From 9f74a1517610881aa1fa2fd3e301692364cb8e5e Mon Sep 17 00:00:00 2001 From: Sabrina Hernandez Date: Sun, 3 Nov 2024 22:22:20 -0600 Subject: [PATCH 001/459] Updated neutron skin process in FlowZDCtask.cxx --- PWGCF/Flow/Tasks/FlowZDCtask.cxx | 96 ++++++++++++++++++++++++++++---- 1 file changed, 85 insertions(+), 11 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowZDCtask.cxx b/PWGCF/Flow/Tasks/FlowZDCtask.cxx index 641ef3cb1e5..fbb6e068cf6 100644 --- a/PWGCF/Flow/Tasks/FlowZDCtask.cxx +++ b/PWGCF/Flow/Tasks/FlowZDCtask.cxx @@ -36,7 +36,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod::mult; -using ColEvSels = soa::Join; +using ColEvSels = soa::Join; using aodCollisions = soa::Filtered>; using aodTracks = soa::Filtered>; using BCsRun3 = soa::Join; @@ -76,7 +76,6 @@ struct FlowZDCtask { ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.30, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.20, 2.40, 2.60, 2.80, 3.00}, "pt axis for histograms"}; ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; - Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); @@ -102,6 +101,13 @@ struct FlowZDCtask { OutputObj ZDC_ZEM_Energy{TProfile("ZDC_ZEM_Energy", "ZDC vs ZEM Energy", 10, 0, 1000)}; OutputObj pCosPsiDifferences{TProfile("pCosPsiDifferences", "Differences in cos(psi) vs Centrality;Centrality;Mean cos(psi) Difference", 200, 0, 100, -1, 1)}; OutputObj pSinPsiDifferences{TProfile("pSinPsiDifferences", "Differences in sin(psi) vs Centrality;Centrality;Mean sin(psi) Difference", 200, 0, 100, -1, 1)}; + OutputObj pZNvsFT0MAmp{TProfile("pZNvsFT0MAmp", "ZN Energy vs FT0M Amplitude", 100, 0, 50000, 0, 500)}; + OutputObj pZPvsFT0MAmp{TProfile("pZPvsFT0MAmp", "ZP Energy vs FT0M Amplitude", 100, 0, 50000, 0, 500)}; + + OutputObj pZNvsFT0Ccent{TProfile("pZNvsFT0Ccent", "ZN Energy vs FT0C Centrality", 100, 0, 100, 0, 50000)}; + OutputObj pZPvsFT0Ccent{TProfile("pZPvsFT0Ccent", "ZP Energy vs FT0C Centrality", 100, 0, 100, 0, 50000)}; + OutputObj pZNratiovscent{TProfile("pZNratiovscent", "Ratio ZNC/ZNA vs FT0C Centrality", 100, 0, 100, 0, 5)}; + OutputObj pZPratiovscent{TProfile("pZPratiovscent", "Ratio ZPC/ZPA vs FT0C Centrality", 100, 0, 100, 0, 5)}; double sumCosPsiDiff = 0.0; // Sum of cos(psiZNC) - cos(psiZNA) int countEvents = 0; // Count of processed events @@ -120,11 +126,11 @@ struct FlowZDCtask { const AxisSpec axisQZNA{100, -1, 1, "Q"}; const AxisSpec axisREQ{100, -1, 1, "real Q"}; const AxisSpec axisIMQ{100, -1, 1, "imag Q"}; - const AxisSpec axisEnergy{100, 0, 50, "energy"}; + const AxisSpec axisEnergy{100, 0, 50000., "energy"}; AxisSpec axisVtxcounts{2, -0.5f, 1.5f, "Vtx info (0=no, 1=yes)"}; AxisSpec axisZvert{120, -30.f, 30.f, "Vtx z (cm)"}; - AxisSpec axisCent{8, 0.f, 100.f, "centrality"}; + AxisSpec axisCent{8, 0.f, 105.f, "centrality"}; AxisSpec axisMult{1000, -0.5f, 1500.5f, "multiplicity"}; AxisSpec axisMultTPC{1000, -0.5f, 1999.5f, "TPCmultiplicity"}; AxisSpec axisCentBins{{0, 5., 10., 20., 30., 40., 50., 60., 70., 80.}, "centrality percentile"}; @@ -152,6 +158,7 @@ struct FlowZDCtask { histos.add("EnergyZNA", "ZNA Sector Energy", kTH1F, {axisEnergy}); histos.add("EnergyZNC", "ZNC Sector Energy", kTH1F, {axisEnergy}); + histos.add("hCentFT0C", "FT0C Centrality Distribution", kTH1F, {{100, 0, 105}}); // for q vector recentering histos.add("revsimag", "revsimag", kTH2F, {axisREQ, axisIMQ}); @@ -179,6 +186,19 @@ struct FlowZDCtask { histos.add("hSinDifferences", "Differences in sin(psi);sin(psiZNC) - sin(psiZNA);Entries", {HistType::kTH1F, {{100, -2, 2}}}); histos.add("CosPsiDifferencesAvg", "Differences in cos(psi);cos(psiZNC) - cos(psiZNA);Entries", {HistType::kTH2F, {{axisCent}, {100, -2, 2}}}); histos.add("ZDC_energy_vs_ZEM", "ZDCvsZEM; ZEM; ZNA+ZNC+ZPA+ZPC", {HistType::kTH2F, {{{nBinsAmp, -0.5, MaxZEM}, {nBinsAmp, -0.5, 2. * MaxZN}}}}); + // common energies information for ZDC + histos.add("ZNCenergy", "ZN energy side c", kTH1F, {axisEnergy}); + histos.add("ZNAenergy", "ZN energy side a", kTH1F, {axisEnergy}); + histos.add("ZPCenergy", "ZP energy side c", kTH1F, {axisEnergy}); + histos.add("ZPAenergy", "ZP energy side a", kTH1F, {axisEnergy}); + histos.add("ZNenergy", "common zn (a + c sides) energy", kTH1F, {axisEnergy}); + histos.add("ZPenergy", "common zp energy (a + c sides)", kTH1F, {axisEnergy}); + histos.add("hFT0CAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 10000000}}); + histos.add("hFT0AAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 10000000}}); + histos.add("hFT0MAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 10000000}}); + histos.add("hMultT0A", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 250000}}); + histos.add("hMultT0C", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 250000}}); + histos.add("hMultT0M", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 250000}}); } } @@ -228,18 +248,47 @@ struct FlowZDCtask { void processZdcCollAssoc( ColEvSels const& cols, BCsRun3 const& /*bcs*/, - aod::Zdcs const& /*zdcs*/) + aod::Zdcs const& /*zdcs*/, + aod::FT0s const& ft0s) { double sumCosPsiDiff = 0.0; // initialize Sum of cosPsiDiff for averaging double sumSinPsiDiff = 0.0; // initialize Sum of cosPsiDiff for averaging int countEvents = 0; // initialize Counter for the number of events processed + double FT0AAmp = 0; + double FT0CAmp = 0; + // init values for ft0 multiplicity + float multFT0A = 0.f; + float multFT0C = 0.f; + float multFT0M = 0.f; + // collision-based event selection for (auto& collision : cols) { const auto& foundBC = collision.foundBC_as(); + multFT0A = collision.multFT0A(); + multFT0C = collision.multFT0C(); + multFT0M = multFT0A + multFT0C; + + histos.fill(HIST("hMultT0A"), multFT0A); + histos.fill(HIST("hMultT0C"), multFT0C); + histos.fill(HIST("hMultT0M"), multFT0M); + if (collision.has_foundFT0()) { + auto ft0 = collision.foundFT0(); + for (auto amplitude : ft0.amplitudeA()) { + FT0AAmp += amplitude; + histos.fill(HIST("hFT0AAmp"), FT0AAmp); + } + for (auto amplitude : ft0.amplitudeC()) { + FT0CAmp += amplitude; + histos.fill(HIST("hFT0CAmp"), FT0CAmp); + } + } + double FT0MAmp = FT0AAmp + FT0CAmp; + histos.fill(HIST("hFT0MAmp"), FT0MAmp); if (foundBC.has_zdc()) { const auto& zdcread = foundBC.zdc(); const auto cent = collision.centFT0C(); + // ZDC data and histogram filling histos.get(HIST("ZNAcoll"))->Fill(zdcread.amplitudeZNA()); histos.get(HIST("ZNCcoll"))->Fill(zdcread.amplitudeZNC()); histos.get(HIST("ZNvsZEMcoll"))->Fill(zdcread.amplitudeZEM1() + zdcread.amplitudeZEM2(), zdcread.amplitudeZNA() + zdcread.amplitudeZNC()); @@ -254,23 +303,47 @@ struct FlowZDCtask { float sumZPA = (zdcread.energySectorZPA())[0] + (zdcread.energySectorZPA())[1] + (zdcread.energySectorZPA())[2] + (zdcread.energySectorZPA())[3]; float sumZDC = sumZPA + sumZPC + sumZNA + sumZNC; float sumZEM = zdcread.amplitudeZEM1() + zdcread.amplitudeZEM2(); + + // common energies + float common_sumZNC = (zdcread.energyCommonZNC()); + float common_sumZNA = (zdcread.energyCommonZNA()); + float common_sumZPC = (zdcread.energyCommonZPC()); + float common_sumZPA = (zdcread.energyCommonZPA()); + float sumZN = (sumZNC) + (sumZNA); + float sumZP = (sumZPC) + (sumZPA); + + histos.fill(HIST("ZNenergy"), sumZN); + histos.fill(HIST("ZPenergy"), sumZP); + histos.fill(HIST("ZNCenergy"), common_sumZNC); + histos.fill(HIST("ZNAenergy"), common_sumZNA); + histos.fill(HIST("ZPAenergy"), common_sumZPA); + histos.fill(HIST("ZPCenergy"), common_sumZPC); + + float ratioZN = sumZNC / sumZNA; + float ratioZP = sumZPC / sumZPA; + pZNratiovscent->Fill(cent, ratioZN); + pZPratiovscent->Fill(cent, ratioZP); + pZNvsFT0Ccent->Fill(cent, sumZN); + pZPvsFT0Ccent->Fill(cent, sumZP); + pZPvsFT0MAmp->Fill(sumZP, FT0MAmp); + pZNvsFT0MAmp->Fill(sumZN, FT0MAmp); + histos.get(HIST("ZDC_energy_vs_ZEM"))->Fill(sumZEM, sumZDC); + // Spectator plane angle calculations and histograms const auto Ntot_ZNA = zdcread.amplitudeZNA(); const auto Ntot_ZNC = zdcread.amplitudeZNC(); - double qZNA_real = 0.0; // Initialize qZNA_real - double qZNA_im = 0.0; // Initialize - double qZNC_real = 0.0; // Initialize qZNC_real - double qZNC_im = 0.0; // Initialize + double qZNA_real = 0.0; + double qZNA_im = 0.0; + double qZNC_real = 0.0; + double qZNC_im = 0.0; const double phiRadians[4] = {45 * TMath::Pi() / 180, 135 * TMath::Pi() / 180, 225 * TMath::Pi() / 180, 315 * TMath::Pi() / 180}; TComplex qZNA(0, 0), qZNC(0, 0); for (int sector = 0; sector < 4; ++sector) { - // energy for current sector for ZNA and ZNC float energyZNA = zdcread.energySectorZNA()[sector]; float energyZNC = zdcread.energySectorZNC()[sector]; - // Calculate q-vector from current sector and add it to the total q-vector qZNA += TComplex(TMath::Cos(2 * phiRadians[sector]) * energyZNA / sumZNA, TMath::Sin(2 * phiRadians[sector]) * energyZNA / sumZNA); qZNC += TComplex(TMath::Cos(2 * phiRadians[sector]) * energyZNC / sumZNC, TMath::Sin(2 * phiRadians[sector]) * energyZNC / sumZNC); } @@ -313,6 +386,7 @@ struct FlowZDCtask { } } } + PROCESS_SWITCH(FlowZDCtask, processZdcCollAssoc, "Processing ZDC w. collision association", true); PROCESS_SWITCH(FlowZDCtask, processQVector, "Process before recentering", true); From d4671f2115f085f31e0f6e25a3806c141845b4bc Mon Sep 17 00:00:00 2001 From: Sabrina Hernandez Date: Wed, 20 Nov 2024 13:16:43 -0600 Subject: [PATCH 002/459] added 2d histos and efficiency factors --- PWGCF/Flow/Tasks/FlowZDCtask.cxx | 47 ++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowZDCtask.cxx b/PWGCF/Flow/Tasks/FlowZDCtask.cxx index fbb6e068cf6..c71141a41fc 100644 --- a/PWGCF/Flow/Tasks/FlowZDCtask.cxx +++ b/PWGCF/Flow/Tasks/FlowZDCtask.cxx @@ -70,12 +70,17 @@ struct FlowZDCtask { Configurable nBinsADC{"nBinsADC", 1000, "nbinsADC"}; Configurable nBinsAmp{"nBinsAmp", 1025, "nbinsAmp"}; Configurable MaxZN{"MaxZN", 4099.5, "Max ZN signal"}; + Configurable acceptnace_ZNA{"acceptnace_ZNA", 0.92, "ZNA acceptance factor"}; + Configurable acceptnace_ZNC{"acceptnace_ZNC", 0.90, "ZNC acceptance factor"}; + Configurable acceptnace_ZPA{"acceptnace_ZPA", 0.52, "ZPA acceptance factor"}; + Configurable acceptnace_ZPC{"acceptnace_ZPC", 0.50, "ZPC acceptance factor"}; ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for histograms"}; ConfigurableAxis axisPhi{"axisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"}; ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.30, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.20, 2.40, 2.60, 2.80, 3.00}, "pt axis for histograms"}; ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; + ConfigurableAxis axisEnergy{"axisEnergy", {100,0,700}, "energy axis for zdc histos"}; Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); @@ -101,11 +106,10 @@ struct FlowZDCtask { OutputObj ZDC_ZEM_Energy{TProfile("ZDC_ZEM_Energy", "ZDC vs ZEM Energy", 10, 0, 1000)}; OutputObj pCosPsiDifferences{TProfile("pCosPsiDifferences", "Differences in cos(psi) vs Centrality;Centrality;Mean cos(psi) Difference", 200, 0, 100, -1, 1)}; OutputObj pSinPsiDifferences{TProfile("pSinPsiDifferences", "Differences in sin(psi) vs Centrality;Centrality;Mean sin(psi) Difference", 200, 0, 100, -1, 1)}; - OutputObj pZNvsFT0MAmp{TProfile("pZNvsFT0MAmp", "ZN Energy vs FT0M Amplitude", 100, 0, 50000, 0, 500)}; - OutputObj pZPvsFT0MAmp{TProfile("pZPvsFT0MAmp", "ZP Energy vs FT0M Amplitude", 100, 0, 50000, 0, 500)}; - - OutputObj pZNvsFT0Ccent{TProfile("pZNvsFT0Ccent", "ZN Energy vs FT0C Centrality", 100, 0, 100, 0, 50000)}; - OutputObj pZPvsFT0Ccent{TProfile("pZPvsFT0Ccent", "ZP Energy vs FT0C Centrality", 100, 0, 100, 0, 50000)}; + OutputObj pZNvsFT0MAmp{TProfile("pZNvsFT0MAmp", "ZN Energy vs FT0M Amplitude", 1025, 0, 1e7, 0, 500)}; + OutputObj pZPvsFT0MAmp{TProfile("pZPvsFT0MAmp", "ZP Energy vs FT0M Amplitude", 1025, 0, 1e7, 0, 500)}; + OutputObj pZNvsFT0Ccent{TProfile("pZNvsFT0Ccent", "ZN Energy vs FT0C Centrality", 100, 0, 100, 0, 500)}; + OutputObj pZPvsFT0Ccent{TProfile("pZPvsFT0Ccent", "ZP Energy vs FT0C Centrality", 100, 0, 100, 0, 500)}; OutputObj pZNratiovscent{TProfile("pZNratiovscent", "Ratio ZNC/ZNA vs FT0C Centrality", 100, 0, 100, 0, 5)}; OutputObj pZPratiovscent{TProfile("pZPratiovscent", "Ratio ZPC/ZPA vs FT0C Centrality", 100, 0, 100, 0, 5)}; @@ -126,7 +130,7 @@ struct FlowZDCtask { const AxisSpec axisQZNA{100, -1, 1, "Q"}; const AxisSpec axisREQ{100, -1, 1, "real Q"}; const AxisSpec axisIMQ{100, -1, 1, "imag Q"}; - const AxisSpec axisEnergy{100, 0, 50000., "energy"}; + AxisSpec axisVtxcounts{2, -0.5f, 1.5f, "Vtx info (0=no, 1=yes)"}; AxisSpec axisZvert{120, -30.f, 30.f, "Vtx z (cm)"}; @@ -159,6 +163,18 @@ struct FlowZDCtask { histos.add("EnergyZNA", "ZNA Sector Energy", kTH1F, {axisEnergy}); histos.add("EnergyZNC", "ZNC Sector Energy", kTH1F, {axisEnergy}); histos.add("hCentFT0C", "FT0C Centrality Distribution", kTH1F, {{100, 0, 105}}); + + histos.add("hZNvsFT0Ccent", + "ZN Energy vs FT0C Centrality;Centrality [%];ZN Energy [TeV]", + kTH2F, + {AxisSpec{100, 0, 100, "Centrality [%]"}, AxisSpec{100, 0, 500, "ZN Energy [TeV]"}} + ); + + histos.add("hZPvsFT0Ccent", + "ZP Energy vs FT0C Centrality;Centrality [%];ZP Energy [TeV]", + kTH2F, + {AxisSpec{100, 0, 100, "Centrality [%]"}, AxisSpec{100, 0, 500, "ZP Energy [TeV]"}} + ); // for q vector recentering histos.add("revsimag", "revsimag", kTH2F, {axisREQ, axisIMQ}); @@ -193,9 +209,9 @@ struct FlowZDCtask { histos.add("ZPAenergy", "ZP energy side a", kTH1F, {axisEnergy}); histos.add("ZNenergy", "common zn (a + c sides) energy", kTH1F, {axisEnergy}); histos.add("ZPenergy", "common zp energy (a + c sides)", kTH1F, {axisEnergy}); - histos.add("hFT0CAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 10000000}}); - histos.add("hFT0AAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 10000000}}); - histos.add("hFT0MAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 10000000}}); + histos.add("hFT0CAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 1e7}}); + histos.add("hFT0AAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 1e7}}); + histos.add("hFT0MAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 1e7}}); histos.add("hMultT0A", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 250000}}); histos.add("hMultT0C", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 250000}}); histos.add("hMultT0M", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 250000}}); @@ -305,11 +321,11 @@ struct FlowZDCtask { float sumZEM = zdcread.amplitudeZEM1() + zdcread.amplitudeZEM2(); // common energies - float common_sumZNC = (zdcread.energyCommonZNC()); - float common_sumZNA = (zdcread.energyCommonZNA()); - float common_sumZPC = (zdcread.energyCommonZPC()); - float common_sumZPA = (zdcread.energyCommonZPA()); - float sumZN = (sumZNC) + (sumZNA); + float common_sumZNC = (zdcread.energyCommonZNC()) / acceptnace_ZNC; + float common_sumZNA = (zdcread.energyCommonZNA()) / acceptnace_ZNA; + float common_sumZPC = (zdcread.energyCommonZPC()) / acceptnace_ZPC; + float common_sumZPA = (zdcread.energyCommonZPA()) / acceptnace_ZPA; + float sumZN = (sumZNC ) + (sumZNA ); float sumZP = (sumZPC) + (sumZPA); histos.fill(HIST("ZNenergy"), sumZN); @@ -318,7 +334,8 @@ struct FlowZDCtask { histos.fill(HIST("ZNAenergy"), common_sumZNA); histos.fill(HIST("ZPAenergy"), common_sumZPA); histos.fill(HIST("ZPCenergy"), common_sumZPC); - + histos.fill(HIST("hZNvsFT0Ccent"), cent, sumZN); + histos.fill(HIST("hZPvsFT0Ccent"), cent, sumZP); float ratioZN = sumZNC / sumZNA; float ratioZP = sumZPC / sumZPA; pZNratiovscent->Fill(cent, ratioZN); From d6f85cc863bf2bfad97ab22d2c8ab3ce651cfce4 Mon Sep 17 00:00:00 2001 From: Sabrina Hernandez Date: Wed, 20 Nov 2024 13:32:51 -0600 Subject: [PATCH 003/459] added 2d histos --- PWGCF/Flow/Tasks/FlowZDCtask.cxx | 36 -------------------------------- 1 file changed, 36 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowZDCtask.cxx b/PWGCF/Flow/Tasks/FlowZDCtask.cxx index 4a89368a88e..c71141a41fc 100644 --- a/PWGCF/Flow/Tasks/FlowZDCtask.cxx +++ b/PWGCF/Flow/Tasks/FlowZDCtask.cxx @@ -80,10 +80,7 @@ struct FlowZDCtask { ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.30, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.20, 2.40, 2.60, 2.80, 3.00}, "pt axis for histograms"}; ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; -<<<<<<< HEAD ConfigurableAxis axisEnergy{"axisEnergy", {100,0,700}, "energy axis for zdc histos"}; -======= ->>>>>>> 9f74a1517610881aa1fa2fd3e301692364cb8e5e Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); @@ -109,18 +106,10 @@ struct FlowZDCtask { OutputObj ZDC_ZEM_Energy{TProfile("ZDC_ZEM_Energy", "ZDC vs ZEM Energy", 10, 0, 1000)}; OutputObj pCosPsiDifferences{TProfile("pCosPsiDifferences", "Differences in cos(psi) vs Centrality;Centrality;Mean cos(psi) Difference", 200, 0, 100, -1, 1)}; OutputObj pSinPsiDifferences{TProfile("pSinPsiDifferences", "Differences in sin(psi) vs Centrality;Centrality;Mean sin(psi) Difference", 200, 0, 100, -1, 1)}; -<<<<<<< HEAD OutputObj pZNvsFT0MAmp{TProfile("pZNvsFT0MAmp", "ZN Energy vs FT0M Amplitude", 1025, 0, 1e7, 0, 500)}; OutputObj pZPvsFT0MAmp{TProfile("pZPvsFT0MAmp", "ZP Energy vs FT0M Amplitude", 1025, 0, 1e7, 0, 500)}; OutputObj pZNvsFT0Ccent{TProfile("pZNvsFT0Ccent", "ZN Energy vs FT0C Centrality", 100, 0, 100, 0, 500)}; OutputObj pZPvsFT0Ccent{TProfile("pZPvsFT0Ccent", "ZP Energy vs FT0C Centrality", 100, 0, 100, 0, 500)}; -======= - OutputObj pZNvsFT0MAmp{TProfile("pZNvsFT0MAmp", "ZN Energy vs FT0M Amplitude", 100, 0, 50000, 0, 500)}; - OutputObj pZPvsFT0MAmp{TProfile("pZPvsFT0MAmp", "ZP Energy vs FT0M Amplitude", 100, 0, 50000, 0, 500)}; - - OutputObj pZNvsFT0Ccent{TProfile("pZNvsFT0Ccent", "ZN Energy vs FT0C Centrality", 100, 0, 100, 0, 50000)}; - OutputObj pZPvsFT0Ccent{TProfile("pZPvsFT0Ccent", "ZP Energy vs FT0C Centrality", 100, 0, 100, 0, 50000)}; ->>>>>>> 9f74a1517610881aa1fa2fd3e301692364cb8e5e OutputObj pZNratiovscent{TProfile("pZNratiovscent", "Ratio ZNC/ZNA vs FT0C Centrality", 100, 0, 100, 0, 5)}; OutputObj pZPratiovscent{TProfile("pZPratiovscent", "Ratio ZPC/ZPA vs FT0C Centrality", 100, 0, 100, 0, 5)}; @@ -141,11 +130,7 @@ struct FlowZDCtask { const AxisSpec axisQZNA{100, -1, 1, "Q"}; const AxisSpec axisREQ{100, -1, 1, "real Q"}; const AxisSpec axisIMQ{100, -1, 1, "imag Q"}; -<<<<<<< HEAD -======= - const AxisSpec axisEnergy{100, 0, 50000., "energy"}; ->>>>>>> 9f74a1517610881aa1fa2fd3e301692364cb8e5e AxisSpec axisVtxcounts{2, -0.5f, 1.5f, "Vtx info (0=no, 1=yes)"}; AxisSpec axisZvert{120, -30.f, 30.f, "Vtx z (cm)"}; @@ -178,7 +163,6 @@ struct FlowZDCtask { histos.add("EnergyZNA", "ZNA Sector Energy", kTH1F, {axisEnergy}); histos.add("EnergyZNC", "ZNC Sector Energy", kTH1F, {axisEnergy}); histos.add("hCentFT0C", "FT0C Centrality Distribution", kTH1F, {{100, 0, 105}}); -<<<<<<< HEAD histos.add("hZNvsFT0Ccent", "ZN Energy vs FT0C Centrality;Centrality [%];ZN Energy [TeV]", @@ -191,8 +175,6 @@ struct FlowZDCtask { kTH2F, {AxisSpec{100, 0, 100, "Centrality [%]"}, AxisSpec{100, 0, 500, "ZP Energy [TeV]"}} ); -======= ->>>>>>> 9f74a1517610881aa1fa2fd3e301692364cb8e5e // for q vector recentering histos.add("revsimag", "revsimag", kTH2F, {axisREQ, axisIMQ}); @@ -227,15 +209,9 @@ struct FlowZDCtask { histos.add("ZPAenergy", "ZP energy side a", kTH1F, {axisEnergy}); histos.add("ZNenergy", "common zn (a + c sides) energy", kTH1F, {axisEnergy}); histos.add("ZPenergy", "common zp energy (a + c sides)", kTH1F, {axisEnergy}); -<<<<<<< HEAD histos.add("hFT0CAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 1e7}}); histos.add("hFT0AAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 1e7}}); histos.add("hFT0MAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 1e7}}); -======= - histos.add("hFT0CAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 10000000}}); - histos.add("hFT0AAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 10000000}}); - histos.add("hFT0MAmp", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 10000000}}); ->>>>>>> 9f74a1517610881aa1fa2fd3e301692364cb8e5e histos.add("hMultT0A", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 250000}}); histos.add("hMultT0C", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 250000}}); histos.add("hMultT0M", ";Amplitude;counts", kTH1F, {{nBinsAmp, 0, 250000}}); @@ -345,19 +321,11 @@ struct FlowZDCtask { float sumZEM = zdcread.amplitudeZEM1() + zdcread.amplitudeZEM2(); // common energies -<<<<<<< HEAD float common_sumZNC = (zdcread.energyCommonZNC()) / acceptnace_ZNC; float common_sumZNA = (zdcread.energyCommonZNA()) / acceptnace_ZNA; float common_sumZPC = (zdcread.energyCommonZPC()) / acceptnace_ZPC; float common_sumZPA = (zdcread.energyCommonZPA()) / acceptnace_ZPA; float sumZN = (sumZNC ) + (sumZNA ); -======= - float common_sumZNC = (zdcread.energyCommonZNC()); - float common_sumZNA = (zdcread.energyCommonZNA()); - float common_sumZPC = (zdcread.energyCommonZPC()); - float common_sumZPA = (zdcread.energyCommonZPA()); - float sumZN = (sumZNC) + (sumZNA); ->>>>>>> 9f74a1517610881aa1fa2fd3e301692364cb8e5e float sumZP = (sumZPC) + (sumZPA); histos.fill(HIST("ZNenergy"), sumZN); @@ -366,12 +334,8 @@ struct FlowZDCtask { histos.fill(HIST("ZNAenergy"), common_sumZNA); histos.fill(HIST("ZPAenergy"), common_sumZPA); histos.fill(HIST("ZPCenergy"), common_sumZPC); -<<<<<<< HEAD histos.fill(HIST("hZNvsFT0Ccent"), cent, sumZN); histos.fill(HIST("hZPvsFT0Ccent"), cent, sumZP); -======= - ->>>>>>> 9f74a1517610881aa1fa2fd3e301692364cb8e5e float ratioZN = sumZNC / sumZNA; float ratioZP = sumZPC / sumZPA; pZNratiovscent->Fill(cent, ratioZN); From 4d548f3c8b38cde644bc4753f1e8bcd7a3892ebc Mon Sep 17 00:00:00 2001 From: Sabrina Hernandez Date: Wed, 20 Nov 2024 13:46:33 -0600 Subject: [PATCH 004/459] fixing whitespace --- PWGCF/Flow/Tasks/FlowZDCtask.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGCF/Flow/Tasks/FlowZDCtask.cxx b/PWGCF/Flow/Tasks/FlowZDCtask.cxx index c71141a41fc..68df7323fe0 100644 --- a/PWGCF/Flow/Tasks/FlowZDCtask.cxx +++ b/PWGCF/Flow/Tasks/FlowZDCtask.cxx @@ -163,7 +163,6 @@ struct FlowZDCtask { histos.add("EnergyZNA", "ZNA Sector Energy", kTH1F, {axisEnergy}); histos.add("EnergyZNC", "ZNC Sector Energy", kTH1F, {axisEnergy}); histos.add("hCentFT0C", "FT0C Centrality Distribution", kTH1F, {{100, 0, 105}}); - histos.add("hZNvsFT0Ccent", "ZN Energy vs FT0C Centrality;Centrality [%];ZN Energy [TeV]", kTH2F, From c07eadc949745246c37e7572dbc13ebccd4acb4f Mon Sep 17 00:00:00 2001 From: Sabrina Hernandez Date: Wed, 20 Nov 2024 13:51:06 -0600 Subject: [PATCH 005/459] fix clang format --- PWGCF/Flow/Tasks/FlowZDCtask.cxx | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowZDCtask.cxx b/PWGCF/Flow/Tasks/FlowZDCtask.cxx index 68df7323fe0..14377a20a91 100644 --- a/PWGCF/Flow/Tasks/FlowZDCtask.cxx +++ b/PWGCF/Flow/Tasks/FlowZDCtask.cxx @@ -80,9 +80,9 @@ struct FlowZDCtask { ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.30, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.20, 2.40, 2.60, 2.80, 3.00}, "pt axis for histograms"}; ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; - ConfigurableAxis axisEnergy{"axisEnergy", {100,0,700}, "energy axis for zdc histos"}; + ConfigurableAxis axisEnergy{"axisEnergy", {100, 0, 700}, "energy axis for zdc histos"}; Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; - Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); Partition tracksIUWithTPC = (aod::track::tpcNClsFindable > (uint8_t)0); @@ -131,7 +131,6 @@ struct FlowZDCtask { const AxisSpec axisREQ{100, -1, 1, "real Q"}; const AxisSpec axisIMQ{100, -1, 1, "imag Q"}; - AxisSpec axisVtxcounts{2, -0.5f, 1.5f, "Vtx info (0=no, 1=yes)"}; AxisSpec axisZvert{120, -30.f, 30.f, "Vtx z (cm)"}; AxisSpec axisCent{8, 0.f, 105.f, "centrality"}; @@ -164,16 +163,14 @@ struct FlowZDCtask { histos.add("EnergyZNC", "ZNC Sector Energy", kTH1F, {axisEnergy}); histos.add("hCentFT0C", "FT0C Centrality Distribution", kTH1F, {{100, 0, 105}}); histos.add("hZNvsFT0Ccent", - "ZN Energy vs FT0C Centrality;Centrality [%];ZN Energy [TeV]", - kTH2F, - {AxisSpec{100, 0, 100, "Centrality [%]"}, AxisSpec{100, 0, 500, "ZN Energy [TeV]"}} - ); + "ZN Energy vs FT0C Centrality;Centrality [%];ZN Energy [TeV]", + kTH2F, + {AxisSpec{100, 0, 100, "Centrality [%]"}, AxisSpec{100, 0, 500, "ZN Energy [TeV]"}}); histos.add("hZPvsFT0Ccent", - "ZP Energy vs FT0C Centrality;Centrality [%];ZP Energy [TeV]", - kTH2F, - {AxisSpec{100, 0, 100, "Centrality [%]"}, AxisSpec{100, 0, 500, "ZP Energy [TeV]"}} - ); + "ZP Energy vs FT0C Centrality;Centrality [%];ZP Energy [TeV]", + kTH2F, + {AxisSpec{100, 0, 100, "Centrality [%]"}, AxisSpec{100, 0, 500, "ZP Energy [TeV]"}}); // for q vector recentering histos.add("revsimag", "revsimag", kTH2F, {axisREQ, axisIMQ}); @@ -324,7 +321,7 @@ struct FlowZDCtask { float common_sumZNA = (zdcread.energyCommonZNA()) / acceptnace_ZNA; float common_sumZPC = (zdcread.energyCommonZPC()) / acceptnace_ZPC; float common_sumZPA = (zdcread.energyCommonZPA()) / acceptnace_ZPA; - float sumZN = (sumZNC ) + (sumZNA ); + float sumZN = (sumZNC) + (sumZNA); float sumZP = (sumZPC) + (sumZPA); histos.fill(HIST("ZNenergy"), sumZN); From ad2f839f665e0d8d21b9a474ebe56a9daceefebc Mon Sep 17 00:00:00 2001 From: Sabrina Hernandez Date: Wed, 20 Nov 2024 13:53:37 -0600 Subject: [PATCH 006/459] fix clang formatting --- PWGCF/Flow/Tasks/FlowZDCtask.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowZDCtask.cxx b/PWGCF/Flow/Tasks/FlowZDCtask.cxx index 14377a20a91..c0a5f84210b 100644 --- a/PWGCF/Flow/Tasks/FlowZDCtask.cxx +++ b/PWGCF/Flow/Tasks/FlowZDCtask.cxx @@ -82,8 +82,7 @@ struct FlowZDCtask { ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; ConfigurableAxis axisEnergy{"axisEnergy", {100, 0, 700}, "energy axis for zdc histos"}; Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; - Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); - + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); Partition tracksIUWithTPC = (aod::track::tpcNClsFindable > (uint8_t)0); TComplex qTPC; // init q TPC From 5a10f74d5825a72ba15a91ac536d56f97fe492e5 Mon Sep 17 00:00:00 2001 From: JiangTao-thu <56904131+JiangTao-thu@users.noreply.github.com> Date: Thu, 21 Nov 2024 04:05:59 +0800 Subject: [PATCH 007/459] [PWGCF] Add some selections to pt-effeciency code (#8529) --- PWGCF/Flow/Tasks/flowPtEfficiency.cxx | 71 +++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowPtEfficiency.cxx b/PWGCF/Flow/Tasks/flowPtEfficiency.cxx index 43a6eff399d..874f0c3d2df 100644 --- a/PWGCF/Flow/Tasks/flowPtEfficiency.cxx +++ b/PWGCF/Flow/Tasks/flowPtEfficiency.cxx @@ -14,11 +14,15 @@ /// \author everyone #include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" #include "Framework/ASoAHelpers.h" #include "Framework/HistogramRegistry.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" using namespace o2; using namespace o2::framework; @@ -32,18 +36,38 @@ struct flowPtEfficiency { O2_DEFINE_CONFIGURABLE(cfgCutPtMin, float, 0.2f, "Minimal pT for tracks") O2_DEFINE_CONFIGURABLE(cfgCutPtMax, float, 3.0f, "Maximal pT for tracks") O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "Eta range for tracks") + O2_DEFINE_CONFIGURABLE(cfgTrkSelRun3ITSMatch, bool, false, "GlobalTrackRun3ITSMatching::Run3ITSall7Layers selection") + O2_DEFINE_CONFIGURABLE(cfgCutChi2prTPCcls, float, 2.5f, "max chi2 per TPC clusters") + O2_DEFINE_CONFIGURABLE(cfgCutTPCclu, float, 70.0f, "minimum TPC clusters") + O2_DEFINE_CONFIGURABLE(cfgCutTPCcrossedrows, float, 70.0f, "minimum TPC crossed rows") O2_DEFINE_CONFIGURABLE(cfgCutDCAxy, float, 0.2f, "DCAxy cut for tracks") + O2_DEFINE_CONFIGURABLE(cfgCutDCAz, float, 2.0f, "DCAz cut for tracks") + O2_DEFINE_CONFIGURABLE(cfgCutDCAxyppPass3Enabled, bool, false, "switch of ppPass3 DCAxy pt dependent cut") + O2_DEFINE_CONFIGURABLE(cfgCutDCAzPtDepEnabled, bool, false, "switch of DCAz pt dependent cut") + O2_DEFINE_CONFIGURABLE(cfgSelRunNumberEnabled, bool, false, "switch of run number selection") + Configurable> cfgRunNumberList{"cfgRunNumberList", std::vector{-1}, "runnumber list in consideration for analysis"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.30, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.20, 2.40, 2.60, 2.80, 3.00}, "pt axis for histograms"}; // Filter the tracks - Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && (nabs(aod::track::dcaXY) < cfgCutDCAxy); + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); using myTracks = soa::Filtered>; + // Filter for collisions + Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; + using myCollisions = soa::Filtered>; + // Filter for MCParticle Filter particleFilter = (nabs(aod::mcparticle::eta) < cfgCutEta) && (aod::mcparticle::pt > cfgCutPtMin) && (aod::mcparticle::pt < cfgCutPtMax); using myMcParticles = soa::Filtered; + // Filter for MCcollisions + Filter mccollisionFilter = nabs(aod::mccollision::posZ) < cfgCutVertex; + using myMcCollisions = soa::Filtered; + + // Additional filters for tracks + TrackSelection myTrackSel; + // Define the output HistogramRegistry registry{"registry"}; @@ -71,13 +95,46 @@ struct flowPtEfficiency { registry.add("mcEventCounter", "Monte Carlo Truth EventCounter", kTH1F, {axisCounter}); registry.add("hPtMCGen", "Monte Carlo Truth", {HistType::kTH1D, {axisPt}}); + + if (cfgTrkSelRun3ITSMatch) { + myTrackSel = getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers, TrackSelection::GlobalTrackRun3DCAxyCut::Default); + } else { + myTrackSel = getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::Default); + } + if (cfgCutDCAxyppPass3Enabled) { + myTrackSel.SetMaxDcaXYPtDep([](float pt) { return 0.004f + 0.013f / pt; }); + } else { + myTrackSel.SetMaxDcaXY(cfgCutDCAxy); + } + myTrackSel.SetMinNClustersTPC(cfgCutTPCclu); + myTrackSel.SetMinNCrossedRowsTPC(cfgCutTPCcrossedrows); + if (!cfgCutDCAzPtDepEnabled) + myTrackSel.SetMaxDcaZ(cfgCutDCAz); } - void processReco(o2::aod::Collision const&, myTracks const& tracks, aod::McParticles const&) + template + bool trackSelected(TTrack track) + { + if (cfgCutDCAzPtDepEnabled && (track.dcaZ() > (0.004f + 0.013f / track.pt()))) + return false; + return myTrackSel.IsSelected(track); + } + + void processReco(myCollisions::iterator const& collision, aod::BCsWithTimestamps const&, myTracks const& tracks, aod::McParticles const&) { registry.fill(HIST("eventCounter"), 0.5); + if (!collision.sel8()) + return; + if (tracks.size() < 1) + return; + if (cfgSelRunNumberEnabled) { + auto bc = collision.bc_as(); + int RunNumber = bc.runNumber(); + if (!std::count(cfgRunNumberList.value.begin(), cfgRunNumberList.value.end(), RunNumber)) + return; + } for (const auto& track : tracks) { - if (track.tpcNClsCrossedRows() < 70) + if (!trackSelected(track)) continue; if (track.has_mcParticle()) { auto mcParticle = track.mcParticle(); @@ -89,8 +146,14 @@ struct flowPtEfficiency { } PROCESS_SWITCH(flowPtEfficiency, processReco, "process reconstructed information", true); - void processSim(aod::McCollision const&, soa::SmallGroups> const& collisions, myMcParticles const& mcParticles) + void processSim(myMcCollisions::iterator const& collision, aod::BCsWithTimestamps const&, soa::SmallGroups> const& collisions, myMcParticles const& mcParticles) { + if (cfgSelRunNumberEnabled) { + auto bc = collision.bc_as(); + int RunNumber = bc.runNumber(); + if (!std::count(cfgRunNumberList.value.begin(), cfgRunNumberList.value.end(), RunNumber)) + return; + } if (collisions.size() > -1) { registry.fill(HIST("mcEventCounter"), 0.5); for (const auto& mcParticle : mcParticles) { From fa8f20ab873d064ad834f8a8684f4df781a754be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 20 Nov 2024 21:14:15 +0100 Subject: [PATCH 008/459] [PWGHF] Add self-contained derived-data format for B+ (#8485) Co-authored-by: ALICE Builder --- PWGHF/D2H/Tasks/taskBplus.cxx | 4 +- PWGHF/DataModel/DerivedTables.h | 352 +++++++++-- PWGHF/TableProducer/CMakeLists.txt | 5 + PWGHF/TableProducer/candidateCreatorBplus.cxx | 27 +- .../derivedDataCreatorBplusToD0Pi.cxx | 557 ++++++++++++++++++ .../derivedDataCreatorD0ToKPi.cxx | 83 ++- .../derivedDataCreatorLcToPKPi.cxx | 18 +- PWGHF/Utils/utilsDerivedData.h | 42 ++ PWGHF/Utils/utilsPid.h | 17 +- 9 files changed, 974 insertions(+), 131 deletions(-) create mode 100644 PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx create mode 100644 PWGHF/Utils/utilsDerivedData.h diff --git a/PWGHF/D2H/Tasks/taskBplus.cxx b/PWGHF/D2H/Tasks/taskBplus.cxx index 9586ebaa424..b98a2930258 100644 --- a/PWGHF/D2H/Tasks/taskBplus.cxx +++ b/PWGHF/D2H/Tasks/taskBplus.cxx @@ -18,6 +18,8 @@ /// \author Antonio Palasciano , Università degli Studi di Bari & INFN, Sezione di Bari /// \author Deepa Thomas , UT Austin +#include + #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" @@ -263,7 +265,7 @@ struct HfTaskBplus { float ptProngs[2], yProngs[2], etaProngs[2]; int counter = 0; - for (const auto& daught : particle.daughters_as()) { + for (const auto& daught : particle.daughters_as>()) { ptProngs[counter] = daught.pt(); etaProngs[counter] = daught.eta(); yProngs[counter] = RecoDecay::y(daught.pVector(), pdg->Mass(daught.pdgCode())); diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 62c7a9cd15c..88f570b47c0 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -28,8 +28,20 @@ namespace o2::aod { -constexpr uint MarkerD0 = 10; -constexpr uint Marker3P = 20; +// basic species: +// D0 -> K- + pi+ (done) +// Lc -> pi+ K- p (existing 3P table to be renamed Lc) +// D+ -> K- + pi+ + pi+ (3P table with adapted PID columns) +// Ds+ -> K- + K+ + pi+ (3P table with adapted PID columns) +// composite species +// B0 -> D- + pi+ +// B+ -> D0 + pi+ (in progress) +// D*+ -> D0 + pi+ +constexpr uint MarkerBase = 2; +constexpr uint MarkerD0 = 3; +constexpr uint Marker3P = 4; +constexpr uint MarkerBplus = 5; +constexpr uint MarkerB0 = 6; // ================ // Collision tables @@ -38,17 +50,40 @@ constexpr uint Marker3P = 20; // Basic collision properties namespace hf_coll_base { -DECLARE_SOA_COLUMN(IsEventReject, isEventReject, int8_t); //! collision rejection flag -DECLARE_SOA_COLUMN(MultFT0M, multFT0M, float); //! FT0M multiplicity -DECLARE_SOA_COLUMN(CentFT0A, centFT0A, float); //! FT0A centrality percentile -DECLARE_SOA_COLUMN(CentFT0C, centFT0C, float); //! FT0C centrality percentile -DECLARE_SOA_COLUMN(CentFT0M, centFT0M, float); //! FT0M centrality percentile -DECLARE_SOA_COLUMN(CentFV0A, centFV0A, float); //! FT0A centrality percentile -DECLARE_SOA_COLUMN(CentFDDM, centFDDM, float); //! FDDM centrality percentile +DECLARE_SOA_COLUMN(IsEventReject, isEventReject, int8_t); //! collision rejection flag +DECLARE_SOA_COLUMN(MultFT0M, multFT0M, float); //! FT0M multiplicity +DECLARE_SOA_COLUMN(CentFT0A, centFT0A, float); //! FT0A centrality percentile +DECLARE_SOA_COLUMN(CentFT0C, centFT0C, float); //! FT0C centrality percentile +DECLARE_SOA_COLUMN(CentFT0M, centFT0M, float); //! FT0M centrality percentile +DECLARE_SOA_COLUMN(CentFV0A, centFV0A, float); //! FV0A centrality percentile +DECLARE_SOA_COLUMN(CentFDDM, centFDDM, float); //! FDDM centrality percentile DECLARE_SOA_COLUMN(MultZeqNTracksPV, multZeqNTracksPV, float); //! z-equalised barrel multiplicity } // namespace hf_coll_base -// D0 +// base + +DECLARE_SOA_TABLE_STAGED(HfCollBases, "HFCOLLBASE", //! Table with basic collision info + o2::soa::Index<>, + collision::PosX, + collision::PosY, + collision::PosZ, + collision::NumContrib, + hf_coll_base::CentFT0A, + hf_coll_base::CentFT0C, + hf_coll_base::CentFT0M, + hf_coll_base::CentFV0A, + hf_coll_base::MultZeqNTracksPV, + // hf_coll_base::IsEventReject, + // bc::RunNumber, + o2::soa::Marker); + +using HfCollBase = HfCollBases::iterator; + +DECLARE_SOA_TABLE_STAGED(HfCollIds, "HFCOLLID", //! Table with original global indices of collisions + hf_cand::CollisionId, + o2::soa::Marker); + +// D0 (to be replaced by base version) DECLARE_SOA_TABLE_STAGED(HfD0CollBases, "HFD0COLLBASE", //! Table with basic collision info o2::soa::Index<>, @@ -62,16 +97,17 @@ DECLARE_SOA_TABLE_STAGED(HfD0CollBases, "HFD0COLLBASE", //! Table with basic col hf_coll_base::CentFV0A, hf_coll_base::MultZeqNTracksPV, // hf_coll_base::IsEventReject, - // bc::RunNumber); - soa::Marker); + // bc::RunNumber, + o2::soa::Marker); using HfD0CollBase = HfD0CollBases::iterator; using StoredHfD0CollBase = StoredHfD0CollBases::iterator; DECLARE_SOA_TABLE_STAGED(HfD0CollIds, "HFD0COLLID", //! Table with original global indices of collisions - hf_cand::CollisionId); + hf_cand::CollisionId, + o2::soa::Marker); -// 3-prong decays +// 3-prong decays (to be replaced by base version) DECLARE_SOA_TABLE_STAGED(Hf3PCollBases, "HF3PCOLLBASE", //! Table with basic collision info o2::soa::Index<>, @@ -93,7 +129,7 @@ using StoredHf3PCollBase = StoredHf3PCollBases::iterator; DECLARE_SOA_TABLE_STAGED(Hf3PCollIds, "HF3PCOLLID", //! Table with original global indices of collisions hf_cand::CollisionId, - soa::Marker); + o2::soa::Marker); // =================== // MC collision tables @@ -102,7 +138,8 @@ DECLARE_SOA_TABLE_STAGED(Hf3PCollIds, "HF3PCOLLID", //! Table with original glob // MC collision columns namespace hf_mc_coll { -DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! original global index of the MC collision +DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! original global index of the MC collision +DECLARE_SOA_ARRAY_INDEX_COLUMN(HfCollBase, hfCollBases); //! collision index array pointing to the derived reconstructed collisions for D0 candidates namespace der_d0 { DECLARE_SOA_ARRAY_INDEX_COLUMN(HfD0CollBase, hfCollBases); //! collision index array pointing to the derived reconstructed collisions for D0 candidates @@ -113,21 +150,39 @@ DECLARE_SOA_ARRAY_INDEX_COLUMN(Hf3PCollBase, hfCollBases); //! collision index a } } // namespace hf_mc_coll -// DO +// base + +DECLARE_SOA_TABLE_STAGED(HfMcCollBases, "HFMCCOLLBASE", //! Table with basic MC collision info + o2::soa::Index<>, + mccollision::PosX, + mccollision::PosY, + mccollision::PosZ, + o2::soa::Marker); + +using HfMcCollBase = HfMcCollBases::iterator; + +DECLARE_SOA_TABLE_STAGED(HfMcCollIds, "HFMCCOLLID", //! Table with original global indices of MC collisions + hf_mc_coll::McCollisionId, + o2::soa::Marker); + +DECLARE_SOA_TABLE_STAGED(HfMcRCollIds, "HFMCRCOLLID", //! Table with indices pointing to the derived reconstructed-collision table + hf_mc_coll::HfCollBaseIds); + +// D0 DECLARE_SOA_TABLE_STAGED(HfD0McCollBases, "HFD0MCCOLLBASE", //! Table with basic MC collision info o2::soa::Index<>, mccollision::PosX, mccollision::PosY, mccollision::PosZ, - soa::Marker); + o2::soa::Marker); using HfD0McCollBase = HfD0McCollBases::iterator; using StoredHfD0McCollBase = StoredHfD0McCollBases::iterator; DECLARE_SOA_TABLE_STAGED(HfD0McCollIds, "HFD0MCCOLLID", //! Table with original global indices of MC collisions hf_mc_coll::McCollisionId, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfD0McRCollIds, "HFD0MCRCOLLID", //! Table with indices pointing to the derived reconstructed-collision table hf_mc_coll::der_d0::HfD0CollBaseIds); @@ -139,14 +194,14 @@ DECLARE_SOA_TABLE_STAGED(Hf3PMcCollBases, "HF3PMCCOLLBASE", //! Table with basic mccollision::PosX, mccollision::PosY, mccollision::PosZ, - soa::Marker); + o2::soa::Marker); using Hf3PMcCollBase = Hf3PMcCollBases::iterator; using StoredHf3PMcCollBase = StoredHf3PMcCollBases::iterator; DECLARE_SOA_TABLE_STAGED(Hf3PMcCollIds, "HF3PMCCOLLID", //! Table with original global indices of MC collisions hf_mc_coll::McCollisionId, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(Hf3PMcRCollIds, "HF3PMCRCOLLID", //! Table with indices pointing to the derived reconstructed-collision table hf_mc_coll::der_3p::Hf3PCollBaseIds); @@ -162,6 +217,10 @@ namespace der_d0 { DECLARE_SOA_INDEX_COLUMN(HfD0CollBase, hfCollBase); //! collision index pointing to the derived collision table for D0 candidates } +namespace der_bplus +{ +DECLARE_SOA_INDEX_COLUMN(HfCollBase, hfCollBase); //! collision index pointing to the derived collision table for B+ candidates +} namespace der_3p { DECLARE_SOA_INDEX_COLUMN(Hf3PCollBase, hfCollBase); //! collision index pointing to the derived collision table for 3-prong candidates @@ -248,6 +307,77 @@ DECLARE_SOA_COLUMN(NSigTpcTofPr1, nSigTpcTofPr1, float); DECLARE_SOA_COLUMN(NSigTpcTofPr2, nSigTpcTofPr2, float); } // namespace hf_cand_par +// Candidate properties of the charm daughter candidate used for selection of the beauty candidate +// Copy of hf_cand_par with "Charm" suffix to make it joinable with the beauty candidate table. +// We don't want to link the charm candidate table because we want to avoid producing it. +namespace hf_cand_par_charm +{ +DECLARE_SOA_COLUMN(CosThetaStarCharm, cosThetaStarCharm, float); //! cosine of theta star +DECLARE_SOA_COLUMN(CpaCharm, cpaCharm, float); //! cosine of pointing angle +DECLARE_SOA_COLUMN(CpaXYCharm, cpaXYCharm, float); //! cosine of pointing angle in the transverse plane +DECLARE_SOA_COLUMN(CtCharm, ctCharm, float); //! proper lifetime times c +DECLARE_SOA_COLUMN(DecayLengthCharm, decayLengthCharm, float); //! decay length +DECLARE_SOA_COLUMN(DecayLengthNormalisedCharm, decayLengthNormalisedCharm, float); //! decay length divided by its uncertainty +DECLARE_SOA_COLUMN(DecayLengthXYCharm, decayLengthXYCharm, float); //! decay length in the transverse plane +DECLARE_SOA_COLUMN(DecayLengthXYNormalisedCharm, decayLengthXYNormalisedCharm, float); //! decay length in the transverse plane divided by its uncertainty +DECLARE_SOA_COLUMN(ImpactParameter0Charm, impactParameter0Charm, float); //! impact parameter of prong 0 +DECLARE_SOA_COLUMN(ImpactParameter1Charm, impactParameter1Charm, float); //! impact parameter of prong 1 +DECLARE_SOA_COLUMN(ImpactParameterNormalised0Charm, impactParameterNormalised0Charm, float); //! impact parameter of prong 0 divided by its uncertainty +DECLARE_SOA_COLUMN(ImpactParameterNormalised1Charm, impactParameterNormalised1Charm, float); //! impact parameter of prong 1 divided by its uncertainty +DECLARE_SOA_COLUMN(ImpactParameterNormalised2Charm, impactParameterNormalised2Charm, float); //! impact parameter of prong 2 divided by its uncertainty +DECLARE_SOA_COLUMN(ImpactParameterProductCharm, impactParameterProductCharm, float); //! product of impact parameters of prong 0 and prong 1 +DECLARE_SOA_COLUMN(MaxNormalisedDeltaIPCharm, maxNormalisedDeltaIPCharm, float); //! see RecoDecay::maxNormalisedDeltaIP +DECLARE_SOA_COLUMN(PProng0Charm, pProng0Charm, float); //! momentum magnitude of prong 0 +DECLARE_SOA_COLUMN(PProng1Charm, pProng1Charm, float); //! momentum magnitude of prong 1 +DECLARE_SOA_COLUMN(PProng2Charm, pProng2Charm, float); //! momentum magnitude of prong 2 +DECLARE_SOA_COLUMN(PtProng0Charm, ptProng0Charm, float); //! transverse momentum of prong 0 +DECLARE_SOA_COLUMN(PtProng1Charm, ptProng1Charm, float); //! transverse momentum of prong 1 +DECLARE_SOA_COLUMN(PtProng2Charm, ptProng2Charm, float); //! transverse momentum of prong 2 +DECLARE_SOA_COLUMN(RSecondaryVertexCharm, rSecondaryVertexCharm, float); //! distance of the secondary vertex from the z axis +// TOF +DECLARE_SOA_COLUMN(NSigTofKa0Charm, nSigTofKa0Charm, float); +DECLARE_SOA_COLUMN(NSigTofKa1Charm, nSigTofKa1Charm, float); +DECLARE_SOA_COLUMN(NSigTofKa2Charm, nSigTofKa2Charm, float); +DECLARE_SOA_COLUMN(NSigTofKaExpPiCharm, nSigTofKaExpPiCharm, float); +DECLARE_SOA_COLUMN(NSigTofKaExpKaCharm, nSigTofKaExpKaCharm, float); +DECLARE_SOA_COLUMN(NSigTofPi0Charm, nSigTofPi0Charm, float); +DECLARE_SOA_COLUMN(NSigTofPi1Charm, nSigTofPi1Charm, float); +DECLARE_SOA_COLUMN(NSigTofPi2Charm, nSigTofPi2Charm, float); +DECLARE_SOA_COLUMN(NSigTofPiExpPiCharm, nSigTofPiExpPiCharm, float); +DECLARE_SOA_COLUMN(NSigTofPiExpKaCharm, nSigTofPiExpKaCharm, float); +DECLARE_SOA_COLUMN(NSigTofPr0Charm, nSigTofPr0Charm, float); +DECLARE_SOA_COLUMN(NSigTofPr1Charm, nSigTofPr1Charm, float); +DECLARE_SOA_COLUMN(NSigTofPr2Charm, nSigTofPr2Charm, float); +// TPC +DECLARE_SOA_COLUMN(NSigTpcKa0Charm, nSigTpcKa0Charm, float); +DECLARE_SOA_COLUMN(NSigTpcKa1Charm, nSigTpcKa1Charm, float); +DECLARE_SOA_COLUMN(NSigTpcKa2Charm, nSigTpcKa2Charm, float); +DECLARE_SOA_COLUMN(NSigTpcKaExpPiCharm, nSigTpcKaExpPiCharm, float); +DECLARE_SOA_COLUMN(NSigTpcKaExpKaCharm, nSigTpcKaExpKaCharm, float); +DECLARE_SOA_COLUMN(NSigTpcPi0Charm, nSigTpcPi0Charm, float); +DECLARE_SOA_COLUMN(NSigTpcPi1Charm, nSigTpcPi1Charm, float); +DECLARE_SOA_COLUMN(NSigTpcPi2Charm, nSigTpcPi2Charm, float); +DECLARE_SOA_COLUMN(NSigTpcPiExpPiCharm, nSigTpcPiExpPiCharm, float); +DECLARE_SOA_COLUMN(NSigTpcPiExpKaCharm, nSigTpcPiExpKaCharm, float); +DECLARE_SOA_COLUMN(NSigTpcPr0Charm, nSigTpcPr0Charm, float); +DECLARE_SOA_COLUMN(NSigTpcPr1Charm, nSigTpcPr1Charm, float); +DECLARE_SOA_COLUMN(NSigTpcPr2Charm, nSigTpcPr2Charm, float); +// TPC+TOF +DECLARE_SOA_COLUMN(NSigTpcTofKa0Charm, nSigTpcTofKa0Charm, float); +DECLARE_SOA_COLUMN(NSigTpcTofKa1Charm, nSigTpcTofKa1Charm, float); +DECLARE_SOA_COLUMN(NSigTpcTofKa2Charm, nSigTpcTofKa2Charm, float); +DECLARE_SOA_COLUMN(NSigTpcTofKaExpPiCharm, nSigTpcTofKaExpPiCharm, float); +DECLARE_SOA_COLUMN(NSigTpcTofKaExpKaCharm, nSigTpcTofKaExpKaCharm, float); +DECLARE_SOA_COLUMN(NSigTpcTofPi0Charm, nSigTpcTofPi0Charm, float); +DECLARE_SOA_COLUMN(NSigTpcTofPi1Charm, nSigTpcTofPi1Charm, float); +DECLARE_SOA_COLUMN(NSigTpcTofPi2Charm, nSigTpcTofPi2Charm, float); +DECLARE_SOA_COLUMN(NSigTpcTofPiExpPiCharm, nSigTpcTofPiExpPiCharm, float); +DECLARE_SOA_COLUMN(NSigTpcTofPiExpKaCharm, nSigTpcTofPiExpKaCharm, float); +DECLARE_SOA_COLUMN(NSigTpcTofPr0Charm, nSigTpcTofPr0Charm, float); +DECLARE_SOA_COLUMN(NSigTpcTofPr1Charm, nSigTpcTofPr1Charm, float); +DECLARE_SOA_COLUMN(NSigTpcTofPr2Charm, nSigTpcTofPr2Charm, float); +} // namespace hf_cand_par_charm + // Candidate selection flags namespace hf_cand_sel { @@ -261,12 +391,27 @@ DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); //! flag for DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); //! particle origin, reconstruction level DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int8_t); //! swapping of the prongs order DECLARE_SOA_COLUMN(FlagMcDecayChanRec, flagMcDecayChanRec, int8_t); //! resonant decay channel flag, reconstruction level +DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class DECLARE_SOA_COLUMN(MlScoreBkg, mlScoreBkg, float); //! ML score for background class DECLARE_SOA_COLUMN(MlScorePrompt, mlScorePrompt, float); //! ML score for prompt class DECLARE_SOA_COLUMN(MlScoreNonPrompt, mlScoreNonPrompt, float); //! ML score for non-prompt class DECLARE_SOA_COLUMN(MlScores, mlScores, std::vector); //! vector of ML scores } // namespace hf_cand_mc +// Candidate MC columns of the charm daughter +namespace hf_cand_mc_charm +{ +DECLARE_SOA_COLUMN(FlagMcMatchRecCharm, flagMcMatchRecCharm, int8_t); //! flag for reconstruction level matching +DECLARE_SOA_COLUMN(OriginMcRecCharm, originMcRecCharm, int8_t); //! particle origin, reconstruction level +DECLARE_SOA_COLUMN(IsCandidateSwappedCharm, isCandidateSwappedCharm, int8_t); //! swapping of the prongs order +DECLARE_SOA_COLUMN(FlagMcDecayChanRecCharm, flagMcDecayChanRecCharm, int8_t); //! resonant decay channel flag, reconstruction level +DECLARE_SOA_COLUMN(MlScoreSigCharm, mlScoreSigCharm, float); //! ML score for signal class +DECLARE_SOA_COLUMN(MlScoreBkgCharm, mlScoreBkgCharm, float); //! ML score for background class +DECLARE_SOA_COLUMN(MlScorePromptCharm, mlScorePromptCharm, float); //! ML score for prompt class +DECLARE_SOA_COLUMN(MlScoreNonPromptCharm, mlScoreNonPromptCharm, float); //! ML score for non-prompt class +DECLARE_SOA_COLUMN(MlScoresCharm, mlScoresCharm, std::vector); //! vector of ML scores +} // namespace hf_cand_mc_charm + // D0 DECLARE_SOA_TABLE_STAGED(HfD0Bases, "HFD0BASE", //! Table with basic candidate properties used in the analyses @@ -281,7 +426,7 @@ DECLARE_SOA_TABLE_STAGED(HfD0Bases, "HFD0BASE", //! Table with basic candidate p hf_cand_base::Py, hf_cand_base::Pz, hf_cand_base::P, - soa::Marker); + o2::soa::Marker); // candidates for removal: // PxProng0, PyProng0, PzProng0,... (same for 1, 2), we can keep Pt, Eta, Phi instead @@ -315,7 +460,7 @@ DECLARE_SOA_TABLE_STAGED(HfD0Pars, "HFD0PAR", //! Table with candidate propertie hf_cand_par::NSigTpcTofKaExpKa, hf_cand_par::MaxNormalisedDeltaIP, hf_cand_par::ImpactParameterProduct, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfD0ParEs, "HFD0PARE", //! Table with additional candidate properties used for selection hf_cand::XSecondaryVertex, @@ -337,26 +482,125 @@ DECLARE_SOA_TABLE_STAGED(HfD0ParEs, "HFD0PARE", //! Table with additional candid hf_cand::ErrorImpactParameter1, hf_cand_par::CosThetaStar, hf_cand_par::Ct, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfD0Sels, "HFD0SEL", //! Table with candidate selection flags hf_cand_sel::CandidateSelFlag, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfD0Mls, "HFD0ML", //! Table with candidate selection ML scores hf_cand_mc::MlScores, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfD0Ids, "HFD0ID", //! Table with original global indices for candidates hf_cand::CollisionId, hf_track_index::Prong0Id, hf_track_index::Prong1Id, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfD0Mcs, "HFD0MC", //! Table with MC candidate info hf_cand_mc::FlagMcMatchRec, hf_cand_mc::OriginMcRec, - soa::Marker); + o2::soa::Marker); + +// B+ + +DECLARE_SOA_TABLE_STAGED(HfBplusBases, "HFBPBASE", //! Table with basic candidate properties used in the analyses + o2::soa::Index<>, + hf_cand_base::der_bplus::HfCollBaseId, + hf_cand_base::Pt, + hf_cand_base::Eta, + hf_cand_base::Phi, + hf_cand_base::M, + hf_cand_base::Y, + hf_cand_base::Px, + hf_cand_base::Py, + hf_cand_base::Pz, + hf_cand_base::P, + o2::soa::Marker); + +// candidates for removal: +// PxProng0, PyProng0, PzProng0,... (same for 1, 2), we can keep Pt, Eta, Phi instead +// XY: CpaXY, DecayLengthXY, ErrorDecayLengthXY +// normalised: DecayLengthNormalised, DecayLengthXYNormalised, ImpactParameterNormalised0 +DECLARE_SOA_TABLE_STAGED(HfBplusPars, "HFBPPAR", //! Table with candidate properties used for selection + hf_cand::Chi2PCA, + hf_cand_par::Cpa, + hf_cand_par::CpaXY, + hf_cand_par::DecayLength, + hf_cand_par::DecayLengthXY, + hf_cand_par::DecayLengthNormalised, + hf_cand_par::DecayLengthXYNormalised, + hf_cand_par::PtProng0, + hf_cand_par::PtProng1, + hf_cand::ImpactParameter0, + hf_cand::ImpactParameter1, + hf_cand_par::ImpactParameterNormalised0, + hf_cand_par::ImpactParameterNormalised1, + hf_cand_par::NSigTpcPiExpPi, + hf_cand_par::NSigTofPiExpPi, + hf_cand_par::NSigTpcTofPiExpPi, + hf_cand_par::NSigTpcKaExpPi, + hf_cand_par::NSigTofKaExpPi, + hf_cand_par::NSigTpcTofKaExpPi, + hf_cand_par::MaxNormalisedDeltaIP, + hf_cand_par::ImpactParameterProduct, + o2::soa::Marker); + +DECLARE_SOA_TABLE_STAGED(HfBplusParD0s, "HFBPPARD0", //! Table with D0 candidate properties used for selection of B+ + hf_cand_par_charm::CpaCharm, + hf_cand_par_charm::DecayLengthCharm, + hf_cand_par_charm::ImpactParameter0Charm, + hf_cand_par_charm::ImpactParameter1Charm, + hf_cand_par_charm::ImpactParameterProductCharm, + hf_cand_par_charm::NSigTpcPiExpPiCharm, + hf_cand_par_charm::NSigTofPiExpPiCharm, + hf_cand_par_charm::NSigTpcTofPiExpPiCharm, + hf_cand_par_charm::NSigTpcKaExpPiCharm, + hf_cand_par_charm::NSigTofKaExpPiCharm, + hf_cand_par_charm::NSigTpcTofKaExpPiCharm, + hf_cand_par_charm::NSigTpcPiExpKaCharm, + hf_cand_par_charm::NSigTofPiExpKaCharm, + hf_cand_par_charm::NSigTpcTofPiExpKaCharm, + hf_cand_par_charm::NSigTpcKaExpKaCharm, + hf_cand_par_charm::NSigTofKaExpKaCharm, + hf_cand_par_charm::NSigTpcTofKaExpKaCharm); + +DECLARE_SOA_TABLE_STAGED(HfBplusParEs, "HFBPPARE", //! Table with additional candidate properties used for selection + hf_cand::XSecondaryVertex, + hf_cand::YSecondaryVertex, + hf_cand::ZSecondaryVertex, + hf_cand::ErrorDecayLength, + hf_cand::ErrorDecayLengthXY, + hf_cand_par::RSecondaryVertex, + hf_cand_par::PProng1, + hf_cand::PxProng1, + hf_cand::PyProng1, + hf_cand::PzProng1, + hf_cand::ErrorImpactParameter1, + hf_cand_par::CosThetaStar, + hf_cand_par::Ct, + o2::soa::Marker); + +DECLARE_SOA_TABLE_STAGED(HfBplusMls, "HFBPML", //! Table with candidate selection ML scores + hf_cand_mc::MlScoreSig, + o2::soa::Marker); + +DECLARE_SOA_TABLE_STAGED(HfBplusMlD0s, "HFBPMLD0", //! Table with D0 candidate selection ML scores + hf_cand_mc_charm::MlScoresCharm, + o2::soa::Marker); + +DECLARE_SOA_TABLE_STAGED(HfBplusIds, "HFBPID", //! Table with original global indices for candidates + hf_cand::CollisionId, + hf_track_index::Prong0Id, // D0 prong 0 + hf_track_index::Prong1Id, // D0 prong 1 + hf_track_index::Prong2Id, // bachelor pion + o2::soa::Marker); + +DECLARE_SOA_TABLE_STAGED(HfBplusMcs, "HFBPMC", //! Table with MC candidate info + hf_cand_mc::FlagMcMatchRec, + hf_cand_mc::OriginMcRec, + o2::soa::Marker); // 3-prong decays @@ -372,7 +616,7 @@ DECLARE_SOA_TABLE_STAGED(Hf3PBases, "HF3PBASE", //! Table with basic candidate p hf_cand_base::Py, hf_cand_base::Pz, hf_cand_base::P, - soa::Marker); + o2::soa::Marker); // candidates for removal: // PxProng0, PyProng0, PzProng0,... (same for 1, 2), we can keep Pt, Eta, Phi instead @@ -411,7 +655,7 @@ DECLARE_SOA_TABLE_STAGED(Hf3PPars, "HF3PPAR", //! Table with candidate propertie hf_cand_par::NSigTofPr2, hf_cand_par::NSigTpcTofPi2, hf_cand_par::NSigTpcTofPr2, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(Hf3PParEs, "HF3PPARE", //! Table with additional candidate properties used for selection hf_cand::XSecondaryVertex, @@ -436,28 +680,28 @@ DECLARE_SOA_TABLE_STAGED(Hf3PParEs, "HF3PPARE", //! Table with additional candid hf_cand::ErrorImpactParameter1, hf_cand::ErrorImpactParameter2, hf_cand_par::Ct, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(Hf3PSels, "HF3PSEL", //! Table with candidate selection flags hf_cand_sel::CandidateSelFlag, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(Hf3PMls, "HF3PML", //! Table with candidate selection ML scores hf_cand_mc::MlScores, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(Hf3PIds, "HF3PID", //! Table with original global indices for candidates hf_cand::CollisionId, hf_track_index::Prong0Id, hf_track_index::Prong1Id, hf_track_index::Prong2Id, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(Hf3PMcs, "HF3PMC", //! Table with MC candidate info hf_cand_mc::FlagMcMatchRec, hf_cand_mc::OriginMcRec, hf_cand_mc::IsCandidateSwapped, - soa::Marker); + o2::soa::Marker); // ================== // MC particle tables @@ -466,12 +710,16 @@ DECLARE_SOA_TABLE_STAGED(Hf3PMcs, "HF3PMC", //! Table with MC candidate info // MC particle columns namespace hf_mc_particle { -DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! MC collision of this particle -DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! MC particle +DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! MC collision of this particle +DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! MC particle namespace der_d0 { DECLARE_SOA_INDEX_COLUMN(HfD0McCollBase, hfMcCollBase); //! collision index pointing to the derived MC collision table for D0 candidates } +namespace der_bplus +{ +DECLARE_SOA_INDEX_COLUMN(HfMcCollBase, hfMcCollBase); //! collision index pointing to the derived MC collision table for B+ candidates +} namespace der_3p { DECLARE_SOA_INDEX_COLUMN(Hf3PMcCollBase, hfMcCollBase); //! collision index pointing to the derived MC collision table for 3-prong candidates @@ -496,12 +744,34 @@ DECLARE_SOA_TABLE_STAGED(HfD0PBases, "HFD0PBASE", //! Table with MC particle inf hf_cand_base::Py, hf_cand_base::Pz, hf_cand_base::P, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfD0PIds, "HFD0PID", //! Table with original global indices for MC particles hf_mc_particle::McCollisionId, hf_mc_particle::McParticleId, - soa::Marker); + o2::soa::Marker); + +// B+ + +DECLARE_SOA_TABLE_STAGED(HfBplusPBases, "HFBPPBASE", //! Table with MC particle info + o2::soa::Index<>, + hf_mc_particle::der_bplus::HfMcCollBaseId, + hf_cand_base::Pt, + hf_cand_base::Eta, + hf_cand_base::Phi, + hf_cand_base::Y, + hf_mc_particle::FlagMcMatchGen, + hf_mc_particle::OriginMcGen, + hf_cand_base::Px, + hf_cand_base::Py, + hf_cand_base::Pz, + hf_cand_base::P, + o2::soa::Marker); + +DECLARE_SOA_TABLE_STAGED(HfBplusPIds, "HFBPPID", //! Table with original global indices for MC particles + hf_mc_particle::McCollisionId, + hf_mc_particle::McParticleId, + o2::soa::Marker); // 3-prong decays @@ -518,12 +788,12 @@ DECLARE_SOA_TABLE_STAGED(Hf3PPBases, "HF3PPBASE", //! Table with MC particle inf hf_cand_base::Py, hf_cand_base::Pz, hf_cand_base::P, - soa::Marker); + o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(Hf3PPIds, "HF3PPID", //! Table with original global indices for MC particles hf_mc_particle::McCollisionId, hf_mc_particle::McParticleId, - soa::Marker); + o2::soa::Marker); } // namespace o2::aod #endif // PWGHF_DATAMODEL_DERIVEDTABLES_H_ diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 133d4bf3d45..58f6d3280e4 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -276,6 +276,11 @@ o2physics_add_dpl_workflow(tree-creator-dstar-to-d0-pi # Derived-data creators +o2physics_add_dpl_workflow(derived-data-creator-bplus-to-d0-pi + SOURCES derivedDataCreatorBplusToD0Pi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(derived-data-creator-d0-to-k-pi SOURCES derivedDataCreatorD0ToKPi.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGHF/TableProducer/candidateCreatorBplus.cxx b/PWGHF/TableProducer/candidateCreatorBplus.cxx index b8845945df9..0d4753c6c98 100644 --- a/PWGHF/TableProducer/candidateCreatorBplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorBplus.cxx @@ -18,6 +18,10 @@ /// \author Deepa Thomas , UT Austin /// \author Antonio Palasciano , Università degli Studi di Bari & INFN, Sezione di Bari +#include +#include +#include + #include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" #include "Framework/AnalysisTask.h" @@ -79,9 +83,6 @@ struct HfCandidateCreatorBplus { o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; int runNumber; - double massPi{0.}; - double massD0{0.}; - double massBplus{0.}; double invMass2D0PiMin{0.}; double invMass2D0PiMax{0.}; double bz{0.}; @@ -110,11 +111,8 @@ struct HfCandidateCreatorBplus { void init(InitContext const&) { // invariant-mass window cut - massPi = MassPiPlus; - massD0 = MassD0; - massBplus = MassBPlus; - invMass2D0PiMin = (massBplus - invMassWindowBplus) * (massBplus - invMassWindowBplus); - invMass2D0PiMax = (massBplus + invMassWindowBplus) * (massBplus + invMassWindowBplus); + invMass2D0PiMin = (MassBPlus - invMassWindowBplus) * (MassBPlus - invMassWindowBplus); + invMass2D0PiMax = (MassBPlus + invMassWindowBplus) * (MassBPlus + invMassWindowBplus); // Initialise fitter for B vertex dfB.setPropagateToPCA(propagateToPCA); @@ -173,16 +171,8 @@ struct HfCandidateCreatorBplus { aod::BCsWithTimestamps const&) { - static int nCol = 0; - for (const auto& collision : collisions) { auto primaryVertex = getPrimaryVertex(collision); - - if (nCol % 10000 == 0) { - LOG(debug) << nCol << " collisions parsed"; - } - nCol++; - /// Set the magnetic field from ccdb. /// The static instance of the propagator was already modified in the HFTrackIndexSkimCreator, /// but this is not true when running on Run2 data/MC already converted into AO2Ds. @@ -294,7 +284,6 @@ struct HfCandidateCreatorBplus { auto trackParCovPi = getTrackParCov(trackPion); std::array pVecD0 = {0., 0., 0.}; std::array pVecBach = {0., 0., 0.}; - std::array pVecBCand = {0., 0., 0.}; // find the DCA between the D0 and the bachelor track, for B+ hCandidatesB->Fill(SVFitting::BeforeFit); @@ -318,8 +307,6 @@ struct HfCandidateCreatorBplus { auto covMatrixPCA = dfB.calcPCACovMatrixFlat(); hCovSVXX->Fill(covMatrixPCA[0]); // FIXME: Calculation of errorDecayLength(XY) gives wrong values without this line. - pVecBCand = RecoDecay::pVec(pVecD0, pVecBach); - // get track impact parameters // This modifies track momenta! auto covMatrixPV = primaryVertex.getCov(); @@ -336,7 +323,7 @@ struct HfCandidateCreatorBplus { auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.)); // compute invariant mass square and apply selection - auto invMass2D0Pi = RecoDecay::m2(std::array{pVecD0, pVecBach}, std::array{massD0, massPi}); + auto invMass2D0Pi = RecoDecay::m2(std::array{pVecD0, pVecBach}, std::array{MassD0, MassPiPlus}); if ((invMass2D0Pi < invMass2D0PiMin) || (invMass2D0Pi > invMass2D0PiMax)) { continue; } diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx new file mode 100644 index 00000000000..6c0ada5de5b --- /dev/null +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -0,0 +1,557 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file derivedDataCreatorBplusToD0Pi.cxx +/// \brief Producer of derived tables of B+ candidates, collisions and MC particles +/// \note Based on derivedDataCreatorLcToPKPi.cxx +/// +/// \author Vít Kučera , Inha University + +#include +#include +#include + +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" + +#include "PWGHF/Core/HfHelper.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/DataModel/DerivedTables.h" +#include "PWGHF/Utils/utilsDerivedData.h" +#include "PWGHF/Utils/utilsPid.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::aod::pid_tpc_tof_utils; +using namespace o2::analysis::hf_derived; + +/// Writes the full information in an output TTree +struct HfDerivedDataCreatorBplusToD0Pi { + // Candidates + Produces rowCandidateBase; + Produces rowCandidatePar; + Produces rowCandidateParD0; + Produces rowCandidateParE; + Produces rowCandidateMl; + Produces rowCandidateMlD0; + Produces rowCandidateId; + Produces rowCandidateMc; + // Collisions + Produces rowCollBase; + Produces rowCollId; + // MC collisions + Produces rowMcCollBase; + Produces rowMcCollId; + Produces rowMcRCollId; + // MC particles + Produces rowParticleBase; + Produces rowParticleId; + + // Switches for filling tables + Configurable fillCandidateBase{"fillCandidateBase", true, "Fill candidate base properties"}; + Configurable fillCandidatePar{"fillCandidatePar", true, "Fill candidate parameters"}; + Configurable fillCandidateParD0{"fillCandidateParD0", true, "Fill D0 candidate parameters"}; + Configurable fillCandidateParE{"fillCandidateParE", true, "Fill candidate extended parameters"}; + Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; + Configurable fillCandidateMlD0{"fillCandidateMlD0", true, "Fill D0 candidate selection ML scores"}; + Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; + Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; + Configurable fillCollBase{"fillCollBase", true, "Fill collision base properties"}; + Configurable fillCollId{"fillCollId", true, "Fill original collision indices"}; + Configurable fillMcCollBase{"fillMcCollBase", true, "Fill MC collision base properties"}; + Configurable fillMcCollId{"fillMcCollId", true, "Fill original MC collision indices"}; + Configurable fillMcRCollId{"fillMcRCollId", true, "Fill indices of saved derived reconstructed collisions matched to saved derived MC collisions"}; + Configurable fillParticleBase{"fillParticleBase", true, "Fill MC particle properties"}; + Configurable fillParticleId{"fillParticleId", true, "Fill original MC indices"}; + // Parameters for production of training samples + Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; + Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; + + HfHelper hfHelper; + SliceCache cache; + std::map> matchedCollisions; // indices of derived reconstructed collisions matched to the global indices of MC collisions + std::map hasMcParticles; // flags for MC collisions with HF particles + + using CollisionsWCentMult = soa::Join; + using CollisionsWMcCentMult = soa::Join; + using TracksWPid = soa::Join; + using SelectedCandidates = soa::Filtered>; + using SelectedCandidatesMc = soa::Filtered>; + using SelectedCandidatesMl = soa::Filtered>; + using SelectedCandidatesMcMl = soa::Filtered>; + using MatchedGenCandidatesMc = soa::Filtered>; + using TypeMcCollisions = aod::McCollisions; + using THfCandDaughters = aod::HfCand2ProngWPid; + using THfCandDaughtersMl = soa::Join; + + Filter filterSelectCandidates = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 1; + Filter filterMcGenMatching = nabs(aod::hf_cand_bplus::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_bplus::DecayType::BplusToD0Pi)); + + Preslice candidatesPerCollision = aod::hf_cand::collisionId; + Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; + Preslice candidatesMlPerCollision = aod::hf_cand::collisionId; + Preslice candidatesMcMlPerCollision = aod::hf_cand::collisionId; + Preslice mcParticlesPerMcCollision = aod::mcparticle::mcCollisionId; + + // trivial partitions for all candidates to allow "->sliceByCached" inside processCandidates + Partition candidatesAll = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 0; + Partition candidatesMcAll = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 0; + Partition candidatesMlAll = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 0; + Partition candidatesMcMlAll = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= 0; + // partitions for signal and background + Partition candidatesMcSig = nabs(aod::hf_cand_bplus::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_bplus::DecayType::BplusToD0Pi)); + Partition candidatesMcBkg = nabs(aod::hf_cand_bplus::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_bplus::DecayType::BplusToD0Pi)); + Partition candidatesMcMlSig = nabs(aod::hf_cand_bplus::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_bplus::DecayType::BplusToD0Pi)); + Partition candidatesMcMlBkg = nabs(aod::hf_cand_bplus::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_bplus::DecayType::BplusToD0Pi)); + + void init(InitContext const&) + { + std::array doprocess{doprocessData, doprocessMcSig, doprocessMcBkg, doprocessMcAll, doprocessDataMl, doprocessMcMlSig, doprocessMcMlBkg, doprocessMcMlAll}; + if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { + LOGP(fatal, "Only one process function can be enabled at a time."); + } + } + + template + // void fillTablesCollision(const T& collision, int isEventReject, int runNumber) + void fillTablesCollision(const T& collision) + { + if (fillCollBase) { + rowCollBase( + collision.posX(), + collision.posY(), + collision.posZ(), + collision.numContrib(), + collision.centFT0A(), + collision.centFT0C(), + collision.centFT0M(), + collision.centFV0A(), + collision.multZeqNTracksPV()); + // isEventReject, + // runNumber); + } + if (fillCollId) { + rowCollId( + collision.globalIndex()); + } + if constexpr (isMC) { + if (fillMcRCollId && collision.has_mcCollision()) { + // Save rowCollBase.lastIndex() at key collision.mcCollisionId() + LOGF(debug, "Rec. collision %d: Filling derived-collision index %d for MC collision %d", collision.globalIndex(), rowCollBase.lastIndex(), collision.mcCollisionId()); + matchedCollisions[collision.mcCollisionId()].push_back(rowCollBase.lastIndex()); // [] inserts an empty element if it does not exist + } + } + } + + template + void fillTablesMcCollision(const T& mcCollision) + { + if (fillMcCollBase) { + rowMcCollBase( + mcCollision.posX(), + mcCollision.posY(), + mcCollision.posZ()); + } + if (fillMcCollId) { + rowMcCollId( + mcCollision.globalIndex()); + } + if (fillMcRCollId) { + // Fill the table with the vector of indices of derived reconstructed collisions matched to mcCollision.globalIndex() + rowMcRCollId( + matchedCollisions[mcCollision.globalIndex()]); + } + } + + template + void fillTablesCandidate(const T& candidate, const U& prongCharm, const V& prongBachelor, int candFlag, double invMass, + double ct, double y, int8_t flagMc, int8_t origin, float mlScore, const std::vector& mlScoresCharm) + { + if (fillCandidateBase) { + rowCandidateBase( + rowCollBase.lastIndex(), + candidate.pt(), + candidate.eta(), + candidate.phi(), + invMass, + y); + } + if (fillCandidatePar) { + rowCandidatePar( + candidate.chi2PCA(), + candidate.cpa(), + candidate.cpaXY(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.decayLengthNormalised(), + candidate.decayLengthXYNormalised(), + candidate.ptProng0(), + candidate.ptProng1(), + candidate.impactParameter0(), + candidate.impactParameter1(), + candidate.impactParameterNormalised0(), + candidate.impactParameterNormalised1(), + prongBachelor.tpcNSigmaPi(), + prongBachelor.tofNSigmaPi(), + prongBachelor.tpcTofNSigmaPi(), + prongBachelor.tpcNSigmaKa(), + prongBachelor.tofNSigmaKa(), + prongBachelor.tpcTofNSigmaKa(), + candidate.maxNormalisedDeltaIP(), + candidate.impactParameterProduct()); + } + if (fillCandidateParD0) { + std::array, 2>, 2> sigmas{}; // PID nSigma [Expected][Hypothesis][TPC/TOF/TPC+TOF] + if (candFlag == 0) { + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion], prongCharm, 0, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon], prongCharm, 0, Ka) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion], prongCharm, 1, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon], prongCharm, 1, Ka) + } else if (candFlag == 1) { + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion], prongCharm, 1, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon], prongCharm, 1, Ka) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion], prongCharm, 0, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon], prongCharm, 0, Ka) + } + rowCandidateParD0( + prongCharm.cpa(), + prongCharm.decayLength(), + prongCharm.impactParameter0(), + prongCharm.impactParameter1(), + prongCharm.impactParameterProduct(), + sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][0], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][1], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][2], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon][0], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon][1], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon][2], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion][0], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion][1], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion][2], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon][0], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon][1], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon][2]); + } + if (fillCandidateParE) { + rowCandidateParE( + candidate.xSecondaryVertex(), + candidate.ySecondaryVertex(), + candidate.zSecondaryVertex(), + candidate.errorDecayLength(), + candidate.errorDecayLengthXY(), + candidate.rSecondaryVertex(), + RecoDecay::p(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), + candidate.pxProng1(), + candidate.pyProng1(), + candidate.pzProng1(), + candidate.errorImpactParameter1(), + hfHelper.cosThetaStarBplus(candidate), + ct); + } + if (fillCandidateMl) { + rowCandidateMl( + mlScore); + } + if (fillCandidateMlD0) { + rowCandidateMlD0( + mlScoresCharm); + } + if (fillCandidateId) { + rowCandidateId( + candidate.collisionId(), + prongCharm.prong0Id(), + prongCharm.prong1Id(), + candidate.prong1Id()); + } + if (fillCandidateMc) { + rowCandidateMc( + flagMc, + origin); + } + } + + template + void fillTablesParticle(const T& particle, U mass) + { + if (fillParticleBase) { + rowParticleBase( + rowMcCollBase.lastIndex(), + particle.pt(), + particle.eta(), + particle.phi(), + RecoDecayPtEtaPhi::y(particle.pt(), particle.eta(), mass), + particle.flagMcMatchGen(), + particle.originMcGen()); + } + if (fillParticleId) { + rowParticleId( + particle.mcCollisionId(), + particle.globalIndex()); + } + } + + template + void processCandidates(CollType const& collisions, + Partition& candidates, + CandCharmType const&, + TracksWPid const&, + aod::BCs const&) + { + // Fill collision properties + if constexpr (isMc) { + if (fillMcRCollId) { + matchedCollisions.clear(); + } + } + auto sizeTableColl = collisions.size(); + reserveTable(rowCollBase, fillCollBase, sizeTableColl); + reserveTable(rowCollId, fillCollId, sizeTableColl); + for (const auto& collision : collisions) { + auto thisCollId = collision.globalIndex(); + auto candidatesThisColl = candidates->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache); // FIXME + auto sizeTableCand = candidatesThisColl.size(); + LOGF(debug, "Rec. collision %d has %d candidates", thisCollId, sizeTableCand); + // Skip collisions without HF candidates (and without HF particles in matched MC collisions if saving indices of reconstructed collisions matched to MC collisions) + bool mcCollisionHasMcParticles{false}; + if constexpr (isMc) { + mcCollisionHasMcParticles = fillMcRCollId && collision.has_mcCollision() && hasMcParticles[collision.mcCollisionId()]; + LOGF(debug, "Rec. collision %d has MC collision %d with MC particles? %s", thisCollId, collision.mcCollisionId(), mcCollisionHasMcParticles ? "yes" : "no"); + } + if (sizeTableCand == 0 && (!fillMcRCollId || !mcCollisionHasMcParticles)) { + LOGF(debug, "Skipping rec. collision %d", thisCollId); + continue; + } + LOGF(debug, "Filling rec. collision %d at derived index %d", thisCollId, rowCollBase.lastIndex() + 1); + // fillTablesCollision(collision, 0, collision.bc().runNumber()); + fillTablesCollision(collision); + + // Fill candidate properties + reserveTable(rowCandidateBase, fillCandidateBase, sizeTableCand); + reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand); + reserveTable(rowCandidateParD0, fillCandidateParD0, sizeTableCand); + reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand); + reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); + reserveTable(rowCandidateMlD0, fillCandidateMlD0, sizeTableCand); + reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); + if constexpr (isMc) { + reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); + } + int8_t flagMcRec = 0, origin = 0; + for (const auto& candidate : candidatesThisColl) { + if constexpr (isMc) { + flagMcRec = candidate.flagMcMatchRec(); + origin = candidate.originMcRec(); + if constexpr (onlyBkg) { + if (TESTBIT(std::abs(flagMcRec), aod::hf_cand_bplus::DecayType::BplusToD0Pi)) { + continue; + } + if (downSampleBkgFactor < 1.) { + float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); + if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { + continue; + } + } + } + if constexpr (onlySig) { + if (!TESTBIT(std::abs(flagMcRec), aod::hf_cand_bplus::DecayType::BplusToD0Pi)) { + continue; + } + } + } + auto prongCharm = candidate.template prong0_as(); + auto prongBachelor = candidate.template prong1_as(); + double ct = hfHelper.ctBplus(candidate); + double y = hfHelper.yBplus(candidate); + float massBplusToD0Pi = hfHelper.invMassBplusToD0Pi(candidate); + float mlScoreBplusToD0Pi{-1.f}; + std::vector mlScoresD0; + bool isD0 = prongBachelor.sign() < 0; // D0 or D0bar + if constexpr (isMl) { + mlScoreBplusToD0Pi = candidate.mlProbBplusToD0Pi(); + if (isD0) { + std::copy(prongCharm.mlProbD0().begin(), prongCharm.mlProbD0().end(), std::back_inserter(mlScoresD0)); + } else { + std::copy(prongCharm.mlProbD0bar().begin(), prongCharm.mlProbD0bar().end(), std::back_inserter(mlScoresD0)); + } + } + // flag = 0 for D0 pi-, flag = 1 for D0bar pi+ + fillTablesCandidate(candidate, prongCharm, prongBachelor, isD0 ? 0 : 1, massBplusToD0Pi, ct, y, flagMcRec, origin, mlScoreBplusToD0Pi, mlScoresD0); + } + } + } + + template + void preProcessMcCollisions(CollisionType const& mcCollisions, + ParticleType const& mcParticles) + { + if (!fillMcRCollId) { + return; + } + hasMcParticles.clear(); + // Fill MC collision flags + for (const auto& mcCollision : mcCollisions) { + auto thisMcCollId = mcCollision.globalIndex(); + auto particlesThisMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, thisMcCollId); + LOGF(debug, "MC collision %d has %d MC particles (preprocess)", thisMcCollId, particlesThisMcColl.size()); + hasMcParticles[thisMcCollId] = (particlesThisMcColl.size() > 0); + } + } + + template + void processMcParticles(CollisionType const& mcCollisions, + ParticleType const& mcParticles) + { + // Fill MC collision properties + auto sizeTableMcColl = mcCollisions.size(); + reserveTable(rowMcCollBase, fillMcCollBase, sizeTableMcColl); + reserveTable(rowMcCollId, fillMcCollId, sizeTableMcColl); + reserveTable(rowMcRCollId, fillMcRCollId, sizeTableMcColl); + for (const auto& mcCollision : mcCollisions) { + auto thisMcCollId = mcCollision.globalIndex(); + auto particlesThisMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, thisMcCollId); + auto sizeTablePart = particlesThisMcColl.size(); + LOGF(debug, "MC collision %d has %d MC particles", thisMcCollId, sizeTablePart); + // Skip MC collisions without HF particles (and without HF candidates in matched reconstructed collisions if saving indices of reconstructed collisions matched to MC collisions) + LOGF(debug, "MC collision %d has %d saved derived rec. collisions", thisMcCollId, matchedCollisions[thisMcCollId].size()); + if (sizeTablePart == 0 && (!fillMcRCollId || matchedCollisions[thisMcCollId].empty())) { + LOGF(debug, "Skipping MC collision %d", thisMcCollId); + continue; + } + LOGF(debug, "Filling MC collision %d at derived index %d", thisMcCollId, rowMcCollBase.lastIndex() + 1); + fillTablesMcCollision(mcCollision); + + // Fill MC particle properties + reserveTable(rowParticleBase, fillParticleBase, sizeTablePart); + reserveTable(rowParticleId, fillParticleId, sizeTablePart); + for (const auto& particle : particlesThisMcColl) { + fillTablesParticle(particle, o2::constants::physics::MassBPlus); + } + } + } + + void processData(CollisionsWCentMult const& collisions, + SelectedCandidates const&, + THfCandDaughters const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesAll, candidatesDaughters, tracks, bcs); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processData, "Process data", true); + + void processMcSig(CollisionsWMcCentMult const& collisions, + SelectedCandidatesMc const&, + TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles, + THfCandDaughters const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + preProcessMcCollisions(mcCollisions, mcParticles); + processCandidates(collisions, candidatesMcSig, candidatesDaughters, tracks, bcs); + processMcParticles(mcCollisions, mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcSig, "Process MC only for signals", false); + + void processMcBkg(CollisionsWMcCentMult const& collisions, + SelectedCandidatesMc const&, + TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles, + THfCandDaughters const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + preProcessMcCollisions(mcCollisions, mcParticles); + processCandidates(collisions, candidatesMcBkg, candidatesDaughters, tracks, bcs); + processMcParticles(mcCollisions, mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcBkg, "Process MC only for background", false); + + void processMcAll(CollisionsWMcCentMult const& collisions, + SelectedCandidatesMc const&, + TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles, + THfCandDaughters const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + preProcessMcCollisions(mcCollisions, mcParticles); + processCandidates(collisions, candidatesMcAll, candidatesDaughters, tracks, bcs); + processMcParticles(mcCollisions, mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcAll, "Process MC", false); + + // ML versions + + void processDataMl(CollisionsWCentMult const& collisions, + SelectedCandidatesMl const&, + THfCandDaughtersMl const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + processCandidates(collisions, candidatesMlAll, candidatesDaughters, tracks, bcs); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processDataMl, "Process data with ML", false); + + void processMcMlSig(CollisionsWMcCentMult const& collisions, + SelectedCandidatesMcMl const&, + TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles, + THfCandDaughtersMl const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + preProcessMcCollisions(mcCollisions, mcParticles); + processCandidates(collisions, candidatesMcMlSig, candidatesDaughters, tracks, bcs); + processMcParticles(mcCollisions, mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlSig, "Process MC with ML only for signals", false); + + void processMcMlBkg(CollisionsWMcCentMult const& collisions, + SelectedCandidatesMcMl const&, + TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles, + THfCandDaughtersMl const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + preProcessMcCollisions(mcCollisions, mcParticles); + processCandidates(collisions, candidatesMcMlBkg, candidatesDaughters, tracks, bcs); + processMcParticles(mcCollisions, mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlBkg, "Process MC with ML only for background", false); + + void processMcMlAll(CollisionsWMcCentMult const& collisions, + SelectedCandidatesMcMl const&, + TypeMcCollisions const& mcCollisions, + MatchedGenCandidatesMc const& mcParticles, + THfCandDaughtersMl const& candidatesDaughters, + TracksWPid const& tracks, + aod::BCs const& bcs) + { + preProcessMcCollisions(mcCollisions, mcParticles); + processCandidates(collisions, candidatesMcMlAll, candidatesDaughters, tracks, bcs); + processMcParticles(mcCollisions, mcParticles); + } + PROCESS_SWITCH(HfDerivedDataCreatorBplusToD0Pi, processMcMlAll, "Process MC with ML", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index 59480f3b50a..de26dc1dff3 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -15,6 +15,10 @@ /// /// \author Vít Kučera , Inha University +#include +#include +#include + #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -27,10 +31,14 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/DataModel/DerivedTables.h" +#include "PWGHF/Utils/utilsDerivedData.h" +#include "PWGHF/Utils/utilsPid.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::aod::pid_tpc_tof_utils; +using namespace o2::analysis::hf_derived; /// Writes the full information in an output TTree struct HfDerivedDataCreatorD0ToKPi { @@ -132,14 +140,6 @@ struct HfDerivedDataCreatorD0ToKPi { } } - template - void reserveTable(T& table, const Configurable& enabled, const uint64_t size) - { - if (enabled.value) { - table.reserve(size); - } - }; - template // void fillTablesCollision(const T& collision, int isEventReject, int runNumber) void fillTablesCollision(const T& collision) @@ -204,33 +204,18 @@ struct HfDerivedDataCreatorD0ToKPi { invMass, y); } - if (fillCandidatePar) { - float tpcNSigmaPiExpPi = candidate.nSigTpcPi0(); - float tofNSigmaPiExpPi = candidate.nSigTofPi0(); - float tpcTofNSigmaPiExpPi = candidate.tpcTofNSigmaPi0(); - float tpcNSigmaKaExpPi = candidate.nSigTpcKa0(); - float tofNSigmaKaExpPi = candidate.nSigTofKa0(); - float tpcTofNSigmaKaExpPi = candidate.tpcTofNSigmaKa0(); - float tpcNSigmaPiExpKa = candidate.nSigTpcPi1(); - float tofNSigmaPiExpKa = candidate.nSigTofPi1(); - float tpcTofNSigmaPiExpKa = candidate.tpcTofNSigmaPi1(); - float tpcNSigmaKaExpKa = candidate.nSigTpcKa1(); - float tofNSigmaKaExpKa = candidate.nSigTofKa1(); - float tpcTofNSigmaKaExpKa = candidate.tpcTofNSigmaKa1(); - if (candFlag == 1) { - tpcNSigmaPiExpPi = candidate.nSigTpcPi1(); - tofNSigmaPiExpPi = candidate.nSigTofPi1(); - tpcTofNSigmaPiExpPi = candidate.tpcTofNSigmaPi1(); - tpcNSigmaKaExpPi = candidate.nSigTpcKa1(); - tofNSigmaKaExpPi = candidate.nSigTofKa1(); - tpcTofNSigmaKaExpPi = candidate.tpcTofNSigmaKa1(); - tpcNSigmaPiExpKa = candidate.nSigTpcPi0(); - tofNSigmaPiExpKa = candidate.nSigTofPi0(); - tpcTofNSigmaPiExpKa = candidate.tpcTofNSigmaPi0(); - tpcNSigmaKaExpKa = candidate.nSigTpcKa0(); - tofNSigmaKaExpKa = candidate.nSigTofKa0(); - tpcTofNSigmaKaExpKa = candidate.tpcTofNSigmaKa0(); + std::array, 2>, 2> sigmas{}; // PID nSigma [Expected][Hypothesis][TPC/TOF/TPC+TOF] + if (candFlag == 0) { + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion], candidate, 0, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon], candidate, 0, Ka) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion], candidate, 1, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon], candidate, 1, Ka) + } else if (candFlag == 1) { + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion], candidate, 1, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon], candidate, 1, Ka) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion], candidate, 0, Pi) + GET_N_SIGMA_PRONG(sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon], candidate, 0, Ka) } rowCandidatePar( candidate.chi2PCA(), @@ -246,18 +231,18 @@ struct HfDerivedDataCreatorD0ToKPi { candidate.impactParameter1(), candidate.impactParameterNormalised0(), candidate.impactParameterNormalised1(), - tpcNSigmaPiExpPi, - tofNSigmaPiExpPi, - tpcTofNSigmaPiExpPi, - tpcNSigmaKaExpPi, - tofNSigmaKaExpPi, - tpcTofNSigmaKaExpPi, - tpcNSigmaPiExpKa, - tofNSigmaPiExpKa, - tpcTofNSigmaPiExpKa, - tpcNSigmaKaExpKa, - tofNSigmaKaExpKa, - tpcTofNSigmaKaExpKa, + sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][0], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][1], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Pion][2], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon][0], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon][1], + sigmas[HfProngSpecies::Pion][HfProngSpecies::Kaon][2], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion][0], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion][1], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Pion][2], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon][0], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon][1], + sigmas[HfProngSpecies::Kaon][HfProngSpecies::Kaon][2], candidate.maxNormalisedDeltaIP(), candidate.impactParameterProduct()); } @@ -363,6 +348,7 @@ struct HfDerivedDataCreatorD0ToKPi { reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand); reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand); reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); + reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); if constexpr (isMc) { reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); @@ -377,7 +363,7 @@ struct HfDerivedDataCreatorD0ToKPi { continue; } if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - (int64_t)(candidate.ptProng0() * 1000); + float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -390,7 +376,7 @@ struct HfDerivedDataCreatorD0ToKPi { } } else { if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - (int64_t)(candidate.ptProng0() * 1000); + float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -448,6 +434,7 @@ struct HfDerivedDataCreatorD0ToKPi { // Fill MC collision properties auto sizeTableMcColl = mcCollisions.size(); reserveTable(rowMcCollBase, fillMcCollBase, sizeTableMcColl); + reserveTable(rowMcCollId, fillMcCollId, sizeTableMcColl); reserveTable(rowMcRCollId, fillMcRCollId, sizeTableMcColl); for (const auto& mcCollision : mcCollisions) { auto thisMcCollId = mcCollision.globalIndex(); diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 645deab1c39..5827f26a1aa 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -15,6 +15,10 @@ /// /// \author Vít Kučera , Inha University +#include +#include +#include + #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -27,10 +31,12 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/DataModel/DerivedTables.h" +#include "PWGHF/Utils/utilsDerivedData.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::analysis::hf_derived; /// Writes the full information in an output TTree struct HfDerivedDataCreatorLcToPKPi { @@ -115,14 +121,6 @@ struct HfDerivedDataCreatorLcToPKPi { } } - template - void reserveTable(T& table, const Configurable& enabled, const uint64_t size) - { - if (enabled.value) { - table.reserve(size); - } - }; - template // void fillTablesCollision(const T& collision, int isEventReject, int runNumber) void fillTablesCollision(const T& collision) @@ -329,6 +327,7 @@ struct HfDerivedDataCreatorLcToPKPi { reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand); reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand); reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); + reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); if constexpr (isMc) { reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand); @@ -344,7 +343,7 @@ struct HfDerivedDataCreatorLcToPKPi { continue; } if (downSampleBkgFactor < 1.) { - float pseudoRndm = candidate.ptProng0() * 1000. - (int64_t)(candidate.ptProng0() * 1000); + float pseudoRndm = candidate.ptProng0() * 1000. - static_cast(candidate.ptProng0() * 1000); if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } @@ -402,6 +401,7 @@ struct HfDerivedDataCreatorLcToPKPi { // Fill MC collision properties auto sizeTableMcColl = mcCollisions.size(); reserveTable(rowMcCollBase, fillMcCollBase, sizeTableMcColl); + reserveTable(rowMcCollId, fillMcCollId, sizeTableMcColl); reserveTable(rowMcRCollId, fillMcRCollId, sizeTableMcColl); for (const auto& mcCollision : mcCollisions) { auto thisMcCollId = mcCollision.globalIndex(); diff --git a/PWGHF/Utils/utilsDerivedData.h b/PWGHF/Utils/utilsDerivedData.h new file mode 100644 index 00000000000..ad3bf57e25e --- /dev/null +++ b/PWGHF/Utils/utilsDerivedData.h @@ -0,0 +1,42 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file utilsDerivedData.h +/// \brief Utilities for derived-data creators +/// \author Vít Kučera , Inha University + +#ifndef PWGHF_UTILS_UTILSDERIVEDDATA_H_ +#define PWGHF_UTILS_UTILSDERIVEDDATA_H_ + +#include + +// Macro to store nSigma for prong _id_ with PID hypothesis _hyp_ in an array +#define GET_N_SIGMA_PRONG(_array_, _candidate_, _id_, _hyp_) \ + _array_[0] = _candidate_.nSigTpc##_hyp_##_id_(); \ + _array_[1] = _candidate_.nSigTof##_hyp_##_id_(); \ + _array_[2] = _candidate_.tpcTofNSigma##_hyp_##_id_(); + +namespace o2::analysis::hf_derived +{ +/// Reserve space in the filled table for all entries in the source table. +/// \param cursor cursor of the filled table +/// \param enabled switch for filling the table +/// \param size size of the source table +template +void reserveTable(T& cursor, const o2::framework::Configurable& enabled, const uint64_t size) +{ + if (enabled.value) { + cursor.reserve(size); + } +}; +} // namespace o2::analysis::hf_derived + +#endif // PWGHF_UTILS_UTILSDERIVEDDATA_H_ diff --git a/PWGHF/Utils/utilsPid.h b/PWGHF/Utils/utilsPid.h index c0cec3e0ce1..19325426cd6 100644 --- a/PWGHF/Utils/utilsPid.h +++ b/PWGHF/Utils/utilsPid.h @@ -17,15 +17,11 @@ #ifndef PWGHF_UTILS_UTILSPID_H_ #define PWGHF_UTILS_UTILSPID_H_ -namespace o2::aod +namespace o2::aod::pid_tpc_tof_utils { - -namespace pid_tpc_tof_utils -{ - -enum HfProngSpecies : int { Pion = 0, - Kaon, - Proton }; +enum HfProngSpecies : uint8_t { Pion = 0, + Kaon, + Proton }; /// Function to combine TPC and TOF NSigma /// \param tiny switch between full and tiny (binned) PID tables @@ -100,9 +96,6 @@ void fillProngPid(TRK const& track, ROW& rowPid) // fill candidate prong PID rows rowPid(nSigTpc, nSigTof); } - -} // namespace pid_tpc_tof_utils - -} // namespace o2::aod +} // namespace o2::aod::pid_tpc_tof_utils #endif // PWGHF_UTILS_UTILSPID_H_ From e94c8deb017cb83bc87da8aaf3949a50c00473a4 Mon Sep 17 00:00:00 2001 From: Chiara Zampolli Date: Wed, 20 Nov 2024 21:55:29 +0100 Subject: [PATCH 009/459] [Infrastructure] Update of DPG coordinators (#8552) --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index ab99fb8e954..253fbdc4690 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -15,7 +15,7 @@ /Common/CCDB @alibuild @jgrosseo @iarsene @ekryshen @ddobrigk /Common/Tools/Multiplicity @alibuild @ddobrigk @victor-gonzalez /ALICE3 @alibuild @njacazio @hscheid -/DPG @alibuild @chiarazampolli @noferini +/DPG @alibuild @chiarazampolli @alcaliva @catalinristea /DPG/Tasks/AOTEvent @alibuild @ekryshen @strogolo @altsybee /DPG/Tasks/AOTTrack @alibuild @mfaggin @iouribelikov @njacazio /DPG/Tasks/TOF @alibuild @noferini @njacazio From 6b9c394df878dcd5352812328a0adcaf9baac495 Mon Sep 17 00:00:00 2001 From: Chiara Pinto <48326672+chiarapinto@users.noreply.github.com> Date: Wed, 20 Nov 2024 21:56:26 +0100 Subject: [PATCH 010/459] [PWGLF] fixed configurable in dca selection (#8535) --- PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx b/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx index a90b4677b61..7d3659419de 100644 --- a/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx +++ b/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx @@ -264,9 +264,9 @@ struct nuclei_in_jets { // standard selection if (!setDCAselectionPtDep) { - if (TMath::Abs(track.dcaXY()) > 0.1) + if (TMath::Abs(track.dcaXY()) > max_dcaxy) return false; - if (TMath::Abs(track.dcaZ()) > 0.1) + if (TMath::Abs(track.dcaZ()) > max_dcaz) return false; } @@ -378,7 +378,7 @@ struct nuclei_in_jets { double c = pz * pz * pz * pz - py * py * py * py - px * px * py * py; double delta = b * b - 4.0 * a * c; - // Protection agains delta<0 + // Protection against delta<0 if (delta < 0) { return; } @@ -1127,9 +1127,9 @@ struct nuclei_in_jets { continue; } if (!setDCAselectionPtDep) { - if (dcaxy > 0.1) + if (dcaxy > max_dcaxy) continue; - if (dcaz > 0.1) + if (dcaz > max_dcaz) continue; } @@ -1228,9 +1228,9 @@ struct nuclei_in_jets { continue; } if (!setDCAselectionPtDep) { - if (dcaxy > 0.1) + if (dcaxy > max_dcaxy) continue; - if (dcaz > 0.1) + if (dcaz > max_dcaz) continue; } From 0345b92cd8ee21e34d6a4b5605e0eb9e9b165bbe Mon Sep 17 00:00:00 2001 From: altsybee Date: Wed, 20 Nov 2024 21:57:19 +0100 Subject: [PATCH 011/459] [DPG] Update rofOccupancyQa.cxx - fixes (#8553) --- DPG/Tasks/AOTEvent/rofOccupancyQa.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx b/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx index 9e82e498585..790174ef6c8 100644 --- a/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx +++ b/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx @@ -246,7 +246,7 @@ struct RofOccupancyQaTask { histos.add("afterNarrowDeltaTimeCut/hThisEvITSTr_vs_occupancyInPreviousROF_1collPerROF_XaxisWins", "", kTH2D, {{250, 0., 8000 * k}, {250, 0., 8000 * k}}); // 2,3,4 colls in ROF - histos.add("vZ_TF_ROF_border_cuts/hThisEvITSTr_vs_occupancyInROF_2coll_noVzCutOnOtherVertices", "", kTH2D, {{500, 0., 20000 * k}, {250, 0., 8000 * k}}); + histos.add("vZ_TF_ROF_border_cuts/hThisEvITSTr_vs_occupancyInROF_2coll_noVzCutOnOtherVertices", "", kTH2D, {{500, 0., 8000 * k}, {250, 0., 8000 * k}}); histos.add("vZ_TF_ROF_border_cuts/hThisEvITSTr_vs_occupancyInROF_3coll_noVzCutOnOtherVertices", "", kTH2D, {{500, 0., 20000 * k}, {250, 0., 8000 * k}}); histos.add("vZ_TF_ROF_border_cuts/hThisEvITSTr_vs_occupancyInROF_4coll_noVzCutOnOtherVertices", "", kTH2D, {{500, 0., 20000 * k}, {250, 0., 8000 * k}}); @@ -453,7 +453,7 @@ struct RofOccupancyQaTask { for (auto& track : colPvTracks) { if (track.itsNCls() >= 5) { vTracksITS567perColl[colIndex]++; - if (fabs(track.eta() < 0.8)) + if (fabs(track.eta()) < 0.8) vTracksITS567eta08perColl[colIndex]++; if (track.tpcNClsFound() > 70) vTracksITSTPCperColl[colIndex]++; @@ -754,7 +754,7 @@ struct RofOccupancyQaTask { vROFidThisColl[colIndex] = rofIdInTF; if (fabs(vZ) < 10) - vNumCollinROFinVz10[colIndex]++; + vNumCollinROFinVz10[colIndex] = 1; for (uint32_t iCol = 0; iCol < vAssocToSameROF.size(); iCol++) { int thisColIndex = vAssocToSameROF[iCol]; // int64_t thisRofId = (vFoundGlobalBC[thisColIndex] + 3564 - rofOffset) / rofLength; @@ -769,6 +769,8 @@ struct RofOccupancyQaTask { nITS567tracksForRofVetoStrict += vTracksITS567perColl[thisColIndex]; nSumAmplFT0CforRofVetoStrict += vAmpFT0CperColl[thisColIndex]; vNumCollinROF[colIndex]++; + if (fabs(vCollVz[thisColIndex]) < 10) + vNumCollinROFinVz10[colIndex]++; vInROFcollIndex[colIndex] = thisBcInITSROF > bcInITSROF ? 0 : 1; // if colIndex is for the first coll in ROF => inROFindex=0, otherwise =1 // if (vTracksITS567perColl[thisColIndex] > confNtracksCutVetoOnCollInROF) @@ -883,13 +885,13 @@ struct RofOccupancyQaTask { } else if (dt > -4.0 && dt <= -2.0) { // us, strict veto to suppress fake ITS-TPC matches more if (vTracksITS567perColl[thisColIndex] > confNtracksCutVetoOnCollInTimeRange / 5) nITS567tracksForVetoStandard += vTracksITS567perColl[thisColIndex]; - } else if (fabs(dt) < 10 + fabs(vZ) / driftV) { // loose veto, 8 us corresponds to maximum possible |vZ|, which is ~20 cm + } else if (fabs(dt) < 8 + fabs(vZ) / driftV) { // loose veto, 8 us corresponds to maximum possible |vZ|, which is ~20 cm // counting number of other collisions with mult above threshold if (vTracksITS567perColl[thisColIndex] > confNtracksCutVetoOnCollInTimeRange) nITS567tracksForVetoStandard += vTracksITS567perColl[thisColIndex]; } // vZ-dependent time cut to avoid collinear tracks from other collisions (experimental) - if (fabs(dt) < 10 + fabs(vZ) / driftV) { + if (fabs(dt) < 8 + fabs(vZ) / driftV) { if (dt < 0) { // check distance between given vZ and (moving in two directions) vZ of drifting tracks from past collisions if ((fabs(vCollVz[thisColIndex] - fabs(dt) * driftV - vZ) < confEpsilonDistanceForVzDependentVetoTPC) || From b182c3e02dfe8d54eae08b9338b7585803a486f7 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Wed, 20 Nov 2024 22:01:31 +0100 Subject: [PATCH 012/459] [PWGHF] Add Y cut for reco candidates and fill data sparses with abs(Y). (#8560) Co-authored-by: Mattia Faggin --- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 42 ++++++++++++++--------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index cbcfb44a85b..1594cc5e9cc 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -16,6 +16,8 @@ /// \author S. Kundu (CERN) sourav.kundu@cern.ch /// \author M. Faggin (CERN) mattia.faggin@cern.ch +#include + #include "TRandom3.h" #include "Math/Vector3D.h" #include "Math/Vector4D.h" @@ -189,6 +191,9 @@ struct TaskPolarisationCharmHadrons { Configurable activateTHnEulerPhiMonitor{"activateTHnEulerPhiMonitor", false, "Flag to switch on the monitoring THnSparse vs. Euler angle phi (Lc -> pKpi)"}; ConfigurableAxis configTHnAxisEulerPhi{"configTHnAxisEulerPhi", {24, -o2::constants::math::PI, o2::constants::math::PI}, "Euler polar angle #phi"}; + /// Application of rapidity cut for reconstructed candidates + Configurable rapidityCut{"rapidityCut", 999.f, "Max. value of reconstructed candidate rapidity (abs. value)"}; + Filter filterSelectDstarCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstarToD0Pi; Filter filterSelectLcToPKPiCandidates = (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLcToPKPi) || (aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLcToPKPi); @@ -537,18 +542,18 @@ struct TaskPolarisationCharmHadrons { if constexpr (!doMc) { // data if constexpr (withMl) { // with ML if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); + registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ - registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); } } } else { // without ML if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); + registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ - registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + registry.fill(HIST("hHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiHelicity"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); } @@ -601,18 +606,18 @@ struct TaskPolarisationCharmHadrons { if constexpr (!doMc) { // data if constexpr (withMl) { // with ML if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); + registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ - registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); } } } else { // without ML if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); + registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ - registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + registry.fill(HIST("hProduction"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiProduction"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); } @@ -665,18 +670,18 @@ struct TaskPolarisationCharmHadrons { if constexpr (!doMc) { // data if constexpr (withMl) { // with ML if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); + registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ - registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, outputMl[0], /*outputMl[1],*/ outputMl[2], charge); } } } else { // without ML if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); + registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ - registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + registry.fill(HIST("hBeam"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); if (activateTHnEulerPhiMonitor) { registry.fill(HIST("hEulerPhiBeam"), invMassCharmHad, ptCharmHad, invMassKPiLc, phiEuler, charge); } @@ -729,15 +734,15 @@ struct TaskPolarisationCharmHadrons { if constexpr (!doMc) { // data if constexpr (withMl) { // with ML if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); + registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ - registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); } } else { // without ML if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); + registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ - registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); + registry.fill(HIST("hRandom"), invMassCharmHad, ptCharmHad, numPvContributors, std::abs(rapCharmHad), invMassKPiLc, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, isRotatedCandidate, charge); } } } else { // MC --> no distinction among channels, since rotational bkg not supported @@ -1168,6 +1173,11 @@ struct TaskPolarisationCharmHadrons { continue; } + /// apply rapidity selection on the reconstructed candidate + if (std::abs(rapidity) > rapidityCut) { + continue; + } + float phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); float thetaRandom = gRandom->Uniform(0.f, constants::math::PI); ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(pxDau, pyDau, pzDau, massDau); From 0e6aba2410b9e94dc1146a8142e2b176082e79b0 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:36:26 +0100 Subject: [PATCH 013/459] [PWGHF] added flag and histograms for direct v1 calculation for cross check (#8499) Co-authored-by: Prottay Das --- .../Tasks/taskDirectedFlowCharmHadrons.cxx | 72 +++++++++++++------ 1 file changed, 52 insertions(+), 20 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index 5fae6ef48d3..5d52470a6b0 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -48,6 +48,7 @@ struct HfTaskDirectedFlowCharmHadrons { Configurable centralityMin{"centralityMin", 0., "Minimum centrality accepted in SP computation"}; Configurable centralityMax{"centralityMax", 100., "Maximum centrality accepted in SP computation"}; Configurable storeMl{"storeMl", false, "Flag to store ML scores"}; + Configurable direct{"direct", false, "Flag to calculate direct v1 odd and even"}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable> classMl{"classMl", {0, 2}, "Indices of BDT scores to be stored. Two indexes max."}; @@ -100,15 +101,23 @@ struct HfTaskDirectedFlowCharmHadrons { if (storeMl) { axes.insert(axes.end(), {thnAxisMlOne, thnAxisMlTwo}); } - registry.add("hpuxQxpvscentpteta", "hpuxQxpvscentpteta", HistType::kTHnSparseF, axes, true); - registry.add("hpuyQypvscentpteta", "hpuyQypvscentpteta", HistType::kTHnSparseF, axes, true); - registry.add("hpuxQxtvscentpteta", "hpuxQxtvscentpteta", HistType::kTHnSparseF, axes, true); - registry.add("hpuyQytvscentpteta", "hpuyQytvscentpteta", HistType::kTHnSparseF, axes, true); - registry.add("hpQxtQxpvscent", "hpQxtQxpvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); - registry.add("hpQytQypvscent", "hpQytQypvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); - registry.add("hpQxtQypvscent", "hpQxtQypvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); - registry.add("hpQxpQytvscent", "hpQxpQytvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + if (direct) { + registry.add("hpQxytpvscent", "hpQxytpvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpuxyQxypvscentpteta", "hpuxyQxypvscentpteta", HistType::kTHnSparseF, axes, true); + registry.add("hpuxyQxytvscentpteta", "hpuxyQxytvscentpteta", HistType::kTHnSparseF, axes, true); + registry.add("hpoddvscentpteta", "hpoddvscentpteta", HistType::kTHnSparseF, axes, true); + registry.add("hpevenvscentpteta", "hpevenvscentpteta", HistType::kTHnSparseF, axes, true); + } else { + registry.add("hpQxtQxpvscent", "hpQxtQxpvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQytQypvscent", "hpQytQypvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQxtQypvscent", "hpQxtQypvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQxpQytvscent", "hpQxpQytvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpuxQxpvscentpteta", "hpuxQxpvscentpteta", HistType::kTHnSparseF, axes, true); + registry.add("hpuyQypvscentpteta", "hpuyQypvscentpteta", HistType::kTHnSparseF, axes, true); + registry.add("hpuxQxtvscentpteta", "hpuxQxtvscentpteta", HistType::kTHnSparseF, axes, true); + registry.add("hpuyQytvscentpteta", "hpuyQytvscentpteta", HistType::kTHnSparseF, axes, true); + } ccdb->setURL(ccdbUrl); ccdb->setCaching(true); @@ -165,14 +174,19 @@ struct HfTaskDirectedFlowCharmHadrons { auto QxtQxp = qxZDCC * qxZDCA; auto QytQyp = qyZDCC * qyZDCA; + auto Qxytp = QxtQxp + QytQyp; auto QxpQyt = qxZDCA * qyZDCC; auto QxtQyp = qxZDCC * qyZDCA; // correlations in the denominators for SP calculation - registry.fill(HIST("hpQxtQxpvscent"), cent, QxtQxp); - registry.fill(HIST("hpQytQypvscent"), cent, QytQyp); - registry.fill(HIST("hpQxpQytvscent"), cent, QxpQyt); - registry.fill(HIST("hpQxtQypvscent"), cent, QxtQyp); + if (direct) { + registry.fill(HIST("hpQxytpvscent"), cent, Qxytp); + } else { + registry.fill(HIST("hpQxtQxpvscent"), cent, QxtQxp); + registry.fill(HIST("hpQytQypvscent"), cent, QytQyp); + registry.fill(HIST("hpQxpQytvscent"), cent, QxpQyt); + registry.fill(HIST("hpQxtQypvscent"), cent, QxtQyp); + } for (const auto& candidate : candidates) { double massCand = 0.; @@ -198,19 +212,37 @@ struct HfTaskDirectedFlowCharmHadrons { auto uy = sinNPhi; // imaginary part of candidate q vector auto uxQxp = ux * qxZDCA; auto uyQyp = uy * qyZDCA; // correlations of particle and ZDC q vectors + auto uxyQxyp = uxQxp + uyQyp; auto uxQxt = ux * qxZDCC; auto uyQyt = uy * qyZDCC; + auto uxyQxyt = uxQxt + uyQyt; + auto oddv1 = ux * (qxZDCA - qxZDCC) + uy * (qyZDCA - qyZDCC); + auto evenv1 = ux * (qxZDCA + qxZDCC) + uy * (qyZDCA + qyZDCC); if (storeMl) { - registry.fill(HIST("hpuxQxpvscentpteta"), massCand, cent, ptCand, etaCand, uxQxp, sign, outputMl[0], outputMl[1]); - registry.fill(HIST("hpuyQypvscentpteta"), massCand, cent, ptCand, etaCand, uyQyp, sign, outputMl[0], outputMl[1]); - registry.fill(HIST("hpuxQxtvscentpteta"), massCand, cent, ptCand, etaCand, uxQxt, sign, outputMl[0], outputMl[1]); - registry.fill(HIST("hpuyQytvscentpteta"), massCand, cent, ptCand, etaCand, uyQyt, sign, outputMl[0], outputMl[1]); + if (direct) { + registry.fill(HIST("hpuxyQxypvscentpteta"), massCand, cent, ptCand, etaCand, uxyQxyp, sign, outputMl[0], outputMl[1]); + registry.fill(HIST("hpuxyQxytvscentpteta"), massCand, cent, ptCand, etaCand, uxyQxyt, sign, outputMl[0], outputMl[1]); + registry.fill(HIST("hpoddvscentpteta"), massCand, cent, ptCand, etaCand, oddv1, sign, outputMl[0], outputMl[1]); + registry.fill(HIST("hpevenvscentpteta"), massCand, cent, ptCand, etaCand, evenv1, sign, outputMl[0], outputMl[1]); + } else { + registry.fill(HIST("hpuxQxpvscentpteta"), massCand, cent, ptCand, etaCand, uxQxp, sign, outputMl[0], outputMl[1]); + registry.fill(HIST("hpuyQypvscentpteta"), massCand, cent, ptCand, etaCand, uyQyp, sign, outputMl[0], outputMl[1]); + registry.fill(HIST("hpuxQxtvscentpteta"), massCand, cent, ptCand, etaCand, uxQxt, sign, outputMl[0], outputMl[1]); + registry.fill(HIST("hpuyQytvscentpteta"), massCand, cent, ptCand, etaCand, uyQyt, sign, outputMl[0], outputMl[1]); + } } else { - registry.fill(HIST("hpuxQxpvscentpteta"), massCand, cent, ptCand, etaCand, uxQxp, sign); - registry.fill(HIST("hpuyQypvscentpteta"), massCand, cent, ptCand, etaCand, uyQyp, sign); - registry.fill(HIST("hpuxQxtvscentpteta"), massCand, cent, ptCand, etaCand, uxQxt, sign); - registry.fill(HIST("hpuyQytvscentpteta"), massCand, cent, ptCand, etaCand, uyQyt, sign); + if (direct) { + registry.fill(HIST("hpuxyQxypvscentpteta"), massCand, cent, ptCand, etaCand, uxyQxyp, sign); + registry.fill(HIST("hpuxyQxytvscentpteta"), massCand, cent, ptCand, etaCand, uxyQxyt, sign); + registry.fill(HIST("hpoddvscentpteta"), massCand, cent, ptCand, etaCand, oddv1, sign); + registry.fill(HIST("hpevenvscentpteta"), massCand, cent, ptCand, etaCand, evenv1, sign); + } else { + registry.fill(HIST("hpuxQxpvscentpteta"), massCand, cent, ptCand, etaCand, uxQxp, sign); + registry.fill(HIST("hpuyQypvscentpteta"), massCand, cent, ptCand, etaCand, uyQyp, sign); + registry.fill(HIST("hpuxQxtvscentpteta"), massCand, cent, ptCand, etaCand, uxQxt, sign); + registry.fill(HIST("hpuyQytvscentpteta"), massCand, cent, ptCand, etaCand, uyQyt, sign); + } } } } From c47121524e669d2ed40ae7e6c3e571c9f7c86393 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:38:04 +0100 Subject: [PATCH 014/459] [PWGLF] Fix logic of the number of generated particles + others (#8576) --- .../derivedlambdakzeroanalysis.cxx | 447 ++++++++---------- 1 file changed, 202 insertions(+), 245 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 875192b2dbb..c40b0e6adb3 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -80,6 +80,7 @@ struct derivedlambdakzeroanalysis { Configurable calculateFeeddownMatrix{"calculateFeeddownMatrix", true, "fill feeddown matrix if MC"}; Configurable requireSel8{"requireSel8", true, "require sel8 event selection"}; + Configurable requireTriggerTVX{"requireTriggerTVX", true, "require FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level"}; Configurable rejectITSROFBorder{"rejectITSROFBorder", true, "reject events at ITS ROF border"}; Configurable rejectTFBorder{"rejectTFBorder", true, "reject events at TF border"}; Configurable requireIsVertexITSTPC{"requireIsVertexITSTPC", false, "require events with at least one ITS-TPC track"}; @@ -94,6 +95,8 @@ struct derivedlambdakzeroanalysis { Configurable requireNoCollInROFStd{"requireNoCollInROFStd", false, "reject collisions corrupted by the cannibalism, with other collisions within the same ITS ROF with mult. above a certain threshold"}; Configurable requireNoCollInROFStrict{"requireNoCollInROFStrict", false, "reject collisions corrupted by the cannibalism, with other collisions within the same ITS ROF"}; + Configurable maxZVtxPosition{"maxZVtxPosition", 10., "max Z vtx position"}; + Configurable useFT0CbasedOccupancy{"useFT0CbasedOccupancy", false, "Use sum of FT0-C amplitudes for estimating occupancy? (if not, use track-based definition)"}; // fast check on occupancy Configurable minOccupancy{"minOccupancy", -1, "minimum occupancy from neighbouring collisions"}; @@ -390,22 +393,23 @@ struct derivedlambdakzeroanalysis { histos.add("hEventSelection", "hEventSelection", kTH1F, {{20, -0.5f, +19.5f}}); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(3, "posZ cut"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(3, "kIsTriggerTVX"); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(4, "kNoITSROFrameBorder"); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(5, "kNoTimeFrameBorder"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(6, "kIsVertexITSTPC"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(7, "kIsGoodZvtxFT0vsPV"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(8, "kIsVertexTOFmatched"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(9, "kIsVertexTRDmatched"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(10, "kNoSameBunchPileup"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(11, "kNoCollInTimeRangeStd"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(12, "kNoCollInTimeRangeStrict"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(13, "kNoCollInTimeRangeNarrow"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(14, "kNoCollInTimeRangeVzDep"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(15, "kNoCollInRofStd"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(16, "kNoCollInRofStrict"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(17, "Below min occup."); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(18, "Above max occup."); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(6, "posZ cut"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(7, "kIsVertexITSTPC"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(8, "kIsGoodZvtxFT0vsPV"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(9, "kIsVertexTOFmatched"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(10, "kIsVertexTRDmatched"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(11, "kNoSameBunchPileup"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(12, "kNoCollInTimeRangeStd"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(13, "kNoCollInTimeRangeStrict"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(14, "kNoCollInTimeRangeNarrow"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(15, "kNoCollInTimeRangeVzDep"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(16, "kNoCollInRofStd"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(17, "kNoCollInRofStrict"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(18, "Below min occup."); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(19, "Above max occup."); histos.add("hEventCentrality", "hEventCentrality", kTH1F, {{100, 0.0f, +100.0f}}); histos.add("hCentralityVsNch", "hCentralityVsNch", kTH2F, {axisCentrality, axisNch}); @@ -686,7 +690,8 @@ struct derivedlambdakzeroanalysis { histos.print(); } - void initCCDB(soa::Join::iterator const& collision) + template + void initCCDB(TCollision collision) { if (mRunNumber == collision.runNumber()) { return; @@ -1339,108 +1344,214 @@ struct derivedlambdakzeroanalysis { } } - // ______________________________________________________ - // Real data processing - no MC subscription - void processRealData(soa::Join::iterator const& collision, v0Candidates const& fullV0s, dauTracks const&) + template + bool IsEventAccepted(TCollision collision, bool fillHists) + // check whether the collision passes our collision selections { - // Fire up CCDB - if ((mlConfigurations.useK0ShortScores && mlConfigurations.calculateK0ShortScores) || - (mlConfigurations.useLambdaScores && mlConfigurations.calculateLambdaScores) || - (mlConfigurations.useAntiLambdaScores && mlConfigurations.calculateAntiLambdaScores)) { - initCCDB(collision); - } + if (fillHists) + histos.fill(HIST("hEventSelection"), 0. /* all collisions */); - histos.fill(HIST("hEventSelection"), 0. /* all collisions */); if (requireSel8 && !collision.sel8()) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 1 /* sel8 collisions */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 1 /* sel8 collisions */); - if (std::abs(collision.posZ()) > 10.f) { - return; + if (requireTriggerTVX && !collision.selection_bit(aod::evsel::kIsTriggerTVX)) { + return false; } - histos.fill(HIST("hEventSelection"), 2 /* vertex-Z selected */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 2 /* FT0 vertex (acceptable FT0C-FT0A time difference) collisions */); if (rejectITSROFBorder && !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 3 /* Not at ITS ROF border */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 3 /* Not at ITS ROF border */); if (rejectTFBorder && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { - return; + return false; + } + if (fillHists) + histos.fill(HIST("hEventSelection"), 4 /* Not at TF border */); + + if (std::abs(collision.posZ()) > maxZVtxPosition) { + return false; } - histos.fill(HIST("hEventSelection"), 4 /* Not at TF border */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 5 /* vertex-Z selected */); if (requireIsVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 5 /* Contains at least one ITS-TPC track */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 6 /* Contains at least one ITS-TPC track */); if (requireIsGoodZvtxFT0VsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 6 /* PV position consistency check */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 7 /* PV position consistency check */); if (requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 7 /* PV with at least one contributor matched with TOF */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 8 /* PV with at least one contributor matched with TOF */); if (requireIsVertexTRDmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTRDmatched)) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 8 /* PV with at least one contributor matched with TRD */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 9 /* PV with at least one contributor matched with TRD */); if (rejectSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 9 /* Not at same bunch pile-up */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 10 /* Not at same bunch pile-up */); if (requireNoCollInTimeRangeStd && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 10 /* No other collision within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds*/); + if (fillHists) + histos.fill(HIST("hEventSelection"), 11 /* No other collision within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds*/); if (requireNoCollInTimeRangeStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 11 /* No other collision within +/- 10 microseconds */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 12 /* No other collision within +/- 10 microseconds */); if (requireNoCollInTimeRangeNarrow && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 12 /* No other collision within +/- 2 microseconds */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 13 /* No other collision within +/- 2 microseconds */); if (requireNoCollInTimeRangeVzDep && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeVzDependent)) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 13 /* No other collision with pvZ of drifting TPC tracks from past/future collisions within 2.5 cm the current pvZ */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 14 /* No other collision with pvZ of drifting TPC tracks from past/future collisions within 2.5 cm the current pvZ */); if (requireNoCollInROFStd && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 14 /* No other collision within the same ITS ROF with mult. above a certain threshold */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 15 /* No other collision within the same ITS ROF with mult. above a certain threshold */); if (requireNoCollInROFStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 15 /* No other collision within the same ITS ROF */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 16 /* No other collision within the same ITS ROF */); float collisionOccupancy = useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange(); if (minOccupancy > 0 && collisionOccupancy < minOccupancy) { - return; + return false; } - histos.fill(HIST("hEventSelection"), 16 /* Below min occupancy */); + if (fillHists) + histos.fill(HIST("hEventSelection"), 17 /* Below min occupancy */); + if (maxOccupancy > 0 && collisionOccupancy > maxOccupancy) { + return false; + } + if (fillHists) + histos.fill(HIST("hEventSelection"), 18 /* Above max occupancy */); + + return true; + } + + // ______________________________________________________ + // Simulated processing + // Return the list of indices to the recoed collision associated to a given MC collision. + std::vector getListOfRecoCollIndices(soa::Join const& mcCollisions, soa::Join const& collisions) + { + std::vector listBestCollisionIdx(mcCollisions.size()); + for (auto const& mcCollision : mcCollisions) { + auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); + // Find the collision with the biggest nbr of PV contributors + // Follows what was done here: https://github.com/AliceO2Group/O2Physics/blob/master/Common/TableProducer/mcCollsExtra.cxx#L93 + int biggestNContribs = -1; + int bestCollisionIndex = -1; + for (auto const& collision : groupedCollisions) { + if (biggestNContribs < collision.multPVTotalContributors()) { + biggestNContribs = collision.multPVTotalContributors(); + bestCollisionIndex = collision.globalIndex(); + } + } + listBestCollisionIdx[mcCollision.globalIndex()] = bestCollisionIndex; + } + return listBestCollisionIdx; + } + + // ______________________________________________________ + // Simulated processing + // Fill generated event information (for event loss/splitting estimation) + void fillGeneratedEventProperties(soa::Join const& mcCollisions, soa::Join const& collisions) + { + std::vector listBestCollisionIdx(mcCollisions.size()); + for (auto const& mcCollision : mcCollisions) { + histos.fill(HIST("hGenEvents"), mcCollision.multMCNParticlesEta05(), 0 /* all gen. events*/); + + auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); + // Check if there is at least one of the reconstructed collisions associated to this MC collision + // If so, we consider it + bool atLeastOne = false; + int biggestNContribs = -1; + float centrality = 100.5f; + int nCollisions = 0; + for (auto const& collision : groupedCollisions) { + + if (!IsEventAccepted(collision, false)) { + continue; + } + + if (biggestNContribs < collision.multPVTotalContributors()) { + biggestNContribs = collision.multPVTotalContributors(); + centrality = collision.centFT0C(); + } + nCollisions++; + + atLeastOne = true; + } + + histos.fill(HIST("hCentralityVsNcoll_beforeEvSel"), centrality, groupedCollisions.size()); + histos.fill(HIST("hCentralityVsNcoll_afterEvSel"), centrality, nCollisions); + + histos.fill(HIST("hCentralityVsMultMC"), centrality, mcCollision.multMCNParticlesEta05()); + + if (atLeastOne) { + histos.fill(HIST("hGenEvents"), mcCollision.multMCNParticlesEta05(), 1 /* at least 1 rec. event*/); + + histos.fill(HIST("hGenEventCentrality"), centrality); + } + } + return; + } + + // ______________________________________________________ + // Real data processing - no MC subscription + void processRealData(soa::Join::iterator const& collision, v0Candidates const& fullV0s, dauTracks const&) + { + // Fire up CCDB + if ((mlConfigurations.useK0ShortScores && mlConfigurations.calculateK0ShortScores) || + (mlConfigurations.useLambdaScores && mlConfigurations.calculateLambdaScores) || + (mlConfigurations.useAntiLambdaScores && mlConfigurations.calculateAntiLambdaScores)) { + initCCDB(collision); + } + + if (!IsEventAccepted(collision, true)) { return; } - histos.fill(HIST("hEventSelection"), 17 /* Above max occupancy */); float centrality = collision.centFT0C(); if (qaCentrality) { auto hRawCentrality = histos.get(HIST("hRawCentrality")); centrality = hRawCentrality->GetBinContent(hRawCentrality->FindBin(collision.multFT0C())); } + float collisionOccupancy = useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange(); // gap side int gapSide = collision.gapSide(); @@ -1499,99 +1610,25 @@ struct derivedlambdakzeroanalysis { // ______________________________________________________ // Simulated processing (subscribes to MC information too) - void processMonteCarlo(soa::Join::iterator const& collision, v0MCCandidates const& fullV0s, dauTracks const&, aod::MotherMCParts const&, soa::Join const& /*mccollisions*/, soa::Join const&) + void processMonteCarlo(soa::Join::iterator const& collision, v0MCCandidates const& fullV0s, dauTracks const&, aod::MotherMCParts const&, soa::Join const& /*mccollisions*/, soa::Join const&) { - histos.fill(HIST("hEventSelection"), 0. /* all collisions */); - if (requireSel8 && !collision.sel8()) { - return; - } - histos.fill(HIST("hEventSelection"), 1 /* sel8 collisions */); - - if (std::abs(collision.posZ()) > 10.f) { - return; - } - histos.fill(HIST("hEventSelection"), 2 /* vertex-Z selected */); - - if (rejectITSROFBorder && !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { - return; - } - histos.fill(HIST("hEventSelection"), 3 /* Not at ITS ROF border */); - - if (rejectTFBorder && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { - return; - } - histos.fill(HIST("hEventSelection"), 4 /* Not at TF border */); - - if (requireIsVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { - return; - } - histos.fill(HIST("hEventSelection"), 5 /* Contains at least one ITS-TPC track */); - - if (requireIsGoodZvtxFT0VsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - return; - } - histos.fill(HIST("hEventSelection"), 6 /* PV position consistency check */); - - if (requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) { - return; - } - histos.fill(HIST("hEventSelection"), 7 /* PV with at least one contributor matched with TOF */); - - if (requireIsVertexTRDmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTRDmatched)) { - return; - } - histos.fill(HIST("hEventSelection"), 8 /* PV with at least one contributor matched with TRD */); - - if (rejectSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - return; - } - histos.fill(HIST("hEventSelection"), 9 /* Not at same bunch pile-up */); - - if (requireNoCollInTimeRangeStd && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { - return; - } - histos.fill(HIST("hEventSelection"), 10 /* No other collision within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds*/); - - if (requireNoCollInTimeRangeStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { - return; - } - histos.fill(HIST("hEventSelection"), 11 /* No other collision within +/- 10 microseconds */); - - if (requireNoCollInTimeRangeNarrow && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { - return; - } - histos.fill(HIST("hEventSelection"), 12 /* No other collision within +/- 2 microseconds */); - - if (requireNoCollInTimeRangeVzDep && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeVzDependent)) { - return; - } - histos.fill(HIST("hEventSelection"), 13 /* No other collision with pvZ of drifting TPC tracks from past/future collisions within 2.5 cm the current pvZ */); - - if (requireNoCollInROFStd && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { - return; - } - histos.fill(HIST("hEventSelection"), 14 /* No other collision within the same ITS ROF with mult. above a certain threshold */); - - if (requireNoCollInROFStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) { - return; + // Fire up CCDB + if ((mlConfigurations.useK0ShortScores && mlConfigurations.calculateK0ShortScores) || + (mlConfigurations.useLambdaScores && mlConfigurations.calculateLambdaScores) || + (mlConfigurations.useAntiLambdaScores && mlConfigurations.calculateAntiLambdaScores)) { + initCCDB(collision); } - histos.fill(HIST("hEventSelection"), 15 /* No other collision within the same ITS ROF */); - float collisionOccupancy = useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange(); - if (minOccupancy > 0 && collisionOccupancy < minOccupancy) { - return; - } - histos.fill(HIST("hEventSelection"), 16 /* Below min occupancy */); - if (maxOccupancy > 0 && collisionOccupancy > maxOccupancy) { + if (!IsEventAccepted(collision, true)) { return; } - histos.fill(HIST("hEventSelection"), 17 /* Above max occupancy */); float centrality = collision.centFT0C(); if (qaCentrality) { auto hRawCentrality = histos.get(HIST("hRawCentrality")); centrality = hRawCentrality->GetBinContent(hRawCentrality->FindBin(collision.multFT0C())); } + float collisionOccupancy = useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange(); // gap side int gapSide = collision.gapSide(); @@ -1681,7 +1718,8 @@ struct derivedlambdakzeroanalysis { // Simulated processing (subscribes to MC information too) void processGenerated(soa::Join const& mcCollisions, soa::Join const& V0MCCores, soa::Join const& CascMCCores, soa::Join const& collisions) { - std::vector listBestCollisionIdx = fillGenEventHist(mcCollisions, collisions); + fillGeneratedEventProperties(mcCollisions, collisions); + std::vector listBestCollisionIdx = getListOfRecoCollIndices(mcCollisions, collisions); for (auto const& v0MC : V0MCCores) { if (!v0MC.has_straMCCollision()) continue; @@ -1689,12 +1727,12 @@ struct derivedlambdakzeroanalysis { if (!v0MC.isPhysicalPrimary()) continue; - float ptmc = RecoDecay::sqrtSumOfSquares(v0MC.pxPosMC() + v0MC.pxNegMC(), v0MC.pyPosMC() + v0MC.pyNegMC()); + float ptmc = v0MC.ptMC(); float ymc = 1e3; if (v0MC.pdgCode() == 310) - ymc = RecoDecay::y(std::array{v0MC.pxPosMC() + v0MC.pxNegMC(), v0MC.pyPosMC() + v0MC.pyNegMC(), v0MC.pzPosMC() + v0MC.pzNegMC()}, o2::constants::physics::MassKaonNeutral); + ymc = v0MC.rapidityMC(0); else if (TMath::Abs(v0MC.pdgCode()) == 3122) - ymc = RecoDecay::y(std::array{v0MC.pxPosMC() + v0MC.pxNegMC(), v0MC.pyPosMC() + v0MC.pyNegMC(), v0MC.pzPosMC() + v0MC.pzNegMC()}, o2::constants::physics::MassLambda); + ymc = v0MC.rapidityMC(1); if (TMath::Abs(ymc) > v0Selections.rapidityCut) continue; @@ -1704,6 +1742,14 @@ struct derivedlambdakzeroanalysis { if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); centrality = collision.centFT0C(); + float collisionOccupancy = useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange(); + + if (minOccupancy > 0 && collisionOccupancy < minOccupancy) { + continue; + } + if (maxOccupancy > 0 && collisionOccupancy > maxOccupancy) { + continue; + } } if (v0MC.pdgCode() == 310) { @@ -1727,12 +1773,12 @@ struct derivedlambdakzeroanalysis { if (!cascMC.isPhysicalPrimary()) continue; - float ptmc = RecoDecay::sqrtSumOfSquares(cascMC.pxMC(), cascMC.pyMC()); + float ptmc = cascMC.ptMC(); float ymc = 1e3; if (TMath::Abs(cascMC.pdgCode()) == 3312) - ymc = RecoDecay::y(std::array{cascMC.pxMC(), cascMC.pyMC(), cascMC.pzMC()}, o2::constants::physics::MassXiMinus); + ymc = cascMC.rapidityMC(0); else if (TMath::Abs(cascMC.pdgCode()) == 3334) - ymc = RecoDecay::y(std::array{cascMC.pxMC(), cascMC.pyMC(), cascMC.pzMC()}, o2::constants::physics::MassOmegaMinus); + ymc = cascMC.rapidityMC(2); if (TMath::Abs(ymc) > v0Selections.rapidityCut) continue; @@ -1742,6 +1788,14 @@ struct derivedlambdakzeroanalysis { if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); centrality = collision.centFT0C(); + float collisionOccupancy = useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange(); + + if (minOccupancy > 0 && collisionOccupancy < minOccupancy) { + continue; + } + if (maxOccupancy > 0 && collisionOccupancy > maxOccupancy) { + continue; + } } if (cascMC.pdgCode() == 3312) { @@ -1763,103 +1817,6 @@ struct derivedlambdakzeroanalysis { } } - // ______________________________________________________ - // Simulated processing - // Fill event information (for event loss estimation) and return the index to the recoed collision associated to a given MC collision. - std::vector fillGenEventHist(soa::Join const& mcCollisions, soa::Join const& collisions) - { - std::vector listBestCollisionIdx(mcCollisions.size()); - for (auto const& mcCollision : mcCollisions) { - histos.fill(HIST("hGenEvents"), mcCollision.multMCNParticlesEta05(), 0 /* all gen. events*/); - - auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); - // Check if there is at least one of the reconstructed collisions associated to this MC collision - // If so, we consider it - bool atLeastOne = false; - int biggestNContribs = -1; - int bestCollisionIndex = -1; - float centrality = 100.5f; - int nCollisions = 0; - for (auto const& collision : groupedCollisions) { - if (requireSel8 && !collision.sel8()) { - continue; - } - if (std::abs(collision.posZ()) > 10.f) { - continue; - } - if (rejectITSROFBorder && !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { - continue; - } - if (rejectTFBorder && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { - continue; - } - if (requireIsVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { - continue; - } - if (requireIsGoodZvtxFT0VsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - continue; - } - if (requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) { - continue; - } - if (requireIsVertexTRDmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTRDmatched)) { - continue; - } - if (rejectSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - continue; - } - if (requireNoCollInTimeRangeStd && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { - continue; - } - if (requireNoCollInTimeRangeStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { - continue; - } - if (requireNoCollInTimeRangeNarrow && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { - continue; - } - if (requireNoCollInTimeRangeVzDep && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeVzDependent)) { - continue; - } - if (requireNoCollInROFStd && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { - continue; - } - if (requireNoCollInROFStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) { - continue; - } - - float collisionOccupancy = useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange(); - if (minOccupancy > 0 && collisionOccupancy < minOccupancy) { - continue; - } - if (maxOccupancy > 0 && collisionOccupancy > maxOccupancy) { - continue; - } - - if (biggestNContribs < collision.multPVTotalContributors()) { - biggestNContribs = collision.multPVTotalContributors(); - bestCollisionIndex = collision.globalIndex(); - centrality = collision.centFT0C(); - } - nCollisions++; - - atLeastOne = true; - } - listBestCollisionIdx[mcCollision.globalIndex()] = bestCollisionIndex; - - histos.fill(HIST("hCentralityVsNcoll_beforeEvSel"), centrality, groupedCollisions.size()); - histos.fill(HIST("hCentralityVsNcoll_afterEvSel"), centrality, nCollisions); - - histos.fill(HIST("hCentralityVsMultMC"), centrality, mcCollision.multMCNParticlesEta05()); - - if (atLeastOne) { - histos.fill(HIST("hGenEvents"), mcCollision.multMCNParticlesEta05(), 1 /* at least 1 rec. event*/); - - histos.fill(HIST("hGenEventCentrality"), centrality); - } - } - return listBestCollisionIdx; - } - // ______________________________________________________ // Simulated processing (subscribes to MC information too) void processBinnedGenerated( From 0bc790f70d6cb88f6d27d330a84b06a36ca46d4e Mon Sep 17 00:00:00 2001 From: JaeYoonCHO Date: Wed, 20 Nov 2024 22:44:46 +0100 Subject: [PATCH 015/459] [PWGHF] Add a possibility to use ML selection in XicToXiPiPi candidate selector and task (#8520) Co-authored-by: ALICE Action Bot --- PWGHF/Core/HfMlResponseXicToXiPiPi.h | 147 ++++++++++++++++++ PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx | 146 ++++++++++++++--- PWGHF/DataModel/CandidateSelectionTables.h | 3 + .../candidateSelectorXicToXiPiPi.cxx | 62 +++++++- 4 files changed, 335 insertions(+), 23 deletions(-) create mode 100644 PWGHF/Core/HfMlResponseXicToXiPiPi.h diff --git a/PWGHF/Core/HfMlResponseXicToXiPiPi.h b/PWGHF/Core/HfMlResponseXicToXiPiPi.h new file mode 100644 index 00000000000..0a290e14d1d --- /dev/null +++ b/PWGHF/Core/HfMlResponseXicToXiPiPi.h @@ -0,0 +1,147 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file HfMlResponseXicToXiPiPi.h +/// \brief Class to compute the ML response for Ξc± → Ξ∓ π± π± analysis selections +/// \author Jaeyoon Cho , Inha University + +#ifndef PWGHF_CORE_HFMLRESPONSEXICTOXIPIPI_H_ +#define PWGHF_CORE_HFMLRESPONSEXICTOXIPIPI_H_ + +#include +#include +#include + +#include "PWGHF/Core/HfMlResponse.h" + +// Fill the map of available input features +// the key is the feature's name (std::string) +// the value is the corresponding value in EnumInputFeatures +#define FILL_MAP_XICTOXIPIPI(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesXicToXiPiPi::FEATURE) \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER from OBJECT +#define CHECK_AND_FILL_VEC_XICTOXIPIPI_FULL(OBJECT, FEATURE, GETTER) \ + case static_cast(InputFeaturesXicToXiPiPi::FEATURE): { \ + inputFeatures.emplace_back(OBJECT.GETTER()); \ + break; \ + } + +// Specific case of CHECK_AND_FILL_VEC_XICTOXIPIPI_FULL(OBJECT, FEATURE, GETTER) +// where OBJECT is named candidate and FEATURE = GETTER +#define CHECK_AND_FILL_VEC_XICTOXIPIPI(GETTER) \ + case static_cast(InputFeaturesXicToXiPiPi::GETTER): { \ + inputFeatures.emplace_back(candidate.GETTER()); \ + break; \ + } + +namespace o2::analysis +{ + +enum class InputFeaturesXicToXiPiPi : uint8_t { + ptProng0 = 0, + ptProng1, + ptProng2, + chi2PCA, + decayLength, + decayLengthNormalised, + decayLengthXY, + decayLengthXYNormalised, + cpa, + cpaXY, + cosPaXi, + cosPaXYXi, + cosPaLambda, + cosPaXYLambda, + impactParameterXY0, + impactParameterXY1, + impactParameterXY2 +}; + +template +class HfMlResponseXicToXiPiPi : public HfMlResponse +{ + public: + /// Default constructor + HfMlResponseXicToXiPiPi() = default; + /// Default destructor + virtual ~HfMlResponseXicToXiPiPi() = default; + + /// Method to get the input features vector needed for ML inference + /// \param candidate is the Xic candidate + /// \return inputFeatures vector + template + std::vector getInputFeatures(T1 const& candidate) + { + std::vector inputFeatures; + + for (const auto& idx : MlResponse::mCachedIndices) { + switch (idx) { + CHECK_AND_FILL_VEC_XICTOXIPIPI(ptProng0); + CHECK_AND_FILL_VEC_XICTOXIPIPI(ptProng1); + CHECK_AND_FILL_VEC_XICTOXIPIPI(ptProng2); + CHECK_AND_FILL_VEC_XICTOXIPIPI(chi2PCA); + CHECK_AND_FILL_VEC_XICTOXIPIPI(decayLength); + CHECK_AND_FILL_VEC_XICTOXIPIPI(decayLengthNormalised); + CHECK_AND_FILL_VEC_XICTOXIPIPI(decayLengthXY); + CHECK_AND_FILL_VEC_XICTOXIPIPI(decayLengthXYNormalised); + CHECK_AND_FILL_VEC_XICTOXIPIPI(cpa); + CHECK_AND_FILL_VEC_XICTOXIPIPI(cpaXY); + CHECK_AND_FILL_VEC_XICTOXIPIPI(cosPaXi); + CHECK_AND_FILL_VEC_XICTOXIPIPI(cosPaXYXi); + CHECK_AND_FILL_VEC_XICTOXIPIPI(cosPaLambda); + CHECK_AND_FILL_VEC_XICTOXIPIPI(cosPaXYLambda); + CHECK_AND_FILL_VEC_XICTOXIPIPI_FULL(candidate, impactParameterXY0, impactParameter0); + CHECK_AND_FILL_VEC_XICTOXIPIPI_FULL(candidate, impactParameterXY1, impactParameter1); + CHECK_AND_FILL_VEC_XICTOXIPIPI_FULL(candidate, impactParameterXY2, impactParameter2); + } + } + + return inputFeatures; + } + + protected: + /// Method to fill the map of available input features + void setAvailableInputFeatures() + { + MlResponse::mAvailableInputFeatures = { + FILL_MAP_XICTOXIPIPI(ptProng0), + FILL_MAP_XICTOXIPIPI(ptProng1), + FILL_MAP_XICTOXIPIPI(ptProng2), + FILL_MAP_XICTOXIPIPI(chi2PCA), + FILL_MAP_XICTOXIPIPI(decayLength), + FILL_MAP_XICTOXIPIPI(decayLengthNormalised), + FILL_MAP_XICTOXIPIPI(decayLengthXY), + FILL_MAP_XICTOXIPIPI(decayLengthXYNormalised), + FILL_MAP_XICTOXIPIPI(cpa), + FILL_MAP_XICTOXIPIPI(cpaXY), + FILL_MAP_XICTOXIPIPI(cosPaXi), + FILL_MAP_XICTOXIPIPI(cosPaXYXi), + FILL_MAP_XICTOXIPIPI(cosPaLambda), + FILL_MAP_XICTOXIPIPI(cosPaXYLambda), + FILL_MAP_XICTOXIPIPI(impactParameterXY0), + FILL_MAP_XICTOXIPIPI(impactParameterXY1), + FILL_MAP_XICTOXIPIPI(impactParameterXY2)}; + } +}; + +} // namespace o2::analysis + +#undef FILL_MAP_XICTOXIPIPI +#undef CHECK_AND_FILL_VEC_XICTOXIPIPI_FULL +#undef CHECK_AND_FILL_VEC_XICTOXIPIPI + +#endif // PWGHF_CORE_HFMLRESPONSEXICTOXIPIPI_H_ diff --git a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx index a5a14c734cc..726bf86d77d 100644 --- a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx +++ b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx @@ -15,6 +15,9 @@ /// /// \author Phil Lennart Stahlhut , Heidelberg University /// \author Carolina Reetz , Heidelberg University +/// \author Jaeyoon Cho , Inha University + +#include #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" @@ -42,7 +45,17 @@ struct HfTaskXicToXiPiPi { Configurable> binsPt{"binsPt", std::vector{hf_cuts_xic_to_xi_pi_pi::vecBinsPt}, "pT bin limits"}; // MC checks Configurable checkDecayTypeMc{"checkDecayTypeMc", false, "Flag to enable DecayType histogram"}; - + // THnSparese for ML selection check + Configurable enableTHn{"enableTHn", false, "Fill THnSparse for Xic"}; + ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {400, 0., 40.}, ""}; + ConfigurableAxis thnConfigAxisMass{"thnConfigAxisMass", {300, 1.8, 3.0}, ""}; + ConfigurableAxis thnConfigAxisPtProng{"thnConfigAxisPtProng", {300, 0., 30.}, ""}; + ConfigurableAxis thnConfigAxisChi2PCA{"thnConfigAxisChi2PCA", {200, 0., 20}, ""}; + ConfigurableAxis thnConfigAxisDecLength{"thnConfigAxisDecLength", {200, 0., 0.5}, ""}; + ConfigurableAxis thnConfigAxisDecLengthXY{"thnConfigAxisDecLengthXY", {200, 0., 0.5}, ""}; + ConfigurableAxis thnConfigAxisCPA{"thnConfigAxisCPA", {110, -1.1, 1.1}, ""}; + ConfigurableAxis thnConfigAxisBdtScoreBkg{"thnConfigAxisBdtScoreBkg", {100, 0., 1.}, ""}; + ConfigurableAxis thnConfigAxisBdtScoreSignal{"thnConfigAxisBdtScoreSignal", {100, 0., 1.}, ""}; // Axis ConfigurableAxis binsDecLength{"binsDecLength", {200, 0., 0.5}, ""}; ConfigurableAxis binsErrDecLength{"binsErrDecLength", {100, 0., 1.}, ""}; @@ -64,20 +77,15 @@ struct HfTaskXicToXiPiPi { void init(InitContext const&) { - if (!doprocessWithKFParticle && !doprocessWithDCAFitter && !doprocessMcWithKFParticle && !doprocessMcWithDCAFitter) { - LOGF(fatal, "No process function enabled. Please enable one."); - } - if (doprocessWithKFParticle && doprocessWithDCAFitter) { - LOGF(fatal, "Cannot enable doprocessWithKFParticle and doprocessWithDCAFitter at the same time. Please choose one."); + std::array doprocess{doprocessWithDCAFitter, doprocessWithKFParticle, doprocessWithDCAFitterAndML, doprocessWithKFParticleAndML, doprocessMcWithDCAFitter, doprocessMcWithKFParticle, doprocessMcWithDCAFitterAndML, doprocessMcWithKFParticleAndML}; + if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) == 0) { + LOGP(fatal, "No process function enabled. Please enable one."); } - if (doprocessMcWithKFParticle && doprocessMcWithDCAFitter) { - LOGF(fatal, "Cannot enable doprocessMcWithKFParticle and doprocessMcWithDCAFitter at the same time. Please choose one."); + if ((doprocessWithDCAFitter || doprocessWithDCAFitterAndML || doprocessMcWithDCAFitter || doprocessMcWithDCAFitterAndML) && (doprocessWithKFParticle || doprocessWithKFParticleAndML || doprocessMcWithKFParticle || doprocessMcWithKFParticleAndML)) { + LOGP(fatal, "Cannot enable DCAFitter and KFParticle at the same time. Please choose one."); } - if (doprocessWithKFParticle && doprocessMcWithDCAFitter) { - LOGF(fatal, "Cannot enable doprocessWithKFParticle and doprocessMcWithDCAFitter at the same time. Please choose one."); - } - if (doprocessWithDCAFitter && doprocessMcWithKFParticle) { - LOGF(fatal, "Cannot enable doprocessWithDCAFitter and doprocessMcWithKFParticle at the same time. Please choose one."); + if ((doprocessWithDCAFitter || doprocessWithKFParticle || doprocessMcWithDCAFitter || doprocessMcWithKFParticle) && (doprocessWithDCAFitterAndML || doprocessWithKFParticleAndML || doprocessMcWithDCAFitterAndML || doprocessMcWithKFParticleAndML)) { + LOGP(fatal, "Cannot enable process function with ML and process function without ML at the same time. Please choose one."); } static const AxisSpec axisMassXic = {300, 1.8, 3.0, "inv. mass (GeV/#it{c}^{2})"}; @@ -120,14 +128,14 @@ struct HfTaskXicToXiPiPi { registry.add("hMassXiPi1", "#Xi^{#plus}_{c} candidates;inv. mass #Xi^{#mp} #pi^{#pm} (prong 1) (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisMassXiRes, axisPt}}); registry.add("hMassXiPi2", "#Xi^{#plus}_{c} candidates;inv. mass #Xi^{#mp} #pi^{#pm} (prong 2) (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisMassXiRes, axisPt}}); - if (doprocessWithKFParticle) { + if (doprocessWithKFParticle || doprocessWithKFParticleAndML) { registry.add("hChi2geoXi", "#Xi^{#plus}_{c} candidates;#Xi^{#mp} #chi^{2}_{geo};entries", {HistType::kTH2F, {axisChi2, axisPt}}); registry.add("hChi2geoLam", "#Xi^{#plus}_{c} candidates;#Lambda #chi^{2}_{geo};entries", {HistType::kTH2F, {axisChi2, axisPt}}); registry.add("hChi2topoToPV", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate #chi^{2}_{topo} to PV;entries", {HistType::kTH2F, {axisChi2, axisPt}}); registry.add("hChi2topoXiToXicPlus", "#Xi^{#plus}_{c} candidates;#Xi^{#mp} candidate #chi^{2}_{topo} to #Xi^{#plus}_{c};entries", {HistType::kTH2F, {axisChi2, axisPt}}); } - if (doprocessMcWithKFParticle || doprocessMcWithDCAFitter) { + if (doprocessMcWithKFParticle || doprocessMcWithDCAFitter || doprocessMcWithKFParticleAndML || doprocessMcWithDCAFitterAndML) { // MC reconstructed registry.add("hPtGenSig", "#Xi^{#plus}_{c} candidates (gen+rec);candidate #it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{300, 0., 30.}}}); registry.add("hPtRecSig", "#Xi^{#plus}_{c} candidates (matched);candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{300, 0., 30.}}}); @@ -191,7 +199,7 @@ struct HfTaskXicToXiPiPi { registry.add("hMassXiPi2RecSig", "#Xi^{#plus}_{c} candidates (matched);inv. mass #Xi^{#mp} #pi^{#pm} (prong 2) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{300, 1.0, 2.0}, axisPt}}); registry.add("hMassXiPi2RecBg", "#Xi^{#plus}_{c} candidates (unmatched);inv. mass #Xi^{#mp} #pi^{#pm} (prong 2) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{300, 1.0, 2.0}, axisPt}}); - if (doprocessMcWithKFParticle) { + if (doprocessMcWithKFParticle || doprocessMcWithDCAFitterAndML) { registry.add("hChi2topoToPVRecSig", "#Xi^{#plus}_{c} candidates (matched);#Xi^{#plus}_{c} candidate #chi^{2}_{topo} to PV;entries", {HistType::kTH2F, {axisChi2, axisPt}}); registry.add("hChi2topoToPVRecBg", "#Xi^{#plus}_{c} candidates (unmatched);#Xi^{#plus}_{c} candidate #chi^{2}_{topo} to PV;entries", {HistType::kTH2F, {axisChi2, axisPt}}); registry.add("hChi2geoXiRecSig", "#Xi^{#plus}_{c} candidates (matched);#Xi^{#mp} #chi^{2}_{geo};entries", {HistType::kTH2F, {axisChi2, axisPt}}); @@ -235,6 +243,50 @@ struct HfTaskXicToXiPiPi { registry.get(HIST("hDecayTypeMc"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin]); } } + + if (enableTHn) { + const AxisSpec thnAxisPt{thnConfigAxisPt, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec thnAxisMass{thnConfigAxisMass, "inv. mass #Xi^{#mp} #pi^{#pm} #pi^{#pm}"}; + const AxisSpec thnAxisChi2PCA{thnConfigAxisChi2PCA, "Chi2PCA to sec. vertex (cm)"}; + const AxisSpec thnAxisDecLength{thnConfigAxisDecLength, "decay length (cm)"}; + const AxisSpec thnAxisDecLengthXY{thnConfigAxisDecLengthXY, "decay length xy (cm)"}; + const AxisSpec thnAxisCPA{thnConfigAxisCPA, "#Xi^{#plus}_{c} candidate cosine of pointing angle"}; + const AxisSpec thnAxisBdtScoreBkg{thnConfigAxisBdtScoreBkg, "BDT score of background"}; + const AxisSpec thnAxisBdtScoreSignal{thnConfigAxisBdtScoreSignal, "BDT score of prompt Xic"}; + + if (doprocessWithKFParticleAndML || doprocessWithDCAFitterAndML || doprocessMcWithKFParticleAndML || doprocessMcWithDCAFitterAndML) { + // with ML information + registry.add("hXicToXiPiPiVarsWithML", "THnSparse for Xic with ML", HistType::kTHnSparseF, {thnAxisPt, thnAxisMass, thnAxisChi2PCA, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA, thnAxisBdtScoreBkg, thnAxisBdtScoreSignal}); + } else { + // without ML information + registry.add("hXicToXiPiPiVars", "THnSparse for Xic", HistType::kTHnSparseF, {thnAxisPt, thnAxisMass, thnAxisChi2PCA, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA}); + } + } // enable THnSpare + + } // end init + + /// Fill THnSpare depending on whether ML selection is used + // \param candidate is candidate + template + void fillTHnSparse(const T1& candidate) + { + if (!enableTHn) { + return; + } + + if constexpr (useMl) { + // with ML information + double outputBkg = -99.; + double outputPrompt = -99.; + if (candidate.mlProbXicToXiPiPi().size() > 0) { + outputBkg = candidate.mlProbXicToXiPiPi()[0]; + outputPrompt = candidate.mlProbXicToXiPiPi()[1]; + } + registry.get(HIST("hXicToXiPiPiVarsWithML"))->Fill(candidate.pt(), candidate.invMassXic(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa(), outputBkg, outputPrompt); + } else { + // without ML information + registry.get(HIST("hXicToXiPiPiVars"))->Fill(candidate.pt(), candidate.invMassXic(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa()); + } } /// Selection of Xic daughter in geometrical acceptance @@ -248,7 +300,7 @@ struct HfTaskXicToXiPiPi { } /// Function to fill histograms - template + template void fillHistograms(TCanTable const& candidates) { for (const auto& candidate : candidates) { @@ -299,11 +351,20 @@ struct HfTaskXicToXiPiPi { registry.fill(HIST("hChi2geoXi"), candidate.kfCascadeChi2(), ptCandXic); registry.fill(HIST("hChi2geoLam"), candidate.kfV0Chi2(), ptCandXic); } + + // fill THnSparse + if (enableTHn) { + if constexpr (useMl) { + fillTHnSparse(candidate); + } else { + fillTHnSparse(candidate); + } + } } // candidate loop } /// Function for MC analysis and histogram filling - template + template void fillHistogramsMc(TCandTable const& candidates, soa::Join const& mcParticles, aod::TracksWMc const&) @@ -413,6 +474,15 @@ struct HfTaskXicToXiPiPi { registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_xic_to_xi_pi_pi::DecayType::NDecayType, candidate.invMassXic(), ptCandXic); } } + // fill THnSparse + if (enableTHn) { + if constexpr (useMl) { + fillTHnSparse(candidate); + } else { + fillTHnSparse(candidate); + } + } + } // rec // MC gen. level @@ -473,24 +543,38 @@ struct HfTaskXicToXiPiPi { } // gen } + /// Data analysis and fill histograms void processWithDCAFitter(soa::Filtered> const& candidates) { - fillHistograms(candidates); + fillHistograms(candidates); } PROCESS_SWITCH(HfTaskXicToXiPiPi, processWithDCAFitter, "Process data with DCAFitter", true); void processWithKFParticle(soa::Filtered> const& candidates) { - fillHistograms(candidates); + fillHistograms(candidates); } PROCESS_SWITCH(HfTaskXicToXiPiPi, processWithKFParticle, "Process data with KFParticle", false); + /// Data analysis and fill histograms with ML + void processWithDCAFitterAndML(soa::Filtered> const& candidates) + { + fillHistograms(candidates); + } + PROCESS_SWITCH(HfTaskXicToXiPiPi, processWithDCAFitterAndML, "Process data with DCAFitter and ML approach", false); + + void processWithKFParticleAndML(soa::Filtered> const& candidates) + { + fillHistograms(candidates); + } + PROCESS_SWITCH(HfTaskXicToXiPiPi, processWithKFParticleAndML, "Process data with KFParticle and ML approach", false); + /// MC analysis and fill histograms void processMcWithDCAFitter(soa::Filtered> const& candidates, soa::Join const& mcParticles, aod::TracksWMc const& tracksWMc) { - fillHistogramsMc(candidates, mcParticles, tracksWMc); + fillHistogramsMc(candidates, mcParticles, tracksWMc); } PROCESS_SWITCH(HfTaskXicToXiPiPi, processMcWithDCAFitter, "Process MC with DCAFitter", false); @@ -499,9 +583,27 @@ struct HfTaskXicToXiPiPi { soa::Join const& mcParticles, aod::TracksWMc const& tracksWMc) { - fillHistogramsMc(candidates, mcParticles, tracksWMc); + fillHistogramsMc(candidates, mcParticles, tracksWMc); } PROCESS_SWITCH(HfTaskXicToXiPiPi, processMcWithKFParticle, "Process MC with KFParticle", false); + + // MC analysis and fill histograms with ML + void processMcWithDCAFitterAndML(soa::Filtered> const& candidates, + soa::Join const& mcParticles, + aod::TracksWMc const& tracksWMc) + { + fillHistogramsMc(candidates, mcParticles, tracksWMc); + } + PROCESS_SWITCH(HfTaskXicToXiPiPi, processMcWithDCAFitterAndML, "Process MC with DCAFitter and ML approach", false); + + void processMcWithKFParticleAndML(soa::Filtered> const& candidates, + soa::Join const& mcParticles, + aod::TracksWMc const& tracksWMc) + { + fillHistogramsMc(candidates, mcParticles, tracksWMc); + } + PROCESS_SWITCH(HfTaskXicToXiPiPi, processMcWithKFParticleAndML, "Process MC with KFParticle and ML approach", false); + }; // struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGHF/DataModel/CandidateSelectionTables.h b/PWGHF/DataModel/CandidateSelectionTables.h index 071ad7c0431..583c30a5de2 100644 --- a/PWGHF/DataModel/CandidateSelectionTables.h +++ b/PWGHF/DataModel/CandidateSelectionTables.h @@ -308,6 +308,7 @@ DECLARE_SOA_COLUMN(MlProbXicToPKPi, mlProbXicToPKPi, std::vector); //! DECLARE_SOA_COLUMN(MlProbXicToPiKP, mlProbXicToPiKP, std::vector); //! // XicPlus to Xi Pi Pi DECLARE_SOA_COLUMN(IsSelXicToXiPiPi, isSelXicToXiPiPi, int); //! +DECLARE_SOA_COLUMN(MlProbXicToXiPiPi, mlProbXicToXiPiPi, std::vector); //! } // namespace hf_sel_candidate_xic DECLARE_SOA_TABLE(HfSelXicToPKPi, "AOD", "HFSELXIC", //! @@ -317,6 +318,8 @@ DECLARE_SOA_TABLE(HfMlXicToPKPi, "AOD", "HFMLXIC", //! // XicPlus to Xi Pi Pi DECLARE_SOA_TABLE(HfSelXicToXiPiPi, "AOD", "HFSELXICTOXI2PI", //! hf_sel_candidate_xic::IsSelXicToXiPiPi); +DECLARE_SOA_TABLE(HfMlXicToXiPiPi, "AOD", "HFMLXICTOXI2PI", //! + hf_sel_candidate_xic::MlProbXicToXiPiPi); namespace hf_sel_candidate_xicc { diff --git a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx index a1a76ac86ea..49b4b2df01b 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx @@ -13,12 +13,17 @@ /// \brief Ξc± → Ξ∓ π± π± candidate selector /// /// \author Phil Lennart Stahlhut , Heidelberg University +/// \author Jaeyoon Cho , Inha University + +#include +#include #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" #include "Common/Core/TrackSelectorPID.h" +#include "PWGHF/Core/HfMlResponseXicToXiPiPi.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -31,6 +36,7 @@ using namespace o2::analysis; struct HfCandidateSelectorXicToXiPiPi { Produces hfSelXicToXiPiPiCandidate; + Produces hfMlXicToXiPiPiCandidate; Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; Configurable ptCandMax{"ptCandMax", 36., "Upper bound of candidate pT"}; @@ -52,7 +58,23 @@ struct HfCandidateSelectorXicToXiPiPi { Configurable ptPidTofMax{"ptPidTofMax", 20., "Upper bound of track pT for TOF PID"}; Configurable nSigmaTofMax{"nSigmaTofMax", 5., "Nsigma cut on TOF only"}; Configurable nSigmaTofCombinedMax{"nSigmaTofCombinedMax", 5., "Nsigma cut on TOF combined with TPC"}; - + // ML inference + Configurable applyMl{"applyMl", false, "Flag to apply ML selections"}; + Configurable> binsPtMl{"binsPtMl", std::vector{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"}; + Configurable> cutDirMl{"cutDirMl", std::vector{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"}; + Configurable> cutsMl{"cutsMl", {hf_cuts_ml::cuts[0], hf_cuts_ml::nBinsPt, hf_cuts_ml::nCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"}; + Configurable nClassesMl{"nClassesMl", (int8_t)hf_cuts_ml::nCutScores, "Number of classes in ML model"}; + Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature1", "feature2"}, "Names of ML model input features"}; + // CCDB configuration + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable> modelPathsCCDB{"modelPathsCCDB", std::vector{"EventFiltering/PWGHF/BDTXicToXiPiPi"}, "Paths of models on CCDB"}; + Configurable> onnxFileNames{"onnxFileNames", std::vector{"ModelHandler_onnx_XicToXiPiPi.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; + Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + + o2::analysis::HfMlResponseXicToXiPiPi hfMlResponse; + std::vector outputMlXicToXiPiPi = {}; + o2::ccdb::CcdbApi ccdbApi; TrackSelectorPi selectorPion; TrackSelectorPr selectorProton; @@ -93,6 +115,18 @@ struct HfCandidateSelectorXicToXiPiPi { registry.get(HIST("hSelections"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); } } + + if (applyMl) { + hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); + if (loadModelsFromCCDB) { + ccdbApi.init(ccdbUrl); + hfMlResponse.setModelPathsCCDB(onnxFileNames, ccdbApi, modelPathsCCDB, timestampCCDB); + } else { + hfMlResponse.setModelPathsLocal(onnxFileNames); + } + hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); + hfMlResponse.init(); + } } /// Conjugate-independent topological cuts @@ -188,6 +222,9 @@ struct HfCandidateSelectorXicToXiPiPi { { for (const auto& hfCandXic : hfCandsXic) { int statusXicToXiPiPi = 0; + + outputMlXicToXiPiPi.clear(); + auto ptCandXic = hfCandXic.pt(); if (activateQA) { @@ -203,6 +240,9 @@ struct HfCandidateSelectorXicToXiPiPi { // topological cuts if (!selectionTopol(hfCandXic)) { hfSelXicToXiPiPiCandidate(statusXicToXiPiPi); + if (applyMl) { + hfMlXicToXiPiPiCandidate(outputMlXicToXiPiPi); + } continue; } SETBIT(statusXicToXiPiPi, SelectionStep::RecoTopol); // RecoTopol = 1 --> statusXicToXiPiPi = 3 @@ -233,6 +273,9 @@ struct HfCandidateSelectorXicToXiPiPi { if (!selectionPid(pidTrackPi0, pidTrackPi1, pidTrackPr, pidTrackPiLam, pidTrackPiXi, acceptPIDNotApplicable.value)) { hfSelXicToXiPiPiCandidate(statusXicToXiPiPi); + if (applyMl) { + hfMlXicToXiPiPiCandidate(outputMlXicToXiPiPi); + } continue; } SETBIT(statusXicToXiPiPi, SelectionStep::RecoPID); // RecoPID = 2 --> statusXicToXiPiPi = 7 @@ -241,6 +284,23 @@ struct HfCandidateSelectorXicToXiPiPi { } } + // ML selections + + if (applyMl) { + bool isSelectedMlXicToXiPiPi = false; + std::vector inputFeaturesXicToXiPiPi = hfMlResponse.getInputFeatures(hfCandXic); + + isSelectedMlXicToXiPiPi = hfMlResponse.isSelectedMl(inputFeaturesXicToXiPiPi, ptCandXic, outputMlXicToXiPiPi); + + hfMlXicToXiPiPiCandidate(outputMlXicToXiPiPi); + + if (!isSelectedMlXicToXiPiPi) { + hfSelXicToXiPiPiCandidate(statusXicToXiPiPi); + continue; + } + SETBIT(statusXicToXiPiPi, aod::SelectionStep::RecoMl); + } + hfSelXicToXiPiPiCandidate(statusXicToXiPiPi); } } From 12ecbaa826271e8a3c42a00918a1718ec5428648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 20 Nov 2024 22:59:20 +0100 Subject: [PATCH 016/459] [PWGHF,Trigger] Fix compilation warnings (#8561) --- EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx b/EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx index 1ee50ada907..5e62416a75d 100644 --- a/EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx +++ b/EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx @@ -162,7 +162,7 @@ struct HfFilterPrepareMlSamples { // Main struct auto trackFirst = cand3Prong.prong0_as(); // first daughter auto trackSecond = cand3Prong.prong1_as(); // second daughter auto trackThird = cand3Prong.prong2_as(); // third daughter - auto arrayDaughters = std::array{trackFirst, trackSecond, trackThird}; + // auto arrayDaughters = std::array{trackFirst, trackSecond, trackThird}; auto trackParFirst = getTrackPar(trackFirst); auto trackParSecond = getTrackPar(trackSecond); @@ -206,7 +206,7 @@ struct HfFilterPrepareMlSamples { // Main struct deltaMassKKFirst = std::abs(RecoDecay::m(std::array{pVecFirst, pVecSecond}, std::array{massKa, massKa}) - massPhi); deltaMassKKSecond = std::abs(RecoDecay::m(std::array{pVecThird, pVecSecond}, std::array{massKa, massKa}) - massPhi); } - int8_t sign = 0; + // int8_t sign = 0; auto flag = RecoDecay::OriginType::None; float pseudoRndm = trackFirst.pt() * 1000. - static_cast(trackFirst.pt() * 1000); From 42f8d9603c5faba54cb9703cc6ef8beeecdbbdff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 20 Nov 2024 23:00:43 +0100 Subject: [PATCH 017/459] [PWGHF] Fix compilation warnings (#8567) --- PWGHF/D2H/Macros/HFInvMassFitter.h | 13 +++++++------ PWGHF/HFC/Macros/DhCorrelationFitter.cxx | 10 ++++++++-- PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx | 2 +- PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx | 10 +++++----- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.h b/PWGHF/D2H/Macros/HFInvMassFitter.h index 6ac9357c5c2..410450de273 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.h +++ b/PWGHF/D2H/Macros/HFInvMassFitter.h @@ -20,7 +20,8 @@ #ifndef PWGHF_D2H_MACROS_HFINVMASSFITTER_H_ #define PWGHF_D2H_MACROS_HFINVMASSFITTER_H_ -#include // std::string +#include // std::cout +#include // std::string #include #include @@ -121,7 +122,7 @@ class HFInvMassFitter : public TNamed { if (mean < meanLowLimit || mean > meanUpLimit) { - cout << "Invalid Gaussian mean limmit!" << endl; + std::cout << "Invalid Gaussian mean limmit!" << std::endl; } setInitialGaussianMean(mean); mMassLowLimit = meanLowLimit; @@ -132,7 +133,7 @@ class HFInvMassFitter : public TNamed { if (mean < meanLowLimit || mean > meanUpLimit) { - cout << "Invalid Gaussian mean limmit for reflection!" << endl; + std::cout << "Invalid Gaussian mean limmit for reflection!" << std::endl; } setInitialGaussianMean(mean); mMassReflLowLimit = meanLowLimit; @@ -153,7 +154,7 @@ class HFInvMassFitter : public TNamed void setFixSecondGaussianSigma(Double_t sigma) { if (mTypeOfSgnPdf != DoubleGaus) { - cout << "Fit type should be 2Gaus!" << endl; + std::cout << "Fit type should be 2Gaus!" << std::endl; } setInitialSecondGaussianSigma(sigma); mFixedSigmaDoubleGaus = kTRUE; @@ -162,7 +163,7 @@ class HFInvMassFitter : public TNamed { if (mTypeOfSgnPdf != DoubleGaus && mTypeOfSgnPdf != DoubleGausSigmaRatioPar) { - cout << "Fit type should be 2Gaus or 2GausSigmaRatio!" << endl; + std::cout << "Fit type should be 2Gaus or 2GausSigmaRatio!" << std::endl; } setInitialFracDoubleGaus(frac); mFixedFracDoubleGaus = kTRUE; @@ -170,7 +171,7 @@ class HFInvMassFitter : public TNamed void setFixRatioToGausSigma(Double_t sigmaFrac) { if (mTypeOfSgnPdf != DoubleGausSigmaRatioPar) { - cout << "Fit type should be set to k2GausSigmaRatioPar!" << endl; + std::cout << "Fit type should be set to k2GausSigmaRatioPar!" << std::endl; } setInitialRatioDoubleGausSigma(sigmaFrac); mFixedRatioDoubleGausSigma = kTRUE; diff --git a/PWGHF/HFC/Macros/DhCorrelationFitter.cxx b/PWGHF/HFC/Macros/DhCorrelationFitter.cxx index d203c6ee63f..7e5157bb752 100644 --- a/PWGHF/HFC/Macros/DhCorrelationFitter.cxx +++ b/PWGHF/HFC/Macros/DhCorrelationFitter.cxx @@ -14,6 +14,12 @@ /// \author Samuele Cattaruzzi /// \author Swapnesh Santosh Khade +#include "DhCorrelationFitter.h" + +#include +#include +#include + #include #include #include @@ -34,10 +40,10 @@ #include #include #include -#include #include #include -#include "DhCorrelationFitter.h" + +using namespace std; DhCorrelationFitter::DhCorrelationFitter() : // default constructor fIsReflected(kFALSE), diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 3d8bf16dd31..eb99db9dbe4 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -180,7 +180,7 @@ struct HfCorrelatorD0Hadrons { Configurable applyEfficiency{"efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights"}; Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; - Configurable ptSoftPionMax{"ptSoftPionMax", 3 * 800. * pow(10., -6.), "max. pT cut for soft pion identification"}; + Configurable ptSoftPionMax{"ptSoftPionMax", 3.f * 800.f * std::pow(10.f, -6.f), "max. pT cut for soft pion identification"}; Configurable correlateD0WithLeadingParticle{"correlateD0WithLeadingParticle", false, "Switch for correlation of D0 mesons with leading particle only"}; Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its D-meson mother instead of skipping it"}; Configurable numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"}; diff --git a/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx b/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx index 03f1de6a731..fd11fad78b1 100644 --- a/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/treeCreatorDstarToD0Pi.cxx @@ -301,7 +301,7 @@ struct HfTreeCreatorDstarToD0Pi { float massDStar{-1.f}; float cosThetaD0{-1.f}; float impParameterProng0{-999.}, impParameterProng1{-999.}; - float errorImpParameterProng0{-999.}, errorImpParameterProng1{-999.}; + // float errorImpParameterProng0{-999.}, errorImpParameterProng1{-999.}; float impParameterNormalisedProng0{-999.}, impParameterNormalisedProng1{-999.}; float ptProng0{-999.}, ptProng1{-999.}; float pProng0{-999.}, pProng1{-999.}; @@ -315,8 +315,8 @@ struct HfTreeCreatorDstarToD0Pi { ptProng1 = candidate.ptProng1(); impParameterProng0 = candidate.impactParameter0(); impParameterProng1 = candidate.impactParameter1(); - errorImpParameterProng0 = candidate.errorImpactParameter0(); - errorImpParameterProng1 = candidate.errorImpactParameter1(); + // errorImpParameterProng0 = candidate.errorImpactParameter0(); + // errorImpParameterProng1 = candidate.errorImpactParameter1(); impParameterNormalisedProng0 = candidate.impactParameterNormalised0(); impParameterNormalisedProng1 = candidate.impactParameterNormalised1(); pProng0 = RecoDecay::p(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()); @@ -331,8 +331,8 @@ struct HfTreeCreatorDstarToD0Pi { ptProng1 = candidate.ptProng0(); impParameterProng0 = candidate.impactParameter1(); impParameterProng1 = candidate.impactParameter0(); - errorImpParameterProng0 = candidate.errorImpactParameter1(); - errorImpParameterProng1 = candidate.errorImpactParameter0(); + // errorImpParameterProng0 = candidate.errorImpactParameter1(); + // errorImpParameterProng1 = candidate.errorImpactParameter0(); impParameterNormalisedProng0 = candidate.impactParameterNormalised1(); impParameterNormalisedProng1 = candidate.impactParameterNormalised0(); pProng0 = RecoDecay::p(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()); From e19ec1613b9df4f45617b769db55a615fe672536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 20 Nov 2024 23:01:48 +0100 Subject: [PATCH 018/459] [PWGJE] Fix int8_t configurables (#8522) --- PWGJE/Tasks/bjetTaggingML.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/Tasks/bjetTaggingML.cxx b/PWGJE/Tasks/bjetTaggingML.cxx index e1e9d9e03d0..42f385a5c48 100644 --- a/PWGJE/Tasks/bjetTaggingML.cxx +++ b/PWGJE/Tasks/bjetTaggingML.cxx @@ -114,7 +114,7 @@ struct BJetTaggingML { Configurable> binsPtMl{"binsPtMl", std::vector{5., 1000.}, "pT bin limits for ML application"}; Configurable> cutDirMl{"cutDirMl", std::vector{cuts_ml::CutSmaller, cuts_ml::CutNot}, "Whether to reject score values greater or smaller than the threshold"}; Configurable> cutsMl{"cutsMl", {defaultCutsMl[0], 1, 2, {"pT bin 0"}, {"score for default b-jet tagging", "uncer 1"}}, "ML selections per pT bin"}; - Configurable nClassesMl{"nClassesMl", (int8_t)2, "Number of classes in ML model"}; + Configurable nClassesMl{"nClassesMl", 2, "Number of classes in ML model"}; Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature1", "feature2"}, "Names of ML model input features"}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; From 682d0f53406b03c8840411cc33cf600620573412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 20 Nov 2024 23:02:27 +0100 Subject: [PATCH 019/459] [PWGJE] Fix compilation warnings (#8568) --- PWGJE/Tasks/jetchargedv2.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGJE/Tasks/jetchargedv2.cxx b/PWGJE/Tasks/jetchargedv2.cxx index c3645ec47aa..01184740f28 100644 --- a/PWGJE/Tasks/jetchargedv2.cxx +++ b/PWGJE/Tasks/jetchargedv2.cxx @@ -246,7 +246,7 @@ struct Jetchargedv2Task { AxisSpec axisEvtPl{360, -constants::math::PI, constants::math::PI}; histosQA.add("histCentFull", "Centrality distribution for valid events", HistType::kTH1F, {axisCent}); - for (auto i = 0; i < cfgnMods->size(); i++) { + for (std::size_t i = 0; i < cfgnMods->size(); i++) { histosQA.add(Form("histQvecUncorV%d", cfgnMods->at(i)), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}}); histosQA.add(Form("histQvecRectrV%d", cfgnMods->at(i)), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}}); histosQA.add(Form("histQvecTwistV%d", cfgnMods->at(i)), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}}); @@ -351,7 +351,7 @@ struct Jetchargedv2Task { soa::Join const& jets, aod::JetTracks const& tracks) { - double collnum = 1; + // double collnum = 1; for (const auto& collision : collisions) { double leadingJetPt = -1; double leadingJetPhi = -1; @@ -370,7 +370,7 @@ struct Jetchargedv2Task { } //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// - for (auto i = 0; i < cfgnMods->size(); i++) { + for (std::size_t i = 0; i < cfgnMods->size(); i++) { int nmode = cfgnMods->at(i); int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); if (nmode == 2) { @@ -412,8 +412,8 @@ struct Jetchargedv2Task { continue; } phiMinusPsi2 = jet.phi() - evtPl2; - Double_t jetPtCorr = 0.0; - jetPtCorr = jet.pt() - collision.rho() * jet.area(); + // Double_t jetPtCorr = 0.0; + // jetPtCorr = jet.pt() - collision.rho() * jet.area(); if ((phiMinusPsi2 < TMath::Pi() / 4) || (phiMinusPsi2 >= 7 * TMath::Pi() / 4) || (phiMinusPsi2 >= 3 * TMath::Pi() / 4 && phiMinusPsi2 < 5 * TMath::Pi() / 4)) { registry.fill(HIST("h_jet_pt_in_plane_v2"), jet.pt() - (collision.rho() * jet.area()), 1.0); @@ -435,8 +435,8 @@ struct Jetchargedv2Task { continue; } phiMinusPsi3 = jet.phi() - evtPl3; - Double_t jetPtCorr = 0.0; - jetPtCorr = jet.pt() - collision.rho() * jet.area(); + // Double_t jetPtCorr = 0.0; + // jetPtCorr = jet.pt() - collision.rho() * jet.area(); if ((phiMinusPsi3 < TMath::Pi() / 4) || (phiMinusPsi3 >= 7 * TMath::Pi() / 4) || (phiMinusPsi3 >= 3 * TMath::Pi() / 4 && phiMinusPsi3 < 5 * TMath::Pi() / 4)) { registry.fill(HIST("h_jet_pt_in_plane_v3"), jet.pt() - (collision.rho() * jet.area()), 1.0); @@ -475,7 +475,7 @@ struct Jetchargedv2Task { return; } - for (auto i = 0; i < cfgnMods->size(); i++) { + for (std::size_t i = 0; i < cfgnMods->size(); i++) { TRandom3 randomNumber(0); float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); float randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); From b260227e774990691ecf2d0b869a97f744ee5458 Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Wed, 20 Nov 2024 23:06:31 +0100 Subject: [PATCH 020/459] [PWGLF] Add vertex reconstruction rate monitoring (#8539) --- PWGLF/Tasks/QC/CMakeLists.txt | 2 +- PWGLF/Tasks/QC/vertexQA.cxx | 67 ++++++++++++++++++++++++++++++++--- 2 files changed, 64 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/QC/CMakeLists.txt b/PWGLF/Tasks/QC/CMakeLists.txt index 20377eb08cb..5fba2292100 100644 --- a/PWGLF/Tasks/QC/CMakeLists.txt +++ b/PWGLF/Tasks/QC/CMakeLists.txt @@ -72,7 +72,7 @@ o2physics_add_dpl_workflow(tpc-dedx-qa o2physics_add_dpl_workflow(vertexqa SOURCES vertexQA.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(efficiencyqa diff --git a/PWGLF/Tasks/QC/vertexQA.cxx b/PWGLF/Tasks/QC/vertexQA.cxx index 5e9060d51ce..66ae298813d 100644 --- a/PWGLF/Tasks/QC/vertexQA.cxx +++ b/PWGLF/Tasks/QC/vertexQA.cxx @@ -9,14 +9,18 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include #include -#include #include -#include +#include +#include +#include -#include "Framework/runDataProcessing.h" +#include "CCDB/BasicCCDBManager.h" +#include "Common/CCDB/ctpRateFetcher.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" using namespace o2; using namespace o2::framework; @@ -34,7 +38,7 @@ double deltaTimeColl(BCcoll const bccoll1, BCcoll const bccoll2) auto coll2 = std::get(bccoll2); auto bc1 = std::get(bccoll1); auto bc2 = std::get(bccoll2); - int64_t tmpDT = int64_t(bc1.globalBC()) - int64_t(bc2.globalBC()); + int64_t tmpDT = static_cast(bc1.globalBC()) - static_cast(bc2.globalBC()); double deltaT = tmpDT * LHCBunchSpacingNS + coll1.collisionTime() - coll2.collisionTime(); return deltaT; } @@ -57,6 +61,9 @@ DECLARE_SOA_TABLE(VtxQAtable, "AOD", "VTXQATABLE", } // namespace o2::aod struct vertexQA { + Service ccdb; + ctpRateFetcher mRateFetcher; + Produces vtxQAtable; Configurable storeTree{"storeTree", 1000, "Store in tree collisions from BC's with more than 'storeTree' vertices, for in-depth analysis"}; @@ -87,10 +94,15 @@ struct vertexQA { ConfigurableAxis nContribAxis{"nContribBins", {1000, 0, 5000}, "Binning for number of contributors to PV"}; ConfigurableAxis nContribDiffAxis{"nContribDiffBins", {1000, -5000, 5000}, "Binning for the difference in number of contributors to PV"}; + ConfigurableAxis irBinning{"IRbinning", {500, 0, 100}, "Binning for the interaction rate (kHz)"}; + Configurable irSource{"irSource", "ZNC hadronic", "Source of the interaction rate"}; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; std::deque colls; + int64_t mFirstBCid = -1; + void init(InitContext const&) { histos.add("nVtxHistogram", ";#it{N}_{vtx}^{rec};Entries", HistType::kTH1F, {nVtxAxis}); @@ -121,6 +133,11 @@ struct vertexQA { histos.add("nContribITSRofTimeSeriesHistogram", ";#it{N}_{contrib}^{1};#it{N}_{contrib}^{2}", HistType::kTH2F, {nContribAxis, nContribAxis}); histos.add("tDiffDuplicateTimeSeriesHistogram", ";#Delta#it{t}_{vtx} (ns);Entries", HistType::kTH1F, {tDiffVtxAxisExtend}); + histos.add("tIRvsCollisionRateHistogram", Form(";IR from %s (kHz);IR from reconstructed vertices (kHz)", irSource.value.data()), HistType::kTH2D, {irBinning, irBinning}); + + ccdb->setURL("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setFatalWhenNull(false); } void process(aod::BC const& bc, aod::Collisions const& collisions) @@ -231,6 +248,48 @@ struct vertexQA { } } } + PROCESS_SWITCH(vertexQA, process, "Standard vertex QA", true); + + void processIR(aod::BCsWithTimestamps const& bcs, aod::Collisions const& collisions) + { + if (collisions.size() <= 2) { + return; + } + + std::vector jumps{0ll}; + int64_t lastBC = bcs.rawIteratorAt(0).globalBC(); + for (auto bc : bcs) { + if (bc.globalBC() - lastBC > 3564 * 32) { // 32 orbits + jumps.push_back(bc.globalIndex()); + lastBC = bc.globalBC(); + } + } + uint64_t jumpsSentinel{1}; + std::vector collisionsIndices{0ll}; + for (auto col : collisions) { + if (jumpsSentinel == jumps.size()) { + break; + } + if (col.bcId() > jumps[jumpsSentinel]) { + collisionsIndices.push_back(col.globalIndex()); + jumpsSentinel++; + } + } + jumps.push_back(bcs.size()); + collisionsIndices.push_back(collisions.size()); + + for (size_t i{0}; i < jumps.size() - 1; ++i) { + auto startBC = bcs.rawIteratorAt(jumps[i]); + auto endBC = bcs.rawIteratorAt(jumps[i + 1] - 1); + double startIR = mRateFetcher.fetch(ccdb.service, startBC.timestamp(), startBC.runNumber(), irSource.value); + double endIR = mRateFetcher.fetch(ccdb.service, endBC.timestamp(), endBC.runNumber(), irSource.value); + double deltaT = (endBC.globalBC() - startBC.globalBC()) * LHCBunchSpacingNS * 1.e-9; + double collisionRate = (collisionsIndices[i + 1] - collisionsIndices[i]) / deltaT; /// -1 to remove the bias of the collisions at extremities? + double ir = (startIR + endIR) * 0.5; + histos.fill(HIST("tIRvsCollisionRateHistogram"), ir * 1.e-3, collisionRate * 1.e-3); + } + } + PROCESS_SWITCH(vertexQA, processIR, "Checks on interaction rate", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 47b01a3034f1d289686a7a02aa5d5130ade0688e Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Wed, 20 Nov 2024 23:07:17 +0100 Subject: [PATCH 021/459] [PWGLF] feat: Add PDG code of ITS track to non-prompt cascade tables (#8429) --- PWGLF/DataModel/LFNonPromptCascadeTables.h | 2 ++ PWGLF/Tasks/Strangeness/nonPromptCascade.cxx | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/PWGLF/DataModel/LFNonPromptCascadeTables.h b/PWGLF/DataModel/LFNonPromptCascadeTables.h index 4bdca4b9c97..0208c7c027c 100644 --- a/PWGLF/DataModel/LFNonPromptCascadeTables.h +++ b/PWGLF/DataModel/LFNonPromptCascadeTables.h @@ -29,6 +29,7 @@ DECLARE_SOA_COLUMN(ITSClusSize, itsClusSize, float); DECLARE_SOA_COLUMN(IsGoodMatch, isGoodMatch, bool); DECLARE_SOA_COLUMN(IsGoodCascade, isGoodCascade, bool); DECLARE_SOA_COLUMN(PdgCodeMom, pdgCodeMom, int); +DECLARE_SOA_COLUMN(PdgCodeITStrack, pdgCodeITStrack, int); DECLARE_SOA_COLUMN(IsFromBeauty, isFromBeauty, bool); DECLARE_SOA_COLUMN(IsFromCharm, isFromCharm, bool); @@ -165,6 +166,7 @@ DECLARE_SOA_TABLE(NPCascTableMC, "AOD", "NPCASCTABLEMC", NPCascadeTable::IsGoodMatch, NPCascadeTable::IsGoodCascade, NPCascadeTable::PdgCodeMom, + NPCascadeTable::PdgCodeITStrack, NPCascadeTable::IsFromBeauty, NPCascadeTable::IsFromCharm, NPCascadeTable::PvX, diff --git a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx index 44e3ded502a..d9b15e16d2a 100644 --- a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx +++ b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx @@ -51,6 +51,7 @@ struct NPCascCandidate { bool isGoodMatch; bool isGoodCascade; int pdgCodeMom; + int pdgCodeITStrack; bool isFromBeauty; bool isFromCharm; float pvX; @@ -597,8 +598,9 @@ struct NonPromptCascadeTask { fromHF = isFromHF(track.mcParticle()); pdgCodeMom = track.mcParticle().has_mothers() ? track.mcParticle().mothers_as()[0].pdgCode() : 0; } + int itsTrackPDG = ITStrack.has_mcParticle() ? ITStrack.mcParticle().pdgCode() : 0; - candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), trackedCascade.itsClsSize(), isGoodMatch, isGoodCascade, pdgCodeMom, std::get<0>(fromHF), std::get<1>(fromHF), + candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), trackedCascade.itsClsSize(), isGoodMatch, isGoodCascade, pdgCodeMom, itsTrackPDG, std::get<0>(fromHF), std::get<1>(fromHF), primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ(), track.pt(), track.eta(), track.phi(), protonTrack.pt(), protonTrack.eta(), pionTrack.pt(), pionTrack.eta(), bachelor.pt(), bachelor.eta(), @@ -627,7 +629,7 @@ struct NonPromptCascadeTask { auto mcCollision = particle.mcCollision_as(); auto label = collisions.iteratorAt(c.collisionID); - NPCTableMC(c.matchingChi2, c.itsClusSize, c.isGoodMatch, c.isGoodCascade, c.pdgCodeMom, c.isFromBeauty, c.isFromCharm, + NPCTableMC(c.matchingChi2, c.itsClusSize, c.isGoodMatch, c.isGoodCascade, c.pdgCodeMom, c.pdgCodeITStrack, c.isFromBeauty, c.isFromCharm, c.pvX, c.pvY, c.pvZ, c.cascPt, c.cascEta, c.cascPhi, c.protonPt, c.protonEta, c.pionPt, c.pionEta, c.bachPt, c.bachEta, @@ -847,7 +849,7 @@ struct NonPromptCascadeTask { daughtersDCA dDCA; fillDauDCA(trackedCascade, bachelor, protonTrack, pionTrack, primaryVertex, isOmega, dDCA); - candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), trackedCascade.itsClsSize(), 0, 0, 0, 0, 0, + candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), trackedCascade.itsClsSize(), 0, 0, 0, 0, 0, 0, primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ(), track.pt(), track.eta(), track.phi(), protonTrack.pt(), protonTrack.eta(), pionTrack.pt(), pionTrack.eta(), bachelor.pt(), bachelor.eta(), From 3eb1f422f909d604df6ea42970bfc7e1386f2a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 20 Nov 2024 23:08:20 +0100 Subject: [PATCH 022/459] [PWGCF] Fix compilation warnings (#8381) Co-authored-by: ALICE Builder Co-authored-by: Victor Gonzalez --- .../Tasks/RobustFluctuationObservables.cxx | 29 ++++++++++--------- PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h | 1 - .../femtoUniverseProducerTask.cxx | 6 ++-- .../Tasks/femtoUniverseEfficiencyBase.cxx | 4 +-- ...toUniversePairTaskTrackCascadeExtended.cxx | 16 +++++----- .../Tasks/femtoUniversePairTaskTrackPhi.cxx | 18 +++++++----- .../femtoUniversePairTaskTrackV0Extended.cxx | 4 +-- PWGCF/Flow/TableProducer/ZDCQvectors.cxx | 6 ++-- PWGCF/Flow/Tasks/FlowGFWPbPb.cxx | 2 +- PWGCF/Flow/Tasks/FlowRunbyRun.cxx | 1 - PWGCF/Flow/Tasks/FlowTask.cxx | 7 ----- PWGCF/Flow/Tasks/FlowZDCtask.cxx | 2 +- .../Tasks/r2p2-4-id.cxx | 4 +-- 13 files changed, 48 insertions(+), 52 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx b/PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx index 191158c7ba0..f4d50ac9c7a 100644 --- a/PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx @@ -14,6 +14,9 @@ #include #include +#include +#include +#include #include "TF1.h" #include "TGraphErrors.h" @@ -82,7 +85,7 @@ struct RobustFluctuationObservables { // for vertex vs time: bool flagShowInfo = false; int lastRunNumber = -1; - int nBCsPerOrbit = 3564; + uint64_t nBCsPerOrbit = 3564; // bc position correlations int64_t prevOrbit = -1; @@ -101,7 +104,7 @@ struct RobustFluctuationObservables { int64_t orbitSOR = -1; // int64_t bcSORbis = -1; // global bc of the start of the first orbit - try alternative int64_t nBCsPerTF = 1; // 128*3564; // duration of TF in bcs - int64_t TFid = -1; // count time frames in a given run + uint64_t TFid = 0; // count time frames in a given run bool flagWaitForNewTF = false; uint32_t nOrbitsPerTF = 0; @@ -154,7 +157,7 @@ struct RobustFluctuationObservables { // hand-made ITS ROF cut Configurable nITSROF{"nITSROF", 6, "nITSROF"}; Configurable nITSROF_BC_offset{"nITSROF_BC_offset", 65, "nITSROF_BC_offset"}; - Configurable nITSROF_BC_cutWidth{"nITSROF_BC_cutWidth", 40, "nITSROF_BC_cutWidth"}; + Configurable nITSROF_BC_cutWidth{"nITSROF_BC_cutWidth", 40, "nITSROF_BC_cutWidth"}; // Configurable nITSROF_middle_cut_forITSonlyVert{"nITSROF_middle_cut_forITSonlyVert", 198/2 /*ROF=198 in pp*/, "nITSROF_middle_cut_forITSonlyVert"}; // Configurable nNoITSonlyVertices{"nNoITSonlyVertices", false, "nITSROF_middle_cut_forITSonlyVert"}; @@ -163,7 +166,7 @@ struct RobustFluctuationObservables { Configurable cutVzTrackT0diffUpper{"cutVzTrackT0diffUpper", 1., "cutVzTrackT0diffUpper, cm"}; // splitting of the orbit into several BC ranges - Configurable> vSplitBCpointsOfTheOrbit{"SplitBCpointsOfTheOrbit", {1200, 2000, 3000}, "BC split points of the orbit"}; + Configurable> vSplitBCpointsOfTheOrbit{"SplitBCpointsOfTheOrbit", {1200, 2000, 3000}, "BC split points of the orbit"}; // orbit QA uint32_t orbitAtCollIndexZero = 0; @@ -968,7 +971,7 @@ struct RobustFluctuationObservables { } if (myDF_ID >= 0 && myDF_ID < nHistQAplotsDF) { - int diffOrbits = (int32_t)orbit - (int32_t)orbitAtCollIndexZero; + int diffOrbits = static_cast(orbit) - static_cast(orbitAtCollIndexZero); TString strDF = Form("DF_%d", static_cast(DF_ID_raw)); fV_h1D_Orbit_vs_CollIndex[myDF_ID]->Fill(collision.index(), diffOrbits); fV_h1D_Orbit_vs_CollIndex[myDF_ID]->SetTitle(strDF); @@ -1474,23 +1477,23 @@ struct RobustFluctuationObservables { // ##### check how often we analyze collision in the same BC (and also the vZ difference) if (collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { if (prevBC != 9999) { - int32_t diff = (int32_t)collBC - (int32_t)prevBC; + int32_t diff = static_cast(collBC) - static_cast(prevBC); histosEvent.fill(HIST("hBC_DIFF_to_previous"), diff); if (diff == 0) histosEvent.fill(HIST("hBC_DIFF_to_previous_vZvZ_2D"), vZ, prev_vZ); } if (prevBcInTF >= 0) { - int32_t diffBcInTF = (int32_t)bcInTF - (int32_t)prevBcInTF; + int32_t diffBcInTF = static_cast(bcInTF) - static_cast(prevBcInTF); histosEvent.fill(HIST("hBCinTF_DIFF_to_previous"), diffBcInTF); } if (prevFoundBcInTF >= 0) { - int32_t diffGlobalBcInTF = (int32_t)foundBcInTF - (int32_t)prevFoundBcInTF; + int32_t diffGlobalBcInTF = static_cast(foundBcInTF) - static_cast(prevFoundBcInTF); histosEvent.fill(HIST("hBCinTF_DIFF_to_previous_FOUND_BC"), diffGlobalBcInTF); } // global found BC: if (prevGlobalFoundBC != 9999) { - int32_t diff = (int32_t)globalFoundBC - (int32_t)prevGlobalFoundBC; + int32_t diff = static_cast(globalFoundBC) - static_cast(prevGlobalFoundBC); histosEvent.fill(HIST("hBC_DIFF_to_previous_FOUND_BC"), diff); if (counterPVcontributorsAfterTPCcuts > 0) { @@ -1620,8 +1623,8 @@ struct RobustFluctuationObservables { histosEventBcInTF.fill(HIST("hGlobalTracks_vs_bcInTF"), bcInTF, nTracksGlobalAccepted); } - histosEvent.fill(HIST("hOrbitStartFromCollIndexZeroAft"), (int32_t)orbit - (int32_t)orbitAtCollIndexZero); - histosEvent.fill(HIST("h2D_Orbit_vs_CollIndex_Aft"), collision.index(), (int32_t)orbit - (int32_t)orbitAtCollIndexZero); + histosEvent.fill(HIST("hOrbitStartFromCollIndexZeroAft"), static_cast(orbit) - static_cast(orbitAtCollIndexZero)); + histosEvent.fill(HIST("h2D_Orbit_vs_CollIndex_Aft"), collision.index(), static_cast(orbit) - static_cast(orbitAtCollIndexZero)); histosEvent.fill(HIST("hMF"), magneticField); int MFsign = magneticField > 0 ? +1 : -1; @@ -1680,11 +1683,11 @@ struct RobustFluctuationObservables { histosEvent.fill(HIST("hBCFound_Aft"), globalFoundBC); histosEvent.fill(HIST("h2D_numContrib_vs_BC"), collBC, collision.numContrib()); - int64_t diffFoundBC_vs_BC = (int64_t)globalFoundBC - (int64_t)collBC; + int64_t diffFoundBC_vs_BC = static_cast(globalFoundBC) - static_cast(collBC); histosEvent.fill(HIST("h2D_diffFoundBC_vs_BC"), collBC, diffFoundBC_vs_BC); if (collision.has_foundBC()) - histosEvent.fill(HIST("h2D_diffFoundBC_vs_BC_inTF"), collBC, (int64_t)foundBcInTF - (int64_t)bcInTF); + histosEvent.fill(HIST("h2D_diffFoundBC_vs_BC_inTF"), collBC, static_cast(foundBcInTF) - static_cast(bcInTF)); // with FT0 conditions if (isFT0) { diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h index 74f5554bde3..957fe316eb7 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h @@ -76,7 +76,6 @@ class FemtoUniverseMath const ROOT::Math::PtEtaPhiMVector vecpart1(part1.pt(), part1.eta(), part1.phi(), mass1); const ROOT::Math::PtEtaPhiMVector vecpart2(part2.pt(), part2.eta(), part2.phi(), mass2); const ROOT::Math::PtEtaPhiMVector trackSum = vecpart1 + vecpart2; - const ROOT::Math::PtEtaPhiMVector trackDiff = vecpart1 - vecpart2; const float beta = trackSum.Beta(); const float betax = beta * std::cos(trackSum.Phi()) * std::sin(trackSum.Theta()); diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 57e77210979..2482c592275 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -1445,7 +1445,7 @@ struct femtoUniverseProducerTask { std::vector tmpPDGCodes = ConfMCTruthPDGCodes; // necessary due to some features of the Configurable for (uint32_t pdg : tmpPDGCodes) { if (static_cast(pdg) == static_cast(pdgCode)) { - if ((pdgCode == 333)) { // && (recoMcIds && recoMcIds->get().contains(particle.globalIndex()))) { // ATTENTION: all Phi mesons are NOT primary particles + if (pdgCode == 333) { // && (recoMcIds && recoMcIds->get().contains(particle.globalIndex()))) { // ATTENTION: all Phi mesons are NOT primary particles pass = true; } else { if (particle.isPhysicalPrimary() || (ConfActivateSecondaries && recoMcIds && recoMcIds->get().contains(particle.globalIndex()))) @@ -1497,11 +1497,11 @@ struct femtoUniverseProducerTask { if constexpr (resolveDaughs) { childIDs[0] = 0; childIDs[1] = 0; - for (int i = 0; i < tmpIDtrack.size(); i++) { + for (std::size_t i = 0; i < tmpIDtrack.size(); i++) { const auto& particle = tracks.iteratorAt(tmpIDtrack[i] - tracks.begin().globalIndex()); for (int daughIndex = 0, n = std::min(2ul, particle.daughtersIds().size()); daughIndex < n; daughIndex++) { // loop to find the corresponding index of the daughters - for (int j = 0; j < tmpIDtrack.size(); j++) { + for (std::size_t j = 0; j < tmpIDtrack.size(); j++) { if (tmpIDtrack[j] == particle.daughtersIds()[daughIndex]) { childIDs[daughIndex] = i - j; break; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx index 4ce8e4b3ae3..04b6424455b 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx @@ -283,7 +283,7 @@ struct femtoUniverseEfficiencyBase { { /// Histogramming same event for (auto& part : grouppartsOneMCGen) { - if (!ConfNoPDGPartOne && part.pidcut() != ConfPDGCodePartOne) { + if (!ConfNoPDGPartOne && part.tempFitVar() != ConfPDGCodePartOne) { continue; } trackHistoPartOneGen.fillQA(part); @@ -291,7 +291,7 @@ struct femtoUniverseEfficiencyBase { if (!ConfIsSame) { for (auto& part : grouppartsTwoMCGen) { - if (!ConfNoPDGPartTwo && part.pidcut() != ConfPDGCodePartTwo) { + if (!ConfNoPDGPartTwo && part.tempFitVar() != ConfPDGCodePartTwo) { continue; } trackHistoPartTwoGen.fillQA(part); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx index 03f5e5980da..914017c9b7d 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx @@ -263,7 +263,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { void processSameEvent(FilteredFDCollision& col, FemtoFullParticles& parts) { - const auto& magFieldTesla = col.magField(); + // const auto& magFieldTesla = col.magField(); auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); @@ -307,9 +307,9 @@ struct femtoUniversePairTaskTrackCascadeExtended { continue; if (!IsParticleCombined(p1, ConfTrackChoicePartOne)) continue; - const auto& posChild = parts.iteratorAt(p2.index() - 3); - const auto& negChild = parts.iteratorAt(p2.index() - 2); - const auto& bachelor = parts.iteratorAt(p2.index() - 1); + // const auto& posChild = parts.iteratorAt(p2.index() - 3); + // const auto& negChild = parts.iteratorAt(p2.index() - 2); + // const auto& bachelor = parts.iteratorAt(p2.index() - 1); /// Child particles must pass this condition to be selected /*if (!IsParticleTPC(posChild, CascChildTable[ConfCascType1][0]) || !IsParticleTPC(negChild, CascChildTable[ConfCascType1][1]) || !IsParticleTPC(bachelor, CascChildTable[ConfCascType1][2])) @@ -320,7 +320,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { } PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processSameEvent, "Enable processing same event for track - cascade", true); - void processMixedEvent(FilteredFDCollisions& cols, FemtoFullParticles& parts) + void processMixedEvent(FilteredFDCollisions& cols, FemtoFullParticles& /*parts*/) { ColumnBinningPolicy colBinning{{ConfVtxBins, ConfMultBins}, true}; @@ -341,9 +341,9 @@ struct femtoUniversePairTaskTrackCascadeExtended { if (!IsParticleCombined(p1, ConfTrackChoicePartOne)) continue; - const auto& posChild = parts.iteratorAt(p2.index() - 3); - const auto& negChild = parts.iteratorAt(p2.index() - 2); - const auto& bachelor = parts.iteratorAt(p2.index() - 1); + // const auto& posChild = parts.iteratorAt(p2.index() - 3); + // const auto& negChild = parts.iteratorAt(p2.index() - 2); + // const auto& bachelor = parts.iteratorAt(p2.index() - 1); /// Child particles must pass this condition to be selected /*if (!IsParticleTPC(posChild, CascChildTable[ConfCascType1][0]) || !IsParticleTPC(negChild, CascChildTable[ConfCascType1][1]) || !IsParticleTPC(bachelor, CascChildTable[ConfCascType1][2])) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index b5b1aeb6296..15aea7eee19 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -17,6 +17,7 @@ /// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch #include +#include #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" #include "Framework/HistogramRegistry.h" @@ -72,8 +73,8 @@ struct femtoUniversePairTaskTrackPhi { struct : o2::framework::ConfigurableGroup { Configurable ConfEfficiencyTrackPath{"ConfEfficiencyTrackPath", "", "Local path to proton efficiency TH2F file"}; Configurable ConfEfficiencyPhiPath{"ConfEfficiencyPhiPath", "", "Local path to Phi efficiency TH2F file"}; - Configurable ConfEfficiencyTrackTimestamp{"ConfEfficiencyTrackTimestamp", 0, "(long int) Timestamp for hadron"}; - Configurable ConfEfficiencyPhiTimestamp{"ConfEfficiencyPhiTimestamp", 0, "(long int) Timestamp for phi"}; + Configurable ConfEfficiencyTrackTimestamp{"ConfEfficiencyTrackTimestamp", 0, "(int64_t) Timestamp for hadron"}; + Configurable ConfEfficiencyPhiTimestamp{"ConfEfficiencyPhiTimestamp", 0, "(int64_t) Timestamp for phi"}; } ConfEff; struct : o2::framework::ConfigurableGroup { @@ -438,7 +439,7 @@ struct femtoUniversePairTaskTrackPhi { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); - long now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + int64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); ccdb->setCreatedNotAfter(now); if (!ConfEff.ConfEfficiencyTrackPath.value.empty()) { @@ -584,10 +585,11 @@ struct femtoUniversePairTaskTrackPhi { float mMassTwo = TDatabasePDG::Instance()->GetParticle(-321)->Mass(); // FIXME: Get from the PDG service of the common header for (auto& [kaon1, kaon2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsKaons, groupPartsKaons))) { - if (!IsKaonNSigma(kaon1.p(), trackCuts.getNsigmaTPC(kaon1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(kaon1, o2::track::PID::Kaon))) { - } - if (!IsKaonNSigma(kaon2.p(), trackCuts.getNsigmaTPC(kaon2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(kaon2, o2::track::PID::Kaon))) { - } + // empty if statements commented out on 20241114 to get rid of MegaLinter errors + // if (!IsKaonNSigma(kaon1.p(), trackCuts.getNsigmaTPC(kaon1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(kaon1, o2::track::PID::Kaon))) { + // } + // if (!IsKaonNSigma(kaon2.p(), trackCuts.getNsigmaTPC(kaon2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(kaon2, o2::track::PID::Kaon))) { + // } if ((kaon1.mAntiLambda() == 1) && (kaon2.mAntiLambda() == 1)) { part1Vec.SetPtEtaPhiM(kaon1.pt(), kaon1.eta(), kaon1.phi(), mMassOne); part2Vec.SetPtEtaPhiM(kaon2.pt(), kaon2.eta(), kaon2.phi(), mMassOne); @@ -765,7 +767,7 @@ struct femtoUniversePairTaskTrackPhi { registryMCtruth.fill(HIST("MCtruthKp"), part.pt(), part.eta()); registryMCtruth.fill(HIST("MCtruthKpPt"), part.pt()); } - if ((pdgCode == 333)) { + if (pdgCode == 333) { registryMCtruth.fill(HIST("MCtruthPhi"), part.pt(), part.eta()); continue; } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx index 184f74a7e7e..4810c79298d 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx @@ -517,7 +517,7 @@ struct femtoUniversePairTaskTrackV0Extended { PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMCSameEvent, "Enable processing same event for MC truth track - V0", false); /// This function processes MC same events for V0 - V0 - void processMCSameEventV0(FilteredFDCollision& col, FemtoFullParticles& parts) + void processMCSameEventV0(FilteredFDCollision& col, FemtoFullParticles& /*parts*/) { auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); const int multCol = ConfUseCent ? col.multV0M() : col.multNtr(); @@ -753,7 +753,7 @@ struct femtoUniversePairTaskTrackV0Extended { PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMCMixedEvent, "Enable processing mixed events for MC truth track - V0", false); /// This function processes MC mixed events for V0 - V0 - void processMCMixedEventV0(FilteredFDCollisions& cols, FemtoFullParticles& parts) + void processMCMixedEventV0(FilteredFDCollisions& cols, FemtoFullParticles& /*parts*/) { ColumnBinningPolicy colBinningMult{{ConfVtxBins, ConfMultBins}, true}; ColumnBinningPolicy colBinningCent{{ConfVtxBins, ConfMultBins}, true}; diff --git a/PWGCF/Flow/TableProducer/ZDCQvectors.cxx b/PWGCF/Flow/TableProducer/ZDCQvectors.cxx index 82202d86e3d..24c47443d1c 100644 --- a/PWGCF/Flow/TableProducer/ZDCQvectors.cxx +++ b/PWGCF/Flow/TableProducer/ZDCQvectors.cxx @@ -365,7 +365,7 @@ struct ZDCqvectors { cal.calibList[iteration][step] = ccdb->getForTimeStamp(ccdb_dir, timestamp); if (cal.calibList[iteration][step]) { - for (int i = 0; i < names.size(); i++) { + for (std::size_t i = 0; i < names.size(); i++) { TObject* obj = reinterpret_cast(cal.calibList[iteration][step]->FindObject(Form("%s", names[i].Data()))); if (!obj) { if (counter < 1) { @@ -426,7 +426,7 @@ struct ZDCqvectors { double getCorrection(int iteration, int step, const char* objName) { T* hist = nullptr; - double calibConstant; + double calibConstant{0}; hist = reinterpret_cast(cal.calibList[iteration][step]->FindObject(Form("%s", objName))); if (!hist) { @@ -460,7 +460,7 @@ struct ZDCqvectors { sparsePars.push_back(h->GetAxis(3)->FindBin(v[1])); sparsePars.push_back(h->GetAxis(4)->FindBin(v[2])); } - for (int i = 0; i < sparsePars.size(); i++) { + for (std::size_t i = 0; i < sparsePars.size(); i++) { h->GetAxis(i)->SetRange(sparsePars[i], sparsePars[i]); } calibConstant = h->Projection(sparsePars.size())->GetMean(); diff --git a/PWGCF/Flow/Tasks/FlowGFWPbPb.cxx b/PWGCF/Flow/Tasks/FlowGFWPbPb.cxx index 23442a4ee0b..39cddafbd2a 100644 --- a/PWGCF/Flow/Tasks/FlowGFWPbPb.cxx +++ b/PWGCF/Flow/Tasks/FlowGFWPbPb.cxx @@ -162,7 +162,7 @@ struct FlowGFWPbPb { ccdb->setCreatedNotAfter(nolaterthan.value); // Add some output objects to the histogram registry - registry.add("hEventCount", "Number of Events;; No. of Events", {HistType::kTH1D, {{kNOOFEVENTSTEPS, -0.5, kNOOFEVENTSTEPS - 0.5}}}); + registry.add("hEventCount", "Number of Events;; No. of Events", {HistType::kTH1D, {{kNOOFEVENTSTEPS, -0.5, +kNOOFEVENTSTEPS - 0.5}}}); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(kFILTERED + 1, "Filtered events"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(kSEL8 + 1, "Sel8"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(kOCCUPANCY + 1, "Occupancy"); diff --git a/PWGCF/Flow/Tasks/FlowRunbyRun.cxx b/PWGCF/Flow/Tasks/FlowRunbyRun.cxx index d24350df022..e5536500b20 100644 --- a/PWGCF/Flow/Tasks/FlowRunbyRun.cxx +++ b/PWGCF/Flow/Tasks/FlowRunbyRun.cxx @@ -185,7 +185,6 @@ struct FlowRunbyRun { for (auto& track : tracks) { TH1sList[runNumber][hPhi]->Fill(track.phi()); TH1sList[runNumber][hEta]->Fill(track.eta()); - bool WithinPtPOI = (cfgCutPtPOIMin < track.pt()) && (track.pt() < cfgCutPtPOIMax); // within POI pT range bool WithinPtRef = (cfgCutPtRefMin < track.pt()) && (track.pt() < cfgCutPtRefMax); // within RF pT range if (WithinPtRef) { fGFW->Fill(track.eta(), 1, track.phi(), wacc * weff, 1); diff --git a/PWGCF/Flow/Tasks/FlowTask.cxx b/PWGCF/Flow/Tasks/FlowTask.cxx index 7639b4af2d7..692caed6af2 100644 --- a/PWGCF/Flow/Tasks/FlowTask.cxx +++ b/PWGCF/Flow/Tasks/FlowTask.cxx @@ -546,13 +546,6 @@ struct FlowTask { // no collisions in specified time range return 0; } - float vtxz = -999; - if (collision.numContrib() > 1) { - vtxz = collision.posZ(); - float zRes = TMath::Sqrt(collision.covZZ()); - if (zRes > 0.25 && collision.numContrib() < 20) - vtxz = -999; - } auto multNTracksPV = collision.multNTracksPV(); auto occupancy = collision.trackOccupancyInTimeRange(); if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)) diff --git a/PWGCF/Flow/Tasks/FlowZDCtask.cxx b/PWGCF/Flow/Tasks/FlowZDCtask.cxx index c0a5f84210b..7efdeff3d05 100644 --- a/PWGCF/Flow/Tasks/FlowZDCtask.cxx +++ b/PWGCF/Flow/Tasks/FlowZDCtask.cxx @@ -260,7 +260,7 @@ struct FlowZDCtask { ColEvSels const& cols, BCsRun3 const& /*bcs*/, aod::Zdcs const& /*zdcs*/, - aod::FT0s const& ft0s) + aod::FT0s const& /*ft0s*/) { double sumCosPsiDiff = 0.0; // initialize Sum of cosPsiDiff for averaging double sumSinPsiDiff = 0.0; // initialize Sum of cosPsiDiff for averaging diff --git a/PWGCF/TwoParticleCorrelations/Tasks/r2p2-4-id.cxx b/PWGCF/TwoParticleCorrelations/Tasks/r2p2-4-id.cxx index f19df4ffb0e..e6c13fe1318 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/r2p2-4-id.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/r2p2-4-id.cxx @@ -51,12 +51,12 @@ struct FillFlagsTable { auto tpcnsigma = (std::vector>){TPCnsigmacutsPi, TPCnsigmacutsKa, TPCnsigmacutsPr}; auto tofpt = (std::vector>){TOFpTrangesPi, TOFpTrangesKa, TOFpTrangesPr}; auto tofnsigma = (std::vector>){TOFnsigmacutsPi, TOFnsigmacutsKa, TOFnsigmacutsPr}; - for (int8_t i = 0; i < tpcpt[species].size(); i++) + for (std::size_t i = 0; i < tpcpt[species].size(); i++) if (trackpt < tpcpt[species][i]) { tpcindex = i; break; } - for (int8_t i = 0; i < tofpt[species].size(); i++) + for (std::size_t i = 0; i < tofpt[species].size(); i++) if (trackpt >= tofpt[species][i]) { tofindex = i; break; From cc2d869ed0e768aa6084b974938e7b6ec0b72084 Mon Sep 17 00:00:00 2001 From: Ionut Cristian Arsene Date: Thu, 21 Nov 2024 01:53:57 +0100 Subject: [PATCH 023/459] [PWGDQ] Implemented ConfigurableGroup for tableMaker_withAssoc, warning fixes and explanatory comments (#8531) Co-authored-by: Ionut Cristian Arsene --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 407 +++++++++++-------- 1 file changed, 231 insertions(+), 176 deletions(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index b248c1fa1f0..d475c222f61 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -69,6 +69,7 @@ using namespace o2::aod; Zorro zorro; +// Declaration of various Joins used in the different process functions // TODO: Since DCA depends on which collision the track is associated to, we should remove writing and subscribing to DCA tables, to optimize on CPU / memory using MyBarrelTracks = soa::Join; using ExtBCs = soa::Join; +// Declaration of various bit maps containing information on which tables are included in a Join +// These are used as template arguments and checked at compile time // constexpr static uint32_t gkEventFillMap = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision; // constexpr static uint32_t gkEventFillMapWithFilter = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::EventFilter; - constexpr static uint32_t gkEventFillMapWithMults = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionMult; constexpr static uint32_t gkEventFillMapWithMultsZdc = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionMult | VarManager::ObjTypes::Zdc; constexpr static uint32_t gkEventFillMapWithMultsAndEventFilter = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionMult | VarManager::ObjTypes::CollisionMultExtra | VarManager::ObjTypes::EventFilter; @@ -128,6 +130,16 @@ constexpr static uint32_t gkMuonFillMapWithCov = VarManager::ObjTypes::Muon | Va // constexpr static uint32_t gkTrackFillMapWithAmbi = VarManager::ObjTypes::Track | VarManager::ObjTypes::AmbiTrack; constexpr static uint32_t gkMFTFillMap = VarManager::ObjTypes::TrackMFT; +// Enum containing the ordering of statistics histograms to be written in the QA file +enum SkimStatsHists { + kStatsEvent = 0, + kStatsTracks, + kStatsMuons, + kStatsOrphanTracks, + kStatsZorroInfo, + kStatsZorroSel +}; + struct TableMaker { Produces event; @@ -158,68 +170,83 @@ struct TableMaker { HistogramManager* fHistMan; // Event and track AnalysisCut configurables - Configurable fConfigEventCuts{"cfgEventCuts", "eventStandard", "Event selection"}; - Configurable fConfigTrackCuts{"cfgBarrelTrackCuts", "jpsiO2MCdebugCuts2", "Comma separated list of barrel track cuts"}; - Configurable fConfigMuonCuts{"cfgMuonCuts", "muonQualityCuts", "Comma separated list of muon cuts"}; - Configurable fConfigRunZorro{"cfgRunZorro", false, "Enable event selection with zorro [WARNING: under debug, do not enable!]"}; - Configurable fConfigZorroTrigMask{"cfgZorroTriggerMask", "fDiMuon", "DQ Trigger masks: fSingleE,fLMeeIMR,fLMeeHMR,fDiElectron,fSingleMuLow,fSingleMuHigh,fDiMuon"}; - Configurable fConfigRunZorroSel{"cfgRunZorroSel", false, "Select events with trigger mask"}; + struct : ConfigurableGroup { + Configurable fConfigEventCuts{"cfgEventCuts", "eventStandard", "Event selection"}; + Configurable fConfigTrackCuts{"cfgBarrelTrackCuts", "jpsiO2MCdebugCuts2", "Comma separated list of barrel track cuts"}; + Configurable fConfigMuonCuts{"cfgMuonCuts", "muonQualityCuts", "Comma separated list of muon cuts"}; + } fConfigCuts; + + // Zorro selection + struct : ConfigurableGroup { + Configurable fConfigRunZorro{"cfgRunZorro", false, "Enable event selection with zorro [WARNING: under debug, do not enable!]"}; + Configurable fConfigZorroTrigMask{"cfgZorroTriggerMask", "fDiMuon", "DQ Trigger masks: fSingleE,fLMeeIMR,fLMeeHMR,fDiElectron,fSingleMuLow,fSingleMuHigh,fDiMuon"}; + Configurable fConfigRunZorroSel{"cfgRunZorroSel", false, "Select events with trigger mask"}; + } fConfigZorro; // Steer QA output - Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; - Configurable fConfigDetailedQA{"cfgDetailedQA", false, "If true, include more QA histograms (BeforeCuts classes)"}; - Configurable fConfigAddEventHistogram{"cfgAddEventHistogram", "", "Comma separated list of histograms"}; - Configurable fConfigAddTrackHistogram{"cfgAddTrackHistogram", "", "Comma separated list of histograms"}; - Configurable fConfigAddMuonHistogram{"cfgAddMuonHistogram", "", "Comma separated list of histograms"}; + struct : ConfigurableGroup { + Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; + Configurable fConfigDetailedQA{"cfgDetailedQA", false, "If true, include more QA histograms (BeforeCuts classes)"}; + Configurable fConfigAddEventHistogram{"cfgAddEventHistogram", "", "Comma separated list of histograms"}; + Configurable fConfigAddTrackHistogram{"cfgAddTrackHistogram", "", "Comma separated list of histograms"}; + Configurable fConfigAddMuonHistogram{"cfgAddMuonHistogram", "", "Comma separated list of histograms"}; + } fConfigHistOutput; - // Selections to be applied as Filter on the Track and FwdTrack Configurable fIsRun2{"cfgIsRun2", false, "Whether we analyze Run-2 or Run-3 data"}; - Configurable fConfigBarrelTrackMaxAbsEta{"cfgBarrelMaxAbsEta", 0.9f, "Eta absolute value cut for tracks in the barrel"}; - Configurable fConfigBarrelTrackMinPt{"cfgBarrelMinPt", 0.5f, "Minimum pt for tracks in the barrel"}; - Configurable fConfigBarrelRequireTPC{"cfgBarrelRequireTPC", true, "Require TPC for tracks in the barrel"}; - Configurable fConfigBarrelMinTPCncls{"cfgBarrelMinTPCncls", 50.0f, "Minimum TPC cls for tracks in the barrel"}; - Configurable fConfigBarrelMaxTPCchi2{"cfgBarrelMaxTPCchi2", 10.0f, "Maximum TPC chi2/ndf for tracks in the barrel"}; - Configurable fConfigBarrelRequireITS{"cfgBarrelRequireITS", true, "Require ITS for tracks in the barrel"}; - Configurable fConfigBarrelMaxITSchi2{"cfgBarrelMaxITSchi2", 36.0f, "Maximum ITS chi2/ndf for tracks in the barrel"}; - Configurable fConfigMuonPtLow{"cfgMuonLowPt", 1.0f, "Low pt cut for muons"}; + + // Selections to be applied as Filter on the Track and FwdTrack + /*struct : ConfigurableGroup { + Configurable fConfigBarrelTrackMaxAbsEta{"cfgBarrelMaxAbsEta", 0.9f, "Eta absolute value cut for tracks in the barrel"}; + Configurable fConfigBarrelTrackMinPt{"cfgBarrelMinPt", 0.5f, "Minimum pt for tracks in the barrel"}; + Configurable fConfigBarrelRequireTPC{"cfgBarrelRequireTPC", true, "Require TPC for tracks in the barrel"}; + Configurable fConfigBarrelMinTPCncls{"cfgBarrelMinTPCncls", 50.0f, "Minimum TPC cls for tracks in the barrel"}; + Configurable fConfigBarrelMaxTPCchi2{"cfgBarrelMaxTPCchi2", 10.0f, "Maximum TPC chi2/ndf for tracks in the barrel"}; + Configurable fConfigBarrelRequireITS{"cfgBarrelRequireITS", true, "Require ITS for tracks in the barrel"}; + Configurable fConfigBarrelMaxITSchi2{"cfgBarrelMaxITSchi2", 36.0f, "Maximum ITS chi2/ndf for tracks in the barrel"}; + Configurable fConfigMuonPtLow{"cfgMuonLowPt", 1.0f, "Low pt cut for muons"}; + } fConfigFilter;*/ // CCDB connection configurables - Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable fConfigCcdbPathTPC{"ccdb-path-tpc", "Users/z/zhxiong/TPCPID/PostCalib", "base path to the ccdb object"}; - Configurable fConfigCcdbPathZorro{"ccdb-path-zorro", "/Users/m/mpuccio/EventFiltering/OTS/", "base path to the ccdb object for zorro"}; - Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; - Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; - Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable grpmagPathRun2{"grpmagPathRun2", "GLO/GRP/GRP", "CCDB path of the GRPObject (Usage for Run 2)"}; + struct : ConfigurableGroup { + Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable fConfigCcdbPathTPC{"ccdb-path-tpc", "Users/z/zhxiong/TPCPID/PostCalib", "base path to the ccdb object"}; + Configurable fConfigCcdbPathZorro{"ccdb-path-zorro", "/Users/m/mpuccio/EventFiltering/OTS/Chunked/", "base path to the ccdb object for zorro"}; + Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable fConfigGeoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + Configurable fConfigGrpMagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable fConfigGrpMagPathRun2{"grpmagPathRun2", "GLO/GRP/GRP", "CCDB path of the GRPObject (Usage for Run 2)"}; + } fConfigCCDB; // TPC postcalibration related options - Configurable fConfigComputeTPCpostCalib{"cfgTPCpostCalib", false, "If true, compute TPC post-calibrated n-sigmas(electrons, pions, protons)"}; - Configurable fConfigComputeTPCpostCalibKaon{"cfgTPCpostCalibKaon", false, "If true, compute TPC post-calibrated n-sigmas for kaons"}; - Configurable fConfigIsOnlyforMaps{"cfgIsforMaps", false, "If true, run for postcalibration maps only"}; - Configurable fConfigSaveElectronSample{"cfgSaveElectronSample", false, "If true, only save electron sample"}; - Configurable fConfigDummyRunlist{"cfgDummyRunlist", false, "If true, use dummy runlist"}; - Configurable fConfigInitRunNumber{"cfgInitRunNumber", 543215, "Initial run number used in run by run checks"}; - - // Track related options - Configurable fPropTrack{"cfgPropTrack", true, "Propagate tracks to associated collision to recalculate DCA and momentum vector"}; - - // Muon related options - Configurable fPropMuon{"cfgPropMuon", true, "Propagate muon tracks through absorber (do not use if applying pairing)"}; - Configurable fRefitGlobalMuon{"cfgRefitGlobalMuon", true, "Correct global muon parameters"}; - Configurable fMuonMatchEtaMin{"cfgMuonMatchEtaMin", -4.0f, "Definition of the acceptance of muon tracks to be matched with MFT"}; - Configurable fMuonMatchEtaMax{"cfgMuonMatchEtaMax", -2.5f, "Definition of the acceptance of muon tracks to be matched with MFT"}; + struct : ConfigurableGroup { + Configurable fConfigComputeTPCpostCalib{"cfgTPCpostCalib", false, "If true, compute TPC post-calibrated n-sigmas(electrons, pions, protons)"}; + Configurable fConfigComputeTPCpostCalibKaon{"cfgTPCpostCalibKaon", false, "If true, compute TPC post-calibrated n-sigmas for kaons"}; + Configurable fConfigIsOnlyforMaps{"cfgIsforMaps", false, "If true, run for postcalibration maps only"}; + Configurable fConfigSaveElectronSample{"cfgSaveElectronSample", false, "If true, only save electron sample"}; + Configurable fConfigDummyRunlist{"cfgDummyRunlist", false, "If true, use dummy runlist"}; + Configurable fConfigInitRunNumber{"cfgInitRunNumber", 543215, "Initial run number used in run by run checks"}; + } fConfigPostCalibTPC; + + struct : ConfigurableGroup { + // Track related options + Configurable fPropTrack{"cfgPropTrack", true, "Propagate tracks to associated collision to recalculate DCA and momentum vector"}; + // Muon related options + Configurable fPropMuon{"cfgPropMuon", true, "Propagate muon tracks through absorber (do not use if applying pairing)"}; + Configurable fRefitGlobalMuon{"cfgRefitGlobalMuon", true, "Correct global muon parameters"}; + Configurable fMuonMatchEtaMin{"cfgMuonMatchEtaMin", -4.0f, "Definition of the acceptance of muon tracks to be matched with MFT"}; + Configurable fMuonMatchEtaMax{"cfgMuonMatchEtaMax", -2.5f, "Definition of the acceptance of muon tracks to be matched with MFT"}; + } fConfigVariousOptions; Service fCCDB; + o2::ccdb::CcdbApi fCCDBApi; - o2::parameters::GRPObject* grpmagrun2 = nullptr; // for run 2, we access the GRPObject from GLO/GRP/GRP - o2::parameters::GRPMagField* grpmag = nullptr; // for run 3, we access GRPMagField from GLO/Config/GRPMagField + o2::parameters::GRPObject* fGrpMagRun2 = nullptr; // for run 2, we access the GRPObject from GLO/GRP/GRP + o2::parameters::GRPMagField* fGrpMag = nullptr; // for run 3, we access GRPMagField from GLO/Config/GRPMagField AnalysisCompositeCut* fEventCut; //! Event selection cut std::vector fTrackCuts; //! Barrel track cuts std::vector fMuonCuts; //! Muon track cuts - Service ccdb; - o2::ccdb::CcdbApi fCCDBApi; bool fDoDetailedQA = false; // Bool to set detailed QA true, if QA is set true int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. @@ -235,12 +262,12 @@ struct TableMaker { // our own Filtered tracks. If the filter is very selective, then it may be worth to run the association in this workflow // using the Common/CollisionAssociation class /*Filter barrelSelectedTracks = ifnode(fIsRun2.node() == true, track::trackType == uint8_t(track::Run2Track), track::trackType == uint8_t(track::Track)) - && track::pt > fConfigBarrelTrackMinPt - && nabs(track::eta) <= fConfigBarrelTrackMaxAbsEta - && ifnode(fConfigBarrelRequireITS.node() == true, track::itsChi2NCl < fConfigBarrelMaxITSchi2, true) - && ifnode(fConfigBarrelRequireTPC.node() == true, track::tpcNClsFound > fConfigBarrelMinTPCncls && track::tpcChi2NCl < fConfigBarrelMaxTPCchi2, true); + && track::pt > fConfigFilter.fConfigBarrelTrackMinPt + && nabs(track::eta) <= fConfigFilter.fConfigBarrelTrackMaxAbsEta + && ifnode(fConfigFilter.fConfigBarrelRequireITS.node() == true, track::itsChi2NCl < fConfigFilter.fConfigBarrelMaxITSchi2, true) + && ifnode(fConfigFilter.fConfigBarrelRequireTPC.node() == true, track::tpcNClsFound > fConfigFilter.fConfigBarrelMinTPCncls && track::tpcChi2NCl < fConfigFilter.fConfigBarrelMaxTPCchi2, true); - Filter muonFilter = o2::aod::fwdtrack::pt >= fConfigMuonPtLow;*/ + Filter muonFilter = o2::aod::fwdtrack::pt >= fConfigFilter.fConfigMuonPtLow;*/ Preslice trackIndicesPerCollision = aod::track_association::collisionId; Preslice fwdtrackIndicesPerCollision = aod::track_association::collisionId; @@ -248,93 +275,105 @@ struct TableMaker { void init(o2::framework::InitContext& context) { - DefineCuts(); - ccdb->setURL(fConfigCcdbUrl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); + // CCDB configuration + if (fConfigPostCalibTPC.fConfigComputeTPCpostCalib) { + fCCDB->setURL(fConfigCCDB.fConfigCcdbUrl.value); + fCCDB->setCaching(true); + fCCDB->setLocalObjectValidityChecking(); + // Not later than now objects + fCCDB->setCreatedNotAfter(fConfigCCDB.fConfigNoLaterThan.value); + } + fCCDBApi.init(fConfigCCDB.fConfigCcdbUrl.value); + if (!o2::base::GeometryManager::isGeometryLoaded()) { - ccdb->get(geoPath); + fCCDB->get(fConfigCCDB.fConfigGeoPath); } + // Define the event, track and muon cuts + DefineCuts(); + + // Initialize the histogram manager VarManager::SetDefaultVarNames(); fHistMan = new HistogramManager("analysisHistos", "aa", VarManager::kNVars); fHistMan->SetUseDefaultVariableNames(kTRUE); fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); // Only use detailed QA when QA is set true - if (fConfigQA && fConfigDetailedQA) { + if (fConfigHistOutput.fConfigQA && fConfigHistOutput.fConfigDetailedQA) { fDoDetailedQA = true; } // Create the histogram class names to be added to the histogram manager + // The histogram class names are added into a string and then passed to the DefineHistograms() function which + // actually configures the HistogramManager + // Histograms are defined as histogram classes / groups and filled at specific points in the analysis flow TString histClasses = ""; + // Event-wise histograms, before selection cuts if (fDoDetailedQA) { histClasses += "Event_BeforeCuts;"; } - if (fConfigQA) { + // Event-wise histograms, after selection cuts + if (fConfigHistOutput.fConfigQA) { histClasses += "Event_AfterCuts;"; } + // Check whether we have to define barrel or muon histograms bool enableBarrelHistos = (context.mOptions.get("processPPWithFilter") || context.mOptions.get("processPPWithFilterBarrelOnly") || context.mOptions.get("processPPBarrelOnly") || context.mOptions.get("processPbPb") || context.mOptions.get("processPbPbBarrelOnly") || context.mOptions.get("processPbPbBarrelOnlyWithV0Bits")); + bool enableMuonHistos = (context.mOptions.get("processPPWithFilter") || context.mOptions.get("processPPWithFilterMuonOnly") || context.mOptions.get("processPPWithFilterMuonMFT") || context.mOptions.get("processPPMuonOnly") || context.mOptions.get("processPPMuonMFT") || context.mOptions.get("processPbPb") || context.mOptions.get("processPbPbMuonOnly") || context.mOptions.get("processPbPbMuonMFT")); if (enableBarrelHistos) { + // Barrel track histograms, before selections if (fDoDetailedQA) { histClasses += "TrackBarrel_BeforeCuts;"; } - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { + // Barrel track histograms after selections; one histogram directory for each user specified selection for (auto& cut : fTrackCuts) { histClasses += Form("TrackBarrel_%s;", cut.GetName()); } } - if (fConfigIsOnlyforMaps) { + // Barrel histograms for clean samples of V0 legs used for post-calibration + if (fConfigPostCalibTPC.fConfigIsOnlyforMaps) { histClasses += "TrackBarrel_PostCalibElectron;"; histClasses += "TrackBarrel_PostCalibPion;"; histClasses += "TrackBarrel_PostCalibProton;"; } } if (enableMuonHistos) { + // Muon tracks before cuts and MFT tracks if (fDoDetailedQA) { histClasses += "Muons_BeforeCuts;"; histClasses += "MftTracks;"; } - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { + // Muon tracks after selections; one directory per selection for (auto& muonCut : fMuonCuts) { histClasses += Form("Muons_%s;", muonCut.GetName()); } } } - if (fConfigDummyRunlist) { - VarManager::SetDummyRunlist(fConfigInitRunNumber); + if (fConfigPostCalibTPC.fConfigDummyRunlist) { + VarManager::SetDummyRunlist(fConfigPostCalibTPC.fConfigInitRunNumber); } DefineHistograms(histClasses); // define all histograms VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill fOutputList.setObject(fHistMan->GetMainHistogramList()); - - // CCDB configuration - if (fConfigComputeTPCpostCalib) { - fCCDB->setURL(fConfigCcdbUrl.value); - fCCDB->setCaching(true); - fCCDB->setLocalObjectValidityChecking(); - // Not later than now objects - fCCDB->setCreatedNotAfter(fConfigNoLaterThan.value); - } - fCCDBApi.init(fConfigCcdbUrl.value); } void DefineCuts() { // Event cuts fEventCut = new AnalysisCompositeCut(true); - TString eventCutStr = fConfigEventCuts.value; + TString eventCutStr = fConfigCuts.fConfigEventCuts.value; fEventCut->AddCut(dqcuts::GetAnalysisCut(eventCutStr.Data())); // Barrel track cuts - TString cutNamesStr = fConfigTrackCuts.value; + TString cutNamesStr = fConfigCuts.fConfigTrackCuts.value; if (!cutNamesStr.IsNull()) { std::unique_ptr objArray(cutNamesStr.Tokenize(",")); for (int icut = 0; icut < objArray->GetEntries(); ++icut) { @@ -343,7 +382,7 @@ struct TableMaker { } // Muon cuts - cutNamesStr = fConfigMuonCuts.value; + cutNamesStr = fConfigCuts.fConfigMuonCuts.value; if (!cutNamesStr.IsNull()) { std::unique_ptr objArray(cutNamesStr.Tokenize(",")); for (int icut = 0; icut < objArray->GetEntries(); ++icut) { @@ -356,15 +395,16 @@ struct TableMaker { void DefineHistograms(TString histClasses) { + // Create histograms via HistogramManager std::unique_ptr objArray(histClasses.Tokenize(";")); for (Int_t iclass = 0; iclass < objArray->GetEntries(); ++iclass) { TString classStr = objArray->At(iclass)->GetName(); - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { fHistMan->AddHistClass(classStr.Data()); } // fill the THn histograms - if (fConfigIsOnlyforMaps) { + if (fConfigPostCalibTPC.fConfigIsOnlyforMaps) { if (classStr.Contains("PostCalibElectron")) { dqhistograms::DefineHistograms(fHistMan, objArray->At(iclass)->GetName(), "track", "postcalib_electron"); } @@ -376,43 +416,42 @@ struct TableMaker { } } - TString histEventName = fConfigAddEventHistogram.value; + TString histEventName = fConfigHistOutput.fConfigAddEventHistogram.value; if (classStr.Contains("Event")) { - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { dqhistograms::DefineHistograms(fHistMan, objArray->At(iclass)->GetName(), "event", histEventName); } } - TString histTrackName = fConfigAddTrackHistogram.value; + TString histTrackName = fConfigHistOutput.fConfigAddTrackHistogram.value; if (classStr.Contains("Track")) { - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { dqhistograms::DefineHistograms(fHistMan, objArray->At(iclass)->GetName(), "track", histTrackName); } } - TString histMuonName = fConfigAddMuonHistogram.value; + TString histMuonName = fConfigHistOutput.fConfigAddMuonHistogram.value; if (classStr.Contains("Muons")) { - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { dqhistograms::DefineHistograms(fHistMan, objArray->At(iclass)->GetName(), "track", histMuonName); } } - TString histMftName = fConfigAddMuonHistogram.value; + TString histMftName = fConfigHistOutput.fConfigAddMuonHistogram.value; if (classStr.Contains("Mft")) { - if (fConfigDetailedQA) { + if (fConfigHistOutput.fConfigDetailedQA) { dqhistograms::DefineHistograms(fHistMan, objArray->At(iclass)->GetName(), "track", histMftName); } } } - // create statistics histograms - // 0: Event statistics - // 1: Track statistics - // 2: Muon statistics - // 3: Orphan track statistics - // 4: Zorro information - // 5: Zorro trigger selection - // NOTE: Please keep the order of the histograms in the list + // Create statistics histograms which will be stored in the QA output + // Event statistics: kStatsEvent + // Track statistics: kStatsTracks + // Muon statistics: kStatsMuons + // Orphan track statistics: kStatsOrphanTracks + // Zorro information: kStatsZorroInfo + // Zorro trigger selection: kStatsZorroSel fStatsList.setObject(new TList()); fStatsList->SetOwner(kTRUE); std::vector eventLabels{"BCs", "Collisions before filtering", "Before cuts", "After cuts"}; @@ -425,7 +464,7 @@ struct TableMaker { histEvents->GetYaxis()->SetBinLabel(ib, o2::aod::evsel::selectionLabels[ib - 1]); } histEvents->GetYaxis()->SetBinLabel(o2::aod::evsel::kNsel + 1, "Total"); - fStatsList->Add(histEvents); // At index 0 + fStatsList->AddAt(histEvents, kStatsEvent); // Track statistics: one bin for each track selection and 5 bins for V0 tags (gamma, K0s, Lambda, anti-Lambda, Omega) TH1D* histTracks = new TH1D("TrackStats", "Track statistics", fTrackCuts.size() + 5.0, -0.5, fTrackCuts.size() - 0.5 + 5.0); @@ -437,23 +476,25 @@ struct TableMaker { for (ib = 0; ib < 5; ib++) { histTracks->GetXaxis()->SetBinLabel(fTrackCuts.size() + 1 + ib, v0TagNames[ib]); } - fStatsList->Add(histTracks); // At index 1 + fStatsList->AddAt(histTracks, kStatsTracks); + TH1D* histMuons = new TH1D("MuonStats", "Muon statistics", fMuonCuts.size(), -0.5, fMuonCuts.size() - 0.5); ib = 1; for (auto cut = fMuonCuts.begin(); cut != fMuonCuts.end(); cut++, ib++) { histMuons->GetXaxis()->SetBinLabel(ib, (*cut).GetName()); } - fStatsList->Add(histMuons); // At index 2 + fStatsList->AddAt(histMuons, kStatsMuons); + TH1D* histOrphanTracks = new TH1D("histOrphanTracks", "Orphan Track statistics", 2, -1, 1); histOrphanTracks->GetXaxis()->SetBinLabel(1, "Track w/o collision ID"); histOrphanTracks->GetXaxis()->SetBinLabel(2, "Track with +ve collision ID"); - fStatsList->Add(histOrphanTracks); // At index 3 + fStatsList->AddAt(histOrphanTracks, kStatsOrphanTracks); TH2D* histZorroInfo = new TH2D("ZorroInfo", "Zorro information", 1, -0.5, 0.5, 1, -0.5, 0.5); - fStatsList->Add(histZorroInfo); // At index 4 + fStatsList->AddAt(histZorroInfo, kStatsZorroInfo); TH2D* histZorroSel = new TH2D("ZorroSel", "trigger of interested", 1, -0.5, 0.5, 1, -0.5, 0.5); - fStatsList->Add(histZorroSel); // At index 5 + fStatsList->AddAt(histZorroSel, kStatsZorroSel); } template @@ -461,7 +502,7 @@ struct TableMaker { TTrackAssoc const& trackAssocs, TTracks const& tracks) { // Skim collisions - // NOTE: So far, collisions are filtered based on the user specified analysis cuts and the filterPP event filter. + // NOTE: So far, collisions are filtered based on the user specified analysis cuts AND the filterPP or Zorro event filter. // The collision-track associations which point to an event that is not selected for writing are discarded! fCollIndexMap.clear(); @@ -482,10 +523,10 @@ struct TableMaker { for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (reinterpret_cast(fStatsList->At(0)))->Fill(1.0, static_cast(i)); + (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(1.0, static_cast(i)); } } - (reinterpret_cast(fStatsList->At(0)))->Fill(1.0, static_cast(o2::aod::evsel::kNsel)); + (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(1.0, static_cast(o2::aod::evsel::kNsel)); // apply the event filter computed by filter-PP if constexpr ((TEventFillMap & VarManager::ObjTypes::EventFilter) > 0) { @@ -528,20 +569,20 @@ struct TableMaker { // fill stats information, before selections for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (reinterpret_cast(fStatsList->At(0)))->Fill(2.0, static_cast(i)); + (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(2.0, static_cast(i)); } } - (reinterpret_cast(fStatsList->At(0)))->Fill(2.0, static_cast(o2::aod::evsel::kNsel)); + (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(2.0, static_cast(o2::aod::evsel::kNsel)); - if (fConfigRunZorro) { - zorro.setBaseCCDBPath(fConfigCcdbPathZorro.value); - zorro.initCCDB(fCCDB.service, fCurrentRun, bc.timestamp(), fConfigZorroTrigMask.value); - zorro.populateExternalHists(fCurrentRun, reinterpret_cast(fStatsList->At(4)), reinterpret_cast(fStatsList->At(5))); - bool zorroSel = zorro.isSelected(bc.globalBC(), 100UL, reinterpret_cast(fStatsList->At(5))); + if (fConfigZorro.fConfigRunZorro) { + zorro.setBaseCCDBPath(fConfigCCDB.fConfigCcdbPathZorro.value); + zorro.initCCDB(fCCDB.service, fCurrentRun, bc.timestamp(), fConfigZorro.fConfigZorroTrigMask.value); + zorro.populateExternalHists(fCurrentRun, reinterpret_cast(fStatsList->At(kStatsZorroInfo)), reinterpret_cast(fStatsList->At(kStatsZorroSel))); + bool zorroSel = zorro.isSelected(bc.globalBC(), 100UL, reinterpret_cast(fStatsList->At(kStatsZorroSel))); if (zorroSel) { tag |= (static_cast(true) << 56); // the same bit is used for this zorro selections from ccdb } - if (fConfigRunZorroSel && (!zorroSel || !fEventCut->IsSelected(VarManager::fgValues))) { + if (fConfigZorro.fConfigRunZorroSel && (!zorroSel || !fEventCut->IsSelected(VarManager::fgValues))) { continue; } } else { @@ -553,10 +594,10 @@ struct TableMaker { // fill stats information, after selections for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (reinterpret_cast(fStatsList->At(0)))->Fill(3.0, static_cast(i)); + (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(3.0, static_cast(i)); } } - (reinterpret_cast(fStatsList->At(0)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); + (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); fHistMan->FillHistClass("Event_AfterCuts", VarManager::fgValues); @@ -613,22 +654,23 @@ struct TableMaker { // Tracks are written only once, even if they constribute to more than one association uint64_t trackFilteringTag = static_cast(0); - uint64_t trackTempFilterMap = uint8_t(0); + uint32_t trackTempFilterMap = static_cast(0); // material correction for track propagation + // TODO: Do we need a configurable to switch between different material correction options? // o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; for (const auto& assoc : assocs) { - // get track + // get the track auto track = assoc.template track_as(); trackFilteringTag = static_cast(0); - trackTempFilterMap = uint8_t(0); + trackTempFilterMap = static_cast(0); VarManager::FillTrack(track); // compute quantities which depend on the associated collision, such as DCA - if (fPropTrack && (track.collisionId() != collision.globalIndex())) { + if (fConfigVariousOptions.fPropTrack && (track.collisionId() != collision.globalIndex())) { VarManager::FillTrackCollisionMatCorr(track, collision, noMatCorr, o2::base::Propagator::Instance()); } @@ -640,13 +682,13 @@ struct TableMaker { int i = 0; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, i++) { if ((*cut).IsSelected(VarManager::fgValues)) { - trackTempFilterMap |= (uint8_t(1) << i); - // NOTE: the QA is filled here for every (collision,track) association since the results of the track cuts can be different depending on which collision is associated (e.g. DCA cuts) - // TODO: create a statistics histograms with unique tracks - if (fConfigQA) { + trackTempFilterMap |= (static_cast(1) << i); + // NOTE: the QA is filled here just for the first occurence of this track. + // So if there are histograms of quantities which depend on the collision association, these will not be accurate + if (fConfigHistOutput.fConfigQA && (fTrackIndexMap.find(track.globalIndex()) == fTrackIndexMap.end())) { fHistMan->FillHistClass(Form("TrackBarrel_%s", (*cut).GetName()), VarManager::fgValues); } - (reinterpret_cast(fStatsList->At(1)))->Fill(static_cast(i)); + (reinterpret_cast(fStatsList->At(kStatsTracks)))->Fill(static_cast(i)); } } if (!trackTempFilterMap) { @@ -658,10 +700,10 @@ struct TableMaker { trackFilteringTag |= static_cast(track.pidbit()); for (int iv0 = 0; iv0 < 5; iv0++) { if (track.pidbit() & (uint8_t(1) << iv0)) { - (reinterpret_cast(fStatsList->At(1)))->Fill(fTrackCuts.size() + static_cast(iv0)); + (reinterpret_cast(fStatsList->At(kStatsTracks)))->Fill(fTrackCuts.size() + static_cast(iv0)); } } - if (fConfigIsOnlyforMaps) { + if (fConfigPostCalibTPC.fConfigIsOnlyforMaps) { if (trackFilteringTag & (static_cast(1) << VarManager::kIsConversionLeg)) { // for electron fHistMan->FillHistClass("TrackBarrel_PostCalibElectron", VarManager::fgValues); } @@ -675,7 +717,7 @@ struct TableMaker { fHistMan->FillHistClass("TrackBarrel_PostCalibProton", VarManager::fgValues); } } - if (fConfigSaveElectronSample) { // only save electron sample + if (fConfigPostCalibTPC.fConfigSaveElectronSample) { // only save electron sample if (!(trackFilteringTag & (static_cast(1) << VarManager::kIsConversionLeg))) { continue; } @@ -687,25 +729,28 @@ struct TableMaker { trackFilteringTag |= (static_cast(trackTempFilterMap) << VarManager::kBarrelUserCutsBits); // BIT13-...: user track filters if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackPID)) { - if (fConfigComputeTPCpostCalib) { + if (fConfigPostCalibTPC.fConfigComputeTPCpostCalib) { trackFilteringTag |= (static_cast(1) << VarManager::kIsTPCPostcalibrated); } } // write the track global index in the map for skimming (to make sure we have it just once) if (fTrackIndexMap.find(track.globalIndex()) == fTrackIndexMap.end()) { - // NOTE: The collision ID that is written in the table is the one found in the first association for this track. - // However, in data analysis one should loop over associations, so this one should not be used. - // In the case of Run2-like analysis, there will be no associations, so this ID will be the one originally assigned in the AO2Ds (updated for the skims) - // reducedEventIdx = fCollIndexMap[collision.globalIndex()]; // This gives the first collision form the table // Calculating the percentage of orphan tracks i.e., tracks which have no collisions associated to it if (!track.has_collision()) { - (reinterpret_cast(fStatsList->At(3)))->Fill(static_cast(-1)); + (reinterpret_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(static_cast(-1)); } else { - (reinterpret_cast(fStatsList->At(3)))->Fill(0.9); + (reinterpret_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(0.9); } - // Protection against crash, where the original collision IDs of tracks were removed by pp-filter or zorro selection and hence the track is now orphaned + // NOTE: The collision ID written in the table is the one of the original collision assigned in the AO2D. + // The reason is that the time associated to the track is wrt that collision. + // If new associations are done with the skimmed data, the track time wrt new collision can then be recomputed based on the + // relative difference in time between the original and the new collision. + + // If the original collision of this track was not selected for skimming, then we skip this track. + // Normally, the filter-pp is selecting all collisions which contain the tracks which contributed to the triggering + // of an event, so this is rejecting possibly a few tracks originally associated with collisions distant in time. if (fCollIndexMap.find(track.collisionId()) == fCollIndexMap.end()) { continue; } @@ -728,10 +773,10 @@ struct TableMaker { track.c1PtY(), track.c1PtZ(), track.c1PtSnp(), track.c1PtTgl(), track.c1Pt21Pt2()); } if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackPID)) { - float nSigmaEl = (fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaEl_Corr] : track.tpcNSigmaEl()); - float nSigmaPi = (fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPi_Corr] : track.tpcNSigmaPi()); - float nSigmaKa = ((fConfigComputeTPCpostCalib && fConfigComputeTPCpostCalibKaon) ? VarManager::fgValues[VarManager::kTPCnSigmaKa_Corr] : track.tpcNSigmaKa()); - float nSigmaPr = (fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPr_Corr] : track.tpcNSigmaPr()); + float nSigmaEl = (fConfigPostCalibTPC.fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaEl_Corr] : track.tpcNSigmaEl()); + float nSigmaPi = (fConfigPostCalibTPC.fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPi_Corr] : track.tpcNSigmaPi()); + float nSigmaKa = ((fConfigPostCalibTPC.fConfigComputeTPCpostCalib && fConfigPostCalibTPC.fConfigComputeTPCpostCalibKaon) ? VarManager::fgValues[VarManager::kTPCnSigmaKa_Corr] : track.tpcNSigmaKa()); + float nSigmaPr = (fConfigPostCalibTPC.fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPr_Corr] : track.tpcNSigmaPr()); trackBarrelPID(track.tpcSignal(), nSigmaEl, track.tpcNSigmaMu(), nSigmaPi, nSigmaKa, nSigmaPr, track.beta(), track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), @@ -753,7 +798,7 @@ struct TableMaker { for (const auto& assoc : mftAssocs) { auto track = assoc.template mfttrack_as(); - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { VarManager::FillTrack(track); fHistMan->FillHistClass("MftTracks", VarManager::fgValues); } @@ -779,8 +824,10 @@ struct TableMaker { // Muons are written only once, even if they constribute to more than one association, // which means that in the case of multiple associations, the track parameters are wrong and should be computed again at analysis time. - uint8_t trackFilteringTag = uint8_t(0); - uint8_t trackTempFilterMap = uint8_t(0); + // TODO: Currently, the TMFTFillMap is not used in this function. Is it needed ? + + uint8_t trackFilteringTag = static_cast(0); + uint8_t trackTempFilterMap = static_cast(0); fFwdTrackIndexMapReversed.clear(); uint32_t offset = muonBasic.lastIndex(); @@ -789,22 +836,25 @@ struct TableMaker { // get the muon auto muon = assoc.template fwdtrack_as(); - trackFilteringTag = uint8_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); VarManager::FillTrack(muon); - // NOTE: If a muon is associated to multiple collisions, depending on the selections, + // NOTE: Muons are propagated to the current associated collisions. + // So if a muon is associated to multiple collisions, depending on the selections, // it may be accepted for some associations and rejected for other - if (fPropMuon) { + if (fConfigVariousOptions.fPropMuon) { VarManager::FillPropagateMuon(muon, collision); } - // recalculte pDca and global muon kinematics - if (static_cast(muon.trackType()) < 2 && fRefitGlobalMuon) { + // recalculate pDca and global muon kinematics + if (static_cast(muon.trackType()) < 2 && fConfigVariousOptions.fRefitGlobalMuon) { auto muontrack = muon.template matchMCHTrack_as(); - if (muontrack.eta() < fMuonMatchEtaMin || muontrack.eta() > fMuonMatchEtaMax) { + if (muontrack.eta() < fConfigVariousOptions.fMuonMatchEtaMin || muontrack.eta() > fConfigVariousOptions.fMuonMatchEtaMax) { continue; } - auto mfttrack = muon.template matchMFTTrack_as(); VarManager::FillTrackCollision(muontrack, collision); + // NOTE: the MFT track originally associated to the MUON track is currently used in the global muon refit + // Should MUON - MFT time ambiguities be taken into account ? + auto mfttrack = muon.template matchMFTTrack_as(); VarManager::FillGlobalMuonRefit(muontrack, mfttrack, collision); } else { VarManager::FillTrackCollision(muon, collision); @@ -817,11 +867,14 @@ struct TableMaker { int i = 0; for (auto cut = fMuonCuts.begin(); cut != fMuonCuts.end(); cut++, i++) { if ((*cut).IsSelected(VarManager::fgValues)) { - trackTempFilterMap |= (uint8_t(1) << i); - if (fConfigQA) { + trackTempFilterMap |= (static_cast(1) << i); + // NOTE: the QA is filled here just for the first occurence of this muon, which means the current association + // will be skipped from histograms if this muon was already filled in the skimming map. + // So if there are histograms of quantities which depend on the collision association, these histograms will not be completely accurate + if (fConfigHistOutput.fConfigQA && (fFwdTrackIndexMap.find(muon.globalIndex()) == fFwdTrackIndexMap.end())) { fHistMan->FillHistClass(Form("Muons_%s", (*cut).GetName()), VarManager::fgValues); } - (reinterpret_cast(fStatsList->At(2)))->Fill(static_cast(i)); + (reinterpret_cast(fStatsList->At(kStatsMuons)))->Fill(static_cast(i)); } } @@ -856,13 +909,13 @@ struct TableMaker { // get the muon auto muon = muons.rawIteratorAt(origIdx); uint32_t reducedEventIdx = fCollIndexMap[collision.globalIndex()]; - // NOTE: Currently, one writes the original AO2D momentum-vector (pt, eta and phi) in the tables because we write only one instance of the muon track, - // while multiple collision associations (and multiple mom vectors can exist) + // NOTE: Currently, one writes in the tables the momentum-vector (pt, eta and phi) of the first collision association for this muon, + // while multiple collision associations (and multiple mom vectors can exist). // The momentum can be recomputed at the analysis time based on the associations written in the skims // So all the information which pertains to collision association or MFT associations should not be taken from the skimmed data, but recomputed at analysis time. uint32_t mchIdx = -1; uint32_t mftIdx = -1; - if (muon.trackType() == uint8_t(0) || muon.trackType() == uint8_t(2)) { // MCH-MID (2) or global (0) + if (muon.trackType() == static_cast(0) || muon.trackType() == static_cast(2)) { // MCH-MID (2) or global (0) if (fFwdTrackIndexMap.find(muon.matchMCHTrackId()) != fFwdTrackIndexMap.end()) { mchIdx = fFwdTrackIndexMap[muon.matchMCHTrackId()]; } @@ -871,11 +924,11 @@ struct TableMaker { } } VarManager::FillTrack(muon); - if (fPropMuon) { + if (fConfigVariousOptions.fPropMuon) { VarManager::FillPropagateMuon(muon, collision); } // recalculte pDca and global muon kinematics - if (static_cast(muon.trackType()) < 2 && fRefitGlobalMuon) { + if (static_cast(muon.trackType()) < 2 && fConfigVariousOptions.fRefitGlobalMuon) { auto muontrack = muon.template matchMCHTrack_as(); auto mfttrack = muon.template matchMFTTrack_as(); VarManager::FillTrackCollision(muontrack, collision); @@ -910,28 +963,28 @@ struct TableMaker { { if (bcs.size() > 0 && fCurrentRun != bcs.begin().runNumber()) { - if (fConfigComputeTPCpostCalib) { - auto calibList = fCCDB->getForTimeStamp(fConfigCcdbPathTPC.value, bcs.begin().timestamp()); + if (fConfigPostCalibTPC.fConfigComputeTPCpostCalib) { + auto calibList = fCCDB->getForTimeStamp(fConfigCCDB.fConfigCcdbPathTPC.value, bcs.begin().timestamp()); VarManager::SetCalibrationObject(VarManager::kTPCElectronMean, calibList->FindObject("mean_map_electron")); VarManager::SetCalibrationObject(VarManager::kTPCElectronSigma, calibList->FindObject("sigma_map_electron")); VarManager::SetCalibrationObject(VarManager::kTPCPionMean, calibList->FindObject("mean_map_pion")); VarManager::SetCalibrationObject(VarManager::kTPCPionSigma, calibList->FindObject("sigma_map_pion")); VarManager::SetCalibrationObject(VarManager::kTPCProtonMean, calibList->FindObject("mean_map_proton")); VarManager::SetCalibrationObject(VarManager::kTPCProtonSigma, calibList->FindObject("sigma_map_proton")); - if (fConfigComputeTPCpostCalibKaon) { + if (fConfigPostCalibTPC.fConfigComputeTPCpostCalibKaon) { VarManager::SetCalibrationObject(VarManager::kTPCKaonMean, calibList->FindObject("mean_map_kaon")); VarManager::SetCalibrationObject(VarManager::kTPCKaonSigma, calibList->FindObject("sigma_map_kaon")); } } if (fIsRun2 == true) { - grpmagrun2 = ccdb->getForTimeStamp(grpmagPathRun2, bcs.begin().timestamp()); - if (grpmagrun2 != nullptr) { - o2::base::Propagator::initFieldFromGRP(grpmagrun2); + fGrpMagRun2 = fCCDB->getForTimeStamp(fConfigCCDB.fConfigGrpMagPathRun2, bcs.begin().timestamp()); + if (fGrpMagRun2 != nullptr) { + o2::base::Propagator::initFieldFromGRP(fGrpMagRun2); } } else { - grpmag = ccdb->getForTimeStamp(grpmagPath, bcs.begin().timestamp()); - if (grpmag != nullptr) { - o2::base::Propagator::initFieldFromGRP(grpmag); + fGrpMag = fCCDB->getForTimeStamp(fConfigCCDB.fConfigGrpMagPath, bcs.begin().timestamp()); + if (fGrpMag != nullptr) { + o2::base::Propagator::initFieldFromGRP(fGrpMag); } } std::map metadataRCT, header; @@ -941,7 +994,7 @@ struct TableMaker { VarManager::SetSORandEOR(sor, eor); fCurrentRun = bcs.begin().runNumber(); - } + } // end updating the CCDB quantities at change of run // skim collisions event.reserve(collisions.size()); @@ -980,18 +1033,20 @@ struct TableMaker { muonAssoc.reserve(muons.size()); } - // loop over selected collisions and select the tracks and fwd tracks to be skimmed + // loop over selected collisions, group the compatible associations, and run the skimming for (auto const& [origIdx, skimIdx] : fCollIndexMap) { auto collision = collisions.rawIteratorAt(origIdx); - // group the tracks and muons for this collision + // group the barrel track associations for this collision if constexpr (static_cast(TTrackFillMap)) { auto groupedTrackIndices = trackAssocs.sliceBy(trackIndicesPerCollision, origIdx); skimTracks(collision, bcs, tracksBarrel, groupedTrackIndices); } + // group the MFT associations for this collision if constexpr (static_cast(TMFTFillMap)) { auto groupedMFTIndices = mftAssocs.sliceBy(mfttrackIndicesPerCollision, origIdx); skimMFT(collision, bcs, mftTracks, groupedMFTIndices); } + // group the muon associations for this collision if constexpr (static_cast(TMuonFillMap)) { if constexpr (static_cast(TMFTFillMap)) { auto groupedMuonIndices = fwdTrackAssocs.sliceBy(fwdtrackIndicesPerCollision, origIdx); @@ -1002,6 +1057,10 @@ struct TableMaker { } } } // end loop over skimmed collisions + + LOG(info) << "Skims in this TF: " << fCollIndexMap.size() << " collisions; " << trackBasic.lastIndex() << " barrel tracks; " + << muonBasic.lastIndex() << " muon tracks; " << mftTrack.lastIndex() << " MFT tracks; "; + LOG(info) << " " << trackBarrelAssoc.lastIndex() << " barrel assocs; " << muonAssoc.lastIndex() << " muon assocs; " << mftAssoc.lastIndex() << " MFT assoc"; } // produce the full DQ skimmed data model typically for pp/p-Pb or UPC Pb-Pb (no centrality), subscribe to the DQ event filter (filter-pp or filter-PbPb) @@ -1019,10 +1078,6 @@ struct TableMaker { MyBarrelTracksWithCov const& tracksBarrel, TrackAssoc const& trackAssocs) { - /*const int& a = 0; - MFTTracks const& mftTracks = 0; - FwdTrackAssoc const& fwdTrackAssocs = 0; - MFTTrackAssoc const& mftAssocs = 0;*/ fullSkimming(collisions, bcs, zdcs, tracksBarrel, nullptr, nullptr, trackAssocs, nullptr, nullptr); } @@ -1051,7 +1106,7 @@ struct TableMaker { // produce the muon-only DQ skimmed data model typically for pp/p-Pb or UPC Pb-Pb (no centrality), meant to run on skimmed data void processPPMuonOnly(MyEventsWithMults const& collisions, BCsWithTimestamps const& bcs, - MyMuonsWithCov const& muons, FwdTrackAssoc const& fwdTrackAssocs, MFTTracks const& /*mftTracks*/) + MyMuonsWithCov const& muons, FwdTrackAssoc const& fwdTrackAssocs) { fullSkimming(collisions, bcs, nullptr, nullptr, muons, nullptr, nullptr, fwdTrackAssocs, nullptr); } @@ -1110,10 +1165,10 @@ struct TableMaker { { for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (bc.selection_bit(i) > 0) { - (reinterpret_cast(fStatsList->At(0)))->Fill(0.0, static_cast(i)); + (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(0.0, static_cast(i)); } } - (reinterpret_cast(fStatsList->At(0)))->Fill(0.0, static_cast(o2::aod::evsel::kNsel)); + (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(0.0, static_cast(o2::aod::evsel::kNsel)); } PROCESS_SWITCH(TableMaker, processPPWithFilter, "Build full DQ skimmed data model typically for pp/p-Pb and UPC Pb-Pb, w/ event filtering", false); From d83f0c7f17521d9a8e97a75b9cc5be13acba2e40 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:30:33 +0800 Subject: [PATCH 024/459] [PWGHF] Add an eta cut for finding the leading particle. (#8533) --- PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx | 4 ++-- PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx | 9 +++------ PWGHF/HFC/Utils/utilsCorrelations.h | 7 +++++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index eb99db9dbe4..9ec7e5fc7c2 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -281,7 +281,7 @@ struct HfCorrelatorD0Hadrons { } // find leading particle if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value); + leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value, etaTrackMax.value); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); @@ -425,7 +425,7 @@ struct HfCorrelatorD0Hadrons { } // find leading particle if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value); + leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value, etaTrackMax.value); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); int nTracks = 0; diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index a2f57e21a9f..ecd5d7c0bc6 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -271,10 +271,9 @@ struct HfCorrelatorLcHadrons { if (selectedLcCandidates.size() == 0) { return; } - // find leading particle if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value); + leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value, etaTrackMax.value); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); @@ -363,7 +362,6 @@ struct HfCorrelatorLcHadrons { continue; } } - if (candidate.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), @@ -397,10 +395,9 @@ struct HfCorrelatorLcHadrons { if (selectedLcCandidatesMc.size() == 0) { return; } - // find leading particle if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value); + leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value, etaTrackMax.value); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); @@ -517,7 +514,6 @@ struct HfCorrelatorLcHadrons { continue; } } - if (candidate.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), @@ -536,6 +532,7 @@ struct HfCorrelatorLcHadrons { correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal); } + } // end inner loop (Tracks) } // end outer Lc loop registry.fill(HIST("hZvtx"), collision.posZ()); diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 0c214cb1c6f..65f447a2b90 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -43,14 +43,17 @@ Region getRegion(T const deltaPhi) } // ========= Find Leading Particle ============== -template -int findLeadingParticle(TTracks const& tracks, T1 const dcaXYTrackMax, T2 const dcaZTrackMax) +template +int findLeadingParticle(TTracks const& tracks, T1 const dcaXYTrackMax, T2 const dcaZTrackMax, T3 const etaTrackMax) { auto leadingParticle = tracks.begin(); for (auto const& track : tracks) { if (std::abs(track.dcaXY()) >= dcaXYTrackMax || std::abs(track.dcaZ()) >= dcaZTrackMax) { continue; } + if (std::abs(track.eta()) > etaTrackMax) { + continue; + } if (track.pt() > leadingParticle.pt()) { leadingParticle = track; } From 6a7923f0e241599717f658a82746b4dda5164b0e Mon Sep 17 00:00:00 2001 From: Marvin Hemmer <53471402+mhemmer-cern@users.noreply.github.com> Date: Thu, 21 Nov 2024 06:42:42 +0100 Subject: [PATCH 025/459] [PWGJE,EMCAL-670] EMCal Clusterizer - add different MinMax time setting (#8453) --- PWGJE/DataModel/EMCALClusters.h | 9 +++++++++ PWGJE/Tasks/emcclustermonitor.cxx | 15 +++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/PWGJE/DataModel/EMCALClusters.h b/PWGJE/DataModel/EMCALClusters.h index 60bb583cfca..af97b559546 100644 --- a/PWGJE/DataModel/EMCALClusters.h +++ b/PWGJE/DataModel/EMCALClusters.h @@ -35,6 +35,9 @@ const EMCALClusterDefinition kV3Default(ClusterAlgorithm_t::kV3, 10, 1, "kV3Defa const EMCALClusterDefinition kV3MostSplit(ClusterAlgorithm_t::kV3, 11, 1, "kV3MostSplit", 0.5, 0.1, -10000, 10000, true, 0.); const EMCALClusterDefinition kV3LowSeed(ClusterAlgorithm_t::kV3, 12, 1, "kV3LowSeed", 0.3, 0.1, -10000, 10000, true, 0.03); const EMCALClusterDefinition kV3MostSplitLowSeed(ClusterAlgorithm_t::kV3, 13, 1, "kV3MostSplitLowSeed", 0.3, 0.1, -10000, 10000, true, 0.); +const EMCALClusterDefinition kV3StrictTime(ClusterAlgorithm_t::kV3, 20, 1, "kV3StrictTime", 0.5, 0.1, -500, 500, true, 0.03); +const EMCALClusterDefinition kV3StricterTime(ClusterAlgorithm_t::kV3, 21, 1, "kV3StricterTime", 0.5, 0.1, -100, 100, true, 0.03); +const EMCALClusterDefinition kV3MostStrictTime(ClusterAlgorithm_t::kV3, 22, 1, "kV3MostStrictTime", 0.5, 0.1, -50, 50, true, 0.03); /// \brief function returns EMCALClusterDefinition for the given name /// \param name name of the cluster definition @@ -55,6 +58,12 @@ const EMCALClusterDefinition getClusterDefinitionFromString(const std::string& c return kV3LowSeed; } else if (clusterDefinitionName == "kV3MostSplitLowSeed") { return kV3MostSplitLowSeed; + } else if (clusterDefinitionName == "kV3StrictTime") { + return kV3StrictTime; + } else if (clusterDefinitionName == "kV3StricterTime") { + return kV3StricterTime; + } else if (clusterDefinitionName == "kV3MostStrictTime") { + return kV3MostStrictTime; } else { throw std::invalid_argument("Cluster definition name not recognized"); } diff --git a/PWGJE/Tasks/emcclustermonitor.cxx b/PWGJE/Tasks/emcclustermonitor.cxx index 1fc741ec410..bbf29d344e7 100644 --- a/PWGJE/Tasks/emcclustermonitor.cxx +++ b/PWGJE/Tasks/emcclustermonitor.cxx @@ -16,6 +16,7 @@ #include #include #include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -75,6 +76,7 @@ struct ClusterMonitor { std::vector mVetoBCIDs; std::vector mSelectBCIDs; + std::vector mCellTime; /// \brief Create output histograms and initialize geometry void init(InitContext const&) @@ -94,6 +96,8 @@ struct ClusterMonitor { const o2Axis supermoduleAxis{20, -0.5, 19.5, "Supermodule ID"}; o2Axis timeAxis{mClusterTimeBinning, "t_{cl} (ns)"}; o2Axis numberClustersAxis{mNumberClusterBinning, "Number of clusters / event"}; + const AxisSpec thAxisCellTimeDiff{3000, -1500, 1500, "#Delta#it{t}_{cell} (ns)"}; + const AxisSpec thAxisCellTimeMean{1500, -600, 900, "#LT#it{t}_{cell}#GT (ns)"}; // event properties mHistManager.add("eventsAll", "Number of events", o2HistType::kTH1F, {{1, 0.5, 1.5}}); @@ -121,6 +125,8 @@ struct ClusterMonitor { mHistManager.add("clusterDistanceToBadChannel", "Distance to bad channel", o2HistType::kTH1F, {{100, 0, 100}}); mHistManager.add("clusterTimeVsE", "Cluster time vs energy", o2HistType::kTH2F, {timeAxis, energyAxis}); mHistManager.add("clusterAmpFractionLeadingCell", "Fraction of energy in leading cell", o2HistType::kTH1F, {{100, 0, 1}}); + mHistManager.add("clusterCellTimeDiff", "Cell time difference in clusters", o2HistType::kTH1D, {thAxisCellTimeDiff}); + mHistManager.add("clusterCellTimeMean", "Mean cell time per cluster", o2HistType::kTH1D, {thAxisCellTimeMean}); // add histograms per supermodule for (int ism = 0; ism < 20; ++ism) { @@ -238,12 +244,21 @@ struct ClusterMonitor { auto cellsofcluster = emccluscells.sliceBy(perCluster, cluster.globalIndex()); double maxamp = 0; double ampfraction = 0; + mCellTime.clear(); + mCellTime.reserve(cellsofcluster.size()); for (const auto& cell : cellsofcluster) { // example how to get any information of the cell associated with cluster LOG(debug) << "Cell ID:" << cell.calo().amplitude() << " Time " << cell.calo().time(); if (cell.calo().amplitude() > maxamp) { maxamp = cell.calo().amplitude(); } + mCellTime.push_back(cell.calo().time()); + } // end of loop over cells + mHistManager.fill(HIST("clusterCellTimeMean"), std::accumulate(mCellTime.begin(), mCellTime.end(), 0.0f) / mCellTime.size()); + for (int iCell1 = 0; iCell1 < mCellTime.size() - 1; iCell1++) { + for (int iCell2 = iCell1 + 1; iCell2 < mCellTime.size(); iCell2++) { + mHistManager.fill(HIST("clusterCellTimeDiff"), mCellTime[iCell1] - mCellTime[iCell2]); + } } ampfraction = maxamp / cluster.energy(); mHistManager.fill(HIST("clusterAmpFractionLeadingCell"), ampfraction); From 4f9943d71cfd18285b91fc5560f502eb7e0e84a8 Mon Sep 17 00:00:00 2001 From: Ida Storehaug <38440296+torkjellsdatter@users.noreply.github.com> Date: Thu, 21 Nov 2024 06:53:13 +0100 Subject: [PATCH 026/459] [PWGDQ] [PWGDQ-120] cutsLibrary.cxx: DCA cut on kaon, SPDAny->ISITSibAny for kaon and electron (#8536) Co-authored-by: Ida Torkjellsdatter Storehaug --- PWGDQ/Core/CutsLibrary.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index 2bbd8a5f36e..8fc8f9fccd5 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -145,6 +145,15 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) cut->AddCut(GetAnalysisCut("electronPIDnsigmaMedium")); return cut; } + + if (!nameStr.compare("electronSelection1_idstoreh")) { // same as electronSelection1_ionut, but with kIsSPDAny -> kIsITSibAny + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug4")); + cut->AddCut(GetAnalysisCut("dcaCut1_ionut")); + cut->AddCut(GetAnalysisCut("electronPIDnsigmaMedium")); + return cut; + } + if (!nameStr.compare("electronSelection1pos_ionut")) { cut->AddCut(GetAnalysisCut("posTrack")); cut->AddCut(GetAnalysisCut("jpsiStandardKine")); @@ -625,6 +634,14 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) return cut; } + if (!nameStr.compare("kaonPID3_withDCA")) { // same as kaonPID3 but with cut on DCA and SPDAny->ITSAny + cut->AddCut(GetAnalysisCut("AssocKine")); // standard kine cuts usually are applied via Filter in the task + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug4")); + cut->AddCut(GetAnalysisCut("dcaCut1_ionut")); + cut->AddCut(GetAnalysisCut("kaonPID_TPCnTOF")); + return cut; + } + if (!nameStr.compare("kaonPID4")) { cut->AddCut(GetAnalysisCut("kaonPID_TPCnTOF")); return cut; From b546fa8bec6a09c6482c7a7c18a7b8fa4b481848 Mon Sep 17 00:00:00 2001 From: sashingo Date: Thu, 21 Nov 2024 15:07:29 +0900 Subject: [PATCH 027/459] [PWGHF] modified function to get EMCal matched track phi and eta (#8557) --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index 918f06da9bd..e86fe36813f 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -206,8 +206,8 @@ struct HfTaskElectronWeakBoson { // LOG(info) << "tr phi1 = " << track.phi(); // LOG(info) << "emc phi = " << phiEmc; if (nMatch == 0) { - double dEta = match.track_as().eta() - etaEmc; - double dPhi = match.track_as().phi() - phiEmc; + double dEta = match.track_as().trackEtaEmcal() - etaEmc; + double dPhi = match.track_as().trackPhiEmcal() - phiEmc; dPhi = RecoDecay::constrainAngle(dPhi, -o2::constants::math::PI); registry.fill(HIST("hMatchPhi"), phiEmc, match.track_as().phi()); From a862b3563c5759d635d6aaa76b852632dfa5e37a Mon Sep 17 00:00:00 2001 From: eloviyo <38348689+Eloviyo@users.noreply.github.com> Date: Thu, 21 Nov 2024 07:08:10 +0100 Subject: [PATCH 028/459] [PWGCF] FemtoUniverse cascade task -- added pair cleaner for track-cascade case (#8543) --- PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h b/PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h index a99d569fd65..bbddf41aefd 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h @@ -100,6 +100,19 @@ class FemtoUniversePairCleaner return false; } return part1.globalIndex() != part2.globalIndex(); + } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kCascade) { + /// Track-Cascade combination part1 is hadron and part2 is cascade + if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kCascade) { + LOG(fatal) << "FemtoUniversePairCleaner: passed arguments don't agree with FemtoUniversePairCleaner instantiation! Please provide first argument kTrack candidate and second argument kCascade candidate."; + return false; + } + // Getting cascade children for part2 + const auto& posChild = particles.iteratorAt(part2.index() - 3); + const auto& negChild = particles.iteratorAt(part2.index() - 2); + const auto& bachelor = particles.iteratorAt(part2.index() - 1); + if (part1.globalIndex() == posChild.globalIndex() || part1.globalIndex() == negChild.globalIndex() || part1.globalIndex() == bachelor.globalIndex()) { + return false; + } } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) { /// Track-D0 combination part1 is hadron and part2 is D0 if (part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kD0) { From 4e7189b9bd5f9309938552cadbd0f78ad365022f Mon Sep 17 00:00:00 2001 From: bghanley1995 Date: Thu, 21 Nov 2024 01:08:45 -0500 Subject: [PATCH 029/459] [PWGCF] IdentifiedBf Fixes for MC particle processing (#8538) --- .../TableProducer/identifiedBfFilter.cxx | 110 ++++++++---------- .../TableProducer/identifiedBfFilter.h | 84 ++++++++----- 2 files changed, 99 insertions(+), 95 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx b/PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx index fb6355c55b2..fee15c95f97 100644 --- a/PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx +++ b/PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx @@ -12,6 +12,8 @@ #include #include +#include +#include #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -935,11 +937,9 @@ struct IdentifiedBfFilterTracks { template inline MatchRecoGenSpecies IdentifyTrack(TrackObject const& track); template - MatchRecoGenSpecies trackIdentification(TrackObject const& track); - template int8_t AcceptTrack(TrackObject const& track); template - int8_t AcceptParticle(ParticleObject& particle, MCCollisionObject const&); + int8_t AcceptParticle(ParticleObject& particle, MCCollisionObject const& mccollision); template int8_t selectTrackAmbiguousCheck(CollisionObjects const& collisions, TrackObject const& track); template @@ -1020,7 +1020,6 @@ struct IdentifiedBfFilterTracks { void filterParticles(soa::Join const& gencollisions, aod::McParticles const& particles) { using namespace identifiedbffilter; - int acceptedparticles = 0; int acceptedcollisions = 0; if (!fullDerivedData) { @@ -1049,38 +1048,9 @@ struct IdentifiedBfFilterTracks { fillParticleHistosBeforeSelection(particle, mccollision, charge); /* track selection */ - /* TODO: at some point the pid has to be substituted by the identified species */ pid = AcceptParticle(particle, mccollision); - if (!(pid < 0)) { - /* the particle has been accepted */ - /* let's identify the particle */ - /* TODO: probably this needs to go to AcceptParticle */ - MatchRecoGenSpecies sp = IdentifyParticle(particle); - if (sp != kWrongSpecies) { - if (sp != kIdBfCharged) { - /* fill the charged particle histograms */ - fillParticleHistosAfterSelection(particle, mccollision, charge, kIdBfCharged); - /* update charged multiplicities */ - if (pid % 2 == 0) { - partMultPos[kIdBfCharged]++; - } - if (pid % 2 == 1) { - partMultNeg[kIdBfCharged]++; - } - } - /* fill the species histograms */ - fillParticleHistosAfterSelection(particle, mccollision, charge, sp); - /* update species multiplicities */ - if (pid % 2 == 0) { - partMultPos[sp]++; - } - if (pid % 2 == 1) { - partMultNeg[sp]++; - } - acceptedparticles++; - } else { - pid = -1; - } + if (!(pid < 0)) { // if PID isn't negative + acceptedparticles++; } } } else { @@ -1161,7 +1131,7 @@ struct IdentifiedBfFilterTracks { } PROCESS_SWITCH(IdentifiedBfFilterTracks, filterRecoWithoutPIDAmbiguous, "Track filtering without PID information with ambiguous tracks check", false) - void filterDetectorLevelWithoutPID(soa::Join const& collisions, IdBfFullTracksDetLevel const& tracks) + void filterDetectorLevelWithoutPID(soa::Join const& collisions, IdBfFullTracksDetLevel const& tracks, aod::McParticles const&) { filterTracks(collisions, tracks); } @@ -1358,30 +1328,6 @@ inline MatchRecoGenSpecies IdentifiedBfFilterTracks::IdentifyTrack(TrackObject c } } -template -MatchRecoGenSpecies IdentifiedBfFilterTracks::trackIdentification(TrackObject const& track) -{ - using namespace identifiedbffilter; - MatchRecoGenSpecies sp = kWrongSpecies; - if (recoIdMethod == 0) { - sp = kIdBfCharged; - } else if (recoIdMethod == 1) { - - if constexpr (framework::has_type_v || framework::has_type_v) { - sp = IdentifyTrack(track); - } else { - LOGF(fatal, "Track identification required but PID information not present"); - } - } else if (recoIdMethod == 2) { - if constexpr (framework::has_type_v) { - sp = IdentifyParticle(track.template mcParticle_as()); - } else { - LOGF(fatal, "Track identification required from MC particle but MC information not present"); - } - } - return sp; -} - /// \brief Accepts or not the passed track /// \param track the track of interest /// \return the internal track id, -1 if not accepted @@ -1404,17 +1350,33 @@ inline int8_t IdentifiedBfFilterTracks::AcceptTrack(TrackObject const& track) if (matchTrackType(track)) { if (ptlow < track.pt() && track.pt() < ptup && etalow < track.eta() && track.eta() < etaup) { fillTrackHistosAfterSelection(track, kIdBfCharged); - MatchRecoGenSpecies sp = trackIdentification(track); + MatchRecoGenSpecies sp = kWrongSpecies; + if (recoIdMethod == 0) { + sp = kIdBfCharged; + } else if (recoIdMethod == 1) { + + if constexpr (framework::has_type_v || framework::has_type_v) { + sp = IdentifyTrack(track); + } else { + LOGF(fatal, "Track identification required but PID information not present"); + } + } else if (recoIdMethod == 2) { + if constexpr (framework::has_type_v) { + sp = IdentifyParticle(track.template mcParticle_as()); + } else { + LOGF(fatal, "Track identification required from MC particle but MC information not present"); + } + } if (sp == kWrongSpecies) { return -1; } if (!(sp < 0)) { fillTrackHistosAfterSelection(track, sp); // 0) { + if (track.sign() > 0) { // if positive trkMultPos[sp]++; //<< Update Particle Multiplicity return speciesChargeValue1[sp]; } - if (track.sign() < 0) { + if (track.sign() < 0) { // if negative trkMultNeg[sp]++; //<< Update Particle Multiplicity return speciesChargeValue1[sp] + 1; } @@ -1428,7 +1390,7 @@ inline int8_t IdentifiedBfFilterTracks::AcceptTrack(TrackObject const& track) /// \param track the particle of interest /// \return `true` if the particle is accepted, `false` otherwise template -inline int8_t IdentifiedBfFilterTracks::AcceptParticle(ParticleObject& particle, MCCollisionObject const&) +inline int8_t IdentifiedBfFilterTracks::AcceptParticle(ParticleObject& particle, MCCollisionObject const& mccollision) { /* overall momentum cut */ if (!(overallminp < particle.p())) { @@ -1444,6 +1406,26 @@ inline int8_t IdentifiedBfFilterTracks::AcceptParticle(ParticleObject& particle, if (ptlow < particle.pt() && particle.pt() < ptup && etalow < particle.eta() && particle.eta() < etaup) { MatchRecoGenSpecies sp = IdentifyParticle(particle); + if (sp != kWrongSpecies) { + if (sp != kIdBfCharged) { + /* fill the charged particle histograms */ + fillParticleHistosAfterSelection(particle, mccollision, charge, kIdBfCharged); + /* update charged multiplicities */ + if (charge == 1) { + partMultPos[kIdBfCharged]++; + } else if (charge == -1) { + partMultNeg[kIdBfCharged]++; + } + } + /* fill the species histograms */ + fillParticleHistosAfterSelection(particle, mccollision, charge, sp); + /* update species multiplicities */ + if (charge == 1) { + partMultPos[sp]++; + } else if (charge == -1) { + partMultNeg[sp]++; + } + } if (charge == 1) { return speciesChargeValue1[sp]; diff --git a/PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.h b/PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.h index 392bcd73afe..6897cac98b4 100644 --- a/PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.h +++ b/PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.h @@ -34,8 +34,8 @@ namespace aod { using CollisionsEvSelCent = soa::Join; using CollisionEvSelCent = soa::Join::iterator; -using CollisionsEvSelRun2Cent = soa::Join; -using CollisionEvSelRun2Cent = soa::Join::iterator; +using CollisionsEvSelRun2Cent = soa::Join; +using CollisionEvSelRun2Cent = soa::Join::iterator; using CollisionsEvSel = soa::Join; using CollisionEvSel = soa::Join::iterator; using TrackData = soa::Join::iterator; @@ -523,38 +523,60 @@ inline float extractMultiplicity(CollisionObject const& collision, CentMultEstim ////////////////////////////////////////////////////////////////////////////////// /// \brief Centrality/multiplicity percentile template - requires(o2::aod::HasRun2Centrality) float getCentMultPercentile(CollisionObject collision) { - switch (fCentMultEstimator) { - case kV0M: - return collision.centRun2V0M(); - case kCL0: - return collision.centRun2CL0(); - case kCL1: - return collision.centRun2CL1(); - default: - return 105.0; - } -} + if constexpr (framework::has_type_v || + framework::has_type_v || + framework::has_type_v) { + switch (fCentMultEstimator) { + case kV0M: + return collision.centRun2V0M(); + break; + case kCL0: + if constexpr (framework::has_type_v) { + return collision.centRun2CL0(); + } else { + return 105.0; + } + break; -template - requires(o2::aod::HasCentrality) -float getCentMultPercentile(CollisionObject collision) -{ - switch (fCentMultEstimator) { - case kFV0A: - return collision.centFV0A(); - case kFT0M: - return collision.centFT0M(); - case kFT0A: - return collision.centFT0A(); - case kFT0C: - return collision.centFT0C(); - case kNTPV: - return collision.centNTPV(); - default: - return 105.0; + case kCL1: + if constexpr (framework::has_type_v) { + return collision.centRun2CL1(); + } else { + return 105.0; + } + break; + default: + return 105.0; + break; + } + } + if constexpr (framework::has_type_v || + framework::has_type_v || + framework::has_type_v || + framework::has_type_v || + framework::has_type_v) { + switch (fCentMultEstimator) { + case kFV0A: + return collision.centFV0A(); + break; + case kFT0M: + return collision.centFT0M(); + break; + case kFT0A: + return collision.centFT0A(); + break; + case kFT0C: + return collision.centFT0C(); + break; + case kNTPV: + return collision.centNTPV(); + break; + default: + return 105.0; + break; + } } } From 3b28004b4f4c037bc21aab63118744a2b1ce276c Mon Sep 17 00:00:00 2001 From: Gianni Shigeru Setoue Liveraro <81832939+gianniliveraro@users.noreply.github.com> Date: Thu, 21 Nov 2024 03:09:41 -0300 Subject: [PATCH 030/459] [PWGLF] Changes in sigma0 tasks (#8489) --- PWGLF/DataModel/LFSigmaTables.h | 36 +- .../Strangeness/sigma0builder.cxx | 317 ++++++++++++------ PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 273 ++++++++++++--- 3 files changed, 468 insertions(+), 158 deletions(-) diff --git a/PWGLF/DataModel/LFSigmaTables.h b/PWGLF/DataModel/LFSigmaTables.h index 136f000316f..01ef1354162 100644 --- a/PWGLF/DataModel/LFSigmaTables.h +++ b/PWGLF/DataModel/LFSigmaTables.h @@ -45,12 +45,18 @@ namespace sigma0Core DECLARE_SOA_COLUMN(SigmapT, sigmapT, float); DECLARE_SOA_COLUMN(SigmaMass, sigmaMass, float); DECLARE_SOA_COLUMN(SigmaRapidity, sigmaRapidity, float); +DECLARE_SOA_COLUMN(SigmaOPAngle, sigmaOPAngle, float); +DECLARE_SOA_COLUMN(SigmaDeltaEta, sigmaDeltaEta, float); +DECLARE_SOA_COLUMN(SigmaDeltaPhi, sigmaDeltaPhi, float); } // namespace sigma0Core DECLARE_SOA_TABLE(Sigma0Cores, "AOD", "SIGMA0CORES", sigma0Core::SigmapT, sigma0Core::SigmaMass, - sigma0Core::SigmaRapidity); + sigma0Core::SigmaRapidity, + sigma0Core::SigmaOPAngle, + sigma0Core::SigmaDeltaEta, + sigma0Core::SigmaDeltaPhi); DECLARE_SOA_TABLE(Sigma0CollRefs, "AOD", "SIGMA0COLLREF", //! optional table to refer back to a collision o2::soa::Index<>, sigma0Core::Sigma0CollisionId); @@ -70,6 +76,7 @@ DECLARE_SOA_COLUMN(PhotonDCAPosPV, photonDCAPosPV, float); DECLARE_SOA_COLUMN(PhotonZconv, photonZconv, float); DECLARE_SOA_COLUMN(PhotonEta, photonEta, float); DECLARE_SOA_COLUMN(PhotonY, photonY, float); +DECLARE_SOA_COLUMN(PhotonPhi, photonPhi, float); DECLARE_SOA_COLUMN(PhotonPosTPCNSigma, photonPosTPCNSigma, float); DECLARE_SOA_COLUMN(PhotonNegTPCNSigma, photonNegTPCNSigma, float); DECLARE_SOA_COLUMN(PhotonPosTPCCrossedRows, photonPosTPCCrossedRows, uint8_t); @@ -103,6 +110,7 @@ DECLARE_SOA_TABLE(SigmaPhotonExtras, "AOD", "SIGMA0PHOTON", sigmaPhotonExtra::PhotonZconv, sigmaPhotonExtra::PhotonEta, sigmaPhotonExtra::PhotonY, + sigmaPhotonExtra::PhotonPhi, sigmaPhotonExtra::PhotonPosTPCNSigma, sigmaPhotonExtra::PhotonNegTPCNSigma, sigmaPhotonExtra::PhotonPosTPCCrossedRows, @@ -136,10 +144,15 @@ DECLARE_SOA_COLUMN(LambdaDCANegPV, lambdaDCANegPV, float); DECLARE_SOA_COLUMN(LambdaDCAPosPV, lambdaDCAPosPV, float); DECLARE_SOA_COLUMN(LambdaEta, lambdaEta, float); DECLARE_SOA_COLUMN(LambdaY, lambdaY, float); +DECLARE_SOA_COLUMN(LambdaPhi, lambdaPhi, float); DECLARE_SOA_COLUMN(LambdaPosPrTPCNSigma, lambdaPosPrTPCNSigma, float); DECLARE_SOA_COLUMN(LambdaPosPiTPCNSigma, lambdaPosPiTPCNSigma, float); DECLARE_SOA_COLUMN(LambdaNegPrTPCNSigma, lambdaNegPrTPCNSigma, float); DECLARE_SOA_COLUMN(LambdaNegPiTPCNSigma, lambdaNegPiTPCNSigma, float); +DECLARE_SOA_COLUMN(LambdaPrTOFNSigma, lambdaPrTOFNSigma, float); +DECLARE_SOA_COLUMN(LambdaPiTOFNSigma, lambdaPiTOFNSigma, float); +DECLARE_SOA_COLUMN(ALambdaPrTOFNSigma, aLambdaPrTOFNSigma, float); +DECLARE_SOA_COLUMN(ALambdaPiTOFNSigma, aLambdaPiTOFNSigma, float); DECLARE_SOA_COLUMN(LambdaPosTPCCrossedRows, lambdaPosTPCCrossedRows, uint8_t); DECLARE_SOA_COLUMN(LambdaNegTPCCrossedRows, lambdaNegTPCCrossedRows, uint8_t); DECLARE_SOA_COLUMN(LambdaPosPt, lambdaPosPt, float); @@ -173,10 +186,15 @@ DECLARE_SOA_TABLE(SigmaLambdaExtras, "AOD", "SIGMA0LAMBDA", sigmaLambdaExtra::LambdaDCAPosPV, sigmaLambdaExtra::LambdaEta, sigmaLambdaExtra::LambdaY, + sigmaLambdaExtra::LambdaPhi, sigmaLambdaExtra::LambdaPosPrTPCNSigma, sigmaLambdaExtra::LambdaPosPiTPCNSigma, sigmaLambdaExtra::LambdaNegPrTPCNSigma, sigmaLambdaExtra::LambdaNegPiTPCNSigma, + sigmaLambdaExtra::LambdaPrTOFNSigma, + sigmaLambdaExtra::LambdaPiTOFNSigma, + sigmaLambdaExtra::ALambdaPrTOFNSigma, + sigmaLambdaExtra::ALambdaPiTOFNSigma, sigmaLambdaExtra::LambdaPosTPCCrossedRows, sigmaLambdaExtra::LambdaNegTPCCrossedRows, sigmaLambdaExtra::LambdaPosPt, @@ -198,14 +216,26 @@ DECLARE_SOA_TABLE(SigmaLambdaExtras, "AOD", "SIGMA0LAMBDA", // for MC data namespace sigmaMCCore { -DECLARE_SOA_COLUMN(IsSigma, isSigma, bool); +DECLARE_SOA_COLUMN(IsSigma, isSigma, bool); // TODO: include PDG + IsPhysicalPrimary DECLARE_SOA_COLUMN(IsAntiSigma, isAntiSigma, bool); +DECLARE_SOA_COLUMN(PhotonCandPDGCode, photonCandPDGCode, int); +DECLARE_SOA_COLUMN(PhotonCandPDGCodeMother, photonCandPDGCodeMother, int); +DECLARE_SOA_COLUMN(IsPhotonCandPrimary, isPhotonCandPrimary, bool); +DECLARE_SOA_COLUMN(LambdaCandPDGCode, lambdaCandPDGCode, int); +DECLARE_SOA_COLUMN(LambdaCandPDGCodeMother, lambdaCandPDGCodeMother, int); +DECLARE_SOA_COLUMN(IsLambdaCandPrimary, isLambdaCandPrimary, bool); } // namespace sigmaMCCore DECLARE_SOA_TABLE(SigmaMCCores, "AOD", "SIGMA0MCCORES", sigmaMCCore::IsSigma, - sigmaMCCore::IsAntiSigma); + sigmaMCCore::IsAntiSigma, + sigmaMCCore::PhotonCandPDGCode, + sigmaMCCore::PhotonCandPDGCodeMother, + sigmaMCCore::IsPhotonCandPrimary, + sigmaMCCore::LambdaCandPDGCode, + sigmaMCCore::LambdaCandPDGCodeMother, + sigmaMCCore::IsLambdaCandPrimary); } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFSIGMATABLES_H_ diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index edd4bdfa5e8..e6b7d2495a9 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -55,9 +55,9 @@ using namespace o2::framework; using namespace o2::framework::expressions; using std::array; using dauTracks = soa::Join; -using V0DerivedMCDatas = soa::Join; -using V0MLDerivedDatas = soa::Join; -using V0StandardDerivedDatas = soa::Join; +using V0DerivedMCDatas = soa::Join; +using V0MLDerivedDatas = soa::Join; +using V0StandardDerivedDatas = soa::Join; struct sigma0builder { SliceCache cache; @@ -106,7 +106,6 @@ struct sigma0builder { // Axis // base properties - ConfigurableAxis vertexZ{"vertexZ", {30, -15.0f, 15.0f}, ""}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "pt axis for analysis"}; ConfigurableAxis axisCentrality{"axisCentrality", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f, 110.0f}, "Centrality"}; ConfigurableAxis axisDeltaPt{"axisDeltaPt", {100, -1.0, +1.0}, "#Delta(p_{T})"}; @@ -134,7 +133,6 @@ struct sigma0builder { void init(InitContext const&) { // Event counter - histos.add("hEventVertexZ", "hEventVertexZ", kTH1F, {vertexZ}); histos.add("hEventCentrality", "hEventCentrality", kTH1F, {axisCentrality}); histos.add("hCandidateBuilderSelection", "hCandidateBuilderSelection", kTH1F, {axisCandSel}); histos.get(HIST("hCandidateBuilderSelection"))->GetXaxis()->SetBinLabel(1, "No Sel"); @@ -151,45 +149,68 @@ struct sigma0builder { histos.get(HIST("hCandidateBuilderSelection"))->GetXaxis()->SetBinLabel(12, "Sigma Mass Window"); histos.get(HIST("hCandidateBuilderSelection"))->GetXaxis()->SetBinLabel(13, "Sigma Y Window"); - // For efficiency calculation (and QA): - histos.add("GeneralQA/hPhotonMass", "hPhotonMass", kTH1F, {axisPhotonMass}); - histos.add("GeneralQA/hPhotonNegEta", "hPhotonNegEta", kTH1F, {axisRapidity}); - histos.add("GeneralQA/hPhotonPosEta", "hPhotonPosEta", kTH1F, {axisRapidity}); - histos.add("GeneralQA/hPhotonDCANegToPV", "hPhotonDCANegToPV", kTH1F, {axisDCAtoPV}); - histos.add("GeneralQA/hPhotonDCAPosToPV", "hPhotonDCAPosToPV", kTH1F, {axisDCAtoPV}); - histos.add("GeneralQA/hPhotonDCADau", "hPhotonDCADau", kTH1F, {axisDCAdau}); - histos.add("GeneralQA/hPhotonRadius", "hPhotonRadius", kTH1F, {axisRadius}); - histos.add("GeneralQA/hLambdaMass", "hLambdaMass", kTH1F, {axisLambdaMass}); - histos.add("GeneralQA/hAntiLambdaMass", "hAntiLambdaMass", kTH1F, {axisLambdaMass}); - histos.add("GeneralQA/hLambdaNegEta", "hLambdaNegEta", kTH1F, {axisRapidity}); - histos.add("GeneralQA/hLambdaPosEta", "hLambdaPosEta", kTH1F, {axisRapidity}); - histos.add("GeneralQA/hLambdaDCANegToPV", "hLambdaDCANegToPV", kTH1F, {axisDCAtoPV}); - histos.add("GeneralQA/hLambdaDCAPosToPV", "hLambdaDCAPosToPV", kTH1F, {axisDCAtoPV}); - histos.add("GeneralQA/hLambdaDCADau", "hLambdaDCADau", kTH1F, {axisDCAdau}); - histos.add("GeneralQA/hLambdaRadius", "hLambdaRadius", kTH1F, {axisRadius}); - histos.add("GeneralQA/hSigmaMass", "hSigmaMass", kTH1F, {axisSigmaMass}); - histos.add("GeneralQA/hSigmaMassWindow", "hSigmaMassWindow", kTH1F, {{1000, -0.09f, 0.11f}}); - histos.add("GeneralQA/hSigmaY", "hSigmaY", kTH1F, {axisRapidity}); - - histos.add("Efficiency/h2dPtVsCentrality_GammaAll", "h2dPtVsCentrality_GammaAll", kTH2D, {axisCentrality, axisPt}); - histos.add("Efficiency/h2dPtVsCentrality_LambdaAll", "h2dPtVsCentrality_LambdaAll", kTH2D, {axisCentrality, axisPt}); - histos.add("Efficiency/h2dPtVsCentrality_AntiLambdaAll", "h2dPtVsCentrality_AntiLambdaAll", kTH2D, {axisCentrality, axisPt}); - histos.add("Efficiency/h2dPtVsCentrality_GammaSigma0", "h2dPtVsCentrality_GammaSigma0", kTH2D, {axisCentrality, axisPt}); - histos.add("Efficiency/h2dPtVsCentrality_LambdaSigma0", "h2dPtVsCentrality_LambdaSigma0", kTH2D, {axisCentrality, axisPt}); - histos.add("Efficiency/h2dPtVsCentrality_Sigma0All", "h2dPtVsCentrality_Sigma0All", kTH2D, {axisCentrality, axisPt}); - histos.add("Efficiency/h2dPtVsCentrality_Sigma0AfterSel", "h2dPtVsCentrality_Sigma0AfterSel", kTH2D, {axisCentrality, axisPt}); - histos.add("Efficiency/h2dPtVsCentrality_AntiSigma0All", "h2dPtVsCentrality_AntiSigma0All", kTH2D, {axisCentrality, axisPt}); - histos.add("Efficiency/h2dPtVsCentrality_GammaAntiSigma0", "h2dPtVsCentrality_GammaAntiSigma0", kTH2D, {axisCentrality, axisPt}); - histos.add("Efficiency/h2dPtVsCentrality_LambdaAntiSigma0", "h2dPtVsCentrality_LambdaAntiSigma0", kTH2D, {axisCentrality, axisPt}); - histos.add("Efficiency/h2dPtVsCentrality_AntiSigma0AfterSel", "h2dPtVsCentrality_AntiSigma0AfterSel", kTH2D, {axisCentrality, axisPt}); - - histos.add("Efficiency/h2dSigmaPtVsLambdaPt", "h2dSigmaPtVsLambdaPt", kTH2D, {axisPt, axisPt}); - histos.add("Efficiency/h2dSigmaPtVsGammaPt", "h2dSigmaPtVsGammaPt", kTH2D, {axisPt, axisPt}); - - histos.add("Efficiency/h2dLambdaPtResolution", "h2dLambdaPtResolution", kTH2D, {axisPt, axisDeltaPt}); - histos.add("Efficiency/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisPt, axisDeltaPt}); - - histos.add("h3dMassSigmasAll", "h3dMassSigmasAll", kTH3F, {axisCentrality, axisPt, axisSigmaMass}); + // For QA: + histos.add("Selection/hPhotonMass", "hPhotonMass", kTH1F, {axisPhotonMass}); + histos.add("Selection/hPhotonNegEta", "hPhotonNegEta", kTH1F, {axisRapidity}); + histos.add("Selection/hPhotonPosEta", "hPhotonPosEta", kTH1F, {axisRapidity}); + histos.add("Selection/hPhotonDCANegToPV", "hPhotonDCANegToPV", kTH1F, {axisDCAtoPV}); + histos.add("Selection/hPhotonDCAPosToPV", "hPhotonDCAPosToPV", kTH1F, {axisDCAtoPV}); + histos.add("Selection/hPhotonDCADau", "hPhotonDCADau", kTH1F, {axisDCAdau}); + histos.add("Selection/hPhotonRadius", "hPhotonRadius", kTH1F, {axisRadius}); + histos.add("Selection/hLambdaMass", "hLambdaMass", kTH1F, {axisLambdaMass}); + histos.add("Selection/hAntiLambdaMass", "hAntiLambdaMass", kTH1F, {axisLambdaMass}); + histos.add("Selection/hLambdaNegEta", "hLambdaNegEta", kTH1F, {axisRapidity}); + histos.add("Selection/hLambdaPosEta", "hLambdaPosEta", kTH1F, {axisRapidity}); + histos.add("Selection/hLambdaDCANegToPV", "hLambdaDCANegToPV", kTH1F, {axisDCAtoPV}); + histos.add("Selection/hLambdaDCAPosToPV", "hLambdaDCAPosToPV", kTH1F, {axisDCAtoPV}); + histos.add("Selection/hLambdaDCADau", "hLambdaDCADau", kTH1F, {axisDCAdau}); + histos.add("Selection/hLambdaRadius", "hLambdaRadius", kTH1F, {axisRadius}); + histos.add("Selection/hSigmaMass", "hSigmaMass", kTH1F, {axisSigmaMass}); + histos.add("Selection/hSigmaMassWindow", "hSigmaMassWindow", kTH1F, {{1000, -0.09f, 0.11f}}); + histos.add("Selection/hSigmaY", "hSigmaY", kTH1F, {axisRapidity}); + + histos.add("GeneralQA/h2dMassGammaVsK0S", "h2dMassGammaVsK0S", kTH2D, {axisPhotonMass, {200, 0.4f, 0.6f}}); + histos.add("GeneralQA/h2dMassLambdaVsK0S", "h2dMassLambdaVsK0S", kTH2D, {axisLambdaMass, {200, 0.4f, 0.6f}}); + histos.add("GeneralQA/h2dMassGammaVsLambda", "h2dMassGammaVsLambda", kTH2D, {axisPhotonMass, axisLambdaMass}); + histos.add("GeneralQA/h3dMassSigma0VsDaupTs", "h3dMassSigma0VsDaupTs", kTH3F, {axisPt, axisPt, axisSigmaMass}); + histos.add("GeneralQA/h2dMassGammaVsK0SAfterMassSel", "h2dMassGammaVsK0SAfterMassSel", kTH2D, {axisPhotonMass, {200, 0.4f, 0.6f}}); + histos.add("GeneralQA/h2dMassLambdaVsK0SAfterMassSel", "h2dMassLambdaVsK0SAfterMassSel", kTH2D, {axisLambdaMass, {200, 0.4f, 0.6f}}); + histos.add("GeneralQA/h2dMassGammaVsLambdaAfterMassSel", "h2dMassGammaVsLambdaAfterMassSel", kTH2D, {axisPhotonMass, axisLambdaMass}); + + // MC + histos.add("MC/h2dPtVsCentrality_GammaBeforeSel", "h2dPtVsCentrality_GammaBeforeSel", kTH2D, {axisCentrality, axisPt}); + histos.add("MC/h2dPtVsCentrality_LambdaBeforeSel", "h2dPtVsCentrality_LambdaBeforeSel", kTH2D, {axisCentrality, axisPt}); + histos.add("MC/h2dPtVsCentrality_AntiLambdaBeforeSel", "h2dPtVsCentrality_AntiLambdaBeforeSel", kTH2D, {axisCentrality, axisPt}); + histos.add("MC/h2dPtVsCentrality_GammaSigma0", "h2dPtVsCentrality_GammaSigma0", kTH2D, {axisCentrality, axisPt}); + histos.add("MC/h2dPtVsCentrality_LambdaSigma0", "h2dPtVsCentrality_LambdaSigma0", kTH2D, {axisCentrality, axisPt}); + histos.add("MC/h2dPtVsCentrality_Sigma0BeforeSel", "h2dPtVsCentrality_Sigma0BeforeSel", kTH2D, {axisCentrality, axisPt}); + histos.add("MC/h2dPtVsCentrality_Sigma0AfterSel", "h2dPtVsCentrality_Sigma0AfterSel", kTH2D, {axisCentrality, axisPt}); + histos.add("MC/h2dPtVsCentrality_AntiSigma0BeforeSel", "h2dPtVsCentrality_AntiSigma0BeforeSel", kTH2D, {axisCentrality, axisPt}); + histos.add("MC/h2dPtVsCentrality_GammaAntiSigma0", "h2dPtVsCentrality_GammaAntiSigma0", kTH2D, {axisCentrality, axisPt}); + histos.add("MC/h2dPtVsCentrality_LambdaAntiSigma0", "h2dPtVsCentrality_LambdaAntiSigma0", kTH2D, {axisCentrality, axisPt}); + histos.add("MC/h2dPtVsCentrality_AntiSigma0AfterSel", "h2dPtVsCentrality_AntiSigma0AfterSel", kTH2D, {axisCentrality, axisPt}); + + // Sigma vs Daughters pT + histos.add("MC/h2dSigmaPtVsLambdaPt", "h2dSigmaPtVsLambdaPt", kTH2D, {axisPt, axisPt}); + histos.add("MC/h2dSigmaPtVsGammaPt", "h2dSigmaPtVsGammaPt", kTH2D, {axisPt, axisPt}); + + // pT Resolution: + histos.add("MC/h2dLambdaPtResolution", "h2dLambdaPtResolution", kTH2D, {axisPt, axisDeltaPt}); + histos.add("MC/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisPt, axisDeltaPt}); + + // For background decomposition + histos.add("MC/h2dPtVsMassSigma_All", "h2dPtVsMassSigma_All", kTH2D, {axisPt, axisSigmaMass}); + histos.add("MC/h2dPtVsMassSigma_SignalOnly", "h2dPtVsMassSigma_SignalOnly", kTH2D, {axisPt, axisSigmaMass}); + histos.add("MC/h2dPtVsMassSigma_TrueDaughters", "h2dPtVsMassSigma_TrueDaughters", kTH2D, {axisPt, axisSigmaMass}); + histos.add("MC/h2dPtVsMassSigma_TrueGammaFakeLambda", "h2dPtVsMassSigma_TrueGammaFakeLambda", kTH2D, {axisPt, axisSigmaMass}); + histos.add("MC/h2dPtVsMassSigma_FakeGammaTrueLambda", "h2dPtVsMassSigma_FakeGammaTrueLambda", kTH2D, {axisPt, axisSigmaMass}); + histos.add("MC/h2dPtVsMassSigma_FakeDaughters", "h2dPtVsMassSigma_FakeDaughters", kTH2D, {axisPt, axisSigmaMass}); + histos.add("MC/h2dTrueDaughtersMatrix", "h2dTrueDaughtersMatrix", kTHnSparseD, {{10001, -5000.5f, +5000.5f}, {10001, -5000.5f, +5000.5f}}); + histos.add("MC/h2dTrueGammaFakeLambdaMatrix", "h2dTrueGammaFakeLambdaMatrix", kTHnSparseD, {{10001, -5000.5f, +5000.5f}, {10001, -5000.5f, +5000.5f}}); + histos.add("MC/h2dFakeGammaTrueLambdaMatrix", "h2dFakeGammaTrueLambdaMatrix", kTHnSparseD, {{10001, -5000.5f, +5000.5f}, {10001, -5000.5f, +5000.5f}}); + histos.add("MC/h2dFakeDaughtersMatrix", "h2dFakeDaughtersMatrix", kTHnSparseD, {{10001, -5000.5f, +5000.5f}, {10001, -5000.5f, +5000.5f}}); + + histos.add("h3dMassSigmasBeforeSel", "h3dMassSigmasBeforeSel", kTH3F, {axisCentrality, axisPt, axisSigmaMass}); histos.add("h3dMassSigmasAfterSel", "h3dMassSigmasAfterSel", kTH3F, {axisCentrality, axisPt, axisSigmaMass}); } @@ -200,6 +221,10 @@ struct sigma0builder { if ((lambda.v0Type() == 0) || (gamma.v0Type() == 0)) return false; + // Checking if both V0s are made of the very same tracks + if ((gamma.posTrackExtraId() == lambda.posTrackExtraId()) || (gamma.negTrackExtraId() == lambda.negTrackExtraId()) || (gamma.posTrackExtraId() == lambda.negTrackExtraId()) || (gamma.negTrackExtraId() == lambda.posTrackExtraId()) || (gamma.posTrackExtraId() == lambda.negTrackExtraId())) + return false; + if constexpr ( requires { gamma.gammaBDTScore(); } && requires { lambda.lambdaBDTScore(); } && @@ -218,49 +243,49 @@ struct sigma0builder { // Standard selection // Gamma basic selection criteria: histos.fill(HIST("hCandidateBuilderSelection"), 1.); - histos.fill(HIST("GeneralQA/hPhotonMass"), gamma.mGamma()); + histos.fill(HIST("Selection/hPhotonMass"), gamma.mGamma()); if ((gamma.mGamma() < 0) || (gamma.mGamma() > PhotonMaxMass)) return false; - histos.fill(HIST("GeneralQA/hPhotonNegEta"), gamma.negativeeta()); - histos.fill(HIST("GeneralQA/hPhotonPosEta"), gamma.positiveeta()); + histos.fill(HIST("Selection/hPhotonNegEta"), gamma.negativeeta()); + histos.fill(HIST("Selection/hPhotonPosEta"), gamma.positiveeta()); histos.fill(HIST("hCandidateBuilderSelection"), 2.); if ((TMath::Abs(gamma.negativeeta()) > PhotonMaxDauPseudoRap) || (TMath::Abs(gamma.positiveeta()) > PhotonMaxDauPseudoRap)) return false; - histos.fill(HIST("GeneralQA/hPhotonDCANegToPV"), TMath::Abs(gamma.dcanegtopv())); - histos.fill(HIST("GeneralQA/hPhotonDCAPosToPV"), TMath::Abs(gamma.dcapostopv())); + histos.fill(HIST("Selection/hPhotonDCANegToPV"), TMath::Abs(gamma.dcanegtopv())); + histos.fill(HIST("Selection/hPhotonDCAPosToPV"), TMath::Abs(gamma.dcapostopv())); histos.fill(HIST("hCandidateBuilderSelection"), 3.); if ((TMath::Abs(gamma.dcapostopv()) < PhotonMinDCAToPv) || (TMath::Abs(gamma.dcanegtopv()) < PhotonMinDCAToPv)) return false; - histos.fill(HIST("GeneralQA/hPhotonDCADau"), TMath::Abs(gamma.dcaV0daughters())); + histos.fill(HIST("Selection/hPhotonDCADau"), TMath::Abs(gamma.dcaV0daughters())); histos.fill(HIST("hCandidateBuilderSelection"), 4.); if (TMath::Abs(gamma.dcaV0daughters()) > PhotonMaxDCAV0Dau) return false; - histos.fill(HIST("GeneralQA/hPhotonRadius"), gamma.v0radius()); + histos.fill(HIST("Selection/hPhotonRadius"), gamma.v0radius()); histos.fill(HIST("hCandidateBuilderSelection"), 5.); if ((gamma.v0radius() < PhotonMinRadius) || (gamma.v0radius() > PhotonMaxRadius)) return false; histos.fill(HIST("hCandidateBuilderSelection"), 6.); - histos.fill(HIST("GeneralQA/hLambdaMass"), lambda.mLambda()); - histos.fill(HIST("GeneralQA/hAntiLambdaMass"), lambda.mAntiLambda()); + histos.fill(HIST("Selection/hLambdaMass"), lambda.mLambda()); + histos.fill(HIST("Selection/hAntiLambdaMass"), lambda.mAntiLambda()); // Lambda basic selection criteria: if ((TMath::Abs(lambda.mLambda() - 1.115683) > LambdaWindow) && (TMath::Abs(lambda.mAntiLambda() - 1.115683) > LambdaWindow)) return false; - histos.fill(HIST("GeneralQA/hLambdaNegEta"), lambda.negativeeta()); - histos.fill(HIST("GeneralQA/hLambdaPosEta"), lambda.positiveeta()); + histos.fill(HIST("Selection/hLambdaNegEta"), lambda.negativeeta()); + histos.fill(HIST("Selection/hLambdaPosEta"), lambda.positiveeta()); histos.fill(HIST("hCandidateBuilderSelection"), 7.); if ((TMath::Abs(lambda.negativeeta()) > LambdaDauPseudoRap) || (TMath::Abs(lambda.positiveeta()) > LambdaDauPseudoRap)) return false; - histos.fill(HIST("GeneralQA/hLambdaDCANegToPV"), lambda.dcanegtopv()); - histos.fill(HIST("GeneralQA/hLambdaDCAPosToPV"), lambda.dcapostopv()); + histos.fill(HIST("Selection/hLambdaDCANegToPV"), lambda.dcanegtopv()); + histos.fill(HIST("Selection/hLambdaDCAPosToPV"), lambda.dcapostopv()); histos.fill(HIST("hCandidateBuilderSelection"), 8.); if ((TMath::Abs(lambda.dcapostopv()) < LambdaMinDCAPosToPv) || (TMath::Abs(lambda.dcanegtopv()) < LambdaMinDCANegToPv)) return false; - histos.fill(HIST("GeneralQA/hLambdaRadius"), lambda.v0radius()); + histos.fill(HIST("Selection/hLambdaRadius"), lambda.v0radius()); histos.fill(HIST("hCandidateBuilderSelection"), 9.); if ((lambda.v0radius() < LambdaMinv0radius) || (lambda.v0radius() > LambdaMaxv0radius)) return false; - histos.fill(HIST("GeneralQA/hLambdaDCADau"), lambda.dcaV0daughters()); + histos.fill(HIST("Selection/hLambdaDCADau"), lambda.dcaV0daughters()); histos.fill(HIST("hCandidateBuilderSelection"), 10.); if (TMath::Abs(lambda.dcaV0daughters()) > LambdaMaxDCAV0Dau) return false; @@ -272,21 +297,57 @@ struct sigma0builder { auto arrMom = std::array{pVecPhotons, pVecLambda}; float sigmamass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); float sigmarap = RecoDecay::y(std::array{gamma.px() + lambda.px(), gamma.py() + lambda.py(), gamma.pz() + lambda.pz()}, o2::constants::physics::MassSigma0); + float SigmapT = RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()}); + + histos.fill(HIST("Selection/hSigmaMass"), sigmamass); + histos.fill(HIST("Selection/hSigmaMassWindow"), sigmamass - 1.192642); + histos.fill(HIST("GeneralQA/h2dMassGammaVsK0S"), gamma.mGamma(), gamma.mK0Short()); + histos.fill(HIST("GeneralQA/h2dMassLambdaVsK0S"), lambda.mLambda(), lambda.mK0Short()); + histos.fill(HIST("GeneralQA/h2dMassGammaVsLambda"), gamma.mGamma(), lambda.mLambda()); + histos.fill(HIST("GeneralQA/h3dMassSigma0VsDaupTs"), gamma.pt(), lambda.pt(), sigmamass); + + if constexpr (requires { gamma.pdgCode(); } && requires { lambda.pdgCode(); }) { + + histos.fill(HIST("MC/h2dPtVsMassSigma_All"), SigmapT, sigmamass); + + // Real Gamma x Real Lambda - but not from the same sigma0/antisigma0! + if ((gamma.pdgCode() == 22) && ((lambda.pdgCode() == 3122) || (lambda.pdgCode() == -3122)) && (gamma.motherMCPartId() != lambda.motherMCPartId())) { + histos.fill(HIST("MC/h2dPtVsMassSigma_TrueDaughters"), SigmapT, sigmamass); + histos.fill(HIST("MC/h2dTrueDaughtersMatrix"), lambda.pdgCodeMother(), gamma.pdgCodeMother()); + } + + // Real Gamma x fake Lambda + if ((gamma.pdgCode() == 22) && (lambda.pdgCode() != 3122) && (lambda.pdgCode() != -3122)) { + histos.fill(HIST("MC/h2dPtVsMassSigma_TrueGammaFakeLambda"), SigmapT, sigmamass); + histos.fill(HIST("MC/h2dTrueGammaFakeLambdaMatrix"), lambda.pdgCodeMother(), gamma.pdgCodeMother()); + } + + // Fake Gamma x Real Lambda + if ((gamma.pdgCode() != 22) && ((lambda.pdgCode() == 3122) || (lambda.pdgCode() == -3122))) { + histos.fill(HIST("MC/h2dPtVsMassSigma_FakeGammaTrueLambda"), SigmapT, sigmamass); + histos.fill(HIST("MC/h2dFakeGammaTrueLambdaMatrix"), lambda.pdgCodeMother(), gamma.pdgCodeMother()); + } - histos.fill(HIST("GeneralQA/hSigmaMass"), sigmamass); - histos.fill(HIST("GeneralQA/hSigmaMassWindow"), sigmamass - 1.192642); + // Fake Gamma x Fake Lambda + if ((gamma.pdgCode() != 22) && (lambda.pdgCode() != 3122) && (lambda.pdgCode() != -3122)) { + histos.fill(HIST("MC/h2dPtVsMassSigma_FakeDaughters"), SigmapT, sigmamass); + histos.fill(HIST("MC/h2dFakeDaughtersMatrix"), lambda.pdgCodeMother(), gamma.pdgCodeMother()); + } + } if (TMath::Abs(sigmamass - 1.192642) > Sigma0Window) return false; + histos.fill(HIST("GeneralQA/h2dMassGammaVsK0SAfterMassSel"), gamma.mGamma(), gamma.mK0Short()); + histos.fill(HIST("GeneralQA/h2dMassLambdaVsK0SAfterMassSel"), lambda.mLambda(), lambda.mK0Short()); + histos.fill(HIST("GeneralQA/h2dMassGammaVsLambdaAfterMassSel"), gamma.mGamma(), lambda.mLambda()); + histos.fill(HIST("Selection/hSigmaY"), sigmarap); histos.fill(HIST("hCandidateBuilderSelection"), 12.); - histos.fill(HIST("GeneralQA/hSigmaY"), sigmarap); if (TMath::Abs(sigmarap) > SigmaMaxRap) return false; histos.fill(HIST("hCandidateBuilderSelection"), 13.); - return true; } // Helper struct to pass v0 information @@ -294,6 +355,9 @@ struct sigma0builder { float mass; float pT; float Rapidity; + float OPAngle; + float DeltaEta; + float DeltaPhi; } sigmaCandidate; // Fill tables with reconstructed sigma0 candidate @@ -315,19 +379,6 @@ struct sigma0builder { AntiLambdaBDTScore = lambda.antiLambdaBDTScore(); } - // Sigma0 candidate properties - std::array pVecPhotons{gamma.px(), gamma.py(), gamma.pz()}; - std::array pVecLambda{lambda.px(), lambda.py(), lambda.pz()}; - auto arrMom = std::array{pVecPhotons, pVecLambda}; - sigmaCandidate.mass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); - sigmaCandidate.pT = RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()}); - sigmaCandidate.Rapidity = RecoDecay::y(std::array{gamma.px() + lambda.px(), gamma.py() + lambda.py(), gamma.pz() + lambda.pz()}, o2::constants::physics::MassSigma0); - - // Sigma related - float fSigmapT = sigmaCandidate.pT; - float fSigmaMass = sigmaCandidate.mass; - float fSigmaRap = sigmaCandidate.Rapidity; - // Daughters related /// Photon auto posTrackGamma = gamma.template posTrackExtra_as(); @@ -345,6 +396,7 @@ struct sigma0builder { float fPhotonZconv = gamma.z(); float fPhotonEta = gamma.eta(); float fPhotonY = RecoDecay::y(std::array{gamma.px(), gamma.py(), gamma.pz()}, o2::constants::physics::MassGamma); + float fPhotonPhi = RecoDecay::phi(gamma.px(), gamma.py()); float fPhotonPosTPCNSigma = posTrackGamma.tpcNSigmaEl(); float fPhotonNegTPCNSigma = negTrackGamma.tpcNSigmaEl(); uint8_t fPhotonPosTPCCrossedRows = posTrackGamma.tpcCrossedRows(); @@ -378,10 +430,17 @@ struct sigma0builder { float fLambdaDCAPosPV = lambda.dcapostopv(); float fLambdaEta = lambda.eta(); float fLambdaY = lambda.yLambda(); + float fLambdaPhi = RecoDecay::phi(lambda.px(), lambda.py()); float fLambdaPosPrTPCNSigma = posTrackLambda.tpcNSigmaPr(); float fLambdaPosPiTPCNSigma = posTrackLambda.tpcNSigmaPi(); float fLambdaNegPrTPCNSigma = negTrackLambda.tpcNSigmaPr(); float fLambdaNegPiTPCNSigma = negTrackLambda.tpcNSigmaPi(); + + float fLambdaPrTOFNSigma = lambda.tofNSigmaLaPr(); + float fLambdaPiTOFNSigma = lambda.tofNSigmaLaPi(); + float fALambdaPrTOFNSigma = lambda.tofNSigmaALaPr(); + float fALambdaPiTOFNSigma = lambda.tofNSigmaALaPi(); + uint8_t fLambdaPosTPCCrossedRows = posTrackLambda.tpcCrossedRows(); uint8_t fLambdaNegTPCCrossedRows = negTrackLambda.tpcCrossedRows(); float fLambdaPosPt = lambda.positivept(); @@ -398,12 +457,34 @@ struct sigma0builder { uint32_t fLambdaNegITSClSize = negTrackLambda.itsClusterSizes(); uint8_t fLambdaV0Type = lambda.v0Type(); + // Sigma0 candidate properties + std::array pVecPhotons{gamma.px(), gamma.py(), gamma.pz()}; + std::array pVecLambda{lambda.px(), lambda.py(), lambda.pz()}; + auto arrMom = std::array{pVecPhotons, pVecLambda}; + TVector3 v1(gamma.px(), gamma.py(), gamma.pz()); + TVector3 v2(lambda.px(), lambda.py(), lambda.pz()); + + sigmaCandidate.mass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); + sigmaCandidate.pT = RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()}); + sigmaCandidate.Rapidity = RecoDecay::y(std::array{gamma.px() + lambda.px(), gamma.py() + lambda.py(), gamma.pz() + lambda.pz()}, o2::constants::physics::MassSigma0); + sigmaCandidate.OPAngle = v1.Angle(v2); + sigmaCandidate.DeltaEta = fLambdaEta - fPhotonEta; + sigmaCandidate.DeltaPhi = fLambdaPhi - fPhotonPhi; + + // Sigma related + float fSigmapT = sigmaCandidate.pT; + float fSigmaMass = sigmaCandidate.mass; + float fSigmaRap = sigmaCandidate.Rapidity; + float fSigmaOPAngle = sigmaCandidate.OPAngle; + float fSigmaDeltaEta = sigmaCandidate.DeltaEta; + float fSigmaDeltaPhi = sigmaCandidate.DeltaPhi; + // Filling TTree for ML analysis - sigma0cores(fSigmapT, fSigmaMass, fSigmaRap); + sigma0cores(fSigmapT, fSigmaMass, fSigmaRap, fSigmaOPAngle, fSigmaDeltaEta, fSigmaDeltaPhi); sigmaPhotonExtras(fPhotonPt, fPhotonMass, fPhotonQt, fPhotonAlpha, fPhotonRadius, fPhotonCosPA, fPhotonDCADau, fPhotonDCANegPV, fPhotonDCAPosPV, fPhotonZconv, - fPhotonEta, fPhotonY, fPhotonPosTPCNSigma, fPhotonNegTPCNSigma, fPhotonPosTPCCrossedRows, + fPhotonEta, fPhotonY, fPhotonPhi, fPhotonPosTPCNSigma, fPhotonNegTPCNSigma, fPhotonPosTPCCrossedRows, fPhotonNegTPCCrossedRows, fPhotonPosPt, fPhotonNegPt, fPhotonPosEta, fPhotonNegEta, fPhotonPosY, fPhotonNegY, fPhotonPsiPair, fPhotonPosITSCls, fPhotonNegITSCls, fPhotonPosITSClSize, fPhotonNegITSClSize, @@ -411,9 +492,10 @@ struct sigma0builder { sigmaLambdaExtras(fLambdaPt, fLambdaMass, fAntiLambdaMass, fLambdaQt, fLambdaAlpha, fLambdaRadius, fLambdaCosPA, fLambdaDCADau, fLambdaDCANegPV, - fLambdaDCAPosPV, fLambdaEta, fLambdaY, fLambdaPosPrTPCNSigma, - fLambdaPosPiTPCNSigma, fLambdaNegPrTPCNSigma, fLambdaNegPiTPCNSigma, fLambdaPosTPCCrossedRows, - fLambdaNegTPCCrossedRows, fLambdaPosPt, fLambdaNegPt, fLambdaPosEta, + fLambdaDCAPosPV, fLambdaEta, fLambdaY, fLambdaPhi, fLambdaPosPrTPCNSigma, + fLambdaPosPiTPCNSigma, fLambdaNegPrTPCNSigma, fLambdaNegPiTPCNSigma, + fLambdaPrTOFNSigma, fLambdaPiTOFNSigma, fALambdaPrTOFNSigma, fALambdaPiTOFNSigma, + fLambdaPosTPCCrossedRows, fLambdaNegTPCCrossedRows, fLambdaPosPt, fLambdaNegPt, fLambdaPosEta, fLambdaNegEta, fLambdaPosPrY, fLambdaPosPiY, fLambdaNegPrY, fLambdaNegPiY, fLambdaPosITSCls, fLambdaNegITSCls, fLambdaPosITSClSize, fLambdaNegITSClSize, fLambdaV0Type, LambdaBDTScore, AntiLambdaBDTScore); @@ -427,8 +509,7 @@ struct sigma0builder { auto V0Table_thisCollision = V0s.sliceBy(perCollisionMCDerived, collIdx); // V0 table sliced - for (auto& gamma : V0Table_thisCollision) { // selecting photons from Sigma0 - + for (auto& gamma : V0Table_thisCollision) { // selecting photons from Sigma0 float centrality = coll.centFT0C(); // Auxiliary histograms: @@ -436,39 +517,38 @@ struct sigma0builder { float GammaY = TMath::Abs(RecoDecay::y(std::array{gamma.px(), gamma.py(), gamma.pz()}, o2::constants::physics::MassGamma)); if (GammaY < 0.5) { // rapidity selection - histos.fill(HIST("Efficiency/h2dPtVsCentrality_GammaAll"), centrality, gamma.pt()); // isgamma - histos.fill(HIST("Efficiency/h2dGammaPtResolution"), gamma.pt(), gamma.pt() - RecoDecay::pt(array{gamma.pxMC(), gamma.pyMC()})); // pT resolution + histos.fill(HIST("MC/h2dPtVsCentrality_GammaBeforeSel"), centrality, gamma.pt()); // isgamma + histos.fill(HIST("MC/h2dGammaPtResolution"), gamma.pt(), gamma.pt() - RecoDecay::pt(array{gamma.pxMC(), gamma.pyMC()})); // pT resolution if (gamma.pdgCodeMother() == 3212) { - histos.fill(HIST("Efficiency/h2dPtVsCentrality_GammaSigma0"), centrality, gamma.pt()); // isgamma from sigma + histos.fill(HIST("MC/h2dPtVsCentrality_GammaSigma0"), centrality, gamma.pt()); // isgamma from sigma } if (gamma.pdgCodeMother() == -3212) { - histos.fill(HIST("Efficiency/h2dPtVsCentrality_GammaAntiSigma0"), centrality, gamma.pt()); // isgamma from sigma + histos.fill(HIST("MC/h2dPtVsCentrality_GammaAntiSigma0"), centrality, gamma.pt()); // isgamma from sigma } } } if (gamma.pdgCode() == 3122) { // Is Lambda float LambdaY = TMath::Abs(RecoDecay::y(std::array{gamma.px(), gamma.py(), gamma.pz()}, o2::constants::physics::MassLambda)); if (LambdaY < 0.5) { // rapidity selection - histos.fill(HIST("Efficiency/h2dPtVsCentrality_LambdaAll"), centrality, gamma.pt()); - histos.fill(HIST("Efficiency/h2dLambdaPtResolution"), gamma.pt(), gamma.pt() - RecoDecay::pt(array{gamma.pxMC(), gamma.pyMC()})); // pT resolution + histos.fill(HIST("MC/h2dPtVsCentrality_LambdaBeforeSel"), centrality, gamma.pt()); + histos.fill(HIST("MC/h2dLambdaPtResolution"), gamma.pt(), gamma.pt() - RecoDecay::pt(array{gamma.pxMC(), gamma.pyMC()})); // pT resolution if (gamma.pdgCodeMother() == 3212) { - histos.fill(HIST("Efficiency/h2dPtVsCentrality_LambdaSigma0"), centrality, gamma.pt()); + histos.fill(HIST("MC/h2dPtVsCentrality_LambdaSigma0"), centrality, gamma.pt()); } } } if (gamma.pdgCode() == -3122) { // Is AntiLambda float AntiLambdaY = TMath::Abs(RecoDecay::y(std::array{gamma.px(), gamma.py(), gamma.pz()}, o2::constants::physics::MassLambda)); if (AntiLambdaY < 0.5) { // rapidity selection - histos.fill(HIST("Efficiency/h2dPtVsCentrality_AntiLambdaAll"), centrality, gamma.pt()); + histos.fill(HIST("MC/h2dPtVsCentrality_AntiLambdaBeforeSel"), centrality, gamma.pt()); if (gamma.pdgCodeMother() == -3212) { - histos.fill(HIST("Efficiency/h2dPtVsCentrality_LambdaAntiSigma0"), centrality, gamma.pt()); // isantilambda from antisigma + histos.fill(HIST("MC/h2dPtVsCentrality_LambdaAntiSigma0"), centrality, gamma.pt()); // isantilambda from antisigma } } } for (auto& lambda : V0Table_thisCollision) { // selecting lambdas from Sigma0 - // Sigma0 candidate properties std::array pVecPhotons{gamma.px(), gamma.py(), gamma.pz()}; std::array pVecLambda{lambda.px(), lambda.py(), lambda.pz()}; @@ -477,31 +557,43 @@ struct sigma0builder { float SigmapT = RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()}); float SigmaY = TMath::Abs(RecoDecay::y(std::array{gamma.px() + lambda.px(), gamma.py() + lambda.py(), gamma.pz() + lambda.pz()}, o2::constants::physics::MassSigma0)); - histos.fill(HIST("h3dMassSigmasAll"), centrality, SigmapT, SigmaMass); - if ((gamma.pdgCode() == 22) && (gamma.pdgCodeMother() == 3212) && (lambda.pdgCode() == 3122) && (lambda.pdgCodeMother() == 3212) && (gamma.motherMCPartId() == lambda.motherMCPartId()) && (SigmaY < 0.5)) { - histos.fill(HIST("Efficiency/h2dPtVsCentrality_Sigma0All"), centrality, RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()})); - histos.fill(HIST("Efficiency/h2dSigmaPtVsLambdaPt"), SigmapT, lambda.pt()); - histos.fill(HIST("Efficiency/h2dSigmaPtVsGammaPt"), SigmapT, gamma.pt()); + histos.fill(HIST("MC/h2dPtVsCentrality_Sigma0BeforeSel"), centrality, RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()})); + histos.fill(HIST("MC/h2dSigmaPtVsLambdaPt"), SigmapT, lambda.pt()); + histos.fill(HIST("MC/h2dSigmaPtVsGammaPt"), SigmapT, gamma.pt()); } if ((gamma.pdgCode() == 22) && (gamma.pdgCodeMother() == -3212) && (lambda.pdgCode() == -3122) && (lambda.pdgCodeMother() == -3212) && (gamma.motherMCPartId() == lambda.motherMCPartId()) && (SigmaY < 0.5)) - histos.fill(HIST("Efficiency/h2dPtVsCentrality_AntiSigma0All"), centrality, SigmapT); + histos.fill(HIST("MC/h2dPtVsCentrality_AntiSigma0BeforeSel"), centrality, SigmapT); if (!processSigmaCandidate(lambda, gamma)) // basic selection continue; bool fIsSigma = false; bool fIsAntiSigma = false; - histos.fill(HIST("h3dMassSigmasAfterSel"), centrality, SigmapT, SigmaMass); + bool fIsPhotonPrimary = gamma.isPhysicalPrimary(); + int PhotonCandPDGCode = gamma.pdgCode(); + int PhotonCandPDGCodeMother = gamma.pdgCodeMother(); + bool fIsLambdaPrimary = lambda.isPhysicalPrimary(); + int LambdaCandPDGCode = lambda.pdgCode(); + int LambdaCandPDGCodeMother = lambda.pdgCodeMother(); + if ((gamma.pdgCode() == 22) && (gamma.pdgCodeMother() == 3212) && (lambda.pdgCode() == 3122) && (lambda.pdgCodeMother() == 3212) && (gamma.motherMCPartId() == lambda.motherMCPartId())) { fIsSigma = true; - histos.fill(HIST("Efficiency/h2dPtVsCentrality_Sigma0AfterSel"), centrality, RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()})); + histos.fill(HIST("MC/h2dPtVsCentrality_Sigma0AfterSel"), centrality, RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()})); } if ((gamma.pdgCode() == 22) && (gamma.pdgCodeMother() == -3212) && (lambda.pdgCode() == -3122) && (lambda.pdgCodeMother() == -3212) && (gamma.motherMCPartId() == lambda.motherMCPartId())) { fIsAntiSigma = true; - histos.fill(HIST("Efficiency/h2dPtVsCentrality_AntiSigma0AfterSel"), centrality, RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()})); + histos.fill(HIST("MC/h2dPtVsCentrality_AntiSigma0AfterSel"), centrality, RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()})); + // TH3D Mass histogram } - sigma0mccores(fIsSigma, fIsAntiSigma); + sigma0mccores(fIsSigma, fIsAntiSigma, + PhotonCandPDGCode, PhotonCandPDGCodeMother, fIsPhotonPrimary, + LambdaCandPDGCode, LambdaCandPDGCodeMother, fIsLambdaPrimary); + + // QA histograms + // Signal only (sigma0+antisigma0) + if (fIsSigma || fIsAntiSigma) + histos.fill(HIST("MC/h2dPtVsMassSigma_SignalOnly"), SigmapT, SigmaMass); } } } @@ -514,23 +606,32 @@ struct sigma0builder { const uint64_t collIdx = coll.globalIndex(); auto V0Table_thisCollision = V0s.sliceBy(perCollisionSTDDerived, collIdx); - histos.fill(HIST("hEventVertexZ"), coll.posZ()); histos.fill(HIST("hEventCentrality"), coll.centFT0C()); sigma0Coll(coll.posX(), coll.posY(), coll.posZ(), coll.centFT0M(), coll.centFT0A(), coll.centFT0C(), coll.centFV0A()); // V0 table sliced for (auto& gamma : V0Table_thisCollision) { // selecting photons from Sigma0 for (auto& lambda : V0Table_thisCollision) { // selecting lambdas from Sigma0 + std::array pVecPhotons{gamma.px(), gamma.py(), gamma.pz()}; + std::array pVecLambda{lambda.px(), lambda.py(), lambda.pz()}; + auto arrMom = std::array{pVecPhotons, pVecLambda}; + float SigmaMass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); + float SigmapT = RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()}); + float SigmaY = TMath::Abs(RecoDecay::y(std::array{gamma.px() + lambda.px(), gamma.py() + lambda.py(), gamma.pz() + lambda.pz()}, o2::constants::physics::MassSigma0)); + histos.fill(HIST("h3dMassSigmasBeforeSel"), coll.centFT0C(), SigmapT, SigmaMass); + if (!processSigmaCandidate(lambda, gamma)) // applying selection for reconstruction continue; + histos.fill(HIST("h3dMassSigmasAfterSel"), coll.centFT0C(), SigmapT, SigmaMass); + + sigma0CollRefs(collIdx); + fillTables(lambda, gamma); // filling tables with accepted candidates + nSigmaCandidates++; if (nSigmaCandidates % 5000 == 0) { LOG(info) << "Sigma0 Candidates built: " << nSigmaCandidates; } - - sigma0CollRefs(collIdx); - fillTables(lambda, gamma); // filling tables with accepted candidates } } } @@ -543,7 +644,7 @@ struct sigma0builder { const uint64_t collIdx = coll.globalIndex(); auto V0Table_thisCollision = V0s.sliceBy(perCollisionMLDerived, collIdx); - histos.fill(HIST("hEventVertexZ"), coll.posZ()); + histos.fill(HIST("hEventCentrality"), coll.centFT0C()); sigma0Coll(coll.posX(), coll.posY(), coll.posZ(), coll.centFT0M(), coll.centFT0A(), coll.centFT0C(), coll.centFV0A()); // V0 table sliced diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 687c444bb71..2b07b4c0958 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -60,10 +60,6 @@ using V0Sigmas = soa::Join analyseSigma{"analyseSigma", false, "process Sigma-like candidates"}; - // Configurable analyseAntiSigma{"analyseAntiSigma", false, "process AntiSigma-like candidates"}; - // Analysis strategy: Configurable fUseMLSel{"fUseMLSel", false, "Flag to use ML selection. If False, the standard selection is applied."}; Configurable fProcessMonteCarlo{"fProcessMonteCarlo", false, "Flag to process MC data."}; @@ -87,6 +83,8 @@ struct sigmaanalysis { Configurable LambdaMinv0cospa{"LambdaMinv0cospa", 0.95, "Min V0 CosPA"}; Configurable LambdaWindow{"LambdaWindow", 0.015, "Mass window around expected (in GeV/c2)"}; Configurable LambdaMaxRap{"LambdaMaxRap", 0.8, "Max lambda rapidity"}; + Configurable LambdaMaxTPCNSigmas{"LambdaMaxTPCNSigmas", 1e+9, "Max TPC NSigmas for daughters"}; + Configurable LambdaMaxTOFNSigmas{"LambdaMaxTOFNSigmas", 1e+9, "Max TOF NSigmas for daughters"}; //// Photon standard criteria: // Configurable PhotonMaxDauPseudoRap{"PhotonMaxDauPseudoRap", 0.9, "Max pseudorapidity of daughter tracks"}; @@ -109,6 +107,7 @@ struct sigmaanalysis { // TODO: Include PsiPair selection Configurable SigmaMaxRap{"SigmaMaxRap", 0.5, "Max sigma0 rapidity"}; + Configurable SigmaOPAngle{"SigmaOPAngle", 1.0, "Max sigma0 opening angle between daughters (radians)"}; // Axis // base properties @@ -133,7 +132,7 @@ struct sigmaanalysis { ConfigurableAxis axisDCAtoPV{"axisDCAtoPV", {500, 0.0f, 50.0f}, "DCA (cm)"}; ConfigurableAxis axisDCAdau{"axisDCAdau", {50, 0.0f, 5.0f}, "DCA (cm)"}; ConfigurableAxis axisCosPA{"axisCosPA", {200, 0.5f, 1.0f}, "Cosine of pointing angle"}; - ConfigurableAxis axisCandSel{"axisCandSel", {25, 0.5f, +25.5f}, "Candidate Selection"}; + ConfigurableAxis axisCandSel{"axisCandSel", {26, 0.5f, +26.5f}, "Candidate Selection"}; // ML ConfigurableAxis MLProb{"MLOutput", {100, 0.0f, 1.0f}, ""}; @@ -144,9 +143,9 @@ struct sigmaanalysis { histos.add("hEventCentrality", "hEventCentrality", kTH1F, {axisCentrality}); // All candidates received - histos.add("GeneralQA/h2dArmenterosAll", "h2dArmenterosAll", {HistType::kTH2F, {axisAPAlpha, axisAPQt}}); - histos.add("GeneralQA/h2dArmenterosSelected", "h2dArmenterosSelected", {HistType::kTH2F, {axisAPAlpha, axisAPQt}}); - histos.add("GeneralQA/hMassSigma0All", "hMassSigma0All", kTH1F, {axisSigmaMass}); + histos.add("GeneralQA/h2dArmenterosBeforeSel", "h2dArmenterosBeforeSel", {HistType::kTH2F, {axisAPAlpha, axisAPQt}}); + histos.add("GeneralQA/h2dArmenterosAfterSel", "h2dArmenterosAfterSel", {HistType::kTH2F, {axisAPAlpha, axisAPQt}}); + histos.add("GeneralQA/hMassSigma0BeforeSel", "hMassSigma0BeforeSel", kTH1F, {axisSigmaMass}); // Candidates Counters histos.add("GeneralQA/hCandidateAnalysisSelection", "hCandidateAnalysisSelection", kTH1F, {axisCandSel}); @@ -173,6 +172,9 @@ struct sigmaanalysis { histos.get(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(21, "Lambda Alpha Cut"); histos.get(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(22, "Lambda CosPA Cut"); histos.get(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(23, "Lambda Y Cut"); + histos.get(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(24, "Sigma Y Cut"); + histos.get(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(25, "Sigma OP Angle Cut"); + histos.get(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(26, "Lambda/ALambda PID Cut"); // Photon Selection QA histos histos.add("GeneralQA/hPhotonMass", "hPhotonMass", kTH1F, {axisPhotonMass}); @@ -203,10 +205,16 @@ struct sigmaanalysis { histos.add("GeneralQA/hLambdaCosPA", "hLambdaCosPA", kTH1F, {axisCosPA}); histos.add("GeneralQA/hLambdaY", "hLambdaY", kTH1F, {axisRapidity}); histos.add("GeneralQA/hSigmaY", "hSigmaY", kTH1F, {axisRapidity}); + histos.add("GeneralQA/hSigmaOPAngle", "hSigmaOPAngle", kTH1F, {{140, 0.0f, +7.0f}}); + histos.add("GeneralQA/h2dTPCvsTOFNSigma_LambdaPr", "h2dTPCvsTOFNSigma_LambdaPr", kTH2F, {{120, -30, 30}, {120, -30, 30}}); + histos.add("GeneralQA/h2dTPCvsTOFNSigma_LambdaPi", "h2dTPCvsTOFNSigma_LambdaPi", kTH2F, {{120, -30, 30}, {120, -30, 30}}); + histos.add("GeneralQA/h2dTPCvsTOFNSigma_ALambdaPr", "h2dTPCvsTOFNSigma_ALambdaPr", kTH2F, {{120, -30, 30}, {120, -30, 30}}); + histos.add("GeneralQA/h2dTPCvsTOFNSigma_ALambdaPi", "h2dTPCvsTOFNSigma_ALambdaPi", kTH2F, {{120, -30, 30}, {120, -30, 30}}); histos.add("GeneralQA/hPhotonMassSelected", "hPhotonMassSelected", kTH1F, {axisPhotonMass}); histos.add("GeneralQA/hLambdaMassSelected", "hLambdaMassSelected", kTH1F, {axisLambdaMass}); histos.add("GeneralQA/hAntiLambdaMassSelected", "hAntiLambdaMassSelected", kTH1F, {axisLambdaMass}); + // For Signal Extraction // Sigma0 @@ -223,22 +231,78 @@ struct sigmaanalysis { if (fProcessMonteCarlo) { // Event counter - histos.add("hMCEventCentrality", "hMCEventCentrality", kTH1F, {axisCentrality}); + histos.add("MC/hMCEventCentrality", "hMCEventCentrality", kTH1F, {axisCentrality}); // Kinematic histos.add("MC/h3dMassSigma0", "h3dMassSigma0", kTH3F, {axisCentrality, axisPt, axisSigmaMass}); histos.add("MC/h3dMassAntiSigma0", "h3dMassSigma0", kTH3F, {axisCentrality, axisPt, axisSigmaMass}); - histos.add("MC/h2dArmenterosAll", "h2dArmenterosAll", {HistType::kTH2F, {axisAPAlpha, axisAPQt}}); - histos.add("MC/h2dArmenterosSelected", "h2dArmenterosSelected", {HistType::kTH2F, {axisAPAlpha, axisAPQt}}); + histos.add("MC/h2dArmenterosBeforeSel", "h2dArmenterosBeforeSel", {HistType::kTH2F, {axisAPAlpha, axisAPQt}}); + histos.add("MC/h2dArmenterosAfterSel", "h2dArmenterosAfterSel", {HistType::kTH2F, {axisAPAlpha, axisAPQt}}); // Sigma0 QA - histos.add("MC/hMassSigma0All", "hMassSigma0All", kTH1F, {axisSigmaMass}); - histos.add("MC/hPtSigma0All", "hPtSigma0All", kTH1F, {axisPt}); + histos.add("MC/hMassSigma0BeforeSel", "hMassSigma0BeforeSel", kTH1F, {axisSigmaMass}); + histos.add("MC/hPtSigma0BeforeSel", "hPtSigma0BeforeSel", kTH1F, {axisPt}); histos.add("MC/hMassSigma0", "hMassSigma0", kTH1F, {axisSigmaMass}); histos.add("MC/hPtSigma0", "hPtSigma0", kTH1F, {axisPt}); histos.add("MC/hMassAntiSigma0", "hMassAntiSigma0", kTH1F, {axisSigmaMass}); histos.add("MC/hPtAntiSigma0", "hPtAntiSigma0", kTH1F, {axisPt}); + + // For background decomposition + histos.add("MC/h2dPtVsMassSigma_SignalBkg", "h2dPtVsMassSigma_SignalBkg", kTH2D, {axisPt, axisSigmaMass}); + histos.add("MC/h2dPtVsMassSigma_SignalOnly", "h2dPtVsMassSigma_SignalOnly", kTH2D, {axisPt, axisSigmaMass}); + histos.add("MC/h2dPtVsMassSigma_TrueDaughters", "h2dPtVsMassSigma_TrueDaughters", kTH2D, {axisPt, axisSigmaMass}); + histos.add("MC/h2dPtVsMassSigma_TrueGammaFakeLambda", "h2dPtVsMassSigma_TrueGammaFakeLambda", kTH2D, {axisPt, axisSigmaMass}); + histos.add("MC/h2dPtVsMassSigma_FakeGammaTrueLambda", "h2dPtVsMassSigma_FakeGammaTrueLambda", kTH2D, {axisPt, axisSigmaMass}); + histos.add("MC/h2dPtVsMassSigma_FakeDaughters", "h2dPtVsMassSigma_FakeDaughters", kTH2D, {axisPt, axisSigmaMass}); + histos.add("MC/h2dTrueDaughtersMatrix", "h2dTrueDaughtersMatrix", kTHnSparseD, {{10001, -5000.5f, +5000.5f}, {10001, -5000.5f, +5000.5f}}); + + // For new selection studies: + //// Opening angle between daughters + histos.add("MC/h2dPtVsOPAngle_SignalOnly", "h2dPtVsOPAngle_SignalOnly", kTH2D, {axisPt, {140, 0.0f, +7.0f}}); + histos.add("MC/h2dPtVsOPAngle_TrueDaughters", "h2dPtVsOPAngle_TrueDaughters", kTH2D, {axisPt, {140, 0.0f, +7.0f}}); + histos.add("MC/h2dPtVsMassSigma_AfterOPAngleSel", "h2dPtVsMassSigma_AfterOPAngleSel", kTH2D, {axisPt, axisSigmaMass}); + + // For efficiency/Purity studies + // Before any selection + histos.add("MC/hPtTrueLambda_BeforeSel", "hPtTrueLambda_BeforeSel", kTH1F, {axisPt}); // Signal only + histos.add("MC/hPtTrueGamma_BeforeSel", "hPtTrueGamma_BeforeSel", kTH1F, {axisPt}); // Signal only + histos.add("MC/hPtTrueSigma_BeforeSel", "hPtTrueSigma_BeforeSel", kTH1F, {axisPt}); // Signal only + histos.add("MC/hPtLambdaCand_BeforeSel", "hPtLambdaCand_BeforeSel", kTH1F, {axisPt}); // Bkg + Signal + histos.add("MC/hPtGammaCand_BeforeSel", "hPtGammaCand_BeforeSel", kTH1F, {axisPt}); // Bkg + Signal + histos.add("MC/hPtSigmaCand_BeforeSel", "hPtGammaCand_BeforeSel", kTH1F, {axisPt}); // Bkg + Signal + + // After analysis selections + histos.add("MC/hPtTrueLambda_AfterSel", "hPtTrueLambda_AfterSel", kTH1F, {axisPt}); // Signal only + histos.add("MC/hPtTrueGamma_AfterSel", "hPtTrueGamma_AfterSel", kTH1F, {axisPt}); // Signal only + histos.add("MC/hPtTrueSigma_AfterSel", "hPtTrueSigma_AfterSel", kTH1F, {axisPt}); // Signal only + + histos.add("MC/hPtLambdaCand_AfterSel", "hPtLambdaCand_AfterSel", kTH1F, {axisPt}); + histos.add("MC/hPtGammaCand_AfterSel", "hPtGammaCand_AfterSel", kTH1F, {axisPt}); + histos.add("MC/hPtSigmaCand_AfterSel", "hPtSigmaCand_AfterSel", kTH1F, {axisPt}); + + // TPC vs TOF N Sigmas distributions + histos.add("MC/h3dTPCvsTOFNSigma_LambdaPr", "h3dTPCvsTOFNSigma_LambdaPr", kTH3F, {{120, -30, 30}, {120, -30, 30}, axisPt}); + histos.add("MC/h3dTPCvsTOFNSigma_LambdaPi", "h3dTPCvsTOFNSigma_LambdaPi", kTH3F, {{120, -30, 30}, {120, -30, 30}, axisPt}); + histos.add("MC/h3dTPCvsTOFNSigma_TrueLambdaPr", "h3dTPCvsTOFNSigma_TrueLambdaPr", kTH3F, {{120, -30, 30}, {120, -30, 30}, axisPt}); + histos.add("MC/h3dTPCvsTOFNSigma_TrueLambdaPi", "h3dTPCvsTOFNSigma_TrueLambdaPi", kTH3F, {{120, -30, 30}, {120, -30, 30}, axisPt}); + + // Testing New Selections: + //// Opening Angle + histos.add("MC/hPtTrueSigma_AngleSel", "hPtTrueSigma_AngleSel", kTH1F, {axisPt}); + histos.add("MC/hPtSigmaCand_AngleSel", "hPtSigmaCand_AngleSel", kTH1F, {axisPt}); + + //// TPC PID + histos.add("MC/hPtTrueLambda_TPCPID", "hPtTrueLambda_TPCPID", kTH1F, {axisPt}); + histos.add("MC/hPtLambdaCandidates_TPCPID", "hPtLambdaCandidates_TPCPID", kTH1F, {axisPt}); + + //// TOF PID + histos.add("MC/hPtTrueLambda_TOFPID", "hPtTrueLambda_TOFPID", kTH1F, {axisPt}); + histos.add("MC/hPtLambdaCandidates_TOFPID", "hPtLambdaCandidates_TOFPID", kTH1F, {axisPt}); + + //// TPC+TOF PID + histos.add("MC/hPtTrueLambda_TPCTOFPID", "hPtTrueLambda_TPCTOFPID", kTH1F, {axisPt}); + histos.add("MC/hPtLambdaCandidates_TPCTOFPID", "hPtLambdaCandidates_TPCTOFPID", kTH1F, {axisPt}); } } @@ -360,12 +424,12 @@ struct sigmaanalysis { histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 23.); if (TMath::Abs(cand.sigmaRapidity()) > SigmaMaxRap) return false; + histos.fill(HIST("GeneralQA/hSigmaOPAngle"), cand.sigmaOPAngle()); histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 24.); - histos.fill(HIST("GeneralQA/hPhotonMassSelected"), cand.photonMass()); - histos.fill(HIST("GeneralQA/hLambdaMassSelected"), cand.lambdaMass()); - histos.fill(HIST("GeneralQA/hAntiLambdaMassSelected"), cand.antilambdaMass()); + if (cand.sigmaOPAngle() > SigmaOPAngle) + return false; + histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 25.); } - return true; } @@ -381,28 +445,127 @@ struct sigmaanalysis { void processMonteCarlo(aod::Sigma0Collision const& coll, V0MCSigmas const& v0s) { - histos.fill(HIST("hMCEventCentrality"), coll.centFT0C()); + histos.fill(HIST("MC/hMCEventCentrality"), coll.centFT0C()); for (auto& sigma : v0s) { // selecting Sigma0-like candidates - if (sigma.isSigma() || sigma.isAntiSigma()) { - histos.fill(HIST("MC/h2dArmenterosAll"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST("MC/h2dArmenterosAll"), sigma.lambdaAlpha(), sigma.lambdaQt()); - histos.fill(HIST("MC/hMassSigma0All"), sigma.sigmaMass()); - histos.fill(HIST("MC/hPtSigma0All"), sigma.sigmapT()); - if (!processSigmaCandidate(sigma)) - continue; + histos.fill(HIST("MC/h2dArmenterosBeforeSel"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST("MC/h2dArmenterosBeforeSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); + histos.fill(HIST("MC/hMassSigma0BeforeSel"), sigma.sigmaMass()); + histos.fill(HIST("MC/hPtSigma0BeforeSel"), sigma.sigmapT()); + + if (sigma.photonCandPDGCode() == 22) + histos.fill(HIST("MC/hPtTrueGamma_BeforeSel"), sigma.photonPt()); + if (sigma.lambdaCandPDGCode() == 3122) + histos.fill(HIST("MC/hPtTrueLambda_BeforeSel"), sigma.lambdaPt()); + if (sigma.isSigma() || sigma.isAntiSigma()) + histos.fill(HIST("MC/hPtTrueSigma_BeforeSel"), sigma.sigmapT()); + + histos.fill(HIST("MC/hPtGammaCand_BeforeSel"), sigma.photonPt()); + histos.fill(HIST("MC/hPtLambdaCand_BeforeSel"), sigma.lambdaPt()); + histos.fill(HIST("MC/hPtSigmaCand_BeforeSel"), sigma.sigmapT()); + + if (!processSigmaCandidate(sigma)) + continue; + + // Purity Study + PID study: + bool fPassTPCPID = false; + bool fPassTOFPID = false; + + histos.fill(HIST("MC/hPtGammaCand_AfterSel"), sigma.photonPt()); + histos.fill(HIST("MC/hPtSigmaCand_AfterSel"), sigma.sigmapT()); + + if (sigma.photonCandPDGCode() == 22) + histos.fill(HIST("MC/hPtTrueGamma_AfterSel"), sigma.photonPt()); + + // For Lambda PID Studies + if (sigma.lambdaAlpha() > 0) { + histos.fill(HIST("MC/hPtLambdaCand_AfterSel"), sigma.lambdaPt()); + histos.fill(HIST("MC/h3dTPCvsTOFNSigma_LambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma(), sigma.sigmapT()); + histos.fill(HIST("MC/h3dTPCvsTOFNSigma_LambdaPi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma(), sigma.sigmapT()); + + if (sigma.lambdaCandPDGCode() == 3122) { + histos.fill(HIST("MC/hPtTrueLambda_AfterSel"), sigma.lambdaPt()); + histos.fill(HIST("MC/h3dTPCvsTOFNSigma_TrueLambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma(), sigma.sigmapT()); + histos.fill(HIST("MC/h3dTPCvsTOFNSigma_TrueLambdaPi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma(), sigma.sigmapT()); + } + + // TPC PID: + if ((TMath::Abs(sigma.lambdaPosPrTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaNegPiTPCNSigma()) < LambdaMaxTPCNSigmas)) { + fPassTPCPID = true; + histos.fill(HIST("MC/hPtLambdaCandidates_TPCPID"), sigma.lambdaPt()); + if (sigma.lambdaCandPDGCode() == 3122) + histos.fill(HIST("MC/hPtTrueLambda_TPCPID"), sigma.lambdaPt()); + } + + // TOF PID: + if ((TMath::Abs(sigma.lambdaPrTOFNSigma()) < LambdaMaxTOFNSigmas) && (TMath::Abs(sigma.lambdaPiTOFNSigma()) < LambdaMaxTOFNSigmas)) { + fPassTOFPID = true; + histos.fill(HIST("MC/hPtLambdaCandidates_TOFPID"), sigma.lambdaPt()); + if (sigma.lambdaCandPDGCode() == 3122) + histos.fill(HIST("MC/hPtTrueLambda_TOFPID"), sigma.lambdaPt()); + } + // TPC + TOF PID: + if (fPassTPCPID && fPassTOFPID) { + histos.fill(HIST("MC/hPtLambdaCandidates_TPCTOFPID"), sigma.lambdaPt()); + if (sigma.lambdaCandPDGCode() == 3122) + histos.fill(HIST("MC/hPtTrueLambda_TPCTOFPID"), sigma.lambdaPt()); + } + } + + // For Opening Angle study + if (sigma.sigmaOPAngle() <= SigmaOPAngle) { + histos.fill(HIST("MC/h2dPtVsMassSigma_AfterOPAngleSel"), sigma.sigmapT(), sigma.sigmaMass()); + histos.fill(HIST("MC/hPtSigmaCand_AngleSel"), sigma.sigmapT()); + if (sigma.isSigma() || sigma.isAntiSigma()) + histos.fill(HIST("MC/hPtTrueSigma_AngleSel"), sigma.sigmapT()); + } + + // For background studies: + histos.fill(HIST("MC/h2dPtVsMassSigma_SignalBkg"), sigma.sigmapT(), sigma.sigmaMass()); + // Real Gamma x Real Lambda - but not from the same sigma0/antisigma0! + if ((sigma.photonCandPDGCode() == 22) && ((sigma.lambdaCandPDGCode() == 3122) || (sigma.lambdaCandPDGCode() == -3122)) && !(sigma.isSigma()) && !(sigma.isAntiSigma())) { + histos.fill(HIST("MC/h2dPtVsMassSigma_TrueDaughters"), sigma.sigmapT(), sigma.sigmaMass()); + histos.fill(HIST("MC/h2dTrueDaughtersMatrix"), sigma.lambdaCandPDGCodeMother(), sigma.photonCandPDGCodeMother()); + histos.fill(HIST("MC/h2dPtVsOPAngle_TrueDaughters"), sigma.sigmapT(), sigma.sigmaOPAngle()); + } + // Real Gamma x fake Lambda + if ((sigma.photonCandPDGCode() == 22) && (sigma.lambdaCandPDGCode() != 3122) && (sigma.lambdaCandPDGCode() != -3122)) + histos.fill(HIST("MC/h2dPtVsMassSigma_TrueGammaFakeLambda"), sigma.sigmapT(), sigma.sigmaMass()); + + // Fake Gamma x Real Lambda + if ((sigma.photonCandPDGCode() != 22) && ((sigma.lambdaCandPDGCode() == 3122) || (sigma.lambdaCandPDGCode() == -3122))) + histos.fill(HIST("MC/h2dPtVsMassSigma_FakeGammaTrueLambda"), sigma.sigmapT(), sigma.sigmaMass()); - histos.fill(HIST("MC/h2dArmenterosSelected"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST("MC/h2dArmenterosSelected"), sigma.lambdaAlpha(), sigma.lambdaQt()); + // Fake Gamma x Fake Lambda + if ((sigma.photonCandPDGCode() != 22) && (sigma.lambdaCandPDGCode() != 3122) && (sigma.lambdaCandPDGCode() != -3122)) + histos.fill(HIST("MC/h2dPtVsMassSigma_FakeDaughters"), sigma.sigmapT(), sigma.sigmaMass()); + // MC association (signal study) + if (sigma.isSigma() || sigma.isAntiSigma()) { + histos.fill(HIST("MC/h2dPtVsMassSigma_SignalOnly"), sigma.sigmapT(), sigma.sigmaMass()); + histos.fill(HIST("MC/h2dPtVsOPAngle_SignalOnly"), sigma.sigmapT(), sigma.sigmaOPAngle()); + histos.fill(HIST("MC/hPtTrueSigma_AfterSel"), sigma.sigmapT()); + histos.fill(HIST("GeneralQA/hPhotonMassSelected"), sigma.photonMass()); if (sigma.isSigma()) { - histos.fill(HIST("MC/hMassSigma0"), sigma.sigmaMass()); - histos.fill(HIST("MC/hPtSigma0"), sigma.sigmapT()); - histos.fill(HIST("MC/h3dMassSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass()); + // PID selections + if ((TMath::Abs(sigma.lambdaPosPrTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaNegPiTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaPrTOFNSigma()) < LambdaMaxTOFNSigmas) && (TMath::Abs(sigma.lambdaPiTOFNSigma()) < LambdaMaxTOFNSigmas)) { + histos.fill(HIST("MC/h2dArmenterosAfterSel"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST("MC/h2dArmenterosAfterSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); + histos.fill(HIST("GeneralQA/hLambdaMassSelected"), sigma.lambdaMass()); + histos.fill(HIST("MC/hMassSigma0"), sigma.sigmaMass()); + histos.fill(HIST("MC/hPtSigma0"), sigma.sigmapT()); + histos.fill(HIST("MC/h3dMassSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass()); + } } else { - histos.fill(HIST("MC/hMassAntiSigma0"), sigma.sigmaMass()); - histos.fill(HIST("MC/hPtAntiSigma0"), sigma.sigmapT()); - histos.fill(HIST("MC/h3dMassAntiSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass()); + // PID selections + if ((TMath::Abs(sigma.lambdaPosPiTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaNegPrTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.aLambdaPrTOFNSigma()) < LambdaMaxTOFNSigmas) && (TMath::Abs(sigma.aLambdaPiTOFNSigma()) < LambdaMaxTOFNSigmas)) { + histos.fill(HIST("MC/h2dArmenterosAfterSel"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST("GeneralQA/hAntiLambdaMassSelected"), sigma.antilambdaMass()); + histos.fill(HIST("MC/h2dArmenterosAfterSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); + histos.fill(HIST("MC/hMassAntiSigma0"), sigma.sigmaMass()); + histos.fill(HIST("MC/hPtAntiSigma0"), sigma.sigmapT()); + histos.fill(HIST("MC/h3dMassAntiSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass()); + } } } } @@ -412,9 +575,9 @@ struct sigmaanalysis { { histos.fill(HIST("hEventCentrality"), coll.centFT0C()); for (auto& sigma : v0s) { // selecting Sigma0-like candidates - histos.fill(HIST("GeneralQA/h2dArmenterosAll"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST("GeneralQA/h2dArmenterosAll"), sigma.lambdaAlpha(), sigma.lambdaQt()); - histos.fill(HIST("GeneralQA/hMassSigma0All"), sigma.sigmaMass()); + histos.fill(HIST("GeneralQA/h2dArmenterosBeforeSel"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST("GeneralQA/h2dArmenterosBeforeSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); + histos.fill(HIST("GeneralQA/hMassSigma0BeforeSel"), sigma.sigmaMass()); nSigmaCandidates++; if (nSigmaCandidates % 50000 == 0) { @@ -423,19 +586,35 @@ struct sigmaanalysis { if (!processSigmaCandidate(sigma)) continue; - histos.fill(HIST("GeneralQA/h2dArmenterosSelected"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST("GeneralQA/h2dArmenterosSelected"), sigma.lambdaAlpha(), sigma.lambdaQt()); - + histos.fill(HIST("GeneralQA/hPhotonMassSelected"), sigma.photonMass()); if (sigma.lambdaAlpha() > 0) { - histos.fill(HIST("Sigma0/hMassSigma0"), sigma.sigmaMass()); - histos.fill(HIST("Sigma0/hPtSigma0"), sigma.sigmapT()); - histos.fill(HIST("Sigma0/hRapiditySigma0"), sigma.sigmaRapidity()); - histos.fill(HIST("Sigma0/h3dMassSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass()); + // PID selections + histos.fill(HIST("GeneralQA/h2dTPCvsTOFNSigma_LambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma()); + histos.fill(HIST("GeneralQA/h2dTPCvsTOFNSigma_LambdaPi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma()); + if ((TMath::Abs(sigma.lambdaPosPrTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaNegPiTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaPrTOFNSigma()) < LambdaMaxTOFNSigmas) && (TMath::Abs(sigma.lambdaPiTOFNSigma()) < LambdaMaxTOFNSigmas)) { + histos.fill(HIST("GeneralQA/h2dArmenterosAfterSel"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST("GeneralQA/h2dArmenterosAfterSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); + histos.fill(HIST("GeneralQA/hLambdaMassSelected"), sigma.lambdaMass()); + histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 26.); + histos.fill(HIST("Sigma0/hMassSigma0"), sigma.sigmaMass()); + histos.fill(HIST("Sigma0/hPtSigma0"), sigma.sigmapT()); + histos.fill(HIST("Sigma0/hRapiditySigma0"), sigma.sigmaRapidity()); + histos.fill(HIST("Sigma0/h3dMassSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass()); + } } else { - histos.fill(HIST("AntiSigma0/hMassAntiSigma0"), sigma.sigmaMass()); - histos.fill(HIST("AntiSigma0/hPtAntiSigma0"), sigma.sigmapT()); - histos.fill(HIST("AntiSigma0/hRapidityAntiSigma0"), sigma.sigmaRapidity()); - histos.fill(HIST("AntiSigma0/h3dMassAntiSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass()); + // PID selections + histos.fill(HIST("GeneralQA/h2dTPCvsTOFNSigma_ALambdaPr"), sigma.lambdaNegPrTPCNSigma(), sigma.aLambdaPrTOFNSigma()); + histos.fill(HIST("GeneralQA/h2dTPCvsTOFNSigma_ALambdaPi"), sigma.lambdaPosPiTPCNSigma(), sigma.aLambdaPiTOFNSigma()); + if ((TMath::Abs(sigma.lambdaPosPiTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaNegPrTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.aLambdaPrTOFNSigma()) < LambdaMaxTOFNSigmas) && (TMath::Abs(sigma.aLambdaPiTOFNSigma()) < LambdaMaxTOFNSigmas)) { + histos.fill(HIST("GeneralQA/h2dArmenterosAfterSel"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST("GeneralQA/h2dArmenterosAfterSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); + histos.fill(HIST("GeneralQA/hAntiLambdaMassSelected"), sigma.antilambdaMass()); + histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 26.); + histos.fill(HIST("AntiSigma0/hMassAntiSigma0"), sigma.sigmaMass()); + histos.fill(HIST("AntiSigma0/hPtAntiSigma0"), sigma.sigmapT()); + histos.fill(HIST("AntiSigma0/hRapidityAntiSigma0"), sigma.sigmaRapidity()); + histos.fill(HIST("AntiSigma0/h3dMassAntiSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass()); + } } } } From df611fc0b502f13c980e5c4956a99b4e7c928d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 21 Nov 2024 07:14:20 +0100 Subject: [PATCH 031/459] [PWGHF] fix the bug of mix-event setting and complete the track QA plots (#8476) --- PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx index ef40dedc667..f7aad26d676 100644 --- a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx +++ b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx @@ -196,6 +196,10 @@ struct HfTaskCharmHadronsFemtoDream { void init(InitContext& /*context*/) { + // setup columnpolicy for binning + colBinningMult = {{mixingBinVztx, mixingBinMult}, true}; + colBinningMultPercentile = {{mixingBinVztx, mixingBinMultPercentile}, true}; + colBinningMultMultPercentile = {{mixingBinVztx, mixingBinMult, mixingBinMultPercentile}, true}; eventHisto.init(®istry); trackHistoPartOne.init(®istry, binmultTempFit, binMulPercentile, binpTTrack, binEta, binPhi, binTempFitVarTrack, binNSigmaTPC, binNSigmaTOF, binNSigmaTPCTOF, binTPCClusters, dummy, isMc, pdgCodeTrack1, true); @@ -242,7 +246,7 @@ struct HfTaskCharmHadronsFemtoDream { /// Histogramming same event for (auto const& part : sliceTrk1) { - trackHistoPartOne.fillQA(part, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + trackHistoPartOne.fillQA(part, static_cast(ConfTempFitVarMomentum.value), col.multNtr(), col.multV0M()); } for (auto const& [p1, p2] : combinations(CombinationsFullIndexPolicy(sliceTrk1, sliceCharmHad))) { @@ -349,7 +353,6 @@ struct HfTaskCharmHadronsFemtoDream { } const int multiplicityCol = collision1.multNtr(); - registryMixQa.fill(HIST("MixingQA/hMECollisionBins"), colBinningMult.getBin({collision1.posZ(), multiplicityCol})); auto sliceTrk1 = part1->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); From 2ab38fe18e3269dd072d186cc1e0407a04fa75bd Mon Sep 17 00:00:00 2001 From: Diana <70915994+diana0x0f@users.noreply.github.com> Date: Thu, 21 Nov 2024 08:16:27 +0100 Subject: [PATCH 032/459] [PWGUD] Add MC process for global fwd tracks in UPCCandidateProducer (#8428) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera Co-authored-by: rolavick Co-authored-by: Sasha Bylinkin <37345380+abylinkin@users.noreply.github.com> Co-authored-by: Diana Krupova --- PWGUD/TableProducer/UPCCandidateProducer.cxx | 26 ++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/PWGUD/TableProducer/UPCCandidateProducer.cxx b/PWGUD/TableProducer/UPCCandidateProducer.cxx index 6443f67fa45..5eba6e0c2ef 100644 --- a/PWGUD/TableProducer/UPCCandidateProducer.cxx +++ b/PWGUD/TableProducer/UPCCandidateProducer.cxx @@ -1610,7 +1610,7 @@ struct UpcCandProducer { if (nMFTs > fNFwdProngs) // too many tracks continue; std::vector trkCandIDs{}; - const auto& midTrackIDs = midIt->second; + const auto& midTrackIDs = midIt->second; // to retrieve corresponding MCH-MID tracks if (nMFTs == fNFwdProngs) { for (auto iMft : fwdTrackIDs) { auto trk = fwdTracks.iteratorAt(iMft); @@ -1897,13 +1897,35 @@ struct UpcCandProducer { (o2::aod::McFwdTrackLabels*)nullptr); } + void processForwardGlobalMC(ForwardTracks const& fwdTracks, + o2::aod::FwdTrkCls const& fwdTrkClusters, + o2::aod::AmbiguousFwdTracks const& ambFwdTracks, + BCsWithBcSels const& bcs, + o2::aod::Collisions const& collisions, + o2::aod::FT0s const& ft0s, + o2::aod::FDDs const& fdds, + o2::aod::FV0As const& fv0as, + o2::aod::Zdcs const& zdcs, + o2::aod::McCollisions const& mcCollisions, o2::aod::McParticles const& mcParticles, + o2::aod::McFwdTrackLabels const& mcFwdTrackLabels) + { + fDoMC = true; + skimMCInfo(mcCollisions, mcParticles, bcs); + createCandidatesFwdGlobal(fwdTracks, fwdTrkClusters, ambFwdTracks, + bcs, collisions, + ft0s, fdds, fv0as, zdcs, + &mcFwdTrackLabels); + fNewPartIDs.clear(); + } + PROCESS_SWITCH(UpcCandProducer, processSemiFwd, "Produce candidates in semiforward/forward region", false); PROCESS_SWITCH(UpcCandProducer, processCentral, "Produce candidates in central region", false); PROCESS_SWITCH(UpcCandProducer, processSemiFwdMC, "Produce candidates in semiforward/forward region with MC information", false); PROCESS_SWITCH(UpcCandProducer, processCentralMC, "Produce candidates in central region with MC information", false); PROCESS_SWITCH(UpcCandProducer, processForward, "Produce candidates in forward region", false); PROCESS_SWITCH(UpcCandProducer, processForwardGlobal, "Produce candidates in forward region with MFT", true); - PROCESS_SWITCH(UpcCandProducer, processForwardMC, "Produce caniddates in forward region with MC information", false); + PROCESS_SWITCH(UpcCandProducer, processForwardMC, "Produce candidates in forward region with MC information", false); + PROCESS_SWITCH(UpcCandProducer, processForwardGlobalMC, "Produce candidates in forward region with MFT and MC information", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From bd76160be3975fa6be1b563fdbf398cbb4b790f7 Mon Sep 17 00:00:00 2001 From: HANSEO PARK <53218370+hanseopark@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:40:34 +0100 Subject: [PATCH 033/459] [Common,PWGJE] Add getParticleOrigin and modified init problem (#8438) --- Common/Core/RecoDecay.h | 113 +++++++++++++++++++++++++++++++ PWGJE/Core/JetTaggingUtilities.h | 7 +- 2 files changed, 118 insertions(+), 2 deletions(-) diff --git a/Common/Core/RecoDecay.h b/Common/Core/RecoDecay.h index ce2469e66e7..a8e4de1216f 100644 --- a/Common/Core/RecoDecay.h +++ b/Common/Core/RecoDecay.h @@ -1035,6 +1035,119 @@ struct RecoDecay { } return OriginType::None; } + + /// based on getCharmHardronOrigin in order to extend general particle + /// Finding the origin (from charm hadronisation or beauty-hadron decay) of paritcle (b, c and others) + /// \param particlesMC table with MC particles + /// \param particle MC particle + /// \param searchUpToQuark if true tag origin based on charm/beauty quark otherwise on the presence of a b-hadron or c-hadron + /// \param idxBhadMothers optional vector of b-hadron indices (might be more than one in case of searchUpToQuark in case of beauty resonances) + /// \return an integer corresponding to the origin (0: none(others), 1: charm, 2: beauty) as in OriginType + template + static int getParticleOrigin(const T& particlesMC, + const typename T::iterator& particle, + const bool searchUpToQuark = false, + std::vector* idxBhadMothers = nullptr) + { + int stage = 0; // mother tree level (just for debugging) + + // vector of vectors with mother indices; each line corresponds to a "stage" + std::vector> arrayIds{}; + std::vector initVec{particle.globalIndex()}; + arrayIds.push_back(initVec); // the first vector contains the index of the original particle + auto PDGParticle = std::abs(particle.pdgCode()); + bool couldBeCharm = false; + if (PDGParticle / 100 == 4 || PDGParticle / 1000 == 4) { + couldBeCharm = true; + } + while (arrayIds[-stage].size() > 0) { + // vector of mother indices for the current stage + std::vector arrayIdsStage{}; + for (auto& iPart : arrayIds[-stage]) { // check all the particles that were the mothers at the previous stage + auto particleMother = particlesMC.rawIteratorAt(iPart - particlesMC.offset()); + if (particleMother.has_mothers()) { + + // we break immediately if searchUpToQuark is false and the first mother is a parton (an hadron should never be the mother of a parton) + if (!searchUpToQuark) { + auto mother = particlesMC.rawIteratorAt(particleMother.mothersIds().front() - particlesMC.offset()); + auto PDGParticleIMother = std::abs(mother.pdgCode()); // PDG code of the mother + if (PDGParticleIMother < 9 || (PDGParticleIMother > 20 && PDGParticleIMother < 38)) { + auto PDGPaticle = std::abs(particleMother.pdgCode()); + if ( + (PDGParticleIMother / 100 == 5 || // b mesons + PDGParticleIMother / 1000 == 5) // b baryons + ) { + return OriginType::NonPrompt; // beauty + } + if ( + (PDGParticleIMother / 100 == 4 || // c mesons + PDGParticleIMother / 1000 == 4) // c baryons + ) { + return OriginType::Prompt; // charm + } + break; + } + } + + for (auto iMother = particleMother.mothersIds().front(); iMother <= particleMother.mothersIds().back(); ++iMother) { // loop over the mother particles of the analysed particle + if (std::find(arrayIdsStage.begin(), arrayIdsStage.end(), iMother) != arrayIdsStage.end()) { // if a mother is still present in the vector, do not check it again + continue; + } + auto mother = particlesMC.rawIteratorAt(iMother - particlesMC.offset()); + // Check status code + auto motherStatusCode = std::abs(mother.getGenStatusCode()); + auto PDGParticleIMother = std::abs(mother.pdgCode()); // PDG code of the mother + // Check mother's PDG code. + // printf("getMother: "); + // for (int i = stage; i < 0; i++) // Indent to make the tree look nice. + // printf(" "); + // printf("Stage %d: Mother PDG: %d, status: %d, Index: %d\n", stage, PDGParticleIMother, motherStatusCode, iMother); + + if (searchUpToQuark) { + if (idxBhadMothers) { + if (PDGParticleIMother / 100 == 5 || // b mesons + PDGParticleIMother / 1000 == 5) // b baryons + { + idxBhadMothers->push_back(iMother); + } + } + if (PDGParticleIMother == 5) { // b quark + return OriginType::NonPrompt; // beauty + } + if (PDGParticleIMother == 4) { // c quark + return OriginType::Prompt; // charm + } + } else { + if ( + (PDGParticleIMother / 100 == 5 || // b mesons + PDGParticleIMother / 1000 == 5) // b baryons + ) { + if (idxBhadMothers) { + idxBhadMothers->push_back(iMother); + } + return OriginType::NonPrompt; // beauty + } + if ( + (PDGParticleIMother / 100 == 4 || // c mesons + PDGParticleIMother / 1000 == 4) // c baryons + ) { + couldBeCharm = true; + } + } + // add mother index in the vector for the current stage + arrayIdsStage.push_back(iMother); + } + } + } + // add vector of mother indices for the current stage + arrayIds.push_back(arrayIdsStage); + stage--; + } + if (couldBeCharm) { + return OriginType::Prompt; // charm + } + return OriginType::None; + } }; /// Calculations using (pT, η, φ) coordinates, aka (transverse momentum, pseudorapidity, azimuth) diff --git a/PWGJE/Core/JetTaggingUtilities.h b/PWGJE/Core/JetTaggingUtilities.h index d6a4ee8f32b..8f5c44362e1 100644 --- a/PWGJE/Core/JetTaggingUtilities.h +++ b/PWGJE/Core/JetTaggingUtilities.h @@ -137,12 +137,13 @@ int jetTrackFromHFShower(T const& jet, U const& /*tracks*/, V const& particles, bool hasMcParticle = false; int origin = -1; for (auto& track : jet.template tracks_as()) { + hftrack = track; // for init if origin is 1 or 2, the track is not hftrack if (!track.has_mcParticle()) { continue; } hasMcParticle = true; auto const& particle = track.template mcParticle_as(); - origin = RecoDecay::getCharmHadronOrigin(particles, particle, searchUpToQuark); + origin = RecoDecay::getParticleOrigin(particles, particle, searchUpToQuark); if (origin == 1 || origin == 2) { // 1=charm , 2=beauty hftrack = track; if (origin == 1) { @@ -153,6 +154,7 @@ int jetTrackFromHFShower(T const& jet, U const& /*tracks*/, V const& particles, } } } + if (hasMcParticle) { return JetTaggingSpecies::lightflavour; } else { @@ -173,7 +175,8 @@ int jetParticleFromHFShower(T const& jet, U const& particles, typename U::iterat int origin = -1; for (const auto& particle : jet.template tracks_as()) { - origin = RecoDecay::getCharmHadronOrigin(particles, particle, searchUpToQuark); + hfparticle = particle; // for init if origin is 1 or 2, the particle is not hfparticle + origin = RecoDecay::getParticleOrigin(particles, particle, searchUpToQuark); if (origin == 1 || origin == 2) { // 1=charm , 2=beauty hfparticle = particle; if (origin == 1) { From 8f835651399b2c6db733737d3ada993a33c9cd1a Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Thu, 21 Nov 2024 09:42:09 +0100 Subject: [PATCH 034/459] [PWGHF] Add single-track variables in B0 reduced task (#8537) Co-authored-by: ALICE Action Bot --- PWGHF/D2H/DataModel/ReducedDataModel.h | 4 +- PWGHF/D2H/Tasks/taskB0Reduced.cxx | 218 ++++++++++++++++--------- 2 files changed, 146 insertions(+), 76 deletions(-) diff --git a/PWGHF/D2H/DataModel/ReducedDataModel.h b/PWGHF/D2H/DataModel/ReducedDataModel.h index 590b536f61a..d8c06e0d26f 100644 --- a/PWGHF/D2H/DataModel/ReducedDataModel.h +++ b/PWGHF/D2H/DataModel/ReducedDataModel.h @@ -343,8 +343,8 @@ DECLARE_SOA_TABLE(HfRedPidDau1s, "AOD", "HFREDPIDDAU1", //! hf_track_pid_reduced::TOFNSigmaKaProng1, hf_track_vars_reduced::HasTOFProng1, hf_track_vars_reduced::HasTPCProng1, - hf_track_pid_reduced::TPCTOFNSigmaPiProng0, - hf_track_pid_reduced::TPCTOFNSigmaKaProng0); + hf_track_pid_reduced::TPCTOFNSigmaPiProng1, + hf_track_pid_reduced::TPCTOFNSigmaKaProng1); DECLARE_SOA_TABLE(HfRedPidDau2s, "AOD", "HFREDPIDDAU2", //! hf_track_pid_reduced::TPCNSigmaPiProng2, diff --git a/PWGHF/D2H/Tasks/taskB0Reduced.cxx b/PWGHF/D2H/Tasks/taskB0Reduced.cxx index a0f5b14e5cc..d3f81aac980 100644 --- a/PWGHF/D2H/Tasks/taskB0Reduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0Reduced.cxx @@ -36,58 +36,106 @@ namespace o2::aod { namespace hf_cand_b0_lite { -DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); //! Transverse momentum of prong0 (GeV/c) -DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); //! Transverse momentum of prong1 (GeV/c) -DECLARE_SOA_COLUMN(MProng0, mProng0, float); //! Invariant mass of prong0 (GeV/c) -DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c2) -DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c) -DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) -DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c) -DECLARE_SOA_COLUMN(Y, y, float); //! Rapidity of candidate -DECLARE_SOA_COLUMN(Eta, eta, float); //! Pseudorapidity of candidate -DECLARE_SOA_COLUMN(Phi, phi, float); //! Azimuth angle of candidate -DECLARE_SOA_COLUMN(E, e, float); //! Energy of candidate (GeV) -DECLARE_SOA_COLUMN(NSigTpcPi1, nSigTpcPi1, float); //! TPC Nsigma separation for prong1 with pion mass hypothesis -DECLARE_SOA_COLUMN(NSigTofPi1, nSigTofPi1, float); //! TOF Nsigma separation for prong1 with pion mass hypothesis -DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! Decay length of candidate (cm) -DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Transverse decay length of candidate (cm) -DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! Normalised decay length of candidate -DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of candidate -DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! Impact parameter product of candidate -DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine pointing angle of candidate -DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine pointing angle of candidate in transverse plane -DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! Maximum normalized difference between measured and expected impact parameter of candidate prongs -DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class -DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); //! Flag for association with wrong collision +DECLARE_SOA_COLUMN(PtD, ptD, float); //! Transverse momentum of D-meson daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(PtBach, ptBach, float); //! Transverse momentum of bachelor pion (GeV/c) +DECLARE_SOA_COLUMN(AbsEtaBach, absEtaBach, float); //! Absolute pseudorapidity of bachelor pion +DECLARE_SOA_COLUMN(ItsNClsBach, itsNClsBach, int); //! Number of ITS clusters of bachelor pion +DECLARE_SOA_COLUMN(TpcNClsCrossedRowsBach, tpcNClsCrossedRowsBach, int); //! Number of TPC crossed rows of prongs of bachelor pion +DECLARE_SOA_COLUMN(TpcChi2NClBach, tpcChi2NClBach, float); //! Maximum TPC chi2 of prongs of D-meson daughter candidate +DECLARE_SOA_COLUMN(PtDmesProngMin, ptProngDmesMin, float); //! Minimum pT of prongs of D-meson daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(AbsEtaDmesProngMin, absEtaProngDmesMin, float); //! Minimum absolute pseudorapidity of prongs of D-meson daughter candidate +DECLARE_SOA_COLUMN(ItsNClsDmesProngMin, itsNClsDmesProngMin, int); //! Minimum number of ITS clusters of prongs of D-meson daughter candidate +DECLARE_SOA_COLUMN(TpcNClsCrossedRowsDmesProngMin, tpcNClsCrossedRowsDmesProngMin, int); //! Minimum number of TPC crossed rows of prongs of D-meson daughter candidate +DECLARE_SOA_COLUMN(TpcChi2NClDmesProngMax, tpcChi2NClDmesProngMax, float); //! Maximum TPC chi2 of prongs of D-meson daughter candidate +DECLARE_SOA_COLUMN(MD, mD, float); //! Invariant mass of D-meson daughter candidates (GeV/c) +DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c2) +DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(Y, y, float); //! Rapidity of candidate +DECLARE_SOA_COLUMN(Eta, eta, float); //! Pseudorapidity of candidate +DECLARE_SOA_COLUMN(Phi, phi, float); //! Azimuth angle of candidate +DECLARE_SOA_COLUMN(E, e, float); //! Energy of candidate (GeV) +DECLARE_SOA_COLUMN(NSigTpcPiBachelor, nSigTpcPiBachelor, float); //! TPC Nsigma separation for bachelor with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTofPiBachelor, nSigTofPiBachelor, float); //! TOF Nsigma separation for bachelor with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcTofPiBachelor, nSigTpcTofPiBachelor, float); //! Combined TPC and TOF Nsigma separation for bachelor with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcPiDmesProng0, nSigTpcPiDmesProng0, float); //! TPC Nsigma separation for D-meson prong0 with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTofPiDmesProng0, nSigTofPiDmesProng0, float); //! TOF Nsigma separation for D-meson prong0 with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcTofPiDmesProng0, nSigTpcTofPiDmesProng0, float); //! Combined TPC and TOF Nsigma separation for D-meson prong0 with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcKaDmesProng1, nSigTpcKaDmesProng1, float); //! TPC Nsigma separation for D-meson prong1 with kaon mass hypothesis +DECLARE_SOA_COLUMN(NSigTofKaDmesProng1, nSigTofKaDmesProng1, float); //! TOF Nsigma separation for D-meson prong1 with kaon mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcTofKaDmesProng1, nSigTpcTofKaDmesProng1, float); //! Combined TPC and TOF Nsigma separation for D-meson prong1 with kaon mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcPiDmesProng2, nSigTpcPiDmesProng2, float); //! TPC Nsigma separation for D-meson prong2 with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTofPiDmesProng2, nSigTofPiDmesProng2, float); //! TOF Nsigma separation for D-meson prong2 with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcTofPiDmesProng2, nSigTpcTofPiDmesProng2, float); //! Combined TPC and TOF Nsigma separation for D-meson prong0 with pion mass hypothesis +DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! Decay length of candidate (cm) +DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Transverse decay length of candidate (cm) +DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! Normalised decay length of candidate +DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of candidate +DECLARE_SOA_COLUMN(DecayLengthD, decayLengthD, float); //! Decay length of D-meson daughter candidate (cm) +DECLARE_SOA_COLUMN(DecayLengthXYD, decayLengthXYD, float); //! Transverse decay length of D-meson daughter candidate (cm) +DECLARE_SOA_COLUMN(ImpactParameterD, impactParameterD, float); //! Impact parameter product of D-meson daughter candidate +DECLARE_SOA_COLUMN(ImpactParameterBach, impactParameterBach, float); //! Impact parameter product of bachelor pion +DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! Impact parameter product of daughters +DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine pointing angle of candidate +DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine pointing angle of candidate in transverse plane +DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! Maximum normalized difference between measured and expected impact parameter of candidate prongs +DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class +DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); //! Flag for association with wrong collision } // namespace hf_cand_b0_lite DECLARE_SOA_TABLE(HfRedCandB0Lites, "AOD", "HFREDCANDB0LITE", //! Table with some B0 properties + // B meson features hf_cand_b0_lite::M, + hf_cand_b0_lite::M, + hf_cand_b0_lite::Pt, + hf_cand_b0_lite::Eta, + hf_cand_b0_lite::Phi, + hf_cand_b0_lite::Y, + hf_cand_b0_lite::Cpa, + hf_cand_b0_lite::CpaXY, hf_cand::Chi2PCA, hf_cand_b0_lite::DecayLength, hf_cand_b0_lite::DecayLengthXY, hf_cand_b0_lite::DecayLengthNormalised, hf_cand_b0_lite::DecayLengthXYNormalised, - hf_cand_b0_lite::MProng0, - hf_cand_b0_lite::PtProng0, - hf_cand_b0_lite::PtProng1, - hf_cand::ImpactParameter0, - hf_cand::ImpactParameter1, hf_cand_b0_lite::ImpactParameterProduct, - hf_cand_b0_lite::NSigTpcPi1, - hf_cand_b0_lite::NSigTofPi1, + hf_cand_b0_lite::MaxNormalisedDeltaIP, + hf_cand_b0_lite::MlScoreSig, + hf_sel_candidate_b0::IsSelB0ToDPi, + // D meson features + hf_cand_b0_lite::MD, + hf_cand_b0_lite::PtD, + hf_cand_b0_lite::DecayLengthD, + hf_cand_b0_lite::DecayLengthXYD, + hf_cand_b0_lite::ImpactParameterD, + hf_cand_b0_lite::PtDmesProngMin, + hf_cand_b0_lite::AbsEtaDmesProngMin, + hf_cand_b0_lite::ItsNClsDmesProngMin, + hf_cand_b0_lite::TpcNClsCrossedRowsDmesProngMin, + hf_cand_b0_lite::TpcChi2NClDmesProngMax, + hf_cand_b0_lite::NSigTpcPiDmesProng0, + hf_cand_b0_lite::NSigTofPiDmesProng0, + hf_cand_b0_lite::NSigTpcTofPiDmesProng0, + hf_cand_b0_lite::NSigTpcKaDmesProng1, + hf_cand_b0_lite::NSigTofKaDmesProng1, + hf_cand_b0_lite::NSigTpcTofKaDmesProng1, + hf_cand_b0_lite::NSigTpcPiDmesProng2, + hf_cand_b0_lite::NSigTofPiDmesProng2, + hf_cand_b0_lite::NSigTpcTofPiDmesProng2, hf_cand_b0_reduced::Prong0MlScoreBkg, hf_cand_b0_reduced::Prong0MlScorePrompt, hf_cand_b0_reduced::Prong0MlScoreNonprompt, - hf_cand_b0_lite::MlScoreSig, - hf_sel_candidate_b0::IsSelB0ToDPi, - hf_cand_b0_lite::M, - hf_cand_b0_lite::Pt, - hf_cand_b0_lite::Cpa, - hf_cand_b0_lite::CpaXY, - hf_cand_b0_lite::MaxNormalisedDeltaIP, - hf_cand_b0_lite::Eta, - hf_cand_b0_lite::Phi, - hf_cand_b0_lite::Y, + // pion features + hf_cand_b0_lite::PtBach, + hf_cand_b0_lite::AbsEtaBach, + hf_cand_b0_lite::ItsNClsBach, + hf_cand_b0_lite::TpcNClsCrossedRowsBach, + hf_cand_b0_lite::TpcChi2NClBach, + hf_cand_b0_lite::ImpactParameterBach, + hf_cand_b0_lite::NSigTpcPiBachelor, + hf_cand_b0_lite::NSigTofPiBachelor, + hf_cand_b0_lite::NSigTpcTofPiBachelor, + // MC truth hf_cand_3prong::FlagMcMatchRec, hf_cand_3prong::OriginMcRec, hf_cand_b0_lite::FlagWrongCollision, @@ -96,8 +144,8 @@ DECLARE_SOA_TABLE(HfRedCandB0Lites, "AOD", "HFREDCANDB0LITE", //! Table with som DECLARE_SOA_TABLE(HfRedB0McCheck, "AOD", "HFREDB0MCCHECK", //! Table with MC decay type check hf_cand_3prong::FlagMcMatchRec, hf_cand_b0_lite::FlagWrongCollision, - hf_cand_b0_lite::MProng0, - hf_cand_b0_lite::PtProng0, + hf_cand_b0_lite::MD, + hf_cand_b0_lite::PtD, hf_cand_b0_lite::M, hf_cand_b0_lite::Pt, hf_cand_b0_lite::MlScoreSig, @@ -133,6 +181,7 @@ struct HfTaskB0Reduced { HistogramRegistry registry{"registry"}; using TracksPion = soa::Join; + using CandsDplus = soa::Join; void init(InitContext&) { @@ -326,13 +375,13 @@ struct HfTaskB0Reduced { /// \param withB0Ml is the flag to enable the filling with ML scores for the B0 candidate /// \param candidate is the B0 candidate /// \param candidatesD is the table with D- candidates - template + template void fillCand(Cand const& candidate, - aod::HfRed3Prongs const&) + CandsDmes const&) { auto ptCandB0 = candidate.pt(); auto invMassB0 = hfHelper.invMassB0ToDPi(candidate); - auto candD = candidate.template prong0_as(); + auto candD = candidate.template prong0_as(); auto ptD = candidate.ptProng0(); auto invMassD = candD.invMassHypo0(); std::array posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; @@ -474,7 +523,7 @@ struct HfTaskB0Reduced { } } if (fillTree) { - float pseudoRndm = ptD * 1000. - (int64_t)(ptD * 1000); + float pseudoRndm = ptD * 1000. - static_cast(ptD * 1000); if (flagMcMatchRec != 0 || (((doMc && fillBackground) || !doMc) && (ptCandB0 >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { float prong0MlScoreBkg = -1.; float prong0MlScorePrompt = -1.; @@ -496,42 +545,63 @@ struct HfTaskB0Reduced { } hfRedCandB0Lite( + // B-meson features + invMassB0, + ptCandB0, + candidate.eta(), + candidate.phi(), + hfHelper.yB0(candidate), + candidate.cpa(), + candidate.cpaXY(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.decayLengthNormalised(), candidate.decayLengthXYNormalised(), + candidate.impactParameterProduct(), + candidate.maxNormalisedDeltaIP(), + candidateMlScoreSig, + candidate.isSelB0ToDPi(), + // D-meson features invMassD, ptD, - candidate.ptProng1(), + decLenD, + decLenXyD, candidate.impactParameter0(), - candidate.impactParameter1(), - candidate.impactParameterProduct(), - prong1.tpcNSigmaPi(), - prong1.tofNSigmaPi(), + candD.ptProngMin(), + candD.absEtaProngMin(), + candD.itsNClsProngMin(), + candD.tpcNClsCrossedRowsProngMin(), + candD.tpcChi2NClProngMax(), + candD.tpcNSigmaPiProng0(), + candD.tofNSigmaPiProng0(), + candD.tpcTofNSigmaPiProng0(), + candD.tpcNSigmaKaProng1(), + candD.tofNSigmaKaProng1(), + candD.tpcTofNSigmaKaProng1(), + candD.tpcNSigmaPiProng2(), + candD.tofNSigmaPiProng2(), + candD.tpcTofNSigmaPiProng2(), prong0MlScoreBkg, prong0MlScorePrompt, prong0MlScoreNonprompt, - candidateMlScoreSig, - candidate.isSelB0ToDPi(), - invMassB0, - ptCandB0, - candidate.cpa(), - candidate.cpaXY(), - candidate.maxNormalisedDeltaIP(), - candidate.eta(), - candidate.phi(), - hfHelper.yB0(candidate), + // pion features + candidate.ptProng1(), + std::abs(RecoDecay::eta(prong1.pVector())), + prong1.itsNCls(), + prong1.tpcNClsCrossedRows(), + prong1.tpcChi2NCl(), + candidate.impactParameter1(), + prong1.tpcNSigmaPi(), + prong1.tofNSigmaPi(), + prong1.tpcTofNSigmaPi(), + // MC truth flagMcMatchRec, isSignal, flagWrongCollision, ptMother); if constexpr (withDecayTypeCheck) { - float candidateMlScoreSig = -1; - if constexpr (withB0Ml) { - candidateMlScoreSig = candidate.mlProbB0ToDPi(); - } hfRedB0McCheck( flagMcMatchRec, flagWrongCollision, @@ -591,7 +661,7 @@ struct HfTaskB0Reduced { // Process functions void processData(soa::Filtered> const& candidates, - aod::HfRed3Prongs const& candidatesD, + CandsDplus const& candidatesD, TracksPion const&) { for (const auto& candidate : candidates) { @@ -604,7 +674,7 @@ struct HfTaskB0Reduced { PROCESS_SWITCH(HfTaskB0Reduced, processData, "Process data without ML scores for B0 and D daughter", true); void processDataWithDmesMl(soa::Filtered> const& candidates, - aod::HfRed3Prongs const& candidatesD, + CandsDplus const& candidatesD, TracksPion const&) { for (const auto& candidate : candidates) { @@ -617,7 +687,7 @@ struct HfTaskB0Reduced { PROCESS_SWITCH(HfTaskB0Reduced, processDataWithDmesMl, "Process data with(out) ML scores for D daughter (B0)", false); void processDataWithB0Ml(soa::Filtered> const& candidates, - aod::HfRed3Prongs const& candidatesD, + CandsDplus const& candidatesD, TracksPion const&) { for (const auto& candidate : candidates) { @@ -631,7 +701,7 @@ struct HfTaskB0Reduced { void processMc(soa::Filtered> const& candidates, aod::HfMcGenRedB0s const& mcParticles, - aod::HfRed3Prongs const& candidatesD, + CandsDplus const& candidatesD, TracksPion const&) { // MC rec @@ -651,7 +721,7 @@ struct HfTaskB0Reduced { void processMcWithDecayTypeCheck(soa::Filtered> const& candidates, aod::HfMcGenRedB0s const& mcParticles, - aod::HfRed3Prongs const& candidatesD, + CandsDplus const& candidatesD, TracksPion const&) { // MC rec @@ -671,7 +741,7 @@ struct HfTaskB0Reduced { void processMcWithDmesMl(soa::Filtered> const& candidates, aod::HfMcGenRedB0s const& mcParticles, - aod::HfRed3Prongs const& candidatesD, + CandsDplus const& candidatesD, TracksPion const&) { // MC rec @@ -691,7 +761,7 @@ struct HfTaskB0Reduced { void processMcWithDmesMlAndDecayTypeCheck(soa::Filtered> const& candidates, aod::HfMcGenRedB0s const& mcParticles, - aod::HfRed3Prongs const& candidatesD, + CandsDplus const& candidatesD, TracksPion const&) { // MC rec @@ -711,7 +781,7 @@ struct HfTaskB0Reduced { void processMcWithB0Ml(soa::Filtered> const& candidates, aod::HfMcGenRedB0s const& mcParticles, - aod::HfRed3Prongs const& candidatesD, + CandsDplus const& candidatesD, TracksPion const&) { // MC rec @@ -731,7 +801,7 @@ struct HfTaskB0Reduced { void processMcWithB0MlAndDecayTypeCheck(soa::Filtered> const& candidates, aod::HfMcGenRedB0s const& mcParticles, - aod::HfRed3Prongs const& candidatesD, + CandsDplus const& candidatesD, TracksPion const&) { // MC rec From 3164b489e9239ca70dc6e7ca07768701893e6480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 21 Nov 2024 09:54:20 +0100 Subject: [PATCH 035/459] [PWGDQ] Fix compilation warnings (#8569) --- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 21 ++++++++++----------- PWGDQ/Tasks/quarkoniaToHyperons.cxx | 4 ++-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 01c641ee43c..82f7d64569b 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -538,8 +538,8 @@ struct AnalysisTrackSelection { } } } // end loop over cuts - } // end loop over MC signals - } // end if (filterMap > 0) + } // end loop over MC signals + } // end if (filterMap > 0) // count the number of associations per track if (filterMap > 0) { @@ -811,7 +811,7 @@ struct AnalysisMuonSelection { } } } // end loop over cuts - } // end loop over MC signals + } // end loop over MC signals // count the number of associations per track if (event.isEventSelected_bit(1)) { @@ -1236,7 +1236,7 @@ struct AnalysisSameEventPairing { // NOTE: In the numbering scheme for the map key, we use the number of barrel cuts in the barrel-track selection task fTrackHistNames[fNCutsBarrel + icut * fNPairCuts + iPairCut] = names; } // end loop (pair cuts) - } // end if (pair cuts) + } // end if (pair cuts) // assign hist directories for the MC matched pairs for each (track cut,MCsignal) combination if (!sigNamesStr.IsNull()) { @@ -1314,7 +1314,7 @@ struct AnalysisSameEventPairing { histNames += Form("%s;%s;%s;", names[0].Data(), names[1].Data(), names[2].Data()); fMuonHistNames[fNCutsMuon + icut * fNCutsMuon + iPairCut] = names; } // end loop (pair cuts) - } // end if (pair cuts) + } // end if (pair cuts) // assign hist directories for pairs matched to MC signals for each (muon cut, MCrec signal) combination if (!sigNamesStr.IsNull()) { @@ -1343,7 +1343,7 @@ struct AnalysisSameEventPairing { } } } // end loop over cuts - } // end if (muonCutsStr) + } // end if (muonCutsStr) // Add histogram classes for each specified MCsignal at the generator level // TODO: create a std::vector of hist classes to be used at Fill time, to avoid using Form in the process function @@ -1739,8 +1739,8 @@ struct AnalysisSameEventPairing { } // end loop (pair cuts) } } // end loop (cuts) - } // end loop over pairs of track associations - } // end loop over events + } // end loop over pairs of track associations + } // end loop over events } // Preslice perReducedMcEvent = aod::reducedtrackMC::reducedMCeventId; @@ -1789,8 +1789,8 @@ struct AnalysisSameEventPairing { fHistMan->FillHistClass(Form("MCTruthGenPair_%s", sig.GetName()), VarManager::fgValues); } } // end loop over MC signals - } // end loop over pairs - } // end loop over events + } // end loop over pairs + } // end loop over events } } // end runMCGen @@ -1979,7 +1979,6 @@ struct AnalysisDileptonTrack { DefineHistograms(fHistMan, fHistNamesDileptonTrack[icut], fConfigHistogramSubgroups.value.data()); // define dilepton-track histograms DefineHistograms(fHistMan, fHistNamesDileptons[icut], "barrel,vertexing"); // define dilepton histograms std::vector mcHistNames; - int isig = 0; for (auto& sig : fRecMCSignals) { mcHistNames.push_back(Form("DileptonTrackMCMatched_%s_%s_%s", tempStr.Data(), fConfigTrackCut.value.data(), sig.GetName())); DefineHistograms(fHistMan, mcHistNames[mcHistNames.size() - 1], fConfigHistogramSubgroups.value.data()); diff --git a/PWGDQ/Tasks/quarkoniaToHyperons.cxx b/PWGDQ/Tasks/quarkoniaToHyperons.cxx index aabb1923fdc..62ba3f9c9d8 100644 --- a/PWGDQ/Tasks/quarkoniaToHyperons.cxx +++ b/PWGDQ/Tasks/quarkoniaToHyperons.cxx @@ -1272,7 +1272,7 @@ struct quarkoniaToHyperons { } template - void analyseV0Candidate(TV0 v0, float pt, float centrality, uint64_t selMap, std::vector& selK0ShortIndices, std::vector& selLambdaIndices, std::vector& selAntiLambdaIndices, int v0TableOffset) + void analyseV0Candidate(TV0 v0, float pt, float /*centrality*/, uint64_t selMap, std::vector& selK0ShortIndices, std::vector& selLambdaIndices, std::vector& selAntiLambdaIndices, int v0TableOffset) // precalculate this information so that a check is one mask operation, not many { bool passK0ShortSelections = false; @@ -1940,7 +1940,7 @@ struct quarkoniaToHyperons { auto cascadeMC = cascade.cascMCCore_as>(); - float ptmc = RecoDecay::sqrtSumOfSquares(cascadeMC.pxMC(), cascadeMC.pyMC()); + // float ptmc = RecoDecay::sqrtSumOfSquares(cascadeMC.pxMC(), cascadeMC.pyMC()); float ymc = 1e-3; if (TMath::Abs(cascadeMC.pdgCode()) == 3312) ymc = RecoDecay::y(std::array{cascadeMC.pxMC(), cascadeMC.pyMC(), cascadeMC.pzMC()}, o2::constants::physics::MassXiMinus); From 71b6f3509a8f9f74393feef0f37de22a6b27c2c6 Mon Sep 17 00:00:00 2001 From: syano0822 <32352856+syano0822@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:55:32 +0900 Subject: [PATCH 036/459] [Common] Add the mft muon matching with real data workflow (#8562) Co-authored-by: Satoshi Yano --- Common/TableProducer/CMakeLists.txt | 5 + Common/TableProducer/match-mft-mch-data.cxx | 886 ++++++++++++++++++++ 2 files changed, 891 insertions(+) create mode 100644 Common/TableProducer/match-mft-mch-data.cxx diff --git a/Common/TableProducer/CMakeLists.txt b/Common/TableProducer/CMakeLists.txt index 7e9ca8dea40..91513029f73 100644 --- a/Common/TableProducer/CMakeLists.txt +++ b/Common/TableProducer/CMakeLists.txt @@ -129,3 +129,8 @@ o2physics_add_dpl_workflow(ese-table-producer SOURCES eseTableProducer.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(mftmch-matching-data + SOURCES match-mft-mch-data.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2Physics::AnalysisCCDB O2Physics::PWGDQCore O2Physics::EventFilteringUtils + COMPONENT_NAME Analysis) diff --git a/Common/TableProducer/match-mft-mch-data.cxx b/Common/TableProducer/match-mft-mch-data.cxx new file mode 100644 index 00000000000..affa18f325d --- /dev/null +++ b/Common/TableProducer/match-mft-mch-data.cxx @@ -0,0 +1,886 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include +#include +#include +#include +#include + +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/DataTypes.h" +#include "Framework/runDataProcessing.h" +#include "CCDB/BasicCCDBManager.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Centrality.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/MftmchMatchingML.h" +#include "Common/Core/trackUtilities.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "PWGDQ/Core/VarManager.h" +#include "PWGDQ/Core/HistogramManager.h" +#include "PWGDQ/Core/AnalysisCut.h" +#include "PWGDQ/Core/AnalysisCompositeCut.h" +#include "PWGDQ/Core/HistogramsLibrary.h" +#include "PWGDQ/Core/CutsLibrary.h" +#include "DataFormatsGlobalTracking/RecoContainerCreateTracksVariadic.h" +#include "DetectorsVertexing/VertexTrackMatcher.h" +#include "ReconstructionDataFormats/PrimaryVertex.h" +#include "ReconstructionDataFormats/VtxTrackIndex.h" +#include "ReconstructionDataFormats/VtxTrackRef.h" +#include "DataFormatsITSMFT/ROFRecord.h" +#include "CommonDataFormat/InteractionRecord.h" +#include "DetectorsVertexing/PVertexerParams.h" +#include "MathUtils/Primitive2D.h" +#include "DataFormatsGlobalTracking/RecoContainer.h" +#include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/DataModel/MatchMFTFT0.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "Field/MagneticField.h" +#include "TGeoGlobalMagField.h" +#include "DetectorsBase/Propagator.h" +#include "DetectorsBase/GeometryManager.h" +#include "EventFiltering/Zorro.h" +#include "ReconstructionDataFormats/TrackFwd.h" +#include "Math/MatrixFunctions.h" +#include "Math/SMatrix.h" +#include "MFTTracking/Tracker.h" +#include "MCHTracking/TrackParam.h" +#include "MCHTracking/TrackExtrap.h" +#include "GlobalTracking/MatchGlobalFwd.h" +#include +#include +#include "TDatabasePDG.h" + +using namespace o2; +using namespace o2::soa; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::framework::expressions; + +using SMatrix55 = ROOT::Math::SMatrix>; +using SMatrix5 = ROOT::Math::SVector; + +// using MyEvents = soa::Join; +// using MyEventsWithMults = soa::Join; +// using MyEventsWithFilter = soa::Join; +// using MyEventsWithMultsAndFilter = soa::Join; +// using MyEventsWithCent = soa::Join; +// using MyEventsWithCentAndMults = soa::Join; +using MyMuons = soa::Join; +using MyMFTs = aod::MFTTracks; +// using MyMuonsWithCov = soa::Join; +// using MyMuonsColl = soa::Join; +// using MyMuonsCollWithCov = soa::Join; +using MyBCs = soa::Join; +using ExtBCs = soa::Join; + +float mMu = TDatabasePDG::Instance()->GetParticle(13)->Mass(); + +TRandom* rnd = new TRandom(); + +TLorentzVector muon1LV; +TLorentzVector muon2LV; +TLorentzVector dimuonLV; + +TVector3 V1; +TVector3 V2; + +namespace o2::aod +{ + +namespace muon_params +{ +DECLARE_SOA_COLUMN(TRACKCHI2, trackChi2, float); +DECLARE_SOA_COLUMN(RABS, rabs, float); +DECLARE_SOA_COLUMN(Q, q, int16_t); + +DECLARE_SOA_COLUMN(PT, pt, float); +DECLARE_SOA_COLUMN(ETA, eta, float); +DECLARE_SOA_COLUMN(PHI, phi, float); + +DECLARE_SOA_COLUMN(PT_AT_PV, pt_pv, float); +DECLARE_SOA_COLUMN(ETA_AT_PV, eta_pv, float); +DECLARE_SOA_COLUMN(PHI_AT_PV, phi_pv, float); + +DECLARE_SOA_COLUMN(PT_AT_DCA, pt_dca, float); +DECLARE_SOA_COLUMN(ETA_AT_DCA, eta_dca, float); +DECLARE_SOA_COLUMN(PHI_AT_DCA, phi_dca, float); +DECLARE_SOA_COLUMN(DCA, dca, float); + +DECLARE_SOA_COLUMN(HASMFT, has_mft, bool); +} // namespace muon_params + +DECLARE_SOA_TABLE(MUONParams, "AOD", "MUON", + muon_params::TRACKCHI2, + muon_params::RABS, + muon_params::Q, + muon_params::PT, + muon_params::ETA, + muon_params::PHI, + muon_params::PT_AT_PV, + muon_params::ETA_AT_PV, + muon_params::PHI_AT_PV, + muon_params::PT_AT_DCA, + muon_params::ETA_AT_DCA, + muon_params::PHI_AT_DCA, + muon_params::DCA, + muon_params::HASMFT); + +namespace mft_params +{ +DECLARE_SOA_COLUMN(NCLUST, nclust, int); +DECLARE_SOA_COLUMN(ISCA, isCA, bool); +DECLARE_SOA_COLUMN(TRACKCHI2, trackChi2, float); +DECLARE_SOA_COLUMN(Q, q, int16_t); +DECLARE_SOA_COLUMN(PT, pt, float); +DECLARE_SOA_COLUMN(ETA, eta, float); +DECLARE_SOA_COLUMN(PHI, phi, float); +DECLARE_SOA_COLUMN(PT_AT_DCA, pt_dca, float); +DECLARE_SOA_COLUMN(ETA_AT_DCA, eta_dca, float); +DECLARE_SOA_COLUMN(PHI_AT_DCA, phi_dca, float); +DECLARE_SOA_COLUMN(DCA, dca, float); +DECLARE_SOA_COLUMN(DCAx, dcax, float); +DECLARE_SOA_COLUMN(DCAy, dcay, float); +} // namespace mft_params + +DECLARE_SOA_TABLE(MFTParams, "AOD", "MFT", + mft_params::NCLUST, + mft_params::ISCA, + mft_params::TRACKCHI2, + mft_params::Q, + mft_params::PT, + mft_params::ETA, + mft_params::PHI, + mft_params::PT_AT_DCA, + mft_params::ETA_AT_DCA, + mft_params::PHI_AT_DCA, + mft_params::DCAx, + mft_params::DCAy, + mft_params::DCA); + +namespace matching_params +{ +// matching parameters +DECLARE_SOA_COLUMN(NClustMFTTracks, nClustMFT, int); +DECLARE_SOA_COLUMN(Chi2MFTTracks, chi2MFT, float); + +DECLARE_SOA_COLUMN(DeltaP, dp_mchplane, float); +DECLARE_SOA_COLUMN(DeltaPt, dpt_mchplane, float); +DECLARE_SOA_COLUMN(DeltaEta, deta_mchplane, float); +DECLARE_SOA_COLUMN(DeltaPhi, dphi_mchplane, float); +DECLARE_SOA_COLUMN(DeltaX, dx_mchplane, float); +DECLARE_SOA_COLUMN(DeltaY, dy_mchplane, float); + +DECLARE_SOA_COLUMN(MchPt, mchpt, float); +DECLARE_SOA_COLUMN(MchEta, mcheta, float); +DECLARE_SOA_COLUMN(MchPhi, mchphi, float); +DECLARE_SOA_COLUMN(MchQ, mchq, float); + +DECLARE_SOA_COLUMN(MftPt, mftpt, float); +DECLARE_SOA_COLUMN(MftEta, mfteta, float); +DECLARE_SOA_COLUMN(MftPhi, mftphi, float); +DECLARE_SOA_COLUMN(MftQ, mftq, float); + +DECLARE_SOA_COLUMN(MftDCA, mftdca, float); + +} // namespace matching_params + +DECLARE_SOA_TABLE(MatchParams, "AOD", "MATCHING", + matching_params::NClustMFTTracks, + matching_params::Chi2MFTTracks, + matching_params::DeltaP, + matching_params::DeltaPt, + matching_params::DeltaEta, + matching_params::DeltaPhi, + matching_params::DeltaX, + matching_params::DeltaY, + matching_params::MchPt, + matching_params::MchEta, + matching_params::MchPhi, + matching_params::MchQ, + matching_params::MftPt, + matching_params::MftEta, + matching_params::MftPhi, + matching_params::MftQ, + matching_params::MftDCA); + +namespace mix_matching_params +{ +// matching parameters +DECLARE_SOA_COLUMN(NClustMFTTracks, nClustMFT, int); +DECLARE_SOA_COLUMN(Chi2MFTTracks, chi2MFT, float); + +DECLARE_SOA_COLUMN(DeltaP, dp_mchplane, float); +DECLARE_SOA_COLUMN(DeltaPt, dpt_mchplane, float); +DECLARE_SOA_COLUMN(DeltaEta, deta_mchplane, float); +DECLARE_SOA_COLUMN(DeltaPhi, dphi_mchplane, float); +DECLARE_SOA_COLUMN(DeltaX, dx_mchplane, float); +DECLARE_SOA_COLUMN(DeltaY, dy_mchplane, float); + +DECLARE_SOA_COLUMN(MchPt, mchpt, float); +DECLARE_SOA_COLUMN(MchEta, mcheta, float); +DECLARE_SOA_COLUMN(MchPhi, mchphi, float); +DECLARE_SOA_COLUMN(MchQ, mchq, float); + +DECLARE_SOA_COLUMN(MftPt, mftpt, float); +DECLARE_SOA_COLUMN(MftEta, mfteta, float); +DECLARE_SOA_COLUMN(MftPhi, mftphi, float); +DECLARE_SOA_COLUMN(MftQ, mftq, float); +DECLARE_SOA_COLUMN(MftDCA, mftdca, float); +} // namespace mix_matching_params + +namespace tag_matching_params +{ +// matching parameters +DECLARE_SOA_COLUMN(NClustMFTTracks, nClustMFT, int); +DECLARE_SOA_COLUMN(Chi2MFTTracks, chi2MFT, float); + +DECLARE_SOA_COLUMN(DeltaP, dp_mchplane, float); +DECLARE_SOA_COLUMN(DeltaPt, dpt_mchplane, float); +DECLARE_SOA_COLUMN(DeltaEta, deta_mchplane, float); +DECLARE_SOA_COLUMN(DeltaPhi, dphi_mchplane, float); +DECLARE_SOA_COLUMN(DeltaX, dx_mchplane, float); +DECLARE_SOA_COLUMN(DeltaY, dy_mchplane, float); + +DECLARE_SOA_COLUMN(MchPt, mchpt, float); +DECLARE_SOA_COLUMN(MchEta, mcheta, float); +DECLARE_SOA_COLUMN(MchPhi, mchphi, float); +DECLARE_SOA_COLUMN(MchQ, mchq, float); + +DECLARE_SOA_COLUMN(MftPt, mftpt, float); +DECLARE_SOA_COLUMN(MftEta, mfteta, float); +DECLARE_SOA_COLUMN(MftPhi, mftphi, float); +DECLARE_SOA_COLUMN(MftQ, mftq, float); +DECLARE_SOA_COLUMN(MftDCA, mftdca, float); + +DECLARE_SOA_COLUMN(IsTaged, isTaged, bool); +} // namespace tag_matching_params + +DECLARE_SOA_TABLE(TagMatchParams, "AOD", "TAGMATCHING", + tag_matching_params::NClustMFTTracks, + tag_matching_params::Chi2MFTTracks, + tag_matching_params::DeltaP, + tag_matching_params::DeltaPt, + tag_matching_params::DeltaEta, + tag_matching_params::DeltaPhi, + tag_matching_params::DeltaX, + tag_matching_params::DeltaY, + tag_matching_params::MchPt, + tag_matching_params::MchEta, + tag_matching_params::MchPhi, + tag_matching_params::MchQ, + tag_matching_params::MftPt, + tag_matching_params::MftEta, + tag_matching_params::MftPhi, + tag_matching_params::MftQ, + tag_matching_params::MftDCA, + tag_matching_params::IsTaged); + +namespace probe_matching_params +{ +// matching parameters +DECLARE_SOA_COLUMN(NMFTCandTagMuon, nTagMFT, int); +DECLARE_SOA_COLUMN(TagMuonP, tagmuonp, float); + +DECLARE_SOA_COLUMN(NClustMFTTracks, nClustMFT, int); +DECLARE_SOA_COLUMN(Chi2MFTTracks, chi2MFT, float); + +DECLARE_SOA_COLUMN(DeltaP, dp_mchplane, float); +DECLARE_SOA_COLUMN(DeltaPt, dpt_mchplane, float); +DECLARE_SOA_COLUMN(DeltaEta, deta_mchplane, float); +DECLARE_SOA_COLUMN(DeltaPhi, dphi_mchplane, float); +DECLARE_SOA_COLUMN(DeltaX, dx_mchplane, float); +DECLARE_SOA_COLUMN(DeltaY, dy_mchplane, float); + +DECLARE_SOA_COLUMN(MchPt, mchpt, float); +DECLARE_SOA_COLUMN(MchEta, mcheta, float); +DECLARE_SOA_COLUMN(MchPhi, mchphi, float); +DECLARE_SOA_COLUMN(MchQ, mchq, float); + +DECLARE_SOA_COLUMN(MftPt, mftpt, float); +DECLARE_SOA_COLUMN(MftEta, mfteta, float); +DECLARE_SOA_COLUMN(MftPhi, mftphi, float); +DECLARE_SOA_COLUMN(MftQ, mftq, float); +DECLARE_SOA_COLUMN(MftDCA, mftdca, float); +} // namespace probe_matching_params + +DECLARE_SOA_TABLE(ProbeMatchParams, "AOD", "PROBEMATCHING", + probe_matching_params::NMFTCandTagMuon, + probe_matching_params::TagMuonP, + probe_matching_params::NClustMFTTracks, + probe_matching_params::Chi2MFTTracks, + probe_matching_params::DeltaP, + probe_matching_params::DeltaPt, + probe_matching_params::DeltaEta, + probe_matching_params::DeltaPhi, + probe_matching_params::DeltaX, + probe_matching_params::DeltaY, + probe_matching_params::MchPt, + probe_matching_params::MchEta, + probe_matching_params::MchPhi, + probe_matching_params::MchQ, + probe_matching_params::MftPt, + probe_matching_params::MftEta, + probe_matching_params::MftPhi, + probe_matching_params::MftQ, + probe_matching_params::MftDCA); + +DECLARE_SOA_TABLE(MixMatchParams, "AOD", "MIXMATCHING", + mix_matching_params::NClustMFTTracks, + mix_matching_params::Chi2MFTTracks, + mix_matching_params::DeltaP, + mix_matching_params::DeltaPt, + mix_matching_params::DeltaEta, + mix_matching_params::DeltaPhi, + mix_matching_params::DeltaX, + mix_matching_params::DeltaY, + mix_matching_params::MchPt, + mix_matching_params::MchEta, + mix_matching_params::MchPhi, + mix_matching_params::MchQ, + mix_matching_params::MftPt, + mix_matching_params::MftEta, + mix_matching_params::MftPhi, + mix_matching_params::MftQ, + mix_matching_params::MftDCA); + +namespace muon_pair +{ +DECLARE_SOA_COLUMN(NMFT, nMft, int); +DECLARE_SOA_COLUMN(Q, q, int16_t); +DECLARE_SOA_COLUMN(M, m, float); +DECLARE_SOA_COLUMN(Pt, pt, float); +DECLARE_SOA_COLUMN(Rap, rap, float); +} // namespace muon_pair + +DECLARE_SOA_TABLE(MuonPair, "AOD", "DIMUON", muon_pair::NMFT, muon_pair::Q, muon_pair::M, muon_pair::Pt, muon_pair::Rap); + +namespace tag_muon_pair +{ +DECLARE_SOA_COLUMN(NMFT, nMft, int); +DECLARE_SOA_COLUMN(Q, q, int16_t); +DECLARE_SOA_COLUMN(M, m, float); +DECLARE_SOA_COLUMN(Pt, pt, float); +DECLARE_SOA_COLUMN(Rap, rap, float); +} // namespace tag_muon_pair + +DECLARE_SOA_TABLE(TagMuonPair, "AOD", "TAGDIMUON", tag_muon_pair::NMFT, tag_muon_pair::Q, tag_muon_pair::M, tag_muon_pair::Pt, tag_muon_pair::Rap); + +} // namespace o2::aod + +struct match_mft_mch_data { + + Produces matchingParams; + Produces tagmatchingParams; + Produces probematchingParams; + Produces mixmatchingParams; + Produces muonPairs; + Produces tagmuonPairs; + Produces muonParams; + Produces mftParams; + + HistogramRegistry registry{ + "registry", + {{"hMchP", "MCH track total momentum (at the first station); p [GeV/c]; Counts", {HistType::kTH1F, {{2000, 0, 200}}}}, + {"hMchCorrP", "MCH track total momentum (propagated to PV); p [GeV/c]; Counts", {HistType::kTH1F, {{2000, 0, 200}}}}, + {"hMassCorrMchPair", "Corrected MCH track pair mass (propagated to PV); m [GeV/c^{2}]; Counts", {HistType::kTH1F, {{1000, 0, 10}}}}}}; + + Configurable fEtaMchLow{"cfgEtaMchLow", -4.0f, ""}; + Configurable fEtaMchUp{"cfgEtaMchUp", -2.5f, ""}; + Configurable fEtaMftLow{"cfgEtaMftlow", -3.6f, ""}; + Configurable fEtaMftUp{"cfgEtaMftup", -2.5f, ""}; + // Filter etaMchFilter = (fEtaMchLow < aod::fwdtrack::eta) && (aod::fwdtrack::eta < fEtaMchUp); + + Configurable fRabsLow1{"cfgRabsLow1", 17.6f, ""}; + Configurable fRabsUp1{"cfgRabsUp1", 26.5f, ""}; + Configurable fRabsLow2{"cfgRabsLow2", 26.5f, ""}; + Configurable fRabsUp2{"cfgRabsUp2", 89.5f, ""}; + Configurable fPdcaUp1{"cfgPdcaUp1", 594.f, ""}; + Configurable fPdcaUp2{"cfgPdcaUp2", 324.f, ""}; + // Filter rAbsFilter = (fRabsLow1 < aod::fwdtrack::rAtAbsorberEnd && aod::fwdtrack::rAtAbsorberEnd < fRabsUp1 && aod::fwdtrack::pDca < fPdcaUp1) || (fRabsLow2 < aod::fwdtrack::rAtAbsorberEnd && aod::fwdtrack::rAtAbsorberEnd < fRabsUp2 && aod::fwdtrack::pDca < fPdcaUp2); + + Configurable fTrackChi2MchUp{"cfgTrackChi2MchUp", 5.f, ""}; + // Filter trackChi2MchFilter = aod::fwdtrack::chi2 < fTrackChi2MchUp; + + Configurable fMatchingChi2MchMidUp{"cfgMatchingChi2MchMidUp", 999.f, ""}; + // Filter matchingChi2MchMidFilter = aod::fwdtrack::chi2MatchMCHMID < fMatchingChi2MchMidUp; + + // Configurable fSaveMixedMatchingParamsRate{"cfgSaveMixedMatchingParamsRate", 0.002f, ""}; + + Configurable fPreselectMatchingX{"cfgPreselectMatchingX", 999.f, ""}; + Configurable fPreselectMatchingY{"cfgPreselectMatchingY", 999.f, ""}; + + Configurable fTagMassWindowMin{"cfgTagMassWindowMin", 2.8f, ""}; + Configurable fTagMassWindowMax{"cfgTagMassWindowMax", 3.3f, ""}; + + Configurable fEventMaxDeltaNMFT{"cfgEventMaxDeltaNMFT", 1, ""}; + Configurable fEventMaxDeltaVtxZ{"cfgEventMaxDeltaVtxZ", 1.f, ""}; + + Configurable fTagRWindow{"cfgTagRWindow", 3.f, ""}; + Configurable fTagPhiWindow{"cfgTagPhiWindow", 0.1f, ""}; + Configurable fTagEtaWindow{"cfgTagEtaWindow", 0.1f, ""}; + + Service ccdb; + Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + + // o2::parameters::GRPMagField* grpmag = nullptr; + o2::globaltracking::MatchGlobalFwd mMatching; + o2::field::MagneticField* fieldB; + + o2::ccdb::CcdbApi ccdbApi; + int mRunNumber; + + void init(o2::framework::InitContext&) + { + ccdb->setURL(ccdburl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); + ccdbApi.init(ccdburl); + mRunNumber = 0; + } + + void initCCDB(ExtBCs::iterator const& bc) + { + if (mRunNumber == bc.runNumber()) { + return; + } + mRunNumber = bc.runNumber(); + std::map metadata; + auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, mRunNumber); + auto ts = soreor.first; + auto grpmag = ccdbApi.retrieveFromTFileAny(grpmagPath, metadata, ts); + o2::base::Propagator::initFieldFromGRP(grpmag); + if (!o2::base::GeometryManager::isGeometryLoaded()) { + ccdb->get(geoPath); + } + o2::mch::TrackExtrap::setField(); + fieldB = static_cast(TGeoGlobalMagField::Instance()->GetField()); + } + + enum ProagationPoint { ToVtx, + ToDCA }; + + template + o2::dataformats::GlobalFwdTrack PropagateMuon(T const& muon, int PropType) + { + + auto collision = muon.collision(); + + o2::dataformats::GlobalFwdTrack propmuon; + + double chi2 = muon.chi2(); + + SMatrix5 tpars(muon.x(), muon.y(), muon.phi(), muon.tgl(), muon.signed1Pt()); + std::vector v1{muon.cXX(), muon.cXY(), muon.cYY(), muon.cPhiX(), muon.cPhiY(), + muon.cPhiPhi(), muon.cTglX(), muon.cTglY(), muon.cTglPhi(), muon.cTglTgl(), + muon.c1PtX(), muon.c1PtY(), muon.c1PtPhi(), muon.c1PtTgl(), muon.c1Pt21Pt2()}; + if (isGoodFwdTrack(muon)) { + SMatrix55 tcovs(v1.begin(), v1.end()); + o2::track::TrackParCovFwd fwdtrack{muon.z(), tpars, tcovs, chi2}; + + o2::dataformats::GlobalFwdTrack track; + track.setParameters(tpars); + track.setZ(fwdtrack.getZ()); + track.setCovariances(tcovs); + auto mchTrack = mMatching.FwdtoMCH(track); + if (PropType == ProagationPoint::ToVtx) + o2::mch::TrackExtrap::extrapToVertex(mchTrack, collision.posX(), collision.posY(), collision.posZ(), collision.covXX(), collision.covYY()); + else if (PropType == ProagationPoint::ToDCA) + o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchTrack, collision.posZ()); + + auto proptrack = mMatching.MCHtoFwd(mchTrack); + propmuon.setParameters(proptrack.getParameters()); + propmuon.setZ(proptrack.getZ()); + propmuon.setCovariances(proptrack.getCovariances()); + } + + v1.clear(); + v1.shrink_to_fit(); + + return propmuon; + } + + template + o2::track::TrackParCovFwd PropagateMFT(T const& mfttrack, int PropType) + { + std::vector mftv1; + SMatrix55 mftcovs{mftv1.begin(), mftv1.end()}; + SMatrix5 mftpars = {mfttrack.x(), mfttrack.y(), mfttrack.phi(), mfttrack.tgl(), mfttrack.signed1Pt()}; + o2::track::TrackParCovFwd mftpartrack = {mfttrack.z(), mftpars, mftcovs, mfttrack.chi2()}; + if (PropType == ProagationPoint::ToDCA) { + auto collision = mfttrack.collision(); + double propVec[3] = {fabs(mfttrack.x() - collision.posX()), fabs(mfttrack.y() - collision.posY()), fabs(mfttrack.z() - collision.posZ())}; + double centerZ[3] = {mfttrack.x() - propVec[0] / 2., mfttrack.y() - propVec[1] / 2., mfttrack.z() - propVec[2] / 2.}; + float Bz = fieldB->getBz(centerZ); + mftpartrack.propagateToZ(collision.posZ(), Bz); + } + return mftpartrack; + } + + template + o2::track::TrackParCovFwd PropagateMFTtoMatchingPlane(MFT const& mfttrack, FWD const& fwdtrack) + { + std::vector v1; // Temporary null vector for the computation of the covariance matrix + double propVec[3] = {fwdtrack.x() - mfttrack.x(), fwdtrack.y() - mfttrack.y(), fwdtrack.z() - mfttrack.z()}; + double centerZ[3] = {mfttrack.x() + propVec[0] / 2., mfttrack.y() + propVec[1] / 2., mfttrack.z() + propVec[2] / 2.}; + float Bz = fieldB->getBz(centerZ); // gives error if the propagator is not initFielded + SMatrix55 tmftcovs(v1.begin(), v1.end()); + SMatrix5 tmftpars(mfttrack.x(), mfttrack.y(), mfttrack.phi(), mfttrack.tgl(), mfttrack.signed1Pt()); + o2::track::TrackParCovFwd extrap_mfttrack{mfttrack.z(), tmftpars, tmftcovs, mfttrack.chi2()}; + extrap_mfttrack.propagateToZ(fwdtrack.z(), Bz); // z in cm + return extrap_mfttrack; + } + + template + bool isGoodFwdTrack(T track) + { + if (!track.has_collision()) + return false; + if (track.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) + return false; + if (track.chi2() > fTrackChi2MchUp) + return false; + if (17.6 > track.rAtAbsorberEnd() || track.rAtAbsorberEnd() > 89.5) + return false; + if (track.rAtAbsorberEnd() < 26.5 && 594. < track.pDca()) + return false; + if (track.rAtAbsorberEnd() > 26.5 && 324. < track.pDca()) + return false; + return true; + } + + template + int selectTagMuon(T track1, T track2) + { + if (track1.pt() > track2.pt()) { + return track1.globalIndex(); + } else { + return track2.globalIndex(); + } + } + + template + int selectProbeMuon(T track1, T track2) + { + if (track1.pt() < track2.pt()) { + return track1.globalIndex(); + } else { + return track2.globalIndex(); + } + } + + bool isGoodKenematicTrack(o2::dataformats::GlobalFwdTrack track) + { + if (fEtaMchLow > track.getEta() || track.getEta() > fEtaMchUp) + return false; + return true; + } + + void process(aod::Collisions const& collisions, ExtBCs const& ebcs, + MyMuons const& fwdtracks, MyMFTs const& mfttracks) + { + initCCDB(ebcs.begin()); + + std::unordered_set bcs_mfttrack; + std::unordered_map map_vtxZ; + std::unordered_map nmfttracks; + std::unordered_map> map_mfttraks; + + for (const auto& mfttrack : mfttracks) { + + if (!mfttrack.has_collision()) + continue; + bcs_mfttrack.insert(mfttrack.collisionId()); + std::vector& tracks = map_mfttraks[mfttrack.collisionId()]; + tracks.push_back(mfttrack.globalIndex()); + + o2::track::TrackParCovFwd mftpartrack = PropagateMFT(mfttrack, ProagationPoint::ToDCA); + + auto collision = mfttrack.collision(); + + map_vtxZ[mfttrack.collisionId()] = collision.posZ(); + + float dx = mftpartrack.getX() - collision.posX(); + float dy = mftpartrack.getY() - collision.posY(); + float dca = sqrt(dx * dx + dy * dy); + + mftParams(mfttrack.nClusters(), mfttrack.isCA(), + mfttrack.chi2(), mfttrack.sign(), + mfttrack.pt(), mfttrack.eta(), mfttrack.phi(), + mftpartrack.getPt(), mftpartrack.getEta(), mftpartrack.getPhi(), + dx, dy, dca); + + nmfttracks[mfttrack.collisionId()]++; + } + + std::unordered_map nfwdtracks; + std::unordered_map> map_fwdtraks; + + for (auto fwdtrack : fwdtracks) { + + if (!isGoodFwdTrack(fwdtrack)) + continue; + + o2::dataformats::GlobalFwdTrack propmuonAtPV = PropagateMuon(fwdtrack, ProagationPoint::ToVtx); + o2::dataformats::GlobalFwdTrack propmuonAtDCA = PropagateMuon(fwdtrack, ProagationPoint::ToDCA); + if (!isGoodKenematicTrack(propmuonAtPV)) + continue; + std::vector& tracks = map_fwdtraks[fwdtrack.collisionId()]; + tracks.push_back(fwdtrack.globalIndex()); + + auto collision = fwdtrack.collision(); + + float dx = propmuonAtDCA.getX() - collision.posX(); + float dy = propmuonAtDCA.getY() - collision.posY(); + float DCA = sqrt(dx * dx + dy * dy); + + bool hasMFT = false; + + std::vector& mfttracks = map_mfttraks[fwdtrack.collisionId()]; + + if (mfttracks.size() > 0) + hasMFT = true; + + muonParams(fwdtrack.chi2(), fwdtrack.rAtAbsorberEnd(), fwdtrack.sign(), fwdtrack.pt(), fwdtrack.eta(), fwdtrack.phi(), + propmuonAtPV.getPt(), propmuonAtPV.getEta(), propmuonAtPV.getPhi(), + propmuonAtDCA.getPt(), propmuonAtDCA.getEta(), propmuonAtDCA.getPhi(), + DCA, hasMFT); + + nfwdtracks[fwdtrack.collisionId()]++; + } + + for (auto fwdtrack1 : fwdtracks) { + + if (!isGoodFwdTrack(fwdtrack1)) + continue; + + int ibc = fwdtrack1.collisionId(); + auto collision = fwdtrack1.collision(); + + o2::dataformats::GlobalFwdTrack fwdtrackAtPV1 = PropagateMuon(fwdtrack1, ProagationPoint::ToVtx); + if (!isGoodKenematicTrack(fwdtrackAtPV1)) + continue; + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////// MIXED EVENT /////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + for (auto bc_mfttrack : bcs_mfttrack) { + + if (ibc == bc_mfttrack) + continue; + if (fabs(nmfttracks[ibc] - nmfttracks[bc_mfttrack]) > fEventMaxDeltaNMFT) + continue; + if (fabs(map_vtxZ[bc_mfttrack] - collision.posZ()) > fEventMaxDeltaVtxZ) + continue; + + std::vector& mfttrackGlobalIndex = map_mfttraks[bc_mfttrack]; + + for (int idmfttrack1 = 0; idmfttrack1 < static_cast(mfttrackGlobalIndex.size()); ++idmfttrack1) { + + auto mfttrack1 = mfttracks.rawIteratorAt(mfttrackGlobalIndex[idmfttrack1]); + o2::track::TrackParCovFwd mfttrack_at_matching = PropagateMFTtoMatchingPlane(mfttrack1, fwdtrack1); + + V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); + V2.SetPtEtaPhi(fwdtrack1.pt(), fwdtrack1.eta(), fwdtrack1.phi()); + + double deltaP = mfttrack_at_matching.getP() - fwdtrack1.p(); + double deltaPt = mfttrack_at_matching.getPt() - fwdtrack1.pt(); + double deltaX = mfttrack_at_matching.getX() - fwdtrack1.x(); + double deltaY = mfttrack_at_matching.getY() - fwdtrack1.y(); + double deltaPhi = V1.DeltaPhi(V2); + double deltaEta = mfttrack_at_matching.getEta() - fwdtrack1.eta(); + + if (fabs(deltaX) > fPreselectMatchingX) + continue; + if (fabs(deltaY) > fPreselectMatchingY) + continue; + + o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFT(mfttrack1, ProagationPoint::ToDCA); + float dx = mfttrack_at_dca.getX() - collision.posX(); + float dy = mfttrack_at_dca.getY() - collision.posY(); + float DCA = sqrt(dx * dx + dy * dy); + + mixmatchingParams(mfttrack1.nClusters(), mfttrack1.chi2(), + deltaP, deltaPt, deltaEta, deltaPhi, deltaX, deltaY, + fwdtrackAtPV1.getPt(), fwdtrackAtPV1.getEta(), fwdtrackAtPV1.getPhi(), fwdtrack1.sign(), + mfttrack_at_dca.getPt(), mfttrack_at_dca.getEta(), mfttrack_at_dca.getPhi(), mfttrack1.sign(), DCA); + } + } // end of loop bc_mfttrack + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /////////////// SAME EVENT /////////////// + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + std::vector& mfttrackGlobalIndex = map_mfttraks[ibc]; + + for (int idmfttrack1 = 0; idmfttrack1 < static_cast(mfttrackGlobalIndex.size()); ++idmfttrack1) { + + auto mfttrack1 = mfttracks.rawIteratorAt(mfttrackGlobalIndex[idmfttrack1]); + o2::track::TrackParCovFwd mfttrack_at_matching = PropagateMFTtoMatchingPlane(mfttrack1, fwdtrack1); + V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); + V2.SetPtEtaPhi(fwdtrack1.pt(), fwdtrack1.eta(), fwdtrack1.phi()); + + double deltaP = mfttrack_at_matching.getP() - fwdtrack1.p(); + double deltaPt = mfttrack_at_matching.getPt() - fwdtrack1.pt(); + double deltaX = mfttrack_at_matching.getX() - fwdtrack1.x(); + double deltaY = mfttrack_at_matching.getY() - fwdtrack1.y(); + double deltaPhi = V1.DeltaPhi(V2); + double deltaEta = mfttrack_at_matching.getEta() - fwdtrack1.eta(); + + if (fabs(deltaX) > fPreselectMatchingX) + continue; + if (fabs(deltaY) > fPreselectMatchingY) + continue; + + o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFT(mfttrack1, ProagationPoint::ToDCA); + float dx = mfttrack_at_dca.getX() - collision.posX(); + float dy = mfttrack_at_dca.getY() - collision.posY(); + float DCA = sqrt(dx * dx + dy * dy); + + matchingParams(mfttrack1.nClusters(), mfttrack1.chi2(), + deltaP, deltaPt, deltaEta, deltaPhi, deltaX, deltaY, + fwdtrackAtPV1.getPt(), fwdtrackAtPV1.getEta(), fwdtrackAtPV1.getPhi(), fwdtrack1.sign(), + mfttrack_at_dca.getPt(), mfttrack_at_dca.getEta(), mfttrack_at_dca.getPhi(), mfttrack1.sign(), DCA); + } // end of loop idmfttrack1 + + std::vector& fwdtrackGlobalIndex = map_fwdtraks[ibc]; + + for (int idfwdtrack2 = 0; idfwdtrack2 < static_cast(fwdtrackGlobalIndex.size()); ++idfwdtrack2) { + + if (fwdtrack1.globalIndex() == fwdtrackGlobalIndex[idfwdtrack2]) + continue; + + auto fwdtrack2 = fwdtracks.rawIteratorAt(fwdtrackGlobalIndex[idfwdtrack2]); + + if (!isGoodFwdTrack(fwdtrack2)) + continue; + + o2::dataformats::GlobalFwdTrack fwdtrackAtPV2 = PropagateMuon(fwdtrack2, ProagationPoint::ToVtx); + if (!isGoodKenematicTrack(fwdtrackAtPV2)) + continue; + + muon1LV.SetPtEtaPhiM(fwdtrackAtPV1.getPt(), fwdtrackAtPV1.getEta(), fwdtrackAtPV1.getPhi(), mMu); + muon2LV.SetPtEtaPhiM(fwdtrackAtPV2.getPt(), fwdtrackAtPV2.getEta(), fwdtrackAtPV2.getPhi(), mMu); + dimuonLV = muon1LV + muon2LV; + + muonPairs(nmfttracks[ibc], fwdtrack1.sign() + fwdtrack2.sign(), dimuonLV.M(), dimuonLV.Pt(), dimuonLV.Rapidity()); + + if (fabs(fwdtrack1.sign() + fwdtrack2.sign()) > 0) + continue; + if (fTagMassWindowMin > dimuonLV.M() || dimuonLV.M() > fTagMassWindowMax) + continue; + if (nmfttracks[ibc] < 1) + continue; + + tagmuonPairs(nmfttracks[ibc], fwdtrack1.sign() + fwdtrack2.sign(), dimuonLV.M(), dimuonLV.Pt(), dimuonLV.Rapidity()); + + bool isGoodTag = false; + int nMFTCandsTagMuon = 0; + + auto tagfwdtrack = fwdtracks.rawIteratorAt(selectTagMuon(fwdtrack1, fwdtrack2)); + o2::dataformats::GlobalFwdTrack tagfwdtrackAtPV = PropagateMuon(tagfwdtrack, ProagationPoint::ToVtx); + + for (int idmfttrack1 = 0; idmfttrack1 < static_cast(mfttrackGlobalIndex.size()); ++idmfttrack1) { + + auto mfttrack1 = mfttracks.rawIteratorAt(mfttrackGlobalIndex[idmfttrack1]); + o2::track::TrackParCovFwd mfttrack_at_matching = PropagateMFTtoMatchingPlane(mfttrack1, tagfwdtrack); + + V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); + V2.SetPtEtaPhi(tagfwdtrack.pt(), tagfwdtrack.eta(), tagfwdtrack.phi()); + + double deltaP = mfttrack_at_matching.getP() - tagfwdtrack.p(); + double deltaPt = mfttrack_at_matching.getPt() - tagfwdtrack.pt(); + double deltaX = mfttrack_at_matching.getX() - tagfwdtrack.x(); + double deltaY = mfttrack_at_matching.getY() - tagfwdtrack.y(); + double deltaPhi = V1.DeltaPhi(V2); + double deltaEta = mfttrack_at_matching.getEta() - tagfwdtrack.eta(); + + double deltaR = sqrt(deltaX * deltaX + deltaY * deltaY); + if (fabs(deltaX) > fPreselectMatchingX) + continue; + if (fabs(deltaY) > fPreselectMatchingY) + continue; + + o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFT(mfttrack1, ProagationPoint::ToDCA); + float dx = mfttrack_at_dca.getX() - collision.posX(); + float dy = mfttrack_at_dca.getY() - collision.posY(); + float DCA = sqrt(dx * dx + dy * dy); + + bool dummyTag = false; + + if (fabs(deltaR) < fTagRWindow && fabs(deltaPhi) < fTagPhiWindow && fabs(deltaEta) < fTagEtaWindow) { + isGoodTag = true; + dummyTag = true; + nMFTCandsTagMuon++; + } + + tagmatchingParams(mfttrack1.nClusters(), mfttrack1.chi2(), + deltaP, deltaPt, deltaEta, deltaPhi, deltaX, deltaY, + tagfwdtrackAtPV.getPt(), tagfwdtrackAtPV.getEta(), tagfwdtrackAtPV.getPhi(), tagfwdtrack.sign(), + mfttrack_at_dca.getPt(), mfttrack_at_dca.getEta(), mfttrack_at_dca.getPhi(), mfttrack1.sign(), DCA, dummyTag); + } + + if (!isGoodTag) + continue; + + auto probefwdtrack = fwdtracks.rawIteratorAt(selectProbeMuon(fwdtrack1, fwdtrack2)); + o2::dataformats::GlobalFwdTrack probefwdtrackAtPV = PropagateMuon(probefwdtrack, ProagationPoint::ToVtx); + + for (int idmfttrack1 = 0; idmfttrack1 < static_cast(mfttrackGlobalIndex.size()); ++idmfttrack1) { + + auto mfttrack1 = mfttracks.rawIteratorAt(mfttrackGlobalIndex[idmfttrack1]); + o2::track::TrackParCovFwd mfttrack_at_matching = PropagateMFTtoMatchingPlane(mfttrack1, probefwdtrack); + + V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); + V2.SetPtEtaPhi(probefwdtrack.pt(), probefwdtrack.eta(), probefwdtrack.phi()); + + double deltaP = mfttrack_at_matching.getP() - probefwdtrack.p(); + double deltaPt = mfttrack_at_matching.getPt() - probefwdtrack.pt(); + double deltaX = mfttrack_at_matching.getX() - probefwdtrack.x(); + double deltaY = mfttrack_at_matching.getY() - probefwdtrack.y(); + double deltaPhi = V1.DeltaPhi(V2); + double deltaEta = mfttrack_at_matching.getEta() - probefwdtrack.eta(); + + if (fabs(deltaX) > fPreselectMatchingX) + continue; + if (fabs(deltaY) > fPreselectMatchingY) + continue; + + o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFT(mfttrack1, ProagationPoint::ToDCA); + float dx = mfttrack_at_dca.getX() - collision.posX(); + float dy = mfttrack_at_dca.getY() - collision.posY(); + float DCA = sqrt(dx * dx + dy * dy); + + probematchingParams(nMFTCandsTagMuon, tagfwdtrack.p(), mfttrack1.nClusters(), mfttrack1.chi2(), + deltaP, deltaPt, deltaEta, deltaPhi, deltaX, deltaY, + probefwdtrackAtPV.getPt(), probefwdtrackAtPV.getEta(), probefwdtrackAtPV.getPhi(), probefwdtrack.sign(), + mfttrack_at_dca.getPt(), mfttrack_at_dca.getEta(), mfttrack_at_dca.getPhi(), mfttrack1.sign(), DCA); + } + } + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From d2147afcfb8a26db1d14b4841165d3e11d93fa6e Mon Sep 17 00:00:00 2001 From: Noor Koster <82090643+cnkoster@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:56:17 +0100 Subject: [PATCH 037/459] [PWGCF] added QA histos and fixed getCorrection function (#8573) Co-authored-by: ALICE Action Bot --- PWGCF/Flow/TableProducer/ZDCQvectors.cxx | 200 +++++++++++++++-------- 1 file changed, 131 insertions(+), 69 deletions(-) diff --git a/PWGCF/Flow/TableProducer/ZDCQvectors.cxx b/PWGCF/Flow/TableProducer/ZDCQvectors.cxx index 24c47443d1c..f8cfb02a8a4 100644 --- a/PWGCF/Flow/TableProducer/ZDCQvectors.cxx +++ b/PWGCF/Flow/TableProducer/ZDCQvectors.cxx @@ -82,15 +82,16 @@ std::vector hZN_mean(10, nullptr); // Get from calibration file std::vector mean_10perCent_v(4, nullptr); // hQXA, hQYA, hQXC, hQYC // step2: Small bins 1D -std::vector mean_1perCent_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC -std::vector mean_vx_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC -std::vector mean_vy_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC -std::vector mean_vz_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC +std::vector mean_cent_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC +std::vector mean_vx_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC +std::vector mean_vy_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC +std::vector mean_vz_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC // Define histogrm names here to use same names for creating and later uploading and retrieving data from ccdb // Energy calibration: std::vector names_Ecal(10, ""); std::vector> names(5, std::vector()); //(1x 4d 4x 1d) +std::vector vnames = {"hvertex_vx", "hvertex_vy"}; // https://alice-notes.web.cern.ch/system/files/notes/analysis/620/017-May-31-analysis_note-ALICE_analysis_note_v2.pdf std::vector ZDC_px = {-1.75, 1.75, -1.75, 1.75}; @@ -98,7 +99,7 @@ std::vector ZDC_py = {-1.75, -1.75, 1.75, 1.75}; double alphaZDC = 0.395; // step 0 tm 5 A&C -std::vector>> q(5, std::vector>(7, std::vector(4, 0.0))); // 5 iterations with 5 steps, each with 4 values +std::vector>> q(6, std::vector>(7, std::vector(4, 0.0))); // 5 iterations with 5 steps, each with 4 values // for energy calibration std::vector EZN(8); // uncalibrated energy for the 2x4 towers (a1, a2, a3, a4, c1, c2, c3, c4) @@ -108,6 +109,7 @@ std::vector e(8, 0.); // calibrated energies (a1, a2, a3, a4, c1, c2, // Define variables needed to do the recentring steps. double centrality = 0; int runnumber = 0; +int lastRunnumber = 0; std::vector v(3, 0); // vx, vy, vz bool isSelected = false; @@ -122,13 +124,12 @@ struct ZDCqvectors { ConfigurableAxis axisCent{"axisCent", {90, 0, 90}, "Centrality axis in 1% bins"}; ConfigurableAxis axisCent10{"axisCent10", {9, 0, 90}, "Centrality axis in 10% bins"}; ConfigurableAxis axisQ{"axisQ", {100, -2, 2}, "Q vector (xy) in ZDC"}; - ConfigurableAxis axisVx_big{"axisVx_big", {3, -0.006, -0.006}, "for Pos X of collision"}; - ConfigurableAxis axisVy_big{"axisVy_big", {3, -0.003, 0.003}, "for Pos Y of collision"}; + ConfigurableAxis axisVx_big{"axisVx_big", {3, -0.01, 0.01}, "for Pos X of collision"}; + ConfigurableAxis axisVy_big{"axisVy_big", {3, -0.01, 0.01}, "for Pos Y of collision"}; ConfigurableAxis axisVz_big{"axisVz_big", {3, -10, 10}, "for Pos Z of collision"}; - ConfigurableAxis axisVx{"axisVx", {10, -0.006, 0.006}, "for Pos X of collision"}; - ConfigurableAxis axisVy{"axisVy", {10, -0.003, 0.003}, "for Pos Y of collision"}; + ConfigurableAxis axisVx{"axisVx", {10, -0.01, 0.01}, "for Pos X of collision"}; + ConfigurableAxis axisVy{"axisVy", {10, -0.01, 0.01}, "for Pos Y of collision"}; ConfigurableAxis axisVz{"axisVz", {10, -10, 1}, "for vz of collision"}; - ConfigurableAxis axisRun{"axisRun", {1e6, 0, 1e6}, "for runNumber in ThnSparse"}; O2_DEFINE_CONFIGURABLE(cfgCutVertex, float, 10.0f, "Accepted z-vertex range") O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMin, float, 0.2f, "Minimal.q pT for poi tracks") @@ -140,10 +141,12 @@ struct ZDCqvectors { O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried") O2_DEFINE_CONFIGURABLE(cfgEnergyCal, std::string, "", "ccdb path for energy calibration histos") O2_DEFINE_CONFIGURABLE(cfgMeanv, std::string, "", "ccdb path for mean v histos") + Configurable> cfgRec1{"cfgRec1", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 1"}; Configurable> cfgRec2{"cfgRec2", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 2"}; Configurable> cfgRec3{"cfgRec3", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 3"}; Configurable> cfgRec4{"cfgRec4", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 4"}; + Configurable> cfgRec5{"cfgRec5", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 5"}; // Define output HistogramRegistry registry{"Registry"}; @@ -179,6 +182,8 @@ struct ZDCqvectors { // Qx_vs_Qy for each step for ZNA and ZNC for (int step = 0; step < 6; step++) { + registry.add(Form("step%i/QA/hSPplaneA", step), "hSPplaneA", kTH2D, {{100, -4, 4}, axisCent10}); + registry.add(Form("step%i/QA/hSPplaneC", step), "hSPplaneC", kTH2D, {{100, -4, 4}, axisCent10}); for (const char* side : sides) { hQx_vs_Qy[step] = registry.add(Form("step%i/hZN%s_Qx_vs_Qy", step, side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ}); } @@ -202,28 +207,28 @@ struct ZDCqvectors { if (step == 1 || step == 5) { TString name = TString::Format("hQ%s%s_mean_Cent_V_run", coord, side); - registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_Cent_V_run", coord, side), {HistType::kTHnSparseD, {axisRun, axisCent10, axisVx_big, axisVy_big, axisVz_big, axisQ}}); + registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_Cent_V_run", coord, side), {HistType::kTHnSparseD, {axisCent10, axisVx_big, axisVy_big, axisVz_big, axisQ}}); if (step == 1) names[step - 1].push_back(name); } if (step == 2) { - TString name = TString::Format("hQ%s%s_mean_1percent_run", coord, side); - registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_1percent_run", coord, side), kTProfile2D, {{1, 0., 1.}, axisCent}); + TString name = TString::Format("hQ%s%s_mean_cent_run", coord, side); + registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_cent_run", coord, side), kTProfile, {axisCent}); names[step - 1].push_back(name); } if (step == 3) { TString name = TString::Format("hQ%s%s_mean_vx_run", coord, side); - registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_vx_run", coord, side), kTProfile2D, {{1, 0., 1.}, axisVx}); + registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_vx_run", coord, side), kTProfile, {axisVx}); names[step - 1].push_back(name); } if (step == 4) { TString name = TString::Format("hQ%s%s_mean_vy_run", coord, side); - registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_vy_run", coord, side), kTProfile2D, {{1, 0., 1.}, axisVy}); + registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_vy_run", coord, side), kTProfile, {axisVy}); names[step - 1].push_back(name); } if (step == 5) { TString name = TString::Format("hQ%s%s_mean_vz_run", coord, side); - registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_vz_run", coord, side), kTProfile2D, {{1, 0., 1.}, axisVz}); + registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_vz_run", coord, side), kTProfile, {axisVz}); names[step - 1].push_back(name); } } // end of COORDS @@ -233,6 +238,13 @@ struct ZDCqvectors { // recentered q-vectors (to check what steps are finished in the end) registry.add("hStep", "hStep", {HistType::kTH1D, {{10, 0., 10.}}}); registry.add("hIteration", "hIteration", {HistType::kTH1D, {{10, 0., 10.}}}); + registry.add("vmean/hvertex_vx", "hvertex_vx", kTProfile, {{1, 0., 1.}}); + registry.add("vmean/hvertex_vy", "hvertex_vy", kTProfile, {{1, 0., 1.}}); + registry.add("QA/centrality_before", "centrality_before", kTH1D, {{200, 0, 100}}); + registry.add("QA/centrality_after", "centrality_after", kTH1D, {{200, 0, 100}}); + + registry.add("QA/ZNA_Energy", "ZNA_Energy", kTProfile, {{8, 0, 8}}); + registry.add("QA/ZNC_Energy", "ZNC_Energy", kTProfile, {{8, 0, 8}}); } inline void fillRegistry(int iteration, int step) @@ -248,42 +260,42 @@ struct ZDCqvectors { } if (step == 1) { - registry.get(HIST("step2/hQXA_mean_1percent_run"))->Fill(Form("%d", runnumber), centrality, q[iteration][step][0], 1); - registry.get(HIST("step2/hQYA_mean_1percent_run"))->Fill(Form("%d", runnumber), centrality, q[iteration][step][1], 1); - registry.get(HIST("step2/hQXC_mean_1percent_run"))->Fill(Form("%d", runnumber), centrality, q[iteration][step][2], 1); - registry.get(HIST("step2/hQYC_mean_1percent_run"))->Fill(Form("%d", runnumber), centrality, q[iteration][step][3], 1); + registry.get(HIST("step2/hQXA_mean_cent_run"))->Fill(centrality, q[iteration][step][0]); + registry.get(HIST("step2/hQYA_mean_cent_run"))->Fill(centrality, q[iteration][step][1]); + registry.get(HIST("step2/hQXC_mean_cent_run"))->Fill(centrality, q[iteration][step][2]); + registry.get(HIST("step2/hQYC_mean_cent_run"))->Fill(centrality, q[iteration][step][3]); registry.fill(HIST("hStep"), step, 1); } if (step == 2) { - registry.get(HIST("step3/hQXA_mean_vx_run"))->Fill(Form("%d", runnumber), v[0], q[iteration][step][0], 1); - registry.get(HIST("step3/hQYA_mean_vx_run"))->Fill(Form("%d", runnumber), v[0], q[iteration][step][1], 1); - registry.get(HIST("step3/hQXC_mean_vx_run"))->Fill(Form("%d", runnumber), v[0], q[iteration][step][2], 1); - registry.get(HIST("step3/hQYC_mean_vx_run"))->Fill(Form("%d", runnumber), v[0], q[iteration][step][3], 1); + registry.get(HIST("step3/hQXA_mean_vx_run"))->Fill(v[0], q[iteration][step][0]); + registry.get(HIST("step3/hQYA_mean_vx_run"))->Fill(v[0], q[iteration][step][1]); + registry.get(HIST("step3/hQXC_mean_vx_run"))->Fill(v[0], q[iteration][step][2]); + registry.get(HIST("step3/hQYC_mean_vx_run"))->Fill(v[0], q[iteration][step][3]); registry.fill(HIST("hStep"), step, 1); } if (step == 3) { - registry.get(HIST("step4/hQXA_mean_vy_run"))->Fill(Form("%d", runnumber), v[1], q[iteration][step][0], 1); - registry.get(HIST("step4/hQYA_mean_vy_run"))->Fill(Form("%d", runnumber), v[1], q[iteration][step][1], 1); - registry.get(HIST("step4/hQXC_mean_vy_run"))->Fill(Form("%d", runnumber), v[1], q[iteration][step][2], 1); - registry.get(HIST("step4/hQYC_mean_vy_run"))->Fill(Form("%d", runnumber), v[1], q[iteration][step][3], 1); + registry.get(HIST("step4/hQXA_mean_vy_run"))->Fill(v[1], q[iteration][step][0]); + registry.get(HIST("step4/hQYA_mean_vy_run"))->Fill(v[1], q[iteration][step][1]); + registry.get(HIST("step4/hQXC_mean_vy_run"))->Fill(v[1], q[iteration][step][2]); + registry.get(HIST("step4/hQYC_mean_vy_run"))->Fill(v[1], q[iteration][step][3]); registry.fill(HIST("hStep"), step, 1); } if (step == 4) { - registry.get(HIST("step5/hQXA_mean_vz_run"))->Fill(Form("%d", runnumber), v[2], q[iteration][step][0], 1); - registry.get(HIST("step5/hQYA_mean_vz_run"))->Fill(Form("%d", runnumber), v[2], q[iteration][step][1], 1); - registry.get(HIST("step5/hQXC_mean_vz_run"))->Fill(Form("%d", runnumber), v[2], q[iteration][step][2], 1); - registry.get(HIST("step5/hQYC_mean_vz_run"))->Fill(Form("%d", runnumber), v[2], q[iteration][step][3], 1); + registry.get(HIST("step5/hQXA_mean_vz_run"))->Fill(v[2], q[iteration][step][0]); + registry.get(HIST("step5/hQYA_mean_vz_run"))->Fill(v[2], q[iteration][step][1]); + registry.get(HIST("step5/hQXC_mean_vz_run"))->Fill(v[2], q[iteration][step][2]); + registry.get(HIST("step5/hQYC_mean_vz_run"))->Fill(v[2], q[iteration][step][3]); registry.fill(HIST("hStep"), step, 1); } if (step == 5) { - registry.fill(HIST("step5/hQXA_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[iteration][step][0]); - registry.fill(HIST("step5/hQYA_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[iteration][step][1]); - registry.fill(HIST("step5/hQXC_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[iteration][step][2]); - registry.fill(HIST("step5/hQYC_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[iteration][step][3]); + registry.fill(HIST("step5/hQXA_mean_Cent_V_run"), centrality, v[0], v[1], v[2], q[iteration][step][0]); + registry.fill(HIST("step5/hQYA_mean_Cent_V_run"), centrality, v[0], v[1], v[2], q[iteration][step][1]); + registry.fill(HIST("step5/hQXC_mean_Cent_V_run"), centrality, v[0], v[1], v[2], q[iteration][step][2]); + registry.fill(HIST("step5/hQYC_mean_Cent_V_run"), centrality, v[0], v[1], v[2], q[iteration][step][3]); registry.fill(HIST("hStep"), step, 1); } } @@ -353,6 +365,13 @@ struct ZDCqvectors { registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_vz"), v[2], q[iteration][index_rt][1]); registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_vz"), v[2], q[iteration][index_rt][2]); registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_vz"), v[2], q[iteration][index_rt][3]); + + // add psi!! + double Psi_A = 1.0 * TMath::ATan2(q[iteration][index_rt][2], q[iteration][index_rt][0]); + registry.fill(HIST(subdir[index]) + HIST("QA/hSPplaneA"), Psi_A, centrality, 1); + double Psi_C = 1.0 * TMath::ATan2(q[iteration][index_rt][3], q[iteration][index_rt][1]); + registry.fill(HIST(subdir[index]) + HIST("QA/hSPplaneC"), Psi_C, centrality, 1); + }); } @@ -434,27 +453,32 @@ struct ZDCqvectors { } if (hist->InheritsFrom("TProfile2D")) { - if (counter < 1) - LOGF(info, "correction is TProfile2D %s for q[%i][%i]", objName, iteration, step); + // needed for energy calibration! TProfile2D* h = reinterpret_cast(hist); + TString name = h->GetName(); int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); - int bincentrality = h->GetYaxis()->FindBin(centrality); - calibConstant = h->GetBinContent(binrunnumber, bincentrality); + int bin = h->GetYaxis()->FindBin(centrality); + calibConstant = h->GetBinContent(binrunnumber, bin); + } else if (hist->InheritsFrom("TProfile")) { - if (counter < 1) - LOGF(info, "correction is TProfile %s for q[%i][%i]", objName, iteration, step); TProfile* h = reinterpret_cast(hist); - int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); - calibConstant = h->GetBinContent(binrunnumber); + TString name = h->GetName(); + int bin; + if (name.Contains("mean_vx")) + bin = h->GetXaxis()->FindBin(v[0]); + if (name.Contains("mean_vy")) + bin = h->GetXaxis()->FindBin(v[1]); + if (name.Contains("mean_vz")) + bin = h->GetXaxis()->FindBin(v[2]); + if (name.Contains("mean_cent")) + bin = h->GetXaxis()->FindBin(centrality); + if (name.Contains("vertex")) + bin = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); + calibConstant = h->GetBinContent(bin); } else if (hist->InheritsFrom("THnSparse")) { - if (counter < 1) - LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration, step); std::vector sparsePars; - if (counter < 1) - LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration, step); THnSparseD* h = reinterpret_cast(hist); if (step == 0 && iteration > 0) { - sparsePars.push_back(h->GetAxis(0)->FindBin(runnumber)); sparsePars.push_back(h->GetAxis(1)->FindBin(centrality)); sparsePars.push_back(h->GetAxis(2)->FindBin(v[0])); sparsePars.push_back(h->GetAxis(3)->FindBin(v[1])); @@ -493,14 +517,18 @@ struct ZDCqvectors { auto cent = collision.centFT0C(); if (cent < 0 || cent > 90) { - SPtableZDC(0, 0, 0, 0, 0, 0, 0, 0, 0, false, 0, 0); + SPtableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + lastRunnumber = runnumber; return; } + registry.fill(HIST("QA/centrality_before"), cent); + const auto& foundBC = collision.foundBC_as(); if (!foundBC.has_zdc()) { - SPtableZDC(0, 0, 0, 0, 0, 0, 0, 0, 0, false, 0, 0); + SPtableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + lastRunnumber = runnumber; return; } @@ -518,12 +546,22 @@ struct ZDCqvectors { } // load the calibration histos for iteration 0 step 0 (Energy Calibration) - loadCalibrations(0, 0, foundBC.timestamp(), cfgEnergyCal, names_Ecal); + if (runnumber != lastRunnumber) + loadCalibrations(0, 0, foundBC.timestamp(), cfgEnergyCal, names_Ecal); if (!cal.calibfilesLoaded[0][0]) { if (counter < 1) { LOGF(info, " --> No Energy calibration files found.. -> Only Energy calibration will be done. "); } } + // load the calibrations for the mean v + if (runnumber != lastRunnumber) + loadCalibrations(0, 1, foundBC.timestamp(), cfgMeanv, vnames); + if (!cal.calibfilesLoaded[0][1]) { + if (counter < 1) + LOGF(warning, " --> No mean V found.. -> THis wil lead to wrong axis for vx, vy (will be created in vmean/)"); + registry.get(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]); + registry.get(HIST("vmean/hvertex_vy"))->Fill(Form("%d", runnumber), v[1]); + } if (counter < 1) LOGF(info, "=====================> .....Start Energy Calibration..... <====================="); @@ -563,13 +601,15 @@ struct ZDCqvectors { // if ZNA or ZNC not hit correctly.. do not use event in q-vector calculation if (!isZNAhit || !isZNChit) { counter++; - SPtableZDC(0, 0, 0, 0, 0, 0, 0, 0, 0, false, 0, 0); + SPtableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + lastRunnumber = runnumber; return; } if (!cal.calibfilesLoaded[0][0]) { counter++; - SPtableZDC(0, 0, 0, 0, 0, 0, 0, 0, 0, false, 0, 0); + SPtableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + lastRunnumber = runnumber; return; } @@ -598,6 +638,14 @@ struct ZDCqvectors { calibtower++; } + for (int i = 0; i < 4; i++) { + float bincenter = i + .5; + registry.fill(HIST("QA/ZNA_Energy"), bincenter, EZN[i]); + registry.fill(HIST("QA/ZNA_Energy"), bincenter + 4, e[i]); + registry.fill(HIST("QA/ZNC_Energy"), bincenter, EZN[i + 4]); + registry.fill(HIST("QA/ZNC_Energy"), bincenter + 4, e[i + 4]); + } + // Now calculate Q-vector for (int tower = 0; tower < 8; tower++) { int side = (tower > 3) ? 1 : 0; @@ -616,19 +664,30 @@ struct ZDCqvectors { } } - for (int iteration = 1; iteration < 5; iteration++) { - std::vector ccdb_dirs; - if (iteration == 1) - ccdb_dirs = cfgRec1.value; - if (iteration == 2) - ccdb_dirs = cfgRec2.value; - if (iteration == 3) - ccdb_dirs = cfgRec3.value; - if (iteration == 4) - ccdb_dirs = cfgRec4.value; - - for (int step = 0; step < 5; step++) { - loadCalibrations(iteration, step, foundBC.timestamp(), (ccdb_dirs)[step], names[step]); + if (cal.calibfilesLoaded[0][1]) { + if (counter < 1) + LOGF(info, "=====================> Setting v to vmean!"); + v[0] = v[0] - getCorrection(0, 1, vnames[0].Data()); + v[1] = v[1] - getCorrection(0, 1, vnames[1].Data()); + } + + if (runnumber != lastRunnumber) { + for (int iteration = 1; iteration < 6; iteration++) { + std::vector ccdb_dirs; + if (iteration == 1) + ccdb_dirs = cfgRec1.value; + if (iteration == 2) + ccdb_dirs = cfgRec2.value; + if (iteration == 3) + ccdb_dirs = cfgRec3.value; + if (iteration == 4) + ccdb_dirs = cfgRec4.value; + if (iteration == 5) + ccdb_dirs = cfgRec5.value; + + for (int step = 0; step < 5; step++) { + loadCalibrations(iteration, step, foundBC.timestamp(), (ccdb_dirs)[step], names[step]); + } } } @@ -637,6 +696,7 @@ struct ZDCqvectors { LOGF(warning, "Calibation files missing!!! Output created with q-vectors right after energy gain eq. !!"); fillAllRegistries(0, 0); SPtableZDC(runnumber, centrality, v[0], v[1], v[2], q[0][0][0], q[0][0][1], q[0][0][2], q[0][0][3], true, 0, 0); + lastRunnumber = runnumber; counter++; return; } else { @@ -651,7 +711,7 @@ struct ZDCqvectors { q[iteration][step + 1][i] = q[iteration - 1][5][i] - getCorrection(iteration, step, names[step][i].Data()); } } else { - q[iteration][step + 1][i] = q[iteration][step][i] - getCorrection(iteration, step, names[step][i].Data()); + q[iteration][step + 1][i] = q[iteration][step][i] - getCorrection(iteration, step, names[step][i].Data()); } } } else { @@ -662,9 +722,11 @@ struct ZDCqvectors { } // end of iteration if (counter < 1) - LOGF(warning, "Calibation files missing!!! Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep + 1); + LOGF(info, "Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep + 1); fillAllRegistries(cal.atIteration, cal.atStep + 1); + registry.fill(HIST("QA/centrality_after"), centrality); SPtableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], true, cal.atIteration, cal.atStep); + lastRunnumber = runnumber; counter++; return; } From 984e374c89f4f84bdcffc6fb0913b277dfe809ab Mon Sep 17 00:00:00 2001 From: yuanzhe <90246048+wang-yuanzhe@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:56:37 +0100 Subject: [PATCH 038/459] [PWGLF] Add event-mixing for analysis of 3body decay (#8544) --- PWGLF/DataModel/pidTOFGeneric.h | 156 +++---- .../Nuspex/decay3bodybuilder.cxx | 385 +++++++++++++----- .../Nuspex/threebodyRecoTask.cxx | 4 + PWGLF/Tasks/Nuspex/hypertriton3bodyMCQA.cxx | 5 +- 4 files changed, 383 insertions(+), 167 deletions(-) diff --git a/PWGLF/DataModel/pidTOFGeneric.h b/PWGLF/DataModel/pidTOFGeneric.h index 2c1c9960a21..b43d4ecc9ff 100644 --- a/PWGLF/DataModel/pidTOFGeneric.h +++ b/PWGLF/DataModel/pidTOFGeneric.h @@ -51,7 +51,7 @@ namespace pidtofgeneric static constexpr float kCSPEED = TMath::C() * 1.0e2f * 1.0e-12f; // c in cm/ps -template +template class TofPidNewCollision { public: @@ -83,85 +83,95 @@ class TofPidNewCollision pidType = pidId; } - float GetTOFNSigma(o2::track::PID::ID pidId, TTrack const& track, TCollision const& originalcol, TCollision const& correctedcol, bool EnableBCAO2D = true) - { - float mMassHyp = o2::track::pid_constants::sMasses2Z[track.pidForTracking()]; - float expTime = track.length() * sqrt((mMassHyp * mMassHyp) + (track.tofExpMom() * track.tofExpMom())) / (kCSPEED * track.tofExpMom()); // L*E/(p*c) = L/v + template + float GetTOFNSigma(o2::track::PID::ID pidId, TTrack const& track, TCollision const& originalcol, TCollision const& correctedcol, bool EnableBCAO2D = true); - float evTime = correctedcol.evTime(); - float evTimeErr = correctedcol.evTimeErr(); - float tofsignal = track.trackTime() * 1000 + expTime; // in ps - float expSigma, tofNsigma; + template + float GetTOFNSigma(TTrack const& track, TCollision const& originalcol, TCollision const& correctedcol, bool EnableBCAO2D = true); +}; - if (originalcol.globalIndex() == correctedcol.globalIndex()) { - evTime = track.evTimeForTrack(); - evTimeErr = track.evTimeErrForTrack(); +template +template +float TofPidNewCollision::GetTOFNSigma(o2::track::PID::ID pidId, TTrack const& track, TCollision const& originalcol, TCollision const& correctedcol, bool EnableBCAO2D) +{ + float mMassHyp = o2::track::pid_constants::sMasses2Z[track.pidForTracking()]; + float expTime = track.length() * sqrt((mMassHyp * mMassHyp) + (track.tofExpMom() * track.tofExpMom())) / (kCSPEED * track.tofExpMom()); // L*E/(p*c) = L/v + + float evTime = correctedcol.evTime(); + float evTimeErr = correctedcol.evTimeErr(); + float tofsignal = track.trackTime() * 1000 + expTime; // in ps + float expSigma, tofNsigma; + + if (originalcol.globalIndex() == correctedcol.globalIndex()) { + evTime = track.evTimeForTrack(); + evTimeErr = track.evTimeErrForTrack(); + } else { + if (EnableBCAO2D) { + auto originalbc = originalcol.template bc_as(); + auto correctedbc = correctedcol.template bc_as(); + o2::InteractionRecord originalIR = o2::InteractionRecord::long2IR(originalbc.globalBC()); + o2::InteractionRecord correctedIR = o2::InteractionRecord::long2IR(correctedbc.globalBC()); + tofsignal += originalIR.differenceInBCNS(correctedIR) * 1000; } else { - if (EnableBCAO2D) { - auto originalbc = originalcol.template bc_as(); - auto correctedbc = correctedcol.template bc_as(); - o2::InteractionRecord originalIR = o2::InteractionRecord::long2IR(originalbc.globalBC()); - o2::InteractionRecord correctedIR = o2::InteractionRecord::long2IR(correctedbc.globalBC()); - tofsignal += originalIR.differenceInBCNS(correctedIR) * 1000; - } else { - auto originalbc = originalcol.template foundBC_as(); - auto correctedbc = correctedcol.template foundBC_as(); - o2::InteractionRecord originalIR = o2::InteractionRecord::long2IR(originalbc.globalBC()); - o2::InteractionRecord correctedIR = o2::InteractionRecord::long2IR(correctedbc.globalBC()); - tofsignal += originalIR.differenceInBCNS(correctedIR) * 1000; - } + auto originalbc = originalcol.template foundBC_as(); + auto correctedbc = correctedcol.template foundBC_as(); + o2::InteractionRecord originalIR = o2::InteractionRecord::long2IR(originalbc.globalBC()); + o2::InteractionRecord correctedIR = o2::InteractionRecord::long2IR(correctedbc.globalBC()); + tofsignal += originalIR.differenceInBCNS(correctedIR) * 1000; } - - switch (pidId) { - case 0: - expSigma = responseEl.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); - tofNsigma = (tofsignal - evTime - responseEl.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; - break; - case 1: - expSigma = responseMu.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); - tofNsigma = (tofsignal - evTime - responseMu.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; - break; - case 2: - expSigma = responsePi.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); - tofNsigma = (tofsignal - evTime - responsePi.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; - break; - case 3: - expSigma = responseKa.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); - tofNsigma = (tofsignal - evTime - responseKa.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; - break; - case 4: - expSigma = responsePr.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); - tofNsigma = (tofsignal - evTime - responsePr.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; - break; - case 5: - expSigma = responseDe.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); - tofNsigma = (tofsignal - evTime - responseDe.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; - break; - case 6: - expSigma = responseTr.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); - tofNsigma = (tofsignal - evTime - responseTr.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; - break; - case 7: - expSigma = responseHe.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); - tofNsigma = (tofsignal - evTime - responseHe.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; - break; - case 8: - expSigma = responseAl.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); - tofNsigma = (tofsignal - evTime - responseAl.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; - break; - default: - LOG(fatal) << "Wrong particle ID in TofPidSecondary class"; - return -999; - } - - return tofNsigma; } - float GetTOFNSigma(TTrack const& track, TCollision const& originalcol, TCollision const& correctedcol, bool EnableBCAO2D = true) - { - return GetTOFNSigma(pidType, track, originalcol, correctedcol, EnableBCAO2D); + switch (pidId) { + case 0: + expSigma = responseEl.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); + tofNsigma = (tofsignal - evTime - responseEl.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; + break; + case 1: + expSigma = responseMu.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); + tofNsigma = (tofsignal - evTime - responseMu.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; + break; + case 2: + expSigma = responsePi.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); + tofNsigma = (tofsignal - evTime - responsePi.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; + break; + case 3: + expSigma = responseKa.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); + tofNsigma = (tofsignal - evTime - responseKa.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; + break; + case 4: + expSigma = responsePr.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); + tofNsigma = (tofsignal - evTime - responsePr.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; + break; + case 5: + expSigma = responseDe.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); + tofNsigma = (tofsignal - evTime - responseDe.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; + break; + case 6: + expSigma = responseTr.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); + tofNsigma = (tofsignal - evTime - responseTr.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; + break; + case 7: + expSigma = responseHe.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); + tofNsigma = (tofsignal - evTime - responseHe.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; + break; + case 8: + expSigma = responseAl.GetExpectedSigma(mRespParamsV2, track, tofsignal, evTimeErr); + tofNsigma = (tofsignal - evTime - responseAl.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma; + break; + default: + LOG(fatal) << "Wrong particle ID in TofPidSecondary class"; + return -999; } -}; + + return tofNsigma; +} + +template +template +float TofPidNewCollision::GetTOFNSigma(TTrack const& track, TCollision const& originalcol, TCollision const& correctedcol, bool EnableBCAO2D) +{ + return GetTOFNSigma(pidType, track, originalcol, correctedcol, EnableBCAO2D); +} } // namespace pidtofgeneric } // namespace o2::aod diff --git a/PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx b/PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx index 27c3969d7b8..8bcbc20c98a 100644 --- a/PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx +++ b/PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx @@ -18,6 +18,7 @@ #include #include #include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -66,11 +67,28 @@ using FullTracksExtIU = soa::Join; using ColwithEvTimes = o2::soa::Join; +using FullCols = o2::soa::Join; using TrackExtIUwithEvTimes = soa::Join; using TrackExtPIDIUwithEvTimes = soa::Join; using MCLabeledTracksIU = soa::Join; +struct vtxCandidate { + int track0Id; + int track1Id; + int track2Id; + int collisionId; + int decay3bodyId; + float vtxPos[3]; + float track0P[3]; + float track1P[3]; + float track2P[3]; + float dcadaughters; + float daudcaxytopv[3]; // 0 - proton, 1 - pion, 2 - bachelor + float daudcatopv[3]; // 0 - proton, 1 - pion, 2 - bachelor + float bachelortofNsigma; +}; + struct decay3bodyBuilder { Produces vtx3bodydata; @@ -78,6 +96,7 @@ struct decay3bodyBuilder { Produces kfvtx3bodydatalite; Service ccdb; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; + std::vector vtxCandidates; // Configurables Configurable d_UseAbsDCA{"d_UseAbsDCA", true, "Use Abs DCAs"}; @@ -123,9 +142,10 @@ struct decay3bodyBuilder { HistogramRegistry registry{"registry", {}}; // hypothesis - Configurable motherhyp{"motherhyp", 0, "hypothesis of the 3body decayed particle"}; // corresponds to hyp3body - int bachelorcharge = 1; // to be updated in Init base on the hypothesis - o2::aod::pidtofgeneric::TofPidNewCollision bachelorTOFPID; // to be updated in Init base on the hypothesis + Configurable motherhyp{"motherhyp", 0, "hypothesis of the 3body decayed particle"}; // corresponds to hyp3body + int bachelorcharge = 1; // to be updated in Init base on the hypothesis + // o2::aod::pidtofgeneric::TofPidNewCollision bachelorTOFPID; // to be updated in Init base on the hypothesis + o2::aod::pidtofgeneric::TofPidNewCollision bachelorTOFPID; // to be updated in Init base on the hypothesis // Selection criteria Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; @@ -197,6 +217,30 @@ struct decay3bodyBuilder { Configurable maxChi2topo{"kfparticleConfigurations.maxChi2topo", 1000., "Maximum chi2 topological with KFParticle"}; } kfparticleConfigurations; + //------------------------------------------------------------------ + // Sets for event mixing + struct : ConfigurableGroup { + Configurable nUseMixedEvent{"nUseMixedEvent", 5, "nUseMixedEvent"}; + Configurable em_event_sel8_selection{"em_event_sel8_selection", true, "event selection count post sel8 cut"}; + Configurable etacut{"etacut", 0.9, "etacut"}; + Configurable minProtonPt{"minProtonPt", 0.3, "minProtonPt"}; + Configurable maxProtonPt{"maxProtonPt", 5, "maxProtonPt"}; + Configurable minPionPt{"minPionPt", 0.1, "minPionPt"}; + Configurable maxPionPt{"maxPionPt", 1.2, "maxPionPt"}; + Configurable minDeuteronPt{"minDeuteronPt", 0.6, "minDeuteronPt"}; + Configurable maxDeuteronPt{"maxDeuteronPt", 10, "maxDeuteronPt"}; + Configurable mintpcNClsproton{"mintpcNClsproton", 90, "min tpc Nclusters for proton"}; + Configurable mintpcNClspion{"mintpcNClspion", 70, "min tpc Nclusters for pion"}; + Configurable mintpcNClsbachelor{"mintpcNClsbachelor", 100, "min tpc Nclusters for bachelor"}; + Configurable emTpcPidNsigmaCut{"emTpcPidNsigmaCut", 5, "emTpcPidNsigmaCut"}; + } EMTrackSel; + + Preslice tracksperCol = aod::track::collisionId; + SliceCache cache; + ConfigurableAxis axisPosZ{"axisPosZ", {40, -10, 10}, "Mixing bins - posZ"}; + ConfigurableAxis axisCentrality{"axisCentrality", {10, 0, 100}, "Mixing bins - centrality"}; + using BinningType = ColumnBinningPolicy; + // Filters and slices // Filter collisionFilter = (aod::evsel::sel8 == true && nabs(aod::collision::posZ) < 10.f); Preslice perCollision = o2::aod::decay3body::collisionId; @@ -273,7 +317,7 @@ struct decay3bodyBuilder { fitter3body.setMatCorrType(matCorr); // Add histograms separately for different process functions - if (doprocessRun3 == true) { + if (doprocessRun3 == true || doprocessRun3EM == true || doprocessRun3EMLikeSign == true) { registry.add("hEventCounter", "hEventCounter", HistType::kTH1F, {{1, 0.0f, 1.0f}}); auto hVtx3BodyCounter = registry.add("hVtx3BodyCounter", "hVtx3BodyCounter", HistType::kTH1F, {{6, 0.0f, 6.0f}}); hVtx3BodyCounter->GetXaxis()->SetBinLabel(1, "Total"); @@ -512,110 +556,139 @@ struct decay3bodyBuilder { //------------------------------------------------------------------ // 3body candidate builder - template - // void buildVtx3BodyDataTable(TCollisionTable const& /*allcollisions*/, TCollisionTable::iterator const& collision, TTrackTable const& /*tracks*/, aod::Decay3Bodys const& decay3bodys, int bachelorcharge = 1) - void buildVtx3BodyDataTable(TCollisionTable const& collision, TTrackTable const& /*tracks*/, aod::Decay3Bodys const& decay3bodys, int bachelorcharge = 1) + template + void fillVtxCand(TCollisionTable const& collision, TTrackTable const& t0, TTrackTable const& t1, TTrackTable const& t2, int64_t decay3bodyId, int bachelorcharge = 1) { - for (auto& vtx3body : decay3bodys) { - - registry.fill(HIST("hVtx3BodyCounter"), kVtxAll); - - auto t0 = vtx3body.template track0_as(); - auto t1 = vtx3body.template track1_as(); - auto t2 = vtx3body.template track2_as(); - - if (t0.tpcNClsFound() < mintpcNCls || t1.tpcNClsFound() < mintpcNCls || t2.tpcNClsFound() < mintpcNCls) { - continue; - } - registry.fill(HIST("hVtx3BodyCounter"), kVtxTPCNcls); + registry.fill(HIST("hVtx3BodyCounter"), kVtxAll); - // Recalculate the TOF PID - double tofNSigmaBach = -999; - if (t2.has_collision() && t2.hasTOF()) { + if (t0.tpcNClsFound() < mintpcNCls || t1.tpcNClsFound() < mintpcNCls || t2.tpcNClsFound() < mintpcNCls) { + return; + } + registry.fill(HIST("hVtx3BodyCounter"), kVtxTPCNcls); + + // Recalculate the TOF PID + double tofNSigmaBach = -999; + if (t2.has_collision() && t2.hasTOF()) { + if (decay3bodyId == -1) { + // for event-mixing, the collisionId of tracks not equal to global index + tofNSigmaBach = bachelorTOFPID.GetTOFNSigma(t2, collision, collision); + } else { auto originalcol = t2.template collision_as(); tofNSigmaBach = bachelorTOFPID.GetTOFNSigma(t2, originalcol, collision); } + } - if (enablePidCut) { - if (t2.sign() > 0) { - if (!checkPIDH3L(t0, t1, t2, tofNSigmaBach)) - continue; - } else { - if (!checkPIDH3L(t1, t0, t2, tofNSigmaBach)) - continue; - } + if (enablePidCut) { + if (t2.sign() > 0) { + if (!checkPIDH3L(t0, t1, t2, tofNSigmaBach)) + return; + } else { + if (!checkPIDH3L(t1, t0, t2, tofNSigmaBach)) + return; } + } - registry.fill(HIST("hVtx3BodyCounter"), kVtxPIDCut); + registry.fill(HIST("hVtx3BodyCounter"), kVtxPIDCut); - // Calculate DCA with respect to the collision associated to the V0, not individual tracks - gpu::gpustd::array dcaInfo; + // Calculate DCA with respect to the collision associated to the V0, not individual tracks + gpu::gpustd::array dcaInfo; - auto Track0Par = getTrackPar(t0); - o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, Track0Par, 2.f, fitter3body.getMatCorrType(), &dcaInfo); - auto Track0dcaXY = dcaInfo[0]; - auto Track0dca = std::sqrt(Track0dcaXY * Track0dcaXY + dcaInfo[1] * dcaInfo[1]); + auto Track0Par = getTrackPar(t0); + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, Track0Par, 2.f, fitter3body.getMatCorrType(), &dcaInfo); + auto Track0dcaXY = dcaInfo[0]; + auto Track0dca = std::sqrt(Track0dcaXY * Track0dcaXY + dcaInfo[1] * dcaInfo[1]); - auto Track1Par = getTrackPar(t1); - o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, Track1Par, 2.f, fitter3body.getMatCorrType(), &dcaInfo); - auto Track1dcaXY = dcaInfo[0]; - auto Track1dca = std::sqrt(Track1dcaXY * Track1dcaXY + dcaInfo[1] * dcaInfo[1]); + auto Track1Par = getTrackPar(t1); + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, Track1Par, 2.f, fitter3body.getMatCorrType(), &dcaInfo); + auto Track1dcaXY = dcaInfo[0]; + auto Track1dca = std::sqrt(Track1dcaXY * Track1dcaXY + dcaInfo[1] * dcaInfo[1]); - auto Track2Par = getTrackPar(t2); - o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, Track2Par, 2.f, fitter3body.getMatCorrType(), &dcaInfo); - auto Track2dcaXY = dcaInfo[0]; - auto Track2dca = std::sqrt(Track2dcaXY * Track2dcaXY + dcaInfo[1] * dcaInfo[1]); + auto Track2Par = getTrackPar(t2); + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, Track2Par, 2.f, fitter3body.getMatCorrType(), &dcaInfo); + auto Track2dcaXY = dcaInfo[0]; + auto Track2dca = std::sqrt(Track2dcaXY * Track2dcaXY + dcaInfo[1] * dcaInfo[1]); - auto Track0 = getTrackParCov(t0); - auto Track1 = getTrackParCov(t1); - auto Track2 = getTrackParCov(t2); - int n3bodyVtx = fitter3body.process(Track0, Track1, Track2); - if (n3bodyVtx == 0) { // discard this pair - continue; - } - registry.fill(HIST("hVtx3BodyCounter"), kVtxhasSV); + auto Track0 = getTrackParCov(t0); + auto Track1 = getTrackParCov(t1); + auto Track2 = getTrackParCov(t2); + int n3bodyVtx = fitter3body.process(Track0, Track1, Track2); + if (n3bodyVtx == 0) { // discard this pair + return; + } + registry.fill(HIST("hVtx3BodyCounter"), kVtxhasSV); - std::array pos = {0.}; - const auto& vtxXYZ = fitter3body.getPCACandidate(); - for (int i = 0; i < 3; i++) { - pos[i] = vtxXYZ[i]; - } + std::array pos = {0.}; + const auto& vtxXYZ = fitter3body.getPCACandidate(); + for (int i = 0; i < 3; i++) { + pos[i] = vtxXYZ[i]; + } - std::array p0 = {0.}, p1 = {0.}, p2{0.}; - const auto& propagatedTrack0 = fitter3body.getTrack(0); - const auto& propagatedTrack1 = fitter3body.getTrack(1); - const auto& propagatedTrack2 = fitter3body.getTrack(2); - propagatedTrack0.getPxPyPzGlo(p0); - propagatedTrack1.getPxPyPzGlo(p1); - propagatedTrack2.getPxPyPzGlo(p2); - for (int i = 0; i < 3; i++) { - p2[i] *= bachelorcharge; - } - std::array p3B = {p0[0] + p1[0] + p2[0], p0[1] + p1[1] + p2[1], p0[2] + p1[2] + p2[2]}; + std::array p0 = {0.}, p1 = {0.}, p2{0.}; + const auto& propagatedTrack0 = fitter3body.getTrack(0); + const auto& propagatedTrack1 = fitter3body.getTrack(1); + const auto& propagatedTrack2 = fitter3body.getTrack(2); + propagatedTrack0.getPxPyPzGlo(p0); + propagatedTrack1.getPxPyPzGlo(p1); + propagatedTrack2.getPxPyPzGlo(p2); + for (int i = 0; i < 3; i++) { + p2[i] *= bachelorcharge; + } + std::array p3B = {p0[0] + p1[0] + p2[0], p0[1] + p1[1] + p2[1], p0[2] + p1[2] + p2[2]}; - if (fitter3body.getChi2AtPCACandidate() > dcavtxdau) { - continue; - } - registry.fill(HIST("hVtx3BodyCounter"), kVtxDcaDau); + if (fitter3body.getChi2AtPCACandidate() > dcavtxdau) { + return; + } + registry.fill(HIST("hVtx3BodyCounter"), kVtxDcaDau); - float VtxcosPA = RecoDecay::cpa(array{collision.posX(), collision.posY(), collision.posZ()}, array{pos[0], pos[1], pos[2]}, array{p3B[0], p3B[1], p3B[2]}); - if (VtxcosPA < minCosPA3body) { - continue; - } - registry.fill(HIST("hVtx3BodyCounter"), kVtxCosPA); - - registry.fill(HIST("hBachelorTOFNSigmaDe"), t2.sign() * t2.p(), tofNSigmaBach); - - vtx3bodydata( - t0.globalIndex(), t1.globalIndex(), t2.globalIndex(), collision.globalIndex(), vtx3body.globalIndex(), - pos[0], pos[1], pos[2], - p0[0], p0[1], p0[2], p1[0], p1[1], p1[2], p2[0], p2[1], p2[2], - fitter3body.getChi2AtPCACandidate(), - Track0dcaXY, Track1dcaXY, Track2dcaXY, - Track0dca, Track1dca, Track2dca, - tofNSigmaBach); + float VtxcosPA = RecoDecay::cpa(array{collision.posX(), collision.posY(), collision.posZ()}, array{pos[0], pos[1], pos[2]}, array{p3B[0], p3B[1], p3B[2]}); + if (VtxcosPA < minCosPA3body) { + return; } + registry.fill(HIST("hVtx3BodyCounter"), kVtxCosPA); + + registry.fill(HIST("hBachelorTOFNSigmaDe"), t2.sign() * t2.p(), tofNSigmaBach); + + vtxCandidate candVtx; + candVtx.track0Id = t0.globalIndex(); + candVtx.track1Id = t1.globalIndex(); + candVtx.track2Id = t2.globalIndex(); + candVtx.collisionId = collision.globalIndex(); + candVtx.decay3bodyId = decay3bodyId; + candVtx.vtxPos[0] = pos[0]; + candVtx.vtxPos[1] = pos[1]; + candVtx.vtxPos[2] = pos[2]; + candVtx.track0P[0] = p0[0]; + candVtx.track0P[1] = p0[1]; + candVtx.track0P[2] = p0[2]; + candVtx.track1P[0] = p1[0]; + candVtx.track1P[1] = p1[1]; + candVtx.track1P[2] = p1[2]; + candVtx.track2P[0] = p2[0]; + candVtx.track2P[1] = p2[1]; + candVtx.track2P[2] = p2[2]; + candVtx.dcadaughters = fitter3body.getChi2AtPCACandidate(); + candVtx.daudcaxytopv[0] = Track0dcaXY; + candVtx.daudcaxytopv[1] = Track1dcaXY; + candVtx.daudcaxytopv[2] = Track2dcaXY; + candVtx.daudcatopv[0] = Track0dca; + candVtx.daudcatopv[1] = Track1dca; + candVtx.daudcatopv[2] = Track2dca; + candVtx.bachelortofNsigma = tofNSigmaBach; + vtxCandidates.push_back(candVtx); + } + //------------------------------------------------------------------ + // fill the StoredVtx3BodyDatas table + void fillVtx3BodyTable(vtxCandidate const& candVtx) + { + vtx3bodydata( + candVtx.track0Id, candVtx.track1Id, candVtx.track2Id, candVtx.collisionId, candVtx.decay3bodyId, + candVtx.vtxPos[0], candVtx.vtxPos[1], candVtx.vtxPos[2], + candVtx.track0P[0], candVtx.track0P[1], candVtx.track0P[2], candVtx.track1P[0], candVtx.track1P[1], candVtx.track1P[2], candVtx.track2P[0], candVtx.track2P[1], candVtx.track2P[2], + candVtx.dcadaughters, + candVtx.daudcaxytopv[0], candVtx.daudcaxytopv[1], candVtx.daudcaxytopv[2], + candVtx.daudcatopv[0], candVtx.daudcatopv[1], candVtx.daudcatopv[2], + candVtx.bachelortofNsigma); } //------------------------------------------------------------------ @@ -1110,20 +1183,143 @@ struct decay3bodyBuilder { } //------------------------------------------------------------------ - void processRun3(ColwithEvTimes const& collisions, TrackExtPIDIUwithEvTimes const& tracksIU, aod::Decay3Bodys const& decay3bodys, aod::BCsWithTimestamps const&) + void processRun3(ColwithEvTimes const& collisions, TrackExtPIDIUwithEvTimes const& /*tracksIU*/, aod::Decay3Bodys const& decay3bodys, aod::BCsWithTimestamps const&) { + vtxCandidates.clear(); + for (const auto& collision : collisions) { auto bc = collision.bc_as(); initCCDB(bc); registry.fill(HIST("hEventCounter"), 0.5); const auto& d3bodysInCollision = decay3bodys.sliceBy(perCollision, collision.globalIndex()); - // buildVtx3BodyDataTable(collisions, collision, tracksIU, d3bodysInCollision, bachelorcharge); - buildVtx3BodyDataTable(collision, tracksIU, d3bodysInCollision, bachelorcharge); + for (auto& d3body : d3bodysInCollision) { + auto t0 = d3body.template track0_as(); + auto t1 = d3body.template track1_as(); + auto t2 = d3body.template track2_as(); + fillVtxCand(collision, t0, t1, t2, d3body.globalIndex(), bachelorcharge); + } + } + + for (auto& candVtx : vtxCandidates) { + fillVtx3BodyTable(candVtx); } } PROCESS_SWITCH(decay3bodyBuilder, processRun3, "Produce DCA fitter decay3body tables", true); + //------------------------------------------------------------------ + // Event-mixing background + void processRun3EM(FullCols const& collisions, TrackExtPIDIUwithEvTimes const& tracksIU, aod::BCsWithTimestamps const&) + { + + vtxCandidates.clear(); + + auto tracksTuple = std::make_tuple(tracksIU); + BinningType binningEvent{{axisPosZ, axisCentrality}, true}; + SameKindPair pair{binningEvent, EMTrackSel.nUseMixedEvent, -1, collisions, tracksTuple, &cache}; + + Partition candProtons = aod::track::signed1Pt > 0.f && nabs(aod::track::eta) <= EMTrackSel.etacut && aod::track::pt >= EMTrackSel.minProtonPt && aod::track::pt <= EMTrackSel.maxProtonPt && aod::track::tpcNClsFindable >= (uint8_t)EMTrackSel.mintpcNClsproton && nabs(aod::pidtpc::tpcNSigmaPr) <= EMTrackSel.emTpcPidNsigmaCut; + Partition candAntiProtons = aod::track::signed1Pt < 0.f && nabs(aod::track::eta) <= EMTrackSel.etacut && aod::track::pt >= EMTrackSel.minProtonPt && aod::track::pt <= EMTrackSel.maxProtonPt && aod::track::tpcNClsFindable >= (uint8_t)EMTrackSel.mintpcNClsproton && nabs(aod::pidtpc::tpcNSigmaPr) <= EMTrackSel.emTpcPidNsigmaCut; + Partition candPionPlus = aod::track::signed1Pt > 0.f && nabs(aod::track::eta) <= EMTrackSel.etacut && aod::track::pt >= EMTrackSel.minPionPt && aod::track::pt <= EMTrackSel.maxPionPt && aod::track::tpcNClsFindable >= (uint8_t)EMTrackSel.mintpcNClspion && nabs(aod::pidtpc::tpcNSigmaPi) <= EMTrackSel.emTpcPidNsigmaCut; + Partition candPionMinus = aod::track::signed1Pt < 0.f && nabs(aod::track::eta) <= EMTrackSel.etacut && aod::track::pt >= EMTrackSel.minPionPt && aod::track::pt <= EMTrackSel.maxPionPt && aod::track::tpcNClsFindable >= (uint8_t)EMTrackSel.mintpcNClspion && nabs(aod::pidtpc::tpcNSigmaPi) <= EMTrackSel.emTpcPidNsigmaCut; + Partition candBachelors = aod::track::signed1Pt > 0.f && nabs(aod::track::eta) <= EMTrackSel.etacut && aod::track::pt >= EMTrackSel.minDeuteronPt && aod::track::pt <= EMTrackSel.maxDeuteronPt && aod::track::tpcNClsFindable >= (uint8_t)EMTrackSel.mintpcNClsbachelor && nabs(aod::pidtpc::tpcNSigmaDe) <= EMTrackSel.emTpcPidNsigmaCut; + Partition candAntiBachelors = aod::track::signed1Pt < 0.f && nabs(aod::track::eta) <= EMTrackSel.etacut && aod::track::pt >= EMTrackSel.minDeuteronPt && aod::track::pt <= EMTrackSel.maxDeuteronPt && aod::track::tpcNClsFindable >= (uint8_t)EMTrackSel.mintpcNClsbachelor && nabs(aod::pidtpc::tpcNSigmaDe) <= EMTrackSel.emTpcPidNsigmaCut; + candProtons.bindTable(tracksIU); + candPionPlus.bindTable(tracksIU); + candAntiProtons.bindTable(tracksIU); + candPionMinus.bindTable(tracksIU); + candBachelors.bindTable(tracksIU); + candAntiBachelors.bindTable(tracksIU); + + for (auto& [c1, tracks1, c2, tracks2] : pair) { + if (EMTrackSel.em_event_sel8_selection && (!c1.sel8() || !c2.sel8())) { + continue; + } + auto bc = c1.bc_as(); + initCCDB(bc); + auto protons = candProtons->sliceByCached(aod::track::collisionId, c1.globalIndex(), cache); + auto pionsplus = candPionPlus->sliceByCached(aod::track::collisionId, c1.globalIndex(), cache); + auto antiprotons = candAntiProtons->sliceByCached(aod::track::collisionId, c1.globalIndex(), cache); + auto pionsminus = candPionMinus->sliceByCached(aod::track::collisionId, c1.globalIndex(), cache); + auto bachelors = candBachelors->sliceByCached(aod::track::collisionId, c2.globalIndex(), cache); + auto antibachelors = candAntiBachelors->sliceByCached(aod::track::collisionId, c2.globalIndex(), cache); + + for (auto const& [tpos, tneg, tbach] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(protons, pionsminus, bachelors))) { + fillVtxCand(c1, tpos, tneg, tbach, -1, bachelorcharge); + } + for (auto const& [tpos, tneg, tbach] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(pionsplus, antiprotons, antibachelors))) { + fillVtxCand(c1, tpos, tneg, tbach, -1, bachelorcharge); + } + } + + // Aviod break of preslice in following workflow + std::sort(vtxCandidates.begin(), vtxCandidates.end(), [](const vtxCandidate a, const vtxCandidate b) { + return a.collisionId < b.collisionId; + }); + + for (auto& candVtx : vtxCandidates) { + fillVtx3BodyTable(candVtx); + } + } + PROCESS_SWITCH(decay3bodyBuilder, processRun3EM, "Produce event-mix background", false); + + //------------------------------------------------------------------ + // Event-mixing background + like-sign (to aviod deuteron with wrong collisionId) + void processRun3EMLikeSign(FullCols const& collisions, TrackExtPIDIUwithEvTimes const& tracksIU, aod::BCsWithTimestamps const&) + { + + vtxCandidates.clear(); + + auto tracksTuple = std::make_tuple(tracksIU); + BinningType binningEvent{{axisPosZ, axisCentrality}, true}; + SameKindPair pair{binningEvent, 5, -1, collisions, tracksTuple, &cache}; + + Partition candProtons = aod::track::signed1Pt > 0.f && nabs(aod::track::eta) <= EMTrackSel.etacut && aod::track::pt >= EMTrackSel.minProtonPt && aod::track::pt <= EMTrackSel.maxProtonPt && aod::track::tpcNClsFindable >= (uint8_t)EMTrackSel.mintpcNClsproton && nabs(aod::pidtpc::tpcNSigmaPr) <= EMTrackSel.emTpcPidNsigmaCut; + Partition candPionPlus = aod::track::signed1Pt > 0.f && nabs(aod::track::eta) <= EMTrackSel.etacut && aod::track::pt >= EMTrackSel.minPionPt && aod::track::pt <= EMTrackSel.maxPionPt && aod::track::tpcNClsFindable >= (uint8_t)EMTrackSel.mintpcNClspion && nabs(aod::pidtpc::tpcNSigmaPi) <= EMTrackSel.emTpcPidNsigmaCut; + Partition candAntiProtons = aod::track::signed1Pt < 0.f && nabs(aod::track::eta) <= EMTrackSel.etacut && aod::track::pt >= EMTrackSel.minProtonPt && aod::track::pt <= EMTrackSel.maxProtonPt && aod::track::tpcNClsFindable >= (uint8_t)EMTrackSel.mintpcNClsproton && nabs(aod::pidtpc::tpcNSigmaPr) <= EMTrackSel.emTpcPidNsigmaCut; + Partition candPionMinus = aod::track::signed1Pt < 0.f && nabs(aod::track::eta) <= EMTrackSel.etacut && aod::track::pt >= EMTrackSel.minPionPt && aod::track::pt <= EMTrackSel.maxPionPt && aod::track::tpcNClsFindable >= (uint8_t)EMTrackSel.mintpcNClspion && nabs(aod::pidtpc::tpcNSigmaPi) <= EMTrackSel.emTpcPidNsigmaCut; + Partition candBachelors = aod::track::signed1Pt > 0.f && nabs(aod::track::eta) <= EMTrackSel.etacut && aod::track::pt >= EMTrackSel.minDeuteronPt && aod::track::pt <= EMTrackSel.maxDeuteronPt && aod::track::tpcNClsFindable >= (uint8_t)EMTrackSel.mintpcNClsbachelor && nabs(aod::pidtpc::tpcNSigmaDe) <= EMTrackSel.emTpcPidNsigmaCut; + Partition candAntiBachelors = aod::track::signed1Pt < 0.f && nabs(aod::track::eta) <= EMTrackSel.etacut && aod::track::pt >= EMTrackSel.minDeuteronPt && aod::track::pt <= EMTrackSel.maxDeuteronPt && aod::track::tpcNClsFindable >= (uint8_t)EMTrackSel.mintpcNClsbachelor && nabs(aod::pidtpc::tpcNSigmaDe) <= EMTrackSel.emTpcPidNsigmaCut; + candProtons.bindTable(tracksIU); + candPionPlus.bindTable(tracksIU); + candAntiProtons.bindTable(tracksIU); + candPionMinus.bindTable(tracksIU); + candBachelors.bindTable(tracksIU); + candAntiBachelors.bindTable(tracksIU); + + for (auto& [c1, tracks1, c2, tracks2] : pair) { + if (EMTrackSel.em_event_sel8_selection && (!c1.sel8() || !c2.sel8())) { + continue; + } + auto bc = c1.bc_as(); + initCCDB(bc); + auto protons = candProtons->sliceByCached(aod::track::collisionId, c1.globalIndex(), cache); + auto pionsplus = candPionPlus->sliceByCached(aod::track::collisionId, c1.globalIndex(), cache); + auto antiprotons = candAntiProtons->sliceByCached(aod::track::collisionId, c1.globalIndex(), cache); + auto pionsminus = candPionMinus->sliceByCached(aod::track::collisionId, c1.globalIndex(), cache); + auto bachelors = candBachelors->sliceByCached(aod::track::collisionId, c2.globalIndex(), cache); + auto antibachelors = candAntiBachelors->sliceByCached(aod::track::collisionId, c2.globalIndex(), cache); + + for (auto const& [tpos, tneg, tbach] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(protons, pionsminus, antibachelors))) { + fillVtxCand(c1, tpos, tneg, tbach, -1, bachelorcharge); + } + for (auto const& [tpos, tneg, tbach] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(pionsplus, antiprotons, bachelors))) { + fillVtxCand(c1, tpos, tneg, tbach, -1, bachelorcharge); + } + } + + // Aviod break of preslice in following workflow + std::sort(vtxCandidates.begin(), vtxCandidates.end(), [](const vtxCandidate a, const vtxCandidate b) { + return a.collisionId < b.collisionId; + }); + + for (auto& candVtx : vtxCandidates) { + fillVtx3BodyTable(candVtx); + } + } + PROCESS_SWITCH(decay3bodyBuilder, processRun3EMLikeSign, "Produce event-mix background with like-sign method", false); + //------------------------------------------------------------------ + void processRun3withKFParticle(ColwithEvTimes const& collisions, TrackExtPIDIUwithEvTimes const&, aod::Decay3Bodys const& decay3bodys, aod::BCsWithTimestamps const&) { for (const auto& collision : collisions) { @@ -1154,6 +1350,7 @@ struct decay3bodyBuilder { PROCESS_SWITCH(decay3bodyBuilder, processRun3withKFParticle, "Produce KFParticle decay3body tables", false); }; +// build link from decay3body -> vtx3body struct decay3bodyDataLinkBuilder { Produces vtxdataLink; @@ -1166,7 +1363,9 @@ struct decay3bodyDataLinkBuilder { for (int ii = 0; ii < decay3bodytable.size(); ii++) lIndices[ii] = -1; for (auto& vtxdata : vtxdatatable) { - lIndices[vtxdata.decay3bodyId()] = vtxdata.globalIndex(); + if (vtxdata.decay3bodyId() != -1) { + lIndices[vtxdata.decay3bodyId()] = vtxdata.globalIndex(); + } } for (int ii = 0; ii < decay3bodytable.size(); ii++) { vtxdataLink(lIndices[ii]); diff --git a/PWGLF/TableProducer/Nuspex/threebodyRecoTask.cxx b/PWGLF/TableProducer/Nuspex/threebodyRecoTask.cxx index b0a53668d4f..0f728f37574 100644 --- a/PWGLF/TableProducer/Nuspex/threebodyRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/threebodyRecoTask.cxx @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include "Framework/runDataProcessing.h" @@ -636,6 +638,8 @@ struct threebodyRecoTask { continue; } registry.fill(HIST("hEventCounter"), 2.5); + registry.fill(HIST("hCentFT0C"), collision.centFT0C()); + if (collision.mcCollisionId() >= 0) { isGoodCollision[collision.mcCollisionId()] = true; } diff --git a/PWGLF/Tasks/Nuspex/hypertriton3bodyMCQA.cxx b/PWGLF/Tasks/Nuspex/hypertriton3bodyMCQA.cxx index 1fe1a563137..7d54bd86d48 100644 --- a/PWGLF/Tasks/Nuspex/hypertriton3bodyMCQA.cxx +++ b/PWGLF/Tasks/Nuspex/hypertriton3bodyMCQA.cxx @@ -19,6 +19,9 @@ #include #include #include +#include +#include +#include #include #include "CommonDataFormat/InteractionRecord.h" @@ -267,7 +270,7 @@ struct hypertriton3bodyTrackMcinfo { Configurable loadResponseFromCCDB{"loadResponseFromCCDB", false, "Flag to load the response from the CCDB"}; Configurable fatalOnPassNotAvailable{"fatalOnPassNotAvailable", true, "Flag to throw a fatal if the pass is not available in the retrieved CCDB object"}; - o2::aod::pidtofgeneric::TofPidNewCollision bachelorTOFPID; + o2::aod::pidtofgeneric::TofPidNewCollision bachelorTOFPID; o2::pid::tof::TOFResoParamsV2 mRespParamsV2; void initCCDB(aod::BCsWithTimestamps::iterator const& bc) From cbab24805691847122d58dd2ca0d802ee1befb71 Mon Sep 17 00:00:00 2001 From: Fernanda Torres <135931275+mtorresc15@users.noreply.github.com> Date: Thu, 21 Nov 2024 02:56:53 -0600 Subject: [PATCH 039/459] [PWGLF] Update on spectraTOF.cxx (#8579) --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 78 +++++++++++++++++++++++-------- 1 file changed, 58 insertions(+), 20 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 942175867b7..a16e466f884 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -52,16 +52,21 @@ std::array, NpCharge> hDcaXYZMat; std::array, NpCharge> hDcaXYWrongCollisionPrm; std::array, NpCharge> hDcaXYWrongCollisionStr; std::array, NpCharge> hDcaXYWrongCollisionMat; -std::array, NpCharge> hDcaXYMC; // DCA xy in the MC -std::array, NpCharge> hDcaZMC; // DCA z in the MC -std::array, NpCharge> hDcaXYMCD0; // DCA xy in the MC for particles from D0 -std::array, NpCharge> hDcaZMCD0; // DCA z in the MC for particles from D0 -std::array, NpCharge> hDcaXYMCCharm; // DCA xy in the MC for particles from charm -std::array, NpCharge> hdcaZMCCharm; // DCA z in the MC for particles from charm -std::array, NpCharge> hDcaXYMCBeauty; // DCA xy in the MC for particles from beauty -std::array, NpCharge> hDcaZMCBeauty; // DCA z in the MC for particles from beauty -std::array, NpCharge> hDcaXYMCNotHF; // DCA xy in the MC for particles from not a HF -std::array, NpCharge> hDcaZMCNotHF; // DCA z in the MC for particles from not a HF +std::array, NpCharge> hDcaXYMC; // DCA xy in the MC +std::array, NpCharge> hDcaZMC; // DCA z in the MC +std::array, NpCharge> hDcaXYMCD0; // DCA xy in the MC for particles from D0 +std::array, NpCharge> hDcaZMCD0; // DCA z in the MC for particles from D0 +std::array, NpCharge> hDcaXYMCCharm; // DCA xy in the MC for particles from charm +std::array, NpCharge> hdcaZMCCharm; // DCA z in the MC for particles from charm +std::array, NpCharge> hDcaXYMCBeauty; // DCA xy in the MC for particles from beauty +std::array, NpCharge> hDcaZMCBeauty; // DCA z in the MC for particles from beauty +std::array, NpCharge> hDcaXYMCNotHF; // DCA xy in the MC for particles from not a HF +std::array, NpCharge> hDcaZMCNotHF; // DCA z in the MC for particles from not a HF +std::array, NpCharge> hDecayLengthStr; // Decay Length for particles from Strange +std::array, NpCharge> hDecayLengthMCD0; // Decay Length in the MC for particles from D0 +std::array, NpCharge> hDecayLengthMCCharm; // Decay Length in the MC for particles from charm +std::array, NpCharge> hDecayLengthMCBeauty; // Decay Length in the MC for particles from charm +std::array, NpCharge> hDecayLengthMCNotHF; // Decay Length in the MC for particles from not a HF // Spectra task struct tofSpectra { @@ -335,6 +340,7 @@ struct tofSpectra { const AxisSpec phiAxis{200, 0, 7, "#it{#varphi} (rad)"}; const AxisSpec dcaZAxis{binsOptions.binsDca, "DCA_{z} (cm)"}; const AxisSpec lengthAxis{100, 0, 600, "Track length (cm)"}; + const AxisSpec decayLengthAxis{100, 0, 0.1, "Decay Length (cm)"}; if (enableTrackCutHistograms) { const AxisSpec chargeAxis{2, -2.f, 2.f, "Charge"}; @@ -653,6 +659,7 @@ struct tofSpectra { histos.add(hdcazstr[i].data(), pTCharge[i], kTH2D, {ptAxis, dcaZAxis}); histos.add(hdcaxymat[i].data(), pTCharge[i], kTH2D, {ptAxis, dcaXyAxis}); histos.add(hdcazmat[i].data(), pTCharge[i], kTH2D, {ptAxis, dcaZAxis}); + hDecayLengthStr[i] = histos.add("decaylengthstr" + cpName, pTCharge[i], kTH2D, {ptAxis, decayLengthAxis}); if (enableDcaGoodEvents) { histos.add(hdcaxyprmgoodevs[i].data(), pTCharge[i], kTH2D, {ptAxis, dcaXyAxis}); histos.add(hdcazprmgoodevs[i].data(), pTCharge[i], kTH2D, {ptAxis, dcaZAxis}); @@ -668,6 +675,10 @@ struct tofSpectra { hdcaZMCCharm[i] = histos.add("dcazcharm" + cpName, pTCharge[i], kTH2D, {ptAxis, dcaZAxis}); hDcaXYMCBeauty[i] = histos.add("dcaxybeauty" + cpName, pTCharge[i], kTH2D, {ptAxis, dcaXyAxis}); hDcaZMCBeauty[i] = histos.add("dcazbeauty" + cpName, pTCharge[i], kTH2D, {ptAxis, dcaZAxis}); + hDecayLengthMCD0[i] = histos.add("decaylengthD0" + cpName, pTCharge[i], kTH2D, {ptAxis, decayLengthAxis}); + hDecayLengthMCCharm[i] = histos.add("decaylengthcharm" + cpName, pTCharge[i], kTH2D, {ptAxis, decayLengthAxis}); + hDecayLengthMCBeauty[i] = histos.add("decaylengthbeauty" + cpName, pTCharge[i], kTH2D, {ptAxis, decayLengthAxis}); + hDecayLengthMCNotHF[i] = histos.add("decaylengthnothf" + cpName, pTCharge[i], kTH2D, {ptAxis, decayLengthAxis}); } } @@ -1630,6 +1641,13 @@ struct tofSpectra { histos.fill(HIST(hdcaxystr[i]), track.pt(), track.dcaXY()); histos.fill(HIST(hdcazstr[i]), track.pt(), track.dcaZ()); } + if (mcParticle.has_daughters()) { + auto daughter0 = mcParticle.template daughters_as().begin(); + double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()}; + double vertexPrimary[3] = {mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()}; + auto decayLength = RecoDecay::distance(vertexPrimary, vertexDau) / 10000; + hDecayLengthStr[i]->Fill(track.pt(), decayLength); + } } else { if (enableDCAxyzHistograms) { hDcaXYZMat[i]->Fill(track.pt(), track.dcaXY(), track.dcaZ()); @@ -1658,23 +1676,23 @@ struct tofSpectra { bool IsD0Mother = false; bool IsCharmMother = false; bool IsBeautyMother = false; + bool IsNotHFMother = false; if (mcParticle.has_mothers()) { const int charmOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, false); for (const auto& mother : mcParticle.template mothers_as()) { - const int motherPdgCode = mother.pdgCode(); + const int motherPdgCode = std::abs(mother.pdgCode()); if (motherPdgCode == 421) { IsD0Mother = true; } - if (charmOrigin == RecoDecay::OriginType::NonPrompt) { - if ((motherPdgCode) / 1000 == 5 || (motherPdgCode) / 100 == 5) { - IsBeautyMother = true; - } + if (charmOrigin == RecoDecay::OriginType::NonPrompt && ((motherPdgCode) / 1000 == 5 || (motherPdgCode) / 100 == 5)) { + IsBeautyMother = true; + } + if (charmOrigin == RecoDecay::OriginType::Prompt && ((motherPdgCode) / 1000 == 4 || (motherPdgCode) / 100 == 4)) { + IsCharmMother = true; } - if (charmOrigin == RecoDecay::OriginType::Prompt) { - if ((motherPdgCode) / 1000 == 4 || (motherPdgCode) / 100 == 4) { - IsCharmMother = true; - } + if (!(motherPdgCode / 1000 == 4 || motherPdgCode / 100 == 4) && !(motherPdgCode / 1000 == 5 || motherPdgCode / 100 == 5)) { + IsNotHFMother = true; } } } @@ -1690,10 +1708,30 @@ struct tofSpectra { hDcaXYMCBeauty[i]->Fill(track.pt(), track.dcaXY()); hDcaZMCBeauty[i]->Fill(track.pt(), track.dcaZ()); } - if (!IsCharmMother && !IsBeautyMother) { + if (IsNotHFMother) { hDcaXYMCNotHF[i]->Fill(track.pt(), track.dcaXY()); hDcaZMCNotHF[i]->Fill(track.pt(), track.dcaZ()); } + + if (mcParticle.has_daughters()) { + auto daughter0 = mcParticle.template daughters_as().begin(); + double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()}; + double vertexPrimary[3] = {mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()}; + auto decayLength = RecoDecay::distance(vertexPrimary, vertexDau) / 10000; + + if (IsD0Mother) { + hDecayLengthMCD0[i]->Fill(track.pt(), decayLength); + } + if (IsCharmMother) { + hDecayLengthMCCharm[i]->Fill(track.pt(), decayLength); + } + if (IsBeautyMother) { + hDecayLengthMCBeauty[i]->Fill(track.pt(), decayLength); + } + if (IsNotHFMother) { + hDecayLengthMCNotHF[i]->Fill(track.pt(), decayLength); + } + } } } From 65394b341845ef56fd5c838dc817aaa6a4f25bda Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:57:20 +0100 Subject: [PATCH 040/459] [PWGCF] FemtoUniverse: Linking libraries (#8548) --- PWGCF/FemtoUniverse/TableProducer/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/CMakeLists.txt b/PWGCF/FemtoUniverse/TableProducer/CMakeLists.txt index ecbb6e46873..b82a2e6d6f1 100644 --- a/PWGCF/FemtoUniverse/TableProducer/CMakeLists.txt +++ b/PWGCF/FemtoUniverse/TableProducer/CMakeLists.txt @@ -11,7 +11,7 @@ o2physics_add_dpl_workflow(femtouniverse-producer SOURCES femtoUniverseProducerTask.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(femtouniverse-mctruth-producer From 06cf3289411bc99836b40eb6626eec6e632861c7 Mon Sep 17 00:00:00 2001 From: Paul Buehler Date: Thu, 21 Nov 2024 09:58:20 +0100 Subject: [PATCH 041/459] [PWGUD] update DGCandProducer to fill proper globalBC number into UDMcCollisions table (#8449) Co-authored-by: rolavick --- PWGUD/TableProducer/DGCandProducer.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PWGUD/TableProducer/DGCandProducer.cxx b/PWGUD/TableProducer/DGCandProducer.cxx index 855b60b6e86..027cfd376ee 100644 --- a/PWGUD/TableProducer/DGCandProducer.cxx +++ b/PWGUD/TableProducer/DGCandProducer.cxx @@ -11,6 +11,7 @@ // // \brief Saves relevant information of DG candidates // \author Paul Buehler, paul.buehler@oeaw.ac.at + #include #include #include @@ -377,7 +378,8 @@ struct McDGCandProducer { void updateUDMcCollisions(TMcCollision const& mccol) { // save mccol - outputMcCollisions(mccol.bcId(), + auto bc = mccol.template bc_as(); + outputMcCollisions(bc.globalBC(), mccol.generatorsID(), mccol.posX(), mccol.posY(), From 4b0c6caa652ea233daa294402d88b558b7f173f5 Mon Sep 17 00:00:00 2001 From: Rafael Manhart <56776511+RafRaf11@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:59:14 +0100 Subject: [PATCH 042/459] [PWGLF] Update NucleiHistTask.cxx (#8541) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/NucleiHistTask.cxx | 456 ++++++++++++++++++++++++-- 1 file changed, 427 insertions(+), 29 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx b/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx index e3bfc1be9ae..37ad72ef487 100644 --- a/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx +++ b/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx @@ -58,7 +58,9 @@ struct NucleiHistTask { // MC HistogramRegistry MC_recon_reg{"MC_particles_reco", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - OutputObj histPDG{TH1F("PDG", "PDG;PDG code", 20, 0.0, 20.0)}; + OutputObj histPDG{TH1I("PDG", "PDG;PDG code", 20, 0.0, 20.0)}; + OutputObj histTrackcuts_data{TH1I("histTrackcuts_data", "Entires;Track cut", 15, 0, 15)}; + OutputObj histTrackcuts_MC{TH1I("histTrackcuts_MC", "Entires;Track cut", 15, 0, 15)}; void init(o2::framework::InitContext&) { @@ -67,6 +69,36 @@ struct NucleiHistTask { LOG(fatal) << "Can't enable processData and processDataCent in the same time, pick one!"; } + // +++++++++++++++++++++ Data ++++++++++++++++++++++++ + histTrackcuts_data->GetXaxis()->SetBinLabel(1, "Events read"); + histTrackcuts_data->GetXaxis()->SetBinLabel(2, "Ev. sel. passed"); + histTrackcuts_data->GetXaxis()->SetBinLabel(3, "Rap. cut passed"); + histTrackcuts_data->GetXaxis()->SetBinLabel(4, "DCA cut passed"); + histTrackcuts_data->GetXaxis()->SetBinLabel(5, "TPCnCls cut passed"); + histTrackcuts_data->GetXaxis()->SetBinLabel(6, "TPCCrossedRowsOverFindable cut passed"); + histTrackcuts_data->GetXaxis()->SetBinLabel(7, "Chi2 cut passed"); + histTrackcuts_data->GetXaxis()->SetBinLabel(8, "Passed TPC refit cut"); + histTrackcuts_data->GetXaxis()->SetBinLabel(9, "Passed ITS refit cut"); + histTrackcuts_data->GetXaxis()->SetBinLabel(10, "ITSnCls cut passed"); + histTrackcuts_data->GetXaxis()->SetBinLabel(11, "Momentum cut passed"); + histTrackcuts_data->GetXaxis()->SetBinLabel(12, "hasITS & hasTPC cut passed"); + histTrackcuts_data->GetXaxis()->SetBinLabel(13, "GoldenChi2 cut passed"); + + // +++++++++++++++++++++ MC ++++++++++++++++++++++++ + histTrackcuts_MC->GetXaxis()->SetBinLabel(1, "Events read"); + histTrackcuts_MC->GetXaxis()->SetBinLabel(2, "Prim. particle. sel. passed"); + histTrackcuts_MC->GetXaxis()->SetBinLabel(3, "Rap. cut passed"); + histTrackcuts_MC->GetXaxis()->SetBinLabel(4, "DCA cut passed"); + histTrackcuts_MC->GetXaxis()->SetBinLabel(5, "TPCnCls cut passed"); + histTrackcuts_MC->GetXaxis()->SetBinLabel(6, "TPCCrossedRowsOverFindable cut passed"); + histTrackcuts_MC->GetXaxis()->SetBinLabel(7, "Chi2 cut passed"); + histTrackcuts_MC->GetXaxis()->SetBinLabel(8, "Passed TPC refit cut"); + histTrackcuts_MC->GetXaxis()->SetBinLabel(9, "Passed ITS refit cut"); + histTrackcuts_MC->GetXaxis()->SetBinLabel(10, "ITSnCls cut passed"); + histTrackcuts_MC->GetXaxis()->SetBinLabel(11, "Momentum cut passed"); + histTrackcuts_MC->GetXaxis()->SetBinLabel(12, "hasITS & hasTPC cut passed"); + histTrackcuts_MC->GetXaxis()->SetBinLabel(13, "GoldenChi2 cut passed"); + std::vector ptBinning = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 2.0, 2.2, 2.4, 2.8, 3.2, 3.6, 4., 5., 6., 8., 10., 12., 14.}; std::vector etaBinning = {-1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0}; std::vector PDGBinning = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0}; @@ -386,6 +418,7 @@ struct NucleiHistTask { // Configurables Configurable use_momentum_getter{"use_momentum_getter", 0, "0: track.p(), 1: track.pt(), 2: track.tpcInnerParam()"}; + Configurable momentum_He3{"momentum_He3", 0, "0: momentum * 1.0, 1: momentum * 2.0"}; Configurable yMin{"yMin", -0.5, "Maximum rapidity"}; Configurable yMax{"yMax", 0.5, "Minimum rapidity"}; Configurable p_min{"p_min", 0.1f, "min momentum"}; @@ -399,16 +432,23 @@ struct NucleiHistTask { Configurable enable_Centrality_cut_global{"enable_Centrality_cut_global", true, "use Centrality cut"}; // Replacement for globalTrack filter + Configurable requireITS{"requireITS", true, "Additional cut on the ITS requirement"}; + Configurable requireTPC{"requireTPC", true, "Additional cut on the TPC requirement"}; + Configurable passedITSRefit{"passedITSRefit", true, "Additional cut on the ITS refit requirement"}; + Configurable passedTPCRefit{"passedTPCRefit", true, "Additional cut on the TPC refit requirement"}; Configurable minReqClusterITS{"minReqClusterITS", 1.0, "min number of clusters required in ITS"}; Configurable minReqClusterITSib{"minReqClusterITSib", 1.0, "min number of clusters required in ITS inner barrel"}; Configurable minTPCnClsFound{"minTPCnClsFound", 0.0f, "min number of crossed rows TPC"}; Configurable minNCrossedRowsTPC{"minNCrossedRowsTPC", 70.0f, "min number of crossed rows TPC"}; Configurable minRatioCrossedRowsTPC{"minRatioCrossedRowsTPC", 0.8f, "min ratio of crossed rows over findable clusters TPC"}; Configurable maxRatioCrossedRowsTPC{"maxRatioCrossedRowsTPC", 2.0f, "max ratio of crossed rows over findable clusters TPC"}; - Configurable maxChi2ITS{"maxChi2ITS", 36.0f, "max chi2 per cluster ITS"}; - Configurable maxChi2TPC{"maxChi2TPC", 4.0f, "max chi2 per cluster TPC"}; + Configurable maxChi2PerClusterTPC{"maxChi2PerClusterTPC", 4.f, "Cut on the maximum value of the chi2 per cluster in the TPC"}; + Configurable minChi2PerClusterTPC{"minChi2PerClusterTPC", 0.5f, "Cut on the minimum value of the chi2 per cluster in the TPC"}; + Configurable maxChi2PerClusterITS{"maxChi2PerClusterITS", 36.f, "Cut on the maximum value of the chi2 per cluster in the ITS"}; Configurable maxDCA_XY{"maxDCA_XY", 0.5f, "max DCA to vertex xy"}; Configurable maxDCA_Z{"maxDCA_Z", 2.0f, "max DCA to vertex z"}; + Configurable lastRequiredTrdCluster{"lastRequiredTrdCluster", -1, "Last cluster to required in TRD for track selection. -1 does not require any TRD cluster"}; + Configurable requireGoldenChi2{"requireGoldenChi2", false, "Enable the requirement of GoldenChi2"}; Configurable event_selection_sel8{"event_selection_sel8", true, "Enable sel8 event selection"}; Configurable event_selection_MC_sel8{"event_selection_MC_sel8", true, "Enable sel8 event selection in MC processing"}; @@ -425,26 +465,63 @@ struct NucleiHistTask { for (auto track : tracks) { + histTrackcuts_data->AddBinContent(1); if (event_selection_sel8 && !event.sel8()) continue; + histTrackcuts_data->AddBinContent(2); double momentum = 0.0; + double momentum_Z_equal_2 = 0.0; int momentum_getter = 0; + int momentum_getter_Z_equal_2 = 0; switch (use_momentum_getter) { case 0: momentum = track.p(); + switch (momentum_He3) { + case 0: + momentum_Z_equal_2 = track.p(); + break; + case 1: + momentum_Z_equal_2 = track.p() * 2.0; + break; + default: + momentum_getter_Z_equal_2 = -1; + break; + } break; case 1: momentum = track.pt(); + switch (momentum_He3) { + case 0: + momentum_Z_equal_2 = track.pt(); + break; + case 1: + momentum_Z_equal_2 = track.pt() * 2.0; + break; + default: + momentum_getter_Z_equal_2 = -1; + break; + } break; case 2: momentum = track.tpcInnerParam(); + switch (momentum_He3) { + case 0: + momentum_Z_equal_2 = track.tpcInnerParam(); + break; + case 1: + momentum_Z_equal_2 = track.tpcInnerParam() * 2.0; + break; + default: + momentum_getter_Z_equal_2 = -1; + break; + } break; default: momentum_getter = -1; break; } - if (momentum_getter == -1) + if (momentum_getter == -1 || momentum_getter_Z_equal_2 == -1) break; float TPCnumberClsFound = track.tpcNClsFound(); @@ -483,6 +560,7 @@ struct NucleiHistTask { lorentzVector_He3.Rapidity() < yMin || lorentzVector_He3.Rapidity() > yMax || lorentzVector_He4.Rapidity() < yMin || lorentzVector_He4.Rapidity() > yMax) continue; + histTrackcuts_data->AddBinContent(3); float nSigmaPion = track.tpcNSigmaPi(); float nSigmaProton = track.tpcNSigmaPr(); @@ -497,8 +575,36 @@ struct NucleiHistTask { spectra_reg.fill(HIST("histChi2TPC"), track.pt(), track.tpcChi2NCl()); spectra_reg.fill(HIST("histChi2ITS"), track.pt(), track.itsChi2NCl()); - if (TMath::Abs(track.dcaXY()) > maxDCA_XY || TMath::Abs(track.dcaZ()) > maxDCA_Z || TPCnumberClsFound < minTPCnClsFound || TPC_nCls_Crossed_Rows < minNCrossedRowsTPC || RatioCrossedRowsOverFindableTPC < minRatioCrossedRowsTPC || RatioCrossedRowsOverFindableTPC > maxRatioCrossedRowsTPC || Chi2perClusterTPC > maxChi2TPC || Chi2perClusterITS > maxChi2ITS || !(track.passedTPCRefit()) || !(track.passedITSRefit()) || (track.itsNClsInnerBarrel()) < minReqClusterITSib || (track.itsNCls()) < minReqClusterITS || track.pt() < p_min || track.pt() > p_max) + if (TMath::Abs(track.dcaXY()) > maxDCA_XY || TMath::Abs(track.dcaZ()) > maxDCA_Z) + continue; + histTrackcuts_data->AddBinContent(4); + if (TPCnumberClsFound < minTPCnClsFound || TPC_nCls_Crossed_Rows < minNCrossedRowsTPC) + continue; + histTrackcuts_data->AddBinContent(5); + if (RatioCrossedRowsOverFindableTPC < minRatioCrossedRowsTPC || RatioCrossedRowsOverFindableTPC > maxRatioCrossedRowsTPC) + continue; + histTrackcuts_data->AddBinContent(6); + if (Chi2perClusterTPC > maxChi2PerClusterTPC || Chi2perClusterTPC < minChi2PerClusterTPC || Chi2perClusterITS > maxChi2PerClusterITS) + continue; + histTrackcuts_data->AddBinContent(7); + if (!(track.passedTPCRefit())) + continue; + histTrackcuts_data->AddBinContent(8); + if (!(track.passedITSRefit())) continue; + histTrackcuts_data->AddBinContent(9); + if ((track.itsNClsInnerBarrel()) < minReqClusterITSib || (track.itsNCls()) < minReqClusterITS) + continue; + histTrackcuts_data->AddBinContent(10); + if (track.pt() < p_min || track.pt() > p_max) + continue; + histTrackcuts_data->AddBinContent(11); + if ((requireITS && !(track.hasITS())) || (requireTPC && !(track.hasTPC()))) + continue; + histTrackcuts_data->AddBinContent(12); + if (requireGoldenChi2 && !(track.passedGoldenChi2())) + continue; + histTrackcuts_data->AddBinContent(13); spectra_reg.fill(HIST("histTpcSignalData"), momentum * track.sign(), track.tpcSignal()); @@ -507,10 +613,21 @@ struct NucleiHistTask { proton_reg.fill(HIST("histTpcNsigmaData"), momentum, nSigmaProton); deuteron_reg.fill(HIST("histTpcNsigmaData"), momentum, nSigmaDeut); triton_reg.fill(HIST("histTpcNsigmaData"), momentum, nSigmaTriton); - Helium3_reg.fill(HIST("histTpcNsigmaData"), momentum * 2.0, nSigmaHe3); - Helium4_reg.fill(HIST("histTpcNsigmaData"), momentum * 2.0, nSigmaHe4); + Helium3_reg.fill(HIST("histTpcNsigmaData"), momentum_Z_equal_2, nSigmaHe3); + Helium4_reg.fill(HIST("histTpcNsigmaData"), momentum_Z_equal_2, nSigmaHe4); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); spectra_reg.fill(HIST("histTOFm2"), momentum, TOFmass2); } @@ -521,10 +638,21 @@ struct NucleiHistTask { aproton_reg.fill(HIST("histTpcNsigmaData"), momentum, nSigmaProton); adeuteron_reg.fill(HIST("histTpcNsigmaData"), momentum, nSigmaDeut); atriton_reg.fill(HIST("histTpcNsigmaData"), momentum, nSigmaTriton); - aHelium3_reg.fill(HIST("histTpcNsigmaData"), momentum * 2.0, nSigmaHe3); - aHelium4_reg.fill(HIST("histTpcNsigmaData"), momentum * 2.0, nSigmaHe4); + aHelium3_reg.fill(HIST("histTpcNsigmaData"), momentum_Z_equal_2, nSigmaHe3); + aHelium4_reg.fill(HIST("histTpcNsigmaData"), momentum_Z_equal_2, nSigmaHe4); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); spectra_reg.fill(HIST("histTOFm2"), momentum, TOFmass2); } @@ -545,6 +673,17 @@ struct NucleiHistTask { pion_reg.fill(HIST("histChi2ITS"), track.pt(), track.itsChi2NCl()); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); Float_t beta = track.beta(); pion_reg.fill(HIST("histTOFm2"), momentum, TOFmass2); @@ -564,6 +703,17 @@ struct NucleiHistTask { apion_reg.fill(HIST("histChi2ITS"), track.pt(), track.itsChi2NCl()); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); Float_t beta = track.beta(); apion_reg.fill(HIST("histTOFm2"), momentum, TOFmass2); @@ -573,6 +723,17 @@ struct NucleiHistTask { } if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } spectra_reg.fill(HIST("histTofSignalData"), momentum * track.sign(), track.beta()); } } @@ -592,6 +753,17 @@ struct NucleiHistTask { proton_reg.fill(HIST("histChi2ITS"), track.pt(), track.itsChi2NCl()); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); Float_t beta = track.beta(); proton_reg.fill(HIST("histTOFm2"), momentum, TOFmass2); @@ -611,6 +783,17 @@ struct NucleiHistTask { aproton_reg.fill(HIST("histChi2ITS"), track.pt(), track.itsChi2NCl()); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); Float_t beta = track.beta(); aproton_reg.fill(HIST("histTOFm2"), momentum, TOFmass2); @@ -620,6 +803,17 @@ struct NucleiHistTask { } if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } spectra_reg.fill(HIST("histTofSignalData"), momentum * track.sign(), track.beta()); } } @@ -639,6 +833,17 @@ struct NucleiHistTask { deuteron_reg.fill(HIST("histChi2ITS"), track.pt(), track.itsChi2NCl()); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); Float_t beta = track.beta(); deuteron_reg.fill(HIST("histTOFm2"), momentum, TOFmass2); @@ -658,6 +863,17 @@ struct NucleiHistTask { adeuteron_reg.fill(HIST("histChi2ITS"), track.pt(), track.itsChi2NCl()); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); Float_t beta = track.beta(); adeuteron_reg.fill(HIST("histTOFm2"), momentum, TOFmass2); @@ -667,6 +883,17 @@ struct NucleiHistTask { } if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } spectra_reg.fill(HIST("histTofSignalData"), momentum * track.sign(), track.beta()); } } @@ -686,6 +913,17 @@ struct NucleiHistTask { triton_reg.fill(HIST("histChi2ITS"), track.pt(), track.itsChi2NCl()); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); Float_t beta = track.beta(); triton_reg.fill(HIST("histTOFm2"), momentum, TOFmass2); @@ -705,6 +943,17 @@ struct NucleiHistTask { atriton_reg.fill(HIST("histChi2ITS"), track.pt(), track.itsChi2NCl()); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); Float_t beta = track.beta(); atriton_reg.fill(HIST("histTOFm2"), momentum, TOFmass2); @@ -714,6 +963,17 @@ struct NucleiHistTask { } if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } spectra_reg.fill(HIST("histTofSignalData"), momentum * track.sign(), track.beta()); } } @@ -725,7 +985,7 @@ struct NucleiHistTask { if (track.sign() > 0) { Helium3_reg.fill(HIST("histDcaVsPtData"), track.pt() * 2.0, track.dcaXY()); Helium3_reg.fill(HIST("histDcaZVsPtData"), track.pt() * 2.0, track.dcaZ()); - Helium3_reg.fill(HIST("histTpcSignalData"), momentum * 2.0, track.tpcSignal()); + Helium3_reg.fill(HIST("histTpcSignalData"), momentum_Z_equal_2, track.tpcSignal()); Helium3_reg.fill(HIST("histNClusterTPC"), track.pt() * 2.0, track.tpcNClsFound()); Helium3_reg.fill(HIST("histNClusterITS"), track.pt() * 2.0, track.itsNCls()); Helium3_reg.fill(HIST("histNClusterITSib"), track.pt() * 2.0, track.itsNClsInnerBarrel()); @@ -733,18 +993,29 @@ struct NucleiHistTask { Helium3_reg.fill(HIST("histChi2ITS"), track.pt() * 2.0, track.itsChi2NCl()); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); Float_t beta = track.beta(); - Helium3_reg.fill(HIST("histTOFm2"), momentum * 2.0, TOFmass2); - Helium3_reg.fill(HIST("histTofSignalData"), momentum * 2.0, beta); - Helium3_reg.fill(HIST("histTofNsigmaData"), momentum * 2.0, track.tofNSigmaHe()); + Helium3_reg.fill(HIST("histTOFm2"), momentum_Z_equal_2, TOFmass2); + Helium3_reg.fill(HIST("histTofSignalData"), momentum_Z_equal_2, beta); + Helium3_reg.fill(HIST("histTofNsigmaData"), momentum_Z_equal_2, track.tofNSigmaHe()); } } if (track.sign() < 0) { aHelium3_reg.fill(HIST("histDcaVsPtData"), track.pt() * 2.0, track.dcaXY()); aHelium3_reg.fill(HIST("histDcaZVsPtData"), track.pt() * 2.0, track.dcaZ()); - aHelium3_reg.fill(HIST("histTpcSignalData"), momentum * 2.0, track.tpcSignal()); + aHelium3_reg.fill(HIST("histTpcSignalData"), momentum_Z_equal_2, track.tpcSignal()); aHelium3_reg.fill(HIST("histNClusterTPC"), track.pt() * 2.0, track.tpcNClsFound()); aHelium3_reg.fill(HIST("histNClusterITS"), track.pt() * 2.0, track.itsNCls()); aHelium3_reg.fill(HIST("histNClusterITSib"), track.pt() * 2.0, track.itsNClsInnerBarrel()); @@ -752,16 +1023,38 @@ struct NucleiHistTask { aHelium3_reg.fill(HIST("histChi2ITS"), track.pt() * 2.0, track.itsChi2NCl()); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); Float_t beta = track.beta(); - aHelium3_reg.fill(HIST("histTOFm2"), momentum * 2.0, TOFmass2); - aHelium3_reg.fill(HIST("histTofSignalData"), momentum * 2.0, beta); - aHelium3_reg.fill(HIST("histTofNsigmaData"), momentum * 2.0, track.tofNSigmaHe()); + aHelium3_reg.fill(HIST("histTOFm2"), momentum_Z_equal_2, TOFmass2); + aHelium3_reg.fill(HIST("histTofSignalData"), momentum_Z_equal_2, beta); + aHelium3_reg.fill(HIST("histTofNsigmaData"), momentum_Z_equal_2, track.tofNSigmaHe()); } } if (track.hasTOF()) { - spectra_reg.fill(HIST("histTofSignalData"), momentum * 2.0 * track.sign(), track.beta()); + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } + spectra_reg.fill(HIST("histTofSignalData"), momentum_Z_equal_2 * track.sign(), track.beta()); } } @@ -772,7 +1065,7 @@ struct NucleiHistTask { if (track.sign() > 0) { Helium4_reg.fill(HIST("histDcaVsPtData"), track.pt() * 2.0, track.dcaXY()); Helium4_reg.fill(HIST("histDcaZVsPtData"), track.pt() * 2.0, track.dcaZ()); - Helium4_reg.fill(HIST("histTpcSignalData"), momentum * 2.0, track.tpcSignal()); + Helium4_reg.fill(HIST("histTpcSignalData"), momentum_Z_equal_2, track.tpcSignal()); Helium4_reg.fill(HIST("histNClusterTPC"), track.pt() * 2.0, track.tpcNClsFound()); Helium4_reg.fill(HIST("histNClusterITS"), track.pt() * 2.0, track.itsNCls()); Helium4_reg.fill(HIST("histNClusterITSib"), track.pt() * 2.0, track.itsNClsInnerBarrel()); @@ -780,18 +1073,29 @@ struct NucleiHistTask { Helium4_reg.fill(HIST("histChi2ITS"), track.pt() * 2.0, track.itsChi2NCl()); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); Float_t beta = track.beta(); - Helium4_reg.fill(HIST("histTOFm2"), momentum * 2.0, TOFmass2); - Helium4_reg.fill(HIST("histTofSignalData"), momentum * 2.0, beta); - Helium4_reg.fill(HIST("histTofNsigmaData"), momentum * 2.0, track.tofNSigmaAl()); + Helium4_reg.fill(HIST("histTOFm2"), momentum_Z_equal_2, TOFmass2); + Helium4_reg.fill(HIST("histTofSignalData"), momentum_Z_equal_2, beta); + Helium4_reg.fill(HIST("histTofNsigmaData"), momentum_Z_equal_2, track.tofNSigmaAl()); } } if (track.sign() < 0) { aHelium4_reg.fill(HIST("histDcaVsPtData"), track.pt() * 2.0, track.dcaXY()); aHelium4_reg.fill(HIST("histDcaZVsPtData"), track.pt() * 2.0, track.dcaZ()); - aHelium4_reg.fill(HIST("histTpcSignalData"), momentum * 2.0, track.tpcSignal()); + aHelium4_reg.fill(HIST("histTpcSignalData"), momentum_Z_equal_2, track.tpcSignal()); aHelium4_reg.fill(HIST("histNClusterTPC"), track.pt() * 2.0, track.tpcNClsFound()); aHelium4_reg.fill(HIST("histNClusterITS"), track.pt() * 2.0, track.itsNCls()); aHelium4_reg.fill(HIST("histNClusterITSib"), track.pt() * 2.0, track.itsNClsInnerBarrel()); @@ -799,16 +1103,38 @@ struct NucleiHistTask { aHelium4_reg.fill(HIST("histChi2ITS"), track.pt() * 2.0, track.itsChi2NCl()); if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } Float_t TOFmass2 = ((track.mass()) * (track.mass())); Float_t beta = track.beta(); - aHelium4_reg.fill(HIST("histTOFm2"), momentum * 2.0, TOFmass2); - aHelium4_reg.fill(HIST("histTofSignalData"), momentum * 2.0, beta); - aHelium4_reg.fill(HIST("histTofNsigmaData"), momentum * 2.0, track.tofNSigmaAl()); + aHelium4_reg.fill(HIST("histTOFm2"), momentum_Z_equal_2, TOFmass2); + aHelium4_reg.fill(HIST("histTofSignalData"), momentum_Z_equal_2, beta); + aHelium4_reg.fill(HIST("histTofNsigmaData"), momentum_Z_equal_2, track.tofNSigmaAl()); } } if (track.hasTOF()) { - spectra_reg.fill(HIST("histTofSignalData"), momentum * 2.0 * track.sign(), track.beta()); + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } + spectra_reg.fill(HIST("histTofSignalData"), momentum_Z_equal_2 * track.sign(), track.beta()); } } } @@ -862,7 +1188,25 @@ struct NucleiHistTask { float Chi2perClusterTPC = track.tpcChi2NCl(); float Chi2perClusterITS = track.itsChi2NCl(); - if (TPCnumberClsFound < minTPCnClsFound || TPC_nCls_Crossed_Rows < minNCrossedRowsTPC || RatioCrossedRowsOverFindableTPC < minRatioCrossedRowsTPC || RatioCrossedRowsOverFindableTPC > maxRatioCrossedRowsTPC || Chi2perClusterTPC > maxChi2TPC || Chi2perClusterITS > maxChi2ITS || !(track.passedTPCRefit()) || !(track.passedITSRefit()) || (track.itsNClsInnerBarrel()) < minReqClusterITSib || (track.itsNCls()) < minReqClusterITS) + if (TMath::Abs(track.dcaXY()) > maxDCA_XY || TMath::Abs(track.dcaZ()) > maxDCA_Z) + continue; + if (TPCnumberClsFound < minTPCnClsFound || TPC_nCls_Crossed_Rows < minNCrossedRowsTPC) + continue; + if (RatioCrossedRowsOverFindableTPC < minRatioCrossedRowsTPC || RatioCrossedRowsOverFindableTPC > maxRatioCrossedRowsTPC) + continue; + if (Chi2perClusterTPC > maxChi2PerClusterTPC || Chi2perClusterTPC < minChi2PerClusterTPC || Chi2perClusterITS > maxChi2PerClusterITS) + continue; + if (!(track.passedTPCRefit())) + continue; + if (!(track.passedITSRefit())) + continue; + if ((track.itsNClsInnerBarrel()) < minReqClusterITSib || (track.itsNCls()) < minReqClusterITS) + continue; + if (track.pt() < p_min || track.pt() > p_max) + continue; + if ((requireITS && !(track.hasITS())) || (requireTPC && !(track.hasTPC()))) + continue; + if (requireGoldenChi2 && !(track.passedGoldenChi2())) continue; TLorentzVector lorentzVector_pion{}; @@ -906,6 +1250,17 @@ struct NucleiHistTask { } if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } pion_reg.fill(HIST("histTofNsigmaData_cent"), momentum, track.tofNSigmaPi(), event.centFT0C()); proton_reg.fill(HIST("histTofNsigmaData_cent"), momentum, track.tofNSigmaPr(), event.centFT0C()); deuteron_reg.fill(HIST("histTofNsigmaData_cent"), momentum, track.tofNSigmaDe(), event.centFT0C()); @@ -956,6 +1311,17 @@ struct NucleiHistTask { } if (track.hasTOF()) { + if (track.hasTRD() && (lastRequiredTrdCluster > 0)) { + int lastLayer = 0; + for (int l = 7; l >= 0; l--) { + if (track.trdPattern() & (1 << l)) { + lastLayer = l; + break; + } + } + if (lastLayer < lastRequiredTrdCluster) + continue; + } apion_reg.fill(HIST("histTofNsigmaData_cent"), momentum, track.tofNSigmaPi(), event.centFT0C()); aproton_reg.fill(HIST("histTofNsigmaData_cent"), momentum, track.tofNSigmaPr(), event.centFT0C()); adeuteron_reg.fill(HIST("histTofNsigmaData_cent"), momentum, track.tofNSigmaDe(), event.centFT0C()); @@ -1023,9 +1389,11 @@ struct NucleiHistTask { MC_recon_reg.fill(HIST("histCentrality"), collisions.centFT0C()); for (auto& track : tracks) { + histTrackcuts_MC->AddBinContent(1); const auto particle = track.mcParticle(); if (!particle.isPhysicalPrimary()) continue; + histTrackcuts_MC->AddBinContent(2); int pdgbin = 0; switch (particle.pdgCode()) { @@ -1133,6 +1501,7 @@ struct NucleiHistTask { lorentzVector_He3.Rapidity() < yMin || lorentzVector_He3.Rapidity() > yMax || lorentzVector_He4.Rapidity() < yMin || lorentzVector_He4.Rapidity() > yMax) continue; + histTrackcuts_MC->AddBinContent(3); MC_recon_reg.fill(HIST("histEta"), track.eta(), pdgbin); @@ -1168,8 +1537,37 @@ struct NucleiHistTask { float Chi2perClusterTPC = track.tpcChi2NCl(); float Chi2perClusterITS = track.itsChi2NCl(); - if (TPCnumberClsFound < minTPCnClsFound || TPC_nCls_Crossed_Rows < minNCrossedRowsTPC || RatioCrossedRowsOverFindableTPC < minRatioCrossedRowsTPC || RatioCrossedRowsOverFindableTPC > maxRatioCrossedRowsTPC || Chi2perClusterTPC > maxChi2TPC || Chi2perClusterITS > maxChi2ITS || !(track.passedTPCRefit()) || !(track.passedITSRefit()) || (track.itsNClsInnerBarrel()) < minReqClusterITSib || (track.itsNCls()) < minReqClusterITS || TMath::Abs(track.dcaXY()) > maxDCA_XY || TMath::Abs(track.dcaZ()) > maxDCA_Z) + if (TMath::Abs(track.dcaXY()) > maxDCA_XY || TMath::Abs(track.dcaZ()) > maxDCA_Z) + continue; + histTrackcuts_MC->AddBinContent(4); + if (TPCnumberClsFound < minTPCnClsFound || TPC_nCls_Crossed_Rows < minNCrossedRowsTPC) + continue; + histTrackcuts_MC->AddBinContent(5); + if (RatioCrossedRowsOverFindableTPC < minRatioCrossedRowsTPC || RatioCrossedRowsOverFindableTPC > maxRatioCrossedRowsTPC) + continue; + histTrackcuts_MC->AddBinContent(6); + if (Chi2perClusterTPC > maxChi2PerClusterTPC || Chi2perClusterTPC < minChi2PerClusterTPC || Chi2perClusterITS > maxChi2PerClusterITS) + continue; + histTrackcuts_MC->AddBinContent(7); + if (!(track.passedTPCRefit())) + continue; + histTrackcuts_MC->AddBinContent(8); + if (!(track.passedITSRefit())) + continue; + histTrackcuts_MC->AddBinContent(9); + if ((track.itsNClsInnerBarrel()) < minReqClusterITSib || (track.itsNCls()) < minReqClusterITS) + continue; + histTrackcuts_MC->AddBinContent(10); + if (track.pt() < p_min || track.pt() > p_max) + continue; + histTrackcuts_MC->AddBinContent(11); + + if ((requireITS && !(track.hasITS())) || (requireTPC && !(track.hasTPC()))) + continue; + histTrackcuts_MC->AddBinContent(12); + if (requireGoldenChi2 && !(track.passedGoldenChi2())) continue; + histTrackcuts_MC->AddBinContent(13); float nSigmaPion = track.tpcNSigmaPi(); float nSigmaProton = track.tpcNSigmaPr(); From 82cf39edb851c3f0925fc6c6d7e4921a982a5ee8 Mon Sep 17 00:00:00 2001 From: zhengqi-w Date: Thu, 21 Nov 2024 17:05:36 +0800 Subject: [PATCH 043/459] [PWGCF] commit the pikpcme code version_1 (#8588) Co-authored-by: ALICE Action Bot --- PWGCF/Tasks/CMakeLists.txt | 5 + PWGCF/Tasks/pidcme.cxx | 498 +++++++++++++++++++++++++++++++++++++ 2 files changed, 503 insertions(+) create mode 100644 PWGCF/Tasks/pidcme.cxx diff --git a/PWGCF/Tasks/CMakeLists.txt b/PWGCF/Tasks/CMakeLists.txt index fdc35cf2ef6..ab3d5edd9e2 100644 --- a/PWGCF/Tasks/CMakeLists.txt +++ b/PWGCF/Tasks/CMakeLists.txt @@ -28,3 +28,8 @@ o2physics_add_dpl_workflow(correlations SOURCES correlations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(pid-cme + SOURCES pidcme.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore + COMPONENT_NAME Analysis) diff --git a/PWGCF/Tasks/pidcme.cxx b/PWGCF/Tasks/pidcme.cxx new file mode 100644 index 00000000000..a776e584f7d --- /dev/null +++ b/PWGCF/Tasks/pidcme.cxx @@ -0,0 +1,498 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// C++/ROOT includes. +#include +#include +#include +#include +#include +#include +#include +#include + +// o2Physics includes. +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/StaticFor.h" + +#include "Common/DataModel/Qvectors.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/Centrality.h" +#include "Common/Core/EventPlaneHelper.h" +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/PIDResponse.h" + +#include "CommonConstants/PhysicsConstants.h" + +// o2 includes. + +using namespace o2; +using namespace o2::framework; + +using MyCollisions = soa::Join; +using MyTracks = soa::Join; + +struct pidcme { + HistogramRegistry histosQA{"histosQA", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Configurable> cfgnMods{"cfgnMods", {2}, "Modulation of interest"}; + Configurable cfgDetName{"cfgDetName", "FT0C", "The name of detector to be analyzed"}; + Configurable cfgRefAName{"cfgRefAName", "TPCpos", "The name of detector for reference A"}; + Configurable cfgRefBName{"cfgRefBName", "TPCneg", "The name of detector for reference B"}; + + Configurable cfgnTotalSystem{"cfgnTotalSystem", 7, "total qvector number"}; + + Configurable cfgMinPt{"cfgMinPt", 0.15, "Minimum transverse momentum for charged track"}; + Configurable cfgMaxEta{"cfgMaxEta", 0.8, "Maximum pseudorapidiy for charged track"}; + Configurable cfgMaxDCArToPVcut{"cfgMaxDCArToPVcut", 0.1, "Maximum transverse DCA"}; + Configurable cfgMaxDCAzToPVcut{"cfgMaxDCAzToPVcut", 1.0, "Maximum longitudinal DCA"}; + + Configurable cfgnSigmaCutTPCPi{"cfgnSigmaCutTPCPi", 3.0, "Value of the TPC Nsigma cut for pions"}; + Configurable cfgnSigmaCutTPCKa{"cfgnSigmaCutTPCKa", 3.0, "Value of the TPC Nsigma cut for kaons"}; + Configurable cfgnSigmaCutTPCPr{"cfgnSigmaCutTPCPr", 3.0, "Value of the TPC Nsigma cut for protons"}; + Configurable cfgnSigmaCutTOFPi{"cfgnSigmaCutTOFPi", 3.0, "Value of the TOF Nsigma cut for pions"}; + Configurable cfgnSigmaCutTOFKa{"cfgnSigmaCutTOFKa", 3.0, "Value of the TOF Nsigma cut for kaons"}; + Configurable cfgnSigmaCutTOFPr{"cfgnSigmaCutTOFPr", 3.0, "Value of the TOF Nsigma cut for protons"}; + Configurable cfgnSigmaCutCombine{"cfgnSigmaCutCombine", 3.0, "Value of the Combined Nsigma cut"}; + + ConfigurableAxis cfgaxisQvecF{"cfgaxisQvecF", {300, -1, 1}, ""}; + ConfigurableAxis cfgaxisQvec{"cfgaxisQvec", {100, -3, 3}, ""}; + ConfigurableAxis cfgaxisCent{"cfgaxisCent", {100, 0, 100}, ""}; + + ConfigurableAxis cfgaxiscos{"cfgaxiscos", {102, -1.02, 1.02}, ""}; + ConfigurableAxis cfgaxispt{"cfgaxispt", {100, 0, 10}, ""}; + ConfigurableAxis cfgaxisCentMerged{"cfgaxisCentMerged", {20, 0, 100}, ""}; + + ConfigurableAxis cfgrigidityBins{"cfgrigidityBins", {200, -10.f, 10.f}, "Binning for rigidity #it{p}^{TPC}/#it{z}"}; + ConfigurableAxis cfgdedxBins{"cfgdedxBins", {1000, 0.f, 1000.f}, "Binning for dE/dx"}; + ConfigurableAxis cfgnSigmaBins{"cfgnSigmaBins", {200, -5.f, 5.f}, "Binning for n sigma"}; + + ConfigurableAxis cfgaxissumpt{"cfgaxissumpt", {7, 1, 8}, "Binning for #gamma and #delta pt(particle1 + particle2)"}; + ConfigurableAxis cfgaxisdeltaeta{"cfgaxisdeltaeta", {5, 0, 1}, "Binning for #gamma and #delta |#eta(particle1 - particle2)|"}; + + Configurable onlyTOF{"onlyTOF", false, "only TOF tracks"}; + Configurable onlyTOFHIT{"onlyTOFHIT", false, "accept only TOF hit tracks at high pt"}; + Configurable OpenCME = {"cfgkOpeanCME", false, "open PID CME"}; + bool onlyTPC = true; + + EventPlaneHelper helperEP; + + int DetId; + int RefAId; + int RefBId; + + template + int GetDetId(const T& name) + { + if (name.value == "BPos" || name.value == "BNeg" || name.value == "BTot") { + LOGF(warning, "Using deprecated label: %s. Please use TPCpos, TPCneg, TPCall instead.", name.value); + } + if (name.value == "FT0C") { + return 0; + } else if (name.value == "FT0A") { + return 1; + } else if (name.value == "FT0M") { + return 2; + } else if (name.value == "FV0A") { + return 3; + } else if (name.value == "TPCpos" || name.value == "BPos") { + return 4; + } else if (name.value == "TPCneg" || name.value == "BNeg") { + return 5; + } else if (name.value == "TPCall" || name.value == "BTot") { + return 6; + } else { + return 0; + } + } + + void init(InitContext const&) + { + + DetId = GetDetId(cfgDetName); + RefAId = GetDetId(cfgRefAName); + RefBId = GetDetId(cfgRefBName); + + if (DetId == RefAId || DetId == RefBId || RefAId == RefBId) { + LOGF(info, "Wrong detector configuration \n The FT0C will be used to get Q-Vector \n The TPCpos and TPCneg will be used as reference systems"); + DetId = 0; + RefAId = 4; + RefBId = 5; + } + + AxisSpec axisCent{cfgaxisCent, "centrality"}; + AxisSpec axisQvec{cfgaxisQvec, "Q"}; + AxisSpec axisQvecF{cfgaxisQvecF, "Q"}; + AxisSpec axisEvtPl = {100, -1.0 * constants::math::PI, constants::math::PI}; + + AxisSpec axisCos{cfgaxiscos, "angle function"}; + AxisSpec axisPt{cfgaxispt, "trasverse momentum"}; + AxisSpec axisCentMerged{cfgaxisCentMerged, "merged centrality"}; + + AxisSpec axisRigidity{cfgrigidityBins, "#it{p}^{TPC}/#it{z}"}; + AxisSpec axisdEdx{cfgdedxBins, "d#it{E}/d#it{x}"}; + AxisSpec axisnSigma{cfgnSigmaBins, "n_{#sigma}({}^{3}He)"}; + + AxisSpec axissumpt{cfgaxissumpt, "#it{p}_{T}^{sum}}"}; + AxisSpec axisdeltaeta{cfgaxisdeltaeta, "#Delta#eta"}; + AxisSpec axisvertexz = {100, -15., 15., "vrtx_{Z} [cm]"}; + + histosQA.add(Form("QA/histEventCount"), "", {HistType::kTH1F, {{2, 0.0, 2.0}}}); + histosQA.get(HIST("QA/histEventCount"))->GetXaxis()->SetBinLabel(1, "Not selected events"); + histosQA.get(HIST("QA/histEventCount"))->GetXaxis()->SetBinLabel(2, "Selected events"); + histosQA.add(Form("QA/histVertexZRec"), "", {HistType::kTH1F, {axisvertexz}}); + histosQA.add(Form("QA/histCentrality"), "", {HistType::kTH1F, {axisCent}}); + histosQA.add(Form("QA/histQvec_CorrL0_V2"), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}}); + histosQA.add(Form("QA/histQvec_CorrL1_V2"), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}}); + histosQA.add(Form("QA/histQvec_CorrL2_V2"), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}}); + histosQA.add(Form("QA/histQvec_CorrL3_V2"), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}}); + histosQA.add(Form("QA/histEvtPl_CorrL0_V2"), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); + histosQA.add(Form("QA/histEvtPl_CorrL1_V2"), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); + histosQA.add(Form("QA/histEvtPl_CorrL2_V2"), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); + histosQA.add(Form("QA/histEvtPl_CorrL3_V2"), "", {HistType::kTH2F, {axisEvtPl, axisCent}}); + histosQA.add(Form("QA/histQvecRes_SigRefAV2"), "", {HistType::kTH2F, {axisQvecF, axisCent}}); + histosQA.add(Form("QA/histQvecRes_SigRefBV2"), "", {HistType::kTH2F, {axisQvecF, axisCent}}); + histosQA.add(Form("QA/histQvecRes_RefARefBV2"), "", {HistType::kTH2F, {axisQvecF, axisCent}}); + + histosQA.add(Form("QA/PID/histdEdxTPC_All"), "", {HistType::kTH2F, {axisRigidity, axisdEdx}}); + histosQA.add(Form("QA/PID/histdEdxTPC_Pi"), "", {HistType::kTH2F, {axisRigidity, axisdEdx}}); + histosQA.add(Form("QA/PID/histnSigma_Pi"), "", {HistType::kTH1F, {axisnSigma}}); + histosQA.add(Form("QA/PID/histdEdxTPC_Ka"), "", {HistType::kTH2F, {axisRigidity, axisdEdx}}); + histosQA.add(Form("QA/PID/histnSigma_Ka"), "", {HistType::kTH1F, {axisnSigma}}); + histosQA.add(Form("QA/PID/histdEdxTPC_Pr"), "", {HistType::kTH2F, {axisRigidity, axisdEdx}}); + histosQA.add(Form("QA/PID/histnSigma_Pr"), "", {HistType::kTH1F, {axisnSigma}}); + + histosQA.add(Form("V2/histCosDetV2"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); + histosQA.add(Form("V2/histSinDetV2"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); + + histosQA.add(Form("V2/PID/histCosDetV2_Pi"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); + histosQA.add(Form("V2/PID/histCosDetV2_Ka"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); + histosQA.add(Form("V2/PID/histCosDetV2_Pr"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); + histosQA.add(Form("V2/PID/histCosDetV2_Pi_Neg"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); + histosQA.add(Form("V2/PID/histCosDetV2_Ka_Neg"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); + histosQA.add(Form("V2/PID/histCosDetV2_Pr_Neg"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); + + if (OpenCME) { + histosQA.add(Form("PIDCME/histgamama_PiKa_ss"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/histgamama_PiKa_os"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/histgamama_PiPr_ss"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/histgamama_PiPr_os"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/histgamama_KaPr_ss"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/histgamama_KaPr_os"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + + histosQA.add(Form("PIDCME/histdelta_PiKa_ss"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/histdelta_PiKa_os"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/histdelta_PiPr_ss"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/histdelta_PiPr_os"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/histdelta_KaPr_ss"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/histdelta_KaPr_os"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + } + } + + template + bool SelEvent(const CollType& collision) + { + if (!collision.sel8()) { + return 0; + } + if (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + return 0; + } + if (!collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { + return 0; + } + if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + return 0; + } + if (std::abs(collision.posZ()) > 10.) { + return 0; + } + + return 1; + } + + template + bool SelTrack(const TrackType track) + { + if (track.pt() < cfgMinPt) + return false; + if (std::abs(track.eta()) > cfgMaxEta) + return false; + if (!track.passedITSNCls()) + return false; + if (!track.passedITSChi2NDF()) + return false; + if (!track.passedITSHits()) + return false; + if (!track.passedTPCCrossedRowsOverNCls()) + return false; + if (!track.passedTPCChi2NDF()) + return false; + if (!track.passedDCAxy()) + return false; + if (!track.passedDCAz()) + return false; + + return true; + } + + template + bool selectionPID(const T& candidate, int PID) + { + if (candidate.pt() > 0.4) { + onlyTPC = false; + } + + if (PID == 0) { + if (onlyTOF) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < cfgnSigmaCutTOFPi) { + return true; + } + } else if (onlyTOFHIT) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < cfgnSigmaCutTOFPi) { + return true; + } + if (!candidate.hasTOF() && + std::abs(candidate.tpcNSigmaPi()) < cfgnSigmaCutTPCPi) { + return true; + } + } else if (onlyTPC) { + if (std::abs(candidate.tpcNSigmaPi()) < cfgnSigmaCutTPCPi) { + return true; + } + } else { + if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (cfgnSigmaCutCombine * cfgnSigmaCutCombine)) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < cfgnSigmaCutTPCPi) { + return true; + } + } + } else if (PID == 1) { + if (onlyTOF) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < cfgnSigmaCutTOFKa) { + return true; + } + } else if (onlyTOFHIT) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < cfgnSigmaCutTOFKa) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < cfgnSigmaCutTPCPi) { + return true; + } + } else if (onlyTPC) { + if (std::abs(candidate.tpcNSigmaKa()) < cfgnSigmaCutTPCPi) { + return true; + } + } else { + if (candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (cfgnSigmaCutCombine * cfgnSigmaCutCombine)) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < cfgnSigmaCutTPCPi) { + return true; + } + } + } else if (PID == 2) { + if (onlyTOF) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOFPr) { + return true; + } + } else if (onlyTOFHIT) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOFPr) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPCPr) { + return true; + } + } else if (onlyTPC) { + if (std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPCPr) { + return true; + } + } else { + if (candidate.hasTOF() && (candidate.tofNSigmaPr() * candidate.tofNSigmaPr() + candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr()) < (cfgnSigmaCutCombine * cfgnSigmaCutCombine)) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPCPr) { + return true; + } + } + } + return false; + } + + template + void fillHistosQvec(const CollType& collision, int nmode) + { + int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + int RefAInd = RefAId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + int RefBInd = RefBId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + if (nmode == 2) { + if (collision.qvecAmp()[DetId] > 1e-8) { + histosQA.fill(HIST("QA/histQvec_CorrL0_V2"), collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], collision.centFT0C()); + histosQA.fill(HIST("QA/histQvec_CorrL1_V2"), collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], collision.centFT0C()); + histosQA.fill(HIST("QA/histQvec_CorrL2_V2"), collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], collision.centFT0C()); + histosQA.fill(HIST("QA/histQvec_CorrL3_V2"), collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], collision.centFT0C()); + histosQA.fill(HIST("QA/histEvtPl_CorrL0_V2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode), collision.centFT0C()); + histosQA.fill(HIST("QA/histEvtPl_CorrL1_V2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], nmode), collision.centFT0C()); + histosQA.fill(HIST("QA/histEvtPl_CorrL2_V2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], nmode), collision.centFT0C()); + histosQA.fill(HIST("QA/histEvtPl_CorrL3_V2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), collision.centFT0C()); + } + if (collision.qvecAmp()[DetId] > 1e-8 && collision.qvecAmp()[RefAId] > 1e-8 && collision.qvecAmp()[RefBId] > 1e-8) { + histosQA.fill(HIST("QA/histQvecRes_SigRefAV2"), helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[RefAInd + 3], collision.qvecIm()[RefAInd + 3], nmode), nmode), collision.centFT0C()); + histosQA.fill(HIST("QA/histQvecRes_SigRefBV2"), helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[RefBInd + 3], collision.qvecIm()[RefBInd + 3], nmode), nmode), collision.centFT0C()); + histosQA.fill(HIST("QA/histQvecRes_RefARefBV2"), helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[RefAInd + 3], collision.qvecIm()[RefAInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[RefBInd + 3], collision.qvecIm()[RefBInd + 3], nmode), nmode), collision.centFT0C()); + } + } + } + + template + void fillHistosFlow_gamma_delta(const CollType& collision, const TrackType& track, int nmode) + { + if (collision.qvecAmp()[DetId] < 1e-8) { + return; + } + int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + bool kisPi = false, kisKa = false, kisPr = false; + bool kisPi_2 = false, kisKa_2 = false, kisPr_2 = false; + float Psi_n = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); + for (auto& trk : track) { + histosQA.fill(HIST("QA/PID/histdEdxTPC_All"), trk.sign() * trk.tpcInnerParam(), trk.tpcSignal()); + if (!SelTrack(trk)) { + continue; + } + kisPi = selectionPID(trk, 0); + kisKa = selectionPID(trk, 1); + kisPr = selectionPID(trk, 2); + if (kisPi) { + histosQA.fill(HIST("QA/PID/histdEdxTPC_Pi"), trk.sign() * trk.tpcInnerParam(), trk.tpcSignal()); + histosQA.fill(HIST("QA/PID/histnSigma_Pi"), trk.tpcNSigmaPi()); + } + if (kisKa) { + histosQA.fill(HIST("QA/PID/histdEdxTPC_Ka"), trk.sign() * trk.tpcInnerParam(), trk.tpcSignal()); + histosQA.fill(HIST("QA/PID/histnSigma_Ka"), trk.tpcNSigmaKa()); + } + if (kisPr) { + histosQA.fill(HIST("QA/PID/histdEdxTPC_Pr"), trk.sign() * trk.tpcInnerParam(), trk.tpcSignal()); + histosQA.fill(HIST("QA/PID/histnSigma_Pr"), trk.tpcNSigmaPr()); + } + if (nmode == 2) { + histosQA.fill(HIST("V2/histSinDetV2"), collision.centFT0C(), trk.pt(), + std::sin(static_cast(nmode) * (trk.phi() - Psi_n))); + histosQA.fill(HIST("V2/histCosDetV2"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + if (kisPi) { + if (trk.sign() > 0) { + histosQA.fill(HIST("V2/PID/histCosDetV2_Pi"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } else if (trk.sign() < 0) { + histosQA.fill(HIST("V2/PID/histCosDetV2_Pi_Neg"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } + } + if (kisKa) { + if (trk.sign() > 0) { + histosQA.fill(HIST("V2/PID/histCosDetV2_Ka"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } else if (trk.sign() < 0) { + histosQA.fill(HIST("V2/PID/histCosDetV2_Ka_Neg"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } + } + if (kisPr) { + if (trk.sign() > 0) { + histosQA.fill(HIST("V2/PID/histCosDetV2_Pr"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } else if (trk.sign() < 0) { + histosQA.fill(HIST("V2/PID/histCosDetV2_Pr_Neg"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } + } + } + if (OpenCME) { + for (auto& trk_2 : track) { + if (trk_2.globalIndex() == trk.globalIndex()) + continue; + if (nmode == 2) { + kisPi_2 = selectionPID(trk_2, 0); + kisKa_2 = selectionPID(trk_2, 1); + kisPr_2 = selectionPID(trk_2, 2); + if (kisPi && kisKa_2) { + if (trk.sign() == trk_2.sign()) { + histosQA.fill(HIST("PIDCME/histgamama_PiKa_ss"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), + std::cos((trk.phi() + trk_2.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histdelta_PiKa_ss"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), + std::cos((trk.phi() - trk_2.phi()))); + } else { + histosQA.fill(HIST("PIDCME/histgamama_PiKa_os"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), + std::cos((trk.phi() + trk_2.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histdelta_PiKa_os"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), + std::cos((trk.phi() - trk_2.phi()))); + } + } + if (kisPi && kisPr_2) { + if (trk.sign() == trk_2.sign()) { + histosQA.fill(HIST("PIDCME/histgamama_PiPr_ss"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), + std::cos((trk.phi() + trk_2.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histdelta_PiPr_ss"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), + std::cos((trk.phi() - trk_2.phi()))); + } else { + histosQA.fill(HIST("PIDCME/histgamama_PiPr_os"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), + std::cos((trk.phi() + trk_2.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histdelta_PiPr_os"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), + std::cos((trk.phi() - trk_2.phi()))); + } + } + if (kisKa && kisPr_2) { + if (trk.sign() == trk_2.sign()) { + histosQA.fill(HIST("PIDCME/histgamama_KaPr_ss"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), + std::cos((trk.phi() + trk_2.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histdelta_KaPr_ss"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), + std::cos((trk.phi() - trk_2.phi()))); + } else { + histosQA.fill(HIST("PIDCME/histgamama_KaPr_os"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), + std::cos((trk.phi() + trk_2.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histdelta_KaPr_os"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), + std::cos((trk.phi() - trk_2.phi()))); + } + } + } + } + } + } + } + + void process(MyCollisions::iterator const& collision, MyTracks const& tracks) + { + histosQA.fill(HIST("QA/histEventCount"), 0.5); + if (!SelEvent(collision)) { + return; + } + histosQA.fill(HIST("QA/histEventCount"), 1.5); + histosQA.fill(HIST("QA/histCentrality"), collision.centFT0C()); + histosQA.fill(HIST("QA/histVertexZRec"), collision.posZ()); + for (auto i = 0; i < static_cast(cfgnMods->size()); i++) { + fillHistosQvec(collision, cfgnMods->at(i)); + fillHistosFlow_gamma_delta(collision, tracks, cfgnMods->at(i)); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From f14dc761ffc68c50ddbbeae5c0f607689585e028 Mon Sep 17 00:00:00 2001 From: nepeivodaRS <94179174+nepeivodaRS@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:06:38 +0100 Subject: [PATCH 044/459] [PWGLF] add rapidity and gap axes to histograms in UPC analysis (#8575) Co-authored-by: ALICE Action Bot --- .../Tasks/Strangeness/strange-yield-pbpb.cxx | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/strange-yield-pbpb.cxx b/PWGLF/Tasks/Strangeness/strange-yield-pbpb.cxx index 6e5cd33540c..7706fe720bb 100644 --- a/PWGLF/Tasks/Strangeness/strange-yield-pbpb.cxx +++ b/PWGLF/Tasks/Strangeness/strange-yield-pbpb.cxx @@ -350,11 +350,11 @@ struct strangeYieldPbPb { void addKinematicQAHistograms(HistogramRegistry& histos) { const bool isCascade = (partID > 2.5) ? true : false; - histos.add(Form("%s/h2dPosEtaPt", particlenames[partID].data()), "h2dPosEtaPt", kTH3F, {axisPtCoarse, axisEta, axisSelGap}); - histos.add(Form("%s/h2dNegEtaPt", particlenames[partID].data()), "h2dNegEtaPt", kTH3F, {axisPtCoarse, axisEta, axisSelGap}); - histos.add(Form("%s/h2dRapPt", particlenames[partID].data()), "h2dRapPt", kTH3F, {axisPtCoarse, axisRap, axisSelGap}); + histos.add(Form("%s/h3dPosEtaPt", particlenames[partID].data()), "h3dPosEtaPt", kTH3F, {axisPtCoarse, axisEta, axisSelGap}); + histos.add(Form("%s/h3dNegEtaPt", particlenames[partID].data()), "h3dNegEtaPt", kTH3F, {axisPtCoarse, axisEta, axisSelGap}); + histos.add(Form("%s/h3dRapPt", particlenames[partID].data()), "h3dRapPt", kTH3F, {axisPtCoarse, axisRap, axisSelGap}); if (isCascade) { - histos.add(Form("%s/h2dBachEtaPt", particlenames[partID].data()), "h2dBachEtaPt", kTH3F, {axisPtCoarse, axisEta, axisSelGap}); + histos.add(Form("%s/h3dBachEtaPt", particlenames[partID].data()), "h3dBachEtaPt", kTH3F, {axisPtCoarse, axisEta, axisSelGap}); } } @@ -387,7 +387,7 @@ struct strangeYieldPbPb { template void addHistograms(HistogramRegistry& histos) { - histos.add(Form("%s/h5dMass", particlenames[partID].data()), "h5dMass", kTHnSparseF, {axisFT0C, axisPt, axisInvMass.at(partID), axisSelGap, axisNchInvMass}); + histos.add(Form("%s/h6dMass", particlenames[partID].data()), "h6dMass", kTHnSparseF, {axisFT0C, axisPt, axisInvMass.at(partID), axisSelGap, axisNchInvMass, axisRap}); histos.add(Form("%s/h2dMass", particlenames[partID].data()), "h2dMass", kTH2F, {axisInvMass.at(partID), axisSelGap}); if (doPlainTopoQA) { addTopoHistograms(histos); @@ -474,11 +474,11 @@ struct strangeYieldPbPb { } histos.fill(HIST(particlenames[partID]) + HIST("/h2dMass"), invMass, gap); - histos.fill(HIST(particlenames[partID]) + HIST("/h5dMass"), centrality, pT, invMass, gap, coll.multAllTracksTPCOnly() + coll.multAllTracksITSTPC()); + histos.fill(HIST(particlenames[partID]) + HIST("/h6dMass"), centrality, pT, invMass, gap, coll.multAllTracksTPCOnly() + coll.multAllTracksITSTPC(), rapidity); if (doKienmaticQA) { - histos.fill(HIST(particlenames[partID]) + HIST("/h2dPosEtaPt"), pT, cand.positiveeta(), gap); - histos.fill(HIST(particlenames[partID]) + HIST("/h2dNegEtaPt"), pT, cand.negativeeta(), gap); - histos.fill(HIST(particlenames[partID]) + HIST("/h2dRapPt"), pT, rapidity, gap); + histos.fill(HIST(particlenames[partID]) + HIST("/h3dPosEtaPt"), pT, cand.positiveeta(), gap); + histos.fill(HIST(particlenames[partID]) + HIST("/h3dNegEtaPt"), pT, cand.negativeeta(), gap); + histos.fill(HIST(particlenames[partID]) + HIST("/h3dRapPt"), pT, rapidity, gap); } if (doPlainTopoQA) { histos.fill(HIST(particlenames[partID]) + HIST("/hPosDCAToPV"), cand.dcapostopv()); @@ -624,12 +624,12 @@ struct strangeYieldPbPb { } } histos.fill(HIST(particlenames[partID]) + HIST("/h2dMass"), invMass, gap); - histos.fill(HIST(particlenames[partID]) + HIST("/h5dMass"), centrality, pT, invMass, gap, coll.multAllTracksTPCOnly() + coll.multAllTracksITSTPC()); + histos.fill(HIST(particlenames[partID]) + HIST("/h6dMass"), centrality, pT, invMass, gap, coll.multAllTracksTPCOnly() + coll.multAllTracksITSTPC(), rapidity); if (doKienmaticQA) { - histos.fill(HIST(particlenames[partID]) + HIST("/h2dPosEtaPt"), pT, cand.positiveeta(), gap); - histos.fill(HIST(particlenames[partID]) + HIST("/h2dNegEtaPt"), pT, cand.negativeeta(), gap); - histos.fill(HIST(particlenames[partID]) + HIST("/h2dBachEtaPt"), pT, cand.bacheloreta(), gap); - histos.fill(HIST(particlenames[partID]) + HIST("/h2dRapPt"), pT, rapidity, gap); + histos.fill(HIST(particlenames[partID]) + HIST("/h3dPosEtaPt"), pT, cand.positiveeta(), gap); + histos.fill(HIST(particlenames[partID]) + HIST("/h3dNegEtaPt"), pT, cand.negativeeta(), gap); + histos.fill(HIST(particlenames[partID]) + HIST("/h3dBachEtaPt"), pT, cand.bacheloreta(), gap); + histos.fill(HIST(particlenames[partID]) + HIST("/h3dRapPt"), pT, rapidity, gap); } if (doPlainTopoQA) { histos.fill(HIST(particlenames[partID]) + HIST("/hCascCosPA"), pT, cand.casccosPA(coll.posX(), coll.posY(), coll.posZ())); @@ -842,18 +842,18 @@ struct strangeYieldPbPb { histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(16, "has UPC flag"); // Event QA - histos.add("eventQA/hCentrality", "hCentrality", kTH1F, {axisFT0C_QA}); - histos.add("eventQA/hCentralityVsTracksPVeta1", "hCentralityVsTracksPVeta1", kTH2F, {axisFT0C_QA, axisNTracksPVeta1}); - histos.add("eventQA/hCentralityVsTracksTotalExceptITSonly", "hCentralityVsTracksTotalExceptITSonly", kTH2F, {axisFT0C_QA, axisNTracksTotalExceptITSonly}); - histos.add("eventQA/hOccupancy", "hOccupancy", kTH1F, {axisOccupancy}); - histos.add("eventQA/hCentralityVsOccupancy", "hCentralityVsOccupancy", kTH2F, {axisFT0C_QA, axisOccupancy}); - histos.add("eventQA/hTracksPVeta1VsTracksGlobal", "hTracksPVeta1VsTracksGlobal", kTH2F, {axisNTracksPVeta1, axisNTracksGlobal}); - histos.add("eventQA/hCentralityVsTracksGlobal", "hCentralityVsTracksGlobal", kTH2F, {axisFT0C_QA, axisNTracksGlobal}); + histos.add("eventQA/hCentrality", "hCentrality", kTH2F, {axisFT0C_QA, axisSelGap}); + histos.add("eventQA/hCentralityVsTracksPVeta1", "hCentralityVsTracksPVeta1", kTH3F, {axisFT0C_QA, axisNTracksPVeta1, axisSelGap}); + histos.add("eventQA/hCentralityVsTracksTotalExceptITSonly", "hCentralityVsTracksTotalExceptITSonly", kTH3F, {axisFT0C_QA, axisNTracksTotalExceptITSonly, axisSelGap}); + histos.add("eventQA/hOccupancy", "hOccupancy", kTH2F, {axisOccupancy, axisSelGap}); + histos.add("eventQA/hCentralityVsOccupancy", "hCentralityVsOccupancy", kTH3F, {axisFT0C_QA, axisOccupancy, axisSelGap}); + histos.add("eventQA/hTracksPVeta1VsTracksGlobal", "hTracksPVeta1VsTracksGlobal", kTH3F, {axisNTracksPVeta1, axisNTracksGlobal, axisSelGap}); + histos.add("eventQA/hCentralityVsTracksGlobal", "hCentralityVsTracksGlobal", kTH3F, {axisFT0C_QA, axisNTracksGlobal, axisSelGap}); histos.add("eventQA/hGapSide", "Gap side; Entries", kTH1F, {{5, -0.5, 4.5}}); histos.add("eventQA/hSelGapSide", "Selected gap side; Entries", kTH1F, {axisSelGap}); - histos.add("eventQA/hPosX", "Vertex position in x", kTH1F, {{100, -0.1, 0.1}}); - histos.add("eventQA/hPosY", "Vertex position in y", kTH1F, {{100, -0.1, 0.1}}); - histos.add("eventQA/hPosZ", "Vertex position in z", kTH1F, {{100, -20., 20.}}); + histos.add("eventQA/hPosX", "Vertex position in x", kTH2F, {{100, -0.1, 0.1}, axisSelGap}); + histos.add("eventQA/hPosY", "Vertex position in y", kTH2F, {{100, -0.1, 0.1}, axisSelGap}); + histos.add("eventQA/hPosZ", "Vertex position in z", kTH2F, {{100, -20., 20.}, axisSelGap}); histos.add("eventQA/hFT0", "hFT0", kTH3F, {axisDetectors.axisFT0Aampl, axisDetectors.axisFT0Campl, axisSelGap}); histos.add("eventQA/hFDD", "hFDD", kTH3F, {axisDetectors.axisFDDAampl, axisDetectors.axisFDDCampl, axisSelGap}); histos.add("eventQA/hZN", "hZN", kTH3F, {axisDetectors.axisZNAampl, axisDetectors.axisZNCampl, axisSelGap}); @@ -954,20 +954,20 @@ struct strangeYieldPbPb { } template - void fillHistogramsQA(TCollision const& collision) + void fillHistogramsQA(TCollision const& collision, int const& gap) { // QA histograms float centrality = collision.centFT0C(); - histos.fill(HIST("eventQA/hCentrality"), centrality); - histos.fill(HIST("eventQA/hCentralityVsTracksTotalExceptITSonly"), centrality, collision.multAllTracksTPCOnly() + collision.multAllTracksITSTPC()); - histos.fill(HIST("eventQA/hCentralityVsTracksPVeta1"), centrality, collision.multNTracksPVeta1()); - histos.fill(HIST("eventQA/hOccupancy"), collision.trackOccupancyInTimeRange()); - histos.fill(HIST("eventQA/hCentralityVsOccupancy"), centrality, collision.trackOccupancyInTimeRange()); - histos.fill(HIST("eventQA/hTracksPVeta1VsTracksGlobal"), collision.multNTracksPVeta1(), collision.multNTracksGlobal()); - histos.fill(HIST("eventQA/hCentralityVsTracksGlobal"), centrality, collision.multNTracksGlobal()); - histos.fill(HIST("eventQA/hPosX"), collision.posX()); - histos.fill(HIST("eventQA/hPosY"), collision.posY()); - histos.fill(HIST("eventQA/hPosZ"), collision.posZ()); + histos.fill(HIST("eventQA/hCentrality"), centrality, gap); + histos.fill(HIST("eventQA/hCentralityVsTracksTotalExceptITSonly"), centrality, collision.multAllTracksTPCOnly() + collision.multAllTracksITSTPC(), gap); + histos.fill(HIST("eventQA/hCentralityVsTracksPVeta1"), centrality, collision.multNTracksPVeta1(), gap); + histos.fill(HIST("eventQA/hOccupancy"), collision.trackOccupancyInTimeRange(), gap); + histos.fill(HIST("eventQA/hCentralityVsOccupancy"), centrality, collision.trackOccupancyInTimeRange(), gap); + histos.fill(HIST("eventQA/hTracksPVeta1VsTracksGlobal"), collision.multNTracksPVeta1(), collision.multNTracksGlobal(), gap); + histos.fill(HIST("eventQA/hCentralityVsTracksGlobal"), centrality, collision.multNTracksGlobal(), gap); + histos.fill(HIST("eventQA/hPosX"), collision.posX(), gap); + histos.fill(HIST("eventQA/hPosY"), collision.posY(), gap); + histos.fill(HIST("eventQA/hPosZ"), collision.posZ(), gap); } template @@ -1523,7 +1523,7 @@ struct strangeYieldPbPb { if (studyUPConly && (selGapSide < -0.5)) return; - fillHistogramsQA(collision); + fillHistogramsQA(collision, selGapSide); for (auto& v0 : fullV0s) { if ((v0.v0Type() != v0cuts.v0TypeSelection) && (v0cuts.v0TypeSelection > 0)) @@ -1549,7 +1549,7 @@ struct strangeYieldPbPb { if (studyUPConly && (selGapSide < -0.5)) return; - fillHistogramsQA(collision); + fillHistogramsQA(collision, selGapSide); for (auto& casc : fullCascades) { std::bitset selMap = computeBitmapCascade(casc, collision); From fc143ea4142c446bc122ee13db9c04196f30b422 Mon Sep 17 00:00:00 2001 From: thakurd3 Date: Thu, 21 Nov 2024 10:08:56 +0100 Subject: [PATCH 045/459] [PWGDQ] Change of binning of Psi_FT0C Histograms for DQ Flow (#8542) --- PWGDQ/Core/HistogramsLibrary.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 83bd31ab66d..0f358226af7 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -238,9 +238,9 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Psi2A", "", false, 100, -2.0, 2.0, VarManager::kPsi2A); hm->AddHistogram(histClass, "Psi2B", "", false, 100, -2.0, 2.0, VarManager::kPsi2B); hm->AddHistogram(histClass, "Psi2C", "", false, 100, -2.0, 2.0, VarManager::kPsi2C); - hm->AddHistogram(histClass, "Psi2A_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2A); - hm->AddHistogram(histClass, "Psi2B_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2B); - hm->AddHistogram(histClass, "Psi2C_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2C); + hm->AddHistogram(histClass, "Psi2A_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2A); + hm->AddHistogram(histClass, "Psi2B_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2B); + hm->AddHistogram(histClass, "Psi2C_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2C); hm->AddHistogram(histClass, "centrFT0C_Corr2REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REF, VarManager::kM11REF); hm->AddHistogram(histClass, "centrFT0C_Corr2REFetagap_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); hm->AddHistogram(histClass, "centrFT0C_Corr4REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR4REF, VarManager::kM1111REF); From a9948d4ae490c776d310bed9a2e13f024f040d83 Mon Sep 17 00:00:00 2001 From: Francesco Mazzaschi <43742195+fmazzasc@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:34:48 +0100 Subject: [PATCH 046/459] [Common,PWGLF] Fix PID parametrisations and add pid to qa task (#8518) Co-authored-by: Francesco Mazzaschi Co-authored-by: ALICE Action Bot --- Common/DataModel/PIDResponseITS.h | 98 +++++++++++-------- Common/TableProducer/PID/pidITS.cxx | 32 ++++-- .../Nuspex/LFTreeCreatorClusterStudies.cxx | 18 +++- 3 files changed, 98 insertions(+), 50 deletions(-) diff --git a/Common/DataModel/PIDResponseITS.h b/Common/DataModel/PIDResponseITS.h index ab95018c708..44c029fcb75 100644 --- a/Common/DataModel/PIDResponseITS.h +++ b/Common/DataModel/PIDResponseITS.h @@ -14,6 +14,7 @@ /// \since 2024-11-12 /// \author Nicolò Jacazio nicolo.jacazio@cern.ch /// \author Francesco Mazzaschi francesco.mazzaschi@cern.ch +/// \author Giorgio Alberto Lucia giorgio.alberto.lucia@cern.ch /// \brief Set of tables, tasks and utilities to provide the interface between /// the analysis data model and the PID response of the ITS /// @@ -54,19 +55,33 @@ struct ITSResponse { static constexpr float inverseMass = 1. / o2::track::pid_constants::sMasses[id]; static constexpr float charge = static_cast(o2::track::pid_constants::sCharges[id]); const float bg = momentum * inverseMass; - return (mITSRespParams[0] / (std::pow(bg, mITSRespParams[1])) + mITSRespParams[2]) * std::pow(charge, mChargeFactor); + if (id == o2::track::PID::Helium3 || id == o2::track::PID::Alpha) { + return (mITSRespParamsZ2[0] / (std::pow(bg, mITSRespParamsZ2[1])) + mITSRespParamsZ2[2]); + } + return (mITSRespParams[0] / (std::pow(bg, mITSRespParams[1])) + mITSRespParams[2]); + } + + template + static float expResolution(const float momentum) + { + static constexpr float inverseMass = 1. / o2::track::pid_constants::sMasses[id]; + static constexpr float charge = static_cast(o2::track::pid_constants::sCharges[id]); + const float bg = momentum * inverseMass; + float relRes = mResolutionParams[0] * std::erf((bg - mResolutionParams[1]) / mResolutionParams[2]); + return relRes; } template - static float nSigmaITS(uint32_t itsClusterSizes, float momentum) + static float nSigmaITS(uint32_t itsClusterSizes, float momentum, float eta) { const float exp = expSignal(momentum); const float average = averageClusterSize(itsClusterSizes); - const float resolution = mResolution * exp; - return (average - exp) / resolution; + const float coslInv = 1. / std::cosh(eta); + const float resolution = expResolution(momentum) * exp; + return (average * coslInv - exp) / resolution; }; - static void setParameters(float p0, float p1, float p2, float chargeFactor, float resolution) + static void setParameters(float p0, float p1, float p2, float p0_Z2, float p1_Z2, float p2_Z2, float p0_res, float p1_res, float p2_res) { if (mIsInitialized) { LOG(fatal) << "ITSResponse parameters already initialized"; @@ -75,79 +90,84 @@ struct ITSResponse { mITSRespParams[0] = p0; mITSRespParams[1] = p1; mITSRespParams[2] = p2; - mChargeFactor = chargeFactor; - mResolution = resolution; + mITSRespParamsZ2[0] = p0_Z2; + mITSRespParamsZ2[1] = p1_Z2; + mITSRespParamsZ2[2] = p2_Z2; + mResolutionParams[0] = p0_res; + mResolutionParams[1] = p1_res; + mResolutionParams[2] = p2_res; } private: static std::array mITSRespParams; - static float mChargeFactor; - static float mResolution; + static std::array mITSRespParamsZ2; + static std::array mResolutionParams; static bool mIsInitialized; }; -std::array ITSResponse::mITSRespParams = {0.903, 2.014, 2.440}; -float ITSResponse::mChargeFactor = 2.299999952316284f; -float ITSResponse::mResolution = 0.15f; +std::array ITSResponse::mITSRespParams = {1.1576, 1.684, 1.9453}; +std::array ITSResponse::mITSRespParamsZ2 = {2.8752, 1.1246, 5.0259}; +// relative resolution is modelled with an erf function: [0]*TMath::Erf((x-[1])/[2]) +std::array ITSResponse::mResolutionParams = {0.2431, -0.3293, 1.533}; bool ITSResponse::mIsInitialized = false; namespace pidits { DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaElImp, itsNSigmaEl, //! Nsigma separation with the ITS detector for electrons - [](uint32_t itsClusterSizes, float momentum) -> float { - return ITSResponse::nSigmaITS(itsClusterSizes, momentum); + [](uint32_t itsClusterSizes, float momentum, float eta) -> float { + return ITSResponse::nSigmaITS(itsClusterSizes, momentum, eta); }); DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaMuImp, itsNSigmaMu, //! Nsigma separation with the ITS detector for muons - [](uint32_t itsClusterSizes, float momentum) -> float { - return ITSResponse::nSigmaITS(itsClusterSizes, momentum); + [](uint32_t itsClusterSizes, float momentum, float eta) -> float { + return ITSResponse::nSigmaITS(itsClusterSizes, momentum, eta); }); DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaPiImp, itsNSigmaPi, //! Nsigma separation with the ITS detector for pions - [](uint32_t itsClusterSizes, float momentum) -> float { - return ITSResponse::nSigmaITS(itsClusterSizes, momentum); + [](uint32_t itsClusterSizes, float momentum, float eta) -> float { + return ITSResponse::nSigmaITS(itsClusterSizes, momentum, eta); }); DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaKaImp, itsNSigmaKa, //! Nsigma separation with the ITS detector for kaons - [](uint32_t itsClusterSizes, float momentum) -> float { - return ITSResponse::nSigmaITS(itsClusterSizes, momentum); + [](uint32_t itsClusterSizes, float momentum, float eta) -> float { + return ITSResponse::nSigmaITS(itsClusterSizes, momentum, eta); }); DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaPrImp, itsNSigmaPr, //! Nsigma separation with the ITS detector for protons - [](uint32_t itsClusterSizes, float momentum) -> float { - return ITSResponse::nSigmaITS(itsClusterSizes, momentum); + [](uint32_t itsClusterSizes, float momentum, float eta) -> float { + return ITSResponse::nSigmaITS(itsClusterSizes, momentum, eta); }); DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaDeImp, itsNSigmaDe, //! Nsigma separation with the ITS detector for deuterons - [](uint32_t itsClusterSizes, float momentum) -> float { - return ITSResponse::nSigmaITS(itsClusterSizes, momentum); + [](uint32_t itsClusterSizes, float momentum, float eta) -> float { + return ITSResponse::nSigmaITS(itsClusterSizes, momentum, eta); }); DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaTrImp, itsNSigmaTr, //! Nsigma separation with the ITS detector for tritons - [](uint32_t itsClusterSizes, float momentum) -> float { - return ITSResponse::nSigmaITS(itsClusterSizes, momentum); + [](uint32_t itsClusterSizes, float momentum, float eta) -> float { + return ITSResponse::nSigmaITS(itsClusterSizes, momentum, eta); }); DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaHeImp, itsNSigmaHe, //! Nsigma separation with the ITS detector for helium3 - [](uint32_t itsClusterSizes, float momentum) -> float { - return ITSResponse::nSigmaITS(itsClusterSizes, momentum); + [](uint32_t itsClusterSizes, float momentum, float eta) -> float { + return ITSResponse::nSigmaITS(itsClusterSizes, momentum, eta); }); DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaAlImp, itsNSigmaAl, //! Nsigma separation with the ITS detector for alphas - [](uint32_t itsClusterSizes, float momentum) -> float { - return ITSResponse::nSigmaITS(itsClusterSizes, momentum); + [](uint32_t itsClusterSizes, float momentum, float eta) -> float { + return ITSResponse::nSigmaITS(itsClusterSizes, momentum, eta); }); // Define user friendly names for the columns to join with the tracks -using ITSNSigmaEl = ITSNSigmaElImp; -using ITSNSigmaMu = ITSNSigmaMuImp; -using ITSNSigmaPi = ITSNSigmaPiImp; -using ITSNSigmaKa = ITSNSigmaKaImp; -using ITSNSigmaPr = ITSNSigmaPrImp; -using ITSNSigmaDe = ITSNSigmaDeImp; -using ITSNSigmaTr = ITSNSigmaTrImp; -using ITSNSigmaHe = ITSNSigmaHeImp; -using ITSNSigmaAl = ITSNSigmaAlImp; +using ITSNSigmaEl = ITSNSigmaElImp; +using ITSNSigmaMu = ITSNSigmaMuImp; +using ITSNSigmaPi = ITSNSigmaPiImp; +using ITSNSigmaKa = ITSNSigmaKaImp; +using ITSNSigmaPr = ITSNSigmaPrImp; +using ITSNSigmaDe = ITSNSigmaDeImp; +using ITSNSigmaTr = ITSNSigmaTrImp; +using ITSNSigmaHe = ITSNSigmaHeImp; +using ITSNSigmaAl = ITSNSigmaAlImp; } // namespace pidits } // namespace o2::aod diff --git a/Common/TableProducer/PID/pidITS.cxx b/Common/TableProducer/PID/pidITS.cxx index 225108528bf..58ac57984fe 100644 --- a/Common/TableProducer/PID/pidITS.cxx +++ b/Common/TableProducer/PID/pidITS.cxx @@ -14,6 +14,7 @@ /// \since 2024-11-12 /// \author Nicolò Jacazio nicolo.jacazio@cern.ch /// \author Francesco Mazzaschi francesco.mazzaschi@cern.ch +/// \author Giorgio Alberto Lucia giorgio.alberto.lucia@cern.ch /// \brief Task to produce PID tables for ITS split for each particle. /// Only the tables for the mass hypotheses requested are filled, the others are sent empty. /// @@ -42,14 +43,21 @@ using namespace o2::track; MetadataHelper metadataInfo; static constexpr int nCases = 2; -static constexpr int nParameters = 5; +static constexpr int nParameters = 9; static const std::vector casesNames{"Data", "MC"}; -static const std::vector parameterNames{"bb1", "bb2", "bb3", "Charge exponent", "Resolution"}; -static constexpr float defaultParameters[nCases][nParameters]{{0.903, 2.014, 2.440, 2.299999952316284f, 0.15f}, - {0.903, 2.014, 2.440, 2.299999952316284f, 0.15f}}; +static const std::vector parameterNames{"RespITSPar1", "RespITSPar2", "RespITSPar3", + "RespITSPar1_Z2", "RespITSPar2_Z2", "RespITSPar3_Z2", + "ResolutionPar1", "ResolutionPar2", "ResolutionPar3"}; +static constexpr float defaultParameters[nCases][nParameters]{{0.903, 2.014, 2.440, + 2.8752, 1.1246, 5.0259, + 0.2431, -0.3293, 1.533}, + {0.903, 2.014, 2.440, + 2.8752, 1.1246, 5.0259, + 0.2431, -0.3293, 1.533}}; /// Task to produce the ITS PID information for each particle species -/// The parametrization is: [p0/(bg)**p1 + p2] * pow(q, p3), being bg = p/m and q the charge +/// The parametrization is: [p0/(bg)**p1 + p2] being bg = p/m. Different parametrizations are used for He3 and Alpha particles. +/// The resolution depends on the bg and is modelled with an erf function: p0*TMath::Erf((bg-p1)/p2) struct itsPid { Configurable> itsParams{"itsParams", @@ -74,11 +82,15 @@ struct itsPid { LOG(fatal) << "Not implemented yet"; } else { const char* key = metadataInfo.isMC() ? "MC" : "Data"; - o2::aod::ITSResponse::setParameters(itsParams->get(key, "bb1"), - itsParams->get(key, "bb2"), - itsParams->get(key, "bb3"), - itsParams->get(key, "Charge exponent"), - itsParams->get(key, "Resolution")); + o2::aod::ITSResponse::setParameters(itsParams->get(key, "RespITSPar1"), + itsParams->get(key, "RespITSPar2"), + itsParams->get(key, "RespITSPar3"), + itsParams->get(key, "RespITSPar1_Z2"), + itsParams->get(key, "RespITSPar2_Z2"), + itsParams->get(key, "RespITSPar3_Z2"), + itsParams->get(key, "ResolutionPar1"), + itsParams->get(key, "ResolutionPar2"), + itsParams->get(key, "ResolutionPar3")); } } diff --git a/PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx b/PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx index 676572e035d..ca382c8d2be 100644 --- a/PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx +++ b/PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx @@ -45,6 +45,7 @@ #include "Common/TableProducer/PID/pidTOFBase.h" #include "Common/Core/PID/TPCPIDResponse.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/PIDResponseITS.h" #include "DCAFitter/DCAFitterN.h" #include "PWGLF/DataModel/LFClusterStudiesTable.h" @@ -234,6 +235,12 @@ struct LfTreeCreatorClusterStudies { {"nSigmaTOFDe", "nSigma TOF Deuteron; signed #it{p} (GeV/#it{c}); n#sigma_{TOF} d", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {100, -3.0f, 3.0f}}}}, {"TOFmassDe", "TOF mass De; signed #it{p}_{T} (GeV/#it{c}); mass_{TOF} ^{3}He (GeV/#it{c}^2)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {100, 1.0f, 5.0f}}}}, {"TOFmassHe", "TOF mass He3; signed #it{p}_{T} (GeV/#it{c}); mass_{TOF} ^{3}He (GeV/#it{c}^2)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {100, 1.0f, 5.0f}}}}, + {"nSigmaITSEl", "nSigma ITS Electron; signed #it{p} (GeV/#it{c}); n#sigma_{ITS} e", {HistType::kTH2F, {{50, -5.0f, 5.0f}, {60, -2.0f, 2.0f}}}}, + {"nSigmaITSPi", "nSigma ITS Pion; signed #it{p} (GeV/#it{c}); n#sigma_{ITS} #pi", {HistType::kTH2F, {{50, -5.0f, 5.0f}, {60, -3.0f, 3.0f}}}}, + {"nSigmaITSKa", "nSigma ITS Kaon; signed #it{p} (GeV/#it{c}); n#sigma_{ITS} e", {HistType::kTH2F, {{50, -5.0f, 5.0f}, {60, -4.0f, 4.0f}}}}, + {"nSigmaITSPr", "nSigma ITS Proton; signed #it{p} (GeV/#it{c}); n#sigma_{ITS} p", {HistType::kTH2F, {{50, -5.0f, 5.0f}, {60, -3.0f, 3.0f}}}}, + {"nSigmaITSDe", "nSigma ITS Deuteron; signed #it{p} (GeV/#it{c}); n#sigma_{ITS} d", {HistType::kTH2F, {{50, -5.0f, 5.0f}, {100, -3.0f, 3.0f}}}}, + {"nSigmaITSHe", "nSigma ITS He3; signed #it{p} (GeV/#it{c}); n#sigma_{ITS} ^{3}He", {HistType::kTH2F, {{50, -5.0f, 5.0f}, {100, -3.0f, 3.0f}}}}, {"pmatchingEl", "#it{p} matching e; signed #it{p}_{TPC} (GeV/#it{c}); #frac{#it{p}_{TPC} - #it{p}}{#it{p}_{TPC}}", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {100, -0.5f, 0.5f}}}}, {"pmatchingPi", "#it{p} matching #pi; signed #it{p}_{TPC} (GeV/#it{c}); #frac{#it{p}_{TPC} - #it{p}}{#it{p}_{TPC}}", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {100, -0.5f, 0.5f}}}}, {"pmatchingKa", "#it{p} matching K; signed #it{p}_{TPC} (GeV/#it{c}); #frac{#it{p}_{TPC} - #it{p}}{#it{p}_{TPC}}", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {100, -0.5f, 0.5f}}}}, @@ -260,6 +267,7 @@ struct LfTreeCreatorClusterStudies { o2::vertexing::DCAFitterN<2> m_fitter; o2::pid::tof::Beta m_responseBeta; o2::pid::tof::Beta m_responseBetaMc; + o2::aod::ITSResponse m_responseITS; template bool initializeFitter(const T& trackParCovA, const T& trackParCovB) @@ -705,7 +713,9 @@ struct LfTreeCreatorClusterStudies { m_hAnalysis.fill(HIST("massLambda"), std::hypot(momMother[0], momMother[1], momMother[2]), massLambdaV0); m_hAnalysis.fill(HIST("armenteros_plot_lambda"), alphaAP, qtAP); m_hAnalysis.fill(HIST("nSigmaTPCPr"), std::hypot(momPos[0], momPos[1], momPos[2]), posTrack.tpcNSigmaPr()); + m_hAnalysis.fill(HIST("nSigmaITSPr"), std::hypot(momPos[0], momPos[1], momPos[2]), m_responseITS.nSigmaITS(posTrack.itsClusterSizes(), posTrack.p(), posTrack.eta())); m_hAnalysis.fill(HIST("nSigmaTPCPi"), std::hypot(momNeg[0], momNeg[1], momNeg[2]) * -1.f, negTrack.tpcNSigmaPi()); + m_hAnalysis.fill(HIST("nSigmaITSPi"), std::hypot(momNeg[0], momNeg[1], momNeg[2]) * -1.f, m_responseITS.nSigmaITS(negTrack.itsClusterSizes(), negTrack.p(), negTrack.eta())); m_hAnalysis.fill(HIST("pmatchingPr"), posTrack.tpcInnerParam(), (posTrack.tpcInnerParam() - posTrack.p()) / posTrack.tpcInnerParam()); m_hAnalysis.fill(HIST("pmatchingPi"), -negTrack.tpcInnerParam(), (negTrack.tpcInnerParam() - negTrack.p()) / negTrack.tpcInnerParam()); @@ -715,7 +725,9 @@ struct LfTreeCreatorClusterStudies { // "signed" pt for antimatter m_hAnalysis.fill(HIST("armenteros_plot_lambda"), alphaAP, qtAP); m_hAnalysis.fill(HIST("nSigmaTPCPi"), std::hypot(momPos[0], momPos[1], momPos[2]), posTrack.tpcNSigmaPi()); - m_hAnalysis.fill(HIST("nSigmaTPCPi"), std::hypot(momNeg[0], momNeg[1], momNeg[2]) * -1.f, negTrack.tpcNSigmaPr()); + m_hAnalysis.fill(HIST("nSigmaITSPi"), std::hypot(momPos[0], momPos[1], momPos[2]), m_responseITS.nSigmaITS(posTrack.itsClusterSizes(), posTrack.p(), posTrack.eta())); + m_hAnalysis.fill(HIST("nSigmaTPCPr"), std::hypot(momNeg[0], momNeg[1], momNeg[2]) * -1.f, negTrack.tpcNSigmaPr()); + m_hAnalysis.fill(HIST("nSigmaITSPr"), std::hypot(momNeg[0], momNeg[1], momNeg[2]) * -1.f, m_responseITS.nSigmaITS(negTrack.itsClusterSizes(), negTrack.p(), negTrack.eta())); m_hAnalysis.fill(HIST("pmatchingPi"), posTrack.tpcInnerParam(), (posTrack.tpcInnerParam() - posTrack.p()) / posTrack.tpcInnerParam()); m_hAnalysis.fill(HIST("pmatchingPr"), -negTrack.tpcInnerParam(), (negTrack.tpcInnerParam() - negTrack.p()) / negTrack.tpcInnerParam()); @@ -723,6 +735,8 @@ struct LfTreeCreatorClusterStudies { massV0 = 0.f; m_hAnalysis.fill(HIST("nSigmaTPCEl"), std::hypot(momPos[0], momPos[1], momPos[2]), posTrack.tpcNSigmaEl()); m_hAnalysis.fill(HIST("nSigmaTPCEl"), std::hypot(momNeg[0], momNeg[1], momNeg[2]) * -1.f, negTrack.tpcNSigmaEl()); + m_hAnalysis.fill(HIST("nSigmaITSEl"), std::hypot(momPos[0], momPos[1], momPos[2]), m_responseITS.nSigmaITS(posTrack.itsClusterSizes(), posTrack.p(), posTrack.eta())); + m_hAnalysis.fill(HIST("nSigmaITSEl"), std::hypot(momNeg[0], momNeg[1], momNeg[2]) * -1.f, m_responseITS.nSigmaITS(negTrack.itsClusterSizes(), negTrack.p(), negTrack.eta())); m_hAnalysis.fill(HIST("armenteros_plot_gamma"), alphaAP, qtAP); m_hAnalysis.fill(HIST("pmatchingEl"), posTrack.tpcInnerParam(), (posTrack.tpcInnerParam() - posTrack.p()) / posTrack.tpcInnerParam()); m_hAnalysis.fill(HIST("pmatchingEl"), -negTrack.tpcInnerParam(), (negTrack.tpcInnerParam() - negTrack.p()) / negTrack.tpcInnerParam()); @@ -972,6 +986,7 @@ struct LfTreeCreatorClusterStudies { } m_hAnalysis.fill(HIST("de_selections"), DeSelections::kDePIDtof); m_hAnalysis.fill(HIST("nSigmaTPCDe"), track.p() * track.sign(), computeNSigmaDe(track)); + m_hAnalysis.fill(HIST("nSigmaITSDe"), track.p() * track.sign(), m_responseITS.nSigmaITS(track.itsClusterSizes(), track.p(), track.eta())); m_hAnalysis.fill(HIST("nSigmaTOFDe"), track.p() * track.sign(), track.tofNSigmaDe()); m_hAnalysis.fill(HIST("TOFmassDe"), track.p() * track.sign(), computeTOFmassDe(track)); m_hAnalysis.fill(HIST("pmatchingDe"), track.sign() * track.tpcInnerParam(), (track.tpcInnerParam() - track.p()) / track.tpcInnerParam()); @@ -1060,6 +1075,7 @@ struct LfTreeCreatorClusterStudies { m_hAnalysis.fill(HIST("he3_selections"), He3Selections::kHe3PIDtof); m_hAnalysis.fill(HIST("nSigmaTPCHe"), track.p() * track.sign(), computeNSigmaHe3(track)); + m_hAnalysis.fill(HIST("nSigmaITSHe"), track.p() * track.sign(), m_responseITS.nSigmaITS(track.itsClusterSizes(), track.p(), track.eta())); m_hAnalysis.fill(HIST("TOFmassHe"), track.p() * track.sign(), tofMass); m_hAnalysis.fill(HIST("pmatchingHe"), track.sign() * correctedTPCinnerParam, (correctedTPCinnerParam - track.p()) / correctedTPCinnerParam); From 24cec5135db409f8eb855e7f634d80a9ec3420d9 Mon Sep 17 00:00:00 2001 From: Zhiyong <71517277+Luzhiyongg@users.noreply.github.com> Date: Fri, 22 Nov 2024 08:51:28 +0800 Subject: [PATCH 047/459] [PWGCF] flow: add FlowContainer in FlowRunbyRun; add d2{4} in FlowTask (#8546) --- PWGCF/Flow/Tasks/FlowRunbyRun.cxx | 66 +++++++++++++++++++++++++++++++ PWGCF/Flow/Tasks/FlowTask.cxx | 11 ++++-- 2 files changed, 74 insertions(+), 3 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowRunbyRun.cxx b/PWGCF/Flow/Tasks/FlowRunbyRun.cxx index e5536500b20..02f006f2c3c 100644 --- a/PWGCF/Flow/Tasks/FlowRunbyRun.cxx +++ b/PWGCF/Flow/Tasks/FlowRunbyRun.cxx @@ -36,6 +36,7 @@ #include "GFW.h" #include "GFWCumulant.h" #include "GFWWeights.h" +#include "FlowContainer.h" #include "TList.h" #include #include @@ -60,6 +61,8 @@ struct FlowRunbyRun { O2_DEFINE_CONFIGURABLE(cfgCutDCAz, float, 2.0f, "max DCA to vertex z") O2_DEFINE_CONFIGURABLE(cfgUseNch, bool, false, "Use Nch for flow observables") Configurable> cfgRunNumbers{"cfgRunNumbers", std::vector{544095, 544098, 544116, 544121, 544122, 544123, 544124}, "Preconfigured run numbers"}; + Configurable> cfgUserDefineGFWCorr{"cfgUserDefineGFWCorr", std::vector{"refN10 {2} refP10 {-2}"}, "User defined GFW CorrelatorConfig"}; + Configurable> cfgUserDefineGFWName{"cfgUserDefineGFWName", std::vector{"Ch10Gap22"}, "User defined GFW Name"}; ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for histograms"}; ConfigurableAxis axisPhi{"axisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"}; @@ -76,11 +79,15 @@ struct FlowRunbyRun { Configurable url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; // Define output + OutputObj fFC{FlowContainer("FlowContainer")}; HistogramRegistry registry{"registry"}; // define global variables GFW* fGFW = new GFW(); std::vector corrconfigs; + std::vector corrconfigsFC; + TAxis* fPtAxis; + TRandom3* fRndm = new TRandom3(0); std::vector RunNumbers; // vector of run numbers std::map>> TH1sList; // map of histograms for all runs std::map>> ProfilesList; // map of profiles for all runs @@ -114,12 +121,43 @@ struct FlowRunbyRun { CreateOutputObjectsForRun(runNumber); } + o2::framework::AxisSpec axis = axisPt; + int nPtBins = axis.binEdges.size() - 1; + double* PtBins = &(axis.binEdges)[0]; + fPtAxis = new TAxis(nPtBins, PtBins); + + // Create FlowContainer + TObjArray* oba = new TObjArray(); + std::vector UserDefineGFWCorr = cfgUserDefineGFWCorr; + std::vector UserDefineGFWName = cfgUserDefineGFWName; + if (!UserDefineGFWCorr.empty() && !UserDefineGFWName.empty()) { + for (uint i = 0; i < UserDefineGFWName.size(); i++) { + oba->Add(new TNamed(UserDefineGFWName.at(i).c_str(), UserDefineGFWName.at(i).c_str())); + } + } + fFC->SetName("FlowContainer"); + fFC->SetXAxis(fPtAxis); + fFC->Initialize(oba, axisIndependent, 1); + delete oba; + fGFW->AddRegion("full", -0.8, 0.8, 1, 1); fGFW->AddRegion("refN10", -0.8, -0.5, 1, 1); fGFW->AddRegion("refP10", 0.5, 0.8, 1, 1); corrconfigs.resize(kCount_TProfileNames); corrconfigs[c22] = fGFW->GetCorrelatorConfig("full {2 -2}", "ChFull22", kFALSE); corrconfigs[c22_gap10] = fGFW->GetCorrelatorConfig("refN10 {2} refP10 {-2}", "Ch10Gap22", kFALSE); + if (!UserDefineGFWCorr.empty() && !UserDefineGFWName.empty()) { + LOGF(info, "User adding GFW CorrelatorConfig:"); + // attentaion: here we follow the index of cfgUserDefineGFWCorr + for (uint i = 0; i < UserDefineGFWCorr.size(); i++) { + if (i >= UserDefineGFWName.size()) { + LOGF(fatal, "The names you provided are more than configurations. UserDefineGFWName.size(): %d > UserDefineGFWCorr.size(): %d", UserDefineGFWName.size(), UserDefineGFWCorr.size()); + break; + } + LOGF(info, "%d: %s %s", i, UserDefineGFWCorr.at(i).c_str(), UserDefineGFWName.at(i).c_str()); + corrconfigsFC.push_back(fGFW->GetCorrelatorConfig(UserDefineGFWCorr.at(i).c_str(), UserDefineGFWName.at(i).c_str(), kFALSE)); + } + } fGFW->CreateRegions(); } @@ -139,6 +177,29 @@ struct FlowRunbyRun { return; } + void FillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) + { + double dnx, val; + dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (dnx == 0) + return; + if (!corrconf.pTDif) { + val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (TMath::Abs(val) < 1) + fFC->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm); + return; + } + for (Int_t i = 1; i <= fPtAxis->GetNbins(); i++) { + dnx = fGFW->Calculate(corrconf, i - 1, kTRUE).real(); + if (dnx == 0) + continue; + val = fGFW->Calculate(corrconf, i - 1, kFALSE).real() / dnx; + if (TMath::Abs(val) < 1) + fFC->FillProfile(Form("%s_pt_%i", corrconf.Head.c_str(), i), cent, val, dnx, rndm); + } + return; + } + void CreateOutputObjectsForRun(int runNumber) { std::vector> histos(kCount_TH1Names); @@ -164,6 +225,7 @@ struct FlowRunbyRun { // detect run number auto bc = collision.bc_as(); int runNumber = bc.runNumber(); + float l_Random = fRndm->Rndm(); if (std::find(RunNumbers.begin(), RunNumbers.end(), runNumber) == RunNumbers.end()) { // if run number is not in the preconfigured list, create new output histograms for this run CreateOutputObjectsForRun(runNumber); @@ -195,6 +257,10 @@ struct FlowRunbyRun { for (uint i = 0; i < kCount_TProfileNames; ++i) { FillProfile(corrconfigs[i], ProfilesList[runNumber][i], cent); } + // Filling Flow Container + for (uint l_ind = 0; l_ind < corrconfigsFC.size(); l_ind++) { + FillFC(corrconfigsFC.at(l_ind), cent, l_Random); + } } }; diff --git a/PWGCF/Flow/Tasks/FlowTask.cxx b/PWGCF/Flow/Tasks/FlowTask.cxx index 692caed6af2..0f4d6977855 100644 --- a/PWGCF/Flow/Tasks/FlowTask.cxx +++ b/PWGCF/Flow/Tasks/FlowTask.cxx @@ -248,13 +248,15 @@ struct FlowTask { // add in FlowContainer to Get boostrap sample automatically TObjArray* oba = new TObjArray(); oba->Add(new TNamed("ChGap22", "ChGap22")); - for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) - oba->Add(new TNamed(Form("ChGap22_pt_%i", i + 1), "ChGap22_pTDiff")); oba->Add(new TNamed("ChFull22", "ChFull22")); oba->Add(new TNamed("ChFull32", "ChFull32")); oba->Add(new TNamed("ChFull42", "ChFull42")); oba->Add(new TNamed("ChFull24", "ChFull24")); oba->Add(new TNamed("ChFull26", "ChFull26")); + for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + oba->Add(new TNamed(Form("ChFull22_pt_%i", i + 1), "ChFull22_pTDiff")); + for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + oba->Add(new TNamed(Form("ChFull24_pt_%i", i + 1), "ChFull24_pTDiff")); oba->Add(new TNamed("Ch04Gap22", "Ch04Gap22")); oba->Add(new TNamed("Ch06Gap22", "Ch06Gap22")); oba->Add(new TNamed("Ch08Gap22", "Ch08Gap22")); @@ -324,8 +326,10 @@ struct FlowTask { fGFW->AddRegion("refM", -0.4, 0.4, 1, 1); fGFW->AddRegion("poiN", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 2); fGFW->AddRegion("poiN10", -0.8, -0.5, 1 + fPtAxis->GetNbins(), 2); + fGFW->AddRegion("poifull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 2); fGFW->AddRegion("olN", -0.8, -0.4, 1, 4); fGFW->AddRegion("olN10", -0.8, -0.5, 1, 4); + fGFW->AddRegion("olfull", -0.8, 0.8, 1, 4); corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {2 -2}", "ChFull22", kFALSE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {3 -3}", "ChFull32", kFALSE)); @@ -348,7 +352,8 @@ struct FlowTask { corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN10 {4} refP10 {-4}", "Ch10Gap42", kFALSE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN12 {4} refP12 {-4}", "Ch12Gap42", kFALSE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN {2} refP {-2}", "ChGap22", kFALSE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiN refN | olN {2} refP {-2}", "ChGap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poifull full | olfull {2 -2}", "ChFull22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poifull full | olfull {2 2 -2 -2}", "ChFull24", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiN10 refN10 | olN10 {2} refP10 {-2}", "Ch10Gap22", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiN10 refN10 | olN10 {3} refP10 {-3}", "Ch10Gap32", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiN10 refN10 | olN10 {4} refP10 {-4}", "Ch10Gap42", kTRUE)); From 182b7436c59aaa8f1195dee77e9c335dfab479b3 Mon Sep 17 00:00:00 2001 From: mcoquet642 <74600025+mcoquet642@users.noreply.github.com> Date: Fri, 22 Nov 2024 04:23:12 +0100 Subject: [PATCH 048/459] [PWGDQ] Adding ambiguity histograms for muon (#8501) --- PWGDQ/Core/HistogramsLibrary.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 0f358226af7..bad53e0fd1b 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -735,8 +735,13 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "MuonDcaX_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "MuonDcaY_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 500, -5.0, 5.0, VarManager::kEta); } else { + hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); + hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); hm->AddHistogram(histClass, "AmbiguityInBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsInBunch); hm->AddHistogram(histClass, "AmbiguityOutOfBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsOutOfBunch); + hm->AddHistogram(histClass, "AmbiguityInBunch_pt", "in bunch collision ambiguity vs p_{T}", false, 50, 0.0, 10.0, VarManager::kPt, 10, 0., 10., VarManager::kMuonNAssocsInBunch); + hm->AddHistogram(histClass, "AmbiguityOutOfBunch_pt", "out of bunch collision ambiguity vs p_{T}", false, 50, 0.0, 10.0, VarManager::kPt, 10, 0., 10., VarManager::kMuonNAssocsOutOfBunch); } } From 9f208fd156262df6306c392a3c606caaf7fb1d76 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Fri, 22 Nov 2024 05:36:21 +0100 Subject: [PATCH 049/459] [PWGCF] FemtoUniverse: Adding FDExtCollisions table (#8547) --- PWGCF/FemtoUniverse/DataModel/FemtoDerived.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h b/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h index f2465196a6f..7f43c675053 100644 --- a/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h +++ b/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h @@ -31,6 +31,8 @@ DECLARE_SOA_COLUMN(MultV0M, multV0M, float); //! V0M multiplicity DECLARE_SOA_COLUMN(MultNtr, multNtr, int); //! multiplicity of charged tracks as defined in the producer DECLARE_SOA_COLUMN(Sphericity, sphericity, float); //! Sphericity of the event DECLARE_SOA_COLUMN(MagField, magField, float); //! Magnetic field of the event +DECLARE_SOA_COLUMN(IRrate, irrate, float); //! Interaction rate +DECLARE_SOA_COLUMN(Occupancy, occupancy, int); //! TPC occupancy } // namespace femtouniversecollision @@ -43,6 +45,11 @@ DECLARE_SOA_TABLE(FDCollisions, "AOD", "FDCOLLISION", femtouniversecollision::MagField); using FDCollision = FDCollisions::iterator; +DECLARE_SOA_TABLE(FDExtCollisions, "AOD", "FDEXTCOLLISION", + femtouniversecollision::IRrate, + femtouniversecollision::Occupancy); +using FDExtCollision = FDExtCollisions::iterator; + /// FemtoUniverseTrack namespace femtouniverseparticle { From d74b0382e8f0878a2f8828930839c93fb5d1c971 Mon Sep 17 00:00:00 2001 From: Lars <146946151+ljoergen@users.noreply.github.com> Date: Fri, 22 Nov 2024 08:50:45 +0100 Subject: [PATCH 050/459] [PWGLF] AngularCorrelationsInJets.cxx: minor histogram edits (#8549) Co-authored-by: ALICE Action Bot --- .../Nuspex/AngularCorrelationsInJets.cxx | 285 +++++++++++------- 1 file changed, 171 insertions(+), 114 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx b/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx index 51a48b3902e..6d751cde7c1 100644 --- a/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx +++ b/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx @@ -12,6 +12,8 @@ // author: Lars Jörgensen #include +#include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -29,9 +31,6 @@ #include "fastjet/AreaDefinition.hh" #include "fastjet/ClusterSequenceArea.hh" #include "fastjet/GhostedAreaSpec.hh" -// #include "fastjet/Selector.hh" -// #include "fastjet/tools/Subtractor.hh" -// #include "fastjet/tools/JetMedianBackgroundEstimator.hh" #include "PWGJE/Core/JetBkgSubUtils.h" #include "TVector2.h" #include "TVector3.h" @@ -43,8 +42,8 @@ using namespace o2::framework::expressions; struct AxisSpecs { AxisSpec ptAxisPos = {1000, 0, 100, "#it{p}_{T} [GeV/#it{c}]"}; AxisSpec ptAxisFull = {2000, -100, 100, "#it{p}_{T} [GeV/#it{c}]"}; - AxisSpec nsigmapTAxis = {1000, -50, 50, "#it{p}_{T} [GeV/#it{c}]"}; - AxisSpec nsigmaAxis = {1000, -15, 15, "n#sigma"}; + AxisSpec nsigmapTAxis = {500, 0, 50, "#it{p}_{T} [GeV/#it{c}]"}; + AxisSpec nsigmaAxis = {300, -15, 15, "n#sigma"}; AxisSpec dcazAxis = {1000, -1, 1, "DCA_{z} [cm]"}; AxisSpec dcaxyAxis = {1000, -0.5, 0.5, "DCA_{xy} [cm]"}; AxisSpec angDistPhiAxis = {1000, -2, 5, "#Delta#varphi"}; @@ -67,8 +66,6 @@ struct AngularCorrelationsInJets { Configurable fJetR{"jetR", 0.4, "jet resolution parameter"}; Configurable fMinJetPt{"minJetPt", 5.0, "minimum total pT to accept jet"}; Configurable fMinJetParticlePt{"minJetParticlePt", 0.0, "minimum pT to accept jet particle"}; - // Configurable fMinLeadingPt{"minLeadingPt", 5.0, "minimum pT for leading track"}; - // float fMinLeadingPt = 5.0; // Proton Cuts Configurable fProtonDCAxyYield{"protonDCAxyYield", 0.05, "[proton] DCAxy cut for yield"}; @@ -182,7 +179,7 @@ struct AngularCorrelationsInJets { registryData.add("hPtJetAntiproton", "p_{T} of antiprotons", HistType::kTH1D, {axisSpecs.ptAxisPos}); registryData.add("hPtJetNuclei", "p_{T} of nuclei", HistType::kTH1D, {axisSpecs.ptAxisPos}); registryData.add("hPtJetAntinuclei", "p_{T} of antinuclei", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryData.add("hPtTotalJet", "p_{T} of entire jet;#it{p}_{T} [GeV/#it{c}]", HistType::kTH1F, {{2000, 0, 500}}); + registryData.add("hPtTotalJet", "p_{T} of entire jet;#it{p}_{T} [GeV/#it{c}]", HistType::kTH1F, {{1000, 0, 500}}); registryQA.add("hPtJetProton_15", "Proton p_{T} for jet p_{T} < 15 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); registryQA.add("hPtJetProton_20", "Proton p_{T} for jet p_{T} < 20 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); registryQA.add("hPtJetProton_30", "Proton p_{T} for jet p_{T} < 30 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); @@ -201,16 +198,24 @@ struct AngularCorrelationsInJets { registryQA.add("hPtJetAntinuclei_50", "Antinuclei p_{T} for jet p_{T} < 50 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); // nSigma - registryData.add("hTPCsignal", "TPC signal", HistType::kTH2F, {{1000, 0, 100, "#it{p} [GeV/#it{c}]"}, {5000, 0, 5000, "d#it{E}/d#it{X} (a.u.)"}}); - registryData.add("hTOFsignal", "TOF signal", HistType::kTH2F, {{1000, 0, 100, "#it{p} [GeV/#it{c}]"}, {550, 0, 1.1, "#beta (TOF)"}}); - registryData.add("hTPCsignalProton", "TPC n#sigma for (anti)proton without cuts", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); - registryData.add("hTOFsignalProton", "TOF n#sigma for (anti)proton without cuts", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); - registryData.add("hTPCsignalNuclei", "TPC n#sigma for (anti)nuclei without cuts", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); - registryData.add("hTOFsignalNuclei", "TOF n#sigma for (anti)nuclei without cuts", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); - registryData.add("hTPCnsigmaProton", "TPC n#sigma for (anti)proton", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); - registryData.add("hTOFnsigmaProton", "TOF n#sigma for (anti)proton", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); - registryData.add("hTPCnsigmaNuclei", "TPC n#sigma for (anti)nuclei", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); - registryData.add("hTOFnsigmaNuclei", "TOF n#sigma for (anti)nuclei", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTPCsignal", "TPC signal", HistType::kTH2F, {{1000, -100, 100, "#it{p} [GeV/#it{c}]"}, {5000, 0, 5000, "d#it{E}/d#it{X} (a.u.)"}}); + registryData.add("hTOFsignal", "TOF signal", HistType::kTH2F, {{1000, -100, 100, "#it{p} [GeV/#it{c}]"}, {550, 0, 1.1, "#beta (TOF)"}}); + registryData.add("hTPCnsigmaProton", "TPC n#sigma for proton", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTOFnsigmaProton", "TOF n#sigma for proton", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTPCnsigmaAntiproton", "TPC n#sigma for antiproton", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTOFnsigmaAntiproton", "TOF n#sigma for antiproton", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTPCnsigmaNuclei", "TPC n#sigma for nuclei", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTOFnsigmaNuclei", "TOF n#sigma for nuclei", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTPCnsigmaAntinuclei", "TPC n#sigma for antinuclei", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTOFnsigmaAntinuclei", "TOF n#sigma for antinuclei", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTPCnsigmaProtonCF", "TPC n#sigma for proton CF", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTOFnsigmaProtonCF", "TOF n#sigma for proton CF", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTPCnsigmaAntiprotonCF", "TPC n#sigma for antiproton CF", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTOFnsigmaAntiprotonCF", "TOF n#sigma for antiproton CF", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTPCnsigmaNucleiCF", "TPC n#sigma for nuclei CF", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTOFnsigmaNucleiCF", "TOF n#sigma for nuclei CF", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTPCnsigmaAntinucleiCF", "TPC n#sigma for antinuclei CF", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); + registryData.add("hTOFnsigmaAntinucleiCF", "TOF n#sigma for antinuclei CF", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); // DCA registryData.add("hDCAxyFullJet", "DCA_{xy} of full jet", HistType::kTH2F, {axisSpecs.ptAxisFull, axisSpecs.dcaxyAxis}); @@ -265,7 +270,7 @@ struct AngularCorrelationsInJets { registryQA.add("hRhoMEstimateArea", "Background #rho_{m} (area)", HistType::kTH2F, {{axisSpecs.ptAxisPos}, {200, 0, 20}}); registryQA.add("hJetBkgDeltaPt", "#Delta p_{T} Clustered Cone - Pure Jet", HistType::kTH1F, {{200, 0, 10}}); - registryQA.add("hTOFmass", "TOF mass", HistType::kTH2F, {axisSpecs.ptAxisPos, {1000, 0, 5, "#it{m} [GeV/#it{c}^{2}]"}}); + registryQA.add("hTOFmass", "TOF mass vs p_{T}", HistType::kTH2F, {axisSpecs.ptAxisPos, {1000, 0, 5, "#it{m} [GeV/#it{c}^{2}]"}}); registryQA.get(HIST("hTOFmass"))->Sumw2(); registryQA.add("hPtFullEvent", "p_{T} after basic cuts", HistType::kTH1F, {axisSpecs.ptAxisPos}); registryQA.add("hCrossedRowsTPC", "Crossed rows TPC", HistType::kTH2I, {axisSpecs.ptAxisPos, {135, 65, 200}}); @@ -335,37 +340,49 @@ struct AngularCorrelationsInJets { return false; if (tightCuts) { // for correlation function + // DCA + if (TMath::Abs(track.dcaXY()) > fProtonDCAxyCF) + return false; + if (TMath::Abs(track.dcaZ()) > fProtonDCAzCF) + return false; + + registryData.fill(HIST("hTPCnsigmaProtonCF"), track.pt(), track.tpcNSigmaPr()); + // TPC if (track.pt() < fProtonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fProtonTPCnsigLowCF) return false; if (track.pt() > fProtonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fProtonTPCnsigHighCF) return false; + registryData.fill(HIST("hTOFnsigmaProtonCF"), track.pt(), track.tofNSigmaPr()); + + // TOF + if (track.hasTOF()) { + if (track.pt() > fProtonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > fProtonTOFnsigCF) + return false; + } + } else { // for yields // DCA - if (TMath::Abs(track.dcaXY()) > fProtonDCAxyCF) + if (TMath::Abs(track.dcaXY()) > fProtonDCAxyYield) return false; - if (TMath::Abs(track.dcaZ()) > fProtonDCAzCF) + if (TMath::Abs(track.dcaZ()) > fProtonDCAzYield) return false; - // TOF - if (track.pt() > fProtonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > fProtonTOFnsigCF) - return false; - } else { // for yields + registryData.fill(HIST("hTPCnsigmaProton"), track.pt(), track.tpcNSigmaPr()); + // TPC if (track.pt() < fProtonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fProtonTPCnsigLowYield) return false; if (track.pt() > fProtonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fProtonTPCnsigHighYield) return false; - // DCA - if (TMath::Abs(track.dcaXY()) > fProtonDCAxyYield) - return false; - if (TMath::Abs(track.dcaZ()) > fProtonDCAzYield) - return false; + registryData.fill(HIST("hTOFnsigmaProton"), track.pt(), track.tofNSigmaPr()); // TOF - if (track.pt() > fProtonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > fProtonTOFnsigYield) - return false; + if (track.hasTOF()) { + if (track.pt() > fProtonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > fProtonTOFnsigYield) + return false; + } } return true; @@ -378,37 +395,49 @@ struct AngularCorrelationsInJets { return false; if (tightCuts) { // for correlation function + // DCA + if (TMath::Abs(track.dcaXY()) > fAntiprotonDCAxyCF) + return false; + if (TMath::Abs(track.dcaZ()) > fAntiprotonDCAzCF) + return false; + + registryData.fill(HIST("hTPCnsigmaAntiprotonCF"), track.pt(), track.tpcNSigmaPr()); + // TPC if (track.pt() < fAntiprotonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fAntiprotonTPCnsigLowCF) return false; if (track.pt() > fAntiprotonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fAntiprotonTPCnsigHighCF) return false; + registryData.fill(HIST("hTOFnsigmaAntiprotonCF"), track.pt(), track.tofNSigmaPr()); + + // TOF + if (track.hasTOF()) { + if (track.pt() > fAntiprotonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > fAntiprotonTOFnsigCF) + return false; + } + } else { // for yields // DCA - if (TMath::Abs(track.dcaXY()) > fAntiprotonDCAxyCF) + if (TMath::Abs(track.dcaXY()) > fAntiprotonDCAxyYield) return false; - if (TMath::Abs(track.dcaZ()) > fAntiprotonDCAzCF) + if (TMath::Abs(track.dcaZ()) > fAntiprotonDCAzYield) return false; - // TOF - if (track.pt() > fAntiprotonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > fAntiprotonTOFnsigCF) - return false; - } else { // for yields + registryData.fill(HIST("hTPCnsigmaAntiproton"), track.pt(), track.tpcNSigmaPr()); + // TPC if (track.pt() < fAntiprotonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fAntiprotonTPCnsigLowYield) return false; if (track.pt() > fAntiprotonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fAntiprotonTPCnsigHighYield) return false; - // DCA - if (TMath::Abs(track.dcaXY()) > fAntiprotonDCAxyYield) - return false; - if (TMath::Abs(track.dcaZ()) > fAntiprotonDCAzYield) - return false; + registryData.fill(HIST("hTOFnsigmaAntiproton"), track.pt(), track.tofNSigmaPr()); // TOF - if (track.pt() > fAntiprotonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > fAntiprotonTOFnsigYield) - return false; + if (track.hasTOF()) { + if (track.pt() > fAntiprotonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > fAntiprotonTOFnsigYield) + return false; + } } return true; @@ -421,71 +450,95 @@ struct AngularCorrelationsInJets { return false; if (fDeuteronAnalysis) { if (tightCuts) { // for correlation function + // DCA + if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyCF) + return false; + if (TMath::Abs(track.dcaZ()) > fNucleiDCAzCF) + return false; + + registryData.fill(HIST("hTPCnsigmaNucleiCF"), track.pt(), track.tpcNSigmaDe()); + // TPC if (track.pt() < fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fNucleiTPCnsigLowCF) return false; if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fNucleiTPCnsigHighCF) return false; + registryData.fill(HIST("hTOFnsigmaNucleiCF"), track.pt(), track.tofNSigmaDe()); + + // TOF + if (track.hasTOF()) { + if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tofNSigmaDe()) > fNucleiTOFnsigCF) + return false; + } + } else { // for yields // DCA - if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyCF) + if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyYield) return false; - if (TMath::Abs(track.dcaZ()) > fNucleiDCAzCF) + if (TMath::Abs(track.dcaZ()) > fNucleiDCAzYield) return false; - // TOF - if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tofNSigmaDe()) > fNucleiTOFnsigCF) - return false; - } else { // for yields + registryData.fill(HIST("hTPCnsigmaNuclei"), track.pt(), track.tpcNSigmaDe()); + // TPC if (track.pt() < fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fNucleiTPCnsigLowYield) return false; if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fNucleiTPCnsigHighYield) return false; - // DCA - if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyYield) - return false; - if (TMath::Abs(track.dcaZ()) > fNucleiDCAzYield) - return false; + registryData.fill(HIST("hTOFnsigmaNuclei"), track.pt(), track.tofNSigmaDe()); // TOF - if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tofNSigmaDe()) > fNucleiTOFnsigYield) - return false; + if (track.hasTOF()) { + if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tofNSigmaDe()) > fNucleiTOFnsigYield) + return false; + } } } else { if (tightCuts) { // for correlation function - including for helium just in case, but realistically, angular correlations won't be a thing here + // DCA + if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyCF) + return false; + if (TMath::Abs(track.dcaZ()) > fNucleiDCAzCF) + return false; + + registryData.fill(HIST("hTPCnsigmaNucleiCF"), track.pt(), track.tpcNSigmaHe()); + // TPC if (track.pt() < fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fNucleiTPCnsigLowCF) return false; if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fNucleiTPCnsigHighCF) return false; + registryData.fill(HIST("hTOFnsigmaNucleiCF"), track.pt(), track.tofNSigmaHe()); + + // TOF + if (track.hasTOF()) { + if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tofNSigmaHe()) > fNucleiTOFnsigCF) + return false; + } + } else { // for yields // DCA - if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyCF) + if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyYield) return false; - if (TMath::Abs(track.dcaZ()) > fNucleiDCAzCF) + if (TMath::Abs(track.dcaZ()) > fNucleiDCAzYield) return false; - // TOF - if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tofNSigmaHe()) > fNucleiTOFnsigCF) - return false; - } else { // for yields + registryData.fill(HIST("hTPCnsigmaNuclei"), track.pt(), track.tpcNSigmaHe()); + // TPC if (track.pt() < fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fNucleiTPCnsigLowYield) return false; if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fNucleiTPCnsigHighYield) return false; - // DCA - if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyYield) - return false; - if (TMath::Abs(track.dcaZ()) > fNucleiDCAzYield) - return false; + registryData.fill(HIST("hTOFnsigmaNuclei"), track.pt(), track.tofNSigmaHe()); // TOF - if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tofNSigmaHe()) > fNucleiTOFnsigYield) - return false; + if (track.hasTOF()) { + if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tofNSigmaHe()) > fNucleiTOFnsigYield) + return false; + } } } @@ -500,33 +553,41 @@ struct AngularCorrelationsInJets { if (fDeuteronAnalysis) { if (tightCuts) { // for correlation function + // DCA + if (TMath::Abs(track.dcaXY()) > fAntinucleiDCAxyCF) + return false; + if (TMath::Abs(track.dcaZ()) > fAntinucleiDCAzCF) + return false; + + registryData.fill(HIST("hTPCnsigmaAntinucleiCF"), track.pt(), track.tpcNSigmaDe()); + // TPC if (track.pt() < fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fAntinucleiTPCnsigLowCF) return false; if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fAntinucleiTPCnsigHighCF) return false; - // DCA - if (TMath::Abs(track.dcaXY()) > fAntinucleiDCAxyCF) - return false; - if (TMath::Abs(track.dcaZ()) > fAntinucleiDCAzCF) - return false; + registryData.fill(HIST("hTOFnsigmaAntinucleiCF"), track.pt(), track.tofNSigmaDe()); // TOF if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tofNSigmaDe()) > fAntinucleiTOFnsigCF) return false; } else { // for yields + // DCA + if (TMath::Abs(track.dcaXY()) > fAntinucleiDCAxyYield) + return false; + if (TMath::Abs(track.dcaZ()) > fAntinucleiDCAzYield) + return false; + + registryData.fill(HIST("hTPCnsigmaAntinuclei"), track.pt(), track.tpcNSigmaDe()); + // TPC if (track.pt() < fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fAntinucleiTPCnsigLowYield) return false; if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fAntinucleiTPCnsigHighYield) return false; - // DCA - if (TMath::Abs(track.dcaXY()) > fAntinucleiDCAxyYield) - return false; - if (TMath::Abs(track.dcaZ()) > fAntinucleiDCAzYield) - return false; + registryData.fill(HIST("hTOFnsigmaAntinuclei"), track.pt(), track.tofNSigmaDe()); // TOF if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tofNSigmaDe()) > fAntinucleiTOFnsigYield) @@ -534,33 +595,41 @@ struct AngularCorrelationsInJets { } } else { if (tightCuts) { // for correlation function - including for antihelium just in case, but realistically, angular correlations won't be a thing here + // DCA + if (TMath::Abs(track.dcaXY()) > fAntinucleiDCAxyCF) + return false; + if (TMath::Abs(track.dcaZ()) > fAntinucleiDCAzCF) + return false; + + registryData.fill(HIST("hTPCnsigmaAntinucleiCF"), track.pt(), track.tpcNSigmaHe()); + // TPC if (track.pt() < fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fAntinucleiTPCnsigLowCF) return false; if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fAntinucleiTPCnsigHighCF) return false; - // DCA - if (TMath::Abs(track.dcaXY()) > fAntinucleiDCAxyCF) - return false; - if (TMath::Abs(track.dcaZ()) > fAntinucleiDCAzCF) - return false; + registryData.fill(HIST("hTOFnsigmaAntinucleiCF"), track.pt(), track.tofNSigmaHe()); // TOF if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tofNSigmaHe()) > fAntinucleiTOFnsigCF) return false; } else { // for yields + // DCA + if (TMath::Abs(track.dcaXY()) > fAntinucleiDCAxyYield) + return false; + if (TMath::Abs(track.dcaZ()) > fAntinucleiDCAzYield) + return false; + + registryData.fill(HIST("hTPCnsigmaAntinuclei"), track.pt(), track.tpcNSigmaHe()); + // TPC if (track.pt() < fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fAntinucleiTPCnsigLowYield) return false; if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fAntinucleiTPCnsigHighYield) return false; - // DCA - if (TMath::Abs(track.dcaXY()) > fAntinucleiDCAxyYield) - return false; - if (TMath::Abs(track.dcaZ()) > fAntinucleiDCAzYield) - return false; + registryData.fill(HIST("hTOFnsigmaAntinuclei"), track.pt(), track.tofNSigmaHe()); // TOF if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tofNSigmaHe()) > fAntinucleiTOFnsigYield) @@ -901,17 +970,6 @@ struct AngularCorrelationsInJets { registryData.fill(HIST("hTPCsignal"), jetParticle.pt() * jetParticle.sign(), jetParticle.tpcSignal()); if (jetParticle.hasTOF()) { registryData.fill(HIST("hTOFsignal"), jetParticle.pt() * jetParticle.sign(), jetParticle.beta()); - registryData.fill(HIST("hTOFsignalProton"), jetParticle.pt() * jetParticle.sign(), jetParticle.tofNSigmaPr()); - } - registryData.fill(HIST("hTPCsignalProton"), jetParticle.pt() * jetParticle.sign(), jetParticle.tpcNSigmaPr()); - if (fDeuteronAnalysis) { - registryData.fill(HIST("hTPCsignalNuclei"), jetParticle.pt() * jetParticle.sign(), jetParticle.tpcNSigmaDe()); - if (jetParticle.hasTOF()) - registryData.fill(HIST("hTOFsignalNuclei"), jetParticle.pt() * jetParticle.sign(), jetParticle.tofNSigmaDe()); - } else { - registryData.fill(HIST("hTPCsignalNuclei"), jetParticle.pt() * jetParticle.sign(), jetParticle.tpcNSigmaHe()); - if (jetParticle.hasTOF()) - registryData.fill(HIST("hTOFsignalNuclei"), jetParticle.pt() * jetParticle.sign(), jetParticle.tofNSigmaHe()); } double ptDiff = pseudoParticle.pt() - jetParticle.pt(); registryQA.fill(HIST("hPtDiff"), ptDiff); @@ -929,9 +987,8 @@ struct AngularCorrelationsInJets { } else if (subtractedJetPerp.pt() < 50) { registryQA.fill(HIST("hPtJetProton_50"), jetParticle.pt()); } - registryData.fill(HIST("hTPCnsigmaProton"), jetParticle.pt() * jetParticle.sign(), jetParticle.tpcNSigmaPr()); if (jetParticle.hasTOF()) - registryData.fill(HIST("hTOFnsigmaProton"), jetParticle.pt() * jetParticle.sign(), jetParticle.tofNSigmaPr()); + registryData.fill(HIST("hTOFnsigmaProton"), jetParticle.pt(), jetParticle.tofNSigmaPr()); registryData.fill(HIST("hTrackProtocol"), 4); // # protons if (isProton(jetParticle, true)) { registryData.fill(HIST("hTrackProtocol"), 5); // # high purity protons @@ -949,9 +1006,9 @@ struct AngularCorrelationsInJets { } else if (subtractedJetPerp.pt() < 50) { registryQA.fill(HIST("hPtJetAntiproton_50"), jetParticle.pt()); } - registryData.fill(HIST("hTPCnsigmaProton"), jetParticle.pt() * jetParticle.sign(), jetParticle.tpcNSigmaPr()); + registryData.fill(HIST("hTPCnsigmaAntiproton"), jetParticle.pt(), jetParticle.tpcNSigmaPr()); if (jetParticle.hasTOF()) - registryData.fill(HIST("hTOFnsigmaProton"), jetParticle.pt() * jetParticle.sign(), jetParticle.tofNSigmaPr()); + registryData.fill(HIST("hTOFnsigmaAntiproton"), jetParticle.pt(), jetParticle.tofNSigmaPr()); registryData.fill(HIST("hTrackProtocol"), 6); // # antiprotons if (isAntiproton(jetParticle, true)) { registryData.fill(HIST("hTrackProtocol"), 7); // # high purity antiprotons @@ -970,15 +1027,15 @@ struct AngularCorrelationsInJets { registryQA.fill(HIST("hPtJetNuclei_50"), jetParticle.pt()); } if (fDeuteronAnalysis) { - registryData.fill(HIST("hTPCnsigmaNuclei"), jetParticle.pt() * jetParticle.sign(), jetParticle.tpcNSigmaDe()); + registryData.fill(HIST("hTPCnsigmaNuclei"), jetParticle.pt(), jetParticle.tpcNSigmaDe()); } else { - registryData.fill(HIST("hTPCnsigmaNuclei"), jetParticle.pt() * jetParticle.sign(), jetParticle.tpcNSigmaHe()); + registryData.fill(HIST("hTPCnsigmaNuclei"), jetParticle.pt(), jetParticle.tpcNSigmaHe()); } if (jetParticle.hasTOF()) { if (fDeuteronAnalysis) { - registryData.fill(HIST("hTOFnsigmaNuclei"), jetParticle.pt() * jetParticle.sign(), jetParticle.tofNSigmaDe()); + registryData.fill(HIST("hTOFnsigmaNuclei"), jetParticle.pt(), jetParticle.tofNSigmaDe()); } else { - registryData.fill(HIST("hTOFnsigmaNuclei"), jetParticle.pt() * jetParticle.sign(), jetParticle.tofNSigmaHe()); + registryData.fill(HIST("hTOFnsigmaNuclei"), jetParticle.pt(), jetParticle.tofNSigmaHe()); } } registryData.fill(HIST("hTrackProtocol"), 8); // # nuclei @@ -999,15 +1056,15 @@ struct AngularCorrelationsInJets { registryQA.fill(HIST("hPtJetAntinuclei_50"), jetParticle.pt()); } if (fDeuteronAnalysis) { - registryData.fill(HIST("hTPCnsigmaNuclei"), jetParticle.pt() * jetParticle.sign(), jetParticle.tpcNSigmaDe()); + registryData.fill(HIST("hTPCnsigmaAntinuclei"), jetParticle.pt(), jetParticle.tpcNSigmaDe()); } else { - registryData.fill(HIST("hTPCnsigmaNuclei"), jetParticle.pt() * jetParticle.sign(), jetParticle.tpcNSigmaHe()); + registryData.fill(HIST("hTPCnsigmaAntinuclei"), jetParticle.pt(), jetParticle.tpcNSigmaHe()); } if (jetParticle.hasTOF()) { if (fDeuteronAnalysis) { - registryData.fill(HIST("hTOFnsigmaNuclei"), jetParticle.pt() * jetParticle.sign(), jetParticle.tofNSigmaDe()); + registryData.fill(HIST("hTOFnsigmaAntinuclei"), jetParticle.pt(), jetParticle.tofNSigmaDe()); } else { - registryData.fill(HIST("hTOFnsigmaNuclei"), jetParticle.pt() * jetParticle.sign(), jetParticle.tofNSigmaHe()); + registryData.fill(HIST("hTOFnsigmaAntinuclei"), jetParticle.pt(), jetParticle.tofNSigmaHe()); } } registryData.fill(HIST("hTrackProtocol"), 10); // # antinuclei From 3a46d4f396cb31b519f8bec46dfba16508b66af6 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Fri, 22 Nov 2024 01:32:46 -0800 Subject: [PATCH 051/459] PWGJE:fixing error on unsorted JEmcalTrack table (#8551) --- PWGJE/TableProducer/jetderiveddatawriter.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/TableProducer/jetderiveddatawriter.cxx b/PWGJE/TableProducer/jetderiveddatawriter.cxx index 9b09530ce57..eb5858184da 100644 --- a/PWGJE/TableProducer/jetderiveddatawriter.cxx +++ b/PWGJE/TableProducer/jetderiveddatawriter.cxx @@ -151,7 +151,7 @@ struct JetDerivedDataWriter { Preslice D0sPerCollision = aod::jd0indices::collisionId; Preslice LcsPerCollision = aod::jlcindices::collisionId; Preslice DielectronsPerCollision = aod::jdielectronindices::collisionId; - Preslice EMCTrackPerTrack = aod::jemctrack::trackId; + PresliceUnsorted EMCTrackPerTrack = aod::jemctrack::trackId; std::vector collisionFlag; std::vector McCollisionFlag; From b4fb76a6089c9b3faff5965a1d526f1b5bb762e5 Mon Sep 17 00:00:00 2001 From: Sasha Bylinkin <37345380+abylinkin@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:01:37 +0100 Subject: [PATCH 052/459] [PWGUD] sgPIDAnalyzer improved binning (#8431) Co-authored-by: ALICE Action Bot --- PWGUD/Tasks/sgPIDAnalyzer.cxx | 48 +++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/PWGUD/Tasks/sgPIDAnalyzer.cxx b/PWGUD/Tasks/sgPIDAnalyzer.cxx index 93bc69fb917..0d043f546af 100644 --- a/PWGUD/Tasks/sgPIDAnalyzer.cxx +++ b/PWGUD/Tasks/sgPIDAnalyzer.cxx @@ -36,10 +36,11 @@ struct sgPIDAnalyzer { ConfigurableAxis ptAxis{ "ptAxis", - {198, 0.1, 10.0}, + {200, 0.0, 10.0}, "Pt binning"}; - ConfigurableAxis sigmaAxis{"sigmaAxis", {100, -50, 50}, "nSigma TPC binning"}; + ConfigurableAxis sigmaAxis{"sigmaAxis", {1000, -20, 180}, "nSigma TPC binning"}; + ConfigurableAxis tofAxis{"tofAxis", {200, -10, 10}, "nSigma TOF binning"}; Configurable eta_min{"eta_min", -0.9, "Track Pseudorapidity"}; Configurable eta_max{"eta_max", 0.9, "Track Pseudorapidity"}; @@ -48,6 +49,8 @@ struct sgPIDAnalyzer { const AxisSpec ptBins{ptAxis, "p_{T} axis"}; const AxisSpec nSigmaBins{sigmaAxis, "pseudo rapidity axis"}; + const AxisSpec ntofBins{tofAxis, "pseudo rapidity axis"}; + histos.add("Events", "Selected Events", {HistType::kTH1F, {{3, -.5, 2.5}}}); histos.add("TPC/pTPC_Pi", "Positive TPC Pi Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_Pi", "Negative TPC Pi Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_Ka", "Positive TPC Ka Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); @@ -93,28 +96,29 @@ struct sgPIDAnalyzer { histos.add("TPC/nTPC_El_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_El_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TOF/pPi", "Positive TPC Pi vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/nPi", "Negative TPC Pi vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/pKa", "Positive TPC Ka vs TOF Ka vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/nKa", "Negative TPC Ka vs TOF Ka vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/pPr", "Positive TPC Pr vs TOF Pr vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/nPr", "Negative TPC Pr vs TOF Pr vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/pEl", "Positive TPC El vs TOF El vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/nEl", "Negative TPC El vs TOF El vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/pDe", "Positive TPC De vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/nDe", "Negative TPC De vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/pTr", "Positive TPC Tr vs TOF Ka vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/nTr", "Negative TPC Tr vs TOF Ka vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/pHe", "Positive TPC He vs TOF Pr vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/nHe", "Negative TPC He vs TOF Pr vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/pAl", "Positive TPC Al vs TOF El vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/nAl", "Negative TPC Al vs TOF El vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/pMu", "Positive TPC Mu vs TOF El vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); - histos.add("TOF/nMu", "Negative TPC Mu vs TOF El vs pt", {HistType::kTH3F, {ptBins, nSigmaBins, nSigmaBins}}); + histos.add("TOF/pPi", "Positive TPC Pi vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/nPi", "Negative TPC Pi vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/pKa", "Positive TPC Ka vs TOF Ka vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/nKa", "Negative TPC Ka vs TOF Ka vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/pPr", "Positive TPC Pr vs TOF Pr vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/nPr", "Negative TPC Pr vs TOF Pr vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/pEl", "Positive TPC El vs TOF El vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/nEl", "Negative TPC El vs TOF El vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/pDe", "Positive TPC De vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/nDe", "Negative TPC De vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/pTr", "Positive TPC Tr vs TOF Ka vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/nTr", "Negative TPC Tr vs TOF Ka vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/pHe", "Positive TPC He vs TOF Pr vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/nHe", "Negative TPC He vs TOF Pr vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/pAl", "Positive TPC Al vs TOF El vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/nAl", "Negative TPC Al vs TOF El vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/pMu", "Positive TPC Mu vs TOF El vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); + histos.add("TOF/nMu", "Negative TPC Mu vs TOF El vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); } - - void process(aod::SGEvents const&, aod::SGTracks const& tracks) + using SGEvent = aod::SGEvents::iterator; + void process(SGEvent const& event, aod::SGTracks const& tracks) { + histos.fill(HIST("Events"), event.gs()); for (const auto& track : tracks) { if (track.eta() < eta_min || track.eta() > eta_max) continue; From fde3bac107cbe2bdbcbe42220b2d0cabbc351518 Mon Sep 17 00:00:00 2001 From: Nasir Mehdi Malik <89008506+nasirmehdimalik@users.noreply.github.com> Date: Sat, 23 Nov 2024 01:37:59 +0530 Subject: [PATCH 053/459] [PWGLF] added e() memeber in reso. initilliser for mc particles and added occupancy cut in lamba1520_pb tasks (#8559) --- PWGLF/DataModel/LFResonanceTables.h | 4 ++- PWGLF/DataModel/LFResonanceTablesMergeDF.h | 4 ++- .../Resonances/LFResonanceInitializer.cxx | 4 ++- .../Resonances/LFResonanceMergeDF.cxx | 7 +++-- PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx | 31 +++++++++++++------ 5 files changed, 34 insertions(+), 16 deletions(-) diff --git a/PWGLF/DataModel/LFResonanceTables.h b/PWGLF/DataModel/LFResonanceTables.h index 195acbacaa9..2c74b52a1b6 100644 --- a/PWGLF/DataModel/LFResonanceTables.h +++ b/PWGLF/DataModel/LFResonanceTables.h @@ -339,7 +339,9 @@ DECLARE_SOA_TABLE(ResoMCParents, "AOD", "RESOMCPARENTS", resodaughter::Pz, resodaughter::Eta, resodaughter::Phi, - mcparticle::Y); + mcparticle::Y, + mcparticle::E, + mcparticle::StatusCode); using ResoMCParent = ResoMCParents::iterator; using Reso2TracksExt = soa::Join; // without Extra diff --git a/PWGLF/DataModel/LFResonanceTablesMergeDF.h b/PWGLF/DataModel/LFResonanceTablesMergeDF.h index bceb237faff..00ec4741956 100644 --- a/PWGLF/DataModel/LFResonanceTablesMergeDF.h +++ b/PWGLF/DataModel/LFResonanceTablesMergeDF.h @@ -44,6 +44,7 @@ DECLARE_SOA_COLUMN(BMagField, bMagField, float); //! Magnetic field } // namespace resocollisiondf DECLARE_SOA_TABLE(ResoCollisionDFs, "AOD", "RESOCOLLISIONDF", o2::soa::Index<>, + o2::aod::mult::MultNTracksPV, collision::PosX, collision::PosY, collision::PosZ, @@ -54,7 +55,8 @@ DECLARE_SOA_TABLE(ResoCollisionDFs, "AOD", "RESOCOLLISIONDF", resocollisiondf::EvtPlResAC, resocollisiondf::EvtPlResBC, resocollisiondf::BMagField, - timestamp::Timestamp); + timestamp::Timestamp, + evsel::NumTracksInTimeRange); using ResoCollisionDF = ResoCollisionDFs::iterator; // Resonance Daughters diff --git a/PWGLF/TableProducer/Resonances/LFResonanceInitializer.cxx b/PWGLF/TableProducer/Resonances/LFResonanceInitializer.cxx index 5f18062be42..23876a82286 100644 --- a/PWGLF/TableProducer/Resonances/LFResonanceInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/LFResonanceInitializer.cxx @@ -864,7 +864,9 @@ struct reso2initializer { mcPart.pz(), mcPart.eta(), mcPart.phi(), - mcPart.y()); + mcPart.y(), + mcPart.e(), + mcPart.statusCode()); daughterPDGs.clear(); } } diff --git a/PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx b/PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx index 9668afc3e01..9850a7bf23a 100644 --- a/PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx +++ b/PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx @@ -25,6 +25,7 @@ /// /// /// \author Bong-Hwi Lim /// Nasir Mehdi Malik +#include #include "Common/DataModel/PIDResponse.h" #include "Common/Core/TrackSelection.h" @@ -60,7 +61,6 @@ using namespace o2::soa; struct reso2dfmerged { // SliceCache cache; - Configurable nDF{"nDF", 1, "no of combination of collision"}; Configurable cpidCut{"cpidCut", 0, "pid cut"}; Configurable crejtpc{"crejtpc", 0, "reject electron pion"}; @@ -184,7 +184,7 @@ struct reso2dfmerged { const auto& innerVector = vecOfVecOfTuples[i]; histos.fill(HIST("Event/h1d_ft0_mult_percentile"), std::get<3>(tuple)); - resoCollisionsdf(std::get<0>(tuple), std::get<1>(tuple), std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple), std::get<5>(tuple), 0., 0., 0., 0, 0); + resoCollisionsdf(0, std::get<0>(tuple), std::get<1>(tuple), std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple), std::get<5>(tuple), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange()); // LOGF(info, "collisions: Index = %d ) %f - %f - %f %f %d -- %d", std::get<0>(tuple).globalIndex(),std::get<1>(tuple),std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple), std::get<5>(tuple).size(),resoCollisionsdf.lastIndex()); for (const auto& tuple : innerVector) { @@ -239,9 +239,10 @@ struct reso2dfmerged { if (doprocessTrackDataDF) LOG(fatal) << "Disable processTrackDataDF first!"; + histos.fill(HIST("Event/h1d_ft0_mult_percentile"), collision.cent()); - resoCollisionsdf(collision.posX(), collision.posY(), collision.posZ(), collision.cent(), collision.spherocity(), collision.evtPl(), 0., 0., 0., 0., 0); + resoCollisionsdf(0, collision.posX(), collision.posY(), collision.posZ(), collision.cent(), collision.spherocity(), collision.evtPl(), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange()); for (auto& track : tracks) { if (isPrimary && !track.isPrimaryTrack()) diff --git a/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx b/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx index 63f1c7d58d5..74234cb8bd1 100644 --- a/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/Centrality.h" @@ -42,6 +43,8 @@ struct lambdaAnalysis_pb { Preslice perRCol = aod::resodaughter::resoCollisionId; Preslice perCollision = aod::track::collisionId; // Configurables. + + Configurable ConfEvtOccupancyInTimeRange{"ConfEvtOccupancyInTimeRange", -1, "Evt sel: maximum track occupancy"}; Configurable nBinsPt{"nBinsPt", 100, "N bins in pT histogram"}; Configurable nBinsInvM{"nBinsInvM", 120, "N bins in InvMass histogram"}; Configurable lambda1520id{"lambda1520id", 3124, "pdg"}; @@ -138,7 +141,7 @@ struct lambdaAnalysis_pb { histos.add("QAbefore/Kaon/h2d_ka_nsigma_tof_vs_tpc", "n#sigma^{TPC} vs n#sigma^{TOF} Kaons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); // QA After - histos.add("QAafter/Proton/hd_pr_pt", "p_{T}-spectra Protons", kTH1F, {axisPt_pid}); + histos.add("QAafter/Proton/hd_pr_pt", "p_{T}-spectra Protons", kTH2F, {axisPt_pid, axisCent}); histos.add("QAafter/Proton/h2d_pr_dca_z", "dca_{z} Protons", kTH2F, {axisPt_pid, axisDCAz}); histos.add("QAafter/Proton/h2d_pr_dca_xy", "dca_{xy} Protons", kTH2F, {axisPt_pid, axisDCAxy}); histos.add("QAafter/Proton/h2d_pr_dEdx_p", "TPC Signal Protons", kTH2F, {axisP_pid, axisdEdx}); @@ -153,7 +156,7 @@ struct lambdaAnalysis_pb { histos.add("QAafter/Proton/h2d_Prka_nsigma_tof_p", " Protons kaon", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAafter/Proton/h2d_Prel_nsigma_tof_p", " Protons electron", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAafter/Proton/h2d_pr_nsigma_tof_vs_tpc", "n#sigma(TOF) vs n#sigma(TPC) Protons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); - histos.add("QAafter/Kaon/hd_ka_pt", "p_{T}-spectra Kaons", kTH1F, {axisPt_pid}); + histos.add("QAafter/Kaon/hd_ka_pt", "p_{T}-spectra Kaons", kTH2F, {axisPt_pid, axisCent}); histos.add("QAafter/Kaon/h2d_ka_dca_z", "dca_{z} Kaons", kTH2F, {axisPt_pid, axisDCAz}); histos.add("QAafter/Kaon/h2d_ka_dca_xy", "dca_{xy} Kaons", kTH2F, {axisPt_pid, axisDCAxy}); histos.add("QAafter/Kaon/h2d_ka_dEdx_p", "TPC Signal Kaon", kTH2F, {axisP_pid, axisdEdx}); @@ -427,7 +430,7 @@ struct lambdaAnalysis_pb { auto _tpcnsigmaPr = trkPr.tpcNSigmaPr(); // Proton - histos.fill(HIST("QAafter/Proton/hd_pr_pt"), _ptPr); + histos.fill(HIST("QAafter/Proton/hd_pr_pt"), _ptPr, mult); histos.fill(HIST("QAafter/Proton/h2d_pr_dca_z"), _ptPr, trkPr.dcaZ()); histos.fill(HIST("QAafter/Proton/h2d_pr_dca_xy"), _ptPr, trkPr.dcaXY()); histos.fill(HIST("QAafter/Proton/h2d_pr_dEdx_p"), p_ptot, trkPr.tpcSignal()); @@ -449,7 +452,7 @@ struct lambdaAnalysis_pb { auto _tpcnsigmaKa = trkKa.tpcNSigmaKa(); // Kaon - histos.fill(HIST("QAafter/Kaon/hd_ka_pt"), _ptKa); + histos.fill(HIST("QAafter/Kaon/hd_ka_pt"), _ptKa, mult); histos.fill(HIST("QAafter/Kaon/h2d_ka_dca_z"), _ptKa, trkKa.dcaZ()); histos.fill(HIST("QAafter/Kaon/h2d_ka_dca_xy"), _ptKa, trkKa.dcaXY()); histos.fill(HIST("QAafter/Kaon/h2d_ka_dEdx_p"), k_ptot, trkKa.tpcSignal()); @@ -558,6 +561,8 @@ struct lambdaAnalysis_pb { { // LOGF(info, " collisions: Index = %d %d", collision.globalIndex(),tracks.size()); + if (ConfEvtOccupancyInTimeRange > 0 && collision.trackOccupancyInTimeRange() > ConfEvtOccupancyInTimeRange) + return; histos.fill(HIST("Event/h1d_ft0_mult_percentile"), collision.cent()); fillDataHistos(tracks, tracks, collision.cent()); } @@ -597,7 +602,6 @@ struct lambdaAnalysis_pb { } for (auto const& part : resoParents) { - if (abs(part.pdgCode()) != lambda1520id) // // L* pdg_code = 3124 continue; if (abs(part.y()) > 0.5) { // rapidity cut @@ -616,7 +620,10 @@ struct lambdaAnalysis_pb { if (!pass1 || !pass2) // If we have both decay products continue; - auto mass = 1.520; // part.M() + + TLorentzVector p4; + p4.SetPxPyPzE(part.px(), part.py(), part.pz(), part.e()); + auto mass = p4.M(); if (part.pdgCode() > 0) histos.fill(HIST("Analysis/h3d_gen_lstar_PM"), mass, part.pt(), mult); else @@ -637,7 +644,8 @@ struct lambdaAnalysis_pb { SameKindPair pairs{binningPositions2, cNumMixEv, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip for (auto& [c1, t1, c2, t2] : pairs) { - + if (ConfEvtOccupancyInTimeRange > 0 && c1.trackOccupancyInTimeRange() > ConfEvtOccupancyInTimeRange && c2.trackOccupancyInTimeRange() > ConfEvtOccupancyInTimeRange) + return; // LOGF(info, "processMCMixedDerived: Mixed collisions : %d (%.3f, %.3f,%d), %d (%.3f, %.3f,%d)",c1.globalIndex(), c1.posZ(), c1.cent(),c1.mult(), c2.globalIndex(), c2.posZ(), c2.cent(),c2.mult()); histos.fill(HIST("Event/mixing_vzVsmultpercentile"), c1.cent(), c1.posZ(), c1.evtPl()); fillDataHistos(t1, t2, c1.cent()); @@ -656,7 +664,8 @@ struct lambdaAnalysis_pb { if (doprocessData) LOG(error) << "Disable processData() first!"; - + if (ConfEvtOccupancyInTimeRange > 0 && collision.trackOccupancyInTimeRange() > ConfEvtOccupancyInTimeRange) + return; // LOGF(info, "inside df collisions: Index = %d %d", collision.globalIndex(),tracks.size()); histos.fill(HIST("Event/h1d_ft0_mult_percentile"), collision.cent()); fillDataHistos(tracks, tracks, collision.cent()); @@ -676,6 +685,8 @@ struct lambdaAnalysis_pb { SameKindPair pairs{binningPositions2, cNumMixEv, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip for (auto& [c1, t1, c2, t2] : pairs) { + if (ConfEvtOccupancyInTimeRange > 0 && c1.trackOccupancyInTimeRange() > ConfEvtOccupancyInTimeRange && c2.trackOccupancyInTimeRange() > ConfEvtOccupancyInTimeRange) + return; // LOGF(info, "processMCMixedDerived: Mixed collisions : %d (%.3f, %.3f,%d), %d (%.3f, %.3f,%d)",c1.globalIndex(), c1.posZ(), c1.cent(),c1.mult(), c2.globalIndex(), c2.posZ(), c2.cent(),c2.mult()); histos.fill(HIST("Event/mixing_vzVsmultpercentile"), c1.cent(), c1.posZ(), c1.evtPl()); @@ -691,13 +702,13 @@ struct lambdaAnalysis_pb { if (doprocessMix || doprocessMixDF) LOG(fatal) << "Disable processMix() or processMixDF() first!"; LOGF(debug, "Event Mixing Started"); - BinningTypeEP binningPositions2{{cMixVtxBins, cMixMultBins, cMixEPAngle}, true}; auto tracksTuple = std::make_tuple(tracks); SameKindPair pairs{binningPositions2, cNumMixEv, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip for (auto& [c1, t1, c2, t2] : pairs) { - + if (ConfEvtOccupancyInTimeRange > 0 && c1.trackOccupancyInTimeRange() > ConfEvtOccupancyInTimeRange && c2.trackOccupancyInTimeRange() > ConfEvtOccupancyInTimeRange) + return; // LOGF(info, "processMCMixedDerived: Mixed collisions : %d (%.3f, %.3f,%.3f), %d (%.3f, %.3f, %.3f)",c1.globalIndex(), c1.posZ(), c1.cent(),c1.evtPl(), c2.globalIndex(), c2.posZ(), c2.cent(),c2.evtPl()); histos.fill(HIST("Event/mixing_vzVsmultpercentile"), c1.cent(), c1.posZ(), c1.evtPl()); fillDataHistos(t1, t2, c1.cent()); From b206030dcbb132e54d7b359585c1286522a73554 Mon Sep 17 00:00:00 2001 From: Rosario Turrisi Date: Sat, 23 Nov 2024 04:00:00 +0100 Subject: [PATCH 054/459] [DPG] Added TOF presence condition (#8550) --- DPG/Tasks/AOTTrack/qaMatchEff.cxx | 57 ++++++++++++++++++------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaMatchEff.cxx b/DPG/Tasks/AOTTrack/qaMatchEff.cxx index 086b1818364..ddcdf65766e 100644 --- a/DPG/Tasks/AOTTrack/qaMatchEff.cxx +++ b/DPG/Tasks/AOTTrack/qaMatchEff.cxx @@ -31,7 +31,10 @@ #include "Framework/AnalysisTask.h" #include "Framework/RunningWorkflowInfo.h" #include "Framework/runDataProcessing.h" - +// +#include "string" +#include "vector" +#include "set" // namespace extConfPar { @@ -139,6 +142,7 @@ struct qaMatchEff { // Other track settings // TRD presence Configurable isTRDThere{"isTRDThere", 2, "Integer to turn the presence of TRD off, on, don't care (0,1,anything else)"}; + Configurable isTOFThere{"isTOFThere", 2, "Integer to turn the presence of TOF off, on, don't care (0,1,anything else)"}; // Configurable isitMC{"isitMC", false, "Reading MC files, data if false"}; Configurable doDebug{"doDebug", false, "Flag of debug information"}; @@ -1504,6 +1508,11 @@ struct qaMatchEff { continue; if ((isTRDThere == 0) && track.hasTRD()) continue; + // choose if we keep the track according to the TOF presence requirement + if ((isTOFThere == 1) && !track.hasTOF()) + continue; + if ((isTOFThere == 0) && track.hasTOF()) + continue; // kinematic track seletions for all tracks if (!isTrackSelectedKineCuts(track)) @@ -2363,7 +2372,7 @@ struct qaMatchEff { histos.get(HIST("data/PID/etahist_tpc_noidminus"))->Fill(track.eta()); } } // not pions, nor kaons, nor protons - } // end if DATA + } // end if DATA // if (trkWITS && isTrackSelectedITSCuts(track)) { //////////////////////////////////////////// ITS tag inside TPC tagged if constexpr (IS_MC) { //////////////////////// MC @@ -2703,7 +2712,7 @@ struct qaMatchEff { // } } } // end if ITS - } // end if TPC + } // end if TPC // // // if (trkWITS) { @@ -2830,9 +2839,9 @@ struct qaMatchEff { histos.get(HIST("data/etahist_tpcits_pos"))->Fill(track.eta()); } } // end if ITS - } // end if TPC - // - } // end positive + } // end if TPC + // + } // end positive // // negative only if (track.signed1Pt() < 0) { @@ -2857,9 +2866,9 @@ struct qaMatchEff { histos.get(HIST("data/etahist_tpcits_neg"))->Fill(track.eta()); } } // end if ITS - } // end if TPC - // - } // end negative + } // end if TPC + // + } // end negative if constexpr (IS_MC) { // MC auto mcpart = track.mcParticle(); @@ -2883,7 +2892,7 @@ struct qaMatchEff { histos.get(HIST("MC/primsec/phihist_tpcits_prim"))->Fill(track.phi()); histos.get(HIST("MC/primsec/etahist_tpcits_prim"))->Fill(track.eta()); } // end if ITS - } // end if TPC + } // end if TPC // end if primaries } else if (mcpart.getProcess() == 4) { // @@ -2905,7 +2914,7 @@ struct qaMatchEff { histos.get(HIST("MC/primsec/phihist_tpcits_secd"))->Fill(track.phi()); histos.get(HIST("MC/primsec/etahist_tpcits_secd"))->Fill(track.eta()); } // end if ITS - } // end if TPC + } // end if TPC // end if secondaries from decay } else { // @@ -2927,8 +2936,8 @@ struct qaMatchEff { histos.get(HIST("MC/primsec/phihist_tpcits_secm"))->Fill(track.phi()); histos.get(HIST("MC/primsec/etahist_tpcits_secm"))->Fill(track.eta()); } // end if ITS - } // end if TPC - } // end if secondaries from material + } // end if TPC + } // end if secondaries from material // // protons only if (tpPDGCode == 2212) { @@ -2995,7 +3004,7 @@ struct qaMatchEff { histos.get(HIST("MC/PID/etahist_tpcits_prminus"))->Fill(track.eta()); } } // end if ITS - } // end if TPC + } // end if TPC } // // pions only @@ -3063,7 +3072,7 @@ struct qaMatchEff { histos.get(HIST("MC/PID/etahist_tpcits_piminus"))->Fill(track.eta()); } } // end if ITS - } // end if TPC + } // end if TPC // // only primary pions if (mcpart.isPhysicalPrimary()) { @@ -3076,7 +3085,7 @@ struct qaMatchEff { histos.get(HIST("MC/PID/phihist_tpcits_pi_prim"))->Fill(track.phi()); histos.get(HIST("MC/PID/etahist_tpcits_pi_prim"))->Fill(track.eta()); } // end if ITS - } // end if TPC + } // end if TPC // end if primaries } else if (mcpart.getProcess() == 4) { // @@ -3090,7 +3099,7 @@ struct qaMatchEff { histos.get(HIST("MC/PID/phihist_tpcits_pi_secd"))->Fill(track.phi()); histos.get(HIST("MC/PID/etahist_tpcits_pi_secd"))->Fill(track.eta()); } // end if ITS - } // end if TPC + } // end if TPC // end if secondaries from decay } else { // @@ -3104,9 +3113,9 @@ struct qaMatchEff { histos.get(HIST("MC/PID/phihist_tpcits_pi_secm"))->Fill(track.phi()); histos.get(HIST("MC/PID/etahist_tpcits_pi_secm"))->Fill(track.eta()); } // end if ITS - } // end if TPC - } // end if secondaries from material // - } // end pions only + } // end if TPC + } // end if secondaries from material // + } // end pions only // // no primary/sec-d pions if (!((tpPDGCode == 211) && (mcpart.isPhysicalPrimary()))) { @@ -3130,8 +3139,8 @@ struct qaMatchEff { histos.get(HIST("MC/PID/etahist_tpcits_nopi"))->Fill(track.eta()); histos.get(HIST("MC/PID/pdghist_num"))->Fill(pdg_fill); } // end if ITS - } // end if TPC - } // end if not prim/sec-d pi + } // end if TPC + } // end if not prim/sec-d pi // // kaons only if (tpPDGCode == 321) { @@ -3198,7 +3207,7 @@ struct qaMatchEff { histos.get(HIST("MC/PID/etahist_tpcits_kaminus"))->Fill(track.eta()); } } // end if ITS - } // end if TPC + } // end if TPC } // // pions and kaons together @@ -3212,7 +3221,7 @@ struct qaMatchEff { histos.get(HIST("MC/PID/phihist_tpcits_piK"))->Fill(track.phi()); histos.get(HIST("MC/PID/etahist_tpcits_piK"))->Fill(track.eta()); } // end if ITS - } // end if TPC + } // end if TPC } } // From d116a4078393d92f1c74ebb0bef645abac078f5b Mon Sep 17 00:00:00 2001 From: Hadi Hassan Date: Sat, 23 Nov 2024 08:53:04 +0200 Subject: [PATCH 055/459] [PWGJE] Making the code process events without using weight (#8566) --- PWGJE/Tasks/bjetTaggingML.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PWGJE/Tasks/bjetTaggingML.cxx b/PWGJE/Tasks/bjetTaggingML.cxx index 42f385a5c48..98b3542cc09 100644 --- a/PWGJE/Tasks/bjetTaggingML.cxx +++ b/PWGJE/Tasks/bjetTaggingML.cxx @@ -14,6 +14,10 @@ /// /// \author Hadi Hassan , University of Jyväskylä +#include +#include +#include + #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" #include "Framework/ASoA.h" @@ -84,6 +88,7 @@ struct BJetTaggingML { // event level configurables Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; + Configurable useEventWeight{"useEventWeight", true, "Flag whether to scale histograms with the event weight"}; Configurable pTHatMaxMCD{"pTHatMaxMCD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"}; Configurable pTHatMaxMCP{"pTHatMaxMCP", 999.0, "maximum fraction of hard scattering for jet acceptance in particle MC"}; @@ -450,7 +455,7 @@ struct BJetTaggingML { continue; } - float eventWeight = analysisJet.eventWeight(); + float eventWeight = useEventWeight ? analysisJet.eventWeight() : 1.0; float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); if (analysisJet.pt() > pTHatMaxMCD * pTHat) { continue; @@ -535,7 +540,7 @@ struct BJetTaggingML { continue; } - float eventWeight = mcpjet.eventWeight(); + float eventWeight = useEventWeight ? mcpjet.eventWeight() : 1.0; float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); if (mcpjet.pt() > pTHatMaxMCP * pTHat) { continue; @@ -582,7 +587,7 @@ struct BJetTaggingML { continue; } - float eventWeight = mcpjet.eventWeight(); + float eventWeight = useEventWeight ? mcpjet.eventWeight() : 1.0; float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); if (mcpjet.pt() > pTHatMaxMCP * pTHat) { continue; From c85854d700fdda8e0f7eb5a773f528f8a793100e Mon Sep 17 00:00:00 2001 From: Luca Barioglio Date: Sat, 23 Nov 2024 13:31:36 +0100 Subject: [PATCH 056/459] [PWGLF] Remove upfront filters to fix MC (#8570) --- PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx index b6e85e94367..82477987971 100644 --- a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx @@ -306,10 +306,8 @@ struct nucleiSpectra { int mRunNumber = 0; float mBz = 0.f; - Filter trackFilter = nabs(aod::track::eta) < cfgCutEta && aod::track::tpcInnerParam > cfgCutTpcMom; + using TrackCandidates = soa::Join; - using TrackCandidates = soa::Filtered>; - using TrackCandidatesMC = soa::Filtered>; // Collisions with chentrality using CollWithCent = soa::Join::iterator; @@ -524,7 +522,9 @@ struct nucleiSpectra { int nGloTracks[2]{0, 0}, nTOFTracks[2]{0, 0}; for (auto& track : tracks) { // start loop over tracks - if (track.itsNCls() < cfgCutNclusITS || + if (std::abs(track.eta()) > cfgCutEta || + track.tpcInnerParam() < cfgCutTpcMom || + track.itsNCls() < cfgCutNclusITS || track.tpcNClsFound() < cfgCutNclusTPC || track.tpcNClsCrossedRows() < 70 || track.tpcNClsCrossedRows() < 0.8 * track.tpcNClsFindable() || @@ -797,7 +797,7 @@ struct nucleiSpectra { PROCESS_SWITCH(nucleiSpectra, processDataFlowAlternative, "Data analysis with flow - alternative framework", false); Preslice tracksPerCollisions = aod::track::collisionId; - void processMC(soa::Join const& collisions, aod::McCollisions const& mcCollisions, TrackCandidatesMC const& tracks, aod::McParticles const& particlesMC, aod::BCsWithTimestamps const&) + void processMC(soa::Join const& collisions, aod::McCollisions const& mcCollisions, soa::Join const& tracks, aod::McParticles const& particlesMC, aod::BCsWithTimestamps const&) { nuclei::candidates.clear(); for (auto& c : mcCollisions) { From ebd5da73454829ba7db75185f4d68e055e24955b Mon Sep 17 00:00:00 2001 From: Luca Aglietta <75362880+Luca610@users.noreply.github.com> Date: Sat, 23 Nov 2024 22:21:29 +0100 Subject: [PATCH 057/459] [PWGHF] Fixed bug in Resonances Task (#8563) Co-authored-by: ALICE Action Bot --- .../candidateCreatorCharmResoReduced.cxx | 62 ++++++------- PWGHF/D2H/Tasks/taskCharmResoReduced.cxx | 90 +++++++++++-------- 2 files changed, 78 insertions(+), 74 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx index 0005fd09b96..062fb658128 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorCharmResoReduced.cxx @@ -35,6 +35,7 @@ using namespace o2::aod; using namespace o2::analysis; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::constants::physics; enum Selections : uint8_t { NoSel = 0, @@ -118,16 +119,6 @@ struct HfCandidateCreatorCharmResoReduced { Preslice candsDPerCollision = hf_track_index_reduced::hfRedCollisionId; Preslice candsDPerCollisionWithMl = hf_track_index_reduced::hfRedCollisionId; - // Useful constants - double massK0{0.}; - double massLambda{0.}; - double massProton{0.}; - double massPion{0.}; - double massKaon{0.}; - double massDplus{0.}; - double massDstar{0.}; - double massD0{0.}; - HistogramRegistry registry{"registry"}; void init(InitContext const&) @@ -140,10 +131,11 @@ struct HfCandidateCreatorCharmResoReduced { } // histograms const AxisSpec axisPt{(std::vector)vecBinsPt, "#it{p}_{T} (GeV/#it{c})"}; - registry.add("hMassDs1", "Ds1 candidates;m_{Ds1} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{200, 2.5, 2.7}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDs2Star", "Ds^{*}2 candidates; m_Ds^{*}2 (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {{100, 2.4, 2.7}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassXcRes", "XcRes candidates; m_XcRes (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {{100, 2.9, 3.3}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassLambdaDminus", "LambdaDminus candidates; m_LambdaDminus (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {{100, 2.9, 3.3}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + const AxisSpec axisMassDsj{400, 0.49f, 0.89f, ""}; + registry.add("hMassDs1", "Ds1 candidates;m_{Ds1} (GeV/#it{c}^{2});entries", {HistType::kTH2F, {axisMassDsj, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDs2Star", "Ds^{*}2 candidates; m_Ds^{*}2 (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {axisMassDsj, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassXcRes", "XcRes candidates; m_XcRes (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {{300, 1.1, 1.4}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassLambdaDminus", "LambdaDminus candidates; m_LambdaDminus (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {{300, 1.1, 1.4}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassDstarTrack", "DstarTrack candidates; m_DstarTrack (GeV/#it{c}^{2}) ;entries", {HistType::kTH2F, {{100, 0.9, 1.4}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); if (doprocessDs1ToDstarK0sMixedEvent) { registry.add("hNPvContCorr", "Collision number of PV contributors ; N contrib ; N contrib", {HistType::kTH2F, {{100, 0, 250}, {100, 0, 250}}}); @@ -163,15 +155,6 @@ struct HfCandidateCreatorCharmResoReduced { registry.get(HIST("hSelections"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); } } - // mass constants - massK0 = o2::constants::physics::MassK0Short; - massLambda = o2::constants::physics::MassLambda; - massProton = o2::constants::physics::MassProton; - massPion = o2::constants::physics::MassPiPlus; - massKaon = o2::constants::physics::MassKPlus; - massDplus = o2::constants::physics::MassDPlus; - massDstar = o2::constants::physics::MassDStar; - massD0 = o2::constants::physics::MassD0; } /// Basic selection of D candidates @@ -225,10 +208,10 @@ struct HfCandidateCreatorCharmResoReduced { return false; } if (channel == DecayChannel::Ds2StarToDplusK0s || channel == DecayChannel::Ds1ToDstarK0s) { - massV0 = massK0; + massV0 = MassK0Short; invMassV0 = candV0.invMassK0s(); } else if (channel == DecayChannel::XcToDplusLambda || channel == DecayChannel::LambdaDminus) { - massV0 = massLambda; + massV0 = MassLambda; int wsFact{1}; if (channel == DecayChannel::LambdaDminus) wsFact = -1; @@ -315,25 +298,30 @@ struct HfCandidateCreatorCharmResoReduced { float invMassReso{0.}; float invMassV0{0.}; std::array pVecV0Tr = {candV0Tr.px(), candV0Tr.py(), candV0Tr.pz()}; + std::array, 3> pVectorCharmProngs = {candD.pVectorProng0(), candD.pVectorProng1(), candD.pVectorProng2()}; float ptReso = RecoDecay::pt(RecoDecay::sumOfVec(pVecV0Tr, pVecD)); if constexpr (channel == DecayChannel::DstarTrack) { if (candD.dType() > 0) { - invMassReso = RecoDecay::m(std::array{candD.pVectorProng0(), candD.pVectorProng1(), candD.pVectorProng2(), pVecV0Tr}, std::array{massPion, massKaon, massPion, massProton}); + invMassReso = RecoDecay::m(std::array{pVectorCharmProngs[0], pVectorCharmProngs[1], pVectorCharmProngs[2], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassProton}); } else { - invMassReso = RecoDecay::m(std::array{candD.pVectorProng1(), candD.pVectorProng0(), candD.pVectorProng2(), pVecV0Tr}, std::array{massPion, massKaon, massPion, massProton}); + invMassReso = RecoDecay::m(std::array{pVectorCharmProngs[1], pVectorCharmProngs[0], pVectorCharmProngs[2], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassProton}); } registry.fill(HIST("hMassDstarTrack"), invMassReso - invMassD, ptReso); } else { switch (channel) { case DecayChannel::Ds1ToDstarK0s: invMassV0 = candV0Tr.invMassK0s(); - invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{massDstar, massK0}); + if (candD.dType() > 0) { + invMassReso = RecoDecay::m(std::array{pVectorCharmProngs[0], pVectorCharmProngs[1], pVectorCharmProngs[2], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassK0Short}) - invMassD; + } else { + invMassReso = RecoDecay::m(std::array{pVectorCharmProngs[1], pVectorCharmProngs[0], pVectorCharmProngs[2], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassK0Short}) - invMassD; + } registry.fill(HIST("hMassDs1"), invMassReso, ptReso); break; case DecayChannel::Ds2StarToDplusK0s: invMassV0 = candV0Tr.invMassK0s(); - invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{massDplus, massK0}); + invMassReso = RecoDecay::m(std::array{pVectorCharmProngs[0], pVectorCharmProngs[1], pVectorCharmProngs[2], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassK0Short}) - invMassD; registry.fill(HIST("hMassDs2Star"), invMassReso, ptReso); break; case DecayChannel::XcToDplusLambda: @@ -342,7 +330,7 @@ struct HfCandidateCreatorCharmResoReduced { } else { invMassV0 = candV0Tr.invMassAntiLambda(); } - invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{massDplus, massLambda}); + invMassReso = RecoDecay::m(std::array{pVectorCharmProngs[0], pVectorCharmProngs[1], pVectorCharmProngs[2], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassLambda}) - invMassD; registry.fill(HIST("hMassXcRes"), invMassReso, ptReso); break; case DecayChannel::LambdaDminus: @@ -351,7 +339,7 @@ struct HfCandidateCreatorCharmResoReduced { } else { invMassV0 = candV0Tr.invMassAntiLambda(); } - invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{massDplus, massLambda}); + invMassReso = RecoDecay::m(std::array{pVectorCharmProngs[0], pVectorCharmProngs[1], pVectorCharmProngs[2], pVecV0Tr}, std::array{MassPiPlus, MassKPlus, MassPiPlus, MassLambda}) - invMassD; registry.fill(HIST("hMassLambdaDminus"), invMassReso, ptReso); break; default: @@ -428,12 +416,12 @@ struct HfCandidateCreatorCharmResoReduced { switch (channel) { case DecayChannel::Ds1ToDstarK0s: invMassV0 = bachV0Tr.invMassK0s(); - invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{massDstar, massK0}); + invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{MassDStar, MassK0Short}); registry.fill(HIST("hMassDs1"), invMassReso, ptReso); break; case DecayChannel::Ds2StarToDplusK0s: invMassV0 = bachV0Tr.invMassK0s(); - invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{massDplus, massK0}); + invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{MassDPlus, MassK0Short}); registry.fill(HIST("hMassDs2Star"), invMassReso, ptReso); break; case DecayChannel::XcToDplusLambda: @@ -442,7 +430,7 @@ struct HfCandidateCreatorCharmResoReduced { } else { invMassV0 = bachV0Tr.invMassAntiLambda(); } - invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{massDplus, massLambda}); + invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{MassDPlus, MassLambda}); registry.fill(HIST("hMassXcRes"), invMassReso, ptReso); break; case DecayChannel::LambdaDminus: @@ -451,7 +439,7 @@ struct HfCandidateCreatorCharmResoReduced { } else { invMassV0 = bachV0Tr.invMassAntiLambda(); } - invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{massDplus, massLambda}); + invMassReso = RecoDecay::m(std::array{pVecD, pVecV0Tr}, std::array{MassDPlus, MassLambda}); registry.fill(HIST("hMassLambdaDminus"), invMassReso, ptReso); break; default: @@ -649,7 +637,7 @@ struct HfCandidateCreatorCharmResoReducedExpressions { // Configurable axis ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0., 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 8.f, 12.f, 24.f, 50.f}, "#it{p}_{T} (GeV/#it{c})"}; - ConfigurableAxis axisInvMassReso{"axisInvMassReso", {200, 2.5, 2.7}, "inv. mass (DV_{0}) (GeV/#it{c}^{2})"}; + ConfigurableAxis axisInvMassReso{"axisInvMassReso", {400, 0.49f, 0.89f}, "inv. mass (DV_{0}) (GeV/#it{c}^{2})"}; ConfigurableAxis axisInvMassProng0{"axisInvMassProng0", {200, 0.14, 0.17}, "inv. mass (D) (GeV/#it{c}^{2})"}; ConfigurableAxis axisInvMassProng1{"axisInvMassProng1", {200, 0.47, 0.53}, "inv. mass ({V}_{0}) (GeV/#it{c}^{2})"}; ConfigurableAxis axisInvMassD0{"axisInvMassD0", {200, 1.65, 2.05}, "inv. mass ({V}_{0}) (GeV/#it{c}^{2})"}; @@ -708,7 +696,7 @@ struct HfCandidateCreatorCharmResoReducedExpressions { break; } if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the D-Pi creator - // rowResoMcRec(0, -1, -1, -1.f); + rowResoMcRec(0, -1, -1, -1.f); registry.fill(HIST("hMassMcNoEntry"), candReso.invMass(), candReso.pt()); } } diff --git a/PWGHF/D2H/Tasks/taskCharmResoReduced.cxx b/PWGHF/D2H/Tasks/taskCharmResoReduced.cxx index 6890975926c..7126e02258f 100644 --- a/PWGHF/D2H/Tasks/taskCharmResoReduced.cxx +++ b/PWGHF/D2H/Tasks/taskCharmResoReduced.cxx @@ -114,6 +114,11 @@ DECLARE_SOA_TABLE(HfCandResoLites, "AOD", "HFCANDRESOLITE", //! Table with some hf_cand_reso_lite::PtGen, hf_cand_reso_lite::SignD0); +DECLARE_SOA_TABLE(HfGenResoLites, "AOD", "HFGENRESOLITE", //! Table with some B0 properties + hf_cand_reso_lite::Pt, + hf_cand_reso_lite::Y, + hf_cand_reso_lite::Origin); + } // namespace o2::aod enum DecayChannel : uint8_t { @@ -125,13 +130,14 @@ enum DecayChannel : uint8_t { struct HfTaskCharmResoReduced { Produces hfCandResoLite; - Configurable ptMinReso{"ptMinReso", 5, "Discard events with smaller pT"}; + Produces hfGenResoLite; + Configurable ptMinReso{"ptMinReso", -1, "Discard events with smaller pT"}; Configurable fillTrees{"fillTrees", false, "Fill output Trees"}; Configurable fillSparses{"fillSparses", false, "Fill output Sparses"}; Configurable useDeltaMass{"useDeltaMass", false, "Use Delta Mass for resonance invariant Mass calculation"}; Configurable fillOnlySignal{"fillOnlySignal", false, "Flag to Fill only signal candidates (MC only)"}; Configurable yCandGenMax{"yCandGenMax", 0.5, "max. gen particle rapidity"}; - Configurable yCandRecoMax{"yCandRecoMax", 0.8, "max. cand. rapidity"}; + Configurable yCandRecoMax{"yCandRecoMax", -1, "max. cand. rapidity"}; Configurable etaTrackMax{"etaTrackMax", 0.8, "max. track pseudo-rapidity for acceptance calculation"}; Configurable ptTrackMin{"ptTrackMin", 0.1, "min. track transverse momentum for acceptance calculation"}; // Configurables axis for histos @@ -152,7 +158,7 @@ struct HfTaskCharmResoReduced { using ReducedResoWithMl = soa::Join; using ReducedResoMc = soa::Join; using ReducedResoWithMlMc = soa::Join; - using CharmBach = soa::Join; + // Histogram Registry HistogramRegistry registry; @@ -165,13 +171,15 @@ struct HfTaskCharmResoReduced { registry.add("hPt", "Charm resonance candidates pT", {HistType::kTH1F, {axisPt}}); registry.add("hPtProng0", "D daughters pT", {HistType::kTH1F, {axisPtProng0}}); registry.add("hPtProng1", "V0 daughter pT", {HistType::kTH1F, {axisPtProng1}}); - registry.add("hNPvCont", "Collision number of PV contributors ; N contrib ; entries", {HistType::kTH1F, {{100, 0, 250}}}); + registry.add("hNPvCont", "Collision number of PV contributors ; N contrib ; entries", {HistType::kTH1F, {{125, -0.5, 249.5}}}); registry.add("hZvert", "Collision Z Vtx ; z PV [cm] ; entries", {HistType::kTH1F, {{120, -12., 12.}}}); registry.add("hBz", "Collision Bz ; Bz [T] ; entries", {HistType::kTH1F, {{20, -10., 10.}}}); registry.add("hSparse", "THn for production studies with cosThStar and BDT scores", HistType::kTHnSparseF, {axisPt, axisPtProng0, axisPtProng1, axisInvMassReso, axisInvMassProng0, axisInvMassProng1, axisCosThetaStar, axisBkgBdtScore, axisNonPromptBdtScore}); - if (doprocessDs1Mc || doprocessDs2StarMc) { + if (doprocessDs1Mc || doprocessDs2StarMc || doprocessDs1McWithMl || doprocessDs2StarMcWithMl) { // gen histos + registry.add("hYRecPrompt", "Charm resonance candidates pT", {HistType::kTH2F, {axisPt, axisEta}}); + registry.add("hYRecNonPrompt", "Charm resonance candidates pT", {HistType::kTH2F, {axisPt, axisEta}}); registry.add("hYGenPrompt", "Prompt {D_{S}}^j particles (generated);#it{p}_{T}^{gen}({D_{S}}^j) (GeV/#it{c});#it{y}^{gen}({D_{S}}^j);entries", {HistType::kTH2F, {axisPt, axisEta}}); registry.add("hYGenPromptWithProngsInAcceptance", "Prompt {D_{S}}^j particles (generated-daughters in acceptance);#it{p}_{T}^{gen}({D_{S}}^j) (GeV/#it{c});#it{y}^{gen}({D_{S}}^j);entries", {HistType::kTH2F, {axisPt, axisEta}}); registry.add("hYGenNonPrompt", "NonPrompt {D_{S}}^j particles (generated);#it{p}_{T}^{gen}({D_{S}}^j) (GeV/#it{c});#it{y}^{gen}({D_{S}}^j);entries", {HistType::kTH2F, {axisPt, axisEta}}); @@ -250,7 +258,19 @@ struct HfTaskCharmResoReduced { origin = candidate.origin(); flagMcMatchRec = candidate.flagMcMatchRec(); debugMcRec = candidate.debugMcRec(); - // signD0 = candidate.signD0(); + if (fillOnlySignal) { + if (channel == DecayChannel::Ds1ToDstarK0s && !(std::abs(flagMcMatchRec) == DecayTypeMc::Ds1ToDStarK0ToD0PiK0s || std::abs(flagMcMatchRec) == DecayTypeMc::Ds1ToDStarK0ToD0PiK0sPart || std::abs(flagMcMatchRec) == DecayTypeMc::Ds1ToDStarK0ToD0NoPiK0sPart || std::abs(flagMcMatchRec) == DecayTypeMc::Ds1ToDStarK0ToD0PiK0sOneMu)) { + return; + } + if (channel == DecayChannel::Ds2StarToDplusK0s && !(std::abs(flagMcMatchRec) == DecayTypeMc::Ds2StarToDplusK0sToPiKaPiPiPi || std::abs(flagMcMatchRec) == DecayTypeMc::Ds2StarToDplusK0sOneMu)) { + return; + } + } + if (origin == 1) { + registry.fill(HIST("hYRecPrompt"), candidate.pt(), y); + } else if (origin == 2) { + registry.fill(HIST("hYRecNonPrompt"), candidate.pt(), y); + } } float mlScoreBkg{-1.}, mlScorePrompt{-1.}, mlScoreNonPrompt{-1.}; if constexpr (withMl) { @@ -263,23 +283,16 @@ struct HfTaskCharmResoReduced { registry.fill(HIST("hZvert"), collision.posZ()); registry.fill(HIST("hBz"), collision.bz()); // Candidate properties - registry.fill(HIST("hMass"), candidate.invMass()); - registry.fill(HIST("hMassProng0"), candidate.invMassProng0()); - registry.fill(HIST("hMassProng1"), candidate.invMassProng1()); + registry.fill(HIST("hMass"), invMassReso); + registry.fill(HIST("hMassProng0"), invMassBach0); + registry.fill(HIST("hMassProng1"), invMassBach1); registry.fill(HIST("hPt"), candidate.pt()); registry.fill(HIST("hPtProng0"), candidate.ptProng0()); registry.fill(HIST("hPtProng1"), candidate.ptProng1()); if (fillSparses) { - registry.fill(HIST("hSparse"), candidate.pt(), candidate.ptProng0(), candidate.ptProng1(), candidate.invMass(), candidate.invMassProng0(), candidate.invMassProng1(), cosThetaStar, mlScoreBkg, mlScoreNonPrompt); - } - if (doMc && fillOnlySignal) { - if (channel == DecayChannel::Ds1ToDstarK0s && !(std::abs(flagMcMatchRec) == DecayTypeMc::Ds1ToDStarK0ToD0PiK0s || std::abs(flagMcMatchRec) == DecayTypeMc::Ds1ToDStarK0ToD0PiK0sPart || std::abs(flagMcMatchRec) == DecayTypeMc::Ds1ToDStarK0ToD0NoPiK0sPart || std::abs(flagMcMatchRec) == DecayTypeMc::Ds1ToDStarK0ToD0PiK0sOneMu)) { - return; - } - if (channel == DecayChannel::Ds2StarToDplusK0s && !(std::abs(flagMcMatchRec) == DecayTypeMc::Ds2StarToDplusK0sToPiKaPiPiPi || std::abs(flagMcMatchRec) == DecayTypeMc::Ds1ToDStarK0ToDPlusPi0K0s || std::abs(flagMcMatchRec) == DecayTypeMc::Ds2StarToDplusK0sOneMu)) { - return; - } + registry.fill(HIST("hSparse"), candidate.pt(), candidate.ptProng0(), candidate.ptProng1(), invMassReso, invMassBach0, invMassBach1, cosThetaStar, mlScoreBkg, mlScoreNonPrompt); } + if (fillTrees) { hfCandResoLite( invMassReso, @@ -323,11 +336,11 @@ struct HfTaskCharmResoReduced { /// \param CharmBach is the reduced 3 prong table /// \param V0Bach is the reduced v0 table /// \param Cand is the candidates table - template - void processData(Coll const&, Candidates const& candidates) + template + void processData(Coll const&, Candidates const& candidates, CharmBach const&, aod::HfRedVzeros const&) { for (const auto& cand : candidates) { - if (cand.pt() < ptMinReso) { + if (ptMinReso >= 0 && cand.pt() < ptMinReso) { continue; } float pdgMassReso{0}; @@ -391,59 +404,62 @@ struct HfTaskCharmResoReduced { registry.fill(HIST("hPtYWithProngsInAccepanceGenSig"), ptParticle, yParticle, originParticle, flag); } } + if (fillTrees) { + hfGenResoLite(ptParticle, yParticle, originParticle); + } } } // fillCandMcGen // process functions - void processDs1Data(aod::HfRedCollisions const& collisions, ReducedReso const& candidates) + void processDs1Data(aod::HfRedCollisions const& collisions, ReducedReso const& candidates, aod::HfRed3PrNoTrks const& charmBachs, aod::HfRedVzeros const& v0Bachs) { - processData(collisions, candidates); + processData(collisions, candidates, charmBachs, v0Bachs); } PROCESS_SWITCH(HfTaskCharmResoReduced, processDs1Data, "Process data for Ds1 analysis without Ml", true); - void processDs1DataWithMl(aod::HfRedCollisions const& collisions, ReducedResoWithMl const& candidates) + void processDs1DataWithMl(aod::HfRedCollisions const& collisions, ReducedResoWithMl const& candidates, soa::Join const& charmBachs, aod::HfRedVzeros const& v0Bachs) { - processData(collisions, candidates); + processData(collisions, candidates, charmBachs, v0Bachs); } PROCESS_SWITCH(HfTaskCharmResoReduced, processDs1DataWithMl, "Process data for Ds1 analysis with Ml", false); - void processDs2StarData(aod::HfRedCollisions const& collisions, ReducedReso const& candidates) + void processDs2StarData(aod::HfRedCollisions const& collisions, ReducedReso const& candidates, aod::HfRed3PrNoTrks const& charmBachs, aod::HfRedVzeros const& v0Bachs) { - processData(collisions, candidates); + processData(collisions, candidates, charmBachs, v0Bachs); } PROCESS_SWITCH(HfTaskCharmResoReduced, processDs2StarData, "Process data Ds2Star analysis without Ml", false); - void processDs2StarDataWithMl(aod::HfRedCollisions const& collisions, ReducedResoWithMl const& candidates) + void processDs2StarDataWithMl(aod::HfRedCollisions const& collisions, ReducedResoWithMl const& candidates, soa::Join const& charmBachs, aod::HfRedVzeros const& v0Bachs) { - processData(collisions, candidates); + processData(collisions, candidates, charmBachs, v0Bachs); } PROCESS_SWITCH(HfTaskCharmResoReduced, processDs2StarDataWithMl, "Process data Ds2Star analysis with Ml", false); - void processDs1Mc(aod::HfRedCollisions const& collisions, ReducedResoMc const& candidates, aod::HfMcGenRedResos const& mcParticles) + void processDs1Mc(aod::HfRedCollisions const& collisions, ReducedResoMc const& candidates, aod::HfMcGenRedResos const& mcParticles, aod::HfRed3PrNoTrks const& charmBachs, aod::HfRedVzeros const& v0Bachs) { - processData(collisions, candidates); + processData(collisions, candidates, charmBachs, v0Bachs); fillCandMcGen(mcParticles); } PROCESS_SWITCH(HfTaskCharmResoReduced, processDs1Mc, "Process Mc for Ds1 analysis without Ml", false); - void processDs1McWithMl(aod::HfRedCollisions const& collisions, ReducedResoWithMlMc const& candidates, aod::HfMcGenRedResos const& mcParticles) + void processDs1McWithMl(aod::HfRedCollisions const& collisions, ReducedResoWithMlMc const& candidates, aod::HfMcGenRedResos const& mcParticles, soa::Join const& charmBachs, aod::HfRedVzeros const& v0Bachs) { - processData(collisions, candidates); + processData(collisions, candidates, charmBachs, v0Bachs); fillCandMcGen(mcParticles); } PROCESS_SWITCH(HfTaskCharmResoReduced, processDs1McWithMl, "Process Mc for Ds1 analysis with Ml", false); - void processDs2StarMc(aod::HfRedCollisions const& collisions, ReducedResoMc const& candidates, aod::HfMcGenRedResos const& mcParticles) + void processDs2StarMc(aod::HfRedCollisions const& collisions, ReducedResoMc const& candidates, aod::HfMcGenRedResos const& mcParticles, aod::HfRed3PrNoTrks const& charmBachs, aod::HfRedVzeros const& v0Bachs) { - processData(collisions, candidates); + processData(collisions, candidates, charmBachs, v0Bachs); fillCandMcGen(mcParticles); } PROCESS_SWITCH(HfTaskCharmResoReduced, processDs2StarMc, "Process Mc for Ds2Star analysis without Ml", false); - void processDs2StarMcWithMl(aod::HfRedCollisions const& collisions, ReducedResoWithMlMc const& candidates, aod::HfMcGenRedResos const& mcParticles) + void processDs2StarMcWithMl(aod::HfRedCollisions const& collisions, ReducedResoWithMlMc const& candidates, aod::HfMcGenRedResos const& mcParticles, soa::Join const& charmBachs, aod::HfRedVzeros const& v0Bachs) { - processData(collisions, candidates); + processData(collisions, candidates, charmBachs, v0Bachs); fillCandMcGen(mcParticles); } PROCESS_SWITCH(HfTaskCharmResoReduced, processDs2StarMcWithMl, "Process Mc for Ds2Star analysis with Ml", false); From 9194bcc70797176bd170165a2a4fb13433f16075 Mon Sep 17 00:00:00 2001 From: Marcellocosti <96481191+Marcellocosti@users.noreply.github.com> Date: Sun, 24 Nov 2024 05:54:23 +0100 Subject: [PATCH 058/459] [PWGHF] Occupancy studies in Pb-Pb collisions for D mesons (#8475) Co-authored-by: ALICE Action Bot --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 117 +++++++++++++++++++++-- PWGHF/Utils/utilsEvSelHf.h | 32 ++++++- 2 files changed, 138 insertions(+), 11 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 25f0803bdb9..2d84a9afdf8 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -15,6 +15,9 @@ /// \author S. Politanò, INFN Torino, Italy /// \author Wu Chuntai, CUG, China +#include +#include + #include "CCDB/BasicCCDBManager.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" @@ -61,6 +64,8 @@ struct HfTaskFlowCharmHadrons { Configurable centralityMax{"centralityMax", 100., "Maximum centrality accepted in SP/EP computation (not applied in resolution process)"}; Configurable storeEP{"storeEP", false, "Flag to store EP-related axis"}; Configurable storeMl{"storeMl", false, "Flag to store ML scores"}; + Configurable occEstimator{"occEstimator", 1, "Occupancy estimation (1: ITS, 2: FT0C)"}; + Configurable storeOccupancy{"storeOccupancy", false, "Flag to store TH2 occITS/occFT0C + HfEvSelBitMasks"}; Configurable saveEpResoHisto{"saveEpResoHisto", false, "Flag to save event plane resolution histogram"}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable> classMl{"classMl", {0, 2}, "Indexes of BDT scores to be stored. Two indexes max."}; @@ -73,6 +78,13 @@ struct HfTaskFlowCharmHadrons { ConfigurableAxis thnConfigAxisScalarProd{"thnConfigAxisScalarProd", {100, 0., 1.}, ""}; ConfigurableAxis thnConfigAxisMlOne{"thnConfigAxisMlOne", {1000, 0., 1.}, ""}; ConfigurableAxis thnConfigAxisMlTwo{"thnConfigAxisMlTwo", {1000, 0., 1.}, ""}; + ConfigurableAxis thnConfigAxisOccupancyITS{"thnConfigAxisOccupancyITS", {14, 0, 14000}, ""}; + ConfigurableAxis thnConfigAxisOccupancyFT0C{"thnConfigAxisOccupancyFT0C", {14, 0, 140000}, ""}; + ConfigurableAxis thnConfigAxisNoSameBunchPileup{"thnConfigAxisNoSameBunchPileup", {2, 0, 2}, ""}; + ConfigurableAxis thnConfigAxisNumTracksInTimeRange{"thnConfigAxisNumTracksInTimeRange", {2, 0, 2}, ""}; + ConfigurableAxis thnConfigAxisNoCollInTimeRangeNarrow{"thnConfigAxisNoCollInTimeRangeNarrow", {2, 0, 2}, ""}; + ConfigurableAxis thnConfigAxisNoCollInTimeRangeStandard{"thnConfigAxisNoCollInTimeRangeStandard", {2, 0, 2}, ""}; + ConfigurableAxis thnConfigAxisNoCollInRofStandard{"thnConfigAxisNoCollInRofStandard", {2, 0, 2}, ""}; using CandDsDataWMl = soa::Filtered>; using CandDsData = soa::Filtered>; @@ -120,6 +132,13 @@ struct HfTaskFlowCharmHadrons { const AxisSpec thnAxisScalarProd{thnConfigAxisScalarProd, "SP"}; const AxisSpec thnAxisMlOne{thnConfigAxisMlOne, "Bkg score"}; const AxisSpec thnAxisMlTwo{thnConfigAxisMlTwo, "FD score"}; + const AxisSpec thnAxisOccupancyITS{thnConfigAxisOccupancyITS, "OccupancyITS"}; + const AxisSpec thnAxisOccupancyFT0C{thnConfigAxisOccupancyFT0C, "OccupancyFT0C"}; + const AxisSpec thnAxisNoSameBunchPileup{thnConfigAxisNoSameBunchPileup, "NoSameBunchPileup"}; + const AxisSpec thnAxisNumTracksInTimeRange{thnConfigAxisNumTracksInTimeRange, "NumTracksInTimeRange"}; + const AxisSpec thnAxisNoCollInTimeRangeNarrow{thnConfigAxisNoCollInTimeRangeNarrow, "NoCollInTimeRangeNarrow"}; + const AxisSpec thnAxisNoCollInTimeRangeStandard{thnConfigAxisNoCollInTimeRangeStandard, "NoCollInTimeRangeStandard"}; + const AxisSpec thnAxisNoCollInRofStandard{thnConfigAxisNoCollInRofStandard, "NoCollInRofStandard"}; std::vector axes = {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisScalarProd}; if (storeEP) { @@ -128,8 +147,21 @@ struct HfTaskFlowCharmHadrons { if (storeMl) { axes.insert(axes.end(), {thnAxisMlOne, thnAxisMlTwo}); } + if (storeOccupancy) { + if (occEstimator == 1) { + axes.insert(axes.end(), {thnAxisOccupancyITS, thnAxisNoSameBunchPileup, thnAxisNumTracksInTimeRange, + thnAxisNoCollInTimeRangeNarrow, thnAxisNoCollInTimeRangeStandard, thnAxisNoCollInRofStandard}); + } else { + axes.insert(axes.end(), {thnAxisOccupancyFT0C, thnAxisNoSameBunchPileup, thnAxisNumTracksInTimeRange, + thnAxisNoCollInTimeRangeNarrow, thnAxisNoCollInTimeRangeStandard, thnAxisNoCollInRofStandard}); + } + } registry.add("hSparseFlowCharm", "THn for SP", HistType::kTHnSparseF, axes); + if (storeOccupancy) { + registry.add("trackOccVsFT0COcc", "trackOccVsFT0COcc; trackOcc; FT0COcc", {HistType::kTH2F, {thnAxisOccupancyITS, thnAxisOccupancyFT0C}}); + } + if (doprocessResolution) { // enable resolution histograms only for resolution process registry.add("spReso/hSpResoFT0cFT0a", "hSpResoFT0cFT0a; centrality; Q_{FT0c} #bullet Q_{FT0a}", {HistType::kTH2F, {thnAxisCent, thnAxisScalarProd}}); registry.add("spReso/hSpResoFT0cFV0a", "hSpResoFT0cFV0a; centrality; Q_{FT0c} #bullet Q_{FV0a}", {HistType::kTH2F, {thnAxisCent, thnAxisScalarProd}}); @@ -236,29 +268,89 @@ struct HfTaskFlowCharmHadrons { /// \param cosDeltaPhi is the cosine of the n*(phi - evtPl) angle /// \param sp is the scalar product /// \param outputMl are the ML scores + /// \param occupancy is the occupancy of the collision using the track estimator + /// \param hfevselflag flag of the collision associated to utilsEvSelHf.h void fillThn(float& mass, float& pt, float& cent, float& cosNPhi, float& cosDeltaPhi, float& sp, - std::vector& outputMl) + std::vector& outputMl, + float& occupancy, + uint16_t& hfevselflag) { - if (storeMl) { - if (storeEP) { - registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, cosNPhi, cosDeltaPhi, outputMl[0], outputMl[1]); + if (storeOccupancy) { + if (storeMl) { + if (storeEP) { + registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, cosNPhi, cosDeltaPhi, outputMl[0], outputMl[1], occupancy, + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NumTracksInTimeRange), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)); + } else { + registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, outputMl[0], outputMl[1], occupancy, + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NumTracksInTimeRange), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)); + } } else { - registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, outputMl[0], outputMl[1]); + if (storeEP) { + registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, cosNPhi, cosDeltaPhi, occupancy, + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NumTracksInTimeRange), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)); + } else { + registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, occupancy, + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NumTracksInTimeRange), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)); + } } } else { - if (storeEP) { - registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, cosNPhi, cosDeltaPhi); + if (storeMl) { + if (storeEP) { + registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, cosNPhi, cosDeltaPhi, outputMl[0], outputMl[1]); + } else { + registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, outputMl[0], outputMl[1]); + } } else { - registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp); + if (storeEP) { + registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, cosNPhi, cosDeltaPhi); + } else { + registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp); + } } } } + /// Get the occupancy + /// \param collision is the collision with the occupancy information + float getOccupancy(CollsWithQvecs::iterator const& collision) + { + float occupancy = -999.; + switch (occEstimator) { + case 1: + occupancy = collision.trackOccupancyInTimeRange(); + break; + case 2: + occupancy = collision.ft0cOccupancyInTimeRange(); + break; + default: + LOG(warning) << "Occupancy estimator not valid. Possible values are ITS or FT0C. Fallback to ITS"; + occupancy = collision.trackOccupancyInTimeRange(); + break; + } + return occupancy; + } + /// Get the centrality /// \param collision is the collision with the centrality information float getCentrality(CollsWithQvecs::iterator const& collision) @@ -360,6 +452,13 @@ struct HfTaskFlowCharmHadrons { if (cent < centralityMin || cent > centralityMax) { return; } + float occupancy = 0.; + uint16_t hfevflag; + if (storeOccupancy) { + occupancy = getOccupancy(collision); + registry.fill(HIST("trackOccVsFT0COcc"), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange()); + hfevflag = hfEvSel.getHfCollisionRejectionMask(collision, cent, ccdb, registry); + } std::vector qVecs = getQvec(collision); float xQVec = qVecs[0]; @@ -459,7 +558,7 @@ struct HfTaskFlowCharmHadrons { float scalprodCand = cosNPhi * xQVec + sinNPhi * yQVec; float cosDeltaPhi = std::cos(harmonic * (phiCand - evtPl)); - fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMl); + fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMl, occupancy, hfevflag); } } diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index d1ffe2038e2..71f0bd0559d 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -48,6 +48,9 @@ enum EventRejection { NContrib, Chi2, PositionZ, + NoCollInTimeRangeNarrow, + NoCollInTimeRangeStandard, + NoCollInRofStandard, NEventRejection }; @@ -73,6 +76,9 @@ void setEventRejectionLabels(Histo& hRejection, std::string softwareTriggerLabel hRejection->GetXaxis()->SetBinLabel(EventRejection::NContrib + 1, "# of PV contributors"); hRejection->GetXaxis()->SetBinLabel(EventRejection::Chi2 + 1, "PV #it{#chi}^{2}"); hRejection->GetXaxis()->SetBinLabel(EventRejection::PositionZ + 1, "PV #it{z}"); + hRejection->GetXaxis()->SetBinLabel(EventRejection::NoCollInTimeRangeNarrow + 1, "No coll timerange narrow"); + hRejection->GetXaxis()->SetBinLabel(EventRejection::NoCollInTimeRangeStandard + 1, "No coll timerange strict"); + hRejection->GetXaxis()->SetBinLabel(EventRejection::NoCollInRofStandard + 1, "No coll in ROF std"); } struct HfEventSelection : o2::framework::ConfigurableGroup { @@ -88,12 +94,16 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable useIsGoodZvtxFT0vsPV{"useIsGoodZvtxFT0vsPV", false, "Check consistency between PVz from central barrel with that from FT0 timing"}; o2::framework::Configurable useNoSameBunchPileup{"useNoSameBunchPileup", false, "Exclude collisions in bunches with more than 1 reco. PV"}; // POTENTIALLY BAD FOR BEAUTY ANALYSES o2::framework::Configurable useNumTracksInTimeRange{"useNumTracksInTimeRange", false, "Apply occupancy selection (num. ITS tracks with at least 5 clusters in +-100us from current collision)"}; + o2::framework::Configurable useFT0cOccEstimator{"useFT0cOccEstimator", false, "Adopt FT0c amplitudes as occupancy estimator instead of ITS tracks"}; o2::framework::Configurable numTracksInTimeRangeMin{"numTracksInTimeRangeMin", 0, "Minimum occupancy"}; o2::framework::Configurable numTracksInTimeRangeMax{"numTracksInTimeRangeMax", 1000000, "Maximum occupancy"}; o2::framework::Configurable nPvContributorsMin{"nPvContributorsMin", 0, "Minimum number of PV contributors"}; o2::framework::Configurable chi2PvMax{"chi2PvMax", -1.f, "Maximum PV chi2"}; o2::framework::Configurable zPvPosMin{"zPvPosMin", -10.f, "Minimum PV posZ (cm)"}; o2::framework::Configurable zPvPosMax{"zPvPosMax", 10.f, "Maximum PV posZ (cm)"}; + o2::framework::Configurable useNoCollInTimeRangeNarrow{"useNoCollInTimeRangeNarrow", false, "Reject collisions in time range narrow"}; + o2::framework::Configurable useNoCollInTimeRangeStandard{"useNoCollInTimeRangeStandard", false, "Reject collisions in time range strict"}; + o2::framework::Configurable useNoCollInRofStandard{"useNoCollInRofStandard", false, "Reject collisions in ROF standard"}; o2::framework::Configurable softwareTrigger{"softwareTrigger", "", "Label of software trigger. Multiple triggers can be selected dividing them by a comma. Set None if you want bcs that are not selected by any trigger"}; o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "Users/m/mpuccio/EventFiltering/OTS/", "ccdb path for ZORRO objects"}; @@ -189,9 +199,27 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { if (useNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { SETBIT(rejectionMask, EventRejection::NoSameBunchPileup); } - /// occupancy estimator (ITS tracks with at least 5 clusters in +-10us from current collision) + /// No collisions in time range narrow + if (useNoCollInTimeRangeNarrow && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { + SETBIT(rejectionMask, EventRejection::NoCollInTimeRangeNarrow); + } + /// No collisions in time range strict + if (useNoCollInTimeRangeStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + SETBIT(rejectionMask, EventRejection::NoCollInTimeRangeStandard); + } + /// No collisions in ROF standard + if (useNoCollInRofStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + SETBIT(rejectionMask, EventRejection::NoCollInRofStandard); + } if (useNumTracksInTimeRange) { - const int numTracksInTimeRange = collision.trackOccupancyInTimeRange(); + float numTracksInTimeRange; + if (useFT0cOccEstimator) { + /// occupancy estimator (FT0c signal amplitudes in +-10us from current collision) + numTracksInTimeRange = collision.ft0cOccupancyInTimeRange(); + } else { + /// occupancy estimator (ITS tracks with at least 5 clusters in +-10us from current collision) + numTracksInTimeRange = static_cast(collision.trackOccupancyInTimeRange()); + } if (numTracksInTimeRange < numTracksInTimeRangeMin || numTracksInTimeRange > numTracksInTimeRangeMax) { SETBIT(rejectionMask, EventRejection::NumTracksInTimeRange); } From ac5d731086411f23ba04570c9f2268d0dd2ecc4c Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Sun, 24 Nov 2024 07:30:17 +0100 Subject: [PATCH 059/459] [PWGEM/Dilepton] update on prefilter for photon conversion rejection (#8585) --- PWGEM/Dilepton/Core/Dilepton.h | 86 ++- PWGEM/Dilepton/Core/DileptonMC.h | 32 +- PWGEM/Dilepton/DataModel/dileptonTables.h | 5 + PWGEM/Dilepton/Tasks/CMakeLists.txt | 5 + PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 524 +++++++++++++++++++ PWGEM/Dilepton/Utils/PairUtilities.h | 5 + 6 files changed, 618 insertions(+), 39 deletions(-) create mode 100644 PWGEM/Dilepton/Tasks/prefilterDielectron.cxx diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 4681418fb26..70580bbdc74 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -174,9 +174,9 @@ struct Dilepton { Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; - Configurable cfg_apply_detadphi_geom{"cfg_apply_detadphi_geom", false, "flag to apply generator deta-dphi elliptic cut"}; - Configurable cfg_min_deta_geom{"cfg_min_deta_geom", 0.02, "geometrical min deta between 2 electrons (elliptic cut)"}; - Configurable cfg_min_dphi_geom{"cfg_min_dphi_geom", 0.2, "geometrical min dphi between 2 electrons (elliptic cut)"}; + Configurable cfg_apply_dzrdphi_geom{"cfg_apply_dzrdphi_geom", false, "flag to apply generator dz-rdphi elliptic cut"}; + Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 1.2, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; + Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 2.4, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; @@ -405,7 +405,7 @@ struct Dilepton { } fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); - fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{1001, -0.5, 1000.5}}, true); + fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); if (doprocessTriggerAnalysis) { fRegistry.add("Event/hNInspectedTVX", "N inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true); } @@ -525,9 +525,10 @@ struct Dilepton { if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca}, true); fRegistry.add("Pair/same/uls/hsDeltaP", "difference of p between 2 tracks;|p_{T,1} - p_{T,2}|/|p_{T,1} + p_{T,2}|;#Delta#eta;#Delta#varphi (rad.);", kTHnSparseD, {{20, 0, 1}, {100, -0.5, +0.5}, {180, -M_PI, M_PI}}, true); - fRegistry.add("Pair/same/uls/hGeomDeltaEtaDeltaPhi", Form("difference in #eta-#varphi plane between 2 tracks at X = %2.1f cm;#Delta#varphi (rad.);#Delta#eta;", dielectroncuts.cfg_x_to_go.value), kTH2D, {{180, -M_PI, M_PI}, {100, -0.5, +0.5}}, true); + fRegistry.add("Pair/same/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -50, 50}, {40, -10, 10}}, true); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron + fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron + fRegistry.add("Pair/same/uls/hMvsPhiV_prop", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron fRegistry.add("Pair/same/uls/hMvsOpAng", "m_{ee} vs. angle between 2 tracks;#omega (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{100, 0, 2.0}, {20, 0.0f, 3.2}}, true); } fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); @@ -771,8 +772,11 @@ struct Dilepton { } } - std::map, float> map_eta_geom; // map -> geometrical eta position at propagated point - std::map, float> map_phi_geom; // map -> geometrical phi position at propagated point + std::map, float> map_z_prop; // map -> geometrical z position at propagated point + std::map, float> map_phi_prop; // map -> geometrical phi position at propagated point + std::map, float> map_px_prop; // map -> px at propagated point + std::map, float> map_py_prop; // map -> py at propagated point + std::map, float> map_pz_prop; // map -> pz at propagated point template void propagateElectron(TTracks const& tracks) @@ -783,11 +787,22 @@ struct Dilepton { track_par_cov.setPID(o2::track::PID::Electron); o2::base::Propagator::Instance()->propagateToX(track_par_cov, dielectroncuts.cfg_x_to_go, d_bz, o2::base::PropagatorImpl::MAX_SIN_PHI, o2::base::PropagatorImpl::MAX_STEP, matCorr); auto xyz = track_par_cov.getXYZGlo(); - float eta = RecoDecay::eta(std::array{xyz.X(), xyz.Y(), xyz.Z()}); + // float eta = RecoDecay::eta(std::array{xyz.X(), xyz.Y(), xyz.Z()}); float phi = RecoDecay::phi(std::array{xyz.X(), xyz.Y()}); o2::math_utils::bringTo02Pi(phi); - map_eta_geom[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = eta; - map_phi_geom[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = phi; + map_z_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = xyz.Z(); + map_phi_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = phi; + + std::array pxpypz_prop = {0, 0, 0}; // px, py, pz + getPxPyPz(track_par_cov, pxpypz_prop); + map_px_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[0]; + map_py_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[1]; + map_pz_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[2]; + + // float r = sqrt(pow(xyz.X(),2) + pow(xyz.Y(), 2)); + // float theta = 2.f * std::atan(std::exp(-eta)); + // float z = r/std::tan(theta); + // LOGF(info, "r = %f, z = %f , xyz.Z() = %f", r, z, xyz.Z()); } } @@ -836,21 +851,39 @@ struct Dilepton { } } - float deta_geom = 999.f, dphi_geom = 999.f; + float dphi_geom = 999.f, dz_geom = 999.f, rdphi_geom = 999.f; + float phiv_prop = 999.f, mee_prop = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } if constexpr (ev_id == 0) { - deta_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_eta_geom[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_eta_geom[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_eta_geom[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_eta_geom[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; - dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_geom[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_phi_geom[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_phi_geom[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_phi_geom[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; + dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; + dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; + o2::math_utils::bringToPMPi(dphi_geom); + rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; + + float px1 = map_px_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; + float py1 = map_py_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; + float pz1 = map_pz_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; + float px2 = map_px_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())]; + float py2 = map_py_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())]; + float pz2 = map_pz_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())]; + + ROOT::Math::PxPyPzMVector v1prop(px1, py1, pz1, leptonM1); + ROOT::Math::PxPyPzMVector v2prop(px2, py2, pz2, leptonM2); + ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; + mee_prop = v12prop.M(); + phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(px1, py1, pz1, px2, py2, pz2, t1.sign(), t2.sign(), d_bz); + } else { // mixed event - deta_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_eta_geom[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())] - map_eta_geom[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] : map_eta_geom[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] - map_eta_geom[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; - dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_geom[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())] - map_phi_geom[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] : map_phi_geom[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] - map_phi_geom[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; + dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())] - map_z_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] : map_z_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] - map_z_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; + dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; + o2::math_utils::bringToPMPi(dphi_geom); + rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; } - o2::math_utils::bringToPMPi(dphi_geom); - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_detadphi_geom && std::pow(deta_geom / dielectroncuts.cfg_min_deta_geom, 2) + std::pow(dphi_geom / dielectroncuts.cfg_min_dphi_geom, 2) < 1.f) { + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { return false; } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { @@ -901,25 +934,28 @@ struct Dilepton { if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hsDeltaP"), dpt, deta, dphi, weight); - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hGeomDeltaEtaDeltaPhi"), dphi_geom, deta_geom, weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hMvsPhiV"), phiv, v12.M(), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hMvsPhiV_prop"), phiv_prop, mee_prop, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hMvsOpAng"), opAng, v12.M(), weight); } } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hs"), v12.M(), v12.Pt(), pair_dca, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hsDeltaP"), dpt, deta, dphi, weight); - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hGeomDeltaEtaDeltaPhi"), dphi_geom, deta_geom, weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hMvsPhiV"), phiv, v12.M(), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hMvsPhiV_prop"), phiv_prop, mee_prop, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hMvsOpAng"), opAng, v12.M(), weight); } } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hsDeltaP"), dpt, deta, dphi, weight); - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hGeomDeltaEtaDeltaPhi"), dphi_geom, deta_geom, weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hMvsPhiV"), phiv, v12.M(), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hMvsPhiV_prop"), phiv_prop, mee_prop, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hMvsOpAng"), opAng, v12.M(), weight); } } @@ -1364,10 +1400,12 @@ struct Dilepton { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } - float deta_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_eta_geom[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_eta_geom[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_eta_geom[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_eta_geom[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; - float dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_geom[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_phi_geom[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_phi_geom[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_phi_geom[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; + float dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; + float dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; o2::math_utils::bringToPMPi(dphi_geom); - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_detadphi_geom && std::pow(deta_geom / dielectroncuts.cfg_min_deta_geom, 2) + std::pow(dphi_geom / dielectroncuts.cfg_min_dphi_geom, 2) < 1.f) { + float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; + + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { return false; } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 90db1237cc1..84af68489da 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -153,9 +153,9 @@ struct DileptonMC { Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; - Configurable cfg_apply_detadphi_geom{"cfg_apply_detadphi_geom", false, "flag to apply generator deta-dphi elliptic cut"}; - Configurable cfg_min_deta_geom{"cfg_min_deta_geom", 0.02, "geometrical min deta between 2 electrons (elliptic cut)"}; - Configurable cfg_min_dphi_geom{"cfg_min_dphi_geom", 0.2, "geometrical min dphi between 2 electrons (elliptic cut)"}; + Configurable cfg_apply_dzrdphi_geom{"cfg_apply_dzrdphi_geom", false, "flag to apply generator dz-rdphi elliptic cut"}; + Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 1.2, "geometrical min deta between 2 electrons (elliptic cut)"}; + Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 2.4, "geometrical min dphi between 2 electrons (elliptic cut)"}; Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; @@ -356,7 +356,6 @@ struct DileptonMC { fRegistry.addClone("Pair/sm/Photon/", "Pair/sm/NonPromptPsi2S/"); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - fRegistry.add("Pair/sm/Photon/hGeomDeltaEtaDeltaPhi", Form("difference in #eta-#varphi plane between 2 tracks at X = %2.1f cm;#Delta#varphi (rad.);#Delta#eta;", dielectroncuts.cfg_x_to_go.value), kTH2D, {{90, -M_PI, M_PI}, {100, -0.5, +0.5}}, true); fRegistry.add("Pair/sm/Photon/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); fRegistry.add("Pair/sm/Pi0/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); } @@ -712,8 +711,6 @@ struct DileptonMC { return false; } - float deta_geom = 999.f; - float dphi_geom = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { if (!cut.template IsSelectedTrack(t1, collision) || !cut.template IsSelectedTrack(t2, collision)) { @@ -733,7 +730,8 @@ struct DileptonMC { track_par_cov1.setPID(o2::track::PID::Electron); o2::base::Propagator::Instance()->propagateToX(track_par_cov1, dielectroncuts.cfg_x_to_go, d_bz, o2::base::PropagatorImpl::MAX_SIN_PHI, o2::base::PropagatorImpl::MAX_STEP, matCorr); auto xyz1 = track_par_cov1.getXYZGlo(); - float eta1 = RecoDecay::eta(std::array{xyz1.X(), xyz1.Y(), xyz1.Z()}); + float z1 = xyz1.Z(); + // float eta1 = RecoDecay::eta(std::array{xyz1.X(), xyz1.Y(), xyz1.Z()}); float phi1 = RecoDecay::phi(std::array{xyz1.X(), xyz1.Y()}); o2::math_utils::bringTo02Pi(phi1); @@ -741,14 +739,16 @@ struct DileptonMC { track_par_cov2.setPID(o2::track::PID::Electron); o2::base::Propagator::Instance()->propagateToX(track_par_cov2, dielectroncuts.cfg_x_to_go, d_bz, o2::base::PropagatorImpl::MAX_SIN_PHI, o2::base::PropagatorImpl::MAX_STEP, matCorr); auto xyz2 = track_par_cov2.getXYZGlo(); - float eta2 = RecoDecay::eta(std::array{xyz2.X(), xyz2.Y(), xyz2.Z()}); + float z2 = xyz2.Z(); + // float eta2 = RecoDecay::eta(std::array{xyz2.X(), xyz2.Y(), xyz2.Z()}); float phi2 = RecoDecay::phi(std::array{xyz2.X(), xyz2.Y()}); o2::math_utils::bringTo02Pi(phi2); - float deta_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? eta1 - eta2 : eta2 - eta1; + float dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? z1 - z2 : z2 - z1; float dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? phi1 - phi2 : phi2 - phi1; o2::math_utils::bringToPMPi(dphi_geom); - if (dielectroncuts.cfg_apply_detadphi_geom && std::pow(deta_geom / dielectroncuts.cfg_min_deta_geom, 2) + std::pow(dphi_geom / dielectroncuts.cfg_min_dphi_geom, 2) < 1.f) { + float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; + if (dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { return false; } } @@ -955,7 +955,6 @@ struct DileptonMC { fRegistry.fill(HIST("Pair/sm/Photon/hs"), v12.M(), v12.Pt(), v12.Rapidity(), abs(dphi), deta, abs(cos_thetaCS), abs(phiCS), aco, asym, abs(dphi_e_ee), pair_dca, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/sm/Photon/hMvsPhiV"), phiv, v12.M()); - fRegistry.fill(HIST("Pair/sm/Photon/hGeomDeltaEtaDeltaPhi"), dphi_geom, deta_geom, weight); } break; default: @@ -1645,7 +1644,8 @@ struct DileptonMC { track_par_cov1.setPID(o2::track::PID::Electron); o2::base::Propagator::Instance()->propagateToX(track_par_cov1, dielectroncuts.cfg_x_to_go, d_bz, o2::base::PropagatorImpl::MAX_SIN_PHI, o2::base::PropagatorImpl::MAX_STEP, matCorr); auto xyz1 = track_par_cov1.getXYZGlo(); - float eta1 = RecoDecay::eta(std::array{xyz1.X(), xyz1.Y(), xyz1.Z()}); + float z1 = xyz1.Z(); + // float eta1 = RecoDecay::eta(std::array{xyz1.X(), xyz1.Y(), xyz1.Z()}); float phi1 = RecoDecay::phi(std::array{xyz1.X(), xyz1.Y()}); o2::math_utils::bringTo02Pi(phi1); @@ -1653,14 +1653,16 @@ struct DileptonMC { track_par_cov2.setPID(o2::track::PID::Electron); o2::base::Propagator::Instance()->propagateToX(track_par_cov2, dielectroncuts.cfg_x_to_go, d_bz, o2::base::PropagatorImpl::MAX_SIN_PHI, o2::base::PropagatorImpl::MAX_STEP, matCorr); auto xyz2 = track_par_cov2.getXYZGlo(); - float eta2 = RecoDecay::eta(std::array{xyz2.X(), xyz2.Y(), xyz2.Z()}); + float z2 = xyz2.Z(); + // float eta2 = RecoDecay::eta(std::array{xyz2.X(), xyz2.Y(), xyz2.Z()}); float phi2 = RecoDecay::phi(std::array{xyz2.X(), xyz2.Y()}); o2::math_utils::bringTo02Pi(phi2); - float deta_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? eta1 - eta2 : eta2 - eta1; + float dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? z1 - z2 : z2 - z1; float dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? phi1 - phi2 : phi2 - phi1; o2::math_utils::bringToPMPi(dphi_geom); - if (dielectroncuts.cfg_apply_detadphi_geom && std::pow(deta_geom / dielectroncuts.cfg_min_deta_geom, 2) + std::pow(dphi_geom / dielectroncuts.cfg_min_dphi_geom, 2) < 1.f) { + float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; + if (dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { return false; } } diff --git a/PWGEM/Dilepton/DataModel/dileptonTables.h b/PWGEM/Dilepton/DataModel/dileptonTables.h index 3add073e6bf..7f252fc4f67 100644 --- a/PWGEM/Dilepton/DataModel/dileptonTables.h +++ b/PWGEM/Dilepton/DataModel/dileptonTables.h @@ -367,6 +367,7 @@ DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(AmbiguousElectrons, ambiguousElectrons); DECLARE_SOA_COLUMN(IsAssociatedToMPC, isAssociatedToMPC, bool); //! is associated to most probable collision DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! DECLARE_SOA_COLUMN(PrefilterBit, pfb, uint8_t); //! +DECLARE_SOA_COLUMN(PrefilterBitPi0, pfbpi0, uint16_t); //! DECLARE_SOA_DYNAMIC_COLUMN(Signed1Pt, signed1Pt, [](float pt, int8_t sign) -> float { return sign * 1. / pt; }); DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) -> float { return pt * std::cosh(eta); }); DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) -> float { return pt * std::cos(phi); }); @@ -512,6 +513,10 @@ DECLARE_SOA_TABLE(EMAmbiguousElectronSelfIds, "AOD", "EMAMBELSELFID", emprimarye // iterators using EMAmbiguousElectronSelfId = EMAmbiguousElectronSelfIds::iterator; +DECLARE_SOA_TABLE(EMPrimaryElectronsPrefilterBitPi0, "AOD", "PRMELPFBPI0", emprimaryelectron::PrefilterBitPi0); // To be joined with EMPrimaryElectrons table at analysis level. +// iterators +using EMPrimaryElectronPrefilterBitPi0 = EMPrimaryElectronsPrefilterBitPi0::iterator; + namespace emprimarymuon { DECLARE_SOA_INDEX_COLUMN(EMEvent, emevent); //! diff --git a/PWGEM/Dilepton/Tasks/CMakeLists.txt b/PWGEM/Dilepton/Tasks/CMakeLists.txt index 4745a1d175a..f84c8513ac9 100644 --- a/PWGEM/Dilepton/Tasks/CMakeLists.txt +++ b/PWGEM/Dilepton/Tasks/CMakeLists.txt @@ -116,3 +116,8 @@ o2physics_add_dpl_workflow(photon-hbt-pcmee PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore O2Physics::MLCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(prefilter-dielectron + SOURCES prefilterDielectron.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::MLCore O2Physics::PWGEMDileptonCore + COMPONENT_NAME Analysis) + diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx new file mode 100644 index 00000000000..9d908c24de9 --- /dev/null +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -0,0 +1,524 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +// +// ======================== +// +// This code produces information on prefilter for dielectron. +// Please write to: daiki.sekihata@cern.ch + +#include +#include +#include + +#include "TString.h" +#include "Math/Vector4D.h" +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" +#include "Common/Core/RecoDecay.h" + +#include "DetectorsBase/GeometryManager.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "CCDB/BasicCCDBManager.h" + +#include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "PWGEM/Dilepton/Core/DielectronCut.h" +#include "PWGEM/Dilepton/Core/EMEventCut.h" +#include "PWGEM/Dilepton/Utils/EMTrack.h" +#include "PWGEM/Dilepton/Utils/EventHistograms.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; +using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; +using namespace o2::aod::pwgem::dilepton::utils::pairutil; + +using MyCollisions = soa::Join; +using MyCollision = MyCollisions::iterator; + +using MyTracks = soa::Join; +using MyTrack = MyTracks::iterator; + +struct prefilterDielectron { + Produces pfb_pi0; + + // Configurables + Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + // Configurable> cfgMaxMee{"cfgMaxMee", {0.01, 0.02, 0.04, 0.06, 0.08, 0.10}, "max mee steps for prefilter. Don't exceed 15 values!"}; + Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + Configurable cfgMaxMee{"cfgMaxMee", 0.01, "max mee for prefilter in GeV/c2"}; // only for ULS + Configurable cfgMaxMee_for_phiv_uls{"cfgMaxMee_for_phiv_uls", 0.65, "max mee at phiv = pi for ULS"}; // GeV/c2 + Configurable cfgMinPhiV_uls{"cfgMinPhiV_uls", 2.9, "min phiv for in ULS"}; // radian + Configurable cfgMaxMee_for_phiv_ls{"cfgMinMee_for_phiv", 0.25, "max mee at phiv = 0 and pi for LS"}; // GeV/c2 // symmetric + Configurable cfgMinPhiVv_ls{"cfgMinPhiVv_ls", 2.5, "min phiv for LS"}; // radian + + EMEventCut fEMEventCut; + struct : ConfigurableGroup { + std::string prefix = "eventcut_group"; + Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; + Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", true, "require no ITS readout frame border in event cut"}; + Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + } eventcuts; + + DielectronCut fDielectronCut; + struct : ConfigurableGroup { + std::string prefix = "dielectroncut_group"; + Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; + Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; + Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; + Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; + Configurable cfg_min_p_its_cluster_size{"cfg_min_p_its_cluster_size", 0.0, "min p to apply ITS cluster size cut"}; + Configurable cfg_max_p_its_cluster_size{"cfg_max_p_its_cluster_size", 0.0, "max p to apply ITS cluster size cut"}; + Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; + Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + + Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; + Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + + // configuration for PID ML + Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + Configurable> binsMl{"binsMl", std::vector{-999999., 999999.}, "Bin limits for ML application"}; + Configurable> cutsMl{"cutsMl", std::vector{0.95}, "ML cuts per bin"}; + Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + } dielectroncuts; + + o2::ccdb::CcdbApi ccdbApi; + Service ccdb; + int mRunNumber; + float d_bz; + + HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + + void init(InitContext& /*context*/) + { + DefineEMEventCut(); + DefineDielectronCut(); + addhistograms(); + + mRunNumber = 0; + d_bz = 0; + + ccdb->setURL(ccdburl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); + } + + template + void initCCDB(TCollision const& collision) + { + if (mRunNumber == collision.runNumber()) { + return; + } + + // In case override, don't proceed, please - no CCDB access required + if (d_bz_input > -990) { + d_bz = d_bz_input; + o2::parameters::GRPMagField grpmag; + if (fabs(d_bz) > 1e-5) { + grpmag.setL3Current(30000.f / (d_bz / 5.0f)); + } + mRunNumber = collision.runNumber(); + return; + } + + auto run3grp_timestamp = collision.timestamp(); + o2::parameters::GRPObject* grpo = 0x0; + o2::parameters::GRPMagField* grpmag = 0x0; + if (!skipGRPOquery) + grpo = ccdb->getForTimeStamp(grpPath, run3grp_timestamp); + if (grpo) { + // Fetch magnetic field from ccdb for current collision + d_bz = grpo->getNominalL3Field(); + LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; + } else { + grpmag = ccdb->getForTimeStamp(grpmagPath, run3grp_timestamp); + if (!grpmag) { + LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp; + } + // Fetch magnetic field from ccdb for current collision + d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f); + LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; + } + mRunNumber = collision.runNumber(); + } + + ~prefilterDielectron() {} + + void addhistograms() + { + const AxisSpec axis_mass{400, 0, 4, "m_{ee} (GeV/c^{2})"}; + const AxisSpec axis_pair_pt{100, 0, 10, "p_{T,ee} (GeV/c)"}; + const AxisSpec axis_phiv{90, 0, M_PI, "#varphi_{V} (rad.)"}; + + // for pair + fRegistry.add("Pair/before/uls/hMvsPt", "m_{ee} vs. p_{T,ee}", kTH2D, {axis_mass, axis_pair_pt}, true); + fRegistry.add("Pair/before/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {axis_phiv, {200, 0, 1}}, true); + fRegistry.add("Pair/before/uls/hDeltaEtaDeltaPhi", "d#eta-d#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {100, -0.5, +0.5}}, true); + fRegistry.addClone("Pair/before/uls/", "Pair/before/lspp/"); + fRegistry.addClone("Pair/before/uls/", "Pair/before/lsmm/"); + fRegistry.addClone("Pair/before/", "Pair/after/"); + } + + void DefineEMEventCut() + { + fEMEventCut = EMEventCut("fEMEventCut", "fEMEventCut"); + fEMEventCut.SetRequireSel8(eventcuts.cfgRequireSel8); + fEMEventCut.SetRequireFT0AND(eventcuts.cfgRequireFT0AND); + fEMEventCut.SetZvtxRange(-eventcuts.cfgZvtxMax, +eventcuts.cfgZvtxMax); + fEMEventCut.SetRequireNoTFB(eventcuts.cfgRequireNoTFB); + fEMEventCut.SetRequireNoITSROFB(eventcuts.cfgRequireNoITSROFB); + fEMEventCut.SetRequireNoSameBunchPileup(eventcuts.cfgRequireNoSameBunchPileup); + fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); + } + + o2::analysis::MlResponseDielectronSingleTrack mlResponseSingleTrack; + void DefineDielectronCut() + { + fDielectronCut = DielectronCut("fDielectronCut", "fDielectronCut"); + + // for pair + fDielectronCut.SetMeeRange(0, 1e+10); + fDielectronCut.SetPairPtRange(0.f, 1e+10); + fDielectronCut.SetPairYRange(-1e+10, +1e+10); + fDielectronCut.SetPairDCARange(0.f, 1e+10); // in sigma + fDielectronCut.ApplyPhiV(false); + fDielectronCut.ApplyPrefilter(false); + fDielectronCut.SetMindEtadPhi(false, 1.f, 1.f); + fDielectronCut.SetPairOpAng(0.f, 3.2f); + fDielectronCut.SetRequireDifferentSides(false); + + // for track + fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, 1e+10f); + fDielectronCut.SetTrackEtaRange(dielectroncuts.cfg_min_eta_track, dielectroncuts.cfg_max_eta_track); + fDielectronCut.SetTrackPhiRange(dielectroncuts.cfg_min_phi_track, dielectroncuts.cfg_max_phi_track); + fDielectronCut.SetMinNClustersTPC(dielectroncuts.cfg_min_ncluster_tpc); + fDielectronCut.SetMinNCrossedRowsTPC(dielectroncuts.cfg_min_ncrossedrows); + fDielectronCut.SetMinNCrossedRowsOverFindableClustersTPC(0.8); + fDielectronCut.SetMaxFracSharedClustersTPC(dielectroncuts.cfg_max_frac_shared_clusters_tpc); + fDielectronCut.SetChi2PerClusterTPC(0.0, dielectroncuts.cfg_max_chi2tpc); + fDielectronCut.SetChi2PerClusterITS(0.0, dielectroncuts.cfg_max_chi2its); + fDielectronCut.SetNClustersITS(dielectroncuts.cfg_min_ncluster_its, 7); + fDielectronCut.SetMeanClusterSizeITS(dielectroncuts.cfg_min_its_cluster_size, dielectroncuts.cfg_max_its_cluster_size, dielectroncuts.cfg_min_p_its_cluster_size, dielectroncuts.cfg_max_p_its_cluster_size); + fDielectronCut.SetTrackMaxDcaXY(dielectroncuts.cfg_max_dcaxy); + fDielectronCut.SetTrackMaxDcaZ(dielectroncuts.cfg_max_dcaz); + fDielectronCut.RequireITSibAny(dielectroncuts.cfg_require_itsib_any); + fDielectronCut.RequireITSib1st(dielectroncuts.cfg_require_itsib_1st); + fDielectronCut.SetChi2TOF(0, dielectroncuts.cfg_max_chi2tof); + fDielectronCut.SetRelDiffPin(dielectroncuts.cfg_min_rel_diff_pin, dielectroncuts.cfg_max_rel_diff_pin); + + // for eID + fDielectronCut.SetPIDScheme(dielectroncuts.cfg_pid_scheme); + fDielectronCut.SetTPCNsigmaElRange(dielectroncuts.cfg_min_TPCNsigmaEl, dielectroncuts.cfg_max_TPCNsigmaEl); + fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); + fDielectronCut.SetTPCNsigmaPiRange(dielectroncuts.cfg_min_TPCNsigmaPi, dielectroncuts.cfg_max_TPCNsigmaPi); + fDielectronCut.SetTPCNsigmaKaRange(dielectroncuts.cfg_min_TPCNsigmaKa, dielectroncuts.cfg_max_TPCNsigmaKa); + fDielectronCut.SetTPCNsigmaPrRange(dielectroncuts.cfg_min_TPCNsigmaPr, dielectroncuts.cfg_max_TPCNsigmaPr); + fDielectronCut.SetTOFNsigmaElRange(dielectroncuts.cfg_min_TOFNsigmaEl, dielectroncuts.cfg_max_TOFNsigmaEl); + + if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { // please call this at the end of DefineDileptonCut + static constexpr int nClassesMl = 2; + const std::vector cutDirMl = {o2::cuts_ml::CutSmaller, o2::cuts_ml::CutNot}; + const std::vector labelsClasses = {"Signal", "Background"}; + const uint32_t nBinsMl = dielectroncuts.binsMl.value.size() - 1; + const std::vector labelsBins(nBinsMl, "bin"); + double cutsMlArr[nBinsMl][nClassesMl]; + for (uint32_t i = 0; i < nBinsMl; i++) { + cutsMlArr[i][0] = dielectroncuts.cutsMl.value[i]; + cutsMlArr[i][1] = 0.; + } + o2::framework::LabeledArray cutsMl = {cutsMlArr[0], nBinsMl, nClassesMl, labelsBins, labelsClasses}; + + mlResponseSingleTrack.configure(dielectroncuts.binsMl.value, cutsMl, cutDirMl, nClassesMl); + if (dielectroncuts.loadModelsFromCCDB) { + ccdbApi.init(ccdburl); + mlResponseSingleTrack.setModelPathsCCDB(dielectroncuts.onnxFileNames.value, ccdbApi, dielectroncuts.onnxPathsCCDB.value, dielectroncuts.timestampCCDB.value); + } else { + mlResponseSingleTrack.setModelPathsLocal(dielectroncuts.onnxFileNames.value); + } + mlResponseSingleTrack.cacheInputFeaturesIndices(dielectroncuts.namesInputFeatures); + mlResponseSingleTrack.cacheBinningIndex(dielectroncuts.nameBinningFeature); + mlResponseSingleTrack.init(dielectroncuts.enableOptimizations.value); + + fDielectronCut.SetPIDMlResponse(&mlResponseSingleTrack); + } // end of PID ML + } + + std::unordered_map map_pfb; // map track.globalIndex -> prefilter bit + + SliceCache cache; + Preslice perCollision_track = aod::emprimaryelectron::emeventId; + Partition posTracks = o2::aod::emprimaryelectron::sign > int8_t(0); + Partition negTracks = o2::aod::emprimaryelectron::sign < int8_t(0); + + Filter collisionFilter_centrality = (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); + Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin < o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = soa::Filtered; + + void processPFB(FilteredMyCollisions const& collisions, MyTracks const& tracks) + { + for (auto& track : tracks) { + map_pfb[track.globalIndex()] = 0; + } // end of track loop + + for (auto& collision : collisions) { + initCCDB(collision); + const float centralities[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; + bool is_cent_ok = true; + if (centralities[cfgCentEstimator] < cfgCentMin || cfgCentMax < centralities[cfgCentEstimator]) { + is_cent_ok = false; + } + + auto posTracks_per_coll = posTracks->sliceByCached(o2::aod::emprimaryelectron::emeventId, collision.globalIndex(), cache); + auto negTracks_per_coll = negTracks->sliceByCached(o2::aod::emprimaryelectron::emeventId, collision.globalIndex(), cache); + + if (!fEMEventCut.IsSelected(collision) || !is_cent_ok) { + for (auto& pos : posTracks_per_coll) { + map_pfb[pos.globalIndex()] = 0; + } + for (auto& neg : negTracks_per_coll) { + map_pfb[neg.globalIndex()] = 0; + } + continue; + } + + // LOGF(info, "centrality = %f , posTracks_per_coll.size() = %d, negTracks_per_coll.size() = %d", centralities[cfgCentEstimator], posTracks_per_coll.size(), negTracks_per_coll.size()); + + for (auto& [pos, ele] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + if (!fDielectronCut.IsSelectedTrack(pos) || !fDielectronCut.IsSelectedTrack(ele)) { + continue; + } + // don't apply pair cut when you produce prefilter bit. + + ROOT::Math::PtEtaPhiMVector v1(pos.pt(), pos.eta(), pos.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v2(ele.pt(), ele.eta(), ele.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; + float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(v1.Px(), v1.Py(), v1.Pz(), v2.Px(), v2.Py(), v2.Pz(), pos.sign(), ele.sign(), d_bz); + float deta = pos.sign() * v1.Pt() > ele.sign() * v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); + float dphi = pos.sign() * v1.Pt() > ele.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); + o2::math_utils::bringToPMPi(dphi); + + fRegistry.fill(HIST("Pair/before/uls/hMvsPt"), v12.M(), v12.Pt()); + fRegistry.fill(HIST("Pair/before/uls/hMvsPhiV"), phiv, v12.M()); + fRegistry.fill(HIST("Pair/before/uls/hDeltaEtaDeltaPhi"), dphi, deta); + + if (v12.M() < cfgMaxMee) { + map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee); + map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee); + } + if (v12.M() < cfgMaxMee_for_phiv_uls && cfgMinPhiV_uls < phiv) { + map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); + map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); + } + } + + for (auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + if (!fDielectronCut.IsSelectedTrack(pos1) || !fDielectronCut.IsSelectedTrack(pos2)) { + continue; + } + // don't apply pair cut when you produce prefilter bit. + + ROOT::Math::PtEtaPhiMVector v1(pos1.pt(), pos1.eta(), pos1.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v2(pos2.pt(), pos2.eta(), pos2.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; + float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(v1.Px(), v1.Py(), v1.Pz(), v2.Px(), v2.Py(), v2.Pz(), pos1.sign(), pos2.sign(), d_bz); + float deta = pos1.sign() * v1.Pt() > pos2.sign() * v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); + float dphi = pos1.sign() * v1.Pt() > pos2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); + o2::math_utils::bringToPMPi(dphi); + + fRegistry.fill(HIST("Pair/before/lspp/hMvsPt"), v12.M(), v12.Pt()); + fRegistry.fill(HIST("Pair/before/lspp/hMvsPhiV"), phiv, v12.M()); + fRegistry.fill(HIST("Pair/before/lspp/hDeltaEtaDeltaPhi"), dphi, deta); + + float slope = cfgMaxMee_for_phiv_ls / (M_PI - cfgMinPhiVv_ls); + float intercept = cfgMaxMee_for_phiv_ls - slope * M_PI; + if (v12.M() < phiv * slope + intercept || v12.M() < (M_PI - phiv) * slope + intercept) { + map_pfb[pos1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); + map_pfb[pos2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); + } + } + + for (auto& [ele1, ele2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + if (!fDielectronCut.IsSelectedTrack(ele1) || !fDielectronCut.IsSelectedTrack(ele2)) { + continue; + } + // don't apply pair cut when you produce prefilter bit. + + ROOT::Math::PtEtaPhiMVector v1(ele1.pt(), ele1.eta(), ele1.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v2(ele2.pt(), ele2.eta(), ele2.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; + float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(v1.Px(), v1.Py(), v1.Pz(), v2.Px(), v2.Py(), v2.Pz(), ele1.sign(), ele2.sign(), d_bz); + float deta = ele1.sign() * v1.Pt() > ele2.sign() * v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); + float dphi = ele1.sign() * v1.Pt() > ele2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); + o2::math_utils::bringToPMPi(dphi); + + fRegistry.fill(HIST("Pair/before/lsmm/hMvsPt"), v12.M(), v12.Pt()); + fRegistry.fill(HIST("Pair/before/lsmm/hMvsPhiV"), phiv, v12.M()); + fRegistry.fill(HIST("Pair/before/lsmm/hDeltaEtaDeltaPhi"), dphi, deta); + float slope = cfgMaxMee_for_phiv_ls / (M_PI - cfgMinPhiVv_ls); + float intercept = cfgMaxMee_for_phiv_ls - slope * M_PI; + if (v12.M() < phiv * slope + intercept || v12.M() < (M_PI - phiv) * slope + intercept) { + map_pfb[ele1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); + map_pfb[ele2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); + } + } + + } // end of collision loop + + for (auto& track : tracks) { + // LOGF(info, "map_pfb[%d] = %d", track.globalIndex(), map_pfb[track.globalIndex()]); + pfb_pi0(map_pfb[track.globalIndex()]); + } // end of track loop + + // check pfb. + for (auto& collision : collisions) { + const float centralities[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; + if (centralities[cfgCentEstimator] < cfgCentMin || cfgCentMax < centralities[cfgCentEstimator]) { + continue; + } + + auto posTracks_per_coll = posTracks->sliceByCached(o2::aod::emprimaryelectron::emeventId, collision.globalIndex(), cache); + auto negTracks_per_coll = negTracks->sliceByCached(o2::aod::emprimaryelectron::emeventId, collision.globalIndex(), cache); + + if (!fEMEventCut.IsSelected(collision)) { + continue; + } + + for (auto& [pos, ele] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + if (!fDielectronCut.IsSelectedTrack(pos) || !fDielectronCut.IsSelectedTrack(ele)) { + continue; + } + if (map_pfb[pos.globalIndex()] != 0 || map_pfb[ele.globalIndex()] != 0) { + continue; + } + + ROOT::Math::PtEtaPhiMVector v1(pos.pt(), pos.eta(), pos.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v2(ele.pt(), ele.eta(), ele.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; + float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(v1.Px(), v1.Py(), v1.Pz(), v2.Px(), v2.Py(), v2.Pz(), pos.sign(), ele.sign(), d_bz); + float deta = pos.sign() * v1.Pt() > ele.sign() * v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); + float dphi = pos.sign() * v1.Pt() > ele.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); + o2::math_utils::bringToPMPi(dphi); + fRegistry.fill(HIST("Pair/after/uls/hMvsPt"), v12.M(), v12.Pt()); + fRegistry.fill(HIST("Pair/after/uls/hMvsPhiV"), phiv, v12.M()); + fRegistry.fill(HIST("Pair/after/uls/hDeltaEtaDeltaPhi"), dphi, deta); + } + + for (auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + if (!fDielectronCut.IsSelectedTrack(pos1) || !fDielectronCut.IsSelectedTrack(pos2)) { + continue; + } + if (map_pfb[pos1.globalIndex()] != 0 || map_pfb[pos2.globalIndex()] != 0) { + continue; + } + + ROOT::Math::PtEtaPhiMVector v1(pos1.pt(), pos1.eta(), pos1.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v2(pos2.pt(), pos2.eta(), pos2.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; + float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(v1.Px(), v1.Py(), v1.Pz(), v2.Px(), v2.Py(), v2.Pz(), pos1.sign(), pos2.sign(), d_bz); + float deta = pos1.sign() * v1.Pt() > pos2.sign() * v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); + float dphi = pos1.sign() * v1.Pt() > pos2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); + o2::math_utils::bringToPMPi(dphi); + fRegistry.fill(HIST("Pair/after/lspp/hMvsPt"), v12.M(), v12.Pt()); + fRegistry.fill(HIST("Pair/after/lspp/hMvsPhiV"), phiv, v12.M()); + fRegistry.fill(HIST("Pair/after/lspp/hDeltaEtaDeltaPhi"), dphi, deta); + } + + for (auto& [ele1, ele2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + if (!fDielectronCut.IsSelectedTrack(ele1) || !fDielectronCut.IsSelectedTrack(ele2)) { + continue; + } + if (map_pfb[ele1.globalIndex()] != 0 || map_pfb[ele2.globalIndex()] != 0) { + continue; + } + + ROOT::Math::PtEtaPhiMVector v1(ele1.pt(), ele1.eta(), ele1.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v2(ele2.pt(), ele2.eta(), ele2.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; + float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(v1.Px(), v1.Py(), v1.Pz(), v2.Px(), v2.Py(), v2.Pz(), ele1.sign(), ele2.sign(), d_bz); + float deta = ele1.sign() * v1.Pt() > ele2.sign() * v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); + float dphi = ele1.sign() * v1.Pt() > ele2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); + o2::math_utils::bringToPMPi(dphi); + fRegistry.fill(HIST("Pair/after/lsmm/hMvsPt"), v12.M(), v12.Pt()); + fRegistry.fill(HIST("Pair/after/lsmm/hMvsPhiV"), phiv, v12.M()); + fRegistry.fill(HIST("Pair/after/lsmm/hDeltaEtaDeltaPhi"), dphi, deta); + } + + } // end of collision loop + + map_pfb.clear(); + } // end of process + PROCESS_SWITCH(prefilterDielectron, processPFB, "produce prefilter bit", false); + + void processDummy(MyTracks const& tracks) + { + for (int i = 0; i < tracks.size(); i++) { + pfb_pi0(0); + } + } + PROCESS_SWITCH(prefilterDielectron, processDummy, "dummy", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"prefilter-dielectron"})}; +} diff --git a/PWGEM/Dilepton/Utils/PairUtilities.h b/PWGEM/Dilepton/Utils/PairUtilities.h index c50b3c74495..293cb34dfa5 100644 --- a/PWGEM/Dilepton/Utils/PairUtilities.h +++ b/PWGEM/Dilepton/Utils/PairUtilities.h @@ -41,6 +41,11 @@ enum class DileptonAnalysisType : int { kVM = 5, kHFll = 6, }; +enum class DileptonPrefilterBit : int { + kMee = 0, // reject tracks from pi0 dalitz decays at very low mass where S/B > 1 + kPhiV = 1, // reject tracks from photon conversions + kFakeMatchITSTPC = 2, // reject tracks from photon conversions misreconstructed as ITS-TPC matched track +}; using SMatrix55 = ROOT::Math::SMatrix>; using SMatrix5 = ROOT::Math::SVector; From 9f8542534bab9fea6f1b2c7067dd640e0c98d693 Mon Sep 17 00:00:00 2001 From: fuchuncui <162277233+fuchuncui@users.noreply.github.com> Date: Sun, 24 Nov 2024 16:05:42 +0800 Subject: [PATCH 060/459] [PWGCF] Add some TProfiles and fix some bug in flowGFWOmegaXi.cxx (#8587) --- PWGCF/Flow/Tasks/flowGFWOmegaXi.cxx | 96 +++++++++++++++++------------ 1 file changed, 57 insertions(+), 39 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowGFWOmegaXi.cxx b/PWGCF/Flow/Tasks/flowGFWOmegaXi.cxx index 68d162f7005..fba1baa6069 100644 --- a/PWGCF/Flow/Tasks/flowGFWOmegaXi.cxx +++ b/PWGCF/Flow/Tasks/flowGFWOmegaXi.cxx @@ -143,10 +143,10 @@ struct FlowGFWOmegaXi { TF1* fT0AV0AMean = nullptr; TF1* fT0AV0ASigma = nullptr; - using TracksPID = soa::Join; + using TracksPID = soa::Join; using aodTracks = soa::Filtered>; // tracks filter using aodCollisions = soa::Filtered>; // collisions filter - using DaughterTracks = soa::Join; + using DaughterTracks = soa::Join; // Declare the pt, mult and phi Axis; int nPtBins = 0; @@ -203,6 +203,8 @@ struct FlowGFWOmegaXi { // cumulant of flow registry.add("c22", ";Centrality (%) ; C_{2}{2} ", {HistType::kTProfile, {axisMultiplicity}}); registry.add("c24", ";Centrality (%) ; C_{2}{2} ", {HistType::kTProfile, {axisMultiplicity}}); + registry.add("K0sc22", ";Centrality (%) ; C_{2}{2} ", {HistType::kTProfile, {axisMultiplicity}}); + registry.add("Lambdac22", ";Centrality (%) ; C_{2}{2} ", {HistType::kTProfile, {axisMultiplicity}}); registry.add("c22dpt", ";Centrality (%) ; C_{2}{2}", {HistType::kTProfile2D, {cfgaxisPt, axisMultiplicity}}); registry.add("c24dpt", ";Centrality (%) ; C_{2}{4}", {HistType::kTProfile2D, {cfgaxisPt, axisMultiplicity}}); // pt-diff cumulant of flow @@ -258,38 +260,50 @@ struct FlowGFWOmegaXi { fGFW->AddRegion("reffulldpt", -0.8, 0.8, nPtBins, 1); fGFW->AddRegion("refoldpt", -0.8, 0.8, nPtBins, 1); int nXiptMassBins = nXiPtBins * cfgXiMassbins; - fGFW->AddRegion("poiXiP", 0.4, 0.8, nXiptMassBins, 2); - fGFW->AddRegion("poiXiN", -0.8, -0.4, nXiptMassBins, 2); - fGFW->AddRegion("poiXifull", -0.8, 0.8, nXiptMassBins, 2); + fGFW->AddRegion("poiXiPdpt", 0.4, 0.8, nXiptMassBins, 2); + fGFW->AddRegion("poiXiNdpt", -0.8, -0.4, nXiptMassBins, 2); + fGFW->AddRegion("poiXifulldpt", -0.8, 0.8, nXiptMassBins, 2); + fGFW->AddRegion("poiXiP", 0.4, 0.8, 1, 2); + fGFW->AddRegion("poiXiN", -0.8, -0.4, 1, 2); int nOmegaptMassBins = nXiPtBins * cfgOmegaMassbins; - fGFW->AddRegion("poiOmegaP", 0.4, 0.8, nOmegaptMassBins, 4); - fGFW->AddRegion("poiOmegaN", -0.8, -0.4, nOmegaptMassBins, 4); - fGFW->AddRegion("poiOmegafull", -0.8, 0.8, nOmegaptMassBins, 4); + fGFW->AddRegion("poiOmegaPdpt", 0.4, 0.8, nOmegaptMassBins, 4); + fGFW->AddRegion("poiOmegaNdpt", -0.8, -0.4, nOmegaptMassBins, 4); + fGFW->AddRegion("poiOmegafulldpt", -0.8, 0.8, nOmegaptMassBins, 4); + fGFW->AddRegion("poiOmegaP", 0.4, 0.8, 1, 4); + fGFW->AddRegion("poiOmegaN", -0.8, -0.4, 1, 4); int nK0sptMassBins = nV0PtBins * cfgK0sMassbins; - fGFW->AddRegion("poiK0sP", 0.4, 0.8, nK0sptMassBins, 8); - fGFW->AddRegion("poiK0sN", -0.8, -0.4, nK0sptMassBins, 8); - fGFW->AddRegion("poiK0sfull", -0.8, 0.8, nK0sptMassBins, 8); + fGFW->AddRegion("poiK0sPdpt", 0.4, 0.8, nK0sptMassBins, 8); + fGFW->AddRegion("poiK0sNdpt", -0.8, -0.4, nK0sptMassBins, 8); + fGFW->AddRegion("poiK0sfulldpt", -0.8, 0.8, nK0sptMassBins, 8); + fGFW->AddRegion("poiK0sP", 0.4, 0.8, 1, 8); + fGFW->AddRegion("poiK0sN", -0.8, 0.4, 1, 8); int nLambdaptMassBins = nV0PtBins * cfgLambdaMassbins; - fGFW->AddRegion("poiLambdaP", 0.4, 0.8, nLambdaptMassBins, 16); - fGFW->AddRegion("poiLambdaN", -0.8, -0.4, nLambdaptMassBins, 16); - fGFW->AddRegion("poiLambdafull", -0.8, 0.8, nLambdaptMassBins, 16); + fGFW->AddRegion("poiLambdaPdpt", 0.4, 0.8, nLambdaptMassBins, 16); + fGFW->AddRegion("poiLambdaNdpt", -0.8, -0.4, nLambdaptMassBins, 16); + fGFW->AddRegion("poiLambdafulldpt", -0.8, 0.8, nLambdaptMassBins, 16); + fGFW->AddRegion("poiLambdaP", 0.4, 0.8, 1, 16); + fGFW->AddRegion("poiLambdaN", -0.8, -0.4, 1, 16); // pushback corrconfigs.push_back(fGFW->GetCorrelatorConfig("refP10dpt {2} refN10dpt {-2}", "Ref10Gap22dpt", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("reffulldpt reffulldpt {2 2 -2 -2}", "Ref10Gap24dpt", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiXiP {2} refN10 {-2}", "Xi10Gap22a", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiXiN {2} refP10 {-2}", "Xi10Gap22b", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiXifull reffull {2 2 -2 -2}", "Xi10Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiOmegaP {2} refN10 {-2}", "Omega10Gap22a", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiOmegaN {2} refP10 {-2}", "Omega10Gap22b", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiOmegaP reffull {2 2 -2 -2}", "Xi10Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sP {2} refN10 {-2}", "K0short10Gap22a", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sN {2} refP10 {-2}", "K0short10Gap22b", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sP reffull {2 2 -2 -2}", "Xi10Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiLambdaP {2} refN10 {-2}", "Lambda10Gap22a", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiLambdaN {2} refP10 {-2}", "Lambda10Gap22b", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiLambdaP reffull {2 2 -2 -2}", "Xi10Gap24a", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiXiPdpt {2} refN10 {-2}", "Xi10Gap22a", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiXiNdpt {2} refP10 {-2}", "Xi10Gap22b", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiXifulldpt reffull {2 2 -2 -2}", "Xi10Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiOmegaPdpt {2} refN10 {-2}", "Omega10Gap22a", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiOmegaNdpt {2} refP10 {-2}", "Omega10Gap22b", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiOmegaPdpt reffull {2 2 -2 -2}", "Xi10Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sPdpt {2} refN10 {-2}", "K0short10Gap22a", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sNdpt {2} refP10 {-2}", "K0short10Gap22b", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sPdpt reffull {2 2 -2 -2}", "Xi10Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiLambdaPdpt {2} refN10 {-2}", "Lambda10Gap22a", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiLambdaNdpt {2} refP10 {-2}", "Lambda10Gap22b", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiLambdaPdpt reffull {2 2 -2 -2}", "Xi10Gap24a", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("refP10 {2} refN10 {-2}", "Ref10Gap22", kFALSE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("reffull reffull {2 2 -2 -2}", "Ref10Gap24", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sP {2} refN10 {-2}", "K0s10Gap22inta", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sN {2} refP10 {-2}", "K0s10Gap22intb", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiLambdaP {2} refN10 {-2}", "Lambda10Gap22inta", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiLambdaN {2} refP10 {-2}", "Lambda10Gap22intb", kFALSE)); fGFW->CreateRegions(); // finalize the initialization // used for event selection @@ -342,10 +356,10 @@ struct FlowGFWOmegaXi { { float dnx = 0; float val = 0; - dnx = fGFW->Calculate(corrconf, ptbin, kTRUE).real(); + dnx = fGFW->Calculate(corrconf, ptbin - 1, kTRUE).real(); if (dnx == 0) return; - val = fGFW->Calculate(corrconf, ptbin, kFALSE).real() / dnx; + val = fGFW->Calculate(corrconf, ptbin - 1, kFALSE).real() / dnx; if (TMath::Abs(val) < 1) { registry.fill(tarName, fPtAxis->GetBinCenter(ptbin), cent, val, dnx); } @@ -528,7 +542,7 @@ struct FlowGFWOmegaXi { continue; registry.fill(HIST("hPhi"), track.phi()); registry.fill(HIST("hEta"), track.eta()); - registry.fill(HIST("hEtaPhiVtxzREF"), track.phi(), track.eta(), vtxz); + registry.fill(HIST("hEtaPhiVtxzREF"), track.phi(), track.eta(), vtxz, wacc); registry.fill(HIST("hPt"), track.pt()); int ptbin = fPtAxis->FindBin(track.pt()) - 1; if ((track.pt() > cfgCutPtMin) && (track.pt() < cfgCutPtMax)) { @@ -543,13 +557,13 @@ struct FlowGFWOmegaXi { auto v0negdau = v0.negTrack_as(); // check tpc int PDGCode = 0; - if (v0.qtarm() / TMath::Abs(v0.alpha()) > cfgv0_ArmPodocut && TMath::Abs(v0posdau.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(v0negdau.tpcNSigmaPi()) < cfgNSigmaCascPion) { + if (v0.qtarm() / TMath::Abs(v0.alpha()) > cfgv0_ArmPodocut && TMath::Abs(v0posdau.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(v0negdau.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(v0posdau.tofNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(v0negdau.tofNSigmaPi()) < cfgNSigmaCascPion) { registry.fill(HIST("InvMassK0s_all"), v0.pt(), v0.mK0Short(), v0.eta(), cent); if (!setCurrentParticleWeights(weff, wacc, v0, vtxz, 1)) continue; PDGCode = kK0Short; CandNum_all[0] = CandNum_all[0] + 1; - } else if (v0.qtarm() / TMath::Abs(v0.alpha()) < cfgv0_ArmPodocut && TMath::Abs(v0posdau.tpcNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(v0negdau.tpcNSigmaPi()) < cfgNSigmaCascPion) { + } else if (TMath::Abs(v0posdau.tpcNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(v0negdau.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(v0posdau.tofNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(v0negdau.tofNSigmaPi()) < cfgNSigmaCascPion) { registry.fill(HIST("InvMassLambda_all"), v0.pt(), v0.mLambda(), v0.eta(), cent); if (!setCurrentParticleWeights(weff, wacc, v0, vtxz, 2)) continue; @@ -576,7 +590,7 @@ struct FlowGFWOmegaXi { if (TMath::Abs(v0.mK0Short() - o2::constants::physics::MassK0Short) < cfgv0_mk0swindow) { CandNum[0] = CandNum[0] + 1; registry.fill(HIST("InvMassK0s"), v0.pt(), v0.mK0Short(), v0.eta(), cent); - registry.fill(HIST("hEtaPhiVtxzPOIK0s"), v0.phi(), v0.eta(), vtxz); + registry.fill(HIST("hEtaPhiVtxzPOIK0s"), v0.phi(), v0.eta(), vtxz, wacc); fGFW->Fill(v0.eta(), fV0PtAxis->FindBin(v0.pt()) - 1 + ((fK0sMass->FindBin(v0.mK0Short()) - 1) * nV0PtBins), v0.phi(), wacc * weff, 8); if (cfgOutputNUAWeights) fWeightsK0s->Fill(v0.phi(), v0.eta(), vtxz, v0.pt(), cent, 0); @@ -585,7 +599,7 @@ struct FlowGFWOmegaXi { if (TMath::Abs(v0.mLambda() - o2::constants::physics::MassLambda0) < cfgv0_mlambdawindow) { CandNum[1] = CandNum[1] + 1; registry.fill(HIST("InvMassLambda"), v0.pt(), v0.mLambda(), v0.eta(), cent); - registry.fill(HIST("hEtaPhiVtxzPOILambda"), v0.phi(), v0.eta(), vtxz); + registry.fill(HIST("hEtaPhiVtxzPOILambda"), v0.phi(), v0.eta(), vtxz, wacc); fGFW->Fill(v0.eta(), fV0PtAxis->FindBin(v0.pt()) - 1 + ((fLambdaMass->FindBin(v0.mLambda()) - 1) * nV0PtBins), v0.phi(), wacc * weff, 16); if (cfgOutputNUAWeights) fWeightsLambda->Fill(v0.phi(), v0.eta(), vtxz, v0.pt(), cent, 0); @@ -602,13 +616,13 @@ struct FlowGFWOmegaXi { continue; } int PDGCode = 0; - if (casc.sign() < 0 && TMath::Abs(casc.yOmega()) < cfgCasc_rapidity && TMath::Abs(bachelor.tpcNSigmaKa()) < cfgNSigmaCascKaon && TMath::Abs(posdau.tpcNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(negdau.tpcNSigmaPi()) < cfgNSigmaCascPion) { + if (casc.sign() < 0 && TMath::Abs(casc.yOmega()) < cfgCasc_rapidity && TMath::Abs(bachelor.tpcNSigmaKa()) < cfgNSigmaCascKaon && TMath::Abs(posdau.tpcNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(negdau.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(bachelor.tofNSigmaKa()) < cfgNSigmaCascKaon && TMath::Abs(posdau.tofNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(negdau.tofNSigmaPi()) < cfgNSigmaCascPion) { registry.fill(HIST("InvMassOmegaMinus_all"), casc.pt(), casc.mOmega(), casc.eta(), cent); if (!setCurrentParticleWeights(weff, wacc, casc, vtxz, 4)) continue; PDGCode = kOmegaMinus; CandNum_all[3] = CandNum_all[3] + 1; - } else if (casc.sign() < 0 && TMath::Abs(casc.yXi()) < cfgCasc_rapidity && TMath::Abs(bachelor.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(posdau.tpcNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(negdau.tpcNSigmaPi()) < cfgNSigmaCascPion) { + } else if (casc.sign() < 0 && TMath::Abs(casc.yXi()) < cfgCasc_rapidity && TMath::Abs(bachelor.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(posdau.tpcNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(negdau.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(bachelor.tofNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(posdau.tofNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(negdau.tofNSigmaPi()) < cfgNSigmaCascPion) { registry.fill(HIST("InvMassXiMinus_all"), casc.pt(), casc.mXi(), casc.eta(), cent); if (!setCurrentParticleWeights(weff, wacc, casc, vtxz, 3)) continue; @@ -649,7 +663,7 @@ struct FlowGFWOmegaXi { continue; if (PDGCode == kOmegaMinus) { CandNum[3] = CandNum[3] + 1; - registry.fill(HIST("hEtaPhiVtxzPOIOmega"), casc.phi(), casc.eta(), vtxz); + registry.fill(HIST("hEtaPhiVtxzPOIOmega"), casc.phi(), casc.eta(), vtxz, wacc); registry.fill(HIST("InvMassOmegaMinus"), casc.pt(), casc.mOmega(), casc.eta(), cent); if ((casc.pt() < cfgCutPtPOIMax) && (casc.pt() > cfgCutPtPOIMin) && (casc.mOmega() > 1.63) && (casc.mOmega() < 1.71)) { fGFW->Fill(casc.eta(), fXiPtAxis->FindBin(casc.pt()) - 1 + ((fOmegaMass->FindBin(casc.mOmega()) - 1) * nXiPtBins), casc.phi(), wacc * weff, 4); @@ -659,7 +673,7 @@ struct FlowGFWOmegaXi { } if (PDGCode == kXiMinus) { CandNum[2] = CandNum[2] + 1; - registry.fill(HIST("hEtaPhiVtxzPOIXi"), casc.phi(), casc.eta(), vtxz); + registry.fill(HIST("hEtaPhiVtxzPOIXi"), casc.phi(), casc.eta(), vtxz, wacc); registry.fill(HIST("InvMassXiMinus"), casc.pt(), casc.mXi(), casc.eta(), cent); if ((casc.pt() < cfgCutPtPOIMax) && (casc.pt() > cfgCutPtPOIMin) && (casc.mXi() > 1.30) && (casc.mXi() < 1.37)) { fGFW->Fill(casc.eta(), fXiPtAxis->FindBin(casc.pt()) - 1 + ((fXiMass->FindBin(casc.mXi()) - 1) * nXiPtBins), casc.phi(), wacc * weff, 2); @@ -669,16 +683,20 @@ struct FlowGFWOmegaXi { } } for (int i = 0; i < 4; i++) { - if (CandNum_all[i] > 1) { + if (CandNum_all[i] > 0) { registry.fill(HIST("hEventCount"), 2.5, i + 0.5); } - if (CandNum[i] > 1) { + if (CandNum[i] > 0) { registry.fill(HIST("hEventCount"), 3.5, i + 0.5); } } // Filling cumulant with ROOT TProfile and loop for all ptBins FillProfile(corrconfigs.at(14), HIST("c22"), cent); FillProfile(corrconfigs.at(15), HIST("c24"), cent); + FillProfile(corrconfigs.at(16), HIST("K0sc22"), cent); + FillProfile(corrconfigs.at(17), HIST("K0sc22"), cent); + FillProfile(corrconfigs.at(18), HIST("Lambdac22"), cent); + FillProfile(corrconfigs.at(19), HIST("Lambdac22"), cent); for (int i = 1; i <= nPtBins; i++) { FillProfilepT(corrconfigs.at(0), HIST("c22dpt"), i, cent); FillProfilepT(corrconfigs.at(1), HIST("c24dpt"), i, cent); From 012e18629e15acbe4feb17f521c4f5eb135a775c Mon Sep 17 00:00:00 2001 From: Daniel Samitz <69901155+DanielSamitz@users.noreply.github.com> Date: Sun, 24 Nov 2024 10:43:43 +0100 Subject: [PATCH 061/459] [PWGEM] FT0 occupancy in treeCreatorElectronML (#8590) --- PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx index de581cc2be5..41e9e58209c 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx @@ -68,7 +68,7 @@ DECLARE_SOA_COLUMN(MCPosY, mcposY, float); //! DECLARE_SOA_COLUMN(MCPosZ, mcposZ, float); //! } // namespace mycollision DECLARE_SOA_TABLE(MyCollisions, "AOD", "MYCOLLISION", //! vertex information of collision - o2::soa::Index<>, bc::GlobalBC, bc::RunNumber, collision::PosX, collision::PosY, collision::PosZ, collision::NumContrib, evsel::NumTracksInTimeRange, evsel::Sel8, mycollision::Bz, + o2::soa::Index<>, bc::GlobalBC, bc::RunNumber, collision::PosX, collision::PosY, collision::PosZ, collision::NumContrib, evsel::NumTracksInTimeRange, evsel::SumAmpFT0CInTimeRange, evsel::Sel8, mycollision::Bz, mccollision::GeneratorsID, mycollision::MCPosX, mycollision::MCPosY, mycollision::MCPosZ, mult::MultNTracksPV, cent::CentFT0M, cent::CentFT0A, cent::CentFT0C); using MyCollision = MyCollisions::iterator; @@ -184,7 +184,8 @@ struct TreeCreatorElectronML { // collision Configurable maxVtxZ{"maxVtxZ", 10.0, "max VtxZ [cm]"}; - Configurable maxOccupancy{"maxOccupancy", 999999, "max occupancy"}; + Configurable maxTrackOccupancy{"maxTrackOccupancy", 999999, "max. track occupancy"}; + Configurable maxFT0Occupancy{"maxFT0Occupancy", 999999, "max. FT0 occupancy"}; // track Configurable mincrossedrows{"mincrossedrows", 70, "min. crossed rows"}; @@ -598,7 +599,7 @@ struct TreeCreatorElectronML { void doCollision(TCollision& collision, TMCCollision& mccollision, uint64_t globalBC, int runNumber) { registry.fill(HIST("hEventCounter"), 1.5); - mycollision(globalBC, runNumber, collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.sel8(), d_bz, + mycollision(globalBC, runNumber, collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange(), collision.sel8(), d_bz, mccollision.generatorsID(), mccollision.posX(), mccollision.posY(), mccollision.posZ(), collision.multNTracksPV(), collision.centFT0M(), collision.centFT0A(), collision.centFT0C()); } @@ -613,7 +614,7 @@ struct TreeCreatorElectronML { using MyFilteredTracksMC = soa::Filtered; Preslice perCollision = aod::track::collisionId; - Filter collisionFilter = nabs(o2::aod::collision::posZ) < maxVtxZ && o2::aod::evsel::trackOccupancyInTimeRange < maxOccupancy; + Filter collisionFilter = nabs(o2::aod::collision::posZ) < maxVtxZ && o2::aod::evsel::trackOccupancyInTimeRange < maxTrackOccupancy && o2::aod::evsel::ft0cOccupancyInTimeRange < maxFT0Occupancy; using MyFilteredCollisions = soa::Filtered>; void processSingleTrack(MyFilteredCollisions const& collisions, aod::BCsWithTimestamps const&, MyFilteredTracksMC const& tracks, aod::McParticles const& mctracks, aod::McCollisions const&) From 9109948ec793249516f8e315112095191d4e4458 Mon Sep 17 00:00:00 2001 From: mj525 <99000728+mjkim525@users.noreply.github.com> Date: Sun, 24 Nov 2024 20:22:45 +0900 Subject: [PATCH 062/459] [PWGLF] added Xi* Cascade track's PID selection for QA code (#8591) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx | 718 +++++++++++--------- 1 file changed, 384 insertions(+), 334 deletions(-) diff --git a/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx b/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx index 9c60a73042d..6781fdffdaf 100644 --- a/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx +++ b/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx @@ -9,8 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file xi1530analysisqa.cxx -/// \brief Reconstruction of track-track decay resonance candidates +/// \file xi1530Analysisqa.cxx +/// \brief Reconstruction of Xi* resonance. /// /// \author Min-jae Kim , Bong-Hwi Lim #include @@ -48,9 +48,16 @@ enum { kAllType }; +enum { + PionPID = 211, + XiPID = 3312, + XiStarPID = 3324 +}; + struct xi1530analysisqa { // Basic set-up // + Configurable cMassXiminus{"cMassXiminus", 1.32171, "Mass of Xi baryon"}; SliceCache cache; Preslice perRCol = aod::resodaughter::resoCollisionId; Preslice perCollision = aod::track::collisionId; @@ -58,18 +65,16 @@ struct xi1530analysisqa { using ResoMCCols = soa::Join; - Configurable cMassXiminus{"cMassXiminus", 1.31486, "Mass of Xi baryon"}; - // associated with histograms ConfigurableAxis binsPt{"binsPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 12.7, 12.8, 12.9, 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 14.0, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 14.9, 15.0}, "Binning of the pT axis"}; ConfigurableAxis binsPtQA{"binsPtQA", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8, 7.0, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, 8.6, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.0}, "Binning of the pT axis"}; ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; - Configurable cInvMassStart{"cInvMassStart", 1.2, "Invariant mass start"}; - Configurable cInvMassEnd{"cInvMassEnd", 2.1, "Invariant mass end"}; - Configurable cInvMassBins{"cInvMassBins", 900, "Invariant mass binning"}; + Configurable cInvMassStart{"cInvMassStart", 1.4, "Invariant mass start"}; + Configurable cInvMassEnd{"cInvMassEnd", 1.8, "Invariant mass end"}; + Configurable cInvMassBins{"cInvMassBins", 200, "Invariant mass binning"}; - Configurable cPIDBins{"cPIDBins", 65, "PID binning"}; + Configurable cPIDBins{"cPIDBins", 130, "PID binning"}; Configurable cPIDQALimit{"cPIDQALimit", 6.5, "PID QA limit"}; Configurable cDCABins{"cDCABins", 150, "DCA binning"}; @@ -77,6 +82,10 @@ struct xi1530analysisqa { Configurable study_antiparticle{"study_antiparticle", true, "Study anti-particles separately"}; Configurable PIDplots{"PIDplots", true, "Make TPC and TOF PID plots"}; + Configurable additionalQAplots{"additionalQAplots", true, "Additional QA plots"}; + Configurable additionalQAeventPlots{"additionalQAeventPlots", true, "Additional QA event plots"}; + Configurable additionalMEPlots{"additionalMEPlots", true, "Additional Mixed event plots"}; + // Event Mixing Configurable nEvtMixing{"nEvtMixing", 10, "Number of events to mix"}; ConfigurableAxis CfgVtxBins{"CfgVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; @@ -92,28 +101,26 @@ struct xi1530analysisqa { Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; - Configurable cfgGlobalTrack{"cfgGlobalTrack", true, "Global track selection"}; - Configurable cfgPVContributor{"cfgPVContributor", true, "PV contributor track selection"}; - Configurable additionalQAplots{"additionalQAplots", true, "Additional QA plots"}; - Configurable additionalQAeventPlots{"additionalQAeventPlots", true, "Additional QA event plots"}; - Configurable additionalMEPlots{"additionalMEPlots", true, "Additional Mixed event plots"}; + Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; + Configurable cfgPVContributor{"cfgPVContributor", false, "PV contributor track selection"}; - Configurable tof_at_high_pt{"tof_at_high_pt", true, "Use TOF at high pT"}; + Configurable tof_at_high_pt{"tof_at_high_pt", false, "Use TOF at high pT"}; - Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; // Minmimum - Configurable cfgTPCcluster{"cfgTPCcluster", 0, "Number of TPC cluster"}; // Minmimum + Configurable cfgITScluster{"cfgITScluster", 1, "Minimum Number of ITS cluster"}; // Minmimum + Configurable cfgTPCcluster{"cfgTPCcluster", 1, "Minimum Number of TPC cluster"}; // Minmimum - Configurable cfgRatioTPCRowsOverFindableCls{"cfgRatioTPCRowsOverFindableCls", 0.0f, "TPC Crossed Rows to Findable Clusters"}; // Minmimum + Configurable cfgTPCRows{"cfgTPCRows", 70, "Minimum Number of TPC Crossed Rows "}; + Configurable cfgRatioTPCRowsOverFindableCls{"cfgRatioTPCRowsOverFindableCls", 0.8, "Minimum of TPC Crossed Rows to Findable Clusters"}; // Minmimum - Configurable cfgITSChi2NCl{"cfgITSChi2NCl", 999.0, "ITS Chi2/NCl"}; // Maximum - Configurable cfgTPCChi2NCl{"cfgTPCChi2NCl", 999.0, "TPC Chi2/NCl"}; // Maximum + Configurable cfgITSChi2NCl{"cfgITSChi2NCl", 4.0, "Maximum ITS Chi2/NCl"}; // Maximum + Configurable cfgTPCChi2NCl{"cfgTPCChi2NCl", 4.0, "Maximum TPC Chi2/NCl"}; // Maximum - Configurable cfgUseTPCRefit{"cfgUseTPCRefit", true, "Require TPC Refit"}; - Configurable cfgUseITSRefit{"cfgUseITSRefit", true, "Require ITS Refit"}; + Configurable cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"}; + Configurable cfgUseITSRefit{"cfgUseITSRefit", false, "Require ITS Refit"}; Configurable cfgHasITS{"cfgHasITS", true, "Require ITS"}; Configurable cfgHasTPC{"cfgHasTPC", true, "Require TPC"}; - Configurable cfgHasTOF{"cfgHasTOF", true, "Require TOF"}; + Configurable cfgHasTOF{"cfgHasTOF", false, "Require TOF"}; //*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*// @@ -148,38 +155,43 @@ struct xi1530analysisqa { // PID Selections// + Configurable cPIDBound{"cPIDBound", 6.349, "configurable for replacing to .has"}; + // PID Selections for Pion First Configurable cMaxTPCnSigmaPionFirst{"cMaxTPCnSigmaPionFirst", 3.0, "TPC nSigma cut for Pion First"}; Configurable cMaxTOFnSigmaPionFirst{"cMaxTOFnSigmaPionFirst", 3.0, "TOF nSigma cut for Pion First"}; - Configurable nsigmaCutCombinedPionFirst{"nsigmaCutCombinedPionFirst", -999, "Combined nSigma cut for Pion First"}; + Configurable nsigmaCutCombinedPionFirst{"nsigmaCutCombinedPionFirst", -4.0, "Combined nSigma cut for Pion First"}; - Configurable cUseOnlyTOFTrackPionFirst{"cUseOnlyTOFTrackPionFirst", true, "Use only TOF track for PID selection Pion First"}; - Configurable cByPassTOFPionFirst{"cByPassTOFPionFirst", true, "By pass TOF Pion First PID selection"}; + Configurable cUseOnlyTOFTrackPionFirst{"cUseOnlyTOFTrackPionFirst", false, "Use only TOF track for PID selection Pion First"}; + Configurable cByPassTOFPionFirst{"cByPassTOFPionFirst", false, "By pass TOF Pion First PID selection"}; - // // PID Selections for Pion Bachelor - // Configurable cMaxTPCnSigmaPionBachelor{"cMaxTPCnSigmaPionBachelor", 3.0, "TPC nSigma cut for Pion Bachelor"}; - // Configurable cMaxTOFnSigmaPionBachelor{"cMaxTOFnSigmaPionBachelor", 3.0, "TOF nSigma cut for Pion Bachelor"}; + // PID Selections for Pion Bachelor + Configurable cMaxTPCnSigmaPionBachelor{"cMaxTPCnSigmaPionBachelor", 3.0, "TPC nSigma cut for Pion Bachelor"}; + Configurable cMaxTOFnSigmaPionBachelor{"cMaxTOFnSigmaPionBachelor", 3.0, "TOF nSigma cut for Pion Bachelor"}; - // Configurable nsigmaCutCombinedPionBachelor{"nsigmaCutCombinedPionBachelor", -999, "Combined nSigma cut for Pion Bachelor"}; + Configurable nsigmaCutCombinedPionBachelor{"nsigmaCutCombinedPionBachelor", -4.0, "Combined nSigma cut for Pion Bachelor"}; - // Configurable cUseOnlyTOFTrackPionBachelor{"cUseOnlyTOFTrackPionBachelor", false, "Use only TOF track for PID selection Pion Bachelor"}; + Configurable cUseOnlyTOFTrackPionBachelor{"cUseOnlyTOFTrackPionBachelor", false, "Use only TOF track for PID selection Pion Bachelor"}; + Configurable cByPassTOFPionBachelor{"cByPassTOFPionBachelor", false, "By pass TOF Pion Bachelor PID selection"}; - // // PID Selections for Pion - // Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 3.0, "TPC nSigma cut for Pion"}; - // Configurable cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; + // PID Selections for Pion + Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 3.0, "TPC nSigma cut for Pion"}; + Configurable cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; - // Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; + Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", -4.0, "Combined nSigma cut for Pion"}; - // Configurable cUseOnlyTOFTrackPion{"cUseOnlyTOFTrackPion", false, "Use only TOF track for PID selection Pion"}; + Configurable cUseOnlyTOFTrackPion{"cUseOnlyTOFTrackPion", false, "Use only TOF track for PID selection Pion"}; + Configurable cByPassTOFPion{"cByPassTOFPion", false, "By pass TOF Pion PID selection"}; - // // PID Selections for Proton - // Configurable cMaxTPCnSigmaProton{"cMaxTPCnSigmaProton", 3.0, "TPC nSigma cut for Proton"}; - // Configurable cMaxTOFnSigmaProton{"cMaxTOFnSigmaProton", 3.0, "TOF nSigma cut for Proton"}; + // PID Selections for Proton + Configurable cMaxTPCnSigmaProton{"cMaxTPCnSigmaProton", 3.0, "TPC nSigma cut for Proton"}; + Configurable cMaxTOFnSigmaProton{"cMaxTOFnSigmaProton", 3.0, "TOF nSigma cut for Proton"}; - // Configurable nsigmaCutCombinedProton{"nsigmaCutCombinedProton", -999, "Combined nSigma cut for Proton"}; + Configurable nsigmaCutCombinedProton{"nsigmaCutCombinedProton", -4.0, "Combined nSigma cut for Proton"}; - // Configurable cUseOnlyTOFTrackProton{"cUseOnlyTOFTrackProton", false, "Use only TOF track for PID selection Proton"}; + Configurable cUseOnlyTOFTrackProton{"cUseOnlyTOFTrackProton", false, "Use only TOF track for PID selection Proton"}; + Configurable cByPassTOFProton{"cByPassTOFProton", false, "By pass TOF Proton PID selection"}; //*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*// @@ -191,12 +203,18 @@ struct xi1530analysisqa { // Cuts on mother particle Configurable cfgCutsOnMother{"cfgCutsOnMother", true, "Enamble additional cuts on mother"}; Configurable cMaxPtMotherCut{"cMaxPtMotherCut", 15.0, "Maximum pt of mother cut"}; - Configurable cMaxMinvMotherCut{"cMaxMinvMotherCut", 1.5, "Maximum Minv of mother cut"}; - Configurable cetaphiBins{"cetaphiBins", 400, "number of eta and phi bins"}; + Configurable cMaxMinvMotherCut{"cMaxMinvMotherCut", 2.1, "Maximum Minv of mother cut"}; TRandom* rn = new TRandom(); //*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*// + struct PIDSelectionParam { + double cMaxTPCnSigma; + double cMaxTOFnSigma; + bool cByPassTOF; + double nsigmaCutCombined; + }; + void init(o2::framework::InitContext&) { AxisSpec centAxis = {binsCent, "FT0M (%)"}; @@ -249,16 +267,8 @@ struct xi1530analysisqa { if (additionalQAplots) { // TPC ncluster distirbutions histos.add("TPCncluster/TPCnclusterpifirst", "TPC ncluster distribution", kTH1F, {{160, 0, 160, "TPC nCluster"}}); - // histos.add("TPCncluster/TPCnclusterpr", "TPC ncluster distribution", kTH1F, {{160, 0, 160, "TPC nCluster"}}); // can't use TPC info. for cascades!! - histos.add("TPCncluster/TPCnclusterPhipifirst", "TPC ncluster vs phi", kTH2F, {{160, 0, 160, "TPC nCluster"}, {63, 0, 6.28, "#phi"}}); - // histos.add("TPCncluster/TPCnclusterPhipr", "TPC ncluster vs phi", kTH2F, {{160, 0, 160, "TPC nCluster"}, {63, 0, 6.28, "#phi"}}); // can't use TPC info. for cascades!! - // Multiplicity correlation calibrations - histos.add("MultCalib/centglopi_before", "Centrality vs Global-Tracks", kTH2F, {{110, 0, 110, "Centrality"}, {500, 0, 5000, "Global Tracks"}}); - histos.add("MultCalib/GloPVpi_before", "Global tracks vs PV tracks", kTH2F, {{500, 0, 5000, "Global tracks"}, {500, 0, 5000, "PV tracks"}}); - - histos.add("MultCalib/centglopi_after", "Centrality vs Global-Tracks", kTH2F, {{110, 0, 110, "Centrality"}, {500, 0, 5000, "Global Tracks"}}); - histos.add("MultCalib/GloPVpi_after", "Global tracks vs PV tracks", kTH2F, {{500, 0, 5000, "Global tracks"}, {500, 0, 5000, "PV tracks"}}); + histos.add("TPCncluster/TPCnclusterPhipifirst", "TPC ncluster vs phi", kTH2F, {{160, 0, 160, "TPC nCluster"}, {63, 0, 6.28, "#phi"}}); } // DCA QA to candidates for first pion and Xi- @@ -281,24 +291,47 @@ struct xi1530analysisqa { histos.add("QAafter/trkpT_pi", "pT distribution of pion track candidates", kTH1F, {ptAxis}); histos.add("QAafter/trkpT_Xi", "pT distribution of Xi- track candidates", kTH1F, {ptAxis}); - // Can't use PID for cascades !! if (PIDplots) { + + // Plots for QA before, Need to pt info. for the daugthers histos.add("QAbefore/TOF_TPC_Map_pi_first_all", "TOF + TPC Combined PID for Pion_{First};#sigma_{TOF}^{Pion};#sigma_{TPC}^{Pion}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); histos.add("QAbefore/TOF_Nsigma_pi_first_all", "TOF NSigma for Pion_{First};#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); histos.add("QAbefore/TPC_Nsigma_pi_first_all", "TPC NSigma for Pion_{First};#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); - // histos.add("QAbefore/TOF_TPC_Map_pr_all", "TOF + TPC Combined PID for Pion;#sigma_{TOF}^{proton};#sigma_{TPC}^{proton}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); - // histos.add("QAbefore/TOF_Nsigma_pr_all", "TOF NSigma for Pion;#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{proton};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); - // histos.add("QAbefore/TPC_Nsigma_pr_all", "TPC NSigma for proton;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{proton};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + histos.add("QAbefore/TOF_TPC_Map_pi_bachelor_all", "TOF + TPC Combined PID for Pion_{Bachelor};#sigma_{TOF}^{Pion};#sigma_{TPC}^{Pion}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + histos.add("QAbefore/TPC_Nsigma_pi_bachelor_all", "TPC NSigma for Pion_{Bachelor};#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + + histos.add("QAbefore/TOF_TPC_Map_pr_all", "TOF + TPC Combined PID for Proton;#sigma_{TOF}^{Proton};#sigma_{TPC}^{Proton}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + histos.add("QAbefore/TOF_TPC_Map_antipr_all", "TOF + TPC Combined PID for Anti-Proton;#sigma_{TOF}^{Proton};#sigma_{TPC}^{Proton}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); - // PID QA after cuts + histos.add("QAbefore/TPC_Nsigma_pr_all", "TPC NSigma for Proton;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Proton};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + histos.add("QAbefore/TPC_Nsigma_antipr_all", "TPC NSigma for Anti-Proton;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Proton};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + + histos.add("QAbefore/TOF_TPC_Map_pi_all", "TOF + TPC Combined PID for Pion;#sigma_{TOF}^{Pion};#sigma_{TPC}^{Pion}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + histos.add("QAbefore/TOF_TPC_Map_piminus_all", "TOF + TPC Combined PID for Pion -;#sigma_{TOF}^{Pion};#sigma_{TPC}^{Pion}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + + histos.add("QAbefore/TPC_Nsigma_pi_all", "TPC NSigma for Pion;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + histos.add("QAbefore/TPC_Nsigma_piminus_all", "TPC NSigma for Pion -;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + + // Plots for QA after histos.add("QAafter/TOF_TPC_Map_pi_first_all", "TOF + TPC Combined PID for Pion_{First};#sigma_{TOF}^{Pion};#sigma_{TPC}^{Pion}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); histos.add("QAafter/TOF_Nsigma_pi_first_all", "TOF NSigma for Pion_{First};#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); histos.add("QAafter/TPC_Nsigma_pi_first_all", "TPC NSigma for Pion_{First};#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); - // histos.add("QAafter/TOF_TPC_Map_pr_all", "TOF + TPC Combined PID for Pion;#sigma_{TOF}^{proton};#sigma_{TPC}^{proton}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); - // histos.add("QAafter/TOF_Nsigma_pr_all", "TOF NSigma for Pion;#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{proton};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); - // histos.add("QAafter/TPC_Nsigma_pr_all", "TPC NSigma for proton;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{proton};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + histos.add("QAafter/TOF_TPC_Map_pi_bachelor_all", "TOF + TPC Combined PID for Pion_{Bachelor};#sigma_{TOF}^{Pion};#sigma_{TPC}^{Pion}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + histos.add("QAafter/TPC_Nsigma_pi_bachelor_all", "TPC NSigma for Pion_{Bachelor};#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + + histos.add("QAafter/TOF_TPC_Map_pr_all", "TOF + TPC Combined PID for Proton;#sigma_{TOF}^{Proton};#sigma_{TPC}^{Proton}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + histos.add("QAafter/TOF_TPC_Map_antipr_all", "TOF + TPC Combined PID for Anti-Proton;#sigma_{TOF}^{Proton};#sigma_{TPC}^{Proton}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + + histos.add("QAafter/TPC_Nsigma_pr_all", "TPC NSigma for Proton;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Proton};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + histos.add("QAafter/TPC_Nsigma_antipr_all", "TPC NSigma for Anti-Proton;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Proton};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + + histos.add("QAafter/TOF_TPC_Map_pi_all", "TOF + TPC Combined PID for Pion;#sigma_{TOF}^{Pion};#sigma_{TPC}^{Pion}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + histos.add("QAafter/TOF_TPC_Map_piminus_all", "TOF + TPC Combined PID for Pion -;#sigma_{TOF}^{Pion};#sigma_{TPC}^{Pion}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + + histos.add("QAafter/TPC_Nsigma_pi_all", "TPC NSigma for Pion;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + histos.add("QAafter/TPC_Nsigma_piminus_all", "TPC NSigma for Pion -;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); } // 3d histogram + Flags @@ -319,18 +352,30 @@ struct xi1530analysisqa { if (doprocessMC) { // MC QA histos.add("QAMCTrue/trkDCAxy_pi", "DCAxy distribution of pion track candidates", HistType::kTH1F, {dcaxyAxis}); - histos.add("QAMCTrue/trkDCAxy_Xi", "DCAxy distribution of Xi- track candidates", HistType::kTH1F, {dcaxyAxis}); + histos.add("QAMCTrue/trkDCAxy_xi", "DCAxy distribution of Xi- track candidates", HistType::kTH1F, {dcaxyAxis}); histos.add("QAMCTrue/trkDCAz_pi", "DCAz distribution of pion track candidates", HistType::kTH1F, {dcazAxis}); - histos.add("QAMCTrue/trkDCAz_Xi", "DCAz distribution of Xi- track candidates", HistType::kTH1F, {dcazAxis}); + histos.add("QAMCTrue/trkDCAz_xi", "DCAz distribution of Xi- track candidates", HistType::kTH1F, {dcazAxis}); - // Can't use PID for cascades !! if (PIDplots) { - histos.add("QAMCTrue/TOF_Nsigma_pi_all", "TOF NSigma for Pion;#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); - histos.add("QAMCTrue/TPC_Nsigma_pi_all", "TPC NSigma for Pion;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + histos.add("QAMCTrue/TOF_TPC_Map_pi_first_all", "TOF + TPC Combined PID for Pion_{First};#sigma_{TOF}^{Pion};#sigma_{TPC}^{Pion}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + histos.add("QAMCTrue/TOF_Nsigma_pi_first_all", "TOF NSigma for Pion_{First};#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + histos.add("QAMCTrue/TPC_Nsigma_pi_first_all", "TPC NSigma for Pion_{First};#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + + histos.add("QAMCTrue/TOF_TPC_Map_pi_bachelor_all", "TOF + TPC Combined PID for Pion_{Bachelor};#sigma_{TOF}^{Pion};#sigma_{TPC}^{Pion}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + histos.add("QAMCTrue/TPC_Nsigma_pi_bachelor_all", "TPC NSigma for Pion_{Bachelor};#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); - // histos.add("QAMCTrue/TOF_Nsigma_pr_all", "TOF NSigma for Pion;#it{p}_{T} (GeV/#it{c});#sigma_{TOF}^{Proton};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); - // histos.add("QAMCTrue/TPC_Nsigma_pr_all", "TPC NSigma for Proton;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Proton};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + histos.add("QAMCTrue/TOF_TPC_Map_pr_all", "TOF + TPC Combined PID for Proton;#sigma_{TOF}^{Proton};#sigma_{TPC}^{Proton}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + histos.add("QAMCTrue/TOF_TPC_Map_antipr_all", "TOF + TPC Combined PID for Anti-Proton;#sigma_{TOF}^{Proton};#sigma_{TPC}^{Proton}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + + histos.add("QAMCTrue/TPC_Nsigma_pr_all", "TPC NSigma for Proton;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Proton};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + histos.add("QAMCTrue/TPC_Nsigma_antipr_all", "TPC NSigma for Anti-Proton;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Proton};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + + histos.add("QAMCTrue/TOF_TPC_Map_pi_all", "TOF + TPC Combined PID for Pion;#sigma_{TOF}^{Pion};#sigma_{TPC}^{Pion}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + histos.add("QAMCTrue/TOF_TPC_Map_piminus_all", "TOF + TPC Combined PID for Pion -;#sigma_{TOF}^{Pion};#sigma_{TPC}^{Pion}", {HistType::kTH2F, {pidQAAxis, pidQAAxis}}); + + histos.add("QAMCTrue/TPC_Nsigma_pi_all", "TPC NSigma for Pion;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); + histos.add("QAMCTrue/TPC_Nsigma_piminus_all", "TPC NSigma for Pion -;#it{p}_{T} (GeV/#it{c});#sigma_{TPC}^{Pion};", {HistType::kTH3F, {centAxis, ptAxisQA, pidQAAxis}}); } histos.add("h3RecXi1530invmass", "Invariant mass of Reconstructed MC Xi(1530)0", kTHnSparseF, {centAxis, ptAxis, invMassAxis, FlagAxis}); @@ -349,7 +394,7 @@ struct xi1530analysisqa { // Primary track selection for the first pion // template - bool trackCut(const TrackType track) + bool PtrackCut(const TrackType track) { if (std::abs(track.eta()) > cMaxetacut) return false; @@ -363,6 +408,8 @@ struct xi1530analysisqa { return false; if (track.tpcNClsFound() < cfgTPCcluster) return false; + if (track.tpcNClsCrossedRows() < cfgTPCRows) + return false; if (track.tpcCrossedRowsOverFindableCls() < cfgRatioTPCRowsOverFindableCls) return false; if (track.itsChi2NCl() >= cfgITSChi2NCl) @@ -391,9 +438,14 @@ struct xi1530analysisqa { return true; } - // Primary track selection for cascades (Need to more informations for cascades!) // + bool hasSubsystemInfo(float Nsigma) // this will be replaced // .hasXX() was not appied in resocascade yet + { + return std::abs(Nsigma) < cPIDBound; + } + + // Primary track selection for cascades, Need to more informations for cascades // template - bool casctrackCut(const TracksTypeCasc track) + bool cascPtrackCut(const TracksTypeCasc track) { if (std::abs(track.eta()) > cMaxetacut) return false; @@ -407,8 +459,7 @@ struct xi1530analysisqa { return true; } - // Secondary track selection for cascades // - //(Not added yet!-> Need to more informations for cascades!) + // Secondary track selection for cascades // need to more information, // Topological cuts for cascades template @@ -424,7 +475,7 @@ struct xi1530analysisqa { return false; if (std::abs(track.dcapostopv()) < cDCAProtonToPVcut) return false; - } else if (track.sign() > 0) { + } else { if (std::abs(track.dcanegtopv()) < cDCAProtonToPVcut) return false; if (std::abs(track.dcapostopv()) < cDCAPionToPVcut) @@ -444,7 +495,7 @@ struct xi1530analysisqa { return false; if (track.casctransRadius() > cMaxCascradiuscut || track.casctransRadius() < cMinCascradiuscut) return false; - // if (std::abs(track.mXi() - pdgDB->Mass(3312)) > cMasswindowCasccut) // codes are not operated when using pdgDB->Mass() !! + // if (std::abs(track.mXi() - XiMass) > cMasswindowCasccut) // return false; if (std::abs(track.mXi() - cMassXiminus) > cMasswindowCasccut) return false; @@ -452,233 +503,108 @@ struct xi1530analysisqa { return true; } - // PID selection for the First Pion // - template - bool selectionPIDPionFirst(const T& candidate) + bool PIDSelector(float TPCNsigma, float TOFNsigma, const PIDSelectionParam& params, bool tofAtHighPt) { - if (tof_at_high_pt) { - if (candidate.hasTOF() && (std::abs(candidate.tofNSigmaPi()) < cMaxTOFnSigmaPionFirst)) { + bool tpcPIDPassed{false}, tofPIDPassed{false}; + + if (tofAtHighPt) { + // TOF based PID + if (hasSubsystemInfo(TOFNsigma) && std::abs(TOFNsigma) < params.cMaxTOFnSigma) { return true; } - if (!candidate.hasTOF() && (std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPionFirst)) { + if (!hasSubsystemInfo(TOFNsigma) && std::abs(TPCNsigma) < params.cMaxTPCnSigma) { return true; } + return false; } else { - bool tpcPIDPassed{false}, tofPIDPassed{false}; - if (std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPionFirst) { + + if (std::abs(TPCNsigma) < params.cMaxTPCnSigma) { tpcPIDPassed = true; } - if (cByPassTOFPionFirst && tpcPIDPassed) { + + if (params.cByPassTOF && tpcPIDPassed) { return true; } - if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaPi()) < cMaxTOFnSigmaPionFirst) { + + if (hasSubsystemInfo(TOFNsigma)) { + if (std::abs(TOFNsigma) < params.cMaxTOFnSigma) { tofPIDPassed = true; } - if ((nsigmaCutCombinedPionFirst > 0) && (candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < nsigmaCutCombinedPionFirst * nsigmaCutCombinedPionFirst)) { + if ((params.nsigmaCutCombined > 0) && + (TPCNsigma * TPCNsigma + TOFNsigma * TOFNsigma < params.nsigmaCutCombined * params.nsigmaCutCombined)) { tofPIDPassed = true; } } else { tofPIDPassed = true; } - if (tpcPIDPassed && tofPIDPassed) { - return true; - } + + return tpcPIDPassed && tofPIDPassed; } - return true; } - // PID selection for the Cascades // -> Does not use yet! - // template - // bool selectionPIDCascade(const TCascade& candidate) - // { - // auto bachTrack = candidate.template bachelor_as(); - // auto posTrack = candidate.template posTrack_as(); - // auto negTrack = candidate.template negTrack_as(); - - // bool lConsistentWithLambdaPos = false; - // bool lConsistentWithLambdaNeg = false; - // bool lConsistentWithLambda = false; - // bool lConsistentWithXi = false; - - // if (tof_at_high_pt) { - // if (bachTrack.hasTOF() && (std::abs(bachTrack.tofNSigmaPi()) < cMaxTOFnSigmaPionBachelor)) { - // lConsistentWithXi = true; - // } - // if (!bachTrack.hasTOF() && (std::abs(bachTrack.tpcNSigmaPi()) < cMaxTPCnSigmaPionBachelor)) { - // lConsistentWithXi = true; - // } - // } else { - // bool tpcPIDPassed{false}, tofPIDPassed{false}; - // if (std::abs(bachTrack.tpcNSigmaPi()) < cMaxTPCnSigmaPionBachelor) { - // tpcPIDPassed = true; - // } - // if (cByPassTOF && tpcPIDPassed) { - // lConsistentWithXi = true; - // } - // if (bachTrack.hasTOF()) { - // if (std::abs(bachTrack.tofNSigmaPi()) < cMaxTPCnSigmaPionBachelor) { - // tofPIDPassed = true; - // } - // if ((nsigmaCutCombinedPionBachelor > 0) && (bachTrack.tpcNSigmaPi() * bachTrack.tpcNSigmaPi() + bachTrack.tofNSigmaPi() * bachTrack.tofNSigmaPi() < nsigmaCutCombinedPionBachelor * nsigmaCutCombinedPionBachelor)) { - // tofPIDPassed = true; - // } - // } else { - // tofPIDPassed = true; - // } - // if (tpcPIDPassed && tofPIDPassed) { - // lConsistentWithXi = true; - // } - - // } - - // if(candidate.sign() > 0) { - // bool lConsistentWithPion = false; - // bool lConsistentWithProton = false; - - // if (tof_at_high_pt) { - // if (posTrack.hasTOF() && (std::abs(posTrack.tofNSigmaPi()) < cMaxTOFnSigmaPion)) { - // lConsistentWithPion = true; - // } - // if (!posTrack.hasTOF() && (std::abs(posTrack.tpcNSigmaPi()) < cMaxTPCnSigmaPion)) { - // lConsistentWithPion = true; - // } - // } else { - // bool tpcPIDPassed{false}, tofPIDPassed{false}; - // if (std::abs(posTrack.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { - // tpcPIDPassed = true; - // } - // if (cByPassTOF && tpcPIDPassed) { - // lConsistentWithPion = true; - // } - // if (posTrack.hasTOF()) { - // if (std::abs(posTrack.tofNSigmaPi()) < cMaxTPCnSigmaPion) { - // tofPIDPassed = true; - // } - // if ((nsigmaCutCombinedPion > 0) && (posTrack.tpcNSigmaPi() * posTrack.tpcNSigmaPi() + posTrack.tofNSigmaPi() * posTrack.tofNSigmaPi() < nsigmaCutCombinedPion * nsigmaCutCombinedPion)) { - // tofPIDPassed = true; - // } - // } else { - // tofPIDPassed = true; - // } - // if (tpcPIDPassed && tofPIDPassed) { - // lConsistentWithPion = true; - // } - // } - - // if (tof_at_high_pt) { - // if (posTrack.hasTOF() && (std::abs(posTrack.tofNSigmaPr()) < cMaxTOFnSigmaProton)) { - // lConsistentWithProton = true; - // } - // if (!posTrack.hasTOF() && (std::abs(posTrack.tpcNSigmaPr()) < cMaxTPCnSigmaProton)) { - // lConsistentWithProton = true; - // } - // } else { - // bool tpcPIDPassed{false}, tofPIDPassed{false}; - // if (std::abs(posTrack.tpcNSigmaPr()) < cMaxTPCnSigmaProton) { - // tpcPIDPassed = true; - // } - // if (cByPassTOF && tpcPIDPassed) { - // lConsistentWithProton = true; - // } - // if (posTrack.hasTOF()) { - // if (std::abs(posTrack.tofNSigmaPr()) < cMaxTPCnSigmaProton) { - // tofPIDPassed = true; - // } - // if ((nsigmaCutCombinedProton > 0) && (posTrack.tpcNSigmaPr() * posTrack.tpcNSigmaPr() + posTrack.tofNSigmaPr() * posTrack.tofNSigmaPr() < nsigmaCutCombinedProton * nsigmaCutCombinedProton)) { - // tofPIDPassed = true; - // } - // } else { - // tofPIDPassed = true; - // } - // if (tpcPIDPassed && tofPIDPassed) { - // lConsistentWithProton = true; - // } - // } - // lConsistentWithLambdaPos = lConsistentWithProton*lConsistentWithPion; - // } - - // if(candidate.sign() < 0) { - // bool lConsistentWithPion = false; - // bool lConsistentWithProton = false; - - // if (tof_at_high_pt) { - // if (negTrack.hasTOF() && (std::abs(negTrack.tofNSigmaPi()) < cMaxTOFnSigmaPion)) { - // lConsistentWithPion = true; - // } - // if (!negTrack.hasTOF() && (std::abs(negTrack.tpcNSigmaPi()) < cMaxTPCnSigmaPion)) { - // lConsistentWithPion = true; - // } - // } else { - // bool tpcPIDPassed{false}, tofPIDPassed{false}; - // if (std::abs(negTrack.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { - // tpcPIDPassed = true; - // } - // if (cByPassTOF && tpcPIDPassed) { - // lConsistentWithPion = true; - // } - // if (negTrack.hasTOF()) { - // if (std::abs(negTrack.tofNSigmaPi()) < cMaxTPCnSigmaPion) { - // tofPIDPassed = true; - // } - // if ((nsigmaCutCombinedPion > 0) && (negTrack.tpcNSigmaPi() * negTrack.tpcNSigmaPi() + negTrack.tofNSigmaPi() * negTrack.tofNSigmaPi() < nsigmaCutCombinedPion * nsigmaCutCombinedPion)) { - // tofPIDPassed = true; - // } - // } else { - // tofPIDPassed = true; - // } - // if (tpcPIDPassed && tofPIDPassed) { - // lConsistentWithPion = true; - // } - // } - - // if (tof_at_high_pt) { - // if (negTrack.hasTOF() && (std::abs(negTrack.tofNSigmaPr()) < cMaxTOFnSigmaProton)) { - // lConsistentWithProton = true; - // } - // if (!negTrack.hasTOF() && (std::abs(negTrack.tpcNSigmaPr()) < cMaxTPCnSigmaProton)) { - // lConsistentWithProton = true; - // } - // } else { - // bool tpcPIDPassed{false}, tofPIDPassed{false}; - // if (std::abs(negTrack.tpcNSigmaPr()) < cMaxTPCnSigmaProton) { - // tpcPIDPassed = true; - // } - // if (cByPassTOF && tpcPIDPassed) { - // lConsistentWithProton = true; - // } - // if (negTrack.hasTOF()) { - // if (std::abs(negTrack.tofNSigmaPr()) < cMaxTPCnSigmaProton) { - // tofPIDPassed = true; - // } - // if ((nsigmaCutCombinedProton > 0) && (negTrack.tpcNSigmaPr() * negTrack.tpcNSigmaPr() + negTrack.tofNSigmaPr() * negTrack.tofNSigmaPr() < nsigmaCutCombinedProton * nsigmaCutCombinedProton)) { - // tofPIDPassed = true; - // } - // } else { - // tofPIDPassed = true; - // } - // if (tpcPIDPassed && tofPIDPassed) { - // lConsistentWithProton = true; - // } - // } - // lConsistentWithLambdaNeg = lConsistentWithProton*lConsistentWithPion; - // } - - // lConsistentWithLambda = lConsistentWithLambdaPos * lConsistentWithLambdaNeg; - - // return lConsistentWithXi * lConsistentWithLambda; - // } + // PID selection for the First Pion // + template + bool selectionPIDPionFirst(const T& candidate) + { + + float TPCNsigmaPionFirst, TOFNsigmaPionFirst; + + TPCNsigmaPionFirst = candidate.tpcNSigmaPi(); + TOFNsigmaPionFirst = candidate.tofNSigmaPi(); + + PIDSelectionParam PionFirstParams = {cMaxTPCnSigmaPionFirst, cMaxTOFnSigmaPionFirst, cByPassTOFPionFirst, nsigmaCutCombinedPionFirst}; + + return PIDSelector(TPCNsigmaPionFirst, TOFNsigmaPionFirst, PionFirstParams, tof_at_high_pt); + } + + template + bool selectionPIDCascades(const TCascade& candidate) + { + bool lConsistentWithXi{false}, lConsistentWithLambda{false}, lConsistentWithPion{false}, lConsistentWithProton{false}; + + float TPCNsigmaBachelor, TOFNsigmaBachelor; + float TPCNsigmaPion, TOFNsigmaPion; + float TPCNsigmaProton, TOFNsigmaProton; + + if (candidate.sign() < 0) { // Xi- candidates + TPCNsigmaBachelor = candidate.daughterTPCNSigmaBachPi(); + TOFNsigmaBachelor = candidate.daughterTOFNSigmaBachPi(); + + TPCNsigmaPion = candidate.daughterTPCNSigmaNegPi(); + TOFNsigmaPion = candidate.daughterTOFNSigmaNegPi(); + + TPCNsigmaProton = candidate.daughterTPCNSigmaPosPr(); + TOFNsigmaProton = candidate.daughterTOFNSigmaPosPr(); + } else { // Anti-Xi- candidates + + TPCNsigmaBachelor = candidate.daughterTPCNSigmaBachPi(); + TOFNsigmaBachelor = candidate.daughterTOFNSigmaBachPi(); + + TPCNsigmaPion = candidate.daughterTPCNSigmaPosPi(); + TOFNsigmaPion = candidate.daughterTOFNSigmaPosPi(); + + TPCNsigmaProton = candidate.daughterTPCNSigmaNegPr(); + TOFNsigmaProton = candidate.daughterTOFNSigmaNegPr(); + } + + PIDSelectionParam bachelorParams = {cMaxTPCnSigmaPionBachelor, cMaxTOFnSigmaPionBachelor, cByPassTOFPionBachelor, nsigmaCutCombinedPionBachelor}; + PIDSelectionParam pionParams = {cMaxTPCnSigmaPion, cMaxTOFnSigmaPion, cByPassTOFPion, nsigmaCutCombinedPion}; + PIDSelectionParam protonParams = {cMaxTPCnSigmaProton, cMaxTOFnSigmaProton, cByPassTOFProton, nsigmaCutCombinedProton}; + + lConsistentWithXi = PIDSelector(TPCNsigmaBachelor, TOFNsigmaBachelor, bachelorParams, tof_at_high_pt); + lConsistentWithPion = PIDSelector(TPCNsigmaPion, TOFNsigmaPion, pionParams, tof_at_high_pt); + lConsistentWithProton = PIDSelector(TPCNsigmaProton, TOFNsigmaProton, protonParams, tof_at_high_pt); + + lConsistentWithLambda = lConsistentWithProton && lConsistentWithPion; + + return lConsistentWithXi && lConsistentWithLambda; + } template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeCasc& dTracks2) // Order: ResoColl, ResoTrack, ResoCascTrack { auto multiplicity = collision.cent(); - if (additionalQAplots) { - histos.fill(HIST("MultCalib/centglopi_before"), multiplicity, dTracks1.size()); // centrality vs global tracks before the multiplicity calibration cuts - histos.fill(HIST("MultCalib/GloPVpi_before"), dTracks1.size(), collision.multNTracksPV()); // global tracks vs PV tracks before the multiplicity calibration cuts - } - if (additionalQAeventPlots) { if constexpr (!IsMix) { histos.fill(HIST("QAevent/hVertexZSameE"), collision.posZ()); @@ -693,12 +619,8 @@ struct xi1530analysisqa { } } - if (additionalQAplots) { - histos.fill(HIST("MultCalib/centglopi_after"), multiplicity, dTracks1.size()); // centrality vs global tracks after the multiplicity calibration cuts - histos.fill(HIST("MultCalib/GloPVpi_after"), dTracks1.size(), collision.multNTracksPV()); // global tracks vs PV tracks after the multiplicity calibration cuts - } + TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; // It will be replaced to use RecoDecay (In fixing...) - TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; for (auto& [trk1, trk2] : combinations(CombinationsFullIndexPolicy(dTracks1, dTracks2))) { if (additionalQAeventPlots) { @@ -709,47 +631,100 @@ struct xi1530analysisqa { } } - if (!trackCut(trk1) || !casctrackCut(trk2)) + if (!PtrackCut(trk1) || !cascPtrackCut(trk2)) // Primary track selections continue; - auto isTrk1hasTOF = trk1.hasTOF(); - // auto isTrk2hasTOF = trk2.hasTOF(); // Can't use TPC, TOF info. for cascades yet!! - auto trk1ptPi = trk1.pt(); auto trk1NSigmaPiTPC = trk1.tpcNSigmaPi(); - auto trk1NSigmaPiTOF = (isTrk1hasTOF) ? trk1.tofNSigmaPi() : -999.; + auto trk1NSigmaPiTOF = trk1.tofNSigmaPi(); auto trk2ptXi = trk2.pt(); + // Need to daughther's pt info. in the table + // auto trk2ptPiBachelor = trk2.pt(); + float trk2NSigmaPiBachelorTPC = trk2.daughterTPCNSigmaBachPi(); + float trk2NSigmaPiBachelorTOF = trk2.daughterTOFNSigmaBachPi(); + + // auto trk2ptPr = trk2.pt(); + float trk2NSigmaPrPosTPC = trk2.daughterTPCNSigmaPosPr(); + float trk2NSigmaPrNegTPC = trk2.daughterTPCNSigmaNegPr(); + + float trk2NSigmaPrPosTOF = trk2.daughterTOFNSigmaPosPr(); + float trk2NSigmaPrNegTOF = trk2.daughterTOFNSigmaNegPr(); + + // auto trk2ptPi = trk2.pt(); + float trk2NSigmaPiPosTPC = trk2.daughterTPCNSigmaPosPi(); + float trk2NSigmaPiNegTPC = trk2.daughterTPCNSigmaNegPi(); + + float trk2NSigmaPiPosTOF = trk2.daughterTOFNSigmaPosPi(); + float trk2NSigmaPiNegTOF = trk2.daughterTOFNSigmaNegPi(); if constexpr (!IsMix) { - //// QA plots before the selection - // --- PID QA Pion + //// QA plots before the selection // need to pt for cascade tracks + // --- PID QA if (PIDplots) { histos.fill(HIST("QAbefore/TPC_Nsigma_pi_first_all"), multiplicity, trk1ptPi, trk1NSigmaPiTPC); - if (isTrk1hasTOF) { + if (hasSubsystemInfo(trk1NSigmaPiTOF)) { histos.fill(HIST("QAbefore/TOF_Nsigma_pi_first_all"), multiplicity, trk1ptPi, trk1NSigmaPiTOF); histos.fill(HIST("QAbefore/TOF_TPC_Map_pi_first_all"), trk1NSigmaPiTOF, trk1NSigmaPiTPC); } + // hasSubsystemInfo is Temporary, it will be replaced. + + histos.fill(HIST("QAbefore/TPC_Nsigma_pi_bachelor_all"), multiplicity, 0, trk2NSigmaPiBachelorTPC); // can't take pt information for the cascade secondary + if (hasSubsystemInfo(trk2NSigmaPiBachelorTOF)) { + histos.fill(HIST("QAbefore/TOF_TPC_Map_pi_bachelor_all"), trk2NSigmaPiBachelorTOF, trk2NSigmaPiBachelorTPC); + } + + histos.fill(HIST("QAbefore/TPC_Nsigma_pr_all"), multiplicity, 0, trk2NSigmaPrPosTPC); + if (hasSubsystemInfo(trk2NSigmaPrPosTOF)) { + histos.fill(HIST("QAbefore/TOF_TPC_Map_pr_all"), trk2NSigmaPrPosTOF, trk2NSigmaPrPosTPC); + } + + histos.fill(HIST("QAbefore/TPC_Nsigma_antipr_all"), multiplicity, 0, trk2NSigmaPrNegTPC); + if (hasSubsystemInfo(trk2NSigmaPrNegTOF)) { + histos.fill(HIST("QAbefore/TOF_TPC_Map_antipr_all"), trk2NSigmaPrNegTOF, trk2NSigmaPrNegTPC); + } + + histos.fill(HIST("QAbefore/TPC_Nsigma_pi_all"), multiplicity, 0, trk2NSigmaPiPosTPC); + if (hasSubsystemInfo(trk2NSigmaPiPosTOF)) { + histos.fill(HIST("QAbefore/TOF_TPC_Map_pi_all"), trk2NSigmaPiPosTOF, trk2NSigmaPiPosTPC); + } + + histos.fill(HIST("QAbefore/TPC_Nsigma_piminus_all"), multiplicity, 0, trk2NSigmaPiNegTPC); + if (hasSubsystemInfo(trk2NSigmaPiNegTOF)) { + histos.fill(HIST("QAbefore/TOF_TPC_Map_piminus_all"), trk2NSigmaPiNegTOF, trk2NSigmaPiNegTPC); + } } histos.fill(HIST("QAbefore/trkpT_pi"), trk1ptPi); histos.fill(HIST("QAbefore/trkpT_Xi"), trk2ptXi); + histos.fill(HIST("QAbefore/trkDCAxy_pi"), trk1.dcaXY()); histos.fill(HIST("QAbefore/trkDCAxy_Xi"), trk2.dcaXYCascToPV()); + histos.fill(HIST("QAbefore/trkDCAz_pi"), trk1.dcaZ()); histos.fill(HIST("QAbefore/trkDCAz_Xi"), trk2.dcaZCascToPV()); } - if (cUseOnlyTOFTrackPionFirst && !isTrk1hasTOF) + // PID selection + if (cUseOnlyTOFTrackPionFirst && !hasSubsystemInfo(trk1NSigmaPiTOF)) continue; - // if (cUseOnlyTOFTrackPr && !isTrk2hasTOF) // Can't use TPC, TOF info. for cascades yet!! - // continue; - if (!selectionPIDPionFirst(trk1)) + if (cUseOnlyTOFTrackPionBachelor && !hasSubsystemInfo(trk2NSigmaPiBachelorTOF)) + continue; + + if (cUseOnlyTOFTrackProton && !hasSubsystemInfo(trk2NSigmaPrPosTOF)) + continue; + if (cUseOnlyTOFTrackProton && !hasSubsystemInfo(trk2NSigmaPrNegTOF)) + continue; + + if (cUseOnlyTOFTrackPion && !hasSubsystemInfo(trk2NSigmaPiPosTOF)) + continue; + if (cUseOnlyTOFTrackPion && !hasSubsystemInfo(trk2NSigmaPiNegTOF)) + continue; + + if (!selectionPIDPionFirst(trk1) || !selectionPIDCascades(trk2)) continue; - // if (!selectionPIDCascades(trk2)) // Can't use TPC, TOF info. for cascades yet!! - // continue; if (!casctopCut(trk2)) continue; @@ -761,34 +736,74 @@ struct xi1530analysisqa { if constexpr (!IsMix) { //// QA plots before the selection - // --- PID QA Pion + // --- PID QA if (PIDplots) { histos.fill(HIST("QAafter/TPC_Nsigma_pi_first_all"), multiplicity, trk1ptPi, trk1NSigmaPiTPC); - if (isTrk1hasTOF) { + + if (hasSubsystemInfo(trk1NSigmaPiTOF)) { histos.fill(HIST("QAafter/TOF_Nsigma_pi_first_all"), multiplicity, trk1ptPi, trk1NSigmaPiTOF); histos.fill(HIST("QAafter/TOF_TPC_Map_pi_first_all"), trk1NSigmaPiTOF, trk1NSigmaPiTPC); } + + if (trk2.sign() < 0) { + histos.fill(HIST("QAafter/TPC_Nsigma_pi_bachelor_all"), multiplicity, 0, trk2NSigmaPiBachelorTPC); // not exist pt information in resocascade yet. + if (hasSubsystemInfo(trk2NSigmaPiBachelorTOF)) { + histos.fill(HIST("QAafter/TOF_TPC_Map_pi_bachelor_all"), trk2NSigmaPiBachelorTOF, trk2NSigmaPiBachelorTPC); + } + + histos.fill(HIST("QAafter/TPC_Nsigma_pr_all"), multiplicity, 0, trk2NSigmaPrPosTPC); + if (hasSubsystemInfo(trk2NSigmaPrPosTOF)) { + histos.fill(HIST("QAafter/TOF_TPC_Map_pr_all"), trk2NSigmaPrPosTOF, trk2NSigmaPrPosTPC); + } + + histos.fill(HIST("QAafter/TPC_Nsigma_piminus_all"), multiplicity, 0, trk2NSigmaPiNegTPC); + if (hasSubsystemInfo(trk2NSigmaPiNegTOF)) { + histos.fill(HIST("QAafter/TOF_TPC_Map_piminus_all"), trk2NSigmaPiNegTOF, trk2NSigmaPiNegTPC); + } + + } else { + + histos.fill(HIST("QAafter/TPC_Nsigma_pi_bachelor_all"), multiplicity, 0, trk2NSigmaPiBachelorTPC); // not exist pt information in resocascade yet. + if (hasSubsystemInfo(trk2NSigmaPiBachelorTOF)) { + histos.fill(HIST("QAafter/TOF_TPC_Map_pi_bachelor_all"), trk2NSigmaPiBachelorTOF, trk2NSigmaPiBachelorTPC); + } + + histos.fill(HIST("QAafter/TPC_Nsigma_antipr_all"), multiplicity, 0, trk2NSigmaPrNegTPC); + if (hasSubsystemInfo(trk2NSigmaPrNegTOF)) { + histos.fill(HIST("QAafter/TOF_TPC_Map_antipr_all"), trk2NSigmaPrNegTOF, trk2NSigmaPrNegTPC); + } + + histos.fill(HIST("QAafter/TPC_Nsigma_pi_all"), multiplicity, 0, trk2NSigmaPiPosTPC); + if (hasSubsystemInfo(trk2NSigmaPiPosTOF)) { + histos.fill(HIST("QAafter/TOF_TPC_Map_pi_all"), trk2NSigmaPiPosTOF, trk2NSigmaPiPosTPC); + } + } } histos.fill(HIST("QAafter/trkpT_pi"), trk1ptPi); histos.fill(HIST("QAafter/trkpT_Xi"), trk2ptXi); + histos.fill(HIST("QAafter/trkDCAxy_pi"), trk1.dcaXY()); histos.fill(HIST("QAafter/trkDCAxy_Xi"), trk2.dcaXYCascToPV()); + histos.fill(HIST("QAafter/trkDCAz_pi"), trk1.dcaZ()); histos.fill(HIST("QAafter/trkDCAz_Xi"), trk2.dcaZCascToPV()); } - lDecayDaughter1.SetPtEtaPhiM(trk1.pt(), trk1.eta(), trk1.phi(), massPi); - lDecayDaughter2.SetPtEtaPhiM(trk2.pt(), trk2.eta(), trk2.phi(), trk2.mXi()); + lDecayDaughter1.SetPtEtaPhiM(trk1ptPi, trk1.eta(), trk1.phi(), massPi); + lDecayDaughter2.SetPtEtaPhiM(trk2ptXi, trk2.eta(), trk2.phi(), trk2.mXi()); lResonance = lDecayDaughter1 + lDecayDaughter2; - if (abs(lResonance.Rapidity()) >= 0.5) + auto lResonancePt = lResonance.Pt(); + auto lResonanceInMass = lResonance.M(); + + if (std::abs(lResonance.Rapidity()) >= 0.5) continue; if (cfgCutsOnMother) { - if (lResonance.Pt() >= cMaxPtMotherCut) // excluding candidates in overflow + if (lResonancePt >= cMaxPtMotherCut) // excluding candidates in overflow continue; - if (lResonance.M() >= cMaxMinvMotherCut) // excluding candidates in overflow + if (lResonanceInMass >= cMaxMinvMotherCut) // excluding candidates in overflow continue; } @@ -798,59 +813,93 @@ struct xi1530analysisqa { if (study_antiparticle) { if (trk1.sign() > 0) { if (invmass1D) - histos.fill(HIST("Xi1530invmassDS"), lResonance.M()); - histos.fill(HIST("h3Xi1530invmassDS"), multiplicity, lResonance.Pt(), lResonance.M(), kData); + histos.fill(HIST("Xi1530invmassDS"), lResonanceInMass); + histos.fill(HIST("h3Xi1530invmassDS"), multiplicity, lResonancePt, lResonanceInMass, kData); } else if (trk1.sign() < 0) { if (invmass1D) - histos.fill(HIST("Xi1530invmassDSAnti"), lResonance.M()); - histos.fill(HIST("h3Xi1530invmassDSAnti"), multiplicity, lResonance.Pt(), lResonance.M(), kData); + histos.fill(HIST("Xi1530invmassDSAnti"), lResonanceInMass); + histos.fill(HIST("h3Xi1530invmassDSAnti"), multiplicity, lResonancePt, lResonanceInMass, kData); } } else { if (invmass1D) - histos.fill(HIST("Xi1530invmassDS"), lResonance.M()); - histos.fill(HIST("h3Xi1530invmassDS"), multiplicity, lResonance.Pt(), lResonance.M(), kData); + histos.fill(HIST("Xi1530invmassDS"), lResonanceInMass); + histos.fill(HIST("h3Xi1530invmassDS"), multiplicity, lResonancePt, lResonanceInMass, kData); } } else { if (invmass1D) - histos.fill(HIST("Xi1530invmassME"), lResonance.M()); + histos.fill(HIST("Xi1530invmassME"), lResonanceInMass); if (trk1.sign() > 0) { if (invmass1D) - histos.fill(HIST("Xi1530invmassME_DS"), lResonance.M()); - histos.fill(HIST("h3Xi1530invmassME_DS"), multiplicity, lResonance.Pt(), lResonance.M(), kMixing); + histos.fill(HIST("Xi1530invmassME_DS"), lResonanceInMass); + histos.fill(HIST("h3Xi1530invmassME_DS"), multiplicity, lResonancePt, lResonanceInMass, kMixing); } else if (trk1.sign() < 0) { if (invmass1D) - histos.fill(HIST("Xi1530invmassME_DSAnti"), lResonance.M()); - histos.fill(HIST("h3Xi1530invmassME_DSAnti"), multiplicity, lResonance.Pt(), lResonance.M(), kMixing); + histos.fill(HIST("Xi1530invmassME_DSAnti"), lResonanceInMass); + histos.fill(HIST("h3Xi1530invmassME_DSAnti"), multiplicity, lResonancePt, lResonanceInMass, kMixing); } - histos.fill(HIST("h3Xi1530invmassME"), multiplicity, lResonance.Pt(), lResonance.M(), kMixing); + histos.fill(HIST("h3Xi1530invmassME"), multiplicity, lResonancePt, lResonanceInMass, kMixing); } if constexpr (IsMC) { - if (abs(trk1.pdgCode()) != 211 || abs(trk2.pdgCode()) != 3312) + if (std::abs(trk2.motherPDG()) != XiStarPID) continue; - if (trk1.motherId() != trk2.motherId()) + if (std::abs(trk1.pdgCode()) != PionPID || std::abs(trk2.pdgCode()) != XiPID) continue; - if (abs(trk2.motherPDG()) != 3324) + if (trk1.motherId() != trk2.motherId()) continue; histos.fill(HIST("QAMCTrue/trkDCAxy_pi"), trk1.dcaXY()); histos.fill(HIST("QAMCTrue/trkDCAxy_xi"), trk2.dcaXYCascToPV()); histos.fill(HIST("QAMCTrue/trkDCAz_pi"), trk1.dcaZ()); histos.fill(HIST("QAMCTrue/trkDCAz_xi"), trk2.dcaZCascToPV()); - histos.fill(HIST("QAMCTrue/TPC_Nsigma_pi_all"), multiplicity, trk1ptPi, trk1NSigmaPiTPC); - if (isTrk1hasTOF) { - histos.fill(HIST("QAMCTrue/TOF_Nsigma_pi_all"), multiplicity, trk1ptPi, trk1NSigmaPiTOF); + histos.fill(HIST("QAMCTrue/TPC_Nsigma_pi_first_all"), multiplicity, trk1ptPi, trk1NSigmaPiTPC); + if (hasSubsystemInfo(trk1NSigmaPiTOF)) { + histos.fill(HIST("QAMCTrue/TOF_Nsigma_pi_first_all"), multiplicity, trk1ptPi, trk1NSigmaPiTOF); + histos.fill(HIST("QAMCTrue/TOF_TPC_Map_pi_first_all"), trk1NSigmaPiTOF, trk1NSigmaPiTPC); } + if (trk2.sign() < 0) { + histos.fill(HIST("QAafter/TPC_Nsigma_pi_bachelor_all"), multiplicity, 0, trk2NSigmaPiBachelorTPC); // not exist pt information in resocascade yet. + if (hasSubsystemInfo(trk2NSigmaPiBachelorTOF)) { + histos.fill(HIST("QAafter/TOF_TPC_Map_pi_bachelor_all"), trk2NSigmaPiBachelorTOF, trk2NSigmaPiBachelorTPC); + } + + histos.fill(HIST("QAafter/TPC_Nsigma_pr_all"), multiplicity, 0, trk2NSigmaPrPosTPC); + if (hasSubsystemInfo(trk2NSigmaPrPosTOF)) { + histos.fill(HIST("QAafter/TOF_TPC_Map_pr_all"), trk2NSigmaPrPosTOF, trk2NSigmaPrPosTPC); + } + + histos.fill(HIST("QAafter/TPC_Nsigma_piminus_all"), multiplicity, 0, trk2NSigmaPiNegTPC); + if (hasSubsystemInfo(trk2NSigmaPiNegTOF)) { + histos.fill(HIST("QAafter/TOF_TPC_Map_piminus_all"), trk2NSigmaPiNegTOF, trk2NSigmaPiNegTPC); + } + + } else { + + histos.fill(HIST("QAafter/TPC_Nsigma_pi_bachelor_all"), multiplicity, 0, trk2NSigmaPiBachelorTPC); // not exist pt information in resocascade yet. + if (hasSubsystemInfo(trk2NSigmaPiBachelorTOF)) { + histos.fill(HIST("QAafter/TOF_TPC_Map_pi_bachelor_all"), trk2NSigmaPiBachelorTOF, trk2NSigmaPiBachelorTPC); + } + + histos.fill(HIST("QAafter/TPC_Nsigma_antipr_all"), multiplicity, 0, trk2NSigmaPrNegTPC); + if (hasSubsystemInfo(trk2NSigmaPrNegTOF)) { + histos.fill(HIST("QAafter/TOF_TPC_Map_antipr_all"), trk2NSigmaPrNegTOF, trk2NSigmaPrNegTPC); + } + + histos.fill(HIST("QAafter/TPC_Nsigma_pi_all"), multiplicity, 0, trk2NSigmaPiPosTPC); + if (hasSubsystemInfo(trk2NSigmaPiPosTOF)) { + histos.fill(HIST("QAafter/TOF_TPC_Map_pi_all"), trk2NSigmaPiPosTOF, trk2NSigmaPiPosTPC); + } + } // MC histograms if (trk2.motherPDG() > 0) { - histos.fill(HIST("Xi1530Rec"), lResonance.Pt(), multiplicity); - histos.fill(HIST("Xi1530Recinvmass"), lResonance.M()); - histos.fill(HIST("h3RecXi1530invmass"), multiplicity, lResonance.Pt(), lResonance.M(), kMCReco); + histos.fill(HIST("Xi1530Rec"), lResonancePt, multiplicity); + histos.fill(HIST("Xi1530Recinvmass"), lResonanceInMass); + histos.fill(HIST("h3RecXi1530invmass"), multiplicity, lResonancePt, lResonanceInMass, kMCReco); } else { - histos.fill(HIST("Xi1530RecAnti"), lResonance.Pt(), multiplicity); - histos.fill(HIST("Xi1530Recinvmass"), lResonance.M()); - histos.fill(HIST("h3RecXi1530invmassAnti"), multiplicity, lResonance.Pt(), lResonance.M(), kMCReco); + histos.fill(HIST("Xi1530RecAnti"), lResonancePt, multiplicity); + histos.fill(HIST("Xi1530Recinvmass"), lResonanceInMass); + histos.fill(HIST("h3RecXi1530invmassAnti"), multiplicity, lResonancePt, lResonanceInMass, kMCReco); } } @@ -859,17 +908,17 @@ struct xi1530analysisqa { if (study_antiparticle) { if (trk1.sign() < 0) { if (invmass1D) - histos.fill(HIST("Xi1530invmassLS"), lResonance.M()); - histos.fill(HIST("h3Xi1530invmassLS"), multiplicity, lResonance.Pt(), lResonance.M(), kLS); + histos.fill(HIST("Xi1530invmassLS"), lResonanceInMass); + histos.fill(HIST("h3Xi1530invmassLS"), multiplicity, lResonancePt, lResonanceInMass, kLS); } else if (trk1.sign() > 0) { if (invmass1D) - histos.fill(HIST("Xi1530invmassLSAnti"), lResonance.M()); - histos.fill(HIST("h3Xi1530invmassLSAnti"), multiplicity, lResonance.Pt(), lResonance.M(), kLS); + histos.fill(HIST("Xi1530invmassLSAnti"), lResonanceInMass); + histos.fill(HIST("h3Xi1530invmassLSAnti"), multiplicity, lResonancePt, lResonanceInMass, kLS); } } else { if (invmass1D) - histos.fill(HIST("Xi1530invmassLS"), lResonance.M()); - histos.fill(HIST("h3Xi1530invmassLS"), multiplicity, lResonance.Pt(), lResonance.M(), kLS); + histos.fill(HIST("Xi1530invmassLS"), lResonanceInMass); + histos.fill(HIST("h3Xi1530invmassLS"), multiplicity, lResonancePt, lResonanceInMass, kLS); } } } @@ -887,7 +936,7 @@ struct xi1530analysisqa { soa::Join const& cascTracks, soa::Join const& resoTracks) { - if (!resoCollision.isInAfterAllCuts() || (abs(resoCollision.posZ()) > cZvertCutMC)) // MC event selection, all cuts missing vtx cut + if (!resoCollision.isInAfterAllCuts() || (std::abs(resoCollision.posZ()) > cZvertCutMC)) // MC event selection, all cuts missing vtx cut return; fillHistograms(resoCollision, resoTracks, cascTracks); } @@ -896,10 +945,10 @@ struct xi1530analysisqa { { auto multiplicity = resoCollision.cent(); for (auto& part : resoParents) { // loop over all pre-filtered MC particles - if (abs(part.pdgCode()) != 3324 || abs(part.y()) >= 0.5) + if (std::abs(part.pdgCode()) != XiStarPID || std::abs(part.y()) >= 0.5) continue; - bool pass1 = abs(part.daughterPDG1()) == 211 || abs(part.daughterPDG2()) == 211; - bool pass2 = abs(part.daughterPDG1()) == 3312 || abs(part.daughterPDG2()) == 3312; + bool pass1 = std::abs(part.daughterPDG1()) == PionPID || std::abs(part.daughterPDG2()) == PionPID; + bool pass2 = std::abs(part.daughterPDG1()) == XiPID || std::abs(part.daughterPDG2()) == XiPID; if (!pass1 || !pass2) continue; @@ -955,6 +1004,7 @@ struct xi1530analysisqa { PROCESS_SWITCH(xi1530analysisqa, processMCTrue, "Process Event for MC (Generated)", true); PROCESS_SWITCH(xi1530analysisqa, processME, "Process EventMixing light without partition", true); }; + WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; From c3a25e1394283f30a851b5d61f3a9e02a2bc9a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Sun, 24 Nov 2024 14:11:00 +0100 Subject: [PATCH 063/459] [PWGHF] add the v1 for D0 (#8582) --- .../Tasks/taskDirectedFlowCharmHadrons.cxx | 58 ++++++++++++++++++- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index 5d52470a6b0..a81e6acde41 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -13,6 +13,7 @@ /// \brief Analysis task for charm hadron directed flow /// /// \author Prottay Das, prottay.das@cern.ch +/// \author Biao Zhang, biao.zhanng@cern.ch #include #include @@ -40,7 +41,9 @@ using namespace o2::framework::expressions; using namespace o2::hf_centrality; using namespace o2::hf_evsel; -enum DecayChannel { DplusToPiKPi = 0 }; +enum DecayChannel { DplusToPiKPi = 0, + D0ToPiK, + D0ToKPi }; struct HfTaskDirectedFlowCharmHadrons { Configurable centEstimator{"centEstimator", 2, "Centrality estimation (FT0A: 1, FT0C: 2, FT0M: 3, FV0A: 4)"}; @@ -63,10 +66,18 @@ struct HfTaskDirectedFlowCharmHadrons { using CandDplusDataWMl = soa::Filtered>; using CandDplusData = soa::Filtered>; + using CandD0DataWMl = soa::Filtered>; + using CandD0Data = soa::Filtered>; using CollsWithQvecs = soa::Join; using TracksWithExtra = soa::Join; Filter filterSelectDplusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlag; + Filter filterSelectD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlag || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlag; + + Partition selectedD0ToPiK = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlag; + Partition selectedD0ToKPi = aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlag; + Partition selectedD0ToPiKWMl = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlag; + Partition selectedD0ToKPiWMl = aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlag; SliceCache cache; HfHelper hfHelper; @@ -80,7 +91,7 @@ struct HfTaskDirectedFlowCharmHadrons { { /// check process functions - std::array processes = {doprocessDplusStd, doprocessDplusMl}; + std::array processes = {doprocessDplusStd, doprocessDplusMl, doprocessD0Std, doprocessD0Ml}; const int nProcesses = std::accumulate(processes.begin(), processes.end(), 0); if (nProcesses > 1) { LOGP(fatal, "Only one process function should be enabled at a time, please check your configuration"); @@ -197,10 +208,29 @@ struct HfTaskDirectedFlowCharmHadrons { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)]; } + } else if constexpr (std::is_same_v || std::is_same_v) { + switch (channel) { + case DecayChannel::D0ToPiK: + massCand = hfHelper.invMassD0ToPiK(candidate); + if constexpr (std::is_same_v) { + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + outputMl[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; + } + break; + case DecayChannel::D0ToKPi: + massCand = hfHelper.invMassD0barToKPi(candidate); + if constexpr (std::is_same_v) { + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + outputMl[iclass] = candidate.mlProbD0bar()[classMl->at(iclass)]; + } + break; + default: + break; + } } auto trackprong0 = candidate.template prong0_as(); - double sign = trackprong0.sign(); // to differentiate between D+ and D- + double sign = trackprong0.sign(); // electric charge of the first daughter track to differentiate particle and antiparticle double ptCand = candidate.pt(); double etaCand = candidate.eta(); @@ -246,6 +276,28 @@ struct HfTaskDirectedFlowCharmHadrons { } } } + // D0 with ML + void processD0Ml(CollsWithQvecs::iterator const& collision, + TracksWithExtra const& tracks) + { + auto candsD0ToPiKWMl = selectedD0ToPiKWMl->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + auto candsD0ToKPiWMl = selectedD0ToKPiWMl->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + runFlowAnalysis(collision, candsD0ToPiKWMl, tracks); + runFlowAnalysis(collision, candsD0ToKPiWMl, tracks); + } + PROCESS_SWITCH(HfTaskDirectedFlowCharmHadrons, processD0Ml, "Process D0 candidates with ML", false); + + // D0 with rectangular cuts + void processD0Std(CollsWithQvecs::iterator const& collision, + TracksWithExtra const& tracks) + { + auto candsD0ToPiK = selectedD0ToPiK->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + auto candsD0ToKPi = selectedD0ToKPi->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + runFlowAnalysis(collision, candsD0ToPiK, tracks); + runFlowAnalysis(collision, candsD0ToKPi, tracks); + } + PROCESS_SWITCH(HfTaskDirectedFlowCharmHadrons, processD0Std, "Process D0 candidates with rectangular cuts", false); + // Dplus with ML void processDplusMl(CollsWithQvecs::iterator const& collision, CandDplusDataWMl const& candidatesDplus, From 6572e46f9a617213c6b0a239253ad97b5a70bcf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Sun, 24 Nov 2024 15:45:43 +0100 Subject: [PATCH 064/459] [DPG] Add contributor cuts (#8594) --- DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx | 29 ++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx index 8c1aeca6483..d1420da31fc 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx @@ -137,6 +137,8 @@ struct tofPidQa { Configurable splitSignalPerCharge{"splitSignalPerCharge", true, "Split the signal per charge (reduces memory footprint if off)"}; Configurable enableVsMomentumHistograms{"enableVsMomentumHistograms", false, "Enables plots vs momentum instead of just pT (reduces memory footprint if off)"}; Configurable requireGoodMatchTracks{"requireGoodMatchTracks", false, "Require good match tracks"}; + Configurable pvContributorsMin{"pvContributorsMin", -10, "Minimum pvContributors"}; + Configurable pvContributorsMax{"pvContributorsMax", 10000, "Maximum pvContributors"}; template void initPerParticle(const AxisSpec& pAxis, @@ -282,6 +284,8 @@ struct tofPidQa { h->GetXaxis()->SetBinLabel(1, "Events read"); h->GetXaxis()->SetBinLabel(2, "Passed ev. sel."); h->GetXaxis()->SetBinLabel(3, "Passed vtx Z"); + h->GetXaxis()->SetBinLabel(4, Form("Passed pvContributorsMin %f", pvContributorsMin.value)); + h->GetXaxis()->SetBinLabel(5, Form("Passed pvContributorsMax %f", pvContributorsMax.value)); h = histos.add("event/trackselection", "", kTH1D, {{10, 0.5, 10.5, "Selection passed"}}); h->GetXaxis()->SetBinLabel(1, "Tracks read"); @@ -375,11 +379,30 @@ struct tofPidQa { } } } - if (abs(collision.posZ()) > 10.f) { + if (std::abs(collision.posZ()) > 10.f) { return false; } + // Count the number of contributors + int pvContributors = 0; + for (const auto& trk : tracks) { + if (trk.isPVContributor()) { + pvContributors++; + } + } + if (pvContributors < pvContributorsMin) { + return false; + } + if constexpr (fillHistograms) { + histos.fill(HIST("event/evsel"), 4); + } + if (pvContributors > pvContributorsMax) { + return false; + } + if constexpr (fillHistograms) { + histos.fill(HIST("event/evsel"), 5); + } if constexpr (fillHistograms) { - histos.fill(HIST("event/evsel"), 3); + histos.fill(HIST("event/evsel"), 6); histos.fill(HIST("event/vertexz"), collision.posZ()); histos.fill(HIST("event/evtime/colltime"), collision.collisionTime() * 1000.f); @@ -505,7 +528,7 @@ struct tofPidQa { } if (applyRapidityCut) { - if (abs(t.rapidity(PID::getMass(id))) > 0.5) { + if (std::abs(t.rapidity(PID::getMass(id))) > 0.5) { continue; } } From 3ae2361a3a6e711e430c4637578a2f80ca5dd809 Mon Sep 17 00:00:00 2001 From: Ida Storehaug <38440296+torkjellsdatter@users.noreply.github.com> Date: Sun, 24 Nov 2024 17:26:20 +0100 Subject: [PATCH 065/459] [PWGDQ] [PWGDQ-120] dqEfficiency_withAssoc.cxx: added mcDecision to table of B meson candidates (#8595) Co-authored-by: Ida Torkjellsdatter Storehaug --- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 82f7d64569b..018d72f3c7c 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -76,6 +76,7 @@ DECLARE_SOA_COLUMN(TauxyBcandidate, tauxyBcandidate, float); DECLARE_SOA_COLUMN(TauzBcandidate, tauzBcandidate, float); DECLARE_SOA_COLUMN(CosPBcandidate, cosPBcandidate, float); DECLARE_SOA_COLUMN(Chi2Bcandidate, chi2Bcandidate, float); +DECLARE_SOA_COLUMN(McFlag, mcFlag, int8_t); } // namespace dqanalysisflags DECLARE_SOA_TABLE(EventCuts, "AOD", "DQANAEVCUTS", dqanalysisflags::IsEventSelected); //! joinable to ReducedEvents @@ -84,7 +85,7 @@ DECLARE_SOA_TABLE(BarrelAmbiguities, "AOD", "DQBARRELAMB", dqanalysisflags::Barr DECLARE_SOA_TABLE(MuonTrackCuts, "AOD", "DQANAMUONCUTS", dqanalysisflags::IsMuonSelected); //! joinable to ReducedMuonsAssoc DECLARE_SOA_TABLE(MuonAmbiguities, "AOD", "DQMUONAMB", dqanalysisflags::MuonAmbiguityInBunch, dqanalysisflags::MuonAmbiguityOutOfBunch); //! joinable to ReducedMuonTracks DECLARE_SOA_TABLE(Prefilter, "AOD", "DQPREFILTER", dqanalysisflags::IsBarrelSelectedPrefilter); //! joinable to ReducedTracksAssoc -DECLARE_SOA_TABLE(BmesonCandidates, "AOD", "DQBMESONS", dqanalysisflags::massBcandidate, dqanalysisflags::pTBcandidate, dqanalysisflags::LxyBcandidate, dqanalysisflags::LxyzBcandidate, dqanalysisflags::LzBcandidate, dqanalysisflags::TauxyBcandidate, dqanalysisflags::TauzBcandidate, dqanalysisflags::CosPBcandidate, dqanalysisflags::Chi2Bcandidate); +DECLARE_SOA_TABLE(BmesonCandidates, "AOD", "DQBMESONS", dqanalysisflags::massBcandidate, dqanalysisflags::pTBcandidate, dqanalysisflags::LxyBcandidate, dqanalysisflags::LxyzBcandidate, dqanalysisflags::LzBcandidate, dqanalysisflags::TauxyBcandidate, dqanalysisflags::TauzBcandidate, dqanalysisflags::CosPBcandidate, dqanalysisflags::Chi2Bcandidate, dqanalysisflags::McFlag); } // namespace o2::aod // Declarations of various short names @@ -2123,7 +2124,7 @@ struct AnalysisDileptonTrack { } } // table to be written out for ML analysis - BmesonsTable(fValuesHadron[VarManager::kPairMass], fValuesHadron[VarManager::kPairPt], fValuesHadron[VarManager::kVertexingLxy], fValuesHadron[VarManager::kVertexingLxyz], fValuesHadron[VarManager::kVertexingLz], fValuesHadron[VarManager::kVertexingTauxy], fValuesHadron[VarManager::kVertexingTauz], fValuesHadron[VarManager::kCosPointingAngle], fValuesHadron[VarManager::kVertexingChi2PCA]); + BmesonsTable(fValuesHadron[VarManager::kPairMass], fValuesHadron[VarManager::kPairPt], fValuesHadron[VarManager::kVertexingLxy], fValuesHadron[VarManager::kVertexingLxyz], fValuesHadron[VarManager::kVertexingLz], fValuesHadron[VarManager::kVertexingTauxy], fValuesHadron[VarManager::kVertexingTauz], fValuesHadron[VarManager::kCosPointingAngle], fValuesHadron[VarManager::kVertexingChi2PCA], mcDecision); } } // end loop over dileptons } From 7e0408bf62626867131d852db27e360eb5146616 Mon Sep 17 00:00:00 2001 From: ldellost <47105254+DelloStritto@users.noreply.github.com> Date: Sun, 24 Nov 2024 19:07:57 +0100 Subject: [PATCH 066/459] [PWGHF,PWGJE] Add MC T0M centrality to the Lc derived data (#8596) Co-authored-by: Luigi Dello Stritto Co-authored-by: ALICE Action Bot --- PWGHF/DataModel/DerivedTables.h | 3 +++ PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx | 7 +++++-- PWGJE/Core/JetHFUtilities.h | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 88f570b47c0..441d412ea2f 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -23,6 +23,8 @@ #include "Common/Core/RecoDecay.h" +#include "PWGLF/DataModel/mcCentrality.h" + #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -194,6 +196,7 @@ DECLARE_SOA_TABLE_STAGED(Hf3PMcCollBases, "HF3PMCCOLLBASE", //! Table with basic mccollision::PosX, mccollision::PosY, mccollision::PosZ, + cent::CentFT0M, o2::soa::Marker); using Hf3PMcCollBase = Hf3PMcCollBases::iterator; diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 5827f26a1aa..e16c498cd11 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -27,6 +27,8 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/Multiplicity.h" +#include "PWGLF/DataModel/mcCentrality.h" + #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -91,7 +93,7 @@ struct HfDerivedDataCreatorLcToPKPi { using SelectedCandidatesMl = soa::Filtered>; using SelectedCandidatesMcMl = soa::Filtered>; using MatchedGenCandidatesMc = soa::Filtered>; - using TypeMcCollisions = aod::McCollisions; + using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 1 || aod::hf_sel_candidate_lc::isSelLcToPiKP >= 1; Filter filterMcGenMatching = nabs(aod::hf_cand_3prong::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi)); @@ -159,7 +161,8 @@ struct HfDerivedDataCreatorLcToPKPi { rowMcCollBase( mcCollision.posX(), mcCollision.posY(), - mcCollision.posZ()); + mcCollision.posZ(), + mcCollision.centFT0M()); } if (fillMcCollId) { rowMcCollId( diff --git a/PWGJE/Core/JetHFUtilities.h b/PWGJE/Core/JetHFUtilities.h index 39ce84a879f..d76c8d19121 100644 --- a/PWGJE/Core/JetHFUtilities.h +++ b/PWGJE/Core/JetHFUtilities.h @@ -549,7 +549,7 @@ void fillD0McCollisionTable(T const& mcCollision, U& D0McCollisionTable, int32_t template void fillLcMcCollisionTable(T const& mcCollision, U& LcMcCollisionTable, int32_t& LcMcCollisionTableIndex) { - LcMcCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()); + LcMcCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.centFT0M()); LcMcCollisionTableIndex = LcMcCollisionTable.lastIndex(); } From 798029431a933eb20313674a9a45bef2fb8ab762 Mon Sep 17 00:00:00 2001 From: Chiara Pinto <48326672+chiarapinto@users.noreply.github.com> Date: Sun, 24 Nov 2024 20:51:33 +0100 Subject: [PATCH 067/459] [PWGLF] Add QC histo for event selection (#8592) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx b/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx index 7d3659419de..ab26df26ea1 100644 --- a/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx +++ b/PWGLF/Tasks/Nuspex/nuclei_in_jets.cxx @@ -154,6 +154,7 @@ struct nuclei_in_jets { registryQC.add("sumPtUE", "sumPtUE", HistType::kTH1F, {{500, 0, 50, "#it{p}_{T} (GeV/#it{c})"}}); registryQC.add("nJets_found", "nJets_found", HistType::kTH1F, {{10, 0, 10, "#it{n}_{Jet}"}}); registryQC.add("nJets_selected", "nJets_selected", HistType::kTH1F, {{10, 0, 10, "#it{n}_{Jet}"}}); + registryQC.add("event_selection_jets", "event_selection_jets", HistType::kTH1F, {{10, 0, 10, "counter"}}); registryQC.add("dcaxy_vs_pt", "dcaxy_vs_pt", HistType::kTH2F, {{100, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}, {2000, -0.05, 0.05, "DCA_{xy} (cm)"}}); registryQC.add("dcaz_vs_pt", "dcaz_vs_pt", HistType::kTH2F, {{100, 0.0, 5.0, "#it{p}_{T} (GeV/#it{c})"}, {2000, -0.05, 0.05, "DCA_{z} (cm)"}}); registryQC.add("jet_ue_overlaps", "jet_ue_overlaps", HistType::kTH2F, {{20, 0.0, 20.0, "#it{n}_{jet}"}, {200, 0.0, 200.0, "#it{n}_{overlaps}"}}); @@ -440,6 +441,7 @@ struct nuclei_in_jets { { // Event Counter: before event selection registryData.fill(HIST("number_of_events_data"), 0.5); + registryQC.fill(HIST("event_selection_jets"), 0.5); // all events before jet selection // Event Selection if (!collision.sel8()) @@ -591,8 +593,27 @@ struct nuclei_in_jets { if (n_jets_selected == 0) return; registryData.fill(HIST("number_of_events_data"), 3.5); + registryQC.fill(HIST("event_selection_jets"), 1.5); // events with pTjet>10 GeV/c selected //************************************************************************************************************************************ + // Leading Track + double pt_max(0); + + // Loop over Reconstructed Tracks + for (auto const& track : tracks) { + + if (!passedTrackSelectionForJetReconstruction(track)) + continue; + + if (track.pt() > pt_max) { + pt_max = track.pt(); + } + } + // Event Counter: Skip Events with pt 5 GeV/c selected + // Overlaps int nOverlaps(0); for (int i = 0; i < static_cast(jet.size()); i++) { From 4af00b2bae6232633d7024d632d488eb16b6c5e8 Mon Sep 17 00:00:00 2001 From: JStaa <39123272+JStaa@users.noreply.github.com> Date: Sun, 24 Nov 2024 22:35:54 +0100 Subject: [PATCH 068/459] [PWGCF] Added a procedure for calculating the PID purity in MC (#8598) Co-authored-by: ALICE Action Bot --- .../Tasks/ThreeParticleCorrelations.cxx | 69 ++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/PWGCF/MultiparticleCorrelations/Tasks/ThreeParticleCorrelations.cxx b/PWGCF/MultiparticleCorrelations/Tasks/ThreeParticleCorrelations.cxx index 375f5917eba..fdb4ff9dcca 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/ThreeParticleCorrelations.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/ThreeParticleCorrelations.cxx @@ -65,7 +65,9 @@ struct ThreePartCorr { using MyFilteredMCGenCollision = soa::Filtered::iterator; using MyFilteredMCParticles = soa::Filtered; using MyFilteredMCRecCollision = soa::Filtered>::iterator; - using MyFilteredMCTracks = soa::Filtered>; + using MyFilteredMCTracks = soa::Filtered>; // Mixed-events binning policy SliceCache cache; @@ -100,6 +102,7 @@ struct ThreePartCorr { void init(InitContext const&) { + // Histograms axes const AxisSpec CentralityAxis{ConfCentBins}; const AxisSpec ZvtxAxis{ConfZvtxBins}; const AxisSpec PhiAxis{36, (-1. / 2) * M_PI, (3. / 2) * M_PI}; @@ -108,6 +111,7 @@ struct ThreePartCorr { const AxisSpec TrackPtAxis{28, 0.2, 3}; const AxisSpec LambdaInvMassAxis{100, 1.08, 1.16}; + // QA & PID QARegistry.add("hTrackPt", "hTrackPt", {HistType::kTH1D, {{100, 0, 4}}}); QARegistry.add("hTrackEta", "hTrackEta", {HistType::kTH1D, {{100, -1, 1}}}); QARegistry.add("hTrackPhi", "hTrackPhi", {HistType::kTH1D, {{100, (-1. / 2) * M_PI, (5. / 2) * M_PI}}}); @@ -129,12 +133,15 @@ struct ThreePartCorr { QARegistry.add("hInvMassLambda", "hInvMassLambda", {HistType::kTH3D, {{LambdaInvMassAxis}, {V0PtAxis}, {CentralityAxis}}}); QARegistry.add("hInvMassAntiLambda", "hInvMassAntiLambda", {HistType::kTH3D, {{LambdaInvMassAxis}, {V0PtAxis}, {CentralityAxis}}}); + // Efficiency + MCRegistry.add("hGenerated", "hGenerated", {HistType::kTH1D, {TrackPtAxis}}); MCRegistry.add("hGenPionP", "hGenPionP", {HistType::kTH1D, {TrackPtAxis}}); MCRegistry.add("hGenPionN", "hGenPionN", {HistType::kTH1D, {TrackPtAxis}}); MCRegistry.add("hGenKaonP", "hGenKaonP", {HistType::kTH1D, {TrackPtAxis}}); MCRegistry.add("hGenKaonN", "hGenKaonN", {HistType::kTH1D, {TrackPtAxis}}); MCRegistry.add("hGenProtonP", "hGenProtonP", {HistType::kTH1D, {TrackPtAxis}}); MCRegistry.add("hGenProtonN", "hGenProtonN", {HistType::kTH1D, {TrackPtAxis}}); + MCRegistry.add("hReconstructed", "hReconstructed", {HistType::kTH1D, {TrackPtAxis}}); MCRegistry.add("hRecPionP", "hRecPionP", {HistType::kTH1D, {TrackPtAxis}}); MCRegistry.add("hRecPionN", "hRecPionN", {HistType::kTH1D, {TrackPtAxis}}); MCRegistry.add("hRecKaonP", "hRecKaonP", {HistType::kTH1D, {TrackPtAxis}}); @@ -142,6 +149,21 @@ struct ThreePartCorr { MCRegistry.add("hRecProtonP", "hRecProtonP", {HistType::kTH1D, {TrackPtAxis}}); MCRegistry.add("hRecProtonN", "hRecProtonN", {HistType::kTH1D, {TrackPtAxis}}); + // Purity + MCRegistry.add("hSelectPionP", "hSelectPionP", {HistType::kTH1D, {TrackPtAxis}}); + MCRegistry.add("hSelectPionN", "hSelectPionN", {HistType::kTH1D, {TrackPtAxis}}); + MCRegistry.add("hSelectKaonP", "hSelectKaonP", {HistType::kTH1D, {TrackPtAxis}}); + MCRegistry.add("hSelectKaonN", "hSelectKaonN", {HistType::kTH1D, {TrackPtAxis}}); + MCRegistry.add("hSelectProtonP", "hSelectProtonP", {HistType::kTH1D, {TrackPtAxis}}); + MCRegistry.add("hSelectProtonN", "hSelectProtonN", {HistType::kTH1D, {TrackPtAxis}}); + MCRegistry.add("hTrueSelectPionP", "hTrueSelectPionP", {HistType::kTH1D, {TrackPtAxis}}); + MCRegistry.add("hTrueSelectPionN", "hTrueSelectPionN", {HistType::kTH1D, {TrackPtAxis}}); + MCRegistry.add("hTrueSelectKaonP", "hTrueSelectKaonP", {HistType::kTH1D, {TrackPtAxis}}); + MCRegistry.add("hTrueSelectKaonN", "hTrueSelectKaonN", {HistType::kTH1D, {TrackPtAxis}}); + MCRegistry.add("hTrueSelectProtonP", "hTrueSelectProtonP", {HistType::kTH1D, {TrackPtAxis}}); + MCRegistry.add("hTrueSelectProtonN", "hTrueSelectProtonN", {HistType::kTH1D, {TrackPtAxis}}); + + // Correlations SECorrRegistry.add("hSameLambdaPion_SGNL", "Same-event #Lambda - #pi correlator (SGNL region)", {HistType::kTHnSparseD, {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2, -2, 2}, {2, -2, 2}}}); SECorrRegistry.add("hSameLambdaPion_SB", "Same-event #Lambda - #pi correlator (SB region)", {HistType::kTHnSparseD, {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2, -2, 2}, {2, -2, 2}}}); SECorrRegistry.add("hSameLambdaKaon_SGNL", "Same-event #Lambda - K correlator (SGNL region)", {HistType::kTHnSparseD, {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2, -2, 2}, {2, -2, 2}}}); @@ -298,6 +320,8 @@ struct ThreePartCorr { for (const auto& particle : particles) { if (particle.isPhysicalPrimary()) { + // Efficiency - Generated + MCRegistry.fill(HIST("hGenerated"), particle.pt()); if (particle.pdgCode() == kPiPlus) { // Pos pions MCRegistry.fill(HIST("hGenPionP"), particle.pt()); } else if (particle.pdgCode() == kPiMinus) { // Neg pions @@ -332,6 +356,8 @@ struct ThreePartCorr { auto particle = track.mcParticle(); if (particle.isPhysicalPrimary()) { + // Efficiency - Reconstructed + MCRegistry.fill(HIST("hReconstructed"), track.pt()); if (particle.pdgCode() == kPiPlus) { // Pos pions MCRegistry.fill(HIST("hRecPionP"), track.pt()); } else if (particle.pdgCode() == kPiMinus) { // Neg pions @@ -345,6 +371,47 @@ struct ThreePartCorr { } else if (particle.pdgCode() == kProtonBar) { // Neg protons MCRegistry.fill(HIST("hRecProtonN"), track.pt()); } + + // Purity + A_PID = TrackPID(track); + if (A_PID[1] < 4.0) { + + if (track.sign() > 0) { // Positive tracks + if (A_PID[0] == 0.0) { // Pions + MCRegistry.fill(HIST("hSelectPionP"), track.pt()); + if (particle.pdgCode() == kPiPlus) { + MCRegistry.fill(HIST("hTrueSelectPionP"), track.pt()); + } + } else if (A_PID[0] == 1.0) { // Kaons + MCRegistry.fill(HIST("hSelectKaonP"), track.pt()); + if (particle.pdgCode() == kKPlus) { + MCRegistry.fill(HIST("hTrueSelectKaonP"), track.pt()); + } + } else if (A_PID[0] == 2.0) { // Protons + MCRegistry.fill(HIST("hSelectProtonP"), track.pt()); + if (particle.pdgCode() == kProton) { + MCRegistry.fill(HIST("hTrueSelectProtonP"), track.pt()); + } + } + } else if (track.sign() < 0) { // Negative tracks + if (A_PID[0] == 0.0) { // Pions + MCRegistry.fill(HIST("hSelectPionN"), track.pt()); + if (particle.pdgCode() == kPiMinus) { + MCRegistry.fill(HIST("hTrueSelectPionN"), track.pt()); + } + } else if (A_PID[0] == 1.0) { // Kaons + MCRegistry.fill(HIST("hSelectKaonN"), track.pt()); + if (particle.pdgCode() == kKMinus) { + MCRegistry.fill(HIST("hTrueSelectKaonN"), track.pt()); + } + } else if (A_PID[0] == 2.0) { // Protons + MCRegistry.fill(HIST("hSelectProtonN"), track.pt()); + if (particle.pdgCode() == kProtonBar) { + MCRegistry.fill(HIST("hTrueSelectProtonN"), track.pt()); + } + } + } + } } } // End of the Monte-Carlo reconstructed QA From 0740e0ba98b752c3374d01f197745b98caaaf032 Mon Sep 17 00:00:00 2001 From: YubiaoWang Date: Mon, 25 Nov 2024 10:27:08 +0800 Subject: [PATCH 069/459] [PWGJE] fix charged jet v2 in-plane and out-of-plane filling issue (#8604) --- PWGJE/Tasks/jetchargedv2.cxx | 231 +++++++++++++++++------------------ 1 file changed, 114 insertions(+), 117 deletions(-) diff --git a/PWGJE/Tasks/jetchargedv2.cxx b/PWGJE/Tasks/jetchargedv2.cxx index 01184740f28..1268efb425b 100644 --- a/PWGJE/Tasks/jetchargedv2.cxx +++ b/PWGJE/Tasks/jetchargedv2.cxx @@ -200,19 +200,22 @@ struct Jetchargedv2Task { trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast(trackSelections)); //< \sigma p_T at local rho test plot > - registry.add("h_ptsum_collnum", "jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{40, 0.0, 40}}}); - registry.add("h_ptsum_sumpt", "jet #varphi;#varphi_{jet};entries", {HistType::kTH1F, {{160, 0., TMath::TwoPi()}}}); - registry.add("h2_phi_track_eta", "phi vs track eta; #varphi; #eta (GeV/#it{c})", {HistType::kTH2F, {{100, -1.0, 1.0}, {160, 0., TMath::TwoPi()}}}); - registry.add("h2_phi_track_pt", "phi vs track pT; #varphi; #it{p}_{T,track} (GeV/#it{c})", {HistType::kTH2F, {{200, 0., 200.}, {160, 0., TMath::TwoPi()}}}); - registry.add("h2_centrality_phi_w_pt", "centrality vs jet #varphi; #varphi_{jet}; entries", {HistType::kTH2F, {{100, 0.0, 100.0}, {160, 0., TMath::TwoPi()}}}); + registry.add("h_ptsum_collnum", "ptsum collnum;collnum;entries", {HistType::kTH1F, {{40, 0.0, 40}}}); + registry.add("h_ptsum_sumpt", "jet sumpt;sum p_{T};entries", {HistType::kTH1F, {{160, 0., TMath::TwoPi()}}}); + registry.add("h2_phi_track_eta", "phi vs track eta; #eta (GeV/#it{c}); #varphi", {HistType::kTH2F, {{100, -1.0, 1.0}, {160, 0., TMath::TwoPi()}}}); + registry.add("h2_phi_track_pt", "phi vs track pT; #it{p}_{T,track} (GeV/#it{c}); #varphi", {HistType::kTH2F, {{200, 0., 200.}, {160, 0., TMath::TwoPi()}}}); + registry.add("h2_centrality_phi_w_pt", "centrality vs jet #varphi; centrality; entries", {HistType::kTH2F, {{100, 0.0, 100.0}, {160, 0., TMath::TwoPi()}}}); registry.add("h2_evtnum_phi_w_pt", "eventNumber vs jet #varphi; #eventNumber; entries", {HistType::kTH2F, {{100000, 0.0, 100000}, {160, 0., TMath::TwoPi()}}}); //< \sigma p_T at local rho test plot | end > + registry.add("h2_centrality_collisions", "centrality vs collisions; centrality; collisions", {HistType::kTH2F, {{1200, -10.0, 110.0}, {4, 0.0, 4.0}}}); registry.add("h2_centrality_track_pt", "centrality vs track pT; centrality; #it{p}_{T,track} (GeV/#it{c})", {HistType::kTH2F, {{1200, -10.0, 110.0}, {200, 0., 200.}}}); registry.add("h2_centrality_track_eta", "centrality vs track #eta; centrality; #eta_{track}", {HistType::kTH2F, {{1200, -10.0, 110.0}, {100, -1.0, 1.0}}}); registry.add("h2_centrality_track_phi", "centrality vs track #varphi; centrality; #varphi_{track}", {HistType::kTH2F, {{1200, -10.0, 110.0}, {160, -1.0, 7.}}}); + registry.add("h_jet_pt_rhoareasubtracted", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); + registry.add("h_recoil_jet_pt", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_recoil_jet_eta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); registry.add("h_recoil_jet_phi", "jet #phi;#phi_{jet};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); @@ -227,6 +230,7 @@ struct Jetchargedv2Task { registry.add("h3_centrality_RCpt_RandomCornPhi_rhorandomconewithoutleadingjet", "centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho}; #Delta#varphi_{jet}", {HistType::kTH3F, {{120, -10.0, 110.0}, {800, -400.0, 400.0}, {160, 0., TMath::TwoPi()}}}); //< bkg sub plot | end >// + registry.add("h_jet_pt_in_out_plane_v2", "jet pT;#it{p}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); registry.add("h_jet_pt_in_plane_v2", "jet pT;#it{p}^{in-plane}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); registry.add("h_jet_pt_out_of_plane_v2", "jet pT;#it{p}^{out-of-plane}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); registry.add("h_jet_pt_in_plane_v3", "jet pT;#it{p}^{in-plane}_{T,jet} (GeV/#it{c});entries", {HistType::kTH1F, {jetPtAxisRhoAreaSub}}); @@ -245,8 +249,10 @@ struct Jetchargedv2Task { AxisSpec axisEvtPl{360, -constants::math::PI, constants::math::PI}; - histosQA.add("histCentFull", "Centrality distribution for valid events", HistType::kTH1F, {axisCent}); - for (std::size_t i = 0; i < cfgnMods->size(); i++) { + histosQA.add("histCent", "Centrality TrkProcess", HistType::kTH1F, {axisCent}); + histosQA.add("histCentTrkProcess_aftersel", "Centrality TrkProcess aft_sel", HistType::kTH1F, {axisCent}); + + for (uint i = 0; i < cfgnMods->size(); i++) { histosQA.add(Form("histQvecUncorV%d", cfgnMods->at(i)), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}}); histosQA.add(Form("histQvecRectrV%d", cfgnMods->at(i)), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}}); histosQA.add(Form("histQvecTwistV%d", cfgnMods->at(i)), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}}); @@ -290,27 +296,6 @@ struct Jetchargedv2Task { return true; } - //=====================< q-vector & evtpln check >=====================// - template - void fillHistosQvec(const T& vec, int nmode) - { - int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - int RefAInd = RefAId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - int RefBInd = RefBId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - if (nmode == 2) { - if (vec.qvecAmp()[DetId] > 1e-8) { - histosQA.fill(HIST("histQvecUncorV2"), vec.qvecRe()[DetInd], vec.qvecIm()[DetInd], vec.cent()); - histosQA.fill(HIST("histQvecRectrV2"), vec.qvecRe()[DetInd + 1], vec.qvecIm()[DetInd + 1], vec.cent()); - histosQA.fill(HIST("histQvecTwistV2"), vec.qvecRe()[DetInd + 2], vec.qvecIm()[DetInd + 2], vec.cent()); - histosQA.fill(HIST("histQvecFinalV2"), vec.qvecRe()[DetInd + 3], vec.qvecIm()[DetInd + 3], vec.cent()); - histosQA.fill(HIST("histEvtPlUncorV2"), helperEP.GetEventPlane(vec.qvecRe()[DetInd], vec.qvecIm()[DetInd], nmode), vec.cent()); - histosQA.fill(HIST("histEvtPlRectrV2"), helperEP.GetEventPlane(vec.qvecRe()[DetInd + 1], vec.qvecIm()[DetInd + 1], nmode), vec.cent()); - histosQA.fill(HIST("histEvtPlTwistV2"), helperEP.GetEventPlane(vec.qvecRe()[DetInd + 2], vec.qvecIm()[DetInd + 2], nmode), vec.cent()); - histosQA.fill(HIST("histEvtPlFinalV2"), helperEP.GetEventPlane(vec.qvecRe()[DetInd + 3], vec.qvecIm()[DetInd + 3], nmode), vec.cent()); - } - } - } - //=====================< q-vector & evtpln check | end >=====================// void fillLeadingJetQA(double leadingJetPt, double leadingJetPhi, double leadingJetEta) { registry.fill(HIST("leadJetPt"), leadingJetPt); @@ -318,8 +303,9 @@ struct Jetchargedv2Task { registry.fill(HIST("leadJetEta"), leadingJetEta); } // end of fillLeadingJetQA template - void processjetQA(soa::Filtered::iterator const& collision, - soa::Join const& jets, aod::JetTracks const& tracks) + void processjetQA(soa::Filtered>::iterator const& collision, + soa::Join const& jets, + aod::JetTracks const& tracks) { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; @@ -347,11 +333,100 @@ struct Jetchargedv2Task { } PROCESS_SWITCH(Jetchargedv2Task, processjetQA, "jet rho v2 jet QA", true); + void processInOutJetV2(soa::Filtered>::iterator const& collision, + soa::Join const& jets, + aod::JetTracks const& tracks) + { + if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { + return; + } + + //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// + histosQA.fill(HIST("histCent"), collision.cent()); + for (uint i = 0; i < cfgnMods->size(); i++) { + int nmode = cfgnMods->at(i); + int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + if (nmode == 2) { + if (collision.qvecAmp()[DetId] > 1e-8) { + histosQA.fill(HIST("histQvecUncorV2"), collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], collision.cent()); + histosQA.fill(HIST("histQvecRectrV2"), collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], collision.cent()); + histosQA.fill(HIST("histQvecTwistV2"), collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], collision.cent()); + histosQA.fill(HIST("histQvecFinalV2"), collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], collision.cent()); + + histosQA.fill(HIST("histEvtPlUncorV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlRectrV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlTwistV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlFinalV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), collision.cent()); + } + } else if (nmode == 3) { + histosQA.fill(HIST("histQvecUncorV3"), collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], collision.cent()); + histosQA.fill(HIST("histQvecRectrV3"), collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], collision.cent()); + histosQA.fill(HIST("histQvecTwistV3"), collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], collision.cent()); + histosQA.fill(HIST("histQvecFinalV3"), collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], collision.cent()); + + histosQA.fill(HIST("histEvtPlUncorV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlRectrV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlTwistV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], nmode), collision.cent()); + histosQA.fill(HIST("histEvtPlFinalV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), collision.cent()); + } + + if (nmode == 2) { + Double_t phiMinusPsi2; + if (collision.qvecAmp()[DetId] < 1e-8) { + continue; + } + float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); + for (auto const& jet : jets) { + if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(jet)) { + continue; + } + registry.fill(HIST("h_jet_pt_rhoareasubtracted"), jet.pt() - (collision.rho() * jet.area()), 1); + if (jet.r() == round(selectedJetsRadius * 100.0f)) { + registry.fill(HIST("h_jet_pt_in_out_plane_v2"), jet.pt() - (collision.rho() * jet.area()), 1.0); + } + phiMinusPsi2 = jet.phi() - evtPl2; + + if ((phiMinusPsi2 < TMath::Pi() / 4) || (phiMinusPsi2 >= 7 * TMath::Pi() / 4) || (phiMinusPsi2 >= 3 * TMath::Pi() / 4 && phiMinusPsi2 < 5 * TMath::Pi() / 4)) { + registry.fill(HIST("h_jet_pt_in_plane_v2"), jet.pt() - (collision.rho() * jet.area()), 1.0); + registry.fill(HIST("h2_centrality_jet_pt_in_plane_v2"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); + } else { + registry.fill(HIST("h_jet_pt_out_of_plane_v2"), jet.pt() - (collision.rho() * jet.area()), 1.0); + registry.fill(HIST("h2_centrality_jet_pt_out_of_plane_v2"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); + } + } + //< JetPtCorr = Jet_pT-*A in-plane and out-of-plane | end >// + } else if (nmode == 3) { + Double_t phiMinusPsi3; + float evtPl3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); + for (auto const& jet : jets) { + if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { + continue; + } + if (!isAcceptedJet(jet)) { + continue; + } + phiMinusPsi3 = jet.phi() - evtPl3; + + if ((phiMinusPsi3 < TMath::Pi() / 4) || (phiMinusPsi3 >= 7 * TMath::Pi() / 4) || (phiMinusPsi3 >= 3 * TMath::Pi() / 4 && phiMinusPsi3 < 5 * TMath::Pi() / 4)) { + registry.fill(HIST("h_jet_pt_in_plane_v3"), jet.pt() - (collision.rho() * jet.area()), 1.0); + registry.fill(HIST("h2_centrality_jet_pt_in_plane_v3"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); + } else { + registry.fill(HIST("h_jet_pt_out_of_plane_v3"), jet.pt() - (collision.rho() * jet.area()), 1.0); + registry.fill(HIST("h2_centrality_jet_pt_out_of_plane_v3"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); + } + } + } + } + } + PROCESS_SWITCH(Jetchargedv2Task, processInOutJetV2, "Jet V2 in and out of plane", true); + void processSigmaPt(soa::Filtered> const& collisions, soa::Join const& jets, aod::JetTracks const& tracks) { - // double collnum = 1; for (const auto& collision : collisions) { double leadingJetPt = -1; double leadingJetPhi = -1; @@ -368,94 +443,14 @@ struct Jetchargedv2Task { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } - - //=====================< evt pln [n=2->\Psi_2, n=3->\Psi_3] >=====================// - for (std::size_t i = 0; i < cfgnMods->size(); i++) { - int nmode = cfgnMods->at(i); - int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - if (nmode == 2) { - if (collision.qvecAmp()[DetId] > 1e-8) { - histosQA.fill(HIST("histQvecUncorV2"), collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], collision.cent()); - histosQA.fill(HIST("histQvecRectrV2"), collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], collision.cent()); - histosQA.fill(HIST("histQvecTwistV2"), collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], collision.cent()); - histosQA.fill(HIST("histQvecFinalV2"), collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], collision.cent()); - - histosQA.fill(HIST("histEvtPlUncorV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlRectrV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlTwistV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlFinalV2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), collision.cent()); - } - } else if (nmode == 3) { - histosQA.fill(HIST("histQvecUncorV3"), collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], collision.cent()); - histosQA.fill(HIST("histQvecRectrV3"), collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], collision.cent()); - histosQA.fill(HIST("histQvecTwistV3"), collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], collision.cent()); - histosQA.fill(HIST("histQvecFinalV3"), collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], collision.cent()); - - histosQA.fill(HIST("histEvtPlUncorV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlRectrV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlTwistV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], nmode), collision.cent()); - histosQA.fill(HIST("histEvtPlFinalV3"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), collision.cent()); - } - //< Psi_EP,2, JetPtCorr = Jet_pT-*A in-plane and out-of-plane >// - auto collJets = jets.sliceBy(JetsPerJCollision, collision.globalIndex()); // select the jet in collisions - if (nmode == 2) { - Double_t phiMinusPsi2; - if (collision.qvecAmp()[DetId] < 1e-8) { - continue; - } - float evtPl2 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); - for (auto const& jet : collJets) { - if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { - continue; - } - if (!isAcceptedJet(jet)) { - continue; - } - phiMinusPsi2 = jet.phi() - evtPl2; - // Double_t jetPtCorr = 0.0; - // jetPtCorr = jet.pt() - collision.rho() * jet.area(); - - if ((phiMinusPsi2 < TMath::Pi() / 4) || (phiMinusPsi2 >= 7 * TMath::Pi() / 4) || (phiMinusPsi2 >= 3 * TMath::Pi() / 4 && phiMinusPsi2 < 5 * TMath::Pi() / 4)) { - registry.fill(HIST("h_jet_pt_in_plane_v2"), jet.pt() - (collision.rho() * jet.area()), 1.0); - registry.fill(HIST("h2_centrality_jet_pt_in_plane_v2"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); - } else { - registry.fill(HIST("h_jet_pt_out_of_plane_v2"), jet.pt() - (collision.rho() * jet.area()), 1.0); - registry.fill(HIST("h2_centrality_jet_pt_out_of_plane_v2"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); - } - } - //< JetPtCorr = Jet_pT-*A in-plane and out-of-plane | end >// - } else if (nmode == 3) { - Double_t phiMinusPsi3; - float evtPl3 = helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode); - for (auto const& jet : collJets) { - if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { - continue; - } - if (!isAcceptedJet(jet)) { - continue; - } - phiMinusPsi3 = jet.phi() - evtPl3; - // Double_t jetPtCorr = 0.0; - // jetPtCorr = jet.pt() - collision.rho() * jet.area(); - - if ((phiMinusPsi3 < TMath::Pi() / 4) || (phiMinusPsi3 >= 7 * TMath::Pi() / 4) || (phiMinusPsi3 >= 3 * TMath::Pi() / 4 && phiMinusPsi3 < 5 * TMath::Pi() / 4)) { - registry.fill(HIST("h_jet_pt_in_plane_v3"), jet.pt() - (collision.rho() * jet.area()), 1.0); - registry.fill(HIST("h2_centrality_jet_pt_in_plane_v3"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); - } else { - registry.fill(HIST("h_jet_pt_out_of_plane_v3"), jet.pt() - (collision.rho() * jet.area()), 1.0); - registry.fill(HIST("h2_centrality_jet_pt_out_of_plane_v3"), collision.centrality(), jet.pt() - (collision.rho() * jet.area()), 1.0); - } - } - } - } - //=====================< evt pln | end >=====================// auto collTracks = tracks.sliceBy(tracksPerJCollision, collision.globalIndex()); + if (jets.size() > 0) { for (auto const& track : collTracks) { - if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius) && track.pt() >= 0.2 && track.pt() <= 5.) { + if (jetderiveddatautilities::selectTrack(track, trackSelection) && (fabs(track.eta() - leadingJetEta) > jetRadius)) { registry.fill(HIST("h2_phi_track_pt"), track.pt(), track.phi()); registry.fill(HIST("h2_phi_track_eta"), track.eta(), track.phi()); - registry.fill(HIST("h_ptsum_sumpt"), track.phi(), track.pt()); // \sigma p_T distribution test + registry.fill(HIST("h_ptsum_sumpt"), track.phi(), track.pt()); // \sigma p_T distribution test [ && track.pt() >= 0.2 && track.pt() <= 5.] registry.fill(HIST("h2_centrality_phi_w_pt"), collision.centrality(), track.phi(), track.pt()); // \sigma track.pt() distribution with centrality test registry.fill(HIST("h2_evtnum_phi_w_pt"), evtnum, track.phi(), track.pt()); } @@ -465,7 +460,7 @@ struct Jetchargedv2Task { evtnum += 1; } } - PROCESS_SWITCH(Jetchargedv2Task, processSigmaPt, "QA for charged tracks", true); + PROCESS_SWITCH(Jetchargedv2Task, processSigmaPt, "Sigma pT and bkg as fcn of phi", true); void processRandomConeDataV2(soa::Filtered>::iterator const& collision, soa::Join const& jets, @@ -475,7 +470,7 @@ struct Jetchargedv2Task { return; } - for (std::size_t i = 0; i < cfgnMods->size(); i++) { + for (uint i = 0; i < cfgnMods->size(); i++) { TRandom3 randomNumber(0); float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR); float randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI); @@ -529,13 +524,15 @@ struct Jetchargedv2Task { } PROCESS_SWITCH(Jetchargedv2Task, processRandomConeDataV2, "QA for random cone estimation of background fluctuations in data", true); - void processTracksQA(soa::Filtered::iterator const& collision, + void processTracksQA(soa::Filtered>::iterator const& collision, soa::Filtered const& tracks) { + // histosQA.fill(HIST("histCentTrkProcess"), collision.centrality()); registry.fill(HIST("h2_centrality_collisions"), collision.centrality(), 0.5); if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; } + histosQA.fill(HIST("histCentTrkProcess_aftersel"), collision.centrality()); registry.fill(HIST("h2_centrality_collisions"), collision.centrality(), 1.5); for (auto const& track : tracks) { From ccce0ba3672e1d8d9bf5de673e5b53bbdb84bd39 Mon Sep 17 00:00:00 2001 From: spolitan <59452587+stefanopolitano@users.noreply.github.com> Date: Mon, 25 Nov 2024 07:19:31 +0100 Subject: [PATCH 070/459] [DPG] Add occupancy information in qa efficiency task (#8603) Co-authored-by: ALICE Action Bot --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 278 +++++++++++++++++++++++----- 1 file changed, 234 insertions(+), 44 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 0e1c023fc6e..1da6ae7783b 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -24,6 +24,7 @@ #include "ReconstructionDataFormats/DCA.h" #include "ReconstructionDataFormats/Track.h" #include "Common/Core/TrackSelection.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -35,6 +36,7 @@ #include "TEfficiency.h" #include "THashList.h" +using namespace o2; using namespace o2::framework; // Indices for the track cut histogram @@ -213,6 +215,8 @@ struct QaEfficiency { ConfigurableAxis etaBins{"etaBins", {200, -3.f, 3.f}, "Eta binning"}; ConfigurableAxis phiBins{"phiBins", {200, 0.f, 6.284f}, "Phi binning"}; ConfigurableAxis yBins{"yBins", {200, -0.5f, 0.5f}, "Y binning"}; + ConfigurableAxis occBins{"occBins", {100, 0.f, 14000.f}, "Occupancy binning"}; + ConfigurableAxis centBins{"centBins", {110, 0.f, 110.f}, "Centrality binning"}; ConfigurableAxis radiusBins{"radiusBins", {200, 0.f, 100.f}, "Radius binning"}; // Task configuration Configurable makeEff{"make-eff", false, "Flag to produce the efficiency with TEfficiency"}; @@ -241,11 +245,14 @@ struct QaEfficiency { Configurable minDcaZ{"minDcaZ", -2.f, "Additional cut on the minimum abs value of the DCA z"}; Configurable minDcaXY{"minDcaXY", -1.f, "Additional cut on the minimum abs value of the DCA xy"}; + Configurable doOccupancy{"doOccupancyStudy", false, "Flag to store Occupancy-related information"}; + Configurable useFT0OccEstimator{"useFT0OccEstimator", false, "Flag to adopt FT0c to estimate occupancy instead of ITS"}; + // Output objects for TEfficiency OutputObj listEfficiencyMC{"EfficiencyMC"}; OutputObj listEfficiencyData{"EfficiencyData"}; - using CollisionCandidates = o2::soa::Join; + using CollisionCandidates = o2::soa::Join; using CollisionCandidatesMC = o2::soa::Join; using TrackCandidates = o2::soa::Join; using TrackCandidatesMC = o2::soa::Join; @@ -291,6 +298,7 @@ struct QaEfficiency { const AxisSpec axisY{yBins, "#it{y}"}; const AxisSpec axisPhi{phiBins, "#it{#varphi} (rad)"}; const AxisSpec axisRadius{radiusBins, "Radius (cm)"}; + const AxisSpec axisOcc{occBins, "Occupancy"}; const char* partName = particleName(pdgSign, id); LOG(info) << "Preparing histograms for particle: " << partName << " pdgSign " << pdgSign; @@ -630,6 +638,24 @@ struct QaEfficiency { listEfficiencyMC.setObject(new THashList); + if (doOccupancy) { + const AxisSpec axisPt{ptBins, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec axisOcc{occBins, "Occupancy"}; + const AxisSpec axisCent{centBins, "Centrality"}; + + histos.add("MC/occ_cent/gen/pos", "Generated Positive ", kTH3D, {axisOcc, axisCent, axisPt}); + histos.add("MC/occ_cent/gen/neg", "Generated Negative ", kTH3D, {axisOcc, axisCent, axisPt}); + + histos.add("MC/occ_cent/reco/pos/its_tpc_tof", "ITS-TPC-TOF Positive ", kTH3D, {axisOcc, axisCent, axisPt}); + histos.add("MC/occ_cent/reco/neg/its_tpc_tof", "ITS-TPC-TOF Negative ", kTH3D, {axisOcc, axisCent, axisPt}); + + histos.add("MC/occ_cent/reco/pos/its_tpc", "ITS-TPC Positive ", kTH3D, {axisOcc, axisCent, axisPt}); + histos.add("MC/occ_cent/reco/neg/its_tpc", "ITS-TPC Negative ", kTH3D, {axisOcc, axisCent, axisPt}); + + histos.add("MC/occ_cent/reco/pos/its", "ITS Positive ", kTH3D, {axisOcc, axisCent, axisPt}); + histos.add("MC/occ_cent/reco/neg/its", "ITS Negative ", kTH3D, {axisOcc, axisCent, axisPt}); + } + static_for<0, 1>([&](auto pdgSign) { makeMCHistograms(doEl); makeMCHistograms(doMu); @@ -734,6 +760,8 @@ struct QaEfficiency { ptMin, ptMax, phiMin, phiMax); const AxisSpec axisEta{etaBins, "#it{#eta}"}; + const AxisSpec axisOcc{occBins, "Occupancy"}; + const AxisSpec axisCent{centBins, "Centrality"}; const TString tagPhi = Form("#it{#eta} [%.2f,%.2f] #it{p}_{T} [%.2f,%.2f]", etaMin, etaMax, @@ -745,6 +773,20 @@ struct QaEfficiency { histos.add("Data/trackLength", "Track length;Track length (cm)", kTH1D, {{2000, -1000, 1000}}); + if (doOccupancy) { + histos.add("Data/occ_cent/pos/its_tpc_tof", "ITS-TPC-TOF Positive ", kTH3D, {axisOcc, axisCent, axisPt}); + histos.add("Data/occ_cent/neg/its_tpc_tof", "ITS-TPC-TOF Negative ", kTH3D, {axisOcc, axisCent, axisPt}); + + histos.add("Data/occ_cent/pos/its_tpc", "ITS-TPC Positive ", kTH3D, {axisOcc, axisCent, axisPt}); + histos.add("Data/occ_cent/neg/its_tpc", "ITS-TPC Negative ", kTH3D, {axisOcc, axisCent, axisPt}); + + histos.add("Data/occ_cent/pos/tpc", "TPC Positive ", kTH3D, {axisOcc, axisCent, axisPt}); + histos.add("Data/occ_cent/neg/tpc", "TPC Negative ", kTH3D, {axisOcc, axisCent, axisPt}); + + histos.add("Data/occ_cent/pos/its", "ITS Positive ", kTH3D, {axisOcc, axisCent, axisPt}); + histos.add("Data/occ_cent/neg/its", "ITS Negative ", kTH3D, {axisOcc, axisCent, axisPt}); + } + // ITS-TPC-TOF histos.add("Data/pos/pt/its_tpc_tof", "ITS-TPC-TOF Positive " + tagPt, kTH1D, {axisPt}); histos.add("Data/neg/pt/its_tpc_tof", "ITS-TPC-TOF Negative " + tagPt, kTH1D, {axisPt}); @@ -1627,6 +1669,54 @@ struct QaEfficiency { return true; } + /// \brief Function to get MC collision occupancy + /// \param collSlice collection of reconstructed collisions + /// \return collision occupancy + template + int getOccupancyColl(CCs const& collSlice) + { + float multiplicity{0.f}; + int occupancy = 0; + for (const auto& collision : collSlice) { + float collMult{0.f}; + collMult = collision.numContrib(); + + if (collMult > multiplicity) { + if (useFT0OccEstimator) { + /// occupancy estimator (FT0c signal amplitudes in +-10us from current collision) + occupancy = collision.ft0cOccupancyInTimeRange(); + } else { + /// occupancy estimator (ITS tracks with at least 5 clusters in +-10us from current collision) + occupancy = static_cast(collision.trackOccupancyInTimeRange()); + } + multiplicity = collMult; + } + } // end loop over collisions + + return occupancy; + } + + /// \brief Function to get MC collision centrality + /// \param collSlice collection of reconstructed collisions + /// \return collision centrality + template + int getCentralityColl(CCs const& collSlice) + { + float multiplicity{0.f}; + int centrality = 0; + for (const auto& collision : collSlice) { + float collMult{0.f}; + collMult = collision.numContrib(); + + if (collMult > multiplicity) { + centrality = collision.centFT0C(); + multiplicity = collMult; + } + } // end loop over collisions + + return centrality; + } + // MC process // Single-track efficiency calculated only for MC collisions with at least 1 reco. collision SliceCache cache; @@ -1652,6 +1742,12 @@ struct QaEfficiency { if (groupedCollisions.size() < 1) { // Skipping MC events that have no reconstructed collisions continue; } + float centrality = -1.; + float occupancy = -1.; + if (doOccupancy) { + centrality = getCentralityColl(groupedCollisions); + occupancy = getOccupancyColl(groupedCollisions); + } histos.fill(HIST("MC/generatedCollisions"), 2); if (skipEventsWithoutTPCTracks) { int nTPCTracks = 0; @@ -1678,6 +1774,14 @@ struct QaEfficiency { continue; } histos.fill(HIST("MC/generatedCollisions"), 5); + if (useFT0OccEstimator) { + /// occupancy estimator (FT0c signal amplitudes in +-10us from current collision) + occupancy = collision.ft0cOccupancyInTimeRange(); + } else { + /// occupancy estimator (ITS tracks with at least 5 clusters in +-10us from current collision) + occupancy = static_cast(collision.trackOccupancyInTimeRange()); + } + centrality = collision.centFT0C(); const auto groupedTracks = tracks.sliceBy(perCollision, collision.globalIndex()); @@ -1694,6 +1798,33 @@ struct QaEfficiency { continue; } + if (doOccupancy) { + float trackPt = track.pt(); + float trackSign = track.sign(); + if (trackSign > 0) { + if (passedTOF && passedTPC && passedITS) { + histos.fill(HIST("MC/occ_cent/reco/pos/its_tpc_tof"), occupancy, centrality, trackPt); + } + if (passedTPC && passedITS) { + histos.fill(HIST("MC/occ_cent/reco/pos/its_tpc"), occupancy, centrality, trackPt); + } + if (passedITS) { + histos.fill(HIST("MC/occ_cent/reco/pos/its"), occupancy, centrality, trackPt); + } + } + if (trackSign < 0) { + if (passedTOF && passedTPC && passedITS) { + histos.fill(HIST("MC/occ_cent/reco/neg/its_tpc_tof"), occupancy, centrality, trackPt); + } + if (passedTPC && passedITS) { + histos.fill(HIST("MC/occ_cent/reco/neg/its_tpc"), occupancy, centrality, trackPt); + } + if (passedITS) { + histos.fill(HIST("MC/occ_cent/reco/neg/its"), occupancy, centrality, trackPt); + } + } + } + // Filling variable histograms histos.fill(HIST("MC/trackLength"), track.length()); static_for<0, 1>([&](auto pdgSign) { @@ -1737,6 +1868,17 @@ struct QaEfficiency { continue; } + if (doOccupancy) { + float partSign = particle.pdgCode(); + float mcPartPt = particle.pt(); + if (partSign > 0) { + histos.fill(HIST("MC/occ_cent/gen/pos"), occupancy, centrality, mcPartPt); + } + if (partSign < 0) { + histos.fill(HIST("MC/occ_cent/gen/neg"), occupancy, centrality, mcPartPt); + } + } + static_for<0, 1>([&](auto pdgSign) { fillMCParticleHistograms(particle, doEl); fillMCParticleHistograms(particle, doMu); @@ -1914,76 +2056,124 @@ struct QaEfficiency { histos.fill(HIST("Data/trackLength"), track.length()); + float trackPt = track.pt(); + float trackEta = track.eta(); + float trackPhi = track.phi(); + float trackSign = track.sign(); + float occupancy; + float centrality; + if (doOccupancy) { + centrality = collision.centFT0C(); + if (useFT0OccEstimator) { + /// occupancy estimator (FT0c signal amplitudes in +-10us from current collision) + occupancy = collision.ft0cOccupancyInTimeRange(); + } else { + /// occupancy estimator (ITS tracks with at least 5 clusters in +-10us from current collision) + occupancy = static_cast(collision.trackOccupancyInTimeRange()); + } + } if (passedITS) { - if (track.sign() > 0) { - histos.fill(HIST("Data/pos/pt/its"), track.pt()); - histos.fill(HIST("Data/pos/eta/its"), track.eta()); - histos.fill(HIST("Data/pos/phi/its"), track.phi()); - histos.fill(HIST("Data/pos/etaphi/its"), track.eta(), track.phi()); + if (trackSign > 0) { + histos.fill(HIST("Data/pos/pt/its"), trackPt); + histos.fill(HIST("Data/pos/eta/its"), trackEta); + histos.fill(HIST("Data/pos/phi/its"), trackPhi); + histos.fill(HIST("Data/pos/etaphi/its"), trackEta, trackPhi); + + if (doOccupancy) { + histos.fill(HIST("Data/occ_cent/pos/its"), occupancy, centrality, trackPt); + } } else { - histos.fill(HIST("Data/neg/pt/its"), track.pt()); - histos.fill(HIST("Data/neg/eta/its"), track.eta()); - histos.fill(HIST("Data/neg/phi/its"), track.phi()); - histos.fill(HIST("Data/neg/etaphi/its"), track.eta(), track.phi()); + histos.fill(HIST("Data/neg/pt/its"), trackPt); + histos.fill(HIST("Data/neg/eta/its"), trackEta); + histos.fill(HIST("Data/neg/phi/its"), trackPhi); + histos.fill(HIST("Data/neg/etaphi/its"), trackEta, trackPhi); + + if (doOccupancy) { + histos.fill(HIST("Data/occ_cent/neg/its"), occupancy, centrality, trackPt); + } } } if (passedTPC) { - if (track.sign() > 0) { - histos.fill(HIST("Data/pos/pt/tpc"), track.pt()); - histos.fill(HIST("Data/pos/eta/tpc"), track.eta()); - histos.fill(HIST("Data/pos/phi/tpc"), track.phi()); - histos.fill(HIST("Data/pos/etaphi/tpc"), track.eta(), track.phi()); + if (trackSign > 0) { + histos.fill(HIST("Data/pos/pt/tpc"), trackPt); + histos.fill(HIST("Data/pos/eta/tpc"), trackEta); + histos.fill(HIST("Data/pos/phi/tpc"), trackPhi); + histos.fill(HIST("Data/pos/etaphi/tpc"), trackEta, trackPhi); + + if (doOccupancy) { + histos.fill(HIST("Data/occ_cent/pos/tpc"), occupancy, centrality, trackPt); + } } else { - histos.fill(HIST("Data/neg/pt/tpc"), track.pt()); - histos.fill(HIST("Data/neg/eta/tpc"), track.eta()); - histos.fill(HIST("Data/neg/phi/tpc"), track.phi()); - histos.fill(HIST("Data/neg/etaphi/tpc"), track.eta(), track.phi()); + histos.fill(HIST("Data/neg/pt/tpc"), trackPt); + histos.fill(HIST("Data/neg/eta/tpc"), trackEta); + histos.fill(HIST("Data/neg/phi/tpc"), trackPhi); + histos.fill(HIST("Data/neg/etaphi/tpc"), trackEta, trackPhi); + + if (doOccupancy) { + histos.fill(HIST("Data/occ_cent/neg/tpc"), occupancy, centrality, trackPt); + } } } if (passedITS && passedTPC) { - if (track.sign() > 0) { - histos.fill(HIST("Data/pos/pt/its_tpc"), track.pt()); - histos.fill(HIST("Data/pos/eta/its_tpc"), track.eta()); - histos.fill(HIST("Data/pos/phi/its_tpc"), track.phi()); - histos.fill(HIST("Data/pos/etaphi/its_tpc"), track.eta(), track.phi()); + if (trackSign > 0) { + histos.fill(HIST("Data/pos/pt/its_tpc"), trackPt); + histos.fill(HIST("Data/pos/eta/its_tpc"), trackEta); + histos.fill(HIST("Data/pos/phi/its_tpc"), trackPhi); + histos.fill(HIST("Data/pos/etaphi/its_tpc"), trackEta, trackPhi); + + if (doOccupancy) { + histos.fill(HIST("Data/occ_cent/pos/its_tpc"), occupancy, centrality, trackPt); + } } else { - histos.fill(HIST("Data/neg/pt/its_tpc"), track.pt()); - histos.fill(HIST("Data/neg/eta/its_tpc"), track.eta()); - histos.fill(HIST("Data/neg/phi/its_tpc"), track.phi()); - histos.fill(HIST("Data/neg/etaphi/its_tpc"), track.eta(), track.phi()); + histos.fill(HIST("Data/neg/pt/its_tpc"), trackPt); + histos.fill(HIST("Data/neg/eta/its_tpc"), trackEta); + histos.fill(HIST("Data/neg/phi/its_tpc"), trackPhi); + histos.fill(HIST("Data/neg/etaphi/its_tpc"), trackEta, trackPhi); + + if (doOccupancy) { + histos.fill(HIST("Data/occ_cent/neg/its_tpc"), occupancy, centrality, trackPt); + } } } if (passedITS && passedTPC && passedTOF) { - if (track.sign() > 0) { - histos.fill(HIST("Data/pos/pt/its_tpc_tof"), track.pt()); - histos.fill(HIST("Data/pos/eta/its_tpc_tof"), track.eta()); - histos.fill(HIST("Data/pos/phi/its_tpc_tof"), track.phi()); - histos.fill(HIST("Data/pos/etaphi/its_tpc_tof"), track.eta(), track.phi()); + if (trackSign > 0) { + histos.fill(HIST("Data/pos/pt/its_tpc_tof"), trackPt); + histos.fill(HIST("Data/pos/eta/its_tpc_tof"), trackEta); + histos.fill(HIST("Data/pos/phi/its_tpc_tof"), trackPhi); + histos.fill(HIST("Data/pos/etaphi/its_tpc_tof"), trackEta, trackPhi); + + if (doOccupancy) { + histos.fill(HIST("Data/occ_cent/pos/its_tpc_tof"), occupancy, centrality, trackPt); + } } else { - histos.fill(HIST("Data/neg/pt/its_tpc_tof"), track.pt()); - histos.fill(HIST("Data/neg/eta/its_tpc_tof"), track.eta()); - histos.fill(HIST("Data/neg/phi/its_tpc_tof"), track.phi()); - histos.fill(HIST("Data/neg/etaphi/its_tpc_tof"), track.eta(), track.phi()); + histos.fill(HIST("Data/neg/pt/its_tpc_tof"), trackPt); + histos.fill(HIST("Data/neg/eta/its_tpc_tof"), trackEta); + histos.fill(HIST("Data/neg/phi/its_tpc_tof"), trackPhi); + histos.fill(HIST("Data/neg/etaphi/its_tpc_tof"), trackEta, trackPhi); + + if (doOccupancy) { + histos.fill(HIST("Data/occ_cent/neg/its"), occupancy, centrality, trackPt); + } } } if (makeEff) { if (passedITS) { - effITSTPCMatchingVsPt->Fill(passedTPC, track.pt()); + effITSTPCMatchingVsPt->Fill(passedTPC, trackPt); } if (passedTPC) { - effTPCITSMatchingVsPt->Fill(passedITS, track.pt()); + effTPCITSMatchingVsPt->Fill(passedITS, trackPt); } if (passedITS && passedTPC) { - effTPCTOFMatchingVsPt->Fill(passedTOF, track.pt()); + effTPCTOFMatchingVsPt->Fill(passedTOF, trackPt); effTPCTOFMatchingVsP->Fill(passedTOF, track.p()); - effTPCTOFMatchingVsEta->Fill(passedTOF, track.eta()); - effTPCTOFMatchingVsPhi->Fill(passedTOF, track.phi()); - effTPCTOFMatchingVsPtVsEta->Fill(passedTOF, track.pt(), track.eta()); - effTPCTOFMatchingVsPtVsPhi->Fill(passedTOF, track.pt(), track.phi()); + effTPCTOFMatchingVsEta->Fill(passedTOF, trackEta); + effTPCTOFMatchingVsPhi->Fill(passedTOF, trackPhi); + effTPCTOFMatchingVsPtVsEta->Fill(passedTOF, trackPt, trackEta); + effTPCTOFMatchingVsPtVsPhi->Fill(passedTOF, trackPt, trackPhi); } } } From 8c80275c6026d0a76e469cfe1449c501cf42c7df Mon Sep 17 00:00:00 2001 From: czhang Date: Mon, 25 Nov 2024 07:23:43 +0100 Subject: [PATCH 071/459] [PWGDQ,PWGEM] Completion of flow calculation with on-the-flight resolution factors (#8572) --- PWGDQ/Core/HistogramsLibrary.cxx | 51 ++-- PWGDQ/Core/VarManager.h | 307 ++++++++++++--------- PWGDQ/Tasks/tableReader.cxx | 47 +++- PWGDQ/Tasks/tableReader_withAssoc.cxx | 8 +- PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx | 2 +- 5 files changed, 241 insertions(+), 174 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index bad53e0fd1b..44aaad223f4 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -297,23 +297,37 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "R2EP_TPCFT0A_CentV0M", "", false, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kR2EP_AB); hm->AddHistogram(histClass, "R2EP_TPCFT0C_CentV0M", "", false, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kR2EP_AC); hm->AddHistogram(histClass, "R2EP_FT0CFT0A_CentV0M", "", false, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kR2EP_BC); - hm->AddHistogram(histClass, "R2SP_TPCFT0A_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_AB); - hm->AddHistogram(histClass, "R2SP_TPCFT0C_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_AC); - hm->AddHistogram(histClass, "R2SP_FT0AFT0C_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_BC); + hm->AddHistogram(histClass, "R2SP_TPCFT0A_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_AB); + hm->AddHistogram(histClass, "R2SP_TPCFT0C_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_AC); + hm->AddHistogram(histClass, "R2SP_FT0AFT0C_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_BC); hm->AddHistogram(histClass, "R2SP_FT0CTPCPOS_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_FT0CTPCPOS); hm->AddHistogram(histClass, "R2SP_FT0CTPCNEG_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_FT0CTPCNEG); hm->AddHistogram(histClass, "R2SP_FT0ATPCPOS_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_FT0ATPCPOS); hm->AddHistogram(histClass, "R2SP_FT0ATPCNEG_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2SP_FT0ATPCNEG); hm->AddHistogram(histClass, "R3SP_CentFT0C", "", true, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR3SP); - hm->AddHistogram(histClass, "R2EP_TPCFT0A_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2EP_AB); - hm->AddHistogram(histClass, "R2EP_TPCFT0C_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2EP_AC); - hm->AddHistogram(histClass, "R2EP_FT0CFT0A_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2EP_BC); + hm->AddHistogram(histClass, "R2EP_TPCFT0A_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2EP_AB); + hm->AddHistogram(histClass, "R2EP_TPCFT0C_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2EP_AC); + hm->AddHistogram(histClass, "R2EP_FT0CFT0A_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2EP_BC); hm->AddHistogram(histClass, "R2EP_FT0CTPCPOS_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2EP_FT0CTPCPOS); hm->AddHistogram(histClass, "R2EP_FT0CTPCNEG_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2EP_FT0CTPCNEG); hm->AddHistogram(histClass, "R2EP_FT0ATPCPOS_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2EP_FT0ATPCPOS); hm->AddHistogram(histClass, "R2EP_FT0ATPCNEG_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR2EP_FT0ATPCNEG); hm->AddHistogram(histClass, "R3EP_CentFT0C", "", true, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kR3EP); } + if (subGroupStr.Contains("reso-profile")) { + hm->AddHistogram(histClass, "Profile_R2SP_TPCFT0A_CentFT0C", "Profile_R2SP_TPCFT0A_CentFT0C", true, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, 0.0, 5.0, VarManager::kR2SP_AB, 0, 0, 0, -1, "", "", "", -1, VarManager::kWR2SP_AB); + hm->AddHistogram(histClass, "Profile_R2SP_TPCFT0C_CentFT0C", "Profile_R2SP_TPCFT0C_CentFT0C", true, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, 0.0, 5.0, VarManager::kR2SP_AC, 0, 0, 0, -1, "", "", "", -1, VarManager::kWR2SP_AC); + hm->AddHistogram(histClass, "Profile_R2SP_FT0AFT0C_CentFT0C", "Profile_R2SP_FT0AFT0C_CentFT0C", true, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, 0.0, 5.0, VarManager::kR2SP_BC, 0, 0, 0, -1, "", "", "", -1, VarManager::kWR2SP_BC); + hm->AddHistogram(histClass, "Profile_R2EP_TPCFT0A_CentFT0C", "Profile_R2EP_TPCFT0A_CentFT0C", true, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, 0.0, 5.0, VarManager::kR2EP_AB, 0, 0, 0, -1, "", "", "", -1, VarManager::kWR2EP_AB); + hm->AddHistogram(histClass, "Profile_R2EP_TPCFT0C_CentFT0C", "Profile_R2EP_TPCFT0C_CentFT0C", true, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, 0.0, 5.0, VarManager::kR2EP_AC, 0, 0, 0, -1, "", "", "", -1, VarManager::kWR2EP_AC); + hm->AddHistogram(histClass, "Profile_R2EP_FT0AFT0C_CentFT0C", "Profile_R2EP_FT0AFT0C_CentFT0C", true, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, 0.0, 5.0, VarManager::kR2EP_BC, 0, 0, 0, -1, "", "", "", -1, VarManager::kWR2EP_BC); + hm->AddHistogram(histClass, "Profile_R2SP_Im_TPCFT0A_CentFT0C", "Profile_R2SP_Im_TPCFT0A_CentFT0C", true, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, 0.0, 5.0, VarManager::kR2SP_AB_Im, 0, 0, 0, -1, "", "", "", -1, VarManager::kWR2SP_AB_Im); + hm->AddHistogram(histClass, "Profile_R2SP_Im_TPCFT0C_CentFT0C", "Profile_R2SP_Im_TPCFT0C_CentFT0C", true, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, 0.0, 5.0, VarManager::kR2SP_AC_Im, 0, 0, 0, -1, "", "", "", -1, VarManager::kWR2SP_AC_Im); + hm->AddHistogram(histClass, "Profile_R2SP_Im_FT0AFT0C_CentFT0C", "Profile_R2SP_Im_FT0AFT0C_CentFT0C", true, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, 0.0, 5.0, VarManager::kR2SP_BC_Im, 0, 0, 0, -1, "", "", "", -1, VarManager::kWR2SP_BC_Im); + hm->AddHistogram(histClass, "Profile_R2EP_Im_TPCFT0A_CentFT0C", "Profile_R2EP_Im_TPCFT0A_CentFT0C", true, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, 0.0, 5.0, VarManager::kR2EP_AB_Im, 0, 0, 0, -1, "", "", "", -1, VarManager::kWR2EP_AB_Im); + hm->AddHistogram(histClass, "Profile_R2EP_Im_TPCFT0C_CentFT0C", "Profile_R2EP_Im_TPCFT0C_CentFT0C", true, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, 0.0, 5.0, VarManager::kR2EP_AC_Im, 0, 0, 0, -1, "", "", "", -1, VarManager::kWR2EP_AC_Im); + hm->AddHistogram(histClass, "Profile_R2EP_Im_FT0AFT0C_CentFT0C", "Profile_R2EP_Im_FT0AFT0C_CentFT0C", true, 90, 0.0, 90.0, VarManager::kCentFT0C, 500, 0.0, 5.0, VarManager::kR2EP_BC_Im, 0, 0, 0, -1, "", "", "", -1, VarManager::kWR2EP_BC_Im); + } if (subGroupStr.Contains("filter")) { hm->AddHistogram(histClass, "IsDoubleGap", "Is double gap", false, 2, -0.5, 1.5, VarManager::kIsDoubleGap); hm->AddHistogram(histClass, "IsSingleGapA", "Is single gap on side A", false, 2, -0.5, 1.5, VarManager::kIsSingleGapA); @@ -990,25 +1004,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "U2Q2_CentFT0C_ev2", "mass vs. centrality vs. U2Q2_event2", false, 125, 0.0, 5.0, VarManager::kMass, 9, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kU2Q2Ev2); } if (subGroupStr.Contains("metest")) { - int var1[5] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kU2Q2Ev1, VarManager::kCos2DeltaPhiMu1}; - int var2[5] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kU2Q2Ev2, VarManager::kCos2DeltaPhiMu2}; - int bins[5] = {250, 60, 18, 100, 100}; - double minBins[5] = {0.0, 0.0, 0.0, -10., -1.0}; - double maxBins[5] = {5.0, 30.0, 90.0, 10., 1.0}; - hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_U2Q2ev1_cos2DeltaPhiMu1", "", 5, var1, bins, minBins, maxBins, 0, -1, kTRUE); - hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_U2Q2ev2_cos2DeltaPhiMu2", "", 5, var2, bins, minBins, maxBins, 0, -1, kTRUE); - hm->AddHistogram(histClass, "R2SPAB1_CentFT0C", "mass vs centrality vs. R2SPAB_event1", false, 250, 0.0, 5.0, VarManager::kMass, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kTwoR2SP_AB1); - hm->AddHistogram(histClass, "R2SPAB2_CentFT0C", "mass vs centrality vs. R2SPAB_event2", false, 250, 0.0, 5.0, VarManager::kMass, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kTwoR2SP_AB2); - hm->AddHistogram(histClass, "R2SPAC1_CentFT0C", "mass vs centrality vs. R2SPAC_event1", false, 250, 0.0, 5.0, VarManager::kMass, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kTwoR2SP_AC1); - hm->AddHistogram(histClass, "R2SPAC2_CentFT0C", "mass vs centrality vs. R2SPAC_event2", false, 250, 0.0, 5.0, VarManager::kMass, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kTwoR2SP_AC2); - hm->AddHistogram(histClass, "R2SPBC1_CentFT0C", "mass vs centrality vs. R2SPBC_event1", false, 250, 0.0, 5.0, VarManager::kMass, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kTwoR2SP_BC1); - hm->AddHistogram(histClass, "R2SPBC2_CentFT0C", "mass vs centrality vs. R2SPBC_event2", false, 250, 0.0, 5.0, VarManager::kMass, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kTwoR2SP_BC2); - hm->AddHistogram(histClass, "R2EPAB1_CentFT0C", "mass vs centrality vs. R2EPAB_event1", false, 250, 0.0, 5.0, VarManager::kMass, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kTwoR2EP_AB1); - hm->AddHistogram(histClass, "R2EPAB2_CentFT0C", "mass vs centrality vs. R2EPAB_event2", false, 250, 0.0, 5.0, VarManager::kMass, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kTwoR2EP_AB2); - hm->AddHistogram(histClass, "R2EPAC1_CentFT0C", "mass vs centrality vs. R2EPAC_event1", false, 250, 0.0, 5.0, VarManager::kMass, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kTwoR2EP_AC1); - hm->AddHistogram(histClass, "R2EPAC2_CentFT0C", "mass vs centrality vs. R2EPAC_event2", false, 250, 0.0, 5.0, VarManager::kMass, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kTwoR2EP_AC2); - hm->AddHistogram(histClass, "R2EPBC1_CentFT0C", "mass vs centrality vs. R2EPBC_event1", false, 250, 0.0, 5.0, VarManager::kMass, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kTwoR2EP_BC1); - hm->AddHistogram(histClass, "R2EPBC2_CentFT0C", "mass vs centrality vs. R2EPBC_event2", false, 250, 0.0, 5.0, VarManager::kMass, 18, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kTwoR2EP_BC2); + hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_V2ME_SP", "", true, 250, 0.0, 5.0, VarManager::kMass, 60, 0.0, 30.0, VarManager::kPt, 90, 0.0, 90.0, VarManager::kCentFT0C, "", "", "", VarManager::kV2ME_SP, VarManager::kWV2ME_SP); + hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_V2ME_EP", "", true, 250, 0.0, 5.0, VarManager::kMass, 60, 0.0, 30.0, VarManager::kPt, 90, 0.0, 90.0, VarManager::kCentFT0C, "", "", "", VarManager::kV2ME_EP, VarManager::kWV2ME_EP); } if (subGroupStr.Contains("dimuon-polarization-he")) { int varspTHE[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCosThetaHE, VarManager::kPhiHE}; @@ -1158,6 +1155,10 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Mass_Pt_centrFT0C_V2", "", 6, varV2, bins, minBins, maxBins, 0, -1, kTRUE); hm->AddHistogram(histClass, "Mass_Pt_centrFT0C_V3", "", 6, varV3, bins, minBins, maxBins, 0, -1, kTRUE); } + if (subGroupStr.Contains("flow-ccdb")) { + hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_V2SPwR", "Mass_Pt_CentFT0C_V2SPwR, --s--", true, 250, 0.0, 5.0, VarManager::kMass, 60, 0.0, 30.0, VarManager::kPt, 90, 0.0, 90.0, VarManager::kCentFT0C, "", "", "", VarManager::kV2SP, VarManager::kWV2SP); + hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_V2EPwR", "Mass_Pt_CentFT0C_V2EPwR, --s--", true, 250, 0.0, 5.0, VarManager::kMass, 60, 0.0, 30.0, VarManager::kPt, 90, 0.0, 90.0, VarManager::kCentFT0C, "", "", "", VarManager::kV2EP, VarManager::kWV2EP); + } if (subGroupStr.Contains("cumulant")) { int var[4] = {VarManager::kMass, VarManager::kPt, VarManager::kRap, VarManager::kCentFT0C}; int bins[4] = {250, 60, 6, 18}; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 0c5b49f5a7e..8d0a1805063 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -310,6 +310,15 @@ class VarManager : public TObject kR2SP_AB, kR2SP_AC, kR2SP_BC, + kWR2SP_AB, + kWR2SP_AC, + kWR2SP_BC, + kR2SP_AB_Im, + kR2SP_AC_Im, + kR2SP_BC_Im, + kWR2SP_AB_Im, + kWR2SP_AC_Im, + kWR2SP_BC_Im, kR2SP_FT0CTPCPOS, kR2SP_FT0CTPCNEG, kR2SP_FT0ATPCPOS, @@ -322,6 +331,15 @@ class VarManager : public TObject kR2EP_AB, kR2EP_AC, kR2EP_BC, + kWR2EP_AB, + kWR2EP_AC, + kWR2EP_BC, + kR2EP_AB_Im, + kR2EP_AC_Im, + kR2EP_BC_Im, + kWR2EP_AB_Im, + kWR2EP_AC_Im, + kWR2EP_BC_Im, kR2EP_FT0CTPCPOS, kR2EP_FT0CTPCNEG, kR2EP_FT0ATPCPOS, @@ -340,6 +358,8 @@ class VarManager : public TObject kTwoEvPosZ2, // vtx-z for collision 2 in two events correlations kTwoEvPosR1, // vtx-R for collision 1 in two events correlations kTwoEvPosR2, + kTwoEvCentFT0C1, + kTwoEvCentFT0C2, kTwoEvPVcontrib1, // n-contributors for collision 1 in two events correlations kTwoEvPVcontrib2, kTwoEvDeltaZ, // distance in z between collisions @@ -369,22 +389,20 @@ class VarManager : public TObject kQ2Y0A2, kU2Q2Ev1, kU2Q2Ev2, - kTwoR2SP1, // Scalar product resolution of event1 for ME technique - kTwoR2SP2, // Scalar product resolution of event2 for ME technique - kTwoR2EP1, // Event plane resolution of event2 for ME technique - kTwoR2EP2, // Event plane resolution of event2 for ME technique - kTwoR2SP_AB1, // Scalar product resolution of event1 for ME technique - kTwoR2SP_AB2, // Scalar product resolution of event2 for ME technique - kTwoR2SP_AC1, // Scalar product resolution of event1 for ME technique - kTwoR2SP_AC2, // Scalar product resolution of event2 for ME technique - kTwoR2SP_BC1, // Scalar product resolution of event1 for ME technique - kTwoR2SP_BC2, // Scalar product resolution of event2 for ME technique - kTwoR2EP_AB1, // Event plane resolution of event2 for ME technique - kTwoR2EP_AB2, // Event plane resolution of event2 for ME technique - kTwoR2EP_AC1, // Event plane resolution of event2 for ME technique - kTwoR2EP_AC2, // Event plane resolution of event2 for ME technique - kTwoR2EP_BC1, // Event plane resolution of event2 for ME technique - kTwoR2EP_BC2, // Event plane resolution of event2 for ME technique + kCos2DeltaPhiEv1, + kCos2DeltaPhiEv2, + kV2SP1, + kV2SP2, + kV2EP1, + kV2EP2, + kV2ME_SP, + kV2ME_EP, + kWV2ME_SP, + kWV2ME_EP, + kTwoR2SP1, // Scalar product resolution of event1 for ME technique + kTwoR2SP2, // Scalar product resolution of event2 for ME technique + kTwoR2EP1, // Event plane resolution of event2 for ME technique + kTwoR2EP2, // Event plane resolution of event2 for ME technique // Basic track/muon/pair wise variables kX, @@ -609,6 +627,10 @@ class VarManager : public TObject kImpParXYK, kDCATrackProd, kDCATrackVtxProd, + kV2SP, + kV2EP, + kWV2SP, + kWV2EP, kU2Q2, kU3Q3, kQ42XA, @@ -651,6 +673,8 @@ class VarManager : public TObject kCORR4POIMp, kCORR2POIMpw, kCORR4POIMpw, + kR2SP, + kR2EP, kPsi2A, kPsi2APOS, kPsi2ANEG, @@ -931,9 +955,13 @@ class VarManager : public TObject template static void FillEventTrackEstimators(TEvent const& collision, TAssoc const& groupedTrackIndices, TTracks const& tracks, float* values = nullptr); template + static void FillEventFlowResoFactor(T const& hs_sp, T const& hs_ep, float* values = nullptr); + template static void FillTwoEvents(T const& event1, T const& event2, float* values = nullptr); template static void FillTwoMixEvents(T1 const& event1, T1 const& event2, T2 const& tracks1, T2 const& tracks2, float* values = nullptr); + template + static void FillTwoMixEventsFlowResoFactor(T const& hs_sp, T const& hs_ep, float* values = nullptr); template static void FillTrack(T const& track, float* values = nullptr); template @@ -956,7 +984,7 @@ class VarManager : public TObject static void FillPairCollisionMatCorr(C const& collision, T1 const& t1, T2 const& t2, M const& materialCorr, P const& propagator, float* values = nullptr); template static void FillTriple(T1 const& t1, T2 const& t2, T3 const& t3, float* values = nullptr, PairCandidateType pairType = kTripleCandidateToEEPhoton); - template + template static void FillPairME(T1 const& t1, T2 const& t2, float* values = nullptr); template static void FillPairMC(T1 const& t1, T2 const& t2, float* values = nullptr, PairCandidateType pairType = kDecayToEE); @@ -1687,13 +1715,43 @@ void VarManager::FillEvent(T const& event, float* values) values[kPsi2B] = Psi2B; values[kPsi2C] = Psi2C; - values[kR2SP_AB] = (values[kQ2X0A] * values[kQ2X0B] + values[kQ2Y0A] * values[kQ2Y0B]); - values[kR2SP_AC] = (values[kQ2X0A] * values[kQ2X0C] + values[kQ2Y0A] * values[kQ2Y0C]); - values[kR2SP_BC] = (values[kQ2X0B] * values[kQ2X0C] + values[kQ2Y0B] * values[kQ2Y0C]); - - values[kR2EP_AB] = TMath::Cos(2 * (Psi2A - Psi2B)); - values[kR2EP_AC] = TMath::Cos(2 * (Psi2A - Psi2C)); - values[kR2EP_BC] = TMath::Cos(2 * (Psi2B - Psi2C)); + float R2SP_AB = (values[kQ2X0A] * values[kQ2X0B] + values[kQ2Y0A] * values[kQ2Y0B]); + float R2SP_AC = (values[kQ2X0A] * values[kQ2X0C] + values[kQ2Y0A] * values[kQ2Y0C]); + float R2SP_BC = (values[kQ2X0B] * values[kQ2X0C] + values[kQ2Y0B] * values[kQ2Y0C]); + float R2SP_AB_Im = (values[kQ2Y0A] * values[kQ2X0B] - values[kQ2X0A] * values[kQ2Y0B]); + float R2SP_AC_Im = (values[kQ2Y0A] * values[kQ2X0C] - values[kQ2X0A] * values[kQ2Y0C]); + float R2SP_BC_Im = (values[kQ2Y0B] * values[kQ2X0C] - values[kQ2X0B] * values[kQ2Y0C]); + values[kR2SP_AB] = std::isnan(R2SP_AB) || std::isinf(R2SP_AB) ? 0. : R2SP_AB; + values[kWR2SP_AB] = std::isnan(R2SP_AB) || std::isinf(R2SP_AB) ? 0. : 1.0; + values[kR2SP_AC] = std::isnan(R2SP_AC) || std::isinf(R2SP_AC) ? 0. : R2SP_AC; + values[kWR2SP_AC] = std::isnan(R2SP_AC) || std::isinf(R2SP_AC) ? 0. : 1.0; + values[kR2SP_BC] = std::isnan(R2SP_BC) || std::isinf(R2SP_BC) ? 0. : R2SP_BC; + values[kWR2SP_BC] = std::isnan(R2SP_BC) || std::isinf(R2SP_BC) ? 0. : 1.0; + values[kR2SP_AB_Im] = std::isnan(R2SP_AB_Im) || std::isinf(R2SP_AB_Im) ? 0. : R2SP_AB_Im; + values[kWR2SP_AB_Im] = std::isnan(R2SP_AB_Im) || std::isinf(R2SP_AB_Im) ? 0. : 1.0; + values[kR2SP_AC_Im] = std::isnan(R2SP_AC_Im) || std::isinf(R2SP_AC_Im) ? 0. : R2SP_AC_Im; + values[kWR2SP_AC_Im] = std::isnan(R2SP_AC_Im) || std::isinf(R2SP_AC_Im) ? 0. : 1.0; + values[kR2SP_BC_Im] = std::isnan(R2SP_BC_Im) || std::isinf(R2SP_BC_Im) ? 0. : R2SP_BC_Im; + values[kWR2SP_BC_Im] = std::isnan(R2SP_BC_Im) || std::isinf(R2SP_BC_Im) ? 0. : 1.0; + + float R2EP_AB = std::isnan(Psi2A) || std::isinf(Psi2A) || std::isnan(Psi2B) || std::isinf(Psi2B) ? 0. : TMath::Cos(2 * (Psi2A - Psi2B)); + float R2EP_AC = std::isnan(Psi2A) || std::isinf(Psi2A) || std::isnan(Psi2C) || std::isinf(Psi2C) ? 0. : TMath::Cos(2 * (Psi2A - Psi2C)); + float R2EP_BC = std::isnan(Psi2B) || std::isinf(Psi2B) || std::isnan(Psi2C) || std::isinf(Psi2C) ? 0. : TMath::Cos(2 * (Psi2B - Psi2C)); + float R2EP_AB_Im = std::isnan(Psi2A) || std::isinf(Psi2A) || std::isnan(Psi2B) || std::isinf(Psi2B) ? 0. : TMath::Sin(2 * (Psi2A - Psi2B)); + float R2EP_AC_Im = std::isnan(Psi2A) || std::isinf(Psi2A) || std::isnan(Psi2C) || std::isinf(Psi2C) ? 0. : TMath::Sin(2 * (Psi2A - Psi2C)); + float R2EP_BC_Im = std::isnan(Psi2B) || std::isinf(Psi2B) || std::isnan(Psi2C) || std::isinf(Psi2C) ? 0. : TMath::Sin(2 * (Psi2B - Psi2C)); + values[kR2EP_AB] = std::isnan(R2EP_AB) || std::isinf(R2EP_AB) ? 0. : R2EP_AB; + values[kWR2EP_AB] = std::isnan(R2EP_AB) || std::isinf(R2EP_AB) ? 0. : 1.0; + values[kR2EP_AC] = std::isnan(R2EP_AC) || std::isinf(R2EP_AC) ? 0. : R2EP_AC; + values[kWR2EP_AC] = std::isnan(R2EP_AC) || std::isinf(R2EP_AC) ? 0. : 1.0; + values[kR2EP_BC] = std::isnan(R2EP_BC) || std::isinf(R2EP_BC) ? 0. : R2EP_BC; + values[kWR2EP_BC] = std::isnan(R2EP_BC) || std::isinf(R2EP_BC) ? 0. : 1.0; + values[kR2EP_AB_Im] = std::isnan(R2EP_AB_Im) || std::isinf(R2EP_AB_Im) ? 0. : R2EP_AB_Im; + values[kWR2EP_AB_Im] = std::isnan(R2EP_AB_Im) || std::isinf(R2EP_AB_Im) ? 0. : 1.0; + values[kR2EP_AC_Im] = std::isnan(R2EP_AC_Im) || std::isinf(R2EP_AC_Im) ? 0. : R2EP_AC_Im; + values[kWR2EP_AC_Im] = std::isnan(R2EP_AC_Im) || std::isinf(R2EP_AC_Im) ? 0. : 1.0; + values[kR2EP_BC_Im] = std::isnan(R2EP_BC_Im) || std::isinf(R2EP_BC_Im) ? 0. : R2EP_BC_Im; + values[kWR2EP_BC_Im] = std::isnan(R2EP_BC_Im) || std::isinf(R2EP_BC_Im) ? 0. : 1.0; } if constexpr ((fillMap & CollisionMC) > 0) { @@ -1783,6 +1841,46 @@ void VarManager::FillEventTrackEstimators(TEvent const& collision, TAssoc const& } } +template +void VarManager::FillEventFlowResoFactor(T const& hs_sp, T const& hs_ep, float* values) +{ + if (!values) { + values = fgValues; + } + + if (values[kCentFT0C] >= 0.) { + int idx_sp = hs_sp->FindBin(values[kCentFT0C]); + int idx_ep = hs_ep->FindBin(values[kCentFT0C]); + + values[kR2SP] = hs_sp->GetBinContent(idx_sp); + values[kR2EP] = hs_ep->GetBinContent(idx_ep); + } +} + +template +void VarManager::FillTwoMixEventsFlowResoFactor(T const& hs_sp, T const& hs_ep, float* values) +{ + if (!values) { + values = fgValues; + } + + if (values[kTwoEvCentFT0C1] >= 0.) { + int idx_sp1 = hs_sp->FindBin(values[kTwoEvCentFT0C1]); + int idx_ep1 = hs_ep->FindBin(values[kTwoEvCentFT0C1]); + + values[kTwoR2SP1] = hs_sp->GetBinContent(idx_sp1); + values[kTwoR2EP1] = hs_ep->GetBinContent(idx_ep1); + } + + if (values[kTwoEvCentFT0C2] >= 0.) { + int idx_sp2 = hs_sp->FindBin(values[kTwoEvCentFT0C2]); + int idx_ep2 = hs_ep->FindBin(values[kTwoEvCentFT0C2]); + + values[kTwoR2SP2] = hs_sp->GetBinContent(idx_sp2); + values[kTwoR2EP2] = hs_ep->GetBinContent(idx_ep2); + } +} + template void VarManager::FillTwoEvents(T const& ev1, T const& ev2, float* values) { @@ -1829,42 +1927,16 @@ void VarManager::FillTwoMixEvents(T1 const& ev1, T1 const& ev2, T2 const& /*trac for (auto& track1 : tracks1) { Track1Filter = uint32_t(track1.isMuonSelected());} for (auto& track2 : tracks2) { Track2Filter = uint32_t(track2.isMuonSelected());} */ + if constexpr ((fillMap & CollisionCent) > 0 || (fillMap & ReducedEventExtended) > 0) { + values[kTwoEvCentFT0C1] = ev1.centFT0C(); + values[kTwoEvCentFT0C2] = ev2.centFT0C(); + } if constexpr ((fillMap & ReducedEventQvector) > 0) { // Tobe used for the calculation of u1q1 and u2q2 values[kQ2X0A1] = ev1.q2x0a(); values[kQ2X0A2] = ev2.q2x0a(); values[kQ2Y0A1] = ev1.q2y0a(); values[kQ2Y0A2] = ev2.q2y0a(); - - values[kTwoR2SP1] = (ev1.q2x0b() * ev1.q2x0c() + ev1.q2y0b() * ev1.q2y0c()); - values[kTwoR2SP2] = (ev2.q2x0b() * ev2.q2x0c() + ev2.q2y0b() * ev2.q2y0c()); - values[kTwoR2SP_AB1] = (ev1.q2x0a() * ev1.q2x0b() + ev1.q2y0a() * ev1.q2y0b()); - values[kTwoR2SP_AB2] = (ev2.q2x0a() * ev2.q2x0b() + ev2.q2y0a() * ev2.q2y0b()); - values[kTwoR2SP_AC1] = (ev1.q2x0a() * ev1.q2x0c() + ev1.q2y0a() * ev1.q2y0c()); - values[kTwoR2SP_AC2] = (ev2.q2x0a() * ev2.q2x0c() + ev2.q2y0a() * ev2.q2y0c()); - values[kTwoR2SP_BC1] = (ev1.q2x0b() * ev1.q2x0c() + ev1.q2y0b() * ev1.q2y0c()); - values[kTwoR2SP_BC2] = (ev2.q2x0b() * ev2.q2x0c() + ev2.q2y0b() * ev2.q2y0c()); - - if (ev1.q2y0a() * ev1.q2y0b() != 0.0) { - values[kTwoR2EP_AB1] = TMath::Cos(2 * (getEventPlane(2, ev1.q2x0a(), ev1.q2y0a()) - getEventPlane(2, ev1.q2x0b(), ev1.q2y0b()))); - } - if (ev2.q2y0a() * ev2.q2y0b() != 0.0) { - values[kTwoR2EP_AB2] = TMath::Cos(2 * (getEventPlane(2, ev2.q2x0a(), ev2.q2y0a()) - getEventPlane(2, ev2.q2x0b(), ev2.q2y0b()))); - } - if (ev1.q2y0a() * ev1.q2y0c() != 0.0) { - values[kTwoR2EP_AC1] = TMath::Cos(2 * (getEventPlane(2, ev1.q2x0a(), ev1.q2y0a()) - getEventPlane(2, ev1.q2x0c(), ev1.q2y0c()))); - } - if (ev2.q2y0a() * ev2.q2y0c() != 0.0) { - values[kTwoR2EP_AC2] = TMath::Cos(2 * (getEventPlane(2, ev2.q2x0a(), ev2.q2y0a()) - getEventPlane(2, ev2.q2x0c(), ev2.q2y0c()))); - } - if (ev1.q2y0b() * ev1.q2y0c() != 0.0) { - values[kTwoR2EP1] = TMath::Cos(2 * (getEventPlane(2, ev1.q2x0b(), ev1.q2y0b()) - getEventPlane(2, ev1.q2x0c(), ev1.q2y0c()))); - values[kTwoR2EP_BC1] = TMath::Cos(2 * (getEventPlane(2, ev1.q2x0b(), ev1.q2y0b()) - getEventPlane(2, ev1.q2x0c(), ev1.q2y0c()))); - } - if (ev2.q2y0b() * ev2.q2y0c() != 0.0) { - values[kTwoR2EP2] = TMath::Cos(2 * (getEventPlane(2, ev2.q2x0b(), ev2.q2y0b()) - getEventPlane(2, ev2.q2x0c(), ev2.q2y0c()))); - values[kTwoR2EP_BC2] = TMath::Cos(2 * (getEventPlane(2, ev2.q2x0b(), ev2.q2y0b()) - getEventPlane(2, ev2.q2x0c(), ev2.q2y0c()))); - } } if constexpr ((fillMap & CollisionQvect) > 0) { // Tobe used for the calculation of u1q1 and u2q2 @@ -1872,61 +1944,6 @@ void VarManager::FillTwoMixEvents(T1 const& ev1, T1 const& ev2, T2 const& /*trac values[kQ2X0A2] = (ev2.qvecBPosRe() * ev2.nTrkBPos() + ev2.qvecBNegRe() * ev2.nTrkBNeg()) / (ev2.nTrkBPos() + ev2.nTrkBNeg()); values[kQ2Y0A1] = (ev1.qvecBPosIm() * ev1.nTrkBPos() + ev1.qvecBNegIm() * ev1.nTrkBNeg()) / (ev1.nTrkBPos() + ev1.nTrkBNeg()); values[kQ2Y0A2] = (ev2.qvecBPosIm() * ev2.nTrkBPos() + ev2.qvecBNegIm() * ev2.nTrkBNeg()) / (ev2.nTrkBPos() + ev2.nTrkBNeg()); - - values[kTwoR2SP1] = (ev1.qvecFT0ARe() * ev1.qvecFT0CRe() + ev1.qvecFT0AIm() * ev1.qvecFT0CIm()); - values[kTwoR2SP2] = (ev2.qvecFT0ARe() * ev2.qvecFT0CRe() + ev2.qvecFT0AIm() * ev2.qvecFT0CIm()); - values[kTwoR2SP_AB1] = (values[kQ2X0A1] * ev1.qvecFT0ARe() + values[kQ2Y0A1] * ev1.qvecFT0AIm()); - values[kTwoR2SP_AB2] = (values[kQ2X0A2] * ev2.qvecFT0ARe() + values[kQ2Y0A2] * ev2.qvecFT0AIm()); - values[kTwoR2SP_AC1] = (values[kQ2X0A1] * ev1.qvecFT0CRe() + values[kQ2Y0A1] * ev1.qvecFT0CIm()); - values[kTwoR2SP_AC2] = (values[kQ2X0A2] * ev2.qvecFT0CRe() + values[kQ2Y0A2] * ev2.qvecFT0CIm()); - values[kTwoR2SP_BC1] = values[kTwoR2SP1]; - values[kTwoR2SP_BC2] = values[kTwoR2SP2]; - - if (values[kQ2Y0A1] * ev1.qvecFT0AIm() != 0.0) { - values[kTwoR2EP_AB1] = TMath::Cos(2 * (getEventPlane(2, values[kQ2X0A1], values[kQ2Y0A1]) - getEventPlane(2, ev1.qvecFT0ARe(), ev1.qvecFT0AIm()))); - } - if (values[kQ2Y0A2] * ev2.qvecFT0AIm() != 0.0) { - values[kTwoR2EP_AB2] = TMath::Cos(2 * (getEventPlane(2, values[kQ2X0A2], values[kQ2Y0A2]) - getEventPlane(2, ev2.qvecFT0ARe(), ev2.qvecFT0AIm()))); - } - if (values[kQ2Y0A1] * ev1.qvecFT0CIm() != 0.0) { - values[kTwoR2EP_AC1] = TMath::Cos(2 * (getEventPlane(2, values[kQ2X0A1], values[kQ2Y0A1]) - getEventPlane(2, ev1.qvecFT0CRe(), ev1.qvecFT0CIm()))); - } - if (values[kQ2Y0A2] * ev2.qvecFT0CIm() != 0.0) { - values[kTwoR2EP_AC2] = TMath::Cos(2 * (getEventPlane(2, values[kQ2X0A2], values[kQ2Y0A2]) - getEventPlane(2, ev2.qvecFT0CRe(), ev2.qvecFT0CIm()))); - } - if (ev1.qvecFT0AIm() * ev1.qvecFT0CIm() != 0.0) { - values[kTwoR2EP1] = TMath::Cos(2 * (getEventPlane(2, ev1.qvecFT0ARe(), ev1.qvecFT0AIm()) - getEventPlane(2, ev1.qvecFT0CRe(), ev1.qvecFT0CIm()))); - values[kTwoR2EP_BC1] = values[kTwoR2EP1]; - } - if (ev2.qvecFT0AIm() * ev2.qvecFT0CIm() != 0.0) { - values[kTwoR2EP2] = TMath::Cos(2 * (getEventPlane(2, ev2.qvecFT0ARe(), ev2.qvecFT0AIm()) - getEventPlane(2, ev2.qvecFT0CRe(), ev2.qvecFT0CIm()))); - values[kTwoR2EP_BC2] = values[kTwoR2EP2]; - } - } - - if (std::isnan(VarManager::fgValues[VarManager::kTwoR2SP1]) == true || std::isnan(VarManager::fgValues[VarManager::kTwoR2EP1]) == true) { - values[kTwoR2SP1] = -999.; - values[kTwoR2SP2] = -999.; - values[kTwoR2EP1] = -999.; - values[kTwoR2EP2] = -999.; - } - if (std::isnan(VarManager::fgValues[VarManager::kTwoR2SP_AB1]) == true || std::isnan(VarManager::fgValues[VarManager::kTwoR2EP_AB1]) == true) { - values[kTwoR2SP_AB1] = -999.; - values[kTwoR2SP_AB2] = -999.; - values[kTwoR2EP_AB1] = -999.; - values[kTwoR2EP_AB2] = -999.; - } - if (std::isnan(VarManager::fgValues[VarManager::kTwoR2SP_AC1]) == true || std::isnan(VarManager::fgValues[VarManager::kTwoR2EP_AC1]) == true) { - values[kTwoR2SP_AC1] = -999.; - values[kTwoR2SP_AC2] = -999.; - values[kTwoR2EP_AC1] = -999.; - values[kTwoR2EP_AC2] = -999.; - } - if (std::isnan(VarManager::fgValues[VarManager::kTwoR2SP_BC1]) == true || std::isnan(VarManager::fgValues[VarManager::kTwoR2EP_BC1]) == true) { - values[kTwoR2SP_BC1] = -999.; - values[kTwoR2SP_BC2] = -999.; - values[kTwoR2EP_BC1] = -999.; - values[kTwoR2EP_BC2] = -999.; } } @@ -2886,7 +2903,7 @@ void VarManager::FillTriple(T1 const& t1, T2 const& t2, T3 const& t3, float* val } } -template +template void VarManager::FillPairME(T1 const& t1, T2 const& t2, float* values) { // @@ -2937,13 +2954,31 @@ void VarManager::FillPairME(T1 const& t1, T2 const& t2, float* values) values[kDeltaEtaPair2] = v1.Eta() - v2.Eta(); } - // TODO: provide different computations for vn - // Compute the scalar product UQ for two muon from different event using Q-vector from A, for second and third harmonic - values[kU2Q2Ev1] = values[kQ2X0A1] * std::cos(2 * v1.Phi()) + values[kQ2Y0A1] * std::sin(2 * v1.Phi()); - values[kU2Q2Ev2] = values[kQ2X0A2] * std::cos(2 * v2.Phi()) + values[kQ2Y0A2] * std::sin(2 * v2.Phi()); - values[kCos2DeltaPhiMu1] = std::cos(2 * (v1.Phi() - v12.Phi())); - values[kCos2DeltaPhiMu2] = std::cos(2 * (v2.Phi() - v12.Phi())); + if constexpr ((fillMap & ReducedEventQvector) > 0 || (fillMap & CollisionQvect) > 0) { + // TODO: provide different computations for vn + // Compute the scalar product UQ for two muon from different event using Q-vector from A, for second and third harmonic + float Psi2A1 = getEventPlane(2, values[kQ2X0A1], values[kQ2Y0A1]); + float Psi2A2 = getEventPlane(2, values[kQ2X0A2], values[kQ2Y0A2]); + values[kCos2DeltaPhiEv1] = TMath::Cos(2 * (v1.Phi() - Psi2A1)); + values[kCos2DeltaPhiEv2] = TMath::Cos(2 * (v2.Phi() - Psi2A2)); + values[kU2Q2Ev1] = values[kQ2X0A1] * TMath::Cos(2 * v1.Phi()) + values[kQ2Y0A1] * TMath::Sin(2 * v1.Phi()); + values[kU2Q2Ev2] = values[kQ2X0A2] * TMath::Cos(2 * v2.Phi()) + values[kQ2Y0A2] * TMath::Sin(2 * v2.Phi()); + values[kCos2DeltaPhiMu1] = TMath::Cos(2 * (v1.Phi() - v12.Phi())); + values[kCos2DeltaPhiMu2] = TMath::Cos(2 * (v2.Phi() - v12.Phi())); + + values[kV2SP1] = values[kU2Q2Ev1] / values[kTwoR2SP1]; + values[kV2SP2] = values[kU2Q2Ev2] / values[kTwoR2SP2]; + values[kV2EP1] = values[kCos2DeltaPhiEv1] / values[kTwoR2EP1]; + values[kV2EP2] = values[kCos2DeltaPhiEv2] / values[kTwoR2EP2]; + + float V2ME_SP = values[kV2SP1] * values[kCos2DeltaPhiMu1] + values[kV2SP2] * values[kCos2DeltaPhiMu2]; + float V2ME_EP = values[kV2EP1] * values[kCos2DeltaPhiMu1] + values[kV2EP2] * values[kCos2DeltaPhiMu2]; + values[kV2ME_SP] = std::isnan(V2ME_SP) || std::isinf(V2ME_SP) ? 0. : V2ME_SP; + values[kWV2ME_SP] = std::isnan(V2ME_SP) || std::isinf(V2ME_SP) ? 0. : 1.0; + values[kV2ME_EP] = std::isnan(V2ME_EP) || std::isinf(V2ME_EP) ? 0. : V2ME_EP; + values[kWV2ME_EP] = std::isnan(V2ME_EP) || std::isinf(V2ME_EP) ? 0. : 1.0; + } if constexpr (pairType == kDecayToMuMu) { if (fgUsedVars[kQuadDCAabsXY]) { double dca1X = t1.fwdDcaX(); @@ -4105,17 +4140,17 @@ void VarManager::FillQVectorFromCentralFW(C const& collision, float* values) float epBNegs = epHelper.GetEventPlane(xQVecBNeg, yQVecBNeg, 2); float epTPCFull = epHelper.GetEventPlane(values[kQ2X0A], values[kQ2Y0A], 2); - values[kR2EP_AB] = std::cos(2 * getDeltaPsiInRange(epTPCFull, epFT0a, 2)); - values[kR2EP_AC] = std::cos(2 * getDeltaPsiInRange(epTPCFull, epFT0c, 2)); - values[kR2EP_BC] = std::cos(2 * getDeltaPsiInRange(epFT0a, epFT0c, 2)); - values[kR2EP_FT0CTPCPOS] = std::cos(2 * getDeltaPsiInRange(epFT0c, epBPoss, 2)); - values[kR2EP_FT0CTPCNEG] = std::cos(2 * getDeltaPsiInRange(epFT0c, epBNegs, 2)); - values[kR2EP_FT0ATPCPOS] = std::cos(2 * getDeltaPsiInRange(epFT0a, epBPoss, 2)); - values[kR2EP_FT0ATPCNEG] = std::cos(2 * getDeltaPsiInRange(epFT0a, epBNegs, 2)); - values[kR2EP_FT0MTPCPOS] = std::cos(2 * getDeltaPsiInRange(epFT0m, epBPoss, 2)); - values[kR2EP_FT0MTPCNEG] = std::cos(2 * getDeltaPsiInRange(epFT0m, epBNegs, 2)); - values[kR2EP_FV0ATPCPOS] = std::cos(2 * getDeltaPsiInRange(epFV0a, epBPoss, 2)); - values[kR2EP_FV0ATPCNEG] = std::cos(2 * getDeltaPsiInRange(epFV0a, epBNegs, 2)); + values[kR2EP_AB] = TMath::Cos(2 * getDeltaPsiInRange(epTPCFull, epFT0a, 2)); + values[kR2EP_AC] = TMath::Cos(2 * getDeltaPsiInRange(epTPCFull, epFT0c, 2)); + values[kR2EP_BC] = TMath::Cos(2 * getDeltaPsiInRange(epFT0a, epFT0c, 2)); + values[kR2EP_FT0CTPCPOS] = TMath::Cos(2 * getDeltaPsiInRange(epFT0c, epBPoss, 2)); + values[kR2EP_FT0CTPCNEG] = TMath::Cos(2 * getDeltaPsiInRange(epFT0c, epBNegs, 2)); + values[kR2EP_FT0ATPCPOS] = TMath::Cos(2 * getDeltaPsiInRange(epFT0a, epBPoss, 2)); + values[kR2EP_FT0ATPCNEG] = TMath::Cos(2 * getDeltaPsiInRange(epFT0a, epBNegs, 2)); + values[kR2EP_FT0MTPCPOS] = TMath::Cos(2 * getDeltaPsiInRange(epFT0m, epBPoss, 2)); + values[kR2EP_FT0MTPCNEG] = TMath::Cos(2 * getDeltaPsiInRange(epFT0m, epBNegs, 2)); + values[kR2EP_FV0ATPCPOS] = TMath::Cos(2 * getDeltaPsiInRange(epFV0a, epBPoss, 2)); + values[kR2EP_FV0ATPCNEG] = TMath::Cos(2 * getDeltaPsiInRange(epFV0a, epBNegs, 2)); } template @@ -4257,8 +4292,8 @@ void VarManager::FillPairVn(T1 const& t1, T2 const& t2, float* values) // TODO: provide different computations for vn // Compute the scalar product UQ using Q-vector from A, for second and third harmonic // Dilepton vn could be accessible after dividing this product with the R factor - values[kU2Q2] = values[kQ2X0A] * std::cos(2 * v12.Phi()) + values[kQ2Y0A] * std::sin(2 * v12.Phi()); - values[kU3Q3] = values[kQ3X0A] * std::cos(3 * v12.Phi()) + values[kQ3Y0A] * std::sin(3 * v12.Phi()); + values[kU2Q2] = values[kQ2X0A] * TMath::Cos(2 * v12.Phi()) + values[kQ2Y0A] * TMath::Sin(2 * v12.Phi()); + values[kU3Q3] = values[kQ3X0A] * TMath::Cos(3 * v12.Phi()) + values[kQ3Y0A] * TMath::Sin(3 * v12.Phi()); values[kR2SP_AB] = (values[kQ2X0A] * values[kQ2X0B] + values[kQ2Y0A] * values[kQ2Y0B]); values[kR2SP_AC] = (values[kQ2X0A] * values[kQ2X0C] + values[kQ2Y0A] * values[kQ2Y0C]); values[kR2SP_BC] = (values[kQ2X0B] * values[kQ2X0C] + values[kQ2Y0B] * values[kQ2Y0C]); @@ -4270,15 +4305,19 @@ void VarManager::FillPairVn(T1 const& t1, T2 const& t2, float* values) float Psi3B = getEventPlane(3, values[kQ3X0B], values[kQ3Y0B]); float Psi2C = getEventPlane(2, values[kQ2X0C], values[kQ2Y0C]); float Psi3C = getEventPlane(3, values[kQ3X0C], values[kQ3Y0C]); - values[kCos2DeltaPhi] = std::cos(2 * (v12.Phi() - Psi2A)); - values[kCos3DeltaPhi] = std::cos(3 * (v12.Phi() - Psi3A)); + values[kCos2DeltaPhi] = TMath::Cos(2 * (v12.Phi() - Psi2A)); + values[kCos3DeltaPhi] = TMath::Cos(3 * (v12.Phi() - Psi3A)); values[kR2EP_AB] = TMath::Cos(2 * (Psi2A - Psi2B)); values[kR2EP_AC] = TMath::Cos(2 * (Psi2A - Psi2C)); values[kR2EP_BC] = TMath::Cos(2 * (Psi2B - Psi2C)); values[kR3EP] = TMath::Cos(3 * (Psi3B - Psi3C)); - values[kCos2DeltaPhiMu1] = std::cos(2 * (v1.Phi() - v12.Phi())); - values[kCos2DeltaPhiMu2] = std::cos(2 * (v2.Phi() - v12.Phi())); + float V2SP = values[kU2Q2] / values[kR2SP]; + float V2EP = values[kCos2DeltaPhi] / values[kR2EP]; + values[kV2SP] = std::isnan(V2SP) || std::isinf(V2SP) ? 0. : V2SP; + values[kWV2SP] = std::isnan(V2SP) || std::isinf(V2SP) ? 0. : 1.0; + values[kV2EP] = std::isnan(V2EP) || std::isinf(V2EP) ? 0. : V2EP; + values[kWV2EP] = std::isnan(V2EP) || std::isinf(V2EP) ? 0. : 1.0; if (std::isnan(VarManager::fgValues[VarManager::kU2Q2]) == true) { values[kU2Q2] = -999.; @@ -4306,7 +4345,7 @@ void VarManager::FillPairVn(T1 const& t1, T2 const& t2, float* values) complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); complex Q42(values[kQ42XA], values[kQ42YA]); complex Q23(values[kQ23XA], values[kQ23YA]); - complex P2(std::cos(2 * v12.Phi()), std::sin(2 * v12.Phi())); + complex P2(TMath::Cos(2 * v12.Phi()), TMath::Sin(2 * v12.Phi())); values[kM01POI] = values[kMultDimuons] * values[kS11A]; values[kM0111POI] = values[kMultDimuons] * (values[kS31A] - 3. * values[kS11A] * values[kS12A] + 2. * values[kS13A]); values[kCORR2POI] = (P2 * conj(Q21)).real() / values[kM01POI]; diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index b7bd4639aba..bf060637a13 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -658,10 +658,14 @@ struct AnalysisEventMixing { Configurable ccdburl{"ccdburl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable fConfigAmbiguousHist{"cfgAmbiHist", false, "Enable Ambiguous histograms for time association studies"}; + Configurable ccdbPathFlow{"ccdb-path-flow", "Users/c/chizh/FlowResolution", "path to the ccdb object for flow resolution factors"}; + Configurable fConfigFlowReso{"cfgFlowReso", false, "Enable loading of flow resolution factors from CCDB"}; Service ccdb; o2::parameters::GRPMagField* grpmag = nullptr; + TH1D* ResoFlowSP = nullptr; // Resolution factors for flow analysis, this will be loaded from CCDB + TH1D* ResoFlowEP = nullptr; // Resolution factors for flow analysis, this will be loaded from CCDB int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. Filter filterEventSelected = aod::dqanalysisflags::isEventSelected == 1; @@ -788,16 +792,7 @@ struct AnalysisEventMixing { if (!twoTrackFilter) { // the tracks must have at least one filter bit in common to continue continue; } - VarManager::FillPairME(track1, track2); - - constexpr bool eventHasQvector = (VarManager::ObjTypes::ReducedEventQvector > 0); - if constexpr (eventHasQvector) { - VarManager::FillPairVn(track1, track2); - } - constexpr bool eventHasQvectorCentr = (VarManager::ObjTypes::CollisionQvect > 0); - if constexpr (eventHasQvectorCentr) { - VarManager::FillPairVn(track1, track2); - } + VarManager::FillPairME(track1, track2); for (unsigned int icut = 0; icut < ncuts; icut++) { if (twoTrackFilter & (uint32_t(1) << icut)) { @@ -836,6 +831,16 @@ struct AnalysisEventMixing { } else { LOGF(fatal, "GRP object is not available in CCDB at timestamp=%llu", events.begin().timestamp()); } + if (fConfigFlowReso) { + TString PathFlow = ccdbPathFlow.value; + TString ccdbPathFlowSP = Form("%s/ScalarProduct", PathFlow.Data()); + TString ccdbPathFlowEP = Form("%s/EventPlane", PathFlow.Data()); + ResoFlowSP = ccdb->getForTimeStamp(ccdbPathFlowSP.Data(), events.begin().timestamp()); + ResoFlowEP = ccdb->getForTimeStamp(ccdbPathFlowEP.Data(), events.begin().timestamp()); + if (ResoFlowSP == nullptr || ResoFlowEP == nullptr) { + LOGF(fatal, "Resolution factor is not available in CCDB at timestamp=%llu", events.begin().timestamp()); + } + } fCurrentRun = events.begin().runNumber(); } @@ -852,6 +857,9 @@ struct AnalysisEventMixing { tracks2.bindExternalIndices(&events); VarManager::FillTwoMixEvents(event1, event2, tracks1, tracks2); + if (fConfigFlowReso) { + VarManager::FillEventFlowResoFactor(ResoFlowSP, ResoFlowEP); + } runMixedPairing(tracks1, tracks2); } // end event loop } @@ -944,6 +952,8 @@ struct AnalysisSameEventPairing { float mMagField = 0.0; o2::parameters::GRPMagField* grpmag = nullptr; o2::base::MatLayerCylSet* lut = nullptr; + TH1D* ResoFlowSP = nullptr; // Resolution factors for flow analysis, this will be loaded from CCDB + TH1D* ResoFlowEP = nullptr; // Resolution factors for flow analysis, this will be loaded from CCDB int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. OutputObj fOutputList{"output"}; @@ -952,6 +962,8 @@ struct AnalysisSameEventPairing { Configurable fConfigPairCuts{"cfgPairCuts", "", "Comma separated list of pair cuts"}; Configurable url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable ccdbPath{"ccdb-path", "Users/lm", "base path to the ccdb object"}; + Configurable ccdbPathFlow{"ccdb-path-flow", "Users/c/chizh/FlowResolution", "path to the ccdb object for flow resolution factors"}; + Configurable fConfigFlowReso{"cfgFlowReso", false, "Enable loading of flow resolution factors from CCDB"}; Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable fConfigAddSEPHistogram{"cfgAddSEPHistogram", "", "Comma separated list of histograms"}; Configurable fConfigFlatTables{"cfgFlatTables", false, "Produce a single flat tables with all relevant information of the pairs and single tracks"}; @@ -1184,6 +1196,16 @@ struct AnalysisSameEventPairing { } VarManager::SetMagneticField(fConfigMagField.value); } + if (fConfigFlowReso) { + TString PathFlow = ccdbPathFlow.value; + TString ccdbPathFlowSP = Form("%s/ScalarProduct", PathFlow.Data()); + TString ccdbPathFlowEP = Form("%s/EventPlane", PathFlow.Data()); + ResoFlowSP = ccdb->getForTimeStamp(ccdbPathFlowSP.Data(), event.timestamp()); + ResoFlowEP = ccdb->getForTimeStamp(ccdbPathFlowEP.Data(), event.timestamp()); + if (ResoFlowSP == nullptr || ResoFlowEP == nullptr) { + LOGF(fatal, "Resolution factor is not available in CCDB at timestamp=%llu", event.timestamp()); + } + } fCurrentRun = event.runNumber(); } @@ -1234,6 +1256,11 @@ struct AnalysisSameEventPairing { VarManager::fgValues[VarManager::kMultDimuons] = mult_dimuons; } + + if (fConfigFlowReso) { + VarManager::FillEventFlowResoFactor(ResoFlowSP, ResoFlowEP); + } + bool isFirst = true; for (auto& [t1, t2] : combinations(tracks1, tracks2)) { if constexpr (TPairType == VarManager::kDecayToEE || TPairType == VarManager::kDecayToPiPi) { diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index e38e03d054a..349db4dd7a2 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -1571,9 +1571,9 @@ struct AnalysisSameEventPairing { } auto t1 = a1.template reducedtrack_as(); auto t2 = a2.template reducedtrack_as(); - VarManager::FillPairME(t1, t2); + VarManager::FillPairME(t1, t2); if constexpr ((TEventFillMap & VarManager::ObjTypes::ReducedEventQvector) > 0) { - VarManager::FillPairVn(t1, t2); + VarManager::FillPairVn(t1, t2); } pairSign = t1.sign() + t2.sign(); ncuts = fNCutsBarrel; @@ -1589,9 +1589,9 @@ struct AnalysisSameEventPairing { continue; if (t1.matchMFTTrackId() == t2.matchMFTTrackId()) continue; - VarManager::FillPairME(t1, t2); + VarManager::FillPairME(t1, t2); if constexpr ((TEventFillMap & VarManager::ObjTypes::ReducedEventQvector) > 0) { - VarManager::FillPairVn(t1, t2); + VarManager::FillPairVn(t1, t2); } pairSign = t1.sign() + t2.sign(); // store the ambiguity number of the two dilepton legs in the last 4 digits of the two-track filter diff --git a/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx b/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx index 7c960add267..d78ef01676c 100644 --- a/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx +++ b/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx @@ -862,7 +862,7 @@ struct AnalysisEventMixing { if (!twoTrackFilter) { // the tracks must have at least one filter bit in common to continue continue; } - VarManager::FillPairME(track1, track2); + VarManager::FillPairME(track1, track2); constexpr bool eventHasQvector = (VarManager::ObjTypes::ReducedEventQvector > 0); if constexpr (eventHasQvector) { From 0d918f2bcd6bc9360cb98e007cca7e4afda6f75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Mon, 25 Nov 2024 08:42:10 +0100 Subject: [PATCH 072/459] [PWGLF] Fix compilation warnings (#8386) Co-authored-by: ALICE Builder --- PWGLF/TableProducer/Common/spvector.cxx | 5 ---- PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx | 8 +++---- .../Converters/v0mlscoresconverter.cxx | 2 +- .../Strangeness/cascadebuilder.cxx | 4 +++- .../TableProducer/Strangeness/cascadeflow.cxx | 2 -- .../Strangeness/lambdakzerobuilder.cxx | 4 +++- .../Strangeness/lambdakzeromcfinder.cxx | 20 ++++++++-------- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 2 +- PWGLF/Tasks/Resonances/highmasslambda.cxx | 7 ------ PWGLF/Tasks/Resonances/kstarpbpb.cxx | 2 +- .../Tasks/Resonances/phianalysisrun3_PbPb.cxx | 2 +- .../Tasks/Strangeness/hStrangeCorrelation.cxx | 10 ++++---- PWGLF/Tasks/Strangeness/k0_mixed_events.cxx | 12 ++++++---- PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx | 6 ++++- PWGLF/Utils/svPoolCreator.h | 23 +++++++++++-------- 15 files changed, 54 insertions(+), 55 deletions(-) diff --git a/PWGLF/TableProducer/Common/spvector.cxx b/PWGLF/TableProducer/Common/spvector.cxx index 7afa0a23c20..5309156b345 100644 --- a/PWGLF/TableProducer/Common/spvector.cxx +++ b/PWGLF/TableProducer/Common/spvector.cxx @@ -422,11 +422,6 @@ struct spvector { qxZDCC = qxZDCC / sumC; qyZDCC = qyZDCC / sumC; } - } else { - qxZDCA = qxZDCA; - qxZDCC = qxZDCC; - qyZDCA = qyZDCA; - qyZDCC = qyZDCC; } if (sumA <= 1e-4 || sumC <= 1e-4) { qxZDCA = 0.0; diff --git a/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx b/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx index 0c042c5f84b..f83a2d990f1 100644 --- a/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx +++ b/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx @@ -82,13 +82,13 @@ namespace constexpr double betheBlochDefault[1][6]{{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}}; static const std::vector betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"}; -constexpr float he3Mass = o2::constants::physics::MassHelium3; -constexpr float protonMass = o2::constants::physics::MassProton; -constexpr float pionchargedMass = o2::constants::physics::MassPiPlus; +// constexpr float he3Mass = o2::constants::physics::MassHelium3; +// constexpr float protonMass = o2::constants::physics::MassProton; +// constexpr float pionchargedMass = o2::constants::physics::MassPiPlus; constexpr int li4PDG = 1000030040; constexpr int prPDG = 2212; constexpr int hePDG = 1000020030; -constexpr int pichargedPDG = 211; +// constexpr int pichargedPDG = 211; enum Selections { kNoCuts = 0, diff --git a/PWGLF/TableProducer/Strangeness/Converters/v0mlscoresconverter.cxx b/PWGLF/TableProducer/Strangeness/Converters/v0mlscoresconverter.cxx index f7e901e780f..9f2020bf20d 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/v0mlscoresconverter.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/v0mlscoresconverter.cxx @@ -26,7 +26,7 @@ struct v0mlscoresconverter { void process(aod::V0Cores const& v0cores) { - for (auto& values : v0cores) { + for (int64_t i = 0; i < v0cores.size(); ++i) { gammaMLSelections(-1); lambdaMLSelections(-1); antiLambdaMLSelections(-1); diff --git a/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx b/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx index ed2e5f32820..a9a41f83f8c 100644 --- a/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx @@ -36,6 +36,8 @@ // david.dobrigkeit.chinellato@cern.ch // +#include +#include #include #include #include @@ -2256,7 +2258,7 @@ struct cascadePreselector { void checkAndFinalize() { // parse + publish tag table now - for (int ii = 0; ii < selectionMask.size(); ii++) { + for (std::size_t ii = 0; ii < selectionMask.size(); ii++) { histos.fill(HIST("hPreselectorStatistics"), 0.0f); // All cascades bool validCascade = bitcheck(selectionMask[ii], bitTrackQuality); if (validCascade) { diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index 5ae3308785d..6e44fd5c803 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -916,7 +916,6 @@ struct cascadeFlow { histosMCGen.fill(HIST("hNEventsMC"), 4.5); int biggestNContribs = -1; - int bestCollisionIndex = -1; float centrality = 100.5f; int nCollisions = 0; for (auto const& coll : collisions) { @@ -925,7 +924,6 @@ struct cascadeFlow { } if (biggestNContribs < coll.multPVTotalContributors()) { biggestNContribs = coll.multPVTotalContributors(); - bestCollisionIndex = coll.globalIndex(); centrality = coll.centFT0C(); } nCollisions++; diff --git a/PWGLF/TableProducer/Strangeness/lambdakzerobuilder.cxx b/PWGLF/TableProducer/Strangeness/lambdakzerobuilder.cxx index d4a87d2f502..376b980a8b0 100644 --- a/PWGLF/TableProducer/Strangeness/lambdakzerobuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/lambdakzerobuilder.cxx @@ -36,6 +36,8 @@ // david.dobrigkeit.chinellato@cern.ch // +#include +#include #include #include #include @@ -1562,7 +1564,7 @@ struct lambdakzeroPreselector { void checkAndFinalize() { // parse + publish tag table now - for (int ii = 0; ii < selectionMask.size(); ii++) { + for (std::size_t ii = 0; ii < selectionMask.size(); ii++) { histos.fill(HIST("hPreselectorStatistics"), 0.0f); // all V0s bool validV0 = bitcheck(selectionMask[ii], bitTrackQuality); if (validV0) { diff --git a/PWGLF/TableProducer/Strangeness/lambdakzeromcfinder.cxx b/PWGLF/TableProducer/Strangeness/lambdakzeromcfinder.cxx index 86e71a80ae2..0a0db73ea6d 100644 --- a/PWGLF/TableProducer/Strangeness/lambdakzeromcfinder.cxx +++ b/PWGLF/TableProducer/Strangeness/lambdakzeromcfinder.cxx @@ -24,10 +24,18 @@ // david.dobrigkeit.chinellato@cern.ch // -#include #include #include #include +#include + +#include "Math/Vector4D.h" +#include +#include +#include +#include +#include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -50,14 +58,6 @@ #include "CommonConstants/PhysicsConstants.h" #include "PWGMM/Mult/DataModel/Index.h" // for Particles2Tracks table -#include -#include -#include -#include -#include -#include -#include - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -351,7 +351,7 @@ struct lambdakzeromcfinder { continue; // skip particles without decay mothers for (auto& posMotherParticle : posParticle.mothers_as()) { // determine if mother particle satisfies any condition curently being searched for - for (int ipdg = 0; ipdg < searchedV0PDG.size(); ipdg++) + for (std::size_t ipdg = 0; ipdg < searchedV0PDG.size(); ipdg++) if (searchedV0PDG[ipdg] == posMotherParticle.pdgCode() && fabs(posMotherParticle.y()) < yPreFilter) { v0pdgIndex = ipdg; // index mapping to desired V0 species motherIndex = posMotherParticle.globalIndex(); diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index a16e466f884..37c87eeaec0 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1124,7 +1124,7 @@ struct tofSpectra { } template - bool isTrackSelected(TrackType const& track, CollisionType const& collision) + bool isTrackSelected(TrackType const& track, CollisionType const& /*collision*/) { if constexpr (fillHistograms) { histos.fill(HIST("tracksel"), 1); diff --git a/PWGLF/Tasks/Resonances/highmasslambda.cxx b/PWGLF/Tasks/Resonances/highmasslambda.cxx index 9ef449cb83b..8afe10bd882 100644 --- a/PWGLF/Tasks/Resonances/highmasslambda.cxx +++ b/PWGLF/Tasks/Resonances/highmasslambda.cxx @@ -838,13 +838,6 @@ struct highmasslambda { } auto anglesign = (v0.x() - collision1.posX()) * v0.px() + (v0.y() - collision1.posY()) * v0.py() + (v0.z() - collision1.posZ()) * v0.pz(); anglesign = anglesign / TMath::Abs(anglesign); - auto dcasum = 0.0; - if (useSignDCAV0) { - dcasum = anglesign * (v0.dcav0topv()) - track1.dcaXY(); - } - if (!useSignDCAV0) { - dcasum = v0.dcav0topv() - track1.dcaXY(); - } if (occupancy1 < cfgOccupancyCut && occupancy2 < cfgOccupancyCut && Lambdac.M() > cMinLambdaMass && Lambdac.M() <= cMaxLambdaMass && TMath::Abs(Lambdac.Rapidity()) < confRapidity && Lambdac.Pt() > 2.0 && Lambdac.Pt() <= 6.0) { if (fillDefault) { diff --git a/PWGLF/Tasks/Resonances/kstarpbpb.cxx b/PWGLF/Tasks/Resonances/kstarpbpb.cxx index 712b2d411a3..2d507ba5dda 100644 --- a/PWGLF/Tasks/Resonances/kstarpbpb.cxx +++ b/PWGLF/Tasks/Resonances/kstarpbpb.cxx @@ -375,7 +375,7 @@ struct kstarpbpb { return result; } template - bool isFakeKaon(T const& track, int PID) + bool isFakeKaon(T const& track, int /*PID*/) { const auto pglobal = track.p(); const auto ptpc = track.tpcInnerParam(); diff --git a/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx b/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx index 9d41ffb6eaa..d3b249a65be 100644 --- a/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx +++ b/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx @@ -267,7 +267,7 @@ struct phianalysisrun3_PbPb { { return; } - float multiplicity; + float multiplicity{-1}; if (cfgMultFT0) multiplicity = collision.centFT0C(); histos.fill(HIST("hCentrality"), multiplicity); diff --git a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx index 01d843fa74e..4e16c31f995 100644 --- a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx @@ -1206,7 +1206,7 @@ struct correlateStrangeness { } } - void processMCGenerated(aod::McCollision const& mcCollision, soa::SmallGroups> const& collisions, aod::McParticles const& mcParticles) + void processMCGenerated(aod::McCollision const& /*mcCollision*/, soa::SmallGroups> const& collisions, aod::McParticles const& mcParticles) { histos.fill(HIST("hClosureTestEventCounter"), 2.5f); @@ -1349,7 +1349,7 @@ struct correlateStrangeness { }); } } - void processClosureTest(aod::McCollision const& mcCollision, soa::SmallGroups> const& recCollisions, aod::McParticles const& mcParticles) + void processClosureTest(aod::McCollision const& /*mcCollision*/, soa::SmallGroups> const& recCollisions, aod::McParticles const& mcParticles) { std::vector triggerIndices; @@ -1508,7 +1508,7 @@ struct correlateStrangeness { associatedIndices.emplace_back(omegaPlusIndices); associatedIndices.emplace_back(piIndices); - for (Int_t iTrigger = 0; iTrigger < triggerIndices.size(); iTrigger++) { + for (std::size_t iTrigger = 0; iTrigger < triggerIndices.size(); iTrigger++) { auto triggerParticle = mcParticles.iteratorAt(triggerIndices[iTrigger]); // check range of trigger particle if (triggerParticle.pt() > axisRanges[3][1] || triggerParticle.pt() < axisRanges[3][0]) { @@ -1518,10 +1518,10 @@ struct correlateStrangeness { Double_t gphitrigger = triggerParticle.phi(); Double_t pttrigger = triggerParticle.pt(); auto const& mother = triggerParticle.mothers_first_as(); - Int_t globalIndex = mother.globalIndex(); + auto globalIndex = mother.globalIndex(); static_for<0, 7>([&](auto i) { // associated loop constexpr int index = i.value; - for (Int_t iassoc = 0; iassoc < associatedIndices[index].size(); iassoc++) { + for (std::size_t iassoc = 0; iassoc < associatedIndices[index].size(); iassoc++) { auto assocParticle = mcParticles.iteratorAt(associatedIndices[index][iassoc]); if (triggerIndices[iTrigger] != associatedIndices[index][iassoc] && globalIndex != assocParticle.globalIndex()) { // avoid self Double_t getaassoc = assocParticle.eta(); diff --git a/PWGLF/Tasks/Strangeness/k0_mixed_events.cxx b/PWGLF/Tasks/Strangeness/k0_mixed_events.cxx index b76fbee0fa8..90ff4382b41 100644 --- a/PWGLF/Tasks/Strangeness/k0_mixed_events.cxx +++ b/PWGLF/Tasks/Strangeness/k0_mixed_events.cxx @@ -13,9 +13,14 @@ /// \author Sofia Tomassini, Gleb Romanenko, Nicolò Jacazio /// \since 31 May 2023 +#include +#include +#include +#include + #include #include -#include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -32,9 +37,6 @@ #include "PWGCF/Femto3D/DataModel/singletrackselector.h" #include "PWGCF/Femto3D/Core/femto3dPairTask.h" -#include "TLorentzVector.h" -#include "TDatabasePDG.h" - using namespace o2; using namespace o2::soa; using namespace o2::aod; @@ -297,7 +299,7 @@ struct K0MixedEvents { } registry.fill(HIST("Trks"), 1); - const float& vtxZ = track.singleCollSel_as().posZ(); + const float vtxZ = track.singleCollSel_as().posZ(); registry.fill(HIST("VTX"), vtxZ); if (std::abs(vtxZ) > _vertexZ) continue; diff --git a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx index 10049865bb5..6ca3f353e07 100644 --- a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx +++ b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx @@ -19,6 +19,10 @@ for different pt ranges (constituting bins), so 3x20=60 plots.The values are ins Plots of the invariant masses at different stages of the analysis (ex. before and after the V0 cuts are enforced) and some pt distributions. This analysis includes two processes, one for Real Data and one for MC Data switchable at the end of the code, only run one at a time*/ +#include +#include +#include + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Common/DataModel/EventSelection.h" @@ -193,7 +197,7 @@ struct v0ptinvmassplots { void RecMCprocess(soa::Filtered>::iterator const&, soa::Join const& V0s, DaughterTracks const&, // no need to define a variable for tracks, if we don't access them directly - aod::McParticles const& mcParticles) + aod::McParticles const& /*mcParticles*/) { for (const auto& v0 : V0s) { rPtAnalysis.fill(HIST("hV0PtAll"), v0.pt()); diff --git a/PWGLF/Utils/svPoolCreator.h b/PWGLF/Utils/svPoolCreator.h index ba78c417376..f4d98b2e304 100644 --- a/PWGLF/Utils/svPoolCreator.h +++ b/PWGLF/Utils/svPoolCreator.h @@ -29,7 +29,7 @@ using namespace o2::framework::expressions; using std::array; using CollBracket = o2::math_utils::Bracket; -constexpr auto bOffsetMax = 241; // track compatibility can never go beyond 6 mus (ITS) +constexpr uint64_t bOffsetMax = 241; // track compatibility can never go beyond 6 mus (ITS) struct TrackCand { int Idxtr; @@ -86,7 +86,8 @@ class svPoolCreator return; } bool isDau0 = pdgHypo == track0Pdg; - uint64_t globalBC = -1; + constexpr uint64_t BcInvalid = -1; + uint64_t globalBC = BcInvalid; if (trackCand.has_collision()) { if (trackCand.template collision_as().has_bc()) { globalBC = trackCand.template collision_as().template bc_as().globalBC(); @@ -97,17 +98,17 @@ class svPoolCreator continue; } if (!ambTrack.has_bc() || ambTrack.bc_as().size() == 0) { - globalBC = -1; + globalBC = BcInvalid; break; } globalBC = ambTrack.bc_as().begin().globalBC(); break; } } else { - globalBC = -1; + globalBC = BcInvalid; } - if (globalBC == -1) { + if (globalBC == BcInvalid) { return; } @@ -128,11 +129,13 @@ class svPoolCreator float collTimeRes2 = collision.collisionTimeRes() * collision.collisionTimeRes(); uint64_t collBC = collision.template bc_as().globalBC(); int collIdx = collision.globalIndex(); - int64_t bcOffset = globalBC - (int64_t)collBC; - if (std::abs(bcOffset) > bOffsetMax && bcOffset < 0) { - break; - } else if (std::abs(bcOffset) > bOffsetMax && bcOffset > 0) { - continue; + int64_t bcOffset = globalBC - static_cast(collBC); + if (static_cast(std::abs(bcOffset)) > bOffsetMax) { + if (bcOffset < 0) { + break; + } else if (bcOffset > 0) { + continue; + } } float trackTime{0.}; From 1a27b635e98fd6db26354148b12882c40a438a2b Mon Sep 17 00:00:00 2001 From: Roberta Ferioli <142217183+Roberta-Ferioli@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:01:17 +0100 Subject: [PATCH 073/459] [PWGLF] Create task for pt spectrum of 3He from hypertriton (#8602) --- PWGLF/Tasks/Nuspex/CMakeLists.txt | 5 + PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx | 121 +++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx diff --git a/PWGLF/Tasks/Nuspex/CMakeLists.txt b/PWGLF/Tasks/Nuspex/CMakeLists.txt index 3ab4d352396..afc9891eb3e 100644 --- a/PWGLF/Tasks/Nuspex/CMakeLists.txt +++ b/PWGLF/Tasks/Nuspex/CMakeLists.txt @@ -144,6 +144,11 @@ o2physics_add_dpl_workflow(ebye-mult PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(he3-from-hypertriton-map + SOURCES he3FromHypertritonMap.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + if(FastJet_FOUND) o2physics_add_dpl_workflow(angular-correlations-in-jets SOURCES AngularCorrelationsInJets.cxx diff --git a/PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx b/PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx new file mode 100644 index 00000000000..04175779501 --- /dev/null +++ b/PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx @@ -0,0 +1,121 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \author Roberta Ferioli (roberta.ferioli@cern.ch) +/// \since November, 2024 + +#include +#include +#include +#include +#include +#include +#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoA.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/DataTypes.h" +#include "ReconstructionDataFormats/Track.h" +#include "ReconstructionDataFormats/PID.h" +#include "ReconstructionDataFormats/DCA.h" +#include "Common/Core/trackUtilities.h" +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/PIDResponse.h" + +using namespace std; +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::constants::physics; +using std::array; + +using MCTracks = soa::Join; + +struct he3FromHypertritonMap { + HistogramRegistry registryMC{ + "registryMC", + {}, + OutputObjHandlingPolicy::AnalysisObject, + true, + true}; + + Configurable particle_of_interest{"particle_of_interest", 0, "0=antihelium3, 1=antihypertriton"}; + + // Track Parameters + Configurable min_ITS_nClusters{"min_ITS_nClusters", 7, "minimum number of found ITS clusters"}; + Configurable min_TPC_nClusters{"min_TPC_nClusters", 100, "minimum number of found TPC clusters"}; + Configurable min_TPC_nCrossedRows{"min_TPC_nCrossedRows", 70, "minimum number of TPC crossed pad rows"}; + Configurable max_chi2_TPC{"max_chi2_TPC", 4.0f, "maximum TPC chi^2/Ncls"}; + Configurable min_chi2_TPC{"min_chi2_ITS", 0.5f, "minimum TPC chi^2/Ncls"}; + Configurable min_eta{"min_eta", -0.8f, "minimum_eta"}; + Configurable max_eta{"max_eta", +0.8f, "maximum_eta"}; + Configurable max_dcaxy{"max_dcaxy", 0.05f, "Maximum DCAxy"}; + Configurable max_dcaz{"max_dcaz", 0.05f, "Maximum DCAz"}; + Configurable min_nsigmaTPC{"min_nsigmaTPC", -2.0f, "Minimum nsigma TPC"}; + Configurable max_nsigmaTPC{"max_nsigmaTPC", +2.0f, "Maximum nsigma TPC"}; + Configurable min_pt{"min_pt", 0.0f, "minimum pt of the tracks"}; + Configurable max_pt{"max_pt", 10.0f, "maximum pt of the tracks"}; + Configurable nbin_pt{"nbin_pt", 50, "number of pt bins"}; + + int AntihePDG = -1000020030; + int AntiHypertritonPDG = -1010010030; + + void init(InitContext const&) + { + registryMC.add("he3SecPtRec", "he3SecPtRec", HistType::kTH1F, {{nbin_pt, min_pt, max_pt, "p_{T} (GeV/c)"}}); + registryMC.add("hypertritonPtgen", "hypertritonPtGen", HistType::kTH1F, {{nbin_pt, min_pt, max_pt, "p_{T} (GeV/c)"}}); + } + + void processMC(aod::McParticles const& mcParticles, const MCTracks& tracks) + { + for (const auto& track : tracks) { + if (!track.has_mcParticle()) { + continue; + } + auto mcparticle = track.mcParticle(); + if (mcparticle.pdgCode() != AntihePDG || mcparticle.isPhysicalPrimary()) { + continue; + } + + for (auto& motherparticle : mcparticle.mothers_as()) { + if (motherparticle.pdgCode() == AntiHypertritonPDG) { + if (track.itsNCls() < min_ITS_nClusters || + track.tpcNClsFound() < min_TPC_nClusters || + track.tpcNClsCrossedRows() < min_TPC_nCrossedRows || + track.tpcNClsCrossedRows() < 0.8 * track.tpcNClsFindable() || + track.tpcChi2NCl() > 4.f || + track.tpcChi2NCl() < min_chi2_TPC || + track.eta() < min_eta || track.eta() > max_eta || + track.dcaXY() > max_dcaxy || track.dcaXY() < -max_dcaxy || + track.dcaZ() > max_dcaz || track.dcaZ() < -max_dcaz || + track.itsChi2NCl() > 36.f) { + continue; + } + registryMC.fill(HIST("he3SecPtRec"), track.pt()); + registryMC.fill(HIST("hypertritonPtgen"), motherparticle.pt()); + } + } + } + } + PROCESS_SWITCH(he3FromHypertritonMap, processMC, "Process MC", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 5de547eb2d87d88c25d7329dc43ed0f929e59359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 25 Nov 2024 10:46:05 +0100 Subject: [PATCH 074/459] [PWGCF] Add PID with ITS to STS (#8441) Co-authored-by: ALICE Builder --- PWGCF/Femto3D/DataModel/singletrackselector.h | 32 +++++++++++ .../TableProducer/singleTrackSelector.cxx | 56 +++++++++++++++---- 2 files changed, 78 insertions(+), 10 deletions(-) diff --git a/PWGCF/Femto3D/DataModel/singletrackselector.h b/PWGCF/Femto3D/DataModel/singletrackselector.h index afb4fc3f615..a49293f1b7a 100644 --- a/PWGCF/Femto3D/DataModel/singletrackselector.h +++ b/PWGCF/Femto3D/DataModel/singletrackselector.h @@ -208,15 +208,35 @@ DECLARE_SOA_COLUMN(StoredTPCNSigmaHe, storedTpcNSigmaHe, binning::nsigma::binned DECLARE_SOA_COLUMN(StoredTOFNSigmaPi_v1, storedTofNSigmaPi_v1, binning::nsigma::binned_t); // (v1) DECLARE_SOA_COLUMN(StoredTPCNSigmaPi_v1, storedTpcNSigmaPi_v1, binning::nsigma::binned_t); // (v1) + DECLARE_SOA_COLUMN(StoredTOFNSigmaKa_v1, storedTofNSigmaKa_v1, binning::nsigma::binned_t); // (v1) DECLARE_SOA_COLUMN(StoredTPCNSigmaKa_v1, storedTpcNSigmaKa_v1, binning::nsigma::binned_t); // (v1) + DECLARE_SOA_COLUMN(StoredTOFNSigmaPr_v1, storedTofNSigmaPr_v1, binning::nsigma::binned_t); // (v1) DECLARE_SOA_COLUMN(StoredTPCNSigmaPr_v1, storedTpcNSigmaPr_v1, binning::nsigma::binned_t); // (v1) + DECLARE_SOA_COLUMN(StoredTOFNSigmaDe_v1, storedTofNSigmaDe_v1, binning::nsigma::binned_t); // (v1) DECLARE_SOA_COLUMN(StoredTPCNSigmaDe_v1, storedTpcNSigmaDe_v1, binning::nsigma::binned_t); // (v1) + DECLARE_SOA_COLUMN(StoredTOFNSigmaHe_v1, storedTofNSigmaHe_v1, binning::nsigma::binned_t); // (v1) DECLARE_SOA_COLUMN(StoredTPCNSigmaHe_v1, storedTpcNSigmaHe_v1, binning::nsigma::binned_t); // (v1) +DECLARE_SOA_COLUMN(StoredITSNSigmaPi_v1, storedItsNSigmaPi_v1, binning::nsigma::binned_t); // (v1) +DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaPi_v1, itsNSigmaPi, + [](binning::nsigma_v1::binned_t nsigma_binned) -> float { return singletrackselector::unPackSymmetric(nsigma_binned); }); +DECLARE_SOA_COLUMN(StoredITSNSigmaKa_v1, storedItsNSigmaKa_v1, binning::nsigma::binned_t); // (v1) +DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaKa_v1, itsNSigmaKa, + [](binning::nsigma_v1::binned_t nsigma_binned) -> float { return singletrackselector::unPackSymmetric(nsigma_binned); }); +DECLARE_SOA_COLUMN(StoredITSNSigmaPr_v1, storedItsNSigmaPr_v1, binning::nsigma::binned_t); // (v1) +DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaPr_v1, itsNSigmaPr, + [](binning::nsigma_v1::binned_t nsigma_binned) -> float { return singletrackselector::unPackSymmetric(nsigma_binned); }); +DECLARE_SOA_COLUMN(StoredITSNSigmaDe_v1, storedItsNSigmaDe_v1, binning::nsigma::binned_t); // (v1) +DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaDe_v1, itsNSigmaDe, + [](binning::nsigma_v1::binned_t nsigma_binned) -> float { return singletrackselector::unPackSymmetric(nsigma_binned); }); +DECLARE_SOA_COLUMN(StoredITSNSigmaHe_v1, storedItsNSigmaHe_v1, binning::nsigma::binned_t); // (v1) +DECLARE_SOA_DYNAMIC_COLUMN(ITSNSigmaHe_v1, itsNSigmaHe, + [](binning::nsigma_v1::binned_t nsigma_binned) -> float { return singletrackselector::unPackSymmetric(nsigma_binned); }); + DECLARE_SOA_DYNAMIC_COLUMN(Energy, energy, [](float p, float mass) -> float { return sqrt(p * p + mass * mass); }); DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float p, float eta) -> float { return p / std::cosh(eta); }); DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float p, float eta, float phi) -> float { return (p / std::cosh(eta)) * std::sin(phi); }); @@ -487,6 +507,18 @@ DECLARE_SOA_TABLE(SinglePIDEls, "AOD", "SINGLEPIDEL", singletrackselector::StoredTPCNSigmaEl, singletrackselector::TPCNSigmaEl); +DECLARE_SOA_TABLE(SinglePIDsITSPi, "AOD", "STSPIDITSPI", + singletrackselector::StoredITSNSigmaPi_v1, + singletrackselector::ITSNSigmaPi_v1); + +DECLARE_SOA_TABLE(SinglePIDsITSKa, "AOD", "STSPIDITSKA", + singletrackselector::StoredITSNSigmaKa_v1, + singletrackselector::ITSNSigmaKa_v1); + +DECLARE_SOA_TABLE(SinglePIDsITSPr, "AOD", "STSPIDITSPR", + singletrackselector::StoredITSNSigmaPr_v1, + singletrackselector::ITSNSigmaPr_v1); + namespace singletrackselector { DECLARE_SOA_COLUMN(PdgCode, pdgCode, int); diff --git a/PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx b/PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx index 0bec4d3cf40..538daf6cbb2 100644 --- a/PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx +++ b/PWGCF/Femto3D/TableProducer/singleTrackSelector.cxx @@ -17,6 +17,8 @@ #include #include +#include +#include #include "EventFiltering/Zorro.h" #include "EventFiltering/ZorroSummary.h" @@ -30,6 +32,7 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/PIDResponseITS.h" #include "Common/CCDB/ctpRateFetcher.h" #include "DetectorsBase/Propagator.h" @@ -98,6 +101,9 @@ struct singleTrackSelector { Produces tableRow; Produces tableRowExtra; Produces tableRowPIDEl; + Produces tableRowPIDITSPi; + Produces tableRowPIDITSKa; + Produces tableRowPIDITSPr; Produces tableRowMC; Filter eventFilter = (applyEvSel.node() == 0) || @@ -187,8 +193,8 @@ struct singleTrackSelector { d_bz = 0.1 * d_bz; } - template - inline void fillTrackTables(Trks const& tracks) + template + inline void fillTrackTables(TracksType const& tracks) { bool skip_track = false; // flag used for track rejection @@ -248,6 +254,9 @@ struct singleTrackSelector { track.beta()); tableRowPIDEl(singletrackselector::packSymmetric(track.tpcNSigmaEl())); + tableRowPIDITSPi(singletrackselector::packSymmetric(track.itsNSigmaPi())); + tableRowPIDITSKa(singletrackselector::packSymmetric(track.itsNSigmaKa())); + tableRowPIDITSPr(singletrackselector::packSymmetric(track.itsNSigmaPr())); if constexpr (isMC) { int origin = -1; @@ -274,8 +283,15 @@ struct singleTrackSelector { } } - void processDataRun2(soa::Filtered::iterator const& collision, soa::Filtered const& tracks, aod::BCsWithTimestamps const&) + void processDataRun2(soa::Filtered::iterator const& collision, + soa::Filtered const& tracks, + aod::BCsWithTimestamps const&) { + + auto tracksWithITSPid = soa::Attach(tracks); auto bc = collision.bc_as(); initCCDB(bc); @@ -304,13 +320,19 @@ struct singleTrackSelector { collision.posZ(), d_bz); - fillTrackTables(tracks); + fillTrackTables(tracksWithITSPid); } } PROCESS_SWITCH(singleTrackSelector, processDataRun2, "process data Run2", false); - void processDataRun3(soa::Filtered::iterator const& collision, soa::Filtered const& tracks, aod::BCsWithTimestamps const&) + void processDataRun3(soa::Filtered::iterator const& collision, + soa::Filtered const& tracks, + aod::BCsWithTimestamps const&) { + auto tracksWithITSPid = soa::Attach(tracks); auto bc = collision.bc_as(); initCCDB(bc); @@ -381,13 +403,20 @@ struct singleTrackSelector { hadronicRate, occupancy); - fillTrackTables(tracks); + fillTrackTables(tracksWithITSPid); } } PROCESS_SWITCH(singleTrackSelector, processDataRun3, "process data Run3", true); - void processMCRun2(soa::Filtered::iterator const& collision, soa::Filtered> const& tracks, aod::McParticles const&, aod::BCsWithTimestamps const&) + void processMCRun2(soa::Filtered::iterator const& collision, + soa::Filtered> const& tracks, + aod::McParticles const&, aod::BCsWithTimestamps const&) { + + auto tracksWithITSPid = soa::Attach, + aod::pidits::ITSNSigmaPi, + aod::pidits::ITSNSigmaKa, + aod::pidits::ITSNSigmaPr>(tracks); auto bc = collision.bc_as(); initCCDB(bc); @@ -415,13 +444,20 @@ struct singleTrackSelector { collision.posZ(), d_bz); - fillTrackTables(tracks); + fillTrackTables(tracksWithITSPid); } } PROCESS_SWITCH(singleTrackSelector, processMCRun2, "process MC Run2", false); - void processMCRun3(soa::Filtered::iterator const& collision, aod::McCollisions const&, soa::Filtered> const& tracks, aod::McParticles const& mcParticles, aod::BCsWithTimestamps const&) + void processMCRun3(soa::Filtered::iterator const& collision, aod::McCollisions const&, + soa::Filtered> const& tracks, + aod::McParticles const& mcParticles, + aod::BCsWithTimestamps const&) { + auto tracksWithITSPid = soa::Attach, + aod::pidits::ITSNSigmaPi, + aod::pidits::ITSNSigmaKa, + aod::pidits::ITSNSigmaPr>(tracks); auto bc = collision.bc_as(); initCCDB(bc); double hadronicRate = 0.; @@ -483,7 +519,7 @@ struct singleTrackSelector { hadronicRate, occupancy); - fillTrackTables(tracks); + fillTrackTables(tracksWithITSPid); if (!enable_gen_info) { return; From 64e038873fd79c9f32ace35b760daf542e91fa9d Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Mon, 25 Nov 2024 12:26:34 +0100 Subject: [PATCH 075/459] [PWGDQ] Adding checks for M11 and M1111 weights for cumulants calculation (#8606) --- PWGDQ/Core/VarManager.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 8d0a1805063..8c18ab0394a 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -4018,6 +4018,10 @@ void VarManager::FillQVectorFromGFW(C const& /*collision*/, A const& compA11, A values[kCORR4REF] = (pow(norm(compA21), 2) + norm(compA42) - 2. * (compA42 * conj(compA21) * conj(compA21)).real() + 8. * (compA23 * conj(compA21)).real() - 4. * S12A * norm(compA21) - 6. * S14A - 2. * S22A) / values[kM1111REF]; values[kCORR2REF] = std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) ? 0 : values[kCORR2REF]; values[kCORR4REF] = std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kCORR4REF]; + values[kM11REF] = std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) ? 0 : values[kM11REF]; + values[kM1111REF] = std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) ? 0 : values[kM1111REF]; + values[kM11REF] = std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) ? 0 : values[kM11REF]; + values[kM1111REF] = std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kM1111REF]; values[kCORR2REFw] = values[kCORR2REF] * values[kM11REF]; values[kCORR2REFsquared] = values[kCORR2REF] * values[kCORR2REF]; values[kCORR2REFsquaredw] = values[kCORR2REF] * values[kCORR2REF] * values[kM11REF]; From 147206ee9c39b42e4c65b239df7e326534817174 Mon Sep 17 00:00:00 2001 From: Chiara Date: Mon, 25 Nov 2024 15:16:03 +0100 Subject: [PATCH 076/459] [PWGCF] Updating to allow for a minimum cut value in multiplicity (#8574) --- PWGCF/TableProducer/filterCorrelations.cxx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/PWGCF/TableProducer/filterCorrelations.cxx b/PWGCF/TableProducer/filterCorrelations.cxx index 9cbde25a20c..2eb718a5f02 100644 --- a/PWGCF/TableProducer/filterCorrelations.cxx +++ b/PWGCF/TableProducer/filterCorrelations.cxx @@ -63,6 +63,7 @@ struct FilterCF { O2_DEFINE_CONFIGURABLE(cfgCollisionFlags, uint16_t, aod::collision::CollisionFlagsRun2::Run2VertexerTracks, "Request collision flags if non-zero (0 = off, 1 = Run2VertexerTracks)") O2_DEFINE_CONFIGURABLE(cfgTransientTables, bool, false, "Output transient tables for collision and track IDs") O2_DEFINE_CONFIGURABLE(cfgTrackSelection, int, 0, "Type of track selection (0 = Run 2/3 without systematics | 1 = Run 3 with systematics)") + O2_DEFINE_CONFIGURABLE(cfgMinMultiplicity, float, -1, "Minimum multiplicity considered for filtering (if value positive)") // Filters and input definitions Filter collisionZVtxFilter = nabs(aod::collision::posZ) < cfgCutVertex; @@ -92,22 +93,26 @@ struct FilterCF { template bool keepCollision(TCollision& collision) { + bool isMultSelected = false; + if (collision.multiplicity() >= cfgMinMultiplicity) + isMultSelected = true; + if (cfgTrigger == 0) { return true; } else if (cfgTrigger == 7) { - return collision.alias_bit(kINT7) && collision.sel7(); + return isMultSelected && collision.alias_bit(kINT7) && collision.sel7(); } else if (cfgTrigger == 8) { - return collision.sel8(); + return isMultSelected && collision.sel8(); } else if (cfgTrigger == 9) { // relevant only for Pb-Pb - return collision.sel8() && collision.selection_bit(aod::evsel::kNoSameBunchPileup) && collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV); + return isMultSelected && collision.sel8() && collision.selection_bit(aod::evsel::kNoSameBunchPileup) && collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV); } else if (cfgTrigger == 10) { // TVX trigger only (sel8 selection before April, 2024) - return collision.selection_bit(aod::evsel::kIsTriggerTVX); + return isMultSelected && collision.selection_bit(aod::evsel::kIsTriggerTVX); } else if (cfgTrigger == 11) { // sel8 selection for MC - return collision.selection_bit(aod::evsel::kIsTriggerTVX) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder); + return isMultSelected && collision.selection_bit(aod::evsel::kIsTriggerTVX) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder); } else if (cfgTrigger == 12) { // relevant only for Pb-Pb with occupancy cuts and rejection of the collisions which have other events nearby int occupancy = collision.trackOccupancyInTimeRange(); if (occupancy >= 0 && occupancy < 500) - return collision.sel8() && collision.selection_bit(aod::evsel::kNoSameBunchPileup) && collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && collision.selection_bit(aod::evsel::kNoCollInTimeRangeStandard); + return isMultSelected && collision.sel8() && collision.selection_bit(aod::evsel::kNoSameBunchPileup) && collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && collision.selection_bit(aod::evsel::kNoCollInTimeRangeStandard); else return false; } From 3cae78c4bc6a09ad365d513c635505f8444720c6 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Mon, 25 Nov 2024 16:03:55 +0100 Subject: [PATCH 077/459] [PWGLF] ebyeMaker: check correlation cuts for nuclei ebye analysis (#8629) --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index e00ff5476a8..f6efa86fc3a 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -185,6 +185,12 @@ struct tagRun2V0MCalibration { TFormula* mMCScale = nullptr; } Run2V0MInfo; +struct tagRun2CL0Calibration { + bool mCalibrationStored = false; + TH1* mhVtxAmpCorr = nullptr; + TH1* mhMultSelCalib = nullptr; +} Run2CL0Info; + struct ebyeMaker { Produces collisionEbyeTable; Produces miniCollTable; @@ -412,6 +418,13 @@ struct ebyeMaker { } else { LOGF(fatal, "Calibration information from V0M for run %d corrupted", bc.runNumber()); } + Run2CL0Info.mhVtxAmpCorr = getccdb("hVtx_fnSPDClusters0_Normalized"); + Run2CL0Info.mhMultSelCalib = getccdb("hMultSelCalib_CL0"); + if ((Run2CL0Info.mhVtxAmpCorr != nullptr) && (Run2CL0Info.mhMultSelCalib != nullptr)) { + Run2CL0Info.mCalibrationStored = true; + } else { + LOGF(fatal, "Calibration information from CL0 multiplicity for run %d corrupted", bc.runNumber()); + } } else { auto grpmagPath{"GLO/Config/GRPMagField"}; grpmag = ccdb->getForTimeStamp("GLO/Config/GRPMagField", timestamp); @@ -1004,7 +1017,7 @@ struct ebyeMaker { } PROCESS_SWITCH(ebyeMaker, processRun3, "process (Run 3)", false); - void processRun2(soa::Join const& collisions, TracksFull const& tracks, aod::V0s const& V0s, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, BCsWithRun2Info const&) + void processRun2(soa::Join const& collisions, TracksFull const& tracks, aod::V0s const& V0s, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, BCsWithRun2Info const&) { for (const auto& collision : collisions) { auto bc = collision.bc_as(); @@ -1024,7 +1037,11 @@ struct ebyeMaker { if (!(collision.sel7() && collision.alias_bit(kINT7)) && (!kINT7Intervals || (kINT7Intervals && ((cV0M >= 10 && cV0M < 30) || cV0M > 50)))) continue; - auto centralityCl0 = collision.centRun2CL0(); + auto centralityCl0 = 105.0f; + if (Run2CL0Info.mCalibrationStored) { + float cl0m = bc.spdClustersL0() * Run2CL0Info.mhVtxAmpCorr->GetBinContent(Run2CL0Info.mhVtxAmpCorr->FindFixBin(collision.posZ())); + centralityCl0 = Run2CL0Info.mhMultSelCalib->GetBinContent(Run2CL0Info.mhMultSelCalib->FindFixBin(cl0m)); + } if (kUseEstimatorsCorrelationCut) { const auto& x = centralityCl0; const double center = estimatorsCorrelationCoef[0] + estimatorsCorrelationCoef[1] * x; From 0322f406ae3e1c8030c0ca68fe38a135aa0ba35f Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Mon, 25 Nov 2024 16:04:49 +0100 Subject: [PATCH 078/459] [Common] add track extra converter to v002 (#8611) --- .../TableProducer/Converters/CMakeLists.txt | 5 + .../Converters/tracksExtraV002Converter.cxx | 105 ++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 Common/TableProducer/Converters/tracksExtraV002Converter.cxx diff --git a/Common/TableProducer/Converters/CMakeLists.txt b/Common/TableProducer/Converters/CMakeLists.txt index aedc7257229..8f48851df90 100644 --- a/Common/TableProducer/Converters/CMakeLists.txt +++ b/Common/TableProducer/Converters/CMakeLists.txt @@ -24,6 +24,11 @@ o2physics_add_dpl_workflow(tracks-extra-converter PUBLIC_LINK_LIBRARIES COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(tracks-extra-v002-converter + SOURCES tracksExtraV002Converter.cxx + PUBLIC_LINK_LIBRARIES + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(mft-tracks-converter SOURCES mftTracksConverter.cxx PUBLIC_LINK_LIBRARIES diff --git a/Common/TableProducer/Converters/tracksExtraV002Converter.cxx b/Common/TableProducer/Converters/tracksExtraV002Converter.cxx new file mode 100644 index 00000000000..51d06085809 --- /dev/null +++ b/Common/TableProducer/Converters/tracksExtraV002Converter.cxx @@ -0,0 +1,105 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" + +using namespace o2; +using namespace o2::framework; + +struct TracksExtraV002Converter { + Produces tracksExtra_002; + + void processV000ToV002(aod::TracksExtra_000 const& tracksExtra_000) + { + + for (const auto& track0 : tracksExtra_000) { + + uint32_t itsClusterSizes = 0; + for (int layer = 0; layer < 7; layer++) { + if (track0.itsClusterMap() & (1 << layer)) { + itsClusterSizes |= (0xf << (layer * 4)); + } + } + + int8_t TPCNClsFindableMinusPID = 0; + + tracksExtra_002(track0.tpcInnerParam(), + track0.flags(), + itsClusterSizes, + track0.tpcNClsFindable(), + track0.tpcNClsFindableMinusFound(), + TPCNClsFindableMinusPID, + track0.tpcNClsFindableMinusCrossedRows(), + track0.tpcNClsShared(), + track0.trdPattern(), + track0.itsChi2NCl(), + track0.tpcChi2NCl(), + track0.trdChi2(), + track0.tofChi2(), + track0.tpcSignal(), + track0.trdSignal(), + track0.length(), + track0.tofExpMom(), + track0.trackEtaEmcal(), + track0.trackPhiEmcal(), + track0.trackTime(), + track0.trackTimeRes()); + } + } + PROCESS_SWITCH(TracksExtraV002Converter, processV000ToV002, "process v000-to-v002 conversion", false); + + void processV001ToV002(aod::TracksExtra_001 const& tracksExtra_001) + { + + for (const auto& track1 : tracksExtra_001) { + + int8_t TPCNClsFindableMinusPID = 0; + + tracksExtra_002(track1.tpcInnerParam(), + track1.flags(), + track1.itsClusterSizes(), + track1.tpcNClsFindable(), + track1.tpcNClsFindableMinusFound(), + TPCNClsFindableMinusPID, + track1.tpcNClsFindableMinusCrossedRows(), + track1.tpcNClsShared(), + track1.trdPattern(), + track1.itsChi2NCl(), + track1.tpcChi2NCl(), + track1.trdChi2(), + track1.tofChi2(), + track1.tpcSignal(), + track1.trdSignal(), + track1.length(), + track1.tofExpMom(), + track1.trackEtaEmcal(), + track1.trackPhiEmcal(), + track1.trackTime(), + track1.trackTimeRes()); + } + } + PROCESS_SWITCH(TracksExtraV002Converter, processV001ToV002, "process v001-to-v002 conversion", false); +}; + +/// Spawn the extended table for TracksExtra002 to avoid the call to the internal spawner and a consequent circular dependency +struct TracksExtraSpawner { + Spawns tracksExtra_002; +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), + }; +} From 1736776a2a59a847bd398c504d6e5f6ced26b8a6 Mon Sep 17 00:00:00 2001 From: Katarzyna <116073883+kgwizdzi@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:05:09 +0100 Subject: [PATCH 079/459] [PWGCF] FemtoUniverse - D0 task update (#8610) --- .../femtoUniverseProducerTask.cxx | 1 - .../Tasks/femtoUniversePairTaskTrackD0.cxx | 50 ++++++------------- 2 files changed, 14 insertions(+), 37 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 2482c592275..b2438f3a1b4 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -779,7 +779,6 @@ struct femtoUniverseProducerTask { if (!colCuts.isSelected(col)) { return; } - if (!ConfIsUsePileUp) { if (ConfDoSpher) { outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx index f377c2aaa90..273ff0e629e 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx @@ -111,6 +111,8 @@ struct femtoUniversePairTaskTrackD0 { Configurable ConfPIDTrack{"ConfPIDTrack", 2, "Particle 2 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> Configurable ConfTrackSign{"ConfTrackSign", 1, "Track sign"}; Configurable ConfIsTrackIdentified{"ConfIsTrackIdentified", true, "Enable PID for the track"}; + Configurable ConfTrackLowPtCut{"ConfTrackLowPtCut", 0.5, "Low pT cut of the track"}; + Configurable ConfTrackHighPtCut{"ConfTrackHighPtCut", 2.5, "High pT cut of the track"}; } ConfTrack; /// Particle 2 --- D0/D0bar meson @@ -133,23 +135,22 @@ struct femtoUniversePairTaskTrackD0 { } ConfD0D0barSideBand; Configurable> binsPt{"binsPt", std::vector{hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits"}; - Configurable ConfChooseD0trackCorr{"ConfChooseD0trackCorr", 3, "If 0 - only D0s, 1 - only D0bars, 2 - D0/D0bar (one mass hypo.), 3 - all D0/D0bar cand."}; - Configurable ConfUsePtCutForD0D0bar{"ConfUsePtCutForD0D0bar", false, "Include pT cut for D0/D0bar in same and mixed processes."}; + Configurable ConfChooseD0trackCorr{"ConfChooseD0trackCorr", 3, "If 0 - only D0s, 1 - only D0bars, 2 - D0/D0bar (one mass hypo.), 3 - all D0/D0bar cand."}; Configurable ConfUseMassCutForD0D0bar{"ConfUseMassCutForD0D0bar", false, "Switch to save D0/D0bar within declared inv. mass range"}; /// Partitions for particle 1 - Partition partsTrack = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == int8_t(ConfTrack.ConfTrackSign)); + Partition partsTrack = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == int8_t(ConfTrack.ConfTrackSign)) && (aod::femtouniverseparticle::pt > ConfTrack.ConfTrackLowPtCut) && (aod::femtouniverseparticle::pt < ConfTrack.ConfTrackHighPtCut); Partition> partsTrackMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)); /// Partitions for particle 2 - /// Partition with all D0/D0bar mesons (which pass double and one mass hypothesis) - Partition partsAllDmesons = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)); + /// Partition with all D0/D0bar mesons (which pass double mass hypothesis) + Partition partsAllDmesons = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda > 0.0f) && (aod::femtouniverseparticle::mAntiLambda > 0.0f); /// Partition with D0/D0bar candidates, which pass only one mass hypothesis Partition partsOnlyD0D0bar = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda < 0.0f || aod::femtouniverseparticle::mAntiLambda < 0.0f); /// Partition with D0 mesons only (one mass hypothesis) - Partition partsD0s = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda > 0.0f) && (aod::femtouniverseparticle::mAntiLambda < 0.0f); + Partition partsD0s = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda > 0.0f) && (aod::femtouniverseparticle::mAntiLambda < 0.0f) && (aod::femtouniverseparticle::pt > ConfDmesons.ConfMinPtD0D0bar) && (aod::femtouniverseparticle::pt < ConfDmesons.ConfMaxPtD0D0bar); /// Partition with D0bar mesons only (one mass hypothesis) - Partition partsD0bars = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda < 0.0f) && (aod::femtouniverseparticle::mAntiLambda > 0.0f); + Partition partsD0bars = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda < 0.0f) && (aod::femtouniverseparticle::mAntiLambda > 0.0f) && (aod::femtouniverseparticle::pt > ConfDmesons.ConfMinPtD0D0bar) && (aod::femtouniverseparticle::pt < ConfDmesons.ConfMaxPtD0D0bar); /// Partition for D0/D0bar mesons from MC Partition> partsD0D0barMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)); @@ -403,9 +404,8 @@ struct femtoUniversePairTaskTrackD0 { // D0/D0bar histograms auto vbins = (std::vector)binsPt; - registry.add("hMassVsPt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {ConfInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassVsPtFinerBinning", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {ConfInvMassFinerBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hInvMassVsPtOnlyD0D0bar", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {ConfInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("D0D0bar_oneMassHypo/hMassVsPt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {ConfInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("D0D0bar_oneMassHypo/hMassVsPtFinerBinning", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {ConfInvMassFinerBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hDeltaPhiSigSig", "SxS correlation;#Delta#varphi (rad);counts", {HistType::kTH1F, {{10, 0.0, o2::constants::math::PI}}}); registry.add("hDeltaPhiD0BgD0barSig", "B(D0)x S(D0bar) correlation;#Delta#varphi (rad);counts", {HistType::kTH1F, {{10, 0.0, o2::constants::math::PI}}}); registry.add("hDeltaPhiD0SigD0barBg", "S(D0)x B(D0bar) correlation;#Delta#varphi (rad);counts", {HistType::kTH1F, {{10, 0.0, o2::constants::math::PI}}}); @@ -430,16 +430,6 @@ struct femtoUniversePairTaskTrackD0 { // loop over all D mesons for (auto const& dmeson : groupPartsAllDmesons) { - if (dmeson.mLambda() > 0.0f) { - registry.fill(HIST("hMassVsPt"), dmeson.mLambda(), dmeson.pt()); - registry.fill(HIST("hMassVsPtFinerBinning"), dmeson.mLambda(), dmeson.pt()); - } - - if (dmeson.mAntiLambda() > 0.0f) { - registry.fill(HIST("hMassVsPt"), dmeson.mAntiLambda(), dmeson.pt()); - registry.fill(HIST("hMassVsPtFinerBinning"), dmeson.mAntiLambda(), dmeson.pt()); - } - registry.fill(HIST("hPtDmesonCand"), dmeson.pt()); registry.fill(HIST("hPhiDmesonCand"), dmeson.phi()); registry.fill(HIST("hEtaDmesonCand"), dmeson.eta()); @@ -451,7 +441,7 @@ struct femtoUniversePairTaskTrackD0 { registry.fill(HIST("hPtD0D0bar"), d0d0bar.pt()); if (d0d0bar.mLambda() > 0.0f && d0d0bar.mAntiLambda() < 0.0f) { - registry.fill(HIST("hInvMassVsPtOnlyD0D0bar"), d0d0bar.mLambda(), d0d0bar.pt()); + registry.fill(HIST("D0D0bar_oneMassHypo/hMassVsPt"), d0d0bar.mLambda(), d0d0bar.pt()); if (d0d0bar.mLambda() > ConfDmesons.ConfMinInvMassD0D0bar && d0d0bar.mLambda() < ConfDmesons.ConfMaxInvMassD0D0bar) { registry.fill(HIST("hInvMassD0"), d0d0bar.mLambda()); } @@ -460,7 +450,7 @@ struct femtoUniversePairTaskTrackD0 { registry.fill(HIST("hEtaD0"), d0d0bar.eta()); } if (d0d0bar.mLambda() < 0.0f && d0d0bar.mAntiLambda() > 0.0f) { - registry.fill(HIST("hInvMassVsPtOnlyD0D0bar"), d0d0bar.mAntiLambda(), d0d0bar.pt()); + registry.fill(HIST("D0D0bar_oneMassHypo/hMassVsPt"), d0d0bar.mAntiLambda(), d0d0bar.pt()); if (d0d0bar.mAntiLambda() > ConfDmesons.ConfMinInvMassD0D0bar && d0d0bar.mAntiLambda() < ConfDmesons.ConfMaxInvMassD0D0bar) { registry.fill(HIST("hInvMassD0bar"), d0d0bar.mAntiLambda()); } @@ -611,15 +601,9 @@ struct femtoUniversePairTaskTrackD0 { continue; } } - // // Set pT cut for D0/D0bar candidates - if (ConfUsePtCutForD0D0bar) { - if (d0candidate.pt() < ConfDmesons.ConfMinPtD0D0bar && d0candidate.pt() > ConfDmesons.ConfMaxPtD0D0bar) { - continue; - } - } // // Set inv. mass cut for D0/D0bar candidates if (ConfUseMassCutForD0D0bar) { - if ((d0candidate.mLambda() < ConfD0D0barSideBand.ConfSignalRegionMin && d0candidate.mLambda() > ConfD0D0barSideBand.ConfSignalRegionMax) || (d0candidate.mAntiLambda() < ConfD0D0barSideBand.ConfSignalRegionMin && d0candidate.mAntiLambda() > ConfD0D0barSideBand.ConfSignalRegionMax)) { + if ((d0candidate.mLambda() < ConfD0D0barSideBand.ConfSignalRegionMin || d0candidate.mLambda() > ConfD0D0barSideBand.ConfSignalRegionMax) || (d0candidate.mAntiLambda() < ConfD0D0barSideBand.ConfSignalRegionMin || d0candidate.mAntiLambda() > ConfD0D0barSideBand.ConfSignalRegionMax)) { continue; } } @@ -708,15 +692,9 @@ struct femtoUniversePairTaskTrackD0 { continue; } } - // // Set pT cut for D0/D0bar candidates - if (ConfUsePtCutForD0D0bar) { - if (d0candidate.pt() < ConfDmesons.ConfMinPtD0D0bar && d0candidate.pt() > ConfDmesons.ConfMaxPtD0D0bar) { - continue; - } - } // // Set inv. mass cut for D0/D0bar candidates if (ConfUseMassCutForD0D0bar) { - if ((d0candidate.mLambda() < ConfD0D0barSideBand.ConfSignalRegionMin && d0candidate.mLambda() > ConfD0D0barSideBand.ConfSignalRegionMax) || (d0candidate.mAntiLambda() < ConfD0D0barSideBand.ConfSignalRegionMin && d0candidate.mAntiLambda() > ConfD0D0barSideBand.ConfSignalRegionMax)) { + if ((d0candidate.mLambda() < ConfD0D0barSideBand.ConfSignalRegionMin || d0candidate.mLambda() > ConfD0D0barSideBand.ConfSignalRegionMax) || (d0candidate.mAntiLambda() < ConfD0D0barSideBand.ConfSignalRegionMin || d0candidate.mAntiLambda() > ConfD0D0barSideBand.ConfSignalRegionMax)) { continue; } } From 93509887a8789bbb3c009066853136695f1d3887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 25 Nov 2024 16:05:31 +0100 Subject: [PATCH 080/459] [Common] [FT0] define the resolution in ps (#8615) --- Common/TableProducer/ft0CorrectedTable.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Common/TableProducer/ft0CorrectedTable.cxx b/Common/TableProducer/ft0CorrectedTable.cxx index 877cb40111f..bf99be86c45 100644 --- a/Common/TableProducer/ft0CorrectedTable.cxx +++ b/Common/TableProducer/ft0CorrectedTable.cxx @@ -10,6 +10,7 @@ // or submit itself to any jurisdiction. #include +#include #include "Framework/ConfigParamSpec.h" #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -30,8 +31,8 @@ using namespace o2::aod; struct ft0CorrectedTable { // Configurables - Configurable resoFT0A{"resoFT0A", 20.f, "FT0A resolution"}; - Configurable resoFT0C{"resoFT0C", 20.f, "FT0C resolution"}; + Configurable resoFT0A{"resoFT0A", 20.f, "FT0A resolution in ps for the MC override"}; + Configurable resoFT0C{"resoFT0C", 20.f, "FT0C resolution in ps for the MC override"}; Configurable addHistograms{"addHistograms", false, "Add QA histograms"}; Configurable cfgCollisionSystem{"collisionSystem", -2, "Collision system: -2 (use cfg values), -1 (autoset), 0 (pp), 1 (PbPb), 2 (XeXe), 3 (pPb)"}; Configurable cfgUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -61,6 +62,11 @@ struct ft0CorrectedTable { // Not later than now objects ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + if (doprocessWithBypassFT0timeInMC) { + // From ps to ns + resoFT0A.value = resoFT0A.value / 1000.f; + resoFT0C.value = resoFT0C.value / 1000.f; + } if (!addHistograms) { return; } @@ -135,6 +141,9 @@ struct ft0CorrectedTable { default: break; } + // Resolution is given in ps + resoFT0A.value = resoFT0A.value / 1000.f; + resoFT0C.value = resoFT0C.value / 1000.f; } table.reserve(collisions.size()); float t0A = 1e10f; From e72fb196fddc79898756e3d548304264e2c68efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 25 Nov 2024 16:05:57 +0100 Subject: [PATCH 081/459] [Common] [TOF] introduce generic resolution parametrization (#8616) --- Common/Core/PID/PIDTOF.h | 76 +++++++++++--- Common/TableProducer/PID/pidTOFMerge.cxx | 122 +++++++++++++++++------ 2 files changed, 155 insertions(+), 43 deletions(-) diff --git a/Common/Core/PID/PIDTOF.h b/Common/Core/PID/PIDTOF.h index 5ecd32cbbd0..3c507223feb 100644 --- a/Common/Core/PID/PIDTOF.h +++ b/Common/Core/PID/PIDTOF.h @@ -28,17 +28,19 @@ #include "TMath.h" #include "TGraph.h" #include "TFile.h" +#include "TF2.h" // O2 includes #include "DataFormatsTOF/ParameterContainers.h" #include "Framework/Logger.h" #include "ReconstructionDataFormats/PID.h" #include "Framework/DataTypes.h" +#include "CommonConstants/PhysicsConstants.h" namespace o2::pid::tof { -// Utility values +// Utility values (to remove!) static constexpr float kCSPEED = TMath::C() * 1.0e2f * 1.0e-12f; /// Speed of light in TOF units (cm/ps) static constexpr float kCSPEDDInv = 1.f / kCSPEED; /// Inverse of the Speed of light in TOF units (ps/cm) static constexpr float defaultReturnValue = -999.f; /// Default return value in case TOF measurement is not available @@ -55,7 +57,7 @@ class Beta /// \param length Length in cm of the track /// \param tofSignal TOF signal in ps for the track /// \param collisionTime collision time in ps for the event of the track - static float GetBeta(const float length, const float tofSignal, const float collisionTime) { return length / (tofSignal - collisionTime) * kCSPEDDInv; } + static float GetBeta(const float length, const float tofSignal, const float collisionTime) { return length / (tofSignal - collisionTime) * o2::constants::physics::invLightSpeedCm2PS; } /// Gets the beta for the track of interest /// \param track Track of interest @@ -139,6 +141,11 @@ class TOFResoParamsV2 : public o2::tof::Parameters<13> ~TOFResoParamsV2() = default; + template + float getResolution(const float, const float) const + { + return -1.f; + } // Momentum shift for charge calibration void setMomentumChargeShiftParameters(std::unordered_map const& pars) { @@ -254,14 +261,12 @@ class TOFResoParamsV2 : public o2::tof::Parameters<13> class TOFResoParamsV3 : public o2::tof::Parameters<13> { public: - TOFResoParamsV3() : Parameters(std::array{"TrkRes.Pi.P0", "TrkRes.Pi.P1", "TrkRes.Pi.P2", "TrkRes.Pi.P3", "time_resolution", - "TrkRes.Ka.P0", "TrkRes.Ka.P1", "TrkRes.Ka.P2", "TrkRes.Ka.P3", - "TrkRes.Pr.P0", "TrkRes.Pr.P1", "TrkRes.Pr.P2", "TrkRes.Pr.P3"}, + TOFResoParamsV3() : Parameters(std::array{"time_resolution", "time_resolution", "time_resolution", "time_resolution", "time_resolution", + "time_resolution", "time_resolution", "time_resolution", "time_resolution", + "time_resolution", "time_resolution", "time_resolution", "time_resolution"}, "TOFResoParamsV3") { - setParameters(std::array{0.008, 0.008, 0.002, 40.0, 60.0, - 0.008, 0.008, 0.002, 40.0, - 0.008, 0.008, 0.002, 40.0}); + setParameters(std::array{60.0}); } // Default constructor with default parameters ~TOFResoParamsV3() = default; @@ -313,7 +318,7 @@ class TOFResoParamsV3 : public o2::tof::Parameters<13> } } - // Time shift for post calibration + // Time shift for post calibration to realign as a function of eta void setTimeShiftParameters(std::unordered_map const& pars, bool positive) { std::string baseOpt = positive ? "TimeShift.Pos." : "TimeShift.Neg."; @@ -367,6 +372,38 @@ class TOFResoParamsV3 : public o2::tof::Parameters<13> return gNegEtaTimeCorr->Eval(eta); } + void setResolutionParametrization(std::unordered_map const& pars) + { + static constexpr std::array particleNames = {"El", "Mu", "Pi", "Ka", "Pr", "De", "Tr", "He", "Al"}; + for (int i = 0; i < 9; ++i) { + const std::string baseOpt = Form("tofResTrack.%s_", particleNames[i]); + // Check if a key begins with a string + for (const auto& [key, value] : pars) { + if (key.find(baseOpt) == 0) { + // Remove from the key the baseOpt + const std::string fun = key.substr(baseOpt.size()); + mResolution[i] = new TF2(baseOpt.c_str(), fun.c_str(), 0., 20, -1, 1.); + LOG(info) << "Set the resolution function for " << particleNames[i] << " with formula " << mResolution[i]->GetFormula()->GetExpFormula(); + break; + } + } + } + // Print a summary + for (int i = 0; i < 9; ++i) { + if (!mResolution[i]) { + LOG(info) << "Resolution function for " << particleNames[i] << " not provided, using default " << mDefaultResoParams[i]; + mResolution[i] = new TF2(Form("tofResTrack.%s_Default", particleNames[i]), mDefaultResoParams[i], 0., 20, -1, 1.); + } + LOG(info) << "Resolution function for " << particleNames[i] << " is " << mResolution[i]->GetName() << " with formula " << mResolution[i]->GetFormula()->GetExpFormula(); + } + } + + template + float getResolution(const float p, const float eta) const + { + return mResolution[pid]->Eval(p, eta); + } + private: // Charge calibration int mEtaN = 0; // Number of eta bins, 0 means no correction @@ -374,6 +411,16 @@ class TOFResoParamsV3 : public o2::tof::Parameters<13> float mEtaStop = 0.f; float mInvEtaWidth = 9999.f; std::vector mContent; + std::array mResolution{nullptr}; + static constexpr std::array mDefaultResoParams{"14.3*TMath::Power((TMath::Max(x-0.319,0.1))*(1-0.4235*y*y),-0.8467)", + "14.3*TMath::Power((TMath::Max(x-0.319,0.1))*(1-0.4235*y*y),-0.8467)", + "14.3*TMath::Power((TMath::Max(x-0.319,0.1))*(1-0.4235*y*y),-0.8467)", + "42.66*TMath::Power((TMath::Max(x-0.417,0.1))*(1-0.4235*y*y),-0.7145)", + "99.46*TMath::Power((TMath::Max(x-0.447,0.1))*(1-0.4235*y*y),-0.8094)", + "216*TMath::Power((TMath::Max(x-0.647,0.1))*(1-0.4235*y*y),-0.76)", + "315*TMath::Power((TMath::Max(x-0.811,0.1))*(1-0.4235*y*y),-0.783)", + "157*TMath::Power((TMath::Max(x-0.556,0.1))*(1-0.4235*y*y),-0.783)", + "216*TMath::Power((TMath::Max(x-0.647,0.1))*(1-0.4235*y*y),-0.76)"}; // Time shift for post calibration TGraph* gPosEtaTimeCorr = nullptr; /// Time shift correction for positive tracks @@ -391,7 +438,7 @@ class ExpTimes static constexpr float mMassZSqared = mMassZ * mMassZ; /// (M/z)^2 /// Computes the expected time of a track, given it TOF expected momentum - static float ComputeExpectedTime(const float tofExpMom, const float length) { return length * sqrt((mMassZSqared) + (tofExpMom * tofExpMom)) / (kCSPEED * tofExpMom); } + static float ComputeExpectedTime(const float tofExpMom, const float length) { return length * sqrt((mMassZSqared) + (tofExpMom * tofExpMom)) / (o2::constants::physics::LightSpeedCm2PS * tofExpMom); } /// Gets the expected signal of the track of interest under the PID assumption /// \param track Track of interest @@ -401,7 +448,7 @@ class ExpTimes return defaultReturnValue; } if (track.trackType() == o2::aod::track::Run2Track) { - return ComputeExpectedTime(track.tofExpMom() * kCSPEDDInv, track.length()); + return ComputeExpectedTime(track.tofExpMom() * o2::constants::physics::invLightSpeedCm2PS, track.length()); } return ComputeExpectedTime(track.tofExpMom(), track.length()); } @@ -416,7 +463,7 @@ class ExpTimes return defaultReturnValue; } if (track.trackType() == o2::aod::track::Run2Track) { - return ComputeExpectedTime(track.tofExpMom() * kCSPEDDInv / (1.f + track.sign() * parameters.getMomentumChargeShift(track.eta())), track.length()); + return ComputeExpectedTime(track.tofExpMom() * o2::constants::physics::invLightSpeedCm2PS / (1.f + track.sign() * parameters.getMomentumChargeShift(track.eta())), track.length()); } LOG(debug) << "TOF exp. mom. " << track.tofExpMom() << " shifted = " << track.tofExpMom() / (1.f + track.sign() * parameters.getMomentumChargeShift(track.eta())); return ComputeExpectedTime(track.tofExpMom() / (1.f + track.sign() * parameters.getMomentumChargeShift(track.eta())), track.length()) + parameters.getTimeShift(track.eta(), track.sign()); @@ -432,9 +479,14 @@ class ExpTimes static float GetExpectedSigma(const ParamType& parameters, const TrackType& track, const float tofSignal, const float collisionTimeRes) { const float& mom = track.p(); + const float& eta = track.eta(); if (mom <= 0) { return -999.f; } + const float reso = parameters.template getResolution(mom, eta); + if (reso > 0) { + return std::sqrt(reso * reso + parameters[4] * parameters[4] + collisionTimeRes * collisionTimeRes); + } if constexpr (id <= o2::track::PID::Pion) { LOG(debug) << "Using parameters for the pion hypothesis and ID " << id; const float dpp = parameters[0] + parameters[1] * mom + parameters[2] * mMassZ / mom; // mean relative pt resolution; diff --git a/Common/TableProducer/PID/pidTOFMerge.cxx b/Common/TableProducer/PID/pidTOFMerge.cxx index cfd3c566c2b..047dc041cd5 100644 --- a/Common/TableProducer/PID/pidTOFMerge.cxx +++ b/Common/TableProducer/PID/pidTOFMerge.cxx @@ -19,6 +19,8 @@ #include #include #include +#include +#include // O2 includes #include "Framework/runDataProcessing.h" @@ -71,6 +73,7 @@ struct TOFCalibConfig { mParamFileName = opt.cfgParamFileName.value; mParametrizationPath = opt.cfgParametrizationPath.value; mReconstructionPass = opt.cfgReconstructionPass.value; + mReconstructionPassDefault = opt.cfgReconstructionPassDefault.value; mLoadResponseFromCCDB = opt.cfgLoadResponseFromCCDB.value; mFatalOnPassNotAvailable = opt.cfgFatalOnPassNotAvailable.value; mEnableTimeDependentResponse = opt.cfgEnableTimeDependentResponse.value; @@ -81,7 +84,7 @@ struct TOFCalibConfig { template void getCfg(o2::framework::InitContext& initContext, const std::string name, VType& v, const std::string task) { - if (!getTaskOptionValue(initContext, task, name, v, true)) { + if (!getTaskOptionValue(initContext, task, name, v, false)) { LOG(fatal) << "Could not get " << name << " from " << task << " task"; } } @@ -93,10 +96,11 @@ struct TOFCalibConfig { getCfg(initContext, "ccdb-path-grplhcif", mPathGrpLhcIf, task); getCfg(initContext, "ccdb-timestamp", mTimestamp, task); getCfg(initContext, "timeShiftCCDBPathPos", mTimeShiftCCDBPathPos, task); - getCfg(initContext, "timeShiftCCDBPathNeg", mTimeShiftCCDBPathPos, task); + getCfg(initContext, "timeShiftCCDBPathNeg", mTimeShiftCCDBPathNeg, task); getCfg(initContext, "paramFileName", mParamFileName, task); getCfg(initContext, "parametrizationPath", mParametrizationPath, task); getCfg(initContext, "reconstructionPass", mReconstructionPass, task); + getCfg(initContext, "reconstructionPassDefault", mReconstructionPassDefault, task); getCfg(initContext, "loadResponseFromCCDB", mLoadResponseFromCCDB, task); getCfg(initContext, "fatalOnPassNotAvailable", mFatalOnPassNotAvailable, task); getCfg(initContext, "enableTimeDependentResponse", mEnableTimeDependentResponse, task); @@ -129,49 +133,63 @@ struct TOFCalibConfig { } LOG(info) << "Using parameter collection, starting from pass '" << mReconstructionPass << "'"; - const std::string fname = mParamFileName; - if (!fname.empty()) { // Loading the parametrization from file - LOG(info) << "Loading exp. sigma parametrization from file " << fname << ", using param: " << mParametrizationPath; - if (1) { - o2::tof::ParameterCollection paramCollection; - paramCollection.loadParamFromFile(fname, mParametrizationPath); - LOG(info) << "+++ Loaded parameter collection from file +++"; - if (!paramCollection.retrieveParameters(mRespParamsV3, mReconstructionPass)) { - if (mFatalOnPassNotAvailable) { - LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + if (!mParamFileName.empty()) { // Loading the parametrization from file + LOG(info) << "Loading exp. sigma parametrization from file " << mParamFileName << ", using param: " << mParametrizationPath << " and pass " << mReconstructionPass; + o2::tof::ParameterCollection paramCollection; + paramCollection.loadParamFromFile(mParamFileName, mParametrizationPath); + LOG(info) << "+++ Loaded parameter collection from file +++"; + if (!paramCollection.retrieveParameters(mRespParamsV3, mReconstructionPass)) { + if (mFatalOnPassNotAvailable) { + LOG(fatal) << "Pass '" << mReconstructionPass << "' not available in the retrieved object from file"; + } else { + LOG(warning) << "Pass '" << mReconstructionPass << "' not available in the retrieved object from file, fetching '" << mReconstructionPassDefault << "'"; + if (!paramCollection.retrieveParameters(mRespParamsV3, mReconstructionPassDefault)) { + paramCollection.print(); + LOG(fatal) << "Cannot get default pass for calibration " << mReconstructionPassDefault; } else { - LOGF(warning, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + mRespParamsV3.setResolutionParametrization(paramCollection.getPars(mReconstructionPassDefault)); + mRespParamsV3.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPassDefault)); + mRespParamsV3.printMomentumChargeShiftParameters(); } - } else { - mRespParamsV3.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPass)); - mRespParamsV3.printMomentumChargeShiftParameters(); } - } else { - mRespParamsV3.loadParamFromFile(fname.data(), mParametrizationPath); + } else { // Pass is available, load non standard parameters + mRespParamsV3.setResolutionParametrization(paramCollection.getPars(mReconstructionPass)); + mRespParamsV3.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPass)); + mRespParamsV3.printMomentumChargeShiftParameters(); } - } else if (mLoadResponseFromCCDB) { // Loading it from CCDB - LOG(info) << "Loading exp. sigma parametrization from CCDB, using path: " << mParametrizationPath << " for timestamp " << mTimestamp; + } else if (mLoadResponseFromCCDB && !mEnableTimeDependentResponse) { // Loading it from CCDB + LOG(info) << "Loading initial exp. sigma parametrization from CCDB, using path: " << mParametrizationPath << " for timestamp " << mTimestamp; o2::tof::ParameterCollection* paramCollection = ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp); paramCollection->print(); if (!paramCollection->retrieveParameters(mRespParamsV3, mReconstructionPass)) { // Attempt at loading the parameters with the pass defined if (mFatalOnPassNotAvailable) { - LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + LOG(fatal) << "Pass '" << mReconstructionPass << "' not available in the retrieved CCDB object"; } else { - LOGF(warning, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + LOG(warning) << "Pass '" << mReconstructionPass << "' not available in the retrieved CCDB object, fetching '" << mReconstructionPassDefault << "'"; + if (!paramCollection->retrieveParameters(mRespParamsV3, mReconstructionPassDefault)) { + paramCollection->print(); + LOG(fatal) << "Cannot get default pass for calibration " << mReconstructionPassDefault; + } else { + mRespParamsV3.setResolutionParametrization(paramCollection->getPars(mReconstructionPassDefault)); + mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPassDefault)); + mRespParamsV3.printMomentumChargeShiftParameters(); + } } } else { // Pass is available, load non standard parameters + mRespParamsV3.setResolutionParametrization(paramCollection->getPars(mReconstructionPass)); mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPass)); mRespParamsV3.printMomentumChargeShiftParameters(); } + } else { + std::unordered_map m; + mRespParamsV3.setResolutionParametrization(m); } - // Calibration object is defined - mRespParamsV3.print(); // Loading additional calibration objects if (mTimeShiftCCDBPathPos != "") { if (mTimeShiftCCDBPathPos.find(".root") != std::string::npos) { mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathPos, "ccdb_object", true); - } else { + } else if (!mEnableTimeDependentResponse) { if (mReconstructionPass == "") { mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathPos, mTimestamp), true); } else { @@ -184,7 +202,7 @@ struct TOFCalibConfig { if (mTimeShiftCCDBPathNeg != "") { if (mTimeShiftCCDBPathNeg.find(".root") != std::string::npos) { mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathNeg, "ccdb_object", false); - } else { + } else if (!mEnableTimeDependentResponse) { if (mReconstructionPass == "") { mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathNeg, mTimestamp), false); } else { @@ -194,6 +212,10 @@ struct TOFCalibConfig { } } } + + // Calibration object is defined + LOG(info) << "Parametrization at init time:"; + mRespParamsV3.print(); } template @@ -221,14 +243,50 @@ struct TOFCalibConfig { if (!mEnableTimeDependentResponse) { return; } - LOG(debug) << "Updating parametrization from path '" << mParametrizationPath << "' and timestamp " << mTimestamp; - if (!ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->retrieveParameters(mRespParamsV3, mReconstructionPass)) { - if (mFatalOnPassNotAvailable) { - LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + LOG(info) << "Updating parametrization from path '" << mParametrizationPath << "' and timestamp " << mTimestamp << " and reconstruction pass '" << mReconstructionPass << "'"; + if (mParamFileName.empty()) { // Not loading if parametrization from file + if (!ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->retrieveParameters(mRespParamsV3, mReconstructionPass)) { + if (mFatalOnPassNotAvailable) { + LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + } else { + LOGF(warning, "Pass '%s' not available in the retrieved CCDB object, fetching '%s'", mReconstructionPass.data(), mReconstructionPassDefault.data()); + if (!ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->retrieveParameters(mRespParamsV3, mReconstructionPassDefault)) { + ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->print(); + LOG(fatal) << "Cannot get default pass for calibration " << mReconstructionPassDefault; + } + } + } + } + + // Loading additional calibration objects + if (mTimeShiftCCDBPathPos != "") { + if (mTimeShiftCCDBPathPos.find(".root") != std::string::npos) { + mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathPos, "ccdb_object", true); + } else { + if (mReconstructionPass == "") { + mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathPos, mTimestamp), true); + } else { + std::map metadata; + metadata["RecoPassName"] = mReconstructionPass; + mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(mTimeShiftCCDBPathPos, mTimestamp, metadata), true); + } + } + } + if (mTimeShiftCCDBPathNeg != "") { + if (mTimeShiftCCDBPathNeg.find(".root") != std::string::npos) { + mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathNeg, "ccdb_object", false); } else { - LOGF(warning, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + if (mReconstructionPass == "") { + mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathNeg, mTimestamp), false); + } else { + std::map metadata; + metadata["RecoPassName"] = mReconstructionPass; + mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(mTimeShiftCCDBPathNeg, mTimestamp, metadata), false); + } } + LOG(info) << " test getTimeShift neg: " << mRespParamsV3.getTimeShift(0, false); } + return; } @@ -248,6 +306,7 @@ struct TOFCalibConfig { std::string mParamFileName; std::string mParametrizationPath; std::string mReconstructionPass; + std::string mReconstructionPassDefault; bool mLoadResponseFromCCDB; bool mFatalOnPassNotAvailable; bool mEnableTimeDependentResponse; @@ -289,6 +348,7 @@ struct tofSignal { Configurable cfgParamFileName{"paramFileName", "", "Path to the parametrization object. If empty the parametrization is not taken from file"}; Configurable cfgParametrizationPath{"parametrizationPath", "TOF/Calib/Params", "Path of the TOF parametrization on the CCDB or in the file, if the paramFileName is not empty"}; Configurable cfgReconstructionPass{"reconstructionPass", "", {"Apass to use when fetching the calibration tables. Empty (default) does not check for any pass. Use `metadata` to fetch it from the AO2D metadata. Otherwise it will override the metadata."}}; + Configurable cfgReconstructionPassDefault{"reconstructionPassDefault", "unanchored", {"Default pass to get if the standard one is not found"}}; Configurable cfgLoadResponseFromCCDB{"loadResponseFromCCDB", false, "Flag to load the response from the CCDB"}; Configurable cfgFatalOnPassNotAvailable{"fatalOnPassNotAvailable", true, "Flag to throw a fatal if the pass is not available in the retrieved CCDB object"}; Configurable cfgEnableTimeDependentResponse{"enableTimeDependentResponse", false, "Flag to use the collision timestamp to fetch the PID Response"}; From 651d0a029c7f9ce7b72ff89c2ed8850db6949097 Mon Sep 17 00:00:00 2001 From: Rafael Manhart <56776511+RafRaf11@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:06:19 +0100 Subject: [PATCH 082/459] [PWGLF] Update NucleiHistTask.cxx (#8634) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/NucleiHistTask.cxx | 120 ++++++++++++++++++++++---- 1 file changed, 101 insertions(+), 19 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx b/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx index 37ad72ef487..8b741eca28a 100644 --- a/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx +++ b/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx @@ -55,12 +55,13 @@ struct NucleiHistTask { HistogramRegistry aHelium3_reg{"aHelium3", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry Helium4_reg{"Helium4", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry aHelium4_reg{"aHelium4", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + OutputObj histTrackcuts_data{TH1I("histTrackcuts_data", "Entires;Track cut", 18, 0, 18)}; // MC HistogramRegistry MC_recon_reg{"MC_particles_reco", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - OutputObj histPDG{TH1I("PDG", "PDG;PDG code", 20, 0.0, 20.0)}; - OutputObj histTrackcuts_data{TH1I("histTrackcuts_data", "Entires;Track cut", 15, 0, 15)}; - OutputObj histTrackcuts_MC{TH1I("histTrackcuts_MC", "Entires;Track cut", 15, 0, 15)}; + HistogramRegistry MC_DCA{"MC_DCA", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + OutputObj histPDG{TH1I("PDG", "PDG;PDG code", 18, 0.0, 18)}; + OutputObj histTrackcuts_MC{TH1I("histTrackcuts_MC", "Entires;Track cut", 18, 0, 18)}; void init(o2::framework::InitContext&) { @@ -85,6 +86,20 @@ struct NucleiHistTask { histTrackcuts_data->GetXaxis()->SetBinLabel(13, "GoldenChi2 cut passed"); // +++++++++++++++++++++ MC ++++++++++++++++++++++++ + histPDG->GetXaxis()->SetBinLabel(1, "#pi^{+}"); + histPDG->GetXaxis()->SetBinLabel(2, "#pi^{-}"); + histPDG->GetXaxis()->SetBinLabel(3, "K^{+}"); + histPDG->GetXaxis()->SetBinLabel(4, "K^{-}"); + histPDG->GetXaxis()->SetBinLabel(5, "p"); + histPDG->GetXaxis()->SetBinLabel(6, "#bar{p}"); + histPDG->GetXaxis()->SetBinLabel(7, "d"); + histPDG->GetXaxis()->SetBinLabel(8, "#bar{d}"); + histPDG->GetXaxis()->SetBinLabel(9, "t"); + histPDG->GetXaxis()->SetBinLabel(10, "#bar{t}"); + histPDG->GetXaxis()->SetBinLabel(11, "^{3}He"); + histPDG->GetXaxis()->SetBinLabel(12, "^{3}#bar{He}"); + histPDG->GetXaxis()->SetBinLabel(13, "^{4}He"); + histPDG->GetXaxis()->SetBinLabel(14, "^{4}#bar{He}"); histTrackcuts_MC->GetXaxis()->SetBinLabel(1, "Events read"); histTrackcuts_MC->GetXaxis()->SetBinLabel(2, "Prim. particle. sel. passed"); histTrackcuts_MC->GetXaxis()->SetBinLabel(3, "Rap. cut passed"); @@ -414,6 +429,13 @@ struct NucleiHistTask { MC_recon_reg.add("histTofNsigmaDataaHe", "TOF nSigma (^{3}#bar{He})", HistType::kTH2F, {pAxis, {160, -20., +20., "n#sigma_{^{3}He}"}}); MC_recon_reg.add("histTofNsigmaDataAl", "TOF nSigma (^{4}He)", HistType::kTH2F, {pAxis, {160, -20., +20., "n#sigma_{^{4}He}"}}); MC_recon_reg.add("histTofNsigmaDataaAl", "TOF nSigma (^{4}#bar{He})", HistType::kTH2F, {pAxis, {160, -20., +20., "n#sigma_{^{4}He}"}}); + + MC_DCA.add("histDCA_prim", "DCA xy", HistType::kTH3F, {ptAxis, {250, -0.5, 0.5, "dca"}, PDGBINNING}); + MC_DCA.add("histDCAz_prim", "DCA z", HistType::kTH3F, {ptAxis, {1000, -2.0, 2.0, "dca"}, PDGBINNING}); + MC_DCA.add("histDCA_weak", "DCA xy", HistType::kTH3F, {ptAxis, {250, -0.5, 0.5, "dca"}, PDGBINNING}); + MC_DCA.add("histDCAz_weak", "DCA z", HistType::kTH3F, {ptAxis, {1000, -2.0, 2.0, "dca"}, PDGBINNING}); + MC_DCA.add("histDCA_mat", "DCA xy", HistType::kTH3F, {ptAxis, {250, -0.5, 0.5, "dca"}, PDGBINNING}); + MC_DCA.add("histDCAz_mat", "DCA z", HistType::kTH3F, {ptAxis, {1000, -2.0, 2.0, "dca"}, PDGBINNING}); } // Configurables @@ -1391,70 +1413,130 @@ struct NucleiHistTask { for (auto& track : tracks) { histTrackcuts_MC->AddBinContent(1); const auto particle = track.mcParticle(); + + int pdgbin = 0; + switch (particle.pdgCode()) { + case +211: + pdgbin = 0; + break; + case -211: + pdgbin = 1; + break; + case +321: + pdgbin = 2; + break; + case -321: + pdgbin = 3; + break; + case +2212: + pdgbin = 4; + break; + case -2212: + pdgbin = 5; + break; + case +1000010020: + pdgbin = 6; + break; + case -1000010020: + pdgbin = 7; + break; + case +1000010030: + pdgbin = 8; + break; + case -1000010030: + pdgbin = 9; + break; + case +1000020030: + pdgbin = 10; + break; + case -1000020030: + pdgbin = 11; + break; + case +1000020040: + pdgbin = 12; + break; + case -1000020040: + pdgbin = 13; + break; + default: + pdgbin = -1; + break; + } + + if (particle.isPhysicalPrimary()) { + if ((particle.pdgCode() == 1000020030) || (particle.pdgCode() == -1000020030) || (particle.pdgCode() == 1000020040) || (particle.pdgCode() == -1000020040)) { + MC_DCA.fill(HIST("histDCA_prim"), track.pt() * 2.0, track.dcaXY(), pdgbin); + MC_DCA.fill(HIST("histDCAz_prim"), track.pt() * 2.0, track.dcaZ(), pdgbin); + } else { + MC_DCA.fill(HIST("histDCA_prim"), track.pt(), track.dcaXY(), pdgbin); + MC_DCA.fill(HIST("histDCAz_prim"), track.pt(), track.dcaZ(), pdgbin); + } + } else if (particle.has_mothers()) { + if ((particle.pdgCode() == 1000020030) || (particle.pdgCode() == -1000020030) || (particle.pdgCode() == 1000020040) || (particle.pdgCode() == -1000020040)) { + MC_DCA.fill(HIST("histDCA_weak"), track.pt() * 2.0, track.dcaXY(), pdgbin); + MC_DCA.fill(HIST("histDCAz_weak"), track.pt() * 2.0, track.dcaZ(), pdgbin); + } else { + MC_DCA.fill(HIST("histDCA_weak"), track.pt(), track.dcaXY(), pdgbin); + MC_DCA.fill(HIST("histDCAz_weak"), track.pt(), track.dcaZ(), pdgbin); + } + } else { + if ((particle.pdgCode() == 1000020030) || (particle.pdgCode() == -1000020030) || (particle.pdgCode() == 1000020040) || (particle.pdgCode() == -1000020040)) { + MC_DCA.fill(HIST("histDCA_mat"), track.pt() * 2.0, track.dcaXY(), pdgbin); + MC_DCA.fill(HIST("histDCAz_mat"), track.pt() * 2.0, track.dcaZ(), pdgbin); + } else { + MC_DCA.fill(HIST("histDCA_mat"), track.pt(), track.dcaXY(), pdgbin); + MC_DCA.fill(HIST("histDCAz_mat"), track.pt(), track.dcaZ(), pdgbin); + } + } + if (!particle.isPhysicalPrimary()) continue; histTrackcuts_MC->AddBinContent(2); - int pdgbin = 0; switch (particle.pdgCode()) { case +211: histPDG->AddBinContent(1); - pdgbin = 0; break; case -211: histPDG->AddBinContent(2); - pdgbin = 1; break; case +321: histPDG->AddBinContent(3); - pdgbin = 2; break; case -321: histPDG->AddBinContent(4); - pdgbin = 3; break; case +2212: histPDG->AddBinContent(5); - pdgbin = 4; break; case -2212: histPDG->AddBinContent(6); - pdgbin = 5; break; case +1000010020: histPDG->AddBinContent(7); - pdgbin = 6; break; case -1000010020: histPDG->AddBinContent(8); - pdgbin = 7; break; case +1000010030: histPDG->AddBinContent(9); - pdgbin = 8; break; case -1000010030: histPDG->AddBinContent(10); - pdgbin = 9; break; case +1000020030: histPDG->AddBinContent(11); - pdgbin = 10; break; case -1000020030: histPDG->AddBinContent(12); - pdgbin = 11; break; case +1000020040: histPDG->AddBinContent(13); - pdgbin = 12; break; case -1000020040: histPDG->AddBinContent(14); - pdgbin = 13; break; default: - pdgbin = -1; break; } From cc63fe5f0eae3571ec2a11a12c80ef3c5eebbb02 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:06:38 +0100 Subject: [PATCH 083/459] [PWGLF] Add globalBC to strangeness data model (#8624) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicolò Jacazio --- PWGLF/DataModel/LFStrangenessTables.h | 5 ++- .../Strangeness/Converters/CMakeLists.txt | 5 +++ .../Converters/strastampsconverter.cxx | 37 +++++++++++++++++++ .../Strangeness/strangederivedbuilder.cxx | 2 +- 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 PWGLF/TableProducer/Strangeness/Converters/strastampsconverter.cxx diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index fc7f3b950d7..a6915382bba 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -224,11 +224,14 @@ DECLARE_SOA_TABLE(StraFT0CQVsEv, "AOD", "STRAFT0CQVSEv", //! events used to comp epcalibrationtable::TriggerEventEP); DECLARE_SOA_TABLE(StraZDCSP, "AOD", "STRAZDCSP", //! events used to compute the ZDC spectator plane spcalibrationtable::TriggerEventSP, spcalibrationtable::PsiZDCA, spcalibrationtable::PsiZDCC); -DECLARE_SOA_TABLE(StraStamps, "AOD", "STRASTAMPS", //! information for ID-ing mag field if needed +DECLARE_SOA_TABLE(StraStamps_000, "AOD", "STRASTAMPS", //! information for ID-ing mag field if needed bc::RunNumber, timestamp::Timestamp); +DECLARE_SOA_TABLE_VERSIONED(StraStamps_001, "AOD", "STRASTAMPS", 1, //! information for ID-ing mag field if needed + bc::RunNumber, timestamp::Timestamp, bc::GlobalBC); using StraRawCents = StraRawCents_004; using StraEvSels = StraEvSels_003; +using StraStamps = StraStamps_001; using StraCollision = StraCollisions::iterator; using StraCent = StraCents::iterator; diff --git a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt index 582047b6b60..4d7043e4a78 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt @@ -72,4 +72,9 @@ o2physics_add_dpl_workflow(v0mlscoresconverter o2physics_add_dpl_workflow(stramccollisionconverter SOURCES stramccollisionconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(strastampsconverter + SOURCES strastampsconverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGLF/TableProducer/Strangeness/Converters/strastampsconverter.cxx b/PWGLF/TableProducer/Strangeness/Converters/strastampsconverter.cxx new file mode 100644 index 00000000000..7f5f129d623 --- /dev/null +++ b/PWGLF/TableProducer/Strangeness/Converters/strastampsconverter.cxx @@ -0,0 +1,37 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" + +using namespace o2; +using namespace o2::framework; + +// Converts Stra Stamps from 000 to 001 +struct strastampsconverter { + Produces straStamps_001; + + void process(aod::StraStamps_000 const& straStamps_000) + { + for (auto& values : straStamps_000) { + straStamps_001(values.runNumber(), + values.timestamp(), + 0 /*dummy globalBC value*/); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index ee8db63d0a6..911cd99aec8 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -382,7 +382,7 @@ struct strangederivedbuilder { energyCommonZNA, energyCommonZNC, // Collision flags collision.flags()); - strangeStamps(bc.runNumber(), bc.timestamp()); + strangeStamps(bc.runNumber(), bc.timestamp(), bc.globalBC()); } for (const auto& v0 : V0Table_thisColl) V0CollIndices[v0.globalIndex()] = strangeColl.lastIndex(); From 37f174784b7f5136a687014270c9ba0e93e890d8 Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Mon, 25 Nov 2024 16:07:53 +0100 Subject: [PATCH 084/459] [PWGLF] adding configurable for PV selection variation (#8626) Co-authored-by: junleekim --- PWGLF/Tasks/Resonances/f0980pbpbanalysis.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGLF/Tasks/Resonances/f0980pbpbanalysis.cxx b/PWGLF/Tasks/Resonances/f0980pbpbanalysis.cxx index bb27b5f81c7..85ad1180b23 100644 --- a/PWGLF/Tasks/Resonances/f0980pbpbanalysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980pbpbanalysis.cxx @@ -79,6 +79,8 @@ struct f0980pbpbanalysis { Configurable cfgMaxOccupancy{"cfgMaxOccupancy", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; Configurable cfgMinOccupancy{"cfgMinOccupancy", -100, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; Configurable cfgNCollinTR{"cfgNCollinTR", false, "Additional selection for the number of coll in time range"}; + Configurable cfgPVSel{"cfgPVSel", false, "Additional PV selection flag for syst"}; + Configurable cfgPV{"cfgPV", 8.0, "Additional PV selection range for syst"}; Configurable cfgCentSel{"cfgCentSel", 80., "Centrality selection"}; Configurable cfgCentEst{"cfgCentEst", 1, "Centrality estimator, 1: FT0C, 2: FT0M"}; @@ -192,6 +194,9 @@ struct f0980pbpbanalysis { if (cfgNCollinTR && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { return 0; } + if (cfgPVSel && std::abs(collision.posZ()) > cfgPV) { + return 0; + } return 1; } // event selection From f43a33961d9c96368d102c3d8babd63a5eb36c19 Mon Sep 17 00:00:00 2001 From: eloviyo <38348689+Eloviyo@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:08:41 +0100 Subject: [PATCH 085/459] [PWGCF] FemtoUniverse cascade task -- applied clean pair check for cascade pair building (#8607) Co-authored-by: Shirajum Monira --- ...toUniversePairTaskTrackCascadeExtended.cxx | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx index 914017c9b7d..b049a6589d1 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx @@ -60,7 +60,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { Configurable ConfTrackChoicePartOne{"ConfTrackChoicePartOne", 0, "0:Proton, 1:Pion, 2:Kaon"}; Configurable ConfTrkPDGCodePartOne{"ConfTrkPDGCodePartOne", 2212, "Particle 1 (Track) - PDG code"}; Configurable ConfCascType1{"ConfCascType1", 0, "select one of the V0s (Omega = 0, Xi = 1, anti-Omega = 2, anti-Xi = 3) for track-cascade combination"}; - Configurable ConfChargePart1{"ConfChargePart1", 0, "sign of particle 1"}; + Configurable ConfChargePart1{"ConfChargePart1", 1, "sign of particle 1"}; Configurable ConfHPtPart1{"ConfHPtPart1", 4.0f, "higher limit for pt of particle 1"}; Configurable ConfLPtPart1{"ConfLPtPart1", 0.5f, "lower limit for pt of particle 1"}; Configurable ConfHPtPart2{"ConfHPtPart2", 4.0f, "higher limit for pt of particle 2"}; @@ -103,6 +103,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { FemtoUniverseContainer sameEventCont; FemtoUniverseContainer mixedEventCont; + FemtoUniversePairCleaner pairCleaner; HistogramRegistry rXiQA{"xi", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -197,6 +198,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { sameEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfEtaBins, ConfPhiBins, ConfIsMC, ConfUse3D); mixedEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfEtaBins, ConfPhiBins, ConfIsMC, ConfUse3D); + pairCleaner.init(&qaRegistry); } void processCascades(FilteredFDCollision& col, FemtoFullParticles& parts) @@ -263,8 +265,6 @@ struct femtoUniversePairTaskTrackCascadeExtended { void processSameEvent(FilteredFDCollision& col, FemtoFullParticles& parts) { - // const auto& magFieldTesla = col.magField(); - auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); @@ -275,8 +275,8 @@ struct femtoUniversePairTaskTrackCascadeExtended { const auto& negChild = parts.iteratorAt(part.index() - 2); const auto& bachelor = parts.iteratorAt(part.index() - 1); /// Child particles must pass this condition to be selected - /*if (!IsParticleTPC(posChild, CascChildTable[ConfCascType1][0]) || !IsParticleTPC(negChild, CascChildTable[ConfCascType1][1]) || !IsParticleTPC(bachelor, CascChildTable[ConfCascType1][2])) - continue;*/ + if (!IsParticleTPC(posChild, CascChildTable[ConfCascType1][0]) || !IsParticleTPC(negChild, CascChildTable[ConfCascType1][1]) || !IsParticleTPC(bachelor, CascChildTable[ConfCascType1][2])) + continue; posChildHistos.fillQA(posChild); negChildHistos.fillQA(negChild); @@ -303,24 +303,29 @@ struct femtoUniversePairTaskTrackCascadeExtended { } for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + // Cascade invariant mass cut if (!invMCascade(p2.mLambda(), p2.mAntiLambda())) continue; + // PID if (!IsParticleCombined(p1, ConfTrackChoicePartOne)) continue; - // const auto& posChild = parts.iteratorAt(p2.index() - 3); - // const auto& negChild = parts.iteratorAt(p2.index() - 2); - // const auto& bachelor = parts.iteratorAt(p2.index() - 1); - + // track cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } + const auto& posChild = parts.iteratorAt(p2.index() - 3); + const auto& negChild = parts.iteratorAt(p2.index() - 2); + const auto& bachelor = parts.iteratorAt(p2.index() - 1); /// Child particles must pass this condition to be selected - /*if (!IsParticleTPC(posChild, CascChildTable[ConfCascType1][0]) || !IsParticleTPC(negChild, CascChildTable[ConfCascType1][1]) || !IsParticleTPC(bachelor, CascChildTable[ConfCascType1][2])) - continue;*/ + if (!IsParticleTPC(posChild, CascChildTable[ConfCascType1][0]) || !IsParticleTPC(negChild, CascChildTable[ConfCascType1][1]) || !IsParticleTPC(bachelor, CascChildTable[ConfCascType1][2])) + continue; sameEventCont.setPair(p1, p2, col.multNtr(), ConfUse3D, 1.0f); } } PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processSameEvent, "Enable processing same event for track - cascade", true); - void processMixedEvent(FilteredFDCollisions& cols, FemtoFullParticles& /*parts*/) + void processMixedEvent(FilteredFDCollisions& cols, FemtoFullParticles& parts) { ColumnBinningPolicy colBinning{{ConfVtxBins, ConfMultBins}, true}; @@ -336,18 +341,23 @@ struct femtoUniversePairTaskTrackCascadeExtended { continue; } for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + // Cascade invariant mass cut if (!invMCascade(p2.mLambda(), p2.mAntiLambda())) continue; + // PID if (!IsParticleCombined(p1, ConfTrackChoicePartOne)) continue; - // const auto& posChild = parts.iteratorAt(p2.index() - 3); - // const auto& negChild = parts.iteratorAt(p2.index() - 2); - // const auto& bachelor = parts.iteratorAt(p2.index() - 1); - + const auto& posChild = parts.iteratorAt(p2.index() - 3); + const auto& negChild = parts.iteratorAt(p2.index() - 2); + const auto& bachelor = parts.iteratorAt(p2.index() - 1); /// Child particles must pass this condition to be selected - /*if (!IsParticleTPC(posChild, CascChildTable[ConfCascType1][0]) || !IsParticleTPC(negChild, CascChildTable[ConfCascType1][1]) || !IsParticleTPC(bachelor, CascChildTable[ConfCascType1][2])) - continue;*/ + if (!IsParticleTPC(posChild, CascChildTable[ConfCascType1][0]) || !IsParticleTPC(negChild, CascChildTable[ConfCascType1][1]) || !IsParticleTPC(bachelor, CascChildTable[ConfCascType1][2])) + continue; + // track cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } mixedEventCont.setPair(p1, p2, collision1.multNtr(), ConfUse3D, 1.0f); } From b9467d53728a12901205cfb26ce4683ff1ec2b4d Mon Sep 17 00:00:00 2001 From: Florian Jonas Date: Mon, 25 Nov 2024 16:09:00 +0100 Subject: [PATCH 086/459] [PWGJE] additional features for GammaJetTrees (#8565) Co-authored-by: ALICE Action Bot --- PWGJE/DataModel/GammaJetAnalysisTree.h | 8 +- PWGJE/TableProducer/emcalCorrectionTask.cxx | 5 +- PWGJE/Tasks/gammajettreeproducer.cxx | 111 +++++++++++++------- 3 files changed, 84 insertions(+), 40 deletions(-) diff --git a/PWGJE/DataModel/GammaJetAnalysisTree.h b/PWGJE/DataModel/GammaJetAnalysisTree.h index beb927f381c..a28131ab688 100644 --- a/PWGJE/DataModel/GammaJetAnalysisTree.h +++ b/PWGJE/DataModel/GammaJetAnalysisTree.h @@ -31,9 +31,10 @@ DECLARE_SOA_COLUMN(Multiplicity, multiplicity, float); DECLARE_SOA_COLUMN(Centrality, centrality, float); DECLARE_SOA_COLUMN(Rho, rho, float); DECLARE_SOA_COLUMN(EventSel, eventSel, uint8_t); +DECLARE_SOA_COLUMN(Occupancy, occupancy, int); DECLARE_SOA_BITMAP_COLUMN(Alias, alias, 32); } // namespace gjevent -DECLARE_SOA_TABLE(GjEvents, "AOD", "GJEVENT", o2::soa::Index<>, gjevent::Multiplicity, gjevent::Centrality, gjevent::Rho, gjevent::EventSel, gjevent::Alias) +DECLARE_SOA_TABLE(GjEvents, "AOD", "GJEVENT", o2::soa::Index<>, gjevent::Multiplicity, gjevent::Centrality, gjevent::Rho, gjevent::EventSel, gjevent::Occupancy, gjevent::Alias) using GjEvent = GjEvents::iterator; @@ -64,12 +65,15 @@ DECLARE_SOA_INDEX_COLUMN(GjEvent, gjevent); DECLARE_SOA_COLUMN(Pt, pt, float); DECLARE_SOA_COLUMN(Eta, eta, float); DECLARE_SOA_COLUMN(Phi, phi, float); +DECLARE_SOA_COLUMN(Radius, radius, float); DECLARE_SOA_COLUMN(Energy, energy, float); DECLARE_SOA_COLUMN(Mass, mass, float); DECLARE_SOA_COLUMN(Area, area, float); +DECLARE_SOA_COLUMN(LeadingTrackPt, leadingtrackpt, float); +DECLARE_SOA_COLUMN(PerpConeRho, perpconerho, float); DECLARE_SOA_COLUMN(NConstituents, nConstituents, ushort); } // namespace gjchjet -DECLARE_SOA_TABLE(GjChargedJets, "AOD", "GJCHJET", gjchjet::GjEventId, gjchjet::Pt, gjchjet::Eta, gjchjet::Phi, gjchjet::Energy, gjchjet::Mass, gjchjet::Area, gjchjet::NConstituents) +DECLARE_SOA_TABLE(GjChargedJets, "AOD", "GJCHJET", gjchjet::GjEventId, gjchjet::Pt, gjchjet::Eta, gjchjet::Phi, gjchjet::Radius, gjchjet::Energy, gjchjet::Mass, gjchjet::Area, gjchjet::LeadingTrackPt, gjchjet::PerpConeRho, gjchjet::NConstituents) } // namespace o2::aod #endif // PWGJE_DATAMODEL_GAMMAJETANALYSISTREE_H_ diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index 111841890c8..645a3517842 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -184,13 +184,15 @@ struct EmcalCorrectionTask { o2Axis energyAxis{200, 0., 100., "E (GeV)"}, timeAxis{300, -100, 200., "t (ns)"}, etaAxis{160, -0.8, 0.8, "#eta"}, - phiAxis{72, 0, 2 * 3.14159, "phi"}; + phiAxis{72, 0, 2 * 3.14159, "phi"}, + nlmAxis{50, -0.5, 49.5, "NLM"}; mHistManager.add("hCellE", "hCellE", o2HistType::kTH1F, {energyAxis}); mHistManager.add("hCellTowerID", "hCellTowerID", o2HistType::kTH1D, {{20000, 0, 20000}}); mHistManager.add("hCellEtaPhi", "hCellEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); // NOTE: Reversed column and row because it's more natural for presentation. mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", o2HistType::kTH2D, {{97, 0, 97}, {600, 0, 600}}); mHistManager.add("hClusterE", "hClusterE", o2HistType::kTH1F, {energyAxis}); + mHistManager.add("hClusterNLM", "hClusterNLM", o2HistType::kTH1F, {nlmAxis}); mHistManager.add("hClusterEtaPhi", "hClusterEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); mHistManager.add("hClusterTime", "hClusterTime", o2HistType::kTH1F, {timeAxis}); mHistManager.add("hGlobalTrackEtaPhi", "hGlobalTrackEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); @@ -627,6 +629,7 @@ struct EmcalCorrectionTask { } // end of cells of cluser loop // fill histograms mHistManager.fill(HIST("hClusterE"), cluster.E()); + mHistManager.fill(HIST("hClusterNLM"), cluster.getNExMax()); mHistManager.fill(HIST("hClusterTime"), cluster.getClusterTime()); mHistManager.fill(HIST("hClusterEtaPhi"), pos.Eta(), TVector2::Phi_0_2pi(pos.Phi())); if (IndexMapPair && trackGlobalIndex) { diff --git a/PWGJE/Tasks/gammajettreeproducer.cxx b/PWGJE/Tasks/gammajettreeproducer.cxx index 273205ccb7c..9cc938d1184 100644 --- a/PWGJE/Tasks/gammajettreeproducer.cxx +++ b/PWGJE/Tasks/gammajettreeproducer.cxx @@ -9,6 +9,12 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +// C++ system headers first +#include +#include +#include + +// Framework and other headers after #include "Framework/ASoA.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" @@ -44,9 +50,10 @@ /// \since 02.08.2024 /// using namespace o2; +using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; -using selectedClusters = o2::soa::Filtered; +using selectedClusters = o2::soa::Filtered>; #include "Framework/runDataProcessing.h" @@ -72,12 +79,11 @@ struct GammaJetTreeProducer { trackSelections{"trackSelections", "globalTracks", "set track selections"}; Configurable trackMinPt{"trackMinPt", 0.15, "minimum track pT cut"}; Configurable jetPtMin{"jetPtMin", 5.0, "minimum jet pT cut"}; - Configurable jetR{"jetR", 0.4, "jet resolution parameter"}; Configurable isoR{"isoR", 0.4, "isolation cone radius"}; - + Configurable perpConeJetR{"perpConeJetR", 0.4, "perpendicular cone radius used to calculate perp cone rho for jet"}; + Configurable trackMatchingEoverP{"trackMatchingEoverP", 2.0, "closest track is required to have E/p < value"}; // cluster cuts Configurable mClusterDefinition{"clusterDefinition", 10, "cluster definition to be selected, e.g. 10=kV3Default"}; - // Preslice perClusterMatchedTracks = o2::aod::jcluster::clusterId; int mRunNumber = 0; int eventSelection = -1; @@ -98,14 +104,21 @@ struct GammaJetTreeProducer { // create histograms LOG(info) << "Creating histograms"; - const o2Axis ptAxis{100, 0, 100, "p_{T} (GeV/c)"}; + const o2Axis ptAxis{100, 0, 200, "p_{T} (GeV/c)"}; const o2Axis energyAxis{100, 0, 100, "E (GeV)"}; const o2Axis m02Axis{100, 0, 3, "m02"}; - + const o2Axis etaAxis{100, -1, 1, "#eta"}; + const o2Axis phiAxis{100, 0, 2 * TMath::Pi(), "#phi"}; + const o2Axis occupancyAxis{300, 0, 30000, "occupancy"}; mHistograms.add("clusterE", "Energy of cluster", o2HistType::kTH1F, {energyAxis}); mHistograms.add("trackPt", "pT of track", o2HistType::kTH1F, {ptAxis}); mHistograms.add("chjetPt", "pT of charged jet", o2HistType::kTH1F, {ptAxis}); + mHistograms.add("chjetPtEtaPhi", "pT of charged jet", o2HistType::kTHnSparseF, {ptAxis, etaAxis, phiAxis}); mHistograms.add("chjetpt_vs_constpt", "pT of charged jet vs pT of constituents", o2HistType::kTH2F, {ptAxis, ptAxis}); + + // track QA THnSparse + mHistograms.add("trackPtEtaPhi", "Track QA", o2HistType::kTHnSparseF, {ptAxis, etaAxis, phiAxis}); + mHistograms.add("trackPtEtaOccupancy", "Track QA vs occupancy", o2HistType::kTHnSparseF, {ptAxis, etaAxis, occupancyAxis}); } // --------------------- @@ -156,12 +169,25 @@ struct GammaJetTreeProducer { } return iso; } - double ch_perp_cone_rho(const auto& cluster, aod::JetTracks const& tracks, float radius = 0.4) + + void runTrackQA(const auto& collision, aod::JetTracks const& tracks) + { + for (auto track : tracks) { + if (!isTrackSelected(track)) { + continue; + } + mHistograms.fill(HIST("trackPt"), track.pt()); + mHistograms.fill(HIST("trackPtEtaPhi"), track.pt(), track.eta(), track.phi()); + mHistograms.fill(HIST("trackPtEtaOccupancy"), track.pt(), track.eta(), collision.trackOccupancyInTimeRange()); + } + } + + double ch_perp_cone_rho(const auto& object, aod::JetTracks const& tracks, float radius = 0.4) { double ptSumLeft = 0; double ptSumRight = 0; - double cPhi = TVector2::Phi_0_2pi(cluster.phi()); + double cPhi = TVector2::Phi_0_2pi(object.phi()); // rotate cone left by 90 degrees float cPhiLeft = cPhi - TMath::Pi() / 2; @@ -173,8 +199,8 @@ struct GammaJetTreeProducer { if (!isTrackSelected(track)) { continue; } - dRLeft = jetutilities::deltaR(cluster.eta(), cPhiLeft, track.eta(), track.phi()); - dRRight = jetutilities::deltaR(cluster.eta(), cPhiRight, track.eta(), track.phi()); + dRLeft = jetutilities::deltaR(object.eta(), cPhiLeft, track.eta(), track.phi()); + dRRight = jetutilities::deltaR(object.eta(), cPhiRight, track.eta(), track.phi()); if (dRLeft < radius) { ptSumLeft += track.pt(); @@ -201,16 +227,21 @@ struct GammaJetTreeProducer { // sadly passing of the string at runtime is not possible for technical region so cluster definition is // an integer instead Filter clusterDefinitionSelection = (o2::aod::jcluster::definition == mClusterDefinition); + PresliceUnsorted EMCTrackPerTrack = aod::jemctrack::trackId; + // Process clusters - void processClusters(soa::Join::iterator const& collision, selectedClusters const& clusters, aod::JetTracks const& tracks) + void processClusters(soa::Join::iterator const& collision, selectedClusters const& clusters, aod::JetTracks const& tracks, aod::JEMCTracks const& emctracks) { if (!isEventAccepted(collision)) { return; } - eventsTable(collision.multiplicity(), collision.centrality(), collision.rho(), collision.eventSel(), collision.alias_raw()); + eventsTable(collision.multiplicity(), collision.centrality(), collision.rho(), collision.eventSel(), collision.trackOccupancyInTimeRange(), collision.alias_raw()); collisionMapping[collision.globalIndex()] = eventsTable.lastIndex(); + // loop over tracks one time for QA + runTrackQA(collision, tracks); + // loop over clusters for (auto cluster : clusters) { @@ -226,26 +257,24 @@ struct GammaJetTreeProducer { // double dRMin = 100; double p = -1; - // auto tracksofcluster = matchedtracks.sliceBy(perClusterMatchedTracks, cluster.globalIndex()); - // for (const auto& match : tracksofcluster) { - // // ask the jtracks table for track with ID trackID - // double dR = deltaR(cluster.eta(), cluster.phi(), match.tracks_as().Eta(), match.tracks_as().Phi()); - // if (dR < dRMin) { - // dRMin = dR; - // dEta = cluster.eta() - match.tracks_as().eta(); - // dPhi = TVector2::Phi_0_2pi(cluster.phi()) - TVector2::Phi_0_2pi(match.tracks_as().phi()); - // if (abs(dPhi) > M_PI) { - // dPhi = 2 * M_PI - abs(dPhi); - // } - // p = match.tracks_as().p(); - // } - // } - - // // for compression reasons make dPhi and dEta 0 if no match is found - // if (p == -1) { - // dPhi = 0; - // dEta = 0; - // } + // do track matching + auto tracksofcluster = cluster.matchedTracks_as(); + for (auto track : tracksofcluster) { + if (!isTrackSelected(track)) { + continue; + } + auto emcTracksPerTrack = emctracks.sliceBy(EMCTrackPerTrack, track.globalIndex()); + auto emcTrack = emcTracksPerTrack.iteratorAt(0); + // find closest track that still has E/p < trackMatchingEoverP + if (cluster.energy() / track.p() > trackMatchingEoverP) { + continue; + } else { + dEta = cluster.eta() - emcTrack.etaEmcal(); + dPhi = RecoDecay::constrainAngle(RecoDecay::constrainAngle(emcTrack.phiEmcal(), -M_PI) - RecoDecay::constrainAngle(cluster.phi(), -M_PI), -M_PI); + p = track.p(); + break; + } + } gammasTable(eventsTable.lastIndex(), cluster.energy(), cluster.eta(), cluster.phi(), cluster.m02(), cluster.m20(), cluster.nCells(), cluster.time(), cluster.isExotic(), cluster.distanceToBadChannel(), cluster.nlm(), isoraw, perpconerho, dPhi, dEta, p); } @@ -257,30 +286,38 @@ struct GammaJetTreeProducer { } PROCESS_SWITCH(GammaJetTreeProducer, processClusters, "Process EMCal clusters", true); - Filter jetCuts = aod::jet::pt > jetPtMin&& aod::jet::r == nround(jetR.node() * 100.0f); + Filter jetCuts = aod::jet::pt > jetPtMin; // Process charged jets - void processChargedJets(soa::Join::iterator const& collision, soa::Filtered> const& chargedJets, aod::JetTracks const&) + void processChargedJets(soa::Join::iterator const& collision, soa::Filtered> const& chargedJets, aod::JetTracks const& tracks) { // event selection if (!isEventAccepted(collision)) { return; } - + float leadingTrackPt = 0; + ushort nconst = 0; // loop over charged jets for (auto jet : chargedJets) { if (jet.pt() < jetPtMin) continue; - ushort nconst = 0; + nconst = 0; + leadingTrackPt = 0; // loop over constituents for (auto& constituent : jet.template tracks_as()) { mHistograms.fill(HIST("chjetpt_vs_constpt"), jet.pt(), constituent.pt()); nconst++; + if (constituent.pt() > leadingTrackPt) { + leadingTrackPt = constituent.pt(); + } } int32_t storedColIndex = -1; if (auto foundCol = collisionMapping.find(collision.globalIndex()); foundCol != collisionMapping.end()) { storedColIndex = foundCol->second; } - chargedJetsTable(storedColIndex, jet.pt(), jet.eta(), jet.phi(), jet.energy(), jet.mass(), jet.area(), nconst); + // calculate perp cone rho + double perpconerho = ch_perp_cone_rho(jet, tracks, perpConeJetR); + mHistograms.fill(HIST("chjetPtEtaPhi"), jet.pt(), jet.eta(), jet.phi()); + chargedJetsTable(storedColIndex, jet.pt(), jet.eta(), jet.phi(), jet.r(), jet.energy(), jet.mass(), jet.area(), leadingTrackPt, perpconerho, nconst); // fill histograms mHistograms.fill(HIST("chjetPt"), jet.pt()); } From 5abdfe28f589e2e4f1906dcd429998159d78e204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 25 Nov 2024 16:09:22 +0100 Subject: [PATCH 087/459] [DPG] [TOF] fill delta histogram for pions (#8618) --- DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx index e5ca7df21cc..ef23cdaff2d 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx @@ -345,7 +345,7 @@ struct tofPidCollisionTimeQa { const float& massT0C = collision.t0CCorrectedValid() ? o2::pid::tof::TOFMass::GetTOFMass(trk, betaT0C) : 999.f; const float& massT0AC = collision.t0ACValid() ? o2::pid::tof::TOFMass::GetTOFMass(trk, betaT0AC) : 999.f; - const float& deltaPi = trk.tofSignal() - trk.tofEvTime() - o2::pid::tof::ExpTimes::GetExpectedSignal(trk); + const float& deltaPi = trk.tofSignal() - trk.tofEvTime() - trk.tofExpTimePi(); histos.fill(HIST("tofbeta/inclusive"), trk.p(), trk.beta()); histos.fill(HIST("tofmass/inclusive"), trk.p(), trk.mass()); @@ -367,6 +367,10 @@ struct tofPidCollisionTimeQa { histos.fill(HIST("tofmass/EvTimeT0COnly"), trk.p(), massT0C); histos.fill(HIST("tofmass/EvTimeT0ACOnly"), trk.p(), massT0AC); + if (trk.p() > minPReso && trk.p() < maxPReso) { + histos.fill(HIST("deltaVsMult/pi"), trk.evTimeTOFMult(), deltaPi); + histos.fill(HIST("deltaVsReso/pi"), trk.evTimeTOFMult(), deltaPi); + } if (enableDebug) { histos.fill(HIST("withtof/p"), trk.p()); @@ -375,10 +379,6 @@ struct tofPidCollisionTimeQa { histos.fill(HIST("withtof/tofSignal"), trk.tofSignal()); histos.fill(HIST("withtof/beta"), trk.p(), trk.beta()); histos.fill(HIST("withtof/delta"), trk.p(), deltaPi); - if (trk.p() > minPReso && trk.p() < maxPReso) { - histos.fill(HIST("deltaVsMult/pi"), trk.evTimeTOFMult(), deltaPi); - histos.fill(HIST("deltaVsReso/pi"), trk.evTimeTOFMult(), deltaPi); - } histos.fill(HIST("withtof/expP"), trk.p(), trk.tofExpMom()); histos.fill(HIST("withtof/mass"), trk.mass()); From 7596ce179b7e285c01858d722c80da71e4f8a088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:09:55 +0100 Subject: [PATCH 088/459] [PWGHF] Fix the type mismatch between candidateSelFlag and the configurables (#8614) --- PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx index f7aad26d676..be297dd87c8 100644 --- a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx +++ b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx @@ -139,8 +139,8 @@ struct HfTaskCharmHadronsFemtoDream { FemtoDreamDetaDphiStar pairCloseRejectionME; Filter eventMultiplicity = aod::femtodreamcollision::multNtr >= eventSel.multMin && aod::femtodreamcollision::multNtr <= eventSel.multMax; Filter eventMultiplicityPercentile = aod::femtodreamcollision::multV0M >= eventSel.multPercentileMin && aod::femtodreamcollision::multV0M <= eventSel.multPercentileMax; - Filter hfCandSelFilter = aod::fdhf::candidateSelFlag >= charmHadCandSel.value; - Filter hfMcSelFilter = nabs(aod::fdhf::flagMc) == charmHadMcSel.value; + Filter hfCandSelFilter = aod::fdhf::candidateSelFlag >= static_cast(charmHadCandSel.value); + Filter hfMcSelFilter = nabs(aod::fdhf::flagMc) == static_cast(charmHadMcSel.value); Filter trackEtaFilterLow = ifnode(aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack), aod::femtodreamparticle::eta < etaTrack1Max, true); Filter trackEtaFilterUp = ifnode(aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack), aod::femtodreamparticle::eta > etaTrack1Min, true); Filter trackPtFilterLow = ifnode(aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack), aod::femtodreamparticle::pt < ptTrack1Max, true); From 3610bc7ce8d49a2a385ccadc6bef25c39a8aa043 Mon Sep 17 00:00:00 2001 From: Fabrizio Chinu <91954233+fchinu@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:10:51 +0100 Subject: [PATCH 089/459] [PWGHF] Add task for studies on PID variables (#8617) Co-authored-by: marcellocosti Co-authored-by: ALICE Action Bot Co-authored-by: Marcellocosti <96481191+Marcellocosti@users.noreply.github.com> --- PWGHF/Tasks/CMakeLists.txt | 5 + PWGHF/Tasks/pidStudies.cxx | 294 +++++++++++++++++++++++++++++++++++++ 2 files changed, 299 insertions(+) create mode 100644 PWGHF/Tasks/pidStudies.cxx diff --git a/PWGHF/Tasks/CMakeLists.txt b/PWGHF/Tasks/CMakeLists.txt index 00878e48a2c..b27696543ac 100644 --- a/PWGHF/Tasks/CMakeLists.txt +++ b/PWGHF/Tasks/CMakeLists.txt @@ -43,3 +43,8 @@ o2physics_add_dpl_workflow(task-mc-validation # SOURCES taskSelOptimisation.cxx # PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore # COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(pid-studies + SOURCES pidStudies.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGHF/Tasks/pidStudies.cxx b/PWGHF/Tasks/pidStudies.cxx new file mode 100644 index 00000000000..6b72dc01378 --- /dev/null +++ b/PWGHF/Tasks/pidStudies.cxx @@ -0,0 +1,294 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file pidStudies.cxx +/// \brief task for studies of PID performance +/// +/// \author Fabrizio Chinu , Università and INFN Torino +/// \author Stefano Politanò , INFN Torino +/// \author Marcello Di Costanzo , Politecnico and INFN Torino +/// \author Luca Aglietta , Università and INFN Torino + +#include "TPDGCode.h" + +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +namespace o2::aod +{ +namespace pid_studies +{ +enum Particle { NotMatched = 0, + K0s, + Lambda, + Omega }; +// V0s +DECLARE_SOA_COLUMN(MassK0, massK0, float); //! Candidate mass +DECLARE_SOA_COLUMN(MassLambda, massLambda, float); //! Candidate mass +DECLARE_SOA_COLUMN(MassAntiLambda, massAntiLambda, float); //! Candidate mass +DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of the candidate (GeV/c) +DECLARE_SOA_COLUMN(PtPos, ptPos, float); //! Transverse momentum of positive track (GeV/c) +DECLARE_SOA_COLUMN(PtNeg, ptNeg, float); //! Transverse momentum of negative track (GeV/c) +DECLARE_SOA_COLUMN(Radius, radius, float); //! Radius +DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine of pointing angle +DECLARE_SOA_COLUMN(NSigmaTpcPosPi, nSigmaTpcPosPi, float); //! nSigmaTPC of positive track with pion hypothesis +DECLARE_SOA_COLUMN(NSigmaTpcNegPi, nSigmaTpcNegPi, float); //! nSigmaTPC of negative track with pion hypothesis +DECLARE_SOA_COLUMN(NSigmaTpcPosPr, nSigmaTpcPosPr, float); //! nSigmaTPC of positive track with proton hypothesis +DECLARE_SOA_COLUMN(NSigmaTpcNegPr, nSigmaTpcNegPr, float); //! nSigmaTPC of negative track with proton hypothesis +DECLARE_SOA_COLUMN(NSigmaTofPosPi, nSigmaTofPosPi, float); //! nSigmaTOF of positive track with pion hypothesis +DECLARE_SOA_COLUMN(NSigmaTofNegPi, nSigmaTofNegPi, float); //! nSigmaTOF of negative track with pion hypothesis +DECLARE_SOA_COLUMN(NSigmaTofPosPr, nSigmaTofPosPr, float); //! nSigmaTOF of positive track with proton hypothesis +DECLARE_SOA_COLUMN(NSigmaTofNegPr, nSigmaTofNegPr, float); //! nSigmaTOF of negative track with proton hypothesis +DECLARE_SOA_COLUMN(AlphaArm, alphaArm, float); //! Armenteros alpha +DECLARE_SOA_COLUMN(QtArm, qtArm, float); //! Armenteros Qt + +// Cascades +DECLARE_SOA_COLUMN(MassOmega, massOmega, float); //! Candidate mass +DECLARE_SOA_COLUMN(MassXi, massXi, float); //! Candidate mass +DECLARE_SOA_COLUMN(BachPt, bachPt, float); //! Transverse momentum of the bachelor (GeV/c) +DECLARE_SOA_COLUMN(V0cosPA, v0cosPA, float); //! V0 CPA +DECLARE_SOA_COLUMN(CascCosPA, casccosPA, float); //! Cascade CPA +DECLARE_SOA_COLUMN(DCAV0daughters, dcaV0daughters, float); //! DCA of V0 daughters +DECLARE_SOA_COLUMN(DCAv0topv, dcav0topv, float); //! V0 DCA to PV +DECLARE_SOA_COLUMN(NSigmaTpcBachKa, nSigmaTpcBachKa, float); //! nSigmaTPC of bachelor with kaon hypothesis +DECLARE_SOA_COLUMN(NSigmaTofBachKa, nSigmaTofBachKa, float); //! nSigmaTOF of bachelor with kaon hypothesis + +// Common columns +DECLARE_SOA_COLUMN(OccupancyFt0c, occupancyFt0c, float); //! Occupancy from FT0C +DECLARE_SOA_COLUMN(OccupancyIts, occupancyIts, float); //! Occupancy from ITS +DECLARE_SOA_COLUMN(CentralityFT0C, centralityFT0C, float); //! Centrality from FT0C +DECLARE_SOA_COLUMN(CentralityFT0M, centralityFT0M, float); //! Centrality from FT0M +DECLARE_SOA_COLUMN(CandFlag, candFlag, int); //! Flag for MC matching +} // namespace pid_studies + +DECLARE_SOA_TABLE(PidV0s, "AOD", "PIDV0S", //! Table with PID information + pid_studies::MassK0, + pid_studies::MassLambda, + pid_studies::MassAntiLambda, + pid_studies::Pt, + pid_studies::PtPos, + pid_studies::PtNeg, + pid_studies::Radius, + pid_studies::Cpa, + pid_studies::NSigmaTpcPosPi, + pid_studies::NSigmaTpcNegPi, + pid_studies::NSigmaTpcPosPr, + pid_studies::NSigmaTpcNegPr, + pid_studies::NSigmaTofPosPi, + pid_studies::NSigmaTofNegPi, + pid_studies::NSigmaTofPosPr, + pid_studies::NSigmaTofNegPr, + pid_studies::AlphaArm, + pid_studies::QtArm, + pid_studies::OccupancyFt0c, + pid_studies::OccupancyIts, + pid_studies::CentralityFT0C, + pid_studies::CentralityFT0M, + pid_studies::CandFlag); + +DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID information + pid_studies::MassOmega, + pid_studies::Pt, + pid_studies::BachPt, + pid_studies::V0cosPA, + pid_studies::MassXi, + pid_studies::CascCosPA, + pid_studies::DCAV0daughters, + pid_studies::DCAv0topv, + pid_studies::NSigmaTpcBachKa, + pid_studies::NSigmaTofBachKa, + pid_studies::OccupancyFt0c, + pid_studies::OccupancyIts, + pid_studies::CentralityFT0C, + pid_studies::CentralityFT0M, + pid_studies::CandFlag); +} // namespace o2::aod + +struct HfPidStudies { + Produces pidV0; + Produces pidCascade; + + Configurable massK0Min{"massK0Min", 0.4, "Minimum mass for K0"}; + Configurable massK0Max{"massK0Max", 0.6, "Maximum mass for K0"}; + Configurable massLambdaMin{"massLambdaMin", 1.0, "Minimum mass for lambda"}; + Configurable massLambdaMax{"massLambdaMax", 1.3, "Maximum mass for lambda"}; + Configurable massOmegaMin{"massOmegaMin", 1.5, "Minimum mass for omega"}; + Configurable massOmegaMax{"massOmegaMax", 1.8, "Maximum mass for omega"}; + Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of candidates to keep"}; + Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; + + using PidTracks = soa::Join; + using CollSels = soa::Join; + using V0sMcRec = soa::Join; + using CascsMcRec = soa::Join; + + template + void fillTree(Cand const& candidate, const int flag) + { + float pseudoRndm = candidate.pt() * 1000. - static_cast(candidate.pt() * 1000); + if (candidate.pt() < ptMaxForDownSample && pseudoRndm > downSampleBkgFactor) { + return; + } + + const auto& coll = candidate.template collision_as(); + if constexpr (isV0) { + const auto& posTrack = candidate.template posTrack_as(); + const auto& negTrack = candidate.template negTrack_as(); + pidV0( + candidate.mK0Short(), + candidate.mLambda(), + candidate.mAntiLambda(), + candidate.pt(), + posTrack.pt(), + negTrack.pt(), + candidate.v0radius(), + candidate.v0cosPA(), + posTrack.tofNSigmaPi(), + negTrack.tofNSigmaPi(), + posTrack.tofNSigmaPr(), + negTrack.tofNSigmaPr(), + posTrack.tpcNSigmaPi(), + negTrack.tpcNSigmaPi(), + posTrack.tpcNSigmaPr(), + negTrack.tpcNSigmaPr(), + candidate.alpha(), + candidate.qtarm(), + coll.ft0cOccupancyInTimeRange(), + coll.trackOccupancyInTimeRange(), + coll.centFT0C(), + coll.centFT0M(), + flag); + } else { + const auto& bachTrack = candidate.template bachelor_as(); + pidCascade( + candidate.mOmega(), + candidate.pt(), + candidate.bachelorpt(), + candidate.v0cosPA(coll.posX(), coll.posY(), coll.posZ()), + candidate.mXi(), + candidate.casccosPA(coll.posX(), coll.posY(), coll.posZ()), + candidate.dcaV0daughters(), + candidate.dcav0topv(coll.posX(), coll.posY(), coll.posZ()), + bachTrack.tpcNSigmaKa(), + bachTrack.tofNSigmaKa(), + coll.ft0cOccupancyInTimeRange(), + coll.trackOccupancyInTimeRange(), + coll.centFT0C(), + coll.centFT0M(), + flag); + } + } + + template + int isMatched(const T1& cand) + { + if constexpr (std::is_same::value) { + if (!cand.has_v0MCCore()) { + return aod::pid_studies::Particle::NotMatched; + } + auto v0MC = cand.template v0MCCore_as(); + if (v0MC.pdgCode() == kK0Short && v0MC.pdgCodeNegative() == -kPiPlus && v0MC.pdgCodePositive() == kPiPlus) { + return aod::pid_studies::Particle::K0s; + } + if (v0MC.pdgCode() == kLambda0 && v0MC.pdgCodeNegative() == -kPiPlus && v0MC.pdgCodePositive() == kProton) { + return aod::pid_studies::Particle::Lambda; + } + if (v0MC.pdgCode() == -kLambda0 && v0MC.pdgCodeNegative() == -kProton && v0MC.pdgCodePositive() == kPiPlus) { + return -aod::pid_studies::Particle::Lambda; + } + } + if constexpr (std::is_same::value) { + if (!cand.has_cascMCCore()) { + return aod::pid_studies::Particle::NotMatched; + } + auto cascMC = cand.template cascMCCore_as(); + if (cascMC.pdgCode() == kOmegaMinus && + cascMC.pdgCodeBachelor() == -kKPlus && + cascMC.pdgCodeV0() == kLambda0 && + cascMC.pdgCodePositive() == kProton && + cascMC.pdgCodeNegative() == -kPiPlus) { + return aod::pid_studies::Particle::Omega; + } + if (cascMC.pdgCode() == -kOmegaMinus && + cascMC.pdgCodeBachelor() == kKPlus && + cascMC.pdgCodeV0() == -kLambda0 && + cascMC.pdgCodePositive() == kPiPlus && + cascMC.pdgCodeNegative() == -kProton) { + return -aod::pid_studies::Particle::Omega; + } + } + return aod::pid_studies::Particle::NotMatched; + } + + void processMc(V0sMcRec const& V0s, + aod::V0MCCores const&, + CascsMcRec const& cascades, + aod::CascMCCores const&, + CollSels const&, + PidTracks const&) + { + for (const auto& v0 : V0s) { + if ((v0.mK0Short() > massK0Min && v0.mK0Short() < massK0Max) || + (v0.mLambda() > massLambdaMin && v0.mLambda() < massLambdaMax) || + (v0.mAntiLambda() > massLambdaMin && v0.mAntiLambda() < massLambdaMax)) { + int matched = isMatched(v0); + if (matched != aod::pid_studies::Particle::NotMatched) { + fillTree(v0, matched); + } + } + } + for (const auto& casc : cascades) { + if (casc.mOmega() > massOmegaMin && casc.mOmega() < massOmegaMax && casc.mLambda() > massLambdaMin && casc.mLambda() < massLambdaMax) { + int matched = isMatched(casc); + if (matched != aod::pid_studies::Particle::NotMatched) { + fillTree(casc, matched); + } + } + } + } + PROCESS_SWITCH(HfPidStudies, processMc, "Process MC", true); + + void processData(aod::V0Datas const& V0s, aod::CascDatas const& cascades, CollSels const&, PidTracks const&) + { + for (const auto& v0 : V0s) { + if ((v0.mK0Short() > massK0Min && v0.mK0Short() < massK0Max) || + (v0.mLambda() > massLambdaMin && v0.mLambda() < massLambdaMax) || + (v0.mAntiLambda() > massLambdaMin && v0.mAntiLambda() < massLambdaMax)) { + fillTree(v0, aod::pid_studies::Particle::NotMatched); + } + } + for (const auto& casc : cascades) { + if (casc.mOmega() > massOmegaMin && casc.mOmega() < massOmegaMax && casc.mLambda() > massLambdaMin && casc.mLambda() < massLambdaMax) { + fillTree(casc, aod::pid_studies::Particle::NotMatched); + } + } + } + PROCESS_SWITCH(HfPidStudies, processData, "Process data", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 1cd6c6b4999e2a3a1c1e51a0e0635c9e7756aaf6 Mon Sep 17 00:00:00 2001 From: Ionut Cristian Arsene Date: Mon, 25 Nov 2024 16:11:14 +0100 Subject: [PATCH 090/459] [PWGDQ] Many optimizations and warning fixes (#8637) Co-authored-by: Ionut Cristian Arsene --- PWGDQ/Core/HistogramManager.cxx | 4 +- .../TableProducer/tableMakerMC_withAssoc.cxx | 305 +++++---- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 102 +-- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 549 +++++++-------- PWGDQ/Tasks/tableReader_withAssoc.cxx | 631 ++++++++++-------- 5 files changed, 876 insertions(+), 715 deletions(-) diff --git a/PWGDQ/Core/HistogramManager.cxx b/PWGDQ/Core/HistogramManager.cxx index 19956da4496..f66ced3ca8b 100644 --- a/PWGDQ/Core/HistogramManager.cxx +++ b/PWGDQ/Core/HistogramManager.cxx @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include "Framework/Logger.h" using namespace std; @@ -137,7 +139,7 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co } // check whether this histogram name was used before if (hList->FindObject(hname)) { - LOG(warn) << "HistogramManager::AddHistogram(): Histogram " << hname << " already exists"; + LOG(warn) << "HistogramManager::AddHistogram(): Histogram " << hname << " already exists in class " << histClass; return; } diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index bcb465d13fb..d6a4270bb10 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -17,6 +17,10 @@ // and the MC truth particles corresponding to the reconstructed tracks selected by the specified track cuts on reconstructed data. #include +#include +#include +#include +#include #include "TList.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -56,6 +60,7 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; +// Declare Joins used in the various process functions using MyBarrelTracks = soa::Join; using MyEventsWithCentAndMults = soa::Join; +// Declare bit maps containing information on the table joins content (used as argument in templated functions) // constexpr static uint32_t gkEventFillMap = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision; constexpr static uint32_t gkEventFillMapWithMults = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionMult | VarManager::ObjTypes::CollisionMultExtra; // constexpr static uint32_t gkEventFillMapWithCent = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision | VarManager::ObjTypes::CollisionCent; @@ -132,51 +138,60 @@ struct TableMakerMC { OutputObj fStatsList{"Statistics"}; //! skimming statistics HistogramManager* fHistMan; + Configurable fIsRun2{"cfgIsRun2", false, "Whether we analyze Run-2 or Run-3 data"}; + // Event and track AnalysisCut configurables - Configurable fConfigEventCuts{"cfgEventCuts", "eventStandard", "Event selection"}; - Configurable fConfigTrackCuts{"cfgBarrelTrackCuts", "jpsiPID1", "barrel track cut"}; - Configurable fConfigMuonCuts{"cfgMuonCuts", "muonQualityCuts", "Comma separated list of muon cuts"}; + struct : ConfigurableGroup { + Configurable fConfigEventCuts{"cfgEventCuts", "eventStandard", "Event selection"}; + Configurable fConfigTrackCuts{"cfgBarrelTrackCuts", "jpsiPID1", "barrel track cut"}; + Configurable fConfigMuonCuts{"cfgMuonCuts", "muonQualityCuts", "Comma separated list of muon cuts"}; + } fConfigCuts; // MC signals to be skimmed Configurable fConfigMCSignals{"cfgMCsignals", "", "Comma separated list of MC signals"}; // Steer QA output - Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; - Configurable fConfigDetailedQA{"cfgDetailedQA", false, "If true, include more QA histograms (BeforeCuts classes)"}; - Configurable fConfigAddEventHistogram{"cfgAddEventHistogram", "", "Comma separated list of histograms"}; - Configurable fConfigAddTrackHistogram{"cfgAddTrackHistogram", "", "Comma separated list of histograms"}; - Configurable fConfigAddMuonHistogram{"cfgAddMuonHistogram", "", "Comma separated list of histograms"}; - Configurable fConfigAddMCTruthHistogram{"cfgAddMCTruthHistogram", "", "Comma separated list of histograms"}; + struct : ConfigurableGroup { + Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; + Configurable fConfigDetailedQA{"cfgDetailedQA", false, "If true, include more QA histograms (BeforeCuts classes)"}; + Configurable fConfigAddEventHistogram{"cfgAddEventHistogram", "", "Comma separated list of histograms"}; + Configurable fConfigAddTrackHistogram{"cfgAddTrackHistogram", "", "Comma separated list of histograms"}; + Configurable fConfigAddMuonHistogram{"cfgAddMuonHistogram", "", "Comma separated list of histograms"}; + Configurable fConfigAddMCTruthHistogram{"cfgAddMCTruthHistogram", "", "Comma separated list of histograms"}; + } fConfigHistOutput; // Selections to be applied as Filter on the Track and FwdTrack - Configurable fIsRun2{"cfgIsRun2", false, "Whether we analyze Run-2 or Run-3 data"}; - Configurable fConfigBarrelTrackMaxAbsEta{"cfgBarrelMaxAbsEta", 0.9f, "Eta absolute value cut for tracks in the barrel"}; + /*Configurable fConfigBarrelTrackMaxAbsEta{"cfgBarrelMaxAbsEta", 0.9f, "Eta absolute value cut for tracks in the barrel"}; Configurable fConfigBarrelTrackMinPt{"cfgBarrelMinPt", 0.5f, "Minimum pt for tracks in the barrel"}; Configurable fConfigBarrelMinTPCncls{"cfgBarrelMinTPCncls", 50.0f, "Minimum TPC cls for tracks in the barrel"}; Configurable fConfigBarrelMaxTPCchi2{"cfgBarrelMaxTPCchi2", 10.0f, "Maximum TPC chi2/ndf for tracks in the barrel"}; Configurable fConfigBarrelMaxITSchi2{"cfgBarrelMaxITSchi2", 36.0f, "Maximum ITS chi2/ndf for tracks in the barrel"}; Configurable fConfigMuonPtLow{"cfgMuonLowPt", 1.0f, "Low pt cut for muons"}; + */ // CCDB connection configurables - Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; - Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable grpmagPathRun2{"grpmagPathRun2", "GLO/GRP/GRP", "CCDB path of the GRPObject (Usage for Run 2)"}; - - // Track related options - Configurable fPropTrack{"cfgPropTrack", true, "Propagate tracks to primary vertex"}; - - // Muon related options - Configurable fPropMuon{"cfgPropMuon", true, "Propagate muon tracks through absorber (do not use if applying pairing)"}; - Configurable fRefitGlobalMuon{"cfgRefitGlobalMuon", true, "Correct global muon parameters"}; - Configurable fMuonMatchEtaMin{"cfgMuonMatchEtaMin", -4.0f, "Definition of the acceptance of muon tracks to be matched with MFT"}; - Configurable fMuonMatchEtaMax{"cfgMuonMatchEtaMax", -2.5f, "Definition of the acceptance of muon tracks to be matched with MFT"}; + struct : ConfigurableGroup { + Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable fGeoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + Configurable fGrpMagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable fGrpMagPathRun2{"grpmagPathRun2", "GLO/GRP/GRP", "CCDB path of the GRPObject (Usage for Run 2)"}; + } fConfigCCDB; + + struct : ConfigurableGroup { + // Track related options + Configurable fPropTrack{"cfgPropTrack", true, "Propagate tracks to primary vertex"}; + // Muon related options + Configurable fPropMuon{"cfgPropMuon", true, "Propagate muon tracks through absorber (do not use if applying pairing)"}; + Configurable fRefitGlobalMuon{"cfgRefitGlobalMuon", true, "Correct global muon parameters"}; + Configurable fMuonMatchEtaMin{"cfgMuonMatchEtaMin", -4.0f, "Definition of the acceptance of muon tracks to be matched with MFT"}; + Configurable fMuonMatchEtaMax{"cfgMuonMatchEtaMax", -2.5f, "Definition of the acceptance of muon tracks to be matched with MFT"}; + } fConfigVariousOptions; Service fCCDB; o2::ccdb::CcdbApi fCCDBApi; - o2::parameters::GRPObject* grpmagrun2 = nullptr; // for run 2, we access the GRPObject from GLO/GRP/GRP - o2::parameters::GRPMagField* grpmag = nullptr; // for run 3, we access GRPMagField from GLO/Config/GRPMagField + o2::parameters::GRPObject* fGrpMagRun2 = nullptr; // for run 2, we access the GRPObject from GLO/GRP/GRP + o2::parameters::GRPMagField* fGrpMag = nullptr; // for run 3, we access GRPMagField from GLO/Config/GRPMagField AnalysisCompositeCut* fEventCut; //! Event selection cut std::vector fTrackCuts; //! Barrel track cuts @@ -199,6 +214,16 @@ struct TableMakerMC { void init(o2::framework::InitContext& context) { + // Check whether barrel or muon are enabled + bool isProcessBCenabled = context.mOptions.get("processPP"); + bool isBarrelEnabled = (context.mOptions.get("processPP") || context.mOptions.get("processPPBarrelOnly") || context.mOptions.get("processPbPbBarrelOnly")); + bool isMuonEnabled = (context.mOptions.get("processPP") || context.mOptions.get("processPPMuonOnly") || context.mOptions.get("processPbPbMuonOnly")); + // Make sure at least one process function is enabled + if (!(isProcessBCenabled || isBarrelEnabled || isMuonEnabled)) { + LOG(fatal) << "No process function was enabled for TableMakerMC. Check it out!!!"; + } + + // Define user specified cut DefineCuts(); VarManager::SetDefaultVarNames(); @@ -207,68 +232,73 @@ struct TableMakerMC { fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); // Only use detailed QA when QA is set true - if (fConfigQA && fConfigDetailedQA) { + if (fConfigHistOutput.fConfigQA && fConfigHistOutput.fConfigDetailedQA) { fDoDetailedQA = true; } // Create the histogram class names to be added to the histogram manager TString histClasses = ""; + // Event histograms before any cuts if (fDoDetailedQA) { histClasses += "Event_BeforeCuts;"; } - if (fConfigQA) { + // Event histograms after cuts and for MC truth collisions + if (fConfigHistOutput.fConfigQA) { histClasses += "Event_AfterCuts;"; histClasses += "Event_MCTruth;"; } - bool enableBarrelHistos = (context.mOptions.get("processPP") || context.mOptions.get("processPPBarrelOnly") || context.mOptions.get("processPbPbBarrelOnly")); - bool enableMuonHistos = (context.mOptions.get("processPP") || context.mOptions.get("processPPMuonOnly") || context.mOptions.get("processPbPbMuonOnly")); - - LOG(info) << "enable barrel/muon histograms :: " << enableBarrelHistos << " / " << enableMuonHistos; - - // TODO: switch on/off histogram classes depending on which process function we run - if (enableBarrelHistos) { + if (isBarrelEnabled) { + // Barrel track histograms before cuts if (fDoDetailedQA) { histClasses += "TrackBarrel_BeforeCuts;"; } - if (fConfigQA) { + // Barrel track histograms after cuts; one directory per cut + if (fConfigHistOutput.fConfigQA) { for (auto& cut : fTrackCuts) { histClasses += Form("TrackBarrel_%s;", cut.GetName()); } } } - if (enableMuonHistos) { + if (isMuonEnabled) { + // Muon track histograms before cuts if (fDoDetailedQA) { histClasses += "Muons_BeforeCuts;"; } - if (fConfigQA) { + // Muon track histograms after cuts; one directory per cut + if (fConfigHistOutput.fConfigQA) { for (auto& muonCut : fMuonCuts) { histClasses += Form("Muons_%s;", muonCut.GetName()); } } } + // Configure user specified MC signals and setup histogram classes TString configNamesStr = fConfigMCSignals.value; std::unique_ptr objArray(configNamesStr.Tokenize(",")); if (objArray->GetEntries() > 0) { + // loop over MC signals for (int isig = 0; isig < objArray->GetEntries(); ++isig) { MCSignal* sig = o2::aod::dqmcsignals::GetMCSignal(objArray->At(isig)->GetName()); if (sig) { fMCSignals.push_back(*sig); - if (fConfigQA) { + // setup a histogram directory for this MC signal + if (fConfigHistOutput.fConfigQA) { histClasses += Form("MCTruth_%s;", objArray->At(isig)->GetName()); } } else { continue; } if (fDoDetailedQA) { - if (enableBarrelHistos) { + if (isBarrelEnabled) { + // in case of detailed QA, setup histogram directories for each combination of reconstructed track cuts and MC signals for (auto& cut : fTrackCuts) { histClasses += Form("TrackBarrel_%s_%s;", cut.GetName(), objArray->At(isig)->GetName()); } } - if (enableMuonHistos) { + if (isMuonEnabled) { + // in case of detailed QA, setup histogram directories for each combination of reconstructed muon cuts and MC signals for (auto& cut : fMuonCuts) { histClasses += Form("Muons_%s_%s;", cut.GetName(), objArray->At(isig)->GetName()); } @@ -281,24 +311,25 @@ struct TableMakerMC { VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill fOutputList.setObject(fHistMan->GetMainHistogramList()); - fCCDB->setURL(fConfigCcdbUrl); + // Setup the CCDB + fCCDB->setURL(fConfigCCDB.fConfigCcdbUrl); fCCDB->setCaching(true); fCCDB->setLocalObjectValidityChecking(); if (!o2::base::GeometryManager::isGeometryLoaded()) { - fCCDB->get(geoPath); + fCCDB->get(fConfigCCDB.fGeoPath); } - fCCDBApi.init(fConfigCcdbUrl.value); + fCCDBApi.init(fConfigCCDB.fConfigCcdbUrl.value); } void DefineCuts() { // Event cuts fEventCut = new AnalysisCompositeCut(true); - TString eventCutStr = fConfigEventCuts.value; + TString eventCutStr = fConfigCuts.fConfigEventCuts.value; fEventCut->AddCut(dqcuts::GetAnalysisCut(eventCutStr.Data())); // Barrel track cuts - TString cutNamesStr = fConfigTrackCuts.value; + TString cutNamesStr = fConfigCuts.fConfigTrackCuts.value; if (!cutNamesStr.IsNull()) { std::unique_ptr objArray(cutNamesStr.Tokenize(",")); for (int icut = 0; icut < objArray->GetEntries(); ++icut) { @@ -307,7 +338,7 @@ struct TableMakerMC { } // Muon cuts - cutNamesStr = fConfigMuonCuts.value; + cutNamesStr = fConfigCuts.fConfigMuonCuts.value; if (!cutNamesStr.IsNull()) { std::unique_ptr objArray(cutNamesStr.Tokenize(",")); for (int icut = 0; icut < objArray->GetEntries(); ++icut) { @@ -329,10 +360,13 @@ struct TableMakerMC { // one has to do a mapping of the old vs new indices so that the skimmed labels are properly updated. VarManager::ResetValues(0, VarManager::kNVars); + // Loop over MC collisions for (auto& mcCollision : mcCollisions) { + // Get MC collision information into the VarManager VarManager::FillEvent(mcCollision); + // Fill histograms fHistMan->FillHistClass("Event_MCTruth", VarManager::fgValues); - + // Create the skimmed table entry for this collision eventMC(mcCollision.generatorsID(), mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.t(), mcCollision.weight(), mcCollision.impactParameter()); } @@ -340,16 +374,21 @@ struct TableMakerMC { void skimMCParticles(aod::McParticles const& mcTracks, aod::McCollisions const&) { - // select MC particles which fulfill at least one of the specified MC signals + // Select MC particles which fulfill at least one of the user specified MC signals + // In this function we just fill a map with the labels of selected particles, not creating the tables themselves. + // The reason is that in the skims we will additionally add any MC label connected to selected reconstructed tracks + // which were not selected already via the MC signals + + // Clear the label maps fLabelsMap.clear(); fLabelsMapReversed.clear(); fMCFlags.clear(); - uint16_t mcflags = 0; + uint16_t mcflags = static_cast(0); // flags which will hold the decisions for each MC signal int trackCounter = 0; for (auto& mctrack : mcTracks) { - // check all the requested MC signals and fill a decision bit map + // check all the requested MC signals and fill the decision bit map mcflags = 0; int i = 0; for (auto& sig : fMCSignals) { @@ -361,28 +400,29 @@ struct TableMakerMC { checked = sig.CheckSignal(true, mctrack); } if (checked) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); } i++; } + // if no MC signals were matched, continue if (mcflags == 0) { continue; } - if (!(fLabelsMap.find(mctrack.globalIndex()) != fLabelsMap.end())) { + // If this MC track was not already added to the map, add it now + if (fLabelsMap.find(mctrack.globalIndex()) == fLabelsMap.end()) { fLabelsMap[mctrack.globalIndex()] = trackCounter; fLabelsMapReversed[trackCounter] = mctrack.globalIndex(); fMCFlags[mctrack.globalIndex()] = mcflags; trackCounter++; - // if any of the MC signals was matched, then fill histograms and write that MC particle into the new stack // fill histograms for each of the signals, if found - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { VarManager::FillTrackMC(mcTracks, mctrack); VarManager::FillEvent(mctrack.mcCollision()); int j = 0; for (auto signal = fMCSignals.begin(); signal != fMCSignals.end(); signal++, j++) { - if (mcflags & (uint16_t(1) << j)) { + if (mcflags & (static_cast(1) << j)) { fHistMan->FillHistClass(Form("MCTruth_%s", (*signal).GetName()), VarManager::fgValues); } } @@ -394,7 +434,9 @@ struct TableMakerMC { template void skimCollisions(TEvents const& collisions, BCsWithTimestamps const& /*bcs*/) { - // Skim collisions + // Skim reconstructed collisions which are selected by the user specified cuts + + // Create a collision index map to relate between the "old" AO2D indices and the skimmed ones fCollIndexMap.clear(); int multTPC = -1.0; float multFV0A = -1.0; @@ -409,8 +451,10 @@ struct TableMakerMC { int multTracksPV = -1.0; float centFT0C = -1.0; + // Loop over collisions for (const auto& collision : collisions) { + // Fill the stats event histogram with the event selection bits for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { (reinterpret_cast(fStatsList->At(0)))->Fill(1.0, static_cast(i)); @@ -420,14 +464,15 @@ struct TableMakerMC { auto bc = collision.template bc_as(); // store the selection decisions - uint64_t tag = 0; + uint64_t tag = static_cast(0); // store some more information in the tag - // if the BC found by event selection does not coincide with the collision.bc() + // if the BC found by event selection does not coincide with the collision.bc(), toggle the first bit auto bcEvSel = collision.template foundBC_as(); if (bcEvSel.globalIndex() != bc.globalIndex()) { - tag |= (uint64_t(1) << 0); + tag |= (static_cast(1) << 0); } + // Compute BC and event quantities and fill histograms VarManager::ResetValues(0, VarManager::kNEventWiseVariables); VarManager::FillBC(bc); VarManager::FillEvent(collision); // extract event information and place it in the fValues array @@ -444,6 +489,7 @@ struct TableMakerMC { } (reinterpret_cast(fStatsList->At(0)))->Fill(2.0, static_cast(o2::aod::evsel::kNsel)); + // Apply the user specified event selection if (!fEventCut->IsSelected(VarManager::fgValues)) { continue; } @@ -456,6 +502,7 @@ struct TableMakerMC { } (reinterpret_cast(fStatsList->At(0)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); + // Fill historams after event cuts fHistMan->FillHistClass("Event_AfterCuts", VarManager::fgValues); // create the event tables @@ -488,6 +535,7 @@ struct TableMakerMC { 0, 0, 0.0, 0.0, 0, 0); } + // add an element for this collision into the map fCollIndexMap[collision.globalIndex()] = event.lastIndex(); } } @@ -495,46 +543,48 @@ struct TableMakerMC { template void skimTracks(TEvent const& collision, TTracks const& /*tracks*/, TrackAssoc const& assocs, aod::McParticles const& mcTracks) { - // Skim the barrel tracks - // Loop over the collision-track associations, retrieve the track, and apply track cuts for selection - // Tracks are written only once, even if they constribute to more than one association - // It is assumed that we do not apply cuts which depend on the track-collision association at the skimming time (e.g. DCA) - - uint64_t trackFilteringTag = uint64_t(0); - uint64_t trackTempFilterMap = uint8_t(0); - uint16_t mcflags = 0; + // Skim the barrel track associations + // Apply track cuts for each collision association and if it passes the cuts, we skim it. + // NOTE: If selection cuts include conditions on quantities dependent on the associated collision (e.g. DCA), + // one track may pass for some association and fail for others. + // Tracks are written only once in the skims, even if they contribute to more than one association + // so in case of multiple associations, the variables depending on the collision association (e.g. DCA, secondary vertexing, etc) + // have to be recomputed at analysis time for each association. + + uint64_t trackFilteringTag = static_cast(0); + uint32_t trackTempFilterMap = static_cast(0); + uint16_t mcflags = static_cast(0); int trackCounter = fLabelsMap.size(); + // Loop over associations for (const auto& assoc : assocs) { auto track = assoc.template track_as(); - // If this track exists already in the index map, it was checked already. - // So at this point we just skim the association and continue - // NOTE: This means we do not make cuts based on the barrel track-collision association in the skimming - if (fTrackIndexMap.find(track.globalIndex()) != fTrackIndexMap.end()) { - trackBarrelAssoc(fCollIndexMap[collision.globalIndex()], fTrackIndexMap[track.globalIndex()]); + // If the original collision of this track was not selected for skimming, then we skip this track. + // Normally, the filter-pp is selecting all collisions which contain the tracks which contributed to the triggering + // of an event, so this is rejecting possibly a few tracks unrelated to the trigger, originally associated with collisions distant in time. + if (fCollIndexMap.find(track.collisionId()) == fCollIndexMap.end()) { continue; } - // Here we have new tracks - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); + + // Compute track quantities and fill histograms VarManager::FillTrack(track); - if (fPropTrack && (track.collisionId() != collision.globalIndex())) { + if (fConfigVariousOptions.fPropTrack && (track.collisionId() != collision.globalIndex())) { VarManager::FillTrackCollision(track, collision); } if (fDoDetailedQA) { fHistMan->FillHistClass("TrackBarrel_BeforeCuts", VarManager::fgValues); } - // apply track cuts and fill stats histogram + // apply track cuts and fill histograms int i = 0; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, i++) { if ((*cut).IsSelected(VarManager::fgValues)) { - trackTempFilterMap |= (uint8_t(1) << i); - // NOTE: the QA is filled here for every (collision,track) association - // TODO: create a statistics histograms with unique tracks - if (fConfigQA) { + trackTempFilterMap |= (static_cast(1) << i); + if (fConfigHistOutput.fConfigQA) { fHistMan->FillHistClass(Form("TrackBarrel_%s", (*cut).GetName()), VarManager::fgValues); } (reinterpret_cast(fStatsList->At(1)))->Fill(static_cast(i)); @@ -544,9 +594,16 @@ struct TableMakerMC { continue; } - // store selection information in the track tag + // If this track is already present in the index map, it means it was already skimmed, + // so we just store the association and we skip the track + if (fTrackIndexMap.find(track.globalIndex()) != fTrackIndexMap.end()) { + trackBarrelAssoc(fCollIndexMap[collision.globalIndex()], fTrackIndexMap[track.globalIndex()]); + continue; + } + + // store V0 and Dalitz bits selection information in the track tag if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackV0Bits)) { // BIT0-4: V0Bits - trackFilteringTag |= uint64_t(track.pidbit()); + trackFilteringTag |= static_cast(track.pidbit()); for (int iv0 = 0; iv0 < 5; iv0++) { if (track.pidbit() & (uint8_t(1) << iv0)) { (reinterpret_cast(fStatsList->At(1)))->Fill(fTrackCuts.size() + static_cast(iv0)); @@ -554,18 +611,17 @@ struct TableMakerMC { } } // end if V0Bits if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::DalitzBits)) { - trackFilteringTag |= (uint64_t(track.dalitzBits()) << VarManager::kDalitzBits); // BIT5-12: Dalitz + trackFilteringTag |= (static_cast(track.dalitzBits()) << VarManager::kDalitzBits); // BIT5-12: Dalitz } - trackFilteringTag |= (uint64_t(trackTempFilterMap) << VarManager::kBarrelUserCutsBits); // BIT13-...: user track filters + trackFilteringTag |= (static_cast(trackTempFilterMap) << VarManager::kBarrelUserCutsBits); // BIT13-...: user track filters // NOTE: The collision ID that is written in the table is the one originally assigned in the AOD. // However, in data analysis one should loop over associations, so this one should not be used. // In the case of Run2-like analysis, there will be no associations, so this ID will be the one originally assigned in the AO2Ds (updated for the skims) - uint32_t reducedEventIdx = -1; - if (track.has_collision() && - fCollIndexMap.find(track.collisionId()) != fCollIndexMap.end()) { // if the original track collisionId is from a not skimmed collision, keep -1 as coll index - reducedEventIdx = fCollIndexMap[track.collisionId()]; - } + uint32_t reducedEventIdx = fCollIndexMap[track.collisionId()]; + + // NOTE: trackBarrelInfo stores the index of the collision as in AO2D (for use in some cases where the analysis on skims is done + // in workflows where the original AO2Ds are also present) trackBarrelInfo(track.collisionId(), collision.posX(), collision.posY(), collision.posZ(), track.globalIndex()); trackBasic(reducedEventIdx, trackFilteringTag, track.pt(), track.eta(), track.phi(), track.sign(), 0); trackBarrel(track.x(), track.alpha(), track.y(), track.z(), track.snp(), track.tgl(), track.signed1Pt(), @@ -603,7 +659,8 @@ struct TableMakerMC { // check all the specified signals and fill histograms for MC truth matched tracks for (auto& sig : fMCSignals) { if (sig.CheckSignal(true, mctrack)) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); + // If detailed QA is on, fill histograms for each MC signal and track cut combination if (fDoDetailedQA) { j = 0; for (auto& cut : fTrackCuts) { @@ -640,7 +697,7 @@ struct TableMakerMC { for (const auto& assoc : mftAssocs) { auto track = assoc.template mfttrack_as(); - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { VarManager::FillTrack(track); fHistMan->FillHistClass("MftTracks", VarManager::fgValues); } @@ -648,8 +705,8 @@ struct TableMakerMC { // write the MFT track global index in the map for skimming (to make sure we have it just once) if (fMftIndexMap.find(track.globalIndex()) == fMftIndexMap.end()) { uint32_t reducedEventIdx = fCollIndexMap[collision.globalIndex()]; - mftTrack(reducedEventIdx, uint64_t(0), track.pt(), track.eta(), track.phi()); - // TODO: We are not writing the DCA at the moment, because this depend on the collision association + mftTrack(reducedEventIdx, static_cast(0), track.pt(), track.eta(), track.phi()); + // TODO: We are not writing the DCA at the moment, because this depends on the collision association mftTrackExtra(track.mftClusterSizesAndTrackFlags(), track.sign(), 0.0, 0.0, track.nClusters()); fMftIndexMap[track.globalIndex()] = mftTrack.lastIndex(); @@ -665,10 +722,10 @@ struct TableMakerMC { // Loop over the collision-track associations, recompute track properties depending on the collision assigned, and apply track cuts for selection // Muons are written only once, even if they constribute to more than one association, // which means that in the case of multiple associations, the track parameters are wrong and should be computed again at analysis time. - uint8_t trackFilteringTag = uint8_t(0); - uint8_t trackTempFilterMap = uint8_t(0); + uint8_t trackFilteringTag = static_cast(0); + uint8_t trackTempFilterMap = static_cast(0); fFwdTrackIndexMapReversed.clear(); - uint16_t mcflags = 0; + uint16_t mcflags = static_cast(0); int trackCounter = fLabelsMap.size(); uint32_t offset = muonBasic.lastIndex(); @@ -682,13 +739,13 @@ struct TableMakerMC { VarManager::FillTrack(muon); // NOTE: If a muon is associated to multiple collisions, depending on the selections, // it may be accepted for some associations and rejected for other - if (fPropMuon) { + if (fConfigVariousOptions.fPropMuon) { VarManager::FillPropagateMuon(muon, collision); } // recalculte pDca and global muon kinematics - if (static_cast(muon.trackType()) < 2 && fRefitGlobalMuon) { + if (static_cast(muon.trackType()) < 2 && fConfigVariousOptions.fRefitGlobalMuon) { auto muontrack = muon.template matchMCHTrack_as(); - if (muontrack.eta() < fMuonMatchEtaMin || muontrack.eta() > fMuonMatchEtaMax) { + if (muontrack.eta() < fConfigVariousOptions.fMuonMatchEtaMin || muontrack.eta() > fConfigVariousOptions.fMuonMatchEtaMax) { continue; } auto mfttrack = muon.template matchMFTTrack_as(); @@ -701,12 +758,12 @@ struct TableMakerMC { if (fDoDetailedQA) { fHistMan->FillHistClass("Muons_BeforeCuts", VarManager::fgValues); } - // check the cuts and filters + // check the cuts and fill histograms for each fulfilled cut int i = 0; for (auto cut = fMuonCuts.begin(); cut != fMuonCuts.end(); cut++, i++) { if ((*cut).IsSelected(VarManager::fgValues)) { trackTempFilterMap |= (uint8_t(1) << i); - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { fHistMan->FillHistClass(Form("Muons_%s", (*cut).GetName()), VarManager::fgValues); } (reinterpret_cast(fStatsList->At(2)))->Fill(static_cast(i)); @@ -742,7 +799,7 @@ struct TableMakerMC { // check all the specified signals and fill histograms for MC truth matched tracks for (auto& sig : fMCSignals) { if (sig.CheckSignal(true, mctrack)) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); if (fDoDetailedQA) { for (auto& cut : fMuonCuts) { if (trackTempFilterMap & (uint8_t(1) << j)) { @@ -797,11 +854,11 @@ struct TableMakerMC { } } VarManager::FillTrack(muon); - if (fPropMuon) { + if (fConfigVariousOptions.fPropMuon) { VarManager::FillPropagateMuon(muon, collision); } // recalculte pDca and global muon kinematics - if (static_cast(muon.trackType()) < 2 && fRefitGlobalMuon) { + if (static_cast(muon.trackType()) < 2 && fConfigVariousOptions.fRefitGlobalMuon) { auto muontrack = muon.template matchMCHTrack_as(); auto mfttrack = muon.template matchMFTTrack_as(); VarManager::FillTrackCollision(muontrack, collision); @@ -838,16 +895,17 @@ struct TableMakerMC { TTrackAssoc const& trackAssocs, TFwdTrackAssoc const& fwdTrackAssocs, TMFTTrackAssoc const& mftAssocs, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) { + // Check whether the run changed and update CCDB if it did if (bcs.size() > 0 && fCurrentRun != bcs.begin().runNumber()) { if (fIsRun2 == true) { - grpmagrun2 = fCCDB->getForTimeStamp(grpmagPathRun2, bcs.begin().timestamp()); - if (grpmagrun2 != nullptr) { - o2::base::Propagator::initFieldFromGRP(grpmagrun2); + fGrpMagRun2 = fCCDB->getForTimeStamp(fConfigCCDB.fGrpMagPathRun2, bcs.begin().timestamp()); + if (fGrpMagRun2 != nullptr) { + o2::base::Propagator::initFieldFromGRP(fGrpMagRun2); } } else { - grpmag = fCCDB->getForTimeStamp(grpmagPath, bcs.begin().timestamp()); - if (grpmag != nullptr) { - o2::base::Propagator::initFieldFromGRP(grpmag); + fGrpMag = fCCDB->getForTimeStamp(fConfigCCDB.fGrpMagPath, bcs.begin().timestamp()); + if (fGrpMag != nullptr) { + o2::base::Propagator::initFieldFromGRP(fGrpMag); } } std::map metadataRCT, header; @@ -878,6 +936,7 @@ struct TableMakerMC { return; } + // Clear index map and reserve memory for barrel tables if constexpr (static_cast(TTrackFillMap)) { fTrackIndexMap.clear(); trackBarrelInfo.reserve(tracksBarrel.size()); @@ -889,6 +948,7 @@ struct TableMakerMC { trackBarrelLabels.reserve(tracksBarrel.size()); } + // Clear index map and reserve memory for MFT tables if constexpr (static_cast(TMFTFillMap)) { fMftIndexMap.clear(); mftTrack.reserve(mftTracks.size()); @@ -896,6 +956,7 @@ struct TableMakerMC { mftAssoc.reserve(mftTracks.size()); } + // Clear index map and reserve memory for muon tables if constexpr (static_cast(TMuonFillMap)) { fFwdTrackIndexMap.clear(); fFwdTrackFilterMap.clear(); @@ -978,7 +1039,7 @@ struct TableMakerMC { mctrack.weight(), mctrack.pt(), mctrack.eta(), mctrack.phi(), mctrack.e(), mctrack.vx(), mctrack.vy(), mctrack.vz(), mctrack.vt(), mcflags); for (unsigned int isig = 0; isig < fMCSignals.size(); isig++) { - if (mcflags & (uint16_t(1) << isig)) { + if (mcflags & (static_cast(1) << isig)) { (reinterpret_cast(fStatsList->At(3)))->Fill(static_cast(isig)); } } @@ -993,36 +1054,36 @@ struct TableMakerMC { std::unique_ptr objArray(histClasses.Tokenize(";")); for (Int_t iclass = 0; iclass < objArray->GetEntries(); ++iclass) { TString classStr = objArray->At(iclass)->GetName(); - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { fHistMan->AddHistClass(classStr.Data()); } - TString histEventName = fConfigAddEventHistogram.value; + TString histEventName = fConfigHistOutput.fConfigAddEventHistogram.value; if (classStr.Contains("Event")) { - if (fConfigQA && !classStr.Contains("MCTruth")) { + if (fConfigHistOutput.fConfigQA && !classStr.Contains("MCTruth")) { dqhistograms::DefineHistograms(fHistMan, objArray->At(iclass)->GetName(), "event", histEventName); } else { dqhistograms::DefineHistograms(fHistMan, objArray->At(iclass)->GetName(), "event", "generator"); } } - TString histTrackName = fConfigAddTrackHistogram.value; + TString histTrackName = fConfigHistOutput.fConfigAddTrackHistogram.value; if (classStr.Contains("Track")) { - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { dqhistograms::DefineHistograms(fHistMan, objArray->At(iclass)->GetName(), "track", histTrackName); } } - TString histMuonName = fConfigAddMuonHistogram.value; + TString histMuonName = fConfigHistOutput.fConfigAddMuonHistogram.value; if (classStr.Contains("Muons")) { - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { dqhistograms::DefineHistograms(fHistMan, objArray->At(iclass)->GetName(), "track", histMuonName); } } - TString histMCTruthName = fConfigAddMCTruthHistogram.value; + TString histMCTruthName = fConfigHistOutput.fConfigAddMCTruthHistogram.value; if (classStr.Contains("MCTruth") && !classStr.Contains("Event")) { - if (fConfigQA) { + if (fConfigHistOutput.fConfigQA) { dqhistograms::DefineHistograms(fHistMan, objArray->At(iclass)->GetName(), "mctruth_track", histMCTruthName); } } diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index d475c222f61..8f437b7955c 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -665,6 +665,13 @@ struct TableMaker { // get the track auto track = assoc.template track_as(); + // If the original collision of this track was not selected for skimming, then we skip this track. + // Normally, the filter-pp is selecting all collisions which contain the tracks which contributed to the triggering + // of an event, so this is rejecting possibly a few tracks unrelated to the trigger, originally associated with collisions distant in time. + if (fCollIndexMap.find(track.collisionId()) == fCollIndexMap.end()) { + continue; + } + trackFilteringTag = static_cast(0); trackTempFilterMap = static_cast(0); VarManager::FillTrack(track); @@ -695,6 +702,13 @@ struct TableMaker { continue; } + // If this track is already present in the index map, it means it was already skimmed, + // so we just store the association and we skip the track + if (fTrackIndexMap.find(track.globalIndex()) != fTrackIndexMap.end()) { + trackBarrelAssoc(fCollIndexMap[collision.globalIndex()], fTrackIndexMap[track.globalIndex()]); + continue; + } + // store selection information in the track tag if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackV0Bits)) { // BIT0-4: V0Bits trackFilteringTag |= static_cast(track.pidbit()); @@ -733,57 +747,49 @@ struct TableMaker { trackFilteringTag |= (static_cast(1) << VarManager::kIsTPCPostcalibrated); } } - // write the track global index in the map for skimming (to make sure we have it just once) - if (fTrackIndexMap.find(track.globalIndex()) == fTrackIndexMap.end()) { - - // Calculating the percentage of orphan tracks i.e., tracks which have no collisions associated to it - if (!track.has_collision()) { - (reinterpret_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(static_cast(-1)); - } else { - (reinterpret_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(0.9); - } - // NOTE: The collision ID written in the table is the one of the original collision assigned in the AO2D. - // The reason is that the time associated to the track is wrt that collision. - // If new associations are done with the skimmed data, the track time wrt new collision can then be recomputed based on the - // relative difference in time between the original and the new collision. + // Calculating the percentage of orphan tracks i.e., tracks which have no collisions associated to it + if (!track.has_collision()) { + (reinterpret_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(static_cast(-1)); + } else { + (reinterpret_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(0.9); + } - // If the original collision of this track was not selected for skimming, then we skip this track. - // Normally, the filter-pp is selecting all collisions which contain the tracks which contributed to the triggering - // of an event, so this is rejecting possibly a few tracks originally associated with collisions distant in time. - if (fCollIndexMap.find(track.collisionId()) == fCollIndexMap.end()) { - continue; - } - uint32_t reducedEventIdx = fCollIndexMap[track.collisionId()]; // This gives the original iD of the track - // NOTE: trackBarrelInfo stores the index of the collision as in AO2D (for use in some cases where the analysis on skims is done - // in workflows where the original AO2Ds are also present) - trackBarrelInfo(collision.globalIndex(), collision.posX(), collision.posY(), collision.posZ(), track.globalIndex()); - trackBasic(reducedEventIdx, trackFilteringTag, track.pt(), track.eta(), track.phi(), track.sign(), 0); - trackBarrel(track.x(), track.alpha(), track.y(), track.z(), track.snp(), track.tgl(), track.signed1Pt(), - track.tpcInnerParam(), track.flags(), track.itsClusterMap(), track.itsChi2NCl(), - track.tpcNClsFindable(), track.tpcNClsFindableMinusFound(), track.tpcNClsFindableMinusCrossedRows(), - track.tpcNClsShared(), track.tpcChi2NCl(), - track.trdChi2(), track.trdPattern(), track.tofChi2(), - track.length(), track.dcaXY(), track.dcaZ(), - track.trackTime(), track.trackTimeRes(), track.tofExpMom(), - track.detectorMap()); - if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackCov)) { - trackBarrelCov(track.cYY(), track.cZY(), track.cZZ(), track.cSnpY(), track.cSnpZ(), - track.cSnpSnp(), track.cTglY(), track.cTglZ(), track.cTglSnp(), track.cTglTgl(), - track.c1PtY(), track.c1PtZ(), track.c1PtSnp(), track.c1PtTgl(), track.c1Pt21Pt2()); - } - if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackPID)) { - float nSigmaEl = (fConfigPostCalibTPC.fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaEl_Corr] : track.tpcNSigmaEl()); - float nSigmaPi = (fConfigPostCalibTPC.fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPi_Corr] : track.tpcNSigmaPi()); - float nSigmaKa = ((fConfigPostCalibTPC.fConfigComputeTPCpostCalib && fConfigPostCalibTPC.fConfigComputeTPCpostCalibKaon) ? VarManager::fgValues[VarManager::kTPCnSigmaKa_Corr] : track.tpcNSigmaKa()); - float nSigmaPr = (fConfigPostCalibTPC.fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPr_Corr] : track.tpcNSigmaPr()); - trackBarrelPID(track.tpcSignal(), - nSigmaEl, track.tpcNSigmaMu(), nSigmaPi, nSigmaKa, nSigmaPr, - track.beta(), track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), - track.trdSignal()); - } - fTrackIndexMap[track.globalIndex()] = trackBasic.lastIndex(); + // NOTE: The collision ID written in the table is the one of the original collision assigned in the AO2D. + // The reason is that the time associated to the track is wrt that collision. + // If new associations are done with the skimmed data, the track time wrt new collision can then be recomputed based on the + // relative difference in time between the original and the new collision. + uint32_t reducedEventIdx = fCollIndexMap[track.collisionId()]; // This gives the original iD of the track + + // NOTE: trackBarrelInfo stores the index of the collision as in AO2D (for use in some cases where the analysis on skims is done + // in workflows where the original AO2Ds are also present) + trackBarrelInfo(collision.globalIndex(), collision.posX(), collision.posY(), collision.posZ(), track.globalIndex()); + trackBasic(reducedEventIdx, trackFilteringTag, track.pt(), track.eta(), track.phi(), track.sign(), 0); + trackBarrel(track.x(), track.alpha(), track.y(), track.z(), track.snp(), track.tgl(), track.signed1Pt(), + track.tpcInnerParam(), track.flags(), track.itsClusterMap(), track.itsChi2NCl(), + track.tpcNClsFindable(), track.tpcNClsFindableMinusFound(), track.tpcNClsFindableMinusCrossedRows(), + track.tpcNClsShared(), track.tpcChi2NCl(), + track.trdChi2(), track.trdPattern(), track.tofChi2(), + track.length(), track.dcaXY(), track.dcaZ(), + track.trackTime(), track.trackTimeRes(), track.tofExpMom(), + track.detectorMap()); + if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackCov)) { + trackBarrelCov(track.cYY(), track.cZY(), track.cZZ(), track.cSnpY(), track.cSnpZ(), + track.cSnpSnp(), track.cTglY(), track.cTglZ(), track.cTglSnp(), track.cTglTgl(), + track.c1PtY(), track.c1PtZ(), track.c1PtSnp(), track.c1PtTgl(), track.c1Pt21Pt2()); + } + if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackPID)) { + float nSigmaEl = (fConfigPostCalibTPC.fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaEl_Corr] : track.tpcNSigmaEl()); + float nSigmaPi = (fConfigPostCalibTPC.fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPi_Corr] : track.tpcNSigmaPi()); + float nSigmaKa = ((fConfigPostCalibTPC.fConfigComputeTPCpostCalib && fConfigPostCalibTPC.fConfigComputeTPCpostCalibKaon) ? VarManager::fgValues[VarManager::kTPCnSigmaKa_Corr] : track.tpcNSigmaKa()); + float nSigmaPr = (fConfigPostCalibTPC.fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPr_Corr] : track.tpcNSigmaPr()); + trackBarrelPID(track.tpcSignal(), + nSigmaEl, track.tpcNSigmaMu(), nSigmaPi, nSigmaKa, nSigmaPr, + track.beta(), track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), + track.trdSignal()); } + fTrackIndexMap[track.globalIndex()] = trackBasic.lastIndex(); + // write the skimmed collision - track association trackBarrelAssoc(fCollIndexMap[collision.globalIndex()], fTrackIndexMap[track.globalIndex()]); } // end loop over associations diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 018d72f3c7c..9c6608ceb17 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -15,6 +15,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -76,7 +79,6 @@ DECLARE_SOA_COLUMN(TauxyBcandidate, tauxyBcandidate, float); DECLARE_SOA_COLUMN(TauzBcandidate, tauzBcandidate, float); DECLARE_SOA_COLUMN(CosPBcandidate, cosPBcandidate, float); DECLARE_SOA_COLUMN(Chi2Bcandidate, chi2Bcandidate, float); -DECLARE_SOA_COLUMN(McFlag, mcFlag, int8_t); } // namespace dqanalysisflags DECLARE_SOA_TABLE(EventCuts, "AOD", "DQANAEVCUTS", dqanalysisflags::IsEventSelected); //! joinable to ReducedEvents @@ -85,7 +87,7 @@ DECLARE_SOA_TABLE(BarrelAmbiguities, "AOD", "DQBARRELAMB", dqanalysisflags::Barr DECLARE_SOA_TABLE(MuonTrackCuts, "AOD", "DQANAMUONCUTS", dqanalysisflags::IsMuonSelected); //! joinable to ReducedMuonsAssoc DECLARE_SOA_TABLE(MuonAmbiguities, "AOD", "DQMUONAMB", dqanalysisflags::MuonAmbiguityInBunch, dqanalysisflags::MuonAmbiguityOutOfBunch); //! joinable to ReducedMuonTracks DECLARE_SOA_TABLE(Prefilter, "AOD", "DQPREFILTER", dqanalysisflags::IsBarrelSelectedPrefilter); //! joinable to ReducedTracksAssoc -DECLARE_SOA_TABLE(BmesonCandidates, "AOD", "DQBMESONS", dqanalysisflags::massBcandidate, dqanalysisflags::pTBcandidate, dqanalysisflags::LxyBcandidate, dqanalysisflags::LxyzBcandidate, dqanalysisflags::LzBcandidate, dqanalysisflags::TauxyBcandidate, dqanalysisflags::TauzBcandidate, dqanalysisflags::CosPBcandidate, dqanalysisflags::Chi2Bcandidate, dqanalysisflags::McFlag); +DECLARE_SOA_TABLE(BmesonCandidates, "AOD", "DQBMESONS", dqanalysisflags::massBcandidate, dqanalysisflags::pTBcandidate, dqanalysisflags::LxyBcandidate, dqanalysisflags::LxyzBcandidate, dqanalysisflags::LzBcandidate, dqanalysisflags::TauxyBcandidate, dqanalysisflags::TauzBcandidate, dqanalysisflags::CosPBcandidate, dqanalysisflags::Chi2Bcandidate); } // namespace o2::aod // Declarations of various short names @@ -143,6 +145,10 @@ struct AnalysisEventSelection { Configurable fConfigAddEventHistogram{"cfgAddEventHistogram", "", "Comma separated list of histograms"}; Configurable fConfigAddEventMCHistogram{"cfgAddEventMCHistogram", "generator", "Comma separated list of histograms"}; + Configurable fConfigSplitCollisionsDeltaZ{"splitCollisionsDeltaZ", 1.0, "maximum delta-z (cm) between two collisions to consider them as split candidates"}; + Configurable fConfigSplitCollisionsDeltaBC{"splitCollisionsDeltaBC", 100, "maximum delta-BC between two collisions to consider them as split candidates; do not apply if value is negative"}; + Configurable fConfigCheckSplitCollisions{"checkSplitCollisions", false, "If true, run the split collision check and fill histograms"}; + Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; @@ -173,9 +179,12 @@ struct AnalysisEventSelection { fHistMan = new HistogramManager("analysisHistos", "", VarManager::kNVars); fHistMan->SetUseDefaultVariableNames(kTRUE); fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); - DefineHistograms(fHistMan, "Event_BeforeCuts;Event_AfterCuts;OutOfBunchCorrelations;SameBunchCorrelations;", fConfigAddEventHistogram.value.data()); // define all histograms - DefineHistograms(fHistMan, "EventsMC", fConfigAddEventMCHistogram.value.data()); // define all histograms - VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill + DefineHistograms(fHistMan, "Event_BeforeCuts;Event_AfterCuts;", fConfigAddEventHistogram.value.data()); + if (fConfigCheckSplitCollisions) { + DefineHistograms(fHistMan, "OutOfBunchCorrelations;SameBunchCorrelations;", ""); + } + DefineHistograms(fHistMan, "EventsMC", fConfigAddEventMCHistogram.value.data()); + VarManager::SetUseVars(fHistMan->GetUsedVars()); fOutputList.setObject(fHistMan->GetMainHistogramList()); } @@ -194,8 +203,7 @@ struct AnalysisEventSelection { fHeader = fCCDBApi.retrieveHeaders(Form("RCT/Info/RunInformation/%i", events.begin().runNumber()), fMetadataRCT, -1); uint64_t sor = std::atol(fHeader["SOR"].c_str()); uint64_t eor = std::atol(fHeader["EOR"].c_str()); - cout << "=========================== SOR / EOR is " << sor << " / " << eor << endl; - // TODO: send SOR to VarManager and compute event times relative to SOR + VarManager::SetSORandEOR(sor, eor); } fSelMap.clear(); @@ -245,78 +253,67 @@ struct AnalysisEventSelection { // Reset the fValues array and fill event observables VarManager::ResetValues(0, VarManager::kNEventWiseVariables); - // loop over the BC map, find BCs with more than one collision and compute 2-event correlation quantities - // TODO: add also correlations for out of bunch events - // TODO: check event time resolution as a function of various multiplicity estimators - - // for (auto& [bc, evIndices] : fBCCollMap) { - for (auto it1 = fBCCollMap.begin(); it1 != fBCCollMap.end(); it1++) { - - // correlate events in neighbouring BCs (within one orbit) - for (auto it2 = it1; it2 != fBCCollMap.end(); it2++) { - if (it2 == it1) { + // loop over the BC map, get the collision vectors and make in-bunch and out of bunch 2-event correlations + for (auto bc1It = fBCCollMap.begin(); bc1It != fBCCollMap.end(); ++bc1It) { + uint64_t bc1 = bc1It->first; + auto bc1Events = bc1It->second; + + // same bunch event correlations, if more than 1 collisions in this bunch + if (bc1Events.size() > 1) { + for (auto ev1It = bc1Events.begin(); ev1It != bc1Events.end(); ++ev1It) { + auto ev1 = events.rawIteratorAt(*ev1It); + for (auto ev2It = std::next(ev1It); ev2It != bc1Events.end(); ++ev2It) { + auto ev2 = events.rawIteratorAt(*ev2It); + // compute 2-event quantities and mark the candidate split collisions + VarManager::FillTwoEvents(ev1, ev2); + if (TMath::Abs(VarManager::fgValues[VarManager::kTwoEvDeltaZ]) < fConfigSplitCollisionsDeltaZ) { // this is a possible collision split + collisionSplittingMap[*ev1It] = true; + collisionSplittingMap[*ev2It] = true; + } + fHistMan->FillHistClass("SameBunchCorrelations", VarManager::fgValues); + } // end second event loop + } // end first event loop + } // end if BC1 events > 1 + + // loop over the following BCs in the TF + for (auto bc2It = std::next(bc1It); bc2It != fBCCollMap.end(); ++bc2It) { + uint64_t bc2 = bc2It->first; + if ((bc2 > bc1 ? bc2 - bc1 : bc1 - bc2) > fConfigSplitCollisionsDeltaBC) { continue; } - - if ((it2->first - it1->first) > 100) { - break; - } - - for (auto& ev1Idx : it1->second) { - if (!fSelMap[ev1Idx]) { - continue; - } - auto ev1 = events.rawIteratorAt(ev1Idx); - for (auto& ev2Idx : it2->second) { - if (!fSelMap[ev2Idx]) { - continue; - } - auto ev2 = events.rawIteratorAt(ev2Idx); + auto bc2Events = bc2It->second; + + // loop over events in the first BC + for (auto ev1It : bc1Events) { + auto ev1 = events.rawIteratorAt(ev1It); + // loop over events in the second BC + for (auto ev2It : bc2Events) { + auto ev2 = events.rawIteratorAt(ev2It); + // compute 2-event quantities and mark the candidate split collisions VarManager::FillTwoEvents(ev1, ev2); + if (TMath::Abs(VarManager::fgValues[VarManager::kTwoEvDeltaZ]) < fConfigSplitCollisionsDeltaZ) { // this is a possible collision split + collisionSplittingMap[ev1It] = true; + collisionSplittingMap[ev2It] = true; + } fHistMan->FillHistClass("OutOfBunchCorrelations", VarManager::fgValues); } } } - - auto evIndices = it1->second; - if (evIndices.size() < 2) { - continue; - } - - // correlate the events inside one BC - for (auto ev1Idx = evIndices.begin(); ev1Idx != evIndices.end(); ++ev1Idx) { - if (!fSelMap[*ev1Idx]) { - continue; - } - auto ev1 = events.rawIteratorAt(*ev1Idx); - for (auto ev2Idx = std::next(ev1Idx); ev2Idx != evIndices.end(); ++ev2Idx) { - if (!fSelMap[*ev2Idx]) { - continue; - } - auto ev2 = events.rawIteratorAt(*ev2Idx); - VarManager::FillTwoEvents(ev1, ev2); - if (TMath::Abs(VarManager::fgValues[VarManager::kTwoEvDeltaZ]) < 1.0) { // this is a possible collision split - collisionSplittingMap[*ev1Idx] = true; - collisionSplittingMap[*ev2Idx] = true; - } - fHistMan->FillHistClass("SameBunchCorrelations", VarManager::fgValues); - } - } } // publish the table - uint32_t evSel = 0; + uint32_t evSel = static_cast(0); for (auto& event : events) { evSel = 0; if (fSelMap[event.globalIndex()]) { // event passed the user cuts - evSel |= (uint32_t(1) << 0); + evSel |= (static_cast(1) << 0); } std::vector sameBunchEvents = fBCCollMap[event.globalBC()]; if (sameBunchEvents.size() > 1) { // event with in-bunch pileup - evSel |= (uint32_t(1) << 1); + evSel |= (static_cast(1) << 1); } if (collisionSplittingMap.find(event.globalIndex()) != collisionSplittingMap.end()) { // event with possible fake in-bunch pileup (collision splitting) - evSel |= (uint32_t(1) << 2); + evSel |= (static_cast(1) << 2); } eventSel(evSel); } @@ -347,6 +344,7 @@ struct AnalysisTrackSelection { Configurable fConfigCuts{"cfgTrackCuts", "jpsiO2MCdebugCuts2", "Comma separated list of barrel track cuts"}; Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; Configurable fConfigAddTrackHistogram{"cfgAddTrackHistogram", "", "Comma separated list of histograms"}; + Configurable fConfigPublishAmbiguity{"cfgPublishAmbiguity", true, "If true, publish ambiguity table and fill QA histograms"}; Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable fConfigCcdbPathTPC{"ccdb-path-tpc", "Users/z/zhxiong/TPCPID/PostCalib", "base path to the ccdb object"}; Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; @@ -423,7 +421,9 @@ struct AnalysisTrackSelection { } DefineHistograms(fHistMan, histClasses.Data(), fConfigAddTrackHistogram.value.data()); - DefineHistograms(fHistMan, "TrackBarrel_AmbiguityInBunch;TrackBarrel_AmbiguityOutOfBunch;", "ambiguity"); + if (fConfigPublishAmbiguity) { + DefineHistograms(fHistMan, "TrackBarrel_AmbiguityInBunch;TrackBarrel_AmbiguityOutOfBunch;", "ambiguity"); + } VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill fOutputList.setObject(fHistMan->GetMainHistogramList()); } @@ -502,10 +502,10 @@ struct AnalysisTrackSelection { } int iCut = 0; - uint32_t filterMap = 0; + uint32_t filterMap = static_cast(0); for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, iCut++) { if ((*cut).IsSelected(VarManager::fgValues)) { - filterMap |= (uint32_t(1) << iCut); + filterMap |= (static_cast(1) << iCut); if (fConfigQA) { fHistMan->FillHistClass(fHistNamesReco[iCut], VarManager::fgValues); } @@ -514,24 +514,24 @@ struct AnalysisTrackSelection { trackSel(filterMap); // compute MC matching decisions and fill histograms for matched associations - uint32_t mcDecision = 0; + uint32_t mcDecision = static_cast(0); int isig = 0; if (filterMap > 0) { for (auto sig = fMCSignals.begin(); sig != fMCSignals.end(); sig++, isig++) { if (track.has_reducedMCTrack()) { if ((*sig).CheckSignal(true, track.reducedMCTrack())) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } } // fill histograms for (unsigned int i = 0; i < fMCSignals.size(); i++) { - if (!(mcDecision & (uint32_t(1) << i))) { + if (!(mcDecision & (static_cast(1) << i))) { continue; } for (unsigned int j = 0; j < fTrackCuts.size(); j++) { - if (filterMap & (uint32_t(1) << j)) { + if (filterMap & (static_cast(1) << j)) { if (isCorrectAssoc) { fHistMan->FillHistClass(fHistNamesMCMatched[j * fMCSignals.size() + 2 * i].Data(), VarManager::fgValues); } else { @@ -543,8 +543,9 @@ struct AnalysisTrackSelection { } // end if (filterMap > 0) // count the number of associations per track - if (filterMap > 0) { + if (fConfigPublishAmbiguity && filterMap > 0) { if (event.isEventSelected_bit(1)) { + // for this track, count the number of associated collisions with in-bunch pileup and out of bunch associations if (fNAssocsInBunch.find(track.globalIndex()) == fNAssocsInBunch.end()) { std::vector evVector = {event.globalIndex()}; fNAssocsInBunch[track.globalIndex()] = evVector; @@ -567,39 +568,43 @@ struct AnalysisTrackSelection { // QA the collision-track associations // TODO: some tracks can be associated to both collisions that have in bunch pileup and collisions from different bunches // So one could QA these tracks separately - for (auto& [trackIdx, evIndices] : fNAssocsInBunch) { - if (evIndices.size() == 1) { - continue; - } - auto track = tracks.rawIteratorAt(trackIdx); - VarManager::ResetValues(0, VarManager::kNBarrelTrackVariables); - VarManager::FillTrack(track); - VarManager::fgValues[VarManager::kBarrelNAssocsInBunch] = static_cast(evIndices.size()); - fHistMan->FillHistClass("TrackBarrel_AmbiguityInBunch", VarManager::fgValues); - } // end loop over in-bunch ambiguous tracks - - for (auto& [trackIdx, evIndices] : fNAssocsOutOfBunch) { - if (evIndices.size() == 1) { - continue; - } - auto track = tracks.rawIteratorAt(trackIdx); - VarManager::ResetValues(0, VarManager::kNBarrelTrackVariables); - VarManager::FillTrack(track); - VarManager::fgValues[VarManager::kBarrelNAssocsOutOfBunch] = static_cast(evIndices.size()); - fHistMan->FillHistClass("TrackBarrel_AmbiguityOutOfBunch", VarManager::fgValues); - } // end loop over out-of-bunch ambiguous tracks - - // publish the ambiguity table - for (auto& track : tracks) { - int8_t nInBunch = 0; - if (fNAssocsInBunch.find(track.globalIndex()) != fNAssocsInBunch.end()) { - nInBunch = fNAssocsInBunch[track.globalIndex()].size(); - } - int8_t nOutOfBunch = 0; - if (fNAssocsOutOfBunch.find(track.globalIndex()) != fNAssocsOutOfBunch.end()) { - nOutOfBunch = fNAssocsOutOfBunch[track.globalIndex()].size(); + if (fConfigPublishAmbiguity) { + if (fConfigQA) { + for (auto& [trackIdx, evIndices] : fNAssocsInBunch) { + if (evIndices.size() == 1) { + continue; + } + auto track = tracks.rawIteratorAt(trackIdx); + VarManager::ResetValues(0, VarManager::kNBarrelTrackVariables); + VarManager::FillTrack(track); + VarManager::fgValues[VarManager::kBarrelNAssocsInBunch] = static_cast(evIndices.size()); + fHistMan->FillHistClass("TrackBarrel_AmbiguityInBunch", VarManager::fgValues); + } // end loop over in-bunch ambiguous tracks + + for (auto& [trackIdx, evIndices] : fNAssocsOutOfBunch) { + if (evIndices.size() == 1) { + continue; + } + auto track = tracks.rawIteratorAt(trackIdx); + VarManager::ResetValues(0, VarManager::kNBarrelTrackVariables); + VarManager::FillTrack(track); + VarManager::fgValues[VarManager::kBarrelNAssocsOutOfBunch] = static_cast(evIndices.size()); + fHistMan->FillHistClass("TrackBarrel_AmbiguityOutOfBunch", VarManager::fgValues); + } // end loop over out-of-bunch ambiguous tracks + } + + // publish the ambiguity table + for (auto& track : tracks) { + int8_t nInBunch = 0; + if (fNAssocsInBunch.find(track.globalIndex()) != fNAssocsInBunch.end()) { + nInBunch = fNAssocsInBunch[track.globalIndex()].size(); + } + int8_t nOutOfBunch = 0; + if (fNAssocsOutOfBunch.find(track.globalIndex()) != fNAssocsOutOfBunch.end()) { + nOutOfBunch = fNAssocsOutOfBunch[track.globalIndex()].size(); + } + trackAmbiguities(nInBunch, nOutOfBunch); } - trackAmbiguities(nInBunch, nOutOfBunch); } } // end runTrackSelection() @@ -631,6 +636,7 @@ struct AnalysisMuonSelection { Configurable fConfigCuts{"cfgMuonCuts", "muonQualityCuts", "Comma separated list of muon cuts"}; Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; Configurable fConfigAddMuonHistogram{"cfgAddMuonHistogram", "", "Comma separated list of histograms"}; + Configurable fConfigPublishAmbiguity{"cfgPublishAmbiguity", true, "If true, publish ambiguity table and fill QA histograms"}; Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; @@ -702,7 +708,9 @@ struct AnalysisMuonSelection { histClasses += Form("%s;", nameStr2.Data()); } } - histClasses += "Muon_AmbiguityInBunch;Muon_AmbiguityOutOfBunch;"; + if (fConfigPublishAmbiguity) { + histClasses += "Muon_AmbiguityInBunch;Muon_AmbiguityOutOfBunch;"; + } DefineHistograms(fHistMan, histClasses.Data(), fConfigAddMuonHistogram.value.data()); // define all histograms VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill @@ -763,10 +771,10 @@ struct AnalysisMuonSelection { } int iCut = 0; - uint32_t filterMap = 0; + uint32_t filterMap = static_cast(0); for (auto cut = fMuonCuts.begin(); cut != fMuonCuts.end(); cut++, iCut++) { if ((*cut).IsSelected(VarManager::fgValues)) { - filterMap |= (uint32_t(1) << iCut); + filterMap |= (static_cast(1) << iCut); if (fConfigQA) { fHistMan->FillHistClass(fHistNamesReco[iCut].Data(), VarManager::fgValues); } @@ -786,13 +794,13 @@ struct AnalysisMuonSelection { } // compute MC matching decisions - uint32_t mcDecision = 0; + uint32_t mcDecision = static_cast(0); int isig = 0; for (auto sig = fMCSignals.begin(); sig != fMCSignals.end(); sig++, isig++) { if constexpr ((TMuonFillMap & VarManager::ObjTypes::ReducedMuon) > 0) { if (track.has_reducedMCTrack()) { if ((*sig).CheckSignal(true, track.reducedMCTrack())) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } } @@ -800,11 +808,11 @@ struct AnalysisMuonSelection { // fill histograms for (unsigned int i = 0; i < fMCSignals.size(); i++) { - if (!(mcDecision & (uint32_t(1) << i))) { + if (!(mcDecision & (static_cast(1) << i))) { continue; } for (unsigned int j = 0; j < fMuonCuts.size(); j++) { - if (filterMap & (uint8_t(1) << j)) { + if (filterMap & (static_cast(1) << j)) { if (isCorrectAssoc) { fHistMan->FillHistClass(fHistNamesMCMatched[j * fMCSignals.size() + 2 * i].Data(), VarManager::fgValues); } else { @@ -815,21 +823,23 @@ struct AnalysisMuonSelection { } // end loop over MC signals // count the number of associations per track - if (event.isEventSelected_bit(1)) { - if (fNAssocsInBunch.find(track.globalIndex()) == fNAssocsInBunch.end()) { - std::vector evVector = {event.globalIndex()}; - fNAssocsInBunch[track.globalIndex()] = evVector; - } else { - auto& evVector = fNAssocsInBunch[track.globalIndex()]; - evVector.push_back(event.globalIndex()); - } - } else { - if (fNAssocsOutOfBunch.find(track.globalIndex()) == fNAssocsOutOfBunch.end()) { - std::vector evVector = {event.globalIndex()}; - fNAssocsOutOfBunch[track.globalIndex()] = evVector; + if (fConfigPublishAmbiguity && filterMap > 0) { + if (event.isEventSelected_bit(1)) { + if (fNAssocsInBunch.find(track.globalIndex()) == fNAssocsInBunch.end()) { + std::vector evVector = {event.globalIndex()}; + fNAssocsInBunch[track.globalIndex()] = evVector; + } else { + auto& evVector = fNAssocsInBunch[track.globalIndex()]; + evVector.push_back(event.globalIndex()); + } } else { - auto& evVector = fNAssocsOutOfBunch[track.globalIndex()]; - evVector.push_back(event.globalIndex()); + if (fNAssocsOutOfBunch.find(track.globalIndex()) == fNAssocsOutOfBunch.end()) { + std::vector evVector = {event.globalIndex()}; + fNAssocsOutOfBunch[track.globalIndex()] = evVector; + } else { + auto& evVector = fNAssocsOutOfBunch[track.globalIndex()]; + evVector.push_back(event.globalIndex()); + } } } } // end loop over assocs @@ -837,39 +847,41 @@ struct AnalysisMuonSelection { // QA the collision-track associations // TODO: some tracks can be associated to both collisions that have in bunch pileup and collisions from different bunches // So one could QA these tracks separately - for (auto& [trackIdx, evIndices] : fNAssocsInBunch) { - if (evIndices.size() == 1) { - continue; - } - auto track = muons.rawIteratorAt(trackIdx); - VarManager::ResetValues(0, VarManager::kNVars); - VarManager::FillTrack(track); - VarManager::fgValues[VarManager::kMuonNAssocsInBunch] = static_cast(evIndices.size()); - fHistMan->FillHistClass("Muon_AmbiguityInBunch", VarManager::fgValues); - } // end loop over in-bunch ambiguous tracks - - for (auto& [trackIdx, evIndices] : fNAssocsOutOfBunch) { - if (evIndices.size() == 1) { - continue; - } - auto track = muons.rawIteratorAt(trackIdx); - VarManager::ResetValues(0, VarManager::kNVars); - VarManager::FillTrack(track); - VarManager::fgValues[VarManager::kMuonNAssocsOutOfBunch] = static_cast(evIndices.size()); - fHistMan->FillHistClass("Muon_AmbiguityOutOfBunch", VarManager::fgValues); - } // end loop over out-of-bunch ambiguous tracks - - // publish the ambiguity table - for (auto& track : muons) { - int8_t nInBunch = 0; - if (fNAssocsInBunch.find(track.globalIndex()) != fNAssocsInBunch.end()) { - nInBunch = fNAssocsInBunch[track.globalIndex()].size(); - } - int8_t nOutOfBunch = 0; - if (fNAssocsOutOfBunch.find(track.globalIndex()) != fNAssocsOutOfBunch.end()) { - nOutOfBunch = fNAssocsOutOfBunch[track.globalIndex()].size(); + if (fConfigPublishAmbiguity) { + for (auto& [trackIdx, evIndices] : fNAssocsInBunch) { + if (evIndices.size() == 1) { + continue; + } + auto track = muons.rawIteratorAt(trackIdx); + VarManager::ResetValues(0, VarManager::kNVars); + VarManager::FillTrack(track); + VarManager::fgValues[VarManager::kMuonNAssocsInBunch] = static_cast(evIndices.size()); + fHistMan->FillHistClass("Muon_AmbiguityInBunch", VarManager::fgValues); + } // end loop over in-bunch ambiguous tracks + + for (auto& [trackIdx, evIndices] : fNAssocsOutOfBunch) { + if (evIndices.size() == 1) { + continue; + } + auto track = muons.rawIteratorAt(trackIdx); + VarManager::ResetValues(0, VarManager::kNVars); + VarManager::FillTrack(track); + VarManager::fgValues[VarManager::kMuonNAssocsOutOfBunch] = static_cast(evIndices.size()); + fHistMan->FillHistClass("Muon_AmbiguityOutOfBunch", VarManager::fgValues); + } // end loop over out-of-bunch ambiguous tracks + + // publish the ambiguity table + for (auto& track : muons) { + int8_t nInBunch = 0; + if (fNAssocsInBunch.find(track.globalIndex()) != fNAssocsInBunch.end()) { + nInBunch = fNAssocsInBunch[track.globalIndex()].size(); + } + int8_t nOutOfBunch = 0; + if (fNAssocsOutOfBunch.find(track.globalIndex()) != fNAssocsOutOfBunch.end()) { + nOutOfBunch = fNAssocsOutOfBunch[track.globalIndex()].size(); + } + muonAmbiguities(nInBunch, nOutOfBunch); } - muonAmbiguities(nInBunch, nOutOfBunch); } } @@ -926,9 +938,6 @@ struct AnalysisPrefilterSelection { if (!trackCutsStr.IsNull()) { objArrayTrackCuts = trackCutsStr.Tokenize(","); } - if (objArrayTrackCuts->GetEntries() == 0) { - LOG(fatal) << " No track cuts to prefilter!"; - } // get the list of cuts that were computed in the barrel track-selection task and create a bit mask // to mark just the ones we want to apply a prefilter on @@ -946,18 +955,17 @@ struct AnalysisPrefilterSelection { for (int icut = 0; icut < objArray->GetEntries(); ++icut) { TString tempStr = objArray->At(icut)->GetName(); if (objArrayTrackCuts->FindObject(tempStr.Data()) != nullptr) { - fPrefilterMask |= (uint32_t(1) << icut); + fPrefilterMask |= (static_cast(1) << icut); } if (tempStr.CompareTo(fConfigPrefilterTrackCut.value) == 0) { fPrefilterCutBit = icut; } } } - if (fPrefilterMask == 0) { - LOG(fatal) << "No specified track cuts for prefiltering"; - } - if (fPrefilterCutBit < 0) { - LOG(fatal) << "No or incorrectly specified loose track prefilter cut"; + // NOTE: If no prefilter loose cut is specified to be "prefiltered" or no track cuts are asked to be prefiltered, + // then make a warning. In the processing, the produced table will just lead to a neutral behaviour (no prefilter applied) + if (fPrefilterMask == static_cast(0) || fPrefilterCutBit < 0) { + LOG(warn) << "No loose cut or track cuts for prefiltering are specified. This task will do nothing."; } // setup the prefilter pair cut @@ -977,6 +985,9 @@ struct AnalysisPrefilterSelection { template void runPrefilter(TEvent const& event, soa::Join const& assocs, TTracks const& /*tracks*/) { + if (fPrefilterCutBit < 0 || fPrefilterMask == 0) { + return; + } for (auto& [assoc1, assoc2] : o2::soa::combinations(assocs, assocs)) { auto track1 = assoc1.template reducedtrack_as(); @@ -1030,11 +1041,14 @@ struct AnalysisPrefilterSelection { for (auto& assoc : assocs) { auto track = assoc.template reducedtrack_as(); mymap = -1; - if (fPrefilterMap.find(track.globalIndex()) != fPrefilterMap.end()) { + // If cuts were not configured, then produce a map with all 1's + if (fPrefilterCutBit < 0 || fPrefilterMask == 0) { + prefilter(mymap); + } else if (fPrefilterMap.find(track.globalIndex()) != fPrefilterMap.end()) { // NOTE: publish the bitwise negated bits (~), so there will be zeroes for cuts that failed the prefiltering and 1 everywhere else mymap = ~fPrefilterMap[track.globalIndex()]; + prefilter(mymap); } - prefilter(mymap); } } @@ -1060,7 +1074,6 @@ struct AnalysisSameEventPairing { Produces dielectronInfoList; Produces dimuonsExtraList; Produces dimuonAllList; - Produces dileptonFlowList; Produces dileptonInfoList; o2::base::MatLayerCylSet* fLUT = nullptr; @@ -1068,34 +1081,41 @@ struct AnalysisSameEventPairing { OutputObj fOutputList{"output"}; - Configurable fConfigTrackCuts{"cfgTrackCuts", "jpsiO2MCdebugCuts2", "Comma separated list of barrel track cuts"}; - Configurable fConfigMuonCuts{"cfgMuonCuts", "", "Comma separated list of muon cuts"}; - Configurable fConfigPairCuts{"cfgPairCuts", "", "Comma separated list of pair cuts, !!! Use only if you know what you are doing, otherwise leave empty"}; - - Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable fConfigCcdbPath{"ccdb-path", "Users/lm", "base path to the ccdb object"}; - Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; - Configurable fConfigGRPMagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable fConfigUseRemoteField{"cfgUseRemoteField", false, "Chose whether to fetch the magnetic field from ccdb or set it manually"}; - Configurable fConfigMagField{"cfgMagField", 5.0f, "Manually set magnetic field"}; + struct : ConfigurableGroup { + Configurable track{"cfgTrackCuts", "jpsiO2MCdebugCuts2", "Comma separated list of barrel track cuts"}; + Configurable muon{"cfgMuonCuts", "", "Comma separated list of muon cuts"}; + Configurable pair{"cfgPairCuts", "", "Comma separated list of pair cuts, !!! Use only if you know what you are doing, otherwise leave empty"}; + } fConfigCuts; Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; Configurable fConfigAddSEPHistogram{"cfgAddSEPHistogram", "", "Comma separated list of histograms"}; - Configurable fConfigFlatTables{"cfgFlatTables", false, "Produce a single flat tables with all relevant information of the pairs and single tracks"}; - Configurable fConfigUseKFVertexing{"cfgUseKFVertexing", false, "Use KF Particle for secondary vertex reconstruction (DCAFitter is used by default)"}; - Configurable fConfigUseAbsDCA{"cfgUseAbsDCA", false, "Use absolute DCA minimization instead of chi^2 minimization in secondary vertexing"}; - Configurable fConfigPropToPCA{"cfgPropToPCA", false, "Propagate tracks to secondary vertex"}; - Configurable fConfigCorrFullGeo{"cfgCorrFullGeo", false, "Use full geometry to correct for MCS effects in track propagation"}; - Configurable fConfigNoCorr{"cfgNoCorrFwdProp", false, "Do not correct for MCS effects in track propagation"}; - Configurable fConfigLutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; - Configurable fConfigGeoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; - Configurable fConfigCollisionSystem{"syst", "pp", "Collision system, pp or PbPb"}; - Configurable fConfigCenterMassEnergy{"energy", 13600, "Center of mass energy in GeV"}; - Configurable fConfigRunMCGenPair{"cfgRunMCGenPair", false, "Do pairing of true MC particles"}; - Configurable fConfigMCGenSignals{"cfgBarrelMCGenSignals", "", "Comma separated list of MC signals (generated)"}; - Configurable fConfigMCRecSignals{"cfgBarrelMCRecSignals", "", "Comma separated list of MC signals (reconstructed)"}; - Configurable fConfigSkimSignalOnly{"fConfigSkimSignalOnly", false, "Configurable to select only matched candidates"}; + struct : ConfigurableGroup { + Configurable url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable grpMagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; + Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + } fConfigCCDB; + + struct : ConfigurableGroup { + Configurable useRemoteField{"cfgUseRemoteField", false, "Chose whether to fetch the magnetic field from ccdb or set it manually"}; + Configurable magField{"cfgMagField", 5.0f, "Manually set magnetic field"}; + Configurable flatTables{"cfgFlatTables", false, "Produce a single flat tables with all relevant information of the pairs and single tracks"}; + Configurable useKFVertexing{"cfgUseKFVertexing", false, "Use KF Particle for secondary vertex reconstruction (DCAFitter is used by default)"}; + Configurable useAbsDCA{"cfgUseAbsDCA", false, "Use absolute DCA minimization instead of chi^2 minimization in secondary vertexing"}; + Configurable propToPCA{"cfgPropToPCA", false, "Propagate tracks to secondary vertex"}; + Configurable corrFullGeo{"cfgCorrFullGeo", false, "Use full geometry to correct for MCS effects in track propagation"}; + Configurable noCorr{"cfgNoCorrFwdProp", false, "Do not correct for MCS effects in track propagation"}; + Configurable collisionSystem{"syst", "pp", "Collision system, pp or PbPb"}; + Configurable centerMassEnergy{"energy", 13600, "Center of mass energy in GeV"}; + } fConfigOptions; + + struct : ConfigurableGroup { + Configurable genSignals{"cfgBarrelMCGenSignals", "", "Comma separated list of MC signals (generated)"}; + Configurable recSignals{"cfgBarrelMCRecSignals", "", "Comma separated list of MC signals (reconstructed)"}; + Configurable skimSignalOnly{"cfgSkimSignalOnly", false, "Configurable to select only matched candidates"}; + Configurable runMCGenPair{"cfgRunMCGenPair", false, "Do pairing of true MC particles"}; + } fConfigMC; // Track related options Configurable fPropTrack{"cfgPropTrack", true, "Propgate tracks to associated collision to recalculate DCA and momentum vector"}; @@ -1137,20 +1157,10 @@ struct AnalysisSameEventPairing { fEnableBarrelHistos = context.mOptions.get("processAllSkimmed") || context.mOptions.get("processBarrelOnlySkimmed") || context.mOptions.get("processBarrelOnlyWithCollSkimmed"); fEnableMuonHistos = context.mOptions.get("processAllSkimmed") || context.mOptions.get("processMuonOnlySkimmed"); - bool isDummy = context.mOptions.get("processDummy"); - if (isDummy) { - if (fEnableBarrelHistos || fEnableMuonHistos) { - LOG(warning) << "The dummy process function is enabled while you have enabled normal process function. Check your configuration file!" << endl; - } else { - LOG(info) << "Dummy function enabled. Skipping the rest of init()" << endl; - return; - } - } // Keep track of all the histogram class names to avoid composing strings in the pairing loop TString histNames = ""; - - TString cutNamesStr = fConfigPairCuts.value; + TString cutNamesStr = fConfigCuts.pair.value; if (!cutNamesStr.IsNull()) { std::unique_ptr objArray(cutNamesStr.Tokenize(",")); for (int icut = 0; icut < objArray->GetEntries(); ++icut) { @@ -1160,19 +1170,19 @@ struct AnalysisSameEventPairing { // get the list of cuts for tracks/muons, check that they were played by the barrel/muon selection tasks // and make a mask for active cuts (barrel and muon selection tasks may run more cuts, needed for other analyses) - TString trackCutsStr = fConfigTrackCuts.value; + TString trackCutsStr = fConfigCuts.track.value; TObjArray* objArrayTrackCuts = nullptr; if (!trackCutsStr.IsNull()) { objArrayTrackCuts = trackCutsStr.Tokenize(","); } - TString muonCutsStr = fConfigMuonCuts.value; + TString muonCutsStr = fConfigCuts.muon.value; TObjArray* objArrayMuonCuts = nullptr; if (!muonCutsStr.IsNull()) { objArrayMuonCuts = muonCutsStr.Tokenize(","); } // Setting the MC rec signal names - TString sigNamesStr = fConfigMCRecSignals.value; + TString sigNamesStr = fConfigMC.recSignals.value; std::unique_ptr objRecSigArray(sigNamesStr.Tokenize(",")); for (int isig = 0; isig < objRecSigArray->GetEntries(); ++isig) { @@ -1199,7 +1209,7 @@ struct AnalysisSameEventPairing { // if the current barrel selection cut is required in this task, then switch on the corresponding bit in the mask // and assign histogram directories if (objArrayTrackCuts->FindObject(tempStr.Data()) != nullptr) { - fTrackFilterMask |= (uint32_t(1) << icut); + fTrackFilterMask |= (static_cast(1) << icut); if (fEnableBarrelHistos) { // assign the pair hist directories for the current cut @@ -1224,7 +1234,7 @@ struct AnalysisSameEventPairing { // if there are pair cuts specified, assign hist directories for each barrel cut - pair cut combination // NOTE: This could possibly lead to large histogram outputs. It is strongly advised to use pair cuts only // if you know what you are doing. - TString cutNamesStr = fConfigPairCuts.value; + TString cutNamesStr = fConfigCuts.pair.value; if (!cutNamesStr.IsNull()) { // if pair cuts std::unique_ptr objArrayPair(cutNamesStr.Tokenize(",")); fNPairCuts = objArrayPair->GetEntries(); @@ -1280,7 +1290,7 @@ struct AnalysisSameEventPairing { TString tempStr = objArray->At(icut)->GetName(); if (objArrayMuonCuts->FindObject(tempStr.Data()) != nullptr) { // update the filter mask - fMuonFilterMask |= (uint32_t(1) << icut); + fMuonFilterMask |= (static_cast(1) << icut); if (fEnableMuonHistos) { // assign pair hist directories for each required muon cut @@ -1303,7 +1313,7 @@ struct AnalysisSameEventPairing { fMuonHistNames[icut] = names; // if there are specified pair cuts, assign hist dirs for each muon cut - pair cut combination - TString cutNamesStr = fConfigPairCuts.value; + TString cutNamesStr = fConfigCuts.pair.value; if (!cutNamesStr.IsNull()) { // if pair cuts std::unique_ptr objArrayPair(cutNamesStr.Tokenize(",")); fNPairCuts = objArrayPair->GetEntries(); @@ -1348,7 +1358,7 @@ struct AnalysisSameEventPairing { // Add histogram classes for each specified MCsignal at the generator level // TODO: create a std::vector of hist classes to be used at Fill time, to avoid using Form in the process function - TString sigGenNamesStr = fConfigMCGenSignals.value; + TString sigGenNamesStr = fConfigMC.genSignals.value; std::unique_ptr objGenSigArray(sigGenNamesStr.Tokenize(",")); for (int isig = 0; isig < objGenSigArray->GetEntries(); isig++) { MCSignal* sig = o2::aod::dqmcsignals::GetMCSignal(objGenSigArray->At(isig)->GetName()); @@ -1366,18 +1376,18 @@ struct AnalysisSameEventPairing { fCurrentRun = 0; - fCCDB->setURL(fConfigCcdbUrl.value); + fCCDB->setURL(fConfigCCDB.url.value); fCCDB->setCaching(true); fCCDB->setLocalObjectValidityChecking(); - if (fConfigNoCorr) { + if (fConfigOptions.noCorr) { VarManager::SetupFwdDCAFitterNoCorr(); - } else if (fConfigCorrFullGeo || (fConfigUseKFVertexing && fConfigPropToPCA)) { + } else if (fConfigOptions.corrFullGeo || (fConfigOptions.useKFVertexing && fConfigOptions.propToPCA)) { if (!o2::base::GeometryManager::isGeometryLoaded()) { - fCCDB->get(fConfigGeoPath); + fCCDB->get(fConfigCCDB.geoPath); } } else { - fLUT = o2::base::MatLayerCylSet::rectifyPtrFromFile(fCCDB->get(fConfigLutPath)); + fLUT = o2::base::MatLayerCylSet::rectifyPtrFromFile(fCCDB->get(fConfigCCDB.lutPath)); VarManager::SetupMatLUTFwdDCAFitter(fLUT); } @@ -1386,7 +1396,7 @@ struct AnalysisSameEventPairing { fHistMan->SetUseDefaultVariableNames(kTRUE); fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); - VarManager::SetCollisionSystem((TString)fConfigCollisionSystem, fConfigCenterMassEnergy); // set collision system and center of mass energy + VarManager::SetCollisionSystem((TString)fConfigOptions.collisionSystem, fConfigOptions.centerMassEnergy); // set collision system and center of mass energy DefineHistograms(fHistMan, histNames.Data(), fConfigAddSEPHistogram.value.data()); // define all histograms VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill @@ -1395,8 +1405,8 @@ struct AnalysisSameEventPairing { void initParamsFromCCDB(uint64_t timestamp, bool withTwoProngFitter = true) { - if (fConfigUseRemoteField.value) { - o2::parameters::GRPMagField* grpmag = fCCDB->getForTimeStamp(fConfigGRPMagPath, timestamp); + if (fConfigOptions.useRemoteField.value) { + o2::parameters::GRPMagField* grpmag = fCCDB->getForTimeStamp(fConfigCCDB.grpMagPath, timestamp); float magField = 0.0; if (grpmag != nullptr) { magField = grpmag->getNominalL3Field(); @@ -1404,25 +1414,25 @@ struct AnalysisSameEventPairing { LOGF(fatal, "GRP object is not available in CCDB at timestamp=%llu", timestamp); } if (withTwoProngFitter) { - if (fConfigUseKFVertexing.value) { + if (fConfigOptions.useKFVertexing.value) { VarManager::SetupTwoProngKFParticle(magField); } else { - VarManager::SetupTwoProngDCAFitter(magField, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); // TODO: get these parameters from Configurables - VarManager::SetupTwoProngFwdDCAFitter(magField, true, 200.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); + VarManager::SetupTwoProngDCAFitter(magField, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigOptions.useAbsDCA.value); // TODO: get these parameters from Configurables + VarManager::SetupTwoProngFwdDCAFitter(magField, true, 200.0f, 1.0e-3f, 0.9f, fConfigOptions.useAbsDCA.value); } } else { - VarManager::SetupTwoProngDCAFitter(magField, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); // needed because take in varmanager Bz from fgFitterTwoProngBarrel for PhiV calculations + VarManager::SetupTwoProngDCAFitter(magField, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigOptions.useAbsDCA.value); // needed because take in varmanager Bz from fgFitterTwoProngBarrel for PhiV calculations } } else { if (withTwoProngFitter) { - if (fConfigUseKFVertexing.value) { - VarManager::SetupTwoProngKFParticle(fConfigMagField.value); + if (fConfigOptions.useKFVertexing.value) { + VarManager::SetupTwoProngKFParticle(fConfigOptions.magField.value); } else { - VarManager::SetupTwoProngDCAFitter(fConfigMagField.value, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); // TODO: get these parameters from Configurables - VarManager::SetupTwoProngFwdDCAFitter(fConfigMagField.value, true, 200.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); + VarManager::SetupTwoProngDCAFitter(fConfigOptions.magField.value, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigOptions.useAbsDCA.value); // TODO: get these parameters from Configurables + VarManager::SetupTwoProngFwdDCAFitter(fConfigOptions.magField.value, true, 200.0f, 1.0e-3f, 0.9f, fConfigOptions.useAbsDCA.value); } } else { - VarManager::SetupTwoProngDCAFitter(fConfigMagField.value, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); // needed because take in varmanager Bz from fgFitterTwoProngBarrel for PhiV calculations + VarManager::SetupTwoProngDCAFitter(fConfigOptions.magField.value, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigOptions.useAbsDCA.value); // needed because take in varmanager Bz from fgFitterTwoProngBarrel for PhiV calculations } } } @@ -1436,21 +1446,21 @@ struct AnalysisSameEventPairing { fCurrentRun = events.begin().runNumber(); } - TString cutNames = fConfigTrackCuts.value; + TString cutNames = fConfigCuts.track.value; std::map> histNames = fTrackHistNames; std::map> histNamesMC = fBarrelHistNamesMCmatched; int ncuts = fNCutsBarrel; if constexpr (TPairType == VarManager::kDecayToMuMu) { - cutNames = fConfigMuonCuts.value; + cutNames = fConfigCuts.muon.value; histNames = fMuonHistNames; histNamesMC = fMuonHistNamesMCmatched; ncuts = fNCutsMuon; } - uint32_t twoTrackFilter = 0; + uint32_t twoTrackFilter = static_cast(0); int sign1 = 0; int sign2 = 0; - uint32_t mcDecision = 0; + uint32_t mcDecision = static_cast(0); bool isCorrectAssoc_leg1 = false; bool isCorrectAssoc_leg2 = false; dielectronList.reserve(1); @@ -1459,7 +1469,7 @@ struct AnalysisSameEventPairing { dimuonsExtraList.reserve(1); dielectronInfoList.reserve(1); dileptonInfoList.reserve(1); - if (fConfigFlatTables.value) { + if (fConfigOptions.flatTables.value) { dimuonAllList.reserve(1); } constexpr bool eventHasQvector = ((TEventFillMap & VarManager::ObjTypes::ReducedEventQvector) > 0); @@ -1494,16 +1504,16 @@ struct AnalysisSameEventPairing { sign2 = t2.sign(); // store the ambiguity number of the two dilepton legs in the last 4 digits of the two-track filter if (t1.barrelAmbiguityInBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 28); + twoTrackFilter |= (static_cast(1) << 28); } if (t2.barrelAmbiguityInBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 29); + twoTrackFilter |= (static_cast(1) << 29); } if (t1.barrelAmbiguityOutOfBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 30); + twoTrackFilter |= (static_cast(1) << 30); } if (t2.barrelAmbiguityOutOfBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 31); + twoTrackFilter |= (static_cast(1) << 31); } // run MC matching for this pair @@ -1512,7 +1522,7 @@ struct AnalysisSameEventPairing { for (auto sig = fRecMCSignals.begin(); sig != fRecMCSignals.end(); sig++, isig++) { if (t1.has_reducedMCTrack() && t2.has_reducedMCTrack()) { if ((*sig).CheckSignal(true, t1.reducedMCTrack(), t2.reducedMCTrack())) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } } // end loop over MC signals @@ -1526,12 +1536,12 @@ struct AnalysisSameEventPairing { VarManager::FillPairCollision(event, t1, t2); } if constexpr (TTwoProngFitter) { - VarManager::FillPairVertexing(event, t1, t2, fConfigPropToPCA); + VarManager::FillPairVertexing(event, t1, t2, fConfigOptions.propToPCA); } if constexpr (eventHasQvector) { VarManager::FillPairVn(t1, t2); } - if (!fConfigSkimSignalOnly || (fConfigSkimSignalOnly && mcDecision > 0)) { + if (!fConfigMC.skimSignalOnly || (fConfigMC.skimSignalOnly && mcDecision > 0)) { dielectronList(event.globalIndex(), VarManager::fgValues[VarManager::kMass], VarManager::fgValues[VarManager::kPt], VarManager::fgValues[VarManager::kEta], VarManager::fgValues[VarManager::kPhi], t1.sign() + t2.sign(), twoTrackFilter, mcDecision); @@ -1561,16 +1571,16 @@ struct AnalysisSameEventPairing { sign2 = t2.sign(); // store the ambiguity number of the two dilepton legs in the last 4 digits of the two-track filter if (t1.muonAmbiguityInBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 28); + twoTrackFilter |= (static_cast(1) << 28); } if (t2.muonAmbiguityInBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 29); + twoTrackFilter |= (static_cast(1) << 29); } if (t1.muonAmbiguityOutOfBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 30); + twoTrackFilter |= (static_cast(1) << 30); } if (t2.muonAmbiguityOutOfBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 31); + twoTrackFilter |= (static_cast(1) << 31); } // run MC matching for this pair @@ -1579,7 +1589,7 @@ struct AnalysisSameEventPairing { for (auto sig = fRecMCSignals.begin(); sig != fRecMCSignals.end(); sig++, isig++) { if (t1.has_reducedMCTrack() && t2.has_reducedMCTrack()) { if ((*sig).CheckSignal(true, t1.reducedMCTrack(), t2.reducedMCTrack())) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } } // end loop over MC signals @@ -1594,7 +1604,7 @@ struct AnalysisSameEventPairing { VarManager::FillPairCollision(event, t1, t2); } if constexpr (TTwoProngFitter) { - VarManager::FillPairVertexing(event, t1, t2, fConfigPropToPCA); + VarManager::FillPairVertexing(event, t1, t2, fConfigOptions.propToPCA); } if constexpr (eventHasQvector) { VarManager::FillPairVn(t1, t2); @@ -1609,7 +1619,7 @@ struct AnalysisSameEventPairing { if constexpr (TTwoProngFitter) { dimuonsExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]); - if (fConfigFlatTables.value) { + if (fConfigOptions.flatTables.value) { dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(), -999., -999., -999., VarManager::fgValues[VarManager::kMass], @@ -1629,7 +1639,7 @@ struct AnalysisSameEventPairing { -999., -999., -999., -999., -999., -999., -999., -999., -999., -999., -999., -999., - (twoTrackFilter & (uint32_t(1) << 28)) || (twoTrackFilter & (uint32_t(1) << 30)), (twoTrackFilter & (uint32_t(1) << 29)) || (twoTrackFilter & (uint32_t(1) << 31)), + (twoTrackFilter & (static_cast(1) << 28)) || (twoTrackFilter & (static_cast(1) << 30)), (twoTrackFilter & (static_cast(1) << 29)) || (twoTrackFilter & (static_cast(1) << 31)), -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, VarManager::fgValues[VarManager::kMultDimuons], @@ -1642,21 +1652,17 @@ struct AnalysisSameEventPairing { twoTrackFilter = a1.isBarrelSelected_raw() & a1.isBarrelSelectedPrefilter_raw() & a2.isMuonSelected_raw() & fTwoTrackFilterMask; }*/ - if constexpr (eventHasQvector) { - dileptonFlowList(VarManager::fgValues[VarManager::kU2Q2], VarManager::fgValues[VarManager::kU3Q3], VarManager::fgValues[VarManager::kCos2DeltaPhi], VarManager::fgValues[VarManager::kCos3DeltaPhi]); - } - // Fill histograms bool isAmbiInBunch = false; bool isAmbiOutOfBunch = false; for (int icut = 0; icut < ncuts; icut++) { - if (twoTrackFilter & (uint32_t(1) << icut)) { - isAmbiInBunch = (twoTrackFilter & (uint32_t(1) << 28)) || (twoTrackFilter & (uint32_t(1) << 29)); - isAmbiOutOfBunch = (twoTrackFilter & (uint32_t(1) << 30)) || (twoTrackFilter & (uint32_t(1) << 31)); + if (twoTrackFilter & (static_cast(1) << icut)) { + isAmbiInBunch = (twoTrackFilter & (static_cast(1) << 28)) || (twoTrackFilter & (static_cast(1) << 29)); + isAmbiOutOfBunch = (twoTrackFilter & (static_cast(1) << 30)) || (twoTrackFilter & (static_cast(1) << 31)); if (sign1 * sign2 < 0) { // +- pairs fHistMan->FillHistClass(histNames[icut][0].Data(), VarManager::fgValues); // reconstructed, unmatched for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { // loop over MC signals - if (mcDecision & (uint32_t(1) << isig)) { + if (mcDecision & (static_cast(1) << isig)) { fHistMan->FillHistClass(histNamesMC[icut * fRecMCSignals.size() + isig][0].Data(), VarManager::fgValues); // matched signal if (fConfigQA) { if (isCorrectAssoc_leg1 && isCorrectAssoc_leg2) { // correct track-collision association @@ -1695,7 +1701,7 @@ struct AnalysisSameEventPairing { if (sign1 > 0) { // ++ pairs fHistMan->FillHistClass(histNames[icut][1].Data(), VarManager::fgValues); for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { // loop over MC signals - if (mcDecision & (uint32_t(1) << isig)) { + if (mcDecision & (static_cast(1) << isig)) { fHistMan->FillHistClass(histNamesMC[icut * fRecMCSignals.size() + isig][1].Data(), VarManager::fgValues); } } @@ -1710,7 +1716,7 @@ struct AnalysisSameEventPairing { } else { // -- pairs fHistMan->FillHistClass(histNames[icut][2].Data(), VarManager::fgValues); for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { // loop over MC signals - if (mcDecision & (uint32_t(1) << isig)) { + if (mcDecision & (static_cast(1) << isig)) { fHistMan->FillHistClass(histNamesMC[icut * fRecMCSignals.size() + isig][2].Data(), VarManager::fgValues); } } @@ -1802,8 +1808,9 @@ struct AnalysisSameEventPairing { { runSameEventPairing(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, mcEvents, mcTracks); runSameEventPairing(events, muonAssocsPerCollision, muonAssocs, muons, mcEvents, mcTracks); - if (fConfigRunMCGenPair) + if (fConfigMC.runMCGenPair) { runMCGen(mcEvents, mcTracks); + } // runSameEventPairing(event, tracks, muons); } @@ -1812,8 +1819,9 @@ struct AnalysisSameEventPairing { MyBarrelTracksWithCovWithAmbiguities const& barrelTracks, ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks) { runSameEventPairing(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, mcEvents, mcTracks); - if (fConfigRunMCGenPair) + if (fConfigMC.runMCGenPair) { runMCGen(mcEvents, mcTracks); + } } void processBarrelOnlyWithCollSkimmed(MyEventsVtxCovSelected const& events, @@ -1821,16 +1829,18 @@ struct AnalysisSameEventPairing { MyBarrelTracksWithCovWithAmbiguitiesWithColl const& barrelTracks, ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks) { runSameEventPairing(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, mcEvents, mcTracks); - if (fConfigRunMCGenPair) + if (fConfigMC.runMCGenPair) { runMCGen(mcEvents, mcTracks); + } } void processMuonOnlySkimmed(MyEventsVtxCovSelected const& events, soa::Join const& muonAssocs, MyMuonTracksWithCovWithAmbiguities const& muons, ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks) { runSameEventPairing(events, muonAssocsPerCollision, muonAssocs, muons, mcEvents, mcTracks); - if (fConfigRunMCGenPair) + if (fConfigMC.runMCGenPair) { runMCGen(mcEvents, mcTracks); + } } void processDummy(MyEvents&) @@ -1879,10 +1889,10 @@ struct AnalysisDileptonTrack { Service fCCDB; // TODO: The filter expressions seem to always use the default value of configurables, not the values from the actual configuration file - Filter eventFilter = aod::dqanalysisflags::isEventSelected > uint32_t(0); + Filter eventFilter = aod::dqanalysisflags::isEventSelected > static_cast(0); Filter dileptonFilter = aod::reducedpair::pt > fConfigDileptonpTCut&& aod::reducedpair::mass > fConfigDileptonLowMass&& aod::reducedpair::mass fConfigDileptonLxyCut; - Filter filterBarrel = aod::dqanalysisflags::isBarrelSelected > uint32_t(0); - Filter filterMuon = aod::dqanalysisflags::isMuonSelected > uint32_t(0); + Filter filterBarrel = aod::dqanalysisflags::isBarrelSelected > static_cast(0); + Filter filterMuon = aod::dqanalysisflags::isMuonSelected > static_cast(0); constexpr static uint32_t fgDileptonFillMap = VarManager::ObjTypes::ReducedTrack | VarManager::ObjTypes::Pair; // fill map @@ -1980,6 +1990,7 @@ struct AnalysisDileptonTrack { DefineHistograms(fHistMan, fHistNamesDileptonTrack[icut], fConfigHistogramSubgroups.value.data()); // define dilepton-track histograms DefineHistograms(fHistMan, fHistNamesDileptons[icut], "barrel,vertexing"); // define dilepton histograms std::vector mcHistNames; + for (auto& sig : fRecMCSignals) { mcHistNames.push_back(Form("DileptonTrackMCMatched_%s_%s_%s", tempStr.Data(), fConfigTrackCut.value.data(), sig.GetName())); DefineHistograms(fHistMan, mcHistNames[mcHistNames.size() - 1], fConfigHistogramSubgroups.value.data()); @@ -2047,7 +2058,7 @@ struct AnalysisDileptonTrack { VarManager::FillEvent(event, fValuesDilepton); VarManager::FillEvent(event.reducedMCevent(), fValuesDilepton); - uint32_t mcDecision = 0; + uint32_t mcDecision = static_cast(0); size_t isig = 0; for (auto dilepton : dileptons) { @@ -2086,7 +2097,7 @@ struct AnalysisDileptonTrack { isig = 0; for (auto sig = fRecMCSignals.begin(); sig != fRecMCSignals.end(); sig++, isig++) { if ((*sig).CheckSignal(true, lepton1MC, lepton2MC, trackMC)) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } } @@ -2107,7 +2118,7 @@ struct AnalysisDileptonTrack { isig = 0; for (auto sig = fRecMCSignals.begin(); sig != fRecMCSignals.end(); sig++, isig++) { if ((*sig).CheckSignal(true, lepton1MC, lepton2MC, trackMC)) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } } @@ -2116,7 +2127,7 @@ struct AnalysisDileptonTrack { if (dilepton.filterMap_bit(icut)) { fHistMan->FillHistClass(fHistNamesDileptonTrack[icut].Data(), fValuesHadron); for (isig = 0; isig < fRecMCSignals.size(); isig++) { - if (mcDecision & (uint32_t(1) << isig)) { + if (mcDecision & (static_cast(1) << isig)) { // TODO: check also whether the collision association is correct (add dedicated histogram dirs) fHistMan->FillHistClass(fHistNamesDileptonTrackMCmatched[icut][isig], fValuesHadron); } @@ -2124,7 +2135,7 @@ struct AnalysisDileptonTrack { } } // table to be written out for ML analysis - BmesonsTable(fValuesHadron[VarManager::kPairMass], fValuesHadron[VarManager::kPairPt], fValuesHadron[VarManager::kVertexingLxy], fValuesHadron[VarManager::kVertexingLxyz], fValuesHadron[VarManager::kVertexingLz], fValuesHadron[VarManager::kVertexingTauxy], fValuesHadron[VarManager::kVertexingTauz], fValuesHadron[VarManager::kCosPointingAngle], fValuesHadron[VarManager::kVertexingChi2PCA], mcDecision); + BmesonsTable(fValuesHadron[VarManager::kPairMass], fValuesHadron[VarManager::kPairPt], fValuesHadron[VarManager::kVertexingLxy], fValuesHadron[VarManager::kVertexingLxyz], fValuesHadron[VarManager::kVertexingLz], fValuesHadron[VarManager::kVertexingTauxy], fValuesHadron[VarManager::kVertexingTauz], fValuesHadron[VarManager::kCosPointingAngle], fValuesHadron[VarManager::kVertexingChi2PCA]); } } // end loop over dileptons } @@ -2258,7 +2269,7 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", "postcalib_proton"); } if (classStr.Contains("Ambiguity")) { - dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", Form("%s,ambiguity", histName.Data())); + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", "ambiguity"); } } } diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 349db4dd7a2..194dd3b67ef 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -19,6 +19,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -66,7 +70,7 @@ namespace o2::aod namespace dqanalysisflags { DECLARE_SOA_COLUMN(MixingHash, mixingHash, int); //! Hash used in event mixing -DECLARE_SOA_BITMAP_COLUMN(IsEventSelected, isEventSelected, 32); //! Event decision +DECLARE_SOA_BITMAP_COLUMN(IsEventSelected, isEventSelected, 8); //! Event decision DECLARE_SOA_BITMAP_COLUMN(IsBarrelSelected, isBarrelSelected, 32); //! Barrel track decisions DECLARE_SOA_COLUMN(BarrelAmbiguityInBunch, barrelAmbiguityInBunch, int8_t); //! Barrel track in-bunch ambiguity DECLARE_SOA_COLUMN(BarrelAmbiguityOutOfBunch, barrelAmbiguityOutOfBunch, int8_t); //! Barrel track out of bunch ambiguity @@ -86,14 +90,14 @@ DECLARE_SOA_COLUMN(CosPBcandidate, cosPBcandidate, float); DECLARE_SOA_COLUMN(Chi2Bcandidate, chi2Bcandidate, float); } // namespace dqanalysisflags -DECLARE_SOA_TABLE(EventCuts, "AOD", "DQANAEVCUTS", dqanalysisflags::IsEventSelected); //! joinable to ReducedEvents -DECLARE_SOA_TABLE(MixingHashes, "AOD", "DQANAMIXHASH", dqanalysisflags::MixingHash); //! joinable to ReducedEvents -DECLARE_SOA_TABLE(BarrelTrackCuts, "AOD", "DQANATRKCUTS", dqanalysisflags::IsBarrelSelected); //! joinable to ReducedTracksAssoc -DECLARE_SOA_TABLE(BarrelAmbiguities, "AOD", "DQBARRELAMB", dqanalysisflags::BarrelAmbiguityInBunch, dqanalysisflags::BarrelAmbiguityOutOfBunch); //! joinable to ReducedBarrelTracks -DECLARE_SOA_TABLE(MuonTrackCuts, "AOD", "DQANAMUONCUTS", dqanalysisflags::IsMuonSelected); //! joinable to ReducedMuonsAssoc -DECLARE_SOA_TABLE(MuonAmbiguities, "AOD", "DQMUONAMB", dqanalysisflags::MuonAmbiguityInBunch, dqanalysisflags::MuonAmbiguityOutOfBunch); //! joinable to ReducedMuonTracks -DECLARE_SOA_TABLE(Prefilter, "AOD", "DQPREFILTER", dqanalysisflags::IsBarrelSelectedPrefilter); //! joinable to ReducedTracksAssoc -DECLARE_SOA_TABLE(BmesonCandidates, "AOD", "DQBMESONS", dqanalysisflags::massBcandidate, dqanalysisflags::pTBcandidate, dqanalysisflags::LxyBcandidate, dqanalysisflags::LxyzBcandidate, dqanalysisflags::LzBcandidate, dqanalysisflags::TauxyBcandidate, dqanalysisflags::TauzBcandidate, dqanalysisflags::CosPBcandidate, dqanalysisflags::Chi2Bcandidate); +DECLARE_SOA_TABLE(EventCuts, "AOD", "DQANAEVCUTSA", dqanalysisflags::IsEventSelected); //! joinable to ReducedEvents +DECLARE_SOA_TABLE(MixingHashes, "AOD", "DQANAMIXHASHA", dqanalysisflags::MixingHash); //! joinable to ReducedEvents +DECLARE_SOA_TABLE(BarrelTrackCuts, "AOD", "DQANATRKCUTSA", dqanalysisflags::IsBarrelSelected); //! joinable to ReducedTracksAssoc +DECLARE_SOA_TABLE(BarrelAmbiguities, "AOD", "DQBARRELAMBA", dqanalysisflags::BarrelAmbiguityInBunch, dqanalysisflags::BarrelAmbiguityOutOfBunch); //! joinable to ReducedBarrelTracks +DECLARE_SOA_TABLE(MuonTrackCuts, "AOD", "DQANAMUONCUTSA", dqanalysisflags::IsMuonSelected); //! joinable to ReducedMuonsAssoc +DECLARE_SOA_TABLE(MuonAmbiguities, "AOD", "DQMUONAMBA", dqanalysisflags::MuonAmbiguityInBunch, dqanalysisflags::MuonAmbiguityOutOfBunch); //! joinable to ReducedMuonTracks +DECLARE_SOA_TABLE(Prefilter, "AOD", "DQPREFILTERA", dqanalysisflags::IsBarrelSelectedPrefilter); //! joinable to ReducedTracksAssoc +DECLARE_SOA_TABLE(BmesonCandidates, "AOD", "DQBMESONSA", dqanalysisflags::massBcandidate, dqanalysisflags::pTBcandidate, dqanalysisflags::LxyBcandidate, dqanalysisflags::LxyzBcandidate, dqanalysisflags::LzBcandidate, dqanalysisflags::TauxyBcandidate, dqanalysisflags::TauzBcandidate, dqanalysisflags::CosPBcandidate, dqanalysisflags::Chi2Bcandidate); } // namespace o2::aod // Declarations of various short names @@ -154,17 +158,25 @@ void PrintBitMap(TMap map, int nbits) } } -// Analysis task that produces event decisions and the Hash table used in event mixing +// Analysis task that produces event decisions (analysis cut, in bunch pileup and split collision check) and the Hash table used in event mixing struct AnalysisEventSelection { Produces eventSel; Produces hash; OutputObj fOutputList{"output"}; + // TODO: Provide the mixing variables and binning directly via configurables (e.g. vectors of float) Configurable fConfigMixingVariables{"cfgMixingVars", "", "Mixing configs separated by a comma, default no mixing"}; Configurable fConfigEventCuts{"cfgEventCuts", "eventStandard", "Event selection"}; Configurable fConfigAddEventHistogram{"cfgAddEventHistogram", "", "Comma separated list of histograms"}; - Configurable fConfigITSROFrameStartBorderMargin{"ITSROFrameStartBorderMargin", -1, "Number of bcs at the start of ITS RO Frame border. Take from CCDB if -1"}; - Configurable fConfigITSROFrameEndBorderMargin{"ITSROFrameEndBorderMargin", -1, "Number of bcs at the end of ITS RO Frame border. Take from CCDB if -1"}; + Configurable fConfigQA{"cfgQA", true, "If true, QA histograms will be created and filled"}; + + Configurable fConfigITSROFrameStartBorderMargin{"cfgITSROFrameStartBorderMargin", -1, "Number of bcs at the start of ITS RO Frame border. Take from CCDB if -1"}; + Configurable fConfigITSROFrameEndBorderMargin{"cfgITSROFrameEndBorderMargin", -1, "Number of bcs at the end of ITS RO Frame border. Take from CCDB if -1"}; + + Configurable fConfigSplitCollisionsDeltaZ{"cfgSplitCollisionsDeltaZ", 1.0, "maximum delta-z (cm) between two collisions to consider them as split candidates"}; + Configurable fConfigSplitCollisionsDeltaBC{"cfgSplitCollisionsDeltaBC", 100, "maximum delta-BC between two collisions to consider them as split candidates; do not apply if value is negative"}; + Configurable fConfigCheckSplitCollisions{"cfgCheckSplitCollisions", false, "If true, run the split collision check and fill histograms"}; + Configurable fConfigRunZorro{"cfgRunZorro", false, "Enable event selection with zorro [WARNING: under debug, do not enable!]"}; Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; @@ -192,12 +204,17 @@ struct AnalysisEventSelection { VarManager::SetUseVars(AnalysisCut::fgUsedVars); // provide the list of required variables so that VarManager knows what to fill VarManager::SetDefaultVarNames(); - fHistMan = new HistogramManager("analysisHistos", "", VarManager::kNVars); - fHistMan->SetUseDefaultVariableNames(kTRUE); - fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); - DefineHistograms(fHistMan, "Event_BeforeCuts;Event_AfterCuts;SameBunchCorrelations", fConfigAddEventHistogram.value.data()); // define all histograms - VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill - fOutputList.setObject(fHistMan->GetMainHistogramList()); + if (fConfigQA) { + fHistMan = new HistogramManager("analysisHistos", "", VarManager::kNVars); + fHistMan->SetUseDefaultVariableNames(kTRUE); + fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); + DefineHistograms(fHistMan, "Event_BeforeCuts;Event_AfterCuts;", fConfigAddEventHistogram.value.data()); + if (fConfigCheckSplitCollisions) { + DefineHistograms(fHistMan, "SameBunchCorrelations;OutOfBunchCorrelations;", ""); + } + VarManager::SetUseVars(fHistMan->GetUsedVars()); + fOutputList.setObject(fHistMan->GetMainHistogramList()); + } TString mixVarsString = fConfigMixingVariables.value; std::unique_ptr objArray(mixVarsString.Tokenize(",")); @@ -226,15 +243,12 @@ struct AnalysisEventSelection { uint64_t sor = std::atol(header["SOR"].c_str()); uint64_t eor = std::atol(header["EOR"].c_str()); VarManager::SetSORandEOR(sor, eor); - LOG(info) << "============================= SOR / EOR :: " << sor << " / " << eor; auto alppar = fCCDB->getForTimeStamp>("ITS/Config/AlpideParam", events.begin().timestamp()); EventSelectionParams* par = fCCDB->getForTimeStamp("EventSelection/EventSelectionParams", events.begin().timestamp()); int itsROFrameStartBorderMargin = fConfigITSROFrameStartBorderMargin < 0 ? par->fITSROFrameStartBorderMargin : fConfigITSROFrameStartBorderMargin; int itsROFrameEndBorderMargin = fConfigITSROFrameEndBorderMargin < 0 ? par->fITSROFrameEndBorderMargin : fConfigITSROFrameEndBorderMargin; VarManager::SetITSROFBorderselection(alppar->roFrameBiasInBC, alppar->roFrameLengthInBC, itsROFrameStartBorderMargin, itsROFrameEndBorderMargin); - LOGP(debug, "==============++++++++++++========== roBias / roLength / start / end :: {} / {} / {} / {}", alppar->roFrameBiasInBC, alppar->roFrameLengthInBC, itsROFrameStartBorderMargin, itsROFrameEndBorderMargin); - fCurrentRun = events.begin().runNumber(); } @@ -247,7 +261,10 @@ struct AnalysisEventSelection { VarManager::FillEvent(event); bool decision = false; - fHistMan->FillHistClass("Event_BeforeCuts", VarManager::fgValues); // automatically fill all the histograms in the class Event + // Fill histograms in the class Event, before cuts + fHistMan->FillHistClass("Event_BeforeCuts", VarManager::fgValues); + + // Apply event cuts and fill histograms after selection if (fEventCut->IsSelected(VarManager::fgValues)) { if (fConfigRunZorro) { if (event.tag_bit(56)) { // This is the bit used for the software trigger event selections [TO BE DONE: find a more clear way to use it] @@ -259,7 +276,11 @@ struct AnalysisEventSelection { decision = true; } } + + // fill the event decision map fSelMap[event.globalIndex()] = decision; + + // Fill the BC map of events if (fBCCollMap.find(event.globalBC()) == fBCCollMap.end()) { std::vector evIndices = {event.globalIndex()}; fBCCollMap[event.globalBC()] = evIndices; @@ -268,6 +289,7 @@ struct AnalysisEventSelection { evIndices.push_back(event.globalIndex()); } + // create the mixing hash and publish it into the hash table if (fMixHandler != nullptr) { int hh = fMixHandler->FindEventCategory(VarManager::fgValues); hash(hh); @@ -278,49 +300,73 @@ struct AnalysisEventSelection { template void publishSelections(TEvents const& events) { - - std::map collisionSplittingMap; // key: event global index, value: whether pileup event is a possible splitting + // Create a map for collisions which are candidate of being split + // key: event global index, value: whether pileup event is a possible splitting + std::map collisionSplittingMap; // Reset the fValues array and fill event observables VarManager::ResetValues(0, VarManager::kNEventWiseVariables); - // loop over the BC map, find BCs with more than one collision and compute 2-event correlation quantities - for (auto& [bc, evIndices] : fBCCollMap) { - if (evIndices.size() < 2) { - continue; - } - for (auto ev1Idx = evIndices.begin(); ev1Idx != evIndices.end(); ++ev1Idx) { - if (!fSelMap[*ev1Idx]) { - continue; + // loop over the BC map, get the collision vectors and make in-bunch and out of bunch 2-event correlations + for (auto bc1It = fBCCollMap.begin(); bc1It != fBCCollMap.end(); ++bc1It) { + uint64_t bc1 = bc1It->first; + auto bc1Events = bc1It->second; + + // same bunch event correlations, if more than 1 collisions in this bunch + if (bc1Events.size() > 1) { + for (auto ev1It = bc1Events.begin(); ev1It != bc1Events.end(); ++ev1It) { + auto ev1 = events.rawIteratorAt(*ev1It); + for (auto ev2It = std::next(ev1It); ev2It != bc1Events.end(); ++ev2It) { + auto ev2 = events.rawIteratorAt(*ev2It); + // compute 2-event quantities and mark the candidate split collisions + VarManager::FillTwoEvents(ev1, ev2); + if (TMath::Abs(VarManager::fgValues[VarManager::kTwoEvDeltaZ]) < fConfigSplitCollisionsDeltaZ) { // this is a possible collision split + collisionSplittingMap[*ev1It] = true; + collisionSplittingMap[*ev2It] = true; + } + fHistMan->FillHistClass("SameBunchCorrelations", VarManager::fgValues); + } // end second event loop + } // end first event loop + } // end if BC1 events > 1 + + // loop over the following BCs in the TF + for (auto bc2It = std::next(bc1It); bc2It != fBCCollMap.end(); ++bc2It) { + uint64_t bc2 = bc2It->first; + if ((bc2 > bc1 ? bc2 - bc1 : bc1 - bc2) > fConfigSplitCollisionsDeltaBC) { + break; } - auto ev1 = events.rawIteratorAt(*ev1Idx); - for (auto ev2Idx = std::next(ev1Idx); ev2Idx != evIndices.end(); ++ev2Idx) { - if (!fSelMap[*ev2Idx]) { - continue; - } - auto ev2 = events.rawIteratorAt(*ev2Idx); - VarManager::FillTwoEvents(ev1, ev2); - if (TMath::Abs(VarManager::fgValues[VarManager::kTwoEvDeltaZ]) < 1.0) { // this is a possible collision split - collisionSplittingMap[*ev1Idx] = true; - collisionSplittingMap[*ev2Idx] = true; + auto bc2Events = bc2It->second; + + // loop over events in the first BC + for (auto ev1It : bc1Events) { + auto ev1 = events.rawIteratorAt(ev1It); + // loop over events in the second BC + for (auto ev2It : bc2Events) { + auto ev2 = events.rawIteratorAt(ev2It); + // compute 2-event quantities and mark the candidate split collisions + VarManager::FillTwoEvents(ev1, ev2); + if (TMath::Abs(VarManager::fgValues[VarManager::kTwoEvDeltaZ]) < fConfigSplitCollisionsDeltaZ) { // this is a possible collision split + collisionSplittingMap[ev1It] = true; + collisionSplittingMap[ev2It] = true; + } + fHistMan->FillHistClass("OutOfBunchCorrelations", VarManager::fgValues); } - fHistMan->FillHistClass("SameBunchCorrelations", VarManager::fgValues); } } } // publish the table - uint32_t evSel = 0; + uint8_t evSel = static_cast(0); for (auto& event : events) { evSel = 0; if (fSelMap[event.globalIndex()]) { // event passed the user cuts - evSel |= (uint32_t(1) << 0); + evSel |= (static_cast(1) << 0); } std::vector sameBunchEvents = fBCCollMap[event.globalBC()]; if (sameBunchEvents.size() > 1) { // event with in-bunch pileup - evSel |= (uint32_t(1) << 1); + evSel |= (static_cast(1) << 1); } if (collisionSplittingMap.find(event.globalIndex()) != collisionSplittingMap.end()) { // event with possible fake in-bunch pileup (collision splitting) - evSel |= (uint32_t(1) << 2); + evSel |= (static_cast(1) << 2); } eventSel(evSel); } @@ -360,11 +406,14 @@ struct AnalysisTrackSelection { OutputObj fOutputList{"output"}; Configurable fConfigCuts{"cfgTrackCuts", "jpsiO2MCdebugCuts2", "Comma separated list of barrel track cuts"}; - Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; Configurable fConfigAddTrackHistogram{"cfgAddTrackHistogram", "", "Comma separated list of histograms"}; + Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; + Configurable fConfigPublishAmbiguity{"cfgPublishAmbiguity", true, "If true, publish ambiguity table and fill QA histograms"}; + Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable fConfigCcdbPathTPC{"ccdb-path-tpc", "Users/z/zhxiong/TPCPID/PostCalib", "base path to the ccdb object"}; Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable fConfigComputeTPCpostCalib{"cfgTPCpostCalib", false, "If true, compute TPC post-calibrated n-sigmas"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable fConfigDummyRunlist{"cfgDummyRunlist", false, "If true, use dummy runlist"}; @@ -411,7 +460,9 @@ struct AnalysisTrackSelection { for (auto& cut : fTrackCuts) { histDirNames += Form("TrackBarrel_%s;", cut.GetName()); } - histDirNames += "TrackBarrel_AmbiguityInBunch;TrackBarrel_AmbiguityOutOfBunch;"; + if (fConfigPublishAmbiguity) { + histDirNames += "TrackBarrel_AmbiguityInBunch;TrackBarrel_AmbiguityOutOfBunch;"; + } DefineHistograms(fHistMan, histDirNames.Data(), fConfigAddTrackHistogram.value.data()); // define all histograms VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill @@ -420,12 +471,11 @@ struct AnalysisTrackSelection { if (fConfigDummyRunlist) { VarManager::SetDummyRunlist(fConfigInitRunNumber); } - if (fConfigComputeTPCpostCalib) { - fCCDB->setURL(fConfigCcdbUrl.value); - fCCDB->setCaching(true); - fCCDB->setLocalObjectValidityChecking(); - fCCDB->setCreatedNotAfter(fConfigNoLaterThan.value); - } + + fCCDB->setURL(fConfigCcdbUrl.value); + fCCDB->setCaching(true); + fCCDB->setLocalObjectValidityChecking(); + fCCDB->setCreatedNotAfter(fConfigNoLaterThan.value); fCCDBApi.init(fConfigCcdbUrl.value); } @@ -464,10 +514,12 @@ struct AnalysisTrackSelection { trackSel.reserve(assocs.size()); trackAmbiguities.reserve(tracks.size()); - uint32_t filterMap = 0; + uint32_t filterMap = static_cast(0); int iCut = 0; for (auto& assoc : assocs) { + + // if the event from this association is not selected, reject also the association auto event = assoc.template reducedevent_as(); if (!event.isEventSelected_bit(0)) { trackSel(0); @@ -478,7 +530,7 @@ struct AnalysisTrackSelection { VarManager::FillEvent(event); auto track = assoc.template reducedtrack_as(); - filterMap = 0; + filterMap = static_cast(0); VarManager::FillTrack(track); // compute quantities which depend on the associated collision, such as DCA if (fPropTrack) { @@ -490,17 +542,19 @@ struct AnalysisTrackSelection { iCut = 0; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, iCut++) { if ((*cut).IsSelected(VarManager::fgValues)) { - filterMap |= (uint32_t(1) << iCut); + filterMap |= (static_cast(1) << iCut); if (fConfigQA) { fHistMan->FillHistClass(Form("TrackBarrel_%s", (*cut).GetName()), VarManager::fgValues); } } } // end loop over cuts + // publish the decisions trackSel(filterMap); // count the number of associations per track - if (filterMap > 0) { + if (fConfigPublishAmbiguity && filterMap > 0) { + // for this track, count the number of associated collisions with in-bunch pileup and out of bunch associations if (event.isEventSelected_bit(1)) { if (fNAssocsInBunch.find(track.globalIndex()) == fNAssocsInBunch.end()) { std::vector evVector = {event.globalIndex()}; @@ -521,41 +575,47 @@ struct AnalysisTrackSelection { } } // end loop over associations - // QA the collision-track associations - for (auto& [trackIdx, evIndices] : fNAssocsInBunch) { - if (evIndices.size() == 1) { - continue; - } - auto track = tracks.rawIteratorAt(trackIdx); - VarManager::ResetValues(0, VarManager::kNBarrelTrackVariables); - VarManager::FillTrack(track); - VarManager::fgValues[VarManager::kBarrelNAssocsInBunch] = static_cast(evIndices.size()); - fHistMan->FillHistClass("TrackBarrel_AmbiguityInBunch", VarManager::fgValues); - } // end loop over in-bunch ambiguous tracks + if (fConfigPublishAmbiguity) { + // QA the collision-track associations + if (fConfigQA) { + for (auto& [trackIdx, evIndices] : fNAssocsInBunch) { + if (evIndices.size() == 1) { + continue; + } + auto track = tracks.rawIteratorAt(trackIdx); + VarManager::ResetValues(0, VarManager::kNBarrelTrackVariables); + VarManager::FillTrack(track); + // Exceptionally, set the VarManager ambiguity number here, to be used in histograms + VarManager::fgValues[VarManager::kBarrelNAssocsInBunch] = static_cast(evIndices.size()); + fHistMan->FillHistClass("TrackBarrel_AmbiguityInBunch", VarManager::fgValues); + } // end loop over in-bunch ambiguous tracks - for (auto& [trackIdx, evIndices] : fNAssocsOutOfBunch) { - if (evIndices.size() == 1) { - continue; + for (auto& [trackIdx, evIndices] : fNAssocsOutOfBunch) { + if (evIndices.size() == 1) { + continue; + } + auto track = tracks.rawIteratorAt(trackIdx); + VarManager::ResetValues(0, VarManager::kNBarrelTrackVariables); + VarManager::FillTrack(track); + // Exceptionally, set the VarManager ambiguity number here + VarManager::fgValues[VarManager::kBarrelNAssocsOutOfBunch] = static_cast(evIndices.size()); + fHistMan->FillHistClass("TrackBarrel_AmbiguityOutOfBunch", VarManager::fgValues); + } // end loop over out-of-bunch ambiguous tracks } - auto track = tracks.rawIteratorAt(trackIdx); - VarManager::ResetValues(0, VarManager::kNBarrelTrackVariables); - VarManager::FillTrack(track); - VarManager::fgValues[VarManager::kBarrelNAssocsOutOfBunch] = static_cast(evIndices.size()); - fHistMan->FillHistClass("TrackBarrel_AmbiguityOutOfBunch", VarManager::fgValues); - } // end loop over out-of-bunch ambiguous tracks - // publish the ambiguity table - for (auto& track : tracks) { - int8_t nInBunch = 0; - if (fNAssocsInBunch.find(track.globalIndex()) != fNAssocsInBunch.end()) { - nInBunch = fNAssocsInBunch[track.globalIndex()].size(); - } - int8_t nOutOfBunch = 0; - if (fNAssocsOutOfBunch.find(track.globalIndex()) != fNAssocsOutOfBunch.end()) { - nOutOfBunch = fNAssocsOutOfBunch[track.globalIndex()].size(); + // publish the ambiguity table + for (auto& track : tracks) { + int8_t nInBunch = 0; + if (fNAssocsInBunch.find(track.globalIndex()) != fNAssocsInBunch.end()) { + nInBunch = fNAssocsInBunch[track.globalIndex()].size(); + } + int8_t nOutOfBunch = 0; + if (fNAssocsOutOfBunch.find(track.globalIndex()) != fNAssocsOutOfBunch.end()) { + nOutOfBunch = fNAssocsOutOfBunch[track.globalIndex()].size(); + } + trackAmbiguities(nInBunch, nOutOfBunch); } - trackAmbiguities(nInBunch, nOutOfBunch); - } + } // end if (fConfigPublishAmbiguity) } // end runTrackSelection() @@ -592,6 +652,8 @@ struct AnalysisMuonSelection { Configurable fConfigCuts{"cfgMuonCuts", "muonQualityCuts", "Comma separated list of muon cuts"}; Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; Configurable fConfigAddMuonHistogram{"cfgAddMuonHistogram", "", "Comma separated list of histograms"}; + Configurable fConfigPublishAmbiguity{"cfgPublishAmbiguity", true, "If true, publish ambiguity table and fill QA histograms"}; + Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; @@ -634,7 +696,9 @@ struct AnalysisMuonSelection { for (auto& cut : fMuonCuts) { histDirNames += Form("TrackMuon_%s;", cut.GetName()); } - histDirNames += "TrackMuon_AmbiguityInBunch;TrackMuon_AmbiguityOutOfBunch;"; + if (fConfigPublishAmbiguity) { + histDirNames += "TrackMuon_AmbiguityInBunch;TrackMuon_AmbiguityOutOfBunch;"; + } DefineHistograms(fHistMan, histDirNames.Data(), fConfigAddMuonHistogram.value.data()); // define all histograms VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill @@ -669,7 +733,7 @@ struct AnalysisMuonSelection { muonSel.reserve(assocs.size()); muonAmbiguities.reserve(muons.size()); - uint32_t filterMap = 0; + uint32_t filterMap = static_cast(0); int iCut = 0; for (auto& assoc : assocs) { @@ -683,7 +747,7 @@ struct AnalysisMuonSelection { VarManager::FillEvent(event); auto track = assoc.template reducedmuon_as(); - filterMap = 0; + filterMap = static_cast(0); VarManager::FillTrack(track); if (fConfigQA) { fHistMan->FillHistClass("TrackMuon_BeforeCuts", VarManager::fgValues); @@ -691,7 +755,7 @@ struct AnalysisMuonSelection { iCut = 0; for (auto cut = fMuonCuts.begin(); cut != fMuonCuts.end(); cut++, iCut++) { if ((*cut).IsSelected(VarManager::fgValues)) { - filterMap |= (uint32_t(1) << iCut); + filterMap |= (static_cast(1) << iCut); if (fConfigQA) { fHistMan->FillHistClass(Form("TrackMuon_%s", (*cut).GetName()), VarManager::fgValues); } @@ -700,7 +764,7 @@ struct AnalysisMuonSelection { muonSel(filterMap); // count the number of associations per track - if (filterMap > 0) { + if (fConfigPublishAmbiguity && filterMap > 0) { if (event.isEventSelected_bit(1)) { if (fNAssocsInBunch.find(track.globalIndex()) == fNAssocsInBunch.end()) { std::vector evVector = {event.globalIndex()}; @@ -718,45 +782,47 @@ struct AnalysisMuonSelection { evVector.push_back(event.globalIndex()); } } - } + } // end if (fConfigPublishAmbiguity) } // end loop over assocs - // QA the collision-track associations - if (fConfigQA) { - for (auto& [trackIdx, evIndices] : fNAssocsInBunch) { - if (evIndices.size() == 1) { - continue; - } - auto track = muons.rawIteratorAt(trackIdx); - VarManager::ResetValues(0, VarManager::kNMuonTrackVariables); - VarManager::FillTrack(track); - VarManager::fgValues[VarManager::kMuonNAssocsInBunch] = static_cast(evIndices.size()); - fHistMan->FillHistClass("TrackMuon_AmbiguityInBunch", VarManager::fgValues); - } // end loop over in-bunch ambiguous tracks - - for (auto& [trackIdx, evIndices] : fNAssocsOutOfBunch) { - if (evIndices.size() == 1) { - continue; - } - auto track = muons.rawIteratorAt(trackIdx); - VarManager::ResetValues(0, VarManager::kNMuonTrackVariables); - VarManager::FillTrack(track); - VarManager::fgValues[VarManager::kMuonNAssocsOutOfBunch] = static_cast(evIndices.size()); - fHistMan->FillHistClass("TrackMuon_AmbiguityOutOfBunch", VarManager::fgValues); - } // end loop over out-of-bunch ambiguous tracks - } + if (fConfigPublishAmbiguity) { + // QA the collision-track associations + if (fConfigQA) { + for (auto& [trackIdx, evIndices] : fNAssocsInBunch) { + if (evIndices.size() == 1) { + continue; + } + auto track = muons.rawIteratorAt(trackIdx); + VarManager::ResetValues(0, VarManager::kNMuonTrackVariables); + VarManager::FillTrack(track); + VarManager::fgValues[VarManager::kMuonNAssocsInBunch] = static_cast(evIndices.size()); + fHistMan->FillHistClass("TrackMuon_AmbiguityInBunch", VarManager::fgValues); + } // end loop over in-bunch ambiguous tracks - // publish the ambiguity table - for (auto& track : muons) { - int8_t nInBunch = 0; - if (fNAssocsInBunch.find(track.globalIndex()) != fNAssocsInBunch.end()) { - nInBunch = fNAssocsInBunch[track.globalIndex()].size(); + for (auto& [trackIdx, evIndices] : fNAssocsOutOfBunch) { + if (evIndices.size() == 1) { + continue; + } + auto track = muons.rawIteratorAt(trackIdx); + VarManager::ResetValues(0, VarManager::kNMuonTrackVariables); + VarManager::FillTrack(track); + VarManager::fgValues[VarManager::kMuonNAssocsOutOfBunch] = static_cast(evIndices.size()); + fHistMan->FillHistClass("TrackMuon_AmbiguityOutOfBunch", VarManager::fgValues); + } // end loop over out-of-bunch ambiguous tracks } - int8_t nOutOfBunch = 0; - if (fNAssocsOutOfBunch.find(track.globalIndex()) != fNAssocsOutOfBunch.end()) { - nOutOfBunch = fNAssocsOutOfBunch[track.globalIndex()].size(); + + // publish the ambiguity table + for (auto& track : muons) { + int8_t nInBunch = 0; + if (fNAssocsInBunch.find(track.globalIndex()) != fNAssocsInBunch.end()) { + nInBunch = fNAssocsInBunch[track.globalIndex()].size(); + } + int8_t nOutOfBunch = 0; + if (fNAssocsOutOfBunch.find(track.globalIndex()) != fNAssocsOutOfBunch.end()) { + nOutOfBunch = fNAssocsOutOfBunch[track.globalIndex()].size(); + } + muonAmbiguities(nInBunch, nOutOfBunch); } - muonAmbiguities(nInBunch, nOutOfBunch); } } @@ -790,8 +856,6 @@ struct AnalysisPrefilterSelection { uint32_t fPrefilterMask; int fPrefilterCutBit; - Preslice trackAssocsPerCollision = aod::reducedtrack_association::reducedeventId; - void init(o2::framework::InitContext& context) { if (context.mOptions.get("processDummy")) { @@ -810,7 +874,7 @@ struct AnalysisPrefilterSelection { // get the list of cuts that were computed in the barrel track-selection task and create a bit mask // to mark just the ones we want to apply a prefilter on - fPrefilterMask = 0; + fPrefilterMask = static_cast(0); fPrefilterCutBit = -1; string trackCuts; getTaskOptionValue(context, "analysis-track-selection", "cfgTrackCuts", trackCuts, false); @@ -824,18 +888,15 @@ struct AnalysisPrefilterSelection { for (int icut = 0; icut < objArray->GetEntries(); ++icut) { TString tempStr = objArray->At(icut)->GetName(); if (objArrayTrackCuts->FindObject(tempStr.Data()) != nullptr) { - fPrefilterMask |= (uint32_t(1) << icut); + fPrefilterMask |= (static_cast(1) << icut); } if (tempStr.CompareTo(fConfigPrefilterTrackCut.value) == 0) { fPrefilterCutBit = icut; } } } - if (fPrefilterMask == 0) { - LOG(fatal) << "No specified track cuts for prefiltering"; - } - if (fPrefilterCutBit < 0) { - LOG(fatal) << "No or incorrectly specified loose track prefilter cut"; + if (fPrefilterMask == static_cast(0) || fPrefilterCutBit < 0) { + LOG(warn) << "No specified loose cut or track cuts for prefiltering. This task will do nothing."; } // setup the prefilter pair cut @@ -849,12 +910,15 @@ struct AnalysisPrefilterSelection { VarManager::SetDefaultVarNames(); VarManager::SetupTwoProngDCAFitter(5.0f, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, true); // TODO: get these parameters from Configurables - VarManager::SetupTwoProngFwdDCAFitter(5.0f, true, 200.0f, 1.0e-3f, 0.9f, true); + // VarManager::SetupTwoProngFwdDCAFitter(5.0f, true, 200.0f, 1.0e-3f, 0.9f, true); } template void runPrefilter(soa::Join const& assocs, TTracks const& /*tracks*/) { + if (fPrefilterCutBit < 0 || fPrefilterMask == 0) { + return; + } for (auto& [assoc1, assoc2] : o2::soa::combinations(assocs, assocs)) { auto track1 = assoc1.template reducedtrack_as(); @@ -872,6 +936,7 @@ struct AnalysisPrefilterSelection { bool track1Loose = assoc1.isBarrelSelected_bit(fPrefilterCutBit); bool track2Loose = assoc2.isBarrelSelected_bit(fPrefilterCutBit); + // Here we check if we should apply the prefilter for this pair if (!((track1Candidate > 0 && track2Loose) || (track2Candidate > 0 && track1Loose))) { continue; } @@ -890,6 +955,8 @@ struct AnalysisPrefilterSelection { } // end loop over combinations } + Preslice trackAssocsPerCollision = aod::reducedtrack_association::reducedeventId; + void processBarrelSkimmed(MyEvents const& events, soa::Join const& assocs, MyBarrelTracks const& tracks) { @@ -905,11 +972,14 @@ struct AnalysisPrefilterSelection { for (auto& assoc : assocs) { auto track = assoc.template reducedtrack_as(); mymap = -1; - if (fPrefilterMap.find(track.globalIndex()) != fPrefilterMap.end()) { + // If cuts were not configured, then produce a map with all 1's + if (fPrefilterCutBit < 0 || fPrefilterMask == 0) { + prefilter(mymap); + } else if (fPrefilterMap.find(track.globalIndex()) != fPrefilterMap.end()) { // NOTE: publish the bitwise negated bits (~), so there will be zeroes for cuts that failed the prefiltering and 1 everywhere else mymap = ~fPrefilterMap[track.globalIndex()]; + prefilter(mymap); } - prefilter(mymap); } } @@ -944,38 +1014,42 @@ struct AnalysisSameEventPairing { OutputObj fOutputList{"output"}; - Configurable fConfigTrackCuts{"cfgTrackCuts", "jpsiO2MCdebugCuts2", "Comma separated list of barrel track cuts"}; - Configurable fConfigMuonCuts{"cfgMuonCuts", "", "Comma separated list of muon cuts"}; - Configurable fConfigPairCuts{"cfgPairCuts", "", "Comma separated list of pair cuts"}; + struct : ConfigurableGroup { + Configurable track{"cfgTrackCuts", "jpsiO2MCdebugCuts2", "Comma separated list of barrel track cuts"}; + Configurable muon{"cfgMuonCuts", "", "Comma separated list of muon cuts"}; + Configurable pair{"cfgPairCuts", "", "Comma separated list of pair cuts"}; + } fConfigCuts; Configurable fConfigMixingDepth{"cfgMixingDepth", 100, "Number of Events stored for event mixing"}; // Configurable fConfigAddEventMixingHistogram{"cfgAddEventMixingHistogram", "", "Comma separated list of histograms"}; - - Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable fConfigCcdbPath{"ccdb-path", "Users/lm", "base path to the ccdb object"}; - Configurable fConfigNoLaterThan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; - Configurable fConfigGRPMagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - Configurable fConfigUseRemoteField{"cfgUseRemoteField", false, "Chose whether to fetch the magnetic field from ccdb or set it manually"}; - Configurable fConfigMagField{"cfgMagField", 5.0f, "Manually set magnetic field"}; - Configurable fConfigAddSEPHistogram{"cfgAddSEPHistogram", "", "Comma separated list of histograms"}; - Configurable fConfigFlatTables{"cfgFlatTables", false, "Produce a single flat tables with all relevant information of the pairs and single tracks"}; - Configurable fConfigUseKFVertexing{"cfgUseKFVertexing", false, "Use KF Particle for secondary vertex reconstruction (DCAFitter is used by default)"}; - Configurable fConfigUseAbsDCA{"cfgUseAbsDCA", false, "Use absolute DCA minimization instead of chi^2 minimization in secondary vertexing"}; - Configurable fConfigPropToPCA{"cfgPropToPCA", false, "Propagate tracks to secondary vertex"}; - Configurable fConfigCorrFullGeo{"cfgCorrFullGeo", false, "Use full geometry to correct for MCS effects in track propagation"}; - Configurable fConfigNoCorr{"cfgNoCorrFwdProp", false, "Do not correct for MCS effects in track propagation"}; - Configurable fConfigLutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; - Configurable fConfigGeoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; - Configurable fConfigCollisionSystem{"syst", "pp", "Collision system, pp or PbPb"}; - Configurable fConfigCenterMassEnergy{"energy", 13600, "Center of mass energy in GeV"}; - // Track related options - Configurable fPropTrack{"cfgPropTrack", true, "Propgate tracks to associated collision to recalculate DCA and momentum vector"}; + Configurable fConfigQA{"cfgQA", true, "If true, fill output histograms"}; + + struct : ConfigurableGroup { + Configurable url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable grpMagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; + Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + } fConfigCCDB; + + struct : ConfigurableGroup { + Configurable useRemoteField{"cfgUseRemoteField", false, "Chose whether to fetch the magnetic field from ccdb or set it manually"}; + Configurable magField{"cfgMagField", 5.0f, "Manually set magnetic field"}; + Configurable flatTables{"cfgFlatTables", false, "Produce a single flat tables with all relevant information of the pairs and single tracks"}; + Configurable useKFVertexing{"cfgUseKFVertexing", false, "Use KF Particle for secondary vertex reconstruction (DCAFitter is used by default)"}; + Configurable useAbsDCA{"cfgUseAbsDCA", false, "Use absolute DCA minimization instead of chi^2 minimization in secondary vertexing"}; + Configurable propToPCA{"cfgPropToPCA", false, "Propagate tracks to secondary vertex"}; + Configurable corrFullGeo{"cfgCorrFullGeo", false, "Use full geometry to correct for MCS effects in track propagation"}; + Configurable noCorr{"cfgNoCorrFwdProp", false, "Do not correct for MCS effects in track propagation"}; + Configurable collisionSystem{"syst", "pp", "Collision system, pp or PbPb"}; + Configurable centerMassEnergy{"energy", 13600, "Center of mass energy in GeV"}; + Configurable propTrack{"cfgPropTrack", true, "Propgate tracks to associated collision to recalculate DCA and momentum vector"}; + } fConfigOptions; Service fCCDB; o2::ccdb::CcdbApi fCCDBApi; - Filter filterEventSelected = aod::dqanalysisflags::isEventSelected == uint32_t(1); + Filter filterEventSelected = aod::dqanalysisflags::isEventSelected > static_cast(1); HistogramManager* fHistMan; @@ -1016,7 +1090,7 @@ struct AnalysisSameEventPairing { TString histNames = ""; std::vector names; - TString cutNamesStr = fConfigPairCuts.value; + TString cutNamesStr = fConfigCuts.pair.value; if (!cutNamesStr.IsNull()) { std::unique_ptr objArray(cutNamesStr.Tokenize(",")); for (int icut = 0; icut < objArray->GetEntries(); ++icut) { @@ -1026,12 +1100,12 @@ struct AnalysisSameEventPairing { // get the list of cuts for tracks/muons, check that they were played by the barrel/muon selection tasks // and make a mask for active cuts (barrel and muon selection tasks may run more cuts, needed for other analyses) - TString trackCutsStr = fConfigTrackCuts.value; + TString trackCutsStr = fConfigCuts.track.value; TObjArray* objArrayTrackCuts = nullptr; if (!trackCutsStr.IsNull()) { objArrayTrackCuts = trackCutsStr.Tokenize(","); } - TString muonCutsStr = fConfigMuonCuts.value; + TString muonCutsStr = fConfigCuts.muon.value; TObjArray* objArrayMuonCuts = nullptr; if (!muonCutsStr.IsNull()) { objArrayMuonCuts = muonCutsStr.Tokenize(","); @@ -1047,7 +1121,7 @@ struct AnalysisSameEventPairing { for (int icut = 0; icut < objArray->GetEntries(); ++icut) { TString tempStr = objArray->At(icut)->GetName(); if (objArrayTrackCuts->FindObject(tempStr.Data()) != nullptr) { - fTrackFilterMask |= (uint32_t(1) << icut); + fTrackFilterMask |= (static_cast(1) << icut); if (fEnableBarrelHistos) { names = { @@ -1071,7 +1145,7 @@ struct AnalysisSameEventPairing { histNames += Form("%s;%s;%s;", names[(fEnableBarrelMixingHistos ? 9 : 6)].Data(), names[(fEnableBarrelMixingHistos ? 10 : 7)].Data(), names[(fEnableBarrelMixingHistos ? 11 : 8)].Data()); fTrackHistNames[icut] = names; - TString cutNamesStr = fConfigPairCuts.value; + TString cutNamesStr = fConfigCuts.pair.value; if (!cutNamesStr.IsNull()) { // if pair cuts std::unique_ptr objArrayPair(cutNamesStr.Tokenize(",")); fNPairCuts = objArrayPair->GetEntries(); @@ -1097,7 +1171,7 @@ struct AnalysisSameEventPairing { for (int icut = 0; icut < objArray->GetEntries(); ++icut) { TString tempStr = objArray->At(icut)->GetName(); if (objArrayMuonCuts->FindObject(tempStr.Data()) != nullptr) { - fMuonFilterMask |= (uint32_t(1) << icut); + fMuonFilterMask |= (static_cast(1) << icut); if (fEnableMuonHistos) { // no pair cuts @@ -1140,7 +1214,7 @@ struct AnalysisSameEventPairing { } fMuonHistNames[icut] = names; - TString cutNamesStr = fConfigPairCuts.value; + TString cutNamesStr = fConfigCuts.pair.value; if (!cutNamesStr.IsNull()) { // if pair cuts std::unique_ptr objArrayPair(cutNamesStr.Tokenize(",")); fNPairCuts = objArrayPair->GetEntries(); @@ -1160,30 +1234,25 @@ struct AnalysisSameEventPairing { fCurrentRun = 0; - fCCDB->setURL(fConfigCcdbUrl.value); + fCCDB->setURL(fConfigCCDB.url.value); fCCDB->setCaching(true); fCCDB->setLocalObjectValidityChecking(); - fCCDBApi.init(fConfigCcdbUrl.value); + fCCDBApi.init(fConfigCCDB.url.value); - if (fConfigNoCorr) { + if (fConfigOptions.noCorr) { VarManager::SetupFwdDCAFitterNoCorr(); - } else if (fConfigCorrFullGeo || (fConfigUseKFVertexing && fConfigPropToPCA)) { + } else if (fConfigOptions.corrFullGeo || (fConfigOptions.useKFVertexing && fConfigOptions.propToPCA)) { if (!o2::base::GeometryManager::isGeometryLoaded()) { - fCCDB->get(fConfigGeoPath); + fCCDB->get(fConfigCCDB.geoPath); } } else { - fLUT = o2::base::MatLayerCylSet::rectifyPtrFromFile(fCCDB->get(fConfigLutPath)); + fLUT = o2::base::MatLayerCylSet::rectifyPtrFromFile(fCCDB->get(fConfigCCDB.lutPath)); VarManager::SetupMatLUTFwdDCAFitter(fLUT); } - VarManager::SetDefaultVarNames(); - fHistMan = new HistogramManager("analysisHistos", "aa", VarManager::kNVars); - fHistMan->SetUseDefaultVariableNames(kTRUE); - fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); - /*if (context.mOptions.get("processElectronMuonSkimmed") || context.mOptions.get("processAllSkimmed")) { - TString cutNamesBarrel = fConfigTrackCuts.value; - TString cutNamesMuon = fConfigMuonCuts.value; + TString cutNamesBarrel = fConfigCuts.track.value; + TString cutNamesMuon = fConfigCuts.muon.value; if (!cutNamesBarrel.IsNull() && !cutNamesMuon.IsNull()) { std::unique_ptr objArrayBarrel(cutNamesBarrel.Tokenize(",")); std::unique_ptr objArrayMuon(cutNamesMuon.Tokenize(",")); @@ -1197,7 +1266,7 @@ struct AnalysisSameEventPairing { histNames += Form("%s;%s;%s;", names[0].Data(), names[1].Data(), names[2].Data()); fTrackMuonHistNames.push_back(names); - TString cutNamesStr = fConfigPairCuts.value; + TString cutNamesStr = fConfigCuts.pair.value; if (!cutNamesStr.IsNull()) { // if pair cuts std::unique_ptr objArrayPair(cutNamesStr.Tokenize(",")); for (int iPairCut = 0; iPairCut < objArrayPair->GetEntries(); ++iPairCut) { // loop over pair cuts @@ -1214,18 +1283,23 @@ struct AnalysisSameEventPairing { } // end if (track cuts) }*/ - VarManager::SetCollisionSystem((TString)fConfigCollisionSystem, fConfigCenterMassEnergy); // set collision system and center of mass energy - - DefineHistograms(fHistMan, histNames.Data(), fConfigAddSEPHistogram.value.data()); // define all histograms - VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill - fOutputList.setObject(fHistMan->GetMainHistogramList()); + if (fConfigQA) { + VarManager::SetDefaultVarNames(); + fHistMan = new HistogramManager("analysisHistos", "aa", VarManager::kNVars); + fHistMan->SetUseDefaultVariableNames(true); + fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); + VarManager::SetCollisionSystem((TString)fConfigOptions.collisionSystem, fConfigOptions.centerMassEnergy); // set collision system and center of mass energy + DefineHistograms(fHistMan, histNames.Data(), fConfigAddSEPHistogram.value.data()); // define all histograms + VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill + fOutputList.setObject(fHistMan->GetMainHistogramList()); + } } void initParamsFromCCDB(uint64_t timestamp, int runNumber, bool withTwoProngFitter = true) { - if (fConfigUseRemoteField.value) { - o2::parameters::GRPMagField* grpmag = fCCDB->getForTimeStamp(fConfigGRPMagPath, timestamp); + if (fConfigOptions.useRemoteField.value) { + o2::parameters::GRPMagField* grpmag = fCCDB->getForTimeStamp(fConfigCCDB.grpMagPath, timestamp); float magField = 0.0; if (grpmag != nullptr) { magField = grpmag->getNominalL3Field(); @@ -1233,25 +1307,25 @@ struct AnalysisSameEventPairing { LOGF(fatal, "GRP object is not available in CCDB at timestamp=%llu", timestamp); } if (withTwoProngFitter) { - if (fConfigUseKFVertexing.value) { + if (fConfigOptions.useKFVertexing.value) { VarManager::SetupTwoProngKFParticle(magField); } else { - VarManager::SetupTwoProngDCAFitter(magField, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); // TODO: get these parameters from Configurables - VarManager::SetupTwoProngFwdDCAFitter(magField, true, 200.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); + VarManager::SetupTwoProngDCAFitter(magField, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigOptions.useAbsDCA.value); // TODO: get these parameters from Configurables + VarManager::SetupTwoProngFwdDCAFitter(magField, true, 200.0f, 1.0e-3f, 0.9f, fConfigOptions.useAbsDCA.value); } } else { - VarManager::SetupTwoProngDCAFitter(magField, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); // needed because take in varmanager Bz from fgFitterTwoProngBarrel for PhiV calculations + VarManager::SetupTwoProngDCAFitter(magField, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigOptions.useAbsDCA.value); // needed because take in varmanager Bz from fgFitterTwoProngBarrel for PhiV calculations } } else { if (withTwoProngFitter) { - if (fConfigUseKFVertexing.value) { - VarManager::SetupTwoProngKFParticle(fConfigMagField.value); + if (fConfigOptions.useKFVertexing.value) { + VarManager::SetupTwoProngKFParticle(fConfigOptions.magField.value); } else { - VarManager::SetupTwoProngDCAFitter(fConfigMagField.value, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); // TODO: get these parameters from Configurables - VarManager::SetupTwoProngFwdDCAFitter(fConfigMagField.value, true, 200.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); + VarManager::SetupTwoProngDCAFitter(fConfigOptions.magField.value, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigOptions.useAbsDCA.value); // TODO: get these parameters from Configurables + VarManager::SetupTwoProngFwdDCAFitter(fConfigOptions.magField.value, true, 200.0f, 1.0e-3f, 0.9f, fConfigOptions.useAbsDCA.value); } } else { - VarManager::SetupTwoProngDCAFitter(fConfigMagField.value, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); // needed because take in varmanager Bz from fgFitterTwoProngBarrel for PhiV calculations + VarManager::SetupTwoProngDCAFitter(fConfigOptions.magField.value, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigOptions.useAbsDCA.value); // needed because take in varmanager Bz from fgFitterTwoProngBarrel for PhiV calculations } } @@ -1273,12 +1347,12 @@ struct AnalysisSameEventPairing { } } - TString cutNames = fConfigTrackCuts.value; + TString cutNames = fConfigCuts.track.value; std::map> histNames = fTrackHistNames; int ncuts = fNCutsBarrel; int histIdxOffset = 0; if constexpr (TPairType == pairTypeMuMu) { - cutNames = fConfigMuonCuts.value; + cutNames = fConfigCuts.muon.value; histNames = fMuonHistNames; ncuts = fNCutsMuon; if (fEnableMuonMixingHistos) { @@ -1291,12 +1365,12 @@ struct AnalysisSameEventPairing { } } /*if constexpr (TPairType == pairTypeEMu) { - cutNames = fConfigMuonCuts.value; + cutNames = fConfigCuts.muon.value; histNames = fTrackMuonHistNames; }*/ - uint32_t twoTrackFilter = 0; - uint32_t dileptonMcDecision = 0; // placeholder, copy of the dqEfficiency.cxx one + uint32_t twoTrackFilter = static_cast(0); + uint32_t dileptonMcDecision = static_cast(0); // placeholder, copy of the dqEfficiency.cxx one int sign1 = 0; int sign2 = 0; dielectronList.reserve(1); @@ -1306,7 +1380,7 @@ struct AnalysisSameEventPairing { dimuonsExtraList.reserve(1); dileptonInfoList.reserve(1); dileptonFlowList.reserve(1); - if (fConfigFlatTables.value) { + if (fConfigOptions.flatTables.value) { dielectronAllList.reserve(1); dimuonAllList.reserve(1); } @@ -1341,26 +1415,27 @@ struct AnalysisSameEventPairing { sign1 = t1.sign(); sign2 = t2.sign(); // store the ambiguity number of the two dilepton legs in the last 4 digits of the two-track filter + // TODO: Make sure that we do not work with more than 28 track bits if (t1.barrelAmbiguityInBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 28); + twoTrackFilter |= (static_cast(1) << 28); } if (t2.barrelAmbiguityInBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 29); + twoTrackFilter |= (static_cast(1) << 29); } if (t1.barrelAmbiguityOutOfBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 30); + twoTrackFilter |= (static_cast(1) << 30); } if (t2.barrelAmbiguityOutOfBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 31); + twoTrackFilter |= (static_cast(1) << 31); } VarManager::FillPair(t1, t2); // compute quantities which depend on the associated collision, such as DCA - if (fPropTrack) { + if (fConfigOptions.propTrack) { VarManager::FillPairCollision(event, t1, t2); } if constexpr (TTwoProngFitter) { - VarManager::FillPairVertexing(event, t1, t2, fConfigPropToPCA); + VarManager::FillPairVertexing(event, t1, t2, fConfigOptions.propToPCA); } if constexpr (eventHasQvector) { VarManager::FillPairVn(t1, t2); @@ -1377,7 +1452,7 @@ struct AnalysisSameEventPairing { if constexpr (trackHasCov && TTwoProngFitter) { dielectronsExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauzProjected], VarManager::fgValues[VarManager::kVertexingLzProjected], VarManager::fgValues[VarManager::kVertexingLxyProjected]); if constexpr ((TTrackFillMap & VarManager::ObjTypes::ReducedTrackBarrelPID) > 0) { - if (fConfigFlatTables.value) { + if (fConfigOptions.flatTables.value) { dielectronAllList(VarManager::fgValues[VarManager::kMass], VarManager::fgValues[VarManager::kPt], VarManager::fgValues[VarManager::kEta], VarManager::fgValues[VarManager::kPhi], t1.sign() + t2.sign(), twoTrackFilter, dileptonMcDecision, t1.pt(), t1.eta(), t1.phi(), t1.itsClusterMap(), t1.itsChi2NCl(), t1.tpcNClsCrossedRows(), t1.tpcNClsFound(), t1.tpcChi2NCl(), t1.dcaXY(), t1.dcaZ(), t1.tpcSignal(), t1.tpcNSigmaEl(), t1.tpcNSigmaPi(), t1.tpcNSigmaPr(), t1.beta(), t1.tofNSigmaEl(), t1.tofNSigmaPi(), t1.tofNSigmaPr(), t2.pt(), t2.eta(), t2.phi(), t2.itsClusterMap(), t2.itsChi2NCl(), t2.tpcNClsCrossedRows(), t2.tpcNClsFound(), t2.tpcChi2NCl(), t2.dcaXY(), t2.dcaZ(), t2.tpcSignal(), t2.tpcNSigmaEl(), t2.tpcNSigmaPi(), t2.tpcNSigmaPr(), t2.beta(), t2.tofNSigmaEl(), t2.tofNSigmaPi(), t2.tofNSigmaPr(), @@ -1407,25 +1482,25 @@ struct AnalysisSameEventPairing { sign2 = t2.sign(); // store the ambiguity number of the two dilepton legs in the last 4 digits of the two-track filter if (t1.muonAmbiguityInBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 28); + twoTrackFilter |= (static_cast(1) << 28); } if (t2.muonAmbiguityInBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 29); + twoTrackFilter |= (static_cast(1) << 29); } if (t1.muonAmbiguityOutOfBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 30); + twoTrackFilter |= (static_cast(1) << 30); } if (t2.muonAmbiguityOutOfBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 31); + twoTrackFilter |= (static_cast(1) << 31); } VarManager::FillPair(t1, t2); // compute quantities which depend on the associated collision, such as DCA - if (fPropTrack) { + if (fConfigOptions.propTrack) { VarManager::FillPairCollision(event, t1, t2); } if constexpr (TTwoProngFitter) { - VarManager::FillPairVertexing(event, t1, t2, fConfigPropToPCA); + VarManager::FillPairVertexing(event, t1, t2, fConfigOptions.propToPCA); } if constexpr (eventHasQvector) { VarManager::FillPairVn(t1, t2); @@ -1440,7 +1515,7 @@ struct AnalysisSameEventPairing { if constexpr (TTwoProngFitter) { dimuonsExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]); - if (fConfigFlatTables.value) { + if (fConfigOptions.flatTables.value) { dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(), -999., -999., -999., VarManager::fgValues[VarManager::kMass], @@ -1460,7 +1535,7 @@ struct AnalysisSameEventPairing { -999., -999., -999., -999., -999., -999., -999., -999., -999., -999., -999., -999., - (twoTrackFilter & (uint32_t(1) << 28)) || (twoTrackFilter & (uint32_t(1) << 30)), (twoTrackFilter & (uint32_t(1) << 29)) || (twoTrackFilter & (uint32_t(1) << 31)), + (twoTrackFilter & (static_cast(1) << 28)) || (twoTrackFilter & (static_cast(1) << 30)), (twoTrackFilter & (static_cast(1) << 29)) || (twoTrackFilter & (static_cast(1) << 31)), VarManager::fgValues[VarManager::kU2Q2], VarManager::fgValues[VarManager::kU3Q3], VarManager::fgValues[VarManager::kR2EP_AB], VarManager::fgValues[VarManager::kR2SP_AB], VarManager::fgValues[VarManager::kCentFT0C], VarManager::fgValues[VarManager::kCos2DeltaPhi], VarManager::fgValues[VarManager::kCos3DeltaPhi], @@ -1495,10 +1570,10 @@ struct AnalysisSameEventPairing { bool isAmbiOutOfBunch = false; bool isUnambiguous = false; for (int icut = 0; icut < ncuts; icut++) { - if (twoTrackFilter & (uint32_t(1) << icut)) { - isAmbiInBunch = (twoTrackFilter & (uint32_t(1) << 28)) || (twoTrackFilter & (uint32_t(1) << 29)); - isAmbiOutOfBunch = (twoTrackFilter & (uint32_t(1) << 30)) || (twoTrackFilter & (uint32_t(1) << 31)); - isUnambiguous = !((twoTrackFilter & (uint32_t(1) << 28)) || (twoTrackFilter & (uint32_t(1) << 29)) || (twoTrackFilter & (uint32_t(1) << 30)) || (twoTrackFilter & (uint32_t(1) << 31))); + if (twoTrackFilter & (static_cast(1) << icut)) { + isAmbiInBunch = (twoTrackFilter & (static_cast(1) << 28)) || (twoTrackFilter & (static_cast(1) << 29)); + isAmbiOutOfBunch = (twoTrackFilter & (static_cast(1) << 30)) || (twoTrackFilter & (static_cast(1) << 31)); + isUnambiguous = !(isAmbiInBunch || isAmbiOutOfBunch); if (sign1 * sign2 < 0) { fHistMan->FillHistClass(histNames[icut][0].Data(), VarManager::fgValues); if (isAmbiInBunch) { @@ -1507,8 +1582,10 @@ struct AnalysisSameEventPairing { if (isAmbiOutOfBunch) { fHistMan->FillHistClass(histNames[icut][3 + histIdxOffset + 3].Data(), VarManager::fgValues); } - if (isUnambiguous) { - fHistMan->FillHistClass(histNames[icut][3 + histIdxOffset + 6].Data(), VarManager::fgValues); + if constexpr (TPairType == VarManager::kDecayToMuMu) { + if (isUnambiguous) { + fHistMan->FillHistClass(histNames[icut][3 + histIdxOffset + 6].Data(), VarManager::fgValues); + } } } else { if (sign1 > 0) { @@ -1519,8 +1596,10 @@ struct AnalysisSameEventPairing { if (isAmbiOutOfBunch) { fHistMan->FillHistClass(histNames[icut][4 + histIdxOffset + 3].Data(), VarManager::fgValues); } - if (isUnambiguous) { - fHistMan->FillHistClass(histNames[icut][4 + histIdxOffset + 6].Data(), VarManager::fgValues); + if constexpr (TPairType == VarManager::kDecayToMuMu) { + if (isUnambiguous) { + fHistMan->FillHistClass(histNames[icut][4 + histIdxOffset + 6].Data(), VarManager::fgValues); + } } } else { fHistMan->FillHistClass(histNames[icut][2].Data(), VarManager::fgValues); @@ -1530,8 +1609,10 @@ struct AnalysisSameEventPairing { if (isAmbiOutOfBunch) { fHistMan->FillHistClass(histNames[icut][5 + histIdxOffset + 3].Data(), VarManager::fgValues); } - if (isUnambiguous) { - fHistMan->FillHistClass(histNames[icut][5 + histIdxOffset + 6].Data(), VarManager::fgValues); + if constexpr (TPairType == VarManager::kDecayToMuMu) { + if (isUnambiguous) { + fHistMan->FillHistClass(histNames[icut][5 + histIdxOffset + 6].Data(), VarManager::fgValues); + } } } } @@ -1561,7 +1642,7 @@ struct AnalysisSameEventPairing { std::map> histNames = fTrackHistNames; int pairSign = 0; int ncuts = 0; - uint32_t twoTrackFilter = 0; + uint32_t twoTrackFilter = static_cast(0); for (auto& a1 : assocs1) { for (auto& a2 : assocs2) { if constexpr (TPairType == VarManager::kDecayToEE) { @@ -1596,16 +1677,16 @@ struct AnalysisSameEventPairing { pairSign = t1.sign() + t2.sign(); // store the ambiguity number of the two dilepton legs in the last 4 digits of the two-track filter if (t1.muonAmbiguityInBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 28); + twoTrackFilter |= (static_cast(1) << 28); } if (t2.muonAmbiguityInBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 29); + twoTrackFilter |= (static_cast(1) << 29); } if (t1.muonAmbiguityOutOfBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 30); + twoTrackFilter |= (static_cast(1) << 30); } if (t2.muonAmbiguityOutOfBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 31); + twoTrackFilter |= (static_cast(1) << 31); } ncuts = fNCutsMuon; histNames = fMuonHistNames; @@ -1618,12 +1699,12 @@ struct AnalysisSameEventPairing { bool isAmbiOutOfBunch = false; bool isUnambiguous = false; for (int icut = 0; icut < ncuts; icut++) { - if (!(twoTrackFilter & (uint32_t(1) << icut))) { + if (!(twoTrackFilter & (static_cast(1) << icut))) { continue; // cut not passed } - isAmbiInBunch = (twoTrackFilter & (uint32_t(1) << 28)) || (twoTrackFilter & (uint32_t(1) << 29)); - isAmbiOutOfBunch = (twoTrackFilter & (uint32_t(1) << 30)) || (twoTrackFilter & (uint32_t(1) << 31)); - isUnambiguous = !((twoTrackFilter & (uint32_t(1) << 28)) || (twoTrackFilter & (uint32_t(1) << 29)) || (twoTrackFilter & (uint32_t(1) << 30)) || (twoTrackFilter & (uint32_t(1) << 31))); + isAmbiInBunch = (twoTrackFilter & (static_cast(1) << 28)) || (twoTrackFilter & (static_cast(1) << 29)); + isAmbiOutOfBunch = (twoTrackFilter & (static_cast(1) << 30)) || (twoTrackFilter & (static_cast(1) << 31)); + isUnambiguous = !((twoTrackFilter & (static_cast(1) << 28)) || (twoTrackFilter & (static_cast(1) << 29)) || (twoTrackFilter & (static_cast(1) << 30)) || (twoTrackFilter & (static_cast(1) << 31))); if (pairSign == 0) { fHistMan->FillHistClass(histNames[icut][3].Data(), VarManager::fgValues); if (isAmbiInBunch) { @@ -1810,9 +1891,9 @@ struct AnalysisAsymmetricPairing { Preslice> trackAssocsPerCollision = aod::reducedtrack_association::reducedeventId; // Partitions for triplets and asymmetric pairs - Partition> legACandidateAssocs = (o2::aod::dqanalysisflags::isBarrelSelected & fConfigLegAFilterMask) > uint32_t(0); - Partition> legBCandidateAssocs = (o2::aod::dqanalysisflags::isBarrelSelected & fConfigLegBFilterMask) > uint32_t(0); - Partition> legCCandidateAssocs = (o2::aod::dqanalysisflags::isBarrelSelected & fConfigLegCFilterMask) > uint32_t(0); + Partition> legACandidateAssocs = (o2::aod::dqanalysisflags::isBarrelSelected & fConfigLegAFilterMask) > static_cast(0); + Partition> legBCandidateAssocs = (o2::aod::dqanalysisflags::isBarrelSelected & fConfigLegBFilterMask) > static_cast(0); + Partition> legCCandidateAssocs = (o2::aod::dqanalysisflags::isBarrelSelected & fConfigLegCFilterMask) > static_cast(0); void init(o2::framework::InitContext& context) { @@ -1849,8 +1930,8 @@ struct AnalysisAsymmetricPairing { for (int icut = 0; icut < fNCommonTrackCuts; ++icut) { commonCutIdx = objArray->IndexOf(objArrayCommon->At(icut)); if (commonCutIdx >= 0) { - fCommonTrackCutMask |= uint32_t(1) << objArray->IndexOf(objArrayCommon->At(icut)); - fCommonTrackCutFilterMasks[icut] = uint32_t(1) << objArray->IndexOf(objArrayCommon->At(icut)); + fCommonTrackCutMask |= static_cast(1) << objArray->IndexOf(objArrayCommon->At(icut)); + fCommonTrackCutFilterMasks[icut] = static_cast(1) << objArray->IndexOf(objArrayCommon->At(icut)); } else { LOGF(fatal, "Common track cut %s was not calculated upstream. Check the config!", objArrayCommon->At(icut)->GetName()); } @@ -1896,16 +1977,16 @@ struct AnalysisAsymmetricPairing { // Find leg cuts in the track selection cuts legAIdx = objArray->IndexOf(legs->At(0)); if (legAIdx >= 0) { - fConstructedLegAFilterMask |= (uint32_t(1) << legAIdx); - fTrackCutFilterMasks[icut] |= uint32_t(1) << legAIdx; + fConstructedLegAFilterMask |= (static_cast(1) << legAIdx); + fTrackCutFilterMasks[icut] |= static_cast(1) << legAIdx; } else { LOGF(fatal, "Leg A cut %s was not calculated upstream. Check the config!", legs->At(0)->GetName()); continue; } legBIdx = objArray->IndexOf(legs->At(1)); if (legBIdx >= 0) { - fConstructedLegBFilterMask |= (uint32_t(1) << legBIdx); - fTrackCutFilterMasks[icut] |= uint32_t(1) << legBIdx; + fConstructedLegBFilterMask |= (static_cast(1) << legBIdx); + fTrackCutFilterMasks[icut] |= static_cast(1) << legBIdx; } else { LOGF(fatal, "Leg B cut %s was not calculated upstream. Check the config!", legs->At(1)->GetName()); continue; @@ -1913,8 +1994,8 @@ struct AnalysisAsymmetricPairing { if (isThreeProng[icut]) { legCIdx = objArray->IndexOf(legs->At(2)); if (legCIdx >= 0) { - fConstructedLegCFilterMask |= (uint32_t(1) << legCIdx); - fTrackCutFilterMasks[icut] |= uint32_t(1) << legCIdx; + fConstructedLegCFilterMask |= (static_cast(1) << legCIdx); + fTrackCutFilterMasks[icut] |= static_cast(1) << legCIdx; } else { LOGF(fatal, "Leg C cut %s was not calculated upstream. Check the config!", legs->At(2)->GetName()); continue; @@ -2124,14 +2205,14 @@ struct AnalysisAsymmetricPairing { std::set> globIdxPairs; for (auto& [a1, a2] : combinations(soa::CombinationsFullIndexPolicy(groupedLegAAssocs, groupedLegBAssocs))) { - uint32_t twoTrackFilter = 0; - uint32_t twoTrackCommonFilter = 0; - uint32_t pairFilter = 0; + uint32_t twoTrackFilter = static_cast(0); + uint32_t twoTrackCommonFilter = static_cast(0); + uint32_t pairFilter = static_cast(0); bool isPairIdWrong = false; for (int icut = 0; icut < fNLegCuts; ++icut) { // Find leg pair definitions both candidates participate in if ((((a1.isBarrelSelected_raw() & fLegAFilterMask) | (a2.isBarrelSelected_raw() & fLegBFilterMask)) & fTrackCutFilterMasks[icut]) == fTrackCutFilterMasks[icut]) { - twoTrackFilter |= (uint32_t(1) << icut); + twoTrackFilter |= (static_cast(1) << icut); // If the supposed pion passes a kaon cut, this is a K+K-. Skip it. if (TPairType == VarManager::kDecayToKPi && fConfigSkipAmbiguousIdCombinations.value) { if (a2.isBarrelSelected_raw() & fLegAFilterMask) { @@ -2160,10 +2241,10 @@ struct AnalysisAsymmetricPairing { sign2 = t2.sign(); // store the ambiguity number of the two dilepton legs in the last 4 digits of the two-track filter if (t1.barrelAmbiguityInBunch() > 1 || t1.barrelAmbiguityOutOfBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 30); + twoTrackFilter |= (static_cast(1) << 30); } if (t2.barrelAmbiguityInBunch() > 1 || t2.barrelAmbiguityOutOfBunch() > 1) { - twoTrackFilter |= (uint32_t(1) << 31); + twoTrackFilter |= (static_cast(1) << 31); } VarManager::FillPair(t1, t2); @@ -2174,8 +2255,8 @@ struct AnalysisAsymmetricPairing { // Fill histograms bool isAmbi = false; for (int icut = 0; icut < fNLegCuts; icut++) { - if (twoTrackFilter & (uint32_t(1) << icut)) { - isAmbi = (twoTrackFilter & (uint32_t(1) << 30)) || (twoTrackFilter & (uint32_t(1) << 31)); + if (twoTrackFilter & (static_cast(1) << icut)) { + isAmbi = (twoTrackFilter & (static_cast(1) << 30)) || (twoTrackFilter & (static_cast(1) << 31)); if (sign1 * sign2 < 0) { fHistMan->FillHistClass(histNames[icut][0].Data(), VarManager::fgValues); if (isAmbi && fConfigAmbiguousHistograms.value) { @@ -2211,7 +2292,7 @@ struct AnalysisAsymmetricPairing { AnalysisCompositeCut cut = fPairCuts.at(iPairCut); if (!(cut.IsSelected(VarManager::fgValues))) // apply pair cuts continue; - pairFilter |= (uint32_t(1) << iPairCut); + pairFilter |= (static_cast(1) << iPairCut); // Histograms with pair cuts if (sign1 * sign2 < 0) { fHistMan->FillHistClass(histNames[fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut][0].Data(), VarManager::fgValues); @@ -2305,12 +2386,12 @@ struct AnalysisAsymmetricPairing { template void readTriplet(TTrackAssoc const& a1, TTrackAssoc const& a2, TTrackAssoc const& a3, TTracks const& /*tracks*/, TEvent const& event, VarManager::PairCandidateType tripletType, std::map> histNames) { - uint32_t threeTrackFilter = 0; - uint32_t threeTrackCommonFilter = 0; + uint32_t threeTrackFilter = static_cast(0); + uint32_t threeTrackCommonFilter = static_cast(0); for (int icut = 0; icut < fNLegCuts; ++icut) { // Find out which leg cut combination the triplet passes if ((((a1.isBarrelSelected_raw() & fLegAFilterMask) | (a2.isBarrelSelected_raw() & fLegBFilterMask) | (a3.isBarrelSelected_raw() & fLegCFilterMask)) & fTrackCutFilterMasks[icut]) == fTrackCutFilterMasks[icut]) { - threeTrackFilter |= (uint32_t(1) << icut); + threeTrackFilter |= (static_cast(1) << icut); if (tripletType == VarManager::kTripleCandidateToPKPi && fConfigSkipAmbiguousIdCombinations.value) { // Check if the supposed pion passes as a proton or kaon, if so, skip this triplet. It is pKp or pKK. if ((a3.isBarrelSelected_raw() & fLegAFilterMask) || (a3.isBarrelSelected_raw() & fLegBFilterMask)) { @@ -2347,13 +2428,13 @@ struct AnalysisAsymmetricPairing { // store the ambiguity of the three legs in the last 3 digits of the two-track filter if (t1.barrelAmbiguityInBunch() > 1 || t1.barrelAmbiguityOutOfBunch() > 1) { - threeTrackFilter |= (uint32_t(1) << 29); + threeTrackFilter |= (static_cast(1) << 29); } if (t2.barrelAmbiguityInBunch() > 1 || t2.barrelAmbiguityOutOfBunch() > 1) { - threeTrackFilter |= (uint32_t(1) << 30); + threeTrackFilter |= (static_cast(1) << 30); } if (t3.barrelAmbiguityInBunch() > 1 || t3.barrelAmbiguityOutOfBunch() > 1) { - threeTrackFilter |= (uint32_t(1) << 31); + threeTrackFilter |= (static_cast(1) << 31); } VarManager::FillTriple(t1, t2, t3, VarManager::fgValues, tripletType); @@ -2363,9 +2444,9 @@ struct AnalysisAsymmetricPairing { // Fill histograms for (int icut = 0; icut < fNLegCuts; icut++) { - if (threeTrackFilter & (uint32_t(1) << icut)) { + if (threeTrackFilter & (static_cast(1) << icut)) { fHistMan->FillHistClass(histNames[icut][0].Data(), VarManager::fgValues); - if (fConfigAmbiguousHistograms.value && ((threeTrackFilter & (uint32_t(1) << 29)) || (threeTrackFilter & (uint32_t(1) << 30)) || (threeTrackFilter & (uint32_t(1) << 31)))) { + if (fConfigAmbiguousHistograms.value && ((threeTrackFilter & (static_cast(1) << 29)) || (threeTrackFilter & (static_cast(1) << 30)) || (threeTrackFilter & (static_cast(1) << 31)))) { fHistMan->FillHistClass(histNames[icut][1].Data(), VarManager::fgValues); } for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; iCommonCut++) { @@ -2465,10 +2546,10 @@ struct AnalysisDileptonTrack { Service fCCDB; // TODO: The filter expressions seem to always use the default value of configurables, not the values from the actual configuration file - Filter eventFilter = aod::dqanalysisflags::isEventSelected == uint32_t(1); + Filter eventFilter = aod::dqanalysisflags::isEventSelected > static_cast(1); Filter dileptonFilter = aod::reducedpair::pt > fConfigDileptonpTCut&& aod::reducedpair::mass > fConfigDileptonLowMass&& aod::reducedpair::mass fConfigDileptonLxyCut; - Filter filterBarrel = aod::dqanalysisflags::isBarrelSelected > uint32_t(0); - Filter filterMuon = aod::dqanalysisflags::isMuonSelected > uint32_t(0); + Filter filterBarrel = aod::dqanalysisflags::isBarrelSelected > static_cast(0); + Filter filterMuon = aod::dqanalysisflags::isMuonSelected > static_cast(0); constexpr static uint32_t fgDileptonFillMap = VarManager::ObjTypes::ReducedTrack | VarManager::ObjTypes::Pair; // fill map @@ -2940,7 +3021,7 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "event", histName); } - if (classStr.Contains("SameBunchCorrelations")) { + if (classStr.Contains("SameBunchCorrelations") || classStr.Contains("OutOfBunchCorrelations")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "two-collisions", histName); } @@ -2957,7 +3038,7 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", "postcalib_proton"); } if (classStr.Contains("Ambiguity")) { - dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", Form("%s,ambiguity", histName.Data())); + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", "ambiguity"); } } if (classStr.Contains("Muon")) { From 45bca6ca808bf53eda643424551e7605d0ee125d Mon Sep 17 00:00:00 2001 From: zhengqi-w Date: Mon, 25 Nov 2024 23:11:52 +0800 Subject: [PATCH 091/459] [PWGCF] second pull request for pidcme macro (#8632) Co-authored-by: ALICE Action Bot --- PWGCF/Flow/Tasks/CMakeLists.txt | 5 + PWGCF/{ => Flow}/Tasks/pidcme.cxx | 595 ++++++++++++++++++------------ PWGCF/Tasks/CMakeLists.txt | 5 - 3 files changed, 367 insertions(+), 238 deletions(-) rename PWGCF/{ => Flow}/Tasks/pidcme.cxx (50%) diff --git a/PWGCF/Flow/Tasks/CMakeLists.txt b/PWGCF/Flow/Tasks/CMakeLists.txt index bb7fd7d4ac4..f3c0c3f120b 100644 --- a/PWGCF/Flow/Tasks/CMakeLists.txt +++ b/PWGCF/Flow/Tasks/CMakeLists.txt @@ -48,3 +48,8 @@ o2physics_add_dpl_workflow(flow-gfw-omegaxi SOURCES flowGFWOmegaXi.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(flow-pid-cme + SOURCES pidcme.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore + COMPONENT_NAME Analysis) diff --git a/PWGCF/Tasks/pidcme.cxx b/PWGCF/Flow/Tasks/pidcme.cxx similarity index 50% rename from PWGCF/Tasks/pidcme.cxx rename to PWGCF/Flow/Tasks/pidcme.cxx index a776e584f7d..882e97aabec 100644 --- a/PWGCF/Tasks/pidcme.cxx +++ b/PWGCF/Flow/Tasks/pidcme.cxx @@ -20,6 +20,7 @@ #include // o2Physics includes. +#include "Framework/ASoA.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" #include "Framework/ASoAHelpers.h" @@ -42,12 +43,214 @@ using namespace o2; using namespace o2::framework; +using namespace o2::framework::expressions; -using MyCollisions = soa::Join; -using MyTracks = soa::Join; +namespace o2::aod +{ +namespace CMETrackPIDcolums +{ +DECLARE_SOA_COLUMN(NPIDFlag, Npid, int8_t); // Flag tracks without proper binning as -1, and indicate type of particle 0->un-Id, 1->pion, 2->kaon, 3->proton +} // namespace CMETrackPIDcolums +DECLARE_SOA_TABLE(Flags, "AOD", "Flags", CMETrackPIDcolums::NPIDFlag); +} // namespace o2::aod + +using TracksPID = soa::Join; +struct FillPIDcolums { + Configurable cfgnSigmaCutTPCPi{"cfgnSigmaCutTPCPi", 3.0, "Value of the TPC Nsigma cut for pions"}; + Configurable cfgnSigmaCutTPCKa{"cfgnSigmaCutTPCKa", 3.0, "Value of the TPC Nsigma cut for kaons"}; + Configurable cfgnSigmaCutTPCPr{"cfgnSigmaCutTPCPr", 3.0, "Value of the TPC Nsigma cut for protons"}; + Configurable cfgnSigmaCutTOFPi{"cfgnSigmaCutTOFPi", 3.0, "Value of the TOF Nsigma cut for pions"}; + Configurable cfgnSigmaCutTOFKa{"cfgnSigmaCutTOFKa", 3.0, "Value of the TOF Nsigma cut for kaons"}; + Configurable cfgnSigmaCutTOFPr{"cfgnSigmaCutTOFPr", 3.0, "Value of the TOF Nsigma cut for protons"}; + Configurable cfgnSigmaCutCombine{"cfgnSigmaCutCombine", 3.0, "Value of the Combined Nsigma cut"}; + Configurable cfgPtMaxforTPCOnlyPID{"cfgPtMaxforTPCOnlyPID", 0.4, "Maxmium track pt for TPC only PID,only when onlyTOF and onlyTOFHIT closed"}; + Configurable cfgMinPtPID{"cfgMinPtPID", 0.15, "Minimum track #P_{t} for PID"}; + Configurable cfgMaxEtaPID{"cfgMaxEtaPID", 0.8, "Maximum track #eta for PID"}; + + ConfigurableAxis cfgrigidityBins{"cfgrigidityBins", {200, -10.f, 10.f}, "Binning for rigidity #it{p}^{TPC}/#it{z}"}; + ConfigurableAxis cfgdedxBins{"cfgdedxBins", {1000, 0.f, 1000.f}, "Binning for dE/dx"}; + ConfigurableAxis cfgnSigmaBins{"cfgnSigmaBins", {200, -5.f, 5.f}, "Binning for n sigma"}; + ConfigurableAxis cfgaxisptPID{"cfgaxisptPID", {24, 0, 12}, ""}; + + Configurable onlyTOF{"onlyTOF", false, "only TOF tracks"}; + Configurable onlyTOFHIT{"onlyTOFHIT", false, "accept only TOF hit tracks at high pt"}; + bool onlyTPC = true; + + template + bool SelTrack_PID(const TrackType track) + { + if (!(track.pt() > cfgMinPtPID)) + return false; + if (!(std::abs(track.eta()) < cfgMaxEtaPID)) + return false; + if (!track.passedITSNCls()) + return false; + if (!track.passedITSChi2NDF()) + return false; + if (!track.passedITSHits()) + return false; + if (!track.passedTPCCrossedRowsOverNCls()) + return false; + if (!track.passedTPCChi2NDF()) + return false; + if (!track.passedDCAxy()) + return false; + if (!track.passedDCAz()) + return false; + return true; + } + + template + bool selectionPID(const T& candidate, int8_t PID) + { + if (candidate.pt() > cfgPtMaxforTPCOnlyPID) { + onlyTPC = false; + } + + if (PID == 0) { + if (onlyTOF) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < cfgnSigmaCutTOFPi) { + return true; + } + } else if (onlyTOFHIT) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < cfgnSigmaCutTOFPi) { + return true; + } + if (!candidate.hasTOF() && + std::abs(candidate.tpcNSigmaPi()) < cfgnSigmaCutTPCPi) { + return true; + } + } else if (onlyTPC) { + if (std::abs(candidate.tpcNSigmaPi()) < cfgnSigmaCutTPCPi) { + return true; + } + } else { + if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (cfgnSigmaCutCombine * cfgnSigmaCutCombine)) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < cfgnSigmaCutTPCPi) { + return true; + } + } + } else if (PID == 1) { + if (onlyTOF) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < cfgnSigmaCutTOFKa) { + return true; + } + } else if (onlyTOFHIT) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < cfgnSigmaCutTOFKa) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < cfgnSigmaCutTPCPi) { + return true; + } + } else if (onlyTPC) { + if (std::abs(candidate.tpcNSigmaKa()) < cfgnSigmaCutTPCPi) { + return true; + } + } else { + if (candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (cfgnSigmaCutCombine * cfgnSigmaCutCombine)) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < cfgnSigmaCutTPCPi) { + return true; + } + } + } else if (PID == 2) { + if (onlyTOF) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOFPr) { + return true; + } + } else if (onlyTOFHIT) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOFPr) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPCPr) { + return true; + } + } else if (onlyTPC) { + if (std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPCPr) { + return true; + } + } else { + if (candidate.hasTOF() && (candidate.tofNSigmaPr() * candidate.tofNSigmaPr() + candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr()) < (cfgnSigmaCutCombine * cfgnSigmaCutCombine)) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPCPr) { + return true; + } + } + } + return false; + } + + HistogramRegistry histosQA{"histosQAPID", {}, OutputObjHandlingPolicy::AnalysisObject}; + + void init(InitContext const&) + { + AxisSpec axisRigidity{cfgrigidityBins, "#it{p}^{TPC}/#it{z}"}; + AxisSpec axisdEdx{cfgdedxBins, "d#it{E}/d#it{x}"}; + AxisSpec axisnSigma{cfgnSigmaBins, "n_{#sigma}TPC"}; + AxisSpec axisPtPID{cfgaxisptPID, "#it{p}_{T}"}; + + histosQA.add(Form("QA/PID/histdEdxTPC_All"), "", {HistType::kTH2F, {axisRigidity, axisdEdx}}); + histosQA.add(Form("QA/PID/histdEdxTPC_Pi"), "", {HistType::kTH2F, {axisRigidity, axisdEdx}}); + histosQA.add(Form("QA/PID/histnSigma_Pi"), "", {HistType::kTH1F, {axisnSigma}}); + histosQA.add(Form("QA/PID/histnSigma_Pt_Pi"), "", {HistType::kTH2F, {axisPtPID, axisnSigma}}); + histosQA.add(Form("QA/PID/histdEdxTPC_Ka"), "", {HistType::kTH2F, {axisRigidity, axisdEdx}}); + histosQA.add(Form("QA/PID/histnSigma_Ka"), "", {HistType::kTH1F, {axisnSigma}}); + histosQA.add(Form("QA/PID/histnSigma_Pt_Ka"), "", {HistType::kTH2F, {axisPtPID, axisnSigma}}); + histosQA.add(Form("QA/PID/histdEdxTPC_Pr"), "", {HistType::kTH2F, {axisRigidity, axisdEdx}}); + histosQA.add(Form("QA/PID/histnSigma_Pr"), "", {HistType::kTH1F, {axisnSigma}}); + histosQA.add(Form("QA/PID/histnSigma_Pt_Pr"), "", {HistType::kTH2F, {axisPtPID, axisnSigma}}); + } + Produces PIDCMEtable; + void process(TracksPID const& tracks) + { + int8_t PID_flag; + for (auto& track : tracks) { + if (!SelTrack_PID(track)) { + PID_flag = -1; + } else { + histosQA.fill(HIST("QA/PID/histdEdxTPC_All"), track.sign() * track.tpcInnerParam(), track.tpcSignal()); + float nsigma_array[3] = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; + PID_flag = 0; + for (int8_t i = 0; i < 3; i++) { + if (selectionPID(track, i)) + PID_flag = PID_flag * 10 + i + 1; + if (PID_flag > 10) { // If a track is identified as two different tracks. + if (fabs(nsigma_array[(PID_flag / 10) - 1]) < fabs(nsigma_array[(PID_flag % 10) - 1])) // The track is identified as the particle whose |nsigma| is the least. + PID_flag /= 10; + else + PID_flag %= 10; + } + } + + switch (PID_flag) { + case 1: + histosQA.fill(HIST("QA/PID/histdEdxTPC_Pi"), track.sign() * track.tpcInnerParam(), track.tpcSignal()); + histosQA.fill(HIST("QA/PID/histnSigma_Pi"), track.tpcNSigmaPi()); + histosQA.fill(HIST("QA/PID/histnSigma_Pt_Pi"), track.pt(), track.tpcNSigmaPi()); + break; + case 2: + histosQA.fill(HIST("QA/PID/histdEdxTPC_Ka"), track.sign() * track.tpcInnerParam(), track.tpcSignal()); + histosQA.fill(HIST("QA/PID/histnSigma_Ka"), track.tpcNSigmaKa()); + histosQA.fill(HIST("QA/PID/histnSigma_Pt_Ka"), track.pt(), track.tpcNSigmaKa()); + break; + case 3: + histosQA.fill(HIST("QA/PID/histdEdxTPC_Pr"), track.sign() * track.tpcInnerParam(), track.tpcSignal()); + histosQA.fill(HIST("QA/PID/histnSigma_Pr"), track.tpcNSigmaPr()); + histosQA.fill(HIST("QA/PID/histnSigma_Pt_Pr"), track.pt(), track.tpcNSigmaPr()); + break; + } + } + PIDCMEtable(PID_flag); + } + } +}; struct pidcme { - HistogramRegistry histosQA{"histosQA", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry histosQA{"histosmain", {}, OutputObjHandlingPolicy::AnalysisObject}; Configurable> cfgnMods{"cfgnMods", {2}, "Modulation of interest"}; Configurable cfgDetName{"cfgDetName", "FT0C", "The name of detector to be analyzed"}; @@ -61,14 +264,6 @@ struct pidcme { Configurable cfgMaxDCArToPVcut{"cfgMaxDCArToPVcut", 0.1, "Maximum transverse DCA"}; Configurable cfgMaxDCAzToPVcut{"cfgMaxDCAzToPVcut", 1.0, "Maximum longitudinal DCA"}; - Configurable cfgnSigmaCutTPCPi{"cfgnSigmaCutTPCPi", 3.0, "Value of the TPC Nsigma cut for pions"}; - Configurable cfgnSigmaCutTPCKa{"cfgnSigmaCutTPCKa", 3.0, "Value of the TPC Nsigma cut for kaons"}; - Configurable cfgnSigmaCutTPCPr{"cfgnSigmaCutTPCPr", 3.0, "Value of the TPC Nsigma cut for protons"}; - Configurable cfgnSigmaCutTOFPi{"cfgnSigmaCutTOFPi", 3.0, "Value of the TOF Nsigma cut for pions"}; - Configurable cfgnSigmaCutTOFKa{"cfgnSigmaCutTOFKa", 3.0, "Value of the TOF Nsigma cut for kaons"}; - Configurable cfgnSigmaCutTOFPr{"cfgnSigmaCutTOFPr", 3.0, "Value of the TOF Nsigma cut for protons"}; - Configurable cfgnSigmaCutCombine{"cfgnSigmaCutCombine", 3.0, "Value of the Combined Nsigma cut"}; - ConfigurableAxis cfgaxisQvecF{"cfgaxisQvecF", {300, -1, 1}, ""}; ConfigurableAxis cfgaxisQvec{"cfgaxisQvec", {100, -3, 3}, ""}; ConfigurableAxis cfgaxisCent{"cfgaxisCent", {100, 0, 100}, ""}; @@ -77,20 +272,15 @@ struct pidcme { ConfigurableAxis cfgaxispt{"cfgaxispt", {100, 0, 10}, ""}; ConfigurableAxis cfgaxisCentMerged{"cfgaxisCentMerged", {20, 0, 100}, ""}; - ConfigurableAxis cfgrigidityBins{"cfgrigidityBins", {200, -10.f, 10.f}, "Binning for rigidity #it{p}^{TPC}/#it{z}"}; - ConfigurableAxis cfgdedxBins{"cfgdedxBins", {1000, 0.f, 1000.f}, "Binning for dE/dx"}; - ConfigurableAxis cfgnSigmaBins{"cfgnSigmaBins", {200, -5.f, 5.f}, "Binning for n sigma"}; - ConfigurableAxis cfgaxissumpt{"cfgaxissumpt", {7, 1, 8}, "Binning for #gamma and #delta pt(particle1 + particle2)"}; ConfigurableAxis cfgaxisdeltaeta{"cfgaxisdeltaeta", {5, 0, 1}, "Binning for #gamma and #delta |#eta(particle1 - particle2)|"}; - Configurable onlyTOF{"onlyTOF", false, "only TOF tracks"}; - Configurable onlyTOFHIT{"onlyTOFHIT", false, "accept only TOF hit tracks at high pt"}; - Configurable OpenCME = {"cfgkOpeanCME", false, "open PID CME"}; - bool onlyTPC = true; + Configurable OpenCME = {"cfgkOpeanCME", true, "open PID CME"}; EventPlaneHelper helperEP; + SliceCache cache; + unsigned int mult1, mult2, mult3; int DetId; int RefAId; int RefBId; @@ -120,6 +310,15 @@ struct pidcme { } } + Filter col = aod::evsel::sel8 == true; + Filter collisionFilter = (nabs(aod::collision::posZ) < 10.f); + Filter ptfilter = aod::track::pt > cfgMinPt; + Filter etafilter = aod::track::eta < cfgMaxEta; + Filter properPIDfilter = aod::CMETrackPIDcolums::Npid != -1; + + Partition>> Tracks_set1 = aod::CMETrackPIDcolums::Npid == 1; + Partition>> Tracks_set2 = aod::CMETrackPIDcolums::Npid == 2; + Partition>> Tracks_set3 = aod::CMETrackPIDcolums::Npid == 3; void init(InitContext const&) { @@ -143,10 +342,6 @@ struct pidcme { AxisSpec axisPt{cfgaxispt, "trasverse momentum"}; AxisSpec axisCentMerged{cfgaxisCentMerged, "merged centrality"}; - AxisSpec axisRigidity{cfgrigidityBins, "#it{p}^{TPC}/#it{z}"}; - AxisSpec axisdEdx{cfgdedxBins, "d#it{E}/d#it{x}"}; - AxisSpec axisnSigma{cfgnSigmaBins, "n_{#sigma}({}^{3}He)"}; - AxisSpec axissumpt{cfgaxissumpt, "#it{p}_{T}^{sum}}"}; AxisSpec axisdeltaeta{cfgaxisdeltaeta, "#Delta#eta"}; AxisSpec axisvertexz = {100, -15., 15., "vrtx_{Z} [cm]"}; @@ -168,14 +363,6 @@ struct pidcme { histosQA.add(Form("QA/histQvecRes_SigRefBV2"), "", {HistType::kTH2F, {axisQvecF, axisCent}}); histosQA.add(Form("QA/histQvecRes_RefARefBV2"), "", {HistType::kTH2F, {axisQvecF, axisCent}}); - histosQA.add(Form("QA/PID/histdEdxTPC_All"), "", {HistType::kTH2F, {axisRigidity, axisdEdx}}); - histosQA.add(Form("QA/PID/histdEdxTPC_Pi"), "", {HistType::kTH2F, {axisRigidity, axisdEdx}}); - histosQA.add(Form("QA/PID/histnSigma_Pi"), "", {HistType::kTH1F, {axisnSigma}}); - histosQA.add(Form("QA/PID/histdEdxTPC_Ka"), "", {HistType::kTH2F, {axisRigidity, axisdEdx}}); - histosQA.add(Form("QA/PID/histnSigma_Ka"), "", {HistType::kTH1F, {axisnSigma}}); - histosQA.add(Form("QA/PID/histdEdxTPC_Pr"), "", {HistType::kTH2F, {axisRigidity, axisdEdx}}); - histosQA.add(Form("QA/PID/histnSigma_Pr"), "", {HistType::kTH1F, {axisnSigma}}); - histosQA.add(Form("V2/histCosDetV2"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); histosQA.add(Form("V2/histSinDetV2"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); @@ -187,28 +374,39 @@ struct pidcme { histosQA.add(Form("V2/PID/histCosDetV2_Pr_Neg"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); if (OpenCME) { - histosQA.add(Form("PIDCME/histgamama_PiKa_ss"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); - histosQA.add(Form("PIDCME/histgamama_PiKa_os"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); - histosQA.add(Form("PIDCME/histgamama_PiPr_ss"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); - histosQA.add(Form("PIDCME/histgamama_PiPr_os"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); - histosQA.add(Form("PIDCME/histgamama_KaPr_ss"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); - histosQA.add(Form("PIDCME/histgamama_KaPr_os"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); - - histosQA.add(Form("PIDCME/histdelta_PiKa_ss"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); - histosQA.add(Form("PIDCME/histdelta_PiKa_os"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); - histosQA.add(Form("PIDCME/histdelta_PiPr_ss"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); - histosQA.add(Form("PIDCME/histdelta_PiPr_os"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); - histosQA.add(Form("PIDCME/histdelta_KaPr_ss"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); - histosQA.add(Form("PIDCME/histdelta_KaPr_os"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/histgamama_PiKa_ss"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histgamama_PiKa_os"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histgamama_PiPr_ss"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histgamama_PiPr_os"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histgamama_KaPr_ss"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histgamama_KaPr_os"), "", {HistType::kTProfile, {axisCentMerged}}); + + histosQA.add(Form("PIDCME/histdelta_PiKa_ss"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histdelta_PiKa_os"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histdelta_PiPr_ss"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histdelta_PiPr_os"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histdelta_KaPr_ss"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histdelta_KaPr_os"), "", {HistType::kTProfile, {axisCentMerged}}); + + histosQA.add(Form("PIDCME/Differential/histgamama_PiKa_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histgamama_PiKa_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histgamama_PiPr_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histgamama_PiPr_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histgamama_KaPr_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histgamama_KaPr_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + + histosQA.add(Form("PIDCME/Differential/histdelta_PiKa_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histdelta_PiKa_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histdelta_PiPr_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histdelta_PiPr_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histdelta_KaPr_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histdelta_KaPr_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); } } template bool SelEvent(const CollType& collision) { - if (!collision.sel8()) { - return 0; - } if (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { return 0; } @@ -218,20 +416,12 @@ struct pidcme { if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { return 0; } - if (std::abs(collision.posZ()) > 10.) { - return 0; - } - return 1; } template bool SelTrack(const TrackType track) { - if (track.pt() < cfgMinPt) - return false; - if (std::abs(track.eta()) > cfgMaxEta) - return false; if (!track.passedITSNCls()) return false; if (!track.passedITSChi2NDF()) @@ -246,94 +436,9 @@ struct pidcme { return false; if (!track.passedDCAz()) return false; - return true; } - template - bool selectionPID(const T& candidate, int PID) - { - if (candidate.pt() > 0.4) { - onlyTPC = false; - } - - if (PID == 0) { - if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < cfgnSigmaCutTOFPi) { - return true; - } - } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < cfgnSigmaCutTOFPi) { - return true; - } - if (!candidate.hasTOF() && - std::abs(candidate.tpcNSigmaPi()) < cfgnSigmaCutTPCPi) { - return true; - } - } else if (onlyTPC) { - if (std::abs(candidate.tpcNSigmaPi()) < cfgnSigmaCutTPCPi) { - return true; - } - } else { - if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (cfgnSigmaCutCombine * cfgnSigmaCutCombine)) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < cfgnSigmaCutTPCPi) { - return true; - } - } - } else if (PID == 1) { - if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < cfgnSigmaCutTOFKa) { - return true; - } - } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < cfgnSigmaCutTOFKa) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < cfgnSigmaCutTPCPi) { - return true; - } - } else if (onlyTPC) { - if (std::abs(candidate.tpcNSigmaKa()) < cfgnSigmaCutTPCPi) { - return true; - } - } else { - if (candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (cfgnSigmaCutCombine * cfgnSigmaCutCombine)) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < cfgnSigmaCutTPCPi) { - return true; - } - } - } else if (PID == 2) { - if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOFPr) { - return true; - } - } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOFPr) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPCPr) { - return true; - } - } else if (onlyTPC) { - if (std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPCPr) { - return true; - } - } else { - if (candidate.hasTOF() && (candidate.tofNSigmaPr() * candidate.tofNSigmaPr() + candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr()) < (cfgnSigmaCutCombine * cfgnSigmaCutCombine)) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPCPr) { - return true; - } - } - } - return false; - } - template void fillHistosQvec(const CollType& collision, int nmode) { @@ -360,114 +465,118 @@ struct pidcme { } template - void fillHistosFlow_gamma_delta(const CollType& collision, const TrackType& track, int nmode) + void fillHistosFlow_gamma_delta(const CollType& collision, const TrackType& track1, const TrackType& track2, const TrackType& track3, int nmode) { if (collision.qvecAmp()[DetId] < 1e-8) { return; } int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - bool kisPi = false, kisKa = false, kisPr = false; - bool kisPi_2 = false, kisKa_2 = false, kisPr_2 = false; float Psi_n = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); - for (auto& trk : track) { - histosQA.fill(HIST("QA/PID/histdEdxTPC_All"), trk.sign() * trk.tpcInnerParam(), trk.tpcSignal()); - if (!SelTrack(trk)) { + for (auto& trk : track1) { + if (!SelTrack(trk)) continue; + if (nmode == 2) { + if (trk.sign() > 0) { + histosQA.fill(HIST("V2/PID/histCosDetV2_Pi"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } else if (trk.sign() < 0) { + histosQA.fill(HIST("V2/PID/histCosDetV2_Pi_Neg"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } } - kisPi = selectionPID(trk, 0); - kisKa = selectionPID(trk, 1); - kisPr = selectionPID(trk, 2); - if (kisPi) { - histosQA.fill(HIST("QA/PID/histdEdxTPC_Pi"), trk.sign() * trk.tpcInnerParam(), trk.tpcSignal()); - histosQA.fill(HIST("QA/PID/histnSigma_Pi"), trk.tpcNSigmaPi()); - } - if (kisKa) { - histosQA.fill(HIST("QA/PID/histdEdxTPC_Ka"), trk.sign() * trk.tpcInnerParam(), trk.tpcSignal()); - histosQA.fill(HIST("QA/PID/histnSigma_Ka"), trk.tpcNSigmaKa()); - } - if (kisPr) { - histosQA.fill(HIST("QA/PID/histdEdxTPC_Pr"), trk.sign() * trk.tpcInnerParam(), trk.tpcSignal()); - histosQA.fill(HIST("QA/PID/histnSigma_Pr"), trk.tpcNSigmaPr()); + } + for (auto& trk : track2) { + if (!SelTrack(trk)) + continue; + if (nmode == 2) { + if (trk.sign() > 0) { + histosQA.fill(HIST("V2/PID/histCosDetV2_Ka"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } else if (trk.sign() < 0) { + histosQA.fill(HIST("V2/PID/histCosDetV2_Ka_Neg"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } } + } + for (auto& trk : track3) { + if (!SelTrack(trk)) + continue; if (nmode == 2) { - histosQA.fill(HIST("V2/histSinDetV2"), collision.centFT0C(), trk.pt(), - std::sin(static_cast(nmode) * (trk.phi() - Psi_n))); - histosQA.fill(HIST("V2/histCosDetV2"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); - if (kisPi) { - if (trk.sign() > 0) { - histosQA.fill(HIST("V2/PID/histCosDetV2_Pi"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); - } else if (trk.sign() < 0) { - histosQA.fill(HIST("V2/PID/histCosDetV2_Pi_Neg"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); - } + if (trk.sign() > 0) { + histosQA.fill(HIST("V2/PID/histCosDetV2_Pr"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } else if (trk.sign() < 0) { + histosQA.fill(HIST("V2/PID/histCosDetV2_Pr_Neg"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); } - if (kisKa) { - if (trk.sign() > 0) { - histosQA.fill(HIST("V2/PID/histCosDetV2_Ka"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); - } else if (trk.sign() < 0) { - histosQA.fill(HIST("V2/PID/histCosDetV2_Ka_Neg"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } + } + if (OpenCME) { + for (auto& trk1 : track1) { + for (auto& trk2 : track2) { + if (trk1.globalIndex() == trk2.globalIndex()) + continue; + if (nmode == 2) { + if (trk1.sign() == trk2.sign()) { + histosQA.fill(HIST("PIDCME/histgamama_PiKa_ss"), collision.centFT0C(), std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histdelta_PiKa_ss"), collision.centFT0C(), std::cos((trk1.phi() - trk2.phi()))); + histosQA.fill(HIST("PIDCME/Differential/histgamama_PiKa_ss_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/Differential/histdelta_PiKa_ss_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() - trk2.phi()))); + } else { + histosQA.fill(HIST("PIDCME/histgamama_PiKa_os"), collision.centFT0C(), std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histdelta_PiKa_os"), collision.centFT0C(), std::cos((trk1.phi() - trk2.phi()))); + histosQA.fill(HIST("PIDCME/Differential/histgamama_PiKa_os_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/Differential/histdelta_PiKa_os_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() - trk2.phi()))); + } } } - if (kisPr) { - if (trk.sign() > 0) { - histosQA.fill(HIST("V2/PID/histCosDetV2_Pr"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); - } else if (trk.sign() < 0) { - histosQA.fill(HIST("V2/PID/histCosDetV2_Pr_Neg"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + } + for (auto& trk1 : track1) { + for (auto& trk3 : track3) { + if (trk1.globalIndex() == trk3.globalIndex()) + continue; + if (nmode == 2) { + if (trk1.sign() == trk3.sign()) { + histosQA.fill(HIST("PIDCME/histgamama_PiPr_ss"), collision.centFT0C(), std::cos((trk1.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histdelta_PiPr_ss"), collision.centFT0C(), std::cos((trk1.phi() - trk3.phi()))); + histosQA.fill(HIST("PIDCME/Differential/histgamama_PiPr_ss_Dif"), collision.centFT0C(), trk1.pt() + trk3.pt(), std::abs(trk1.eta() - trk3.eta()), + std::cos((trk1.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/Differential/histdelta_PiPr_ss_Dif"), collision.centFT0C(), trk1.pt() + trk3.pt(), std::abs(trk1.eta() - trk3.eta()), + std::cos((trk1.phi() - trk3.phi()))); + } else { + histosQA.fill(HIST("PIDCME/histgamama_PiPr_os"), collision.centFT0C(), std::cos((trk1.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histdelta_PiPr_os"), collision.centFT0C(), std::cos((trk1.phi() - trk3.phi()))); + histosQA.fill(HIST("PIDCME/Differential/histgamama_PiPr_os_Dif"), collision.centFT0C(), trk1.pt() + trk3.pt(), std::abs(trk1.eta() - trk3.eta()), + std::cos((trk1.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/Differential/histdelta_PiPr_os_Dif"), collision.centFT0C(), trk1.pt() + trk3.pt(), std::abs(trk1.eta() - trk3.eta()), + std::cos((trk1.phi() - trk3.phi()))); + } } } } - if (OpenCME) { - for (auto& trk_2 : track) { - if (trk_2.globalIndex() == trk.globalIndex()) + for (auto& trk2 : track2) { + for (auto& trk3 : track3) { + if (trk2.globalIndex() == trk3.globalIndex()) continue; if (nmode == 2) { - kisPi_2 = selectionPID(trk_2, 0); - kisKa_2 = selectionPID(trk_2, 1); - kisPr_2 = selectionPID(trk_2, 2); - if (kisPi && kisKa_2) { - if (trk.sign() == trk_2.sign()) { - histosQA.fill(HIST("PIDCME/histgamama_PiKa_ss"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), - std::cos((trk.phi() + trk_2.phi() - static_cast(nmode) * Psi_n))); - histosQA.fill(HIST("PIDCME/histdelta_PiKa_ss"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), - std::cos((trk.phi() - trk_2.phi()))); - } else { - histosQA.fill(HIST("PIDCME/histgamama_PiKa_os"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), - std::cos((trk.phi() + trk_2.phi() - static_cast(nmode) * Psi_n))); - histosQA.fill(HIST("PIDCME/histdelta_PiKa_os"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), - std::cos((trk.phi() - trk_2.phi()))); - } - } - if (kisPi && kisPr_2) { - if (trk.sign() == trk_2.sign()) { - histosQA.fill(HIST("PIDCME/histgamama_PiPr_ss"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), - std::cos((trk.phi() + trk_2.phi() - static_cast(nmode) * Psi_n))); - histosQA.fill(HIST("PIDCME/histdelta_PiPr_ss"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), - std::cos((trk.phi() - trk_2.phi()))); - } else { - histosQA.fill(HIST("PIDCME/histgamama_PiPr_os"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), - std::cos((trk.phi() + trk_2.phi() - static_cast(nmode) * Psi_n))); - histosQA.fill(HIST("PIDCME/histdelta_PiPr_os"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), - std::cos((trk.phi() - trk_2.phi()))); - } - } - if (kisKa && kisPr_2) { - if (trk.sign() == trk_2.sign()) { - histosQA.fill(HIST("PIDCME/histgamama_KaPr_ss"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), - std::cos((trk.phi() + trk_2.phi() - static_cast(nmode) * Psi_n))); - histosQA.fill(HIST("PIDCME/histdelta_KaPr_ss"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), - std::cos((trk.phi() - trk_2.phi()))); - } else { - histosQA.fill(HIST("PIDCME/histgamama_KaPr_os"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), - std::cos((trk.phi() + trk_2.phi() - static_cast(nmode) * Psi_n))); - histosQA.fill(HIST("PIDCME/histdelta_KaPr_os"), collision.centFT0C(), trk.pt() + trk_2.pt(), std::abs(trk.eta() - trk_2.eta()), - std::cos((trk.phi() - trk_2.phi()))); - } + if (trk2.sign() == trk3.sign()) { + histosQA.fill(HIST("PIDCME/histgamama_KaPr_ss"), collision.centFT0C(), std::cos((trk2.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histdelta_KaPr_ss"), collision.centFT0C(), std::cos((trk2.phi() - trk3.phi()))); + histosQA.fill(HIST("PIDCME/Differential/histgamama_KaPr_ss_Dif"), collision.centFT0C(), trk2.pt() + trk3.pt(), std::abs(trk2.eta() - trk3.eta()), + std::cos((trk2.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/Differential/histdelta_KaPr_ss_Dif"), collision.centFT0C(), trk2.pt() + trk3.pt(), std::abs(trk2.eta() - trk3.eta()), + std::cos((trk2.phi() - trk3.phi()))); + } else { + histosQA.fill(HIST("PIDCME/histgamama_KaPr_os"), collision.centFT0C(), std::cos((trk2.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histdelta_KaPr_os"), collision.centFT0C(), std::cos((trk2.phi() - trk3.phi()))); + histosQA.fill(HIST("PIDCME/Differential/histgamama_KaPr_os_Dif"), collision.centFT0C(), trk2.pt() + trk3.pt(), std::abs(trk2.eta() - trk3.eta()), + std::cos((trk2.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/Differential/histdelta_KaPr_os_Dif"), collision.centFT0C(), trk2.pt() + trk3.pt(), std::abs(trk2.eta() - trk3.eta()), + std::cos((trk2.phi() - trk3.phi()))); } } } @@ -475,7 +584,7 @@ struct pidcme { } } - void process(MyCollisions::iterator const& collision, MyTracks const& tracks) + void process(soa::Filtered>::iterator const& collision, soa::Filtered> const& tracks) { histosQA.fill(HIST("QA/histEventCount"), 0.5); if (!SelEvent(collision)) { @@ -484,9 +593,27 @@ struct pidcme { histosQA.fill(HIST("QA/histEventCount"), 1.5); histosQA.fill(HIST("QA/histCentrality"), collision.centFT0C()); histosQA.fill(HIST("QA/histVertexZRec"), collision.posZ()); + auto tracks1 = Tracks_set1->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto tracks2 = Tracks_set2->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto tracks3 = Tracks_set3->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + mult1 = tracks1.size(); + mult2 = tracks2.size(); + mult3 = tracks3.size(); + if (mult1 < 1 || mult2 < 1 || mult3 < 1) // Reject Collisions without sufficient particles + return; for (auto i = 0; i < static_cast(cfgnMods->size()); i++) { + int DetInd_global = DetId * 4 + cfgnTotalSystem * 4 * (cfgnMods->at(i) - 2); + float Psi_n_global = helperEP.GetEventPlane(collision.qvecRe()[DetInd_global + 3], collision.qvecIm()[DetInd_global + 3], cfgnMods->at(i)); + for (auto& trk : tracks) { + if (!SelTrack(trk)) + continue; + histosQA.fill(HIST("V2/histSinDetV2"), collision.centFT0C(), trk.pt(), + std::sin(static_cast(cfgnMods->at(i)) * (trk.phi() - Psi_n_global))); + histosQA.fill(HIST("V2/histCosDetV2"), collision.centFT0C(), trk.pt(), + std::cos(static_cast(cfgnMods->at(i)) * (trk.phi() - Psi_n_global))); + } fillHistosQvec(collision, cfgnMods->at(i)); - fillHistosFlow_gamma_delta(collision, tracks, cfgnMods->at(i)); + fillHistosFlow_gamma_delta(collision, tracks1, tracks2, tracks3, cfgnMods->at(i)); } } }; @@ -494,5 +621,7 @@ struct pidcme { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), + }; } diff --git a/PWGCF/Tasks/CMakeLists.txt b/PWGCF/Tasks/CMakeLists.txt index ab3d5edd9e2..fdc35cf2ef6 100644 --- a/PWGCF/Tasks/CMakeLists.txt +++ b/PWGCF/Tasks/CMakeLists.txt @@ -28,8 +28,3 @@ o2physics_add_dpl_workflow(correlations SOURCES correlations.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(pid-cme - SOURCES pidcme.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore - COMPONENT_NAME Analysis) From 5980937c8954215b263d43b47f505396df85a689 Mon Sep 17 00:00:00 2001 From: Samuele Cattaruzzi <124249902+scattaru@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:57:39 +0100 Subject: [PATCH 092/459] [PWGHF] Fix derived data issue for HF correlations (#8608) --- PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h | 5 +++-- PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h b/PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h index f8350111bdc..8bd3815df00 100644 --- a/PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h +++ b/PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h @@ -26,6 +26,7 @@ DECLARE_SOA_COLUMN(Multiplicity, multiplicity, float); //! Event multiplicity DECLARE_SOA_COLUMN(PosZ, posZ, float); //! Primary vertex z position } // namespace hf_collisions_reduced + DECLARE_SOA_TABLE(HfcRedCollisions, "AOD", "HFCREDCOLLISION", //! Table with collision info soa::Index<>, aod::hf_collisions_reduced::Multiplicity, @@ -44,7 +45,7 @@ DECLARE_SOA_COLUMN(EtaCand, etaCand, float); //! Eta of the candida DECLARE_SOA_COLUMN(PtCand, ptCand, float); //! Pt of the candidate DECLARE_SOA_COLUMN(InvMassDs, invMassDs, float); //! Invariant mass of Ds candidate } // namespace hf_candidate_reduced -DECLARE_SOA_TABLE(DsCandReduced, "AOD", "DSCANDREDUCED", //! Table with Ds candidate info (rectangular selection) +DECLARE_SOA_TABLE(DsCandReduceds, "AOD", "DSCANDREDUCED", //! Table with Ds candidate info (rectangular selection) soa::Index<>, aod::hf_candidate_reduced::HfcRedCollisionId, aod::hf_candidate_reduced::PhiCand, @@ -59,7 +60,7 @@ DECLARE_SOA_COLUMN(EtaAssocTrack, etaAssocTrack, float); //! Eta of the track DECLARE_SOA_COLUMN(PhiAssocTrack, phiAssocTrack, float); //! Phi of the track DECLARE_SOA_COLUMN(PtAssocTrack, ptAssocTrack, float); //! Pt of the track } // namespace hf_assoc_track_reduced -DECLARE_SOA_TABLE(AssocTrackRed, "AOD", "ASSOCTRACKRED", //! Table with associated track info +DECLARE_SOA_TABLE(AssocTrackReds, "AOD", "ASSOCTRACKRED", //! Table with associated track info soa::Index<>, aod::hf_candidate_reduced::HfcRedCollisionId, aod::hf_assoc_track_reduced::PhiAssocTrack, diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index a0514f97a62..6d85a17cb80 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -79,6 +79,7 @@ struct HfCorrelatorDsHadronsSelCollision { bool isSel8 = true; bool isNosameBunchPileUp = true; if (doSelDsCollision) { + isDsFound = false; // if candidate table is empty for-loop is not performed for (const auto& candidate : candidates) { if (std::abs(hfHelper.yDs(candidate)) > yCandMax || candidate.pt() < ptCandMin) { isDsFound = false; @@ -89,9 +90,11 @@ struct HfCorrelatorDsHadronsSelCollision { } } if (useSel8) { + isSel8 = false; isSel8 = collision.sel8(); } if (selNoSameBunchPileUpColl) { + isNosameBunchPileUp = false; isNosameBunchPileUp = static_cast(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)); } isSelColl = isDsFound && isSel8 && isNosameBunchPileUp; @@ -139,8 +142,8 @@ struct HfCorrelatorDsHadrons { Produces entryDsCandGenInfo; Produces entryTrackRecoInfo; Produces collReduced; - Produces candReduced; - Produces assocTrackReduced; + Produces candReduced; + Produces assocTrackReduced; Configurable fillHistoData{"fillHistoData", true, "Flag for filling histograms in data processes"}; Configurable fillHistoMcRec{"fillHistoMcRec", true, "Flag for filling histograms in MC Rec processes"}; From 66fba30a9ed533412cf5e6bc43dd30ce84e595d7 Mon Sep 17 00:00:00 2001 From: lauraser <45659867+lauraser@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:32:42 +0100 Subject: [PATCH 093/459] [PWGCF] Config ccdb path for trigger selections (#8622) Co-authored-by: Laura Serksnyte --- PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx index fa215542a6c..c0620e16e37 100644 --- a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx +++ b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx @@ -15,6 +15,8 @@ #include #include +#include +#include #include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" @@ -109,6 +111,7 @@ struct femtoDreamProducerTask { "ConfTriggerSwitches", {softwareTriggers::triggerSwitches[0], 1, softwareTriggers::nTriggers, std::vector{"Switch"}, softwareTriggers::triggerNames}, "Turn on which trigger should be checked for recorded events to pass selection"}; + Configurable ConfBaseCCDBPathForTriggers{"ConfBaseCCDBPathForTriggers", "Users/m/mpuccio/EventFiltering/OTS/Chunked/", "Provide ccdb path for trigger table; default - trigger coordination"}; // Event cuts - usual selection criteria Configurable ConfEvtZvtx{"ConfEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; @@ -341,6 +344,7 @@ struct femtoDreamProducerTask { // Init for zorro to get trigger flags if (ConfEnableTriggerSelection) { + zorro.setCCDBpath(ConfBaseCCDBPathForTriggers); zorro.initCCDB(ccdb.service, mRunNumber, timestamp, zorroTriggerNames); } } From add653e0b0a7a57f37c127a4e433107fb59bbba2 Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Tue, 26 Nov 2024 15:32:59 +0100 Subject: [PATCH 094/459] [Trigger] Add option to skip untriggered events (#8655) --- EventFiltering/cefpTask.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/EventFiltering/cefpTask.cxx b/EventFiltering/cefpTask.cxx index 6b998a1d37f..b5cfa90449a 100644 --- a/EventFiltering/cefpTask.cxx +++ b/EventFiltering/cefpTask.cxx @@ -14,12 +14,13 @@ #include #include -#include #include #include #include #include #include +#include +#include #include "filterTables.h" @@ -213,6 +214,7 @@ struct centralEventFilterTask { Produces tags; Configurable cfgDisableDownscalings{"cfgDisableDownscalings", false, "Disable downscalings"}; + Configurable cfgSkipUntriggeredEvents{"cfgSkipUntriggeredEvents", false, "Skip untriggered events"}; FILTER_CONFIGURABLE(F1ProtonFilters); FILTER_CONFIGURABLE(NucleiFilters); @@ -389,6 +391,9 @@ struct centralEventFilterTask { } for (uint64_t iD{0}; iD < outDecision.size(); ++iD) { uint64_t foundBC = FoundBCArray->Value(iD) >= 0 && FoundBCArray->Value(iD) < GloBCArray->length() ? GloBCArray->Value(FoundBCArray->Value(iD)) : -1; + if (cfgSkipUntriggeredEvents.value && !outDecision[iD][0] && !outDecision[iD][1]) { + continue; + } tags(CollBCIdArray->Value(iD), GloBCArray->Value(CollBCIdArray->Value(iD)), foundBC, CollTimeArray->Value(iD), CollTimeResArray->Value(iD), outTrigger[iD][0], outTrigger[iD][1], outDecision[iD][0], outDecision[iD][1]); } } From 9888501d96b2fb001fb91c73ead01757862d1f3a Mon Sep 17 00:00:00 2001 From: Stefano Cannito <143754257+scannito@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:33:55 +0100 Subject: [PATCH 095/459] [PWGLF] Updated counting procedure for efficiency in phik0sanalysis.cxx (#8577) --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 750 +++++++++------------ 1 file changed, 318 insertions(+), 432 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index e9c37b8dc4b..1ba49cf9944 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -52,21 +52,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -namespace -{ -const int nMultBin = 10; -constexpr float multBin[nMultBin + 1] = {0.0f, 1.0f, 5.0f, 10.0f, 15.0f, 20.0f, 30.0f, 40.0f, 50.0f, 70.0f, 100.0f}; -auto vecMultBin = std::vector{multBin, multBin + nMultBin + 1}; - -const int nPtBinK0S = 7; -constexpr float pTBinK0S[nPtBinK0S + 1] = {0.0f, 0.5f, 1.0f, 1.5f, 2.0f, 3.0f, 4.0f, 6.0f}; -auto vecPtBinK0S = std::vector{pTBinK0S, pTBinK0S + nPtBinK0S + 1}; - -const int nPtBinPi = 8; -constexpr float pTBinPi[nPtBinPi + 1] = {0.2f, 0.4f, 0.6f, 0.8f, 1.0f, 1.2f, 1.5f, 2.0f, 3.0f}; -auto vecPtBinPi = std::vector{pTBinPi, pTBinPi + nPtBinPi + 1}; -} // namespace - struct phik0shortanalysis { // Histograms are defined with HistogramRegistry HistogramRegistry eventHist{"eventHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -83,6 +68,8 @@ struct phik0shortanalysis { HistogramRegistry K0SeffHist{"K0SeffHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry PioneffHist{"PioneffHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry yaccHist{"yaccHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry closureMCPhiK0SHist{"closureMCPhiK0SHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry closureMCPhiPionHist{"closureMCPhiPionHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; // Configurable for event selection Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; @@ -138,7 +125,7 @@ struct phik0shortanalysis { Configurable NSigmaTOFPion{"NSigmaTOFPion", 5.0, "NSigmaTOFPion"}; // Configurable on pion pT bins - Configurable> binspTPi{"binspTPi", {0.2, 0.4, 0.6, 0.8, 1.0f, 1.2, 1.5, 2.0, 3.0}, "pT bin limits for pions"}; + Configurable> binspTPi{"binspTPi", {0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.5, 2.0, 3.0}, "pT bin limits for pions"}; // Configurables for delta y selection Configurable nBinsy{"nBinsy", 10, "Number of bins in y and deltay axis"}; @@ -190,6 +177,12 @@ struct phik0shortanalysis { // Necessary to flag INEL>0 events in GenMC Service pdgDB; + typedef struct TLorentzVectorAndPID { + TLorentzVector fLorentzVector; + float fnSigmaTPC; + float fnSigmaTOF; + } TLorentzVectorAndPID; + void init(InitContext&) { // Axes @@ -261,92 +254,102 @@ struct phik0shortanalysis { // Phi invariant mass for computing purities and normalisation PhipurHist.add("h2PhipurInvMass", "Invariant mass of Phi for Purity (no K0S/Pi)", kTH2F, {binnedmultAxis, PhimassAxis}); - PhipurHist.add("h3PhipurK0SInvMassInclusive", "Invariant mass of Phi for Purity (K0S) Inclusive", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); - PhipurHist.add("h3PhipurK0SInvMassFirstCut", "Invariant mass of Phi for Purity (K0S) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); - PhipurHist.add("h3PhipurK0SInvMassSecondCut", "Invariant mass of Phi for Purity (K0S) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); + PhipurHist.add("h3PhipurK0SInvMassInc", "Invariant mass of Phi for Purity (K0S) Inclusive", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); + PhipurHist.add("h3PhipurK0SInvMassFCut", "Invariant mass of Phi for Purity (K0S) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); + PhipurHist.add("h3PhipurK0SInvMassSCut", "Invariant mass of Phi for Purity (K0S) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); - PhipurHist.add("h3PhipurPiInvMassInclusive", "Invariant mass of Phi for Purity (Pi) Inclusive", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); - PhipurHist.add("h3PhipurPiInvMassFirstCut", "Invariant mass of Phi for Purity (Pi) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); - PhipurHist.add("h3PhipurPiInvMassSecondCut", "Invariant mass of Phi for Purity (Pi) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); + PhipurHist.add("h3PhipurPiInvMassInc", "Invariant mass of Phi for Purity (Pi) Inclusive", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); + PhipurHist.add("h3PhipurPiInvMassFCut", "Invariant mass of Phi for Purity (Pi) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); + PhipurHist.add("h3PhipurPiInvMassSCut", "Invariant mass of Phi for Purity (Pi) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); // MCPhi invariant mass for computing purities MCPhipurHist.add("h2MCPhipurInvMass", "Invariant mass of Phi for Purity (no K0S/Pi)", kTH2F, {binnedmultAxis, PhimassAxis}); - MCPhipurHist.add("h3MCPhipurK0SInvMassInclusive", "Invariant mass of Phi for Purity (K0S) Inclusive", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); - MCPhipurHist.add("h3MCPhipurK0SInvMassFirstCut", "Invariant mass of Phi for Purity (K0S) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); - MCPhipurHist.add("h3MCPhipurK0SInvMassSecondCut", "Invariant mass of Phi for Purity (K0S) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); + MCPhipurHist.add("h3MCPhipurK0SInvMassInc", "Invariant mass of Phi for Purity (K0S) Inclusive", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); + MCPhipurHist.add("h3MCPhipurK0SInvMassFCut", "Invariant mass of Phi for Purity (K0S) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); + MCPhipurHist.add("h3MCPhipurK0SInvMassSCut", "Invariant mass of Phi for Purity (K0S) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); - MCPhipurHist.add("h3MCPhipurPiInvMassInclusive", "Invariant mass of Phi for Purity (Pi) Inclusive", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); - MCPhipurHist.add("h3MCPhipurPiInvMassFirstCut", "Invariant mass of Phi for Purity (Pi) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); - MCPhipurHist.add("h3MCPhipurPiInvMassSecondCut", "Invariant mass of Phi for Purity (Pi) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); + MCPhipurHist.add("h3MCPhipurPiInvMassInc", "Invariant mass of Phi for Purity (Pi) Inclusive", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); + MCPhipurHist.add("h3MCPhipurPiInvMassFCut", "Invariant mass of Phi for Purity (Pi) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); + MCPhipurHist.add("h3MCPhipurPiInvMassSCut", "Invariant mass of Phi for Purity (Pi) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); // 2D mass for Phi and K0S for Data PhiK0SHist.add("h4PhiK0SSEInc", "2D Invariant mass of Phi and K0Short for Same Event Inclusive", kTHnSparseF, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis, sigPhimassAxis}); PhiK0SHist.add("h4PhiK0SSEFCut", "2D Invariant mass of Phi and K0Short for Same Event Deltay < FirstCut", kTHnSparseF, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis, sigPhimassAxis}); PhiK0SHist.add("h4PhiK0SSESCut", "2D Invariant mass of Phi and K0Short for Same Event Deltay < SecondCut", kTHnSparseF, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis, sigPhimassAxis}); - // MC 2D mass for Phi and K0S + // RecMC K0S coupled to Phi MCPhiK0SHist.add("h3RecMCPhiK0SSEInc", "2D Invariant mass of Phi and K0Short for RecMC Inclusive", kTH3F, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis}); MCPhiK0SHist.add("h3RecMCPhiK0SSEFCut", "2D Invariant mass of Phi and K0Short for RecMC Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis}); MCPhiK0SHist.add("h3RecMCPhiK0SSESCut", "2D Invariant mass of Phi and K0Short for RecMC Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis}); // GenMC K0S coupled to Phi - MCPhiK0SHist.add("h2PhiK0SGenMCInclusive", "K0Short coupled to Phi for GenMC Inclusive", kTH2F, {binnedmultAxis, binnedptK0SAxis}); - MCPhiK0SHist.add("h2PhiK0SGenMCFirstCut", "K0Short coupled to Phi for GenMC Deltay < FirstCut", kTH2F, {binnedmultAxis, binnedptK0SAxis}); - MCPhiK0SHist.add("h2PhiK0SGenMCSecondCut", "K0Short coupled to Phi for GenMC Deltay < SecondCut", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + MCPhiK0SHist.add("h2PhiK0SGenMCInc", "K0Short coupled to Phi for GenMC Inclusive", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + MCPhiK0SHist.add("h2PhiK0SGenMCFCut", "K0Short coupled to Phi for GenMC Deltay < FirstCut", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + MCPhiK0SHist.add("h2PhiK0SGenMCSCut", "K0Short coupled to Phi for GenMC Deltay < SecondCut", kTH2F, {binnedmultAxis, binnedptK0SAxis}); - MCPhiK0SHist.add("h2PhiK0SGenMCInclusiveAssocReco", "K0Short coupled to Phi for GenMC Inclusive Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptK0SAxis}); - MCPhiK0SHist.add("h2PhiK0SGenMCFirstCutAssocReco", "K0Short coupled to Phi for GenMC Deltay < FirstCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptK0SAxis}); - MCPhiK0SHist.add("h2PhiK0SGenMCSecondCutAssocReco", "K0Short coupled to Phi for GenMC Deltay < SecondCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + MCPhiK0SHist.add("h2PhiK0SGenMCIncAssocReco", "K0Short coupled to Phi for GenMC Inclusive Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + MCPhiK0SHist.add("h2PhiK0SGenMCFCutAssocReco", "K0Short coupled to Phi for GenMC Deltay < FirstCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + MCPhiK0SHist.add("h2PhiK0SGenMCSCutAssocReco", "K0Short coupled to Phi for GenMC Deltay < SecondCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + + // 2D mass for Phi and K0S for Closure Test + closureMCPhiK0SHist.add("h4ClosureMCPhiK0SSEInc", "2D Invariant mass of Phi and K0Short for Same Event Inclusive for Closure Test", kTHnSparseF, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis, sigPhimassAxis}); + closureMCPhiK0SHist.add("h4ClosureMCPhiK0SSEFCut", "2D Invariant mass of Phi and K0Short for Same Event Deltay < FirstCut for Closure Test", kTHnSparseF, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis, sigPhimassAxis}); + closureMCPhiK0SHist.add("h4ClosureMCPhiK0SSESCut", "2D Invariant mass of Phi and K0Short for Same Event Deltay < SecondCut for Closure Test", kTHnSparseF, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis, sigPhimassAxis}); // Phi mass vs Pion NSigma dE/dx for Data PhiPionHist.add("h5PhiPiSEInc", "Phi Invariant mass vs Pion nSigma TPC/TOF for Same Event Inclusive", kTHnSparseF, {binnedmultAxis, binnedptPiAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, sigPhimassAxis}); PhiPionHist.add("h5PhiPiSEFCut", "Phi Invariant mass vs Pion nSigma TPC/TOF for Same Event Deltay < FirstCut", kTHnSparseF, {binnedmultAxis, binnedptPiAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, sigPhimassAxis}); PhiPionHist.add("h5PhiPiSESCut", "Phi Invariant mass vs Pion nSigma TPC/TOF for Same Event Deltay < SecondCut", kTHnSparseF, {binnedmultAxis, binnedptPiAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, sigPhimassAxis}); - // MC Phi mass vs Pion NSigma dE/dx + // RecMC Pion coupled to Phi MCPhiPionHist.add("h4RecMCPhiPiSEInc", "Phi Invariant mass vs Pion nSigma TPC/TOF for RecMC Inclusive", kTHnSparseF, {binnedmultAxis, binnedptPiAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}}); MCPhiPionHist.add("h4RecMCPhiPiSEFCut", "Phi Invariant mass vs Pion nSigma TPC/TOF for RecMC Deltay < FirstCut", kTHnSparseF, {binnedmultAxis, binnedptPiAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}}); MCPhiPionHist.add("h4RecMCPhiPiSESCut", "Phi Invariant mass vs Pion nSigma TPC/TOF for RecMC Deltay < SecondCut", kTHnSparseF, {binnedmultAxis, binnedptPiAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}}); // GenMC Pion coupled to Phi - MCPhiPionHist.add("h2PhiPiGenMCInclusive", "Pion coupled to Phi for GenMC Inclusive", kTH2F, {binnedmultAxis, binnedptPiAxis}); - MCPhiPionHist.add("h2PhiPiGenMCFirstCut", "Pion coupled to Phi for GenMC Deltay < FirstCut", kTH2F, {binnedmultAxis, binnedptPiAxis}); - MCPhiPionHist.add("h2PhiPiGenMCSecondCut", "Pion coupled to Phi for GenMC Deltay < SecondCut", kTH2F, {binnedmultAxis, binnedptPiAxis}); + MCPhiPionHist.add("h2PhiPiGenMCInc", "Pion coupled to Phi for GenMC Inclusive", kTH2F, {binnedmultAxis, binnedptPiAxis}); + MCPhiPionHist.add("h2PhiPiGenMCFCut", "Pion coupled to Phi for GenMC Deltay < FirstCut", kTH2F, {binnedmultAxis, binnedptPiAxis}); + MCPhiPionHist.add("h2PhiPiGenMCSCut", "Pion coupled to Phi for GenMC Deltay < SecondCut", kTH2F, {binnedmultAxis, binnedptPiAxis}); + + MCPhiPionHist.add("h2PhiPiGenMCIncAssocReco", "Pion coupled to Phi for GenMC Inclusive Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); + MCPhiPionHist.add("h2PhiPiGenMCFCutAssocReco", "Pion coupled to Phi for GenMC Deltay < FirstCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); + MCPhiPionHist.add("h2PhiPiGenMCSCutAssocReco", "Pion coupled to Phi for GenMC Deltay < SecondCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); - MCPhiPionHist.add("h2PhiPiGenMCInclusiveAssocReco", "Pion coupled to Phi for GenMC Inclusive Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); - MCPhiPionHist.add("h2PhiPiGenMCFirstCutAssocReco", "Pion coupled to Phi for GenMC Deltay < FirstCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); - MCPhiPionHist.add("h2PhiPiGenMCSecondCutAssocReco", "Pion coupled to Phi for GenMC Deltay < SecondCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); + // Phi mass vs Pion NSigma dE/dx for Closure Test + closureMCPhiPionHist.add("h5ClosureMCPhiPiSEInc", "Phi Invariant mass vs Pion nSigma TPC/TOF for Same Event Inclusive for Closure Test", kTHnSparseF, {binnedmultAxis, binnedptPiAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, sigPhimassAxis}); + closureMCPhiPionHist.add("h5ClosureMCPhiPiSEFCut", "Phi Invariant mass vs Pion nSigma TPC/TOF for Same Event Deltay < FirstCut for Closure Test", kTHnSparseF, {binnedmultAxis, binnedptPiAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, sigPhimassAxis}); + closureMCPhiPionHist.add("h5ClosureMCPhiPiSESCut", "Phi Invariant mass vs Pion nSigma TPC/TOF for Same Event Deltay < SecondCut for Closure Test", kTHnSparseF, {binnedmultAxis, binnedptPiAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, sigPhimassAxis}); // MCPhi invariant mass for computing efficiencies and MCnormalisation PhieffHist.add("h2PhieffInvMass", "Invariant mass of Phi for Efficiency (no K0S/Pi)", kTH2F, {binnedmultAxis, PhimassAxis}); - PhieffHist.add("h3PhieffK0SInvMassInclusive", "Invariant mass of Phi for Efficiency (K0S) Inclusive", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); - PhieffHist.add("h3PhieffK0SInvMassFirstCut", "Invariant mass of Phi for Efficiency (K0S) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); - PhieffHist.add("h3PhieffK0SInvMassSecondCut", "Invariant mass of Phi for Efficiency (K0S) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); + PhieffHist.add("h3PhieffK0SInvMassInc", "Invariant mass of Phi for Efficiency (K0S) Inclusive", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); + PhieffHist.add("h3PhieffK0SInvMassFCut", "Invariant mass of Phi for Efficiency (K0S) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); + PhieffHist.add("h3PhieffK0SInvMassSCut", "Invariant mass of Phi for Efficiency (K0S) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); - PhieffHist.add("h3PhieffPiInvMassInclusive", "Invariant mass of Phi for Efficiency (Pi) Inclusive", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); - PhieffHist.add("h3PhieffPiInvMassFirstCut", "Invariant mass of Phi for Efficiency (Pi) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); - PhieffHist.add("h3PhieffPiInvMassSecondCut", "Invariant mass of Phi for Efficiency (Pi) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); + PhieffHist.add("h3PhieffPiInvMassInc", "Invariant mass of Phi for Efficiency (Pi) Inclusive", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); + PhieffHist.add("h3PhieffPiInvMassFCut", "Invariant mass of Phi for Efficiency (Pi) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); + PhieffHist.add("h3PhieffPiInvMassSCut", "Invariant mass of Phi for Efficiency (Pi) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); // GenMC Phi and Phi coupled to K0S and Pion - PhieffHist.add("h1PhiGenMC", "Phi for GenMC", kTH1F, {{10, -0.5f, 9.5f}}); + PhieffHist.add("h1PhiGenMC", "Phi for GenMC", kTH1F, {binnedmultAxis}); - PhieffHist.add("h2PhieffK0SGenMCInclusive", "Phi coupled to K0Short for GenMC Inclusive", kTH2F, {{10, -0.5f, 9.5f}, {4, -0.5f, 3.5f}}); - PhieffHist.add("h2PhieffK0SGenMCFirstCut", "Phi coupled to K0Short for GenMC Deltay < FirstCut", kTH2F, {{10, -0.5f, 9.5f}, {4, -0.5f, 3.5f}}); - PhieffHist.add("h2PhieffK0SGenMCSecondCut", "Phi coupled to K0Short for GenMC Deltay < SecondCut", kTH2F, {{10, -0.5f, 9.5f}, {4, -0.5f, 3.5f}}); + PhieffHist.add("h2PhieffK0SGenMCInc", "Phi coupled to K0Short for GenMC Inclusive", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + PhieffHist.add("h2PhieffK0SGenMCFCut", "Phi coupled to K0Short for GenMC Deltay < FirstCut", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + PhieffHist.add("h2PhieffK0SGenMCSCut", "Phi coupled to K0Short for GenMC Deltay < SecondCut", kTH2F, {binnedmultAxis, binnedptK0SAxis}); - PhieffHist.add("h2PhieffK0SGenMCInclusiveAssocReco", "Phi coupled to K0Short for GenMC Inclusive", kTH2F, {{10, -0.5f, 9.5f}, {4, -0.5f, 3.5f}}); - PhieffHist.add("h2PhieffK0SGenMCFirstCutAssocReco", "Phi coupled to K0Short for GenMC Deltay < FirstCut", kTH2F, {{10, -0.5f, 9.5f}, {4, -0.5f, 3.5f}}); - PhieffHist.add("h2PhieffK0SGenMCSecondCutAssocReco", "Phi coupled to K0Short for GenMC Deltay < SecondCut", kTH2F, {{10, -0.5f, 9.5f}, {4, -0.5f, 3.5f}}); + PhieffHist.add("h2PhieffK0SGenMCIncAssocReco", "Phi coupled to K0Short for GenMC Inclusive", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + PhieffHist.add("h2PhieffK0SGenMCFCutAssocReco", "Phi coupled to K0Short for GenMC Deltay < FirstCut", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + PhieffHist.add("h2PhieffK0SGenMCSCutAssocReco", "Phi coupled to K0Short for GenMC Deltay < SecondCut", kTH2F, {binnedmultAxis, binnedptK0SAxis}); - PhieffHist.add("h2PhieffPiGenMCInclusive", "Phi coupled to Pion for GenMC Inclusive", kTH2F, {{10, -0.5f, 9.5f}, {3, -0.5f, 2.5f}}); - PhieffHist.add("h2PhieffPiGenMCFirstCut", "Phi coupled to Pion for GenMC Deltay < FirstCut", kTH2F, {{10, -0.5f, 9.5f}, {3, -0.5f, 2.5f}}); - PhieffHist.add("h2PhieffPiGenMCSecondCut", "Phi coupled to Pion for GenMC Deltay < SecondCut", kTH2F, {{10, -0.5f, 9.5f}, {3, -0.5f, 2.5f}}); + PhieffHist.add("h2PhieffPiGenMCInc", "Phi coupled to Pion for GenMC Inclusive", kTH2F, {binnedmultAxis, binnedptPiAxis}); + PhieffHist.add("h2PhieffPiGenMCFCut", "Phi coupled to Pion for GenMC Deltay < FirstCut", kTH2F, {binnedmultAxis, binnedptPiAxis}); + PhieffHist.add("h2PhieffPiGenMCSCut", "Phi coupled to Pion for GenMC Deltay < SecondCut", kTH2F, {binnedmultAxis, binnedptPiAxis}); - PhieffHist.add("h2PhieffPiGenMCInclusiveAssocReco", "Phi coupled to Pion for GenMC Inclusive", kTH2F, {{10, -0.5f, 9.5f}, {3, -0.5f, 2.5f}}); - PhieffHist.add("h2PhieffPiGenMCFirstCutAssocReco", "Phi coupled to Pion for GenMC Deltay < FirstCut", kTH2F, {{10, -0.5f, 9.5f}, {3, -0.5f, 2.5f}}); - PhieffHist.add("h2PhieffPiGenMCSecondCutAssocReco", "Phi coupled to Pion for GenMC Deltay < SecondCut", kTH2F, {{10, -0.5f, 9.5f}, {3, -0.5f, 2.5f}}); + PhieffHist.add("h2PhieffPiGenMCIncAssocReco", "Phi coupled to Pion for GenMC Inclusive", kTH2F, {binnedmultAxis, binnedptPiAxis}); + PhieffHist.add("h2PhieffPiGenMCFCutAssocReco", "Phi coupled to Pion for GenMC Deltay < FirstCut", kTH2F, {binnedmultAxis, binnedptPiAxis}); + PhieffHist.add("h2PhieffPiGenMCSCutAssocReco", "Phi coupled to Pion for GenMC Deltay < SecondCut", kTH2F, {binnedmultAxis, binnedptPiAxis}); // MCK0S invariant mass and GenMC K0S for computing efficiencies K0SeffHist.add("h3K0SeffInvMass", "Invariant mass of K0Short for Efficiency", kTH3F, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis}); @@ -546,7 +549,7 @@ struct phik0shortanalysis { // Fill 2D invariant mass histogram for V0 and Phi template - void fillInvMass2D(TLorentzVector V0, const std::vector listPhi, float multiplicity, const std::array weights) + void fillInvMass2D(const TLorentzVector& V0, const std::vector& listPhi, float multiplicity, const std::array weights) { double massV0 = V0.M(); double ptV0 = V0.Pt(); @@ -566,23 +569,25 @@ struct phik0shortanalysis { continue; PhiK0SHist.fill(HIST("h4PhiK0SSESCut"), multiplicity, ptV0, massV0, massPhi, weights.at(2)); } else { // MC event - MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSEInc"), multiplicity, ptV0, massV0, weights.at(0)); + closureMCPhiK0SHist.fill(HIST("h4ClosureMCPhiK0SSEInc"), multiplicity, ptV0, massV0, massPhi, weights.at(0)); if (deltay > cfgFirstCutonDeltay) continue; - MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSEFCut"), multiplicity, ptV0, massV0, weights.at(1)); + closureMCPhiK0SHist.fill(HIST("h4ClosureMCPhiK0SSEFCut"), multiplicity, ptV0, massV0, massPhi, weights.at(1)); if (deltay > cfgSecondCutonDeltay) continue; - MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSESCut"), multiplicity, ptV0, massV0, weights.at(2)); + closureMCPhiK0SHist.fill(HIST("h4ClosureMCPhiK0SSESCut"), multiplicity, ptV0, massV0, massPhi, weights.at(2)); } } } // Fill Phi invariant mass vs Pion nSigmadE/dx histogram template - void fillInvMassNSigma(TLorentzVector Pi, float nSigmaTPCPi, float nSigmaTOFPi, const std::vector listPhi, float multiplicity, const std::array weights) + void fillInvMassNSigma(const TLorentzVectorAndPID& Pi, const std::vector& listPhi, float multiplicity, const std::array weights) { - double rapidityPi = Pi.Rapidity(); - double ptPi = Pi.Pt(); + float nSigmaTPCPi = Pi.fnSigmaTPC; + float nSigmaTOFPi = Pi.fnSigmaTOF; + double rapidityPi = Pi.fLorentzVector.Rapidity(); + double ptPi = Pi.fLorentzVector.Pt(); for (unsigned int phitag = 0; phitag < listPhi.size(); phitag++) { double massPhi = listPhi[phitag].M(); @@ -598,13 +603,13 @@ struct phik0shortanalysis { continue; PhiPionHist.fill(HIST("h5PhiPiSESCut"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weights.at(2)); } else { // MC event - MCPhiPionHist.fill(HIST("h4RecMCPhiPiSEInc"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, weights.at(0)); + closureMCPhiPionHist.fill(HIST("h5ClosureMCPhiPiSEInc"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weights.at(0)); if (deltay > cfgFirstCutonDeltay) continue; - MCPhiPionHist.fill(HIST("h4RecMCPhiPiSEFCut"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, weights.at(1)); + closureMCPhiPionHist.fill(HIST("h5ClosureMCPhiPiSEFCut"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weights.at(1)); if (deltay > cfgSecondCutonDeltay) continue; - MCPhiPionHist.fill(HIST("h4RecMCPhiPiSESCut"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, weights.at(2)); + closureMCPhiPionHist.fill(HIST("h5ClosureMCPhiPiSESCut"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weights.at(2)); } } } @@ -646,8 +651,7 @@ struct phik0shortanalysis { if (track2ID == track1ID) continue; // condition to avoid double counting of pair - TLorentzVector recPhi; - recPhi = recMother(track1, track2, massKa, massKa); + TLorentzVector recPhi = recMother(track1, track2, massKa, massKa); if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) continue; @@ -658,7 +662,7 @@ struct phik0shortanalysis { PhipurHist.fill(HIST("h2PhipurInvMass"), multiplicity, recPhi.M()); - bool isCountedK0SInclusive[nPtBinK0S] = {false}, isCountedK0SFirstCut[nPtBinK0S] = {false}, isCountedK0SSecondCut[nPtBinK0S] = {false}; + std::array isCountedK0S{false, false, false}; // V0 already reconstructed by the builder for (const auto& v0 : V0s) { @@ -680,76 +684,56 @@ struct phik0shortanalysis { } } - TLorentzVector recK0S; - recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; - - int ipTBinK0S = 0; - for (int i = 0; i < nPtBinK0S; i++) { - if (pTBinK0S[i] < recK0S.Pt() && recK0S.Pt() <= pTBinK0S[i + 1]) { - ipTBinK0S = i; - break; - } - } - - if (!isCountedK0SInclusive[ipTBinK0S]) { - PhipurHist.fill(HIST("h3PhipurK0SInvMassInclusive"), multiplicity, recK0S.Pt(), recPhi.M()); - isCountedK0SInclusive[ipTBinK0S] = true; + if (!isCountedK0S.at(0)) { + PhipurHist.fill(HIST("h3PhipurK0SInvMassInc"), multiplicity, recK0S.Pt(), recPhi.M()); + isCountedK0S.at(0) = true; } if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; - if (!isCountedK0SFirstCut[ipTBinK0S]) { - PhipurHist.fill(HIST("h3PhipurK0SInvMassFirstCut"), multiplicity, recK0S.Pt(), recPhi.M()); - isCountedK0SFirstCut[ipTBinK0S] = true; + if (!isCountedK0S.at(1)) { + PhipurHist.fill(HIST("h3PhipurK0SInvMassFCut"), multiplicity, recK0S.Pt(), recPhi.M()); + isCountedK0S.at(1) = true; } if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; - if (!isCountedK0SSecondCut[ipTBinK0S]) { - PhipurHist.fill(HIST("h3PhipurK0SInvMassSecondCut"), multiplicity, recK0S.Pt(), recPhi.M()); - isCountedK0SSecondCut[ipTBinK0S] = true; + if (!isCountedK0S.at(2)) { + PhipurHist.fill(HIST("h3PhipurK0SInvMassSCut"), multiplicity, recK0S.Pt(), recPhi.M()); + isCountedK0S.at(2) = true; } } isFilledhV0 = true; - bool isCountedPiInclusive[nPtBinPi] = {false}, isCountedPiFirstCut[nPtBinPi] = {false}, isCountedPiSecondCut[nPtBinPi] = {false}; + std::array isCountedPi{false, false, false}; // Loop over all primary pion candidates for (const auto& track : fullTracks) { if (!selectionPion(track)) continue; - TLorentzVector recPi; - recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); + TLorentzVector recPi(track.px(), track.py(), track.pz(), massPi); if (std::abs(recPi.Rapidity()) > cfgyAcceptance) continue; - - int ipTBinPi = 0; - for (int i = 0; i < nPtBinPi; i++) { - if (pTBinPi[i] < recPi.Pt() && recPi.Pt() <= pTBinPi[i + 1]) { - ipTBinPi = i; - break; - } - } - - if (!isCountedPiInclusive[ipTBinPi]) { - PhipurHist.fill(HIST("h3PhipurPiInvMassInclusive"), multiplicity, recPi.Pt(), recPhi.M()); - isCountedPiInclusive[ipTBinPi] = true; + if (!isCountedPi.at(0)) { + PhipurHist.fill(HIST("h3PhipurPiInvMassInc"), multiplicity, recPi.Pt(), recPhi.M()); + isCountedPi.at(0) = true; } if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; - if (!isCountedPiFirstCut[ipTBinPi]) { - PhipurHist.fill(HIST("h3PhipurPiInvMassFirstCut"), multiplicity, recPi.Pt(), recPhi.M()); - isCountedPiFirstCut[ipTBinPi] = true; + if (!isCountedPi.at(1)) { + PhipurHist.fill(HIST("h3PhipurPiInvMassFCut"), multiplicity, recPi.Pt(), recPhi.M()); + isCountedPi.at(1) = true; } if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; - if (!isCountedPiSecondCut[ipTBinPi]) { - PhipurHist.fill(HIST("h3PhipurPiInvMassSecondCut"), multiplicity, recPi.Pt(), recPhi.M()); - isCountedPiSecondCut[ipTBinPi] = true; + if (!isCountedPi.at(2)) { + PhipurHist.fill(HIST("h3PhipurPiInvMassSCut"), multiplicity, recPi.Pt(), recPhi.M()); + isCountedPi.at(2) = true; } } } @@ -779,8 +763,7 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S; - recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -804,22 +787,21 @@ struct phik0shortanalysis { if (track2ID == track1ID) continue; // condition to avoid double counting of pair - TLorentzVector recPhi; - recPhi = recMother(track1, track2, massKa, massKa); - if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) + TLorentzVector recPhi = recMother(track1, track2, massKa, massKa); + + if (recPhi.M() < lowmPhi || recPhi.M() > upmPhi) continue; + if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) + continue; listrecPhi.push_back(recPhi); - - if (lowmPhi <= recPhi.M() && recPhi.M() <= upmPhi) { - counts.at(0)++; - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) - continue; - counts.at(1)++; - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) - continue; - counts.at(2)++; - } + counts.at(0)++; + if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + continue; + counts.at(1)++; + if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + continue; + counts.at(2)++; } } @@ -853,14 +835,14 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi; - recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); - if (std::abs(recPi.Rapidity()) > cfgyAcceptance) + TLorentzVector vecPi(track.px(), track.py(), track.pz(), massPi); + if (std::abs(vecPi.Rapidity()) > cfgyAcceptance) continue; - float nsigmaTPC, nsigmaTOF; - nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -9.99); - nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -9.99); + float nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -9.99); + float nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -9.99); + + TLorentzVectorAndPID recPi{vecPi, nsigmaTPC, nsigmaTOF}; std::vector listrecPhi; std::array counts{}; @@ -882,22 +864,21 @@ struct phik0shortanalysis { if (track2ID == track1ID) continue; // condition to avoid double counting of pair - TLorentzVector recPhi; - recPhi = recMother(track1, track2, massKa, massKa); - if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) + TLorentzVector recPhi = recMother(track1, track2, massKa, massKa); + + if (recPhi.M() < lowmPhi || recPhi.M() > upmPhi) continue; + if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) + continue; listrecPhi.push_back(recPhi); - - if (lowmPhi <= recPhi.M() && recPhi.M() <= upmPhi) { - counts.at(0)++; - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) - continue; - counts.at(1)++; - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) - continue; - counts.at(2)++; - } + counts.at(0)++; + if (std::abs(vecPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + continue; + counts.at(1)++; + if (std::abs(vecPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + continue; + counts.at(2)++; } } @@ -906,7 +887,7 @@ struct phik0shortanalysis { weights.at(i) = (counts.at(i) > 0 ? 1. / static_cast(counts.at(i)) : 0); } - fillInvMassNSigma(recPi, nsigmaTPC, nsigmaTOF, listrecPhi, multiplicity, weights); + fillInvMassNSigma(recPi, listrecPhi, multiplicity, weights); } } @@ -976,8 +957,7 @@ struct phik0shortanalysis { if (pdgParentPhi != 333) continue; - TLorentzVector recPhi; - recPhi = recMother(track1, track2, massKa, massKa); + TLorentzVector recPhi = recMother(track1, track2, massKa, massKa); if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) continue; @@ -988,7 +968,7 @@ struct phik0shortanalysis { PhieffHist.fill(HIST("h2PhieffInvMass"), genmultiplicity, recPhi.M()); - bool isCountedK0SInclusive[nPtBinK0S] = {false}, isCountedK0SFirstCut[nPtBinK0S] = {false}, isCountedK0SSecondCut[nPtBinK0S] = {false}; + std::array isCountedK0S{false, false, false}; // V0 already reconstructed by the builder for (const auto& v0 : V0s) { @@ -1021,39 +1001,29 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S; - recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; - - int ipTBinK0S = 0; - for (int i = 0; i < nPtBinK0S; i++) { - if (pTBinK0S[i] < recK0S.Pt() && recK0S.Pt() <= pTBinK0S[i + 1]) { - ipTBinK0S = i; - break; - } - } - - if (!isCountedK0SInclusive[ipTBinK0S]) { - PhieffHist.fill(HIST("h3PhieffK0SInvMassInclusive"), genmultiplicity, recK0S.Pt(), recPhi.M()); - isCountedK0SInclusive[ipTBinK0S] = true; + if (!isCountedK0S.at(0)) { + PhieffHist.fill(HIST("h3PhieffK0SInvMassInc"), genmultiplicity, recK0S.Pt(), recPhi.M()); + isCountedK0S.at(0) = true; } if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; - if (!isCountedK0SFirstCut[ipTBinK0S]) { - PhieffHist.fill(HIST("h3PhieffK0SInvMassFirstCut"), genmultiplicity, recK0S.Pt(), recPhi.M()); - isCountedK0SFirstCut[ipTBinK0S] = true; + if (!isCountedK0S.at(1)) { + PhieffHist.fill(HIST("h3PhieffK0SInvMassFCut"), genmultiplicity, recK0S.Pt(), recPhi.M()); + isCountedK0S.at(1) = true; } if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; - if (!isCountedK0SSecondCut[ipTBinK0S]) { - PhieffHist.fill(HIST("h3PhieffK0SInvMassSecondCut"), genmultiplicity, recK0S.Pt(), recPhi.M()); - isCountedK0SSecondCut[ipTBinK0S] = true; + if (!isCountedK0S.at(2)) { + PhieffHist.fill(HIST("h3PhieffK0SInvMassSCut"), genmultiplicity, recK0S.Pt(), recPhi.M()); + isCountedK0S.at(2) = true; } } - bool isCountedPiInclusive[nPtBinPi] = {false}, isCountedPiFirstCut[nPtBinPi] = {false}, isCountedPiSecondCut[nPtBinPi] = {false}; + std::array isCountedPi{false, false, false}; // Loop over all primary pion candidates for (const auto& track : fullMCTracks) { @@ -1067,35 +1037,25 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi; - recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); + TLorentzVector recPi(track.px(), track.py(), track.pz(), massPi); if (std::abs(recPi.Rapidity()) > cfgyAcceptance) continue; - - int ipTBinPi = 0; - for (int i = 0; i < nPtBinPi; i++) { - if (pTBinPi[i] < recPi.Pt() && recPi.Pt() <= pTBinPi[i + 1]) { - ipTBinPi = i; - break; - } - } - - if (!isCountedPiInclusive[ipTBinPi]) { - PhieffHist.fill(HIST("h3PhieffPiInvMassInclusive"), genmultiplicity, recPi.Pt(), recPhi.M()); - isCountedPiInclusive[ipTBinPi] = true; + if (!isCountedPi.at(0)) { + PhieffHist.fill(HIST("h3PhieffPiInvMassInc"), genmultiplicity, recPi.Pt(), recPhi.M()); + isCountedPi.at(0) = true; } if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; - if (!isCountedPiFirstCut[ipTBinPi]) { - PhieffHist.fill(HIST("h3PhieffPiInvMassFirstCut"), genmultiplicity, recPi.Pt(), recPhi.M()); - isCountedPiFirstCut[ipTBinPi] = true; + if (!isCountedPi.at(1)) { + PhieffHist.fill(HIST("h3PhieffPiInvMassFCut"), genmultiplicity, recPi.Pt(), recPhi.M()); + isCountedPi.at(1) = true; } if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; - if (!isCountedPiSecondCut[ipTBinPi]) { - PhieffHist.fill(HIST("h3PhieffPiInvMassSecondCut"), genmultiplicity, recPi.Pt(), recPhi.M()); - isCountedPiSecondCut[ipTBinPi] = true; + if (!isCountedPi.at(2)) { + PhieffHist.fill(HIST("h3PhieffPiInvMassSCut"), genmultiplicity, recPi.Pt(), recPhi.M()); + isCountedPi.at(2) = true; } } } @@ -1149,17 +1109,13 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S; - recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; K0SeffHist.fill(HIST("h3K0SeffInvMass"), genmultiplicity, recK0S.Pt(), recK0S.M()); - std::vector listrecPhi; - std::array counts{}; - - bool isCountedPhi = false; + std::array isCountedPhi{false, false, false}; // Phi reconstruction for (auto track1 : posThisColl) { // loop over all selected tracks @@ -1203,36 +1159,32 @@ struct phik0shortanalysis { if (pdgParentPhi != 333) continue; - TLorentzVector recPhi; - recPhi = recMother(track1, track2, massKa, massKa); - if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) - continue; + TLorentzVector recPhi = recMother(track1, track2, massKa, massKa); - listrecPhi.push_back(recPhi); + if (recPhi.M() < lowmPhi || recPhi.M() > upmPhi) + continue; - if (!isCountedPhi) { + if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) + continue; + if (!isCountedPhi.at(0)) { yaccHist.fill(HIST("hyaccK0SRecMC"), genmultiplicity, recK0S.Pt(), recK0S.Rapidity()); - isCountedPhi = true; + MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSEInc"), genmultiplicity, recK0S.Pt(), recK0S.M()); + isCountedPhi.at(0) = true; } - - if (lowmPhi <= recPhi.M() && recPhi.M() <= upmPhi) { - counts.at(0)++; - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) - continue; - counts.at(1)++; - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) - continue; - counts.at(2)++; + if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + continue; + if (!isCountedPhi.at(1)) { + MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSEFCut"), genmultiplicity, recK0S.Pt(), recK0S.M()); + isCountedPhi.at(1) = true; + } + if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + continue; + if (!isCountedPhi.at(2)) { + MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSESCut"), genmultiplicity, recK0S.Pt(), recK0S.M()); + isCountedPhi.at(2) = true; } } } - - std::array weights{}; - for (unsigned int i = 0; i < counts.size(); i++) { - weights.at(i) = (counts.at(i) > 0 ? 1. / static_cast(counts.at(i)) : 0); - } - - fillInvMass2D(recK0S, listrecPhi, genmultiplicity, weights); } } @@ -1267,8 +1219,7 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi; - recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); + TLorentzVector recPi(track.px(), track.py(), track.pz(), massPi); if (std::abs(recPi.Rapidity()) > cfgyAcceptance) continue; @@ -1278,10 +1229,7 @@ struct phik0shortanalysis { PioneffHist.fill(HIST("h4PieffInvMass"), genmultiplicity, recPi.Pt(), nsigmaTPC, nsigmaTOF); - std::vector listrecPhi; - std::array counts{}; - - bool isCountedPhi = false; + std::array isCountedPhi{false, false, false}; // Phi reconstruction for (auto track1 : posThisColl) { // loop over all selected tracks @@ -1325,36 +1273,32 @@ struct phik0shortanalysis { if (pdgParentPhi != 333) continue; - TLorentzVector recPhi; - recPhi = recMother(track1, track2, massKa, massKa); - if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) - continue; + TLorentzVector recPhi = recMother(track1, track2, massKa, massKa); - listrecPhi.push_back(recPhi); + if (recPhi.M() < lowmPhi || recPhi.M() > upmPhi) + continue; - if (!isCountedPhi) { + if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) + continue; + if (!isCountedPhi.at(0)) { yaccHist.fill(HIST("hyaccPiRecMC"), genmultiplicity, recPi.Pt(), recPi.Rapidity()); - isCountedPhi = true; + MCPhiPionHist.fill(HIST("h4RecMCPhiPiSEInc"), genmultiplicity, recPi.Pt(), nsigmaTPC, nsigmaTOF); + isCountedPhi.at(0) = true; } - - if (lowmPhi <= recPhi.M() && recPhi.M() <= upmPhi) { - counts.at(0)++; - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) - continue; - counts.at(1)++; - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) - continue; - counts.at(2)++; + if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + continue; + if (!isCountedPhi.at(1)) { + MCPhiPionHist.fill(HIST("h4RecMCPhiPiSEFCut"), genmultiplicity, recPi.Pt(), nsigmaTPC, nsigmaTOF); + isCountedPhi.at(1) = true; + } + if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + continue; + if (!isCountedPhi.at(2)) { + MCPhiPionHist.fill(HIST("h4RecMCPhiPiSESCut"), genmultiplicity, recPi.Pt(), nsigmaTPC, nsigmaTOF); + isCountedPhi.at(2) = true; } } } - - std::array weights{}; - for (unsigned int i = 0; i < counts.size(); i++) { - weights.at(i) = (counts.at(i) > 0 ? 1. / static_cast(counts.at(i)) : 0); - } - - fillInvMassNSigma(recPi, nsigmaTPC, nsigmaTOF, listrecPhi, genmultiplicity, weights); } } @@ -1394,8 +1338,7 @@ struct phik0shortanalysis { if (track2ID == track1ID) continue; // condition to avoid double counting of pair - TLorentzVector recPhi; - recPhi = recMother(track1, track2, massKa, massKa); + TLorentzVector recPhi = recMother(track1, track2, massKa, massKa); if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) continue; @@ -1406,7 +1349,7 @@ struct phik0shortanalysis { MCPhipurHist.fill(HIST("h2MCPhipurInvMass"), genmultiplicity, recPhi.M()); - bool isCountedK0SInclusive[nPtBinK0S] = {false}, isCountedK0SFirstCut[nPtBinK0S] = {false}, isCountedK0SSecondCut[nPtBinK0S] = {false}; + std::array isCountedK0S{false, false, false}; // V0 already reconstructed by the builder for (const auto& v0 : V0s) { @@ -1416,39 +1359,30 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S; - recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; - int ipTBinK0S = 0; - for (int i = 0; i < nPtBinK0S; i++) { - if (pTBinK0S[i] < recK0S.Pt() && recK0S.Pt() <= pTBinK0S[i + 1]) { - ipTBinK0S = i; - break; - } - } - - if (!isCountedK0SInclusive[ipTBinK0S]) { - MCPhipurHist.fill(HIST("h3MCPhipurK0SInvMassInclusive"), genmultiplicity, recK0S.Pt(), recPhi.M()); - isCountedK0SInclusive[ipTBinK0S] = true; + if (!isCountedK0S.at(0)) { + MCPhipurHist.fill(HIST("h3MCPhipurK0SInvMassInc"), genmultiplicity, recK0S.Pt(), recPhi.M()); + isCountedK0S.at(0) = true; } if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; - if (!isCountedK0SFirstCut[ipTBinK0S]) { - MCPhipurHist.fill(HIST("h3MCPhipurK0SInvMassFirstCut"), genmultiplicity, recK0S.Pt(), recPhi.M()); - isCountedK0SFirstCut[ipTBinK0S] = true; + if (!isCountedK0S.at(1)) { + MCPhipurHist.fill(HIST("h3MCPhipurK0SInvMassFCut"), genmultiplicity, recK0S.Pt(), recPhi.M()); + isCountedK0S.at(1) = true; } if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; - if (!isCountedK0SSecondCut[ipTBinK0S]) { - MCPhipurHist.fill(HIST("h3MCPhipurK0SInvMassSecondCut"), genmultiplicity, recK0S.Pt(), recPhi.M()); - isCountedK0SSecondCut[ipTBinK0S] = true; + if (!isCountedK0S.at(2)) { + MCPhipurHist.fill(HIST("h3MCPhipurK0SInvMassSCut"), genmultiplicity, recK0S.Pt(), recPhi.M()); + isCountedK0S.at(2) = true; } } - bool isCountedPiInclusive[nPtBinPi] = {false}, isCountedPiFirstCut[nPtBinPi] = {false}, isCountedPiSecondCut[nPtBinPi] = {false}; + std::array isCountedPi{false, false, false}; // Loop over all primary pion candidates for (const auto& track : fullMCTracks) { @@ -1456,35 +1390,26 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi; - recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); + TLorentzVector recPi(track.px(), track.py(), track.pz(), massPi); if (std::abs(recPi.Rapidity()) > cfgyAcceptance) continue; - int ipTBinPi = 0; - for (int i = 0; i < nPtBinPi; i++) { - if (pTBinPi[i] < recPi.Pt() && recPi.Pt() <= pTBinPi[i + 1]) { - ipTBinPi = i; - break; - } - } - - if (!isCountedPiInclusive[ipTBinPi]) { - MCPhipurHist.fill(HIST("h3MCPhipurPiInvMassInclusive"), genmultiplicity, recPi.Pt(), recPhi.M()); - isCountedPiInclusive[ipTBinPi] = true; + if (!isCountedPi.at(0)) { + MCPhipurHist.fill(HIST("h3MCPhipurPiInvMassInc"), genmultiplicity, recPi.Pt(), recPhi.M()); + isCountedPi.at(0) = true; } if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; - if (!isCountedPiFirstCut[ipTBinPi]) { - MCPhipurHist.fill(HIST("h3MCPhipurPiInvMassFirstCut"), genmultiplicity, recPi.Pt(), recPhi.M()); - isCountedPiFirstCut[ipTBinPi] = true; + if (!isCountedPi.at(1)) { + MCPhipurHist.fill(HIST("h3MCPhipurPiInvMassFCut"), genmultiplicity, recPi.Pt(), recPhi.M()); + isCountedPi.at(1) = true; } if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; - if (!isCountedPiSecondCut[ipTBinPi]) { - MCPhipurHist.fill(HIST("h3MCPhipurPiInvMassSecondCut"), genmultiplicity, recPi.Pt(), recPhi.M()); - isCountedPiSecondCut[ipTBinPi] = true; + if (!isCountedPi.at(2)) { + MCPhipurHist.fill(HIST("h3MCPhipurPiInvMassSCut"), genmultiplicity, recPi.Pt(), recPhi.M()); + isCountedPi.at(2) = true; } } } @@ -1516,8 +1441,7 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S; - recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -1539,22 +1463,21 @@ struct phik0shortanalysis { if (track2ID == track1ID) continue; // condition to avoid double counting of pair - TLorentzVector recPhi; - recPhi = recMother(track1, track2, massKa, massKa); - if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) + TLorentzVector recPhi = recMother(track1, track2, massKa, massKa); + + if (recPhi.M() < lowmPhi || recPhi.M() > upmPhi) continue; + if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) + continue; listrecPhi.push_back(recPhi); - - if (lowmPhi <= recPhi.M() && recPhi.M() <= upmPhi) { - counts.at(0)++; - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) - continue; - counts.at(1)++; - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) - continue; - counts.at(2)++; - } + counts.at(0)++; + if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + continue; + counts.at(1)++; + if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + continue; + counts.at(2)++; } } @@ -1591,14 +1514,14 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi; - recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); - if (std::abs(recPi.Rapidity()) > cfgyAcceptance) + TLorentzVector vecPi(track.px(), track.py(), track.pz(), massPi); + if (std::abs(vecPi.Rapidity()) > cfgyAcceptance) continue; - float nsigmaTPC, nsigmaTOF; - nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -9.99); - nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -9.99); + float nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -9.99); + float nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -9.99); + + TLorentzVectorAndPID recPi{vecPi, nsigmaTPC, nsigmaTOF}; std::vector listrecPhi; std::array counts{}; @@ -1618,22 +1541,21 @@ struct phik0shortanalysis { if (track2ID == track1ID) continue; // condition to avoid double counting of pair - TLorentzVector recPhi; - recPhi = recMother(track1, track2, massKa, massKa); - if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) + TLorentzVector recPhi = recMother(track1, track2, massKa, massKa); + + if (recPhi.M() < lowmPhi || recPhi.M() > upmPhi) continue; + if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) + continue; listrecPhi.push_back(recPhi); - - if (lowmPhi <= recPhi.M() && recPhi.M() <= upmPhi) { - counts.at(0)++; - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) - continue; - counts.at(1)++; - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) - continue; - counts.at(2)++; - } + counts.at(0)++; + if (std::abs(vecPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + continue; + counts.at(1)++; + if (std::abs(vecPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + continue; + counts.at(2)++; } } @@ -1642,7 +1564,7 @@ struct phik0shortanalysis { weights.at(i) = (counts.at(i) > 0 ? 1. / static_cast(counts.at(i)) : 0); } - fillInvMassNSigma(recPi, nsigmaTPC, nsigmaTOF, listrecPhi, genmultiplicity, weights); + fillInvMassNSigma(recPi, listrecPhi, genmultiplicity, weights); } } @@ -1667,16 +1589,8 @@ struct phik0shortanalysis { } } - float multiplicity = mcCollision.centFT0M(); - MCeventHist.fill(HIST("hGenMCMultiplicityPercent"), multiplicity); - - int imultBin = 0; - for (int i = 0; i < nMultBin; i++) { - if (multBin[i] < multiplicity && multiplicity <= multBin[i + 1]) { - imultBin = i; - break; - } - } + float genmultiplicity = mcCollision.centFT0M(); + MCeventHist.fill(HIST("hGenMCMultiplicityPercent"), genmultiplicity); bool isCountedPhi = false; @@ -1705,89 +1619,73 @@ struct phik0shortanalysis { isCountedPhi = true; } - PhieffHist.fill(HIST("h1PhiGenMC"), imultBin); + PhieffHist.fill(HIST("h1PhiGenMC"), genmultiplicity); - bool isCountedK0SInclusive[nPtBinK0S] = {false}, isCountedK0SFirstCut[nPtBinK0S] = {false}, isCountedK0SSecondCut[nPtBinK0S] = {false}; + std::array isCountedK0S = {false, false, false}; for (auto mcParticle2 : mcParticles) { if (mcParticle2.pdgCode() != 310) continue; if (!mcParticle2.isPhysicalPrimary()) continue; + if (std::abs(mcParticle2.y()) > cfgyAcceptance) continue; - - int ipTBinK0S = 0; - for (int i = 0; i < nPtBinK0S; i++) { - if (pTBinK0S[i] < mcParticle1.pt() && mcParticle1.pt() <= pTBinK0S[i + 1]) { - ipTBinK0S = i; - break; - } - } - - if (!isCountedK0SInclusive[ipTBinK0S]) { - PhieffHist.fill(HIST("h2PhieffK0SGenMCInclusive"), imultBin, ipTBinK0S); + if (!isCountedK0S.at(0)) { + PhieffHist.fill(HIST("h2PhieffK0SGenMCInc"), genmultiplicity, mcParticle2.pt()); if (isAssocColl) - PhieffHist.fill(HIST("h2PhieffK0SGenMCFirstCutAssocReco"), imultBin, ipTBinK0S); - isCountedK0SInclusive[ipTBinK0S] = true; + PhieffHist.fill(HIST("h2PhieffK0SGenMCFCutAssocReco"), genmultiplicity, mcParticle2.pt()); + isCountedK0S.at(0) = true; } if (std::abs(mcParticle1.y() - mcParticle2.y()) > cfgFirstCutonDeltay) continue; - if (!isCountedK0SFirstCut[ipTBinK0S]) { - PhieffHist.fill(HIST("h2PhieffK0SGenMCFirstCut"), imultBin, ipTBinK0S); + if (!isCountedK0S.at(1)) { + PhieffHist.fill(HIST("h2PhieffK0SGenMCFCut"), genmultiplicity, mcParticle2.pt()); if (isAssocColl) - PhieffHist.fill(HIST("h2PhieffK0SGenMCFirstCutAssocReco"), imultBin, ipTBinK0S); - isCountedK0SFirstCut[ipTBinK0S] = true; + PhieffHist.fill(HIST("h2PhieffK0SGenMCFCutAssocReco"), genmultiplicity, mcParticle2.pt()); + isCountedK0S.at(1) = true; } if (std::abs(mcParticle1.y() - mcParticle2.y()) > cfgSecondCutonDeltay) continue; - if (!isCountedK0SSecondCut[ipTBinK0S]) { - PhieffHist.fill(HIST("h2PhieffK0SGenMCSecondCut"), imultBin, ipTBinK0S); + if (!isCountedK0S.at(2)) { + PhieffHist.fill(HIST("h2PhieffK0SGenMCSCut"), genmultiplicity, mcParticle2.pt()); if (isAssocColl) - PhieffHist.fill(HIST("h2PhieffK0SGenMCSecondCutAssocReco"), imultBin, ipTBinK0S); - isCountedK0SSecondCut[ipTBinK0S] = true; + PhieffHist.fill(HIST("h2PhieffK0SGenMCSCutAssocReco"), genmultiplicity, mcParticle2.pt()); + isCountedK0S.at(2) = true; } } - bool isCountedPiInclusive[nPtBinPi] = {false}, isCountedPiFirstCut[nPtBinPi] = {false}, isCountedPiSecondCut[nPtBinPi] = {false}; + std::array isCountedPi = {false, false, false}; for (auto mcParticle2 : mcParticles) { if (std::abs(mcParticle2.pdgCode()) != 211) continue; if (!mcParticle2.isPhysicalPrimary()) continue; + if (std::abs(mcParticle2.y()) > cfgyAcceptance) continue; - - int ipTBinPi = 0; - for (int i = 0; i < nPtBinPi; i++) { - if (pTBinPi[i] < mcParticle1.pt() && mcParticle1.pt() <= pTBinPi[i + 1]) { - ipTBinPi = i; - break; - } - } - - if (!isCountedPiInclusive[ipTBinPi]) { - PhieffHist.fill(HIST("h2PhieffPiGenMCInclusive"), imultBin, ipTBinPi); + if (!isCountedPi.at(0)) { + PhieffHist.fill(HIST("h2PhieffPiGenMCInc"), genmultiplicity, mcParticle2.pt()); if (isAssocColl) - PhieffHist.fill(HIST("h2PhieffPiGenMCInclusiveAssocReco"), imultBin, ipTBinPi); - isCountedPiInclusive[ipTBinPi] = true; + PhieffHist.fill(HIST("h2PhieffPiGenMCIncAssocReco"), genmultiplicity, mcParticle2.pt()); + isCountedPi.at(0) = true; } if (std::abs(mcParticle1.y() - mcParticle2.y()) > cfgFirstCutonDeltay) continue; - if (!isCountedPiFirstCut[ipTBinPi]) { - PhieffHist.fill(HIST("h2PhieffPiGenMCFirstCut"), imultBin, ipTBinPi); + if (!isCountedPi.at(1)) { + PhieffHist.fill(HIST("h2PhieffPiGenMCFCut"), genmultiplicity, mcParticle2.pt()); if (isAssocColl) - PhieffHist.fill(HIST("h2PhieffPiGenMCFirstCutAssocReco"), imultBin, ipTBinPi); - isCountedPiFirstCut[ipTBinPi] = true; + PhieffHist.fill(HIST("h2PhieffPiGenMCFCutAssocReco"), genmultiplicity, mcParticle2.pt()); + isCountedPi.at(1) = true; } if (std::abs(mcParticle1.y() - mcParticle2.y()) > cfgSecondCutonDeltay) continue; - if (!isCountedPiSecondCut[ipTBinPi]) { - PhieffHist.fill(HIST("h2PhieffPiGenMCSecondCut"), imultBin, ipTBinPi); + if (!isCountedPi.at(2)) { + PhieffHist.fill(HIST("h2PhieffPiGenMCSCut"), genmultiplicity, mcParticle2.pt()); if (isAssocColl) - PhieffHist.fill(HIST("h2PhieffPiGenMCSecondCutAssocReco"), imultBin, ipTBinPi); - isCountedPiSecondCut[ipTBinPi] = true; + PhieffHist.fill(HIST("h2PhieffPiGenMCSCutAssocReco"), genmultiplicity, mcParticle2.pt()); + isCountedPi.at(2) = true; } } } @@ -1810,8 +1708,8 @@ struct phik0shortanalysis { } } - float multiplicity = mcCollision.centFT0M(); - MCeventHist.fill(HIST("hGenMCMultiplicityPercent"), multiplicity); + float genmultiplicity = mcCollision.centFT0M(); + MCeventHist.fill(HIST("hGenMCMultiplicityPercent"), genmultiplicity); for (auto mcParticle1 : mcParticles) { if (mcParticle1.pdgCode() != 310) @@ -1833,11 +1731,9 @@ struct phik0shortanalysis { if (std::abs(mcParticle1.y()) > cfgyAcceptance) continue; - K0SeffHist.fill(HIST("h2K0SGenMC"), multiplicity, mcParticle1.pt()); + K0SeffHist.fill(HIST("h2K0SGenMC"), genmultiplicity, mcParticle1.pt()); - bool isCountedPhi = false; - - bool isCountedPhiInclusive = false, isCountedPhiFirstCut = false, isCountedPhiSecondCut = false; + std::array isCountedPhi = {false, false, false}; for (auto mcParticle2 : mcParticles) { if (mcParticle2.pdgCode() != 333) @@ -1854,35 +1750,31 @@ struct phik0shortanalysis { } if (!isPosKaon || !isNegKaon) continue; + if (std::abs(mcParticle2.y()) > cfgyAcceptance) continue; - - if (!isCountedPhi) { - yaccHist.fill(HIST("hyaccK0SGenMC"), multiplicity, mcParticle1.pt(), mcParticle1.y()); - isCountedPhi = true; - } - - if (!isCountedPhiInclusive) { - MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCInclusive"), multiplicity, mcParticle1.pt()); + if (!isCountedPhi.at(0)) { + yaccHist.fill(HIST("hyaccK0SGenMC"), genmultiplicity, mcParticle1.pt(), mcParticle1.y()); + MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCInc"), genmultiplicity, mcParticle1.pt()); if (isAssocColl) - MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCInclusiveAssocReco"), multiplicity, mcParticle1.pt()); - isCountedPhiInclusive = true; + MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCIncAssocReco"), genmultiplicity, mcParticle1.pt()); + isCountedPhi.at(0) = true; } if (std::abs(mcParticle1.y() - mcParticle2.y()) > cfgFirstCutonDeltay) continue; - if (!isCountedPhiFirstCut) { - MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCFirstCut"), multiplicity, mcParticle1.pt()); + if (!isCountedPhi.at(1)) { + MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCFCut"), genmultiplicity, mcParticle1.pt()); if (isAssocColl) - MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCFirstCutAssocReco"), multiplicity, mcParticle1.pt()); - isCountedPhiFirstCut = true; + MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCFCutAssocReco"), genmultiplicity, mcParticle1.pt()); + isCountedPhi.at(1) = true; } if (std::abs(mcParticle1.y() - mcParticle2.y()) > cfgSecondCutonDeltay) continue; - if (!isCountedPhiSecondCut) { - MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCSecondCut"), multiplicity, mcParticle1.pt()); + if (!isCountedPhi.at(2)) { + MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCSCut"), genmultiplicity, mcParticle1.pt()); if (isAssocColl) - MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCSecondCutAssocReco"), multiplicity, mcParticle1.pt()); - isCountedPhiSecondCut = true; + MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCSCutAssocReco"), genmultiplicity, mcParticle1.pt()); + isCountedPhi.at(2) = true; } } } @@ -1905,8 +1797,8 @@ struct phik0shortanalysis { } } - float multiplicity = mcCollision.centFT0M(); - MCeventHist.fill(HIST("hGenMCMultiplicityPercent"), multiplicity); + float genmultiplicity = mcCollision.centFT0M(); + MCeventHist.fill(HIST("hGenMCMultiplicityPercent"), genmultiplicity); for (auto mcParticle1 : mcParticles) { if (std::abs(mcParticle1.pdgCode()) != 211) @@ -1916,11 +1808,9 @@ struct phik0shortanalysis { if (std::abs(mcParticle1.y()) > cfgyAcceptance) continue; - PioneffHist.fill(HIST("h2PiGenMC"), multiplicity, mcParticle1.pt()); - - bool isCountedPhi = false; + PioneffHist.fill(HIST("h2PiGenMC"), genmultiplicity, mcParticle1.pt()); - bool isCountedPhiInclusive = false, isCountedPhiFirstCut = false, isCountedPhiSecondCut = false; + std::array isCountedPhi = {false, false, false}; for (auto mcParticle2 : mcParticles) { if (mcParticle2.pdgCode() != 333) @@ -1937,35 +1827,31 @@ struct phik0shortanalysis { } if (!isPosKaon || !isNegKaon) continue; + if (std::abs(mcParticle2.y()) > cfgyAcceptance) continue; - - if (!isCountedPhi) { - yaccHist.fill(HIST("hyaccPiGenMC"), multiplicity, mcParticle1.pt(), mcParticle1.y()); - isCountedPhi = true; - } - - if (!isCountedPhiInclusive) { - MCPhiPionHist.fill(HIST("h2PhiPiGenMCInclusive"), multiplicity, mcParticle1.pt()); + if (!isCountedPhi.at(0)) { + yaccHist.fill(HIST("hyaccPiGenMC"), genmultiplicity, mcParticle1.pt(), mcParticle1.y()); + MCPhiPionHist.fill(HIST("h2PhiPiGenMCInc"), genmultiplicity, mcParticle1.pt()); if (isAssocColl) - MCPhiPionHist.fill(HIST("h2PhiPiGenMCInclusiveAssocReco"), multiplicity, mcParticle1.pt()); - isCountedPhiInclusive = true; + MCPhiPionHist.fill(HIST("h2PhiPiGenMCIncAssocReco"), genmultiplicity, mcParticle1.pt()); + isCountedPhi.at(0) = true; } if (std::abs(mcParticle1.y() - mcParticle2.y()) > cfgFirstCutonDeltay) continue; - if (!isCountedPhiFirstCut) { - MCPhiPionHist.fill(HIST("h2PhiPiGenMCFirstCut"), multiplicity, mcParticle1.pt()); + if (!isCountedPhi.at(1)) { + MCPhiPionHist.fill(HIST("h2PhiPiGenMCFCut"), genmultiplicity, mcParticle1.pt()); if (isAssocColl) - MCPhiPionHist.fill(HIST("h2PhiPiGenMCFirstCutAssocReco"), multiplicity, mcParticle1.pt()); - isCountedPhiFirstCut = true; + MCPhiPionHist.fill(HIST("h2PhiPiGenMCFCutAssocReco"), genmultiplicity, mcParticle1.pt()); + isCountedPhi.at(1) = true; } if (std::abs(mcParticle1.y() - mcParticle2.y()) > cfgSecondCutonDeltay) continue; - if (!isCountedPhiSecondCut) { - MCPhiPionHist.fill(HIST("h2PhiPiGenMCSecondCut"), multiplicity, mcParticle1.pt()); + if (!isCountedPhi.at(2)) { + MCPhiPionHist.fill(HIST("h2PhiPiGenMCSCut"), genmultiplicity, mcParticle1.pt()); if (isAssocColl) - MCPhiPionHist.fill(HIST("h2PhiPiGenMCSecondCutAssocReco"), multiplicity, mcParticle1.pt()); - isCountedPhiSecondCut = true; + MCPhiPionHist.fill(HIST("h2PhiPiGenMCSCutAssocReco"), genmultiplicity, mcParticle1.pt()); + isCountedPhi.at(2) = true; } } } From 55b4d96e3796d074d3cabfe41d6dbb510042ee54 Mon Sep 17 00:00:00 2001 From: Suraj Prasad Date: Tue, 26 Nov 2024 20:04:17 +0530 Subject: [PATCH 096/459] [PWGLF] Fix maximum bin content reached in histograms (#8658) --- .../Strangeness/lambdak0sflattenicity.cxx | 192 +++++++++--------- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdak0sflattenicity.cxx b/PWGLF/Tasks/Strangeness/lambdak0sflattenicity.cxx index b0636238735..0b1d48aad85 100755 --- a/PWGLF/Tasks/Strangeness/lambdak0sflattenicity.cxx +++ b/PWGLF/Tasks/Strangeness/lambdak0sflattenicity.cxx @@ -205,9 +205,9 @@ struct lambdak0sflattenicity { // Histograms // Event selection rEventSelection.add("hVertexZ", "hVertexZ", - {HistType::kTH1F, {vertexZAxis}}); + {HistType::kTH1D, {vertexZAxis}}); rEventSelection.add("hEventsSelected", "hEventsSelected", - {HistType::kTH1I, {{12, 0, 12}}}); + {HistType::kTH1D, {{12, 0, 12}}}); rEventSelection.get(HIST("hEventsSelected"))->GetXaxis()->SetBinLabel(1, "all"); rEventSelection.get(HIST("hEventsSelected"))->GetXaxis()->SetBinLabel(2, "sel8"); @@ -222,34 +222,34 @@ struct lambdak0sflattenicity { rEventSelection.get(HIST("hEventsSelected"))->GetXaxis()->SetBinLabel(11, "Applied selection"); rEventSelection.add("hFlattenicityDistribution", "hFlattenicityDistribution", - {HistType::kTH1F, {flatAxis}}); + {HistType::kTH1D, {flatAxis}}); if (doprocessRecMC) { rEventSelection.add("hFlattenicityDistributionMCGen_Rec", "hFlattenicityDistributionMCGen_Rec", - {HistType::kTH1F, {flatAxis}}); + {HistType::kTH1D, {flatAxis}}); rEventSelection.add("hFlattenicity_Corr_Gen_vs_Rec", "hFlattenicity_Corr_Gen_vs_Rec", - {HistType::kTH2F, {flatAxis, flatAxis}}); + {HistType::kTH2D, {flatAxis, flatAxis}}); } if (doprocessGenMC) { rEventSelection.add("hVertexZGen", "hVertexZGen", - {HistType::kTH1F, {vertexZAxis}}); + {HistType::kTH1D, {vertexZAxis}}); rEventSelection.add("hFlattenicityDistributionMCGen", "hFlattenicityDistributionMCGen", - {HistType::kTH1F, {flatAxis}}); - - rEventSelection.add("hFlat_RecoColl_MC", "hFlat_RecoColl_MC", {HistType::kTH1F, {flatAxis}}); - rEventSelection.add("hFlat_RecoColl_MC_INELgt0", "hFlat_RecoColl_MC_INELgt0", {HistType::kTH1F, {flatAxis}}); - rEventSelection.add("hFlat_GenRecoColl_MC", "hFlat_GenRecoColl_MC", {HistType::kTH1F, {flatAxis}}); - rEventSelection.add("hFlat_GenRecoColl_MC_INELgt0", "hFlat_GenRecoColl_MC_INELgt0", {HistType::kTH1F, {flatAxis}}); - rEventSelection.add("hFlat_GenColl_MC", "hFlat_GenColl_MC", {HistType::kTH1F, {flatAxis}}); - rEventSelection.add("hFlat_GenColl_MC_INELgt0", "hFlat_GenColl_MC_INELgt0", {HistType::kTH1F, {flatAxis}}); - rEventSelection.add("hNEventsMCGen", "hNEventsMCGen", {HistType::kTH1I, {{4, 0.f, 4.f}}}); + {HistType::kTH1D, {flatAxis}}); + + rEventSelection.add("hFlat_RecoColl_MC", "hFlat_RecoColl_MC", {HistType::kTH1D, {flatAxis}}); + rEventSelection.add("hFlat_RecoColl_MC_INELgt0", "hFlat_RecoColl_MC_INELgt0", {HistType::kTH1D, {flatAxis}}); + rEventSelection.add("hFlat_GenRecoColl_MC", "hFlat_GenRecoColl_MC", {HistType::kTH1D, {flatAxis}}); + rEventSelection.add("hFlat_GenRecoColl_MC_INELgt0", "hFlat_GenRecoColl_MC_INELgt0", {HistType::kTH1D, {flatAxis}}); + rEventSelection.add("hFlat_GenColl_MC", "hFlat_GenColl_MC", {HistType::kTH1D, {flatAxis}}); + rEventSelection.add("hFlat_GenColl_MC_INELgt0", "hFlat_GenColl_MC_INELgt0", {HistType::kTH1D, {flatAxis}}); + rEventSelection.add("hNEventsMCGen", "hNEventsMCGen", {HistType::kTH1D, {{4, 0.f, 4.f}}}); rEventSelection.get(HIST("hNEventsMCGen"))->GetXaxis()->SetBinLabel(1, "all"); rEventSelection.get(HIST("hNEventsMCGen"))->GetXaxis()->SetBinLabel(2, "zvertex_true"); rEventSelection.get(HIST("hNEventsMCGen"))->GetXaxis()->SetBinLabel(3, "INELgt0_true"); - rEventSelection.add("hNEventsMCGenReco", "hNEventsMCGenReco", {HistType::kTH1I, {{2, 0.f, 2.f}}}); + rEventSelection.add("hNEventsMCGenReco", "hNEventsMCGenReco", {HistType::kTH1D, {{2, 0.f, 2.f}}}); rEventSelection.get(HIST("hNEventsMCGenReco"))->GetXaxis()->SetBinLabel(1, "INEL"); rEventSelection.get(HIST("hNEventsMCGenReco"))->GetXaxis()->SetBinLabel(2, "INELgt0"); - rEventSelection.add("hNEventsMCReco", "hNEventsMCReco", {HistType::kTH1I, {{4, 0.f, 4.f}}}); + rEventSelection.add("hNEventsMCReco", "hNEventsMCReco", {HistType::kTH1D, {{4, 0.f, 4.f}}}); rEventSelection.get(HIST("hNEventsMCReco"))->GetXaxis()->SetBinLabel(1, "all"); rEventSelection.get(HIST("hNEventsMCReco"))->GetXaxis()->SetBinLabel(2, "pass ev sel"); rEventSelection.get(HIST("hNEventsMCReco"))->GetXaxis()->SetBinLabel(3, "INELgt0"); @@ -257,165 +257,165 @@ struct lambdak0sflattenicity { } // K0s reconstruction // Mass - rKzeroShort.add("hMassK0s", "hMassK0s", {HistType::kTH1F, {K0sMassAxis}}); + rKzeroShort.add("hMassK0s", "hMassK0s", {HistType::kTH1D, {K0sMassAxis}}); rKzeroShort.add("hMassK0sSelected", "hMassK0sSelected", - {HistType::kTH1F, {K0sMassAxis}}); + {HistType::kTH1D, {K0sMassAxis}}); // K0s topological/PID cuts rKzeroShort.add("hrapidityK0s", "hrapidityK0s", - {HistType::kTH1F, {{40, -2.0f, 2.0f, "y"}}}); + {HistType::kTH1D, {{40, -2.0f, 2.0f, "y"}}}); rKzeroShort.add("hctauK0s", "hctauK0s", - {HistType::kTH1F, {{40, 0.0f, 40.0f, "c#tau (cm)"}}}); + {HistType::kTH1D, {{40, 0.0f, 40.0f, "c#tau (cm)"}}}); rKzeroShort.add( "h2DdecayRadiusK0s", "h2DdecayRadiusK0s", - {HistType::kTH1F, {{100, 0.0f, 1.0f, "Decay Radius (cm)"}}}); + {HistType::kTH1D, {{100, 0.0f, 1.0f, "Decay Radius (cm)"}}}); rKzeroShort.add("hDCAV0DaughtersK0s", "hDCAV0DaughtersK0s", - {HistType::kTH1F, {{55, 0.0f, 2.2f, "DCA Daughters"}}}); + {HistType::kTH1D, {{55, 0.0f, 2.2f, "DCA Daughters"}}}); rKzeroShort.add("hV0CosPAK0s", "hV0CosPAK0s", - {HistType::kTH1F, {{100, 0.95f, 1.f, "CosPA"}}}); + {HistType::kTH1D, {{100, 0.95f, 1.f, "CosPA"}}}); rKzeroShort.add("hNSigmaPosPionFromK0s", "hNSigmaPosPionFromK0s", - {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}); + {HistType::kTH2D, {{100, -5.f, 5.f}, {ptAxis}}}); rKzeroShort.add("hNSigmaNegPionFromK0s", "hNSigmaNegPionFromK0s", - {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}); + {HistType::kTH2D, {{100, -5.f, 5.f}, {ptAxis}}}); rKzeroShort.add("hMassK0spT", "hMassK0spT", - {HistType::kTH2F, {{K0sMassAxis}, {ptAxis}}}); + {HistType::kTH2D, {{K0sMassAxis}, {ptAxis}}}); rKzeroShort.add("hMassK0spTFlat", "hMassK0spTFlat", - {HistType::kTH3F, {{K0sMassAxis}, {ptAxis}, {flatAxis}}}); + {HistType::kTH3D, {{K0sMassAxis}, {ptAxis}, {flatAxis}}}); if (doprocessRecMC) { rKzeroShort.add("Generated_MCRecoCollCheck_INEL_K0Short", "Generated_MCRecoCollCheck_INEL_K0Short", - {HistType::kTH2F, {{ptAxis}, {flatAxis}}}); + {HistType::kTH2D, {{ptAxis}, {flatAxis}}}); } if (doprocessGenMC) { rKzeroShort.add("pGen_MCGenRecoColl_INEL_K0Short", "pGen_MCGenRecoColl_INEL_K0Short", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rKzeroShort.add("Generated_MCRecoColl_INEL_K0Short", "Generated_MCRecoColl_INEL_K0Short", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rKzeroShort.add("pGen_MCGenColl_INEL_K0Short", "pGen_MCGenColl_INEL_K0Short", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rKzeroShort.add("pGen_MCGenRecoColl_INELgt0_K0Short", "pGen_MCGenRecoColl_INELgt0_K0Short", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rKzeroShort.add("Generated_MCRecoColl_INELgt0_K0Short", "Generated_MCRecoColl_INELgt0_K0Short", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rKzeroShort.add("Generated_MCRecoCollCheck_INELgt0_K0Short", "Generated_MCRecoCollCheck_INELgt0_K0Short", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rKzeroShort.add("pGen_MCGenColl_INELgt0_K0Short", "pGen_MCGenColl_INELgt0_K0Short", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); } // Lambda reconstruction Mass rLambda.add("hMassLambda", "hMassLambda", - {HistType::kTH1F, {LambdaMassAxis}}); + {HistType::kTH1D, {LambdaMassAxis}}); rLambda.add("hMassLambdaSelected", "hMassLambdaSelected", - {HistType::kTH1F, {LambdaMassAxis}}); + {HistType::kTH1D, {LambdaMassAxis}}); // Lambda topological/PID cuts rLambda.add("hDCAV0DaughtersLambda", "hDCAV0DaughtersLambda", - {HistType::kTH1F, {{55, 0.0f, 2.2f, "DCA Daughters"}}}); + {HistType::kTH1D, {{55, 0.0f, 2.2f, "DCA Daughters"}}}); rLambda.add("hV0CosPALambda", "hV0CosPALambda", - {HistType::kTH1F, {{100, 0.95f, 1.f, "CosPA"}}}); + {HistType::kTH1D, {{100, 0.95f, 1.f, "CosPA"}}}); rLambda.add("hNSigmaPosPionFromLambda", "hNSigmaPosPionFromLambda", - {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}); + {HistType::kTH2D, {{100, -5.f, 5.f}, {ptAxis}}}); rLambda.add("hNSigmaNegPionFromLambda", "hNSigmaNegPionFromLambda", - {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}); + {HistType::kTH2D, {{100, -5.f, 5.f}, {ptAxis}}}); rLambda.add("hrapidityLambda", "hrapidityLambda", - {HistType::kTH1F, {{40, -2.0f, 2.0f, "y"}}}); + {HistType::kTH1D, {{40, -2.0f, 2.0f, "y"}}}); rLambda.add("hctauLambda", "hctauLambda", - {HistType::kTH1F, {{40, 0.0f, 40.0f, "c#tau (cm)"}}}); + {HistType::kTH1D, {{40, 0.0f, 40.0f, "c#tau (cm)"}}}); rLambda.add("h2DdecayRadiusLambda", "h2DdecayRadiusLambda", - {HistType::kTH1F, {{100, 0.0f, 1.0f, "c#tau (cm)"}}}); + {HistType::kTH1D, {{100, 0.0f, 1.0f, "c#tau (cm)"}}}); rLambda.add("hMassLambdapT", "hMassLambdapT", - {HistType::kTH2F, {{LambdaMassAxis}, {ptAxis}}}); + {HistType::kTH2D, {{LambdaMassAxis}, {ptAxis}}}); rLambda.add("hMassLambdapTFlat", "hMassLambdapTFlat", - {HistType::kTH3F, {{LambdaMassAxis}, {ptAxis}, {flatAxis}}}); + {HistType::kTH3D, {{LambdaMassAxis}, {ptAxis}, {flatAxis}}}); if (doprocessRecMC) { rLambda.add("Generated_MCRecoCollCheck_INEL_Lambda", "Generated_MCRecoCollCheck_INEL_Lambda", - {HistType::kTH2F, {{ptAxis}, {flatAxis}}}); + {HistType::kTH2D, {{ptAxis}, {flatAxis}}}); } if (doprocessGenMC) { rLambda.add("pGen_MCGenRecoColl_INEL_Lambda", "pGen_MCGenRecoColl_INEL_Lambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rLambda.add("Generated_MCRecoColl_INEL_Lambda", "Generated_MCRecoColl_INEL_Lambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rLambda.add("pGen_MCGenColl_INEL_Lambda", "pGen_MCGenColl_INEL_Lambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rLambda.add("pGen_MCGenRecoColl_INELgt0_Lambda", "pGen_MCGenRecoColl_INELgt0_Lambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rLambda.add("Generated_MCRecoColl_INELgt0_Lambda", "Generated_MCRecoColl_INELgt0_Lambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rLambda.add("Generated_MCRecoCollCheck_INELgt0_Lambda", "Generated_MCRecoCollCheck_INELgt0_Lambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rLambda.add("pGen_MCGenColl_INELgt0_Lambda", "pGen_MCGenColl_INELgt0_Lambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); } // AntiLambda reconstruction // Mass rAntiLambda.add("hMassAntiLambda", "hMassAntiLambda", - {HistType::kTH1F, {AntiLambdaMassAxis}}); + {HistType::kTH1D, {AntiLambdaMassAxis}}); rAntiLambda.add("hMassAntiLambdaSelected", "hMassAntiLambdaSelected", - {HistType::kTH1F, {AntiLambdaMassAxis}}); + {HistType::kTH1D, {AntiLambdaMassAxis}}); // AntiLambda topological/PID cuts rAntiLambda.add("hDCAV0DaughtersAntiLambda", "hDCAV0DaughtersAntiLambda", - {HistType::kTH1F, {{55, 0.0f, 2.2f, "DCA Daughters"}}}); + {HistType::kTH1D, {{55, 0.0f, 2.2f, "DCA Daughters"}}}); rAntiLambda.add("hV0CosPAAntiLambda", "hV0CosPAAntiLambda", - {HistType::kTH1F, {{100, 0.95f, 1.f, "CosPA"}}}); + {HistType::kTH1D, {{100, 0.95f, 1.f, "CosPA"}}}); rAntiLambda.add("hNSigmaPosPionFromAntiLambda", "hNSigmaPosPionFromAntiLambda", - {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}); + {HistType::kTH2D, {{100, -5.f, 5.f}, {ptAxis}}}); rAntiLambda.add("hNSigmaNegPionFromAntiLambda", "hNSigmaNegPionFromAntiLambda", - {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}); + {HistType::kTH2D, {{100, -5.f, 5.f}, {ptAxis}}}); rAntiLambda.add("hrapidityAntiLambda", "hrapidityAntiLambda", - {HistType::kTH1F, {{40, -2.0f, 2.0f, "y"}}}); + {HistType::kTH1D, {{40, -2.0f, 2.0f, "y"}}}); rAntiLambda.add("hctauAntiLambda", "hctauAntiLambda", - {HistType::kTH1F, {{40, 0.0f, 40.0f, "c#tau (cm)"}}}); + {HistType::kTH1D, {{40, 0.0f, 40.0f, "c#tau (cm)"}}}); rAntiLambda.add("h2DdecayRadiusAntiLambda", "h2DdecayRadiusAntiLambda", - {HistType::kTH1F, {{100, 0.0f, 1.0f, "c#tau (cm)"}}}); + {HistType::kTH1D, {{100, 0.0f, 1.0f, "c#tau (cm)"}}}); rAntiLambda.add("hMassAntiLambdapT", "hMassAntiLambdapT", - {HistType::kTH2F, {{AntiLambdaMassAxis}, {ptAxis}}}); + {HistType::kTH2D, {{AntiLambdaMassAxis}, {ptAxis}}}); rAntiLambda.add("hMassAntiLambdapTFlat", "hMassAntiLambdapTFlat", - {HistType::kTH3F, {{AntiLambdaMassAxis}, {ptAxis}, {flatAxis}}}); + {HistType::kTH3D, {{AntiLambdaMassAxis}, {ptAxis}, {flatAxis}}}); if (doprocessRecMC) { rAntiLambda.add("Generated_MCRecoCollCheck_INEL_AntiLambda", "Generated_MCRecoCollCheck_INEL_AntiLambda", - {HistType::kTH2F, {{ptAxis}, {flatAxis}}}); + {HistType::kTH2D, {{ptAxis}, {flatAxis}}}); } if (doprocessGenMC) { rAntiLambda.add("pGen_MCGenRecoColl_INEL_AntiLambda", "pGen_MCGenRecoColl_INEL_AntiLambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rAntiLambda.add("Generated_MCRecoColl_INEL_AntiLambda", "Generated_MCRecoColl_INEL_AntiLambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rAntiLambda.add("pGen_MCGenColl_INEL_AntiLambda", "pGen_MCGenColl_INEL_AntiLambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rAntiLambda.add("pGen_MCGenRecoColl_INELgt0_AntiLambda", "pGen_MCGenRecoColl_INELgt0_AntiLambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rAntiLambda.add("Generated_MCRecoColl_INELgt0_AntiLambda", "Generated_MCRecoColl_INELgt0_AntiLambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rAntiLambda.add("Generated_MCRecoCollCheck_INELgt0_AntiLambda", "Generated_MCRecoCollCheck_INELgt0_AntiLambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); rAntiLambda.add("pGen_MCGenColl_INELgt0_AntiLambda", "pGen_MCGenColl_INELgt0_AntiLambda", - {HistType::kTH2F, {ptAxis, flatAxis}}); + {HistType::kTH2D, {ptAxis, flatAxis}}); } if (flattenicityQA) { - rFlattenicity.add("hEv", "Ev", HistType::kTH1F, + rFlattenicity.add("hEv", "Ev", HistType::kTH1D, {{6, -0.5, 5.5, "index activated detector"}}); - rFlattenicity.add("hFV0amplRing1to4", "FV01to4", HistType::kTH1F, + rFlattenicity.add("hFV0amplRing1to4", "FV01to4", HistType::kTH1D, {{4000, -0.5, +49999.5, "FV0 amplitude"}}); - rFlattenicity.add("hFT0Aampl", "FTAampl", HistType::kTH1F, + rFlattenicity.add("hFT0Aampl", "FTAampl", HistType::kTH1D, {{50000, -0.5, +199999.5, "FT0A amplitude"}}); - rFlattenicity.add("hFT0Campl", "FTCampl", HistType::kTH1F, + rFlattenicity.add("hFT0Campl", "FTCampl", HistType::kTH1D, {{10000, -0.5, +4999.5, "FT0C amplitude"}}); - rFlattenicity.add("hFT0C", "FT0C", HistType::kTH1F, + rFlattenicity.add("hFT0C", "FT0C", HistType::kTH1D, {{50000, -0.5, 199999.5, "FT0C amplitudes"}}); - rFlattenicity.add("hFT0A", "FT0A", HistType::kTH1F, + rFlattenicity.add("hFT0A", "FT0A", HistType::kTH1D, {{2000, -0.5, 1999.5, "FT0A amplitudes"}}); // estimators for (int i_e = 0; i_e < 8; ++i_e) { rFlattenicity.add( - nhEst[i_e].data(), "", HistType::kTH2F, + nhEst[i_e].data(), "", HistType::kTH2D, {{nBinsEst[i_e], lowEdgeEst[i_e], upEdgeEst[i_e], tEst[i_e].data()}, {100, -0.5, +99.5, "Global track"}}); } @@ -427,54 +427,54 @@ struct lambdak0sflattenicity { {{nBinsEst[i_e], lowEdgeEst[i_e], upEdgeEst[i_e], tEst[i_e].data()}}); } - rFlattenicity.add("fMultFv0", "FV0 amp", HistType::kTH1F, + rFlattenicity.add("fMultFv0", "FV0 amp", HistType::kTH1D, {{5000, -0.5, +199999.5, "FV0 amplitude"}}); rFlattenicity.add( - "hAmpV0VsCh", "", HistType::kTH2F, + "hAmpV0VsCh", "", HistType::kTH2D, {{48, -0.5, 47.5, "channel"}, {500, -0.5, +19999.5, "FV0 amplitude"}}); rFlattenicity.add( - "hAmpV0VsChBeforeCalibration", "", HistType::kTH2F, + "hAmpV0VsChBeforeCalibration", "", HistType::kTH2D, {{48, -0.5, 47.5, "channel"}, {500, -0.5, +19999.5, "FV0 amplitude"}}); rFlattenicity.add( - "hAmpT0AVsChBeforeCalibration", "", HistType::kTH2F, + "hAmpT0AVsChBeforeCalibration", "", HistType::kTH2D, {{24, -0.5, 23.5, "channel"}, {600, -0.5, +5999.5, "FT0A amplitude"}}); rFlattenicity.add( - "hAmpT0CVsChBeforeCalibration", "", HistType::kTH2F, + "hAmpT0CVsChBeforeCalibration", "", HistType::kTH2D, {{28, -0.5, 27.5, "channel"}, {600, -0.5, +5999.5, "FT0C amplitude"}}); rFlattenicity.add( - "hAmpT0AVsCh", "", HistType::kTH2F, + "hAmpT0AVsCh", "", HistType::kTH2D, {{24, -0.5, 23.5, "channel"}, {600, -0.5, +5999.5, "FT0A amplitude"}}); rFlattenicity.add( - "hAmpT0CVsCh", "", HistType::kTH2F, + "hAmpT0CVsCh", "", HistType::kTH2D, {{28, -0.5, 27.5, "channel"}, {600, -0.5, +5999.5, "FT0C amplitude"}}); - rFlattenicity.add("hFlatFT0CvsFlatFT0A", "", HistType::kTH2F, + rFlattenicity.add("hFlatFT0CvsFlatFT0A", "", HistType::kTH2D, {{20, -0.01, +1.01, "flatenicity (FT0C)"}, {20, -0.01, +1.01, "flatenicity (FT0A)"}}); rFlattenicity.add( - "fEtaPhiFv0", "eta vs phi", HistType::kTH2F, + "fEtaPhiFv0", "eta vs phi", HistType::kTH2D, {{8, 0.0, 2 * M_PI, "#phi (rad)"}, {5, 2.2, 5.1, "#eta"}}); - rFlattenicity.add("hAmpV0vsVtxBeforeCalibration", "", HistType::kTH2F, + rFlattenicity.add("hAmpV0vsVtxBeforeCalibration", "", HistType::kTH2D, {{30, -15.0, +15.0, "Trk mult"}, {1000, -0.5, +39999.5, "FV0 amplitude"}}); rFlattenicity.add( - "hAmpT0AvsVtxBeforeCalibration", "", HistType::kTH2F, + "hAmpT0AvsVtxBeforeCalibration", "", HistType::kTH2D, {{30, -15.0, +15.0, "Vtx_z"}, {600, -0.5, +5999.5, "FT0A amplitude"}}); rFlattenicity.add( - "hAmpT0CvsVtxBeforeCalibration", "", HistType::kTH2F, + "hAmpT0CvsVtxBeforeCalibration", "", HistType::kTH2D, {{30, -15.0, +15.0, "Vtx_z"}, {600, -0.5, +5999.5, "FT0C amplitude"}}); - rFlattenicity.add("hAmpV0vsVtx", "", HistType::kTH2F, + rFlattenicity.add("hAmpV0vsVtx", "", HistType::kTH2D, {{30, -15.0, +15.0, "Trk mult"}, {1000, -0.5, +39999.5, "FV0 amplitude"}}); rFlattenicity.add( - "hAmpT0AvsVtx", "", HistType::kTH2F, + "hAmpT0AvsVtx", "", HistType::kTH2D, {{30, -15.0, +15.0, "Vtx_z"}, {600, -0.5, +5999.5, "FT0A amplitude"}}); rFlattenicity.add( - "hAmpT0CvsVtx", "", HistType::kTH2F, + "hAmpT0CvsVtx", "", HistType::kTH2D, {{30, -15.0, +15.0, "Vtx_z"}, {600, -0.5, +5999.5, "FT0C amplitude"}}); } if (doprocessDataRun3 && (doprocessRecMC || doprocessGenMC)) { From d3bafe0e20de6114ee71fe841b3d182b496fb7a2 Mon Sep 17 00:00:00 2001 From: Marta Urioni <78807256+murioni@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:34:31 +0100 Subject: [PATCH 097/459] [PWGLF] Implementing a Run2 analysis functionality on the K892 PbPb analysis (#8640) --- PWGLF/Tasks/Resonances/k892analysis_PbPb.cxx | 258 +++++++++++++++++-- 1 file changed, 238 insertions(+), 20 deletions(-) diff --git a/PWGLF/Tasks/Resonances/k892analysis_PbPb.cxx b/PWGLF/Tasks/Resonances/k892analysis_PbPb.cxx index 200a3340e6b..aeefe798b82 100644 --- a/PWGLF/Tasks/Resonances/k892analysis_PbPb.cxx +++ b/PWGLF/Tasks/Resonances/k892analysis_PbPb.cxx @@ -71,7 +71,7 @@ struct k892analysis_PbPb { // events Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; Configurable timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"}; - Configurable additionalEvSel2{"additionalEvSel2", true, "Additional evsel2"}; + Configurable additionalEvSel2{"additionalEvSel2", true, "NoSameBunchPileUp and IsGoodZvtxFT0vsPV"}; Configurable additionalEvSel3{"additionalEvSel3", false, "Additional evsel3"}; // presel @@ -136,7 +136,7 @@ struct k892analysis_PbPb { AxisSpec invMassAxis = {cInvMassBins, cInvMassStart, cInvMassEnd, "Invariant Mass (GeV/#it{c}^2)"}; AxisSpec pidQAAxis = {cPIDBins, -cPIDQALimit, cPIDQALimit}; - if (doprocessSameEvent || doprocessMixedEvent) { + if (doprocessSameEvent || doprocessSameEventRun2 || doprocessMixedEvent || doprocessMixedEventRun2) { // event histograms histos.add("QAevent/hEvtCounterSameE", "Number of analyzed Same Events", HistType::kTH1F, {{1, 0.5, 1.5}}); histos.add("QAevent/hMultiplicityPercentSameE", "Multiplicity percentile of collision", HistType::kTH1F, {{120, 0.0f, 120.0f}}); @@ -163,7 +163,7 @@ struct k892analysis_PbPb { histos.add("k892invmassDSAnti", "Invariant mass of Anti-K(892)0 different sign", kTH1F, {invMassAxis}); histos.add("k892invmassLS", "Invariant mass of K(892)0 like sign", kTH1F, {invMassAxis}); histos.add("k892invmassLSAnti", "Invariant mass of Anti-K(892)0 like sign", kTH1F, {invMassAxis}); - if (doprocessMixedEvent) { + if (doprocessMixedEvent || doprocessMixedEventRun2) { histos.add("k892invmassME", "Invariant mass of K(892)0 mixed event", kTH1F, {invMassAxis}); if (additionalMEPlots) { histos.add("k892invmassME_DS", "Invariant mass of K(892)0 mixed event DS", kTH1F, {invMassAxis}); @@ -200,7 +200,7 @@ struct k892analysis_PbPb { histos.add("h3k892invmassDSAnti", "Invariant mass of Anti-K(892)0 differnt sign", kTH3F, {centAxis, ptAxis, invMassAxis}); histos.add("h3k892invmassLS", "Invariant mass of K(892)0 same sign", kTH3F, {centAxis, ptAxis, invMassAxis}); histos.add("h3k892invmassLSAnti", "Invariant mass of Anti-K(892)0 same sign", kTH3F, {centAxis, ptAxis, invMassAxis}); - if (doprocessMixedEvent) { + if (doprocessMixedEvent || doprocessMixedEventRun2) { histos.add("h3k892invmassME", "Invariant mass of K(892)0 mixed event", kTH3F, {centAxis, ptAxis, invMassAxis}); if (additionalMEPlots) { @@ -216,7 +216,7 @@ struct k892analysis_PbPb { } } - if (doprocessMC) { + if (doprocessMC || doprocessMCRun2) { histos.add("hMCrecCollSels", "MC Event statistics", HistType::kTH1F, {{10, 0.0f, 10.0f}}); histos.add("QAevent/hMultiplicityPercentMC", "Multiplicity percentile of MCrec collision", HistType::kTH1F, {{120, 0.0f, 120.0f}}); @@ -333,11 +333,16 @@ struct k892analysis_PbPb { return false; } - template + template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksType& dTracks2) { - auto multiplicity = collision.centFT0C(); + auto multiplicity = -999; + + if constexpr (!IsRun2) + multiplicity = collision.centFT0C(); + else + multiplicity = collision.centRun2V0M(); auto oldindex = -999; TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; @@ -545,8 +550,8 @@ struct k892analysis_PbPb { } // end of loop on tracks combinations } // ennd on fill histograms - Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; - Filter centralityFilter = nabs(aod::cent::centFT0C) < cfgCutCentrality; + Filter collisionFilter = nabs(aod::collision::posZ) <= cfgCutVertex; + Filter centralityFilter = nabs(aod::cent::centFT0C) <= cfgCutCentrality; Filter acceptanceFilter = (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT); Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); @@ -599,29 +604,93 @@ struct k892analysis_PbPb { auto candPosPitpc = posPitpc->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); auto candNegKatpc = negKatpc->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - fillHistograms(collision, candPosPitpc, candNegKatpc); + fillHistograms(collision, candPosPitpc, candNegKatpc); //-+ auto candNegPitpc = negPitpc->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); auto candPosKatpc = posKatpc->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - fillHistograms(collision, candNegPitpc, candPosKatpc); + fillHistograms(collision, candNegPitpc, candPosKatpc); } else if (tofhighpt) { //+- auto candPosPitof = posPitof->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); auto candNegKatof = negKatof->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - fillHistograms(collision, candPosPitof, candNegKatof); + fillHistograms(collision, candPosPitof, candNegKatof); //-+ auto candNegPitof = negPitof->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); auto candPosKatof = posKatof->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - fillHistograms(collision, candNegPitof, candPosKatof); + fillHistograms(collision, candNegPitof, candPosKatof); } } - PROCESS_SWITCH(k892analysis_PbPb, processSameEvent, "Process Same event TOF High Pt", false); + PROCESS_SWITCH(k892analysis_PbPb, processSameEvent, "Process Same event", false); + + ///////*************************************** + + using Run2Events = soa::Join; //, aod::TrackletMults>; + using BCsWithRun2Info = soa::Join; + + void processSameEventRun2(Run2Events::iterator const& collision, TrackCandidates const& tracks, BCsWithRun2Info const&) + { + auto bc = collision.bc_as(); + + // if (!collision.alias_bit(kINT7)) + // return; + + // if (!collision.sel7()) + // return; + + if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) + return; + + if (std::abs(collision.posZ()) > cfgCutVertex) + return; + + auto centrality = collision.centRun2V0M(); + + if (centrality > cfgCutCentrality) + return; + + histos.fill(HIST("QAevent/hEvtCounterSameE"), 1); + histos.fill(HIST("QAevent/hVertexZSameE"), collision.posZ()); + histos.fill(HIST("QAevent/hMultiplicityPercentSameE"), centrality); + + if (additionalQAeventPlots) { + histos.fill(HIST("TestME/hCollisionIndexSameE"), collision.globalIndex()); + histos.fill(HIST("TestME/hnTrksSameE"), tracks.size()); + } + + if (tpclowpt) { + //+- + auto candPosPitpc = posPitpc->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto candNegKatpc = negKatpc->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + + fillHistograms(collision, candPosPitpc, candNegKatpc); + + //-+ + auto candNegPitpc = negPitpc->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto candPosKatpc = posKatpc->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + + fillHistograms(collision, candNegPitpc, candPosKatpc); + + } else if (tofhighpt) { + //+- + auto candPosPitof = posPitof->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto candNegKatof = negKatof->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + + fillHistograms(collision, candPosPitof, candNegKatof); + + //-+ + auto candNegPitof = negPitof->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto candPosKatof = posKatof->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + + fillHistograms(collision, candNegPitof, candPosKatof); + } + } + PROCESS_SWITCH(k892analysis_PbPb, processSameEventRun2, "Process Same event Run2", false); using BinningTypeVtxCent = ColumnBinningPolicy; void processMixedEvent(EventCandidates const& collisions, TrackCandidates const& tracks) @@ -660,13 +729,77 @@ struct k892analysis_PbPb { auto candPosPitpc = posPitpc->sliceByCached(aod::track::collisionId, collision1.globalIndex(), cache); auto candNegKatpc = negKatpc->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache); - fillHistograms(collision1, candPosPitpc, candNegKatpc); + fillHistograms(collision1, candPosPitpc, candNegKatpc); + + //-+ + auto candNegPitpc = negPitpc->sliceByCached(aod::track::collisionId, collision1.globalIndex(), cache); + auto candPosKatpc = posKatpc->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache); + + fillHistograms(collision1, candNegPitpc, candPosKatpc); + + } else if (tofhighpt) { + + //+- + auto candPosPitof = posPitof->sliceByCached(aod::track::collisionId, collision1.globalIndex(), cache); + auto candNegKatof = negKatof->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache); + + fillHistograms(collision1, candPosPitof, candNegKatof); + + //-+ + auto candNegPitof = negPitof->sliceByCached(aod::track::collisionId, collision1.globalIndex(), cache); + auto candPosKatof = posKatof->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache); + + fillHistograms(collision1, candNegPitof, candPosKatof); + } + } + } + PROCESS_SWITCH(k892analysis_PbPb, processMixedEvent, "Process Mixed event", true); + + using BinningTypeVtxCentRun2 = ColumnBinningPolicy; + void processMixedEventRun2(Run2Events const& collisions, TrackCandidates const& tracks, BCsWithRun2Info const&) + { + auto tracksTuple = std::make_tuple(tracks); + BinningTypeVtxCentRun2 colBinning{{CfgVtxBins, CfgMultBins}, true}; + SameKindPair pairs{colBinning, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; + + for (auto& [collision1, tracks1, collision2, tracks2] : pairs) { + + auto bc1 = collision1.bc_as(); + auto bc2 = collision2.bc_as(); + + if (!(bc1.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted)) || !(bc2.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) + continue; + + if ((std::abs(collision1.posZ()) > cfgCutVertex) || (std::abs(collision2.posZ()) > cfgCutVertex)) + continue; + + auto centrality1 = collision1.centRun2V0M(); + auto centrality2 = collision2.centRun2V0M(); + + if ((centrality1 > cfgCutCentrality) || (centrality2 > cfgCutCentrality)) + continue; + + if (additionalQAeventPlots) { + histos.fill(HIST("QAevent/hEvtCounterMixedE"), 1.0); + histos.fill(HIST("QAevent/hVertexZMixedE"), collision1.posZ()); + histos.fill(HIST("QAevent/hMultiplicityPercentMixedE"), centrality1); + histos.fill(HIST("TestME/hCollisionIndexMixedE"), collision1.globalIndex()); + histos.fill(HIST("TestME/hnTrksMixedE"), tracks1.size()); + } + + if (tpclowpt) { + + //+- + auto candPosPitpc = posPitpc->sliceByCached(aod::track::collisionId, collision1.globalIndex(), cache); + auto candNegKatpc = negKatpc->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache); + + fillHistograms(collision1, candPosPitpc, candNegKatpc); //-+ auto candNegPitpc = negPitpc->sliceByCached(aod::track::collisionId, collision1.globalIndex(), cache); auto candPosKatpc = posKatpc->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache); - fillHistograms(collision1, candNegPitpc, candPosKatpc); + fillHistograms(collision1, candNegPitpc, candPosKatpc); } else if (tofhighpt) { @@ -674,17 +807,17 @@ struct k892analysis_PbPb { auto candPosPitof = posPitof->sliceByCached(aod::track::collisionId, collision1.globalIndex(), cache); auto candNegKatof = negKatof->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache); - fillHistograms(collision1, candPosPitof, candNegKatof); + fillHistograms(collision1, candPosPitof, candNegKatof); //-+ auto candNegPitof = negPitof->sliceByCached(aod::track::collisionId, collision1.globalIndex(), cache); auto candPosKatof = posKatof->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache); - fillHistograms(collision1, candNegPitof, candPosKatof); + fillHistograms(collision1, candNegPitof, candPosKatof); } } } - PROCESS_SWITCH(k892analysis_PbPb, processMixedEvent, "Process Mixed event TPC low pt", true); + PROCESS_SWITCH(k892analysis_PbPb, processMixedEventRun2, "Process Mixed event Run2", true); // MC @@ -728,7 +861,7 @@ struct k892analysis_PbPb { auto centrality = RecCollision.centFT0C(); histos.fill(HIST("QAevent/hMultiplicityPercentMC"), centrality); auto tracks = RecTracks.sliceByCached(aod::track::collisionId, RecCollision.globalIndex(), cache); - fillHistograms(RecCollision, tracks, tracks); + fillHistograms(RecCollision, tracks, tracks); // Generated MC for (auto& mcPart : mcParticles) { @@ -781,6 +914,91 @@ struct k892analysis_PbPb { } // end loop on rec collisions } PROCESS_SWITCH(k892analysis_PbPb, processMC, "Process Monte Carlo", false); + + // MC Run2 + + using EventCandidatesMCrecRun2 = soa::Join; // aod::TrackletMults>; + + void processMCRun2(aod::McCollisions::iterator const& /*mcCollision*/, aod::McParticles& mcParticles, const soa::SmallGroups& recCollisions, TrackCandidatesMCrec const& RecTracks, BCsWithRun2Info const&) + { + histos.fill(HIST("hMCrecCollSels"), 0); + if (recCollisions.size() == 0) { + histos.fill(HIST("hMCrecCollSels"), 1); + return; + } + if (recCollisions.size() > 1) { + histos.fill(HIST("hMCrecCollSels"), 2); + return; + } + for (auto& RecCollision : recCollisions) { + auto bc = RecCollision.bc_as(); + histos.fill(HIST("hMCrecCollSels"), 3); + + if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) + return; + histos.fill(HIST("hMCrecCollSels"), 4); + + if (std::abs(RecCollision.posZ()) > cfgCutVertex) + return; + histos.fill(HIST("hMCrecCollSels"), 5); + + auto centrality = RecCollision.centRun2V0M(); + + histos.fill(HIST("QAevent/hMultiplicityPercentMC"), centrality); + auto tracks = RecTracks.sliceByCached(aod::track::collisionId, RecCollision.globalIndex(), cache); + fillHistograms(RecCollision, tracks, tracks); + + // Generated MC + for (auto& mcPart : mcParticles) { + if (abs(mcPart.y()) >= 0.5 || abs(mcPart.pdgCode()) != 313) + continue; + + auto kDaughters = mcPart.daughters_as(); + if (kDaughters.size() != 2) { + continue; + } + + TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; + + auto daughtp = false; + auto daughtk = false; + for (auto kCurrentDaughter : kDaughters) { + if (!kCurrentDaughter.isPhysicalPrimary()) + break; + if (genacceptancecut && (kCurrentDaughter.pt() < cfgCutPT || TMath::Abs(kCurrentDaughter.eta()) > cfgCutEta)) + break; + + if (abs(kCurrentDaughter.pdgCode()) == 211) { + daughtp = true; + lDecayDaughter1.SetXYZM(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), massPi); + } else if (abs(kCurrentDaughter.pdgCode()) == 321) { + daughtk = true; + lDecayDaughter2.SetXYZM(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), massKa); + } + } + + if (!daughtp || !daughtk) + continue; + + lResonance = lDecayDaughter1 + lDecayDaughter2; + + histos.fill(HIST("QAMCTrue/hGlobalIndexMotherGen"), mcPart.globalIndex()); + + if (mcPart.pdgCode() > 0) { // no cuts, purely generated + histos.fill(HIST("k892GenInvmass"), lResonance.M()); + histos.fill(HIST("h3k892GenInvmass"), centrality, lResonance.Pt(), lResonance.M()); + histos.fill(HIST("k892Gen"), 3, mcPart.pt(), centrality); + } else { + histos.fill(HIST("k892GenInvmassAnti"), lResonance.M()); + histos.fill(HIST("h3k892GenInvmassAnti"), centrality, lResonance.Pt(), lResonance.M()); + histos.fill(HIST("k892GenAnti"), 3, mcPart.pt(), centrality); + } + + } // end loop on gen particles + + } // end loop on rec collisions + } + PROCESS_SWITCH(k892analysis_PbPb, processMCRun2, "Process Monte Carlo Run2", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From c0df2150ee37482f9292e792380fa47be2831f16 Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:34:45 +0100 Subject: [PATCH 098/459] [PWGLF] Add shift correction for TPC and FT0A event plane reconstruction and fix track selection for flow task (#8620) --- PWGLF/TableProducer/Common/epvector.cxx | 57 +++++++++++++++++++++++ PWGLF/Tasks/Resonances/highmasslambda.cxx | 23 +++------ 2 files changed, 64 insertions(+), 16 deletions(-) diff --git a/PWGLF/TableProducer/Common/epvector.cxx b/PWGLF/TableProducer/Common/epvector.cxx index f5c2aad66b9..c5ceda81949 100644 --- a/PWGLF/TableProducer/Common/epvector.cxx +++ b/PWGLF/TableProducer/Common/epvector.cxx @@ -25,6 +25,7 @@ #include #include #include +#include // o2Physics includes. #include "Framework/AnalysisDataModel.h" @@ -95,9 +96,14 @@ struct epvector { Configurable useGainCallib{"useGainCallib", true, "use gain calibration"}; Configurable useRecentere{"useRecentere", true, "use Recentering"}; Configurable useShift{"useShift", false, "use Shift"}; + Configurable useShift2{"useShift2", false, "use Shift for others"}; Configurable ConfGainPath{"ConfGainPath", "Users/s/skundu/My/Object/test100", "Path to gain calibration"}; Configurable ConfRecentere{"ConfRecentere", "Users/s/skundu/My/Object/Finaltest2/recenereall", "Path for recentere"}; Configurable ConfShift{"ConfShift", "Users/s/skundu/My/Object/Finaltest2/recenereall", "Path for Shift"}; + Configurable ConfShiftFT0A{"ConfShiftFT0A", "Users/s/skundu/My/Object/Finaltest2/recenereall", "Path for Shift FT0A"}; + Configurable ConfShiftTPC{"ConfShiftTPC", "Users/s/skundu/My/Object/Finaltest2/recenereall", "Path for Shift TPC"}; + Configurable ConfShiftTPCL{"ConfShiftTPCL", "Users/s/skundu/My/Object/Finaltest2/recenereall", "Path for Shift TPCL"}; + Configurable ConfShiftTPCR{"ConfShiftTPCR", "Users/s/skundu/My/Object/Finaltest2/recenereall", "Path for Shift TPCR"}; ConfigurableAxis configAxisCentrality{"configAxisCentrality", {80, 0.0, 80}, "centrality bining"}; // Event selection cuts - Alex TF1* fMultPVCutLow = nullptr; @@ -166,6 +172,10 @@ struct epvector { histos.add("QTPC", "QTPC", kTH3F, {centAxis, qAxis, occupancyAxis}); histos.add("ShiftFT0C", "ShiftFT0C", kTProfile3D, {centAxis, basisAxis, shiftAxis}); + histos.add("ShiftFT0A", "ShiftFT0A", kTProfile3D, {centAxis, basisAxis, shiftAxis}); + histos.add("ShiftTPC", "ShiftTPC", kTProfile3D, {centAxis, basisAxis, shiftAxis}); + histos.add("ShiftTPCL", "ShiftTPCL", kTProfile3D, {centAxis, basisAxis, shiftAxis}); + histos.add("ShiftTPCR", "ShiftTPCR", kTProfile3D, {centAxis, basisAxis, shiftAxis}); // Event selection cut additional - Alex // if (additionalEvsel) { @@ -254,6 +264,10 @@ struct epvector { TProfile* gainprofile; TH2D* hrecentere; TProfile3D* shiftprofile; + TProfile3D* shiftprofile2; + TProfile3D* shiftprofile3; + TProfile3D* shiftprofile4; + TProfile3D* shiftprofile5; Filter acceptanceFilter = (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT); Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); @@ -361,15 +375,46 @@ struct epvector { if (useShift && (currentRunNumber != lastRunNumber)) { shiftprofile = ccdb->getForTimeStamp(ConfShift.value, bc.timestamp()); + if (useShift2) { + shiftprofile2 = ccdb->getForTimeStamp(ConfShiftFT0A.value, bc.timestamp()); + shiftprofile3 = ccdb->getForTimeStamp(ConfShiftTPC.value, bc.timestamp()); + shiftprofile4 = ccdb->getForTimeStamp(ConfShiftTPCL.value, bc.timestamp()); + shiftprofile5 = ccdb->getForTimeStamp(ConfShiftTPCR.value, bc.timestamp()); + } } if (useShift) { auto deltapsiFT0C = 0.0; + auto deltapsiFT0A = 0.0; + auto deltapsiTPC = 0.0; + auto deltapsiTPCL = 0.0; + auto deltapsiTPCR = 0.0; for (int ishift = 1; ishift <= 10; ishift++) { auto coeffshiftxFT0C = shiftprofile->GetBinContent(shiftprofile->FindBin(centrality, 0.5, ishift - 0.5)); auto coeffshiftyFT0C = shiftprofile->GetBinContent(shiftprofile->FindBin(centrality, 1.5, ishift - 0.5)); deltapsiFT0C = deltapsiFT0C + ((1 / (1.0 * ishift)) * (-coeffshiftxFT0C * TMath::Cos(ishift * 2.0 * psiFT0C) + coeffshiftyFT0C * TMath::Sin(ishift * 2.0 * psiFT0C))); + if (useShift2) { + auto coeffshiftxFT0A = shiftprofile2->GetBinContent(shiftprofile2->FindBin(centrality, 0.5, ishift - 0.5)); + auto coeffshiftyFT0A = shiftprofile2->GetBinContent(shiftprofile2->FindBin(centrality, 1.5, ishift - 0.5)); + + auto coeffshiftxTPC = shiftprofile3->GetBinContent(shiftprofile3->FindBin(centrality, 0.5, ishift - 0.5)); + auto coeffshiftyTPC = shiftprofile3->GetBinContent(shiftprofile3->FindBin(centrality, 1.5, ishift - 0.5)); + + auto coeffshiftxTPCL = shiftprofile4->GetBinContent(shiftprofile4->FindBin(centrality, 0.5, ishift - 0.5)); + auto coeffshiftyTPCL = shiftprofile4->GetBinContent(shiftprofile4->FindBin(centrality, 1.5, ishift - 0.5)); + + auto coeffshiftxTPCR = shiftprofile5->GetBinContent(shiftprofile5->FindBin(centrality, 0.5, ishift - 0.5)); + auto coeffshiftyTPCR = shiftprofile5->GetBinContent(shiftprofile5->FindBin(centrality, 1.5, ishift - 0.5)); + deltapsiFT0A = deltapsiFT0A + ((1 / (1.0 * ishift)) * (-coeffshiftxFT0A * TMath::Cos(ishift * 2.0 * psiFT0A) + coeffshiftyFT0A * TMath::Sin(ishift * 2.0 * psiFT0A))); + deltapsiTPC = deltapsiTPC + ((1 / (1.0 * ishift)) * (-coeffshiftxTPC * TMath::Cos(ishift * 2.0 * psiTPC) + coeffshiftyTPC * TMath::Sin(ishift * 2.0 * psiTPC))); + deltapsiTPCL = deltapsiTPCL + ((1 / (1.0 * ishift)) * (-coeffshiftxTPCL * TMath::Cos(ishift * 2.0 * psiTPCL) + coeffshiftyTPCL * TMath::Sin(ishift * 2.0 * psiTPCL))); + deltapsiTPCR = deltapsiTPCR + ((1 / (1.0 * ishift)) * (-coeffshiftxTPCR * TMath::Cos(ishift * 2.0 * psiTPCR) + coeffshiftyTPCR * TMath::Sin(ishift * 2.0 * psiTPCR))); + } } psiFT0C = psiFT0C + deltapsiFT0C; + psiFT0A = psiFT0A + deltapsiFT0A; + psiTPC = psiTPC + deltapsiTPC; + psiTPCL = psiTPCL + deltapsiTPCL; + psiTPCR = psiTPCR + deltapsiTPCR; } histos.fill(HIST("QxFT0C"), centrality, qxFT0C); histos.fill(HIST("QyFT0C"), centrality, qyFT0C); @@ -416,6 +461,18 @@ struct epvector { for (int ishift = 1; ishift <= 10; ishift++) { histos.fill(HIST("ShiftFT0C"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 2.0 * psiFT0C)); histos.fill(HIST("ShiftFT0C"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 2.0 * psiFT0C)); + + histos.fill(HIST("ShiftFT0A"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 2.0 * psiFT0A)); + histos.fill(HIST("ShiftFT0A"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 2.0 * psiFT0A)); + + histos.fill(HIST("ShiftTPC"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 2.0 * psiTPC)); + histos.fill(HIST("ShiftTPC"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 2.0 * psiTPC)); + + histos.fill(HIST("ShiftTPCL"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 2.0 * psiTPCL)); + histos.fill(HIST("ShiftTPCL"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 2.0 * psiTPCL)); + + histos.fill(HIST("ShiftTPCR"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 2.0 * psiTPCR)); + histos.fill(HIST("ShiftTPCR"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 2.0 * psiTPCR)); } lastRunNumber = currentRunNumber; } diff --git a/PWGLF/Tasks/Resonances/highmasslambda.cxx b/PWGLF/Tasks/Resonances/highmasslambda.cxx index 8afe10bd882..75c41977fd5 100644 --- a/PWGLF/Tasks/Resonances/highmasslambda.cxx +++ b/PWGLF/Tasks/Resonances/highmasslambda.cxx @@ -88,7 +88,7 @@ struct highmasslambda { Configurable cfgCutCentralityMax{"cfgCutCentralityMax", 50.0f, "Accepted maximum Centrality"}; Configurable cfgCutCentralityMin{"cfgCutCentralityMin", 30.0f, "Accepted minimum Centrality"}; // proton track cut - Configurable rejectPID{"reject PID", true, "pion, kaon, electron rejection"}; + Configurable rejectPID{"rejectPID", true, "pion, kaon, electron rejection"}; Configurable cfgCutTOFBeta{"cfgCutTOFBeta", 0.0, "cut TOF beta"}; Configurable ispTdifferentialDCA{"ispTdifferentialDCA", true, "is pT differential DCA"}; Configurable isPVContributor{"isPVContributor", true, "is PV contributor"}; @@ -601,7 +601,6 @@ struct highmasslambda { if (!selectionTrack(track1)) { continue; } - // PID check if (PIDstrategy == 0 && !selectionPID1(track1)) { continue; @@ -634,7 +633,6 @@ struct highmasslambda { histos.fill(HIST("hNsigmaProtonKaonTPC_afterKa"), track1.tpcNSigmaPr(), track1.tpcNSigmaKa(), track1.tpcInnerParam()); } } - histos.fill(HIST("hMomCorr"), track1.p() / track1.sign(), track1.p() - track1.tpcInnerParam(), centrality); histos.fill(HIST("hEta"), track1.eta()); histos.fill(HIST("hDcaxy"), track1.dcaXY()); @@ -699,7 +697,6 @@ struct highmasslambda { histos.fill(HIST("hSparseV2SASameEvent_V2_dcatopv"), Lambdac.M(), Lambdac.Pt(), v2, v0.dcav0topv(), Proton.Pt()); } } - if (fillRotation) { for (int nrotbkg = 0; nrotbkg < nBkgRotations; nrotbkg++) { auto anglestart = confMinRot; @@ -780,21 +777,10 @@ struct highmasslambda { continue; } for (auto& [track1, v0] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + if (!selectionTrack(track1)) { continue; } - if (!track1.hasTOF()) { - if (rejectPID && !rejectPi(track1)) { - continue; - } - if (rejectPID && !rejectEl(track1)) { - continue; - } - if (rejectPID && !rejectKa(track1)) { - continue; - } - } - // PID check if (PIDstrategy == 0 && !selectionPID1(track1)) { continue; @@ -809,6 +795,11 @@ struct highmasslambda { continue; } + if (!track1.hasTOF()) { + if (rejectPID && !rejectEl(track1)) { + continue; + } + } if (!SelectionV0(collision2, v0)) { continue; } From 1abd0b75f7d3112387166710fe7857c39faaf699 Mon Sep 17 00:00:00 2001 From: Chiara De Martin <39315597+ChiaraDeMartin95@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:34:59 +0100 Subject: [PATCH 099/459] [PWGLF] Add new event selection and histogram for efficiency in cascadeflow task (#8625) Co-authored-by: Chiara De Martin --- PWGLF/DataModel/cascqaanalysis.h | 4 +- .../TableProducer/Strangeness/cascadeflow.cxx | 92 +++++++++++++++---- 2 files changed, 78 insertions(+), 18 deletions(-) diff --git a/PWGLF/DataModel/cascqaanalysis.h b/PWGLF/DataModel/cascqaanalysis.h index 30053e145a6..ea451559da5 100644 --- a/PWGLF/DataModel/cascqaanalysis.h +++ b/PWGLF/DataModel/cascqaanalysis.h @@ -115,6 +115,8 @@ namespace cascadesflow DECLARE_SOA_COLUMN(CentFT0A, centFT0A, float); DECLARE_SOA_COLUMN(CentFT0C, centFT0C, float); DECLARE_SOA_COLUMN(CentFT0M, centFT0M, float); +DECLARE_SOA_COLUMN(IsNoCollInTimeRange, isNoCollInTimeRange, bool); +DECLARE_SOA_COLUMN(IsNoCollInRof, isNoCollInRof, bool); DECLARE_SOA_COLUMN(Sign, sign, int16_t); DECLARE_SOA_COLUMN(Pt, pt, float); DECLARE_SOA_COLUMN(Eta, eta, float); @@ -160,7 +162,7 @@ DECLARE_SOA_TABLE(CascTraining, "AOD", "CascTraining", o2::soa::Index<>, mycascades::DCABachToPV, mycascades::DCACascDaughters, mycascades::DCAV0Daughters, mycascades::DCAV0ToPV, mycascades::BachBaryonCosPA, mycascades::BachBaryonDCAxyToPV, mycascades::McPdgCode); DECLARE_SOA_TABLE(CascAnalysis, "AOD", "CascAnalysis", o2::soa::Index<>, - cascadesflow::CentFT0C, cascadesflow::Sign, cascadesflow::Pt, cascadesflow::Eta, cascadesflow::Phi, cascadesflow::MassXi, cascadesflow::MassOmega, cascadesflow::V2CSP, cascadesflow::V2CEP, cascadesflow::PsiT0C, cascadesflow::BDTResponseXi, cascadesflow::BDTResponseOmega, cascadesflow::CosThetaStarLambdaFromOmega, cascadesflow::CosThetaStarLambdaFromXi, cascadesflow::CosThetaStarProton, mycascades::McPdgCode); + cascadesflow::CentFT0C, cascadesflow::IsNoCollInTimeRange, cascadesflow::IsNoCollInRof, cascadesflow::Sign, cascadesflow::Pt, cascadesflow::Eta, cascadesflow::Phi, cascadesflow::MassXi, cascadesflow::MassOmega, cascadesflow::V2CSP, cascadesflow::V2CEP, cascadesflow::PsiT0C, cascadesflow::BDTResponseXi, cascadesflow::BDTResponseOmega, cascadesflow::CosThetaStarLambdaFromOmega, cascadesflow::CosThetaStarLambdaFromXi, cascadesflow::CosThetaStarProton, mycascades::McPdgCode); namespace myMCcascades { diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index 6e44fd5c803..723bf0a86b7 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -135,10 +135,16 @@ struct cascadeFlow { Configurable isNoSameBunchPileupCut{"isNoSameBunchPileupCut", 1, "Same found-by-T0 bunch crossing rejection"}; Configurable isGoodZvtxFT0vsPVCut{"isGoodZvtxFT0vsPVCut", 1, "z of PV by tracks and z of PV from FT0 A-C time difference cut"}; Configurable isGoodEventEP{"isGoodEventEP", 1, "Event is used to calibrate event plane"}; + Configurable isTrackOccupancySel{"isTrackOccupancySel", 0, "isTrackOccupancySel"}; Configurable MinOccupancy{"MinOccupancy", 0, "MinOccupancy"}; Configurable MaxOccupancy{"MaxOccupancy", 500, "MaxOccupancy"}; - Configurable isCollInStandardTimeRange{"isCollInStandardTimeRange", 1, "To remove collisions in +-10 micros time range"}; - Configurable isCollInNarrowTimeRange{"isCollInNarrowTimeRange", 0, "To remove collisions in +-4 micros time range"}; + Configurable isFT0OccupancySel{"isFT0OccupancySel", 0, "isFT0OccupancySel"}; + Configurable MinOccupancyFT0{"MinOccupancyFT0", 0, "MinOccupancyFT0"}; + Configurable MaxOccupancyFT0{"MaxOccupancyFT0", 5000, "MaxOccupancyFT0"}; + Configurable isNoCollInStandardTimeRange{"isNoCollInStandardTimeRange", 1, "To remove collisions in +-10 micros time range"}; + Configurable isNoCollInNarrowTimeRange{"isNoCollInNarrowTimeRange", 0, "To remove collisions in +-2 micros time range"}; + Configurable isNoCollInRofStandard{"isNoCollInRofStandard", 0, "To remove collisions in the same ITS ROF and with a multiplicity above a certain threshold"}; + Configurable isNoTVXinTRD{"isNoTVXinTRD", 0, "To remove collisions with trigger in TRD"}; Configurable MinPt{"MinPt", 0.6, "Min pt of cascade"}; Configurable MaxPt{"MaxPt", 10, "Max pt of cascade"}; @@ -213,22 +219,45 @@ struct cascadeFlow { // occupancy cut int occupancy = collision.trackOccupancyInTimeRange(); - if (occupancy < MinOccupancy || occupancy > MaxOccupancy) { + if (isTrackOccupancySel && (occupancy < MinOccupancy || occupancy > MaxOccupancy)) { return false; } + // occupancy cut based on FT0C + int occupancyFT0 = collision.ft0cOccupancyInTimeRange(); + if (isFT0OccupancySel && (occupancyFT0 < MinOccupancyFT0 || occupancyFT0 > MaxOccupancyFT0)) { + return false; + } + if (isFillHisto) histos.fill(HIST("hNEvents"), 5.5); - if (isCollInStandardTimeRange && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + // time-based event selection + if (isNoCollInStandardTimeRange && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { return false; } - - if (isCollInNarrowTimeRange && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { + if (isNoCollInNarrowTimeRange && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { return false; } + if (isFillHisto) histos.fill(HIST("hNEvents"), 6.5); + // In-ROF event selection + if (isNoCollInRofStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + return false; + } + + if (isFillHisto) + histos.fill(HIST("hNEvents"), 7.5); + + // TVX in TRD + // if (isNoTVXinTRD && collision.alias_bit(kTVXinTRD)){ + // return false; + // } + + if (isFillHisto) + histos.fill(HIST("hNEvents"), 8.5); + if (isFillHisto) { histos.fill(HIST("hEventNchCorrelation"), collision.multNTracksPVeta1(), collision.multNTracksGlobal()); histos.fill(HIST("hEventPVcontributorsVsCentrality"), collision.centFT0C(), collision.multNTracksPVeta1()); @@ -337,7 +366,21 @@ struct cascadeFlow { cosThetaStarLambda[i] = boostedLambda.Pz() / boostedLambda.P(); } + // time-based event selection + bool isNoCollInTimeRangeStd = 0; + if (coll.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) + isNoCollInTimeRangeStd = 1; + // IN-ROF pile-up rejection + bool isNoCollInRofStd = 0; + if (coll.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) + isNoCollInRofStd = 1; + // TVX in TRD + bool isTVXinTRD = 0; + // if (coll.alias_bit(kTVXinTRD)) isTVXinTRD = 1; + analysisSample(coll.centFT0C(), + isNoCollInTimeRangeStd, + isNoCollInRofStd, casc.sign(), casc.pt(), casc.eta(), @@ -365,7 +408,7 @@ struct cascadeFlow { const AxisSpec ptAxis{static_cast((MaxPt - MinPt) / 0.2), MinPt, MaxPt, "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec v2Axis{200, -1., 1., "#it{v}_{2}"}; const AxisSpec CentAxis{18, 0., 90., "FT0C centrality percentile"}; - TString hNEventsLabels[8] = {"All", "sel8", "z vrtx", "kNoSameBunchPileup", "kIsGoodZvtxFT0vsPV", "trackOccupancyInTimeRange", "kNoCollInTimeRange", "kIsGoodEventEP"}; + TString hNEventsLabels[10] = {"All", "sel8", "z vrtx", "kNoSameBunchPileup", "kIsGoodZvtxFT0vsPV", "trackOccupancyInTimeRange", "kNoCollInTimeRange", "kNoCollInROF", "kTVXinTRD", "kIsGoodEventEP"}; TString hNEventsLabelsMC[6] = {"All", "z vtx", ">=1RecoColl", "1Reco", "2Reco", "EvSelected"}; TString hNCascLabelsMC[8] = {"All Xi", "all Omega", "Xi: has MC coll", "Om: has MC coll", "Xi: isPrimary", "Om: is Primary", "Xi: |eta|<0.8", "Om: |eta| < 0.8"}; @@ -376,7 +419,7 @@ struct cascadeFlow { resolution.add("QVectorsNormT0CTPCC", "QVectorsNormT0CTPCC", HistType::kTH2F, {axisQVsNorm, CentAxis}); resolution.add("QVectorsNormTPCAC", "QVectorsNormTPCCB", HistType::kTH2F, {axisQVsNorm, CentAxis}); - histos.add("hNEvents", "hNEvents", {HistType::kTH1F, {{8, 0.f, 8.f}}}); + histos.add("hNEvents", "hNEvents", {HistType::kTH1F, {{10, 0.f, 10.f}}}); for (Int_t n = 1; n <= histos.get(HIST("hNEvents"))->GetNbinsX(); n++) { histos.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(n, hNEventsLabels[n - 1]); } @@ -398,17 +441,21 @@ struct cascadeFlow { histos.add("hCandidate", "hCandidate", HistType::kTH1F, {{22, -0.5, 21.5}}); histos.add("hCascadeSignal", "hCascadeSignal", HistType::kTH1F, {{6, -0.5, 5.5}}); histos.add("hCascade", "hCascade", HistType::kTH1F, {{6, -0.5, 5.5}}); - histos.add("hXiPtvsCent", "hXiPtvsCent", HistType::kTH2F, {{100, 0, 100}, {200, 0, 20}}); - histos.add("hOmegaPtvsCent", "hOmegaPtvsCent", HistType::kTH2F, {{100, 0, 100}, {200, 0, 20}}); + histos.add("hXiPtvsCent", "hXiPtvsCent", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histos.add("hXiPtvsCentEta08", "hXiPtvsCentEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histos.add("hXiPtvsCentY05", "hXiPtvsCentY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histos.add("hOmegaPtvsCent", "hOmegaPtvsCent", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histos.add("hOmegaPtvsCentEta08", "hOmegaPtvsCentEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histos.add("hOmegaPtvsCentY05", "hOmegaPtvsCentY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); histos.add("hCascadePhi", "hCascadePhi", HistType::kTH1F, {{100, 0, 2 * TMath::Pi()}}); histos.add("hcascminuspsiT0C", "hcascminuspsiT0C", HistType::kTH1F, {{100, 0, TMath::Pi()}}); histos.add("hv2CEPvsFT0C", "hv2CEPvsFT0C", HistType::kTH2F, {CentAxis, {100, -1, 1}}); histos.add("hv2CEPvsv2CSP", "hv2CEPvsV2CSP", HistType::kTH2F, {{100, -1, 1}, {100, -1, 1}}); - histosMCGen.add("h2DGenXiEta08", "h2DGenXiEta08", HistType::kTH2F, {{100, 0, 100}, {200, 0, 20}}); - histosMCGen.add("h2DGenOmegaEta08", "h2DGenOmegaEta08", HistType::kTH2F, {{100, 0, 100}, {200, 0, 20}}); - histosMCGen.add("h2DGenXiY05", "h2DGenXiY05", HistType::kTH2F, {{100, 0, 100}, {200, 0, 20}}); - histosMCGen.add("h2DGenOmegaY05", "h2DGenOmegaY05", HistType::kTH2F, {{100, 0, 100}, {200, 0, 20}}); + histosMCGen.add("h2DGenXiEta08", "h2DGenXiEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histosMCGen.add("h2DGenOmegaEta08", "h2DGenOmegaEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histosMCGen.add("h2DGenXiY05", "h2DGenXiY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histosMCGen.add("h2DGenOmegaY05", "h2DGenOmegaY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); histosMCGen.add("hGenXiY", "hGenXiY", HistType::kTH1F, {{100, -1, 1}}); histosMCGen.add("hGenOmegaY", "hGenOmegaY", HistType::kTH1F, {{100, -1, 1}}); histosMCGen.add("hZvertexGen", "hZvertexGen", HistType::kTH1F, {{100, -20, 20}}); @@ -544,7 +591,7 @@ struct cascadeFlow { if (isGoodEventEP && !coll.triggereventep()) { return; } - histos.fill(HIST("hNEvents"), 7.5); + histos.fill(HIST("hNEvents"), 9.5); histos.fill(HIST("hEventNchCorrelationAfterEP"), coll.multNTracksPVeta1(), coll.multNTracksGlobal()); histos.fill(HIST("hEventPVcontributorsVsCentralityAfterEP"), coll.centFT0C(), coll.multNTracksPVeta1()); histos.fill(HIST("hEventGlobalTracksVsCentralityAfterEP"), coll.centFT0C(), coll.multNTracksGlobal()); @@ -669,7 +716,7 @@ struct cascadeFlow { } } - histos.fill(HIST("hNEvents"), 7.5); + histos.fill(HIST("hNEvents"), 9.5); histos.fill(HIST("hEventNchCorrelationAfterEP"), coll.multNTracksPVeta1(), coll.multNTracksGlobal()); histos.fill(HIST("hEventPVcontributorsVsCentralityAfterEP"), coll.centFT0C(), coll.multNTracksPVeta1()); histos.fill(HIST("hEventGlobalTracksVsCentralityAfterEP"), coll.centFT0C(), coll.multNTracksGlobal()); @@ -790,7 +837,7 @@ struct cascadeFlow { return; } - histos.fill(HIST("hNEvents"), 7.5); + histos.fill(HIST("hNEvents"), 9.5); histos.fill(HIST("hEventNchCorrelationAfterEP"), coll.multNTracksPVeta1(), coll.multNTracksGlobal()); histos.fill(HIST("hEventPVcontributorsVsCentralityAfterEP"), coll.centFT0C(), coll.multNTracksPVeta1()); histos.fill(HIST("hEventGlobalTracksVsCentralityAfterEP"), coll.centFT0C(), coll.multNTracksGlobal()); @@ -813,11 +860,22 @@ struct cascadeFlow { pdgCode = 0; } + // rapidity definition + float XiY = RecoDecay::y(std::array{casc.px(), casc.py(), casc.pz()}, constants::physics::MassXiMinus); + float OmegaY = RecoDecay::y(std::array{casc.px(), casc.py(), casc.pz()}, constants::physics::MassOmegaMinus); // true reco cascades before applying any selection if (std::abs(pdgCode) == 3312 && std::abs(cascMC.pdgCodeV0()) == 3122 && std::abs(cascMC.pdgCodeBachelor()) == 211) { histos.fill(HIST("hXiPtvsCent"), coll.centFT0C(), casc.pt()); + if (std::abs(casc.eta()) < 0.8) + histos.fill(HIST("hXiPtvsCentEta08"), coll.centFT0C(), casc.pt()); + if (std::abs(XiY) < 0.5) + histos.fill(HIST("hXiPtvsCentY05"), coll.centFT0C(), casc.pt()); } else if (std::abs(pdgCode) == 3334 && std::abs(cascMC.pdgCodeV0()) == 3122 && std::abs(cascMC.pdgCodeBachelor()) == 321) { histos.fill(HIST("hOmegaPtvsCent"), coll.centFT0C(), casc.pt()); + if (std::abs(casc.eta()) < 0.8) + histos.fill(HIST("hOmegaPtvsCentEta08"), coll.centFT0C(), casc.pt()); + if (std::abs(OmegaY) < 0.5) + histos.fill(HIST("hOmegaPtvsCentY05"), coll.centFT0C(), casc.pt()); } /// Add some minimal cuts for single track variables (min number of TPC clusters) From 48347a5305589852c892d8c17cce9ed11d1bb50c Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Tue, 26 Nov 2024 15:35:14 +0100 Subject: [PATCH 100/459] [PWGLF] adds evsel::alias for v2 ev sel studies, etc (#8643) Co-authored-by: ALICE Builder --- PWGLF/DataModel/LFStrangenessTables.h | 49 ++++++++------ .../Strangeness/Converters/CMakeLists.txt | 5 ++ .../Converters/straevselsconverter4.cxx | 66 +++++++++++++++++++ .../Strangeness/strangederivedbuilder.cxx | 3 +- 4 files changed, 101 insertions(+), 22 deletions(-) create mode 100644 PWGLF/TableProducer/Strangeness/Converters/straevselsconverter4.cxx diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index a6915382bba..66d9027779e 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -129,15 +129,6 @@ DECLARE_SOA_TABLE_VERSIONED(StraEvSels_001, "AOD", "STRAEVSELS", 1, //! udcollision::TotalFDDAmplitudeC, // UPC info: re-assigned FDD-C amplitude, in case of SG event, from the most active bc udzdc::EnergyCommonZNA, // UPC info: re-assigned ZN-A amplitude, in case of SG event, from the most active bc udzdc::EnergyCommonZNC, // UPC info: re-assigned ZN-C amplitude, in case of SG event, from the most active bc - - // Dynamic columns for manipulating information - // stracollision::TotalFV0AmplitudeA, - // stracollision::TotalFT0AmplitudeA, - // stracollision::TotalFT0AmplitudeC, - // stracollision::TotalFDDAmplitudeA, - // stracollision::TotalFDDAmplitudeC, - // stracollision::EnergyCommonZNA, - // stracollision::EnergyCommonZNC, stracollision::IsUPC); DECLARE_SOA_TABLE_VERSIONED(StraEvSels_002, "AOD", "STRAEVSELS", 2, //! debug information @@ -161,17 +152,7 @@ DECLARE_SOA_TABLE_VERSIONED(StraEvSels_002, "AOD", "STRAEVSELS", 2, //! udcollision::TotalFDDAmplitudeC, // UPC info: re-assigned FDD-C amplitude, in case of SG event, from the most active bc udzdc::EnergyCommonZNA, // UPC info: re-assigned ZN-A amplitude, in case of SG event, from the most active bc udzdc::EnergyCommonZNC, // UPC info: re-assigned ZN-C amplitude, in case of SG event, from the most active bc - - collision::Flags, // Contains Vertex::Flags, with most notably the UPCMode to know whether the vertex has been found using UPC settings - - // Dynamic columns for manipulating information - // stracollision::TotalFV0AmplitudeA, - // stracollision::TotalFT0AmplitudeA, - // stracollision::TotalFT0AmplitudeC, - // stracollision::TotalFDDAmplitudeA, - // stracollision::TotalFDDAmplitudeC, - // stracollision::EnergyCommonZNA, - // stracollision::EnergyCommonZNC, + collision::Flags, // Contains Vertex::Flags, with most notably the UPCMode to know whether the vertex has been found using UPC settings stracollision::IsUPC); DECLARE_SOA_TABLE_VERSIONED(StraEvSels_003, "AOD", "STRAEVSELS", 3, //! debug information @@ -196,8 +177,34 @@ DECLARE_SOA_TABLE_VERSIONED(StraEvSels_003, "AOD", "STRAEVSELS", 3, //! udcollision::TotalFDDAmplitudeC, // UPC info: re-assigned FDD-C amplitude, in case of SG event, from the most active bc udzdc::EnergyCommonZNA, // UPC info: re-assigned ZN-A amplitude, in case of SG event, from the most active bc udzdc::EnergyCommonZNC, // UPC info: re-assigned ZN-C amplitude, in case of SG event, from the most active bc + collision::Flags, // Contains Vertex::Flags, with most notably the UPCMode to know whether the vertex has been found using UPC settings + stracollision::IsUPC); + +DECLARE_SOA_TABLE_VERSIONED(StraEvSels_004, "AOD", "STRAEVSELS", 4, //! debug information + evsel::Sel8, evsel::Selection, //! event selection: sel8 + mult::MultFT0A, mult::MultFT0C, mult::MultFV0A, // FIT detectors + mult::MultFDDA, mult::MultFDDC, + mult::MultNTracksPVeta1, // track multiplicities with eta cut for INEL>0 + mult::MultPVTotalContributors, // number of PV contribs total + mult::MultNTracksGlobal, // global track multiplicities + mult::MultNTracksITSTPC, // track multiplicities, PV contribs, no eta cut + mult::MultAllTracksTPCOnly, // TPConly track multiplicities, all, no eta cut + mult::MultAllTracksITSTPC, // ITSTPC track multiplicities, all, no eta cut + mult::MultZNA, mult::MultZNC, mult::MultZEM1, // ZDC signals + mult::MultZEM2, mult::MultZPA, mult::MultZPC, + evsel::NumTracksInTimeRange, // add occupancy in specified time interval by a number of tracks from nearby collisions + evsel::SumAmpFT0CInTimeRange, // add occupancy in specified time interval by a sum of FT0C amplitudes from nearby collisions + udcollision::GapSide, // UPC info: 0 for side A, 1 for side C, 2 for both sides, 3 neither A or C, 4 not enough or too many pv contributors + udcollision::TotalFT0AmplitudeA, // UPC info: re-assigned FT0-A amplitude, in case of SG event, from the most active bc + udcollision::TotalFT0AmplitudeC, // UPC info: re-assigned FT0-C amplitude, in case of SG event, from the most active bc + udcollision::TotalFV0AmplitudeA, // UPC info: re-assigned FV0-A amplitude, in case of SG event, from the most active bc + udcollision::TotalFDDAmplitudeA, // UPC info: re-assigned FDD-A amplitude, in case of SG event, from the most active bc + udcollision::TotalFDDAmplitudeC, // UPC info: re-assigned FDD-C amplitude, in case of SG event, from the most active bc + udzdc::EnergyCommonZNA, // UPC info: re-assigned ZN-A amplitude, in case of SG event, from the most active bc + udzdc::EnergyCommonZNC, // UPC info: re-assigned ZN-C amplitude, in case of SG event, from the most active bc collision::Flags, // Contains Vertex::Flags, with most notably the UPCMode to know whether the vertex has been found using UPC settings + evsel::Alias, // trigger aliases (e.g. kTVXinTRD for v2) // Dynamic columns for manipulating information // stracollision::TotalFV0AmplitudeA, @@ -230,7 +237,7 @@ DECLARE_SOA_TABLE_VERSIONED(StraStamps_001, "AOD", "STRASTAMPS", 1, //! informat bc::RunNumber, timestamp::Timestamp, bc::GlobalBC); using StraRawCents = StraRawCents_004; -using StraEvSels = StraEvSels_003; +using StraEvSels = StraEvSels_004; using StraStamps = StraStamps_001; using StraCollision = StraCollisions::iterator; using StraCent = StraCents::iterator; diff --git a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt index 4d7043e4a78..50311dd41cd 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt @@ -39,6 +39,11 @@ o2physics_add_dpl_workflow(straevselsconverter3 PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::ITStracking COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(straevselsconverter4 + SOURCES straevselsconverter4.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::ITStracking + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(straevselsconverter2rawcents SOURCES straevselsconverter2rawcents.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGLF/TableProducer/Strangeness/Converters/straevselsconverter4.cxx b/PWGLF/TableProducer/Strangeness/Converters/straevselsconverter4.cxx new file mode 100644 index 00000000000..ad988fd93aa --- /dev/null +++ b/PWGLF/TableProducer/Strangeness/Converters/straevselsconverter4.cxx @@ -0,0 +1,66 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "ITStracking/Vertexer.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" + +using namespace o2; +using namespace o2::framework; + +// Converts Stra Event selections from 000 to 001 +struct straevselsconverter4 { + Produces straEvSels_004; + + void process(aod::StraEvSels_003 const& straEvSels_003) + { + for (auto& values : straEvSels_003) { + straEvSels_004(values.sel8(), + values.selection_raw(), + values.multFT0A(), + values.multFT0C(), + values.multFT0A(), + 0 /*dummy FDDA value*/, + 0 /*dummy FDDC value*/, + values.multNTracksPVeta1(), + values.multPVTotalContributors(), + values.multNTracksGlobal(), + values.multNTracksITSTPC(), + values.multAllTracksTPCOnly(), + values.multAllTracksITSTPC(), + values.multZNA(), + values.multZNC(), + values.multZEM1(), + values.multZEM2(), + values.multZPA(), + values.multZPC(), + values.trackOccupancyInTimeRange(), + 0 /*dummy occupancy value*/, + values.gapSide(), + values.totalFT0AmplitudeA(), + values.totalFT0AmplitudeC(), + values.totalFV0AmplitudeA(), + values.totalFDDAmplitudeA(), + values.totalFDDAmplitudeC(), + values.energyCommonZNA(), + values.energyCommonZNC(), + values.flags(), + 0 /*dummy Alias value*/); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 911cd99aec8..9888f324bf4 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -381,7 +381,8 @@ struct strangederivedbuilder { totalFDDAmplitudeA, totalFDDAmplitudeC, energyCommonZNA, energyCommonZNC, // Collision flags - collision.flags()); + collision.flags(), + collision.alias_raw()); strangeStamps(bc.runNumber(), bc.timestamp(), bc.globalBC()); } for (const auto& v0 : V0Table_thisColl) From 53bf9237f87840edcf7ef0bfd6c14b541194206a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:35:28 +0100 Subject: [PATCH 101/459] [PWGHF,PWGCF] Add QA histograms for tracks and charm hadron before pairing (#8630) --- .../Core/femtoDreamTrackSelection.h | 7 +- .../HFC/TableProducer/femtoDreamProducer.cxx | 6 +- .../HFC/Tasks/taskCharmHadronsFemtoDream.cxx | 64 +++++++++++++------ 3 files changed, 50 insertions(+), 27 deletions(-) diff --git a/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h b/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h index 221988a4d3f..a1c5e0dda05 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h @@ -574,15 +574,14 @@ void FemtoDreamTrackSelection::fillQA(T const& track) mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtodreamparticle::TrackTypeName[tracktype]) + HIST("/nSigmaComb_pi"), track.p(), std::sqrt(track.tpcNSigmaPi() * track.tpcNSigmaPi() + track.tofNSigmaPi() * track.tofNSigmaPi())); mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtodreamparticle::TrackTypeName[tracktype]) + HIST("/nSigmaComb_K"), track.p(), std::sqrt(track.tpcNSigmaKa() * track.tpcNSigmaKa() + track.tofNSigmaKa() * track.tofNSigmaKa())); mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtodreamparticle::TrackTypeName[tracktype]) + HIST("/nSigmaComb_p"), track.p(), std::sqrt(track.tpcNSigmaPr() * track.tpcNSigmaPr() + track.tofNSigmaPr() * track.tofNSigmaPr())); + mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtodreamparticle::TrackTypeName[tracktype]) + HIST("/nSigmaTPC_d"), track.p(), track.tpcNSigmaDe()); + mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtodreamparticle::TrackTypeName[tracktype]) + HIST("/nSigmaComb_d"), track.p(), std::sqrt(track.tpcNSigmaDe() * track.tpcNSigmaDe() + track.tofNSigmaDe() * track.tofNSigmaDe())); + mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtodreamparticle::TrackTypeName[tracktype]) + HIST("/nSigmaTOF_d"), track.p(), track.tofNSigmaDe()); if constexpr (!isHF) { mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtodreamparticle::TrackTypeName[tracktype]) + HIST("/nSigmaComb_el"), track.p(), std::sqrt(track.tpcNSigmaEl() * track.tpcNSigmaEl() + track.tofNSigmaEl() * track.tofNSigmaEl())); mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtodreamparticle::TrackTypeName[tracktype]) + HIST("/nSigmaTOF_el"), track.p(), track.tofNSigmaEl()); mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtodreamparticle::TrackTypeName[tracktype]) + HIST("/nSigmaTPC_el"), track.p(), track.tpcNSigmaEl()); - - mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtodreamparticle::TrackTypeName[tracktype]) + HIST("/nSigmaTPC_d"), track.p(), track.tpcNSigmaDe()); - mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtodreamparticle::TrackTypeName[tracktype]) + HIST("/nSigmaComb_d"), track.p(), std::sqrt(track.tpcNSigmaDe() * track.tpcNSigmaDe() + track.tofNSigmaDe() * track.tofNSigmaDe())); - mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtodreamparticle::TrackTypeName[tracktype]) + HIST("/nSigmaTOF_d"), track.p(), track.tofNSigmaDe()); } } } diff --git a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx index 7b493c9a733..5328703d76c 100644 --- a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx +++ b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx @@ -114,7 +114,7 @@ struct HfFemtoDreamProducer { using FemtoFullCollisionMc = soa::Join::iterator; using FemtoFullMcgenCollisions = soa::Join; using FemtoFullMcgenCollision = FemtoFullMcgenCollisions::iterator; - using FemtoHFTracks = soa::Join; + using FemtoHFTracks = soa::Join; using FemtoHFTrack = FemtoHFTracks::iterator; using FemtoHFMcTracks = soa::Join; using FemtoHFMcTrack = FemtoHFMcTracks::iterator; @@ -203,14 +203,14 @@ struct HfFemtoDreamProducer { particle.tpcNSigmaPi(), particle.tpcNSigmaKa(), particle.tpcNSigmaPr(), - -999., + particle.tpcNSigmaDe(), -999., -999., -999., particle.tofNSigmaPi(), particle.tofNSigmaKa(), particle.tofNSigmaPr(), - -999., + particle.tofNSigmaDe(), -999., -999., -999., -999., -999., -999., -999., -999.); diff --git a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx index be297dd87c8..f421bd35ff3 100644 --- a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx +++ b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx @@ -58,12 +58,12 @@ struct HfTaskCharmHadronsFemtoDream { ConfigurableAxis bin4DMult{"bin4Dmult", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f}, "multiplicity Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; ConfigurableAxis bin4DmT{"bin4DmT", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; ConfigurableAxis bin4DmultPercentile{"bin4DmultPercentile", {10, 0.0f, 100.0f}, "multiplicity percentile Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; - ConfigurableAxis binInvMass{"binInvMass", {300, 2.15, 2.45}, "InvMass binning"}; + ConfigurableAxis binInvMass{"binInvMass", {400, 2.10, 2.50}, "InvMass binning"}; + ConfigurableAxis binpTCharm{"binpTCharm", {360, 0, 36}, "pT binning of charm hadron"}; ConfigurableAxis binTempFitVarTrack{"binTempFitVarTrack", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot (Track)"}; ConfigurableAxis binmT{"binmT", {225, 0., 7.5}, "binning mT"}; ConfigurableAxis binmultTempFit{"binmultTempFit", {1, 0, 1}, "multiplicity Binning for the TempFitVar plot"}; ConfigurableAxis binMulPercentile{"binMulPercentile", {10, 0.0f, 100.0f}, "multiplicity percentile Binning"}; - ConfigurableAxis binpT{"binpT", {20, 0.5, 4.05}, "pT binning"}; ConfigurableAxis binpTTrack{"binpTTrack", {50, 0.5, 10.05}, "pT binning of the pT vs. TempFitVar plot (Track)"}; ConfigurableAxis binEta{"binEta", {{200, -1.5, 1.5}}, "eta binning"}; ConfigurableAxis binPhi{"binPhi", {{200, 0, TMath::TwoPi()}}, "phi binning"}; @@ -167,12 +167,15 @@ struct HfTaskCharmHadronsFemtoDream { femtodreamcollision::BitMaskType BitMask = 1 << 0; /// Histogramming for particle 1 - FemtoDreamParticleHisto trackHistoPartOne; + FemtoDreamParticleHisto allTrackHisto; + FemtoDreamParticleHisto selectedTrackHisto; + /// Histogramming for Event FemtoDreamEventHisto eventHisto; /// Histogram output HistogramRegistry registry{"CorrelationsAndQA", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry registryMixQa{"registryMixQa"}; + HistogramRegistry registryCharmHadronQa{"registryCharmHadronQa"}; /// Partition for particle 1 Partition partitionTrk1 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) && (ncheckbit(aod::femtodreamparticle::cut, cutBitTrack1)) && ifnode(aod::femtodreamparticle::pt * (nexp(aod::femtodreamparticle::eta) + nexp(-1.f * aod::femtodreamparticle::eta)) / 2.f <= pidThresTrack1, ncheckbit(aod::femtodreamparticle::pidcut, tpcBitTrack1), ncheckbit(aod::femtodreamparticle::pidcut, tpcTofBitTrack1)); @@ -201,10 +204,11 @@ struct HfTaskCharmHadronsFemtoDream { colBinningMultPercentile = {{mixingBinVztx, mixingBinMultPercentile}, true}; colBinningMultMultPercentile = {{mixingBinVztx, mixingBinMult, mixingBinMultPercentile}, true}; eventHisto.init(®istry); - trackHistoPartOne.init(®istry, binmultTempFit, binMulPercentile, binpTTrack, binEta, binPhi, binTempFitVarTrack, binNSigmaTPC, binNSigmaTOF, binNSigmaTPCTOF, binTPCClusters, dummy, isMc, pdgCodeTrack1, true); + allTrackHisto.init(®istry, binmultTempFit, binMulPercentile, binpTTrack, binEta, binPhi, binTempFitVarTrack, binNSigmaTPC, binNSigmaTOF, binNSigmaTPCTOF, binTPCClusters, dummy, isMc, pdgCodeTrack1, true); + selectedTrackHisto.init(®istry, binmultTempFit, binMulPercentile, binpTTrack, binEta, binPhi, binTempFitVarTrack, binNSigmaTPC, binNSigmaTOF, binNSigmaTPCTOF, binTPCClusters, dummy, isMc, pdgCodeTrack1, true); sameEventCont.init(®istry, - binkstar, binpT, binkT, binmT, mixingBinMult, mixingBinMultPercentile, + binkstar, binpTTrack, binkT, binmT, mixingBinMult, mixingBinMultPercentile, bin4Dkstar, bin4DmT, bin4DMult, bin4DmultPercentile, isMc, use4D, extendedPlots, highkstarCut, @@ -212,16 +216,18 @@ struct HfTaskCharmHadronsFemtoDream { sameEventCont.setPDGCodes(pdgCodeTrack1, charmHadPDGCode); mixedEventCont.init(®istry, - binkstar, binpT, binkT, binmT, mixingBinMult, mixingBinMultPercentile, + binkstar, binpTTrack, binkT, binmT, mixingBinMult, mixingBinMultPercentile, bin4Dkstar, bin4DmT, bin4DMult, bin4DmultPercentile, isMc, use4D, extendedPlots, highkstarCut, smearingByOrigin, binInvMass); mixedEventCont.setPDGCodes(pdgCodeTrack1, charmHadPDGCode); - registryMixQa.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); - registryMixQa.add("MixingQA/hSECollisionPool", ";bin;Entries", kTH2F, {{100, -10, 10}, {2000, 0, 200}}); - registryMixQa.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + registryMixQa.add("MixingQA/hSECollisionBins", "; bin; Entries", kTH1F, {{120, -0.5, 119.5}}); + registryMixQa.add("MixingQA/hSECollisionPool", "; Vz (cm); Mul", kTH2F, {{100, -10, 10}, {200, 0, 200}}); + registryMixQa.add("MixingQA/hMECollisionBins", "; bin; Entries", kTH1F, {{120, -0.5, 119.5}}); + registryCharmHadronQa.add("CharmHadronQA/hPtVsMass", "; #it{p}_{T} (GeV/#it{c}); inv. mass (GeV/#it{c}^{2})", kTH2F, {binpTCharm, binInvMass}); + pairCleaner.init(®istry); if (useCPR.value) { pairCloseRejectionSE.init(®istry, ®istry, cprDeltaPhiMax.value, cprDeltaEtaMax.value, cprPlotPerRadii.value, 1); @@ -243,11 +249,6 @@ struct HfTaskCharmHadronsFemtoDream { fillCollision(col); processType = 1; // for same event - /// Histogramming same event - for (auto const& part : sliceTrk1) { - - trackHistoPartOne.fillQA(part, static_cast(ConfTempFitVarMomentum.value), col.multNtr(), col.multV0M()); - } for (auto const& [p1, p2] : combinations(CombinationsFullIndexPolicy(sliceTrk1, sliceCharmHad))) { @@ -304,6 +305,8 @@ struct HfTaskCharmHadronsFemtoDream { if (p2.pt() < charmHadMinPt || p2.pt() > charmHadMaxPt) { continue; } + /// Filling QA histograms of the selected tracks + selectedTrackHisto.fillQA(p1, static_cast(ConfTempFitVarMomentum.value), col.multNtr(), col.multV0M()); int charmHadMc = 0; int originType = 0; @@ -427,12 +430,26 @@ struct HfTaskCharmHadronsFemtoDream { FilteredFDParticles const& parts, FilteredCharmCands const&) { - if ((col.bitmaskTrackOne() & BitMask) != BitMask || (col.bitmaskTrackTwo() & BitMask) != BitMask) { - return; - } eventHisto.fillQA(col); auto sliceTrk1 = partitionTrk1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); auto sliceCharmHad = partitionCharmHadron->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + /// Filling QA histograms of the all tracks and all charm hadrons before pairing + for (auto const& part : sliceTrk1) { + allTrackHisto.fillQA(part, static_cast(ConfTempFitVarMomentum.value), col.multNtr(), col.multV0M()); + } + for (auto const& part : sliceCharmHad) { + float invMass; + if (part.candidateSelFlag() == 1) { + invMass = part.m(std::array{o2::constants::physics::MassProton, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); + } else { + invMass = part.m(std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassProton}); + } + registryCharmHadronQa.fill(HIST("CharmHadronQA/hPtVsMass"), part.pt(), invMass); + } + + if ((col.bitmaskTrackOne() & BitMask) != BitMask || (col.bitmaskTrackTwo() & BitMask) != BitMask) { + return; + } doSameEvent(sliceTrk1, sliceCharmHad, parts, col); } PROCESS_SWITCH(HfTaskCharmHadronsFemtoDream, processSameEvent, "Enable processing same event", false); @@ -467,15 +484,22 @@ struct HfTaskCharmHadronsFemtoDream { o2::aod::FDExtMCParticles const&, FilteredCharmMcCands const&) { - if ((col.bitmaskTrackOne() & BitMask) != BitMask || (col.bitmaskTrackTwo() & BitMask) != BitMask) { - return; - } + eventHisto.fillQA(col); + auto sliceMcTrk1 = partitionMcTrk1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); auto sliceMcCharmHad = partitionMcCharmHadron->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); if (sliceMcTrk1.size() == 0 && sliceMcCharmHad.size() == 0) { return; } + /// Filling QA histograms of the all mc tracks before pairing + for (auto const& part : sliceMcTrk1) { + allTrackHisto.fillQA(part, static_cast(ConfTempFitVarMomentum.value), col.multNtr(), col.multV0M()); + } + + if ((col.bitmaskTrackOne() & BitMask) != BitMask || (col.bitmaskTrackTwo() & BitMask) != BitMask) { + return; + } doSameEvent(sliceMcTrk1, sliceMcCharmHad, parts, col); } PROCESS_SWITCH(HfTaskCharmHadronsFemtoDream, processSameEventMc, "Enable processing same event for Monte Carlo", false); From 8fde854507f50a93b256d0b8f627a7bdf7de8161 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Tue, 26 Nov 2024 15:35:41 +0100 Subject: [PATCH 102/459] [PWGEM/Dilepton] first version of prefilter to reject photon conversion (#8638) --- PWGEM/Dilepton/Core/DielectronCut.cxx | 15 ++ PWGEM/Dilepton/Core/DielectronCut.h | 73 +++++++- PWGEM/Dilepton/Core/Dilepton.h | 55 +++++- PWGEM/Dilepton/Core/DileptonMC.h | 36 +++- PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 180 +++++++++++++++++-- 5 files changed, 333 insertions(+), 26 deletions(-) diff --git a/PWGEM/Dilepton/Core/DielectronCut.cxx b/PWGEM/Dilepton/Core/DielectronCut.cxx index 3d1987801cc..38e6e9c6103 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.cxx +++ b/PWGEM/Dilepton/Core/DielectronCut.cxx @@ -84,6 +84,21 @@ void DielectronCut::SetRequireDifferentSides(bool flag) mRequireDiffSides = flag; LOG(info) << "Dielectron Cut, require 2 tracks to be from different sides: " << mRequireDiffSides; } +void DielectronCut::SetPrefilterPhiV(float max_mee_uls, float max_phiv_uls, float max_mee_ls, float max_phiv_ls) +{ + mMaxMee_phiv_uls = max_mee_uls; + mMaxPhiV_uls = max_phiv_uls; + mSlope_phiv_ls = max_mee_ls / (M_PI - max_phiv_ls); + mIntercept_phiv_ls = max_mee_ls - mSlope_phiv_ls * M_PI; + LOG(info) << "Dielectron Cut, set phiv prefilter ULS: " << " mMaxMee_phiv_uls: " << mMaxMee_phiv_uls << " mMaxPhiV_uls: " << mMaxPhiV_uls; + LOG(info) << "Dielectron Cut, set phiv prefilter LS: " << " mSlope_phiv_ls: " << mSlope_phiv_ls << " mIntercept_phiv_ls: " << mIntercept_phiv_ls; +} +void DielectronCut::SetPrefilterMee(float min_mee_uls, float max_mee_uls) +{ + mMinMee_uls = min_mee_uls; + mMaxMee_uls = max_mee_uls; + LOG(info) << "Dielectron Cut, set mee prefilter ULS: " << " mMinMee_uls: " << mMinMee_uls << " mMaxMee_uls: " << mMaxMee_uls; +} void DielectronCut::SetTrackPtRange(float minPt, float maxPt) { mMinTrackPt = minPt; diff --git a/PWGEM/Dilepton/Core/DielectronCut.h b/PWGEM/Dilepton/Core/DielectronCut.h index ac3b6d2bb5b..f08d8cd3fcb 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.h +++ b/PWGEM/Dilepton/Core/DielectronCut.h @@ -143,7 +143,7 @@ class DielectronCut : public TNamed return false; } - if (opAng < mMinOpAng || mMaxOpAng < opAng) { // in sigma for pair + if (opAng < mMinOpAng || mMaxOpAng < opAng) { return false; } @@ -161,6 +161,70 @@ class DielectronCut : public TNamed return true; } + template + bool IsSelectedPair_PrefilterULS(TTrack1 const& t1, TTrack2 const& t2, const float bz) const + { + // don't move this function into IsSelectedPair. + if (!IsSelectedPair_PrefilterULS_Mee(t1, t2, bz)) { + return false; + } + if (!IsSelectedPair_PrefilterULS_PhiV(t1, t2, bz)) { + return false; + } + return true; + } + + template + bool IsSelectedPair_PrefilterULS_Mee(TTrack1 const& t1, TTrack2 const& t2, const float /*bz*/) const + { + // don't move this function into IsSelectedPair. + ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; + if (mMinMee_uls < v12.M() && v12.M() < mMaxMee_uls) { + return false; + } + return true; + } + + template + bool IsSelectedPair_PrefilterULS_PhiV(TTrack1 const& t1, TTrack2 const& t2, const float bz) const + { + // don't move this function into IsSelectedPair. + ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; + float phiv = getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), bz); + if (v12.M() < mMaxMee_phiv_uls && mMaxPhiV_uls < phiv) { + return false; + } + return true; + } + + template + bool IsSelectedPair_PrefilterLS(TTrack1 const& t1, TTrack2 const& t2, const float bz) const + { + // don't move this function into IsSelectedPair. + if (!IsSelectedPair_PrefilterLS_PhiV(t1, t2, bz)) { + return false; + } + return true; + } + + template + bool IsSelectedPair_PrefilterLS_PhiV(TTrack1 const& t1, TTrack2 const& t2, const float bz) const + { + // don't move this function into IsSelectedPair. + ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassElectron); + ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; + float phiv = getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), bz); + if (v12.M() < phiv * mSlope_phiv_ls + mIntercept_phiv_ls || v12.M() < (M_PI - phiv) * mSlope_phiv_ls + mIntercept_phiv_ls) { + return false; + } + return true; + } + template bool IsSelectedTrack(TTrack const& track, TCollision const& collision = 0) const { @@ -413,6 +477,8 @@ class DielectronCut : public TNamed void SelectPhotonConversion(bool flag); void SetMindEtadPhi(bool flag, float min_deta, float min_dphi); void SetRequireDifferentSides(bool flag); + void SetPrefilterPhiV(float max_mee_uls, float max_phiv_uls, float max_mee_ls, float max_phiv_ls); + void SetPrefilterMee(float min_mee_uls, float max_mee_uls); void SetTrackPtRange(float minPt = 0.f, float maxPt = 1e10f); void SetTrackEtaRange(float minEta = -1e10f, float maxEta = 1e10f); @@ -480,6 +546,11 @@ class DielectronCut : public TNamed float mMinOpAng{0.f}, mMaxOpAng{1e10f}; bool mRequireDiffSides{false}; // flag to require 2 tracks to be from different sides. (A-C combination). If one wants 2 tracks to be in the same side (A-A or C-C), one can simply use track eta cut. + // only for prefilter + float mMinMee_uls{0.f}, mMaxMee_uls{0.f}; + float mMaxMee_phiv_uls{0.f}, mMaxPhiV_uls{0.f}; // rectangle + float mSlope_phiv_ls{0.f}, mIntercept_phiv_ls{0.f}; // mee > phiv * slope + intercept + // kinematic cuts float mMinTrackPt{0.f}, mMaxTrackPt{1e10f}; // range in pT float mMinTrackEta{-1e10f}, mMaxTrackEta{1e10f}; // range in eta diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 70580bbdc74..311e87d82ec 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -75,7 +75,7 @@ using MyCollision = MyCollisions::iterator; using MyCollisionsWithSWT = soa::Join; using MyCollisionWithSWT = MyCollisionsWithSWT::iterator; -using MyElectrons = soa::Join; +using MyElectrons = soa::Join; using MyElectron = MyElectrons::iterator; using FilteredMyElectrons = soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; @@ -180,7 +180,15 @@ struct Dilepton { Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; - Configurable cfg_x_to_go{"cfg_x_to_go", -1, "x (cm) to be propagated in local coordinate"}; + + Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply phiv cut inherited from prefilter"}; + Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kFakeMatchITSTPC : 4] Please consider logical-OR among them."}; // see PairUtilities.h + Configurable cfgMinMee_uls{"cfgMinMee_uls", 0.0, "min mee for prefilter in GeV/c2"}; // only for ULS + Configurable cfgMaxMee_uls{"cfgMaxMee_uls", 0.01, "max mee for prefilter in GeV/c2"}; // only for ULS + Configurable cfgMaxMee_for_phiv_uls{"cfgMaxMee_for_phiv_uls", 0.65, "max mee at phiv = pi for ULS"}; // GeV/c2 + Configurable cfgMaxPhiV_uls{"cfgMaxPhiV_uls", 2.9, "min phiv for in ULS"}; // radian + Configurable cfgMaxMee_for_phiv_ls{"cfgMinMee_for_phiv", 0.25, "max mee at phiv = 0 and pi for LS"}; // GeV/c2 // symmetric + Configurable cfgMaxPhiV_ls{"cfgMaxPhiV_ls", 2.5, "min phiv for LS"}; // radian Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; @@ -204,6 +212,7 @@ struct Dilepton { Configurable cfg_max_p_its_cluster_size{"cfg_max_p_its_cluster_size", 0.0, "max p to apply ITS cluster size cut"}; Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + Configurable cfg_x_to_go{"cfg_x_to_go", -1, "x (cm) to be propagated in local coordinate"}; Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; @@ -525,10 +534,10 @@ struct Dilepton { if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca}, true); fRegistry.add("Pair/same/uls/hsDeltaP", "difference of p between 2 tracks;|p_{T,1} - p_{T,2}|/|p_{T,1} + p_{T,2}|;#Delta#eta;#Delta#varphi (rad.);", kTHnSparseD, {{20, 0, 1}, {100, -0.5, +0.5}, {180, -M_PI, M_PI}}, true); - fRegistry.add("Pair/same/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -50, 50}, {40, -10, 10}}, true); + fRegistry.add("Pair/same/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {80, -20, 20}}, true); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron - fRegistry.add("Pair/same/uls/hMvsPhiV_prop", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron + fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron + fRegistry.add("Pair/same/uls/hMvsPhiV_prop", Form("m_{ee} vs. #varphi_{V} at r = %2.1f cm;#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", dielectroncuts.cfg_x_to_go.value), kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron fRegistry.add("Pair/same/uls/hMvsOpAng", "m_{ee} vs. angle between 2 tracks;#omega (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{100, 0, 2.0}, {20, 0.0f, 3.2}}, true); } fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); @@ -652,6 +661,16 @@ struct Dilepton { fDielectronCut.SetPairOpAng(dielectroncuts.cfg_min_opang, dielectroncuts.cfg_max_opang); fDielectronCut.SetRequireDifferentSides(dielectroncuts.cfg_require_diff_sides); + // for prefilter + if (dielectroncuts.cfg_apply_cuts_from_prefilter) { + if ((dielectroncuts.cfg_prefilter_bits & (1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > 0) { + fDielectronCut.SetPrefilterMee(dielectroncuts.cfgMinMee_uls, dielectroncuts.cfgMaxMee_uls); + } + if ((dielectroncuts.cfg_prefilter_bits & (1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC))) > 0) { + fDielectronCut.SetPrefilterPhiV(dielectroncuts.cfgMaxMee_for_phiv_uls, dielectroncuts.cfgMaxPhiV_uls, dielectroncuts.cfgMaxMee_for_phiv_ls, dielectroncuts.cfgMaxPhiV_ls); + } + } + // for track fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, 1e+10f); fDielectronCut.SetTrackEtaRange(dielectroncuts.cfg_min_eta_track, dielectroncuts.cfg_max_eta_track); @@ -858,6 +877,10 @@ struct Dilepton { return false; } + if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { + return false; + } + if constexpr (ev_id == 0) { dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; @@ -876,12 +899,24 @@ struct Dilepton { ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; mee_prop = v12prop.M(); phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(px1, py1, pz1, px2, py2, pz2, t1.sign(), t2.sign(), d_bz); - } else { // mixed event dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())] - map_z_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] : map_z_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] - map_z_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; o2::math_utils::bringToPMPi(dphi_geom); rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; + + float px1 = map_px_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; + float py1 = map_py_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; + float pz1 = map_pz_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; + float px2 = map_px_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())]; + float py2 = map_py_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())]; + float pz2 = map_pz_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())]; + + ROOT::Math::PxPyPzMVector v1prop(px1, py1, pz1, leptonM1); + ROOT::Math::PxPyPzMVector v2prop(px2, py2, pz2, leptonM2); + ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; + mee_prop = v12prop.M(); + phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(px1, py1, pz1, px2, py2, pz2, t1.sign(), t2.sign(), d_bz); } if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { return false; @@ -1151,6 +1186,11 @@ struct Dilepton { Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && dielectroncuts.cfg_min_phi_track < o2::aod::track::phi && o2::aod::track::phi < dielectroncuts.cfg_max_phi_track && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; Filter pidFilter_electron = (dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl) && (o2::aod::pidtpc::tpcNSigmaPi < dielectroncuts.cfg_min_TPCNsigmaPi || dielectroncuts.cfg_max_TPCNsigmaPi < o2::aod::pidtpc::tpcNSigmaPi); Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfbpi0 >= static_cast(0)); + Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); @@ -1400,6 +1440,9 @@ struct Dilepton { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } + if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { + return false; + } float dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; float dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; o2::math_utils::bringToPMPi(dphi_geom); diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 84af68489da..a8b57d937af 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -65,7 +65,7 @@ using namespace o2::aod::pwgem::dilepton::utils::pairutil; using MyCollisions = soa::Join; using MyCollision = MyCollisions::iterator; -using MyMCElectrons = soa::Join; +using MyMCElectrons = soa::Join; using MyMCElectron = MyMCElectrons::iterator; using FilteredMyMCElectrons = soa::Filtered; using FilteredMyMCElectron = FilteredMyMCElectrons::iterator; @@ -159,7 +159,15 @@ struct DileptonMC { Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; - Configurable cfg_x_to_go{"cfg_x_to_go", -1, "x (cm) to be propagated in local coordinate"}; + + Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply phiv cut inherited from prefilter"}; + Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kFakeMatchITSTPC : 4] Please consider logical-OR among them."}; // see PairUtilities.h + Configurable cfgMinMee_uls{"cfgMinMee_uls", 0.0, "min mee for prefilter in GeV/c2"}; // only for ULS + Configurable cfgMaxMee_uls{"cfgMaxMee_uls", 0.01, "max mee for prefilter in GeV/c2"}; // only for ULS + Configurable cfgMaxMee_for_phiv_uls{"cfgMaxMee_for_phiv_uls", 0.65, "max mee at phiv = pi for ULS"}; // GeV/c2 + Configurable cfgMaxPhiV_uls{"cfgMaxPhiV_uls", 2.9, "min phiv for in ULS"}; // radian + Configurable cfgMaxMee_for_phiv_ls{"cfgMinMee_for_phiv", 0.25, "max mee at phiv = 0 and pi for LS"}; // GeV/c2 // symmetric + Configurable cfgMaxPhiV_ls{"cfgMaxPhiV_ls", 2.5, "min phiv for LS"}; // radian Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "max eta for single track"}; @@ -183,6 +191,7 @@ struct DileptonMC { Configurable cfg_max_p_its_cluster_size{"cfg_max_p_its_cluster_size", 0.0, "max p to apply ITS cluster size cut"}; Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + Configurable cfg_x_to_go{"cfg_x_to_go", -1, "x (cm) to be propagated in local coordinate"}; Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; @@ -357,6 +366,7 @@ struct DileptonMC { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.add("Pair/sm/Photon/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add("Pair/sm/Photon/hMvsRxy", "m_{ee} vs. r_{xy};r_{xy}^{true} (cm);m_{ee} (GeV/c^{2})", kTH2F, {{100, 0, 100}, {100, 0.0f, 1.0f}}, true); fRegistry.add("Pair/sm/Pi0/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); } @@ -556,6 +566,16 @@ struct DileptonMC { fDielectronCut.SetPairOpAng(dielectroncuts.cfg_min_opang, dielectroncuts.cfg_max_opang); fDielectronCut.SetRequireDifferentSides(dielectroncuts.cfg_require_diff_sides); + // for prefilter + if (dielectroncuts.cfg_apply_cuts_from_prefilter) { + if ((dielectroncuts.cfg_prefilter_bits & (1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > 0) { + fDielectronCut.SetPrefilterMee(dielectroncuts.cfgMinMee_uls, dielectroncuts.cfgMaxMee_uls); + } + if ((dielectroncuts.cfg_prefilter_bits & (1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC))) > 0) { + fDielectronCut.SetPrefilterPhiV(dielectroncuts.cfgMaxMee_for_phiv_uls, dielectroncuts.cfgMaxPhiV_uls, dielectroncuts.cfgMaxMee_for_phiv_ls, dielectroncuts.cfgMaxPhiV_ls); + } + } + // for track fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, 1e+10f); fDielectronCut.SetTrackEtaRange(-dielectroncuts.cfg_max_eta_track, +dielectroncuts.cfg_max_eta_track); @@ -724,6 +744,9 @@ struct DileptonMC { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } + if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { + return false; + } if (dielectroncuts.cfg_x_to_go > 0.f) { auto track_par_cov1 = getTrackParCov(t1); @@ -955,6 +978,8 @@ struct DileptonMC { fRegistry.fill(HIST("Pair/sm/Photon/hs"), v12.M(), v12.Pt(), v12.Rapidity(), abs(dphi), deta, abs(cos_thetaCS), abs(phiCS), aco, asym, abs(dphi_e_ee), pair_dca, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/sm/Photon/hMvsPhiV"), phiv, v12.M()); + float rxy_gen = std::sqrt(std::pow(t1mc.vx(), 2) + std::pow(t1mc.vy(), 2)); + fRegistry.fill(HIST("Pair/sm/Photon/hMvsRxy"), rxy_gen, v12.M()); } break; default: @@ -1057,6 +1082,10 @@ struct DileptonMC { Filter trackFilter_electron = dielectroncuts.cfg_min_phi_track < o2::aod::track::phi && o2::aod::track::phi < dielectroncuts.cfg_max_phi_track && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; Filter pidFilter_electron = (dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl) && (o2::aod::pidtpc::tpcNSigmaPi < dielectroncuts.cfg_min_TPCNsigmaPi || dielectroncuts.cfg_max_TPCNsigmaPi < o2::aod::pidtpc::tpcNSigmaPi); Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfbpi0 >= static_cast(0)); Preslice perCollision_muon = aod::emprimarymuon::emeventId; Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; @@ -1639,6 +1668,9 @@ struct DileptonMC { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } + if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { + return false; + } if (dielectroncuts.cfg_x_to_go > 0.f) { auto track_par_cov1 = getTrackParCov(t1); track_par_cov1.setPID(o2::track::PID::Electron); diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index 9d908c24de9..e310074c815 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -17,6 +17,8 @@ #include #include #include +// #include +// #include #include "TString.h" #include "Math/Vector4D.h" @@ -24,7 +26,9 @@ #include "Framework/AnalysisTask.h" #include "Framework/ASoAHelpers.h" #include "Common/Core/RecoDecay.h" +// #include "Common/Core/trackUtilities.h" +#include "DetectorsBase/Propagator.h" #include "DetectorsBase/GeometryManager.h" #include "DataFormatsParameters/GRPObject.h" #include "DataFormatsParameters/GRPMagField.h" @@ -61,15 +65,15 @@ struct prefilterDielectron { Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - // Configurable> cfgMaxMee{"cfgMaxMee", {0.01, 0.02, 0.04, 0.06, 0.08, 0.10}, "max mee steps for prefilter. Don't exceed 15 values!"}; Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgMaxMee{"cfgMaxMee", 0.01, "max mee for prefilter in GeV/c2"}; // only for ULS + Configurable cfgMinMee_uls{"cfgMinMee_uls", 0.0, "min mee for prefilter in GeV/c2"}; // only for ULS + Configurable cfgMaxMee_uls{"cfgMaxMee_uls", 0.01, "max mee for prefilter in GeV/c2"}; // only for ULS Configurable cfgMaxMee_for_phiv_uls{"cfgMaxMee_for_phiv_uls", 0.65, "max mee at phiv = pi for ULS"}; // GeV/c2 - Configurable cfgMinPhiV_uls{"cfgMinPhiV_uls", 2.9, "min phiv for in ULS"}; // radian - Configurable cfgMaxMee_for_phiv_ls{"cfgMinMee_for_phiv", 0.25, "max mee at phiv = 0 and pi for LS"}; // GeV/c2 // symmetric - Configurable cfgMinPhiVv_ls{"cfgMinPhiVv_ls", 2.5, "min phiv for LS"}; // radian + Configurable cfgMaxPhiV_uls{"cfgMaxPhiV_uls", 2.9, "min phiv for in ULS"}; // radian + Configurable cfgMaxMee_for_phiv_ls{"cfgMaxMee_for_phiv", 0.25, "max mee at phiv = 0 and pi for LS"}; // GeV/c2 // symmetric + Configurable cfgMaxPhiV_ls{"cfgMaxPhiV_ls", 2.5, "min phiv for LS"}; // radian EMEventCut fEMEventCut; struct : ConfigurableGroup { @@ -112,6 +116,7 @@ struct prefilterDielectron { Configurable cfg_max_p_its_cluster_size{"cfg_max_p_its_cluster_size", 0.0, "max p to apply ITS cluster size cut"}; Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + // Configurable cfg_x_to_go{"cfg_x_to_go", -1, "x (cm) to be propagated in local coordinate"}; Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; @@ -144,6 +149,7 @@ struct prefilterDielectron { Service ccdb; int mRunNumber; float d_bz; + o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; @@ -176,6 +182,7 @@ struct prefilterDielectron { if (fabs(d_bz) > 1e-5) { grpmag.setL3Current(30000.f / (d_bz / 5.0f)); } + o2::base::Propagator::initFieldFromGRP(&grpmag); mRunNumber = collision.runNumber(); return; } @@ -186,6 +193,7 @@ struct prefilterDielectron { if (!skipGRPOquery) grpo = ccdb->getForTimeStamp(grpPath, run3grp_timestamp); if (grpo) { + o2::base::Propagator::initFieldFromGRP(grpo); // Fetch magnetic field from ccdb for current collision d_bz = grpo->getNominalL3Field(); LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; @@ -194,6 +202,7 @@ struct prefilterDielectron { if (!grpmag) { LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp; } + o2::base::Propagator::initFieldFromGRP(grpmag); // Fetch magnetic field from ccdb for current collision d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f); LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; @@ -212,7 +221,10 @@ struct prefilterDielectron { // for pair fRegistry.add("Pair/before/uls/hMvsPt", "m_{ee} vs. p_{T,ee}", kTH2D, {axis_mass, axis_pair_pt}, true); fRegistry.add("Pair/before/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {axis_phiv, {200, 0, 1}}, true); - fRegistry.add("Pair/before/uls/hDeltaEtaDeltaPhi", "d#eta-d#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {100, -0.5, +0.5}}, true); + fRegistry.add("Pair/before/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {100, -0.5, +0.5}}, true); + // fRegistry.add("Pair/before/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -20, 20}, {100, -10, 10}}, true); + // fRegistry.add("Pair/before/uls/hMvsPhiV_prop", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.addClone("Pair/before/uls/", "Pair/before/lspp/"); fRegistry.addClone("Pair/before/uls/", "Pair/before/lsmm/"); fRegistry.addClone("Pair/before/", "Pair/after/"); @@ -246,6 +258,10 @@ struct prefilterDielectron { fDielectronCut.SetPairOpAng(0.f, 3.2f); fDielectronCut.SetRequireDifferentSides(false); + // for prefilter + fDielectronCut.SetPrefilterPhiV(cfgMaxMee_for_phiv_uls, cfgMaxPhiV_uls, cfgMaxMee_for_phiv_ls, cfgMaxPhiV_ls); + fDielectronCut.SetPrefilterMee(cfgMinMee_uls, cfgMaxMee_uls); + // for track fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, 1e+10f); fDielectronCut.SetTrackEtaRange(dielectroncuts.cfg_min_eta_track, dielectroncuts.cfg_max_eta_track); @@ -302,6 +318,40 @@ struct prefilterDielectron { } // end of PID ML } + // std::map, float> map_z_prop; // map -> geometrical z position at propagated point + // std::map, float> map_phi_prop; // map -> geometrical phi position at propagated point + // std::map, float> map_px_prop; // map -> px at propagated point + // std::map, float> map_py_prop; // map -> py at propagated point + // std::map, float> map_pz_prop; // map -> pz at propagated point + + // template + // void propagateElectron(TTracks const& tracks) + // { + // // this has to be called after initCCDB for bz. + // for (auto& track : tracks) { + // auto track_par_cov = getTrackParCov(track); + // track_par_cov.setPID(o2::track::PID::Electron); + // o2::base::Propagator::Instance()->propagateToX(track_par_cov, dielectroncuts.cfg_x_to_go, d_bz, o2::base::PropagatorImpl::MAX_SIN_PHI, o2::base::PropagatorImpl::MAX_STEP, matCorr); + // auto xyz = track_par_cov.getXYZGlo(); + // // float eta = RecoDecay::eta(std::array{xyz.X(), xyz.Y(), xyz.Z()}); + // float phi = RecoDecay::phi(std::array{xyz.X(), xyz.Y()}); + // o2::math_utils::bringTo02Pi(phi); + // map_z_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = xyz.Z(); + // map_phi_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = phi; + + // std::array pxpypz_prop = {0, 0, 0}; // px, py, pz + // getPxPyPz(track_par_cov, pxpypz_prop); + // map_px_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[0]; + // map_py_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[1]; + // map_pz_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[2]; + + // // float r = sqrt(pow(xyz.X(),2) + pow(xyz.Y(), 2)); + // // float theta = 2.f * std::atan(std::exp(-eta)); + // // float z = r/std::tan(theta); + // // LOGF(info, "r = %f, z = %f , xyz.Z() = %f", r, z, xyz.Z()); + // } + // } + std::unordered_map map_pfb; // map track.globalIndex -> prefilter bit SliceCache cache; @@ -314,6 +364,7 @@ struct prefilterDielectron { Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin < o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; using FilteredMyCollisions = soa::Filtered; + int ndf = 0; void processPFB(FilteredMyCollisions const& collisions, MyTracks const& tracks) { for (auto& track : tracks) { @@ -341,6 +392,11 @@ struct prefilterDielectron { continue; } + // if (dielectroncuts.cfg_x_to_go > 0.f) { + // propagateElectron(posTracks_per_coll); + // propagateElectron(negTracks_per_coll); + // } + // LOGF(info, "centrality = %f , posTracks_per_coll.size() = %d, negTracks_per_coll.size() = %d", centralities[cfgCentEstimator], posTracks_per_coll.size(), negTracks_per_coll.size()); for (auto& [pos, ele] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS @@ -357,15 +413,30 @@ struct prefilterDielectron { float dphi = pos.sign() * v1.Pt() > ele.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); - fRegistry.fill(HIST("Pair/before/uls/hMvsPt"), v12.M(), v12.Pt()); + // float dz_geom = pos.sign() * pos.pt() > ele.sign() * ele.pt() ? map_z_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] : map_z_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())]; + // float dphi_geom = pos.sign() * pos.pt() > ele.sign() * ele.pt() ? map_phi_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] : map_phi_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())]; + // o2::math_utils::bringToPMPi(dphi_geom); + // float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; + + // ROOT::Math::PxPyPzMVector v1prop(map_px_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_py_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v2prop(map_px_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_py_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; + // float mee_prop = v12prop.M(); + // float phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(map_px_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_py_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], + // map_px_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_py_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], + // pos.sign(), ele.sign(), d_bz); + fRegistry.fill(HIST("Pair/before/uls/hMvsPhiV"), phiv, v12.M()); + fRegistry.fill(HIST("Pair/before/uls/hMvsPt"), v12.M(), v12.Pt()); fRegistry.fill(HIST("Pair/before/uls/hDeltaEtaDeltaPhi"), dphi, deta); + // fRegistry.fill(HIST("Pair/before/uls/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); + // fRegistry.fill(HIST("Pair/before/uls/hMvsPhiV_prop"), phiv_prop, mee_prop); - if (v12.M() < cfgMaxMee) { + if (!fDielectronCut.IsSelectedPair_PrefilterULS_Mee(pos, ele, d_bz)) { map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee); map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee); } - if (v12.M() < cfgMaxMee_for_phiv_uls && cfgMinPhiV_uls < phiv) { + if (!fDielectronCut.IsSelectedPair_PrefilterULS_PhiV(pos, ele, d_bz)) { map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); } @@ -385,13 +456,26 @@ struct prefilterDielectron { float dphi = pos1.sign() * v1.Pt() > pos2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); + // float dz_geom = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? map_z_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] : map_z_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())]; + // float dphi_geom = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? map_phi_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())]; + // o2::math_utils::bringToPMPi(dphi_geom); + // float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; + + // ROOT::Math::PxPyPzMVector v1prop(map_px_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_py_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v2prop(map_px_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_py_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; + // float mee_prop = v12prop.M(); + // float phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(map_px_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_py_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], + // map_px_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_py_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], + // pos1.sign(), pos2.sign(), d_bz); + fRegistry.fill(HIST("Pair/before/lspp/hMvsPt"), v12.M(), v12.Pt()); fRegistry.fill(HIST("Pair/before/lspp/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/before/lspp/hDeltaEtaDeltaPhi"), dphi, deta); + // fRegistry.fill(HIST("Pair/before/lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); + // fRegistry.fill(HIST("Pair/before/lspp/hMvsPhiV_prop"), phiv_prop, mee_prop); - float slope = cfgMaxMee_for_phiv_ls / (M_PI - cfgMinPhiVv_ls); - float intercept = cfgMaxMee_for_phiv_ls - slope * M_PI; - if (v12.M() < phiv * slope + intercept || v12.M() < (M_PI - phiv) * slope + intercept) { + if (!fDielectronCut.IsSelectedPair_PrefilterLS_PhiV(pos1, pos2, d_bz)) { map_pfb[pos1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); map_pfb[pos2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); } @@ -411,12 +495,26 @@ struct prefilterDielectron { float dphi = ele1.sign() * v1.Pt() > ele2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); + // float dz_geom = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? map_z_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] : map_z_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())]; + // float dphi_geom = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? map_phi_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())]; + // o2::math_utils::bringToPMPi(dphi_geom); + // float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; + + // ROOT::Math::PxPyPzMVector v1prop(map_px_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_py_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v2prop(map_px_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_py_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; + // float mee_prop = v12prop.M(); + // float phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(map_px_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_py_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], + // map_px_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_py_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], + // ele1.sign(), ele2.sign(), d_bz); + fRegistry.fill(HIST("Pair/before/lsmm/hMvsPt"), v12.M(), v12.Pt()); fRegistry.fill(HIST("Pair/before/lsmm/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/before/lsmm/hDeltaEtaDeltaPhi"), dphi, deta); - float slope = cfgMaxMee_for_phiv_ls / (M_PI - cfgMinPhiVv_ls); - float intercept = cfgMaxMee_for_phiv_ls - slope * M_PI; - if (v12.M() < phiv * slope + intercept || v12.M() < (M_PI - phiv) * slope + intercept) { + // fRegistry.fill(HIST("Pair/before/lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); + // fRegistry.fill(HIST("Pair/before/lsmm/hMvsPhiV_prop"), phiv_prop, mee_prop); + + if (!fDielectronCut.IsSelectedPair_PrefilterLS_PhiV(ele1, ele2, d_bz)) { map_pfb[ele1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); map_pfb[ele2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); } @@ -458,9 +556,25 @@ struct prefilterDielectron { float deta = pos.sign() * v1.Pt() > ele.sign() * v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); float dphi = pos.sign() * v1.Pt() > ele.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); - fRegistry.fill(HIST("Pair/after/uls/hMvsPt"), v12.M(), v12.Pt()); + + // float dz_geom = pos.sign() * pos.pt() > ele.sign() * ele.pt() ? map_z_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] : map_z_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())]; + // float dphi_geom = pos.sign() * pos.pt() > ele.sign() * ele.pt() ? map_phi_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] : map_phi_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())]; + // o2::math_utils::bringToPMPi(dphi_geom); + // float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; + + // ROOT::Math::PxPyPzMVector v1prop(map_px_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_py_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v2prop(map_px_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_py_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; + // float mee_prop = v12prop.M(); + // float phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(map_px_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_py_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], + // map_px_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_py_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], + // pos.sign(), ele.sign(), d_bz); + fRegistry.fill(HIST("Pair/after/uls/hMvsPhiV"), phiv, v12.M()); + fRegistry.fill(HIST("Pair/after/uls/hMvsPt"), v12.M(), v12.Pt()); fRegistry.fill(HIST("Pair/after/uls/hDeltaEtaDeltaPhi"), dphi, deta); + // fRegistry.fill(HIST("Pair/after/uls/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); + // fRegistry.fill(HIST("Pair/after/uls/hMvsPhiV_prop"), phiv_prop, mee_prop); } for (auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ @@ -478,9 +592,25 @@ struct prefilterDielectron { float deta = pos1.sign() * v1.Pt() > pos2.sign() * v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); float dphi = pos1.sign() * v1.Pt() > pos2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); + + // float dz_geom = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? map_z_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] : map_z_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())]; + // float dphi_geom = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? map_phi_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())]; + // o2::math_utils::bringToPMPi(dphi_geom); + // float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; + + // ROOT::Math::PxPyPzMVector v1prop(map_px_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_py_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v2prop(map_px_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_py_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; + // float mee_prop = v12prop.M(); + // float phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(map_px_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_py_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], + // map_px_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_py_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], + // pos1.sign(), pos2.sign(), d_bz); + fRegistry.fill(HIST("Pair/after/lspp/hMvsPt"), v12.M(), v12.Pt()); fRegistry.fill(HIST("Pair/after/lspp/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/after/lspp/hDeltaEtaDeltaPhi"), dphi, deta); + // fRegistry.fill(HIST("Pair/after/lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); + // fRegistry.fill(HIST("Pair/after/lspp/hMvsPhiV_prop"), phiv_prop, mee_prop); } for (auto& [ele1, ele2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- @@ -498,13 +628,29 @@ struct prefilterDielectron { float deta = ele1.sign() * v1.Pt() > ele2.sign() * v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); float dphi = ele1.sign() * v1.Pt() > ele2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); + + // float dz_geom = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? map_z_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] : map_z_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())]; + // float dphi_geom = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? map_phi_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())]; + // o2::math_utils::bringToPMPi(dphi_geom); + // float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; + + // ROOT::Math::PxPyPzMVector v1prop(map_px_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_py_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v2prop(map_px_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_py_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], o2::constants::physics::MassElectron); + // ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; + // float mee_prop = v12prop.M(); + // float phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(map_px_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_py_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], + // map_px_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_py_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], + // ele1.sign(), ele2.sign(), d_bz); + fRegistry.fill(HIST("Pair/after/lsmm/hMvsPt"), v12.M(), v12.Pt()); fRegistry.fill(HIST("Pair/after/lsmm/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/after/lsmm/hDeltaEtaDeltaPhi"), dphi, deta); + // fRegistry.fill(HIST("Pair/after/lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); + // fRegistry.fill(HIST("Pair/after/lsmm/hMvsPhiV_prop"), phiv_prop, mee_prop); } } // end of collision loop - + ndf++; map_pfb.clear(); } // end of process PROCESS_SWITCH(prefilterDielectron, processPFB, "produce prefilter bit", false); From 6caafc34a0023373ccbf1b3007aeae0b47fe54af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Tue, 26 Nov 2024 15:35:57 +0100 Subject: [PATCH 103/459] [DPG] [TOF] add pv contributors histogram (#8619) --- DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx index d1420da31fc..24e5a09a21a 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx @@ -262,6 +262,7 @@ struct tofPidQa { { const AxisSpec multAxis{100, 0, 100, "TOF multiplicity"}; const AxisSpec vtxZAxis{100, -20, 20, "Vtx_{z} (cm)"}; + const AxisSpec contributorsAxis{100, 0, 1000, "PV contributors"}; const AxisSpec etaAxis{etaBins, "#it{#eta}"}; const AxisSpec phiAxis{phiBins, "#it{#phi}"}; const AxisSpec colTimeAxis{100, -2000, 2000, "Collision time (ps)"}; @@ -295,6 +296,7 @@ struct tofPidQa { h->GetXaxis()->SetBinLabel(5, "hasTOF"); h->GetXaxis()->SetBinLabel(6, "goodTOFMatch"); + histos.add("event/pvcontributors", "", kTH1D, {contributorsAxis}); histos.add("event/vertexz", "", kTH1D, {vtxZAxis}); h = histos.add("event/particlehypo", "", kTH1D, {{10, 0, 10, "PID in tracking"}}); for (int i = 0; i < 9; i++) { @@ -389,6 +391,7 @@ struct tofPidQa { pvContributors++; } } + histos.fill(HIST("event/pvcontributors"), pvContributors); if (pvContributors < pvContributorsMin) { return false; } From bb535d21333e4239385e3cd5eca7160535771b45 Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:36:12 +0100 Subject: [PATCH 104/459] [PWGDQ] Cross Term <<2><4>> + option s in TProfile (Cumulants calculation) (#8631) --- PWGDQ/Core/HistogramsLibrary.cxx | 14 ++++++++------ PWGDQ/Core/VarManager.cxx | 4 ++++ PWGDQ/Core/VarManager.h | 6 ++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 44aaad223f4..c23dbc30a2e 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -241,12 +241,14 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Psi2A_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2A); hm->AddHistogram(histClass, "Psi2B_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2B); hm->AddHistogram(histClass, "Psi2C_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2C); - hm->AddHistogram(histClass, "centrFT0C_Corr2REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REF, VarManager::kM11REF); - hm->AddHistogram(histClass, "centrFT0C_Corr2REFetagap_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); - hm->AddHistogram(histClass, "centrFT0C_Corr4REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR4REF, VarManager::kM1111REF); - hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REF_ev", "", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2REF, VarManager::kM11REF); - hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); - hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); + hm->AddHistogram(histClass, "centrFT0C_Corr2REF_ev", "centrFT0C_Corr2REF_ev, --s--", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REF, VarManager::kM11REF); + hm->AddHistogram(histClass, "centrFT0C_Corr2REFetagap_ev", "centrFT0C_Corr2REFetagap_ev, --s--", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); + hm->AddHistogram(histClass, "centrFT0C_Corr4REF_ev", "centrFT0C_Corr4REF_ev, --s--", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR4REF, VarManager::kM1111REF); + hm->AddHistogram(histClass, "centrFT0C_Corr2Corr4REF_ev", "centrFT0C_Corr2Corr4REF_ev, --s--", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); + hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REF_ev", "Run2_centrFT0C_Corr2REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2REF, VarManager::kM11REF); + hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "Run2_centrFT0C_Corr2REFetagap_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); + hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "Run2_centrFT0C_Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); + hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2Corr4REF_ev", "Run2_centrFT0C_Corr2Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2CORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); hm->AddHistogram(histClass, "Corr2REFerrorsetagap", "", 4, std::array{VarManager::kCentFT0C, VarManager::kCORR2REFetagapw, VarManager::kCORR2REFetagapsquaredw, VarManager::kM11REFetagap}.data(), std::array{100, 5000, 5000, 5000}.data(), std::array{0.0, -5000.0, 0.0, 0.0}.data(), std::array{100.0, 5000.0, 100.0, 300000.0}.data(), nullptr, -1, true, true); hm->AddHistogram(histClass, "Corr2REFerrors", "", 4, std::array{VarManager::kCentFT0C, VarManager::kCORR2REFw, VarManager::kCORR2REFsquaredw, VarManager::kM11REF}.data(), std::array{100, 10000, 10000, 10000}.data(), std::array{0.0, -40000.0, 0.0, 0.0}.data(), std::array{100.0, 40000.0, 100.0, 6000000.0}.data(), nullptr, -1, true, true); hm->AddHistogram(histClass, "Corr4REFerrors", "", 4, std::array{VarManager::kCentFT0C, VarManager::kCORR4REFw, VarManager::kCORR4REFsquaredw, VarManager::kM1111REF}.data(), std::array{100, 100000, 100000, 100000}.data(), std::array{0.0, -30000000.0, 0.0, 0.0}.data(), std::array{100.0, 90000000.0, 40000.0, 9000000000000.0}.data(), nullptr, -1, true, true); diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index 0f9892c6c2f..b21293bf42c 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -765,6 +765,10 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kM1111REF] = ""; fgVariableNames[kM1111REFsmall] = "M_{1111}^{REF}small "; fgVariableUnits[kM1111REFsmall] = ""; + fgVariableNames[kM11M1111REF] = "M_{11}_{REF}M_{1111}_{REF} "; + fgVariableUnits[kM11M1111REF] = ""; + fgVariableNames[kCORR2CORR4REF] = "<2><4>"; + fgVariableUnits[kCORR2CORR4REF] = ""; fgVariableNames[kM0111POI] = "M^{'}_{0111}^{POI} "; fgVariableUnits[kM0111POI] = ""; fgVariableNames[kCORR2REF] = "<2> "; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 8c18ab0394a..c6ae7d4a906 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -646,6 +646,8 @@ class VarManager : public TObject kM01POI, kM1111REF, kM1111REFsmall, + kM11M1111REF, + kCORR2CORR4REF, kM0111POI, kCORR2REF, kCORR2REFw, @@ -1651,6 +1653,8 @@ void VarManager::FillEvent(T const& event, float* values) if constexpr ((fillMap & ReducedEventRefFlow) > 0) { values[kM1111REF] = event.m1111ref(); values[kM1111REFsmall] = event.m1111ref(); + values[kM11M1111REF] = event.m1111ref(); + values[kCORR2CORR4REF] = event.corr4ref(); values[kM11REF] = event.m11ref(); values[kM11REFetagap] = event.m11ref(); values[kCORR2REF] = event.corr2ref(); @@ -4027,6 +4031,8 @@ void VarManager::FillQVectorFromGFW(C const& /*collision*/, A const& compA11, A values[kCORR2REFsquaredw] = values[kCORR2REF] * values[kCORR2REF] * values[kM11REF]; values[kCORR4REFw] = values[kCORR4REF] * values[kM1111REF]; values[kCORR4REFsquaredw] = values[kCORR4REF] * values[kCORR4REF] * values[kM1111REF]; + values[kCORR2CORR4REF] = values[kCORR2REF] * values[kCORR4REF]; + values[kM11M1111REF] = values[kM11REF] * values[kM1111REF]; // For cumulants: A = Full TPC, B = Negative TPC, C = Positive TPC complex QA(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); From 8545891d9749adf365b4ce9896da15bda8c90952 Mon Sep 17 00:00:00 2001 From: syano0822 <32352856+syano0822@users.noreply.github.com> Date: Tue, 26 Nov 2024 23:36:28 +0900 Subject: [PATCH 105/459] [Common] Modified the match-mft-mch-data.cxx to reduce table size (#8656) Co-authored-by: Satoshi Yano --- Common/TableProducer/match-mft-mch-data.cxx | 368 ++++++++++---------- 1 file changed, 176 insertions(+), 192 deletions(-) diff --git a/Common/TableProducer/match-mft-mch-data.cxx b/Common/TableProducer/match-mft-mch-data.cxx index affa18f325d..d87504ccfef 100644 --- a/Common/TableProducer/match-mft-mch-data.cxx +++ b/Common/TableProducer/match-mft-mch-data.cxx @@ -107,20 +107,9 @@ namespace muon_params DECLARE_SOA_COLUMN(TRACKCHI2, trackChi2, float); DECLARE_SOA_COLUMN(RABS, rabs, float); DECLARE_SOA_COLUMN(Q, q, int16_t); - DECLARE_SOA_COLUMN(PT, pt, float); DECLARE_SOA_COLUMN(ETA, eta, float); DECLARE_SOA_COLUMN(PHI, phi, float); - -DECLARE_SOA_COLUMN(PT_AT_PV, pt_pv, float); -DECLARE_SOA_COLUMN(ETA_AT_PV, eta_pv, float); -DECLARE_SOA_COLUMN(PHI_AT_PV, phi_pv, float); - -DECLARE_SOA_COLUMN(PT_AT_DCA, pt_dca, float); -DECLARE_SOA_COLUMN(ETA_AT_DCA, eta_dca, float); -DECLARE_SOA_COLUMN(PHI_AT_DCA, phi_dca, float); -DECLARE_SOA_COLUMN(DCA, dca, float); - DECLARE_SOA_COLUMN(HASMFT, has_mft, bool); } // namespace muon_params @@ -131,13 +120,6 @@ DECLARE_SOA_TABLE(MUONParams, "AOD", "MUON", muon_params::PT, muon_params::ETA, muon_params::PHI, - muon_params::PT_AT_PV, - muon_params::ETA_AT_PV, - muon_params::PHI_AT_PV, - muon_params::PT_AT_DCA, - muon_params::ETA_AT_DCA, - muon_params::PHI_AT_DCA, - muon_params::DCA, muon_params::HASMFT); namespace mft_params @@ -146,13 +128,9 @@ DECLARE_SOA_COLUMN(NCLUST, nclust, int); DECLARE_SOA_COLUMN(ISCA, isCA, bool); DECLARE_SOA_COLUMN(TRACKCHI2, trackChi2, float); DECLARE_SOA_COLUMN(Q, q, int16_t); -DECLARE_SOA_COLUMN(PT, pt, float); -DECLARE_SOA_COLUMN(ETA, eta, float); -DECLARE_SOA_COLUMN(PHI, phi, float); DECLARE_SOA_COLUMN(PT_AT_DCA, pt_dca, float); DECLARE_SOA_COLUMN(ETA_AT_DCA, eta_dca, float); DECLARE_SOA_COLUMN(PHI_AT_DCA, phi_dca, float); -DECLARE_SOA_COLUMN(DCA, dca, float); DECLARE_SOA_COLUMN(DCAx, dcax, float); DECLARE_SOA_COLUMN(DCAy, dcay, float); } // namespace mft_params @@ -162,15 +140,11 @@ DECLARE_SOA_TABLE(MFTParams, "AOD", "MFT", mft_params::ISCA, mft_params::TRACKCHI2, mft_params::Q, - mft_params::PT, - mft_params::ETA, - mft_params::PHI, mft_params::PT_AT_DCA, mft_params::ETA_AT_DCA, mft_params::PHI_AT_DCA, mft_params::DCAx, - mft_params::DCAy, - mft_params::DCA); + mft_params::DCAy); namespace matching_params { @@ -200,9 +174,6 @@ DECLARE_SOA_COLUMN(MftDCA, mftdca, float); } // namespace matching_params DECLARE_SOA_TABLE(MatchParams, "AOD", "MATCHING", - matching_params::NClustMFTTracks, - matching_params::Chi2MFTTracks, - matching_params::DeltaP, matching_params::DeltaPt, matching_params::DeltaEta, matching_params::DeltaPhi, @@ -210,13 +181,9 @@ DECLARE_SOA_TABLE(MatchParams, "AOD", "MATCHING", matching_params::DeltaY, matching_params::MchPt, matching_params::MchEta, - matching_params::MchPhi, matching_params::MchQ, - matching_params::MftPt, matching_params::MftEta, - matching_params::MftPhi, - matching_params::MftQ, - matching_params::MftDCA); + matching_params::MftQ); namespace mix_matching_params { @@ -243,13 +210,21 @@ DECLARE_SOA_COLUMN(MftQ, mftq, float); DECLARE_SOA_COLUMN(MftDCA, mftdca, float); } // namespace mix_matching_params +DECLARE_SOA_TABLE(MixMatchParams, "AOD", "MIXMATCHING", + mix_matching_params::DeltaPt, + mix_matching_params::DeltaEta, + mix_matching_params::DeltaPhi, + mix_matching_params::DeltaX, + mix_matching_params::DeltaY, + mix_matching_params::MchPt, + mix_matching_params::MchEta, + mix_matching_params::MchQ, + mix_matching_params::MftEta, + mix_matching_params::MftQ); + namespace tag_matching_params { // matching parameters -DECLARE_SOA_COLUMN(NClustMFTTracks, nClustMFT, int); -DECLARE_SOA_COLUMN(Chi2MFTTracks, chi2MFT, float); - -DECLARE_SOA_COLUMN(DeltaP, dp_mchplane, float); DECLARE_SOA_COLUMN(DeltaPt, dpt_mchplane, float); DECLARE_SOA_COLUMN(DeltaEta, deta_mchplane, float); DECLARE_SOA_COLUMN(DeltaPhi, dphi_mchplane, float); @@ -258,22 +233,14 @@ DECLARE_SOA_COLUMN(DeltaY, dy_mchplane, float); DECLARE_SOA_COLUMN(MchPt, mchpt, float); DECLARE_SOA_COLUMN(MchEta, mcheta, float); -DECLARE_SOA_COLUMN(MchPhi, mchphi, float); DECLARE_SOA_COLUMN(MchQ, mchq, float); -DECLARE_SOA_COLUMN(MftPt, mftpt, float); DECLARE_SOA_COLUMN(MftEta, mfteta, float); -DECLARE_SOA_COLUMN(MftPhi, mftphi, float); DECLARE_SOA_COLUMN(MftQ, mftq, float); -DECLARE_SOA_COLUMN(MftDCA, mftdca, float); - DECLARE_SOA_COLUMN(IsTaged, isTaged, bool); } // namespace tag_matching_params DECLARE_SOA_TABLE(TagMatchParams, "AOD", "TAGMATCHING", - tag_matching_params::NClustMFTTracks, - tag_matching_params::Chi2MFTTracks, - tag_matching_params::DeltaP, tag_matching_params::DeltaPt, tag_matching_params::DeltaEta, tag_matching_params::DeltaPhi, @@ -281,19 +248,16 @@ DECLARE_SOA_TABLE(TagMatchParams, "AOD", "TAGMATCHING", tag_matching_params::DeltaY, tag_matching_params::MchPt, tag_matching_params::MchEta, - tag_matching_params::MchPhi, tag_matching_params::MchQ, - tag_matching_params::MftPt, tag_matching_params::MftEta, - tag_matching_params::MftPhi, tag_matching_params::MftQ, - tag_matching_params::MftDCA, tag_matching_params::IsTaged); namespace probe_matching_params { // matching parameters DECLARE_SOA_COLUMN(NMFTCandTagMuon, nTagMFT, int); +DECLARE_SOA_COLUMN(NMFTCandProbeMuon, nProbeMFT, int); DECLARE_SOA_COLUMN(TagMuonP, tagmuonp, float); DECLARE_SOA_COLUMN(NClustMFTTracks, nClustMFT, int); @@ -320,10 +284,8 @@ DECLARE_SOA_COLUMN(MftDCA, mftdca, float); DECLARE_SOA_TABLE(ProbeMatchParams, "AOD", "PROBEMATCHING", probe_matching_params::NMFTCandTagMuon, + probe_matching_params::NMFTCandProbeMuon, probe_matching_params::TagMuonP, - probe_matching_params::NClustMFTTracks, - probe_matching_params::Chi2MFTTracks, - probe_matching_params::DeltaP, probe_matching_params::DeltaPt, probe_matching_params::DeltaEta, probe_matching_params::DeltaPhi, @@ -331,32 +293,9 @@ DECLARE_SOA_TABLE(ProbeMatchParams, "AOD", "PROBEMATCHING", probe_matching_params::DeltaY, probe_matching_params::MchPt, probe_matching_params::MchEta, - probe_matching_params::MchPhi, probe_matching_params::MchQ, - probe_matching_params::MftPt, probe_matching_params::MftEta, - probe_matching_params::MftPhi, - probe_matching_params::MftQ, - probe_matching_params::MftDCA); - -DECLARE_SOA_TABLE(MixMatchParams, "AOD", "MIXMATCHING", - mix_matching_params::NClustMFTTracks, - mix_matching_params::Chi2MFTTracks, - mix_matching_params::DeltaP, - mix_matching_params::DeltaPt, - mix_matching_params::DeltaEta, - mix_matching_params::DeltaPhi, - mix_matching_params::DeltaX, - mix_matching_params::DeltaY, - mix_matching_params::MchPt, - mix_matching_params::MchEta, - mix_matching_params::MchPhi, - mix_matching_params::MchQ, - mix_matching_params::MftPt, - mix_matching_params::MftEta, - mix_matching_params::MftPhi, - mix_matching_params::MftQ, - mix_matching_params::MftDCA); + probe_matching_params::MftQ); namespace muon_pair { @@ -379,7 +318,6 @@ DECLARE_SOA_COLUMN(Rap, rap, float); } // namespace tag_muon_pair DECLARE_SOA_TABLE(TagMuonPair, "AOD", "TAGDIMUON", tag_muon_pair::NMFT, tag_muon_pair::Q, tag_muon_pair::M, tag_muon_pair::Pt, tag_muon_pair::Rap); - } // namespace o2::aod struct match_mft_mch_data { @@ -399,40 +337,54 @@ struct match_mft_mch_data { {"hMchCorrP", "MCH track total momentum (propagated to PV); p [GeV/c]; Counts", {HistType::kTH1F, {{2000, 0, 200}}}}, {"hMassCorrMchPair", "Corrected MCH track pair mass (propagated to PV); m [GeV/c^{2}]; Counts", {HistType::kTH1F, {{1000, 0, 10}}}}}}; + //// Variables for selecting muon tracks Configurable fEtaMchLow{"cfgEtaMchLow", -4.0f, ""}; Configurable fEtaMchUp{"cfgEtaMchUp", -2.5f, ""}; - Configurable fEtaMftLow{"cfgEtaMftlow", -3.6f, ""}; - Configurable fEtaMftUp{"cfgEtaMftup", -2.5f, ""}; - // Filter etaMchFilter = (fEtaMchLow < aod::fwdtrack::eta) && (aod::fwdtrack::eta < fEtaMchUp); - Configurable fRabsLow1{"cfgRabsLow1", 17.6f, ""}; Configurable fRabsUp1{"cfgRabsUp1", 26.5f, ""}; Configurable fRabsLow2{"cfgRabsLow2", 26.5f, ""}; Configurable fRabsUp2{"cfgRabsUp2", 89.5f, ""}; Configurable fPdcaUp1{"cfgPdcaUp1", 594.f, ""}; Configurable fPdcaUp2{"cfgPdcaUp2", 324.f, ""}; - // Filter rAbsFilter = (fRabsLow1 < aod::fwdtrack::rAtAbsorberEnd && aod::fwdtrack::rAtAbsorberEnd < fRabsUp1 && aod::fwdtrack::pDca < fPdcaUp1) || (fRabsLow2 < aod::fwdtrack::rAtAbsorberEnd && aod::fwdtrack::rAtAbsorberEnd < fRabsUp2 && aod::fwdtrack::pDca < fPdcaUp2); - Configurable fTrackChi2MchUp{"cfgTrackChi2MchUp", 5.f, ""}; - // Filter trackChi2MchFilter = aod::fwdtrack::chi2 < fTrackChi2MchUp; - Configurable fMatchingChi2MchMidUp{"cfgMatchingChi2MchMidUp", 999.f, ""}; - // Filter matchingChi2MchMidFilter = aod::fwdtrack::chi2MatchMCHMID < fMatchingChi2MchMidUp; - // Configurable fSaveMixedMatchingParamsRate{"cfgSaveMixedMatchingParamsRate", 0.002f, ""}; + //// Variables for selecting mft tracks + Configurable fEtaMftLow{"cfgEtaMftlow", -3.6f, ""}; + Configurable fEtaMftUp{"cfgEtaMftup", -2.5f, ""}; + Configurable fTrackNClustMftLow{"cfgTrackNClustMftLow", 7, ""}; + Configurable fTrackChi2MftUp{"cfgTrackChi2MftUp", 999.f, ""}; + /// Variables to add preselection for the matching table Configurable fPreselectMatchingX{"cfgPreselectMatchingX", 999.f, ""}; Configurable fPreselectMatchingY{"cfgPreselectMatchingY", 999.f, ""}; - Configurable fTagMassWindowMin{"cfgTagMassWindowMin", 2.8f, ""}; - Configurable fTagMassWindowMax{"cfgTagMassWindowMax", 3.3f, ""}; - + /// Variables to event mixing criteria + Configurable fSaveMixedMatchingParamsRate{"cfgSaveMixedMatchingParamsRate", 0.002f, ""}; Configurable fEventMaxDeltaNMFT{"cfgEventMaxDeltaNMFT", 1, ""}; Configurable fEventMaxDeltaVtxZ{"cfgEventMaxDeltaVtxZ", 1.f, ""}; - Configurable fTagRWindow{"cfgTagRWindow", 3.f, ""}; - Configurable fTagPhiWindow{"cfgTagPhiWindow", 0.1f, ""}; - Configurable fTagEtaWindow{"cfgTagEtaWindow", 0.1f, ""}; + //// Variables for selecting tag muon + Configurable fTagMassWindowMin{"cfgTagMassWindowMin", 2.8f, ""}; + Configurable fTagMassWindowMax{"cfgTagMassWindowMax", 3.3f, ""}; + Configurable fTagXWindowLow{"cfgTagXWindowLow", -0.80f, ""}; + Configurable fTagXWindowUp{"cfgTagXWindowUp", 0.84f, ""}; + Configurable fTagYWindowLow{"cfgTagYWindowLow", -0.64f, ""}; + Configurable fTagYWindowUp{"cfgTagYWindowUp", 0.95f, ""}; + Configurable fTagPhiWindowLow{"cfgTagPhiWindowLow", -0.041f, ""}; + Configurable fTagPhiWindowUp{"cfgTagPhiWindowUp", 0.039f, ""}; + Configurable fTagEtaWindowLow{"cfgTagEtaWindowLow", -0.045f, ""}; + Configurable fTagEtaWindowUp{"cfgTagEtaWindowUp", 0.033f, ""}; + + //// Variables for selecting probe muon + Configurable fProbeXWindowLow{"cfgProbeXWindowLow", -10.f, ""}; + Configurable fProbeXWindowUp{"cfgProbeXWindowUp", 10.f, ""}; + Configurable fProbeYWindowLow{"cfgProbeYWindowLow", -10.f, ""}; + Configurable fProbeYWindowUp{"cfgProbeYWindowUp", 10.f, ""}; + Configurable fProbePhiWindowLow{"cfgProbePhiWindowLow", -1.0f, ""}; + Configurable fProbePhiWindowUp{"cfgProbePhiWindowUp", 1.0f, ""}; + Configurable fProbeEtaWindowLow{"cfgProbeEtaWindowLow", -1.0f, ""}; + Configurable fProbeEtaWindowUp{"cfgProbeEtaWindowUp", 1.0f, ""}; Service ccdb; Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -479,7 +431,7 @@ struct match_mft_mch_data { ToDCA }; template - o2::dataformats::GlobalFwdTrack PropagateMuon(T const& muon, int PropType) + o2::dataformats::GlobalFwdTrack PropagateMUONTrack(T const& muon, int PropType) { auto collision = muon.collision(); @@ -492,7 +444,7 @@ struct match_mft_mch_data { std::vector v1{muon.cXX(), muon.cXY(), muon.cYY(), muon.cPhiX(), muon.cPhiY(), muon.cPhiPhi(), muon.cTglX(), muon.cTglY(), muon.cTglPhi(), muon.cTglTgl(), muon.c1PtX(), muon.c1PtY(), muon.c1PtPhi(), muon.c1PtTgl(), muon.c1Pt21Pt2()}; - if (isGoodFwdTrack(muon)) { + if (isGoodMUONTrack(muon)) { SMatrix55 tcovs(v1.begin(), v1.end()); o2::track::TrackParCovFwd fwdtrack{muon.z(), tpars, tcovs, chi2}; @@ -550,7 +502,7 @@ struct match_mft_mch_data { } template - bool isGoodFwdTrack(T track) + bool isGoodMUONTrack(T track) { if (!track.has_collision()) return false; @@ -558,17 +510,17 @@ struct match_mft_mch_data { return false; if (track.chi2() > fTrackChi2MchUp) return false; - if (17.6 > track.rAtAbsorberEnd() || track.rAtAbsorberEnd() > 89.5) + if (fRabsLow1 > track.rAtAbsorberEnd() || track.rAtAbsorberEnd() > fRabsUp2) return false; - if (track.rAtAbsorberEnd() < 26.5 && 594. < track.pDca()) + if (track.rAtAbsorberEnd() < fRabsUp1 && fPdcaUp1 < track.pDca()) return false; - if (track.rAtAbsorberEnd() > 26.5 && 324. < track.pDca()) + if (track.rAtAbsorberEnd() > fRabsLow2 && fPdcaUp2 < track.pDca()) return false; return true; } template - int selectTagMuon(T track1, T track2) + int selectTagMUON(T track1, T track2) { if (track1.pt() > track2.pt()) { return track1.globalIndex(); @@ -578,7 +530,7 @@ struct match_mft_mch_data { } template - int selectProbeMuon(T track1, T track2) + int selectProbeMUONTrack(T track1, T track2) { if (track1.pt() < track2.pt()) { return track1.globalIndex(); @@ -587,13 +539,33 @@ struct match_mft_mch_data { } } - bool isGoodKenematicTrack(o2::dataformats::GlobalFwdTrack track) + bool isGoodKenematicMUONTrack(o2::dataformats::GlobalFwdTrack track) { if (fEtaMchLow > track.getEta() || track.getEta() > fEtaMchUp) return false; return true; } + template + bool isGoodMFTTrack(T track) + { + if (!track.has_collision()) + return false; + if (track.chi2() > fTrackChi2MftUp) + return false; + if (track.nClusters() < fTrackNClustMftLow) + return false; + return true; + } + + bool isGoodKenematicMFTTrack(o2::track::TrackParCovFwd track) + { + if (fEtaMftLow > track.getEta() || track.getEta() > fEtaMftUp) { + return false; + } + return true; + } + void process(aod::Collisions const& collisions, ExtBCs const& ebcs, MyMuons const& fwdtracks, MyMFTs const& mfttracks) { @@ -606,28 +578,28 @@ struct match_mft_mch_data { for (const auto& mfttrack : mfttracks) { - if (!mfttrack.has_collision()) + if (!isGoodMFTTrack(mfttrack)) { continue; + } + bcs_mfttrack.insert(mfttrack.collisionId()); std::vector& tracks = map_mfttraks[mfttrack.collisionId()]; tracks.push_back(mfttrack.globalIndex()); o2::track::TrackParCovFwd mftpartrack = PropagateMFT(mfttrack, ProagationPoint::ToDCA); + if (!isGoodKenematicMFTTrack(mftpartrack)) { + continue; + } + auto collision = mfttrack.collision(); map_vtxZ[mfttrack.collisionId()] = collision.posZ(); float dx = mftpartrack.getX() - collision.posX(); float dy = mftpartrack.getY() - collision.posY(); - float dca = sqrt(dx * dx + dy * dy); - - mftParams(mfttrack.nClusters(), mfttrack.isCA(), - mfttrack.chi2(), mfttrack.sign(), - mfttrack.pt(), mfttrack.eta(), mfttrack.phi(), - mftpartrack.getPt(), mftpartrack.getEta(), mftpartrack.getPhi(), - dx, dy, dca); + mftParams(mfttrack.nClusters(), mfttrack.isCA(), mfttrack.chi2(), mfttrack.sign(), mftpartrack.getPt(), mftpartrack.getEta(), mftpartrack.getPhi(), dx, dy); nmfttracks[mfttrack.collisionId()]++; } @@ -636,48 +608,43 @@ struct match_mft_mch_data { for (auto fwdtrack : fwdtracks) { - if (!isGoodFwdTrack(fwdtrack)) + if (!isGoodMUONTrack(fwdtrack)) { continue; + } - o2::dataformats::GlobalFwdTrack propmuonAtPV = PropagateMuon(fwdtrack, ProagationPoint::ToVtx); - o2::dataformats::GlobalFwdTrack propmuonAtDCA = PropagateMuon(fwdtrack, ProagationPoint::ToDCA); - if (!isGoodKenematicTrack(propmuonAtPV)) + o2::dataformats::GlobalFwdTrack propmuonAtPV = PropagateMUONTrack(fwdtrack, ProagationPoint::ToVtx); + if (!isGoodKenematicMUONTrack(propmuonAtPV)) { continue; + } + std::vector& tracks = map_fwdtraks[fwdtrack.collisionId()]; tracks.push_back(fwdtrack.globalIndex()); - auto collision = fwdtrack.collision(); - - float dx = propmuonAtDCA.getX() - collision.posX(); - float dy = propmuonAtDCA.getY() - collision.posY(); - float DCA = sqrt(dx * dx + dy * dy); - bool hasMFT = false; std::vector& mfttracks = map_mfttraks[fwdtrack.collisionId()]; - if (mfttracks.size() > 0) + if (mfttracks.size() > 0) { hasMFT = true; + } - muonParams(fwdtrack.chi2(), fwdtrack.rAtAbsorberEnd(), fwdtrack.sign(), fwdtrack.pt(), fwdtrack.eta(), fwdtrack.phi(), - propmuonAtPV.getPt(), propmuonAtPV.getEta(), propmuonAtPV.getPhi(), - propmuonAtDCA.getPt(), propmuonAtDCA.getEta(), propmuonAtDCA.getPhi(), - DCA, hasMFT); - + muonParams(fwdtrack.chi2(), fwdtrack.rAtAbsorberEnd(), fwdtrack.sign(), propmuonAtPV.getPt(), propmuonAtPV.getEta(), propmuonAtPV.getPhi(), hasMFT); nfwdtracks[fwdtrack.collisionId()]++; } for (auto fwdtrack1 : fwdtracks) { - if (!isGoodFwdTrack(fwdtrack1)) + if (!isGoodMUONTrack(fwdtrack1)) { continue; + } int ibc = fwdtrack1.collisionId(); auto collision = fwdtrack1.collision(); - o2::dataformats::GlobalFwdTrack fwdtrackAtPV1 = PropagateMuon(fwdtrack1, ProagationPoint::ToVtx); - if (!isGoodKenematicTrack(fwdtrackAtPV1)) + o2::dataformats::GlobalFwdTrack fwdtrackAtPV1 = PropagateMUONTrack(fwdtrack1, ProagationPoint::ToVtx); + if (!isGoodKenematicMUONTrack(fwdtrackAtPV1)) { continue; + } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////// MIXED EVENT /////////////// @@ -686,10 +653,12 @@ struct match_mft_mch_data { if (ibc == bc_mfttrack) continue; - if (fabs(nmfttracks[ibc] - nmfttracks[bc_mfttrack]) > fEventMaxDeltaNMFT) + if (fabs(nmfttracks[ibc] - nmfttracks[bc_mfttrack]) > fEventMaxDeltaNMFT) { continue; - if (fabs(map_vtxZ[bc_mfttrack] - collision.posZ()) > fEventMaxDeltaVtxZ) + } + if (fabs(map_vtxZ[bc_mfttrack] - collision.posZ()) > fEventMaxDeltaVtxZ) { continue; + } std::vector& mfttrackGlobalIndex = map_mfttraks[bc_mfttrack]; @@ -701,27 +670,22 @@ struct match_mft_mch_data { V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); V2.SetPtEtaPhi(fwdtrack1.pt(), fwdtrack1.eta(), fwdtrack1.phi()); - double deltaP = mfttrack_at_matching.getP() - fwdtrack1.p(); double deltaPt = mfttrack_at_matching.getPt() - fwdtrack1.pt(); double deltaX = mfttrack_at_matching.getX() - fwdtrack1.x(); double deltaY = mfttrack_at_matching.getY() - fwdtrack1.y(); double deltaPhi = V1.DeltaPhi(V2); double deltaEta = mfttrack_at_matching.getEta() - fwdtrack1.eta(); - if (fabs(deltaX) > fPreselectMatchingX) + if (fabs(deltaX) > fPreselectMatchingX) { continue; - if (fabs(deltaY) > fPreselectMatchingY) + } + if (fabs(deltaY) > fPreselectMatchingY) { continue; + } o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFT(mfttrack1, ProagationPoint::ToDCA); - float dx = mfttrack_at_dca.getX() - collision.posX(); - float dy = mfttrack_at_dca.getY() - collision.posY(); - float DCA = sqrt(dx * dx + dy * dy); - - mixmatchingParams(mfttrack1.nClusters(), mfttrack1.chi2(), - deltaP, deltaPt, deltaEta, deltaPhi, deltaX, deltaY, - fwdtrackAtPV1.getPt(), fwdtrackAtPV1.getEta(), fwdtrackAtPV1.getPhi(), fwdtrack1.sign(), - mfttrack_at_dca.getPt(), mfttrack_at_dca.getEta(), mfttrack_at_dca.getPhi(), mfttrack1.sign(), DCA); + + mixmatchingParams(deltaPt, deltaEta, deltaPhi, deltaX, deltaY, fwdtrackAtPV1.getPt(), fwdtrackAtPV1.getEta(), fwdtrack1.sign(), mfttrack_at_dca.getEta(), mfttrack1.sign()); } } // end of loop bc_mfttrack @@ -738,44 +702,45 @@ struct match_mft_mch_data { V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); V2.SetPtEtaPhi(fwdtrack1.pt(), fwdtrack1.eta(), fwdtrack1.phi()); - double deltaP = mfttrack_at_matching.getP() - fwdtrack1.p(); double deltaPt = mfttrack_at_matching.getPt() - fwdtrack1.pt(); double deltaX = mfttrack_at_matching.getX() - fwdtrack1.x(); double deltaY = mfttrack_at_matching.getY() - fwdtrack1.y(); double deltaPhi = V1.DeltaPhi(V2); double deltaEta = mfttrack_at_matching.getEta() - fwdtrack1.eta(); - if (fabs(deltaX) > fPreselectMatchingX) + if (fabs(deltaX) > fPreselectMatchingX) { continue; - if (fabs(deltaY) > fPreselectMatchingY) + } + if (fabs(deltaY) > fPreselectMatchingY) { continue; + } o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFT(mfttrack1, ProagationPoint::ToDCA); - float dx = mfttrack_at_dca.getX() - collision.posX(); - float dy = mfttrack_at_dca.getY() - collision.posY(); - float DCA = sqrt(dx * dx + dy * dy); - - matchingParams(mfttrack1.nClusters(), mfttrack1.chi2(), - deltaP, deltaPt, deltaEta, deltaPhi, deltaX, deltaY, - fwdtrackAtPV1.getPt(), fwdtrackAtPV1.getEta(), fwdtrackAtPV1.getPhi(), fwdtrack1.sign(), - mfttrack_at_dca.getPt(), mfttrack_at_dca.getEta(), mfttrack_at_dca.getPhi(), mfttrack1.sign(), DCA); + + matchingParams(deltaPt, deltaEta, deltaPhi, deltaX, deltaY, + fwdtrackAtPV1.getPt(), fwdtrackAtPV1.getEta(), fwdtrack1.sign(), + mfttrack_at_dca.getEta(), mfttrack1.sign()); + } // end of loop idmfttrack1 std::vector& fwdtrackGlobalIndex = map_fwdtraks[ibc]; for (int idfwdtrack2 = 0; idfwdtrack2 < static_cast(fwdtrackGlobalIndex.size()); ++idfwdtrack2) { - if (fwdtrack1.globalIndex() == fwdtrackGlobalIndex[idfwdtrack2]) + if (fwdtrack1.globalIndex() == fwdtrackGlobalIndex[idfwdtrack2]) { continue; + } auto fwdtrack2 = fwdtracks.rawIteratorAt(fwdtrackGlobalIndex[idfwdtrack2]); - if (!isGoodFwdTrack(fwdtrack2)) + if (!isGoodMUONTrack(fwdtrack2)) { continue; + } - o2::dataformats::GlobalFwdTrack fwdtrackAtPV2 = PropagateMuon(fwdtrack2, ProagationPoint::ToVtx); - if (!isGoodKenematicTrack(fwdtrackAtPV2)) + o2::dataformats::GlobalFwdTrack fwdtrackAtPV2 = PropagateMUONTrack(fwdtrack2, ProagationPoint::ToVtx); + if (!isGoodKenematicMUONTrack(fwdtrackAtPV2)) { continue; + } muon1LV.SetPtEtaPhiM(fwdtrackAtPV1.getPt(), fwdtrackAtPV1.getEta(), fwdtrackAtPV1.getPhi(), mMu); muon2LV.SetPtEtaPhiM(fwdtrackAtPV2.getPt(), fwdtrackAtPV2.getEta(), fwdtrackAtPV2.getPhi(), mMu); @@ -783,20 +748,23 @@ struct match_mft_mch_data { muonPairs(nmfttracks[ibc], fwdtrack1.sign() + fwdtrack2.sign(), dimuonLV.M(), dimuonLV.Pt(), dimuonLV.Rapidity()); - if (fabs(fwdtrack1.sign() + fwdtrack2.sign()) > 0) + if (fabs(fwdtrack1.sign() + fwdtrack2.sign()) > 0) { continue; - if (fTagMassWindowMin > dimuonLV.M() || dimuonLV.M() > fTagMassWindowMax) + } + if (fTagMassWindowMin > dimuonLV.M() || dimuonLV.M() > fTagMassWindowMax) { continue; - if (nmfttracks[ibc] < 1) + } + if (nmfttracks[ibc] < 1) { continue; + } tagmuonPairs(nmfttracks[ibc], fwdtrack1.sign() + fwdtrack2.sign(), dimuonLV.M(), dimuonLV.Pt(), dimuonLV.Rapidity()); bool isGoodTag = false; - int nMFTCandsTagMuon = 0; + int nMFTCandsTagMUON = 0; - auto tagfwdtrack = fwdtracks.rawIteratorAt(selectTagMuon(fwdtrack1, fwdtrack2)); - o2::dataformats::GlobalFwdTrack tagfwdtrackAtPV = PropagateMuon(tagfwdtrack, ProagationPoint::ToVtx); + auto tagfwdtrack = fwdtracks.rawIteratorAt(selectTagMUON(fwdtrack1, fwdtrack2)); + o2::dataformats::GlobalFwdTrack tagfwdtrackAtPV = PropagateMUONTrack(tagfwdtrack, ProagationPoint::ToVtx); for (int idmfttrack1 = 0; idmfttrack1 < static_cast(mfttrackGlobalIndex.size()); ++idmfttrack1) { @@ -806,43 +774,64 @@ struct match_mft_mch_data { V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); V2.SetPtEtaPhi(tagfwdtrack.pt(), tagfwdtrack.eta(), tagfwdtrack.phi()); - double deltaP = mfttrack_at_matching.getP() - tagfwdtrack.p(); double deltaPt = mfttrack_at_matching.getPt() - tagfwdtrack.pt(); double deltaX = mfttrack_at_matching.getX() - tagfwdtrack.x(); double deltaY = mfttrack_at_matching.getY() - tagfwdtrack.y(); double deltaPhi = V1.DeltaPhi(V2); double deltaEta = mfttrack_at_matching.getEta() - tagfwdtrack.eta(); - double deltaR = sqrt(deltaX * deltaX + deltaY * deltaY); - if (fabs(deltaX) > fPreselectMatchingX) + if (fabs(deltaX) > fPreselectMatchingX) { continue; - if (fabs(deltaY) > fPreselectMatchingY) + } + if (fabs(deltaY) > fPreselectMatchingY) { continue; + } o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFT(mfttrack1, ProagationPoint::ToDCA); - float dx = mfttrack_at_dca.getX() - collision.posX(); - float dy = mfttrack_at_dca.getY() - collision.posY(); - float DCA = sqrt(dx * dx + dy * dy); bool dummyTag = false; - if (fabs(deltaR) < fTagRWindow && fabs(deltaPhi) < fTagPhiWindow && fabs(deltaEta) < fTagEtaWindow) { + if (fTagXWindowLow < deltaX && deltaX < fTagXWindowUp && + fTagXWindowLow < deltaY && deltaY < fTagXWindowUp && + fTagPhiWindowLow < deltaPhi && deltaPhi < fTagPhiWindowUp && + fTagEtaWindowLow < deltaEta && deltaEta < fTagEtaWindowUp) { isGoodTag = true; dummyTag = true; - nMFTCandsTagMuon++; + nMFTCandsTagMUON++; } - tagmatchingParams(mfttrack1.nClusters(), mfttrack1.chi2(), - deltaP, deltaPt, deltaEta, deltaPhi, deltaX, deltaY, - tagfwdtrackAtPV.getPt(), tagfwdtrackAtPV.getEta(), tagfwdtrackAtPV.getPhi(), tagfwdtrack.sign(), - mfttrack_at_dca.getPt(), mfttrack_at_dca.getEta(), mfttrack_at_dca.getPhi(), mfttrack1.sign(), DCA, dummyTag); + tagmatchingParams(deltaPt, deltaEta, deltaPhi, deltaX, deltaY, + tagfwdtrackAtPV.getPt(), tagfwdtrackAtPV.getEta(), tagfwdtrack.sign(), mfttrack_at_dca.getEta(), mfttrack1.sign(), dummyTag); } - if (!isGoodTag) + if (!isGoodTag) { continue; + } + + auto probefwdtrack = fwdtracks.rawIteratorAt(selectProbeMUONTrack(fwdtrack1, fwdtrack2)); + o2::dataformats::GlobalFwdTrack probefwdtrackAtPV = PropagateMUONTrack(probefwdtrack, ProagationPoint::ToVtx); + + int nMFTCandsProbeMUON = 0; + /// Counting the number of MFT tracks in a probe muon track + for (int idmfttrack1 = 0; idmfttrack1 < static_cast(mfttrackGlobalIndex.size()); ++idmfttrack1) { - auto probefwdtrack = fwdtracks.rawIteratorAt(selectProbeMuon(fwdtrack1, fwdtrack2)); - o2::dataformats::GlobalFwdTrack probefwdtrackAtPV = PropagateMuon(probefwdtrack, ProagationPoint::ToVtx); + auto mfttrack1 = mfttracks.rawIteratorAt(mfttrackGlobalIndex[idmfttrack1]); + o2::track::TrackParCovFwd mfttrack_at_matching = PropagateMFTtoMatchingPlane(mfttrack1, probefwdtrack); + V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); + V2.SetPtEtaPhi(probefwdtrack.pt(), probefwdtrack.eta(), probefwdtrack.phi()); + + double deltaX = mfttrack_at_matching.getX() - probefwdtrack.x(); + double deltaY = mfttrack_at_matching.getY() - probefwdtrack.y(); + double deltaPhi = V1.DeltaPhi(V2); + double deltaEta = mfttrack_at_matching.getEta() - probefwdtrack.eta(); + + if (fProbeXWindowLow < deltaX && deltaX < fProbeXWindowUp && + fProbeXWindowLow < deltaY && deltaY < fProbeXWindowUp && + fProbePhiWindowLow < deltaPhi && deltaPhi < fProbePhiWindowUp && + fProbeEtaWindowLow < deltaEta && deltaEta < fProbeEtaWindowUp) { + nMFTCandsProbeMUON++; + } + } for (int idmfttrack1 = 0; idmfttrack1 < static_cast(mfttrackGlobalIndex.size()); ++idmfttrack1) { @@ -852,27 +841,22 @@ struct match_mft_mch_data { V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); V2.SetPtEtaPhi(probefwdtrack.pt(), probefwdtrack.eta(), probefwdtrack.phi()); - double deltaP = mfttrack_at_matching.getP() - probefwdtrack.p(); double deltaPt = mfttrack_at_matching.getPt() - probefwdtrack.pt(); double deltaX = mfttrack_at_matching.getX() - probefwdtrack.x(); double deltaY = mfttrack_at_matching.getY() - probefwdtrack.y(); double deltaPhi = V1.DeltaPhi(V2); double deltaEta = mfttrack_at_matching.getEta() - probefwdtrack.eta(); - if (fabs(deltaX) > fPreselectMatchingX) + if (fabs(deltaX) > fPreselectMatchingX) { continue; - if (fabs(deltaY) > fPreselectMatchingY) + } + if (fabs(deltaY) > fPreselectMatchingY) { continue; + } o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFT(mfttrack1, ProagationPoint::ToDCA); - float dx = mfttrack_at_dca.getX() - collision.posX(); - float dy = mfttrack_at_dca.getY() - collision.posY(); - float DCA = sqrt(dx * dx + dy * dy); - - probematchingParams(nMFTCandsTagMuon, tagfwdtrack.p(), mfttrack1.nClusters(), mfttrack1.chi2(), - deltaP, deltaPt, deltaEta, deltaPhi, deltaX, deltaY, - probefwdtrackAtPV.getPt(), probefwdtrackAtPV.getEta(), probefwdtrackAtPV.getPhi(), probefwdtrack.sign(), - mfttrack_at_dca.getPt(), mfttrack_at_dca.getEta(), mfttrack_at_dca.getPhi(), mfttrack1.sign(), DCA); + + probematchingParams(nMFTCandsTagMUON, nMFTCandsProbeMUON, tagfwdtrack.p(), deltaPt, deltaEta, deltaPhi, deltaX, deltaY, probefwdtrackAtPV.getPt(), probefwdtrackAtPV.getEta(), probefwdtrack.sign(), mfttrack_at_dca.getEta(), mfttrack1.sign()); } } } From 24c5a1e3a982957d6152dedddc866762fbc6b3a2 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Tue, 26 Nov 2024 15:36:43 +0100 Subject: [PATCH 106/459] [PWGCF] DptDpt. Tracking the event selection incorporating occupancy (#8636) Co-authored-by: Victor --- PWGCF/TableProducer/dptdptfilter.cxx | 32 ++++++ PWGCF/TableProducer/dptdptfilter.h | 160 ++++++++++++++++++++++++++- 2 files changed, 191 insertions(+), 1 deletion(-) diff --git a/PWGCF/TableProducer/dptdptfilter.cxx b/PWGCF/TableProducer/dptdptfilter.cxx index 986370739b4..a1faad494e3 100644 --- a/PWGCF/TableProducer/dptdptfilter.cxx +++ b/PWGCF/TableProducer/dptdptfilter.cxx @@ -89,10 +89,25 @@ const char* speciesName[kDptDptNoOfSpecies] = {"h", "e", "mu", "pi", "ka", "p"}; const char* speciesTitle[kDptDptNoOfSpecies] = {"", "e", "#mu", "#pi", "K", "p"}; +const char* eventSelectionSteps[knCollisionSelectionFlags] = { + "MB", + "INT7", + "SEL7", + "SEL8", + "NOSAMEBUNCHPUP", + "ISGOODZVTXFT0VSPV", + "ISVERTEXITSTPC", + "ISVERTEXTOFMATCHED", + "ISVERTEXTRDMATCHED", + "OCCUPANCY", + "CENTRALITY", + "ZVERTEX"}; + //============================================================================================ // The DptDptFilter histogram objects // TODO: consider registering in the histogram registry //============================================================================================ +TH1D* fhEventSelection = nullptr; TH1F* fhCentMultB = nullptr; TH1F* fhCentMultA = nullptr; TH1F* fhVertexZB = nullptr; @@ -339,6 +354,8 @@ struct DptDptFilter { } cfginputfile; Configurable cfgFullDerivedData{"fullderiveddata", false, "Produce the full derived data for external storage. Default false"}; Configurable cfgCentMultEstimator{"centmultestimator", "V0M", "Centrality/multiplicity estimator detector: V0M,CL0,CL1,FV0A,FT0M,FT0A,FT0C,NTPV,NOCM: none. Default V0M"}; + Configurable cfgOccupancyEstimation{"occestimation", "None", "Occupancy estimation: None, Tracks, FT0C. Default None"}; + Configurable cfgMaxOccupancy{"occmax", 1e6f, "Maximum allowed occupancy. Depends on the occupancy estimation"}; Configurable cfgSystem{"syst", "PbPb", "System: pp, PbPb, Pbp, pPb, XeXe, ppRun3, PbPbRun3. Default PbPb"}; Configurable cfgDataType{"datatype", "data", "Data type: data, datanoevsel, MC, FastMC, OnTheFlyMC. Default data"}; Configurable cfgTriggSel{"triggsel", "MB", "Trigger selection: MB,VTXTOFMATCHED,VTXTRDMATCHED,VTXTRDTOFMATCHED,None. Default MB"}; @@ -386,6 +403,10 @@ struct DptDptFilter { } else { fCentMultEstimator = getCentMultEstimator(cfgCentMultEstimator); } + /* the occupancy selection */ + fOccupancyEstimation = getOccupancyEstimator(cfgOccupancyEstimation); + fMaxOccupancy = cfgMaxOccupancy; + /* the trigger selection */ fTriggerSelection = getTriggerSelection(cfgTriggSel); traceCollId0 = cfgTraceCollId0; @@ -401,6 +422,10 @@ struct DptDptFilter { if ((fDataType == kData) || (fDataType == kDataNoEvtSel) || (fDataType == kMC)) { /* create the reconstructed data histograms */ + fhEventSelection = new TH1D("EventSelection", ";counts", knCollisionSelectionFlags, -0.5f, static_cast(knCollisionSelectionFlags) - 0.5f); + for (int ix = 0; ix < knCollisionSelectionFlags; ++ix) { + fhEventSelection->GetXaxis()->SetBinLabel(ix + 1, eventSelectionSteps[ix]); + } /* TODO: proper axes and axes titles according to the system; still incomplete */ std::string multestimator = getCentMultEstimatorName(fCentMultEstimator); if (fSystem > kPbp) { @@ -420,6 +445,7 @@ struct DptDptFilter { fhVertexZA = new TH1F("VertexZA", "Vertex Z; z_{vtx}", zvtxbins, zvtxlow, zvtxup); /* add the hstograms to the output list */ + fOutputList->Add(fhEventSelection); fOutputList->Add(fhCentMultB); fOutputList->Add(fhCentMultA); fOutputList->Add(fhMultB); @@ -546,6 +572,12 @@ void DptDptFilter::processReconstructed(CollisionObject const& collision, Tracks collisionsinfo(uint8_t(false), 105.0); } } + /* report the event selection */ + for (int iflag = 0; iflag < knCollisionSelectionFlags; ++iflag) { + if (collisionFlags.test(iflag)) { + fhEventSelection->Fill(iflag); + } + } } void DptDptFilter::processWithCent(aod::CollisionEvSelCent const& collision, DptDptFullTracks const& ftracks) diff --git a/PWGCF/TableProducer/dptdptfilter.h b/PWGCF/TableProducer/dptdptfilter.h index b4a6f2859b8..9ba5cebcd6d 100644 --- a/PWGCF/TableProducer/dptdptfilter.h +++ b/PWGCF/TableProducer/dptdptfilter.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -106,6 +107,33 @@ enum TriggerSelectionType { knEventSelection ///< number of triggers for event selection }; +/// \enum OccupancyEstimationType +/// \brief The type of occupancy estimation +enum OccupancyEstimationType { + kNOOCC = 0, ///< do not use occupancy estimation + kTRACKSOCC, ///< occupancy estimated using tracks + kFT0COCC, ///< occupancy estimated using the FT0C + knOccupancyEstimators ///< the number of occupancy estimators +}; + +/// \enum CollisionSelectionFlags +/// \brief The different criteria for selecting/rejecting collisions +enum CollisionSelectionFlags { + kMBBIT = 0, ///< minimum bias + kINT7BIT, ///< INT7 Run 1/2 + kSEL7BIT, ///< Sel7 Run 1/2 + kSEL8BIT, ///< Sel8 + kNOSAMEBUNCHPUPBIT, ///< no same bunch pile up + kISGOODZVTXFT0VSPVBIT, ///< good zvtx FT0 vs PV + kISVERTEXITSTPCBIT, ///< is vertex TPC and ITS + kISVERTEXTOFMATCHEDBIT, ///< vertex contributor with TOF matched + kISVERTEXTRDMATCHEDBIT, ///< vertex contributor with TRD matche + kOCCUPANCYBIT, ///< occupancy within limits + kCENTRALITYBIT, ///< centrality cut passed + kZVERTEXBIT, ///< zvtx cut passed + knCollisionSelectionFlags ///< number of flags +}; + /// \enum StrongDebugging /// \brief Enable a per track information debugging. Only for local analyses enum StrongDebugging { @@ -123,6 +151,11 @@ std::ofstream debugstream; //============================================================================================ float overallminp = 0.0f; +//============================================================================================ +// The collision selection flags and configuration objects +//============================================================================================ +std::bitset<32> collisionFlags; + //============================================================================================ // The DptDptFilter configuration objects //============================================================================================ @@ -302,6 +335,8 @@ SystemType fSystem = kNoSystem; DataType fDataType = kData; CentMultEstimatorType fCentMultEstimator = kV0M; TriggerSelectionType fTriggerSelection = kMB; +OccupancyEstimationType fOccupancyEstimation = kNOOCC; /* the occupancy estimator to use */ +float fMaxOccupancy = 1e6f; /* the maximum allowed occupancy */ /* adaptations for the pp nightly checks */ analysis::CheckRangeCfg traceDCAOutliers; @@ -449,6 +484,20 @@ inline std::string getCentMultEstimatorName(CentMultEstimatorType est) } } +inline OccupancyEstimationType getOccupancyEstimator(const std::string& estimator) +{ + if (estimator == "None") { + return kNOOCC; + } else if (estimator == "Tracks") { + return kTRACKSOCC; + } else if (estimator == "FT0C") { + return kFT0COCC; + } else { + LOGF(fatal, "Occupancy estimator %s not supported yet", estimator.c_str()); + return kNOOCC; + } +} + ////////////////////////////////////////////////////////////////////////////////// /// Trigger selection ////////////////////////////////////////////////////////////////////////////////// @@ -469,17 +518,21 @@ inline bool triggerSelectionReco(CollisionObject const& collision) switch (fDataType) { case kData: if (collision.alias_bit(kINT7)) { + collisionFlags.set(kINT7BIT); if (collision.sel7()) { trigsel = true; + collisionFlags.set(kSEL7BIT); } } break; case kMC: if (collision.sel7()) { trigsel = true; + collisionFlags.set(kSEL7BIT); } break; default: + collisionFlags.set(kMBBIT); trigsel = true; break; } @@ -502,6 +555,14 @@ inline bool triggerSelectionReco(CollisionObject const& collision) coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && coll.selection_bit(aod::evsel::kIsVertexITSTPC); }; + auto setCollisionFlags = [](auto& flags, auto const& coll) { + flags.set(kSEL8BIT, coll.sel8() != 0); + flags.set(kNOSAMEBUNCHPUPBIT, coll.selection_bit(aod::evsel::kNoSameBunchPileup)); + flags.set(kISGOODZVTXFT0VSPVBIT, coll.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)); + flags.set(kISVERTEXITSTPCBIT, coll.selection_bit(aod::evsel::kIsVertexITSTPC)); + flags.set(kISVERTEXTOFMATCHEDBIT, coll.selection_bit(aod::evsel::kIsVertexTOFmatched)); + flags.set(kISVERTEXTRDMATCHEDBIT, coll.selection_bit(aod::evsel::kIsVertexTRDmatched)); + }; switch (fTriggerSelection) { case kMB: if (run3Accepted(collision)) { @@ -549,6 +610,7 @@ inline bool triggerSelectionReco(CollisionObject const& collision) default: break; } + setCollisionFlags(collisionFlags, collision); } break; default: break; @@ -704,6 +766,7 @@ inline bool centralitySelectionMult(CollisionObject collision, float& centmult) float mult = getCentMultPercentile(collision); if (mult < 100 && 0 < mult) { centmult = mult; + collisionFlags.set(kCENTRALITYBIT); return true; } return false; @@ -718,6 +781,7 @@ inline bool centralitySelectionNoMult(CollisionObject const&, float& centmult) case kNOCM: centmult = 50.0; centmultsel = true; + collisionFlags.set(kCENTRALITYBIT); break; default: break; @@ -786,6 +850,94 @@ inline bool centralitySelection(aod::McCollision const&, float } } +////////////////////////////////////////////////////////////////////////////////// +/// Occupancy selection +////////////////////////////////////////////////////////////////////////////////// + +/// \brief get the collision occupancy +template +inline bool selectOnOccupancy(CollisionObject collision) +{ + switch (fOccupancyEstimation) { + case kNOOCC: + collisionFlags.set(kOCCUPANCYBIT); + return true; + case kTRACKSOCC: + if (collision.trackOccupancyInTimeRange() < fMaxOccupancy) { + collisionFlags.set(kOCCUPANCYBIT); + return true; + } else { + return false; + } + case kFT0COCC: + if (collision.ft0cOccupancyInTimeRange() < fMaxOccupancy) { + collisionFlags.set(kOCCUPANCYBIT); + return true; + } else { + return false; + } + default: + return false; + } +} + +/// \brief Occupancy selection by default: unknown subscribed collision table +template +inline bool occupancySelection(CollisionObject const&) +{ + LOGF(fatal, "Occupancy selection not implemented for this kind of collisions"); + return false; +} + +/// \brief Occupancy selection for reconstructed and detector level collision tables with centrality/multiplicity information +template <> +inline bool occupancySelection(aod::CollisionEvSelCent const& collision) +{ + return selectOnOccupancy(collision); +} + +/// \brief Occupancy selection for reconstructed and detector level collision tables with Run 2 centrality/multiplicity information +template <> +inline bool occupancySelection(aod::CollisionEvSelRun2Cent const& collision) +{ + return selectOnOccupancy(collision); +} + +/// \brief Occupancy selection for reconstructed and detector level collision tables without centrality/multiplicity information +template <> +inline bool occupancySelection(aod::CollisionEvSel const& collision) +{ + return selectOnOccupancy(collision); +} + +/// \brief Occupancy selection for detector level collision tables without centrality/multiplicity +template <> +inline bool occupancySelection::iterator>(soa::Join::iterator const& collision) +{ + return selectOnOccupancy(collision); +} + +/// \brief Occupancy selection for detector level collision tables with centrality/multiplicity +template <> +inline bool occupancySelection::iterator>(soa::Join::iterator const& collision) +{ + return selectOnOccupancy(collision); +} + +/// \brief Occupancy selection for detector level collision tables with Run 2 centrality/multiplicity +template <> +inline bool occupancySelection::iterator>(soa::Join::iterator const& collision) +{ + return selectOnOccupancy(collision); +} + +/// \brief Occupancy selection for generator level collision table +template <> +inline bool occupancySelection(aod::McCollision const&) +{ + return true; +} + ////////////////////////////////////////////////////////////////////////////////// /// Event selection ////////////////////////////////////////////////////////////////////////////////// @@ -793,8 +945,12 @@ inline bool centralitySelection(aod::McCollision const&, float template inline bool IsEvtSelected(CollisionObject const& collision, float& centormult) { + collisionFlags.reset(); + bool trigsel = triggerSelection(collision); + bool occupancysel = occupancySelection(collision); + bool zvtxsel = false; /* TODO: vertex quality checks */ if (zvtxlow < collision.posZ() && collision.posZ() < zvtxup) { @@ -802,15 +958,17 @@ inline bool IsEvtSelected(CollisionObject const& collision, float& centormult) if (collision.posZ() != 0.0) { /* if only one side, we accept collisions which have zvtx different than zero */ zvtxsel = true; + collisionFlags.set(kZVERTEXBIT); } } else { zvtxsel = true; + collisionFlags.set(kZVERTEXBIT); } } bool centmultsel = centralitySelection(collision, centormult); - return trigsel && zvtxsel && centmultsel; + return trigsel && occupancysel && zvtxsel && centmultsel; } ////////////////////////////////////////////////////////////////////////////////// From cd29be3f661fe8b10a06e116db9d01839df85e22 Mon Sep 17 00:00:00 2001 From: abilandz Date: Tue, 26 Nov 2024 15:36:57 +0100 Subject: [PATCH 107/459] =?UTF-8?q?[PWGCF]=20re-organized=20QA=20histogram?= =?UTF-8?q?s,=20support=20for=20ref.=20mult.,=20support=20for=20analy?= =?UTF-8?q?=E2=80=A6=20(#8633)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/MuPa-Configurables.h | 56 +- .../Core/MuPa-DataMembers.h | 74 +- .../Core/MuPa-Enums.h | 93 +- .../Core/MuPa-MemberFunctions.h | 1376 ++++++++++------- .../Tasks/multiparticle-correlations-ab.cxx | 9 +- 5 files changed, 978 insertions(+), 630 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h index 201115e2241..be8bf29ec50 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h @@ -24,22 +24,27 @@ struct : ConfigurableGroup { Configurable cfVerbose{"cfVerbose", false, "run or not in verbose mode (but not for simple utility functions or function calls per particle)"}; Configurable cfVerboseUtility{"cfVerboseUtility", false, "run or not in verbose mode, also for simple utility functions (but not for function calls per particle)"}; Configurable cfVerboseForEachParticle{"cfVerboseForEachParticle", false, "run or not in verbose mode (also for function calls per particle)"}; + Configurable cfVerboseEventCounter{"cfVerboseEventCounter", false, "print or not only event counter"}; + Configurable cfPlainPrintout{"cfPlainPrintout", false, "print in color or in plain (use the latter in HL)"}; Configurable cfDoAdditionalInsanityChecks{"cfDoAdditionalInsanityChecks", false, "do additional insanity checks at run time (this leads to small loss of performance)"}; Configurable cfInsanityCheckForEachParticle{"cfInsanityCheckForEachParticle", false, "do insanity checks at run time for each particle, at the expense of losing a lot of performance. Use only during debugging."}; Configurable cfRandomSeed{"cfRandomSeed", 0, "0 = random seed is guaranteed to be unique in space and time"}; Configurable cfUseFisherYates{"cfUseFisherYates", false, "use or not Fisher-Yates algorithm to randomize particle indices"}; Configurable cfFixedNumberOfRandomlySelectedTracks{"cfFixedNumberOfRandomlySelectedTracks", -1, "set to some integer > 0, to apply and use. Set to <=0, to ignore."}; - Configurable cfUseStopwatch{"cfUseStopwatch", false, "if true, some basic info on time execution is printed, here and there. Very loosely, this can be used for execution time profiling."}; + Configurable cfUseStopwatch{"cfUseStopwatch", true, "if true, some basic info on time execution is printed, here and there. Very loosely, this can be used for execution time profiling."}; Configurable cfFloatingPointPrecision{"cfFloatingPointPrecision", 0.000001, "two floats are the same if TMath::Abs(f1 - f2) < fFloatingPointPrecision"}; Configurable cfSequentialBailout{"cfSequentialBailout", 0, "if fSequentialBailout > 0, then each fSequentialBailout events the function BailOut() is called. Can be used for real analysis and for IV"}; + Configurable cfUseSpecificCuts{"cfUseSpecificCuts", false, "if true, analysis-specific cuts set via configurable cfWhichSpecificCuts are applied after DefaultCuts(). "}; + Configurable cfWhichSpecificCuts{"cfWhichSpecificCuts", "some supported set of analysis-specific cuts (e.g. LHC23zzh, ...)", "determine which set of analysis-specific cuts will be applied after DefaultCuts(). Use in combination with tc.fUseSpecificCuts"}; } cf_tc; // *) QA: struct : ConfigurableGroup { Configurable cfCheckUnderflowAndOverflow{"cfCheckUnderflowAndOverflow", false, "check and bail out if in event and particle histograms there are entries which went to underflow or overflow bins (use only locally)"}; + Configurable cfRebin{"cfRebin", 1, "number of bins of selected heavy 2D histograms are devided with this number"}; Configurable cfFillQAEventHistograms2D{"cfFillQAEventHistograms2D", false, "if false, all QA 2D event histograms are not filled. if true, only the ones for which fBookQAEventHistograms2D[...] is true, are filled"}; - Configurable> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"MultTPC_vs_NContributors-1", "MultTPC_vs_Centrality-1", "Vertex_z_vs_MultTPC-1", "Vertex_z_vs_NContributors-1", "CentFT0C_vs_CentNTPV-1", "CentFT0M_vs_CentNTPV-1", "CentRun2V0M_vs_CentRun2SPDTracklets-1", "CentRun2V0M_vs_NContributors-1", "TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange-1", "TrackOccupancyInTimeRange_vs_MultTPC-1", "TrackOccupancyInTimeRange_vs_Vertex_z-1", "TrackOccupancyInTimeRange_vs_Centrality-1"}, "book (1) or do not book (0) this QA 2D event histogram"}; + Configurable> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"Multiplicity_vs_ReferenceMultiplicity-1", "Multiplicity_vs_NContributors-1", "Multiplicity_vs_Centrality-1", "Multiplicity_vs_Vertex_z-1", "Multiplicity_vs_Occupancy-1", "ReferenceMultiplicity_vs_NContributors-1", "ReferenceMultiplicity_vs_Centrality-1", "ReferenceMultiplicity_vs_Vertex_z-1", "ReferenceMultiplicity_vs_Occupancy-1", "NContributors_vs_Centrality-1", "NContributors_vs_Vertex_z-1", "NContributors_vs_Occupancy-1", "Centrality_vs_Vertex_z-1", "Centrality_vs_Occupancy-1", "Vertex_z_vs_Occupancy-1", "CentFT0C_vs_CentNTPV-0", "CentFT0M_vs_CentNTPV-0", "CentRun2V0M_vs_CentRun2SPDTracklets-0", "TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange-1"}, "book (1) or do not book (0) this QA 2D event histogram"}; Configurable cfFillQAParticleHistograms2D{"cfFillQAParticleHistograms2D", false, "if false, all QA 2D particle histograms are not filled. if true, only the ones for which fBookQAParticleHistograms2D[...] is true, are filled"}; Configurable> cfBookQAParticleHistograms2D{"cfBookQAParticleHistograms2D", {"Pt_vs_dcaXY-1"}, "book (1) or do not book (0) this QA 2D particle histogram"}; } cf_qa; @@ -47,42 +52,41 @@ struct : ConfigurableGroup { // *) Event histograms: struct : ConfigurableGroup { Configurable cfFillEventHistograms{"cfFillEventHistograms", true, "if false, all event histograms are not filled. if true, only the ones for which fBookEventHistograms[...] is true, are filled"}; - Configurable> cfBookEventHistograms{"cfBookEventHistograms", {"NumberOfEvents-1", "TotalMultiplicity-1", "SelectedTracks-1", "MultFV0M-1", "MultFT0M-1", "MultTPC-1", "MultNTracksPV-1", "MultTracklets-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Occupancy-1"}, "Book (1) or do not book (0) event histogram"}; + Configurable> cfBookEventHistograms{"cfBookEventHistograms", {"NumberOfEvents-1", "TotalMultiplicity-1", "Multiplicity-1", "ReferenceMultiplicity-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Occupancy-1", "MultMCNParticlesEta08-1"}, "Book (1) or do not book (0) event histogram"}; } cf_eh; // *) Event cuts: struct : ConfigurableGroup { - Configurable> cfUseEventCuts{"cfUseEventCuts", {"NumberOfEvents-1", "TotalMultiplicity-1", "SelectedTracks-1", "MultFV0M-1", "MultFT0M-1", "MultTPC-1", "MultNTracksPV-1", "MultTracklets-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Occupancy-1", "Trigger-0", "Sel7-1", "Sel8-1", "CentralityEstimator-1", "SelectedEvents-1", "NoSameBunchPileup-1", "IsGoodZvtxFT0vsPV-1", "IsVertexITSTPC-1", "IsVertexTOFmatched-1", "IsVertexTRDmatched-1", "OccupancyEstimator-1"}, "use (1) or do not use (0) event cuts"}; + Configurable> cfUseEventCuts{"cfUseEventCuts", {"NumberOfEvents-1", "TotalMultiplicity-1", "Multiplicity-1", "ReferenceMultiplicity-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Occupancy-1", "MultMCNParticlesEta08-1", "Trigger-0", "Sel7-1", "Sel8-1", "MultiplicityEstimator-1", "ReferenceMultiplicityEstimator-1", "CentralityEstimator-1", "SelectedEvents-1", "NoSameBunchPileup-1", "IsGoodZvtxFT0vsPV-1", "IsVertexITSTPC-1", "IsVertexTOFmatched-1", "IsVertexTRDmatched-1", "OccupancyEstimator-1"}, "use (1) or do not use (0) event cuts"}; Configurable cfUseEventCutCounterAbsolute{"cfUseEventCutCounterAbsolute", false, "profile and save how many times each event cut counter triggered (absolute). Use with care, as this is computationally heavy"}; Configurable cfUseEventCutCounterSequential{"cfUseEventCutCounterSequential", false, "profile and save how many times each event cut counter triggered (sequential). Use with care, as this is computationally heavy"}; Configurable cfPrintCutCounterContent{"cfPrintCutCounterContent", false, "if true, prints on the screen after each event the content of fEventCutCounterHist[*][*] (all which were booked)"}; // Remark: Preserve below the same ordering as in enum's eEventHistograms + eEventCuts. In hyperloop, in any case this ordering is lost, because there it's alphabetical TBI 20240521 check this, after I added now std::string prefix thingie Configurable> cfNumberOfEvents{"cfNumberOfEvents", {-1, 1000000000}, "total number of events to process (whether or not they survive event cuts): {min, max}, with convention: min <= N < max"}; Configurable> cfTotalMultiplicity{"cfTotalMultiplicity", {-1, 1000000000}, "total multiplicity range: {min, max}, with convention: min <= M < max"}; - Configurable> cfSelectedTracks{"cfSelectedTracks", {-1, 1000000000}, "selected tracks range: {min, max}, with convention: min <= M < max"}; - Configurable> cfMultFV0M{"cfMultFV0M", {-1, 1000000000}, "MultFV0M range {min, max}, with convention: min <= M < max"}; - Configurable> cfMultFT0M{"cfMultFT0M", {-1, 1000000000}, "MultFT0M range {min, max}, with convention: min <= M < max"}; - Configurable> cfMultTPC{"cfMultTPC", {-1, 1000000000}, "MultTPC range {min, max}, with convention: min <= M < max"}; - Configurable> cfMultNTracksPV{"cfMultNTracksPV", {-1, 1000000000}, "MultNTracksPV range {min, max}, with convention: min <= M < max"}; - Configurable> cfMultTracklets{"cfMultTracklets", {-1, 1000000000}, "MultTracklets range {min, max}, with convention: min <= M < max"}; + Configurable> cfMultiplicity{"cfMultiplicity", {-1., 1000000000.}, "multiplicity (defined via cfMultiplicityEstimator) range {min, max}, with convention: min <= M < max"}; + Configurable> cfReferenceMultiplicity{"cfReferenceMultiplicity", {-1., 1000000000.}, "reference multiplicity (defined via cfReferenceMultiplicityEstimator) range {min, max}, with convention: min <= M < max"}; Configurable> cfCentrality{"cfCentrality", {-10., 110.}, "centrality range: {min, max}, with convention: min <= cent < max"}; Configurable> cfVertex_x{"cfVertex_x", {-10., 10.}, "vertex x position range: {min, max}[cm], with convention: min <= Vx < max"}; Configurable> cfVertex_y{"cfVertex_y", {-10., 10.}, "vertex y position range: {min, max}[cm], with convention: min <= Vy < max"}; Configurable> cfVertex_z{"cfVertex_z", {-10., 10.}, "vertex z position range: {min, max}[cm], with convention: min <= Vz < max"}; - Configurable> cfNContributors{"cfNContributors", {-1, 1000000000}, "Number of vertex contributors: {min, max}, with convention: min <= N < max"}; + Configurable> cfNContributors{"cfNContributors", {2, 1000000000}, "Number of vertex contributors: {min, max}, with convention: min <= N < max"}; Configurable> cfImpactParameter{"cfImpactParameter", {-1, 1000000000}, "Impact parameter range (can be used only for sim): {min, max}, with convention: min <= IP < max"}; Configurable> cfOccupancy{"cfOccupancy", {-2, 1000000000}, "Range for occupancy (use cfOccupancyEstimator to set specific estimator): {min, max}, with convention: min <= X < max"}; - Configurable cfTrigger{"cfTrigger", "some supported trigger", "set here some supported trigger (kINT7, ...) "}; + Configurable> cfMultMCNParticlesEta08{"cfMultMCNParticlesEta08", {-1, 1000000000}, "Range for MultMCNParticlesEta08 : {min, max}, with convention: min <= X < max"}; + Configurable cfTrigger{"cfTrigger", "some supported trigger (e.g. kINT7, ...)", "set here some supported trigger"}; Configurable cfUseSel7{"cfUseSel7", false, "use for Run 1 and 2 data and MC (see official doc)"}; Configurable cfUseSel8{"cfUseSel8", false, "use for Run 3 data and MC (see official doc)"}; - Configurable cfCentralityEstimator{"cfCentralityEstimator", "some supported centrality estimator", "set here some supported centrality estimator (CentFT0C, CentFT0M, CentFV0A, CentNTPV, ... for Run 3, and CentRun2V0M, CentRun2SPDTracklets, ..., for Run 2 and 1) "}; + Configurable cfMultiplicityEstimator{"cfMultiplicityEstimator", "SelectedTracks", "all results vs. mult are calculated against this multiplicity. Can be set to SelectedTracks (calculated internally), ReferenceMultiplicity (calculated outside of my code), etc."}; + Configurable cfReferenceMultiplicityEstimator{"cfReferenceMultiplicityEstimator", "some supported option for ref. mult. (MultTPC, MultFV0M, etc.)", "Reference multiplicity, calculated outside of my code. Can be MultTPC, MultFV0M, etc."}; + Configurable cfCentralityEstimator{"cfCentralityEstimator", "some supported centrality estimator (e.g. CentFT0C, ...)", "set here some supported centrality estimator (CentFT0C, CentFT0M, CentFV0A, CentNTPV, ... for Run 3, and CentRun2V0M, CentRun2SPDTracklets, ..., for Run 2 and 1) "}; Configurable> cfSelectedEvents{"cfSelectedEvents", {-1, 1000000000}, "Selected number of events to process (i.e. only events which survive event cuts): {min, max}, with convention: min <= N < max"}; Configurable cfUseNoSameBunchPileup{"cfUseNoSameBunchPileup", false, "TBI 20240521 explanation"}; Configurable cfUseIsGoodZvtxFT0vsPV{"cfUseIsGoodZvtxFT0vsPV", false, "TBI 20240521 explanation"}; Configurable cfUseIsVertexITSTPC{"cfUseIsVertexITSTPC", false, "TBI 20240521 explanation"}; Configurable cfUseIsVertexTOFmatched{"cfUseIsVertexTOFmatched", false, "TBI 20240521 explanation"}; Configurable cfUseIsVertexTRDmatched{"cfUseIsVertexTRDmatched", false, "TBI 20240521 explanation"}; - Configurable cfOccupancyEstimator{"cfOccupancyEstimator", "some supported occupancy estimator", "set here some supported occupancy estimator (TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ..."}; + Configurable cfOccupancyEstimator{"cfOccupancyEstimator", "some supported occupancy estimator (e.g. TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ...)", "set here some supported occupancy estimator (TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ..."}; } cf_ec; // *) Particle histograms: @@ -102,17 +106,17 @@ struct : ConfigurableGroup { Configurable> cfPt{"cfPt", {0.2, 5.0}, "pt range: {min, max}[GeV], with convention: min <= pt < max"}; Configurable> cfEta{"cfEta", {-0.8, 0.8}, "eta range: {min, max}, with convention: min <= eta < max"}; Configurable> cfCharge{"cfCharge", {-1.5, 1.5}, "particle charge. {-1.5,0} = only negative, {0,1.5} = only positive"}; - Configurable> cftpcNClsFindable{"cftpcNClsFindable", {-1000., 1000.}, "tpcNClsFindable range: {min, max}, with convention: min <= eta < max"}; - Configurable> cftpcNClsShared{"cftpcNClsShared", {-1000., 1000.}, "tpcNClsShared range: {min, max}, with convention: min <= eta < max"}; - Configurable> cftpcNClsFound{"cftpcNClsFound", {-1000., 1000.}, "tpcNClsFound range: {min, max}, with convention: min <= eta < max"}; - Configurable> cftpcNClsCrossedRows{"cftpcNClsCrossedRows", {-1000., 1000.}, "tpcNClsCrossedRows range: {min, max}, with convention: min <= eta < max"}; - Configurable> cfitsNCls{"cfitsNCls", {-1000., 1000.}, "itsNCls range: {min, max}, with convention: min <= eta < max"}; - Configurable> cfitsNClsInnerBarrel{"cfitsNClsInnerBarrel", {-1000., 1000.}, "itsNClsInnerBarrel range: {min, max}, with convention: min <= eta < max"}; - Configurable> cftpcCrossedRowsOverFindableCls{"cftpcCrossedRowsOverFindableCls", {-1000., 1000.}, "tpcCrossedRowsOverFindableCls range: {min, max}, with convention: min <= eta < max"}; - Configurable> cftpcFoundOverFindableCls{"cftpcFoundOverFindableCls", {-1000., 1000.}, "tpcFoundOverFindableCls range: {min, max}, with convention: min <= eta < max"}; - Configurable> cftpcFractionSharedCls{"cftpcFractionSharedCls", {-1000., 1000.}, "tpcFractionSharedCls range: {min, max}, with convention: min <= eta < max"}; - Configurable> cfdcaXY{"cfdcaXY", {-1000., 1000.}, "dcaXY range: {min, max}, with convention: min <= dcaXY < max (yes, DCA can be negative!)"}; - Configurable> cfdcaZ{"cfdcaZ", {-1000., 1000.}, "dcaZ range: {min, max}, with convention: min <= dcaZ < max (yes, DCA can be negative!)"}; + Configurable> cftpcNClsFindable{"cftpcNClsFindable", {-1000., 1000.}, "tpcNClsFindable range: {min, max}, with convention: min <= cftpcNClsFindable < max"}; + Configurable> cftpcNClsShared{"cftpcNClsShared", {-1000., 1000.}, "tpcNClsShared range: {min, max}, with convention: min <= cftpcNClsShared < max"}; + Configurable> cftpcNClsFound{"cftpcNClsFound", {-1000., 1000.}, "tpcNClsFound range: {min, max}, with convention: min <= cftpcNClsFound < max"}; + Configurable> cftpcNClsCrossedRows{"cftpcNClsCrossedRows", {70., 1000.}, "tpcNClsCrossedRows range: {min, max}, with convention: min <= tpcNClsCrossedRows < max"}; + Configurable> cfitsNCls{"cfitsNCls", {5., 1000.}, "itsNCls range: {min, max}, with convention: min <= itsNCls < max"}; + Configurable> cfitsNClsInnerBarrel{"cfitsNClsInnerBarrel", {-1000., 1000.}, "itsNClsInnerBarrel range: {min, max}, with convention: min <= cfitsNClsInnerBarrel < max"}; + Configurable> cftpcCrossedRowsOverFindableCls{"cftpcCrossedRowsOverFindableCls", {0.8, 1000.}, "tpcCrossedRowsOverFindableCls range: {min, max}, with convention: min <= cftpcCrossedRowsOverFindableCls < max"}; + Configurable> cftpcFoundOverFindableCls{"cftpcFoundOverFindableCls", {-1000., 1000.}, "tpcFoundOverFindableCls range: {min, max}, with convention: min <= cftpcFoundOverFindableCls < max"}; + Configurable> cftpcFractionSharedCls{"cftpcFractionSharedCls", {-1000., 0.4}, "tpcFractionSharedCls range: {min, max}, with convention: min <= cftpcFractionSharedCls < max"}; + Configurable> cfdcaXY{"cfdcaXY", {-2.4, 2.4}, "dcaXY range: {min, max}, with convention: min <= dcaXY < max (yes, DCA can be negative!)"}; + Configurable> cfdcaZ{"cfdcaZ", {-3.2, 3.2}, "dcaZ range: {min, max}, with convention: min <= dcaZ < max (yes, DCA can be negative!)"}; Configurable> cfPDG{"cfPDG", {-5000., 5000.}, "PDG code"}; Configurable cftrackCutFlagFb1{"cftrackCutFlagFb1", false, "TBI 20240510 add description"}; Configurable cftrackCutFlagFb2{"cftrackCutFlagFb2", false, "TBI 20240510 add description"}; @@ -205,7 +209,7 @@ struct : ConfigurableGroup { Configurable> cfFixedLength_mult_bins{"cfFixedLength_mult_bins", {2000, 0., 20000.}, "nMultBins, multMin, multMax"}; Configurable> cfFixedLength_cent_bins{"cfFixedLength_cent_bins", {110, 0., 110.}, "nCentBins, centMin, centMax"}; Configurable> cfFixedLength_pt_bins{"cfFixedLength_pt_bins", {1000, 0., 100.}, "nPtBins, ptMin, ptMax"}; - Configurable> cfFixedLength_eta_bins{"cfFixedLength_eta_bins", {1000, -2., 2.}, "nEtaBins, etaMin, etaMax"}; + Configurable> cfFixedLength_eta_bins{"cfFixedLength_eta_bins", {100, -2., 2.}, "nEtaBins, etaMin, etaMax"}; Configurable> cfFixedLength_occu_bins{"cfFixedLength_occu_bins", {400, 0., 4000.}, "nOccuBins, occuMin, occuMax"}; // Variable-length binning (per request): diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h index bb020581fc7..88acf3dfb48 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h @@ -45,6 +45,8 @@ struct TaskConfiguration { Bool_t fVerbose = kFALSE; // print additional info during debugging, but not for simply utility function or function calls per particle (see next) Bool_t fVerboseUtility = kFALSE; // print additional info during debugging also for simply utility function, but not for function calls per particle (see next) Bool_t fVerboseForEachParticle = kFALSE; // print additional info during debugging, also for function calls per particle + Bool_t fVerboseEventCounter = kTRUE; // print or not only event counter + Bool_t fPlainPrintout = kFALSE; // print in color or in plain (use the latter in HL) Bool_t fDoAdditionalInsanityChecks = kFALSE; // do additional insanity checks at run time, at the expense of losing a bit of performance // (for instance, check if the run number in the current 'collision' is the same as run number in the first 'collision', etc.) Bool_t fInsanityCheckForEachParticle = kFALSE; // do additional insanity checks at run time for each particle, at the expense of losing a lot of performance. Use only during debugging. @@ -58,39 +60,47 @@ struct TaskConfiguration { TStopwatch* fTimer[eTimer_N] = {NULL}; // stopwatch, global (overal execution time) and local Float_t fFloatingPointPrecision = 1.e-6; // two floats are the same if TMath::Abs(f1 - f2) < fFloatingPointPrecision (there is configurable for it) Int_t fSequentialBailout = 0; // if fSequentialBailout > 0, then each fSequentialBailout events the function BailOut() is called. Can be used for real analysis and for IV. + Bool_t fUseSpecificCuts = kFALSE; // apply after DefaultCuts() also hardwired analysis-specific cuts, determined via tc.fWhichSpecificCuts + TString fWhichSpecificCuts = ""; // determine which set of analysis-specific cuts will be applied after DefaultCuts(). Use in combination with tc.fUseSpecificCuts } tc; // "tc" labels an instance of this group of variables. // *) Event-by-event quantities: struct EventByEventQuantities { - Int_t fSelectedTracks = 0; // integer counter of tracks used to calculate Q-vectors, after all particle cuts have been applied - Float_t fCentrality = 0.; // event-by-event centrality. Value of the default centrality estimator, set via configurable cfCentralityEstimator - Float_t fOccupancy = 0.; // event-by-event occupancy. Value of the default occupancy estimator, set via configurable cfOccupancyEstimator -} ebye; // "ebye" is a common label for objects in this struct + Int_t fSelectedTracks = 0; // integer counter of tracks used to calculate Q-vectors, after all particle cuts have been applied + Float_t fMultiplicity = 0.; // my internal multiplicity, can be set to fSelectedTracks (calculated internally), fReferenceMultiplicity (calculated outside of my code), etc. + // Results "vs. mult" are plotted against fMultiplicity, whatever it is set to. + // Use configurable cfMultiplicityEstimator[eMultiplicityEstimator] to define what is this multiplicity, by default it is "SelectedTracks" + Float_t fReferenceMultiplicity = 0.; // reference multiplicity, calculated outside of my code. Can be "MultTPC", "MultFV0M", etc. + // Use configurable cfReferenceMultiplicityEstimator[eReferenceMultiplicityEstimator]" to define what is this multiplicity, by default it is "TBI 20241123 I do not know yet which estimator is best for ref. mult." + Float_t fCentrality = 0.; // event-by-event centrality. Value of the default centrality estimator, set via configurable cfCentralityEstimator + Float_t fOccupancy = 0.; // event-by-event occupancy. Value of the default occupancy estimator, set via configurable cfOccupancyEstimator +} ebye; // "ebye" is a common label for objects in this struct // *) QA: // Remark 1: I keep new histograms in this group, until I need them permanently in the analysis. Then, they are moved to EventHistograms or ParticleHistograms (yes, even if they are 2D). // Remark 2: All 2D histograms book as TH2F, due to "stmem error" in terminate (see .cxx for further details) struct QualityAssurance { - TList* fQAList = NULL; //! use only in Run 2 and Run 1. TBI 20240522 I stil need to validate this one over MC - eSel8, // See def. of sel7 in Ref. b) above. Event selection decision based on TVX => use only in Run 3, both for data and MC - // *) As of 20240410, kNoITSROFrameBorder (only in MC) and kNoTimeFrameBorder event selection cuts are part of Sel8 - // See also email from EK from 20240410 - eCentralityEstimator, // the default centrality estimator, set via configurable. All supported centrality estimators, for QA, etc, are in enum eCentralityEstimators - eSelectedEvents, // selected events = eNumberOfEvents + eAfter => therefore I do not need a special histogram for it - eNoSameBunchPileup, // reject collisions in case of pileup with another collision in the same foundBC (emails from IA on 20240404 and EK on 20240410) - eIsGoodZvtxFT0vsPV, // small difference between z-vertex from PV and from FT0 (emails from IA on 20240404 and EK on 20240410) - eIsVertexITSTPC, // at least one ITS-TPC track (reject vertices built from ITS-only tracks) (emails from IA on 20240404 and EK on 20240410 - eIsVertexTOFmatched, // at least one of vertex contributors is matched to TOF - eIsVertexTRDmatched, // at least one of vertex contributors is matched to TRD - eOccupancyEstimator, // the default Occupancy estimator, set via configurable. All supported centrality estimators, for QA, etc, are in enum eOccupancyEstimators + eTrigger = eEventHistograms_N, // Do NOT use eTrigger for Run 3. Validated only for Run 2, and it has to be "kINT7" . TBI 20240522 investigate for Run 1 + eSel7, // See def. of sel7 in Ref. b) above. Event selection decision based on V0A & V0C => use only in Run 2 and Run 1. TBI 20240522 I stil need to validate this one over MC + eSel8, // See def. of sel7 in Ref. b) above. Event selection decision based on TVX => use only in Run 3, both for data and MC + // *) As of 20240410, kNoITSROFrameBorder (only in MC) and kNoTimeFrameBorder event selection cuts are part of Sel8 + // See also email from EK from 2024041 + eMultiplicityEstimator, // see documentation below for ebye.fMultiplicity + eReferenceMultiplicityEstimator, // see documentation below for ebye.fReferenceMultiplicity + eCentralityEstimator, // the default centrality estimator, set via configurable. All supported centrality estimators, for QA, etc, are in enum eCentralityEstimators + eSelectedEvents, // selected events = eNumberOfEvents + eAfter => therefore I do not need a special histogram for it + eNoSameBunchPileup, // reject collisions in case of pileup with another collision in the same foundBC (emails from IA on 20240404 and EK on 20240410) + eIsGoodZvtxFT0vsPV, // small difference between z-vertex from PV and from FT0 (emails from IA on 20240404 and EK on 20240410) + eIsVertexITSTPC, // at least one ITS-TPC track (reject vertices built from ITS-only tracks) (emails from IA on 20240404 and EK on 20240410 + eIsVertexTOFmatched, // at least one of vertex contributors is matched to TOF + eIsVertexTRDmatched, // at least one of vertex contributors is matched to TRD + eOccupancyEstimator, // the default Occupancy estimator, set via configurable. All supported centrality estimators, for QA, etc, are in enum eOccupancyEstimators eEventCuts_N }; @@ -225,18 +228,29 @@ enum eCutCounter { }; enum eQAEventHistograms2D { - eMultTPC_vs_NContributors = 0, - eMultTPC_vs_Centrality, // only vs. chosen centrality estimator - eVertex_z_vs_MultTPC, - eVertex_z_vs_NContributors, + // General (estimators can be chosen via configurables): + eMultiplicity_vs_ReferenceMultiplicity = 0, + eMultiplicity_vs_NContributors, + eMultiplicity_vs_Centrality, + eMultiplicity_vs_Vertex_z, + eMultiplicity_vs_Occupancy, + eReferenceMultiplicity_vs_NContributors, + eReferenceMultiplicity_vs_Centrality, + eReferenceMultiplicity_vs_Vertex_z, + eReferenceMultiplicity_vs_Occupancy, + eNContributors_vs_Centrality, + eNContributors_vs_Vertex_z, + eNContributors_vs_Occupancy, + eCentrality_vs_Vertex_z, + eCentrality_vs_Occupancy, + eVertex_z_vs_Occupancy, + // ... + // Specific (estimators are hardwired): eCentFT0C_vs_CentNTPV, // Run 3 centrality eCentFT0M_vs_CentNTPV, // Run 3 centrality eCentRun2V0M_vs_CentRun2SPDTracklets, // Run 2 centrality (do not use in Run 1 converted, because there is no centrality information) - eCentRun2V0M_vs_NContributors, // Run 2 centrality (do not use in Run 1 converted, because there is no centrality information) eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange, - eTrackOccupancyInTimeRange_vs_MultTPC, - eTrackOccupancyInTimeRange_vs_Vertex_z, - eTrackOccupancyInTimeRange_vs_Centrality, // only vs. chosen centrality estimator + // ... eQAEventHistograms2D_N }; @@ -245,6 +259,18 @@ enum eQAParticleHistograms2D { eQAParticleHistograms2D_N }; +enum eReferenceMultiplicityEstimators { + // Run 3: + eMultTPC = 0, + eMultFV0M, // ref. mult from helper task o2-analysis-multiplicity-table + eMultFT0C, // ref. mult from helper task o2-analysis-multiplicity-table + eMultFT0M, // ref. mult from helper task o2-analysis-multiplicity-table + eMultNTracksPV, // ref. mult from helper task o2-analysis-multiplicity-table + // Run 2: + eMultTracklets, // ref. mult from helper task o2-analysis-multiplicity-table, use only for Run 2 + eReferenceMultiplicityEstimators_N +}; + enum eCentralityEstimators { // Run 3: eCentFT0C = 0, @@ -269,4 +295,9 @@ enum eEventCounter { eEventCounter_N }; +enum eSpecificCuts { + eLHC23zzh, + eSpecificCuts_N +}; + #endif // PWGCF_MULTIPARTICLECORRELATIONS_CORE_MUPA_ENUMS_H_ diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h index 417690caeb4..7e77e64e934 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h @@ -55,9 +55,18 @@ void BookBaseList() fBasePro->GetXaxis()->SetBinLabel(eVerbose, "fVerbose"); fBasePro->Fill(eVerbose, static_cast(tc.fVerbose)); + fBasePro->GetXaxis()->SetBinLabel(eVerboseUtility, "fVerboseUtility"); + fBasePro->Fill(eVerboseUtility, static_cast(tc.fVerboseUtility)); + fBasePro->GetXaxis()->SetBinLabel(eVerboseForEachParticle, "fVerboseForEachParticle"); fBasePro->Fill(eVerboseForEachParticle, static_cast(tc.fVerboseForEachParticle)); + fBasePro->GetXaxis()->SetBinLabel(eVerboseEventCounter, "fVerboseEventCounter"); + fBasePro->Fill(eVerboseEventCounter, static_cast(tc.fVerboseEventCounter)); + + fBasePro->GetXaxis()->SetBinLabel(ePlainPrintout, "fPlainPrintout"); + fBasePro->Fill(ePlainPrintout, static_cast(tc.fPlainPrintout)); + fBasePro->GetXaxis()->SetBinLabel(eDoAdditionalInsanityChecks, "fDoAdditionalInsanityChecks"); fBasePro->Fill(eDoAdditionalInsanityChecks, static_cast(tc.fDoAdditionalInsanityChecks)); @@ -84,6 +93,11 @@ void BookBaseList() fBasePro->GetXaxis()->SetBinLabel(eSequentialBailout, "fSequentialBailout"); fBasePro->Fill(eSequentialBailout, static_cast(tc.fSequentialBailout)); + fBasePro->GetXaxis()->SetBinLabel(eUseSpecificCuts, "fUseSpecificCuts"); + fBasePro->Fill(eUseSpecificCuts, static_cast(tc.fUseSpecificCuts)); + + fBasePro->GetXaxis()->SetBinLabel(eWhichSpecificCuts, Form("WhichSpecificCuts = %s", tc.fWhichSpecificCuts.Data())); + fBaseList->Add(fBasePro); if (tc.fVerbose) { @@ -132,6 +146,8 @@ void DefaultConfiguration() } tc.fVerboseUtility = cf_tc.cfVerboseUtility; tc.fVerboseForEachParticle = cf_tc.cfVerboseForEachParticle; + tc.fVerboseEventCounter = cf_tc.cfVerboseEventCounter; + tc.fPlainPrintout = cf_tc.cfPlainPrintout; tc.fDoAdditionalInsanityChecks = cf_tc.cfDoAdditionalInsanityChecks; // Set automatically what to process, from an implicit variable "doprocessSomeProcessName" within a PROCESS_SWITCH clause: tc.fProcess[eProcessRec] = doprocessRec; @@ -200,16 +216,14 @@ void DefaultConfiguration() tc.fUseStopwatch = cf_tc.cfUseStopwatch; tc.fFloatingPointPrecision = cf_tc.cfFloatingPointPrecision; tc.fSequentialBailout = cf_tc.cfSequentialBailout; + tc.fUseSpecificCuts = cf_tc.cfUseSpecificCuts; + tc.fWhichSpecificCuts = cf_tc.cfWhichSpecificCuts; // *) Event histograms (for QA see below): eh.fEventHistogramsName[eNumberOfEvents] = "NumberOfEvents"; eh.fEventHistogramsName[eTotalMultiplicity] = "TotalMultiplicity"; - eh.fEventHistogramsName[eSelectedTracks] = "SelectedTracks"; - eh.fEventHistogramsName[eMultFV0M] = "MultFV0M"; - eh.fEventHistogramsName[eMultFT0M] = "MultFT0M"; - eh.fEventHistogramsName[eMultTPC] = "MultTPC"; - eh.fEventHistogramsName[eMultNTracksPV] = "MultNTracksPV"; - eh.fEventHistogramsName[eMultTracklets] = "MultTracklets"; + eh.fEventHistogramsName[eMultiplicity] = "Multiplicity"; + eh.fEventHistogramsName[eReferenceMultiplicity] = "ReferenceMultiplicity"; eh.fEventHistogramsName[eCentrality] = "Centrality"; eh.fEventHistogramsName[eVertex_x] = "Vertex_x"; eh.fEventHistogramsName[eVertex_y] = "Vertex_y"; @@ -217,6 +231,8 @@ void DefaultConfiguration() eh.fEventHistogramsName[eNContributors] = "NContributors"; eh.fEventHistogramsName[eImpactParameter] = "ImpactParameter"; eh.fEventHistogramsName[eOccupancy] = "Occupancy"; + eh.fEventHistogramsName[eMultMCNParticlesEta08] = "MultMCNParticlesEta08"; + for (Int_t t = 0; t < eEventHistograms_N; t++) { if (eh.fEventHistogramsName[t].EqualTo("")) { LOGF(fatal, "\033[1;31m%s at line %d : name of fEventHistogramsName[%d] is not set \033[0m", __FUNCTION__, __LINE__, static_cast(t)); @@ -231,12 +247,8 @@ void DefaultConfiguration() // Set names of all event cuts: ec.fEventCutName[eNumberOfEvents] = "NumberOfEvents"; ec.fEventCutName[eTotalMultiplicity] = "TotalMultiplicity"; - ec.fEventCutName[eSelectedTracks] = "SelectedTracks"; - ec.fEventCutName[eMultFV0M] = "MultFV0M"; - ec.fEventCutName[eMultFT0M] = "MultFT0M"; - ec.fEventCutName[eMultTPC] = "MultTPC"; - ec.fEventCutName[eMultNTracksPV] = "MultNTracksPV"; - ec.fEventCutName[eMultTracklets] = "MultTracklets"; + ec.fEventCutName[eMultiplicity] = "Multiplicity"; + ec.fEventCutName[eReferenceMultiplicity] = "ReferenceMultiplicity"; ec.fEventCutName[eCentrality] = "Centrality"; ec.fEventCutName[eVertex_x] = "Vertex_x"; ec.fEventCutName[eVertex_y] = "Vertex_y"; @@ -244,10 +256,13 @@ void DefaultConfiguration() ec.fEventCutName[eNContributors] = "NContributors"; ec.fEventCutName[eImpactParameter] = "ImpactParameter"; ec.fEventCutName[eOccupancy] = "Occupancy"; + ec.fEventCutName[eMultMCNParticlesEta08] = "MultMCNParticlesEta08"; ec.fEventCutName[eTrigger] = "Trigger"; ec.fEventCutName[eSel7] = "Sel7"; ec.fEventCutName[eSel8] = "Sel8"; ec.fEventCutName[eCentralityEstimator] = "CentralityEstimator"; + ec.fEventCutName[eMultiplicityEstimator] = "MultiplicityEstimator"; + ec.fEventCutName[eReferenceMultiplicityEstimator] = "ReferenceMultiplicityEstimator"; ec.fEventCutName[eSelectedEvents] = "SelectedEvents"; ec.fEventCutName[eNoSameBunchPileup] = "NoSameBunchPileup"; ec.fEventCutName[eIsGoodZvtxFT0vsPV] = "IsGoodZvtxFT0vsPV"; @@ -453,6 +468,15 @@ void DefaultConfiguration() // *) QA: // Remark: I keep it on the bottom, because here I define some names in temrs of names defined above. qa.fCheckUnderflowAndOverflow = cf_qa.cfCheckUnderflowAndOverflow; + qa.fRebin = cf_qa.cfRebin; + + // **) Reference multiplicity estimators: + qa.fReferenceMultiplicityEstimatorName[eMultTPC] = "MultTPC"; + qa.fReferenceMultiplicityEstimatorName[eMultFV0M] = "MultFV0M"; + qa.fReferenceMultiplicityEstimatorName[eMultFT0C] = "MultFT0C"; + qa.fReferenceMultiplicityEstimatorName[eMultFT0M] = "MultFT0M"; + qa.fReferenceMultiplicityEstimatorName[eMultNTracksPV] = "MultNTracksPV"; + qa.fReferenceMultiplicityEstimatorName[eMultTracklets] = "MultTracklets"; // **) Centrality estimators: qa.fCentralityEstimatorName[eCentFT0C] = "CentFT0C"; @@ -468,18 +492,30 @@ void DefaultConfiguration() // **) Names of QA 2D event histograms: // Remark: Do NOT use FancyFormatting here, only later in BookQAHistograms() for axis titles! - qa.fEventHistogramsName2D[eMultTPC_vs_NContributors] = Form("%s_vs_%s", eh.fEventHistogramsName[eMultTPC].Data(), eh.fEventHistogramsName[eNContributors].Data()); - qa.fEventHistogramsName2D[eMultTPC_vs_Centrality] = Form("%s_vs_%s", eh.fEventHistogramsName[eMultTPC].Data(), eh.fEventHistogramsName[eCentrality].Data()); - qa.fEventHistogramsName2D[eVertex_z_vs_MultTPC] = Form("%s_vs_%s", eh.fEventHistogramsName[eVertex_z].Data(), eh.fEventHistogramsName[eMultTPC].Data()); - qa.fEventHistogramsName2D[eVertex_z_vs_NContributors] = Form("%s_vs_%s", eh.fEventHistogramsName[eVertex_z].Data(), eh.fEventHistogramsName[eNContributors].Data()); + qa.fEventHistogramsName2D[eMultiplicity_vs_ReferenceMultiplicity] = Form("%s_vs_%s", eh.fEventHistogramsName[eMultiplicity].Data(), eh.fEventHistogramsName[eReferenceMultiplicity].Data()); + qa.fEventHistogramsName2D[eMultiplicity_vs_NContributors] = Form("%s_vs_%s", eh.fEventHistogramsName[eMultiplicity].Data(), eh.fEventHistogramsName[eNContributors].Data()); + qa.fEventHistogramsName2D[eMultiplicity_vs_Centrality] = Form("%s_vs_%s", eh.fEventHistogramsName[eMultiplicity].Data(), eh.fEventHistogramsName[eCentrality].Data()); + qa.fEventHistogramsName2D[eMultiplicity_vs_Vertex_z] = Form("%s_vs_%s", eh.fEventHistogramsName[eMultiplicity].Data(), eh.fEventHistogramsName[eVertex_z].Data()); + qa.fEventHistogramsName2D[eMultiplicity_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eMultiplicity].Data(), eh.fEventHistogramsName[eOccupancy].Data()); + + qa.fEventHistogramsName2D[eReferenceMultiplicity_vs_NContributors] = Form("%s_vs_%s", eh.fEventHistogramsName[eReferenceMultiplicity].Data(), eh.fEventHistogramsName[eNContributors].Data()); + qa.fEventHistogramsName2D[eReferenceMultiplicity_vs_Centrality] = Form("%s_vs_%s", eh.fEventHistogramsName[eReferenceMultiplicity].Data(), eh.fEventHistogramsName[eCentrality].Data()); + qa.fEventHistogramsName2D[eReferenceMultiplicity_vs_Vertex_z] = Form("%s_vs_%s", eh.fEventHistogramsName[eReferenceMultiplicity].Data(), eh.fEventHistogramsName[eVertex_z].Data()); + qa.fEventHistogramsName2D[eReferenceMultiplicity_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eReferenceMultiplicity].Data(), eh.fEventHistogramsName[eOccupancy].Data()); + + qa.fEventHistogramsName2D[eNContributors_vs_Centrality] = Form("%s_vs_%s", eh.fEventHistogramsName[eNContributors].Data(), eh.fEventHistogramsName[eCentrality].Data()); + qa.fEventHistogramsName2D[eNContributors_vs_Vertex_z] = Form("%s_vs_%s", eh.fEventHistogramsName[eNContributors].Data(), eh.fEventHistogramsName[eVertex_z].Data()); + qa.fEventHistogramsName2D[eNContributors_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eNContributors].Data(), eh.fEventHistogramsName[eOccupancy].Data()); + + qa.fEventHistogramsName2D[eCentrality_vs_Vertex_z] = Form("%s_vs_%s", eh.fEventHistogramsName[eCentrality].Data(), eh.fEventHistogramsName[eVertex_z].Data()); + qa.fEventHistogramsName2D[eCentrality_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eCentrality].Data(), eh.fEventHistogramsName[eOccupancy].Data()); + + qa.fEventHistogramsName2D[eVertex_z_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eVertex_z].Data(), eh.fEventHistogramsName[eOccupancy].Data()); + qa.fEventHistogramsName2D[eCentFT0C_vs_CentNTPV] = Form("%s_vs_%s", qa.fCentralityEstimatorName[eCentFT0C].Data(), qa.fCentralityEstimatorName[eCentNTPV].Data()); qa.fEventHistogramsName2D[eCentFT0M_vs_CentNTPV] = Form("%s_vs_%s", qa.fCentralityEstimatorName[eCentFT0M].Data(), qa.fCentralityEstimatorName[eCentNTPV].Data()); qa.fEventHistogramsName2D[eCentRun2V0M_vs_CentRun2SPDTracklets] = Form("%s_vs_%s", qa.fCentralityEstimatorName[eCentRun2V0M].Data(), qa.fCentralityEstimatorName[eCentRun2SPDTracklets].Data()); - qa.fEventHistogramsName2D[eCentRun2V0M_vs_NContributors] = Form("%s_vs_%s", qa.fCentralityEstimatorName[eCentRun2V0M].Data(), eh.fEventHistogramsName[eNContributors].Data()); qa.fEventHistogramsName2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = Form("%s_vs_%s", qa.fOccupancyEstimatorName[eTrackOccupancyInTimeRange].Data(), qa.fOccupancyEstimatorName[eFT0COccupancyInTimeRange].Data()); - qa.fEventHistogramsName2D[eTrackOccupancyInTimeRange_vs_MultTPC] = Form("%s_vs_%s", qa.fOccupancyEstimatorName[eTrackOccupancyInTimeRange].Data(), eh.fEventHistogramsName[eMultTPC].Data()); - qa.fEventHistogramsName2D[eTrackOccupancyInTimeRange_vs_Vertex_z] = Form("%s_vs_%s", qa.fOccupancyEstimatorName[eTrackOccupancyInTimeRange].Data(), eh.fEventHistogramsName[eVertex_z].Data()); - qa.fEventHistogramsName2D[eTrackOccupancyInTimeRange_vs_Centrality] = Form("%s_vs_%s", qa.fOccupancyEstimatorName[eTrackOccupancyInTimeRange].Data(), eh.fEventHistogramsName[eCentrality].Data()); // ***) Quick insanity check that all names are set: for (Int_t t = 0; t < eQAEventHistograms2D_N; t++) { @@ -593,12 +629,8 @@ void DefaultBooking() // I append "&& eh.fFillEventHistograms" below, to switch off booking of all event histograms with one common flag: eh.fBookEventHistograms[eNumberOfEvents] = Alright(lBookEventHistograms[eNumberOfEvents]) && eh.fFillEventHistograms; eh.fBookEventHistograms[eTotalMultiplicity] = Alright(lBookEventHistograms[eTotalMultiplicity]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eSelectedTracks] = Alright(lBookEventHistograms[eSelectedTracks]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eMultFV0M] = Alright(lBookEventHistograms[eMultFV0M]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eMultFT0M] = Alright(lBookEventHistograms[eMultFT0M]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eMultTPC] = Alright(lBookEventHistograms[eMultTPC]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eMultNTracksPV] = Alright(lBookEventHistograms[eMultNTracksPV]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eMultTracklets] = Alright(lBookEventHistograms[eMultTracklets]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eMultiplicity] = Alright(lBookEventHistograms[eMultiplicity]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eReferenceMultiplicity] = Alright(lBookEventHistograms[eReferenceMultiplicity]) && eh.fFillEventHistograms; eh.fBookEventHistograms[eCentrality] = Alright(lBookEventHistograms[eCentrality]) && eh.fFillEventHistograms; eh.fBookEventHistograms[eVertex_x] = Alright(lBookEventHistograms[eVertex_x]) && eh.fFillEventHistograms; eh.fBookEventHistograms[eVertex_y] = Alright(lBookEventHistograms[eVertex_y]) && eh.fFillEventHistograms; @@ -606,6 +638,7 @@ void DefaultBooking() eh.fBookEventHistograms[eNContributors] = Alright(lBookEventHistograms[eNContributors]) && eh.fFillEventHistograms; eh.fBookEventHistograms[eImpactParameter] = Alright(lBookEventHistograms[eImpactParameter]) && eh.fFillEventHistograms; eh.fBookEventHistograms[eOccupancy] = Alright(lBookEventHistograms[eOccupancy]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eMultMCNParticlesEta08] = Alright(lBookEventHistograms[eMultMCNParticlesEta08]) && eh.fFillEventHistograms; // b) Event histograms 2D: // TBI 20240515 Ideally, all 2D shall go to QA group, see below @@ -691,7 +724,7 @@ void DefaultBooking() if (lBookQAEventHistograms2D.size() != eQAEventHistograms2D_N) { LOGF(info, "\033[1;31m lBookQAEventHistograms2D.size() = %d\033[0m", lBookQAEventHistograms2D.size()); LOGF(info, "\033[1;31m eQAEventHistograms2D_N = %d\033[0m", static_cast(eQAEventHistograms2D_N)); - LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookQAEventHistograms2D, and number of entries in enum eEventHistograms2D \n \033[0m", __FUNCTION__, __LINE__); + LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookQAEventHistograms2D, and number of entries in enum eQAEventHistograms2D \n \033[0m", __FUNCTION__, __LINE__); } // *) Insanity check on the content and ordering of QA 2D event histograms in the initialization in configurable cfBookQAEventHistograms2D: @@ -704,18 +737,25 @@ void DefaultBooking() } // I append "&& qa.fFillQAEventHistograms2D" below, to switch off booking of all 2D event histograms with one common flag: - qa.fBookQAEventHistograms2D[eMultTPC_vs_NContributors] = Alright(lBookQAEventHistograms2D[eMultTPC_vs_NContributors]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eMultTPC_vs_Centrality] = Alright(lBookQAEventHistograms2D[eMultTPC_vs_Centrality]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eVertex_z_vs_MultTPC] = Alright(lBookQAEventHistograms2D[eVertex_z_vs_MultTPC]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eVertex_z_vs_NContributors] = Alright(lBookQAEventHistograms2D[eVertex_z_vs_NContributors]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_NContributors] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_NContributors]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_Centrality] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Centrality]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_NContributors] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_NContributors]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Centrality] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Centrality]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eNContributors_vs_Centrality] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Centrality]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eNContributors_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eNContributors_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentrality_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eCentrality_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentrality_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eCentrality_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eVertex_z_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eVertex_z_vs_Occupancy]) && qa.fFillQAEventHistograms2D; qa.fBookQAEventHistograms2D[eCentFT0C_vs_CentNTPV] = Alright(lBookQAEventHistograms2D[eCentFT0C_vs_CentNTPV]) && qa.fFillQAEventHistograms2D; qa.fBookQAEventHistograms2D[eCentFT0M_vs_CentNTPV] = Alright(lBookQAEventHistograms2D[eCentFT0M_vs_CentNTPV]) && qa.fFillQAEventHistograms2D; qa.fBookQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets] = Alright(lBookQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCentRun2V0M_vs_NContributors] = Alright(lBookQAEventHistograms2D[eCentRun2V0M_vs_NContributors]) && qa.fFillQAEventHistograms2D; qa.fBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = Alright(lBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_MultTPC] = Alright(lBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_MultTPC]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_Centrality] = Alright(lBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_Centrality]) && qa.fFillQAEventHistograms2D; // **) QA 2D particle histograms: qa.fFillQAParticleHistograms2D = cf_qa.cfFillQAParticleHistograms2D; @@ -773,33 +813,17 @@ void DefaultBinning() eh.fEventHistogramsBins[eNumberOfEvents][1] = 0.; eh.fEventHistogramsBins[eNumberOfEvents][2] = 1.; - eh.fEventHistogramsBins[eTotalMultiplicity][0] = 10000; + eh.fEventHistogramsBins[eTotalMultiplicity][0] = 10000. / qa.fRebin; eh.fEventHistogramsBins[eTotalMultiplicity][1] = 0.; - eh.fEventHistogramsBins[eTotalMultiplicity][2] = 1.e5; - - eh.fEventHistogramsBins[eSelectedTracks][0] = 10000; - eh.fEventHistogramsBins[eSelectedTracks][1] = 0.; - eh.fEventHistogramsBins[eSelectedTracks][2] = 1.e5; - - eh.fEventHistogramsBins[eMultFV0M][0] = 10000; - eh.fEventHistogramsBins[eMultFV0M][1] = 0.; - eh.fEventHistogramsBins[eMultFV0M][2] = 1.e5; - - eh.fEventHistogramsBins[eMultFT0M][0] = 10000; - eh.fEventHistogramsBins[eMultFT0M][1] = 0.; - eh.fEventHistogramsBins[eMultFT0M][2] = 1.e5; - - eh.fEventHistogramsBins[eMultTPC][0] = 10000; - eh.fEventHistogramsBins[eMultTPC][1] = 0.; - eh.fEventHistogramsBins[eMultTPC][2] = 1.e5; + eh.fEventHistogramsBins[eTotalMultiplicity][2] = 100000.; - eh.fEventHistogramsBins[eMultNTracksPV][0] = 10000; - eh.fEventHistogramsBins[eMultNTracksPV][1] = 0.; - eh.fEventHistogramsBins[eMultNTracksPV][2] = 1.e5; + eh.fEventHistogramsBins[eMultiplicity][0] = 2000. / qa.fRebin; + eh.fEventHistogramsBins[eMultiplicity][1] = 0.; + eh.fEventHistogramsBins[eMultiplicity][2] = 20000.; - eh.fEventHistogramsBins[eMultTracklets][0] = 10000; - eh.fEventHistogramsBins[eMultTracklets][1] = 0.; - eh.fEventHistogramsBins[eMultTracklets][2] = 1.e5; + eh.fEventHistogramsBins[eReferenceMultiplicity][0] = 6000. / qa.fRebin; + eh.fEventHistogramsBins[eReferenceMultiplicity][1] = 0.; + eh.fEventHistogramsBins[eReferenceMultiplicity][2] = 60000.; eh.fEventHistogramsBins[eCentrality][0] = 120; // intentionally, because if centrality is not determined, it's set to 105.0 at the moment eh.fEventHistogramsBins[eCentrality][1] = -10.; @@ -817,7 +841,7 @@ void DefaultBinning() eh.fEventHistogramsBins[eVertex_z][1] = -40.; eh.fEventHistogramsBins[eVertex_z][2] = 40.; - eh.fEventHistogramsBins[eNContributors][0] = 1000; + eh.fEventHistogramsBins[eNContributors][0] = 1000. / qa.fRebin; eh.fEventHistogramsBins[eNContributors][1] = 0.; eh.fEventHistogramsBins[eNContributors][2] = 10000.; @@ -825,9 +849,21 @@ void DefaultBinning() eh.fEventHistogramsBins[eImpactParameter][1] = -1000.; // It's set to -999 if not meaningful eh.fEventHistogramsBins[eImpactParameter][2] = 1000.; - eh.fEventHistogramsBins[eOccupancy][0] = 151; - eh.fEventHistogramsBins[eOccupancy][1] = -100.; // It's set to -1 if not meaningful TBI 20241109 check this further - eh.fEventHistogramsBins[eOccupancy][2] = 15000.; + if (ec.fsEventCuts[eOccupancyEstimator].EqualTo("TrackOccupancyInTimeRange", TString::kIgnoreCase)) { + eh.fEventHistogramsBins[eOccupancy][0] = 151; + eh.fEventHistogramsBins[eOccupancy][1] = -100.; // It's set to -1 if not meaningful TBI 20241109 check this further + eh.fEventHistogramsBins[eOccupancy][2] = 15000.; + } else if (ec.fsEventCuts[eOccupancyEstimator].EqualTo("FT0COccupancyInTimeRange", TString::kIgnoreCase)) { // keep in sync with values below for 2D QA + eh.fEventHistogramsBins[eOccupancy][0] = 601; + eh.fEventHistogramsBins[eOccupancy][1] = -100.; // It's set to -1 if not meaningful TBI 20241109 check this further + eh.fEventHistogramsBins[eOccupancy][2] = 60000.; + } + // For 2D QA correlation plot, temporarily I set it to maximum of the 2 => TBI 20241114 this can be refined + if (qa.fBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange]) { + eh.fEventHistogramsBins[eOccupancy][0] = 601; + eh.fEventHistogramsBins[eOccupancy][1] = -100.; // It's set to -1 if not meaningful TBI 20241109 check this further + eh.fEventHistogramsBins[eOccupancy][2] = 60000.; + } // b) Default binning for particle histograms 1D: ph.fParticleHistogramsBins[ePhi][0] = 360; @@ -878,17 +914,17 @@ void DefaultBinning() ph.fParticleHistogramsBins[etpcFoundOverFindableCls][1] = 0.; ph.fParticleHistogramsBins[etpcFoundOverFindableCls][2] = 5000.; - ph.fParticleHistogramsBins[etpcFractionSharedCls][0] = 600; + ph.fParticleHistogramsBins[etpcFractionSharedCls][0] = 110; ph.fParticleHistogramsBins[etpcFractionSharedCls][1] = -1.; // yes, I saw here entries with negative values TBI 20240507 check what are these values - ph.fParticleHistogramsBins[etpcFractionSharedCls][2] = 1000.; + ph.fParticleHistogramsBins[etpcFractionSharedCls][2] = 10.; ph.fParticleHistogramsBins[edcaXY][0] = 2000; - ph.fParticleHistogramsBins[edcaXY][1] = -1000.; - ph.fParticleHistogramsBins[edcaXY][2] = 1000.; + ph.fParticleHistogramsBins[edcaXY][1] = -10.; + ph.fParticleHistogramsBins[edcaXY][2] = 10.; ph.fParticleHistogramsBins[edcaZ][0] = 2000; - ph.fParticleHistogramsBins[edcaZ][1] = -1000.; - ph.fParticleHistogramsBins[edcaZ][2] = 1000.; + ph.fParticleHistogramsBins[edcaZ][1] = -10.; + ph.fParticleHistogramsBins[edcaZ][2] = 10.; ph.fParticleHistogramsBins[ePDG][0] = 2000; ph.fParticleHistogramsBins[ePDG][1] = -1000.; @@ -1140,12 +1176,8 @@ void DefaultCuts() // *) from enum eEventHistograms: ec.fUseEventCuts[eNumberOfEvents] = Alright(lUseEventCuts[eNumberOfEvents]); // total number of events (before event cuts) ec.fUseEventCuts[eTotalMultiplicity] = Alright(lUseEventCuts[eTotalMultiplicity]); - ec.fUseEventCuts[eSelectedTracks] = Alright(lUseEventCuts[eSelectedTracks]); - ec.fUseEventCuts[eMultFV0M] = Alright(lUseEventCuts[eMultFV0M]); - ec.fUseEventCuts[eMultFT0M] = Alright(lUseEventCuts[eMultFT0M]); - ec.fUseEventCuts[eMultTPC] = Alright(lUseEventCuts[eMultTPC]); - ec.fUseEventCuts[eMultNTracksPV] = Alright(lUseEventCuts[eMultNTracksPV]); - ec.fUseEventCuts[eMultTracklets] = Alright(lUseEventCuts[eMultTracklets]); + ec.fUseEventCuts[eMultiplicity] = Alright(lUseEventCuts[eMultiplicity]); + ec.fUseEventCuts[eReferenceMultiplicity] = Alright(lUseEventCuts[eReferenceMultiplicity]); ec.fUseEventCuts[eCentrality] = Alright(lUseEventCuts[eCentrality]); ec.fUseEventCuts[eVertex_x] = Alright(lUseEventCuts[eVertex_x]); ec.fUseEventCuts[eVertex_y] = Alright(lUseEventCuts[eVertex_y]); @@ -1153,11 +1185,15 @@ void DefaultCuts() ec.fUseEventCuts[eNContributors] = Alright(lUseEventCuts[eNContributors]); ec.fUseEventCuts[eImpactParameter] = Alright(lUseEventCuts[eImpactParameter]); ec.fUseEventCuts[eOccupancy] = Alright(lUseEventCuts[eOccupancy]); + ec.fUseEventCuts[eMultMCNParticlesEta08] = Alright(lUseEventCuts[eMultMCNParticlesEta08]); + // *) from enum eEventCuts: ec.fUseEventCuts[eTrigger] = Alright(lUseEventCuts[eTrigger]); ec.fUseEventCuts[eSel7] = Alright(lUseEventCuts[eSel7]); ec.fUseEventCuts[eSel8] = Alright(lUseEventCuts[eSel8]); + ec.fUseEventCuts[eMultiplicityEstimator] = Alright(lUseEventCuts[eMultiplicityEstimator]); ec.fUseEventCuts[eCentralityEstimator] = Alright(lUseEventCuts[eCentralityEstimator]); + ec.fUseEventCuts[eReferenceMultiplicityEstimator] = Alright(lUseEventCuts[eReferenceMultiplicityEstimator]); ec.fUseEventCuts[eSelectedEvents] = Alright(lUseEventCuts[eSelectedEvents]); // selected number of events (after all event cuts) ec.fUseEventCuts[eNoSameBunchPileup] = Alright(lUseEventCuts[eNoSameBunchPileup]); ec.fUseEventCuts[eIsGoodZvtxFT0vsPV] = Alright(lUseEventCuts[eIsGoodZvtxFT0vsPV]); @@ -1184,29 +1220,13 @@ void DefaultCuts() ec.fdEventCuts[eTotalMultiplicity][eMin] = lTotalMultiplicity[eMin]; ec.fdEventCuts[eTotalMultiplicity][eMax] = lTotalMultiplicity[eMax]; - auto lSelectedTracks = (vector)cf_ec.cfSelectedTracks; - ec.fdEventCuts[eSelectedTracks][eMin] = lSelectedTracks[eMin]; - ec.fdEventCuts[eSelectedTracks][eMax] = lSelectedTracks[eMax]; - - auto lMultFV0M = (vector)cf_ec.cfMultFV0M; - ec.fdEventCuts[eMultFV0M][eMin] = lMultFV0M[eMin]; - ec.fdEventCuts[eMultFV0M][eMax] = lMultFV0M[eMax]; + auto lMultiplicity = (vector)cf_ec.cfMultiplicity; + ec.fdEventCuts[eMultiplicity][eMin] = lMultiplicity[eMin]; + ec.fdEventCuts[eMultiplicity][eMax] = lMultiplicity[eMax]; - auto lMultFT0M = (vector)cf_ec.cfMultFT0M; - ec.fdEventCuts[eMultFT0M][eMin] = lMultFT0M[eMin]; - ec.fdEventCuts[eMultFT0M][eMax] = lMultFT0M[eMax]; - - auto lMultTPC = (vector)cf_ec.cfMultTPC; - ec.fdEventCuts[eMultTPC][eMin] = lMultTPC[eMin]; - ec.fdEventCuts[eMultTPC][eMax] = lMultTPC[eMax]; - - auto lMultNTracksPV = (vector)cf_ec.cfMultNTracksPV; - ec.fdEventCuts[eMultNTracksPV][eMin] = lMultNTracksPV[eMin]; - ec.fdEventCuts[eMultNTracksPV][eMax] = lMultNTracksPV[eMax]; - - auto lMultTracklets = (vector)cf_ec.cfMultTracklets; - ec.fdEventCuts[eMultTracklets][eMin] = lMultTracklets[eMin]; - ec.fdEventCuts[eMultTracklets][eMax] = lMultTracklets[eMax]; + auto lReferenceMultiplicity = (vector)cf_ec.cfReferenceMultiplicity; + ec.fdEventCuts[eReferenceMultiplicity][eMin] = lReferenceMultiplicity[eMin]; + ec.fdEventCuts[eReferenceMultiplicity][eMax] = lReferenceMultiplicity[eMax]; auto lCentrality = (vector)cf_ec.cfCentrality; ec.fdEventCuts[eCentrality][eMin] = lCentrality[eMin]; @@ -1236,11 +1256,17 @@ void DefaultCuts() ec.fdEventCuts[eOccupancy][eMin] = lOccupancy[eMin]; ec.fdEventCuts[eOccupancy][eMax] = lOccupancy[eMax]; + auto lMultMCNParticlesEta08 = (vector)cf_ec.cfMultMCNParticlesEta08; + ec.fdEventCuts[eMultMCNParticlesEta08][eMin] = lMultMCNParticlesEta08[eMin]; + ec.fdEventCuts[eMultMCNParticlesEta08][eMax] = lMultMCNParticlesEta08[eMax]; + auto lSelectedEvents = (vector)cf_ec.cfSelectedEvents; ec.fdEventCuts[eSelectedEvents][eMin] = lSelectedEvents[eMin]; ec.fdEventCuts[eSelectedEvents][eMax] = lSelectedEvents[eMax]; // **) event cuts defined via string: + ec.fsEventCuts[eMultiplicityEstimator] = cf_ec.cfMultiplicityEstimator; + ec.fsEventCuts[eReferenceMultiplicityEstimator] = cf_ec.cfReferenceMultiplicityEstimator; ec.fsEventCuts[eCentralityEstimator] = cf_ec.cfCentralityEstimator; ec.fsEventCuts[eTrigger] = cf_ec.cfTrigger; ec.fsEventCuts[eOccupancyEstimator] = cf_ec.cfOccupancyEstimator; @@ -1376,6 +1402,53 @@ void DefaultCuts() //============================================================ +void SpecificCuts(TString whichSpecificCuts) +{ + // After default cuts are applied, on top of them apply analysis-specific cuts. Has to be called after DefaultBinning() and DefaultCuts(). + // Typically, analysis-specific cuts are determined through period tag, see below the case statement. + // Both event and particle cuts are hardwired here. + // For the time being, all specific cuts are defaulted and tuned for the latest reconstruction pass. + + // a) Mapping; + // b) Implementation of analysis-specific cuts. + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // a) Mapping: + // I need this mapping, for the switch statement below. TBI 20241120 I could introduce a utility function for this as well... + eSpecificCuts specificCuts = eSpecificCuts_N; + if (whichSpecificCuts.EqualTo("LHC23zzh")) { + specificCuts = eLHC23zzh; + } else if (whichSpecificCuts.EqualTo("...")) { + // ... + } else { + LOGF(fatal, "\033[1;31m%s at line %d : whichSpecificCuts = %s is not supported \033[0m", __FUNCTION__, __LINE__, whichSpecificCuts.Data()); + } + + // b) Implementation of analysis-specific cuts: + // Remark: Whichever cuts start to repeat below, promote and implement into DefaultCuts(). + switch (specificCuts) { + case eLHC23zzh: + ec.fUseEventCuts[eSel8] = kTRUE; + break; + + // ... + + default: + LOGF(fatal, "\033[1;31m%s at line %d : specificCuts = %d is not supported yet \033[0m", __FUNCTION__, __LINE__, static_cast(specificCuts)); + break; + } // switch((specificCuts)) + + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // void SpecificCuts(const char* specificCutsName) + +//============================================================ + void InsanityChecksBeforeBooking() { // Do insanity checks on configuration, binning and cuts. Values to be checked are either hardwired locally, or obtained from configurables. @@ -1493,6 +1566,15 @@ void InsanityChecksBeforeBooking() } } + // **) Supported reference multiplicity estimators for Run 1 and 2 are enlisted here: + if (tc.fProcess[eProcessRec_Run2] || tc.fProcess[eProcessRecSim_Run2] || tc.fProcess[eProcessRec_Run1] || tc.fProcess[eProcessRecSim_Run1]) { + if (!(ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("MultTracklets", TString::kIgnoreCase))) { + LOGF(fatal, "\033[1;31m%s at line %d : reference multiplicity estimator = %s is not supported yet for Run 1 and 2 analysis.\nUse \"MultTracklets\"\033[0m", __FUNCTION__, __LINE__, ec.fsEventCuts[eReferenceMultiplicityEstimator].Data()); + } + } else if (tc.fProcess[eProcessSim_Run2] || tc.fProcess[eProcessSim_Run1]) { + LOGF(fatal, "\033[1;31m%s at line %d : eProcessSim is not validated yet \033[0m", __FUNCTION__, __LINE__); + } + // **) Supported centrality estimators for Run 1 and 2 are enlisted here: if (tc.fProcess[eProcessRec_Run2] || tc.fProcess[eProcessRecSim_Run2] || tc.fProcess[eProcessSim_Run2] || tc.fProcess[eProcessRec_Run1] || tc.fProcess[eProcessRecSim_Run1] || tc.fProcess[eProcessSim_Run1]) { if (!(ec.fsEventCuts[eCentralityEstimator].EqualTo("centRun2V0M") || @@ -1551,14 +1633,29 @@ void InsanityChecksBeforeBooking() } } + // **) Supported reference multiplicity estimators for Run 3 are enlisted here: + if (tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim]) { + if (!(ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("MultTPC", TString::kIgnoreCase) || + ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("MultFV0M", TString::kIgnoreCase) || + ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("MultFT0C", TString::kIgnoreCase) || + ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("MultFT0M", TString::kIgnoreCase) || + ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("MultNTracksPV", TString::kIgnoreCase))) { + LOGF(fatal, "\033[1;31m%s at line %d : reference multiplicity estimator = %s is not supported yet for Run 3 analysis.\nUse \"MultTPC\", \"MultFV0M\", \"MultFT0C\", \"MultFT0M\" or \"MultNTracksPV\"\033[0m", __FUNCTION__, __LINE__, ec.fsEventCuts[eReferenceMultiplicityEstimator].Data()); + } + } else if (tc.fProcess[eProcessSim]) { + LOGF(fatal, "\033[1;31m%s at line %d : eProcessSim is not validated yet \033[0m", __FUNCTION__, __LINE__); + } + // **) Supported centrality estimators for Run 3 are enlisted here: - if (tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim] || tc.fProcess[eProcessSim]) { + if (tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim]) { if (!(ec.fsEventCuts[eCentralityEstimator].EqualTo("centFT0C", TString::kIgnoreCase) || ec.fsEventCuts[eCentralityEstimator].EqualTo("centFT0M", TString::kIgnoreCase) || ec.fsEventCuts[eCentralityEstimator].EqualTo("centFV0A", TString::kIgnoreCase) || ec.fsEventCuts[eCentralityEstimator].EqualTo("centNTPV", TString::kIgnoreCase))) { LOGF(fatal, "\033[1;31m%s at line %d : centrality estimator = %s is not supported yet for Run 3 analysis.\nUse \"centFT0C\", \"centFT0M\", \"centFV0A\", or \"centNTPV\"\033[0m", __FUNCTION__, __LINE__, ec.fsEventCuts[eCentralityEstimator].Data()); } + } else if (tc.fProcess[eProcessSim]) { + LOGF(fatal, "\033[1;31m%s at line %d : eProcessSim is not validated yet \033[0m", __FUNCTION__, __LINE__); } // **) Supported occupancy estimators for Run 3 are enlisted here: @@ -1585,6 +1682,9 @@ void InsanityChecksBeforeBooking() // ... // e) Insanity checks on events cuts: + if (ec.fsEventCuts[eMultiplicityEstimator].EqualTo("ReferenceMultiplicity", TString::kIgnoreCase) && ec.fUseEventCuts[eMultiplicity]) { + LOGF(fatal, "\033[1;31m%s at line %d : use ec.fUseEventCuts[eMultiplicity] only when eMultiplicityEstimator = SelectedTracks. Otherwise, things can happen... \033[0m", __FUNCTION__, __LINE__); + } // ... // f) Insanity checks on Toy NUA: @@ -1610,6 +1710,10 @@ void InsanityChecksBeforeBooking() LOGF(fatal, "\033[1;31m%s at line %d : rescaling with theoretical input is not supported when cross-check is done with nested loops. \033[0m", __FUNCTION__, __LINE__); } + if (ec.fsEventCuts[eMultiplicityEstimator].EqualTo("ReferenceMultiplicity", TString::kIgnoreCase)) { + LOGF(fatal, "\033[1;31m%s at line %d : in IV eMultiplicityEstimator cannot be set to \"ReferenceMultiplicity\" (yet) \033[0m", __FUNCTION__, __LINE__); + } + } // if (iv.fUseInternalValidation) { // h) Insanity checks on results histograms: @@ -1857,10 +1961,12 @@ void BookQAHistograms() [1450742:multiparticle-correlations-a-b]: *** Program crashed (Aborted) [1450742:multiparticle-correlations-a-b]: Backtrace by DPL: */ - LOGF(info, "\033[1;33m%s: !!!! WARNING !!!! With too many 2D histograms with double precision, the code will crash in terminate (\"... shmem: could not create a message of size ...\") . Locally, you can circumvent this while testing by calling Bailout() explicitly. !!!! WARNING !!!! \033[0m", __FUNCTION__); + if (tc.fVerbose) { + LOGF(info, "\033[1;33m%s: !!!! WARNING !!!! With too many 2D histograms with double precision, the code will crash in terminate (\"... shmem: could not create a message of size ...\") . Locally, you can circumvent this while testing by calling Bailout() explicitly. !!!! WARNING !!!! \033[0m", __FUNCTION__); + } // a) Book the profile holding flags: - qa.fQAHistogramsPro = new TProfile("fQAHistogramsPro", "flags for QA histograms", 3, 0., 3.); + qa.fQAHistogramsPro = new TProfile("fQAHistogramsPro", "flags for QA histograms", 4, 0., 4.); qa.fQAHistogramsPro->SetStats(kFALSE); qa.fQAHistogramsPro->SetLineColor(eColor); qa.fQAHistogramsPro->SetFillColor(eFillColor); @@ -1870,6 +1976,8 @@ void BookQAHistograms() qa.fQAHistogramsPro->Fill(1.5, static_cast(qa.fFillQAEventHistograms2D)); qa.fQAHistogramsPro->GetXaxis()->SetBinLabel(3, "fFillQAParticleHistograms2D"); qa.fQAHistogramsPro->Fill(2.5, static_cast(qa.fFillQAParticleHistograms2D)); + qa.fQAHistogramsPro->GetXaxis()->SetBinLabel(4, "fRebin"); + qa.fQAHistogramsPro->Fill(3.5, static_cast(qa.fRebin)); // ... @@ -1892,45 +2000,155 @@ void BookQAHistograms() Double_t max_y_Event[eQAEventHistograms2D_N] = {0.}; TString title_y_Event[eQAEventHistograms2D_N] = {""}; - // *) "MultTPC_vs_NContributors": - nBins_x_Event[eMultTPC_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eMultTPC][0]); // TBI 20240702 add support for rebinning - min_x_Event[eMultTPC_vs_NContributors] = eh.fEventHistogramsBins[eMultTPC][1]; - max_x_Event[eMultTPC_vs_NContributors] = eh.fEventHistogramsBins[eMultTPC][2]; - title_x_Event[eMultTPC_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eMultTPC].Data()); - nBins_y_Event[eMultTPC_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); // TBI 20240702 add support for rebinning - min_y_Event[eMultTPC_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][1]; - max_y_Event[eMultTPC_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][2]; - title_y_Event[eMultTPC_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); - - // *) "MultTPC_vs_Centrality": - nBins_x_Event[eMultTPC_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eMultTPC][0]); // TBI 20240702 add support for rebinning - min_x_Event[eMultTPC_vs_Centrality] = eh.fEventHistogramsBins[eMultTPC][1]; - max_x_Event[eMultTPC_vs_Centrality] = eh.fEventHistogramsBins[eMultTPC][2]; - title_x_Event[eMultTPC_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eMultTPC].Data()); - nBins_y_Event[eMultTPC_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); // TBI 20240702 add support for rebinning - min_y_Event[eMultTPC_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][1]; - max_y_Event[eMultTPC_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][2]; - title_y_Event[eMultTPC_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); - - // *) "Vertex_z_vs_MultTPC": - nBins_x_Event[eVertex_z_vs_MultTPC] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); // TBI 20240702 add support for rebinning - min_x_Event[eVertex_z_vs_MultTPC] = eh.fEventHistogramsBins[eVertex_z][1]; - max_x_Event[eVertex_z_vs_MultTPC] = eh.fEventHistogramsBins[eVertex_z][2]; - title_x_Event[eVertex_z_vs_MultTPC] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); - nBins_y_Event[eVertex_z_vs_MultTPC] = static_cast(eh.fEventHistogramsBins[eMultTPC][0]); // TBI 20240702 add support for rebinning - min_y_Event[eVertex_z_vs_MultTPC] = eh.fEventHistogramsBins[eMultTPC][1]; - max_y_Event[eVertex_z_vs_MultTPC] = eh.fEventHistogramsBins[eMultTPC][2]; - title_y_Event[eVertex_z_vs_MultTPC] = FancyFormatting(eh.fEventHistogramsName[eMultTPC].Data()); - - // *) "Vertex_z_vs_NContributors": - nBins_x_Event[eVertex_z_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); // TBI 20240702 add support for rebinning - min_x_Event[eVertex_z_vs_NContributors] = eh.fEventHistogramsBins[eVertex_z][1]; - max_x_Event[eVertex_z_vs_NContributors] = eh.fEventHistogramsBins[eVertex_z][2]; - title_x_Event[eVertex_z_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); - nBins_y_Event[eVertex_z_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); // TBI 20240702 add support for rebinning - min_y_Event[eVertex_z_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][1]; - max_y_Event[eVertex_z_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][2]; - title_y_Event[eVertex_z_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); + // *) "Multiplicity_vs_ReferenceMultiplicity": + nBins_x_Event[eMultiplicity_vs_ReferenceMultiplicity] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0]); // TBI 20240702 add support for rebinning + min_x_Event[eMultiplicity_vs_ReferenceMultiplicity] = eh.fEventHistogramsBins[eMultiplicity][1]; + max_x_Event[eMultiplicity_vs_ReferenceMultiplicity] = eh.fEventHistogramsBins[eMultiplicity][2]; + title_x_Event[eMultiplicity_vs_ReferenceMultiplicity] = FancyFormatting(eh.fEventHistogramsName[eMultiplicity].Data()); + nBins_y_Event[eMultiplicity_vs_ReferenceMultiplicity] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0]); // TBI 20240702 add support for rebinning + min_y_Event[eMultiplicity_vs_ReferenceMultiplicity] = eh.fEventHistogramsBins[eReferenceMultiplicity][1]; + max_y_Event[eMultiplicity_vs_ReferenceMultiplicity] = eh.fEventHistogramsBins[eReferenceMultiplicity][2]; + title_y_Event[eMultiplicity_vs_ReferenceMultiplicity] = FancyFormatting(eh.fEventHistogramsName[eReferenceMultiplicity].Data()); + + // *) "Multiplicity_vs_NContributors": + nBins_x_Event[eMultiplicity_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0]); // TBI 20240702 add support for rebinning + min_x_Event[eMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eMultiplicity][1]; + max_x_Event[eMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eMultiplicity][2]; + title_x_Event[eMultiplicity_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eMultiplicity].Data()); + nBins_y_Event[eMultiplicity_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); // TBI 20240702 add support for rebinning + min_y_Event[eMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][1]; + max_y_Event[eMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][2]; + title_y_Event[eMultiplicity_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); + + // *) "Multiplicity_vs_Centrality": + nBins_x_Event[eMultiplicity_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0]); // TBI 20240702 add support for rebinning + min_x_Event[eMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eMultiplicity][1]; + max_x_Event[eMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eMultiplicity][2]; + title_x_Event[eMultiplicity_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eMultiplicity].Data()); + nBins_y_Event[eMultiplicity_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); // TBI 20240702 add support for rebinning + min_y_Event[eMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][1]; + max_y_Event[eMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][2]; + title_y_Event[eMultiplicity_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); + + // *) "Multiplicity_vs_Vertex_z": + nBins_x_Event[eMultiplicity_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0]); // TBI 20240702 add support for rebinning + min_x_Event[eMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eMultiplicity][1]; + max_x_Event[eMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eMultiplicity][2]; + title_x_Event[eMultiplicity_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eMultiplicity].Data()); + nBins_y_Event[eMultiplicity_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); // TBI 20240702 add support for rebinning + min_y_Event[eMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][1]; + max_y_Event[eMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][2]; + title_y_Event[eMultiplicity_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); + + // *) "Multiplicity_vs_Occupancy": + nBins_x_Event[eMultiplicity_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0]); // TBI 20240702 add support for rebinning + min_x_Event[eMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eMultiplicity][1]; + max_x_Event[eMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eMultiplicity][2]; + title_x_Event[eMultiplicity_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eMultiplicity].Data()); + nBins_y_Event[eMultiplicity_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); // TBI 20240702 add support for rebinning + min_y_Event[eMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][1]; + max_y_Event[eMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][2]; + title_y_Event[eMultiplicity_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eOccupancy].Data()); + + // *) "ReferenceMultiplicity_vs_NContributors": + nBins_x_Event[eReferenceMultiplicity_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0]); // TBI 20240702 add support for rebinning + min_x_Event[eReferenceMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eReferenceMultiplicity][1]; + max_x_Event[eReferenceMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eReferenceMultiplicity][2]; + title_x_Event[eReferenceMultiplicity_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eReferenceMultiplicity].Data()); + nBins_y_Event[eReferenceMultiplicity_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); // TBI 20240702 add support for rebinning + min_y_Event[eReferenceMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][1]; + max_y_Event[eReferenceMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][2]; + title_y_Event[eReferenceMultiplicity_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); + + // *) "ReferenceMultiplicity_vs_Centrality": + nBins_x_Event[eReferenceMultiplicity_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0]); // TBI 20240702 add support for rebinning + min_x_Event[eReferenceMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eReferenceMultiplicity][1]; + max_x_Event[eReferenceMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eReferenceMultiplicity][2]; + title_x_Event[eReferenceMultiplicity_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eReferenceMultiplicity].Data()); + nBins_y_Event[eReferenceMultiplicity_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); // TBI 20240702 add support for rebinning + min_y_Event[eReferenceMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][1]; + max_y_Event[eReferenceMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][2]; + title_y_Event[eReferenceMultiplicity_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); + + // *) "ReferenceMultiplicity_vs_Vertex_z": + nBins_x_Event[eReferenceMultiplicity_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0]); // TBI 20240702 add support for rebinning + min_x_Event[eReferenceMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eReferenceMultiplicity][1]; + max_x_Event[eReferenceMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eReferenceMultiplicity][2]; + title_x_Event[eReferenceMultiplicity_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eReferenceMultiplicity].Data()); + nBins_y_Event[eReferenceMultiplicity_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); // TBI 20240702 add support for rebinning + min_y_Event[eReferenceMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][1]; + max_y_Event[eReferenceMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][2]; + title_y_Event[eReferenceMultiplicity_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); + + // *) "ReferenceMultiplicity_vs_Occupancy": + nBins_x_Event[eReferenceMultiplicity_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0]); // TBI 20240702 add support for rebinning + min_x_Event[eReferenceMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eReferenceMultiplicity][1]; + max_x_Event[eReferenceMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eReferenceMultiplicity][2]; + title_x_Event[eReferenceMultiplicity_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eReferenceMultiplicity].Data()); + nBins_y_Event[eReferenceMultiplicity_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); // TBI 20240702 add support for rebinning + min_y_Event[eReferenceMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][1]; + max_y_Event[eReferenceMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][2]; + title_y_Event[eReferenceMultiplicity_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eOccupancy].Data()); + + // *) "NContributors_vs_Centrality": + nBins_x_Event[eNContributors_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); // TBI 20240702 add support for rebinning + min_x_Event[eNContributors_vs_Centrality] = eh.fEventHistogramsBins[eNContributors][1]; + max_x_Event[eNContributors_vs_Centrality] = eh.fEventHistogramsBins[eNContributors][2]; + title_x_Event[eNContributors_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); + nBins_y_Event[eNContributors_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); // TBI 20240702 add support for rebinning + min_y_Event[eNContributors_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][1]; + max_y_Event[eNContributors_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][2]; + title_y_Event[eNContributors_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); + + // *) "NContributors_vs_Vertex_z": + nBins_x_Event[eNContributors_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); // TBI 20240702 add support for rebinning + min_x_Event[eNContributors_vs_Vertex_z] = eh.fEventHistogramsBins[eNContributors][1]; + max_x_Event[eNContributors_vs_Vertex_z] = eh.fEventHistogramsBins[eNContributors][2]; + title_x_Event[eNContributors_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); + nBins_y_Event[eNContributors_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); // TBI 20240702 add support for rebinning + min_y_Event[eNContributors_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][1]; + max_y_Event[eNContributors_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][2]; + title_y_Event[eNContributors_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); + + // *) "NContributors_vs_Occupancy": + nBins_x_Event[eNContributors_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); // TBI 20240702 add support for rebinning + min_x_Event[eNContributors_vs_Occupancy] = eh.fEventHistogramsBins[eNContributors][1]; + max_x_Event[eNContributors_vs_Occupancy] = eh.fEventHistogramsBins[eNContributors][2]; + title_x_Event[eNContributors_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); + nBins_y_Event[eNContributors_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); // TBI 20240702 add support for rebinning + min_y_Event[eNContributors_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][1]; + max_y_Event[eNContributors_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][2]; + title_y_Event[eNContributors_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eOccupancy].Data()); + + // *) "Centrality_vs_Vertex_z": + nBins_x_Event[eCentrality_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); // TBI 20240702 add support for rebinning + min_x_Event[eCentrality_vs_Vertex_z] = eh.fEventHistogramsBins[eCentrality][1]; + max_x_Event[eCentrality_vs_Vertex_z] = eh.fEventHistogramsBins[eCentrality][2]; + title_x_Event[eCentrality_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); + nBins_y_Event[eCentrality_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); // TBI 20240702 add support for rebinning + min_y_Event[eCentrality_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][1]; + max_y_Event[eCentrality_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][2]; + title_y_Event[eCentrality_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); + + // *) "Centrality_vs_Occupancy": + nBins_x_Event[eCentrality_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); // TBI 20240702 add support for rebinning + min_x_Event[eCentrality_vs_Occupancy] = eh.fEventHistogramsBins[eCentrality][1]; + max_x_Event[eCentrality_vs_Occupancy] = eh.fEventHistogramsBins[eCentrality][2]; + title_x_Event[eCentrality_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); + nBins_y_Event[eCentrality_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); // TBI 20240702 add support for rebinning + min_y_Event[eCentrality_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][1]; + max_y_Event[eCentrality_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][2]; + title_y_Event[eCentrality_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eOccupancy].Data()); + + // *) "Vertex_z_vs_Occupancy": + nBins_x_Event[eVertex_z_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); // TBI 20240702 add support for rebinning + min_x_Event[eVertex_z_vs_Occupancy] = eh.fEventHistogramsBins[eVertex_z][1]; + max_x_Event[eVertex_z_vs_Occupancy] = eh.fEventHistogramsBins[eVertex_z][2]; + title_x_Event[eVertex_z_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); + nBins_y_Event[eVertex_z_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); // TBI 20240702 add support for rebinning + min_y_Event[eVertex_z_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][1]; + max_y_Event[eVertex_z_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][2]; + title_y_Event[eVertex_z_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eOccupancy].Data()); // *) "eCentFT0C_vs_CentNTPV": nBins_x_Event[eCentFT0C_vs_CentNTPV] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); @@ -1962,16 +2180,6 @@ void BookQAHistograms() max_y_Event[eCentRun2V0M_vs_CentRun2SPDTracklets] = eh.fEventHistogramsBins[eCentrality][2]; title_y_Event[eCentRun2V0M_vs_CentRun2SPDTracklets] = FancyFormatting(qa.fCentralityEstimatorName[eCentRun2SPDTracklets].Data()); - // *) "eCentRun2V0M_vs_NContributors": - nBins_x_Event[eCentRun2V0M_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); - min_x_Event[eCentRun2V0M_vs_NContributors] = eh.fEventHistogramsBins[eCentrality][1]; - max_x_Event[eCentRun2V0M_vs_NContributors] = eh.fEventHistogramsBins[eCentrality][2]; - title_x_Event[eCentRun2V0M_vs_NContributors] = FancyFormatting(qa.fCentralityEstimatorName[eCentRun2V0M].Data()); - nBins_y_Event[eCentRun2V0M_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); - min_y_Event[eCentRun2V0M_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][1]; - max_y_Event[eCentRun2V0M_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][2]; - title_y_Event[eCentRun2V0M_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); - // *) "eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange": nBins_x_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); min_x_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = eh.fEventHistogramsBins[eOccupancy][1]; @@ -1979,39 +2187,9 @@ void BookQAHistograms() title_x_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = FancyFormatting(qa.fOccupancyEstimatorName[eTrackOccupancyInTimeRange].Data()); nBins_y_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); min_y_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = eh.fEventHistogramsBins[eOccupancy][1]; - max_y_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = eh.fEventHistogramsBins[eOccupancy][2] * 10; // TBI 20241112 I extend here manually this axis temporarily + max_y_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = eh.fEventHistogramsBins[eOccupancy][2]; title_y_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = FancyFormatting(qa.fOccupancyEstimatorName[eFT0COccupancyInTimeRange].Data()); - // *) "eTrackOccupancyInTimeRange_vs_MultTPC": - nBins_x_Event[eTrackOccupancyInTimeRange_vs_MultTPC] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); - min_x_Event[eTrackOccupancyInTimeRange_vs_MultTPC] = eh.fEventHistogramsBins[eOccupancy][1]; - max_x_Event[eTrackOccupancyInTimeRange_vs_MultTPC] = eh.fEventHistogramsBins[eOccupancy][2]; - title_x_Event[eTrackOccupancyInTimeRange_vs_MultTPC] = FancyFormatting(qa.fOccupancyEstimatorName[eTrackOccupancyInTimeRange].Data()); - nBins_y_Event[eTrackOccupancyInTimeRange_vs_MultTPC] = static_cast(eh.fEventHistogramsBins[eMultTPC][0]); - min_y_Event[eTrackOccupancyInTimeRange_vs_MultTPC] = eh.fEventHistogramsBins[eMultTPC][1]; - max_y_Event[eTrackOccupancyInTimeRange_vs_MultTPC] = eh.fEventHistogramsBins[eMultTPC][2]; - title_y_Event[eTrackOccupancyInTimeRange_vs_MultTPC] = FancyFormatting(eh.fEventHistogramsName[eMultTPC].Data()); - - // *) "eTrackOccupancyInTimeRange_vs_Vertex_z": - nBins_x_Event[eTrackOccupancyInTimeRange_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); - min_x_Event[eTrackOccupancyInTimeRange_vs_Vertex_z] = eh.fEventHistogramsBins[eOccupancy][1]; - max_x_Event[eTrackOccupancyInTimeRange_vs_Vertex_z] = eh.fEventHistogramsBins[eOccupancy][2]; - title_x_Event[eTrackOccupancyInTimeRange_vs_Vertex_z] = FancyFormatting(qa.fOccupancyEstimatorName[eTrackOccupancyInTimeRange].Data()); - nBins_y_Event[eTrackOccupancyInTimeRange_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); - min_y_Event[eTrackOccupancyInTimeRange_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][1]; - max_y_Event[eTrackOccupancyInTimeRange_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][2]; - title_y_Event[eTrackOccupancyInTimeRange_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); - - // *) "eTrackOccupancyInTimeRange_vs_Centrality": - nBins_x_Event[eTrackOccupancyInTimeRange_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); - min_x_Event[eTrackOccupancyInTimeRange_vs_Centrality] = eh.fEventHistogramsBins[eOccupancy][1]; - max_x_Event[eTrackOccupancyInTimeRange_vs_Centrality] = eh.fEventHistogramsBins[eOccupancy][2]; - title_x_Event[eTrackOccupancyInTimeRange_vs_Centrality] = FancyFormatting(qa.fOccupancyEstimatorName[eTrackOccupancyInTimeRange].Data()); - nBins_y_Event[eTrackOccupancyInTimeRange_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); - min_y_Event[eTrackOccupancyInTimeRange_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][1]; - max_y_Event[eTrackOccupancyInTimeRange_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][2]; - title_y_Event[eTrackOccupancyInTimeRange_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); - // ... // *) Quick insanity check on title_x_Event and title_y_Event: @@ -2050,6 +2228,17 @@ void BookQAHistograms() for (Int_t ba = 0; ba < 2; ba++) // before/after cuts { + + // Special treatment for eMultiplicity => I will never fill this one before the cuts, if Multiplicity = SelectedTracks, obviously: + if (ba == eBefore && (title_x_Event[t].BeginsWith("Multiplicity") || title_y_Event[t].BeginsWith("Multiplicity")) && ec.fsEventCuts[eMultiplicityEstimator].EqualTo("SelectedTracks", TString::kIgnoreCase)) { + // TBI 20241123 what remains ill-defined is the case when Multiplicity != SelectedTracks , check that further + // TBI 20241123 not sure if checking with BeginsWith(...) x2 is robust enough + // TBI 20241123 just like I have Skip(rs), introduce the same thingie for "ba" counter + propagate to other member functions + // TBI 20241124 there is a corner case when eMultiplicityEstimator itself is "ReferenceMultiplicity" => all 2D QA booked both before and after cuts, + // but it's filled trivially before the cuts, because Multiplicity is always 0. Re-think this at some point. + continue; + } + qa.fQAEventHistograms2D[t][rs][ba] = new TH2F( Form("fQAEventHistograms2D[%s][%s][%s]", qa.fEventHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in DetermineAndPropagateRunNumber(T const& collision) @@ -2180,8 +2369,9 @@ void BookEventHistograms() for (Int_t ba = 0; ba < 2; ba++) // before/after cuts { - // Special treatment for eSelectedTracks => I will never fill this one before the cuts, obviously: - if (ba == eBefore && eh.fEventHistogramsName[t].EqualTo("SelectedTracks")) { + // Special treatment for eMultiplicity => I will never fill this one before the cuts, if Multiplicity = SelectedTracks, obviously: + if (ba == eBefore && eh.fEventHistogramsName[t].EqualTo("Multiplicity") && ec.fsEventCuts[eMultiplicityEstimator].EqualTo("SelectedTracks", TString::kIgnoreCase)) { + // TBI 20241123 what remains ill-defined is the case when Multiplicity != SelectedTracks , check that further continue; } eh.fEventHistograms[t][rs][ba] = new TH1F( @@ -2610,7 +2800,7 @@ void BookCorrelationsHistograms() mupa.fCorrelationsPro[k][n][v] = reinterpret_cast(res.fResultsPro[v]->Clone(Form("fCorrelationsPro[%d][%d][%s]", k, n, res.fResultsProRawName[v].Data()))); // yes mupa.fCorrelationsPro[k][n][v]->SetStats(kFALSE); mupa.fCorrelationsPro[k][n][v]->Sumw2(); - mupa.fCorrelationsPro[k][n][v]->GetXaxis()->SetTitle(res.fResultsProXaxisTitle[v].Data()); + mupa.fCorrelationsPro[k][n][v]->GetXaxis()->SetTitle(FancyFormatting(res.fResultsProXaxisTitle[v].Data())); mupa.fCorrelationsPro[k][n][v]->GetYaxis()->SetTitle(Form("#LT#LTcos[%s(%s)]#GT#GT", 1 == n + 1 ? "" : Form("%d", n + 1), oVariable[k].Data())); mupa.fCorrelationsList->Add(mupa.fCorrelationsPro[k][n][v]); } @@ -2690,7 +2880,7 @@ void BookWeightsHistograms() void BookCentralityWeightsHistograms() { - // Book all objects for particle centrality weights. + // Book all objects for centrality weights. // a) Book the profile holding flags; // b) Histograms for centrality weights. @@ -2721,7 +2911,7 @@ void BookCentralityWeightsHistograms() ExitFunction(__FUNCTION__); } -} // void BookWeightsHistograms() +} // void BookCentralityWeightsHistograms() //============================================================ @@ -3319,17 +3509,20 @@ void InternalValidation() // *) Counter of selected tracks in the current event: // Remark: This has to go after FillNestedLoopsContainers(...), because ebye.fSelectedTracks is used as a particle index there. ebye.fSelectedTracks++; - if (ebye.fSelectedTracks >= ec.fdEventCuts[eSelectedTracks][eMax]) { + if (ebye.fSelectedTracks >= ec.fdEventCuts[eMultiplicity][eMax]) { break; } } // for(Int_t p=0;pFill(0.5); !eh.fEventHistograms[eTotalMultiplicity][eSim][eAfter] ? true : eh.fEventHistograms[eTotalMultiplicity][eSim][eAfter]->Fill(nMult); - !eh.fEventHistograms[eSelectedTracks][eSim][eAfter] ? true : eh.fEventHistograms[eSelectedTracks][eSim][eAfter]->Fill(ebye.fSelectedTracks); + !eh.fEventHistograms[eMultiplicity][eSim][eAfter] ? true : eh.fEventHistograms[eMultiplicity][eSim][eAfter]->Fill(ebye.fMultiplicity); !eh.fEventHistograms[eCentrality][eSim][eAfter] ? true : eh.fEventHistograms[eCentrality][eSim][eAfter]->Fill(ebye.fCentrality); !eh.fEventHistograms[eOccupancy][eSim][eAfter] ? true : eh.fEventHistograms[eCentrality][eSim][eAfter]->Fill(ebye.fOccupancy); } @@ -3361,7 +3554,9 @@ void InternalValidation() } // for(Int_t e=0;e(iv.fnEventsInternalValidation);e++) // *) Print info on the current event number (total): - PrintEventCounter(eAfter); + if (tc.fVerboseEventCounter) { + PrintEventCounter(eAfter); + } // c) Delete persistent objects: if (fPhiPDF) { @@ -3495,7 +3690,7 @@ void BookTest0Histograms() t0.fTest0Pro[mo][mi][v]->SetStats(kFALSE); t0.fTest0Pro[mo][mi][v]->Sumw2(); t0.fTest0Pro[mo][mi][v]->SetTitle(t0.fTest0Labels[mo][mi]->Data()); - t0.fTest0Pro[mo][mi][v]->GetXaxis()->SetTitle(res.fResultsProXaxisTitle[v].Data()); + t0.fTest0Pro[mo][mi][v]->GetXaxis()->SetTitle(FancyFormatting(res.fResultsProXaxisTitle[v].Data())); /* if(fUseFixedNumberOfRandomlySelectedParticles && 1==v) // just a warning for the meaning of multiplicity in this special case { @@ -3856,6 +4051,8 @@ void ResetEventByEventQuantities() // a) Event-by-event quantities: ebye.fSelectedTracks = 0; + ebye.fMultiplicity = 0.; + ebye.fReferenceMultiplicity = 0.; ebye.fCentrality = 0.; ebye.fOccupancy = 0.; @@ -3936,19 +4133,19 @@ void EventCutsCounters(T1 const& collision, T2 const& tracks) ec.fEventCutCounterBinNumber[eSim] = 1; EventCuts(collision, tracks, eCutCounterBinning); // dry call, to establish the map fEventCutCounterMap and its inverse - // **) Special treatment for event cuts implemented outside of EventCuts(), like eSelectedTracks: - // Algorithm: I simply add eSelectedTracks at the end of what was esatablished by now in the above call EventCuts(collision, tracks, eCutCounterBinning) + // **) Special treatment for event cuts implemented outside of EventCuts(), like eMultiplicity: + // Algorithm: I simply add eMultiplicity at the end of what was esatablished by now in the above call EventCuts(collision, tracks, eCutCounterBinning) // unless proven it shall be done some other way. if (ec.fEventCutCounterMap[eRec]) { // TBI 20240414 also here have to hardcode 'eRec', because 'rs' spans over all enums in eRecSim => I definitely need 'generic Rec' case, perhaps via TExMap ? // But I have already tc.fProcess[eGenericRec] and tc.fProcess[eGenericRecSim], available, shall I simply re-use them? - ec.fEventCutCounterMap[eRec]->Add(ec.fEventCutCounterBinNumber[eRec], eSelectedTracks); - ec.fEventCutCounterMapInverse[eRec]->Add(eSelectedTracks, ec.fEventCutCounterBinNumber[eRec]); + ec.fEventCutCounterMap[eRec]->Add(ec.fEventCutCounterBinNumber[eRec], eMultiplicity); + ec.fEventCutCounterMapInverse[eRec]->Add(eMultiplicity, ec.fEventCutCounterBinNumber[eRec]); ec.fEventCutCounterBinNumber[eRec]++; // yes } if (ec.fEventCutCounterMap[eSim]) { // TBI 20240414 also here have to hardcode 'eSim', because 'rs' spans over all enums in eRecSim => I definitely need 'generic Rec' case, perhaps via TExMap ? // But I have already tc.fProcess[eGenericRec] and tc.fProcess[eGenericRecSim], available, shall I simply re-use them? - ec.fEventCutCounterMap[eSim]->Add(ec.fEventCutCounterBinNumber[eSim], eSelectedTracks); - ec.fEventCutCounterMapInverse[eSim]->Add(eSelectedTracks, ec.fEventCutCounterBinNumber[eSim]); + ec.fEventCutCounterMap[eSim]->Add(ec.fEventCutCounterBinNumber[eSim], eMultiplicity); + ec.fEventCutCounterMapInverse[eSim]->Add(eMultiplicity, ec.fEventCutCounterBinNumber[eSim]); ec.fEventCutCounterBinNumber[eSim]++; // yes } @@ -3988,7 +4185,7 @@ void EventCutsCounters(T1 const& collision, T2 const& tracks) EventCuts(collision, tracks, eCutCounterAbsolute); // **) Special treatments: - // a) eSelectedTracks: It doesn't make sense to treat this one in eCutCounterAbsolute + // a) eMultiplicity: It doesn't make sense to treat this one in eCutCounterAbsolute } // *) Event cut counter (sequential): @@ -3998,8 +4195,8 @@ void EventCutsCounters(T1 const& collision, T2 const& tracks) EventCuts(collision, tracks, eCutCounterSequential); // **) Special treatments: - // a) eSelectedTracks: Since cut on eSelectedTracks is implenented outside of EventCuts - // I call EventCut(rs, eSelectedTracks, eCutCounterSequential) directly where its implemented. + // a) eMultiplicity: Since cut on eMultiplicity is implenented outside of EventCuts + // I call EventCut(rs, eMultiplicity, eCutCounterSequential) directly where its implemented. // Add same treatment for other special cases, but do not forget above to expand **) Special treatment for event cuts ... } @@ -4036,6 +4233,8 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) // *) NumberOfEvents: => this event cut is implemented directly in Steer(...) + // *) SelectedEvents: => this event cut is implemented directly in Steer(...) + // *) Sel8: // see definition in Common/TableProducer/eventSelection.cxx if (ec.fUseEventCuts[eSel8]) { if (cutModus == eCutCounterBinning) { @@ -4047,75 +4246,33 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) } } - // *) NoSameBunchPileup: // see O2Physics/Common/CCDB/EventSelectionParams.cxx - if (ec.fUseEventCuts[eNoSameBunchPileup]) { - if (cutModus == eCutCounterBinning) { - EventCut(eRec, eNoSameBunchPileup, eCutCounterBinning); - } else if (!collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - if (!EventCut(eRec, eNoSameBunchPileup, cutModus)) { - return kFALSE; - } - } - } - - // *) IsGoodZvtxFT0vsPV: // see O2Physics/Common/CCDB/EventSelectionParams.cxx - if (ec.fUseEventCuts[eIsGoodZvtxFT0vsPV]) { - if (cutModus == eCutCounterBinning) { - EventCut(eRec, eIsGoodZvtxFT0vsPV, eCutCounterBinning); - } else if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - if (!EventCut(eRec, eIsGoodZvtxFT0vsPV, cutModus)) { - return kFALSE; - } - } - } - - // *) IsVertexITSTPC: // see O2Physics/Common/CCDB/EventSelectionParams.cxx - if (ec.fUseEventCuts[eIsVertexITSTPC]) { - if (cutModus == eCutCounterBinning) { - EventCut(eRec, eIsVertexITSTPC, eCutCounterBinning); - } else if (!collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { - if (!EventCut(eRec, eIsVertexITSTPC, cutModus)) { - return kFALSE; - } - } - } - - // *) IsVertexTOFmatched: // see O2Physics/Common/CCDB/EventSelectionParams.cxx - if (ec.fUseEventCuts[eIsVertexTOFmatched]) { + // *) TotalMultiplicity: + if (ec.fUseEventCuts[eTotalMultiplicity]) { if (cutModus == eCutCounterBinning) { - EventCut(eRec, eIsVertexTOFmatched, eCutCounterBinning); - } else if (!collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) { - if (!EventCut(eRec, eIsVertexTOFmatched, cutModus)) { + EventCut(eRec, eTotalMultiplicity, eCutCounterBinning); + } else if (tracks.size() < ec.fdEventCuts[eTotalMultiplicity][eMin] || tracks.size() > ec.fdEventCuts[eTotalMultiplicity][eMax] || TMath::Abs(tracks.size() - ec.fdEventCuts[eTotalMultiplicity][eMax]) < tc.fFloatingPointPrecision) { + if (!EventCut(eRec, eTotalMultiplicity, cutModus)) { return kFALSE; } } } - // *) IsVertexTRDmatched: // see O2Physics/Common/CCDB/EventSelectionParams.cxx - if (ec.fUseEventCuts[eIsVertexTRDmatched]) { - if (cutModus == eCutCounterBinning) { - EventCut(eRec, eIsVertexTRDmatched, eCutCounterBinning); - } else if (!collision.selection_bit(o2::aod::evsel::kIsVertexTRDmatched)) { - if (!EventCut(eRec, eIsVertexTRDmatched, cutModus)) { - return kFALSE; - } - } - } + // *) Multiplicity: + // Remark: This cut is implemented directly in Steer(...), because I allow the possibility that ebye.fMultiplicity = ebye.fSelectedTracks . + // In fact, that will be true in most cases of practical interest. - // *) TotalMultiplicity: - if (ec.fUseEventCuts[eTotalMultiplicity]) { + // *) Reference multiplicity: + // Remark: In this member function, reference multiplicity is just a number, and any specific setting for Run 3, 2, or 1 is already done in DetermineReferenceMultiplicity(...) + if (ec.fUseEventCuts[eReferenceMultiplicity]) { if (cutModus == eCutCounterBinning) { - EventCut(eRec, eTotalMultiplicity, eCutCounterBinning); - } else if (tracks.size() < ec.fdEventCuts[eTotalMultiplicity][eMin] || tracks.size() > ec.fdEventCuts[eTotalMultiplicity][eMax] || TMath::Abs(tracks.size() - ec.fdEventCuts[eTotalMultiplicity][eMax]) < tc.fFloatingPointPrecision) { - if (!EventCut(eRec, eTotalMultiplicity, cutModus)) { + EventCut(eRec, eReferenceMultiplicity, eCutCounterBinning); + } else if (ebye.fReferenceMultiplicity < ec.fdEventCuts[eReferenceMultiplicity][eMin] || ebye.fReferenceMultiplicity > ec.fdEventCuts[eReferenceMultiplicity][eMax] || TMath::Abs(ebye.fReferenceMultiplicity - ec.fdEventCuts[eReferenceMultiplicity][eMax]) < tc.fFloatingPointPrecision) { + if (!EventCut(eRec, eReferenceMultiplicity, cutModus)) { return kFALSE; } } } - // *) SelectedTracks: - // Remark: This cut is implemented directly in void process( ... ) TBI 20240508 check how to implement this one with the current re-write - // *) Centrality: // Remark: In this member function, centrality is just a number, and any specific setting for Run 3, 2, or 1 is already done in DetermineCentrality(...) if (ec.fUseEventCuts[eCentrality]) { @@ -4172,8 +4329,6 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) } } - // *) SelectedEvents: => this event cut is implemented directly in Steer(...) - // ... // ... and corresponding MC truth simulated: @@ -4217,8 +4372,8 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) // *) TotalMultiplicity: // TBI 20240509 check what is the Monte Carlo analogy for tracks.size() - // *) SelectedTracks: - // Remark: This cut is implemented directly in void process( ... ) TBI 20240508 check how to implement this one with the current re-write + // *) Multiplicity: + // Remark: This cut is implemented directly in Steer(...) TBI 20240508 check how to implement this one with the current re-write // *) Centrality: this is related to eImpactParameter. TBI 20240509 How do I proceed here? Shall i calculate it in void DetermineCentrality( ... ), from IP, and store it in ebye.fCentrality? @@ -4274,56 +4429,67 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) // Therefore, I need always a header Common/DataModel/Multiplicity.h and o2-analysis-multiplicity-table in the workflow // TBI 20240509 check also o2::aod::MultExtra - // *) MultFV0M: - if (ec.fUseEventCuts[eMultFV0M]) { + // *) Occupancy: + if (ec.fUseEventCuts[eOccupancy]) { if (cutModus == eCutCounterBinning) { - EventCut(eRec, eMultFV0M, eCutCounterBinning); - } else if (collision.multFV0M() < ec.fdEventCuts[eMultFV0M][eMin] || collision.multFV0M() > ec.fdEventCuts[eMultFV0M][eMax] || TMath::Abs(collision.multFV0M() - ec.fdEventCuts[eMultFV0M][eMax]) < tc.fFloatingPointPrecision) { - if (!EventCut(eRec, eVertex_z, cutModus)) { + EventCut(eRec, eOccupancy, eCutCounterBinning); + } else if (ebye.fOccupancy < ec.fdEventCuts[eOccupancy][eMin] || ebye.fOccupancy > ec.fdEventCuts[eOccupancy][eMax] || TMath::Abs(ebye.fOccupancy - ec.fdEventCuts[eOccupancy][eMax]) < tc.fFloatingPointPrecision) { + if (!EventCut(eRec, eOccupancy, cutModus)) { return kFALSE; } } } - // *) MultFT0M: - if (ec.fUseEventCuts[eMultFT0M]) { + // *) NoSameBunchPileup: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eNoSameBunchPileup]) { if (cutModus == eCutCounterBinning) { - EventCut(eRec, eMultFT0M, eCutCounterBinning); - } else if (collision.multFT0M() < ec.fdEventCuts[eMultFT0M][eMin] || collision.multFT0M() > ec.fdEventCuts[eMultFT0M][eMax] || TMath::Abs(collision.multFT0M() - ec.fdEventCuts[eMultFT0M][eMax]) < tc.fFloatingPointPrecision) { - if (!EventCut(eRec, eVertex_z, cutModus)) { + EventCut(eRec, eNoSameBunchPileup, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + if (!EventCut(eRec, eNoSameBunchPileup, cutModus)) { return kFALSE; } } } - // *) MultTPC: - if (ec.fUseEventCuts[eMultTPC]) { + // *) IsGoodZvtxFT0vsPV: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eIsGoodZvtxFT0vsPV]) { if (cutModus == eCutCounterBinning) { - EventCut(eRec, eMultTPC, eCutCounterBinning); - } else if (collision.multTPC() < ec.fdEventCuts[eMultTPC][eMin] || collision.multTPC() > ec.fdEventCuts[eMultTPC][eMax] || TMath::Abs(collision.multTPC() - ec.fdEventCuts[eMultTPC][eMax]) < tc.fFloatingPointPrecision) { - if (!EventCut(eRec, eVertex_z, cutModus)) { + EventCut(eRec, eIsGoodZvtxFT0vsPV, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + if (!EventCut(eRec, eIsGoodZvtxFT0vsPV, cutModus)) { + return kFALSE; + } + } + } + + // *) IsVertexITSTPC: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eIsVertexITSTPC]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eIsVertexITSTPC, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + if (!EventCut(eRec, eIsVertexITSTPC, cutModus)) { return kFALSE; } } } - // *) MultNTracksPV: - if (ec.fUseEventCuts[eMultNTracksPV]) { + // *) IsVertexTOFmatched: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eIsVertexTOFmatched]) { if (cutModus == eCutCounterBinning) { - EventCut(eRec, eMultNTracksPV, eCutCounterBinning); - } else if (collision.multNTracksPV() < ec.fdEventCuts[eMultNTracksPV][eMin] || collision.multNTracksPV() > ec.fdEventCuts[eMultNTracksPV][eMax] || TMath::Abs(collision.multNTracksPV() - ec.fdEventCuts[eMultNTracksPV][eMax]) < tc.fFloatingPointPrecision) { - if (!EventCut(eRec, eMultNTracksPV, cutModus)) { + EventCut(eRec, eIsVertexTOFmatched, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) { + if (!EventCut(eRec, eIsVertexTOFmatched, cutModus)) { return kFALSE; } } } - // *) Occupancy: - if (ec.fUseEventCuts[eOccupancy]) { + // *) IsVertexTRDmatched: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eIsVertexTRDmatched]) { if (cutModus == eCutCounterBinning) { - EventCut(eRec, eOccupancy, eCutCounterBinning); - } else if (ebye.fOccupancy < ec.fdEventCuts[eOccupancy][eMin] || ebye.fOccupancy > ec.fdEventCuts[eOccupancy][eMax] || TMath::Abs(ebye.fOccupancy - ec.fdEventCuts[eOccupancy][eMax]) < tc.fFloatingPointPrecision) { - if (!EventCut(eRec, eOccupancy, cutModus)) { + EventCut(eRec, eIsVertexTRDmatched, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kIsVertexTRDmatched)) { + if (!EventCut(eRec, eIsVertexTRDmatched, cutModus)) { return kFALSE; } } @@ -4493,7 +4659,7 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) Bool_t EventCut(Int_t rs, Int_t eventCut, eCutModus cutModus) { // Helper function to reduce code bloat in EventCuts(). It's meant to be used only in EventCuts(). - // It can be used also in exceptional cases outside of EventCuts(), like for eSelectedTracks, but use with care. + // It can be used also in exceptional cases outside of EventCuts(), like for eMultiplicity, but use with care. // Remark: Remember that as a second argument I cannot use enum eEventCuts, because here in one go I take both enum eEventCuts and enum eEventHistograms . @@ -4551,6 +4717,8 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) // f) Fill only simulated (Run 1 and 2 specific); // In case there is some corner case between Run 1 and Run 2, simply branch further this one // g) Test case. + // Remark: in most cases, all histogram which depend on eMultiplicity are booked only for "after", because by default, Multiplicity = SelectedTracks. + if (tc.fVerbose) { StartFunction(__FUNCTION__); } @@ -4563,18 +4731,23 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) !eh.fEventHistograms[eVertex_y][eRec][ba] ? true : eh.fEventHistograms[eVertex_y][eRec][ba]->Fill(collision.posY()); !eh.fEventHistograms[eVertex_z][eRec][ba] ? true : eh.fEventHistograms[eVertex_z][eRec][ba]->Fill(collision.posZ()); !eh.fEventHistograms[eNContributors][eRec][ba] ? true : eh.fEventHistograms[eNContributors][eRec][ba]->Fill(collision.numContrib()); - !eh.fEventHistograms[eTotalMultiplicity][eRec][ba] ? true : eh.fEventHistograms[eTotalMultiplicity][eRec][ba]->Fill(tracks.size()); // TBI 20231106 check and validate further - !eh.fEventHistograms[eSelectedTracks][eRec][ba] ? true : eh.fEventHistograms[eSelectedTracks][eRec][ba]->Fill(ebye.fSelectedTracks); // TBI 20240108 this one makes sense only for eAfter - !eh.fEventHistograms[eMultTPC][eRec][ba] ? true : eh.fEventHistograms[eMultTPC][eRec][ba]->Fill(collision.multTPC()); - !eh.fEventHistograms[eMultNTracksPV][eRec][ba] ? true : eh.fEventHistograms[eMultNTracksPV][eRec][ba]->Fill(collision.multNTracksPV()); + !eh.fEventHistograms[eTotalMultiplicity][eRec][ba] ? true : eh.fEventHistograms[eTotalMultiplicity][eRec][ba]->Fill(tracks.size()); // TBI 20231106 check and validate further + !eh.fEventHistograms[eMultiplicity][eRec][ba] ? true : eh.fEventHistograms[eMultiplicity][eRec][ba]->Fill(ebye.fMultiplicity); + !eh.fEventHistograms[eReferenceMultiplicity][eRec][ba] ? true : eh.fEventHistograms[eReferenceMultiplicity][eRec][ba]->Fill(ebye.fReferenceMultiplicity); !eh.fEventHistograms[eCentrality][eRec][ba] ? true : eh.fEventHistograms[eCentrality][eRec][ba]->Fill(ebye.fCentrality); } // QA: if (qa.fFillQAEventHistograms2D) { - !qa.fQAEventHistograms2D[eMultTPC_vs_NContributors][eRec][ba] ? true : qa.fQAEventHistograms2D[eMultTPC_vs_NContributors][eRec][ba]->Fill(collision.multTPC(), collision.numContrib()); - !qa.fQAEventHistograms2D[eMultTPC_vs_Centrality][eRec][ba] ? true : qa.fQAEventHistograms2D[eMultTPC_vs_Centrality][eRec][ba]->Fill(collision.multTPC(), ebye.fCentrality); - !qa.fQAEventHistograms2D[eVertex_z_vs_MultTPC][eRec][ba] ? true : qa.fQAEventHistograms2D[eVertex_z_vs_MultTPC][eRec][ba]->Fill(collision.posZ(), collision.multTPC()); - !qa.fQAEventHistograms2D[eVertex_z_vs_NContributors][eRec][ba] ? true : qa.fQAEventHistograms2D[eVertex_z_vs_NContributors][eRec][ba]->Fill(collision.posZ(), collision.numContrib()); + !qa.fQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity][eRec][ba] ? true : qa.fQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity][eRec][ba]->Fill(ebye.fMultiplicity, ebye.fReferenceMultiplicity); + !qa.fQAEventHistograms2D[eMultiplicity_vs_NContributors][eRec][ba] ? true : qa.fQAEventHistograms2D[eMultiplicity_vs_NContributors][eRec][ba]->Fill(ebye.fMultiplicity, collision.numContrib()); + !qa.fQAEventHistograms2D[eMultiplicity_vs_Centrality][eRec][ba] ? true : qa.fQAEventHistograms2D[eMultiplicity_vs_Centrality][eRec][ba]->Fill(ebye.fMultiplicity, ebye.fCentrality); + !qa.fQAEventHistograms2D[eMultiplicity_vs_Vertex_z][eRec][ba] ? true : qa.fQAEventHistograms2D[eMultiplicity_vs_Vertex_z][eRec][ba]->Fill(ebye.fMultiplicity, collision.posZ()); + !qa.fQAEventHistograms2D[eReferenceMultiplicity_vs_NContributors][eRec][ba] ? true : qa.fQAEventHistograms2D[eReferenceMultiplicity_vs_NContributors][eRec][ba]->Fill(ebye.fReferenceMultiplicity, collision.numContrib()); + !qa.fQAEventHistograms2D[eReferenceMultiplicity_vs_Centrality][eRec][ba] ? true : qa.fQAEventHistograms2D[eReferenceMultiplicity_vs_Centrality][eRec][ba]->Fill(ebye.fReferenceMultiplicity, ebye.fCentrality); + !qa.fQAEventHistograms2D[eReferenceMultiplicity_vs_Vertex_z][eRec][ba] ? true : qa.fQAEventHistograms2D[eReferenceMultiplicity_vs_Vertex_z][eRec][ba]->Fill(ebye.fReferenceMultiplicity, collision.posZ()); + !qa.fQAEventHistograms2D[eNContributors_vs_Centrality][eRec][ba] ? true : qa.fQAEventHistograms2D[eNContributors_vs_Centrality][eRec][ba]->Fill(collision.numContrib(), ebye.fCentrality); + !qa.fQAEventHistograms2D[eNContributors_vs_Vertex_z][eRec][ba] ? true : qa.fQAEventHistograms2D[eNContributors_vs_Vertex_z][eRec][ba]->Fill(collision.numContrib(), collision.posZ()); + !qa.fQAEventHistograms2D[eCentrality_vs_Vertex_z][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentrality_vs_Vertex_z][eRec][ba]->Fill(ebye.fCentrality, collision.posZ()); !qa.fQAEventHistograms2D[eCentFT0C_vs_CentNTPV][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentFT0C_vs_CentNTPV][eRec][ba]->Fill(qa.fCentrality[eCentFT0C], qa.fCentrality[eCentNTPV]); !qa.fQAEventHistograms2D[eCentFT0M_vs_CentNTPV][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentFT0M_vs_CentNTPV][eRec][ba]->Fill(qa.fCentrality[eCentFT0M], qa.fCentrality[eCentNTPV]); } @@ -4592,8 +4765,8 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) !eh.fEventHistograms[eVertex_z][eSim][ba] ? true : eh.fEventHistograms[eVertex_z][eSim][ba]->Fill(collision.mcCollision().posZ()); !eh.fEventHistograms[eImpactParameter][eSim][ba] ? true : eh.fEventHistograms[eImpactParameter][eSim][ba]->Fill(collision.mcCollision().impactParameter()); // eh.fEventHistograms[eTotalMultiplicity][eSim][ba]->Fill(tracks.size()); // TBI 20231106 check how to get corresponding MC truth info, and validate further - // eh.fEventHistograms[eSelectedTracks][eSim][ba]->Fill(ebye.fSelectedTracks); // TBI 20240108 this one makes sense only for eAfter + re-think if I really need it here - // TBI 20240120 eMultFT0M, ..., eMultNTracksPV are not needed here + // eh.fEventHistograms[eMultiplicity][eSim][ba]->Fill(ebye.fMultiplicity); // TBI 20241123 re-think if I really need it here. If yes, most likely I will have to + // generalize fSelectedTracks to an array, to counter separately selected sim particles // eh.fEventHistograms[eCentrality][eSim][ba]->Fill(ebye.fCentrality); // TBI 20240120 this case is still not supported in DetermineCentrality() } } // if constexpr (rs == eRecAndSim) { @@ -4605,8 +4778,9 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) if constexpr (rs == eSim || rs == eSim_Run2 || rs == eSim_Run1) { if (eh.fFillEventHistograms) { !eh.fEventHistograms[eImpactParameter][eSim][ba] ? true : eh.fEventHistograms[eImpactParameter][eSim][ba]->Fill(collision.impactParameter()); // yes, because in this branch 'collision' is always aod::McCollision - !eh.fEventHistograms[eSelectedTracks][eSim][ba] ? true : eh.fEventHistograms[eSelectedTracks][eSim][ba]->Fill(ebye.fSelectedTracks); // TBI 20240108 this one makes sense only for eAfter + !eh.fEventHistograms[eMultiplicity][eSim][ba] ? true : eh.fEventHistograms[eMultiplicity][eSim][ba]->Fill(ebye.fMultiplicity); // eh.fEventHistograms[eCentrality][eSim][ba]->Fill(ebye.fCentrality); // TBI 20240120 this case is still not supported in DetermineCentrality() + // eh.fEventHistograms[eReferenceMultiplicity][eSim][ba]->Fill(ebye.fReferenceMultiplicity); // TBI 20241123 this case is still not supported in DetermineReferenceMultiplicity() // eh.fEventHistograms[eTotalMultiplicity][eSim][ba]->Fill(tracks.size()); // TBI 20231030 check further how to use the same thing for 'sim' } } @@ -4616,16 +4790,25 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) // c) Fill reconstructed (Run 3 specific): if constexpr (rs == eRec || rs == eRecAndSim) { if (eh.fFillEventHistograms) { - !eh.fEventHistograms[eMultFT0M][eRec][ba] ? true : eh.fEventHistograms[eMultFT0M][eRec][ba]->Fill(collision.multFT0M()); - !eh.fEventHistograms[eMultFV0M][eRec][ba] ? true : eh.fEventHistograms[eMultFV0M][eRec][ba]->Fill(collision.multFV0M()); !eh.fEventHistograms[eOccupancy][eRec][ba] ? true : eh.fEventHistograms[eOccupancy][eRec][ba]->Fill(ebye.fOccupancy); } // QA: if (qa.fFillQAEventHistograms2D) { + // General (estimators can be chosen via configurables): + !qa.fQAEventHistograms2D[eMultiplicity_vs_Occupancy][eRec][ba] ? true : qa.fQAEventHistograms2D[eMultiplicity_vs_Occupancy][eRec][ba]->Fill(ebye.fMultiplicity, ebye.fOccupancy); + !qa.fQAEventHistograms2D[eReferenceMultiplicity_vs_Occupancy][eRec][ba] ? true : qa.fQAEventHistograms2D[eReferenceMultiplicity_vs_Occupancy][eRec][ba]->Fill(ebye.fReferenceMultiplicity, ebye.fOccupancy); + !qa.fQAEventHistograms2D[eNContributors_vs_Occupancy][eRec][ba] ? true : qa.fQAEventHistograms2D[eNContributors_vs_Occupancy][eRec][ba]->Fill(collision.numContrib(), ebye.fOccupancy); + !qa.fQAEventHistograms2D[eCentrality_vs_Occupancy][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentrality_vs_Occupancy][eRec][ba]->Fill(ebye.fCentrality, ebye.fOccupancy); + !qa.fQAEventHistograms2D[eVertex_z_vs_Occupancy][eRec][ba] ? true : qa.fQAEventHistograms2D[eVertex_z_vs_Occupancy][eRec][ba]->Fill(collision.posZ(), ebye.fOccupancy); + // ... + + // Specific (estimators are hardwired): + !qa.fQAEventHistograms2D[eCentFT0C_vs_CentNTPV][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentFT0C_vs_CentNTPV][eRec][ba]->Fill(qa.fCentrality[eCentFT0C], qa.fCentrality[eCentNTPV]); + !qa.fQAEventHistograms2D[eCentFT0M_vs_CentNTPV][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentFT0M_vs_CentNTPV][eRec][ba]->Fill(qa.fCentrality[eCentFT0M], qa.fCentrality[eCentNTPV]); + // TBI 20241124 add 2D QA correlation plots for 2-3 selected reference multiplicity estimators + // !eh.fEventHistograms[eMultFT0M][eRec][ba] ? true : eh.fEventHistograms[eMultFT0M][eRec][ba]->Fill(collision.multFT0M()); + // !eh.fEventHistograms[eMultFV0M][eRec][ba] ? true : eh.fEventHistograms[eMultFV0M][eRec][ba]->Fill(collision.multFV0M()); !qa.fQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange][eRec][ba] ? true : qa.fQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange][eRec][ba]->Fill(collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange()); - !qa.fQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_MultTPC][eRec][ba] ? true : qa.fQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_MultTPC][eRec][ba]->Fill(collision.trackOccupancyInTimeRange(), collision.multTPC()); - !qa.fQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_Vertex_z][eRec][ba] ? true : qa.fQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_Vertex_z][eRec][ba]->Fill(collision.trackOccupancyInTimeRange(), collision.posZ()); - !qa.fQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_Centrality][eRec][ba] ? true : qa.fQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_Centrality][eRec][ba]->Fill(collision.trackOccupancyInTimeRange(), ebye.fCentrality); } // ... and corresponding MC truth simulated (Run 3 specific) @@ -4635,6 +4818,9 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) LOGF(warning, "No MC collision for this collision, skip..."); return; } + + // !eh.fEventHistograms[eMultMCNParticlesEta08][eSim][ba] ? true : eh.fEventHistograms[eMultMCNParticlesEta08][eSim][ba]->Fill(collision.multMCNParticlesEta08()); + // !eh.fEventHistograms[eNumberOfEvents][eSim][ba] ? true : eh.fEventHistograms[eNumberOfEvents][eSim][ba]->Fill(0.5); } // if constexpr (rs == eRecAndSim) { } // if constexpr (rs == eRec || rs == eRecAndSim) { @@ -4656,7 +4842,6 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) // QA: if (qa.fFillQAEventHistograms2D) { !qa.fQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets][eRec][ba]->Fill(qa.fCentrality[eCentRun2V0M], qa.fCentrality[eCentRun2SPDTracklets]); - !qa.fQAEventHistograms2D[eCentRun2V0M_vs_NContributors][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentRun2V0M_vs_NContributors][eRec][ba]->Fill(qa.fCentrality[eCentRun2V0M], collision.numContrib()); } // ... and corresponding MC truth simulated (Run 1 and Run 2 specific): @@ -4869,13 +5054,13 @@ void CheckUnderflowAndOverflow() template bool ValidTrack(T const& track) { - // Before I start applying any particle tracks, check if this is a valid track. + // Before I start applying any track cuts, check if this is a valid track. // For instance, Run 2 or Run 1 tracklets are NOT valid tracks, as they carry no pt information, and in this function they are filtered out. // See enum TrackTypeEnum in O2/Framework/Core/include/Framework/DataTypes.h for further info. // a) Validity checks for tracks in Run 3; - // b) Validity checks for tracks in Run 2 and 1. + // b) Validity checks for tracks in Run 2 and 1; // c) Additional validity checks for all tracks (in Run 3, 2 and 1), use only during debugging. if (tc.fVerboseForEachParticle) { @@ -5629,7 +5814,7 @@ void FillParticleHistograms(T const& track, eBeforeAfter ba, Int_t weight = 1) // But GetMeanErorr(), GetRMSError(), etc. are affected. // For instance, GetMean() remains the same, because (x+y)/(1+1) = (x+y+z-z)(1+1+1-1). But whenever weight in the formula is taken directly to some higher power, // like in the calculation of GetMeanError(), this idea with BanishmentLoopOverParticles is not applicable (also when I enable Setw2() in histograms). - // Since from particle histograms I only care about the number of enties, I rarely need even GetMean(), and basically never GetMeanError(), + // Since from particle histograms I only care about the number of entries, I rarely need even GetMean(), and basically never GetMeanError(), // I use BanishmentLoopOverParticles . Alternatively, I would need new set of histograms, fill them separately, etc. if (tc.fVerboseForEachParticle) { @@ -5651,26 +5836,26 @@ void FillParticleHistograms(T const& track, eBeforeAfter ba, Int_t weight = 1) // 1D: if (ph.fFillParticleHistograms) { // From o2::aod::Tracks - !ph.fParticleHistograms[ePhi][eRec][ba] ? true : ph.fParticleHistograms[ePhi][eRec][ba]->Fill(track.phi(), weight); // 3 2 - !ph.fParticleHistograms[ePt][eRec][ba] ? true : ph.fParticleHistograms[ePt][eRec][ba]->Fill(track.pt(), weight); // 3 2 - !ph.fParticleHistograms[eEta][eRec][ba] ? true : ph.fParticleHistograms[eEta][eRec][ba]->Fill(track.eta(), weight); // 3 2 - !ph.fParticleHistograms[eCharge][eRec][ba] ? true : ph.fParticleHistograms[eCharge][eRec][ba]->Fill(track.sign(), weight); // 3 2 + !ph.fParticleHistograms[ePhi][eRec][ba] ? true : ph.fParticleHistograms[ePhi][eRec][ba]->Fill(track.phi(), weight); + !ph.fParticleHistograms[ePt][eRec][ba] ? true : ph.fParticleHistograms[ePt][eRec][ba]->Fill(track.pt(), weight); + !ph.fParticleHistograms[eEta][eRec][ba] ? true : ph.fParticleHistograms[eEta][eRec][ba]->Fill(track.eta(), weight); + !ph.fParticleHistograms[eCharge][eRec][ba] ? true : ph.fParticleHistograms[eCharge][eRec][ba]->Fill(track.sign(), weight); // From o2::aod::TracksExtra_001 - !ph.fParticleHistograms[etpcNClsFindable][eRec][ba] ? true : ph.fParticleHistograms[etpcNClsFindable][eRec][ba]->Fill(track.tpcNClsFindable(), weight); // 3 2 - !ph.fParticleHistograms[etpcNClsShared][eRec][ba] ? true : ph.fParticleHistograms[etpcNClsShared][eRec][ba]->Fill(track.tpcNClsShared(), weight); // 3 2 - !ph.fParticleHistograms[etpcNClsFound][eRec][ba] ? true : ph.fParticleHistograms[etpcNClsFound][eRec][ba]->Fill(track.tpcNClsFound(), weight); // 3 2 - !ph.fParticleHistograms[etpcNClsCrossedRows][eRec][ba] ? true : ph.fParticleHistograms[etpcNClsCrossedRows][eRec][ba]->Fill(track.tpcNClsCrossedRows(), weight); // 3 2 - !ph.fParticleHistograms[eitsNCls][eRec][ba] ? true : ph.fParticleHistograms[eitsNCls][eRec][ba]->Fill(track.itsNCls(), weight); // 3 2 - !ph.fParticleHistograms[eitsNClsInnerBarrel][eRec][ba] ? true : ph.fParticleHistograms[eitsNClsInnerBarrel][eRec][ba]->Fill(track.itsNClsInnerBarrel(), weight); // 3 2 - !ph.fParticleHistograms[etpcCrossedRowsOverFindableCls][eRec][ba] ? true : ph.fParticleHistograms[etpcCrossedRowsOverFindableCls][eRec][ba]->Fill(track.tpcCrossedRowsOverFindableCls(), weight); // 3 2 - !ph.fParticleHistograms[etpcFoundOverFindableCls][eRec][ba] ? true : ph.fParticleHistograms[etpcFoundOverFindableCls][eRec][ba]->Fill(track.tpcFoundOverFindableCls(), weight); // 3 2 - !ph.fParticleHistograms[etpcFractionSharedCls][eRec][ba] ? true : ph.fParticleHistograms[etpcFractionSharedCls][eRec][ba]->Fill(track.tpcFractionSharedCls(), weight); // 3 2 + !ph.fParticleHistograms[etpcNClsFindable][eRec][ba] ? true : ph.fParticleHistograms[etpcNClsFindable][eRec][ba]->Fill(track.tpcNClsFindable(), weight); + !ph.fParticleHistograms[etpcNClsShared][eRec][ba] ? true : ph.fParticleHistograms[etpcNClsShared][eRec][ba]->Fill(track.tpcNClsShared(), weight); + !ph.fParticleHistograms[etpcNClsFound][eRec][ba] ? true : ph.fParticleHistograms[etpcNClsFound][eRec][ba]->Fill(track.tpcNClsFound(), weight); + !ph.fParticleHistograms[etpcNClsCrossedRows][eRec][ba] ? true : ph.fParticleHistograms[etpcNClsCrossedRows][eRec][ba]->Fill(track.tpcNClsCrossedRows(), weight); + !ph.fParticleHistograms[eitsNCls][eRec][ba] ? true : ph.fParticleHistograms[eitsNCls][eRec][ba]->Fill(track.itsNCls(), weight); + !ph.fParticleHistograms[eitsNClsInnerBarrel][eRec][ba] ? true : ph.fParticleHistograms[eitsNClsInnerBarrel][eRec][ba]->Fill(track.itsNClsInnerBarrel(), weight); + !ph.fParticleHistograms[etpcCrossedRowsOverFindableCls][eRec][ba] ? true : ph.fParticleHistograms[etpcCrossedRowsOverFindableCls][eRec][ba]->Fill(track.tpcCrossedRowsOverFindableCls(), weight); + !ph.fParticleHistograms[etpcFoundOverFindableCls][eRec][ba] ? true : ph.fParticleHistograms[etpcFoundOverFindableCls][eRec][ba]->Fill(track.tpcFoundOverFindableCls(), weight); + !ph.fParticleHistograms[etpcFractionSharedCls][eRec][ba] ? true : ph.fParticleHistograms[etpcFractionSharedCls][eRec][ba]->Fill(track.tpcFractionSharedCls(), weight); // From o2::aod::TracksDCA // Remark: For this one, in Run 3 workflow I need helper task o2-analysis-track-propagation, while in Run 2 and 1 I need o2-analysis-trackextension . - !ph.fParticleHistograms[edcaXY][eRec][ba] ? true : ph.fParticleHistograms[edcaXY][eRec][ba]->Fill(track.dcaXY(), weight); // 3 2 - !ph.fParticleHistograms[edcaZ][eRec][ba] ? true : ph.fParticleHistograms[edcaZ][eRec][ba]->Fill(track.dcaZ(), weight); // 3 2 + !ph.fParticleHistograms[edcaXY][eRec][ba] ? true : ph.fParticleHistograms[edcaXY][eRec][ba]->Fill(track.dcaXY(), weight); + !ph.fParticleHistograms[edcaZ][eRec][ba] ? true : ph.fParticleHistograms[edcaZ][eRec][ba]->Fill(track.dcaZ(), weight); } // 2D: @@ -5697,9 +5882,9 @@ void FillParticleHistograms(T const& track, eBeforeAfter ba, Int_t weight = 1) // 1D: if (ph.fFillParticleHistograms) { - !ph.fParticleHistograms[ePhi][eSim][ba] ? true : ph.fParticleHistograms[ePhi][eSim][ba]->Fill(mcparticle.phi(), weight); // 3 - !ph.fParticleHistograms[ePt][eSim][ba] ? true : ph.fParticleHistograms[ePt][eSim][ba]->Fill(mcparticle.pt(), weight); // 3 - !ph.fParticleHistograms[eEta][eSim][ba] ? true : ph.fParticleHistograms[eEta][eSim][ba]->Fill(mcparticle.eta(), weight); // 3 + !ph.fParticleHistograms[ePhi][eSim][ba] ? true : ph.fParticleHistograms[ePhi][eSim][ba]->Fill(mcparticle.phi(), weight); + !ph.fParticleHistograms[ePt][eSim][ba] ? true : ph.fParticleHistograms[ePt][eSim][ba]->Fill(mcparticle.pt(), weight); + !ph.fParticleHistograms[eEta][eSim][ba] ? true : ph.fParticleHistograms[eEta][eSim][ba]->Fill(mcparticle.eta(), weight); // !ph.fParticleHistograms[eCharge][eSim][ba] ? true : ph.fParticleHistograms[eCharge][eSim][ba]->Fill( ... ); // TBI 20240511 there is no mcparticle.sign()) !ph.fParticleHistograms[ePDG][eSim][ba] ? true : ph.fParticleHistograms[ePDG][eSim][ba]->Fill(mcparticle.pdgCode(), weight); // TBI 20240512 this one gets filles correctly, deduce from it charge signature } @@ -6344,7 +6529,7 @@ void CalculateTest0() } // vs. multiplicity: if (t0.fTest0Pro[mo][mi][AFO_MULTIPLICITY]) { - t0.fTest0Pro[mo][mi][AFO_MULTIPLICITY]->Fill(ebye.fSelectedTracks + 0.5, correlation / weight, weight); + t0.fTest0Pro[mo][mi][AFO_MULTIPLICITY]->Fill(ebye.fMultiplicity + 0.5, correlation / weight, weight); } // vs. centrality: if (t0.fTest0Pro[mo][mi][AFO_CENTRALITY]) { @@ -6404,9 +6589,9 @@ void CalculateKineTest0(eAsFunctionOf AFO_variable) for (Int_t b = 0; b < nBins; b++) { // *) Ensures that in each bin of interest, I have the same cut on number of particles, like in integrated analysis: - if ((qv.fqVectorEntries[qvKine][b] < ec.fdEventCuts[eSelectedTracks][eMin]) || (qv.fqVectorEntries[qvKine][b] > ec.fdEventCuts[eSelectedTracks][eMax])) { + if ((qv.fqVectorEntries[qvKine][b] < ec.fdEventCuts[eMultiplicity][eMin]) || (qv.fqVectorEntries[qvKine][b] > ec.fdEventCuts[eMultiplicity][eMax] || TMath::Abs(qv.fqVectorEntries[qvKine][b] - ec.fdEventCuts[eMultiplicity][eMax]) < tc.fFloatingPointPrecision)) { if (tc.fVerbose) { - LOGF(info, "\033[1;31m%s eSelectedTracks cut in bin = %d, for qvKine = %d\033[0m", __FUNCTION__, b, static_cast(qvKine)); + LOGF(info, "\033[1;31m%s eMultiplicity cut in bin = %d, for qvKine = %d\033[0m", __FUNCTION__, b, static_cast(qvKine)); } } @@ -6686,7 +6871,7 @@ void CalculateNestedLoops() // fill cos, 2p, vs. multiplicity: if (nl.fNestedLoopsPro[0][h][AFO_MULTIPLICITY]) { nl.fNestedLoopsPro[0][h][AFO_MULTIPLICITY]->Fill( - ebye.fSelectedTracks + 0.5, TMath::Cos((h + 1.) * (dPhi1 - dPhi2)), + ebye.fMultiplicity + 0.5, TMath::Cos((h + 1.) * (dPhi1 - dPhi2)), dW1 * dW2); } // fill cos, 2p, vs. centrality: @@ -6740,7 +6925,7 @@ void CalculateNestedLoops() } // fill cos, 4p, all harmonics, vs. M: if (nl.fNestedLoopsPro[1][h][AFO_MULTIPLICITY]) { - nl.fNestedLoopsPro[1][h][AFO_MULTIPLICITY]->Fill(ebye.fSelectedTracks + 0.5, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 - dPhi3 - dPhi4)), dW1 * dW2 * dW3 * dW4); + nl.fNestedLoopsPro[1][h][AFO_MULTIPLICITY]->Fill(ebye.fMultiplicity + 0.5, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 - dPhi3 - dPhi4)), dW1 * dW2 * dW3 * dW4); } // fill cos, 4p, all harmonics, vs. centrality: if (nl.fNestedLoopsPro[1][h][AFO_CENTRALITY]) { @@ -6805,7 +6990,7 @@ void CalculateNestedLoops() } // fill cos, 6p, all harmonics, vs. M: if (nl.fNestedLoopsPro[2][h][AFO_MULTIPLICITY]) { - nl.fNestedLoopsPro[2][h][AFO_MULTIPLICITY]->Fill(ebye.fSelectedTracks + 0.5, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 + dPhi3 - dPhi4 - dPhi5 - dPhi6)), dW1 * dW2 * dW3 * dW4 * dW5 * dW6); + nl.fNestedLoopsPro[2][h][AFO_MULTIPLICITY]->Fill(ebye.fMultiplicity + 0.5, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 + dPhi3 - dPhi4 - dPhi5 - dPhi6)), dW1 * dW2 * dW3 * dW4 * dW5 * dW6); } // fill cos, 6p, all harmonics, vs. centrality: if (nl.fNestedLoopsPro[2][h][AFO_CENTRALITY]) { @@ -6884,7 +7069,7 @@ void CalculateNestedLoops() } // fill cos, 8p, all harmonics, vs. M: if (nl.fNestedLoopsPro[3][h][AFO_MULTIPLICITY]) { - nl.fNestedLoopsPro[3][h][AFO_MULTIPLICITY]->Fill(ebye.fSelectedTracks + 0.5, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 + dPhi3 + dPhi4 - dPhi5 - dPhi6 - dPhi7 - dPhi8)), dW1 * dW2 * dW3 * dW4 * dW5 * dW6 * dW7 * dW8); + nl.fNestedLoopsPro[3][h][AFO_MULTIPLICITY]->Fill(ebye.fMultiplicity + 0.5, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 + dPhi3 + dPhi4 - dPhi5 - dPhi6 - dPhi7 - dPhi8)), dW1 * dW2 * dW3 * dW4 * dW5 * dW6 * dW7 * dW8); } // fill cos, 8p, all harmonics, vs. centrality: if (nl.fNestedLoopsPro[3][h][AFO_CENTRALITY]) { @@ -7437,7 +7622,7 @@ TH1D* GetHistogramWithWeights(const char* filePath, const char* runNumber, const } weightsFile->GetObject( - "ccdb_object", baseList); // TBI 20231008 for simplicity, harwired name + "ccdb_object", baseList); // TBI 20231008 for simplicity, hardwired name // of base TList is "ccdb_object" also for // AliEn case, see if I need to change this if (!baseList) { @@ -7509,7 +7694,7 @@ TH1D* GetHistogramWithWeights(const char* filePath, const char* runNumber, const LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); } - weightsFile->GetObject("ccdb_object", baseList); // TBI 20231008 for simplicity, harwired name + weightsFile->GetObject("ccdb_object", baseList); // TBI 20231008 for simplicity, hardwired name // of base TList is "ccdb_object" also for // local case, see if I need to change this if (!baseList) { @@ -7691,7 +7876,7 @@ TH1D* GetHistogramWithCentralityWeights(const char* filePath, const char* runNum LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); } - centralityWeightsFile->GetObject("ccdb_object", baseList); // TBI 20231008 for simplicity, harwired name + centralityWeightsFile->GetObject("ccdb_object", baseList); // TBI 20231008 for simplicity, hardwired name // of base TList is "ccdb_object" also for // AliEn case, see if I need to change this if (!baseList) { @@ -7763,23 +7948,38 @@ TH1D* GetHistogramWithCentralityWeights(const char* filePath, const char* runNum LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); } - centralityWeightsFile->GetObject("ccdb_object", baseList); // TBI 20231008 for simplicity, harwired name - // of base TList is "ccdb_object" also for - // local case, see if I need to change this - if (!baseList) { - // centralityWeightsFile->ls(); - LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); - } + // xxxxxxxxxxxx TBI 20241124 remove this code - listWithRuns = reinterpret_cast(GetObjectFromList(baseList, runNumber)); - if (!listWithRuns) { - TString runNumberWithLeadingZeroes = "000"; - runNumberWithLeadingZeroes += runNumber; // another try, with "000" prepended to run number - listWithRuns = reinterpret_cast(GetObjectFromList(baseList, runNumberWithLeadingZeroes.Data())); - if (!listWithRuns) { - LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); - } + hist = reinterpret_cast(centralityWeightsFile->Get("FT0C_Default list name")); // TBI 20241122 temporary workaround + if (!hist) { + Exit(); } + hist->SetDirectory(0); + hist->SetTitle(Form("%s, %s", filePath, runNumber)); // I have to do it here, because only here I have "filePath" available + return hist; + + // xxxxxxxxxxxx + + /* + centralityWeightsFile->GetObject("ccdb_object", baseList); // TBI 20231008 for simplicity, hardwired name + // of base TList is "ccdb_object" also for + // local case, see if I need to change this + + if (!baseList) { + // centralityWeightsFile->ls(); + LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); + } + + listWithRuns = reinterpret_cast(GetObjectFromList(baseList, runNumber)); + if (!listWithRuns) { + TString runNumberWithLeadingZeroes = "000"; + runNumberWithLeadingZeroes += runNumber; // another try, with "000" prepended to run number + listWithRuns = reinterpret_cast(GetObjectFromList(baseList, runNumberWithLeadingZeroes.Data())); + if (!listWithRuns) { + LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); + } + } + */ } // else { @@ -8641,10 +8841,18 @@ void PrintEventCounter(eBeforeAfter ba) // *) Print or die: switch (ba) { case eBefore: - LOGF(info, "\033[1;32m%s : processing event %d ....\033[0m", __FUNCTION__, eh.fEventCounter[eTotal]); + if (!tc.fPlainPrintout) { + LOGF(info, "\033[1;32m%s : processing event %d ....\033[0m", __FUNCTION__, eh.fEventCounter[eTotal]); + } else { + LOGF(info, "%s : processing event %d ....", __FUNCTION__, eh.fEventCounter[eTotal]); + } break; case eAfter: - LOGF(info, "\033[1;32m%s : event passed all cuts %d/%d\033[0m", __FUNCTION__, eh.fEventCounter[eProcessed], eh.fEventCounter[eTotal]); + if (!tc.fPlainPrintout) { + LOGF(info, "\033[1;32m%s : event passed all cuts %d/%d\033[0m", __FUNCTION__, eh.fEventCounter[eProcessed], eh.fEventCounter[eTotal]); + } else { + LOGF(info, "%s : event passed all cuts %d/%d", __FUNCTION__, eh.fEventCounter[eProcessed], eh.fEventCounter[eTotal]); + } break; default: LOGF(fatal, "\033[1;31m%s at line %d : enum ba = %d is not supported yet. \033[0m", __FUNCTION__, __LINE__, static_cast(ba)); @@ -8697,7 +8905,7 @@ void EventCounterForDryRun(eEventCounterForDryRun eVar) ExitFunction(__FUNCTION__); } -} // void EventCounterForDryRun() +} // void EventCounterForDryRun(eEventCounterForDryRun eVar) //============================================================ @@ -8719,11 +8927,11 @@ const char* FancyFormatting(const char* name) const char* fancyFormatting = name; // Special cases supported by now: - if (TString(name).EqualTo("Phi")) { + if (TString(name).EqualTo("Phi", TString::kIgnoreCase)) { fancyFormatting = "#varphi"; - } else if (TString(name).EqualTo("Pt")) { + } else if (TString(name).EqualTo("Pt", TString::kIgnoreCase)) { fancyFormatting = "p_{T}"; - } else if (TString(name).EqualTo("Eta")) { + } else if (TString(name).EqualTo("Eta", TString::kIgnoreCase)) { fancyFormatting = "#eta"; } else if (TString(name).EqualTo("Vertex_x")) { fancyFormatting = "V_{x}"; @@ -8731,7 +8939,13 @@ const char* FancyFormatting(const char* name) fancyFormatting = "V_{y}"; } else if (TString(name).EqualTo("Vertex_z")) { fancyFormatting = "V_{z}"; - } else if (TString(name).EqualTo("Centrality")) { + } else if (TString(name).EqualTo("TotalMultiplicity")) { + fancyFormatting = "TotalMultiplicity (tracks.size())"; + } else if (TString(name).EqualTo("Multiplicity", TString::kIgnoreCase)) { + fancyFormatting = Form("Multiplicity (%s)", ec.fsEventCuts[eMultiplicityEstimator].Data()); + } else if (TString(name).EqualTo("ReferenceMultiplicity")) { + fancyFormatting = Form("ReferenceMultiplicity (%s)", ec.fsEventCuts[eReferenceMultiplicityEstimator].Data()); + } else if (TString(name).EqualTo("Centrality", TString::kIgnoreCase)) { TString tmp = ec.fsEventCuts[eCentralityEstimator]; // I have to introduce local TString tmp, because ReplaceAll replaces in-place if (tmp.BeginsWith("CentRun2")) { fancyFormatting = Form("Centrality (%s)", tmp.ReplaceAll("CentRun2", "").Data()); // "CentRun2V0M" => "Centrality (V0M)" @@ -8746,12 +8960,8 @@ const char* FancyFormatting(const char* name) fancyFormatting = "trackOccupancyInTimeRange()"; } else if (TString(name).EqualTo("FT0COccupancyInTimeRange")) { fancyFormatting = "ft0cOccupancyInTimeRange()"; - } else if (TString(name).EqualTo("Occupancy")) { - if (ec.fsEventCuts[eOccupancyEstimator].BeginsWith("Track")) { - fancyFormatting = "Occupancy (getter trackOccupancyInTimeRange())"; - } else if (ec.fsEventCuts[eOccupancyEstimator].BeginsWith("FT0C")) { - fancyFormatting = "Occupancy (getter ft0cOccupancyInTimeRange())"; - } + } else if (TString(name).EqualTo("Occupancy", TString::kIgnoreCase)) { + fancyFormatting = Form("Occupancy (%s)", ec.fsEventCuts[eOccupancyEstimator].Data()); } if (tc.fVerboseUtility) { @@ -8991,50 +9201,37 @@ Double_t CalculateKineCustomNestedLoops(TArrayI* harmonics, eAsFunctionOf AFO_va StartFunction(__FUNCTION__); } - Trace(__FUNCTION__, __LINE__); - if (!harmonics) { LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); } - Trace(__FUNCTION__, __LINE__); - // *) ... eqvectorKine qvKine = eqvectorKine_N; // which component of q-vector TString kineVarName = ""; switch (AFO_variable) { case AFO_PT: - Trace(__FUNCTION__, __LINE__); qvKine = PTq; kineVarName = "pt"; break; case AFO_ETA: - Trace(__FUNCTION__, __LINE__); qvKine = ETAq; kineVarName = "eta"; break; default: - Trace(__FUNCTION__, __LINE__); LOGF(fatal, "\033[1;31m%s at line %d : This AFO_variable = %d is not supported yet. \033[0m", __FUNCTION__, __LINE__, static_cast(AFO_variable)); break; } // switch(AFO_variable) - Trace(__FUNCTION__, __LINE__); - // *) Insanity checks on above settings: if (qvKine == eqvectorKine_N) { LOGF(fatal, "\033[1;31m%s at line %d : qvKine == eqvectorKine_N => add some more entries to the case statement \033[0m", __FUNCTION__, __LINE__); } - Trace(__FUNCTION__, __LINE__); - if (0 > bin || res.fResultsPro[AFO_variable]->GetNbinsX() < bin) { // this 'bin' starts from 0, i.e. this is an array bin // either underflow or overflow is hit, meaning that histogram is booked in narrower range than cuts LOGF(fatal, "\033[1;31m%s at line %d => AFO_variable = %d, bin = %d\033[0m", __FUNCTION__, __LINE__, static_cast(AFO_variable), bin); } - Trace(__FUNCTION__, __LINE__); - // Get the number of particles in this kine bin: Int_t nParticles = 0; for (Int_t i = 0; i < nl.ftaNestedLoopsKine[qvKine][bin][0]->GetSize(); i++) { @@ -9043,41 +9240,27 @@ Double_t CalculateKineCustomNestedLoops(TArrayI* harmonics, eAsFunctionOf AFO_va } } - Trace(__FUNCTION__, __LINE__); - // 'qvKine' is enum eqvectorKine: if (!res.fResultsPro[AFO_variable]) { LOGF(fatal, "\033[1;31m%s at line %d : AFO_variable = %d, bin = %d \033[0m", __FUNCTION__, __LINE__, static_cast(AFO_variable), bin); } - Trace(__FUNCTION__, __LINE__); - LOGF(info, " Processing qvKine = %d (vs. %s), nParticles in this kine bin = %d, bin range = [%f,%f) ....", static_cast(qvKine), kineVarName.Data(), nParticles, res.fResultsPro[AFO_variable]->GetBinLowEdge(bin + 1), res.fResultsPro[AFO_variable]->GetBinLowEdge(bin + 2)); - Trace(__FUNCTION__, __LINE__); - // a) Determine the order of correlator; Int_t order = harmonics->GetSize(); if (0 == order || order > gMaxCorrelator) { LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); } - - Trace(__FUNCTION__, __LINE__); - if (order > nParticles) { LOGF(info, " There is no enough particles in this bin to calculate the requested correlator"); return 0.; // TBI 20240405 Is this really safe here? Re-think... } - - Trace(__FUNCTION__, __LINE__); - if (nl.fMaxNestedLoop > 0 && nl.fMaxNestedLoop < order) { LOGF(info, " nl.fMaxNestedLoop > 0 && nl.fMaxNestedLoop < order, where nl.fMaxNestedLoop = %d, order = %d", nl.fMaxNestedLoop, order); return 0.; // TBI 20240405 Is this really safe here? Re-think... } - Trace(__FUNCTION__, __LINE__); - // b) Custom nested loop: TProfile* profile = new TProfile("profile", "", 1, 0., 1.); // helper profile to get all averages automatically // profile->Sumw2(); @@ -9240,18 +9423,10 @@ Double_t CalculateKineCustomNestedLoops(TArrayI* harmonics, eAsFunctionOf AFO_va } // for(int i2=0; i2GetBinContent(1); - - Trace(__FUNCTION__, __LINE__); - delete profile; profile = NULL; - - Trace(__FUNCTION__, __LINE__); - if (tc.fVerbose) { ExitFunction(__FUNCTION__); } @@ -9261,28 +9436,139 @@ Double_t CalculateKineCustomNestedLoops(TArrayI* harmonics, eAsFunctionOf AFO_va //============================================================ -template -void DetermineCentrality(T const& collision) +void DetermineMultiplicity() { - // Determine collision centrality. - - // a) For real data, determine centrality from default centrality estimator; - // b) For simulated data, determine centrality directly from impact parameter; - // c) Same as a), just for converted Run 2 data; - // d) Same as b), just for converted Run 2 data; - // e) Same as a), just for converted Run 1 data; - // f) Same as b), just for converted Run 1 data; - // g) Test case; - // h) Print centrality for the audience... + // Determine multiplicity for "vs. mult" results. if (tc.fVerbose) { StartFunction(__FUNCTION__); } - // a) For real data, determine centrality from default centrality estimator: - if constexpr (rs == eRec || rs == eRecAndSim) { - if (ec.fsEventCuts[eCentralityEstimator].EqualTo("centFT0C", TString::kIgnoreCase)) { - ebye.fCentrality = collision.centFT0C(); + if (ec.fsEventCuts[eMultiplicityEstimator].EqualTo("SelectedTracks", TString::kIgnoreCase)) { + ebye.fMultiplicity = static_cast(ebye.fSelectedTracks); + } else if (ec.fsEventCuts[eMultiplicityEstimator].EqualTo("ReferenceMultiplicity", TString::kIgnoreCase)) { + ebye.fMultiplicity = ebye.fReferenceMultiplicity; + } else { + LOGF(fatal, "\033[1;31m%s at line %d : multiplicity estimator = %s is not supported yet. \033[0m", __FUNCTION__, __LINE__, ec.fsEventCuts[eMultiplicityEstimator].Data()); + } + + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // void DetermineMultiplicity() + +//============================================================ + +template +void DetermineReferenceMultiplicity(T const& collision) +{ + // Determine collision reference multiplicity. + + // a) Determine reference multiplicity for real Run 3 data; + // b) Determine reference multiplicity for simulated Run 3 data; + // c) Same as a), just for converted Run 2 and Run 1 data; + // d) Same as b), just for converted Run 2 and Run 1 data; + // e) Test case; + // f) Print reference multiplicity for the audience... + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // a) Determine reference multiplicity for real Run 3 data: + if constexpr (rs == eRec || rs == eRecAndSim) { + // Local convention for name of reference multiplicity estimator: use the same name as the getter, case insensitive. + if (ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("multTPC", TString::kIgnoreCase)) { + ebye.fReferenceMultiplicity = collision.multTPC(); + } else if (ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("multFV0M", TString::kIgnoreCase)) { + ebye.fReferenceMultiplicity = collision.multFV0M(); + } else if (ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("multFT0C", TString::kIgnoreCase)) { + ebye.fReferenceMultiplicity = collision.multFT0C(); + } else if (ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("multFT0M", TString::kIgnoreCase)) { + ebye.fReferenceMultiplicity = collision.multFT0M(); + } else if (ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("multNTracksPV", TString::kIgnoreCase)) { + ebye.fReferenceMultiplicity = collision.multNTracksPV(); + } else { + LOGF(fatal, "\033[1;31m%s at line %d : reference multiplicity estimator = %d is not supported yet for Run 3. \033[0m", __FUNCTION__, __LINE__, ec.fsEventCuts[eReferenceMultiplicityEstimator].Data()); + } + // QA: + if (qa.fFillQAEventHistograms2D) { // TBI 20240515 this flag is too general here, I need to make it more specific + qa.fReferenceMultiplicity[eMultTPC] = collision.multTPC(); + qa.fReferenceMultiplicity[eMultFV0M] = collision.multFV0M(); + qa.fReferenceMultiplicity[eMultFT0C] = collision.multFT0C(); + qa.fReferenceMultiplicity[eMultFT0M] = collision.multFT0M(); + qa.fReferenceMultiplicity[eMultNTracksPV] = collision.multNTracksPV(); + } + + // TBI 20241123 check if corresponding simulated ref. mult. is available through collision.has_mcCollision() + // ... + } + + // b) Determine reference multiplicity for simulated Run 3 data: + if constexpr (rs == eSim) { + ebye.fReferenceMultiplicity = -44.; // TBI 20241123 check what to use here and add support eventualy + } + + // c) Same as a), just for converted Run 2 and Run 1 data: + if constexpr (rs == eRec_Run2 || rs == eRecAndSim_Run2 || rs == eRec_Run1 || rs == eRecAndSim_Run1) { + if (ec.fsEventCuts[eReferenceMultiplicity].EqualTo("multTracklets", TString::kIgnoreCase)) { + ebye.fReferenceMultiplicity = collision.multTracklets(); + } else { + LOGF(fatal, "\033[1;31m%s at line %d : reference multiplicity estimator = %d is not supported yet for Run 2. \033[0m", __FUNCTION__, __LINE__, ec.fsEventCuts[eReferenceMultiplicityEstimator].Data()); + } + // QA: + if (qa.fFillQAEventHistograms2D) { // TBI 20240515 this flag is too general here, I need to make it more specific + // ... + } + + // TBI 20241123 check if corresponding simulated ref. mult. is available through collision.has_mcCollision() + // ... + } + + // d) Same as b), just for converted Run 2 and Run 1 data: + if constexpr (rs == eSim_Run2 || rs == eSim_Run1) { + ebye.fReferenceMultiplicity = -44.; // TBI 20241123 check what to use here and add support eventualy + } + + // e) Test case: + if constexpr (rs == eTest) { + ebye.fReferenceMultiplicity = static_cast(gRandom->Uniform(0., 5000.)); // TBI 20241123 I could implement here a getter, if there is one available both for Run 3 and Run 2/1 + } + + // f) Print centrality for the audience...: + if (tc.fVerbose) { + LOGF(info, "\033[1;32m ebye.fReferenceMultiplicity = %f\033[0m", ebye.fReferenceMultiplicity); + ExitFunction(__FUNCTION__); + } + +} // template void DetermineReferenceMultiplicity(T const& collision) + +//============================================================ + +template +void DetermineCentrality(T const& collision) +{ + // Determine collision centrality. + + // a) For real data, determine centrality from default centrality estimator; + // b) For simulated data, determine centrality directly from impact parameter; + // c) Same as a), just for converted Run 2 data; + // d) Same as b), just for converted Run 2 data; + // e) Same as a), just for converted Run 1 data; + // f) Same as b), just for converted Run 1 data; + // g) Test case; + // h) Print centrality for the audience... + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // a) For real data, determine centrality from default centrality estimator: + if constexpr (rs == eRec || rs == eRecAndSim) { + // Local convention for name of centrality estimator: use the same name as the getter, case insensitive. + if (ec.fsEventCuts[eCentralityEstimator].EqualTo("centFT0C", TString::kIgnoreCase)) { + ebye.fCentrality = collision.centFT0C(); } else if (ec.fsEventCuts[eCentralityEstimator].EqualTo("centFT0M", TString::kIgnoreCase)) { ebye.fCentrality = collision.centFT0M(); } else if (ec.fsEventCuts[eCentralityEstimator].EqualTo("centFV0A", TString::kIgnoreCase)) { @@ -9310,7 +9596,6 @@ void DetermineCentrality(T const& collision) // c) Same as a), just for converted Run 2 data: if constexpr (rs == eRec_Run2 || rs == eRecAndSim_Run2) { - // Local convention for name of centrality estimator: use the same name as the getter, case insensitive. if (ec.fsEventCuts[eCentralityEstimator].EqualTo("centRun2V0M", TString::kIgnoreCase)) { ebye.fCentrality = collision.centRun2V0M(); } else if (ec.fsEventCuts[eCentralityEstimator].EqualTo("centRun2SPDTracklets", TString::kIgnoreCase)) { @@ -9425,7 +9710,7 @@ void DetermineEventCounters() eh.fEventCounter[eTotal] = static_cast(eh.fEventHistograms[eNumberOfEvents][eRec][eBefore]->GetBinContent(1)); eh.fEventCounter[eProcessed] = static_cast(eh.fEventHistograms[eNumberOfEvents][eRec][eAfter]->GetBinContent(1)); } else if (eh.fEventHistograms[eNumberOfEvents][eSim][eBefore] && eh.fEventHistograms[eNumberOfEvents][eSim][eAfter]) { - // Remark: This branch covers automatically also internal validation, because I book and fill there on [eSim]. + // Remark: This branch covers automatically also internal validation, because I book and fill there only eSim. eh.fEventCounter[eTotal] = static_cast(eh.fEventHistograms[eNumberOfEvents][eSim][eBefore]->GetBinContent(1)); eh.fEventCounter[eProcessed] = static_cast(eh.fEventHistograms[eNumberOfEvents][eSim][eAfter]->GetBinContent(1)); } @@ -9662,13 +9947,13 @@ void BailOut(Bool_t finalBailout = kFALSE) TString sBailOutFile = "AnalysisResultsBailOut.root"; TString sDirectoryFile = "multiparticle-correlations-a-b"; - // *) For sequential bailout, I need to adapt the ROOT file name, each time this function is called: + // *) For sequential bailout, I need to adapt the ROOT file name each time this function is called: if (tc.fSequentialBailout > 0) { sBailOutFile.ReplaceAll(".root", Form("_%d.root", eh.fEventCounter[eProcessed])); // replaces in-place // basically, at 1st call "AnalysisResultsBailOut.root" => "AnalysisResultsBailOut_1*eh.fEventCounter[eProcessed].root", // at 2nd call "AnalysisResultsBailOut.root" => "AnalysisResultsBailOut_2*eh.fEventCounter[eProcessed].root", etc. if (!finalBailout && !gSystem->AccessPathName(sBailOutFile.Data(), kFileExists)) { // only for finalBailout = kTRUE, I will overwrite the existing file with the same name. - LOGF(info, "\033[1;33m\nsBailOutFile = %s already exits, that means that eh.fEventCounter[eProcessed] is the same as in the previous call of BailOut.\nJust skipping and waiting more event to pass selection criteria... \033[0m", sBailOutFile.Data()); + LOGF(info, "\033[1;33m\nsBailOutFile = %s already exits, that means that eh.fEventCounter[eProcessed] is the same as in the previous call of BailOut.\nJust skipping and waiting more events to pass selection criteria... \033[0m", sBailOutFile.Data()); return; } } @@ -9681,7 +9966,7 @@ void BailOut(Bool_t finalBailout = kFALSE) // *) Okay, let's bail out intentionally: TFile* f = new TFile(sBailOutFile.Data(), "recreate"); TDirectoryFile* dirFile = new TDirectoryFile(sDirectoryFile.Data(), sDirectoryFile.Data()); - // TBI 20240130 I cannot add here fBaseList directtly, since that one is declared as OutputObj + // TBI 20240130 I cannot add here fBaseList directly, since that one is declared as OutputObj // Therefore, adding one-by-one nested TList's I want to bail out. // Keep in sync with BookAndNestAllLists(). TList* bailOutList = new TList(); // this is sort of 'fake' fBaseList @@ -9696,6 +9981,7 @@ void BailOut(Bool_t finalBailout = kFALSE) bailOutList->Add(qv.fQvectorList); bailOutList->Add(mupa.fCorrelationsList); bailOutList->Add(pw.fWeightsList); + bailOutList->Add(cw.fCentralityWeightsList); bailOutList->Add(nl.fNestedLoopsList); bailOutList->Add(nua.fNUAList); bailOutList->Add(iv.fInternalValidationList); @@ -9952,129 +10238,6 @@ void CalculateEverything() //============================================================ -template -void Steer(T1 const& collision, T2 const& tracks) -{ - // This is the only function to be called in processRec(...), processRecSim(...), and processSim(...). - // All analysis workflow is defined step-by-step here, via dedicated function calls. - // The order of function calls obviously matters. - - if (tc.fVerbose) { - StartFunction(__FUNCTION__); - } - - // *) Dry run: - if (tc.fDryRun) { - EventCounterForDryRun(eFill); - EventCounterForDryRun(ePrint); - Preprocess(collision); // yes, so that e.g. I can only test if the weights were correctly fetched from external file and initialized locally into data members - return; - } - - // *) Reset event-by-event quantities: TBI 20240430 I do not need this call also here really, but it doesn't hurt either... - ResetEventByEventQuantities(); - - // *) Only do internal validation for all implemented correlators against the theoretical values: - if (iv.fUseInternalValidation) { - InternalValidation(); - return; - } - - // *) Global timestamp: - if (tc.fUseStopwatch) { - LOGF(info, "\033[1;32m=> Global timer: Steer begins ... %.6f\033[0m", tc.fTimer[eGlobal]->RealTime()); - tc.fTimer[eGlobal]->Continue(); // yes - } - - // *) Do all thingies before starting to process data from this collision (e.g. cut on number of events (both total and selected), fetch the run number, etc.): - Preprocess(collision); - - // *) Determine collision centrality: - DetermineCentrality(collision); - - // *) Determine collision occupancy: - DetermineOccupancy(collision); - - // *) Fill event histograms before event cuts: - if (eh.fFillEventHistograms || qa.fFillQAEventHistograms2D) { - FillEventHistograms(collision, tracks, eBefore); - } - - // *) Print info on the current event number (total, before cuts): - PrintEventCounter(eBefore); - - // *) Event cuts counters (use only during QA, as this is computationally heavy): - if (ec.fUseEventCutCounterAbsolute || ec.fUseEventCutCounterSequential) { - EventCutsCounters(collision, tracks); - } - - // *) Event cuts: - if (!EventCuts(collision, tracks, eCut)) { // Main call for event cuts - return; - } - - // *) Main loop over particles: - MainLoopOverParticles(tracks); - - // *) Remaining event cuts which can be applied only after the loop over particles is performed: - if ((ebye.fSelectedTracks < ec.fdEventCuts[eSelectedTracks][eMin]) || (ebye.fSelectedTracks > ec.fdEventCuts[eSelectedTracks][eMax])) { - if (tc.fVerbose) { - LOGF(info, "\033[1;31m%s eSelectedTracks \033[0m", __FUNCTION__); - } - // **) Special treatment for event cut counter: - // TBI 20240514 not sure if everything is done here correctly. Do some additional validation checks, and them move all this to some dedicated member function, e.g. RemainingEventCuts() - if (tc.fProcess[eGenericRec] || tc.fProcess[eGenericRecSim]) { - EventCut(eRec, eSelectedTracks, eCutCounterSequential); - } - if (tc.fProcess[eGenericSim] || tc.fProcess[eGenericRecSim]) { - EventCut(eSim, eSelectedTracks, eCutCounterSequential); - } - - // TBI 20240514 Do I need to do here also something about particle cut counters? Most likely yes, but it's not that important, really - - BanishmentLoopOverParticles(tracks); // yes, I need to remove particles from ParticleHistograms, which were filled in the MainLoopOverParticles also for events < eSelectedTracks - ResetEventByEventQuantities(); - return; - } - - // *) Fill event histograms after event AND particle cuts: // TBI 20240110 not sure still if this one is called here, or it has to be moved above - if (eh.fFillEventHistograms || qa.fFillQAEventHistograms2D) { - FillEventHistograms(collision, tracks, eAfter); - } - - // *) Calculate everything for selected events and particles: - CalculateEverything(); - - // *) Reset event-by-event quantities: - ResetEventByEventQuantities(); - - // *) QA: - if (qa.fCheckUnderflowAndOverflow) { // TBI 20240507 introduce eventualy common function QA(), within which I will call all specific QA functions - CheckUnderflowAndOverflow(); - } - - // *) Print info on the current event number after cuts: - PrintEventCounter(eAfter); - - // *) Per request, print content of event cut counters: - if (ec.fPrintCutCounterContent) { - PrintCutCounterContent(); - } - - // *) Global timestamp: - if (tc.fUseStopwatch) { - LOGF(info, "\033[1;32m=> Global timer: Steer ends ... %.6f\033[0m\n", tc.fTimer[eGlobal]->RealTime()); - tc.fTimer[eGlobal]->Continue(); // yes - } - - if (tc.fVerbose) { - ExitFunction(__FUNCTION__); - } - -} // template void Steer(T1 const* collision, T2 const* tracks) - -//============================================================ - template void MainLoopOverParticles(T const& tracks) { @@ -10181,7 +10344,7 @@ void MainLoopOverParticles(T const& tracks) // *) Counter of selected tracks in the current event: ebye.fSelectedTracks++; - if (ebye.fSelectedTracks >= ec.fdEventCuts[eSelectedTracks][eMax]) { + if (ebye.fSelectedTracks >= ec.fdEventCuts[eMultiplicity][eMax]) { break; } @@ -10209,4 +10372,137 @@ void MainLoopOverParticles(T const& tracks) } } // template void MainLoopOverParticles(T const& tracks) { +//============================================================ + +template +void Steer(T1 const& collision, T2 const& tracks) +{ + // This is the only function to be called in processRec(...), processRecSim(...), and processSim(...). + // All analysis workflow is defined step-by-step here, via dedicated function calls. + // The order of function calls obviously matters. + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // *) Dry run: + if (tc.fDryRun) { + EventCounterForDryRun(eFill); + EventCounterForDryRun(ePrint); + Preprocess(collision); // yes, so that e.g. I can only test if the particle and centrality weights were correctly fetched from external file and initialized locally into data members + return; + } + + // *) Reset event-by-event quantities: TBI 20240430 I do not need this call also here really, but it doesn't hurt either... + ResetEventByEventQuantities(); + + // *) Only do internal validation for all implemented correlators against the theoretical values: + if (iv.fUseInternalValidation) { + InternalValidation(); + return; + } + + // *) Global timestamp: + if (tc.fUseStopwatch) { + LOGF(info, "\033[1;32m=> Global timer: Steer begins ... %.6f\033[0m", tc.fTimer[eGlobal]->RealTime()); + tc.fTimer[eGlobal]->Continue(); // yes + } + + // *) Do all thingies before starting to process data from this collision (e.g. cut on number of events (both total and selected), fetch the run number, etc.): + Preprocess(collision); + + // *) Determine collision reference multiplicity: + DetermineReferenceMultiplicity(collision); + + // *) Determine collision centrality: + DetermineCentrality(collision); + + // *) Determine collision occupancy: + DetermineOccupancy(collision); + + // *) Fill event histograms before event cuts: + if (eh.fFillEventHistograms || qa.fFillQAEventHistograms2D) { + FillEventHistograms(collision, tracks, eBefore); + } + + // *) Print info on the current event number (total, before cuts): + if (tc.fVerboseEventCounter) { + PrintEventCounter(eBefore); + } + + // *) Event cuts counters (use only during QA, as this is computationally heavy): + if (ec.fUseEventCutCounterAbsolute || ec.fUseEventCutCounterSequential) { + EventCutsCounters(collision, tracks); + } + + // *) Event cuts: + if (!EventCuts(collision, tracks, eCut)) { // Main call for event cuts + return; + } + + // *) Main loop over particles: + MainLoopOverParticles(tracks); + + // *) Determine multiplicity of this event, for all "vs. mult" results: + DetermineMultiplicity(); + + // *) Remaining event cuts which can be applied only after the loop over particles is performed: + if (ebye.fMultiplicity < ec.fdEventCuts[eMultiplicity][eMin] || ebye.fMultiplicity > ec.fdEventCuts[eMultiplicity][eMax] || TMath::Abs(ebye.fMultiplicity - ec.fdEventCuts[eMultiplicity][eMax]) < tc.fFloatingPointPrecision) { + if (tc.fVerbose) { + LOGF(info, "\033[1;31m%s eMultiplicity \033[0m", __FUNCTION__); + } + // **) Special treatment for event cut counter: + // TBI 20240514 not sure if everything is done here correctly. Do some additional validation checks, and them move all this to some dedicated member function, e.g. RemainingEventCuts() + if (tc.fProcess[eGenericRec] || tc.fProcess[eGenericRecSim]) { + EventCut(eRec, eMultiplicity, eCutCounterSequential); + } + if (tc.fProcess[eGenericSim] || tc.fProcess[eGenericRecSim]) { + EventCut(eSim, eMultiplicity, eCutCounterSequential); + } + + // TBI 20240514 Do I need to do here also something about particle cut counters? Most likely yes, but it's not that important, really + + BanishmentLoopOverParticles(tracks); // yes, I need to remove particles from ParticleHistograms, which were filled in the MainLoopOverParticles also for events < eMultiplicity + ResetEventByEventQuantities(); + return; + } + + // *) Fill event histograms after event AND particle cuts: // TBI 20240110 not sure still if this one is called here, or it has to be moved above + if (eh.fFillEventHistograms || qa.fFillQAEventHistograms2D) { + FillEventHistograms(collision, tracks, eAfter); + } + + // *) Calculate everything for selected events and particles: + CalculateEverything(); + + // *) Reset event-by-event quantities: + ResetEventByEventQuantities(); + + // *) QA: + if (qa.fCheckUnderflowAndOverflow) { // TBI 20240507 introduce eventualy common function QA(), within which I will call all specific QA functions + CheckUnderflowAndOverflow(); + } + + // *) Print info on the current event number after cuts: + if (tc.fVerboseEventCounter) { + PrintEventCounter(eAfter); + } + + // *) Per request, print content of event cut counters: + if (ec.fPrintCutCounterContent) { + PrintCutCounterContent(); + } + + // *) Global timestamp: + if (tc.fUseStopwatch) { + LOGF(info, "\033[1;32m=> Global timer: Steer ends ... %.6f\033[0m\n", tc.fTimer[eGlobal]->RealTime()); + tc.fTimer[eGlobal]->Continue(); // yes + } + + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // template void Steer(T1 const* collision, T2 const* tracks) + #endif // PWGCF_MULTIPARTICLECORRELATIONS_CORE_MUPA_MEMBERFUNCTIONS_H_ diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx index fd0b3942024..b7f502c42e2 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx @@ -27,6 +27,8 @@ using namespace o2::framework; using EventSelection = soa::Join; using CollisionRec = soa::Join::iterator; // use in json "isMC": "true" for "event-selection-task" using CollisionRecSim = soa::Join::iterator; +// using CollisionRecSim = soa::Join::iterator; +// using CollisionRecSim = soa::Join::iterator; using CollisionSim = aod::McCollision; using TracksRec = soa::Join; using TrackRec = soa::Join::iterator; @@ -113,8 +115,13 @@ struct MultiparticleCorrelationsAB // this name is used in lower-case format to // or values for cuts provided via configurables are taken into account // Remark: DefaultCuts() has to be called after DefaultBinning() + // *) Specific cuts: + if (tc.fUseSpecificCuts) { + SpecificCuts(tc.fWhichSpecificCuts); // after default cuts are applied, on top of them apply analysis-specific cuts. Has to be called after DefaultBinning() and DefaultCuts() + } + // *) Insanity checks before booking: - InsanityChecksBeforeBooking(); // check only harwired values and the ones obtained from configurables + InsanityChecksBeforeBooking(); // check only hardwired values and the ones obtained from configurables // *) Book random generator: delete gRandom; From 01c3b8c05363c07823070b7666bf4b6777ab0122 Mon Sep 17 00:00:00 2001 From: Sasha Bylinkin <37345380+abylinkin@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:37:11 +0100 Subject: [PATCH 108/459] [PWGUD] Added deuterons and TOF into personal PID task (#8644) --- PWGUD/Tasks/sgPIDAnalyzer.cxx | 138 ++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/PWGUD/Tasks/sgPIDAnalyzer.cxx b/PWGUD/Tasks/sgPIDAnalyzer.cxx index 0d043f546af..2ed954bf744 100644 --- a/PWGUD/Tasks/sgPIDAnalyzer.cxx +++ b/PWGUD/Tasks/sgPIDAnalyzer.cxx @@ -73,28 +73,86 @@ struct sgPIDAnalyzer { histos.add("TPC/pTPC_Pi_Ka", "Positive TPC Pi vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_Pi_Pr", "Positive TPC Pi vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_Pi_El", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTPC_Pi_De", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_Ka_Pi", "Positive TPC Ka vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_Ka_Pr", "Positive TPC Ka vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_Ka_El", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTPC_Ka_De", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_Pr_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_Pr_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_Pr_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTPC_Pr_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_El_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_El_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_El_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTPC_El_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTPC_De_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTPC_De_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTPC_De_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTPC_De_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_Pi_Ka", "Positive TPC Pi vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_Pi_Pr", "Positive TPC Pi vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_Pi_El", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTPC_Pi_De", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_Ka_Pi", "Positive TPC Ka vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_Ka_Pr", "Positive TPC Ka vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_Ka_El", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTPC_Ka_De", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_Pr_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_Pr_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_Pr_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTPC_Pr_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_El_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_El_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_El_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTPC_El_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTPC_De_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTPC_De_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTPC_De_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTPC_De_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + + histos.add("TPC/pTOF_Pi_Ka", "Positive TPC Pi vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_Pi_Pr", "Positive TPC Pi vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_Pi_El", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_Pi_De", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_Ka_Pi", "Positive TPC Ka vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_Ka_Pr", "Positive TPC Ka vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_Ka_El", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_Ka_De", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_Pr_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_Pr_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_Pr_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_Pr_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_El_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_El_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_El_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_El_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_De_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_De_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_De_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/pTOF_De_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + + histos.add("TPC/nTOF_Pi_Ka", "Positive TPC Pi vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_Pi_Pr", "Positive TPC Pi vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_Pi_El", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_Pi_De", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_Ka_Pi", "Positive TPC Ka vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_Ka_Pr", "Positive TPC Ka vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_Ka_El", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_Ka_De", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_Pr_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_Pr_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_Pr_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_Pr_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_El_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_El_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_El_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_El_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_De_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_De_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_De_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TPC/nTOF_De_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TOF/pPi", "Positive TPC Pi vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); histos.add("TOF/nPi", "Negative TPC Pi vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); @@ -139,21 +197,31 @@ struct sgPIDAnalyzer { histos.fill(HIST("TPC/pTPC_Ka_Pi"), track.pt(), track.tpcka()); histos.fill(HIST("TPC/pTPC_Pr_Pi"), track.pt(), track.tpcpr()); histos.fill(HIST("TPC/pTPC_El_Pi"), track.pt(), track.tpcel()); + histos.fill(HIST("TPC/pTPC_De_Pi"), track.pt(), track.tpcde()); } if (std::abs(track.tpcka()) < 1) { histos.fill(HIST("TPC/pTPC_Pi_Ka"), track.pt(), track.tpcpi()); histos.fill(HIST("TPC/pTPC_Pr_Ka"), track.pt(), track.tpcpr()); histos.fill(HIST("TPC/pTPC_El_Ka"), track.pt(), track.tpcel()); + histos.fill(HIST("TPC/pTPC_De_Ka"), track.pt(), track.tpcde()); } if (std::abs(track.tpcpr()) < 1) { histos.fill(HIST("TPC/pTPC_Pi_Pr"), track.pt(), track.tpcpi()); histos.fill(HIST("TPC/pTPC_Ka_Pr"), track.pt(), track.tpcka()); histos.fill(HIST("TPC/pTPC_El_Pr"), track.pt(), track.tpcel()); + histos.fill(HIST("TPC/pTPC_De_Pr"), track.pt(), track.tpcde()); } if (std::abs(track.tpcel()) < 1) { histos.fill(HIST("TPC/pTPC_Pi_El"), track.pt(), track.tpcpi()); histos.fill(HIST("TPC/pTPC_Ka_El"), track.pt(), track.tpcka()); histos.fill(HIST("TPC/pTPC_Pr_El"), track.pt(), track.tpcpr()); + histos.fill(HIST("TPC/pTPC_De_El"), track.pt(), track.tpcde()); + } + if (std::abs(track.tpcde()) < 1) { + histos.fill(HIST("TPC/pTPC_Pi_De"), track.pt(), track.tpcpi()); + histos.fill(HIST("TPC/pTPC_Ka_De"), track.pt(), track.tpcka()); + histos.fill(HIST("TPC/pTPC_Pr_De"), track.pt(), track.tpcpr()); + histos.fill(HIST("TPC/pTPC_El_De"), track.pt(), track.tpcel()); } } else { histos.fill(HIST("TPC/nTPC_Pi"), track.pt(), track.tpcpi()); @@ -169,21 +237,31 @@ struct sgPIDAnalyzer { histos.fill(HIST("TPC/nTPC_Ka_Pi"), track.pt(), track.tpcka()); histos.fill(HIST("TPC/nTPC_Pr_Pi"), track.pt(), track.tpcpr()); histos.fill(HIST("TPC/nTPC_El_Pi"), track.pt(), track.tpcel()); + histos.fill(HIST("TPC/nTPC_De_Pi"), track.pt(), track.tpcde()); } if (std::abs(track.tpcka()) < 1) { histos.fill(HIST("TPC/nTPC_Pi_Ka"), track.pt(), track.tpcpi()); histos.fill(HIST("TPC/nTPC_Pr_Ka"), track.pt(), track.tpcpr()); histos.fill(HIST("TPC/nTPC_El_Ka"), track.pt(), track.tpcel()); + histos.fill(HIST("TPC/nTPC_De_Ka"), track.pt(), track.tpcde()); } if (std::abs(track.tpcpr()) < 1) { histos.fill(HIST("TPC/nTPC_Pi_Pr"), track.pt(), track.tpcpi()); histos.fill(HIST("TPC/nTPC_Ka_Pr"), track.pt(), track.tpcka()); histos.fill(HIST("TPC/nTPC_El_Pr"), track.pt(), track.tpcel()); + histos.fill(HIST("TPC/nTPC_De_Pr"), track.pt(), track.tpcde()); } if (std::abs(track.tpcel()) < 1) { histos.fill(HIST("TPC/nTPC_Pi_El"), track.pt(), track.tpcpi()); histos.fill(HIST("TPC/nTPC_Ka_El"), track.pt(), track.tpcka()); histos.fill(HIST("TPC/nTPC_Pr_El"), track.pt(), track.tpcpr()); + histos.fill(HIST("TPC/nTPC_De_El"), track.pt(), track.tpcde()); + } + if (std::abs(track.tpcde()) < 1) { + histos.fill(HIST("TPC/nTPC_Pi_De"), track.pt(), track.tpcpi()); + histos.fill(HIST("TPC/nTPC_Ka_De"), track.pt(), track.tpcka()); + histos.fill(HIST("TPC/nTPC_Pr_De"), track.pt(), track.tpcpr()); + histos.fill(HIST("TPC/nTPC_El_De"), track.pt(), track.tpcel()); } } } else { @@ -197,6 +275,36 @@ struct sgPIDAnalyzer { histos.fill(HIST("TOF/pHe"), track.pt(), track.tpcpr(), track.tofhe()); histos.fill(HIST("TOF/pAl"), track.pt(), track.tpcel(), track.tofal()); histos.fill(HIST("TOF/pMu"), track.pt(), track.tpcel(), track.tofmu()); + if (std::abs(track.tofpi()) < 1) { + histos.fill(HIST("TOF/pTOF_Ka_Pi"), track.pt(), track.tofka()); + histos.fill(HIST("TOF/pTOF_Pr_Pi"), track.pt(), track.tofpr()); + histos.fill(HIST("TOF/pTOF_El_Pi"), track.pt(), track.tofel()); + histos.fill(HIST("TPF/pTOF_De_Pi"), track.pt(), track.tofde()); + } + if (std::abs(track.tofka()) < 1) { + histos.fill(HIST("TOF/pTOF_Pi_Ka"), track.pt(), track.tofpi()); + histos.fill(HIST("TOF/pTOF_Pr_Ka"), track.pt(), track.tofpr()); + histos.fill(HIST("TOF/pTOF_El_Ka"), track.pt(), track.tofel()); + histos.fill(HIST("TOF/pTOF_De_Ka"), track.pt(), track.tofde()); + } + if (std::abs(track.tofpr()) < 1) { + histos.fill(HIST("TOF/pTOF_Pi_Pr"), track.pt(), track.tofpi()); + histos.fill(HIST("TOF/pTOF_Ka_Pr"), track.pt(), track.tofka()); + histos.fill(HIST("TOF/pTOF_El_Pr"), track.pt(), track.tofel()); + histos.fill(HIST("TOF/pTOF_De_Pr"), track.pt(), track.tofde()); + } + if (std::abs(track.tofel()) < 1) { + histos.fill(HIST("TOF/pTOF_Pi_El"), track.pt(), track.tofpi()); + histos.fill(HIST("TOF/pTOF_Ka_El"), track.pt(), track.tofka()); + histos.fill(HIST("TOF/pTOF_Pr_El"), track.pt(), track.tofpr()); + histos.fill(HIST("TOF/pTOF_De_El"), track.pt(), track.tofde()); + } + if (std::abs(track.tofde()) < 1) { + histos.fill(HIST("TOF/pTOF_Pi_De"), track.pt(), track.tofpi()); + histos.fill(HIST("TOF/pTOF_Ka_De"), track.pt(), track.tofka()); + histos.fill(HIST("TOF/pTOF_Pr_De"), track.pt(), track.tofpr()); + histos.fill(HIST("TOF/pTOF_El_De"), track.pt(), track.tofel()); + } } else { histos.fill(HIST("TOF/nPi"), track.pt(), track.tpcpi(), track.tofpi()); histos.fill(HIST("TOF/nKa"), track.pt(), track.tpcka(), track.tofka()); @@ -207,6 +315,36 @@ struct sgPIDAnalyzer { histos.fill(HIST("TOF/nHe"), track.pt(), track.tpcpr(), track.tofhe()); histos.fill(HIST("TOF/nAl"), track.pt(), track.tpcel(), track.tofal()); histos.fill(HIST("TOF/nMu"), track.pt(), track.tpcel(), track.tofmu()); + if (std::abs(track.tofpi()) < 1) { + histos.fill(HIST("TOF/nTOF_Ka_Pi"), track.pt(), track.tofka()); + histos.fill(HIST("TOF/nTOF_Pr_Pi"), track.pt(), track.tofpr()); + histos.fill(HIST("TOF/nTOF_El_Pi"), track.pt(), track.tofel()); + histos.fill(HIST("TPF/nTOF_De_Pi"), track.pt(), track.tofde()); + } + if (std::abs(track.tofka()) < 1) { + histos.fill(HIST("TOF/nTOF_Pi_Ka"), track.pt(), track.tofpi()); + histos.fill(HIST("TOF/nTOF_Pr_Ka"), track.pt(), track.tofpr()); + histos.fill(HIST("TOF/nTOF_El_Ka"), track.pt(), track.tofel()); + histos.fill(HIST("TOF/nTOF_De_Ka"), track.pt(), track.tofde()); + } + if (std::abs(track.tofpr()) < 1) { + histos.fill(HIST("TOF/nTOF_Pi_Pr"), track.pt(), track.tofpi()); + histos.fill(HIST("TOF/nTOF_Ka_Pr"), track.pt(), track.tofka()); + histos.fill(HIST("TOF/nTOF_El_Pr"), track.pt(), track.tofel()); + histos.fill(HIST("TOF/nTOF_De_Pr"), track.pt(), track.tofde()); + } + if (std::abs(track.tofel()) < 1) { + histos.fill(HIST("TOF/nTOF_Pi_El"), track.pt(), track.tofpi()); + histos.fill(HIST("TOF/nTOF_Ka_El"), track.pt(), track.tofka()); + histos.fill(HIST("TOF/nTOF_Pr_El"), track.pt(), track.tofpr()); + histos.fill(HIST("TOF/nTOF_De_El"), track.pt(), track.tofde()); + } + if (std::abs(track.tofde()) < 1) { + histos.fill(HIST("TOF/nTOF_Pi_De"), track.pt(), track.tofpi()); + histos.fill(HIST("TOF/nTOF_Ka_De"), track.pt(), track.tofka()); + histos.fill(HIST("TOF/nTOF_Pr_De"), track.pt(), track.tofpr()); + histos.fill(HIST("TOF/nTOF_El_De"), track.pt(), track.tofel()); + } } } } From 576c6124cf8bddca4ae7f3ab1f33c3d6a828c82c Mon Sep 17 00:00:00 2001 From: Francesca Ercolessi Date: Tue, 26 Nov 2024 15:37:27 +0100 Subject: [PATCH 109/459] [ALICE3] TOF-PID extend axis for pT and nsigma (#8659) --- ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx b/ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx index 39ace42c926..3a907d47342 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTOFPID.cxx @@ -81,6 +81,8 @@ struct OnTheFlyTOFPID { Configurable nBinsTrackDeltaLength{"nBinsTrackDeltaLength", 100, "number of bins in delta track length"}; Configurable nBinsNsigmaCorrectSpecies{"nBinsNsigmaCorrectSpecies", 200, "number of bins in Nsigma plot (correct speies)"}; Configurable nBinsNsigmaWrongSpecies{"nBinsNsigmaWrongSpecies", 200, "number of bins in Nsigma plot (wrong species)"}; + Configurable minNsigmaRange{"minNsigmaRange", -10, "lower limit for the nsigma axis"}; + Configurable maxNsigmaRange{"maxNsigmaRange", +10, "upper limit for the nsigma axis"}; Configurable nBinsTimeRes{"nBinsTimeRes", 400, "number of bins plots time resolution"}; Configurable nBinsRelativeEtaPt{"nBinsRelativeEtaPt", 400, "number of bins plots pt and eta relative errors"}; Configurable nBinsEta{"nBinsEta", 400, "number of bins plot relative eta error"}; @@ -138,7 +140,7 @@ struct OnTheFlyTOFPID { } if (doQAplots) { - const AxisSpec axisMomentum{static_cast(nBinsP), 0.0f, +4.0f, "#it{p} (GeV/#it{c})"}; + const AxisSpec axisMomentum{static_cast(nBinsP), 0.0f, +10.0f, "#it{p} (GeV/#it{c})"}; const AxisSpec axisMomentumSmall{static_cast(nBinsP), 0.0f, +1.0f, "#it{p} (GeV/#it{c})"}; const AxisSpec axisVelocity{static_cast(nBinsBeta), 0.0f, +1.1f, "Measured #beta"}; const AxisSpec axisTrackLengthInner{static_cast(nBinsTrackLengthInner), 0.0f, 60.0f, "Track length (cm)"}; @@ -182,11 +184,11 @@ struct OnTheFlyTOFPID { std::string name_title_inner = "h2dInnerNsigmaTrue" + particle_names2[i_true] + "Vs" + particle_names2[i_hyp] + "Hypothesis"; std::string name_title_outer = "h2dOuterNsigmaTrue" + particle_names2[i_true] + "Vs" + particle_names2[i_hyp] + "Hypothesis"; if (i_true == i_hyp) { - const AxisSpec axisNsigmaCorrect{static_cast(nBinsNsigmaCorrectSpecies), -10.0f, +10.0f, "N#sigma - True " + particle_names1[i_true] + " vs " + particle_names1[i_hyp] + " hypothesis"}; + const AxisSpec axisNsigmaCorrect{static_cast(nBinsNsigmaCorrectSpecies), minNsigmaRange, maxNsigmaRange, "N#sigma - True " + particle_names1[i_true] + " vs " + particle_names1[i_hyp] + " hypothesis"}; histos.add(name_title_inner.c_str(), name_title_inner.c_str(), kTH2F, {axisMomentum, axisNsigmaCorrect}); histos.add(name_title_outer.c_str(), name_title_outer.c_str(), kTH2F, {axisMomentum, axisNsigmaCorrect}); } else { - const AxisSpec axisNsigmaWrong{static_cast(nBinsNsigmaWrongSpecies), -10.0f, +10.0f, "N#sigma - True " + particle_names1[i_true] + " vs " + particle_names1[i_hyp] + " hypothesis"}; + const AxisSpec axisNsigmaWrong{static_cast(nBinsNsigmaWrongSpecies), minNsigmaRange, maxNsigmaRange, "N#sigma - True " + particle_names1[i_true] + " vs " + particle_names1[i_hyp] + " hypothesis"}; histos.add(name_title_inner.c_str(), name_title_inner.c_str(), kTH2F, {axisMomentum, axisNsigmaWrong}); histos.add(name_title_outer.c_str(), name_title_outer.c_str(), kTH2F, {axisMomentum, axisNsigmaWrong}); } From 399facc0af214acd3fc17d1fd70892ccb04e02dc Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:37:41 +0100 Subject: [PATCH 110/459] [PWGCF] FemtoUniverse: From modular to nested filling of trks (#8645) --- .../femtoUniverseProducerTask.cxx | 64 ++++++++++++++----- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index b2438f3a1b4..ad0b59185de 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -22,6 +22,7 @@ #include #include +#include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" @@ -101,6 +102,7 @@ int getRowDaughters(int daughID, T const& vecID) struct femtoUniverseProducerTask { Produces outputCollision; + Produces outputCollExtra; Produces outputParts; Produces outputPartsMC; Produces outputDebugParts; @@ -178,6 +180,7 @@ struct femtoUniverseProducerTask { // V0 FemtoUniverseV0Selection v0Cuts; struct : o2::framework::ConfigurableGroup { + Configurable ConfIsFillV0s{"ConfIsFillV0s", false, "Choice to fill V0s"}; Configurable> ConfV0Sign{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0Sign, "ConfV0"), std::vector{-1, 1}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0Sign, "V0 selection: ")}; Configurable> ConfV0PtMin{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0pTMin, "ConfV0"), std::vector{0.3f, 0.4f, 0.5f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0pTMin, "V0 selection: ")}; Configurable> ConfV0PtMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0pTMax, "ConfV0"), std::vector{3.3f, 3.4f, 3.5f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0pTMax, "V0 selection: ")}; @@ -226,6 +229,7 @@ struct femtoUniverseProducerTask { // CASCADE FemtoUniverseCascadeSelection cascadeCuts; struct : o2::framework::ConfigurableGroup { + Configurable ConfIsFillCascades{"ConfIsFillCascades", false, "Choice to fill cascades"}; Configurable> ConfCascSign{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeSign, "ConfCasc"), std::vector{-1, 1}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeSign, "Cascade selection: ")}; Configurable> ConfCascPtMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadepTMin, "ConfCasc"), std::vector{0.3f, 0.4f, 0.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadepTMin, "Cascade selection: ")}; Configurable> ConfCascPtMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadepTMax, "ConfCasc"), std::vector{3.3f, 3.4f, 3.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadepTMax, "Cascade selection: ")}; @@ -438,16 +442,17 @@ struct femtoUniverseProducerTask { HistogramRegistry qaRegistry{"QAHistos", {}, OutputObjHandlingPolicy::QAObject}; HistogramRegistry cascadeQaRegistry{"CascadeQAHistos", {}, OutputObjHandlingPolicy::QAObject}; - int mRunNumber; + int mRunNumber = 0; float mMagField; Service ccdb; /// Accessing the CCDB + ctpRateFetcher mRateFetcher; // inspired by zdcSP.cxx in PWGLF void init(InitContext&) { - if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data || doprocessTrackV0CentRun3) == false && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == false) { + if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data) == false && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == false) { LOGF(fatal, "Neither processFullData nor processFullMC enabled. Please choose one."); } - if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data || doprocessTrackV0CentRun3) == true && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == true) { + if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data) == true && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == true) { LOGF(fatal, "Cannot enable process Data and process MC at the same time. " "Please choose one."); @@ -843,8 +848,8 @@ struct femtoUniverseProducerTask { } } - template - void fillCollisionsCentRun3(CollisionType const& col, TrackType const& tracks) + template + void fillCollisionsCentRun3(CollisionType const& col, TrackType const& tracks, V0Type const& fullV0s, CascadeType const& fullCascades, double irrate) { const auto vtxZ = col.posZ(); int cent = 0; @@ -871,9 +876,26 @@ struct femtoUniverseProducerTask { } else { outputCollision(vtxZ, cent, multNtr, 2, mMagField); } + + fillCollisionsCentRun3ColExtra(col, irrate); + + fillTracks(tracks); + if (ConfV0Selection.ConfIsFillV0s) { + fillV0(col, fullV0s, tracks); + } + if (ConfCascadeSelection.ConfIsFillCascades) { + fillCascade(col, fullCascades, tracks); + } } } + template + void fillCollisionsCentRun3ColExtra(CollisionType const& col, double irrate) + { + int occupancy = col.trackOccupancyInTimeRange(); + outputCollExtra(irrate, occupancy); + } + template void fillTracks(TrackType const& tracks) { @@ -1586,7 +1608,7 @@ struct femtoUniverseProducerTask { } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackCascadeData, "Provide experimental data for track cascades", false); - void processTrackV0CentRun3(aod::FemtoFullCollisionCentRun3 const& col, + /*void processTrackV0CentRun3(aod::FemtoFullCollisionCentRun3 const& col, aod::BCsWithTimestamps const&, soa::Filtered const& tracks, o2::aod::V0Datas const& fullV0s) @@ -1594,11 +1616,11 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisionsCentRun3(col, tracks); + fillCollisionsCentRun3(col, tracks, fullV0s); fillTracks(tracks); fillV0(col, fullV0s, tracks); } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackV0CentRun3, "Provide experimental data for track v0", false); + PROCESS_SWITCH(femtoUniverseProducerTask, processTrackV0CentRun3, "Provide experimental data for track v0", false);*/ void processFullMC(aod::FemtoFullCollisionMC const& col, aod::BCsWithTimestamps const&, @@ -1761,14 +1783,17 @@ struct femtoUniverseProducerTask { soa::Join const& tracks, aod::McCollisions const&, aod::McParticles const&, - soa::Join const& fullV0s) + soa::Join const& fullV0s, + soa::Join const& fullCascades) { // get magnetic field for run - getMagneticFieldTesla(col.bc_as()); + auto bc = col.bc_as(); + getMagneticFieldTesla(bc); + double ir = 0.; + ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR + // fill the tables - fillCollisionsCentRun3(col, tracks); - fillTracks(tracks); - fillV0(col, fullV0s, tracks); + fillCollisionsCentRun3(col, tracks, fullV0s, fullCascades, ir); } PROCESS_SWITCH(femtoUniverseProducerTask, processFullMCCent, "Provide MC data with centrality bins", false); @@ -1786,13 +1811,18 @@ struct femtoUniverseProducerTask { void processTrackCentRun3Data(aod::FemtoFullCollisionCentRun3 const& col, aod::BCsWithTimestamps const&, - soa::Filtered const& tracks) + soa::Filtered const& tracks, + aod::V0Datas const& fullV0s, + aod::CascDatas const& fullCascades) { // get magnetic field for run - getMagneticFieldTesla(col.bc_as()); + auto bc = col.bc_as(); + getMagneticFieldTesla(bc); + double ir = 0.; + ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR + // fill the tables - fillCollisionsCentRun3(col, tracks); - fillTracks(tracks); + fillCollisionsCentRun3(col, tracks, fullV0s, fullCascades, ir); } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackCentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); }; From 3dcd4d6512cfccf1655fbcbbff66080715b8f6b1 Mon Sep 17 00:00:00 2001 From: shaidlov <109801990+Edingrast@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:38:08 +0100 Subject: [PATCH 111/459] [PWGUD] addition of MC and code cleanup (#8654) --- PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h | 25 +- PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx | 789 +++++++++++--------- 2 files changed, 455 insertions(+), 359 deletions(-) diff --git a/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h b/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h index df0f4d0c260..0857d6bab1d 100644 --- a/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h +++ b/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h @@ -16,21 +16,23 @@ #ifndef PWGUD_CORE_UPCJPSICENTRALBARRELCORRHELPER_H_ #define PWGUD_CORE_UPCJPSICENTRALBARRELCORRHELPER_H_ +#include #include #include "CommonConstants/MathConstants.h" +#include "random" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace std; -enum ParticleType { +/*enum ParticleType { P_ELECTRON = 0, P_MUON = 1, P_PROTON = 2 -}; +};*/ -template +/*template int testPIDhypoTPC(T trackPID) { float nSigmaTPC[3]; @@ -71,7 +73,7 @@ int testPIDhypo(T trackPID) } else { return -1; } -} +}*/ float* correlation(TLorentzVector* lv1, TLorentzVector* lv2, TLorentzVector* lv) { @@ -217,4 +219,19 @@ double DeltaPhi(TLorentzVector lv1, TLorentzVector lv2) return dp; } +double DeltaPhiRandom(TLorentzVector lv1, TLorentzVector lv2) +{ + std::vector indices = {0, 1}; + unsigned seed = std::chrono::system_clock::now().time_since_epoch().count(); + std::shuffle(indices.begin(), indices.end(), std::default_random_engine(seed)); + std::array arrayLorentz = {lv1, lv2}; + TLorentzVector lv_sum = arrayLorentz[indices[0]] + arrayLorentz[indices[1]]; + TLorentzVector lv_diff = arrayLorentz[indices[0]] - arrayLorentz[indices[1]]; + ; + + double dp = lv_sum.DeltaPhi(lv_diff); + + return dp; +} + #endif // PWGUD_CORE_UPCJPSICENTRALBARRELCORRHELPER_H_ diff --git a/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx b/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx index 8464ead5f1e..cf84e91414a 100644 --- a/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx +++ b/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx @@ -14,6 +14,7 @@ /// \since March 2024 #include +#include // O2 headers #include "Framework/runDataProcessing.h" @@ -44,6 +45,8 @@ struct UpcJpsiCentralBarrel { ConfigurableAxis axisIVM{"axisIVM", {500.0f, 2.0f, 4.5f}, "M_#it{inv} (GeV/#it{c}^{2})"}; ConfigurableAxis axisIVMWide{"axisIVMWide", {350.0f, 0.0f, 4.5f}, "M_#it{inv} (GeV/#it{c}^{2})"}; ConfigurableAxis axisPt{"axisPt", {250.0f, 0.1f, 3.0f}, "#it{p}_T (GeV/#it{c})"}; + ConfigurableAxis axisPt2{"axisPt2", {250.0f, 0.0f, 0.01f}, "#it{p}_T (GeV/#it{c})"}; + ConfigurableAxis axisPt2wide{"axisPt2wide", {250.0f, 0.0f, 0.04f}, "#it{p}_T (GeV/#it{c})"}; ConfigurableAxis axisP{"axisP", {250.0f, 0.1f, 3.0f}, "#it{p} (GeV/#it{c})"}; ConfigurableAxis axisEta{"axisEta", {250.0f, -1.5f, 1.5f}, "#eta (-)"}; ConfigurableAxis axisCounter{"axisCounter", {20.0f, 0.0f, 20.0f}, "Number of events (-)"}; @@ -51,15 +54,17 @@ struct UpcJpsiCentralBarrel { ConfigurableAxis axisAccAngle{"axisAccAngle", {250.0f, -0.2f, 0.2f}, "accAngle"}; ConfigurableAxis axisAngTheta{"axisAngTheta", {250.0f, -1.5f, 1.5f}, "cos #theta (-)"}; ConfigurableAxis axisTPC{"axisTPC", {1000.0f, 0, 200.0f}, "TPC d#it{E}/d#it{x}"}; - ConfigurableAxis axisTOF{"axisTOF", {1000.0f, 0, 200.0f}, "TOF d#it{E}/d#it{x}"}; ConfigurableAxis axisBetaTOF{"axisBetaTOF", {100.0f, 0, 1.5}, "TOF #beta"}; ConfigurableAxis axisSigma{"axisSigma", {50, -25, 25}, "#sigma"}; ConfigurableAxis axisZDCEnergy{"axisZDCEnergy", {250, -5.0, 20.0}, "ZDC energy"}; ConfigurableAxis axisZDCTime{"axisZDCTime", {200, -10.0, 10.0}, "ZDC time"}; ConfigurableAxis axisDCA{"axisDCA", {1000, -20.0, 20.0}, "DCA"}; - ConfigurableAxis axisChi2{"axisChi2", {1000, 0.0, 100.0}, "Chi2"}; + ConfigurableAxis axisChi2{"axisChi2", {200, -10.0, 40}, "Chi2"}; ConfigurableAxis axisIVMSel{"axisIVMSel", {1000, 0.0, 10.0}, "IVM"}; ConfigurableAxis axisCounterSel{"axisCounterSel", {1000, 0.0, 200.0}, "Selection"}; + ConfigurableAxis axisITSNCls{"axisITSNCls", {10, 0.0, 10.0}, "ITSNCls"}; + ConfigurableAxis axisTPCNCls{"axisTPCNCls", {170, -1, 160.0}, "TPCNCls"}; + ConfigurableAxis axisTPCCrossed{"axisTPCCrossed", {300, 20, 170.0}, "TPCCrossedRows"}; // configurable cuts (modify in json) // track quality cuts @@ -69,7 +74,6 @@ struct UpcJpsiCentralBarrel { Configurable TOFOneProton{"TOFOneProton", false, "one candidate proton has TOF hits"}; Configurable DCAcut{"DCAcut", false, "DCA cut from run2."}; Configurable newCutTPC{"newCutTPC", false, "New cuts for TPC quality tracks."}; - Configurable TPCNSigmaMu{"TPCNSigmaMu", 3, "PID for TPC Mu track"}; Configurable EtaCut{"EtaCut", 0.9f, "acceptance cut per track"}; Configurable cutPtTrack{"cutPtTrack", 0.7f, "pT cut per track"}; Configurable cutVertexZ{"cutVertexZ", 10.0f, "cut on vertex position in Z"}; @@ -172,6 +176,10 @@ struct UpcJpsiCentralBarrel { "Asymmetry", {}}; + HistogramRegistry MC{ + "MC", + {}}; + using UDCollisionsFull = soa::Join; using UDCollisionFull = UDCollisionsFull::iterator; using UDTracksFull = soa::Join; @@ -185,14 +193,6 @@ struct UpcJpsiCentralBarrel { Statistics.add("Statistics/hNumberOfCollisions", "hNumberOfCollisions", {HistType::kTH1F, {axisCounter}}); Statistics.add("Statistics/hNumberOfTracks", "hNumberOfTracks", {HistType::kTH1F, {axisCounter}}); Statistics.add("Statistics/hNumberGT", "hNumberGT", {HistType::kTH1F, {axisCounter}}); - Statistics.add("Statistics/hNumberGTselected", "hNumberGTselected", {HistType::kTH1F, {axisCounter}}); - Statistics.add("Statistics/hNumberGTel", "hNumberGTel", {HistType::kTH1F, {axisCounter}}); - Statistics.add("Statistics/hNumberGTmu", "hNumberGTmu", {HistType::kTH1F, {axisCounter}}); - Statistics.add("Statistics/hNumberGTp", "hNumberGTp", {HistType::kTH1F, {axisCounter}}); - Statistics.add("Statistics/hNumberGTelSigma", "hNumberGTelSigma", {HistType::kTH1F, {axisCounter}}); - Statistics.add("Statistics/hNumberGTmuSigma", "hNumberGTmuSigma", {HistType::kTH1F, {axisCounter}}); - Statistics.add("Statistics/hNumberGTpSigma", "hNumberGTpSigma", {HistType::kTH1F, {axisCounter}}); - Statistics.add("Statistics/hNumberGTpSigmaTOF", "hNumberGTpSigmaTOF", {HistType::kTH1F, {axisCounter}}); Statistics.add("Statistics/hCutCounterCollisions", "hCutCounterCollisions", {HistType::kTH1F, {axisCounter}}); Statistics.add("Statistics/hCutCounterTracks", "hCutCounterTracks", {HistType::kTH1F, {axisCounter}}); @@ -204,7 +204,7 @@ struct UpcJpsiCentralBarrel { RawData.add("RawData/hTPCNClsFindable", "hTPCNClsFindable", {HistType::kTH1F, {axisTPC}}); RawData.add("RawData/hTPCNClsFindableMinusFound", "hTPCNClsFindableMinusFound", {HistType::kTH1F, {axisTPC}}); RawData.add("RawData/hITSNCls", "hITSNCls", {HistType::kTH1F, {axisCounter}}); - RawData.add("RawData/hTPCNCls", "hITSNCls", {HistType::kTH1F, {axisCounter}}); + RawData.add("RawData/hTPCNCls", "hTPCNCls", {HistType::kTH1F, {axisCounter}}); RawData.add("RawData/hITSChi2NCls", "hITSChi2NCls", {HistType::kTH1F, {axisChi2}}); RawData.add("RawData/hTPCChi2NCls", "hTPCChi2NCls", {HistType::kTH1F, {axisChi2}}); RawData.add("RawData/hPositionZ", "hPositionZ", {HistType::kTH1F, {axisSigma}}); @@ -213,84 +213,82 @@ struct UpcJpsiCentralBarrel { RawData.add("RawData/hPositionXY", "hPositionXY", {HistType::kTH2F, {axisSigma, axisSigma}}); RawData.add("RawData/hZNACommonEnergy", "hZNACommonEnergy", {HistType::kTH1F, {axisZDCEnergy}}); RawData.add("RawData/hZNCCommonEnergy", "hZNCCommonEnergy", {HistType::kTH1F, {axisZDCEnergy}}); + RawData.add("RawData/hZNAvsZNCCommonEnergy", "hZNAvsZNCCommonEnergy", {HistType::kTH2F, {axisZDCEnergy, axisZDCEnergy}}); RawData.add("RawData/hZNATime", "hZNATime", {HistType::kTH1F, {axisZDCTime}}); RawData.add("RawData/hZNCTime", "hZNCTime", {HistType::kTH1F, {axisZDCTime}}); + RawData.add("RawData/hZNAvsZNCTime", "hZNAvsZNCTime", {HistType::kTH2F, {axisZDCTime, axisZDCTime}}); RawData.add("RawData/PID/hTPCVsP", "hTPCVsP", {HistType::kTH2F, {axisP, axisTPC}}); RawData.add("RawData/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); RawData.add("RawData/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); RawData.add("RawData/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - RawData.add("RawData/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); RawData.add("RawData/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - RawData.add("RawData/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - RawData.add("RawData/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - RawData.add("RawData/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); // Selection checks - Selections.add("Selections/Electron/Mass/Leading/hITSNClsVsM", "hITSNClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Electron/Mass/Leading/hITSChi2NClsVsM", "hITSChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Electron/Mass/Leading/hTPCNClsVsM", "hTPCNClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Electron/Mass/Leading/hTPCChi2NClsVsM", "hTPCChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Electron/Mass/Leading/hTPCNClsCrossedRowsVsM", "hTPCNClsCrossedRowsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Electron/Mass/Subleading/hITSNClsVsM", "hITSNClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Electron/Mass/Subleading/hITSChi2NClsVsM", "hITSChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Electron/Mass/Subleading/hTPCNClsVsM", "hTPCNClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Electron/Mass/Subleading/hTPCChi2NClsVsM", "hTPCChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Electron/Mass/Subleading/hTPCNClsCrossedRowsVsM", "hTPCNClsCrossedRowsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - - Selections.add("Selections/Electron/Rapidity/Leading/hITSNClsVsY", "hITSNClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Electron/Rapidity/Leading/hITSChi2NClsVsY", "hITSChi2NClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Electron/Rapidity/Leading/hTPCNClsVsY", "hTPCNClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Electron/Rapidity/Leading/hTPCChi2NClsVsY", "hTPCChi2NClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Electron/Rapidity/Leading/hTPCNClsCrossedRowsVsY", "hTPCNClsCrossedRowsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Electron/Rapidity/Subleading/hITSNClsVsY", "hITSNClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Electron/Rapidity/Subleading/hITSChi2NClsVsY", "hITSChi2NClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Electron/Rapidity/Subleading/hTPCNClsVsY", "hTPCNClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Electron/Rapidity/Subleading/hTPCChi2NClsVsY", "hTPCChi2NClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Electron/Rapidity/Subleading/hTPCNClsCrossedRowsVsY", "hTPCNClsCrossedRowsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - - Selections.add("Selections/Electron/Pt/Leading/hITSNClsVsPt", "hITSNClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Electron/Pt/Leading/hITSChi2NClsVsPt", "hITSChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Electron/Pt/Leading/hTPCNClsVsPt", "hTPCNClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Electron/Pt/Leading/hTPCChi2NClsVsPt", "hTPCChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Electron/Pt/Leading/hTPCNClsCrossedRowsVsPt", "hTPCNClsCrossedRowsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Electron/Pt/Subleading/hITSNClsVsPt", "hITSNClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Electron/Pt/Subleading/hITSChi2NClsVsPt", "hITSChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Electron/Pt/Subleading/hTPCNClsVsPt", "hTPCNClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Electron/Pt/Subleading/hTPCChi2NClsVsPt", "hTPCChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Electron/Pt/Subleading/hTPCNClsCrossedRowsVsPt", "hTPCNClsCrossedRowsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - - Selections.add("Selections/Muon/Mass/Leading/hITSNClsVsM", "hITSNClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Muon/Mass/Leading/hITSChi2NClsVsM", "hITSChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Muon/Mass/Leading/hTPCNClsVsM", "hTPCNClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Muon/Mass/Leading/hTPCChi2NClsVsM", "hTPCChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Muon/Mass/Leading/hTPCNClsCrossedRowsVsM", "hTPCNClsCrossedRowsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Muon/Mass/Subleading/hITSNClsVsM", "hITSNClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Muon/Mass/Subleading/hITSChi2NClsVsM", "hITSChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Muon/Mass/Subleading/hTPCNClsVsM", "hTPCNClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Muon/Mass/Subleading/hTPCChi2NClsVsM", "hTPCChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - Selections.add("Selections/Muon/Mass/Subleading/hTPCNClsCrossedRowsVsM", "hTPCNClsCrossedRowsVsM", {HistType::kTH2F, {axisIVMSel, axisCounterSel}}); - - Selections.add("Selections/Muon/Rapidity/Leading/hITSNClsVsY", "hITSNClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Muon/Rapidity/Leading/hITSChi2NClsVsY", "hITSChi2NClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Muon/Rapidity/Leading/hTPCNClsVsY", "hTPCNClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Muon/Rapidity/Leading/hTPCChi2NClsVsY", "hTPCChi2NClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Muon/Rapidity/Leading/hTPCNClsCrossedRowsVsY", "hTPCNClsCrossedRowsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Muon/Rapidity/Subleading/hITSNClsVsY", "hITSNClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Muon/Rapidity/Subleading/hITSChi2NClsVsY", "hITSChi2NClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Muon/Rapidity/Subleading/hTPCNClsVsY", "hTPCNClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Muon/Rapidity/Subleading/hTPCChi2NClsVsY", "hTPCChi2NClsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - Selections.add("Selections/Muon/Rapidity/Subleading/hTPCNClsCrossedRowsVsY", "hTPCNClsCrossedRowsVsY", {HistType::kTH2F, {axisEta, axisCounterSel}}); - - Selections.add("Selections/Muon/Pt/Leading/hITSNClsVsPt", "hITSNClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Muon/Pt/Leading/hITSChi2NClsVsPt", "hITSChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Muon/Pt/Leading/hTPCNClsVsPt", "hTPCNClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Muon/Pt/Leading/hTPCChi2NClsVsPt", "hTPCChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Muon/Pt/Leading/hTPCNClsCrossedRowsVsPt", "hTPCNClsCrossedRowsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Muon/Pt/Subleading/hITSNClsVsPt", "hITSNClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Muon/Pt/Subleading/hITSChi2NClsVsPt", "hITSChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Muon/Pt/Subleading/hTPCNClsVsPt", "hTPCNClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Muon/Pt/Subleading/hTPCChi2NClsVsPt", "hTPCChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); - Selections.add("Selections/Muon/Pt/Subleading/hTPCNClsCrossedRowsVsPt", "hTPCNClsCrossedRowsVsPt", {HistType::kTH2F, {axisPt, axisCounterSel}}); + Selections.add("Selections/Electron/Mass/Leading/hITSNClsVsM", "hITSNClsVsM", {HistType::kTH2F, {axisIVMSel, axisITSNCls}}); + Selections.add("Selections/Electron/Mass/Leading/hITSChi2NClsVsM", "hITSChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisChi2}}); + Selections.add("Selections/Electron/Mass/Leading/hTPCNClsVsM", "hTPCNClsVsM", {HistType::kTH2F, {axisIVMSel, axisTPCNCls}}); + Selections.add("Selections/Electron/Mass/Leading/hTPCChi2NClsVsM", "hTPCChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisChi2}}); + Selections.add("Selections/Electron/Mass/Leading/hTPCNClsCrossedRowsVsM", "hTPCNClsCrossedRowsVsM", {HistType::kTH2F, {axisIVMSel, axisTPCCrossed}}); + Selections.add("Selections/Electron/Mass/Subleading/hITSNClsVsM", "hITSNClsVsM", {HistType::kTH2F, {axisIVMSel, axisITSNCls}}); + Selections.add("Selections/Electron/Mass/Subleading/hITSChi2NClsVsM", "hITSChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisChi2}}); + Selections.add("Selections/Electron/Mass/Subleading/hTPCNClsVsM", "hTPCNClsVsM", {HistType::kTH2F, {axisIVMSel, axisTPCNCls}}); + Selections.add("Selections/Electron/Mass/Subleading/hTPCChi2NClsVsM", "hTPCChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisChi2}}); + Selections.add("Selections/Electron/Mass/Subleading/hTPCNClsCrossedRowsVsM", "hTPCNClsCrossedRowsVsM", {HistType::kTH2F, {axisIVMSel, axisTPCCrossed}}); + + Selections.add("Selections/Electron/Rapidity/Leading/hITSNClsVsY", "hITSNClsVsY", {HistType::kTH2F, {axisEta, axisITSNCls}}); + Selections.add("Selections/Electron/Rapidity/Leading/hITSChi2NClsVsY", "hITSChi2NClsVsY", {HistType::kTH2F, {axisEta, axisChi2}}); + Selections.add("Selections/Electron/Rapidity/Leading/hTPCNClsVsY", "hTPCNClsVsY", {HistType::kTH2F, {axisEta, axisTPCNCls}}); + Selections.add("Selections/Electron/Rapidity/Leading/hTPCChi2NClsVsY", "hTPCChi2NClsVsY", {HistType::kTH2F, {axisEta, axisChi2}}); + Selections.add("Selections/Electron/Rapidity/Leading/hTPCNClsCrossedRowsVsY", "hTPCNClsCrossedRowsVsY", {HistType::kTH2F, {axisEta, axisTPCCrossed}}); + Selections.add("Selections/Electron/Rapidity/Subleading/hITSNClsVsY", "hITSNClsVsY", {HistType::kTH2F, {axisEta, axisITSNCls}}); + Selections.add("Selections/Electron/Rapidity/Subleading/hITSChi2NClsVsY", "hITSChi2NClsVsY", {HistType::kTH2F, {axisEta, axisChi2}}); + Selections.add("Selections/Electron/Rapidity/Subleading/hTPCNClsVsY", "hTPCNClsVsY", {HistType::kTH2F, {axisEta, axisTPCNCls}}); + Selections.add("Selections/Electron/Rapidity/Subleading/hTPCChi2NClsVsY", "hTPCChi2NClsVsY", {HistType::kTH2F, {axisEta, axisChi2}}); + Selections.add("Selections/Electron/Rapidity/Subleading/hTPCNClsCrossedRowsVsY", "hTPCNClsCrossedRowsVsY", {HistType::kTH2F, {axisEta, axisTPCCrossed}}); + + Selections.add("Selections/Electron/Pt/Leading/hITSNClsVsPt", "hITSNClsVsPt", {HistType::kTH2F, {axisPt, axisITSNCls}}); + Selections.add("Selections/Electron/Pt/Leading/hITSChi2NClsVsPt", "hITSChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisChi2}}); + Selections.add("Selections/Electron/Pt/Leading/hTPCNClsVsPt", "hTPCNClsVsPt", {HistType::kTH2F, {axisPt, axisTPCNCls}}); + Selections.add("Selections/Electron/Pt/Leading/hTPCChi2NClsVsPt", "hTPCChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisChi2}}); + Selections.add("Selections/Electron/Pt/Leading/hTPCNClsCrossedRowsVsPt", "hTPCNClsCrossedRowsVsPt", {HistType::kTH2F, {axisPt, axisTPCCrossed}}); + Selections.add("Selections/Electron/Pt/Subleading/hITSNClsVsPt", "hITSNClsVsPt", {HistType::kTH2F, {axisPt, axisITSNCls}}); + Selections.add("Selections/Electron/Pt/Subleading/hITSChi2NClsVsPt", "hITSChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisChi2}}); + Selections.add("Selections/Electron/Pt/Subleading/hTPCNClsVsPt", "hTPCNClsVsPt", {HistType::kTH2F, {axisPt, axisTPCNCls}}); + Selections.add("Selections/Electron/Pt/Subleading/hTPCChi2NClsVsPt", "hTPCChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisChi2}}); + Selections.add("Selections/Electron/Pt/Subleading/hTPCNClsCrossedRowsVsPt", "hTPCNClsCrossedRowsVsPt", {HistType::kTH2F, {axisPt, axisTPCCrossed}}); + + Selections.add("Selections/Muon/Mass/Leading/hITSNClsVsM", "hITSNClsVsM", {HistType::kTH2F, {axisIVMSel, axisITSNCls}}); + Selections.add("Selections/Muon/Mass/Leading/hITSChi2NClsVsM", "hITSChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisChi2}}); + Selections.add("Selections/Muon/Mass/Leading/hTPCNClsVsM", "hTPCNClsVsM", {HistType::kTH2F, {axisIVMSel, axisTPCNCls}}); + Selections.add("Selections/Muon/Mass/Leading/hTPCChi2NClsVsM", "hTPCChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisChi2}}); + Selections.add("Selections/Muon/Mass/Leading/hTPCNClsCrossedRowsVsM", "hTPCNClsCrossedRowsVsM", {HistType::kTH2F, {axisIVMSel, axisTPCCrossed}}); + Selections.add("Selections/Muon/Mass/Subleading/hITSNClsVsM", "hITSNClsVsM", {HistType::kTH2F, {axisIVMSel, axisITSNCls}}); + Selections.add("Selections/Muon/Mass/Subleading/hITSChi2NClsVsM", "hITSChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisChi2}}); + Selections.add("Selections/Muon/Mass/Subleading/hTPCNClsVsM", "hTPCNClsVsM", {HistType::kTH2F, {axisIVMSel, axisTPCNCls}}); + Selections.add("Selections/Muon/Mass/Subleading/hTPCChi2NClsVsM", "hTPCChi2NClsVsM", {HistType::kTH2F, {axisIVMSel, axisChi2}}); + Selections.add("Selections/Muon/Mass/Subleading/hTPCNClsCrossedRowsVsM", "hTPCNClsCrossedRowsVsM", {HistType::kTH2F, {axisIVMSel, axisTPCCrossed}}); + + Selections.add("Selections/Muon/Rapidity/Leading/hITSNClsVsY", "hITSNClsVsY", {HistType::kTH2F, {axisEta, axisITSNCls}}); + Selections.add("Selections/Muon/Rapidity/Leading/hITSChi2NClsVsY", "hITSChi2NClsVsY", {HistType::kTH2F, {axisEta, axisChi2}}); + Selections.add("Selections/Muon/Rapidity/Leading/hTPCNClsVsY", "hTPCNClsVsY", {HistType::kTH2F, {axisEta, axisTPCNCls}}); + Selections.add("Selections/Muon/Rapidity/Leading/hTPCChi2NClsVsY", "hTPCChi2NClsVsY", {HistType::kTH2F, {axisEta, axisChi2}}); + Selections.add("Selections/Muon/Rapidity/Leading/hTPCNClsCrossedRowsVsY", "hTPCNClsCrossedRowsVsY", {HistType::kTH2F, {axisEta, axisTPCCrossed}}); + Selections.add("Selections/Muon/Rapidity/Subleading/hITSNClsVsY", "hITSNClsVsY", {HistType::kTH2F, {axisEta, axisITSNCls}}); + Selections.add("Selections/Muon/Rapidity/Subleading/hITSChi2NClsVsY", "hITSChi2NClsVsY", {HistType::kTH2F, {axisEta, axisChi2}}); + Selections.add("Selections/Muon/Rapidity/Subleading/hTPCNClsVsY", "hTPCNClsVsY", {HistType::kTH2F, {axisEta, axisTPCNCls}}); + Selections.add("Selections/Muon/Rapidity/Subleading/hTPCChi2NClsVsY", "hTPCChi2NClsVsY", {HistType::kTH2F, {axisEta, axisChi2}}); + Selections.add("Selections/Muon/Rapidity/Subleading/hTPCNClsCrossedRowsVsY", "hTPCNClsCrossedRowsVsY", {HistType::kTH2F, {axisEta, axisTPCCrossed}}); + + Selections.add("Selections/Muon/Pt/Leading/hITSNClsVsPt", "hITSNClsVsPt", {HistType::kTH2F, {axisPt, axisITSNCls}}); + Selections.add("Selections/Muon/Pt/Leading/hITSChi2NClsVsPt", "hITSChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisChi2}}); + Selections.add("Selections/Muon/Pt/Leading/hTPCNClsVsPt", "hTPCNClsVsPt", {HistType::kTH2F, {axisPt, axisTPCNCls}}); + Selections.add("Selections/Muon/Pt/Leading/hTPCChi2NClsVsPt", "hTPCChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisChi2}}); + Selections.add("Selections/Muon/Pt/Leading/hTPCNClsCrossedRowsVsPt", "hTPCNClsCrossedRowsVsPt", {HistType::kTH2F, {axisPt, axisTPCCrossed}}); + Selections.add("Selections/Muon/Pt/Subleading/hITSNClsVsPt", "hITSNClsVsPt", {HistType::kTH2F, {axisPt, axisITSNCls}}); + Selections.add("Selections/Muon/Pt/Subleading/hITSChi2NClsVsPt", "hITSChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisChi2}}); + Selections.add("Selections/Muon/Pt/Subleading/hTPCNClsVsPt", "hTPCNClsVsPt", {HistType::kTH2F, {axisPt, axisTPCNCls}}); + Selections.add("Selections/Muon/Pt/Subleading/hTPCChi2NClsVsPt", "hTPCChi2NClsVsPt", {HistType::kTH2F, {axisPt, axisChi2}}); + Selections.add("Selections/Muon/Pt/Subleading/hTPCNClsCrossedRowsVsPt", "hTPCNClsCrossedRowsVsPt", {HistType::kTH2F, {axisPt, axisTPCCrossed}}); // PVContributors histograms PVContributors.add("PVContributors/hTrackPt", "hTrackPt", {HistType::kTH1F, {axisPt}}); @@ -302,11 +300,7 @@ struct UpcJpsiCentralBarrel { PVContributors.add("PVContributors/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); PVContributors.add("PVContributors/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); PVContributors.add("PVContributors/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - PVContributors.add("PVContributors/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); PVContributors.add("PVContributors/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - PVContributors.add("PVContributors/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - PVContributors.add("PVContributors/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - PVContributors.add("PVContributors/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); // TG histograms TG.add("TG/hTrackPt1", "hTrackPt1", {HistType::kTH1F, {axisPt}}); @@ -321,18 +315,8 @@ struct UpcJpsiCentralBarrel { TG.add("TG/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); TG.add("TG/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); TG.add("TG/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - TG.add("TG/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); TG.add("TG/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - TG.add("TG/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - TG.add("TG/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - TG.add("TG/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); - TG.add("TG/TPC/hNsigmaMu", "hNsigmaMu", HistType::kTH1F, {axisSigma}); - TG.add("TG/TPC/hNsigmaEl", "hNsigmaEl", HistType::kTH1F, {axisSigma}); - TG.add("TG/TPC/hNsigmaPr", "hNsigmaPr", HistType::kTH1F, {axisSigma}); TG.add("TG/TPC/TPCNegVsPosSignal", "TPCNegVsPosSignal", HistType::kTH2F, {axisTPC, axisTPC}); - TG.add("TG/TOF/hNsigmaMu", "hNsigmaMu", HistType::kTH1F, {axisSigma}); - TG.add("TG/TOF/hNsigmaEl", "hNsigmaEl", HistType::kTH1F, {axisSigma}); - TG.add("TG/TOF/hNsigmaPr", "hNsigmaPr", HistType::kTH1F, {axisSigma}); // TGmu histograms TGmu.add("TGmu/hTrackPt1", "hTrackPt1", {HistType::kTH1F, {axisPt}}); @@ -341,18 +325,12 @@ struct UpcJpsiCentralBarrel { TGmu.add("TGmu/hTrackPt2", "hTrackPt2", {HistType::kTH1F, {axisPt}}); TGmu.add("TGmu/hTrackEta2", "hTrackEta2", {HistType::kTH1F, {axisEta}}); TGmu.add("TGmu/hTrackPhi2", "hTrackPhi2", {HistType::kTH1F, {axisPhi}}); - TGmu.add("TGmu/hNsigmaMu", "hNsigmaMu", HistType::kTH1F, {axisSigma}); - TGmu.add("TGmu/hNsigmaMuTOF", "hNsigmaMuTOF", HistType::kTH1F, {axisSigma}); TGmu.add("TGmu/TPCNegVsPosSignal", "TPCNegVsPosSignal", HistType::kTH2F, {axisTPC, axisTPC}); TGmu.add("TGmu/PID/hTPCVsP", "hTPCVsP", {HistType::kTH2F, {axisP, axisTPC}}); TGmu.add("TGmu/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); TGmu.add("TGmu/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); TGmu.add("TGmu/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - TGmu.add("TGmu/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); TGmu.add("TGmu/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - TGmu.add("TGmu/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - TGmu.add("TGmu/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - TGmu.add("TGmu/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); // TGmuCand histograms TGmuCand.add("TGmuCand/hTrackPt1", "hTrackPt1", {HistType::kTH1F, {axisPt}}); @@ -361,22 +339,26 @@ struct UpcJpsiCentralBarrel { TGmuCand.add("TGmuCand/hTrackPt2", "hTrackPt2", {HistType::kTH1F, {axisPt}}); TGmuCand.add("TGmuCand/hTrackEta2", "hTrackEta2", {HistType::kTH1F, {axisEta}}); TGmuCand.add("TGmuCand/hTrackPhi2", "hTrackPhi2", {HistType::kTH1F, {axisPhi}}); - TGmuCand.add("TGmuCand/hTrackITSNcls1", "hTrackITSNcls1", {HistType::kTH1F, {axisCounter}}); - TGmuCand.add("TGmuCand/hTrackITSNcls2", "hTrackITSNcls2", {HistType::kTH1F, {axisCounter}}); TGmuCand.add("TGmuCand/hPairPt", "hPairPt", {HistType::kTH1F, {axisPt}}); TGmuCand.add("TGmuCand/hPairIVM", "hPairIVM", {HistType::kTH1F, {axisIVMWide}}); TGmuCand.add("TGmuCand/hJpsiPt", "hJpsiPt", {HistType::kTH1F, {axisPt}}); + TGmuCand.add("TGmuCand/hJpsiPt2", "hJpsiPt2", {HistType::kTH1F, {axisPt2}}); + TGmuCand.add("TGmuCand/XnXn/hJpsiPt2", "hJpsiPt2", {HistType::kTH1F, {axisPt2}}); + TGmuCand.add("TGmuCand/OnOn/hJpsiPt2", "hJpsiPt2", {HistType::kTH1F, {axisPt2}}); + TGmuCand.add("TGmuCand/OnXn/hJpsiPt2", "hJpsiPt2", {HistType::kTH1F, {axisPt2}}); + TGmuCand.add("TGmuCand/XnOn/hJpsiPt2", "hJpsiPt2", {HistType::kTH1F, {axisPt2}}); + TGmuCand.add("TGmuCand/hJpsiPt2wide", "hJpsiPt2wide", {HistType::kTH1F, {axisPt2}}); + TGmuCand.add("TGmuCand/XnXn/hJpsiPt2wide", "hJpsiPt2wide", {HistType::kTH1F, {axisPt2wide}}); + TGmuCand.add("TGmuCand/OnOn/hJpsiPt2wide", "hJpsiPt2wide", {HistType::kTH1F, {axisPt2wide}}); + TGmuCand.add("TGmuCand/OnXn/hJpsiPt2wide", "hJpsiPt2wide", {HistType::kTH1F, {axisPt2wide}}); + TGmuCand.add("TGmuCand/XnOn/hJpsiPt2wide", "hJpsiPt2wide", {HistType::kTH1F, {axisPt2wide}}); TGmuCand.add("TGmuCand/hJpsiRap", "hJpsiRap", {HistType::kTH1F, {axisEta}}); TGmuCand.add("TGmuCand/TPCNegVsPosSignal", "TPCNegVsPosSignal", HistType::kTH2F, {axisTPC, axisTPC}); TGmuCand.add("TGmuCand/PID/hTPCVsP", "hTPCVsP", {HistType::kTH2F, {axisP, axisTPC}}); TGmuCand.add("TGmuCand/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); TGmuCand.add("TGmuCand/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); TGmuCand.add("TGmuCand/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - TGmuCand.add("TGmuCand/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); TGmuCand.add("TGmuCand/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - TGmuCand.add("TGmuCand/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - TGmuCand.add("TGmuCand/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - TGmuCand.add("TGmuCand/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); // TGel histograms TGel.add("TGel/hTrackPt1", "hTrackPt1", {HistType::kTH1F, {axisPt}}); @@ -385,18 +367,12 @@ struct UpcJpsiCentralBarrel { TGel.add("TGel/hTrackPt2", "hTrackPt2", {HistType::kTH1F, {axisPt}}); TGel.add("TGel/hTrackEta2", "hTrackEta2", {HistType::kTH1F, {axisEta}}); TGel.add("TGel/hTrackPhi2", "hTrackPhi2", {HistType::kTH1F, {axisPhi}}); - TGel.add("TGel/hNsigmaEl", "hNsigmaEl", HistType::kTH1F, {axisSigma}); - TGel.add("TGel/hNsigmaElTOF", "hNsigmaElTOF", HistType::kTH1F, {axisSigma}); TGel.add("TGel/TPCNegVsPosSignal", "TPCNegVsPosSignal", HistType::kTH2F, {axisTPC, axisTPC}); TGel.add("TGel/PID/hTPCVsP", "hTPCVsP", {HistType::kTH2F, {axisP, axisTPC}}); TGel.add("TGel/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); TGel.add("TGel/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); TGel.add("TGel/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - TGel.add("TGel/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); TGel.add("TGel/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - TGel.add("TGel/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - TGel.add("TGel/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - TGel.add("TGel/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); // TGelCand histograms TGelCand.add("TGelCand/hTrackPt1", "hTrackPt1", {HistType::kTH1F, {axisPt}}); @@ -406,8 +382,6 @@ struct UpcJpsiCentralBarrel { TGelCand.add("TGelCand/hTrackEta2", "hTrackEta2", {HistType::kTH1F, {axisEta}}); TGelCand.add("TGelCand/hTrackPhi2", "hTrackPhi2", {HistType::kTH1F, {axisPhi}}); TGelCand.add("TGelCand/TPCNegVsPosSignal", "TPCNegVsPosSignal", HistType::kTH2F, {axisTPC, axisTPC}); - TGelCand.add("TGelCand/hTrackITSNcls1", "hTrackITSNcls1", {HistType::kTH1F, {axisCounter}}); - TGelCand.add("TGelCand/hTrackITSNcls2", "hTrackITSNcls2", {HistType::kTH1F, {axisCounter}}); TGelCand.add("TGelCand/hPairPt", "hPairPt", {HistType::kTH1F, {axisPt}}); TGelCand.add("TGelCand/hPairIVM", "hPairIVM", {HistType::kTH1F, {axisIVMWide}}); TGelCand.add("TGelCand/hJpsiPt", "hJpsiPt", {HistType::kTH1F, {axisPt}}); @@ -416,11 +390,7 @@ struct UpcJpsiCentralBarrel { TGelCand.add("TGelCand/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); TGelCand.add("TGelCand/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); TGelCand.add("TGelCand/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - TGelCand.add("TGelCand/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); TGelCand.add("TGelCand/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - TGelCand.add("TGelCand/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - TGelCand.add("TGelCand/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - TGelCand.add("TGelCand/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); // TGp histograms TGp.add("TGp/hTrackPt1", "hTrackPt1", {HistType::kTH1F, {axisPt}}); @@ -429,17 +399,11 @@ struct UpcJpsiCentralBarrel { TGp.add("TGp/hTrackPt2", "hTrackPt2", {HistType::kTH1F, {axisPt}}); TGp.add("TGp/hTrackEta2", "hTrackEta2", {HistType::kTH1F, {axisEta}}); TGp.add("TGp/hTrackPhi2", "hTrackPhi2", {HistType::kTH1F, {axisPhi}}); - TGp.add("TGp/hNsigmaMu", "hNsigmaMu", HistType::kTH1F, {axisSigma}); - TGp.add("TGp/hNsigmaMuTOF", "hNsigmaMuTOF", HistType::kTH1F, {axisSigma}); TGp.add("TGp/PID/hTPCVsP", "hTPCVsP", {HistType::kTH2F, {axisP, axisTPC}}); TGp.add("TGp/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); TGp.add("TGp/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); TGp.add("TGp/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - TGp.add("TGp/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); TGp.add("TGp/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - TGp.add("TGp/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - TGp.add("TGp/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - TGp.add("TGp/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); // TGpCand histograms TGpCand.add("TGpCand/hTrackPt1", "hTrackPt1", {HistType::kTH1F, {axisPt}}); @@ -448,8 +412,6 @@ struct UpcJpsiCentralBarrel { TGpCand.add("TGpCand/hTrackPt2", "hTrackPt2", {HistType::kTH1F, {axisPt}}); TGpCand.add("TGpCand/hTrackEta2", "hTrackEta2", {HistType::kTH1F, {axisEta}}); TGpCand.add("TGpCand/hTrackPhi2", "hTrackPhi2", {HistType::kTH1F, {axisPhi}}); - TGpCand.add("TGpCand/hTrackITSNcls1", "hTrackITSNcls1", {HistType::kTH1F, {axisCounter}}); - TGpCand.add("TGpCand/hTrackITSNcls2", "hTrackITSNcls2", {HistType::kTH1F, {axisCounter}}); TGpCand.add("TGpCand/hPairPt", "hPairPt", {HistType::kTH1F, {axisPt}}); TGpCand.add("TGpCand/hPairIVM", "hPairIVM", {HistType::kTH1F, {axisIVMWide}}); TGpCand.add("TGpCand/hJpsiPt", "hJpsiPt", {HistType::kTH1F, {axisPt}}); @@ -458,11 +420,7 @@ struct UpcJpsiCentralBarrel { TGpCand.add("TGpCand/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); TGpCand.add("TGpCand/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); TGpCand.add("TGpCand/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - TGpCand.add("TGpCand/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); TGpCand.add("TGpCand/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - TGpCand.add("TGpCand/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - TGpCand.add("TGpCand/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - TGpCand.add("TGpCand/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); // JPsiToEl histograms JPsiToEl.add("JPsiToEl/Coherent/hPt", "Pt of J/Psi ; p_{T} {GeV/c]", {HistType::kTH1F, {axisPt}}); @@ -524,11 +482,7 @@ struct UpcJpsiCentralBarrel { JPsiToEl.add("JPsiToEl/Coherent/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); JPsiToEl.add("JPsiToEl/Coherent/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); JPsiToEl.add("JPsiToEl/Coherent/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - JPsiToEl.add("JPsiToEl/Coherent/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); JPsiToEl.add("JPsiToEl/Coherent/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - JPsiToEl.add("JPsiToEl/Coherent/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - JPsiToEl.add("JPsiToEl/Coherent/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - JPsiToEl.add("JPsiToEl/Coherent/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); JPsiToEl.add("JPsiToEl/Incoherent/hPt", "Pt of J/Psi ; p_{T} {GeV/c]", {HistType::kTH1F, {axisPt}}); JPsiToEl.add("JPsiToEl/Incoherent/hPt1", "pT of track 1 ; p_{T} {GeV/c]", {HistType::kTH1F, {axisPt}}); @@ -538,6 +492,7 @@ struct UpcJpsiCentralBarrel { JPsiToEl.add("JPsiToEl/Incoherent/hPhi1", "phi of track 1 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToEl.add("JPsiToEl/Incoherent/hPhi2", "phi of track 2 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToEl.add("JPsiToEl/Incoherent/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); + JPsiToEl.add("JPsiToEl/NotCoherent/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); JPsiToEl.add("JPsiToEl/Incoherent/hRap", "Rap of J/Psi ; y {-]", {HistType::kTH1F, {axisEta}}); JPsiToEl.add("JPsiToEl/Incoherent/hEta", "Eta of J/Psi ; #eta {-]", {HistType::kTH1F, {axisEta}}); JPsiToEl.add("JPsiToEl/Incoherent/hPhi", "Phi of J/Psi ; #phi {-]", {HistType::kTH1F, {axisPhi}}); @@ -549,6 +504,7 @@ struct UpcJpsiCentralBarrel { JPsiToEl.add("JPsiToEl/Incoherent/XnXn/hPhi1", "phi of track 1 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToEl.add("JPsiToEl/Incoherent/XnXn/hPhi2", "phi of track 2 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToEl.add("JPsiToEl/Incoherent/XnXn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); + JPsiToEl.add("JPsiToEl/NotCoherent/XnXn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); JPsiToEl.add("JPsiToEl/Incoherent/XnXn/hRap", "Rap of J/Psi ; y {-]", {HistType::kTH1F, {axisEta}}); JPsiToEl.add("JPsiToEl/Incoherent/XnXn/hEta", "Eta of J/Psi ; #eta {-]", {HistType::kTH1F, {axisEta}}); JPsiToEl.add("JPsiToEl/Incoherent/XnXn/hPhi", "Phi of J/Psi ; #phi {-]", {HistType::kTH1F, {axisPhi}}); @@ -560,6 +516,7 @@ struct UpcJpsiCentralBarrel { JPsiToEl.add("JPsiToEl/Incoherent/OnOn/hPhi1", "phi of track 1 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToEl.add("JPsiToEl/Incoherent/OnOn/hPhi2", "phi of track 2 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToEl.add("JPsiToEl/Incoherent/OnOn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); + JPsiToEl.add("JPsiToEl/NotCoherent/OnOn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); JPsiToEl.add("JPsiToEl/Incoherent/OnOn/hRap", "Rap of J/Psi ; y {-]", {HistType::kTH1F, {axisEta}}); JPsiToEl.add("JPsiToEl/Incoherent/OnOn/hEta", "Eta of J/Psi ; #eta {-]", {HistType::kTH1F, {axisEta}}); JPsiToEl.add("JPsiToEl/Incoherent/OnOn/hPhi", "Phi of J/Psi ; #phi {-]", {HistType::kTH1F, {axisPhi}}); @@ -571,6 +528,7 @@ struct UpcJpsiCentralBarrel { JPsiToEl.add("JPsiToEl/Incoherent/OnXn/hPhi1", "phi of track 1 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToEl.add("JPsiToEl/Incoherent/OnXn/hPhi2", "phi of track 2 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToEl.add("JPsiToEl/Incoherent/OnXn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); + JPsiToEl.add("JPsiToEl/NotCoherent/OnXn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); JPsiToEl.add("JPsiToEl/Incoherent/OnXn/hRap", "Rap of J/Psi ; y {-]", {HistType::kTH1F, {axisEta}}); JPsiToEl.add("JPsiToEl/Incoherent/OnXn/hEta", "Eta of J/Psi ; #eta {-]", {HistType::kTH1F, {axisEta}}); JPsiToEl.add("JPsiToEl/Incoherent/OnXn/hPhi", "Phi of J/Psi ; #phi {-]", {HistType::kTH1F, {axisPhi}}); @@ -582,6 +540,7 @@ struct UpcJpsiCentralBarrel { JPsiToEl.add("JPsiToEl/Incoherent/XnOn/hPhi1", "phi of track 1 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToEl.add("JPsiToEl/Incoherent/XnOn/hPhi2", "phi of track 2 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToEl.add("JPsiToEl/Incoherent/XnOn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); + JPsiToEl.add("JPsiToEl/NotCoherent/XnOn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); JPsiToEl.add("JPsiToEl/Incoherent/XnOn/hRap", "Rap of J/Psi ; y {-]", {HistType::kTH1F, {axisEta}}); JPsiToEl.add("JPsiToEl/Incoherent/XnOn/hEta", "Eta of J/Psi ; #eta {-]", {HistType::kTH1F, {axisEta}}); JPsiToEl.add("JPsiToEl/Incoherent/XnOn/hPhi", "Phi of J/Psi ; #phi {-]", {HistType::kTH1F, {axisPhi}}); @@ -589,11 +548,7 @@ struct UpcJpsiCentralBarrel { JPsiToEl.add("JPsiToEl/Incoherent/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); JPsiToEl.add("JPsiToEl/Incoherent/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); JPsiToEl.add("JPsiToEl/Incoherent/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - JPsiToEl.add("JPsiToEl/Incoherent/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); JPsiToEl.add("JPsiToEl/Incoherent/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - JPsiToEl.add("JPsiToEl/Incoherent/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - JPsiToEl.add("JPsiToEl/Incoherent/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - JPsiToEl.add("JPsiToEl/Incoherent/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); // JPsiToMu histograms JPsiToMu.add("JPsiToMu/Coherent/hPt", "Pt of J/Psi ; p_{T} {GeV/c]", {HistType::kTH1F, {axisPt}}); @@ -655,11 +610,7 @@ struct UpcJpsiCentralBarrel { JPsiToMu.add("JPsiToMu/Coherent/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); JPsiToMu.add("JPsiToMu/Coherent/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); JPsiToMu.add("JPsiToMu/Coherent/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - JPsiToMu.add("JPsiToMu/Coherent/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); JPsiToMu.add("JPsiToMu/Coherent/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - JPsiToMu.add("JPsiToMu/Coherent/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - JPsiToMu.add("JPsiToMu/Coherent/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - JPsiToMu.add("JPsiToMu/Coherent/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); JPsiToMu.add("JPsiToMu/Incoherent/hPt", "Pt of J/Psi ; p_{T} {GeV/c]", {HistType::kTH1F, {axisPt}}); JPsiToMu.add("JPsiToMu/Incoherent/hPt1", "pT of track 1 ; p_{T} {GeV/c]", {HistType::kTH1F, {axisPt}}); @@ -669,6 +620,7 @@ struct UpcJpsiCentralBarrel { JPsiToMu.add("JPsiToMu/Incoherent/hPhi1", "phi of track 1 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToMu.add("JPsiToMu/Incoherent/hPhi2", "phi of track 2 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToMu.add("JPsiToMu/Incoherent/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); + JPsiToMu.add("JPsiToMu/NotCoherent/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); JPsiToMu.add("JPsiToMu/Incoherent/hRap", "Rap of J/Psi ; y {-]", {HistType::kTH1F, {axisEta}}); JPsiToMu.add("JPsiToMu/Incoherent/hEta", "Eta of J/Psi ; #eta {-]", {HistType::kTH1F, {axisEta}}); JPsiToMu.add("JPsiToMu/Incoherent/hPhi", "Phi of J/Psi ; #phi {-]", {HistType::kTH1F, {axisPhi}}); @@ -680,6 +632,7 @@ struct UpcJpsiCentralBarrel { JPsiToMu.add("JPsiToMu/Incoherent/XnXn/hPhi1", "phi of track 1 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToMu.add("JPsiToMu/Incoherent/XnXn/hPhi2", "phi of track 2 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToMu.add("JPsiToMu/Incoherent/XnXn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); + JPsiToMu.add("JPsiToMu/NotCoherent/XnXn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); JPsiToMu.add("JPsiToMu/Incoherent/XnXn/hRap", "Rap of J/Psi ; y {-]", {HistType::kTH1F, {axisEta}}); JPsiToMu.add("JPsiToMu/Incoherent/XnXn/hEta", "Eta of J/Psi ; #eta {-]", {HistType::kTH1F, {axisEta}}); JPsiToMu.add("JPsiToMu/Incoherent/XnXn/hPhi", "Phi of J/Psi ; #phi {-]", {HistType::kTH1F, {axisPhi}}); @@ -691,6 +644,7 @@ struct UpcJpsiCentralBarrel { JPsiToMu.add("JPsiToMu/Incoherent/OnOn/hPhi1", "phi of track 1 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToMu.add("JPsiToMu/Incoherent/OnOn/hPhi2", "phi of track 2 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToMu.add("JPsiToMu/Incoherent/OnOn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); + JPsiToMu.add("JPsiToMu/NotCoherent/OnOn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); JPsiToMu.add("JPsiToMu/Incoherent/OnOn/hRap", "Rap of J/Psi ; y {-]", {HistType::kTH1F, {axisEta}}); JPsiToMu.add("JPsiToMu/Incoherent/OnOn/hEta", "Eta of J/Psi ; #eta {-]", {HistType::kTH1F, {axisEta}}); JPsiToMu.add("JPsiToMu/Incoherent/OnOn/hPhi", "Phi of J/Psi ; #phi {-]", {HistType::kTH1F, {axisPhi}}); @@ -702,6 +656,7 @@ struct UpcJpsiCentralBarrel { JPsiToMu.add("JPsiToMu/Incoherent/OnXn/hPhi1", "phi of track 1 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToMu.add("JPsiToMu/Incoherent/OnXn/hPhi2", "phi of track 2 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToMu.add("JPsiToMu/Incoherent/OnXn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); + JPsiToMu.add("JPsiToMu/NotCoherent/OnXn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); JPsiToMu.add("JPsiToMu/Incoherent/OnXn/hRap", "Rap of J/Psi ; y {-]", {HistType::kTH1F, {axisEta}}); JPsiToMu.add("JPsiToMu/Incoherent/OnXn/hEta", "Eta of J/Psi ; #eta {-]", {HistType::kTH1F, {axisEta}}); JPsiToMu.add("JPsiToMu/Incoherent/OnXn/hPhi", "Phi of J/Psi ; #phi {-]", {HistType::kTH1F, {axisPhi}}); @@ -713,6 +668,7 @@ struct UpcJpsiCentralBarrel { JPsiToMu.add("JPsiToMu/Incoherent/XnOn/hPhi1", "phi of track 1 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToMu.add("JPsiToMu/Incoherent/XnOn/hPhi2", "phi of track 2 ; #phi {-]", {HistType::kTH1F, {axisPhi}}); JPsiToMu.add("JPsiToMu/Incoherent/XnOn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); + JPsiToMu.add("JPsiToMu/NotCoherent/XnOn/hIVM", "J/Psi Invariant Mass ; m {GeV]", {HistType::kTH1F, {axisIVM}}); JPsiToMu.add("JPsiToMu/Incoherent/XnOn/hRap", "Rap of J/Psi ; y {-]", {HistType::kTH1F, {axisEta}}); JPsiToMu.add("JPsiToMu/Incoherent/XnOn/hEta", "Eta of J/Psi ; #eta {-]", {HistType::kTH1F, {axisEta}}); JPsiToMu.add("JPsiToMu/Incoherent/XnOn/hPhi", "Phi of J/Psi ; #phi {-]", {HistType::kTH1F, {axisPhi}}); @@ -720,11 +676,7 @@ struct UpcJpsiCentralBarrel { JPsiToMu.add("JPsiToMu/Incoherent/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); JPsiToMu.add("JPsiToMu/Incoherent/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); JPsiToMu.add("JPsiToMu/Incoherent/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - JPsiToMu.add("JPsiToMu/Incoherent/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); JPsiToMu.add("JPsiToMu/Incoherent/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - JPsiToMu.add("JPsiToMu/Incoherent/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - JPsiToMu.add("JPsiToMu/Incoherent/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - JPsiToMu.add("JPsiToMu/Incoherent/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); // JPsiToP histograms JPsiToP.add("JPsiToP/Coherent/hPt", "Pt of J/Psi ; p_{T} {GeV/c]", {HistType::kTH1F, {axisPt}}); @@ -742,11 +694,7 @@ struct UpcJpsiCentralBarrel { JPsiToP.add("JPsiToP/Coherent/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); JPsiToP.add("JPsiToP/Coherent/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); JPsiToP.add("JPsiToP/Coherent/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - JPsiToP.add("JPsiToP/Coherent/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); JPsiToP.add("JPsiToP/Coherent/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - JPsiToP.add("JPsiToP/Coherent/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - JPsiToP.add("JPsiToP/Coherent/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - JPsiToP.add("JPsiToP/Coherent/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); JPsiToP.add("JPsiToP/Incoherent/hPt", "Pt of J/Psi ; p_{T} {GeV/c]", {HistType::kTH1F, {axisPt}}); JPsiToP.add("JPsiToP/Incoherent/hPt1", "pT of track 1 ; p_{T} {GeV/c]", {HistType::kTH1F, {axisPt}}); @@ -763,11 +711,7 @@ struct UpcJpsiCentralBarrel { JPsiToP.add("JPsiToP/Incoherent/PID/hTPCVsPt", "hTPCVsPt", {HistType::kTH2F, {axisPt, axisTPC}}); JPsiToP.add("JPsiToP/Incoherent/PID/hTPCVsPhi", "hTPCVsPhi", {HistType::kTH2F, {axisPhi, axisTPC}}); JPsiToP.add("JPsiToP/Incoherent/PID/hTPCVsEta", "hTPCVsEta", {HistType::kTH2F, {axisEta, axisTPC}}); - JPsiToP.add("JPsiToP/Incoherent/PID/hTOFVsP", "hTOFVsP", {HistType::kTH2F, {axisP, axisTOF}}); JPsiToP.add("JPsiToP/Incoherent/PID/hBetaTOFVsP", "hBetaTOFVsP", {HistType::kTH2F, {axisP, axisBetaTOF}}); - JPsiToP.add("JPsiToP/Incoherent/PID/hTOFVsPt", "hTOFVsPt", {HistType::kTH2F, {axisPt, axisTOF}}); - JPsiToP.add("JPsiToP/Incoherent/PID/hTOFVsPhi", "hTOFVsPhi", {HistType::kTH2F, {axisPhi, axisTOF}}); - JPsiToP.add("JPsiToP/Incoherent/PID/hTOFVsEta", "hTOFVsEta", {HistType::kTH2F, {axisEta, axisTOF}}); // Correlation histograms Correlation.add("Correlation/Muon/Coherent/AccoplAngle", "AccoplAngle", {HistType::kTH1F, {axisAccAngle}}); @@ -800,9 +744,77 @@ struct UpcJpsiCentralBarrel { // Asymmetry histograms Asymmetry.add("Asymmetry/Muon/Coherent/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Coherent/XnXn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Coherent/OnOn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Coherent/XnOn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Coherent/OnXn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); Asymmetry.add("Asymmetry/Muon/Incoherent/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Incoherent/XnXn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Incoherent/OnOn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Incoherent/XnOn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Incoherent/OnXn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); Asymmetry.add("Asymmetry/Electron/Coherent/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Coherent/XnXn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Coherent/OnOn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Coherent/XnOn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Coherent/OnXn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); Asymmetry.add("Asymmetry/Electron/Incoherent/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Incoherent/XnXn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Incoherent/OnOn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Incoherent/XnOn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Incoherent/OnXn/DeltaPhi", "DeltaPhi", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Coherent/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Coherent/XnXn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Coherent/OnOn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Coherent/XnOn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Coherent/OnXn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Incoherent/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Incoherent/XnXn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Incoherent/OnOn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Incoherent/XnOn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Muon/Incoherent/OnXn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Coherent/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Coherent/XnXn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Coherent/OnOn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Coherent/XnOn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Coherent/OnXn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Incoherent/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Incoherent/XnXn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Incoherent/OnOn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Incoherent/XnOn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + Asymmetry.add("Asymmetry/Electron/Incoherent/OnXn/DeltaPhiRandom", "DeltaPhiRandom", {HistType::kTH1F, {{180, -PI, PI}}}); + + // MC histograms + MC.add("MC/hNumberOfMCCollisions", "hNumberOfCollisions", {HistType::kTH1F, {{10, 0, 10}}}); + MC.add("MC/hNumberOfMCTracks", "hNumberOfMCTracks", {HistType::kTH1F, {{10, 0, 10}}}); + MC.add("MC/hPosZ", "hPosZ", {HistType::kTH1F, {{60, -15, 15}}}); + MC.add("MC/hPDG", "hPDG", {HistType::kTH1F, {{900, -450, 450}}}); + MC.add("MC/hEta1", "hEta1", {HistType::kTH1F, {axisEta}}); + MC.add("MC/hEta2", "hEta2", {HistType::kTH1F, {axisEta}}); + MC.add("MC/hPhi1", "hPhi1", {HistType::kTH1F, {axisPhi}}); + MC.add("MC/hPhi2", "hPhi2", {HistType::kTH1F, {axisPhi}}); + MC.add("MC/hIVM", "hIVM", {HistType::kTH1F, {axisIVM}}); + MC.add("MC/hRapidity", "hRapidity", {HistType::kTH1F, {axisEta}}); + MC.add("MC/hPt1", "hPt1", {HistType::kTH1F, {axisPt}}); + MC.add("MC/hPt2", "hPt2", {HistType::kTH1F, {axisPt}}); + MC.add("MC/hPt", "hPt", {HistType::kTH1F, {axisPt}}); + } + + bool cutITSLayers(uint8_t itsClusterMap) const + { + std::vector>> requiredITSHits{}; + requiredITSHits.push_back(std::make_pair(1, std::array{0, 1, 2})); // at least one hit in the innermost layer + constexpr uint8_t bit = 1; + for (auto& itsRequirement : requiredITSHits) { + auto hits = std::count_if(itsRequirement.second.begin(), itsRequirement.second.end(), [&](auto&& requiredLayer) { return itsClusterMap & (bit << requiredLayer); }); + + if ((itsRequirement.first == -1) && (hits > 0)) { + return false; // no hits were required in specified layers + } else if (hits < itsRequirement.first) { + return false; // not enough hits found in specified layers + } + } + return true; } template @@ -818,60 +830,65 @@ struct UpcJpsiCentralBarrel { Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(2); return false; } - // acceptance + // acceptance cut (TPC) if (std::abs(RecoDecay::eta(std::array{track.px(), track.py(), track.pz()})) > EtaCut) { Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(3); return false; } // DCA if (std::abs(track.dcaZ()) > dcaZCut) { + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(4); return false; } if (DCAcut) { float dcaXYPtCut = 0.0105f + 0.0350f / pow(track.pt(), 1.1f); if (std::abs(track.dcaXY()) > dcaXYPtCut) { - Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(4); + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(5); return false; } } else { if (std::abs(track.dcaXY()) > dcaXYCut) { - Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(4); + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(5); return false; } } // ITS if (!track.hasITS()) { - Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(5); + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(6); return false; } if (track.itsNCls() < ITSNClsCut) { - Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(6); + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(7); + return false; + } + if (!cutITSLayers(track.itsClusterMap())) { + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(8); return false; } if (track.itsChi2NCl() > ITSChi2NClsCut) { - Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(7); + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(9); return false; } // TPC if (!track.hasTPC()) { - Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(8); + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(10); return false; } if (track.tpcNClsCrossedRows() < TPCNClsCrossedRowsCut) { - Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(9); + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(11); return false; } if (track.tpcChi2NCl() > TPCChi2NCls) { - Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(10); + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(12); return false; // TPC chi2 } + if ((track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()) < TPCMinNCls) { + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(13); + return false; + } if (newCutTPC) { - if ((track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()) < TPCMinNCls) { - Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(11); - return false; - } if ((static_cast(track.tpcNClsCrossedRows()) / static_cast(track.tpcNClsFindable())) < TPCCrossedOverFindable) { - Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(12); + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(14); return false; } } @@ -883,12 +900,12 @@ struct UpcJpsiCentralBarrel { bool CandidateCuts(float massJpsi, float rapJpsi) { if (std::abs(rapJpsi) > RapCut) { - Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(13); + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(15); return false; } if (massJpsi < 2.0f) { - Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(14); + Statistics.get(HIST("Statistics/hCutCounterTracks"))->Fill(16); return false; } @@ -899,14 +916,6 @@ struct UpcJpsiCentralBarrel { void fillHistograms(C collision, Ts tracks) { Statistics.get(HIST("Statistics/hCutCounterCollisions"))->Fill(0); // number of collisions without any cuts - RawData.get(HIST("RawData/hPositionX"))->Fill(collision.posX()); - RawData.get(HIST("RawData/hPositionY"))->Fill(collision.posY()); - RawData.get(HIST("RawData/hPositionZ"))->Fill(collision.posZ()); - RawData.get(HIST("RawData/hPositionXY"))->Fill(collision.posX(), collision.posY()); - RawData.get(HIST("RawData/hZNACommonEnergy"))->Fill(collision.energyCommonZNA()); - RawData.get(HIST("RawData/hZNCCommonEnergy"))->Fill(collision.energyCommonZNC()); - RawData.get(HIST("RawData/hZNCTime"))->Fill(collision.timeZNC()); - RawData.get(HIST("RawData/hZNATime"))->Fill(collision.timeZNA()); // check UPC vs standard if (doOnlyUPC) { @@ -959,11 +968,7 @@ struct UpcJpsiCentralBarrel { } if (track.hasTOF()) { - PVContributors.get(HIST("PVContributors/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkPx, trkPy, trkPz), track.tofSignal()); PVContributors.get(HIST("PVContributors/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkPx, trkPy, trkPz), track.beta()); - PVContributors.get(HIST("PVContributors/PID/hTOFVsPt"))->Fill(track.pt(), track.tofSignal()); - PVContributors.get(HIST("PVContributors/PID/hTOFVsEta"))->Fill(RecoDecay::eta(std::array{trkPx, trkPy, trkPz}), track.tofSignal()); - PVContributors.get(HIST("PVContributors/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(trkPx, trkPy), track.tofSignal()); } } @@ -986,19 +991,11 @@ struct UpcJpsiCentralBarrel { } if (track.hasTOF()) { - RawData.get(HIST("RawData/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkPx, trkPy, trkPz), track.tofSignal()); RawData.get(HIST("RawData/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkPx, trkPy, trkPz), track.beta()); - RawData.get(HIST("RawData/PID/hTOFVsPt"))->Fill(track.pt(), track.tofSignal()); - RawData.get(HIST("RawData/PID/hTOFVsEta"))->Fill(RecoDecay::eta(std::array{trkPx, trkPy, trkPz}), track.tofSignal()); - RawData.get(HIST("RawData/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(trkPx, trkPy), track.tofSignal()); } } int countGT = 0; - int countGTMuSigma = 0; - int countGTElSigma = 0; - int countGTPSigma = 0; - int countGTPSigmaTOF = 0; std::vector trkIdx; // loop over tracks with selections if (std::abs(collision.posZ()) > cutVertexZ) { @@ -1006,8 +1003,21 @@ struct UpcJpsiCentralBarrel { return; } + RawData.get(HIST("RawData/hPositionX"))->Fill(collision.posX()); + RawData.get(HIST("RawData/hPositionY"))->Fill(collision.posY()); + RawData.get(HIST("RawData/hPositionZ"))->Fill(collision.posZ()); + RawData.get(HIST("RawData/hPositionXY"))->Fill(collision.posX(), collision.posY()); + RawData.get(HIST("RawData/hZNACommonEnergy"))->Fill(collision.energyCommonZNA()); + RawData.get(HIST("RawData/hZNCCommonEnergy"))->Fill(collision.energyCommonZNC()); + RawData.get(HIST("RawData/hZNAvsZNCCommonEnergy"))->Fill(collision.energyCommonZNA(), collision.energyCommonZNC()); + RawData.get(HIST("RawData/hZNCTime"))->Fill(collision.timeZNC()); + RawData.get(HIST("RawData/hZNATime"))->Fill(collision.timeZNA()); + RawData.get(HIST("RawData/hZNAvsZNCTime"))->Fill(collision.timeZNA(), collision.timeZNC()); + for (auto& track : tracks) { + Statistics.get(HIST("Statistics/hNumberOfTracks"))->Fill(2.); + // select good tracks if (GoodTrackCuts(track) != 1) { continue; @@ -1015,27 +1025,10 @@ struct UpcJpsiCentralBarrel { countGT++; trkIdx.push_back(track.index()); - - if (std::abs(track.tpcNSigmaMu()) <= 3) { - countGTMuSigma++; - } - if (std::abs(track.tpcNSigmaEl()) <= 3) { - countGTElSigma++; - } - if (std::abs(track.tpcNSigmaPr()) <= 3) { - countGTPSigma++; - } - if (std::abs(track.tofNSigmaPr()) <= 3) { - countGTPSigmaTOF++; - } } - Statistics.get(HIST("Statistics/hNumberOfTracks"))->Fill(2., countGT); + Statistics.get(HIST("Statistics/hNumberOfTracks"))->Fill(3., countGT); Statistics.get(HIST("Statistics/hNumberGT"))->Fill(countGT); - Statistics.get(HIST("Statistics/hNumberGTelSigma"))->Fill(countGTElSigma); - Statistics.get(HIST("Statistics/hNumberGTmuSigma"))->Fill(countGTMuSigma); - Statistics.get(HIST("Statistics/hNumberGTpSigma"))->Fill(countGTPSigma); - Statistics.get(HIST("Statistics/hNumberGTpSigmaTOF"))->Fill(countGTPSigmaTOF); float massEl = o2::constants::physics::MassElectron; float massMu = o2::constants::physics::MassMuonMinus; @@ -1075,9 +1068,6 @@ struct UpcJpsiCentralBarrel { TG.get(HIST("TG/PID/hTPCVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tpcSignal()); TG.get(HIST("TG/PID/hTPCVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tpcSignal()); TG.get(HIST("TG/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tpcSignal()); - TG.get(HIST("TG/TPC/hNsigmaMu"))->Fill(trkDaughter1.tpcNSigmaMu()); - TG.get(HIST("TG/TPC/hNsigmaEl"))->Fill(trkDaughter1.tpcNSigmaEl()); - TG.get(HIST("TG/TPC/hNsigmaPr"))->Fill(trkDaughter1.tpcNSigmaPr()); TG.get(HIST("TG/hTPCNClsFindable"))->Fill(trkDaughter1.tpcNClsFindable()); TG.get(HIST("TG/hTPCNClsFindableMinusFound"))->Fill(trkDaughter1.tpcNClsFindableMinusFound()); if (trkDaughter1.sign() < 0) { @@ -1091,30 +1081,14 @@ struct UpcJpsiCentralBarrel { TG.get(HIST("TG/PID/hTPCVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tpcSignal()); TG.get(HIST("TG/PID/hTPCVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tpcSignal()); TG.get(HIST("TG/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tpcSignal()); - TG.get(HIST("TG/TPC/hNsigmaMu"))->Fill(trkDaughter2.tpcNSigmaMu()); - TG.get(HIST("TG/TPC/hNsigmaEl"))->Fill(trkDaughter2.tpcNSigmaEl()); - TG.get(HIST("TG/TPC/hNsigmaPr"))->Fill(trkDaughter2.tpcNSigmaPr()); TG.get(HIST("TG/hTPCNClsFindable"))->Fill(trkDaughter2.tpcNClsFindable()); TG.get(HIST("TG/hTPCNClsFindableMinusFound"))->Fill(trkDaughter2.tpcNClsFindableMinusFound()); } if (trkDaughter1.hasTOF()) { - TG.get(HIST("TG/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); - TG.get(HIST("TG/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - TG.get(HIST("TG/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - TG.get(HIST("TG/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); - TG.get(HIST("TG/TOF/hNsigmaMu"))->Fill(trkDaughter1.tofNSigmaMu()); - TG.get(HIST("TG/TOF/hNsigmaEl"))->Fill(trkDaughter1.tofNSigmaEl()); - TG.get(HIST("TG/TOF/hNsigmaPr"))->Fill(trkDaughter1.tofNSigmaPr()); + TG.get(HIST("TG/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); } if (trkDaughter2.hasTOF()) { - TG.get(HIST("TG/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tofSignal()); TG.get(HIST("TG/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - TG.get(HIST("TG/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tofSignal()); - TG.get(HIST("TG/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tofSignal()); - TG.get(HIST("TG/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tofSignal()); - TG.get(HIST("TG/TOF/hNsigmaMu"))->Fill(trkDaughter2.tofNSigmaMu()); - TG.get(HIST("TG/TOF/hNsigmaEl"))->Fill(trkDaughter2.tofNSigmaEl()); - TG.get(HIST("TG/TOF/hNsigmaPr"))->Fill(trkDaughter2.tofNSigmaPr()); } if (doElectrons) { if (RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaMu(), trkDaughter2.tpcNSigmaMu()) > RecoDecay::sumOfSquares(trkDaughter1.tpcNSigmaEl(), trkDaughter2.tpcNSigmaEl())) { @@ -1180,34 +1154,18 @@ struct UpcJpsiCentralBarrel { TGel.get(HIST("TGel/PID/hTPCVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tpcSignal()); TGel.get(HIST("TGel/PID/hTPCVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tpcSignal()); TGel.get(HIST("TGel/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tpcSignal()); - TGel.get(HIST("TGel/hNsigmaEl"))->Fill(trkDaughter1.tpcNSigmaEl()); } if (trkDaughter2.hasTPC()) { TGel.get(HIST("TGel/PID/hTPCVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tpcSignal()); TGel.get(HIST("TGel/PID/hTPCVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tpcSignal()); TGel.get(HIST("TGel/PID/hTPCVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tpcSignal()); TGel.get(HIST("TGel/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tpcSignal()); - TGel.get(HIST("TGel/hNsigmaEl"))->Fill(trkDaughter2.tpcNSigmaEl()); - if (trkDaughter1.sign() < 0) { - TGel.get(HIST("TGel/TPCNegVsPosSignal"))->Fill(trkDaughter1.tpcSignal(), trkDaughter2.tpcSignal()); - } else { - TGel.get(HIST("TGel/TPCNegVsPosSignal"))->Fill(trkDaughter2.tpcSignal(), trkDaughter1.tpcSignal()); - } } if (trkDaughter1.hasTOF()) { - TGel.get(HIST("TGel/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); - TGel.get(HIST("TGel/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - TGel.get(HIST("TGel/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - TGel.get(HIST("TGel/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); - TGel.get(HIST("TGel/hNsigmaElTOF"))->Fill(trkDaughter1.tofNSigmaEl()); + TGel.get(HIST("TGel/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); } if (trkDaughter2.hasTOF()) { - TGel.get(HIST("TGel/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tofSignal()); TGel.get(HIST("TGel/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - TGel.get(HIST("TGel/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tofSignal()); - TGel.get(HIST("TGel/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tofSignal()); - TGel.get(HIST("TGel/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tofSignal()); - TGel.get(HIST("TGel/hNsigmaElTOF"))->Fill(trkDaughter2.tofNSigmaEl()); } if (CandidateCuts(massJpsi, rapJpsi) != 1) { @@ -1220,8 +1178,6 @@ struct UpcJpsiCentralBarrel { TGelCand.get(HIST("TGelCand/hTrackEta2"))->Fill(RecoDecay::eta(daughter2)); TGelCand.get(HIST("TGelCand/hTrackPhi1"))->Fill(RecoDecay::phi(daughter1)); TGelCand.get(HIST("TGelCand/hTrackPhi2"))->Fill(RecoDecay::phi(daughter2)); - TGelCand.get(HIST("TGelCand/hTrackITSNcls1"))->Fill(trkDaughter1.itsNCls()); - TGelCand.get(HIST("TGelCand/hTrackITSNcls2"))->Fill(trkDaughter2.itsNCls()); TGelCand.get(HIST("TGelCand/hPairPt"))->Fill(RecoDecay::pt(mother)); TGelCand.get(HIST("TGelCand/hPairIVM"))->Fill(massJpsi); @@ -1243,28 +1199,57 @@ struct UpcJpsiCentralBarrel { TGelCand.get(HIST("TGelCand/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tpcSignal()); } if (trkDaughter1.hasTOF()) { - TGelCand.get(HIST("TGelCand/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); - TGelCand.get(HIST("TGelCand/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - TGelCand.get(HIST("TGelCand/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - TGelCand.get(HIST("TGelCand/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); + TGelCand.get(HIST("TGelCand/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); } if (trkDaughter2.hasTOF()) { - TGelCand.get(HIST("TGelCand/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tofSignal()); TGelCand.get(HIST("TGelCand/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - TGelCand.get(HIST("TGelCand/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tofSignal()); - TGelCand.get(HIST("TGelCand/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tofSignal()); - TGelCand.get(HIST("TGelCand/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tofSignal()); } if (RecoDecay::pt(mother) < 0.2f) { JPsiToEl.get(HIST("JPsiToEl/Coherent/hIVM"))->Fill(massJpsi); + if (XnXn) { + JPsiToEl.get(HIST("JPsiToEl/Coherent/XnXn/hIVM"))->Fill(massJpsi); + } else if (OnXn) { + JPsiToEl.get(HIST("JPsiToEl/Coherent/OnXn/hIVM"))->Fill(massJpsi); + } else if (XnOn) { + JPsiToEl.get(HIST("JPsiToEl/Coherent/XnOn/hIVM"))->Fill(massJpsi); + } else if (OnOn) { + JPsiToEl.get(HIST("JPsiToEl/Coherent/OnOn/hIVM"))->Fill(massJpsi); + } + } else if (RecoDecay::pt(mother) > 0.4f) { + JPsiToEl.get(HIST("JPsiToEl/NotCoherent/hIVM"))->Fill(massJpsi); + if (XnXn) { + JPsiToEl.get(HIST("JPsiToEl/NotCoherent/XnXn/hIVM"))->Fill(massJpsi); + } else if (OnXn) { + JPsiToEl.get(HIST("JPsiToEl/NotCoherent/OnXn/hIVM"))->Fill(massJpsi); + } else if (XnOn) { + JPsiToEl.get(HIST("JPsiToEl/NotCoherent/XnOn/hIVM"))->Fill(massJpsi); + } else if (OnOn) { + JPsiToEl.get(HIST("JPsiToEl/NotCoherent/OnOn/hIVM"))->Fill(massJpsi); + } } else { JPsiToEl.get(HIST("JPsiToEl/Incoherent/hIVM"))->Fill(massJpsi); + if (XnXn) { + JPsiToEl.get(HIST("JPsiToEl/Incoherent/XnXn/hIVM"))->Fill(massJpsi); + } else if (OnXn) { + JPsiToEl.get(HIST("JPsiToEl/Incoherent/OnXn/hIVM"))->Fill(massJpsi); + } else if (XnOn) { + JPsiToEl.get(HIST("JPsiToEl/Incoherent/XnOn/hIVM"))->Fill(massJpsi); + } else if (OnOn) { + JPsiToEl.get(HIST("JPsiToEl/Incoherent/OnOn/hIVM"))->Fill(massJpsi); + } } if ((massJpsi < maxJpsiMass) && (massJpsi > minJpsiMass)) { TGelCand.get(HIST("TGelCand/hJpsiPt"))->Fill(RecoDecay::pt(mother)); TGelCand.get(HIST("TGelCand/hJpsiRap"))->Fill(rapJpsi); + + if (trkDaughter1.sign() < 0) { + TGelCand.get(HIST("TGelCand/TPCNegVsPosSignal"))->Fill(trkDaughter1.tpcSignal(), trkDaughter2.tpcSignal()); + } else { + TGelCand.get(HIST("TGelCand/TPCNegVsPosSignal"))->Fill(trkDaughter2.tpcSignal(), trkDaughter1.tpcSignal()); + } + if (RecoDecay::pt(mother) < 0.2f) { // fill track histos JPsiToEl.get(HIST("JPsiToEl/Coherent/hPt1"))->Fill(trkDaughter1.pt()); @@ -1318,18 +1303,10 @@ struct UpcJpsiCentralBarrel { } if (trkDaughter1.hasTOF()) { - JPsiToEl.get(HIST("JPsiToEl/Coherent/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); JPsiToEl.get(HIST("JPsiToEl/Coherent/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); - JPsiToEl.get(HIST("JPsiToEl/Coherent/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - JPsiToEl.get(HIST("JPsiToEl/Coherent/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - JPsiToEl.get(HIST("JPsiToEl/Coherent/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); } if (trkDaughter2.hasTOF()) { - JPsiToEl.get(HIST("JPsiToEl/Coherent/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tofSignal()); JPsiToEl.get(HIST("JPsiToEl/Coherent/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - JPsiToEl.get(HIST("JPsiToEl/Coherent/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tofSignal()); - JPsiToEl.get(HIST("JPsiToEl/Coherent/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tofSignal()); - JPsiToEl.get(HIST("JPsiToEl/Coherent/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tofSignal()); } // fill J/psi histos JPsiToEl.get(HIST("JPsiToEl/Coherent/hPt"))->Fill(RecoDecay::pt(mother)); @@ -1369,6 +1346,27 @@ struct UpcJpsiCentralBarrel { double dp = DeltaPhi(daughter[0], daughter[1]); Asymmetry.get(HIST("Asymmetry/Electron/Coherent/DeltaPhi"))->Fill(dp); + if (XnXn) { + Asymmetry.get(HIST("Asymmetry/Electron/Coherent/XnXn/DeltaPhi"))->Fill(dp); + } else if (OnOn) { + Asymmetry.get(HIST("Asymmetry/Electron/Coherent/OnOn/DeltaPhi"))->Fill(dp); + } else if (XnOn) { + Asymmetry.get(HIST("Asymmetry/Electron/Coherent/XnOn/DeltaPhi"))->Fill(dp); + } else if (OnXn) { + Asymmetry.get(HIST("Asymmetry/Electron/Coherent/OnXn/DeltaPhi"))->Fill(dp); + } + + double dpRandom = DeltaPhiRandom(daughter[0], daughter[1]); + Asymmetry.get(HIST("Asymmetry/Electron/Coherent/DeltaPhiRandom"))->Fill(dpRandom); + if (XnXn) { + Asymmetry.get(HIST("Asymmetry/Electron/Coherent/XnXn/DeltaPhiRandom"))->Fill(dpRandom); + } else if (OnOn) { + Asymmetry.get(HIST("Asymmetry/Electron/Coherent/OnOn/DeltaPhiRandom"))->Fill(dpRandom); + } else if (XnOn) { + Asymmetry.get(HIST("Asymmetry/Electron/Coherent/XnOn/DeltaPhiRandom"))->Fill(dpRandom); + } else if (OnXn) { + Asymmetry.get(HIST("Asymmetry/Electron/Coherent/OnXn/DeltaPhiRandom"))->Fill(dpRandom); + } delete[] q; } // end coherent electrons @@ -1425,18 +1423,10 @@ struct UpcJpsiCentralBarrel { } if (trkDaughter1.hasTOF()) { - JPsiToEl.get(HIST("JPsiToEl/Incoherent/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); JPsiToEl.get(HIST("JPsiToEl/Incoherent/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); - JPsiToEl.get(HIST("JPsiToEl/Incoherent/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - JPsiToEl.get(HIST("JPsiToEl/Incoherent/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - JPsiToEl.get(HIST("JPsiToEl/Incoherent/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); } if (trkDaughter2.hasTOF()) { - JPsiToEl.get(HIST("JPsiToEl/Incoherent/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tofSignal()); JPsiToEl.get(HIST("JPsiToEl/Incoherent/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - JPsiToEl.get(HIST("JPsiToEl/Incoherent/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tofSignal()); - JPsiToEl.get(HIST("JPsiToEl/Incoherent/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tofSignal()); - JPsiToEl.get(HIST("JPsiToEl/Incoherent/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tofSignal()); } // fill J/psi histos JPsiToEl.get(HIST("JPsiToEl/Incoherent/hPt"))->Fill(RecoDecay::pt(mother)); @@ -1476,6 +1466,27 @@ struct UpcJpsiCentralBarrel { double dp = DeltaPhi(daughter[0], daughter[1]); Asymmetry.get(HIST("Asymmetry/Electron/Incoherent/DeltaPhi"))->Fill(dp); + if (XnXn) { + Asymmetry.get(HIST("Asymmetry/Electron/Incoherent/XnXn/DeltaPhi"))->Fill(dp); + } else if (OnOn) { + Asymmetry.get(HIST("Asymmetry/Electron/Incoherent/OnOn/DeltaPhi"))->Fill(dp); + } else if (XnOn) { + Asymmetry.get(HIST("Asymmetry/Electron/Incoherent/XnOn/DeltaPhi"))->Fill(dp); + } else if (OnXn) { + Asymmetry.get(HIST("Asymmetry/Electron/Incoherent/OnXn/DeltaPhi"))->Fill(dp); + } + + double dpRandom = DeltaPhiRandom(daughter[0], daughter[1]); + Asymmetry.get(HIST("Asymmetry/Electron/Incoherent/DeltaPhiRandom"))->Fill(dpRandom); + if (XnXn) { + Asymmetry.get(HIST("Asymmetry/Electron/Incoherent/XnXn/DeltaPhiRandom"))->Fill(dpRandom); + } else if (OnOn) { + Asymmetry.get(HIST("Asymmetry/Electron/Incoherent/OnOn/DeltaPhiRandom"))->Fill(dpRandom); + } else if (XnOn) { + Asymmetry.get(HIST("Asymmetry/Electron/Incoherent/XnOn/DeltaPhiRandom"))->Fill(dpRandom); + } else if (OnXn) { + Asymmetry.get(HIST("Asymmetry/Electron/Incoherent/OnXn/DeltaPhiRandom"))->Fill(dpRandom); + } delete[] q; } // end incoherent electrons @@ -1546,7 +1557,6 @@ struct UpcJpsiCentralBarrel { TGmu.get(HIST("TGmu/PID/hTPCVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tpcSignal()); TGmu.get(HIST("TGmu/PID/hTPCVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tpcSignal()); TGmu.get(HIST("TGmu/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tpcSignal()); - TGmu.get(HIST("TGmu/hNsigmaMu"))->Fill(trkDaughter1.tpcNSigmaMu()); if (trkDaughter1.sign() < 0) { TGmu.get(HIST("TGmu/TPCNegVsPosSignal"))->Fill(trkDaughter1.tpcSignal(), trkDaughter2.tpcSignal()); } else { @@ -1558,22 +1568,13 @@ struct UpcJpsiCentralBarrel { TGmu.get(HIST("TGmu/PID/hTPCVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tpcSignal()); TGmu.get(HIST("TGmu/PID/hTPCVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tpcSignal()); TGmu.get(HIST("TGmu/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tpcSignal()); - TGmu.get(HIST("TGmu/hNsigmaMu"))->Fill(trkDaughter2.tpcNSigmaMu()); } if (trkDaughter1.hasTOF()) { - TGmu.get(HIST("TGmu/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); - TGmu.get(HIST("TGmu/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - TGmu.get(HIST("TGmu/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - TGmu.get(HIST("TGmu/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); - TGmu.get(HIST("TGmu/hNsigmaMuTOF"))->Fill(trkDaughter1.tofNSigmaMu()); + TGmu.get(HIST("TGmu/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); } if (trkDaughter2.hasTOF()) { - TGmu.get(HIST("TGmu/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tofSignal()); + TGmu.get(HIST("TGmu/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - TGmu.get(HIST("TGmu/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tofSignal()); - TGmu.get(HIST("TGmu/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tofSignal()); - TGmu.get(HIST("TGmu/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tofSignal()); - TGmu.get(HIST("TGmu/hNsigmaMuTOF"))->Fill(trkDaughter1.tofNSigmaMu()); } if (CandidateCuts(massJpsi, rapJpsi) != 1) { @@ -1586,8 +1587,6 @@ struct UpcJpsiCentralBarrel { TGmuCand.get(HIST("TGmuCand/hTrackEta2"))->Fill(RecoDecay::eta(daughter2)); TGmuCand.get(HIST("TGmuCand/hTrackPhi1"))->Fill(RecoDecay::phi(daughter1)); TGmuCand.get(HIST("TGmuCand/hTrackPhi2"))->Fill(RecoDecay::phi(daughter2)); - TGmuCand.get(HIST("TGmuCand/hTrackITSNcls1"))->Fill(trkDaughter1.itsNCls()); - TGmuCand.get(HIST("TGmuCand/hTrackITSNcls2"))->Fill(trkDaughter2.itsNCls()); TGmuCand.get(HIST("TGmuCand/hPairPt"))->Fill(RecoDecay::pt(mother)); TGmuCand.get(HIST("TGmuCand/hPairIVM"))->Fill(massJpsi); @@ -1596,11 +1595,6 @@ struct UpcJpsiCentralBarrel { TGmuCand.get(HIST("TGmuCand/PID/hTPCVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tpcSignal()); TGmuCand.get(HIST("TGmuCand/PID/hTPCVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tpcSignal()); TGmuCand.get(HIST("TGmuCand/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tpcSignal()); - if (trkDaughter1.sign() < 0) { - TGmuCand.get(HIST("TGmuCand/TPCNegVsPosSignal"))->Fill(trkDaughter1.tpcSignal(), trkDaughter2.tpcSignal()); - } else { - TGmuCand.get(HIST("TGmuCand/TPCNegVsPosSignal"))->Fill(trkDaughter2.tpcSignal(), trkDaughter1.tpcSignal()); - } } if (trkDaughter2.hasTPC()) { TGmuCand.get(HIST("TGmuCand/PID/hTPCVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tpcSignal()); @@ -1609,31 +1603,71 @@ struct UpcJpsiCentralBarrel { TGmuCand.get(HIST("TGmuCand/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tpcSignal()); } if (trkDaughter1.hasTOF()) { - TGmuCand.get(HIST("TGmuCand/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); - TGmuCand.get(HIST("TGmuCand/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - TGmuCand.get(HIST("TGmuCand/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - TGmuCand.get(HIST("TGmuCand/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); + TGmuCand.get(HIST("TGmuCand/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); } if (trkDaughter2.hasTOF()) { - TGmuCand.get(HIST("TGmuCand/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tofSignal()); TGmuCand.get(HIST("TGmuCand/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - TGmuCand.get(HIST("TGmuCand/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tofSignal()); - TGmuCand.get(HIST("TGmuCand/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tofSignal()); - TGmuCand.get(HIST("TGmuCand/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tofSignal()); } if (RecoDecay::pt(mother) < 0.2f) { JPsiToMu.get(HIST("JPsiToMu/Coherent/hIVM"))->Fill(massJpsi); + if (XnXn) { + JPsiToMu.get(HIST("JPsiToMu/Coherent/XnXn/hIVM"))->Fill(massJpsi); + } else if (OnXn) { + JPsiToMu.get(HIST("JPsiToMu/Coherent/OnXn/hIVM"))->Fill(massJpsi); + } else if (XnOn) { + JPsiToMu.get(HIST("JPsiToMu/Coherent/XnOn/hIVM"))->Fill(massJpsi); + } else if (OnOn) { + JPsiToMu.get(HIST("JPsiToMu/Coherent/OnOn/hIVM"))->Fill(massJpsi); + } + } else if (RecoDecay::pt(mother) > 0.4f) { + JPsiToMu.get(HIST("JPsiToMu/NotCoherent/hIVM"))->Fill(massJpsi); + if (XnXn) { + JPsiToMu.get(HIST("JPsiToMu/NotCoherent/XnXn/hIVM"))->Fill(massJpsi); + } else if (OnXn) { + JPsiToMu.get(HIST("JPsiToMu/NotCoherent/OnXn/hIVM"))->Fill(massJpsi); + } else if (XnOn) { + JPsiToMu.get(HIST("JPsiToMu/NotCoherent/XnOn/hIVM"))->Fill(massJpsi); + } else if (OnOn) { + JPsiToMu.get(HIST("JPsiToMu/NotCoherent/OnOn/hIVM"))->Fill(massJpsi); + } } else { JPsiToMu.get(HIST("JPsiToMu/Incoherent/hIVM"))->Fill(massJpsi); + if (XnXn) { + JPsiToMu.get(HIST("JPsiToMu/Incoherent/XnXn/hIVM"))->Fill(massJpsi); + } else if (OnXn) { + JPsiToMu.get(HIST("JPsiToMu/Incoherent/OnXn/hIVM"))->Fill(massJpsi); + } else if (XnOn) { + JPsiToMu.get(HIST("JPsiToMu/Incoherent/XnOn/hIVM"))->Fill(massJpsi); + } else if (OnOn) { + JPsiToMu.get(HIST("JPsiToMu/Incoherent/OnOn/hIVM"))->Fill(massJpsi); + } } if ((massJpsi < maxJpsiMass) && (massJpsi > minJpsiMass)) { TGmuCand.get(HIST("TGmuCand/hJpsiPt"))->Fill(RecoDecay::pt(mother)); + if (RecoDecay::pt(mother) < 0.1f) { + TGmuCand.get(HIST("TGmuCand/hJpsiPt2"))->Fill(RecoDecay::pt(mother) * RecoDecay::pt(mother)); + if (XnXn) { + TGmuCand.get(HIST("TGmuCand/XnXn/hJpsiPt2"))->Fill(RecoDecay::pt(mother) * RecoDecay::pt(mother)); + } else if (XnOn) { + TGmuCand.get(HIST("TGmuCand/XnOn/hJpsiPt2"))->Fill(RecoDecay::pt(mother) * RecoDecay::pt(mother)); + } else if (OnXn) { + TGmuCand.get(HIST("TGmuCand/OnXn/hJpsiPt2"))->Fill(RecoDecay::pt(mother) * RecoDecay::pt(mother)); + } else if (OnOn) { + TGmuCand.get(HIST("TGmuCand/OnOn/hJpsiPt2"))->Fill(RecoDecay::pt(mother) * RecoDecay::pt(mother)); + } + } TGmuCand.get(HIST("TGmuCand/hJpsiRap"))->Fill(rapJpsi); + if (trkDaughter1.sign() < 0) { + TGmuCand.get(HIST("TGmuCand/TPCNegVsPosSignal"))->Fill(trkDaughter1.tpcSignal(), trkDaughter2.tpcSignal()); + } else { + TGmuCand.get(HIST("TGmuCand/TPCNegVsPosSignal"))->Fill(trkDaughter2.tpcSignal(), trkDaughter1.tpcSignal()); + } if (RecoDecay::pt(mother) < 0.2f) { // fill track histos + TGmuCand.get(HIST("TGmuCand/hJpsiPt2wide"))->Fill(RecoDecay::pt(mother) * RecoDecay::pt(mother)); JPsiToMu.get(HIST("JPsiToMu/Coherent/hPt1"))->Fill(trkDaughter1.pt()); JPsiToMu.get(HIST("JPsiToMu/Coherent/hPt2"))->Fill(trkDaughter2.pt()); JPsiToMu.get(HIST("JPsiToMu/Coherent/hEta1"))->Fill(RecoDecay::eta(daughter1)); @@ -1648,6 +1682,7 @@ struct UpcJpsiCentralBarrel { JPsiToMu.get(HIST("JPsiToMu/Coherent/XnXn/hEta2"))->Fill(RecoDecay::eta(daughter2)); JPsiToMu.get(HIST("JPsiToMu/Coherent/XnXn/hPhi1"))->Fill(RecoDecay::phi(daughter1)); JPsiToMu.get(HIST("JPsiToMu/Coherent/XnXn/hPhi2"))->Fill(RecoDecay::phi(daughter2)); + TGmuCand.get(HIST("TGmuCand/XnXn/hJpsiPt2wide"))->Fill(RecoDecay::pt(mother) * RecoDecay::pt(mother)); } else if (OnOn) { JPsiToMu.get(HIST("JPsiToMu/Coherent/OnOn/hPt1"))->Fill(trkDaughter1.pt()); JPsiToMu.get(HIST("JPsiToMu/Coherent/OnOn/hPt2"))->Fill(trkDaughter2.pt()); @@ -1655,6 +1690,7 @@ struct UpcJpsiCentralBarrel { JPsiToMu.get(HIST("JPsiToMu/Coherent/OnOn/hEta2"))->Fill(RecoDecay::eta(daughter2)); JPsiToMu.get(HIST("JPsiToMu/Coherent/OnOn/hPhi1"))->Fill(RecoDecay::phi(daughter1)); JPsiToMu.get(HIST("JPsiToMu/Coherent/OnOn/hPhi2"))->Fill(RecoDecay::phi(daughter2)); + TGmuCand.get(HIST("TGmuCand/OnOn/hJpsiPt2wide"))->Fill(RecoDecay::pt(mother) * RecoDecay::pt(mother)); } else if (XnOn) { JPsiToMu.get(HIST("JPsiToMu/Coherent/XnOn/hPt1"))->Fill(trkDaughter1.pt()); JPsiToMu.get(HIST("JPsiToMu/Coherent/XnOn/hPt2"))->Fill(trkDaughter2.pt()); @@ -1662,6 +1698,7 @@ struct UpcJpsiCentralBarrel { JPsiToMu.get(HIST("JPsiToMu/Coherent/XnOn/hEta2"))->Fill(RecoDecay::eta(daughter2)); JPsiToMu.get(HIST("JPsiToMu/Coherent/XnOn/hPhi1"))->Fill(RecoDecay::phi(daughter1)); JPsiToMu.get(HIST("JPsiToMu/Coherent/XnOn/hPhi2"))->Fill(RecoDecay::phi(daughter2)); + TGmuCand.get(HIST("TGmuCand/XnOn/hJpsiPt2wide"))->Fill(RecoDecay::pt(mother) * RecoDecay::pt(mother)); } else if (OnXn) { JPsiToMu.get(HIST("JPsiToMu/Coherent/OnXn/hPt1"))->Fill(trkDaughter1.pt()); JPsiToMu.get(HIST("JPsiToMu/Coherent/OnXn/hPt2"))->Fill(trkDaughter2.pt()); @@ -1669,6 +1706,7 @@ struct UpcJpsiCentralBarrel { JPsiToMu.get(HIST("JPsiToMu/Coherent/OnXn/hEta2"))->Fill(RecoDecay::eta(daughter2)); JPsiToMu.get(HIST("JPsiToMu/Coherent/OnXn/hPhi1"))->Fill(RecoDecay::phi(daughter1)); JPsiToMu.get(HIST("JPsiToMu/Coherent/OnXn/hPhi2"))->Fill(RecoDecay::phi(daughter2)); + TGmuCand.get(HIST("TGmuCand/OnXn/hJpsiPt2wide"))->Fill(RecoDecay::pt(mother) * RecoDecay::pt(mother)); } if (trkDaughter1.hasTPC()) { @@ -1684,18 +1722,10 @@ struct UpcJpsiCentralBarrel { JPsiToMu.get(HIST("JPsiToMu/Coherent/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tpcSignal()); } if (trkDaughter1.hasTOF()) { - JPsiToMu.get(HIST("JPsiToMu/Coherent/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); JPsiToMu.get(HIST("JPsiToMu/Coherent/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); - JPsiToMu.get(HIST("JPsiToMu/Coherent/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - JPsiToMu.get(HIST("JPsiToMu/Coherent/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - JPsiToMu.get(HIST("JPsiToMu/Coherent/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); } if (trkDaughter2.hasTOF()) { - JPsiToMu.get(HIST("JPsiToMu/Coherent/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tofSignal()); JPsiToMu.get(HIST("JPsiToMu/Coherent/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - JPsiToMu.get(HIST("JPsiToMu/Coherent/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tofSignal()); - JPsiToMu.get(HIST("JPsiToMu/Coherent/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tofSignal()); - JPsiToMu.get(HIST("JPsiToMu/Coherent/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tofSignal()); } // fill J/psi histos JPsiToMu.get(HIST("JPsiToMu/Coherent/hPt"))->Fill(RecoDecay::pt(mother)); @@ -1735,6 +1765,26 @@ struct UpcJpsiCentralBarrel { double dp = DeltaPhi(daughter[0], daughter[1]); Asymmetry.get(HIST("Asymmetry/Muon/Coherent/DeltaPhi"))->Fill(dp); + if (XnXn) { + Asymmetry.get(HIST("Asymmetry/Muon/Coherent/XnXn/DeltaPhi"))->Fill(dp); + } else if (OnOn) { + Asymmetry.get(HIST("Asymmetry/Muon/Coherent/OnOn/DeltaPhi"))->Fill(dp); + } else if (XnOn) { + Asymmetry.get(HIST("Asymmetry/Muon/Coherent/XnOn/DeltaPhi"))->Fill(dp); + } else if (OnXn) { + Asymmetry.get(HIST("Asymmetry/Muon/Coherent/OnXn/DeltaPhi"))->Fill(dp); + } + double dpRandom = DeltaPhiRandom(daughter[0], daughter[1]); + Asymmetry.get(HIST("Asymmetry/Muon/Coherent/DeltaPhiRandom"))->Fill(dpRandom); + if (XnXn) { + Asymmetry.get(HIST("Asymmetry/Muon/Coherent/XnXn/DeltaPhiRandom"))->Fill(dpRandom); + } else if (OnOn) { + Asymmetry.get(HIST("Asymmetry/Muon/Coherent/OnOn/DeltaPhiRandom"))->Fill(dpRandom); + } else if (XnOn) { + Asymmetry.get(HIST("Asymmetry/Muon/Coherent/XnOn/DeltaPhiRandom"))->Fill(dpRandom); + } else if (OnXn) { + Asymmetry.get(HIST("Asymmetry/Muon/Coherent/OnXn/DeltaPhiRandom"))->Fill(dpRandom); + } delete[] q; } @@ -1790,18 +1840,10 @@ struct UpcJpsiCentralBarrel { JPsiToMu.get(HIST("JPsiToMu/Incoherent/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tpcSignal()); } if (trkDaughter1.hasTOF()) { - JPsiToMu.get(HIST("JPsiToMu/Incoherent/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); JPsiToMu.get(HIST("JPsiToMu/Incoherent/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); - JPsiToMu.get(HIST("JPsiToMu/Incoherent/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - JPsiToMu.get(HIST("JPsiToMu/Incoherent/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - JPsiToMu.get(HIST("JPsiToMu/Incoherent/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); } if (trkDaughter2.hasTOF()) { - JPsiToMu.get(HIST("JPsiToMu/Incoherent/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tpcSignal()); JPsiToMu.get(HIST("JPsiToMu/Incoherent/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - JPsiToMu.get(HIST("JPsiToMu/Incoherent/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tpcSignal()); - JPsiToMu.get(HIST("JPsiToMu/Incoherent/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tpcSignal()); - JPsiToMu.get(HIST("JPsiToMu/Incoherent/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tpcSignal()); } // fill J/psi histos @@ -1842,6 +1884,27 @@ struct UpcJpsiCentralBarrel { double dp = DeltaPhi(daughter[0], daughter[1]); Asymmetry.get(HIST("Asymmetry/Muon/Incoherent/DeltaPhi"))->Fill(dp); + if (XnXn) { + Asymmetry.get(HIST("Asymmetry/Muon/Incoherent/XnXn/DeltaPhi"))->Fill(dp); + } else if (OnOn) { + Asymmetry.get(HIST("Asymmetry/Muon/Incoherent/OnOn/DeltaPhi"))->Fill(dp); + } else if (XnOn) { + Asymmetry.get(HIST("Asymmetry/Muon/Incoherent/XnOn/DeltaPhi"))->Fill(dp); + } else if (OnXn) { + Asymmetry.get(HIST("Asymmetry/Muon/Incoherent/OnXn/DeltaPhi"))->Fill(dp); + } + + double dpRandom = DeltaPhiRandom(daughter[0], daughter[1]); + Asymmetry.get(HIST("Asymmetry/Muon/Incoherent/DeltaPhiRandom"))->Fill(dpRandom); + if (XnXn) { + Asymmetry.get(HIST("Asymmetry/Muon/Incoherent/XnXn/DeltaPhiRandom"))->Fill(dpRandom); + } else if (OnOn) { + Asymmetry.get(HIST("Asymmetry/Muon/Incoherent/OnOn/DeltaPhiRandom"))->Fill(dpRandom); + } else if (XnOn) { + Asymmetry.get(HIST("Asymmetry/Muon/Incoherent/XnOn/DeltaPhiRandom"))->Fill(dpRandom); + } else if (OnXn) { + Asymmetry.get(HIST("Asymmetry/Muon/Incoherent/OnXn/DeltaPhiRandom"))->Fill(dpRandom); + } delete[] q; } @@ -1888,29 +1951,18 @@ struct UpcJpsiCentralBarrel { TGp.get(HIST("TGp/PID/hTPCVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tpcSignal()); TGp.get(HIST("TGp/PID/hTPCVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tpcSignal()); TGp.get(HIST("TGp/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tpcSignal()); - TGp.get(HIST("TGp/hNsigmaMu"))->Fill(trkDaughter1.tpcNSigmaPr()); } if (trkDaughter2.hasTPC()) { TGp.get(HIST("TGp/PID/hTPCVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tpcSignal()); TGp.get(HIST("TGp/PID/hTPCVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tpcSignal()); TGp.get(HIST("TGp/PID/hTPCVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tpcSignal()); TGp.get(HIST("TGp/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tpcSignal()); - TGp.get(HIST("TGp/hNsigmaMu"))->Fill(trkDaughter2.tpcNSigmaPr()); } if (trkDaughter1.hasTOF()) { - TGp.get(HIST("TGp/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); - TGp.get(HIST("TGp/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - TGp.get(HIST("TGp/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - TGp.get(HIST("TGp/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); - TGp.get(HIST("TGp/hNsigmaMuTOF"))->Fill(trkDaughter1.tofNSigmaPr()); + TGp.get(HIST("TGp/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); } if (trkDaughter2.hasTOF()) { - TGp.get(HIST("TGp/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tofSignal()); TGp.get(HIST("TGp/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - TGp.get(HIST("TGp/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tofSignal()); - TGp.get(HIST("TGp/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tofSignal()); - TGp.get(HIST("TGp/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tofSignal()); - TGp.get(HIST("TGp/hNsigmaMuTOF"))->Fill(trkDaughter2.tofNSigmaPr()); } if (CandidateCuts(massJpsi, rapJpsi) != 1) { @@ -1923,8 +1975,6 @@ struct UpcJpsiCentralBarrel { TGpCand.get(HIST("TGpCand/hTrackEta2"))->Fill(RecoDecay::eta(daughter2)); TGpCand.get(HIST("TGpCand/hTrackPhi1"))->Fill(RecoDecay::phi(daughter1)); TGpCand.get(HIST("TGpCand/hTrackPhi2"))->Fill(RecoDecay::phi(daughter2)); - TGpCand.get(HIST("TGpCand/hTrackITSNcls1"))->Fill(trkDaughter1.itsNCls()); - TGpCand.get(HIST("TGpCand/hTrackITSNcls2"))->Fill(trkDaughter2.itsNCls()); TGpCand.get(HIST("TGpCand/hPairPt"))->Fill(RecoDecay::pt(mother)); TGpCand.get(HIST("TGpCand/hPairIVM"))->Fill(massJpsi); @@ -1941,17 +1991,10 @@ struct UpcJpsiCentralBarrel { TGpCand.get(HIST("TGpCand/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tpcSignal()); } if (trkDaughter1.hasTOF()) { - TGpCand.get(HIST("TGpCand/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); - TGpCand.get(HIST("TGpCand/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - TGpCand.get(HIST("TGpCand/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - TGpCand.get(HIST("TGpCand/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); + TGpCand.get(HIST("TGpCand/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); } if (trkDaughter2.hasTOF()) { - TGpCand.get(HIST("TGpCand/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tofSignal()); TGpCand.get(HIST("TGpCand/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - TGpCand.get(HIST("TGpCand/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tofSignal()); - TGpCand.get(HIST("TGpCand/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tofSignal()); - TGpCand.get(HIST("TGpCand/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tofSignal()); } if (RecoDecay::pt(mother) < 0.2f) { @@ -1984,18 +2027,10 @@ struct UpcJpsiCentralBarrel { JPsiToP.get(HIST("JPsiToP/Coherent/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tpcSignal()); } if (trkDaughter1.hasTOF()) { - JPsiToP.get(HIST("JPsiToP/Coherent/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); JPsiToP.get(HIST("JPsiToP/Coherent/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); - JPsiToP.get(HIST("JPsiToP/Coherent/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - JPsiToP.get(HIST("JPsiToP/Coherent/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - JPsiToP.get(HIST("JPsiToP/Coherent/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); } if (trkDaughter2.hasTOF()) { - JPsiToP.get(HIST("JPsiToP/Coherent/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tofSignal()); JPsiToP.get(HIST("JPsiToP/Coherent/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - JPsiToP.get(HIST("JPsiToP/Coherent/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tofSignal()); - JPsiToP.get(HIST("JPsiToP/Coherent/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tofSignal()); - JPsiToP.get(HIST("JPsiToP/Coherent/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tofSignal()); } // fill J/psi histos JPsiToP.get(HIST("JPsiToP/Coherent/hPt"))->Fill(RecoDecay::pt(mother)); @@ -2024,18 +2059,10 @@ struct UpcJpsiCentralBarrel { JPsiToP.get(HIST("JPsiToP/Incoherent/PID/hTPCVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tpcSignal()); } if (trkDaughter1.hasTOF()) { - JPsiToP.get(HIST("JPsiToP/Incoherent/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.tofSignal()); JPsiToP.get(HIST("JPsiToP/Incoherent/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter1.px(), trkDaughter1.py(), trkDaughter1.pz()), trkDaughter1.beta()); - JPsiToP.get(HIST("JPsiToP/Incoherent/PID/hTOFVsPt"))->Fill(trkDaughter1.pt(), trkDaughter1.tofSignal()); - JPsiToP.get(HIST("JPsiToP/Incoherent/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter1), trkDaughter1.tofSignal()); - JPsiToP.get(HIST("JPsiToP/Incoherent/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter1), trkDaughter1.tofSignal()); } if (trkDaughter2.hasTOF()) { - JPsiToP.get(HIST("JPsiToP/Incoherent/PID/hTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.tofSignal()); JPsiToP.get(HIST("JPsiToP/Incoherent/PID/hBetaTOFVsP"))->Fill(RecoDecay::sqrtSumOfSquares(trkDaughter2.px(), trkDaughter2.py(), trkDaughter2.pz()), trkDaughter2.beta()); - JPsiToP.get(HIST("JPsiToP/Incoherent/PID/hTOFVsPt"))->Fill(trkDaughter2.pt(), trkDaughter2.tofSignal()); - JPsiToP.get(HIST("JPsiToP/Incoherent/PID/hTOFVsEta"))->Fill(RecoDecay::eta(daughter2), trkDaughter2.tofSignal()); - JPsiToP.get(HIST("JPsiToP/Incoherent/PID/hTOFVsPhi"))->Fill(RecoDecay::phi(daughter2), trkDaughter2.tofSignal()); } // fill J/psi histos JPsiToP.get(HIST("JPsiToP/Incoherent/hPt"))->Fill(RecoDecay::pt(mother)); @@ -2047,7 +2074,53 @@ struct UpcJpsiCentralBarrel { } } // end protons } // end two tracks - } // end process + } // end reco process + + template + void processMC(C const& mcCollision, T const& mcParticles) + { + + MC.get(HIST("MC/hNumberOfMCCollisions"))->Fill(1.); + MC.get(HIST("MC/hPosZ"))->Fill(mcCollision.posZ()); + + std::array daughPart1; + std::array daughPart2; + + // fill number of particles + for (auto const& mcParticle : mcParticles) { + MC.get(HIST("MC/hNumberOfMCTracks"))->Fill(1.); + MC.get(HIST("MC/hPDG"))->Fill(mcParticle.pdgCode()); + + // check if only muons and physical primaries are present + if ((mcParticle.pdgCode() == 13) && mcParticle.isPhysicalPrimary()) { + daughPart1 = {mcParticle.px(), mcParticle.py(), mcParticle.pz()}; + + MC.get(HIST("MC/hNumberOfMCTracks"))->Fill(2.); + } + if ((mcParticle.pdgCode() == -13) && mcParticle.isPhysicalPrimary()) { + daughPart2 = {mcParticle.px(), mcParticle.py(), mcParticle.pz()}; + + MC.get(HIST("MC/hNumberOfMCTracks"))->Fill(3.); + } + } + + // calculate J/psi system and needed distributions + std::array motherPart = {daughPart1[0] + daughPart2[0], daughPart1[1] + daughPart2[1], daughPart1[2] + daughPart2[2]}; + + float massMu = o2::constants::physics::MassMuonMinus; + auto arrMom = std::array{daughPart1, daughPart2}; + float massJpsi = RecoDecay::m(arrMom, std::array{massMu, massMu}); + + MC.get(HIST("MC/hEta1"))->Fill(RecoDecay::eta(daughPart1)); + MC.get(HIST("MC/hEta2"))->Fill(RecoDecay::eta(daughPart2)); + MC.get(HIST("MC/hPhi1"))->Fill(RecoDecay::phi(daughPart1)); + MC.get(HIST("MC/hPhi2"))->Fill(RecoDecay::phi(daughPart2)); + MC.get(HIST("MC/hPt1"))->Fill(RecoDecay::pt(daughPart1)); + MC.get(HIST("MC/hPt2"))->Fill(RecoDecay::pt(daughPart2)); + MC.get(HIST("MC/hPt"))->Fill(RecoDecay::pt(motherPart)); + MC.get(HIST("MC/hIVM"))->Fill(massJpsi); + MC.get(HIST("MC/hRapidity"))->Fill(RecoDecay::y(motherPart, massJpsi)); + } // end MC process void processDGrecoLevel(UDCollisionFull const& collision, UDTracksFull const& tracks) { @@ -2068,8 +2141,14 @@ struct UpcJpsiCentralBarrel { } // end SG process - PROCESS_SWITCH(UpcJpsiCentralBarrel, processDGrecoLevel, "Iterate over DG skimmed data.", true); + void processMCtruth(aod::UDMcCollision const& mcCollision, aod::UDMcParticles const& mcParticles) + { + processMC(mcCollision, mcParticles); + } + + PROCESS_SWITCH(UpcJpsiCentralBarrel, processDGrecoLevel, "Iterate over DG skimmed data.", false); PROCESS_SWITCH(UpcJpsiCentralBarrel, processSGrecoLevel, "Iterate over SG skimmed data.", false); + PROCESS_SWITCH(UpcJpsiCentralBarrel, processMCtruth, "Iterate of MC true data.", true); }; // end struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 6223f24f52bf7a1381f7ac558a3f1f2d4324cbf6 Mon Sep 17 00:00:00 2001 From: AlexianL <123153896+AlexianL@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:22:48 +0100 Subject: [PATCH 112/459] [PWGHF] taskFlow.cxx: few changes in how event mixing is done. Changes in the filling of same event QA to improve performances. (#8605) --- PWGHF/HFC/Tasks/taskFlow.cxx | 803 +++++++++++++++++++---------------- 1 file changed, 429 insertions(+), 374 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 023a5b02923..b8a4619858d 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -241,6 +241,16 @@ struct HfTaskFlow { // ========================= // DATA : event histograms for TPC-TPC HF-h same event + registry.add("Data/TpcTpc/HfHadron/SameEvent/hPt", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hEta", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hPhi", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hYields", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/hEtaPhi", "multiplicity vs eta vs phi", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); + + registry.add("Data/TpcTpc/HfHadron/SameEvent/2Prong/hEventCountSame", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/2Prong/hEta", "eta", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/2Prong/hPhi", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/2Prong/hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}); registry.add("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); registry.add("Data/TpcTpc/HfHadron/MixedEvent/hMultiplicityHFMixing", "hMultiplicityHFMixing", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcTpc/HfHadron/MixedEvent/hVtxZHFMixing", "hVtxZHFMixing", {HistType::kTH1F, {{100, -10, 10}}}); @@ -276,13 +286,14 @@ struct HfTaskFlow { // DATA : histograms for TPC-TPC HF-h case for 3PRONG // =================== + registry.add("Data/TpcTpc/HfHadron/SameEvent/3Prong/hEventCountSame", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMassVsPt", "3-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMass", "3-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{100, 0., 10.}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMassVsPtVsMult", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}; multiplicity", {HistType::kTH3F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}, {5000, 0., 10000.}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0VsPtProng0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0VsPtProng1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0VsPtProng2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}); + registry.add("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPt", "3-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPtProng0", "3-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); registry.add("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPtProng1", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); @@ -317,12 +328,14 @@ struct HfTaskFlow { // ========================= // DATA : trigger particles (TPC tracks) histograms for TPC-MFT h-h same event + registry.add("Data/TpcMft/HadronHadron/SameEvent/hEventCountSame", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); registry.add("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiTPC", "multiplicity vs eta vs phi in TPC", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); registry.add("Data/TpcMft/HadronHadron/SameEvent/hEtaTPC", "etaTPC", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); registry.add("Data/TpcMft/HadronHadron/SameEvent/hPhiTPC", "phiTPC", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); registry.add("Data/TpcMft/HadronHadron/SameEvent/hPtTPC", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); registry.add("Data/TpcMft/HadronHadron/SameEvent/hYieldsTPC", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("Data/TpcMft/HadronHadron/SameEvent/hNtracksTPC", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HadronHadron/SameEvent/hMultiplicityTPC", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{500, 0, 500}}}); // DATA : associated particles (MFT tracks) histograms for TPC-MFT h-h same event registry.add("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiMFT", "multiplicity vs eta vs phi in MFT", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); @@ -356,6 +369,7 @@ struct HfTaskFlow { // ========================= // DATA : trigger particles (candidates) histograms for TPC-MFT HF-h same event + registry.add("Data/TpcMft/HfHadron/SameEvent/2Prong/hEventCountSame", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/2Prong/hEtaPhiCandidate", "multiplicity vs eta vs phi in TPC", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/2Prong/hEtaCandidate", "etaTPC", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/2Prong/hPhiCandidate", "phiTPC", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); @@ -413,6 +427,7 @@ struct HfTaskFlow { // DATA : histograms for TPC-MFT HF-h case FOR 3PRONG // ========================= + registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hEventCountSame", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hYieldsCandidate", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hNtracksCandidate", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hEtaPhiCandidate", "multiplicity vs eta vs phi in TPC", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); @@ -422,7 +437,7 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0VsPtProng0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0VsPtProng1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0VsPtProng2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hPt", "3-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hPtProng0", "3-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hPtProng1", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); @@ -533,44 +548,28 @@ struct HfTaskFlow { } // End of init() function // ========================= - // templates - // FIXME: Some collisions are rejected here, what causes (part of) differences with the D0 task + // Quality Assesment plots for Same Event // ========================= - template - bool isCollisionSelected(TCollision const& collision, bool fillHistograms = false) - { - if (fillHistograms) - registry.fill(HIST("Data/hEventCounter"), 1); - - if (processMc == false) { - if (!collision.sel8()) { - return false; - } - } - - if (fillHistograms) - registry.fill(HIST("Data/hEventCounter"), 3); - return true; + // ---- DATA : TPC-TPC h-h Same Event QA ---- + template + void fillTpcTpcChChSameEventQa(float multiplicity, TTrack const& track) + { + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hPt"), track.pt()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hEta"), track.eta()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hPhi"), track.phi()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hYields"), multiplicity, track.pt(), track.eta()); + registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hEtaPhi"), multiplicity, track.eta(), track.phi()); } - // ========================= - // Quality Assesment plots - // ========================= - - // ---- DATA : TPC-TPC h-h Same Event QA ---- - template - void fillTpcTpcChChSameEventQa(float multiplicity, TTracks const& tracks) + template + void fillTpcTpcHfChSameEventQa(float multiplicity, TTrack const& track) { - int nTracks = tracks.size(); - for (const auto& track1 : tracks) { - registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hPt"), track1.pt()); - registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hEta"), track1.eta()); - registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hPhi"), track1.phi()); - registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hYields"), multiplicity, track1.pt(), track1.eta()); - registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hEtaPhi"), multiplicity, track1.eta(), track1.phi()); - } - registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hNtracks"), nTracks); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hPt"), track.pt()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hEta"), track.eta()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hPhi"), track.phi()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hYields"), multiplicity, track.pt(), track.eta()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/hEtaPhi"), multiplicity, track.eta(), track.phi()); } // ---- MC : TPC-TPC h-h Same Event QA ---- @@ -613,6 +612,265 @@ struct HfTaskFlow { return nTracks; } + // ---- DATA : TPC-MFT h-h Same Event QA ---- + template + void fillTpcMftChChSameEventQa(float multiplicity, TTrack const& track, bool isTPC) + { + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + + if (isTPC) { // trigger hadron from TPC + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaTPC"), track.eta()); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPhiTPC"), phi); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiTPC"), multiplicity, track.eta(), phi); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPtTPC"), track.pt()); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hYieldsTPC"), multiplicity, track.pt(), track.eta()); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hMultiplicityTPC"), multiplicity); + // add multiplicity plot? + } else { // associated hadron from MFT + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaMFT"), track.eta()); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPhiMFT"), phi); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiMFT"), multiplicity, track.eta(), phi); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPtMFT"), track.pt()); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT"), multiplicity, track.pt(), track.eta()); + } + } + + // ---- DATA : TPC-MFT HF-h Same Event QA ---- + + template + void fillTpcMftHfChSameEventQa(float multiplicity, TTrack const& track) + { + // Used to fill QA plots for associated track from MFT when doing TPC-MFT HF-h correlations + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaMFT"), track.eta()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPhiMFT"), phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaPhiMFT"), multiplicity, track.eta(), phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtMFT"), track.pt()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT"), multiplicity, track.pt(), track.eta()); + // add plot for multiplicity ? + } + + // ---- DATA : TPC-TPC HF-h Same Event (Candidates) QA ---- + // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works + + // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works + template + void fillTpcTpcD0CandidateQa(float multiplicity, TTrack const& candidate) + { + float phi = candidate.phi(); + o2::math_utils::bringTo02Pi(phi); + + auto pt = candidate.pt(); + + if (candidate.isSelD0() >= selectionFlagD0) { + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hMassVsPt"), hfHelper.invMassD0ToPiK(candidate), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hMass"), hfHelper.invMassD0ToPiK(candidate)); + } + if (candidate.isSelD0bar() >= selectionFlagD0bar) { + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hMassVsPt"), hfHelper.invMassD0barToKPi(candidate), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hMass"), hfHelper.invMassD0barToKPi(candidate)); + } + + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hMultiplicity"), multiplicity); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hEta"), candidate.eta()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hPhi"), phi); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hPtCandidate"), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hDecLength"), candidate.decayLength(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hDecLengthXY"), candidate.decayLengthXY(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hd0Prong0"), candidate.impactParameter0(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hd0Prong1"), candidate.impactParameter1(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hd0d0"), candidate.impactParameterProduct(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hCTS"), hfHelper.cosThetaStarD0(candidate), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hCt"), hfHelper.ctD0(candidate), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hCPA"), candidate.cpa(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hEtaCandVsPt"), candidate.eta(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hImpParErr"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hImpParErr"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hDecLenErr"), candidate.errorDecayLength(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hDecLenXYErr"), candidate.errorDecayLengthXY(), pt); + } + + // ---- DATA : TPC-TPC HF-h Same Event (Candidates) QA ---- + // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works + template + void fillTpcTpcLcCandidateQa(float multiplicity, TTrack const& candidate) + { + float phi = candidate.phi(); + o2::math_utils::bringTo02Pi(phi); + + auto pt = candidate.pt(); + auto ptProng0 = candidate.ptProng0(); + auto ptProng1 = candidate.ptProng1(); + auto ptProng2 = candidate.ptProng2(); + auto decayLength = candidate.decayLength(); + auto decayLengthXY = candidate.decayLengthXY(); + auto chi2PCA = candidate.chi2PCA(); + auto cpa = candidate.cpa(); + auto cpaXY = candidate.cpaXY(); + + if (candidate.isSelLcToPKPi() >= selectionFlagLcToPKPi) { + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMass"), hfHelper.invMassLcToPKPi(candidate)); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMassVsPtVsMult"), hfHelper.invMassLcToPKPi(candidate), pt, multiplicity); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMassVsPt"), hfHelper.invMassLcToPKPi(candidate), pt); + } + if (candidate.isSelLcToPiKP() >= selectionFlagLcToPiKP) { + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMass"), hfHelper.invMassLcToPiKP(candidate)); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMassVsPtVsMult"), hfHelper.invMassLcToPiKP(candidate), pt, multiplicity); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMassVsPt"), hfHelper.invMassLcToPiKP(candidate), pt); + } + + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMultiplicity"), multiplicity); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPt"), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPtProng0"), ptProng0); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPtProng1"), ptProng1); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPtProng2"), ptProng2); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0Prong0"), candidate.impactParameter0()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0Prong1"), candidate.impactParameter1()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0Prong2"), candidate.impactParameter2()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0VsPtProng0"), candidate.impactParameter0(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0VsPtProng1"), candidate.impactParameter1(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0VsPtProng2"), candidate.impactParameter2(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDecLength"), decayLength); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDecLengthVsPt"), decayLength, pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDecLengthxy"), decayLengthXY); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDecLengthxyVsPt"), decayLengthXY, pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hCt"), hfHelper.ctLc(candidate)); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hCtVsPt"), hfHelper.ctLc(candidate), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hCPA"), cpa); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hCPAVsPt"), cpa, pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hCPAxy"), cpaXY); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hCPAxyVsPt"), cpaXY, pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDca2"), chi2PCA); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDca2VsPt"), chi2PCA, pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hEta"), candidate.eta()); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hEtaVsPt"), candidate.eta(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPhi"), phi); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPhiVsPt"), phi, pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hSelectionStatus"), candidate.isSelLcToPKPi(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hSelectionStatus"), candidate.isSelLcToPiKP(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hImpParErrProng0"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hImpParErrProng1"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hImpParErrProng2"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDecLenErr"), candidate.errorDecayLength(), pt); + } + + // ---- DATA : TPC-MFT HF-h Same Event (Candidates) QA ---- + // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works + template + void fillTpcMftD0CandidateQa(float multiplicity, TTrack const& candidate) + { + float phi = candidate.phi(); + auto pt = candidate.pt(); + o2::math_utils::bringTo02Pi(phi); + + if (candidate.isSelD0() >= selectionFlagD0) { + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hMassVsPt"), hfHelper.invMassD0ToPiK(candidate), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hMass"), hfHelper.invMassD0ToPiK(candidate)); + } + if (candidate.isSelD0bar() >= selectionFlagD0bar) { + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hMassVsPt"), hfHelper.invMassD0barToKPi(candidate), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hMass"), hfHelper.invMassD0barToKPi(candidate)); + } + + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hEtaCandidate"), candidate.eta()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hPhiCandidate"), phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hEtaPhiCandidate"), multiplicity, candidate.eta(), phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hYieldsCandidate"), multiplicity, pt, candidate.eta()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hPtCandidate"), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hDecLength"), candidate.decayLength(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hDecLengthXY"), candidate.decayLengthXY(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hd0Prong0"), candidate.impactParameter0(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hd0Prong1"), candidate.impactParameter1(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hd0d0"), candidate.impactParameterProduct(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hCTS"), hfHelper.cosThetaStarD0(candidate), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hCt"), hfHelper.ctD0(candidate), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hCPA"), candidate.cpa(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hEtaCandVsPt"), candidate.eta(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hImpParErr"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hImpParErr"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hDecLenErr"), candidate.errorDecayLength(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hDecLenXYErr"), candidate.errorDecayLengthXY(), pt); + } + + // ---- DATA : TPC-MFT HF-h Same Event (Candidates) QA ---- + // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works + + template + void fillTpcMftLcCandidateQa(float multiplicity, TTrack const& candidate) + { + auto pt = candidate.pt(); + auto ptProng0 = candidate.ptProng0(); + auto ptProng1 = candidate.ptProng1(); + auto ptProng2 = candidate.ptProng2(); + auto decayLength = candidate.decayLength(); + auto decayLengthXY = candidate.decayLengthXY(); + auto chi2PCA = candidate.chi2PCA(); + auto cpa = candidate.cpa(); + auto cpaXY = candidate.cpaXY(); + float phi = candidate.phi(); + o2::math_utils::bringTo02Pi(phi); + + if (candidate.isSelLcToPKPi() >= selectionFlagLcToPKPi) { + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMass"), hfHelper.invMassLcToPKPi(candidate)); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMassVsPtVsMult"), hfHelper.invMassLcToPKPi(candidate), pt, multiplicity); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMassVsPt"), hfHelper.invMassLcToPKPi(candidate), pt); + } + if (candidate.isSelLcToPiKP() >= selectionFlagLcToPiKP) { + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMass"), hfHelper.invMassLcToPiKP(candidate)); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMassVsPtVsMult"), hfHelper.invMassLcToPiKP(candidate), pt, multiplicity); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMassVsPt"), hfHelper.invMassLcToPiKP(candidate), pt); + } + + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hYieldsCandidate"), multiplicity, pt, candidate.eta()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hEtaPhiCandidate"), multiplicity, candidate.eta(), phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hNtracksCandidate"), multiplicity); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPt"), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPtProng0"), ptProng0); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPtProng1"), ptProng1); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPtProng2"), ptProng2); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0Prong0"), candidate.impactParameter0()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0Prong1"), candidate.impactParameter1()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0Prong2"), candidate.impactParameter2()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0VsPtProng0"), candidate.impactParameter0(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0VsPtProng1"), candidate.impactParameter1(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0VsPtProng2"), candidate.impactParameter2(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDecLength"), decayLength); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDecLengthVsPt"), decayLength, pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDecLengthxy"), decayLengthXY); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDecLengthxyVsPt"), decayLengthXY, pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hCt"), hfHelper.ctLc(candidate)); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hCtVsPt"), hfHelper.ctLc(candidate), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hCPA"), cpa); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hCPAVsPt"), cpa, pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hCPAxy"), cpaXY); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hCPAxyVsPt"), cpaXY, pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDca2"), chi2PCA); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDca2VsPt"), chi2PCA, pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hEta"), candidate.eta()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hEtaVsPt"), candidate.eta(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPhi"), candidate.phi()); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPhiVsPt"), candidate.phi(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hSelectionStatus"), candidate.isSelLcToPKPi(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hSelectionStatus"), candidate.isSelLcToPiKP(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hImpParErrProng0"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hImpParErrProng1"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hImpParErrProng2"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDecLenErr"), candidate.errorDecayLength(), pt); + } + + // ========================= + // Quality Assesment plots for Mixed Event + // ========================= + // ---- DATA : TPC-TPC h-h Mixed Event QA ---- template void fillTpcTpcChChMixedEventQa(float multiplicity, float vz, TTracks const& tracks) @@ -684,73 +942,6 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hNtracksHFMixing"), nTracks); } - // ---- DATA : TPC-MFT h-h Same Event QA ---- - template - void fillTpcMftChChSameEventQa(float multiplicity, TTracks const& tracks) - { - int nTracks = tracks.size(); - bool isMFT = false; - for (const auto& track1 : tracks) { - if constexpr (std::is_same_v) { // if MFT tracks - - // apply cuts for MFT tracks - if (!isAcceptedMftTrack(track1)) { - continue; - } - - isMFT = true; - registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaMFT"), track1.eta()); - float phi = track1.phi(); - o2::math_utils::bringTo02Pi(phi); - - registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPhiMFT"), phi); - registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiMFT"), multiplicity, track1.eta(), phi); - registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPtMFT"), track1.pt()); - registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); - } else { // if TPC tracks - registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaTPC"), track1.eta()); - float phi = track1.phi(); - o2::math_utils::bringTo02Pi(phi); - registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPhiTPC"), phi); - registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEtaPhiTPC"), multiplicity, track1.eta(), phi); - registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hPtTPC"), track1.pt()); - registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hYieldsTPC"), multiplicity, track1.pt(), track1.eta()); - } - if (isMFT) { - registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hNtracksMFT"), nTracks); - } else { - registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hNtracksTPC"), nTracks); - } - } - } - - // ---- DATA : TPC-MFT HF-h Same Event QA ---- - template - void fillTpcMftHfChSameEventQa(float multiplicity, TTracks const& tracks) - { - // This is only called with MFT tracks, so no TPC case here - int nTracks = tracks.size(); - for (const auto& track1 : tracks) { - if constexpr (std::is_same_v) { // if MFT tracks - - // apply cuts for MFT tracks - if (!isAcceptedMftTrack(track1)) { - continue; - } - - float phi = track1.phi(); - o2::math_utils::bringTo02Pi(phi); - - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaMFT"), track1.eta()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPhiMFT"), phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hEtaPhiMFT"), multiplicity, track1.eta(), phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hPtMFT"), track1.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT"), multiplicity, track1.pt(), track1.eta()); - } - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/hNtracksMFT"), nTracks); - } - } - // ---- DATA : TPC-MFT h-h Mixed Event QA ---- template void fillTpcMftChChMixedEventQa(float multiplicity, float vz, TTracks const& tracks) @@ -831,6 +1022,29 @@ struct HfTaskFlow { } } + // ========================= + // Cuts with functions + // ========================= + + // FIXME: Some collisions are rejected here, what causes (part of) differences with the D0 task + template + bool isCollisionSelected(TCollision const& collision, bool fillHistograms = false) + { + if (fillHistograms) + registry.fill(HIST("Data/hEventCounter"), 1); + + if (processMc == false) { + if (!collision.sel8()) { + return false; + } + } + + if (fillHistograms) + registry.fill(HIST("Data/hEventCounter"), 3); + + return true; + } + // TODO: Check how to put this into a Filter template bool isAcceptedCandidate(TTrack const& candidate) @@ -893,242 +1107,24 @@ struct HfTaskFlow { return true; } - // ---- DATA : TPC-TPC HF-h Same Event (Candidates) QA ---- - // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works - template - void fillTpcTpcD0CandidateQa(TTracks const& candidates) - { - for (const auto& candidate : candidates) { - if (!isAcceptedCandidate(candidate)) { - continue; - } - - if (candidate.isSelD0() >= selectionFlagD0) { - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hMassVsPt"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hMass"), hfHelper.invMassD0ToPiK(candidate)); - } - if (candidate.isSelD0bar() >= selectionFlagD0bar) { - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hMassVsPt"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hMass"), hfHelper.invMassD0barToKPi(candidate)); - } - - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hPtCandidate"), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hPtProng0"), candidate.ptProng0()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hPtProng1"), candidate.ptProng1()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hDecLength"), candidate.decayLength(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hCt"), hfHelper.ctD0(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hCPA"), candidate.cpa(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hEtaCandVsPt"), candidate.eta(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); - } - } - - // ---- DATA : TPC-TPC HF-h Same Event (Candidates) QA ---- - // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works - template - void fillTpcTpcLcCandidateQa(TTracks const& candidates) - { - int nTracks = candidates.size(); - for (const auto& candidate : candidates) { - if (!isAcceptedCandidate(candidate)) { - continue; - } - - auto pt = candidate.pt(); - auto ptProng0 = candidate.ptProng0(); - auto ptProng1 = candidate.ptProng1(); - auto ptProng2 = candidate.ptProng2(); - auto decayLength = candidate.decayLength(); - auto decayLengthXY = candidate.decayLengthXY(); - auto chi2PCA = candidate.chi2PCA(); - auto cpa = candidate.cpa(); - auto cpaXY = candidate.cpaXY(); - - if (candidate.isSelLcToPKPi() >= selectionFlagLcToPKPi) { - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMass"), hfHelper.invMassLcToPKPi(candidate)); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMassVsPtVsMult"), hfHelper.invMassLcToPKPi(candidate), pt, nTracks); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMassVsPt"), hfHelper.invMassLcToPKPi(candidate), pt); - } - if (candidate.isSelLcToPiKP() >= selectionFlagLcToPiKP) { - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMass"), hfHelper.invMassLcToPiKP(candidate)); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMassVsPtVsMult"), hfHelper.invMassLcToPiKP(candidate), pt, nTracks); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMassVsPt"), hfHelper.invMassLcToPiKP(candidate), pt); - } - - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hMultiplicity"), nTracks); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPt"), pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPtProng0"), ptProng0); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPtProng1"), ptProng1); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPtProng2"), ptProng2); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0Prong0"), candidate.impactParameter0()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0Prong1"), candidate.impactParameter1()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0Prong2"), candidate.impactParameter2()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0VsPtProng0"), candidate.impactParameter0(), pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0VsPtProng1"), candidate.impactParameter1(), pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hd0VsPtProng2"), candidate.impactParameter2(), pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDecLength"), decayLength); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDecLengthVsPt"), decayLength, pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDecLengthxy"), decayLengthXY); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDecLengthxyVsPt"), decayLengthXY, pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hCt"), hfHelper.ctLc(candidate)); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hCtVsPt"), hfHelper.ctLc(candidate), pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hCPA"), cpa); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hCPAVsPt"), cpa, pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hCPAxy"), cpaXY); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hCPAxyVsPt"), cpaXY, pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDca2"), chi2PCA); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDca2VsPt"), chi2PCA, pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hEta"), candidate.eta()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hEtaVsPt"), candidate.eta(), pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPhi"), candidate.phi()); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hPhiVsPt"), candidate.phi(), pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hSelectionStatus"), candidate.isSelLcToPKPi(), pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hSelectionStatus"), candidate.isSelLcToPiKP(), pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hImpParErrProng0"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hImpParErrProng1"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hImpParErrProng2"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hDecLenErr"), candidate.errorDecayLength(), pt); - } - } - - // ---- DATA : TPC-MFT HF-h Same Event (Candidates) QA ---- - // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works - template - void fillTpcMftD0CandidateQa(TTracks const& candidates, float multiplicity) - { - int nTracks = candidates.size(); - for (const auto& candidate : candidates) { - if (!isAcceptedCandidate(candidate)) { - continue; - } - - if (candidate.isSelD0() >= selectionFlagD0) { - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hMassVsPt"), hfHelper.invMassD0ToPiK(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hMass"), hfHelper.invMassD0ToPiK(candidate)); - } - if (candidate.isSelD0bar() >= selectionFlagD0bar) { - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hMassVsPt"), hfHelper.invMassD0barToKPi(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hMass"), hfHelper.invMassD0barToKPi(candidate)); - } - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hEtaCandidate"), candidate.eta()); - float phi = candidate.phi(); - o2::math_utils::bringTo02Pi(phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hPhiCandidate"), phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hEtaPhiCandidate"), multiplicity, candidate.eta(), phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hYieldsCandidate"), multiplicity, candidate.pt(), candidate.eta()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hNtracksCandidate"), nTracks); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hPtCandidate"), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hPtProng0"), candidate.ptProng0()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hPtProng1"), candidate.ptProng1()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hDecLength"), candidate.decayLength(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hDecLengthXY"), candidate.decayLengthXY(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hd0Prong0"), candidate.impactParameter0(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hd0Prong1"), candidate.impactParameter1(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hd0d0"), candidate.impactParameterProduct(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hCTS"), hfHelper.cosThetaStarD0(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hCt"), hfHelper.ctD0(candidate), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hCPA"), candidate.cpa(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hEtaCandVsPt"), candidate.eta(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hSelectionStatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hImpParErr"), candidate.errorImpactParameter0(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hImpParErr"), candidate.errorImpactParameter1(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hDecLenErr"), candidate.errorDecayLength(), candidate.pt()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hDecLenXYErr"), candidate.errorDecayLengthXY(), candidate.pt()); - } - } - - // ---- DATA : TPC-MFT HF-h Same Event (Candidates) QA ---- - // TODO: Note: we do not need all these plots since they are in D0 and Lc task -> remove it after we are sure this works - template - void fillTpcMftLcCandidateQa(TTracks const& candidates, float multiplicity) - { - for (const auto& candidate : candidates) { - if (!isAcceptedCandidate(candidate)) { - continue; - } - - auto pt = candidate.pt(); - auto ptProng0 = candidate.ptProng0(); - auto ptProng1 = candidate.ptProng1(); - auto ptProng2 = candidate.ptProng2(); - auto decayLength = candidate.decayLength(); - auto decayLengthXY = candidate.decayLengthXY(); - auto chi2PCA = candidate.chi2PCA(); - auto cpa = candidate.cpa(); - auto cpaXY = candidate.cpaXY(); - float phi = candidate.phi(); - o2::math_utils::bringTo02Pi(phi); - - if (candidate.isSelLcToPKPi() >= selectionFlagLcToPKPi) { - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMass"), hfHelper.invMassLcToPKPi(candidate)); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMassVsPtVsMult"), hfHelper.invMassLcToPKPi(candidate), pt, multiplicity); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMassVsPt"), hfHelper.invMassLcToPKPi(candidate), pt); - } - if (candidate.isSelLcToPiKP() >= selectionFlagLcToPiKP) { - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMass"), hfHelper.invMassLcToPiKP(candidate)); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMassVsPtVsMult"), hfHelper.invMassLcToPiKP(candidate), pt, multiplicity); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMassVsPt"), hfHelper.invMassLcToPiKP(candidate), pt); - } - - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hYieldsCandidate"), multiplicity, candidate.pt(), candidate.eta()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hEtaPhiCandidate"), multiplicity, candidate.eta(), phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hNtracksCandidate"), multiplicity); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPt"), pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPtProng0"), ptProng0); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPtProng1"), ptProng1); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPtProng2"), ptProng2); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0Prong0"), candidate.impactParameter0()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0Prong1"), candidate.impactParameter1()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0Prong2"), candidate.impactParameter2()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0VsPtProng0"), candidate.impactParameter0(), pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0VsPtProng1"), candidate.impactParameter1(), pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0VsPtProng2"), candidate.impactParameter2(), pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDecLength"), decayLength); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDecLengthVsPt"), decayLength, pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDecLengthxy"), decayLengthXY); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDecLengthxyVsPt"), decayLengthXY, pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hCt"), hfHelper.ctLc(candidate)); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hCtVsPt"), hfHelper.ctLc(candidate), pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hCPA"), cpa); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hCPAVsPt"), cpa, pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hCPAxy"), cpaXY); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hCPAxyVsPt"), cpaXY, pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDca2"), chi2PCA); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDca2VsPt"), chi2PCA, pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hEta"), candidate.eta()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hEtaVsPt"), candidate.eta(), pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPhi"), candidate.phi()); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPhiVsPt"), candidate.phi(), pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hSelectionStatus"), candidate.isSelLcToPKPi(), pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hSelectionStatus"), candidate.isSelLcToPiKP(), pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hImpParErrProng0"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hImpParErrProng1"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hImpParErrProng2"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hDecLenErr"), candidate.errorDecayLength(), pt); - } - } - // ========================= // Correlation functions // ========================= template - void fillCorrelations(TTarget target, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, float multiplicity, float posZ) + void fillCorrelations(TTarget target, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, float multiplicity, float posZ, bool sameEvent) { auto triggerWeight = 1; auto associatedWeight = 1; + // To avoid filling associated tracks QA many times + // I fill it only for the first trigger track of the collision + auto loopCounter = 0; + for (const auto& track1 : tracks1) { + loopCounter++; + float eta1 = track1.eta(); float pt1 = track1.pt(); float phi1 = track1.phi(); @@ -1174,6 +1170,32 @@ struct HfTaskFlow { target->getTriggerHist()->Fill(step, pt1, multiplicity, posZ, invmass, triggerWeight); } + // FILL QA PLOTS for trigger particle + if (sameEvent) { + // if constexpr (std::is_same_v) { // If DATA + if constexpr (!std::is_same_v) { // IF TPC-TPC case + if constexpr (std::is_same_v) { // IF D0 CASE -> TPC-TPC D0-h + fillTpcTpcD0CandidateQa(multiplicity, track1); + } else if constexpr (std::is_same_v) { // IF LC CASE -> TPC-TPC Lc-h + fillTpcTpcLcCandidateQa(multiplicity, track1); + } else { // IF NEITHER D0 NOR LC -> TPC-TPC h-h + fillTpcTpcChChSameEventQa(multiplicity, track1); + } + } else { // IF TPC-MFT case + if constexpr (std::is_same_v) { // IF D0 CASE -> TPC-MFT D0-h + fillTpcMftD0CandidateQa(multiplicity, track1); + } else if constexpr (std::is_same_v) { // IF LC CASE -> TPC-MFT Lc-h + fillTpcMftLcCandidateQa(multiplicity, track1); + } else { // IF NEITHER D0 NOR LC -> TPC-MFT h-h + fillTpcMftChChSameEventQa(multiplicity, track1, true); + } // end of if condition for TPC-TPC or TPC-MFT case + } + // Maybe I won't need it for MC (first files are way lighter in MC, but also I need to loop over all tracks in MC GEN) + //} else { // If MC (add cases later) + // fillTpcTpcChChSameEventQaMc(multiplicityTracks2, vz, tracks1); + //} + } + for (const auto& track2 : tracks2) { // apply cuts for MFT tracks @@ -1193,7 +1215,7 @@ struct HfTaskFlow { // in case of HF-h correlations, remove candidate daughters from the pool of associated hadrons // with which the candidate is being correlated (will not have to do it for TPC-MFT case) - if constexpr (!std::is_same_v) { // if NOT TPC-MFT case -> TPC-TPC case + if constexpr (!std::is_same_v) { // if NOT TPC-MFT case -> TPC-TPC case if constexpr (std::is_same_v) { // Remove the 2 prong daughters if ((track1.prong0Id() == track2.globalIndex()) || (track1.prong1Id() == track2.globalIndex())) { continue; @@ -1236,8 +1258,33 @@ struct HfTaskFlow { target->getPairHist()->Fill(step, eta1 - eta2, pt2, pt1, multiplicity, deltaPhi, posZ, invmass, triggerWeight * associatedWeight); } - } - } + + // FILL QA PLOTS for associated particle + if (sameEvent && (loopCounter == 1)) { + // if constexpr (std::is_same_v) { // If DATA + if constexpr (!std::is_same_v) { // IF TPC-TPC case + if constexpr (std::is_same_v) { // IF D0 CASE -> TPC-TPC D0-h + fillTpcTpcHfChSameEventQa(multiplicity, track2); + } else if constexpr (std::is_same_v) { // IF LC CASE -> TPC-TPC Lc-h + fillTpcTpcHfChSameEventQa(multiplicity, track2); + } + // No if condition if it is h-h, because it would be the same plots than for the trigger particle + } else { // IF TPC-MFT case + if constexpr (std::is_same_v) { // IF D0 CASE -> TPC-MFT D0-h + fillTpcMftHfChSameEventQa(multiplicity, track2); + } else if constexpr (std::is_same_v) { // IF LC CASE -> TPC-MFT Lc-h + fillTpcMftHfChSameEventQa(multiplicity, track2); + } else { // IF NEITHER D0 NOR LC -> TPC-MFT h-h + fillTpcMftChChSameEventQa(multiplicity, track2, false); + } // end of if condition for TPC-TPC or TPC-MFT case + } + //} else { // If MC (add cases later) + // fillTpcTpcChChSameEventQaMc(multiplicityTracks2, vz, tracks1); + //} + } + + } // end of loop over tracks2 + } // end of loop over tracks 1 } // template @@ -1266,15 +1313,15 @@ struct HfTaskFlow { auto binningValues = binningWithTracksSize.getBinningValues(collision1, collisions); int bin = binningWithTracksSize.getBin(binningValues); - // const auto multiplicityTracks1 = getPartsSize(collision1); - // const auto multiplicityTracks2 = getPartsSize(collision2); - const auto multiplicityTracks1 = tracks1.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing - const auto multiplicityTracks2 = tracks2.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing + const auto multiplicityTracks1 = getPartsSize(collision1); + const auto multiplicityTracks2 = getPartsSize(collision2); + // const auto multiplicityTracks1 = tracks1.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing + // const auto multiplicityTracks2 = tracks2.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing const auto vz = collision1.posZ(); if constexpr (std::is_same_v) { // If MC registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcTpcChChMixedEventQaMc(multiplicityTracks2, vz, tracks1); + // fillTpcTpcChChMixedEventQaMc(multiplicityTracks2, vz, tracks1); // if constexpr (std::is_same_v || std::is_same_v) { // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); @@ -1284,8 +1331,8 @@ struct HfTaskFlow { // fillMixingQA(multiplicity, vz, tracks1); // } - } else { // If not MC - if constexpr (std::is_same_v) { // IF TPC-MFT case + } else { // If not MC + if constexpr (std::is_same_v) { // IF TPC-MFT case if constexpr (std::is_same_v || std::is_same_v) { // IF HF-h case -> TPC-MFT HF-h registry.fill(HIST("Data/TpcMft/HfHadron/MixedEvent/hEventCountMixing"), bin); fillTpcMftHfChMixedEventQa(multiplicityTracks1, vz, tracks1); // Candidates @@ -1295,7 +1342,7 @@ struct HfTaskFlow { fillTpcMftChChMixedEventQa(multiplicityTracks1, vz, tracks1); // TPC tracks fillTpcMftChChMixedEventQa(multiplicityTracks2, vz, tracks2); // MFT tracks } - } else { // IF TPC-TPC case + } else { // IF TPC-TPC case if constexpr (std::is_same_v || std::is_same_v) { // IF HF-h case -> TPC-TPC HF-h registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); fillTpcTpcHfChMixedEventQa(multiplicityTracks2, vz, tracks1); @@ -1307,7 +1354,7 @@ struct HfTaskFlow { } corrContainer->fillEvent(multiplicityTracks2, CorrelationContainer::kCFStepReconstructed); - fillCorrelations(corrContainer, tracks1, tracks2, multiplicityTracks2, collision1.posZ()); + fillCorrelations(corrContainer, tracks1, tracks2, multiplicityTracks1, collision1.posZ(), false); } } @@ -1344,7 +1391,7 @@ struct HfTaskFlow { // TO BE DONE : ADD ONE MORE IF CONDITION TO FILL THE MC CASE // TODO : FILL NEW PLOTS FOR MCTRUTH ONLY registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/MixedEvent/hEventCountMixing"), bin); - fillTpcTpcChChMixedEventQaMc(multiplicity, vz, tracks1); + // fillTpcTpcChChMixedEventQaMc(multiplicity, vz, tracks1); // if constexpr (std::is_same_v || std::is_same_v) { // registry.fill(HIST("Data/TpcTpc/HfHadron/MixedEvent/hEventCountHFMixing"), bin); @@ -1355,7 +1402,7 @@ struct HfTaskFlow { // } corrContainer->fillEvent(multiplicity, CorrelationContainer::kCFStepAll); - fillCorrelations(corrContainer, tracks1, tracks2, multiplicity, collision1.posZ()); + fillCorrelations(corrContainer, tracks1, tracks2, multiplicity, collision1.posZ(), false); } } @@ -1385,9 +1432,8 @@ struct HfTaskFlow { sameTPCTPCChCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillTpcTpcChChSameEventQa(multiplicity, tracks); // TO-DO : add if condition for when we will implant corrected correlations (kCFStepReconstructed -> kCFStepCorrected) - fillCorrelations(sameTPCTPCChCh, tracks, tracks, multiplicity, collision.posZ()); + fillCorrelations(sameTPCTPCChCh, tracks, tracks, multiplicity, collision.posZ(), true); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChCh, "DATA : Process same-event correlations for TPC-TPC h-h case", false); @@ -1408,12 +1454,15 @@ struct HfTaskFlow { if (!(isCollisionSelected(collision, fillEventSelectionPlots))) { return; } - const auto multiplicity = tracks.size(); + + const auto multiplicity = candidates.size(); + BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; + int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicity)); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hEventCountSame"), bin); sameTPCTPCHfCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillTpcTpcD0CandidateQa(candidates); - fillCorrelations(sameTPCTPCHfCh, candidates, tracks, multiplicity, collision.posZ()); + fillCorrelations(sameTPCTPCHfCh, candidates, tracks, multiplicity, collision.posZ(), true); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcD0Ch, "DATA : Process same-event correlations for TPC-TPC D0-h case", false); @@ -1434,12 +1483,15 @@ struct HfTaskFlow { if (!(isCollisionSelected(collision, fillEventSelectionPlots))) { return; } - const auto multiplicity = tracks.size(); + + const auto multiplicity = candidates.size(); + BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; + int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicity)); + registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hEventCountSame"), bin); sameTPCTPCHfCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillTpcTpcLcCandidateQa(candidates); - fillCorrelations(sameTPCTPCHfCh, candidates, tracks, multiplicity, collision.posZ()); + fillCorrelations(sameTPCTPCHfCh, candidates, tracks, multiplicity, collision.posZ(), true); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcLcCh, "DATA : Process same-event correlations for TPC-TPC Lc-h case", false); @@ -1456,12 +1508,13 @@ struct HfTaskFlow { } const auto multiplicityTPC = tracks.size(); - const auto multiplicityMFT = mftTracks.size(); + BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; + int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicityTPC)); + registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEventCountSame"), bin); sameTPCMFTChCh->fillEvent(multiplicityTPC, CorrelationContainer::kCFStepReconstructed); - fillTpcMftChChSameEventQa(multiplicityTPC, tracks); - fillTpcMftChChSameEventQa(multiplicityMFT, mftTracks); - fillCorrelations(sameTPCMFTChCh, tracks, mftTracks, multiplicityTPC, collision.posZ()); + + fillCorrelations(sameTPCMFTChCh, tracks, mftTracks, multiplicityTPC, collision.posZ(), true); } PROCESS_SWITCH(HfTaskFlow, processSameTpcMftChCh, "DATA : Process same-event correlations for TPC-MFT h-h case", false); @@ -1484,12 +1537,13 @@ struct HfTaskFlow { } const auto multiplicityCandidates = candidates.size(); - const auto multiplicityMFT = mftTracks.size(); + BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; + int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicityCandidates)); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hEventCountSame"), bin); sameTPCMFTHfCh->fillEvent(multiplicityCandidates, CorrelationContainer::kCFStepReconstructed); - fillTpcMftD0CandidateQa(candidates, multiplicityCandidates); - fillTpcMftHfChSameEventQa(multiplicityMFT, mftTracks); - fillCorrelations(sameTPCMFTHfCh, candidates, mftTracks, multiplicityCandidates, collision.posZ()); + + fillCorrelations(sameTPCMFTHfCh, candidates, mftTracks, multiplicityCandidates, collision.posZ(), true); } PROCESS_SWITCH(HfTaskFlow, processSameTpcMftD0Ch, "DATA : Process same-event correlations for TPC-MFT D0-h case", false); @@ -1512,12 +1566,13 @@ struct HfTaskFlow { } const auto multiplicityCandidates = candidates.size(); - const auto multiplicityMFT = mftTracks.size(); + BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; + int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicityCandidates)); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hEventCountSame"), bin); sameTPCMFTHfCh->fillEvent(multiplicityCandidates, CorrelationContainer::kCFStepReconstructed); - fillTpcMftLcCandidateQa(candidates, multiplicityCandidates); - fillTpcMftHfChSameEventQa(multiplicityMFT, mftTracks); - fillCorrelations(sameTPCMFTHfCh, candidates, mftTracks, multiplicityCandidates, collision.posZ()); + + fillCorrelations(sameTPCMFTHfCh, candidates, mftTracks, multiplicityCandidates, collision.posZ(), true); } PROCESS_SWITCH(HfTaskFlow, processSameTpcMftLcCh, "DATA : Process same-event correlations for TPC-MFT Lc-h case", false); @@ -1545,7 +1600,7 @@ struct HfTaskFlow { sameTPCTPCChChMC->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); fillTpcTpcChChSameEventQaMc(multiplicity, mcTracks); - fillCorrelations(sameTPCTPCChChMC, mcTracks, mcTracks, multiplicity, mcCollision.posZ()); + fillCorrelations(sameTPCTPCChChMC, mcTracks, mcTracks, multiplicity, mcCollision.posZ(), true); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmcREC, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", false); @@ -1576,7 +1631,7 @@ struct HfTaskFlow { // In Katka's code, the first time doing this does not fill the histograms, right now will be filled two times.. auto multPrimaryCharge0 = fillTpcTpcChChSameEventQaMc(multiplicity, mcParticles); sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepAll); - fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); + fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ(), true); // NOT USED BY KATARINA APPARENTLY // BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; @@ -1588,7 +1643,7 @@ struct HfTaskFlow { // This line below for sure induce that some plots are filled two times // multPrimaryCharge0 = fillTpcTpcChChSameEventQaMc(multiplicity, mcParticles); // sameTPCTPCChChMC->fillEvent(multPrimaryCharge0, CorrelationContainer::kCFStepVertex); - // fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ()); + // fillCorrelations(sameTPCTPCChChMC, mcParticles, mcParticles, multPrimaryCharge0, mcCollision.posZ(), true); } PROCESS_SWITCH(HfTaskFlow, processSameTpcTpcChChmcGEN, "MONTE-CARLO : Process same-event correlations for TPC-TPC h-h case", false); @@ -1620,9 +1675,9 @@ struct HfTaskFlow { HfCandidatesSelD0 const& candidates) { // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { + auto getTracksSize = [&tracks, this](FilteredCollisionsWSelMult::iterator const& col) { // Still o2::aod::track::collisionId with HF ??? -> I don't think so - auto associatedTracks = candidates.sliceByCached(o2::aod::hf_cand::collisionId, col.globalIndex(), this->cache); + auto associatedTracks = tracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); auto size = associatedTracks.size(); return size; }; @@ -1640,9 +1695,9 @@ struct HfTaskFlow { HfCandidatesSelLc const& candidates) { // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { + auto getTracksSize = [&tracks, this](FilteredCollisionsWSelMult::iterator const& col) { // Still o2::aod::track::collisionId with HF ??? -> I don't think so - auto associatedTracks = candidates.sliceByCached(o2::aod::hf_cand::collisionId, col.globalIndex(), this->cache); + auto associatedTracks = tracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); auto size = associatedTracks.size(); return size; }; @@ -1660,8 +1715,8 @@ struct HfTaskFlow { aod::MFTTracks const& mftTracks) { // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&tracks, this](FilteredCollisionsWSelMult::iterator const& col) { - auto associatedTracks = tracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); + auto getTracksSize = [&mftTracks, this](FilteredCollisionsWSelMult::iterator const& col) { + auto associatedTracks = mftTracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); auto size = associatedTracks.size(); return size; }; @@ -1679,9 +1734,9 @@ struct HfTaskFlow { aod::MFTTracks const& mftTracks) { // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { + auto getTracksSize = [&mftTracks, this](FilteredCollisionsWSelMult::iterator const& col) { // Still o2::aod::track::collisionId with HF ??? -> I don't think so - auto associatedTracks = candidates.sliceByCached(o2::aod::hf_cand::collisionId, col.globalIndex(), this->cache); + auto associatedTracks = mftTracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); auto size = associatedTracks.size(); return size; }; @@ -1700,9 +1755,9 @@ struct HfTaskFlow { { // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&candidates, this](FilteredCollisionsWSelMult::iterator const& col) { + auto getTracksSize = [&mftTracks, this](FilteredCollisionsWSelMult::iterator const& col) { // Still o2::aod::track::collisionId with HF ??? -> I don't think so - auto associatedTracks = candidates.sliceByCached(o2::aod::hf_cand::collisionId, col.globalIndex(), this->cache); + auto associatedTracks = mftTracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); auto size = associatedTracks.size(); return size; }; From 60d03776d0697219961c95eae3a6767e24edc1c7 Mon Sep 17 00:00:00 2001 From: Roberta Ferioli <142217183+Roberta-Ferioli@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:06:09 +0100 Subject: [PATCH 113/459] [PWGLF] Fix He3 pt, add hyperHe4 histogram (#8662) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx b/PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx index 04175779501..5f1e68731d3 100644 --- a/PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx +++ b/PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx @@ -54,8 +54,6 @@ struct he3FromHypertritonMap { true, true}; - Configurable particle_of_interest{"particle_of_interest", 0, "0=antihelium3, 1=antihypertriton"}; - // Track Parameters Configurable min_ITS_nClusters{"min_ITS_nClusters", 7, "minimum number of found ITS clusters"}; Configurable min_TPC_nClusters{"min_TPC_nClusters", 100, "minimum number of found TPC clusters"}; @@ -71,14 +69,18 @@ struct he3FromHypertritonMap { Configurable min_pt{"min_pt", 0.0f, "minimum pt of the tracks"}; Configurable max_pt{"max_pt", 10.0f, "maximum pt of the tracks"}; Configurable nbin_pt{"nbin_pt", 50, "number of pt bins"}; + Configurable nbin_dca = {"nbin_dca", 50, "number of DCA bins"}; int AntihePDG = -1000020030; int AntiHypertritonPDG = -1010010030; + int AntiHyperHelium4PDG = -1010020040; void init(InitContext const&) { - registryMC.add("he3SecPtRec", "he3SecPtRec", HistType::kTH1F, {{nbin_pt, min_pt, max_pt, "p_{T} (GeV/c)"}}); + registryMC.add("he3SecPtRec_from_hypertriton", "he3SecPtRec_from_hypertriton", HistType::kTH1F, {{nbin_pt, min_pt, max_pt, "p_{T} (GeV/c)"}}); + registryMC.add("he3SecPtRec_from_hyperHe4", "he3SecPtRec_from_hyperHe4", HistType::kTH1F, {{nbin_pt, min_pt, max_pt, "p_{T} (GeV/c)"}}); registryMC.add("hypertritonPtgen", "hypertritonPtGen", HistType::kTH1F, {{nbin_pt, min_pt, max_pt, "p_{T} (GeV/c)"}}); + registryMC.add("hyperHe4Ptgen", "hyperHe4PtGen", HistType::kTH1F, {{nbin_pt, min_pt, max_pt, "p_{T} (GeV/c)"}}); } void processMC(aod::McParticles const& mcParticles, const MCTracks& tracks) @@ -93,7 +95,7 @@ struct he3FromHypertritonMap { } for (auto& motherparticle : mcparticle.mothers_as()) { - if (motherparticle.pdgCode() == AntiHypertritonPDG) { + if (motherparticle.pdgCode() == AntiHypertritonPDG || motherparticle.pdgCode() == AntiHyperHelium4PDG) { if (track.itsNCls() < min_ITS_nClusters || track.tpcNClsFound() < min_TPC_nClusters || track.tpcNClsCrossedRows() < min_TPC_nCrossedRows || @@ -106,8 +108,14 @@ struct he3FromHypertritonMap { track.itsChi2NCl() > 36.f) { continue; } - registryMC.fill(HIST("he3SecPtRec"), track.pt()); - registryMC.fill(HIST("hypertritonPtgen"), motherparticle.pt()); + if (motherparticle.pdgCode() == AntiHypertritonPDG) { + registryMC.fill(HIST("he3SecPtRec_from_hypertriton"), 2 * track.pt()); + registryMC.fill(HIST("hypertritonPtgen"), motherparticle.pt()); + } + if (motherparticle.pdgCode() == AntiHyperHelium4PDG) { + registryMC.fill(HIST("he3SecPtRec_from_hyperHe4"), 2 * track.pt()); + registryMC.fill(HIST("hyperHe4Ptgen"), motherparticle.pt()); + } } } } From d087c24d6c1b298081eefc8fca826af7d6fece61 Mon Sep 17 00:00:00 2001 From: altsybee Date: Tue, 26 Nov 2024 17:06:20 +0100 Subject: [PATCH 114/459] [Common/EventSelection,DPG] adding kNoHighMultCollInPrevRof event selection bit (#8652) --- Common/CCDB/EventSelectionParams.cxx | 3 +- Common/CCDB/EventSelectionParams.h | 1 + Common/TableProducer/eventSelection.cxx | 58 +++++++++++++++++++------ DPG/Tasks/AOTEvent/rofOccupancyQa.cxx | 54 ++++++++++++++--------- 4 files changed, 81 insertions(+), 35 deletions(-) diff --git a/Common/CCDB/EventSelectionParams.cxx b/Common/CCDB/EventSelectionParams.cxx index 86bf76a6419..43eb6d00b72 100644 --- a/Common/CCDB/EventSelectionParams.cxx +++ b/Common/CCDB/EventSelectionParams.cxx @@ -60,7 +60,8 @@ const char* selectionLabels[kNsel] = { "kNoCollInTimeRangeStandard", "kNoCollInTimeRangeVzDependent", "kNoCollInRofStrict", - "kNoCollInRofStandard"}; + "kNoCollInRofStandard", + "kNoHighMultCollInPrevRof"}; } // namespace o2::aod::evsel using namespace o2::aod::evsel; diff --git a/Common/CCDB/EventSelectionParams.h b/Common/CCDB/EventSelectionParams.h index 143de878bc5..b5e1f44b91c 100644 --- a/Common/CCDB/EventSelectionParams.h +++ b/Common/CCDB/EventSelectionParams.h @@ -66,6 +66,7 @@ enum EventSelectionFlags { kNoCollInTimeRangeVzDependent, // no other collisions in vZ-dependent time range near a given collision kNoCollInRofStrict, // no other collisions in this Readout Frame kNoCollInRofStandard, // no other collisions in this Readout Frame with per-collision multiplicity above threshold + kNoHighMultCollInPrevRof, // veto an event if FT0C amplitude in previous ITS ROF is above threshold kNsel // counter }; diff --git a/Common/TableProducer/eventSelection.cxx b/Common/TableProducer/eventSelection.cxx index ff55f0e4299..bc9cf1d0fe2 100644 --- a/Common/TableProducer/eventSelection.cxx +++ b/Common/TableProducer/eventSelection.cxx @@ -8,6 +8,8 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include +#include #include "Framework/ConfigParamSpec.h" #include "Framework/runDataProcessing.h" @@ -624,7 +626,7 @@ struct EventSelectionTask { } PROCESS_SWITCH(EventSelectionTask, processRun2, "Process Run2 event selection", true); - Partition pvTracks = ((aod::track::flags & (uint32_t)o2::aod::track::PVContributor) == (uint32_t)o2::aod::track::PVContributor); + Partition pvTracks = ((aod::track::flags & static_cast(o2::aod::track::PVContributor)) == static_cast(o2::aod::track::PVContributor)); void processRun3(aod::Collisions const& cols, FullTracksIU const&, BCsWithBcSelsRun3 const& bcs, aod::FT0s const&) { int run = bcs.iteratorAt(0).runNumber(); @@ -821,8 +823,9 @@ struct EventSelectionTask { } // save indices of collisions for occupancy calculation (both in ROF and in time range) - std::vector> vCollsInTimeWin; std::vector> vCollsInSameITSROF; + std::vector> vCollsInPrevITSROF; + std::vector> vCollsInTimeWin; std::vector> vTimeDeltaForColls; // delta time wrt a given collision for (auto& col : cols) { int32_t colIndex = col.globalIndex(); @@ -835,7 +838,7 @@ struct EventSelectionTask { int64_t rofId = (foundGlobalBC + 3564 - rofOffset) / rofLength; // ### for in-ROF occupancy - std::vector vAssocToSameROF; + std::vector vAssocCollInSameROF; // find all collisions in the same ROF before a given collision int32_t minColIndex = colIndex - 1; while (minColIndex >= 0) { @@ -850,7 +853,7 @@ struct EventSelectionTask { // check if we are within the same ROF if (thisRofId != rofId) break; - vAssocToSameROF.push_back(minColIndex); + vAssocCollInSameROF.push_back(minColIndex); minColIndex--; } // find all collisions in the same ROF after the current one @@ -860,14 +863,31 @@ struct EventSelectionTask { int64_t thisTFid = (thisBC - bcSOR) / nBCsPerTF; if (thisTFid != TFid) break; - // int thisRofIdInTF = (thisBC - rofOffset) / rofLength; int64_t thisRofId = (thisBC + 3564 - rofOffset) / rofLength; if (thisRofId != rofId) break; - vAssocToSameROF.push_back(maxColIndex); + vAssocCollInSameROF.push_back(maxColIndex); maxColIndex++; } - vCollsInSameITSROF.push_back(vAssocToSameROF); + vCollsInSameITSROF.push_back(vAssocCollInSameROF); + + // ### bookkeep collisions in previous ROF + std::vector vAssocCollInPrevROF; + minColIndex = colIndex - 1; + while (minColIndex >= 0) { + int64_t thisBC = vFoundGlobalBC[minColIndex]; + // check if this is still the same TF + int64_t thisTFid = (thisBC - bcSOR) / nBCsPerTF; + if (thisTFid != TFid) + break; + int64_t thisRofId = (thisBC + 3564 - rofOffset) / rofLength; + if (thisRofId == rofId - 1) + vAssocCollInPrevROF.push_back(minColIndex); + else if (thisRofId < rofId - 1) + break; + minColIndex--; + } + vCollsInPrevITSROF.push_back(vAssocCollInPrevROF); // ### for occupancy in time windows std::vector vAssocToThisCol; @@ -924,29 +944,40 @@ struct EventSelectionTask { std::vector vNoCollInSameRofStrict(cols.size(), 0); // to veto events with other collisions in the same ITS ROF std::vector vNoCollInSameRofStandard(cols.size(), 0); // to veto events with other collisions in the same ITS ROF, with per-collision multiplicity above threshold std::vector vNoCollInSameRofWithCloseVz(cols.size(), 0); // to veto events with nearby collisions with close vZ + std::vector vNoHighMultCollInPrevRof(cols.size(), 0); // veto events if FT0C amplitude in previous ITS ROF is above threshold for (auto& col : cols) { int32_t colIndex = col.globalIndex(); float vZ = col.posZ(); // ### in-ROF occupancy - std::vector vAssocToSameROF = vCollsInSameITSROF[colIndex]; - int nITS567tracksForRofVetoStrict = 0; // to veto events with other collisions in the same ITS ROF + std::vector vAssocCollInSameROF = vCollsInSameITSROF[colIndex]; + int nITS567tracksForSameRofVetoStrict = 0; // to veto events with other collisions in the same ITS ROF int nCollsInRofWithFT0CAboveVetoStandard = 0; // to veto events with other collisions in the same ITS ROF, with per-collision multiplicity above threshold int nITS567tracksForRofVetoOnCloseVz = 0; // to veto events with nearby collisions with close vZ - for (uint32_t iCol = 0; iCol < vAssocToSameROF.size(); iCol++) { - int thisColIndex = vAssocToSameROF[iCol]; - nITS567tracksForRofVetoStrict += vTracksITS567perColl[thisColIndex]; + for (uint32_t iCol = 0; iCol < vAssocCollInSameROF.size(); iCol++) { + int thisColIndex = vAssocCollInSameROF[iCol]; + nITS567tracksForSameRofVetoStrict += vTracksITS567perColl[thisColIndex]; if (vAmpFT0CperColl[thisColIndex] > confFT0CamplCutVetoOnCollInROF) nCollsInRofWithFT0CAboveVetoStandard++; if (fabs(vCollVz[thisColIndex] - vZ) < confEpsilonVzDiffVetoInROF) nITS567tracksForRofVetoOnCloseVz += vTracksITS567perColl[thisColIndex]; } // in-ROF occupancy flags - vNoCollInSameRofStrict[colIndex] = (nITS567tracksForRofVetoStrict == 0); + vNoCollInSameRofStrict[colIndex] = (nITS567tracksForSameRofVetoStrict == 0); vNoCollInSameRofStandard[colIndex] = (nCollsInRofWithFT0CAboveVetoStandard == 0); vNoCollInSameRofWithCloseVz[colIndex] = (nITS567tracksForRofVetoOnCloseVz == 0); + // ### occupancy in previous ROF + std::vector vAssocCollInPrevROF = vCollsInPrevITSROF[colIndex]; + float totalFT0amplInPrevROF = 0; + for (uint32_t iCol = 0; iCol < vAssocCollInPrevROF.size(); iCol++) { + int thisColIndex = vAssocCollInPrevROF[iCol]; + totalFT0amplInPrevROF += vAmpFT0CperColl[thisColIndex]; + } + // veto events if FT0C amplitude in previous ITS ROF is above threshold + vNoHighMultCollInPrevRof[colIndex] = (totalFT0amplInPrevROF < confFT0CamplCutVetoOnCollInROF); + // ### occupancy in time windows // protection against TF borders if (!vIsFullInfoForOccupancy[colIndex]) { // occupancy in undefined (too close to TF borders) @@ -1058,6 +1089,7 @@ struct EventSelectionTask { // selection bits based on ITS in-ROF occupancy selection |= vNoCollInSameRofStrict[colIndex] ? BIT(kNoCollInRofStrict) : 0; selection |= (vNoCollInSameRofStandard[colIndex] && vNoCollInSameRofWithCloseVz[colIndex]) ? BIT(kNoCollInRofStandard) : 0; + selection |= vNoHighMultCollInPrevRof[colIndex] ? BIT(kNoHighMultCollInPrevRof) : 0; // apply int7-like selections bool sel7 = 0; diff --git a/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx b/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx index 790174ef6c8..76bf7e87741 100644 --- a/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx +++ b/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx @@ -342,27 +342,31 @@ struct RofOccupancyQaTask { histos.add("ROFbyROF/nPV_000_00y_x00_0", "", kTH2D, {{250, 0., 8000 * k}, {250, 0., 8000 * k}}); // #### new occupancy studies - histos.add("nPV_vs_occupancyByTracks/sel8", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 25000 * k}}); - histos.add("nPV_vs_occupancyByTracks/NoCollInTimeRangeNarrow", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 25000 * k}}); - histos.add("nPV_vs_occupancyByTracks/NoCollInTimeRangeStrict", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 25000 * k}}); - histos.add("nPV_vs_occupancyByTracks/NoCollInTimeRangeStandard", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 25000 * k}}); - histos.add("nPV_vs_occupancyByTracks/NoCollInTimeRangeVzDependent", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 25000 * k}}); - histos.add("nPV_vs_occupancyByTracks/NoCollInRofStrict", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 25000 * k}}); - histos.add("nPV_vs_occupancyByTracks/NoCollInRofStandard", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 25000 * k}}); - histos.add("nPV_vs_occupancyByTracks/NoCollInTimeAndRofStandard", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 25000 * k}}); - histos.add("nPV_vs_occupancyByTracks/NoCollInTimeAndRofStrict", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 25000 * k}}); - histos.add("nPV_vs_occupancyByTracks/NoCollInTimeAndRofStrict_vZ_5cm", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 25000 * k}}); - - histos.add("nPV_vs_occupancyByFT0C/sel8", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); - histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeRangeNarrow", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); - histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeRangeStrict", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); - histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeRangeStandard", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); - histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeRangeVzDependent", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); - histos.add("nPV_vs_occupancyByFT0C/NoCollInRofStrict", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); - histos.add("nPV_vs_occupancyByFT0C/NoCollInRofStandard", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); - histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeAndRofStandard", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); - histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeAndRofStrict", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); - histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeAndRofStrict_vZ_5cm", "", kTH2D, {{250, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); + histos.add("nPV_vs_occupancyByTracks/sel8", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 25000 * k}}); + histos.add("nPV_vs_occupancyByTracks/NoCollInTimeRangeNarrow", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 25000 * k}}); + histos.add("nPV_vs_occupancyByTracks/NoCollInTimeRangeStrict", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 25000 * k}}); + histos.add("nPV_vs_occupancyByTracks/NoCollInTimeRangeStandard", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 25000 * k}}); + histos.add("nPV_vs_occupancyByTracks/NoCollInTimeRangeVzDependent", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 25000 * k}}); + histos.add("nPV_vs_occupancyByTracks/NoCollInRofStrict", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 25000 * k}}); + histos.add("nPV_vs_occupancyByTracks/NoCollInRofStandard", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 25000 * k}}); + histos.add("nPV_vs_occupancyByTracks/NoCollInTimeAndRofStandard", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 25000 * k}}); + histos.add("nPV_vs_occupancyByTracks/NoCollInTimeAndRofStrict", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 25000 * k}}); + histos.add("nPV_vs_occupancyByTracks/NoCollInTimeAndRofStrict_vZ_5cm", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 25000 * k}}); + histos.add("nPV_vs_occupancyByTracks/kNoHighMultCollInPrevRof", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 25000 * k}}); + histos.add("nPV_vs_occupancyByTracks/kNoHighMultCollInPrevRofAndRofStrict", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 25000 * k}}); + + histos.add("nPV_vs_occupancyByFT0C/sel8", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); + histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeRangeNarrow", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); + histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeRangeStrict", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); + histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeRangeStandard", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); + histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeRangeVzDependent", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); + histos.add("nPV_vs_occupancyByFT0C/NoCollInRofStrict", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); + histos.add("nPV_vs_occupancyByFT0C/NoCollInRofStandard", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); + histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeAndRofStandard", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); + histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeAndRofStrict", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); + histos.add("nPV_vs_occupancyByFT0C/NoCollInTimeAndRofStrict_vZ_5cm", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); + histos.add("nPV_vs_occupancyByFT0C/kNoHighMultCollInPrevRof", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); + histos.add("nPV_vs_occupancyByFT0C/kNoHighMultCollInPrevRofAndRofStrict", "", kTH2D, {{125, 0., 8000 * k}, {100, 0., 2.5e5 * k}}); } Partition pvTracks = ((aod::track::flags & static_cast(o2::aod::track::PVContributor)) == static_cast(o2::aod::track::PVContributor)); @@ -978,6 +982,10 @@ struct RofOccupancyQaTask { histos.fill(HIST("nPV_vs_occupancyByTracks/NoCollInTimeAndRofStrict"), nPV, occTracks); if (col.selection_bit(kNoCollInTimeRangeStrict) && col.selection_bit(kNoCollInRofStrict) && fabs(vZ) < 5) histos.fill(HIST("nPV_vs_occupancyByTracks/NoCollInTimeAndRofStrict_vZ_5cm"), nPV, occTracks); + if (col.selection_bit(kNoHighMultCollInPrevRof)) + histos.fill(HIST("nPV_vs_occupancyByTracks/kNoHighMultCollInPrevRof"), nPV, occTracks); + if (col.selection_bit(kNoHighMultCollInPrevRof) && col.selection_bit(kNoCollInRofStrict)) + histos.fill(HIST("nPV_vs_occupancyByTracks/kNoHighMultCollInPrevRofAndRofStrict"), nPV, occTracks); } if (occFT0C >= 0 && fabs(vZ) < 8) { histos.fill(HIST("nPV_vs_occupancyByFT0C/sel8"), nPV, occFT0C); @@ -999,6 +1007,10 @@ struct RofOccupancyQaTask { histos.fill(HIST("nPV_vs_occupancyByFT0C/NoCollInTimeAndRofStrict"), nPV, occFT0C); if (col.selection_bit(kNoCollInTimeRangeStrict) && col.selection_bit(kNoCollInRofStrict) && fabs(vZ) < 5) histos.fill(HIST("nPV_vs_occupancyByFT0C/NoCollInTimeAndRofStrict_vZ_5cm"), nPV, occFT0C); + if (col.selection_bit(kNoHighMultCollInPrevRof)) + histos.fill(HIST("nPV_vs_occupancyByFT0C/kNoHighMultCollInPrevRof"), nPV, occFT0C); + if (col.selection_bit(kNoHighMultCollInPrevRof) && col.selection_bit(kNoCollInRofStrict)) + histos.fill(HIST("nPV_vs_occupancyByFT0C/kNoHighMultCollInPrevRofAndRofStrict"), nPV, occFT0C); } } From 092ed82664af4553905971af998bf6bde00d953a Mon Sep 17 00:00:00 2001 From: Thorkj <154221526+Thorkj@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:09:45 +0100 Subject: [PATCH 115/459] [PWGCF] New task for TwoParticleCorrelation (#8509) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Thor Jensen Co-authored-by: ALICE Action Bot Co-authored-by: Vít Kučera --- .../Tasks/CMakeLists.txt | 9 + .../Tasks/CorrSparse.cxx | 171 ++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index f6742441246..3d939cff243 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -47,3 +47,12 @@ o2physics_add_dpl_workflow(twopartcorr-per-run-extraqc SOURCES perRunExtraQc.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(corrsparses + SOURCES CorrSparse.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore + COMPONENT_NAME Analysis) + + + + diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx b/PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx new file mode 100644 index 00000000000..0d840103eb2 --- /dev/null +++ b/PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx @@ -0,0 +1,171 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Common/Core/RecoDecay.h" +#include "CommonConstants/MathConstants.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/Centrality.h" +#include "PWGCF/Core/CorrelationContainer.h" +#include "PWGCF/Core/PairCuts.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct CorrSparse { + Configurable cfgZVtxCut = {"zvtxcut", 10.0, "Vertex z cut. Default 10 cm"}; + Configurable cfgPtCutMin = {"minpt", 0.2, "Minimum accepted track pT. Default 0.2 GeV"}; + Configurable cfgPtCutMax = {"maxpt", 5.0, "Maximum accepted track pT. Default 5.0 GeV"}; + Configurable cfgEtaCut = {"etacut", 0.8, "Eta cut. Default 0.8"}; + Configurable cfgDCAzCut = {"dcacut", 0.3, "DCA z cut. Default 0.3 cm"}; + Configurable cfgDCAxyCut = {"dcacutxy", 0.3, "DCA xy cut. Default 0.2 cm"}; + Configurable cfgDCAxySigmaCut = {"dcacutxysigma", 1, "DCA xy sigma cut. Default 0.3"}; + Configurable cfgCutChi2prTPCcls = {"chi2cut", 2.5, "Chi2 cut. Default 2.5"}; + ConfigurableAxis axisVertex{"axisVertex", {7, -7, 7}, "vertex axis for histograms"}; + ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -constants::math::PIHalf, constants::math::PIHalf * 3}, "delta phi axis for histograms"}; + ConfigurableAxis axisDeltaEta{"axisDeltaEta", {40, -2, 2}, "delta eta axis for histograms"}; + ConfigurableAxis axisPtTrigger{"axisPtTrigger", {VARIABLE_WIDTH, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0}, "pt trigger axis for histograms"}; + ConfigurableAxis axisPtAssoc{"axisPtAssoc", {VARIABLE_WIDTH, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0}, "pt associated axis for histograms"}; + ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 80, 100}, "multiplicity / centrality axis for histograms"}; + HistogramRegistry registry{"registry"}; + int logcolls = 0; + int logcollpairs = 0; + + void init(InitContext&) + { + LOGF(info, "Starting init"); + registry.add("Yield", "pT vs eta vs Nch", {HistType::kTH3F, {{40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}, {100, 0, 100, "Nch"}}}); // check to see total number of tracks + registry.add("etaphi_Trigger", "eta vs phi vs Nch", {HistType::kTH3F, {{100, -2, 2, "#eta"}, {200, 0, 2 * M_PI, "#varphi"}, {100, 0, 100, "Nch"}}}); + + registry.add("deltaEta_deltaPhi_same", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); // check to see the delta eta and delta phi distribution + registry.add("deltaEta_deltaPhi_mixed", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); + + registry.add("Sparse_mixed", "", {HistType::kTHnSparseD, {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); // Make the output sparse + registry.add("Sparse_same", "", {HistType::kTHnSparseD, {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); + + const int maxMixBin = axisMultiplicity->size() * axisVertex->size(); + registry.add("eventcount", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); // histogram to see how many events are in the same and mixed event + } + + template + void fillYield(TCollision collision, float centrality, TTracks tracks) // function to fill the yield and etaphi histograms. (This is not needed can be removed) + { + for (auto& track1 : tracks) { + registry.fill(HIST("Yield"), track1.pt(), track1.eta(), track1.size()); + registry.fill(HIST("etaphi_Trigger"), track1.size(), track1.phi(), track1.eta()); + } + } + + template + bool fillCollision(TCollision collision, float centrality) + { + + if (!collision.sel8()) { + return false; + } + + return true; + } + + template + void fillCorrelations(TTracks tracks1, TTracks tracks2, float posZ, int system, float Nch) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + { + // loop over all tracks + for (auto const& track1 : tracks1) { + + for (auto const& track2 : tracks2) { + if (track1 == track2) { + continue; + } + + float deltaPhi = track1.phi() - track2.phi(); + float deltaEta = track1.eta() - track2.eta(); + RecoDecay::constrainAngle(deltaPhi, -PIHalf); + + // fill the right sparse and histograms + if (system == 1) { + registry.fill(HIST("deltaEta_deltaPhi_same"), deltaPhi, deltaEta); + registry.fill(HIST("Sparse_same"), posZ, track1.pt(), track2.pt(), Nch, deltaPhi, deltaEta); + } else if (system == 2) { + registry.fill(HIST("deltaEta_deltaPhi_mixed"), deltaPhi, deltaEta); + registry.fill(HIST("Sparse_mixed"), posZ, track1.pt(), track2.pt(), Nch, deltaPhi, deltaEta); + } + } + } + } + + // make the filters and cuts. I was told not to include chi2 since its not needed for run 3 data. + + Filter collisionFilter = nabs(aod::collision::posZ) < cfgZVtxCut; + + Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) + //&& (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) + && (nabs(aod::track::dcaZ) > cfgDCAzCut) && (cfgDCAxySigmaCut * (0.0015f + 0.005f / npow(aod::track::pt, 1.1f)) < nabs(aod::track::dcaXY)); + // + + // define the filtered collisions and tracks + using aodCollisions = soa::Filtered>; + using aodTracks = soa::Filtered>; + + // process for the same event + void processSame(aodCollisions::iterator const& collision, aodTracks const& tracks) + { + const auto centrality = collision.centFT0C(); + + registry.fill(HIST("eventcount"), -2); // because its same event i put it in the -2 bin + fillYield(collision, centrality, tracks); + fillCorrelations(tracks, tracks, collision.posZ(), 1, tracks.size()); // fill the SE histogram and Sparse + } + PROCESS_SWITCH(CorrSparse, processSame, "Process same event", true); + + // i do the event mixing (i have not changed this from the tutorial i got). + std::vector vtxBinsEdges{VARIABLE_WIDTH, -7.0f, -5.0f, -3.0f, -1.0f, 1.0f, 3.0f, 5.0f, 7.0f}; + std::vector multBinsEdges{VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0, 100.1f}; + SliceCache cache; + + ColumnBinningPolicy + bindingOnVtxAndMult{{vtxBinsEdges, multBinsEdges}, true}; // true is for 'ignore overflows' (true by default) + SameKindPair> + pair{bindingOnVtxAndMult, 5, -1, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored + + // the process for filling the mixed events + void processMixed(aodCollisions& collisions, aodTracks const& tracks) + { + for (auto& [collision1, tracks1, collision2, tracks2] : pair) { + + if (fillCollision(collision1, collision1.centFT0C()) == false) { + continue; + } + + registry.fill(HIST("eventcount"), 1); // fill the mixed event in the 1 bin + + fillCorrelations(tracks1, tracks2, collision1.posZ(), 2, tracks1.size()); + } + } + PROCESS_SWITCH(CorrSparse, processMixed, "Process mixed events", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + }; +} From e018ae1bd8b0cf136ddb165e9f9d31f20e0a10d5 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:14:26 +0100 Subject: [PATCH 116/459] [PWGLF] Add histograms for generated candidates coming from recoed event (#8621) --- .../derivedlambdakzeroanalysis.cxx | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index c40b0e6adb3..7b8ea9683d9 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -668,6 +668,14 @@ struct derivedlambdakzeroanalysis { histos.add("h2dGenOmegaMinus", "h2dGenOmegaMinus", kTH2D, {axisCentrality, axisPt}); histos.add("h2dGenOmegaPlus", "h2dGenOmegaPlus", kTH2D, {axisCentrality, axisPt}); + histos.add("h2dGenK0ShortVsMultMC_RecoedEvt", "h2dGenK0ShortVsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); + histos.add("h2dGenLambdaVsMultMC_RecoedEvt", "h2dGenLambdaVsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); + histos.add("h2dGenAntiLambdaVsMultMC_RecoedEvt", "h2dGenAntiLambdaVsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); + histos.add("h2dGenXiMinusVsMultMC_RecoedEvt", "h2dGenXiMinusVsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); + histos.add("h2dGenXiPlusVsMultMC_RecoedEvt", "h2dGenXiPlusVsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); + histos.add("h2dGenOmegaMinusVsMultMC_RecoedEvt", "h2dGenOmegaMinusVsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); + histos.add("h2dGenOmegaPlusVsMultMC_RecoedEvt", "h2dGenOmegaPlusVsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); + histos.add("h2dGenK0ShortVsMultMC", "h2dGenK0ShortVsMultMC", kTH2D, {axisNch, axisPt}); histos.add("h2dGenLambdaVsMultMC", "h2dGenLambdaVsMultMC", kTH2D, {axisNch, axisPt}); histos.add("h2dGenAntiLambdaVsMultMC", "h2dGenAntiLambdaVsMultMC", kTH2D, {axisNch, axisPt}); @@ -1750,6 +1758,16 @@ struct derivedlambdakzeroanalysis { if (maxOccupancy > 0 && collisionOccupancy > maxOccupancy) { continue; } + + if (v0MC.pdgCode() == 310) { + histos.fill(HIST("h2dGenK0ShortVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + } + if (v0MC.pdgCode() == 3122) { + histos.fill(HIST("h2dGenLambdaVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + } + if (v0MC.pdgCode() == -3122) { + histos.fill(HIST("h2dGenAntiLambdaVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + } } if (v0MC.pdgCode() == 310) { @@ -1796,6 +1814,19 @@ struct derivedlambdakzeroanalysis { if (maxOccupancy > 0 && collisionOccupancy > maxOccupancy) { continue; } + + if (cascMC.pdgCode() == 3312) { + histos.fill(HIST("h2dGenXiMinusVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + } + if (cascMC.pdgCode() == -3312) { + histos.fill(HIST("h2dGenXiPlusVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + } + if (cascMC.pdgCode() == 3334) { + histos.fill(HIST("h2dGenOmegaMinusVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + } + if (cascMC.pdgCode() == -3334) { + histos.fill(HIST("h2dGenOmegaPlusVsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + } } if (cascMC.pdgCode() == 3312) { From 572e661555f288c6ef4a0da6ea04f6057d638809 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:55:50 +0100 Subject: [PATCH 117/459] [PWGLF] Re-add pdgCodeV0 column filling for recoed cascade (#8665) --- PWGLF/TableProducer/Strangeness/cascademcbuilder.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGLF/TableProducer/Strangeness/cascademcbuilder.cxx b/PWGLF/TableProducer/Strangeness/cascademcbuilder.cxx index 4e8e62d9db7..3d4a5642004 100644 --- a/PWGLF/TableProducer/Strangeness/cascademcbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/cascademcbuilder.cxx @@ -196,6 +196,7 @@ struct cascademcbuilder { thisInfo.lxyz[0] = particleForLambdaDecayPosition.vx(); thisInfo.lxyz[1] = particleForLambdaDecayPosition.vy(); thisInfo.lxyz[2] = particleForLambdaDecayPosition.vz(); + thisInfo.pdgCodeV0 = originatingV0.pdgCode(); if (originatingV0.has_mothers()) { for (auto& lV0Mother : originatingV0.template mothers_as()) { From a73bf06796c1a93d0334ca1f4b00843c67587ccf Mon Sep 17 00:00:00 2001 From: amaringarcia Date: Tue, 26 Nov 2024 18:15:16 +0100 Subject: [PATCH 118/459] =?UTF-8?q?[PWGDQ,DPG]=20adding=20hadronic=20rate?= =?UTF-8?q?=20to=20clean=20sample=20trees,=20adding=20=20config=E2=80=A6?= =?UTF-8?q?=20(#8623)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DPG/Tasks/TPC/CMakeLists.txt | 2 +- DPG/Tasks/TPC/tpcSkimsTableCreator.cxx | 67 +++++++++++++++++--------- DPG/Tasks/TPC/tpcSkimsTableCreator.h | 7 ++- PWGDQ/Tasks/v0selector.cxx | 12 +++-- 4 files changed, 59 insertions(+), 29 deletions(-) diff --git a/DPG/Tasks/TPC/CMakeLists.txt b/DPG/Tasks/TPC/CMakeLists.txt index 65482991a4b..b8c68ba36fc 100644 --- a/DPG/Tasks/TPC/CMakeLists.txt +++ b/DPG/Tasks/TPC/CMakeLists.txt @@ -11,7 +11,7 @@ o2physics_add_dpl_workflow(pid-tpc-skimscreation SOURCES tpcSkimsTableCreator.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(pid-tpc-tree-creator-light diff --git a/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx b/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx index 67480f2c6d7..2b39df5bb73 100644 --- a/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx +++ b/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx @@ -23,6 +23,8 @@ #include "TRandom3.h" /// O2 #include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" /// O2Physics @@ -33,6 +35,7 @@ #include "PWGDQ/DataModel/ReducedInfoTables.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/EventSelection.h" +#include "Common/CCDB/ctpRateFetcher.h" using namespace o2; using namespace o2::framework; @@ -42,6 +45,8 @@ using namespace o2::dataformats; struct TreeWriterTpcV0 { + Service ccdb; + using Trks = soa::Join; using Coll = soa::Join; @@ -72,9 +77,11 @@ struct TreeWriterTpcV0 { ((trackSelection.node() == 4) && requireQualityTracksInFilter()) || ((trackSelection.node() == 5) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks)); + ctpRateFetcher mRateFetcher; + /// Funktion to fill skimmed tables template - void fillSkimmedV0Table(V0 const& v0, T const& track, C const& collision, const float nSigmaTPC, const float nSigmaTOF, const float dEdxExp, const o2::track::PID::ID id, int runnumber, double dwnSmplFactor) + void fillSkimmedV0Table(V0 const& v0, T const& track, C const& collision, const float nSigmaTPC, const float nSigmaTOF, const float dEdxExp, const o2::track::PID::ID id, int runnumber, double dwnSmplFactor, float hadronicRate) { const double ncl = track.tpcNClsFound(); @@ -117,7 +124,8 @@ struct TreeWriterTpcV0 { gammapsipair, runnumber, trackocc, - ft0occ); + ft0occ, + hadronicRate); } }; @@ -171,6 +179,9 @@ struct TreeWriterTpcV0 { void init(o2::framework::InitContext&) { + ccdb->setURL("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setFatalWhenNull(false); } /// Apply a track quality selection with a filter! @@ -182,6 +193,7 @@ struct TreeWriterTpcV0 { } auto bc = collision.bc_as(); const int runnumber = bc.runNumber(); + float hadronicRate = mRateFetcher.fetch(ccdb.service, bc.timestamp(), runnumber, "ZNC hadronic") * 1.e-3; rowTPCTree.reserve(tracks.size()); @@ -192,37 +204,37 @@ struct TreeWriterTpcV0 { // gamma if (static_cast(posTrack.pidbit() & (1 << 0)) && static_cast(negTrack.pidbit() & (1 << 0))) { if (downsampleTsalisCharged(posTrack.pt(), downsamplingTsalisElectrons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Electron], maxPt4dwnsmplTsalisElectrons)) { - fillSkimmedV0Table(v0, posTrack, collision, posTrack.tpcNSigmaEl(), posTrack.tofNSigmaEl(), posTrack.tpcExpSignalEl(posTrack.tpcSignal()), o2::track::PID::Electron, runnumber, dwnSmplFactor_El); + fillSkimmedV0Table(v0, posTrack, collision, posTrack.tpcNSigmaEl(), posTrack.tofNSigmaEl(), posTrack.tpcExpSignalEl(posTrack.tpcSignal()), o2::track::PID::Electron, runnumber, dwnSmplFactor_El, hadronicRate); } if (downsampleTsalisCharged(negTrack.pt(), downsamplingTsalisElectrons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Electron], maxPt4dwnsmplTsalisElectrons)) { - fillSkimmedV0Table(v0, negTrack, collision, negTrack.tpcNSigmaEl(), negTrack.tofNSigmaEl(), negTrack.tpcExpSignalEl(negTrack.tpcSignal()), o2::track::PID::Electron, runnumber, dwnSmplFactor_El); + fillSkimmedV0Table(v0, negTrack, collision, negTrack.tpcNSigmaEl(), negTrack.tofNSigmaEl(), negTrack.tpcExpSignalEl(negTrack.tpcSignal()), o2::track::PID::Electron, runnumber, dwnSmplFactor_El, hadronicRate); } } // Ks0 if (static_cast(posTrack.pidbit() & (1 << 1)) && static_cast(negTrack.pidbit() & (1 << 1))) { if (downsampleTsalisCharged(posTrack.pt(), downsamplingTsalisPions, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Pion], maxPt4dwnsmplTsalisPions)) { - fillSkimmedV0Table(v0, posTrack, collision, posTrack.tpcNSigmaPi(), posTrack.tofNSigmaPi(), posTrack.tpcExpSignalPi(posTrack.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi); + fillSkimmedV0Table(v0, posTrack, collision, posTrack.tpcNSigmaPi(), posTrack.tofNSigmaPi(), posTrack.tpcExpSignalPi(posTrack.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi, hadronicRate); } if (downsampleTsalisCharged(negTrack.pt(), downsamplingTsalisPions, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Pion], maxPt4dwnsmplTsalisPions)) { - fillSkimmedV0Table(v0, negTrack, collision, negTrack.tpcNSigmaPi(), negTrack.tofNSigmaPi(), negTrack.tpcExpSignalPi(negTrack.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi); + fillSkimmedV0Table(v0, negTrack, collision, negTrack.tpcNSigmaPi(), negTrack.tofNSigmaPi(), negTrack.tpcExpSignalPi(negTrack.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi, hadronicRate); } } // Lambda if (static_cast(posTrack.pidbit() & (1 << 2)) && static_cast(negTrack.pidbit() & (1 << 2))) { if (downsampleTsalisCharged(posTrack.pt(), downsamplingTsalisProtons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Proton], maxPt4dwnsmplTsalisProtons)) { - fillSkimmedV0Table(v0, posTrack, collision, posTrack.tpcNSigmaPr(), posTrack.tofNSigmaPr(), posTrack.tpcExpSignalPr(posTrack.tpcSignal()), o2::track::PID::Proton, runnumber, dwnSmplFactor_Pr); + fillSkimmedV0Table(v0, posTrack, collision, posTrack.tpcNSigmaPr(), posTrack.tofNSigmaPr(), posTrack.tpcExpSignalPr(posTrack.tpcSignal()), o2::track::PID::Proton, runnumber, dwnSmplFactor_Pr, hadronicRate); } if (downsampleTsalisCharged(negTrack.pt(), downsamplingTsalisPions, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Pion], maxPt4dwnsmplTsalisPions)) { - fillSkimmedV0Table(v0, negTrack, collision, negTrack.tpcNSigmaPi(), negTrack.tofNSigmaPi(), negTrack.tpcExpSignalPi(negTrack.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi); + fillSkimmedV0Table(v0, negTrack, collision, negTrack.tpcNSigmaPi(), negTrack.tofNSigmaPi(), negTrack.tpcExpSignalPi(negTrack.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi, hadronicRate); } } // Antilambda if (static_cast(posTrack.pidbit() & (1 << 3)) && static_cast(negTrack.pidbit() & (1 << 3))) { if (downsampleTsalisCharged(posTrack.pt(), downsamplingTsalisPions, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Pion], maxPt4dwnsmplTsalisPions)) { - fillSkimmedV0Table(v0, posTrack, collision, posTrack.tpcNSigmaPi(), posTrack.tofNSigmaPi(), posTrack.tpcExpSignalPi(posTrack.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi); + fillSkimmedV0Table(v0, posTrack, collision, posTrack.tpcNSigmaPi(), posTrack.tofNSigmaPi(), posTrack.tpcExpSignalPi(posTrack.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi, hadronicRate); } if (downsampleTsalisCharged(negTrack.pt(), downsamplingTsalisProtons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Proton], maxPt4dwnsmplTsalisProtons)) { - fillSkimmedV0Table(v0, negTrack, collision, negTrack.tpcNSigmaPr(), negTrack.tofNSigmaPr(), negTrack.tpcExpSignalPr(negTrack.tpcSignal()), o2::track::PID::Proton, runnumber, dwnSmplFactor_Pr); + fillSkimmedV0Table(v0, negTrack, collision, negTrack.tpcNSigmaPr(), negTrack.tofNSigmaPr(), negTrack.tpcExpSignalPr(negTrack.tpcSignal()), o2::track::PID::Proton, runnumber, dwnSmplFactor_Pr, hadronicRate); } } } @@ -230,6 +242,9 @@ struct TreeWriterTpcV0 { }; /// struct TreeWriterTpcV0 struct TreeWriterTPCTOF { + + Service ccdb; + using Trks = soa::Join; using Coll = soa::Join; @@ -289,6 +304,8 @@ struct TreeWriterTPCTOF { ((trackSelection.node() == 4) && requireQualityTracksInFilter()) || ((trackSelection.node() == 5) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks)); + ctpRateFetcher mRateFetcher; + double tsalisCharged(double pt, double mass, double sqrts) { const double a = 6.81, b = 59.24; @@ -320,7 +337,7 @@ struct TreeWriterTPCTOF { /// Function to fill trees template - void fillSkimmedTPCTOFTable(T const& track, C const& collision, const float nSigmaTPC, const float nSigmaTOF, const float dEdxExp, const o2::track::PID::ID id, int runnumber, double dwnSmplFactor) + void fillSkimmedTPCTOFTable(T const& track, C const& collision, const float nSigmaTPC, const float nSigmaTOF, const float dEdxExp, const o2::track::PID::ID id, int runnumber, double dwnSmplFactor, double hadronicRate) { const double ncl = track.tpcNClsFound(); @@ -350,7 +367,8 @@ struct TreeWriterTPCTOF { nSigmaTOF, runnumber, trackocc, - ft0occ); + ft0occ, + hadronicRate); } }; @@ -372,6 +390,9 @@ struct TreeWriterTPCTOF { void init(o2::framework::InitContext&) { + ccdb->setURL("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setFatalWhenNull(false); } void process(Coll::iterator const& collision, soa::Filtered const& tracks, aod::BCsWithTimestamps const&) @@ -383,37 +404,39 @@ struct TreeWriterTPCTOF { auto bc = collision.bc_as(); const int runnumber = bc.runNumber(); + float hadronicRate = mRateFetcher.fetch(ccdb.service, bc.timestamp(), runnumber, "ZNC hadronic") * 1.e-3; + rowTPCTOFTree.reserve(tracks.size()); for (auto const& trk : tracks) { /// Fill tree for tritons if (trk.tpcInnerParam() < maxMomHardCutOnlyTr && trk.tpcInnerParam() <= maxMomTPCOnlyTr && std::abs(trk.tpcNSigmaTr()) < nSigmaTPCOnlyTr && downsampleTsalisCharged(trk.pt(), downsamplingTsalisProtons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Triton])) { - fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaTr(), trk.tofNSigmaTr(), trk.tpcExpSignalTr(trk.tpcSignal()), o2::track::PID::Triton, runnumber, dwnSmplFactor_Tr); + fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaTr(), trk.tofNSigmaTr(), trk.tpcExpSignalTr(trk.tpcSignal()), o2::track::PID::Triton, runnumber, dwnSmplFactor_Tr, hadronicRate); } else if (trk.tpcInnerParam() < maxMomHardCutOnlyTr && trk.tpcInnerParam() > maxMomTPCOnlyTr && std::abs(trk.tofNSigmaTr()) < nSigmaTOF_TPCTOF_Tr && std::abs(trk.tpcNSigmaTr()) < nSigmaTPC_TPCTOF_Tr && downsampleTsalisCharged(trk.pt(), downsamplingTsalisProtons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Triton])) { - fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaTr(), trk.tofNSigmaTr(), trk.tpcExpSignalTr(trk.tpcSignal()), o2::track::PID::Triton, runnumber, dwnSmplFactor_Tr); + fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaTr(), trk.tofNSigmaTr(), trk.tpcExpSignalTr(trk.tpcSignal()), o2::track::PID::Triton, runnumber, dwnSmplFactor_Tr, hadronicRate); } /// Fill tree for deuterons if (trk.tpcInnerParam() < maxMomHardCutOnlyDe && trk.tpcInnerParam() <= maxMomTPCOnlyDe && std::abs(trk.tpcNSigmaDe()) < nSigmaTPCOnlyDe && downsampleTsalisCharged(trk.pt(), downsamplingTsalisProtons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Deuteron])) { - fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaDe(), trk.tofNSigmaDe(), trk.tpcExpSignalDe(trk.tpcSignal()), o2::track::PID::Deuteron, runnumber, dwnSmplFactor_De); + fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaDe(), trk.tofNSigmaDe(), trk.tpcExpSignalDe(trk.tpcSignal()), o2::track::PID::Deuteron, runnumber, dwnSmplFactor_De, hadronicRate); } else if (trk.tpcInnerParam() < maxMomHardCutOnlyDe && trk.tpcInnerParam() > maxMomTPCOnlyDe && std::abs(trk.tofNSigmaDe()) < nSigmaTOF_TPCTOF_De && std::abs(trk.tpcNSigmaDe()) < nSigmaTPC_TPCTOF_De && downsampleTsalisCharged(trk.pt(), downsamplingTsalisProtons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Deuteron])) { - fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaDe(), trk.tofNSigmaDe(), trk.tpcExpSignalDe(trk.tpcSignal()), o2::track::PID::Deuteron, runnumber, dwnSmplFactor_De); + fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaDe(), trk.tofNSigmaDe(), trk.tpcExpSignalDe(trk.tpcSignal()), o2::track::PID::Deuteron, runnumber, dwnSmplFactor_De, hadronicRate); } /// Fill tree for protons if (trk.tpcInnerParam() <= maxMomTPCOnlyPr && std::abs(trk.tpcNSigmaPr()) < nSigmaTPCOnlyPr && downsampleTsalisCharged(trk.pt(), downsamplingTsalisProtons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Proton])) { - fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaPr(), trk.tofNSigmaPr(), trk.tpcExpSignalPr(trk.tpcSignal()), o2::track::PID::Proton, runnumber, dwnSmplFactor_Pr); + fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaPr(), trk.tofNSigmaPr(), trk.tpcExpSignalPr(trk.tpcSignal()), o2::track::PID::Proton, runnumber, dwnSmplFactor_Pr, hadronicRate); } else if (trk.tpcInnerParam() > maxMomTPCOnlyPr && std::abs(trk.tofNSigmaPr()) < nSigmaTOF_TPCTOF_Pr && std::abs(trk.tpcNSigmaPr()) < nSigmaTPC_TPCTOF_Pr && downsampleTsalisCharged(trk.pt(), downsamplingTsalisProtons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Proton])) { - fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaPr(), trk.tofNSigmaPr(), trk.tpcExpSignalPr(trk.tpcSignal()), o2::track::PID::Proton, runnumber, dwnSmplFactor_Pr); + fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaPr(), trk.tofNSigmaPr(), trk.tpcExpSignalPr(trk.tpcSignal()), o2::track::PID::Proton, runnumber, dwnSmplFactor_Pr, hadronicRate); } /// Fill tree for kaons if (trk.tpcInnerParam() < maxMomHardCutOnlyKa && trk.tpcInnerParam() <= maxMomTPCOnlyKa && std::abs(trk.tpcNSigmaKa()) < nSigmaTPCOnlyKa && downsampleTsalisCharged(trk.pt(), downsamplingTsalisKaons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Kaon])) { - fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaKa(), trk.tofNSigmaKa(), trk.tpcExpSignalKa(trk.tpcSignal()), o2::track::PID::Kaon, runnumber, dwnSmplFactor_Ka); + fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaKa(), trk.tofNSigmaKa(), trk.tpcExpSignalKa(trk.tpcSignal()), o2::track::PID::Kaon, runnumber, dwnSmplFactor_Ka, hadronicRate); } else if (trk.tpcInnerParam() < maxMomHardCutOnlyKa && trk.tpcInnerParam() > maxMomTPCOnlyKa && std::abs(trk.tofNSigmaKa()) < nSigmaTOF_TPCTOF_Ka && std::abs(trk.tpcNSigmaKa()) < nSigmaTPC_TPCTOF_Ka && downsampleTsalisCharged(trk.pt(), downsamplingTsalisKaons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Kaon])) { - fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaKa(), trk.tofNSigmaKa(), trk.tpcExpSignalKa(trk.tpcSignal()), o2::track::PID::Kaon, runnumber, dwnSmplFactor_Ka); + fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaKa(), trk.tofNSigmaKa(), trk.tpcExpSignalKa(trk.tpcSignal()), o2::track::PID::Kaon, runnumber, dwnSmplFactor_Ka, hadronicRate); } /// Fill tree pions if (trk.tpcInnerParam() <= maxMomTPCOnlyPi && std::abs(trk.tpcNSigmaPi()) < nSigmaTPCOnlyPi && downsampleTsalisCharged(trk.pt(), downsamplingTsalisPions, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Pion])) { - fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaPi(), trk.tofNSigmaPi(), trk.tpcExpSignalPi(trk.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi); + fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaPi(), trk.tofNSigmaPi(), trk.tpcExpSignalPi(trk.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi, hadronicRate); } else if (trk.tpcInnerParam() > maxMomTPCOnlyPi && std::abs(trk.tofNSigmaPi()) < nSigmaTOF_TPCTOF_Pi && std::abs(trk.tpcNSigmaPi()) < nSigmaTPC_TPCTOF_Pi && downsampleTsalisCharged(trk.pt(), downsamplingTsalisPions, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Pion])) { - fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaPi(), trk.tofNSigmaPi(), trk.tpcExpSignalPi(trk.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi); + fillSkimmedTPCTOFTable(trk, collision, trk.tpcNSigmaPi(), trk.tofNSigmaPi(), trk.tpcExpSignalPi(trk.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi, hadronicRate); } } /// Loop tracks } /// process diff --git a/DPG/Tasks/TPC/tpcSkimsTableCreator.h b/DPG/Tasks/TPC/tpcSkimsTableCreator.h index 2f65dccc589..7c770602efd 100644 --- a/DPG/Tasks/TPC/tpcSkimsTableCreator.h +++ b/DPG/Tasks/TPC/tpcSkimsTableCreator.h @@ -43,6 +43,7 @@ DECLARE_SOA_COLUMN(GammaPsiPair, gammaPsiPair, float); DECLARE_SOA_COLUMN(RunNumber, runNumber, int); DECLARE_SOA_COLUMN(TrackOcc, trackOcc, float); DECLARE_SOA_COLUMN(Ft0Occ, ft0Occ, float); +DECLARE_SOA_COLUMN(HadronicRate, hadronicRate, float); } // namespace tpcskims DECLARE_SOA_TABLE(SkimmedTPCV0Tree, "AOD", "TPCSKIMV0TREE", o2::aod::track::TPCSignal, @@ -68,7 +69,8 @@ DECLARE_SOA_TABLE(SkimmedTPCV0Tree, "AOD", "TPCSKIMV0TREE", tpcskims::GammaPsiPair, tpcskims::RunNumber, tpcskims::TrackOcc, - tpcskims::Ft0Occ); + tpcskims::Ft0Occ, + tpcskims::HadronicRate); DECLARE_SOA_TABLE(SkimmedTPCTOFTree, "AOD", "TPCTOFSKIMTREE", o2::aod::track::TPCSignal, @@ -88,6 +90,7 @@ DECLARE_SOA_TABLE(SkimmedTPCTOFTree, "AOD", "TPCTOFSKIMTREE", tpcskims::NSigTOF, tpcskims::RunNumber, tpcskims::TrackOcc, - tpcskims::Ft0Occ); + tpcskims::Ft0Occ, + tpcskims::HadronicRate); } // namespace o2::aod #endif // DPG_TASKS_TPC_TPCSKIMSTABLECREATOR_H_ diff --git a/PWGDQ/Tasks/v0selector.cxx b/PWGDQ/Tasks/v0selector.cxx index e5489fc33b6..679973da3f2 100644 --- a/PWGDQ/Tasks/v0selector.cxx +++ b/PWGDQ/Tasks/v0selector.cxx @@ -158,6 +158,10 @@ struct v0selector { Configurable mincrossedrows{"mincrossedrows", 70, "min crossed rows"}; Configurable maxchi2tpc{"maxchi2tpc", 4.0, "max chi2/NclsTPC"}; Configurable fillhisto{"fillhisto", false, "flag to fill histograms"}; + // cutNsigmaElTPC, cutNsigmaPiTPC, cutNsigmaPrTPC + Configurable cutNsigmaElTPC{"cutNsigmaElTPC", 5.0, "cutNsigmaElTPC"}; + Configurable cutNsigmaPiTPC{"cutNsigmaPiTPC", 5.0, "cutNsigmaPiTPC"}; + Configurable cutNsigmaPrTPC{"cutNsigmaPrTPC", 5.0, "cutNsigmaPrTPC"}; HistogramRegistry registry{"registry"}; void init(o2::framework::InitContext&) @@ -303,7 +307,7 @@ struct v0selector { registry.fill(HIST("hMassGamma"), V0radius, mGamma); registry.fill(HIST("hV0Psi"), psipair, mGamma); } - if (mGamma < v0max_mee && TMath::Abs(V0.posTrack_as().tpcNSigmaEl()) < 5 && TMath::Abs(V0.negTrack_as().tpcNSigmaEl()) < 5 && TMath::Abs(psipair) < maxpsipair) { + if (mGamma < v0max_mee && TMath::Abs(V0.posTrack_as().tpcNSigmaEl()) < cutNsigmaElTPC && TMath::Abs(V0.negTrack_as().tpcNSigmaEl()) < cutNsigmaElTPC && TMath::Abs(psipair) < maxpsipair) { pidmap[V0.posTrackId()] |= (uint8_t(1) << kGamma); pidmap[V0.negTrackId()] |= (uint8_t(1) << kGamma); if (fillhisto) { @@ -317,7 +321,7 @@ struct v0selector { registry.fill(HIST("hMassK0SEta"), V0.eta(), mK0S); registry.fill(HIST("hMassK0SPhi"), V0.phi(), mK0S); } - if ((0.48 < mK0S && mK0S < 0.51) && TMath::Abs(V0.posTrack_as().tpcNSigmaPi()) < 5 && TMath::Abs(V0.negTrack_as().tpcNSigmaPi()) < 5) { + if ((0.48 < mK0S && mK0S < 0.51) && TMath::Abs(V0.posTrack_as().tpcNSigmaPi()) < cutNsigmaPiTPC && TMath::Abs(V0.negTrack_as().tpcNSigmaPi()) < cutNsigmaPiTPC) { pidmap[V0.posTrackId()] |= (uint8_t(1) << kK0S); pidmap[V0.negTrackId()] |= (uint8_t(1) << kK0S); } @@ -325,7 +329,7 @@ struct v0selector { if (fillhisto) { registry.fill(HIST("hMassLambda"), V0radius, mLambda); } - if (v0id == kLambda && (1.110 < mLambda && mLambda < 1.120) && TMath::Abs(V0.posTrack_as().tpcNSigmaPr()) < 5 && TMath::Abs(V0.negTrack_as().tpcNSigmaPi()) < 5) { + if (v0id == kLambda && (1.110 < mLambda && mLambda < 1.120) && TMath::Abs(V0.posTrack_as().tpcNSigmaPr()) < cutNsigmaPrTPC && TMath::Abs(V0.negTrack_as().tpcNSigmaPi()) < cutNsigmaPiTPC) { pidmap[V0.posTrackId()] |= (uint8_t(1) << kLambda); pidmap[V0.negTrackId()] |= (uint8_t(1) << kLambda); } @@ -333,7 +337,7 @@ struct v0selector { if (fillhisto) { registry.fill(HIST("hMassAntiLambda"), V0radius, mAntiLambda); } - if ((1.110 < mAntiLambda && mAntiLambda < 1.120) && TMath::Abs(V0.posTrack_as().tpcNSigmaPi()) < 5 && TMath::Abs(V0.negTrack_as().tpcNSigmaPr()) < 5) { + if ((1.110 < mAntiLambda && mAntiLambda < 1.120) && TMath::Abs(V0.posTrack_as().tpcNSigmaPi()) < cutNsigmaPiTPC && TMath::Abs(V0.negTrack_as().tpcNSigmaPr()) < cutNsigmaPrTPC) { pidmap[V0.posTrackId()] |= (uint8_t(1) << kAntiLambda); pidmap[V0.negTrackId()] |= (uint8_t(1) << kAntiLambda); } From 7e1045af84cdb498caa896dc642c3dcf01c48033 Mon Sep 17 00:00:00 2001 From: lauraser <45659867+lauraser@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:33:17 +0100 Subject: [PATCH 119/459] Updated pair cleaner (#8664) Co-authored-by: Laura Serksnyte --- PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h b/PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h index 42828b1c38b..7ae8ba40cc6 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h +++ b/PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h @@ -70,7 +70,7 @@ class FemtoDreamPairCleaner } const auto& posChild = particles.iteratorAt(part2.index() - 2); const auto& negChild = particles.iteratorAt(part2.index() - 1); - if (part1.globalIndex() != posChild.globalIndex() || part1.globalIndex() != negChild.globalIndex()) { + if (part1.globalIndex() != posChild.childrenIds()[0] && part1.globalIndex() != negChild.childrenIds()[1]) { return true; } return false; From a897d8e3169a7695c927b6c6adec3d4cbaada830 Mon Sep 17 00:00:00 2001 From: Tanu Gahlaut <154991749+TGahlaut1@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:41:29 +0100 Subject: [PATCH 120/459] [PWGCF] Update change in MC process function (#8663) --- .../Tasks/MeanPtFlucIdentified.cxx | 665 +++++++++--------- 1 file changed, 346 insertions(+), 319 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanPtFlucIdentified.cxx b/PWGCF/EbyEFluctuations/Tasks/MeanPtFlucIdentified.cxx index cda9e3ebd83..709554718a1 100644 --- a/PWGCF/EbyEFluctuations/Tasks/MeanPtFlucIdentified.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/MeanPtFlucIdentified.cxx @@ -75,18 +75,21 @@ struct meanPtFlucId { Configurable cfgMcTofShiftPi{"cfgMcTofShiftPi", 0., "Pion Shift in TOF (MC data) "}; Configurable cfgMcTofShiftKa{"cfgMcTofShiftKa", 0., "Kaon Shift in TOF (MC data) "}; Configurable cfgMcTofShiftPr{"cfgMcTofShiftPr", 0., "Proton Shift in TOF (MC data) "}; + Configurable cfgMCReco{"cfgMCReco", false, ""}; + Configurable cfgMCTruth{"cfgMCTruth", false, ""}; Configurable cfgPosZ{"cfgPosZ", true, "Position Z"}; Configurable cfgSel8{"cfgSel8", true, "Sel8 trigger"}; Configurable cfgEvSel1{"cfgEvSel1", true, "kNoSameBunchPileup"}; Configurable cfgEvSel2{"cfgEvSel2", true, "kIsGoodZvtxFT0vsPV"}; + Configurable cfgEvSel3{"cfgEvSel3", true, "kIsVertexITSTPC"}; Configurable cfgInvMass{"cfgInvMass", true, "electron Inv Mass cut selection"}; Configurable cfgSelOR{"cfgSelOR", true, "Low OR High momentum "}; Configurable cfgSelAND{"cfgSelAND", false, "Low AND High momentum"}; Configurable cfgSelLow{"cfgSelLow", true, "PID selection cut for Low momentum"}; Configurable cfgSelHigh{"cfgSelHigh", true, "PID selection cut for High momentum"}; ConfigurableAxis multTPCBins{"multTPCBins", {150, 0, 150}, "TPC Multiplicity bins"}; - ConfigurableAxis multFT0CBins{"multFT0CBins", {400, 0, 4000}, "Forward Multiplicity bins"}; - ConfigurableAxis multFT0CMCBins{"multFT0CMCBins", {250, 0, 250}, "Forward Multiplicity bins"}; + ConfigurableAxis multFT0MBins{"multFT0MBins", {400, 0, 4000}, "Forward Multiplicity bins"}; + ConfigurableAxis multFT0MMCBins{"multFT0MMCBins", {250, 0, 250}, "Forward Multiplicity bins"}; ConfigurableAxis dcaXYBins{"dcaXYBins", {100, -0.15, 0.15}, "dcaXY bins"}; ConfigurableAxis dcaZBins{"dcaZBins", {100, -1.2, 1.2}, "dcaZ bins"}; ConfigurableAxis QnBins{"QnBins", {1000, 0., 100.}, "nth moments bins"}; @@ -124,8 +127,8 @@ struct meanPtFlucId { const AxisSpec axisMeanPt{100, 0., 3., "M(p_{T}) (GeV/c)"}; const AxisSpec axisMult{100, 0, 100, "N_{ch}"}; const AxisSpec axisMultTPC{multTPCBins, "N_{TPC} "}; - const AxisSpec axisMultFT0C{multFT0CBins, "N_{FT0C}"}; - const AxisSpec axisMultFT0CMC{multFT0CMCBins, "N_{FT0C}"}; + const AxisSpec axisMultFT0M{multFT0MBins, "N_{FT0M}"}; + const AxisSpec axisMultFT0MMC{multFT0MMCBins, "N_{FT0M}"}; const AxisSpec axisCentFT0C{nCentBins, 0, 101, "FT0C (%)"}; const AxisSpec axisVtxZ{80, -20., 20., "V_{Z} (cm)"}; const AxisSpec axisDCAz{dcaZBins, "DCA_{Z} (cm)"}; @@ -137,14 +140,14 @@ struct meanPtFlucId { const AxisSpec axisChi2{40, 0., 40., "Chi2"}; const AxisSpec axisCrossedTPC{300, 0, 300, "Crossed TPC"}; const AxisSpec axisM2{100, 0., 1.4, "#it{m}^{2} (GeV/#it{c}^{2})^{2}"}; - const AxisSpec axisMass{3000, 0., 0.3, "M_{inv} (GeV/#it{c}^2)"}; - - HistogramConfigSpec QnHist({HistType::kTHnSparseD, {axisMultTPC, axisQn, axisMultFT0C}}); - HistogramConfigSpec PartHist({HistType::kTHnSparseD, {axisMultTPC, axisPart, axisMultFT0C}}); - HistogramConfigSpec DenoHist({HistType::kTHnSparseD, {axisMultTPC, axisDeno, axisMultFT0C}}); - HistogramConfigSpec QnMCHist({HistType::kTHnSparseD, {axisMultTPC, axisQn, axisMultFT0CMC}}); - HistogramConfigSpec PartMCHist({HistType::kTHnSparseD, {axisMultTPC, axisPart, axisMultFT0CMC}}); - HistogramConfigSpec DenoMCHist({HistType::kTHnSparseD, {axisMultTPC, axisDeno, axisMultFT0CMC}}); + const AxisSpec axisMass{1000, 0., 0.1, "M_{inv} (GeV/#it{c}^2)"}; + + HistogramConfigSpec QnHist({HistType::kTHnSparseD, {axisMultTPC, axisQn, axisMultFT0M}}); + HistogramConfigSpec PartHist({HistType::kTHnSparseD, {axisMultTPC, axisPart, axisMultFT0M}}); + HistogramConfigSpec DenoHist({HistType::kTHnSparseD, {axisMultTPC, axisDeno, axisMultFT0M}}); + HistogramConfigSpec QnMCHist({HistType::kTHnSparseD, {axisMultTPC, axisQn, axisMultFT0MMC}}); + HistogramConfigSpec PartMCHist({HistType::kTHnSparseD, {axisMultTPC, axisPart, axisMultFT0MMC}}); + HistogramConfigSpec DenoMCHist({HistType::kTHnSparseD, {axisMultTPC, axisDeno, axisMultFT0MMC}}); HistogramConfigSpec TOFnSigmaHist({HistType::kTH2D, {axisP, axisTOFNsigma}}); HistogramConfigSpec TOFSignalHist({HistType::kTH2D, {axisP, axisTOFSignal}}); HistogramConfigSpec TPCnSigmaHist({HistType::kTH2D, {axisP, axisTPCNsigma}}); @@ -176,10 +179,12 @@ struct meanPtFlucId { hist.add("QA/before/h2_DcaZ", "DCA_{Z}", kTH2D, {{axisPt}, {axisDCAz}}); hist.add("QA/before/h2_DcaXY", "DCA_{XY}", kTH2D, {{axisPt}, {axisDCAxy}}); hist.add("QA/before/h_NTPC", "N_{TPC}", kTH1D, {axisMultTPC}); - hist.add("QA/before/h_NFT0C", "FT0C Multiplicity", kTH1D, {axisMultFT0C}); + hist.add("QA/before/h_NFT0M", "FT0M Multiplicity", kTH1D, {axisMultFT0M}); + hist.add("QA/before/h_NFT0C", "FT0C Multiplicity", kTH1D, {axisMultFT0M}); hist.add("QA/before/h_Cent", "FT0C (%)", kTH1D, {axisCentFT0C}); hist.add("QA/before/h2_NTPC_Cent", "N_{TPC} vs FT0C(%)", kTH2D, {{axisCentFT0C}, {axisMultTPC}}); - hist.add("QA/before/h2_NTPC_NFT0C", "N_{TPC} vs N_{FT0C}", kTH2D, {{axisMultFT0C}, {axisMultTPC}}); + hist.add("QA/before/h2_NTPC_NFT0M", "N_{TPC} vs N_{FT0M}", kTH2D, {{axisMultFT0M}, {axisMultTPC}}); + hist.add("QA/before/h2_NTPC_NFT0C", "N_{TPC} vs N_{FT0C}", kTH2D, {{axisMultFT0M}, {axisMultTPC}}); hist.add("QA/before/h2_TPCSignal", "TPC Signal", TPCSignalHist); hist.add("QA/before/h2_TOFSignal", "TOF Signal", TOFSignalHist); @@ -191,18 +196,24 @@ struct meanPtFlucId { hist.addClone("QA/before/", "QA/after/"); - hist.add("QA/after/p_NTPC_NFT0C", "N_{TPC} vs N_{FT0C} (Profile)", kTProfile, {axisMultFT0C}); + hist.add("QA/after/p_NTPC_NFT0M", "N_{TPC} vs N_{FT0M} (Profile)", kTProfile, {axisMultFT0M}); + hist.add("QA/after/p_NTPC_NFT0C", "N_{TPC} vs N_{FT0C} (Profile)", kTProfile, {axisMultFT0M}); hist.add("QA/after/p_NTPC_Cent", "N_{TPC} vs FT0C(%) (Profile)", kTProfile, {axisCentFT0C}); hist.add("QA/after/h2_NTPC_Nch", "N_{ch} vs N_{TPC}", kTH2D, {{axisMultTPC}, {axisMult}}); hist.add("QA/after/h_invMass_gamma", "Inv Mass of #gamma", kTH1D, {axisMass}); hist.add("QA/after/counts_evSelCuts", "Event selection cuts", kTH1D, {axisEvents}); + hist.add("QA/after/h_vtxZ_sim", "Simulated Vertex Z", kTH1D, {axisVtxZ}); + hist.add("QA/after/h_NSim", "Truth Multiplicity TPC", kTH1D, {axisMultTPC}); + hist.add("QA/after/h2_NTPC_NSim", "Reco vs Truth Multiplicty TPC", kTH2D, {{axisMultTPC}, {axisMultTPC}}); + hist.add("QA/after/h2_NchSim_NSim", "Truth Multiplicty Nch vs NTPC", kTH2D, {{axisMultTPC}, {axisMultTPC}}); + hist.add("QA/after/h2_NFT0C_NFT0CSim", "Reco vs Truth Multplicity FT0C", kTH2D, {{axisMultFT0MMC}, {axisMultFT0M}}); hist.add("QA/Pion/h_Pt", "p_{T} ", kTH1D, {axisPt}); - hist.add("QA/Pion/h_allPt", "p_{T} ", kTH1D, {axisPt}); hist.add("QA/Pion/h_PtPos", "p_{T} (positive) ", kTH1D, {axisPt}); - hist.add("QA/Pion/h_allPtPos", "p_{T} (positive) ", kTH1D, {axisPt}); - hist.add("QA/Pion/h_allPtNeg", "p_{T} (negative) ", kTH1D, {axisPt}); hist.add("QA/Pion/h_PtNeg", "p_{T} (negative) ", kTH1D, {axisPt}); + hist.add("QA/Pion/h_PtTruth", "p_{T} ", kTH1D, {axisPt}); + hist.add("QA/Pion/h_PtPosTruth", "p_{T} (positive) ", kTH1D, {axisPt}); + hist.add("QA/Pion/h_PtNegTruth", "p_{T} (negative) ", kTH1D, {axisPt}); hist.add("QA/Pion/h_rap", "y ", kTH1D, {axisY}); hist.add("QA/Pion/h_Eta", "Pseudorapidity ", kTH1D, {axisEta}); hist.add("QA/Pion/h_Phi", "Azimuthal Distribution ", kTH1D, {axisPhi}); @@ -252,9 +263,9 @@ struct meanPtFlucId { hist.add("Analysis/Charged/p_CheckNCH", " 1/denominator vs N_{TPC} ", kTProfile, {axisMultTPC}); hist.add("Analysis/Charged/h_CheckNCH", " 1/denominator vs N_{TPC} ", DenoHist); hist.add("Analysis/Charged/h_Q1_var", "Q1 vs N_{TPC}", QnHist); - hist.add("Analysis/Charged/h_N_var", "N vs N_{TPC}", kTHnSparseD, {axisMultTPC, axisMult, axisMultFT0C}); - hist.add("Analysis/Charged/h_twopart_nume_Mult_var", "twopart numerator", kTHnSparseD, {axisMultTPC, axisTpN, axisMultFT0C}); - hist.add("Analysis/Charged/h_twopart_deno_Mult_var", "twopart denominator", kTHnSparseD, {axisMultTPC, axisTpD, axisMultFT0C}); + hist.add("Analysis/Charged/h_N_var", "N vs N_{TPC}", kTHnSparseD, {axisMultTPC, axisMult, axisMultFT0M}); + hist.add("Analysis/Charged/h_twopart_nume_Mult_var", "twopart numerator", kTHnSparseD, {axisMultTPC, axisTpN, axisMultFT0M}); + hist.add("Analysis/Charged/h_twopart_deno_Mult_var", "twopart denominator", kTHnSparseD, {axisMultTPC, axisTpD, axisMultFT0M}); hist.add("Analysis/Charged/h_mean_pT_Mult_var", " vs N_{TPC} ", PartHist); hist.add("Analysis/Charged/h_mean_pT_Mult_skew", " vs N_{TPC} ", PartHist); hist.add("Analysis/Charged/h_mean_pT_Mult_kurto", " vs N_{TPC} ", PartHist); @@ -273,11 +284,11 @@ struct meanPtFlucId { hist.add("Gen/Counts", "Counts", kTH1D, {axisEvents}); hist.add("Gen/vtxZ", "Vertex Z ", kTH1D, {axisVtxZ}); hist.add("Gen/NTPC", "Mid rapidity Multiplicity", kTH1D, {axisMultTPC}); - hist.add("Gen/NFT0C", "Forward Multiplicity", kTH1D, {axisMultFT0CMC}); - hist.add("Gen/h2_NTPC_NFT0C", "N_{TPC} vs N_{FT0C}", kTH2D, {{axisMultFT0CMC}, {axisMultTPC}}); - hist.add("Gen/Charged/h_Pt", "p_{T} ", kTH1D, {axisPt}); - hist.add("Gen/Charged/h_PtPos", "p_{T} (Positive)", kTH1D, {axisPt}); - hist.add("Gen/Charged/h_PtNeg", "p_{T} (negative)", kTH1D, {axisPt}); + hist.add("Gen/NFT0C", "Forward Multiplicity", kTH1D, {axisMultFT0MMC}); + hist.add("Gen/h2_NTPC_NFT0C", "N_{TPC} vs N_{FT0C}", kTH2D, {{axisMultFT0MMC}, {axisMultTPC}}); + hist.add("Gen/Charged/h_PtTruth", "p_{T} ", kTH1D, {axisPt}); + hist.add("Gen/Charged/h_PtPosTruth", "p_{T} (Positive)", kTH1D, {axisPt}); + hist.add("Gen/Charged/h_PtNegTruth", "p_{T} (negative)", kTH1D, {axisPt}); hist.add("Gen/Charged/h_Mult", "Multiplicity", kTH1D, {axisMult}); hist.add("Gen/Charged/h_mean_pT", " ", kTH1D, {axisMeanPt}); @@ -287,9 +298,9 @@ struct meanPtFlucId { hist.add("Gen/Charged/h_Q3", "Q3", QnMCHist); hist.add("Gen/Charged/h_Q4", "Q4", QnMCHist); hist.add("Gen/Charged/h_Q1_var", "Q1 vs N_{TPC}", QnMCHist); - hist.add("Gen/Charged/h_N_var", "N vs N_{TPC}", kTHnSparseD, {axisMultTPC, axisMult, axisMultFT0CMC}); - hist.add("Gen/Charged/h_twopart_nume_Mult_var", "twopart numerator", kTHnSparseD, {axisMultTPC, axisTpN, axisMultFT0CMC}); - hist.add("Gen/Charged/h_twopart_deno_Mult_var", "twopart denominator", kTHnSparseD, {axisMultTPC, axisTpD, axisMultFT0CMC}); + hist.add("Gen/Charged/h_N_var", "N vs N_{TPC}", kTHnSparseD, {axisMultTPC, axisMult, axisMultFT0MMC}); + hist.add("Gen/Charged/h_twopart_nume_Mult_var", "twopart numerator", kTHnSparseD, {axisMultTPC, axisTpN, axisMultFT0MMC}); + hist.add("Gen/Charged/h_twopart_deno_Mult_var", "twopart denominator", kTHnSparseD, {axisMultTPC, axisTpD, axisMultFT0MMC}); hist.add("Gen/Charged/p_mean_pT_Mult_var", " ", kTProfile, {axisMultTPC}); hist.add("Gen/Charged/p_CheckNCH", " 1/denominator vs N_{TPC} ", kTProfile, {axisMultTPC}); @@ -358,6 +369,10 @@ struct meanPtFlucId { return false; hist.fill(HIST("QA/after/counts_evSelCuts"), 4); + if (cfgEvSel3 && !col.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) + return false; + hist.fill(HIST("QA/after/counts_evSelCuts"), 5); + return true; } @@ -550,13 +565,16 @@ struct meanPtFlucId { hist.fill(HIST("QA/before/h_Counts"), 2); int NTPC = col.multNTracksHasTPC(); + int N_FT0M = col.multFT0M(); int N_FT0C = col.multFT0C(); double cent_FT0C = col.centFT0C(); - if (NTPC != 0 && N_FT0C != 0) { + if (NTPC != 0 && N_FT0M != 0) { hist.fill(HIST("QA/before/h_NTPC"), NTPC); hist.fill(HIST("QA/before/h_Cent"), cent_FT0C); - hist.fill(HIST("QA/before/h_NFT0C"), N_FT0C); + hist.fill(HIST("QA/before/h_NFT0M"), N_FT0M); + hist.fill(HIST("QA/before/h_NFT0C"), N_FT0M); + hist.fill(HIST("QA/before/h2_NTPC_NFT0M"), N_FT0M, NTPC); hist.fill(HIST("QA/before/h2_NTPC_NFT0C"), N_FT0C, NTPC); hist.fill(HIST("QA/before/h2_NTPC_Cent"), cent_FT0C, NTPC); } @@ -567,18 +585,22 @@ struct meanPtFlucId { void FillAfterQAHistos(T const& col) { int NTPC = col.multNTracksHasTPC(); + int N_FT0M = col.multFT0M(); int N_FT0C = col.multFT0C(); double cent_FT0C = col.centFT0C(); hist.fill(HIST("QA/after/h_VtxZ"), col.posZ()); hist.fill(HIST("QA/after/h_Counts"), 2); - if (NTPC != 0 && N_FT0C != 0) { + if (NTPC != 0 && N_FT0M != 0) { hist.fill(HIST("QA/after/h_NTPC"), NTPC); hist.fill(HIST("QA/after/h_Cent"), cent_FT0C); + hist.fill(HIST("QA/after/h_NFT0M"), N_FT0M); hist.fill(HIST("QA/after/h_NFT0C"), N_FT0C); + hist.fill(HIST("QA/after/h2_NTPC_NFT0M"), N_FT0M, NTPC); hist.fill(HIST("QA/after/h2_NTPC_NFT0C"), N_FT0C, NTPC); hist.fill(HIST("QA/after/h2_NTPC_Cent"), cent_FT0C, NTPC); hist.fill(HIST("QA/after/p_NTPC_Cent"), cent_FT0C, NTPC); + hist.fill(HIST("QA/after/p_NTPC_NFT0M"), N_FT0M, NTPC); hist.fill(HIST("QA/after/p_NTPC_NFT0C"), N_FT0C, NTPC); } } @@ -638,10 +660,28 @@ struct meanPtFlucId { hist.fill(HIST("QA/Kaon/innerParam/before/h2_TpcTofNsigma"), track.tpcNSigmaKa(), track.tofNSigmaKa()); } + // Moments Calculation: + void moments(double pt, double& Q1, double& Q2, double& Q3, double& Q4) + { + Q1 += pt; + Q2 += pt * pt; + Q3 += pt * pt * pt; + Q4 += pt * pt * pt * pt; + } + // Fill after PID cut QA hist: template - void FillIdParticleQAHistos(T const& track, double rap, double nSigmaTPC, double nSigmaTOF) + void FillIdParticleQAHistos(T const& track, double rap, double nSigmaTPC, double nSigmaTOF, int& N, double& Q1, double& Q2, double& Q3, double& Q4) { + N++; + moments(track.pt(), Q1, Q2, Q3, Q4); + + hist.fill(HIST(dire[mode]) + HIST("h_Pt"), track.pt()); + if (track.sign() > 0) + hist.fill(HIST(dire[mode]) + HIST("h_PtPos"), track.pt()); + + if (track.sign() < 0) + hist.fill(HIST(dire[mode]) + HIST("h_PtNeg"), track.pt()); hist.fill(HIST(dire[mode]) + HIST("h_Eta"), track.eta()); hist.fill(HIST(dire[mode]) + HIST("h_Phi"), track.phi()); @@ -679,76 +719,65 @@ struct meanPtFlucId { hist.fill(HIST("QA/after/innerParam/h2_pvsm2"), track.mass() * track.mass(), track.tpcInnerParam()); } - template - void FillMCPIDHist(T const& track, int PID, int pdgCodePos, int pdgCodeNeg, int& N, double& Q1, double& Q2, double& Q3, double& Q4) + template + void FillPtMCHist(double pt, int PID, int pdgCodePos, int pdgCodeNeg) { - N++; - double pt = track.pt(); - moments(pt, Q1, Q2, Q3, Q4); - hist.fill(HIST(dire[mode]) + HIST("h_Pt"), track.pt()); + hist.fill(HIST(dire[mode]) + HIST("h_PtTruth"), pt); if (PID == pdgCodePos) { - hist.fill(HIST(dire[mode]) + HIST("h_PtPos"), track.pt()); + hist.fill(HIST(dire[mode]) + HIST("h_PtPosTruth"), pt); } if (PID == pdgCodeNeg) { - hist.fill(HIST(dire[mode]) + HIST("h_PtNeg"), track.pt()); + hist.fill(HIST(dire[mode]) + HIST("h_PtNegTruth"), pt); } } - // Moments Calculation: - void moments(double pt, double& Q1, double& Q2, double& Q3, double& Q4) - { - Q1 += pt; - Q2 += pt * pt; - Q3 += pt * pt * pt; - Q4 += pt * pt * pt * pt; - } - template - void FillAnalysisHistos(int NTPC, int N_FT0C, int N, double Q1, double Q2, double Q3, double Q4) + void FillAnalysisHistos(int NTPC, int N_FT0M, int N, double Q1, double Q2, double Q3, double Q4) { + if (N == 0 /* || Q1 == 0 || Q2 == 0 || Q3 == 0 || Q4 == 0 */) { + return; + } double twopart1 = ((Q1 * Q1) - Q2); double threepart1 = ((Q1 * Q1 * Q1) - (3 * Q2 * Q1) + 2 * Q3); double fourpart1 = ((Q1 * Q1 * Q1 * Q1) - (6 * Q2 * Q1 * Q1) + (3 * Q2 * Q2) + (8 * Q3 * Q1) - 6 * Q4); hist.fill(HIST(dire[mode]) + HIST("h_Mult"), N); - hist.fill(HIST(dire[mode]) + HIST("h_Q1"), NTPC, Q1, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_Q2"), NTPC, Q2, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_Q3"), NTPC, Q3, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_Q4"), NTPC, Q4, N_FT0C); + hist.fill(HIST(dire[mode]) + HIST("h_Q1"), NTPC, Q1, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_Q2"), NTPC, Q2, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_Q3"), NTPC, Q3, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_Q4"), NTPC, Q4, N_FT0M); - if (N > 0) { + if (N > 1) { double mean_pT = Q1 / static_cast(N); + double N_pair = (static_cast(N) * (static_cast(N) - 1)); + double twopart = twopart1 / N_pair; + double checkN_deno_var = (1 / std::sqrt(1 - (1 / static_cast(N)))); hist.fill(HIST(dire[mode]) + HIST("h_mean_pT"), mean_pT); hist.fill(HIST(dire[mode]) + HIST("p_mean_pT_Mult_var"), NTPC, mean_pT); - if (N > 1) { - double N_pair = (static_cast(N) * (static_cast(N) - 1)); - double twopart = twopart1 / N_pair; - double checkN_deno_var = (1 / std::sqrt(1 - (1 / static_cast(N)))); - hist.fill(HIST(dire[mode]) + HIST("h_Q1_var"), NTPC, Q1, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_N_var"), NTPC, N, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_nume_Mult_var"), NTPC, twopart1, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_deno_Mult_var"), NTPC, N_pair, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_mean_pT_Mult_var"), NTPC, mean_pT, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_Mult_var"), NTPC, twopart, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("p_CheckNCH"), NTPC, checkN_deno_var); - hist.fill(HIST(dire[mode]) + HIST("h_CheckNCH"), NTPC, checkN_deno_var, N_FT0C); - - if (N > 2) { - double N_triplet = (static_cast(N) * (static_cast(N) - 1) * (static_cast(N) - 2)); - double threepart = threepart1 / N_triplet; - hist.fill(HIST(dire[mode]) + HIST("h_mean_pT_Mult_skew"), NTPC, mean_pT, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_Mult_skew"), NTPC, twopart, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_threepart_Mult_skew"), NTPC, threepart, N_FT0C); - - if (N > 3) { - double N_quad = (static_cast(N) * (static_cast(N) - 1) * (static_cast(N) - 2) * (static_cast(N) - 3)); - double fourpart = fourpart1 / N_quad; - hist.fill(HIST(dire[mode]) + HIST("h_mean_pT_Mult_kurto"), NTPC, mean_pT, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_Mult_kurto"), NTPC, twopart, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_threepart_Mult_kurto"), NTPC, threepart, N_FT0C); - hist.fill(HIST(dire[mode]) + HIST("h_fourpart_Mult_kurto"), NTPC, fourpart, N_FT0C); - } + hist.fill(HIST(dire[mode]) + HIST("h_Q1_var"), NTPC, Q1, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_N_var"), NTPC, N, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_twopart_nume_Mult_var"), NTPC, twopart1, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_twopart_deno_Mult_var"), NTPC, N_pair, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_mean_pT_Mult_var"), NTPC, mean_pT, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_twopart_Mult_var"), NTPC, twopart, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("p_CheckNCH"), NTPC, checkN_deno_var); + hist.fill(HIST(dire[mode]) + HIST("h_CheckNCH"), NTPC, checkN_deno_var, N_FT0M); + + if (N > 2) { + double N_triplet = (static_cast(N) * (static_cast(N) - 1) * (static_cast(N) - 2)); + double threepart = threepart1 / N_triplet; + hist.fill(HIST(dire[mode]) + HIST("h_mean_pT_Mult_skew"), NTPC, mean_pT, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_twopart_Mult_skew"), NTPC, twopart, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_threepart_Mult_skew"), NTPC, threepart, N_FT0M); + + if (N > 3) { + double N_quad = (static_cast(N) * (static_cast(N) - 1) * (static_cast(N) - 2) * (static_cast(N) - 3)); + double fourpart = fourpart1 / N_quad; + hist.fill(HIST(dire[mode]) + HIST("h_mean_pT_Mult_kurto"), NTPC, mean_pT, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_twopart_Mult_kurto"), NTPC, twopart, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_threepart_Mult_kurto"), NTPC, threepart, N_FT0M); + hist.fill(HIST(dire[mode]) + HIST("h_fourpart_Mult_kurto"), NTPC, fourpart, N_FT0M); } } } @@ -757,13 +786,20 @@ struct meanPtFlucId { template void FillHistos(T const& col, U const& tracks) { + int Nch = 0, N_TPC = 0, N_FT0M = 0; int N_Pi = 0, N_Ka = 0, N_Pr = 0; - int Nch = 0, NTPC = 0, N_FT0C = 0; double pt_ch = 0, Q1_ch = 0, Q2_ch = 0, Q3_ch = 0, Q4_ch = 0; double pt_Pi = 0, Q1_Pi = 0, Q2_Pi = 0, Q3_Pi = 0, Q4_Pi = 0; double pt_Pr = 0, Q1_Pr = 0, Q2_Pr = 0, Q3_Pr = 0, Q4_Pr = 0; double pt_Ka = 0, Q1_Ka = 0, Q2_Ka = 0, Q3_Ka = 0, Q4_Ka = 0; + int Nch_sim = 0, N_sim = 0, NFT0C_sim = 0; + int N_Pi_sim = 0, N_Ka_sim = 0, N_Pr_sim = 0; + double pt_ch_sim = 0, Q1_ch_sim = 0, Q2_ch_sim = 0, Q3_ch_sim = 0, Q4_ch_sim = 0; + double pt_Pi_sim = 0, Q1_Pi_sim = 0, Q2_Pi_sim = 0, Q3_Pi_sim = 0, Q4_Pi_sim = 0; + double pt_Pr_sim = 0, Q1_Pr_sim = 0, Q2_Pr_sim = 0, Q3_Pr_sim = 0, Q4_Pr_sim = 0; + double pt_Ka_sim = 0, Q1_Ka_sim = 0, Q2_Ka_sim = 0, Q3_Ka_sim = 0, Q4_Ka_sim = 0; + array p1, p2; double invMassGamma = 0.0; @@ -784,23 +820,23 @@ struct meanPtFlucId { hist.fill(HIST("QA/after/h_invMass_gamma"), invMassGamma); } - for (auto& track : tracks) { - if (!selTrack(track)) { - continue; - } + if constexpr (DataFlag) { + for (auto& track : tracks) { + if (!selTrack(track)) { + continue; + } + + double nSigmaTPCPi = track.tpcNSigmaPi(); + double nSigmaTPCKa = track.tpcNSigmaKa(); + double nSigmaTPCPr = track.tpcNSigmaPr(); + double nSigmaTOFPi = track.tofNSigmaPi(); + double nSigmaTOFKa = track.tofNSigmaKa(); + double nSigmaTOFPr = track.tofNSigmaPr(); + double rapPi = track.rapidity(MassPiPlus); + double rapKa = track.rapidity(MassKPlus); + double rapPr = track.rapidity(MassProton); + double innerParam = track.tpcInnerParam(); - double nSigmaTPCPi = track.tpcNSigmaPi(); - double nSigmaTPCKa = track.tpcNSigmaKa(); - double nSigmaTPCPr = track.tpcNSigmaPr(); - double nSigmaTOFPi = track.tofNSigmaPi(); - double nSigmaTOFKa = track.tofNSigmaKa(); - double nSigmaTOFPr = track.tofNSigmaPr(); - double rapPi = track.rapidity(MassPiPlus); - double rapKa = track.rapidity(MassKPlus); - double rapPr = track.rapidity(MassProton); - double innerParam = track.tpcInnerParam(); - - if constexpr (DataFlag) { if (std::fabs(track.eta()) < 0.8) { Nch++; pt_ch = track.pt(); @@ -820,183 +856,264 @@ struct meanPtFlucId { if (cfgSelOR == true && cfgSelAND == false) { if (selLowPi(track, innerParam) == cfgSelLow || selHighPi(track) == cfgSelHigh) { - N_Pi++; - pt_Pi = track.pt(); - hist.fill(HIST("QA/Pion/h_Pt"), track.pt()); - moments(pt_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); - FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi); + FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); } } else if (cfgSelOR == false && cfgSelAND == true) { if (selLowPi(track, innerParam) == cfgSelLow && selHighPi(track) == cfgSelHigh) { - N_Pi++; - pt_Pi = track.pt(); - hist.fill(HIST("QA/Pion/h_Pt"), track.pt()); - moments(pt_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); - FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi); + FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); } } if (cfgSelOR == true && cfgSelAND == false) { if (selLowKa(track, innerParam) == cfgSelLow || selHighKa(track) == cfgSelHigh) { - N_Ka++; - pt_Ka = track.pt(); - hist.fill(HIST("QA/Kaon/h_Pt"), track.pt()); - moments(pt_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa); + FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); } } else if (cfgSelOR == false && cfgSelAND == true) { if (selLowKa(track, innerParam) == cfgSelLow && selHighKa(track) == cfgSelHigh) { - N_Ka++; - pt_Ka = track.pt(); - hist.fill(HIST("QA/Kaon/h_Pt"), track.pt()); - moments(pt_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa); + FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); } } if (cfgSelOR == true && cfgSelAND == false) { - if (selLowPr(track, innerParam) == cfgSelLow || selHighPr(track) == cfgSelHigh) { - N_Pr++; - pt_Pr = track.pt(); - hist.fill(HIST("QA/Proton/h_Pt"), track.pt()); - moments(pt_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); - FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr); + if (selLowPr(track, innerParam) == cfgSelLow && selHighPr(track) == cfgSelHigh) { + FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); } } else if (cfgSelOR == false && cfgSelAND == true) { if (selLowPr(track, innerParam) == cfgSelLow && selHighPr(track) == cfgSelHigh) { - N_Pr++; - pt_Pr = track.pt(); - hist.fill(HIST("QA/Proton/h_Pt"), track.pt()); - moments(pt_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); - FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr); + FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); } } + } + } else if constexpr (RecoFlag) { + if (!col.has_mcCollision()) { + LOGF(warning, "No MC collision for this collision, skip..."); + return; + } - } else if constexpr (RecoFlag) { - if (track.has_mcParticle() && track.mcParticle().isPhysicalPrimary()) { - if (std::fabs(track.eta()) < 0.8) { - Nch++; - pt_ch = track.pt(); - moments(pt_ch, Q1_ch, Q2_ch, Q3_ch, Q4_ch); - FillChargedQAHistos(track); - } - FillBeforePIDQAHistos(track); + for (auto& track : tracks) { + if (!track.has_mcParticle()) { + LOGF(warning, "No MC Particle for this track, skip..."); + continue; + } + auto mcPart = track.mcParticle(); + int PID = mcPart.pdgCode(); + if (!mcPart.isPhysicalPrimary()) { + continue; + } - if (rejectTracks(track)) { - return; - } + //___________________________________Truth Level____________________________________________________// + auto charge = 0.; + auto* pd = pdg->GetParticle(PID); + if (pd != nullptr) { + charge = pd->Charge(); + } + if (std::fabs(charge) < 1e-3) { + continue; + } + if (std::abs(mcPart.eta()) < 0.8) { + N_sim++; + } + if (-3.3 < mcPart.eta() && mcPart.eta() < -2.1) { + NFT0C_sim++; + } - if (cfgInvMass == true && invMassGamma < cfgGammaCut) { + if (mcPart.pt() > cfgCutPtMin && mcPart.pt() < cfgCutPtMax) { + if (std::abs(mcPart.y()) > cfgCutRap) { continue; } - int PID = track.mcParticle().pdgCode(); - - if (cfgSelOR == true && cfgSelAND == false) { - if (selLowPi(track, innerParam) == cfgSelLow || selHighPi(track) == cfgSelHigh) { - hist.fill(HIST("QA/Pion/h_allPt"), track.pt()); - if (track.sign() > 0) - hist.fill(HIST("QA/Pion/h_allPtPos"), track.pt()); - - if (track.sign() < 0) - hist.fill(HIST("QA/Pion/h_allPtNeg"), track.pt()); - - if (std::abs(PID) == kPiPlus) { - FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi); - FillMCPIDHist(track, PID, kPiPlus, kPiMinus, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); + Nch_sim++; + pt_ch_sim = mcPart.pt(); + moments(pt_ch_sim, Q1_ch_sim, Q2_ch_sim, Q3_ch_sim, Q4_ch_sim); + hist.fill(HIST("Gen/Charged/h_PtTruth"), mcPart.pt()); + + if (std::abs(PID) == kPiPlus && mcPart.pt() >= cfgCutPiPtMin) { + if (cfgSelOR == true && cfgSelAND == false) { + if (mcPart.p() <= cfgCutPiThrsldP || mcPart.p() > cfgCutPiThrsldP) { + N_Pi_sim++; + pt_Pi_sim = mcPart.pt(); + moments(pt_Pi_sim, Q1_Pi_sim, Q2_Pi_sim, Q3_Pi_sim, Q4_Pi_sim); + FillPtMCHist(pt_Pi_sim, PID, kPiPlus, kPiMinus); + } + } else if (cfgSelOR == false && cfgSelAND == true) { + if ((cfgSelLow == true && mcPart.p() <= cfgCutPiThrsldP) && (cfgSelHigh == true && mcPart.p() > cfgCutPiThrsldP)) { + N_Pi_sim++; + pt_Pi_sim = mcPart.pt(); + moments(pt_Pi_sim, Q1_Pi_sim, Q2_Pi_sim, Q3_Pi_sim, Q4_Pi_sim); + FillPtMCHist(pt_Pi_sim, PID, kPiPlus, kPiMinus); } } - } else if (cfgSelOR == false && cfgSelAND == true) { - if (selLowPi(track, innerParam) == cfgSelLow && selHighPi(track) == cfgSelHigh) { - hist.fill(HIST("QA/Pion/h_allPt"), track.pt()); - if (track.sign() > 0) - hist.fill(HIST("QA/Pion/h_allPtPos"), track.pt()); - - if (track.sign() < 0) - hist.fill(HIST("QA/Pion/h_allPtNeg"), track.pt()); + } - if (std::abs(PID) == kPiPlus) { + if (std::abs(PID) == kKPlus && mcPart.pt() >= cfgCutKaPtMin) { + if (cfgSelOR == true && cfgSelAND == false) { + if ((cfgSelLow == true && mcPart.p() <= cfgCutPiThrsldP) || (cfgSelHigh == true && mcPart.p() > cfgCutPiThrsldP)) { + N_Ka_sim++; + pt_Ka_sim = mcPart.pt(); + moments(pt_Ka_sim, Q1_Ka_sim, Q2_Ka_sim, Q3_Ka_sim, Q4_Ka_sim); + FillPtMCHist(pt_Ka_sim, PID, kKPlus, kKMinus); + } + } else if (cfgSelOR == false && cfgSelAND == true) { + if ((cfgSelLow == true && mcPart.p() <= cfgCutKaThrsldP) && (cfgSelHigh == true && mcPart.p() > cfgCutKaThrsldP)) { + N_Ka_sim++; + pt_Ka_sim = mcPart.pt(); + moments(pt_Ka_sim, Q1_Ka_sim, Q2_Ka_sim, Q3_Ka_sim, Q4_Ka_sim); + FillPtMCHist(pt_Ka_sim, PID, kKPlus, kKMinus); + } + } + } - FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi); - FillMCPIDHist(track, PID, kPiPlus, kPiMinus, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); + if (std::abs(PID) == kProton && mcPart.pt() >= cfgCutPrPtMin) { + if (cfgSelOR == true && cfgSelAND == false) { + if ((cfgSelLow == true && mcPart.p() <= cfgCutPrThrsldP) || (cfgSelHigh == true && mcPart.p() > cfgCutPrThrsldP)) { + N_Pr_sim++; + pt_Pr_sim = mcPart.pt(); + moments(pt_Pr_sim, Q1_Pr_sim, Q2_Pr_sim, Q3_Pr_sim, Q4_Pr_sim); + FillPtMCHist(pt_Pr_sim, PID, kProton, kProtonBar); + } + } else if (cfgSelOR == false && cfgSelAND == true) { + if ((cfgSelLow == true && mcPart.p() <= cfgCutPrThrsldP) && (cfgSelHigh == true && mcPart.p() > cfgCutPrThrsldP)) { + N_Pr_sim++; + pt_Pr_sim = mcPart.pt(); + moments(pt_Pr_sim, Q1_Pr_sim, Q2_Pr_sim, Q3_Pr_sim, Q4_Pr_sim); + FillPtMCHist(pt_Pr_sim, PID, kProton, kProtonBar); } } } + } - if (cfgSelOR == true && cfgSelAND == false) { - if (selLowKa(track, innerParam) == cfgSelLow || selHighKa(track) == cfgSelHigh) { - hist.fill(HIST("QA/Kaon/h_allPt"), track.pt()); - if (track.sign() > 0) - hist.fill(HIST("QA/Kaon/h_allPtPos"), track.pt()); + //______________________________Reconstructed Level____________________________________________________// - if (track.sign() < 0) - hist.fill(HIST("QA/Kaon/h_allPtNeg"), track.pt()); + if (!selTrack(track)) { + continue; + } - if (std::abs(PID) == kKPlus) { - FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa); - FillMCPIDHist(track, PID, kKPlus, kKMinus, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - } + double nSigmaTPCPi = track.tpcNSigmaPi(); + double nSigmaTPCKa = track.tpcNSigmaKa(); + double nSigmaTPCPr = track.tpcNSigmaPr(); + double nSigmaTOFPi = track.tofNSigmaPi(); + double nSigmaTOFKa = track.tofNSigmaKa(); + double nSigmaTOFPr = track.tofNSigmaPr(); + double rapPi = track.rapidity(MassPiPlus); + double rapKa = track.rapidity(MassKPlus); + double rapPr = track.rapidity(MassProton); + double innerParam = track.tpcInnerParam(); + + if (std::fabs(track.eta()) < 0.8) { + Nch++; + pt_ch = track.pt(); + moments(pt_ch, Q1_ch, Q2_ch, Q3_ch, Q4_ch); + FillChargedQAHistos(track); + } + FillBeforePIDQAHistos(track); + + if (rejectTracks(track)) { + return; + } + + if (cfgInvMass == true && invMassGamma < cfgGammaCut) { + continue; + } + + if (cfgSelOR == true && cfgSelAND == false) { + if (selLowPi(track, innerParam) == cfgSelLow || selHighPi(track) == cfgSelHigh) { + pt_Pi = track.pt(); + FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); + + if (std::abs(PID) == kPiPlus) { + FillPtMCHist(pt_Pi, PID, kPiPlus, kPiMinus); } - } else if (cfgSelOR == false && cfgSelAND == true) { - if (selLowKa(track, innerParam) == cfgSelLow && selHighKa(track) == cfgSelHigh) { - hist.fill(HIST("QA/Kaon/h_allPt"), track.pt()); - if (track.sign() > 0) - hist.fill(HIST("QA/Kaon/h_allPtPos"), track.pt()); - - if (track.sign() < 0) - hist.fill(HIST("QA/Kaon/h_allPtNeg"), track.pt()); - - if (std::abs(PID) == kKPlus) { - FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa); - FillMCPIDHist(track, PID, kKPlus, kKMinus, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - } + } + } else if (cfgSelOR == false && cfgSelAND == true) { + if (selLowPi(track, innerParam) == cfgSelLow && selHighPi(track) == cfgSelHigh) { + pt_Pi = track.pt(); + FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); + + if (std::abs(PID) == kPiPlus) { + FillPtMCHist(pt_Pi, PID, kPiPlus, kPiMinus); } } + } - if (cfgSelOR == true && cfgSelAND == false) { - if (selLowPr(track, innerParam) == cfgSelLow || selHighPr(track) == cfgSelHigh) { - hist.fill(HIST("QA/Proton/h_allPt"), track.pt()); - if (track.sign() > 0) - hist.fill(HIST("QA/Proton/h_allPtPos"), track.pt()); + if (cfgSelOR == true && cfgSelAND == false) { + if (selLowKa(track, innerParam) == cfgSelLow || selHighKa(track) == cfgSelHigh) { + pt_Ka = track.pt(); + FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); + if (std::abs(PID) == kKPlus) { + FillPtMCHist(pt_Ka, PID, kKPlus, kKMinus); + } + } + } else if (cfgSelOR == false && cfgSelAND == true) { + if (selLowKa(track, innerParam) == cfgSelLow && selHighKa(track) == cfgSelHigh) { + pt_Ka = track.pt(); + FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - if (track.sign() < 0) - hist.fill(HIST("QA/Proton/h_allPtNeg"), track.pt()); + if (std::abs(PID) == kKPlus) { + FillPtMCHist(pt_Ka, PID, kKPlus, kKMinus); + } + } + } - if (std::abs(PID) == kProton) { - FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr); - FillMCPIDHist(track, PID, kProton, kProtonBar, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); - } + if (cfgSelOR == true && cfgSelAND == false) { + if (selLowPr(track, innerParam) == cfgSelLow || selHighPr(track) == cfgSelHigh) { + pt_Pr = track.pt(); + FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); + + if (std::abs(PID) == kProton) { + FillPtMCHist(pt_Pr, PID, kProton, kProtonBar); } - } else if (cfgSelOR == false && cfgSelAND == true) { - if (selLowPr(track, innerParam) == cfgSelLow && selHighPr(track) == cfgSelHigh) { - hist.fill(HIST("QA/Proton/h_allPt"), track.pt()); - if (track.sign() > 0) - hist.fill(HIST("QA/Proton/h_allPtPos"), track.pt()); - - if (track.sign() < 0) - hist.fill(HIST("QA/Proton/h_allPtNeg"), track.pt()); - - if (std::abs(PID) == kProton) { - FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr); - FillMCPIDHist(track, PID, kProton, kProtonBar, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); - } + } + } else if (cfgSelOR == false && cfgSelAND == true) { + if (selLowPr(track, innerParam) == cfgSelLow && selHighPr(track) == cfgSelHigh) { + pt_Pr = track.pt(); + FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); + + if (std::abs(PID) == kProton) { + FillPtMCHist(pt_Pr, PID, kProton, kProtonBar); } } } } + hist.fill(HIST("QA/after/h_vtxZ_sim"), col.mcCollision().posZ()); } - N_FT0C = col.multFT0C(); - NTPC = col.multNTracksHasTPC(); + N_TPC = col.multNTracksHasTPC(); + N_FT0M = col.multFT0M(); + + if (cfgMCTruth) { + if (N_sim != 0) + hist.fill(HIST("QA/after/h_NSim"), N_sim); + + if (N_sim != 0 && Nch != 0) + hist.fill(HIST("QA/after/h2_NchSim_NSim"), N_sim, Nch_sim); + + if (N_sim != 0 && N_TPC != 0) + hist.fill(HIST("QA/after/h2_NTPC_NSim"), N_sim, N_TPC); + + int NFT0C = col.multFT0C(); + if (NFT0C != 0 && NFT0C_sim != 0) + hist.fill(HIST("QA/after/h2_NFT0C_NFT0CSim"), NFT0C_sim, NFT0C); + + N_TPC = N_sim; + + hist.fill(HIST("Gen/NTPC"), N_TPC); + hist.fill(HIST("Gen/NFT0C"), NFT0C_sim); + hist.fill(HIST("Gen/h2_NTPC_NFT0C"), NFT0C_sim, N_TPC); + + FillAnalysisHistos(N_TPC, N_FT0M, Nch_sim, Q1_ch_sim, Q2_ch_sim, Q3_ch_sim, Q4_ch_sim); + FillAnalysisHistos(N_TPC, N_FT0M, N_Pi_sim, Q1_Pi_sim, Q2_Pi_sim, Q3_Pi_sim, Q4_Pi_sim); + FillAnalysisHistos(N_TPC, N_FT0M, N_Ka_sim, Q1_Ka_sim, Q2_Ka_sim, Q3_Ka_sim, Q4_Ka_sim); + FillAnalysisHistos(N_TPC, N_FT0M, N_Pr_sim, Q1_Pr_sim, Q2_Pr_sim, Q3_Pr_sim, Q4_Pr_sim); + } FillAfterQAHistos(col); - if (NTPC != 0 && Nch != 0) - hist.fill(HIST("QA/after/h2_NTPC_Nch"), NTPC, Nch); + if (N_TPC != 0 && Nch != 0) + hist.fill(HIST("QA/after/h2_NTPC_Nch"), N_TPC, Nch); - FillAnalysisHistos(NTPC, N_FT0C, Nch, Q1_ch, Q2_ch, Q3_ch, Q4_ch); - FillAnalysisHistos(NTPC, N_FT0C, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); - FillAnalysisHistos(NTPC, N_FT0C, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - FillAnalysisHistos(NTPC, N_FT0C, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); + FillAnalysisHistos(N_TPC, N_FT0M, Nch, Q1_ch, Q2_ch, Q3_ch, Q4_ch); + FillAnalysisHistos(N_TPC, N_FT0M, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); + FillAnalysisHistos(N_TPC, N_FT0M, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); + FillAnalysisHistos(N_TPC, N_FT0M, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); } void process_Run3(MyCollisions::iterator const& col, MyAllTracks const& tracks) @@ -1009,109 +1126,19 @@ struct meanPtFlucId { FillHistos(col, tracks); } } - PROCESS_SWITCH(meanPtFlucId, process_Run3, "Process for Run3", true); + PROCESS_SWITCH(meanPtFlucId, process_Run3, "Process for Run3", false); - void process_MCRecoRun3(MyMCCollisions::iterator const& col, aod::McCollisions const&, MyMCTracks const& tracks, aod::McParticles const&) + void process_MCRecoSimRun3(MyMCCollisions::iterator const& col, aod::McCollisions const&, MyMCTracks const& tracks, aod::McParticles const&) { // Before Collision and Track Cuts: FillBeforeQAHistos(col, tracks); // After Collision and Track Cuts: if (selRun3Col(col)) { - if (!col.has_mcCollision()) { - return; - } FillHistos(col, tracks); } } - PROCESS_SWITCH(meanPtFlucId, process_MCRecoRun3, "process MC Reconstructed Run-3", false); - - void process_MCGen(soa::Join::iterator const& mccol, aod::McParticles const& McParticles) - { - int N_Pi = 0, N_Ka = 0, N_Pr = 0; - int Nch = 0, NTPC = 0, N_FT0C = 0; - double pt_ch = 0, Q1_ch = 0, Q2_ch = 0, Q3_ch = 0, Q4_ch = 0; - double Q1_Pi = 0, Q2_Pi = 0, Q3_Pi = 0, Q4_Pi = 0; - double Q1_Pr = 0, Q2_Pr = 0, Q3_Pr = 0, Q4_Pr = 0; - double Q1_Ka = 0, Q2_Ka = 0, Q3_Ka = 0, Q4_Ka = 0; - - if (std::abs(mccol.posZ()) > cfgCutPosZ) - return; - - for (auto& mcParticle : McParticles) { - if (!mcParticle.isPhysicalPrimary()) - continue; - - auto charge = 0.; - int PID = mcParticle.pdgCode(); - auto* pd = pdg->GetParticle(PID); - if (pd != nullptr) { - charge = pd->Charge(); - } - if (std::fabs(charge) < 1e-3) { - continue; - } - - if (mcParticle.pt() > cfgCutPtMin && mcParticle.pt() < cfgCutPtMax && std::abs(mcParticle.y()) < cfgCutRap) { - Nch++; - pt_ch = mcParticle.pt(); - moments(pt_ch, Q1_ch, Q2_ch, Q3_ch, Q4_ch); - hist.fill(HIST("Gen/Charged/h_Pt"), mcParticle.pt()); - - if (std::abs(PID) == kPiPlus && mcParticle.pt() >= cfgCutPiPtMin) { - if (cfgSelOR == true && cfgSelAND == false) { - if (mcParticle.p() <= cfgCutPiThrsldP || mcParticle.p() > cfgCutPiThrsldP) { - FillMCPIDHist(mcParticle, PID, kPiPlus, kPiMinus, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); - } - } else if (cfgSelOR == false && cfgSelAND == true) { - if ((cfgSelLow == true && mcParticle.p() <= cfgCutPiThrsldP) && (cfgSelHigh == true && mcParticle.p() > cfgCutPiThrsldP)) { - FillMCPIDHist(mcParticle, PID, kPiPlus, kPiMinus, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); - } - } - } - - if (std::abs(PID) == kKPlus && mcParticle.pt() >= cfgCutKaPtMin) { - if (cfgSelOR == true && cfgSelAND == false) { - if ((cfgSelLow == true && mcParticle.p() <= cfgCutPiThrsldP) || (cfgSelHigh == true && mcParticle.p() > cfgCutPiThrsldP)) { - FillMCPIDHist(mcParticle, PID, kKPlus, kKMinus, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - } - } else if (cfgSelOR == false && cfgSelAND == true) { - if ((cfgSelLow == true && mcParticle.p() <= cfgCutKaThrsldP) && (cfgSelHigh == true && mcParticle.p() > cfgCutKaThrsldP)) { - FillMCPIDHist(mcParticle, PID, kKPlus, kKMinus, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - } - } - } - - if (std::abs(PID) == kProton && mcParticle.pt() >= cfgCutPrPtMin) { - if (cfgSelOR == true && cfgSelAND == false) { - if ((cfgSelLow == true && mcParticle.p() <= cfgCutPrThrsldP) || (cfgSelHigh == true && mcParticle.p() > cfgCutPrThrsldP)) { - FillMCPIDHist(mcParticle, PID, kProton, kProtonBar, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); - } - } else if (cfgSelOR == false && cfgSelAND == true) { - if ((cfgSelLow == true && mcParticle.p() <= cfgCutPrThrsldP) && (cfgSelHigh == true && mcParticle.p() > cfgCutPrThrsldP)) { - FillMCPIDHist(mcParticle, PID, kProton, kProtonBar, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); - } - } - } - } - } - NTPC = mccol.multMCNParticlesEta08(); - N_FT0C = mccol.multMCFT0C(); - hist.fill(HIST("Gen/Counts"), 2); - hist.fill(HIST("Gen/vtxZ"), mccol.posZ()); - if (NTPC != 0) - hist.fill(HIST("Gen/NTPC"), NTPC); - if (N_FT0C != 0) - hist.fill(HIST("Gen/NFT0C"), N_FT0C); - if (NTPC != 0 && N_FT0C != 0) - hist.fill(HIST("Gen/h2_NTPC_NFT0C"), N_FT0C, NTPC); - - FillAnalysisHistos(NTPC, N_FT0C, Nch, Q1_ch, Q2_ch, Q3_ch, Q4_ch); - FillAnalysisHistos(NTPC, N_FT0C, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); - FillAnalysisHistos(NTPC, N_FT0C, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - FillAnalysisHistos(NTPC, N_FT0C, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); - } - PROCESS_SWITCH(meanPtFlucId, process_MCGen, "process MC Generated", false); + PROCESS_SWITCH(meanPtFlucId, process_MCRecoSimRun3, "process MC Reconstructed & Truth Run-3", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 36280e2b05b3751f7bdec5ca6f276008d364ccb5 Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Tue, 26 Nov 2024 18:54:53 +0100 Subject: [PATCH 121/459] [PWGCF] adding configurable for occupancy selection range (#8657) Co-authored-by: junleekim --- PWGCF/TableProducer/filterCorrelations.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PWGCF/TableProducer/filterCorrelations.cxx b/PWGCF/TableProducer/filterCorrelations.cxx index 2eb718a5f02..5ae37e93384 100644 --- a/PWGCF/TableProducer/filterCorrelations.cxx +++ b/PWGCF/TableProducer/filterCorrelations.cxx @@ -60,6 +60,8 @@ struct FilterCF { O2_DEFINE_CONFIGURABLE(cfgCutMCEta, float, 0.8f, "Eta range for particles") O2_DEFINE_CONFIGURABLE(cfgVerbosity, int, 1, "Verbosity level (0 = major, 1 = per collision)") O2_DEFINE_CONFIGURABLE(cfgTrigger, int, 7, "Trigger choice: (0 = none, 7 = sel7, 8 = sel8, 9 = sel8 + kNoSameBunchPileup + kIsGoodZvtxFT0vsPV, 10 = sel8 before April, 2024, 11 = sel8 for MC, 12 = sel8 with low occupancy cut)") + O2_DEFINE_CONFIGURABLE(cfgMinOcc, int, 0, "minimum occupancy selection") + O2_DEFINE_CONFIGURABLE(cfgMaxOcc, int, 3000, "maximum occupancy selection") O2_DEFINE_CONFIGURABLE(cfgCollisionFlags, uint16_t, aod::collision::CollisionFlagsRun2::Run2VertexerTracks, "Request collision flags if non-zero (0 = off, 1 = Run2VertexerTracks)") O2_DEFINE_CONFIGURABLE(cfgTransientTables, bool, false, "Output transient tables for collision and track IDs") O2_DEFINE_CONFIGURABLE(cfgTrackSelection, int, 0, "Type of track selection (0 = Run 2/3 without systematics | 1 = Run 3 with systematics)") @@ -111,7 +113,7 @@ struct FilterCF { return isMultSelected && collision.selection_bit(aod::evsel::kIsTriggerTVX) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder); } else if (cfgTrigger == 12) { // relevant only for Pb-Pb with occupancy cuts and rejection of the collisions which have other events nearby int occupancy = collision.trackOccupancyInTimeRange(); - if (occupancy >= 0 && occupancy < 500) + if (occupancy >= cfgMinOcc && occupancy < cfgMaxOcc) return isMultSelected && collision.sel8() && collision.selection_bit(aod::evsel::kNoSameBunchPileup) && collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && collision.selection_bit(aod::evsel::kNoCollInTimeRangeStandard); else return false; From 646765d617fadaff88de4a6b7c0f02e8d5840db1 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Tue, 26 Nov 2024 20:38:50 +0100 Subject: [PATCH 122/459] [PWGJE] Splitdevices (#8668) --- PWGJE/JetFinders/CMakeLists.txt | 42 ++++----- PWGJE/JetFinders/Duplicates/CMakeLists.txt | 6 +- ...charged1.cxx => jetFinderDataCharged1.cxx} | 2 +- ...dcharged1.cxx => jetFinderMCDCharged1.cxx} | 2 +- ...pcharged1.cxx => jetFinderMCPCharged1.cxx} | 2 +- .../{jetfinder.cxx => jetFinder.cxx} | 2 + ...charged.cxx => jetFinderD0DataCharged.cxx} | 2 +- ...dcharged.cxx => jetFinderD0MCDCharged.cxx} | 2 +- ...pcharged.cxx => jetFinderD0MCPCharged.cxx} | 2 +- ...tacharged.cxx => jetFinderDataCharged.cxx} | 2 +- ...nderdatafull.cxx => jetFinderDataFull.cxx} | 2 +- ...taneutral.cxx => jetFinderDataNeutral.cxx} | 2 +- ...cxx => jetFinderDielectronDataCharged.cxx} | 2 +- ....cxx => jetFinderDielectronMCDCharged.cxx} | 2 +- ....cxx => jetFinderDielectronMCPCharged.cxx} | 2 +- .../{jetfinderhf.cxx => jetFinderHF.cxx} | 2 + ...charged.cxx => jetFinderLcDataCharged.cxx} | 2 +- ...dcharged.cxx => jetFinderLcMCDCharged.cxx} | 2 +- ...pcharged.cxx => jetFinderLcMCPCharged.cxx} | 2 +- ...mcdcharged.cxx => jetFinderMCDCharged.cxx} | 2 +- ...findermcdfull.cxx => jetFinderMCDFull.cxx} | 2 +- ...mcdneutral.cxx => jetFinderMCDNeutral.cxx} | 2 +- ...mcpcharged.cxx => jetFinderMCPCharged.cxx} | 2 +- ...findermcpfull.cxx => jetFinderMCPFull.cxx} | 2 +- ...mcpneutral.cxx => jetFinderMCPNeutral.cxx} | 2 +- .../{jetfinderv0.cxx => jetFinderV0.cxx} | 2 + ...charged.cxx => jetFinderV0DataCharged.cxx} | 2 +- ...dcharged.cxx => jetFinderV0MCDCharged.cxx} | 2 +- ...pcharged.cxx => jetFinderV0MCPCharged.cxx} | 2 +- PWGJE/TableProducer/CMakeLists.txt | 46 +++------ PWGJE/TableProducer/Matching/CMakeLists.txt | 91 ++++++++++++++++++ .../Matching/Duplicates/CMakeLists.txt | 29 ++++++ .../Duplicates/jetMatchingDuplicates.cxx} | 32 ------- .../jetMatchingDuplicatesChargedData1.cxx | 30 ++++++ .../jetMatchingDuplicatesChargedMCD1.cxx | 30 ++++++ .../jetMatchingDuplicatesChargedMCP1.cxx | 30 ++++++ .../jetMatchingMC.cxx} | 67 +------------ .../Matching/jetMatchingMCCharged.cxx | 31 ++++++ .../Matching/jetMatchingMCD0Charged.cxx | 31 ++++++ .../jetMatchingMCDielectronCharged.cxx | 31 ++++++ .../Matching/jetMatchingMCFull.cxx | 31 ++++++ .../Matching/jetMatchingMCLcCharged.cxx | 31 ++++++ .../Matching/jetMatchingMCNeutral.cxx | 31 ++++++ .../jetMatchingMCSub.cxx} | 35 +------ .../Matching/jetMatchingMCSubCharged.cxx | 29 ++++++ .../Matching/jetMatchingMCSubD0Charged.cxx | 29 ++++++ .../jetMatchingMCSubDielectronCharged.cxx | 29 ++++++ .../Matching/jetMatchingMCSubLcCharged.cxx | 29 ++++++ .../Matching/jetMatchingMCV0Charged.cxx | 31 ++++++ .../jetMatchingSub.cxx} | 38 +------- .../Matching/jetMatchingSubCharged.cxx | 30 ++++++ .../Matching/jetMatchingSubD0Charged.cxx | 30 ++++++ .../jetMatchingSubDielectronCharged.cxx | 30 ++++++ .../Matching/jetMatchingSubLcCharged.cxx | 30 ++++++ ...taproducer.cxx => derivedDataProducer.cxx} | 0 ...dummy.cxx => derivedDataProducerDummy.cxx} | 0 ...yd0.cxx => derivedDataProducerDummyD0.cxx} | 0 ...=> derivedDataProducerDummyDielectron.cxx} | 0 ...ylc.cxx => derivedDataProducerDummyLc.cxx} | 0 ...cer.cxx => derivedDataTriggerProducer.cxx} | 0 ...eddatawriter.cxx => derivedDataWriter.cxx} | 0 ...entweightmcd.cxx => jetEventWeightMCD.cxx} | 0 ...entweightmcp.cxx => jetEventWeightMCP.cxx} | 0 .../{jettaggerhf.cxx => jetTaggerHF.cxx} | 0 ...ettrackderived.cxx => jetTrackDerived.cxx} | 0 ...alculator.cxx => luminosityCalculator.cxx} | 0 ...ityproducer.cxx => luminosityProducer.cxx} | 0 PWGJE/Tasks/CMakeLists.txt | 94 ++++++++++++------- ...{emccellmonitor.cxx => emcCellMonitor.cxx} | 0 ...ustermonitor.cxx => emcClusterMonitor.cxx} | 0 ...electionqa.cxx => emcEventSelectionQA.cxx} | 0 .../{emctmmonitor.cxx => emcTmMonitor.cxx} | 0 ...lectionqa.cxx => emcVertexSelectionQA.cxx} | 0 ...ljetspectrapp.cxx => fullJetSpectraPP.cxx} | 0 ...gerQATask.cxx => fullJetTriggerQATask.cxx} | 8 +- ...eproducer.cxx => gammaJetTreeProducer.cxx} | 0 ...nction.cxx => hfFragmentationFunction.cxx} | 0 .../{jetchargedv2.cxx => jetChargedV2.cxx} | 0 PWGJE/Tasks/jetFinderD0QA.cxx | 27 ++++++ PWGJE/Tasks/jetFinderDielectronQA.cxx | 27 ++++++ ...etfinderfullQA.cxx => jetFinderFullQA.cxx} | 0 .../{jetfinderhfQA.cxx => jetFinderHFQA.cxx} | 28 ------ PWGJE/Tasks/jetFinderLcQA.cxx | 27 ++++++ .../{jetfinderQA.cxx => jetFinderQA.cxx} | 0 .../{jetfinderv0QA.cxx => jetFinderV0QA.cxx} | 0 ...fragmentation.cxx => jetFragmentation.cxx} | 0 .../{jetmatchingqa.cxx => jetMatchingQA.cxx} | 0 .../{jetplanarflow.cxx => jetPlanarFlow.cxx} | 0 ...etsubstructure.cxx => jetSubstructure.cxx} | 0 PWGJE/Tasks/jetSubstructureD0.cxx | 27 ++++++ PWGJE/Tasks/jetSubstructureD0Output.cxx | 26 +++++ PWGJE/Tasks/jetSubstructureDielectron.cxx | 27 ++++++ .../Tasks/jetSubstructureDielectronOutput.cxx | 26 +++++ ...bstructurehf.cxx => jetSubstructureHF.cxx} | 29 +----- ...output.cxx => jetSubstructureHFOutput.cxx} | 17 +--- PWGJE/Tasks/jetSubstructureLc.cxx | 27 ++++++ PWGJE/Tasks/jetSubstructureLcOutput.cxx | 26 +++++ ...reoutput.cxx => jetSubstructureOutput.cxx} | 0 .../{jettaggerhfQA.cxx => jetTaggerHFQA.cxx} | 0 ...etvalidationqa.cxx => jetValidationQA.cxx} | 10 +- ...atorstudies.cxx => mcGeneratorStudies.cxx} | 0 .../{nSubjettiness.cxx => nsubjettiness.cxx} | 0 ...nIsolationQA.cxx => photonIsolationQA.cxx} | 0 .../Tasks/{trackJetqa.cxx => trackJetQA.cxx} | 0 .../{v0jetspectra.cxx => v0JetSpectra.cxx} | 0 PWGJE/Tasks/{v0qa.cxx => v0QA.cxx} | 0 106 files changed, 1048 insertions(+), 361 deletions(-) rename PWGJE/JetFinders/Duplicates/{jetfinderdatacharged1.cxx => jetFinderDataCharged1.cxx} (96%) rename PWGJE/JetFinders/Duplicates/{jetfindermcdcharged1.cxx => jetFinderMCDCharged1.cxx} (96%) rename PWGJE/JetFinders/Duplicates/{jetfindermcpcharged1.cxx => jetFinderMCPCharged1.cxx} (96%) rename PWGJE/JetFinders/{jetfinder.cxx => jetFinder.cxx} (99%) rename PWGJE/JetFinders/{jetfinderD0datacharged.cxx => jetFinderD0DataCharged.cxx} (96%) rename PWGJE/JetFinders/{jetfinderD0mcdcharged.cxx => jetFinderD0MCDCharged.cxx} (97%) rename PWGJE/JetFinders/{jetfinderD0mcpcharged.cxx => jetFinderD0MCPCharged.cxx} (97%) rename PWGJE/JetFinders/{jetfinderdatacharged.cxx => jetFinderDataCharged.cxx} (96%) rename PWGJE/JetFinders/{jetfinderdatafull.cxx => jetFinderDataFull.cxx} (96%) rename PWGJE/JetFinders/{jetfinderdataneutral.cxx => jetFinderDataNeutral.cxx} (96%) rename PWGJE/JetFinders/{jetfinderDielectrondatacharged.cxx => jetFinderDielectronDataCharged.cxx} (97%) rename PWGJE/JetFinders/{jetfinderDielectronmcdcharged.cxx => jetFinderDielectronMCDCharged.cxx} (97%) rename PWGJE/JetFinders/{jetfinderDielectronmcpcharged.cxx => jetFinderDielectronMCPCharged.cxx} (97%) rename PWGJE/JetFinders/{jetfinderhf.cxx => jetFinderHF.cxx} (99%) rename PWGJE/JetFinders/{jetfinderLcdatacharged.cxx => jetFinderLcDataCharged.cxx} (96%) rename PWGJE/JetFinders/{jetfinderLcmcdcharged.cxx => jetFinderLcMCDCharged.cxx} (97%) rename PWGJE/JetFinders/{jetfinderLcmcpcharged.cxx => jetFinderLcMCPCharged.cxx} (97%) rename PWGJE/JetFinders/{jetfindermcdcharged.cxx => jetFinderMCDCharged.cxx} (96%) rename PWGJE/JetFinders/{jetfindermcdfull.cxx => jetFinderMCDFull.cxx} (96%) rename PWGJE/JetFinders/{jetfindermcdneutral.cxx => jetFinderMCDNeutral.cxx} (96%) rename PWGJE/JetFinders/{jetfindermcpcharged.cxx => jetFinderMCPCharged.cxx} (96%) rename PWGJE/JetFinders/{jetfindermcpfull.cxx => jetFinderMCPFull.cxx} (96%) rename PWGJE/JetFinders/{jetfindermcpneutral.cxx => jetFinderMCPNeutral.cxx} (96%) rename PWGJE/JetFinders/{jetfinderv0.cxx => jetFinderV0.cxx} (99%) rename PWGJE/JetFinders/{jetfinderV0datacharged.cxx => jetFinderV0DataCharged.cxx} (96%) rename PWGJE/JetFinders/{jetfinderV0mcdcharged.cxx => jetFinderV0MCDCharged.cxx} (96%) rename PWGJE/JetFinders/{jetfinderV0mcpcharged.cxx => jetFinderV0MCPCharged.cxx} (96%) create mode 100644 PWGJE/TableProducer/Matching/CMakeLists.txt create mode 100644 PWGJE/TableProducer/Matching/Duplicates/CMakeLists.txt rename PWGJE/TableProducer/{jetmatchingduplicates.cxx => Matching/Duplicates/jetMatchingDuplicates.cxx} (66%) create mode 100644 PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedData1.cxx create mode 100644 PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCD1.cxx create mode 100644 PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCP1.cxx rename PWGJE/TableProducer/{jetmatchingmc.cxx => Matching/jetMatchingMC.cxx} (52%) create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCD0Charged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCDielectronCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCFull.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCLcCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCNeutral.cxx rename PWGJE/TableProducer/{jetmatchingmcsub.cxx => Matching/jetMatchingMCSub.cxx} (61%) create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCSubCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCSubD0Charged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCSubDielectronCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCSubLcCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCV0Charged.cxx rename PWGJE/TableProducer/{jetmatchingsub.cxx => Matching/jetMatchingSub.cxx} (63%) create mode 100644 PWGJE/TableProducer/Matching/jetMatchingSubCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingSubD0Charged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingSubDielectronCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingSubLcCharged.cxx rename PWGJE/TableProducer/{jetderiveddataproducer.cxx => derivedDataProducer.cxx} (100%) rename PWGJE/TableProducer/{jetderiveddataproducerdummy.cxx => derivedDataProducerDummy.cxx} (100%) rename PWGJE/TableProducer/{jetderiveddataproducerdummyd0.cxx => derivedDataProducerDummyD0.cxx} (100%) rename PWGJE/TableProducer/{jetderiveddataproducerdummydielectron.cxx => derivedDataProducerDummyDielectron.cxx} (100%) rename PWGJE/TableProducer/{jetderiveddataproducerdummylc.cxx => derivedDataProducerDummyLc.cxx} (100%) rename PWGJE/TableProducer/{jetderiveddatatriggerproducer.cxx => derivedDataTriggerProducer.cxx} (100%) rename PWGJE/TableProducer/{jetderiveddatawriter.cxx => derivedDataWriter.cxx} (100%) rename PWGJE/TableProducer/{jeteventweightmcd.cxx => jetEventWeightMCD.cxx} (100%) rename PWGJE/TableProducer/{jeteventweightmcp.cxx => jetEventWeightMCP.cxx} (100%) rename PWGJE/TableProducer/{jettaggerhf.cxx => jetTaggerHF.cxx} (100%) rename PWGJE/TableProducer/{jettrackderived.cxx => jetTrackDerived.cxx} (100%) rename PWGJE/TableProducer/{luminositycalculator.cxx => luminosityCalculator.cxx} (100%) rename PWGJE/TableProducer/{luminosityproducer.cxx => luminosityProducer.cxx} (100%) rename PWGJE/Tasks/{emccellmonitor.cxx => emcCellMonitor.cxx} (100%) rename PWGJE/Tasks/{emcclustermonitor.cxx => emcClusterMonitor.cxx} (100%) rename PWGJE/Tasks/{emceventselectionqa.cxx => emcEventSelectionQA.cxx} (100%) rename PWGJE/Tasks/{emctmmonitor.cxx => emcTmMonitor.cxx} (100%) rename PWGJE/Tasks/{emcvertexselectionqa.cxx => emcVertexSelectionQA.cxx} (100%) rename PWGJE/Tasks/{fulljetspectrapp.cxx => fullJetSpectraPP.cxx} (100%) rename PWGJE/Tasks/{FullJetTriggerQATask.cxx => fullJetTriggerQATask.cxx} (99%) rename PWGJE/Tasks/{gammajettreeproducer.cxx => gammaJetTreeProducer.cxx} (100%) rename PWGJE/Tasks/{hffragmentationfunction.cxx => hfFragmentationFunction.cxx} (100%) rename PWGJE/Tasks/{jetchargedv2.cxx => jetChargedV2.cxx} (100%) create mode 100644 PWGJE/Tasks/jetFinderD0QA.cxx create mode 100644 PWGJE/Tasks/jetFinderDielectronQA.cxx rename PWGJE/Tasks/{jetfinderfullQA.cxx => jetFinderFullQA.cxx} (100%) rename PWGJE/Tasks/{jetfinderhfQA.cxx => jetFinderHFQA.cxx} (96%) create mode 100644 PWGJE/Tasks/jetFinderLcQA.cxx rename PWGJE/Tasks/{jetfinderQA.cxx => jetFinderQA.cxx} (100%) rename PWGJE/Tasks/{jetfinderv0QA.cxx => jetFinderV0QA.cxx} (100%) rename PWGJE/Tasks/{jetfragmentation.cxx => jetFragmentation.cxx} (100%) rename PWGJE/Tasks/{jetmatchingqa.cxx => jetMatchingQA.cxx} (100%) rename PWGJE/Tasks/{jetplanarflow.cxx => jetPlanarFlow.cxx} (100%) rename PWGJE/Tasks/{jetsubstructure.cxx => jetSubstructure.cxx} (100%) create mode 100644 PWGJE/Tasks/jetSubstructureD0.cxx create mode 100644 PWGJE/Tasks/jetSubstructureD0Output.cxx create mode 100644 PWGJE/Tasks/jetSubstructureDielectron.cxx create mode 100644 PWGJE/Tasks/jetSubstructureDielectronOutput.cxx rename PWGJE/Tasks/{jetsubstructurehf.cxx => jetSubstructureHF.cxx} (84%) rename PWGJE/Tasks/{jetsubstructurehfoutput.cxx => jetSubstructureHFOutput.cxx} (83%) create mode 100644 PWGJE/Tasks/jetSubstructureLc.cxx create mode 100644 PWGJE/Tasks/jetSubstructureLcOutput.cxx rename PWGJE/Tasks/{jetsubstructureoutput.cxx => jetSubstructureOutput.cxx} (100%) rename PWGJE/Tasks/{jettaggerhfQA.cxx => jetTaggerHFQA.cxx} (100%) rename PWGJE/Tasks/{jetvalidationqa.cxx => jetValidationQA.cxx} (99%) rename PWGJE/Tasks/{mcgeneratorstudies.cxx => mcGeneratorStudies.cxx} (100%) rename PWGJE/Tasks/{nSubjettiness.cxx => nsubjettiness.cxx} (100%) rename PWGJE/Tasks/{PhotonIsolationQA.cxx => photonIsolationQA.cxx} (100%) rename PWGJE/Tasks/{trackJetqa.cxx => trackJetQA.cxx} (100%) rename PWGJE/Tasks/{v0jetspectra.cxx => v0JetSpectra.cxx} (100%) rename PWGJE/Tasks/{v0qa.cxx => v0QA.cxx} (100%) diff --git a/PWGJE/JetFinders/CMakeLists.txt b/PWGJE/JetFinders/CMakeLists.txt index 4c63447cf36..9be82d6180b 100644 --- a/PWGJE/JetFinders/CMakeLists.txt +++ b/PWGJE/JetFinders/CMakeLists.txt @@ -14,108 +14,108 @@ add_subdirectory(Duplicates) if(FastJet_FOUND) o2physics_add_dpl_workflow(jet-finder-data-charged - SOURCES jetfinderdatacharged.cxx + SOURCES jetFinderDataCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-mcd-charged - SOURCES jetfindermcdcharged.cxx + SOURCES jetFinderMCDCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-mcp-charged - SOURCES jetfindermcpcharged.cxx + SOURCES jetFinderMCPCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-data-full - SOURCES jetfinderdatafull.cxx + SOURCES jetFinderDataFull.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-mcd-full - SOURCES jetfindermcdfull.cxx + SOURCES jetFinderMCDFull.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-mcp-full - SOURCES jetfindermcpfull.cxx + SOURCES jetFinderMCPFull.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-data-neutral - SOURCES jetfinderdataneutral.cxx + SOURCES jetFinderDataNeutral.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-mcd-neutral - SOURCES jetfindermcdneutral.cxx + SOURCES jetFinderMCDNeutral.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-mcp-neutral - SOURCES jetfindermcpneutral.cxx + SOURCES jetFinderMCPNeutral.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-d0-data-charged - SOURCES jetfinderD0datacharged.cxx + SOURCES jetFinderD0DataCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-d0-mcd-charged - SOURCES jetfinderD0mcdcharged.cxx + SOURCES jetFinderD0MCDCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-d0-mcp-charged - SOURCES jetfinderD0mcpcharged.cxx + SOURCES jetFinderD0MCPCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-lc-data-charged - SOURCES jetfinderLcdatacharged.cxx + SOURCES jetFinderLcDataCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-lc-mcd-charged - SOURCES jetfinderLcmcdcharged.cxx + SOURCES jetFinderLcMCDCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-lc-mcp-charged - SOURCES jetfinderLcmcpcharged.cxx + SOURCES jetFinderLcMCPCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-v0-data-charged - SOURCES jetfinderV0datacharged.cxx + SOURCES jetFinderV0DataCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-v0-mcd-charged - SOURCES jetfinderV0mcdcharged.cxx + SOURCES jetFinderV0MCDCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-v0-mcp-charged - SOURCES jetfinderV0mcpcharged.cxx + SOURCES jetFinderV0MCPCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-dielectron-data-charged - SOURCES jetfinderDielectrondatacharged.cxx + SOURCES jetFinderDielectronDataCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-dielectron-mcd-charged - SOURCES jetfinderDielectronmcdcharged.cxx + SOURCES jetFinderDielectronMCDCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-dielectron-mcp-charged - SOURCES jetfinderDielectronmcpcharged.cxx + SOURCES jetFinderDielectronMCPCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) diff --git a/PWGJE/JetFinders/Duplicates/CMakeLists.txt b/PWGJE/JetFinders/Duplicates/CMakeLists.txt index a884489b29c..4270de9f221 100644 --- a/PWGJE/JetFinders/Duplicates/CMakeLists.txt +++ b/PWGJE/JetFinders/Duplicates/CMakeLists.txt @@ -13,17 +13,17 @@ if(FastJet_FOUND) o2physics_add_dpl_workflow(jet-finder-data-charged-1 - SOURCES jetfinderdatacharged1.cxx + SOURCES jetFinderDataCharged1.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-mcd-charged-1 - SOURCES jetfindermcdcharged1.cxx + SOURCES jetFinderMCDCharged1.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-mcp-charged-1 - SOURCES jetfindermcpcharged1.cxx + SOURCES jetFinderMCPCharged1.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) diff --git a/PWGJE/JetFinders/Duplicates/jetfinderdatacharged1.cxx b/PWGJE/JetFinders/Duplicates/jetFinderDataCharged1.cxx similarity index 96% rename from PWGJE/JetFinders/Duplicates/jetfinderdatacharged1.cxx rename to PWGJE/JetFinders/Duplicates/jetFinderDataCharged1.cxx index d102d57c675..46f2dd88df8 100644 --- a/PWGJE/JetFinders/Duplicates/jetfinderdatacharged1.cxx +++ b/PWGJE/JetFinders/Duplicates/jetFinderDataCharged1.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinder.cxx" +#include "PWGJE/JetFinders/jetFinder.cxx" using JetFinderDataCharged1 = JetFinderTask; diff --git a/PWGJE/JetFinders/Duplicates/jetfindermcdcharged1.cxx b/PWGJE/JetFinders/Duplicates/jetFinderMCDCharged1.cxx similarity index 96% rename from PWGJE/JetFinders/Duplicates/jetfindermcdcharged1.cxx rename to PWGJE/JetFinders/Duplicates/jetFinderMCDCharged1.cxx index 36f9412aad2..4a13537a48b 100644 --- a/PWGJE/JetFinders/Duplicates/jetfindermcdcharged1.cxx +++ b/PWGJE/JetFinders/Duplicates/jetFinderMCDCharged1.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinder.cxx" +#include "PWGJE/JetFinders/jetFinder.cxx" using JetFinderMCDetectorLevelCharged1 = JetFinderTask; diff --git a/PWGJE/JetFinders/Duplicates/jetfindermcpcharged1.cxx b/PWGJE/JetFinders/Duplicates/jetFinderMCPCharged1.cxx similarity index 96% rename from PWGJE/JetFinders/Duplicates/jetfindermcpcharged1.cxx rename to PWGJE/JetFinders/Duplicates/jetFinderMCPCharged1.cxx index ff1d2a10e2b..68e3f861ae6 100644 --- a/PWGJE/JetFinders/Duplicates/jetfindermcpcharged1.cxx +++ b/PWGJE/JetFinders/Duplicates/jetFinderMCPCharged1.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinder.cxx" +#include "PWGJE/JetFinders/jetFinder.cxx" using JetFinderMCParticleLevelCharged1 = JetFinderTask; diff --git a/PWGJE/JetFinders/jetfinder.cxx b/PWGJE/JetFinders/jetFinder.cxx similarity index 99% rename from PWGJE/JetFinders/jetfinder.cxx rename to PWGJE/JetFinders/jetFinder.cxx index 61eb0fbacb4..31417152225 100644 --- a/PWGJE/JetFinders/jetfinder.cxx +++ b/PWGJE/JetFinders/jetFinder.cxx @@ -15,6 +15,8 @@ /// \author Jochen Klein /// \author Raymond Ehlers , ORNL +#include + #include "PWGJE/Core/JetFindingUtilities.h" #include "Framework/runDataProcessing.h" diff --git a/PWGJE/JetFinders/jetfinderD0datacharged.cxx b/PWGJE/JetFinders/jetFinderD0DataCharged.cxx similarity index 96% rename from PWGJE/JetFinders/jetfinderD0datacharged.cxx rename to PWGJE/JetFinders/jetFinderD0DataCharged.cxx index d26fb239ea3..bf39b49696f 100644 --- a/PWGJE/JetFinders/jetfinderD0datacharged.cxx +++ b/PWGJE/JetFinders/jetFinderD0DataCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinderhf.cxx" +#include "PWGJE/JetFinders/jetFinderHF.cxx" using JetFinderD0DataCharged = JetFinderHFTask; diff --git a/PWGJE/JetFinders/jetfinderD0mcdcharged.cxx b/PWGJE/JetFinders/jetFinderD0MCDCharged.cxx similarity index 97% rename from PWGJE/JetFinders/jetfinderD0mcdcharged.cxx rename to PWGJE/JetFinders/jetFinderD0MCDCharged.cxx index afc97fad2b1..fceb0bf2c73 100644 --- a/PWGJE/JetFinders/jetfinderD0mcdcharged.cxx +++ b/PWGJE/JetFinders/jetFinderD0MCDCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinderhf.cxx" +#include "PWGJE/JetFinders/jetFinderHF.cxx" using JetFinderD0MCDetectorLevelCharged = JetFinderHFTask; diff --git a/PWGJE/JetFinders/jetfinderD0mcpcharged.cxx b/PWGJE/JetFinders/jetFinderD0MCPCharged.cxx similarity index 97% rename from PWGJE/JetFinders/jetfinderD0mcpcharged.cxx rename to PWGJE/JetFinders/jetFinderD0MCPCharged.cxx index a92690ebe2a..2584d5693ec 100644 --- a/PWGJE/JetFinders/jetfinderD0mcpcharged.cxx +++ b/PWGJE/JetFinders/jetFinderD0MCPCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinderhf.cxx" +#include "PWGJE/JetFinders/jetFinderHF.cxx" using JetFinderD0MCParticleLevelCharged = JetFinderHFTask; diff --git a/PWGJE/JetFinders/jetfinderdatacharged.cxx b/PWGJE/JetFinders/jetFinderDataCharged.cxx similarity index 96% rename from PWGJE/JetFinders/jetfinderdatacharged.cxx rename to PWGJE/JetFinders/jetFinderDataCharged.cxx index df740ad2dba..e713eb4fa7c 100644 --- a/PWGJE/JetFinders/jetfinderdatacharged.cxx +++ b/PWGJE/JetFinders/jetFinderDataCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinder.cxx" +#include "PWGJE/JetFinders/jetFinder.cxx" using JetFinderDataCharged = JetFinderTask; diff --git a/PWGJE/JetFinders/jetfinderdatafull.cxx b/PWGJE/JetFinders/jetFinderDataFull.cxx similarity index 96% rename from PWGJE/JetFinders/jetfinderdatafull.cxx rename to PWGJE/JetFinders/jetFinderDataFull.cxx index a75896212be..07d103d93b2 100644 --- a/PWGJE/JetFinders/jetfinderdatafull.cxx +++ b/PWGJE/JetFinders/jetFinderDataFull.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinder.cxx" +#include "PWGJE/JetFinders/jetFinder.cxx" using JetFinderDataFull = JetFinderTask; diff --git a/PWGJE/JetFinders/jetfinderdataneutral.cxx b/PWGJE/JetFinders/jetFinderDataNeutral.cxx similarity index 96% rename from PWGJE/JetFinders/jetfinderdataneutral.cxx rename to PWGJE/JetFinders/jetFinderDataNeutral.cxx index a325de11bbd..28a1b898a15 100644 --- a/PWGJE/JetFinders/jetfinderdataneutral.cxx +++ b/PWGJE/JetFinders/jetFinderDataNeutral.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinder.cxx" +#include "PWGJE/JetFinders/jetFinder.cxx" using JetFinderDataNeutral = JetFinderTask; diff --git a/PWGJE/JetFinders/jetfinderDielectrondatacharged.cxx b/PWGJE/JetFinders/jetFinderDielectronDataCharged.cxx similarity index 97% rename from PWGJE/JetFinders/jetfinderDielectrondatacharged.cxx rename to PWGJE/JetFinders/jetFinderDielectronDataCharged.cxx index 1703462a168..195b05f8f2f 100644 --- a/PWGJE/JetFinders/jetfinderDielectrondatacharged.cxx +++ b/PWGJE/JetFinders/jetFinderDielectronDataCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinderhf.cxx" +#include "PWGJE/JetFinders/jetFinderHF.cxx" using JetFinderDielectronDataCharged = JetFinderHFTask; diff --git a/PWGJE/JetFinders/jetfinderDielectronmcdcharged.cxx b/PWGJE/JetFinders/jetFinderDielectronMCDCharged.cxx similarity index 97% rename from PWGJE/JetFinders/jetfinderDielectronmcdcharged.cxx rename to PWGJE/JetFinders/jetFinderDielectronMCDCharged.cxx index 87b3a5b8013..d49a2215ab6 100644 --- a/PWGJE/JetFinders/jetfinderDielectronmcdcharged.cxx +++ b/PWGJE/JetFinders/jetFinderDielectronMCDCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinderhf.cxx" +#include "PWGJE/JetFinders/jetFinderHF.cxx" using JetFinderDielectronMCDetectorLevelCharged = JetFinderHFTask; diff --git a/PWGJE/JetFinders/jetfinderDielectronmcpcharged.cxx b/PWGJE/JetFinders/jetFinderDielectronMCPCharged.cxx similarity index 97% rename from PWGJE/JetFinders/jetfinderDielectronmcpcharged.cxx rename to PWGJE/JetFinders/jetFinderDielectronMCPCharged.cxx index b72e82ed53e..ea8850c5d48 100644 --- a/PWGJE/JetFinders/jetfinderDielectronmcpcharged.cxx +++ b/PWGJE/JetFinders/jetFinderDielectronMCPCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinderhf.cxx" +#include "PWGJE/JetFinders/jetFinderHF.cxx" using JetFinderDielectronMCParticleLevelCharged = JetFinderHFTask; diff --git a/PWGJE/JetFinders/jetfinderhf.cxx b/PWGJE/JetFinders/jetFinderHF.cxx similarity index 99% rename from PWGJE/JetFinders/jetfinderhf.cxx rename to PWGJE/JetFinders/jetFinderHF.cxx index db62faee40d..94ec554e160 100644 --- a/PWGJE/JetFinders/jetfinderhf.cxx +++ b/PWGJE/JetFinders/jetFinderHF.cxx @@ -14,6 +14,8 @@ /// \author Nima Zardoshti /// \author Jochen Klein +#include + #include "CommonConstants/PhysicsConstants.h" #include "PWGJE/Core/JetFindingUtilities.h" diff --git a/PWGJE/JetFinders/jetfinderLcdatacharged.cxx b/PWGJE/JetFinders/jetFinderLcDataCharged.cxx similarity index 96% rename from PWGJE/JetFinders/jetfinderLcdatacharged.cxx rename to PWGJE/JetFinders/jetFinderLcDataCharged.cxx index bf522020db8..808a3ebfa70 100644 --- a/PWGJE/JetFinders/jetfinderLcdatacharged.cxx +++ b/PWGJE/JetFinders/jetFinderLcDataCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinderhf.cxx" +#include "PWGJE/JetFinders/jetFinderHF.cxx" using JetFinderLcDataCharged = JetFinderHFTask; diff --git a/PWGJE/JetFinders/jetfinderLcmcdcharged.cxx b/PWGJE/JetFinders/jetFinderLcMCDCharged.cxx similarity index 97% rename from PWGJE/JetFinders/jetfinderLcmcdcharged.cxx rename to PWGJE/JetFinders/jetFinderLcMCDCharged.cxx index 410d51695b1..f125cd5ef23 100644 --- a/PWGJE/JetFinders/jetfinderLcmcdcharged.cxx +++ b/PWGJE/JetFinders/jetFinderLcMCDCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinderhf.cxx" +#include "PWGJE/JetFinders/jetFinderHF.cxx" using JetFinderLcMCDetectorLevelCharged = JetFinderHFTask; diff --git a/PWGJE/JetFinders/jetfinderLcmcpcharged.cxx b/PWGJE/JetFinders/jetFinderLcMCPCharged.cxx similarity index 97% rename from PWGJE/JetFinders/jetfinderLcmcpcharged.cxx rename to PWGJE/JetFinders/jetFinderLcMCPCharged.cxx index 9183edef828..7fcad36192b 100644 --- a/PWGJE/JetFinders/jetfinderLcmcpcharged.cxx +++ b/PWGJE/JetFinders/jetFinderLcMCPCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinderhf.cxx" +#include "PWGJE/JetFinders/jetFinderHF.cxx" using JetFinderLcMCParticleLevelCharged = JetFinderHFTask; diff --git a/PWGJE/JetFinders/jetfindermcdcharged.cxx b/PWGJE/JetFinders/jetFinderMCDCharged.cxx similarity index 96% rename from PWGJE/JetFinders/jetfindermcdcharged.cxx rename to PWGJE/JetFinders/jetFinderMCDCharged.cxx index 6f248edcaf8..d8558a57770 100644 --- a/PWGJE/JetFinders/jetfindermcdcharged.cxx +++ b/PWGJE/JetFinders/jetFinderMCDCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinder.cxx" +#include "PWGJE/JetFinders/jetFinder.cxx" using JetFinderMCDetectorLevelCharged = JetFinderTask; diff --git a/PWGJE/JetFinders/jetfindermcdfull.cxx b/PWGJE/JetFinders/jetFinderMCDFull.cxx similarity index 96% rename from PWGJE/JetFinders/jetfindermcdfull.cxx rename to PWGJE/JetFinders/jetFinderMCDFull.cxx index 29464e814c9..0123b75d823 100644 --- a/PWGJE/JetFinders/jetfindermcdfull.cxx +++ b/PWGJE/JetFinders/jetFinderMCDFull.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinder.cxx" +#include "PWGJE/JetFinders/jetFinder.cxx" using JetFinderMCDetectorLevelFull = JetFinderTask; diff --git a/PWGJE/JetFinders/jetfindermcdneutral.cxx b/PWGJE/JetFinders/jetFinderMCDNeutral.cxx similarity index 96% rename from PWGJE/JetFinders/jetfindermcdneutral.cxx rename to PWGJE/JetFinders/jetFinderMCDNeutral.cxx index f58cc09492d..9e8225b0c5f 100644 --- a/PWGJE/JetFinders/jetfindermcdneutral.cxx +++ b/PWGJE/JetFinders/jetFinderMCDNeutral.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinder.cxx" +#include "PWGJE/JetFinders/jetFinder.cxx" using JetFinderMCDetectorLevelNeutral = JetFinderTask; diff --git a/PWGJE/JetFinders/jetfindermcpcharged.cxx b/PWGJE/JetFinders/jetFinderMCPCharged.cxx similarity index 96% rename from PWGJE/JetFinders/jetfindermcpcharged.cxx rename to PWGJE/JetFinders/jetFinderMCPCharged.cxx index 41981a193f1..9cba0092a53 100644 --- a/PWGJE/JetFinders/jetfindermcpcharged.cxx +++ b/PWGJE/JetFinders/jetFinderMCPCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinder.cxx" +#include "PWGJE/JetFinders/jetFinder.cxx" using JetFinderMCParticleLevelCharged = JetFinderTask; diff --git a/PWGJE/JetFinders/jetfindermcpfull.cxx b/PWGJE/JetFinders/jetFinderMCPFull.cxx similarity index 96% rename from PWGJE/JetFinders/jetfindermcpfull.cxx rename to PWGJE/JetFinders/jetFinderMCPFull.cxx index cd0bda48730..ff9c26e4d91 100644 --- a/PWGJE/JetFinders/jetfindermcpfull.cxx +++ b/PWGJE/JetFinders/jetFinderMCPFull.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinder.cxx" +#include "PWGJE/JetFinders/jetFinder.cxx" using JetFinderMCParticleLevelFull = JetFinderTask; diff --git a/PWGJE/JetFinders/jetfindermcpneutral.cxx b/PWGJE/JetFinders/jetFinderMCPNeutral.cxx similarity index 96% rename from PWGJE/JetFinders/jetfindermcpneutral.cxx rename to PWGJE/JetFinders/jetFinderMCPNeutral.cxx index e4f8c00683f..8593fb1f644 100644 --- a/PWGJE/JetFinders/jetfindermcpneutral.cxx +++ b/PWGJE/JetFinders/jetFinderMCPNeutral.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinder.cxx" +#include "PWGJE/JetFinders/jetFinder.cxx" using JetFinderMCParticleLevelNeutral = JetFinderTask; diff --git a/PWGJE/JetFinders/jetfinderv0.cxx b/PWGJE/JetFinders/jetFinderV0.cxx similarity index 99% rename from PWGJE/JetFinders/jetfinderv0.cxx rename to PWGJE/JetFinders/jetFinderV0.cxx index e36fb6235de..62e6f1635f2 100644 --- a/PWGJE/JetFinders/jetfinderv0.cxx +++ b/PWGJE/JetFinders/jetFinderV0.cxx @@ -13,6 +13,8 @@ // /// \author Nima Zardoshti +#include + #include "CommonConstants/PhysicsConstants.h" #include "PWGJE/Core/JetFindingUtilities.h" diff --git a/PWGJE/JetFinders/jetfinderV0datacharged.cxx b/PWGJE/JetFinders/jetFinderV0DataCharged.cxx similarity index 96% rename from PWGJE/JetFinders/jetfinderV0datacharged.cxx rename to PWGJE/JetFinders/jetFinderV0DataCharged.cxx index b080f135c6b..7b1ac0a261f 100644 --- a/PWGJE/JetFinders/jetfinderV0datacharged.cxx +++ b/PWGJE/JetFinders/jetFinderV0DataCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinderv0.cxx" +#include "PWGJE/JetFinders/jetFinderV0.cxx" using JetFinderV0DataCharged = JetFinderV0Task; diff --git a/PWGJE/JetFinders/jetfinderV0mcdcharged.cxx b/PWGJE/JetFinders/jetFinderV0MCDCharged.cxx similarity index 96% rename from PWGJE/JetFinders/jetfinderV0mcdcharged.cxx rename to PWGJE/JetFinders/jetFinderV0MCDCharged.cxx index b46ddeb1b28..30442208085 100644 --- a/PWGJE/JetFinders/jetfinderV0mcdcharged.cxx +++ b/PWGJE/JetFinders/jetFinderV0MCDCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinderv0.cxx" +#include "PWGJE/JetFinders/jetFinderV0.cxx" using JetFinderV0MCDetectorLevelCharged = JetFinderV0Task; diff --git a/PWGJE/JetFinders/jetfinderV0mcpcharged.cxx b/PWGJE/JetFinders/jetFinderV0MCPCharged.cxx similarity index 96% rename from PWGJE/JetFinders/jetfinderV0mcpcharged.cxx rename to PWGJE/JetFinders/jetFinderV0MCPCharged.cxx index 29f0fee1bd2..27de0bdbc3c 100644 --- a/PWGJE/JetFinders/jetfinderV0mcpcharged.cxx +++ b/PWGJE/JetFinders/jetFinderV0MCPCharged.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/JetFinders/jetfinderv0.cxx" +#include "PWGJE/JetFinders/jetFinderV0.cxx" using JetFinderV0MCParticleLevelCharged = JetFinderV0Task; diff --git a/PWGJE/TableProducer/CMakeLists.txt b/PWGJE/TableProducer/CMakeLists.txt index 12fa8359820..1794a0b70fe 100644 --- a/PWGJE/TableProducer/CMakeLists.txt +++ b/PWGJE/TableProducer/CMakeLists.txt @@ -13,87 +13,67 @@ if(FastJet_FOUND) o2physics_add_dpl_workflow(jet-deriveddata-producer - SOURCES jetderiveddataproducer.cxx + SOURCES derivedDataProducer.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-deriveddata-trigger-producer - SOURCES jetderiveddatatriggerproducer.cxx + SOURCES derivedDataTriggerProducer.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy - SOURCES jetderiveddataproducerdummy.cxx + SOURCES derivedDataProducerDummy.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy-d0 - SOURCES jetderiveddataproducerdummyd0.cxx + SOURCES derivedDataProducerDummyD0.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy-lc - SOURCES jetderiveddataproducerdummylc.cxx + SOURCES derivedDataProducerDummyLc.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy-dielectron - SOURCES jetderiveddataproducerdummydielectron.cxx + SOURCES derivedDataProducerDummyDielectron.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-deriveddata-writer - SOURCES jetderiveddatawriter.cxx + SOURCES derivedDataWriter.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-luminosity-producer - SOURCES luminosityproducer.cxx + SOURCES luminosityProducer.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-luminosity-calculator - SOURCES luminositycalculator.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(jet-matching-mc - SOURCES jetmatchingmc.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(jet-matching-sub - SOURCES jetmatchingsub.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(jet-matching-mc-sub - SOURCES jetmatchingmcsub.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(jet-matching-duplicates - SOURCES jetmatchingduplicates.cxx + SOURCES luminosityCalculator.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-eventweight-mcd - SOURCES jeteventweightmcd.cxx + SOURCES jetEventWeightMCD.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-eventweight-mcp - SOURCES jeteventweightmcp.cxx + SOURCES jetEventWeightMCP.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-track-derived - SOURCES jettrackderived.cxx + SOURCES jetTrackDerived.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-taggerhf - SOURCES jettaggerhf.cxx + SOURCES jetTaggerHF.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGJE/TableProducer/Matching/CMakeLists.txt b/PWGJE/TableProducer/Matching/CMakeLists.txt new file mode 100644 index 00000000000..5cb655eae3a --- /dev/null +++ b/PWGJE/TableProducer/Matching/CMakeLists.txt @@ -0,0 +1,91 @@ +# Copyright 2019-2020 CERN and copyright holders of ALICE O2. +# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +# All rights not expressly granted are reserved. +# +# This software is distributed under the terms of the GNU General Public +# License v3 (GPL Version 3), copied verbatim in the file "COPYING". +# +# In applying this license CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization +# or submit itself to any jurisdiction. + +add_subdirectory(Duplicates) + +if(FastJet_FOUND) + +o2physics_add_dpl_workflow(jet-matching-mc-ch + SOURCES jetMatchingMCCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-mc-full + SOURCES jetMatchingMCFull.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-mc-neutral + SOURCES jetMatchingMCNeutral.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-mc-d0-ch + SOURCES jetMatchingMCD0Charged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-mc-lc-ch + SOURCES jetMatchingMCLcCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-mc-dielectron-ch + SOURCES jetMatchingMCDielectronCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-mc-v0-ch + SOURCES jetMatchingMCV0Charged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-mc-sub-ch + SOURCES jetMatchingMCSubCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-mc-sub-d0-ch + SOURCES jetMatchingMCSubD0Charged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-mc-sub-lc-ch + SOURCES jetMatchingMCSubLcCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-mc-sub-dielectron-ch + SOURCES jetMatchingMCSubDielectronCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-sub-ch + SOURCES jetMatchingSubCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-sub-d0-ch + SOURCES jetMatchingSubD0Charged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-sub-lc-ch + SOURCES jetMatchingSubLcCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-sub-dielectron-ch + SOURCES jetMatchingSubDielectronCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +endif() diff --git a/PWGJE/TableProducer/Matching/Duplicates/CMakeLists.txt b/PWGJE/TableProducer/Matching/Duplicates/CMakeLists.txt new file mode 100644 index 00000000000..52a7a0377c9 --- /dev/null +++ b/PWGJE/TableProducer/Matching/Duplicates/CMakeLists.txt @@ -0,0 +1,29 @@ +# Copyright 2019-2020 CERN and copyright holders of ALICE O2. +# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +# All rights not expressly granted are reserved. +# +# This software is distributed under the terms of the GNU General Public +# License v3 (GPL Version 3), copied verbatim in the file "COPYING". +# +# In applying this license CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization +# or submit itself to any jurisdiction. + +if(FastJet_FOUND) + +o2physics_add_dpl_workflow(jet-matching-data-ch-1 + SOURCES jetMatchingDuplicatesChargedData1.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-mcd-ch-1 + SOURCES jetMatchingDuplicatesChargedMCD1.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-matching-mcp-ch-1 + SOURCES jetMatchingDuplicatesChargedMCP1.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +endif() diff --git a/PWGJE/TableProducer/jetmatchingduplicates.cxx b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicates.cxx similarity index 66% rename from PWGJE/TableProducer/jetmatchingduplicates.cxx rename to PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicates.cxx index 3c6ef791d4f..981e37a859d 100644 --- a/PWGJE/TableProducer/jetmatchingduplicates.cxx +++ b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicates.cxx @@ -91,35 +91,3 @@ struct JetMatchingDuplicates { } PROCESS_SWITCH(JetMatchingDuplicates, processJets, "Perform jet matching", false); }; - -using Charged1JetDataMatching = JetMatchingDuplicates, - soa::Join, - aod::ChargedJetsMatchedToCharged1Jets, - aod::Charged1JetsMatchedToChargedJets, - aod::JTracks, - aod::JDummys>; - -using Charged1JetMCDMatching = JetMatchingDuplicates, - soa::Join, - aod::ChargedMCDetectorLevelJetsMatchedToCharged1MCDetectorLevelJets, - aod::Charged1MCDetectorLevelJetsMatchedToChargedMCDetectorLevelJets, - aod::JTracks, - aod::JDummys>; - -using Charged1JetMCPMatching = JetMatchingDuplicates, - soa::Join, - aod::ChargedMCParticleLevelJetsMatchedToCharged1MCParticleLevelJets, - aod::Charged1MCParticleLevelJetsMatchedToChargedMCParticleLevelJets, - aod::JMcParticles, - aod::JDummys>; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - std::vector tasks; - - tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-data-ch-1"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-mcd-ch-1"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-mcp-ch-1"})); - - return WorkflowSpec{tasks}; -} diff --git a/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedData1.cxx b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedData1.cxx new file mode 100644 index 00000000000..bdf1abfb30c --- /dev/null +++ b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedData1.cxx @@ -0,0 +1,30 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching duplicates charged data task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingDuplicates.cxx" + +using Charged1JetDataMatchingDupliacates = JetMatchingDuplicates, + soa::Join, + aod::ChargedJetsMatchedToCharged1Jets, + aod::Charged1JetsMatchedToChargedJets, + aod::JTracks, + aod::JDummys>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-data-ch-1"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCD1.cxx b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCD1.cxx new file mode 100644 index 00000000000..e6d8105e4a6 --- /dev/null +++ b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCD1.cxx @@ -0,0 +1,30 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching duplicates charged mcd task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingDuplicates.cxx" + +using Charged1JetMCDMatchingDupliacates = JetMatchingDuplicates, + soa::Join, + aod::ChargedMCDetectorLevelJetsMatchedToCharged1MCDetectorLevelJets, + aod::Charged1MCDetectorLevelJetsMatchedToChargedMCDetectorLevelJets, + aod::JTracks, + aod::JDummys>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-mcd-ch-1"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCP1.cxx b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCP1.cxx new file mode 100644 index 00000000000..c468b010679 --- /dev/null +++ b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCP1.cxx @@ -0,0 +1,30 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching duplicates charged mcp task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingDuplicates.cxx" + +using Charged1JetMCPMatchingDupliacates = JetMatchingDuplicates, + soa::Join, + aod::ChargedMCParticleLevelJetsMatchedToCharged1MCParticleLevelJets, + aod::Charged1MCParticleLevelJetsMatchedToChargedMCParticleLevelJets, + aod::JMcParticles, + aod::JDummys>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-mcp-ch-1"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/jetmatchingmc.cxx b/PWGJE/TableProducer/Matching/jetMatchingMC.cxx similarity index 52% rename from PWGJE/TableProducer/jetmatchingmc.cxx rename to PWGJE/TableProducer/Matching/jetMatchingMC.cxx index 5ad292fcf8f..78fd5c6a399 100644 --- a/PWGJE/TableProducer/jetmatchingmc.cxx +++ b/PWGJE/TableProducer/Matching/jetMatchingMC.cxx @@ -17,6 +17,8 @@ /// \author Aimeric Lanodu /// \author Nima Zardoshti +#include + #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" #include "Framework/ASoA.h" @@ -106,41 +108,6 @@ struct JetMatchingMc { PROCESS_SWITCH(JetMatchingMc, processJets, "Perform jet matching", false); }; -using ChargedJetMatching = JetMatchingMc, - soa::Join, - aod::ChargedMCDetectorLevelJetsMatchedToChargedMCParticleLevelJets, - aod::ChargedMCParticleLevelJetsMatchedToChargedMCDetectorLevelJets, - aod::JCollisions, - aod::JMcCollisions, - aod::JDummys>; -using FullJetMatching = JetMatchingMc, - soa::Join, - aod::FullMCDetectorLevelJetsMatchedToFullMCParticleLevelJets, - aod::FullMCParticleLevelJetsMatchedToFullMCDetectorLevelJets, - aod::JCollisions, - aod::JMcCollisions, - aod::JetClustersMCD>; -using NeutralJetMatching = JetMatchingMc, - soa::Join, - aod::NeutralMCDetectorLevelJetsMatchedToNeutralMCParticleLevelJets, - aod::NeutralMCParticleLevelJetsMatchedToNeutralMCDetectorLevelJets, - aod::JCollisions, - aod::JMcCollisions, - aod::JetClustersMCD>; -using D0ChargedJetMatching = JetMatchingMc, - soa::Join, - aod::D0ChargedMCDetectorLevelJetsMatchedToD0ChargedMCParticleLevelJets, - aod::D0ChargedMCParticleLevelJetsMatchedToD0ChargedMCDetectorLevelJets, - aod::CandidatesD0MCD, - aod::CandidatesD0MCP, - aod::JDummys>; -using LcChargedJetMatching = JetMatchingMc, - soa::Join, - aod::LcChargedMCDetectorLevelJetsMatchedToLcChargedMCParticleLevelJets, - aod::LcChargedMCParticleLevelJetsMatchedToLcChargedMCDetectorLevelJets, - aod::CandidatesLcMCD, - aod::CandidatesLcMCP, - aod::JDummys>; /*using BplusChargedJetMatching = JetMatchingMc, soa::Join, aod::BplusChargedMCDetectorLevelJetsMatchedToBplusChargedMCParticleLevelJets, @@ -148,33 +115,3 @@ using LcChargedJetMatching = JetMatchingMc>;*/ -using V0ChargedJetMatching = JetMatchingMc, - soa::Join, - aod::V0ChargedMCDetectorLevelJetsMatchedToV0ChargedMCParticleLevelJets, - aod::V0ChargedMCParticleLevelJetsMatchedToV0ChargedMCDetectorLevelJets, - aod::CandidatesV0MCD, - aod::CandidatesV0MCP, - aod::JDummys>; - -using DielectronChargedJetMatching = JetMatchingMc, - soa::Join, - aod::DielectronChargedMCDetectorLevelJetsMatchedToDielectronChargedMCParticleLevelJets, - aod::DielectronChargedMCParticleLevelJetsMatchedToDielectronChargedMCDetectorLevelJets, - aod::CandidatesDielectronMCD, - aod::CandidatesDielectronMCP, - aod::JDummys>; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - std::vector tasks; - - tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-mc-ch"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-mc-full"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-mc-neutral"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-d0-ch"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-lc-ch"})); - // tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-bplus-ch"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-v0-ch"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-dielectron-ch"})); - - return WorkflowSpec{tasks}; -} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCCharged.cxx new file mode 100644 index 00000000000..fe951be4566 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCCharged.cxx @@ -0,0 +1,31 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMC.cxx" + +using ChargedJetMatchingMC = JetMatchingMc, + soa::Join, + aod::ChargedMCDetectorLevelJetsMatchedToChargedMCParticleLevelJets, + aod::ChargedMCParticleLevelJetsMatchedToChargedMCDetectorLevelJets, + aod::JCollisions, + aod::JMcCollisions, + aod::JDummys>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-mc-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCD0Charged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCD0Charged.cxx new file mode 100644 index 00000000000..64abc51c79d --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCD0Charged.cxx @@ -0,0 +1,31 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc D0 charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMC.cxx" + +using D0ChargedJetMatchingMC = JetMatchingMc, + soa::Join, + aod::D0ChargedMCDetectorLevelJetsMatchedToD0ChargedMCParticleLevelJets, + aod::D0ChargedMCParticleLevelJetsMatchedToD0ChargedMCDetectorLevelJets, + aod::CandidatesD0MCD, + aod::CandidatesD0MCP, + aod::JDummys>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-d0-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCDielectronCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCDielectronCharged.cxx new file mode 100644 index 00000000000..7d284ecbee4 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCDielectronCharged.cxx @@ -0,0 +1,31 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc Dielectron charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMC.cxx" + +using DielectronChargedJetMatchingMC = JetMatchingMc, + soa::Join, + aod::DielectronChargedMCDetectorLevelJetsMatchedToDielectronChargedMCParticleLevelJets, + aod::DielectronChargedMCParticleLevelJetsMatchedToDielectronChargedMCDetectorLevelJets, + aod::CandidatesDielectronMCD, + aod::CandidatesDielectronMCP, + aod::JDummys>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-dielectron-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCFull.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCFull.cxx new file mode 100644 index 00000000000..e4bf6f3979d --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCFull.cxx @@ -0,0 +1,31 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc full task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMC.cxx" + +using FullJetMatchingMC = JetMatchingMc, + soa::Join, + aod::FullMCDetectorLevelJetsMatchedToFullMCParticleLevelJets, + aod::FullMCParticleLevelJetsMatchedToFullMCDetectorLevelJets, + aod::JCollisions, + aod::JMcCollisions, + aod::JetClustersMCD>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-mc-full"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCLcCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCLcCharged.cxx new file mode 100644 index 00000000000..9be7e169e57 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCLcCharged.cxx @@ -0,0 +1,31 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc Lc charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMC.cxx" + +using LcChargedJetMatchingMC = JetMatchingMc, + soa::Join, + aod::LcChargedMCDetectorLevelJetsMatchedToLcChargedMCParticleLevelJets, + aod::LcChargedMCParticleLevelJetsMatchedToLcChargedMCDetectorLevelJets, + aod::CandidatesLcMCD, + aod::CandidatesLcMCP, + aod::JDummys>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-lc-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCNeutral.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCNeutral.cxx new file mode 100644 index 00000000000..8af1d2513bc --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCNeutral.cxx @@ -0,0 +1,31 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching neutral task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMC.cxx" + +using NeutralJetMatchingMC = JetMatchingMc, + soa::Join, + aod::NeutralMCDetectorLevelJetsMatchedToNeutralMCParticleLevelJets, + aod::NeutralMCParticleLevelJetsMatchedToNeutralMCDetectorLevelJets, + aod::JCollisions, + aod::JMcCollisions, + aod::JetClustersMCD>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-mc-neutral"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/jetmatchingmcsub.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx similarity index 61% rename from PWGJE/TableProducer/jetmatchingmcsub.cxx rename to PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx index 819771a1088..f59038170e7 100644 --- a/PWGJE/TableProducer/jetmatchingmcsub.cxx +++ b/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx @@ -13,6 +13,8 @@ /// \brief matching event-wise constituent subtracted detector level and unsubtracted generated level jets (this is usseful as a template for embedding matching) /// \author Nima Zardoshti +#include + #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" #include "Framework/ASoA.h" @@ -94,41 +96,8 @@ struct JetMatchingMcSub { PROCESS_SWITCH(JetMatchingMcSub, processJets, "Perform jet matching", false); }; -using ChargedJetMatching = JetMatchingMcSub, - soa::Join, - aod::ChargedMCDetectorLevelJetsMatchedToChargedMCDetectorLevelEventWiseSubtractedJets, - aod::ChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToChargedMCDetectorLevelJets, - aod::JDummys>; -using D0ChargedJetMatching = JetMatchingMcSub, - soa::Join, - aod::D0ChargedMCDetectorLevelJetsMatchedToD0ChargedMCDetectorLevelEventWiseSubtractedJets, - aod::D0ChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToD0ChargedMCDetectorLevelJets, - aod::CandidatesD0MCD>; -using LcChargedJetMatching = JetMatchingMcSub, - soa::Join, - aod::LcChargedMCDetectorLevelJetsMatchedToLcChargedMCDetectorLevelEventWiseSubtractedJets, - aod::LcChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToLcChargedMCDetectorLevelJets, - aod::CandidatesLcMCD>; /*using BplusChargedJetMatching = JetMatchingMcSub, soa::Join, aod::BplusChargedMCDetectorLevelJetsMatchedToBplusChargedMCDetectorLevelEventWiseSubtractedJets, aod::BplusChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToBplusChargedMCDetectorLevelJets, aod::CandidatesBplusMCD>;*/ -using DielectronChargedJetMatching = JetMatchingMcSub, - soa::Join, - aod::DielectronChargedMCDetectorLevelJetsMatchedToDielectronChargedMCDetectorLevelEventWiseSubtractedJets, - aod::DielectronChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToDielectronChargedMCDetectorLevelJets, - aod::CandidatesDielectronMCD>; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - std::vector tasks; - - tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-mc-sub-ch"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-sub-d0-ch"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-sub-lc-ch"})); - // tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-sub-bplus-ch"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-sub-dielectron-ch"})); - - return WorkflowSpec{tasks}; -} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCSubCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCSubCharged.cxx new file mode 100644 index 00000000000..2b0c5c19992 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCSubCharged.cxx @@ -0,0 +1,29 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc subtracted charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx" + +using ChargedJetMatchingMCSub = JetMatchingMcSub, + soa::Join, + aod::ChargedMCDetectorLevelJetsMatchedToChargedMCDetectorLevelEventWiseSubtractedJets, + aod::ChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToChargedMCDetectorLevelJets, + aod::JDummys>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-mc-sub-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCSubD0Charged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCSubD0Charged.cxx new file mode 100644 index 00000000000..92a71c20900 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCSubD0Charged.cxx @@ -0,0 +1,29 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc subtracted D0 charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx" + +using D0ChargedJetMatchingMCSub = JetMatchingMcSub, + soa::Join, + aod::D0ChargedMCDetectorLevelJetsMatchedToD0ChargedMCDetectorLevelEventWiseSubtractedJets, + aod::D0ChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToD0ChargedMCDetectorLevelJets, + aod::CandidatesD0MCD>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-sub-d0-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCSubDielectronCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCSubDielectronCharged.cxx new file mode 100644 index 00000000000..376e904f473 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCSubDielectronCharged.cxx @@ -0,0 +1,29 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc subtracted Dielectron charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx" + +using DielectronChargedJetMatchingMCSub = JetMatchingMcSub, + soa::Join, + aod::DielectronChargedMCDetectorLevelJetsMatchedToDielectronChargedMCDetectorLevelEventWiseSubtractedJets, + aod::DielectronChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToDielectronChargedMCDetectorLevelJets, + aod::CandidatesDielectronMCD>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-sub-dielectron-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCSubLcCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCSubLcCharged.cxx new file mode 100644 index 00000000000..6a9456eb241 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCSubLcCharged.cxx @@ -0,0 +1,29 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc subtracted Lc charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx" + +using LcChargedJetMatchingMCSub = JetMatchingMcSub, + soa::Join, + aod::LcChargedMCDetectorLevelJetsMatchedToLcChargedMCDetectorLevelEventWiseSubtractedJets, + aod::LcChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToLcChargedMCDetectorLevelJets, + aod::CandidatesLcMCD>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-sub-lc-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCV0Charged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCV0Charged.cxx new file mode 100644 index 00000000000..d0910abc488 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCV0Charged.cxx @@ -0,0 +1,31 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching V0 charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMC.cxx" + +using V0ChargedJetMatchingMC = JetMatchingMc, + soa::Join, + aod::V0ChargedMCDetectorLevelJetsMatchedToV0ChargedMCParticleLevelJets, + aod::V0ChargedMCParticleLevelJetsMatchedToV0ChargedMCDetectorLevelJets, + aod::CandidatesV0MCD, + aod::CandidatesV0MCP, + aod::JDummys>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-v0-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/jetmatchingsub.cxx b/PWGJE/TableProducer/Matching/jetMatchingSub.cxx similarity index 63% rename from PWGJE/TableProducer/jetmatchingsub.cxx rename to PWGJE/TableProducer/Matching/jetMatchingSub.cxx index de8fce87bbd..cdd7c753593 100644 --- a/PWGJE/TableProducer/jetmatchingsub.cxx +++ b/PWGJE/TableProducer/Matching/jetMatchingSub.cxx @@ -13,6 +13,8 @@ /// \brief matching event-wise constituent subtracted data jets and unsubtracted data jets /// \author Nima Zardoshti +#include + #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" #include "Framework/ASoA.h" @@ -92,45 +94,9 @@ struct JetMatchingSub { PROCESS_SWITCH(JetMatchingSub, processJets, "Perform jet matching", false); }; -using ChargedJetMatching = JetMatchingSub, - soa::Join, - aod::ChargedJetsMatchedToChargedEventWiseSubtractedJets, - aod::ChargedEventWiseSubtractedJetsMatchedToChargedJets, - aod::JTrackSubs, - aod::JDummys>; -using D0ChargedJetMatching = JetMatchingSub, - soa::Join, - aod::D0ChargedJetsMatchedToD0ChargedEventWiseSubtractedJets, - aod::D0ChargedEventWiseSubtractedJetsMatchedToD0ChargedJets, - aod::JTrackD0Subs, - aod::CandidatesD0Data>; -using LcChargedJetMatching = JetMatchingSub, - soa::Join, - aod::LcChargedJetsMatchedToLcChargedEventWiseSubtractedJets, - aod::LcChargedEventWiseSubtractedJetsMatchedToLcChargedJets, - aod::JTrackLcSubs, - aod::CandidatesLcData>; /*using BplusChargedJetMatching = JetMatchingSub, soa::Join, aod::BplusChargedJetsMatchedToBplusChargedEventWiseSubtractedJets, aod::BplusChargedEventWiseSubtractedJetsMatchedToBplusChargedJets, aod::JTrackBplusSubs, aod::CandidatesBplusData>;*/ -using DielectronChargedJetMatching = JetMatchingSub, - soa::Join, - aod::DielectronChargedJetsMatchedToDielectronChargedEventWiseSubtractedJets, - aod::DielectronChargedEventWiseSubtractedJetsMatchedToDielectronChargedJets, - aod::JTrackDielectronSubs, - aod::CandidatesDielectronData>; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - std::vector tasks; - - tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-sub-ch"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-sub-d0-ch"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-sub-lc-ch"})); - // tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-sub-bplus-ch"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-sub-dielectron-ch"})); - - return WorkflowSpec{tasks}; -} diff --git a/PWGJE/TableProducer/Matching/jetMatchingSubCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingSubCharged.cxx new file mode 100644 index 00000000000..4d12c3c0448 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingSubCharged.cxx @@ -0,0 +1,30 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching subtracted charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingSub.cxx" + +using ChargedJetMatchingSub = JetMatchingSub, + soa::Join, + aod::ChargedJetsMatchedToChargedEventWiseSubtractedJets, + aod::ChargedEventWiseSubtractedJetsMatchedToChargedJets, + aod::JTrackSubs, + aod::JDummys>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-matching-sub-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingSubD0Charged.cxx b/PWGJE/TableProducer/Matching/jetMatchingSubD0Charged.cxx new file mode 100644 index 00000000000..d07f5186d95 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingSubD0Charged.cxx @@ -0,0 +1,30 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching subtracted D0 charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingSub.cxx" + +using D0ChargedJetMatchingSub = JetMatchingSub, + soa::Join, + aod::D0ChargedJetsMatchedToD0ChargedEventWiseSubtractedJets, + aod::D0ChargedEventWiseSubtractedJetsMatchedToD0ChargedJets, + aod::JTrackD0Subs, + aod::CandidatesD0Data>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-sub-d0-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingSubDielectronCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingSubDielectronCharged.cxx new file mode 100644 index 00000000000..94960e214d8 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingSubDielectronCharged.cxx @@ -0,0 +1,30 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching subtracted Dielectron charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingSub.cxx" + +using DielectronChargedJetMatchingSub = JetMatchingSub, + soa::Join, + aod::DielectronChargedJetsMatchedToDielectronChargedEventWiseSubtractedJets, + aod::DielectronChargedEventWiseSubtractedJetsMatchedToDielectronChargedJets, + aod::JTrackDielectronSubs, + aod::CandidatesDielectronData>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-sub-dielectron-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingSubLcCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingSubLcCharged.cxx new file mode 100644 index 00000000000..eabc5209fa8 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingSubLcCharged.cxx @@ -0,0 +1,30 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching subtracted Lc charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingSub.cxx" + +using LcChargedJetMatchingSub = JetMatchingSub, + soa::Join, + aod::LcChargedJetsMatchedToLcChargedEventWiseSubtractedJets, + aod::LcChargedEventWiseSubtractedJetsMatchedToLcChargedJets, + aod::JTrackLcSubs, + aod::CandidatesLcData>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-sub-lc-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/jetderiveddataproducer.cxx b/PWGJE/TableProducer/derivedDataProducer.cxx similarity index 100% rename from PWGJE/TableProducer/jetderiveddataproducer.cxx rename to PWGJE/TableProducer/derivedDataProducer.cxx diff --git a/PWGJE/TableProducer/jetderiveddataproducerdummy.cxx b/PWGJE/TableProducer/derivedDataProducerDummy.cxx similarity index 100% rename from PWGJE/TableProducer/jetderiveddataproducerdummy.cxx rename to PWGJE/TableProducer/derivedDataProducerDummy.cxx diff --git a/PWGJE/TableProducer/jetderiveddataproducerdummyd0.cxx b/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx similarity index 100% rename from PWGJE/TableProducer/jetderiveddataproducerdummyd0.cxx rename to PWGJE/TableProducer/derivedDataProducerDummyD0.cxx diff --git a/PWGJE/TableProducer/jetderiveddataproducerdummydielectron.cxx b/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx similarity index 100% rename from PWGJE/TableProducer/jetderiveddataproducerdummydielectron.cxx rename to PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx diff --git a/PWGJE/TableProducer/jetderiveddataproducerdummylc.cxx b/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx similarity index 100% rename from PWGJE/TableProducer/jetderiveddataproducerdummylc.cxx rename to PWGJE/TableProducer/derivedDataProducerDummyLc.cxx diff --git a/PWGJE/TableProducer/jetderiveddatatriggerproducer.cxx b/PWGJE/TableProducer/derivedDataTriggerProducer.cxx similarity index 100% rename from PWGJE/TableProducer/jetderiveddatatriggerproducer.cxx rename to PWGJE/TableProducer/derivedDataTriggerProducer.cxx diff --git a/PWGJE/TableProducer/jetderiveddatawriter.cxx b/PWGJE/TableProducer/derivedDataWriter.cxx similarity index 100% rename from PWGJE/TableProducer/jetderiveddatawriter.cxx rename to PWGJE/TableProducer/derivedDataWriter.cxx diff --git a/PWGJE/TableProducer/jeteventweightmcd.cxx b/PWGJE/TableProducer/jetEventWeightMCD.cxx similarity index 100% rename from PWGJE/TableProducer/jeteventweightmcd.cxx rename to PWGJE/TableProducer/jetEventWeightMCD.cxx diff --git a/PWGJE/TableProducer/jeteventweightmcp.cxx b/PWGJE/TableProducer/jetEventWeightMCP.cxx similarity index 100% rename from PWGJE/TableProducer/jeteventweightmcp.cxx rename to PWGJE/TableProducer/jetEventWeightMCP.cxx diff --git a/PWGJE/TableProducer/jettaggerhf.cxx b/PWGJE/TableProducer/jetTaggerHF.cxx similarity index 100% rename from PWGJE/TableProducer/jettaggerhf.cxx rename to PWGJE/TableProducer/jetTaggerHF.cxx diff --git a/PWGJE/TableProducer/jettrackderived.cxx b/PWGJE/TableProducer/jetTrackDerived.cxx similarity index 100% rename from PWGJE/TableProducer/jettrackderived.cxx rename to PWGJE/TableProducer/jetTrackDerived.cxx diff --git a/PWGJE/TableProducer/luminositycalculator.cxx b/PWGJE/TableProducer/luminosityCalculator.cxx similarity index 100% rename from PWGJE/TableProducer/luminositycalculator.cxx rename to PWGJE/TableProducer/luminosityCalculator.cxx diff --git a/PWGJE/TableProducer/luminosityproducer.cxx b/PWGJE/TableProducer/luminosityProducer.cxx similarity index 100% rename from PWGJE/TableProducer/luminosityproducer.cxx rename to PWGJE/TableProducer/luminosityProducer.cxx diff --git a/PWGJE/Tasks/CMakeLists.txt b/PWGJE/Tasks/CMakeLists.txt index 32f029a3b27..50f9600c2ed 100644 --- a/PWGJE/Tasks/CMakeLists.txt +++ b/PWGJE/Tasks/CMakeLists.txt @@ -11,19 +11,19 @@ o2physics_add_dpl_workflow(emc-cellmonitor - SOURCES emccellmonitor.cxx + SOURCES emcCellMonitor.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(emc-clustermonitor - SOURCES emcclustermonitor.cxx + SOURCES emcClusterMonitor.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(emc-eventselection-qa - SOURCES emceventselectionqa.cxx + SOURCES emcEventSelectionQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(emc-vertexselection-qa - SOURCES emcvertexselectionqa.cxx + SOURCES emcVertexSelectionQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(emc-pi0-energyscale-calib @@ -31,65 +31,89 @@ o2physics_add_dpl_workflow(emc-pi0-energyscale-calib PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(emc-tmmonitor - SOURCES emctmmonitor.cxx + SOURCES emcTmMonitor.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(mc-generator-studies - SOURCES mcgeneratorstudies.cxx + SOURCES mcGeneratorStudies.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(photon-isolation-qa - SOURCES PhotonIsolationQA.cxx + SOURCES photonIsolationQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore COMPONENT_NAME Analysis) if(FastJet_FOUND) o2physics_add_dpl_workflow(jet-substructure - SOURCES jetsubstructure.cxx + SOURCES jetSubstructure.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-substructure-output - SOURCES jetsubstructureoutput.cxx + SOURCES jetSubstructureOutput.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(jet-substructure-hf - SOURCES jetsubstructurehf.cxx + o2physics_add_dpl_workflow(jet-substructure-d0 + SOURCES jetSubstructureD0.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(jet-substructure-hf-output - SOURCES jetsubstructurehfoutput.cxx + o2physics_add_dpl_workflow(jet-substructure-lc + SOURCES jetSubstructureLc.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-substructure-dielectron + SOURCES jetSubstructureDielectron.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-substructure-d0-output + SOURCES jetSubstructureD0Output.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-substructure-lc-output + SOURCES jetSubstructureLcOutput.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-substructure-dielectron-output + SOURCES jetSubstructureDielectronOutput.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-fragmentation - SOURCES jetfragmentation.cxx + SOURCES jetFragmentation.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-v0-spectra - SOURCES v0jetspectra.cxx + SOURCES v0JetSpectra.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-v0qa - SOURCES v0qa.cxx + SOURCES v0QA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-charged-qa - SOURCES jetfinderQA.cxx + SOURCES jetFinderQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-charged-v2 - SOURCES jetchargedv2.cxx + SOURCES jetChargedV2.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-finder-d0-qa + SOURCES jetFinderD0QA.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-finder-lc-qa + SOURCES jetFinderLcQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(jet-finder-hf-qa - SOURCES jetfinderhfQA.cxx + o2physics_add_dpl_workflow(jet-finder-dielectron-qa + SOURCES jetFinderDielectronQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-full-qa - SOURCES jetfinderfullQA.cxx + SOURCES jetFinderFullQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-v0-qa - SOURCES jetfinderv0QA.cxx + SOURCES jetFinderV0QA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(trigger-correlations @@ -101,15 +125,15 @@ if(FastJet_FOUND) PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-full-trigger-qa - SOURCES FullJetTriggerQATask.cxx + SOURCES fullJetTriggerQATask.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-matching-qa - SOURCES jetmatchingqa.cxx + SOURCES jetMatchingQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-validation-qa - SOURCES jetvalidationqa.cxx + SOURCES jetValidationQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-tutorial @@ -121,7 +145,7 @@ if(FastJet_FOUND) PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(track-jet-qa - SOURCES trackJetqa.cxx + SOURCES trackJetQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(track-efficiency @@ -133,7 +157,7 @@ if(FastJet_FOUND) PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-nsubjettiness - SOURCES nSubjettiness.cxx + SOURCES nsubjettiness.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(phi-in-jets @@ -145,7 +169,7 @@ if(FastJet_FOUND) PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-taggerhf-qa - SOURCES jettaggerhfQA.cxx + SOURCES jetTaggerHFQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-lund-reclustering @@ -153,11 +177,11 @@ if(FastJet_FOUND) PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore FastJet::FastJet FastJet::Contrib COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-hf-fragmentation - SOURCES hffragmentationfunction.cxx + SOURCES hfFragmentationFunction.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-planarflow - SOURCES jetplanarflow.cxx + SOURCES jetPlanarFlow.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-ch-corr @@ -173,13 +197,9 @@ if(FastJet_FOUND) PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(full-jet-spectra-pp - SOURCES fulljetspectrapp.cxx + SOURCES fullJetSpectraPP.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(gamma-jet-tree-producer - SOURCES gammajettreeproducer.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::PWGJECore O2Physics::AnalysisCore - COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(bjet-tagging-ml SOURCES bjetTaggingML.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2Physics::MLCore @@ -188,5 +208,9 @@ if(FastJet_FOUND) SOURCES jetSpectraEseTask.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(gamma-jet-tree-producer + SOURCES gammaJetTreeProducer.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) endif() diff --git a/PWGJE/Tasks/emccellmonitor.cxx b/PWGJE/Tasks/emcCellMonitor.cxx similarity index 100% rename from PWGJE/Tasks/emccellmonitor.cxx rename to PWGJE/Tasks/emcCellMonitor.cxx diff --git a/PWGJE/Tasks/emcclustermonitor.cxx b/PWGJE/Tasks/emcClusterMonitor.cxx similarity index 100% rename from PWGJE/Tasks/emcclustermonitor.cxx rename to PWGJE/Tasks/emcClusterMonitor.cxx diff --git a/PWGJE/Tasks/emceventselectionqa.cxx b/PWGJE/Tasks/emcEventSelectionQA.cxx similarity index 100% rename from PWGJE/Tasks/emceventselectionqa.cxx rename to PWGJE/Tasks/emcEventSelectionQA.cxx diff --git a/PWGJE/Tasks/emctmmonitor.cxx b/PWGJE/Tasks/emcTmMonitor.cxx similarity index 100% rename from PWGJE/Tasks/emctmmonitor.cxx rename to PWGJE/Tasks/emcTmMonitor.cxx diff --git a/PWGJE/Tasks/emcvertexselectionqa.cxx b/PWGJE/Tasks/emcVertexSelectionQA.cxx similarity index 100% rename from PWGJE/Tasks/emcvertexselectionqa.cxx rename to PWGJE/Tasks/emcVertexSelectionQA.cxx diff --git a/PWGJE/Tasks/fulljetspectrapp.cxx b/PWGJE/Tasks/fullJetSpectraPP.cxx similarity index 100% rename from PWGJE/Tasks/fulljetspectrapp.cxx rename to PWGJE/Tasks/fullJetSpectraPP.cxx diff --git a/PWGJE/Tasks/FullJetTriggerQATask.cxx b/PWGJE/Tasks/fullJetTriggerQATask.cxx similarity index 99% rename from PWGJE/Tasks/FullJetTriggerQATask.cxx rename to PWGJE/Tasks/fullJetTriggerQATask.cxx index 99b76fcedb9..c9a9152381d 100644 --- a/PWGJE/Tasks/FullJetTriggerQATask.cxx +++ b/PWGJE/Tasks/fullJetTriggerQATask.cxx @@ -796,8 +796,8 @@ struct JetTriggerQA { registry.fill(HIST("hJetRMaxPtJetPt"), jet.r() * 1e-2, jetPt, jet.pt()); } } // for jets - } // if maxJet.r() == std::round(f_jetR * 100) - } // for maxJet + } // if maxJet.r() == std::round(f_jetR * 100) + } // for maxJet // Fill counters for events without max jets for (std::size_t ir = 0; ir < foundMaxJet.size(); ir++) { if (!foundMaxJet[ir]) { @@ -819,8 +819,8 @@ struct JetTriggerQA { for (const auto& jet : jets) { registry.fill(HIST("hJetRMaxPtJetPtNoFiducial"), jet.r() * 1e-2, jetPt, jet.pt()); } // for jets - } // if maxJet.r() == std::round(f_jetR * 100) - } // for maxjet no fiducial + } // if maxJet.r() == std::round(f_jetR * 100) + } // for maxjet no fiducial } // process diff --git a/PWGJE/Tasks/gammajettreeproducer.cxx b/PWGJE/Tasks/gammaJetTreeProducer.cxx similarity index 100% rename from PWGJE/Tasks/gammajettreeproducer.cxx rename to PWGJE/Tasks/gammaJetTreeProducer.cxx diff --git a/PWGJE/Tasks/hffragmentationfunction.cxx b/PWGJE/Tasks/hfFragmentationFunction.cxx similarity index 100% rename from PWGJE/Tasks/hffragmentationfunction.cxx rename to PWGJE/Tasks/hfFragmentationFunction.cxx diff --git a/PWGJE/Tasks/jetchargedv2.cxx b/PWGJE/Tasks/jetChargedV2.cxx similarity index 100% rename from PWGJE/Tasks/jetchargedv2.cxx rename to PWGJE/Tasks/jetChargedV2.cxx diff --git a/PWGJE/Tasks/jetFinderD0QA.cxx b/PWGJE/Tasks/jetFinderD0QA.cxx new file mode 100644 index 00000000000..2db58308d87 --- /dev/null +++ b/PWGJE/Tasks/jetFinderD0QA.cxx @@ -0,0 +1,27 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet finder D0 charged QA task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetFinderHFQA.cxx" + +using JetFinderD0QATask = JetFinderHFQATask; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{}, + TaskName{"jet-finder-charged-d0-qa"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetFinderDielectronQA.cxx b/PWGJE/Tasks/jetFinderDielectronQA.cxx new file mode 100644 index 00000000000..516f4501a7b --- /dev/null +++ b/PWGJE/Tasks/jetFinderDielectronQA.cxx @@ -0,0 +1,27 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet finder Dielectron charged QA task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetFinderHFQA.cxx" + +using JetFinderDielectronQATask = JetFinderHFQATask; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{}, + TaskName{"jet-finder-charged-dielectron-qa"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetfinderfullQA.cxx b/PWGJE/Tasks/jetFinderFullQA.cxx similarity index 100% rename from PWGJE/Tasks/jetfinderfullQA.cxx rename to PWGJE/Tasks/jetFinderFullQA.cxx diff --git a/PWGJE/Tasks/jetfinderhfQA.cxx b/PWGJE/Tasks/jetFinderHFQA.cxx similarity index 96% rename from PWGJE/Tasks/jetfinderhfQA.cxx rename to PWGJE/Tasks/jetFinderHFQA.cxx index 9ac052bdebe..832cdb3305c 100644 --- a/PWGJE/Tasks/jetfinderhfQA.cxx +++ b/PWGJE/Tasks/jetFinderHFQA.cxx @@ -1556,31 +1556,3 @@ struct JetFinderHFQATask { } PROCESS_SWITCH(JetFinderHFQATask, processCandidates, "HF candidate QA", false); }; - -using JetFinderD0QATask = JetFinderHFQATask; -using JetFinderLcQATask = JetFinderHFQATask; -// using JetFinderBplusQATask = JetFinderHFQATask; -using JetFinderDielectronQATask = JetFinderHFQATask; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - std::vector tasks; - - tasks.emplace_back(adaptAnalysisTask(cfgc, - SetDefaultProcesses{}, - TaskName{"jet-finder-charged-d0-qa"})); - - tasks.emplace_back(adaptAnalysisTask(cfgc, - SetDefaultProcesses{}, - TaskName{"jet-finder-charged-lc-qa"})); - - tasks.emplace_back(adaptAnalysisTask(cfgc, - SetDefaultProcesses{}, - TaskName{"jet-finder-charged-dielectron-qa"})); - - // tasks.emplace_back(adaptAnalysisTask(cfgc, - // SetDefaultProcesses{}, - // TaskName{"jet-finder-charged-bplus-qa"})); - - return WorkflowSpec{tasks}; -} diff --git a/PWGJE/Tasks/jetFinderLcQA.cxx b/PWGJE/Tasks/jetFinderLcQA.cxx new file mode 100644 index 00000000000..311086c86c8 --- /dev/null +++ b/PWGJE/Tasks/jetFinderLcQA.cxx @@ -0,0 +1,27 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet finder Lc charged QA task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetFinderHFQA.cxx" + +using JetFinderLcQATask = JetFinderHFQATask; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{}, + TaskName{"jet-finder-charged-lc-qa"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetfinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx similarity index 100% rename from PWGJE/Tasks/jetfinderQA.cxx rename to PWGJE/Tasks/jetFinderQA.cxx diff --git a/PWGJE/Tasks/jetfinderv0QA.cxx b/PWGJE/Tasks/jetFinderV0QA.cxx similarity index 100% rename from PWGJE/Tasks/jetfinderv0QA.cxx rename to PWGJE/Tasks/jetFinderV0QA.cxx diff --git a/PWGJE/Tasks/jetfragmentation.cxx b/PWGJE/Tasks/jetFragmentation.cxx similarity index 100% rename from PWGJE/Tasks/jetfragmentation.cxx rename to PWGJE/Tasks/jetFragmentation.cxx diff --git a/PWGJE/Tasks/jetmatchingqa.cxx b/PWGJE/Tasks/jetMatchingQA.cxx similarity index 100% rename from PWGJE/Tasks/jetmatchingqa.cxx rename to PWGJE/Tasks/jetMatchingQA.cxx diff --git a/PWGJE/Tasks/jetplanarflow.cxx b/PWGJE/Tasks/jetPlanarFlow.cxx similarity index 100% rename from PWGJE/Tasks/jetplanarflow.cxx rename to PWGJE/Tasks/jetPlanarFlow.cxx diff --git a/PWGJE/Tasks/jetsubstructure.cxx b/PWGJE/Tasks/jetSubstructure.cxx similarity index 100% rename from PWGJE/Tasks/jetsubstructure.cxx rename to PWGJE/Tasks/jetSubstructure.cxx diff --git a/PWGJE/Tasks/jetSubstructureD0.cxx b/PWGJE/Tasks/jetSubstructureD0.cxx new file mode 100644 index 00000000000..96760654a3a --- /dev/null +++ b/PWGJE/Tasks/jetSubstructureD0.cxx @@ -0,0 +1,27 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet substructure D0 charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetSubstructureHF.cxx" + +using JetSubstructureD0 = JetSubstructureHFTask, soa::Join, soa::Join, soa::Join, aod::CandidatesD0Data, aod::CandidatesD0MCP, aod::D0CJetSSs, aod::D0CMCDJetSSs, aod::D0CMCPJetSSs, aod::D0CEWSJetSSs, aod::JTrackD0Subs>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{}, + TaskName{"jet-substructure-d0"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetSubstructureD0Output.cxx b/PWGJE/Tasks/jetSubstructureD0Output.cxx new file mode 100644 index 00000000000..d53894fba01 --- /dev/null +++ b/PWGJE/Tasks/jetSubstructureD0Output.cxx @@ -0,0 +1,26 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet substructure output D0 charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetSubstructureHFOutput.cxx" + +using JetSubstructureOutputD0 = JetSubstructureHFOutputTask, aod::CandidatesD0Data, aod::CandidatesD0MCD, aod::CandidatesD0MCP, aod::JTrackD0Subs, soa::Join, soa::Join, aod::D0CJetCOs, aod::D0CJetOs, aod::D0CJetSSOs, aod::D0CJetMOs, soa::Join, aod::D0CMCDJetCOs, aod::D0CMCDJetOs, aod::D0CMCDJetSSOs, aod::D0CMCDJetMOs, soa::Join, aod::D0CMCPJetCOs, aod::D0CMCPJetOs, aod::D0CMCPJetSSOs, aod::D0CMCPJetMOs, soa::Join, aod::D0CEWSJetCOs, aod::D0CEWSJetOs, aod::D0CEWSJetSSOs, aod::D0CEWSJetMOs, aod::StoredHfD0CollBase, aod::StoredHfD0Bases, aod::StoredHfD0Pars, aod::StoredHfD0ParEs, aod::StoredHfD0Sels, aod::StoredHfD0Mls, aod::StoredHfD0Mcs, aod::StoredHfD0McCollBases, aod::StoredHfD0McRCollIds, aod::StoredHfD0PBases>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-substructure-d0-output"})); + + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetSubstructureDielectron.cxx b/PWGJE/Tasks/jetSubstructureDielectron.cxx new file mode 100644 index 00000000000..e5532cce52e --- /dev/null +++ b/PWGJE/Tasks/jetSubstructureDielectron.cxx @@ -0,0 +1,27 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet substructure Dielectron charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetSubstructureHF.cxx" + +using JetSubstructureDielectron = JetSubstructureHFTask, soa::Join, soa::Join, soa::Join, aod::CandidatesDielectronData, aod::CandidatesDielectronMCP, aod::DielectronCJetSSs, aod::DielectronCMCDJetSSs, aod::DielectronCMCPJetSSs, aod::DielectronCEWSJetSSs, aod::JTrackDielectronSubs>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{}, + TaskName{"jet-substructure-dielectron"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetSubstructureDielectronOutput.cxx b/PWGJE/Tasks/jetSubstructureDielectronOutput.cxx new file mode 100644 index 00000000000..2e1e7eb12df --- /dev/null +++ b/PWGJE/Tasks/jetSubstructureDielectronOutput.cxx @@ -0,0 +1,26 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet substructure output Dielectron charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetSubstructureHFOutput.cxx" + +using JetSubstructureOutputDielectron = JetSubstructureHFOutputTask, soa::Join, aod::DielectronCJetCOs, aod::DielectronCJetOs, aod::DielectronCJetSSOs, aod::DielectronCJetMOs, soa::Join, aod::DielectronCMCDJetCOs, aod::DielectronCMCDJetOs, aod::DielectronCMCDJetSSOs, aod::DielectronCMCDJetMOs, soa::Join, aod::DielectronCMCPJetCOs, aod::DielectronCMCPJetOs, aod::DielectronCMCPJetSSOs, aod::DielectronCMCPJetMOs, soa::Join, aod::DielectronCEWSJetCOs, aod::DielectronCEWSJetOs, aod::DielectronCEWSJetSSOs, aod::DielectronCEWSJetMOs, aod::StoredReducedEvents, aod::StoredDielectrons, aod::JDielectron1Dummys, aod::JDielectron2Dummys, aod::JDielectron3Dummys, aod::JDielectron4Dummys, aod::JDielectron5Dummys, aod::StoredJDielectronMcCollisions, aod::JDielectron6Dummys, aod::StoredJDielectronMcs>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-substructure-dielectron-output"})); + + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetsubstructurehf.cxx b/PWGJE/Tasks/jetSubstructureHF.cxx similarity index 84% rename from PWGJE/Tasks/jetsubstructurehf.cxx rename to PWGJE/Tasks/jetSubstructureHF.cxx index c20515e9618..16bcd3acd13 100644 --- a/PWGJE/Tasks/jetsubstructurehf.cxx +++ b/PWGJE/Tasks/jetSubstructureHF.cxx @@ -14,6 +14,8 @@ /// \author Nima Zardoshti // +#include + #include "fastjet/PseudoJet.hh" #include "fastjet/ClusterSequenceArea.hh" @@ -289,31 +291,4 @@ struct JetSubstructureHFTask { } PROCESS_SWITCH(JetSubstructureHFTask, processChargedJetsMCP, "HF jet substructure on MC particle level", false); }; -using JetSubstructureD0 = JetSubstructureHFTask, soa::Join, soa::Join, soa::Join, aod::CandidatesD0Data, aod::CandidatesD0MCP, aod::D0CJetSSs, aod::D0CMCDJetSSs, aod::D0CMCPJetSSs, aod::D0CEWSJetSSs, aod::JTrackD0Subs>; -using JetSubstructureLc = JetSubstructureHFTask, soa::Join, soa::Join, soa::Join, aod::CandidatesLcData, aod::CandidatesLcMCP, aod::LcCJetSSs, aod::LcCMCDJetSSs, aod::LcCMCPJetSSs, aod::LcCEWSJetSSs, aod::JTrackLcSubs>; // using JetSubstructureBplus = JetSubstructureHFTask,soa::Join,soa::Join,soa::Join, aod::CandidatesBplusData, aod::CandidatesBplusMCP, aod::BplusCJetSSs,aod::BplusCMCDJetSSs,aod::BplusCMCPJetSSs, aod::BplusCEWSJetSSs, aod::JTrackBplusSubs>; -using JetSubstructureDielectron = JetSubstructureHFTask, soa::Join, soa::Join, soa::Join, aod::CandidatesDielectronData, aod::CandidatesDielectronMCP, aod::DielectronCJetSSs, aod::DielectronCMCDJetSSs, aod::DielectronCMCPJetSSs, aod::DielectronCEWSJetSSs, aod::JTrackDielectronSubs>; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - std::vector tasks; - - tasks.emplace_back(adaptAnalysisTask(cfgc, - SetDefaultProcesses{}, - TaskName{"jet-substructure-d0"})); - - tasks.emplace_back(adaptAnalysisTask(cfgc, - SetDefaultProcesses{}, - TaskName{"jet-substructure-lc"})); - - tasks.emplace_back(adaptAnalysisTask(cfgc, - SetDefaultProcesses{}, - TaskName{"jet-substructure-dielectron"})); - /* - - tasks.emplace_back(adaptAnalysisTask(cfgc, - SetDefaultProcesses{}, - TaskName{"jet-substructure-bplus"})); - */ - return WorkflowSpec{tasks}; -} diff --git a/PWGJE/Tasks/jetsubstructurehfoutput.cxx b/PWGJE/Tasks/jetSubstructureHFOutput.cxx similarity index 83% rename from PWGJE/Tasks/jetsubstructurehfoutput.cxx rename to PWGJE/Tasks/jetSubstructureHFOutput.cxx index a822d22b4f7..f0ca793c4a9 100644 --- a/PWGJE/Tasks/jetsubstructurehfoutput.cxx +++ b/PWGJE/Tasks/jetSubstructureHFOutput.cxx @@ -14,6 +14,8 @@ /// \author Nima Zardoshti // +#include + #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" #include "Framework/ASoA.h" @@ -497,19 +499,4 @@ struct JetSubstructureHFOutputTask { } PROCESS_SWITCH(JetSubstructureHFOutputTask, processOutputMatchingMC, "jet matching output MC", false); }; -using JetSubstructureOutputD0 = JetSubstructureHFOutputTask, aod::CandidatesD0Data, aod::CandidatesD0MCD, aod::CandidatesD0MCP, aod::JTrackD0Subs, soa::Join, soa::Join, aod::D0CJetCOs, aod::D0CJetOs, aod::D0CJetSSOs, aod::D0CJetMOs, soa::Join, aod::D0CMCDJetCOs, aod::D0CMCDJetOs, aod::D0CMCDJetSSOs, aod::D0CMCDJetMOs, soa::Join, aod::D0CMCPJetCOs, aod::D0CMCPJetOs, aod::D0CMCPJetSSOs, aod::D0CMCPJetMOs, soa::Join, aod::D0CEWSJetCOs, aod::D0CEWSJetOs, aod::D0CEWSJetSSOs, aod::D0CEWSJetMOs, aod::StoredHfD0CollBase, aod::StoredHfD0Bases, aod::StoredHfD0Pars, aod::StoredHfD0ParEs, aod::StoredHfD0Sels, aod::StoredHfD0Mls, aod::StoredHfD0Mcs, aod::StoredHfD0McCollBases, aod::StoredHfD0McRCollIds, aod::StoredHfD0PBases>; -using JetSubstructureOutputLc = JetSubstructureHFOutputTask, aod::CandidatesLcData, aod::CandidatesLcMCD, aod::CandidatesLcMCP, aod::JTrackLcSubs, soa::Join, soa::Join, aod::LcCJetCOs, aod::LcCJetOs, aod::LcCJetSSOs, aod::LcCJetMOs, soa::Join, aod::LcCMCDJetCOs, aod::LcCMCDJetOs, aod::LcCMCDJetSSOs, aod::LcCMCDJetMOs, soa::Join, aod::LcCMCPJetCOs, aod::LcCMCPJetOs, aod::LcCMCPJetSSOs, aod::LcCMCPJetMOs, soa::Join, aod::LcCEWSJetCOs, aod::LcCEWSJetOs, aod::LcCEWSJetSSOs, aod::LcCEWSJetMOs, aod::StoredHf3PCollBase, aod::StoredHf3PBases, aod::StoredHf3PPars, aod::StoredHf3PParEs, aod::StoredHf3PSels, aod::StoredHf3PMls, aod::StoredHf3PMcs, aod::StoredHf3PMcCollBases, aod::StoredHf3PMcRCollIds, aod::StoredHf3PPBases>; // using JetSubstructureOutputBplus = JetSubstructureHFOutputTask, aod::CandidatesBplusData, aod::CandidatesBplusMCD, aod::CandidatesBplusMCP, aod::JTrackBplusSubs, soa::Join, soa::Join, aod::BplusCJetCOs, aod::BplusCJetOs, aod::BplusCJetSSOs, aod::BplusCJetMOs, soa::Join, aod::BplusCMCDJetCOs, aod::BplusCMCDJetOs, aod::BplusCMCDJetSSOs, aod::BplusCMCDJetMOs, soa::Join, aod::BplusCMCPJetCOs, aod::BplusCMCPJetOs, aod::BplusCMCPJetSSOs, aod::BplusCMCPJetMOs, soa::Join, aod::BplusCEWSJetCOs, aod::BplusCEWSJetOs, aod::BplusCEWSJetSSOs, aod::BplusCEWSJetMOs, aod::StoredHfBplusCollBase, aod::StoredHfBplusBases, aod::StoredHfBplusPars, aod::StoredHfBplusParEs, aod::StoredHfBplusSels, aod::StoredHfBplusMls, aod::StoredHfBplusMcs, aod::StoredHfBplusPBases>; -using JetSubstructureOutputDielectron = JetSubstructureHFOutputTask, soa::Join, aod::DielectronCJetCOs, aod::DielectronCJetOs, aod::DielectronCJetSSOs, aod::DielectronCJetMOs, soa::Join, aod::DielectronCMCDJetCOs, aod::DielectronCMCDJetOs, aod::DielectronCMCDJetSSOs, aod::DielectronCMCDJetMOs, soa::Join, aod::DielectronCMCPJetCOs, aod::DielectronCMCPJetOs, aod::DielectronCMCPJetSSOs, aod::DielectronCMCPJetMOs, soa::Join, aod::DielectronCEWSJetCOs, aod::DielectronCEWSJetOs, aod::DielectronCEWSJetSSOs, aod::DielectronCEWSJetMOs, aod::StoredReducedEvents, aod::StoredDielectrons, aod::JDielectron1Dummys, aod::JDielectron2Dummys, aod::JDielectron3Dummys, aod::JDielectron4Dummys, aod::JDielectron5Dummys, aod::StoredJDielectronMcCollisions, aod::JDielectron6Dummys, aod::StoredJDielectronMcs>; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - std::vector tasks; - - tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-substructure-d0-output"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-substructure-lc-output"})); - // tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-substructure-bplus-output"})); - tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-substructure-dielectron-output"})); - - return WorkflowSpec{tasks}; -} diff --git a/PWGJE/Tasks/jetSubstructureLc.cxx b/PWGJE/Tasks/jetSubstructureLc.cxx new file mode 100644 index 00000000000..dc985515164 --- /dev/null +++ b/PWGJE/Tasks/jetSubstructureLc.cxx @@ -0,0 +1,27 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet substructure Lc charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetSubstructureHF.cxx" + +using JetSubstructureLc = JetSubstructureHFTask, soa::Join, soa::Join, soa::Join, aod::CandidatesLcData, aod::CandidatesLcMCP, aod::LcCJetSSs, aod::LcCMCDJetSSs, aod::LcCMCPJetSSs, aod::LcCEWSJetSSs, aod::JTrackLcSubs>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{}, + TaskName{"jet-substructure-lc"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetSubstructureLcOutput.cxx b/PWGJE/Tasks/jetSubstructureLcOutput.cxx new file mode 100644 index 00000000000..34361a1148e --- /dev/null +++ b/PWGJE/Tasks/jetSubstructureLcOutput.cxx @@ -0,0 +1,26 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet substructure output Lc charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetSubstructureHFOutput.cxx" + +using JetSubstructureOutputLc = JetSubstructureHFOutputTask, aod::CandidatesLcData, aod::CandidatesLcMCD, aod::CandidatesLcMCP, aod::JTrackLcSubs, soa::Join, soa::Join, aod::LcCJetCOs, aod::LcCJetOs, aod::LcCJetSSOs, aod::LcCJetMOs, soa::Join, aod::LcCMCDJetCOs, aod::LcCMCDJetOs, aod::LcCMCDJetSSOs, aod::LcCMCDJetMOs, soa::Join, aod::LcCMCPJetCOs, aod::LcCMCPJetOs, aod::LcCMCPJetSSOs, aod::LcCMCPJetMOs, soa::Join, aod::LcCEWSJetCOs, aod::LcCEWSJetOs, aod::LcCEWSJetSSOs, aod::LcCEWSJetMOs, aod::StoredHf3PCollBase, aod::StoredHf3PBases, aod::StoredHf3PPars, aod::StoredHf3PParEs, aod::StoredHf3PSels, aod::StoredHf3PMls, aod::StoredHf3PMcs, aod::StoredHf3PMcCollBases, aod::StoredHf3PMcRCollIds, aod::StoredHf3PPBases>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-substructure-lc-output"})); + + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetsubstructureoutput.cxx b/PWGJE/Tasks/jetSubstructureOutput.cxx similarity index 100% rename from PWGJE/Tasks/jetsubstructureoutput.cxx rename to PWGJE/Tasks/jetSubstructureOutput.cxx diff --git a/PWGJE/Tasks/jettaggerhfQA.cxx b/PWGJE/Tasks/jetTaggerHFQA.cxx similarity index 100% rename from PWGJE/Tasks/jettaggerhfQA.cxx rename to PWGJE/Tasks/jetTaggerHFQA.cxx diff --git a/PWGJE/Tasks/jetvalidationqa.cxx b/PWGJE/Tasks/jetValidationQA.cxx similarity index 99% rename from PWGJE/Tasks/jetvalidationqa.cxx rename to PWGJE/Tasks/jetValidationQA.cxx index c608c9c256c..261bea68571 100644 --- a/PWGJE/Tasks/jetvalidationqa.cxx +++ b/PWGJE/Tasks/jetValidationQA.cxx @@ -437,7 +437,7 @@ struct mcJetTrackCollisionQa { mHistManager.fill(HIST("selectedTrackEta"), track.eta()); } } // end of tracks loop - } // end of mcTrack template + } // end of mcTrack template template void fillMcDetJets(detectorJet const& mcdJet) @@ -496,7 +496,7 @@ struct mcJetTrackCollisionQa { } } } // end of loop particle level jets - } // end if has mc collision + } // end if has mc collision fillMcTrackHistos(tracks, collision, false); for (const auto& detJet : mcDetJets) { if (detJet.collisionId() == collision.globalIndex()) { @@ -506,7 +506,7 @@ struct mcJetTrackCollisionQa { } } } // end of loop detector level jets - } // end processMcRun2 + } // end processMcRun2 PROCESS_SWITCH(mcJetTrackCollisionQa, processMcRun2, "validate jet-finder output on converted run2 mc AOD's", false); void processMcRun3(aod::JetCollisionsMCD::iterator const& collision, @@ -530,7 +530,7 @@ struct mcJetTrackCollisionQa { } } } // end of loop particle level jets - } // end of loop if mc collision + } // end of loop if mc collision fillMcTrackHistos(tracks, collision, false); for (const auto& detJet : mcDetJets) { if (detJet.collisionId() == collision.globalIndex()) { @@ -540,7 +540,7 @@ struct mcJetTrackCollisionQa { } } } // end of loop detector level jets - } // end processMcRun3 + } // end processMcRun3 PROCESS_SWITCH(mcJetTrackCollisionQa, processMcRun3, "validate jet-finder output on run3 mc AOD's", false); // dummy process to run jetfinder validation code on AO2D's, but MC validation for run3 on hyperloop diff --git a/PWGJE/Tasks/mcgeneratorstudies.cxx b/PWGJE/Tasks/mcGeneratorStudies.cxx similarity index 100% rename from PWGJE/Tasks/mcgeneratorstudies.cxx rename to PWGJE/Tasks/mcGeneratorStudies.cxx diff --git a/PWGJE/Tasks/nSubjettiness.cxx b/PWGJE/Tasks/nsubjettiness.cxx similarity index 100% rename from PWGJE/Tasks/nSubjettiness.cxx rename to PWGJE/Tasks/nsubjettiness.cxx diff --git a/PWGJE/Tasks/PhotonIsolationQA.cxx b/PWGJE/Tasks/photonIsolationQA.cxx similarity index 100% rename from PWGJE/Tasks/PhotonIsolationQA.cxx rename to PWGJE/Tasks/photonIsolationQA.cxx diff --git a/PWGJE/Tasks/trackJetqa.cxx b/PWGJE/Tasks/trackJetQA.cxx similarity index 100% rename from PWGJE/Tasks/trackJetqa.cxx rename to PWGJE/Tasks/trackJetQA.cxx diff --git a/PWGJE/Tasks/v0jetspectra.cxx b/PWGJE/Tasks/v0JetSpectra.cxx similarity index 100% rename from PWGJE/Tasks/v0jetspectra.cxx rename to PWGJE/Tasks/v0JetSpectra.cxx diff --git a/PWGJE/Tasks/v0qa.cxx b/PWGJE/Tasks/v0QA.cxx similarity index 100% rename from PWGJE/Tasks/v0qa.cxx rename to PWGJE/Tasks/v0QA.cxx From 41964d6cead08aaf7e9f0c90b1fd8360ea1ca14a Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Wed, 27 Nov 2024 00:08:57 +0100 Subject: [PATCH 123/459] [Common] centrality study extras (#8667) Co-authored-by: ALICE Builder --- Common/DataModel/Multiplicity.h | 22 +++++++- .../TableProducer/Converters/CMakeLists.txt | 4 ++ .../Converters/multMCExtrasConverter.cxx | 38 ++++++++++++++ Common/TableProducer/multiplicityTable.cxx | 16 +++++- Common/Tasks/centralityStudy.cxx | 52 +++++++++++++++++-- 5 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 Common/TableProducer/Converters/multMCExtrasConverter.cxx diff --git a/Common/DataModel/Multiplicity.h b/Common/DataModel/Multiplicity.h index 3583095ee67..d6ffe63e2b4 100644 --- a/Common/DataModel/Multiplicity.h +++ b/Common/DataModel/Multiplicity.h @@ -48,6 +48,9 @@ DECLARE_SOA_DYNAMIC_COLUMN(IsInelGt1, isInelGt1, //! is INEL > 1 // MC DECLARE_SOA_COLUMN(MultMCFT0A, multMCFT0A, int); //! DECLARE_SOA_COLUMN(MultMCFT0C, multMCFT0C, int); //! +DECLARE_SOA_COLUMN(MultMCFV0A, multMCFV0A, int); //! +DECLARE_SOA_COLUMN(MultMCFDDA, multMCFDDA, int); //! +DECLARE_SOA_COLUMN(MultMCFDDC, multMCFDDC, int); //! DECLARE_SOA_COLUMN(MultMCNParticlesEta10, multMCNParticlesEta10, int); //! DECLARE_SOA_COLUMN(MultMCNParticlesEta08, multMCNParticlesEta08, int); //! DECLARE_SOA_COLUMN(MultMCNParticlesEta05, multMCNParticlesEta05, int); //! @@ -144,7 +147,7 @@ DECLARE_SOA_TABLE(MultSelections, "AOD", "MULTSELECTIONS", //! using MultExtra = MultsExtra::iterator; // mc collisions table - indexed to Mult -DECLARE_SOA_TABLE(MultMCExtras, "AOD", "MULTMCEXTRA", //! Table for the MC information +DECLARE_SOA_TABLE(MultMCExtras_000, "AOD", "MULTMCEXTRA", //! Table for MC information mult::MultMCFT0A, mult::MultMCFT0C, mult::MultMCNParticlesEta05, @@ -154,6 +157,23 @@ DECLARE_SOA_TABLE(MultMCExtras, "AOD", "MULTMCEXTRA", //! Table for the MC infor mult::IsInelGt0, mult::IsInelGt1, o2::soa::Marker<1>); + +// mc collisions table - indexed to Mult +DECLARE_SOA_TABLE_VERSIONED(MultMCExtras_001, "AOD", "MULTMCEXTRA", 1, //! Table for MC information + mult::MultMCFT0A, + mult::MultMCFT0C, + mult::MultMCFV0A, + mult::MultMCFDDA, + mult::MultMCFDDC, + mult::MultMCNParticlesEta05, + mult::MultMCNParticlesEta08, + mult::MultMCNParticlesEta10, + mult::MultMCPVz, + mult::IsInelGt0, + mult::IsInelGt1, + o2::soa::Marker<1>); + +using MultMCExtras = MultMCExtras_001; using MultMCExtra = MultMCExtras::iterator; using MultsExtraMC = MultMCExtras; // for backwards compatibility with previous naming scheme diff --git a/Common/TableProducer/Converters/CMakeLists.txt b/Common/TableProducer/Converters/CMakeLists.txt index 8f48851df90..48aba0a771a 100644 --- a/Common/TableProducer/Converters/CMakeLists.txt +++ b/Common/TableProducer/Converters/CMakeLists.txt @@ -79,3 +79,7 @@ o2physics_add_dpl_workflow(multsextra-converter PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(multmcextras-converter + SOURCES multMCExtrasConverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/Common/TableProducer/Converters/multMCExtrasConverter.cxx b/Common/TableProducer/Converters/multMCExtrasConverter.cxx new file mode 100644 index 00000000000..ac2c074ba1b --- /dev/null +++ b/Common/TableProducer/Converters/multMCExtrasConverter.cxx @@ -0,0 +1,38 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Common/DataModel/Multiplicity.h" + +using namespace o2; +using namespace o2::framework; + +struct MultMCExtrasConverter { + Produces multMCExtras_001; + void process(aod::MultMCExtras_000 const& multMCExtras_000) + { + for (const auto& r : multMCExtras_000) { + multMCExtras_001(r.multMCFT0A(), r.multMCFT0C(), 0, 0, 0, + r.multMCNParticlesEta05(), + r.multMCNParticlesEta08(), + r.multMCNParticlesEta10(), + r.multMCPVz()); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/Common/TableProducer/multiplicityTable.cxx b/Common/TableProducer/multiplicityTable.cxx index 30ae0c226fd..ff1ea2e492d 100644 --- a/Common/TableProducer/multiplicityTable.cxx +++ b/Common/TableProducer/multiplicityTable.cxx @@ -9,6 +9,11 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include ; +#include ; +#include ; +#include ; + #include "Framework/ConfigParamSpec.h" #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -634,7 +639,10 @@ struct MultiplicityTable { void processMC(aod::McCollision const& mcCollision, mcParticlesFiltered const& mcParticles) { int multFT0A = 0; + int multFV0A = 0; int multFT0C = 0; + int multFDDA = 0; + int multFDDC = 0; int multBarrelEta05 = 0; int multBarrelEta08 = 0; int multBarrelEta10 = 0; @@ -665,8 +673,14 @@ struct MultiplicityTable { multFT0C++; if (3.5 < mcPart.eta() && mcPart.eta() < 4.9) multFT0A++; + if (2.2 < mcPart.eta() && mcPart.eta() < 5.0) + multFV0A++; + if (-6.9 < mcPart.eta() && mcPart.eta() < -4.9) + multFDDC++; + if (4.7 < mcPart.eta() && mcPart.eta() < 6.3) + multFDDA++; } - tableExtraMc(multFT0A, multFT0C, multBarrelEta05, multBarrelEta08, multBarrelEta10, mcCollision.posZ()); + tableExtraMc(multFT0A, multFT0C, multFV0A, multFDDA, multFDDC, multBarrelEta05, multBarrelEta08, multBarrelEta10, mcCollision.posZ()); } void processMC2Mults(soa::Join::iterator const& collision) diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index 9d5fe997fbc..629867e2984 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -65,8 +65,16 @@ struct centralityStudy { Configurable scaleSignalFT0M{"scaleSignalFT0M", 1.00f, "scale FT0M signal for convenience"}; Configurable scaleSignalFV0A{"scaleSignalFV0A", 1.00f, "scale FV0A signal for convenience"}; - // Configurable Axes - ConfigurableAxis axisMultFT0C{"axisMultFT0C", {2000, 0, 100000}, "FT0C amplitude"}; + // reject low zna/c + Configurable minZNACsignal{"minZNACsignal", 15.0f, "min zna/c signal"}; + Configurable maxFT0CforZNACselection{"maxFT0CforZNACselection", 35000.0f, "max ft0c signal for minZNACsignal to work"}; + + // Configurable Axes for 2d plots, etc + ConfigurableAxis axisMultFV0A{"axisMultFV0A", {1000, 0, 100000}, "FV0A amplitude"}; + ConfigurableAxis axisMultFT0A{"axisMultFT0A", {1000, 0, 100000}, "FT0A amplitude"}; + ConfigurableAxis axisMultFT0C{"axisMultFT0C", {1000, 0, 100000}, "FT0C amplitude"}; + ConfigurableAxis axisMultFDDA{"axisMultFDDA", {1000, 0, 100000}, "FDDA amplitude"}; + ConfigurableAxis axisMultFDDC{"axisMultFDDC", {1000, 0, 100000}, "FDDC amplitude"}; ConfigurableAxis axisMultPVContributors{"axisMultPVContributors", {200, 0, 6000}, "Number of PV Contributors"}; // For one-dimensional plots, where binning is no issue @@ -86,6 +94,8 @@ struct centralityStudy { // For profile Z ConfigurableAxis axisPVz{"axisPVz", {400, -20.0f, +20.0f}, "PVz (cm)"}; + ConfigurableAxis axisZN{"axisZN", {1100, -50.0f, +500.0f}, "ZN"}; + void init(InitContext&) { if (doprocessCollisions || doprocessCollisionsWithCentrality) { @@ -124,11 +134,20 @@ struct centralityStudy { histos.add("hFT0CvsPVz_BCs", "hFT0CvsPVz_BCs", kTProfile, {axisPVz}); histos.add("hVertexZ_BCvsCO", "hVertexZ_BCvsCO", kTH2D, {axisPVz, axisPVz}); + + histos.add("hZNAvsFT0C_BCs", "hZNAvsFT0C_BCs", kTH2D, {axisMultFT0C, axisZN}); + histos.add("hZNCvsFT0C_BCs", "hZNCvsFT0C_BCs", kTH2D, {axisMultFT0C, axisZN}); } if (do2DPlots) { - histos.add("hFT0CvsNContribs", "hFT0CvsNContribs", kTH2F, {axisMultPVContributors, axisMultFT0C}); + histos.add("hNContribsVsFT0C", "hNContribsVsFT0C", kTH2F, {axisMultFT0C, axisMultPVContributors}); histos.add("hMatchedVsITSOnly", "hMatchedVsITSOnly", kTH2F, {axisMultITSOnly, axisMultITSTPC}); + + // 2d correlation of fit signals + histos.add("hFT0AVsFT0C", "hFT0AVsFT0C", kTH2F, {axisMultFT0C, axisMultFT0A}); + histos.add("hFV0AVsFT0C", "hFV0AVsFT0C", kTH2F, {axisMultFT0C, axisMultFV0A}); + histos.add("hFDDAVsFT0C", "hFDDAVsFT0C", kTH2F, {axisMultFT0C, axisMultFDDA}); + histos.add("hFDDCVsFT0C", "hFDDCVsFT0C", kTH2F, {axisMultFT0C, axisMultFDDC}); } if (doprocessCollisionsWithCentrality) { @@ -225,6 +244,13 @@ struct centralityStudy { } histos.fill(HIST("hCollisionSelection"), 14 /* Not ITS ROF pileup (strict) */); + if (collision.multFT0C() < maxFT0CforZNACselection && + collision.multZNA() < minZNACsignal && + collision.multZNC() < minZNACsignal) { + return; + } + histos.fill(HIST("hCollisionSelection"), 15 /* pass em/upc rejection */); + // if we got here, we also finally fill the FT0C histogram, please histos.fill(HIST("hNPVContributors"), collision.multPVTotalContributors()); histos.fill(HIST("hFT0C_Collisions"), collision.multFT0C() * scaleSignalFT0C); @@ -235,8 +261,14 @@ struct centralityStudy { histos.fill(HIST("hFT0CvsPVz_Collisions"), collision.multPVz(), collision.multFT0C() * scaleSignalFT0C); } if (do2DPlots) { - histos.fill(HIST("hFT0CvsNContribs"), collision.multNTracksPV(), collision.multFT0C() * scaleSignalFT0C); + histos.fill(HIST("hNContribsVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multPVTotalContributors()); histos.fill(HIST("hMatchedVsITSOnly"), collision.multNTracksITSOnly(), collision.multNTracksITSTPC()); + + // correlate also FIT detector signals + histos.fill(HIST("hFT0AVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multFT0A()); + histos.fill(HIST("hFV0AVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multFV0A()); + histos.fill(HIST("hFDDAVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multFDDA()); + histos.fill(HIST("hFDDCVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multFDDC()); } // if the table has centrality information @@ -288,8 +320,20 @@ struct centralityStudy { } histos.fill(HIST("hBCSelection"), 4); // FV0OrA + if (multbc.multBCFT0C() < maxFT0CforZNACselection && + multbc.multBCZNA() < minZNACsignal && + multbc.multBCZNC() < minZNACsignal) { + return; + } + histos.fill(HIST("hBCSelection"), 5); // znac + // if we got here, we also finally fill the FT0C histogram, please histos.fill(HIST("hFT0C_BCs"), multbc.multBCFT0C() * scaleSignalFT0C); + + // ZN signals + histos.fill(HIST("hZNAvsFT0C_BCs"), multbc.multBCFT0C() * scaleSignalFT0C, multbc.multBCZNA()); + histos.fill(HIST("hZNCvsFT0C_BCs"), multbc.multBCFT0C() * scaleSignalFT0C, multbc.multBCZNC()); + histos.fill(HIST("hFT0M_BCs"), (multbc.multBCFT0A() + multbc.multBCFT0C()) * scaleSignalFT0M); histos.fill(HIST("hFV0A_BCs"), multbc.multBCFV0A() * scaleSignalFV0A); if (multbc.multBCFT0PosZValid()) { From f9234851765fe0136ec6e1d181367e2841fe6230 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Wed, 27 Nov 2024 07:56:39 +0100 Subject: [PATCH 124/459] [PWGLF] added histogram to monitor run dependent variations of vxy and commented few section of code (#8580) Co-authored-by: Prottay Das --- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 97 +++++++++++++++---------- 1 file changed, 59 insertions(+), 38 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index 313a6747148..1635fd74e33 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -73,7 +73,8 @@ struct lambdapolsp { Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; Configurable additionalEvSel2{"additionalEvSel2", false, "additionalEvSel2"}; Configurable additionalEvSel3{"additionalEvSel3", false, "additionalEvSel3"}; - Configurable correction{"correction", false, "fill histograms including corrections"}; + Configurable correction1{"correction1", false, "fill histograms including corrections 1"}; + Configurable correction2{"correction2", false, "fill histograms including corrections 2"}; Configurable QA{"QA", false, "flag for QA"}; Configurable mycut{"mycut", false, "select tracks based on my cuts"}; Configurable tofhit{"tofhit", true, "select tracks based on tof hit"}; @@ -143,10 +144,13 @@ struct lambdapolsp { Configurable spNbins{"spNbins", 2000, "Number of bins in sp"}; Configurable lbinsp{"lbinsp", -1.0, "lower bin value in sp histograms"}; Configurable hbinsp{"hbinsp", 1.0, "higher bin value in sp histograms"}; + Configurable phiNbins{"phiNbins", 30, "Number of bins in phi"}; ConfigurableAxis configcentAxis{"configcentAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "Cent V0M"}; ConfigurableAxis configthnAxispT{"configthnAxisPt", {VARIABLE_WIDTH, 0.2, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.5, 8.0, 10.0, 100.0}, "#it{p}_{T} (GeV/#it{c})"}; - ConfigurableAxis configetaAxis{"configetaAxis", {VARIABLE_WIDTH, -0.8, -0.4, 0, 0.4, 0.8}, "Eta"}; + ConfigurableAxis configetaAxis{"configetaAxis", {VARIABLE_WIDTH, -0.8, -0.4, -0.2, 0, 0.2, 0.4, 0.8}, "Eta"}; + ConfigurableAxis configthnAxisPol{"configthnAxisPol", {VARIABLE_WIDTH, -1.0, -0.6, -0.2, 0, 0.2, 0.4, 0.8}, "Pol"}; + ConfigurableAxis configphiAxis{"configphiAxis", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.8, 1.0, 2.0, 2.5, 3.0, 4.0, 5.0, 5.5, 6.28}, "PhiAxis"}; SliceCache cache; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -154,6 +158,7 @@ struct lambdapolsp { void init(o2::framework::InitContext&) { AxisSpec thnAxispT{ptNbins, lbinpt, hbinpt, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec thnAxisRap{100, -0.5, 0.5, "Rapidity"}; AxisSpec thnAxisres{resNbins, lbinres, hbinres, "Reso"}; AxisSpec thnAxisInvMass{IMNbins, lbinIM, hbinIM, "#it{M} (GeV/#it{c}^{2})"}; AxisSpec thnAxisPol{PolNbins, lbinPol, hbinPol, "Sin(#phi - #psi)"}; @@ -162,7 +167,7 @@ struct lambdapolsp { AxisSpec etaAxis = {etaNbins, lbineta, hbineta, "Eta"}; AxisSpec spAxis = {spNbins, lbinsp, hbinsp, "Sp"}; AxisSpec qxZDCAxis = {QxyNbins, lbinQxy, hbinQxy, "Qx"}; - // AxisSpec psiACAxis = {120, -6.28, 6.28, "psiAC"}; + AxisSpec phiAxis = {phiNbins, 0.0, 6.28, "phi-phiStar"}; if (checkwithpub) { if (useprofile == 1) { @@ -222,29 +227,36 @@ struct lambdapolsp { if (!checkwithpub) { // histos.add("hVtxZ", "Vertex distribution in Z;Z (cm)", kTH1F, {{20, -10.0, 10.0}}); - histos.add("hpRes", "hpRes", HistType::kTHnSparseF, {centAxis, thnAxisres}); + histos.add("hpRes", "hpRes", HistType::kTHnSparseF, {configcentAxis, thnAxisres}); if (QA) { - histos.add("hpResSin", "hpResSin", HistType::kTHnSparseF, {centAxis, thnAxisres}); - histos.add("hpCosPsiA", "hpCosPsiA", HistType::kTHnSparseF, {centAxis, thnAxisres}); - histos.add("hpCosPsiC", "hpCosPsiC", HistType::kTHnSparseF, {centAxis, thnAxisres}); - histos.add("hpSinPsiA", "hpSinPsiA", HistType::kTHnSparseF, {centAxis, thnAxisres}); - histos.add("hpSinPsiC", "hpSinPsiC", HistType::kTHnSparseF, {centAxis, thnAxisres}); - histos.add("hcentQxZDCA", "hcentQxZDCA", kTH2F, {{centAxis}, {qxZDCAxis}}); + histos.add("hpResSin", "hpResSin", HistType::kTHnSparseF, {configcentAxis, thnAxisres}); + histos.add("hpCosPsiA", "hpCosPsiA", HistType::kTHnSparseF, {configcentAxis, thnAxisres}); + histos.add("hpCosPsiC", "hpCosPsiC", HistType::kTHnSparseF, {configcentAxis, thnAxisres}); + histos.add("hpSinPsiA", "hpSinPsiA", HistType::kTHnSparseF, {configcentAxis, thnAxisres}); + histos.add("hpSinPsiC", "hpSinPsiC", HistType::kTHnSparseF, {configcentAxis, thnAxisres}); + /*histos.add("hcentQxZDCA", "hcentQxZDCA", kTH2F, {{centAxis}, {qxZDCAxis}}); histos.add("hcentQyZDCA", "hcentQyZDCA", kTH2F, {{centAxis}, {qxZDCAxis}}); histos.add("hcentQxZDCC", "hcentQxZDCC", kTH2F, {{centAxis}, {qxZDCAxis}}); - histos.add("hcentQyZDCC", "hcentQyZDCC", kTH2F, {{centAxis}, {qxZDCAxis}}); + histos.add("hcentQyZDCC", "hcentQyZDCC", kTH2F, {{centAxis}, {qxZDCAxis}});*/ } - if (!correction) { - histos.add("hSparseLambdaPolA", "hSparseLambdaPolA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxispT, thnAxisPol, centAxis}, true); - histos.add("hSparseLambdaPolC", "hSparseLambdaPolC", HistType::kTHnSparseF, {thnAxisInvMass, thnAxispT, thnAxisPol, centAxis}, true); - histos.add("hSparseAntiLambdaPolA", "hSparseAntiLambdaPolA", HistType::kTHnSparseF, {thnAxisInvMass, thnAxispT, thnAxisPol, centAxis}, true); - histos.add("hSparseAntiLambdaPolC", "hSparseAntiLambdaPolC", HistType::kTHnSparseF, {thnAxisInvMass, thnAxispT, thnAxisPol, centAxis}, true); + histos.add("hSparseLambdaPolA", "hSparseLambdaPolA", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseLambdaPolC", "hSparseLambdaPolC", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseAntiLambdaPolA", "hSparseAntiLambdaPolA", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseAntiLambdaPolC", "hSparseAntiLambdaPolC", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + + if (correction1) { + histos.add("hSparseLambda_corr1a", "hSparseLambda_corr1a", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseLambda_corr1b", "hSparseLambda_corr1b", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseLambda_corr1c", "hSparseLambda_corr1c", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configphiAxis, configcentAxis}, true); + histos.add("hSparseAntiLambda_corr1a", "hSparseAntiLambda_corr1a", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseAntiLambda_corr1b", "hSparseAntiLambda_corr1b", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseAntiLambda_corr1c", "hSparseAntiLambda_corr1c", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configphiAxis, configcentAxis}, true); } - if (correction) { - histos.add("hSparseLambdaPolA_corr", "hSparseLambdaPolA_corr", HistType::kTHnSparseF, {thnAxisInvMass, thnAxispT, thnAxisCosThetaStar, thnAxisPol, thnAxisPol, thnAxisPol, centAxis}, true); - histos.add("hSparseLambdaPolC_corr", "hSparseLambdaPolC_corr", HistType::kTHnSparseF, {thnAxisInvMass, thnAxispT, thnAxisCosThetaStar, thnAxisPol, thnAxisPol, thnAxisPol, centAxis}, true); - histos.add("hSparseAntiLambdaPolA_corr", "hSparseAntiLambdaPolA_corr", HistType::kTHnSparseF, {thnAxisInvMass, thnAxispT, thnAxisCosThetaStar, thnAxisPol, thnAxisPol, thnAxisPol, centAxis}, true); - histos.add("hSparseAntiLambdaPolC_corr", "hSparseAntiLambdaPolC_corr", HistType::kTHnSparseF, {thnAxisInvMass, thnAxispT, thnAxisCosThetaStar, thnAxisPol, thnAxisPol, thnAxisPol, centAxis}, true); + if (correction2) { + histos.add("hSparseLambda_corr2a", "hSparseLambda_corr2a", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseLambda_corr2b", "hSparseLambda_corr2b", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseAntiLambda_corr2a", "hSparseAntiLambda_corr2a", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseAntiLambda_corr2b", "hSparseAntiLambda_corr2b", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); } } } @@ -395,8 +407,7 @@ struct lambdapolsp { return; } auto centrality = collision.centFT0C(); - - histos.fill(HIST("hCentrality0"), centrality); + // histos.fill(HIST("hCentrality0"), centrality); if (!collision.triggereventsp()) { return; } @@ -432,10 +443,10 @@ struct lambdapolsp { histos.fill(HIST("hpCosPsiC"), centrality, (TMath::Cos(GetPhiInRange(psiZDCC)))); histos.fill(HIST("hpSinPsiA"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA)))); histos.fill(HIST("hpSinPsiC"), centrality, (TMath::Sin(GetPhiInRange(psiZDCC)))); - histos.fill(HIST("hcentQxZDCA"), centrality, qxZDCA); + /*histos.fill(HIST("hcentQxZDCA"), centrality, qxZDCA); histos.fill(HIST("hcentQyZDCA"), centrality, qyZDCA); histos.fill(HIST("hcentQxZDCC"), centrality, qxZDCC); - histos.fill(HIST("hcentQyZDCC"), centrality, qyZDCC); + histos.fill(HIST("hcentQyZDCC"), centrality, qyZDCC);*/ } } @@ -574,30 +585,40 @@ struct lambdapolsp { // histos.fill(HIST("hphiminuspsiC"), (phiminuspsiC)); // auto cosThetaStar = eventplaneVecNorm.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(eventplaneVecNorm.Mag2()); auto cosThetaStar = fourVecDauCM.Pz() / fourVecDauCM.P(); // A0 correction + auto sinThetaStar = TMath::Sqrt(1 - (cosThetaStar * cosThetaStar)); auto PolC = TMath::Sin(phiminuspsiC); auto PolA = TMath::Sin(phiminuspsiA); // needed for corrections auto sinPhiStar = TMath::Sin(GetPhiInRange(phiangle)); auto cosPhiStar = TMath::Cos(GetPhiInRange(phiangle)); - // auto sinThetaStarcosphiphiStar=sinThetaStar*TMath::Cos(2* GetPhiInRange((Lambda.Phi()-phiangle))); //A2 correction + auto sinThetaStarcosphiphiStar = sinThetaStar * TMath::Cos(2 * GetPhiInRange(Lambda.Phi() - phiangle)); // A2 correction + auto phiphiStar = GetPhiInRange(Lambda.Phi() - phiangle); if (LambdaTag) { - if (correction) { - histos.fill(HIST("hSparseLambdaPolA_corr"), v0.mLambda(), v0.pt(), cosThetaStar, sinPhiStar, cosPhiStar, PolA, centrality); - histos.fill(HIST("hSparseLambdaPolC_corr"), v0.mLambda(), v0.pt(), cosThetaStar, sinPhiStar, cosPhiStar, PolC, centrality); - } else { - histos.fill(HIST("hSparseLambdaPolA"), v0.mLambda(), v0.pt(), PolA, centrality); - histos.fill(HIST("hSparseLambdaPolC"), v0.mLambda(), v0.pt(), PolC, centrality); + histos.fill(HIST("hSparseLambdaPolA"), v0.mLambda(), v0.pt(), v0.eta(), PolA, centrality); + histos.fill(HIST("hSparseLambdaPolC"), v0.mLambda(), v0.pt(), v0.eta(), PolC, centrality); + if (correction1) { + histos.fill(HIST("hSparseLambda_corr1a"), v0.mLambda(), v0.pt(), v0.eta(), sinPhiStar, centrality); + histos.fill(HIST("hSparseLambda_corr1b"), v0.mLambda(), v0.pt(), v0.eta(), cosPhiStar, centrality); + histos.fill(HIST("hSparseLambda_corr1c"), v0.mLambda(), v0.pt(), v0.eta(), phiphiStar, centrality); + if (correction2) { + histos.fill(HIST("hSparseLambda_corr2a"), v0.mLambda(), v0.pt(), v0.eta(), sinThetaStar, centrality); + histos.fill(HIST("hSparseLambda_corr2b"), v0.mLambda(), v0.pt(), v0.eta(), sinThetaStarcosphiphiStar, centrality); + } } } if (aLambdaTag) { - if (correction) { - histos.fill(HIST("hSparseAntiLambdaPolA_corr"), v0.mAntiLambda(), v0.pt(), cosThetaStar, sinPhiStar, cosPhiStar, PolA, centrality); - histos.fill(HIST("hSparseAntiLambdaPolC_corr"), v0.mAntiLambda(), v0.pt(), cosThetaStar, sinPhiStar, cosPhiStar, PolC, centrality); - } else { - histos.fill(HIST("hSparseAntiLambdaPolA"), v0.mAntiLambda(), v0.pt(), PolA, centrality); - histos.fill(HIST("hSparseAntiLambdaPolC"), v0.mAntiLambda(), v0.pt(), PolC, centrality); + histos.fill(HIST("hSparseAntiLambdaPolA"), v0.mAntiLambda(), v0.pt(), v0.eta(), PolA, centrality); + histos.fill(HIST("hSparseAntiLambdaPolC"), v0.mAntiLambda(), v0.pt(), v0.eta(), PolC, centrality); + if (correction1) { + histos.fill(HIST("hSparseAntiLambda_corr1a"), v0.mAntiLambda(), v0.pt(), v0.eta(), sinPhiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1b"), v0.mAntiLambda(), v0.pt(), v0.eta(), cosPhiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1c"), v0.mAntiLambda(), v0.pt(), v0.eta(), phiphiStar, centrality); + if (correction2) { + histos.fill(HIST("hSparseAntiLambda_corr2a"), v0.mAntiLambda(), v0.pt(), v0.eta(), sinThetaStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr2b"), v0.mAntiLambda(), v0.pt(), v0.eta(), sinThetaStarcosphiphiStar, centrality); + } } } } From a7b46d3ef4a7a62aa63419fb19f9d7762d9de203 Mon Sep 17 00:00:00 2001 From: Luca Aglietta <75362880+Luca610@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:12:48 +0100 Subject: [PATCH 125/459] [PWGHF] Implemented matching of candidates with kinked tracks for D2H analyses (#8670) Co-authored-by: ALICE Action Bot Co-authored-by: Fabrizio --- .../DataModel/CandidateReconstructionTables.h | 11 ++++-- .../TableProducer/candidateCreator2Prong.cxx | 14 +++++-- .../TableProducer/candidateCreator3Prong.cxx | 38 +++++++++++++++---- PWGHF/TableProducer/candidateCreatorDstar.cxx | 30 ++++++++++----- 4 files changed, 69 insertions(+), 24 deletions(-) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 5c206512490..4948571afe2 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -585,6 +585,8 @@ DECLARE_SOA_COLUMN(KfTopolChi2OverNdf, kfTopolChi2OverNdf, float); //! chi2overn DECLARE_SOA_COLUMN(PtBhadMotherPart, ptBhadMotherPart, float); //! pt of the first B-hadron mother particle (only in case of non-prompt) DECLARE_SOA_COLUMN(PdgBhadMotherPart, pdgBhadMotherPart, int); //! pdg of the first B-hadron mother particle (only in case of non-prompt) DECLARE_SOA_COLUMN(IdxBhadMotherPart, idxBhadMotherPart, int); //! index of the first B-hadron mother particle (only in case of non-prompt) +// Kink topology mc flag +DECLARE_SOA_COLUMN(NTracksDecayed, nTracksDecayed, int8_t); //! number of tracks matched with kinked decay topology // method of secondary-vertex reconstruction enum VertexerType { DCAFitter = 0, @@ -731,7 +733,8 @@ DECLARE_SOA_TABLE(HfCand2ProngMcRec, "AOD", "HFCAND2PMCREC", //! hf_cand_2prong::FlagMcMatchRec, hf_cand_2prong::OriginMcRec, hf_cand::PtBhadMotherPart, - hf_cand::PdgBhadMotherPart); + hf_cand::PdgBhadMotherPart, + hf_cand::NTracksDecayed); // table with results of generator level MC matching DECLARE_SOA_TABLE(HfCand2ProngMcGen, "AOD", "HFCAND2PMCGEN", //! @@ -1008,7 +1011,8 @@ DECLARE_SOA_TABLE(HfCand3ProngMcRec, "AOD", "HFCAND3PMCREC", //! hf_cand_3prong::IsCandidateSwapped, hf_cand_3prong::FlagMcDecayChanRec, hf_cand::PtBhadMotherPart, - hf_cand::PdgBhadMotherPart); + hf_cand::PdgBhadMotherPart, + hf_cand::NTracksDecayed); // table with results of generator level MC matching DECLARE_SOA_TABLE(HfCand3ProngMcGen, "AOD", "HFCAND3PMCGEN", //! @@ -2264,7 +2268,8 @@ DECLARE_SOA_TABLE(HfCandDstarMcRec, "AOD", "HFCANDDSTRMCREC", hf_cand_dstar::FlagMcMatchRec, hf_cand_dstar::OriginMcRec, hf_cand::PtBhadMotherPart, - hf_cand::PdgBhadMotherPart); + hf_cand::PdgBhadMotherPart, + hf_cand::NTracksDecayed); // table with results of generator level MC matching DECLARE_SOA_TABLE(HfCandDstarMcGen, "AOD", "HFCANDDSTRMCGEN", diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 6d27cfd9021..636b7907020 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -677,6 +677,7 @@ struct HfCandidateCreator2ProngExpressions { // Configuration o2::framework::Configurable rejectBackground{"rejectBackground", true, "Reject particles from background events"}; + o2::framework::Configurable matchKinkedDecayTopology{"matchKinkedDecayTopology", false, "Match also candidates with tracks that decay with kinked topology"}; HfEventSelectionMc hfEvSelMc; // mc event selection and monitoring @@ -723,6 +724,7 @@ struct HfCandidateCreator2ProngExpressions { int8_t sign = 0; int8_t flag = 0; int8_t origin = 0; + int8_t nKinkedTracks = 0; // Match reconstructed candidates. // Spawned table can be used directly @@ -744,14 +746,18 @@ struct HfCandidateCreator2ProngExpressions { } } if (fromBkg) { - rowMcMatchRec(flag, origin, -1.f, 0); + rowMcMatchRec(flag, origin, -1.f, 0, 0); continue; } } std::vector idxBhadMothers{}; // D0(bar) → π± K∓ - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); + if (matchKinkedDecayTopology) { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign, 1, &nKinkedTracks); + } else { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); + } if (indexRec > -1) { flag = sign * (1 << DecayType::D0ToPiK); } @@ -779,9 +785,9 @@ struct HfCandidateCreator2ProngExpressions { } if (origin == RecoDecay::OriginType::NonPrompt) { auto bHadMother = mcParticles.rawIteratorAt(idxBhadMothers[0]); - rowMcMatchRec(flag, origin, bHadMother.pt(), bHadMother.pdgCode()); + rowMcMatchRec(flag, origin, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks); } else { - rowMcMatchRec(flag, origin, -1.f, 0); + rowMcMatchRec(flag, origin, -1.f, 0, nKinkedTracks); } } diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index a14df266590..10df33964ad 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -456,6 +456,7 @@ struct HfCandidateCreator3ProngExpressions { // Configuration o2::framework::Configurable rejectBackground{"rejectBackground", true, "Reject particles from background events"}; + o2::framework::Configurable matchKinkedDecayTopology{"matchKinkedDecayTopology", false, "Match also candidates with tracks that decay with kinked topology"}; bool createDplus{false}; bool createDs{false}; @@ -526,6 +527,7 @@ struct HfCandidateCreator3ProngExpressions { int8_t origin = 0; int8_t swapping = 0; int8_t channel = 0; + int8_t nKinkedTracks = 0; std::vector arrDaughIndex; std::array arrPDGDaugh; std::array arrPDGResonant1 = {kProton, 313}; // Λc± → p± K* @@ -558,14 +560,18 @@ struct HfCandidateCreator3ProngExpressions { } } if (fromBkg) { - rowMcMatchRec(flag, origin, swapping, channel, -1.f, 0); + rowMcMatchRec(flag, origin, swapping, channel, -1.f, 0, 0); continue; } } // D± → π± K∓ π± if (createDplus) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + if (matchKinkedDecayTopology) { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks); + } else { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + } if (indexRec > -1) { flag = sign * (1 << DecayType::DplusToPiKPi); } @@ -574,10 +580,18 @@ struct HfCandidateCreator3ProngExpressions { // Ds± → K± K∓ π± and D± → K± K∓ π± if (flag == 0 && createDs) { bool isDplus = false; - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + if (matchKinkedDecayTopology) { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks); + } else { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + } if (indexRec == -1) { isDplus = true; - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + if (matchKinkedDecayTopology) { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks); + } else { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + } } if (indexRec > -1) { // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± @@ -603,7 +617,11 @@ struct HfCandidateCreator3ProngExpressions { // Λc± → p± K∓ π± if (flag == 0 && createLc) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + if (matchKinkedDecayTopology) { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks); + } else { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + } if (indexRec > -1) { flag = sign * (1 << DecayType::LcToPKPi); @@ -630,7 +648,11 @@ struct HfCandidateCreator3ProngExpressions { // Ξc± → p± K∓ π± if (flag == 0 && createXic) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + if (matchKinkedDecayTopology) { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks); + } else { + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + } if (indexRec > -1) { flag = sign * (1 << DecayType::XicToPKPi); } @@ -643,9 +665,9 @@ struct HfCandidateCreator3ProngExpressions { } if (origin == RecoDecay::OriginType::NonPrompt) { auto bHadMother = mcParticles.rawIteratorAt(idxBhadMothers[0]); - rowMcMatchRec(flag, origin, swapping, channel, bHadMother.pt(), bHadMother.pdgCode()); + rowMcMatchRec(flag, origin, swapping, channel, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks); } else { - rowMcMatchRec(flag, origin, swapping, channel, -1.f, 0); + rowMcMatchRec(flag, origin, swapping, channel, -1.f, 0, nKinkedTracks); } } diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index c343d8ce526..fc54575df75 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -15,7 +15,10 @@ /// \author Vít Kučera , CERN /// \author Deependra Sharma , IITB /// \author Fabrizio Grosa , CERN - +// std +#include +#include +#include // ROOT #include // O2 @@ -506,6 +509,7 @@ struct HfCandidateCreatorDstarExpressions { // Configuration o2::framework::Configurable rejectBackground{"rejectBackground", true, "Reject particles from background events"}; + o2::framework::Configurable matchKinkedDecayTopology{"matchKinkedDecayTopology", false, "Match also candidates with tracks that decay with kinked topology"}; using McCollisionsNoCents = soa::Join; using McCollisionsFT0Cs = soa::Join; @@ -552,6 +556,7 @@ struct HfCandidateCreatorDstarExpressions { int8_t signDstar = 0, signD0 = 0; int8_t flagDstar = 0, flagD0 = 0; int8_t originDstar = 0, originD0 = 0; + int8_t nKinkedTracksDstar = 0, nKinkedTracksD0 = 0; // Match reconstructed candidates. for (const auto& rowCandidateDstar : *rowsCandidateDstar) { @@ -581,15 +586,22 @@ struct HfCandidateCreatorDstarExpressions { } } if (fromBkg) { - rowsMcMatchRecDstar(flagDstar, originDstar, -1.f, 0); + rowsMcMatchRecDstar(flagDstar, originDstar, -1.f, 0, 0); continue; } } - // D*± → D0(bar) π± - indexRecDstar = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersDstar, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &signDstar, 2); - // D0(bar) → π± K∓ - indexRecD0 = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersofD0, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &signD0); + if (matchKinkedDecayTopology) { + // D*± → D0(bar) π± + indexRecDstar = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersDstar, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &signDstar, 2, &nKinkedTracksDstar); + // D0(bar) → π± K∓ + indexRecD0 = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersofD0, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &signD0, 1, &nKinkedTracksD0); + } else { + // D*± → D0(bar) π± + indexRecDstar = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersDstar, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &signDstar, 2); + // D0(bar) → π± K∓ + indexRecD0 = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersofD0, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &signD0); + } if (indexRecDstar > -1) { flagDstar = signDstar * (BIT(aod::hf_cand_dstar::DecayType::DstarToD0Pi)); @@ -609,11 +621,11 @@ struct HfCandidateCreatorDstarExpressions { } if (originDstar == RecoDecay::OriginType::NonPrompt) { auto bHadMother = mcParticles.rawIteratorAt(idxBhadMothers[0]); - rowsMcMatchRecDstar(flagDstar, originDstar, bHadMother.pt(), bHadMother.pdgCode()); + rowsMcMatchRecDstar(flagDstar, originDstar, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracksDstar); } else { - rowsMcMatchRecDstar(flagDstar, originDstar, -1.f, 0); + rowsMcMatchRecDstar(flagDstar, originDstar, -1.f, 0, nKinkedTracksDstar); } - rowsMcMatchRecD0(flagD0, originD0, -1.f, 0); + rowsMcMatchRecD0(flagD0, originD0, -1.f, 0, nKinkedTracksD0); } for (const auto& mcCollision : mcCollisions) { From 6219bcde403d88b375e883d8134f34948d73ebb7 Mon Sep 17 00:00:00 2001 From: Antonio Palasciano <52152842+apalasciano@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:59:42 +0100 Subject: [PATCH 126/459] [PWGHF] Add single track variables in B+ reduced task (#8564) Co-authored-by: ALICE Action Bot --- PWGHF/D2H/Tasks/taskBplusReduced.cxx | 269 +++++++++++++++++---------- 1 file changed, 174 insertions(+), 95 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskBplusReduced.cxx b/PWGHF/D2H/Tasks/taskBplusReduced.cxx index af95d1c8179..13544d2c369 100644 --- a/PWGHF/D2H/Tasks/taskBplusReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBplusReduced.cxx @@ -14,6 +14,8 @@ /// /// \author Antonio Palasciano , Università degli Studi di Bari & INFN, Sezione di Bari +#include + #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" @@ -35,58 +37,99 @@ namespace o2::aod { namespace hf_cand_bplus_lite { -DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); //! Transverse momentum of prong0 (GeV/c) -DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); //! Transverse momentum of prong1 (GeV/c) -DECLARE_SOA_COLUMN(MProng0, mProng0, float); //! Invariant mass of prong0 (GeV/c) -DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c2) -DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c) -DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) -DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c) -DECLARE_SOA_COLUMN(Y, y, float); //! Rapidity of candidate -DECLARE_SOA_COLUMN(Eta, eta, float); //! Pseudorapidity of candidate -DECLARE_SOA_COLUMN(Phi, phi, float); //! Azimuth angle of candidate -DECLARE_SOA_COLUMN(E, e, float); //! Energy of candidate (GeV) -DECLARE_SOA_COLUMN(NSigTpcPi1, nSigTpcPi1, float); //! TPC Nsigma separation for prong1 with pion mass hypothesis -DECLARE_SOA_COLUMN(NSigTofPi1, nSigTofPi1, float); //! TOF Nsigma separation for prong1 with pion mass hypothesis -DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! Decay length of candidate (cm) -DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Transverse decay length of candidate (cm) -DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! Normalised decay length of candidate -DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of candidate -DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! Impact parameter product of candidate -DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine pointing angle of candidate -DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine pointing angle of candidate in transverse plane -DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! Maximum normalized difference between measured and expected impact parameter of candidate prongs -DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class -DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); //! Flag for association with wrong collision +DECLARE_SOA_COLUMN(PtD, ptD, float); //! Transverse momentum of D-meson daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(PtBach, ptBach, float); //! Transverse momentum of bachelor pion (GeV/c) +DECLARE_SOA_COLUMN(AbsEtaBach, absEtaBach, float); //! Absolute pseudorapidity of bachelor pion +DECLARE_SOA_COLUMN(ItsNClsBach, itsNClsBach, int); //! Number of ITS clusters of bachelor pion +DECLARE_SOA_COLUMN(TpcNClsCrossedRowsBach, tpcNClsCrossedRowsBach, int); //! Number of TPC crossed rows of prongs of bachelor pion +DECLARE_SOA_COLUMN(TpcChi2NClBach, tpcChi2NClBach, float); //! Maximum TPC chi2 of prongs of D0-meson daughter candidate +DECLARE_SOA_COLUMN(PtDmesProngMin, ptProngDmesMin, float); //! Minimum pT of prongs of D-meson daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(AbsEtaDmesProngMin, absEtaProngDmesMin, float); //! Minimum absolute pseudorapidity of prongs of D-meson daughter candidate +DECLARE_SOA_COLUMN(ItsNClsDmesProngMin, itsNClsDmesProngMin, int); //! Minimum number of ITS clusters of prongs of D-meson daughter candidate +DECLARE_SOA_COLUMN(TpcNClsCrossedRowsDmesProngMin, tpcNClsCrossedRowsDmesProngMin, int); //! Minimum number of TPC crossed rows of prongs of D-meson daughter candidate +DECLARE_SOA_COLUMN(TpcChi2NClDmesProngMax, tpcChi2NClDmesProngMax, float); //! Maximum TPC chi2 of prongs of D-meson daughter candidate +DECLARE_SOA_COLUMN(MD, mD, float); //! Invariant mass of D-meson daughter candidates (GeV/c) +DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c2) +DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(Y, y, float); //! Rapidity of candidate +DECLARE_SOA_COLUMN(Eta, eta, float); //! Pseudorapidity of candidate +DECLARE_SOA_COLUMN(Phi, phi, float); //! Azimuth angle of candidate +DECLARE_SOA_COLUMN(E, e, float); //! Energy of candidate (GeV) +DECLARE_SOA_COLUMN(NSigTpcPiBachelor, nSigTpcPiBachelor, float); //! TPC Nsigma separation for bachelor with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTofPiBachelor, nSigTofPiBachelor, float); //! TOF Nsigma separation for bachelor with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcTofPiBachelor, nSigTpcTofPiBachelor, float); //! Combined TPC and TOF Nsigma separation for bachelor with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcPiDmesProng0, nSigTpcPiDmesProng0, float); //! TPC Nsigma separation for D-meson prong0 with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTofPiDmesProng0, nSigTofPiDmesProng0, float); //! TOF Nsigma separation for D-meson prong0 with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcTofPiDmesProng0, nSigTpcTofPiDmesProng0, float); //! Combined TPC and TOF Nsigma separation for D-meson prong0 with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcKaDmesProng1, nSigTpcKaDmesProng1, float); //! TPC Nsigma separation for D-meson prong1 with kaon mass hypothesis +DECLARE_SOA_COLUMN(NSigTofKaDmesProng1, nSigTofKaDmesProng1, float); //! TOF Nsigma separation for D-meson prong1 with kaon mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcTofKaDmesProng1, nSigTpcTofKaDmesProng1, float); //! Combined TPC and TOF Nsigma separation for D-meson prong1 with kaon mass hypothesis +DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! Decay length of candidate (cm) +DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Transverse decay length of candidate (cm) +DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! Normalised decay length of candidate +DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of candidate +DECLARE_SOA_COLUMN(DecayLengthD, decayLengthD, float); //! Decay length of D-meson daughter candidate (cm) +DECLARE_SOA_COLUMN(DecayLengthXYD, decayLengthXYD, float); //! Transverse decay length of D-meson daughter candidate (cm) +DECLARE_SOA_COLUMN(ImpactParameterD, impactParameterD, float); //! Impact parameter product of D-meson daughter candidate +DECLARE_SOA_COLUMN(ImpactParameterBach, impactParameterBach, float); //! Impact parameter product of bachelor pion +DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! Impact parameter product of daughters +DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine pointing angle of candidate +DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine pointing angle of candidate in transverse plane +DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! Maximum normalized difference between measured and expected impact parameter of candidate prongs +DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class +DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); //! Flag for association with wrong collision } // namespace hf_cand_bplus_lite DECLARE_SOA_TABLE(HfRedCandBpLites, "AOD", "HFREDCANDBPLITE", //! Table with some B+ properties + hf_cand_bplus_lite::M, + hf_cand_bplus_lite::Pt, + hf_cand_bplus_lite::Eta, + hf_cand_bplus_lite::Phi, + hf_cand_bplus_lite::Y, + hf_cand_bplus_lite::Cpa, + hf_cand_bplus_lite::CpaXY, hf_cand::Chi2PCA, hf_cand_bplus_lite::DecayLength, hf_cand_bplus_lite::DecayLengthXY, hf_cand_bplus_lite::DecayLengthNormalised, hf_cand_bplus_lite::DecayLengthXYNormalised, - hf_cand_bplus_lite::MProng0, - hf_cand_bplus_lite::PtProng0, - hf_cand_bplus_lite::PtProng1, - hf_cand::ImpactParameter0, - hf_cand::ImpactParameter1, hf_cand_bplus_lite::ImpactParameterProduct, - hf_cand_bplus_lite::NSigTpcPi1, - hf_cand_bplus_lite::NSigTofPi1, + hf_cand_bplus_lite::MaxNormalisedDeltaIP, + hf_cand_bplus_lite::MlScoreSig, + hf_sel_candidate_bplus::IsSelBplusToD0Pi, + // D meson features + hf_cand_bplus_lite::MD, + hf_cand_bplus_lite::PtD, + hf_cand_bplus_lite::DecayLengthD, + hf_cand_bplus_lite::DecayLengthXYD, + hf_cand_bplus_lite::ImpactParameterD, + hf_cand_bplus_lite::PtDmesProngMin, + hf_cand_bplus_lite::AbsEtaDmesProngMin, + hf_cand_bplus_lite::ItsNClsDmesProngMin, + hf_cand_bplus_lite::TpcNClsCrossedRowsDmesProngMin, + hf_cand_bplus_lite::TpcChi2NClDmesProngMax, + hf_cand_bplus_lite::NSigTpcPiDmesProng0, + hf_cand_bplus_lite::NSigTofPiDmesProng0, + hf_cand_bplus_lite::NSigTpcTofPiDmesProng0, + hf_cand_bplus_lite::NSigTpcKaDmesProng1, + hf_cand_bplus_lite::NSigTofKaDmesProng1, + hf_cand_bplus_lite::NSigTpcTofKaDmesProng1, hf_cand_bplus_reduced::Prong0MlScoreBkg, hf_cand_bplus_reduced::Prong0MlScorePrompt, hf_cand_bplus_reduced::Prong0MlScoreNonprompt, - hf_cand_bplus_lite::MlScoreSig, - hf_sel_candidate_bplus::IsSelBplusToD0Pi, - hf_cand_bplus_lite::M, - hf_cand_bplus_lite::Pt, - hf_cand_bplus_lite::Cpa, - hf_cand_bplus_lite::CpaXY, - hf_cand_bplus_lite::MaxNormalisedDeltaIP, - hf_cand_bplus_lite::Eta, - hf_cand_bplus_lite::Phi, - hf_cand_bplus_lite::Y, + // pion features + hf_cand_bplus_lite::PtBach, + hf_cand_bplus_lite::AbsEtaBach, + hf_cand_bplus_lite::ItsNClsBach, + hf_cand_bplus_lite::TpcNClsCrossedRowsBach, + hf_cand_bplus_lite::TpcChi2NClBach, + hf_cand_bplus_lite::ImpactParameterBach, + hf_cand_bplus_lite::NSigTpcPiBachelor, + hf_cand_bplus_lite::NSigTofPiBachelor, + hf_cand_bplus_lite::NSigTpcTofPiBachelor, + // MC truth hf_cand_2prong::FlagMcMatchRec, hf_cand_2prong::OriginMcRec, hf_cand_bplus_lite::FlagWrongCollision, @@ -95,8 +138,8 @@ DECLARE_SOA_TABLE(HfRedCandBpLites, "AOD", "HFREDCANDBPLITE", //! Table with som DECLARE_SOA_TABLE(HfRedBpMcCheck, "AOD", "HFREDBPMCCHECK", //! Table with MC decay type check hf_cand_2prong::FlagMcMatchRec, hf_cand_bplus_lite::FlagWrongCollision, - hf_cand_bplus_lite::MProng0, - hf_cand_bplus_lite::PtProng0, + hf_cand_bplus_lite::MD, + hf_cand_bplus_lite::PtD, hf_cand_bplus_lite::M, hf_cand_bplus_lite::Pt, hf_cand_bplus_lite::MlScoreSig, @@ -140,6 +183,7 @@ struct HfTaskBplusReduced { HistogramRegistry registry{"registry"}; using TracksPion = soa::Join; + using CandsD0 = soa::Join; void init(InitContext&) { @@ -337,14 +381,14 @@ struct HfTaskBplusReduced { /// \param withBplusMl is the flag to enable the filling with ML scores for the B+ candidate /// \param candidate is the B+ candidate /// \param candidatesD is the table with D0 candidates - template + template void fillCand(Cand const& candidate, - aod::HfRed2Prongs const& /*candidatesD*/, + CandsDmes const& /*candidatesD*/, TracksPion const&) { auto ptCandBplus = candidate.pt(); auto invMassBplus = hfHelper.invMassBplusToD0Pi(candidate); - auto candD0 = candidate.template prong0_as(); + auto candD0 = candidate.template prong0_as(); auto candPi = candidate.template prong1_as(); auto ptD0 = candidate.ptProng0(); auto invMassD0 = (candPi.signed1Pt() < 0) ? candD0.invMassHypo0() : candD0.invMassHypo1(); @@ -489,7 +533,7 @@ struct HfTaskBplusReduced { } } if (fillTree) { - float pseudoRndm = ptD0 * 1000. - (int64_t)(ptD0 * 1000); + float pseudoRndm = ptD0 * 1000. - static_cast(ptD0 * 1000); if (ptCandBplus >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor) { float prong0MlScoreBkg = -1.; float prong0MlScorePrompt = -1.; @@ -504,6 +548,22 @@ struct HfTaskBplusReduced { candidateMlScoreSig = candidate.mlProbBplusToD0Pi(); } auto prong1 = candidate.template prong1_as(); + float tpcNSigmaPi, tofNSigmaPi, tpcTofNSigmaPi, tpcNSigmaKa, tofNSigmaKa, tpcTofNSigmaKa; + if (prong1.signed1Pt() < 0) { + tpcNSigmaPi = candD0.tpcNSigmaPiProng1(); + tofNSigmaPi = candD0.tofNSigmaPiProng1(); + tpcTofNSigmaPi = candD0.tpcTofNSigmaPiProng1(); + tpcNSigmaKa = candD0.tpcNSigmaKaProng0(); + tofNSigmaKa = candD0.tofNSigmaKaProng0(); + tpcTofNSigmaKa = candD0.tpcTofNSigmaKaProng0(); + } else { + tpcNSigmaPi = candD0.tpcNSigmaPiProng0(); + tofNSigmaPi = candD0.tofNSigmaPiProng0(); + tpcTofNSigmaPi = candD0.tpcTofNSigmaPiProng0(); + tpcNSigmaKa = candD0.tpcNSigmaKaProng1(); + tofNSigmaKa = candD0.tofNSigmaKaProng1(); + tpcTofNSigmaKa = candD0.tpcTofNSigmaKaProng1(); + } float ptMother = -1.; if constexpr (doMc) { @@ -511,54 +571,73 @@ struct HfTaskBplusReduced { } hfRedCandBpLite( + // B+ - meson features + invMassBplus, + ptCandBplus, + candidate.eta(), + candidate.phi(), + hfHelper.yBplus(candidate), + candidate.cpa(), + candidate.cpaXY(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.decayLengthNormalised(), candidate.decayLengthXYNormalised(), + candidate.impactParameterProduct(), + candidate.maxNormalisedDeltaIP(), + candidateMlScoreSig, + candidate.isSelBplusToD0Pi(), + // D-meson features invMassD0, ptD0, - candidate.ptProng1(), + decLenD0, + decLenXyD0, candidate.impactParameter0(), - candidate.impactParameter1(), - candidate.impactParameterProduct(), - prong1.tpcNSigmaPi(), - prong1.tofNSigmaPi(), + candD0.ptProngMin(), + candD0.absEtaProngMin(), + candD0.itsNClsProngMin(), + candD0.tpcNClsCrossedRowsProngMin(), + candD0.tpcChi2NClProngMax(), + tpcNSigmaPi, + tofNSigmaPi, + tpcTofNSigmaPi, + tpcNSigmaKa, + tofNSigmaKa, + tpcTofNSigmaKa, prong0MlScoreBkg, prong0MlScorePrompt, prong0MlScoreNonprompt, - candidateMlScoreSig, - candidate.isSelBplusToD0Pi(), - invMassBplus, - ptCandBplus, - candidate.cpa(), - candidate.cpaXY(), - candidate.maxNormalisedDeltaIP(), - candidate.eta(), - candidate.phi(), - hfHelper.yBplus(candidate), + // pion features + candidate.ptProng1(), + std::abs(RecoDecay::eta(prong1.pVector())), + prong1.itsNCls(), + prong1.tpcNClsCrossedRows(), + prong1.tpcChi2NCl(), + candidate.impactParameter1(), + prong1.tpcNSigmaPi(), + prong1.tofNSigmaPi(), + prong1.tpcTofNSigmaPi(), + // MC truth flagMcMatchRec, isSignal, flagWrongCollision, ptMother); - } - if constexpr (withDecayTypeCheck) { - float candidateMlScoreSig = -1; - if constexpr (withBplusMl) { - candidateMlScoreSig = candidate.mlProbBplusToD0Pi(); + + if constexpr (withDecayTypeCheck) { + hfRedBpMcCheck( + flagMcMatchRec, + flagWrongCollision, + invMassD0, + ptD0, + invMassBplus, + ptCandBplus, + candidateMlScoreSig, + candidate.pdgCodeBeautyMother(), + candidate.pdgCodeProng0(), + candidate.pdgCodeProng1(), + candidate.pdgCodeProng2()); } - hfRedBpMcCheck( - flagMcMatchRec, - flagWrongCollision, - invMassD0, - ptD0, - invMassBplus, - ptCandBplus, - candidateMlScoreSig, - candidate.pdgCodeBeautyMother(), - candidate.pdgCodeProng0(), - candidate.pdgCodeProng1(), - candidate.pdgCodeProng2()); } } } @@ -603,7 +682,7 @@ struct HfTaskBplusReduced { // Process functions void processData(soa::Filtered> const& candidates, - aod::HfRed2Prongs const& candidatesD, + CandsD0 const& candidatesD, TracksPion const& pionTracks) { for (const auto& candidate : candidates) { @@ -612,11 +691,11 @@ struct HfTaskBplusReduced { } fillCand(candidate, candidatesD, pionTracks); } // candidate loop - } // processData + } // processData PROCESS_SWITCH(HfTaskBplusReduced, processData, "Process data without ML scores for D0 daughter", true); void processDataWithDmesMl(soa::Filtered> const& candidates, - aod::HfRed2Prongs const& candidatesD, + CandsD0 const& candidatesD, TracksPion const& pionTracks) { for (const auto& candidate : candidates) { @@ -625,11 +704,11 @@ struct HfTaskBplusReduced { } fillCand(candidate, candidatesD, pionTracks); } // candidate loop - } // processDataWithDmesMl + } // processDataWithDmesMl PROCESS_SWITCH(HfTaskBplusReduced, processDataWithDmesMl, "Process data with ML scores for D0 daughter", false); void processDataWithBplusMl(soa::Filtered> const& candidates, - aod::HfRed2Prongs const& candidatesD, + CandsD0 const& candidatesD, TracksPion const& pionTracks) { for (const auto& candidate : candidates) { @@ -638,12 +717,12 @@ struct HfTaskBplusReduced { } fillCand(candidate, candidatesD, pionTracks); } // candidate loop - } // processDataWithBplusMl + } // processDataWithBplusMl PROCESS_SWITCH(HfTaskBplusReduced, processDataWithBplusMl, "Process data with(out) ML scores for B+ (D0 daughter)", false); void processMc(soa::Filtered> const& candidates, aod::HfMcGenRedBps const& mcParticles, - aod::HfRed2Prongs const& candidatesD, + CandsD0 const& candidatesD, TracksPion const& pionTracks) { // MC rec @@ -658,12 +737,12 @@ struct HfTaskBplusReduced { for (const auto& particle : mcParticles) { fillCandMcGen(particle); } // gen - } // processMc + } // processMc PROCESS_SWITCH(HfTaskBplusReduced, processMc, "Process MC without ML scores for B+ and D0 daughter", false); void processMcWithDecayTypeCheck(soa::Filtered> const& candidates, aod::HfMcGenRedBps const& mcParticles, - aod::HfRed2Prongs const& candidatesD, + CandsD0 const& candidatesD, TracksPion const& pionTracks) { // MC rec @@ -678,12 +757,12 @@ struct HfTaskBplusReduced { for (const auto& particle : mcParticles) { fillCandMcGen(particle); } // gen - } // processMc + } // processMc PROCESS_SWITCH(HfTaskBplusReduced, processMcWithDecayTypeCheck, "Process MC with decay type check and without ML scores for B+ and D daughter", false); void processMcWithDmesMl(soa::Filtered> const& candidates, aod::HfMcGenRedBps const& mcParticles, - aod::HfRed2Prongs const& candidatesD, + CandsD0 const& candidatesD, TracksPion const& pionTracks) { // MC rec @@ -698,12 +777,12 @@ struct HfTaskBplusReduced { for (const auto& particle : mcParticles) { fillCandMcGen(particle); } // gen - } // processMcWithDmesMl + } // processMcWithDmesMl PROCESS_SWITCH(HfTaskBplusReduced, processMcWithDmesMl, "Process MC with(out) ML scores for D0 daughter (B+)", false); void processMcWithDmesMlAndDecayTypeCheck(soa::Filtered> const& candidates, aod::HfMcGenRedBps const& mcParticles, - aod::HfRed2Prongs const& candidatesD, + CandsD0 const& candidatesD, TracksPion const& pionTracks) { // MC rec @@ -723,7 +802,7 @@ struct HfTaskBplusReduced { void processMcWithBplusMl(soa::Filtered> const& candidates, aod::HfMcGenRedBps const& mcParticles, - aod::HfRed2Prongs const& candidatesD, + CandsD0 const& candidatesD, TracksPion const& pionTracks) { // MC rec @@ -738,12 +817,12 @@ struct HfTaskBplusReduced { for (const auto& particle : mcParticles) { fillCandMcGen(particle); } // gen - } // processMcWithBplusMl + } // processMcWithBplusMl PROCESS_SWITCH(HfTaskBplusReduced, processMcWithBplusMl, "Process MC with(out) ML scores for B+ (D0 daughter)", false); void processMcWithBplusMlAndDecayTypeCheck(soa::Filtered> const& candidates, aod::HfMcGenRedBps const& mcParticles, - aod::HfRed2Prongs const& candidatesD, + CandsD0 const& candidatesD, TracksPion const& pionTracks) { // MC rec @@ -758,7 +837,7 @@ struct HfTaskBplusReduced { for (const auto& particle : mcParticles) { fillCandMcGen(particle); } // gen - } // processMc + } // processMc PROCESS_SWITCH(HfTaskBplusReduced, processMcWithBplusMlAndDecayTypeCheck, "Process MC with decay type check and with(out) ML scores for B+ (D0 daughter)", false); }; // struct From ec6447a0a4cae572436f81167b1de6536f49a33f Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Wed, 27 Nov 2024 11:02:26 +0100 Subject: [PATCH 127/459] Common: change filter for wider eta range including FDD (#8674) --- Common/TableProducer/multiplicityTable.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/TableProducer/multiplicityTable.cxx b/Common/TableProducer/multiplicityTable.cxx index ff1ea2e492d..7c36fe4363e 100644 --- a/Common/TableProducer/multiplicityTable.cxx +++ b/Common/TableProducer/multiplicityTable.cxx @@ -633,7 +633,7 @@ struct MultiplicityTable { // one loop better than multiple sliceby calls // FIT FT0C: -3.3 < η < -2.1 // FOT FT0A: 3.5 < η < 4.9 - Filter mcParticleFilter = (aod::mcparticle::eta < 4.9f) && (aod::mcparticle::eta > -3.3f); + Filter mcParticleFilter = (aod::mcparticle::eta < 7.0f) && (aod::mcparticle::eta > -7.0f); using mcParticlesFiltered = soa::Filtered; void processMC(aod::McCollision const& mcCollision, mcParticlesFiltered const& mcParticles) From ae392070f65c4c229aad716dfeb4adb0897c7387 Mon Sep 17 00:00:00 2001 From: Zhiyong <71517277+Luzhiyongg@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:43:36 +0800 Subject: [PATCH 128/459] [PWGCF] flow: produce run-by-run nua (#8676) --- PWGCF/Flow/Tasks/FlowRunbyRun.cxx | 44 +++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowRunbyRun.cxx b/PWGCF/Flow/Tasks/FlowRunbyRun.cxx index 02f006f2c3c..60efdf6e24d 100644 --- a/PWGCF/Flow/Tasks/FlowRunbyRun.cxx +++ b/PWGCF/Flow/Tasks/FlowRunbyRun.cxx @@ -60,6 +60,7 @@ struct FlowRunbyRun { O2_DEFINE_CONFIGURABLE(cfgCutChi2prTPCcls, float, 2.5, "Chi2 per TPC clusters") O2_DEFINE_CONFIGURABLE(cfgCutDCAz, float, 2.0f, "max DCA to vertex z") O2_DEFINE_CONFIGURABLE(cfgUseNch, bool, false, "Use Nch for flow observables") + O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeightsRefPt, bool, false, "NUA weights are filled in ref pt bins") Configurable> cfgRunNumbers{"cfgRunNumbers", std::vector{544095, 544098, 544116, 544121, 544122, 544123, 544124}, "Preconfigured run numbers"}; Configurable> cfgUserDefineGFWCorr{"cfgUserDefineGFWCorr", std::vector{"refN10 {2} refP10 {-2}"}, "User defined GFW CorrelatorConfig"}; Configurable> cfgUserDefineGFWName{"cfgUserDefineGFWName", std::vector{"Ch10Gap22"}, "User defined GFW Name"}; @@ -80,6 +81,7 @@ struct FlowRunbyRun { // Define output OutputObj fFC{FlowContainer("FlowContainer")}; + OutputObj fWeightList{"WeightList", OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry registry{"registry"}; // define global variables @@ -88,9 +90,11 @@ struct FlowRunbyRun { std::vector corrconfigsFC; TAxis* fPtAxis; TRandom3* fRndm = new TRandom3(0); + int lastRunNumer = -1; std::vector RunNumbers; // vector of run numbers std::map>> TH1sList; // map of histograms for all runs std::map>> ProfilesList; // map of profiles for all runs + std::map WeightsList; // map of weights for all runs enum OutputTH1Names { // here are TProfiles for vn-pt correlations that are not implemented in GFW hPhi = 0, @@ -115,6 +119,10 @@ struct FlowRunbyRun { ccdb->setCaching(true); ccdb->setCreatedNotAfter(nolaterthan.value); + TList* weightlist = new TList(); + weightlist->SetOwner(true); + fWeightList.setObject(weightlist); + // Add output histograms to the registry RunNumbers = cfgRunNumbers; for (auto& runNumber : RunNumbers) { @@ -214,6 +222,16 @@ struct FlowRunbyRun { profiles[c22] = registry.add(Form("%d/c22", runNumber), "", {HistType::kTProfile, {axisIndependent}}); profiles[c22_gap10] = registry.add(Form("%d/c22_gap10", runNumber), "", {HistType::kTProfile, {axisIndependent}}); ProfilesList.insert(std::make_pair(runNumber, profiles)); + + // WeightsList + o2::framework::AxisSpec axis = axisPt; + int nPtBins = axis.binEdges.size() - 1; + double* PtBins = &(axis.binEdges)[0]; + GFWWeights* weight = new GFWWeights(Form("weight_%d", runNumber)); + weight->SetPtBins(nPtBins, PtBins); + weight->Init(true, false); + fWeightList->Add(weight); + WeightsList.insert(std::make_pair(runNumber, weight)); } void process(aodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, aodTracks const& tracks) @@ -226,15 +244,18 @@ struct FlowRunbyRun { auto bc = collision.bc_as(); int runNumber = bc.runNumber(); float l_Random = fRndm->Rndm(); - if (std::find(RunNumbers.begin(), RunNumbers.end(), runNumber) == RunNumbers.end()) { - // if run number is not in the preconfigured list, create new output histograms for this run - CreateOutputObjectsForRun(runNumber); - RunNumbers.push_back(runNumber); - } + if (runNumber != lastRunNumer) { + lastRunNumer = runNumber; + if (std::find(RunNumbers.begin(), RunNumbers.end(), runNumber) == RunNumbers.end()) { + // if run number is not in the preconfigured list, create new output histograms for this run + CreateOutputObjectsForRun(runNumber); + RunNumbers.push_back(runNumber); + } - if (TH1sList.find(runNumber) == TH1sList.end()) { - LOGF(fatal, "RunNumber %d not found in TH1sList", runNumber); - return; + if (TH1sList.find(runNumber) == TH1sList.end()) { + LOGF(fatal, "RunNumber %d not found in TH1sList", runNumber); + return; + } } TH1sList[runNumber][hVtxZ]->Fill(collision.posZ()); @@ -247,10 +268,17 @@ struct FlowRunbyRun { for (auto& track : tracks) { TH1sList[runNumber][hPhi]->Fill(track.phi()); TH1sList[runNumber][hEta]->Fill(track.eta()); + bool WithinPtPOI = (cfgCutPtPOIMin < track.pt()) && (track.pt() < cfgCutPtPOIMax); // within POI pT range bool WithinPtRef = (cfgCutPtRefMin < track.pt()) && (track.pt() < cfgCutPtRefMax); // within RF pT range if (WithinPtRef) { fGFW->Fill(track.eta(), 1, track.phi(), wacc * weff, 1); } + if (cfgOutputNUAWeightsRefPt) { + if (WithinPtRef) + WeightsList[runNumber]->Fill(track.phi(), track.eta(), collision.posZ(), track.pt(), cent, 0); + } else { + WeightsList[runNumber]->Fill(track.phi(), track.eta(), collision.posZ(), track.pt(), cent, 0); + } } // Filling TProfile From 5ec6f71ec7def9d41b721a7ec206fa16d0a64379 Mon Sep 17 00:00:00 2001 From: a-m-andrushko <96832230+a-m-andrushko@users.noreply.github.com> Date: Wed, 27 Nov 2024 12:28:09 +0100 Subject: [PATCH 129/459] [PWGCF] FemtoUniverse -- Add De selection to femtoUniverseEfficiencyBase.cxx (#8642) --- .../Tasks/femtoUniverseEfficiencyBase.cxx | 40 +++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx index 04b6424455b..b071bc71f62 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx @@ -61,13 +61,22 @@ struct femtoUniverseEfficiencyBase { Configurable ConfNsigmaTPCPion{"ConfNsigmaTPCPion", 3.0, "TPC Pion Sigma for momentum < ConfMomPion"}; } ConfBothTracks; - // Lambda cuts + /// Lambda cuts Configurable ConfV0InvMassLowLimit{"ConfV0InvV0MassLowLimit", 1.10, "Lower limit of the V0 invariant mass"}; Configurable ConfV0InvMassUpLimit{"ConfV0InvV0MassUpLimit", 1.13, "Upper limit of the V0 invariant mass"}; - // Kaon configurables + /// Kaon configurable Configurable IsKaonRun2{"IsKaonRun2", false, "Enable kaon selection used in Run2"}; // to check consistency with Run2 results + /// Deuteron configurables + struct : o2::framework::ConfigurableGroup { + Configurable ConfNsigmaTPCDe{"ConfNsigmaTPCDe", 2.0f, "TPC Deuteron Sigma for momentum < ConfTOFpMinDe"}; + Configurable ConfNsigmaTOFDe{"ConfNsigmaTOFDe", 2.0f, "TOF Deuteron Sigma"}; + Configurable ConfTOFpMinDe{"ConfTOFpMinDe", 0.5f, "Min. momentum for deuterons for which TOF is required for PID"}; + Configurable ConfPLowDe{"ConfPLowDe", 0.8f, "Lower limit for momentum for deuterons"}; + Configurable ConfPHighDe{"ConfPHighDe", 1.8f, "Higher limit for momentum for deuterons"}; + } deuteronconfigs; + /// Particle 1 Configurable ConfPDGCodePartOne{"ConfPDGCodePartOne", 2212, "Particle 1 - PDG code"}; Configurable ConfParticleTypePartOne{"ConfParticleTypePartOne", aod::femtouniverseparticle::ParticleType::kTrack, "Particle 1 - particle type: 0 - track, 2 - V0, 6 - phi"}; @@ -239,7 +248,20 @@ struct femtoUniverseEfficiencyBase { return false; } - bool IsParticleNSigma(int pdgCode, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) + bool IsDeuteronNSigma(float mom, float nsigmaTPCDe, float nsigmaTOFDe) + { + if (mom > deuteronconfigs.ConfPLowDe && mom < deuteronconfigs.ConfPHighDe) { + if (mom < deuteronconfigs.ConfTOFpMinDe) { + return (TMath::Abs(nsigmaTPCDe) < deuteronconfigs.ConfNsigmaTPCDe); + } else { + return (TMath::Abs(nsigmaTOFDe) < deuteronconfigs.ConfNsigmaTOFDe && (TMath::Abs(nsigmaTPCDe) < deuteronconfigs.ConfNsigmaTPCDe)); + } + } else { + return false; + } + } + + bool IsParticleNSigma(int pdgCode, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK, float nsigmaTPCDe, float nsigmaTOFDe) { switch (pdgCode) { case 2212: // Proton @@ -254,6 +276,10 @@ struct femtoUniverseEfficiencyBase { case -321: // Kaon- return IsKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); break; + case 1000010020: // Deuteron + case -1000010020: // Antideuteron + return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); + break; default: return false; } @@ -310,7 +336,7 @@ struct femtoUniverseEfficiencyBase { { /// Histogramming same event for (auto& part : grouppartsOneMCRec) { - if (part.partType() != ConfParticleTypePartOne || part.sign() != ConfChargePart1 || !IsParticleNSigma(ConfPDGCodePartOne, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { + if (part.partType() != ConfParticleTypePartOne || part.sign() != ConfChargePart1 || !IsParticleNSigma(ConfPDGCodePartOne, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron))) { continue; } trackHistoPartOneRec.fillQA(part); @@ -326,7 +352,7 @@ struct femtoUniverseEfficiencyBase { if (!ConfIsSame) { for (auto& part : grouppartsTwoMCRec) { - if (part.partType() != ConfParticleTypePartTwo || part.sign() != ConfChargePart2 || !IsParticleNSigma(ConfPDGCodePartTwo, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { + if (part.partType() != ConfParticleTypePartTwo || part.sign() != ConfChargePart2 || !IsParticleNSigma(ConfPDGCodePartTwo, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron))) { continue; } @@ -354,7 +380,7 @@ struct femtoUniverseEfficiencyBase { { // part1 is track and part2 is Phi for (auto& part : grouppartsOneMCRec) { - if (part.partType() != ConfParticleTypePartOne || part.sign() != ConfChargePart1 || !IsParticleNSigma(ConfPDGCodePartOne, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { + if (part.partType() != ConfParticleTypePartOne || part.sign() != ConfChargePart1 || !IsParticleNSigma(ConfPDGCodePartOne, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron))) { continue; } trackHistoPartOneRec.fillQA(part); @@ -482,7 +508,7 @@ struct femtoUniverseEfficiencyBase { /// Histogramming same event for (auto& part : grouppartsOneMCRec) { - if (part.partType() != ConfParticleTypePartOne || part.sign() != ConfChargePart1 || !IsParticleNSigma(ConfPDGCodePartOne, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { + if (part.partType() != ConfParticleTypePartOne || part.sign() != ConfChargePart1 || !IsParticleNSigma(ConfPDGCodePartOne, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron))) { continue; } From ae52f2c08ce01342e62871ce5ba759853ac39a87 Mon Sep 17 00:00:00 2001 From: lauraser <45659867+lauraser@users.noreply.github.com> Date: Wed, 27 Nov 2024 12:43:00 +0100 Subject: [PATCH 130/459] [PWGCF] Option to have centrality for PbPb (#8679) Co-authored-by: Laura Serksnyte --- .../TableProducer/femtoDreamProducerTask.cxx | 52 +++++++++++++++---- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx index c0620e16e37..eacdb3b96b5 100644 --- a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx +++ b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx @@ -51,8 +51,10 @@ namespace o2::aod using FemtoFullCollision = soa::Join::iterator; using FemtoFullCollision_noCent = soa::Join::iterator; +using FemtoFullCollision_CentPbPb = soa::Join::iterator; using FemtoFullCollisionMC = soa::Join::iterator; using FemtoFullCollision_noCent_MC = soa::Join::iterator; +using FemtoFullCollisionMC_CentPbPb = soa::Join::iterator; using FemtoFullMCgenCollisions = soa::Join; using FemtoFullMCgenCollision = FemtoFullMCgenCollisions::iterator; @@ -102,7 +104,6 @@ struct femtoDreamProducerTask { Configurable ConfIsDebug{"ConfIsDebug", true, "Enable Debug tables"}; Configurable ConfIsRun3{"ConfIsRun3", false, "Running on Run3 or pilot"}; Configurable ConfIsForceGRP{"ConfIsForceGRP", false, "Set true if the magnetic field configuration is not available in the usual CCDB directory (e.g. for Run 2 converted data or unanchorad Monte Carlo)"}; - /// Event cuts FemtoDreamCollisionSelection colCuts; // Event cuts - Triggers @@ -202,10 +203,10 @@ struct femtoDreamProducerTask { void init(InitContext&) { - if (doprocessData == false && doprocessData_noCentrality == false && doprocessMC == false && doprocessMC_noCentrality == false) { + if (doprocessData == false && doprocessData_noCentrality == false && doprocessData_CentPbPb == false && doprocessMC == false && doprocessMC_noCentrality == false && doprocessMC_CentPbPb == false) { LOGF(fatal, "Neither processData nor processMC enabled. Please choose one."); } - if ((doprocessData == true && doprocessMC == true) || (doprocessData == true && doprocessMC_noCentrality == true) || (doprocessMC == true && doprocessMC_noCentrality == true) || (doprocessData_noCentrality == true && doprocessData == true) || (doprocessData_noCentrality == true && doprocessMC == true) || (doprocessData_noCentrality == true && doprocessMC_noCentrality == true)) { + if ((doprocessData == true && doprocessMC == true) || (doprocessData == true && doprocessMC_noCentrality == true) || (doprocessMC == true && doprocessMC_noCentrality == true) || (doprocessData_noCentrality == true && doprocessData == true) || (doprocessData_noCentrality == true && doprocessMC == true) || (doprocessData_noCentrality == true && doprocessMC_noCentrality == true) || (doprocessData_CentPbPb == true && doprocessData == true) || (doprocessData_CentPbPb == true && doprocessData_noCentrality == true) || (doprocessData_CentPbPb == true && doprocessMC == true) || (doprocessData_CentPbPb == true && doprocessMC_noCentrality == true) || (doprocessData_CentPbPb == true && doprocessMC_CentPbPb == true)) { LOGF(fatal, "Cannot enable more than one process switch at the same time. " "Please choose one."); @@ -462,7 +463,7 @@ struct femtoDreamProducerTask { outputCollsMCLabels(-1); } } - template + template void fillCollisionsAndTracksAndV0(CollisionType const& col, TrackType const& tracks, V0Type const& fullV0s) { // If triggering is enabled, select only events which were triggered wit our triggers @@ -479,7 +480,11 @@ struct femtoDreamProducerTask { int multNtr = 0; if (ConfIsRun3) { if constexpr (useCentrality) { - mult = col.centFT0M(); + if constexpr (analysePbPb) { + mult = col.centFT0C(); + } else { + mult = col.centFT0M(); + } } else { mult = 0; } @@ -731,7 +736,7 @@ struct femtoDreamProducerTask { // get magnetic field for run initCCDB_Mag_Trig(col.bc_as()); // fill the tables - fillCollisionsAndTracksAndV0(col, tracks, fullV0s); + fillCollisionsAndTracksAndV0(col, tracks, fullV0s); } PROCESS_SWITCH(femtoDreamProducerTask, processData, "Provide experimental data", true); @@ -745,11 +750,25 @@ struct femtoDreamProducerTask { // get magnetic field for run initCCDB_Mag_Trig(col.bc_as()); // fill the tables - fillCollisionsAndTracksAndV0(col, tracks, fullV0s); + fillCollisionsAndTracksAndV0(col, tracks, fullV0s); } PROCESS_SWITCH(femtoDreamProducerTask, processData_noCentrality, "Provide experimental data without centrality information", false); + void + processData_CentPbPb(aod::FemtoFullCollision_CentPbPb const& col, + aod::BCsWithTimestamps const&, + aod::FemtoFullTracks const& tracks, + o2::aod::V0Datas const& fullV0s) + { + // get magnetic field for run + initCCDB_Mag_Trig(col.bc_as()); + // fill the tables + fillCollisionsAndTracksAndV0(col, tracks, fullV0s); + } + PROCESS_SWITCH(femtoDreamProducerTask, processData_CentPbPb, + "Provide experimental data with centrality information for PbPb collisions", false); + void processMC(aod::FemtoFullCollisionMC const& col, aod::BCsWithTimestamps const&, soa::Join const& tracks, @@ -760,7 +779,7 @@ struct femtoDreamProducerTask { // get magnetic field for run initCCDB_Mag_Trig(col.bc_as()); // fill the tables - fillCollisionsAndTracksAndV0(col, tracks, fullV0s); + fillCollisionsAndTracksAndV0(col, tracks, fullV0s); } PROCESS_SWITCH(femtoDreamProducerTask, processMC, "Provide MC data", false); @@ -774,11 +793,24 @@ struct femtoDreamProducerTask { // get magnetic field for run initCCDB_Mag_Trig(col.bc_as()); // fill the tables - fillCollisionsAndTracksAndV0(col, tracks, fullV0s); + fillCollisionsAndTracksAndV0(col, tracks, fullV0s); } PROCESS_SWITCH(femtoDreamProducerTask, processMC_noCentrality, "Provide MC data without requiring a centrality calibration", false); -}; + void processMC_CentPbPb(aod::FemtoFullCollisionMC_CentPbPb const& col, + aod::BCsWithTimestamps const&, + soa::Join const& tracks, + aod::FemtoFullMCgenCollisions const&, + aod::McParticles const&, + soa::Join const& fullV0s) /// \todo with FilteredFullV0s + { + // get magnetic field for run + initCCDB_Mag_Trig(col.bc_as()); + // fill the tables + fillCollisionsAndTracksAndV0(col, tracks, fullV0s); + } + PROCESS_SWITCH(femtoDreamProducerTask, processMC_CentPbPb, "Provide MC data with centrality information for PbPb collisions", false); +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; From 3c0a001b21a43b95b1e6f56219badf7290ca6525 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Wed, 27 Nov 2024 13:13:36 +0100 Subject: [PATCH 131/459] [PWGJE] Adding missing directory (#8675) --- PWGJE/TableProducer/CMakeLists.txt | 1 + .../Matching/Duplicates/jetMatchingDuplicatesChargedData1.cxx | 2 +- .../Matching/Duplicates/jetMatchingDuplicatesChargedMCD1.cxx | 2 +- .../Matching/Duplicates/jetMatchingDuplicatesChargedMCP1.cxx | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGJE/TableProducer/CMakeLists.txt b/PWGJE/TableProducer/CMakeLists.txt index 1794a0b70fe..8efe1878755 100644 --- a/PWGJE/TableProducer/CMakeLists.txt +++ b/PWGJE/TableProducer/CMakeLists.txt @@ -9,6 +9,7 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. +add_subdirectory(Matching) if(FastJet_FOUND) diff --git a/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedData1.cxx b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedData1.cxx index bdf1abfb30c..8115c95bf04 100644 --- a/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedData1.cxx +++ b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedData1.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/TableProducer/Matching/jetMatchingDuplicates.cxx" +#include "PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicates.cxx" using Charged1JetDataMatchingDupliacates = JetMatchingDuplicates, soa::Join, diff --git a/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCD1.cxx b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCD1.cxx index e6d8105e4a6..96033d17d4e 100644 --- a/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCD1.cxx +++ b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCD1.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/TableProducer/Matching/jetMatchingDuplicates.cxx" +#include "PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicates.cxx" using Charged1JetMCDMatchingDupliacates = JetMatchingDuplicates, soa::Join, diff --git a/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCP1.cxx b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCP1.cxx index c468b010679..11b39822bcb 100644 --- a/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCP1.cxx +++ b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicatesChargedMCP1.cxx @@ -13,7 +13,7 @@ // /// \author Nima Zardoshti -#include "PWGJE/TableProducer/Matching/jetMatchingDuplicates.cxx" +#include "PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicates.cxx" using Charged1JetMCPMatchingDupliacates = JetMatchingDuplicates, soa::Join, From 600943c13a5b36141c498178cb2138a6ddb2bcdb Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Wed, 27 Nov 2024 14:52:16 +0100 Subject: [PATCH 132/459] [PWGCF] FemtoUniverse: Fixing cent and mult datatype to float (#8682) --- .../TableProducer/femtoUniverseProducerTask.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index ad0b59185de..a9853b29e1b 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -762,7 +762,7 @@ struct femtoUniverseProducerTask { void fillCollisions(CollisionType const& col, TrackType const& tracks) { const auto vtxZ = col.posZ(); - int mult = 0; + float mult = 0; int multNtr = 0; if (ConfIsRun3) { mult = col.multFV0M(); @@ -805,7 +805,7 @@ struct femtoUniverseProducerTask { { for (auto& c : col) { const auto vtxZ = c.posZ(); - int mult = 0; + float mult = 0; int multNtr = 0; if (std::abs(vtxZ) > ConfEvtZvtx) { @@ -824,7 +824,7 @@ struct femtoUniverseProducerTask { void fillCollisionsCentRun2(CollisionType const& col, TrackType const& tracks) { const auto vtxZ = col.posZ(); - int cent = 0; + float cent = 0; int multNtr = 0; if (!ConfIsRun3) { cent = col.centRun2V0M(); @@ -852,7 +852,7 @@ struct femtoUniverseProducerTask { void fillCollisionsCentRun3(CollisionType const& col, TrackType const& tracks, V0Type const& fullV0s, CascadeType const& fullCascades, double irrate) { const auto vtxZ = col.posZ(); - int cent = 0; + float cent = 0; int multNtr = 0; if (ConfIsRun3) { multNtr = col.multNTracksPV(); From 0378a1d841a273adc3d1c79b8be539f3a7cb643f Mon Sep 17 00:00:00 2001 From: Jerome Jung Date: Wed, 27 Nov 2024 15:44:50 +0100 Subject: [PATCH 133/459] [PWGEM] LMee: added signed DCA var and DCA histo (#8484) --- PWGEM/Dilepton/Core/Dilepton.h | 23 ++++++++++++++++++++--- PWGEM/Dilepton/Utils/PairUtilities.h | 7 +++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 311e87d82ec..2a37b7be9b3 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -120,6 +120,7 @@ struct Dilepton { Configurable cfgNtracksPV08Max{"cfgNtracksPV08Max", static_cast(1e+9), "max. multNTracksPV"}; Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; + Configurable cfgUseSignedDCA{"cfgUseSignedDCA", false, "flag to use signs in the DCA calculation"}; ConfigurableAxis ConfMllBins{"ConfMllBins", {VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; ConfigurableAxis ConfPtllBins{"ConfPtllBins", {VARIABLE_WIDTH, 0.00, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; @@ -520,6 +521,9 @@ struct Dilepton { } else if (cfgDCAType == 2) { pair_dca_axis_title = "DCA_{ee}^{Z} (#sigma)"; } + if (cfgUseSignedDCA) { + pair_dca_axis_title = "Signed " + pair_dca_axis_title; + } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { mass_axis_title = "m_{#mu#mu} (GeV/c^{2})"; pair_pt_axis_title = "p_{T,#mu#mu} (GeV/c)"; @@ -539,6 +543,7 @@ struct Dilepton { fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron fRegistry.add("Pair/same/uls/hMvsPhiV_prop", Form("m_{ee} vs. #varphi_{V} at r = %2.1f cm;#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", dielectroncuts.cfg_x_to_go.value), kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron fRegistry.add("Pair/same/uls/hMvsOpAng", "m_{ee} vs. angle between 2 tracks;#omega (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{100, 0, 2.0}, {20, 0.0f, 3.2}}, true); + fRegistry.add("Pair/same/uls/hDCA1vsDCA2", "DCA of leg1 vs. DCA of leg2;DCA1(#sigma);DCA2 (#sigma)", kTH2D, {{100, 0, 10.0}, {100, 0, 10}}, true); } fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); @@ -947,11 +952,23 @@ struct Dilepton { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); + if (cfgUseSignedDCA) { + pair_dca = pairDCASignQuadSum(dca3DinSigma(t1), dca3DinSigma(t2), t1.sign(), t2.sign()); + } else { + pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); + } if (cfgDCAType == 1) { - pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); + if (cfgUseSignedDCA) { + pair_dca = pairDCASignQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2), t1.sign(), t2.sign()); + } else { + pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); + } } else if (cfgDCAType == 2) { - pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); + if (cfgUseSignedDCA) { + pair_dca = pairDCASignQuadSum(dcaZinSigma(t1), dcaZinSigma(t2), t1.sign(), t2.sign()); + } else { + pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); + } } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), fwdDcaXYinSigma(t2)); diff --git a/PWGEM/Dilepton/Utils/PairUtilities.h b/PWGEM/Dilepton/Utils/PairUtilities.h index 293cb34dfa5..d157a811e48 100644 --- a/PWGEM/Dilepton/Utils/PairUtilities.h +++ b/PWGEM/Dilepton/Utils/PairUtilities.h @@ -325,6 +325,13 @@ inline float pairDCAQuadSum(const float dca1, const float dca2) { return std::sqrt((dca1 * dca1 + dca2 * dca2) / 2.); } + +//_______________________________________________________________________ +inline float pairDCASignQuadSum(const float dca1, const float dca2, const float charge1, const float charge2) +{ + return charge1 * charge2 * TMath::Sign(1., dca1) * TMath::Sign(1., dca2) * std::sqrt((dca1 * dca1 + dca2 * dca2) / 2.); +} + //_______________________________________________________________________ } // namespace o2::aod::pwgem::dilepton::utils::pairutil #endif // PWGEM_DILEPTON_UTILS_PAIRUTILITIES_H_ From d485185bb97cad39d34b9d6698cff70cc28d1bb2 Mon Sep 17 00:00:00 2001 From: Sasha Bylinkin <37345380+abylinkin@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:53:33 +0100 Subject: [PATCH 134/459] [PWGUD] Mistype in histos names fixed (#8684) --- PWGUD/Tasks/sgPIDAnalyzer.cxx | 84 +++++++++++++++++------------------ 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/PWGUD/Tasks/sgPIDAnalyzer.cxx b/PWGUD/Tasks/sgPIDAnalyzer.cxx index 2ed954bf744..9a69891ee0a 100644 --- a/PWGUD/Tasks/sgPIDAnalyzer.cxx +++ b/PWGUD/Tasks/sgPIDAnalyzer.cxx @@ -112,47 +112,47 @@ struct sgPIDAnalyzer { histos.add("TPC/nTPC_De_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_De_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_Pi_Ka", "Positive TPC Pi vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_Pi_Pr", "Positive TPC Pi vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_Pi_El", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_Pi_De", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_Ka_Pi", "Positive TPC Ka vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_Ka_Pr", "Positive TPC Ka vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_Ka_El", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_Ka_De", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_Pr_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_Pr_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_Pr_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_Pr_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_El_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_El_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_El_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_El_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_De_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_De_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_De_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTOF_De_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_Pi_Ka", "Positive TPC Pi vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_Pi_Pr", "Positive TPC Pi vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_Pi_El", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_Pi_De", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_Ka_Pi", "Positive TPC Ka vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_Ka_Pr", "Positive TPC Ka vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_Ka_El", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_Ka_De", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_Pr_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_Pr_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_Pr_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_Pr_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_El_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_El_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_El_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_El_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_De_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_De_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_De_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/pTOF_De_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_Pi_Ka", "Positive TPC Pi vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_Pi_Pr", "Positive TPC Pi vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_Pi_El", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_Pi_De", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_Ka_Pi", "Positive TPC Ka vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_Ka_Pr", "Positive TPC Ka vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_Ka_El", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_Ka_De", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_Pr_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_Pr_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_Pr_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_Pr_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_El_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_El_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_El_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_El_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_De_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_De_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_De_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTOF_De_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_Pi_Ka", "Positive TPC Pi vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_Pi_Pr", "Positive TPC Pi vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_Pi_El", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_Pi_De", "Positive TPC Pi vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_Ka_Pi", "Positive TPC Ka vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_Ka_Pr", "Positive TPC Ka vs Pr", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_Ka_El", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_Ka_De", "Positive TPC Ka vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_Pr_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_Pr_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_Pr_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_Pr_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_El_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_El_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_El_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_El_De", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_De_Pi", "Positive TPC Pr vs Pi", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_De_Ka", "Positive TPC Pr vs Ka", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_De_Pr", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); + histos.add("TOF/nTOF_De_El", "Positive TPC Pr vs El", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TOF/pPi", "Positive TPC Pi vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); histos.add("TOF/nPi", "Negative TPC Pi vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); @@ -279,7 +279,7 @@ struct sgPIDAnalyzer { histos.fill(HIST("TOF/pTOF_Ka_Pi"), track.pt(), track.tofka()); histos.fill(HIST("TOF/pTOF_Pr_Pi"), track.pt(), track.tofpr()); histos.fill(HIST("TOF/pTOF_El_Pi"), track.pt(), track.tofel()); - histos.fill(HIST("TPF/pTOF_De_Pi"), track.pt(), track.tofde()); + histos.fill(HIST("TOF/pTOF_De_Pi"), track.pt(), track.tofde()); } if (std::abs(track.tofka()) < 1) { histos.fill(HIST("TOF/pTOF_Pi_Ka"), track.pt(), track.tofpi()); @@ -319,7 +319,7 @@ struct sgPIDAnalyzer { histos.fill(HIST("TOF/nTOF_Ka_Pi"), track.pt(), track.tofka()); histos.fill(HIST("TOF/nTOF_Pr_Pi"), track.pt(), track.tofpr()); histos.fill(HIST("TOF/nTOF_El_Pi"), track.pt(), track.tofel()); - histos.fill(HIST("TPF/nTOF_De_Pi"), track.pt(), track.tofde()); + histos.fill(HIST("TOF/nTOF_De_Pi"), track.pt(), track.tofde()); } if (std::abs(track.tofka()) < 1) { histos.fill(HIST("TOF/nTOF_Pi_Ka"), track.pt(), track.tofpi()); From 19e646f31a822ee4ec8c8d63cb524d36abff0217 Mon Sep 17 00:00:00 2001 From: mhartung71 <50153519+mhartung71@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:50:06 +0100 Subject: [PATCH 135/459] [PWGLF] Initial commit of KF hypernuclei task (#8612) Co-authored-by: ALICE Action Bot --- PWGLF/DataModel/LFHypernucleiKfTables.h | 230 ++++ PWGLF/TableProducer/Nuspex/CMakeLists.txt | 10 + PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx | 1223 +++++++++++++++++ .../TableProducer/Nuspex/hypKfTreeCreator.cxx | 768 +++++++++++ 4 files changed, 2231 insertions(+) create mode 100644 PWGLF/DataModel/LFHypernucleiKfTables.h create mode 100644 PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx create mode 100644 PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx diff --git a/PWGLF/DataModel/LFHypernucleiKfTables.h b/PWGLF/DataModel/LFHypernucleiKfTables.h new file mode 100644 index 00000000000..ed50e56b17f --- /dev/null +++ b/PWGLF/DataModel/LFHypernucleiKfTables.h @@ -0,0 +1,230 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +// authors Janik Ditzel and Michael Hartung + +#ifndef PWGLF_DATAMODEL_LFHYPERNUCLEIKFTABLES_H_ +#define PWGLF_DATAMODEL_LFHYPERNUCLEIKFTABLES_H_ + +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Common/DataModel/Centrality.h" +#include "Common/Core/RecoDecay.h" + +namespace o2::aod +{ +namespace hykfmcColl +{ +DECLARE_SOA_COLUMN(PassedEvSel, passedEvSel, bool); //! +} +DECLARE_SOA_TABLE(HypKfMcCollisions, "AOD", "HYPKFMCCOLL", + o2::soa::Index<>, + hykfmcColl::PassedEvSel, + mccollision::PosX, + mccollision::PosY, + mccollision::PosZ); +using HypKfMcCollision = HypKfMcCollisions::iterator; + +namespace hykfmc +{ +DECLARE_SOA_INDEX_COLUMN(HypKfMcCollision, hypKfMcCollision); +DECLARE_SOA_COLUMN(Species, species, int8_t); //! +DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); //! +DECLARE_SOA_COLUMN(Svx, svx, float); //! +DECLARE_SOA_COLUMN(Svy, svy, float); //! +DECLARE_SOA_COLUMN(Svz, svz, float); //! +DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) { return RecoDecay::pt(std::array{px, py}); }); +DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float E, float pz) { return 0.5 * TMath::Log((E + pz) / (E - pz)); }); +DECLARE_SOA_DYNAMIC_COLUMN(Mass, mass, [](float E, float px, float py, float pz) { return TMath::Sqrt(E * E - px * px - py * py - pz * pz); }); +DECLARE_SOA_DYNAMIC_COLUMN(IsMatter, isMatter, [](int pdgCode) { return pdgCode > 0; }); +} // namespace hykfmc + +DECLARE_SOA_TABLE(HypKfMcParticles, "AOD", "HYPKFMCPART", + o2::soa::Index<>, + hykfmc::HypKfMcCollisionId, + hykfmc::Species, + mcparticle::PdgCode, + hykfmc::IsPhysicalPrimary, + mcparticle::Px, + mcparticle::Py, + mcparticle::Pz, + mcparticle::E, + hykfmc::Svx, + hykfmc::Svy, + hykfmc::Svz, + hykfmc::Pt, + hykfmc::Y, + hykfmc::Mass, + hykfmc::IsMatter); +using HypKfMcParticle = HypKfMcParticles::iterator; + +DECLARE_SOA_TABLE(HypKfCollisions, "AOD", "HYPKFCOLL", + o2::soa::Index<>, + hykfmcColl::PassedEvSel, + hykfmc::HypKfMcCollisionId, + collision::PosX, + collision::PosY, + collision::PosZ, + cent::CentFT0A, + cent::CentFT0C, + cent::CentFT0M); +using HypKfCollision = HypKfCollisions::iterator; + +namespace hykftrk +{ +DECLARE_SOA_INDEX_COLUMN(HypKfCollision, hypKfCollision); +DECLARE_SOA_COLUMN(Rigidity, rigidity, float); //! +DECLARE_SOA_COLUMN(TPCnCluster, tpcNcluster, float); //! +DECLARE_SOA_COLUMN(TPCnSigma, tpcNsigma, float); //! +DECLARE_SOA_COLUMN(TPCnSigmaNhp, tpcNsigmaNhp, float); //! +DECLARE_SOA_COLUMN(TPCnSigmaNlp, tpcNsigmaNlp, float); //! +DECLARE_SOA_COLUMN(TOFMass, tofMass, float); //! +DECLARE_SOA_COLUMN(IsPVContributor, isPVContributor, bool); //! +DECLARE_SOA_COLUMN(SubMass, subMass, float); //! +DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) { return (double)pt * TMath::Cos(phi); }); +DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float pt, float phi) { return (double)pt * TMath::Sin(phi); }); +DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float pt, float eta) { return (double)pt * TMath::SinH(eta); }); +DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) { return pt * TMath::CosH(eta); }); // +DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float pt, float eta, float mass) { return std::log((RecoDecay::sqrtSumOfSquares(mass, pt * TMath::CosH(eta)) + pt * TMath::SinH(eta)) / RecoDecay::sqrtSumOfSquares(mass, pt)); }); +DECLARE_SOA_DYNAMIC_COLUMN(Lambda, lambda, [](float eta) { return 1. / TMath::CosH(eta); }); +DECLARE_SOA_DYNAMIC_COLUMN(ITSnCluster, itsNcluster, [](uint32_t itsClusterSizes) { + uint8_t n = 0; + for (uint8_t i = 0; i < 7; i++) { + if (itsClusterSizes >> (4 * i) & 15) + n++; + } + return n; +}); +DECLARE_SOA_DYNAMIC_COLUMN(ITSfirstLayer, itsFirstLayer, [](uint32_t itsClusterSizes) { + for (int i = 0; i < 8; i++) { + if (itsClusterSizes >> (4 * i) & 15) + return i; + } + return -999; +}); +DECLARE_SOA_DYNAMIC_COLUMN(ITSmeanClsSize, itsMeanClsSize, [](uint32_t itsClusterSizes) { + int sum = 0, n = 0; + for (int i = 0; i < 8; i++) { + sum += (itsClusterSizes >> (4 * i) & 15); + if (itsClusterSizes >> (4 * i) & 15) + n++; + } + return static_cast(sum) / n; +}); +} // namespace hykftrk + +DECLARE_SOA_TABLE(HypKfTracks, "AOD", "HYPKFTRACK", + o2::soa::Index<>, + hykfmc::Species, + track::Pt, + track::Eta, + track::Phi, + track::DcaXY, + track::DcaZ, + hykftrk::TPCnCluster, + track::TPCChi2NCl, + track::ITSClusterSizes, + track::ITSChi2NCl, + hykftrk::Rigidity, + track::TPCSignal, + hykftrk::TPCnSigma, + hykftrk::TPCnSigmaNhp, + hykftrk::TPCnSigmaNlp, + hykftrk::TOFMass, + hykftrk::IsPVContributor, + hykftrk::Px, + hykftrk::Py, + hykftrk::Pz, + hykftrk::P, + hykftrk::Lambda, + hykftrk::ITSnCluster, + hykftrk::ITSfirstLayer, + hykftrk::ITSmeanClsSize); +using HypKfTrack = HypKfTracks::iterator; + +DECLARE_SOA_TABLE(HypKfSubDaughters, "AOD", "HYPKFSUBD", + o2::soa::Index<>, + hykftrk::SubMass); +using HypKfSubDaughter = HypKfSubDaughters::iterator; + +DECLARE_SOA_TABLE(HypKfDaughterAddons, "AOD", "HYPKFDADD", + o2::soa::Index<>, + track::X, + track::Y, + track::Z, + mcparticle::Px, + mcparticle::Py, + mcparticle::Pz); +using HypKfDaughterAddon = HypKfDaughterAddons::iterator; + +namespace hykfhyp +{ +DECLARE_SOA_INDEX_COLUMN(HypKfCollision, hypKfCollision); +DECLARE_SOA_INDEX_COLUMN(HypKfMcParticle, hypKfMcParticle); +DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfDaughterAddon, addons); +DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfTrack, daughterTracks); +DECLARE_SOA_SELF_INDEX_COLUMN(HypDaughter, hypDaughter); +DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfSubDaughter, subDaughters); +DECLARE_SOA_COLUMN(Primary, primary, bool); //! +DECLARE_SOA_COLUMN(Mass, mass, float); //! +DECLARE_SOA_COLUMN(Px, px, float); //! +DECLARE_SOA_COLUMN(Py, py, float); //! +DECLARE_SOA_COLUMN(Pz, pz, float); //! +DECLARE_SOA_COLUMN(DcaToPvXY, dcaToPvXY, float); //! +DECLARE_SOA_COLUMN(DcaToPvZ, dcaToPvZ, float); //! +DECLARE_SOA_COLUMN(DcaToVtxXY, dcaToVtxXY, float); //! +DECLARE_SOA_COLUMN(DcaToVtxZ, dcaToVtxZ, float); //! +DECLARE_SOA_COLUMN(Chi2, chi2, float); //! +DECLARE_SOA_COLUMN(DevToPvXY, devToPvXY, float); //! +DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) { return RecoDecay::pt(px, py); }); +DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](float px, float py, float pz) { return RecoDecay::eta(std::array{px, py, pz}); }); +DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](float px, float py) { return RecoDecay::phi(std::array{px, py}); }); +DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float px, float py, float pz) { return RecoDecay::p(px, py, pz); }); // +DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float px, float py, float pz, float mass) { return RecoDecay::y(std::array{px, py, pz}, mass); }); +DECLARE_SOA_DYNAMIC_COLUMN(McTrue, mcTrue, [](int hypKfMcParticleId) { return hypKfMcParticleId > 0; }); +DECLARE_SOA_DYNAMIC_COLUMN(IsMatter, isMatter, [](int8_t species) { return species > 0; }); +DECLARE_SOA_DYNAMIC_COLUMN(Cascade, cascade, [](int hypDaughter) { return hypDaughter > 0; }); +} // namespace hykfhyp + +DECLARE_SOA_TABLE(HypKfHypNucs, "AOD", "HYPKFHYPNUC", + o2::soa::Index<>, + hykfhyp::HypKfMcParticleId, + hykfhyp::HypKfCollisionId, + hykfhyp::HypKfTrackIds, + hykfhyp::HypKfDaughterAddonIds, + hykfhyp::HypDaughterId, + hykfhyp::HypKfSubDaughterIds, + hykfmc::Species, + hykfhyp::Primary, + hykfhyp::Mass, + hykfhyp::Px, + hykfhyp::Py, + hykfhyp::Pz, + hykfhyp::DcaToPvXY, + hykfhyp::DcaToPvZ, + hykfhyp::DevToPvXY, + hykfhyp::DcaToVtxXY, + hykfhyp::DcaToVtxZ, + hykfhyp::Chi2, + hykfmc::Svx, + hykfmc::Svy, + hykfmc::Svz, + hykfhyp::Y, + hykfhyp::Pt, + hykfhyp::Eta, + hykfhyp::Phi, + hykfhyp::P, + hykfhyp::McTrue, + hykfhyp::IsMatter, + hykfhyp::Cascade); +using HypKfHypNuc = HypKfHypNucs::iterator; +} // namespace o2::aod + +#endif // PWGLF_DATAMODEL_LFHYPERNUCLEIKFTABLES_H_ diff --git a/PWGLF/TableProducer/Nuspex/CMakeLists.txt b/PWGLF/TableProducer/Nuspex/CMakeLists.txt index 8670f8c424d..29c6f4ea637 100644 --- a/PWGLF/TableProducer/Nuspex/CMakeLists.txt +++ b/PWGLF/TableProducer/Nuspex/CMakeLists.txt @@ -88,3 +88,13 @@ o2physics_add_dpl_workflow(threebody-kf-task SOURCES threebodyKFTask.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(hypernuclei-kf-reco-task + SOURCES hypKfRecoTask.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore KFParticle::KFParticle + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(hypernuclei-kf-tree-creator + SOURCES hypKfTreeCreator.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx new file mode 100644 index 00000000000..a1c4e21a9a7 --- /dev/null +++ b/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx @@ -0,0 +1,1223 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \brief Hypernuclei rconstruction using KGParticle package +/// \authors Janik Ditzel and Michael Hartung + +#include +#include +#include +#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "ReconstructionDataFormats/Track.h" +#include "Common/Core/RecoDecay.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Centrality.h" +#include "DetectorsBase/Propagator.h" +#include "DetectorsBase/GeometryManager.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Common/Core/PID/TPCPIDResponse.h" +#include "DataFormatsTPC/BetheBlochAleph.h" +#include "DCAFitter/DCAFitterN.h" +#include "Common/DataModel/PIDResponse.h" +#include "PWGLF/DataModel/LFHypernucleiKfTables.h" +#include "TRandom.h" +#include "Common/DataModel/CollisionAssociationTables.h" + +// KFParticle +#ifndef HomogeneousField +#define HomogeneousField +#endif +#include "KFParticle.h" +#include "KFPTrack.h" +#include "KFPVertex.h" +#include "KFParticleBase.h" +#include "KFVertex.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +using CollisionsFull = soa::Join; +using CollisionsFullMC = soa::Join; +using TracksFull = soa::Join; + +//---------------------------------------------------------------------------------------------------------------- + +namespace +{ +static const int nDaughterParticles = 6; +enum DAUGHTERS { kPion, + kProton, + kDeuteron, + kTriton, + kHe3, + kAlpha }; + +static const std::vector particleNames{"pion", "proton", "deuteron", "triton", "helion", "alpha"}; +static const std::vector particlePdgCodes{211, 2212, o2::constants::physics::kDeuteron, o2::constants::physics::kTriton, o2::constants::physics::kHelium3, o2::constants::physics::kAlpha}; +static const std::vector particleMasses{o2::constants::physics::MassPionCharged, o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron, o2::constants::physics::MassTriton, o2::constants::physics::MassHelium3, o2::constants::physics::MassAlpha}; +static const std::vector particleCharge{1, 1, 1, 1, 2, 2}; + +const int nBetheParams = 6; +static const std::vector betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"}; +constexpr double betheBlochDefault[nDaughterParticles][nBetheParams]{ + {14.182511, 3.784237, 0.010118, 1.775545, 0.742465, 0.09}, // pion + {23.248183, 2.357092, -0.143924, 2.178266, 0.416733, 0.09}, // proton + {12.881922, 3.775785, 0.062699, 2.452242, 1.049385, 0.09}, // deuteron + {0.313129, 181.664226, 2779397163087.684082, 2.130773, 29.609643, 0.09}, // triton + {70.584685, 3.196364, 0.133878, 2.731736, 1.675617, 0.09}, // helion + {105.625770, 0.868172, -0.871411, 1.895609, 0.046273, 0.09}}; // alpha + +const int nTrkSettings = 13; +static const std::vector trackPIDsettingsNames{"useBBparams", "minITSnCls", "minTPCnCls", "maxTPCchi2", "maxITSchi2", "minRigidity", "maxRigidity", "maxTPCnSigma", "TOFrequiredabove", "minTOFmass", "maxTOFmass", "minDcaToPvXY", "minDcaToPvZ"}; +constexpr double trackPIDsettings[nDaughterParticles][nTrkSettings]{ + {0, 0, 50, 5, 50, 0.2, 1.2, 3, -1, 0, 100, 0., 0.}, + {0, 0, 50, 5, 50, 0.5, 100, 3, -1, 0, 100, 0., 0.}, + {0, 0, 50, 5, 50, 0.5, 100, 3, -1, 0, 100, 0., 0.}, + {0, 0, 50, 5, 50, 0.5, 100, 3, -1, 0, 100, 0., 0.}, + {0, 0, 50, 5, 50, 0.5, 100, 3, -1, 0, 100, 0., 0.}, + {0, 0, 50, 5, 50, 0.5, 100, 3, -1, 0, 100, 0., 0.}}; + +static const int nHyperNuclei = 10; +static const std::vector hyperNucNames{"L->p+pi", "3LH->3He+pi", "3LH->d+p+pi", "4LH->4He+pi", "4LH->t+p+pi", "4LHe->3He+p+pi", "5LHe->4He+p+pi", "5LHe->3He+d+pi", "custom1", "custom2"}; +static const std::vector hyperNucEnabledLb{"enabled"}; +static const std::vector reduceLb{"reduce factor"}; +constexpr int hyperNucEnabled[nHyperNuclei][1]{{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}; +constexpr float reduceFactor[nHyperNuclei][1]{{1.}, {1.}, {1.}, {1.}, {1.}, {1.}, {1.}, {1.}, {1.}, {1.}}; +static const std::vector hyperNucPdgLb{"PDG code"}; +static constexpr int hyperNucPdgCodes[nHyperNuclei][1]{ + {3122}, + {o2::constants::physics::kHyperTriton}, + {o2::constants::physics::kHyperTriton}, + {o2::constants::physics::kHyperHydrogen4}, + {o2::constants::physics::kHyperHydrogen4}, + {o2::constants::physics::kHyperHelium4}, + {o2::constants::physics::kHyperHelium5}, + {o2::constants::physics::kHyperHelium5}, + {0}, + {0}}; +static const std::vector hyperNucDaughtersLb{"daughter1", "daughter2", "daughter3", "daughter4"}; +static const std::string hyperNucDaughters[nHyperNuclei][4]{{"proton", "pion", "none", "none"}, {"helion", "pion", "none", "none"}, {"deuteron", "proton", "pion", "none"}, {"alpha", "pion", "none", "none"}, {"triton", "proton", "pion", "none"}, {"helion", "proton", "pion", "none"}, {"alpha", "proton", "pion", "none"}, {"helion", "deuteron", "pion", "none"}, {"none", "none", "none", "none"}, {"none", "none", "none", "none"}}; // NOLINT: runtime/string +static const std::string hyperNucSigns[nHyperNuclei][4]{{"+", "-", "", ""}, {"+", "-", "", ""}, {"+", "+", "-", ""}, {"+", "-", "", ""}, {"+", "+", "-", ""}, {"+", "+", "-", ""}, {"+", "+", "-", ""}, {"+", "+", "-", ""}, {"", "", "", ""}, {"", "", "", ""}}; // NOLINT: runtime/string +const int nSelPrim = 8; +static const std::vector preSelectionPrimNames{"minMass", "maxMass", "minCt", "maxCt", "minCosPa", "maxDcaTracks", "maxDcaMotherToPvXY", "maxDcaMotherToPvZ"}; +constexpr double preSelectionsPrimaries[nHyperNuclei][nSelPrim]{ + {1.0, 1.3, 0, 100, -1., 100., 10., 10.}, + {2.9, 3.1, 0, 100, -1., 100., 10., 10.}, + {2.9, 3.1, 0, 100, -1., 100., 10., 10.}, + {3.6, 4.2, 0, 100, -1., 100., 10., 10.}, + {3.6, 4.2, 0, 100, -1., 100., 10., 10.}, + {3.6, 4.2, 0, 100, -1., 100., 10., 10.}, + {4.6, 5.2, 0, 100, -1., 100., 10., 10.}, + {4.6, 5.2, 0, 100, -1., 100., 10., 10.}, + {0.0, 9.9, 0, 100, -1., 100., 10., 10.}, + {0.0, 9.9, 0, 100, -1., 100., 10., 10.}}; +const int nSelSec = 8; +static const std::vector preSelectionSecNames{"minMass", "maxMass", "minCt", "maxCt", "minCosPaSv", "maxDcaTracks", "maxDcaMotherToSvXY", "maxDcaMotherToSvZ"}; +constexpr double preSelectionsSecondaries[nHyperNuclei][nSelSec]{ + {1.0, 1.3, 0, 100, -1., 100., 10., 10.}, + {2.9, 3.1, 0, 100, -1., 100., 10., 10.}, + {2.9, 3.1, 0, 100, -1., 100., 10., 10.}, + {3.6, 4.2, 0, 100, -1., 100., 10., 10.}, + {3.6, 4.2, 0, 100, -1., 100., 10., 10.}, + {3.6, 4.2, 0, 100, -1., 100., 10., 10.}, + {4.6, 5.2, 0, 100, -1., 100., 10., 10.}, + {4.6, 5.2, 0, 100, -1., 100., 10., 10.}, + {0.0, 9.9, 0, 100, -1., 100., 10., 10.}, + {0.0, 9.9, 0, 100, -1., 100., 10., 10.}}; + +static const int nCascades = 6; +static const std::vector cascadeNames{"4LLH->4LHe+pi", "4XHe->4LHe+pi", "custom1", "custom2", "custom3", "custom4"}; +constexpr int cascadeEnabled[nCascades][1]{{0}, {0}, {0}, {0}, {0}, {0}}; +constexpr int cascadePdgCodes[nCascades][1]{ + {1020010040}, + {1120010040}, + {0}, + {0}, + {0}, + {0}}; +static const std::vector cascadeHypDaughterLb{"hypernucleus"}; +static const std::string cascadeHypDaughter[nCascades][1]{{"4LHe->3He+p+pi"}, {"4LHe->3He+p+pi"}, {"none"}, {"none"}, {"none"}, {"none"}}; // NOLINT: runtime/string +static const std::vector cascadeDaughtersLb{"daughter2", "daughter3", "daughter4"}; +static const std::string cascadeDaughters[nCascades][3]{{"pion", "none", "none"}, {"pion", "none", "none"}, {"none", "none", "none"}, {"none", "none", "none"}, {"none", "none", "none"}, {"none", "none", "none"}}; // NOLINT: runtime/string +static const std::string cascadeSigns[nCascades][4]{{"+", "-", "", ""}, {"+", "-", "", ""}, {"", "", "", ""}, {"", "", "", ""}, {"", "", "", ""}, {"", "", "", ""}}; // NOLINT: runtime/string +const int nSelCas = 8; +static const std::vector preSelectionCascadeNames{"minMass", "maxMass", "minCt", "maxCt", "minCosPa", "maxDcaTracks", "maxDcaMotherToPvXY", "maxDcaMotherToPvZ"}; +constexpr double preSelectionsCascades[nCascades][nSelCas]{ + {3.9, 4.3, 0, 100, -1., 100., 10., 10.}, + {3.9, 4.3, 0, 100, -1., 100., 10., 10.}, + {3.9, 4.3, 0, 100, -1., 100., 10., 10.}, + {3.9, 4.3, 0, 100, -1., 100., 10., 10.}, + {3.9, 4.3, 0, 100, -1., 100., 10., 10.}, + {3.9, 4.3, 0, 100, -1., 100., 10., 10.}}; + +//---------------------------------------------------------------------------------------------------------------- +struct daughterParticle { + TString name; + int pdgCode; + double mass; + int charge; + double resolution; + std::vector betheParams; + + daughterParticle(std::string name_, int pdgCode_, double mass_, int charge_, LabeledArray bethe) + { + name = TString(name_); + pdgCode = pdgCode_; + mass = mass_; + charge = charge_; + resolution = bethe.get(name, "resolution"); + betheParams.clear(); + for (unsigned int i = 0; i < 5; i++) + betheParams.push_back(bethe.get(name, i)); + } + + void Print() + { + std::cout << std::endl + << "Daughter: " << name << std::endl; + std::cout << "PDG: " << pdgCode << ", Mass: " << mass << ", Charge: " << charge << std::endl; + for (double d : betheParams) + std::cout << d << ", " << std::flush; + std::cout << resolution << std::endl; + } +}; // class daughterParticle + +struct hyperNucleus { + TString name; + int pdgCode; + double massMax; + double massMin; + bool active; + std::vector daughters; + std::vector daughterTrackSigns; + + hyperNucleus(std::string name_, int pdgCode_, bool active_, std::vector daughters_, std::vector daughterTrackSigns_) + { + name = TString(name_); + pdgCode = pdgCode_; + active = active_; + for (int d : daughters_) + daughters.push_back(d); + for (int dc : daughterTrackSigns_) + daughterTrackSigns.push_back(dc); + } + hyperNucleus(std::string name_, int pdgCode_, bool active_, int hypDaughter, std::vector daughters_, std::vector daughterTrackSigns_) + { + daughters.push_back(hypDaughter); + name = TString(name_); + pdgCode = pdgCode_; + active = active_; + for (int d : daughters_) + daughters.push_back(d); + for (int dc : daughterTrackSigns_) + daughterTrackSigns.push_back(dc); + } + int GetNdaughters() { return static_cast(daughters.size()); } + const char* motherName() { return name.Contains("->") ? ((TString)name(0, name.First("-"))).Data() : name.Data(); } + const char* daughterNames() { return name.Contains("->") ? ((TString)name(name.First("-") + 2, name.Length())).Data() : ""; } + void Print() + { + std::cout << std::endl + << "Hypernucleus: " << name << " (" << pdgCode << "):" << (active ? " active" : " not active") << std::endl; + for (double d : daughters) + std::cout << d << ", " << std::flush; + for (double dc : daughterTrackSigns) + std::cout << dc << ", " << std::flush; + std::cout << std::endl + << std::endl; + } +}; // class hyperNucleus + +struct hyperNucCandidate { + int species; + KFParticle kfp; + std::vector kfpDaughters; + hyperNucCandidate* hypNucDaughter; + std::vector daughterTrackIds; + std::vector recoSV; + float devToVtx; + float dcaToVtxXY; + float dcaToVtxZ; + float chi2; + bool mcTrue; + bool isPhysPrimary; + bool isPrimaryCandidate, isSecondaryCandidate, isUsedSecondary; + int64_t mcParticleId; + int tableId; + + hyperNucCandidate(int species_, std::vector kfpDaughters_, std::vector daughterTrackIds_) : species(species_), hypNucDaughter(0), devToVtx(999), dcaToVtxXY(999), dcaToVtxZ(999), chi2(999), mcTrue(false), isPhysPrimary(false), isPrimaryCandidate(false), isSecondaryCandidate(false), isUsedSecondary(false), mcParticleId(-1), tableId(-1) + { + for (auto kfd : kfpDaughters_) + kfpDaughters.push_back(kfd); + for (auto dt : daughterTrackIds_) + daughterTrackIds.push_back(dt); + Init(); + } + hyperNucCandidate(int species_, hyperNucCandidate* hypNucDaughter_, std::vector kfpDaughters_, std::vector daughterTrackIds_) : species(species_), hypNucDaughter(hypNucDaughter_), devToVtx(999), dcaToVtxXY(999), dcaToVtxZ(999), chi2(999), mcTrue(false), isPhysPrimary(false), isPrimaryCandidate(false), isSecondaryCandidate(false), isUsedSecondary(false), mcParticleId(-1), tableId(-1) + { + for (auto kfd : kfpDaughters_) + kfpDaughters.push_back(kfd); + for (auto dt : daughterTrackIds_) + daughterTrackIds.push_back(dt); + Init(); + } + + void Init() + { + kfp.SetConstructMethod(2); + for (size_t i = 0; i < kfpDaughters.size(); i++) + kfp.AddDaughter(kfpDaughters.at(i)); + kfp.TransportToDecayVertex(); + chi2 = kfp.GetChi2() / kfp.GetNDF(); + recoSV.clear(); + recoSV.push_back(kfp.GetX()); + recoSV.push_back(kfp.GetY()); + recoSV.push_back(kfp.GetZ()); + } + bool CheckKfp() + { + if (kfp.GetMass() == 0) + return false; + if (std::isnan(kfp.GetMass())) + return false; + return true; + } + int GetDaughterTableId() + { + if (hypNucDaughter) + return hypNucDaughter->tableId; + return -1; + } + bool IsCascade() { return hypNucDaughter != 0; } + int GetSign() + { + if (kfp.GetQ() == 0) + return kfpDaughters.front().GetQ() / std::abs(kfpDaughters.front().GetQ()); + return kfp.GetQ() / std::abs(kfp.GetQ()); + } + int GetNdaughters() { return static_cast(kfpDaughters.size()); } + float GetDcaTracks() { return GetNdaughters() == 2 ? GetDcaTracks2() : GetMaxDcaToSv(); } + float GetDcaTracks2() { return kfpDaughters.at(0).GetDistanceFromParticle(kfpDaughters.at(1)); } + float GetMaxDcaToSv() + { + float maxDca = std::numeric_limits::lowest(); + for (auto& daughter : kfpDaughters) { + float dca = daughter.GetDistanceFromVertex(&recoSV[0]); + if (dca > maxDca) + maxDca = dca; + } + return maxDca; + } + float GetDcaMotherToVertex(std::vector vtx) { return kfp.GetDistanceFromVertex(&vtx[0]); } + double GetCpa(std::vector vtx) + { + kfp.TransportToDecayVertex(); + return RecoDecay::cpa(std::array{vtx[0], vtx[1], vtx[2]}, std::array{recoSV[0], recoSV[1], recoSV[2]}, std::array{kfp.GetPx(), kfp.GetPy(), kfp.GetPz()}); + ; + } + float GetCt(std::vector vtx) + { + float dl = 0; + for (size_t i = 0; i < vtx.size(); i++) { + float tmp = recoSV.at(i) - vtx.at(i); + dl += (tmp * tmp); + } + return TMath::Sqrt(dl) * kfp.GetMass() / kfp.GetP(); + } + float GetDcaMotherToVtxXY(std::vector vtx) { return kfp.GetDistanceFromVertexXY(&vtx[0]); } + float GetDcaMotherToVtxZ(std::vector vtx) + { + kfp.TransportToPoint(&vtx[0]); + return std::abs(kfp.GetZ() - vtx[2]); + } + void GetDaughterPosMom(int daughter, std::vector& posMom) + { + kfpDaughters.at(daughter).TransportToPoint(&recoSV[0]); + posMom.assign({kfpDaughters.at(daughter).GetX(), kfpDaughters.at(daughter).GetY(), kfpDaughters.at(daughter).GetZ(), kfpDaughters.at(daughter).GetPx(), kfpDaughters.at(daughter).GetPy(), kfpDaughters.at(daughter).GetPz()}); + } + void CalcDevToVtx(KFPVertex& vtx) { devToVtx = kfp.GetDeviationFromVertexXY(vtx); } + void CalcDevToVtx(hyperNucCandidate& cand) + { + devToVtx = kfp.GetDeviationFromParticleXY(cand.kfp); + dcaToVtxXY = GetDcaMotherToVtxXY(cand.recoSV); + dcaToVtxZ = GetDcaMotherToVtxZ(cand.recoSV); + } + float GetSubDaughterMass(int d1, int d2) + { + KFParticle subDaughter; + subDaughter.SetConstructMethod(2); + subDaughter.AddDaughter(kfpDaughters.at(d1)); + subDaughter.AddDaughter(kfpDaughters.at(d2)); + subDaughter.TransportToDecayVertex(); + return subDaughter.GetMass(); + } +}; // class hyperNucCandidate + +struct indexPairs { + std::vector> pairs; + + void Add(int64_t a, int b) { pairs.push_back({a, b}); } + void Clear() { pairs.clear(); } + bool GetIndex(int64_t a, int& b) + { + for (auto& pair : pairs) { + if (pair.first == a) { + b = pair.second; + return true; + } + } + return false; + } +}; // class indexPairs + +struct mcCollInfo { + bool hasRecoColl; + bool passedEvSel; + bool hasRecoParticle; + int tableIndex; + mcCollInfo() : hasRecoColl(false), passedEvSel(false), hasRecoParticle(false), tableIndex(-1) {} +}; // class mcCollInfo + +//---------------------------------------------------------------------------------------------------------------- +std::vector> hDeDx; +std::vector> hInvMass; +} // namespace + +//---------------------------------------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------------------------------------- +struct hypKfRecoTask { + + Produces outputMcCollisionTable; + Produces outputMcParticleTable; + Produces outputCollisionTable; + Produces outputTrackTable; + Produces outputDaughterAddonTable; + Produces outputSubDaughterTable; + Produces outputHypNucTable; + + Preslice perCollision = aod::track_association::collisionId; + + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Configurable cfgSaveOnlyMcTrue{"cfgSaveOnlyMcTrue", true, "save only MCtrue candidates"}; + Configurable cfgDebug{"cfgDebug", 1, "debug level"}; + + Configurable cfgRigidityCorrection{"cfgRigidityCorrection", false, "apply rigidity correction"}; + Configurable cfgCutEta{"cfgCutEta", 0.9f, "Eta range for tracks"}; + Configurable cfgUsePVcontributors{"cfgUsePVcontributors", true, "use tracks that are PV contibutors"}; + + Configurable> cfgHyperNucsActive{"cfgHyperNucsActive", {hyperNucEnabled[0], nHyperNuclei, 1, hyperNucNames, hyperNucEnabledLb}, "enable or disable reconstruction"}; + Configurable> cfgReduce{"cfgReduce", {reduceFactor[0], nHyperNuclei, 1, hyperNucNames, reduceLb}, "reconstruct only a percentage of all possible hypernuclei"}; + Configurable> cfgHyperNucPdg{"cfgHyperNucsPdg", {hyperNucPdgCodes[0], nHyperNuclei, 1, hyperNucNames, hyperNucPdgLb}, "PDG codes"}; + Configurable> cfgHyperNucDaughters{"cfgHyperNucDaughters", {hyperNucDaughters[0], nHyperNuclei, 4, hyperNucNames, hyperNucDaughtersLb}, "Daughter particles"}; + Configurable> cfgHyperNucSigns{"cfgHyperNucSigns", {hyperNucSigns[0], nHyperNuclei, 4, hyperNucNames, hyperNucDaughtersLb}, "Daughter signs"}; + + Configurable> cfgCascadesActive{"cfgCascadesActive", {cascadeEnabled[0], nCascades, 1, cascadeNames, hyperNucEnabledLb}, "enable or disable reconstruction"}; + Configurable> cfgCascadesPdg{"cfgCascadesPdg", {cascadePdgCodes[0], nCascades, 1, cascadeNames, hyperNucPdgLb}, "PDG codes"}; + Configurable> cfgCascadeHypDaughter{"cfgCascadeHypDaughter", {cascadeHypDaughter[0], nCascades, 1, cascadeNames, cascadeHypDaughterLb}, "Hyernuclei daugther"}; + Configurable> cfgCascadeDaughters{"cfgCascadeDaughters", {cascadeDaughters[0], nCascades, 3, cascadeNames, cascadeDaughtersLb}, "Daughter particles"}; + Configurable> cfgCascadeSigns{"cfgCascadeSigns", {cascadeSigns[0], nCascades, 4, cascadeNames, hyperNucDaughtersLb}, "Daughter signs"}; + + Configurable> cfgBetheBlochParams{"cfgBetheBlochParams", {betheBlochDefault[0], nDaughterParticles, nBetheParams, particleNames, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for light nuclei"}; + Configurable> cfgTrackPIDsettings{"cfgTrackPIDsettings", {trackPIDsettings[0], nDaughterParticles, nTrkSettings, particleNames, trackPIDsettingsNames}, "track selection and PID criteria"}; + Configurable> cfgPreSelectionsPrimaries{"cfgPreSelectionsPrimaries", {preSelectionsPrimaries[0], nHyperNuclei, nSelPrim, hyperNucNames, preSelectionPrimNames}, "selection criteria for primary hypernuclei"}; + Configurable> cfgPreSelectionsSecondaries{"cfgPreSelectionsSecondaries", {preSelectionsSecondaries[0], nHyperNuclei, nSelSec, hyperNucNames, preSelectionSecNames}, "selection criteria for secondary hypernuclei"}; + Configurable> cfgPreSelectionsCascades{"cfgPreSelectionsCascades", {preSelectionsCascades[0], nCascades, nSelCas, cascadeNames, preSelectionCascadeNames}, "selection criteria for cascade hypernuclei"}; + + // CCDB + Service ccdb; + Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; + Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; + Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + Configurable pidPath{"pidPath", "", "Path to the PID response object"}; + + std::vector daughterParticles; + std::vector> foundDaughters; + std::vector> singleHyperNucCandidates; // hypernuclei candidates + std::vector> cascadeHyperNucCandidates; // cascade candidates + std::vector singleHyperNuclei; + std::vector cascadeHyperNuclei; + std::vector primVtx; + std::vector cents; + std::vector mcCollInfos; + indexPairs trackIndices; + indexPairs mcPartIndices; + KFPVertex KfPrimVtx; + bool collHasCandidate, collHasMcTrueCandidate; + bool collPassedEvSel; + int64_t mcCollTableIndex; + int mRunNumber; + float d_bz; + TRandom rand; + //---------------------------------------------------------------------------------------------------------------- + + void init(InitContext const&) + { + mRunNumber = 0; + d_bz = 0; + rand.SetSeed(0); + + ccdb->setURL(ccdburl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); + + for (int i = 0; i < nDaughterParticles; i++) { // create daughterparticles + daughterParticles.push_back(daughterParticle(particleNames.at(i), particlePdgCodes.at(i), particleMasses.at(i), particleCharge.at(i), cfgBetheBlochParams)); + } + for (unsigned int i = 0; i < nHyperNuclei; i++) { // create hypernuclei + singleHyperNuclei.push_back(hyperNucleus(hyperNucNames.at(i), cfgHyperNucPdg->get(i, 0u), cfgHyperNucsActive->get(i, 0u), getDaughterVec(i, cfgHyperNucDaughters), getDaughterSignVec(i, cfgHyperNucSigns))); + } + for (unsigned int i = 0; i < nCascades; i++) { // create cascades + cascadeHyperNuclei.push_back(hyperNucleus(cascadeNames.at(i), cfgCascadesPdg->get(i, 0u), cfgCascadesActive->get(i, 0u), getHypDaughterVec(i, cfgCascadeHypDaughter), getDaughterVec(i, cfgCascadeDaughters), getDaughterSignVec(i, cfgCascadeSigns))); + } + + // define histogram axes + const AxisSpec axisMagField{10, -10., 10., "magnetic field"}; + const AxisSpec axisNev{3, 0., 3., "Number of events"}; + const AxisSpec axisRigidity{4000, -10., 10., "#it{p}^{TPC}/#it{z}"}; + const AxisSpec axisdEdx{2000, 0, 2000, "d#it{E}/d#it{x}"}; + const AxisSpec axisInvMass{1000, 1, 6, "inv mass"}; + + // create histograms + histos.add("histMagField", "histMagField", kTH1F, {axisMagField}); + histos.add("histNev", "histNev", kTH1F, {axisNev}); + hDeDx.resize(2 * nDaughterParticles + 2); + for (int i = 0; i < nDaughterParticles + 1; i++) { + TString histName = i < nDaughterParticles ? daughterParticles[i].name : "all"; + hDeDx[2 * i] = histos.add(Form("histdEdx_%s", histName.Data()), ";p_{TPC}/z (GeV/#it{c}); d#it{E}/d#it{x}", HistType::kTH2F, {axisRigidity, axisdEdx}); + hDeDx[2 * i + 1] = histos.add(Form("histdEdx_%s_Cuts", histName.Data()), ";p_{TPC}/z (GeV/#it{c}); d#it{E}/d#it{x}", HistType::kTH2F, {axisRigidity, axisdEdx}); + } + // create invariant mass histograms + hInvMass.resize(nHyperNuclei + nCascades); + int histCount = 0; + std::vector> hypNucVectors = {singleHyperNuclei, cascadeHyperNuclei}; + for (auto vec : hypNucVectors) { + for (auto nuc : vec) { + if (nuc.active) { + hInvMass[histCount] = histos.add(Form("h%d_%s", histCount, nuc.motherName()), ";;Counts", HistType::kTH1F, {axisInvMass}); + } + histCount++; + } + } + } + //---------------------------------------------------------------------------------------------------------------- + + void findDaughterParticles(aod::TrackAssoc const& tracksByColl, TracksFull const& tracks) + { + // track loop, store daughter candidates in std::vector + for (const auto& trackId : tracksByColl) { + const auto& track = tracks.rawIteratorAt(trackId.trackId()); + filldedx(track, nDaughterParticles); + if (std::abs(track.eta()) > cfgCutEta) + continue; + if (!cfgUsePVcontributors && track.isPVContributor()) + continue; + for (size_t i = 0; i < daughterParticles.size(); i++) { + if (track.tpcNClsFound() < cfgTrackPIDsettings->get(i, "minTPCnCls")) + continue; + if (track.tpcChi2NCl() > cfgTrackPIDsettings->get(i, "maxTPCchi2")) + continue; + if (track.itsNCls() < cfgTrackPIDsettings->get(i, "minITSnCls")) + continue; + if (track.itsChi2NCl() > cfgTrackPIDsettings->get(i, "maxITSchi2")) + continue; + if (std::abs(getTPCnSigma(track, daughterParticles.at(i))) > cfgTrackPIDsettings->get(i, "maxTPCnSigma")) + continue; + filldedx(track, i); + if (std::abs(track.dcaXY()) < cfgTrackPIDsettings->get(i, "minDcaToPvXY")) + continue; + if (std::abs(track.dcaZ()) < cfgTrackPIDsettings->get(i, "minDcaToPvZ")) + continue; + if (getRigidity(track) < cfgTrackPIDsettings->get(i, "minRigidity") || getRigidity(track) > cfgTrackPIDsettings->get(i, "maxRigidity")) + continue; + if (cfgTrackPIDsettings->get(i, "TOFrequiredabove") >= 0 && getRigidity(track) > cfgTrackPIDsettings->get(i, "TOFrequiredabove") && (track.mass() < cfgTrackPIDsettings->get(i, "minTOFmass") || track.mass() > cfgTrackPIDsettings->get(i, "maxTOFmass"))) + continue; + foundDaughters.at(i).push_back(track.globalIndex()); + } + } // track loop + } + + //---------------------------------------------------------------------------------------------------------------- + void checkMCTrueTracks(aod::McTrackLabels const& trackLabels, aod::McParticles const&) + { + for (int i = 0; i < nDaughterParticles; i++) { + auto& daughterVec = foundDaughters.at(i); + for (auto it = daughterVec.begin(); it < daughterVec.end(); it++) { + bool mcTrue = true; + const auto& mcLab = trackLabels.rawIteratorAt(*it); + if (!mcLab.has_mcParticle()) { + mcTrue = false; + } else { + const auto& mcPart = mcLab.mcParticle_as(); + if (std::abs(mcPart.pdgCode()) != daughterParticles.at(i).pdgCode) { + mcTrue = false; + } + if (!mcPart.has_mothers()) { + mcTrue = false; + } + } + if (!mcTrue) { + daughterVec.erase(it); + } + } + } + } + //---------------------------------------------------------------------------------------------------------------- + void createKFHypernuclei(TracksFull const& tracks) + { + // loop over all hypernuclei that are to be reconstructed + for (size_t hyperNucIter = 0; hyperNucIter < singleHyperNuclei.size(); hyperNucIter++) { + hyperNucleus* hyperNuc = &(singleHyperNuclei.at(hyperNucIter)); + if (!hyperNuc->active) + continue; + int nDaughters = hyperNuc->GetNdaughters(); + + std::vector::iterator> it; + int nCombinations = 1; + for (int i = 0; i < nDaughters; i++) { + nCombinations *= foundDaughters.at(hyperNuc->daughters.at(i)).size(); + it.push_back(foundDaughters.at(hyperNuc->daughters.at(i)).begin()); + } + if (!nCombinations) + continue; + while (it[0] != foundDaughters.at(hyperNuc->daughters.at(0)).end()) { + + // check for correct signs, avoid double usage of tracks + bool passedChecks = true; + int checkSign = 0; + std::vector vec; + for (int i = 0; i < nDaughters; i++) { + const auto& daughterTrack = tracks.rawIteratorAt(*(it[i])); + if (!i) + checkSign = daughterTrack.sign(); + if (daughterTrack.sign() != checkSign * hyperNuc->daughterTrackSigns.at(i) || std::find(vec.begin(), vec.end(), *it[i]) != vec.end()) { + passedChecks = false; + break; + } + vec.push_back(*it[i]); + } + if (passedChecks && rand.Rndm() <= cfgReduce->get((unsigned int)hyperNucIter, 0u)) { + // create daugther KFParticles + std::vector daughterIds; + std::vector daughterKfps; + for (int i = 0; i < nDaughters; i++) { + const auto& daughterTrack = tracks.rawIteratorAt(*(it[i])); + daughterIds.push_back(*(it[i])); + auto daughterMass = daughterParticles.at(hyperNuc->daughters.at(i)).mass; + auto daughterCharge = daughterParticles.at(hyperNuc->daughters.at(i)).charge; + daughterKfps.push_back(CreateKFParticle(daughterTrack, daughterMass, daughterCharge)); + } + + hyperNucCandidate candidate(hyperNucIter, daughterKfps, daughterIds); + bool isPrimCandidate = true, isSecCandidate = true; + if (candidate.CheckKfp()) { + // apply pre selections + candidate.CalcDevToVtx(KfPrimVtx); + if (candidate.kfp.GetMass() < cfgPreSelectionsPrimaries->get(hyperNucIter, "minMass") || candidate.kfp.GetMass() > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxMass")) + isPrimCandidate = false; + if (candidate.GetDcaTracks() > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxDcaTracks")) + isPrimCandidate = false; + if (candidate.GetCt(primVtx) < cfgPreSelectionsPrimaries->get(hyperNucIter, "minCt") || candidate.GetCt(primVtx) > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxCt")) + isPrimCandidate = false; + if (candidate.GetCpa(primVtx) < cfgPreSelectionsPrimaries->get(hyperNucIter, "minCosPa")) + isPrimCandidate = false; + if (candidate.GetDcaMotherToVtxXY(primVtx) > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxDcaMotherToPvXY")) + isPrimCandidate = false; + if (candidate.GetDcaMotherToVtxZ(primVtx) > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxDcaMotherToPvZ")) + isPrimCandidate = false; + if (isPrimCandidate) { + candidate.isPrimaryCandidate = true; + collHasCandidate = true; + } + if (candidate.kfp.GetMass() < cfgPreSelectionsSecondaries->get(hyperNucIter, "minMass") || candidate.kfp.GetMass() > cfgPreSelectionsSecondaries->get(hyperNucIter, "maxMass")) + isSecCandidate = false; + if (candidate.GetDcaTracks() > cfgPreSelectionsSecondaries->get(hyperNucIter, "maxDcaTracks")) + isSecCandidate = false; + if (candidate.GetCt(primVtx) < cfgPreSelectionsSecondaries->get(hyperNucIter, "minCt") || candidate.GetCt(primVtx) > cfgPreSelectionsSecondaries->get(hyperNucIter, "maxCt")) + isSecCandidate = false; + if (isSecCandidate) { + candidate.isSecondaryCandidate = true; + } + if (isPrimCandidate || isSecCandidate) + singleHyperNucCandidates.at(hyperNucIter).push_back(candidate); + } + } + it[nDaughters - 1]++; + for (int i = nDaughters - 1; i && it[i] == foundDaughters.at(hyperNuc->daughters.at(i)).end(); i--) { + it[i] = foundDaughters.at(hyperNuc->daughters.at(i)).begin(); + it[i - 1]++; + } + } + } + } + //---------------------------------------------------------------------------------------------------------------- + void createKFCascades(TracksFull const& tracks) + { + + // loop over all cascade hypernuclei that are to be reconstructed + for (size_t hyperNucIter = 0; hyperNucIter < cascadeHyperNuclei.size(); hyperNucIter++) { + hyperNucleus* hyperNuc = &(cascadeHyperNuclei.at(hyperNucIter)); + if (!hyperNuc->active) + continue; + int nDaughters = hyperNuc->GetNdaughters(); + + int nHypNucDaughters = singleHyperNucCandidates.at(hyperNuc->daughters.at(0)).size(); + std::vector vecHypNucDaughers; + for (int64_t i = 0; i < static_cast(nHypNucDaughters); i++) { + vecHypNucDaughers.push_back(i); + } + + std::vector::iterator> it; + int nCombinations = 1; + nCombinations *= nHypNucDaughters; + it.push_back(vecHypNucDaughers.begin()); + for (int i = 1; i < nDaughters; i++) { + nCombinations *= foundDaughters.at(hyperNuc->daughters.at(i)).size(); + it.push_back(foundDaughters.at(hyperNuc->daughters.at(i)).begin()); + } + if (!nCombinations) + continue; + while (it[0] != vecHypNucDaughers.end()) { + std::vector daughterIds; + std::vector daughterKfps; + + // select hypernuclei daughter KFParticle + auto hypNucDaughter = &(singleHyperNucCandidates.at(hyperNuc->daughters.at(0)).at(*it[0])); + // check for correct signs + int checkSign = hypNucDaughter->GetSign(); + bool passedChecks = true; + std::vector vec = hypNucDaughter->daughterTrackIds; + for (int i = 1; i < nDaughters; i++) { + const auto& daughterTrack = tracks.rawIteratorAt(*(it[i])); + if (!i) + checkSign = daughterTrack.sign(); + if (daughterTrack.sign() != checkSign * hyperNuc->daughterTrackSigns.at(i) || std::find(vec.begin(), vec.end(), *it[i]) != vec.end()) { + passedChecks = false; + break; + } + vec.push_back(*it[i]); + } + if (passedChecks && hypNucDaughter->isSecondaryCandidate) { + daughterKfps.push_back(hypNucDaughter->kfp); + for (int i = 1; i < nDaughters; i++) { + daughterIds.push_back(*(it[i])); + const auto& daughterTrack = tracks.rawIteratorAt(*(it[i])); + auto daughterMass = daughterParticles.at(hyperNuc->daughters.at(i)).mass; + auto daughterCharge = daughterParticles.at(hyperNuc->daughters.at(i)).charge; + daughterKfps.push_back(CreateKFParticle(daughterTrack, daughterMass, daughterCharge)); + } + + hyperNucCandidate candidate(hyperNucIter, hypNucDaughter, daughterKfps, daughterIds); + if (candidate.CheckKfp()) { + hypNucDaughter->CalcDevToVtx(candidate); + bool isCandidate = true; + // apply pre selections for hypernucleus daughter + if (hypNucDaughter->GetCpa(candidate.recoSV) < cfgPreSelectionsSecondaries->get(hyperNuc->daughters.at(0), "minCosPaSv")) + isCandidate = false; + if (hypNucDaughter->GetDcaMotherToVtxXY(candidate.recoSV) > cfgPreSelectionsSecondaries->get(hyperNuc->daughters.at(0), "maxDcaMotherToSvXY")) + isCandidate = false; + if (hypNucDaughter->GetDcaMotherToVtxZ(candidate.recoSV) > cfgPreSelectionsSecondaries->get(hyperNuc->daughters.at(0), "maxDcaMotherToSvZ")) + isCandidate = false; + // apply pre selections for cascade + if (candidate.kfp.GetMass() < cfgPreSelectionsCascades->get(hyperNucIter, "minMass") || candidate.kfp.GetMass() > cfgPreSelectionsCascades->get(hyperNucIter, "maxMass")) + isCandidate = false; + if (candidate.GetDcaTracks() > cfgPreSelectionsCascades->get(hyperNucIter, "maxDcaTracks")) + isCandidate = false; + if (candidate.GetCt(primVtx) < cfgPreSelectionsCascades->get(hyperNucIter, "minCt") || candidate.GetCt(primVtx) > cfgPreSelectionsCascades->get(hyperNucIter, "maxCt")) + isCandidate = false; + if (candidate.GetCpa(primVtx) < cfgPreSelectionsCascades->get(hyperNucIter, "minCosPa")) + isCandidate = false; + if (candidate.GetDcaMotherToVtxXY(primVtx) > cfgPreSelectionsCascades->get(hyperNucIter, "maxDcaMotherToPvXY")) + isCandidate = false; + if (candidate.GetDcaMotherToVtxZ(primVtx) > cfgPreSelectionsCascades->get(hyperNucIter, "maxDcaMotherToPvZ")) + isCandidate = false; + + if (isCandidate) { + collHasCandidate = true; + hypNucDaughter->isUsedSecondary = true; + cascadeHyperNucCandidates.at(hyperNucIter).push_back(candidate); + } + } + } + it[nDaughters - 1]++; + for (int i = nDaughters - 1; i && it[i] == foundDaughters.at(hyperNuc->daughters.at(i)).end(); i--) { + it[i] = foundDaughters.at(hyperNuc->daughters.at(i)).begin(); + it[i - 1]++; + } + } + } + } + //---------------------------------------------------------------------------------------------------------------- + void createMCinfo(aod::McTrackLabels const& trackLabels, aod::McCollisionLabels const&, aod::McParticles const& particlesMC, aod::McCollisions const&, bool cascadesOnly = false) + { + // check for mcTrue: single (primary & cascade daughter) and cascade hypernuclei + + std::vector*> hypNucVectors = {&singleHyperNuclei, &cascadeHyperNuclei}; + std::vector>*> candidateVectors = {&singleHyperNucCandidates, &cascadeHyperNucCandidates}; + const int nVecs = candidateVectors.size(); + + for (int vec = cascadesOnly ? 1 : 0; vec < nVecs; vec++) { + auto candidateVector = candidateVectors.at(vec); + for (size_t hyperNucIter = 0; hyperNucIter < hypNucVectors.at(vec)->size(); hyperNucIter++) { + hyperNucleus* hyperNuc = &(hypNucVectors.at(vec)->at(hyperNucIter)); + if (!hyperNuc->active) + continue; + for (auto& hypCand : candidateVector->at(hyperNucIter)) { + std::vector motherIds; + int daughterCount = 0; + if (hypCand.IsCascade()) { + if (!hypCand.hypNucDaughter->mcTrue) + continue; + const auto& mcPart = particlesMC.rawIteratorAt(hypCand.hypNucDaughter->mcParticleId); + if (!mcPart.has_mothers()) + continue; + daughterCount++; + for (auto& mother : mcPart.mothers_as()) { + if (mother.pdgCode() == hyperNuc->pdgCode * hypCand.GetSign()) { + motherIds.push_back(mother.globalIndex()); + break; + } + } + } + for (auto& daughter : hypCand.daughterTrackIds) { + const auto& mcLab = trackLabels.rawIteratorAt(daughter); + if (!mcLab.has_mcParticle()) + continue; + const auto& mcPart = mcLab.mcParticle_as(); + if (std::abs(mcPart.pdgCode()) != daughterParticles.at(hyperNuc->daughters.at(daughterCount++)).pdgCode) + continue; + if (!mcPart.has_mothers()) + continue; + for (auto& mother : mcPart.mothers_as()) { + if (mother.pdgCode() == hyperNuc->pdgCode * hypCand.GetSign()) { + motherIds.push_back(mother.globalIndex()); + break; + } + } + } + if (motherIds.size() != hyperNuc->daughters.size()) { + if (cfgSaveOnlyMcTrue) + hypCand.isSecondaryCandidate = false; + continue; + } + hypCand.mcTrue = true; + for (auto iter = motherIds.begin(); iter != motherIds.end() - 1; iter++) + if (*iter != *(iter + 1)) + hypCand.mcTrue = false; + if (hypCand.mcTrue) { + hypCand.mcParticleId = motherIds.front(); + collHasMcTrueCandidate = true; + } + if (!hypCand.mcTrue && cfgSaveOnlyMcTrue) + hypCand.isSecondaryCandidate = false; + } + } + } + } + //---------------------------------------------------------------------------------------------------------------- + + void fillTree(TracksFull const& tracks, bool saveOnlyMcTrue = false) + { + + outputCollisionTable( + collPassedEvSel, mcCollTableIndex, + primVtx.at(0), primVtx.at(1), primVtx.at(2), + cents.at(0), cents.at(1), cents.at(2)); + + std::vector*> hypNucVectors = {&singleHyperNuclei, &cascadeHyperNuclei}; + std::vector>*> candidateVectors = {&singleHyperNucCandidates, &cascadeHyperNucCandidates}; + + for (int vec = 0; vec < 2; vec++) { + auto candidateVector = candidateVectors.at(vec); + for (size_t hyperNucIter = 0; hyperNucIter < hypNucVectors.at(vec)->size(); hyperNucIter++) { + hyperNucleus* hyperNuc = &(hypNucVectors.at(vec)->at(hyperNucIter)); + if (!hyperNuc->active) + continue; + for (auto& hypCand : candidateVector->at(hyperNucIter)) { + if (!hypCand.isPrimaryCandidate && !hypCand.isUsedSecondary && !hypCand.IsCascade()) + continue; + if (saveOnlyMcTrue && !hypCand.mcTrue) + continue; + hInvMass[vec * nHyperNuclei + hyperNucIter]->Fill(hypCand.kfp.GetMass()); + std::vector vecDaugtherTracks, vecAddons, vecSubDaughters; + int daughterCount = 0; + for (auto daughterTrackId : hypCand.daughterTrackIds) { + int trackTableId; + if (!trackIndices.GetIndex(daughterTrackId, trackTableId)) { + auto daught = hyperNuc->daughters.at(daughterCount); + const auto& track = tracks.rawIteratorAt(daughterTrackId); + outputTrackTable( + hyperNuc->daughters.at(daughterCount) * track.sign(), + track.pt(), track.eta(), track.phi(), + track.dcaXY(), track.dcaZ(), + track.tpcNClsFound(), track.tpcChi2NCl(), + track.itsClusterSizes(), track.itsChi2NCl(), + getRigidity(track), track.tpcSignal(), getTPCnSigma(track, daughterParticles.at(daught)), + daught == kAlpha ? -999 : getTPCnSigma(track, daughterParticles.at(daught + 1)), + daught == kPion ? 999 : getTPCnSigma(track, daughterParticles.at(daught - 1)), + track.mass(), + track.isPVContributor()); + trackTableId = outputTrackTable.lastIndex(); + trackIndices.Add(daughterTrackId, trackTableId); + } + vecDaugtherTracks.push_back(trackTableId); + daughterCount++; + } + for (int i = 0; i < hypCand.GetNdaughters(); i++) { + std::vector posMom; + hypCand.GetDaughterPosMom(i, posMom); + outputDaughterAddonTable( + posMom.at(0), posMom.at(1), posMom.at(2), posMom.at(3), posMom.at(4), posMom.at(5)); + vecAddons.push_back(outputDaughterAddonTable.lastIndex()); + } + if (hypCand.GetNdaughters() > 2) { + for (int i = 0; i < hypCand.GetNdaughters(); i++) { + for (int j = i + 1; j < hypCand.GetNdaughters(); j++) { + outputSubDaughterTable(hypCand.GetSubDaughterMass(i, j)); + vecSubDaughters.push_back(outputSubDaughterTable.lastIndex()); + } + } + } + + hypCand.kfp.TransportToDecayVertex(); + int mcPartTableId; + outputHypNucTable( + mcPartIndices.GetIndex(hypCand.mcParticleId, mcPartTableId) ? mcPartTableId : -1, + outputCollisionTable.lastIndex(), vecDaugtherTracks, vecAddons, hypCand.GetDaughterTableId(), vecSubDaughters, + (vec * nHyperNuclei + hyperNucIter + 1) * hypCand.GetSign(), + hypCand.isPrimaryCandidate, hypCand.kfp.GetMass(), + hypCand.kfp.GetPx(), hypCand.kfp.GetPy(), hypCand.kfp.GetPz(), + hypCand.GetDcaMotherToVtxXY(primVtx), hypCand.GetDcaMotherToVtxZ(primVtx), + hypCand.devToVtx, hypCand.dcaToVtxXY, hypCand.dcaToVtxZ, hypCand.chi2, + hypCand.recoSV.at(0), hypCand.recoSV.at(1), hypCand.recoSV.at(2)); + hypCand.tableId = outputHypNucTable.lastIndex(); + } + } + } + } + //---------------------------------------------------------------------------------------------------------------- + + void processMC(CollisionsFullMC const& collisions, aod::McCollisions const& mcColls, TracksFull const& tracks, aod::BCsWithTimestamps const&, aod::McParticles const& particlesMC, aod::McTrackLabels const& trackLabelsMC, aod::McCollisionLabels const& collLabels, aod::TrackAssoc const& tracksColl) + { + + mcCollInfos.clear(); + mcCollInfos.resize(mcColls.size()); + mcPartIndices.Clear(); + for (const auto& collision : collisions) { + if (!collision.has_mcCollision()) + continue; + if (collision.sel8() && std::abs(collision.posZ()) < 10) + mcCollInfos.at(collision.mcCollisionId()).passedEvSel = true; + } + std::vector*> hypNucVectors = {&singleHyperNuclei, &cascadeHyperNuclei}; + for (auto& mcPart : particlesMC) { + for (int vec = 0; vec < 2; vec++) { + for (size_t hyperNucIter = 0; hyperNucIter < hypNucVectors.at(vec)->size(); hyperNucIter++) { + hyperNucleus* hyperNuc = &(hypNucVectors.at(vec)->at(hyperNucIter)); + if (!hyperNuc->active) + continue; + if (std::abs(mcPart.pdgCode()) != hyperNuc->pdgCode) + continue; + bool isDecayMode = false; + float svx, svy, svz; + int daughterPdg; + if (vec == 0) + daughterPdg = daughterParticles.at(hyperNuc->daughters.at(0)).pdgCode; + else + daughterPdg = singleHyperNuclei.at(hyperNuc->daughters.at(0)).pdgCode; + for (auto& mcDaught : mcPart.daughters_as()) { + if (std::abs(mcDaught.pdgCode()) == daughterPdg) { + isDecayMode = true; + svx = mcDaught.vx(); + svy = mcDaught.vy(); + svz = mcDaught.vz(); + break; + } + } + if (!isDecayMode) + continue; + + if (mcCollInfos.at(mcPart.mcCollisionId()).tableIndex < 0) { + outputMcCollisionTable( + mcCollInfos.at(mcPart.mcCollisionId()).passedEvSel, + mcPart.mcCollision().posX(), mcPart.mcCollision().posY(), mcPart.mcCollision().posZ()); + } + mcCollInfos.at(mcPart.mcCollisionId()).tableIndex = outputMcCollisionTable.lastIndex(); + + outputMcParticleTable( + mcCollInfos.at(mcPart.mcCollisionId()).tableIndex, + (vec * nHyperNuclei + hyperNucIter + 1) * (mcPart.pdgCode() > 0 ? +1 : -1), + mcPart.pdgCode(), + mcPart.isPhysicalPrimary(), + mcPart.px(), mcPart.py(), mcPart.pz(), + mcPart.e(), + svx, svy, svz); + mcPartIndices.Add(mcPart.globalIndex(), outputMcParticleTable.lastIndex()); + } + } + } + + for (const auto& collision : collisions) { + auto bc = collision.bc_as(); + initCCDB(bc); + initCollision(collision); + const uint64_t collIdx = collision.globalIndex(); + auto tracksByColl = tracksColl.sliceBy(perCollision, collIdx); + findDaughterParticles(tracksByColl, tracks); + if (cfgSaveOnlyMcTrue) + checkMCTrueTracks(trackLabelsMC, particlesMC); + createKFHypernuclei(tracks); + createMCinfo(trackLabelsMC, collLabels, particlesMC, mcColls); + createKFCascades(tracks); + createMCinfo(trackLabelsMC, collLabels, particlesMC, mcColls, true); + + if (!collHasCandidate) + continue; + if (cfgSaveOnlyMcTrue && !collHasMcTrueCandidate) + continue; + + mcCollTableIndex = -1; + if (collision.has_mcCollision()) { + mcCollTableIndex = mcCollInfos.at(collision.mcCollisionId()).tableIndex; + if (mcCollTableIndex < 0) { + outputMcCollisionTable( + mcCollInfos.at(collision.mcCollisionId()).passedEvSel, + collision.mcCollision().posX(), collision.mcCollision().posY(), collision.mcCollision().posZ()); + mcCollTableIndex = outputMcCollisionTable.lastIndex(); + mcCollInfos.at(collision.mcCollisionId()).tableIndex = mcCollTableIndex; + } + } + fillTree(tracks, cfgSaveOnlyMcTrue); + } + } + PROCESS_SWITCH(hypKfRecoTask, processMC, "MC analysis", true); + //---------------------------------------------------------------------------------------------------------------- + void processData(CollisionsFull const& collisions, TracksFull const& tracks, aod::BCsWithTimestamps const&, aod::TrackAssoc const& tracksColl) + { + + for (const auto& collision : collisions) { + auto bc = collision.bc_as(); + initCCDB(bc); + initCollision(collision); + const uint64_t collIdx = collision.globalIndex(); + auto tracksByColl = tracksColl.sliceBy(perCollision, collIdx); + findDaughterParticles(tracksByColl, tracks); + createKFHypernuclei(tracks); + createKFCascades(tracks); + if (!collHasCandidate) + continue; + mcCollTableIndex = -1; + fillTree(tracks); + } + } + PROCESS_SWITCH(hypKfRecoTask, processData, "data analysis", false); + //---------------------------------------------------------------------------------------------------------------- + void initCCDB(aod::BCsWithTimestamps::iterator const& bc) + { + if (mRunNumber == bc.runNumber()) { + return; + } + auto run3grp_timestamp = bc.timestamp(); + d_bz = 0; + o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(grpPath, run3grp_timestamp); + o2::parameters::GRPMagField* grpmag = 0x0; + if (grpo) { + o2::base::Propagator::initFieldFromGRP(grpo); + if (d_bz_input < -990) { + // Fetch magnetic field from ccdb for current collision + d_bz = grpo->getNominalL3Field(); + LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; + } else { + d_bz = d_bz_input; + } + } else { + grpmag = ccdb->getForTimeStamp(grpmagPath, run3grp_timestamp); + if (!grpmag) { + LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp; + } + o2::base::Propagator::initFieldFromGRP(grpmag); + if (d_bz_input < -990) { + // Fetch magnetic field from ccdb for current collision + d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f); + LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; + } else { + d_bz = d_bz_input; + } + } + mRunNumber = bc.runNumber(); + KFParticle::SetField(d_bz); + } + //---------------------------------------------------------------------------------------------------------------- + template + void initCollision(const T& collision) + { + foundDaughters.clear(); + foundDaughters.resize(nDaughterParticles); + singleHyperNucCandidates.clear(); + singleHyperNucCandidates.resize(nHyperNuclei); + cascadeHyperNucCandidates.clear(); + cascadeHyperNucCandidates.resize(nCascades); + trackIndices.Clear(); + collHasCandidate = false; + collHasMcTrueCandidate = false; + histos.fill(HIST("histMagField"), d_bz); + histos.fill(HIST("histNev"), 0.5); + + collPassedEvSel = collision.sel8() && std::abs(collision.posZ()) < 10; + if (collPassedEvSel) + histos.fill(HIST("histNev"), 1.5); + + KfPrimVtx = createKFPVertexFromCollision(collision); + primVtx.assign({collision.posX(), collision.posY(), collision.posZ()}); + cents.assign({collision.centFT0A(), collision.centFT0C(), collision.centFT0M()}); + } + + //---------------------------------------------------------------------------------------------------------------- + template + void filldedx(T const& track, int species) + { + const float rigidity = getRigidity(track); + hDeDx[2 * species]->Fill(track.sign() * rigidity, track.tpcSignal()); + if (track.tpcNClsFound() < 100 || track.itsNCls() < 2) + return; + hDeDx[2 * species + 1]->Fill(track.sign() * rigidity, track.tpcSignal()); + } + //---------------------------------------------------------------------------------------------------------------- + + template + float getTPCnSigma(T const& track, daughterParticle const& particle) + { + const float rigidity = getRigidity(track); + if (!track.hasTPC()) + return -999; + + if (particle.name == "pion" && cfgTrackPIDsettings->get("pion", "useBBparams") == 0) + return track.tpcNSigmaPi(); + if (particle.name == "proton" && cfgTrackPIDsettings->get("proton", "useBBparams") == 0) + return track.tpcNSigmaPr(); + if (particle.name == "deuteron" && cfgTrackPIDsettings->get("deuteron", "useBBparams") == 0) + return track.tpcNSigmaDe(); + if (particle.name == "triton" && cfgTrackPIDsettings->get("triton", "useBBparams") == 0) + return track.tpcNSigmaTr(); + if (particle.name == "helion" && cfgTrackPIDsettings->get("helion", "useBBparams") == 0) + return track.tpcNSigmaHe(); + if (particle.name == "alpha" && cfgTrackPIDsettings->get("alpha", "useBBparams") == 0) + return track.tpcNSigmaAl(); + + double expBethe{tpc::BetheBlochAleph(static_cast(particle.charge * rigidity / particle.mass), particle.betheParams[0], particle.betheParams[1], particle.betheParams[2], particle.betheParams[3], particle.betheParams[4])}; + double expSigma{expBethe * particle.resolution}; + float sigmaTPC = static_cast((track.tpcSignal() - expBethe) / expSigma); + return sigmaTPC; + } + //---------------------------------------------------------------------------------------------------------------- + + template + float getRigidity(T const& track) + { + if (!cfgRigidityCorrection) + return track.tpcInnerParam(); + bool hePID = track.pidForTracking() == o2::track::PID::Helium3 || track.pidForTracking() == o2::track::PID::Alpha; + return hePID ? track.tpcInnerParam() / 2 : track.tpcInnerParam(); + } + //---------------------------------------------------------------------------------------------------------------- + + template + KFParticle CreateKFParticle(const T& track, float mass, int charge) + { + auto trackparCov = getTrackParCov(track); + std::array fP; + std::array fM; + trackparCov.getXYZGlo(fP); + trackparCov.getPxPyPzGlo(fM); + float fPM[6]; + for (int i = 0; i < 3; i++) { + fPM[i] = fP[i]; + fPM[i + 3] = fM[i] * std::abs(charge); + } + std::array fC; + trackparCov.getCovXYZPxPyPzGlo(fC); + KFParticle part; + part.Create(fPM, fC.data(), std::abs(charge) * track.sign(), mass); + return part; + } + //---------------------------------------------------------------------------------------------------------------- + + template + KFPVertex createKFPVertexFromCollision(const T& collision) + { + KFPVertex kfpVertex; + kfpVertex.SetXYZ(collision.posX(), collision.posY(), collision.posZ()); + kfpVertex.SetCovarianceMatrix(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ()); + kfpVertex.SetChi2(collision.chi2()); + kfpVertex.SetNDF(2 * collision.numContrib() - 3); + kfpVertex.SetNContributors(collision.numContrib()); + return kfpVertex; + } + //---------------------------------------------------------------------------------------------------------------- + + int getHypDaughterVec(unsigned int cascade, LabeledArray cfg) + { + std::string daughter = cfg.get(cascade, 0u); + if (std::find(hyperNucNames.begin(), hyperNucNames.end(), daughter) == hyperNucNames.end()) + return -1; + return std::find(hyperNucNames.begin(), hyperNucNames.end(), daughter) - hyperNucNames.begin(); + } + //---------------------------------------------------------------------------------------------------------------- + std::vector getDaughterVec(unsigned int hypNuc, LabeledArray cfg) + { + std::vector vec; + for (unsigned int i = 0; i < 4; i++) { + std::string daughter = cfg.get(hypNuc, i); + if (std::find(particleNames.begin(), particleNames.end(), daughter) == particleNames.end()) + break; + vec.push_back(std::find(particleNames.begin(), particleNames.end(), daughter) - particleNames.begin()); + } + return vec; + } + //---------------------------------------------------------------------------------------------------------------- + + std::vector getDaughterSignVec(unsigned int hypNuc, LabeledArray cfg) + { + std::vector vec; + for (unsigned int i = 0; i < 4; i++) { + std::string sign = cfg.get(hypNuc, i); + if (sign != "+" && sign != "-") + break; + vec.push_back(sign == "+" ? +1 : -1); + } + return vec; + } + //---------------------------------------------------------------------------------------------------------------- + //---------------------------------------------------------------------------------------------------------------- +}; +//---------------------------------------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------------------------------------- +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} +//---------------------------------------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------------------------------------- diff --git a/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx b/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx new file mode 100644 index 00000000000..5666a06efc2 --- /dev/null +++ b/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx @@ -0,0 +1,768 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \brief Creates flat tree for ML analysis +/// \authors Janik Ditzel and Michael Hartung + +#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "ReconstructionDataFormats/Track.h" +#include "Common/Core/RecoDecay.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Centrality.h" +#include "DetectorsBase/Propagator.h" +#include "DetectorsBase/GeometryManager.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Common/Core/PID/TPCPIDResponse.h" +#include "DataFormatsTPC/BetheBlochAleph.h" +#include "DCAFitter/DCAFitterN.h" +#include "Common/DataModel/PIDResponse.h" +#include "PWGLF/DataModel/LFHypernucleiKfTables.h" + +using namespace o2; +using namespace o2::framework; +typedef std::array arr3; + +namespace +{ +std::vector> hPt; + +struct trackProperties { + trackProperties() : X(0), Y(0), Z(0), Px(0), Py(0), Pz(0), TPCnCls(0), ITSnCls(0), TPCchi2(0), ITSchi2(0), ITSmeanClsSize(0), ITSmeanClsSizeL(0), Rigidity(0), TPCsignal(0), TPCnSigma(0), TPCnSigmaNhp(0), TPCnSigmaNlp(0), TOFmass(0), DcaXY(0), DcaZ(0), IsPvContributor(0), SubMass(0) {} + float X, Y, Z, Px, Py, Pz; + uint8_t TPCnCls, ITSnCls; + float TPCchi2, ITSchi2, ITSmeanClsSize, ITSmeanClsSizeL; + float Rigidity, TPCsignal, TPCnSigma, TPCnSigmaNhp, TPCnSigmaNlp; + float TOFmass, DcaXY, DcaZ; + bool IsPvContributor; + float SubMass; +}; + +struct hyperNucleus { + hyperNucleus() : PdgCode(0), IsReconstructed(0), GlobalIndex(0), Species(0), IsMatter(0), PassedEvSel(0), IsMatterMC(0), PassedEvSelMC(0), IsPhysicalPrimary(0), CollisionMcTrue(0), Mass(0), Y(0), Pt(0), Ct(0), YGen(0), PtGen(0), CtGen(0), CpaPvGen(0), CpaPv(0), CpaSv(0), MaxDcaTracks(0), MaxDcaTracksSV(0), DcaToPvXY(0), DcaToPvZ(0), DcaToVtxXY(0), DcaToVtxZ(0), DevToPvXY(0), Chi2(0), Pvx(0), Pvy(0), Pvz(0), Svx(0), Svy(0), Svz(0), Px(0), Py(0), Pz(0), PvxGen(0), PvyGen(0), PvzGen(0), SvxGen(0), SvyGen(0), SvzGen(0), PxGen(0), PyGen(0), PzGen(0), NsingleDaughters(0), NcascadeDaughters(0), McTrue(0), MCTrueVtx(0), McPhysicalPrimary(0), HypNucDaughter(0) {} + int PdgCode, IsReconstructed, GlobalIndex; + uint8_t Species; + bool IsMatter, PassedEvSel, IsMatterMC, PassedEvSelMC, IsPhysicalPrimary, CollisionMcTrue; + float Mass, Y, Pt, Ct, YGen, PtGen, CtGen, CpaPvGen, CpaPv, CpaSv, MaxDcaTracks, MaxDcaTracksSV; + float DcaToPvXY, DcaToPvZ, DcaToVtxXY, DcaToVtxZ, DevToPvXY, Chi2; + float Pvx, Pvy, Pvz, Svx, Svy, Svz, Px, Py, Pz; + float PvxGen, PvyGen, PvzGen, SvxGen, SvyGen, SvzGen, PxGen, PyGen, PzGen; + int NsingleDaughters, NcascadeDaughters; + bool McTrue, MCTrueVtx, McPhysicalPrimary; + std::vector daughterTracks; + std::vector subDaughterMassVec; + hyperNucleus* HypNucDaughter; + ~hyperNucleus() + { + if (HypNucDaughter) + delete HypNucDaughter; + } +}; +} // namespace +namespace o2::aod +{ +namespace hypkftree +{ +DECLARE_SOA_COLUMN(Y, y, float); +DECLARE_SOA_COLUMN(Ct, ct, float); +DECLARE_SOA_COLUMN(YGen, yGen, float); +DECLARE_SOA_COLUMN(PtGen, ptGen, float); +DECLARE_SOA_COLUMN(CtGen, ctGen, float); +DECLARE_SOA_COLUMN(CpaPvGen, cpaPvGen, float); +DECLARE_SOA_COLUMN(DcaTracks, dcaTracks, float); +DECLARE_SOA_COLUMN(DcaTrackSv, dcaTrackSv, float); +DECLARE_SOA_COLUMN(CosPa, cosPa, double); +DECLARE_SOA_COLUMN(McTrue, mcTrue, bool); +DECLARE_SOA_COLUMN(Pvx, pvx, float); +DECLARE_SOA_COLUMN(Pvy, pvy, float); +DECLARE_SOA_COLUMN(Pvz, pvz, float); +DECLARE_SOA_COLUMN(Tvx, tvx, float); +DECLARE_SOA_COLUMN(Tvy, tvy, float); +DECLARE_SOA_COLUMN(Tvz, tvz, float); +DECLARE_SOA_COLUMN(PxGen, pxGen, float); +DECLARE_SOA_COLUMN(PyGen, pyGen, float); +DECLARE_SOA_COLUMN(PzGen, pzGen, float); +DECLARE_SOA_COLUMN(PvxGen, pvxGen, float); +DECLARE_SOA_COLUMN(PvyGen, pvyGen, float); +DECLARE_SOA_COLUMN(PvzGen, pvzGen, float); +DECLARE_SOA_COLUMN(SvxGen, svxGen, float); +DECLARE_SOA_COLUMN(SvyGen, svyGen, float); +DECLARE_SOA_COLUMN(SvzGen, svzGen, float); +DECLARE_SOA_COLUMN(TvxGen, tvxGen, float); +DECLARE_SOA_COLUMN(TvyGen, tvyGen, float); +DECLARE_SOA_COLUMN(TvzGen, tvzGen, float); +DECLARE_SOA_COLUMN(PassedEvSelMC, passedEvSelMC, bool); +DECLARE_SOA_COLUMN(IsMatter, isMatter, bool); +DECLARE_SOA_COLUMN(IsMatterGen, isMatterGen, bool); +DECLARE_SOA_COLUMN(IsReconstructed, isReconstructed, bool); +DECLARE_SOA_COLUMN(CollMcTrue, collMcTrue, bool); +DECLARE_SOA_COLUMN(D1X, d1X, float); +DECLARE_SOA_COLUMN(D1Y, d1Y, float); +DECLARE_SOA_COLUMN(D1Z, d1Z, float); +DECLARE_SOA_COLUMN(D1Px, d1Px, float); +DECLARE_SOA_COLUMN(D1Py, d1Py, float); +DECLARE_SOA_COLUMN(D1Pz, d1Pz, float); +DECLARE_SOA_COLUMN(D1TPCnCls, d1TPCnCls, uint8_t); +DECLARE_SOA_COLUMN(D1TPCchi2, d1TPCchi2, float); +DECLARE_SOA_COLUMN(D1ITSnCls, d1ITSnCls, uint8_t); +DECLARE_SOA_COLUMN(D1ITSchi2, d1ITSchi2, float); +DECLARE_SOA_COLUMN(D1ITSmeanClsSize, d1ITSmeanClsSize, float); +DECLARE_SOA_COLUMN(D1ITSmeanClsSizeL, d1ITSmeanClsSizeL, float); +DECLARE_SOA_COLUMN(D1Rigidity, d1Rigidity, float); +DECLARE_SOA_COLUMN(D1TPCsignal, d1TPCsignal, float); +DECLARE_SOA_COLUMN(D1TPCnSigma, d1TPCnSigma, float); +DECLARE_SOA_COLUMN(D1TPCnSigmaNhp, d1TPCnSigmaNhp, float); +DECLARE_SOA_COLUMN(D1TPCnSigmaNlp, d1TPCnSigmaNlp, float); +DECLARE_SOA_COLUMN(D1TOFmass, d1TOFmass, float); +DECLARE_SOA_COLUMN(D1DcaXY, d1DcaXY, float); +DECLARE_SOA_COLUMN(D1DcaZ, d1DcaZ, float); +DECLARE_SOA_COLUMN(D1IsPvContributor, d1IsPvContributor, bool); +DECLARE_SOA_COLUMN(D2X, d2X, float); +DECLARE_SOA_COLUMN(D2Y, d2Y, float); +DECLARE_SOA_COLUMN(D2Z, d2Z, float); +DECLARE_SOA_COLUMN(D2Px, d2Px, float); +DECLARE_SOA_COLUMN(D2Py, d2Py, float); +DECLARE_SOA_COLUMN(D2Pz, d2Pz, float); +DECLARE_SOA_COLUMN(D2TPCnCls, d2TPCnCls, uint8_t); +DECLARE_SOA_COLUMN(D2TPCchi2, d2TPCchi2, float); +DECLARE_SOA_COLUMN(D2ITSnCls, d2ITSnCls, uint8_t); +DECLARE_SOA_COLUMN(D2ITSchi2, d2ITSchi2, float); +DECLARE_SOA_COLUMN(D2ITSmeanClsSize, d2ITSmeanClsSize, float); +DECLARE_SOA_COLUMN(D2ITSmeanClsSizeL, d2ITSmeanClsSizeL, float); +DECLARE_SOA_COLUMN(D2Rigidity, d2Rigidity, float); +DECLARE_SOA_COLUMN(D2TPCsignal, d2TPCsignal, float); +DECLARE_SOA_COLUMN(D2TPCnSigma, d2TPCnSigma, float); +DECLARE_SOA_COLUMN(D2TPCnSigmaNhp, d2TPCnSigmaNhp, float); +DECLARE_SOA_COLUMN(D2TPCnSigmaNlp, d2TPCnSigmaNlp, float); +DECLARE_SOA_COLUMN(D2TOFmass, d2TOFmass, float); +DECLARE_SOA_COLUMN(D2DcaXY, d2DcaXY, float); +DECLARE_SOA_COLUMN(D2DcaZ, d2DcaZ, float); +DECLARE_SOA_COLUMN(D2IsPvContributor, d2IsPvContributor, bool); +DECLARE_SOA_COLUMN(D3X, d3X, float); +DECLARE_SOA_COLUMN(D3Y, d3Y, float); +DECLARE_SOA_COLUMN(D3Z, d3Z, float); +DECLARE_SOA_COLUMN(D3Px, d3Px, float); +DECLARE_SOA_COLUMN(D3Py, d3Py, float); +DECLARE_SOA_COLUMN(D3Pz, d3Pz, float); +DECLARE_SOA_COLUMN(D3TPCnCls, d3TPCnCls, uint8_t); +DECLARE_SOA_COLUMN(D3TPCchi2, d3TPCchi2, float); +DECLARE_SOA_COLUMN(D3ITSnCls, d3ITSnCls, uint8_t); +DECLARE_SOA_COLUMN(D3ITSchi2, d3ITSchi2, float); +DECLARE_SOA_COLUMN(D3ITSmeanClsSize, d3ITSmeanClsSize, float); +DECLARE_SOA_COLUMN(D3ITSmeanClsSizeL, d3ITSmeanClsSizeL, float); +DECLARE_SOA_COLUMN(D3Rigidity, d3Rigidity, float); +DECLARE_SOA_COLUMN(D3TPCsignal, d3TPCsignal, float); +DECLARE_SOA_COLUMN(D3TPCnSigma, d3TPCnSigma, float); +DECLARE_SOA_COLUMN(D3TPCnSigmaNhp, d3TPCnSigmaNhp, float); +DECLARE_SOA_COLUMN(D3TPCnSigmaNlp, d3TPCnSigmaNlp, float); +DECLARE_SOA_COLUMN(D3TOFmass, d3TOFmass, float); +DECLARE_SOA_COLUMN(D3DcaXY, d3DcaXY, float); +DECLARE_SOA_COLUMN(D3DcaZ, d3DcaZ, float); +DECLARE_SOA_COLUMN(D1D2Mass, d1d2Mass, float); +DECLARE_SOA_COLUMN(D1D3Mass, d1d3Mass, float); +DECLARE_SOA_COLUMN(D2D3Mass, d2d3Mass, float); +DECLARE_SOA_COLUMN(D3IsPvContributor, d3IsPvContributor, bool); +DECLARE_SOA_COLUMN(D0X, d0X, float); +DECLARE_SOA_COLUMN(D0Y, d0Y, float); +DECLARE_SOA_COLUMN(D0Z, d0Z, float); +DECLARE_SOA_COLUMN(D0Px, d0Px, float); +DECLARE_SOA_COLUMN(D0Py, d0Py, float); +DECLARE_SOA_COLUMN(D0Pz, d0Pz, float); +DECLARE_SOA_COLUMN(D0Mass, d0Mass, float); +DECLARE_SOA_COLUMN(D0Ct, d0ct, float); +DECLARE_SOA_COLUMN(D0CosPA, d0cosPa, float); +DECLARE_SOA_COLUMN(D0DcaTracks, d0dcaTracks, float); +DECLARE_SOA_COLUMN(D0DcaTracksTv, d0dcaTracksTv, float); +DECLARE_SOA_COLUMN(D0DcaToPvXY, d0dcaToPvXY, float); +DECLARE_SOA_COLUMN(D0DcaToPvZ, d0dcaToPvZ, float); +DECLARE_SOA_COLUMN(D0DcaToSvXY, d0dcaToSvXY, float); +DECLARE_SOA_COLUMN(D0DcaToSvZ, d0dcaToSvZ, float); +DECLARE_SOA_COLUMN(D0Chi2, d0chi2, float); +DECLARE_SOA_COLUMN(SD1X, sd1X, float); +DECLARE_SOA_COLUMN(SD1Y, sd1Y, float); +DECLARE_SOA_COLUMN(SD1Z, sd1Z, float); +DECLARE_SOA_COLUMN(SD1Px, sd1Px, float); +DECLARE_SOA_COLUMN(SD1Py, sd1Py, float); +DECLARE_SOA_COLUMN(SD1Pz, sd1Pz, float); +DECLARE_SOA_COLUMN(SD1TPCnCls, sd1TPCnCls, uint8_t); +DECLARE_SOA_COLUMN(SD1TPCchi2, sd1TPCchi2, float); +DECLARE_SOA_COLUMN(SD1ITSnCls, sd1ITSnCls, uint8_t); +DECLARE_SOA_COLUMN(SD1ITSchi2, sd1ITSchi2, float); +DECLARE_SOA_COLUMN(SD1ITSmeanClsSize, sd1ITSmeanClsSize, float); +DECLARE_SOA_COLUMN(SD1ITSmeanClsSizeL, sd1ITSmeanClsSizeL, float); +DECLARE_SOA_COLUMN(SD1Rigidity, sd1Rigidity, float); +DECLARE_SOA_COLUMN(SD1TPCsignal, sd1TPCsignal, float); +DECLARE_SOA_COLUMN(SD1TPCnSigma, sd1TPCnSigma, float); +DECLARE_SOA_COLUMN(SD1TPCnSigmaNhp, sd1TPCnSigmaNhp, float); +DECLARE_SOA_COLUMN(SD1TPCnSigmaNlp, sd1TPCnSigmaNlp, float); +DECLARE_SOA_COLUMN(SD1TOFmass, sd1TOFmass, float); +DECLARE_SOA_COLUMN(SD1DcaXY, sd1DcaXY, float); +DECLARE_SOA_COLUMN(SD1DcaZ, sd1DcaZ, float); +DECLARE_SOA_COLUMN(SD1IsPvContributor, sd1IsPvContributor, bool); +DECLARE_SOA_COLUMN(SD2X, sd2X, float); +DECLARE_SOA_COLUMN(SD2Y, sd2Y, float); +DECLARE_SOA_COLUMN(SD2Z, sd2Z, float); +DECLARE_SOA_COLUMN(SD2Px, sd2Px, float); +DECLARE_SOA_COLUMN(SD2Py, sd2Py, float); +DECLARE_SOA_COLUMN(SD2Pz, sd2Pz, float); +DECLARE_SOA_COLUMN(SD2TPCnCls, sd2TPCnCls, uint8_t); +DECLARE_SOA_COLUMN(SD2TPCchi2, sd2TPCchi2, float); +DECLARE_SOA_COLUMN(SD2ITSnCls, sd2ITSnCls, uint8_t); +DECLARE_SOA_COLUMN(SD2ITSchi2, sd2ITSchi2, float); +DECLARE_SOA_COLUMN(SD2ITSmeanClsSize, sd2ITSmeanClsSize, float); +DECLARE_SOA_COLUMN(SD2ITSmeanClsSizeL, sd2ITSmeanClsSizeL, float); +DECLARE_SOA_COLUMN(SD2Rigidity, sd2Rigidity, float); +DECLARE_SOA_COLUMN(SD2TPCsignal, sd2TPCsignal, float); +DECLARE_SOA_COLUMN(SD2TPCnSigma, sd2TPCnSigma, float); +DECLARE_SOA_COLUMN(SD2TPCnSigmaNhp, sd2TPCnSigmaNhp, float); +DECLARE_SOA_COLUMN(SD2TPCnSigmaNlp, sd2TPCnSigmaNlp, float); +DECLARE_SOA_COLUMN(SD2TOFmass, sd2TOFmass, float); +DECLARE_SOA_COLUMN(SD2DcaXY, sd2DcaXY, float); +DECLARE_SOA_COLUMN(SD2DcaZ, sd2DcaZ, float); +DECLARE_SOA_COLUMN(SD2IsPvContributor, sd2IsPvContributor, bool); +DECLARE_SOA_COLUMN(SD3X, sd3X, float); +DECLARE_SOA_COLUMN(SD3Y, sd3Y, float); +DECLARE_SOA_COLUMN(SD3Z, sd3Z, float); +DECLARE_SOA_COLUMN(SD3Px, sd3Px, float); +DECLARE_SOA_COLUMN(SD3Py, sd3Py, float); +DECLARE_SOA_COLUMN(SD3Pz, sd3Pz, float); +DECLARE_SOA_COLUMN(SD3TPCnCls, sd3TPCnCls, uint8_t); +DECLARE_SOA_COLUMN(SD3TPCchi2, sd3TPCchi2, float); +DECLARE_SOA_COLUMN(SD3ITSnCls, sd3ITSnCls, uint8_t); +DECLARE_SOA_COLUMN(SD3ITSchi2, sd3ITSchi2, float); +DECLARE_SOA_COLUMN(SD3ITSmeanClsSize, sd3ITSmeanClsSize, float); +DECLARE_SOA_COLUMN(SD3ITSmeanClsSizeL, sd3ITSmeanClsSizeL, float); +DECLARE_SOA_COLUMN(SD3Rigidity, sd3Rigidity, float); +DECLARE_SOA_COLUMN(SD3TPCsignal, sd3TPCsignal, float); +DECLARE_SOA_COLUMN(SD3TPCnSigma, sd3TPCnSigma, float); +DECLARE_SOA_COLUMN(SD3TPCnSigmaNhp, sd3TPCnSigmaNhp, float); +DECLARE_SOA_COLUMN(SD3TPCnSigmaNlp, sd3TPCnSigmaNlp, float); +DECLARE_SOA_COLUMN(SD3TOFmass, sd3TOFmass, float); +DECLARE_SOA_COLUMN(SD3DcaXY, sd3DcaXY, float); +DECLARE_SOA_COLUMN(SD3DcaZ, sd3DcaZ, float); +DECLARE_SOA_COLUMN(SD3IsPvContributor, sd3IsPvContributor, bool); +DECLARE_SOA_COLUMN(SD1SD2Mass, sd1sd2Mass, float); +DECLARE_SOA_COLUMN(SD1SD3Mass, sd1sd3Mass, float); +DECLARE_SOA_COLUMN(SD2SD3Mass, sd2sd3Mass, float); +} // namespace hypkftree + +#define HYPKFGENBASE mcparticle::PdgCode, hypkftree::IsMatterGen, hypkftree::IsReconstructed, hykfmc::IsPhysicalPrimary, hypkftree::PassedEvSelMC, hypkftree::YGen, hypkftree::PtGen, hypkftree::CtGen + +#define HYPKFGENEXT hypkftree::CpaPvGen, hypkftree::PxGen, hypkftree::PyGen, hypkftree::PzGen, hypkftree::PvxGen, hypkftree::PvyGen, hypkftree::PvzGen, hypkftree::SvxGen, hypkftree::SvyGen, hypkftree::SvzGen + +#define HYPKFGENCAS hypkftree::TvxGen, hypkftree::TvyGen, hypkftree::TvzGen + +#define HYPKFHYPNUC hykfmc::Species, hypkftree::IsMatter, hykfmcColl::PassedEvSel, hykfhyp::Mass, hypkftree::Y, track::Pt, hypkftree::Ct, hypkftree::CosPa, hypkftree::DcaTracks, hykfhyp::DcaToPvXY, hykfhyp::DcaToPvZ, hykfhyp::DevToPvXY, hykfhyp::Chi2, hypkftree::Pvx, hypkftree::Pvy, hypkftree::Pvz, hykfmc::Svx, hykfmc::Svy, hykfmc::Svz, hykfhyp::Px, hykfhyp::Py, hykfhyp::Pz, hypkftree::CollMcTrue + +#define HYPKFHYPNUCMC hypkftree::McTrue, hykfmc::IsPhysicalPrimary + +#define HYPKFD0 hypkftree::Tvx, hypkftree::Tvy, hypkftree::Tvz, hypkftree::D0X, hypkftree::D0Y, hypkftree::D0Z, hypkftree::D0Px, hypkftree::D0Py, hypkftree::D0Pz, hypkftree::D0Mass, hypkftree::D0Ct, hypkftree::D0CosPA, hypkftree::D0DcaTracks, hypkftree::D0DcaToPvXY, hypkftree::D0DcaToPvZ, hypkftree::D0DcaToSvXY, hypkftree::D0DcaToSvZ, hypkftree::D0Chi2 + +#define HYPKFD1 hypkftree::D1X, hypkftree::D1Y, hypkftree::D1Z, hypkftree::D1Px, hypkftree::D1Py, hypkftree::D1Pz, hypkftree::D1TPCnCls, hypkftree::D1TPCchi2, hypkftree::D1ITSnCls, hypkftree::D1ITSchi2, hypkftree::D1ITSmeanClsSize, hypkftree::D1ITSmeanClsSizeL, hypkftree::D1Rigidity, hypkftree::D1TPCsignal, hypkftree::D1TPCnSigma, hypkftree::D1TPCnSigmaNhp, hypkftree::D1TPCnSigmaNlp, hypkftree::D1TOFmass, hypkftree::D1DcaXY, hypkftree::D1DcaZ, hypkftree::D1IsPvContributor + +#define HYPKFD2 hypkftree::D2X, hypkftree::D2Y, hypkftree::D2Z, hypkftree::D2Px, hypkftree::D2Py, hypkftree::D2Pz, hypkftree::D2TPCnCls, hypkftree::D2TPCchi2, hypkftree::D2ITSnCls, hypkftree::D2ITSchi2, hypkftree::D2ITSmeanClsSize, hypkftree::D2ITSmeanClsSizeL, hypkftree::D2Rigidity, hypkftree::D2TPCsignal, hypkftree::D2TPCnSigma, hypkftree::D2TPCnSigmaNhp, hypkftree::D2TPCnSigmaNlp, hypkftree::D2TOFmass, hypkftree::D2DcaXY, hypkftree::D2DcaZ, hypkftree::D2IsPvContributor + +#define HYPKFD3 hypkftree::D3X, hypkftree::D3Y, hypkftree::D3Z, hypkftree::D3Px, hypkftree::D3Py, hypkftree::D3Pz, hypkftree::D3TPCnCls, hypkftree::D3TPCchi2, hypkftree::D3ITSnCls, hypkftree::D3ITSchi2, hypkftree::D3ITSmeanClsSize, hypkftree::D3ITSmeanClsSizeL, hypkftree::D3Rigidity, hypkftree::D3TPCsignal, hypkftree::D3TPCnSigma, hypkftree::D3TPCnSigmaNhp, hypkftree::D3TPCnSigmaNlp, hypkftree::D3TOFmass, hypkftree::D3DcaXY, hypkftree::D3DcaZ, hypkftree::D3IsPvContributor + +#define HYPKFSD1 hypkftree::SD1X, hypkftree::SD1Y, hypkftree::SD1Z, hypkftree::SD1Px, hypkftree::SD1Py, hypkftree::SD1Pz, hypkftree::SD1TPCnCls, hypkftree::SD1TPCchi2, hypkftree::SD1ITSnCls, hypkftree::SD1ITSchi2, hypkftree::SD1ITSmeanClsSize, hypkftree::SD1ITSmeanClsSizeL, hypkftree::SD1Rigidity, hypkftree::SD1TPCsignal, hypkftree::SD1TPCnSigma, hypkftree::SD1TPCnSigmaNhp, hypkftree::SD1TPCnSigmaNlp, hypkftree::SD1TOFmass, hypkftree::SD1DcaXY, hypkftree::SD1DcaZ, hypkftree::SD1IsPvContributor + +#define HYPKFSD2 hypkftree::SD2X, hypkftree::SD2Y, hypkftree::SD2Z, hypkftree::SD2Px, hypkftree::SD2Py, hypkftree::SD2Pz, hypkftree::SD2TPCnCls, hypkftree::SD2TPCchi2, hypkftree::SD2ITSnCls, hypkftree::SD2ITSchi2, hypkftree::SD2ITSmeanClsSize, hypkftree::SD2ITSmeanClsSizeL, hypkftree::SD2Rigidity, hypkftree::SD2TPCsignal, hypkftree::SD2TPCnSigma, hypkftree::SD2TPCnSigmaNhp, hypkftree::SD2TPCnSigmaNlp, hypkftree::SD2TOFmass, hypkftree::SD2DcaXY, hypkftree::SD2DcaZ, hypkftree::SD2IsPvContributor + +#define HYPKFSD3 hypkftree::SD3X, hypkftree::SD3Y, hypkftree::SD3Z, hypkftree::SD3Px, hypkftree::SD3Py, hypkftree::SD3Pz, hypkftree::SD3TPCnCls, hypkftree::SD3TPCchi2, hypkftree::SD3ITSnCls, hypkftree::SD3ITSchi2, hypkftree::SD3ITSmeanClsSize, hypkftree::SD3ITSmeanClsSizeL, hypkftree::SD3Rigidity, hypkftree::SD3TPCsignal, hypkftree::SD3TPCnSigma, hypkftree::SD3TPCnSigmaNhp, hypkftree::SD3TPCnSigmaNlp, hypkftree::SD3TOFmass, hypkftree::SD3DcaXY, hypkftree::SD3DcaZ, hypkftree::SD3IsPvContributor + +#define HYPKFSDMASS hypkftree::D1D2Mass, hypkftree::D1D3Mass, hypkftree::D2D3Mass +#define HYPKFSSDMASS hypkftree::SD1SD2Mass, hypkftree::SD1SD3Mass, hypkftree::SD2SD3Mass + +DECLARE_SOA_TABLE(HypKfGens, "AOD", "HYPKFGEN", HYPKFGENBASE); +using HypKfGen = HypKfGens::iterator; + +DECLARE_SOA_TABLE(HypKfSingleTwoBodyCandidates, "AOD", "HYPKFCAND2", HYPKFHYPNUC, HYPKFHYPNUCMC, HYPKFD1, HYPKFD2); +using HypKfSingleTwoBodyCandidate = HypKfSingleTwoBodyCandidates::iterator; + +DECLARE_SOA_TABLE(HypKfMcSingleTwoBodyCandidates, "AOD", "HYPKFMCCAND2", HYPKFGENBASE, HYPKFGENEXT, HYPKFHYPNUC, HYPKFD1, HYPKFD2); +using HypKfMcSingleTwoBodyCandidate = HypKfMcSingleTwoBodyCandidates::iterator; + +DECLARE_SOA_TABLE(HypKfSingleThreeBodyCandidates, "AOD", "HYPKFCAND3", HYPKFHYPNUC, HYPKFHYPNUCMC, HYPKFD1, HYPKFD2, HYPKFD3, HYPKFSDMASS); +using HypKfSingleThreeBodyCandidate = HypKfSingleThreeBodyCandidates::iterator; + +DECLARE_SOA_TABLE(HypKfMcSingleThreeBodyCandidates, "AOD", "HYPKFMCCAND3", HYPKFGENBASE, HYPKFGENEXT, HYPKFHYPNUC, HYPKFD1, HYPKFD2, HYPKFD3, HYPKFSDMASS); +using HypKfMcSingleThreeBodyCandidate = HypKfMcSingleThreeBodyCandidates::iterator; + +DECLARE_SOA_TABLE(HypKfCascadeTwoThreeCandidates, "AOD", "HYPKFCAND23", HYPKFHYPNUC, HYPKFHYPNUCMC, HYPKFD0, HYPKFD1, HYPKFSD1, HYPKFSD2, HYPKFSD3, HYPKFSSDMASS); +using HypKfCascadeTwoThreeCandidate = HypKfCascadeTwoThreeCandidates::iterator; + +DECLARE_SOA_TABLE(HypKfMcCascadeTwoThreeCandidates, "AOD", "HYPKFMCCAND23", HYPKFGENBASE, HYPKFGENEXT, HYPKFHYPNUC, HYPKFD0, HYPKFD1, HYPKFSD1, HYPKFSD2, HYPKFSD3, HYPKFSSDMASS); +using HypKfMcCascadeTwoThreeCandidate = HypKfMcCascadeTwoThreeCandidates::iterator; + +DECLARE_SOA_TABLE(HypKfCascadeThreeTwoCandidates, "AOD", "HYPKFCAND32", HYPKFHYPNUC, HYPKFHYPNUCMC, HYPKFD0, HYPKFD1, HYPKFD2, HYPKFSDMASS, HYPKFSD1, HYPKFSD2); +using HypKfCascadeThreeTwoCandidate = HypKfCascadeThreeTwoCandidates::iterator; + +DECLARE_SOA_TABLE(HypKfMcCascadeThreeTwoCandidates, "AOD", "HYPKFMCCAND32", HYPKFGENBASE, HYPKFGENEXT, HYPKFHYPNUC, HYPKFD0, HYPKFD1, HYPKFD2, HYPKFSDMASS, HYPKFSD1, HYPKFSD2); +using HypKfMcCascadeThreeTwoCandidate = HypKfMcCascadeThreeTwoCandidates::iterator; +} // namespace o2::aod + +struct hypKfTreeCreator { + + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + Produces outputMcGenTable; + Produces outputTableTwo; + Produces outputTableMcTwo; + Produces outputTableThree; + Produces outputTableMcThree; + Produces outputTableTwoThree; + Produces outputTableMcTwoThree; + Produces outputTableThreeTwo; + Produces outputTableMcThreeTwo; + PresliceUnsorted perMcParticle = aod::hykfhyp::hypKfMcParticleId; + + Configurable cfgSpecies{"cfgSpecies", 0, "Select species"}; + Configurable cfgNprimDaughters{"cfgNprimDaughters", 0, "Number of primary daughters"}; + Configurable cfgNsecDaughters{"cfgNsecDaughters", 0, "Number of secondary daughters (cascades only)"}; + Configurable cfgMCGenerated{"cfgMCGenerated", false, "create MC generated tree"}; + Configurable cfgMCReconstructed{"cfgMCReconstructed", false, "create MC reconstructed tree"}; + Configurable cfgMCCombined{"cfgMCCombined", false, "create MC tree containig generated and reconstructed"}; + + bool isMC; + //___________________________________________________________________________________________________________________________________________________________ + + void init(InitContext const&) + { + const AxisSpec axisPt{10, 0., 10., "#it{p}_{T} (GeV/#it{c})"}; + hPt.resize(3); + hPt[0] = histos.add("hGen", "", HistType::kTH1F, {axisPt}); + hPt[0]->Sumw2(); + hPt[1] = histos.add("hRec", "", HistType::kTH1F, {axisPt}); + hPt[1]->Sumw2(); + hPt[2] = histos.add("hEff", "", HistType::kTH1F, {axisPt}); + isMC = false; + } + //___________________________________________________________________________________________________________________________________________________________ + + void processData(aod::HypKfHypNucs const& hypNucs, aod::HypKfCollisions const& hypKfColls, aod::HypKfTracks const& hypKfTrks, aod::HypKfDaughterAddons const& hypKfDAdd, aod::HypKfSubDaughters const& hypKfDSub) + { + for (auto& hypNuc : hypNucs) { + if (std::abs(hypNuc.species()) != cfgSpecies) + continue; + hyperNucleus candidate, hypDaughter, dummy; + fillCandidate(candidate, hypDaughter, hypNuc, hypNucs, hypKfColls, hypKfTrks, hypKfDAdd, hypKfDSub); + if (cfgNsecDaughters) { + fillCandidate(hypDaughter, dummy, hypNucs.rawIteratorAt(hypNuc.hypDaughterId()), hypNucs, hypKfColls, hypKfTrks, hypKfDAdd, hypKfDSub); + } + fillTable(candidate, hypDaughter); + } + } + PROCESS_SWITCH(hypKfTreeCreator, processData, "single tree", false); + //___________________________________________________________________________________________________________________________________________________________ + void fillTable(hyperNucleus& cand, hyperNucleus& hypDaughter) + { + if (isMC && cfgMCGenerated) + outputMcGenTable( + cand.PdgCode, cand.IsMatterMC, cand.IsReconstructed, cand.IsPhysicalPrimary, cand.PassedEvSelMC, cand.YGen, cand.PtGen, cand.CtGen); + + if (!cand.IsReconstructed) { + cand.daughterTracks.resize(4); + cand.subDaughterMassVec.resize(4); + hypDaughter.daughterTracks.resize(4); + hypDaughter.subDaughterMassVec.resize(4); + } + + if (cfgNprimDaughters == 2 && cfgNsecDaughters == 0) { + const auto& d1 = cand.daughterTracks.at(0); + const auto& d2 = cand.daughterTracks.at(1); + if (!isMC || (isMC && cfgMCReconstructed && cand.IsReconstructed)) + outputTableTwo( + cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, + cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, cand.McTrue, cand.McPhysicalPrimary, + d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, + d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, + d2.X, d2.Y, d2.Z, d2.Px, d2.Py, d2.Pz, d2.TPCnCls, d2.TPCchi2, d2.ITSnCls, d2.ITSchi2, d2.ITSmeanClsSize, d2.ITSmeanClsSizeL, + d2.Rigidity, d2.TPCsignal, d2.TPCnSigma, d2.TPCnSigmaNhp, d2.TPCnSigmaNlp, d2.TOFmass, d2.DcaXY, d2.DcaZ, d2.IsPvContributor); + if (isMC && cfgMCCombined) + outputTableMcTwo( + cand.PdgCode, cand.IsMatterMC, cand.IsReconstructed, cand.IsPhysicalPrimary, cand.PassedEvSelMC, cand.YGen, cand.PtGen, cand.CtGen, + cand.CpaPvGen, cand.PxGen, cand.PyGen, cand.PzGen, cand.PvxGen, cand.PvyGen, cand.PvzGen, cand.SvxGen, cand.SvyGen, cand.SvzGen, + cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, + cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, + d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, + d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, + d2.X, d2.Y, d2.Z, d2.Px, d2.Py, d2.Pz, d2.TPCnCls, d2.TPCchi2, d2.ITSnCls, d2.ITSchi2, d2.ITSmeanClsSize, d2.ITSmeanClsSizeL, + d2.Rigidity, d2.TPCsignal, d2.TPCnSigma, d2.TPCnSigmaNhp, d2.TPCnSigmaNlp, d2.TOFmass, d2.DcaXY, d2.DcaZ, d2.IsPvContributor); + } + if (cfgNprimDaughters == 3 && cfgNsecDaughters == 0) { + const auto& d1 = cand.daughterTracks.at(0); + const auto& d2 = cand.daughterTracks.at(1); + const auto& d3 = cand.daughterTracks.at(2); + if (!isMC || (isMC && cfgMCReconstructed && cand.IsReconstructed)) + outputTableThree( + cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, + cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, cand.McTrue, cand.McPhysicalPrimary, + d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, + d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, + d2.X, d2.Y, d2.Z, d2.Px, d2.Py, d2.Pz, d2.TPCnCls, d2.TPCchi2, d2.ITSnCls, d2.ITSchi2, d2.ITSmeanClsSize, d2.ITSmeanClsSizeL, + d2.Rigidity, d2.TPCsignal, d2.TPCnSigma, d2.TPCnSigmaNhp, d2.TPCnSigmaNlp, d2.TOFmass, d2.DcaXY, d2.DcaZ, d2.IsPvContributor, + d3.X, d3.Y, d3.Z, d3.Px, d3.Py, d3.Pz, d3.TPCnCls, d3.TPCchi2, d3.ITSnCls, d3.ITSchi2, d3.ITSmeanClsSize, d3.ITSmeanClsSizeL, + d3.Rigidity, d3.TPCsignal, d3.TPCnSigma, d3.TPCnSigmaNhp, d3.TPCnSigmaNlp, d3.TOFmass, d3.DcaXY, d3.DcaZ, d3.IsPvContributor, + d1.SubMass, d2.SubMass, d3.SubMass); + if (isMC && cfgMCCombined) + outputTableMcThree( + cand.PdgCode, cand.IsMatterMC, cand.IsReconstructed, cand.IsPhysicalPrimary, cand.PassedEvSelMC, cand.YGen, cand.PtGen, cand.CtGen, + cand.CpaPvGen, cand.PxGen, cand.PyGen, cand.PzGen, cand.PvxGen, cand.PvyGen, cand.PvzGen, cand.SvxGen, cand.SvyGen, cand.SvzGen, + cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, + cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, + d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, + d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, + d2.X, d2.Y, d2.Z, d2.Px, d2.Py, d2.Pz, d2.TPCnCls, d2.TPCchi2, d2.ITSnCls, d2.ITSchi2, d2.ITSmeanClsSize, d2.ITSmeanClsSizeL, + d2.Rigidity, d2.TPCsignal, d2.TPCnSigma, d2.TPCnSigmaNhp, d2.TPCnSigmaNlp, d2.TOFmass, d2.DcaXY, d2.DcaZ, d2.IsPvContributor, + d3.X, d3.Y, d3.Z, d3.Px, d3.Py, d3.Pz, d3.TPCnCls, d3.TPCchi2, d3.ITSnCls, d3.ITSchi2, d3.ITSmeanClsSize, d3.ITSmeanClsSizeL, + d3.Rigidity, d3.TPCsignal, d3.TPCnSigma, d3.TPCnSigmaNhp, d3.TPCnSigmaNlp, d3.TOFmass, d3.DcaXY, d3.DcaZ, d3.IsPvContributor, + d1.SubMass, d2.SubMass, d3.SubMass); + } + if (cfgNprimDaughters == 2 && cfgNsecDaughters == 3) { + const auto& d0 = cand.daughterTracks.at(0); + const auto& d1 = cand.daughterTracks.at(1); + const auto& sd1 = hypDaughter.daughterTracks.at(0); + const auto& sd2 = hypDaughter.daughterTracks.at(1); + const auto& sd3 = hypDaughter.daughterTracks.at(2); + if (!isMC || (isMC && cfgMCReconstructed && cand.IsReconstructed)) + outputTableTwoThree( + cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, + cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, cand.McTrue, cand.McPhysicalPrimary, + hypDaughter.Svx, hypDaughter.Svy, hypDaughter.Svz, d0.X, d0.Y, d0.Z, d0.Px, d0.Py, d0.Pz, hypDaughter.Mass, hypDaughter.Ct, hypDaughter.CpaPv, + hypDaughter.MaxDcaTracks, hypDaughter.DcaToPvXY, hypDaughter.DcaToPvZ, hypDaughter.DcaToVtxXY, hypDaughter.DcaToVtxZ, hypDaughter.Chi2, + d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, + d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, + sd1.X, sd1.Y, sd1.Z, sd1.Px, sd1.Py, sd1.Pz, sd1.TPCnCls, sd1.TPCchi2, sd1.ITSnCls, sd1.ITSchi2, sd1.ITSmeanClsSize, sd1.ITSmeanClsSizeL, + sd1.Rigidity, sd1.TPCsignal, sd1.TPCnSigma, sd1.TPCnSigmaNhp, sd1.TPCnSigmaNlp, sd1.TOFmass, sd1.DcaXY, sd1.DcaZ, sd1.IsPvContributor, + sd2.X, sd2.Y, sd2.Z, sd2.Px, sd2.Py, sd2.Pz, sd2.TPCnCls, sd2.TPCchi2, sd2.ITSnCls, sd2.ITSchi2, sd2.ITSmeanClsSize, sd2.ITSmeanClsSizeL, + sd2.Rigidity, sd2.TPCsignal, sd2.TPCnSigma, sd2.TPCnSigmaNhp, sd2.TPCnSigmaNlp, sd2.TOFmass, sd2.DcaXY, sd2.DcaZ, sd2.IsPvContributor, + sd3.X, sd3.Y, sd3.Z, sd3.Px, sd3.Py, sd3.Pz, sd3.TPCnCls, sd3.TPCchi2, sd3.ITSnCls, sd3.ITSchi2, sd3.ITSmeanClsSize, sd3.ITSmeanClsSizeL, + sd3.Rigidity, sd3.TPCsignal, sd3.TPCnSigma, sd3.TPCnSigmaNhp, sd3.TPCnSigmaNlp, sd3.TOFmass, sd3.DcaXY, sd3.DcaZ, sd3.IsPvContributor, + sd1.SubMass, sd2.SubMass, sd3.SubMass); + if (isMC && cfgMCCombined) + outputTableMcTwoThree( + cand.PdgCode, cand.IsMatterMC, cand.IsReconstructed, cand.IsPhysicalPrimary, cand.PassedEvSelMC, cand.YGen, cand.PtGen, cand.CtGen, + cand.CpaPvGen, cand.PxGen, cand.PyGen, cand.PzGen, cand.PvxGen, cand.PvyGen, cand.PvzGen, cand.SvxGen, cand.SvyGen, cand.SvzGen, + cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, + cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, + hypDaughter.Svx, hypDaughter.Svy, hypDaughter.Svz, d0.X, d0.Y, d0.Z, d0.Px, d0.Py, d0.Pz, hypDaughter.Mass, hypDaughter.Ct, hypDaughter.CpaPv, + hypDaughter.MaxDcaTracks, hypDaughter.DcaToPvXY, hypDaughter.DcaToPvZ, hypDaughter.DcaToVtxXY, hypDaughter.DcaToVtxZ, hypDaughter.Chi2, + d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, + d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, + sd1.X, sd1.Y, sd1.Z, sd1.Px, sd1.Py, sd1.Pz, sd1.TPCnCls, sd1.TPCchi2, sd1.ITSnCls, sd1.ITSchi2, sd1.ITSmeanClsSize, sd1.ITSmeanClsSizeL, + sd1.Rigidity, sd1.TPCsignal, sd1.TPCnSigma, sd1.TPCnSigmaNhp, sd1.TPCnSigmaNlp, sd1.TOFmass, sd1.DcaXY, sd1.DcaZ, sd1.IsPvContributor, + sd2.X, sd2.Y, sd2.Z, sd2.Px, sd2.Py, sd2.Pz, sd2.TPCnCls, sd2.TPCchi2, sd2.ITSnCls, sd2.ITSchi2, sd2.ITSmeanClsSize, sd2.ITSmeanClsSizeL, + sd2.Rigidity, sd2.TPCsignal, sd2.TPCnSigma, sd2.TPCnSigmaNhp, sd2.TPCnSigmaNlp, sd2.TOFmass, sd2.DcaXY, sd2.DcaZ, sd2.IsPvContributor, + sd3.X, sd3.Y, sd3.Z, sd3.Px, sd3.Py, sd3.Pz, sd3.TPCnCls, sd3.TPCchi2, sd3.ITSnCls, sd3.ITSchi2, sd3.ITSmeanClsSize, sd3.ITSmeanClsSizeL, + sd3.Rigidity, sd3.TPCsignal, sd3.TPCnSigma, sd3.TPCnSigmaNhp, sd3.TPCnSigmaNlp, sd3.TOFmass, sd3.DcaXY, sd3.DcaZ, sd3.IsPvContributor, + sd1.SubMass, sd2.SubMass, sd3.SubMass); + } + if (cfgNprimDaughters == 3 && cfgNsecDaughters == 1) { + const auto& d0 = cand.daughterTracks.at(0); + const auto& d1 = cand.daughterTracks.at(1); + const auto& d2 = cand.daughterTracks.at(2); + const auto& sd1 = hypDaughter.daughterTracks.at(0); + const auto& sd2 = hypDaughter.daughterTracks.at(1); + if (!isMC || (isMC && cfgMCReconstructed && cand.IsReconstructed)) + outputTableTwoThree( + cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, + cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, cand.McTrue, cand.McPhysicalPrimary, + hypDaughter.Svx, hypDaughter.Svy, hypDaughter.Svz, d0.X, d0.Y, d0.Z, d0.Px, d0.Py, d0.Pz, hypDaughter.Mass, hypDaughter.Ct, hypDaughter.CpaPv, + hypDaughter.MaxDcaTracks, hypDaughter.DcaToPvXY, hypDaughter.DcaToPvZ, hypDaughter.DcaToVtxXY, hypDaughter.DcaToVtxZ, hypDaughter.Chi2, + d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, + d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, + d2.X, d2.Y, d2.Z, d2.Px, d2.Py, d2.Pz, d2.TPCnCls, d2.TPCchi2, d2.ITSnCls, d2.ITSchi2, d2.ITSmeanClsSize, d2.ITSmeanClsSizeL, + d2.Rigidity, d2.TPCsignal, d2.TPCnSigma, d2.TPCnSigmaNhp, d2.TPCnSigmaNlp, d2.TOFmass, d2.DcaXY, d2.DcaZ, d2.IsPvContributor, + d0.SubMass, d1.SubMass, d2.SubMass, + sd1.X, sd1.Y, sd1.Z, sd1.Px, sd1.Py, sd1.Pz, sd1.TPCnCls, sd1.TPCchi2, sd1.ITSnCls, sd1.ITSchi2, sd1.ITSmeanClsSize, sd1.ITSmeanClsSizeL, + sd1.Rigidity, sd1.TPCsignal, sd1.TPCnSigma, sd1.TPCnSigmaNhp, sd1.TPCnSigmaNlp, sd1.TOFmass, sd1.DcaXY, sd1.DcaZ, sd1.IsPvContributor, + sd2.X, sd2.Y, sd2.Z, sd2.Px, sd2.Py, sd2.Pz, sd2.TPCnCls, sd2.TPCchi2, sd2.ITSnCls, sd2.ITSchi2, sd2.ITSmeanClsSize, sd2.ITSmeanClsSizeL, + sd2.Rigidity, sd2.TPCsignal, sd2.TPCnSigma, sd2.TPCnSigmaNhp, sd2.TPCnSigmaNlp, sd2.TOFmass, sd2.DcaXY, sd2.DcaZ, sd2.IsPvContributor); + if (isMC && cfgMCCombined) + outputTableMcTwoThree( + cand.PdgCode, cand.IsMatterMC, cand.IsReconstructed, cand.IsPhysicalPrimary, cand.PassedEvSelMC, cand.YGen, cand.PtGen, cand.CtGen, + cand.CpaPvGen, cand.PxGen, cand.PyGen, cand.PzGen, cand.PvxGen, cand.PvyGen, cand.PvzGen, cand.SvxGen, cand.SvyGen, cand.SvzGen, + cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, + cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, + hypDaughter.Svx, hypDaughter.Svy, hypDaughter.Svz, d0.X, d0.Y, d0.Z, d0.Px, d0.Py, d0.Pz, hypDaughter.Mass, hypDaughter.Ct, hypDaughter.CpaPv, + hypDaughter.MaxDcaTracks, hypDaughter.DcaToPvXY, hypDaughter.DcaToPvZ, hypDaughter.DcaToVtxXY, hypDaughter.DcaToVtxZ, hypDaughter.Chi2, + d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, + d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, + d2.X, d2.Y, d2.Z, d2.Px, d2.Py, d2.Pz, d2.TPCnCls, d2.TPCchi2, d2.ITSnCls, d2.ITSchi2, d2.ITSmeanClsSize, d2.ITSmeanClsSizeL, + d2.Rigidity, d2.TPCsignal, d2.TPCnSigma, d2.TPCnSigmaNhp, d2.TPCnSigmaNlp, d2.TOFmass, d2.DcaXY, d2.DcaZ, d2.IsPvContributor, + d0.SubMass, d1.SubMass, d2.SubMass, + sd1.X, sd1.Y, sd1.Z, sd1.Px, sd1.Py, sd1.Pz, sd1.TPCnCls, sd1.TPCchi2, sd1.ITSnCls, sd1.ITSchi2, sd1.ITSmeanClsSize, sd1.ITSmeanClsSizeL, + sd1.Rigidity, sd1.TPCsignal, sd1.TPCnSigma, sd1.TPCnSigmaNhp, sd1.TPCnSigmaNlp, sd1.TOFmass, sd1.DcaXY, sd1.DcaZ, sd1.IsPvContributor, + sd2.X, sd2.Y, sd2.Z, sd2.Px, sd2.Py, sd2.Pz, sd2.TPCnCls, sd2.TPCchi2, sd2.ITSnCls, sd2.ITSchi2, sd2.ITSmeanClsSize, sd2.ITSmeanClsSizeL, + sd2.Rigidity, sd2.TPCsignal, sd2.TPCnSigma, sd2.TPCnSigmaNhp, sd2.TPCnSigmaNlp, sd2.TOFmass, sd2.DcaXY, sd2.DcaZ, sd2.IsPvContributor); + } + } + //___________________________________________________________________________________________________________________________________________________________ + + void fillCandidate(hyperNucleus& cand, hyperNucleus& hypDaughter, aod::HypKfHypNuc const& hypNuc, aod::HypKfHypNucs const&, aod::HypKfCollisions const&, aod::HypKfTracks const&, aod::HypKfDaughterAddons const&, aod::HypKfSubDaughters const&) + { + cand.daughterTracks.clear(); + cand.subDaughterMassVec.clear(); + auto coll = hypNuc.hypKfCollision(); + auto addOns = hypNuc.addons_as(); + auto posVec = posVector(addOns); + cand.Species = std::abs(hypNuc.species()); + cand.IsMatter = hypNuc.isMatter(); + cand.PassedEvSel = coll.passedEvSel(); + cand.Mass = hypNuc.mass(); + cand.Y = hypNuc.y(); + cand.Pt = hypNuc.pt(); + cand.Ct = ct(coll, hypNuc); + cand.CpaPv = cpa(coll, hypNuc); + cand.MaxDcaTracks = maxValue(dcaTrackSvAll(posVec, hypNuc, "XY")); + cand.DcaToPvXY = hypNuc.dcaToPvXY(); + cand.DcaToPvZ = hypNuc.dcaToPvZ(); + cand.DcaToVtxXY = hypNuc.dcaToVtxXY(); + cand.DcaToVtxZ = hypNuc.dcaToVtxZ(); + cand.DevToPvXY = hypNuc.devToPvXY(); + cand.Chi2 = hypNuc.chi2(); + cand.Pvx = coll.posX(); + cand.Pvy = coll.posY(); + cand.Pvz = coll.posZ(); + cand.Svx = hypNuc.svx(); + cand.Svy = hypNuc.svy(); + cand.Svz = hypNuc.svz(); + cand.Px = hypNuc.px(); + cand.Py = hypNuc.py(); + cand.Pz = hypNuc.pz(); + if (cfgNsecDaughters) { + trackProperties hypDaughter; + cand.daughterTracks.push_back(hypDaughter); + } + auto daughterTracks = hypNuc.daughterTracks_as(); + for (auto& track : daughterTracks) { + trackProperties daughter; + daughter.TPCnCls = track.tpcNcluster(); + daughter.ITSnCls = track.itsNcluster(); + daughter.TPCchi2 = track.tpcChi2NCl(); + daughter.ITSchi2 = track.itsChi2NCl(); + daughter.ITSmeanClsSize = track.itsMeanClsSize(); + daughter.ITSmeanClsSizeL = track.itsMeanClsSize() * track.lambda(); + daughter.Rigidity = track.rigidity(); + daughter.TPCsignal = track.tpcSignal(); + daughter.TPCnSigma = track.tpcNsigma(); + daughter.TPCnSigmaNhp = track.tpcNsigmaNhp(); + daughter.TPCnSigmaNlp = track.tpcNsigmaNlp(); + daughter.TOFmass = track.tofMass(); + daughter.DcaXY = track.dcaXY(); + daughter.DcaZ = track.dcaZ(); + daughter.IsPvContributor = track.isPVContributor(); + cand.daughterTracks.push_back(daughter); + } + int trackCount = 0; + for (auto& addOn : addOns) { + cand.daughterTracks.at(trackCount).X = addOn.x(); + cand.daughterTracks.at(trackCount).Y = addOn.y(); + cand.daughterTracks.at(trackCount).Z = addOn.z(); + cand.daughterTracks.at(trackCount).Px = addOn.px(); + cand.daughterTracks.at(trackCount).Py = addOn.py(); + cand.daughterTracks.at(trackCount).Pz = addOn.py(); + trackCount++; + } + cand.NsingleDaughters = trackCount; + if (cand.NsingleDaughters < 3) + return; + + trackCount = 0; + auto subDaughters = hypNuc.subDaughters_as(); + for (auto& subDaughter : subDaughters) { + cand.daughterTracks.at(trackCount++).SubMass = subDaughter.subMass(); + } + } + //___________________________________________________________________________________________________________________________________________________________ + + void processMC(aod::HypKfMcParticles const& mcHypNucs, aod::HypKfHypNucs const& hypNucs, aod::HypKfMcCollisions const&, aod::HypKfCollisions const& hypKfColls, aod::HypKfTracks const& hypKfTrks, aod::HypKfDaughterAddons const& hypKfDAdd, aod::HypKfSubDaughters const& hypKfDSub) + { + isMC = true; + for (auto& mcHypNuc : mcHypNucs) { + if (std::abs(mcHypNuc.species()) != cfgSpecies) + continue; + auto mcColl = mcHypNuc.hypKfMcCollision(); + const auto mcParticleIdx = mcHypNuc.globalIndex(); + auto hypNucsByMc = hypNucs.sliceBy(perMcParticle, mcParticleIdx); + hyperNucleus candidate, hypDaughter, dummy; + candidate.PdgCode = mcHypNuc.pdgCode(); + candidate.IsMatterMC = mcHypNuc.isMatter(); + candidate.IsPhysicalPrimary = mcHypNuc.isPhysicalPrimary(); + candidate.PassedEvSelMC = mcColl.passedEvSel(); + candidate.YGen = mcHypNuc.y(); + candidate.PtGen = mcHypNuc.pt(); + candidate.CtGen = ct(mcColl, mcHypNuc); + candidate.IsReconstructed = 0; + candidate.CpaPvGen = cpa(mcColl, mcHypNuc); + candidate.PxGen = mcHypNuc.px(); + candidate.PyGen = mcHypNuc.py(); + candidate.PzGen = mcHypNuc.pz(); + candidate.PvxGen = mcColl.posX(); + candidate.PvyGen = mcColl.posY(); + candidate.PvzGen = mcColl.posZ(); + candidate.SvxGen = mcHypNuc.svx(); + candidate.SvyGen = mcHypNuc.svy(); + candidate.SvzGen = mcHypNuc.svz(); + for (auto& hypNuc : hypNucsByMc) { + auto coll = hypNuc.hypKfCollision(); + if (coll.hypKfMcCollisionId() == mcHypNuc.hypKfMcCollisionId()) { + candidate.CollisionMcTrue = true; + } + candidate.IsReconstructed++; + fillCandidate(candidate, hypDaughter, hypNucs.rawIteratorAt(hypNuc.globalIndex()), hypNucs, hypKfColls, hypKfTrks, hypKfDAdd, hypKfDSub); + if (cfgNsecDaughters) { + fillCandidate(hypDaughter, dummy, hypNucs.rawIteratorAt(hypNuc.hypDaughterId()), hypNucs, hypKfColls, hypKfTrks, hypKfDAdd, hypKfDSub); + } + } + fillTable(candidate, hypDaughter); + hPt[0]->Fill(mcHypNuc.pt()); + if (candidate.IsReconstructed) + hPt[1]->Fill(candidate.Pt); + } + hPt[2]->Divide(hPt[1].get(), hPt[0].get()); + } + PROCESS_SWITCH(hypKfTreeCreator, processMC, "MC Gen tree", false); + + //___________________________________________________________________________________________________________________________________________________________ + std::vector dcaTracksAll(std::vector& posVec, TString opt = "") + { + std::vector vec; + int n = posVec.size(); + for (int i = 0; i < (n - 1); i++) { + for (int j = (i + 1); j < n; j++) { + vec.push_back(dcaTracks(posVec, i, j, opt)); + } + } + return vec; + } + template + std::vector dcaTrackSvAll(std::vector& posVec, T const& hypNuc, TString opt = "") + { + std::vector vec; + for (size_t i = 0; i < posVec.size(); i++) { + vec.push_back(dcaTrackSv(posVec, i, hypNuc, opt)); + } + return vec; + } + + float maxValue(std::vector vec) + { + return *max_element(vec.begin(), vec.end()); + } + float meanValue(std::vector vec) + { + float sum = 0; + for (auto value : vec) + sum += value; + return sum / vec.size(); + } + float mean2Value(std::vector vec) + { + float sum = 0; + for (auto value : vec) + sum += (value * value); + return TMath::Sqrt(sum / vec.size()); + } + + float dcaTracks(std::vector v, int track1, int track2, TString opt = "XY") + { + if (opt == "XY") + return RecoDecay::distanceXY(v.at(track1), v.at(track2)); + else if (opt == "Z") + return std::abs(v.at(track1).at(2) - v.at(track2).at(2)); + else + return RecoDecay::distance(v.at(track1), v.at(track2)); + } + template + float dcaTrackSv(std::vector& v, int track, T const& hypNuc, TString opt = "") + { + if (opt == "XY") + return RecoDecay::distanceXY(v.at(track), decayVtx(hypNuc)); + else if (opt == "Z") + return std::abs(v.at(track).at(2) - decayVtx(hypNuc).at(2)); + else + return RecoDecay::distance(v.at(track), decayVtx(hypNuc)); + } + template + std::vector posVector(T const& addons) + { + std::vector v; + for (auto& pos : addons) { + v.push_back(std::array{pos.x(), pos.y(), pos.z()}); + } + return v; + } + template + arr3 primVtx(T const& coll) + { + return std::array{coll.posX(), coll.posY(), coll.posZ()}; + } + template + arr3 decayVtx(T const& hypNuc) + { + return std::array{hypNuc.svx(), hypNuc.svy(), hypNuc.svz()}; + } + template + arr3 momenta(T const& hypNuc) + { + return std::array{hypNuc.px(), hypNuc.py(), hypNuc.pz()}; + } + template + float decayLength(TColl const& coll, TPart const& hypNuc) + { + return RecoDecay::distance(primVtx(coll), decayVtx(hypNuc)); + } + template + float ct(TColl const& coll, TPart const& hypNuc) + { + return RecoDecay::ct(momenta(hypNuc), decayLength(coll, hypNuc), hypNuc.mass()); + } + template + double cpa(TColl const& coll, TPart const& hypNuc) + { + return RecoDecay::cpa(primVtx(coll), decayVtx(hypNuc), momenta(hypNuc)); + } + double paArcMin(double cosPa) + { + // returns the pointing angle (in arc min) for a given cosPa + return TMath::ACos(cosPa) * 60 * 180 / TMath::Pi(); + } + // only for Cascades + template + float decayLength(TPart const& mother, TPart const& daughter) + { + return RecoDecay::distance(decayVtx(mother), decayVtx(daughter)); + } + template + float ct(TPart const& mother, TPart const& daughter) + { + return RecoDecay::ct(momenta(daughter), decayLength(mother, daughter), daughter.mass()); + } + template + double cpa(TPart const& mother, TPart const& daughter) + { + return RecoDecay::cpa(decayVtx(mother), decayVtx(daughter), momenta(daughter)); + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From c334923945cf2d7b7d902d627a2cf455fe96df22 Mon Sep 17 00:00:00 2001 From: Zhen Zhang <74494053+zz951@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:02:35 +0100 Subject: [PATCH 136/459] [PWGHF] modification for efficiency weight (#8600) --- PWGHF/HFC/DataModel/CorrelationTables.h | 50 +- .../HFC/TableProducer/correlatorLcHadrons.cxx | 896 ++++++++++-------- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 629 +++++++++--- 3 files changed, 1055 insertions(+), 520 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 4609b21df95..3c5b8cf86fd 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -97,14 +97,23 @@ DECLARE_SOA_TABLE(DHadronRecoInfo, "AOD", "DHADRONRECOINFO", //! D0-Hadrons pair // Note: definition of columns and tables for Lc-Hadron correlation pairs namespace hf_correlation_lc_hadron { -DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between Lc and Hadrons -DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between Lc and Hadrons -DECLARE_SOA_COLUMN(PtLc, ptLc, float); //! Transverse momentum of Lc -DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron -DECLARE_SOA_COLUMN(MLc, mLc, float); //! Invariant mass of Lc -DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); //! Tag for LcToPKPi/LcToPiKP -DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent -DECLARE_SOA_COLUMN(IsAutoCorrelated, isAutoCorrelated, bool); //! Correlation Status +DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between Lc and Hadrons +DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between Lc and Hadrons +DECLARE_SOA_COLUMN(PtLc, ptLc, float); //! Transverse momentum of Lc +DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron +DECLARE_SOA_COLUMN(MLc, mLc, float); //! Invariant mass of Lc +DECLARE_SOA_COLUMN(MlScoreBkg, mlScoreBkg, float); //! ML background score for Lc selection +DECLARE_SOA_COLUMN(MlScorePrompt, mlScorePrompt, float); //! ML prompt score for Lc selection +DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); //! Tag for LcToPKPi/LcToPiKP +DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent +DECLARE_SOA_COLUMN(TrackDcaXY, trackDcaXY, float); //! DCA xy of the track +DECLARE_SOA_COLUMN(TrackDcaZ, trackDcaZ, float); //! DCA z of the track +DECLARE_SOA_COLUMN(TrackTPCNClsCrossedRows, trackTPCNClsCrossedRows, int); //! Number of crossed TPC Rows +DECLARE_SOA_COLUMN(TrackOrigin, trackOrigin, int); //! Number of crossed TPC Rows +DECLARE_SOA_COLUMN(IsSignal, isSignal, bool); //! Used in MC-Rec, Lc Signal +DECLARE_SOA_COLUMN(IsPrompt, isPrompt, bool); //! Used in MC-Rec, Lc Prompt or Non-Prompt +DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); //! Used in MC-Rec, primary associated particles +DECLARE_SOA_COLUMN(IsAutoCorrelated, isAutoCorrelated, bool); //! Correlation Status } // namespace hf_correlation_lc_hadron DECLARE_SOA_TABLE(LcHadronPair, "AOD", "LCHPAIR", //! Lc-Hadrons pairs Informations @@ -119,6 +128,29 @@ DECLARE_SOA_TABLE(LcHadronRecoInfo, "AOD", "LCHRECOINFO", //! Lc-Hadrons pairs R aod::hf_correlation_lc_hadron::MLc, aod::hf_correlation_lc_hadron::SignalStatus); +DECLARE_SOA_TABLE(LcHadronGenInfo, "AOD", "LCHGENINFO", //! Lc-Hadrons pairs Generated Information + aod::hf_correlation_lc_hadron::IsPrompt, + aod::hf_correlation_lc_hadron::IsPhysicalPrimary, + aod::hf_correlation_lc_hadron::TrackOrigin); + +DECLARE_SOA_TABLE(LcHadronMlInfo, "AOD", "LCHMLINFO", //! Lc-Hadrons pairs Machine Learning Information + aod::hf_correlation_lc_hadron::MlScoreBkg, + aod::hf_correlation_lc_hadron::MlScorePrompt); + +DECLARE_SOA_TABLE(LcRecoInfo, "AOD", "LCRECOINFO", //! Lc candidates Reconstructed Information + aod::hf_correlation_lc_hadron::MLc, + aod::hf_correlation_lc_hadron::PtLc, + aod::hf_correlation_lc_hadron::MlScoreBkg, + aod::hf_correlation_lc_hadron::MlScorePrompt); + +DECLARE_SOA_TABLE(LcGenInfo, "AOD", "LCGENOINFO", //! Lc candidates Generated Information + aod::hf_correlation_lc_hadron::IsPrompt); + +DECLARE_SOA_TABLE(TrkRecInfoLc, "AOD", "TRKRECINFOLC", //! Tracks Reconstructed Information + aod::hf_correlation_lc_hadron::TrackDcaXY, + aod::hf_correlation_lc_hadron::TrackDcaZ, + aod::hf_correlation_lc_hadron::TrackTPCNClsCrossedRows); + // definition of columns and tables for Ds-Hadron correlation pairs namespace hf_correlation_ds_hadron { @@ -335,7 +367,7 @@ DECLARE_SOA_TABLE(Dstar, "AOD", "DSTAR", // Only Dstar properties // Note: Table for selection of Lc in a collision namespace hf_selection_lc_collision { -DECLARE_SOA_COLUMN(LcSel, lcSel, int); //! Selection flag for Lc in a collision +DECLARE_SOA_COLUMN(LcSel, lcSel, bool); //! Selection flag for Lc in a collision } // namespace hf_selection_lc_collision DECLARE_SOA_TABLE(LcSelection, "AOD", "LCINCOLL", // Selection of Lc in collisions diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index ecd5d7c0bc6..c3ef512f6fa 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -37,51 +37,29 @@ using namespace o2; using namespace o2::analysis; using namespace o2::constants::physics; +using namespace o2::constants::math; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::analysis::hf_correlations; - /// /// Returns deltaPhi values in range [-pi/2., 3.*pi/2.], typically used for correlation studies /// double getDeltaPhi(double phiLc, double phiHadron) { - return RecoDecay::constrainAngle(phiHadron - phiLc, -o2::constants::math::PIHalf); + return RecoDecay::constrainAngle(phiHadron - phiLc, -PIHalf); } -/// definition of variables for Lc hadron pairs (in data-like, Mc-reco and Mc-kine tasks) -const int nBinsPtMassAndEfficiency = o2::analysis::hf_cuts_lc_to_p_k_pi::nBinsPt; -const double efficiencyLcDefault[nBinsPtMassAndEfficiency] = {}; -auto vecEfficiencyLc = std::vector{efficiencyLcDefault, efficiencyLcDefault + nBinsPtMassAndEfficiency}; - -// histogram binning definition -const int massAxisBins = 120; -const double massAxisMin = 1.98; -const double massAxisMax = 2.58; -const int phiAxisBins = 32; -const double phiAxisMin = -o2::constants::math::PIHalf; -const double phiAxisMax = 3. * o2::constants::math::PIHalf; -const int yAxisBins = 100; -const double yAxisMin = -2.; -const double yAxisMax = 2.; -const int ptLcAxisBins = 180; -const double ptLcAxisMin = 0.; -const double ptLcAxisMax = 36.; - // definition of ME variables using BinningType = ColumnBinningPolicy>; - -using SelectedCollisions = soa::Filtered>; -using SelectedTracks = soa::Filtered; -using SelectedCandidatesData = soa::Filtered>; -using SelectedCandidatesMcRec = soa::Filtered>; -using SelectedCollisionsMcGen = soa::Filtered>; -using SelectedTracksMcGen = soa::Filtered; +using BinningTypeMcGen = ColumnBinningPolicy; // Code to select collisions with at least one Lambda_c struct HfCorrelatorLcHadronsSelection { Produces lcSel; + Configurable useSel8{"useSel8", true, "Flag for applying sel8 for collision selection"}; + Configurable selNoSameBunchPileUpColl{"selNoSameBunchPileUpColl", true, "Flag for rejecting the collisions associated with the same bunch crossing"}; + Configurable doSelLcCollision{"doSelLcCollision", true, "Select collisions with at least one Lc"}; Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; @@ -89,79 +67,85 @@ struct HfCorrelatorLcHadronsSelection { HfHelper hfHelper; SliceCache cache; - Partition> selectedLcCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; - Partition> selectedLcCandidatesMc = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; + using SelCollisions = soa::Join; + using CandidatesLcData = soa::Filtered>; + using CandidatesLcMcRec = soa::Filtered>; + using CandidatesLcMcGen = soa::Join; - // Returns false if the candidate does not pass cuts on decay type, y max, and pt min. Used for data and MC reco. - template - bool kinematicCuts(const T& candidate) - { - // check decay channel flag for candidate - if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::LcToPKPi)) { - return false; - } - if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { - return false; - } - if (ptCandMin >= 0. && candidate.pt() < ptCandMin) { - return false; - } - return true; - } + // filter on selection of Lc and decay channel Lc->PKPi + Filter lcFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) != static_cast(0)) && (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); - void processLcSelectionData(aod::Collision const& collision, - soa::Join const&) + void processLcSelectionData(SelCollisions::iterator const& collision, + CandidatesLcData const& candidates) { - int isLcFound = 0; - if (selectedLcCandidates.size() > 0) { - auto selectedLcCandidatesGrouped = selectedLcCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - - for (const auto& candidate : selectedLcCandidatesGrouped) { - if (!kinematicCuts(candidate)) { + bool isSelColl = true; + bool isLcFound = true; + bool isSel8 = true; + bool isNosameBunchPileUp = true; + if (doSelLcCollision) { + for (const auto& candidate : candidates) { + if (std::abs(hfHelper.yLc(candidate)) > yCandMax || candidate.pt() < ptCandMin) { + isLcFound = false; continue; } - isLcFound = 1; + isLcFound = true; break; } } - lcSel(isLcFound); + if (useSel8) { + isSel8 = collision.sel8(); + } + if (selNoSameBunchPileUpColl) { + isNosameBunchPileUp = static_cast(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)); + } + isSelColl = isLcFound && isSel8 && isNosameBunchPileUp; + lcSel(isSelColl); } PROCESS_SWITCH(HfCorrelatorLcHadronsSelection, processLcSelectionData, "Process Lc Collision Selection Data", true); - void processLcSelectionMcRec(aod::Collision const& collision, - soa::Join const&) + void processLcSelectionMcRec(SelCollisions::iterator const& collision, + CandidatesLcMcRec const& candidates) { - int isLcFound = 0; - if (selectedLcCandidatesMc.size() > 0) { - auto selectedLcCandidatesGroupedMc = selectedLcCandidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - for (const auto& candidate : selectedLcCandidatesGroupedMc) { - if (!kinematicCuts(candidate)) { + bool isSelColl = true; + bool isLcFound = true; + bool isSel8 = true; + bool isNosameBunchPileUp = true; + if (doSelLcCollision) { + for (const auto& candidate : candidates) { + if (std::abs(hfHelper.yLc(candidate)) > yCandMax || candidate.pt() < ptCandMin) { + isLcFound = false; continue; } - isLcFound = 1; + isLcFound = true; break; } } - lcSel(isLcFound); + if (useSel8) { + isSel8 = collision.sel8(); + } + if (selNoSameBunchPileUpColl) { + isNosameBunchPileUp = static_cast(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)); + } + isSelColl = isLcFound && isSel8 && isNosameBunchPileUp; + lcSel(isSelColl); } PROCESS_SWITCH(HfCorrelatorLcHadronsSelection, processLcSelectionMcRec, "Process Lc Selection McRec", false); void processLcSelectionMcGen(aod::McCollision const&, - aod::McParticles const& mcParticles) + CandidatesLcMcGen const& mcParticles) { - int isLcFound = 0; + bool isLcFound = true; for (const auto& particle : mcParticles) { if (std::abs(particle.pdgCode()) != Pdg::kLambdaCPlus) { + isLcFound = false; continue; } double yL = RecoDecay::y(particle.pVector(), MassLambdaCPlus); - if (yCandMax >= 0. && std::abs(yL) > yCandMax) { - continue; - } - if (ptCandMin >= 0. && particle.pt() < ptCandMin) { + if (std::abs(yL) > yCandMax || particle.pt() < ptCandMin) { + isLcFound = false; continue; } - isLcFound = 1; + isLcFound = true; break; } lcSel(isLcFound); @@ -173,27 +157,41 @@ struct HfCorrelatorLcHadronsSelection { struct HfCorrelatorLcHadrons { Produces entryLcHadronPair; Produces entryLcHadronRecoInfo; + Produces entryLcHadronMlInfo; + Produces entryLcCandRecoInfo; + Produces entryLcHadronGenInfo; + Produces entryLcCandGenInfo; + Produces entryTrackRecoInfo; Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; + Configurable numberEventsMixed{"numberEventsMixed", 5, "number of events mixed in ME process"}; Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying Lc efficiency weights"}; - Configurable filterFlagLc{"filterFlagLc", true, "Flag for applying Collision Filter with Lc"}; - Configurable filterFlagLcMc{"filterFlagLcMc", false, "Flag for applying Mc Collision Filter with Lc"}; - Configurable nEventForMixedEvent{"nEventForMixedEvent", 5, "number of event to be mixed"}; Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; + Configurable yCandGenMax{"yCandGenMax", 0.5, "max. gen. cand. rapidity"}; Configurable etaTrackMax{"etaTrackMax", 0.8, "max. eta of tracks"}; - Configurable dcaXYTrackMax{"dcaXYTrackMax", 0.0025, "max. DCAxy of tracks"}; - Configurable dcaZTrackMax{"dcaZTrackMax", 0.0025, "max. DCAz of tracks"}; + Configurable dcaXYTrackMax{"dcaXYTrackMax", 1., "max. DCAxy of tracks"}; + Configurable dcaZTrackMax{"dcaZTrackMax", 1., "max. DCAz of tracks"}; Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; + Configurable ptCandMax{"ptCandMax", 50., "max. cand. pT"}; Configurable ptTrackMin{"ptTrackMin", 0.3, "min. track pT"}; Configurable ptTrackMax{"ptTrackMax", 50., "max. track pT"}; Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; - Configurable> binsPt{"binsPt", std::vector{o2::analysis::hf_cuts_lc_to_p_k_pi::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; - Configurable> efficiencyLc{"efficiencyLc", std::vector{vecEfficiencyLc}, "Efficiency values for Lc"}; + Configurable> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; + Configurable> binsPtLc{"binsPtLc", std::vector{o2::analysis::hf_cuts_lc_to_p_k_pi::vecBinsPt}, "pT bin limits for candidate mass plots"}; + Configurable> binsPtHadron{"binsPtHadron", std::vector{0.3, 2., 4., 8., 12., 50.}, "pT bin limits for assoc particle"}; + Configurable> binsPtEfficiencyLc{"binsPtEfficiencyLc", std::vector{o2::analysis::hf_cuts_lc_to_p_k_pi::vecBinsPt}, "pT bin limits for efficiency"}; + Configurable> efficiencyLc{"efficiencyLc", {1., 1., 1., 1., 1., 1.}, "efficiency values for Lc"}; ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; ConfigurableAxis binsMultiplicityMc{"binsMultiplicityMc", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks - Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its D-meson mother instead of skipping it"}; + ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; + ConfigurableAxis binsEta{"binsEta", {50, -2., 2.}, "#it{#eta}"}; + ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; + ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; + ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 6000.}, "Multiplicity as FT0M signal amplitude"}; + ConfigurableAxis binsMassLc{"binsMassLc", {200, 1.98, 2.58}, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; + Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its Lc mother instead of skipping it"}; Configurable correlateLcWithLeadingParticle{"correlateLcWithLeadingParticle", false, "Switch for correlation of Lc baryons with leading particle only"}; HfHelper hfHelper; @@ -202,75 +200,107 @@ struct HfCorrelatorLcHadrons { int leadingIndex = 0; bool correlationStatus = false; + // Event Mixing for the Data Mode + using SelCollisionsWithLc = soa::Filtered>; + using SelCollisionsWithLcMc = soa::Filtered>; // collisionFilter applied + using CandidatesLcData = soa::Filtered>; + // Event Mixing for the MCRec Mode + using CandidatesLcMcRec = soa::Filtered>; + using CandidatesLcMcGen = soa::Join; // flagLcFilter applied + // Event Mixing for the MCGen Mode + using McCollisionsSel = soa::Filtered>; + using McParticlesSel = soa::Filtered; + // Tracks used in Data and MC + using TracksData = soa::Filtered>; // trackFilter applied + using TracksWithMc = soa::Filtered>; // trackFilter applied // Filters for ME - Filter collisionFilter = aod::hf_selection_lc_collision::lcSel >= filterFlagLc; + Filter collisionFilter = aod::hf_selection_lc_collision::lcSel == true; + Filter lcFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) != static_cast(0)) && (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (nabs(aod::track::pt) > ptTrackMin) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); - Filter lcFilter = (aod::hf_sel_candidate_lc::isSelLcToPKPi >= 1) || (aod::hf_sel_candidate_lc::isSelLcToPiKP >= 1); - Filter collisionFilterGen = aod::hf_selection_lc_collision::lcSel >= filterFlagLcMc; - Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == 4122 || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); - - Preslice perCol = aod::hf_cand::collisionId; - - Partition> selectedLcCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; - Partition> selectedLcCandidatesMc = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; - - HistogramRegistry registry{ - "registry", - {{"hPtCand", "Lc,Hadron candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtProng0", "Lc,Hadron candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtProng1", "Lc,Hadron candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtProng2", "Lc,Hadron candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hSelectionStatusLcToPKPi", "Lc,Hadron candidates;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}}, - {"hSelectionStatusLcToPiKP", "Lc,Hadron candidates;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}}, - {"hEta", "Lc,Hadron candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, - {"hPhi", "Lc,Hadron candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, - {"hY", "Lc,Hadron candidates;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, - {"hPtCandMcRec", "Lc,Hadron candidates - Mc reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtProng0McRec", "Lc,Hadron candidates - Mc reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtProng1McRec", "Lc,Hadron candidates - Mc reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtProng2McRec", "Lc,Hadron candidates - Mc reco;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hSelectionStatusMcRec", "Lc,Hadron candidates - Mc reco;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}}, - {"hEtaMcRec", "Lc,Hadron candidates - Mc reco;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, - {"hPhiMcRec", "Lc,Hadron candidates - Mc reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, - {"hYMcRec", "Lc,Hadron candidates - Mc reco;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, - {"hMcEvtCount", "Event counter - Mc gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMcGen", "Lc,Hadron particles - Mc gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtParticleAssocMcRec", "Associated Particles - Mc Rec;Hadron #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtParticleAssocMcGen", "Associated Particles - Mc Gen;Hadron #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hEtaMcGen", "Lc,Hadron particles - Mc Gen;particle #it{#varphi};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, - {"hPhiMcGen", "Lc,Hadron particles - Mc Gen;particle #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, - {"hYMcGen", "Lc,Hadron candidates - Mc Gen;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, - {"hCountLcHadronPerEvent", "Lc,Hadron particles - Mc Gen;Number per event;entries", {HistType::kTH1F, {{21, -0.5, 20.5}}}}, - {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hMultT0M", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hZvtx", "z vertex;z vertex;entries", {HistType::kTH1F, {{200, -20., 20.}}}}, - {"hLcPoolBin", "Lc selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}, - {"hTracksPoolBin", "Tracks selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}}}; + HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) { - auto vbins = (std::vector)binsPt; - registry.add("hMassLcVsPt", "Lc candidates;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassLcData", "Lc candidates;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisBins, massAxisMin, massAxisMax}}}); - registry.add("hMassLcMcRec", "Lc candidates;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisBins, massAxisMin, massAxisMax}}}); - registry.add("hMassLcVsPtMcRec", "Lc candidates;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassLcMcRecSig", "Lc signal candidates - Mc reco;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - // mass histogram for Lc background candidates only - registry.add("hMassLcMcRecBkg", "Lc background candidates - Mc reco;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hCountLctriggersMcGen", "Lc trigger particles - Mc gen;;N of trigger Lc", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + AxisSpec axisMassLc = {binsMassLc, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; + AxisSpec axisEta = {binsEta, "#it{eta}"}; + AxisSpec axisPhi = {binsPhi, "#it{#varphi}"}; + AxisSpec axisPtLc = {(std::vector)binsPtLc, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec axisPtHadron = {(std::vector)binsPtHadron, "#it{p}_{T} Hadron (GeV/#it{c})"}; + AxisSpec axisMultiplicity = {binsMultiplicity, "Multiplicity"}; + AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; + AxisSpec axisPosZ = {binsZVtx, "PosZ"}; + AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; + AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; + AxisSpec axisRapidity = {100, -2, 2, "Rapidity"}; + + registry.add("hPtCand", "Lc,Hadron candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPtLc}}); + registry.add("hPtProng0", "Lc,Hadron candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPtLc}}); + registry.add("hPtProng1", "Lc,Hadron candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPtLc}}); + registry.add("hPtProng2", "Lc,Hadron candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPtLc}}); + registry.add("hSelectionStatusLcToPKPi", "Lc,Hadron candidates;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}); + registry.add("hSelectionStatusLcToPiKP", "Lc,Hadron candidates;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}); + registry.add("hEta", "Lc,Hadron candidates;candidate #it{#eta};entries", {HistType::kTH1F, {axisEta}}); + registry.add("hPhi", "Lc,Hadron candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {axisPhi}}); + registry.add("hY", "Lc,Hadron candidates;candidate #it{#y};entries", {HistType::kTH1F, {axisRapidity}}); + registry.add("hcountLcHadronPerEvent", "Lc,Hadron particles - MC gen;Number per event;entries", {HistType::kTH1F, {{21, -0.5, 20.5}}}); + registry.add("hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}); + registry.add("hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}); + registry.add("hMultFT0M", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}); + registry.add("hZvtx", "z vertex;z vertex;entries", {HistType::kTH1F, {{200, -20., 20.}}}); + registry.add("hLcBin", "Lc selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}); + registry.add("hTracksBin", "Tracks selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}); + registry.add("hMassLcVsPt", "Lc candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); + registry.add("hMassLcData", "Lc candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{axisMassLc}}}); + registry.add("hLcPoolBin", "Lc candidates pool bin", {HistType::kTH1F, {axisPoolBin}}); + registry.add("hTracksPoolBin", "Particles associated pool bin", {HistType::kTH1F, {axisPoolBin}}); + // Histograms for MC Reco analysis + registry.add("hSelectionStatusLcToPKPiMcRec", "Lc,Hadron candidates - MC reco;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}); + registry.add("hSelectionStatusLcToPiKPMcRec", "Lc,Hadron candidates - MC reco;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}); + registry.add("hMcEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}); + registry.add("hPtProng0McRec", "Lc,Hadron candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPtLc}}); + registry.add("hPtProng1McRec", "Lc,Hadron candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPtLc}}); + registry.add("hPtProng2McRec", "Lc,Hadron candidates - MC reco;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPtLc}}); + registry.add("hMassLcMcRec", "Lc candidates;inv. mass (P K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{axisMassLc}}}); + registry.add("hMassLcVsPtMcRec", "Lc candidates - MC Reco", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); + registry.add("hMassLcMcRecSig", "Lc signal candidates - MC reco;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); + registry.add("hMassLcMcRecBkg", "Lc background candidates - MC reco;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); + registry.add("hPtCandMcRecSig", "Lc,Hadron candidates - MC Reco", {HistType::kTH1F, {axisPtLc}}); + registry.add("hPtCandMcRecSigPrompt", "Lc,Hadron candidates Prompt - MC Reco", {HistType::kTH1F, {axisPtLc}}); + registry.add("hPtCandMcRecSigNonPrompt", "Lc,Hadron candidates Non Prompt - MC Reco", {HistType::kTH1F, {axisPtLc}}); + registry.add("hPtCandMcRecBkg", "Lc,Hadron candidates - MC Reco", {HistType::kTH1F, {axisPtLc}}); + registry.add("hEtaMcRecSig", "Lc,Hadron candidates - MC Reco", {HistType::kTH1F, {axisEta}}); + registry.add("hPhiMcRecSig", "Lc,Hadron candidates - MC Reco", {HistType::kTH1F, {axisPhi}}); + registry.add("hYMcRecSig", "Lc,Hadron candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {axisRapidity}}); + registry.add("hEtaMcRecBkg", "Lc,Hadron candidates - MC Reco", {HistType::kTH1F, {axisEta}}); + registry.add("hPhiMcRecBkg", "Lc,Hadron candidates - MC Reco", {HistType::kTH1F, {axisPhi}}); + registry.add("hYMcRecBkg", "Lc,Hadron candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {axisRapidity}}); + registry.add("hFakeTracksMcRec", "Fake tracks - MC Rec", {HistType::kTH1F, {axisPtHadron}}); + registry.add("hPtParticleAssocVsCandMcRec", "Associated Particle - MC Rec", {HistType::kTH2F, {{axisPtHadron}, {axisPtLc}}}); + registry.add("hPtPrimaryParticleAssocVsCandMcRec", "Associated Particle - MC Rec", {HistType::kTH2F, {{axisPtHadron}, {axisPtLc}}}); + registry.add("hPtVsMultiplicityMcRecPrompt", "Multiplicity FT0M - MC Rec Prompt", {HistType::kTH2F, {{axisPtLc}, {axisMultFT0M}}}); + registry.add("hPtVsMultiplicityMcRecNonPrompt", "Multiplicity FT0M - MC Rec Non Prompt", {HistType::kTH2F, {{axisPtLc}, {axisMultFT0M}}}); + // Histograms for MC Gen analysis + registry.add("hcountLctriggersMcGen", "Lc trigger particles - MC gen;;N of trigger Lc", {HistType::kTH2F, {{1, -0.5, 0.5}, {axisPtLc}}}); + registry.add("hPtCandMcGen", "Lc,Hadron particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPtLc}}); + registry.add("hYMcGen", "Lc,Hadron candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {axisRapidity}}); + registry.add("hPtCandMcGenPrompt", "Lc,Hadron particles - MC Gen Prompt", {HistType::kTH1F, {axisPtLc}}); + registry.add("hPtCandMcGenNonPrompt", "Lc,Hadron particles - MC Gen Non Prompt", {HistType::kTH1F, {axisPtLc}}); + registry.add("hPtParticleAssocMcGen", "Associated Particle - MC Gen", {HistType::kTH1F, {axisPtHadron}}); + registry.add("hEtaMcGen", "Lc,Hadron particles - MC Gen", {HistType::kTH1F, {axisEta}}); + registry.add("hPhiMcGen", "Lc,Hadron particles - MC Gen", {HistType::kTH1F, {axisPhi}}); + registry.add("hMultFT0AMcGen", "Lc,Hadron multiplicity FT0A - MC Gen", {HistType::kTH1F, {axisMultiplicity}}); + corrBinning = {{binsZVtx, binsMultiplicity}, true}; } - /// Lc-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) - void processData(soa::Join::iterator const& collision, - aod::TracksWDca const& tracks, - soa::Join const&) + void processData(SelCollisionsWithLc::iterator const& collision, + TracksData const& tracks, + CandidatesLcData const& candidates) { - // protection against empty tables to be sliced - if (selectedLcCandidates.size() == 0) { + if (candidates.size() == 0) { return; } + // find leading particle if (correlateLcWithLeadingParticle) { leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value, etaTrackMax.value); @@ -280,14 +310,10 @@ struct HfCorrelatorLcHadrons { int nTracks = 0; if (collision.numContrib() > 1) { for (const auto& track : tracks) { - if (std::abs(track.eta()) > etaTrackMax) { - continue; - } - if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { + if (std::abs(track.eta()) > etaTrackMax || std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { continue; } nTracks++; - registry.fill(HIST("hTracksPoolBin"), poolBin); } } registry.fill(HIST("hMultiplicityPreSelection"), nTracks); @@ -296,59 +322,47 @@ struct HfCorrelatorLcHadrons { } registry.fill(HIST("hMultiplicity"), nTracks); - auto selectedLcCandidatesGrouped = selectedLcCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + int cntLc = 0; + std::vector outputMl = {-1., -1., -1.}; - for (const auto& candidate : selectedLcCandidatesGrouped) { - if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { - continue; - } - if (ptCandMin >= 0. && candidate.pt() < ptCandMin) { - continue; - } - if (candidate.pt() > ptTrackMax) { - continue; - } - // check decay channel flag for candidate - if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::LcToPKPi)) { + for (const auto& candidate : candidates) { + if (std::abs(hfHelper.yLc(candidate)) > yCandMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; } - - double efficiencyWeight = 1.; + double efficiencyWeightLc = 1.; if (applyEfficiency) { - efficiencyWeight = 1. / efficiencyLc->at(o2::analysis::findBin(binsPt, candidate.pt())); + efficiencyWeightLc = 1. / efficiencyLc->at(o2::analysis::findBin(binsPtEfficiencyLc, candidate.pt())); } registry.fill(HIST("hPtCand"), candidate.pt()); registry.fill(HIST("hPtProng0"), candidate.ptProng0()); registry.fill(HIST("hPtProng1"), candidate.ptProng1()); registry.fill(HIST("hPtProng2"), candidate.ptProng2()); registry.fill(HIST("hEta"), candidate.eta()); - registry.fill(HIST("hPhi"), RecoDecay::constrainAngle(candidate.phi(), -o2::constants::math::PIHalf)); + registry.fill(HIST("hPhi"), RecoDecay::constrainAngle(candidate.phi(), -PIHalf)); registry.fill(HIST("hY"), hfHelper.yLc(candidate)); - registry.fill(HIST("hLcPoolBin"), poolBin); + registry.fill(HIST("hLcBin"), poolBin); if (candidate.isSelLcToPKPi() >= selectionFlagLc) { - registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hMassLcData"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeight); + registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); + registry.fill(HIST("hMassLcData"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeightLc); registry.fill(HIST("hSelectionStatusLcToPKPi"), candidate.isSelLcToPKPi()); + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMl[iclass] = candidate.mlProbLcToPKPi()[classMl->at(iclass)]; + } + entryLcCandRecoInfo(hfHelper.invMassLcToPKPi(candidate), candidate.pt(), outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { - registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hMassLcData"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeight); + registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); + registry.fill(HIST("hMassLcData"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeightLc); registry.fill(HIST("hSelectionStatusLcToPiKP"), candidate.isSelLcToPiKP()); + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMl[iclass] = candidate.mlProbLcToPiKP()[classMl->at(iclass)]; + } + entryLcCandRecoInfo(hfHelper.invMassLcToPiKP(candidate), candidate.pt(), outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore } + // Lc-Hadron correlation dedicated section // if the candidate is a Lc, search for Hadrons and evaluate correlations - for (const auto& track : tracks) { - if (std::abs(track.eta()) > etaTrackMax) { - continue; - } - if (track.pt() < ptTrackMin) { - continue; - } - if (std::abs(track.dcaXY()) >= dcaXYTrackMax || std::abs(track.dcaZ()) >= dcaZTrackMax) { - continue; // Remove secondary tracks - } - // Remove Lc daughters by checking track indices if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { if (!storeAutoCorrelationFlag) { @@ -356,7 +370,9 @@ struct HfCorrelatorLcHadrons { } correlationStatus = true; } - + if (!track.isGlobalTrackWoDCA()) { + continue; + } if (correlateLcWithLeadingParticle) { if (track.globalIndex() != leadingIndex) { continue; @@ -370,6 +386,9 @@ struct HfCorrelatorLcHadrons { poolBin, correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), false); + entryLcHadronGenInfo(false, false, 0); + entryLcHadronMlInfo(outputMl[0], outputMl[1]); + entryTrackRecoInfo(track.dcaXY(), track.dcaZ(), track.tpcNClsCrossedRows()); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), @@ -379,22 +398,31 @@ struct HfCorrelatorLcHadrons { poolBin, correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), false); + entryLcHadronGenInfo(false, false, 0); + entryLcHadronMlInfo(outputMl[0], outputMl[1]); + entryTrackRecoInfo(track.dcaXY(), track.dcaZ(), track.tpcNClsCrossedRows()); + } + if (cntLc == 0) { + registry.fill(HIST("hTracksBin"), poolBin); } } // Hadron Tracks loop - } // end outer Lc loop + cntLc++; + } // end outer Lc loop registry.fill(HIST("hZvtx"), collision.posZ()); registry.fill(HIST("hMultT0M"), collision.multFT0M()); } PROCESS_SWITCH(HfCorrelatorLcHadrons, processData, "Process data", true); /// Lc-Hadron correlation process starts for McRec - void processMcRec(soa::Join::iterator const& collision, - aod::TracksWDca const& tracks, - soa::Join const&) + void processMcRec(SelCollisionsWithLc::iterator const& collision, + TracksWithMc const& tracks, + CandidatesLcMcRec const& candidates, + aod::McParticles const& mcParticles) { - if (selectedLcCandidatesMc.size() == 0) { + if (candidates.size() == 0) { return; } + // find leading particle if (correlateLcWithLeadingParticle) { leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value, etaTrackMax.value); @@ -404,14 +432,10 @@ struct HfCorrelatorLcHadrons { int nTracks = 0; if (collision.numContrib() > 1) { for (const auto& track : tracks) { - if (std::abs(track.eta()) > etaTrackMax) { - continue; - } - if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { + if (std::abs(track.eta()) >= etaTrackMax || std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { continue; } nTracks++; - registry.fill(HIST("hTracksPoolBin"), poolBin); } } registry.fill(HIST("hMultiplicityPreSelection"), nTracks); @@ -420,86 +444,106 @@ struct HfCorrelatorLcHadrons { } registry.fill(HIST("hMultiplicity"), nTracks); - auto selectedLcCandidatesGroupedMc = selectedLcCandidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - + float multiplicityFT0M = collision.multFT0M(); // Mc reco level + bool isLcPrompt = false; + bool isLcNonPrompt = false; bool isLcSignal = false; - for (const auto& candidate : selectedLcCandidatesGroupedMc) { + for (const auto& candidate : candidates) { // check decay channel flag for candidate - if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::LcToPKPi)) { - continue; - } - if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { - continue; - } - if (ptCandMin >= 0. && candidate.pt() < ptCandMin) { - continue; - } - if (candidate.pt() >= ptTrackMax) { + if (std::abs(hfHelper.yLc(candidate)) > yCandMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; } - double efficiencyWeight = 1.; + double efficiencyWeightLc = 1.; if (applyEfficiency) { - efficiencyWeight = 1. / efficiencyLc->at(o2::analysis::findBin(binsPt, candidate.pt())); + efficiencyWeightLc = 1. / efficiencyLc->at(o2::analysis::findBin(binsPtEfficiencyLc, candidate.pt())); } - isLcSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi; + isLcSignal = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi); + isLcPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; + isLcNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; + std::vector outputMl = {-1., -1., -1.}; if (isLcSignal) { - registry.fill(HIST("hPtCandMcRec"), candidate.pt()); registry.fill(HIST("hPtProng0McRec"), candidate.ptProng0()); registry.fill(HIST("hPtProng1McRec"), candidate.ptProng1()); registry.fill(HIST("hPtProng2McRec"), candidate.ptProng2()); - registry.fill(HIST("hEtaMcRec"), candidate.eta()); - registry.fill(HIST("hPhiMcRec"), RecoDecay::constrainAngle(candidate.phi(), -o2::constants::math::PIHalf)); - registry.fill(HIST("hYMcRec"), hfHelper.yLc(candidate)); + registry.fill(HIST("hPtCandMcRecSig"), candidate.pt()); + registry.fill(HIST("hEtaMcRecSig"), candidate.eta()); + registry.fill(HIST("hPhiMcRecSig"), RecoDecay::constrainAngle(candidate.phi(), -PIHalf)); + registry.fill(HIST("hYMcRecSig"), hfHelper.yLc(candidate)); // LcToPKPi and LcToPiKP division if (candidate.isSelLcToPKPi() >= selectionFlagLc) { - registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeight); - registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMl[iclass] = candidate.mlProbLcToPKPi()[classMl->at(iclass)]; + } + // prompt and non-prompt division + if (isLcPrompt) { + registry.fill(HIST("hPtCandMcRecSigPrompt"), candidate.pt()); + registry.fill(HIST("hPtVsMultiplicityMcRecPrompt"), candidate.pt(), multiplicityFT0M); + } else if (isLcNonPrompt) { + registry.fill(HIST("hPtCandMcRecSigNonPrompt"), candidate.pt()); + registry.fill(HIST("hPtVsMultiplicityMcRecNonPrompt"), candidate.pt(), multiplicityFT0M); + } + registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeightLc); + registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); + registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPKPi()); + entryLcCandRecoInfo(hfHelper.invMassLcToPKPi(candidate), candidate.pt(), outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore + entryLcCandGenInfo(isLcPrompt); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { - registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeight); - registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMl[iclass] = candidate.mlProbLcToPiKP()[classMl->at(iclass)]; + } + if (isLcPrompt) { + registry.fill(HIST("hPtCandMcRecSigPrompt"), candidate.pt()); + registry.fill(HIST("hPtVsMultiplicityMcRecPrompt"), candidate.pt(), multiplicityFT0M); + } else if (isLcNonPrompt) { + registry.fill(HIST("hPtCandMcRecSigNonPrompt"), candidate.pt()); + registry.fill(HIST("hPtVsMultiplicityMcRecNonPrompt"), candidate.pt(), multiplicityFT0M); + } + registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeightLc); + registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); + registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPiKP()); + entryLcCandRecoInfo(hfHelper.invMassLcToPiKP(candidate), candidate.pt(), outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore + entryLcCandGenInfo(isLcPrompt); } } else { - registry.fill(HIST("hPtCandMcRec"), candidate.pt()); - registry.fill(HIST("hPtProng0McRec"), candidate.ptProng0()); - registry.fill(HIST("hPtProng1McRec"), candidate.ptProng1()); - registry.fill(HIST("hPtProng2McRec"), candidate.ptProng2()); - registry.fill(HIST("hEtaMcRec"), candidate.eta()); - registry.fill(HIST("hPhiMcRec"), RecoDecay::constrainAngle(candidate.phi(), -o2::constants::math::PIHalf)); - registry.fill(HIST("hYMcRec"), hfHelper.yLc(candidate)); + registry.fill(HIST("hPtCandMcRecBkg"), candidate.pt()); + registry.fill(HIST("hEtaMcRecBkg"), candidate.eta()); + registry.fill(HIST("hPhiMcRecBkg"), RecoDecay::constrainAngle(candidate.phi(), -PIHalf)); + registry.fill(HIST("hYMcRecBkg"), hfHelper.yLc(candidate)); // LcToPKPi and LcToPiKP division if (candidate.isSelLcToPKPi() >= selectionFlagLc) { - registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeight); - registry.fill(HIST("hMassLcMcRecBkg"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMl[iclass] = candidate.mlProbLcToPKPi()[classMl->at(iclass)]; + } + registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeightLc); + registry.fill(HIST("hMassLcMcRecBkg"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); + registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPKPi()); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { - registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeight); - registry.fill(HIST("hMassLcMcRecBkg"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMl[iclass] = candidate.mlProbLcToPiKP()[classMl->at(iclass)]; + } + registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeightLc); + registry.fill(HIST("hMassLcMcRecBkg"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); + registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPiKP()); } } - registry.fill(HIST("hLcPoolBin"), poolBin); + registry.fill(HIST("hLcBin"), poolBin); // Lc-Hadron correlation dedicated section // if the candidate is selected as Lc, search for Hadron ad evaluate correlations for (const auto& track : tracks) { - if (std::abs(track.eta()) > etaTrackMax) { - continue; - } - if (track.pt() < ptTrackMin) { + bool isPhysicalPrimary = false; + int trackOrigin = -1; + // apply track selection + if (!track.isGlobalTrackWoDCA()) { continue; } - if (std::abs(track.dcaXY()) >= dcaXYTrackMax || std::abs(track.dcaZ()) >= dcaZTrackMax) { - continue; // Remove secondary tracks - } // Removing Lc daughters by checking track indices if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { if (!storeAutoCorrelationFlag) { @@ -507,13 +551,13 @@ struct HfCorrelatorLcHadrons { } correlationStatus = true; } - registry.fill(HIST("hPtParticleAssocMcRec"), track.pt()); if (correlateLcWithLeadingParticle) { if (track.globalIndex() != leadingIndex) { continue; } } + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), @@ -522,6 +566,23 @@ struct HfCorrelatorLcHadrons { poolBin, correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), isLcSignal); + entryLcHadronMlInfo(outputMl[0], outputMl[1]); + if (track.has_mcParticle()) { + auto mcParticle = track.template mcParticle_as(); + isPhysicalPrimary = mcParticle.isPhysicalPrimary(); + trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, true); + entryLcHadronGenInfo(isLcPrompt, isPhysicalPrimary, trackOrigin); + } else { + entryLcHadronGenInfo(isLcPrompt, false, 0); + registry.fill(HIST("hFakeTracksMcRec"), track.pt()); + } + + // for secondary particle fraction estimation + registry.fill(HIST("hPtParticleAssocVsCandMcRec"), track.pt(), candidate.pt()); + if (isPhysicalPrimary) { + registry.fill(HIST("hPtPrimaryParticleAssocVsCandMcRec"), track.pt(), candidate.pt()); + } + entryTrackRecoInfo(track.dcaXY(), track.dcaZ(), track.tpcNClsCrossedRows()); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), @@ -531,234 +592,325 @@ struct HfCorrelatorLcHadrons { poolBin, correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal); + entryLcHadronMlInfo(outputMl[0], outputMl[1]); + if (track.has_mcParticle()) { + auto mcParticle = track.template mcParticle_as(); + isPhysicalPrimary = mcParticle.isPhysicalPrimary(); + trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, true); + entryLcHadronGenInfo(isLcPrompt, isPhysicalPrimary, trackOrigin); + } else { + entryLcHadronGenInfo(isLcPrompt, false, 0); + registry.fill(HIST("hFakeTracksMcRec"), track.pt()); + } + // for secondary particle fraction estimation + registry.fill(HIST("hPtParticleAssocVsCandMcRec"), track.pt(), candidate.pt()); + if (isPhysicalPrimary) { + registry.fill(HIST("hPtPrimaryParticleAssocVsCandMcRec"), track.pt(), candidate.pt()); + } + entryTrackRecoInfo(track.dcaXY(), track.dcaZ(), track.tpcNClsCrossedRows()); } - } // end inner loop (Tracks) - } // end outer Lc loop + } // end outer Lc loop registry.fill(HIST("hZvtx"), collision.posZ()); registry.fill(HIST("hMultT0M"), collision.multFT0M()); } PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcRec, "Process Mc Reco mode", false); /// Lc-Hadron correlation pair builder - for Mc gen-level analysis - void processMcGen(aod::McCollision const& mcCollision, - soa::Join const& mcParticles) + void processMcGen(SelCollisionsWithLcMc::iterator const& mcCollision, + CandidatesLcMcGen const& mcParticles) { int counterLcHadron = 0; registry.fill(HIST("hMcEvtCount"), 0); + BinningTypeMcGen corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; + int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); + registry.fill(HIST("hMultFT0AMcGen"), mcCollision.multMCFT0A()); + + bool isLcPrompt = false; + bool isLcNonPrompt = false; + // find leading particle if (correlateLcWithLeadingParticle) { leadingIndex = findLeadingParticleMcGen(mcParticles, etaTrackMax.value, ptTrackMin.value); } - auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) { - int nTracks = 0; - for (const auto& track : mcParticles) { - if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { - nTracks++; - } - } - return nTracks; - }; - using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; - BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {binsZVtx, binsMultiplicityMc}, true}; - // Mc gen level for (const auto& particle : mcParticles) { if (std::abs(particle.pdgCode()) != Pdg::kLambdaCPlus) { continue; } - if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { - double yL = RecoDecay::y(particle.pVector(), MassLambdaCPlus); - if (yCandMax >= 0. && std::abs(yL) > yCandMax) { + if (!TESTBIT(std::abs(particle.flagMcMatchGen()), aod::hf_cand_3prong::DecayType::LcToPKPi)) { + continue; + } + double yL = RecoDecay::y(particle.pVector(), MassLambdaCPlus); + if (std::abs(yL) > yCandMax || particle.pt() < ptCandMin) { + continue; + } + registry.fill(HIST("hLcBin"), poolBin); + registry.fill(HIST("hPtCandMcGen"), particle.pt()); + registry.fill(HIST("hEtaMcGen"), particle.eta()); + registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle.phi(), -PIHalf)); + registry.fill(HIST("hYMcGen"), yL); + + isLcPrompt = particle.originMcGen() == RecoDecay::OriginType::Prompt; + isLcNonPrompt = particle.originMcGen() == RecoDecay::OriginType::NonPrompt; + if (isLcPrompt) { + registry.fill(HIST("hPtCandMcGenPrompt"), particle.pt()); + } else if (isLcNonPrompt) { + registry.fill(HIST("hPtCandMcGenNonPrompt"), particle.pt()); + } + + // prompt and non-prompt division + std::vector listDaughters{}; + std::array arrDaughLcPDG = {kProton, -kKPlus, kPiPlus}; + std::array prongsId; + listDaughters.clear(); + RecoDecay::getDaughters(particle, &listDaughters, arrDaughLcPDG, 2); + int counterDaughters = 0; + if (listDaughters.size() == 3) { + for (const auto& dauIdx : listDaughters) { + auto daughI = mcParticles.rawIteratorAt(dauIdx - mcParticles.offset()); + counterDaughters += 1; + prongsId[counterDaughters - 1] = daughI.globalIndex(); + } + } + counterLcHadron++; + // Lc Hadron correlation dedicated section + // if it's a Lc particle, search for Hadron and evalutate correlations + registry.fill(HIST("hcountLctriggersMcGen"), 0, particle.pt()); // to count trigger Lc for normalisation + for (const auto& particleAssoc : mcParticles) { + if (std::abs(particleAssoc.eta()) > etaTrackMax || particleAssoc.pt() < ptTrackMin || particleAssoc.pt() > ptTrackMax) { continue; } - if (ptCandMin >= 0. && particle.pt() < ptCandMin) { + if (particleAssoc.globalIndex() == prongsId[0] || particleAssoc.globalIndex() == prongsId[1] || particleAssoc.globalIndex() == prongsId[2]) { continue; } - registry.fill(HIST("hPtCandMcGen"), particle.pt()); - registry.fill(HIST("hEtaMcGen"), particle.eta()); - registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle.phi(), -o2::constants::math::PIHalf)); - registry.fill(HIST("hYMcGen"), yL); - counterLcHadron++; - - for (const auto& particleAssoc : mcParticles) { - bool flagMotherFound = false; - for (const auto& m : particleAssoc.mothers_as()) { - if (m.globalIndex() == particle.globalIndex()) { - flagMotherFound = true; - break; - } - } - if (flagMotherFound) { - continue; - } - if (std::abs(particleAssoc.eta()) > etaTrackMax) { - continue; - } - if (particleAssoc.pt() < ptTrackMin) { + if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { + if (!storeAutoCorrelationFlag) { continue; } + correlationStatus = true; + } + if (!particleAssoc.isPhysicalPrimary()) { + continue; + } - if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { - if (!storeAutoCorrelationFlag) { - continue; - } - correlationStatus = true; - } - - if (correlateLcWithLeadingParticle) { - if (particleAssoc.globalIndex() != leadingIndex) { - continue; - } + if (correlateLcWithLeadingParticle) { + if (particleAssoc.globalIndex() != leadingIndex) { + continue; } + } - int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), getTracksSize(mcCollision))); - registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); - entryLcHadronPair(getDeltaPhi(particleAssoc.phi(), particle.phi()), - particleAssoc.eta() - particle.eta(), - particle.pt(), - particleAssoc.pt(), - poolBin, - correlationStatus); - entryLcHadronRecoInfo(MassLambdaCPlus, true); - } // end inner loop - } + int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true); + registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); + entryLcHadronPair(getDeltaPhi(particleAssoc.phi(), particle.phi()), + particleAssoc.eta() - particle.eta(), + particle.pt(), + particleAssoc.pt(), + poolBin, + correlationStatus); + entryLcHadronRecoInfo(MassLambdaCPlus, true); + entryLcHadronGenInfo(isLcPrompt, particleAssoc.isPhysicalPrimary(), trackOrigin); + } // end inner loop } // end outer loop registry.fill(HIST("hCountLcHadronPerEvent"), counterLcHadron); registry.fill(HIST("hZvtx"), mcCollision.posZ()); - registry.fill(HIST("hMultiplicity"), getTracksSize(mcCollision)); } PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcGen, "Process Mc Gen mode", false); - void processDataMixedEvent(SelectedCollisions const& collisions, - SelectedCandidatesData const& candidates, - SelectedTracks const& tracks) + void processDataMixedEvent(SelCollisionsWithLc const& collisions, + CandidatesLcData const& candidates, + TracksData const& tracks) { if (candidates.size() == 0) { return; } auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{corrBinning, nEventForMixedEvent, -1, collisions, tracksTuple, &cache}; + Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairData) { int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); - for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - if (!TESTBIT(t1.hfflag(), aod::hf_cand_3prong::DecayType::LcToPKPi)) { - continue; - } - if (yCandMax >= 0. && std::abs(hfHelper.yLc(t1)) > yCandMax) { + for (const auto& [trigLc, assocParticle] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + if (!assocParticle.isGlobalTrackWoDCA() || std::abs(hfHelper.yLc(trigLc)) > yCandMax) { continue; } + std::vector outputMl = {-1., -1., -1.}; // LcToPKPi and LcToPiKP division - if (t1.isSelLcToPKPi() >= selectionFlagLc) { - entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), - t1.eta() - t2.eta(), - t1.pt(), - t2.pt(), + if (trigLc.isSelLcToPKPi() >= selectionFlagLc) { + entryLcHadronPair(getDeltaPhi(assocParticle.phi(), trigLc.phi()), + assocParticle.eta() - trigLc.eta(), + trigLc.pt(), + assocParticle.pt(), poolBin, correlationStatus); - entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(t1), false); - } - if (t1.isSelLcToPiKP() >= selectionFlagLc) { - entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), - t1.eta() - t2.eta(), - t1.pt(), - t2.pt(), + entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(trigLc), false); + entryLcHadronGenInfo(false, false, 0); + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMl[iclass] = trigLc.mlProbLcToPKPi()[classMl->at(iclass)]; + } + entryLcHadronMlInfo(outputMl[0], outputMl[1]); + entryTrackRecoInfo(assocParticle.dcaXY(), assocParticle.dcaZ(), assocParticle.tpcNClsCrossedRows()); + } + if (trigLc.isSelLcToPiKP() >= selectionFlagLc) { + entryLcHadronPair(getDeltaPhi(assocParticle.phi(), trigLc.phi()), + assocParticle.eta() - trigLc.eta(), + trigLc.pt(), + assocParticle.pt(), poolBin, correlationStatus); - entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false); + entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(trigLc), false); + entryLcHadronGenInfo(false, false, 0); + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMl[iclass] = trigLc.mlProbLcToPiKP()[classMl->at(iclass)]; + } + entryLcHadronMlInfo(outputMl[0], outputMl[1]); + entryTrackRecoInfo(assocParticle.dcaXY(), assocParticle.dcaZ(), assocParticle.tpcNClsCrossedRows()); } } } } PROCESS_SWITCH(HfCorrelatorLcHadrons, processDataMixedEvent, "Process Mixed Event Data", false); - void processMcRecMixedEvent(SelectedCollisions const& collisions, - SelectedCandidatesMcRec const& candidates, - SelectedTracks const& tracks) + void processMcRecMixedEvent(SelCollisionsWithLc const& collisions, + CandidatesLcMcRec const& candidates, + TracksWithMc const& tracks, + aod::McParticles const& mcParticles) { + BinningType corrBinning{{binsZVtx, binsMultiplicityMc}, true}; + for (const auto& candidate : candidates) { + if (std::abs(hfHelper.yLc(candidate)) > yCandMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { + continue; + } + // Lc flag + bool isLcSignal = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi); + // prompt and non-prompt division + bool isLcPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; + bool isLcNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; + if (isLcSignal) { + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { + if (isLcPrompt) { + registry.fill(HIST("hPtCandMcRecSigPrompt"), candidate.pt()); + registry.fill(HIST("hPtVsMultiplicityMcRecPrompt"), candidate.pt(), 0); + } else if (isLcNonPrompt) { + registry.fill(HIST("hPtCandMcRecSigNonPrompt"), candidate.pt()); + registry.fill(HIST("hPtVsMultiplicityMcRecNonPrompt"), candidate.pt(), 0); + } + } + if (candidate.isSelLcToPiKP() >= selectionFlagLc) { + if (isLcPrompt) { + registry.fill(HIST("hPtCandMcRecSigPrompt"), candidate.pt()); + registry.fill(HIST("hPtVsMultiplicityMcRecPrompt"), candidate.pt(), 0); + } else if (isLcNonPrompt) { + registry.fill(HIST("hPtCandMcRecSigNonPrompt"), candidate.pt()); + registry.fill(HIST("hPtVsMultiplicityMcRecNonPrompt"), candidate.pt(), 0); + } + } + } else { + registry.fill(HIST("hPtCandMcRecBkg"), candidate.pt()); + registry.fill(HIST("hEtaMcRecBkg"), candidate.eta()); + registry.fill(HIST("hPhiMcRecBkg"), RecoDecay::constrainAngle(candidate.phi(), -PIHalf)); + } + } auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairMcRec{corrBinning, nEventForMixedEvent, -1, collisions, tracksTuple, &cache}; + Pair pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); - for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - if (yCandMax >= 0. && std::abs(hfHelper.yLc(t1)) > yCandMax) { + int poolBinLc = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); + registry.fill(HIST("hMultFT0M"), c1.multFT0M()); + registry.fill(HIST("hZVtx"), c1.posZ()); + registry.fill(HIST("TracksPoolBin"), poolBin); + registry.fill(HIST("hLcPoolBin"), poolBinLc); + for (const auto& [candidate, pAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + if (std::abs(hfHelper.yLc(candidate)) > yCandMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; } - if (t1.isSelLcToPKPi() >= selectionFlagLc) { - entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), - t1.eta() - t2.eta(), - t1.pt(), - t2.pt(), + if (!pAssoc.isGlobalTrackWoDCA()) { + continue; + } + std::vector outputMl = {-1., -1., -1.}; + bool isPhysicalPrimary = false; + int trackOrigin = -1; + bool isLcSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi; + bool isLcPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; + if (pAssoc.has_mcParticle()) { + auto mcParticle = pAssoc.template mcParticle_as(); + isPhysicalPrimary = mcParticle.isPhysicalPrimary(); + trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, true); + } else { + registry.fill(HIST("hFakeTracksMcRec"), pAssoc.pt()); + } + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { + entryLcHadronPair(getDeltaPhi(pAssoc.phi(), candidate.phi()), + pAssoc.eta() - candidate.eta(), + candidate.pt(), + pAssoc.pt(), poolBin, correlationStatus); - entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(t1), false); + entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), isLcSignal); + entryLcHadronGenInfo(isLcPrompt, isPhysicalPrimary, trackOrigin); + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMl[iclass] = candidate.mlProbLcToPKPi()[classMl->at(iclass)]; + } + entryLcHadronMlInfo(outputMl[0], outputMl[1]); + entryTrackRecoInfo(pAssoc.dcaXY(), pAssoc.dcaZ(), pAssoc.tpcNClsCrossedRows()); } - if (t1.isSelLcToPiKP() >= selectionFlagLc) { - entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), - t1.eta() - t2.eta(), - t1.pt(), - t2.pt(), + if (candidate.isSelLcToPiKP() >= selectionFlagLc) { + entryLcHadronPair(getDeltaPhi(pAssoc.phi(), candidate.phi()), + pAssoc.eta() - candidate.eta(), + candidate.pt(), + pAssoc.pt(), poolBin, correlationStatus); - entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false); + entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal); + entryLcHadronGenInfo(isLcPrompt, isPhysicalPrimary, trackOrigin); + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMl[iclass] = candidate.mlProbLcToPiKP()[classMl->at(iclass)]; + } + entryLcHadronMlInfo(outputMl[0], outputMl[1]); + entryTrackRecoInfo(pAssoc.dcaXY(), pAssoc.dcaZ(), pAssoc.tpcNClsCrossedRows()); } } } } PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcRecMixedEvent, "Process Mixed Event McRec", false); - void processMcGenMixedEvent(SelectedCollisionsMcGen const& collisions, - SelectedTracksMcGen const& mcParticles) + void processMcGenMixedEvent(SelCollisionsWithLcMc const& collisions, + CandidatesLcMcGen const& mcParticles) { - auto getTracksSize = [&mcParticles, this](SelectedCollisionsMcGen::iterator const& collision) { - int nTracks = 0; - auto associatedTracks = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision.globalIndex(), this->cache); - for (const auto& track : associatedTracks) { - if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { - nTracks++; - } - } - return nTracks; - }; - - using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; - BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {binsZVtx, binsMultiplicityMc}, true}; - + BinningTypeMcGen corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; auto tracksTuple = std::make_tuple(mcParticles, mcParticles); - Pair pairMcGen{corrBinningMcGen, nEventForMixedEvent, -1, collisions, tracksTuple, &cache}; - + Pair pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { - for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - // Check track t1 is Lc - if (std::abs(t1.pdgCode()) != Pdg::kLambdaCPlus) { + int poolBin = corrBinningMcGen.getBin(std::make_tuple(c1.posZ(), c1.multMCFT0A())); + for (const auto& [candidate, particleAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + if (std::abs(candidate.pdgCode()) != Pdg::kLambdaCPlus) { continue; } - - double yL = RecoDecay::y(t1.pVector(), MassLambdaCPlus); - if (yCandMax >= 0. && std::abs(yL) > yCandMax) { + double yL = RecoDecay::y(candidate.pVector(), MassLambdaCPlus); + if (std::abs(yL) > yCandGenMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { continue; } - if (ptCandMin >= 0. && t1.pt() < ptCandMin) { + if (std::abs(particleAssoc.eta()) > etaTrackMax || particleAssoc.pt() < ptTrackMin || particleAssoc.pt() > ptTrackMax) { continue; } - - if (std::abs(t2.eta()) > etaTrackMax) { + if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particleAssoc.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { continue; } - if (t2.pt() < ptTrackMin) { + if (!particleAssoc.isPhysicalPrimary()) { continue; } - int poolBin = corrBinningMcGen.getBin(std::make_tuple(c2.posZ(), getTracksSize(c2))); - entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), - t1.eta() - t2.eta(), - t1.pt(), - t2.pt(), + int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true); + bool isLcPrompt = candidate.originMcGen() == RecoDecay::OriginType::Prompt; + entryLcHadronPair(getDeltaPhi(particleAssoc.phi(), candidate.phi()), + particleAssoc.eta() - candidate.eta(), + candidate.pt(), + particleAssoc.pt(), poolBin, correlationStatus); + entryLcHadronRecoInfo(MassLambdaCPlus, true); + entryLcHadronGenInfo(isLcPrompt, particleAssoc.isPhysicalPrimary(), trackOrigin); } } } diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index 3acc221d30f..6a6c241a518 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -14,12 +14,15 @@ /// \author Marianna Mazzilli /// \author Zhen Zhang +#include // std::shared_ptr +#include #include - +#include "CCDB/BasicCCDBManager.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" +#include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsAnalysis.h" @@ -27,46 +30,26 @@ #include "PWGHF/HFC/Utils/utilsCorrelations.h" using namespace o2; +using namespace o2::constants::math; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::analysis::hf_correlations; -/// -/// Returns deltaPhi value in range [-pi/2., 3.*pi/2], typically used for correlation studies -/// -double getDeltaPhi(double phiLc, double phiHadron) -{ - return RecoDecay::constrainAngle(phiHadron - phiLc, -o2::constants::math::PIHalf); -} - -/// -/// Returns phi of candidate/particle evaluated from x and y components of segment connecting primary and secondary vertices -/// -double evaluatePhiByVertex(double xVertex1, double xVertex2, double yVertex1, double yVertex2) -{ - return RecoDecay::phi(xVertex2 - xVertex1, yVertex2 - yVertex1); -} - // string definitions, used for histogram axis labels const TString stringPtLc = "#it{p}_{T}^{#Lambda_c} (GeV/#it{c});"; const TString stringPtHadron = "#it{p}_{T}^{Hadron} (GeV/#it{c});"; -const TString stringPoolBin = "poolBin;"; const TString stringDeltaEta = "#it{#eta}^{Hadron}-#it{#eta}^{#Lambda_c};"; const TString stringDeltaPhi = "#it{#varphi}^{Hadron}-#it{#varphi}^{#Lambda_c} (rad);"; const TString stringLcHadron = "#Lambda_c,Hadron candidates "; const TString stringSignal = "signal region;"; const TString stringSideband = "sidebands;"; -const TString stringMcParticles = "Mc gen - #Lambda_c,Hadron particles;"; -const TString stringMcReco = "Mc reco - #Lambda_c,Hadron candidates "; - -// histogram axes definition -AxisSpec axisDeltaEta = {100, -2., 2.}; -AxisSpec axisDeltaPhi = {64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}; -AxisSpec axisPtLc = {10, 0., 10.}; -AxisSpec axisPtHadron = {11, 0., 11.}; -AxisSpec axisPoolBin = {9, 0., 9.}; -AxisSpec axisCorrelationState = {2, 0., 2., ""}; -ConfigurableAxis axisMass{"axisMass", {120, 1.98f, 2.58f}, ""}; +const TString stringMcParticles = "MC gen - #Lambda_c,Hadron particles;"; +const TString stringMcReco = "MC reco - #Lambda_c,Hadron candidates "; +const TString stringMcRecoLcPrompt = "MC reco, prompt #Lambda_c;"; +const TString stringMcGenLcPrompt = "MC gen, prompt #Lambda_c;"; +const TString stringMcRecoLcFd = "MC reco, non-prompt #Lambda_c;"; +const TString stringMcGenLcFd = "MC gen, non-prompt #Lambda_c;"; // definition of vectors for standard ptbin and invariant mass configurables const int nPtBinsCorrelations = 8; @@ -84,16 +67,28 @@ auto vecSidebandLeftInner = std::vector{sidebandLeftInnerDefault, sideba auto vecSidebandLeftOuter = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nPtBinsCorrelations}; auto vecSidebandRightInner = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nPtBinsCorrelations}; auto vecSidebandRightOuter = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nPtBinsCorrelations}; -const int nPtBinsEfficiency = o2::analysis::hf_cuts_lc_to_p_k_pi::nBinsPt; -const double efficiencyLcDefault[nPtBinsEfficiency] = {}; -auto vecEfficiencyLc = std::vector{efficiencyLcDefault, efficiencyLcDefault + nPtBinsEfficiency}; /// Lc-Hadron correlation pair filling task, from pair tables - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) struct HfTaskCorrelationLcHadrons { - // Pt ranges for correlation plots: the default values are those embedded in hf_cuts_lc_to_p_k_pi (i.e. the mass Pt bins), but can be redefined via json files + Configurable fillHistoData{"fillHistoData", true, "Flag for filling histograms in data processes"}; + Configurable fillHistoMcRec{"fillHistoMcRec", true, "Flag for filling histograms in MC Rec processes"}; + Configurable fillHistoMcGen{"fillHistoMcGen", true, "Flag for filling histograms in MC Gen processes"}; + Configurable fillHistoMcEff{"fillHistoMcEff", true, "Flag for filling histograms in efficiency processes"}; Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying efficiency weights"}; + Configurable loadAccXEffFromCCDB{"loadAccXEffFromCCDB", false, "Flag for loading efficiency distributions from CCDB"}; + Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; + Configurable selNoSameBunchPileUpColl{"selNoSameBunchPileUpColl", true, "Flag for rejecting the collisions associated with the same bunch crossing"}; + Configurable> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; + Configurable> mlOutputPrompt{"mlScorePrompt", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"}; + Configurable> mlOutputBkg{"mlScoreBkg", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"}; + // Pt ranges for correlation plots: the default values are those embedded in hf_cuts_lc_to_p_k_pi (i.e. the mass Pt bins), but can be redefined via json files Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{vecBinsPtCorrelations}, "Pt bin limits for correlation plots"}; - Configurable> binsPtEfficiency{"binsPtEfficiency", std::vector{o2::analysis::hf_cuts_lc_to_p_k_pi::vecBinsPt}, "Pt bin limits for efficiency"}; + Configurable> binsPtHadron{"binsPtHadron", std::vector{0.3, 2., 4., 8., 12., 50.}, "Pt bin limits for assoc particle efficiency"}; + Configurable> binsPtEfficiencyLc{"binsPtEfficiencyLc", std::vector{o2::analysis::hf_cuts_lc_to_p_k_pi::vecBinsPt}, "Pt bin limits for efficiency"}; + Configurable> binsPtEfficiencyHad{"binsPtEfficiencyHad", std::vector{0.3, 2., 4., 8., 12., 50.}, "pT bin limits for associated particle efficiency"}; + Configurable> efficiencyLc{"efficiencyLc", {1., 1., 1., 1., 1., 1.}, "efficiency values for prompt Lc"}; + Configurable> efficiencyFdLc{"efficiencyFdLc", {1., 1., 1., 1., 1., 1.}, "efficiency values for beauty feed-down Lc"}; + Configurable> efficiencyHad{"efficiencyHad", {1., 1., 1., 1., 1., 1.}, "efficiency values for associated particles"}; // signal and sideband region edges, to be defined via json file (initialised to empty) Configurable> signalRegionInner{"signalRegionInner", std::vector{vecSignalRegionInner}, "Inner values of signal region vs Pt"}; Configurable> signalRegionOuter{"signalRegionOuter", std::vector{vecSignalRegionOuter}, "Outer values of signal region vs Pt"}; @@ -101,95 +96,268 @@ struct HfTaskCorrelationLcHadrons { Configurable> sidebandLeftOuter{"sidebandLeftOuter", std::vector{vecSidebandLeftOuter}, "Outer values of left sideband vs Pt"}; Configurable> sidebandRightInner{"sidebandRightInner", std::vector{vecSidebandRightInner}, "Inner values of right sideband vs Pt"}; Configurable> sidebandRightOuter{"sidebandRightOuter", std::vector{vecSidebandRightOuter}, "Outer values of right sideband vs Pt"}; - Configurable> efficiencyLc{"efficiencyLc", std::vector{vecEfficiencyLc}, "Efficiency values for Lc "}; Configurable isTowardTransverseAway{"isTowardTransverseAway", false, "Divide into three regions: toward, transverse, and away"}; Configurable leadingParticlePtMin{"leadingParticlePtMin", 0., "Min for leading particle pt"}; + Configurable dcaXYTrackMax{"dcaXYTrackMax", 1., "max. DCA_xy of tracks"}; + Configurable dcaZTrackMax{"dcaZTrackMax", 1., "max. DCA_z of tracks"}; + Configurable etaTrackMax{"etaTrackMax", 0.8, "max. eta of tracks"}; + Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; + Configurable ptCandMax{"ptCandMax", 50., "max. cand pT"}; + Configurable ptTrackMin{"ptTrackMin", 0.3, "min. track pT"}; + Configurable ptTrackMax{"ptTrackMax", 50., "max. track pT"}; + Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; + Configurable yCandGenMax{"yCandGenMax", 0.5, "max. gen. cand. rapidity"}; + Configurable ptDaughterMin{"ptDaughterMin", 0.1, "min. daughter pT"}; + Configurable activateQA{"activateQA", false, "Flag to enable debug histogram"}; + Configurable nTpcCrossedRaws{"nTpcCrossedRaws", 70, "Number of crossed TPC Rows"}; + // CCDB configuration + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable associatedEffCcdbPath{"associatedEffCcdbPath", "", "CCDB path for associated efficiency"}; + Configurable promptEffCcdbPath{"promptEffCcdbPath", "", "CCDB path for trigger efficiency"}; + Configurable fdEffCcdbPath{"fdEffCcdbPath", "", "CCDB path for trigger efficiency"}; + Configurable timestampCcdb{"timestampCcdb", -1, "timestamp of the efficiency files used to query in CCDB"}; + Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + // configurable axis definition + ConfigurableAxis binsMassLc{"binsMassLc", {200, 1.98, 2.58}, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; + ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; + ConfigurableAxis binsEta{"binsEta", {100, -2., 2.}, "#it{#eta}"}; + ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; + ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 8000.}, "Multiplicity as FT0M signal amplitude"}; + ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; + + Service ccdb; + std::shared_ptr mEfficiencyPrompt = nullptr; + std::shared_ptr mEfficiencyFD = nullptr; + std::shared_ptr mEfficiencyAssociated = nullptr; + + HfHelper hfHelper; + + enum CandidateStep { kCandidateStepMcGenAll = 0, + kCandidateStepMcGenLcToPKPi, + kCandidateStepMcCandInAcceptance, + kCandidateStepMcDaughtersInAcceptance, + kCandidateStepMcReco, + kCandidateStepMcRecoInAcceptance, + kCandidateNSteps }; + + using LcHadronPair = soa::Join; + using LcHadronPairFullWithMl = soa::Join; + using CandLcMcReco = soa::Filtered>; + using CandLcMcGen = soa::Join; + using TracksWithMc = soa::Filtered>; // trackFilter applied + + Filter lcFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) != static_cast(0)) && (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); + Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); - using LcHadronPairFull = soa::Join; - - HistogramRegistry registry{ - "registry", - {{"hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - {"hDeltaEtaPtIntSidebands", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - {"hDeltaEtaPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hCorrel2DVsPtSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hCorrel2DVsPtBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hDeltaEtaPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hDeltaEtaPtIntMcGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntMcGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - // Toward Transverse Away - {"hToward", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hTransverse", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hAway", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - // Toward Transverse Away for McRec - {"hTowardRec", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hTransverseRec", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hAwayRec", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - // Toward Transverse Away for McGen - {"hTowardGen", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hTransverseGen", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hAwayGen", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}}}; + HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) { - // redefinition of Pt axes for THnSparse holding correlation entries - int nBinsPtAxis = binsPtCorrelations->size() - 1; - const double* valuesPtAxis = binsPtCorrelations->data(); - - registry.get(HIST("hCorrel2DVsPtSignalRegion"))->GetAxis(2)->Set(nBinsPtAxis, valuesPtAxis); - registry.get(HIST("hCorrel2DVsPtSidebands"))->GetAxis(2)->Set(nBinsPtAxis, valuesPtAxis); - registry.get(HIST("hCorrel2DVsPtSignalRegion"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtSidebands"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtSignalRegionMcRec"))->GetAxis(2)->Set(nBinsPtAxis, valuesPtAxis); - registry.get(HIST("hCorrel2DVsPtSidebandsMcRec"))->GetAxis(2)->Set(nBinsPtAxis, valuesPtAxis); - registry.get(HIST("hCorrel2DVsPtSignalRegionMcRec"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtSidebandsMcRec"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtSignalMcRec"))->GetAxis(2)->Set(nBinsPtAxis, valuesPtAxis); - registry.get(HIST("hCorrel2DVsPtSignalMcRec"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtBkgMcRec"))->GetAxis(2)->Set(nBinsPtAxis, valuesPtAxis); - registry.get(HIST("hCorrel2DVsPtBkgMcRec"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtMcGen"))->GetAxis(2)->Set(nBinsPtAxis, valuesPtAxis); - registry.get(HIST("hCorrel2DVsPtMcGen"))->Sumw2(); + // Axis definition + AxisSpec axisMassLc = {binsMassLc, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; + AxisSpec axisPtCorr = {(std::vector)binsPtCorrelations, "#it{p}_{T}^{#Lambda_c} (GeV/#it{c})"}; + AxisSpec axisPtLc = {(std::vector)binsPtEfficiencyLc, "#it{p}_{T}^{#Lambda_c} (GeV/#it{c})"}; + AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; + AxisSpec axisDeltaEta = {binsEta, "#it{#eta}^{Hadron}-#it{#eta}^{#Lambda_c}"}; + AxisSpec axisDeltaPhi = {binsPhi, "#it{#varphi}^{Hadron}-#it{#varphi}^{#Lambda_c} (rad)"}; + AxisSpec axisPtHadron = {(std::vector)binsPtHadron, "#it{p}_{T}^{Hadron} (GeV/#it{c})"}; + AxisSpec axisPoolBin = {binsPoolBin, "poolBin"}; + AxisSpec axisLcPrompt = {2, -0.5, 1.5, "Prompt #Lambda_c"}; + AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; + + // Histograms for data analysis + registry.add("hBdtScorePrompt", "Lc BDT prompt score", {HistType::kTH1F, {axisBdtScore}}); + registry.add("hBdtScoreBkg", "Lc BDT bkg score", {HistType::kTH1F, {axisBdtScore}}); + registry.add("hMassLcVsPt", "Lc candidates massVsPt", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); + if (fillHistoData) { + registry.add("hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}); + registry.add("hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}); + registry.add("hCorrel2DPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}); + registry.add("hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hDeltaEtaPtIntSidebands", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}); + registry.add("hDeltaPhiPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}); + registry.add("hCorrel2DPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}); + registry.add("hCorrel2DVsPtSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hDeltaEtaPtIntSidebandLeft", stringLcHadron + "Left" + stringSideband + stringDeltaEta, {HistType::kTH1F, {axisDeltaEta}}); + registry.add("hDeltaPhiPtIntSidebandLeft", stringLcHadron + "Left" + stringSideband + stringDeltaPhi, {HistType::kTH1F, {axisDeltaPhi}}); + registry.add("hDeltaEtaPtIntSidebandRight", stringLcHadron + "Right" + stringSideband + stringDeltaEta, {HistType::kTH1F, {axisDeltaEta}}); + registry.add("hDeltaPhiPtIntSidebandRight", stringLcHadron + "Right" + stringSideband + stringDeltaPhi, {HistType::kTH1F, {axisDeltaPhi}}); + registry.add("hCorrel2DVsPtSidebandLeft", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSidebandRight", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + + registry.get(HIST("hCorrel2DVsPtSignalRegion"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSidebands"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSidebandLeft"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSidebandRight"))->Sumw2(); + } + // Histograms for MC Reco analysis + if (fillHistoMcRec) { + registry.add("hMassPromptLcVsPt", "Lc prompt candidates mass Vs Pt", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); + registry.add("hMassNonPromptLcVsPt", "Lc non prompt candidates mass Vs Pt", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); + registry.add("hDeltaEtaPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}); + registry.add("hDeltaPhiPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}); + registry.add("hDeltaEtaPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}); + registry.add("hCorrel2DPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}); + registry.add("hCorrel2DVsPtSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisLcPrompt}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hDeltaPhiPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}); + registry.add("hCorrel2DPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}); + registry.add("hCorrel2DVsPtSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtPhysicalPrimaryMcRec", stringLcHadron + "(only true primary particles)" + stringSignal, {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisLcPrompt}, {axisPoolBin}}}); + registry.add("hDeltaEtaPtIntSidebandLeftMcRec", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTH1F, {axisDeltaEta}}); + registry.add("hDeltaPhiPtIntSidebandLeftMcRec", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTH1F, {axisDeltaPhi}}); + registry.add("hCorrel2DVsPtSidebandLeftMcRec", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hDeltaEtaPtIntSidebandRightMcRec", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTH1F, {axisDeltaEta}}); + registry.add("hDeltaPhiPtIntSidebandRightMcRec", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTH1F, {axisDeltaPhi}}); + registry.add("hCorrel2DVsPtSidebandRightMcRec", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignalRegionPromptLcPromptHadronMcRec", stringLcHadron + "signal region PromptLc - Prompt Track MC reco", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignalRegionNonPromptLcNonPromptHadronMcRec", stringLcHadron + " signal region PromptLc - NonPrompt Track MC reco", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + + registry.get(HIST("hCorrel2DVsPtSignalRegionMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSidebandsMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignalMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtBkgMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSidebandLeftMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSidebandRightMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignalRegionMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtPhysicalPrimaryMcRec"))->Sumw2(); + } + // Histograms for MC Gen analysis + if (fillHistoMcGen) { + registry.add("hDeltaEtaPtIntMcGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}); + registry.add("hDeltaPhiPtIntMcGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}); + registry.add("hCorrel2DPtIntMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}); + registry.add("hCorrel2DVsPtMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtMcGenPrompt", stringLcHadron + " Prompt MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtMcGenPromptLcPromptHadron", stringLcHadron + "prompt Lc prompt h MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtMcGenNonPromptLcNonPromptHadron", stringLcHadron + " non prompt Lc non prompt h MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtMcGenNonPrompt", stringLcHadron + " NonPrompt MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + + registry.get(HIST("hCorrel2DVsPtMcGen"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtMcGenPrompt"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtMcGenNonPrompt"))->Sumw2(); + } + // Histograms for efficiencies + registry.add("Efficiency/hPtCandMcRecPrompt", stringMcRecoLcPrompt + stringPtLc, {HistType::kTH1F, {axisPtLc}}); + registry.add("Efficiency/hPtCandMcGenPrompt", stringMcGenLcPrompt + stringPtLc, {HistType::kTH1F, {axisPtLc}}); + registry.add("Efficiency/hPtCandMcRecNonPrompt", stringMcRecoLcFd + stringPtLc, {HistType::kTH1F, {axisPtLc}}); + registry.add("Efficiency/hPtCandMcGenNonPrompt", stringMcGenLcFd + stringPtLc, {HistType::kTH1F, {axisPtLc}}); + registry.add("Efficiency/hPtCandMcGenDaughterInAcc", stringMcGenLcFd + stringPtLc, {HistType::kTH1F, {axisPtLc}}); + + auto hCandidates = registry.add("hCandidates", "Candidate count at different steps", {HistType::kStepTHnF, {axisPtLc, axisMultFT0M, {RecoDecay::OriginType::NonPrompt + 1, +RecoDecay::OriginType::None - 0.5, +RecoDecay::OriginType::NonPrompt + 0.5}}, kCandidateNSteps}); + hCandidates->GetAxis(0)->SetTitle("#it{p}_{T} (GeV/#it{c})"); + hCandidates->GetAxis(1)->SetTitle("multiplicity"); + hCandidates->GetAxis(2)->SetTitle("Charm hadron origin"); + + // Loading efficiency histograms from CCDB + if (applyEfficiency && loadAccXEffFromCCDB) { + ccdb->setURL(ccdbUrl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); + + mEfficiencyPrompt = std::shared_ptr(ccdb->getForTimeStamp(promptEffCcdbPath, timestampCcdb)); + if (mEfficiencyPrompt == nullptr) { + LOGF(fatal, "Could not load efficiency histogram for trigger particles from %s", promptEffCcdbPath.value.c_str()); + } + LOGF(info, "Loaded trigger efficiency (prompt Lc) histogram from %s", promptEffCcdbPath.value.c_str()); + + mEfficiencyFD = std::shared_ptr(ccdb->getForTimeStamp(fdEffCcdbPath, timestampCcdb)); + if (mEfficiencyFD == nullptr) { + LOGF(fatal, "Could not load efficiency histogram for trigger particles from %s", fdEffCcdbPath.value.c_str()); + } + LOGF(info, "Loaded feed-down Lc efficiency histogram from %s", fdEffCcdbPath.value.c_str()); + + mEfficiencyAssociated = std::shared_ptr(ccdb->getForTimeStamp(associatedEffCcdbPath, timestampCcdb)); + if (mEfficiencyAssociated == nullptr) { + LOGF(fatal, "Could not load efficiency histogram for associated particles from %s", associatedEffCcdbPath.value.c_str()); + } + LOGF(info, "Loaded associated efficiency histogram from %s", associatedEffCcdbPath.value.c_str()); + } + + if (activateQA) { + const int regionLimits = 6; + std::string labels[regionLimits] = {"SigReg Left", "SigReg Right", "Left SB Low", "Left SB Up", "Right SB Low", "Right SB Up"}; + static const AxisSpec axisSidebandLimits = {regionLimits, 0.5, 6.5, ""}; + auto hSigSidebandLimits = registry.add("Inputs/hSigSidebandLimits", "Signal and Sideband Limits;;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisSidebandLimits, {(std::vector)binsPtCorrelations, "#it{p}_{T} (GeV/#it{c})"}}}); + for (int iLim = 0; iLim < regionLimits; iLim++) { + hSigSidebandLimits->GetXaxis()->SetBinLabel(iLim + 1, labels[iLim].data()); + } + for (size_t iPtLc = 0; iPtLc < binsPtCorrelations->size() - 1; iPtLc++) { + hSigSidebandLimits->SetBinContent(1, iPtLc + 1, signalRegionInner->at(iPtLc)); + hSigSidebandLimits->SetBinContent(2, iPtLc + 1, signalRegionOuter->at(iPtLc)); + hSigSidebandLimits->SetBinContent(3, iPtLc + 1, sidebandLeftOuter->at(iPtLc)); + hSigSidebandLimits->SetBinContent(4, iPtLc + 1, sidebandLeftInner->at(iPtLc)); + hSigSidebandLimits->SetBinContent(5, iPtLc + 1, sidebandRightInner->at(iPtLc)); + hSigSidebandLimits->SetBinContent(6, iPtLc + 1, sidebandRightOuter->at(iPtLc)); + } + } } - void processData(LcHadronPairFull const& pairEntries) + void processData(LcHadronPairFullWithMl const& pairEntries, aod::LcRecoInfo const& candidates) { + for (const auto& candidate : candidates) { + float massLc = candidate.mLc(); + float ptLc = candidate.ptLc(); + float bdtScorePrompt = candidate.mlScorePrompt(); + float bdtScoreBkg = candidate.mlScoreBkg(); + int effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); + + // reject entries outside Pt ranges of interest + if (ptLc < binsPtEfficiencyLc->front() || ptLc > binsPtEfficiencyLc->back()) { + continue; + } + + if (bdtScorePrompt < mlOutputPrompt->at(effBinLc) || bdtScoreBkg > mlOutputBkg->at(effBinLc)) { + continue; + } + double efficiencyWeightLc = 1.; + if (applyEfficiency) { + efficiencyWeightLc = 1. / efficiencyLc->at(o2::analysis::findBin(binsPtEfficiencyLc, ptLc)); + if (loadAccXEffFromCCDB) { + efficiencyWeightLc = 1. / mEfficiencyPrompt->GetBinContent(mEfficiencyPrompt->FindBin(ptLc)); + } + } + registry.fill(HIST("hMassLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hBdtScorePrompt"), bdtScorePrompt); + registry.fill(HIST("hBdtScoreBkg"), bdtScoreBkg); + } + for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptLc = pairEntry.ptLc(); - double ptHadron = pairEntry.ptHadron(); + float deltaPhi = pairEntry.deltaPhi(); + float deltaEta = pairEntry.deltaEta(); + float ptLc = pairEntry.ptLc(); + float ptHadron = pairEntry.ptHadron(); + float bdtScorePrompt = pairEntry.mlScorePrompt(); + float bdtScoreBkg = pairEntry.mlScoreBkg(); + float trackDcaXY = pairEntry.trackDcaXY(); + float trackDcaZ = pairEntry.trackDcaZ(); + int trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); + int poolBin = pairEntry.poolBin(); double massLc = pairEntry.mLc(); - int effBinLc = o2::analysis::findBin(binsPtEfficiency, ptLc); + int effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); - int poolBin = pairEntry.poolBin(); bool isAutoCorrelated = pairEntry.isAutoCorrelated(); - // reject entries outside Pt ranges of interest - if (ptBinLc < 0 || effBinLc < 0) { + + // reject entries outside pT ranges of interest + if (ptLc < binsPtEfficiencyLc->front() || ptLc > binsPtEfficiencyLc->back()) { continue; } - if (ptHadron > 10.0) { - ptHadron = 10.5; + + if (bdtScorePrompt < mlOutputPrompt->at(effBinLc) || bdtScoreBkg > mlOutputBkg->at(effBinLc)) { + continue; + } + if (trackDcaXY > dcaXYTrackMax || trackDcaZ > dcaZTrackMax || trackTpcCrossedRows < nTpcCrossedRaws) { + continue; } double efficiencyWeight = 1.; - double efficiencyHadron = 1.; // Note: To be implemented later on if (applyEfficiency) { - efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHadron); + efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, ptHadron))); + if (loadAccXEffFromCCDB) { + efficiencyWeight = 1. / (mEfficiencyPrompt->GetBinContent(mEfficiencyPrompt->FindBin(ptLc)) * mEfficiencyAssociated->GetBinContent(mEfficiencyAssociated->FindBin(ptHadron))); + } } // Divide into three regions: toward, transverse, and away @@ -221,10 +389,21 @@ struct HfTaskCorrelationLcHadrons { registry.fill(HIST("hDeltaEtaPtIntSignalRegion"), deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaPhiPtIntSignalRegion"), deltaPhi, efficiencyWeight); } - - if ((massLc > sidebandLeftOuter->at(ptBinLc) && massLc < sidebandLeftInner->at(ptBinLc)) || - (massLc > sidebandRightInner->at(ptBinLc) && massLc < sidebandRightOuter->at(ptBinLc))) { - // in sideband region + // in sideband left region + if (massLc > sidebandLeftOuter->at(ptBinLc) && massLc < sidebandLeftInner->at(ptBinLc)) { + registry.fill(HIST("hCorrel2DVsPtSidebandLeft"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebandLeft"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebandLeft"), deltaPhi, efficiencyWeight); + registry.fill(HIST("hCorrel2DVsPtSidebands"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSidebands"), deltaPhi, deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebands"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebands"), deltaPhi, efficiencyWeight); + } + // in sideband right region + if (massLc > sidebandRightInner->at(ptBinLc) && massLc < sidebandRightOuter->at(ptBinLc)) { + registry.fill(HIST("hCorrel2DVsPtSidebandRight"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebandRight"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebandRight"), deltaPhi, efficiencyWeight); registry.fill(HIST("hCorrel2DVsPtSidebands"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); registry.fill(HIST("hCorrel2DPtIntSidebands"), deltaPhi, deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaEtaPtIntSidebands"), deltaEta, efficiencyWeight); @@ -235,29 +414,92 @@ struct HfTaskCorrelationLcHadrons { PROCESS_SWITCH(HfTaskCorrelationLcHadrons, processData, "Process data", true); /// Lc-Hadron correlation pair filling task, from pair tables - for Mc reco-level analysis (candidates matched to true signal only, but also bkg sources are studied) - void processMcRec(LcHadronPairFull const& pairEntries) + void processMcRec(LcHadronPairFullWithMl const& pairEntries, + soa::Join const& candidates) { + for (const auto& candidate : candidates) { + float massLc = candidate.mLc(); + float ptLc = candidate.ptLc(); + float bdtScorePrompt = candidate.mlScorePrompt(); + float bdtScoreBkg = candidate.mlScoreBkg(); + int effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); + bool isLcPrompt = candidate.isPrompt(); + + // reject entries outside pT ranges of interest + if (ptLc < binsPtEfficiencyLc->front() || ptLc > binsPtEfficiencyLc->back()) + continue; + + if (bdtScorePrompt < mlOutputPrompt->at(effBinLc) || bdtScoreBkg > mlOutputBkg->at(effBinLc)) { + continue; + } + double efficiencyWeightLc = 1.; + if (applyEfficiency) { + if (isLcPrompt) { + efficiencyWeightLc = 1. / efficiencyLc->at(effBinLc); + if (loadAccXEffFromCCDB) { + efficiencyWeightLc = 1. / mEfficiencyPrompt->GetBinContent(mEfficiencyPrompt->FindBin(ptLc)); + } + registry.fill(HIST("hMassLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hMassPromptLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hBdtScorePrompt"), bdtScorePrompt); + registry.fill(HIST("hBdtScoreBkg"), bdtScoreBkg); + } else { + efficiencyWeightLc = 1. / efficiencyFdLc->at(effBinLc); + if (loadAccXEffFromCCDB) { + efficiencyWeightLc = 1. / mEfficiencyFD->GetBinContent(mEfficiencyFD->FindBin(ptLc)); + } + registry.fill(HIST("hMassLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hMassNonPromptLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hBdtScorePrompt"), bdtScorePrompt); + registry.fill(HIST("hBdtScoreBkg"), bdtScoreBkg); + } + } + } + for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptLc = pairEntry.ptLc(); - double ptHadron = pairEntry.ptHadron(); - double massLc = pairEntry.mLc(); - double efficiencyWeight = 1.; - double efficiencyHadron = 1.; - int effBinLc = o2::analysis::findBin(binsPtEfficiency, ptLc); - int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); + float deltaPhi = pairEntry.deltaPhi(); + float deltaEta = pairEntry.deltaEta(); + float ptLc = pairEntry.ptLc(); + float ptHadron = pairEntry.ptHadron(); + float massLc = pairEntry.mLc(); + float bdtScorePrompt = pairEntry.mlScorePrompt(); + float bdtScoreBkg = pairEntry.mlScoreBkg(); + bool isPhysicalPrimary = pairEntry.isPhysicalPrimary(); + float trackDcaXY = pairEntry.trackDcaXY(); + float trackDcaZ = pairEntry.trackDcaZ(); + int trackTpcCrossedRows = pairEntry.trackTPCNClsCrossedRows(); + int statusLcPrompt = static_cast(pairEntry.isPrompt()); + int statusPromptHadron = pairEntry.trackOrigin(); int poolBin = pairEntry.poolBin(); + int effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); + int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); bool isAutoCorrelated = pairEntry.isAutoCorrelated(); - if (ptBinLc < 0 || effBinLc < 0) { + + // reject entries outside pT ranges of interest + if (ptLc < binsPtEfficiencyLc->front() || ptLc > binsPtEfficiencyLc->back()) + continue; + + if (bdtScorePrompt < mlOutputPrompt->at(effBinLc) || bdtScoreBkg > mlOutputBkg->at(effBinLc)) { continue; } - if (ptHadron > 10.0) { - ptHadron = 10.5; + if (trackDcaXY > dcaXYTrackMax || trackDcaZ > dcaZTrackMax || trackTpcCrossedRows < nTpcCrossedRaws) { + continue; } + double efficiencyWeight = 1.; + if (applyEfficiency) { - efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHadron); + if (statusLcPrompt) { + efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, ptHadron))); + if (loadAccXEffFromCCDB) { + efficiencyWeight = 1. / (mEfficiencyPrompt->GetBinContent(mEfficiencyPrompt->FindBin(ptLc)) * mEfficiencyAssociated->GetBinContent(mEfficiencyAssociated->FindBin(ptHadron))); + } + } else { + efficiencyWeight = 1. / (efficiencyFdLc->at(effBinLc) * efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, ptHadron))); + if (loadAccXEffFromCCDB) { + efficiencyWeight = 1. / (mEfficiencyFD->GetBinContent(mEfficiencyFD->FindBin(ptLc)) * mEfficiencyAssociated->GetBinContent(mEfficiencyAssociated->FindBin(ptHadron))); + } + } } // Divide into three regions: toward, transverse, and away @@ -292,15 +534,34 @@ struct HfTaskCorrelationLcHadrons { // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots if (massLc > signalRegionInner->at(ptBinLc) && massLc < signalRegionOuter->at(ptBinLc)) { // in signal region - registry.fill(HIST("hCorrel2DVsPtSignalRegionMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + registry.fill(HIST("hCorrel2DVsPtSignalRegionMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, statusLcPrompt, poolBin, efficiencyWeight); registry.fill(HIST("hCorrel2DPtIntSignalRegionMcRec"), deltaPhi, deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaEtaPtIntSignalRegionMcRec"), deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaPhiPtIntSignalRegionMcRec"), deltaPhi, efficiencyWeight); + if (isPhysicalPrimary) { + registry.fill(HIST("hCorrel2DVsPtPhysicalPrimaryMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, statusLcPrompt, poolBin, efficiencyWeight); + if (statusLcPrompt == 1 && statusPromptHadron == 1) { + registry.fill(HIST("hCorrel2DVsPtSignalRegionPromptLcPromptHadronMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } else if (statusLcPrompt == 0 && statusPromptHadron == 2) { + registry.fill(HIST("hCorrel2DVsPtSignalRegionNonPromptLcNonPromptHadronMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } + } } - - if (((massLc > sidebandLeftOuter->at(ptBinLc)) && (massLc < sidebandLeftInner->at(ptBinLc))) || - ((massLc > sidebandRightInner->at(ptBinLc) && massLc < sidebandRightOuter->at(ptBinLc)))) { - // in sideband region + // in sideband left region + if (massLc > sidebandLeftOuter->at(ptBinLc) && massLc < sidebandLeftInner->at(ptBinLc)) { + registry.fill(HIST("hCorrel2DVsPtSidebandLeftMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebandLeftMcRec"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebandLeftMcRec"), deltaPhi, efficiencyWeight); + registry.fill(HIST("hCorrel2DVsPtSidebandsMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSidebandsMcRec"), deltaPhi, deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebandsMcRec"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebandsMcRec"), deltaPhi, efficiencyWeight); + } + // in sideband right region + if (massLc > sidebandRightInner->at(ptBinLc) && massLc < sidebandRightOuter->at(ptBinLc)) { + registry.fill(HIST("hCorrel2DVsPtSidebandRightMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebandRightMcRec"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebandRightMcRec"), deltaPhi, efficiencyWeight); registry.fill(HIST("hCorrel2DVsPtSidebandsMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); registry.fill(HIST("hCorrel2DPtIntSidebandsMcRec"), deltaPhi, deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaEtaPtIntSidebandsMcRec"), deltaEta, efficiencyWeight); @@ -311,23 +572,18 @@ struct HfTaskCorrelationLcHadrons { PROCESS_SWITCH(HfTaskCorrelationLcHadrons, processMcRec, "Process Mc Reco mode", false); /// Lc-Hadron correlation pair filling task, from pair tables - for Mc gen-level analysis (no filter/selection, only true signal) - void processMcGen(aod::LcHadronPair const& pairEntries) + void processMcGen(LcHadronPair const& pairEntries) { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptLc = pairEntry.ptLc(); - double ptHadron = pairEntry.ptHadron(); + float deltaPhi = pairEntry.deltaPhi(); + float deltaEta = pairEntry.deltaEta(); + float ptLc = pairEntry.ptLc(); + float ptHadron = pairEntry.ptHadron(); int poolBin = pairEntry.poolBin(); + int statusPromptHadron = pairEntry.trackOrigin(); + bool isLcPrompt = pairEntry.isPrompt(); bool isAutoCorrelated = pairEntry.isAutoCorrelated(); - // reject entries outside Pt ranges of interest - if (o2::analysis::findBin(binsPtCorrelations, ptLc) < 0) { - continue; - } - if (ptHadron > 10.0) { - ptHadron = 10.5; - } if (isTowardTransverseAway) { // Divide into three regions: toward, transverse, and away @@ -353,9 +609,104 @@ struct HfTaskCorrelationLcHadrons { registry.fill(HIST("hCorrel2DPtIntMcGen"), deltaPhi, deltaEta); registry.fill(HIST("hDeltaEtaPtIntMcGen"), deltaEta); registry.fill(HIST("hDeltaPhiPtIntMcGen"), deltaPhi); + if (isLcPrompt) { + registry.fill(HIST("hCorrel2DVsPtMcGenPrompt"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + if (statusPromptHadron == 1) { + registry.fill(HIST("hCorrel2DVsPtMcGenPromptLcPromptHadron"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + } + } else { + registry.fill(HIST("hCorrel2DVsPtMcGenNonPrompt"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + if (statusPromptHadron == 2) { + registry.fill(HIST("hCorrel2DVsPtMcGenNonPromptLcNonPromptHadron"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + } + } } // end loop } PROCESS_SWITCH(HfTaskCorrelationLcHadrons, processMcGen, "Process Mc Gen mode", false); + + /// Lc-Hadron correlation - reconstruction and selection efficiency + void processMcCandEfficiency(soa::Join const&, + soa::Join const&, + CandLcMcGen const& mcParticles, + CandLcMcReco const& candidates, + aod::TracksWMc const&) + { + auto hCandidates = registry.get(HIST("hCandidates")); + + /// Gen loop + float multiplicity = -1.; + for (const auto& mcParticle : mcParticles) { + // generated candidates + if (std::abs(mcParticle.pdgCode()) == Pdg::kLambdaCPlus) { + auto mcCollision = mcParticle.template mcCollision_as>(); + multiplicity = mcCollision.multMCFT0A() + mcCollision.multMCFT0C(); // multFT0M = multFt0A + multFT0C + hCandidates->Fill(kCandidateStepMcGenAll, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); + if (std::abs(mcParticle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + hCandidates->Fill(kCandidateStepMcGenLcToPKPi, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); + auto yL = RecoDecay::y(mcParticle.pVector(), o2::constants::physics::MassLambdaCPlus); + if (std::abs(yL) <= yCandGenMax) { + hCandidates->Fill(kCandidateStepMcCandInAcceptance, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); + if (mcParticle.originMcGen() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("Efficiency/hPtCandMcGenPrompt"), mcParticle.pt()); + } + if (mcParticle.originMcGen() == RecoDecay::OriginType::NonPrompt) { + registry.fill(HIST("Efficiency/hPtCandMcGenNonPrompt"), mcParticle.pt()); + } + } + bool isDaughterInAcceptance = true; + auto daughters = mcParticle.template daughters_as(); + for (const auto& daughter : daughters) { + if (daughter.pt() < ptDaughterMin || std::abs(daughter.eta()) > etaTrackMax) { + isDaughterInAcceptance = false; + } + } + if (isDaughterInAcceptance) { + hCandidates->Fill(kCandidateStepMcDaughtersInAcceptance, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); + registry.fill(HIST("Efficiency/hPtCandMcGenDaughterInAcc"), mcParticle.pt()); + } + } + } + } + + // recontructed candidates loop + for (const auto& candidate : candidates) { + if (candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { + continue; + } + std::vector outputMl = {-1., -1., -1.}; + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMl[iclass] = candidate.mlProbLcToPKPi()[classMl->at(iclass)]; + } + } + if (candidate.isSelLcToPiKP() >= selectionFlagLc) { + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMl[iclass] = candidate.mlProbLcToPiKP()[classMl->at(iclass)]; + } + } + if (outputMl[0] > mlOutputBkg->at(o2::analysis::findBin(binsPtEfficiencyLc, candidate.pt())) || outputMl[1] < mlOutputPrompt->at(o2::analysis::findBin(binsPtEfficiencyLc, candidate.pt()))) { + continue; + } + auto collision = candidate.template collision_as>(); + if (selNoSameBunchPileUpColl && !(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup))) { + continue; + } + multiplicity = collision.multFT0M(); + if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + hCandidates->Fill(kCandidateStepMcReco, candidate.pt(), multiplicity, candidate.originMcRec()); + if (std::abs(hfHelper.yLc(candidate)) <= yCandMax) { + hCandidates->Fill(kCandidateStepMcRecoInAcceptance, candidate.pt(), multiplicity, candidate.originMcRec()); + if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("Efficiency/hPtCandMcRecPrompt"), candidate.pt()); + } + if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { + registry.fill(HIST("Efficiency/hPtCandMcRecNonPrompt"), candidate.pt()); + } + } + } + } + } + PROCESS_SWITCH(HfTaskCorrelationLcHadrons, processMcCandEfficiency, "Process MC for calculating candidate reconstruction efficiency", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 63c08396ea0c0f14bb30cff82e4811e6d511197c Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:39:44 +0100 Subject: [PATCH 137/459] [PWGCF] FemtoUniverse: Adding configurable for TPC occupancy (#8689) --- .../femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx index deb2e4b8d80..735afc9bee8 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx @@ -133,9 +133,12 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { /// Event part Configurable ConfV0MLow{"ConfV0MLow", 0.0, "Lower limit for V0M multiplicity"}; Configurable ConfV0MHigh{"ConfV0MHigh", 25000.0, "Upper limit for V0M multiplicity"}; + Configurable ConfTPCOccupancyLow{"ConfTPCOccupancyLow", 0.0, "Lower limit for TPC occupancy"}; + Configurable ConfTPCOccupancyHigh{"ConfTPCOccupancyHigh", 500.0, "Higher limit for TPC occupancy"}; - Filter collV0Mfilter = ((o2::aod::femtouniversecollision::multV0M > ConfV0MLow) && (o2::aod::femtouniversecollision::multV0M < ConfV0MHigh)); - using FilteredFDCollisions = soa::Filtered; + Filter collfilter = (o2::aod::femtouniversecollision::multV0M > ConfV0MLow) && (o2::aod::femtouniversecollision::multV0M < ConfV0MHigh) && + (o2::aod::femtouniversecollision::occupancy > ConfTPCOccupancyLow) && (o2::aod::femtouniversecollision::occupancy < ConfTPCOccupancyHigh); + using FilteredFDCollisions = soa::Filtered>; using FilteredFDCollision = soa::Filtered::iterator; /// Particle part From b179d66d08f4aa5cf95bb5757d8cb11beb298d22 Mon Sep 17 00:00:00 2001 From: Artem Kotliarov <71133985+KotliarovAr@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:40:31 +0100 Subject: [PATCH 138/459] [PWGJE] Add histogram with q/pT vs phi for tracks (#8687) --- PWGJE/Tasks/ChJetTriggerQATask.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGJE/Tasks/ChJetTriggerQATask.cxx b/PWGJE/Tasks/ChJetTriggerQATask.cxx index 19e4df451ff..7b8331706bc 100644 --- a/PWGJE/Tasks/ChJetTriggerQATask.cxx +++ b/PWGJE/Tasks/ChJetTriggerQATask.cxx @@ -89,6 +89,9 @@ struct ChJetTriggerQATask { ConfigurableAxis dcaXY_Binning{"dcaXY_Binning", {100, -5., 5.}, ""}; ConfigurableAxis dcaZ_Binning{"dcaZ_Binning", {100, -3., 3.}, ""}; + ConfigurableAxis xPhiAxis{"xPhiAxis", {180, 0., TMath::TwoPi()}, ""}; + ConfigurableAxis yQ1pTAxis{"yQ1pTAxis", {200, -0.5, 0.5}, ""}; + float fiducialVolume; // 0.9 - jetR HistogramRegistry spectra; @@ -128,6 +131,7 @@ struct ChJetTriggerQATask { spectra.add("nITSClusters_TrackPt", "Number of ITS hits vs phi & pT of tracks", kTH3F, {{7, 1., 8.}, {60, 0., TMath::TwoPi()}, {100, 0., 100.}}); spectra.add("ptphiQualityTracks", "pT vs phi of quality tracks", {HistType::kTH2F, {{100, 0., 100.}, {60, 0, TMath::TwoPi()}}}); spectra.add("ptphiAllTracks", "pT vs phi of all tracks", {HistType::kTH2F, {{100, 0., +100.}, {60, 0, TMath::TwoPi()}}}); + spectra.add("phi_Q1pT", "Track phi vs. q/pT", kTH2F, {xPhiAxis, yQ1pTAxis}); // Supplementary plots if (bAddSupplementHistosToOutput) { @@ -206,6 +210,7 @@ struct ChJetTriggerQATask { continue; } + spectra.fill(HIST("phi_Q1pT"), originalTrack.phi(), originalTrack.sign() / originalTrack.pt()); spectra.fill(HIST("ptphiQualityTracks"), track.pt(), track.phi()); bool bDcaCondition = (fabs(track.dcaZ()) < dcaZ_cut) && (fabs(track.dcaXY()) < dcaXY_multFact * DcaXYPtCut(track.pt())); From 06918bc0e121655869ea2d7a72c21d406cd0d136 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:12:57 +0100 Subject: [PATCH 139/459] [PWGJE] [PWGJE]Add cell time smearing in MC (#8697) --- PWGJE/TableProducer/emcalCorrectionTask.cxx | 58 +++++++++++---------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index 645a3517842..d9a46f59b3c 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include "CCDB/BasicCCDBManager.h" #include "Framework/runDataProcessing.h" @@ -90,7 +91,7 @@ struct EmcalCorrectionTask { Configurable exoticCellInCrossMinAmplitude{"exoticCellInCrossMinAmplitude", 0.1, "Minimum energy of cells in cross, if lower not considered in cross"}; Configurable useWeightExotic{"useWeightExotic", false, "States if weights should be used for exotic cell cut"}; Configurable isMC{"isMC", false, "States if run over MC"}; - Configurable applyCellTimeShift{"applyCellTimeShift", 0, "apply shift to the cell time for data and MC; For data: 0 = off; non-zero = log function extracted from data - For MC: 0 = off; 1 = const shift; 2 = eta-dependent shift"}; + Configurable applyCellTimeCorrection{"applyCellTimeCorrection", true, "apply a correction to the cell time for data and MC: Shift both average cell times to 0 and smear MC time distribution to fit data better"}; // Require EMCAL cells (CALO type 1) Filter emccellfilter = aod::calo::caloType == selectedCellType; @@ -112,6 +113,11 @@ struct EmcalCorrectionTask { // QA o2::framework::HistogramRegistry mHistManager{"EMCALCorrectionTaskQAHistograms"}; + // Random number generator to draw cell time smearing for MC + std::random_device rd{}; + std::mt19937_64 rdgen{rd()}; + std::normal_distribution<> normalgaus{0, 1}; // mean = 0, stddev = 1 (apply amplitude of smearing after drawing random for performance reasons) + // EMCal geometry o2::emcal::Geometry* geometry; @@ -189,8 +195,9 @@ struct EmcalCorrectionTask { mHistManager.add("hCellE", "hCellE", o2HistType::kTH1F, {energyAxis}); mHistManager.add("hCellTowerID", "hCellTowerID", o2HistType::kTH1D, {{20000, 0, 20000}}); mHistManager.add("hCellEtaPhi", "hCellEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); + mHistManager.add("hCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, {200, 0., 20.}}); // NOTE: Reversed column and row because it's more natural for presentation. - mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", o2HistType::kTH2D, {{97, 0, 97}, {600, 0, 600}}); + mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", o2HistType::kTH2D, {{96, -0.5, 95.5}, {208, -0.5, 207.5}}); mHistManager.add("hClusterE", "hClusterE", o2HistType::kTH1F, {energyAxis}); mHistManager.add("hClusterNLM", "hClusterNLM", o2HistType::kTH1F, {nlmAxis}); mHistManager.add("hClusterEtaPhi", "hClusterEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); @@ -770,6 +777,7 @@ struct EmcalCorrectionTask { // For convenience, use the clusterizer stored geometry to get the eta-phi for (auto& cell : cellsBC) { mHistManager.fill(HIST("hCellE"), cell.getEnergy()); + mHistManager.fill(HIST("hCellTimeEnergy"), cell.getTimeStamp(), cell.getEnergy()); mHistManager.fill(HIST("hCellTowerID"), cell.getTower()); auto res = mClusterizers.at(0)->getGeometry()->EtaPhiFromIndex(cell.getTower()); mHistManager.fill(HIST("hCellEtaPhi"), std::get<0>(res), TVector2::Phi_0_2pi(std::get<1>(res))); @@ -801,33 +809,29 @@ struct EmcalCorrectionTask { // In data this is done to correct for the time walk effect float getCellTimeShift(const int16_t cellID, const float cellEnergy) { + if (!applyCellTimeCorrection) { + return 0.f; + } + float timeshift = 0.f; + float timesmear = 0.f; if (isMC) { - if (applyCellTimeShift == 1) { // constant shift - LOG(debug) << "shift the cell time by 15ns"; - return -15.f; // roughly calculated by assuming particles travel with v=c (photons) and EMCal is 4.4m away from vertex - } else if (applyCellTimeShift == 2) { // eta dependent shift ( as larger eta values are further away from collision point) - // Use distance between vertex and EMCal (at eta = 0) and distance on EMCal surface (cell size times column) to calculate distance to cell - // 0.2 is cell size in m (0.06) divided by the speed of light in m/ns (0.3) - // 47.5 is the "middle" of the EMCal (2*48 cells in one column) - float timeCol = 0.2f * (geometry->GlobalCol(cellID) - 47.5f); // calculate time to get to specific column - float time = -sqrt(215.f + timeCol * timeCol); // 215 is 14.67ns^2 (time it takes to get the cell at eta = 0) - LOG(debug) << "shift the cell time by " << time << " applyCellTimeShift " << applyCellTimeShift; - return time; - } else { - return 0.f; - } - } else { // data - if (applyCellTimeShift != 0) { - if (cellEnergy < 0.3) // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration - return 0.f; - else if (cellEnergy < 4.) // Low energy regime - return (0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods - else // High energy regime - return (-0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods - } else { // Dont apply cell time shift if applyCellTimeShift == 0 - return 0.f; - } + // Shift the time to 0, as the TOF was simulated -> eta dependent shift (as larger eta values are further away from collision point) + // Use distance between vertex and EMCal (at eta = 0) and distance on EMCal surface (cell size times column) to calculate distance to cell + // 0.2 is cell size in m (0.06) divided by the speed of light in m/ns (0.3) - 47.5 is the "middle" of the EMCal (2*48 cells in one column) + float timeCol = 0.2f * (geometry->GlobalCol(cellID) - 47.5f); // calculate time to get to specific column + timeshift = -sqrt(215.f + timeCol * timeCol); // 215 is 14.67ns^2 (time it takes to get the cell at eta = 0) + // Also smear the time to account for the broader time resolution in data than in MC + timesmear = normalgaus(rdgen) * (1.6 + 9.5 * TMath::Exp(-3. * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods + } else { // data + if (cellEnergy < 0.3) // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration + timeshift = 0.; + else if (cellEnergy < 4.) // Low energy regime + timeshift = 0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods + else // High energy regime + timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods } + LOG(debug) << "Shift the cell time by " << timeshift << " + " << timesmear << " ns"; + return timeshift + timesmear; } }; From 62650585577a00f545e0b388758c6722d635e71d Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Wed, 27 Nov 2024 20:00:39 +0100 Subject: [PATCH 140/459] [PWGLF] change lambda mass to anti-lambda mass (#8694) Co-authored-by: junleekim --- PWGLF/Tasks/Strangeness/lambdapolarization.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdapolarization.cxx b/PWGLF/Tasks/Strangeness/lambdapolarization.cxx index b2fe709e01e..f0d7e63f57f 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolarization.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolarization.cxx @@ -596,8 +596,8 @@ struct lambdapolarization { histos.fill(HIST("psi2/h_alambda_cos"), v0.mAntiLambda(), v0.pt(), angle, centrality, relphi, weight); histos.fill(HIST("psi2/h_alambda_cos2"), v0.mAntiLambda(), v0.pt(), angle * angle, centrality, relphi, weight); histos.fill(HIST("psi2/h_alambda_cossin"), v0.mAntiLambda(), v0.pt(), angle * TMath::Sin(relphi), centrality, weight); - histos.fill(HIST("psi2/h_alambda_vncos"), v0.mLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); - histos.fill(HIST("psi2/h_alambda_vnsin"), v0.mLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); + histos.fill(HIST("psi2/h_alambda_vncos"), v0.mAntiLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); + histos.fill(HIST("psi2/h_alambda_vnsin"), v0.mAntiLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); } } else if (nmode == 3) { if (LambdaTag) { @@ -611,8 +611,8 @@ struct lambdapolarization { histos.fill(HIST("psi3/h_alambda_cos"), v0.mAntiLambda(), v0.pt(), angle, centrality, relphi, weight); histos.fill(HIST("psi3/h_alambda_cos2"), v0.mAntiLambda(), v0.pt(), angle * angle, centrality, relphi, weight); histos.fill(HIST("psi3/h_alambda_cossin"), v0.mAntiLambda(), v0.pt(), angle * TMath::Sin(relphi), centrality, weight); - histos.fill(HIST("psi3/h_alambda_vncos"), v0.mLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); - histos.fill(HIST("psi3/h_alambda_vnsin"), v0.mLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); + histos.fill(HIST("psi3/h_alambda_vncos"), v0.mAntiLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); + histos.fill(HIST("psi3/h_alambda_vnsin"), v0.mAntiLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); } } else if (nmode == 4) { if (LambdaTag) { @@ -626,8 +626,8 @@ struct lambdapolarization { histos.fill(HIST("psi4/h_alambda_cos"), v0.mAntiLambda(), v0.pt(), angle, centrality, relphi, weight); histos.fill(HIST("psi4/h_alambda_cos2"), v0.mAntiLambda(), v0.pt(), angle * angle, centrality, relphi, weight); histos.fill(HIST("psi4/h_alambda_cossin"), v0.mAntiLambda(), v0.pt(), angle * TMath::Sin(relphi), centrality, weight); - histos.fill(HIST("psi4/h_alambda_vncos"), v0.mLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); - histos.fill(HIST("psi4/h_alambda_vnsin"), v0.mLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); + histos.fill(HIST("psi4/h_alambda_vncos"), v0.mAntiLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); + histos.fill(HIST("psi4/h_alambda_vnsin"), v0.mAntiLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); } } ////////// FIXME: not possible to get histograms using nmode } From 9fc60a644455c2c9969aed73be7b9f6510cc5509 Mon Sep 17 00:00:00 2001 From: Rafael Manhart <56776511+RafRaf11@users.noreply.github.com> Date: Wed, 27 Nov 2024 20:22:24 +0100 Subject: [PATCH 141/459] [PWGLF] Update NucleiHistTask.cxx (#8691) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/NucleiHistTask.cxx | 119 ++++++++++++++++++++------ 1 file changed, 95 insertions(+), 24 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx b/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx index 8b741eca28a..70b7b2522de 100644 --- a/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx +++ b/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx @@ -39,6 +39,8 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +std::vector ptBinning = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 2.0, 2.2, 2.4, 2.8, 3.2, 3.6, 4., 5., 6., 8., 10., 12., 14.}; + struct NucleiHistTask { // Data @@ -473,6 +475,26 @@ struct NucleiHistTask { Configurable requireGoldenChi2{"requireGoldenChi2", false, "Enable the requirement of GoldenChi2"}; Configurable event_selection_sel8{"event_selection_sel8", true, "Enable sel8 event selection"}; Configurable event_selection_MC_sel8{"event_selection_MC_sel8", true, "Enable sel8 event selection in MC processing"}; + Configurable> Tpc_mSigma_shift_Pi{"Tpc_mSigma_shift_Pi", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting pi^{+} & pi^{-} nSigma values in TPC"}; + Configurable> Tpc_mSigma_shift_Pr{"Tpc_mSigma_shift_Pr", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting (anti)proton nSigma values in TPC"}; + Configurable> Tpc_mSigma_shift_De{"Tpc_mSigma_shift_De", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting (anti)deuteron nSigma values in TPC"}; + Configurable> Tpc_mSigma_shift_Tr{"Tpc_mSigma_shift_Tr", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting (anti)triton nSigma values in TPC"}; + Configurable> Tpc_mSigma_shift_He3{"Tpc_mSigma_shift_He3", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting (anti)helium-3 nSigma values in TPC"}; + Configurable> Tpc_mSigma_shift_Al{"Tpc_mSigma_shift_Al", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting (anti)helium-4 nSigma values in TPC"}; + + // *************************************************************************** + + int getBinIndex(const std::vector& ptBinning, float momentum) + { + for (size_t i = 0; i < ptBinning.size() - 1; ++i) { + if (momentum >= ptBinning[i] && momentum < ptBinning[i + 1]) { + return i; + } + } + return -1; + } + + // *************************************************************************** template void fillHistograms(const CollisionType& event, const TracksType& tracks) @@ -630,6 +652,20 @@ struct NucleiHistTask { spectra_reg.fill(HIST("histTpcSignalData"), momentum * track.sign(), track.tpcSignal()); + int binIndex = getBinIndex(ptBinning, momentum); + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Pi.value.size())) + nSigmaPion += Tpc_mSigma_shift_Pi.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Pr.value.size())) + nSigmaProton += Tpc_mSigma_shift_Pr.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_De.value.size())) + nSigmaDeut += Tpc_mSigma_shift_De.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Tr.value.size())) + nSigmaTriton += Tpc_mSigma_shift_Tr.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_He3.value.size())) + nSigmaHe3 += Tpc_mSigma_shift_He3.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Al.value.size())) + nSigmaHe4 += Tpc_mSigma_shift_Al.value[binIndex]; + if (track.sign() > 0) { pion_reg.fill(HIST("histTpcNsigmaData"), momentum, nSigmaPion); proton_reg.fill(HIST("histTpcNsigmaData"), momentum, nSigmaProton); @@ -1231,6 +1267,13 @@ struct NucleiHistTask { if (requireGoldenChi2 && !(track.passedGoldenChi2())) continue; + float nSigmaPion = track.tpcNSigmaPi(); + float nSigmaProton = track.tpcNSigmaPr(); + float nSigmaDeut = track.tpcNSigmaDe(); + float nSigmaTriton = track.tpcNSigmaTr(); + float nSigmaHe3 = track.tpcNSigmaHe(); + float nSigmaHe4 = track.tpcNSigmaAl(); + TLorentzVector lorentzVector_pion{}; TLorentzVector lorentzVector_proton{}; TLorentzVector lorentzVector_deuteron{}; @@ -1253,22 +1296,36 @@ struct NucleiHistTask { lorentzVector_He4.Rapidity() < yMin || lorentzVector_He4.Rapidity() > yMax) continue; + int binIndex = getBinIndex(ptBinning, momentum); + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Pi.value.size())) + nSigmaPion += Tpc_mSigma_shift_Pi.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Pr.value.size())) + nSigmaProton += Tpc_mSigma_shift_Pr.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_De.value.size())) + nSigmaDeut += Tpc_mSigma_shift_De.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Tr.value.size())) + nSigmaTriton += Tpc_mSigma_shift_Tr.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_He3.value.size())) + nSigmaHe3 += Tpc_mSigma_shift_He3.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Al.value.size())) + nSigmaHe4 += Tpc_mSigma_shift_Al.value[binIndex]; + if (track.sign() > 0) { - pion_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, track.tpcNSigmaPi(), event.centFT0C()); - proton_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, track.tpcNSigmaPr(), event.centFT0C()); - deuteron_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, track.tpcNSigmaDe(), event.centFT0C()); - triton_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, track.tpcNSigmaTr(), event.centFT0C()); - Helium3_reg.fill(HIST("histTpcNsigmaData_cent"), momentum * 2.0, track.tpcNSigmaHe(), event.centFT0C()); - Helium4_reg.fill(HIST("histTpcNsigmaData_cent"), momentum * 2.0, track.tpcNSigmaAl(), event.centFT0C()); + pion_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, nSigmaPion, event.centFT0C()); + proton_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, nSigmaProton, event.centFT0C()); + deuteron_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, nSigmaDeut, event.centFT0C()); + triton_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, nSigmaTriton, event.centFT0C()); + Helium3_reg.fill(HIST("histTpcNsigmaData_cent"), momentum * 2.0, nSigmaHe3, event.centFT0C()); + Helium4_reg.fill(HIST("histTpcNsigmaData_cent"), momentum * 2.0, nSigmaHe4, event.centFT0C()); if ((event.centFT0C() > minCentrality) && (event.centFT0C() < maxCentrality)) { - pion_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, track.tpcNSigmaPi(), track.eta()); - proton_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, track.tpcNSigmaPr(), track.eta()); - deuteron_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, track.tpcNSigmaDe(), track.eta()); - triton_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, track.tpcNSigmaTr(), track.eta()); - Helium3_reg.fill(HIST("histTpcNsigmaData_eta"), momentum * 2.0, track.tpcNSigmaHe(), track.eta()); - Helium4_reg.fill(HIST("histTpcNsigmaData_eta"), momentum * 2.0, track.tpcNSigmaAl(), track.eta()); + pion_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, nSigmaPion, track.eta()); + proton_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, nSigmaProton, track.eta()); + deuteron_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, nSigmaDeut, track.eta()); + triton_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, nSigmaTriton, track.eta()); + Helium3_reg.fill(HIST("histTpcNsigmaData_eta"), momentum * 2.0, nSigmaHe3, track.eta()); + Helium4_reg.fill(HIST("histTpcNsigmaData_eta"), momentum * 2.0, nSigmaHe4, track.eta()); } if (track.hasTOF()) { @@ -1316,20 +1373,20 @@ struct NucleiHistTask { if (track.sign() < 0) { - apion_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, track.tpcNSigmaPi(), event.centFT0C()); - aproton_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, track.tpcNSigmaPr(), event.centFT0C()); - adeuteron_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, track.tpcNSigmaDe(), event.centFT0C()); - atriton_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, track.tpcNSigmaTr(), event.centFT0C()); - aHelium3_reg.fill(HIST("histTpcNsigmaData_cent"), momentum * 2.0, track.tpcNSigmaHe(), event.centFT0C()); - aHelium4_reg.fill(HIST("histTpcNsigmaData_cent"), momentum * 2.0, track.tpcNSigmaAl(), event.centFT0C()); + apion_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, nSigmaPion, event.centFT0C()); + aproton_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, nSigmaProton, event.centFT0C()); + adeuteron_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, nSigmaDeut, event.centFT0C()); + atriton_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, nSigmaTriton, event.centFT0C()); + aHelium3_reg.fill(HIST("histTpcNsigmaData_cent"), momentum * 2.0, nSigmaHe3, event.centFT0C()); + aHelium4_reg.fill(HIST("histTpcNsigmaData_cent"), momentum * 2.0, nSigmaHe4, event.centFT0C()); if ((event.centFT0C() > minCentrality) && (event.centFT0C() < maxCentrality)) { - apion_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, track.tpcNSigmaPi(), track.eta()); - aproton_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, track.tpcNSigmaPr(), track.eta()); - adeuteron_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, track.tpcNSigmaDe(), track.eta()); - atriton_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, track.tpcNSigmaTr(), track.eta()); - aHelium3_reg.fill(HIST("histTpcNsigmaData_eta"), momentum * 2.0, track.tpcNSigmaHe(), track.eta()); - aHelium4_reg.fill(HIST("histTpcNsigmaData_eta"), momentum * 2.0, track.tpcNSigmaAl(), track.eta()); + apion_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, nSigmaPion, track.eta()); + aproton_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, nSigmaProton, track.eta()); + adeuteron_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, nSigmaDeut, track.eta()); + atriton_reg.fill(HIST("histTpcNsigmaData_eta"), momentum, nSigmaTriton, track.eta()); + aHelium3_reg.fill(HIST("histTpcNsigmaData_eta"), momentum * 2.0, nSigmaHe3, track.eta()); + aHelium4_reg.fill(HIST("histTpcNsigmaData_eta"), momentum * 2.0, nSigmaHe4, track.eta()); } if (track.hasTOF()) { @@ -1658,6 +1715,20 @@ struct NucleiHistTask { float nSigmaHe3 = track.tpcNSigmaHe(); float nSigmaHe4 = track.tpcNSigmaAl(); + int binIndex = getBinIndex(ptBinning, momentum); + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Pi.value.size())) + nSigmaPion += Tpc_mSigma_shift_Pi.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Pr.value.size())) + nSigmaProton += Tpc_mSigma_shift_Pr.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_De.value.size())) + nSigmaDeuteron += Tpc_mSigma_shift_De.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Tr.value.size())) + nSigmaTriton += Tpc_mSigma_shift_Tr.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_He3.value.size())) + nSigmaHe3 += Tpc_mSigma_shift_He3.value[binIndex]; + if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Al.value.size())) + nSigmaHe4 += Tpc_mSigma_shift_Al.value[binIndex]; + if (track.sign() > 0) { MC_recon_reg.fill(HIST("histTpcNsigmaDataPi"), momentum, nSigmaPion); MC_recon_reg.fill(HIST("histTpcNsigmaDataPr"), momentum, nSigmaProton); From c18dc32f1839b477df64054a325a22618103ad9f Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:51:07 +0100 Subject: [PATCH 142/459] [PWGCF] FemtoUniverse: More configurables for event selection (#8701) --- ...iversePairTaskTrackTrackSpherHarMultKtExtended.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 9ada1b9b973..84d2c70e5ea 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -133,8 +133,15 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// Event part Configurable ConfV0MLow{"ConfV0MLow", 0.0, "Lower limit for V0M multiplicity"}; Configurable ConfV0MHigh{"ConfV0MHigh", 25000.0, "Upper limit for V0M multiplicity"}; - Filter collV0Mfilter = ((o2::aod::femtouniversecollision::multV0M > ConfV0MLow) && (o2::aod::femtouniversecollision::multV0M < ConfV0MHigh)); - using FilteredFDCollisions = soa::Filtered; + Configurable ConfTPCOccupancyLow{"ConfTPCOccupancyLow", 0.0, "Lower limit for TPC occupancy"}; + Configurable ConfTPCOccupancyHigh{"ConfTPCOccupancyHigh", 500.0, "Higher limit for TPC occupancy"}; + Configurable ConfIntRateLow{"ConfIntRateLow", 0.0, "Lower limit for interaction rate"}; + Configurable ConfIntRateHigh{"ConfIntRateHigh", 10000.0, "Higher limit for interaction rate"}; + + Filter collfilter = (o2::aod::femtouniversecollision::multV0M > ConfV0MLow) && (o2::aod::femtouniversecollision::multV0M < ConfV0MHigh) && + (o2::aod::femtouniversecollision::irrate > ConfIntRateLow) && (o2::aod::femtouniversecollision::irrate < ConfIntRateHigh) && + (o2::aod::femtouniversecollision::occupancy > ConfTPCOccupancyLow) && (o2::aod::femtouniversecollision::occupancy < ConfTPCOccupancyHigh); + using FilteredFDCollisions = soa::Filtered>; using FilteredFDCollision = soa::Filtered::iterator; // Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.ConfEtaMax); // example filtering on configurable From bae4d3fd78467c666eb26c43903acce8c27cbbed Mon Sep 17 00:00:00 2001 From: Preet-Bhanjan Date: Wed, 27 Nov 2024 22:20:16 +0100 Subject: [PATCH 143/459] [PWGCF] Generic Framework: PID v2 (#8651) Co-authored-by: Preet Pati Co-authored-by: ALICE Action Bot --- PWGCF/Flow/Tasks/FlowPbPbpikp.cxx | 696 +++++++++++------------------- 1 file changed, 258 insertions(+), 438 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowPbPbpikp.cxx b/PWGCF/Flow/Tasks/FlowPbPbpikp.cxx index 9ad0696091a..3692ad0375d 100644 --- a/PWGCF/Flow/Tasks/FlowPbPbpikp.cxx +++ b/PWGCF/Flow/Tasks/FlowPbPbpikp.cxx @@ -8,494 +8,314 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// -/// \brief this is a code for the elliptic flow of identified hadrons -/// \author prottay das, preet -/// \since 29/05/2024 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include +#include +#include +#include +#include +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/StepTHn.h" -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" +#include "Common/DataModel/EventSelection.h" #include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Multiplicity.h" #include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StepTHn.h" -#include "Framework/runDataProcessing.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" + +#include "PWGCF/GenericFramework/Core/GFWPowerArray.h" +#include "PWGCF/GenericFramework/Core/GFW.h" +#include "PWGCF/GenericFramework/Core/GFWCumulant.h" +#include "PWGCF/GenericFramework/Core/FlowContainer.h" + #include "ReconstructionDataFormats/Track.h" +#include "ReconstructionDataFormats/PID.h" + +#include +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; -struct v2ellip { +#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; - // Connect to ccdb +struct GfwPidflow { Service ccdb; Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; Configurable url{"ccdb-url", "http://ccdb-test.cern.ch:8080", "url of the ccdb repository"}; - SliceCache cache; - - // Histograms are defined with HistogramRegistry - HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - - // Confugrable for QA histograms - Configurable onlyTOF{"onlyTOF", false, "only TOF tracks"}; - Configurable onlyTOFHIT{"onlyTOFHIT", false, "accept only TOF hit tracks at high pt"}; - bool onlyTPC = true; - - // Configurables for track selections - Configurable cfgCutPT{"cfgCutPT", 0.2f, "PT cut on daughter track"}; - Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta cut on daughter track"}; - Configurable cfgCutDCAxy{"cfgCutDCAxy", 2.0f, "DCAxy range for tracks"}; - Configurable cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"}; - Configurable nsigmaCutTPCPi{"nsigmacutTPCPi", 3.0, "Value of the TPC Nsigma cut for pions"}; - Configurable nsigmaCutTPCKa{"nsigmacutTPCKa", 3.0, "Value of the TPC Nsigma cut for kaons"}; - Configurable nsigmaCutTPCPr{"nsigmacutTPCPr", 3.0, "Value of the TPC Nsigma cut for protons"}; - Configurable nsigmaCutTOFPi{"nsigmacutTOFPi", 3.0, "Value of the TOF Nsigma cut for pions"}; - Configurable nsigmaCutTOFKa{"nsigmacutTOFKa", 3.0, "Value of the TOF Nsigma cut for kaons"}; - Configurable nsigmaCutTOFPr{"nsigmacutTOFPr", 3.0, "Value of the TOF Nsigma cut for protons"}; - Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Value of the Combined Nsigma cut"}; - Configurable ismanualDCAcut{"ismanualDCAcut", true, "ismanualDCAcut"}; - Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; - Configurable cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"}; - - // Event selection configurables - Configurable timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"}; - Configurable TVXEvsel{"TVXEvsel", false, "Triggger selection"}; - Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; - - // Configurable for histograms - Configurable nBins{"nBins", 100, "N bins in all histos"}; - ConfigurableAxis binsMultPlot{"binsCent", {201, -0.5f, 200.5f}, "Binning of the centrality axis for plots"}; + O2_DEFINE_CONFIGURABLE(cfgCutVertex, float, 10.0f, "Accepted z-vertex range") + O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMin, float, 0.2f, "Minimal pT for poi tracks") + O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMax, float, 10.0f, "Maximal pT for poi tracks") + O2_DEFINE_CONFIGURABLE(cfgCutPtMin, float, 0.2f, "Minimal pT for ref tracks") + O2_DEFINE_CONFIGURABLE(cfgCutPtMax, float, 3.0f, "Maximal pT for ref tracks") + 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(cfgUseNch, bool, false, "Use Nch for flow observables") + O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 10, "Number of subsamples") + + ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for histograms"}; + ConfigurableAxis axisPhi{"axisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"}; + ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"}; + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.20, 1.40, 1.60, 1.80, 2.00, 2.20, 2.40, 2.60, 2.80, 3.00, 3.50, 4.00, 5.00, 6.00, 8.00, 10.00}, "pt axis for histograms"}; + ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; + 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"}; + + Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtPOIMin) && (aod::track::pt < cfgCutPtPOIMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); + + OutputObj fFC{FlowContainer("FlowContainer")}; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + GFW* fGFW = new GFW(); + std::vector corrconfigs; + TAxis* fPtAxis; + TRandom3* fRndm = new TRandom3(0); + + using aodCollisions = soa::Filtered>; + using aodTracks = soa::Filtered>; void init(InitContext const&) { - // Axes - AxisSpec vertexZAxis = {nBins, -15., 15., "vrtx_{Z} [cm] for plots"}; - AxisSpec axisv2ref = {10, 0, 10, "v2_{ref}"}; - AxisSpec axisv2diff = {14, 0, 14, "v2_{def}"}; - AxisSpec axisphi = {700, 0, 7, "#phi"}; - - // Histograms - // Event selection - rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); - rEventSelection.add("hmult", "Centrality distribution", kTH1F, {{binsMultPlot}}); - - // v2 tprofiles for reference and differential flow - histos.add("profv2ref", "profv2ref", kTProfile, {axisv2ref}); - histos.add("profv2diff_pr_10_20", "profv2diff_pr_10_20", kTProfile, {axisv2diff}); - histos.add("profv2diff_pi_10_20", "profv2diff_pi_10_20", kTProfile, {axisv2diff}); - histos.add("profv2diff_k_10_20", "profv2diff_k_10_20", kTProfile, {axisv2diff}); - - histos.add("profv2diff_pr_20_30", "profv2diff_pr_20_30", kTProfile, {axisv2diff}); - histos.add("profv2diff_pi_20_30", "profv2diff_pi_20_30", kTProfile, {axisv2diff}); - histos.add("profv2diff_k_20_30", "profv2diff_k_20_30", kTProfile, {axisv2diff}); - - histos.add("profv2diff_pr_30_40", "profv2diff_pr_30_40", kTProfile, {axisv2diff}); - histos.add("profv2diff_pi_30_40", "profv2diff_pi_30_40", kTProfile, {axisv2diff}); - histos.add("profv2diff_k_30_40", "profv2diff_k_30_40", kTProfile, {axisv2diff}); - - histos.add("profv2diff_pr_40_50", "profv2diff_pr_40_50", kTProfile, {axisv2diff}); - histos.add("profv2diff_pi_40_50", "profv2diff_pi_40_50", kTProfile, {axisv2diff}); - histos.add("profv2diff_k_40_50", "profv2diff_k_40_50", kTProfile, {axisv2diff}); - - // histogram for phi distribution - histos.add("hphi", "hphi", kTH1F, {axisphi}); + ccdb->setURL(url.value); + ccdb->setCaching(true); + ccdb->setCreatedNotAfter(nolaterthan.value); + + histos.add("hPhi", "", {HistType::kTH1D, {axisPhi}}); + histos.add("hEta", "", {HistType::kTH1D, {axisEta}}); + histos.add("hVtxZ", "", {HistType::kTH1D, {axisVertex}}); + histos.add("hMult", "", {HistType::kTH1D, {{3000, 0.5, 3000.5}}}); + histos.add("hCent", "", {HistType::kTH1D, {{90, 0, 90}}}); + histos.add("hPt", "", {HistType::kTH1D, {axisPt}}); + histos.add("c22_gap08", "", {HistType::kTProfile, {axisMultiplicity}}); + histos.add("c22_gap08_pi", "", {HistType::kTProfile, {axisMultiplicity}}); + histos.add("c22_gap08_ka", "", {HistType::kTProfile, {axisMultiplicity}}); + histos.add("c22_gap08_pr", "", {HistType::kTProfile, {axisMultiplicity}}); + histos.add("c24_full", "", {HistType::kTProfile, {axisMultiplicity}}); + histos.add("TofTpcNsigma", "", {HistType::kTHnSparseD, {{axisparticles, axisNsigmaTPC, axisNsigmaTOF}}}); + + o2::framework::AxisSpec axis = axisPt; + int nPtBins = axis.binEdges.size() - 1; + double* PtBins = &(axis.binEdges)[0]; + fPtAxis = new TAxis(nPtBins, PtBins); + + TObjArray* oba = new TObjArray(); + oba->Add(new TNamed("Ch08Gap22", "Ch08Gap22")); + for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + oba->Add(new TNamed(Form("Ch08Gap22_pt_%i", i + 1), "Ch08Gap22_pTDiff")); + oba->Add(new TNamed("Pi08Gap22", "Pi08Gap22")); + for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + oba->Add(new TNamed(Form("Pi08Gap22_pt_%i", i + 1), "Pi08Gap22_pTDiff")); + oba->Add(new TNamed("Ka08Gap22", "Ka08Gap22")); + for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + oba->Add(new TNamed(Form("Ka08Gap22_pt_%i", i + 1), "Ka08Gap22_pTDiff")); + oba->Add(new TNamed("Pr08Gap22", "Pr08Gap22")); + for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + oba->Add(new TNamed(Form("Pr08Gap22_pt_%i", i + 1), "Pr08Gap22_pTDiff")); + oba->Add(new TNamed("ChFull24", "ChFull24")); + for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + oba->Add(new TNamed(Form("ChFull24_pt_%i", i + 1), "ChFull24_pTDiff")); + + fFC->SetName("FlowContainer"); + fFC->SetXAxis(fPtAxis); + fFC->Initialize(oba, axisMultiplicity, cfgNbootstrap); + delete oba; + + fGFW->AddRegion("refN08", -0.8, -0.4, 1, 1); + fGFW->AddRegion("refP08", 0.4, 0.8, 1, 1); + fGFW->AddRegion("full", -0.8, 0.8, 1, 512); + + // charged parts + fGFW->AddRegion("poiN", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 128); + fGFW->AddRegion("olN", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 256); + + // pion + fGFW->AddRegion("poiNpi", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 2); + fGFW->AddRegion("olNpi", -0.8, -0.4, 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); + + // proton + fGFW->AddRegion("poiNpr", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 8); + fGFW->AddRegion("olNpr", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 64); + + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2} refP08 {-2}", "Ch08Gap22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2} refP08 {-2}", "Pi08Gap22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2} refP08 {-2}", "Ka08Gap22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2} refP08 {-2}", "Pr08Gap22", kFALSE)); + + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiN refN08 | olN {2} refP08 {-2}", "Ch08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNpi refN08 | olNpi {2} refP08 {-2}", "Pi08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNk refN08 | olNk {2} refP08 {-2}", "Ka08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNpr refN08 | olNpr {2} refP08 {-2}", "Pr08Gap22", kTRUE)); + + corrconfigs.push_back(fGFW->GetCorrelatorConfig("full {2 2 -2 -2}", "ChFull24", kFALSE)); + fGFW->CreateRegions(); } - template - bool selectionTrack(const T& candidate) + template + std::pair GetBayesID(TTrack track) { - if (ismanualDCAcut && !(candidate.isGlobalTrackWoDCA() && candidate.isPVContributor() && std::abs(candidate.dcaXY()) < cfgCutDCAxy && std::abs(candidate.dcaZ()) < cfgCutDCAz && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster)) { - return false; + std::array bayesprobs = {static_cast(track.bayesPi()), static_cast(track.bayesKa()), static_cast(track.bayesPr())}; + int bayesid = -1; + int prob = 0; + + for (int i = 0; i < 3; ++i) { + if (bayesprobs[i] > prob && bayesprobs[i] > 80) { + bayesid = i; + prob = bayesprobs[i]; + } } - - return true; + return std::make_pair(bayesid, prob); } - template - bool selectionPID(const T& candidate, int PID) + template + int GetBayesPIDIndex(TTrack track) { - if (candidate.pt() > 0.4) { - onlyTPC = false; - } - - if (PID == 0) { - if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < nsigmaCutTOFPi) { - return true; - } - } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < nsigmaCutTOFPi) { - return true; - } - if (!candidate.hasTOF() && - std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) { - return true; - } - } else if (onlyTPC) { - if (std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) { - return true; - } - } else { - if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (nsigmaCutCombined * nsigmaCutCombined)) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) { - return true; - } - } - } else if (PID == 1) { - if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < nsigmaCutTOFKa) { - return true; - } - } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < nsigmaCutTOFKa) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < nsigmaCutTPCKa) { - return true; - } - } else if (onlyTPC) { - if (std::abs(candidate.tpcNSigmaKa()) < nsigmaCutTPCKa) { - return true; - } + int maxProb[3] = {80, 80, 80}; + int pidID = -1; + std::pair idprob = GetBayesID(track); + if (idprob.first == 0 || idprob.first == 1 || idprob.first == 2) { // 0 = pion, 1 = kaon, 2 = proton + pidID = idprob.first; + float nsigmaTPC[3] = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; + if (idprob.second > maxProb[pidID]) { + if (abs(nsigmaTPC[pidID]) > 3) + return 0; + return pidID + 1; // shift the pid by 1, 1 = pion, 2 = kaon, 3 = proton } else { - if (candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (nsigmaCutCombined * nsigmaCutCombined)) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < nsigmaCutTPCKa) { - return true; - } - } - } else if (PID == 2) { - if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < nsigmaCutTOFPr) { - return true; - } - } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPr()) < nsigmaCutTOFPr) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < nsigmaCutTPCPr) { - return true; - } - } else if (onlyTPC) { - if (std::abs(candidate.tpcNSigmaPr()) < nsigmaCutTPCPr) { - return true; - } - } else { - if (candidate.hasTOF() && (candidate.tofNSigmaPr() * candidate.tofNSigmaPr() + candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr()) < (nsigmaCutCombined * nsigmaCutCombined)) { - return true; - } - if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < nsigmaCutTPCPr) { - return true; - } + return 0; } } - return false; + return 0; } - // Defining filters for events (event selection) - // Processed events will be already fulfilling the event selection - // requirements - - Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); - Filter acceptanceFilter = (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT); - Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); - - using EventCandidates = soa::Filtered>; - using TrackCandidates = soa::Filtered>; - - // Defining partitions for subevents for eta-gap method - Partition Atracks = (aod::track::eta > 0.4f) && (aod::track::eta < 0.8f); // partition for subevent A - Partition Btracks = (aod::track::eta < -0.4f) && (aod::track::eta > -0.8f); // partition for subevent B - - array ptbins = {0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.4, 1.8, 2.2, 2.6, 3.0, 3.5, 4.0, 4.5, 5.0}; - - void processSE(EventCandidates::iterator const& collision, TrackCandidates const& tracks, aod::BCs const&) - + template + void FillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) { - float sum_sinA = 0.0, sum_cosA = 0.0, sum_sinB = 0.0, sum_cosB = 0.0; - int multA = 0, multB = 0; - - // Q vector elements - array sum_sindsA = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // sin component of Q vector for subevent A - array sum_cosdsA = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // cos component of Q vector for subevent A - array sum_sindsB = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // sin component of Q vector for subevent B - array sum_cosdsB = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // cos component of Q vector for subevent B - - // p vector definitions for subevent A - array pn_sumsinA_pr = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // to store ptwise pn vector components for proton - array pn_sumcosA_pr = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // to store ptwise pn vector components for proton - - array pn_sumsinA_pi = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // to store ptwise pn vector components for pion - array pn_sumcosA_pi = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // to store ptwise pn vector components for pion - - array pn_sumsinA_k = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // to store ptwise pn vector components for kaon - array pn_sumcosA_k = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // to store ptwise pn vector components for kaon - - // p vector definitions for subevent B - array pn_sumsinB_pr = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // to store ptwise pn vector components for proton - array pn_sumcosB_pr = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // to store ptwise pn vector components for proton - - array pn_sumsinB_pi = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // to store ptwise pn vector components for pion - array pn_sumcosB_pi = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // to store ptwise pn vector components for pion - - array pn_sumsinB_k = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // to store ptwise pn vector components for kaon - array pn_sumcosB_k = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; // to store ptwise pn vector components for kaon - - // POI multiplicities - array mpA_pr = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // proton multiplicity for subevent A - array mpB_pr = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // proton multiplicity for subevent B - - array mpA_pi = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // pion multiplicity for subevent A - array mpB_pi = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // pion multiplicity for subevent B - - array mpA_k = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // kaon multiplicity for subevent A - array mpB_k = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // kaon multiplicity for subevent B - - if (!collision.sel8()) { + double dnx, val; + dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (dnx == 0) return; - } - - if (timFrameEvsel && (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { + if (!corrconf.pTDif) { + val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (TMath::Abs(val) < 1) + histos.fill(tarName, cent, val, dnx); return; } + for (Int_t i = 1; i <= fPtAxis->GetNbins(); i++) { + dnx = fGFW->Calculate(corrconf, i - 1, kTRUE).real(); + if (dnx == 0) + continue; + val = fGFW->Calculate(corrconf, i - 1, kFALSE).real() / dnx; + if (TMath::Abs(val) < 1) + histos.fill(tarName, fPtAxis->GetBinCenter(i), val, dnx); + } + return; + } - if (TVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { + void FillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) + { + double dnx, val; + dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (dnx == 0) { return; } - - float multiplicity = 0.0f; - multiplicity = collision.centFT0C(); - - // Fill the event counter - rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); - rEventSelection.fill(HIST("hmult"), multiplicity); - - auto atrack = Atracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - auto btrack = Btracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - - for (auto track : tracks) { - if (!selectionTrack(track)) { - continue; + if (!corrconf.pTDif) { + val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (TMath::Abs(val) < 1) { + fFC->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm); } - if (selectionPID(track, 0) || selectionPID(track, 1) || selectionPID(track, 2)) { // If track pion, kaon or proton - histos.fill(HIST("hphi"), track.phi()); - } else { - continue; - } - } // end of track loop - - for (auto track1 : atrack) { - if (!selectionTrack(track1)) { - continue; - } - - sum_sinA += TMath::Sin(2.0 * track1.phi()); // sum of sin components of Q vector - sum_cosA += TMath::Cos(2.0 * track1.phi()); // sum of cos components of Q vector - multA++; // charged particle multiplicity - - if (selectionPID(track1, 0) || selectionPID(track1, 1) || selectionPID(track1, 2)) { // If track pion, kaon or proton - // pt loop for component sums of p vector, POI multiplicities pt wise - for (auto pt = 0; pt < 14; pt++) { - sum_sindsA[pt] += TMath::Sin(2 * track1.phi()); - sum_cosdsA[pt] += TMath::Cos(2 * track1.phi()); - - if (track1.pt() > ptbins[pt] && track1.pt() <= ptbins[pt + 1] && selectionPID(track1, 0)) { // for pion - pn_sumsinA_pi[pt] += TMath::Sin(2 * track1.phi()); - pn_sumcosA_pi[pt] += TMath::Cos(2 * track1.phi()); - mpA_pi[pt]++; - } else if (track1.pt() > ptbins[pt] && track1.pt() <= ptbins[pt + 1] && selectionPID(track1, 1)) { // for kaon - pn_sumsinA_k[pt] += TMath::Sin(2 * track1.phi()); - pn_sumcosA_k[pt] += TMath::Cos(2 * track1.phi()); - mpA_k[pt]++; - } else if (track1.pt() > ptbins[pt] && track1.pt() <= ptbins[pt + 1] && selectionPID(track1, 2)) { // for proton - pn_sumsinA_pr[pt] += TMath::Sin(2 * track1.phi()); - pn_sumcosA_pr[pt] += TMath::Cos(2 * track1.phi()); - mpA_pr[pt]++; - } else { - continue; - } - } // end of pt loop - } else { - continue; - } - } // track loop ends - - for (auto track2 : btrack) { - if (!selectionTrack(track2)) { - continue; - } - - sum_sinB += TMath::Sin(2.0 * track2.phi()); // sum of sin components of Q vector - sum_cosB += TMath::Cos(2.0 * track2.phi()); // sum of cos components of Q vector - multB++; // charged particle multiplicity - - if (selectionPID(track2, 0) || selectionPID(track2, 1) || selectionPID(track2, 2)) { // If track pion, kaon or proton - // pt loop for component sums of p vector, POI multiplicities pt wise - for (auto pt = 0; pt < 14; pt++) { - sum_sindsB[pt] += TMath::Sin(2 * track2.phi()); - sum_cosdsB[pt] += TMath::Cos(2 * track2.phi()); - - if (track2.pt() > ptbins[pt] && track2.pt() <= ptbins[pt + 1] && selectionPID(track2, 0)) { // for pion - pn_sumsinB_pi[pt] += TMath::Sin(2 * track2.phi()); - pn_sumcosB_pi[pt] += TMath::Cos(2 * track2.phi()); - mpB_pi[pt]++; - } else if (track2.pt() > ptbins[pt] && track2.pt() <= ptbins[pt + 1] && selectionPID(track2, 1)) { // for kaon - pn_sumsinB_k[pt] += TMath::Sin(2 * track2.phi()); - pn_sumcosB_k[pt] += TMath::Cos(2 * track2.phi()); - mpB_k[pt]++; - } else if (track2.pt() > ptbins[pt] && track2.pt() <= ptbins[pt + 1] && selectionPID(track2, 2)) { // for proton - pn_sumsinB_pr[pt] += TMath::Sin(2 * track2.phi()); - pn_sumcosB_pr[pt] += TMath::Cos(2 * track2.phi()); - mpB_pr[pt]++; - } else { - continue; - } - } // end of pt loop - } else { + return; + } + for (Int_t i = 1; i <= fPtAxis->GetNbins(); i++) { + dnx = fGFW->Calculate(corrconf, i - 1, kTRUE).real(); + if (dnx == 0) continue; - } - } // track loop ends - - if (10.0 < multiplicity && multiplicity <= 20.0) { - // reference flow - if ((multA * multB) != 0) { - histos.fill(HIST("profv2ref"), 1, ((sum_cosA * sum_cosB + sum_sinA * sum_sinB) / (multA * multB)), multA * multB); - } - - // pt wise differential flow - for (auto pt = 0; pt < 14; pt++) { - if ((mpA_pr[pt] * multB) != 0) { - histos.fill(HIST("profv2diff_pr_10_20"), pt + 1, ((pn_sumcosA_pr[pt] * sum_cosB + pn_sumsinA_pr[pt] * sum_sinB) / (mpA_pr[pt] * multB)), mpA_pr[pt] * multB); - } // for proton - if ((mpA_pi[pt] * multB) != 0) { - histos.fill(HIST("profv2diff_pi_10_20"), pt + 1, ((pn_sumcosA_pi[pt] * sum_cosB + pn_sumsinA_pi[pt] * sum_sinB) / (mpA_pi[pt] * multB)), mpA_pi[pt] * multB); - } // for pion - if ((mpA_k[pt] * multB) != 0) { - histos.fill(HIST("profv2diff_k_10_20"), pt + 1, ((pn_sumcosA_k[pt] * sum_cosB + pn_sumsinA_k[pt] * sum_sinB) / (mpA_k[pt] * multB)), mpA_k[pt] * multB); - } // for kaon - } - } // 10 to 20 percent centrality - - if (20.0 < multiplicity && multiplicity <= 30.0) { - // reference flow - if ((multA * multB) != 0) { - histos.fill(HIST("profv2ref"), 2, ((sum_cosA * sum_cosB + sum_sinA * sum_sinB) / (multA * multB)), multA * multB); - } - - // pt wise differential flow - for (auto pt = 0; pt < 14; pt++) { - if ((mpA_pr[pt] * multB) != 0) { - histos.fill(HIST("profv2diff_pr_20_30"), pt + 1, ((pn_sumcosA_pr[pt] * sum_cosB + pn_sumsinA_pr[pt] * sum_sinB) / (mpA_pr[pt] * multB)), mpA_pr[pt] * multB); - } // for proton - if ((mpA_pi[pt] * multB) != 0) { - histos.fill(HIST("profv2diff_pi_20_30"), pt + 1, ((pn_sumcosA_pi[pt] * sum_cosB + pn_sumsinA_pi[pt] * sum_sinB) / (mpA_pi[pt] * multB)), mpA_pi[pt] * multB); - } // for pion - if ((mpA_k[pt] * multB) != 0) { - histos.fill(HIST("profv2diff_k_20_30"), pt + 1, ((pn_sumcosA_k[pt] * sum_cosB + pn_sumsinA_k[pt] * sum_sinB) / (mpA_k[pt] * multB)), mpA_k[pt] * multB); - } // for kaon - } - } // 20 to 30 percent centrality - - if (30.0 < multiplicity && multiplicity <= 40.0) { - // reference flow - if ((multA * multB) != 0) { - histos.fill(HIST("profv2ref"), 3, ((sum_cosA * sum_cosB + sum_sinA * sum_sinB) / (multA * multB)), multA * multB); - } - - // pt wise differential flow - for (auto pt = 0; pt < 14; pt++) { - if ((mpA_pr[pt] * multB) != 0) { - histos.fill(HIST("profv2diff_pr_30_40"), pt + 1, ((pn_sumcosA_pr[pt] * sum_cosB + pn_sumsinA_pr[pt] * sum_sinB) / (mpA_pr[pt] * multB)), mpA_pr[pt] * multB); - } // for proton - if ((mpA_pi[pt] * multB) != 0) { - histos.fill(HIST("profv2diff_pi_30_40"), pt + 1, ((pn_sumcosA_pi[pt] * sum_cosB + pn_sumsinA_pi[pt] * sum_sinB) / (mpA_pi[pt] * multB)), mpA_pi[pt] * multB); - } // for pion - if ((mpA_k[pt] * multB) != 0) { - histos.fill(HIST("profv2diff_k_30_40"), pt + 1, ((pn_sumcosA_k[pt] * sum_cosB + pn_sumsinA_k[pt] * sum_sinB) / (mpA_k[pt] * multB)), mpA_k[pt] * multB); - } // for kaon - } - } // 30 to 40 percent centrality - - if (40.0 < multiplicity && multiplicity <= 50.0) { - // reference flow - if ((multA * multB) != 0) { - histos.fill(HIST("profv2ref"), 4, ((sum_cosA * sum_cosB + sum_sinA * sum_sinB) / (multA * multB)), multA * multB); - } - - // pt wise differential flow - for (auto pt = 0; pt < 14; pt++) { - if ((mpA_pr[pt] * multB) != 0) { - histos.fill(HIST("profv2diff_pr_40_50"), pt + 1, ((pn_sumcosA_pr[pt] * sum_cosB + pn_sumsinA_pr[pt] * sum_sinB) / (mpA_pr[pt] * multB)), mpA_pr[pt] * multB); - } // for proton - if ((mpA_pi[pt] * multB) != 0) { - histos.fill(HIST("profv2diff_pi_40_50"), pt + 1, ((pn_sumcosA_pi[pt] * sum_cosB + pn_sumsinA_pi[pt] * sum_sinB) / (mpA_pi[pt] * multB)), mpA_pi[pt] * multB); - } // for pion - if ((mpA_k[pt] * multB) != 0) { - histos.fill(HIST("profv2diff_k_40_50"), pt + 1, ((pn_sumcosA_k[pt] * sum_cosB + pn_sumsinA_k[pt] * sum_sinB) / (mpA_k[pt] * multB)), mpA_k[pt] * multB); - } // for kaon - } - } // 40 to 50 percent centrality + val = fGFW->Calculate(corrconf, i - 1, kFALSE).real() / dnx; + if (TMath::Abs(val) < 1) + fFC->FillProfile(Form("%s_pt_%i", corrconf.Head.c_str(), i), cent, val, dnx, rndm); + } + return; + } - if (50.0 < multiplicity && multiplicity <= 60.0) { - // reference flow - if ((multA * multB) != 0) { - histos.fill(HIST("profv2ref"), 5, ((sum_cosA * sum_cosB + sum_sinA * sum_sinB) / (multA * multB)), multA * multB); + void process(aodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, aodTracks const& tracks) + { + int Ntot = tracks.size(); + if (Ntot < 1) + return; + if (!collision.sel8()) + return; + float l_Random = fRndm->Rndm(); + + float vtxz = collision.posZ(); + histos.fill(HIST("hVtxZ"), vtxz); + histos.fill(HIST("hMult"), Ntot); + histos.fill(HIST("hCent"), collision.centFT0C()); + fGFW->Clear(); + const auto cent = collision.centFT0C(); + float weff = 1, wacc = 1; + int pidIndex; + for (auto& track : tracks) { + double pt = track.pt(); + histos.fill(HIST("hPhi"), track.phi()); + histos.fill(HIST("hEta"), track.eta()); + histos.fill(HIST("hPt"), pt); + + histos.fill(HIST("TofTpcNsigma"), 0, track.tpcNSigmaPi(), track.tofNSigmaPi()); + histos.fill(HIST("TofTpcNsigma"), 1, track.tpcNSigmaKa(), track.tofNSigmaKa()); + histos.fill(HIST("TofTpcNsigma"), 2, track.tpcNSigmaPr(), track.tofNSigmaPr()); + + bool WithinPtPOI = (cfgCutPtPOIMin < pt) && (pt < cfgCutPtPOIMax); // within POI pT range + bool WithinPtRef = (cfgCutPtMin < pt) && (pt < cfgCutPtMax); // within RF pT range + + pidIndex = GetBayesPIDIndex(track); + if (WithinPtRef) + fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 1); + if (WithinPtPOI) + fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 128); + if (WithinPtPOI && WithinPtRef) + fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 256); + fGFW->Fill(track.eta(), 1, track.phi(), wacc * weff, 512); + + if (pidIndex) { + if (WithinPtPOI) + fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 1 << (pidIndex)); + if (WithinPtPOI && WithinPtRef) + fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 1 << (pidIndex + 3)); } - } // 50 to 60 percent centrality + } - if (60.0 < multiplicity && multiplicity <= 70.0) { - // reference flow - if ((multA * multB) != 0) { - histos.fill(HIST("profv2ref"), 6, ((sum_cosA * sum_cosB + sum_sinA * sum_sinB) / (multA * multB)), multA * multB); - } - } // 60 to 70 percent centrality + // Filling c22 with ROOT TProfile + FillProfile(corrconfigs.at(0), HIST("c22_gap08"), cent); + FillProfile(corrconfigs.at(1), HIST("c22_gap08_pi"), cent); + FillProfile(corrconfigs.at(2), HIST("c22_gap08_ka"), cent); + FillProfile(corrconfigs.at(3), HIST("c22_gap08_pr"), cent); + FillProfile(corrconfigs.at(4), HIST("c24_full"), cent); - if (70.0 < multiplicity && multiplicity <= 80.0) { - // reference flow - if ((multA * multB) != 0) { - histos.fill(HIST("profv2ref"), 7, ((sum_cosA * sum_cosB + sum_sinA * sum_sinB) / (multA * multB)), multA * multB); - } - } // 70 to 80 percent centrality + for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) { + FillFC(corrconfigs.at(l_ind), cent, l_Random); + } } // end of process - - PROCESS_SWITCH(v2ellip, processSE, "Process Same event", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 58b23c66c347d30b547ab487a61f7fda1bf6dd74 Mon Sep 17 00:00:00 2001 From: nepeivodaRS <94179174+nepeivodaRS@users.noreply.github.com> Date: Wed, 27 Nov 2024 22:30:57 +0100 Subject: [PATCH 144/459] [PWGLF] strangeness in UPC: back to global tracks, add eta axis (#8702) --- PWGLF/Tasks/Strangeness/strange-yield-pbpb.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/strange-yield-pbpb.cxx b/PWGLF/Tasks/Strangeness/strange-yield-pbpb.cxx index 7706fe720bb..63c866695dc 100644 --- a/PWGLF/Tasks/Strangeness/strange-yield-pbpb.cxx +++ b/PWGLF/Tasks/Strangeness/strange-yield-pbpb.cxx @@ -195,7 +195,7 @@ struct strangeYieldPbPb { ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "pt axis for v0 analysis"}; ConfigurableAxis axisPtXi{"axisPtCasc", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "pt axis for cascade analysis"}; ConfigurableAxis axisPtCoarse{"axisPtCoarse", {VARIABLE_WIDTH, 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 7.0f, 10.0f, 15.0f}, "pt axis for QA"}; - ConfigurableAxis axisEta{"axisEta", {40, -2.0f, 2.0f}, "#eta"}; + ConfigurableAxis axisEta{"axisEta", {100, -2.0f, 2.0f}, "#eta"}; ConfigurableAxis axisRap{"axisRap", {100, -2.0f, 2.0f}, "y"}; // Invariant mass axes @@ -214,7 +214,7 @@ struct strangeYieldPbPb { ConfigurableAxis axisNTracksGlobal{"axisNTracksGlobal", {100, -0.5f, 99.5f}, "Number of global tracks"}; ConfigurableAxis axisNTracksPVeta1{"axisNTracksPVeta1", {100, -0.5f, 99.5f}, "Number of PV contributors in |eta| < 1"}; ConfigurableAxis axisNTracksTotalExceptITSonly{"axisNTracksTotalExceptITSonly", {100, -0.5f, 99.5f}, "Number of ITS-TPC and TPC only tracks"}; - ConfigurableAxis axisNchInvMass{"axisNchInvMass", {20, -0.5f, 19.5f}, "Number of charged particles for kTHnSparseF"}; + ConfigurableAxis axisNchInvMass{"axisNchInvMass", {200, -0.5f, 199.5f}, "Number of charged particles for kTHnSparseF"}; ConfigurableAxis axisFT0C_QA{"axisFT0C_QA", {VARIABLE_WIDTH, 0., 0.01, 0.05, 0.1, 0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 105.5}, @@ -387,7 +387,7 @@ struct strangeYieldPbPb { template void addHistograms(HistogramRegistry& histos) { - histos.add(Form("%s/h6dMass", particlenames[partID].data()), "h6dMass", kTHnSparseF, {axisFT0C, axisPt, axisInvMass.at(partID), axisSelGap, axisNchInvMass, axisRap}); + histos.add(Form("%s/h7dMass", particlenames[partID].data()), "h7dMass", kTHnSparseF, {axisFT0C, axisPt, axisInvMass.at(partID), axisSelGap, axisNchInvMass, axisRap, axisEta}); histos.add(Form("%s/h2dMass", particlenames[partID].data()), "h2dMass", kTH2F, {axisInvMass.at(partID), axisSelGap}); if (doPlainTopoQA) { addTopoHistograms(histos); @@ -474,7 +474,7 @@ struct strangeYieldPbPb { } histos.fill(HIST(particlenames[partID]) + HIST("/h2dMass"), invMass, gap); - histos.fill(HIST(particlenames[partID]) + HIST("/h6dMass"), centrality, pT, invMass, gap, coll.multAllTracksTPCOnly() + coll.multAllTracksITSTPC(), rapidity); + histos.fill(HIST(particlenames[partID]) + HIST("/h7dMass"), centrality, pT, invMass, gap, coll.multNTracksGlobal(), rapidity, cand.eta()); if (doKienmaticQA) { histos.fill(HIST(particlenames[partID]) + HIST("/h3dPosEtaPt"), pT, cand.positiveeta(), gap); histos.fill(HIST(particlenames[partID]) + HIST("/h3dNegEtaPt"), pT, cand.negativeeta(), gap); @@ -624,7 +624,7 @@ struct strangeYieldPbPb { } } histos.fill(HIST(particlenames[partID]) + HIST("/h2dMass"), invMass, gap); - histos.fill(HIST(particlenames[partID]) + HIST("/h6dMass"), centrality, pT, invMass, gap, coll.multAllTracksTPCOnly() + coll.multAllTracksITSTPC(), rapidity); + histos.fill(HIST(particlenames[partID]) + HIST("/h7dMass"), centrality, pT, invMass, gap, coll.multNTracksGlobal(), rapidity, cand.eta()); if (doKienmaticQA) { histos.fill(HIST(particlenames[partID]) + HIST("/h3dPosEtaPt"), pT, cand.positiveeta(), gap); histos.fill(HIST(particlenames[partID]) + HIST("/h3dNegEtaPt"), pT, cand.negativeeta(), gap); From f75fb44f51f2f69081af48bff34c6718bcb621ad Mon Sep 17 00:00:00 2001 From: rolavick Date: Wed, 27 Nov 2024 23:10:44 +0100 Subject: [PATCH 145/459] [PWGUD] Fixing definition of UDMCPARTICLE and UDMCCOLLISION tables (#8703) --- PWGUD/DataModel/UDTables.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGUD/DataModel/UDTables.h b/PWGUD/DataModel/UDTables.h index b24bcdb2b77..8c5a796a578 100644 --- a/PWGUD/DataModel/UDTables.h +++ b/PWGUD/DataModel/UDTables.h @@ -29,7 +29,7 @@ namespace udmccollision DECLARE_SOA_COLUMN(GlobalBC, globalBC, uint64_t); //! } // namespace udmccollision -DECLARE_SOA_TABLE(UDMcCollisions, "AOD", "UDMCCOLLISIONS", +DECLARE_SOA_TABLE(UDMcCollisions, "AOD", "UDMCCOLLISION", o2::soa::Index<>, udmccollision::GlobalBC, mccollision::GeneratorsID, @@ -53,7 +53,7 @@ DECLARE_SOA_COLUMN(Pz, pz, float); //! DECLARE_SOA_COLUMN(E, e, float); //! } // namespace udmcparticle -DECLARE_SOA_TABLE_FULL(UDMcParticles, "UDMcParticles", "AOD", "UDMCPARTICLES", //! +DECLARE_SOA_TABLE_FULL(UDMcParticles, "UDMcParticles", "AOD", "UDMCPARTICLE", //! o2::soa::Index<>, udmcparticle::UDMcCollisionId, mcparticle::PdgCode, mcparticle::StatusCode, From 1fa77e7448708493dc32c93a83a553b42e3daf5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Eduardo=20Mu=C3=B1oz=20M=C3=A9ndez?= <56033627+jmunozme@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:43:29 -0600 Subject: [PATCH 146/459] [PWGLF] [PWGMM] Modification to the event selection criteria (#8672) --- PWGMM/UE/Tasks/uecharged.cxx | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/PWGMM/UE/Tasks/uecharged.cxx b/PWGMM/UE/Tasks/uecharged.cxx index 3db96c9dbac..18e59f8338d 100644 --- a/PWGMM/UE/Tasks/uecharged.cxx +++ b/PWGMM/UE/Tasks/uecharged.cxx @@ -53,7 +53,7 @@ struct ueCharged { selectedTracks.SetRequireTPCRefit(true); // selectedTracks.SetRequireGoldenChi2(true); selectedTracks.SetMinNCrossedRowsTPC(70); - selectedTracks.SetMinNCrossedRowsOverFindableClustersTPC(0.4f); + selectedTracks.SetMinNCrossedRowsOverFindableClustersTPC(0.8f); selectedTracks.SetMaxChi2PerClusterTPC(4.f); selectedTracks.SetRequireHitsInITSLayers(1, {0, 1}); // one hit in any SPD layer selectedTracks.SetMaxChi2PerClusterITS(36.f); @@ -70,7 +70,7 @@ struct ueCharged { selectedTracks.SetRequireTPCRefit(true); // selectedTracks.SetRequireGoldenChi2(true); selectedTracks.SetMinNCrossedRowsTPC(70); - selectedTracks.SetMinNCrossedRowsOverFindableClustersTPC(0.4f); + selectedTracks.SetMinNCrossedRowsOverFindableClustersTPC(0.8f); selectedTracks.SetMaxChi2PerClusterTPC(4.f); selectedTracks.SetRequireHitsInITSLayers(1, {0, 1}); // one hit in any SPD layer selectedTracks.SetMaxChi2PerClusterITS(36.f); @@ -86,7 +86,6 @@ struct ueCharged { float DeltaPhi(float phia, float phib, float rangeMin, float rangeMax); // Configurable for event selection Configurable isRun3{"isRun3", true, "is Run3 dataset"}; - Configurable timeEvsel{"timeEvsel", true, "TPC Time frame boundary cut"}; Configurable piluprejection{"piluprejection", true, "Pileup rejection"}; Configurable goodzvertex{"goodzvertex", true, "removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference."}; @@ -431,21 +430,16 @@ void ueCharged::processMeas(const C& collision, const T& tracks) ue.fill(HIST("hCounter"), 1); - if (timeEvsel && (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { - return; - } - - ue.fill(HIST("hCounter"), 2); if (piluprejection && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { return; } - ue.fill(HIST("hCounter"), 3); + ue.fill(HIST("hCounter"), 2); if (goodzvertex && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { return; } - ue.fill(HIST("hCounter"), 4); + ue.fill(HIST("hCounter"), 3); ue.fill(HIST("hStat"), collision.size()); auto vtxZ = collision.posZ(); @@ -454,7 +448,7 @@ void ueCharged::processMeas(const C& collision, const T& tracks) return; } - ue.fill(HIST("hCounter"), 5); + ue.fill(HIST("hCounter"), 4); ue.fill(HIST("hvtxZ"), vtxZ); @@ -726,28 +720,26 @@ void ueCharged::processMeasMC(const C& collision, const T& tracks, const P& part phiArrayTrue.clear(); indexArrayTrue.clear(); - if (!collision.sel8()) { + if (!collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { return; } ue.fill(HIST("hCounter"), 1); - // TODO:Implement time frame selection (only if MC includes this effect) - ue.fill(HIST("hCounter"), 2); if (piluprejection && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { return; } + ue.fill(HIST("hCounter"), 2); - ue.fill(HIST("hCounter"), 3); if (goodzvertex && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { return; } - ue.fill(HIST("hCounter"), 4); + ue.fill(HIST("hCounter"), 3); // only PS if ((std::abs(collision.posZ()) >= 10.f)) { return; } - ue.fill(HIST("hCounter"), 5); + ue.fill(HIST("hCounter"), 4); ue.fill(HIST(pNumDenTruePS[0]), flPtTrue, ue_true[0]); ue.fill(HIST(pSumPtTruePS[0]), flPtTrue, ue_true[3]); From 95b474c8fe8d812435ca19a0cadea7b8657e5ec8 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Thu, 28 Nov 2024 00:36:49 +0100 Subject: [PATCH 147/459] Adding particle level background subtraction (#8704) --- PWGJE/Core/JetFindingUtilities.h | 10 +- PWGJE/DataModel/Jet.h | 5 + PWGJE/DataModel/JetSubtraction.h | 265 +++++++++++++----- PWGJE/JetFinders/jetFinder.cxx | 16 +- PWGJE/JetFinders/jetFinderD0DataCharged.cxx | 2 +- PWGJE/JetFinders/jetFinderD0MCDCharged.cxx | 2 +- PWGJE/JetFinders/jetFinderD0MCPCharged.cxx | 2 +- .../jetFinderDielectronDataCharged.cxx | 2 +- .../jetFinderDielectronMCDCharged.cxx | 2 +- .../jetFinderDielectronMCPCharged.cxx | 2 +- PWGJE/JetFinders/jetFinderHF.cxx | 27 +- PWGJE/JetFinders/jetFinderLcDataCharged.cxx | 2 +- PWGJE/JetFinders/jetFinderLcMCDCharged.cxx | 2 +- PWGJE/JetFinders/jetFinderLcMCPCharged.cxx | 2 +- PWGJE/JetFinders/jetFinderV0.cxx | 2 +- .../eventwiseConstituentSubtractor.cxx | 79 +++++- PWGJE/TableProducer/rhoEstimator.cxx | 81 +++++- PWGJE/Tasks/jetChargedV2.cxx | 1 - PWGJE/Tasks/jetFinderHFQA.cxx | 1 - PWGJE/Tasks/jetFinderQA.cxx | 1 - PWGJE/Tasks/jetFinderV0QA.cxx | 1 - 21 files changed, 403 insertions(+), 104 deletions(-) diff --git a/PWGJE/Core/JetFindingUtilities.h b/PWGJE/Core/JetFindingUtilities.h index 8efd9733e6e..c41bfbd4f0f 100644 --- a/PWGJE/Core/JetFindingUtilities.h +++ b/PWGJE/Core/JetFindingUtilities.h @@ -336,7 +336,7 @@ void findJets(JetFinder& jetFinder, std::vector& inputPartic * @param pdgDatabase database of pdg codes * @param candidate optional hf candidiate */ -template +template void analyseParticles(std::vector& inputParticles, std::string particleSelection, int jetTypeParticleLevel, T const& particles, o2::framework::Service pdgDatabase, std::optional const& candidate = std::nullopt) { for (auto& particle : particles) { @@ -366,9 +366,11 @@ void analyseParticles(std::vector& inputParticles, std::stri if (cand.mcParticleId() == particle.globalIndex()) { continue; } - auto hfParticle = cand.template mcParticle_as(); - if (jetcandidateutilities::isDaughterParticle(hfParticle, particle.globalIndex())) { - continue; + if constexpr (checkIsDaughter) { + auto hfParticle = cand.template mcParticle_as(); + if (jetcandidateutilities::isDaughterParticle(hfParticle, particle.globalIndex())) { + continue; + } } } } diff --git a/PWGJE/DataModel/Jet.h b/PWGJE/DataModel/Jet.h index b3356fcc4a4..0ba6ff484d4 100644 --- a/PWGJE/DataModel/Jet.h +++ b/PWGJE/DataModel/Jet.h @@ -209,11 +209,13 @@ using JetClustersMCD = o2::soa::Join; using JetMcCollisions = JMcCollisions; using JetMcCollision = JetMcCollisions::iterator; using JetParticles = JMcParticles; +using JetParticlesSub = JMcParticleSubs; using CollisionsD0 = o2::soa::Join; using CandidatesD0Data = o2::soa::Join; using CandidatesD0MCD = o2::soa::Join; using JetTracksSubD0 = JTrackD0Subs; +using JetParticlesSubD0 = JMcParticleD0Subs; using McCollisionsD0 = o2::soa::Join; using CandidatesD0MCP = o2::soa::Join; @@ -221,12 +223,14 @@ using CollisionsLc = o2::soa::Join; using CandidatesLcData = o2::soa::Join; using CandidatesLcMCD = o2::soa::Join; using JetTracksSubLc = JTrackLcSubs; +using JetParticlesSubLc = JMcParticleLcSubs; using McCollisionsLc = o2::soa::Join; using CandidatesLcMCP = o2::soa::Join; using CandidatesBplusData = o2::soa::Join; using CandidatesBplusMCD = o2::soa::Join; using JetTracksSubBplus = JTrackBplusSubs; +using JetParticlesSubBplus = JMcParticleBplusSubs; using CandidatesBplusMCP = o2::soa::Join; using CandidatesV0Data = o2::soa::Join; @@ -239,6 +243,7 @@ using CollisionsDielectron = o2::soa::Join; using CandidatesDielectronMCD = o2::soa::Join; using JetTracksSubDielectron = JTrackDielectronSubs; +using JetParticlesSubDielectron = JMcParticleDielectronSubs; using McCollisionsDielectron = o2::soa::Join; using CandidatesDielectronMCP = o2::soa::Join; diff --git a/PWGJE/DataModel/JetSubtraction.h b/PWGJE/DataModel/JetSubtraction.h index f789d18637a..1992283865c 100644 --- a/PWGJE/DataModel/JetSubtraction.h +++ b/PWGJE/DataModel/JetSubtraction.h @@ -22,6 +22,7 @@ #include "Framework/AnalysisDataModel.h" #include "PWGJE/DataModel/EMCALClusters.h" #include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetReducedDataDQ.h" #include "PWGHF/DataModel/DerivedTables.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" @@ -38,6 +39,7 @@ DECLARE_SOA_COLUMN(RhoM, rhoM, float); //! namespace bkgcharged { DECLARE_SOA_INDEX_COLUMN(JCollision, collision); +DECLARE_SOA_INDEX_COLUMN(JMcCollision, mcCollision); } // namespace bkgcharged namespace bkgd0 @@ -45,144 +47,275 @@ namespace bkgd0 DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfD0Bases, "_0"); } // namespace bkgd0 +namespace bkgd0mc +{ +DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfD0PBases, "_0"); +} // namespace bkgd0mc + namespace bkglc { DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, Hf3PBases, "_0"); } // namespace bkglc +namespace bkglcmc +{ +DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, Hf3PPBases, "_0"); +} // namespace bkglcmc + namespace bkgbplus { DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfCandBplus, "_0"); } // namespace bkgbplus +namespace bkgbplusmc +{ +DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfCandBplusMcGen, "_0"); // change this!! +} // namespace bkgbplusmc + namespace bkgdielectron { DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, Dielectrons, "_0"); -// DECLARE_SOA_INDEX_COLUMN(Dielectron, candidate); } // namespace bkgdielectron +namespace bkgdielectronmc +{ +DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, JDielectronMcs, "_0"); +} // namespace bkgdielectronmc + DECLARE_SOA_TABLE(BkgChargedRhos, "AOD", "BkgCRho", o2::soa::Index<>, bkgrho::Rho, bkgrho::RhoM); -DECLARE_SOA_TABLE(BkgD0Rhos, "AOD", "BkgD0Rho", +DECLARE_SOA_TABLE(BkgChargedMcRhos, "AOD", "BkgCMcRho", o2::soa::Index<>, bkgrho::Rho, bkgrho::RhoM, o2::soa::Marker<1>); -DECLARE_SOA_TABLE(BkgLcRhos, "AOD", "BkgLcRho", +DECLARE_SOA_TABLE(BkgD0Rhos, "AOD", "BkgD0Rho", o2::soa::Index<>, bkgrho::Rho, bkgrho::RhoM, o2::soa::Marker<2>); -DECLARE_SOA_TABLE(BkgBplusRhos, "AOD", "BkgBPlRho", +DECLARE_SOA_TABLE(BkgD0McRhos, "AOD", "BkgD0McRho", o2::soa::Index<>, bkgrho::Rho, bkgrho::RhoM, o2::soa::Marker<3>); -DECLARE_SOA_TABLE(BkgDielectronRhos, "AOD", "BkgDIELRho", +DECLARE_SOA_TABLE(BkgLcRhos, "AOD", "BkgLcRho", o2::soa::Index<>, bkgrho::Rho, bkgrho::RhoM, o2::soa::Marker<4>); -namespace jtracksub -{ +DECLARE_SOA_TABLE(BkgLcMcRhos, "AOD", "BkgLcMcRho", + o2::soa::Index<>, + bkgrho::Rho, + bkgrho::RhoM, + o2::soa::Marker<5>); + +DECLARE_SOA_TABLE(BkgBplusRhos, "AOD", "BkgBPlRho", + o2::soa::Index<>, + bkgrho::Rho, + bkgrho::RhoM, + o2::soa::Marker<6>); + +DECLARE_SOA_TABLE(BkgBplusMcRhos, "AOD", "BkgBPlMcRho", + o2::soa::Index<>, + bkgrho::Rho, + bkgrho::RhoM, + o2::soa::Marker<7>); -DECLARE_SOA_COLUMN(Pt, pt, float); -DECLARE_SOA_COLUMN(Eta, eta, float); -DECLARE_SOA_COLUMN(Phi, phi, float); -DECLARE_SOA_COLUMN(Energy, energy, float); -DECLARE_SOA_COLUMN(TrackSel, trackSel, uint8_t); -DECLARE_SOA_DYNAMIC_COLUMN(Px, px, - [](float pt, float phi) -> float { return pt * std::cos(phi); }); -DECLARE_SOA_DYNAMIC_COLUMN(Py, py, - [](float pt, float phi) -> float { return pt * std::sin(phi); }); -DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, - [](float pt, float eta) -> float { return pt * std::sinh(eta); }); -DECLARE_SOA_DYNAMIC_COLUMN(P, p, - [](float pt, float eta) -> float { return pt * std::cosh(eta); }); -} // namespace jtracksub +DECLARE_SOA_TABLE(BkgDielectronRhos, "AOD", "BkgDIELRho", + o2::soa::Index<>, + bkgrho::Rho, + bkgrho::RhoM, + o2::soa::Marker<8>); + +DECLARE_SOA_TABLE(BkgDielectronMcRhos, "AOD", "BkgDIELMcRho", + o2::soa::Index<>, + bkgrho::Rho, + bkgrho::RhoM, + o2::soa::Marker<9>); DECLARE_SOA_TABLE(JTrackSubs, "AOD", "JTrackSubs", o2::soa::Index<>, bkgcharged::JCollisionId, - jtracksub::Pt, - jtracksub::Eta, - jtracksub::Phi, - jtracksub::Energy, - jtracksub::TrackSel, - jtracksub::Px, - jtracksub::Py, - jtracksub::Pz, - jtracksub::P); + jtrack::Pt, + jtrack::Eta, + jtrack::Phi, + jtrack::TrackSel, + jtrack::Px, + jtrack::Py, + jtrack::Pz, + jtrack::P, + jtrack::Energy); using JTrackSub = JTrackSubs::iterator; +DECLARE_SOA_TABLE(JMcParticleSubs, "AOD", "JMcPartSubs", + o2::soa::Index<>, + bkgcharged::JMcCollisionId, + jmcparticle::Pt, + jmcparticle::Eta, + jmcparticle::Phi, + jmcparticle::Y, + jmcparticle::E, + jmcparticle::PdgCode, + jmcparticle::GenStatusCode, + jmcparticle::HepMCStatusCode, + jmcparticle::IsPhysicalPrimary, + jmcparticle::Px, + jmcparticle::Py, + jmcparticle::Pz, + jmcparticle::P, + jmcparticle::Energy); + +using JMcParticleSub = JMcParticleSubs::iterator; + DECLARE_SOA_TABLE(JTrackD0Subs, "AOD", "JTrackD0Subs", o2::soa::Index<>, bkgd0::CandidateId, - jtracksub::Pt, - jtracksub::Eta, - jtracksub::Phi, - jtracksub::Energy, - jtracksub::TrackSel, - jtracksub::Px, - jtracksub::Py, - jtracksub::Pz, - jtracksub::P); + jtrack::Pt, + jtrack::Eta, + jtrack::Phi, + jtrack::TrackSel, + jtrack::Px, + jtrack::Py, + jtrack::Pz, + jtrack::P, + jtrack::Energy); using JTrackD0Sub = JTrackD0Subs::iterator; +DECLARE_SOA_TABLE(JMcParticleD0Subs, "AOD", "JMcPartD0Subs", + o2::soa::Index<>, + bkgd0mc::CandidateId, + jmcparticle::Pt, + jmcparticle::Eta, + jmcparticle::Phi, + jmcparticle::Y, + jmcparticle::E, + jmcparticle::PdgCode, + jmcparticle::GenStatusCode, + jmcparticle::HepMCStatusCode, + jmcparticle::IsPhysicalPrimary, + jmcparticle::Px, + jmcparticle::Py, + jmcparticle::Pz, + jmcparticle::P, + jmcparticle::Energy); + +using JMcParticleD0Sub = JMcParticleD0Subs::iterator; + DECLARE_SOA_TABLE(JTrackLcSubs, "AOD", "JTrackLcSubs", o2::soa::Index<>, bkglc::CandidateId, - jtracksub::Pt, - jtracksub::Eta, - jtracksub::Phi, - jtracksub::Energy, - jtracksub::TrackSel, - jtracksub::Px, - jtracksub::Py, - jtracksub::Pz, - jtracksub::P); + jtrack::Pt, + jtrack::Eta, + jtrack::Phi, + jtrack::TrackSel, + jtrack::Px, + jtrack::Py, + jtrack::Pz, + jtrack::P, + jtrack::Energy); using JTrackLcSub = JTrackLcSubs::iterator; +DECLARE_SOA_TABLE(JMcParticleLcSubs, "AOD", "JMcPartLcSubs", + o2::soa::Index<>, + bkglcmc::CandidateId, + jmcparticle::Pt, + jmcparticle::Eta, + jmcparticle::Phi, + jmcparticle::Y, + jmcparticle::E, + jmcparticle::PdgCode, + jmcparticle::GenStatusCode, + jmcparticle::HepMCStatusCode, + jmcparticle::IsPhysicalPrimary, + jmcparticle::Px, + jmcparticle::Py, + jmcparticle::Pz, + jmcparticle::P, + jmcparticle::Energy); + +using JMcParticleLcSub = JMcParticleLcSubs::iterator; + DECLARE_SOA_TABLE(JTrackBplusSubs, "AOD", "JTrackBPlSubs", o2::soa::Index<>, bkgbplus::CandidateId, - jtracksub::Pt, - jtracksub::Eta, - jtracksub::Phi, - jtracksub::Energy, - jtracksub::TrackSel, - jtracksub::Px, - jtracksub::Py, - jtracksub::Pz, - jtracksub::P); + jtrack::Pt, + jtrack::Eta, + jtrack::Phi, + jtrack::TrackSel, + jtrack::Px, + jtrack::Py, + jtrack::Pz, + jtrack::P, + jtrack::Energy); using JTrackBplusSub = JTrackBplusSubs::iterator; +DECLARE_SOA_TABLE(JMcParticleBplusSubs, "AOD", "JMcPartBPlSubs", + o2::soa::Index<>, + bkgbplusmc::CandidateId, + jmcparticle::Pt, + jmcparticle::Eta, + jmcparticle::Phi, + jmcparticle::Y, + jmcparticle::E, + jmcparticle::PdgCode, + jmcparticle::GenStatusCode, + jmcparticle::HepMCStatusCode, + jmcparticle::IsPhysicalPrimary, + jmcparticle::Px, + jmcparticle::Py, + jmcparticle::Pz, + jmcparticle::P, + jmcparticle::Energy); + +using JMcParticleBplusSub = JMcParticleBplusSubs::iterator; + DECLARE_SOA_TABLE(JTrackDielectronSubs, "AOD", "JTrackDIELSubs", o2::soa::Index<>, bkgdielectron::CandidateId, - jtracksub::Pt, - jtracksub::Eta, - jtracksub::Phi, - jtracksub::Energy, - jtracksub::TrackSel, - jtracksub::Px, - jtracksub::Py, - jtracksub::Pz, - jtracksub::P); + jtrack::Pt, + jtrack::Eta, + jtrack::Phi, + jtrack::TrackSel, + jtrack::Px, + jtrack::Py, + jtrack::Pz, + jtrack::P, + jtrack::Energy); using JTrackDielectronSub = JTrackDielectronSubs::iterator; +DECLARE_SOA_TABLE(JMcParticleDielectronSubs, "AOD", "JMcPartDIELSubs", + o2::soa::Index<>, + bkgdielectronmc::CandidateId, + jmcparticle::Pt, + jmcparticle::Eta, + jmcparticle::Phi, + jmcparticle::Y, + jmcparticle::E, + jmcparticle::PdgCode, + jmcparticle::GenStatusCode, + jmcparticle::HepMCStatusCode, + jmcparticle::IsPhysicalPrimary, + jmcparticle::Px, + jmcparticle::Py, + jmcparticle::Pz, + jmcparticle::P, + jmcparticle::Energy); + +using JMcParticleDielectronSub = JMcParticleDielectronSubs::iterator; + } // namespace o2::aod #endif // PWGJE_DATAMODEL_JETSUBTRACTION_H_ diff --git a/PWGJE/JetFinders/jetFinder.cxx b/PWGJE/JetFinders/jetFinder.cxx index 31417152225..bbbdcb4b92c 100644 --- a/PWGJE/JetFinders/jetFinder.cxx +++ b/PWGJE/JetFinders/jetFinder.cxx @@ -141,7 +141,6 @@ struct JetFinderTask { aod::EMCALClusterDefinition clusterDefinition = aod::emcalcluster::getClusterDefinitionFromString(clusterDefinitionS.value); Filter collisionFilter = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centrality >= centralityMin && aod::jcollision::centrality < centralityMax && aod::jcollision::trackOccupancyInTimeRange <= trackOccupancyInTimeRangeMax); Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta >= trackEtaMin && aod::jtrack::eta <= trackEtaMax && aod::jtrack::phi >= trackPhiMin && aod::jtrack::phi <= trackPhiMax); // do we need eta cut both here and in globalselection? - Filter trackSubCuts = (aod::jtracksub::pt >= trackPtMin && aod::jtracksub::pt < trackPtMax && aod::jtracksub::eta >= trackEtaMin && aod::jtracksub::eta <= trackEtaMax && aod::jtracksub::phi >= trackPhiMin && aod::jtracksub::phi <= trackPhiMax); Filter partCuts = (aod::jmcparticle::pt >= trackPtMin && aod::jmcparticle::pt < trackPtMax && aod::jmcparticle::eta >= trackEtaMin && aod::jmcparticle::eta <= trackEtaMax && aod::jmcparticle::phi >= trackPhiMin && aod::jmcparticle::phi <= trackPhiMax); Filter clusterFilter = (aod::jcluster::definition == static_cast(clusterDefinition) && aod::jcluster::eta >= clusterEtaMin && aod::jcluster::eta <= clusterEtaMax && aod::jcluster::phi >= clusterPhiMin && aod::jcluster::phi <= clusterPhiMax && aod::jcluster::energy >= clusterEnergyMin && aod::jcluster::time > clusterTimeMin && aod::jcluster::time < clusterTimeMax && (clusterRejectExotics && aod::jcluster::isExotic != true)); @@ -202,16 +201,25 @@ struct JetFinderTask { { // TODO: MC event selection? inputParticles.clear(); - jetfindingutilities::analyseParticles, soa::Filtered::iterator>(inputParticles, particleSelection, 1, particles, pdgDatabase); + jetfindingutilities::analyseParticles, soa::Filtered::iterator>(inputParticles, particleSelection, 1, particles, pdgDatabase); jetfindingutilities::findJets(jetFinder, inputParticles, jetPtMin, jetPtMax, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, fillTHnSparse ? registry.get(HIST("hJetMCP")) : std::shared_ptr(nullptr), fillTHnSparse); } PROCESS_SWITCH(JetFinderTask, processParticleLevelChargedJets, "Particle level charged jet finding", false); + void processParticleLevelChargedEvtWiseSubJets(aod::JetMcCollision const& collision, soa::Filtered const& particles) + { + // TODO: MC event selection? + inputParticles.clear(); + jetfindingutilities::analyseParticles, soa::Filtered::iterator>(inputParticles, particleSelection, 1, particles, pdgDatabase); + jetfindingutilities::findJets(jetFinder, inputParticles, jetPtMin, jetPtMax, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, fillTHnSparse ? registry.get(HIST("hJetMCP")) : std::shared_ptr(nullptr), fillTHnSparse); + } + PROCESS_SWITCH(JetFinderTask, processParticleLevelChargedEvtWiseSubJets, "Particle level charged with event-wise constituent subtraction jet finding", false); + void processParticleLevelNeutralJets(aod::JetMcCollision const& collision, soa::Filtered const& particles) { // TODO: MC event selection? inputParticles.clear(); - jetfindingutilities::analyseParticles, soa::Filtered::iterator>(inputParticles, particleSelection, 2, particles, pdgDatabase); + jetfindingutilities::analyseParticles, soa::Filtered::iterator>(inputParticles, particleSelection, 2, particles, pdgDatabase); jetfindingutilities::findJets(jetFinder, inputParticles, jetPtMin, jetPtMax, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, fillTHnSparse ? registry.get(HIST("hJetMCP")) : std::shared_ptr(nullptr), fillTHnSparse); } PROCESS_SWITCH(JetFinderTask, processParticleLevelNeutralJets, "Particle level neutral jet finding", false); @@ -220,7 +228,7 @@ struct JetFinderTask { { // TODO: MC event selection? inputParticles.clear(); - jetfindingutilities::analyseParticles, soa::Filtered::iterator>(inputParticles, particleSelection, 0, particles, pdgDatabase); + jetfindingutilities::analyseParticles, soa::Filtered::iterator>(inputParticles, particleSelection, 0, particles, pdgDatabase); jetfindingutilities::findJets(jetFinder, inputParticles, jetPtMin, jetPtMax, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, fillTHnSparse ? registry.get(HIST("hJetMCP")) : std::shared_ptr(nullptr), fillTHnSparse); } diff --git a/PWGJE/JetFinders/jetFinderD0DataCharged.cxx b/PWGJE/JetFinders/jetFinderD0DataCharged.cxx index bf39b49696f..29ab757dbce 100644 --- a/PWGJE/JetFinders/jetFinderD0DataCharged.cxx +++ b/PWGJE/JetFinders/jetFinderD0DataCharged.cxx @@ -15,7 +15,7 @@ #include "PWGJE/JetFinders/jetFinderHF.cxx" -using JetFinderD0DataCharged = JetFinderHFTask; +using JetFinderD0DataCharged = JetFinderHFTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/JetFinders/jetFinderD0MCDCharged.cxx b/PWGJE/JetFinders/jetFinderD0MCDCharged.cxx index fceb0bf2c73..46847bf8651 100644 --- a/PWGJE/JetFinders/jetFinderD0MCDCharged.cxx +++ b/PWGJE/JetFinders/jetFinderD0MCDCharged.cxx @@ -15,7 +15,7 @@ #include "PWGJE/JetFinders/jetFinderHF.cxx" -using JetFinderD0MCDetectorLevelCharged = JetFinderHFTask; +using JetFinderD0MCDetectorLevelCharged = JetFinderHFTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/JetFinders/jetFinderD0MCPCharged.cxx b/PWGJE/JetFinders/jetFinderD0MCPCharged.cxx index 2584d5693ec..a21aceff347 100644 --- a/PWGJE/JetFinders/jetFinderD0MCPCharged.cxx +++ b/PWGJE/JetFinders/jetFinderD0MCPCharged.cxx @@ -15,7 +15,7 @@ #include "PWGJE/JetFinders/jetFinderHF.cxx" -using JetFinderD0MCParticleLevelCharged = JetFinderHFTask; +using JetFinderD0MCParticleLevelCharged = JetFinderHFTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/JetFinders/jetFinderDielectronDataCharged.cxx b/PWGJE/JetFinders/jetFinderDielectronDataCharged.cxx index 195b05f8f2f..2b040080579 100644 --- a/PWGJE/JetFinders/jetFinderDielectronDataCharged.cxx +++ b/PWGJE/JetFinders/jetFinderDielectronDataCharged.cxx @@ -15,7 +15,7 @@ #include "PWGJE/JetFinders/jetFinderHF.cxx" -using JetFinderDielectronDataCharged = JetFinderHFTask; +using JetFinderDielectronDataCharged = JetFinderHFTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/JetFinders/jetFinderDielectronMCDCharged.cxx b/PWGJE/JetFinders/jetFinderDielectronMCDCharged.cxx index d49a2215ab6..105b58d459a 100644 --- a/PWGJE/JetFinders/jetFinderDielectronMCDCharged.cxx +++ b/PWGJE/JetFinders/jetFinderDielectronMCDCharged.cxx @@ -15,7 +15,7 @@ #include "PWGJE/JetFinders/jetFinderHF.cxx" -using JetFinderDielectronMCDetectorLevelCharged = JetFinderHFTask; +using JetFinderDielectronMCDetectorLevelCharged = JetFinderHFTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/JetFinders/jetFinderDielectronMCPCharged.cxx b/PWGJE/JetFinders/jetFinderDielectronMCPCharged.cxx index ea8850c5d48..b6aa797e80e 100644 --- a/PWGJE/JetFinders/jetFinderDielectronMCPCharged.cxx +++ b/PWGJE/JetFinders/jetFinderDielectronMCPCharged.cxx @@ -15,7 +15,7 @@ #include "PWGJE/JetFinders/jetFinderHF.cxx" -using JetFinderDielectronMCParticleLevelCharged = JetFinderHFTask; +using JetFinderDielectronMCParticleLevelCharged = JetFinderHFTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/JetFinders/jetFinderHF.cxx b/PWGJE/JetFinders/jetFinderHF.cxx index 94ec554e160..3117ac42f29 100644 --- a/PWGJE/JetFinders/jetFinderHF.cxx +++ b/PWGJE/JetFinders/jetFinderHF.cxx @@ -45,7 +45,7 @@ void customize(std::vector& workflowOptions) // NB: runDataProcessing.h must be included after customize! #include "Framework/runDataProcessing.h" -template +template struct JetFinderHFTask { Produces jetsTable; Produces constituentsTable; @@ -169,15 +169,18 @@ struct JetFinderHFTask { aod::EMCALClusterDefinition clusterDefinition = aod::emcalcluster::getClusterDefinitionFromString(clusterDefinitionS.value); Filter collisionFilter = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centrality >= centralityMin && aod::jcollision::centrality < centralityMax && aod::jcollision::trackOccupancyInTimeRange <= trackOccupancyInTimeRangeMax); Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta >= trackEtaMin && aod::jtrack::eta <= trackEtaMax && aod::jtrack::phi >= trackPhiMin && aod::jtrack::phi <= trackPhiMax); - Filter trackSubCuts = (aod::jtracksub::pt >= trackPtMin && aod::jtracksub::pt < trackPtMax && aod::jtracksub::eta >= trackEtaMin && aod::jtracksub::eta <= trackEtaMax && aod::jtracksub::phi >= trackPhiMin && aod::jtracksub::phi <= trackPhiMax); Filter partCuts = (aod::jmcparticle::pt >= trackPtMin && aod::jmcparticle::pt < trackPtMax && aod::jmcparticle::eta >= trackEtaMin && aod::jmcparticle::eta <= trackEtaMax && aod::jmcparticle::phi >= trackPhiMin && aod::jmcparticle::phi <= trackPhiMax); Filter clusterFilter = (aod::jcluster::definition == static_cast(clusterDefinition) && aod::jcluster::eta >= clusterEtaMin && aod::jcluster::eta <= clusterEtaMax && aod::jcluster::phi >= clusterPhiMin && aod::jcluster::phi <= clusterPhiMax && aod::jcluster::energy >= clusterEnergyMin && aod::jcluster::time > clusterTimeMin && aod::jcluster::time < clusterTimeMax && (clusterRejectExotics && aod::jcluster::isExotic != true)); // Filter candidateCuts = (aod::hfcand::pt >= candPtMin && aod::hfcand::pt < candPtMax && aod::hfcand::y >= candYMin && aod::hfcand::y < candYMax); PresliceOptional> perD0Candidate = aod::bkgd0::candidateId; + PresliceOptional> perD0McCandidate = aod::bkgd0mc::candidateId; PresliceOptional> perLcCandidate = aod::bkglc::candidateId; + PresliceOptional> perLcMcCandidate = aod::bkglcmc::candidateId; PresliceOptional> perBplusCandidate = aod::bkgbplus::candidateId; + PresliceOptional> perBplusMcCandidate = aod::bkgbplusmc::candidateId; PresliceOptional> perDielectronCandidate = aod::bkgdielectron::candidateId; + PresliceOptional> perDielectronMcCandidate = aod::bkgdielectronmc::candidateId; // function that generalically processes Data and reco level events template @@ -208,7 +211,7 @@ struct JetFinderHFTask { } // function that generalically processes gen level events - template + template void analyseMCP(T const& collision, U const& particles, V const& candidate, int jetTypeParticleLevel, float minJetPt, float maxJetPt) { if (rejectIncorrectDecaysMCP && !jetcandidateutilities::isMatchedCandidate(candidate)) { // is this even needed in the new derived format? it means any simulations run have to force the decay channel @@ -219,7 +222,11 @@ struct JetFinderHFTask { if (!jetfindingutilities::analyseCandidate(inputParticles, candidate, candPtMin, candPtMax, candYMin, candYMax)) { return; } - jetfindingutilities::analyseParticles(inputParticles, particleSelection, jetTypeParticleLevel, particles, pdgDatabase, std::optional{candidate}); + if constexpr (checkIsDaughter) { + jetfindingutilities::analyseParticles(inputParticles, particleSelection, jetTypeParticleLevel, particles, pdgDatabase, std::optional{candidate}); + } else { + jetfindingutilities::analyseParticles(inputParticles, particleSelection, jetTypeParticleLevel, particles, pdgDatabase, std::optional{candidate}); + } jetfindingutilities::findJets(jetFinder, inputParticles, minJetPt, maxJetPt, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, registry.get(HIST("hJetMCP")), fillTHnSparse, true); } @@ -265,8 +272,18 @@ struct JetFinderHFTask { CandidateTableMCP const& candidates) { for (typename CandidateTableMCP::iterator const& candidate : candidates) { - analyseMCP(collision, particles, candidate, 1, jetPtMin, jetPtMax); + analyseMCP(collision, particles, candidate, 1, jetPtMin, jetPtMax); } } PROCESS_SWITCH(JetFinderHFTask, processChargedJetsMCP, "hf jet finding on MC particle level", false); + + void processChargedEvtWiseSubJetsMCP(aod::JetMcCollision const& collision, + soa::Filtered const& particles, + CandidateTableMCP const& candidates) + { + for (typename CandidateTableMCP::iterator const& candidate : candidates) { + analyseMCP(collision, jetcandidateutilities::slicedPerCandidate(particles, candidate, perD0McCandidate, perLcMcCandidate, perBplusMcCandidate, perDielectronMcCandidate), candidate, 1, jetPtMin, jetPtMax); + } + } + PROCESS_SWITCH(JetFinderHFTask, processChargedEvtWiseSubJetsMCP, "hf jet finding on MC particle level", false); }; diff --git a/PWGJE/JetFinders/jetFinderLcDataCharged.cxx b/PWGJE/JetFinders/jetFinderLcDataCharged.cxx index 808a3ebfa70..821cbd87df8 100644 --- a/PWGJE/JetFinders/jetFinderLcDataCharged.cxx +++ b/PWGJE/JetFinders/jetFinderLcDataCharged.cxx @@ -15,7 +15,7 @@ #include "PWGJE/JetFinders/jetFinderHF.cxx" -using JetFinderLcDataCharged = JetFinderHFTask; +using JetFinderLcDataCharged = JetFinderHFTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/JetFinders/jetFinderLcMCDCharged.cxx b/PWGJE/JetFinders/jetFinderLcMCDCharged.cxx index f125cd5ef23..c25f35c0efb 100644 --- a/PWGJE/JetFinders/jetFinderLcMCDCharged.cxx +++ b/PWGJE/JetFinders/jetFinderLcMCDCharged.cxx @@ -15,7 +15,7 @@ #include "PWGJE/JetFinders/jetFinderHF.cxx" -using JetFinderLcMCDetectorLevelCharged = JetFinderHFTask; +using JetFinderLcMCDetectorLevelCharged = JetFinderHFTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/JetFinders/jetFinderLcMCPCharged.cxx b/PWGJE/JetFinders/jetFinderLcMCPCharged.cxx index 7fcad36192b..41607ed57d9 100644 --- a/PWGJE/JetFinders/jetFinderLcMCPCharged.cxx +++ b/PWGJE/JetFinders/jetFinderLcMCPCharged.cxx @@ -15,7 +15,7 @@ #include "PWGJE/JetFinders/jetFinderHF.cxx" -using JetFinderLcMCParticleLevelCharged = JetFinderHFTask; +using JetFinderLcMCParticleLevelCharged = JetFinderHFTask; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/JetFinders/jetFinderV0.cxx b/PWGJE/JetFinders/jetFinderV0.cxx index 62e6f1635f2..4398a3b1a7a 100644 --- a/PWGJE/JetFinders/jetFinderV0.cxx +++ b/PWGJE/JetFinders/jetFinderV0.cxx @@ -179,7 +179,7 @@ struct JetFinderV0Task { if (!jetfindingutilities::analyseV0s(inputParticles, candidates, candPtMin, candPtMax, candYMin, candYMax, candIndex)) { return; } - jetfindingutilities::analyseParticles(inputParticles, particleSelection, jetTypeParticleLevel, particles, pdgDatabase, std::optional{candidates}); + jetfindingutilities::analyseParticles(inputParticles, particleSelection, jetTypeParticleLevel, particles, pdgDatabase, std::optional{candidates}); jetfindingutilities::findJets(jetFinder, inputParticles, minJetPt, maxJetPt, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, registry.get(HIST("hJetMCP")), fillTHnSparse, true); } diff --git a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx index 396888fe1a7..18b1249ed95 100644 --- a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx +++ b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx @@ -31,10 +31,15 @@ using namespace o2::framework::expressions; struct eventWiseConstituentSubtractorTask { Produces trackSubtractedTable; + Produces particleSubtractedTable; Produces trackSubtractedD0Table; + Produces particleSubtractedD0Table; Produces trackSubtractedLcTable; + Produces particleSubtractedLcTable; Produces trackSubtractedBplusTable; + Produces particleSubtractedBplusTable; Produces trackSubtractedDielectronTable; + Produces particleSubtractedDielectronTable; Configurable trackPtMin{"trackPtMin", 0.15, "minimum track pT"}; Configurable trackPtMax{"trackPtMax", 1000.0, "maximum track pT"}; @@ -45,6 +50,8 @@ struct eventWiseConstituentSubtractorTask { Configurable trackingEfficiency{"trackingEfficiency", 1.0, "tracking efficiency applied to jet finding"}; Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; + Configurable particleSelections{"particleSelections", "PhysicalPrimary", "set particle selections"}; + Configurable alpha{"alpha", 1.0, "exponent of transverse momentum in calculating the distance measure between pairs"}; Configurable rMax{"rMax", 0.24, "maximum distance of subtraction"}; Configurable eventEtaMax{"eventEtaMax", 0.9, "maximum pseudorapidity of event"}; @@ -56,9 +63,14 @@ struct eventWiseConstituentSubtractorTask { std::vector tracksSubtracted; int trackSelection = -1; + std::string particleSelection; + + Service pdgDatabase; + void init(o2::framework::InitContext&) { trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast(trackSelections)); + particleSelection = static_cast(particleSelections); eventWiseConstituentSubtractor.setDoRhoMassSub(doRhoMassSub); eventWiseConstituentSubtractor.setConstSubAlphaRMax(alpha, rMax); @@ -66,11 +78,11 @@ struct eventWiseConstituentSubtractorTask { } Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax && aod::jtrack::phi >= trackPhiMin && aod::jtrack::phi <= trackPhiMax); + Filter partCuts = (aod::jmcparticle::pt >= trackPtMin && aod::jmcparticle::pt < trackPtMax && aod::jmcparticle::eta >= trackEtaMin && aod::jmcparticle::eta <= trackEtaMax && aod::jmcparticle::phi >= trackPhiMin && aod::jmcparticle::phi <= trackPhiMax); template - void analyseHF(T const& tracks, U const& candidates, V& trackSubtractedTable) + void analyseHF(T const& tracks, U const& candidates, V& trackSubTable) { - for (auto& candidate : candidates) { inputParticles.clear(); tracksSubtracted.clear(); @@ -78,8 +90,22 @@ struct eventWiseConstituentSubtractorTask { tracksSubtracted = eventWiseConstituentSubtractor.JetBkgSubUtils::doEventConstSub(inputParticles, candidate.rho(), candidate.rhoM()); for (auto const& trackSubtracted : tracksSubtracted) { + trackSubTable(candidate.globalIndex(), trackSubtracted.pt(), trackSubtracted.eta(), trackSubtracted.phi(), jetderiveddatautilities::setSingleTrackSelectionBit(trackSelection)); + } + } + } - trackSubtractedTable(candidate.globalIndex(), trackSubtracted.pt(), trackSubtracted.eta(), trackSubtracted.phi(), trackSubtracted.E(), jetderiveddatautilities::setSingleTrackSelectionBit(trackSelection)); + template + void analyseHFMc(T const& particles, U const& candidates, V& particleSubTable) + { + for (auto& candidate : candidates) { + inputParticles.clear(); + tracksSubtracted.clear(); + jetfindingutilities::analyseParticles(inputParticles, particleSelection, 1, particles, pdgDatabase, std::optional{candidate}); // currently only works for charged analyses + + tracksSubtracted = eventWiseConstituentSubtractor.JetBkgSubUtils::doEventConstSub(inputParticles, candidate.rho(), candidate.rhoM()); + for (auto const& trackSubtracted : tracksSubtracted) { + particleSubTable(candidate.globalIndex(), trackSubtracted.pt(), trackSubtracted.eta(), trackSubtracted.phi(), trackSubtracted.rap(), trackSubtracted.e(), 211, 1, 1, 1); // everything after phi is artificial and should not be used for analyses } } } @@ -94,34 +120,73 @@ struct eventWiseConstituentSubtractorTask { tracksSubtracted = eventWiseConstituentSubtractor.JetBkgSubUtils::doEventConstSub(inputParticles, collision.rho(), collision.rhoM()); for (auto const& trackSubtracted : tracksSubtracted) { - trackSubtractedTable(collision.globalIndex(), trackSubtracted.pt(), trackSubtracted.eta(), trackSubtracted.phi(), trackSubtracted.E(), jetderiveddatautilities::setSingleTrackSelectionBit(trackSelection)); + trackSubtractedTable(collision.globalIndex(), trackSubtracted.pt(), trackSubtracted.eta(), trackSubtracted.phi(), jetderiveddatautilities::setSingleTrackSelectionBit(trackSelection)); } } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processCollisions, "Fill table of subtracted tracks for collisions", true); + void processMcCollisions(soa::Join::iterator const& mcCollision, soa::Filtered const& particles) + { + + inputParticles.clear(); + tracksSubtracted.clear(); + jetfindingutilities::analyseParticles, soa::Filtered::iterator>(inputParticles, particleSelection, 1, particles, pdgDatabase); + + tracksSubtracted = eventWiseConstituentSubtractor.JetBkgSubUtils::doEventConstSub(inputParticles, mcCollision.rho(), mcCollision.rhoM()); + + for (auto const& trackSubtracted : tracksSubtracted) { + particleSubtractedTable(mcCollision.globalIndex(), trackSubtracted.pt(), trackSubtracted.eta(), trackSubtracted.phi(), trackSubtracted.rap(), trackSubtracted.e(), 211, 1, 1, 1); // everything after phi is artificial and should not be used for analyses + } + } + PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processMcCollisions, "Fill table of subtracted tracks for Mc collisions", true); + void processD0Collisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { analyseHF(tracks, candidates, trackSubtractedD0Table); } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processD0Collisions, "Fill table of subtracted tracks for collisions with D0 candidates", false); + void processD0McCollisions(aod::JetMcCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) + { + analyseHFMc(tracks, candidates, particleSubtractedD0Table); + } + PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processD0McCollisions, "Fill table of subtracted tracks for collisions with D0 MCP candidates", false); + void processLcCollisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { analyseHF(tracks, candidates, trackSubtractedLcTable); } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processLcCollisions, "Fill table of subtracted tracks for collisions with Lc candidates", false); - void processBplusCollisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) + void processLcMcCollisions(aod::JetMcCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { - analyseHF(tracks, candidates, trackSubtractedBplusTable); + analyseHFMc(tracks, candidates, particleSubtractedLcTable); } - PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processBplusCollisions, "Fill table of subtracted tracks for collisions with Bplus candidates", false); + PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processLcMcCollisions, "Fill table of subtracted tracks for collisions with Lc MCP candidates", false); + /* + void processBplusCollisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) + { + analyseHF(tracks, candidates, trackSubtractedBplusTable); + } + PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processBplusCollisions, "Fill table of subtracted tracks for collisions with Bplus candidates", false); + void processBplusMcCollisions(aod::JetMcCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) + { + analyseHFMc(tracks, candidates, particleSubtractedBplusTable); + } + PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processBplusMcCollisions, "Fill table of subtracted tracks for collisions with Bplus MCP candidates", false); + */ void processDielectronCollisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { analyseHF(tracks, candidates, trackSubtractedDielectronTable); } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processDielectronCollisions, "Fill table of subtracted tracks for collisions with Dielectron candidates", false); + + void processDielectronMcCollisions(aod::JetMcCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) + { + analyseHFMc(tracks, candidates, particleSubtractedDielectronTable); + } + PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processDielectronMcCollisions, "Fill table of subtracted tracks for collisions with Dielectron MCP candidates", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"subtractor-eventwiseconstituent"})}; } diff --git a/PWGJE/TableProducer/rhoEstimator.cxx b/PWGJE/TableProducer/rhoEstimator.cxx index 8f7bd8afc0e..83429af3f5b 100644 --- a/PWGJE/TableProducer/rhoEstimator.cxx +++ b/PWGJE/TableProducer/rhoEstimator.cxx @@ -31,10 +31,15 @@ using namespace o2::framework::expressions; struct RhoEstimatorTask { Produces rhoChargedTable; + Produces rhoChargedMcTable; Produces rhoD0Table; + Produces rhoD0McTable; Produces rhoLcTable; + Produces rhoLcMcTable; Produces rhoBplusTable; + Produces rhoBplusMcTable; Produces rhoDielectronTable; + Produces rhoDielectronMcTable; Configurable trackPtMin{"trackPtMin", 0.15, "minimum track pT"}; Configurable trackPtMax{"trackPtMax", 1000.0, "maximum track pT"}; @@ -45,6 +50,8 @@ struct RhoEstimatorTask { Configurable trackingEfficiency{"trackingEfficiency", 1.0, "tracking efficiency applied to jet finding"}; Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; + Configurable particleSelections{"particleSelections", "PhysicalPrimary", "set particle selections"}; + Configurable bkgjetR{"bkgjetR", 0.2, "jet resolution parameter for determining background density"}; Configurable bkgEtaMin{"bkgEtaMin", -0.9, "minimim pseudorapidity for determining background density"}; Configurable bkgEtaMax{"bkgEtaMax", 0.9, "maximum pseudorapidity for determining background density"}; @@ -56,10 +63,14 @@ struct RhoEstimatorTask { float bkgPhiMax_; std::vector inputParticles; int trackSelection = -1; + std::string particleSelection; + + Service pdgDatabase; void init(o2::framework::InitContext&) { trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast(trackSelections)); + particleSelection = static_cast(particleSelections); bkgSub.setJetBkgR(bkgjetR); bkgSub.setEtaMinMax(bkgEtaMin, bkgEtaMax); @@ -70,6 +81,7 @@ struct RhoEstimatorTask { } Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax && aod::jtrack::phi >= trackPhiMin && aod::jtrack::phi <= trackPhiMax); + Filter partCuts = (aod::jmcparticle::pt >= trackPtMin && aod::jmcparticle::pt < trackPtMax && aod::jmcparticle::eta >= trackEtaMin && aod::jmcparticle::eta <= trackEtaMax && aod::jmcparticle::phi >= trackPhiMin && aod::jmcparticle::phi <= trackPhiMax); void processChargedCollisions(aod::JetCollision const& /*collision*/, soa::Filtered const& tracks) { @@ -80,6 +92,15 @@ struct RhoEstimatorTask { } PROCESS_SWITCH(RhoEstimatorTask, processChargedCollisions, "Fill rho tables for collisions using charged tracks", true); + void processChargedMcCollisions(aod::JetMcCollision const& /*mcCollision*/, soa::Filtered const& particles) + { + inputParticles.clear(); + jetfindingutilities::analyseParticles, soa::Filtered::iterator>(inputParticles, particleSelection, 1, particles, pdgDatabase); + auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); + rhoChargedMcTable(rho, rhoM); + } + PROCESS_SWITCH(RhoEstimatorTask, processChargedMcCollisions, "Fill rho tables for MC collisions using charged tracks", true); + void processD0Collisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesD0Data const& candidates) { inputParticles.clear(); @@ -93,6 +114,19 @@ struct RhoEstimatorTask { } PROCESS_SWITCH(RhoEstimatorTask, processD0Collisions, "Fill rho tables for collisions with D0 candidates", false); + void processD0McCollisions(aod::JetMcCollision const&, soa::Filtered const& particles, aod::CandidatesD0MCP const& candidates) + { + inputParticles.clear(); + for (auto& candidate : candidates) { + inputParticles.clear(); + jetfindingutilities::analyseParticles(inputParticles, particleSelection, 1, particles, pdgDatabase, std::optional{candidate}); + + auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); + rhoD0McTable(rho, rhoM); + } + } + PROCESS_SWITCH(RhoEstimatorTask, processD0McCollisions, "Fill rho tables for collisions with D0 MCP candidates", false); + void processLcCollisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesLcData const& candidates) { inputParticles.clear(); @@ -106,19 +140,45 @@ struct RhoEstimatorTask { } PROCESS_SWITCH(RhoEstimatorTask, processLcCollisions, "Fill rho tables for collisions with Lc candidates", false); - void processBplusCollisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesBplusData const& candidates) + void processLcMcCollisions(aod::JetMcCollision const&, soa::Filtered const& particles, aod::CandidatesLcMCP const& candidates) { inputParticles.clear(); for (auto& candidate : candidates) { inputParticles.clear(); - jetfindingutilities::analyseTracks(inputParticles, tracks, trackSelection, trackingEfficiency, std::optional{candidate}); + jetfindingutilities::analyseParticles(inputParticles, particleSelection, 1, particles, pdgDatabase, std::optional{candidate}); auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); - rhoBplusTable(rho, rhoM); + rhoLcMcTable(rho, rhoM); } } - PROCESS_SWITCH(RhoEstimatorTask, processBplusCollisions, "Fill rho tables for collisions with Bplus candidates", false); + PROCESS_SWITCH(RhoEstimatorTask, processLcMcCollisions, "Fill rho tables for collisions with Lc MCP candidates", false); + /* + void processBplusCollisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesBplusData const& candidates) + { + inputParticles.clear(); + for (auto& candidate : candidates) { + inputParticles.clear(); + jetfindingutilities::analyseTracks(inputParticles, tracks, trackSelection, trackingEfficiency, std::optional{candidate}); + + auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); + rhoBplusTable(rho, rhoM); + } + } + PROCESS_SWITCH(RhoEstimatorTask, processBplusCollisions, "Fill rho tables for collisions with Bplus candidates", false); + void processBplusMcCollisions(aod::JetMcCollision const&, soa::Filtered const& particles, aod::CandidatesBplusMCP const& candidates) + { + inputParticles.clear(); + for (auto& candidate : candidates) { + inputParticles.clear(); + jetfindingutilities::analyseParticles(inputParticles, particleSelection, 1, particles, pdgDatabase, std::optional{candidate}); + + auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); + rhoBplusMcTable(rho, rhoM); + } + } + PROCESS_SWITCH(RhoEstimatorTask, processBplusMcCollisions, "Fill rho tables for collisions with Bplus MCP candidates", false); + */ void processDielectronCollisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesDielectronData const& candidates) { inputParticles.clear(); @@ -131,6 +191,19 @@ struct RhoEstimatorTask { } } PROCESS_SWITCH(RhoEstimatorTask, processDielectronCollisions, "Fill rho tables for collisions with Dielectron candidates", false); + + void processDielectronMcCollisions(aod::JetMcCollision const&, soa::Filtered const& particles, aod::CandidatesDielectronMCP const& candidates) + { + inputParticles.clear(); + for (auto& candidate : candidates) { + inputParticles.clear(); + jetfindingutilities::analyseParticles(inputParticles, particleSelection, 1, particles, pdgDatabase, std::optional{candidate}); + + auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); + rhoDielectronMcTable(rho, rhoM); + } + } + PROCESS_SWITCH(RhoEstimatorTask, processDielectronMcCollisions, "Fill rho tables for collisions with Dielectron MCP candidates", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"estimator-rho"})}; } diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index 1268efb425b..a05c1d80524 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -270,7 +270,6 @@ struct Jetchargedv2Task { Preslice tracksPerJCollision = o2::aod::jtrack::collisionId; Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); - Filter trackSubCuts = (aod::jtracksub::pt >= trackPtMin && aod::jtracksub::pt < trackPtMax && aod::jtracksub::eta > trackEtaMin && aod::jtracksub::eta < trackEtaMax); Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centrality >= centralityMin && aod::jcollision::centrality < centralityMax); template diff --git a/PWGJE/Tasks/jetFinderHFQA.cxx b/PWGJE/Tasks/jetFinderHFQA.cxx index 832cdb3305c..36cf4d149d8 100644 --- a/PWGJE/Tasks/jetFinderHFQA.cxx +++ b/PWGJE/Tasks/jetFinderHFQA.cxx @@ -480,7 +480,6 @@ struct JetFinderHFQATask { using JetTableMCPMatchedWeightedJoined = soa::Join; Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); - Filter trackSubCuts = (aod::jtracksub::pt >= trackPtMin && aod::jtracksub::pt < trackPtMax && aod::jtracksub::eta > trackEtaMin && aod::jtracksub::eta < trackEtaMax); Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centrality >= centralityMin && aod::jcollision::centrality < centralityMax); // Filter candidateCutsD0 = (aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar); diff --git a/PWGJE/Tasks/jetFinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx index efb303fbea8..67806db1115 100644 --- a/PWGJE/Tasks/jetFinderQA.cxx +++ b/PWGJE/Tasks/jetFinderQA.cxx @@ -326,7 +326,6 @@ struct JetFinderQATask { } Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); - Filter trackSubCuts = (aod::jtracksub::pt >= trackPtMin && aod::jtracksub::pt < trackPtMax && aod::jtracksub::eta > trackEtaMin && aod::jtracksub::eta < trackEtaMax); Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centrality >= centralityMin && aod::jcollision::centrality < centralityMax); PresliceUnsorted> CollisionsPerMCPCollision = aod::jmccollisionlb::mcCollisionId; diff --git a/PWGJE/Tasks/jetFinderV0QA.cxx b/PWGJE/Tasks/jetFinderV0QA.cxx index b901db5d61d..362239cf8e1 100644 --- a/PWGJE/Tasks/jetFinderV0QA.cxx +++ b/PWGJE/Tasks/jetFinderV0QA.cxx @@ -164,7 +164,6 @@ struct JetFinderV0QATask { using JetTableMCPMatchedWeightedJoined = soa::Join; Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); - Filter trackSubCuts = (aod::jtracksub::pt >= trackPtMin && aod::jtracksub::pt < trackPtMax && aod::jtracksub::eta > trackEtaMin && aod::jtracksub::eta < trackEtaMax); Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centrality >= centralityMin && aod::jcollision::centrality < centralityMax); template From 8d76ed4d12ba4552db342a0ead7e637117da2181 Mon Sep 17 00:00:00 2001 From: Roberta Ferioli <142217183+Roberta-Ferioli@users.noreply.github.com> Date: Thu, 28 Nov 2024 07:23:15 +0100 Subject: [PATCH 148/459] [PWGLF] Add MotherPDG and flag for ambiguous tracks (#8666) Co-authored-by: ALICE Action Bot --- PWGLF/DataModel/LFSlimNucleiTables.h | 2 ++ PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/PWGLF/DataModel/LFSlimNucleiTables.h b/PWGLF/DataModel/LFSlimNucleiTables.h index 19c42ed12f9..2ceba88be7d 100644 --- a/PWGLF/DataModel/LFSlimNucleiTables.h +++ b/PWGLF/DataModel/LFSlimNucleiTables.h @@ -48,6 +48,7 @@ DECLARE_SOA_COLUMN(gPt, genPt, float); DECLARE_SOA_COLUMN(gEta, genEta, float); DECLARE_SOA_COLUMN(gPhi, genPhi, float); DECLARE_SOA_COLUMN(PDGcode, pdgCode, int); +DECLARE_SOA_COLUMN(MotherPDGcode, MotherpdgCode, int); DECLARE_SOA_COLUMN(SurvivedEventSelection, survivedEventSelection, bool); DECLARE_SOA_COLUMN(AbsoDecL, absoDecL, float); @@ -127,6 +128,7 @@ DECLARE_SOA_TABLE(NucleiTableMC, "AOD", "NUCLEITABLEMC", NucleiTableNS::gEta, NucleiTableNS::gPhi, NucleiTableNS::PDGcode, + NucleiTableNS::MotherPDGcode, NucleiTableNS::SurvivedEventSelection, NucleiTableNS::AbsoDecL); diff --git a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx index 82477987971..503dc2fb0b3 100644 --- a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx @@ -831,12 +831,16 @@ struct nucleiSpectra { if (particle.mcCollisionId() == collMCGlobId) { c.correctPV = true; } + if (!c.correctPV) { + c.flags |= kIsAmbiguous; + } if (!particle.isPhysicalPrimary()) { c.isSecondary = true; if (particle.getProcess() == 4) { c.fromWeakDecay = true; } } + if (c.fillDCAHist && cfgDCAHists->get(iS, c.pt < 0)) { nuclei::hDCAHists[c.pt < 0][iS]->Fill(std::abs(c.pt), c.DCAxy, c.DCAz, c.nSigmaTPC[iS], c.tofMasses[iS], c.ITSnCls, c.TPCnCls, c.correctPV, c.isSecondary, c.fromWeakDecay); } @@ -845,16 +849,20 @@ struct nucleiSpectra { if (!storeIt) { continue; } + int MotherpdgCode = 0; isReconstructed[particle.globalIndex()] = true; if (particle.isPhysicalPrimary()) { c.flags |= kIsPhysicalPrimary; } else if (particle.has_mothers()) { c.flags |= kIsSecondaryFromWeakDecay; + for (auto& motherparticle : particle.mothers_as()) { + MotherpdgCode = motherparticle.pdgCode(); + } } else { c.flags |= kIsSecondaryFromMaterial; } float absoDecL = computeAbsoDecL(particle); - nucleiTableMC(c.pt, c.eta, c.phi, c.tpcInnerParam, c.beta, c.zVertex, c.DCAxy, c.DCAz, c.TPCsignal, c.ITSchi2, c.TPCchi2, c.TOFchi2, c.flags, c.TPCfindableCls, c.TPCcrossedRows, c.ITSclsMap, c.TPCnCls, c.TPCnClsShared, c.clusterSizesITS, particle.pt(), particle.eta(), particle.phi(), particle.pdgCode(), goodCollisions[particle.mcCollisionId()], absoDecL); + nucleiTableMC(c.pt, c.eta, c.phi, c.tpcInnerParam, c.beta, c.zVertex, c.DCAxy, c.DCAz, c.TPCsignal, c.ITSchi2, c.TPCchi2, c.TOFchi2, c.flags, c.TPCfindableCls, c.TPCcrossedRows, c.ITSclsMap, c.TPCnCls, c.TPCnClsShared, c.clusterSizesITS, particle.pt(), particle.eta(), particle.phi(), particle.pdgCode(), MotherpdgCode, goodCollisions[particle.mcCollisionId()], absoDecL); } int index{0}; @@ -875,7 +883,7 @@ struct nucleiSpectra { if (!isReconstructed[index] && (cfgTreeConfig->get(iS, 0u) || cfgTreeConfig->get(iS, 1u))) { float absDecL = computeAbsoDecL(particle); - nucleiTableMC(999., 999., 999., 0., 0., 999., 999., 999., -1, -1, -1, -1, flags, 0, 0, 0, 0, 0, 0, particle.pt(), particle.eta(), particle.phi(), particle.pdgCode(), goodCollisions[particle.mcCollisionId()], absDecL); + nucleiTableMC(999., 999., 999., 0., 0., 999., 999., 999., -1, -1, -1, -1, flags, 0, 0, 0, 0, 0, 0, particle.pt(), particle.eta(), particle.phi(), particle.pdgCode(), 0, goodCollisions[particle.mcCollisionId()], absDecL); } break; } From 222d72040b697e56a2237401a1724874686a0e71 Mon Sep 17 00:00:00 2001 From: Phil Stahlhut <138057549+pstahlhu@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:22:45 +0100 Subject: [PATCH 149/459] [PWGHF] Update XicToXiPiPi workflow (#8695) Co-authored-by: pstahlhu --- PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx | 110 ++++--- .../DataModel/CandidateReconstructionTables.h | 51 +++- .../candidateCreatorXicToXiPiPi.cxx | 178 ++++++++--- .../candidateSelectorXicToXiPiPi.cxx | 8 +- .../TableProducer/treeCreatorXicToXiPiPi.cxx | 278 ++++++++++-------- 5 files changed, 373 insertions(+), 252 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx index 726bf86d77d..58341c78b3d 100644 --- a/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx +++ b/PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx @@ -68,12 +68,7 @@ struct HfTaskXicToXiPiPi { Filter filterSelectCandidates = (aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= selectionFlagXic); - HistogramRegistry registry{ - "registry", - {{"hPtCand", "#Xi^{#plus}_{c} candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{400, 0., 40.}}}}, - {"hPtProng0", "#Xi^{#plus}_{c} candidates;prong 0 (#Xi^{#minus}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{300, 0., 30.}}}}, - {"hPtProng1", "#Xi^{#plus}_{c} candidates;prong 1 (#pi^{#plus}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 20.}}}}, - {"hPtProng2", "#Xi^{#plus}_{c} candidates;prong 2 (#pi^{#plus}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 20.}}}}}}; + HistogramRegistry registry{"registry"}; void init(InitContext const&) { @@ -89,7 +84,7 @@ struct HfTaskXicToXiPiPi { } static const AxisSpec axisMassXic = {300, 1.8, 3.0, "inv. mass (GeV/#it{c}^{2})"}; - static const AxisSpec axisMassXiRes = {300, 1.0, 2.0, "inv. mass (GeV/#it{c}^{2})"}; + static const AxisSpec axisMassXiRes = {300, 1.4, 2.7, "inv. mass (GeV/#it{c}^{2})"}; static const AxisSpec axisPt = {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}; static const AxisSpec axisDecLength = {binsDecLength}; static const AxisSpec axisErrDecLength = {binsErrDecLength}; @@ -98,44 +93,49 @@ struct HfTaskXicToXiPiPi { static const AxisSpec axisSV = {binsSV}; static const AxisSpec axisChi2 = {binsChi2}; - // candidate - registry.add("hPt", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 20.}}}); - registry.add("hEta", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, axisPt}}); - registry.add("hRapidity", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate #it{y};entries", {HistType::kTH2F, {{100, -2., 2.}, axisPt}}); - registry.add("hCPA", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, axisPt}}); - registry.add("hCPAxy", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, axisPt}}); - registry.add("hMass", "#Xi^{#plus}_{c} candidates;inv. mass #Xi^{#mp} #pi^{#pm} #pi^{#pm} (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisMassXic, axisPt}}); - registry.add("hDecLength", "#Xi^{#plus}_{c} candidates;decay length (cm);entries", {HistType::kTH2F, {axisDecLength, axisPt}}); - registry.add("hErrDecLength", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate decay length error (cm);entries", {HistType::kTH2F, {axisErrDecLength, axisPt}}); - registry.add("hDecLengthXY", "#Xi^{#plus}_{c} candidates;decay length xy (cm);entries", {HistType::kTH2F, {axisDecLength, axisPt}}); - registry.add("hErrDecLengthXY", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate decay length xy error (cm);entries", {HistType::kTH2F, {axisErrDecLength, axisPt}}); - registry.add("hSVx", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate secondary vertex position x (cm);entries", {HistType::kTH2F, {axisSV, axisPt}}); - registry.add("hSVy", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate secondary vertex position y (cm);entries", {HistType::kTH2F, {axisSV, axisPt}}); - registry.add("hSVz", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate secondary vertex position z (cm);entries", {HistType::kTH2F, {axisSV, axisPt}}); - // daughters - registry.add("hCPAXi", "#Xi^{#plus}_{c} candidates;#Xi^{#minus} candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, axisPt}}); - registry.add("hCPAxyXi", "#Xi^{#plus}_{c} candidates;#Xi^{#minus} candidate cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, axisPt}}); - registry.add("hCPALambda", "#Xi^{#plus}_{c} candidates;#Lambda candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, axisPt}}); - registry.add("hCPAxyLambda", "#Xi^{#plus}_{c} candidates;#Lambda candidate cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, axisPt}}); - registry.add("hPtProng0vsPt", "#Xi^{#plus}_{c} candidates;#Xi^{#mp} #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{200, 0., 20.}, axisPt}}); - registry.add("hPtProng1vsPt", "#Xi^{#plus}_{c} candidates;prong 1 (#pi^{#pm}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{200, 0., 20.}, axisPt}}); - registry.add("hPtProng2vsPt", "#Xi^{#plus}_{c} candidates;prong 2 (#pi^{#pm}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{200, 0., 20.}, axisPt}}); - registry.add("hd0Prong0", "#Xi^{#plus}_{c} candidates;prong 0 (#Xi^{#mp}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisDCA, axisPt}}); - registry.add("hd0Prong1", "#Xi^{#plus}_{c} candidates;prong 1 (#pi^{#pm}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisDCA, axisPt}}); - registry.add("hd0Prong2", "#Xi^{#plus}_{c} candidates;prong 2 (#pi^{#pm}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisDCA, axisPt}}); - registry.add("hImpParErr", "#Xi^{#plus}_{c} candidates;prongs impact parameter error (cm);entries", {HistType::kTH2F, {axisImpParErr, axisPt}}); - registry.add("hChi2PCA", "#Xi^{#plus}_{c} candidates (matched);sum of distances of the secondary vertex to its prongs;entries", {HistType::kTH2F, {{240, -0.01, 0.5}, axisPt}}); - registry.add("hMassXiPi1", "#Xi^{#plus}_{c} candidates;inv. mass #Xi^{#mp} #pi^{#pm} (prong 1) (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisMassXiRes, axisPt}}); - registry.add("hMassXiPi2", "#Xi^{#plus}_{c} candidates;inv. mass #Xi^{#mp} #pi^{#pm} (prong 2) (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisMassXiRes, axisPt}}); - - if (doprocessWithKFParticle || doprocessWithKFParticleAndML) { - registry.add("hChi2geoXi", "#Xi^{#plus}_{c} candidates;#Xi^{#mp} #chi^{2}_{geo};entries", {HistType::kTH2F, {axisChi2, axisPt}}); - registry.add("hChi2geoLam", "#Xi^{#plus}_{c} candidates;#Lambda #chi^{2}_{geo};entries", {HistType::kTH2F, {axisChi2, axisPt}}); - registry.add("hChi2topoToPV", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate #chi^{2}_{topo} to PV;entries", {HistType::kTH2F, {axisChi2, axisPt}}); - registry.add("hChi2topoXiToXicPlus", "#Xi^{#plus}_{c} candidates;#Xi^{#mp} candidate #chi^{2}_{topo} to #Xi^{#plus}_{c};entries", {HistType::kTH2F, {axisChi2, axisPt}}); + if (doprocessWithDCAFitter || doprocessWithKFParticle || doprocessWithDCAFitterAndML || doprocessWithKFParticleAndML) { + // candidate + registry.add("hPt", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{400, 0., 40.}}}); + registry.add("hEta", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, axisPt}}); + registry.add("hRapidity", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate #it{y};entries", {HistType::kTH2F, {{100, -2., 2.}, axisPt}}); + registry.add("hCPA", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, axisPt}}); + registry.add("hCPAxy", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, axisPt}}); + registry.add("hMass", "#Xi^{#plus}_{c} candidates;inv. mass #Xi^{#mp} #pi^{#pm} #pi^{#pm} (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisMassXic, axisPt}}); + registry.add("hDecLength", "#Xi^{#plus}_{c} candidates;decay length (cm);entries", {HistType::kTH2F, {axisDecLength, axisPt}}); + registry.add("hErrDecLength", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate decay length error (cm);entries", {HistType::kTH2F, {axisErrDecLength, axisPt}}); + registry.add("hDecLengthXY", "#Xi^{#plus}_{c} candidates;decay length xy (cm);entries", {HistType::kTH2F, {axisDecLength, axisPt}}); + registry.add("hErrDecLengthXY", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate decay length xy error (cm);entries", {HistType::kTH2F, {axisErrDecLength, axisPt}}); + registry.add("hSVx", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate secondary vertex position x (cm);entries", {HistType::kTH2F, {axisSV, axisPt}}); + registry.add("hSVy", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate secondary vertex position y (cm);entries", {HistType::kTH2F, {axisSV, axisPt}}); + registry.add("hSVz", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate secondary vertex position z (cm);entries", {HistType::kTH2F, {axisSV, axisPt}}); + // daughters + registry.add("hPtProng0", "#Xi^{#plus}_{c} candidates;prong 0 (#Xi^{#mp}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 20.}}}); + registry.add("hPtProng1", "#Xi^{#plus}_{c} candidates;prong 1 (#pi^{#plus}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 20.}}}); + registry.add("hPtProng2", "#Xi^{#plus}_{c} candidates;prong 2 (#pi^{#plus}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 20.}}}); + registry.add("hPtProng0vsPt", "#Xi^{#plus}_{c} candidates;prong 0 (#Xi^{#mp}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{200, 0., 20.}, axisPt}}); + registry.add("hPtProng1vsPt", "#Xi^{#plus}_{c} candidates;prong 1 (#pi^{#pm}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{200, 0., 20.}, axisPt}}); + registry.add("hPtProng2vsPt", "#Xi^{#plus}_{c} candidates;prong 2 (#pi^{#pm}) #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH2F, {{200, 0., 20.}, axisPt}}); + registry.add("hCPAXi", "#Xi^{#plus}_{c} candidates;#Xi^{#minus} candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, axisPt}}); + registry.add("hCPAxyXi", "#Xi^{#plus}_{c} candidates;#Xi^{#minus} candidate cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, axisPt}}); + registry.add("hCPALambda", "#Xi^{#plus}_{c} candidates;#Lambda candidate cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, axisPt}}); + registry.add("hCPAxyLambda", "#Xi^{#plus}_{c} candidates;#Lambda candidate cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, axisPt}}); + registry.add("hd0Prong0", "#Xi^{#plus}_{c} candidates;prong 0 (#Xi^{#mp}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisDCA, axisPt}}); + registry.add("hd0Prong1", "#Xi^{#plus}_{c} candidates;prong 1 (#pi^{#pm}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisDCA, axisPt}}); + registry.add("hd0Prong2", "#Xi^{#plus}_{c} candidates;prong 2 (#pi^{#pm}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisDCA, axisPt}}); + registry.add("hImpParErr", "#Xi^{#plus}_{c} candidates;prongs impact parameter error (cm);entries", {HistType::kTH2F, {axisImpParErr, axisPt}}); + registry.add("hChi2PCA", "#Xi^{#plus}_{c} candidates (matched);sum of distances of the secondary vertex to its prongs;entries", {HistType::kTH2F, {{240, -0.01, 0.5}, axisPt}}); + registry.add("hMassXiPi1", "#Xi^{#plus}_{c} candidates;inv. mass #Xi^{#mp} #pi^{#pm} (prong 1) (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisMassXiRes, axisPt}}); + registry.add("hMassXiPi2", "#Xi^{#plus}_{c} candidates;inv. mass #Xi^{#mp} #pi^{#pm} (prong 2) (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisMassXiRes, axisPt}}); + // KFParticle + if (doprocessWithKFParticle || doprocessWithKFParticleAndML) { + registry.add("hChi2geoXi", "#Xi^{#plus}_{c} candidates;#Xi^{#mp} #chi^{2}_{geo};entries", {HistType::kTH2F, {axisChi2, axisPt}}); + registry.add("hChi2geoLam", "#Xi^{#plus}_{c} candidates;#Lambda #chi^{2}_{geo};entries", {HistType::kTH2F, {axisChi2, axisPt}}); + registry.add("hChi2topoToPV", "#Xi^{#plus}_{c} candidates;#Xi^{#plus}_{c} candidate #chi^{2}_{topo} to PV;entries", {HistType::kTH2F, {axisChi2, axisPt}}); + registry.add("hChi2topoXiToXicPlus", "#Xi^{#plus}_{c} candidates;#Xi^{#mp} candidate #chi^{2}_{topo} to #Xi^{#plus}_{c};entries", {HistType::kTH2F, {axisChi2, axisPt}}); + } } - if (doprocessMcWithKFParticle || doprocessMcWithDCAFitter || doprocessMcWithKFParticleAndML || doprocessMcWithDCAFitterAndML) { + if (doprocessMcWithDCAFitter || doprocessMcWithKFParticle || doprocessMcWithDCAFitterAndML || doprocessMcWithKFParticleAndML) { // MC reconstructed registry.add("hPtGenSig", "#Xi^{#plus}_{c} candidates (gen+rec);candidate #it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{300, 0., 30.}}}); registry.add("hPtRecSig", "#Xi^{#plus}_{c} candidates (matched);candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{300, 0., 30.}}}); @@ -198,8 +198,8 @@ struct HfTaskXicToXiPiPi { registry.add("hMassXiPi1RecBg", "#Xi^{#plus}_{c} candidates (unmatched);inv. mass #Xi^{#mp} #pi^{#pm} (prong 1) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{300, 1.0, 2.0}, axisPt}}); registry.add("hMassXiPi2RecSig", "#Xi^{#plus}_{c} candidates (matched);inv. mass #Xi^{#mp} #pi^{#pm} (prong 2) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{300, 1.0, 2.0}, axisPt}}); registry.add("hMassXiPi2RecBg", "#Xi^{#plus}_{c} candidates (unmatched);inv. mass #Xi^{#mp} #pi^{#pm} (prong 2) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{300, 1.0, 2.0}, axisPt}}); - - if (doprocessMcWithKFParticle || doprocessMcWithDCAFitterAndML) { + // MC reconstructed with KFParticle + if (doprocessMcWithKFParticle || doprocessMcWithKFParticleAndML) { registry.add("hChi2topoToPVRecSig", "#Xi^{#plus}_{c} candidates (matched);#Xi^{#plus}_{c} candidate #chi^{2}_{topo} to PV;entries", {HistType::kTH2F, {axisChi2, axisPt}}); registry.add("hChi2topoToPVRecBg", "#Xi^{#plus}_{c} candidates (unmatched);#Xi^{#plus}_{c} candidate #chi^{2}_{topo} to PV;entries", {HistType::kTH2F, {axisChi2, axisPt}}); registry.add("hChi2geoXiRecSig", "#Xi^{#plus}_{c} candidates (matched);#Xi^{#mp} #chi^{2}_{geo};entries", {HistType::kTH2F, {axisChi2, axisPt}}); @@ -209,7 +209,6 @@ struct HfTaskXicToXiPiPi { registry.add("hChi2topoXiToXicPlusRecSig", "#Xi^{#plus}_{c} candidates (matched);#Xi^{#mp} candidate #chi^{2}_{topo} to #Xi^{#plus}_{c};entries", {HistType::kTH2F, {axisChi2, axisPt}}); registry.add("hChi2topoXiToXicPlusRecBg", "#Xi^{#plus}_{c} candidates (unmatched);#Xi^{#mp} candidate #chi^{2}_{topo} to #Xi^{#plus}_{c};entries", {HistType::kTH2F, {axisChi2, axisPt}}); } - // MC generated registry.add("hPtProng0Gen", "MC particles (generated);prong 0 (#Xi^{#mp}) #it{p}_{T}^{gen} (GeV/#it{c});entries", {HistType::kTH2F, {{300, 0., 30.}, axisPt}}); registry.add("hPtProng1Gen", "MC particles (generated);prong 1 (#pi^{#pm}) #it{p}_{T}^{gen} (GeV/#it{c});entries", {HistType::kTH2F, {{200, 0., 20.}, axisPt}}); @@ -262,7 +261,6 @@ struct HfTaskXicToXiPiPi { registry.add("hXicToXiPiPiVars", "THnSparse for Xic", HistType::kTHnSparseF, {thnAxisPt, thnAxisMass, thnAxisChi2PCA, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA}); } } // enable THnSpare - } // end init /// Fill THnSpare depending on whether ML selection is used @@ -282,10 +280,10 @@ struct HfTaskXicToXiPiPi { outputBkg = candidate.mlProbXicToXiPiPi()[0]; outputPrompt = candidate.mlProbXicToXiPiPi()[1]; } - registry.get(HIST("hXicToXiPiPiVarsWithML"))->Fill(candidate.pt(), candidate.invMassXic(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa(), outputBkg, outputPrompt); + registry.get(HIST("hXicToXiPiPiVarsWithML"))->Fill(candidate.pt(), candidate.invMassXicPlus(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa(), outputBkg, outputPrompt); } else { // without ML information - registry.get(HIST("hXicToXiPiPiVars"))->Fill(candidate.pt(), candidate.invMassXic(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa()); + registry.get(HIST("hXicToXiPiPiVars"))->Fill(candidate.pt(), candidate.invMassXicPlus(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa()); } } @@ -311,7 +309,7 @@ struct HfTaskXicToXiPiPi { auto ptCandXic = candidate.pt(); - registry.fill(HIST("hPtCand"), ptCandXic); + registry.fill(HIST("hPt"), ptCandXic); registry.fill(HIST("hPtProng0"), candidate.ptProng0()); registry.fill(HIST("hPtProng1"), candidate.ptProng1()); registry.fill(HIST("hPtProng2"), candidate.ptProng2()); @@ -319,7 +317,7 @@ struct HfTaskXicToXiPiPi { registry.fill(HIST("hRapidity"), yCandXic, ptCandXic); registry.fill(HIST("hCPA"), candidate.cpa(), ptCandXic); registry.fill(HIST("hCPAxy"), candidate.cpaXY(), ptCandXic); - registry.fill(HIST("hMass"), candidate.invMassXic(), ptCandXic); + registry.fill(HIST("hMass"), candidate.invMassXicPlus(), ptCandXic); registry.fill(HIST("hDecLength"), candidate.decayLength(), ptCandXic); registry.fill(HIST("hErrDecLength"), candidate.errorDecayLength(), ptCandXic); registry.fill(HIST("hDecLengthXY"), candidate.decayLengthXY(), ptCandXic); @@ -400,7 +398,7 @@ struct HfTaskXicToXiPiPi { registry.fill(HIST("hSVzRecSig"), candidate.zSecondaryVertex(), ptCandXic); registry.fill(HIST("hCPARecSig"), candidate.cpa(), ptCandXic); registry.fill(HIST("hCPAxyRecSig"), candidate.cpaXY(), ptCandXic); - registry.fill(HIST("hMassRecSig"), candidate.invMassXic(), ptCandXic); + registry.fill(HIST("hMassRecSig"), candidate.invMassXicPlus(), ptCandXic); registry.fill(HIST("hDecLengthRecSig"), candidate.decayLength(), ptCandXic); registry.fill(HIST("hErrDecLengthRecSig"), candidate.errorDecayLength(), ptCandXic); registry.fill(HIST("hDecLengthXYRecSig"), candidate.decayLengthXY(), ptCandXic); @@ -439,7 +437,7 @@ struct HfTaskXicToXiPiPi { registry.fill(HIST("hSVzRecBg"), candidate.zSecondaryVertex(), ptCandXic); registry.fill(HIST("hCPARecBg"), candidate.cpa(), ptCandXic); registry.fill(HIST("hCPAxyRecBg"), candidate.cpaXY(), ptCandXic); - registry.fill(HIST("hMassRecBg"), candidate.invMassXic(), ptCandXic); + registry.fill(HIST("hMassRecBg"), candidate.invMassXicPlus(), ptCandXic); registry.fill(HIST("hDecLengthRecBg"), candidate.decayLength(), ptCandXic); registry.fill(HIST("hErrDecLengthRecBg"), candidate.errorDecayLength(), ptCandXic); registry.fill(HIST("hDecLengthXYRecBg"), candidate.decayLengthXY(), ptCandXic); @@ -467,11 +465,11 @@ struct HfTaskXicToXiPiPi { if (checkDecayTypeMc) { if (TESTBIT(flagMcMatchRecXic, hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiPiPi)) { - registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiPiPi, candidate.invMassXic(), ptCandXic); + registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiPiPi, candidate.invMassXicPlus(), ptCandXic); } else if (TESTBIT(flagMcMatchRecXic, hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiResPiToXiPiPi)) { - registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiResPiToXiPiPi, candidate.invMassXic(), ptCandXic); + registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiResPiToXiPiPi, candidate.invMassXicPlus(), ptCandXic); } else { - registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_xic_to_xi_pi_pi::DecayType::NDecayType, candidate.invMassXic(), ptCandXic); + registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_xic_to_xi_pi_pi::DecayType::NDecayType, candidate.invMassXicPlus(), ptCandXic); } } // fill THnSparse diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 4948571afe2..15647b2ca9a 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -1502,20 +1502,20 @@ DECLARE_SOA_COLUMN(ZPvErr, zPvErr, float); DECLARE_SOA_COLUMN(XSvErr, xSvErr, float); DECLARE_SOA_COLUMN(YSvErr, ySvErr, float); DECLARE_SOA_COLUMN(ZSvErr, zSvErr, float); -DECLARE_SOA_COLUMN(XDecayVtxXi, xDecayVtxXi, float); -DECLARE_SOA_COLUMN(YDecayVtxXi, yDecayVtxXi, float); -DECLARE_SOA_COLUMN(ZDecayVtxXi, zDecayVtxXi, float); -DECLARE_SOA_COLUMN(XDecayVtxLambda, xDecayVtxLambda, float); -DECLARE_SOA_COLUMN(YDecayVtxLambda, yDecayVtxLambda, float); -DECLARE_SOA_COLUMN(ZDecayVtxLambda, zDecayVtxLambda, float); DECLARE_SOA_COLUMN(CosPaXi, cosPaXi, float); DECLARE_SOA_COLUMN(CosPaXYXi, cosPaXYXi, float); DECLARE_SOA_COLUMN(CosPaLambda, cosPaLambda, float); DECLARE_SOA_COLUMN(CosPaXYLambda, cosPaXYLambda, float); -DECLARE_SOA_COLUMN(InvMassXic, invMassXic, float); +DECLARE_SOA_COLUMN(CosPaLambdaToXi, cosPaLambdaToXi, float); +DECLARE_SOA_COLUMN(CosPaXYLambdaToXi, cosPaXYLambdaToXi, float); +DECLARE_SOA_COLUMN(InvMassXicPlus, invMassXicPlus, float); +DECLARE_SOA_COLUMN(InvMassXi, invMassXi, float); DECLARE_SOA_COLUMN(Sign, sign, float); DECLARE_SOA_COLUMN(InvMassXiPi0, invMassXiPi0, float); DECLARE_SOA_COLUMN(InvMassXiPi1, invMassXiPi1, float); +DECLARE_SOA_COLUMN(PBachelorPi, pBachelorPi, float); +DECLARE_SOA_COLUMN(PPiFromLambda, pPiFromLambda, float); +DECLARE_SOA_COLUMN(PPrFrmoLambda, pPrFromLambda, float); // KF specific columns DECLARE_SOA_COLUMN(DcaXYPi0Pi1, dcaXYPi0Pi1, float); DECLARE_SOA_COLUMN(DcaXYPi0Xi, dcaXYPi0Xi, float); @@ -1527,6 +1527,17 @@ DECLARE_SOA_COLUMN(Chi2TopoXicPlusToPV, chi2TopoXicPlusToPV, float); DECLARE_SOA_COLUMN(Chi2TopoXicPlusToPVBeforeConstraint, chi2TopoXicPlusToPVBeforeConstraint, float); DECLARE_SOA_COLUMN(Chi2TopoXiToXicPlus, chi2TopoXiToXicPlus, float); DECLARE_SOA_COLUMN(Chi2TopoXiToXicPlusBeforeConstraint, chi2TopoXiToXicPlusBeforeConstraint, float); +// PID +DECLARE_SOA_COLUMN(NSigTpcPiFromXicPlus0, nSigTpcPiFromXicPlus0, float); +DECLARE_SOA_COLUMN(NSigTpcPiFromXicPlus1, nSigTpcPiFromXicPlus1, float); +DECLARE_SOA_COLUMN(NSigTpcBachelorPi, nSigTpcBachelorPi, float); +DECLARE_SOA_COLUMN(NSigTpcPiFromLambda, nSigTpcPiFromLambda, float); +DECLARE_SOA_COLUMN(NSigTpcPrFromLambda, nSigTpcPrFromLambda, float); +DECLARE_SOA_COLUMN(NSigTofPiFromXicPlus0, nSigTofPiFromXicPlus0, float); +DECLARE_SOA_COLUMN(NSigTofPiFromXicPlus1, nSigTofPiFromXicPlus1, float); +DECLARE_SOA_COLUMN(NSigTofBachelorPi, nSigTofBachelorPi, float); +DECLARE_SOA_COLUMN(NSigTofPiFromLambda, nSigTofPiFromLambda, float); +DECLARE_SOA_COLUMN(NSigTofPrFromLambda, nSigTofPrFromLambda, float); // MC matching result: DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); // generator level @@ -1534,6 +1545,13 @@ DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int8_t); // debug flag for mi DECLARE_SOA_COLUMN(DebugMcGen, debugMcGen, int8_t); DECLARE_SOA_COLUMN(OriginRec, originRec, int8_t); DECLARE_SOA_COLUMN(OriginGen, originGen, int8_t); +// Dynamic columns +DECLARE_SOA_DYNAMIC_COLUMN(PProng0, pProng0, //! + [](float px, float py, float pz) -> float { return RecoDecay::p(px, py, pz); }); +DECLARE_SOA_DYNAMIC_COLUMN(PProng1, pProng1, //! + [](float px, float py, float pz) -> float { return RecoDecay::p(px, py, pz); }); +DECLARE_SOA_DYNAMIC_COLUMN(PProng2, pProng2, //! + [](float px, float py, float pz) -> float { return RecoDecay::p(px, py, pz); }); // mapping of decay types enum DecayType { XicToXiPiPi = 0, // Ξc± → Ξ∓ π± π± @@ -1552,19 +1570,20 @@ DECLARE_SOA_TABLE(HfCandXicBase, "AOD", "HFCANDXICBASE", hf_cand::XSecondaryVertex, hf_cand::YSecondaryVertex, hf_cand::ZSecondaryVertex, hf_cand_xic_to_xi_pi_pi::XSvErr, hf_cand_xic_to_xi_pi_pi::YSvErr, hf_cand_xic_to_xi_pi_pi::ZSvErr, hf_cand::ErrorDecayLength, hf_cand::ErrorDecayLengthXY, - hf_cand::Chi2PCA, hf_cand_xic_to_xi_pi_pi::InvMassXic, hf_cand_xic_to_xi_pi_pi::Sign, + hf_cand::Chi2PCA, hf_cand_xic_to_xi_pi_pi::InvMassXicPlus, hf_cand_xic_to_xi_pi_pi::Sign, hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1, hf_cand::PxProng2, hf_cand::PyProng2, hf_cand::PzProng2, hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, hf_cand::ImpactParameter2, hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, hf_cand::ErrorImpactParameter2, // cascade specific columns - hf_cand_xic_to_xi_pi_pi::XDecayVtxXi, hf_cand_xic_to_xi_pi_pi::YDecayVtxXi, hf_cand_xic_to_xi_pi_pi::ZDecayVtxXi, - hf_cand_xic_to_xi_pi_pi::XDecayVtxLambda, hf_cand_xic_to_xi_pi_pi::YDecayVtxLambda, hf_cand_xic_to_xi_pi_pi::ZDecayVtxLambda, - hf_cand_xic_to_xi_pi_pi::CosPaXi, hf_cand_xic_to_xi_pi_pi::CosPaXYXi, hf_cand_xic_to_xi_pi_pi::CosPaLambda, hf_cand_xic_to_xi_pi_pi::CosPaXYLambda, - hf_cand_xic_to_xi_pi_pi::InvMassXiPi0, hf_cand_xic_to_xi_pi_pi::InvMassXiPi1, + hf_cand_xic_to_xi_pi_pi::PBachelorPi, hf_cand_xic_to_xi_pi_pi::PPiFromLambda, hf_cand_xic_to_xi_pi_pi::PPrFrmoLambda, + hf_cand_xic_to_xi_pi_pi::CosPaXi, hf_cand_xic_to_xi_pi_pi::CosPaXYXi, hf_cand_xic_to_xi_pi_pi::CosPaLambda, hf_cand_xic_to_xi_pi_pi::CosPaXYLambda, hf_cand_xic_to_xi_pi_pi::CosPaLambdaToXi, hf_cand_xic_to_xi_pi_pi::CosPaXYLambdaToXi, + hf_cand_xic_to_xi_pi_pi::InvMassXi, hf_cand_xic_to_xi_pi_pi::InvMassXiPi0, hf_cand_xic_to_xi_pi_pi::InvMassXiPi1, + // PID + hf_cand_xic_to_xi_pi_pi::NSigTpcPiFromXicPlus0, hf_cand_xic_to_xi_pi_pi::NSigTpcPiFromXicPlus1, hf_cand_xic_to_xi_pi_pi::NSigTpcBachelorPi, hf_cand_xic_to_xi_pi_pi::NSigTpcPiFromLambda, hf_cand_xic_to_xi_pi_pi::NSigTpcPrFromLambda, + hf_cand_xic_to_xi_pi_pi::NSigTofPiFromXicPlus0, hf_cand_xic_to_xi_pi_pi::NSigTofPiFromXicPlus1, hf_cand_xic_to_xi_pi_pi::NSigTofBachelorPi, hf_cand_xic_to_xi_pi_pi::NSigTofPiFromLambda, hf_cand_xic_to_xi_pi_pi::NSigTofPrFromLambda, /* dynamic columns */ - hf_cand::RSecondaryVertex, hf_cand::DecayLength, hf_cand::DecayLengthXY, hf_cand::DecayLengthNormalised, @@ -1573,8 +1592,11 @@ DECLARE_SOA_TABLE(HfCandXicBase, "AOD", "HFCANDXICBASE", hf_cand::ImpactParameterNormalised1, hf_cand::ImpactParameterNormalised2, /* dynamic columns that use daughter momentum components */ + hf_cand_xic_to_xi_pi_pi::PProng0, hf_cand::PtProng0, + hf_cand_xic_to_xi_pi_pi::PProng1, hf_cand::PtProng1, + hf_cand_xic_to_xi_pi_pi::PProng2, hf_cand::PtProng2, /* dynamic columns that use candidate momentum components */ hf_cand::Pt, @@ -1587,8 +1609,7 @@ DECLARE_SOA_TABLE(HfCandXicBase, "AOD", "HFCANDXICBASE", hf_cand_3prong::MaxNormalisedDeltaIP, hf_cand::Eta, hf_cand::Phi, - hf_cand::Y, - hf_cand::E); + hf_cand::Y); // extended table with expression columns that can be used as arguments of dynamic columns DECLARE_SOA_EXTENDED_TABLE_USER(HfCandXicExt, HfCandXicBase, "HFCANDXICEXT", diff --git a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx index cea4a034559..5d67864bbbb 100644 --- a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx @@ -95,11 +95,16 @@ struct HfCandidateCreatorXicToXiPiPi { float massXiPi0{0.}; float massXiPi1{0.}; double bz{0.}; + enum XicCandCounter { AllIdTriplets = 0, + CascPreSel, + VertexFit }; using CascadesLinked = soa::Join; using CascFull = soa::Join; using KFCascadesLinked = soa::Join; using KFCascFull = soa::Join; + using TracksWCovDcaPidPrPi = soa::Join; + using TracksWCovExtraPidPrPi = soa::Join; HistogramRegistry registry{"registry"}; @@ -111,6 +116,13 @@ struct HfCandidateCreatorXicToXiPiPi { // add histograms to registry if (fillHistograms) { + // counter + registry.add("hVertexerType", "Use KF or DCAFitterN;Vertexer type;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}); // See o2::aod::hf_cand::VertexerType + registry.add("hCandCounter", "hCandCounter", {HistType::kTH1F, {{3, 0.f, 0.3}}}); + registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + AllIdTriplets, "total"); + registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + CascPreSel, "Cascade preselection"); + registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + VertexFit, "Successful vertex fit"); + // physical variables registry.add("hMass3", "3-prong candidates;inv. mass (#Xi #pi #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 2.3, 2.7}}}); registry.add("hCovPVXX", "3-prong candidates;XX element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1D, {{100, 0., 1.e-4}}}); registry.add("hCovSVXX", "3-prong candidates;XX element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1D, {{100, 0., 0.2}}}); @@ -120,7 +132,6 @@ struct HfCandidateCreatorXicToXiPiPi { registry.add("hCovSVXZ", "3-prong candidates;XZ element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1D, {{100, -1.e-4, 0.2}}}); registry.add("hCovPVZZ", "3-prong candidates;ZZ element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1D, {{100, 0., 1.e-4}}}); registry.add("hCovSVZZ", "3-prong candidates;ZZ element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1D, {{100, 0., 0.2}}}); - registry.add("hVertexerType", "Use KF or DCAFitterN;Vertexer type;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}); // See o2::aod::hf_cand::VertexerType registry.add("hDcaXYProngs", "DCAxy of 3-prong candidates;#it{p}_{T} (GeV/#it{c};#it{d}_{xy}) (#mum);entries", {HistType::kTH2D, {{100, 0., 20.}, {200, -500., 500.}}}); registry.add("hDcaZProngs", "DCAz of 3-prong candidates;#it{p}_{T} (GeV/#it{c};#it{d}_{z}) (#mum);entries", {HistType::kTH2D, {{100, 0., 20.}, {200, -500., 500.}}}); } @@ -154,7 +165,7 @@ struct HfCandidateCreatorXicToXiPiPi { aod::HfCascLf3Prongs const& rowsTrackIndexXicPlus, CascadesLinked const&, CascFull const&, - aod::TracksWCovDca const&, + TracksWCovDcaPidPrPi const&, aod::BCsWithTimestamps const&) { // loop over triplets of track indices @@ -164,9 +175,10 @@ struct HfCandidateCreatorXicToXiPiPi { continue; } auto casc = cascAodElement.cascData_as(); - auto trackCharmBachelor0 = rowTrackIndexXicPlus.prong0_as(); - auto trackCharmBachelor1 = rowTrackIndexXicPlus.prong1_as(); + auto trackCharmBachelor0 = rowTrackIndexXicPlus.prong0_as(); + auto trackCharmBachelor1 = rowTrackIndexXicPlus.prong1_as(); auto collision = rowTrackIndexXicPlus.collision(); + registry.fill(HIST("hCandCounter"), 1 + AllIdTriplets); // preselect cascade candidates if (doCascadePreselection) { @@ -177,6 +189,7 @@ struct HfCandidateCreatorXicToXiPiPi { continue; } } + registry.fill(HIST("hCandCounter"), 1 + CascPreSel); //----------------------Set the magnetic field from ccdb--------------------------------------- /// The static instance of the propagator was already modified in the HFTrackIndexSkimCreator, @@ -190,9 +203,6 @@ struct HfCandidateCreatorXicToXiPiPi { } df.setBz(bz); - //----------------accessing particles in the decay chain------------- - auto trackPionFromXi = casc.bachelor_as(); // pion <- xi track from TracksWCovDca table - //--------------------------info of V0 and cascades track from LF-tables--------------------------- std::array vertexV0 = {casc.xlambda(), casc.ylambda(), casc.zlambda()}; std::array pVecV0 = {casc.pxlambda(), casc.pylambda(), casc.pzlambda()}; @@ -208,9 +218,9 @@ struct HfCandidateCreatorXicToXiPiPi { } // create cascade track o2::track::TrackParCov trackCasc; - if (trackPionFromXi.sign() > 0) { + if (casc.sign() > 0) { trackCasc = o2::track::TrackParCov(vertexCasc, pVecCasc, covCasc, 1, true); - } else if (trackPionFromXi.sign() < 0) { + } else if (casc.sign() < 0) { trackCasc = o2::track::TrackParCov(vertexCasc, pVecCasc, covCasc, -1, true); } else { continue; @@ -231,6 +241,7 @@ struct HfCandidateCreatorXicToXiPiPi { LOG(info) << "Run time error found: " << error.what() << ". DCAFitterN cannot work, skipping the candidate."; continue; } + registry.fill(HIST("hCandCounter"), 1 + VertexFit); //----------------------------calculate physical properties----------------------- // Charge of charm baryon @@ -270,10 +281,12 @@ struct HfCandidateCreatorXicToXiPiPi { // calculate cosine of pointing angle std::array pvCoord = {collision.posX(), collision.posY(), collision.posZ()}; - double cpaLambda = casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); - double cpaXYLambda = RecoDecay::cpaXY(pvCoord, vertexV0, pVecV0); - double cpaXi = casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()); - double cpaXYXi = RecoDecay::cpaXY(pvCoord, vertexCasc, pVecCasc); + float cpaLambda = casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); + float cpaXYLambda = RecoDecay::cpaXY(pvCoord, vertexV0, pVecV0); + float cpaXi = casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()); + float cpaXYXi = RecoDecay::cpaXY(pvCoord, vertexCasc, pVecCasc); + float cpaLambdaToXi = RecoDecay::cpa(vertexCasc, vertexV0, pVecV0); + float cpaXYLambdaToXi = RecoDecay::cpaXY(vertexCasc, vertexV0, pVecV0); // get invariant mass of Xi-pi pairs auto arrayMomentaXiPi0 = std::array{pVecXi, pVecPi0}; @@ -282,11 +295,40 @@ struct HfCandidateCreatorXicToXiPiPi { massXiPi1 = RecoDecay::m(std::move(arrayMomentaXiPi1), std::array{MassXiMinus, MassPiPlus}); // get uncertainty of the decay length - double phi, theta; + float phi, theta; getPointDirection(std::array{primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}, secondaryVertex, phi, theta); auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixSV, phi, theta)); auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixSV, phi, 0.)); + //--------------------- get PID information----------------------- + float nSigTpcPiFromXicPlus0 = trackCharmBachelor0.tpcNSigmaPi(); + float nSigTofPiFromXicPlus0 = trackCharmBachelor0.tofNSigmaPi(); + float nSigTpcPiFromXicPlus1 = trackCharmBachelor1.tpcNSigmaPi(); + float nSigTofPiFromXicPlus1 = trackCharmBachelor1.tofNSigmaPi(); + // Bachelor pion + auto trackPionFromXi = casc.bachelor_as(); + float nSigTpcBachelorPi = trackPionFromXi.tpcNSigmaPi(); + float nSigTofBachelorPi = trackPionFromXi.tofNSigmaPi(); + // Lambda daughters + auto trackPosLambdaDaughter = casc.posTrack_as(); + auto trackNegLambdaDaughter = casc.negTrack_as(); + float pPiFromLambda, pPrFromLambda, nSigTpcPiFromLambda, nSigTofPiFromLambda, nSigTpcPrFromLambda, nSigTofPrFromLambda; + if (signXic == +1) { + pPiFromLambda = trackNegLambdaDaughter.p(); + nSigTpcPiFromLambda = trackNegLambdaDaughter.tpcNSigmaPi(); + nSigTofPiFromLambda = trackNegLambdaDaughter.tofNSigmaPi(); + pPrFromLambda = trackPosLambdaDaughter.p(); + nSigTpcPrFromLambda = trackPosLambdaDaughter.tpcNSigmaPr(); + nSigTofPrFromLambda = trackPosLambdaDaughter.tofNSigmaPr(); + } else if (signXic == -1) { + pPiFromLambda = trackPosLambdaDaughter.p(); + nSigTpcPiFromLambda = trackPosLambdaDaughter.tpcNSigmaPi(); + nSigTofPiFromLambda = trackPosLambdaDaughter.tofNSigmaPi(); + pPrFromLambda = trackNegLambdaDaughter.p(); + nSigTpcPrFromLambda = trackNegLambdaDaughter.tpcNSigmaPr(); + nSigTofPrFromLambda = trackNegLambdaDaughter.tofNSigmaPr(); + } + //--------------------------------------------fill histograms---------------------------------------------------------------- if (fillHistograms) { // invariant mass @@ -327,10 +369,12 @@ struct HfCandidateCreatorXicToXiPiPi { impactParameterCasc.getY(), impactParameter0.getY(), impactParameter1.getY(), std::sqrt(impactParameterCasc.getSigmaY2()), std::sqrt(impactParameter0.getSigmaY2()), std::sqrt(impactParameter1.getSigmaY2()), /*cascade specific columns*/ - vertexCasc[0], vertexCasc[1], vertexCasc[2], - vertexV0[0], vertexV0[1], vertexV0[2], - cpaXi, cpaXYXi, cpaLambda, cpaXYLambda, - massXiPi0, massXiPi1); + trackPionFromXi.p(), pPiFromLambda, pPrFromLambda, + cpaXi, cpaXYXi, cpaLambda, cpaXYLambda, cpaLambdaToXi, cpaXYLambdaToXi, + casc.mXi(), massXiPi0, massXiPi1, + /*PID information*/ + nSigTpcPiFromXicPlus0, nSigTpcPiFromXicPlus1, nSigTpcBachelorPi, nSigTpcPiFromLambda, nSigTpcPrFromLambda, + nSigTofPiFromXicPlus0, nSigTofPiFromXicPlus1, nSigTofBachelorPi, nSigTofPiFromLambda, nSigTofPrFromLambda); } // loop over track triplets } PROCESS_SWITCH(HfCandidateCreatorXicToXiPiPi, processXicplusWithDcaFitter, "Run candidate creator with DCAFitter.", true); @@ -339,7 +383,7 @@ struct HfCandidateCreatorXicToXiPiPi { aod::HfCascLf3Prongs const& rowsTrackIndexXicPlus, KFCascadesLinked const&, KFCascFull const&, - aod::TracksWCovExtra const&, + TracksWCovExtraPidPrPi const&, aod::BCsWithTimestamps const&) { // loop over triplets of track indices @@ -349,9 +393,10 @@ struct HfCandidateCreatorXicToXiPiPi { continue; } auto casc = cascAodElement.kfCascData_as(); - auto trackCharmBachelor0 = rowTrackIndexXicPlus.prong0_as(); - auto trackCharmBachelor1 = rowTrackIndexXicPlus.prong1_as(); + auto trackCharmBachelor0 = rowTrackIndexXicPlus.prong0_as(); + auto trackCharmBachelor1 = rowTrackIndexXicPlus.prong1_as(); auto collision = rowTrackIndexXicPlus.collision(); + registry.fill(HIST("hCandCounter"), 1 + AllIdTriplets); //-------------------preselect cascade candidates-------------------------------------- if (doCascadePreselection) { @@ -362,6 +407,7 @@ struct HfCandidateCreatorXicToXiPiPi { continue; } } + registry.fill(HIST("hCandCounter"), 1 + CascPreSel); //----------------------Set the magnetic field from ccdb----------------------------- /// The static instance of the propagator was already modified in the HFTrackIndexSkimCreator, @@ -415,6 +461,7 @@ struct HfCandidateCreatorXicToXiPiPi { LOG(debug) << "Failed to construct XicPlus : " << e.what(); continue; } + registry.fill(HIST("hCandCounter"), 1 + VertexFit); // get geometrical chi2 of XicPlus float chi2GeoXicPlus = kfXicPlus.GetChi2() / kfXicPlus.GetNDF(); @@ -455,37 +502,39 @@ struct HfCandidateCreatorXicToXiPiPi { // sign of charm baryon int signXic = casc.sign() < 0 ? +1 : -1; - // get updated daughter tracks after vertex fit - // after production vertex constraint the parameters of the particle are stored at the position of the production vertex - KFParticle kfCharmBachelor0Upd = kfCharmBachelor0; - KFParticle kfCharmBachelor1Upd = kfCharmBachelor1; - KFParticle kfXiUpd = kfXi; - kfCharmBachelor0Upd.SetProductionVertex(kfXicPlus); - kfCharmBachelor1Upd.SetProductionVertex(kfXicPlus); - kfXiUpd.SetProductionVertex(kfXicPlus); + // transport XicPlus daughters to XicPlus decay vertex (secondary vertex) + float secondaryVertex[3] = {0.}; + secondaryVertex[0] = kfXicPlus.GetX(); + secondaryVertex[1] = kfXicPlus.GetY(); + secondaryVertex[2] = kfXicPlus.GetZ(); + kfXi.TransportToPoint(secondaryVertex); + kfCharmBachelor0.TransportToPoint(secondaryVertex); + kfCharmBachelor1.TransportToPoint(secondaryVertex); - // get impact parameters of updated XicPlus daughters + // get impact parameters of XicPlus daughters float impactParameterPi0XY = 0., errImpactParameterPi0XY = 0.; float impactParameterPi1XY = 0., errImpactParameterPi1XY = 0.; float impactParameterXiXY = 0., errImpactParameterXiXY = 0.; - kfCharmBachelor0Upd.GetDistanceFromVertexXY(KFPV, impactParameterPi0XY, errImpactParameterPi0XY); - kfCharmBachelor1Upd.GetDistanceFromVertexXY(KFPV, impactParameterPi1XY, errImpactParameterPi1XY); - kfXiUpd.GetDistanceFromVertexXY(KFPV, impactParameterXiXY, errImpactParameterXiXY); + kfCharmBachelor0.GetDistanceFromVertexXY(KFPV, impactParameterPi0XY, errImpactParameterPi0XY); + kfCharmBachelor1.GetDistanceFromVertexXY(KFPV, impactParameterPi1XY, errImpactParameterPi1XY); + kfXi.GetDistanceFromVertexXY(KFPV, impactParameterXiXY, errImpactParameterXiXY); // calculate cosine of pointing angle std::array pvCoord = {collision.posX(), collision.posY(), collision.posZ()}; - double cpaLambda = casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); - double cpaXYLambda = RecoDecay::cpaXY(pvCoord, vertexV0, pVecV0); - double cpaXi = casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()); - double cpaXYXi = RecoDecay::cpaXY(pvCoord, vertexCasc, pVecCasc); + float cpaLambda = casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); + float cpaXYLambda = RecoDecay::cpaXY(pvCoord, vertexV0, pVecV0); + float cpaXi = casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()); + float cpaXYXi = RecoDecay::cpaXY(pvCoord, vertexCasc, pVecCasc); + float cpaLambdaToXi = RecoDecay::cpa(vertexCasc, vertexV0, pVecV0); + float cpaXYLambdaToXi = RecoDecay::cpaXY(vertexCasc, vertexV0, pVecV0); // get DCAs of Pi0-Pi1, Pi0-Xi, Pi1-Xi - float dcaXYPi0Pi1 = kfCharmBachelor0Upd.GetDistanceFromParticleXY(kfCharmBachelor1Upd); - float dcaXYPi0Xi = kfCharmBachelor0Upd.GetDistanceFromParticleXY(kfXiUpd); - float dcaXYPi1Xi = kfCharmBachelor1Upd.GetDistanceFromParticleXY(kfXiUpd); - float dcaPi0Pi1 = kfCharmBachelor0Upd.GetDistanceFromParticle(kfCharmBachelor1Upd); - float dcaPi0Xi = kfCharmBachelor0Upd.GetDistanceFromParticle(kfXiUpd); - float dcaPi1Xi = kfCharmBachelor1Upd.GetDistanceFromParticle(kfXiUpd); + float dcaXYPi0Pi1 = kfCharmBachelor0.GetDistanceFromParticleXY(kfCharmBachelor1); + float dcaXYPi0Xi = kfCharmBachelor0.GetDistanceFromParticleXY(kfXi); + float dcaXYPi1Xi = kfCharmBachelor1.GetDistanceFromParticleXY(kfXi); + float dcaPi0Pi1 = kfCharmBachelor0.GetDistanceFromParticle(kfCharmBachelor1); + float dcaPi0Xi = kfCharmBachelor0.GetDistanceFromParticle(kfXi); + float dcaPi1Xi = kfCharmBachelor1.GetDistanceFromParticle(kfXi); // mass of Xi-Pi0 pair KFParticle kfXiPi0; @@ -515,6 +564,35 @@ struct HfCandidateCreatorXicToXiPiPi { float errMassXiPiPi; kfXicPlus.GetMass(massXiPiPi, errMassXiPiPi); + //--------------------- get PID information----------------------- + float nSigTpcPiFromXicPlus0 = trackCharmBachelor0.tpcNSigmaPi(); + float nSigTofPiFromXicPlus0 = trackCharmBachelor0.tofNSigmaPi(); + float nSigTpcPiFromXicPlus1 = trackCharmBachelor1.tpcNSigmaPi(); + float nSigTofPiFromXicPlus1 = trackCharmBachelor1.tofNSigmaPi(); + // Bachelor pion + auto trackPionFromXi = casc.bachelor_as(); + float nSigTpcBachelorPi = trackPionFromXi.tpcNSigmaPi(); + float nSigTofBachelorPi = trackPionFromXi.tofNSigmaPi(); + // Lambda daughters + auto trackPosLambdaDaughter = casc.posTrack_as(); + auto trackNegLambdaDaughter = casc.negTrack_as(); + float pPiFromLambda, pPrFromLambda, nSigTpcPiFromLambda, nSigTofPiFromLambda, nSigTpcPrFromLambda, nSigTofPrFromLambda; + if (signXic == +1) { + pPiFromLambda = trackNegLambdaDaughter.p(); + nSigTpcPiFromLambda = trackNegLambdaDaughter.tpcNSigmaPi(); + nSigTofPiFromLambda = trackNegLambdaDaughter.tofNSigmaPi(); + pPrFromLambda = trackPosLambdaDaughter.p(); + nSigTpcPrFromLambda = trackPosLambdaDaughter.tpcNSigmaPr(); + nSigTofPrFromLambda = trackPosLambdaDaughter.tofNSigmaPr(); + } else if (signXic == -1) { + pPiFromLambda = trackPosLambdaDaughter.p(); + nSigTpcPiFromLambda = trackPosLambdaDaughter.tpcNSigmaPi(); + nSigTofPiFromLambda = trackPosLambdaDaughter.tofNSigmaPi(); + pPrFromLambda = trackNegLambdaDaughter.p(); + nSigTpcPrFromLambda = trackNegLambdaDaughter.tpcNSigmaPr(); + nSigTofPrFromLambda = trackNegLambdaDaughter.tofNSigmaPr(); + } + //-------------------------------fill histograms-------------------------------------------- if (fillHistograms) { // invariant mass @@ -542,7 +620,7 @@ struct HfCandidateCreatorXicToXiPiPi { /*3-prong specific columns*/ rowTrackIndexXicPlus.cascadeId(), rowTrackIndexXicPlus.prong0Id(), rowTrackIndexXicPlus.prong1Id(), casc.bachelorId(), casc.posTrackId(), casc.negTrackId(), - kfXicPlus.GetX(), kfXicPlus.GetY(), kfXicPlus.GetZ(), + secondaryVertex[0], secondaryVertex[1], secondaryVertex[2], kfXicPlus.GetErrX(), kfXicPlus.GetErrY(), kfXicPlus.GetErrZ(), kfXicPlus.GetErrDecayLength(), kfXicPlus.GetErrDecayLengthXY(), chi2GeoXicPlus, massXiPiPi, signXic, @@ -552,10 +630,12 @@ struct HfCandidateCreatorXicToXiPiPi { impactParameterXiXY, impactParameterPi0XY, impactParameterPi1XY, errImpactParameterXiXY, errImpactParameterPi0XY, errImpactParameterPi1XY, /*cascade specific columns*/ - casc.x(), casc.y(), casc.z(), - casc.xlambda(), casc.ylambda(), casc.zlambda(), - cpaXi, cpaXYXi, cpaLambda, cpaXYLambda, - massXiPi0, massXiPi1); + trackPionFromXi.p(), pPiFromLambda, pPrFromLambda, + cpaXi, cpaXYXi, cpaLambda, cpaXYLambda, cpaLambdaToXi, cpaXYLambdaToXi, + casc.mXi(), massXiPi0, massXiPi1, + /*PID information*/ + nSigTpcPiFromXicPlus0, nSigTpcPiFromXicPlus1, nSigTpcBachelorPi, nSigTpcPiFromLambda, nSigTpcPrFromLambda, + nSigTofPiFromXicPlus0, nSigTofPiFromXicPlus1, nSigTofBachelorPi, nSigTofPiFromLambda, nSigTofPrFromLambda); rowCandidateKF(casc.kfCascadeChi2(), casc.kfV0Chi2(), chi2topoXicPlusToPVBeforeConstraint, chi2topoXicPlusToPV, chi2topoXiToXicPlusBeforeConstraint, chi2topoXiToXicPlus, dcaXYPi0Pi1, dcaXYPi0Xi, dcaXYPi1Xi, @@ -700,7 +780,7 @@ struct HfCandidateCreatorXicToXiPiPiExpressions { rowMcMatchGen(flag, debug, origin); } // close loop over generated particles - } // close process + } // close process PROCESS_SWITCH(HfCandidateCreatorXicToXiPiPiExpressions, processMc, "Process MC", false); }; // close struct diff --git a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx index 49b4b2df01b..a2191501706 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx @@ -147,7 +147,7 @@ struct HfCandidateSelectorXicToXiPiPi { } // check candidate mass is within a defined mass window - if (std::abs(hfCandXic.invMassXic() - o2::constants::physics::MassXiCPlus) > cuts->get(pTBin, "m")) { + if (std::abs(hfCandXic.invMassXicPlus() - o2::constants::physics::MassXiCPlus) > cuts->get(pTBin, "m")) { return false; } @@ -284,8 +284,7 @@ struct HfCandidateSelectorXicToXiPiPi { } } - // ML selections - + // ML selection if (applyMl) { bool isSelectedMlXicToXiPiPi = false; std::vector inputFeaturesXicToXiPiPi = hfMlResponse.getInputFeatures(hfCandXic); @@ -299,6 +298,9 @@ struct HfCandidateSelectorXicToXiPiPi { continue; } SETBIT(statusXicToXiPiPi, aod::SelectionStep::RecoMl); + if (activateQA) { + registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoMl, ptCandXic); + } } hfSelXicToXiPiPiCandidate(statusXicToXiPiPi); diff --git a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx index 488a9fee249..649bd742592 100644 --- a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx @@ -35,32 +35,14 @@ namespace full { DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int); //! Selection flag of candidate (output of candidateSelector) // vertices -DECLARE_SOA_COLUMN(XPv, xPv, float); -DECLARE_SOA_COLUMN(YPv, yPv, float); -DECLARE_SOA_COLUMN(ZPv, zPv, float); DECLARE_SOA_COLUMN(XPvErr, xPvErr, float); DECLARE_SOA_COLUMN(YPvErr, yPvErr, float); DECLARE_SOA_COLUMN(ZPvErr, zPvErr, float); -DECLARE_SOA_COLUMN(XPvGen, xPvGen, float); -DECLARE_SOA_COLUMN(YPvGen, yPvGen, float); -DECLARE_SOA_COLUMN(ZPvGen, zPvGen, float); -DECLARE_SOA_COLUMN(XSv, xSv, float); -DECLARE_SOA_COLUMN(YSv, ySv, float); -DECLARE_SOA_COLUMN(ZSv, zSv, float); DECLARE_SOA_COLUMN(XSvErr, xSvErr, float); DECLARE_SOA_COLUMN(YSvErr, ySvErr, float); DECLARE_SOA_COLUMN(ZSvErr, zSvErr, float); DECLARE_SOA_COLUMN(Chi2Sv, chi2Sv, float); -DECLARE_SOA_COLUMN(XSvGen, xSvGen, float); -DECLARE_SOA_COLUMN(YSvGen, ySvGen, float); -DECLARE_SOA_COLUMN(ZSvGen, zSvGen, float); -DECLARE_SOA_COLUMN(XDecVtxXi, xDecVtxXi, float); -DECLARE_SOA_COLUMN(YDecVtxXi, yDecVtxXi, float); -DECLARE_SOA_COLUMN(ZDecVtxXi, zDecVtxXi, float); DECLARE_SOA_COLUMN(Chi2XiVtx, chi2XiVtx, float); -DECLARE_SOA_COLUMN(XDecVtxLam, xDecVtxLam, float); -DECLARE_SOA_COLUMN(YDecVtxLam, yDecVtxLam, float); -DECLARE_SOA_COLUMN(ZDecVtxLam, zDecVtxLam, float); DECLARE_SOA_COLUMN(Chi2LamVtx, chi2LamVtx, float); // properties of XicPlus DECLARE_SOA_COLUMN(Sign, sign, float); @@ -83,12 +65,14 @@ DECLARE_SOA_COLUMN(Chi2TopoXicPlusToPV, chi2TopoXicPlusToPV, float); DECLARE_SOA_COLUMN(Chi2TopoXiToXicPlusBeforeConstraint, chi2TopoXiToXicPlusBeforeConstraint, float); DECLARE_SOA_COLUMN(Chi2TopoXiToXicPlus, chi2TopoXiToXicPlus, float); // properties of daughter tracks -DECLARE_SOA_COLUMN(PtXi, ptXi, float); //! Transverse momentum of Xi (prong0) (GeV/c) -DECLARE_SOA_COLUMN(ImpactParameterXi, impactParameterXi, float); //! Impact parameter of Xi (prong0) -DECLARE_SOA_COLUMN(ImpactParameterNormalisedXi, impactParameterNormalisedXi, float); //! Normalised impact parameter of Xi (prong0) +DECLARE_SOA_COLUMN(PtXi, ptXi, float); //! Transverse momentum of Xi (prong0) (GeV/c) +DECLARE_SOA_COLUMN(ImpactParameterXi, impactParameterXi, float); //! Impact parameter of Xi (prong0) +DECLARE_SOA_COLUMN(ImpactParameterNormalisedXi, impactParameterNormalisedXi, float); //! Normalised impact parameter of Xi (prong0) +DECLARE_SOA_COLUMN(PPi0, pPi0, float); DECLARE_SOA_COLUMN(PtPi0, ptPi0, float); //! Transverse momentum of Pi0 (prong1) (GeV/c) DECLARE_SOA_COLUMN(ImpactParameterPi0, impactParameterPi0, float); //! Impact parameter of Pi0 (prong1) DECLARE_SOA_COLUMN(ImpactParameterNormalisedPi0, impactParameterNormalisedPi0, float); //! Normalised impact parameter of Pi0 (prong1) +DECLARE_SOA_COLUMN(PPi1, pPi1, float); DECLARE_SOA_COLUMN(PtPi1, ptPi1, float); //! Transverse momentum of Pi1 (prong2) (GeV/c) DECLARE_SOA_COLUMN(ImpactParameterPi1, impactParameterPi1, float); //! Normalised impact parameter of Pi1 (prong2) DECLARE_SOA_COLUMN(ImpactParameterNormalisedPi1, impactParameterNormalisedPi1, float); //! Normalised impact parameter of Pi1 (prong2) @@ -97,6 +81,8 @@ DECLARE_SOA_COLUMN(CpaXi, cpaXi, float); DECLARE_SOA_COLUMN(CpaXYXi, cpaXYXi, float); DECLARE_SOA_COLUMN(CpaLam, cpaLam, float); DECLARE_SOA_COLUMN(CpaXYLam, cpaXYLam, float); +DECLARE_SOA_COLUMN(CpaLamToXi, cpaLamToXi, float); +DECLARE_SOA_COLUMN(CpaXYLamToXi, cpaXYLamToXi, float); DECLARE_SOA_COLUMN(DcaXYPi0Pi1, dcaXYPi0Pi1, float); DECLARE_SOA_COLUMN(DcaXYPi0Xi, dcaXYPi0Xi, float); DECLARE_SOA_COLUMN(DcaXYPi1Xi, dcaXYPi1Xi, float); @@ -104,8 +90,12 @@ DECLARE_SOA_COLUMN(DcaPi0Pi1, dcaPi0Pi1, float); DECLARE_SOA_COLUMN(DcaPi0Xi, dcaPi0Xi, float); DECLARE_SOA_COLUMN(DcaPi1Xi, dcaPi1Xi, float); DECLARE_SOA_COLUMN(DcaXiDaughters, dcaXiDaughters, float); +DECLARE_SOA_COLUMN(InvMassXi, invMassXi, float); DECLARE_SOA_COLUMN(InvMassXiPi0, invMassXiPi0, float); DECLARE_SOA_COLUMN(InvMassXiPi1, invMassXiPi1, float); +DECLARE_SOA_COLUMN(PBachelorPi, pBachelorPi, float); +DECLARE_SOA_COLUMN(PPiFromLambda, pPiFromLambda, float); +DECLARE_SOA_COLUMN(PPrFromLambda, pPrFromLambda, float); // residuals and pulls DECLARE_SOA_COLUMN(PtResidual, ptResidual, float); DECLARE_SOA_COLUMN(PResidual, pResidual, float); @@ -125,6 +115,8 @@ DECLARE_SOA_COLUMN(ZSvPull, zSvPull, float); DECLARE_SOA_TABLE(HfCandXicToXiPiPiLites, "AOD", "HFXICXI2PILITE", hf_cand_xic_to_xi_pi_pi::FlagMcMatchRec, + hf_cand_xic_to_xi_pi_pi::DebugMcRec, + hf_cand_xic_to_xi_pi_pi::OriginRec, full::CandidateSelFlag, full::Sign, full::Y, @@ -136,6 +128,7 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiLites, "AOD", "HFXICXI2PILITE", full::PtPi0, full::PtPi1, full::M, + full::InvMassXi, full::InvMassXiPi0, full::InvMassXiPi1, full::Chi2Sv, @@ -160,6 +153,8 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiLites, "AOD", "HFXICXI2PILITE", DECLARE_SOA_TABLE(HfCandXicToXiPiPiLiteKfs, "AOD", "HFXICXI2PILITKF", hf_cand_xic_to_xi_pi_pi::FlagMcMatchRec, + hf_cand_xic_to_xi_pi_pi::DebugMcRec, + hf_cand_xic_to_xi_pi_pi::OriginRec, full::CandidateSelFlag, full::Sign, full::Y, @@ -171,6 +166,7 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiLiteKfs, "AOD", "HFXICXI2PILITKF", full::PtPi0, full::PtPi1, full::M, + full::InvMassXi, full::InvMassXiPi0, full::InvMassXiPi1, full::Chi2Sv, @@ -209,6 +205,8 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiLiteKfs, "AOD", "HFXICXI2PILITKF", DECLARE_SOA_TABLE(HfCandXicToXiPiPiFulls, "AOD", "HFXICXI2PIFULL", hf_cand_xic_to_xi_pi_pi::FlagMcMatchRec, + hf_cand_xic_to_xi_pi_pi::DebugMcRec, + hf_cand_xic_to_xi_pi_pi::OriginRec, full::CandidateSelFlag, full::Sign, full::Y, @@ -220,6 +218,7 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiFulls, "AOD", "HFXICXI2PIFULL", full::PtPi0, full::PtPi1, full::M, + full::InvMassXi, full::InvMassXiPi0, full::InvMassXiPi1, full::Chi2Sv, @@ -242,28 +241,34 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiFulls, "AOD", "HFXICXI2PIFULL", full::ImpactParameterNormalisedPi1, full::MaxNormalisedDeltaIP, // additional columns only stored in the full candidate table - full::E, - full::XPv, - full::YPv, - full::ZPv, full::XPvErr, full::YPvErr, full::ZPvErr, - full::XSv, - full::YSv, - full::ZSv, full::XSvErr, full::YSvErr, full::ZSvErr, - full::XDecVtxXi, - full::YDecVtxXi, - full::ZDecVtxXi, - full::XDecVtxLam, - full::YDecVtxLam, - full::ZDecVtxLam); + full::CpaLamToXi, + full::CpaXYLamToXi, + full::PPi0, + full::PPi1, + full::PBachelorPi, + full::PPiFromLambda, + full::PPrFromLambda, + hf_cand_xic_to_xi_pi_pi::NSigTpcPiFromXicPlus0, + hf_cand_xic_to_xi_pi_pi::NSigTpcPiFromXicPlus1, + hf_cand_xic_to_xi_pi_pi::NSigTpcBachelorPi, + hf_cand_xic_to_xi_pi_pi::NSigTpcPiFromLambda, + hf_cand_xic_to_xi_pi_pi::NSigTpcPrFromLambda, + hf_cand_xic_to_xi_pi_pi::NSigTofPiFromXicPlus0, + hf_cand_xic_to_xi_pi_pi::NSigTofPiFromXicPlus1, + hf_cand_xic_to_xi_pi_pi::NSigTofBachelorPi, + hf_cand_xic_to_xi_pi_pi::NSigTofPiFromLambda, + hf_cand_xic_to_xi_pi_pi::NSigTofPrFromLambda); DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullKfs, "AOD", "HFXICXI2PIFULKF", hf_cand_xic_to_xi_pi_pi::FlagMcMatchRec, + hf_cand_xic_to_xi_pi_pi::DebugMcRec, + hf_cand_xic_to_xi_pi_pi::OriginRec, full::CandidateSelFlag, full::Sign, full::Y, @@ -275,6 +280,7 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullKfs, "AOD", "HFXICXI2PIFULKF", full::PtPi0, full::PtPi1, full::M, + full::InvMassXi, full::InvMassXiPi0, full::InvMassXiPi1, full::Chi2Sv, @@ -297,25 +303,29 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullKfs, "AOD", "HFXICXI2PIFULKF", full::ImpactParameterNormalisedPi1, full::MaxNormalisedDeltaIP, // additional columns only stored in the full candidate table - full::E, - full::XPv, - full::YPv, - full::ZPv, full::XPvErr, full::YPvErr, full::ZPvErr, - full::XSv, - full::YSv, - full::ZSv, full::XSvErr, full::YSvErr, full::ZSvErr, - full::XDecVtxXi, - full::YDecVtxXi, - full::ZDecVtxXi, - full::XDecVtxLam, - full::YDecVtxLam, - full::ZDecVtxLam, + full::CpaLamToXi, + full::CpaXYLamToXi, + full::PPi0, + full::PPi1, + full::PBachelorPi, + full::PPiFromLambda, + full::PPrFromLambda, + hf_cand_xic_to_xi_pi_pi::NSigTpcPiFromXicPlus0, + hf_cand_xic_to_xi_pi_pi::NSigTpcPiFromXicPlus1, + hf_cand_xic_to_xi_pi_pi::NSigTpcBachelorPi, + hf_cand_xic_to_xi_pi_pi::NSigTpcPiFromLambda, + hf_cand_xic_to_xi_pi_pi::NSigTpcPrFromLambda, + hf_cand_xic_to_xi_pi_pi::NSigTofPiFromXicPlus0, + hf_cand_xic_to_xi_pi_pi::NSigTofPiFromXicPlus1, + hf_cand_xic_to_xi_pi_pi::NSigTofBachelorPi, + hf_cand_xic_to_xi_pi_pi::NSigTofPiFromLambda, + hf_cand_xic_to_xi_pi_pi::NSigTofPrFromLambda, // KF-specific columns full::Chi2XiVtx, full::Chi2LamVtx, @@ -332,19 +342,16 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullKfs, "AOD", "HFXICXI2PIFULKF", full::DcaXiDaughters); DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullPs, "AOD", "HFXICXI2PIFULLP", + hf_cand_xic_to_xi_pi_pi::FlagMcMatchGen, + hf_cand_xic_to_xi_pi_pi::DebugMcGen, + hf_cand_xic_to_xi_pi_pi::OriginGen, full::Pt, full::Eta, full::Phi, - full::Y, - full::XPvGen, - full::YPvGen, - full::ZPvGen, - full::XSvGen, - full::YSvGen, - full::ZSvGen, - hf_cand_xic_to_xi_pi_pi::FlagMcMatchGen); + full::Y); DECLARE_SOA_TABLE(HfCandXicToXiPiPiResiduals, "AOD", "HFXICXI2PIRESID", + hf_cand_xic_to_xi_pi_pi::OriginGen, full::PResidual, full::PtResidual, full::XPvResidual, @@ -399,13 +406,19 @@ struct HfTreeCreatorXicToXiPiPi { void fillCandidateTable(const T& candidate) { int8_t flagMc = 0; + int8_t debugMc = 0; + int8_t originMc = 0; if constexpr (doMc) { flagMc = candidate.flagMcMatchRec(); + debugMc = candidate.debugMcRec(); + originMc = candidate.originRec(); } if constexpr (!doKf) { if (fillCandidateLiteTable) { rowCandidateLite( flagMc, + debugMc, + originMc, candidate.isSelXicToXiPiPi(), candidate.sign(), candidate.y(o2::constants::physics::MassXiCPlus), @@ -416,7 +429,8 @@ struct HfTreeCreatorXicToXiPiPi { candidate.ptProng0(), candidate.ptProng1(), candidate.ptProng2(), - candidate.invMassXic(), + candidate.invMassXicPlus(), + candidate.invMassXi(), candidate.invMassXiPi0(), candidate.invMassXiPi1(), candidate.chi2PCA(), @@ -441,6 +455,8 @@ struct HfTreeCreatorXicToXiPiPi { } else { rowCandidateFull( flagMc, + debugMc, + originMc, candidate.isSelXicToXiPiPi(), candidate.sign(), candidate.y(o2::constants::physics::MassXiCPlus), @@ -451,7 +467,8 @@ struct HfTreeCreatorXicToXiPiPi { candidate.ptProng0(), candidate.ptProng1(), candidate.ptProng2(), - candidate.invMassXic(), + candidate.invMassXicPlus(), + candidate.invMassXi(), candidate.invMassXiPi0(), candidate.invMassXiPi1(), candidate.chi2PCA(), @@ -474,30 +491,36 @@ struct HfTreeCreatorXicToXiPiPi { candidate.impactParameterNormalised2(), candidate.maxNormalisedDeltaIP(), // additional columns only stored in the full candidate table - candidate.e(o2::constants::physics::MassXiCPlus), - candidate.posX(), - candidate.posY(), - candidate.posZ(), candidate.xPvErr(), candidate.yPvErr(), candidate.zPvErr(), - candidate.xSecondaryVertex(), - candidate.ySecondaryVertex(), - candidate.zSecondaryVertex(), candidate.xSvErr(), candidate.ySvErr(), candidate.zSvErr(), - candidate.xDecayVtxXi(), - candidate.yDecayVtxXi(), - candidate.zDecayVtxXi(), - candidate.xDecayVtxLambda(), - candidate.yDecayVtxLambda(), - candidate.zDecayVtxLambda()); + candidate.cosPaLambdaToXi(), + candidate.cosPaXYLambdaToXi(), + candidate.pProng1(), + candidate.pProng2(), + candidate.pBachelorPi(), + candidate.pPiFromLambda(), + candidate.pPrFromLambda(), + candidate.nSigTpcPiFromXicPlus0(), + candidate.nSigTpcPiFromXicPlus1(), + candidate.nSigTpcBachelorPi(), + candidate.nSigTpcPiFromLambda(), + candidate.nSigTpcPrFromLambda(), + candidate.nSigTofPiFromXicPlus0(), + candidate.nSigTofPiFromXicPlus1(), + candidate.nSigTofBachelorPi(), + candidate.nSigTofPiFromLambda(), + candidate.nSigTofPrFromLambda()); } } else { if (fillCandidateLiteTable) { rowCandidateLiteKf( flagMc, + debugMc, + originMc, candidate.isSelXicToXiPiPi(), candidate.sign(), candidate.y(o2::constants::physics::MassXiCPlus), @@ -508,7 +531,8 @@ struct HfTreeCreatorXicToXiPiPi { candidate.ptProng0(), candidate.ptProng1(), candidate.ptProng2(), - candidate.invMassXic(), + candidate.invMassXicPlus(), + candidate.invMassXi(), candidate.invMassXiPi0(), candidate.invMassXiPi1(), candidate.chi2PCA(), @@ -547,6 +571,8 @@ struct HfTreeCreatorXicToXiPiPi { } else { rowCandidateFullKf( flagMc, + debugMc, + originMc, candidate.isSelXicToXiPiPi(), candidate.sign(), candidate.y(o2::constants::physics::MassXiCPlus), @@ -557,7 +583,8 @@ struct HfTreeCreatorXicToXiPiPi { candidate.ptProng0(), candidate.ptProng1(), candidate.ptProng2(), - candidate.invMassXic(), + candidate.invMassXicPlus(), + candidate.invMassXi(), candidate.invMassXiPi0(), candidate.invMassXiPi1(), candidate.chi2PCA(), @@ -580,25 +607,29 @@ struct HfTreeCreatorXicToXiPiPi { candidate.impactParameterNormalised2(), candidate.maxNormalisedDeltaIP(), // additional columns only stored in the full candidate table - candidate.e(o2::constants::physics::MassXiCPlus), - candidate.posX(), - candidate.posY(), - candidate.posZ(), candidate.xPvErr(), candidate.yPvErr(), candidate.zPvErr(), - candidate.xSecondaryVertex(), - candidate.ySecondaryVertex(), - candidate.zSecondaryVertex(), candidate.xSvErr(), candidate.ySvErr(), candidate.zSvErr(), - candidate.xDecayVtxXi(), - candidate.yDecayVtxXi(), - candidate.zDecayVtxXi(), - candidate.xDecayVtxLambda(), - candidate.yDecayVtxLambda(), - candidate.zDecayVtxLambda(), + candidate.cosPaLambdaToXi(), + candidate.cosPaXYLambdaToXi(), + candidate.pProng1(), + candidate.pProng2(), + candidate.pBachelorPi(), + candidate.pPiFromLambda(), + candidate.pPrFromLambda(), + candidate.nSigTpcPiFromXicPlus0(), + candidate.nSigTpcPiFromXicPlus1(), + candidate.nSigTpcBachelorPi(), + candidate.nSigTpcPiFromLambda(), + candidate.nSigTpcPrFromLambda(), + candidate.nSigTofPiFromXicPlus0(), + candidate.nSigTofPiFromXicPlus1(), + candidate.nSigTofBachelorPi(), + candidate.nSigTofPiFromLambda(), + candidate.nSigTofPrFromLambda(), // KF-specific columns candidate.kfCascadeChi2(), candidate.kfV0Chi2(), @@ -660,8 +691,6 @@ struct HfTreeCreatorXicToXiPiPi { void processMc(SelectedCandidatesMc const& candidates, soa::Join const& particles) { - std::vector arrDaughIndex; - // Filling candidate properties if (fillOnlySignal) { if (fillCandidateLiteTable) { @@ -701,22 +730,14 @@ struct HfTreeCreatorXicToXiPiPi { for (const auto& particle : particles) { if (TESTBIT(std::abs(particle.flagMcMatchGen()), aod::hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiPiPi) || TESTBIT(std::abs(particle.flagMcMatchGen()), aod::hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiResPiToXiPiPi)) { - arrDaughIndex.clear(); - RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{+kXiMinus, +kPiPlus, +kPiPlus}, 2); - auto XicDaugh0 = particles.rawIteratorAt(arrDaughIndex[0]); - rowCandidateFullParticles( + particle.flagMcMatchGen(), + particle.debugMcGen(), + particle.originGen(), particle.pt(), particle.eta(), particle.phi(), - RecoDecay::y(particle.pVector(), o2::constants::physics::MassXiCPlus), - particle.vx(), - particle.vy(), - particle.vz(), - XicDaugh0.vx(), - XicDaugh0.vx(), - XicDaugh0.vz(), - particle.flagMcMatchGen()); + RecoDecay::y(particle.pVector(), o2::constants::physics::MassXiCPlus)); } } // loop over generated particles } @@ -726,8 +747,6 @@ struct HfTreeCreatorXicToXiPiPi { void processMcKf(SelectedCandidatesKfMc const& candidates, soa::Join const& particles) { - std::vector arrDaughIndex; - // Filling candidate properties if (fillOnlySignal) { if (fillCandidateLiteTable) { @@ -766,22 +785,14 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFullParticles.reserve(particles.size()); for (const auto& particle : particles) { if (TESTBIT(std::abs(particle.flagMcMatchGen()), aod::hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiPiPi) || TESTBIT(std::abs(particle.flagMcMatchGen()), aod::hf_cand_xic_to_xi_pi_pi::DecayType::XicToXiResPiToXiPiPi)) { - arrDaughIndex.clear(); - RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{+kXiMinus, +kPiPlus, +kPiPlus}, 2); - auto XicDaugh0 = particles.rawIteratorAt(arrDaughIndex[0]); - rowCandidateFullParticles( + particle.flagMcMatchGen(), + particle.debugMcGen(), + particle.originGen(), particle.pt(), particle.eta(), particle.phi(), - RecoDecay::y(particle.pVector(), o2::constants::physics::MassXiCPlus), - particle.vx(), - particle.vy(), - particle.vz(), - XicDaugh0.vx(), - XicDaugh0.vx(), - XicDaugh0.vz(), - particle.flagMcMatchGen()); + RecoDecay::y(particle.pVector(), o2::constants::physics::MassXiCPlus)); } } // loop over generated particles } @@ -797,8 +808,9 @@ struct HfTreeCreatorXicToXiPiPi { recSig->bindExternalIndices(&tracks); std::vector arrDaughIndex; - int indexRecXic; + int indexRecXicPlus; int8_t sign; + int8_t origin; std::array pvResiduals; std::array svResiduals; std::array pvPulls; @@ -806,8 +818,9 @@ struct HfTreeCreatorXicToXiPiPi { for (const auto& candidate : recSig) { arrDaughIndex.clear(); - indexRecXic = -1; + indexRecXicPlus = -1; sign = 0; + origin = 0; pvResiduals = {-9999.9}; svResiduals = {-9999.9}; pvPulls = {-9999.9}; @@ -819,24 +832,30 @@ struct HfTreeCreatorXicToXiPiPi { candidate.posTrack_as(), // p <- lambda candidate.negTrack_as()}; // pi <- lambda - // get Xic and daughters as MC particle - indexRecXic = RecoDecay::getMatchedMCRec(particles, arrayDaughters, Pdg::kXiCPlus, std::array{+kPiPlus, +kPiPlus, +kPiMinus, +kProton, +kPiMinus}, true, &sign, 4); - if (indexRecXic == -1) { + // get XicPlus as MC particle + indexRecXicPlus = RecoDecay::getMatchedMCRec(particles, arrayDaughters, Pdg::kXiCPlus, std::array{+kPiPlus, +kPiPlus, +kPiMinus, +kProton, +kPiMinus}, true, &sign, 4); + if (indexRecXicPlus == -1) { continue; } - auto XicGen = particles.rawIteratorAt(indexRecXic); - RecoDecay::getDaughters(XicGen, &arrDaughIndex, std::array{+kXiMinus, +kPiPlus, +kPiPlus}, 2); - auto XicDaugh0 = particles.rawIteratorAt(arrDaughIndex[0]); + auto XicPlusGen = particles.rawIteratorAt(indexRecXicPlus); + origin = RecoDecay::getCharmHadronOrigin(particles, XicPlusGen, true); + + // get MC collision + auto mcCollision = XicPlusGen.mcCollision_as(); + + // get XicPlus daughters as MC particle + RecoDecay::getDaughters(XicPlusGen, &arrDaughIndex, std::array{+kXiMinus, +kPiPlus, +kPiPlus}, 2); + auto XicPlusDaugh0 = particles.rawIteratorAt(arrDaughIndex[0]); // calculate residuals and pulls - float pResidual = candidate.p() - XicGen.p(); - float ptResidual = candidate.pt() - XicGen.pt(); - pvResiduals[0] = candidate.posX() - XicGen.vx(); - pvResiduals[1] = candidate.posY() - XicGen.vy(); - pvResiduals[2] = candidate.posZ() - XicGen.vz(); - svResiduals[0] = candidate.xSecondaryVertex() - XicDaugh0.vx(); - svResiduals[1] = candidate.ySecondaryVertex() - XicDaugh0.vy(); - svResiduals[2] = candidate.zSecondaryVertex() - XicDaugh0.vz(); + float pResidual = candidate.p() - XicPlusGen.p(); + float ptResidual = candidate.pt() - XicPlusGen.pt(); + pvResiduals[0] = candidate.posX() - mcCollision.posX(); + pvResiduals[1] = candidate.posY() - mcCollision.posY(); + pvResiduals[2] = candidate.posZ() - mcCollision.posZ(); + svResiduals[0] = candidate.xSecondaryVertex() - XicPlusDaugh0.vx(); + svResiduals[1] = candidate.ySecondaryVertex() - XicPlusDaugh0.vy(); + svResiduals[2] = candidate.zSecondaryVertex() - XicPlusDaugh0.vz(); try { pvPulls[0] = pvResiduals[0] / candidate.xPvErr(); pvPulls[1] = pvResiduals[1] / candidate.yPvErr(); @@ -850,6 +869,7 @@ struct HfTreeCreatorXicToXiPiPi { // fill table rowCandidateResiduals( + origin, pResidual, ptResidual, pvResiduals[0], From 5c5ef6c7ee1fd8e328c35103d39bd1233d119763 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Thu, 28 Nov 2024 10:15:55 +0100 Subject: [PATCH 150/459] Switching matching workflows on by default (#8708) --- .../Matching/Duplicates/jetMatchingDuplicates.cxx | 7 +------ PWGJE/TableProducer/Matching/jetMatchingMC.cxx | 7 +------ PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx | 7 +------ PWGJE/TableProducer/Matching/jetMatchingSub.cxx | 7 +------ 4 files changed, 4 insertions(+), 24 deletions(-) diff --git a/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicates.cxx b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicates.cxx index 981e37a859d..bc4711efae3 100644 --- a/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicates.cxx +++ b/PWGJE/TableProducer/Matching/Duplicates/jetMatchingDuplicates.cxx @@ -53,11 +53,6 @@ struct JetMatchingDuplicates { { } - void processDummy(aod::JetCollisions const&) - { - } - PROCESS_SWITCH(JetMatchingDuplicates, processDummy, "Dummy process", true); - void processJets(aod::JetCollisions const& collisions, JetsBase const& jetsBase, JetsTag const& jetsTag, Tracks const& tracks, Candidates const& candidates) @@ -89,5 +84,5 @@ struct JetMatchingDuplicates { jetsTagtoBaseMatchingTable(jetsTagtoBaseMatchingGeo[i], jetsTagtoBaseMatchingPt[i], jetsTagtoBaseMatchingHF[i]); // is (and needs to) be filled in order } } - PROCESS_SWITCH(JetMatchingDuplicates, processJets, "Perform jet matching", false); + PROCESS_SWITCH(JetMatchingDuplicates, processJets, "Perform jet matching", true); }; diff --git a/PWGJE/TableProducer/Matching/jetMatchingMC.cxx b/PWGJE/TableProducer/Matching/jetMatchingMC.cxx index 78fd5c6a399..39688616eba 100644 --- a/PWGJE/TableProducer/Matching/jetMatchingMC.cxx +++ b/PWGJE/TableProducer/Matching/jetMatchingMC.cxx @@ -61,11 +61,6 @@ struct JetMatchingMc { { } - void processDummy(aod::JetMcCollisions const&) - { - } - PROCESS_SWITCH(JetMatchingMc, processDummy, "Dummy process", true); - void processJets(aod::JetMcCollisions const& mcCollisions, aod::JetCollisionsMCD const& collisions, JetsBase const& jetsBase, JetsTag const& jetsTag, aod::JetTracksMCD const& tracks, @@ -105,7 +100,7 @@ struct JetMatchingMc { jetsTagtoBaseMatchingTable(jetsTagtoBaseMatchingGeo[i], jetsTagtoBaseMatchingPt[i], jetsTagtoBaseMatchingHF[i]); // is (and needs to) be filled in order } } - PROCESS_SWITCH(JetMatchingMc, processJets, "Perform jet matching", false); + PROCESS_SWITCH(JetMatchingMc, processJets, "Perform jet matching", true); }; /*using BplusChargedJetMatching = JetMatchingMc, diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx index f59038170e7..26dc0a63b53 100644 --- a/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx +++ b/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx @@ -55,11 +55,6 @@ struct JetMatchingMcSub { { } - void processDummy(aod::JetCollisions const&) - { - } - PROCESS_SWITCH(JetMatchingMcSub, processDummy, "Dummy process", true); - void processJets(aod::JetCollisions const& collisions, JetsBase const& jetsBase, JetsTag const& jetsTag, aod::JetTracks const& tracks, @@ -93,7 +88,7 @@ struct JetMatchingMcSub { jetsTagtoBaseMatchingTable(jetsTagtoBaseMatchingGeo[i], jetsTagtoBaseMatchingPt[i], jetsTagtoBaseMatchingHF[i]); // is (and needs to) be filled in order } } - PROCESS_SWITCH(JetMatchingMcSub, processJets, "Perform jet matching", false); + PROCESS_SWITCH(JetMatchingMcSub, processJets, "Perform jet matching", true); }; /*using BplusChargedJetMatching = JetMatchingMcSub, diff --git a/PWGJE/TableProducer/Matching/jetMatchingSub.cxx b/PWGJE/TableProducer/Matching/jetMatchingSub.cxx index cdd7c753593..7c31ba437d7 100644 --- a/PWGJE/TableProducer/Matching/jetMatchingSub.cxx +++ b/PWGJE/TableProducer/Matching/jetMatchingSub.cxx @@ -55,11 +55,6 @@ struct JetMatchingSub { { } - void processDummy(aod::JetCollisions const&) - { - } - PROCESS_SWITCH(JetMatchingSub, processDummy, "Dummy process", true); - void processJets(aod::JetCollisions const& collisions, JetsBase const& jetsBase, JetsTag const& jetsTag, aod::JetTracks const& tracks, TracksTag const& tracksSub, Candidates const& candidates) @@ -91,7 +86,7 @@ struct JetMatchingSub { jetsTagtoBaseMatchingTable(jetsTagtoBaseMatchingGeo[i], jetsTagtoBaseMatchingPt[i], jetsTagtoBaseMatchingHF[i]); // is (and needs to) be filled in order } } - PROCESS_SWITCH(JetMatchingSub, processJets, "Perform jet matching", false); + PROCESS_SWITCH(JetMatchingSub, processJets, "Perform jet matching", true); }; /*using BplusChargedJetMatching = JetMatchingSub, From 6efde27f5fd8ea271b8e032d1b444085f428700f Mon Sep 17 00:00:00 2001 From: Christian Reckziegel <57670185+christianreckziegel@users.noreply.github.com> Date: Thu, 28 Nov 2024 07:13:39 -0300 Subject: [PATCH 151/459] [PWGJE] Update to use bitwise operations for selection flags in charm hadronisation (#8613) --- PWGJE/Tasks/hfFragmentationFunction.cxx | 32 ++++++++++++++++--------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/PWGJE/Tasks/hfFragmentationFunction.cxx b/PWGJE/Tasks/hfFragmentationFunction.cxx index 9284c66e6c1..49e1e204358 100644 --- a/PWGJE/Tasks/hfFragmentationFunction.cxx +++ b/PWGJE/Tasks/hfFragmentationFunction.cxx @@ -72,7 +72,7 @@ DECLARE_SOA_COLUMN(JetHfDist, jethfdist, float); DECLARE_SOA_COLUMN(JetPt, jetpt, float); DECLARE_SOA_COLUMN(JetEta, jeteta, float); DECLARE_SOA_COLUMN(JetPhi, jetphi, float); -DECLARE_SOA_COLUMN(JetNConst, jetnconst, float); +DECLARE_SOA_COLUMN(JetNConst, jetnconst, int); DECLARE_SOA_COLUMN(HfPt, hfpt, float); DECLARE_SOA_COLUMN(HfEta, hfeta, float); DECLARE_SOA_COLUMN(HfPhi, hfphi, float); @@ -323,24 +323,29 @@ struct HfFragmentationFunctionTask { registry.fill(HIST("h_jet_counter"), 1.5); } - // reflection information for storage: +1 = D0, -1 = D0bar, 0 = neither + // reflection information for storage: D0 = +1, D0bar = -1, neither = 0 int matchedFrom = 0; int decayChannel = 1 << aod::hf_cand_2prong::DecayType::D0ToPiK; + int selectedAs = 0; if (mcdd0cand.flagMcMatchRec() == decayChannel) { // matched to D0 on truth level matchedFrom = 1; } else if (mcdd0cand.flagMcMatchRec() == -decayChannel) { // matched to D0bar on truth level matchedFrom = -1; - } else { // matched to another kind of particle on truth level - matchedFrom = 0; + } + // bitwise AND operation: Checks whether BIT(i) is set, regardless of other bits + if (mcdd0cand.candidateSelFlag() & BIT(0)) { // CandidateSelFlag == BIT(0) -> selected as D0 + selectedAs = 1; + } else if (mcdd0cand.candidateSelFlag() & BIT(1)) { // CandidateSelFlag == BIT(1) -> selected as D0bar + selectedAs = -1; } // store data in MC detector level table mcddistJetTable(jetutilities::deltaR(mcdjet, mcdd0cand), mcdjet.pt(), mcdjet.eta(), mcdjet.phi(), mcdjet.tracks_as().size(), // detector level jet mcdd0cand.pt(), mcdd0cand.eta(), mcdd0cand.phi(), mcdd0cand.m(), mcdd0cand.y(), (mcdd0cand.originMcRec() == RecoDecay::OriginType::Prompt), // detector level D0 candidate - mcdjet.has_matchedJetCand(), mcdd0cand.mlScores()[0], mcdd0cand.mlScores()[1], mcdd0cand.mlScores()[2], // ML scores for bkg, prompt and non-prompt - matchedFrom, mcdd0cand.candidateSelFlag()); // check whether detector level candidate is a reflection, CandidateSelFlag == 0 -> selected as D0, CandidateSelFlag == 1 -> selected as D0bar + mcdjet.has_matchedJetCand(), mcdd0cand.mlScores()[0], mcdd0cand.mlScores()[1], mcdd0cand.mlScores()[2], // // Machine Learning PID scores: background, prompt, non-prompt + matchedFrom, selectedAs); // D0 = +1, D0bar = -1, neither = 0 } } @@ -409,16 +414,21 @@ struct HfFragmentationFunctionTask { // obtain leading HF candidate in jet auto mcdd0cand = mcdjet.candidates_first_as(); - // reflection information for storage: +1 = D0, -1 = D0bar, 0 = neither + // reflection information for storage: D0 = +1, D0bar = -1, neither = 0 int matchedFrom = 0; int decayChannel = 1 << aod::hf_cand_2prong::DecayType::D0ToPiK; + int selectedAs = 0; if (mcdd0cand.flagMcMatchRec() == decayChannel) { // matched to D0 on truth level matchedFrom = 1; } else if (mcdd0cand.flagMcMatchRec() == -decayChannel) { // matched to D0bar on truth level matchedFrom = -1; - } else { // matched to another kind of particle on truth level - matchedFrom = 0; + } + // bitwise AND operation: Checks whether BIT(i) is set, regardless of other bits + if (mcdd0cand.candidateSelFlag() & BIT(0)) { // CandidateSelFlag == BIT(0) -> selected as D0 + selectedAs = 1; + } else if (mcdd0cand.candidateSelFlag() & BIT(1)) { // CandidateSelFlag == BIT(1) -> selected as D0bar + selectedAs = -1; } // loop through detector level matched to current particle level @@ -434,8 +444,8 @@ struct HfFragmentationFunctionTask { mcpd0cand.pt(), mcpd0cand.eta(), mcpd0cand.phi(), mcpd0cand.y(), (mcpd0cand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level D0 jetutilities::deltaR(mcdjet, mcdd0cand), mcdjet.pt(), mcdjet.eta(), mcdjet.phi(), mcdjet.tracks_as().size(), // detector level jet mcdd0cand.pt(), mcdd0cand.eta(), mcdd0cand.phi(), mcdd0cand.m(), mcdd0cand.y(), (mcdd0cand.originMcRec() == RecoDecay::OriginType::Prompt), // detector level D0 - mcdd0cand.mlScores()[0], mcdd0cand.mlScores()[1], mcdd0cand.mlScores()[2], - matchedFrom, mcdd0cand.candidateSelFlag()); // check whether detector level candidate is a reflection, CandidateSelFlag == 0 -> selected as D0, CandidateSelFlag == 1 -> selected as D0bar + mcdd0cand.mlScores()[0], mcdd0cand.mlScores()[1], mcdd0cand.mlScores()[2], // Machine Learning PID scores: background, prompt, non-prompt + matchedFrom, selectedAs); // D0 = +1, D0bar = -1, neither = 0 } } } From 808d521f82c678d9d45e48e45a0058f673d8005a Mon Sep 17 00:00:00 2001 From: rolavick Date: Thu, 28 Nov 2024 11:53:52 +0100 Subject: [PATCH 152/459] [PWGUD] Refactor of personal task (#8709) Co-authored-by: ALICE Action Bot --- PWGUD/Core/UPCTauCentralBarrelHelperRL.h | 56 +- PWGUD/Tasks/upcTauCentralBarrelRL.cxx | 2597 ++++++++++------------ 2 files changed, 1197 insertions(+), 1456 deletions(-) diff --git a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h index 4b757fdc963..d454cab0296 100644 --- a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h +++ b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h @@ -28,7 +28,23 @@ enum MyParticle { P_MUON = 1, P_PION = 2, P_KAON = 3, - P_PROTON = 4 + P_PROTON = 4, + P_ENUM_COUNTER = 5 +}; + +enum MyTauChannel { + CH_EE = 0, + CH_MUMU = 1, + CH_EMU = 2, + CH_PIPI = 3, + CH_EPI = 4, + CH_MUPI = 5, + CH_FOURPI = 6, + CH_ETHREEPI = 7, + CH_MUTHREEPI = 8, + CH_SIXPI = 9, + CH_EMUPI = 10, + CH_ENUM_COUNTER = 11 }; void printLargeMessage(std::string info) @@ -106,18 +122,18 @@ int testPIDhypothesis(T trackPIDinfo, float maxNsigmaTPC = 5.0, float maxNsigmaT } template -int trackPDG(T trackPIDinfo) +int trackPDG(T trackPIDinfo, float maxNsigmaTPC = 5.0, float maxNsigmaTOF = 5.0, bool useTOF = true, bool useTOFsigmaAfterTPC = true, float nSigmaShift = 0., bool isMC = false) // using testPIDhypothesis, reads enumMyParticle and return pdg value { - if (testPIDhypothesis(trackPIDinfo) == P_ELECTRON) { + if (testPIDhypothesis(trackPIDinfo, maxNsigmaTPC, maxNsigmaTOF, useTOF, useTOFsigmaAfterTPC, nSigmaShift, isMC) == P_ELECTRON) { return 11; - } else if (testPIDhypothesis(trackPIDinfo) == P_MUON) { + } else if (testPIDhypothesis(trackPIDinfo, maxNsigmaTPC, maxNsigmaTOF, useTOF, useTOFsigmaAfterTPC, nSigmaShift, isMC) == P_MUON) { return 13; - } else if (testPIDhypothesis(trackPIDinfo) == P_PION) { + } else if (testPIDhypothesis(trackPIDinfo, maxNsigmaTPC, maxNsigmaTOF, useTOF, useTOFsigmaAfterTPC, nSigmaShift, isMC) == P_PION) { return 211; - } else if (testPIDhypothesis(trackPIDinfo) == P_KAON) { + } else if (testPIDhypothesis(trackPIDinfo, maxNsigmaTPC, maxNsigmaTOF, useTOF, useTOFsigmaAfterTPC, nSigmaShift, isMC) == P_KAON) { return 321; - } else if (testPIDhypothesis(trackPIDinfo) == P_PROTON) { + } else if (testPIDhypothesis(trackPIDinfo, maxNsigmaTPC, maxNsigmaTOF, useTOF, useTOFsigmaAfterTPC, nSigmaShift, isMC) == P_PROTON) { return 2212; } else { printDebugMessage("Something is wrong with track PDG selector"); @@ -198,6 +214,32 @@ double calculateAcoplanarity(double phi_trk1, double phi_trk2) return (o2::constants::math::TwoPI - aco); } +template +int countPhysicalPrimary(Ps particles) +// Function to loop over particles associated to a mcCollision and return total of physical primary particles +{ + int nTotal = 0; + for (auto& particle : particles) { + if (!particle.isPhysicalPrimary()) + continue; + nTotal++; + } + return nTotal; +} + +template +int countParticlesWithoutMother(Ps particles) +// Function to loop over particles associated to a mcCollision and return total of particles without mothers (hopely alternative to isPhysicalPrimary) +{ + int nTotal = 0; + for (auto& particle : particles) { + if (particle.has_mothers()) + continue; + nTotal++; + } + return nTotal; +} + template float getAvgITSClSize(T const& track) { diff --git a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx index 8753acf8c96..01e8f7a5d6a 100644 --- a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx +++ b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx @@ -13,8 +13,11 @@ /// \author Roman Lavicka, roman.lavicka@cern.ch /// \since 12.07.2022 -// #include -// #include +// C++ headers +#include +#include +#include +#include // O2 headers #include "Framework/AnalysisTask.h" @@ -47,770 +50,626 @@ using namespace o2::framework::expressions; struct UpcTauCentralBarrelRL { // Global varialbes - bool isFirstReconstructedCollisions; - int countCollisions; + bool isMC = false; Service pdg; SGSelector sgSelector; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // declare configurables - Configurable verboseInfo{"verboseInfo", true, {"Print general info to terminal; default it true."}}; - Configurable whichGapSide{"whichGapSide", 2, {"0 for side A, 1 for side C, 2 for both sides"}}; - Configurable useTrueGap{"useTrueGap", true, {"Calculate gapSide for a given FV0/FT0/ZDC thresholds"}}; - Configurable cutMyGapSideFV0{"FV0", 100, "FV0A threshold for SG selector"}; - Configurable cutMyGapSideFT0A{"FT0A", 200., "FT0A threshold for SG selector"}; - Configurable cutMyGapSideFT0C{"FT0C", 100., "FT0C threshold for SG selector"}; - Configurable cutMyGapSideZDC{"ZDC", 10., "ZDC threshold for SG selector"}; - Configurable usePIDwithTOF{"usePIDwithTOF", false, {"Determine whether also TOF should be used in testPIDhypothesis"}}; - Configurable usePIDwithTOFsigmaAfterTPC{"usePIDwithTOFsigmaAfterTPC", true, {"Determine whether cut on TOF n sigma should be used after TPC-based decision in testPIDhypothesis"}}; - Configurable cutMyTPCnSigmaEl{"cutMyTPCnSigmaEl", 3.f, {"n sigma cut on el in absolut values"}}; - Configurable cutMyTPCnSigmaMu{"cutMyTPCnSigmaMu", 3.f, {"n sigma cut on mu in absolut values"}}; - Configurable cutMyTPCnSigmaPi{"cutMyTPCnSigmaPi", 3.f, {"n sigma cut on pi in absolut values"}}; - Configurable cutMyNsigmaTPCPIDselector{"cutMyNsigmaTPCPIDselector", 35.f, {"n sigma TPC cut on all particles in absolut values for testPIDhypothesis"}}; - Configurable cutMyNsigmaTOFPIDselector{"cutMyNsigmaTOFPIDselector", 35.f, {"n sigma TOF cut on all particles in absolut values for testPIDhypothesis"}}; - Configurable cutAvgITSclusterSize{"cutAvgITSclusterSize", 2.05f, {"specific study"}}; - Configurable cutPtAvgITSclusterSize{"cutPtAvgITSclusterSize", 0.7f, {"specific study"}}; - Configurable cutMyGlobalTracksOnly{"cutMyGlobalTracksOnly", false, {"Applies cut on here defined global tracks"}}; - Configurable cutMyGTptMin{"cutMyGTptMin", 0.1f, {"MyGlobalTrack cut"}}; - Configurable cutMyGTptMax{"cutMyGTptMax", 1e10f, {"MyGlobalTrack cut"}}; - Configurable cutMyGTetaMin{"cutMyGTetaMin", -0.8f, {"MyGlobalTrack cut"}}; - Configurable cutMyGTetaMax{"cutMyGTetaMax", 0.8f, {"MyGlobalTrack cut"}}; - Configurable cutMyGTdcaZmax{"cutMyGTdcaZmax", 2.f, {"MyGlobalTrack cut"}}; - Configurable cutMyGTdcaXYmax{"cutMyGTdcaXYmax", 1e10f, {"MyGlobalTrack cut"}}; - Configurable cutMyGTdcaXYusePt{"cutMyGTdcaXYusePt", false, {"MyGlobalTrack cut"}}; - Configurable cutMyHasITS{"cutMyHasITS", true, {"MyGlobalTrack cut"}}; - Configurable cutMyGTitsNClsMin{"cutMyGTitsNClsMin", 1, {"MyGlobalTrack cut"}}; - Configurable cutMyGTitsChi2NclMax{"cutMyGTitsChi2NclMax", 36.f, {"MyGlobalTrack cut"}}; - Configurable cutMyGTitsHitsRule{"cutMyGTitsHitsRule", 0, {"MyGlobalTrack cut"}}; - Configurable cutMyHasTPC{"cutMyHasTPC", true, {"MyGlobalTrack cut"}}; - Configurable cutMyGTtpcNClsMin{"cutMyGTtpcNClsMin", 1, {"MyGlobalTrack cut"}}; - Configurable cutMyGTtpcNClsCrossedRowsMin{"cutMyGTtpcNClsCrossedRowsMin", 70, {"MyGlobalTrack cut"}}; - Configurable cutMyGTtpcNClsCrossedRowsOverNClsMin{"cutMyGTtpcNClsCrossedRowsOverNClsMin", 0.8f, {"MyGlobalTrack cut"}}; - Configurable cutMyGTtpcChi2NclMax{"cutMyGTtpcChi2NclMax", 4.f, {"MyGlobalTrack cut"}}; - Configurable applyTauEventSelection{"applyTauEventSelection", true, {"Select event"}}; - Configurable doMainHistos{"doMainHistos", true, {"Fill main histos"}}; - Configurable doPIDhistos{"doPIDhistos", true, {"Fill PID histos"}}; - Configurable doTwoTracks{"doTwoTracks", true, {"Define histos for two tracks and allow to fill them"}}; - Configurable doPionStudy{"doPionStudy", false, {"Define histos for two pions and allow to fill them"}}; - Configurable doMuonStudy{"doMuonStudy", false, {"Define histos for two muons and allow to fill them"}}; - Configurable doJpsiMuMuTests{"doJpsiMuMuTests", false, {"Define specific-tests histos for two muons and allow to fill them"}}; + Configurable verboseInfo{"verboseInfo", false, {"Print general info to terminal; default it false."}}; + Configurable doMainHistos{"doMainHistos", false, {"Fill main histos"}}; + Configurable doPIDhistos{"doPIDhistos", false, {"Fill PID histos"}}; + Configurable doTruthHistos{"doTruthHistos", false, {"Do histograms specific for generated events/particles"}}; + Configurable doMCtrueElectronCheck{"doMCtrueElectronCheck", false, {"Check if track hypothesis corresponds to MC truth. If no, it cuts."}}; + Configurable oppositeMCtrueElectronCheck{"oppositeMCtrueElectronCheck", false, {"While doMCtrueElectronCheck is true, check if track hypothesis corresponds to MC truth. If yes, it cuts."}}; + Configurable doTwoTracks{"doTwoTracks", false, {"Define histos for two tracks and allow to fill them"}}; Configurable doFourTracks{"doFourTracks", false, {"Define histos for four tracks and allow to fill them"}}; - Configurable doFourTrackPsi2S{"doFourTrackPsi2S", true, {"Define histos for Psi2S into four charged tracks (pi/mu) and allow to fill them"}}; Configurable doSixTracks{"doSixTracks", false, {"Define histos for six tracks and allow to fill them"}}; - ConfigurableAxis axisNtracks{"axisNtracks", {30, -0.5, 29.5}, "Number of tracks in collision"}; - ConfigurableAxis axisZvtx{"axisZvtx", {40, -20., 20.}, "Z-vertex position (cm)"}; - ConfigurableAxis axisInvMass{"axisInvMass", {400, 1., 5.}, "Invariant mass (GeV/c^{2})"}; - ConfigurableAxis axisInvMassWide{"axisInvMassWide", {1000, 0., 10.}, "Invariant mass (GeV/c^{2}), wider range"}; - ConfigurableAxis axisMom{"axisMom", {400, 0., 2.}, "Momentum (GeV/c)"}; - ConfigurableAxis axisMomWide{"axisMomWide", {1000, 0., 10.}, "Momentum (GeV/c), wider range"}; - ConfigurableAxis axisMomSigned{"axisMomSigned", {800, -2., 2.}, "Signed momentum (GeV/c)"}; - ConfigurableAxis axisPt{"axisPt", {400, 0., 2.}, "Transversal momentum (GeV/c)"}; - ConfigurableAxis axisPhi{"axisPhi", {64, -2 * o2::constants::math::PI, 2 * o2::constants::math::PI}, "Azimuthal angle (a.y.)"}; - ConfigurableAxis axisModPhi{"axisModPhi", {400, 0., .4}, "Track fmod(#phi,#pi/9)"}; - ConfigurableAxis axisEta{"axisEta", {50, -1.2, 1.2}, "Pseudorapidity (a.u.)"}; - ConfigurableAxis axisRap{"axisRap", {50, -1.2, 1.2}, "Rapidity (a.u.)"}; - ConfigurableAxis axisAcoplanarity{"axisAcoplanarity", {32, 0.0, o2::constants::math::PI}, "Acoplanarity (rad)"}; - ConfigurableAxis axisTPCdEdx{"axisTPCdEdx", {2000, 0., 200.}, "TPC dE/dx (a.u.)"}; - ConfigurableAxis axisTOFsignal{"axisTOFsignal", {2500, -10000., 40000.}, "TOF signal (a.u.)"}; - ConfigurableAxis axisNsigma{"axisNsigma", {200, -10., 10.}, "n sigma"}; - ConfigurableAxis axisDCA{"axisDCA", {100, -0.5, 0.5}, "DCA (cm)"}; - ConfigurableAxis axisAvgITSclsSizes{"axisAvgITSclsSizes", {500, 0., 10.}, "ITS average cluster size"}; - ConfigurableAxis axisITSnCls{"axisITSnCls", {8, -0.5, 7.5}, "ITS n clusters"}; - ConfigurableAxis axisITSchi2{"axisITSchi2", {100, 0, 50}, "UTS chi2"}; - ConfigurableAxis axisTPCnCls{"axisTPCnCls", {165, -0.5, 164.5}, "TPC n clusters"}; - ConfigurableAxis axisTPCxRwsFrac{"axisTPCxRwsFrac", {200, 0.0, 2.0}, "TPC fraction of crossed raws"}; - ConfigurableAxis axisTPCchi2{"axisTPCchi2", {100, 0, 10}, "TPC chi2"}; + struct : ConfigurableGroup { + Configurable whichGapSide{"whichGapSide", 2, {"0 for side A, 1 for side C, 2 for both sides"}}; + Configurable useTrueGap{"useTrueGap", true, {"Calculate gapSide for a given FV0/FT0/ZDC thresholds"}}; + Configurable cutTrueGapSideFV0{"TrueGapFV0", 100, "FV0A threshold for SG selector"}; + Configurable cutTrueGapSideFT0A{"TrueGapFT0A", 200., "FT0A threshold for SG selector"}; + Configurable cutTrueGapSideFT0C{"TrueGapFT0C", 100., "FT0C threshold for SG selector"}; + Configurable cutTrueGapSideZDC{"TrueGapZDC", 1000., "ZDC threshold for SG selector"}; + Configurable cutFITtime{"cutFITtime", 40., "Maximum FIT time allowed. Default is 4ns"}; + Configurable applyAcceptanceSelection{"applyAcceptanceSelection", false, {"Select events in ALICE CB acceptance set with cutTrackEta"}}; + Configurable cutTrackEta{"cutTrackEta", 0.9, "Cut on central barrel track eta in absolute values."}; + } cutSample; + + struct : ConfigurableGroup { + Configurable applyGlobalTrackSelection{"applyGlobalTrackSelection", false, {"Applies cut on here defined global tracks"}}; + Configurable cutMinPt{"cutMinPt", 0.1f, {"Global track cut"}}; + Configurable cutMaxPt{"cutMaxPt", 1e10f, {"Global track cut"}}; + Configurable cutMinEta{"cutMinEta", -0.8f, {"Global track cut"}}; + Configurable cutMaxEta{"cutMaxEta", 0.8f, {"Global track cut"}}; + Configurable cutMaxDCAz{"cutMaxDCAz", 2.f, {"Global track cut"}}; + Configurable cutMaxDCAxy{"cutMaxDCAxy", 1e10f, {"Global track cut"}}; + Configurable applyPtDependentDCAxy{"applyPtDependentDCAxy", false, {"Global track cut"}}; + Configurable cutHasITS{"cutHasITS", true, {"Global track cut"}}; + Configurable cutMinITSnCls{"cutMinITSnCls", 1, {"Global track cut"}}; + Configurable cutMaxITSchi2{"cutMaxITSchi2", 36.f, {"Global track cut"}}; + Configurable cutITShitsRule{"cutITShitsRule", 0, {"Global track cut"}}; + Configurable cutHasTPC{"cutHasTPC", true, {"Global track cut"}}; + Configurable cutMinTPCnCls{"cutMinTPCnCls", 1, {"Global track cut"}}; + Configurable cutMinTPCnClsXrows{"cutMinTPCnClsXrows", 70, {"Global track cut"}}; + Configurable cutMinTPCnClsXrowsOverNcls{"cutMinTPCnClsXrowsOverNcls", 0.8f, {"Global track cut"}}; + Configurable cutMaxTPCchi2{"cutMaxTPCchi2", 4.f, {"Global track cut"}}; + } cutGlobalTrack; + + struct : ConfigurableGroup { + Configurable applyTauEventSelection{"applyTauEventSelection", true, {"Select tau event."}}; + Configurable cutOppositeCharge{"cutOppositeCharge", true, {"Tracks have opposite charge."}}; + Configurable cutAcoplanarity{"cutAcoplanarity", 4 * o2::constants::math::PI / 5, {"Opening angle of the tracks. What is more goes away."}}; + Configurable cutElectronHasTOF{"cutElectronHasTOF", true, {"Electron is required to hit TOF."}}; + Configurable cutGoodElectron{"cutGoodElectron", true, {"Select good electron."}}; + Configurable cutOutRho{"cutOutRho", false, {"Cut out rho mass under two tracks are pions hypothesis"}}; + Configurable cutOnRho{"cutOnRho", false, {"Cut on rho mass under two tracks are pions hypothesis"}}; + Configurable cutMinRhoMass{"cutMinRhoMass", 0.6, {"Lower limit on the rho mass region for cut"}}; + Configurable cutMaxRhoMass{"cutMaxRhoMass", 0.95, {"Higher limit on the rho mass region for cut"}}; + Configurable cutMinElectronNsigma{"cutMinElectronNsigma", 2.0, {"Upper n sigma cut on el hypo of selected electron. What is more goes away."}}; + Configurable cutMaxElectronNsigma{"cutMaxElectronNsigma", -1.0, {"Lower n sigma cut on el hypo of selected electron. What is less goes away."}}; + Configurable cutMinElectronPiNsigma{"cutMinElectronPiNsigma", -99.0, {"Upper n sigma cut on pi hypo of selected electron. What is less till lower cut goes away."}}; + Configurable cutMaxElectronPiNsigma{"cutMaxElectronPiNsigma", 99.0, {"Lower n sigma cut on pi hypo of selected electron. What is more till upper cut goes away."}}; + } cutTauEvent; + + struct : ConfigurableGroup { + Configurable usePIDwTOF{"usePIDwTOF", false, {"Determine whether also TOF should be used in testPIDhypothesis"}}; + Configurable useScutTOFinTPC{"useScutTOFinTPC", true, {"Determine whether cut on TOF n sigma should be used after TPC-based decision in testPIDhypothesis"}}; + Configurable cutSiTPC{"cutSiTPC", 35.f, {"n sigma TPC cut on all particles in absolut values for testPIDhypothesis"}}; + Configurable cutSiTOF{"cutSiTOF", 35.f, {"n sigma TOF cut on all particles in absolut values for testPIDhypothesis"}}; + } cutPID; + + struct : ConfigurableGroup { + ConfigurableAxis axisNtracks{"axisNtracks", {30, -0.5, 29.5}, "Number of tracks in collision"}; + ConfigurableAxis axisNparticles{"axisNparticles", {100, -0.5, 99.5}, "Number of particles in collision"}; + ConfigurableAxis axisZvtx{"axisZvtx", {40, -20., 20.}, "Z-vertex position (cm)"}; + ConfigurableAxis axisInvMass{"axisInvMass", {400, 1., 5.}, "Invariant mass (GeV/c^{2})"}; + ConfigurableAxis axisInvMassWide{"axisInvMassWide", {1000, 0., 10.}, "Invariant mass (GeV/c^{2}), wider range"}; + ConfigurableAxis axisMom{"axisMom", {400, 0., 2.}, "Momentum (GeV/c)"}; + ConfigurableAxis axisMomWide{"axisMomWide", {1000, 0., 10.}, "Momentum (GeV/c), wider range"}; + ConfigurableAxis axisMomSigned{"axisMomSigned", {800, -2., 2.}, "Signed momentum (GeV/c)"}; + ConfigurableAxis axisPt{"axisPt", {400, 0., 2.}, "Transversal momentum (GeV/c)"}; + ConfigurableAxis axisPhi{"axisPhi", {64, -2 * o2::constants::math::PI, 2 * o2::constants::math::PI}, "Azimuthal angle (a.y.)"}; + ConfigurableAxis axisModPhi{"axisModPhi", {400, 0., .4}, "Track fmod(#phi,#pi/9)"}; + ConfigurableAxis axisEta{"axisEta", {50, -1.2, 1.2}, "Pseudorapidity (a.u.)"}; + ConfigurableAxis axisRap{"axisRap", {50, -1.2, 1.2}, "Rapidity (a.u.)"}; + ConfigurableAxis axisAcoplanarity{"axisAcoplanarity", {32, 0.0, o2::constants::math::PI}, "Acoplanarity (rad)"}; + ConfigurableAxis axisTPCdEdx{"axisTPCdEdx", {2000, 0., 200.}, "TPC dE/dx (a.u.)"}; + ConfigurableAxis axisTOFsignal{"axisTOFsignal", {2500, -10000., 40000.}, "TOF signal (a.u.)"}; + ConfigurableAxis axisNsigma{"axisNsigma", {200, -10., 10.}, "n sigma"}; + ConfigurableAxis axisDCA{"axisDCA", {100, -0.5, 0.5}, "DCA (cm)"}; + ConfigurableAxis axisAvgITSclsSizes{"axisAvgITSclsSizes", {500, 0., 10.}, "ITS average cluster size"}; + ConfigurableAxis axisITSnCls{"axisITSnCls", {8, -0.5, 7.5}, "ITS n clusters"}; + ConfigurableAxis axisITSchi2{"axisITSchi2", {100, 0, 50}, "UTS chi2"}; + ConfigurableAxis axisTPCnCls{"axisTPCnCls", {165, -0.5, 164.5}, "TPC n clusters"}; + ConfigurableAxis axisTPCxRwsFrac{"axisTPCxRwsFrac", {200, 0.0, 2.0}, "TPC fraction of crossed raws"}; + ConfigurableAxis axisTPCchi2{"axisTPCchi2", {100, 0, 10}, "TPC chi2"}; + ConfigurableAxis axisFITtime{"axisFITtime", {201, -40.5, 40.5}, "FIT time in ns"}; + ConfigurableAxis axisFITamplitude{"axisFITamplitude", {1000, 0., 1000.}, "FIT amplitude"}; + + AxisSpec axisChannels{CH_ENUM_COUNTER, -0.5, CH_ENUM_COUNTER - 0.5, "Channels (-)"}; + } confAxis; using FullUDTracks = soa::Join; using FullUDCollision = soa::Join::iterator; using FullSGUDCollision = soa::Join::iterator; - - TF1* funcPhiCutL = nullptr; - TF1* funcPhiCutH = nullptr; + using FullMCUDTracks = soa::Join; + using FullMCUDCollision = soa::Join::iterator; + using FullMCSGUDCollision = soa::Join::iterator; // init void init(InitContext&) { - mySetITShitsRule(cutMyGTitsHitsRule); - if (verboseInfo) - printLargeMessage("INIT METHOD"); - countCollisions = 0; - isFirstReconstructedCollisions = true; - - histos.add("Events/hCountCollisions", ";;Number of analysed collision (-)", HistType::kTH1D, {{1, 0.5, 1.5}}); - histos.add("Events/UDtableGapSide", ";GapSide value from UD table (-);Number of events (-)", HistType::kTH1D, {{4, -1.5, 2.5}}); - histos.add("Events/TrueGapSideDiffToTableValue", ";Difference trueGapSide from SGselector and gapSide from UD table (-);Number of events (-)", HistType::kTH1D, {{7, -3.5, 3.5}}); - histos.add("Events/hNreconstructedTracks", ";Number of tracks in a collision (-);Number of events (-)", HistType::kTH1D, {axisNtracks}); - histos.add("Events/hNreconstructedPVGT", ";Number of good track particles from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {axisNtracks}); - histos.add("Events/hNreconstructedNotPVGT", ";Number of good track particles from NOT primary vertex in a collision (-);Number of events (-);Number of events (-)", HistType::kTH1D, {axisNtracks}); - histos.add("Events/hNreconstructedPVGTelectrons", ";Number of good track identified electrons from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {axisNtracks}); - histos.add("Events/hNreconstructedPVGTmuons", ";Number of good track identified muons from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {axisNtracks}); - histos.add("Events/hNreconstructedPVGTpions", ";Number of good track identified pions from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {axisNtracks}); - histos.add("Events/hNreconstructedPVGTothers", ";Number of good track NOT identified electron/muon/pion particles from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {axisNtracks}); - histos.add("Events/hChannelsRatio", ";Channels (-);Number of events (-)", HistType::kTH1D, {{10, -0.5, 9.5}}); - - histos.add("Tracks/raw/hTrackZ", ";Track z-vertex (cm);Number of events (-)", HistType::kTH1D, {axisZvtx}); - histos.add("Tracks/raw/hTrackP", ";Track #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("Tracks/raw/hTrackPt", ";Track #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("Tracks/raw/hTrackPhi", ";Track #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("Tracks/raw/hTrackPtvsModPhi", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("Tracks/raw/hTrackPtvsModPhiTOF", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("Tracks/raw/hTrackEta", ";Track #eta (-);Number of events (-)", HistType::kTH1D, {axisEta}); - histos.add("Tracks/raw/hTrackDcaXY", ";Track DCA_{XY} (cm);Number of events (-)", HistType::kTH1D, {axisDCA}); - histos.add("Tracks/raw/hTrackPtvsDcaXY", ";Track #it{p_{T}} (GeV/c);Track DCA_{XY} (cm)", HistType::kTH2D, {axisPt, axisDCA}); - histos.add("Tracks/raw/hTrackDcaZ", ";Track DCA_{Z} (cm);Number of events (-)", HistType::kTH1D, {axisDCA}); - histos.add("Tracks/raw/ITS/itsNCls", "number of found ITS clusters;# clusters ITS", kTH1D, {axisITSnCls}); - histos.add("Tracks/raw/ITS/itsChi2NCl", "chi2 per ITS cluster;chi2 / cluster ITS", kTH1D, {axisITSchi2}); - histos.add("Tracks/raw/TPC/tpcNClsFindable", "number of findable TPC clusters;# findable clusters TPC", kTH1D, {axisTPCnCls}); - histos.add("Tracks/raw/TPC/tpcNClsFound", "number of found TPC clusters;# clusters TPC", kTH1D, {axisTPCnCls}); - histos.add("Tracks/raw/TPC/tpcCrossedRows", "number of crossed TPC rows;# crossed rows TPC", kTH1D, {axisTPCnCls}); - histos.add("Tracks/raw/TPC/tpcCrossedRowsOverFindableCls", "crossed TPC rows over findable clusters;crossed rows / findable clusters TPC", kTH1D, {axisTPCxRwsFrac}); - histos.add("Tracks/raw/TPC/tpcChi2NCl", "chi2 per cluster in TPC;chi2 / cluster TPC", kTH1D, {axisTPCchi2}); - histos.add("Tracks/raw/PID/hTPCsignalVsZ", "All tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisZvtx, axisTPCdEdx}); - histos.add("Tracks/raw/PID/hTPCsignalVsP", "All tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("Tracks/raw/PID/hTPCsignalVsPt", "All tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPt, axisTPCdEdx}); - histos.add("Tracks/raw/PID/hTPCsignalVsEta", "All tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisEta, axisTPCdEdx}); - histos.add("Tracks/raw/PID/hTPCsignalVsPhi", "All tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPhi, axisTPCdEdx}); - histos.add("Tracks/raw/PID/hTOFsignalVsP", "All tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsZ", "Positively charged tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisZvtx, axisTPCdEdx}); - histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsP", "Positively charged tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsPt", "Positively charged tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPt, axisTPCdEdx}); - histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsEta", "Positively charged tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisEta, axisTPCdEdx}); - histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsPhi", "Positively charged tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPhi, axisTPCdEdx}); - histos.add("Tracks/raw/PID/PosCharge/hTOFsignalVsP", "Positively charged tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsZ", "Negatively charged tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisZvtx, axisTPCdEdx}); - histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsP", "Negatively charged tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsPt", "Negatively charged tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPt, axisTPCdEdx}); - histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsEta", "Negatively charged tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisEta, axisTPCdEdx}); - histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsPhi", "Negatively charged tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPhi, axisTPCdEdx}); - histos.add("Tracks/raw/PID/NegCharge/hTOFsignalVsP", "Negatively charged tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - - histos.add("Tracks/GoodTrack/hTrackZ", ";Track z-vertex (cm);Number of events (-)", HistType::kTH1D, {axisZvtx}); - histos.add("Tracks/GoodTrack/hTrackP", ";Track #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("Tracks/GoodTrack/hTrackPt", ";Track #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("Tracks/GoodTrack/hTrackPhi", ";Track #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("Tracks/GoodTrack/hTrackPtvsModPhi", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("Tracks/GoodTrack/hTrackPtvsModPhiTOF", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("Tracks/GoodTrack/hTrackEta", ";Track #eta (-);Number of events (-)", HistType::kTH1D, {axisEta}); - histos.add("Tracks/GoodTrack/hTrackDcaXY", ";Track DCA_{XY} (cm);Number of events (-)", HistType::kTH1D, {axisDCA}); - histos.add("Tracks/GoodTrack/hTrackPtvsDcaXY", ";Track #it{p_{T}} (GeV/c);Track DCA_{XY} (cm)", HistType::kTH2D, {axisPt, axisDCA}); - histos.add("Tracks/GoodTrack/hTrackDcaZ", ";Track DCA_{Z} (cm);Number of events (-)", HistType::kTH1D, {axisDCA}); - histos.add("Tracks/GoodTrack/ITS/itsNCls", "number of found ITS clusters;# clusters ITS", kTH1D, {axisITSnCls}); - histos.add("Tracks/GoodTrack/ITS/itsChi2NCl", "chi2 per ITS cluster;chi2 / cluster ITS", kTH1D, {axisITSchi2}); - histos.add("Tracks/GoodTrack/TPC/tpcNClsFindable", "number of findable TPC clusters;# findable clusters TPC", kTH1D, {axisTPCnCls}); - histos.add("Tracks/GoodTrack/TPC/tpcNClsFound", "number of found TPC clusters;# clusters TPC", kTH1D, {axisTPCnCls}); - histos.add("Tracks/GoodTrack/TPC/tpcCrossedRows", "number of crossed TPC rows;# crossed rows TPC", kTH1D, {axisTPCnCls}); - histos.add("Tracks/GoodTrack/TPC/tpcCrossedRowsOverFindableCls", "crossed TPC rows over findable clusters;crossed rows / findable clusters TPC", kTH1D, {axisTPCxRwsFrac}); - histos.add("Tracks/GoodTrack/TPC/tpcChi2NCl", "chi2 per cluster in TPC;chi2 / cluster TPC", kTH1D, {axisTPCchi2}); - histos.add("Tracks/GoodTrack/PID/hTPCsignalVsZ", "All good tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisZvtx, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/hTPCsignalVsP", "All good tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/hTPCsignalVsPt", "All good tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPt, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/hTPCsignalVsEta", "All good tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisEta, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/hTPCsignalVsPhi", "All good tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPhi, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/hTOFsignalVsP", "All good tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsZ", "Positively charged good tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisZvtx, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsP", "Positively charged good tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsPt", "Positively charged good tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPt, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsEta", "Positively charged good tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisEta, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsPhi", "Positively charged good tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPhi, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/PosCharge/hTOFsignalVsP", "Positively charged good tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsZ", "Negatively charged good tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisZvtx, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsP", "Negatively charged good tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsPt", "Negatively charged good tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPt, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsEta", "Negatively charged good tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisEta, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsPhi", "Negatively charged good tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPhi, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/NegCharge/hTOFsignalVsP", "Negatively charged good tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsZ", "Identified electrons;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisZvtx, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsP", "Identified electrons;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsPt", "Identified electrons;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPt, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsEta", "Identified electrons;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisEta, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsPhi", "Identified electrons;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPhi, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Electron/hTOFsignalVsP", "Identified electrons;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaVsP", "Identified electrons;Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaVsP", "Identified electrons;Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsMu", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsMu", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{#mu}_{TOF} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsPi", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsPi", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsKa", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{#it{K}}_{TPC} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsKa", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{#it{K}}_{TOF} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsPr", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsPr", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{p}_{TOF} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsZ", "Identified muons;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisZvtx, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsP", "Identified muons;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsPt", "Identified muons;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPt, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsEta", "Identified muons;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisEta, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsPhi", "Identified muons;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPhi, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Muon/hTOFsignalVsP", "Identified muons;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaVsP", "Identified muons;Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaVsP", "Identified muons;Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsEl", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{#it{e}}_{TPC} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsEl", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{#it{e}}_{TOF} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsPi", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsPi", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsKa", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{#it{K}}_{TPC} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsKa", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{#it{K}}_{TOF} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsPr", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsPr", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{p}_{TOF} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsZ", "Identified pions;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisZvtx, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsP", "Identified pions;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsPt", "Identified pions;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPt, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsEta", "Identified pions;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisEta, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsPhi", "Identified pions;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPhi, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Pion/hTOFsignalVsP", "Identified pions;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaVsP", "Identified pions;Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaVsP", "Identified pions;Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsEl", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{#it{e}}_{TPC} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsEl", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{#it{e}}_{TOF} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsMu", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsMu", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{#mu}_{TOF} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsKa", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{#it{K}}_{TPC} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsKa", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{#it{K}}_{TOF} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsPr", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsPr", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{p}_{TOF} (arb. units)", HistType::kTH2D, {axisNsigma, axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsZ", "Identified NOT electron/Muon/Pion;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisZvtx, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsP", "Identified NOT electron/Muon/Pion;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsPt", "Identified NOT electron/Muon/Pion;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPt, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsEta", "Identified NOT electron/Muon/Pion;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisEta, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsPhi", "Identified NOT electron/Muon/Pion;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisPhi, axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Others/hTOFsignalVsP", "Identified NOT electron/Muon/Pion;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); + printMediumMessage("INIT METHOD"); + + mySetITShitsRule(cutGlobalTrack.cutITShitsRule); + + if (doMainHistos) { + histos.add("Events/hCountCollisions", ";;Number of analysed collision (-)", HistType::kTH1D, {{1, 0.5, 1.5}}); + histos.add("Events/UDtableGapSide", ";GapSide value from UD table (-);Number of events (-)", HistType::kTH1D, {{4, -1.5, 2.5}}); + histos.add("Events/TrueGapSideDiffToTableValue", ";Difference trueGapSide from SGselector and gapSide from UD table (-);Number of events (-)", HistType::kTH1D, {{7, -3.5, 3.5}}); + histos.add("Events/hNreconstructedTracks", ";Number of tracks in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); + histos.add("Events/hNreconstructedPVGT", ";Number of good track particles from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); + histos.add("Events/hNreconstructedNotPVGT", ";Number of good track particles from NOT primary vertex in a collision (-);Number of events (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); + histos.add("Events/hNreconstructedPVGTelectrons", ";Number of good track identified electrons from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); + histos.add("Events/hNreconstructedPVGTmuons", ";Number of good track identified muons from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); + histos.add("Events/hNreconstructedPVGTpions", ";Number of good track identified pions from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); + histos.add("Events/hNreconstructedPVGTothers", ";Number of good track NOT identified electron/muon/pion particles from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); + histos.add("Events/hChannels", ";Channels (-);Number of events (-)", HistType::kTH1D, {{confAxis.axisChannels}}); + histos.add("Events/FIT/hAmplitudeFT0A", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITamplitude}}); + histos.add("Events/FIT/hAmplitudeFT0C", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITamplitude}}); + histos.add("Events/FIT/hAmplitudeFDDA", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITamplitude}}); + histos.add("Events/FIT/hAmplitudeFDDC", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITamplitude}}); + histos.add("Events/FIT/hAmplitudeFV0A", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITamplitude}}); + histos.add("Events/FIT/hTimeFT0A", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITtime}}); + histos.add("Events/FIT/hTimeFT0C", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITtime}}); + histos.add("Events/FIT/hTimeFDDA", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITtime}}); + histos.add("Events/FIT/hTimeFDDC", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITtime}}); + histos.add("Events/FIT/hTimeFV0A", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITtime}}); + histos.add("Events/FIT/hTimeFT0AvsFT0C", ";FT0A time (ns);FT0C time (ns)", HistType::kTH2F, {{confAxis.axisFITtime}, {confAxis.axisFITtime}}); + histos.add("Events/FIT/hTimeFT0CvsFDDA", ";FT0C time (ns);FDDA time (ns)", HistType::kTH2F, {{confAxis.axisFITtime}, {confAxis.axisFITtime}}); + histos.add("Events/FIT/hTimeFDDAvsFDDC", ";FDDA time (ns);FDDC time (ns)", HistType::kTH2F, {{confAxis.axisFITtime}, {confAxis.axisFITtime}}); + histos.add("Events/FIT/hTimeFDDCvsFV0A", ";FDDC time (ns);FV0A time (ns)", HistType::kTH2F, {{confAxis.axisFITtime}, {confAxis.axisFITtime}}); + histos.add("Events/FIT/hTimeFV0AvsFT0A", ";FV0A time (ns);FT0A time (ns)", HistType::kTH2F, {{confAxis.axisFITtime}, {confAxis.axisFITtime}}); + + histos.add("Tracks/raw/hTrackZ", ";Track z-vertex (cm);Number of events (-)", HistType::kTH1D, {confAxis.axisZvtx}); + histos.add("Tracks/raw/hTrackP", ";Track #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("Tracks/raw/hTrackPt", ";Track #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("Tracks/raw/hTrackPhi", ";Track #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("Tracks/raw/hTrackPtvsModPhi", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("Tracks/raw/hTrackPtvsModPhiTOF", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("Tracks/raw/hTrackEta", ";Track #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); + histos.add("Tracks/raw/hTrackDcaXY", ";Track DCA_{XY} (cm);Number of events (-)", HistType::kTH1D, {confAxis.axisDCA}); + histos.add("Tracks/raw/hTrackPtvsDcaXY", ";Track #it{p_{T}} (GeV/c);Track DCA_{XY} (cm)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisDCA}); + histos.add("Tracks/raw/hTrackDcaZ", ";Track DCA_{Z} (cm);Number of events (-)", HistType::kTH1D, {confAxis.axisDCA}); + histos.add("Tracks/raw/ITS/itsNCls", "number of found ITS clusters;# clusters ITS", kTH1D, {confAxis.axisITSnCls}); + histos.add("Tracks/raw/ITS/itsChi2NCl", "chi2 per ITS cluster;chi2 / cluster ITS", kTH1D, {confAxis.axisITSchi2}); + histos.add("Tracks/raw/TPC/tpcNClsFindable", "number of findable TPC clusters;# findable clusters TPC", kTH1D, {confAxis.axisTPCnCls}); + histos.add("Tracks/raw/TPC/tpcNClsFound", "number of found TPC clusters;# clusters TPC", kTH1D, {confAxis.axisTPCnCls}); + histos.add("Tracks/raw/TPC/tpcCrossedRows", "number of crossed TPC rows;# crossed rows TPC", kTH1D, {confAxis.axisTPCnCls}); + histos.add("Tracks/raw/TPC/tpcCrossedRowsOverFindableCls", "crossed TPC rows over findable clusters;crossed rows / findable clusters TPC", kTH1D, {confAxis.axisTPCxRwsFrac}); + histos.add("Tracks/raw/TPC/tpcChi2NCl", "chi2 per cluster in TPC;chi2 / cluster TPC", kTH1D, {confAxis.axisTPCchi2}); + histos.add("Tracks/GoodTrack/hTrackZ", ";Track z-vertex (cm);Number of events (-)", HistType::kTH1D, {confAxis.axisZvtx}); + histos.add("Tracks/GoodTrack/hTrackP", ";Track #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("Tracks/GoodTrack/hTrackPt", ";Track #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("Tracks/GoodTrack/hTrackPhi", ";Track #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("Tracks/GoodTrack/hTrackPtvsModPhi", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("Tracks/GoodTrack/hTrackPtvsModPhiTOF", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("Tracks/GoodTrack/hTrackEta", ";Track #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); + histos.add("Tracks/GoodTrack/hTrackDcaXY", ";Track DCA_{XY} (cm);Number of events (-)", HistType::kTH1D, {confAxis.axisDCA}); + histos.add("Tracks/GoodTrack/hTrackPtvsDcaXY", ";Track #it{p_{T}} (GeV/c);Track DCA_{XY} (cm)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisDCA}); + histos.add("Tracks/GoodTrack/hTrackDcaZ", ";Track DCA_{Z} (cm);Number of events (-)", HistType::kTH1D, {confAxis.axisDCA}); + histos.add("Tracks/GoodTrack/ITS/itsNCls", "number of found ITS clusters;# clusters ITS", kTH1D, {confAxis.axisITSnCls}); + histos.add("Tracks/GoodTrack/ITS/itsChi2NCl", "chi2 per ITS cluster;chi2 / cluster ITS", kTH1D, {confAxis.axisITSchi2}); + histos.add("Tracks/GoodTrack/TPC/tpcNClsFindable", "number of findable TPC clusters;# findable clusters TPC", kTH1D, {confAxis.axisTPCnCls}); + histos.add("Tracks/GoodTrack/TPC/tpcNClsFound", "number of found TPC clusters;# clusters TPC", kTH1D, {confAxis.axisTPCnCls}); + histos.add("Tracks/GoodTrack/TPC/tpcCrossedRows", "number of crossed TPC rows;# crossed rows TPC", kTH1D, {confAxis.axisTPCnCls}); + histos.add("Tracks/GoodTrack/TPC/tpcCrossedRowsOverFindableCls", "crossed TPC rows over findable clusters;crossed rows / findable clusters TPC", kTH1D, {confAxis.axisTPCxRwsFrac}); + histos.add("Tracks/GoodTrack/TPC/tpcChi2NCl", "chi2 per cluster in TPC;chi2 / cluster TPC", kTH1D, {confAxis.axisTPCchi2}); + } + + if (doPIDhistos) { + histos.add("Tracks/raw/PID/hTPCsignalVsZ", "All tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/hTPCsignalVsP", "All tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/hTPCsignalVsPt", "All tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/hTPCsignalVsEta", "All tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/hTPCsignalVsPhi", "All tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/hTOFsignalVsP", "All tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("Tracks/raw/PID/hTPCnSigmaElVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/raw/PID/hTPCnSigmaMuVsP", ";Track #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/raw/PID/hTPCnSigmaPiVsP", ";Track #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/raw/PID/hTPCnSigmaKaVsP", ";Track #it{p} (GeV/c);n#sigma^{K}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/raw/PID/hTPCnSigmaPrVsP", ";Track #it{p} (GeV/c);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsZ", "Positively charged tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsP", "Positively charged tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsPt", "Positively charged tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsEta", "Positively charged tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsPhi", "Positively charged tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/PosCharge/hTOFsignalVsP", "Positively charged tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsZ", "Negatively charged tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsP", "Negatively charged tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsPt", "Negatively charged tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsEta", "Negatively charged tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsPhi", "Negatively charged tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); + histos.add("Tracks/raw/PID/NegCharge/hTOFsignalVsP", "Negatively charged tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/hTPCsignalVsZ", "All good tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/hTPCsignalVsP", "All good tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/hTPCsignalVsPt", "All good tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/hTPCsignalVsEta", "All good tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/hTPCsignalVsPhi", "All good tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/hTPCnSigmaElVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/hTPCnSigmaMuVsP", ";Track #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/hTPCnSigmaPiVsP", ";Track #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/hTPCnSigmaKaVsP", ";Track #it{p} (GeV/c);n#sigma^{K}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/hTPCnSigmaPrVsP", ";Track #it{p} (GeV/c);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/hTOFsignalVsP", "All good tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsZ", "Positively charged good tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsP", "Positively charged good tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsPt", "Positively charged good tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsEta", "Positively charged good tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsPhi", "Positively charged good tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/PosCharge/hTOFsignalVsP", "Positively charged good tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsZ", "Negatively charged good tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsP", "Negatively charged good tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsPt", "Negatively charged good tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsEta", "Negatively charged good tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsPhi", "Negatively charged good tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/NegCharge/hTOFsignalVsP", "Negatively charged good tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsZ", "Identified electrons;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsP", "Identified electrons;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsPt", "Identified electrons;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsEta", "Identified electrons;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsPhi", "Identified electrons;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Electron/hTOFsignalVsP", "Identified electrons;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaVsP", "Identified electrons;Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaVsP", "Identified electrons;Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsMu", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsMu", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{#mu}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsPi", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsPi", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsKa", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{#it{K}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsKa", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{#it{K}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsPr", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsPr", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{p}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsZ", "Identified muons;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsP", "Identified muons;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsPt", "Identified muons;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsEta", "Identified muons;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsPhi", "Identified muons;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Muon/hTOFsignalVsP", "Identified muons;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaVsP", "Identified muons;Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaVsP", "Identified muons;Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsEl", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{#it{e}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsEl", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{#it{e}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsPi", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsPi", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsKa", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{#it{K}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsKa", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{#it{K}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsPr", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsPr", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{p}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsZ", "Identified pions;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsP", "Identified pions;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsPt", "Identified pions;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsEta", "Identified pions;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsPhi", "Identified pions;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Pion/hTOFsignalVsP", "Identified pions;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaVsP", "Identified pions;Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaVsP", "Identified pions;Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsEl", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{#it{e}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsEl", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{#it{e}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsMu", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsMu", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{#mu}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsKa", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{#it{K}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsKa", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{#it{K}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsPr", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsPr", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{p}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsZ", "Identified NOT electron/Muon/Pion;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsP", "Identified NOT electron/Muon/Pion;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsPt", "Identified NOT electron/Muon/Pion;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsEta", "Identified NOT electron/Muon/Pion;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsPhi", "Identified NOT electron/Muon/Pion;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Others/hTOFsignalVsP", "Identified NOT electron/Muon/Pion;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + } if (doTwoTracks) { - histos.add("EventTwoTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/hInvariantMassWideAllPionMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/hInvariantMassWideAllPionMassPtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/hInvariantMassWideAllPionMassTOF", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/hInvariantMassWideAllPionMassITScut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/hInvariantMassWideAllPionMassPtCutITScut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); - histos.add("EventTwoTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventTwoTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventTwoTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventTwoTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventTwoTracks/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/hDaughtersPvsITSclusterSize", ";Average ITS cluster size;Daughter #it{p} (GeV/c)", HistType::kTH2D, {axisAvgITSclsSizes, axisMomSigned}); - histos.add("EventTwoTracks/hDaughtersPvsITSclusterSizeXcos", ";Average ITS cluster size x cos(#lambda);Daughter #it{p} (GeV/c)", HistType::kTH2D, {axisAvgITSclsSizes, axisMomSigned}); - histos.add("EventTwoTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - - histos.add("EventTwoTracks/TwoElectrons/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/TwoElectrons/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/TwoElectrons/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/TwoElectrons/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); - histos.add("EventTwoTracks/TwoElectrons/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventTwoTracks/TwoElectrons/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/TwoElectrons/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/TwoElectrons/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventTwoTracks/TwoElectrons/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventTwoTracks/TwoElectrons/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhiTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhiPtCutTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingP", ";Leading #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPwide", ";Leading #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPt", ";Leading #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPhi", ";Leading #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingRapidity", ";Leading #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPvsOtherP", ";Leading #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPwideVsOtherPwide", ";Leading #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPtVsOtherPt", ";Leading #it{p_{T} (GeV/c); Other #it{p_{T} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPhiVsOtherPhi", ";Leading #phi (rad); Other #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingRapVsOtherRap", ";Leading #it{y} (-); Other #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTPCsignalVsLP", ";Leading #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTPCsignalVsOP", ";Other #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTOFsignalVsLP", ";Leading #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTOFsignalVsOP", ";Other #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTPCnSigmaVsLP", ";Leading #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTPCnSigmaVsOP", ";Other #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsLP", ";Leading #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsOP", ";Other #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - - histos.add("EventTwoTracks/TwoMuons/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/TwoMuons/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/TwoMuons/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/TwoMuons/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); - histos.add("EventTwoTracks/TwoMuons/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventTwoTracks/TwoMuons/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/TwoMuons/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/TwoMuons/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventTwoTracks/TwoMuons/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventTwoTracks/TwoMuons/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhiTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhiPtCutTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/TwoMuons/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - - histos.add("EventTwoTracks/TwoPions/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/TwoPions/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/TwoPions/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/TwoPions/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); - histos.add("EventTwoTracks/TwoPions/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventTwoTracks/TwoPions/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/TwoPions/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/TwoPions/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventTwoTracks/TwoPions/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventTwoTracks/TwoPions/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/TwoPions/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhiTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhiPtCutTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/TwoPions/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/TwoPions/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - - histos.add("EventTwoTracks/ElectronMuon/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/ElectronMuon/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/ElectronMuon/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); - histos.add("EventTwoTracks/ElectronMuon/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventTwoTracks/ElectronMuon/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/ElectronMuon/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/ElectronMuon/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventTwoTracks/ElectronMuon/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventTwoTracks/ElectronMuon/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventTwoTracks/ElectronMuon/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/ElectronMuon/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/ElectronMuon/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/ElectronMuon/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/ElectronMuon/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/ElectronMuon/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - - histos.add("EventTwoTracks/ElectronPion/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/ElectronPion/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/ElectronPion/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); - histos.add("EventTwoTracks/ElectronPion/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventTwoTracks/ElectronPion/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/ElectronPion/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/ElectronPion/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventTwoTracks/ElectronPion/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventTwoTracks/ElectronPion/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventTwoTracks/ElectronPion/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/ElectronPion/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/ElectronPion/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/ElectronPion/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/ElectronPion/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/ElectronPion/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - - histos.add("EventTwoTracks/MuonPion/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/MuonPion/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonPion/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonPion/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); - histos.add("EventTwoTracks/MuonPion/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventTwoTracks/MuonPion/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/MuonPion/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/MuonPion/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventTwoTracks/MuonPion/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventTwoTracks/MuonPion/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventTwoTracks/MuonPion/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/MuonPion/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/MuonPion/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/MuonPion/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/MuonPion/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/MuonPion/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); + histos.add("EventTwoTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventTwoTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/hInvariantMassWideAllPionMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/hInvariantMassWideAllPionMassPtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/hInvariantMassWideAllPionMassTOF", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); + histos.add("EventTwoTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventTwoTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventTwoTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventTwoTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventTwoTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventTwoTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventTwoTracks/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); + histos.add("EventTwoTracks/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); + histos.add("EventTwoTracks/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); + histos.add("EventTwoTracks/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); + histos.add("EventTwoTracks/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/hDaughtersPvsITSclusterSize", ";Average ITS cluster size;Daughter #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisAvgITSclsSizes, confAxis.axisMomSigned}); + histos.add("EventTwoTracks/hDaughtersPvsITSclusterSizeXcos", ";Average ITS cluster size x cos(#lambda);Daughter #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisAvgITSclsSizes, confAxis.axisMomSigned}); + histos.add("EventTwoTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventTwoTracks/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("EventTwoTracks/PID/hTPCnSigmaElVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/PID/hTPCnSigmaMuVsP", ";Track #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/PID/hTPCnSigmaPiVsP", ";Track #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/PID/hTPCnSigmaKaVsP", ";Track #it{p} (GeV/c);n#sigma^{K}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/PID/hTPCnSigmaPrVsP", ";Track #it{p} (GeV/c);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/PID/NoPID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaElVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaMuVsP", ";Track #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaPiVsP", ";Track #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaKaVsP", ";Track #it{p} (GeV/c);n#sigma^{K}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaPrVsP", ";Track #it{p} (GeV/c);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + + histos.add("EventTwoTracks/TwoElectrons/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventTwoTracks/TwoElectrons/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/TwoElectrons/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/TwoElectrons/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); + histos.add("EventTwoTracks/TwoElectrons/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventTwoTracks/TwoElectrons/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventTwoTracks/TwoElectrons/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventTwoTracks/TwoElectrons/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventTwoTracks/TwoElectrons/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventTwoTracks/TwoElectrons/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhiTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhiPtCutTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingP", ";Leading #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPwide", ";Leading #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPt", ";Leading #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPhi", ";Leading #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingRapidity", ";Leading #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPvsOtherP", ";Leading #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPwideVsOtherPwide", ";Leading #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPtVsOtherPt", ";Leading #it{p_{T}} (GeV/c); Other #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPhiVsOtherPhi", ";Leading #phi (rad); Other #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingRapVsOtherRap", ";Leading #it{y} (-); Other #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTPCsignalVsLP", ";Leading #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTPCsignalVsOP", ";Other #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTOFsignalVsLP", ";Leading #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTOFsignalVsOP", ";Other #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTPCnSigmaVsLP", ";Leading #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTPCnSigmaVsOP", ";Other #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsLP", ";Leading #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsOP", ";Other #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + + histos.add("EventTwoTracks/TwoMuons/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventTwoTracks/TwoMuons/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/TwoMuons/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/TwoMuons/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); + histos.add("EventTwoTracks/TwoMuons/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventTwoTracks/TwoMuons/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventTwoTracks/TwoMuons/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventTwoTracks/TwoMuons/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventTwoTracks/TwoMuons/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventTwoTracks/TwoMuons/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhiTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhiPtCutTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/TwoMuons/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + + histos.add("EventTwoTracks/TwoPions/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventTwoTracks/TwoPions/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/TwoPions/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/TwoPions/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); + histos.add("EventTwoTracks/TwoPions/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventTwoTracks/TwoPions/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventTwoTracks/TwoPions/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventTwoTracks/TwoPions/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventTwoTracks/TwoPions/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventTwoTracks/TwoPions/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); + histos.add("EventTwoTracks/TwoPions/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhiTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhiPtCutTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); + histos.add("EventTwoTracks/TwoPions/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/TwoPions/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + + histos.add("EventTwoTracks/ElectronMuon/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventTwoTracks/ElectronMuon/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/ElectronMuon/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); + histos.add("EventTwoTracks/ElectronMuon/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventTwoTracks/ElectronMuon/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventTwoTracks/ElectronMuon/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronMuon/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventTwoTracks/ElectronMuon/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventTwoTracks/ElectronMuon/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronMuon/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); + histos.add("EventTwoTracks/ElectronMuon/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); + histos.add("EventTwoTracks/ElectronMuon/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronMuon/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); + histos.add("EventTwoTracks/ElectronMuon/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/ElectronMuon/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + + histos.add("EventTwoTracks/ElectronPion/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventTwoTracks/ElectronPion/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/ElectronPion/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); + histos.add("EventTwoTracks/ElectronPion/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventTwoTracks/ElectronPion/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventTwoTracks/ElectronPion/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronPion/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventTwoTracks/ElectronPion/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventTwoTracks/ElectronPion/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronPion/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); + histos.add("EventTwoTracks/ElectronPion/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); + histos.add("EventTwoTracks/ElectronPion/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronPion/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); + histos.add("EventTwoTracks/ElectronPion/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/ElectronPion/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + + histos.add("EventTwoTracks/MuonPion/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventTwoTracks/MuonPion/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/MuonPion/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/MuonPion/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); + histos.add("EventTwoTracks/MuonPion/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventTwoTracks/MuonPion/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventTwoTracks/MuonPion/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventTwoTracks/MuonPion/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventTwoTracks/MuonPion/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventTwoTracks/MuonPion/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventTwoTracks/MuonPion/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); + histos.add("EventTwoTracks/MuonPion/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); + histos.add("EventTwoTracks/MuonPion/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); + histos.add("EventTwoTracks/MuonPion/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); + histos.add("EventTwoTracks/MuonPion/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/MuonPion/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); histos.add("EventTwoTracks/ElectronMuPi/hNeventsPtCuts", ";Selection (-);Number of events (-)", HistType::kTH1D, {{20, -0.5, 19.5}}); - histos.add("EventTwoTracks/ElectronMuPi/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/ElectronMuPi/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/ElectronMuPi/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); - histos.add("EventTwoTracks/ElectronMuPi/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventTwoTracks/ElectronMuPi/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/ElectronMuPi/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/ElectronMuPi/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventTwoTracks/ElectronMuPi/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventTwoTracks/ElectronMuPi/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronPtWide", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/ElectronMuPi/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/ElectronMuPi/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronPvsOtherP", ";Electron #it{p} (GeV/c); #mu/#pi #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronPwideVsOtherPwide", ";Electron #it{p} (GeV/c); #mu/#pi #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronPtVsOtherPt", ";Electron #it{p_{T} (GeV/c); #mu/#pi #it{p_{T} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronPhiVsOtherPhi", ";Electron #phi (rad); #mu/#pi #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronRapVsOtherRap", ";Electron #it{y} (-); #mu/#pi #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsEP", ";Electron #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsOP", ";#mu/#pi #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsEP", ";Electron #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsOP", ";Other #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEP", ";Electron #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsMP", ";Muon #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPP", ";Pion #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEP", ";Electron #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsMP", ";Muon #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPP", ";Pion #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventTwoTracks/ElectronMuPi/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/ElectronMuPi/PionsSelection/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventTwoTracks/ElectronMuPi/PionsSelection/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/ElectronMuPi/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); + histos.add("EventTwoTracks/ElectronMuPi/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventTwoTracks/ElectronMuPi/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventTwoTracks/ElectronMuPi/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronMuPi/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventTwoTracks/ElectronMuPi/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventTwoTracks/ElectronMuPi/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronPtWide", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventTwoTracks/ElectronMuPi/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); + histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); + histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); + histos.add("EventTwoTracks/ElectronMuPi/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronPvsOtherP", ";Electron #it{p} (GeV/c); #mu/#pi #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronPwideVsOtherPwide", ";Electron #it{p} (GeV/c); #mu/#pi #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronPtVsOtherPt", ";Electron #it{p_{T}} (GeV/c); #mu/#pi #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronPhiVsOtherPhi", ";Electron #phi (rad); #mu/#pi #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronRapVsOtherRap", ";Electron #it{y} (-); #mu/#pi #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + + histos.add("EventTwoTracks/ElectronMuPi/PID/mcTruth/nSigmaTPC1", "Paul's way;True electron #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/mcTruth/nSigmaTPC2", "Paul's way;True not-electron #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsEPofE", ";Electron #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsOPofO", ";#mu/#pi #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofE", ";Electron #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPPofE", ";Electron #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofE", ";Electron n#sigma^{e}_{TPC} (arb. units);Electron n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofO", ";Non-electron #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsMPofO", ";Non-electron #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPPofO", ";Non-electron #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofO", ";Non-electron n#sigma^{e}_{TPC} (arb. units);Non-electron n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsEPofE", ";Electron #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEPofE", ";Electron #it{p} (GeV/c);n#sigma^{e}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPPofE", ";Electron #it{p} (GeV/c);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaEvsnSigmaPofE", ";Electron n#sigma^{e}_{TOF} (arb. units);Electron n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsOPofO", ";Not-electron #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEPofO", ";Not-electron #it{p} (GeV/c);n#sigma^{e}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsMPofO", ";Not-electron #it{p} (GeV/c);n#sigma^{#mu}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPPofO", ";Not-electron #it{p} (GeV/c);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaEvsnSigmaPofO", ";Not-electron n#sigma^{e}_{TOF} (arb. units);Not-electron n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); histos.add("EventTwoTracks/ElectronOther/hNeventsPtCuts", ";Selection (-);Number of events (-)", HistType::kTH1D, {{20, -0.5, 19.5}}); - histos.add("EventTwoTracks/ElectronOther/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/ElectronOther/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/ElectronOther/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); - histos.add("EventTwoTracks/ElectronOther/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventTwoTracks/ElectronOther/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/ElectronOther/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/ElectronOther/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventTwoTracks/ElectronOther/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventTwoTracks/ElectronOther/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventTwoTracks/ElectronOther/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/ElectronOther/hElectronPtWide", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/ElectronOther/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/ElectronOther/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/ElectronOther/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/ElectronOther/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/ElectronOther/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/ElectronOther/hElectronPvsOtherP", ";Electron #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/ElectronOther/hElectronPwideVsOtherPwide", ";Electron #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/ElectronOther/hElectronPtVsOtherPt", ";Electron #it{p_{T} (GeV/c); Other #it{p_{T} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/ElectronOther/hElectronPhiVsOtherPhi", ";Electron #phi (rad); Other #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/ElectronOther/hElectronRapVsOtherRap", ";Electron #it{y} (-); Other #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCsignalVsEP", ";Electron #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCsignalVsOP", ";#it{e}/#mu/#pi #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFsignalVsEP", ";Electron #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFsignalVsOP", ";Other #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsEP", ";Electron #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsMP", ";Muon #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsPP", ";Pion #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsEP", ";Electron #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsMP", ";Muon #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsPP", ";Pion #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - - if (doPionStudy) { - histos.add("EventTwoTracks/PionsSelection/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/PionsSelection/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/PionsSelection/hInvariantMassWideITS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/PionsSelection/hInvariantMassPtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutUS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutUSmuMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutLS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutUSITScut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutLSITScut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/PionsSelection/hasTOF/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/PionsSelection/hasTOF/hInvariantMassWidePtCutUS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/PionsSelection/hasTOF/hInvariantMassWidePtCutLS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/PionsSelection/hasTOF/hInvariantMassWidePtCutUSmuMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/PionsSelection/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); - histos.add("EventTwoTracks/PionsSelection/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventTwoTracks/PionsSelection/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/PionsSelection/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/PionsSelection/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventTwoTracks/PionsSelection/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventTwoTracks/PionsSelection/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventTwoTracks/PionsSelection/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/PionsSelection/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/PionsSelection/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/PionsSelection/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/PionsSelection/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/PionsSelection/hasTOF/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/PionsSelection/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/PionsSelection/hasTOF/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/PionsSelection/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/PionsSelection/hDaughtersPtvsDcaXY", ";Daughter #it{p_{T}} (GeV/c);Daughter DCA_{XY} (cm)", HistType::kTH2D, {axisPt, axisDCA}); - histos.add("EventTwoTracks/PionsSelection/hDaughtersPtvsDcaXYPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter DCA_{XY} (cm)", HistType::kTH2D, {axisPt, axisDCA}); - histos.add("EventTwoTracks/PionsSelection/hDaughtersPvsITSclusterSize", ";Average ITS cluster size;Daughter #it{p} (GeV/c)", HistType::kTH2D, {axisAvgITSclsSizes, axisMomSigned}); - histos.add("EventTwoTracks/PionsSelection/hDaughtersPvsITSclusterSizeXcos", ";Average ITS cluster size x cos(#lambda);Daughter #it{p} (GeV/c)", HistType::kTH2D, {axisAvgITSclsSizes, axisMomSigned}); - } - - if (doMuonStudy) { - histos.add("EventTwoTracks/MuonsSelection/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWideITS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassPtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutLS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSITScut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - if (doJpsiMuMuTests) { - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSnegEta", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSposEta", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSnegRap", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSposRap", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSrap12", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSrap10", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSrap08", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSrap05", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSrap03", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcNcls70", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcNcls100", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcNxRws70", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcNxRws100", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcBordersCut1", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcBordersCut2", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcBordersCut3", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcBordersCut4", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcBordersCut5", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - } - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutLS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSITScut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - if (doJpsiMuMuTests) { - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSnegEta", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSposEta", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSnegRap", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSposRap", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSrap12", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSrap10", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSrap08", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSrap05", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSrap03", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcNcls70", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcNcls100", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcNxRws70", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcNxRws100", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcBordersCut1", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcBordersCut2", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcBordersCut3", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcBordersCut4", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcBordersCut5", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi1", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi2", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi3", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi4", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi5", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi6", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi7", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi8", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi9", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi10", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi11", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi12", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi13", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi14", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi15", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi16", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi1", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi2", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi3", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi4", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi5", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi6", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi7", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi8", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi9", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi10", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi11", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi12", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi13", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi14", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi15", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi16", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC1", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC2", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC3", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC4", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC5", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC6", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC7", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC8", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC9", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC10", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC11", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC12", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC13", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC14", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC15", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC16", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC1", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC2", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC3", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC4", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC5", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC6", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC7", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC8", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC9", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC10", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC11", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC12", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC13", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC14", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC15", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC16", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - } - histos.add("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutLSITScut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); - histos.add("EventTwoTracks/MuonsSelection/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventTwoTracks/MuonsSelection/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventTwoTracks/MuonsSelection/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/MuonsSelection/hJpsiPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventTwoTracks/MuonsSelection/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventTwoTracks/MuonsSelection/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventTwoTracks/MuonsSelection/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMom, axisMom}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {axisMomWide, axisMomWide}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - if (doJpsiMuMuTests) { - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut1", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut2", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut3", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut4", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut5", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - } - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - if (doJpsiMuMuTests) { - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut1", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut2", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut3", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut4", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut5", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - } - histos.add("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {axisPt, axisModPhi}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPtvsDcaXY", ";Daughter #it{p_{T}} (GeV/c);Daughter DCA_{XY} (cm)", HistType::kTH2D, {axisPt, axisDCA}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPtvsDcaXYPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter DCA_{XY} (cm)", HistType::kTH2D, {axisPt, axisDCA}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPvsITSclusterSize", ";Average ITS cluster size;Daughter #it{p} (GeV/c)", HistType::kTH2D, {axisAvgITSclsSizes, axisMomSigned}); - histos.add("EventTwoTracks/MuonsSelection/hDaughtersPvsITSclusterSizeXcos", ";Average ITS cluster size x cos(#lambda);Daughter #it{p} (GeV/c)", HistType::kTH2D, {axisAvgITSclsSizes, axisMomSigned}); - histos.add("EventTwoTracks/MuonsSelection/Run2Cuts/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Run2Cuts/hInvariantMassWidePtFitPlot", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/Run2Cuts/hInvariantMassWideCS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsLP", ";Leading #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsOP", ";Other #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - histos.add("EventTwoTracks/MuonsSelection/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("EventTwoTracks/MuonsSelection/PID/hTOFsignalVsLP", ";Leading #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("EventTwoTracks/MuonsSelection/PID/hTOFsignalVsOP", ";Other #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {axisMom, axisTOFsignal}); - histos.add("EventTwoTracks/MuonsSelection/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/MuonsSelection/PID/hTPCnSigmaVsLP", ";Leading #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/MuonsSelection/PID/hTPCnSigmaVsOP", ";Other #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/MuonsSelection/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/MuonsSelection/PID/hTOFnSigmaVsLP", ";Leading #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - histos.add("EventTwoTracks/MuonsSelection/PID/hTOFnSigmaVsOP", ";Other #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {axisMom, axisNsigma}); - } + histos.add("EventTwoTracks/ElectronOther/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventTwoTracks/ElectronOther/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventTwoTracks/ElectronOther/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); + histos.add("EventTwoTracks/ElectronOther/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventTwoTracks/ElectronOther/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventTwoTracks/ElectronOther/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronOther/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventTwoTracks/ElectronOther/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventTwoTracks/ElectronOther/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronOther/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronOther/hElectronPtWide", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventTwoTracks/ElectronOther/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); + histos.add("EventTwoTracks/ElectronOther/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); + histos.add("EventTwoTracks/ElectronOther/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronOther/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); + histos.add("EventTwoTracks/ElectronOther/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/ElectronOther/hElectronPvsOtherP", ";Electron #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); + histos.add("EventTwoTracks/ElectronOther/hElectronPwideVsOtherPwide", ";Electron #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); + histos.add("EventTwoTracks/ElectronOther/hElectronPtVsOtherPt", ";Electron #it{p_{T}} (GeV/c); Other #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); + histos.add("EventTwoTracks/ElectronOther/hElectronPhiVsOtherPhi", ";Electron #phi (rad); Other #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); + histos.add("EventTwoTracks/ElectronOther/hElectronRapVsOtherRap", ";Electron #it{y} (-); Other #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCsignalVsEP", ";Electron #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCsignalVsOP", ";#it{e}/#mu/#pi #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFsignalVsEP", ";Electron #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFsignalVsOP", ";Other #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsEP", ";Electron #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsMP", ";Muon #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsPP", ";Pion #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsEP", ";Electron #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsMP", ";Muon #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsPP", ";Pion #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); } if (doFourTracks) { - histos.add("EventFourTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventFourTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventFourTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventFourTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventFourTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventFourTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventFourTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventFourTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventFourTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventFourTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - - histos.add("EventFourTracks/WithElectron/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventFourTracks/WithElectron/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventFourTracks/WithElectron/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventFourTracks/WithElectron/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventFourTracks/WithElectron/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventFourTracks/WithElectron/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventFourTracks/WithElectron/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventFourTracks/WithElectron/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventFourTracks/WithElectron/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - - histos.add("EventFourTracks/WithMuon/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventFourTracks/WithMuon/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventFourTracks/WithMuon/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventFourTracks/WithMuon/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventFourTracks/WithMuon/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventFourTracks/WithMuon/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventFourTracks/WithMuon/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventFourTracks/WithMuon/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventFourTracks/WithMuon/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - - histos.add("EventFourTracks/WithPion/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventFourTracks/WithPion/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventFourTracks/WithPion/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventFourTracks/WithPion/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventFourTracks/WithPion/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventFourTracks/WithPion/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventFourTracks/WithPion/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventFourTracks/WithPion/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventFourTracks/WithPion/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - if (doFourTrackPsi2S) { - histos.add("EventFourTracks/MuonsPions/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventFourTracks/MuonsPions/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventFourTracks/MuonsPions/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventFourTracks/MuonsPions/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventFourTracks/MuonsPions/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventFourTracks/MuonsPions/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventFourTracks/MuonsPions/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventFourTracks/MuonsPions/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - - histos.add("EventFourTracks/Psi2StoMuMuPiPi/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventFourTracks/Psi2StoMuMuPiPi/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventFourTracks/Psi2StoMuMuPiPi/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventFourTracks/Psi2StoMuMuPiPi/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventFourTracks/Psi2StoMuMuPiPi/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventFourTracks/Psi2StoMuMuPiPi/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventFourTracks/Psi2StoMuMuPiPi/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventFourTracks/Psi2StoMuMuPiPi/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - - histos.add("EventFourTracks/Psi2StoElElPiPi/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventFourTracks/Psi2StoElElPiPi/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventFourTracks/Psi2StoElElPiPi/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventFourTracks/Psi2StoElElPiPi/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventFourTracks/Psi2StoElElPiPi/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventFourTracks/Psi2StoElElPiPi/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventFourTracks/Psi2StoElElPiPi/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventFourTracks/Psi2StoElElPiPi/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - } + histos.add("EventFourTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventFourTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventFourTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventFourTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventFourTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventFourTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventFourTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventFourTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventFourTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventFourTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + + histos.add("EventFourTracks/WithElectron/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventFourTracks/WithElectron/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventFourTracks/WithElectron/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventFourTracks/WithElectron/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventFourTracks/WithElectron/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventFourTracks/WithElectron/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventFourTracks/WithElectron/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventFourTracks/WithElectron/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventFourTracks/WithElectron/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + + histos.add("EventFourTracks/WithMuon/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventFourTracks/WithMuon/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventFourTracks/WithMuon/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventFourTracks/WithMuon/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventFourTracks/WithMuon/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventFourTracks/WithMuon/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventFourTracks/WithMuon/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventFourTracks/WithMuon/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventFourTracks/WithMuon/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + + histos.add("EventFourTracks/WithPion/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventFourTracks/WithPion/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventFourTracks/WithPion/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventFourTracks/WithPion/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventFourTracks/WithPion/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventFourTracks/WithPion/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventFourTracks/WithPion/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventFourTracks/WithPion/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventFourTracks/WithPion/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); } if (doSixTracks) { - histos.add("EventSixTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventSixTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventSixTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventSixTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventSixTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventSixTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventSixTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventSixTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventSixTracks//hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventSixTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); - - histos.add("EventSixTracks/SixPions/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); - histos.add("EventSixTracks/SixPions/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); - histos.add("EventSixTracks/SixPions/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); - histos.add("EventSixTracks/SixPions/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); - histos.add("EventSixTracks/SixPions/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {axisPt}); - histos.add("EventSixTracks/SixPions/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {axisPhi}); - histos.add("EventSixTracks/SixPions/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {axisRap}); - histos.add("EventSixTracks/SixPions/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisInvMassWide, axisPt}); - histos.add("EventSixTracks/SixPions/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {axisMom, axisTPCdEdx}); + histos.add("EventSixTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventSixTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventSixTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventSixTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventSixTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventSixTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventSixTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventSixTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventSixTracks//hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventSixTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + + histos.add("EventSixTracks/SixPions/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); + histos.add("EventSixTracks/SixPions/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); + histos.add("EventSixTracks/SixPions/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("EventSixTracks/SixPions/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); + histos.add("EventSixTracks/SixPions/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("EventSixTracks/SixPions/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("EventSixTracks/SixPions/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); + histos.add("EventSixTracks/SixPions/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventSixTracks/SixPions/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + } + + if (doTruthHistos) { + histos.add("Events/Truth/hCountCollisions", ";;Number of generated collision (-)", HistType::kTH1D, {{1, 0.5, 1.5}}); + histos.add("Events/Truth/hChannels", ";Channels (-);Number of events (-)", HistType::kTH1D, {{confAxis.axisChannels}}); + histos.add("Events/Truth/hPDGcodesAll", ";PDG codes of all particles (-);Number of events (-)", HistType::kTH1D, {{2001, -1000, 1000}}); + histos.add("Events/Truth/hPDGcodesNoMother", ";PDG codes of particles without mother (-);Number of events (-)", HistType::kTH1D, {{2001, -1000, 1000}}); + histos.add("Events/Truth/hPDGcodesTauDaughters", ";PDG codes of daughters of particles without mother (-);Number of events (-)", HistType::kTH1D, {{2001, -1000, 1000}}); + histos.add("Events/Truth/hNparticles", ";Number of particles in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); + histos.add("Events/Truth/hNtauDaughters", ";Number of daughters of no-mother particle in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); + histos.add("Events/Truth/hNelectrons", ";Number of electrons in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); + histos.add("Events/Truth/hNmuons", ";Number of muons in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); + histos.add("Events/Truth/hNpions", ";Number of pions in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); + histos.add("Events/Truth/hNphysPartVsNwoutMotherParts", ";Number of physical primary particles (-);Number of particles without mother(-)", HistType::kTH2D, {confAxis.axisNparticles, confAxis.axisNparticles}); } } // end init @@ -821,7 +680,6 @@ struct UpcTauCentralBarrelRL { if (verboseInfo) printLargeMessage("RUN METHOD"); - printDebugMessage(Form("countCollisions = %d", countCollisions)); } // end run @@ -872,43 +730,43 @@ struct UpcTauCentralBarrelRL { bool isGlobalTrackReinstatement(T const& track) { // kInAcceptance copy - if (track.pt() < cutMyGTptMin || track.pt() > cutMyGTptMax) + if (track.pt() < cutGlobalTrack.cutMinPt || track.pt() > cutGlobalTrack.cutMaxPt) return false; - if (eta(track.px(), track.py(), track.pz()) < cutMyGTetaMin || eta(track.px(), track.py(), track.pz()) > cutMyGTetaMax) + if (eta(track.px(), track.py(), track.pz()) < cutGlobalTrack.cutMinEta || eta(track.px(), track.py(), track.pz()) > cutGlobalTrack.cutMaxEta) return false; // kPrimaryTracks // GoldenChi2 cut is only for Run 2 - if (abs(track.dcaZ()) > cutMyGTdcaZmax) + if (std::abs(track.dcaZ()) > cutGlobalTrack.cutMaxDCAz) return false; - if (cutMyGTdcaXYusePt) { - float maxDCA = 0.0105f + 0.0350f / pow(track.pt(), 1.1f); // ? not sure yet if will be used - if (abs(track.dcaXY()) > maxDCA) + if (cutGlobalTrack.applyPtDependentDCAxy) { + float maxDCA = 0.0182f + 0.0350f / std::pow(track.pt(), 1.01f); + if (std::abs(track.dcaXY()) > maxDCA) return false; } else { - if (abs(track.dcaXY()) > cutMyGTdcaXYmax) + if (std::abs(track.dcaXY()) > cutGlobalTrack.cutMaxDCAxy) return false; } // kQualityTrack // TrackType is always 1 as per definition of processed Run3 AO2Ds // ITS - if (cutMyHasITS && !track.hasITS()) + if (cutGlobalTrack.cutHasITS && !track.hasITS()) return false; // ITS refit - if (track.itsNCls() < cutMyGTitsNClsMin) + if (track.itsNCls() < cutGlobalTrack.cutMinITSnCls) return false; - if (track.itsChi2NCl() > cutMyGTitsChi2NclMax) + if (track.itsChi2NCl() > cutGlobalTrack.cutMaxITSchi2) return false; if (!isFulfillsITSHitRequirementsReinstatement(track.itsClusterMap())) return false; // TPC - if (cutMyHasTPC && !track.hasTPC()) + if (cutGlobalTrack.cutHasTPC && !track.hasTPC()) return false; // TPC refit - if ((track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()) < cutMyGTtpcNClsMin) + if ((track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()) < cutGlobalTrack.cutMinTPCnCls) return false; // tpcNClsFound() - if (track.tpcNClsCrossedRows() < cutMyGTtpcNClsCrossedRowsMin) + if (track.tpcNClsCrossedRows() < cutGlobalTrack.cutMinTPCnClsXrows) return false; - if ((static_cast(track.tpcNClsCrossedRows()) / static_cast(track.tpcNClsFindable())) < cutMyGTtpcNClsCrossedRowsOverNClsMin) + if ((static_cast(track.tpcNClsCrossedRows()) / static_cast(track.tpcNClsFindable())) < cutGlobalTrack.cutMinTPCnClsXrowsOverNcls) return false; - if (track.tpcChi2NCl() > cutMyGTtpcChi2NclMax) + if (track.tpcChi2NCl() > cutGlobalTrack.cutMaxTPCchi2) return false; // TPC chi2 return true; @@ -984,74 +842,66 @@ struct UpcTauCentralBarrelRL { return std::fmod(phimodn, o2::constants::math::PI / 9.0); } - bool isNotCloseToTPCBorder(float phimodn, float trackpt, float cutWidth) + template + bool isGoodFITtime(C const& coll, float maxFITtime) { - funcPhiCutL = new TF1("funcPhiCutL", Form("0.06/x+pi/18.0-%.f", cutWidth), 0, 100); - funcPhiCutH = new TF1("funcPhiCutH", Form("0.1/x+pi/18.0+%.f", cutWidth), 0, 100); + // FTOA + if ((std::abs(coll.timeFT0A()) > maxFITtime) && coll.timeFT0A() > -998.) + return false; - if (phimodn < funcPhiCutH->Eval(trackpt) && phimodn > funcPhiCutL->Eval(trackpt)) - return false; // reject track + // FTOC + if ((std::abs(coll.timeFT0C()) > maxFITtime) && coll.timeFT0A() > -998.) + return false; return true; } template - int whatPsi2Schannel(T const& trkDaug1, T const& trkDaug2, T const& trkDaug3, T const& trkDaug4, std::vector& vecPIDidx) + bool selectedGoodElectron(T const& electronCandidate) { - TLorentzVector jpsi, daug[4]; - daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); - daug[2].SetPxPyPzE(trkDaug3.px(), trkDaug3.py(), trkDaug3.pz(), energy(pdg->Mass(trackPDG(trkDaug3)), trkDaug3.px(), trkDaug3.py(), trkDaug3.pz())); - daug[3].SetPxPyPzE(trkDaug4.px(), trkDaug4.py(), trkDaug4.pz(), energy(pdg->Mass(trackPDG(trkDaug4)), trkDaug4.px(), trkDaug4.py(), trkDaug4.pz())); - // Find index of the two largest values - std::vector> vecPts; - for (int i = 0; i < 4; i++) { - vecPts.push_back(std::make_pair(static_cast(daug[i].Pt()), i)); - } - sort(vecPts.begin(), vecPts.end()); - int idx1L = vecPts[vecPts.size() - 1].second; - int idx2L = vecPts[vecPts.size() - 2].second; - int idx3L = vecPts[vecPts.size() - 3].second; - int idx4L = vecPts[vecPts.size() - 4].second; - // Create the jpsi - jpsi = daug[idx1L] + daug[idx2L]; - // The two smallest-pT tracks should be pions - if ((vecPIDidx[idx3L] == P_MUON || vecPIDidx[idx3L] == P_PION) && (vecPIDidx[idx4L] == P_MUON || vecPIDidx[idx4L] == P_PION)) { - // Branch into Jpsi to mumu and Jpsi to elel - if ((vecPIDidx[idx1L] == P_MUON || vecPIDidx[idx1L] == P_PION) && (vecPIDidx[idx2L] == P_MUON || vecPIDidx[idx2L] == P_PION)) { - // Is jpsi mass? - if (jpsi.M() < 2.9 || jpsi.M() > 3.3) - return 0; // Not Psi2S - return 1; - } else if (vecPIDidx[idx1L] == P_ELECTRON && vecPIDidx[idx2L] == P_ELECTRON) { - // Is jpsi mass? - if (jpsi.M() < 2.75 || jpsi.M() > 3.3) - return 0; // Not Psi2S - return 2; - } else { - return 0; // Not Psi2S - } - } else { - return 0; // Not Psi2S - } + if (cutTauEvent.cutElectronHasTOF && !electronCandidate.hasTOF()) + return false; + if (electronCandidate.tpcNSigmaEl() < cutTauEvent.cutMaxElectronNsigma || electronCandidate.tpcNSigmaEl() > cutTauEvent.cutMinElectronNsigma) + return false; + if (electronCandidate.tpcNSigmaPi() > cutTauEvent.cutMaxElectronPiNsigma && electronCandidate.tpcNSigmaPi() < cutTauEvent.cutMinElectronPiNsigma) + return false; + return true; } - template - void fillHistograms(C reconstructedCollision, Ts reconstructedBarrelTracks) + template + bool selectedTauEvent(T const& trkDaug1, T const& trkDaug2) { + TLorentzVector mother, daug[2], motherOfPions, pion[2]; + daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + mother = daug[0] + daug[1]; + pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(211), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(211), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + motherOfPions = pion[0] + pion[1]; + if (cutTauEvent.cutOppositeCharge && (trkDaug1.sign() * trkDaug2.sign() > 0)) + return false; + if (calculateAcoplanarity(daug[0].Phi(), daug[1].Phi()) > cutTauEvent.cutAcoplanarity) + return false; + bool goodElectron = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? selectedGoodElectron(trkDaug1) : selectedGoodElectron(trkDaug2); + if (cutTauEvent.cutGoodElectron && !goodElectron) + return false; + if (cutTauEvent.cutOutRho && (motherOfPions.M() > cutTauEvent.cutMinRhoMass && motherOfPions.M() < cutTauEvent.cutMaxRhoMass)) + return false; + if (cutTauEvent.cutOnRho && (motherOfPions.M() > cutTauEvent.cutMaxRhoMass || motherOfPions.M() < cutTauEvent.cutMinRhoMass)) + return false; + return true; + } - if (isFirstReconstructedCollisions) { - isFirstReconstructedCollisions = false; - if (verboseInfo) - printLargeMessage("START LOOPING OVER RECONSTRUCTED COLLISIONS"); - } + template + void fillHistograms(Ts const& reconstructedBarrelTracks) + { histos.get(HIST("Events/hCountCollisions"))->Fill(1); histos.get(HIST("Events/hNreconstructedTracks"))->Fill(reconstructedBarrelTracks.size()); // Loop over tracks without selections - for (auto& track : reconstructedBarrelTracks) { + for (const auto& track : reconstructedBarrelTracks) { float trkPx = track.px(); float trkPy = track.py(); float trkPz = track.pz(); @@ -1081,20 +931,14 @@ struct UpcTauCentralBarrelRL { int countPVGTmuons = 0; int countPVGTpions = 0; int countPVGTothers = 0; - int countPVGTpionsSelection = 0; - int countPVGTmuonsSelection = 0; int countTOFtracks = 0; - int countTPCcls70 = 0; - int countTPCcls100 = 0; - int countTPCxRws70 = 0; - int countTPCxRws100 = 0; std::vector vecPVidx; std::vector vecPIDidx; // Loop over tracks with selections - for (auto& track : reconstructedBarrelTracks) { - if (track.isPVContributor() != 1) + for (const auto& track : reconstructedBarrelTracks) { + if (!track.isPVContributor()) continue; - if (cutMyGlobalTracksOnly) { + if (cutGlobalTrack.applyGlobalTrackSelection) { if (isGlobalTrackReinstatement(track) != 1) continue; } @@ -1122,15 +966,7 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("Tracks/GoodTrack/TPC/tpcChi2NCl"))->Fill(track.tpcChi2NCl()); if (track.hasTOF()) countTOFtracks++; - if ((track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()) > 70) - countTPCcls70++; - if ((track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()) > 100) - countTPCcls100++; - if (track.tpcNClsCrossedRows() > 70) - countTPCxRws70++; - if (track.tpcNClsCrossedRows() > 100) - countTPCxRws100++; - int hypothesisID = testPIDhypothesis(track, cutMyNsigmaTPCPIDselector, cutMyNsigmaTOFPIDselector, usePIDwithTOF, usePIDwithTOFsigmaAfterTPC); + int hypothesisID = testPIDhypothesis(track, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC); vecPIDidx.push_back(hypothesisID); if (hypothesisID == P_ELECTRON || hypothesisID == P_MUON || hypothesisID == P_PION) { countPVGTselected++; @@ -1145,10 +981,6 @@ struct UpcTauCentralBarrelRL { } else { countPVGTothers++; } - if (abs(track.tpcNSigmaPi()) < cutMyTPCnSigmaPi) - countPVGTpionsSelection++; - if (abs(track.tpcNSigmaMu()) < cutMyTPCnSigmaMu) - countPVGTmuonsSelection++; } // Loop over tracks with selections @@ -1163,8 +995,8 @@ struct UpcTauCentralBarrelRL { TLorentzVector mother, daug[2], motherOfPions, pion[2], motherOfMuons, muon[2]; const auto& trkDaug1 = reconstructedBarrelTracks.iteratorAt(vecPVidx[0]); const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(vecPVidx[1]); - daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); mother = daug[0] + daug[1]; pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(211), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(211), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); @@ -1172,17 +1004,9 @@ struct UpcTauCentralBarrelRL { muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(13), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(13), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); motherOfMuons = muon[0] + muon[1]; - auto acoplanarity = calculateAcoplanarity(daug[0].Phi(), daug[1].Phi()); - auto sign = trkDaug1.sign() * trkDaug2.sign(); - bool passAvgITSclsSizesCut = passITSAvgClsSizesLowMomCut(trkDaug1, cutAvgITSclusterSize, cutPtAvgITSclusterSize) && passITSAvgClsSizesLowMomCut(trkDaug2, cutAvgITSclusterSize, cutPtAvgITSclusterSize); - if (applyTauEventSelection) { - if (sign > 0) - return; - if (acoplanarity > 4 * o2::constants::math::PI / 5) - return; // max opening angle 144 degrees (I hope, check) - // if (daug[0].Pt() < 0.2 || daug[1].Pt() < 0.2) return; - // if (motherOfPions.M() > 0.55 || motherOfPions.M() < 1.05) return; - // if (!trkDaug1.hasTOF() || !trkDaug2.hasTOF()) return; + const auto acoplanarity = calculateAcoplanarity(daug[0].Phi(), daug[1].Phi()); + if (cutTauEvent.applyTauEventSelection && !selectedTauEvent(trkDaug1, trkDaug2)) { + return; } histos.get(HIST("EventTwoTracks/hInvariantMass"))->Fill(mother.M()); @@ -1202,16 +1026,10 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/hMotherMassVsPt"))->Fill(mother.M(), mother.Pt()); if (motherOfPions.Pt() < 0.2) { histos.get(HIST("EventTwoTracks/hInvariantMassWideAllPionMassPtCut"))->Fill(motherOfPions.M()); - if (passAvgITSclsSizesCut) { - histos.get(HIST("EventTwoTracks/hInvariantMassWideAllPionMassPtCutITScut"))->Fill(motherOfPions.M()); - } } if (countTOFtracks == 2) { histos.get(HIST("EventTwoTracks/hInvariantMassWideAllPionMassTOF"))->Fill(motherOfPions.M()); } - if (passAvgITSclsSizesCut) { - histos.get(HIST("EventTwoTracks/hInvariantMassWideAllPionMassITScut"))->Fill(motherOfPions.M()); - } histos.get(HIST("EventTwoTracks/hDaughtersPvsITSclusterSize"))->Fill(getAvgITSClSize(trkDaug1), trkDaug1.sign() * daug[0].P()); histos.get(HIST("EventTwoTracks/hDaughtersPvsITSclusterSize"))->Fill(getAvgITSClSize(trkDaug2), trkDaug2.sign() * daug[1].P()); histos.get(HIST("EventTwoTracks/hDaughtersPvsITSclusterSizeXcos"))->Fill(getAvgITSClSize(trkDaug1) * getCosLambda(trkDaug1), trkDaug1.sign() * daug[0].P()); @@ -1219,7 +1037,7 @@ struct UpcTauCentralBarrelRL { // ee, mm, em, pp, ep, mp, pppp, eppp, mppp, pppppp if (countPVGTelectrons == 2) { - histos.get(HIST("Events/hChannelsRatio"))->Fill(0); + histos.get(HIST("Events/hChannels"))->Fill(CH_EE); histos.get(HIST("EventTwoTracks/TwoElectrons/hInvariantMass"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/TwoElectrons/hInvariantMassWide"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/TwoElectrons/hAcoplanarity"))->Fill(acoplanarity); @@ -1261,7 +1079,7 @@ struct UpcTauCentralBarrelRL { } } if (countPVGTmuons == 2) { - histos.get(HIST("Events/hChannelsRatio"))->Fill(1); + histos.get(HIST("Events/hChannels"))->Fill(CH_MUMU); histos.get(HIST("EventTwoTracks/TwoMuons/hInvariantMass"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/TwoMuons/hInvariantMassWide"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/TwoMuons/hAcoplanarity"))->Fill(acoplanarity); @@ -1293,7 +1111,7 @@ struct UpcTauCentralBarrelRL { } } if (countPVGTelectrons == 1 && countPVGTmuons == 1) { - histos.get(HIST("Events/hChannelsRatio"))->Fill(2); + histos.get(HIST("Events/hChannels"))->Fill(CH_EMU); histos.get(HIST("EventTwoTracks/ElectronMuon/hInvariantMass"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/ElectronMuon/hInvariantMassWide"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/ElectronMuon/hAcoplanarity"))->Fill(acoplanarity); @@ -1310,7 +1128,7 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/ElectronMuon/hDaughtersRapidity"))->Fill(daug[0].Rapidity(), daug[1].Rapidity()); } if (countPVGTpions == 2) { - histos.get(HIST("Events/hChannelsRatio"))->Fill(3); + histos.get(HIST("Events/hChannels"))->Fill(CH_PIPI); histos.get(HIST("EventTwoTracks/TwoPions/hInvariantMass"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/TwoPions/hInvariantMassWide"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/TwoPions/hAcoplanarity"))->Fill(acoplanarity); @@ -1342,7 +1160,7 @@ struct UpcTauCentralBarrelRL { } } if (countPVGTelectrons == 1 && countPVGTpions == 1) { - histos.get(HIST("Events/hChannelsRatio"))->Fill(4); + histos.get(HIST("Events/hChannels"))->Fill(CH_EPI); histos.get(HIST("EventTwoTracks/ElectronPion/hInvariantMass"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/ElectronPion/hInvariantMassWide"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/ElectronPion/hAcoplanarity"))->Fill(acoplanarity); @@ -1359,7 +1177,7 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/ElectronPion/hDaughtersRapidity"))->Fill(daug[0].Rapidity(), daug[1].Rapidity()); } if (countPVGTpions == 1 && countPVGTmuons == 1) { - histos.get(HIST("Events/hChannelsRatio"))->Fill(5); + histos.get(HIST("Events/hChannels"))->Fill(CH_MUPI); histos.get(HIST("EventTwoTracks/MuonPion/hInvariantMass"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/MuonPion/hInvariantMassWide"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/MuonPion/hAcoplanarity"))->Fill(acoplanarity); @@ -1379,9 +1197,12 @@ struct UpcTauCentralBarrelRL { } } if ((countPVGTelectrons == 1 && countPVGTmuons == 1) || (countPVGTelectrons == 1 && countPVGTpions == 1)) { - double electronPt = (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); + double electronPt = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); + histos.get(HIST("Events/hChannels"))->Fill(CH_EMUPI); histos.get(HIST("EventTwoTracks/ElectronMuPi/hInvariantMass"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hInvariantMassWide"))->Fill(mother.M()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PionsSelection/hInvariantMass"))->Fill(motherOfPions.M()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PionsSelection/hInvariantMassWide"))->Fill(motherOfPions.M()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hAcoplanarity"))->Fill(acoplanarity); histos.get(HIST("EventTwoTracks/ElectronMuPi/hMotherP"))->Fill(mother.P()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hMotherPwide"))->Fill(mother.P()); @@ -1396,11 +1217,11 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/ElectronMuPi/hDaughtersPt"))->Fill(daug[0].Pt(), daug[1].Pt()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hDaughtersPhi"))->Fill(daug[0].Phi(), daug[1].Phi()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hDaughtersRapidity"))->Fill(daug[0].Rapidity(), daug[1].Rapidity()); - histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronPvsOtherP"))->Fill((enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].P() : daug[1].P(), (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[1].P() : daug[0].P()); - histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronPwideVsOtherPwide"))->Fill((enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].P() : daug[1].P(), (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[1].P() : daug[0].P()); - histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronPtVsOtherPt"))->Fill((enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(), (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[1].Pt() : daug[0].Pt()); - histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronPhiVsOtherPhi"))->Fill((enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].Phi() : daug[1].Phi(), (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[1].Phi() : daug[0].Phi()); - histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronRapVsOtherRap"))->Fill((enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].Rapidity() : daug[1].Rapidity(), (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[1].Rapidity() : daug[0].Rapidity()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronPvsOtherP"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].P() : daug[1].P(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].P() : daug[0].P()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronPwideVsOtherPwide"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].P() : daug[1].P(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].P() : daug[0].P()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronPtVsOtherPt"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].Pt() : daug[0].Pt()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronPhiVsOtherPhi"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Phi() : daug[1].Phi(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].Phi() : daug[0].Phi()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronRapVsOtherRap"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Rapidity() : daug[1].Rapidity(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].Rapidity() : daug[0].Rapidity()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hNeventsPtCuts"))->Fill(0); if (mother.Pt() < 9.) histos.get(HIST("EventTwoTracks/ElectronMuPi/hNeventsPtCuts"))->Fill(1); @@ -1428,7 +1249,7 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/ElectronMuPi/hNeventsPtCuts"))->Fill(12); } if ((countPVGTelectrons == 2) || (countPVGTelectrons == 1 && countPVGTmuons == 1) || (countPVGTelectrons == 1 && countPVGTpions == 1)) { - double electronPt = (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); + double electronPt = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); if (countPVGTelectrons == 2) electronPt = (daug[0].Pt() > daug[1].Pt()) ? daug[0].Pt() : daug[1].Pt(); histos.get(HIST("EventTwoTracks/ElectronOther/hInvariantMass"))->Fill(mother.M()); @@ -1454,11 +1275,11 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/ElectronOther/hElectronPhiVsOtherPhi"))->Fill(((daug[0].P() > daug[1].P()) ? daug[0].Phi() : daug[1].Phi()), ((daug[0].P() > daug[1].P()) ? daug[1].Phi() : daug[0].Phi())); histos.get(HIST("EventTwoTracks/ElectronOther/hElectronRapVsOtherRap"))->Fill(((daug[0].P() > daug[1].P()) ? daug[0].Rapidity() : daug[1].Rapidity()), ((daug[0].P() > daug[1].P()) ? daug[1].Rapidity() : daug[0].Rapidity())); } else { - histos.get(HIST("EventTwoTracks/ElectronOther/hElectronPvsOtherP"))->Fill((enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].P() : daug[1].P(), (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[1].P() : daug[0].P()); - histos.get(HIST("EventTwoTracks/ElectronOther/hElectronPwideVsOtherPwide"))->Fill((enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].P() : daug[1].P(), (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[1].P() : daug[0].P()); - histos.get(HIST("EventTwoTracks/ElectronOther/hElectronPtVsOtherPt"))->Fill((enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(), (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[1].Pt() : daug[0].Pt()); - histos.get(HIST("EventTwoTracks/ElectronOther/hElectronPhiVsOtherPhi"))->Fill((enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].Phi() : daug[1].Phi(), (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[1].Phi() : daug[0].Phi()); - histos.get(HIST("EventTwoTracks/ElectronOther/hElectronRapVsOtherRap"))->Fill((enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].Rapidity() : daug[1].Rapidity(), (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[1].Rapidity() : daug[0].Rapidity()); + histos.get(HIST("EventTwoTracks/ElectronOther/hElectronPvsOtherP"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].P() : daug[1].P(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].P() : daug[0].P()); + histos.get(HIST("EventTwoTracks/ElectronOther/hElectronPwideVsOtherPwide"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].P() : daug[1].P(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].P() : daug[0].P()); + histos.get(HIST("EventTwoTracks/ElectronOther/hElectronPtVsOtherPt"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].Pt() : daug[0].Pt()); + histos.get(HIST("EventTwoTracks/ElectronOther/hElectronPhiVsOtherPhi"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Phi() : daug[1].Phi(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].Phi() : daug[0].Phi()); + histos.get(HIST("EventTwoTracks/ElectronOther/hElectronRapVsOtherRap"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Rapidity() : daug[1].Rapidity(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].Rapidity() : daug[0].Rapidity()); } histos.get(HIST("EventTwoTracks/ElectronOther/hNeventsPtCuts"))->Fill(0); if (mother.Pt() < 9.) @@ -1486,410 +1307,6 @@ struct UpcTauCentralBarrelRL { if (electronPt > 2. && electronPt < 100.) histos.get(HIST("EventTwoTracks/ElectronOther/hNeventsPtCuts"))->Fill(12); } - if (countPVGTpionsSelection == 2 && doPionStudy) { - histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMass"))->Fill(motherOfPions.M()); - histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWide"))->Fill(motherOfPions.M()); - histos.get(HIST("EventTwoTracks/PionsSelection/hAcoplanarity"))->Fill(acoplanarity); - histos.get(HIST("EventTwoTracks/PionsSelection/hMotherP"))->Fill(motherOfPions.P()); - histos.get(HIST("EventTwoTracks/PionsSelection/hMotherPwide"))->Fill(motherOfPions.P()); - histos.get(HIST("EventTwoTracks/PionsSelection/hMotherPt"))->Fill(motherOfPions.Pt()); - histos.get(HIST("EventTwoTracks/PionsSelection/hMotherPhi"))->Fill(motherOfPions.Phi()); - histos.get(HIST("EventTwoTracks/PionsSelection/hMotherRapidity"))->Fill(motherOfPions.Rapidity()); - histos.get(HIST("EventTwoTracks/PionsSelection/hMotherMassVsPt"))->Fill(motherOfPions.M(), motherOfPions.Pt()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersP"))->Fill(pion[0].P(), pion[1].P()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPwide"))->Fill(pion[0].P(), pion[1].P()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPt"))->Fill(pion[0].Pt(), pion[1].Pt()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPhi"))->Fill(pion[0].Phi(), pion[1].Phi()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersRapidity"))->Fill(pion[0].Rapidity(), pion[1].Rapidity()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPtvsDcaXY"))->Fill(trkDaug1.pt(), trkDaug1.dcaXY()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPtvsDcaXY"))->Fill(trkDaug2.pt(), trkDaug2.dcaXY()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPtvsModPhi"))->Fill(pion[0].Pt(), getPhiModN(pion[0].Phi(), trkDaug1.sign(), 1)); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPtvsModPhi"))->Fill(pion[1].Pt(), getPhiModN(pion[1].Phi(), trkDaug2.sign(), 1)); - if (motherOfPions.Pt() < 0.2) { - histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassPtCut"))->Fill(motherOfPions.M()); - histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWidePtCut"))->Fill(motherOfPions.M()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPtvsModPhiPtCut"))->Fill(pion[0].Pt(), getPhiModN(pion[0].Phi(), trkDaug1.sign(), 1)); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPtvsModPhiPtCut"))->Fill(pion[1].Pt(), getPhiModN(pion[1].Phi(), trkDaug2.sign(), 1)); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPtvsDcaXYPtCut"))->Fill(trkDaug1.pt(), trkDaug1.dcaXY()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPtvsDcaXYPtCut"))->Fill(trkDaug2.pt(), trkDaug2.dcaXY()); - if (sign < 0) { - histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutUS"))->Fill(motherOfPions.M()); - histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutUSmuMass"))->Fill(motherOfMuons.M()); - } - if (sign > 0) - histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutLS"))->Fill(motherOfPions.M()); - if (countTOFtracks == 2) { - if (sign < 0) { - histos.get(HIST("EventTwoTracks/PionsSelection/hasTOF/hInvariantMassWidePtCutUS"))->Fill(motherOfPions.M()); - histos.get(HIST("EventTwoTracks/PionsSelection/hasTOF/hInvariantMassWidePtCutUSmuMass"))->Fill(motherOfMuons.M()); - } - if (sign > 0) - histos.get(HIST("EventTwoTracks/PionsSelection/hasTOF/hInvariantMassWidePtCutLS"))->Fill(motherOfPions.M()); - } - if (passAvgITSclsSizesCut) { - if (sign < 0) - histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutUSITScut"))->Fill(motherOfPions.M()); - if (sign > 0) - histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutLSITScut"))->Fill(motherOfPions.M()); - } - if (countTOFtracks == 2) { - histos.get(HIST("EventTwoTracks/PionsSelection/hasTOF/hDaughtersPtvsModPhiPtCut"))->Fill(pion[0].Pt(), getPhiModN(pion[0].Phi(), trkDaug1.sign(), 1)); - histos.get(HIST("EventTwoTracks/PionsSelection/hasTOF/hDaughtersPtvsModPhiPtCut"))->Fill(pion[1].Pt(), getPhiModN(pion[1].Phi(), trkDaug2.sign(), 1)); - } - } - if (countTOFtracks == 2) { - histos.get(HIST("EventTwoTracks/PionsSelection/hasTOF/hInvariantMassWide"))->Fill(motherOfPions.M()); - histos.get(HIST("EventTwoTracks/PionsSelection/hasTOF/hDaughtersPtvsModPhi"))->Fill(pion[0].Pt(), getPhiModN(pion[0].Phi(), trkDaug1.sign(), 1)); - histos.get(HIST("EventTwoTracks/PionsSelection/hasTOF/hDaughtersPtvsModPhi"))->Fill(pion[1].Pt(), getPhiModN(pion[1].Phi(), trkDaug2.sign(), 1)); - } - if (passAvgITSclsSizesCut) { - histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWideITS"))->Fill(motherOfPions.M()); - } - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPvsITSclusterSize"))->Fill(getAvgITSClSize(trkDaug1), trkDaug1.sign() * daug[0].P()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPvsITSclusterSize"))->Fill(getAvgITSClSize(trkDaug2), trkDaug2.sign() * daug[1].P()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPvsITSclusterSizeXcos"))->Fill(getAvgITSClSize(trkDaug1) * getCosLambda(trkDaug1), trkDaug1.sign() * daug[0].P()); - histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPvsITSclusterSizeXcos"))->Fill(getAvgITSClSize(trkDaug2) * getCosLambda(trkDaug2), trkDaug2.sign() * daug[1].P()); - } - if (countPVGTmuonsSelection == 2 && doMuonStudy) { - float phiModNtrk1 = getPhiModN(muon[0].Phi(), trkDaug1.sign(), 1); - float phiModNtrk2 = getPhiModN(muon[1].Phi(), trkDaug2.sign(), 1); - float cutPhiModN1 = 0.01; - float cutPhiModN2 = 0.03; - float cutPhiModN3 = 0.06; - float cutPhiModN4 = 0.1; - float cutPhiModN5 = 0.2; - float phiPos = 0.; - float phiNeg = 0.; - if (trkDaug1.sign() > 0) { - phiPos = muon[0].Phi(); - phiNeg = muon[1].Phi(); - } else { - phiPos = muon[1].Phi(); - phiNeg = muon[0].Phi(); - } - float phiPosTPC = phiPos - o2::math_utils::angle2Alpha(phiPos); - float phiNegTPC = phiNeg - o2::math_utils::angle2Alpha(phiNeg); - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMass"))->Fill(motherOfMuons.M()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWide"))->Fill(motherOfMuons.M()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hAcoplanarity"))->Fill(acoplanarity); - histos.get(HIST("EventTwoTracks/MuonsSelection/hMotherP"))->Fill(motherOfMuons.P()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hMotherPwide"))->Fill(motherOfMuons.P()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hMotherPt"))->Fill(motherOfMuons.Pt()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hMotherPhi"))->Fill(motherOfMuons.Phi()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hMotherRapidity"))->Fill(motherOfMuons.Rapidity()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersP"))->Fill(muon[0].P(), muon[1].P()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPwide"))->Fill(muon[0].P(), muon[1].P()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPt"))->Fill(muon[0].Pt(), muon[1].Pt()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPhi"))->Fill(muon[0].Phi(), muon[1].Phi()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersRapidity"))->Fill(muon[0].Rapidity(), muon[1].Rapidity()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsDcaXY"))->Fill(trkDaug1.pt(), trkDaug1.dcaXY()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsDcaXY"))->Fill(trkDaug2.pt(), trkDaug2.dcaXY()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhi"))->Fill(muon[0].Pt(), phiModNtrk1); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhi"))->Fill(muon[1].Pt(), phiModNtrk2); - histos.get(HIST("EventTwoTracks/MuonsSelection/hMotherMassVsPt"))->Fill(motherOfMuons.M(), motherOfMuons.Pt()); - if (motherOfMuons.M() > 2.9 && motherOfMuons.M() < 3.2) - histos.get(HIST("EventTwoTracks/MuonsSelection/hJpsiPt"))->Fill(motherOfMuons.Pt()); - if (doJpsiMuMuTests) { - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN1)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut1"))->Fill(muon[0].Pt(), phiModNtrk1); - if (isNotCloseToTPCBorder(phiModNtrk2, muon[1].Pt(), cutPhiModN1)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut1"))->Fill(muon[1].Pt(), phiModNtrk2); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN2)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut2"))->Fill(muon[0].Pt(), phiModNtrk1); - if (isNotCloseToTPCBorder(phiModNtrk2, muon[1].Pt(), cutPhiModN2)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut2"))->Fill(muon[1].Pt(), phiModNtrk2); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN3)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut3"))->Fill(muon[0].Pt(), phiModNtrk1); - if (isNotCloseToTPCBorder(phiModNtrk2, muon[1].Pt(), cutPhiModN3)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut3"))->Fill(muon[1].Pt(), phiModNtrk2); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN4)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut4"))->Fill(muon[0].Pt(), phiModNtrk1); - if (isNotCloseToTPCBorder(phiModNtrk2, muon[1].Pt(), cutPhiModN4)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut4"))->Fill(muon[1].Pt(), phiModNtrk2); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN5)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut5"))->Fill(muon[0].Pt(), phiModNtrk1); - if (isNotCloseToTPCBorder(phiModNtrk2, muon[1].Pt(), cutPhiModN5)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiTPCbordersCut5"))->Fill(muon[1].Pt(), phiModNtrk2); - } - if (motherOfMuons.Pt() < 0.2) { - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassPtCut"))->Fill(motherOfMuons.M()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCut"))->Fill(motherOfMuons.M()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiPtCut"))->Fill(muon[0].Pt(), phiModNtrk1); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsModPhiPtCut"))->Fill(muon[1].Pt(), phiModNtrk2); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsDcaXYPtCut"))->Fill(trkDaug1.pt(), trkDaug1.dcaXY()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPtvsDcaXYPtCut"))->Fill(trkDaug2.pt(), trkDaug2.dcaXY()); - if (sign < 0) { - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUS"))->Fill(motherOfMuons.M()); - if (doJpsiMuMuTests) { - if (muon[0].Eta() < 0.0 && muon[1].Eta() < 0.0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSnegEta"))->Fill(motherOfMuons.M()); - if (muon[0].Eta() > 0.0 && muon[1].Eta() > 0.0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSposEta"))->Fill(motherOfMuons.M()); - if (motherOfMuons.Rapidity() < 0.0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSnegRap"))->Fill(motherOfMuons.M()); - if (motherOfMuons.Rapidity() > 0.0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSposRap"))->Fill(motherOfMuons.M()); - if (std::abs(motherOfMuons.Rapidity()) < 1.2) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSrap12"))->Fill(motherOfMuons.M()); - if (std::abs(motherOfMuons.Rapidity()) < 1.0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSrap10"))->Fill(motherOfMuons.M()); - if (std::abs(motherOfMuons.Rapidity()) < 0.8) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSrap08"))->Fill(motherOfMuons.M()); - if (std::abs(motherOfMuons.Rapidity()) < 0.5) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSrap05"))->Fill(motherOfMuons.M()); - if (std::abs(motherOfMuons.Rapidity()) < 0.3) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSrap03"))->Fill(motherOfMuons.M()); - if (countTPCcls70 == 2) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcNcls70"))->Fill(motherOfMuons.M()); - if (countTPCcls100 == 2) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcNcls100"))->Fill(motherOfMuons.M()); - if (countTPCxRws70 == 2) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcNxRws70"))->Fill(motherOfMuons.M()); - if (countTPCxRws100 == 2) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcNxRws100"))->Fill(motherOfMuons.M()); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN1) && isNotCloseToTPCBorder(phiModNtrk2, muon[0].Pt(), cutPhiModN1)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcBordersCut1"))->Fill(motherOfMuons.M()); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN2) && isNotCloseToTPCBorder(phiModNtrk2, muon[0].Pt(), cutPhiModN2)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcBordersCut2"))->Fill(motherOfMuons.M()); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN3) && isNotCloseToTPCBorder(phiModNtrk2, muon[0].Pt(), cutPhiModN3)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcBordersCut3"))->Fill(motherOfMuons.M()); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN4) && isNotCloseToTPCBorder(phiModNtrk2, muon[0].Pt(), cutPhiModN4)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcBordersCut4"))->Fill(motherOfMuons.M()); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN5) && isNotCloseToTPCBorder(phiModNtrk2, muon[0].Pt(), cutPhiModN5)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUStpcBordersCut5"))->Fill(motherOfMuons.M()); - if (-8 * o2::constants::math::PI / 8 <= phiPos && phiPos <= -7 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi1"))->Fill(motherOfMuons.M()); - if (-7 * o2::constants::math::PI / 8 < phiPos && phiPos <= -6 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi2"))->Fill(motherOfMuons.M()); - if (-6 * o2::constants::math::PI / 8 < phiPos && phiPos <= -5 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi3"))->Fill(motherOfMuons.M()); - if (-5 * o2::constants::math::PI / 8 < phiPos && phiPos <= -4 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi4"))->Fill(motherOfMuons.M()); - if (-4 * o2::constants::math::PI / 8 < phiPos && phiPos <= -3 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi5"))->Fill(motherOfMuons.M()); - if (-3 * o2::constants::math::PI / 8 < phiPos && phiPos <= -2 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi6"))->Fill(motherOfMuons.M()); - if (-2 * o2::constants::math::PI / 8 < phiPos && phiPos <= -1 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi7"))->Fill(motherOfMuons.M()); - if (-1 * o2::constants::math::PI / 8 < phiPos && phiPos <= -0 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi8"))->Fill(motherOfMuons.M()); - if (0 * o2::constants::math::PI / 8 < phiPos && phiPos <= 1 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi9"))->Fill(motherOfMuons.M()); - if (1 * o2::constants::math::PI / 8 < phiPos && phiPos <= 2 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi10"))->Fill(motherOfMuons.M()); - if (2 * o2::constants::math::PI / 8 < phiPos && phiPos <= 3 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi11"))->Fill(motherOfMuons.M()); - if (3 * o2::constants::math::PI / 8 < phiPos && phiPos <= 4 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi12"))->Fill(motherOfMuons.M()); - if (4 * o2::constants::math::PI / 8 < phiPos && phiPos <= 5 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi13"))->Fill(motherOfMuons.M()); - if (5 * o2::constants::math::PI / 8 < phiPos && phiPos <= 6 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi14"))->Fill(motherOfMuons.M()); - if (6 * o2::constants::math::PI / 8 < phiPos && phiPos <= 7 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi15"))->Fill(motherOfMuons.M()); - if (7 * o2::constants::math::PI / 8 < phiPos && phiPos <= 8 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhi16"))->Fill(motherOfMuons.M()); - if (-8 * o2::constants::math::PI / 8 <= phiNeg && phiNeg <= -7 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi1"))->Fill(motherOfMuons.M()); - if (-7 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= -6 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi2"))->Fill(motherOfMuons.M()); - if (-6 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= -5 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi3"))->Fill(motherOfMuons.M()); - if (-5 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= -4 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi4"))->Fill(motherOfMuons.M()); - if (-4 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= -3 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi5"))->Fill(motherOfMuons.M()); - if (-3 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= -2 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi6"))->Fill(motherOfMuons.M()); - if (-2 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= -1 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi7"))->Fill(motherOfMuons.M()); - if (-1 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= -0 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi8"))->Fill(motherOfMuons.M()); - if (0 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= 1 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi9"))->Fill(motherOfMuons.M()); - if (1 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= 2 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi10"))->Fill(motherOfMuons.M()); - if (2 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= 3 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi11"))->Fill(motherOfMuons.M()); - if (3 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= 4 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi12"))->Fill(motherOfMuons.M()); - if (4 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= 5 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi13"))->Fill(motherOfMuons.M()); - if (5 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= 6 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi14"))->Fill(motherOfMuons.M()); - if (6 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= 7 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi15"))->Fill(motherOfMuons.M()); - if (7 * o2::constants::math::PI / 8 < phiNeg && phiNeg <= 8 * o2::constants::math::PI / 8) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhi16"))->Fill(motherOfMuons.M()); - - if (-8 * o2::constants::math::PI / 256 <= phiPosTPC && phiPosTPC <= -7 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC1"))->Fill(motherOfMuons.M()); - if (-7 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= -6 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC2"))->Fill(motherOfMuons.M()); - if (-6 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= -5 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC3"))->Fill(motherOfMuons.M()); - if (-5 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= -4 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC4"))->Fill(motherOfMuons.M()); - if (-4 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= -3 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC5"))->Fill(motherOfMuons.M()); - if (-3 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= -2 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC6"))->Fill(motherOfMuons.M()); - if (-2 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= -1 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC7"))->Fill(motherOfMuons.M()); - if (-1 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= -0 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC8"))->Fill(motherOfMuons.M()); - if (0 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= 1 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC9"))->Fill(motherOfMuons.M()); - if (1 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= 2 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC10"))->Fill(motherOfMuons.M()); - if (2 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= 3 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC11"))->Fill(motherOfMuons.M()); - if (3 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= 4 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC12"))->Fill(motherOfMuons.M()); - if (4 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= 5 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC13"))->Fill(motherOfMuons.M()); - if (5 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= 6 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC14"))->Fill(motherOfMuons.M()); - if (6 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= 7 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC15"))->Fill(motherOfMuons.M()); - if (7 * o2::constants::math::PI / 256 < phiPosTPC && phiPosTPC <= 8 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmupPhiTPC16"))->Fill(motherOfMuons.M()); - if (-8 * o2::constants::math::PI / 256 <= phiNegTPC && phiNegTPC <= -7 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC1"))->Fill(motherOfMuons.M()); - if (-7 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= -6 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC2"))->Fill(motherOfMuons.M()); - if (-6 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= -5 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC3"))->Fill(motherOfMuons.M()); - if (-5 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= -4 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC4"))->Fill(motherOfMuons.M()); - if (-4 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= -3 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC5"))->Fill(motherOfMuons.M()); - if (-3 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= -2 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC6"))->Fill(motherOfMuons.M()); - if (-2 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= -1 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC7"))->Fill(motherOfMuons.M()); - if (-1 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= -0 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC8"))->Fill(motherOfMuons.M()); - if (0 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= 1 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC9"))->Fill(motherOfMuons.M()); - if (1 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= 2 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC10"))->Fill(motherOfMuons.M()); - if (2 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= 3 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC11"))->Fill(motherOfMuons.M()); - if (3 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= 4 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC12"))->Fill(motherOfMuons.M()); - if (4 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= 5 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC13"))->Fill(motherOfMuons.M()); - if (5 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= 6 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC14"))->Fill(motherOfMuons.M()); - if (6 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= 7 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC15"))->Fill(motherOfMuons.M()); - if (7 * o2::constants::math::PI / 256 < phiNegTPC && phiNegTPC <= 8 * o2::constants::math::PI / 256) - histos.get(HIST("EventTwoTracks/MuonsSelection/Ruben/hInvariantMassWidePtCutUSmumPhiTPC16"))->Fill(motherOfMuons.M()); - } - } - if (sign > 0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutLS"))->Fill(motherOfMuons.M()); - if (countTOFtracks == 2) { - if (sign < 0) { - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUS"))->Fill(motherOfMuons.M()); - if (doJpsiMuMuTests) { - if (muon[0].Eta() < 0.0 && muon[1].Eta() < 0.0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSnegEta"))->Fill(motherOfMuons.M()); - if (muon[0].Eta() > 0.0 && muon[1].Eta() > 0.0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSposEta"))->Fill(motherOfMuons.M()); - if (motherOfMuons.Rapidity() < 0.0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSnegRap"))->Fill(motherOfMuons.M()); - if (motherOfMuons.Rapidity() > 0.0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSposRap"))->Fill(motherOfMuons.M()); - if (std::abs(motherOfMuons.Rapidity()) < 1.2) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSrap12"))->Fill(motherOfMuons.M()); - if (std::abs(motherOfMuons.Rapidity()) < 1.0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSrap10"))->Fill(motherOfMuons.M()); - if (std::abs(motherOfMuons.Rapidity()) < 0.8) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSrap08"))->Fill(motherOfMuons.M()); - if (std::abs(motherOfMuons.Rapidity()) < 0.5) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSrap05"))->Fill(motherOfMuons.M()); - if (std::abs(motherOfMuons.Rapidity()) < 0.3) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUSrap03"))->Fill(motherOfMuons.M()); - if (countTPCcls70 == 2) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcNcls70"))->Fill(motherOfMuons.M()); - if (countTPCcls100 == 2) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcNcls100"))->Fill(motherOfMuons.M()); - if (countTPCxRws70 == 2) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcNxRws70"))->Fill(motherOfMuons.M()); - if (countTPCxRws100 == 2) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcNxRws100"))->Fill(motherOfMuons.M()); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN1) && isNotCloseToTPCBorder(phiModNtrk2, muon[0].Pt(), cutPhiModN1)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcBordersCut1"))->Fill(motherOfMuons.M()); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN2) && isNotCloseToTPCBorder(phiModNtrk2, muon[0].Pt(), cutPhiModN2)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcBordersCut2"))->Fill(motherOfMuons.M()); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN3) && isNotCloseToTPCBorder(phiModNtrk2, muon[0].Pt(), cutPhiModN3)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcBordersCut3"))->Fill(motherOfMuons.M()); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN4) && isNotCloseToTPCBorder(phiModNtrk2, muon[0].Pt(), cutPhiModN4)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcBordersCut4"))->Fill(motherOfMuons.M()); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN5) && isNotCloseToTPCBorder(phiModNtrk2, muon[0].Pt(), cutPhiModN5)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutUStpcBordersCut5"))->Fill(motherOfMuons.M()); - } - } - if (sign > 0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWidePtCutLS"))->Fill(motherOfMuons.M()); - } - if (passAvgITSclsSizesCut) { - if (sign < 0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutUSITScut"))->Fill(motherOfMuons.M()); - if (sign > 0) - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWidePtCutLSITScut"))->Fill(motherOfMuons.M()); - } - if (countTOFtracks == 2) { - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiPtCut"))->Fill(muon[0].Pt(), phiModNtrk1); - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiPtCut"))->Fill(muon[1].Pt(), phiModNtrk2); - } - } - if (countTOFtracks == 2) { - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hInvariantMassWide"))->Fill(motherOfMuons.M()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhi"))->Fill(muon[0].Pt(), phiModNtrk1); - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhi"))->Fill(muon[1].Pt(), phiModNtrk2); - if (doJpsiMuMuTests) { - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN1)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut1"))->Fill(muon[0].Pt(), phiModNtrk1); - if (isNotCloseToTPCBorder(phiModNtrk2, muon[1].Pt(), cutPhiModN1)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut1"))->Fill(muon[1].Pt(), phiModNtrk2); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN2)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut2"))->Fill(muon[0].Pt(), phiModNtrk1); - if (isNotCloseToTPCBorder(phiModNtrk2, muon[1].Pt(), cutPhiModN2)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut2"))->Fill(muon[1].Pt(), phiModNtrk2); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN3)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut3"))->Fill(muon[0].Pt(), phiModNtrk1); - if (isNotCloseToTPCBorder(phiModNtrk2, muon[1].Pt(), cutPhiModN3)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut3"))->Fill(muon[1].Pt(), phiModNtrk2); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN4)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut4"))->Fill(muon[0].Pt(), phiModNtrk1); - if (isNotCloseToTPCBorder(phiModNtrk2, muon[1].Pt(), cutPhiModN4)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut4"))->Fill(muon[1].Pt(), phiModNtrk2); - if (isNotCloseToTPCBorder(phiModNtrk1, muon[0].Pt(), cutPhiModN5)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut5"))->Fill(muon[0].Pt(), phiModNtrk1); - if (isNotCloseToTPCBorder(phiModNtrk2, muon[1].Pt(), cutPhiModN5)) - histos.get(HIST("EventTwoTracks/MuonsSelection/hasTOF/hDaughtersPtvsModPhiTPCbordersCut5"))->Fill(muon[1].Pt(), phiModNtrk2); - } - } - if (reinstallRun2JpsiEventSelection(reconstructedCollision, trkDaug1, trkDaug2, motherOfMuons.Rapidity(), acoplanarity)) { - histos.get(HIST("EventTwoTracks/MuonsSelection/Run2Cuts/hInvariantMassWide"))->Fill(motherOfMuons.M()); - if (motherOfMuons.Pt() < 2.0) { - histos.get(HIST("EventTwoTracks/MuonsSelection/Run2Cuts/hInvariantMassWidePtFitPlot"))->Fill(motherOfMuons.M()); - } - if (motherOfMuons.Pt() < 0.11) { - histos.get(HIST("EventTwoTracks/MuonsSelection/Run2Cuts/hInvariantMassWideCS"))->Fill(motherOfMuons.M()); - } - } - if (passAvgITSclsSizesCut) { - histos.get(HIST("EventTwoTracks/MuonsSelection/hInvariantMassWideITS"))->Fill(motherOfMuons.M()); - } - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPvsITSclusterSize"))->Fill(getAvgITSClSize(trkDaug1), trkDaug1.sign() * daug[0].P()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPvsITSclusterSize"))->Fill(getAvgITSClSize(trkDaug2), trkDaug2.sign() * daug[1].P()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPvsITSclusterSizeXcos"))->Fill(getAvgITSClSize(trkDaug1) * getCosLambda(trkDaug1), trkDaug1.sign() * daug[0].P()); - histos.get(HIST("EventTwoTracks/MuonsSelection/hDaughtersPvsITSclusterSizeXcos"))->Fill(getAvgITSClSize(trkDaug2) * getCosLambda(trkDaug2), trkDaug2.sign() * daug[1].P()); - } } else if (countPVGTselected == 4 && doFourTracks) { TLorentzVector mother, daug[4]; @@ -1897,10 +1314,10 @@ struct UpcTauCentralBarrelRL { const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(vecPVidx[1]); const auto& trkDaug3 = reconstructedBarrelTracks.iteratorAt(vecPVidx[2]); const auto& trkDaug4 = reconstructedBarrelTracks.iteratorAt(vecPVidx[3]); - daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); - daug[2].SetPxPyPzE(trkDaug3.px(), trkDaug3.py(), trkDaug3.pz(), energy(pdg->Mass(trackPDG(trkDaug3)), trkDaug3.px(), trkDaug3.py(), trkDaug3.pz())); - daug[3].SetPxPyPzE(trkDaug4.px(), trkDaug4.py(), trkDaug4.pz(), energy(pdg->Mass(trackPDG(trkDaug4)), trkDaug4.px(), trkDaug4.py(), trkDaug4.pz())); + daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + daug[2].SetPxPyPzE(trkDaug3.px(), trkDaug3.py(), trkDaug3.pz(), energy(pdg->Mass(trackPDG(trkDaug3, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug3.px(), trkDaug3.py(), trkDaug3.pz())); + daug[3].SetPxPyPzE(trkDaug4.px(), trkDaug4.py(), trkDaug4.pz(), energy(pdg->Mass(trackPDG(trkDaug4, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug4.px(), trkDaug4.py(), trkDaug4.pz())); mother = daug[0] + daug[1] + daug[2] + daug[3]; histos.get(HIST("EventFourTracks/hInvariantMass"))->Fill(mother.M()); @@ -1914,7 +1331,7 @@ struct UpcTauCentralBarrelRL { // ee, mm, em, pp, ep, mp, pppp, eppp, mppp, pppppp if (countPVGTpions == 4) { - histos.get(HIST("Events/hChannelsRatio"))->Fill(6); + histos.get(HIST("Events/hChannels"))->Fill(CH_FOURPI); histos.get(HIST("EventFourTracks/WithPion/hInvariantMass"))->Fill(mother.M()); histos.get(HIST("EventFourTracks/WithPion/hInvariantMassWide"))->Fill(mother.M()); histos.get(HIST("EventFourTracks/WithPion/hMotherP"))->Fill(mother.P()); @@ -1925,7 +1342,7 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventFourTracks/WithPion/hMotherMassVsPt"))->Fill(mother.M(), mother.Pt()); } if (countPVGTelectrons == 1 && countPVGTpions == 3) { - histos.get(HIST("Events/hChannelsRatio"))->Fill(7); + histos.get(HIST("Events/hChannels"))->Fill(CH_ETHREEPI); histos.get(HIST("EventFourTracks/WithElectron/hInvariantMass"))->Fill(mother.M()); histos.get(HIST("EventFourTracks/WithElectron/hInvariantMassWide"))->Fill(mother.M()); histos.get(HIST("EventFourTracks/WithElectron/hMotherP"))->Fill(mother.P()); @@ -1936,7 +1353,7 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventFourTracks/WithElectron/hMotherMassVsPt"))->Fill(mother.M(), mother.Pt()); } if (countPVGTpions == 3 && countPVGTmuons == 1) { - histos.get(HIST("Events/hChannelsRatio"))->Fill(8); + histos.get(HIST("Events/hChannels"))->Fill(CH_MUTHREEPI); histos.get(HIST("EventFourTracks/WithMuon/hInvariantMass"))->Fill(mother.M()); histos.get(HIST("EventFourTracks/WithMuon/hInvariantMassWide"))->Fill(mother.M()); histos.get(HIST("EventFourTracks/WithMuon/hMotherP"))->Fill(mother.P()); @@ -1946,44 +1363,6 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventFourTracks/WithMuon/hMotherRapidity"))->Fill(mother.Rapidity()); histos.get(HIST("EventFourTracks/WithMuon/hMotherMassVsPt"))->Fill(mother.M(), mother.Pt()); } - // Hunting down psi2s: broad acceptance - if (doFourTrackPsi2S) { - if (countPVGTpions == 4 || - (countPVGTpions == 3 && countPVGTmuons == 1) || - (countPVGTpions == 2 && countPVGTmuons == 2) || - (countPVGTpions == 1 && countPVGTmuons == 3) || - countPVGTmuons == 4) { - histos.get(HIST("EventFourTracks/MuonsPions/hInvariantMass"))->Fill(mother.M()); - histos.get(HIST("EventFourTracks/MuonsPions/hInvariantMassWide"))->Fill(mother.M()); - histos.get(HIST("EventFourTracks/MuonsPions/hMotherP"))->Fill(mother.P()); - histos.get(HIST("EventFourTracks/MuonsPions/hMotherPwide"))->Fill(mother.P()); - histos.get(HIST("EventFourTracks/MuonsPions/hMotherPt"))->Fill(mother.Pt()); - histos.get(HIST("EventFourTracks/MuonsPions/hMotherPhi"))->Fill(mother.Phi()); - histos.get(HIST("EventFourTracks/MuonsPions/hMotherRapidity"))->Fill(mother.Rapidity()); - histos.get(HIST("EventFourTracks/MuonsPions/hMotherMassVsPt"))->Fill(mother.M(), mother.Pt()); - } - // Hunting down psi2s: ideal case - if (whatPsi2Schannel(trkDaug1, trkDaug2, trkDaug3, trkDaug4, vecPIDidx) == 1) { - histos.get(HIST("EventFourTracks/Psi2StoMuMuPiPi/hInvariantMass"))->Fill(mother.M()); - histos.get(HIST("EventFourTracks/Psi2StoMuMuPiPi/hInvariantMassWide"))->Fill(mother.M()); - histos.get(HIST("EventFourTracks/Psi2StoMuMuPiPi/hMotherP"))->Fill(mother.P()); - histos.get(HIST("EventFourTracks/Psi2StoMuMuPiPi/hMotherPwide"))->Fill(mother.P()); - histos.get(HIST("EventFourTracks/Psi2StoMuMuPiPi/hMotherPt"))->Fill(mother.Pt()); - histos.get(HIST("EventFourTracks/Psi2StoMuMuPiPi/hMotherPhi"))->Fill(mother.Phi()); - histos.get(HIST("EventFourTracks/Psi2StoMuMuPiPi/hMotherRapidity"))->Fill(mother.Rapidity()); - histos.get(HIST("EventFourTracks/Psi2StoMuMuPiPi/hMotherMassVsPt"))->Fill(mother.M(), mother.Pt()); - } - if (whatPsi2Schannel(trkDaug1, trkDaug2, trkDaug3, trkDaug4, vecPIDidx) == 2) { - histos.get(HIST("EventFourTracks/Psi2StoElElPiPi/hInvariantMass"))->Fill(mother.M()); - histos.get(HIST("EventFourTracks/Psi2StoElElPiPi/hInvariantMassWide"))->Fill(mother.M()); - histos.get(HIST("EventFourTracks/Psi2StoElElPiPi/hMotherP"))->Fill(mother.P()); - histos.get(HIST("EventFourTracks/Psi2StoElElPiPi/hMotherPwide"))->Fill(mother.P()); - histos.get(HIST("EventFourTracks/Psi2StoElElPiPi/hMotherPt"))->Fill(mother.Pt()); - histos.get(HIST("EventFourTracks/Psi2StoElElPiPi/hMotherPhi"))->Fill(mother.Phi()); - histos.get(HIST("EventFourTracks/Psi2StoElElPiPi/hMotherRapidity"))->Fill(mother.Rapidity()); - histos.get(HIST("EventFourTracks/Psi2StoElElPiPi/hMotherMassVsPt"))->Fill(mother.M(), mother.Pt()); - } - } } else if (countPVGTselected == 6 && doSixTracks) { TLorentzVector mother, daug[6]; const auto& trkDaug1 = reconstructedBarrelTracks.iteratorAt(vecPVidx[0]); @@ -1992,12 +1371,12 @@ struct UpcTauCentralBarrelRL { const auto& trkDaug4 = reconstructedBarrelTracks.iteratorAt(vecPVidx[3]); const auto& trkDaug5 = reconstructedBarrelTracks.iteratorAt(vecPVidx[4]); const auto& trkDaug6 = reconstructedBarrelTracks.iteratorAt(vecPVidx[5]); - daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); - daug[2].SetPxPyPzE(trkDaug3.px(), trkDaug3.py(), trkDaug3.pz(), energy(pdg->Mass(trackPDG(trkDaug3)), trkDaug3.px(), trkDaug3.py(), trkDaug3.pz())); - daug[3].SetPxPyPzE(trkDaug4.px(), trkDaug4.py(), trkDaug4.pz(), energy(pdg->Mass(trackPDG(trkDaug4)), trkDaug4.px(), trkDaug4.py(), trkDaug4.pz())); - daug[4].SetPxPyPzE(trkDaug5.px(), trkDaug5.py(), trkDaug5.pz(), energy(pdg->Mass(trackPDG(trkDaug5)), trkDaug5.px(), trkDaug5.py(), trkDaug5.pz())); - daug[5].SetPxPyPzE(trkDaug6.px(), trkDaug6.py(), trkDaug6.pz(), energy(pdg->Mass(trackPDG(trkDaug6)), trkDaug6.px(), trkDaug6.py(), trkDaug6.pz())); + daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + daug[2].SetPxPyPzE(trkDaug3.px(), trkDaug3.py(), trkDaug3.pz(), energy(pdg->Mass(trackPDG(trkDaug3, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug3.px(), trkDaug3.py(), trkDaug3.pz())); + daug[3].SetPxPyPzE(trkDaug4.px(), trkDaug4.py(), trkDaug4.pz(), energy(pdg->Mass(trackPDG(trkDaug4, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug4.px(), trkDaug4.py(), trkDaug4.pz())); + daug[4].SetPxPyPzE(trkDaug5.px(), trkDaug5.py(), trkDaug5.pz(), energy(pdg->Mass(trackPDG(trkDaug5, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug5.px(), trkDaug5.py(), trkDaug5.pz())); + daug[5].SetPxPyPzE(trkDaug6.px(), trkDaug6.py(), trkDaug6.pz(), energy(pdg->Mass(trackPDG(trkDaug6, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug6.px(), trkDaug6.py(), trkDaug6.pz())); mother = daug[0] + daug[1] + daug[2] + daug[3] + daug[4] + daug[5]; histos.get(HIST("EventSixTracks/hInvariantMass"))->Fill(mother.M()); @@ -2011,7 +1390,7 @@ struct UpcTauCentralBarrelRL { // ee, mm, em, pp, ep, mp, pppp, eppp, mppp, pppppp if (countPVGTpions == 6) { - histos.get(HIST("Events/hChannelsRatio"))->Fill(9); + histos.get(HIST("Events/hChannels"))->Fill(CH_SIXPI); histos.get(HIST("EventSixTracks/SixPions/hInvariantMass"))->Fill(mother.M()); histos.get(HIST("EventSixTracks/SixPions/hInvariantMassWide"))->Fill(mother.M()); histos.get(HIST("EventSixTracks/SixPions/hMotherP"))->Fill(mother.P()); @@ -2028,17 +1407,11 @@ struct UpcTauCentralBarrelRL { } // end fillHistograms template - void fillPIDhistograms(C /*reconstructedCollision*/, Ts reconstructedBarrelTracks) + void fillPIDhistograms(C const& /*reconstructedCollision*/, Ts const& reconstructedBarrelTracks) { - if (isFirstReconstructedCollisions) { - isFirstReconstructedCollisions = false; - if (verboseInfo) - printLargeMessage("START LOOPING OVER RECONSTRUCTED COLLISIONS"); - } - // Loop over tracks without selections - for (auto& track : reconstructedBarrelTracks) { + for (const auto& track : reconstructedBarrelTracks) { float trkPx = track.px(); float trkPy = track.py(); float trkPz = track.pz(); @@ -2048,6 +1421,11 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("Tracks/raw/PID/hTPCsignalVsPt"))->Fill(track.pt(), track.tpcSignal()); histos.get(HIST("Tracks/raw/PID/hTPCsignalVsEta"))->Fill(eta(trkPx, trkPy, trkPz), track.tpcSignal()); histos.get(HIST("Tracks/raw/PID/hTPCsignalVsPhi"))->Fill(phi(trkPx, trkPy), track.tpcSignal()); + histos.get(HIST("Tracks/raw/PID/hTPCnSigmaElVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tpcNSigmaEl()); + histos.get(HIST("Tracks/raw/PID/hTPCnSigmaMuVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tpcNSigmaMu()); + histos.get(HIST("Tracks/raw/PID/hTPCnSigmaPiVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tpcNSigmaPi()); + histos.get(HIST("Tracks/raw/PID/hTPCnSigmaKaVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tpcNSigmaKa()); + histos.get(HIST("Tracks/raw/PID/hTPCnSigmaPrVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tpcNSigmaPr()); if (track.hasTOF()) histos.get(HIST("Tracks/raw/PID/hTOFsignalVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tofSignal()); if (track.sign() == 1) { @@ -2072,20 +1450,22 @@ struct UpcTauCentralBarrelRL { } } // Loop over tracks without selections + int countPVGT = 0; int countPVGTselected = 0; int countPVGTelectrons = 0; int countPVGTmuons = 0; int countPVGTpions = 0; - int countPVGTmuonsSelection = 0; std::vector vecPVidx; + std::vector vecPVnoPIDidx; // Loop over tracks with selections - for (auto& track : reconstructedBarrelTracks) { - if (track.isPVContributor() != 1) + for (const auto& track : reconstructedBarrelTracks) { + if (!track.isPVContributor()) + continue; + if (cutGlobalTrack.applyGlobalTrackSelection && !isGlobalTrackReinstatement(track)) { continue; - if (cutMyGlobalTracksOnly) { - if (isGlobalTrackReinstatement(track) != 1) - continue; } + countPVGT++; + vecPVnoPIDidx.push_back(track.index()); float trkPx = track.px(); float trkPy = track.py(); float trkPz = track.pz(); @@ -2095,6 +1475,11 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("Tracks/GoodTrack/PID/hTPCsignalVsPt"))->Fill(track.pt(), track.tpcSignal()); histos.get(HIST("Tracks/GoodTrack/PID/hTPCsignalVsEta"))->Fill(eta(trkPx, trkPy, trkPz), track.tpcSignal()); histos.get(HIST("Tracks/GoodTrack/PID/hTPCsignalVsPhi"))->Fill(phi(trkPx, trkPy), track.tpcSignal()); + histos.get(HIST("Tracks/GoodTrack/PID/hTPCnSigmaElVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tpcNSigmaEl()); + histos.get(HIST("Tracks/GoodTrack/PID/hTPCnSigmaMuVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tpcNSigmaMu()); + histos.get(HIST("Tracks/GoodTrack/PID/hTPCnSigmaPiVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tpcNSigmaPi()); + histos.get(HIST("Tracks/GoodTrack/PID/hTPCnSigmaKaVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tpcNSigmaKa()); + histos.get(HIST("Tracks/GoodTrack/PID/hTPCnSigmaPrVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tpcNSigmaPr()); if (track.hasTOF()) histos.get(HIST("Tracks/GoodTrack/PID/hTOFsignalVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tofSignal()); if (track.sign() == 1) { @@ -2117,7 +1502,7 @@ struct UpcTauCentralBarrelRL { printMediumMessage("Track has no charge"); } } - int hypothesisID = testPIDhypothesis(track, cutMyNsigmaTPCPIDselector, cutMyNsigmaTOFPIDselector, usePIDwithTOF, usePIDwithTOFsigmaAfterTPC); + int hypothesisID = testPIDhypothesis(track, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC); if (hypothesisID == P_ELECTRON || hypothesisID == P_MUON || hypothesisID == P_PION) { countPVGTselected++; vecPVidx.push_back(track.index()); @@ -2192,24 +1577,58 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("Tracks/GoodTrack/PID/Others/hTOFsignalVsP"))->Fill(momentum(trkPx, trkPy, trkPz), track.tofSignal()); } } - if (abs(track.tpcNSigmaMu()) < cutMyTPCnSigmaMu) - countPVGTmuonsSelection++; } // Loop over tracks with selections + if (countPVGT == 2 && doTwoTracks) { + TLorentzVector daug[2], pion[2], muon[2]; + const auto& trkDaug1 = reconstructedBarrelTracks.iteratorAt(vecPVnoPIDidx[0]); + const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(vecPVnoPIDidx[1]); + daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + if (cutTauEvent.applyTauEventSelection && !selectedTauEvent(trkDaug1, trkDaug2)) { + return; + } + + if (trkDaug1.hasTPC()) { + histos.get(HIST("EventTwoTracks/PID/NoPID/hTPCsignalVsP"))->Fill(daug[0].P(), trkDaug1.tpcSignal()); + histos.get(HIST("EventTwoTracks/PID/NoPID/hTPCnSigmaElVsP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaEl()); + histos.get(HIST("EventTwoTracks/PID/NoPID/hTPCnSigmaMuVsP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaMu()); + histos.get(HIST("EventTwoTracks/PID/NoPID/hTPCnSigmaPiVsP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaPi()); + histos.get(HIST("EventTwoTracks/PID/NoPID/hTPCnSigmaKaVsP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaKa()); + histos.get(HIST("EventTwoTracks/PID/NoPID/hTPCnSigmaPrVsP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaPr()); + } + if (trkDaug2.hasTPC()) { + histos.get(HIST("EventTwoTracks/PID/NoPID/hTPCsignalVsP"))->Fill(daug[1].P(), trkDaug2.tpcSignal()); + histos.get(HIST("EventTwoTracks/PID/NoPID/hTPCnSigmaElVsP"))->Fill(daug[1].P(), trkDaug2.tpcNSigmaEl()); + histos.get(HIST("EventTwoTracks/PID/NoPID/hTPCnSigmaMuVsP"))->Fill(daug[1].P(), trkDaug2.tpcNSigmaMu()); + histos.get(HIST("EventTwoTracks/PID/NoPID/hTPCnSigmaPiVsP"))->Fill(daug[1].P(), trkDaug2.tpcNSigmaPi()); + histos.get(HIST("EventTwoTracks/PID/NoPID/hTPCnSigmaKaVsP"))->Fill(daug[1].P(), trkDaug2.tpcNSigmaKa()); + histos.get(HIST("EventTwoTracks/PID/NoPID/hTPCnSigmaPrVsP"))->Fill(daug[1].P(), trkDaug2.tpcNSigmaPr()); + } + } + if (countPVGTselected == 2 && doTwoTracks) { TLorentzVector daug[2], pion[2], muon[2]; const auto& trkDaug1 = reconstructedBarrelTracks.iteratorAt(vecPVidx[0]); const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(vecPVidx[1]); - daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(211), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(211), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(13), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(13), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + if (cutTauEvent.applyTauEventSelection && !selectedTauEvent(trkDaug1, trkDaug2)) { + return; + } if (trkDaug1.hasTPC()) { histos.get(HIST("EventTwoTracks/PID/hTPCsignalVsP"))->Fill(daug[0].P(), trkDaug1.tpcSignal()); + histos.get(HIST("EventTwoTracks/PID/hTPCnSigmaElVsP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaEl()); + histos.get(HIST("EventTwoTracks/PID/hTPCnSigmaMuVsP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaMu()); + histos.get(HIST("EventTwoTracks/PID/hTPCnSigmaPiVsP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaPi()); + histos.get(HIST("EventTwoTracks/PID/hTPCnSigmaKaVsP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaKa()); + histos.get(HIST("EventTwoTracks/PID/hTPCnSigmaPrVsP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaPr()); if (trkDaug1.hasTOF()) { histos.get(HIST("EventTwoTracks/PID/hTOFsignalVsP"))->Fill(daug[0].P(), trkDaug1.tofSignal()); } @@ -2221,14 +1640,6 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsP"))->Fill(daug[0].P(), trkDaug1.tofNSigmaEl()); } } - if (countPVGTmuonsSelection == 2 && doMuonStudy) { - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsP"))->Fill(daug[0].P(), trkDaug1.tpcSignal()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTPCnSigmaVsP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaEl()); - if (trkDaug1.hasTOF()) { - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTOFsignalVsP"))->Fill(daug[0].P(), trkDaug1.tofSignal()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTOFnSigmaVsP"))->Fill(daug[0].P(), trkDaug1.tofNSigmaEl()); - } - } if (countPVGTmuons == 2) histos.get(HIST("EventTwoTracks/TwoMuons/PID/hTPCsignalVsP"))->Fill(daug[0].P(), trkDaug1.tpcSignal()); if (countPVGTpions == 2) @@ -2258,6 +1669,11 @@ struct UpcTauCentralBarrelRL { } if (trkDaug2.hasTPC()) { histos.get(HIST("EventTwoTracks/PID/hTPCsignalVsP"))->Fill(daug[1].P(), trkDaug2.tpcSignal()); + histos.get(HIST("EventTwoTracks/PID/hTPCnSigmaElVsP"))->Fill(daug[1].P(), trkDaug1.tpcNSigmaEl()); + histos.get(HIST("EventTwoTracks/PID/hTPCnSigmaMuVsP"))->Fill(daug[1].P(), trkDaug1.tpcNSigmaMu()); + histos.get(HIST("EventTwoTracks/PID/hTPCnSigmaPiVsP"))->Fill(daug[1].P(), trkDaug1.tpcNSigmaPi()); + histos.get(HIST("EventTwoTracks/PID/hTPCnSigmaKaVsP"))->Fill(daug[1].P(), trkDaug1.tpcNSigmaKa()); + histos.get(HIST("EventTwoTracks/PID/hTPCnSigmaPrVsP"))->Fill(daug[1].P(), trkDaug1.tpcNSigmaPr()); if (trkDaug2.hasTOF()) { histos.get(HIST("EventTwoTracks/PID/hTOFsignalVsP"))->Fill(daug[1].P(), trkDaug2.tofSignal()); } @@ -2269,14 +1685,6 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsP"))->Fill(daug[1].P(), trkDaug2.tofNSigmaEl()); } } - if (countPVGTmuonsSelection == 2 && doMuonStudy) { - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsP"))->Fill(daug[1].P(), trkDaug2.tpcSignal()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTPCnSigmaVsP"))->Fill(daug[1].P(), trkDaug2.tpcNSigmaEl()); - if (trkDaug1.hasTOF()) { - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTOFsignalVsP"))->Fill(daug[1].P(), trkDaug2.tofSignal()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTOFnSigmaVsP"))->Fill(daug[1].P(), trkDaug2.tofNSigmaEl()); - } - } if (countPVGTmuons == 2) histos.get(HIST("EventTwoTracks/TwoMuons/PID/hTPCsignalVsP"))->Fill(daug[1].P(), trkDaug2.tpcSignal()); if (countPVGTpions == 2) @@ -2334,77 +1742,52 @@ struct UpcTauCentralBarrelRL { } } } - if (countPVGTmuonsSelection == 2 && doMuonStudy) { - if (daug[0].P() > daug[1].P()) { - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsLP"))->Fill(daug[0].P(), trkDaug1.tpcSignal()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsOP"))->Fill(daug[1].P(), trkDaug2.tpcSignal()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTPCnSigmaVsLP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaEl()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTPCnSigmaVsOP"))->Fill(daug[1].P(), trkDaug2.tpcNSigmaEl()); - if (trkDaug1.hasTOF()) { - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTOFsignalVsLP"))->Fill(daug[0].P(), trkDaug1.tofSignal()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTOFnSigmaVsLP"))->Fill(daug[0].P(), trkDaug1.tofNSigmaEl()); - } - if (trkDaug2.hasTOF()) { - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTOFsignalVsOP"))->Fill(daug[1].P(), trkDaug2.tofSignal()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTOFnSigmaVsOP"))->Fill(daug[1].P(), trkDaug2.tofNSigmaEl()); - } - } else { - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsOP"))->Fill(daug[0].P(), trkDaug1.tpcSignal()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTPCsignalVsLP"))->Fill(daug[1].P(), trkDaug2.tpcSignal()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTPCnSigmaVsOP"))->Fill(daug[0].P(), trkDaug1.tpcNSigmaEl()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTPCnSigmaVsLP"))->Fill(daug[1].P(), trkDaug2.tpcNSigmaEl()); - if (trkDaug1.hasTOF()) { - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTOFsignalVsOP"))->Fill(daug[0].P(), trkDaug1.tofSignal()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTOFnSigmaVsOP"))->Fill(daug[0].P(), trkDaug1.tofNSigmaEl()); - } - if (trkDaug2.hasTOF()) { - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTOFsignalVsLP"))->Fill(daug[1].P(), trkDaug2.tofSignal()); - histos.get(HIST("EventTwoTracks/MuonsSelection/PID/hTOFnSigmaVsLP"))->Fill(daug[1].P(), trkDaug2.tofNSigmaEl()); - } - } - } - if ((countPVGTelectrons == 1 && countPVGTmuons == 1) || (countPVGTelectrons == 1 && countPVGTpions == 1)) { - double electronPt = (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); - double electronPID = (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); - double electronNsigma = (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); - double otherPt = (enumMyParticle(trackPDG(trkDaug2)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); - double otherPID = (enumMyParticle(trackPDG(trkDaug2)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); - double otherNsigmaMu = (enumMyParticle(trackPDG(trkDaug2)) == P_ELECTRON) ? trkDaug1.tpcNSigmaMu() : trkDaug2.tpcNSigmaMu(); - double otherNsigmaPi = (enumMyParticle(trackPDG(trkDaug2)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsEP"))->Fill(electronPt, electronPID); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsOP"))->Fill(otherPt, otherPID); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEP"))->Fill(electronPt, electronNsigma); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsMP"))->Fill(otherPt, otherNsigmaMu); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPP"))->Fill(otherPt, otherNsigmaPi); + if (!isMC && ((countPVGTelectrons == 1 && countPVGTmuons == 1) || (countPVGTelectrons == 1 && countPVGTpions == 1))) { + double electronPt = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); + double electronPID = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); + double electronNsigma = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); + double electronPiNsigma = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); + double otherPt = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); + double otherPID = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); + double otherNsigmaMu = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaMu() : trkDaug2.tpcNSigmaMu(); + double otherNsigmaPi = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsEPofE"))->Fill(electronPt, electronPID); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsOPofO"))->Fill(otherPt, otherPID); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofE"))->Fill(electronPt, electronNsigma); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsMPofO"))->Fill(otherPt, otherNsigmaMu); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPPofO"))->Fill(otherPt, otherNsigmaPi); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofE"))->Fill(electronNsigma, electronPiNsigma); if (trkDaug1.hasTOF()) { - if (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) { - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsEP"))->Fill(electronPt, trkDaug1.tofSignal()); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEP"))->Fill(electronPt, trkDaug1.tofNSigmaEl()); + if (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) { + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsEPofE"))->Fill(electronPt, trkDaug1.tofSignal()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEPofE"))->Fill(electronPt, trkDaug1.tofNSigmaEl()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaEvsnSigmaPofE"))->Fill(trkDaug1.tofNSigmaEl(), trkDaug1.tofNSigmaPi()); } else { - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsOP"))->Fill(otherPt, trkDaug1.tofSignal()); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsMP"))->Fill(otherPt, trkDaug1.tofNSigmaMu()); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPP"))->Fill(otherPt, trkDaug1.tofNSigmaPi()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsOPofO"))->Fill(otherPt, trkDaug1.tofSignal()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsMPofO"))->Fill(otherPt, trkDaug1.tofNSigmaMu()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPPofO"))->Fill(otherPt, trkDaug1.tofNSigmaPi()); } } if (trkDaug2.hasTOF()) { - if (enumMyParticle(trackPDG(trkDaug2)) == P_ELECTRON) { - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsEP"))->Fill(electronPt, trkDaug2.tofSignal()); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEP"))->Fill(electronPt, trkDaug2.tofNSigmaEl()); + if (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) { + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsEPofE"))->Fill(electronPt, trkDaug2.tofSignal()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEPofE"))->Fill(electronPt, trkDaug2.tofNSigmaEl()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaEvsnSigmaPofE"))->Fill(trkDaug2.tofNSigmaEl(), trkDaug2.tofNSigmaPi()); } else { - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsOP"))->Fill(otherPt, trkDaug2.tofSignal()); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsMP"))->Fill(otherPt, trkDaug2.tofNSigmaMu()); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPP"))->Fill(otherPt, trkDaug2.tofNSigmaPi()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsOPofO"))->Fill(otherPt, trkDaug2.tofSignal()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsMPofO"))->Fill(otherPt, trkDaug2.tofNSigmaMu()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPPofO"))->Fill(otherPt, trkDaug2.tofNSigmaPi()); } } } if ((countPVGTelectrons == 2) || (countPVGTelectrons == 1 && countPVGTmuons == 1) || (countPVGTelectrons == 1 && countPVGTpions == 1)) { - double electronPt = (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); - double electronPID = (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); - double electronNsigma = (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); - double otherPt = (enumMyParticle(trackPDG(trkDaug2)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); - double otherPID = (enumMyParticle(trackPDG(trkDaug2)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); - double otherNsigmaMu = (enumMyParticle(trackPDG(trkDaug2)) == P_ELECTRON) ? trkDaug1.tpcNSigmaMu() : trkDaug2.tpcNSigmaMu(); - double otherNsigmaPi = (enumMyParticle(trackPDG(trkDaug2)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); + double electronPt = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); + double electronPID = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); + double electronNsigma = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); + double otherPt = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); + double otherPID = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); + double otherNsigmaMu = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaMu() : trkDaug2.tpcNSigmaMu(); + double otherNsigmaPi = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); if (countPVGTelectrons == 2) { electronPt = (daug[0].Pt() > daug[1].Pt()) ? daug[0].Pt() : daug[1].Pt(); electronPID = (daug[0].Pt() > daug[1].Pt()) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); @@ -2420,7 +1803,7 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsMP"))->Fill(otherPt, otherNsigmaMu); histos.get(HIST("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsPP"))->Fill(otherPt, otherNsigmaPi); if (trkDaug1.hasTOF()) { - if (enumMyParticle(trackPDG(trkDaug1)) == P_ELECTRON) { + if (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) { histos.get(HIST("EventTwoTracks/ElectronOther/PID/hTOFsignalVsEP"))->Fill(electronPt, trkDaug1.tofSignal()); histos.get(HIST("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsEP"))->Fill(electronPt, trkDaug1.tofNSigmaEl()); } else { @@ -2430,7 +1813,7 @@ struct UpcTauCentralBarrelRL { } } if (trkDaug2.hasTOF()) { - if (enumMyParticle(trackPDG(trkDaug2)) == P_ELECTRON) { + if (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) { histos.get(HIST("EventTwoTracks/ElectronOther/PID/hTOFsignalVsEP"))->Fill(electronPt, trkDaug2.tofSignal()); histos.get(HIST("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsEP"))->Fill(electronPt, trkDaug2.tofNSigmaEl()); } else { @@ -2448,10 +1831,10 @@ struct UpcTauCentralBarrelRL { const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(vecPVidx[1]); const auto& trkDaug3 = reconstructedBarrelTracks.iteratorAt(vecPVidx[2]); const auto& trkDaug4 = reconstructedBarrelTracks.iteratorAt(vecPVidx[3]); - daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); - daug[2].SetPxPyPzE(trkDaug3.px(), trkDaug3.py(), trkDaug3.pz(), energy(pdg->Mass(trackPDG(trkDaug3)), trkDaug3.px(), trkDaug3.py(), trkDaug3.pz())); - daug[3].SetPxPyPzE(trkDaug4.px(), trkDaug4.py(), trkDaug4.pz(), energy(pdg->Mass(trackPDG(trkDaug4)), trkDaug4.px(), trkDaug4.py(), trkDaug4.pz())); + daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + daug[2].SetPxPyPzE(trkDaug3.px(), trkDaug3.py(), trkDaug3.pz(), energy(pdg->Mass(trackPDG(trkDaug3, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug3.px(), trkDaug3.py(), trkDaug3.pz())); + daug[3].SetPxPyPzE(trkDaug4.px(), trkDaug4.py(), trkDaug4.pz(), energy(pdg->Mass(trackPDG(trkDaug4, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug4.px(), trkDaug4.py(), trkDaug4.pz())); if (trkDaug1.hasTPC()) { histos.get(HIST("EventFourTracks/PID/hTPCsignalVsP"))->Fill(daug[0].P(), trkDaug1.tpcSignal()); @@ -2497,12 +1880,12 @@ struct UpcTauCentralBarrelRL { const auto& trkDaug4 = reconstructedBarrelTracks.iteratorAt(vecPVidx[3]); const auto& trkDaug5 = reconstructedBarrelTracks.iteratorAt(vecPVidx[4]); const auto& trkDaug6 = reconstructedBarrelTracks.iteratorAt(vecPVidx[5]); - daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); - daug[2].SetPxPyPzE(trkDaug3.px(), trkDaug3.py(), trkDaug3.pz(), energy(pdg->Mass(trackPDG(trkDaug3)), trkDaug3.px(), trkDaug3.py(), trkDaug3.pz())); - daug[3].SetPxPyPzE(trkDaug4.px(), trkDaug4.py(), trkDaug4.pz(), energy(pdg->Mass(trackPDG(trkDaug4)), trkDaug4.px(), trkDaug4.py(), trkDaug4.pz())); - daug[4].SetPxPyPzE(trkDaug5.px(), trkDaug5.py(), trkDaug5.pz(), energy(pdg->Mass(trackPDG(trkDaug5)), trkDaug5.px(), trkDaug5.py(), trkDaug5.pz())); - daug[5].SetPxPyPzE(trkDaug6.px(), trkDaug6.py(), trkDaug6.pz(), energy(pdg->Mass(trackPDG(trkDaug6)), trkDaug6.px(), trkDaug6.py(), trkDaug6.pz())); + daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + daug[2].SetPxPyPzE(trkDaug3.px(), trkDaug3.py(), trkDaug3.pz(), energy(pdg->Mass(trackPDG(trkDaug3, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug3.px(), trkDaug3.py(), trkDaug3.pz())); + daug[3].SetPxPyPzE(trkDaug4.px(), trkDaug4.py(), trkDaug4.pz(), energy(pdg->Mass(trackPDG(trkDaug4, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug4.px(), trkDaug4.py(), trkDaug4.pz())); + daug[4].SetPxPyPzE(trkDaug5.px(), trkDaug5.py(), trkDaug5.pz(), energy(pdg->Mass(trackPDG(trkDaug5, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug5.px(), trkDaug5.py(), trkDaug5.pz())); + daug[5].SetPxPyPzE(trkDaug6.px(), trkDaug6.py(), trkDaug6.pz(), energy(pdg->Mass(trackPDG(trkDaug6, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug6.px(), trkDaug6.py(), trkDaug6.pz())); if (trkDaug1.hasTPC()) { histos.get(HIST("EventSixTracks/PID/hTPCsignalVsP"))->Fill(daug[0].P(), trkDaug1.tpcSignal()); @@ -2540,53 +1923,369 @@ struct UpcTauCentralBarrelRL { } // end fillPIDhistograms - void processDGrecoLevel(FullUDCollision const& reconstructedCollision, - FullUDTracks const& reconstructedBarrelTracks) + void fillMCPIDhistograms(FullMCUDTracks const& reconstructedBarrelTracks) { - countCollisions++; - if (doMainHistos) - fillHistograms(reconstructedCollision, reconstructedBarrelTracks); + int countPVGTselected = 0; + int countPVGTelectrons = 0; + int countPVGTmuons = 0; + int countPVGTpions = 0; + std::vector vecPVidx; + // Loop over tracks with selections + for (const auto& track : reconstructedBarrelTracks) { + if (!track.isPVContributor()) + continue; + if (cutGlobalTrack.applyGlobalTrackSelection) { + if (isGlobalTrackReinstatement(track) != 1) + continue; + } + int hypothesisID = testPIDhypothesis(track, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC); + if (hypothesisID == P_ELECTRON || hypothesisID == P_MUON || hypothesisID == P_PION) { + countPVGTselected++; + vecPVidx.push_back(track.index()); + if (hypothesisID == P_ELECTRON) { + countPVGTelectrons++; + } else if (hypothesisID == P_MUON) { + countPVGTmuons++; + } else { + countPVGTpions++; + } + } + + } // Loop over tracks with selections + + if (countPVGTselected == 2 && doTwoTracks) { + TLorentzVector daug[2]; + const auto& trkDaug1 = reconstructedBarrelTracks.iteratorAt(vecPVidx[0]); + const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(vecPVidx[1]); + daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + if (cutTauEvent.applyTauEventSelection && !selectedTauEvent(trkDaug1, trkDaug2)) { + return; + } + if (trkDaug1.hasTPC() && trkDaug2.hasTPC()) { + if (isMC && ((countPVGTelectrons == 1 && countPVGTmuons == 1) || (countPVGTelectrons == 1 && countPVGTpions == 1))) { + int pid = 0; + if (trkDaug1.has_udMcParticle()) { + const auto& part = trkDaug1.udMcParticle(); + pid = std::abs(part.pdgCode()); + if (pid == 11) { + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/mcTruth/nSigmaTPC1"))->Fill(trkDaug1.pt(), trkDaug1.tpcNSigmaEl(), 1.); + } else { + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/mcTruth/nSigmaTPC2"))->Fill(trkDaug1.pt(), trkDaug1.tpcNSigmaEl(), 1.); + } + } + if (trkDaug2.has_udMcParticle()) { + const auto& part = trkDaug2.udMcParticle(); + pid = std::abs(part.pdgCode()); + if (pid == 11) { + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/mcTruth/nSigmaTPC1"))->Fill(trkDaug2.pt(), trkDaug2.tpcNSigmaEl(), 1.); + } else { + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/mcTruth/nSigmaTPC2"))->Fill(trkDaug2.pt(), trkDaug2.tpcNSigmaEl(), 1.); + } + } + bool isNotTrueElectron = false; + if (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) { + if (trkDaug1.has_udMcParticle()) { + const auto& particle = trkDaug1.udMcParticle(); + if (enumMyParticle(particle.pdgCode()) != P_ELECTRON) + isNotTrueElectron = true; + } + } else { + if (trkDaug2.has_udMcParticle()) { + const auto& particle = trkDaug2.udMcParticle(); + if (enumMyParticle(particle.pdgCode()) != P_ELECTRON) + isNotTrueElectron = true; + } + } + if (oppositeMCtrueElectronCheck) { + if (doMCtrueElectronCheck && !isNotTrueElectron) + return; + } else { + if (doMCtrueElectronCheck && isNotTrueElectron) + return; + } + + double electronPt = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); + double electronPID = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); + double electronNsigma = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); + double electronPiNsigma = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); + double otherPt = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); + double otherPID = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); + double otherNsigmaEl = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); + double otherNsigmaMu = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaMu() : trkDaug2.tpcNSigmaMu(); + double otherNsigmaPi = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsEPofE"))->Fill(electronPt, electronPID); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofE"))->Fill(electronPt, electronNsigma); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPPofE"))->Fill(electronPt, electronPiNsigma); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofE"))->Fill(electronNsigma, electronPiNsigma); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsOPofO"))->Fill(otherPt, otherPID); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofO"))->Fill(otherPt, otherNsigmaEl); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsMPofO"))->Fill(otherPt, otherNsigmaMu); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPPofO"))->Fill(otherPt, otherNsigmaPi); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofO"))->Fill(otherNsigmaEl, otherNsigmaPi); + if (trkDaug1.hasTOF()) { + if (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) { + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsEPofE"))->Fill(electronPt, trkDaug1.tofSignal()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEPofE"))->Fill(electronPt, trkDaug1.tofNSigmaEl()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPPofE"))->Fill(electronPt, trkDaug1.tofNSigmaPi()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaEvsnSigmaPofE"))->Fill(trkDaug1.tofNSigmaEl(), trkDaug1.tofNSigmaPi()); + } else { + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsOPofO"))->Fill(otherPt, trkDaug1.tofSignal()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEPofO"))->Fill(otherPt, trkDaug1.tofNSigmaEl()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsMPofO"))->Fill(otherPt, trkDaug1.tofNSigmaMu()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPPofO"))->Fill(otherPt, trkDaug1.tofNSigmaPi()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaEvsnSigmaPofO"))->Fill(trkDaug1.tofNSigmaEl(), trkDaug1.tofNSigmaPi()); + } + } + if (trkDaug2.hasTOF()) { + if (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) { + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsEPofE"))->Fill(electronPt, trkDaug2.tofSignal()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEPofE"))->Fill(electronPt, trkDaug2.tofNSigmaEl()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPPofE"))->Fill(electronPt, trkDaug2.tofNSigmaPi()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaEvsnSigmaPofE"))->Fill(trkDaug2.tofNSigmaEl(), trkDaug2.tofNSigmaPi()); + } else { + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsOPofO"))->Fill(otherPt, trkDaug2.tofSignal()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEPofO"))->Fill(otherPt, trkDaug2.tofNSigmaEl()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsMPofO"))->Fill(otherPt, trkDaug2.tofNSigmaMu()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPPofO"))->Fill(otherPt, trkDaug2.tofNSigmaPi()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaEvsnSigmaPofO"))->Fill(trkDaug2.tofNSigmaEl(), trkDaug2.tofNSigmaPi()); + } + } + } + } + } + + } // end fillMCPIDhistograms + + template + void fillFIThistograms(C const& reconstructedCollision) + { + + histos.get(HIST("Events/FIT/hAmplitudeFT0A"))->Fill(reconstructedCollision.totalFT0AmplitudeA()); + histos.get(HIST("Events/FIT/hAmplitudeFT0C"))->Fill(reconstructedCollision.totalFT0AmplitudeC()); + histos.get(HIST("Events/FIT/hAmplitudeFDDA"))->Fill(reconstructedCollision.totalFDDAmplitudeA()); + histos.get(HIST("Events/FIT/hAmplitudeFDDC"))->Fill(reconstructedCollision.totalFDDAmplitudeC()); + histos.get(HIST("Events/FIT/hAmplitudeFV0A"))->Fill(reconstructedCollision.totalFV0AmplitudeA()); + + histos.get(HIST("Events/FIT/hTimeFT0A"))->Fill(reconstructedCollision.timeFT0A()); + histos.get(HIST("Events/FIT/hTimeFT0C"))->Fill(reconstructedCollision.timeFT0C()); + histos.get(HIST("Events/FIT/hTimeFDDA"))->Fill(reconstructedCollision.timeFDDA()); + histos.get(HIST("Events/FIT/hTimeFDDC"))->Fill(reconstructedCollision.timeFDDC()); + histos.get(HIST("Events/FIT/hTimeFV0A"))->Fill(reconstructedCollision.timeFV0A()); + + histos.get(HIST("Events/FIT/hTimeFT0AvsFT0C"))->Fill(reconstructedCollision.timeFT0A(), reconstructedCollision.timeFT0C()); + histos.get(HIST("Events/FIT/hTimeFT0CvsFDDA"))->Fill(reconstructedCollision.timeFT0C(), reconstructedCollision.timeFDDA()); + histos.get(HIST("Events/FIT/hTimeFDDAvsFDDC"))->Fill(reconstructedCollision.timeFDDA(), reconstructedCollision.timeFDDC()); + histos.get(HIST("Events/FIT/hTimeFDDCvsFV0A"))->Fill(reconstructedCollision.timeFDDC(), reconstructedCollision.timeFV0A()); + histos.get(HIST("Events/FIT/hTimeFV0AvsFT0A"))->Fill(reconstructedCollision.timeFV0A(), reconstructedCollision.timeFT0A()); + } + + void processDataDG(FullUDCollision const& reconstructedCollision, + FullUDTracks const& reconstructedBarrelTracks) + { + + if (!isGoodFITtime(reconstructedCollision, cutSample.cutFITtime)) + return; + + if (doMainHistos) { + fillHistograms(reconstructedBarrelTracks); + fillFIThistograms(reconstructedCollision); + } if (doPIDhistos) fillPIDhistograms(reconstructedCollision, reconstructedBarrelTracks); - } // end processDGrecoLevel + } // end processDataDG - void processSGrecoLevel(FullSGUDCollision const& reconstructedCollision, - FullUDTracks const& reconstructedBarrelTracks) + void processDataSG(FullSGUDCollision const& reconstructedCollision, + FullUDTracks const& reconstructedBarrelTracks) { - countCollisions++; int gapSide = reconstructedCollision.gapSide(); - int trueGapSide = sgSelector.trueGap(reconstructedCollision, cutMyGapSideFV0, cutMyGapSideFT0A, cutMyGapSideFT0C, cutMyGapSideZDC); + int trueGapSide = sgSelector.trueGap(reconstructedCollision, cutSample.cutTrueGapSideFV0, cutSample.cutTrueGapSideFT0A, cutSample.cutTrueGapSideFT0C, cutSample.cutTrueGapSideZDC); histos.fill(HIST("Events/UDtableGapSide"), gapSide); histos.fill(HIST("Events/TrueGapSideDiffToTableValue"), gapSide - trueGapSide); - if (useTrueGap) + if (cutSample.useTrueGap) gapSide = trueGapSide; - if (gapSide != whichGapSide) + if (gapSide != cutSample.whichGapSide) + return; + + if (!isGoodFITtime(reconstructedCollision, cutSample.cutFITtime)) return; - if (doMainHistos) - fillHistograms(reconstructedCollision, reconstructedBarrelTracks); + if (doMainHistos) { + fillHistograms(reconstructedBarrelTracks); + fillFIThistograms(reconstructedCollision); + } if (doPIDhistos) fillPIDhistograms(reconstructedCollision, reconstructedBarrelTracks); - } // end processDGrecoLevel + } // end processDataSG - void processAnalysisFinished(FullUDCollision const&) + void processMCrecDG(FullMCUDCollision const& reconstructedCollision, + FullMCUDTracks const& reconstructedBarrelTracks, + aod::UDMcParticles const&) { + isMC = true; - if (verboseInfo) - printLargeMessage("END OF THIS DATAFRAME"); - printDebugMessage(Form("countCollisions = %d", countCollisions)); - isFirstReconstructedCollisions = true; + if (!isGoodFITtime(reconstructedCollision, cutSample.cutFITtime)) + return; + + if (cutSample.applyAcceptanceSelection) { + for (const auto& track : reconstructedBarrelTracks) { + if (!track.isPVContributor()) + continue; + if (std::abs(eta(track.px(), track.py(), track.py())) > cutSample.cutTrackEta) + return; + } + } + + if (doMainHistos) { + fillHistograms(reconstructedBarrelTracks); + fillFIThistograms(reconstructedCollision); + } + + if (doPIDhistos) { + fillPIDhistograms(reconstructedCollision, reconstructedBarrelTracks); + fillMCPIDhistograms(reconstructedBarrelTracks); + } + + } // end processMCrecDG + + void processMCrecSG(FullMCSGUDCollision const& reconstructedCollision, + FullMCUDTracks const& reconstructedBarrelTracks, + aod::UDMcParticles const&) + { + isMC = true; + + int gapSide = reconstructedCollision.gapSide(); + histos.fill(HIST("Events/UDtableGapSide"), gapSide); + + if (gapSide != cutSample.whichGapSide) + return; + + if (!isGoodFITtime(reconstructedCollision, cutSample.cutFITtime)) + return; + + if (cutSample.applyAcceptanceSelection) { + for (const auto& track : reconstructedBarrelTracks) { + if (!track.isPVContributor()) + continue; + if (std::abs(eta(track.px(), track.py(), track.py())) > cutSample.cutTrackEta) + return; + } + } + + if (doMainHistos) { + fillHistograms(reconstructedBarrelTracks); + fillFIThistograms(reconstructedCollision); + } + + if (doPIDhistos) { + fillPIDhistograms(reconstructedCollision, reconstructedBarrelTracks); + fillMCPIDhistograms(reconstructedBarrelTracks); + } + + } // end processMCrecDG + + void processMCgen(aod::UDMcCollision const& /*generatedCollision*/, + aod::UDMcParticles const& particles) + { + isMC = true; + + if (cutSample.applyAcceptanceSelection) { + for (const auto& particle : particles) { + if (particle.has_mothers()) + continue; + // printLargeMessage(Form("GENE: eta %.3f cut %.2f",std::abs(eta(particle.px(), particle.py(), particle.py())),static_cast(cutTrackEta))); + if (std::abs(eta(particle.px(), particle.py(), particle.py())) > cutSample.cutTrackEta) + return; + } + } + + if (doTruthHistos) { + histos.get(HIST("Events/Truth/hCountCollisions"))->Fill(1); + histos.get(HIST("Events/Truth/hNparticles"))->Fill(particles.size()); + histos.get(HIST("Events/Truth/hNphysPartVsNwoutMotherParts"))->Fill(countPhysicalPrimary(particles), countParticlesWithoutMother(particles)); + + int countElectrons = 0; + int countMuons = 0; + int countPions = 0; + + for (const auto& particle : particles) { + histos.get(HIST("Events/Truth/hPDGcodesAll"))->Fill(particle.pdgCode()); + // if (!particle.isPhysicalPrimary()) continue; + if (particle.has_mothers()) + continue; + histos.get(HIST("Events/Truth/hPDGcodesNoMother"))->Fill(particle.pdgCode()); + const auto& daughters = particle.daughters_as(); + histos.get(HIST("Events/Truth/hNtauDaughters"))->Fill(daughters.size()); + for (const auto& daughter : daughters) { + histos.get(HIST("Events/Truth/hPDGcodesTauDaughters"))->Fill(daughter.pdgCode()); + if (enumMyParticle(daughter.pdgCode()) == P_ELECTRON) + countElectrons++; + if (enumMyParticle(daughter.pdgCode()) == P_MUON) + countMuons++; + if (enumMyParticle(daughter.pdgCode()) == P_PION) + countPions++; + } + } + + histos.get(HIST("Events/Truth/hNelectrons"))->Fill(countElectrons); + histos.get(HIST("Events/Truth/hNmuons"))->Fill(countMuons); + histos.get(HIST("Events/Truth/hNpions"))->Fill(countPions); + + if (countElectrons == 2) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EE); + if (countElectrons == 1 && countMuons == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMU); + if (countElectrons == 1 && countPions == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EPI); + if ((countElectrons == 1 && countMuons == 1) || (countElectrons == 1 && countPions == 1)) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMUPI); + if (countMuons == 2) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUMU); + if (countMuons == 1 && countPions == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUPI); + if (countPions == 2) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_PIPI); + if (countPions == 4) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_FOURPI); + if (countPions == 3 && countElectrons == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_ETHREEPI); + if (countPions == 3 && countMuons == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUTHREEPI); + if (countPions == 6) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_SIXPI); + } + + } // end processMCgenDG + + void processTestMC(FullMCSGUDCollision const& reconstructedCollision, + FullMCUDTracks const& reconstructedBarrelTracks, + aod::UDMcCollisions const&, + aod::UDMcParticles const&) + { + if (reconstructedCollision.has_udMcCollision()) { + const auto& generatedCollision = reconstructedCollision.udMcCollision(); + printDebugMessage(Form("%lli udMcCollision found", generatedCollision.size())); + } + + const auto& track = reconstructedBarrelTracks.iteratorAt(0); + if (track.size() && track.has_udMcParticle()) { + const auto& particle = track.udMcParticle(); + printDebugMessage(Form("%lli udMcParticle found", particle.size())); + } - } // end processAnalysisFinished + } // end processTestMC - PROCESS_SWITCH(UpcTauCentralBarrelRL, processDGrecoLevel, "Iterate UD tables with reconstructed data created by DG-Candidate-Producer", false); - PROCESS_SWITCH(UpcTauCentralBarrelRL, processSGrecoLevel, "Iterate UD tables with reconstructed data created by SG-Candidate-Producer", false); - PROCESS_SWITCH(UpcTauCentralBarrelRL, processAnalysisFinished, "Simply runs in the end of the dataframe", true); + PROCESS_SWITCH(UpcTauCentralBarrelRL, processDataDG, "Iterate UD tables with measured data created by DG-Candidate-Producer.", false); + PROCESS_SWITCH(UpcTauCentralBarrelRL, processDataSG, "Iterate UD tables with measured data created by SG-Candidate-Producer.", false); + PROCESS_SWITCH(UpcTauCentralBarrelRL, processMCrecDG, "Iterate Monte Carlo UD tables with reconstructed data created by DG-Candidate-Producer. Similar to processDataDG but uses association to truth level.", false); + PROCESS_SWITCH(UpcTauCentralBarrelRL, processMCrecSG, "Iterate Monte Carlo UD tables with reconstructed data created by SG-Candidate-Producer. Similar to processDataSG but uses association to truth level and trueGap is not available.", false); + PROCESS_SWITCH(UpcTauCentralBarrelRL, processMCgen, "Iterate Monte Carlo UD tables with truth data.", false); + PROCESS_SWITCH(UpcTauCentralBarrelRL, processTestMC, "Simple test of indices in MC sample.", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From d657992d89fb0d02de16da2aca04ca83302e00d5 Mon Sep 17 00:00:00 2001 From: Fabrizio Chinu <91954233+fchinu@users.noreply.github.com> Date: Thu, 28 Nov 2024 13:15:24 +0100 Subject: [PATCH 153/459] [PWGHF] Add task for correlating multiplicity with generated dN/deta (#8474) Co-authored-by: ALICE Action Bot --- PWGHF/Tasks/CMakeLists.txt | 5 + .../taskMultiplicityEstimatorCorrelation.cxx | 137 ++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx diff --git a/PWGHF/Tasks/CMakeLists.txt b/PWGHF/Tasks/CMakeLists.txt index b27696543ac..888961a70de 100644 --- a/PWGHF/Tasks/CMakeLists.txt +++ b/PWGHF/Tasks/CMakeLists.txt @@ -39,6 +39,11 @@ o2physics_add_dpl_workflow(task-mc-validation PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(task-multiplicity-estimator-correlation + SOURCES taskMultiplicityEstimatorCorrelation.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + # o2physics_add_dpl_workflow(task-sel-optimisation # SOURCES taskSelOptimisation.cxx # PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx b/PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx new file mode 100644 index 00000000000..97e4d9128a9 --- /dev/null +++ b/PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx @@ -0,0 +1,137 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file taskMultiplicityEstimatorCorrelation.cxx +/// \brief Task for correlating the multiplicity estimator with generated dN/deta +/// +/// \author Fabrizio Chinu , Università and INFN Torino + +#include +#include +#include + +#include "TPDGCode.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" +#include "Framework/StaticFor.h" +#include "Common/DataModel/Multiplicity.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct HfTaskMultiplicityEstimatorCorrelation { + HistogramRegistry registry{"registry", {}}; + static constexpr int8_t nEstimators = 8; + static constexpr std::array estimatorsNames = {"FV0A", "FT0A", "FT0C", "FT0M", "FDDA", "FDDC", "FDDM", "NTPV"}; + + std::vector consideredParticles = { + kElectron, + kMuonMinus, + kPiPlus, + kKPlus, + kProton}; + + ConfigurableAxis axisFV0A = {"axisFV0A", {100, 0., 20000.}, "axis for FV0A estimator"}; + ConfigurableAxis axisFT0A = {"axisFT0A", {100, 0., 10000.}, "axis for FT0A estimator"}; + ConfigurableAxis axisFT0C = {"axisFT0C", {100, 0., 5000.}, "axis for FT0C estimator"}; + ConfigurableAxis axisFT0M = {"axisFT0M", {100, 0., 10000.}, "axis for FT0M estimator"}; + ConfigurableAxis axisFDDA = {"axisFDDA", {100, 0., 20000.}, "axis for FDDA estimator"}; + ConfigurableAxis axisFDDC = {"axisFDDC", {100, 0., 5000.}, "axis for FDDC estimator"}; + ConfigurableAxis axisFDDM = {"axisFDDM", {100, 0., 20000.}, "axis for FDDM estimator"}; + ConfigurableAxis axisNTPV = {"axisNTPV", {100, 0., 100.}, "axis for NTPV estimator"}; + ConfigurableAxis axisdNdEta = {"axisdNdEta", {100, 0., 100.}, "axis for dN/deta"}; + + std::vector estimatorsAxes = {&axisFV0A, &axisFT0A, &axisFT0C, &axisFT0M, &axisFDDA, &axisFDDC, &axisFDDM, &axisNTPV}; + + Preslice particlesPerCollision = o2::aod::mcparticle::mcCollisionId; + PresliceUnsorted colPerMcCollision = aod::mccollisionlabel::mcCollisionId; + + using CollisionsWithMult = soa::Join; + + void init(InitContext&) + { + for (int8_t i = 0; i < nEstimators; i++) { + registry.add(("etaPFive/" + std::string(estimatorsNames[i]) + "VsdNdeta").c_str(), (std::string(estimatorsNames[i]) + "VsdNdeta;" + std::string(estimatorsNames[i]) + ";").c_str(), HistType::kTH2F, {*(estimatorsAxes[i]), axisdNdEta}); + registry.add(("etaOne/" + std::string(estimatorsNames[i]) + "VsdNdeta").c_str(), (std::string(estimatorsNames[i]) + "VsdNdeta;" + std::string(estimatorsNames[i]) + ";").c_str(), HistType::kTH2F, {*(estimatorsAxes[i]), axisdNdEta}); + } + } + + void process(CollisionsWithMult const& collisions, + aod::McCollisions const& mcCollisions, + aod::McParticles const& particles, + soa::Join const&) + { + for (auto const& collision : mcCollisions) { + + // Get multiplicity for the reconstructed collision with the highest number of contributors + unsigned maxNumContrib = 0; + CollisionsWithMult::iterator collisionMaxNumContrib; + const auto& recoCollsPerMcColl = collisions.sliceBy(colPerMcCollision, collision.globalIndex()); + for (const auto& recCol : recoCollsPerMcColl) { + if (recCol.numContrib() > maxNumContrib) { + maxNumContrib = recCol.numContrib(); + collisionMaxNumContrib = recCol; + } + } + std::vector multiplicity = { + collisionMaxNumContrib.multZeqFV0A(), + collisionMaxNumContrib.multZeqFT0A(), + collisionMaxNumContrib.multZeqFT0C(), + collisionMaxNumContrib.multZeqFT0A() + collisionMaxNumContrib.multZeqFT0C(), + collisionMaxNumContrib.multZeqFDDA(), + collisionMaxNumContrib.multZeqFDDC(), + collisionMaxNumContrib.multZeqFDDA() + collisionMaxNumContrib.multZeqFDDC(), + collisionMaxNumContrib.multZeqNTracksPV()}; + + // Get the dN/deta for the generated collision + unsigned nChargedInEtaFive = 0; + unsigned nChargedInEtaOne = 0; + const auto& particlesPerMcColl = particles.sliceBy(particlesPerCollision, collision.globalIndex()); + for (auto const& particle : particlesPerMcColl) { + if (particle.isPhysicalPrimary()) { + bool isCharged = false; + for (auto const& consideredParticle : consideredParticles) { + if (std::abs(particle.pdgCode()) == consideredParticle) { + isCharged = true; + break; + } + } + if (!isCharged) { + continue; + } + if (std::abs(particle.eta()) < 0.5) { + nChargedInEtaFive++; + } + if (std::abs(particle.eta()) < 1.0) { + nChargedInEtaOne++; + } + } + } + + float dNdetaFive = nChargedInEtaFive; + float dNdetaOne = nChargedInEtaOne / 2.0; + for (int i = 0; i < nEstimators; i++) { + static_for<0, nEstimators - 1>([&](auto j) { + constexpr int index = j.value; + registry.fill(HIST("etaPFive/") + HIST(estimatorsNames[index]) + HIST("VsdNdeta"), multiplicity[index], dNdetaFive); + registry.fill(HIST("etaOne/") + HIST(estimatorsNames[index]) + HIST("VsdNdeta"), multiplicity[index], dNdetaOne); + }); + } + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From c44c6262b2dfbd119cc41cebcfd9eca7856bfbe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Thu, 28 Nov 2024 13:37:20 +0100 Subject: [PATCH 154/459] [Common] [PID] mute charge (now unused) (#8639) --- Common/DataModel/PIDResponseITS.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/DataModel/PIDResponseITS.h b/Common/DataModel/PIDResponseITS.h index 44c029fcb75..5ee5b386810 100644 --- a/Common/DataModel/PIDResponseITS.h +++ b/Common/DataModel/PIDResponseITS.h @@ -53,7 +53,7 @@ struct ITSResponse { static float expSignal(const float momentum) { static constexpr float inverseMass = 1. / o2::track::pid_constants::sMasses[id]; - static constexpr float charge = static_cast(o2::track::pid_constants::sCharges[id]); + // static constexpr float charge = static_cast(o2::track::pid_constants::sCharges[id]); const float bg = momentum * inverseMass; if (id == o2::track::PID::Helium3 || id == o2::track::PID::Alpha) { return (mITSRespParamsZ2[0] / (std::pow(bg, mITSRespParamsZ2[1])) + mITSRespParamsZ2[2]); @@ -65,7 +65,7 @@ struct ITSResponse { static float expResolution(const float momentum) { static constexpr float inverseMass = 1. / o2::track::pid_constants::sMasses[id]; - static constexpr float charge = static_cast(o2::track::pid_constants::sCharges[id]); + // static constexpr float charge = static_cast(o2::track::pid_constants::sCharges[id]); const float bg = momentum * inverseMass; float relRes = mResolutionParams[0] * std::erf((bg - mResolutionParams[1]) / mResolutionParams[2]); return relRes; From aba9de4611d2a2b1103d93e53d6c048a94b9f89c Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Thu, 28 Nov 2024 13:55:56 +0100 Subject: [PATCH 155/459] [PWGDQ] Update on cumulants (#8712) --- PWGDQ/Core/HistogramsLibrary.cxx | 3 --- PWGDQ/Core/VarManager.cxx | 32 --------------------------- PWGDQ/Core/VarManager.h | 37 ++------------------------------ 3 files changed, 2 insertions(+), 70 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index c23dbc30a2e..a521f27fe33 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -249,9 +249,6 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "Run2_centrFT0C_Corr2REFetagap_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "Run2_centrFT0C_Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2Corr4REF_ev", "Run2_centrFT0C_Corr2Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2CORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); - hm->AddHistogram(histClass, "Corr2REFerrorsetagap", "", 4, std::array{VarManager::kCentFT0C, VarManager::kCORR2REFetagapw, VarManager::kCORR2REFetagapsquaredw, VarManager::kM11REFetagap}.data(), std::array{100, 5000, 5000, 5000}.data(), std::array{0.0, -5000.0, 0.0, 0.0}.data(), std::array{100.0, 5000.0, 100.0, 300000.0}.data(), nullptr, -1, true, true); - hm->AddHistogram(histClass, "Corr2REFerrors", "", 4, std::array{VarManager::kCentFT0C, VarManager::kCORR2REFw, VarManager::kCORR2REFsquaredw, VarManager::kM11REF}.data(), std::array{100, 10000, 10000, 10000}.data(), std::array{0.0, -40000.0, 0.0, 0.0}.data(), std::array{100.0, 40000.0, 100.0, 6000000.0}.data(), nullptr, -1, true, true); - hm->AddHistogram(histClass, "Corr4REFerrors", "", 4, std::array{VarManager::kCentFT0C, VarManager::kCORR4REFw, VarManager::kCORR4REFsquaredw, VarManager::kM1111REF}.data(), std::array{100, 100000, 100000, 100000}.data(), std::array{0.0, -30000000.0, 0.0, 0.0}.data(), std::array{100.0, 90000000.0, 40000.0, 9000000000000.0}.data(), nullptr, -1, true, true); if (subGroupStr.Contains("cross")) { hm->AddHistogram(histClass, "Q1ZNACXX_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACXX); hm->AddHistogram(histClass, "Q1ZNACYY_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACYY); diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index b21293bf42c..bd9055b6cdc 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -763,8 +763,6 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kM01POI] = ""; fgVariableNames[kM1111REF] = "M_{1111}^{REF} "; fgVariableUnits[kM1111REF] = ""; - fgVariableNames[kM1111REFsmall] = "M_{1111}^{REF}small "; - fgVariableUnits[kM1111REFsmall] = ""; fgVariableNames[kM11M1111REF] = "M_{11}_{REF}M_{1111}_{REF} "; fgVariableUnits[kM11M1111REF] = ""; fgVariableNames[kCORR2CORR4REF] = "<2><4>"; @@ -773,36 +771,14 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kM0111POI] = ""; fgVariableNames[kCORR2REF] = "<2> "; fgVariableUnits[kCORR2REF] = ""; - fgVariableNames[kCORR2REFw] = "<2w> "; - fgVariableUnits[kCORR2REFw] = ""; - fgVariableNames[kCORR2REFsquared] = " "; - fgVariableUnits[kCORR2REFsquared] = ""; - fgVariableNames[kCORR2REFsquaredw] = " "; - fgVariableUnits[kCORR2REFsquaredw] = ""; fgVariableNames[kCORR2REFetagap] = "<2-etagap> "; fgVariableUnits[kCORR2REFetagap] = ""; - fgVariableNames[kCORR2REFetagapw] = "<2w-etagap> "; - fgVariableUnits[kCORR2REFetagapw] = ""; - fgVariableNames[kCORR2REFetagapsquaredw] = " "; - fgVariableUnits[kCORR2REFetagapsquaredw] = ""; fgVariableNames[kCORR2POI] = "<2'> "; fgVariableUnits[kCORR2POI] = ""; - fgVariableNames[kCORR2POIw] = "<2'w> "; - fgVariableUnits[kCORR2POIw] = ""; - fgVariableNames[kCORR2POIsquaredw] = " "; - fgVariableUnits[kCORR2POIsquaredw] = ""; fgVariableNames[kCORR4REF] = "<4> "; fgVariableUnits[kCORR4REF] = ""; - fgVariableNames[kCORR4REFw] = "<4w> "; - fgVariableUnits[kCORR4REFw] = ""; - fgVariableNames[kCORR4REFsquaredw] = " "; - fgVariableUnits[kCORR4REFsquaredw] = ""; fgVariableNames[kCORR4POI] = "<4'> "; fgVariableUnits[kCORR4POI] = ""; - fgVariableNames[kCORR4POIw] = "<4'w> "; - fgVariableUnits[kCORR4POIw] = ""; - fgVariableNames[kCORR4POIsquaredw] = " "; - fgVariableUnits[kCORR4POIsquaredw] = ""; fgVariableNames[kM11REFoverMp] = "M_{11}^{REF}/M_{p} "; fgVariableUnits[kM11REFoverMp] = ""; fgVariableNames[kM01POIoverMp] = "M^{'}_{01}^{POI}/M_{p} "; @@ -813,16 +789,8 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kM0111POIoverMp] = ""; fgVariableNames[kCORR2POIMp] = "<2'> M_{p} "; fgVariableUnits[kCORR2POIMp] = ""; - fgVariableNames[kCORR2POIMpw] = "<2'w> M_{p} "; - fgVariableUnits[kCORR2POIMpw] = ""; - fgVariableNames[kCORR2POIsquaredMpw] = "<2'w>^{2} M_{p} "; - fgVariableUnits[kCORR2POIsquaredMpw] = ""; fgVariableNames[kCORR4POIMp] = "<4'> M_{p} "; fgVariableUnits[kCORR4POIMp] = ""; - fgVariableNames[kCORR4POIMpw] = "<4'w> M_{p} "; - fgVariableUnits[kCORR4POIMpw] = ""; - fgVariableNames[kCORR4POIsquaredMpw] = "<4'w>^{2} M_{p} "; - fgVariableUnits[kCORR4POIsquaredMpw] = ""; fgVariableNames[kCos2DeltaPhi] = "cos 2(#varphi-#Psi_{2}^{A}) "; fgVariableUnits[kCos2DeltaPhi] = ""; fgVariableNames[kCos3DeltaPhi] = "cos 3(#varphi-#Psi_{3}^{A}) "; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index c6ae7d4a906..d00e4f183bc 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -645,36 +645,20 @@ class VarManager : public TObject kM11REFetagap, kM01POI, kM1111REF, - kM1111REFsmall, kM11M1111REF, kCORR2CORR4REF, kM0111POI, kCORR2REF, - kCORR2REFw, - kCORR2REFsquared, - kCORR2REFsquaredw, kCORR2REFetagap, - kCORR2REFetagapw, - kCORR2REFetagapsquaredw, kCORR2POI, - kCORR2POIw, - kCORR2POIsquaredw, - kCORR2POIsquaredMpw, kCORR4REF, - kCORR4REFw, - kCORR4REFsquaredw, kCORR4POI, - kCORR4POIw, - kCORR4POIsquaredw, - kCORR4POIsquaredMpw, kM11REFoverMp, kM01POIoverMp, kM1111REFoverMp, kM0111POIoverMp, kCORR2POIMp, kCORR4POIMp, - kCORR2POIMpw, - kCORR4POIMpw, kR2SP, kR2EP, kPsi2A, @@ -1652,21 +1636,11 @@ void VarManager::FillEvent(T const& event, float* values) if constexpr ((fillMap & ReducedEventRefFlow) > 0) { values[kM1111REF] = event.m1111ref(); - values[kM1111REFsmall] = event.m1111ref(); - values[kM11M1111REF] = event.m1111ref(); - values[kCORR2CORR4REF] = event.corr4ref(); values[kM11REF] = event.m11ref(); - values[kM11REFetagap] = event.m11ref(); + values[kM11M1111REF] = event.m11ref() * event.m1111ref(); values[kCORR2REF] = event.corr2ref(); - values[kCORR2REFsquared] = event.corr2ref(); - values[kCORR2REFw] = event.corr2ref(); - values[kCORR2REFsquaredw] = event.corr2ref(); - values[kCORR2REFetagap] = event.corr2ref(); - values[kCORR2REFetagapw] = event.corr2ref(); - values[kCORR2REFetagapsquaredw] = event.corr2ref(); values[kCORR4REF] = event.corr4ref(); - values[kCORR4REFw] = event.corr4ref(); - values[kCORR4REFsquaredw] = event.corr4ref(); + values[kCORR2CORR4REF] = event.corr2ref() * event.corr4ref(); values[kMultA] = event.multa(); } } @@ -4026,11 +4000,6 @@ void VarManager::FillQVectorFromGFW(C const& /*collision*/, A const& compA11, A values[kM1111REF] = std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) ? 0 : values[kM1111REF]; values[kM11REF] = std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) ? 0 : values[kM11REF]; values[kM1111REF] = std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kM1111REF]; - values[kCORR2REFw] = values[kCORR2REF] * values[kM11REF]; - values[kCORR2REFsquared] = values[kCORR2REF] * values[kCORR2REF]; - values[kCORR2REFsquaredw] = values[kCORR2REF] * values[kCORR2REF] * values[kM11REF]; - values[kCORR4REFw] = values[kCORR4REF] * values[kM1111REF]; - values[kCORR4REFsquaredw] = values[kCORR4REF] * values[kCORR4REF] * values[kM1111REF]; values[kCORR2CORR4REF] = values[kCORR2REF] * values[kCORR4REF]; values[kM11M1111REF] = values[kM11REF] * values[kM1111REF]; @@ -4041,8 +4010,6 @@ void VarManager::FillQVectorFromGFW(C const& /*collision*/, A const& compA11, A values[kM11REFetagap] = S11B * S11C; values[kCORR2REFetagap] = ((QB * conj(QC)).real()) / values[kM11REFetagap]; values[kCORR2REFetagap] = std::isnan(values[kCORR2REFetagap]) || std::isinf(values[kCORR2REFetagap]) ? 0 : values[kCORR2REFetagap]; - values[kCORR2REFetagapw] = values[kCORR2REFetagap] * values[kM11REFetagap]; - values[kCORR2REFetagapsquaredw] = values[kCORR2REFetagap] * values[kCORR2REFetagap] * values[kM11REFetagap]; // TODO: provide different computations for R // Compute the R factor using the 2 sub-events technique for second and third harmonic From b3b0db70c8a17d9258bfbe9554f1dfa68181652e Mon Sep 17 00:00:00 2001 From: peressounko Date: Thu, 28 Nov 2024 16:12:51 +0300 Subject: [PATCH 156/459] [PWGEM] Apply calibration to cell energy (#8660) Co-authored-by: peressounko --- PWGEM/Tasks/phosCellQA.cxx | 47 ++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/PWGEM/Tasks/phosCellQA.cxx b/PWGEM/Tasks/phosCellQA.cxx index 911402a9782..271782406c0 100644 --- a/PWGEM/Tasks/phosCellQA.cxx +++ b/PWGEM/Tasks/phosCellQA.cxx @@ -14,9 +14,12 @@ #include #include #include +#include +#include "CCDB/BasicCCDBManager.h" #include "Common/DataModel/EventSelection.h" #include "DataFormatsPHOS/Cell.h" +#include "DataFormatsPHOS/CalibParams.h" #include "Framework/ConfigParamSpec.h" #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -43,13 +46,17 @@ using namespace o2::framework; using namespace o2::framework::expressions; struct phosCellQA { - ConfigurableAxis amplitudeAxisLarge{"amplitude", {1000, 0., 100.}, "Amplutude (GeV)"}; + + Service ccdb; + + ConfigurableAxis amplitudeAxisLarge{"amplitude", {1000, 0., 10.}, "Amplutude (GeV)"}; ConfigurableAxis timeAxisLarge{"celltime", {1000, -1500.e-9, 3500.e-9}, "cell time (ns)"}; Configurable mEvSelTrig{"mEvSelTrig", kTVXinPHOS, "Select events with this trigger"}; - Configurable mMinCellAmplitude{"minCellAmplitude", 0., "Minimum cell amplitude for histograms."}; + Configurable mMinCellAmplitude{"minCellAmplitude", 0.5, "Minimum cell energy for histograms (GeV)"}; Configurable mMinCellTimeMain{"minCellTimeMain", -50, "Min. cell time of main bunch selection"}; Configurable mMaxCellTimeMain{"maxCellTimeMain", 100, "Max. cell time of main bunch selection"}; Configurable mVetoBCID{"vetoBCID", -1, "BC ID to be excluded"}; + Configurable mCalibPath{"calibPath", "PHS/Calib/CalibParams", "path to Calibration snapshot"}; o2::framework::HistogramRegistry mHistManager{"phosCallQAHistograms"}; @@ -91,6 +98,15 @@ struct phosCellQA { void process(o2::aod::Calos const& cells, BCsWithBcSels const& bcs) { LOG(debug) << "Processing next event"; + + int64_t timestamp = 0; + if (bcs.begin() != bcs.end()) { + timestamp = bcs.begin().timestamp(); // timestamp for CCDB object retrieval + } else { + return; + } + const o2::phos::CalibParams* calibParams = ccdb->getForTimeStamp(mCalibPath, timestamp); + for (const auto& bc : bcs) { o2::InteractionRecord eventIR; eventIR.setFromLong(bc.globalBC()); @@ -110,45 +126,52 @@ struct phosCellQA { if (mVetoBCID >= 0 && cellIR.bc == mVetoBCID) continue; mHistManager.fill(HIST("cellBCSelected"), cellIR.bc); - // mHistManager.fill(HIST("cellAmplitude"), cell.amplitude(), cell.cellNumber()); if (!cell.bc_as().alias_bit(mEvSelTrig)) continue; - if (cell.amplitude() < mMinCellAmplitude) + bool isHighGain = cell.cellType(); + double energy = calibParams->getGain(cell.cellNumber()) * cell.amplitude(); + // if (isHighGain) { + // energy = calibParams->getGain(cell.cellNumber()) * cell.amplitude(); + // } else { + // energy = calibParams->getGain(cell.cellNumber()) * cell.amplitude() * calibParams->getHGLGRatio(cell.cellNumber()); + // } + + if (energy < mMinCellAmplitude) continue; char relid[3]; o2::phos::Geometry::absToRelNumbering(cell.cellNumber(), relid); if (relid[0] == 1) { mHistManager.fill(HIST("cellOccM1"), relid[1] - 0.5, relid[2] - 0.5); - mHistManager.fill(HIST("cellAmpM1"), relid[1] - 0.5, relid[2] - 0.5, cell.amplitude()); + mHistManager.fill(HIST("cellAmpM1"), relid[1] - 0.5, relid[2] - 0.5, energy); mHistManager.fill(HIST("cellTimeM1"), relid[1] - 0.5, relid[2] - 0.5, cell.time()); if (cell.time() > mMinCellTimeMain && cell.time() < mMaxCellTimeMain) { - mHistManager.fill(HIST("cellAmpTimeM1"), cell.time(), cell.amplitude()); + mHistManager.fill(HIST("cellAmpTimeM1"), cell.time(), energy); } } if (relid[0] == 2) { mHistManager.fill(HIST("cellOccM2"), relid[1] - 0.5, relid[2] - 0.5); - mHistManager.fill(HIST("cellAmpM2"), relid[1] - 0.5, relid[2] - 0.5, cell.amplitude()); + mHistManager.fill(HIST("cellAmpM2"), relid[1] - 0.5, relid[2] - 0.5, energy); mHistManager.fill(HIST("cellTimeM2"), relid[1] - 0.5, relid[2] - 0.5, cell.time()); if (cell.time() > mMinCellTimeMain && cell.time() < mMaxCellTimeMain) { - mHistManager.fill(HIST("cellAmpTimeM2"), cell.time(), cell.amplitude()); + mHistManager.fill(HIST("cellAmpTimeM2"), cell.time(), energy); } } if (relid[0] == 3) { mHistManager.fill(HIST("cellOccM3"), relid[1] - 0.5, relid[2] - 0.5); - mHistManager.fill(HIST("cellAmpM3"), relid[1] - 0.5, relid[2] - 0.5, cell.amplitude()); + mHistManager.fill(HIST("cellAmpM3"), relid[1] - 0.5, relid[2] - 0.5, energy); mHistManager.fill(HIST("cellTimeM3"), relid[1] - 0.5, relid[2] - 0.5, cell.time()); if (cell.time() > mMinCellTimeMain && cell.time() < mMaxCellTimeMain) { - mHistManager.fill(HIST("cellAmpTimeM3"), cell.time(), cell.amplitude()); + mHistManager.fill(HIST("cellAmpTimeM3"), cell.time(), energy); } } if (relid[0] == 4) { mHistManager.fill(HIST("cellOccM4"), relid[1] - 0.5, relid[2] - 0.5); - mHistManager.fill(HIST("cellAmpM4"), relid[1] - 0.5, relid[2] - 0.5, cell.amplitude()); + mHistManager.fill(HIST("cellAmpM4"), relid[1] - 0.5, relid[2] - 0.5, energy); mHistManager.fill(HIST("cellTimeM4"), relid[1] - 0.5, relid[2] - 0.5, cell.time()); if (cell.time() > mMinCellTimeMain && cell.time() < mMaxCellTimeMain) { - mHistManager.fill(HIST("cellAmpTimeM4"), cell.time(), cell.amplitude()); + mHistManager.fill(HIST("cellAmpTimeM4"), cell.time(), energy); } } } From 6240c4a4ab24d8621ffba888b8f3d97efb045119 Mon Sep 17 00:00:00 2001 From: a-m-andrushko <96832230+a-m-andrushko@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:29:35 +0100 Subject: [PATCH 157/459] [PWGCF] PR (#8713) Co-authored-by: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> --- .../femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx | 6 +++--- ...emtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx index 735afc9bee8..cdccc3bd327 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx @@ -133,13 +133,13 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { /// Event part Configurable ConfV0MLow{"ConfV0MLow", 0.0, "Lower limit for V0M multiplicity"}; Configurable ConfV0MHigh{"ConfV0MHigh", 25000.0, "Upper limit for V0M multiplicity"}; - Configurable ConfTPCOccupancyLow{"ConfTPCOccupancyLow", 0.0, "Lower limit for TPC occupancy"}; - Configurable ConfTPCOccupancyHigh{"ConfTPCOccupancyHigh", 500.0, "Higher limit for TPC occupancy"}; + Configurable ConfTPCOccupancyLow{"ConfTPCOccupancyLow", 0, "Lower limit for TPC occupancy"}; + Configurable ConfTPCOccupancyHigh{"ConfTPCOccupancyHigh", 500, "Higher limit for TPC occupancy"}; Filter collfilter = (o2::aod::femtouniversecollision::multV0M > ConfV0MLow) && (o2::aod::femtouniversecollision::multV0M < ConfV0MHigh) && (o2::aod::femtouniversecollision::occupancy > ConfTPCOccupancyLow) && (o2::aod::femtouniversecollision::occupancy < ConfTPCOccupancyHigh); using FilteredFDCollisions = soa::Filtered>; - using FilteredFDCollision = soa::Filtered::iterator; + using FilteredFDCollision = FilteredFDCollisions::iterator; /// Particle part ConfigurableAxis ConfTempFitVarBins{"ConfDTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 84d2c70e5ea..bfe87658a37 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -133,8 +133,8 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { /// Event part Configurable ConfV0MLow{"ConfV0MLow", 0.0, "Lower limit for V0M multiplicity"}; Configurable ConfV0MHigh{"ConfV0MHigh", 25000.0, "Upper limit for V0M multiplicity"}; - Configurable ConfTPCOccupancyLow{"ConfTPCOccupancyLow", 0.0, "Lower limit for TPC occupancy"}; - Configurable ConfTPCOccupancyHigh{"ConfTPCOccupancyHigh", 500.0, "Higher limit for TPC occupancy"}; + Configurable ConfTPCOccupancyLow{"ConfTPCOccupancyLow", 0, "Lower limit for TPC occupancy"}; + Configurable ConfTPCOccupancyHigh{"ConfTPCOccupancyHigh", 500, "Higher limit for TPC occupancy"}; Configurable ConfIntRateLow{"ConfIntRateLow", 0.0, "Lower limit for interaction rate"}; Configurable ConfIntRateHigh{"ConfIntRateHigh", 10000.0, "Higher limit for interaction rate"}; @@ -142,7 +142,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { (o2::aod::femtouniversecollision::irrate > ConfIntRateLow) && (o2::aod::femtouniversecollision::irrate < ConfIntRateHigh) && (o2::aod::femtouniversecollision::occupancy > ConfTPCOccupancyLow) && (o2::aod::femtouniversecollision::occupancy < ConfTPCOccupancyHigh); using FilteredFDCollisions = soa::Filtered>; - using FilteredFDCollision = soa::Filtered::iterator; + using FilteredFDCollision = FilteredFDCollisions::iterator; // Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.ConfEtaMax); // example filtering on configurable /// Particle part From 8e35a7b40f589ab5299b81c2ec76ae0540f0b901 Mon Sep 17 00:00:00 2001 From: eloviyo <38348689+Eloviyo@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:54:21 +0100 Subject: [PATCH 158/459] [PWGCF] FemtoUniverse cascade task -- fixed cascade pair cleaner (#8714) Co-authored-by: Shirajum Monira --- PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h b/PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h index bbddf41aefd..29b8368f392 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h @@ -113,6 +113,7 @@ class FemtoUniversePairCleaner if (part1.globalIndex() == posChild.globalIndex() || part1.globalIndex() == negChild.globalIndex() || part1.globalIndex() == bachelor.globalIndex()) { return false; } + return part1.globalIndex() != part2.globalIndex(); } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) { /// Track-D0 combination part1 is hadron and part2 is D0 if (part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kD0) { From 26281ed5e1c9064e2fc5deebfe0997b6dd38619b Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Thu, 28 Nov 2024 15:38:09 +0100 Subject: [PATCH 159/459] [PWGHF] align mcPidTof with pidTofMerge as in PR 8616. (#8715) Co-authored-by: Mattia Faggin --- PWGHF/TableProducer/mcPidTof.cxx | 118 +++++++++++++++++++++++-------- 1 file changed, 88 insertions(+), 30 deletions(-) diff --git a/PWGHF/TableProducer/mcPidTof.cxx b/PWGHF/TableProducer/mcPidTof.cxx index ec4ff54b2e3..c76fc6c656a 100644 --- a/PWGHF/TableProducer/mcPidTof.cxx +++ b/PWGHF/TableProducer/mcPidTof.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -71,6 +72,7 @@ struct TOFCalibConfig { mParamFileName = opt.cfgParamFileName.value; mParametrizationPath = opt.cfgParametrizationPath.value; mReconstructionPass = opt.cfgReconstructionPass.value; + mReconstructionPassDefault = opt.cfgReconstructionPassDefault.value; mLoadResponseFromCCDB = opt.cfgLoadResponseFromCCDB.value; mFatalOnPassNotAvailable = opt.cfgFatalOnPassNotAvailable.value; mEnableTimeDependentResponse = opt.cfgEnableTimeDependentResponse.value; @@ -81,7 +83,7 @@ struct TOFCalibConfig { template void getCfg(o2::framework::InitContext& initContext, const std::string name, VType& v, const std::string task) { - if (!getTaskOptionValue(initContext, task, name, v, true)) { + if (!getTaskOptionValue(initContext, task, name, v, false)) { LOG(fatal) << "Could not get " << name << " from " << task << " task"; } } @@ -93,10 +95,11 @@ struct TOFCalibConfig { getCfg(initContext, "ccdb-path-grplhcif", mPathGrpLhcIf, task); getCfg(initContext, "ccdb-timestamp", mTimestamp, task); getCfg(initContext, "timeShiftCCDBPathPos", mTimeShiftCCDBPathPos, task); - getCfg(initContext, "timeShiftCCDBPathNeg", mTimeShiftCCDBPathPos, task); + getCfg(initContext, "timeShiftCCDBPathNeg", mTimeShiftCCDBPathNeg, task); getCfg(initContext, "paramFileName", mParamFileName, task); getCfg(initContext, "parametrizationPath", mParametrizationPath, task); getCfg(initContext, "reconstructionPass", mReconstructionPass, task); + getCfg(initContext, "reconstructionPassDefault", mReconstructionPassDefault, task); getCfg(initContext, "loadResponseFromCCDB", mLoadResponseFromCCDB, task); getCfg(initContext, "fatalOnPassNotAvailable", mFatalOnPassNotAvailable, task); getCfg(initContext, "enableTimeDependentResponse", mEnableTimeDependentResponse, task); @@ -129,49 +132,63 @@ struct TOFCalibConfig { } LOG(info) << "Using parameter collection, starting from pass '" << mReconstructionPass << "'"; - const std::string fname = mParamFileName; - if (!fname.empty()) { // Loading the parametrization from file - LOG(info) << "Loading exp. sigma parametrization from file " << fname << ", using param: " << mParametrizationPath; - if (1) { - o2::tof::ParameterCollection paramCollection; - paramCollection.loadParamFromFile(fname, mParametrizationPath); - LOG(info) << "+++ Loaded parameter collection from file +++"; - if (!paramCollection.retrieveParameters(mRespParamsV3, mReconstructionPass)) { - if (mFatalOnPassNotAvailable) { - LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + if (!mParamFileName.empty()) { // Loading the parametrization from file + LOG(info) << "Loading exp. sigma parametrization from file " << mParamFileName << ", using param: " << mParametrizationPath << " and pass " << mReconstructionPass; + o2::tof::ParameterCollection paramCollection; + paramCollection.loadParamFromFile(mParamFileName, mParametrizationPath); + LOG(info) << "+++ Loaded parameter collection from file +++"; + if (!paramCollection.retrieveParameters(mRespParamsV3, mReconstructionPass)) { + if (mFatalOnPassNotAvailable) { + LOG(fatal) << "Pass '" << mReconstructionPass << "' not available in the retrieved object from file"; + } else { + LOG(warning) << "Pass '" << mReconstructionPass << "' not available in the retrieved object from file, fetching '" << mReconstructionPassDefault << "'"; + if (!paramCollection.retrieveParameters(mRespParamsV3, mReconstructionPassDefault)) { + paramCollection.print(); + LOG(fatal) << "Cannot get default pass for calibration " << mReconstructionPassDefault; } else { - LOGF(warning, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + mRespParamsV3.setResolutionParametrization(paramCollection.getPars(mReconstructionPassDefault)); + mRespParamsV3.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPassDefault)); + mRespParamsV3.printMomentumChargeShiftParameters(); } - } else { - mRespParamsV3.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPass)); - mRespParamsV3.printMomentumChargeShiftParameters(); } - } else { - mRespParamsV3.loadParamFromFile(fname.data(), mParametrizationPath); + } else { // Pass is available, load non standard parameters + mRespParamsV3.setResolutionParametrization(paramCollection.getPars(mReconstructionPass)); + mRespParamsV3.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPass)); + mRespParamsV3.printMomentumChargeShiftParameters(); } - } else if (mLoadResponseFromCCDB) { // Loading it from CCDB + } else if (mLoadResponseFromCCDB && !mEnableTimeDependentResponse) { // Loading it from CCDB LOG(info) << "Loading exp. sigma parametrization from CCDB, using path: " << mParametrizationPath << " for timestamp " << mTimestamp; o2::tof::ParameterCollection* paramCollection = ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp); paramCollection->print(); if (!paramCollection->retrieveParameters(mRespParamsV3, mReconstructionPass)) { // Attempt at loading the parameters with the pass defined if (mFatalOnPassNotAvailable) { - LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + LOG(fatal) << "Pass '" << mReconstructionPass << "' not available in the retrieved CCDB object"; } else { - LOGF(warning, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + LOG(warning) << "Pass '" << mReconstructionPass << "' not available in the retrieved CCDB object, fetching '" << mReconstructionPassDefault << "'"; + if (!paramCollection->retrieveParameters(mRespParamsV3, mReconstructionPassDefault)) { + paramCollection->print(); + LOG(fatal) << "Cannot get default pass for calibration " << mReconstructionPassDefault; + } else { + mRespParamsV3.setResolutionParametrization(paramCollection->getPars(mReconstructionPassDefault)); + mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPassDefault)); + mRespParamsV3.printMomentumChargeShiftParameters(); + } } } else { // Pass is available, load non standard parameters + mRespParamsV3.setResolutionParametrization(paramCollection->getPars(mReconstructionPass)); mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPass)); mRespParamsV3.printMomentumChargeShiftParameters(); } + } else { + std::unordered_map m; + mRespParamsV3.setResolutionParametrization(m); } - // Calibration object is defined - mRespParamsV3.print(); // Loading additional calibration objects if (mTimeShiftCCDBPathPos != "") { if (mTimeShiftCCDBPathPos.find(".root") != std::string::npos) { mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathPos, "ccdb_object", true); - } else { + } else if (!mEnableTimeDependentResponse) { if (mReconstructionPass == "") { mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathPos, mTimestamp), true); } else { @@ -184,7 +201,7 @@ struct TOFCalibConfig { if (mTimeShiftCCDBPathNeg != "") { if (mTimeShiftCCDBPathNeg.find(".root") != std::string::npos) { mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathNeg, "ccdb_object", false); - } else { + } else if (!mEnableTimeDependentResponse) { if (mReconstructionPass == "") { mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathNeg, mTimestamp), false); } else { @@ -194,6 +211,10 @@ struct TOFCalibConfig { } } } + + // Calibration object is defined + LOG(info) << "Parametrization at init time:"; + mRespParamsV3.print(); } template @@ -221,13 +242,48 @@ struct TOFCalibConfig { if (!mEnableTimeDependentResponse) { return; } - LOG(debug) << "Updating parametrization from path '" << mParametrizationPath << "' and timestamp " << mTimestamp; - if (!ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->retrieveParameters(mRespParamsV3, mReconstructionPass)) { - if (mFatalOnPassNotAvailable) { - LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + LOG(info) << "Updating parametrization from path '" << mParametrizationPath << "' and timestamp " << mTimestamp << " and reconstruction pass '" << mReconstructionPass << "'"; + if (mParamFileName.empty()) { // Not loading if parametrization from file + if (!ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->retrieveParameters(mRespParamsV3, mReconstructionPass)) { + if (mFatalOnPassNotAvailable) { + LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + } else { + LOGF(warning, "Pass '%s' not available in the retrieved CCDB object, fetching '%s'", mReconstructionPass.data(), mReconstructionPassDefault.data()); + if (!ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->retrieveParameters(mRespParamsV3, mReconstructionPassDefault)) { + ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->print(); + LOG(fatal) << "Cannot get default pass for calibration " << mReconstructionPassDefault; + } + } + } + } + + // Loading additional calibration objects + if (mTimeShiftCCDBPathPos != "") { + if (mTimeShiftCCDBPathPos.find(".root") != std::string::npos) { + mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathPos, "ccdb_object", true); + } else { + if (mReconstructionPass == "") { + mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathPos, mTimestamp), true); + } else { + std::map metadata; + metadata["RecoPassName"] = mReconstructionPass; + mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(mTimeShiftCCDBPathPos, mTimestamp, metadata), true); + } + } + } + if (mTimeShiftCCDBPathNeg != "") { + if (mTimeShiftCCDBPathNeg.find(".root") != std::string::npos) { + mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathNeg, "ccdb_object", false); } else { - LOGF(warning, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); + if (mReconstructionPass == "") { + mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathNeg, mTimestamp), false); + } else { + std::map metadata; + metadata["RecoPassName"] = mReconstructionPass; + mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(mTimeShiftCCDBPathNeg, mTimestamp, metadata), false); + } } + LOG(info) << " test getTimeShift neg: " << mRespParamsV3.getTimeShift(0, false); } return; } @@ -248,6 +304,7 @@ struct TOFCalibConfig { std::string mParamFileName; std::string mParametrizationPath; std::string mReconstructionPass; + std::string mReconstructionPassDefault; bool mLoadResponseFromCCDB; bool mFatalOnPassNotAvailable; bool mEnableTimeDependentResponse; @@ -289,6 +346,7 @@ struct tofSignal { Configurable cfgParamFileName{"paramFileName", "", "Path to the parametrization object. If empty the parametrization is not taken from file"}; Configurable cfgParametrizationPath{"parametrizationPath", "TOF/Calib/Params", "Path of the TOF parametrization on the CCDB or in the file, if the paramFileName is not empty"}; Configurable cfgReconstructionPass{"reconstructionPass", "", {"Apass to use when fetching the calibration tables. Empty (default) does not check for any pass. Use `metadata` to fetch it from the AO2D metadata. Otherwise it will override the metadata."}}; + Configurable cfgReconstructionPassDefault{"reconstructionPassDefault", "unanchored", {"Default pass to get if the standard one is not found"}}; Configurable cfgLoadResponseFromCCDB{"loadResponseFromCCDB", false, "Flag to load the response from the CCDB"}; Configurable cfgFatalOnPassNotAvailable{"fatalOnPassNotAvailable", true, "Flag to throw a fatal if the pass is not available in the retrieved CCDB object"}; Configurable cfgEnableTimeDependentResponse{"enableTimeDependentResponse", false, "Flag to use the collision timestamp to fetch the PID Response"}; From e4a2d4149b4991f101f209f89699cf4b33e3da46 Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Thu, 28 Nov 2024 16:20:16 +0100 Subject: [PATCH 160/459] [PWGCF] adding 2prong-2prong correlations (#8686) --- PWGCF/Tasks/correlations.cxx | 100 ++++++++++++++++++++++++++++++----- 1 file changed, 87 insertions(+), 13 deletions(-) diff --git a/PWGCF/Tasks/correlations.cxx b/PWGCF/Tasks/correlations.cxx index 5ad33872ccb..eec9faaf96e 100644 --- a/PWGCF/Tasks/correlations.cxx +++ b/PWGCF/Tasks/correlations.cxx @@ -9,6 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. #include +#include +#include #include #include @@ -104,7 +106,7 @@ struct CorrelationTask { // This filter is applied to AOD and derived data (column names are identical) Filter collisionZVtxFilter = nabs(aod::collision::posZ) < cfgCutVertex; // This filter is only applied to AOD - Filter collisionVertexTypeFilter = (aod::collision::flags & (uint16_t)aod::collision::CollisionFlagsRun2::Run2VertexerTracks) == (uint16_t)aod::collision::CollisionFlagsRun2::Run2VertexerTracks; + Filter collisionVertexTypeFilter = (aod::collision::flags & static_cast(aod::collision::CollisionFlagsRun2::Run2VertexerTracks)) == static_cast(aod::collision::CollisionFlagsRun2::Run2VertexerTracks); // Track filters Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPt) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)); @@ -185,6 +187,9 @@ struct CorrelationTask { std::vector userAxis; if (cfgMassAxis != 0) userAxis.emplace_back(axisInvMass, "m (GeV/c^2)"); + if (doprocessSame2Prong2Prong) + userAxis.emplace_back(axisInvMass, "m (GeV/c^2)"); + same.setObject(new CorrelationContainer("sameEvent", "sameEvent", corrAxis, effAxis, userAxis)); mixed.setObject(new CorrelationContainer("mixedEvent", "mixedEvent", corrAxis, effAxis, userAxis)); @@ -241,7 +246,7 @@ struct CorrelationTask { for (auto& track1 : tracks1) { if constexpr (std::experimental::is_detected::value) { if constexpr (std::experimental::is_detected::value) { - if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << (uint32_t)track1.decay())) == 0u) + if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast(track1.decay()))) == 0u) continue; } registry.fill(HIST("invMass"), track1.invMass(), track1.pt(), multiplicity); @@ -317,7 +322,7 @@ struct CorrelationTask { } if constexpr (std::experimental::is_detected::value) { - if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << (uint32_t)track1.decay())) == 0u) + if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast(track1.decay()))) == 0u) continue; } @@ -375,15 +380,54 @@ struct CorrelationTask { } } + if constexpr (std::experimental::is_detected::value) { + if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast(track2.decay()))) == 0u) + continue; + } + + if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) { + if (doprocessSame2Prong2Prong && (track1.decay() == track2.decay() || track1.decay() > 1 || track2.decay() > 1)) { + continue; + } + } // D0 and anti-D0 selection + + if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { + if (track1.cfTrackProng0Id() == track2.cfTrackProng0Id()) { + continue; + } + } + if constexpr (std::experimental::is_detected::value) { + if (track1.cfTrackProng0Id() == track2.cfTrackProng1Id()) { + continue; + } + } + } + + if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { + if (track1.cfTrackProng1Id() == track2.cfTrackProng0Id()) { + continue; + } + } + if constexpr (std::experimental::is_detected::value) { + if (track1.cfTrackProng1Id() == track2.cfTrackProng1Id()) { + continue; + } + } + } // no shared prong for two mothers + if (cfgPtOrder != 0 && track2.pt() >= track1.pt()) { continue; } - if (cfgAssociatedCharge != 0 && cfgAssociatedCharge * track2.sign() < 0) { - continue; + if constexpr (std::experimental::is_detected::value) { + if (cfgAssociatedCharge != 0 && cfgAssociatedCharge * track2.sign() < 0) { + continue; + } } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) { if (cfgPairCharge != 0 && cfgPairCharge * track1.sign() * track2.sign() < 0) { continue; } @@ -391,12 +435,13 @@ struct CorrelationTask { if constexpr (std::is_same::value) { if constexpr (step >= CorrelationContainer::kCFStepReconstructed) { - if (cfg.mPairCuts && mPairCuts.conversionCuts(track1, track2)) { - continue; - } - - if (cfgTwoTrackCut > 0 && mPairCuts.twoTrackCut(track1, track2, magField)) { - continue; + if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) { + if (cfg.mPairCuts && mPairCuts.conversionCuts(track1, track2)) { + continue; + } + if (cfgTwoTrackCut > 0 && mPairCuts.twoTrackCut(track1, track2, magField)) { + continue; + } } } } @@ -417,7 +462,12 @@ struct CorrelationTask { } // last param is the weight - if (cfgMassAxis) { + if (cfgMassAxis && doprocessSame2Prong2Prong) { + if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) + target->getPairHist()->Fill(step, track1.eta() - track2.eta(), track2.pt(), track1.pt(), multiplicity, deltaPhi, posZ, track2.invMass(), track1.invMass(), associatedWeight); + else + LOGF(fatal, "Can not fill mass axis without invMass column. \n no mass for two particles"); + } else if (cfgMassAxis) { if constexpr (std::experimental::is_detected::value) target->getPairHist()->Fill(step, track1.eta() - track2.eta(), track2.pt(), track1.pt(), multiplicity, deltaPhi, posZ, track1.invMass(), associatedWeight); else @@ -547,6 +597,30 @@ struct CorrelationTask { } PROCESS_SWITCH(CorrelationTask, processSame2ProngDerived, "Process same event on derived data", false); + void processSame2Prong2Prong(derivedCollisions::iterator const& collision, soa::Filtered const& p2tracks) + { + BinningTypeDerived configurableBinningDerived{{axisVertex, axisMultiplicity}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. + if (cfgVerbosity > 0) { + LOGF(info, "processSame2ProngDerived: 2-prong candidates: %d | Vertex: %.1f | Multiplicity/Centrality: %.1f", p2tracks.size(), collision.posZ(), collision.multiplicity()); + } + loadEfficiency(collision.timestamp()); + + const auto multiplicity = collision.multiplicity(); + + int bin = configurableBinningDerived.getBin({collision.posZ(), collision.multiplicity()}); + registry.fill(HIST("eventcount_same"), bin); + fillQA(collision, multiplicity, p2tracks, p2tracks); + + same->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); + fillCorrelations(same, p2tracks, p2tracks, multiplicity, collision.posZ(), 0, 1.0f); + + if (cfg.mEfficiencyAssociated || cfg.mEfficiencyTrigger) { + same->fillEvent(multiplicity, CorrelationContainer::kCFStepCorrected); + fillCorrelations(same, p2tracks, p2tracks, multiplicity, collision.posZ(), 0, 1.0f); + } + } + PROCESS_SWITCH(CorrelationTask, processSame2Prong2Prong, "Process same event on derived data", false); + using BinningTypeAOD = ColumnBinningPolicy; void processMixedAOD(aodCollisions& collisions, aodTracks const& tracks, aod::BCsWithTimestamps const&) { From 86cc94ecde9d5fe9fe90215844958128f92b69bd Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:33:12 +0100 Subject: [PATCH 161/459] [PWGDQ] Adding correct checks for Cumulants REF FLOW calculations (#8718) --- PWGDQ/Core/VarManager.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index d00e4f183bc..67249612ba7 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -3994,12 +3994,10 @@ void VarManager::FillQVectorFromGFW(C const& /*collision*/, A const& compA11, A values[kM1111REF] = S41A - 6. * S12A * S21A + 8. * S13A * S11A + 3. * S22A - 6. * S14A; values[kCORR2REF] = (norm(compA21) - S12A) / values[kM11REF]; values[kCORR4REF] = (pow(norm(compA21), 2) + norm(compA42) - 2. * (compA42 * conj(compA21) * conj(compA21)).real() + 8. * (compA23 * conj(compA21)).real() - 4. * S12A * norm(compA21) - 6. * S14A - 2. * S22A) / values[kM1111REF]; - values[kCORR2REF] = std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) ? 0 : values[kCORR2REF]; - values[kCORR4REF] = std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kCORR4REF]; - values[kM11REF] = std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) ? 0 : values[kM11REF]; - values[kM1111REF] = std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) ? 0 : values[kM1111REF]; - values[kM11REF] = std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) ? 0 : values[kM11REF]; - values[kM1111REF] = std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kM1111REF]; + values[kCORR2REF] = std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) ? 0 : values[kCORR2REF]; + values[kM11REF] = std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) ? 0 : values[kM11REF]; + values[kCORR4REF] = std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kCORR4REF]; + values[kM1111REF] = std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kM1111REF]; values[kCORR2CORR4REF] = values[kCORR2REF] * values[kCORR4REF]; values[kM11M1111REF] = values[kM11REF] * values[kM1111REF]; From df6372add674ea1796eef8e6d02d3b83cced7c00 Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Thu, 28 Nov 2024 19:01:35 +0100 Subject: [PATCH 162/459] [PWGDQ] Adding correct checks for REF FLOW WITH etagap (#8719) --- PWGDQ/Core/VarManager.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 67249612ba7..6b0af177765 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -4007,7 +4007,8 @@ void VarManager::FillQVectorFromGFW(C const& /*collision*/, A const& compA11, A complex QC(values[kQ2X0C] * S11C, values[kQ2Y0C] * S11C); values[kM11REFetagap] = S11B * S11C; values[kCORR2REFetagap] = ((QB * conj(QC)).real()) / values[kM11REFetagap]; - values[kCORR2REFetagap] = std::isnan(values[kCORR2REFetagap]) || std::isinf(values[kCORR2REFetagap]) ? 0 : values[kCORR2REFetagap]; + values[kCORR2REFetagap] = std::isnan(values[kM11REFetagap]) || std::isinf(values[kM11REFetagap]) || std::isnan(values[kCORR2REFetagap]) || std::isinf(values[kCORR2REFetagap]) ? 0 : values[kCORR2REFetagap]; + values[kM11REFetagap] = std::isnan(values[kM11REFetagap]) || std::isinf(values[kM11REFetagap]) || std::isnan(values[kCORR2REFetagap]) || std::isinf(values[kCORR2REFetagap]) ? 0 : values[kM11REFetagap]; // TODO: provide different computations for R // Compute the R factor using the 2 sub-events technique for second and third harmonic From d0e73ecf9a909b40364a827f828844b338f105b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jura=C4=8Dka?= <137087737+jjuracka@users.noreply.github.com> Date: Thu, 28 Nov 2024 20:03:05 +0100 Subject: [PATCH 163/459] [PWGUD] updates to upcRhoAnalysis.cxx (#8721) Co-authored-by: ALICE Action Bot --- PWGUD/Tasks/upcRhoAnalysis.cxx | 328 +++++++++++++++++++-------------- 1 file changed, 192 insertions(+), 136 deletions(-) diff --git a/PWGUD/Tasks/upcRhoAnalysis.cxx b/PWGUD/Tasks/upcRhoAnalysis.cxx index 68769394a7f..d4a45ed7442 100644 --- a/PWGUD/Tasks/upcRhoAnalysis.cxx +++ b/PWGUD/Tasks/upcRhoAnalysis.cxx @@ -39,27 +39,63 @@ using FullUdTracks = soa::Join); +// for lorentz vector reconstruction +DECLARE_SOA_COLUMN(TrackPt, trackPt, std::vector); +DECLARE_SOA_COLUMN(TrackEta, trackEta, std::vector); +DECLARE_SOA_COLUMN(TrackPhi, trackPhi, std::vector); +DECLARE_SOA_COLUMN(TrackM, trackM, std::vector); +// other stuff +DECLARE_SOA_COLUMN(TrackPiPID, trackPiPID, std::vector); +DECLARE_SOA_COLUMN(TrackElPID, trackElPID, std::vector); +DECLARE_SOA_COLUMN(TrackDcaXY, trackDcaXY, std::vector); +DECLARE_SOA_COLUMN(TrackDcaZ, trackDcaZ, std::vector); +DECLARE_SOA_COLUMN(TrackTpcSignal, trackTpcSignal, std::vector); DECLARE_SOA_COLUMN(TofClass, tofClass, int); -DECLARE_SOA_COLUMN(TotCharge, charge, int); -DECLARE_SOA_COLUMN(Pt, pt, double); -// system -DECLARE_SOA_COLUMN(M, m, double); -DECLARE_SOA_COLUMN(Rap, y, double); -DECLARE_SOA_COLUMN(PhiRandom, phiRandom, double); -DECLARE_SOA_COLUMN(PhiCharge, phiCharge, double); -DECLARE_SOA_COLUMN(Eta, eta, double); -DECLARE_SOA_COLUMN(Phi, phi, double); -} // namespace dipi -DECLARE_SOA_TABLE(SystemTree, "AOD", "SYSTEMTREE", dipi::RunNumber, dipi::NeutronClass, dipi::TofClass, dipi::TotCharge, dipi::M, dipi::Pt, dipi::Rap, dipi::PhiRandom, dipi::PhiCharge, dipi::Eta, dipi::Phi); +} // namespace tree +DECLARE_SOA_TABLE(Tree, "AOD", "TREE", tree::RunNumber, tree::GlobalBC, tree::NumContrib, tree::PosX, tree::PosY, tree::PosZ, tree::TotalFT0AmplitudeA, tree::TotalFT0AmplitudeC, tree::TotalFV0AmplitudeA, tree::TotalFDDAmplitudeA, tree::TotalFDDAmplitudeC, tree::TimeFT0A, tree::TimeFT0C, tree::TimeFV0A, tree::TimeFDDA, tree::TimeFDDC, tree::EnergyCommonZNA, tree::EnergyCommonZNC, tree::TimeZNA, tree::TimeZNC, tree::NeutronClass, tree::TotalCharge, tree::RhoPt, tree::RhoEta, tree::RhoPhi, tree::RhoM, tree::RhoPhiRandom, tree::RhoPhiCharge, tree::TrackSign, tree::TrackPt, tree::TrackEta, tree::TrackPhi, tree::TrackM, tree::TrackPiPID, tree::TrackElPID, tree::TrackDcaXY, tree::TrackDcaZ, tree::TrackTpcSignal, tree::TofClass); } // namespace o2::aod struct upcRhoAnalysis { - Produces systemTree; + Produces Tree; double PcEtaCut = 0.9; // physics coordination recommendation Configurable requireTof{"requireTof", false, "require TOF signal"}; @@ -96,21 +132,47 @@ struct upcRhoAnalysis { ConfigurableAxis momentumFromPhiAxis{"momentumFromPhiAxis", {400, -0.1, 0.1}, "p (GeV/#it{c})"}; ConfigurableAxis ptQuantileAxis{"ptQuantileAxis", {0, 0.0181689, 0.0263408, 0.0330488, 0.0390369, 0.045058, 0.0512604, 0.0582598, 0.066986, 0.0788085, 0.1}, "p_{T} (GeV/#it{c})"}; - HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry QC{"QC", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry Pions{"Pions", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry System{"System", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry MC{"MC", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry FourPiQA{"4piQA", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(o2::framework::InitContext&) { // QA // // collisions - QC.add("QC/collisions/hPosXY", ";x (cm);y (cm);counts", kTH2D, {{2000, -0.1, 0.1}, {2000, -0.1, 0.1}}); - QC.add("QC/collisions/hPosZ", ";z (cm);counts", kTH1D, {{400, -20.0, 20.0}}); - QC.add("QC/collisions/hNumContrib", ";number of contributors;counts", kTH1D, {{36, -0.5, 35.5}}); - QC.add("QC/collisions/hZdcCommonEnergy", ";ZNA common energy;ZNC common energy;counts", kTH2D, {{250, -5.0, 20.0}, {250, -5.0, 20.0}}); - QC.add("QC/collisions/hZdcTime", ";ZNA time (ns);ZNC time (ns);counts", kTH2D, {{200, -10.0, 10.0}, {200, -10.0, 10.0}}); + QC.add("QC/collisions/all/hPosXY", ";x (cm);y (cm);counts", kTH2D, {{2000, -0.1, 0.1}, {2000, -0.1, 0.1}}); + QC.add("QC/collisions/all/hPosZ", ";z (cm);counts", kTH1D, {{400, -20.0, 20.0}}); + QC.add("QC/collisions/all/hNumContrib", ";number of contributors;counts", kTH1D, {{36, -0.5, 35.5}}); + QC.add("QC/collisions/all/hZdcCommonEnergy", ";ZNA common energy;ZNC common energy;counts", kTH2D, {{250, -5.0, 20.0}, {250, -5.0, 20.0}}); + QC.add("QC/collisions/all/hZdcTime", ";ZNA time (ns);ZNC time (ns);counts", kTH2D, {{200, -10.0, 10.0}, {200, -10.0, 10.0}}); + QC.add("QC/collisions/all/hTotalFT0AmplitudeA", ";FT0A amplitude;counts", kTH1D, {{1000, 0.0, 1000.0}}); + QC.add("QC/collisions/all/hTotalFT0AmplitudeC", ";FT0C amplitude;counts", kTH1D, {{1000, 0.0, 1000.0}}); + QC.add("QC/collisions/all/hTotalFV0AmplitudeA", ";FV0A amplitude;counts", kTH1D, {{1000, 0.0, 1000.0}}); + QC.add("QC/collisions/all/hTotalFDDAmplitudeA", ";FDDA amplitude;counts", kTH1D, {{1000, 0.0, 1000.0}}); + QC.add("QC/collisions/all/hTotalFDDAmplitudeC", ";FDDC amplitude;counts", kTH1D, {{1000, 0.0, 1000.0}}); + QC.add("QC/collisions/all/hTimeFT0A", ";FT0A time (ns);counts", kTH1D, {{200, -100.0, 100.0}}); + QC.add("QC/collisions/all/hTimeFT0C", ";FT0C time (ns);counts", kTH1D, {{200, -100.0, 100.0}}); + QC.add("QC/collisions/all/hTimeFV0A", ";FV0A time (ns);counts", kTH1D, {{200, -100.0, 100.0}}); + QC.add("QC/collisions/all/hTimeFDDA", ";FDDA time (ns);counts", kTH1D, {{200, -100.0, 100.0}}); + QC.add("QC/collisions/all/hTimeFDDC", ";FDDC time (ns);counts", kTH1D, {{200, -100.0, 100.0}}); + // events with selected rho candidates + QC.add("QC/collisions/selected/hPosXY", ";x (cm);y (cm);counts", kTH2D, {{2000, -0.1, 0.1}, {2000, -0.1, 0.1}}); + QC.add("QC/collisions/selected/hPosZ", ";z (cm);counts", kTH1D, {{400, -20.0, 20.0}}); + QC.add("QC/collisions/selected/hNumContrib", ";number of contributors;counts", kTH1D, {{36, -0.5, 35.5}}); + QC.add("QC/collisions/selected/hZdcCommonEnergy", ";ZNA common energy;ZNC common energy;counts", kTH2D, {{250, -5.0, 20.0}, {250, -5.0, 20.0}}); + QC.add("QC/collisions/selected/hZdcTime", ";ZNA time (ns);ZNC time (ns);counts", kTH2D, {{200, -10.0, 10.0}, {200, -10.0, 10.0}}); + QC.add("QC/collisions/selected/hTotalFT0AmplitudeA", ";FT0A amplitude;counts", kTH1D, {{1000, 0.0, 1000.0}}); + QC.add("QC/collisions/selected/hTotalFT0AmplitudeC", ";FT0C amplitude;counts", kTH1D, {{1000, 0.0, 1000.0}}); + QC.add("QC/collisions/selected/hTotalFV0AmplitudeA", ";FV0A amplitude;counts", kTH1D, {{1000, 0.0, 1000.0}}); + QC.add("QC/collisions/selected/hTotalFDDAmplitudeA", ";FDDA amplitude;counts", kTH1D, {{1000, 0.0, 1000.0}}); + QC.add("QC/collisions/selected/hTotalFDDAmplitudeC", ";FDDC amplitude;counts", kTH1D, {{1000, 0.0, 1000.0}}); + QC.add("QC/collisions/selected/hTimeFT0A", ";FT0A time (ns);counts", kTH1D, {{200, -100.0, 100.0}}); + QC.add("QC/collisions/selected/hTimeFT0C", ";FT0C time (ns);counts", kTH1D, {{200, -100.0, 100.0}}); + QC.add("QC/collisions/selected/hTimeFV0A", ";FV0A time (ns);counts", kTH1D, {{200, -100.0, 100.0}}); + QC.add("QC/collisions/selected/hTimeFDDA", ";FDDA time (ns);counts", kTH1D, {{200, -100.0, 100.0}}); + QC.add("QC/collisions/selected/hTimeFDDC", ";FDDC time (ns);counts", kTH1D, {{200, -100.0, 100.0}}); // all tracks QC.add("QC/tracks/raw/hTpcNSigmaPi", ";TPC n#sigma_{#pi};counts", kTH1D, {{400, -10.0, 30.0}}); QC.add("QC/tracks/raw/hTofNSigmaPi", ";TOF n#sigma_{#pi};counts", kTH1D, {{400, -20.0, 20.0}}); @@ -121,46 +183,9 @@ struct upcRhoAnalysis { QC.add("QC/tracks/raw/hTpcChi2NCl", ";TPC #chi^{2}/N_{cls};counts", kTH1D, {{1000, 0.0, 100.0}}); QC.add("QC/tracks/raw/hTpcNCls", ";TPC N_{cls} found;counts", kTH1D, {{200, 0.0, 200.0}}); QC.add("QC/tracks/raw/hTpcNClsCrossedRows", ";TPC crossed rows;counts", kTH1D, {{200, 0.0, 200.0}}); - // track quality selections vs system mass - QC.add("QC/tracks/2D/mass/leading/hItsNClsVsM", ";m (GeV/#it{c}^{2});ITS N_{cls} of leading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {11, -0.5, 10.5}}); - QC.add("QC/tracks/2D/mass/leading/hItsChi2NClVsM", ";m (GeV/#it{c}^{2});ITS #chi^{2}/N_{cls} of leading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {1000, 0.0, 100.0}}); - QC.add("QC/tracks/2D/mass/leading/hTpcChi2NClVsM", ";m (GeV/#it{c}^{2});TPC #chi^{2}/N_{cls} of leading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {1000, 0.0, 100.0}}); - QC.add("QC/tracks/2D/mass/leading/hTpcNClsVsM", ";m (GeV/#it{c}^{2});TPC N_{cls} of leading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {200, 0.0, 200.0}}); - QC.add("QC/tracks/2D/mass/leading/hTpcNClsCrossedRowsVsM", ";m (GeV/#it{c}^{2});TPC crossed rows of leading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {200, 0.0, 200.0}}); - QC.add("QC/tracks/2D/mass/leading/hTpcNClsCrossedRowsOverTpcNClsFindableVsM", ";m (GeV/#it{c}^{2});TPC crossed rows / TPC N_{cls} findable of leading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {1000, 0.0, 10.0}}); - QC.add("QC/tracks/2D/mass/subleading/hItsNClsVsM", ";m (GeV/#it{c}^{2});ITS N_{cls} of subleading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {11, -0.5, 10.5}}); - QC.add("QC/tracks/2D/mass/subleading/hItsChi2NClVsM", ";m (GeV/#it{c}^{2});ITS #chi^{2}/N_{cls} of subleading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {1000, 0.0, 100.0}}); - QC.add("QC/tracks/2D/mass/subleading/hTpcChi2NClVsM", ";m (GeV/#it{c}^{2});TPC #chi^{2}/N_{cls} of subleading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {1000, 0.0, 100.0}}); - QC.add("QC/tracks/2D/mass/subleading/hTpcNClsVsM", ";m (GeV/#it{c}^{2});TPC N_{cls} of subleading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {200, 0.0, 200.0}}); - QC.add("QC/tracks/2D/mass/subleading/hTpcNClsCrossedRowsVsM", ";m (GeV/#it{c}^{2});TPC crossed rows of subleading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {200, 0.0, 200.0}}); - QC.add("QC/tracks/2D/mass/subleading/hTpcNClsCrossedRowsOverTpcNClsFindableVsM", ";m (GeV/#it{c}^{2});TPC crossed rows / TPC N_{cls} findable of subleading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {1000, 0.0, 10.0}}); - // track quality selections vs system rapidity - QC.add("QC/tracks/2D/rapidity/leading/hItsNClsVsY", ";y;ITS N_{cls} of leading-#it{p} track;counts", kTH2D, {{180, -0.9, 0.9}, {11, -0.5, 10.5}}); - QC.add("QC/tracks/2D/rapidity/leading/hItsChi2NClVsY", ";y;ITS #chi^{2}/N_{cls} of leading-#it{p} track;counts", kTH2D, {{180, -0.9, 0.9}, {1000, 0.0, 100.0}}); - QC.add("QC/tracks/2D/rapidity/leading/hTpcChi2NClVsY", ";y;TPC #chi^{2}/N_{cls} of leading-#it{p} track;counts", kTH2D, {{180, -0.9, 0.9}, {1000, 0.0, 100.0}}); - QC.add("QC/tracks/2D/rapidity/leading/hTpcNClsVsY", ";y;TPC N_{cls} of leading-#it{p} track;counts", kTH2D, {{180, -0.9, 0.9}, {200, 0.0, 200.0}}); - QC.add("QC/tracks/2D/rapidity/leading/hTpcNClsCrossedRowsVsY", ";y;TPC crossed rows of leading-#it{p} track;counts", kTH2D, {{180, -0.9, 0.9}, {200, 0.0, 200.0}}); - QC.add("QC/tracks/2D/rapidity/leading/hTpcNClsCrossedRowsOverTpcNClsFindableVsY", ";y;TPC crossed rows / TPC N_{cls} findable of leading-#it{p} track;counts", kTH2D, {{180, -0.9, 0.9}, {1000, 0.0, 10.0}}); - QC.add("QC/tracks/2D/rapidity/subleading/hItsNClsVsY", ";y;ITS N_{cls} of subleading-#it{p} track;counts", kTH2D, {{180, -0.9, 0.9}, {11, -0.5, 10.5}}); - QC.add("QC/tracks/2D/rapidity/subleading/hItsChi2NClVsY", ";y;ITS #chi^{2}/N_{cls} of subleading-#it{p} track;counts", kTH2D, {{180, -0.9, 0.9}, {1000, 0.0, 100.0}}); - QC.add("QC/tracks/2D/rapidity/subleading/hTpcChi2NClVsY", ";y;TPC #chi^{2}/N_{cls} of subleading-#it{p} track;counts", kTH2D, {{180, -0.9, 0.9}, {1000, 0.0, 100.0}}); - QC.add("QC/tracks/2D/rapidity/subleading/hTpcNClsVsY", ";y;TPC N_{cls} of subleading-#it{p} track;counts", kTH2D, {{180, -0.9, 0.9}, {200, 0.0, 200.0}}); - QC.add("QC/tracks/2D/rapidity/subleading/hTpcNClsCrossedRowsVsY", ";y;TPC crossed rows of subleading-#it{p} track;counts", kTH2D, {{180, -0.9, 0.9}, {200, 0.0, 200.0}}); - QC.add("QC/tracks/2D/rapidity/subleading/hTpcNClsCrossedRowsOverTpcNClsFindableVsY", ";y;TPC crossed rows / TPC N_{cls} findable of subleading-#it{p} track;counts", kTH2D, {{180, -0.9, 0.9}, {1000, 0.0, 10.0}}); - // track quality selections vs system pT - QC.add("QC/tracks/2D/pT/leading/hItsNClsVsPt", ";p_{T} (GeV/#it{c});ITS N_{cls} of leading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {11, -0.5, 10.5}}); - QC.add("QC/tracks/2D/pT/leading/hItsChi2NClVsPt", ";p_{T} (GeV/#it{c});ITS #chi^{2}/N_{cls} of leading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {1000, 0.0, 100.0}}); - QC.add("QC/tracks/2D/pT/leading/hTpcChi2NClVsPt", ";p_{T} (GeV/#it{c});TPC #chi^{2}/N_{cls} of leading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {1000, 0.0, 100.0}}); - QC.add("QC/tracks/2D/pT/leading/hTpcNClsVsPt", ";p_{T} (GeV/#it{c});TPC N_{cls} of leading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {200, 0.0, 200.0}}); - QC.add("QC/tracks/2D/pT/leading/hTpcNClsCrossedRowsVsPt", ";p_{T} (GeV/#it{c});TPC crossed rows of leading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {200, 0.0, 200.0}}); - QC.add("QC/tracks/2D/pT/leading/hTpcNClsCrossedRowsOverTpcNClsFindableVsPt", ";p_{T} (GeV/#it{c});TPC crossed rows / TPC N_{cls} findable of leading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {1000, 0.0, 10.0}}); - QC.add("QC/tracks/2D/pT/subleading/hItsNClsVsPt", ";p_{T} (GeV/#it{c});ITS N_{cls} of subleading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {11, -0.5, 10.5}}); - QC.add("QC/tracks/2D/pT/subleading/hItsChi2NClVsPt", ";p_{T} (GeV/#it{c});ITS #chi^{2}/N_{cls} of subleading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {1000, 0.0, 100.0}}); - QC.add("QC/tracks/2D/pT/subleading/hTpcChi2NClVsPt", ";p_{T} (GeV/#it{c});TPC #chi^{2}/N_{cls} of subleading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {1000, 0.0, 100.0}}); - QC.add("QC/tracks/2D/pT/subleading/hTpcNClsVsPt", ";p_{T} (GeV/#it{c});TPC N_{cls} of subleading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {200, 0.0, 200.0}}); - QC.add("QC/tracks/2D/pT/subleading/hTpcNClsCrossedRowsVsPt", ";p_{T} (GeV/#it{c});TPC crossed rows of subleading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {200, 0.0, 200.0}}); - QC.add("QC/tracks/2D/pT/subleading/hTpcNClsCrossedRowsOverTpcNClsFindableVsPt", ";p_{T} (GeV/#it{c});TPC crossed rows / TPC N_{cls} findable of subleading-#it{p} track;counts", kTH2D, {{1000, 0.0, 10.0}, {1000, 0.0, 10.0}}); - // tracks passing selections + QC.add("QC/tracks/raw/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {{1000, 0.0, 10.0}}); + QC.add("QC/tracks/raw/hEta", ";y;counts", kTH1D, {{180, -0.9, 0.9}}); + QC.add("QC/tracks/raw/hPhi", ";#phi;counts", kTH1D, {{180, 0.0, o2::constants::math::TwoPI}}); // tracks passing selections QC.add("QC/tracks/cut/hTpcNSigmaPi2D", ";TPC n#sigma(#pi_{leading});TPC n#sigma(#pi_{subleading});counts", kTH2D, {{400, -10.0, 30.0}, {400, -10.0, 30.0}}); QC.add("QC/tracks/cut/hTpcNSigmaEl2D", ";TPC n#sigma(e_{leading});TPC n#sigma(e_{subleading});counts", kTH2D, {{400, -10.0, 30.0}, {400, -10.0, 30.0}}); QC.add("QC/tracks/cut/hTpcSignalVsP", ";p (GeV/#it{c});TPC signal;counts", kTH2D, {ptAxis, {500, 0.0, 500.0}}); @@ -168,8 +193,8 @@ struct upcRhoAnalysis { QC.add("QC/tracks/cut/hRemainingTracks", ";remaining tracks;counts", kTH1D, {{21, -0.5, 20.5}}); QC.add("QC/tracks/cut/hDcaXYZ", ";DCA_{z} (cm);DCA_{xy} (cm);counts", kTH2D, {{1000, -5.0, 5.0}, {1000, -5.0, 5.0}}); // selection counter - std::vector selectionCounterLabels = {"all tracks", "PV contributor", "ITS hit", "ITS N_{clusters}", "ITS #chi^{2}/N_{clusters}", "TPC hit", "TPC N_{clusters}", "TPC #chi^{2}/N_{clusters}", "TPC crossed rows", - "TPC crossed rows/N_{clusters}" + std::vector selectionCounterLabels = {"all tracks", "PV contributor", "ITS hit", "ITS N_{clusters}", "ITS #chi^{2}/N_{clusters}", "TPC hit", "TPC N_{clusters} found", "TPC #chi^{2}/N_{clusters}", "TPC crossed rows", + "TPC crossed rows/N_{clusters}", "TOF requirement", "p_{T}", "DCA", "#eta", "exactly 2 tracks", "PID"}; auto hSelectionCounter = QC.add("QC/tracks/hSelectionCounter", ";;counts", kTH1D, {{static_cast(selectionCounterLabels.size()), -0.5, static_cast(selectionCounterLabels.size()) - 0.5}}); @@ -410,13 +435,26 @@ struct upcRhoAnalysis { MC.add("MC/QC/hProducedByGenerator", ";produced by generator;counts", kTH1D, {{2, -0.5, 1.5}}); MC.add("MC/QC/hNPions", ";number of pions;counts", kTH1D, {{11, -0.5, 10.5}}); - MC.add("MC/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); - MC.add("MC/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); - MC.add("MC/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); - MC.add("MC/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mAxis, ptAxis}); - MC.add("MC/hY", ";y;counts", kTH1D, {yAxis}); - MC.add("MC/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); - MC.add("MC/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); + MC.add("MC/tracks/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + MC.add("MC/tracks/hEta", ";#eta;counts", kTH1D, {etaAxis}); + MC.add("MC/tracks/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + + MC.add("MC/system/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); + MC.add("MC/system/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + MC.add("MC/system/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); + MC.add("MC/system/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mAxis, ptAxis}); + MC.add("MC/system/hY", ";y;counts", kTH1D, {yAxis}); + MC.add("MC/system/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); + MC.add("MC/system/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); + + // 4 pi QA + FourPiQA.add("FourPiQA/tracks/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + FourPiQA.add("FourPiQA/tracks/hEta", ";#eta;counts", kTH1D, {etaAxis}); + FourPiQA.add("FourPiQA/tracks/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + FourPiQA.add("FourPiQA/system/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); + FourPiQA.add("FourPiQA/system/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + FourPiQA.add("FourPiQA/system/hY", ";y;counts", kTH1D, {yAxis}); + FourPiQA.add("FourPiQA/system/hPhi", ";#phi;counts", kTH1D, {phiAxis}); } template @@ -540,7 +578,7 @@ struct upcRhoAnalysis { template double getPhiChargeMC(const T& cutTracks, const std::vector& cutTracks4Vecs) - { // two possible definitions of phi: charge-based assignment + { // the same as for data but using pdg code instead of charge TLorentzVector pOne, pTwo; pOne = (cutTracks[0].pdgCode() > 0) ? cutTracks4Vecs[0] : cutTracks4Vecs[1]; pTwo = (cutTracks[0].pdgCode() > 0) ? cutTracks4Vecs[1] : cutTracks4Vecs[0]; @@ -553,12 +591,23 @@ struct upcRhoAnalysis { void processReco(C const& collision, T const& tracks) { // QC histograms - QC.fill(HIST("QC/collisions/hPosXY"), collision.posX(), collision.posY()); - QC.fill(HIST("QC/collisions/hPosZ"), collision.posZ()); - QC.fill(HIST("QC/collisions/hZdcCommonEnergy"), collision.energyCommonZNA(), collision.energyCommonZNC()); - QC.fill(HIST("QC/collisions/hZdcTime"), collision.timeZNA(), collision.timeZNC()); - QC.fill(HIST("QC/collisions/hNumContrib"), collision.numContrib()); - + QC.fill(HIST("QC/collisions/all/hPosXY"), collision.posX(), collision.posY()); + QC.fill(HIST("QC/collisions/all/hPosZ"), collision.posZ()); + QC.fill(HIST("QC/collisions/all/hZdcCommonEnergy"), collision.energyCommonZNA(), collision.energyCommonZNC()); + QC.fill(HIST("QC/collisions/all/hZdcTime"), collision.timeZNA(), collision.timeZNC()); + QC.fill(HIST("QC/collisions/all/hNumContrib"), collision.numContrib()); + QC.fill(HIST("QC/collisions/all/hTotalFT0AmplitudeA"), collision.totalFT0AmplitudeA()); + QC.fill(HIST("QC/collisions/all/hTotalFT0AmplitudeC"), collision.totalFT0AmplitudeC()); + QC.fill(HIST("QC/collisions/all/hTotalFV0AmplitudeA"), collision.totalFV0AmplitudeA()); + QC.fill(HIST("QC/collisions/all/hTotalFDDAmplitudeA"), collision.totalFDDAmplitudeA()); + QC.fill(HIST("QC/collisions/all/hTotalFDDAmplitudeC"), collision.totalFDDAmplitudeC()); + QC.fill(HIST("QC/collisions/all/hTimeFT0A"), collision.timeFT0A()); + QC.fill(HIST("QC/collisions/all/hTimeFT0C"), collision.timeFT0C()); + QC.fill(HIST("QC/collisions/all/hTimeFV0A"), collision.timeFV0A()); + QC.fill(HIST("QC/collisions/all/hTimeFDDA"), collision.timeFDDA()); + QC.fill(HIST("QC/collisions/all/hTimeFDDC"), collision.timeFDDC()); + + // vertex z-position cut if (std::abs(collision.posZ()) > collisionsPosZMaxCut) return; @@ -586,9 +635,11 @@ struct upcRhoAnalysis { std::vector cutTracks; std::vector cutTracks4Vecs; - int trackCounter = 0; for (const auto& track : tracks) { // double p = momentum(track.px(), track.py(), track.pz()); + QC.fill(HIST("QC/tracks/raw/hPt"), track.pt()); + QC.fill(HIST("QC/tracks/raw/hEta"), eta(track.px(), track.py(), track.pz())); + QC.fill(HIST("QC/tracks/raw/hPhi"), phi(track.px(), track.py())); QC.fill(HIST("QC/tracks/raw/hTpcNSigmaPi"), track.tpcNSigmaPi()); QC.fill(HIST("QC/tracks/raw/hTofNSigmaPi"), track.tofNSigmaPi()); QC.fill(HIST("QC/tracks/raw/hTpcNSigmaEl"), track.tpcNSigmaEl()); @@ -596,13 +647,13 @@ struct upcRhoAnalysis { QC.fill(HIST("QC/tracks/raw/hItsNCls"), track.itsNCls()); QC.fill(HIST("QC/tracks/raw/hItsChi2NCl"), track.itsChi2NCl()); QC.fill(HIST("QC/tracks/raw/hTpcChi2NCl"), track.tpcChi2NCl()); - QC.fill(HIST("QC/tracks/raw/hTpcNCls"), track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()); + QC.fill(HIST("QC/tracks/raw/hTpcNCls"), (track.tpcNClsFindable() - track.tpcNClsFindableMinusFound())); QC.fill(HIST("QC/tracks/raw/hTpcNClsCrossedRows"), track.tpcNClsCrossedRows()); QC.fill(HIST("QC/tracks/hSelectionCounter"), 0); if (!trackPassesCuts(track)) continue; - trackCounter++; + cutTracks.push_back(track); TLorentzVector track4Vec; track4Vec.SetXYZM(track.px(), track.py(), track.pz(), o2::constants::physics::MassPionCharged); // apriori assume pion mass @@ -611,25 +662,39 @@ struct upcRhoAnalysis { QC.fill(HIST("QC/tracks/cut/hTpcSignalVsPt"), track.pt(), track.tpcSignal()); QC.fill(HIST("QC/tracks/cut/hDcaXYZ"), track.dcaZ(), track.dcaXY()); } - QC.fill(HIST("QC/tracks/cut/hRemainingTracks"), trackCounter); - - if (cutTracks.size() != cutTracks4Vecs.size()) { + QC.fill(HIST("QC/tracks/cut/hRemainingTracks"), cutTracks.size()); + if (cutTracks.size() != cutTracks4Vecs.size()) { // sanity check LOG(error); return; } + if (cutTracks.size() == 4) { + // fill out some 4pi QC histograms + for (int i = 0; i < static_cast(cutTracks.size()); i++) { + FourPiQA.fill(HIST("FourPiQA/tracks/hPt"), cutTracks[i].pt()); + FourPiQA.fill(HIST("FourPiQA/tracks/hEta"), eta(cutTracks[i].px(), cutTracks[i].py(), cutTracks[i].pz())); + FourPiQA.fill(HIST("FourPiQA/tracks/hPhi"), phi(cutTracks[i].px(), cutTracks[i].py())); + } + TLorentzVector system = reconstructSystem(cutTracks4Vecs); + FourPiQA.fill(HIST("FourPiQA/system/hM"), system.M()); + FourPiQA.fill(HIST("FourPiQA/system/hPt"), system.Pt()); + FourPiQA.fill(HIST("FourPiQA/system/hY"), system.Rapidity()); + FourPiQA.fill(HIST("FourPiQA/system/hPhi"), system.Phi()); + } + + // further consider only two pion systems if (cutTracks.size() != 2) return; for (int i = 0; i < static_cast(cutTracks.size()); i++) QC.fill(HIST("QC/tracks/hSelectionCounter"), 14); QC.fill(HIST("QC/tracks/cut/hTpcNSigmaPi2D"), cutTracks[0].tpcNSigmaPi(), cutTracks[1].tpcNSigmaPi()); + QC.fill(HIST("QC/tracks/cut/hTpcNSigmaEl2D"), cutTracks[0].tpcNSigmaEl(), cutTracks[1].tpcNSigmaEl()); if (!tracksPassPiPID(cutTracks)) return; for (int i = 0; i < static_cast(cutTracks.size()); i++) QC.fill(HIST("QC/tracks/hSelectionCounter"), 15); - QC.fill(HIST("QC/tracks/cut/hTpcNSigmaEl2D"), cutTracks[0].tpcNSigmaEl(), cutTracks[1].tpcNSigmaEl()); // reonstruct system and calculate total charge, save commonly used values into variables TLorentzVector system = reconstructSystem(cutTracks4Vecs); @@ -640,6 +705,7 @@ struct upcRhoAnalysis { double rapidity = system.Rapidity(); double phiRandom = getPhiRandom(cutTracks4Vecs); double phiCharge = getPhiCharge(cutTracks, cutTracks4Vecs); + // differentiate leading- and subleading-momentum tracks auto leadingMomentumTrack = momentum(cutTracks[0].px(), cutTracks[0].py(), cutTracks[0].pz()) > momentum(cutTracks[1].px(), cutTracks[1].py(), cutTracks[1].pz()) ? cutTracks[0] : cutTracks[1]; auto subleadingMomentumTrack = (leadingMomentumTrack == cutTracks[0]) ? cutTracks[1] : cutTracks[0]; @@ -660,48 +726,21 @@ struct upcRhoAnalysis { tofClass = 2; else if (leadingMomentumTrack.hasTOF() && subleadingMomentumTrack.hasTOF()) tofClass = 3; - // fill 2D track QC histograms - // mass - QC.fill(HIST("QC/tracks/2D/mass/leading/hItsNClsVsM"), mass, leadingMomentumTrack.itsNCls()); - QC.fill(HIST("QC/tracks/2D/mass/leading/hItsChi2NClVsM"), mass, leadingMomentumTrack.itsChi2NCl()); - QC.fill(HIST("QC/tracks/2D/mass/leading/hTpcChi2NClVsM"), mass, leadingMomentumTrack.tpcChi2NCl()); - QC.fill(HIST("QC/tracks/2D/mass/leading/hTpcNClsVsM"), mass, leadingMomentumTrack.tpcNClsFindable() - leadingMomentumTrack.tpcNClsFindableMinusFound()); - QC.fill(HIST("QC/tracks/2D/mass/leading/hTpcNClsCrossedRowsVsM"), mass, leadingMomentumTrack.tpcNClsCrossedRows()); - QC.fill(HIST("QC/tracks/2D/mass/leading/hTpcNClsCrossedRowsOverTpcNClsFindableVsM"), mass, (static_cast(leadingMomentumTrack.tpcNClsCrossedRows()) / static_cast(leadingMomentumTrack.tpcNClsFindable()))); - QC.fill(HIST("QC/tracks/2D/mass/subleading/hItsNClsVsM"), mass, subleadingMomentumTrack.itsNCls()); - QC.fill(HIST("QC/tracks/2D/mass/subleading/hItsChi2NClVsM"), mass, subleadingMomentumTrack.itsChi2NCl()); - QC.fill(HIST("QC/tracks/2D/mass/subleading/hTpcChi2NClVsM"), mass, subleadingMomentumTrack.tpcChi2NCl()); - QC.fill(HIST("QC/tracks/2D/mass/subleading/hTpcNClsVsM"), mass, subleadingMomentumTrack.tpcNClsFindable() - subleadingMomentumTrack.tpcNClsFindableMinusFound()); - QC.fill(HIST("QC/tracks/2D/mass/subleading/hTpcNClsCrossedRowsVsM"), mass, subleadingMomentumTrack.tpcNClsCrossedRows()); - QC.fill(HIST("QC/tracks/2D/mass/subleading/hTpcNClsCrossedRowsOverTpcNClsFindableVsM"), mass, (static_cast(subleadingMomentumTrack.tpcNClsCrossedRows()) / static_cast(subleadingMomentumTrack.tpcNClsFindable()))); - // rapidity - QC.fill(HIST("QC/tracks/2D/rapidity/leading/hItsNClsVsY"), rapidity, leadingMomentumTrack.itsNCls()); - QC.fill(HIST("QC/tracks/2D/rapidity/leading/hItsChi2NClVsY"), rapidity, leadingMomentumTrack.itsChi2NCl()); - QC.fill(HIST("QC/tracks/2D/rapidity/leading/hTpcChi2NClVsY"), rapidity, leadingMomentumTrack.tpcChi2NCl()); - QC.fill(HIST("QC/tracks/2D/rapidity/leading/hTpcNClsVsY"), rapidity, leadingMomentumTrack.tpcNClsFindable() - leadingMomentumTrack.tpcNClsFindableMinusFound()); - QC.fill(HIST("QC/tracks/2D/rapidity/leading/hTpcNClsCrossedRowsVsY"), rapidity, leadingMomentumTrack.tpcNClsCrossedRows()); - QC.fill(HIST("QC/tracks/2D/rapidity/leading/hTpcNClsCrossedRowsOverTpcNClsFindableVsY"), rapidity, (static_cast(leadingMomentumTrack.tpcNClsCrossedRows()) / static_cast(leadingMomentumTrack.tpcNClsFindable()))); - QC.fill(HIST("QC/tracks/2D/rapidity/subleading/hItsNClsVsY"), rapidity, subleadingMomentumTrack.itsNCls()); - QC.fill(HIST("QC/tracks/2D/rapidity/subleading/hItsChi2NClVsY"), rapidity, subleadingMomentumTrack.itsChi2NCl()); - QC.fill(HIST("QC/tracks/2D/rapidity/subleading/hTpcChi2NClVsY"), rapidity, subleadingMomentumTrack.tpcChi2NCl()); - QC.fill(HIST("QC/tracks/2D/rapidity/subleading/hTpcNClsVsY"), rapidity, subleadingMomentumTrack.tpcNClsFindable() - subleadingMomentumTrack.tpcNClsFindableMinusFound()); - QC.fill(HIST("QC/tracks/2D/rapidity/subleading/hTpcNClsCrossedRowsVsY"), rapidity, subleadingMomentumTrack.tpcNClsCrossedRows()); - QC.fill(HIST("QC/tracks/2D/rapidity/subleading/hTpcNClsCrossedRowsOverTpcNClsFindableVsY"), rapidity, (static_cast(subleadingMomentumTrack.tpcNClsCrossedRows()) / static_cast(subleadingMomentumTrack.tpcNClsFindable()))); - // pT - QC.fill(HIST("QC/tracks/2D/pT/leading/hItsNClsVsPt"), pT, leadingMomentumTrack.itsNCls()); - QC.fill(HIST("QC/tracks/2D/pT/leading/hItsChi2NClVsPt"), pT, leadingMomentumTrack.itsChi2NCl()); - QC.fill(HIST("QC/tracks/2D/pT/leading/hTpcChi2NClVsPt"), pT, leadingMomentumTrack.tpcChi2NCl()); - QC.fill(HIST("QC/tracks/2D/pT/leading/hTpcNClsVsPt"), pT, leadingMomentumTrack.tpcNClsFindable() - leadingMomentumTrack.tpcNClsFindableMinusFound()); - QC.fill(HIST("QC/tracks/2D/pT/leading/hTpcNClsCrossedRowsVsPt"), pT, leadingMomentumTrack.tpcNClsCrossedRows()); - QC.fill(HIST("QC/tracks/2D/pT/leading/hTpcNClsCrossedRowsOverTpcNClsFindableVsPt"), pT, (static_cast(leadingMomentumTrack.tpcNClsCrossedRows()) / static_cast(leadingMomentumTrack.tpcNClsFindable()))); - QC.fill(HIST("QC/tracks/2D/pT/subleading/hItsNClsVsPt"), pT, subleadingMomentumTrack.itsNCls()); - QC.fill(HIST("QC/tracks/2D/pT/subleading/hItsChi2NClVsPt"), pT, subleadingMomentumTrack.itsChi2NCl()); - QC.fill(HIST("QC/tracks/2D/pT/subleading/hTpcChi2NClVsPt"), pT, subleadingMomentumTrack.tpcChi2NCl()); - QC.fill(HIST("QC/tracks/2D/pT/subleading/hTpcNClsVsPt"), pT, subleadingMomentumTrack.tpcNClsFindable() - subleadingMomentumTrack.tpcNClsFindableMinusFound()); - QC.fill(HIST("QC/tracks/2D/pT/subleading/hTpcNClsCrossedRowsVsPt"), pT, subleadingMomentumTrack.tpcNClsCrossedRows()); - QC.fill(HIST("QC/tracks/2D/pT/subleading/hTpcNClsCrossedRowsOverTpcNClsFindableVsPt"), pT, (static_cast(subleadingMomentumTrack.tpcNClsCrossedRows()) / static_cast(subleadingMomentumTrack.tpcNClsFindable()))); + // fill tree - systemTree(collision.runNumber(), neutronClass, tofClass, totalCharge, mass, pT, rapidity, phiRandom, phiCharge, system.PseudoRapidity(), system.Phi()); + std::vector trackSigns = {leadingMomentumTrack.sign(), subleadingMomentumTrack.sign()}; + std::vector trackPts = {leadingPt, subleadingPt}; + std::vector trackEtas = {leadingEta, subleadingEta}; + std::vector trackPhis = {leadingPhi, subleadingPhi}; + std::vector trackMs = {o2::constants::physics::MassPionCharged, o2::constants::physics::MassPionCharged}; + std::vector trackPiPIDs = {leadingMomentumTrack.tpcNSigmaPi(), subleadingMomentumTrack.tpcNSigmaPi()}; + std::vector trackElPIDs = {leadingMomentumTrack.tpcNSigmaEl(), subleadingMomentumTrack.tpcNSigmaEl()}; + std::vector trackDcaXYs = {leadingMomentumTrack.dcaXY(), subleadingMomentumTrack.dcaXY()}; + std::vector trackDcaZs = {leadingMomentumTrack.dcaZ(), subleadingMomentumTrack.dcaZ()}; + std::vector trackTpcSignals = {leadingMomentumTrack.tpcSignal(), subleadingMomentumTrack.tpcSignal()}; + Tree(collision.runNumber(), collision.globalBC(), collision.numContrib(), collision.posX(), collision.posY(), collision.posZ(), collision.totalFT0AmplitudeA(), collision.totalFT0AmplitudeC(), collision.totalFV0AmplitudeA(), collision.totalFDDAmplitudeA(), collision.totalFDDAmplitudeC(), collision.timeFT0A(), collision.timeFT0C(), collision.timeFV0A(), collision.timeFDDA(), collision.timeFDDC(), collision.energyCommonZNA(), collision.energyCommonZNC(), collision.timeZNA(), collision.timeZNC(), neutronClass, + totalCharge, pT, system.Eta(), system.Phi(), mass, phiRandom, phiCharge, + trackSigns, trackPts, trackEtas, trackPhis, trackMs, trackPiPIDs, trackElPIDs, trackDcaXYs, trackDcaZs, trackTpcSignals, tofClass); // fill raw histograms according to the total charge switch (totalCharge) { case 0: @@ -742,6 +781,22 @@ struct upcRhoAnalysis { if (!systemPassCuts(system)) return; + QC.fill(HIST("QC/collisions/selected/hPosXY"), collision.posX(), collision.posY()); + QC.fill(HIST("QC/collisions/selected/hPosZ"), collision.posZ()); + QC.fill(HIST("QC/collisions/selected/hZdcCommonEnergy"), collision.energyCommonZNA(), collision.energyCommonZNC()); + QC.fill(HIST("QC/collisions/selected/hZdcTime"), collision.timeZNA(), collision.timeZNC()); + QC.fill(HIST("QC/collisions/selected/hNumContrib"), collision.numContrib()); + QC.fill(HIST("QC/collisions/selected/hTotalFT0AmplitudeA"), collision.totalFT0AmplitudeA()); + QC.fill(HIST("QC/collisions/selected/hTotalFT0AmplitudeC"), collision.totalFT0AmplitudeC()); + QC.fill(HIST("QC/collisions/selected/hTotalFV0AmplitudeA"), collision.totalFV0AmplitudeA()); + QC.fill(HIST("QC/collisions/selected/hTotalFDDAmplitudeA"), collision.totalFDDAmplitudeA()); + QC.fill(HIST("QC/collisions/selected/hTotalFDDAmplitudeC"), collision.totalFDDAmplitudeC()); + QC.fill(HIST("QC/collisions/selected/hTimeFT0A"), collision.timeFT0A()); + QC.fill(HIST("QC/collisions/selected/hTimeFT0C"), collision.timeFT0C()); + QC.fill(HIST("QC/collisions/selected/hTimeFV0A"), collision.timeFV0A()); + QC.fill(HIST("QC/collisions/selected/hTimeFDDA"), collision.timeFDDA()); + QC.fill(HIST("QC/collisions/selected/hTimeFDDC"), collision.timeFDDC()); + // fill histograms for system passing cuts switch (totalCharge) { case 0: @@ -968,9 +1023,10 @@ struct upcRhoAnalysis { for (auto const& mcParticle : mcParticles) { MC.fill(HIST("MC/QC/hPdgCode"), mcParticle.pdgCode()); MC.fill(HIST("MC/QC/hProducedByGenerator"), mcParticle.producedByGenerator()); - if (!mcParticle.producedByGenerator()) - continue; - if (std::abs(mcParticle.pdgCode()) != 211) + MC.fill(HIST("MC/tracks/hPt"), std::sqrt(mcParticle.px() * mcParticle.px() + mcParticle.py() * mcParticle.py())); + MC.fill(HIST("MC/tracks/hEta"), eta(mcParticle.px(), mcParticle.py(), mcParticle.pz())); + MC.fill(HIST("MC/tracks/hPhi"), phi(mcParticle.px(), mcParticle.py())); + if (!mcParticle.producedByGenerator() || std::abs(mcParticle.pdgCode()) != 211) continue; cutMcParticles.push_back(mcParticle); TLorentzVector pion4Vec; @@ -979,9 +1035,9 @@ struct upcRhoAnalysis { } MC.fill(HIST("MC/QC/hNPions"), cutMcParticles.size()); - if (mcParticles4Vecs.size() != cutMcParticles.size()) + if (mcParticles4Vecs.size() != 2 || cutMcParticles.size() != 2) return; - if (mcParticles4Vecs.size() != 2) + if (cutMcParticles[0].pdgCode() * cutMcParticles[1].pdgCode() > 0) // unlike-sign return; TLorentzVector system = mcParticles4Vecs[0] + mcParticles4Vecs[1]; @@ -995,13 +1051,13 @@ struct upcRhoAnalysis { if (std::abs(rapidity) > systemYCut) return; - MC.fill(HIST("MC/hM"), mass); - MC.fill(HIST("MC/hPt"), pT); - MC.fill(HIST("MC/hPtVsM"), mass, pT); - MC.fill(HIST("MC/hPt2"), pTsquare); - MC.fill(HIST("MC/hY"), rapidity); - MC.fill(HIST("MC/hPhiRandom"), phiRandom); - MC.fill(HIST("MC/hPhiCharge"), phiCharge); + MC.fill(HIST("MC/system/hM"), mass); + MC.fill(HIST("MC/system/hPt"), pT); + MC.fill(HIST("MC/system/hPtVsM"), mass, pT); + MC.fill(HIST("MC/system/hPt2"), pTsquare); + MC.fill(HIST("MC/system/hY"), rapidity); + MC.fill(HIST("MC/system/hPhiRandom"), phiRandom); + MC.fill(HIST("MC/system/hPhiCharge"), phiCharge); } void processSGdata(FullUdSgCollision const& collision, FullUdTracks const& tracks) From 42af7342580962e517bd92e89b148dde1af1c413 Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Thu, 28 Nov 2024 21:52:38 +0100 Subject: [PATCH 164/459] [PWGCF] initial commit for d0 flow with EP (#8671) Co-authored-by: junleekim Co-authored-by: ALICE Action Bot --- PWGCF/JCorran/Tasks/CMakeLists.txt | 5 + PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx | 222 +++++++++++++++++++ 2 files changed, 227 insertions(+) create mode 100644 PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx diff --git a/PWGCF/JCorran/Tasks/CMakeLists.txt b/PWGCF/JCorran/Tasks/CMakeLists.txt index 18284bd2f4c..31fc41e4c6d 100644 --- a/PWGCF/JCorran/Tasks/CMakeLists.txt +++ b/PWGCF/JCorran/Tasks/CMakeLists.txt @@ -33,3 +33,8 @@ o2physics_add_dpl_workflow(epflow-analysis SOURCES jEPFlowAnalysis.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::JCorran COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(epdzeroflow-analysis + SOURCES jEPDzeroFlowAnalysis.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore + COMPONENT_NAME Analysis) diff --git a/PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx b/PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx new file mode 100644 index 00000000000..c669dcf7cc1 --- /dev/null +++ b/PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx @@ -0,0 +1,222 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// \author junlee.kim@cern.ch +/// \since Jul 2024 + +#include +#include +#include +#include +#include +#include +#include + +#include "TLorentzVector.h" +#include "TRandom3.h" +#include "TF1.h" +#include "TVector2.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "Math/GenVector/Boost.h" +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/StaticFor.h" + +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Qvectors.h" + +#include "Common/Core/trackUtilities.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/EventPlaneHelper.h" + +#include "CommonConstants/PhysicsConstants.h" + +#include "ReconstructionDataFormats/Track.h" + +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" + +#include "CCDB/CcdbApi.h" +#include "CCDB/BasicCCDBManager.h" + +#include "PWGCF/DataModel/CorrelationsDerived.h" + +using namespace std; +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; +using namespace o2::constants::physics; + +struct jEPDzeroFlowAnalysis { + enum { + kFT0C = 0, + kFT0A = 1, + kFT0M, + kFV0A, + kTPCpos, + kTPCneg, + kTPCall + }; + + using MyCollisions = soa::Join; + HistogramRegistry histos{ + "histos", + {}, + OutputObjHandlingPolicy::AnalysisObject}; + + Configurable cfgCentSel{"cfgCentSel", 80., "Centrality selection"}; + Configurable cfgCentEst{"cfgCentEst", "FT0C", "Centrality estimator; FT0M or FT0C available"}; + + Configurable cfgPVSel{"cfgPVSel", false, "Additional PV selection flag for syst"}; + Configurable cfgPV{"cfgPV", 8.0, "Additional PV selection range for syst"}; + Configurable cfgAddEvtSelPileup{"cfgAddEvtSelPileup", false, "flag for additional pileup selection"}; + Configurable cfgMaxOccupancy{"cfgMaxOccupancy", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + Configurable cfgMinOccupancy{"cfgMinOccupancy", 0, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + + Configurable cfgnMods{"cfgnMods", 1, "The number of modulations of interest starting from 2"}; + Configurable cfgNQvec{"cfgNQvec", 7, "The number of total Qvectors for looping over the task"}; + + Configurable cfgEtaMax{"cfgEtaMax", 0.8, "eta selection"}; + Configurable cfgPtMin{"cfgPtMin", 0.0, "pt selection"}; + + Configurable cfgDetName{"cfgDetName", "FT0C", "The name of detector to be analyzed"}; + Configurable cfgRefAName{"cfgRefAName", "TPCPos", "The name of detector for reference A"}; + Configurable cfgRefBName{"cfgRefBName", "TPCNeg", "The name of detector for reference B"}; + + ConfigurableAxis massAxis{"massAxis", {175, 1.7, 2.05}, "Invariant mass axis"}; + ConfigurableAxis ptAxis{"ptAxis", {VARIABLE_WIDTH, 0.2, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.5, 8.0, 10.0, 100.0}, "Transverse momentum bins"}; + ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0, 10, 20, 30, 40, 50, 60, 70, 80, 100}, "Centrality interval"}; + ConfigurableAxis cosAxis{"cosAxis", {110, -1.05, 1.05}, "Cosine axis"}; + + // Filter track2pFilter = (nabs(aod::cf2prongtrack::eta) < cfgEtaMax) && (aod::cf2prongtrack::pt > cfgPtMin); + + EventPlaneHelper helperEP; + + int DetId; + int RefAId; + int RefBId; + + float centrality; + + template + using hasInvMass = decltype(std::declval().invMass()); + + template + int GetDetId(const T& name) + { + if (name.value == "FT0C") { + return kFT0C; + } else if (name.value == "FT0A") { + return kFT0A; + } else if (name.value == "FT0M") { + return kFT0M; + } else if (name.value == "FV0A") { + return kFV0A; + } else if (name.value == "TPCpos") { + return kTPCpos; + } else if (name.value == "TPCneg") { + return kTPCneg; + } else if (name.value == "TPCall") { + return kTPCall; + } else { + return 0; + } + } + + template + bool eventSelected(TCollision collision) + { + if (!collision.sel8()) { + return false; + } + if (cfgCentSel < centrality) { + return false; + } + if (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + if (!collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { + return false; + } + if (cfgPVSel && std::abs(collision.posZ()) > cfgPV) { + return false; + } + if (cfgAddEvtSelPileup && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + return false; + } + if (collision.trackOccupancyInTimeRange() > cfgMaxOccupancy || collision.trackOccupancyInTimeRange() < cfgMinOccupancy) { + return false; + } + return true; + } // event selection + + template + void fillHistosFlow(const CollType& coll, TrackType& trks) + { + if (coll.qvecAmp()[DetId] < 1e-4 || coll.qvecAmp()[RefAId] < 1e-4 || coll.qvecAmp()[RefBId] < 1e-4) { + return; + } + int DetInd = DetId * 4 + cfgNQvec * 4; + // int RefAInd = RefAId * 4 + cfgNQvec * 4; + // int RefBInd = RefBId * 4 + cfgNQvec * 4; + for (auto& trk : trks) { + histos.fill(HIST("hist_EP_cos_Det_v2"), trk.invMass(), trk.pt(), std::cos(2.0 * (trk.phi() - helperEP.GetEventPlane(coll.qvecRe()[DetInd + 3], coll.qvecIm()[DetInd + 3], 2))), centrality); + histos.fill(HIST("hist_EP_sin_Det_v2"), trk.invMass(), trk.pt(), std::sin(2.0 * (trk.phi() - helperEP.GetEventPlane(coll.qvecRe()[DetInd + 3], coll.qvecIm()[DetInd + 3], 2))), centrality); + } + } + + void init(InitContext const&) + { + DetId = GetDetId(cfgDetName); + RefAId = GetDetId(cfgRefAName); + RefBId = GetDetId(cfgRefBName); + + if (DetId == RefAId || DetId == RefBId || RefAId == RefBId) { + LOGF(fatal, "Wrong detector configuration \n set the systems correctly"); + DetId = 0; + RefAId = 4; + RefBId = 5; + } + + histos.add(Form("hist_EP_cos_Det_v2"), "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add(Form("hist_EP_cos_Det_v2"), "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + } + + void processData(MyCollisions::iterator const& collision, aod::CF2ProngTracks const& p2tracks) + { + if (cfgCentEst.value == "FT0C") { + centrality = collision.centFT0C(); + } else if (cfgCentEst.value == "FT0M") { + centrality = collision.centFT0M(); + } + if (!eventSelected(collision)) { + return; + } + fillHistosFlow(collision, p2tracks); + } + PROCESS_SWITCH(jEPDzeroFlowAnalysis, processData, "Process Event for data", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 4d71c1e2342104849f90b431b8230e4ff2c00bb6 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Thu, 28 Nov 2024 23:51:41 +0100 Subject: [PATCH 165/459] [PWGCF] DptDpt - Improved event selection tracking (#8722) Co-authored-by: Victor --- PWGCF/TableProducer/dptdptfilter.cxx | 139 +++++++++--------- PWGCF/TableProducer/dptdptfilter.h | 55 ++++--- PWGCF/Tasks/dptdptcorrelations.cxx | 6 +- PWGCF/Tasks/match-reco-gen.cxx | 6 +- .../Tasks/efficiencyAndQc.cxx | 12 +- 5 files changed, 123 insertions(+), 95 deletions(-) diff --git a/PWGCF/TableProducer/dptdptfilter.cxx b/PWGCF/TableProducer/dptdptfilter.cxx index a1faad494e3..a16d7737c84 100644 --- a/PWGCF/TableProducer/dptdptfilter.cxx +++ b/PWGCF/TableProducer/dptdptfilter.cxx @@ -9,6 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file dptdptfilter.cxx +/// \brief Filters collisions and tracks according to selection criteria +/// \author victor.gonzalez.sebastian@gmail.com + #include #include #include @@ -31,7 +35,6 @@ #include "Framework/runDataProcessing.h" #include "Framework/RunningWorkflowInfo.h" #include -#include #include #include #include @@ -90,6 +93,7 @@ const char* speciesName[kDptDptNoOfSpecies] = {"h", "e", "mu", "pi", "ka", "p"}; const char* speciesTitle[kDptDptNoOfSpecies] = {"", "e", "#mu", "#pi", "K", "p"}; const char* eventSelectionSteps[knCollisionSelectionFlags] = { + "IN", "MB", "INT7", "SEL7", @@ -101,7 +105,8 @@ const char* eventSelectionSteps[knCollisionSelectionFlags] = { "ISVERTEXTRDMATCHED", "OCCUPANCY", "CENTRALITY", - "ZVERTEX"}; + "ZVERTEX", + "SELECTED"}; //============================================================================================ // The DptDptFilter histogram objects @@ -187,24 +192,24 @@ using namespace dptdptfilter; ////////////////////////////////////////////////////////////////////////////// struct Multiplicity { - enum multest { + enum MultEst { kV0M, kCL1, kCL1GAP }; - float getMultiplicityClass() { return multiplicityclass; } + float getMultiplicityClass() { return multiplicityClass; } float getMultiplicity() { return multiplicity; } - multest classestimator = kV0M; + MultEst classestimator = kV0M; - float multiplicityclass = -1.0; + float multiplicityClass = -1.0; float multiplicity = 0.0; bool inelgth0 = false; - int V0AM = 0; - int V0CM = 0; - int CL1M = 0; - int CL1EtaGapM = 0; + int v0am = 0; + int v0cm = 0; + int cl1m = 0; + int cl1EtaGapM = 0; int dNchdEta = 0; int nPart = 0; TH1F* fhNPartTot = nullptr; ///< total number of particles analyzed @@ -269,11 +274,11 @@ struct Multiplicity { if (p.eta() < 1.0 && -1.0 < p.eta()) { inelgth0 = true; } - addTo(p, V0AM, 2.8, 5.1); - addTo(p, V0CM, -3.7, -1.7); - addTo(p, CL1M, -1.4, 1.4); - addTo(p, CL1EtaGapM, -1.4, -0.8); - addTo(p, CL1EtaGapM, 0.8, 1.4); + addTo(p, v0am, 2.8, 5.1); + addTo(p, v0cm, -3.7, -1.7); + addTo(p, cl1m, -1.4, 1.4); + addTo(p, cl1EtaGapM, -1.4, -0.8); + addTo(p, cl1EtaGapM, 0.8, 1.4); addTo(p, dNchdEta, -0.5, 0.5); nPart++; } @@ -287,17 +292,17 @@ struct Multiplicity { template void extractMultiplicity(const CollisionParticles& particles) { - multiplicityclass = 105; + multiplicityClass = 105; multiplicity = 0; inelgth0 = false; nPart = 0; - V0AM = 0; - V0CM = 0; - CL1M = 0; - CL1EtaGapM = 0; + v0am = 0; + v0cm = 0; + cl1m = 0; + cl1EtaGapM = 0; dNchdEta = 0; - for (auto particle : particles) { + for (auto const& particle : particles) { addParticleToMultiplicity(particle); } @@ -306,37 +311,37 @@ struct Multiplicity { fhNPartTot->Fill(nPart); } if (fhV0Multiplicity != nullptr) { - fhV0Multiplicity->Fill(V0AM + V0CM, dNchdEta); + fhV0Multiplicity->Fill(v0am + v0cm, dNchdEta); } if (fhCL1Multiplicity != nullptr) { - fhCL1Multiplicity->Fill(CL1M, dNchdEta); + fhCL1Multiplicity->Fill(cl1m, dNchdEta); } if (fhCL1EtaGapMultiplicity != nullptr) { - fhCL1EtaGapMultiplicity->Fill(CL1EtaGapM, dNchdEta); + fhCL1EtaGapMultiplicity->Fill(cl1EtaGapM, dNchdEta); } switch (classestimator) { case kV0M: if (fhV0MMultPercentile != nullptr) { - multiplicityclass = fhV0MMultPercentile->GetBinContent(fhV0MMultPercentile->FindFixBin(V0AM + V0CM)); - multiplicity = V0AM + V0CM; + multiplicityClass = fhV0MMultPercentile->GetBinContent(fhV0MMultPercentile->FindFixBin(v0am + v0cm)); + multiplicity = v0am + v0cm; } break; case kCL1: if (fhCL1MultPercentile != nullptr) { - multiplicityclass = fhCL1MultPercentile->GetBinContent(fhCL1MultPercentile->FindFixBin(CL1M)); - multiplicity = CL1M; + multiplicityClass = fhCL1MultPercentile->GetBinContent(fhCL1MultPercentile->FindFixBin(cl1m)); + multiplicity = cl1m; } break; case kCL1GAP: if (fhCL1EtaGapMultPercentile != nullptr) { - multiplicityclass = fhCL1EtaGapMultPercentile->GetBinContent(fhCL1EtaGapMultPercentile->FindFixBin(CL1EtaGapM)); - multiplicity = CL1EtaGapM; + multiplicityClass = fhCL1EtaGapMultPercentile->GetBinContent(fhCL1EtaGapMultPercentile->FindFixBin(cl1EtaGapM)); + multiplicity = cl1EtaGapM; } break; default: break; } - fhMultiplicity->Fill(multiplicityclass); + fhMultiplicity->Fill(multiplicityClass); } } }; @@ -422,7 +427,7 @@ struct DptDptFilter { if ((fDataType == kData) || (fDataType == kDataNoEvtSel) || (fDataType == kMC)) { /* create the reconstructed data histograms */ - fhEventSelection = new TH1D("EventSelection", ";counts", knCollisionSelectionFlags, -0.5f, static_cast(knCollisionSelectionFlags) - 0.5f); + fhEventSelection = new TH1D("EventSelection", ";;counts", knCollisionSelectionFlags, -0.5f, static_cast(knCollisionSelectionFlags) - 0.5f); for (int ix = 0; ix < knCollisionSelectionFlags; ++ix) { fhEventSelection->GetXaxis()->SetBinLabel(ix + 1, eventSelectionSteps[ix]); } @@ -556,7 +561,7 @@ void DptDptFilter::processReconstructed(CollisionObject const& collision, Tracks fhVertexZB->Fill(collision.posZ()); uint8_t acceptedevent = uint8_t(false); float centormult = tentativecentmult; - if (IsEvtSelected(collision, centormult)) { + if (isEventSelected(collision, centormult)) { acceptedevent = true; fhCentMultA->Fill(centormult); fhMultA->Fill(mult); @@ -616,7 +621,7 @@ bool DptDptFilter::processGenerated(CollisionObject const& mccollision, Particle using namespace dptdptfilter; uint8_t acceptedevent = uint8_t(false); - if (IsEvtSelected(mccollision, centormult)) { + if (isEventSelected(mccollision, centormult)) { acceptedevent = uint8_t(true); } if (fullDerivedData) { @@ -643,11 +648,11 @@ void DptDptFilter::processGeneratorLevel(aod::McCollision const& mccollision, } bool processed = false; - for (auto& tmpcollision : collisions) { + for (auto const& tmpcollision : collisions) { if (tmpcollision.has_mcCollision()) { if (tmpcollision.mcCollisionId() == mccollision.globalIndex()) { typename AllCollisions::iterator const& collision = allcollisions.iteratorAt(tmpcollision.globalIndex()); - if (IsEvtSelected(collision, defaultcent)) { + if (isEventSelected(collision, defaultcent)) { fhTrueVertexZAA->Fill((mccollision.posZ())); processGenerated(mccollision, mcparticles, defaultcent); processed = true; @@ -692,7 +697,7 @@ void DptDptFilter::processOnTheFlyGeneratorLevel(aod::McCollision const& mccolli fhTrueVertexZB->Fill(mccollision.posZ()); /* we assign a default value for the time being */ float centormult = 50.0f; - if (IsEvtSelected(mccollision, centormult)) { + if (isEventSelected(mccollision, centormult)) { acceptedEvent = true; multiplicity.extractMultiplicity(mcparticles); fhTrueVertexZA->Fill((mccollision.posZ())); @@ -711,7 +716,7 @@ void DptDptFilter::processVertexGenerated(aod::McCollisions const& mccollisions) fhTrueVertexZB->Fill(mccollision.posZ()); /* we assign a default value */ float centmult = 50.0f; - if (IsEvtSelected(mccollision, centmult)) { + if (isEventSelected(mccollision, centmult)) { fhTrueVertexZA->Fill((mccollision.posZ())); } } @@ -727,10 +732,10 @@ T computeRMS(std::vector& vec) std::vector diff(vec.size()); std::transform(vec.begin(), vec.end(), diff.begin(), [mean](T x) { return x - mean; }); - T sq_sum = std::inner_product(diff.begin(), diff.end(), diff.begin(), 0.0); - T stdev = std::sqrt(sq_sum / vec.size()); + T sqSum = std::inner_product(diff.begin(), diff.end(), diff.begin(), 0.0); + T stdDev = std::sqrt(sqSum / vec.size()); - return stdev; + return stdDev; } struct DptDptFilterTracks { @@ -828,10 +833,10 @@ struct DptDptFilterTracks { auto insertInPIDselector = [&](auto cfg, uint sp) { if (cfg.value.mUseIt) { if (cfg.value.mExclude) { - pidselector.AddExclude(sp, &(cfg.value)); + pidselector.addExcludedSpecies(sp, &(cfg.value)); LOGF(info, "Incorporated species: %s to PID selection for exclusion", pidselector.spnames[sp].data()); } else { - pidselector.Add(sp, &(cfg.value)); + pidselector.addSpecies(sp, &(cfg.value)); LOGF(info, "Incorporated species: %s to PID selection", pidselector.spnames[sp].data()); } } @@ -848,9 +853,9 @@ struct DptDptFilterTracks { fOutput.setObject(fOutputList); /* incorporate configuration parameters to the output */ - fOutputList->Add(new TParameter("TrackType", cfgTrackType, 'f')); - fOutputList->Add(new TParameter("TrackOneCharge", 1, 'f')); - fOutputList->Add(new TParameter("TrackTwoCharge", -1, 'f')); + fOutputList->Add(new TParameter("TrackType", cfgTrackType, 'f')); + fOutputList->Add(new TParameter("TrackOneCharge", 1, 'f')); + fOutputList->Add(new TParameter("TrackTwoCharge", -1, 'f')); if ((fDataType == kData) || (fDataType == kDataNoEvtSel) || (fDataType == kMC)) { /* create the reconstructed data histograms */ @@ -1118,12 +1123,12 @@ struct DptDptFilterTracks { if (!fullDerivedData) { tracksinfo.reserve(tracks.size()); } - for (auto collision : collisions) { + for (auto const& collision : collisions) { if (collision.collisionaccepted()) { ncollaccepted++; } } - for (auto track : tracks) { + for (auto const& track : tracks) { int8_t pid = -1; if (track.has_collision() && (track.template collision_as>()).collisionaccepted()) { pid = selectTrackAmbiguousCheck(collisions, track); @@ -1169,13 +1174,13 @@ struct DptDptFilterTracks { gentracksinfo.reserve(particles.size()); } - for (auto gencoll : gencollisions) { + for (auto const& gencoll : gencollisions) { if (gencoll.collisionaccepted()) { acceptedcollisions++; } } - for (auto& particle : particles) { + for (auto const& particle : particles) { float charge = getCharge(particle); int8_t pid = -1; @@ -1348,7 +1353,7 @@ int8_t DptDptFilterTracks::selectTrack(TrackObject const& track) /* track selection */ int8_t sp = -127; - if (AcceptTrack(track)) { + if (acceptTrack(track)) { /* the track has been accepted */ /* let's identify it */ sp = trackIdentification(track); @@ -1403,22 +1408,22 @@ int8_t DptDptFilterTracks::selectTrackAmbiguousCheck(CollisionObjects const& col } } - float multiplicityclass = (track.template collision_as()).centmult(); + float multiplicityClass = (track.template collision_as()).centmult(); if (ambiguoustrack) { /* keep track of ambiguous tracks */ - fhAmbiguousTrackType->Fill(ambtracktype, multiplicityclass); - fhAmbiguousTrackPt->Fill(track.pt(), multiplicityclass); - fhAmbiguityDegree->Fill(zvertexes.size(), multiplicityclass); + fhAmbiguousTrackType->Fill(ambtracktype, multiplicityClass); + fhAmbiguousTrackPt->Fill(track.pt(), multiplicityClass); + fhAmbiguityDegree->Fill(zvertexes.size(), multiplicityClass); if (ambtracktype == 2) { - fhCompatibleCollisionsZVtxRms->Fill(-computeRMS(zvertexes), multiplicityclass); + fhCompatibleCollisionsZVtxRms->Fill(-computeRMS(zvertexes), multiplicityClass); } else { - fhCompatibleCollisionsZVtxRms->Fill(computeRMS(zvertexes), multiplicityclass); + fhCompatibleCollisionsZVtxRms->Fill(computeRMS(zvertexes), multiplicityClass); } return -1; } else { if (checkAmbiguousTracks) { /* feedback of no ambiguous tracks only if checks required */ - fhAmbiguousTrackType->Fill(ambtracktype, multiplicityclass); + fhAmbiguousTrackType->Fill(ambtracktype, multiplicityClass); } return selectTrack(track); } @@ -1507,7 +1512,7 @@ inline int8_t DptDptFilterTracks::selectParticle(ParticleObject const& particle, fillParticleHistosBeforeSelection(particle, mccollision, charge); /* track selection */ - if (AcceptParticle(particle, mccollision)) { + if (acceptParticle(particle, mccollision)) { /* the particle has been accepted */ /* the particle is only accepted if it is a primary particle */ /* let's identify the particle */ @@ -1544,14 +1549,14 @@ void DptDptFilterTracks::fillParticleHistosBeforeSelection(ParticleObject const& fhTruePtNegB->Fill(particle.pt()); } - float dcaxy = TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) + - (particle.vy() - collision.posY()) * (particle.vy() - collision.posY())); + float dcaxy = std::sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) + + (particle.vy() - collision.posY()) * (particle.vy() - collision.posY())); if (traceDCAOutliers.mDoIt && (traceDCAOutliers.mLowValue < dcaxy) && (dcaxy < traceDCAOutliers.mUpValue)) { fhTrueDCAxyBid->Fill(TString::Format("%d", particle.pdgCode()).Data(), 1.0); } - fhTrueDCAxyB->Fill(TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) + - (particle.vy() - collision.posY()) * (particle.vy() - collision.posY()))); + fhTrueDCAxyB->Fill(std::sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) + + (particle.vy() - collision.posY()) * (particle.vy() - collision.posY()))); fhTrueDCAzB->Fill((particle.vz() - collision.posZ())); } @@ -1560,16 +1565,16 @@ void DptDptFilterTracks::fillParticleHistosAfterSelection(ParticleObject const& { fhTrueEtaA->Fill(particle.eta()); fhTruePhiA->Fill(particle.phi()); - float dcaxy = TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) + - (particle.vy() - collision.posY()) * (particle.vy() - collision.posY())); + float dcaxy = std::sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) + + (particle.vy() - collision.posY()) * (particle.vy() - collision.posY())); if (traceDCAOutliers.mDoIt && (traceDCAOutliers.mLowValue < dcaxy) && (dcaxy < traceDCAOutliers.mUpValue)) { LOGF(info, "DCAxy outlier: Particle with index %d and pdg code %d assigned to MC collision %d, pT: %f, phi: %f, eta: %f", particle.globalIndex(), particle.pdgCode(), particle.mcCollisionId(), particle.pt(), particle.phi(), particle.eta()); LOGF(info, " With status %d and flags %0X", particle.statusCode(), particle.flags()); } - fhTrueDCAxyA->Fill(TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) + - (particle.vy() - collision.posY()) * (particle.vy() - collision.posY()))); + fhTrueDCAxyA->Fill(std::sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) + + (particle.vy() - collision.posY()) * (particle.vy() - collision.posY()))); fhTrueDCAzA->Fill((particle.vz() - collision.posZ())); fhTruePA[sp]->Fill(particle.p()); fhTruePtA[sp]->Fill(particle.pt()); diff --git a/PWGCF/TableProducer/dptdptfilter.h b/PWGCF/TableProducer/dptdptfilter.h index 9ba5cebcd6d..10c453250fa 100644 --- a/PWGCF/TableProducer/dptdptfilter.h +++ b/PWGCF/TableProducer/dptdptfilter.h @@ -8,6 +8,11 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. + +/// \file dptdptfilter.h +/// \brief Filters collisions and tracks according to selection criteria +/// \author victor.gonzalez.sebastian@gmail.com + #ifndef PWGCF_TABLEPRODUCER_DPTDPTFILTER_H_ #define PWGCF_TABLEPRODUCER_DPTDPTFILTER_H_ @@ -17,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -119,7 +123,8 @@ enum OccupancyEstimationType { /// \enum CollisionSelectionFlags /// \brief The different criteria for selecting/rejecting collisions enum CollisionSelectionFlags { - kMBBIT = 0, ///< minimum bias + kIN = 0, ///< new unhandled, yet, event + kMBBIT, ///< minimum bias kINT7BIT, ///< INT7 Run 1/2 kSEL7BIT, ///< Sel7 Run 1/2 kSEL8BIT, ///< Sel8 @@ -131,6 +136,7 @@ enum CollisionSelectionFlags { kOCCUPANCYBIT, ///< occupancy within limits kCENTRALITYBIT, ///< centrality cut passed kZVERTEXBIT, ///< zvtx cut passed + kSELECTED, ///< the event has passed all selections knCollisionSelectionFlags ///< number of flags }; @@ -172,18 +178,18 @@ bool onlyInOneSide = false; /* select only tracks that don't cross the TPC centr /* selection criteria from PWGMM */ // default quality criteria for tracks with ITS contribution -static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionITS = +static constexpr o2::aod::track::TrackSelectionFlags::flagtype TrackSelectionITS = o2::aod::track::TrackSelectionFlags::kITSNCls | o2::aod::track::TrackSelectionFlags::kITSChi2NDF | o2::aod::track::TrackSelectionFlags::kITSHits; // default quality criteria for tracks with TPC contribution -static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionTPC = +static constexpr o2::aod::track::TrackSelectionFlags::flagtype TrackSelectionTPC = o2::aod::track::TrackSelectionFlags::kTPCNCls | o2::aod::track::TrackSelectionFlags::kTPCCrossedRowsOverNCls | o2::aod::track::TrackSelectionFlags::kTPCChi2NDF; // default standard DCA cuts -static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionDCA = +static constexpr o2::aod::track::TrackSelectionFlags::flagtype TrackSelectionDCA = o2::aod::track::TrackSelectionFlags::kDCAz | o2::aod::track::TrackSelectionFlags::kDCAxy; int tracktype = 1; @@ -311,7 +317,7 @@ inline void initializeTrackSelection(const TrackSelectionTuneCfg& tune) break; } if (tune.mUseIt) { - for (auto filter : trackFilters) { + for (auto const& filter : trackFilters) { if (tune.mUseTPCclusters) { filter->SetMinNClustersTPC(tune.mTPCclusters); } @@ -943,9 +949,10 @@ inline bool occupancySelection(aod::McCollision const&) ////////////////////////////////////////////////////////////////////////////////// template -inline bool IsEvtSelected(CollisionObject const& collision, float& centormult) +inline bool isEventSelected(CollisionObject const& collision, float& centormult) { collisionFlags.reset(); + collisionFlags.set(kIN); bool trigsel = triggerSelection(collision); @@ -968,7 +975,13 @@ inline bool IsEvtSelected(CollisionObject const& collision, float& centormult) bool centmultsel = centralitySelection(collision, centormult); - return trigsel && occupancysel && zvtxsel && centmultsel; + bool accepted = trigsel && occupancysel && zvtxsel && centmultsel; + + if (accepted) { + collisionFlags.set(kSELECTED); + } + + return accepted; } ////////////////////////////////////////////////////////////////////////////////// @@ -987,11 +1000,11 @@ inline bool matchTrackType(TrackObject const& track) // (track.passedDCAxy && track.passedDCAz && track.passedGoldenChi2) && // (track.passedITSNCls && track.passedITSChi2NDF && track.passedITSHits) && // (!track.hasTPC || (track.passedTPCNCls && track.passedTPCChi2NDF && track.passedTPCCrossedRowsOverNCls)); - return track.hasITS() && ((track.trackCutFlag() & trackSelectionITS) == trackSelectionITS) && - (!track.hasTPC() || ((track.trackCutFlag() & trackSelectionTPC) == trackSelectionTPC)) && - ((track.trackCutFlag() & trackSelectionDCA) == trackSelectionDCA); + return track.hasITS() && ((track.trackCutFlag() & TrackSelectionITS) == TrackSelectionITS) && + (!track.hasTPC() || ((track.trackCutFlag() & TrackSelectionTPC) == TrackSelectionTPC)) && + ((track.trackCutFlag() & TrackSelectionDCA) == TrackSelectionDCA); } else { - for (auto filter : trackFilters) { + for (auto const& filter : trackFilters) { if (filter->IsSelected(track)) { /* additional track cuts if needed */ auto checkDca2Dcut = [&](auto const& track) { @@ -1028,7 +1041,7 @@ inline bool matchTrackType(TrackObject const& track) /// \param track the track of interest /// \return true if the track is in the acceptance, otherwise false template -inline bool InTheAcceptance(TrackObject const& track) +inline bool inTheAcceptance(TrackObject const& track) { /* the side on which the collision happened */ float side = track.template collision_as().posZ(); @@ -1070,9 +1083,9 @@ inline bool InTheAcceptance(TrackObject const& track) /// \param track the track of interest /// \return true if the track is accepted, otherwise false template -inline bool AcceptTrack(TrackObject const& track) +inline bool acceptTrack(TrackObject const& track) { - if (InTheAcceptance(track)) { + if (inTheAcceptance(track)) { if (matchTrackType(track)) { return true; } @@ -1083,7 +1096,7 @@ inline bool AcceptTrack(TrackObject const& track) template void exploreMothers(ParticleObject& particle, MCCollisionObject& collision) { - for (auto& m : particle.template mothers_as()) { + for (const auto& m : particle.template mothers_as()) { LOGF(info, " mother index: %d", m.globalIndex()); LOGF(info, " Tracking back mother"); LOGF(info, " assigned collision Id: %d, looping on collision Id: %d", m.mcCollisionId(), collision.globalIndex()); @@ -1109,7 +1122,7 @@ inline float getCharge(ParticleObject& particle) /// \param track the particle of interest /// \return `true` if the particle is accepted, `false` otherwise template -inline bool AcceptParticle(ParticleObject& particle, MCCollisionObject const&) +inline bool acceptParticle(ParticleObject& particle, MCCollisionObject const&) { /* overall momentum cut */ if (!(overallminp < particle.p())) { @@ -1184,7 +1197,7 @@ struct PIDSpeciesSelection { reportadjdetectorwithcharge(tpcnsigmasshiftneg, "TPC", "M"); reportadjdetectorwithcharge(tofnsigmasshiftneg, "TOF", "M"); } - void Add(uint8_t sp, o2::analysis::TrackSelectionPIDCfg* incfg) + void addSpecies(uint8_t sp, o2::analysis::TrackSelectionPIDCfg* incfg) { o2::analysis::TrackSelectionPIDCfg* cfg = new o2::analysis::TrackSelectionPIDCfg(*incfg); config.push_back(cfg); @@ -1199,7 +1212,7 @@ struct PIDSpeciesSelection { LOGF(info, " maxTOF nsigmas: el: %.2f, mu: %.2f, pi: %.2f, ka: %.2f, pr: %.2f", last->mMaxNSigmasTOF[0], last->mMaxNSigmasTOF[1], last->mMaxNSigmasTOF[2], last->mMaxNSigmasTOF[3], last->mMaxNSigmasTOF[4]); LOGF(info, " %.1f < pT < %.1f", last->mPtMin, last->mPtMax); } - void AddExclude(uint8_t sp, const o2::analysis::TrackSelectionPIDCfg* incfg) + void addExcludedSpecies(uint8_t sp, const o2::analysis::TrackSelectionPIDCfg* incfg) { o2::analysis::TrackSelectionPIDCfg* cfg = new o2::analysis::TrackSelectionPIDCfg(*incfg); configexclude.push_back(cfg); @@ -1228,10 +1241,10 @@ struct PIDSpeciesSelection { }; auto outnsigmasdebug = [&]() { if constexpr (outdebug != 0) { - for (auto tpcn : tpcnsigmas) { + for (auto const& tpcn : tpcnsigmas) { debuginfo += TString::Format("%.4f,", tpcn); } - for (auto tofn : tofnsigmas) { + for (auto const& tofn : tofnsigmas) { debuginfo += TString::Format("%.4f,", tofn); } } diff --git a/PWGCF/Tasks/dptdptcorrelations.cxx b/PWGCF/Tasks/dptdptcorrelations.cxx index ad227a09e7d..d8c88981dbe 100644 --- a/PWGCF/Tasks/dptdptcorrelations.cxx +++ b/PWGCF/Tasks/dptdptcorrelations.cxx @@ -9,6 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file dptdptcorrelations.cxx #include #include #include @@ -21,6 +22,9 @@ #include #include #include +#include +#include +#include #include #include @@ -960,7 +964,7 @@ struct DptDptCorrelationsTask { auto cfg = new o2::analysis::TrackSelectionPIDCfg(); cfg->mUseIt = true; cfg->mExclude = false; - pidselector.Add(spid, cfg); + pidselector.addSpecies(spid, cfg); } } }; diff --git a/PWGCF/Tasks/match-reco-gen.cxx b/PWGCF/Tasks/match-reco-gen.cxx index adf0b363e6b..064b1739651 100644 --- a/PWGCF/Tasks/match-reco-gen.cxx +++ b/PWGCF/Tasks/match-reco-gen.cxx @@ -10,6 +10,8 @@ // or submit itself to any jurisdiction. #include +#include +#include #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" @@ -407,9 +409,9 @@ struct CheckGeneratorLevelVsDetectorLevel { if (!(track.collisionId() < 0)) { typename CollisionsObject::iterator coll = collisions.iteratorAt(track.collisionId()); float centormult = -100.0f; - if (IsEvtSelected(coll, centormult)) { + if (isEventSelected(coll, centormult)) { /* TODO: AcceptTrack does not consider PID */ - if (AcceptTrack(track)) { + if (acceptTrack(track)) { /* the track has been accepted */ nreco++; LOGF(MATCHRECGENLOGTRACKS, "Accepted track with global Id %d and collision Id %d has label %d associated to MC collision %d", recix, track.collisionId(), label, track.template mcParticle_as().mcCollisionId()); diff --git a/PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx index 216f273fde3..d8e362b4895 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx @@ -12,6 +12,10 @@ #include #include #include +#include +#include +#include +#include #include "ReconstructionDataFormats/PID.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/TableHelper.h" @@ -307,8 +311,8 @@ struct QADataCollectingEngine { h->Fill(track.eta(), track.pt()); } }; - bool hasits = track.hasITS() && TrackSelectionFlags::checkFlag(track.trackCutFlag(), trackSelectionITS); - bool hastpc = track.hasTPC() && TrackSelectionFlags::checkFlag(track.trackCutFlag(), trackSelectionTPC); + bool hasits = track.hasITS() && TrackSelectionFlags::checkFlag(track.trackCutFlag(), TrackSelectionITS); + bool hastpc = track.hasTPC() && TrackSelectionFlags::checkFlag(track.trackCutFlag(), TrackSelectionTPC); bool hastof = track.hasTOF(); fhITS_NCls_vs_PtB->Fill(track.pt(), track.itsNCls()); @@ -320,7 +324,7 @@ struct QADataCollectingEngine { fhTPC_CrossedRows_vs_PtB->Fill(track.pt(), track.tpcNClsCrossedRows()); fhTPC_CrossedRowsOverFindableCls_vs_PtB->Fill(track.pt(), track.tpcCrossedRowsOverFindableCls()); fhTPC_Chi2NCls_vs_PtB->Fill(track.pt(), track.tpcChi2NCl()); - if (InTheAcceptance(track)) { + if (inTheAcceptance(track)) { /* efficiency histograms */ fillhisto(fhPt_vs_EtaItsAcc, hasits); fillhisto(fhPt_vs_EtaTpcAcc, hastpc); @@ -686,7 +690,7 @@ struct DptDptEfficiencyAndQc { auto cfg = new o2::analysis::TrackSelectionPIDCfg(); cfg->mUseIt = true; cfg->mExclude = false; - pidselector.Add(spid, cfg); + pidselector.addSpecies(spid, cfg); } } }; From e92fc9052d019d985e0622548d49aec878a97687 Mon Sep 17 00:00:00 2001 From: abilandz Date: Fri, 29 Nov 2024 09:21:38 +0100 Subject: [PATCH 166/459] [PWGCF] added support for IR and current run duration (#8710) --- .../Core/MuPa-Configurables.h | 44 +- .../Core/MuPa-DataMembers.h | 58 +- .../Core/MuPa-Enums.h | 22 +- .../Core/MuPa-MemberFunctions.h | 883 +++++++++++++----- .../Tasks/CMakeLists.txt | 2 +- .../Tasks/multiparticle-correlations-ab.cxx | 55 +- 6 files changed, 756 insertions(+), 308 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h index be8bf29ec50..5a1a2e309de 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h @@ -19,6 +19,7 @@ // *) Task configuration: struct : ConfigurableGroup { // std::string prefix = "Task configuration"; // AA: now these configurables also appear grouped on hyperloop => TBI 20240522 check if this work, and if further modifications in init are needed + Configurable cfTaskIsConfiguredFromJson{"cfTaskIsConfiguredFromJson", "no", "always set manaully to \"yes\" via JSON, merely to ensure that settings are not ignored silently"}; Configurable cfTaskName{"cfTaskName", "Default task name", "set task name - use eventually to determine weights for this task"}; Configurable cfDryRun{"cfDryRun", false, "book all histos and run without storing and calculating anything"}; Configurable cfVerbose{"cfVerbose", false, "run or not in verbose mode (but not for simple utility functions or function calls per particle)"}; @@ -44,7 +45,7 @@ struct : ConfigurableGroup { Configurable cfCheckUnderflowAndOverflow{"cfCheckUnderflowAndOverflow", false, "check and bail out if in event and particle histograms there are entries which went to underflow or overflow bins (use only locally)"}; Configurable cfRebin{"cfRebin", 1, "number of bins of selected heavy 2D histograms are devided with this number"}; Configurable cfFillQAEventHistograms2D{"cfFillQAEventHistograms2D", false, "if false, all QA 2D event histograms are not filled. if true, only the ones for which fBookQAEventHistograms2D[...] is true, are filled"}; - Configurable> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"Multiplicity_vs_ReferenceMultiplicity-1", "Multiplicity_vs_NContributors-1", "Multiplicity_vs_Centrality-1", "Multiplicity_vs_Vertex_z-1", "Multiplicity_vs_Occupancy-1", "ReferenceMultiplicity_vs_NContributors-1", "ReferenceMultiplicity_vs_Centrality-1", "ReferenceMultiplicity_vs_Vertex_z-1", "ReferenceMultiplicity_vs_Occupancy-1", "NContributors_vs_Centrality-1", "NContributors_vs_Vertex_z-1", "NContributors_vs_Occupancy-1", "Centrality_vs_Vertex_z-1", "Centrality_vs_Occupancy-1", "Vertex_z_vs_Occupancy-1", "CentFT0C_vs_CentNTPV-0", "CentFT0M_vs_CentNTPV-0", "CentRun2V0M_vs_CentRun2SPDTracklets-0", "TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange-1"}, "book (1) or do not book (0) this QA 2D event histogram"}; + Configurable> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"Multiplicity_vs_ReferenceMultiplicity-1", "Multiplicity_vs_NContributors-1", "Multiplicity_vs_Centrality-1", "Multiplicity_vs_Vertex_z-1", "Multiplicity_vs_Occupancy-1", "ReferenceMultiplicity_vs_NContributors-1", "ReferenceMultiplicity_vs_Centrality-1", "ReferenceMultiplicity_vs_Vertex_z-1", "ReferenceMultiplicity_vs_Occupancy-1", "NContributors_vs_Centrality-1", "NContributors_vs_Vertex_z-1", "NContributors_vs_Occupancy-1", "Centrality_vs_Vertex_z-1", "Centrality_vs_Occupancy-1", "Vertex_z_vs_Occupancy-1", "CentFT0C_vs_CentNTPV-0", "CentFT0M_vs_CentNTPV-0", "CentRun2V0M_vs_CentRun2SPDTracklets-0", "TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange-1", "CurrentRunDuration_vs_InteractionRate-1"}, "book (1) or do not book (0) this QA 2D event histogram"}; Configurable cfFillQAParticleHistograms2D{"cfFillQAParticleHistograms2D", false, "if false, all QA 2D particle histograms are not filled. if true, only the ones for which fBookQAParticleHistograms2D[...] is true, are filled"}; Configurable> cfBookQAParticleHistograms2D{"cfBookQAParticleHistograms2D", {"Pt_vs_dcaXY-1"}, "book (1) or do not book (0) this QA 2D particle histogram"}; } cf_qa; @@ -52,12 +53,12 @@ struct : ConfigurableGroup { // *) Event histograms: struct : ConfigurableGroup { Configurable cfFillEventHistograms{"cfFillEventHistograms", true, "if false, all event histograms are not filled. if true, only the ones for which fBookEventHistograms[...] is true, are filled"}; - Configurable> cfBookEventHistograms{"cfBookEventHistograms", {"NumberOfEvents-1", "TotalMultiplicity-1", "Multiplicity-1", "ReferenceMultiplicity-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Occupancy-1", "MultMCNParticlesEta08-1"}, "Book (1) or do not book (0) event histogram"}; + Configurable> cfBookEventHistograms{"cfBookEventHistograms", {"NumberOfEvents-1", "TotalMultiplicity-1", "Multiplicity-1", "ReferenceMultiplicity-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Occupancy-1", "InteractionRate-1", "CurrentRunDuration-1", "MultMCNParticlesEta08-0"}, "Book (1) or do not book (0) event histogram"}; } cf_eh; // *) Event cuts: struct : ConfigurableGroup { - Configurable> cfUseEventCuts{"cfUseEventCuts", {"NumberOfEvents-1", "TotalMultiplicity-1", "Multiplicity-1", "ReferenceMultiplicity-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Occupancy-1", "MultMCNParticlesEta08-1", "Trigger-0", "Sel7-1", "Sel8-1", "MultiplicityEstimator-1", "ReferenceMultiplicityEstimator-1", "CentralityEstimator-1", "SelectedEvents-1", "NoSameBunchPileup-1", "IsGoodZvtxFT0vsPV-1", "IsVertexITSTPC-1", "IsVertexTOFmatched-1", "IsVertexTRDmatched-1", "OccupancyEstimator-1"}, "use (1) or do not use (0) event cuts"}; + Configurable> cfUseEventCuts{"cfUseEventCuts", {"NumberOfEvents-1", "TotalMultiplicity-1", "Multiplicity-1", "ReferenceMultiplicity-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Occupancy-1", "InteractionRate-1", "CurrentRunDuration-1", "MultMCNParticlesEta08-0", "Trigger-0", "Sel7-0", "Sel8-1", "MultiplicityEstimator-1", "ReferenceMultiplicityEstimator-1", "CentralityEstimator-1", "SelectedEvents-1", "NoSameBunchPileup-1", "IsGoodZvtxFT0vsPV-1", "IsVertexITSTPC-1", "IsVertexTOFmatched-1", "IsVertexTRDmatched-1", "OccupancyEstimator-1"}, "use (1) or do not use (0) event cuts"}; Configurable cfUseEventCutCounterAbsolute{"cfUseEventCutCounterAbsolute", false, "profile and save how many times each event cut counter triggered (absolute). Use with care, as this is computationally heavy"}; Configurable cfUseEventCutCounterSequential{"cfUseEventCutCounterSequential", false, "profile and save how many times each event cut counter triggered (sequential). Use with care, as this is computationally heavy"}; Configurable cfPrintCutCounterContent{"cfPrintCutCounterContent", false, "if true, prints on the screen after each event the content of fEventCutCounterHist[*][*] (all which were booked)"}; @@ -73,27 +74,32 @@ struct : ConfigurableGroup { Configurable> cfNContributors{"cfNContributors", {2, 1000000000}, "Number of vertex contributors: {min, max}, with convention: min <= N < max"}; Configurable> cfImpactParameter{"cfImpactParameter", {-1, 1000000000}, "Impact parameter range (can be used only for sim): {min, max}, with convention: min <= IP < max"}; Configurable> cfOccupancy{"cfOccupancy", {-2, 1000000000}, "Range for occupancy (use cfOccupancyEstimator to set specific estimator): {min, max}, with convention: min <= X < max"}; + Configurable> cfInteractionRate{"cfInteractionRate", {-2, 1000000000}, "Range for interaction rate: {min, max}, with convention: min <= X < max"}; + Configurable> cfCurrentRunDuration{"cfCurrentRunDuration", {-2, 1000000000}, "Range for current run duration (i.e. seconds since start of run) in seconds: {min, max}, with convention: min <= X < max. Only collisions taken in this range (measured from SOR) are taken for analysis"}; Configurable> cfMultMCNParticlesEta08{"cfMultMCNParticlesEta08", {-1, 1000000000}, "Range for MultMCNParticlesEta08 : {min, max}, with convention: min <= X < max"}; Configurable cfTrigger{"cfTrigger", "some supported trigger (e.g. kINT7, ...)", "set here some supported trigger"}; Configurable cfUseSel7{"cfUseSel7", false, "use for Run 1 and 2 data and MC (see official doc)"}; Configurable cfUseSel8{"cfUseSel8", false, "use for Run 3 data and MC (see official doc)"}; Configurable cfMultiplicityEstimator{"cfMultiplicityEstimator", "SelectedTracks", "all results vs. mult are calculated against this multiplicity. Can be set to SelectedTracks (calculated internally), ReferenceMultiplicity (calculated outside of my code), etc."}; - Configurable cfReferenceMultiplicityEstimator{"cfReferenceMultiplicityEstimator", "some supported option for ref. mult. (MultTPC, MultFV0M, etc.)", "Reference multiplicity, calculated outside of my code. Can be MultTPC, MultFV0M, etc."}; - Configurable cfCentralityEstimator{"cfCentralityEstimator", "some supported centrality estimator (e.g. CentFT0C, ...)", "set here some supported centrality estimator (CentFT0C, CentFT0M, CentFV0A, CentNTPV, ... for Run 3, and CentRun2V0M, CentRun2SPDTracklets, ..., for Run 2 and 1) "}; + // Configurable cfReferenceMultiplicityEstimator{"cfReferenceMultiplicityEstimator", "some supported option for ref. mult. (MultFT0C, MultFV0M, MultTPC, etc.)", "Reference multiplicity, calculated outside of my code. Can be MultFT0C, MultFV0M, MultTPC, etc."}; + Configurable cfReferenceMultiplicityEstimator{"cfReferenceMultiplicityEstimator", "MultFT0C", "Reference multiplicity, calculated outside of my code. Can be MultFT0C, MultFV0M, MultTPC, etc."}; + // Configurable cfCentralityEstimator{"cfCentralityEstimator", "some supported centrality estimator (e.g. CentFT0C, ...)", "set here some supported centrality estimator (CentFT0C, CentFT0M, CentFV0A, CentNTPV, ... for Run 3, and CentRun2V0M, CentRun2SPDTracklets, ..., for Run 2 and 1) "}; + Configurable cfCentralityEstimator{"cfCentralityEstimator", "CentFT0C", "set here some supported centrality estimator (CentFT0C, CentFT0M, CentFV0A, CentNTPV, ... for Run 3, and CentRun2V0M, CentRun2SPDTracklets, ..., for Run 2 and 1) "}; Configurable> cfSelectedEvents{"cfSelectedEvents", {-1, 1000000000}, "Selected number of events to process (i.e. only events which survive event cuts): {min, max}, with convention: min <= N < max"}; Configurable cfUseNoSameBunchPileup{"cfUseNoSameBunchPileup", false, "TBI 20240521 explanation"}; Configurable cfUseIsGoodZvtxFT0vsPV{"cfUseIsGoodZvtxFT0vsPV", false, "TBI 20240521 explanation"}; Configurable cfUseIsVertexITSTPC{"cfUseIsVertexITSTPC", false, "TBI 20240521 explanation"}; Configurable cfUseIsVertexTOFmatched{"cfUseIsVertexTOFmatched", false, "TBI 20240521 explanation"}; Configurable cfUseIsVertexTRDmatched{"cfUseIsVertexTRDmatched", false, "TBI 20240521 explanation"}; - Configurable cfOccupancyEstimator{"cfOccupancyEstimator", "some supported occupancy estimator (e.g. TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ...)", "set here some supported occupancy estimator (TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ..."}; + // Configurable cfOccupancyEstimator{"cfOccupancyEstimator", "some supported occupancy estimator (e.g. TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ...)", "set here some supported occupancy estimator (TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ..."}; + Configurable cfOccupancyEstimator{"cfOccupancyEstimator", "FT0COccupancyInTimeRange", "set here some supported occupancy estimator (TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ..."}; } cf_ec; // *) Particle histograms: struct : ConfigurableGroup { - Configurable cfFillParticleHistograms{"cfFillParticleHistograms", true, "if false, all 1D particle histograms are not filled. if kTRUE, the ones for which fBookParticleHistograms[...] is kTRUE, are filled"}; - Configurable> cfBookParticleHistograms{"cfBookParticleHistograms", {"Phi-1", "Pt-1", "Eta-1", "Charge-1", "tpcNClsFindable-1", "tpcNClsShared-1", "tpcNClsFound-1", "tpcNClsCrossedRows-1", "itsNCls-1", "itsNClsInnerBarrel-1", "tpcCrossedRowsOverFindableCls-1", "tpcFoundOverFindableCls-1", "tpcFractionSharedCls-1", "dcaXY-1", "dcaZ-1", "PDG-1"}, "Book (1) or do not book (0) particle histogram"}; - Configurable cfFillParticleHistograms2D{"cfFillParticleHistograms2D", true, "if false, all 2D particle histograms are not filled. if kTRUE, the ones for which fBookParticleHistograms2D[...] is kTRUE, are filled"}; + Configurable cfFillParticleHistograms{"cfFillParticleHistograms", false, "if false, all 1D particle histograms are not filled. if kTRUE, the ones for which fBookParticleHistograms[...] is kTRUE, are filled"}; + Configurable> cfBookParticleHistograms{"cfBookParticleHistograms", {"Phi-1", "Pt-1", "Eta-1", "Charge-1", "tpcNClsFindable-1", "tpcNClsShared-1", "tpcNClsFound-1", "tpcNClsCrossedRows-1", "itsNCls-1", "itsNClsInnerBarrel-1", "tpcCrossedRowsOverFindableCls-1", "tpcFoundOverFindableCls-1", "tpcFractionSharedCls-1", "dcaXY-1", "dcaZ-1", "PDG-0"}, "Book (1) or do not book (0) particle histogram"}; + Configurable cfFillParticleHistograms2D{"cfFillParticleHistograms2D", false, "if false, all 2D particle histograms are not filled. if kTRUE, the ones for which fBookParticleHistograms2D[...] is kTRUE, are filled"}; Configurable> cfBookParticleHistograms2D{"cfBookParticleHistograms2D", {"Phi_vs_Pt-1", "Phi_vs_Eta-1"}, "Book (1) or do not book (0) 2D particle histograms"}; } cf_ph; @@ -142,6 +148,8 @@ struct : ConfigurableGroup { Configurable cfCalculateCorrelationsAsFunctionOfPt{"cfCalculateCorrelationsAsFunctionOfPt", false, "calculate or not correlations as a function of pt"}; Configurable cfCalculateCorrelationsAsFunctionOfEta{"cfCalculateCorrelationsAsFunctionOfEta", false, "calculate or not correlations as a function of eta"}; Configurable cfCalculateCorrelationsAsFunctionOfOccupancy{"cfCalculateCorrelationsAsFunctionOfOccupancy", false, "calculate or not correlations as a function of occupancy"}; + Configurable cfCalculateCorrelationsAsFunctionOfInteractionRate{"cfCalculateCorrelationsAsFunctionOfInteractionRate", false, "calculate or not correlations as a function of interaction rate"}; + Configurable cfCalculateCorrelationsAsFunctionOfCurrentRunDuration{"cfCalculateCorrelationsAsFunctionOfCurrentRunDuration", false, "calculate or not correlations as a function of current run duration (i.e. vs. seconds since start of run)"}; } cf_mupa; // *) Test0: @@ -153,6 +161,8 @@ struct : ConfigurableGroup { Configurable cfCalculateTest0AsFunctionOfPt{"cfCalculateTest0AsFunctionOfPt", false, "calculate or not Test0 as a function of pt"}; Configurable cfCalculateTest0AsFunctionOfEta{"cfCalculateTest0AsFunctionOfEta", false, "calculate or not Test0 as a function of eta"}; Configurable cfCalculateTest0AsFunctionOfOccupancy{"cfCalculateTest0AsFunctionOfOccupancy", false, "calculate or not Test0 as a function of occupancy"}; + Configurable cfCalculateTest0AsFunctionOfInteractionRate{"cfCalculateTest0AsFunctionOfInteractionRate", false, "calculate or not Test0 as a function of interaction rate"}; + Configurable cfCalculateTest0AsFunctionOfCurrentRunDuration{"cfCalculateTest0AsFunctionOfCurrentRunDuration", false, "calculate or not Test0 as a function of current run duration (i.e. vs. seconds since start of run)"}; Configurable cfFileWithLabels{"cfFileWithLabels", "/home/abilandz/DatasetsO2/labels.root", "path to external ROOT file which specifies all labels"}; // for AliEn file prepend "/alice/cern.ch/", for CCDB prepend "/alice-ccdb.cern.ch" Configurable cfUseDefaultLabels{"cfUseDefaultLabels", false, "use default internally hardwired labels, only for testing purposes"}; } cf_t0; @@ -206,11 +216,13 @@ struct : ConfigurableGroup { Configurable cfSaveResultsHistograms{"cfSaveResultsHistograms", false, "save or not results histograms"}; // Fixed-length binning (default): - Configurable> cfFixedLength_mult_bins{"cfFixedLength_mult_bins", {2000, 0., 20000.}, "nMultBins, multMin, multMax"}; - Configurable> cfFixedLength_cent_bins{"cfFixedLength_cent_bins", {110, 0., 110.}, "nCentBins, centMin, centMax"}; - Configurable> cfFixedLength_pt_bins{"cfFixedLength_pt_bins", {1000, 0., 100.}, "nPtBins, ptMin, ptMax"}; - Configurable> cfFixedLength_eta_bins{"cfFixedLength_eta_bins", {100, -2., 2.}, "nEtaBins, etaMin, etaMax"}; - Configurable> cfFixedLength_occu_bins{"cfFixedLength_occu_bins", {400, 0., 4000.}, "nOccuBins, occuMin, occuMax"}; + Configurable> cfFixedLength_mult_bins{"cfFixedLength_mult_bins", {2000, 0., 20000.}, "nMultBins, multMin, multMax (only for results histograms)"}; + Configurable> cfFixedLength_cent_bins{"cfFixedLength_cent_bins", {110, 0., 110.}, "nCentBins, centMin, centMax (only for results histograms)"}; + Configurable> cfFixedLength_pt_bins{"cfFixedLength_pt_bins", {1000, 0., 100.}, "nPtBins, ptMin, ptMax (only for results histograms)"}; + Configurable> cfFixedLength_eta_bins{"cfFixedLength_eta_bins", {100, -2., 2.}, "nEtaBins, etaMin, etaMax (only for results histograms)"}; + Configurable> cfFixedLength_occu_bins{"cfFixedLength_occu_bins", {601, -100., 60000.}, "nOccuBins, occuMin, occuMax (only for results histograms)"}; + Configurable> cfFixedLength_ir_bins{"cfFixedLength_ir_bins", {210000, -10., 200.}, "nirBins, irMin, irMax (only for results histograms)"}; + Configurable> cfFixedLength_crd_bins{"cfFixedLength_crd_bins", {86401, -1., 86400.}, "nrdBins, rdMin, rdMax (only for results histograms)"}; // Variable-length binning (per request): Configurable cfUseVariableLength_mult_bins{"cfUseVariableLength_mult_bins", false, "use or not variable-length multiplicity bins"}; @@ -223,6 +235,10 @@ struct : ConfigurableGroup { Configurable> cfVariableLength_eta_bins{"cfVariableLength_eta_bins", {-0.8, 0.0, 0.3, 0.8}, "variable-length eta bins"}; Configurable cfUseVariableLength_occu_bins{"cfUseVariableLength_occu_bins", false, "use or not variable-length occupancy bins"}; Configurable> cfVariableLength_occu_bins{"cfVariableLength_occu_bins", {0., 5., 6., 7., 8., 9., 100., 200., 500., 1000., 10000.}, "variable-length occupancy bins"}; + Configurable cfUseVariableLength_ir_bins{"cfUseVariableLength_ir_bins", false, "use or not variable-length interaction rate bins"}; + Configurable> cfVariableLength_ir_bins{"cfVariableLength_ir_bins", {0., 5., 10., 50., 100., 200.}, "variable-length ineraction rate bins"}; + Configurable cfUseVariableLength_crd_bins{"cfUseVariableLength_crd_bins", false, "use or not variable-length current run duration bins"}; + Configurable> cfVariableLength_crd_bins{"cfVariableLength_crd_bins", {0., 5., 10., 50., 100., 500.}, "variable-length current run duration bins"}; } cf_res; diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h index 88acf3dfb48..a0081a68b89 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h @@ -37,8 +37,8 @@ TProfile* fBasePro = NULL; //!GetBinContent(x,y); histSwapped->Fill(y,x); eMultiplicity_vs_NContributors, eMultiplicity_vs_Centrality, eMultiplicity_vs_Vertex_z, @@ -245,11 +250,12 @@ enum eQAEventHistograms2D { eCentrality_vs_Occupancy, eVertex_z_vs_Occupancy, // ... - // Specific (estimators are hardwired): + // Specific (everything is hardwired): eCentFT0C_vs_CentNTPV, // Run 3 centrality eCentFT0M_vs_CentNTPV, // Run 3 centrality eCentRun2V0M_vs_CentRun2SPDTracklets, // Run 2 centrality (do not use in Run 1 converted, because there is no centrality information) eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange, + eCurrentRunDuration_vs_InteractionRate, // ... eQAEventHistograms2D_N }; diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h index 7e77e64e934..ffb963a6c08 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h @@ -43,11 +43,13 @@ void BookBaseList() // Remark: If I want to change the ordering of bin labels, simply change the // ordering in enum eConfiguration { ... }, nothing needs to be changed here. + fBasePro->GetXaxis()->SetBinLabel(eTaskIsConfiguredFromJson, Form("fTaskIsConfiguredFromJson = %s", tc.fTaskIsConfiguredFromJson.Data())); + fBasePro->GetXaxis()->SetBinLabel(eTaskName, Form("fTaskName = %s", tc.fTaskName.Data())); fBasePro->GetXaxis()->SetBinLabel(eRunNumber, Form("fRunNumber = %s", "__RUN_NUMBER__")); // I have to do it this way via placeholder, because run number is available only when i start to process data. - // Then, I replace placeholder with run number in DetermineAndPropagateRunNumber(T const& collision) + // Then, I replace placeholder with run number in PropagateRunNumber(...) fBasePro->GetXaxis()->SetBinLabel(eDryRun, "fDryRun"); fBasePro->Fill(eDryRun, static_cast(tc.fDryRun)); @@ -138,6 +140,7 @@ void DefaultConfiguration() // *) Therefore, wrap up all data members in some struct fields + use in instead of individual configurables ConfigurableGroup whenever possible. // *) Within a given struct field, number of data members do not add to that number. Also, number of enum fields do not add. + tc.fTaskIsConfiguredFromJson = TString(cf_tc.cfTaskIsConfiguredFromJson); tc.fTaskName = TString(cf_tc.cfTaskName); tc.fDryRun = cf_tc.cfDryRun; tc.fVerbose = cf_tc.cfVerbose; @@ -231,6 +234,8 @@ void DefaultConfiguration() eh.fEventHistogramsName[eNContributors] = "NContributors"; eh.fEventHistogramsName[eImpactParameter] = "ImpactParameter"; eh.fEventHistogramsName[eOccupancy] = "Occupancy"; + eh.fEventHistogramsName[eInteractionRate] = "InteractionRate"; + eh.fEventHistogramsName[eCurrentRunDuration] = "CurrentRunDuration"; eh.fEventHistogramsName[eMultMCNParticlesEta08] = "MultMCNParticlesEta08"; for (Int_t t = 0; t < eEventHistograms_N; t++) { @@ -256,6 +261,8 @@ void DefaultConfiguration() ec.fEventCutName[eNContributors] = "NContributors"; ec.fEventCutName[eImpactParameter] = "ImpactParameter"; ec.fEventCutName[eOccupancy] = "Occupancy"; + ec.fEventCutName[eInteractionRate] = "InteractionRate"; + ec.fEventCutName[eCurrentRunDuration] = "CurrentRunDuration"; ec.fEventCutName[eMultMCNParticlesEta08] = "MultMCNParticlesEta08"; ec.fEventCutName[eTrigger] = "Trigger"; ec.fEventCutName[eSel7] = "Sel7"; @@ -353,6 +360,8 @@ void DefaultConfiguration() mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] = cf_mupa.cfCalculateCorrelationsAsFunctionOfPt; mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] = cf_mupa.cfCalculateCorrelationsAsFunctionOfEta; mupa.fCalculateCorrelationsAsFunctionOf[AFO_OCCUPANCY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfOccupancy; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_INTERACTIONRATE] = cf_mupa.cfCalculateCorrelationsAsFunctionOfInteractionRate; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_CURRENTRUNDURATION] = cf_mupa.cfCalculateCorrelationsAsFunctionOfCurrentRunDuration; // *) Test0: t0.fCalculateTest0 = cf_t0.cfCalculateTest0; @@ -361,7 +370,8 @@ void DefaultConfiguration() t0.fCalculateTest0AsFunctionOf[AFO_CENTRALITY] = cf_t0.cfCalculateTest0AsFunctionOfCentrality; t0.fCalculateTest0AsFunctionOf[AFO_PT] = cf_t0.cfCalculateTest0AsFunctionOfPt; t0.fCalculateTest0AsFunctionOf[AFO_ETA] = cf_t0.cfCalculateTest0AsFunctionOfEta; - t0.fCalculateTest0AsFunctionOf[AFO_OCCUPANCY] = cf_t0.cfCalculateTest0AsFunctionOfOccupancy; + t0.fCalculateTest0AsFunctionOf[AFO_INTERACTIONRATE] = cf_t0.cfCalculateTest0AsFunctionOfInteractionRate; + t0.fCalculateTest0AsFunctionOf[AFO_CURRENTRUNDURATION] = cf_t0.cfCalculateTest0AsFunctionOfCurrentRunDuration; t0.fFileWithLabels = TString(cf_t0.cfFileWithLabels); t0.fUseDefaultLabels = cf_t0.cfUseDefaultLabels; @@ -463,6 +473,25 @@ void DefaultConfiguration() iv.fRescaleWithTheoreticalInput = cf_iv.cfRescaleWithTheoreticalInput; // *) Results histograms: + // Define axis titles: + // Remark: keep ordering in sync with enum eAsFunctionOf + res.fResultsProXaxisTitle[AFO_INTEGRATED] = "integrated"; + res.fResultsProRawName[AFO_INTEGRATED] = "int"; // this is how it appears simplified in the hist name when saved to the file + res.fResultsProXaxisTitle[AFO_MULTIPLICITY] = "multiplicity"; + res.fResultsProRawName[AFO_MULTIPLICITY] = "mult"; + res.fResultsProXaxisTitle[AFO_CENTRALITY] = "centrality"; + res.fResultsProRawName[AFO_CENTRALITY] = "cent"; + res.fResultsProXaxisTitle[AFO_PT] = "pt"; + res.fResultsProRawName[AFO_PT] = "pt"; + res.fResultsProXaxisTitle[AFO_ETA] = "eta"; + res.fResultsProRawName[AFO_ETA] = "eta"; + res.fResultsProXaxisTitle[AFO_OCCUPANCY] = "occupancy"; + res.fResultsProRawName[AFO_OCCUPANCY] = "occu"; + res.fResultsProXaxisTitle[AFO_INTERACTIONRATE] = "interaction rate"; + res.fResultsProRawName[AFO_INTERACTIONRATE] = "ir"; + res.fResultsProXaxisTitle[AFO_CURRENTRUNDURATION] = "current run duration"; + res.fResultsProRawName[AFO_CURRENTRUNDURATION] = "crd"; + res.fSaveResultsHistograms = cf_res.cfSaveResultsHistograms; // *) QA: @@ -516,6 +545,7 @@ void DefaultConfiguration() qa.fEventHistogramsName2D[eCentFT0M_vs_CentNTPV] = Form("%s_vs_%s", qa.fCentralityEstimatorName[eCentFT0M].Data(), qa.fCentralityEstimatorName[eCentNTPV].Data()); qa.fEventHistogramsName2D[eCentRun2V0M_vs_CentRun2SPDTracklets] = Form("%s_vs_%s", qa.fCentralityEstimatorName[eCentRun2V0M].Data(), qa.fCentralityEstimatorName[eCentRun2SPDTracklets].Data()); qa.fEventHistogramsName2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = Form("%s_vs_%s", qa.fOccupancyEstimatorName[eTrackOccupancyInTimeRange].Data(), qa.fOccupancyEstimatorName[eFT0COccupancyInTimeRange].Data()); + qa.fEventHistogramsName2D[eCurrentRunDuration_vs_InteractionRate] = Form("%s_vs_%s", "CurrentRunDuration", "InteractionRate"); // TBI 20241127 check if this is the permanent formatting for axis titles // ***) Quick insanity check that all names are set: for (Int_t t = 0; t < eQAEventHistograms2D_N; t++) { @@ -606,180 +636,194 @@ void DefaultBooking() // By default all event histograms are booked. Set this flag to kFALSE to switch off booking of all event histograms: eh.fFillEventHistograms = cf_eh.cfFillEventHistograms; - // *) By default all event histograms are booked. If you do not want particular event histogram to be booked, - // use configurable array cfBookEventHistograms, where you can specify name of the histogram accompanied with flags 1 (book) or 0 (do not book). - // Supported format: "someName-0" and "someName-1", where "-" is a field separator. - // Ordering of the flags in that array is interpreted through ordering of enums in enum eEventHistograms. - auto lBookEventHistograms = cf_eh.cfBookEventHistograms.value; // this is now the local version of that string array from configurable. - if (lBookEventHistograms.size() != eEventHistograms_N) { - LOGF(info, "\033[1;31m lBookEventHistograms.size() = %d\033[0m", lBookEventHistograms.size()); - LOGF(info, "\033[1;31m eEventHistograms_N) = %d\033[0m", static_cast(eEventHistograms_N)); - LOGF(fatal, "\033[1;31m%s at line %d : Mismatch in the number of flags in configurable cfBookEventHistograms, and number of entries in enum eEventHistograms \n \033[0m", __FUNCTION__, __LINE__); - } - - // *) Insanity check on the content and ordering of histogram names in the initialization in configurable cfBookEventHistograms: - // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. - for (Int_t name = 0; name < eEventHistograms_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookEventHistograms[name]).BeginsWith(eh.fEventHistogramsName[name].Data())) { - LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookEventHistograms => name = %d, lBookEventHistograms[%d] = \"%s\", eh.fEventHistogramsName[%d] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, name, TString(lBookEventHistograms[name]).Data(), name, eh.fEventHistogramsName[name].Data()); - } - } - - // I append "&& eh.fFillEventHistograms" below, to switch off booking of all event histograms with one common flag: - eh.fBookEventHistograms[eNumberOfEvents] = Alright(lBookEventHistograms[eNumberOfEvents]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eTotalMultiplicity] = Alright(lBookEventHistograms[eTotalMultiplicity]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eMultiplicity] = Alright(lBookEventHistograms[eMultiplicity]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eReferenceMultiplicity] = Alright(lBookEventHistograms[eReferenceMultiplicity]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eCentrality] = Alright(lBookEventHistograms[eCentrality]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eVertex_x] = Alright(lBookEventHistograms[eVertex_x]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eVertex_y] = Alright(lBookEventHistograms[eVertex_y]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eVertex_z] = Alright(lBookEventHistograms[eVertex_z]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eNContributors] = Alright(lBookEventHistograms[eNContributors]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eImpactParameter] = Alright(lBookEventHistograms[eImpactParameter]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eOccupancy] = Alright(lBookEventHistograms[eOccupancy]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eMultMCNParticlesEta08] = Alright(lBookEventHistograms[eMultMCNParticlesEta08]) && eh.fFillEventHistograms; + if (eh.fFillEventHistograms) { + // *) By default all event histograms are booked. If you do not want particular event histogram to be booked, + // use configurable array cfBookEventHistograms, where you can specify name of the histogram accompanied with flags 1 (book) or 0 (do not book). + // Supported format: "someName-0" and "someName-1", where "-" is a field separator. + // Ordering of the flags in that array is interpreted through ordering of enums in enum eEventHistograms. + auto lBookEventHistograms = cf_eh.cfBookEventHistograms.value; // this is now the local version of that string array from configurable. + if (lBookEventHistograms.size() != eEventHistograms_N) { + LOGF(info, "\033[1;31m lBookEventHistograms.size() = %d\033[0m", lBookEventHistograms.size()); + LOGF(info, "\033[1;31m eEventHistograms_N) = %d\033[0m", static_cast(eEventHistograms_N)); + LOGF(fatal, "\033[1;31m%s at line %d : Mismatch in the number of flags in configurable cfBookEventHistograms, and number of entries in enum eEventHistograms \n \033[0m", __FUNCTION__, __LINE__); + } + + // *) Insanity check on the content and ordering of histogram names in the initialization in configurable cfBookEventHistograms: + // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. + for (Int_t name = 0; name < eEventHistograms_N; name++) { + // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookEventHistograms[name]).BeginsWith(eh.fEventHistogramsName[name].Data())) { + LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookEventHistograms => name = %d, lBookEventHistograms[%d] = \"%s\", eh.fEventHistogramsName[%d] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, name, TString(lBookEventHistograms[name]).Data(), name, eh.fEventHistogramsName[name].Data()); + } + } + + // I append "&& eh.fFillEventHistograms" below, to switch off booking of all event histograms with one common flag: + eh.fBookEventHistograms[eNumberOfEvents] = Alright(lBookEventHistograms[eNumberOfEvents]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eTotalMultiplicity] = Alright(lBookEventHistograms[eTotalMultiplicity]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eMultiplicity] = Alright(lBookEventHistograms[eMultiplicity]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eReferenceMultiplicity] = Alright(lBookEventHistograms[eReferenceMultiplicity]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eCentrality] = Alright(lBookEventHistograms[eCentrality]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eVertex_x] = Alright(lBookEventHistograms[eVertex_x]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eVertex_y] = Alright(lBookEventHistograms[eVertex_y]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eVertex_z] = Alright(lBookEventHistograms[eVertex_z]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eNContributors] = Alright(lBookEventHistograms[eNContributors]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eImpactParameter] = Alright(lBookEventHistograms[eImpactParameter]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eOccupancy] = Alright(lBookEventHistograms[eOccupancy]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eInteractionRate] = Alright(lBookEventHistograms[eInteractionRate]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eCurrentRunDuration] = Alright(lBookEventHistograms[eCurrentRunDuration]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eMultMCNParticlesEta08] = Alright(lBookEventHistograms[eMultMCNParticlesEta08]) && eh.fFillEventHistograms; + } // end of if (eh.fFillEventHistograms) // b) Event histograms 2D: // TBI 20240515 Ideally, all 2D shall go to QA group, see below + // ... // c) Particle histograms 1D: // By default all 1D particle histograms are booked. Set this flag to kFALSE to switch off booking of all 1D particle histograms: ph.fFillParticleHistograms = cf_ph.cfFillParticleHistograms; - // *) If you do not want particular particle histogram to be booked, use configurable array cfBookParticleHistograms, where you can specify flags 1 (book) or 0 (do not book). - // Ordering of the flags in that array is interpreted through ordering of enums in enum eParticleHistograms. // TBI 20240124 is this safe enough? - auto lBookParticleHistograms = cf_ph.cfBookParticleHistograms.value; // this is now the local version of that string array from configurable. - if (lBookParticleHistograms.size() != eParticleHistograms_N) { - LOGF(info, "\033[1;31m lBookParticleHistograms.size() = %d\033[0m", lBookParticleHistograms.size()); - LOGF(info, "\033[1;31m eParticleHistograms_N) = %d\033[0m", static_cast(eParticleHistograms_N)); - LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookParticleHistograms, and number of entries in enum eParticleHistograms \n \033[0m", __FUNCTION__, __LINE__); - } - - // *) Insanity check on the content and ordering of particle histograms in the initialization in configurable cfBookParticleHistograms: - // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. - for (Int_t name = 0; name < eParticleHistograms_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookParticleHistograms[name]).BeginsWith(ph.fParticleHistogramsName[name].Data())) { - LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookParticleHistograms => name = %d, lBookParticleHistograms[name] = \"%s\", ph.fParticleHistogramsName[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookParticleHistograms[name]).Data(), ph.fParticleHistogramsName[name].Data()); - } - } - - // I append "&& ph.fFillParticleHistograms" below, to switch off booking of all 1D particle histograms with one common flag: - ph.fBookParticleHistograms[ePhi] = Alright(lBookParticleHistograms[ePhi]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[ePt] = Alright(lBookParticleHistograms[ePt]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[eEta] = Alright(lBookParticleHistograms[eEta]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[eCharge] = Alright(lBookParticleHistograms[eCharge]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcNClsFindable] = Alright(lBookParticleHistograms[etpcNClsFindable]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcNClsShared] = Alright(lBookParticleHistograms[etpcNClsShared]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcNClsFound] = Alright(lBookParticleHistograms[etpcNClsFound]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcNClsCrossedRows] = Alright(lBookParticleHistograms[etpcNClsCrossedRows]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[eitsNCls] = Alright(lBookParticleHistograms[eitsNCls]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[eitsNClsInnerBarrel] = Alright(lBookParticleHistograms[eitsNClsInnerBarrel]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcCrossedRowsOverFindableCls] = Alright(lBookParticleHistograms[etpcCrossedRowsOverFindableCls]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcFoundOverFindableCls] = Alright(lBookParticleHistograms[etpcFoundOverFindableCls]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcFractionSharedCls] = Alright(lBookParticleHistograms[etpcFractionSharedCls]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[edcaXY] = Alright(lBookParticleHistograms[edcaXY]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[edcaZ] = Alright(lBookParticleHistograms[edcaZ]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[ePDG] = Alright(lBookParticleHistograms[ePDG]) && ph.fFillParticleHistograms; - // Remark #1: I do not need here anythig for etrackCutFlagFb1, etrackCutFlagFb2, ... eisGlobalTrack, because they are booleans - // Remark #2: Nothing special here for ePtDependentDCAxyParameterization, because that is a string. + if (ph.fFillParticleHistograms) { + // *) If you do not want particular particle histogram to be booked, use configurable array cfBookParticleHistograms, where you can specify flags 1 (book) or 0 (do not book). + // Ordering of the flags in that array is interpreted through ordering of enums in enum eParticleHistograms. // TBI 20240124 is this safe enough? + auto lBookParticleHistograms = cf_ph.cfBookParticleHistograms.value; // this is now the local version of that string array from configurable. + if (lBookParticleHistograms.size() != eParticleHistograms_N) { + LOGF(info, "\033[1;31m lBookParticleHistograms.size() = %d\033[0m", lBookParticleHistograms.size()); + LOGF(info, "\033[1;31m eParticleHistograms_N) = %d\033[0m", static_cast(eParticleHistograms_N)); + LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookParticleHistograms, and number of entries in enum eParticleHistograms \n \033[0m", __FUNCTION__, __LINE__); + } + + // *) Insanity check on the content and ordering of particle histograms in the initialization in configurable cfBookParticleHistograms: + // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. + for (Int_t name = 0; name < eParticleHistograms_N; name++) { + // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookParticleHistograms[name]).BeginsWith(ph.fParticleHistogramsName[name].Data())) { + LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookParticleHistograms => name = %d, lBookParticleHistograms[name] = \"%s\", ph.fParticleHistogramsName[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookParticleHistograms[name]).Data(), ph.fParticleHistogramsName[name].Data()); + } + } + + // I append "&& ph.fFillParticleHistograms" below, to switch off booking of all 1D particle histograms with one common flag: + ph.fBookParticleHistograms[ePhi] = Alright(lBookParticleHistograms[ePhi]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[ePt] = Alright(lBookParticleHistograms[ePt]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[eEta] = Alright(lBookParticleHistograms[eEta]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[eCharge] = Alright(lBookParticleHistograms[eCharge]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcNClsFindable] = Alright(lBookParticleHistograms[etpcNClsFindable]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcNClsShared] = Alright(lBookParticleHistograms[etpcNClsShared]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcNClsFound] = Alright(lBookParticleHistograms[etpcNClsFound]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcNClsCrossedRows] = Alright(lBookParticleHistograms[etpcNClsCrossedRows]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[eitsNCls] = Alright(lBookParticleHistograms[eitsNCls]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[eitsNClsInnerBarrel] = Alright(lBookParticleHistograms[eitsNClsInnerBarrel]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcCrossedRowsOverFindableCls] = Alright(lBookParticleHistograms[etpcCrossedRowsOverFindableCls]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcFoundOverFindableCls] = Alright(lBookParticleHistograms[etpcFoundOverFindableCls]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcFractionSharedCls] = Alright(lBookParticleHistograms[etpcFractionSharedCls]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[edcaXY] = Alright(lBookParticleHistograms[edcaXY]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[edcaZ] = Alright(lBookParticleHistograms[edcaZ]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[ePDG] = Alright(lBookParticleHistograms[ePDG]) && ph.fFillParticleHistograms; + // Remark #1: I do not need here anythig for etrackCutFlagFb1, etrackCutFlagFb2, ... eisGlobalTrack, because they are booleans + // Remark #2: Nothing special here for ePtDependentDCAxyParameterization, because that is a string. + } // end of if(ph.fFillParticleHistograms) // d) Particle histograms 2D: // By default all 2D particle histograms are booked. Set this flag to kFALSE to switch off booking of all 2D particle histograms: ph.fFillParticleHistograms2D = cf_ph.cfFillParticleHistograms2D; - // If you do not want particular 2D particle histogram to be booked, use configurable array cfBookParticleHistograms2D, where you can specify flags 1 (book) or 0 (do not book). - // *) Ordering of the flags in that array is interpreted through ordering of enums in enum eParticleHistograms2D. - auto lBookParticleHistograms2D = cf_ph.cfBookParticleHistograms2D.value; // this is now the local version of that string array from configurable - // TBI 20241113 For some reason, the default values of configurable "cfBookParticleHistograms2D" are not correctly propagated in the local variables, but I can circumvent that with JSON settings for the time being - if (lBookParticleHistograms2D.size() != eParticleHistograms2D_N) { - LOGF(info, "\033[1;31m lBookParticleHistograms2D.size() = %d\033[0m", lBookParticleHistograms2D.size()); - LOGF(info, "\033[1;31m eParticleHistograms2D_N) = %d\033[0m", static_cast(eParticleHistograms2D_N)); - LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookParticleHistograms2D, and number of entries in enum eParticleHistograms2D \n \033[0m", __FUNCTION__, __LINE__); - } + if (ph.fFillParticleHistograms2D) { + // If you do not want particular 2D particle histogram to be booked, use configurable array cfBookParticleHistograms2D, where you can specify flags 1 (book) or 0 (do not book). + // *) Ordering of the flags in that array is interpreted through ordering of enums in enum eParticleHistograms2D. + auto lBookParticleHistograms2D = cf_ph.cfBookParticleHistograms2D.value; // this is now the local version of that string array from configurable + // TBI 20241113 For some reason, the default values of configurable "cfBookParticleHistograms2D" are not correctly propagated in the local variables, but I can circumvent that with JSON settings for the time being + if (lBookParticleHistograms2D.size() != eParticleHistograms2D_N) { + LOGF(info, "\033[1;31m lBookParticleHistograms2D.size() = %d\033[0m", lBookParticleHistograms2D.size()); + LOGF(info, "\033[1;31m eParticleHistograms2D_N) = %d\033[0m", static_cast(eParticleHistograms2D_N)); + LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookParticleHistograms2D, and number of entries in enum eParticleHistograms2D \n \033[0m", __FUNCTION__, __LINE__); + } - // *) Insanity check on the content and ordering of 2D particle histograms in the initialization in configurable cfBookParticleHistograms2D: - // TBI 20241109 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. - for (Int_t name = 0; name < eParticleHistograms2D_N; name++) { - // TBI 20241109 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookParticleHistograms2D[name]).BeginsWith(ph.fParticleHistogramsName2D[name].Data())) { - LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookParticleHistograms2D => name = %d, lBookParticleHistograms2D[name] = \"%s\", ph.fParticleHistogramsName2D[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookParticleHistograms2D[name]).Data(), ph.fParticleHistogramsName2D[name].Data()); + // *) Insanity check on the content and ordering of 2D particle histograms in the initialization in configurable cfBookParticleHistograms2D: + // TBI 20241109 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. + for (Int_t name = 0; name < eParticleHistograms2D_N; name++) { + // TBI 20241109 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookParticleHistograms2D[name]).BeginsWith(ph.fParticleHistogramsName2D[name].Data())) { + LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookParticleHistograms2D => name = %d, lBookParticleHistograms2D[name] = \"%s\", ph.fParticleHistogramsName2D[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookParticleHistograms2D[name]).Data(), ph.fParticleHistogramsName2D[name].Data()); + } } - } - // I append "&& ph.fFillParticleHistograms2D" below, to switch off booking of all 2D particle histograms with one common flag: - ph.fBookParticleHistograms2D[ePhiPt] = Alright(lBookParticleHistograms2D[ePhiPt]) && ph.fFillParticleHistograms2D; - ph.fBookParticleHistograms2D[ePhiEta] = Alright(lBookParticleHistograms2D[ePhiEta]) && ph.fFillParticleHistograms2D; + // I append "&& ph.fFillParticleHistograms2D" below, to switch off booking of all 2D particle histograms with one common flag: + ph.fBookParticleHistograms2D[ePhiPt] = Alright(lBookParticleHistograms2D[ePhiPt]) && ph.fFillParticleHistograms2D; + ph.fBookParticleHistograms2D[ePhiEta] = Alright(lBookParticleHistograms2D[ePhiEta]) && ph.fFillParticleHistograms2D; + } // end of if (ph.fFillParticleHistograms2D) // e) QA: // **) QA 2D event histograms: qa.fFillQAEventHistograms2D = cf_qa.cfFillQAEventHistograms2D; - // *) If you do not want particular 2D event histogram to be booked, use configurable array cfBookQAEventHistograms2D, where you can specify flags 1 (book) or 0 (do not book). - // Ordering of the flags in that array is interpreted through ordering of enums in enum eQAEventHistograms2D - auto lBookQAEventHistograms2D = cf_qa.cfBookQAEventHistograms2D.value; // this is now the local version of that string array from configurable - // TBI 20241115 For some reason, the default values of configurable "cfBookQAEventHistograms2D" are not correctly propagated in the local variables, but I can circumvent that with JSON settings for the time being - if (lBookQAEventHistograms2D.size() != eQAEventHistograms2D_N) { - LOGF(info, "\033[1;31m lBookQAEventHistograms2D.size() = %d\033[0m", lBookQAEventHistograms2D.size()); - LOGF(info, "\033[1;31m eQAEventHistograms2D_N = %d\033[0m", static_cast(eQAEventHistograms2D_N)); - LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookQAEventHistograms2D, and number of entries in enum eQAEventHistograms2D \n \033[0m", __FUNCTION__, __LINE__); - } - - // *) Insanity check on the content and ordering of QA 2D event histograms in the initialization in configurable cfBookQAEventHistograms2D: - // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. - for (Int_t name = 0; name < eQAEventHistograms2D_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookQAEventHistograms2D[name]).BeginsWith(qa.fEventHistogramsName2D[name].Data())) { - LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookQAEventHistograms2D => name = %d, lBookQAEventHistograms2D[name] = \"%s\", qa.fEventHistogramsName2D[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookQAEventHistograms2D[name]).Data(), qa.fEventHistogramsName2D[name].Data()); - } - } - - // I append "&& qa.fFillQAEventHistograms2D" below, to switch off booking of all 2D event histograms with one common flag: - qa.fBookQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eMultiplicity_vs_NContributors] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_NContributors]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eMultiplicity_vs_Centrality] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Centrality]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eMultiplicity_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eMultiplicity_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Occupancy]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_NContributors] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_NContributors]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Centrality] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Centrality]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Occupancy]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eNContributors_vs_Centrality] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Centrality]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eNContributors_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eNContributors_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Occupancy]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCentrality_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eCentrality_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCentrality_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eCentrality_vs_Occupancy]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eVertex_z_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eVertex_z_vs_Occupancy]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCentFT0C_vs_CentNTPV] = Alright(lBookQAEventHistograms2D[eCentFT0C_vs_CentNTPV]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCentFT0M_vs_CentNTPV] = Alright(lBookQAEventHistograms2D[eCentFT0M_vs_CentNTPV]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets] = Alright(lBookQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = Alright(lBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange]) && qa.fFillQAEventHistograms2D; + if (qa.fFillQAEventHistograms2D) { + // *) If you do not want particular 2D event histogram to be booked, use configurable array cfBookQAEventHistograms2D, where you can specify flags 1 (book) or 0 (do not book). + // Ordering of the flags in that array is interpreted through ordering of enums in enum eQAEventHistograms2D + auto lBookQAEventHistograms2D = cf_qa.cfBookQAEventHistograms2D.value; // this is now the local version of that string array from configurable + // TBI 20241115 For some reason, the default values of configurable "cfBookQAEventHistograms2D" are not correctly propagated in the local variables, but I can circumvent that with JSON settings for the time being + if (lBookQAEventHistograms2D.size() != eQAEventHistograms2D_N) { + LOGF(info, "\033[1;31m lBookQAEventHistograms2D.size() = %d\033[0m", lBookQAEventHistograms2D.size()); + LOGF(info, "\033[1;31m eQAEventHistograms2D_N = %d\033[0m", static_cast(eQAEventHistograms2D_N)); + LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookQAEventHistograms2D, and number of entries in enum eQAEventHistograms2D \n \033[0m", __FUNCTION__, __LINE__); + } + + // *) Insanity check on the content and ordering of QA 2D event histograms in the initialization in configurable cfBookQAEventHistograms2D: + // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. + for (Int_t name = 0; name < eQAEventHistograms2D_N; name++) { + // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookQAEventHistograms2D[name]).BeginsWith(qa.fEventHistogramsName2D[name].Data())) { + LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookQAEventHistograms2D => name = %d, lBookQAEventHistograms2D[name] = \"%s\", qa.fEventHistogramsName2D[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookQAEventHistograms2D[name]).Data(), qa.fEventHistogramsName2D[name].Data()); + } + } + + // I append "&& qa.fFillQAEventHistograms2D" below, to switch off booking of all 2D event histograms with one common flag: + qa.fBookQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_NContributors] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_NContributors]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_Centrality] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Centrality]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_NContributors] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_NContributors]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Centrality] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Centrality]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eNContributors_vs_Centrality] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Centrality]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eNContributors_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eNContributors_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentrality_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eCentrality_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentrality_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eCentrality_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eVertex_z_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eVertex_z_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentFT0C_vs_CentNTPV] = Alright(lBookQAEventHistograms2D[eCentFT0C_vs_CentNTPV]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentFT0M_vs_CentNTPV] = Alright(lBookQAEventHistograms2D[eCentFT0M_vs_CentNTPV]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets] = Alright(lBookQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = Alright(lBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate] = Alright(lBookQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate]) && qa.fFillQAEventHistograms2D; + } // end of if (qa.fFillQAEventHistograms2D) // **) QA 2D particle histograms: qa.fFillQAParticleHistograms2D = cf_qa.cfFillQAParticleHistograms2D; - // *) If you do not want particular 2D particle histogram to be booked, use configurable array cfBookQAParticleHistograms2D, where you can specify flags 1 (book) or 0 (do not book). - // Ordering of the flags in that array is interpreted through ordering of enums in enum eQAParticleHistograms2D. - auto lBookQAParticleHistograms2D = (vector)cf_qa.cfBookQAParticleHistograms2D; // this is now the local version of that int array from configurable - if (lBookQAParticleHistograms2D.size() != eQAParticleHistograms2D_N) { - LOGF(info, "\033[1;31m lBookQAParticleHistograms2D.size() = %d\033[0m", lBookQAParticleHistograms2D.size()); - LOGF(info, "\033[1;31m eQAParticleHistograms2D_N = %d\033[0m", static_cast(eQAParticleHistograms2D_N)); - LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookQAParticleHistograms2D, and number of entries in enum eParticleHistograms2D \n \033[0m", __FUNCTION__, __LINE__); - } + if (qa.fFillQAParticleHistograms2D) { + // *) If you do not want particular 2D particle histogram to be booked, use configurable array cfBookQAParticleHistograms2D, where you can specify flags 1 (book) or 0 (do not book). + // Ordering of the flags in that array is interpreted through ordering of enums in enum eQAParticleHistograms2D. + auto lBookQAParticleHistograms2D = (vector)cf_qa.cfBookQAParticleHistograms2D; // this is now the local version of that int array from configurable + if (lBookQAParticleHistograms2D.size() != eQAParticleHistograms2D_N) { + LOGF(info, "\033[1;31m lBookQAParticleHistograms2D.size() = %d\033[0m", lBookQAParticleHistograms2D.size()); + LOGF(info, "\033[1;31m eQAParticleHistograms2D_N = %d\033[0m", static_cast(eQAParticleHistograms2D_N)); + LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookQAParticleHistograms2D, and number of entries in enum eParticleHistograms2D \n \033[0m", __FUNCTION__, __LINE__); + } - // *) Insanity check on the content and ordering of QA 2D particle histograms in the initialization in configurable cfBookQAParticleHistograms2D: - // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. - for (Int_t name = 0; name < eQAParticleHistograms2D_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookQAParticleHistograms2D[name]).BeginsWith(qa.fParticleHistogramsName2D[name].Data())) { - LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookQAParticleHistograms2D => name = %d, lBookQAParticleHistograms2D[name] = \"%s\", qa.fParticleHistogramsName2D[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookQAParticleHistograms2D[name]).Data(), qa.fParticleHistogramsName2D[name].Data()); + // *) Insanity check on the content and ordering of QA 2D particle histograms in the initialization in configurable cfBookQAParticleHistograms2D: + // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. + for (Int_t name = 0; name < eQAParticleHistograms2D_N; name++) { + // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookQAParticleHistograms2D[name]).BeginsWith(qa.fParticleHistogramsName2D[name].Data())) { + LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookQAParticleHistograms2D => name = %d, lBookQAParticleHistograms2D[name] = \"%s\", qa.fParticleHistogramsName2D[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookQAParticleHistograms2D[name]).Data(), qa.fParticleHistogramsName2D[name].Data()); + } } - } - // I append "&& qa.fFillQAParticleHistograms2D" below, to switch off booking of all 2D particle histograms with one common flag: - qa.fBookQAParticleHistograms2D[ePt_vs_dcaXY] = Alright(lBookQAParticleHistograms2D[ePt_vs_dcaXY]) && qa.fFillQAParticleHistograms2D; + // I append "&& qa.fFillQAParticleHistograms2D" below, to switch off booking of all 2D particle histograms with one common flag: + qa.fBookQAParticleHistograms2D[ePt_vs_dcaXY] = Alright(lBookQAParticleHistograms2D[ePt_vs_dcaXY]) && qa.fFillQAParticleHistograms2D; + } // end of if (qa.fFillQAParticleHistograms2D) // ... @@ -813,15 +857,15 @@ void DefaultBinning() eh.fEventHistogramsBins[eNumberOfEvents][1] = 0.; eh.fEventHistogramsBins[eNumberOfEvents][2] = 1.; - eh.fEventHistogramsBins[eTotalMultiplicity][0] = 10000. / qa.fRebin; + eh.fEventHistogramsBins[eTotalMultiplicity][0] = 10000.; eh.fEventHistogramsBins[eTotalMultiplicity][1] = 0.; eh.fEventHistogramsBins[eTotalMultiplicity][2] = 100000.; - eh.fEventHistogramsBins[eMultiplicity][0] = 2000. / qa.fRebin; + eh.fEventHistogramsBins[eMultiplicity][0] = 2000.; eh.fEventHistogramsBins[eMultiplicity][1] = 0.; eh.fEventHistogramsBins[eMultiplicity][2] = 20000.; - eh.fEventHistogramsBins[eReferenceMultiplicity][0] = 6000. / qa.fRebin; + eh.fEventHistogramsBins[eReferenceMultiplicity][0] = 6000.; eh.fEventHistogramsBins[eReferenceMultiplicity][1] = 0.; eh.fEventHistogramsBins[eReferenceMultiplicity][2] = 60000.; @@ -841,7 +885,7 @@ void DefaultBinning() eh.fEventHistogramsBins[eVertex_z][1] = -40.; eh.fEventHistogramsBins[eVertex_z][2] = 40.; - eh.fEventHistogramsBins[eNContributors][0] = 1000. / qa.fRebin; + eh.fEventHistogramsBins[eNContributors][0] = 1000.; eh.fEventHistogramsBins[eNContributors][1] = 0.; eh.fEventHistogramsBins[eNContributors][2] = 10000.; @@ -850,21 +894,29 @@ void DefaultBinning() eh.fEventHistogramsBins[eImpactParameter][2] = 1000.; if (ec.fsEventCuts[eOccupancyEstimator].EqualTo("TrackOccupancyInTimeRange", TString::kIgnoreCase)) { - eh.fEventHistogramsBins[eOccupancy][0] = 151; - eh.fEventHistogramsBins[eOccupancy][1] = -100.; // It's set to -1 if not meaningful TBI 20241109 check this further + eh.fEventHistogramsBins[eOccupancy][0] = 150; + eh.fEventHistogramsBins[eOccupancy][1] = 0.; // It's set to -1 if not meaningful TBI 20241109 check this further eh.fEventHistogramsBins[eOccupancy][2] = 15000.; } else if (ec.fsEventCuts[eOccupancyEstimator].EqualTo("FT0COccupancyInTimeRange", TString::kIgnoreCase)) { // keep in sync with values below for 2D QA - eh.fEventHistogramsBins[eOccupancy][0] = 601; - eh.fEventHistogramsBins[eOccupancy][1] = -100.; // It's set to -1 if not meaningful TBI 20241109 check this further - eh.fEventHistogramsBins[eOccupancy][2] = 60000.; + eh.fEventHistogramsBins[eOccupancy][0] = 1000; + eh.fEventHistogramsBins[eOccupancy][1] = 0.; // It's set to -1 if not meaningful TBI 20241109 check this further + eh.fEventHistogramsBins[eOccupancy][2] = 100000.; } // For 2D QA correlation plot, temporarily I set it to maximum of the 2 => TBI 20241114 this can be refined if (qa.fBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange]) { - eh.fEventHistogramsBins[eOccupancy][0] = 601; - eh.fEventHistogramsBins[eOccupancy][1] = -100.; // It's set to -1 if not meaningful TBI 20241109 check this further + eh.fEventHistogramsBins[eOccupancy][0] = 600; + eh.fEventHistogramsBins[eOccupancy][1] = 0.; // It's set to -1 if not meaningful TBI 20241109 check this further eh.fEventHistogramsBins[eOccupancy][2] = 60000.; } + eh.fEventHistogramsBins[eInteractionRate][0] = 20000; // TBI 20241127 Remember that I do not have configurables for binning of control histograms, only for results histograms + eh.fEventHistogramsBins[eInteractionRate][1] = 0.; + eh.fEventHistogramsBins[eInteractionRate][2] = 200.; + + eh.fEventHistogramsBins[eCurrentRunDuration][0] = 10000; // TBI 20241128 Remember that I do not have configurables for binning of control histograms, only for results histograms + eh.fEventHistogramsBins[eCurrentRunDuration][1] = 0.; + eh.fEventHistogramsBins[eCurrentRunDuration][2] = 100000.; + // b) Default binning for particle histograms 1D: ph.fParticleHistogramsBins[ePhi][0] = 360; ph.fParticleHistogramsBins[ePhi][1] = 0.; @@ -963,6 +1015,10 @@ void DefaultBinning() this->InitializeFixedLengthBins(AFO_ETA); // *) Fixed-length binning vs. occupancy: this->InitializeFixedLengthBins(AFO_OCCUPANCY); + // *) Fixed-length binning vs. interaction rate: + this->InitializeFixedLengthBins(AFO_INTERACTIONRATE); + // *) Fixed-length binning vs. run duration: + this->InitializeFixedLengthBins(AFO_CURRENTRUNDURATION); // e) Variable-length binning set via MuPa-Configurables.h: // *) Variable-length binning vs. multiplicity: @@ -985,6 +1041,14 @@ void DefaultBinning() if (cf_res.cfUseVariableLength_occu_bins) { this->InitializeVariableLengthBins(AFO_OCCUPANCY); } + // *) Variable-length binning vs. interaction rate: + if (cf_res.cfUseVariableLength_ir_bins) { + this->InitializeVariableLengthBins(AFO_INTERACTIONRATE); + } + // *) Variable-length binning vs. run duration: + if (cf_res.cfUseVariableLength_crd_bins) { + this->InitializeVariableLengthBins(AFO_CURRENTRUNDURATION); + } if (tc.fVerbose) { ExitFunction(__FUNCTION__); @@ -1022,6 +1086,12 @@ void InitializeFixedLengthBins(eAsFunctionOf AFO) case AFO_OCCUPANCY: lFixedLength_bins = cf_res.cfFixedLength_occu_bins.value; break; + case AFO_INTERACTIONRATE: + lFixedLength_bins = cf_res.cfFixedLength_ir_bins.value; + break; + case AFO_CURRENTRUNDURATION: + lFixedLength_bins = cf_res.cfFixedLength_crd_bins.value; + break; // ... default: LOGF(fatal, "\033[1;31m%s at line %d : This enum AFO = %d is not supported yet. \033[0m", __FUNCTION__, __LINE__, static_cast(AFO)); @@ -1076,6 +1146,12 @@ void InitializeVariableLengthBins(eAsFunctionOf AFO) case AFO_OCCUPANCY: lVariableLength_bins = cf_res.cfVariableLength_occu_bins.value; break; + case AFO_INTERACTIONRATE: + lVariableLength_bins = cf_res.cfVariableLength_ir_bins.value; + break; + case AFO_CURRENTRUNDURATION: + lVariableLength_bins = cf_res.cfVariableLength_crd_bins.value; + break; // ... default: LOGF(fatal, "\033[1;31m%s at line %d : This enum AFO = %d is not supported yet. \033[0m", __FUNCTION__, __LINE__, static_cast(AFO)); @@ -1185,6 +1261,8 @@ void DefaultCuts() ec.fUseEventCuts[eNContributors] = Alright(lUseEventCuts[eNContributors]); ec.fUseEventCuts[eImpactParameter] = Alright(lUseEventCuts[eImpactParameter]); ec.fUseEventCuts[eOccupancy] = Alright(lUseEventCuts[eOccupancy]); + ec.fUseEventCuts[eInteractionRate] = Alright(lUseEventCuts[eInteractionRate]); + ec.fUseEventCuts[eCurrentRunDuration] = Alright(lUseEventCuts[eCurrentRunDuration]); ec.fUseEventCuts[eMultMCNParticlesEta08] = Alright(lUseEventCuts[eMultMCNParticlesEta08]); // *) from enum eEventCuts: @@ -1256,6 +1334,14 @@ void DefaultCuts() ec.fdEventCuts[eOccupancy][eMin] = lOccupancy[eMin]; ec.fdEventCuts[eOccupancy][eMax] = lOccupancy[eMax]; + auto lInteractionRate = (vector)cf_ec.cfInteractionRate; + ec.fdEventCuts[eInteractionRate][eMin] = lInteractionRate[eMin]; + ec.fdEventCuts[eInteractionRate][eMax] = lInteractionRate[eMax]; + + auto lCurrentRunDuration = (vector)cf_ec.cfCurrentRunDuration; + ec.fdEventCuts[eCurrentRunDuration][eMin] = lCurrentRunDuration[eMin]; + ec.fdEventCuts[eCurrentRunDuration][eMax] = lCurrentRunDuration[eMax]; + auto lMultMCNParticlesEta08 = (vector)cf_ec.cfMultMCNParticlesEta08; ec.fdEventCuts[eMultMCNParticlesEta08][eMin] = lMultMCNParticlesEta08[eMin]; ec.fdEventCuts[eMultMCNParticlesEta08][eMax] = lMultMCNParticlesEta08[eMax]; @@ -1449,10 +1535,98 @@ void SpecificCuts(TString whichSpecificCuts) //============================================================ +void InsanityChecksOnDefinitionsOfConfigurables() +{ + // Do insanity checks on values obtained from configurables before using them in the remaining function. + // This is really important, because one misconfigured configurable (e.g. boolean set to string), causes the whole json config to die silently, and + // only default values from MuPa-Configurables.h are used. + // Here I only check if configurables are correctly defined, I do NOT here initialize local variables with configurables, that is done later. + // Example misconfiguration in JSON: + // "var": "true", => var = 1 + other configurables are processed correctly + // "var": "truee", => var = 0 + all settings in JSON for configurables are ingored silently + + // TBI 20241127 finalize this function eventually. This is not urgent, though, as only a check below on cfTaskIsConfiguredFromJson covers most cases already. + + // Remark: Ordering below reflects the ordering in Configurables.h, not in DataMembers.h + // a) Task configuration; + // b) QA; + // c) Event histograms; + // d) Event cuts; + // e) Particle histograms; + // f) Particle cuts; + // g) Q-vectors; + // h) Multiparticle correlations; + // i) Test0; + // j) Particle weights; + // k) Centrality weights; + // l) Nested loops; + // m) Toy NUA; + // n) Internal validation; + // o) Results histograms. + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // a) Task configuration: + if (!TString(cf_tc.cfTaskIsConfiguredFromJson).EqualTo("yes")) { + LOGF(fatal, "\033[1;31m%s at line %d : configurable cfTaskIsConfiguredFromJson = \"%s\", but it has to be set to \"yes\" in JSON => most likely some other configurable is misconfigured and all remaining settings in JSON are ignored silently\033[0m", __FUNCTION__, __LINE__, TString(cf_tc.cfTaskIsConfiguredFromJson).Data()); + } + + // b) QA: + // ... + + // c) Event histograms: + // ... + + // d) Event cuts: + // ... + + // e) Particle histograms: + // ... + + // f) Particle cuts: + // ... + + // g) Q-vectors: + // ... + + // h) Multiparticle correlations: + // ... + + // i) Test0: + // ... + + // j) Particle weights: + // ... + + // k) Centrality weights: + // ... + + // l) Nested loops: + // ... + + // m) Toy NUA: + // ... + + // n) Internal validation: + // ... + + // o) Results histograms: + // ... + + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // InsanityChecksOnDefinitionsOfConfigurables() + +//============================================================ + void InsanityChecksBeforeBooking() { - // Do insanity checks on configuration, binning and cuts. Values to be checked are either hardwired locally, or obtained from configurables. - // Remember that here I cannot do insanity checks on local hostograms, etc., because they are not vbooked yet. + // Do insanity checks on configuration, binning and cuts. Values obtained from configurables are checked before being used in InsanityChecksOnDefinitionsOfConfigurables(). + // Remember that here I cannot do insanity checks on local histograms, etc., because they are not booked yet. // For those additional checks, use InsanityChecksAfterBooking(). // a) Insanity checks on configuration; @@ -2001,151 +2175,151 @@ void BookQAHistograms() TString title_y_Event[eQAEventHistograms2D_N] = {""}; // *) "Multiplicity_vs_ReferenceMultiplicity": - nBins_x_Event[eMultiplicity_vs_ReferenceMultiplicity] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eMultiplicity_vs_ReferenceMultiplicity] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0] / qa.fRebin); min_x_Event[eMultiplicity_vs_ReferenceMultiplicity] = eh.fEventHistogramsBins[eMultiplicity][1]; max_x_Event[eMultiplicity_vs_ReferenceMultiplicity] = eh.fEventHistogramsBins[eMultiplicity][2]; title_x_Event[eMultiplicity_vs_ReferenceMultiplicity] = FancyFormatting(eh.fEventHistogramsName[eMultiplicity].Data()); - nBins_y_Event[eMultiplicity_vs_ReferenceMultiplicity] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eMultiplicity_vs_ReferenceMultiplicity] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0] / qa.fRebin); min_y_Event[eMultiplicity_vs_ReferenceMultiplicity] = eh.fEventHistogramsBins[eReferenceMultiplicity][1]; max_y_Event[eMultiplicity_vs_ReferenceMultiplicity] = eh.fEventHistogramsBins[eReferenceMultiplicity][2]; title_y_Event[eMultiplicity_vs_ReferenceMultiplicity] = FancyFormatting(eh.fEventHistogramsName[eReferenceMultiplicity].Data()); // *) "Multiplicity_vs_NContributors": - nBins_x_Event[eMultiplicity_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eMultiplicity_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0] / qa.fRebin); min_x_Event[eMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eMultiplicity][1]; max_x_Event[eMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eMultiplicity][2]; title_x_Event[eMultiplicity_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eMultiplicity].Data()); - nBins_y_Event[eMultiplicity_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eMultiplicity_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eNContributors][0] / qa.fRebin); min_y_Event[eMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][1]; max_y_Event[eMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][2]; title_y_Event[eMultiplicity_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); // *) "Multiplicity_vs_Centrality": - nBins_x_Event[eMultiplicity_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eMultiplicity_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0] / qa.fRebin); min_x_Event[eMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eMultiplicity][1]; max_x_Event[eMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eMultiplicity][2]; title_x_Event[eMultiplicity_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eMultiplicity].Data()); - nBins_y_Event[eMultiplicity_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eMultiplicity_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); min_y_Event[eMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][1]; max_y_Event[eMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][2]; title_y_Event[eMultiplicity_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); // *) "Multiplicity_vs_Vertex_z": - nBins_x_Event[eMultiplicity_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eMultiplicity_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0] / qa.fRebin); min_x_Event[eMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eMultiplicity][1]; max_x_Event[eMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eMultiplicity][2]; title_x_Event[eMultiplicity_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eMultiplicity].Data()); - nBins_y_Event[eMultiplicity_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eMultiplicity_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); min_y_Event[eMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][1]; max_y_Event[eMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][2]; title_y_Event[eMultiplicity_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); // *) "Multiplicity_vs_Occupancy": - nBins_x_Event[eMultiplicity_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eMultiplicity_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0] / qa.fRebin); min_x_Event[eMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eMultiplicity][1]; max_x_Event[eMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eMultiplicity][2]; title_x_Event[eMultiplicity_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eMultiplicity].Data()); - nBins_y_Event[eMultiplicity_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eMultiplicity_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0] / qa.fRebin); min_y_Event[eMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][1]; max_y_Event[eMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][2]; title_y_Event[eMultiplicity_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eOccupancy].Data()); // *) "ReferenceMultiplicity_vs_NContributors": - nBins_x_Event[eReferenceMultiplicity_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eReferenceMultiplicity_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0] / qa.fRebin); min_x_Event[eReferenceMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eReferenceMultiplicity][1]; max_x_Event[eReferenceMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eReferenceMultiplicity][2]; title_x_Event[eReferenceMultiplicity_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eReferenceMultiplicity].Data()); - nBins_y_Event[eReferenceMultiplicity_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eReferenceMultiplicity_vs_NContributors] = static_cast(eh.fEventHistogramsBins[eNContributors][0] / qa.fRebin); min_y_Event[eReferenceMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][1]; max_y_Event[eReferenceMultiplicity_vs_NContributors] = eh.fEventHistogramsBins[eNContributors][2]; title_y_Event[eReferenceMultiplicity_vs_NContributors] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); // *) "ReferenceMultiplicity_vs_Centrality": - nBins_x_Event[eReferenceMultiplicity_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eReferenceMultiplicity_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0] / qa.fRebin); min_x_Event[eReferenceMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eReferenceMultiplicity][1]; max_x_Event[eReferenceMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eReferenceMultiplicity][2]; title_x_Event[eReferenceMultiplicity_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eReferenceMultiplicity].Data()); - nBins_y_Event[eReferenceMultiplicity_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eReferenceMultiplicity_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); min_y_Event[eReferenceMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][1]; max_y_Event[eReferenceMultiplicity_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][2]; title_y_Event[eReferenceMultiplicity_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); // *) "ReferenceMultiplicity_vs_Vertex_z": - nBins_x_Event[eReferenceMultiplicity_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eReferenceMultiplicity_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0] / qa.fRebin); min_x_Event[eReferenceMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eReferenceMultiplicity][1]; max_x_Event[eReferenceMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eReferenceMultiplicity][2]; title_x_Event[eReferenceMultiplicity_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eReferenceMultiplicity].Data()); - nBins_y_Event[eReferenceMultiplicity_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eReferenceMultiplicity_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); min_y_Event[eReferenceMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][1]; max_y_Event[eReferenceMultiplicity_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][2]; title_y_Event[eReferenceMultiplicity_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); // *) "ReferenceMultiplicity_vs_Occupancy": - nBins_x_Event[eReferenceMultiplicity_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eReferenceMultiplicity_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eReferenceMultiplicity][0] / qa.fRebin); min_x_Event[eReferenceMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eReferenceMultiplicity][1]; max_x_Event[eReferenceMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eReferenceMultiplicity][2]; title_x_Event[eReferenceMultiplicity_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eReferenceMultiplicity].Data()); - nBins_y_Event[eReferenceMultiplicity_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eReferenceMultiplicity_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0] / qa.fRebin); min_y_Event[eReferenceMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][1]; max_y_Event[eReferenceMultiplicity_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][2]; title_y_Event[eReferenceMultiplicity_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eOccupancy].Data()); // *) "NContributors_vs_Centrality": - nBins_x_Event[eNContributors_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eNContributors_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eNContributors][0] / qa.fRebin); min_x_Event[eNContributors_vs_Centrality] = eh.fEventHistogramsBins[eNContributors][1]; max_x_Event[eNContributors_vs_Centrality] = eh.fEventHistogramsBins[eNContributors][2]; title_x_Event[eNContributors_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); - nBins_y_Event[eNContributors_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eNContributors_vs_Centrality] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); min_y_Event[eNContributors_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][1]; max_y_Event[eNContributors_vs_Centrality] = eh.fEventHistogramsBins[eCentrality][2]; title_y_Event[eNContributors_vs_Centrality] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); // *) "NContributors_vs_Vertex_z": - nBins_x_Event[eNContributors_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eNContributors_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eNContributors][0] / qa.fRebin); min_x_Event[eNContributors_vs_Vertex_z] = eh.fEventHistogramsBins[eNContributors][1]; max_x_Event[eNContributors_vs_Vertex_z] = eh.fEventHistogramsBins[eNContributors][2]; title_x_Event[eNContributors_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); - nBins_y_Event[eNContributors_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eNContributors_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); min_y_Event[eNContributors_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][1]; max_y_Event[eNContributors_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][2]; title_y_Event[eNContributors_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); // *) "NContributors_vs_Occupancy": - nBins_x_Event[eNContributors_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eNContributors][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eNContributors_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eNContributors][0] / qa.fRebin); min_x_Event[eNContributors_vs_Occupancy] = eh.fEventHistogramsBins[eNContributors][1]; max_x_Event[eNContributors_vs_Occupancy] = eh.fEventHistogramsBins[eNContributors][2]; title_x_Event[eNContributors_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eNContributors].Data()); - nBins_y_Event[eNContributors_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eNContributors_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0] / qa.fRebin); min_y_Event[eNContributors_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][1]; max_y_Event[eNContributors_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][2]; title_y_Event[eNContributors_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eOccupancy].Data()); // *) "Centrality_vs_Vertex_z": - nBins_x_Event[eCentrality_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eCentrality_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); min_x_Event[eCentrality_vs_Vertex_z] = eh.fEventHistogramsBins[eCentrality][1]; max_x_Event[eCentrality_vs_Vertex_z] = eh.fEventHistogramsBins[eCentrality][2]; title_x_Event[eCentrality_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); - nBins_y_Event[eCentrality_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eCentrality_vs_Vertex_z] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); min_y_Event[eCentrality_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][1]; max_y_Event[eCentrality_vs_Vertex_z] = eh.fEventHistogramsBins[eVertex_z][2]; title_y_Event[eCentrality_vs_Vertex_z] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); // *) "Centrality_vs_Occupancy": - nBins_x_Event[eCentrality_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eCentrality_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); min_x_Event[eCentrality_vs_Occupancy] = eh.fEventHistogramsBins[eCentrality][1]; max_x_Event[eCentrality_vs_Occupancy] = eh.fEventHistogramsBins[eCentrality][2]; title_x_Event[eCentrality_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); - nBins_y_Event[eCentrality_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eCentrality_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0] / qa.fRebin); min_y_Event[eCentrality_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][1]; max_y_Event[eCentrality_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][2]; title_y_Event[eCentrality_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eOccupancy].Data()); // *) "Vertex_z_vs_Occupancy": - nBins_x_Event[eVertex_z_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); // TBI 20240702 add support for rebinning + nBins_x_Event[eVertex_z_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); min_x_Event[eVertex_z_vs_Occupancy] = eh.fEventHistogramsBins[eVertex_z][1]; max_x_Event[eVertex_z_vs_Occupancy] = eh.fEventHistogramsBins[eVertex_z][2]; title_x_Event[eVertex_z_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eVertex_z].Data()); - nBins_y_Event[eVertex_z_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); // TBI 20240702 add support for rebinning + nBins_y_Event[eVertex_z_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eOccupancy][0] / qa.fRebin); min_y_Event[eVertex_z_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][1]; max_y_Event[eVertex_z_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][2]; title_y_Event[eVertex_z_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eOccupancy].Data()); @@ -2181,15 +2355,25 @@ void BookQAHistograms() title_y_Event[eCentRun2V0M_vs_CentRun2SPDTracklets] = FancyFormatting(qa.fCentralityEstimatorName[eCentRun2SPDTracklets].Data()); // *) "eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange": - nBins_x_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); + nBins_x_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = static_cast(eh.fEventHistogramsBins[eOccupancy][0] / qa.fRebin); min_x_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = eh.fEventHistogramsBins[eOccupancy][1]; max_x_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = eh.fEventHistogramsBins[eOccupancy][2]; title_x_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = FancyFormatting(qa.fOccupancyEstimatorName[eTrackOccupancyInTimeRange].Data()); - nBins_y_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = static_cast(eh.fEventHistogramsBins[eOccupancy][0]); + nBins_y_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = static_cast(eh.fEventHistogramsBins[eOccupancy][0] / qa.fRebin); min_y_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = eh.fEventHistogramsBins[eOccupancy][1]; max_y_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = eh.fEventHistogramsBins[eOccupancy][2]; title_y_Event[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = FancyFormatting(qa.fOccupancyEstimatorName[eFT0COccupancyInTimeRange].Data()); + // *) "eCurrentRunDuration_vs_InteractionRate": + nBins_x_Event[eCurrentRunDuration_vs_InteractionRate] = static_cast(eh.fEventHistogramsBins[eCurrentRunDuration][0] / qa.fRebin); + min_x_Event[eCurrentRunDuration_vs_InteractionRate] = eh.fEventHistogramsBins[eCurrentRunDuration][1]; + max_x_Event[eCurrentRunDuration_vs_InteractionRate] = eh.fEventHistogramsBins[eCurrentRunDuration][2]; + title_x_Event[eCurrentRunDuration_vs_InteractionRate] = FancyFormatting(eh.fEventHistogramsName[eCurrentRunDuration].Data()); + nBins_y_Event[eCurrentRunDuration_vs_InteractionRate] = static_cast(eh.fEventHistogramsBins[eInteractionRate][0] / qa.fRebin); + min_y_Event[eCurrentRunDuration_vs_InteractionRate] = eh.fEventHistogramsBins[eInteractionRate][1]; + max_y_Event[eCurrentRunDuration_vs_InteractionRate] = eh.fEventHistogramsBins[eInteractionRate][2]; + title_y_Event[eCurrentRunDuration_vs_InteractionRate] = FancyFormatting(eh.fEventHistogramsName[eInteractionRate].Data()); + // ... // *) Quick insanity check on title_x_Event and title_y_Event: @@ -2241,7 +2425,7 @@ void BookQAHistograms() qa.fQAEventHistograms2D[t][rs][ba] = new TH2F( Form("fQAEventHistograms2D[%s][%s][%s]", qa.fEventHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in DetermineAndPropagateRunNumber(T const& collision) + Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) nBins_x_Event[t], min_x_Event[t], max_x_Event[t], nBins_y_Event[t], min_y_Event[t], max_y_Event[t]); qa.fQAEventHistograms2D[t][rs][ba]->GetXaxis()->SetTitle(title_x_Event[t].Data()); qa.fQAEventHistograms2D[t][rs][ba]->GetYaxis()->SetTitle(title_y_Event[t].Data()); @@ -2305,7 +2489,7 @@ void BookQAHistograms() { qa.fQAParticleHistograms2D[t][rs][ba] = new TH2F( Form("fQAParticleHistograms2D[%s][%s][%s]", qa.fParticleHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in DetermineAndPropagateRunNumber(T const& collision) + Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) nBins_x_Particle[t], min_x_Particle[t], max_x_Particle[t], nBins_y_Particle[t], min_y_Particle[t], max_y_Particle[t]); qa.fQAParticleHistograms2D[t][rs][ba]->GetXaxis()->SetTitle(title_x_Particle[t].Data()); @@ -2376,7 +2560,7 @@ void BookEventHistograms() } eh.fEventHistograms[t][rs][ba] = new TH1F( Form("fEventHistograms[%s][%s][%s]", eh.fEventHistogramsName[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in DetermineAndPropagateRunNumber(T const& collision) + Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) static_cast(eh.fEventHistogramsBins[t][0]), eh.fEventHistogramsBins[t][1], eh.fEventHistogramsBins[t][2]); eh.fEventHistograms[t][rs][ba]->GetXaxis()->SetTitle(FancyFormatting(eh.fEventHistogramsName[t].Data())); @@ -2570,7 +2754,7 @@ void BookParticleHistograms() // optional variable-length binning for y-axis (for supported observables): if (ph.fParticleHistogramsName2D[t].EqualTo("Phi_vs_Pt") && res.fUseResultsProVariableLengthBins[AFO_PT]) { - // Remark: placeholder __RUN_NUMBER__ is handled in DetermineAndPropagateRunNumber(T const& collision) + // Remark: placeholder __RUN_NUMBER__ is handled in PropagateRunNumber(...) // *) variable-length binning for phi vs pt, but only in pt axis: ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), @@ -2793,6 +2977,12 @@ void BookCorrelationsHistograms() if (AFO_OCCUPANCY == v && !mupa.fCalculateCorrelationsAsFunctionOf[AFO_OCCUPANCY]) { continue; } + if (AFO_INTERACTIONRATE == v && !mupa.fCalculateCorrelationsAsFunctionOf[AFO_INTERACTIONRATE]) { + continue; + } + if (AFO_CURRENTRUNDURATION == v && !mupa.fCalculateCorrelationsAsFunctionOf[AFO_CURRENTRUNDURATION]) { + continue; + } if (!res.fResultsPro[v]) { LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); @@ -3405,15 +3595,19 @@ void InternalValidation() fPhiPDF->SetParameter(3, fReactionPlane); } - ebye.fCentrality = static_cast(gRandom->Uniform(0., 100.)); // this is perfectly fine for this exercise - ebye.fOccupancy = static_cast(gRandom->Uniform(0., 10000.)); // this is perfectly fine for this exercise + ebye.fCentrality = static_cast(gRandom->Uniform(0., 100.)); // this is perfectly fine for this exercise + ebye.fOccupancy = static_cast(gRandom->Uniform(0., 10000.)); // this is perfectly fine for this exercise + ebye.fInteractionRate = static_cast(gRandom->Uniform(0., 10000.)); // this is perfectly fine for this exercise + ebye.fCurrentRunDuration = static_cast(gRandom->Uniform(0., 86400.)); // this is perfectly fine for this exercise // b2) Fill event histograms before cuts: if (eh.fFillEventHistograms) { !eh.fEventHistograms[eNumberOfEvents][eSim][eBefore] ? true : eh.fEventHistograms[eNumberOfEvents][eSim][eBefore]->Fill(0.5); !eh.fEventHistograms[eTotalMultiplicity][eSim][eBefore] ? true : eh.fEventHistograms[eTotalMultiplicity][eSim][eBefore]->Fill(nMult); !eh.fEventHistograms[eCentrality][eSim][eBefore] ? true : eh.fEventHistograms[eCentrality][eSim][eBefore]->Fill(ebye.fCentrality); - !eh.fEventHistograms[eOccupancy][eSim][eBefore] ? true : eh.fEventHistograms[eCentrality][eSim][eBefore]->Fill(ebye.fOccupancy); + !eh.fEventHistograms[eOccupancy][eSim][eBefore] ? true : eh.fEventHistograms[eOccupancy][eSim][eBefore]->Fill(ebye.fOccupancy); + !eh.fEventHistograms[eInteractionRate][eSim][eBefore] ? true : eh.fEventHistograms[eInteractionRate][eSim][eBefore]->Fill(ebye.fInteractionRate); + !eh.fEventHistograms[eCurrentRunDuration][eSim][eBefore] ? true : eh.fEventHistograms[eCurrentRunDuration][eSim][eBefore]->Fill(ebye.fCurrentRunDuration); } // ... here I could implement some event cuts, if necessary ... @@ -3524,7 +3718,9 @@ void InternalValidation() !eh.fEventHistograms[eTotalMultiplicity][eSim][eAfter] ? true : eh.fEventHistograms[eTotalMultiplicity][eSim][eAfter]->Fill(nMult); !eh.fEventHistograms[eMultiplicity][eSim][eAfter] ? true : eh.fEventHistograms[eMultiplicity][eSim][eAfter]->Fill(ebye.fMultiplicity); !eh.fEventHistograms[eCentrality][eSim][eAfter] ? true : eh.fEventHistograms[eCentrality][eSim][eAfter]->Fill(ebye.fCentrality); - !eh.fEventHistograms[eOccupancy][eSim][eAfter] ? true : eh.fEventHistograms[eCentrality][eSim][eAfter]->Fill(ebye.fOccupancy); + !eh.fEventHistograms[eOccupancy][eSim][eAfter] ? true : eh.fEventHistograms[eOccupancy][eSim][eAfter]->Fill(ebye.fOccupancy); + !eh.fEventHistograms[eInteractionRate][eSim][eAfter] ? true : eh.fEventHistograms[eCentrality][eSim][eAfter]->Fill(ebye.fInteractionRate); + !eh.fEventHistograms[eCurrentRunDuration][eSim][eAfter] ? true : eh.fEventHistograms[eCurrentRunDuration][eSim][eAfter]->Fill(ebye.fCurrentRunDuration); } // b5) Calculate everything for selected events and particles: @@ -3681,6 +3877,12 @@ void BookTest0Histograms() if (AFO_OCCUPANCY == v && !t0.fCalculateTest0AsFunctionOf[AFO_OCCUPANCY]) { continue; } + if (AFO_INTERACTIONRATE == v && !t0.fCalculateTest0AsFunctionOf[AFO_INTERACTIONRATE]) { + continue; + } + if (AFO_CURRENTRUNDURATION == v && !t0.fCalculateTest0AsFunctionOf[AFO_CURRENTRUNDURATION]) { + continue; + } if (!res.fResultsPro[v]) { LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); @@ -3731,8 +3933,7 @@ void BookResultsHistograms() } // a) Book the profile holding flags: - res.fResultsFlagsPro = new TProfile("fResultsFlagsPro", - "flags for results histograms", 1, 0., 1.); + res.fResultsFlagsPro = new TProfile("fResultsFlagsPro", "flags for results histograms", 1, 0., 1.); res.fResultsFlagsPro->SetStats(kFALSE); res.fResultsFlagsPro->SetLineColor(eColor); res.fResultsFlagsPro->SetFillColor(eFillColor); @@ -3791,8 +3992,8 @@ void BookTheRest() //============================================================ -template -void Preprocess(T const& collision) +template +void Preprocess(T1 const& collision, T2 const& bcs) { // Do all thingies before starting to process data (e.g. count number of events, fetch the run number, get the weights for this run number, etc.). @@ -3815,10 +4016,11 @@ void Preprocess(T const& collision) // *) Determine and propagate run number info to already booked objects: if (!tc.fRunNumberIsDetermined) { - DetermineAndPropagateRunNumber(collision); + DetermineRunNumber(collision, bcs); + PropagateRunNumber(); } if (tc.fDoAdditionalInsanityChecks && tc.fRunNumberIsDetermined) { - CheckCurrentRunNumber(collision); + CheckCurrentRunNumber(collision, bcs); } // *) Fetch the weights for this particular run number. Do it only once. @@ -3843,35 +4045,62 @@ void Preprocess(T const& collision) ExitFunction(__FUNCTION__); } -} // template void Preprocess(T const& collision) +} // template void Preprocess(T1 const& collision, T2 const& bcs) //============================================================ -template -void DetermineAndPropagateRunNumber(T const& collision) +template +void DetermineRunNumber(T1 const& collision, T2 const&) { - // Determine and propagate run number info to already booked objects, wherever it's relevant. + // Determine a run number. // Make sure in process(...) that this function is called only once. - // TBI 20231018 At the moment I can access run number info only in process(...) via collision->bc().runNumber(), but not in init(...) + // TBI 20231018 At the moment I can access run number info only in process(...), but not in init(...) // Once I can access run number info in init(...), this function shall be called in init(...), not in process(...) - // a) Determine run number; - // b) Propagate run number to all booked objects, wherever that info is relevant. + // a) Determine run number for Run 3 real data; + // b) Determine run number for the rest. TBI 20241126 differentiate this support as well, e.g. for eRecSim and eSim. But Run 2 and Run 1 most likely will stay as before if (tc.fVerbose) { StartFunction(__FUNCTION__); } - // a) Determine run number for reconstructed data: - tc.fRunNumber = Form("%d", collision.bc().runNumber()); // implemented for both aod::Collision and aod::McCollision, so I can use it straight, as long as I have subscribed to aod::BCs - if (tc.fRunNumber.EqualTo("")) { - LOGF(error, "\033[1;33m%s fRunNumber is empty, collision->bc().runNumber() failed...\033[0m", __FUNCTION__); - LOGF(fatal, "collision->bc().runNumber() = %d", collision.bc().runNumber()); + // a) Determine run number for Run 3 real data: + if constexpr (rs == eRec) { + + auto bc = collision.template foundBC_as(); // TBI 20241126 I have the same code snippet at 2 other locations, I shall unify at some point + tc.fRunNumber = Form("%d", bc.runNumber()); + if (tc.fRunNumber.EqualTo("")) { + LOGF(error, "\033[1;33m%s fRunNumber is empty, bc.runNumber() failed...\033[0m", __FUNCTION__); + LOGF(fatal, "bc.runNumber() = %d", bc.runNumber()); + } + } else { + // b) Determine run number for the rest. TBI 20241126 differentiate this support as well, e.g. for eRecSim and eSim. But Run 2 and Run 1 most likely will stay as before + LOGF(fatal, "bc.runNumber() is not validated yet beyond eRec"); } tc.fRunNumberIsDetermined = kTRUE; - // b) Propagate run number to all booked objects, wherever that info is relevant: + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // template void DetermineRunNumber(T1 const& collision, T2 const&) + +//============================================================ + +void PropagateRunNumber() +{ + // Propagate run number info to already booked objects, wherever it's relevant. + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // Do some local insanity checks: + if (tc.fRunNumber.EqualTo("")) { + LOGF(fatal, "\033[1;31m%s at line %d : tc.fRunNumber is empty \033[0m", __FUNCTION__, __LINE__); + } + // *) base: fBasePro->GetXaxis()->SetBinLabel(eRunNumber, Form("fRunNumber = %s", tc.fRunNumber.Data())); @@ -3956,7 +4185,6 @@ void DetermineAndPropagateRunNumber(T const& collision) { for (Int_t cc = 0; cc < eCutCounter_N; cc++) // enum eCutCounter { - if (!pc.fParticleCutCounterHist[rs][cc]) { continue; } @@ -4010,29 +4238,46 @@ void DetermineAndPropagateRunNumber(T const& collision) ExitFunction(__FUNCTION__); } -} // template void DetermineAndPropagateRunNumber(T const& collision) +} // PropagateRunNumber() //============================================================ -template -void CheckCurrentRunNumber(T const& collision) +template +void CheckCurrentRunNumber(T1 const& collision, T2 const&) { // Insanity check for the current run number. + // a) Support for Run 3 real data; + // b) The rest. TBI 20241126 differentiate this support as well, e.g. for eRecSim and eSim. But Run 2 and Run 1 most likely will stay as before + if (tc.fVerbose) { StartFunction(__FUNCTION__); } - if (!tc.fRunNumber.EqualTo(Form("%d", collision.bc().runNumber()))) { - LOGF(error, "\033[1;33m%s Run number changed within process(). This most likely indicates that a given masterjob is processing 2 or more different runs in one go.\033[0m", __FUNCTION__); - LOGF(fatal, "tc.fRunNumber = %s, collision.bc().runNumber() = %d", tc.fRunNumber.Data(), collision.bc().runNumber()); - } + // a) Support for Run 3 real data: + if constexpr (rs == eRec) { + + auto bc = collision.template foundBC_as(); // TBI 20241126 I have the same code snippet at 2 other locations, I shall unify at some point + if (!tc.fRunNumber.EqualTo(Form("%d", bc.runNumber()))) { + LOGF(error, "\033[1;33m%s Run number changed within process(). This most likely indicates that a given masterjob is processing 2 or more different runs in one go.\033[0m", __FUNCTION__); + LOGF(fatal, "tc.fRunNumber = %s, bc.runNumber() = %d", tc.fRunNumber.Data(), bc.runNumber()); + } + + } else { + // b) The rest: + + if (!tc.fRunNumber.EqualTo(Form("%d", collision.bc().runNumber()))) { + LOGF(error, "\033[1;33m%s Run number changed within process(). This most likely indicates that a given masterjob is processing 2 or more different runs in one go.\033[0m", __FUNCTION__); + LOGF(fatal, "tc.fRunNumber = %s, collision.bc().runNumber() = %d", tc.fRunNumber.Data(), collision.bc().runNumber()); + } + + } // to else if (tc.fVerbose) { ExitFunction(__FUNCTION__); } -} // template void CheckCurrentRunNumber(T const& collision) +} // template void CheckCurrentRunNumber(T1 const& collision, T2 const&) //============================================================ @@ -4055,6 +4300,8 @@ void ResetEventByEventQuantities() ebye.fReferenceMultiplicity = 0.; ebye.fCentrality = 0.; ebye.fOccupancy = 0.; + ebye.fInteractionRate = 0.; + ebye.fCurrentRunDuration = 0.; // b) Q-vectors: if (qv.fCalculateQvectors) { @@ -4440,6 +4687,28 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) } } + // *) InteractionRate: + if (ec.fUseEventCuts[eInteractionRate]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eInteractionRate, eCutCounterBinning); + } else if (ebye.fInteractionRate < ec.fdEventCuts[eInteractionRate][eMin] || ebye.fInteractionRate > ec.fdEventCuts[eInteractionRate][eMax] || TMath::Abs(ebye.fInteractionRate - ec.fdEventCuts[eInteractionRate][eMax]) < tc.fFloatingPointPrecision) { + if (!EventCut(eRec, eInteractionRate, cutModus)) { + return kFALSE; + } + } + } + + // *) CurrentRunDuration: // TBI 20241128 check if I can use this one also on Run 2 and Run 1, most likely not + if (ec.fUseEventCuts[eCurrentRunDuration]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eCurrentRunDuration, eCutCounterBinning); + } else if (ebye.fCurrentRunDuration < ec.fdEventCuts[eCurrentRunDuration][eMin] || ebye.fCurrentRunDuration > ec.fdEventCuts[eCurrentRunDuration][eMax] || TMath::Abs(ebye.fCurrentRunDuration - ec.fdEventCuts[eCurrentRunDuration][eMax]) < tc.fFloatingPointPrecision) { + if (!EventCut(eRec, eCurrentRunDuration, cutModus)) { + return kFALSE; + } + } + } + // *) NoSameBunchPileup: // see O2Physics/Common/CCDB/EventSelectionParams.cxx if (ec.fUseEventCuts[eNoSameBunchPileup]) { if (cutModus == eCutCounterBinning) { @@ -4791,6 +5060,8 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) if constexpr (rs == eRec || rs == eRecAndSim) { if (eh.fFillEventHistograms) { !eh.fEventHistograms[eOccupancy][eRec][ba] ? true : eh.fEventHistograms[eOccupancy][eRec][ba]->Fill(ebye.fOccupancy); + !eh.fEventHistograms[eInteractionRate][eRec][ba] ? true : eh.fEventHistograms[eInteractionRate][eRec][ba]->Fill(ebye.fInteractionRate); + !eh.fEventHistograms[eCurrentRunDuration][eRec][ba] ? true : eh.fEventHistograms[eCurrentRunDuration][eRec][ba]->Fill(ebye.fCurrentRunDuration); // TBI 20241128 check if this one can be used for Run 2 and Run 1 converted, most likely not } // QA: if (qa.fFillQAEventHistograms2D) { @@ -4809,6 +5080,7 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) // !eh.fEventHistograms[eMultFT0M][eRec][ba] ? true : eh.fEventHistograms[eMultFT0M][eRec][ba]->Fill(collision.multFT0M()); // !eh.fEventHistograms[eMultFV0M][eRec][ba] ? true : eh.fEventHistograms[eMultFV0M][eRec][ba]->Fill(collision.multFV0M()); !qa.fQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange][eRec][ba] ? true : qa.fQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange][eRec][ba]->Fill(collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange()); + !qa.fQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate][eRec][ba] ? true : qa.fQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate][eRec][ba]->Fill(ebye.fCurrentRunDuration, ebye.fInteractionRate); } // ... and corresponding MC truth simulated (Run 3 specific) @@ -6094,6 +6366,14 @@ void CalculateCorrelations() if (mupa.fCorrelationsPro[0][h - 1][AFO_OCCUPANCY]) { mupa.fCorrelationsPro[0][h - 1][AFO_OCCUPANCY]->Fill(ebye.fOccupancy, twoC, wTwo); } + // vs. interaction rate: + if (mupa.fCorrelationsPro[0][h - 1][AFO_INTERACTIONRATE]) { + mupa.fCorrelationsPro[0][h - 1][AFO_INTERACTIONRATE]->Fill(ebye.fInteractionRate, twoC, wTwo); + } + // vs. current run duration: + if (mupa.fCorrelationsPro[0][h - 1][AFO_CURRENTRUNDURATION]) { + mupa.fCorrelationsPro[0][h - 1][AFO_CURRENTRUNDURATION]->Fill(ebye.fCurrentRunDuration, twoC, wTwo); + } // 4p: if (ebye.fSelectedTracks < 4) { @@ -6151,6 +6431,14 @@ void CalculateCorrelations() if (mupa.fCorrelationsPro[1][h - 1][AFO_OCCUPANCY]) { mupa.fCorrelationsPro[1][h - 1][AFO_OCCUPANCY]->Fill(ebye.fOccupancy, fourC, wFour); } + // vs. interaction rate: + if (mupa.fCorrelationsPro[1][h - 1][AFO_INTERACTIONRATE]) { + mupa.fCorrelationsPro[1][h - 1][AFO_INTERACTIONRATE]->Fill(ebye.fInteractionRate, fourC, wFour); + } + // vs. current run duration: + if (mupa.fCorrelationsPro[1][h - 1][AFO_CURRENTRUNDURATION]) { + mupa.fCorrelationsPro[1][h - 1][AFO_CURRENTRUNDURATION]->Fill(ebye.fCurrentRunDuration, fourC, wFour); + } // 6p: if (ebye.fSelectedTracks < 6) { @@ -6210,6 +6498,14 @@ void CalculateCorrelations() if (mupa.fCorrelationsPro[2][h - 1][AFO_OCCUPANCY]) { mupa.fCorrelationsPro[2][h - 1][AFO_OCCUPANCY]->Fill(ebye.fOccupancy, sixC, wSix); } + // vs. interaction rate: + if (mupa.fCorrelationsPro[2][h - 1][AFO_INTERACTIONRATE]) { + mupa.fCorrelationsPro[2][h - 1][AFO_INTERACTIONRATE]->Fill(ebye.fInteractionRate, sixC, wSix); + } + // vs. current run duration: + if (mupa.fCorrelationsPro[2][h - 1][AFO_CURRENTRUNDURATION]) { + mupa.fCorrelationsPro[2][h - 1][AFO_CURRENTRUNDURATION]->Fill(ebye.fCurrentRunDuration, sixC, wSix); + } // 8p: if (ebye.fSelectedTracks < 8) { @@ -6271,6 +6567,14 @@ void CalculateCorrelations() if (mupa.fCorrelationsPro[3][h - 1][AFO_OCCUPANCY]) { mupa.fCorrelationsPro[3][h - 1][AFO_OCCUPANCY]->Fill(ebye.fOccupancy, eightC, wEight); } + // vs. interaction rate: + if (mupa.fCorrelationsPro[3][h - 1][AFO_INTERACTIONRATE]) { + mupa.fCorrelationsPro[3][h - 1][AFO_INTERACTIONRATE]->Fill(ebye.fInteractionRate, eightC, wEight); + } + // vs. current run duration: + if (mupa.fCorrelationsPro[3][h - 1][AFO_CURRENTRUNDURATION]) { + mupa.fCorrelationsPro[3][h - 1][AFO_CURRENTRUNDURATION]->Fill(ebye.fCurrentRunDuration, eightC, wEight); + } } // for(Int_t h=1;h<=gMaxHarmonic;h++) // harmonic @@ -6539,6 +6843,14 @@ void CalculateTest0() if (t0.fTest0Pro[mo][mi][AFO_OCCUPANCY]) { t0.fTest0Pro[mo][mi][AFO_OCCUPANCY]->Fill(ebye.fOccupancy, correlation / weight, weight); } + // vs. interaction rate: + if (t0.fTest0Pro[mo][mi][AFO_INTERACTIONRATE]) { + t0.fTest0Pro[mo][mi][AFO_INTERACTIONRATE]->Fill(ebye.fInteractionRate, correlation / weight, weight); + } + // vs. current run duration: + if (t0.fTest0Pro[mo][mi][AFO_CURRENTRUNDURATION]) { + t0.fTest0Pro[mo][mi][AFO_CURRENTRUNDURATION]->Fill(ebye.fCurrentRunDuration, correlation / weight, weight); + } } // if(t0.fTest0Labels[mo][mi]) } // for(Int_t mi=0;miFill( ebye.fOccupancy, TMath::Cos((h + 1.) * (dPhi1 - dPhi2)), dW1 * dW2); } + // fill cos, 2p, vs. interaction rate: + if (nl.fNestedLoopsPro[0][h][AFO_INTERACTIONRATE]) { + nl.fNestedLoopsPro[0][h][AFO_INTERACTIONRATE]->Fill( + ebye.fInteractionRate, TMath::Cos((h + 1.) * (dPhi1 - dPhi2)), dW1 * dW2); + } + // fill cos, 2p, vs. current run duration: + if (nl.fNestedLoopsPro[0][h][AFO_CURRENTRUNDURATION]) { + nl.fNestedLoopsPro[0][h][AFO_CURRENTRUNDURATION]->Fill( + ebye.fCurrentRunDuration, TMath::Cos((h + 1.) * (dPhi1 - dPhi2)), dW1 * dW2); + } } // for(int h=1; h<=6; h++) } // for(int i2=0; i2Fill(ebye.fOccupancy, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 - dPhi3 - dPhi4)), dW1 * dW2 * dW3 * dW4); } + // fill cos, 4p, all harmonics, vs. interaction rate: + if (nl.fNestedLoopsPro[1][h][AFO_INTERACTIONRATE]) { + nl.fNestedLoopsPro[1][h][AFO_INTERACTIONRATE]->Fill(ebye.fInteractionRate, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 - dPhi3 - dPhi4)), dW1 * dW2 * dW3 * dW4); + } + // fill cos, 4p, all harmonics, vs. current run duratione: + if (nl.fNestedLoopsPro[1][h][AFO_CURRENTRUNDURATION]) { + nl.fNestedLoopsPro[1][h][AFO_CURRENTRUNDURATION]->Fill(ebye.fCurrentRunDuration, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 - dPhi3 - dPhi4)), dW1 * dW2 * dW3 * dW4); + } } // for(int h=0; hFill(ebye.fOccupancy, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 + dPhi3 - dPhi4 - dPhi5 - dPhi6)), dW1 * dW2 * dW3 * dW4 * dW5 * dW6); } + // fill cos, 6p, all harmonics, vs. interaction rate: + if (nl.fNestedLoopsPro[2][h][AFO_INTERACTIONRATE]) { + nl.fNestedLoopsPro[2][h][AFO_INTERACTIONRATE]->Fill(ebye.fInteractionRate, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 + dPhi3 - dPhi4 - dPhi5 - dPhi6)), dW1 * dW2 * dW3 * dW4 * dW5 * dW6); + } + // fill cos, 6p, all harmonics, vs. current run duration: + if (nl.fNestedLoopsPro[2][h][AFO_CURRENTRUNDURATION]) { + nl.fNestedLoopsPro[2][h][AFO_CURRENTRUNDURATION]->Fill(ebye.fCurrentRunDuration, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 + dPhi3 - dPhi4 - dPhi5 - dPhi6)), dW1 * dW2 * dW3 * dW4 * dW5 * dW6); + } } // for(int h=0; hFill(ebye.fOccupancy, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 + dPhi3 + dPhi4 - dPhi5 - dPhi6 - dPhi7 - dPhi8)), dW1 * dW2 * dW3 * dW4 * dW5 * dW6 * dW7 * dW8); } + // fill cos, 8p, all harmonics, vs. interaction rate: + if (nl.fNestedLoopsPro[3][h][AFO_INTERACTIONRATE]) { + nl.fNestedLoopsPro[3][h][AFO_INTERACTIONRATE]->Fill(ebye.fInteractionRate, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 + dPhi3 + dPhi4 - dPhi5 - dPhi6 - dPhi7 - dPhi8)), dW1 * dW2 * dW3 * dW4 * dW5 * dW6 * dW7 * dW8); + } + // fill cos, 8p, all harmonics, vs. current run duration: + if (nl.fNestedLoopsPro[3][h][AFO_CURRENTRUNDURATION]) { + nl.fNestedLoopsPro[3][h][AFO_CURRENTRUNDURATION]->Fill(ebye.fCurrentRunDuration, TMath::Cos((h + 1.) * (dPhi1 + dPhi2 + dPhi3 + dPhi4 - dPhi5 - dPhi6 - dPhi7 - dPhi8)), dW1 * dW2 * dW3 * dW4 * dW5 * dW6 * dW7 * dW8); + } } // for(int h=0; hSetOwner(); // Define some labels: - const Int_t nLabels = 4; - TString labels[nLabels] = {"1 -1", "2 -2", "1 2 -3", "2 3 -3 -2"}; + const Int_t nLabels = 7; + TString labels[nLabels] = {"1 -1", "2 -2", "3 -3", "2 1 -1 -2", "3 1 -1 -3", "3 2 -2 -3", "3 2 1 -1 -2 -3"}; // Make a transfer: for (Int_t l = 0; l < nLabels; l++) { @@ -8962,6 +9308,10 @@ const char* FancyFormatting(const char* name) fancyFormatting = "ft0cOccupancyInTimeRange()"; } else if (TString(name).EqualTo("Occupancy", TString::kIgnoreCase)) { fancyFormatting = Form("Occupancy (%s)", ec.fsEventCuts[eOccupancyEstimator].Data()); + } else if (TString(name).EqualTo("InteractionRate", TString::kIgnoreCase) || TString(name).EqualTo("Interaction Rate", TString::kIgnoreCase)) { + fancyFormatting = "Interaction Rate [kHz]"; // TBI 20241127 do I leave kHz hardwired here? + } else if (TString(name).EqualTo("CurrentRunDuration", TString::kIgnoreCase) || TString(name).EqualTo("Current Run Duration", TString::kIgnoreCase)) { + fancyFormatting = "Current run duration [s] (i.e. time in seconds since start of run)"; } if (tc.fVerboseUtility) { @@ -9697,6 +10047,68 @@ void DetermineOccupancy(T const& collision) //============================================================ +template +void DetermineInteractionRate(T1 const& collision, T2 const&) +{ + // Determine interaction rate. + + // a) Determine interaction rate only for eRec; + // b) For all other cases, set interaction rate to -1 for the time being; + // c) Print interaction rate and run duration for the audience... + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // a) Determine interaction rate only for eRec: + if constexpr (rs == eRec) { + auto bc = collision.template foundBC_as(); // TBI 20241126 this seems to works as expected, but check and validate further + // cout << bc.runNumber() << endl; // works as expected + // cout << bc.timestamp() << endl; // works as expected + // TBI 20241126 I have the same code snippet at 2 other locations, I shall unify at some point + + // Get start timestamp and end timemstamp for this run in miliseconds, and convert both of them in seconds: + // o see O2/CCDB/src/BasicCCDBManager.cxx, O2/CCDB/include/CCDB/BasicCCDBManager.h + // o example usage in O2Physics/PWGLF/TableProducer/Common/zdcSP.cxx + auto runDuration = ccdb->getRunDuration(bc.runNumber()); // this is total run duration, not the current one (see below) + int64_t startOfRun = std::floor(runDuration.first * 0.001); + int64_t endOfRun = std::ceil(runDuration.second * 0.001); + int64_t runDurationInSec = endOfRun - startOfRun; // yes, this is now in seconds + + // From documentation: double ctpRateFetcher::fetch(o2::ccdb::BasicCCDBManager* ccdb, uint64_t timeStamp, int runNumber, std::string sourceName) + double hadronicRate = mRateFetcher.fetch(ccdb.service, static_cast(bc.timestamp()), static_cast(bc.runNumber()), "ZNC hadronic") * 1.e-3; + if (hadronicRate > 0.) { + ebye.fInteractionRate = static_cast(hadronicRate); + } else { + LOGF(fatal, "\033[1;31m%s at line %d : hadronicRate = %f is meaningless \033[0m", __FUNCTION__, __LINE__, hadronicRate); + } + + // If I feel 2D QA eCurrentRunDuration_vs_InteractionRate , extract still the current run duration: + if (qa.fBookQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate]) { // TBI 20241127 do I check this flag, of pointers, like in FillEventHistograms(...) ? + ebye.fCurrentRunDuration = std::floor(bc.timestamp() * 0.001) - startOfRun; + if (ebye.fCurrentRunDuration > runDurationInSec) { + LOGF(fatal, "\033[1;31m%s at line %d : ebye.fCurrentRunDuration = %d is bigger than runDurationInSec = %d, which is meaningless \033[0m", __FUNCTION__, __LINE__, static_cast(ebye.fCurrentRunDuration), static_cast(runDurationInSec)); + } + } + } else { + + ebye.fInteractionRate = -1.; + ebye.fCurrentRunDuration = -1.; + } + + // c) Print interaction rate and run duration for the audience...: + if (tc.fVerbose) { + LOGF(info, "\033[1;32m ebye.fInteractionRate = %f kHz\033[0m", ebye.fInteractionRate); + if (qa.fBookQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate]) { // TBI 20241127 do I check this flag, of pointers, like in FillEventHistograms(...) ? + LOGF(info, "\033[1;32m ebye.fCurrentRunDuration = %f s (in seconds after SOR)\033[0m", ebye.fCurrentRunDuration); + } + ExitFunction(__FUNCTION__); + } + +} // template void DetermineInteractionRate(T1 const& collision, T2 const& bcs) + +//============================================================ + void DetermineEventCounters() { // Determine all event counters. @@ -10374,8 +10786,8 @@ void MainLoopOverParticles(T const& tracks) //============================================================ -template -void Steer(T1 const& collision, T2 const& tracks) +template +void Steer(T1 const& collision, T2 const& bcs, T3 const& tracks) { // This is the only function to be called in processRec(...), processRecSim(...), and processSim(...). // All analysis workflow is defined step-by-step here, via dedicated function calls. @@ -10389,7 +10801,7 @@ void Steer(T1 const& collision, T2 const& tracks) if (tc.fDryRun) { EventCounterForDryRun(eFill); EventCounterForDryRun(ePrint); - Preprocess(collision); // yes, so that e.g. I can only test if the particle and centrality weights were correctly fetched from external file and initialized locally into data members + Preprocess(collision, bcs); // yes, so that e.g. I can only test if the particle and centrality weights were correctly fetched from external file and initialized locally into data members return; } @@ -10409,7 +10821,7 @@ void Steer(T1 const& collision, T2 const& tracks) } // *) Do all thingies before starting to process data from this collision (e.g. cut on number of events (both total and selected), fetch the run number, etc.): - Preprocess(collision); + Preprocess(collision, bcs); // *) Determine collision reference multiplicity: DetermineReferenceMultiplicity(collision); @@ -10420,6 +10832,9 @@ void Steer(T1 const& collision, T2 const& tracks) // *) Determine collision occupancy: DetermineOccupancy(collision); + // *) Determine collision interaction rate: + DetermineInteractionRate(collision, bcs); + // *) Fill event histograms before event cuts: if (eh.fFillEventHistograms || qa.fFillQAEventHistograms2D) { FillEventHistograms(collision, tracks, eBefore); diff --git a/PWGCF/MultiparticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/MultiparticleCorrelations/Tasks/CMakeLists.txt index 4240aaf37e0..bc0ad886d5c 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/MultiparticleCorrelations/Tasks/CMakeLists.txt @@ -11,7 +11,7 @@ o2physics_add_dpl_workflow(multiparticle-correlations-ab SOURCES multiparticle-correlations-ab.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(multiparticle-correlations-ar diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx index b7f502c42e2..5787746f82d 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx @@ -11,6 +11,8 @@ // O2: #include +#include "Common/CCDB/ctpRateFetcher.h" +// #include "Common/CCDB/ctpRateFetcher.cxx" // TBI 20241126 if I include instead only .h file, linker fails, check this further #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -24,6 +26,10 @@ using namespace o2; using namespace o2::framework; // *) Run 3: +using BCs_Run3 = soa::Join; // TBI 20241126 under testing +// Remark 1: I have already timestamp in workflow, due to track-propagation. With Run3MatchedToBCSparse, I can use bc.has_zdc() +// Remark 2: For consistency with notation below, drop _Run3 and instead use _Run2 and _Run1 + using EventSelection = soa::Join; using CollisionRec = soa::Join::iterator; // use in json "isMC": "true" for "event-selection-task" using CollisionRecSim = soa::Join::iterator; @@ -31,7 +37,7 @@ using CollisionRecSim = soa::Join::iterator; using CollisionSim = aod::McCollision; using TracksRec = soa::Join; -using TrackRec = soa::Join::iterator; +// using TrackRec = soa::Join::iterator; using TracksRecSim = soa::Join; // + use in json "isMC" : "true" using TrackRecSim = soa::Join::iterator; using TracksSim = aod::McParticles; @@ -79,6 +85,7 @@ struct MultiparticleCorrelationsAB // this name is used in lower-case format to // *) CCDB: Service ccdb; + ctpRateFetcher mRateFetcher; // see email from MP on 20240508 and example usage in O2Physics/PWGLF/TableProducer/Common/zdcSP.cxx // *) Configurables (cuts): #include "PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h" @@ -108,12 +115,13 @@ struct MultiparticleCorrelationsAB // this name is used in lower-case format to TH1::AddDirectory(kFALSE); // *) Default configuration, booking, binning and cuts: - DefaultConfiguration(); // here default values from configurables are taken into account - DefaultBooking(); // here I decide only which histograms are booked, not details like binning, etc. - DefaultBinning(); // here default values for bins are either hardwired, or values for bins provided via configurables are taken into account - DefaultCuts(); // here default values for cuts are either hardwired, or defined through default binning to ease bookeeping, - // or values for cuts provided via configurables are taken into account - // Remark: DefaultCuts() has to be called after DefaultBinning() + InsanityChecksOnDefinitionsOfConfigurables(); // values passed via configurables are insanitized here. Nothing is initialized yet via configurables in this method + DefaultConfiguration(); // here default values from configurables are taken into account + DefaultBooking(); // here I decide only which histograms are booked, not details like binning, etc. + DefaultBinning(); // here default values for bins are either hardwired, or values for bins provided via configurables are taken into account + DefaultCuts(); // here default values for cuts are either hardwired, or defined through default binning to ease bookeeping, + // or values for cuts provided via configurables are taken into account + // Remark: DefaultCuts() has to be called after DefaultBinning() // *) Specific cuts: if (tc.fUseSpecificCuts) { @@ -179,48 +187,49 @@ struct MultiparticleCorrelationsAB // this name is used in lower-case format to // ------------------------------------------- // A) Process only reconstructed data: - void processRec(CollisionRec const& collision, aod::BCs const&, TracksRec const& tracks) + // void processRec(CollisionRec const& collision, aod::BCs const&, TracksRec const& tracks) + void processRec(CollisionRec const& collision, BCs_Run3 const& bcs, TracksRec const& tracks) { // Remark: Do not use here LOGF(fatal, ...) or LOGF(info, ...), because their stdout/stderr is suppressed. Use them in regular member functions instead. // *) Steer all analysis steps: - Steer(collision, tracks); + Steer(collision, bcs, tracks); } PROCESS_SWITCH(MultiparticleCorrelationsAB, processRec, "process only reconstructed data", true); // yes, keep always one process switch "true", so that I have default running version // ------------------------------------------- // B) Process both reconstructed and corresponding MC truth simulated data: - void processRecSim(CollisionRecSim const& collision, aod::BCs const&, TracksRecSim const& tracks, aod::McParticles const&, aod::McCollisions const&) + void processRecSim(CollisionRecSim const& collision, aod::BCs const& bcs, TracksRecSim const& tracks, aod::McParticles const&, aod::McCollisions const&) { - Steer(collision, tracks); + Steer(collision, bcs, tracks); } PROCESS_SWITCH(MultiparticleCorrelationsAB, processRecSim, "process both reconstructed and corresponding MC truth simulated data", false); // ------------------------------------------- // C) Process only simulated data: - void processSim(CollisionSim const& /*collision*/, aod::BCs const&, TracksSim const& /*tracks*/) + void processSim(CollisionSim const& /*collision*/, aod::BCs const& /*bcs*/, TracksSim const& /*tracks*/) { - // Steer(collision, tracks); // TBI 20240517 not ready yet, but I do not really need this one urgently, since RecSim is working, and I need that one for efficiencies... + // Steer(collision, bcs, tracks); // TBI 20240517 not ready yet, but I do not really need this one urgently, since RecSim is working, and I need that one for efficiencies... } PROCESS_SWITCH(MultiparticleCorrelationsAB, processSim, "process only simulated data", false); // ------------------------------------------- // D) Process only converted reconstructed Run 2 data: - void processRec_Run2(CollisionRec_Run2 const& collision, aod::BCs const&, TracksRec const& tracks) + void processRec_Run2(CollisionRec_Run2 const& collision, aod::BCs const& bcs, TracksRec const& tracks) { - Steer(collision, tracks); + Steer(collision, bcs, tracks); } PROCESS_SWITCH(MultiparticleCorrelationsAB, processRec_Run2, "process only converted reconstructed Run 2 data", false); // ------------------------------------------- // E) Process both converted reconstructed and corresponding MC truth simulated Run 2 data: - void processRecSim_Run2(CollisionRecSim_Run2 const& collision, aod::BCs const&, TracksRecSim const& tracks, aod::McParticles const&, aod::McCollisions const&) + void processRecSim_Run2(CollisionRecSim_Run2 const& collision, aod::BCs const& bcs, TracksRecSim const& tracks, aod::McParticles const&, aod::McCollisions const&) { - Steer(collision, tracks); + Steer(collision, bcs, tracks); } PROCESS_SWITCH(MultiparticleCorrelationsAB, processRecSim_Run2, "process both converted reconstructed and simulated Run 2 data", false); @@ -236,18 +245,18 @@ struct MultiparticleCorrelationsAB // this name is used in lower-case format to // ------------------------------------------- // G) Process only converted reconstructed Run 1 data: - void processRec_Run1(CollisionRec_Run1 const& collision, aod::BCs const&, TracksRec const& tracks) + void processRec_Run1(CollisionRec_Run1 const& collision, aod::BCs const& bcs, TracksRec const& tracks) { - Steer(collision, tracks); + Steer(collision, bcs, tracks); } PROCESS_SWITCH(MultiparticleCorrelationsAB, processRec_Run1, "process only converted reconstructed Run 1 data", false); // ------------------------------------------- // H) Process both converted reconstructed and corresponding MC truth simulated Run 1 data; - void processRecSim_Run1(CollisionRecSim_Run1 const& /*collision*/, aod::BCs const&, TracksRecSim const& /*tracks*/, aod::McParticles const&, aod::McCollisions const&) + void processRecSim_Run1(CollisionRecSim_Run1 const& /*collision*/, aod::BCs const& /*bcs*/, TracksRecSim const& /*tracks*/, aod::McParticles const&, aod::McCollisions const&) { - // Steer(collision, tracks); // TBI 20240517 not ready yet, but for benchmarking in any case I need only "Rec" + // Steer(collision, bcs, tracks); // TBI 20240517 not ready yet, but for benchmarking in any case I need only "Rec" } PROCESS_SWITCH(MultiparticleCorrelationsAB, processRecSim_Run1, "process both converted reconstructed and simulated Run 1 data", false); @@ -263,9 +272,9 @@ struct MultiparticleCorrelationsAB // this name is used in lower-case format to // ------------------------------------------- // J) Process data with minimum subscription to the tables, for testing purposes: - void processTest(aod::Collision const& collision, aod::BCs const&, aod::Tracks const& tracks) + void processTest(aod::Collision const& collision, aod::BCs const& bcs, aod::Tracks const& tracks) { - Steer(collision, tracks); + Steer(collision, bcs, tracks); } PROCESS_SWITCH(MultiparticleCorrelationsAB, processTest, "test processing", false); From bf719f6c2c815f844861ca10bc887d9ec32278b5 Mon Sep 17 00:00:00 2001 From: Rafael Manhart <56776511+RafRaf11@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:58:24 +0100 Subject: [PATCH 167/459] [PWGLF] Update NucleiHistTask.cxx (#8707) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/NucleiHistTask.cxx | 174 +++++++++++++++++++++----- 1 file changed, 142 insertions(+), 32 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx b/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx index 70b7b2522de..bacf180ca48 100644 --- a/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx +++ b/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx @@ -25,6 +25,7 @@ #include "Framework/ASoAHelpers.h" #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Centrality.h" @@ -61,8 +62,10 @@ struct NucleiHistTask { // MC HistogramRegistry MC_recon_reg{"MC_particles_reco", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MC_gen_reg{"MC_particles_gen", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry MC_DCA{"MC_DCA", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - OutputObj histPDG{TH1I("PDG", "PDG;PDG code", 18, 0.0, 18)}; + OutputObj histPDG_reco{TH1I("PDG reconstructed", "PDG;PDG code", 18, 0.0, 18)}; + OutputObj histPDG_gen{TH1I("PDG generated", "PDG;PDG code", 18, 0.0, 18)}; OutputObj histTrackcuts_MC{TH1I("histTrackcuts_MC", "Entires;Track cut", 18, 0, 18)}; void init(o2::framework::InitContext&) @@ -88,20 +91,34 @@ struct NucleiHistTask { histTrackcuts_data->GetXaxis()->SetBinLabel(13, "GoldenChi2 cut passed"); // +++++++++++++++++++++ MC ++++++++++++++++++++++++ - histPDG->GetXaxis()->SetBinLabel(1, "#pi^{+}"); - histPDG->GetXaxis()->SetBinLabel(2, "#pi^{-}"); - histPDG->GetXaxis()->SetBinLabel(3, "K^{+}"); - histPDG->GetXaxis()->SetBinLabel(4, "K^{-}"); - histPDG->GetXaxis()->SetBinLabel(5, "p"); - histPDG->GetXaxis()->SetBinLabel(6, "#bar{p}"); - histPDG->GetXaxis()->SetBinLabel(7, "d"); - histPDG->GetXaxis()->SetBinLabel(8, "#bar{d}"); - histPDG->GetXaxis()->SetBinLabel(9, "t"); - histPDG->GetXaxis()->SetBinLabel(10, "#bar{t}"); - histPDG->GetXaxis()->SetBinLabel(11, "^{3}He"); - histPDG->GetXaxis()->SetBinLabel(12, "^{3}#bar{He}"); - histPDG->GetXaxis()->SetBinLabel(13, "^{4}He"); - histPDG->GetXaxis()->SetBinLabel(14, "^{4}#bar{He}"); + histPDG_reco->GetXaxis()->SetBinLabel(1, "#pi^{+}"); + histPDG_reco->GetXaxis()->SetBinLabel(2, "#pi^{-}"); + histPDG_reco->GetXaxis()->SetBinLabel(3, "K^{+}"); + histPDG_reco->GetXaxis()->SetBinLabel(4, "K^{-}"); + histPDG_reco->GetXaxis()->SetBinLabel(5, "p"); + histPDG_reco->GetXaxis()->SetBinLabel(6, "#bar{p}"); + histPDG_reco->GetXaxis()->SetBinLabel(7, "d"); + histPDG_reco->GetXaxis()->SetBinLabel(8, "#bar{d}"); + histPDG_reco->GetXaxis()->SetBinLabel(9, "t"); + histPDG_reco->GetXaxis()->SetBinLabel(10, "#bar{t}"); + histPDG_reco->GetXaxis()->SetBinLabel(11, "^{3}He"); + histPDG_reco->GetXaxis()->SetBinLabel(12, "^{3}#bar{He}"); + histPDG_reco->GetXaxis()->SetBinLabel(13, "^{4}He"); + histPDG_reco->GetXaxis()->SetBinLabel(14, "^{4}#bar{He}"); + histPDG_gen->GetXaxis()->SetBinLabel(1, "#pi^{+}"); + histPDG_gen->GetXaxis()->SetBinLabel(2, "#pi^{-}"); + histPDG_gen->GetXaxis()->SetBinLabel(3, "K^{+}"); + histPDG_gen->GetXaxis()->SetBinLabel(4, "K^{-}"); + histPDG_gen->GetXaxis()->SetBinLabel(5, "p"); + histPDG_gen->GetXaxis()->SetBinLabel(6, "#bar{p}"); + histPDG_gen->GetXaxis()->SetBinLabel(7, "d"); + histPDG_gen->GetXaxis()->SetBinLabel(8, "#bar{d}"); + histPDG_gen->GetXaxis()->SetBinLabel(9, "t"); + histPDG_gen->GetXaxis()->SetBinLabel(10, "#bar{t}"); + histPDG_gen->GetXaxis()->SetBinLabel(11, "^{3}He"); + histPDG_gen->GetXaxis()->SetBinLabel(12, "^{3}#bar{He}"); + histPDG_gen->GetXaxis()->SetBinLabel(13, "^{4}He"); + histPDG_gen->GetXaxis()->SetBinLabel(14, "^{4}#bar{He}"); histTrackcuts_MC->GetXaxis()->SetBinLabel(1, "Events read"); histTrackcuts_MC->GetXaxis()->SetBinLabel(2, "Prim. particle. sel. passed"); histTrackcuts_MC->GetXaxis()->SetBinLabel(3, "Rap. cut passed"); @@ -389,6 +406,12 @@ struct NucleiHistTask { // +++++++++++++++++++++ MC ++++++++++++++++++++++++++ + // MC generated + MC_gen_reg.add("histRecVtxMC", "MC generated vertex z position", HistType::kTH1F, {{400, -40., +40., "z position (cm)"}}); + MC_gen_reg.add("histCentrality", "Centrality", HistType::kTH1F, {centralityAxis}); + MC_gen_reg.add("histEta", "#eta", HistType::kTH2F, {{102, -2.01, 2.01}, PDGBINNING}); + MC_gen_reg.add("histPt", "p_{t}", HistType::kTH2F, {ptAxis, PDGBINNING}); + // MC reconstructed MC_recon_reg.add("histRecVtxMC", "MC reconstructed vertex z position", HistType::kTH1F, {{400, -40., +40., "z position (cm)"}}); MC_recon_reg.add("histCentrality", "Centrality", HistType::kTH1F, {centralityAxis}); @@ -475,6 +498,7 @@ struct NucleiHistTask { Configurable requireGoldenChi2{"requireGoldenChi2", false, "Enable the requirement of GoldenChi2"}; Configurable event_selection_sel8{"event_selection_sel8", true, "Enable sel8 event selection"}; Configurable event_selection_MC_sel8{"event_selection_MC_sel8", true, "Enable sel8 event selection in MC processing"}; + Configurable require_PhysicalPrimary_MC_gen{"require_PhysicalPrimary_MC_gen", true, "Enable PhysicalPrimary selection in generated MC processing"}; Configurable> Tpc_mSigma_shift_Pi{"Tpc_mSigma_shift_Pi", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting pi^{+} & pi^{-} nSigma values in TPC"}; Configurable> Tpc_mSigma_shift_Pr{"Tpc_mSigma_shift_Pr", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting (anti)proton nSigma values in TPC"}; Configurable> Tpc_mSigma_shift_De{"Tpc_mSigma_shift_De", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting (anti)deuteron nSigma values in TPC"}; @@ -1458,8 +1482,94 @@ struct NucleiHistTask { } PROCESS_SWITCH(NucleiHistTask, processDataCent, "process data with centralities", false); - void processMC(soa::Join::iterator const& collisions, soa::Filtered> const& tracks, - aod::McParticles& /*mcParticles*/, aod::McCollisions const& /*mcCollisions*/) + void processMCgen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles) + { + MC_gen_reg.fill(HIST("histRecVtxMC"), mcCollision.posZ()); + MC_gen_reg.fill(HIST("histCentrality"), mcCollision.impactParameter()); + + for (const auto& mcParticleGen : mcParticles) { + if (require_PhysicalPrimary_MC_gen && !mcParticleGen.isPhysicalPrimary()) + continue; + int pdgCode = mcParticleGen.pdgCode(); + + if (mcParticleGen.y() > yMax || mcParticleGen.y() < yMin) + continue; + if (mcParticleGen.eta() > cfgCutEta || mcParticleGen.eta() < -cfgCutEta) + continue; + + int pdgbin = 0; + switch (pdgCode) { + case +211: + histPDG_gen->AddBinContent(1); + pdgbin = 0; + break; + case -211: + histPDG_gen->AddBinContent(2); + pdgbin = 1; + break; + case +321: + histPDG_gen->AddBinContent(3); + pdgbin = 2; + break; + case -321: + histPDG_gen->AddBinContent(4); + pdgbin = 3; + break; + case +2212: + histPDG_gen->AddBinContent(5); + pdgbin = 4; + break; + case -2212: + histPDG_gen->AddBinContent(6); + pdgbin = 5; + break; + case +1000010020: + histPDG_gen->AddBinContent(7); + pdgbin = 6; + break; + case -1000010020: + histPDG_gen->AddBinContent(8); + pdgbin = 7; + break; + case +1000010030: + histPDG_gen->AddBinContent(9); + pdgbin = 8; + break; + case -1000010030: + histPDG_gen->AddBinContent(10); + pdgbin = 9; + break; + case +1000020030: + histPDG_gen->AddBinContent(11); + pdgbin = 10; + break; + case -1000020030: + histPDG_gen->AddBinContent(12); + pdgbin = 11; + break; + case +1000020040: + histPDG_gen->AddBinContent(13); + pdgbin = 12; + break; + case -1000020040: + histPDG_gen->AddBinContent(14); + pdgbin = 13; + break; + default: + break; + } + MC_gen_reg.fill(HIST("histEta"), mcParticleGen.eta(), pdgbin); + if ((pdgCode == 1000020030) || (pdgCode == -1000020030) || (pdgCode == 1000020040) || (pdgCode == -1000020040)) { + MC_gen_reg.fill(HIST("histPt"), mcParticleGen.pt() * 2.0, pdgbin); + } else { + MC_gen_reg.fill(HIST("histPt"), mcParticleGen.pt(), pdgbin); + } + } + } + PROCESS_SWITCH(NucleiHistTask, processMCgen, "process generated MC", false); + + void processMCreco(soa::Join::iterator const& collisions, soa::Filtered> const& tracks, + aod::McParticles& /*mcParticles*/, aod::McCollisions const& /*mcCollisions*/) { if (event_selection_MC_sel8 && !collisions.sel8()) @@ -1552,46 +1662,46 @@ struct NucleiHistTask { switch (particle.pdgCode()) { case +211: - histPDG->AddBinContent(1); + histPDG_reco->AddBinContent(1); break; case -211: - histPDG->AddBinContent(2); + histPDG_reco->AddBinContent(2); break; case +321: - histPDG->AddBinContent(3); + histPDG_reco->AddBinContent(3); break; case -321: - histPDG->AddBinContent(4); + histPDG_reco->AddBinContent(4); break; case +2212: - histPDG->AddBinContent(5); + histPDG_reco->AddBinContent(5); break; case -2212: - histPDG->AddBinContent(6); + histPDG_reco->AddBinContent(6); break; case +1000010020: - histPDG->AddBinContent(7); + histPDG_reco->AddBinContent(7); break; case -1000010020: - histPDG->AddBinContent(8); + histPDG_reco->AddBinContent(8); break; case +1000010030: - histPDG->AddBinContent(9); + histPDG_reco->AddBinContent(9); break; case -1000010030: - histPDG->AddBinContent(10); + histPDG_reco->AddBinContent(10); break; case +1000020030: - histPDG->AddBinContent(11); + histPDG_reco->AddBinContent(11); break; case -1000020030: - histPDG->AddBinContent(12); + histPDG_reco->AddBinContent(12); break; case +1000020040: - histPDG->AddBinContent(13); + histPDG_reco->AddBinContent(13); break; case -1000020040: - histPDG->AddBinContent(14); + histPDG_reco->AddBinContent(14); break; default: break; @@ -1784,7 +1894,7 @@ struct NucleiHistTask { } } } - PROCESS_SWITCH(NucleiHistTask, processMC, "process MC", false); + PROCESS_SWITCH(NucleiHistTask, processMCreco, "process reconstructed MC", false); }; //**************************************************************************************************** From 6000a94c03793d0f7679ca733ed38a3c6ff5e997 Mon Sep 17 00:00:00 2001 From: upasanasharma31 <84681984+upasanasharma31@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:31:11 +0530 Subject: [PATCH 168/459] [DPG] Update qaEfficiency.cxx (#8673) --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 1da6ae7783b..15d3eba14df 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -17,6 +17,9 @@ /// // O2 includes +#include +#include + #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" #include "Framework/HistogramRegistry.h" @@ -74,6 +77,7 @@ static constexpr int PDGs[nParticles] = {11, 13, 211, 321, 2212, 1000010020, 100 -11, -13, -211, -321, -2212, -1000010020, -1000010030, -1000020030, -1000020040}; // Histograms +std::shared_ptr hPtmotherGenerated; // histogram to store pT of Xi and Lambda // Pt std::array, nParticles> hPtIts; @@ -332,6 +336,7 @@ struct QaEfficiency { phiMin, phiMax, yMin, yMax); const int histogramIndex = id + pdgSign * nSpecies; + hPtmotherGenerated = histos.add("MC/mother/pt/generated", "Generated pT of mother Lambda or Xi", kTH1D, {axisPt}); // Pt hPtIts[histogramIndex] = histos.add(Form("MC/pdg%i/pt/its", PDGs[histogramIndex]), "ITS tracks " + tagPt, kTH1D, {axisPt}); @@ -1242,19 +1247,20 @@ struct QaEfficiency { } } else { if (mcParticle.getProcess() == 4) { // Particle decay - // Checking mothers bool motherIsAccepted = true; + // Check for mothers if needed if (checkForMothers.value && mothersPDGs.value.size() > 0 && mcParticle.has_mothers()) { motherIsAccepted = false; auto mothers = mcParticle.mothers_as(); + // Loop over mother particles for (const auto& mother : mothers) { for (const auto& pdgToCheck : mothersPDGs.value) { if (mother.pdgCode() == pdgToCheck) { - motherIsAccepted = true; + motherIsAccepted = true; // Mother matches the list of specified PDGs break; } if (motherIsAccepted) { - break; + hPtmotherGenerated->Fill(mother.pt()); // Fill generated pT for Lambda } } } From d32316f923e70ef9d9f0c2915e58acb506ab9bcb Mon Sep 17 00:00:00 2001 From: Florian Jonas Date: Fri, 29 Nov 2024 12:03:14 +0100 Subject: [PATCH 169/459] [PWGJE] adding trigger capabilities and cluster definition to gammaisotree (#8728) Co-authored-by: ALICE Action Bot --- PWGJE/DataModel/EMCALClusterDefinition.h | 6 +- PWGJE/DataModel/EMCALClusters.h | 23 ++++--- PWGJE/DataModel/GammaJetAnalysisTree.h | 3 +- PWGJE/TableProducer/emcalCorrectionTask.cxx | 2 + PWGJE/Tasks/gammaJetTreeProducer.cxx | 67 +++++++++++++++------ 5 files changed, 68 insertions(+), 33 deletions(-) diff --git a/PWGJE/DataModel/EMCALClusterDefinition.h b/PWGJE/DataModel/EMCALClusterDefinition.h index d3480c29366..a7fcb34c439 100644 --- a/PWGJE/DataModel/EMCALClusterDefinition.h +++ b/PWGJE/DataModel/EMCALClusterDefinition.h @@ -42,11 +42,12 @@ struct EMCALClusterDefinition { double timeMax = 10000; // maximum time (ns) bool doGradientCut = true; // apply gradient cut if true double gradientCut = -1; // gradient cut + bool recalcShowerShape5x5 = false; // recalculate shower shape using 5x5 cells // default constructor EMCALClusterDefinition() = default; // constructor - EMCALClusterDefinition(ClusterAlgorithm_t pAlgorithm, int pStorageID, int pSelectedCellType, std::string pName, double pSeedEnergy, double pMinCellEnergy, double pTimeMin, double pTimeMax, bool pDoGradientCut, double pGradientCut) + EMCALClusterDefinition(ClusterAlgorithm_t pAlgorithm, int pStorageID, int pSelectedCellType, std::string pName, double pSeedEnergy, double pMinCellEnergy, double pTimeMin, double pTimeMax, bool pDoGradientCut, double pGradientCut, bool precalcShowerShape5x5) { algorithm = pAlgorithm; storageID = pStorageID; @@ -58,12 +59,13 @@ struct EMCALClusterDefinition { timeMax = pTimeMax; doGradientCut = pDoGradientCut; gradientCut = pGradientCut; + recalcShowerShape5x5 = precalcShowerShape5x5; } // implement comparison operators for int std::string and ClusterAlgorithm_t bool operator==(const EMCALClusterDefinition& rhs) const { - return (algorithm == rhs.algorithm && storageID == rhs.storageID && name == rhs.name && seedEnergy == rhs.seedEnergy && minCellEnergy == rhs.minCellEnergy && timeMin == rhs.timeMin && timeMax == rhs.timeMax && gradientCut == rhs.gradientCut && doGradientCut == rhs.doGradientCut); + return (algorithm == rhs.algorithm && storageID == rhs.storageID && name == rhs.name && seedEnergy == rhs.seedEnergy && minCellEnergy == rhs.minCellEnergy && timeMin == rhs.timeMin && timeMax == rhs.timeMax && gradientCut == rhs.gradientCut && doGradientCut == rhs.doGradientCut && recalcShowerShape5x5 == rhs.recalcShowerShape5x5); } bool operator!=(const EMCALClusterDefinition& rhs) const { diff --git a/PWGJE/DataModel/EMCALClusters.h b/PWGJE/DataModel/EMCALClusters.h index af97b559546..a4d6e032422 100644 --- a/PWGJE/DataModel/EMCALClusters.h +++ b/PWGJE/DataModel/EMCALClusters.h @@ -28,16 +28,17 @@ namespace emcalcluster // define global cluster definitions // New definitions should be added here! -const EMCALClusterDefinition kV3NoSplit(ClusterAlgorithm_t::kV3, 0, 1, "kV3NoSplit", 0.5, 0.1, -10000, 10000, false, 0.); -const EMCALClusterDefinition kV3NoSplitLowSeed(ClusterAlgorithm_t::kV3, 1, 1, "kV3NoSplitLowSeed", 0.3, 0.1, -10000, 10000, false, 0.); -const EMCALClusterDefinition kV3NoSplitLowerSeed(ClusterAlgorithm_t::kV3, 2, 1, "kV3NoSplitLowerSeed", 0.2, 0.1, -10000, 10000, false, 0.); -const EMCALClusterDefinition kV3Default(ClusterAlgorithm_t::kV3, 10, 1, "kV3Default", 0.5, 0.1, -10000, 10000, true, 0.03); -const EMCALClusterDefinition kV3MostSplit(ClusterAlgorithm_t::kV3, 11, 1, "kV3MostSplit", 0.5, 0.1, -10000, 10000, true, 0.); -const EMCALClusterDefinition kV3LowSeed(ClusterAlgorithm_t::kV3, 12, 1, "kV3LowSeed", 0.3, 0.1, -10000, 10000, true, 0.03); -const EMCALClusterDefinition kV3MostSplitLowSeed(ClusterAlgorithm_t::kV3, 13, 1, "kV3MostSplitLowSeed", 0.3, 0.1, -10000, 10000, true, 0.); -const EMCALClusterDefinition kV3StrictTime(ClusterAlgorithm_t::kV3, 20, 1, "kV3StrictTime", 0.5, 0.1, -500, 500, true, 0.03); -const EMCALClusterDefinition kV3StricterTime(ClusterAlgorithm_t::kV3, 21, 1, "kV3StricterTime", 0.5, 0.1, -100, 100, true, 0.03); -const EMCALClusterDefinition kV3MostStrictTime(ClusterAlgorithm_t::kV3, 22, 1, "kV3MostStrictTime", 0.5, 0.1, -50, 50, true, 0.03); +const EMCALClusterDefinition kV3NoSplit(ClusterAlgorithm_t::kV3, 0, 1, "kV3NoSplit", 0.5, 0.1, -10000, 10000, false, 0., false); +const EMCALClusterDefinition kV3NoSplitLowSeed(ClusterAlgorithm_t::kV3, 1, 1, "kV3NoSplitLowSeed", 0.3, 0.1, -10000, 10000, false, 0., false); +const EMCALClusterDefinition kV3NoSplitLowerSeed(ClusterAlgorithm_t::kV3, 2, 1, "kV3NoSplitLowerSeed", 0.2, 0.1, -10000, 10000, false, 0., false); +const EMCALClusterDefinition kV3Default(ClusterAlgorithm_t::kV3, 10, 1, "kV3Default", 0.5, 0.1, -10000, 10000, true, 0.03, false); +const EMCALClusterDefinition kV3MostSplit(ClusterAlgorithm_t::kV3, 11, 1, "kV3MostSplit", 0.5, 0.1, -10000, 10000, true, 0., false); +const EMCALClusterDefinition kV3LowSeed(ClusterAlgorithm_t::kV3, 12, 1, "kV3LowSeed", 0.3, 0.1, -10000, 10000, true, 0.03, false); +const EMCALClusterDefinition kV3MostSplitLowSeed(ClusterAlgorithm_t::kV3, 13, 1, "kV3MostSplitLowSeed", 0.3, 0.1, -10000, 10000, true, 0., false); +const EMCALClusterDefinition kV3StrictTime(ClusterAlgorithm_t::kV3, 20, 1, "kV3StrictTime", 0.5, 0.1, -500, 500, true, 0.03, false); +const EMCALClusterDefinition kV3StricterTime(ClusterAlgorithm_t::kV3, 21, 1, "kV3StricterTime", 0.5, 0.1, -100, 100, true, 0.03, false); +const EMCALClusterDefinition kV3MostStrictTime(ClusterAlgorithm_t::kV3, 22, 1, "kV3MostStrictTime", 0.5, 0.1, -50, 50, true, 0.03, false); +const EMCALClusterDefinition kV3Default5x5(ClusterAlgorithm_t::kV3, 30, 1, "kV3Default5x5", 0.5, 0.1, -10000, 10000, true, 0.03, true); /// \brief function returns EMCALClusterDefinition for the given name /// \param name name of the cluster definition @@ -64,6 +65,8 @@ const EMCALClusterDefinition getClusterDefinitionFromString(const std::string& c return kV3StricterTime; } else if (clusterDefinitionName == "kV3MostStrictTime") { return kV3MostStrictTime; + } else if (clusterDefinitionName == "kV3Default5x5") { + return kV3Default5x5; } else { throw std::invalid_argument("Cluster definition name not recognized"); } diff --git a/PWGJE/DataModel/GammaJetAnalysisTree.h b/PWGJE/DataModel/GammaJetAnalysisTree.h index a28131ab688..7d468a339e7 100644 --- a/PWGJE/DataModel/GammaJetAnalysisTree.h +++ b/PWGJE/DataModel/GammaJetAnalysisTree.h @@ -42,6 +42,7 @@ namespace gjgamma { DECLARE_SOA_INDEX_COLUMN(GjEvent, gjevent); //! event index DECLARE_SOA_COLUMN(Energy, energy, float); //! cluster energy (GeV) +DECLARE_SOA_COLUMN(Definition, definition, int); //! cluster definition, see EMCALClusterDefinition.h DECLARE_SOA_COLUMN(Eta, eta, float); //! cluster pseudorapidity (calculated using vertex) DECLARE_SOA_COLUMN(Phi, phi, float); //! cluster azimuthal angle (calculated using vertex) DECLARE_SOA_COLUMN(M02, m02, float); //! shower shape long axis @@ -58,7 +59,7 @@ DECLARE_SOA_COLUMN(TMdeltaEta, tmdeltaeta, float); //! delta DECLARE_SOA_COLUMN(TMtrackP, tmtrackp, float); //! track momentum of closest match, -1 if no match found } // namespace gjgamma DECLARE_SOA_TABLE(GjGammas, "AOD", "GJGAMMA", - gjgamma::GjEventId, gjgamma::Energy, gjgamma::Eta, gjgamma::Phi, gjgamma::M02, gjgamma::M20, gjgamma::NCells, gjgamma::Time, gjgamma::IsExotic, gjgamma::DistanceToBadChannel, gjgamma::NLM, gjgamma::IsoRaw, gjgamma::PerpConeRho, gjgamma::TMdeltaPhi, gjgamma::TMdeltaEta, gjgamma::TMtrackP) + gjgamma::GjEventId, gjgamma::Energy, gjgamma::Definition, gjgamma::Eta, gjgamma::Phi, gjgamma::M02, gjgamma::M20, gjgamma::NCells, gjgamma::Time, gjgamma::IsExotic, gjgamma::DistanceToBadChannel, gjgamma::NLM, gjgamma::IsoRaw, gjgamma::PerpConeRho, gjgamma::TMdeltaPhi, gjgamma::TMdeltaEta, gjgamma::TMtrackP) namespace gjchjet { DECLARE_SOA_INDEX_COLUMN(GjEvent, gjevent); diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index d9a46f59b3c..e14c347eb37 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -567,6 +567,8 @@ struct EmcalCorrectionTask { mAnalysisClusters.clear(); mClusterLabels.clear(); mClusterFactories.reset(); + // in preparation for future O2 changes + // mClusterFactories.setClusterizerSettings(mClusterDefinitions.at(iClusterizer).minCellEnergy, mClusterDefinitions.at(iClusterizer).timeMin, mClusterDefinitions.at(iClusterizer).timeMax, mClusterDefinitions.at(iClusterizer).recalcShowerShape5x5); if (cellLabels) { mClusterFactories.setContainer(*emcalClusters, cellsBC, *emcalClustersInputIndices, cellLabels); } else { diff --git a/PWGJE/Tasks/gammaJetTreeProducer.cxx b/PWGJE/Tasks/gammaJetTreeProducer.cxx index 9cc938d1184..e1ffd83887f 100644 --- a/PWGJE/Tasks/gammaJetTreeProducer.cxx +++ b/PWGJE/Tasks/gammaJetTreeProducer.cxx @@ -53,7 +53,7 @@ using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; -using selectedClusters = o2::soa::Filtered>; +using emcClusters = o2::soa::Join; #include "Framework/runDataProcessing.h" @@ -82,8 +82,7 @@ struct GammaJetTreeProducer { Configurable isoR{"isoR", 0.4, "isolation cone radius"}; Configurable perpConeJetR{"perpConeJetR", 0.4, "perpendicular cone radius used to calculate perp cone rho for jet"}; Configurable trackMatchingEoverP{"trackMatchingEoverP", 2.0, "closest track is required to have E/p < value"}; - // cluster cuts - Configurable mClusterDefinition{"clusterDefinition", 10, "cluster definition to be selected, e.g. 10=kV3Default"}; + Configurable minClusterETrigger{"minClusterETrigger", 0.0, "minimum cluster energy to trigger"}; int mRunNumber = 0; int eventSelection = -1; @@ -136,7 +135,16 @@ struct GammaJetTreeProducer { return true; } - bool isEventAccepted(const auto& collision) + int getStoredColIndex(const auto& collision) + { + int32_t storedColIndex = -1; + if (auto foundCol = collisionMapping.find(collision.globalIndex()); foundCol != collisionMapping.end()) { + storedColIndex = foundCol->second; + } + return storedColIndex; + } + + bool isEventAccepted(const auto& collision, const auto& clusters) { if (collision.posZ() > mVertexCut) { @@ -151,7 +159,14 @@ struct GammaJetTreeProducer { if (!jetderiveddatautilities::eventEMCAL(collision)) { return false; } - return true; + + // Check if event contains a cluster with energy > minClusterETrigger + for (auto cluster : clusters) { + if (cluster.energy() > minClusterETrigger) { + return true; + } + } + return false; } double ch_iso_in_cone(const auto& cluster, aod::JetTracks const& tracks, float radius = 0.4) @@ -217,27 +232,43 @@ struct GammaJetTreeProducer { // --------------------- // Processing functions // --------------------- + // WARNING: This function always has to run first in the processing chain void processClearMaps(aod::JetCollisions const&) { collisionMapping.clear(); } PROCESS_SWITCH(GammaJetTreeProducer, processClearMaps, "process function that clears all the maps in each dataframe", true); + // WARNING: This function always has to run second in the processing chain + void processEvent(soa::Join::iterator const& collision, emcClusters const& clusters) + { + if (!isEventAccepted(collision, clusters)) { + return; + } + + eventsTable(collision.multiplicity(), collision.centrality(), collision.rho(), collision.eventSel(), collision.trackOccupancyInTimeRange(), collision.alias_raw()); + collisionMapping[collision.globalIndex()] = eventsTable.lastIndex(); + } + PROCESS_SWITCH(GammaJetTreeProducer, processEvent, "Process event", true); + + // --------------------- + // Processing functions can be safely added below this line + // --------------------- + // define cluster filter. It selects only those clusters which are of the type // sadly passing of the string at runtime is not possible for technical region so cluster definition is // an integer instead - Filter clusterDefinitionSelection = (o2::aod::jcluster::definition == mClusterDefinition); PresliceUnsorted EMCTrackPerTrack = aod::jemctrack::trackId; - // Process clusters - void processClusters(soa::Join::iterator const& collision, selectedClusters const& clusters, aod::JetTracks const& tracks, aod::JEMCTracks const& emctracks) + void processClusters(soa::Join::iterator const& collision, emcClusters const& clusters, aod::JetTracks const& tracks, aod::JEMCTracks const& emctracks) { - if (!isEventAccepted(collision)) { + // event selection + int32_t storedColIndex = getStoredColIndex(collision); + if (storedColIndex == -1) return; - } - eventsTable(collision.multiplicity(), collision.centrality(), collision.rho(), collision.eventSel(), collision.trackOccupancyInTimeRange(), collision.alias_raw()); - collisionMapping[collision.globalIndex()] = eventsTable.lastIndex(); + // eventsTable(collision.multiplicity(), collision.centrality(), collision.rho(), collision.eventSel(), collision.trackOccupancyInTimeRange(), collision.alias_raw()); + // collisionMapping[collision.globalIndex()] = eventsTable.lastIndex(); // loop over tracks one time for QA runTrackQA(collision, tracks); @@ -275,8 +306,7 @@ struct GammaJetTreeProducer { break; } } - - gammasTable(eventsTable.lastIndex(), cluster.energy(), cluster.eta(), cluster.phi(), cluster.m02(), cluster.m20(), cluster.nCells(), cluster.time(), cluster.isExotic(), cluster.distanceToBadChannel(), cluster.nlm(), isoraw, perpconerho, dPhi, dEta, p); + gammasTable(storedColIndex, cluster.energy(), cluster.definition(), cluster.eta(), cluster.phi(), cluster.m02(), cluster.m20(), cluster.nCells(), cluster.time(), cluster.isExotic(), cluster.distanceToBadChannel(), cluster.nlm(), isoraw, perpconerho, dPhi, dEta, p); } // dummy loop over tracks @@ -291,9 +321,9 @@ struct GammaJetTreeProducer { void processChargedJets(soa::Join::iterator const& collision, soa::Filtered> const& chargedJets, aod::JetTracks const& tracks) { // event selection - if (!isEventAccepted(collision)) { + int32_t storedColIndex = getStoredColIndex(collision); + if (storedColIndex == -1) return; - } float leadingTrackPt = 0; ushort nconst = 0; // loop over charged jets @@ -310,10 +340,7 @@ struct GammaJetTreeProducer { leadingTrackPt = constituent.pt(); } } - int32_t storedColIndex = -1; - if (auto foundCol = collisionMapping.find(collision.globalIndex()); foundCol != collisionMapping.end()) { - storedColIndex = foundCol->second; - } + // calculate perp cone rho double perpconerho = ch_perp_cone_rho(jet, tracks, perpConeJetR); mHistograms.fill(HIST("chjetPtEtaPhi"), jet.pt(), jet.eta(), jet.phi()); From 9f5be32f7cdcb8486bc1d0f585c3df7765f51e73 Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Fri, 29 Nov 2024 13:26:50 +0100 Subject: [PATCH 170/459] [PWGCF] fix duplicated histograms (#8724) Co-authored-by: junleekim --- PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx b/PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx index c669dcf7cc1..be132b44684 100644 --- a/PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx +++ b/PWGCF/JCorran/Tasks/jEPDzeroFlowAnalysis.cxx @@ -197,7 +197,7 @@ struct jEPDzeroFlowAnalysis { } histos.add(Form("hist_EP_cos_Det_v2"), "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); - histos.add(Form("hist_EP_cos_Det_v2"), "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add(Form("hist_EP_sin_Det_v2"), "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); } void processData(MyCollisions::iterator const& collision, aod::CF2ProngTracks const& p2tracks) From 83bcd40903f36c5f00a8d67de5c9eac4a92f587f Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Fri, 29 Nov 2024 13:59:51 +0100 Subject: [PATCH 171/459] [Common] centrality study task additions (#8732) Co-authored-by: ALICE Builder --- Common/Tasks/centralityStudy.cxx | 43 ++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index 629867e2984..1ffa639f474 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -65,9 +65,19 @@ struct centralityStudy { Configurable scaleSignalFT0M{"scaleSignalFT0M", 1.00f, "scale FT0M signal for convenience"}; Configurable scaleSignalFV0A{"scaleSignalFV0A", 1.00f, "scale FV0A signal for convenience"}; + // _______________________________________ + // upc rejection criteria // reject low zna/c - Configurable minZNACsignal{"minZNACsignal", 15.0f, "min zna/c signal"}; - Configurable maxFT0CforZNACselection{"maxFT0CforZNACselection", 35000.0f, "max ft0c signal for minZNACsignal to work"}; + struct : ConfigurableGroup { + Configurable minZNACsignal{"minZNACsignal", -999999.0f, "min zna/c signal"}; + Configurable maxFT0CforZNACselection{"maxFT0CforZNACselection", -99999.0f, "max ft0c signal for minZNACsignal to work"}; + + Configurable minFV0Asignal{"minFV0Asignal", -999999.0f, "min fv0a signal"}; + Configurable maxFT0CforFV0Aselection{"maxFT0CforFV0Aselection", -99999.0f, "max ft0c signal for minFV0Asignal to work"}; + + Configurable minFDDAsignal{"minFDDAsignal", -999999.0f, "min fdda signal"}; + Configurable maxFT0CforFDDAselection{"maxFT0CforFDDAselection", -99999.0f, "max ft0c signal for minFDDAsignal to work"}; + } upcRejection; // Configurable Axes for 2d plots, etc ConfigurableAxis axisMultFV0A{"axisMultFV0A", {1000, 0, 100000}, "FV0A amplitude"}; @@ -244,9 +254,17 @@ struct centralityStudy { } histos.fill(HIST("hCollisionSelection"), 14 /* Not ITS ROF pileup (strict) */); - if (collision.multFT0C() < maxFT0CforZNACselection && - collision.multZNA() < minZNACsignal && - collision.multZNC() < minZNACsignal) { + if (collision.multFT0C() < upcRejection.maxFT0CforZNACselection && + collision.multZNA() < upcRejection.minZNACsignal && + collision.multZNC() < upcRejection.minZNACsignal) { + return; + } + if (collision.multFT0C() < upcRejection.maxFT0CforFV0Aselection && + collision.multFV0A() < upcRejection.minFV0Asignal) { + return; + } + if (collision.multFT0C() < upcRejection.maxFT0CforFDDAselection && + collision.multFDDA() < upcRejection.minFDDAsignal) { return; } histos.fill(HIST("hCollisionSelection"), 15 /* pass em/upc rejection */); @@ -320,11 +338,20 @@ struct centralityStudy { } histos.fill(HIST("hBCSelection"), 4); // FV0OrA - if (multbc.multBCFT0C() < maxFT0CforZNACselection && - multbc.multBCZNA() < minZNACsignal && - multbc.multBCZNC() < minZNACsignal) { + if (multbc.multBCFT0C() < upcRejection.maxFT0CforZNACselection && + multbc.multBCZNA() < upcRejection.minZNACsignal && + multbc.multBCZNC() < upcRejection.minZNACsignal) { return; } + if (multbc.multBCFT0C() < upcRejection.maxFT0CforFV0Aselection && + multbc.multBCFV0A() < upcRejection.minFV0Asignal) { + return; + } + if (multbc.multBCFT0C() < upcRejection.maxFT0CforFDDAselection && + multbc.multBCFDDA() < upcRejection.minFDDAsignal) { + return; + } + histos.fill(HIST("hBCSelection"), 5); // znac // if we got here, we also finally fill the FT0C histogram, please From 18c3b38d1690e4384593673f0cba7ee9e352366e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Fri, 29 Nov 2024 14:51:47 +0100 Subject: [PATCH 172/459] [Common] [TOF] streamline ccdb configuration (#8692) - fix caching of metadata for ccdb call --- Common/Core/PID/PIDTOF.h | 77 +++++- Common/TableProducer/PID/pidTOFMerge.cxx | 236 ++++++++---------- Common/TableProducer/PID/pidTOFbeta.cxx | 11 +- DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx | 18 +- .../Nuspex/LFTreeCreatorClusterStudies.cxx | 33 +-- PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx | 5 +- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 4 +- PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx | 3 +- 8 files changed, 193 insertions(+), 194 deletions(-) diff --git a/Common/Core/PID/PIDTOF.h b/Common/Core/PID/PIDTOF.h index 3c507223feb..f0165c65400 100644 --- a/Common/Core/PID/PIDTOF.h +++ b/Common/Core/PID/PIDTOF.h @@ -46,7 +46,6 @@ static constexpr float kCSPEDDInv = 1.f / kCSPEED; /// Inverse of static constexpr float defaultReturnValue = -999.f; /// Default return value in case TOF measurement is not available /// \brief Class to handle the the TOF detector response for the TOF beta measurement -template class Beta { public: @@ -62,11 +61,19 @@ class Beta /// Gets the beta for the track of interest /// \param track Track of interest /// \param collisionTime Collision time - static float GetBeta(const TrackType& track, const float collisionTime) { return track.hasTOF() ? GetBeta(track.length(), track.tofSignal(), collisionTime) : defaultReturnValue; } + template + static float GetBeta(const TrackType& track, const float collisionTime) + { + return track.hasTOF() ? GetBeta(track.length(), track.tofSignal(), collisionTime) : defaultReturnValue; + } /// Gets the beta for the track of interest /// \param track Track of interest - static float GetBeta(const TrackType& track) { return GetBeta(track, track.tofEvTime()); } + template + static float GetBeta(const TrackType& track) + { + return GetBeta(track, track.tofEvTime()); + } /// Computes the expected uncertainty on the beta measurement /// \param length Length in cm of the track @@ -77,7 +84,11 @@ class Beta /// Gets the expected uncertainty on the beta measurement of the track of interest /// \param track Track of interest - float GetExpectedSigma(const TrackType& track) const { return GetExpectedSigma(track.length(), track.tofSignal(), track.tofEvTime(), mExpectedResolution); } + template + float GetExpectedSigma(const TrackType& track) const + { + return GetExpectedSigma(track.length(), track.tofSignal(), track.tofEvTime(), mExpectedResolution); + } /// Gets the expected beta for a given mass hypothesis (no energy loss taken into account) /// \param momentum momentum in GeV/c of the track @@ -86,7 +97,7 @@ class Beta /// Gets the expected beta given the particle index (no energy loss taken into account) of the track of interest /// \param track Track of interest - template + template float GetExpectedBeta(const TrackType& track) const { return GetExpectedBeta(track.p(), o2::track::PID::getMass2Z(id)); @@ -94,7 +105,7 @@ class Beta /// Gets the number of sigmas with respect the approximate beta (no energy loss taken into account) of the track of interest /// \param track Track of interest - template + template float GetSeparation(const TrackType& track) const { return (GetBeta(track) - GetExpectedBeta(track)) / GetExpectedSigma(track); @@ -104,7 +115,6 @@ class Beta }; /// \brief Class to handle the the TOF detector response for the TOF mass measurement -template class TOFMass { public: @@ -118,11 +128,19 @@ class TOFMass /// Gets the TOF mass for the track of interest /// \param track Track of interest - static float GetTOFMass(const TrackType& track, const float beta) { return track.hasTOF() ? GetTOFMass(track.p(), beta) : defaultReturnValue; } + template + static float GetTOFMass(const TrackType& track, const float beta) + { + return track.hasTOF() ? GetTOFMass(track.p(), beta) : defaultReturnValue; + } /// Gets the TOF mass for the track of interest /// \param track Track of interest - static float GetTOFMass(const TrackType& track) { return track.hasTOF() ? GetTOFMass(track.p(), Beta::GetBeta(track)) : defaultReturnValue; } + template + static float GetTOFMass(const TrackType& track) + { + return track.hasTOF() ? GetTOFMass(track.p(), Beta::GetBeta(track)) : defaultReturnValue; + } }; /// \brief Next implementation class to store TOF response parameters for exp. times @@ -219,7 +237,7 @@ class TOFResoParamsV2 : public o2::tof::Parameters<13> } f.Close(); } - LOG(info) << "Set the Time Shift parameters from file " << filename << " and object " << objname << " for " << (positive ? "positive" : "negative"); + LOG(info) << "Set the Time Shift parameters from file " << filename << " and object " << objname << " for " << (positive ? "positive" : "negative") << " example of shift at eta 0: " << getTimeShift(0, positive); } void setTimeShiftParameters(TGraph* g, bool positive) { @@ -266,7 +284,7 @@ class TOFResoParamsV3 : public o2::tof::Parameters<13> "time_resolution", "time_resolution", "time_resolution", "time_resolution"}, "TOFResoParamsV3") { - setParameters(std::array{60.0}); + setParameters(std::array{60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0}); } // Default constructor with default parameters ~TOFResoParamsV3() = default; @@ -372,6 +390,20 @@ class TOFResoParamsV3 : public o2::tof::Parameters<13> return gNegEtaTimeCorr->Eval(eta); } + void printTimeShiftParameters() const + { + if (gPosEtaTimeCorr) { + LOG(info) << "Using a time shift for Pos " << gPosEtaTimeCorr->GetName() << " " << gPosEtaTimeCorr->GetTitle() << " value at 0: " << gPosEtaTimeCorr->Eval(0) << " vs correction " << getTimeShift(0, 1); + } else { + LOG(info) << "Using no time shift for Pos vs correction " << getTimeShift(0, 1); + } + if (gNegEtaTimeCorr) { + LOG(info) << "Using a time shift for Neg " << gNegEtaTimeCorr->GetName() << " " << gNegEtaTimeCorr->GetTitle() << " value at 0: " << gNegEtaTimeCorr->Eval(0) << " vs correction " << getTimeShift(0, -1); + } else { + LOG(info) << "Using no time shift for Neg vs correction " << getTimeShift(0, -1); + } + } + void setResolutionParametrization(std::unordered_map const& pars) { static constexpr std::array particleNames = {"El", "Mu", "Pi", "Ka", "Pr", "De", "Tr", "He", "Al"}; @@ -382,6 +414,9 @@ class TOFResoParamsV3 : public o2::tof::Parameters<13> if (key.find(baseOpt) == 0) { // Remove from the key the baseOpt const std::string fun = key.substr(baseOpt.size()); + if (mResolution[i]) { + delete mResolution[i]; + } mResolution[i] = new TF2(baseOpt.c_str(), fun.c_str(), 0., 20, -1, 1.); LOG(info) << "Set the resolution function for " << particleNames[i] << " with formula " << mResolution[i]->GetFormula()->GetExpFormula(); break; @@ -404,6 +439,26 @@ class TOFResoParamsV3 : public o2::tof::Parameters<13> return mResolution[pid]->Eval(p, eta); } + void printResolution() const + { + static constexpr std::array particleNames = {"El", "Mu", "Pi", "Ka", "Pr", "De", "Tr", "He", "Al"}; + // Print a summary + for (int i = 0; i < 9; ++i) { + if (!mResolution[i]) { + LOG(info) << "Resolution function for " << particleNames[i] << " is not defined yet"; + continue; + } + LOG(info) << "Resolution function for " << particleNames[i] << " is " << mResolution[i]->GetName() << " with formula " << mResolution[i]->GetFormula()->GetExpFormula(); + } + } + void printFullConfig() const + { + print(); + printMomentumChargeShiftParameters(); + printTimeShiftParameters(); + printResolution(); + } + private: // Charge calibration int mEtaN = 0; // Number of eta bins, 0 means no correction diff --git a/Common/TableProducer/PID/pidTOFMerge.cxx b/Common/TableProducer/PID/pidTOFMerge.cxx index 047dc041cd5..df682d4ffb8 100644 --- a/Common/TableProducer/PID/pidTOFMerge.cxx +++ b/Common/TableProducer/PID/pidTOFMerge.cxx @@ -70,11 +70,12 @@ struct TOFCalibConfig { mTimestamp = opt.cfgTimestamp.value; mTimeShiftCCDBPathPos = opt.cfgTimeShiftCCDBPathPos.value; mTimeShiftCCDBPathNeg = opt.cfgTimeShiftCCDBPathNeg.value; + mTimeShiftCCDBPathPosMC = opt.cfgTimeShiftCCDBPathPosMC.value; + mTimeShiftCCDBPathNegMC = opt.cfgTimeShiftCCDBPathNegMC.value; mParamFileName = opt.cfgParamFileName.value; mParametrizationPath = opt.cfgParametrizationPath.value; mReconstructionPass = opt.cfgReconstructionPass.value; mReconstructionPassDefault = opt.cfgReconstructionPassDefault.value; - mLoadResponseFromCCDB = opt.cfgLoadResponseFromCCDB.value; mFatalOnPassNotAvailable = opt.cfgFatalOnPassNotAvailable.value; mEnableTimeDependentResponse = opt.cfgEnableTimeDependentResponse.value; mCollisionSystem = opt.cfgCollisionSystem.value; @@ -97,11 +98,12 @@ struct TOFCalibConfig { getCfg(initContext, "ccdb-timestamp", mTimestamp, task); getCfg(initContext, "timeShiftCCDBPathPos", mTimeShiftCCDBPathPos, task); getCfg(initContext, "timeShiftCCDBPathNeg", mTimeShiftCCDBPathNeg, task); + getCfg(initContext, "timeShiftCCDBPathPosMC", mTimeShiftCCDBPathPosMC, task); + getCfg(initContext, "timeShiftCCDBPathNegMC", mTimeShiftCCDBPathNegMC, task); getCfg(initContext, "paramFileName", mParamFileName, task); getCfg(initContext, "parametrizationPath", mParametrizationPath, task); getCfg(initContext, "reconstructionPass", mReconstructionPass, task); getCfg(initContext, "reconstructionPassDefault", mReconstructionPassDefault, task); - getCfg(initContext, "loadResponseFromCCDB", mLoadResponseFromCCDB, task); getCfg(initContext, "fatalOnPassNotAvailable", mFatalOnPassNotAvailable, task); getCfg(initContext, "enableTimeDependentResponse", mEnableTimeDependentResponse, task); getCfg(initContext, "collisionSystem", mCollisionSystem, task); @@ -149,18 +151,15 @@ struct TOFCalibConfig { } else { mRespParamsV3.setResolutionParametrization(paramCollection.getPars(mReconstructionPassDefault)); mRespParamsV3.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPassDefault)); - mRespParamsV3.printMomentumChargeShiftParameters(); } } } else { // Pass is available, load non standard parameters mRespParamsV3.setResolutionParametrization(paramCollection.getPars(mReconstructionPass)); mRespParamsV3.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPass)); - mRespParamsV3.printMomentumChargeShiftParameters(); } - } else if (mLoadResponseFromCCDB && !mEnableTimeDependentResponse) { // Loading it from CCDB + } else if (!mEnableTimeDependentResponse) { // Loading it from CCDB LOG(info) << "Loading initial exp. sigma parametrization from CCDB, using path: " << mParametrizationPath << " for timestamp " << mTimestamp; - o2::tof::ParameterCollection* paramCollection = ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp); - paramCollection->print(); + o2::tof::ParameterCollection* paramCollection = ccdb->template getSpecific(mParametrizationPath, mTimestamp); if (!paramCollection->retrieveParameters(mRespParamsV3, mReconstructionPass)) { // Attempt at loading the parameters with the pass defined if (mFatalOnPassNotAvailable) { LOG(fatal) << "Pass '" << mReconstructionPass << "' not available in the retrieved CCDB object"; @@ -172,50 +171,46 @@ struct TOFCalibConfig { } else { mRespParamsV3.setResolutionParametrization(paramCollection->getPars(mReconstructionPassDefault)); mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPassDefault)); - mRespParamsV3.printMomentumChargeShiftParameters(); } } } else { // Pass is available, load non standard parameters mRespParamsV3.setResolutionParametrization(paramCollection->getPars(mReconstructionPass)); mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPass)); - mRespParamsV3.printMomentumChargeShiftParameters(); } - } else { - std::unordered_map m; - mRespParamsV3.setResolutionParametrization(m); } // Loading additional calibration objects - if (mTimeShiftCCDBPathPos != "") { - if (mTimeShiftCCDBPathPos.find(".root") != std::string::npos) { - mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathPos, "ccdb_object", true); - } else if (!mEnableTimeDependentResponse) { - if (mReconstructionPass == "") { - mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathPos, mTimestamp), true); - } else { - std::map metadata; - metadata["RecoPassName"] = mReconstructionPass; - mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(mTimeShiftCCDBPathPos, mTimestamp, metadata), true); - } - } + std::map metadata; + if (!mReconstructionPass.empty()) { + metadata["RecoPassName"] = mReconstructionPass; } - if (mTimeShiftCCDBPathNeg != "") { - if (mTimeShiftCCDBPathNeg.find(".root") != std::string::npos) { - mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathNeg, "ccdb_object", false); - } else if (!mEnableTimeDependentResponse) { - if (mReconstructionPass == "") { - mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathNeg, mTimestamp), false); - } else { - std::map metadata; - metadata["RecoPassName"] = mReconstructionPass; - mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(mTimeShiftCCDBPathNeg, mTimestamp, metadata), false); - } + + auto updateTimeShift = [&](const std::string& nameShift, bool isPositive) { + if (nameShift.empty()) { + return; } - } + const bool isFromFile = nameShift.find(".root") != std::string::npos; + if (isFromFile) { + LOG(info) << "Initializing the time shift for " << (isPositive ? "positive" : "negative") << " from file '" << nameShift << "'"; + mRespParamsV3.setTimeShiftParameters(nameShift, "ccdb_object", isPositive); + } else if (!mEnableTimeDependentResponse) { // If the response is fixed fetch it at the init time + LOG(info) << "Initializing the time shift for " << (isPositive ? "positive" : "negative") + << " from ccdb '" << nameShift << "' and timestamp " << mTimestamp + << " and pass '" << mReconstructionPass << "'"; + mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(nameShift, mTimestamp, metadata), isPositive); + } + LOG(info) << " test getTimeShift at 0 " << (isPositive ? "pos" : "neg") << ": " + << mRespParamsV3.getTimeShift(0, isPositive); + }; + + const std::string nameShiftPos = metadataInfo.isMC() ? mTimeShiftCCDBPathPosMC : mTimeShiftCCDBPathPos; + updateTimeShift(nameShiftPos, true); + const std::string nameShiftNeg = metadataInfo.isMC() ? mTimeShiftCCDBPathNegMC : mTimeShiftCCDBPathNeg; + updateTimeShift(nameShiftNeg, true); // Calibration object is defined LOG(info) << "Parametrization at init time:"; - mRespParamsV3.print(); + mRespParamsV3.printFullConfig(); } template @@ -228,13 +223,14 @@ struct TOFCalibConfig { if (mLastRunNumber == bc.runNumber()) { return; } + LOG(info) << "Updating the parametrization from last run " << mLastRunNumber << " to " << bc.runNumber() << " and timestamp from " << mTimestamp << " " << bc.timestamp(); mLastRunNumber = bc.runNumber(); mTimestamp = bc.timestamp(); // Check the beam type if (mCollisionSystem == -1) { - o2::parameters::GRPLHCIFData* grpo = ccdb->template getForTimeStamp(mPathGrpLhcIf, - mTimestamp); + o2::parameters::GRPLHCIFData* grpo = ccdb->template getSpecific(mPathGrpLhcIf, + mTimestamp); mCollisionSystem = CollisionSystemType::getCollisionTypeFromGrp(grpo); } else { LOG(debug) << "Not setting collisions system as already set to " << mCollisionSystem << " " << CollisionSystemType::getCollisionSystemName(mCollisionSystem); @@ -243,51 +239,56 @@ struct TOFCalibConfig { if (!mEnableTimeDependentResponse) { return; } - LOG(info) << "Updating parametrization from path '" << mParametrizationPath << "' and timestamp " << mTimestamp << " and reconstruction pass '" << mReconstructionPass << "'"; - if (mParamFileName.empty()) { // Not loading if parametrization from file - if (!ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->retrieveParameters(mRespParamsV3, mReconstructionPass)) { + LOG(info) << "Updating parametrization from path '" << mParametrizationPath << "' and timestamp " << mTimestamp << " and reconstruction pass '" << mReconstructionPass << "' for run number " << bc.runNumber(); + if (mParamFileName.empty()) { // Not loading if parametrization was taken from file + LOG(info) << "Updating parametrization from ccdb"; + const o2::tof::ParameterCollection* paramCollection = ccdb->template getSpecific(mParametrizationPath, mTimestamp); + if (!paramCollection->retrieveParameters(mRespParamsV3, mReconstructionPass)) { if (mFatalOnPassNotAvailable) { LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); } else { LOGF(warning, "Pass '%s' not available in the retrieved CCDB object, fetching '%s'", mReconstructionPass.data(), mReconstructionPassDefault.data()); - if (!ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->retrieveParameters(mRespParamsV3, mReconstructionPassDefault)) { - ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->print(); + if (!paramCollection->retrieveParameters(mRespParamsV3, mReconstructionPassDefault)) { + paramCollection->print(); LOG(fatal) << "Cannot get default pass for calibration " << mReconstructionPassDefault; + } else { // Found the default case + mRespParamsV3.setResolutionParametrization(paramCollection->getPars(mReconstructionPassDefault)); + mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPassDefault)); } } + } else { // Found the non default case + mRespParamsV3.setResolutionParametrization(paramCollection->getPars(mReconstructionPass)); + mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPass)); } } // Loading additional calibration objects - if (mTimeShiftCCDBPathPos != "") { - if (mTimeShiftCCDBPathPos.find(".root") != std::string::npos) { - mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathPos, "ccdb_object", true); - } else { - if (mReconstructionPass == "") { - mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathPos, mTimestamp), true); - } else { - std::map metadata; - metadata["RecoPassName"] = mReconstructionPass; - mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(mTimeShiftCCDBPathPos, mTimestamp, metadata), true); - } - } - } - if (mTimeShiftCCDBPathNeg != "") { - if (mTimeShiftCCDBPathNeg.find(".root") != std::string::npos) { - mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathNeg, "ccdb_object", false); - } else { - if (mReconstructionPass == "") { - mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathNeg, mTimestamp), false); - } else { - std::map metadata; - metadata["RecoPassName"] = mReconstructionPass; - mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(mTimeShiftCCDBPathNeg, mTimestamp, metadata), false); - } - } - LOG(info) << " test getTimeShift neg: " << mRespParamsV3.getTimeShift(0, false); + std::map metadata; + if (!mReconstructionPass.empty()) { + metadata["RecoPassName"] = mReconstructionPass; } - return; + auto updateTimeShift = [&](const std::string& nameShift, bool isPositive) { + if (nameShift.empty()) { + return; + } + const bool isFromFile = nameShift.find(".root") != std::string::npos; + if (isFromFile) { + return; + } + LOG(info) << "Updating the time shift for " << (isPositive ? "positive" : "negative") + << " from ccdb '" << nameShift << "' and timestamp " << mTimestamp + << " and pass '" << mReconstructionPass << "'"; + mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(nameShift, mTimestamp, metadata), isPositive); + LOG(info) << " test getTimeShift at 0 " << (isPositive ? "pos" : "neg") << ": " + << mRespParamsV3.getTimeShift(0, isPositive); + }; + + updateTimeShift(metadataInfo.isMC() ? mTimeShiftCCDBPathPosMC : mTimeShiftCCDBPathPos, true); + updateTimeShift(metadataInfo.isMC() ? mTimeShiftCCDBPathNegMC : mTimeShiftCCDBPathNeg, false); + + LOG(info) << "Parametrization at setup time:"; + mRespParamsV3.printFullConfig(); } bool autoSetProcessFunctions() const { return mAutoSetProcessFunctions; } @@ -303,11 +304,12 @@ struct TOFCalibConfig { int64_t mTimestamp; std::string mTimeShiftCCDBPathPos; std::string mTimeShiftCCDBPathNeg; + std::string mTimeShiftCCDBPathPosMC; + std::string mTimeShiftCCDBPathNegMC; std::string mParamFileName; std::string mParametrizationPath; std::string mReconstructionPass; std::string mReconstructionPassDefault; - bool mLoadResponseFromCCDB; bool mFatalOnPassNotAvailable; bool mEnableTimeDependentResponse; int mCollisionSystem; @@ -345,11 +347,12 @@ struct tofSignal { Configurable cfgTimestamp{"ccdb-timestamp", -1, "timestamp of the object"}; Configurable cfgTimeShiftCCDBPathPos{"timeShiftCCDBPathPos", "", "Path of the TOF time shift vs eta for pos. tracks. If empty none is taken"}; Configurable cfgTimeShiftCCDBPathNeg{"timeShiftCCDBPathNeg", "", "Path of the TOF time shift vs eta for neg. tracks. If empty none is taken"}; + Configurable cfgTimeShiftCCDBPathPosMC{"timeShiftCCDBPathPosMC", "", "Path of the TOF time shift for MC vs eta for pos. tracks. If empty none is taken"}; + Configurable cfgTimeShiftCCDBPathNegMC{"timeShiftCCDBPathNegMC", "", "Path of the TOF time shift for MC vs eta for neg. tracks. If empty none is taken"}; Configurable cfgParamFileName{"paramFileName", "", "Path to the parametrization object. If empty the parametrization is not taken from file"}; Configurable cfgParametrizationPath{"parametrizationPath", "TOF/Calib/Params", "Path of the TOF parametrization on the CCDB or in the file, if the paramFileName is not empty"}; Configurable cfgReconstructionPass{"reconstructionPass", "", {"Apass to use when fetching the calibration tables. Empty (default) does not check for any pass. Use `metadata` to fetch it from the AO2D metadata. Otherwise it will override the metadata."}}; Configurable cfgReconstructionPassDefault{"reconstructionPassDefault", "unanchored", {"Default pass to get if the standard one is not found"}}; - Configurable cfgLoadResponseFromCCDB{"loadResponseFromCCDB", false, "Flag to load the response from the CCDB"}; Configurable cfgFatalOnPassNotAvailable{"fatalOnPassNotAvailable", true, "Flag to throw a fatal if the pass is not available in the retrieved CCDB object"}; Configurable cfgEnableTimeDependentResponse{"enableTimeDependentResponse", false, "Flag to use the collision timestamp to fetch the PID Response"}; Configurable cfgCollisionSystem{"collisionSystem", -1, "Collision system: -1 (autoset), 0 (pp), 1 (PbPb), 2 (XeXe), 3 (pPb)"}; @@ -611,7 +614,7 @@ struct tofEventTime { void processRun3(Run3TrksWtof& tracks, aod::FT0s const&, EvTimeCollisionsFT0 const&, - aod::BCsWithTimestamps const&) + aod::BCsWithTimestamps const& bcs) { if (!enableTableTOFEvTime) { return; @@ -623,39 +626,24 @@ struct tofEventTime { if (enableTableEvTimeTOFOnly) { tableEvTimeTOFOnly.reserve(tracks.size()); } - bool calibUpdated = false; - for (auto const& track : tracks) { // Loop on all tracks - if (!track.has_collision()) { // Skipping tracks without collisions - continue; - } - const auto& coll = track.collision_as(); - if (!coll.has_bc()) { - continue; - } - mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, coll.bc_as()); // Update the calibration parameters - calibUpdated = true; - break; - } + + mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, bcs.iteratorAt(0)); // Update the calibration parameters // Autoset the processing mode for the event time computation - if (calibUpdated) { - if (mComputeEvTimeWithTOF == -1 || mComputeEvTimeWithFT0 == -1) { - switch (mTOFCalibConfig.collisionSystem()) { - case CollisionSystemType::kCollSyspp: // pp - mComputeEvTimeWithTOF.value = ((mComputeEvTimeWithTOF == -1) ? 0 : mComputeEvTimeWithTOF.value); - mComputeEvTimeWithFT0.value = ((mComputeEvTimeWithFT0 == -1) ? 1 : mComputeEvTimeWithFT0.value); - break; - case CollisionSystemType::kCollSysPbPb: // PbPb - mComputeEvTimeWithTOF.value = ((mComputeEvTimeWithTOF == -1) ? 1 : mComputeEvTimeWithTOF.value); - mComputeEvTimeWithFT0.value = ((mComputeEvTimeWithFT0 == -1) ? 0 : mComputeEvTimeWithFT0.value); - break; - default: - LOG(fatal) << "Collision system " << mTOFCalibConfig.collisionSystem() << " " << CollisionSystemType::getCollisionSystemName(mTOFCalibConfig.collisionSystem()) << " not supported for TOF event time computation"; - break; - } + if (mComputeEvTimeWithTOF == -1 || mComputeEvTimeWithFT0 == -1) { + switch (mTOFCalibConfig.collisionSystem()) { + case CollisionSystemType::kCollSyspp: // pp + mComputeEvTimeWithTOF.value = ((mComputeEvTimeWithTOF == -1) ? 0 : mComputeEvTimeWithTOF.value); + mComputeEvTimeWithFT0.value = ((mComputeEvTimeWithFT0 == -1) ? 1 : mComputeEvTimeWithFT0.value); + break; + case CollisionSystemType::kCollSysPbPb: // PbPb + mComputeEvTimeWithTOF.value = ((mComputeEvTimeWithTOF == -1) ? 1 : mComputeEvTimeWithTOF.value); + mComputeEvTimeWithFT0.value = ((mComputeEvTimeWithFT0 == -1) ? 0 : mComputeEvTimeWithFT0.value); + break; + default: + LOG(fatal) << "Collision system " << mTOFCalibConfig.collisionSystem() << " " << CollisionSystemType::getCollisionSystemName(mTOFCalibConfig.collisionSystem()) << " not supported for TOF event time computation"; + break; } - } else { - LOG(warning) << "Calibration not updated on " << tracks.size() << " tracks !!"; } LOG(debug) << "Running on " << CollisionSystemType::getCollisionSystemName(mTOFCalibConfig.collisionSystem()) << " mComputeEvTimeWithTOF " << mComputeEvTimeWithTOF.value << " mComputeEvTimeWithFT0 " << mComputeEvTimeWithFT0.value; @@ -1107,7 +1095,7 @@ struct tofPidMerge { using ResponseImplementation = o2::pid::tof::ExpTimes; void processRun3(Run3TrksWtofWevTime const& tracks, Run3Cols const&, - aod::BCsWithTimestamps const&) + aod::BCsWithTimestamps const& bcs) { constexpr auto responseEl = ResponseImplementation(); constexpr auto responseMu = ResponseImplementation(); @@ -1119,17 +1107,7 @@ struct tofPidMerge { constexpr auto responseHe = ResponseImplementation(); constexpr auto responseAl = ResponseImplementation(); - for (auto const& track : tracks) { // Loop on all tracks - if (!track.has_collision()) { // Skipping tracks without collisions - continue; - } - const auto& coll = track.collision(); - if (!coll.has_bc()) { - continue; - } - mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, coll.bc_as()); // Update the calibration parameters - break; - } + mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, bcs.iteratorAt(0)); // Update the calibration parameters for (auto const& pidId : mEnabledParticles) { reserveTable(pidId, tracks.size(), false); @@ -1279,7 +1257,7 @@ struct tofPidMerge { using ResponseImplementationRun2 = o2::pid::tof::ExpTimes; void processRun2(Run2TrksWtofWevTime const& tracks, Run3Cols const&, - aod::BCsWithTimestamps const&) + aod::BCsWithTimestamps const& bcs) { constexpr auto responseEl = ResponseImplementationRun2(); constexpr auto responseMu = ResponseImplementationRun2(); @@ -1291,17 +1269,7 @@ struct tofPidMerge { constexpr auto responseHe = ResponseImplementationRun2(); constexpr auto responseAl = ResponseImplementationRun2(); - for (auto const& track : tracks) { // Loop on all tracks - if (!track.has_collision()) { // Skipping tracks without collisions - continue; - } - const auto& coll = track.collision(); - if (!coll.has_bc()) { - continue; - } - mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, coll.bc_as()); // Update the calibration parameters - break; - } + mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, bcs.iteratorAt(0)); // Update the calibration parameters for (auto const& pidId : mEnabledParticles) { reserveTable(pidId, tracks.size(), false); @@ -1492,7 +1460,7 @@ struct tofPidBeta { void process(aod::BCs const&) {} - o2::pid::tof::Beta responseBetaRun2; + o2::pid::tof::Beta responseBetaRun2; void processRun2(Run2TrksWtofWevTime const& tracks) { if (!enableTableBeta && !enableTableMass) { @@ -1507,16 +1475,16 @@ struct tofPidBeta { } if (enableTableMass) { if (enableTOFParams) { - tablePIDTOFMass(o2::pid::tof::TOFMass::GetTOFMass(trk.tofExpMom() / (1.f + trk.sign() * mRespParamsV3.getMomentumChargeShift(trk.eta())), beta)); + tablePIDTOFMass(o2::pid::tof::TOFMass::GetTOFMass(trk.tofExpMom() / (1.f + trk.sign() * mRespParamsV3.getMomentumChargeShift(trk.eta())), beta)); } else { - tablePIDTOFMass(o2::pid::tof::TOFMass::GetTOFMass(trk, beta)); + tablePIDTOFMass(o2::pid::tof::TOFMass::GetTOFMass(trk, beta)); } } } } PROCESS_SWITCH(tofPidBeta, processRun2, "Process Run3 data i.e. input is TrackIU. If false, taken from metadata automatically", true); - o2::pid::tof::Beta responseBeta; + o2::pid::tof::Beta responseBeta; void processRun3(Run3TrksWtofWevTime const& tracks) { if (!enableTableBeta && !enableTableMass) { @@ -1532,9 +1500,9 @@ struct tofPidBeta { } if (enableTableMass) { if (enableTOFParams) { - tablePIDTOFMass(o2::pid::tof::TOFMass::GetTOFMass(trk.tofExpMom() / (1.f + trk.sign() * mRespParamsV3.getMomentumChargeShift(trk.eta())), beta)); + tablePIDTOFMass(o2::pid::tof::TOFMass::GetTOFMass(trk.tofExpMom() / (1.f + trk.sign() * mRespParamsV3.getMomentumChargeShift(trk.eta())), beta)); } else { - tablePIDTOFMass(o2::pid::tof::TOFMass::GetTOFMass(trk, beta)); + tablePIDTOFMass(o2::pid::tof::TOFMass::GetTOFMass(trk, beta)); } } } diff --git a/Common/TableProducer/PID/pidTOFbeta.cxx b/Common/TableProducer/PID/pidTOFbeta.cxx index dc4888bce55..d76d631bc4d 100644 --- a/Common/TableProducer/PID/pidTOFbeta.cxx +++ b/Common/TableProducer/PID/pidTOFbeta.cxx @@ -124,7 +124,7 @@ struct tofPidBeta { } using Trks = soa::Join; - o2::pid::tof::Beta responseBeta; + o2::pid::tof::Beta responseBeta; template using ResponseImplementation = o2::pid::tof::ExpTimes; void process(Trks const& tracks) @@ -142,16 +142,13 @@ struct tofPidBeta { } if (enableTableMass) { if (enableTOFParams) { - tablePIDTOFMass(o2::pid::tof::TOFMass::GetTOFMass(trk.tofExpMom() / (1.f + trk.sign() * mRespParamsV2.getShift(trk.eta())), beta)); + tablePIDTOFMass(o2::pid::tof::TOFMass::GetTOFMass(trk.tofExpMom() / (1.f + trk.sign() * mRespParamsV2.getShift(trk.eta())), beta)); } else { - tablePIDTOFMass(o2::pid::tof::TOFMass::GetTOFMass(trk, beta)); + tablePIDTOFMass(o2::pid::tof::TOFMass::GetTOFMass(trk, beta)); } } } } }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx index ef23cdaff2d..204bff837fb 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx @@ -335,15 +335,15 @@ struct tofPidCollisionTimeQa { histos.fill(HIST("trackSelection"), 4.5f); // Recompute quantities with event times - const float& betaTOF = trk.evTimeTOFMult() > 1 ? o2::pid::tof::Beta::GetBeta(trk, trk.evTimeTOF()) : 999.f; - const float& betaT0A = collision.t0ACorrectedValid() ? o2::pid::tof::Beta::GetBeta(trk, collision.t0ACorrected() * 1000.f) : 999.f; - const float& betaT0C = collision.t0CCorrectedValid() ? o2::pid::tof::Beta::GetBeta(trk, collision.t0CCorrected() * 1000.f) : 999.f; - const float& betaT0AC = collision.t0ACValid() ? o2::pid::tof::Beta::GetBeta(trk, collision.t0AC() * 1000.f) : 999.f; - - const float& massTOF = trk.evTimeTOFMult() > 1 ? o2::pid::tof::TOFMass::GetTOFMass(trk, betaTOF) : 999.f; - const float& massT0A = collision.t0ACorrectedValid() ? o2::pid::tof::TOFMass::GetTOFMass(trk, betaT0A) : 999.f; - const float& massT0C = collision.t0CCorrectedValid() ? o2::pid::tof::TOFMass::GetTOFMass(trk, betaT0C) : 999.f; - const float& massT0AC = collision.t0ACValid() ? o2::pid::tof::TOFMass::GetTOFMass(trk, betaT0AC) : 999.f; + const float& betaTOF = trk.evTimeTOFMult() > 1 ? o2::pid::tof::Beta::GetBeta(trk, trk.evTimeTOF()) : 999.f; + const float& betaT0A = collision.t0ACorrectedValid() ? o2::pid::tof::Beta::GetBeta(trk, collision.t0ACorrected() * 1000.f) : 999.f; + const float& betaT0C = collision.t0CCorrectedValid() ? o2::pid::tof::Beta::GetBeta(trk, collision.t0CCorrected() * 1000.f) : 999.f; + const float& betaT0AC = collision.t0ACValid() ? o2::pid::tof::Beta::GetBeta(trk, collision.t0AC() * 1000.f) : 999.f; + + const float& massTOF = trk.evTimeTOFMult() > 1 ? o2::pid::tof::TOFMass::GetTOFMass(trk, betaTOF) : 999.f; + const float& massT0A = collision.t0ACorrectedValid() ? o2::pid::tof::TOFMass::GetTOFMass(trk, betaT0A) : 999.f; + const float& massT0C = collision.t0CCorrectedValid() ? o2::pid::tof::TOFMass::GetTOFMass(trk, betaT0C) : 999.f; + const float& massT0AC = collision.t0ACValid() ? o2::pid::tof::TOFMass::GetTOFMass(trk, betaT0AC) : 999.f; const float& deltaPi = trk.tofSignal() - trk.tofEvTime() - trk.tofExpTimePi(); diff --git a/PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx b/PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx index ca382c8d2be..237b4538a2d 100644 --- a/PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx +++ b/PWGLF/TableProducer/Nuspex/LFTreeCreatorClusterStudies.cxx @@ -265,8 +265,6 @@ struct LfTreeCreatorClusterStudies { std::vector m_v0TrackParCovs; o2::vertexing::DCAFitterN<2> m_fitter; - o2::pid::tof::Beta m_responseBeta; - o2::pid::tof::Beta m_responseBetaMc; o2::aod::ITSResponse m_responseITS; template @@ -450,15 +448,9 @@ struct LfTreeCreatorClusterStudies { template float computeTOFmassDe(const T& candidate) { - if constexpr (isMC) { - float beta = m_responseBetaMc.GetBeta(candidate); - beta = std::min(1.f - 1.e-6f, std::max(1.e-4f, beta)); /// sometimes beta > 1 or < 0, to be checked - return candidate.tpcInnerParam() * 2.f * std::sqrt(1.f / (beta * beta) - 1.f); - } else { - float beta = m_responseBeta.GetBeta(candidate); - beta = std::min(1.f - 1.e-6f, std::max(1.e-4f, beta)); /// sometimes beta > 1 or < 0, to be checked - return candidate.tpcInnerParam() * 2.f * std::sqrt(1.f / (beta * beta) - 1.f); - } + float beta = o2::pid::tof::Beta::GetBeta(candidate); + beta = std::min(1.f - 1.e-6f, std::max(1.e-4f, beta)); /// sometimes beta > 1 or < 0, to be checked + return candidate.tpcInnerParam() * 2.f * std::sqrt(1.f / (beta * beta) - 1.f); } // ========================================================================================================= @@ -486,20 +478,11 @@ struct LfTreeCreatorClusterStudies { template float computeTOFmassHe3(const T& candidate) { - if constexpr (isMC) { - float beta = m_responseBetaMc.GetBeta(candidate); - beta = std::min(1.f - 1.e-6f, std::max(1.e-4f, beta)); /// sometimes beta > 1 or < 0, to be checked - bool heliumPID = candidate.pidForTracking() == o2::track::PID::Helium3 || candidate.pidForTracking() == o2::track::PID::Alpha; - float correctedTPCinnerParamHe3 = (heliumPID && he3setting_compensatePIDinTracking) ? candidate.tpcInnerParam() / 2.f : candidate.tpcInnerParam(); - return correctedTPCinnerParamHe3 * 2.f * std::sqrt(1.f / (beta * beta) - 1.f); - } else { - float beta = m_responseBeta.GetBeta(candidate); - beta = std::min(1.f - 1.e-6f, std::max(1.e-4f, beta)); /// sometimes beta > 1 or < 0, to be checked - bool heliumPID = candidate.pidForTracking() == o2::track::PID::Helium3 || candidate.pidForTracking() == o2::track::PID::Alpha; - float correctedTPCinnerParamHe3 = (heliumPID && he3setting_compensatePIDinTracking) ? candidate.tpcInnerParam() / 2.f : candidate.tpcInnerParam(); - return correctedTPCinnerParamHe3 * 2.f * std::sqrt(1.f / (beta * beta) - 1.f); - } - return -999.f; + float beta = o2::pid::tof::Beta::GetBeta(candidate); + beta = std::min(1.f - 1.e-6f, std::max(1.e-4f, beta)); /// sometimes beta > 1 or < 0, to be checked + bool heliumPID = candidate.pidForTracking() == o2::track::PID::Helium3 || candidate.pidForTracking() == o2::track::PID::Alpha; + float correctedTPCinnerParamHe3 = (heliumPID && he3setting_compensatePIDinTracking) ? candidate.tpcInnerParam() / 2.f : candidate.tpcInnerParam(); + return correctedTPCinnerParamHe3 * 2.f * std::sqrt(1.f / (beta * beta) - 1.f); } // ========================================================================================================= diff --git a/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx b/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx index f83a2d990f1..c42e5eee06c 100644 --- a/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx +++ b/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx @@ -592,16 +592,15 @@ struct he3hadronfemto { he3Hadcand.trackIDHe3 = trackHe3.globalIndex(); he3Hadcand.trackIDHad = trackHad.globalIndex(); - o2::pid::tof::Beta responseBeta; if (trackHe3.hasTOF()) { - float beta = responseBeta.GetBeta(trackHe3); + float beta = o2::pid::tof::Beta::GetBeta(trackHe3); beta = std::min(1.f - 1.e-6f, std::max(1.e-4f, beta)); /// sometimes beta > 1 or < 0, to be checked bool heliumPID = trackHe3.pidForTracking() == o2::track::PID::Helium3 || trackHe3.pidForTracking() == o2::track::PID::Alpha; float correctedTPCinnerParamHe3 = (heliumPID && setting_compensatePIDinTracking) ? trackHe3.tpcInnerParam() / 2.f : trackHe3.tpcInnerParam(); he3Hadcand.massTOFHe3 = correctedTPCinnerParamHe3 * 2.f * std::sqrt(1.f / (beta * beta) - 1.f); } if (trackHad.hasTOF()) { - float beta = responseBeta.GetBeta(trackHad); + float beta = o2::pid::tof::Beta::GetBeta(trackHad); beta = std::min(1.f - 1.e-6f, std::max(1.e-4f, beta)); /// sometimes beta > 1 or < 0, to be checked he3Hadcand.massTOFHad = trackHad.tpcInnerParam() * std::sqrt(1.f / (beta * beta) - 1.f); } diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index 6acf6578717..25f883bf1e3 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -155,8 +155,6 @@ struct hyperRecoTask { o2::vertexing::DCAFitterN<2> fitter; svPoolCreator svCreator{heDauPdg, 211}; - o2::pid::tof::Beta responseBeta; - // daughter masses float he3Mass = o2::constants::physics::MassHelium3; float he4Mass = o2::constants::physics::MassAlpha; @@ -506,7 +504,7 @@ struct hyperRecoTask { hypCand.collisionID = collision.globalIndex(); if (heTrack.hasTOF()) { - float beta = responseBeta.GetBeta(heTrack); + float beta = o2::pid::tof::Beta::GetBeta(heTrack); beta = std::min(1.f - 1.e-6f, std::max(1.e-4f, beta)); /// sometimes beta > 1 or < 0, to be checked hypCand.massTOFHe3 = hypCand.momHe3TPC * 2.f * std::sqrt(1.f / (beta * beta) - 1.f); } diff --git a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx index 503dc2fb0b3..b0ae705f374 100644 --- a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx @@ -495,7 +495,6 @@ struct nucleiSpectra { template void fillDataInfo(Tcoll const& collision, Ttrks const& tracks) { - o2::pid::tof::Beta responseBeta; auto bc = collision.template bc_as(); initCCDB(bc); if (cfgSkimmedProcessing) { @@ -585,7 +584,7 @@ struct nucleiSpectra { gpu::gpustd::array dcaInfo; o2::base::Propagator::Instance()->propagateToDCA(collVtx, mTrackParCov, mBz, 2.f, static_cast(cfgMaterialCorrection.value), &dcaInfo); - float beta{responseBeta.GetBeta(track)}; + float beta{o2::pid::tof::Beta::GetBeta(track)}; spectra.fill(HIST("hTpcSignalDataSelected"), correctedTpcInnerParam * track.sign(), track.tpcSignal()); spectra.fill(HIST("hTofSignalData"), correctedTpcInnerParam, beta); beta = std::min(1.f - 1.e-6f, std::max(1.e-4f, beta)); /// sometimes beta > 1 or < 0, to be checked From 946288a89cff8936dc3f8332f296f942a0d04c87 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:02:49 +0100 Subject: [PATCH 173/459] [PWGDQ] Enable running over derived data from skimmed datasets (#8705) --- PWGDQ/Tasks/CMakeLists.txt | 2 +- PWGDQ/Tasks/quarkoniaToHyperons.cxx | 102 ++++++++++++++++++++++++---- 2 files changed, 89 insertions(+), 15 deletions(-) diff --git a/PWGDQ/Tasks/CMakeLists.txt b/PWGDQ/Tasks/CMakeLists.txt index 3d7f53faeba..f64f67ee394 100644 --- a/PWGDQ/Tasks/CMakeLists.txt +++ b/PWGDQ/Tasks/CMakeLists.txt @@ -111,5 +111,5 @@ o2physics_add_dpl_workflow(task-fwd-track-pid o2physics_add_dpl_workflow(quarkonia-to-hyperons SOURCES quarkoniaToHyperons.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGDQ/Tasks/quarkoniaToHyperons.cxx b/PWGDQ/Tasks/quarkoniaToHyperons.cxx index 62ba3f9c9d8..f2fc85498a3 100644 --- a/PWGDQ/Tasks/quarkoniaToHyperons.cxx +++ b/PWGDQ/Tasks/quarkoniaToHyperons.cxx @@ -40,6 +40,7 @@ #include "Framework/ASoAHelpers.h" #include "Framework/O2DatabasePDGPlugin.h" #include "ReconstructionDataFormats/Track.h" +#include "CCDB/BasicCCDBManager.h" #include "CommonConstants/PhysicsConstants.h" #include "Common/Core/trackUtilities.h" #include "PWGLF/DataModel/LFStrangenessTables.h" @@ -55,6 +56,9 @@ #include "Tools/ML/MlResponse.h" #include "Tools/ML/model.h" +#include "EventFiltering/Zorro.h" +#include "EventFiltering/ZorroSummary.h" + // constants const float ctauXiPDG = 4.91; // from PDG const float ctauOmegaPDG = 2.461; // from PDG @@ -83,6 +87,11 @@ struct quarkoniaToHyperons { // master analysis switches Configurable isPP{"isPP", true, "If running on pp collision, switch it on true"}; + // for running over skimmed dataset + Configurable cfgSkimmedProcessing{"cfgSkimmedProcessing", false, "If running over skimmed data, switch it on true"}; + Configurable cfgSkimmedTrigger{"cfgSkimmedTrigger", "fDoubleXi,fTripleXi,fQuadrupleXi", "(std::string) Comma separated list of triggers of interest"}; + + // switch on/off event selections Configurable requireSel8{"requireSel8", true, "require sel8 event selection"}; Configurable rejectITSROFBorder{"rejectITSROFBorder", true, "reject events at ITS ROF border"}; Configurable rejectTFBorder{"rejectTFBorder", true, "reject events at TF border"}; @@ -98,6 +107,8 @@ struct quarkoniaToHyperons { Configurable buildXiXiBarPairs{"buildXiXiBarPairs", false, "Build Xi antiXi from charmonia decay"}; Configurable buildOmOmBarPairs{"buildOmOmBarPairs", false, "Build Omega antiOmega from charmonia decay"}; + Configurable buildSameSignPairs{"buildSameSignPairs", false, "If true: build same-sign pairs, otherwise consider only opposite-sign pairs"}; + // fast check on occupancy Configurable minOccupancy{"minOccupancy", -1, "minimum occupancy from neighbouring collisions"}; Configurable maxOccupancy{"maxOccupancy", -1, "maximum occupancy from neighbouring collisions"}; @@ -255,10 +266,14 @@ struct quarkoniaToHyperons { Configurable mVtxPath{"ccdbConfigurations.mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"}; } ccdbConfigurations; + Service ccdb; o2::ccdb::CcdbApi ccdbApi; int mRunNumber; std::map metadata; + Zorro zorro; + OutputObj zorroSummary{"zorroSummary"}; + static constexpr float defaultLifetimeCuts[1][2] = {{30., 20.}}; Configurable> lifetimecut{"lifetimecut", {defaultLifetimeCuts[0], 2, {"lifetimecutLambda", "lifetimecutK0S"}}, "lifetimecut"}; @@ -654,6 +669,11 @@ struct quarkoniaToHyperons { histos.add("OmOmBar/h3dInvMassTruePsi2S", "h3dInvMassTruePsi2S", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); } } + + if (cfgSkimmedProcessing) { + zorroSummary.setObject(zorro.getZorroSummary()); + } + // inspect histogram sizes, please histos.print(); } @@ -666,6 +686,15 @@ struct quarkoniaToHyperons { } mRunNumber = collision.runNumber(); + if (cfgSkimmedProcessing) { + ccdb->setURL(ccdbConfigurations.ccdburl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); + + zorro.initCCDB(ccdb.service, collision.runNumber(), collision.timestamp(), cfgSkimmedTrigger.value); + zorro.populateHistRegistry(histos, collision.runNumber()); + } // machine learning initialization if requested if (mlConfigurations.calculateK0ShortScores || @@ -1272,7 +1301,7 @@ struct quarkoniaToHyperons { } template - void analyseV0Candidate(TV0 v0, float pt, float /*centrality*/, uint64_t selMap, std::vector& selK0ShortIndices, std::vector& selLambdaIndices, std::vector& selAntiLambdaIndices, int v0TableOffset) + void analyseV0Candidate(TV0 v0, float pt, uint64_t selMap, std::vector& selK0ShortIndices, std::vector& selLambdaIndices, std::vector& selAntiLambdaIndices, int v0TableOffset) // precalculate this information so that a check is one mask operation, not many { bool passK0ShortSelections = false; @@ -1349,7 +1378,7 @@ struct quarkoniaToHyperons { float hyperonDecayLength = std::sqrt(std::pow(hyperon.x() - collision.posX(), 2) + std::pow(hyperon.y() - collision.posY(), 2) + std::pow(hyperon.z() - collision.posZ(), 2)) * o2::constants::physics::MassLambda0 / (hyperon.p() + 1E-10); float antiHyperonDecayLength = std::sqrt(std::pow(antiHyperon.x() - collision.posX(), 2) + std::pow(antiHyperon.y() - collision.posY(), 2) + std::pow(antiHyperon.z() - collision.posZ(), 2)) * o2::constants::physics::MassLambda0 / (antiHyperon.p() + 1E-10); - // Candidates after Xi selections + // Candidates after Lambda selections histos.fill(HIST("LaLaBar/Lambda/hPosDCAToPV"), hyperon.dcapostopv()); histos.fill(HIST("LaLaBar/Lambda/hNegDCAToPV"), hyperon.dcapostopv()); histos.fill(HIST("LaLaBar/Lambda/hDCAV0Daughters"), hyperon.dcaV0daughters()); @@ -1363,7 +1392,7 @@ struct quarkoniaToHyperons { histos.fill(HIST("LaLaBar/Lambda/hNegTPCNsigma"), negTrackExtraHyperon.tpcNSigmaPi()); histos.fill(HIST("LaLaBar/Lambda/h2dPositiveITSvsTPCpts"), posTrackExtraHyperon.tpcCrossedRows(), posTrackExtraHyperon.itsNCls()); histos.fill(HIST("LaLaBar/Lambda/h2dNegativeITSvsTPCpts"), negTrackExtraHyperon.tpcCrossedRows(), negTrackExtraHyperon.itsNCls()); - // Candidates after AntiXi selections + // Candidates after AntiLambda selections histos.fill(HIST("LaLaBar/AntiLambda/hPosDCAToPV"), antiHyperon.dcapostopv()); histos.fill(HIST("LaLaBar/AntiLambda/hNegDCAToPV"), antiHyperon.dcapostopv()); histos.fill(HIST("LaLaBar/AntiLambda/hDCAV0Daughters"), antiHyperon.dcaV0daughters()); @@ -1745,7 +1774,8 @@ struct quarkoniaToHyperons { void processRealData(soa::Join::iterator const& collision, v0Candidates const& fullV0s, cascadeCandidates const& fullCascades, dauTracks const&) { // Fire up CCDB - if ((mlConfigurations.useK0ShortScores && mlConfigurations.calculateK0ShortScores) || + if (cfgSkimmedProcessing || + (mlConfigurations.useK0ShortScores && mlConfigurations.calculateK0ShortScores) || (mlConfigurations.useLambdaScores && mlConfigurations.calculateLambdaScores) || (mlConfigurations.useAntiLambdaScores && mlConfigurations.calculateAntiLambdaScores)) { initCCDB(collision); @@ -1755,6 +1785,10 @@ struct quarkoniaToHyperons { return; } + if (cfgSkimmedProcessing) { + zorro.isSelected(collision.globalBC()); /// Just let Zorro do the accounting + } + float centrality = -1; int selGapSide = -1; // only useful in case one wants to use this task in Pb-Pb UPC fillEventHistograms(collision, centrality, selGapSide); @@ -1779,7 +1813,7 @@ struct quarkoniaToHyperons { selMap = selMap | (uint64_t(1) << selConsiderK0Short) | (uint64_t(1) << selConsiderLambda) | (uint64_t(1) << selConsiderAntiLambda); selMap = selMap | (uint64_t(1) << selPhysPrimK0Short) | (uint64_t(1) << selPhysPrimLambda) | (uint64_t(1) << selPhysPrimAntiLambda); - analyseV0Candidate(v0, v0.pt(), centrality, selMap, selK0ShortIndices, selLambdaIndices, selAntiLambdaIndices, fullV0s.offset()); + analyseV0Candidate(v0, v0.pt(), selMap, selK0ShortIndices, selLambdaIndices, selAntiLambdaIndices, fullV0s.offset()); } // end v0 loop // count the number of K0s, Lambda and AntiLambdas passsing the selections @@ -1794,9 +1828,15 @@ struct quarkoniaToHyperons { // Check the number of Lambdas and antiLambdas // needs at least 1 of each - if (nLambdas >= 1 && nAntiLambdas >= 1) { + if (!buildSameSignPairs && nLambdas >= 1 && nAntiLambdas >= 1) { // consider Lambda antiLambda pairs buildHyperonAntiHyperonPairs(collision, fullV0s, selLambdaIndices, selAntiLambdaIndices, centrality, selGapSide, 0); } + if (buildSameSignPairs && nLambdas > 1) { // consider Lambda Lambda pairs + buildHyperonAntiHyperonPairs(collision, fullV0s, selLambdaIndices, selLambdaIndices, centrality, selGapSide, 0); + } + if (buildSameSignPairs && nAntiLambdas > 1) { // consider antiLambda antiLambda pairs + buildHyperonAntiHyperonPairs(collision, fullV0s, selAntiLambdaIndices, selAntiLambdaIndices, centrality, selGapSide, 0); + } } if (buildXiXiBarPairs || buildOmOmBarPairs) { // Look at Cascades @@ -1839,9 +1879,15 @@ struct quarkoniaToHyperons { // Check the number of Lambdas and antiLambdas // needs at least 1 of each - if (nXis >= 1 && nAntiXis >= 1) { + if (!buildSameSignPairs && nXis >= 1 && nAntiXis >= 1) { buildHyperonAntiHyperonPairs(collision, fullCascades, selXiIndices, selAntiXiIndices, centrality, selGapSide, 1); } + if (buildSameSignPairs && nXis > 1) { + buildHyperonAntiHyperonPairs(collision, fullCascades, selXiIndices, selXiIndices, centrality, selGapSide, 1); + } + if (buildSameSignPairs && nAntiXis > 1) { + buildHyperonAntiHyperonPairs(collision, fullCascades, selAntiXiIndices, selAntiXiIndices, centrality, selGapSide, 1); + } } if (buildOmOmBarPairs) { histos.fill(HIST("OmOmBar/h2dNbrOfOmegaVsCentrality"), centrality, nOmegas); @@ -1849,9 +1895,15 @@ struct quarkoniaToHyperons { // Check the number of Lambdas and antiLambdas // needs at least 1 of each - if (nOmegas >= 1 && nAntiOmegas >= 1) { + if (!buildSameSignPairs && nOmegas >= 1 && nAntiOmegas >= 1) { buildHyperonAntiHyperonPairs(collision, fullCascades, selOmIndices, selAntiOmIndices, centrality, selGapSide, 2); } + if (buildSameSignPairs && nOmegas > 1) { + buildHyperonAntiHyperonPairs(collision, fullCascades, selOmIndices, selOmIndices, centrality, selGapSide, 2); + } + if (buildSameSignPairs && nAntiOmegas > 1) { + buildHyperonAntiHyperonPairs(collision, fullCascades, selAntiOmIndices, selAntiOmIndices, centrality, selGapSide, 2); + } } } } @@ -1861,7 +1913,8 @@ struct quarkoniaToHyperons { void processMonteCarlo(soa::Join::iterator const& collision, v0MCCandidates const& fullV0s, cascadeMCCandidates const& fullCascades, dauTracks const&, aod::MotherMCParts const&, soa::Join const& /*mccollisions*/, soa::Join const&, soa::Join const&) { // Fire up CCDB - if ((mlConfigurations.useK0ShortScores && mlConfigurations.calculateK0ShortScores) || + if (cfgSkimmedProcessing || + (mlConfigurations.useK0ShortScores && mlConfigurations.calculateK0ShortScores) || (mlConfigurations.useLambdaScores && mlConfigurations.calculateLambdaScores) || (mlConfigurations.useAntiLambdaScores && mlConfigurations.calculateAntiLambdaScores)) { initCCDB(collision); @@ -1871,6 +1924,10 @@ struct quarkoniaToHyperons { return; } + if (cfgSkimmedProcessing) { + zorro.isSelected(collision.globalBC()); /// Just let Zorro do the accounting + } + float centrality = -1; int selGapSide = -1; // only useful in case one wants to use this task in Pb-Pb UPC fillEventHistograms(collision, centrality, selGapSide); @@ -1906,7 +1963,7 @@ struct quarkoniaToHyperons { selMap = selMap | (uint64_t(1) << selPhysPrimK0Short) | (uint64_t(1) << selPhysPrimLambda) | (uint64_t(1) << selPhysPrimAntiLambda); } - analyseV0Candidate(v0, ptmc, centrality, selMap, selK0ShortIndices, selLambdaIndices, selAntiLambdaIndices, fullV0s.offset()); + analyseV0Candidate(v0, ptmc, selMap, selK0ShortIndices, selLambdaIndices, selAntiLambdaIndices, fullV0s.offset()); } // end v0 loop /// count the number of K0s, Lambda and AntiLambdas passsing the selections @@ -1919,9 +1976,15 @@ struct quarkoniaToHyperons { histos.fill(HIST("LaLaBar/h2dNbrOfLambdaVsCentrality"), centrality, nLambdas); histos.fill(HIST("LaLaBar/h2dNbrOfAntiLambdaVsCentrality"), centrality, nAntiLambdas); - if (nLambdas >= 1 && nAntiLambdas >= 1) { + if (!buildSameSignPairs && nLambdas >= 1 && nAntiLambdas >= 1) { // consider Lambda antiLambda pairs buildHyperonAntiHyperonPairs(collision, fullV0s, selLambdaIndices, selAntiLambdaIndices, centrality, selGapSide, 0); } + if (buildSameSignPairs && nLambdas > 1) { // consider Lambda Lambda pairs + buildHyperonAntiHyperonPairs(collision, fullV0s, selLambdaIndices, selLambdaIndices, centrality, selGapSide, 0); + } + if (buildSameSignPairs && nAntiLambdas > 1) { // consider antiLambda antiLambda pairs + buildHyperonAntiHyperonPairs(collision, fullV0s, selAntiLambdaIndices, selAntiLambdaIndices, centrality, selGapSide, 0); + } } if (buildXiXiBarPairs || buildOmOmBarPairs) { // Look at Cascades @@ -1940,7 +2003,6 @@ struct quarkoniaToHyperons { auto cascadeMC = cascade.cascMCCore_as>(); - // float ptmc = RecoDecay::sqrtSumOfSquares(cascadeMC.pxMC(), cascadeMC.pyMC()); float ymc = 1e-3; if (TMath::Abs(cascadeMC.pdgCode()) == 3312) ymc = RecoDecay::y(std::array{cascadeMC.pxMC(), cascadeMC.pyMC(), cascadeMC.pzMC()}, o2::constants::physics::MassXiMinus); @@ -1976,9 +2038,15 @@ struct quarkoniaToHyperons { // Check the number of Lambdas and antiLambdas // needs at least 1 of each - if (nXis >= 1 && nAntiXis >= 1) { + if (!buildSameSignPairs && nXis >= 1 && nAntiXis >= 1) { buildHyperonAntiHyperonPairs(collision, fullCascades, selXiIndices, selAntiXiIndices, centrality, selGapSide, 1); } + if (buildSameSignPairs && nXis > 1) { + buildHyperonAntiHyperonPairs(collision, fullCascades, selXiIndices, selXiIndices, centrality, selGapSide, 1); + } + if (buildSameSignPairs && nAntiXis > 1) { + buildHyperonAntiHyperonPairs(collision, fullCascades, selAntiXiIndices, selAntiXiIndices, centrality, selGapSide, 1); + } } if (buildOmOmBarPairs) { histos.fill(HIST("OmOmBar/h2dNbrOfOmegaVsCentrality"), centrality, nOmegas); @@ -1986,9 +2054,15 @@ struct quarkoniaToHyperons { // Check the number of Lambdas and antiLambdas // needs at least 1 of each - if (nOmegas >= 1 && nAntiOmegas >= 1) { + if (!buildSameSignPairs && nOmegas >= 1 && nAntiOmegas >= 1) { buildHyperonAntiHyperonPairs(collision, fullCascades, selOmIndices, selAntiOmIndices, centrality, selGapSide, 2); } + if (buildSameSignPairs && nOmegas > 1) { + buildHyperonAntiHyperonPairs(collision, fullCascades, selOmIndices, selOmIndices, centrality, selGapSide, 2); + } + if (buildSameSignPairs && nAntiOmegas > 1) { + buildHyperonAntiHyperonPairs(collision, fullCascades, selAntiOmIndices, selAntiOmIndices, centrality, selGapSide, 2); + } } } } From c83948a18572949e8f0911a926a561fe6f814d51 Mon Sep 17 00:00:00 2001 From: czhang Date: Fri, 29 Nov 2024 15:03:22 +0100 Subject: [PATCH 174/459] [PWGDQ] Change build option of profiles used for flow analysis in Event-Mixing/Same-Event (#8699) --- PWGDQ/Core/HistogramsLibrary.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index a521f27fe33..2155f9caade 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -1003,8 +1003,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "U2Q2_CentFT0C_ev2", "mass vs. centrality vs. U2Q2_event2", false, 125, 0.0, 5.0, VarManager::kMass, 9, 0.0, 90.0, VarManager::kCentFT0C, 100, -10.0, 10.0, VarManager::kU2Q2Ev2); } if (subGroupStr.Contains("metest")) { - hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_V2ME_SP", "", true, 250, 0.0, 5.0, VarManager::kMass, 60, 0.0, 30.0, VarManager::kPt, 90, 0.0, 90.0, VarManager::kCentFT0C, "", "", "", VarManager::kV2ME_SP, VarManager::kWV2ME_SP); - hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_V2ME_EP", "", true, 250, 0.0, 5.0, VarManager::kMass, 60, 0.0, 30.0, VarManager::kPt, 90, 0.0, 90.0, VarManager::kCentFT0C, "", "", "", VarManager::kV2ME_EP, VarManager::kWV2ME_EP); + hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_V2ME_SP", "Mass_Pt_CentFT0C_V2ME_SP", true, 250, 0.0, 5.0, VarManager::kMass, 60, 0.0, 30.0, VarManager::kPt, 90, 0.0, 90.0, VarManager::kCentFT0C, "", "", "", VarManager::kV2ME_SP, VarManager::kWV2ME_SP); + hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_V2ME_EP", "Mass_Pt_CentFT0C_V2ME_EP", true, 250, 0.0, 5.0, VarManager::kMass, 60, 0.0, 30.0, VarManager::kPt, 90, 0.0, 90.0, VarManager::kCentFT0C, "", "", "", VarManager::kV2ME_EP, VarManager::kWV2ME_EP); } if (subGroupStr.Contains("dimuon-polarization-he")) { int varspTHE[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCosThetaHE, VarManager::kPhiHE}; @@ -1155,8 +1155,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Mass_Pt_centrFT0C_V3", "", 6, varV3, bins, minBins, maxBins, 0, -1, kTRUE); } if (subGroupStr.Contains("flow-ccdb")) { - hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_V2SPwR", "Mass_Pt_CentFT0C_V2SPwR, --s--", true, 250, 0.0, 5.0, VarManager::kMass, 60, 0.0, 30.0, VarManager::kPt, 90, 0.0, 90.0, VarManager::kCentFT0C, "", "", "", VarManager::kV2SP, VarManager::kWV2SP); - hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_V2EPwR", "Mass_Pt_CentFT0C_V2EPwR, --s--", true, 250, 0.0, 5.0, VarManager::kMass, 60, 0.0, 30.0, VarManager::kPt, 90, 0.0, 90.0, VarManager::kCentFT0C, "", "", "", VarManager::kV2EP, VarManager::kWV2EP); + hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_V2SPwR", "Mass_Pt_CentFT0C_V2SPwR", true, 250, 0.0, 5.0, VarManager::kMass, 60, 0.0, 30.0, VarManager::kPt, 90, 0.0, 90.0, VarManager::kCentFT0C, "", "", "", VarManager::kV2SP, VarManager::kWV2SP); + hm->AddHistogram(histClass, "Mass_Pt_CentFT0C_V2EPwR", "Mass_Pt_CentFT0C_V2EPwR", true, 250, 0.0, 5.0, VarManager::kMass, 60, 0.0, 30.0, VarManager::kPt, 90, 0.0, 90.0, VarManager::kCentFT0C, "", "", "", VarManager::kV2EP, VarManager::kWV2EP); } if (subGroupStr.Contains("cumulant")) { int var[4] = {VarManager::kMass, VarManager::kPt, VarManager::kRap, VarManager::kCentFT0C}; From e7c2da3e9aa523b48184e23255a7539747245bc2 Mon Sep 17 00:00:00 2001 From: Ida Storehaug <38440296+torkjellsdatter@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:06:06 +0100 Subject: [PATCH 175/459] [PWGDQ] [PWG-DQ-120] added mcDecision to B meson candidate table (#8737) Co-authored-by: Ida Torkjellsdatter Storehaug --- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 9c6608ceb17..b6ce89fdeec 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -79,6 +79,7 @@ DECLARE_SOA_COLUMN(TauxyBcandidate, tauxyBcandidate, float); DECLARE_SOA_COLUMN(TauzBcandidate, tauzBcandidate, float); DECLARE_SOA_COLUMN(CosPBcandidate, cosPBcandidate, float); DECLARE_SOA_COLUMN(Chi2Bcandidate, chi2Bcandidate, float); +DECLARE_SOA_COLUMN(McFlag, mcFlag, int8_t); } // namespace dqanalysisflags DECLARE_SOA_TABLE(EventCuts, "AOD", "DQANAEVCUTS", dqanalysisflags::IsEventSelected); //! joinable to ReducedEvents @@ -87,7 +88,7 @@ DECLARE_SOA_TABLE(BarrelAmbiguities, "AOD", "DQBARRELAMB", dqanalysisflags::Barr DECLARE_SOA_TABLE(MuonTrackCuts, "AOD", "DQANAMUONCUTS", dqanalysisflags::IsMuonSelected); //! joinable to ReducedMuonsAssoc DECLARE_SOA_TABLE(MuonAmbiguities, "AOD", "DQMUONAMB", dqanalysisflags::MuonAmbiguityInBunch, dqanalysisflags::MuonAmbiguityOutOfBunch); //! joinable to ReducedMuonTracks DECLARE_SOA_TABLE(Prefilter, "AOD", "DQPREFILTER", dqanalysisflags::IsBarrelSelectedPrefilter); //! joinable to ReducedTracksAssoc -DECLARE_SOA_TABLE(BmesonCandidates, "AOD", "DQBMESONS", dqanalysisflags::massBcandidate, dqanalysisflags::pTBcandidate, dqanalysisflags::LxyBcandidate, dqanalysisflags::LxyzBcandidate, dqanalysisflags::LzBcandidate, dqanalysisflags::TauxyBcandidate, dqanalysisflags::TauzBcandidate, dqanalysisflags::CosPBcandidate, dqanalysisflags::Chi2Bcandidate); +DECLARE_SOA_TABLE(BmesonCandidates, "AOD", "DQBMESONS", dqanalysisflags::massBcandidate, dqanalysisflags::pTBcandidate, dqanalysisflags::LxyBcandidate, dqanalysisflags::LxyzBcandidate, dqanalysisflags::LzBcandidate, dqanalysisflags::TauxyBcandidate, dqanalysisflags::TauzBcandidate, dqanalysisflags::CosPBcandidate, dqanalysisflags::Chi2Bcandidate, dqanalysisflags::McFlag); } // namespace o2::aod // Declarations of various short names @@ -2135,7 +2136,7 @@ struct AnalysisDileptonTrack { } } // table to be written out for ML analysis - BmesonsTable(fValuesHadron[VarManager::kPairMass], fValuesHadron[VarManager::kPairPt], fValuesHadron[VarManager::kVertexingLxy], fValuesHadron[VarManager::kVertexingLxyz], fValuesHadron[VarManager::kVertexingLz], fValuesHadron[VarManager::kVertexingTauxy], fValuesHadron[VarManager::kVertexingTauz], fValuesHadron[VarManager::kCosPointingAngle], fValuesHadron[VarManager::kVertexingChi2PCA]); + BmesonsTable(fValuesHadron[VarManager::kPairMass], fValuesHadron[VarManager::kPairPt], fValuesHadron[VarManager::kVertexingLxy], fValuesHadron[VarManager::kVertexingLxyz], fValuesHadron[VarManager::kVertexingLz], fValuesHadron[VarManager::kVertexingTauxy], fValuesHadron[VarManager::kVertexingTauz], fValuesHadron[VarManager::kCosPointingAngle], fValuesHadron[VarManager::kVertexingChi2PCA], mcDecision); } } // end loop over dileptons } From fa5772f1a04f530b617ce822e9356f4b542113d9 Mon Sep 17 00:00:00 2001 From: vfeuilla <71069003+vfeuilla@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:38:53 +0100 Subject: [PATCH 176/459] [PWGDQ] Add the list of cuts for DQ used by the CEFP task in the CutsLibrary (#8534) --- PWGDQ/Core/CutsLibrary.cxx | 36 +++++++----------- PWGDQ/Core/CutsLibrary.h | 76 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 22 deletions(-) diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index 8fc8f9fccd5..ae4d9bbb900 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -32,6 +32,8 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) // /////////////////////////////////////////////// // These are the Cuts used in the CEFP Task // // to select tracks in the event selection // + // // + // see CutsLubrary.h for the description // // /////////////////////////////////////////////// if (!nameStr.compare("Electron2022")) { cut->AddCut(GetAnalysisCut("jpsiStandardKine")); @@ -40,25 +42,15 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) return cut; } if (!nameStr.compare("Electron2023")) { - cut->AddCut(GetAnalysisCut("jpsiStandardKine4")); + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); - cut->AddCut(GetAnalysisCut("pidCut_lowP_Corr")); - - AnalysisCompositeCut* pidCut_highP = new AnalysisCompositeCut("pidCut_highP", "pidCut_highP", kFALSE); - pidCut_highP->AddCut(GetAnalysisCut("EleInclusion_highP_Corr")); - pidCut_highP->AddCut(GetAnalysisCut("PionExclusion_highP_Corr")); - cut->AddCut(pidCut_highP); + cut->AddCut(GetAnalysisCut("jpsi_TPCPID_debug5_noCorr")); return cut; } - if (!nameStr.compare("Electron2023_Tight")) { - cut->AddCut(GetAnalysisCut("jpsiStandardKine4")); - cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug")); - cut->AddCut(GetAnalysisCut("pidCut_lowP_Corr")); - - AnalysisCompositeCut* pidCut_highP = new AnalysisCompositeCut("pidCut_highP", "pidCut_highP", kFALSE); - pidCut_highP->AddCut(GetAnalysisCut("EleInclusion_highP2_Corr")); - pidCut_highP->AddCut(GetAnalysisCut("PionExclusion_highP_Corr")); - cut->AddCut(pidCut_highP); + if (!nameStr.compare("LowMassElectron2023")) { + cut->AddCut(GetAnalysisCut("lmeeStandardKine")); + cut->AddCut(GetAnalysisCut("LooseGlobalTrackRun3")); + cut->AddCut(GetAnalysisCut("lmee_pp_502TeV_TOFloose_pionrej")); return cut; } if (!nameStr.compare("MuonLow2022")) { @@ -66,17 +58,17 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) cut->AddCut(GetAnalysisCut("muonQualityCuts")); return cut; } - if (!nameStr.compare("MuonLow2023")) { - cut->AddCut(GetAnalysisCut("muonLowPt2")); - cut->AddCut(GetAnalysisCut("muonQualityCuts")); - cut->AddCut(GetAnalysisCut("MCHMID")); - return cut; - } if (!nameStr.compare("MuonHigh2022")) { cut->AddCut(GetAnalysisCut("muonHighPt2")); cut->AddCut(GetAnalysisCut("muonQualityCuts")); return cut; } + if (!nameStr.compare("MuonLow2023")) { + cut->AddCut(GetAnalysisCut("muonLowPt2")); + cut->AddCut(GetAnalysisCut("muonQualityCuts10SigmaPDCA")); + cut->AddCut(GetAnalysisCut("MCHMID")); + return cut; + } if (!nameStr.compare("MuonHigh2023")) { cut->AddCut(GetAnalysisCut("muonHighPt6")); cut->AddCut(GetAnalysisCut("muonQualityCuts")); diff --git a/PWGDQ/Core/CutsLibrary.h b/PWGDQ/Core/CutsLibrary.h index 59079166b29..1ce85510ab2 100644 --- a/PWGDQ/Core/CutsLibrary.h +++ b/PWGDQ/Core/CutsLibrary.h @@ -21,6 +21,82 @@ #include "PWGDQ/Core/AnalysisCompositeCut.h" #include "PWGDQ/Core/VarManager.h" +// /////////////////////////////////////////////// +// These are the Cuts used in the CEFP Task // +// to select tracks in the event selection // +// /////////////////////////////////////////////// +// +// Electron 2022 cuts : +// - Single e pT > 1.0 GeV/c +// - Single e eta = [-0.9 ; 0.9] +// - Is SPD Any : yes +// - TPC chi2 < 4.0 +// - TPC N Clusters = [70 ; 160] +// - n-sigma_e = [-4.0 ; 4.0] +// - n-sigma_pi > 2.5 +// - n-sigma_pr > 2.5 +// - PID post-calibration : Yes +// - Track-collision association : No +// For the dielectron Cut : pairNoCut +// mee > 0 GeV/c2 +// +// Electron 2023 & 2024 cuts : +// - Single e pT > 1.0 GeV/c +// - Single e eta = [-0.9 ; 0.9] +// - Is SPD Any : yes +// - TPC chi2 < 4.0 +// - TPC N Clusters = [70 ; 160] +// - n-sigma_e = [-4.0 ; 4.0] +// - n-sigma_pi > 2.5 +// - n-sigma_pr > 2.5 +// - PID post-calibration : No +// - Track-collision association : Yes +// For the dielectron Cut : pairMassLow5 +// mee > 1.8 GeV/c2 +// +// Low Mass electrons 2023 & 2024 cuts : +// - Single e pT > 0.4 GeV/c +// - Single e eta = [-0.8 ; 0.8] +// - Is SPD Any : yes +// - TPC chi2 < 4.0 +// - ITS chi2 < 6.0 +// - TPC N Clusters = [70 ; 170] +// - ITS N Clusters = [3.5 ; 7.5] +// - n-sigma_e = [-4.0 ; 4.0] +// - n-sigma_pi > 3.5 for 0.0 < pIN < 2.0 +// - n-sigma_pr > 2.5 for 2.0 < pIN < 1e+10 +// - n-sigma_e TOF = [-4.0 ; 4.0] for 0.3 < pIN < 1e+10 +// - PID post-calibration : No +// - Track-collision association : Yes +// For the dielectron Cut : +// - Intermediate Mass Range ee trigger : mee > 1.3 GeV/c2 (pairMass1_3) +// - High Mass Range ee trigger : mee > 3.5 GeV/c2 (pairMassLow12) +// +// Muons Cuts 2022 : +// - Single mu Low (High) pT > 0.7 (4.0) GeV/c +// - Single mu eta = [-4.0 ; -2.5] +// - Rabs = [17.6 ; 89.5] +// - p x DCA = ~6 sigma_[p x DCA] +// - Matching MCH-MID : No +// - Track-collision association : No +// For the dimuon cut +// m_mumu > 1.8 GeV/c2 +// +// Muons Cuts 2023 & 2024 : +// - Single mu Low (High) pT > 0.7 (20.0) GeV/c +// - Single mu eta = [-4.0 ; -2.5] +// - Rabs = [17.6 ; 89.5] +// - p x DCA = ~10 sigma_[p x DCA] +// - Matching MCH-MID : Yes +// - Track-collision association : Yes +// For the dimuon cut +// m_mumu > 1.8 GeV/c2 +// +// +// /////////////////////////////////////////////// +// End of Cuts for CEFP // +// /////////////////////////////////////////////// + namespace o2::aod { namespace dqcuts From 046584e95dfdc86879a313fa710f4291693841d1 Mon Sep 17 00:00:00 2001 From: spolitan <59452587+stefanopolitano@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:42:53 +0100 Subject: [PATCH 177/459] [PWGHF] Adding occupcany vs centrality info in HF ev. sel. utils (#8700) Co-authored-by: ALICE Action Bot --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 63 +++++-------- .../TableProducer/candidateCreator2Prong.cxx | 9 +- .../TableProducer/candidateCreator3Prong.cxx | 9 +- PWGHF/Utils/utilsEvSelHf.h | 90 +++++++++++++------ 4 files changed, 96 insertions(+), 75 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 2d84a9afdf8..59e4f0f4523 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -64,8 +64,7 @@ struct HfTaskFlowCharmHadrons { Configurable centralityMax{"centralityMax", 100., "Maximum centrality accepted in SP/EP computation (not applied in resolution process)"}; Configurable storeEP{"storeEP", false, "Flag to store EP-related axis"}; Configurable storeMl{"storeMl", false, "Flag to store ML scores"}; - Configurable occEstimator{"occEstimator", 1, "Occupancy estimation (1: ITS, 2: FT0C)"}; - Configurable storeOccupancy{"storeOccupancy", false, "Flag to store TH2 occITS/occFT0C + HfEvSelBitMasks"}; + Configurable occEstimator{"occEstimator", 0, "Occupancy estimation (0: None, 1: ITS, 2: FT0C)"}; Configurable saveEpResoHisto{"saveEpResoHisto", false, "Flag to save event plane resolution histogram"}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable> classMl{"classMl", {0, 2}, "Indexes of BDT scores to be stored. Two indexes max."}; @@ -81,7 +80,7 @@ struct HfTaskFlowCharmHadrons { ConfigurableAxis thnConfigAxisOccupancyITS{"thnConfigAxisOccupancyITS", {14, 0, 14000}, ""}; ConfigurableAxis thnConfigAxisOccupancyFT0C{"thnConfigAxisOccupancyFT0C", {14, 0, 140000}, ""}; ConfigurableAxis thnConfigAxisNoSameBunchPileup{"thnConfigAxisNoSameBunchPileup", {2, 0, 2}, ""}; - ConfigurableAxis thnConfigAxisNumTracksInTimeRange{"thnConfigAxisNumTracksInTimeRange", {2, 0, 2}, ""}; + ConfigurableAxis thnConfigAxisOccupancy{"thnConfigAxisOccupancy", {2, 0, 2}, ""}; ConfigurableAxis thnConfigAxisNoCollInTimeRangeNarrow{"thnConfigAxisNoCollInTimeRangeNarrow", {2, 0, 2}, ""}; ConfigurableAxis thnConfigAxisNoCollInTimeRangeStandard{"thnConfigAxisNoCollInTimeRangeStandard", {2, 0, 2}, ""}; ConfigurableAxis thnConfigAxisNoCollInRofStandard{"thnConfigAxisNoCollInRofStandard", {2, 0, 2}, ""}; @@ -135,7 +134,7 @@ struct HfTaskFlowCharmHadrons { const AxisSpec thnAxisOccupancyITS{thnConfigAxisOccupancyITS, "OccupancyITS"}; const AxisSpec thnAxisOccupancyFT0C{thnConfigAxisOccupancyFT0C, "OccupancyFT0C"}; const AxisSpec thnAxisNoSameBunchPileup{thnConfigAxisNoSameBunchPileup, "NoSameBunchPileup"}; - const AxisSpec thnAxisNumTracksInTimeRange{thnConfigAxisNumTracksInTimeRange, "NumTracksInTimeRange"}; + const AxisSpec thnAxisOccupancy{thnConfigAxisOccupancy, "Occupancy"}; const AxisSpec thnAxisNoCollInTimeRangeNarrow{thnConfigAxisNoCollInTimeRangeNarrow, "NoCollInTimeRangeNarrow"}; const AxisSpec thnAxisNoCollInTimeRangeStandard{thnConfigAxisNoCollInTimeRangeStandard, "NoCollInTimeRangeStandard"}; const AxisSpec thnAxisNoCollInRofStandard{thnConfigAxisNoCollInRofStandard, "NoCollInRofStandard"}; @@ -147,18 +146,18 @@ struct HfTaskFlowCharmHadrons { if (storeMl) { axes.insert(axes.end(), {thnAxisMlOne, thnAxisMlTwo}); } - if (storeOccupancy) { + if (occEstimator != 0) { if (occEstimator == 1) { - axes.insert(axes.end(), {thnAxisOccupancyITS, thnAxisNoSameBunchPileup, thnAxisNumTracksInTimeRange, + axes.insert(axes.end(), {thnAxisOccupancyITS, thnAxisNoSameBunchPileup, thnAxisOccupancy, thnAxisNoCollInTimeRangeNarrow, thnAxisNoCollInTimeRangeStandard, thnAxisNoCollInRofStandard}); } else { - axes.insert(axes.end(), {thnAxisOccupancyFT0C, thnAxisNoSameBunchPileup, thnAxisNumTracksInTimeRange, + axes.insert(axes.end(), {thnAxisOccupancyFT0C, thnAxisNoSameBunchPileup, thnAxisOccupancy, thnAxisNoCollInTimeRangeNarrow, thnAxisNoCollInTimeRangeStandard, thnAxisNoCollInRofStandard}); } } registry.add("hSparseFlowCharm", "THn for SP", HistType::kTHnSparseF, axes); - if (storeOccupancy) { + if (occEstimator != 0) { registry.add("trackOccVsFT0COcc", "trackOccVsFT0COcc; trackOcc; FT0COcc", {HistType::kTH2F, {thnAxisOccupancyITS, thnAxisOccupancyFT0C}}); } @@ -280,19 +279,19 @@ struct HfTaskFlowCharmHadrons { float& occupancy, uint16_t& hfevselflag) { - if (storeOccupancy) { + if (occEstimator != 0) { if (storeMl) { if (storeEP) { registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, cosNPhi, cosDeltaPhi, outputMl[0], outputMl[1], occupancy, TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), - TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NumTracksInTimeRange), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::Occupancy), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)); } else { registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, outputMl[0], outputMl[1], occupancy, TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), - TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NumTracksInTimeRange), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::Occupancy), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)); @@ -301,14 +300,14 @@ struct HfTaskFlowCharmHadrons { if (storeEP) { registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, cosNPhi, cosDeltaPhi, occupancy, TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), - TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NumTracksInTimeRange), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::Occupancy), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)); } else { registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, occupancy, TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), - TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NumTracksInTimeRange), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::Occupancy), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)); @@ -331,26 +330,6 @@ struct HfTaskFlowCharmHadrons { } } - /// Get the occupancy - /// \param collision is the collision with the occupancy information - float getOccupancy(CollsWithQvecs::iterator const& collision) - { - float occupancy = -999.; - switch (occEstimator) { - case 1: - occupancy = collision.trackOccupancyInTimeRange(); - break; - case 2: - occupancy = collision.ft0cOccupancyInTimeRange(); - break; - default: - LOG(warning) << "Occupancy estimator not valid. Possible values are ITS or FT0C. Fallback to ITS"; - occupancy = collision.trackOccupancyInTimeRange(); - break; - } - return occupancy; - } - /// Get the centrality /// \param collision is the collision with the centrality information float getCentrality(CollsWithQvecs::iterator const& collision) @@ -380,16 +359,20 @@ struct HfTaskFlowCharmHadrons { /// Check if the collision is selected /// \param collision is the collision with the Q vector information /// \param bc is the bunch crossing with timestamp information + /// \param centrality is the collision centrality /// \return true if the collision is selected, false otherwise template bool isCollSelected(CollsWithQvecs::iterator const& collision, - aod::BCsWithTimestamps const&) + aod::BCsWithTimestamps const&, + float& centrality) { - float centrality{-1.f}; + float occupancy = hfEvSel.getOccupancy(collision, occEstimator); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + centrality = getCentrality(collision); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); + registry.fill(HIST("trackOccVsFT0COcc"), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange()); return rejectionMask == 0; } @@ -454,8 +437,8 @@ struct HfTaskFlowCharmHadrons { } float occupancy = 0.; uint16_t hfevflag; - if (storeOccupancy) { - occupancy = getOccupancy(collision); + if (occEstimator != 0) { + occupancy = hfEvSel.getOccupancy(collision, occEstimator); registry.fill(HIST("trackOccVsFT0COcc"), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange()); hfevflag = hfEvSel.getHfCollisionRejectionMask(collision, cent, ccdb, registry); } @@ -648,12 +631,12 @@ struct HfTaskFlowCharmHadrons { void processResolution(CollsWithQvecs::iterator const& collision, aod::BCsWithTimestamps const& bcs) { - if (!isCollSelected(collision, bcs)) { + float centrality{-1.f}; + if (!isCollSelected(collision, bcs, centrality)) { // no selection on the centrality is applied on purpose to allow for the resolution study in post-processing return; } - float centrality = getCentrality(collision); // centrality not updated in the rejection mask function float xQVecFT0a = collision.qvecFT0ARe(); float yQVecFT0a = collision.qvecFT0AIm(); float xQVecFT0c = collision.qvecFT0CRe(); diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 636b7907020..8b464257ce6 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -625,10 +625,11 @@ struct HfCandidateCreator2Prong { /// bitmask with event. selection info float centrality{-1.f}; + float occupancy = hfEvSel.getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } @@ -642,10 +643,11 @@ struct HfCandidateCreator2Prong { /// bitmask with event. selection info float centrality{-1.f}; + float occupancy = hfEvSel.getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } @@ -659,10 +661,11 @@ struct HfCandidateCreator2Prong { /// bitmask with event. selection info float centrality{-1.f}; + float occupancy = hfEvSel.getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 10df33964ad..e7c464efa72 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -404,10 +404,11 @@ struct HfCandidateCreator3Prong { /// bitmask with event. selection info float centrality{-1.f}; + float occupancy = hfEvSel.getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } @@ -421,10 +422,11 @@ struct HfCandidateCreator3Prong { /// bitmask with event. selection info float centrality{-1.f}; + float occupancy = hfEvSel.getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } @@ -438,10 +440,11 @@ struct HfCandidateCreator3Prong { /// bitmask with event. selection info float centrality{-1.f}; + float occupancy = hfEvSel.getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 71f0bd0559d..616608116bb 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -44,7 +44,7 @@ enum EventRejection { ItsRofBorderCut, IsGoodZvtxFT0vsPV, NoSameBunchPileup, - NumTracksInTimeRange, + Occupancy, NContrib, Chi2, PositionZ, @@ -72,7 +72,7 @@ void setEventRejectionLabels(Histo& hRejection, std::string softwareTriggerLabel hRejection->GetXaxis()->SetBinLabel(EventRejection::ItsRofBorderCut + 1, "ITS ROF border"); hRejection->GetXaxis()->SetBinLabel(EventRejection::IsGoodZvtxFT0vsPV + 1, "PV #it{z} consistency FT0 timing"); hRejection->GetXaxis()->SetBinLabel(EventRejection::NoSameBunchPileup + 1, "No same-bunch pile-up"); // POTENTIALLY BAD FOR BEAUTY ANALYSES - hRejection->GetXaxis()->SetBinLabel(EventRejection::NumTracksInTimeRange + 1, "Occupancy"); + hRejection->GetXaxis()->SetBinLabel(EventRejection::Occupancy + 1, "Occupancy"); hRejection->GetXaxis()->SetBinLabel(EventRejection::NContrib + 1, "# of PV contributors"); hRejection->GetXaxis()->SetBinLabel(EventRejection::Chi2 + 1, "PV #it{#chi}^{2}"); hRejection->GetXaxis()->SetBinLabel(EventRejection::PositionZ + 1, "PV #it{z}"); @@ -93,10 +93,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable useItsRofBorderCut{"useItsRofBorderCut", true, "Apply ITS ROF border cut"}; o2::framework::Configurable useIsGoodZvtxFT0vsPV{"useIsGoodZvtxFT0vsPV", false, "Check consistency between PVz from central barrel with that from FT0 timing"}; o2::framework::Configurable useNoSameBunchPileup{"useNoSameBunchPileup", false, "Exclude collisions in bunches with more than 1 reco. PV"}; // POTENTIALLY BAD FOR BEAUTY ANALYSES - o2::framework::Configurable useNumTracksInTimeRange{"useNumTracksInTimeRange", false, "Apply occupancy selection (num. ITS tracks with at least 5 clusters in +-100us from current collision)"}; - o2::framework::Configurable useFT0cOccEstimator{"useFT0cOccEstimator", false, "Adopt FT0c amplitudes as occupancy estimator instead of ITS tracks"}; - o2::framework::Configurable numTracksInTimeRangeMin{"numTracksInTimeRangeMin", 0, "Minimum occupancy"}; - o2::framework::Configurable numTracksInTimeRangeMax{"numTracksInTimeRangeMax", 1000000, "Maximum occupancy"}; + o2::framework::Configurable useOccupancyCut{"useOccupancyCut ", false, "Apply occupancy selection (num. ITS tracks with at least 5 clusters or num. of signals in FT0c in +-100us from current collision)"}; + o2::framework::Configurable occEstimator{"occEstimator", 1, "Occupancy estimation (1: ITS, 2: FT0C)"}; + o2::framework::Configurable occupancyMin{"occupancyMin", 0, "Minimum occupancy"}; + o2::framework::Configurable occupancyMax{"occupancyMax", 1000000, "Maximum occupancy"}; o2::framework::Configurable nPvContributorsMin{"nPvContributorsMin", 0, "Minimum number of PV contributors"}; o2::framework::Configurable chi2PvMax{"chi2PvMax", -1.f, "Maximum PV chi2"}; o2::framework::Configurable zPvPosMin{"zPvPosMin", -10.f, "Minimum PV posZ (cm)"}; @@ -107,6 +107,8 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable softwareTrigger{"softwareTrigger", "", "Label of software trigger. Multiple triggers can be selected dividing them by a comma. Set None if you want bcs that are not selected by any trigger"}; o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "Users/m/mpuccio/EventFiltering/OTS/", "ccdb path for ZORRO objects"}; + o2::framework::ConfigurableAxis th2ConfigAxisCent{"th2ConfigAxisCent", {100, 0., 100.}, ""}; + o2::framework::ConfigurableAxis th2ConfigAxisOccupancy{"th2ConfigAxisOccupancy", {14, 0, 140000}, ""}; // histogram names static constexpr char nameHistCollisions[] = "hCollisions"; @@ -116,8 +118,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { static constexpr char nameHistPosXAfterEvSel[] = "hPosXAfterEvSel"; static constexpr char nameHistPosYAfterEvSel[] = "hPosYAfterEvSel"; static constexpr char nameHistNumPvContributorsAfterSel[] = "hNumPvContributorsAfterSel"; + static constexpr char nameHistCollisionsCentOcc[] = "hCollisionsCentOcc"; std::shared_ptr hCollisions, hSelCollisionsCent, hPosZBeforeEvSel, hPosZAfterEvSel, hPosXAfterEvSel, hPosYAfterEvSel, hNumPvContributorsAfterSel; + std::shared_ptr hCollisionsCentOcc; // util to retrieve trigger mask in case of software triggers Zorro zorro; @@ -137,6 +141,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { hNumPvContributorsAfterSel = registry.add(nameHistNumPvContributorsAfterSel, "selected events;#it{y}_{prim. vtx.} (cm);entries", {o2::framework::HistType::kTH1D, {{500, -0.5, 499.5}}}); setEventRejectionLabels(hCollisions, softwareTrigger); + const o2::framework::AxisSpec th2AxisCent{th2ConfigAxisCent, "Centrality"}; + const o2::framework::AxisSpec th2AxisOccupancy{th2ConfigAxisOccupancy, "Occupancy"}; + hCollisionsCentOcc = registry.add(nameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {th2AxisCent, th2AxisOccupancy}}); + // we initialise the summary object if (softwareTrigger.value != "") { zorroSummary.setObject(zorro.getZorroSummary()); @@ -157,17 +165,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { uint16_t rejectionMask{0}; // 16 bits, in case new ev. selections will be added if constexpr (centEstimator != o2::hf_centrality::CentralityEstimator::None) { - if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0A) { - centrality = collision.centFT0A(); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0C) { - centrality = collision.centFT0C(); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { - centrality = collision.centFT0M(); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FV0A) { - centrality = collision.centFV0A(); - } else { - LOGP(fatal, "Unsupported centrality estimator!"); - } + centrality = getCentrality(collision); if (centrality < centralityMin || centrality > centralityMax) { SETBIT(rejectionMask, EventRejection::Centrality); } @@ -211,17 +209,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { if (useNoCollInRofStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { SETBIT(rejectionMask, EventRejection::NoCollInRofStandard); } - if (useNumTracksInTimeRange) { - float numTracksInTimeRange; - if (useFT0cOccEstimator) { - /// occupancy estimator (FT0c signal amplitudes in +-10us from current collision) - numTracksInTimeRange = collision.ft0cOccupancyInTimeRange(); - } else { - /// occupancy estimator (ITS tracks with at least 5 clusters in +-10us from current collision) - numTracksInTimeRange = static_cast(collision.trackOccupancyInTimeRange()); - } - if (numTracksInTimeRange < numTracksInTimeRangeMin || numTracksInTimeRange > numTracksInTimeRangeMax) { - SETBIT(rejectionMask, EventRejection::NumTracksInTimeRange); + if (useOccupancyCut) { + float occupancy = getOccupancy(collision, occEstimator); + if (occupancy < occupancyMin || occupancy > occupancyMax) { + SETBIT(rejectionMask, EventRejection::Occupancy); } } } @@ -268,11 +259,51 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { return rejectionMask; } + /// Get the occupancy + /// \param collision is the collision with the occupancy information + /// \param occEstimator is the occupancy estimator (1: ITS, 2: FT0C) + template + float getOccupancy(Coll const& collision, int occEstimator = 1) + { + switch (occEstimator) { + case 1: // ITS + return collision.trackOccupancyInTimeRange(); + break; + case 2: // FT0c + return collision.ft0cOccupancyInTimeRange(); + break; + default: + LOG(warning) << "Occupancy estimator not valid. Possible values are ITS or FT0C. Fallback to ITS"; + return collision.trackOccupancyInTimeRange(); + break; + } + } + + /// Get the centrality + /// \param collision is the collision with the centrality information + /// \param centEstimator is the centrality estimator from hf_centrality::CentralityEstimator + template + float getCentrality(Coll const& collision) + { + if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0A) { + return collision.centFT0A(); + } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0C) { + return collision.centFT0C(); + } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { + return collision.centFT0M(); + } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FV0A) { + return collision.centFV0A(); + } else { + LOG(warning) << "Centrality estimator not valid. Possible values are V0A, T0M, T0A, T0C. Fallback to FT0c"; + return collision.centFT0C(); + } + } + /// \brief Fills histograms for monitoring event selections satisfied by the collision. /// \param collision analysed collision /// \param rejectionMask bitmask storing the info about which ev. selections are not satisfied by the collision template - void fillHistograms(Coll const& collision, const uint16_t rejectionMask, float& centrality) + void fillHistograms(Coll const& collision, const uint16_t rejectionMask, float& centrality, float occupancy = -1) { hCollisions->Fill(EventRejection::None); const float posZ = collision.posZ(); @@ -290,6 +321,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { hPosZAfterEvSel->Fill(posZ); hNumPvContributorsAfterSel->Fill(collision.numContrib()); hSelCollisionsCent->Fill(centrality); + hCollisionsCentOcc->Fill(centrality, occupancy); } }; From 7b795d5351f43e47d65e1d002c9195c8842ab39f Mon Sep 17 00:00:00 2001 From: Andrea Giovanni Riffero Date: Fri, 29 Nov 2024 16:24:14 +0100 Subject: [PATCH 178/459] [PWGUD] Update personal task fwdMuonsUPC.cxx (#8734) Co-authored-by: ariffero Co-authored-by: ALICE Action Bot --- PWGUD/Tasks/fwdMuonsUPC.cxx | 606 ++++++++++++++++++++++++++++++++---- 1 file changed, 545 insertions(+), 61 deletions(-) diff --git a/PWGUD/Tasks/fwdMuonsUPC.cxx b/PWGUD/Tasks/fwdMuonsUPC.cxx index 34075b7a862..418995de88c 100644 --- a/PWGUD/Tasks/fwdMuonsUPC.cxx +++ b/PWGUD/Tasks/fwdMuonsUPC.cxx @@ -9,6 +9,16 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file fwdMuonsUPC.cxx +/// \brief perform some selections on fwd events and saves the results + +/// executable name o2-analysis-ud-fwd-muon-upc + +/// \author Andrea Giovanni Riffero + +#include +#include + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -17,21 +27,38 @@ #include "DataFormatsParameters/GRPECSObject.h" #include "PWGUD/DataModel/UDTables.h" +#include "TDatabasePDG.h" #include "TLorentzVector.h" #include "TSystem.h" #include "TMath.h" +#include "TRandom3.h" +// table for saving tree with info on data namespace dimu { // dimuon DECLARE_SOA_COLUMN(M, m, float); +DECLARE_SOA_COLUMN(E, energy, float); +DECLARE_SOA_COLUMN(Px, px, float); +DECLARE_SOA_COLUMN(Py, py, float); +DECLARE_SOA_COLUMN(Pz, pz, float); DECLARE_SOA_COLUMN(Pt, pt, float); DECLARE_SOA_COLUMN(Rap, rap, float); DECLARE_SOA_COLUMN(Phi, phi, float); +DECLARE_SOA_COLUMN(PhiAv, phiAv, float); +DECLARE_SOA_COLUMN(PhiCh, phiCh, float); // tracks positive (p) and negative (n) +DECLARE_SOA_COLUMN(Ep, energyp, float); +DECLARE_SOA_COLUMN(Pxp, pxp, float); +DECLARE_SOA_COLUMN(Pyp, pyp, float); +DECLARE_SOA_COLUMN(Pzp, pzp, float); DECLARE_SOA_COLUMN(Ptp, ptp, float); DECLARE_SOA_COLUMN(Etap, etap, float); DECLARE_SOA_COLUMN(Phip, phip, float); +DECLARE_SOA_COLUMN(En, energyn, float); +DECLARE_SOA_COLUMN(Pxn, pxn, float); +DECLARE_SOA_COLUMN(Pyn, pyn, float); +DECLARE_SOA_COLUMN(Pzn, pzn, float); DECLARE_SOA_COLUMN(Ptn, ptn, float); DECLARE_SOA_COLUMN(Etan, etan, float); DECLARE_SOA_COLUMN(Phin, phin, float); @@ -46,19 +73,58 @@ DECLARE_SOA_COLUMN(Nclass, nclass, int); namespace o2::aod { DECLARE_SOA_TABLE(DiMu, "AOD", "DIMU", - dimu::M, dimu::Pt, dimu::Rap, dimu::Phi, - dimu::Ptp, dimu::Etap, dimu::Phip, - dimu::Ptn, dimu::Etan, dimu::Phin, + dimu::M, dimu::E, dimu::Px, dimu::Py, dimu::Pz, dimu::Pt, dimu::Rap, dimu::Phi, + dimu::PhiAv, dimu::PhiCh, + dimu::Ep, dimu::Pxp, dimu::Pyp, dimu::Pzp, dimu::Ptp, dimu::Etap, dimu::Phip, + dimu::En, dimu::Pxn, dimu::Pyn, dimu::Pzn, dimu::Ptn, dimu::Etan, dimu::Phin, dimu::Tzna, dimu::Ezna, dimu::Tznc, dimu::Eznc, dimu::Nclass); -} +} // namespace o2::aod + +// for saving tree with info on reco MC +namespace recodimu +{ +// dimuon +DECLARE_SOA_COLUMN(Pt, pt, float); +DECLARE_SOA_COLUMN(Rap, rap, float); +DECLARE_SOA_COLUMN(Phi, phi, float); +DECLARE_SOA_COLUMN(PhiAv, phiAv, float); +DECLARE_SOA_COLUMN(PhiCh, phiCh, float); +// tracks positive (p) and negative (n) +DECLARE_SOA_COLUMN(Ptp, ptp, float); +DECLARE_SOA_COLUMN(Etap, etap, float); +DECLARE_SOA_COLUMN(Phip, phip, float); +DECLARE_SOA_COLUMN(Ptn, ptn, float); +DECLARE_SOA_COLUMN(Etan, etan, float); +DECLARE_SOA_COLUMN(Phin, phin, float); +// gen info dimuon +DECLARE_SOA_COLUMN(GenPt, gen_pt, float); +DECLARE_SOA_COLUMN(GenRap, gen_rap, float); +DECLARE_SOA_COLUMN(GenPhi, gen_phi, float); +// gen info trks +DECLARE_SOA_COLUMN(GenPtp, gen_ptp, float); +DECLARE_SOA_COLUMN(GenEtap, gen_etap, float); +DECLARE_SOA_COLUMN(GenPhip, gen_phip, float); +DECLARE_SOA_COLUMN(GenPtn, gen_ptn, float); +DECLARE_SOA_COLUMN(GenEtan, gen_etan, float); +DECLARE_SOA_COLUMN(GenPhin, gen_phin, float); +} // namespace recodimu + +namespace o2::aod +{ +DECLARE_SOA_TABLE(recoDiMu, "AOD", "RECODIMU", + recodimu::Pt, recodimu::Rap, recodimu::Phi, + recodimu::PhiAv, recodimu::PhiCh, + recodimu::Ptp, recodimu::Etap, recodimu::Phip, + recodimu::Ptn, recodimu::Etan, recodimu::Phin, + recodimu::GenPt, recodimu::GenRap, recodimu::GenPhi, + recodimu::GenPtp, recodimu::GenEtap, recodimu::GenPhip, + recodimu::GenPtn, recodimu::GenEtan, recodimu::GenPhin); +} // namespace o2::aod using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -// defining constants -double mMu = 0.10566; // mass of muon - // constants used in the track selection const float kRAbsMin = 17.6; const float kRAbsMid = 26.5; @@ -71,22 +137,29 @@ const float kPtMin = 0.; struct fwdMuonsUPC { + // a pdg object + TDatabasePDG* pdg = nullptr; + using CandidatesFwd = soa::Join; using ForwardTracks = soa::Join; + using CompleteFwdTracks = soa::Join; Produces dimuSel; + Produces dimuReco; - // defining histograms using histogram registry + // defining histograms using histogram registry: different histos for the different process functions HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry reg0n0n{"reg0n0n", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry regXn0n{"regXn0n", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry regXnXn{"regXnXn", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry McGenRegistry{"McGenRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry McRecoRegistry{"McRecoRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; // CONFIGURABLES // pT of muon pairs Configurable nBinsPt{"nBinsPt", 250, "N bins in pT histo"}; Configurable lowPt{"lowPt", 0., "lower limit in pT histo"}; - Configurable highPt{"highPt", 0.5, "upper limit in pT histo"}; + Configurable highPt{"highPt", 2, "upper limit in pT histo"}; // mass of muon pairs Configurable nBinsMass{"nBinsMass", 500, "N bins in mass histo"}; Configurable lowMass{"lowMass", 0., "lower limit in mass histo"}; @@ -120,12 +193,11 @@ struct fwdMuonsUPC { Configurable lowEnZN{"lowEnZN", -50., "lower limit in ZN energy histo"}; Configurable highEnZN{"highEnZN", 250., "upper limit in ZN energy histo"}; - // configuarble rapidity cuts - Configurable yCutLow{"yCutLow", -4, "Lower cut in pair rapidity"}; - Configurable yCutUp{"yCutUp", -2.5, "Upper cut in pair rapidity"}; - void init(InitContext&) { + // PDG + pdg = TDatabasePDG::Instance(); + // binning of pT axis fr fit std::vector ptFitBinning = { 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, @@ -148,13 +220,14 @@ struct fwdMuonsUPC { const AxisSpec axisPhiSingle{nBinsPhiSingle, lowPhiSingle, highPhiSingle, "#varphi_{trk}"}; // histos - registry.add("hMass", "Ivariant mass of muon pairs;;#counts", kTH1D, {axisMass}); - registry.add("hPt", "Transverse momentum mass of muon pairs;;#counts", kTH1D, {axisPt}); - registry.add("hPtFit", "Transverse momentum mass of muon pairs;;#counts", kTH1D, {axisPtFit}); + // data and reco MC + registry.add("hMass", "Invariant mass of muon pairs;;#counts", kTH1D, {axisMass}); + registry.add("hPt", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPt}); + registry.add("hPtFit", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPtFit}); registry.add("hEta", "Pseudorapidty of muon pairs;;#counts", kTH1D, {axisEta}); registry.add("hRapidity", "Rapidty of muon pairs;;#counts", kTH1D, {axisRapidity}); registry.add("hPhi", "#varphi of muon pairs;;#counts", kTH1D, {axisPhi}); - registry.add("hCharge", "Charge;#it{charge};;#counts", kTH1D, {{5, -2.5, 2.5}}); + registry.add("hCharge", "Charge;;;#counts", kTH1D, {{5, -2.5, 2.5}}); registry.add("hContrib", "hContrib;;#counts", kTH1D, {{6, -0.5, 5.5}}); registry.add("hEvSign", "Sum of the charges of all the tracks in each event;;#counts", kTH1D, {{5, -2.5, 2.5}}); registry.add("hPtTrkPos", "Pt of positive muons;;#counts", kTH1D, {axisPtSingle}); @@ -163,32 +236,87 @@ struct fwdMuonsUPC { registry.add("hEtaTrkNeg", "#eta of negative muons;;#counts", kTH1D, {axisEtaSingle}); registry.add("hPhiTrkPos", "#varphi of positive muons;;#counts", kTH1D, {axisPhiSingle}); registry.add("hPhiTrkNeg", "#varphi of negative muons;;#counts", kTH1D, {axisPhiSingle}); + registry.add("hSameSign", "hSameSign;;#counts", kTH1D, {{6, -0.5, 5.5}}); + registry.add("hPhiCharge", "#phi #it{charge}", kTH1D, {axisPhi}); + registry.add("hPhiAverage", "#phi #it{average}", kTH1D, {axisPhi}); + + // data registry.add("hTimeZNA", "ZNA Times;;#counts", kTH1D, {axisTimeZN}); registry.add("hTimeZNC", "ZNC Times;;#counts", kTH1D, {axisTimeZN}); registry.add("hEnergyZN", "ZNA vs ZNC energy", kTH2D, {axisEnergyZNA, axisEnergyZNC}); - registry.add("hSameSign", "hSameSign;;#counts", kTH1D, {{6, -0.5, 5.5}}); - reg0n0n.add("hMass", "Ivariant mass of muon pairs - 0n0n;;#counts", kTH1D, {axisMass}); - reg0n0n.add("hPt", "Transverse momentum mass of muon pairs - 0n0n;;#counts", kTH1D, {axisPt}); + reg0n0n.add("hMass", "Invariant mass of muon pairs - 0n0n;;#counts", kTH1D, {axisMass}); + reg0n0n.add("hPt", "Transverse momentum of muon pairs - 0n0n;;#counts", kTH1D, {axisPt}); reg0n0n.add("hEta", "Pseudorapidty of muon pairs - 0n0n;;#counts", kTH1D, {axisEta}); reg0n0n.add("hRapidity", "Rapidty of muon pairs - 0n0n;;#counts", kTH1D, {axisRapidity}); - reg0n0n.add("hPtFit", "Transverse momentum mass of muon pairs - 0n0n;;#counts", kTH1D, {axisPtFit}); + reg0n0n.add("hPtFit", "Transverse momentum of muon pairs - 0n0n;;#counts", kTH1D, {axisPtFit}); - regXn0n.add("hMass", "Ivariant mass of muon pairs - Xn0n;;#counts", kTH1D, {axisMass}); - regXn0n.add("hPt", "Transverse momentum mass of muon pairs - Xn0n;;#counts", kTH1D, {axisPt}); + regXn0n.add("hMass", "Invariant mass of muon pairs - Xn0n;;#counts", kTH1D, {axisMass}); + regXn0n.add("hPt", "Transverse momentum of muon pairs - Xn0n;;#counts", kTH1D, {axisPt}); regXn0n.add("hEta", "Pseudorapidty of muon pairs - Xn0n;;#counts", kTH1D, {axisEta}); regXn0n.add("hRapidity", "Rapidty of muon pairs - Xn0n;;#counts", kTH1D, {axisRapidity}); - regXn0n.add("hPtFit", "Transverse momentum mass of muon pairs - Xn0n;;#counts", kTH1D, {axisPtFit}); + regXn0n.add("hPtFit", "Transverse momentum of muon pairs - Xn0n;;#counts", kTH1D, {axisPtFit}); - regXnXn.add("hMass", "Ivariant mass of muon pairs - XnXn;;#counts", kTH1D, {axisMass}); - regXnXn.add("hPt", "Transverse momentum mass of muon pairs - XnXn;;#counts", kTH1D, {axisPt}); + regXnXn.add("hMass", "Invariant mass of muon pairs - XnXn;;#counts", kTH1D, {axisMass}); + regXnXn.add("hPt", "Transverse momentum of muon pairs - XnXn;;#counts", kTH1D, {axisPt}); regXnXn.add("hEta", "Pseudorapidty of muon pairs - XnXn;;#counts", kTH1D, {axisEta}); regXnXn.add("hRapidity", "Rapidty of muon pairs - XnXn;;#counts", kTH1D, {axisRapidity}); - regXnXn.add("hPtFit", "Transverse momentum mass of muon pairs - XnXn;;#counts", kTH1D, {axisPtFit}); + regXnXn.add("hPtFit", "Transverse momentum of muon pairs - XnXn;;#counts", kTH1D, {axisPtFit}); + + // gen MC + McGenRegistry.add("hMass", "Invariant mass of muon pairs;;#counts", kTH1D, {axisMass}); + McGenRegistry.add("hPt", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPt}); + McGenRegistry.add("hEta", "Pseudorapidty of muon pairs;;#counts", kTH1D, {axisEta}); + McGenRegistry.add("hRapidity", "Rapidty of muon pairs;;#counts", kTH1D, {axisRapidity}); + McGenRegistry.add("hPhi", "#varphi of muon pairs;;#counts", kTH1D, {axisPhi}); + McGenRegistry.add("hPtTrkPos", "Pt of positive muons;;#counts", kTH1D, {axisPtSingle}); + McGenRegistry.add("hPtTrkNeg", "Pt of negative muons;;#counts", kTH1D, {axisPtSingle}); + McGenRegistry.add("hEtaTrkPos", "#eta of positive muons;;#counts", kTH1D, {axisEtaSingle}); + McGenRegistry.add("hEtaTrkNeg", "#eta of negative muons;;#counts", kTH1D, {axisEtaSingle}); + McGenRegistry.add("hPhiTrkPos", "#varphi of positive muons;;#counts", kTH1D, {axisPhiSingle}); + McGenRegistry.add("hPhiTrkNeg", "#varphi of negative muons;;#counts", kTH1D, {axisPhiSingle}); + McGenRegistry.add("hPhiCharge", "#phi #it{charge}", kTH1D, {axisPhi}); + McGenRegistry.add("hPhiAverage", "#phi #it{average}", kTH1D, {axisPhi}); + + // reco MC + McRecoRegistry.add("hMass", "Invariant mass of muon pairs;;#counts", kTH1D, {axisMass}); + McRecoRegistry.add("hPt", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPt}); + McRecoRegistry.add("hPtFit", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPtFit}); + McRecoRegistry.add("hEta", "Pseudorapidty of muon pairs;;#counts", kTH1D, {axisEta}); + McRecoRegistry.add("hRapidity", "Rapidty of muon pairs;;#counts", kTH1D, {axisRapidity}); + McRecoRegistry.add("hPhi", "#varphi of muon pairs;;#counts", kTH1D, {axisPhi}); + McRecoRegistry.add("hCharge", "Charge;;;#counts", kTH1D, {{5, -2.5, 2.5}}); + McRecoRegistry.add("hContrib", "hContrib;;#counts", kTH1D, {{6, -0.5, 5.5}}); + McRecoRegistry.add("hEvSign", "Sum of the charges of all the tracks in each event;;#counts", kTH1D, {{5, -2.5, 2.5}}); + McRecoRegistry.add("hPtTrkPos", "Pt of positive muons;;#counts", kTH1D, {axisPtSingle}); + McRecoRegistry.add("hPtTrkNeg", "Pt of negative muons;;#counts", kTH1D, {axisPtSingle}); + McRecoRegistry.add("hEtaTrkPos", "#eta of positive muons;;#counts", kTH1D, {axisEtaSingle}); + McRecoRegistry.add("hEtaTrkNeg", "#eta of negative muons;;#counts", kTH1D, {axisEtaSingle}); + McRecoRegistry.add("hPhiTrkPos", "#varphi of positive muons;;#counts", kTH1D, {axisPhiSingle}); + McRecoRegistry.add("hPhiTrkNeg", "#varphi of negative muons;;#counts", kTH1D, {axisPhiSingle}); + McRecoRegistry.add("hSameSign", "hSameSign;;#counts", kTH1D, {{6, -0.5, 5.5}}); + McRecoRegistry.add("hPhiCharge", "#phi #it{charge}", kTH1D, {axisPhi}); + McRecoRegistry.add("hPhiAverage", "#phi #it{average}", kTH1D, {axisPhi}); + + // corr gen-reco + McRecoRegistry.add("hPtcorr", "gen pT vs reco pT", kTH2D, {axisPt, axisPt}); + McRecoRegistry.add("hRapcorr", "gen rapidity vs reco rapidity", kTH2D, {axisRapidity, axisRapidity}); + McRecoRegistry.add("hPhicorr", "gen #phi vs reco #phi", kTH2D, {axisPhi, axisPhi}); } // FUNCTIONS + // retrieve particle mass (GeV/c^2) from TDatabasePDG + float particleMass(TDatabasePDG* pdg, int pid) + { + auto mass = 0.; + TParticlePDG* pdgparticle = pdg->GetParticle(pid); + if (pdgparticle != nullptr) { + mass = pdgparticle->Mass(); + } + return mass; + } + // template function that fills a map with the collision id of each udcollision as key // and a vector with the tracks // map == (key, element) == (udCollisionId, vector of trks) @@ -204,6 +332,45 @@ struct fwdMuonsUPC { } } + // template function that fills a map with the collision id of each udmccollision as key + // and a vector with the tracks + // map == (key, element) == (udMcCollisionId, vector of mc particles) + template + void collectMcCandIDs(std::unordered_map>& tracksPerCand, TTracks& tracks) + { + for (const auto& tr : tracks) { + int32_t candId = tr.udMcCollisionId(); + if (candId < 0) { + continue; + } + tracksPerCand[candId].push_back(tr.globalIndex()); + } + } + + // template function that fills a map with the collision id of each udmccollision as key + // and a vector with the tracks + // map == (key, element) == (udCollisionId, vector(track1, mcPart1, udCollisionId1, track2, mcPart2, udCollisionId2)) + template + void collectRecoCandID(std::unordered_map>& tracksPerCand, TTracks& tracks) + { + for (const auto& tr : tracks) { + int32_t candId = tr.udCollisionId(); + if (candId < 0) + continue; + + if (!tr.has_udMcParticle()) { + // LOGF(info,"tr does not have mc part"); + continue; + } + // retrieve mc particle from the reco track + auto mcPart = tr.udMcParticle(); + + tracksPerCand[candId].push_back(tr.globalIndex()); + tracksPerCand[candId].push_back(mcPart.globalIndex()); + tracksPerCand[candId].push_back(mcPart.udMcCollisionId()); + } + } + // struct used to store the ZDC info in a map struct ZDCinfo { float timeA; @@ -242,11 +409,13 @@ struct fwdMuonsUPC { } // function to select muon tracks - bool isMuonSelected(const ForwardTracks::iterator& fwdTrack) + template + bool isMuonSelected(const TTracks& fwdTrack) { float rAbs = fwdTrack.rAtAbsorberEnd(); float pDca = fwdTrack.pDca(); TLorentzVector p; + auto mMu = particleMass(pdg, 13); p.SetXYZM(fwdTrack.px(), fwdTrack.py(), fwdTrack.pz(), mMu); float eta = p.Eta(); float pt = p.Pt(); @@ -263,10 +432,38 @@ struct fwdMuonsUPC { return true; } + // function to compute phi for azimuth anisotropy + void computePhiAnis(TLorentzVector p1, TLorentzVector p2, int sign1, float& phiAverage, float& phiCharge) + { + + TLorentzVector tSum, tDiffAv, tDiffCh; + tSum = p1 + p2; + if (sign1 > 0) { + tDiffCh = p1 - p2; + if (gRandom->Rndm() > 0.5) + tDiffAv = p1 - p2; + else + tDiffAv = p2 - p1; + } else { + tDiffCh = p2 - p1; + if (gRandom->Rndm() > 0.5) + tDiffAv = p2 - p1; + else + tDiffAv = p1 - p2; + } + + // average + phiAverage = tSum.DeltaPhi(tDiffAv); + // charge + phiCharge = tSum.DeltaPhi(tDiffCh); + } + // function that processes the candidates: - // it applies V0 selection, trk selection, and fills the histograms + // it applies V0 selection, trk selection, kine selection, and fills the histograms + // it also divides the data in neutron classes + // used for real data void processCand(CandidatesFwd::iterator const& cand, - const ForwardTracks::iterator& tr1, const ForwardTracks::iterator& tr2, + ForwardTracks::iterator const& tr1, ForwardTracks::iterator const& tr2, ZDCinfo& zdc) { // V0 selection @@ -279,14 +476,16 @@ struct fwdMuonsUPC { } } + // select opposite charge events only + if (cand.netCharge() != 0) { + registry.fill(HIST("hSameSign"), cand.numContrib()); + return; + } + // track selection - TLorentzVector p1, p2; - p1.SetXYZM(tr1.px(), tr1.py(), tr1.pz(), mMu); - p2.SetXYZM(tr2.px(), tr2.py(), tr2.pz(), mMu); - TLorentzVector p = p1 + p2; - if (!isMuonSelected(tr1)) + if (!isMuonSelected(*tr1)) return; - if (!isMuonSelected(tr2)) + if (!isMuonSelected(*tr2)) return; // MCH-MID match selection @@ -298,21 +497,34 @@ struct fwdMuonsUPC { if (nMIDs != 2) return; - // cuts on pair kinematics - if (!(p.M() > 2 && p.M() < 6 && p.Pt() < 5)) - return; + // form Lorentz vectors + TLorentzVector p1, p2; + auto mMu = particleMass(pdg, 13); + p1.SetXYZM(tr1.px(), tr1.py(), tr1.pz(), mMu); + p2.SetXYZM(tr2.px(), tr2.py(), tr2.pz(), mMu); + TLorentzVector p = p1 + p2; - // select opposite charge events only - if (cand.netCharge() != 0) { - registry.fill(HIST("hSameSign"), cand.numContrib()); + // cut on pair kinematics + // select mass + if (p.M() < lowMass) return; - } - - // select rapidity ranges - if (p.Rapidity() < yCutLow) + if (p.M() > highMass) + return; + // select pt + if (p.Pt() < lowPt) + return; + if (p.Pt() > highPt) return; - if (p.Rapidity() > yCutUp) + // select rapidity + if (p.Rapidity() < lowRapidity) return; + if (p.Rapidity() > highRapidity) + return; + + // compute phi for azimuth anisotropy + float phiAverage = 0; + float phiCharge = 0; + computePhiAnis(p1, p2, tr1.sign(), phiAverage, phiCharge); // zdc info if (TMath::Abs(zdc.timeA) < 10) @@ -339,7 +551,7 @@ struct fwdMuonsUPC { // fill the histos in neutron classes and assign neutron class label // 0n0n if (neutron_C == false && neutron_A == false) { - znClass = 0; + znClass = 1; reg0n0n.fill(HIST("hMass"), p.M()); reg0n0n.fill(HIST("hPt"), p.Pt()); reg0n0n.fill(HIST("hPtFit"), p.Pt()); @@ -347,16 +559,16 @@ struct fwdMuonsUPC { reg0n0n.fill(HIST("hRapidity"), p.Rapidity()); } else if (neutron_A ^ neutron_C) { // Xn0n + 0nXn if (neutron_A) - znClass = 1; - else if (neutron_C) znClass = 2; + else if (neutron_C) + znClass = 3; regXn0n.fill(HIST("hMass"), p.M()); regXn0n.fill(HIST("hPt"), p.Pt()); regXn0n.fill(HIST("hPtFit"), p.Pt()); regXn0n.fill(HIST("hEta"), p.Eta()); regXn0n.fill(HIST("hRapidity"), p.Rapidity()); } else if (neutron_A && neutron_C) { // XnXn - znClass = 3; + znClass = 4; regXnXn.fill(HIST("hMass"), p.M()); regXnXn.fill(HIST("hPt"), p.Pt()); regXnXn.fill(HIST("hPtFit"), p.Pt()); @@ -381,25 +593,232 @@ struct fwdMuonsUPC { registry.fill(HIST("hPhi"), p.Phi()); registry.fill(HIST("hCharge"), tr1.sign()); registry.fill(HIST("hCharge"), tr2.sign()); + registry.fill(HIST("hPhiAverage"), phiAverage); + registry.fill(HIST("hPhiCharge"), phiCharge); // store the event to save it into a tree if (tr1.sign() > 0) { - dimuSel(p.M(), p.Pt(), p.Rapidity(), p.Phi(), - p1.Pt(), p1.PseudoRapidity(), p1.Phi(), - p2.Pt(), p2.PseudoRapidity(), p2.Phi(), + dimuSel(p.M(), p.E(), p.Px(), p.Py(), p.Pz(), p.Pt(), p.Rapidity(), p.Phi(), + phiAverage, phiCharge, + p1.E(), p1.Px(), p1.Py(), p1.Pz(), p1.Pt(), p1.PseudoRapidity(), p1.Phi(), + p2.E(), p2.Px(), p2.Py(), p2.Pz(), p2.Pt(), p2.PseudoRapidity(), p2.Phi(), zdc.timeA, zdc.enA, zdc.timeC, zdc.enC, znClass); } else { - dimuSel(p.M(), p.Pt(), p.Rapidity(), p.Phi(), - p2.Pt(), p2.PseudoRapidity(), p2.Phi(), - p1.Pt(), p1.PseudoRapidity(), p1.Phi(), + dimuSel(p.M(), p.E(), p.Px(), p.Py(), p.Pz(), p.Pt(), p.Rapidity(), p.Phi(), + phiAverage, phiCharge, + p2.E(), p2.Px(), p2.Py(), p2.Pz(), p2.Pt(), p2.PseudoRapidity(), p2.Phi(), + p1.E(), p1.Px(), p1.Py(), p1.Pz(), p1.Pt(), p1.PseudoRapidity(), p1.Phi(), zdc.timeA, zdc.enA, zdc.timeC, zdc.enC, znClass); } } + // function that processes the MC gen candidates: + // it applies some kinematics cut and fills the histograms + void processMcGenCand(aod::UDMcCollisions::iterator const& mcCand, + aod::UDMcParticles::iterator const& McPart1, aod::UDMcParticles::iterator const& McPart2) + { + + // check that all pairs are mu+mu- + if (McPart1.pdgCode() + McPart2.pdgCode() != 0) + LOGF(info, "PDG codes: %d | %d", McPart1.pdgCode(), McPart2.pdgCode()); + + // create Lorentz vectors + TLorentzVector p1, p2; + auto mMu = particleMass(pdg, 13); + p1.SetXYZM(McPart1.px(), McPart1.py(), McPart1.pz(), mMu); + p2.SetXYZM(McPart2.px(), McPart2.py(), McPart2.pz(), mMu); + TLorentzVector p = p1 + p2; + + // cut on pair kinematics + // select mass + if (p.M() < lowMass) + return; + if (p.M() > highMass) + return; + // select pt + if (p.Pt() < lowPt) + return; + if (p.Pt() > highPt) + return; + // select rapidity + if (p.Rapidity() < lowRapidity) + return; + if (p.Rapidity() > highRapidity) + return; + + // compute phi for azimuth anisotropy + float phiAverage = 0; + float phiCharge = 0; + computePhiAnis(p1, p2, McPart1.pdgCode(), phiAverage, phiCharge); + + // fill the histos + McGenRegistry.fill(HIST("hPtTrkPos"), p1.Pt()); + McGenRegistry.fill(HIST("hPtTrkNeg"), p2.Pt()); + McGenRegistry.fill(HIST("hEtaTrkPos"), p1.Eta()); + McGenRegistry.fill(HIST("hEtaTrkNeg"), p2.Eta()); + McGenRegistry.fill(HIST("hPhiTrkPos"), p1.Phi()); + McGenRegistry.fill(HIST("hPhiTrkNeg"), p2.Phi()); + McGenRegistry.fill(HIST("hMass"), p.M()); + McGenRegistry.fill(HIST("hPt"), p.Pt()); + McGenRegistry.fill(HIST("hEta"), p.Eta()); + McGenRegistry.fill(HIST("hRapidity"), p.Rapidity()); + McGenRegistry.fill(HIST("hPhi"), p.Phi()); + McGenRegistry.fill(HIST("hPhiAverage"), phiAverage); + McGenRegistry.fill(HIST("hPhiCharge"), phiCharge); + } + + // function that processes MC reco candidates + // it applies V0 selection, trk selection, kine selection, and fills the histograms + void processMcRecoCand(CandidatesFwd::iterator const& cand, + CompleteFwdTracks::iterator const& tr1, aod::UDMcParticles::iterator const& McPart1, + CompleteFwdTracks::iterator const& tr2, aod::UDMcParticles::iterator const& McPart2) + { + // V0 selection + const auto& ampsV0A = cand.amplitudesV0A(); + const auto& ampsRelBCsV0A = cand.ampRelBCsV0A(); + for (unsigned int i = 0; i < ampsV0A.size(); ++i) { + if (std::abs(ampsRelBCsV0A[i]) <= 1) { + if (ampsV0A[i] > 100.) + return; + } + } + + // select opposite charge events only + if (cand.netCharge() != 0) { + registry.fill(HIST("hSameSign"), cand.numContrib()); + return; + } + + // track selection + if (!isMuonSelected(*tr1)) + return; + if (!isMuonSelected(*tr2)) + return; + + // MCH-MID match selection + int nMIDs = 0; + if (tr1.chi2MatchMCHMID() > 0) + nMIDs++; + if (tr2.chi2MatchMCHMID() > 0) + nMIDs++; + if (nMIDs != 2) + return; + + // form Lorentz vectors + TLorentzVector p1, p2; + auto mMu = particleMass(pdg, 13); + p1.SetXYZM(tr1.px(), tr1.py(), tr1.pz(), mMu); + p2.SetXYZM(tr2.px(), tr2.py(), tr2.pz(), mMu); + TLorentzVector p = p1 + p2; + + // cut on pair kinematics (reco candidates) + // select mass + if (p.M() < lowMass) + return; + if (p.M() > highMass) + return; + // select pt + if (p.Pt() < lowPt) + return; + if (p.Pt() > highPt) + return; + // select rapidity + if (p.Rapidity() < lowRapidity) + return; + if (p.Rapidity() > highRapidity) + return; + + // compute phi for azimuth anisotropy + float phiAverage = 0; + float phiCharge = 0; + computePhiAnis(p1, p2, tr1.sign(), phiAverage, phiCharge); + + // gen particle + TLorentzVector p1Mc, p2Mc; + p1Mc.SetXYZM(McPart1.px(), McPart1.py(), McPart1.pz(), mMu); + p2Mc.SetXYZM(McPart2.px(), McPart2.py(), McPart2.pz(), mMu); + TLorentzVector pMc = p1Mc + p2Mc; + + // compute gen phi for azimuth anisotropy + float phiGenAverage = 0; + float phiGenCharge = 0; + computePhiAnis(p1, p2, McPart1.pdgCode(), phiGenAverage, phiGenCharge); + + // print info in case of problems + if (tr1.sign() * McPart1.pdgCode() > 0 || tr2.sign() * McPart2.pdgCode() > 0) { + LOGF(info, "Problem: "); + LOGF(info, "real: %d | %d", (int)tr1.sign(), (int)tr2.sign()); + LOGF(info, "mc : %i | %i", (int)McPart1.pdgCode(), (int)McPart2.pdgCode()); + LOGF(info, "contrib: %d", (int)cand.numContrib()); + } + + // fill the histos + // reco info + McRecoRegistry.fill(HIST("hContrib"), cand.numContrib()); + McRecoRegistry.fill(HIST("hPtTrkPos"), p1.Pt()); + McRecoRegistry.fill(HIST("hPtTrkNeg"), p2.Pt()); + McRecoRegistry.fill(HIST("hEtaTrkPos"), p1.Eta()); + McRecoRegistry.fill(HIST("hEtaTrkNeg"), p2.Eta()); + McRecoRegistry.fill(HIST("hPhiTrkPos"), p1.Phi()); + McRecoRegistry.fill(HIST("hPhiTrkNeg"), p2.Phi()); + McRecoRegistry.fill(HIST("hEvSign"), cand.netCharge()); + McRecoRegistry.fill(HIST("hMass"), p.M()); + McRecoRegistry.fill(HIST("hPt"), p.Pt()); + McRecoRegistry.fill(HIST("hPtFit"), p.Pt()); + McRecoRegistry.fill(HIST("hEta"), p.Eta()); + McRecoRegistry.fill(HIST("hRapidity"), p.Rapidity()); + McRecoRegistry.fill(HIST("hPhi"), p.Phi()); + McRecoRegistry.fill(HIST("hCharge"), tr1.sign()); + McRecoRegistry.fill(HIST("hCharge"), tr2.sign()); + McRecoRegistry.fill(HIST("hPhiAverage"), phiAverage); + McRecoRegistry.fill(HIST("hPhiCharge"), phiCharge); + + // gen info (of reco events) + McGenRegistry.fill(HIST("hPtTrkPos"), p1Mc.Pt()); + McGenRegistry.fill(HIST("hPtTrkNeg"), p2Mc.Pt()); + McGenRegistry.fill(HIST("hEtaTrkPos"), p1Mc.Eta()); + McGenRegistry.fill(HIST("hEtaTrkNeg"), p2Mc.Eta()); + McGenRegistry.fill(HIST("hPhiTrkPos"), p1Mc.Phi()); + McGenRegistry.fill(HIST("hPhiTrkNeg"), p2Mc.Phi()); + McGenRegistry.fill(HIST("hMass"), pMc.M()); + McGenRegistry.fill(HIST("hPt"), pMc.Pt()); + McGenRegistry.fill(HIST("hEta"), pMc.Eta()); + McGenRegistry.fill(HIST("hRapidity"), pMc.Rapidity()); + McGenRegistry.fill(HIST("hPhi"), pMc.Phi()); + McGenRegistry.fill(HIST("hPhiAverage"), phiGenAverage); + McGenRegistry.fill(HIST("hPhiCharge"), phiGenCharge); + + // reco-gen correlations + McRecoRegistry.fill(HIST("hPtcorr"), p.Pt(), pMc.Pt()); + McRecoRegistry.fill(HIST("hRapcorr"), p.Eta(), pMc.Eta()); + McRecoRegistry.fill(HIST("hPhicorr"), p.Phi(), pMc.Phi()); + + // store the event to save it into a tree + if (tr1.sign() > 0) { + dimuReco(p.Pt(), p.Rapidity(), p.Phi(), + phiAverage, phiCharge, + p1.Pt(), p1.PseudoRapidity(), p1.Phi(), + p2.Pt(), p2.PseudoRapidity(), p2.Phi(), + // gen info + pMc.Pt(), pMc.Rapidity(), pMc.Phi(), + p1Mc.Pt(), p1Mc.PseudoRapidity(), p1Mc.Phi(), + p2Mc.Pt(), p2Mc.PseudoRapidity(), p2Mc.Phi()); + } else { + dimuReco(p.Pt(), p.Rapidity(), p.Phi(), + phiAverage, phiCharge, + p2.Pt(), p2.PseudoRapidity(), p2.Phi(), + p1.Pt(), p1.PseudoRapidity(), p1.Phi(), + // gen info + pMc.Pt(), pMc.Rapidity(), pMc.Phi(), + p2Mc.Pt(), p2Mc.PseudoRapidity(), p2Mc.Phi(), + p1Mc.Pt(), p1Mc.PseudoRapidity(), p1Mc.Phi()); + } + } + // PROCESS FUNCTION - void process(CandidatesFwd const& eventCandidates, - o2::aod::UDZdcsReduced& ZDCs, - ForwardTracks const& fwdTracks) + void processData(CandidatesFwd const& eventCandidates, + o2::aod::UDZdcsReduced& ZDCs, + ForwardTracks const& fwdTracks) { // map with the tracks @@ -434,7 +853,72 @@ struct fwdMuonsUPC { } } - PROCESS_SWITCH(fwdMuonsUPC, process, "", false); + PROCESS_SWITCH(fwdMuonsUPC, processData, "", true); + + // process MC Truth + void processMcGen(aod::UDMcCollisions const& mccollisions, aod::UDMcParticles const& McParts) + { + + // map with the tracks + std::unordered_map> tracksPerCand; + collectMcCandIDs(tracksPerCand, McParts); + + // loop over the candidates + for (const auto& item : tracksPerCand) { + int32_t trId1 = item.second[0]; + int32_t trId2 = item.second[1]; + int32_t candID = item.first; + auto cand = mccollisions.iteratorAt(candID); + auto tr1 = McParts.iteratorAt(trId1); + auto tr2 = McParts.iteratorAt(trId2); + + processMcGenCand(cand, tr1, tr2); + } + } + PROCESS_SWITCH(fwdMuonsUPC, processMcGen, "", false); + + // process reco MC (gen info included) + void processMcReco(CandidatesFwd const& eventCandidates, + CompleteFwdTracks const& fwdTracks, + aod::UDMcCollisions const& mcCandidates, + aod::UDMcParticles const& McParts) + { + std::unordered_map> tracksPerCandAll; + collectRecoCandID(tracksPerCandAll, fwdTracks); + + // loop over the candidates + for (const auto& item : tracksPerCandAll) { + if (item.second.size() != 6) { + // LOGF(info, "error: reco track(s) not gen"); + continue; + } + + int32_t trId1 = item.second[0]; + int32_t trId2 = item.second[3]; //[2] + + int32_t candID = item.first; + auto cand = eventCandidates.iteratorAt(candID); + auto tr1 = fwdTracks.iteratorAt(trId1); + auto tr2 = fwdTracks.iteratorAt(trId2); + + auto trMcId1 = item.second[1]; + auto trMcId2 = item.second[4]; + auto trMc1 = McParts.iteratorAt(trMcId1); + auto trMc2 = McParts.iteratorAt(trMcId2); + + auto mcCandID1 = mcCandidates.iteratorAt(item.second[2]); + auto mcCandID2 = mcCandidates.iteratorAt(item.second[5]); + + if (mcCandID1 != mcCandID2) { + // LOGF(info, "mc tracks belong to different collisions"); + } + + // auto mcTr1 = McParts.iteratorAt(tr1.udMcParticleId()); + // auto mcTr2 = McParts.iteratorAt(tr2.udMcParticleId()); + processMcRecoCand(cand, tr1, trMc1, tr2, trMc2); + } + } + PROCESS_SWITCH(fwdMuonsUPC, processMcReco, "", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From bfe059ff9e99cee61e7eebb92b502742a026da75 Mon Sep 17 00:00:00 2001 From: Stefano Cannito <143754257+scannito@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:40:07 +0100 Subject: [PATCH 179/459] [PWGLF] Changed filling functions in phik0sanalysis.cxx (#8738) --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 1ba49cf9944..6ad2e6a774e 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -549,7 +549,7 @@ struct phik0shortanalysis { // Fill 2D invariant mass histogram for V0 and Phi template - void fillInvMass2D(const TLorentzVector& V0, const std::vector& listPhi, float multiplicity, const std::array weights) + void fillInvMass2D(const TLorentzVector V0, const std::vector listPhi, float multiplicity, const std::array weights) { double massV0 = V0.M(); double ptV0 = V0.Pt(); @@ -582,7 +582,7 @@ struct phik0shortanalysis { // Fill Phi invariant mass vs Pion nSigmadE/dx histogram template - void fillInvMassNSigma(const TLorentzVectorAndPID& Pi, const std::vector& listPhi, float multiplicity, const std::array weights) + void fillInvMassNSigma(const TLorentzVectorAndPID Pi, const std::vector listPhi, float multiplicity, const std::array weights) { float nSigmaTPCPi = Pi.fnSigmaTPC; float nSigmaTOFPi = Pi.fnSigmaTOF; @@ -839,8 +839,8 @@ struct phik0shortanalysis { if (std::abs(vecPi.Rapidity()) > cfgyAcceptance) continue; - float nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -9.99); - float nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -9.99); + float nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -999); + float nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -999); TLorentzVectorAndPID recPi{vecPi, nsigmaTPC, nsigmaTOF}; @@ -1224,8 +1224,8 @@ struct phik0shortanalysis { continue; float nsigmaTPC, nsigmaTOF; - nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -9.99); - nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -9.99); + nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -999); + nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -999); PioneffHist.fill(HIST("h4PieffInvMass"), genmultiplicity, recPi.Pt(), nsigmaTPC, nsigmaTOF); @@ -1518,8 +1518,8 @@ struct phik0shortanalysis { if (std::abs(vecPi.Rapidity()) > cfgyAcceptance) continue; - float nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -9.99); - float nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -9.99); + float nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -999); + float nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -999); TLorentzVectorAndPID recPi{vecPi, nsigmaTPC, nsigmaTOF}; From a1d5ca950b640d8fd6ae5b5f0510994c4bbe77f0 Mon Sep 17 00:00:00 2001 From: fuchuncui <162277233+fuchuncui@users.noreply.github.com> Date: Sat, 30 Nov 2024 00:00:03 +0800 Subject: [PATCH 180/459] [PWGCF] add topological cut QA and flow uncertainties (#8729) --- PWGCF/Flow/Tasks/flowGFWOmegaXi.cxx | 263 +++++++++++++++++++++++----- 1 file changed, 221 insertions(+), 42 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowGFWOmegaXi.cxx b/PWGCF/Flow/Tasks/flowGFWOmegaXi.cxx index fba1baa6069..8a491e46d28 100644 --- a/PWGCF/Flow/Tasks/flowGFWOmegaXi.cxx +++ b/PWGCF/Flow/Tasks/flowGFWOmegaXi.cxx @@ -16,6 +16,7 @@ #include #include #include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/ASoAHelpers.h" @@ -47,6 +48,19 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +namespace +{ +std::shared_ptr REFc22[10]; +std::shared_ptr REFc24[10]; +std::shared_ptr K0sc22[10]; +std::shared_ptr K0sc24[10]; +std::shared_ptr Lambdac22[10]; +std::shared_ptr Lambdac24[10]; +std::shared_ptr Xic22[10]; +std::shared_ptr Xic24[10]; +std::shared_ptr Omegac22[10]; +std::shared_ptr Omegac24[10]; +} // namespace #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; @@ -59,6 +73,8 @@ struct FlowGFWOmegaXi { O2_DEFINE_CONFIGURABLE(cfgCutPtMax, float, 10.0f, "Maximal pT for ref tracks") 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(cfgCutOccupancyHigh, int, 500, "High cut on TPC occupancy") + O2_DEFINE_CONFIGURABLE(cfgCutOccupancyLow, int, 0, "Low cut on TPC occupancy") O2_DEFINE_CONFIGURABLE(cfgOmegaMassbins, int, 16, "Number of Omega mass axis bins for c22") O2_DEFINE_CONFIGURABLE(cfgXiMassbins, int, 14, "Number of Xi mass axis bins for c22") O2_DEFINE_CONFIGURABLE(cfgK0sMassbins, int, 80, "Number of K0s mass axis bins for c22") @@ -66,7 +82,7 @@ struct FlowGFWOmegaXi { // topological cut for V0 O2_DEFINE_CONFIGURABLE(cfgv0_radius, float, 5.0f, "minimum decay radius") O2_DEFINE_CONFIGURABLE(cfgv0_v0cospa, float, 0.995f, "minimum cosine of pointing angle") - O2_DEFINE_CONFIGURABLE(cfgv0_dcav0topv, float, 0.1f, "minimum daughter DCA to PV") + O2_DEFINE_CONFIGURABLE(cfgv0_dcadautopv, float, 0.1f, "minimum daughter DCA to PV") O2_DEFINE_CONFIGURABLE(cfgv0_dcav0dau, float, 0.5f, "maximum DCA among V0 daughters") O2_DEFINE_CONFIGURABLE(cfgv0_mk0swindow, float, 0.1f, "Invariant mass window of K0s") O2_DEFINE_CONFIGURABLE(cfgv0_mlambdawindow, float, 0.04f, "Invariant mass window of lambda") @@ -83,11 +99,17 @@ struct FlowGFWOmegaXi { // track quality and type selections O2_DEFINE_CONFIGURABLE(cfgtpcclusters, int, 70, "minimum number of TPC clusters requirement") O2_DEFINE_CONFIGURABLE(cfgitsclusters, int, 1, "minimum number of ITS clusters requirement") - O2_DEFINE_CONFIGURABLE(cfgcheckDauTPC, bool, false, "check if daughter tracks have TPC match") + O2_DEFINE_CONFIGURABLE(cfgtpcclufindable, int, 1, "minimum number of findable TPC clusters") + O2_DEFINE_CONFIGURABLE(cfgtpccrossoverfindable, int, 1, "minimum number of Ratio crossed rows over findable clusters") + O2_DEFINE_CONFIGURABLE(cfgcheckDauTPC, bool, true, "check daughter tracks TPC or not") + O2_DEFINE_CONFIGURABLE(cfgcheckDauTOF, bool, false, "check daughter tracks TOF or not") O2_DEFINE_CONFIGURABLE(cfgCasc_rapidity, float, 0.5, "rapidity") - O2_DEFINE_CONFIGURABLE(cfgNSigmaCascPion, float, 3, "NSigmaCascPion") - O2_DEFINE_CONFIGURABLE(cfgNSigmaCascProton, float, 3, "NSigmaCascProton") - O2_DEFINE_CONFIGURABLE(cfgNSigmaCascKaon, float, 3, "NSigmaCascKaon") + O2_DEFINE_CONFIGURABLE(cfgtpcNSigmaCascPion, float, 3, "NSigmaCascPion") + O2_DEFINE_CONFIGURABLE(cfgtpcNSigmaCascProton, float, 3, "NSigmaCascProton") + O2_DEFINE_CONFIGURABLE(cfgtpcNSigmaCascKaon, float, 3, "NSigmaCascKaon") + O2_DEFINE_CONFIGURABLE(cfgtofNSigmaCascPion, float, 3, "NSigmaCascPion") + O2_DEFINE_CONFIGURABLE(cfgtofNSigmaCascProton, float, 3, "NSigmaCascProton") + O2_DEFINE_CONFIGURABLE(cfgtofNSigmaCascKaon, float, 3, "NSigmaCascKaon") O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeights, bool, true, "Fill and output NUA weights") O2_DEFINE_CONFIGURABLE(cfgAcceptancePath, std::vector, (std::vector{"Users/f/fcui/NUA/NUAREFPartical", "Users/f/fcui/NUA/NUAK0s", "Users/f/fcui/NUA/NUALambda", "Users/f/fcui/NUA/NUAXi", "Users/f/fcui/NUA/NUAOmega"}), "CCDB path to acceptance object") O2_DEFINE_CONFIGURABLE(cfgEfficiencyPath, std::vector, (std::vector{"PathtoRef"}), "CCDB path to efficiency object") @@ -143,7 +165,7 @@ struct FlowGFWOmegaXi { TF1* fT0AV0AMean = nullptr; TF1* fT0AV0ASigma = nullptr; - using TracksPID = soa::Join; + using TracksPID = soa::Join; using aodTracks = soa::Filtered>; // tracks filter using aodCollisions = soa::Filtered>; // collisions filter using DaughterTracks = soa::Join; @@ -200,6 +222,20 @@ struct FlowGFWOmegaXi { registry.get(HIST("hEventCount"))->GetYaxis()->SetBinLabel(3, "XiMinus"); registry.get(HIST("hEventCount"))->GetYaxis()->SetBinLabel(4, "Omega"); + // QA + registry.add("hqaV0radiusbefore", "", {HistType::kTH1D, {{200, 0, 200}}}); + registry.add("hqaV0radiusafter", "", {HistType::kTH1D, {{200, 0, 200}}}); + registry.add("hqaV0cosPAbefore", "", {HistType::kTH1D, {{1000, 0.95, 1}}}); + registry.add("hqaV0cosPAafter", "", {HistType::kTH1D, {{1000, 0.95, 1}}}); + registry.add("hqadcaV0daubefore", "", {HistType::kTH1D, {{100, 0, 1}}}); + registry.add("hqadcaV0dauafter", "", {HistType::kTH1D, {{100, 0, 1}}}); + registry.add("hqaarm_podobefore", "", {HistType::kTH2D, {{100, -1, 1}, {50, 0, 0.3}}}); + registry.add("hqaarm_podoafter", "", {HistType::kTH2D, {{100, -1, 1}, {50, 0, 0.3}}}); + registry.add("hqadcapostoPVbefore", "", {HistType::kTH1D, {{1000, -10, 10}}}); + registry.add("hqadcapostoPVafter", "", {HistType::kTH1D, {{1000, -10, 10}}}); + registry.add("hqadcanegtoPVbefore", "", {HistType::kTH1D, {{1000, -10, 10}}}); + registry.add("hqadcanegtoPVafter", "", {HistType::kTH1D, {{1000, -10, 10}}}); + // cumulant of flow registry.add("c22", ";Centrality (%) ; C_{2}{2} ", {HistType::kTProfile, {axisMultiplicity}}); registry.add("c24", ";Centrality (%) ; C_{2}{2} ", {HistType::kTProfile, {axisMultiplicity}}); @@ -216,6 +252,19 @@ struct FlowGFWOmegaXi { registry.add("Omegac24dpt", ";pt ; C_{2}{4} ", {HistType::kTProfile3D, {cfgaxisPtXi, cfgaxisOmegaminusMassforflow, axisMultiplicity}}); registry.add("K0sc24dpt", ";pt ; C_{2}{4} ", {HistType::kTProfile3D, {cfgaxisPtV0, cfgaxisK0sMassforflow, axisMultiplicity}}); registry.add("Lambdac24dpt", ";pt ; C_{2}{4} ", {HistType::kTProfile3D, {cfgaxisPtV0, cfgaxisLambdaMassforflow, axisMultiplicity}}); + // for Jackknife + for (int i = 1; i <= 10; i++) { + REFc22[i - 1] = registry.add(Form("Jackknife/REF/c22_%d", i), ";Centrality (%) ; C_{2}{2} ", {HistType::kTProfile, {axisMultiplicity}}); + REFc24[i - 1] = registry.add(Form("Jackknife/REF/c24_%d", i), ";Centrality (%) ; C_{2}{2} ", {HistType::kTProfile, {axisMultiplicity}}); + Xic22[i - 1] = registry.add(Form("Jackknife/Xi/Xic22dpt_%d", i), ";pt ; C_{2}{2} ", {HistType::kTProfile3D, {cfgaxisPtXi, cfgaxisXiminusMassforflow, axisMultiplicity}}); + Omegac22[i - 1] = registry.add(Form("Jackknife/Omega/Omegac22dpt_%d", i), ";pt ; C_{2}{2} ", {HistType::kTProfile3D, {cfgaxisPtXi, cfgaxisOmegaminusMassforflow, axisMultiplicity}}); + K0sc22[i - 1] = registry.add(Form("Jackknife/K0s/K0sc22dpt_%d", i), ";pt ; C_{2}{2} ", {HistType::kTProfile3D, {cfgaxisPtV0, cfgaxisK0sMassforflow, axisMultiplicity}}); + Lambdac22[i - 1] = registry.add(Form("Jackknife/Lambda/Lambdac22dpt_%d", i), ";pt ; C_{2}{2} ", {HistType::kTProfile3D, {cfgaxisPtV0, cfgaxisLambdaMassforflow, axisMultiplicity}}); + Xic24[i - 1] = registry.add(Form("Jackknife/Xi/Xic24dpt_%d", i), ";pt ; C_{2}{4} ", {HistType::kTProfile3D, {cfgaxisPtXi, cfgaxisXiminusMassforflow, axisMultiplicity}}); + Omegac24[i - 1] = registry.add(Form("Jackknife/Omega/Omegac24dpt_%d", i), ";pt ; C_{2}{4} ", {HistType::kTProfile3D, {cfgaxisPtXi, cfgaxisOmegaminusMassforflow, axisMultiplicity}}); + K0sc24[i - 1] = registry.add(Form("Jackknife/K0s/K0sc24dpt_%d", i), ";pt ; C_{2}{4} ", {HistType::kTProfile3D, {cfgaxisPtV0, cfgaxisK0sMassforflow, axisMultiplicity}}); + Lambdac24[i - 1] = registry.add(Form("Jackknife/Lambda/Lambdac24dpt_%d", i), ";pt ; C_{2}{4} ", {HistType::kTProfile3D, {cfgaxisPtV0, cfgaxisLambdaMassforflow, axisMultiplicity}}); + } // InvMass(GeV) of casc and v0 registry.add("InvMassXiMinus_all", "", {HistType::kTHnSparseF, {cfgaxisPtXi, axisXiminusMass, cfgaxisEta, axisMultiplicity}}); registry.add("InvMassOmegaMinus_all", "", {HistType::kTHnSparseF, {cfgaxisPtXi, axisOmegaminusMass, cfgaxisEta, axisMultiplicity}}); @@ -252,13 +301,13 @@ struct FlowGFWOmegaXi { fLambdaMass = new TAxis(cfgLambdaMassbins, 1.08, 1.16); fGFW->AddRegion("reffull", -0.8, 0.8, 1, 1); // ("name", etamin, etamax, ptbinnum, bitmask)eta region -0.8 to 0.8 - // with (-0.5, 0.5) eta gap fGFW->AddRegion("refN10", -0.8, -0.4, 1, 1); fGFW->AddRegion("refP10", 0.4, 0.8, 1, 1); - fGFW->AddRegion("refN10dpt", -0.8, -0.4, nPtBins, 1); - fGFW->AddRegion("refP10dpt", 0.4, 0.8, nPtBins, 1); - fGFW->AddRegion("reffulldpt", -0.8, 0.8, nPtBins, 1); - fGFW->AddRegion("refoldpt", -0.8, 0.8, nPtBins, 1); + // POI + fGFW->AddRegion("poiN10dpt", -0.8, -0.4, nPtBins, 32); + fGFW->AddRegion("poiP10dpt", 0.4, 0.8, nPtBins, 32); + fGFW->AddRegion("poifulldpt", -0.8, 0.8, nPtBins, 32); + fGFW->AddRegion("poioldpt", -0.8, 0.8, nPtBins, 1); int nXiptMassBins = nXiPtBins * cfgXiMassbins; fGFW->AddRegion("poiXiPdpt", 0.4, 0.8, nXiptMassBins, 2); fGFW->AddRegion("poiXiNdpt", -0.8, -0.4, nXiptMassBins, 2); @@ -284,21 +333,22 @@ struct FlowGFWOmegaXi { fGFW->AddRegion("poiLambdaP", 0.4, 0.8, 1, 16); fGFW->AddRegion("poiLambdaN", -0.8, -0.4, 1, 16); // pushback - corrconfigs.push_back(fGFW->GetCorrelatorConfig("refP10dpt {2} refN10dpt {-2}", "Ref10Gap22dpt", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("reffulldpt reffulldpt {2 2 -2 -2}", "Ref10Gap24dpt", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiP10dpt {2} refN10 {-2}", "Poi10Gap22dpta", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiN10dpt {2} refP10 {-2}", "Poi10Gap22dptb", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poifulldpt reffull | poioldpt {2 2 -2 -2}", "Poi10Gap24dpt", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiXiPdpt {2} refN10 {-2}", "Xi10Gap22a", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiXiNdpt {2} refP10 {-2}", "Xi10Gap22b", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiXifulldpt reffull {2 2 -2 -2}", "Xi10Gap24", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiOmegaPdpt {2} refN10 {-2}", "Omega10Gap22a", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiOmegaNdpt {2} refP10 {-2}", "Omega10Gap22b", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiOmegaPdpt reffull {2 2 -2 -2}", "Xi10Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiOmegafulldpt reffull {2 2 -2 -2}", "Xi10Gap24", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sPdpt {2} refN10 {-2}", "K0short10Gap22a", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sNdpt {2} refP10 {-2}", "K0short10Gap22b", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sPdpt reffull {2 2 -2 -2}", "Xi10Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sfulldpt reffull {2 2 -2 -2}", "Xi10Gap24", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiLambdaPdpt {2} refN10 {-2}", "Lambda10Gap22a", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiLambdaNdpt {2} refP10 {-2}", "Lambda10Gap22b", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiLambdaPdpt reffull {2 2 -2 -2}", "Xi10Gap24a", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("refP10 {2} refN10 {-2}", "Ref10Gap22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiLambdafulldpt reffull {2 2 -2 -2}", "Xi10Gap24a", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refP10 {2} refN10 {-2}", "Ref10Gap22a", kFALSE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("reffull reffull {2 2 -2 -2}", "Ref10Gap24", kFALSE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sP {2} refN10 {-2}", "K0s10Gap22inta", kFALSE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiK0sN {2} refP10 {-2}", "K0s10Gap22intb", kFALSE)); @@ -335,6 +385,7 @@ struct FlowGFWOmegaXi { } } + // input HIST("name") template void FillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) { @@ -344,13 +395,29 @@ struct FlowGFWOmegaXi { return; if (!corrconf.pTDif) { val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) + if (std::fabs(val) < 1) registry.fill(tarName, cent, val, dnx); return; } return; } + // input shared_ptr + void FillProfile(const GFW::CorrConfig& corrconf, std::shared_ptr TProfile, const double& cent) + { + double dnx, val; + dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (dnx == 0) + return; + if (!corrconf.pTDif) { + val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (std::fabs(val) < 1) + TProfile->Fill(cent, val, dnx); + return; + } + return; + } + template void FillProfilepT(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const int& ptbin, const double& cent) { @@ -360,12 +427,13 @@ struct FlowGFWOmegaXi { if (dnx == 0) return; val = fGFW->Calculate(corrconf, ptbin - 1, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) { + if (std::fabs(val) < 1) { registry.fill(tarName, fPtAxis->GetBinCenter(ptbin), cent, val, dnx); } return; } + // input HIST("name") template void FillProfilepTMass(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const int& ptbin, const int& PDGCode, const float& cent) { @@ -404,13 +472,58 @@ struct FlowGFWOmegaXi { if (dnx == 0) continue; val = fGFW->Calculate(corrconf, (ptbin - 1) + ((massbin - 1) * nptbins), kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) { + if (std::fabs(val) < 1) { registry.fill(tarName, fpt->GetBinCenter(ptbin), fMass->GetBinCenter(massbin), cent, val, dnx); } } return; } + // input shared_ptr + void FillProfilepTMass(const GFW::CorrConfig& corrconf, std::shared_ptr TProfile3D, const int& ptbin, const int& PDGCode, const float& cent) + { + int nMassBins = 0; + int nptbins = 0; + TAxis* fMass = nullptr; + TAxis* fpt = nullptr; + if (PDGCode == kXiMinus) { + nMassBins = cfgXiMassbins; + nptbins = nXiPtBins; + fpt = fXiPtAxis; + fMass = fXiMass; + } else if (PDGCode == kOmegaMinus) { + nMassBins = cfgOmegaMassbins; + nptbins = nXiPtBins; + fpt = fXiPtAxis; + fMass = fOmegaMass; + } else if (PDGCode == kK0Short) { + nMassBins = cfgK0sMassbins; + nptbins = nV0PtBins; + fpt = fV0PtAxis; + fMass = fK0sMass; + } else if (PDGCode == kLambda0) { + nMassBins = cfgLambdaMassbins; + nptbins = nV0PtBins; + fpt = fV0PtAxis; + fMass = fLambdaMass; + } else { + LOGF(error, "Error, please put in correct PDGCode of K0s, Lambda, Xi or Omega"); + return; + } + for (int massbin = 1; massbin <= nMassBins; massbin++) { + float dnx = 0; + float val = 0; + dnx = fGFW->Calculate(corrconf, (ptbin - 1) + ((massbin - 1) * nptbins), kTRUE).real(); + if (dnx == 0) + continue; + val = fGFW->Calculate(corrconf, (ptbin - 1) + ((massbin - 1) * nptbins), kFALSE).real() / dnx; + if (std::fabs(val) < 1) { + TProfile3D->Fill(fpt->GetBinCenter(ptbin), fMass->GetBinCenter(massbin), cent, val, dnx); + } + } + return; + } + void loadCorrections(uint64_t timestamp) { if (correctionsLoaded) @@ -481,6 +594,10 @@ struct FlowGFWOmegaXi { // use this cut at low multiplicities with caution return false; } + if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + // no collisions in specified time range + return 0; + } float vtxz = -999; if (collision.numContrib() > 1) { vtxz = collision.posZ(); @@ -489,8 +606,9 @@ struct FlowGFWOmegaXi { vtxz = -999; } auto multNTracksPV = collision.multNTracksPV(); + auto occupancy = collision.trackOccupancyInTimeRange(); - if (abs(vtxz) > cfgCutVertex) + if (std::fabs(vtxz) > cfgCutVertex) return false; if (multNTracksPV < fMultPVCutLow->Eval(centrality)) return false; @@ -500,9 +618,11 @@ struct FlowGFWOmegaXi { return false; if (multTrk > fMultCutHigh->Eval(centrality)) return false; + if (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh) + return 0; // V0A T0A 5 sigma cut - if (abs(collision.multFV0A() - fT0AV0AMean->Eval(collision.multFT0A())) > 5 * fT0AV0ASigma->Eval(collision.multFT0A())) + if (std::fabs(collision.multFV0A() - fT0AV0AMean->Eval(collision.multFT0A())) > 5 * fT0AV0ASigma->Eval(collision.multFT0A())) return 0; return true; @@ -548,6 +668,9 @@ struct FlowGFWOmegaXi { if ((track.pt() > cfgCutPtMin) && (track.pt() < cfgCutPtMax)) { fGFW->Fill(track.eta(), ptbin, track.phi(), wacc * weff, 1); //(eta, ptbin, phi, wacc*weff, bitmask) } + if ((track.pt() > cfgCutPtPOIMin) && (track.pt() < cfgCutPtPOIMax)) { + fGFW->Fill(track.eta(), ptbin, track.phi(), wacc * weff, 32); + } if (cfgOutputNUAWeights) fWeightsREF->Fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0); } @@ -557,24 +680,44 @@ struct FlowGFWOmegaXi { auto v0negdau = v0.negTrack_as(); // check tpc int PDGCode = 0; - if (v0.qtarm() / TMath::Abs(v0.alpha()) > cfgv0_ArmPodocut && TMath::Abs(v0posdau.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(v0negdau.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(v0posdau.tofNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(v0negdau.tofNSigmaPi()) < cfgNSigmaCascPion) { + // fill QA + registry.fill(HIST("hqaarm_podobefore"), v0.alpha(), v0.qtarm()); + // check daughter TPC and TOF + if (v0.qtarm() / std::fabs(v0.alpha()) > cfgv0_ArmPodocut && + (!cfgcheckDauTPC || (std::fabs(v0posdau.tpcNSigmaPi()) < cfgtpcNSigmaCascPion && std::fabs(v0negdau.tpcNSigmaPi()) < cfgtpcNSigmaCascPion)) && + (!cfgcheckDauTOF || (std::fabs(v0posdau.tofNSigmaPi()) < cfgtofNSigmaCascPion && std::fabs(v0negdau.tofNSigmaPi()) < cfgtofNSigmaCascPion))) { registry.fill(HIST("InvMassK0s_all"), v0.pt(), v0.mK0Short(), v0.eta(), cent); if (!setCurrentParticleWeights(weff, wacc, v0, vtxz, 1)) continue; PDGCode = kK0Short; CandNum_all[0] = CandNum_all[0] + 1; - } else if (TMath::Abs(v0posdau.tpcNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(v0negdau.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(v0posdau.tofNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(v0negdau.tofNSigmaPi()) < cfgNSigmaCascPion) { + registry.fill(HIST("hqaarm_podoafter"), v0.alpha(), v0.qtarm()); + } else if ((!cfgcheckDauTPC || (std::fabs(v0posdau.tpcNSigmaPr()) < cfgtpcNSigmaCascProton && std::fabs(v0negdau.tpcNSigmaPi()) < cfgtpcNSigmaCascPion)) && + (!cfgcheckDauTOF || (std::fabs(v0posdau.tofNSigmaPr()) < cfgtofNSigmaCascProton && std::fabs(v0negdau.tofNSigmaPi()) < cfgtofNSigmaCascPion))) { registry.fill(HIST("InvMassLambda_all"), v0.pt(), v0.mLambda(), v0.eta(), cent); if (!setCurrentParticleWeights(weff, wacc, v0, vtxz, 2)) continue; PDGCode = kLambda0; CandNum_all[1] = CandNum_all[1] + 1; } + // fill QA before cut + registry.fill(HIST("hqaV0radiusbefore"), v0.v0radius()); + registry.fill(HIST("hqaV0cosPAbefore"), v0.v0cosPA()); + registry.fill(HIST("hqadcaV0daubefore"), v0.dcaV0daughters()); + registry.fill(HIST("hqadcapostoPVbefore"), v0.dcapostopv()); + registry.fill(HIST("hqadcanegtoPVbefore"), v0.dcanegtopv()); + // track quality check if (v0posdau.tpcNClsFound() < cfgtpcclusters) continue; if (v0negdau.tpcNClsFound() < cfgtpcclusters) continue; + if (v0posdau.tpcNClsFindable() < cfgtpcclufindable) + continue; + if (v0negdau.tpcNClsFindable() < cfgtpcclufindable) + continue; + if (v0posdau.tpcCrossedRowsOverFindableCls() < cfgtpccrossoverfindable) + continue; if (v0posdau.itsNCls() < cfgitsclusters) continue; if (v0negdau.itsNCls() < cfgitsclusters) @@ -586,8 +729,18 @@ struct FlowGFWOmegaXi { continue; if (v0.dcaV0daughters() > cfgv0_dcav0dau) continue; + if (std::fabs(v0.dcapostopv()) < cfgv0_dcadautopv) + continue; + if (std::fabs(v0.dcanegtopv()) < cfgv0_dcadautopv) + continue; + // fill QA after cut + registry.fill(HIST("hqaV0radiusafter"), v0.v0radius()); + registry.fill(HIST("hqaV0cosPAafter"), v0.v0cosPA()); + registry.fill(HIST("hqadcaV0dauafter"), v0.dcaV0daughters()); + registry.fill(HIST("hqadcapostoPVafter"), v0.dcapostopv()); + registry.fill(HIST("hqadcanegtoPVafter"), v0.dcanegtopv()); if (PDGCode == kK0Short) { - if (TMath::Abs(v0.mK0Short() - o2::constants::physics::MassK0Short) < cfgv0_mk0swindow) { + if (std::fabs(v0.mK0Short() - o2::constants::physics::MassK0Short) < cfgv0_mk0swindow) { CandNum[0] = CandNum[0] + 1; registry.fill(HIST("InvMassK0s"), v0.pt(), v0.mK0Short(), v0.eta(), cent); registry.fill(HIST("hEtaPhiVtxzPOIK0s"), v0.phi(), v0.eta(), vtxz, wacc); @@ -596,7 +749,7 @@ struct FlowGFWOmegaXi { fWeightsK0s->Fill(v0.phi(), v0.eta(), vtxz, v0.pt(), cent, 0); } } else if (PDGCode == kLambda0) { - if (TMath::Abs(v0.mLambda() - o2::constants::physics::MassLambda0) < cfgv0_mlambdawindow) { + if (std::fabs(v0.mLambda() - o2::constants::physics::MassLambda0) < cfgv0_mlambdawindow) { CandNum[1] = CandNum[1] + 1; registry.fill(HIST("InvMassLambda"), v0.pt(), v0.mLambda(), v0.eta(), cent); registry.fill(HIST("hEtaPhiVtxzPOILambda"), v0.phi(), v0.eta(), vtxz, wacc); @@ -616,13 +769,13 @@ struct FlowGFWOmegaXi { continue; } int PDGCode = 0; - if (casc.sign() < 0 && TMath::Abs(casc.yOmega()) < cfgCasc_rapidity && TMath::Abs(bachelor.tpcNSigmaKa()) < cfgNSigmaCascKaon && TMath::Abs(posdau.tpcNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(negdau.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(bachelor.tofNSigmaKa()) < cfgNSigmaCascKaon && TMath::Abs(posdau.tofNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(negdau.tofNSigmaPi()) < cfgNSigmaCascPion) { + if (casc.sign() < 0 && std::fabs(casc.yOmega()) < cfgCasc_rapidity && std::fabs(bachelor.tpcNSigmaKa()) < cfgtpcNSigmaCascKaon && std::fabs(posdau.tpcNSigmaPr()) < cfgtpcNSigmaCascProton && std::fabs(negdau.tpcNSigmaPi()) < cfgtpcNSigmaCascPion && std::fabs(bachelor.tofNSigmaKa()) < cfgtofNSigmaCascKaon && std::fabs(posdau.tofNSigmaPr()) < cfgtofNSigmaCascProton && std::fabs(negdau.tofNSigmaPi()) < cfgtofNSigmaCascPion) { registry.fill(HIST("InvMassOmegaMinus_all"), casc.pt(), casc.mOmega(), casc.eta(), cent); if (!setCurrentParticleWeights(weff, wacc, casc, vtxz, 4)) continue; PDGCode = kOmegaMinus; CandNum_all[3] = CandNum_all[3] + 1; - } else if (casc.sign() < 0 && TMath::Abs(casc.yXi()) < cfgCasc_rapidity && TMath::Abs(bachelor.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(posdau.tpcNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(negdau.tpcNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(bachelor.tofNSigmaPi()) < cfgNSigmaCascPion && TMath::Abs(posdau.tofNSigmaPr()) < cfgNSigmaCascProton && TMath::Abs(negdau.tofNSigmaPi()) < cfgNSigmaCascPion) { + } else if (casc.sign() < 0 && std::fabs(casc.yXi()) < cfgCasc_rapidity && std::fabs(bachelor.tpcNSigmaPi()) < cfgtpcNSigmaCascPion && std::fabs(posdau.tpcNSigmaPr()) < cfgtpcNSigmaCascProton && std::fabs(negdau.tpcNSigmaPi()) < cfgtpcNSigmaCascPion && std::fabs(bachelor.tofNSigmaPi()) < cfgtofNSigmaCascPion && std::fabs(posdau.tofNSigmaPr()) < cfgtofNSigmaCascProton && std::fabs(negdau.tofNSigmaPi()) < cfgtofNSigmaCascPion) { registry.fill(HIST("InvMassXiMinus_all"), casc.pt(), casc.mXi(), casc.eta(), cent); if (!setCurrentParticleWeights(weff, wacc, casc, vtxz, 3)) continue; @@ -646,7 +799,7 @@ struct FlowGFWOmegaXi { continue; if (casc.dcaV0daughters() > cfgcasc_dcav0dau) continue; - if (TMath::Abs(casc.mLambda() - o2::constants::physics::MassLambda0) > cfgcasc_mlambdawindow) + if (std::fabs(casc.mLambda() - o2::constants::physics::MassLambda0) > cfgcasc_mlambdawindow) continue; // track quality check if (bachelor.tpcNClsFound() < cfgtpcclusters) @@ -691,31 +844,57 @@ struct FlowGFWOmegaXi { } } // Filling cumulant with ROOT TProfile and loop for all ptBins - FillProfile(corrconfigs.at(14), HIST("c22"), cent); - FillProfile(corrconfigs.at(15), HIST("c24"), cent); - FillProfile(corrconfigs.at(16), HIST("K0sc22"), cent); + FillProfile(corrconfigs.at(15), HIST("c22"), cent); + FillProfile(corrconfigs.at(16), HIST("c24"), cent); FillProfile(corrconfigs.at(17), HIST("K0sc22"), cent); - FillProfile(corrconfigs.at(18), HIST("Lambdac22"), cent); + FillProfile(corrconfigs.at(18), HIST("K0sc22"), cent); FillProfile(corrconfigs.at(19), HIST("Lambdac22"), cent); + FillProfile(corrconfigs.at(20), HIST("Lambdac22"), cent); for (int i = 1; i <= nPtBins; i++) { FillProfilepT(corrconfigs.at(0), HIST("c22dpt"), i, cent); - FillProfilepT(corrconfigs.at(1), HIST("c24dpt"), i, cent); + FillProfilepT(corrconfigs.at(1), HIST("c22dpt"), i, cent); + FillProfilepT(corrconfigs.at(2), HIST("c24dpt"), i, cent); } for (int i = 1; i <= nV0PtBins; i++) { - FillProfilepTMass(corrconfigs.at(8), HIST("K0sc22dpt"), i, kK0Short, cent); FillProfilepTMass(corrconfigs.at(9), HIST("K0sc22dpt"), i, kK0Short, cent); - FillProfilepTMass(corrconfigs.at(10), HIST("K0sc24dpt"), i, kK0Short, cent); - FillProfilepTMass(corrconfigs.at(11), HIST("Lambdac22dpt"), i, kLambda0, cent); + FillProfilepTMass(corrconfigs.at(10), HIST("K0sc22dpt"), i, kK0Short, cent); + FillProfilepTMass(corrconfigs.at(11), HIST("K0sc24dpt"), i, kK0Short, cent); FillProfilepTMass(corrconfigs.at(12), HIST("Lambdac22dpt"), i, kLambda0, cent); - FillProfilepTMass(corrconfigs.at(13), HIST("Lambdac24dpt"), i, kLambda0, cent); + FillProfilepTMass(corrconfigs.at(13), HIST("Lambdac22dpt"), i, kLambda0, cent); + FillProfilepTMass(corrconfigs.at(14), HIST("Lambdac24dpt"), i, kLambda0, cent); } for (int i = 1; i <= nXiPtBins; i++) { - FillProfilepTMass(corrconfigs.at(2), HIST("Xic22dpt"), i, kXiMinus, cent); FillProfilepTMass(corrconfigs.at(3), HIST("Xic22dpt"), i, kXiMinus, cent); - FillProfilepTMass(corrconfigs.at(4), HIST("Xic24dpt"), i, kXiMinus, cent); - FillProfilepTMass(corrconfigs.at(5), HIST("Omegac22dpt"), i, kOmegaMinus, cent); + FillProfilepTMass(corrconfigs.at(4), HIST("Xic22dpt"), i, kXiMinus, cent); + FillProfilepTMass(corrconfigs.at(5), HIST("Xic24dpt"), i, kXiMinus, cent); FillProfilepTMass(corrconfigs.at(6), HIST("Omegac22dpt"), i, kOmegaMinus, cent); - FillProfilepTMass(corrconfigs.at(7), HIST("Omegac24dpt"), i, kOmegaMinus, cent); + FillProfilepTMass(corrconfigs.at(7), HIST("Omegac22dpt"), i, kOmegaMinus, cent); + FillProfilepTMass(corrconfigs.at(8), HIST("Omegac24dpt"), i, kOmegaMinus, cent); + } + // Fill subevents flow + TRandom3* fRdm = new TRandom3(0); + double Eventrdm = 10 * fRdm->Rndm(); + for (int j = 1; j <= 10; j++) { + if (Eventrdm > (j - 1) && Eventrdm < j) + continue; + FillProfile(corrconfigs.at(15), REFc22[j - 1], cent); + FillProfile(corrconfigs.at(16), REFc24[j - 1], cent); + for (int i = 1; i <= nV0PtBins; i++) { + FillProfilepTMass(corrconfigs.at(9), K0sc22[j - 1], i, kK0Short, cent); + FillProfilepTMass(corrconfigs.at(10), K0sc22[j - 1], i, kK0Short, cent); + FillProfilepTMass(corrconfigs.at(11), K0sc24[j - 1], i, kK0Short, cent); + FillProfilepTMass(corrconfigs.at(12), Lambdac22[j - 1], i, kLambda0, cent); + FillProfilepTMass(corrconfigs.at(13), Lambdac22[j - 1], i, kLambda0, cent); + FillProfilepTMass(corrconfigs.at(14), Lambdac24[j - 1], i, kLambda0, cent); + } + for (int i = 1; i <= nXiPtBins; i++) { + FillProfilepTMass(corrconfigs.at(3), Xic22[j - 1], i, kXiMinus, cent); + FillProfilepTMass(corrconfigs.at(4), Xic22[j - 1], i, kXiMinus, cent); + FillProfilepTMass(corrconfigs.at(5), Xic24[j - 1], i, kXiMinus, cent); + FillProfilepTMass(corrconfigs.at(6), Omegac22[j - 1], i, kOmegaMinus, cent); + FillProfilepTMass(corrconfigs.at(7), Omegac22[j - 1], i, kOmegaMinus, cent); + FillProfilepTMass(corrconfigs.at(8), Omegac24[j - 1], i, kOmegaMinus, cent); + } } } }; From c18a199a4b8f5f059aac950da73f34494879540c Mon Sep 17 00:00:00 2001 From: Evgeny Kryshen Date: Fri, 29 Nov 2024 19:36:54 +0300 Subject: [PATCH 181/459] [DPG] Using AggregatedRunInfo in eventSelectionQA (#8735) --- DPG/Tasks/AOTEvent/eventSelectionQa.cxx | 125 +++++++++++------------- 1 file changed, 57 insertions(+), 68 deletions(-) diff --git a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx index 82230b44d2c..da2cc2b5588 100644 --- a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx +++ b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx @@ -9,7 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "map" +#include +#include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -21,6 +23,7 @@ #include "CommonDataFormat/BunchFilling.h" #include "DataFormatsParameters/GRPLHCIFData.h" #include "DataFormatsParameters/GRPECSObject.h" +#include "DataFormatsParameters/AggregatedRunInfo.h" #include "TH1F.h" #include "TH2F.h" @@ -35,23 +38,23 @@ using FullTracksIU = soa::Join; struct EventSelectionQaTask { Configurable isMC{"isMC", 0, "0 - data, 1 - MC"}; - Configurable nGlobalBCs{"nGlobalBCs", 100000, "number of global bcs"}; - Configurable minOrbitConf{"minOrbit", 0, "minimum orbit"}; - Configurable nOrbitsConf{"nOrbits", 10000, "number of orbits"}; + Configurable nGlobalBCs{"nGlobalBCs", 100000, "number of global bcs"}; + Configurable minOrbitConf{"minOrbit", 0, "minimum orbit"}; + Configurable nOrbitsConf{"nOrbits", 10000, "number of orbits"}; Configurable isLowFlux{"isLowFlux", 1, "1 - low flux (pp, pPb), 0 - high flux (PbPb)"}; - uint64_t minGlobalBC = 0; Service ccdb; HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; bool* applySelection = NULL; int nBCsPerOrbit = 3564; - int lastRunNumber = -1; + int lastRun = -1; int nOrbits = nOrbitsConf; - double minOrbit = minOrbitConf; - int64_t bcSOR = 0; // global bc of the start of the first orbit, setting 0 by default for unanchored MC - int64_t nBCsPerTF = 128 * nBCsPerOrbit; // duration of TF in bcs, should be 128*3564 or 32*3564, setting 128 orbits by default sfor unanchored MC - std::bitset beamPatternA; - std::bitset beamPatternC; + int64_t minOrbit = minOrbitConf; + int64_t minGlobalBC = minOrbit * nBCsPerOrbit; + int64_t bcSOR = 0; // global bc of the start of the first orbit, setting 0 for unanchored MC + int32_t nOrbitsPerTF = 128; // 128 in 2022, 32 in 2023, setting 128 for unanchored MC + int64_t nBCsPerTF = nOrbitsPerTF * nBCsPerOrbit; // duration of TF in bcs + std::bitset bcPatternA; std::bitset bcPatternC; std::bitset bcPatternB; @@ -75,7 +78,7 @@ struct EventSelectionQaTask { void init(InitContext&) { - minGlobalBC = uint64_t(minOrbit) * nBCsPerOrbit; + minGlobalBC = minOrbit * nBCsPerOrbit; // ccdb->setURL("http://ccdb-test.cern.ch:8080"); ccdb->setURL("http://alice-ccdb.cern.ch"); @@ -439,10 +442,11 @@ struct EventSelectionQaTask { float multT0C = bc.has_ft0() ? bc.ft0().sumAmpC() : -999.f; if (bc.has_fdd()) { - for (auto amplitude : bc.fdd().chargeA()) { + auto fdd = bc.fdd(); + for (auto amplitude : fdd.chargeA()) { multFDA += amplitude; } - for (auto amplitude : bc.fdd().chargeC()) { + for (auto amplitude : fdd.chargeC()) { multFDC += amplitude; } } @@ -523,61 +527,43 @@ struct EventSelectionQaTask { aod::FT0s const&, aod::FDDs const&) { - int runNumber = bcs.iteratorAt(0).runNumber(); - uint32_t nOrbitsPerTF = 128; // 128 in 2022, 32 in 2023 - if (runNumber != lastRunNumber) { - lastRunNumber = runNumber; // do it only once - int64_t tsSOR = 0; - int64_t tsEOR = 1; - - if (runNumber >= 500000) { // access CCDB for data or anchored MC only - int64_t ts = bcs.iteratorAt(0).timestamp(); - - // access colliding and beam-gas bc patterns - auto grplhcif = ccdb->getForTimeStamp("GLO/Config/GRPLHCIF", ts); - beamPatternA = grplhcif->getBunchFilling().getBeamPattern(0); - beamPatternC = grplhcif->getBunchFilling().getBeamPattern(1); + int run = bcs.iteratorAt(0).runNumber(); + + if (run != lastRun) { + lastRun = run; + int64_t tsSOR = 0; // dummy start-of-run timestamp for unanchored MC + int64_t tsEOR = 1; // dummy end-of-run timestamp for unanchored MC + if (run >= 500000) { + auto runInfo = o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo(o2::ccdb::BasicCCDBManager::instance(), run); + // first bc of the first orbit + bcSOR = runInfo.orbitSOR * o2::constants::lhc::LHCMaxBunches; + // duration of TF in bcs + nBCsPerTF = runInfo.orbitsPerTF * o2::constants::lhc::LHCMaxBunches; + // number of orbits per TF + nOrbitsPerTF = runInfo.orbitsPerTF; + // first orbit + minOrbit = runInfo.orbitSOR; + // total number of orbits + nOrbits = runInfo.orbitEOR - runInfo.orbitSOR; + // start-of-run timestamp + tsSOR = runInfo.sor; + // end-of-run timestamp + tsEOR = runInfo.eor; + + // bc patterns + auto grplhcif = ccdb->getForTimeStamp("GLO/Config/GRPLHCIF", (tsSOR + tsEOR) / 2); + auto beamPatternA = grplhcif->getBunchFilling().getBeamPattern(0); + auto beamPatternC = grplhcif->getBunchFilling().getBeamPattern(1); bcPatternA = beamPatternA & ~beamPatternC; bcPatternC = ~beamPatternA & beamPatternC; bcPatternB = beamPatternA & beamPatternC; + // fill once per DF for (int i = 0; i < nBCsPerOrbit; i++) { - if (bcPatternA[i]) { - histos.fill(HIST("hBcA"), i); - } - if (bcPatternC[i]) { - histos.fill(HIST("hBcC"), i); - } - if (bcPatternB[i]) { - histos.fill(HIST("hBcB"), i); - } + histos.fill(HIST("hBcA"), i, bcPatternA[i] ? 1. : 0.); + histos.fill(HIST("hBcB"), i, bcPatternB[i] ? 1. : 0.); + histos.fill(HIST("hBcC"), i, bcPatternC[i] ? 1. : 0.); } - - EventSelectionParams* par = ccdb->getForTimeStamp("EventSelection/EventSelectionParams", ts); - // access orbit-reset timestamp - auto ctpx = ccdb->getForTimeStamp>("CTP/Calib/OrbitReset", ts); - int64_t tsOrbitReset = (*ctpx)[0]; // us - // access TF duration, start-of-run and end-of-run timestamps from ECS GRP - std::map metadata; - metadata["runNumber"] = Form("%d", runNumber); - auto grpecs = ccdb->getSpecific("GLO/Config/GRPECS", ts, metadata); - nOrbitsPerTF = grpecs->getNHBFPerTF(); // assuming 1 orbit = 1 HBF; nOrbitsPerTF=128 in 2022, 32 in 2023 - tsSOR = grpecs->getTimeStart(); // ms - tsEOR = grpecs->getTimeEnd(); // ms - // calculate SOR and EOR orbits - int64_t orbitSOR = (tsSOR * 1000 - tsOrbitReset) / o2::constants::lhc::LHCOrbitMUS; - int64_t orbitEOR = (tsEOR * 1000 - tsOrbitReset) / o2::constants::lhc::LHCOrbitMUS; - // adjust to the nearest TF edge - orbitSOR = orbitSOR / nOrbitsPerTF * nOrbitsPerTF + par->fTimeFrameOrbitShift; - orbitEOR = orbitEOR / nOrbitsPerTF * nOrbitsPerTF + par->fTimeFrameOrbitShift; - // set nOrbits and minOrbit used for orbit-axis binning - nOrbits = orbitEOR - orbitSOR; - minOrbit = orbitSOR; - // first bc of the first orbit (should coincide with TF start) - bcSOR = orbitSOR * o2::constants::lhc::LHCMaxBunches; - // duration of TF in bcs - nBCsPerTF = nOrbitsPerTF * o2::constants::lhc::LHCMaxBunches; - LOGP(info, "tsOrbitReset={} us, SOR = {} ms, EOR = {} ms, orbitSOR = {}, nBCsPerTF = {}", tsOrbitReset, tsSOR, tsEOR, orbitSOR, nBCsPerTF); } // create orbit-axis histograms on the fly with binning based on info from GRP if GRP is available @@ -771,12 +757,14 @@ struct EventSelectionQaTask { histos.fill(HIST("hGlobalBcFDD"), globalBC - minGlobalBC); histos.fill(HIST("hOrbitFDD"), orbit - minOrbit); histos.fill(HIST("hBcFDD"), localBC); + + auto fdd = bc.fdd(); float multFDA = 0; - for (auto amplitude : bc.fdd().chargeA()) { + for (auto amplitude : fdd.chargeA()) { multFDA += amplitude; } float multFDC = 0; - for (auto amplitude : bc.fdd().chargeC()) { + for (auto amplitude : fdd.chargeC()) { multFDC += amplitude; } histos.fill(HIST("hMultFDAall"), multFDA); @@ -829,7 +817,7 @@ struct EventSelectionQaTask { for (const auto& bc : bcs) { int64_t globalBC = bc.globalBC(); // skip non-colliding bcs for data and anchored runs - if (runNumber >= 500000 && bcPatternB[globalBC % o2::constants::lhc::LHCMaxBunches] == 0) { + if (run >= 500000 && bcPatternB[globalBC % o2::constants::lhc::LHCMaxBunches] == 0) { continue; } if (bc.selection_bit(kIsBBT0A) || bc.selection_bit(kIsBBT0C)) { @@ -982,10 +970,11 @@ struct EventSelectionQaTask { float multFDA = 0; float multFDC = 0; if (foundBC.has_fdd()) { - for (auto amplitude : foundBC.fdd().chargeA()) { + auto fdd = foundBC.fdd(); + for (auto amplitude : fdd.chargeA()) { multFDA += amplitude; } - for (auto amplitude : foundBC.fdd().chargeC()) { + for (auto amplitude : fdd.chargeC()) { multFDC += amplitude; } } From 933463e90767ce02e42459bfe080ada8f0bdde0d Mon Sep 17 00:00:00 2001 From: creetz16 <79141119+creetz16@users.noreply.github.com> Date: Fri, 29 Nov 2024 18:05:06 +0100 Subject: [PATCH 182/459] [PWGLF] Adding event mixing for hypertriton 3-body KF reconstruction (#8698) --- .../Nuspex/decay3bodybuilder.cxx | 915 ++++++++++-------- 1 file changed, 502 insertions(+), 413 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx b/PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx index 8bcbc20c98a..980c3cee06f 100644 --- a/PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx +++ b/PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx @@ -62,12 +62,12 @@ using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -using MyCollisions = soa::Join; using FullTracksExtIU = soa::Join; using FullTracksExtPIDIU = soa::Join; using ColwithEvTimes = o2::soa::Join; using FullCols = o2::soa::Join; +using ColwithEvTimesMults = o2::soa::Join; using TrackExtIUwithEvTimes = soa::Join; using TrackExtPIDIUwithEvTimes = soa::Join; @@ -116,7 +116,6 @@ struct decay3bodyBuilder { kNVtxSteps }; enum kfvtxstep { kKfVtxAll = 0, - kKfVtxCollIds, kKfVtxCharge, kKfVtxEta, kKfVtxTPCNcls, @@ -205,16 +204,20 @@ struct decay3bodyBuilder { Configurable maxDcaPiDe{"kfparticleConfigurations.maxDcaPiDe", 1000., "Maximum geometrical distance between pion and deuteron at the SV in 3D with KFParticle"}; Configurable maxDcaXYSVDau{"kfparticleConfigurations.maxDcaXYSVDau", 1.0, "Maximum geometrical distance of daughter tracks from the SV in XY with KFParticle"}; Configurable maxRapidityHt{"kfparticleConfigurations.maxRapidityHt", 1., "Maximum rapidity for Hypertriton candidates with KFParticle"}; - Configurable minPtHt{"kfparticleConfigurations.minPtHt", 0., "Minimum momentum for Hypertriton candidates with KFParticle"}; + Configurable minPtHt{"kfparticleConfigurations.minPtHt", 0.01, "Minimum momentum for Hypertriton candidates with KFParticle (0.01 applied in SVertexer)"}; Configurable maxPtHt{"kfparticleConfigurations.maxPtHt", 36., "Maximum momentum for Hypertriton candidates with KFParticle"}; Configurable minMassHt{"kfparticleConfigurations.minMassHt", 2.96, "Minimum candidate mass with KFParticle"}; Configurable maxMassHt{"kfparticleConfigurations.maxMassHt", 3.05, "Maximum candidate mass with KFParticle"}; Configurable maxctauHt{"kfparticleConfigurations.maxctauHt", 40., "Maximum candidate ctau with KFParticle before topological constraint"}; Configurable maxChi2geo{"kfparticleConfigurations.maxChi2geo", 1000., "Maximum chi2 geometrical with KFParticle"}; - Configurable minCosPA{"kfparticleConfigurations.minCosPA", 0.5, "Minimum cosine pointing angle with KFParticle"}; - Configurable minCosPAxy{"kfparticleConfigurations.minCosPAxy", 0.5, "Minimum cosine pointing angle in xy with KFParticle"}; + Configurable minCosPA{"kfparticleConfigurations.minCosPA", 0.8, "Minimum cosine pointing angle with KFParticle (0.8 applied in SVertexer)"}; + Configurable minCosPAxy{"kfparticleConfigurations.minCosPAxy", 0.8, "Minimum cosine pointing angle in xy with KFParticle"}; Configurable applyTopoSel{"kfparticleConfigurations.applyTopoSel", false, "Apply selection constraining the mother to the PV with KFParticle"}; Configurable maxChi2topo{"kfparticleConfigurations.maxChi2topo", 1000., "Maximum chi2 topological with KFParticle"}; + Configurable nEvtMixing{"kfparticleConfigurations.nEvtMixing", 5, "Number of events to mix"}; + Configurable applySVertexerCuts{"kfparticleConfigurations.applySVertexerCuts", true, "Apply SVertexer selections in event mixing case"}; + ConfigurableAxis binsVtxZ{"kfparticleConfigurations.binsVtxZ", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + ConfigurableAxis binsMultiplicity{"kfparticleConfigurations.binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 1.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f, 110.0f}, "Mixing bins - multiplicity"}; } kfparticleConfigurations; //------------------------------------------------------------------ @@ -241,6 +244,10 @@ struct decay3bodyBuilder { ConfigurableAxis axisCentrality{"axisCentrality", {10, 0, 100}, "Mixing bins - centrality"}; using BinningType = ColumnBinningPolicy; + // KF event mixing + using BinningTypeKF = ColumnBinningPolicy; + BinningTypeKF binningOnPosAndMult{{kfparticleConfigurations.binsVtxZ, kfparticleConfigurations.binsMultiplicity}, true}; + // Filters and slices // Filter collisionFilter = (aod::evsel::sel8 == true && nabs(aod::collision::posZ) < 10.f); Preslice perCollision = o2::aod::decay3body::collisionId; @@ -329,36 +336,35 @@ struct decay3bodyBuilder { registry.add("hBachelorTOFNSigmaDe", "", HistType::kTH2F, {{40, -10.0f, 10.0f, "p/z (GeV/c)"}, {40, -10.0f, 10.0f, "TOF n#sigma"}}); } - if (doprocessRun3withKFParticle == true) { + if (doprocessRun3withKFParticle == true || doprocessRun3EMwithKFParticle == true) { auto hEventCounterKFParticle = registry.add("hEventCounterKFParticle", "hEventCounterKFParticle", HistType::kTH1F, {{4, 0.0f, 4.0f}}); hEventCounterKFParticle->GetXaxis()->SetBinLabel(1, "total"); hEventCounterKFParticle->GetXaxis()->SetBinLabel(2, "sel8"); hEventCounterKFParticle->GetXaxis()->SetBinLabel(3, "vertexZ"); hEventCounterKFParticle->GetXaxis()->SetBinLabel(4, "has candidate"); hEventCounterKFParticle->LabelsOption("v"); - auto hVtx3BodyCounterKFParticle = registry.add("hVtx3BodyCounterKFParticle", "hVtx3BodyCounterKFParticle", HistType::kTH1F, {{22, 0.0f, 22.0f}}); + auto hVtx3BodyCounterKFParticle = registry.add("hVtx3BodyCounterKFParticle", "hVtx3BodyCounterKFParticle", HistType::kTH1F, {{21, 0.0f, 21.0f}}); hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(1, "Total"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(2, "CollIds"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(3, "Charge"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(4, "Eta"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(5, "TPCNcls"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(6, "TPCRows"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(7, "TPCpid"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(8, "DCAxyPV"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(9, "DCAzPV"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(10, "V0MassConst"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(11, "HasSV"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(12, "DcaDau"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(13, "DCADauVtx"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(14, "DauPt"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(15, "Rapidity"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(16, "Pt"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(17, "Mass"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(18, "CosPA"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(19, "CosPAXY"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(20, "Chi2geo"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(21, "TopoConstr"); - hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(22, "Chi2topo"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(2, "Charge"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(3, "Eta"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(4, "TPCNcls"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(5, "TPCRows"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(6, "TPCpid"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(7, "DCAxyPV"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(8, "DCAzPV"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(9, "V0MassConst"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(10, "HasSV"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(11, "DcaDau"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(12, "DCADauVtx"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(13, "DauPt"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(14, "Rapidity"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(15, "Pt"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(16, "Mass"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(17, "CosPA"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(18, "CosPAXY"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(19, "Chi2geo"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(20, "TopoConstr"); + hVtx3BodyCounterKFParticle->GetXaxis()->SetBinLabel(21, "Chi2topo"); hVtx3BodyCounterKFParticle->LabelsOption("v"); registry.add("QA/Tracks/hTrackPosTPCNcls", "hTrackPosTPCNcls", HistType::kTH1F, {{152, 0, 152, "# TPC clusters"}}); @@ -393,6 +399,19 @@ struct decay3bodyBuilder { registry.add("QA/Event/hVtxCovXZ", "hVtxCovXZ", HistType::kTH1F, {{200, -0.0001f, 0.0001f, "PV cov(XZ) (cm^{2})"}}); registry.add("QA/Event/hVtxCovYZ", "hVtxCovYZ", HistType::kTH1F, {{200, -0.0001f, 0.0001f, "PV cov(YZ) (cm^{2})"}}); } + + if (doprocessRun3EMwithKFParticle == true) { + auto hPairCounterMixing = registry.add("QA/EM/hPairCounterMixing", "hPairCounterMixing", HistType::kTH1F, {{3, 0.0f, 3.0f}}); + hPairCounterMixing->GetXaxis()->SetBinLabel(1, "total"); + hPairCounterMixing->GetXaxis()->SetBinLabel(2, "sel8"); + hPairCounterMixing->GetXaxis()->SetBinLabel(3, "vertexZ"); + hPairCounterMixing->LabelsOption("v"); + auto hCombinationCounterMixing = registry.add("QA/EM/hCombinationCounterMixing", "hCombinationCounterMixing", HistType::kTH1F, {{3, 0.0f, 3.0f}}); + hCombinationCounterMixing->GetXaxis()->SetBinLabel(1, "total"); + hCombinationCounterMixing->GetXaxis()->SetBinLabel(2, "bach sign/ID"); + hCombinationCounterMixing->GetXaxis()->SetBinLabel(3, "bach pT"); + hCombinationCounterMixing->LabelsOption("v"); + } } void initCCDB(aod::BCsWithTimestamps::iterator const& bc) @@ -693,11 +712,16 @@ struct decay3bodyBuilder { //------------------------------------------------------------------ // 3body candidate builder with KFParticle - template - void buildVtx3BodyDataTableKFParticle(TCollision const& collision, aod::Decay3Bodys const& decay3bodys, int bachelorcharge = 1) + template + void buildVtx3BodyDataTableKFParticle(TCollision const& collision, TTrack const& trackPos, TTrack const& trackNeg, TTrack const& trackBach, int64_t decay3bodyID, int bachelorcharge = 1) { LOG(debug) << "buildVtx3BodyDataTableKFParticle called."; + bool isEventMixing = false; + if (decay3bodyID == -1) { + isEventMixing = true; + } + // initialise KF primary vertex KFPVertex kfpVertex = createKFPVertexFromCollision(collision); KFParticle kfpv(kfpVertex); @@ -725,366 +749,429 @@ struct decay3bodyBuilder { registry.fill(HIST("QA/Event/hVtxCovYZ"), collision.covYZ()); } - for (auto& vtx3body : decay3bodys) { - LOG(debug) << "Entered decay3bodys loop."; - - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxAll); - - auto trackPos = vtx3body.template track0_as(); - auto trackNeg = vtx3body.template track1_as(); - auto trackBach = vtx3body.template track2_as(); - auto trackParCovPos = getTrackParCov(trackPos); - auto trackParCovNeg = getTrackParCov(trackNeg); - auto trackParCovBach = getTrackParCov(trackBach); - LOG(debug) << "Got all daughter tracks."; - - bool isMatter = trackBach.sign() > 0 ? true : false; - - // ---------- fill track QA histograms ---------- - if (kfparticleConfigurations.doTrackQA) { - registry.fill(HIST("QA/Tracks/hTrackPosTPCNcls"), trackPos.tpcNClsFound()); - registry.fill(HIST("QA/Tracks/hTrackNegTPCNcls"), trackNeg.tpcNClsFound()); - registry.fill(HIST("QA/Tracks/hTrackBachTPCNcls"), trackBach.tpcNClsFound()); - registry.fill(HIST("QA/Tracks/hTrackPosHasTPC"), trackPos.hasTPC()); - registry.fill(HIST("QA/Tracks/hTrackNegHasTPC"), trackNeg.hasTPC()); - registry.fill(HIST("QA/Tracks/hTrackBachHasTPC"), trackBach.hasTPC()); - registry.fill(HIST("QA/Tracks/hTrackBachITSClusSizes"), trackBach.itsClusterSizes()); - if (isMatter) { - registry.fill(HIST("QA/Tracks/hTrackProtonTPCPID"), trackPos.sign() * trackPos.tpcInnerParam(), trackPos.tpcNSigmaPr()); - registry.fill(HIST("QA/Tracks/hTrackPionTPCPID"), trackNeg.sign() * trackNeg.tpcInnerParam(), trackNeg.tpcNSigmaPi()); - registry.fill(HIST("QA/Tracks/hTrackProtonPt"), trackPos.pt()); - registry.fill(HIST("QA/Tracks/hTrackPionPt"), trackNeg.pt()); - } else { - registry.fill(HIST("QA/Tracks/hTrackProtonTPCPID"), trackNeg.sign() * trackNeg.tpcInnerParam(), trackNeg.tpcNSigmaPr()); - registry.fill(HIST("QA/Tracks/hTrackPionTPCPID"), trackPos.sign() * trackPos.tpcInnerParam(), trackPos.tpcNSigmaPi()); - registry.fill(HIST("QA/Tracks/hTrackProtonPt"), trackNeg.pt()); - registry.fill(HIST("QA/Tracks/hTrackPionPt"), trackPos.pt()); - } - registry.fill(HIST("QA/Tracks/hTrackBachTPCPID"), trackBach.sign() * trackBach.tpcInnerParam(), trackBach.tpcNSigmaDe()); - registry.fill(HIST("QA/Tracks/hTrackBachPt"), trackBach.pt()); - } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxAll); - // -------- STEP 1: track selection -------- - // collision ID --> not correct? tracks can have different collisions, but belong to one 3prong vertex! - // if (trackPos.collisionId() != trackNeg.collisionId() || trackPos.collisionId() != trackBach.collisionId() || trackNeg.collisionId() != trackBach.collisionId()) { - // continue; - // } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxCollIds); - // track IDs --> already checked in SVertexer! + auto trackParCovPos = getTrackParCov(trackPos); + auto trackParCovNeg = getTrackParCov(trackNeg); + auto trackParCovBach = getTrackParCov(trackBach); + LOG(debug) << "Got all daughter tracks."; - // track signs (pos, neg, bach) --> sanity check, should already be in SVertexer - if (trackPos.sign() != +1 || trackNeg.sign() != -1) { - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxCharge); + bool isMatter = trackBach.sign() > 0 ? true : false; - // track eta - if (abs(trackPos.eta()) > kfparticleConfigurations.maxEta || abs(trackNeg.eta()) > kfparticleConfigurations.maxEta || abs(trackBach.eta()) > kfparticleConfigurations.maxEta) { - continue; + // ---------- fill track QA histograms ---------- + if (kfparticleConfigurations.doTrackQA) { + registry.fill(HIST("QA/Tracks/hTrackPosTPCNcls"), trackPos.tpcNClsFound()); + registry.fill(HIST("QA/Tracks/hTrackNegTPCNcls"), trackNeg.tpcNClsFound()); + registry.fill(HIST("QA/Tracks/hTrackBachTPCNcls"), trackBach.tpcNClsFound()); + registry.fill(HIST("QA/Tracks/hTrackPosHasTPC"), trackPos.hasTPC()); + registry.fill(HIST("QA/Tracks/hTrackNegHasTPC"), trackNeg.hasTPC()); + registry.fill(HIST("QA/Tracks/hTrackBachHasTPC"), trackBach.hasTPC()); + registry.fill(HIST("QA/Tracks/hTrackBachITSClusSizes"), trackBach.itsClusterSizes()); + if (isMatter) { + registry.fill(HIST("QA/Tracks/hTrackProtonTPCPID"), trackPos.sign() * trackPos.tpcInnerParam(), trackPos.tpcNSigmaPr()); + registry.fill(HIST("QA/Tracks/hTrackPionTPCPID"), trackNeg.sign() * trackNeg.tpcInnerParam(), trackNeg.tpcNSigmaPi()); + registry.fill(HIST("QA/Tracks/hTrackProtonPt"), trackPos.pt()); + registry.fill(HIST("QA/Tracks/hTrackPionPt"), trackNeg.pt()); + } else { + registry.fill(HIST("QA/Tracks/hTrackProtonTPCPID"), trackNeg.sign() * trackNeg.tpcInnerParam(), trackNeg.tpcNSigmaPr()); + registry.fill(HIST("QA/Tracks/hTrackPionTPCPID"), trackPos.sign() * trackPos.tpcInnerParam(), trackPos.tpcNSigmaPi()); + registry.fill(HIST("QA/Tracks/hTrackProtonPt"), trackNeg.pt()); + registry.fill(HIST("QA/Tracks/hTrackPionPt"), trackPos.pt()); } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxEta); + registry.fill(HIST("QA/Tracks/hTrackBachTPCPID"), trackBach.sign() * trackBach.tpcInnerParam(), trackBach.tpcNSigmaDe()); + registry.fill(HIST("QA/Tracks/hTrackBachPt"), trackBach.pt()); + } - // number of TPC clusters - if (trackBach.tpcNClsFound() <= kfparticleConfigurations.mintpcNClsBach) { - continue; - } - if (isMatter && ((kfparticleConfigurations.useTPCforPion && trackNeg.tpcNClsFound() <= kfparticleConfigurations.mintpcNClsPion) || trackPos.tpcNClsFound() <= kfparticleConfigurations.mintpcNClsProton)) { - continue; - } else if (!isMatter && ((kfparticleConfigurations.useTPCforPion && trackPos.tpcNClsFound() <= kfparticleConfigurations.mintpcNClsPion) || trackNeg.tpcNClsFound() <= kfparticleConfigurations.mintpcNClsProton)) { - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxTPCNcls); + // -------- STEP 1: track selection -------- + // collision ID --> not correct? tracks can have different collisions, but belong to one 3prong vertex! + // if (trackPos.collisionId() != trackNeg.collisionId() || trackPos.collisionId() != trackBach.collisionId() || trackNeg.collisionId() != trackBach.collisionId()) { + // continue; + // } + // track IDs --> already checked in SVertexer! - // number of TPC crossed rows - if (trackBach.tpcNClsCrossedRows() <= kfparticleConfigurations.mintpcCrossedRows) { - continue; - } - if (isMatter && ((kfparticleConfigurations.useTPCforPion && trackNeg.tpcNClsCrossedRows() <= kfparticleConfigurations.mintpcCrossedRowsPion) || trackPos.tpcNClsCrossedRows() <= kfparticleConfigurations.mintpcCrossedRows)) { - continue; - } else if (!isMatter && ((kfparticleConfigurations.useTPCforPion && trackPos.tpcNClsCrossedRows() <= kfparticleConfigurations.mintpcCrossedRowsPion) || trackNeg.tpcNClsCrossedRows() <= kfparticleConfigurations.mintpcCrossedRows)) { - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxTPCRows); - - // TPC PID - float tpcNsigmaProton; - float tpcNsigmaPion; - float dEdxProton; - float dEdxPion; - float tpcNsigmaDeuteron = trackBach.tpcNSigmaDe(); - float tpcNsigmaPionBach = trackBach.tpcNSigmaPi(); - float dEdxDeuteron = trackBach.tpcSignal(); - if (isMatter) { // hypertriton (proton, pi-, deuteron) - tpcNsigmaProton = trackPos.tpcNSigmaPr(); - tpcNsigmaPion = trackNeg.tpcNSigmaPi(); - dEdxProton = trackPos.tpcSignal(); - dEdxPion = trackNeg.tpcSignal(); - if (!selectTPCPID(trackPos, trackNeg, trackBach)) { - continue; - } - } else if (!isMatter) { // anti-hypertriton (anti-proton, pi+, deuteron) - tpcNsigmaProton = trackNeg.tpcNSigmaPr(); - tpcNsigmaPion = trackPos.tpcNSigmaPi(); - dEdxProton = trackNeg.tpcSignal(); - dEdxPion = trackPos.tpcSignal(); - if (!selectTPCPID(trackNeg, trackPos, trackBach)) { - continue; - } - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxTPCPID); - LOG(debug) << "Basic track selections done."; + // track signs (pos, neg, bach) --> sanity check, should already be in SVertexer + if (trackPos.sign() != +1 || trackNeg.sign() != -1) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxCharge); - // TOF PID of deuteron (set motherhyp correctly) - double tofNSigmaDeuteron = -999; - if (trackBach.has_collision() && trackBach.hasTOF()) { - auto originalcol = trackBach.template collision_as(); - tofNSigmaDeuteron = bachelorTOFPID.GetTOFNSigma(trackBach, originalcol, collision); - } + // track eta + if (abs(trackPos.eta()) > kfparticleConfigurations.maxEta || abs(trackNeg.eta()) > kfparticleConfigurations.maxEta || abs(trackBach.eta()) > kfparticleConfigurations.maxEta) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxEta); - // Average ITS cluster size of deuteron track - double averageClusterSizeDeuteron(0); - int nCls(0); - for (int i = 0; i < 7; i++) { - int clusterSize = trackBach.itsClsSizeInLayer(i); - averageClusterSizeDeuteron += static_cast(clusterSize); - if (clusterSize > 0) - nCls++; - } - averageClusterSizeDeuteron = averageClusterSizeDeuteron / static_cast(nCls); - - // track DCAxy and DCAz to PV associated with decay3body - o2::dataformats::VertexBase mPV; - o2::dataformats::DCA mDcaInfoCovPos; - o2::dataformats::DCA mDcaInfoCovNeg; - o2::dataformats::DCA mDcaInfoCovBach; - auto trackParCovPVPos = trackParCovPos; - auto trackParCovPVNeg = trackParCovNeg; - auto trackParCovPVBach = trackParCovBach; - mPV.setPos({collision.posX(), collision.posY(), collision.posZ()}); - mPV.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ()); - o2::base::Propagator::Instance()->propagateToDCABxByBz(mPV, trackParCovPVPos, 2.f, matCorr, &mDcaInfoCovPos); - o2::base::Propagator::Instance()->propagateToDCABxByBz(mPV, trackParCovPVNeg, 2.f, matCorr, &mDcaInfoCovNeg); - o2::base::Propagator::Instance()->propagateToDCABxByBz(mPV, trackParCovPVBach, 2.f, matCorr, &mDcaInfoCovBach); - auto TrackPosDcaXY = mDcaInfoCovPos.getY(); - auto TrackNegDcaXY = mDcaInfoCovNeg.getY(); - auto TrackBachDcaXY = mDcaInfoCovBach.getY(); - auto TrackPosDcaZ = mDcaInfoCovPos.getZ(); - auto TrackNegDcaZ = mDcaInfoCovNeg.getZ(); - auto TrackBachDcaZ = mDcaInfoCovBach.getZ(); - if (isMatter && (fabs(TrackNegDcaXY) <= kfparticleConfigurations.mindcaXYPionPV || fabs(TrackPosDcaXY) <= kfparticleConfigurations.mindcaXYProtonPV)) { - continue; - } else if (!isMatter && (fabs(TrackPosDcaXY) <= kfparticleConfigurations.mindcaXYPionPV || fabs(TrackNegDcaXY) <= kfparticleConfigurations.mindcaXYProtonPV)) { - continue; + // number of TPC clusters + if (trackBach.tpcNClsFound() <= kfparticleConfigurations.mintpcNClsBach) { + return; + } + if (isMatter && ((kfparticleConfigurations.useTPCforPion && trackNeg.tpcNClsFound() <= kfparticleConfigurations.mintpcNClsPion) || trackPos.tpcNClsFound() <= kfparticleConfigurations.mintpcNClsProton)) { + return; + } else if (!isMatter && ((kfparticleConfigurations.useTPCforPion && trackPos.tpcNClsFound() <= kfparticleConfigurations.mintpcNClsPion) || trackNeg.tpcNClsFound() <= kfparticleConfigurations.mintpcNClsProton)) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxTPCNcls); + + // number of TPC crossed rows + if (trackBach.tpcNClsCrossedRows() <= kfparticleConfigurations.mintpcCrossedRows) { + return; + } + if (isMatter && ((kfparticleConfigurations.useTPCforPion && trackNeg.tpcNClsCrossedRows() <= kfparticleConfigurations.mintpcCrossedRowsPion) || trackPos.tpcNClsCrossedRows() <= kfparticleConfigurations.mintpcCrossedRows)) { + return; + } else if (!isMatter && ((kfparticleConfigurations.useTPCforPion && trackPos.tpcNClsCrossedRows() <= kfparticleConfigurations.mintpcCrossedRowsPion) || trackNeg.tpcNClsCrossedRows() <= kfparticleConfigurations.mintpcCrossedRows)) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxTPCRows); + + // TPC PID + float tpcNsigmaProton; + float tpcNsigmaPion; + float dEdxProton; + float dEdxPion; + float tpcNsigmaDeuteron = trackBach.tpcNSigmaDe(); + float tpcNsigmaPionBach = trackBach.tpcNSigmaPi(); + float dEdxDeuteron = trackBach.tpcSignal(); + if (isMatter) { // hypertriton (proton, pi-, deuteron) + tpcNsigmaProton = trackPos.tpcNSigmaPr(); + tpcNsigmaPion = trackNeg.tpcNSigmaPi(); + dEdxProton = trackPos.tpcSignal(); + dEdxPion = trackNeg.tpcSignal(); + if (!selectTPCPID(trackPos, trackNeg, trackBach)) { + return; } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxDCAxyPV); - if (isMatter && (fabs(TrackNegDcaZ) <= kfparticleConfigurations.mindcaZPionPV || fabs(TrackPosDcaZ) <= kfparticleConfigurations.mindcaZProtonPV)) { - continue; - } else if (!isMatter && (fabs(TrackPosDcaZ) <= kfparticleConfigurations.mindcaZPionPV || fabs(TrackNegDcaZ) <= kfparticleConfigurations.mindcaZProtonPV)) { - continue; + } else if (!isMatter) { // anti-hypertriton (anti-proton, pi+, deuteron) + tpcNsigmaProton = trackNeg.tpcNSigmaPr(); + tpcNsigmaPion = trackPos.tpcNSigmaPi(); + dEdxProton = trackNeg.tpcSignal(); + dEdxPion = trackPos.tpcSignal(); + if (!selectTPCPID(trackNeg, trackPos, trackBach)) { + return; } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxDCAzPV); - // calculate 3D track DCA - auto TrackPosDca = std::sqrt(TrackPosDcaXY * TrackPosDcaXY + TrackPosDcaZ * TrackPosDcaZ); - auto TrackNegDca = std::sqrt(TrackNegDcaXY * TrackNegDcaXY + TrackNegDcaZ * TrackNegDcaZ); - auto TrackBachDca = std::sqrt(TrackBachDcaXY * TrackBachDcaXY + TrackBachDcaZ * TrackBachDcaZ); - - // daughter track momentum at inner wall of TPC - float tpcInnerParamProton; - float tpcInnerParamPion; - float tpcInnerParamDeuteron = trackBach.tpcInnerParam(); - if (isMatter) { // hypertriton (proton, pi-, deuteron) - tpcInnerParamProton = trackPos.tpcInnerParam(); - tpcInnerParamPion = trackNeg.tpcInnerParam(); - } else if (!isMatter) { // anti-hypertriton (anti-proton, pi+, deuteron) - tpcInnerParamProton = trackNeg.tpcInnerParam(); - tpcInnerParamPion = trackPos.tpcInnerParam(); + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxTPCPID); + LOG(debug) << "Basic track selections done."; + + // TOF PID of deuteron (set motherhyp correctly) + double tofNSigmaDeuteron = -999; + if (trackBach.has_collision() && trackBach.hasTOF()) { + if (isEventMixing) { + tofNSigmaDeuteron = bachelorTOFPID.GetTOFNSigma(trackBach, collision, collision); + } else { + auto originalcol = trackBach.template collision_as(); + tofNSigmaDeuteron = bachelorTOFPID.GetTOFNSigma(trackBach, originalcol, collision); } + } - // -------- STEP 2: fit vertex with proton and pion -------- - // Fit vertex with DCA fitter to find minimization point --> uses material corrections implicitly - if (kfparticleConfigurations.doDCAFitterPreMinimum) { - try { - fitter3body.process(trackParCovPos, trackParCovNeg, trackParCovBach); - } catch (std::runtime_error& e) { - LOG(error) << "Exception caught in DCA fitter process call: Not able to fit decay3body vertex!"; - continue; - } - // re-acquire tracks at vertex position from DCA fitter - trackParCovPos = fitter3body.getTrack(0); - trackParCovNeg = fitter3body.getTrack(1); - trackParCovBach = fitter3body.getTrack(2); - - LOG(debug) << "Minimum found with DCA fitter for decay3body."; - } + // Average ITS cluster size of deuteron track + double averageClusterSizeDeuteron(0); + int nCls(0); + for (int i = 0; i < 7; i++) { + int clusterSize = trackBach.itsClsSizeInLayer(i); + averageClusterSizeDeuteron += static_cast(clusterSize); + if (clusterSize > 0) + nCls++; + } + averageClusterSizeDeuteron = averageClusterSizeDeuteron / static_cast(nCls); + + /// TODO: check to which PV bachelor DCA has to be calculated in event mixing case and add it here + // track DCAxy and DCAz to PV associated with decay3body + o2::dataformats::VertexBase mPV; + o2::dataformats::DCA mDcaInfoCovPos; + o2::dataformats::DCA mDcaInfoCovNeg; + o2::dataformats::DCA mDcaInfoCovBach; + auto trackParCovPVPos = trackParCovPos; + auto trackParCovPVNeg = trackParCovNeg; + auto trackParCovPVBach = trackParCovBach; + mPV.setPos({collision.posX(), collision.posY(), collision.posZ()}); + mPV.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ()); + o2::base::Propagator::Instance()->propagateToDCABxByBz(mPV, trackParCovPVPos, 2.f, matCorr, &mDcaInfoCovPos); + o2::base::Propagator::Instance()->propagateToDCABxByBz(mPV, trackParCovPVNeg, 2.f, matCorr, &mDcaInfoCovNeg); + o2::base::Propagator::Instance()->propagateToDCABxByBz(mPV, trackParCovPVBach, 2.f, matCorr, &mDcaInfoCovBach); + auto TrackPosDcaXY = mDcaInfoCovPos.getY(); + auto TrackNegDcaXY = mDcaInfoCovNeg.getY(); + auto TrackBachDcaXY = mDcaInfoCovBach.getY(); + auto TrackPosDcaZ = mDcaInfoCovPos.getZ(); + auto TrackNegDcaZ = mDcaInfoCovNeg.getZ(); + auto TrackBachDcaZ = mDcaInfoCovBach.getZ(); + // calculate 3D track DCA + auto TrackPosDca = std::sqrt(TrackPosDcaXY * TrackPosDcaXY + TrackPosDcaZ * TrackPosDcaZ); + auto TrackNegDca = std::sqrt(TrackNegDcaXY * TrackNegDcaXY + TrackNegDcaZ * TrackNegDcaZ); + auto TrackBachDca = std::sqrt(TrackBachDcaXY * TrackBachDcaXY + TrackBachDcaZ * TrackBachDcaZ); + // selection + if (isMatter && (fabs(TrackNegDcaXY) <= kfparticleConfigurations.mindcaXYPionPV || fabs(TrackPosDcaXY) <= kfparticleConfigurations.mindcaXYProtonPV)) { + return; + } else if (!isMatter && (fabs(TrackPosDcaXY) <= kfparticleConfigurations.mindcaXYPionPV || fabs(TrackNegDcaXY) <= kfparticleConfigurations.mindcaXYProtonPV)) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxDCAxyPV); + if (isMatter && (fabs(TrackNegDcaZ) <= kfparticleConfigurations.mindcaZPionPV || fabs(TrackPosDcaZ) <= kfparticleConfigurations.mindcaZProtonPV)) { + return; + } else if (!isMatter && (fabs(TrackPosDcaZ) <= kfparticleConfigurations.mindcaZPionPV || fabs(TrackNegDcaZ) <= kfparticleConfigurations.mindcaZProtonPV)) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxDCAzPV); + // SVertexer selection bachelor track for event mixing + if (isEventMixing && kfparticleConfigurations.applySVertexerCuts && TrackBachDca < 0.05) { + return; + } - // create KFParticle objects from tracks - KFParticle kfpProton, kfpPion; - if (isMatter) { - kfpProton = createKFParticleFromTrackParCov(trackParCovPos, trackPos.sign(), constants::physics::MassProton); - kfpPion = createKFParticleFromTrackParCov(trackParCovNeg, trackNeg.sign(), constants::physics::MassPionCharged); - } else if (!isMatter) { - kfpProton = createKFParticleFromTrackParCov(trackParCovNeg, trackNeg.sign(), constants::physics::MassProton); - kfpPion = createKFParticleFromTrackParCov(trackParCovPos, trackPos.sign(), constants::physics::MassPionCharged); - } - LOG(debug) << "KFParticle objects created from daughter tracks."; + // daughter track momentum at inner wall of TPC + float tpcInnerParamProton; + float tpcInnerParamPion; + float tpcInnerParamDeuteron = trackBach.tpcInnerParam(); + if (isMatter) { // hypertriton (proton, pi-, deuteron) + tpcInnerParamProton = trackPos.tpcInnerParam(); + tpcInnerParamPion = trackNeg.tpcInnerParam(); + } else if (!isMatter) { // anti-hypertriton (anti-proton, pi+, deuteron) + tpcInnerParamProton = trackNeg.tpcInnerParam(); + tpcInnerParamPion = trackPos.tpcInnerParam(); + } - // Construct V0 as intermediate step - KFParticle KFV0; - int nDaughtersV0 = 2; - const KFParticle* DaughtersV0[2] = {&kfpProton, &kfpPion}; - KFV0.SetConstructMethod(2); + // -------- STEP 2: fit vertex with proton and pion -------- + // Fit vertex with DCA fitter to find minimization point --> uses material corrections implicitly + if (kfparticleConfigurations.doDCAFitterPreMinimum) { try { - KFV0.Construct(DaughtersV0, nDaughtersV0); + fitter3body.process(trackParCovPos, trackParCovNeg, trackParCovBach); } catch (std::runtime_error& e) { - LOG(debug) << "Failed to create V0 vertex from daughter tracks." << e.what(); - continue; - } - KFV0.TransportToDecayVertex(); - LOG(debug) << "V0 constructed."; - - // check V0 mass and set mass constraint - float massV0, sigmaMassV0; - KFV0.GetMass(massV0, sigmaMassV0); - KFParticle KFV0Mass = KFV0; - KFV0Mass.SetNonlinearMassConstraint(o2::constants::physics::MassLambda); - float chi2massV0 = KFV0Mass.GetChi2() / KFV0Mass.GetNDF(); - if (kfparticleConfigurations.useLambdaMassConstraint) { - LOG(debug) << "V0 mass constraint applied."; - KFV0 = KFV0Mass; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxV0MassConst); - - // -------- STEP 3: fit three body vertex -------- - // Create KFParticle object from deuteron track - KFParticle kfpDeuteron; - kfpDeuteron = createKFParticleFromTrackParCov(trackParCovBach, trackBach.sign() * bachelorcharge, constants::physics::MassDeuteron); - LOG(debug) << "KFParticle created from deuteron track."; - // Construct 3body vertex - int nDaughters3body = 3; - const KFParticle* Daughters3body[3] = {&kfpProton, &kfpPion, &kfpDeuteron}; - KFParticle KFHt; - KFHt.SetConstructMethod(2); - try { - KFHt.Construct(Daughters3body, nDaughters3body); - } catch (std::runtime_error& e) { - LOG(debug) << "Failed to create Hyper triton 3-body vertex." << e.what(); - continue; - } - // transport all daughter tracks to hypertriton vertex - float HtVtx[3] = {0.}; - HtVtx[0] = KFHt.GetX(); - HtVtx[1] = KFHt.GetY(); - HtVtx[2] = KFHt.GetZ(); - kfpProton.TransportToPoint(HtVtx); - kfpPion.TransportToPoint(HtVtx); - kfpDeuteron.TransportToPoint(HtVtx); - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxhasSV); - LOG(debug) << "Hypertriton vertex constructed."; - - // -------- STEP 4: selections after geometrical vertex fit -------- - // daughter DCAs with KF - if ((kfpProton.GetDistanceFromParticle(kfpPion) >= kfparticleConfigurations.maxDcaProPi) || (kfpProton.GetDistanceFromParticle(kfpDeuteron) >= kfparticleConfigurations.maxDcaProDeu) || (kfpPion.GetDistanceFromParticle(kfpDeuteron) >= kfparticleConfigurations.maxDcaPiDe)) { - continue; + LOG(error) << "Exception caught in DCA fitter process call: Not able to fit decay3body vertex!"; + return; } - float DCAvtxDaughters3D = kfpProton.GetDistanceFromParticle(kfpPion) + kfpProton.GetDistanceFromParticle(kfpDeuteron) + kfpPion.GetDistanceFromParticle(kfpDeuteron); - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxDcaDau); - LOG(debug) << "DCA selection after vertex fit applied."; + // re-acquire tracks at vertex position from DCA fitter + trackParCovPos = fitter3body.getTrack(0); + trackParCovNeg = fitter3body.getTrack(1); + trackParCovBach = fitter3body.getTrack(2); - // daughter DCAs to vertex - if (kfpProton.GetDistanceFromVertexXY(KFHt) >= kfparticleConfigurations.maxDcaXYSVDau || kfpPion.GetDistanceFromVertexXY(KFHt) >= kfparticleConfigurations.maxDcaXYSVDau || kfpDeuteron.GetDistanceFromVertexXY(KFHt) >= kfparticleConfigurations.maxDcaXYSVDau) { - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxDcaDauVtx); - LOG(debug) << "DCA to vertex selection after vertex fit applied."; + LOG(debug) << "Minimum found with DCA fitter for decay3body."; + } - // daughter pT - if (kfpProton.GetPt() < kfparticleConfigurations.minPtProton || kfpProton.GetPt() > kfparticleConfigurations.maxPtProton || kfpPion.GetPt() < kfparticleConfigurations.minPtPion || kfpPion.GetPt() > kfparticleConfigurations.maxPtPion || kfpDeuteron.GetPt() < kfparticleConfigurations.minPtDeuteron || kfpDeuteron.GetPt() > kfparticleConfigurations.maxPtDeuteron) { - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxDauPt); - LOG(debug) << "Daughter pT selection applied."; + // create KFParticle objects from tracks + KFParticle kfpProton, kfpPion; + if (isMatter) { + kfpProton = createKFParticleFromTrackParCov(trackParCovPos, trackPos.sign(), constants::physics::MassProton); + kfpPion = createKFParticleFromTrackParCov(trackParCovNeg, trackNeg.sign(), constants::physics::MassPionCharged); + } else if (!isMatter) { + kfpProton = createKFParticleFromTrackParCov(trackParCovNeg, trackNeg.sign(), constants::physics::MassProton); + kfpPion = createKFParticleFromTrackParCov(trackParCovPos, trackPos.sign(), constants::physics::MassPionCharged); + } + LOG(debug) << "KFParticle objects created from daughter tracks."; + + // Construct V0 as intermediate step + KFParticle KFV0; + int nDaughtersV0 = 2; + const KFParticle* DaughtersV0[2] = {&kfpProton, &kfpPion}; + KFV0.SetConstructMethod(2); + try { + KFV0.Construct(DaughtersV0, nDaughtersV0); + } catch (std::runtime_error& e) { + LOG(debug) << "Failed to create V0 vertex from daughter tracks." << e.what(); + return; + } + KFV0.TransportToDecayVertex(); + LOG(debug) << "V0 constructed."; + + // check V0 mass and set mass constraint + float massV0, sigmaMassV0; + KFV0.GetMass(massV0, sigmaMassV0); + KFParticle KFV0Mass = KFV0; + KFV0Mass.SetNonlinearMassConstraint(o2::constants::physics::MassLambda); + float chi2massV0 = KFV0Mass.GetChi2() / KFV0Mass.GetNDF(); + if (kfparticleConfigurations.useLambdaMassConstraint) { + LOG(debug) << "V0 mass constraint applied."; + KFV0 = KFV0Mass; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxV0MassConst); + + // -------- STEP 3: fit three body vertex -------- + // Create KFParticle object from deuteron track + KFParticle kfpDeuteron; + kfpDeuteron = createKFParticleFromTrackParCov(trackParCovBach, trackBach.sign() * bachelorcharge, constants::physics::MassDeuteron); + LOG(debug) << "KFParticle created from deuteron track."; + // Construct 3body vertex + int nDaughters3body = 3; + const KFParticle* Daughters3body[3] = {&kfpProton, &kfpPion, &kfpDeuteron}; + KFParticle KFHt; + KFHt.SetConstructMethod(2); + try { + KFHt.Construct(Daughters3body, nDaughters3body); + } catch (std::runtime_error& e) { + LOG(debug) << "Failed to create Hyper triton 3-body vertex." << e.what(); + return; + } + // transport all daughter tracks to hypertriton vertex + float HtVtx[3] = {0.}; + HtVtx[0] = KFHt.GetX(); + HtVtx[1] = KFHt.GetY(); + HtVtx[2] = KFHt.GetZ(); + kfpProton.TransportToPoint(HtVtx); + kfpPion.TransportToPoint(HtVtx); + kfpDeuteron.TransportToPoint(HtVtx); + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxhasSV); + LOG(debug) << "Hypertriton vertex constructed."; + + // -------- STEP 4: daughter selections after geometrical vertex fit -------- + // daughter DCAs with KF + if ((kfpProton.GetDistanceFromParticle(kfpPion) >= kfparticleConfigurations.maxDcaProPi) || (kfpProton.GetDistanceFromParticle(kfpDeuteron) >= kfparticleConfigurations.maxDcaProDeu) || (kfpPion.GetDistanceFromParticle(kfpDeuteron) >= kfparticleConfigurations.maxDcaPiDe)) { + return; + } + float DCAvtxDaughters3D = kfpProton.GetDistanceFromParticle(kfpPion) + kfpProton.GetDistanceFromParticle(kfpDeuteron) + kfpPion.GetDistanceFromParticle(kfpDeuteron); + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxDcaDau); + LOG(debug) << "DCA selection after vertex fit applied."; - // -------- STEP 5: candidate selection after geometrical vertex fit -------- - // Rapidity - float rapHt = RecoDecay::y(std::array{KFHt.GetPx(), KFHt.GetPy(), KFHt.GetPz()}, o2::constants::physics::MassHyperTriton); - if (std::abs(rapHt) > kfparticleConfigurations.maxRapidityHt) { - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxRap); + // daughter DCAs to vertex + if (kfpProton.GetDistanceFromVertexXY(KFHt) >= kfparticleConfigurations.maxDcaXYSVDau || kfpPion.GetDistanceFromVertexXY(KFHt) >= kfparticleConfigurations.maxDcaXYSVDau || kfpDeuteron.GetDistanceFromVertexXY(KFHt) >= kfparticleConfigurations.maxDcaXYSVDau) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxDcaDauVtx); + LOG(debug) << "DCA to vertex selection after vertex fit applied."; - // Pt selection - if (KFHt.GetPt() <= kfparticleConfigurations.minPtHt || KFHt.GetPt() >= kfparticleConfigurations.maxPtHt) { - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxPt); + // daughter pT + if (kfpProton.GetPt() < kfparticleConfigurations.minPtProton || kfpProton.GetPt() > kfparticleConfigurations.maxPtProton || kfpPion.GetPt() < kfparticleConfigurations.minPtPion || kfpPion.GetPt() > kfparticleConfigurations.maxPtPion || kfpDeuteron.GetPt() < kfparticleConfigurations.minPtDeuteron || kfpDeuteron.GetPt() > kfparticleConfigurations.maxPtDeuteron) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxDauPt); + LOG(debug) << "Daughter pT selection applied."; - // Mass window - float massHt, sigmaMassHt; - KFHt.GetMass(massHt, sigmaMassHt); - if (massHt <= kfparticleConfigurations.minMassHt || massHt >= kfparticleConfigurations.maxMassHt) { - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxMass); + // -------- STEP 5: candidate selection after geometrical vertex fit -------- + // Rapidity + float rapHt = RecoDecay::y(std::array{KFHt.GetPx(), KFHt.GetPy(), KFHt.GetPz()}, o2::constants::physics::MassHyperTriton); + if (std::abs(rapHt) > kfparticleConfigurations.maxRapidityHt) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxRap); - // cos(PA) to PV - if (std::abs(cpaFromKF(KFHt, kfpv)) <= kfparticleConfigurations.minCosPA) { - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxCosPA); + // Pt selection + if (KFHt.GetPt() <= kfparticleConfigurations.minPtHt || KFHt.GetPt() >= kfparticleConfigurations.maxPtHt) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxPt); - // cos(PA) xy to PV - if (std::abs(cpaXYFromKF(KFHt, kfpv)) <= kfparticleConfigurations.minCosPAxy) { - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxCosPAXY); + // Mass window + float massHt, sigmaMassHt; + KFHt.GetMass(massHt, sigmaMassHt); + if (massHt <= kfparticleConfigurations.minMassHt || massHt >= kfparticleConfigurations.maxMassHt) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxMass); - // chi2 geometrical - float chi2geoNDF = KFHt.GetChi2() / KFHt.GetNDF(); - if (chi2geoNDF >= kfparticleConfigurations.maxChi2geo) { - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxChi2geo); - LOG(debug) << "Basic selections after vertex fit done."; + // cos(PA) to PV + if (std::abs(cpaFromKF(KFHt, kfpv)) <= kfparticleConfigurations.minCosPA) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxCosPA); - // ctau before topo constraint - if (KFHt.GetLifeTime() > kfparticleConfigurations.maxctauHt) { - return; - } + // cos(PA) xy to PV + if (std::abs(cpaXYFromKF(KFHt, kfpv)) <= kfparticleConfigurations.minCosPAxy) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxCosPAXY); - // -------- STEP 6: topological constraint -------- - /// Set vertex constraint and topological selection - KFParticle KFHtPV = KFHt; - try { - KFHtPV.SetProductionVertex(kfpv); - } catch (std::runtime_error& e) { - LOG(error) << "Exception caught KFParticle process call: Topological constraint failed"; - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxTopoConstr); // to check if topo constraint fails - // get topological chi2 - float chi2topoNDF = KFHtPV.GetChi2() / KFHtPV.GetNDF(); - KFHtPV.TransportToDecayVertex(); - if (kfparticleConfigurations.applyTopoSel && chi2topoNDF >= kfparticleConfigurations.maxChi2topo) { - continue; - } - registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxChi2topo); + // chi2 geometrical + float chi2geoNDF = KFHt.GetChi2() / KFHt.GetNDF(); + if (chi2geoNDF >= kfparticleConfigurations.maxChi2geo) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxChi2geo); + LOG(debug) << "Basic selections after vertex fit done."; + + // ctau before topo constraint + if (KFHt.GetLifeTime() > kfparticleConfigurations.maxctauHt) { + return; + } + + // -------- STEP 6: topological constraint -------- + /// Set vertex constraint and topological selection + KFParticle KFHtPV = KFHt; + try { + KFHtPV.SetProductionVertex(kfpv); + } catch (std::runtime_error& e) { + LOG(error) << "Exception caught KFParticle process call: Topological constraint failed"; + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxTopoConstr); // to check if topo constraint fails + // get topological chi2 + float chi2topoNDF = KFHtPV.GetChi2() / KFHtPV.GetNDF(); + KFHtPV.TransportToDecayVertex(); + if (kfparticleConfigurations.applyTopoSel && chi2topoNDF >= kfparticleConfigurations.maxChi2topo) { + return; + } + registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxChi2topo); - //------------------------------------------------------------------ - // table filling - kfvtx3bodydata( - collision.globalIndex(), trackPos.globalIndex(), trackNeg.globalIndex(), trackBach.globalIndex(), vtx3body.globalIndex(), + // additional selections from SVertexer for event mixing + float radius3body = sqrt(KFHt.GetX() * KFHt.GetX() + KFHt.GetY() * KFHt.GetY()); + float radiusV0 = sqrt(KFV0.GetX() * KFV0.GetX() + KFV0.GetY() * KFV0.GetY()); + float radiusTrackBachIU = sqrt(trackBach.x() * trackBach.x() + trackBach.y() * trackBach.y()); + if (isEventMixing && kfparticleConfigurations.applySVertexerCuts && (abs(radiusV0 - radius3body) > 3 || (radiusTrackBachIU - radius3body) > 50 || (radius3body - radiusTrackBachIU) > 1)) { + return; + } + + //------------------------------------------------------------------ + // table filling + kfvtx3bodydata( + collision.globalIndex(), trackPos.globalIndex(), trackNeg.globalIndex(), trackBach.globalIndex(), decay3bodyID, + // hypertriton + massHt, + KFHt.GetX(), KFHt.GetY(), KFHt.GetZ(), + KFHt.GetErrX(), KFHt.GetErrY(), KFHt.GetErrZ(), + KFHt.GetPx(), KFHt.GetPy(), KFHt.GetPz(), KFHt.GetPt(), + KFHt.GetErrPx(), KFHt.GetErrPy(), KFHt.GetErrPz(), KFHt.GetErrPt(), + KFHt.GetQ(), + KFHt.GetDistanceFromVertex(kfpv), KFHt.GetDistanceFromVertexXY(kfpv), + cpaFromKF(KFHt, kfpv), // before topo constraint + cpaXYFromKF(KFHt, kfpv), + cpaFromKF(KFHtPV, kfpv), // after topo constraint + cpaXYFromKF(KFHtPV, kfpv), + KFHtPV.GetDecayLength(), KFHtPV.GetDecayLengthXY(), // decay length defined after topological constraint + KFHtPV.GetDecayLength() / KFHtPV.GetErrDecayLength(), // ldl + chi2geoNDF, chi2topoNDF, + KFHtPV.GetLifeTime(), + // V0 + massV0, chi2massV0, + cpaFromKF(KFV0, kfpv), + // daughter momenta at vertex + kfpProton.GetPx(), kfpProton.GetPy(), kfpProton.GetPz(), + kfpPion.GetPx(), kfpPion.GetPy(), kfpPion.GetPz(), + kfpDeuteron.GetPx(), kfpDeuteron.GetPy(), kfpDeuteron.GetPz(), + // daughter momenta at inner wall of TPC + tpcInnerParamProton, tpcInnerParamPion, tpcInnerParamDeuteron, + // daughter DCAs KF + kfpProton.GetDistanceFromVertex(kfpv), + kfpPion.GetDistanceFromVertex(kfpv), + kfpDeuteron.GetDistanceFromVertex(kfpv), + kfpProton.GetDistanceFromVertexXY(kfpv), + kfpPion.GetDistanceFromVertexXY(kfpv), + kfpDeuteron.GetDistanceFromVertexXY(kfpv), + kfpProton.GetDistanceFromVertexXY(KFHt), + kfpPion.GetDistanceFromVertexXY(KFHt), + kfpDeuteron.GetDistanceFromVertexXY(KFHt), + kfpProton.GetDistanceFromParticle(kfpPion), + kfpProton.GetDistanceFromParticle(kfpDeuteron), + kfpPion.GetDistanceFromParticle(kfpDeuteron), + DCAvtxDaughters3D, + // daughter DCAs to PV in XY propagated with material + TrackPosDcaXY, TrackNegDcaXY, TrackBachDcaXY, + // daughter DCAs to PV in 3D propagated with material + TrackPosDca, TrackNegDca, TrackBachDca, + // daughter signs + kfpProton.GetQ(), + kfpPion.GetQ(), + trackBach.sign(), + // daughter PID + tpcNsigmaProton, tpcNsigmaPion, tpcNsigmaDeuteron, tpcNsigmaPionBach, + dEdxProton, dEdxPion, dEdxDeuteron, + tofNSigmaDeuteron, + averageClusterSizeDeuteron, + trackBach.pidForTracking()); + + if (kfparticleConfigurations.fillCandidateLiteTable) { + kfvtx3bodydatalite( // hypertriton massHt, KFHt.GetX(), KFHt.GetY(), KFHt.GetZ(), - KFHt.GetErrX(), KFHt.GetErrY(), KFHt.GetErrZ(), KFHt.GetPx(), KFHt.GetPy(), KFHt.GetPz(), KFHt.GetPt(), - KFHt.GetErrPx(), KFHt.GetErrPy(), KFHt.GetErrPz(), KFHt.GetErrPt(), KFHt.GetQ(), KFHt.GetDistanceFromVertex(kfpv), KFHt.GetDistanceFromVertexXY(kfpv), cpaFromKF(KFHt, kfpv), // before topo constraint cpaXYFromKF(KFHt, kfpv), - cpaFromKF(KFHtPV, kfpv), // after topo constraint - cpaXYFromKF(KFHtPV, kfpv), KFHtPV.GetDecayLength(), KFHtPV.GetDecayLengthXY(), // decay length defined after topological constraint KFHtPV.GetDecayLength() / KFHtPV.GetErrDecayLength(), // ldl chi2geoNDF, chi2topoNDF, @@ -1112,10 +1199,6 @@ struct decay3bodyBuilder { kfpProton.GetDistanceFromParticle(kfpDeuteron), kfpPion.GetDistanceFromParticle(kfpDeuteron), DCAvtxDaughters3D, - // daughter DCAs to PV in XY propagated with material - TrackPosDcaXY, TrackNegDcaXY, TrackBachDcaXY, - // daughter DCAs to PV in 3D propagated with material - TrackPosDca, TrackNegDca, TrackBachDca, // daughter signs kfpProton.GetQ(), kfpPion.GetQ(), @@ -1126,60 +1209,11 @@ struct decay3bodyBuilder { tofNSigmaDeuteron, averageClusterSizeDeuteron, trackBach.pidForTracking()); - - if (kfparticleConfigurations.fillCandidateLiteTable) { - kfvtx3bodydatalite( - // hypertriton - massHt, - KFHt.GetX(), KFHt.GetY(), KFHt.GetZ(), - KFHt.GetPx(), KFHt.GetPy(), KFHt.GetPz(), KFHt.GetPt(), - KFHt.GetQ(), - KFHt.GetDistanceFromVertex(kfpv), KFHt.GetDistanceFromVertexXY(kfpv), - cpaFromKF(KFHt, kfpv), // before topo constraint - cpaXYFromKF(KFHt, kfpv), - KFHtPV.GetDecayLength(), KFHtPV.GetDecayLengthXY(), // decay length defined after topological constraint - KFHtPV.GetDecayLength() / KFHtPV.GetErrDecayLength(), // ldl - chi2geoNDF, chi2topoNDF, - KFHtPV.GetLifeTime(), - // V0 - massV0, chi2massV0, - cpaFromKF(KFV0, kfpv), - // daughter momenta at vertex - kfpProton.GetPx(), kfpProton.GetPy(), kfpProton.GetPz(), - kfpPion.GetPx(), kfpPion.GetPy(), kfpPion.GetPz(), - kfpDeuteron.GetPx(), kfpDeuteron.GetPy(), kfpDeuteron.GetPz(), - // daughter momenta at inner wall of TPC - tpcInnerParamProton, tpcInnerParamPion, tpcInnerParamDeuteron, - // daughter DCAs KF - kfpProton.GetDistanceFromVertex(kfpv), - kfpPion.GetDistanceFromVertex(kfpv), - kfpDeuteron.GetDistanceFromVertex(kfpv), - kfpProton.GetDistanceFromVertexXY(kfpv), - kfpPion.GetDistanceFromVertexXY(kfpv), - kfpDeuteron.GetDistanceFromVertexXY(kfpv), - kfpProton.GetDistanceFromVertexXY(KFHt), - kfpPion.GetDistanceFromVertexXY(KFHt), - kfpDeuteron.GetDistanceFromVertexXY(KFHt), - kfpProton.GetDistanceFromParticle(kfpPion), - kfpProton.GetDistanceFromParticle(kfpDeuteron), - kfpPion.GetDistanceFromParticle(kfpDeuteron), - DCAvtxDaughters3D, - // daughter signs - kfpProton.GetQ(), - kfpPion.GetQ(), - trackBach.sign(), - // daughter PID - tpcNsigmaProton, tpcNsigmaPion, tpcNsigmaDeuteron, tpcNsigmaPionBach, - dEdxProton, dEdxPion, dEdxDeuteron, - tofNSigmaDeuteron, - averageClusterSizeDeuteron, - trackBach.pidForTracking()); - } - LOG(debug) << "Table filled."; - - // fill event counter hist (has selected candidate) - registry.fill(HIST("hEventCounterKFParticle"), 3.5); } + LOG(debug) << "Table filled."; + + // fill event counter hist (has selected candidate) + registry.fill(HIST("hEventCounterKFParticle"), 3.5); } //------------------------------------------------------------------ @@ -1343,11 +1377,59 @@ struct decay3bodyBuilder { // LOG(debug) << "Collision index: " << collIdx; auto Decay3BodyTable_thisCollision = decay3bodys.sliceBy(perCollision, collIdx); // LOG(debug) << "Decay3Body tables sliced per collision. Calling buildVtx3BodyDataTableKFParticle function..."; - buildVtx3BodyDataTableKFParticle(collision, Decay3BodyTable_thisCollision, bachelorcharge); + for (auto& vtx3body : Decay3BodyTable_thisCollision) { + auto trackPos = vtx3body.template track0_as(); + auto trackNeg = vtx3body.template track1_as(); + auto trackBach = vtx3body.template track2_as(); + buildVtx3BodyDataTableKFParticle(collision, trackPos, trackNeg, trackBach, vtx3body.globalIndex(), bachelorcharge); + } LOG(debug) << "End of processKFParticle."; } } PROCESS_SWITCH(decay3bodyBuilder, processRun3withKFParticle, "Produce KFParticle decay3body tables", false); + + void processRun3EMwithKFParticle(ColwithEvTimesMults const& collisions, TrackExtPIDIUwithEvTimes const& tracksIU, aod::Decay3Bodys const& decay3bodys, aod::BCsWithTimestamps const&) + { + auto tuple = std::make_tuple(decay3bodys, tracksIU); + Pair pair{binningOnPosAndMult, kfparticleConfigurations.nEvtMixing, -1, collisions, tuple, &cache}; // indicates that under/overflow (-1) to be ignored + + for (auto& [c1, decays3body, c2, tracks] : pair) { + registry.fill(HIST("QA/EM/hPairCounterMixing"), 0.5); + // event selection + if (kfparticleConfigurations.doSel8selection && (!c1.sel8() || !c2.sel8())) { + continue; + } + registry.fill(HIST("QA/EM/hPairCounterMixing"), 1.5); + if (kfparticleConfigurations.doPosZselection && (abs(c1.posZ()) > 10.f || abs(c2.posZ()) > 10.f)) { + continue; + } + registry.fill(HIST("QA/EM/hPairCounterMixing"), 2.5); + auto bc = c1.bc_as(); + initCCDB(bc); + LOG(debug) << "CCDB initialised."; + + for (auto& [decay3body, track] : soa::combinations(soa::CombinationsFullIndexPolicy(decays3body, tracks))) { + auto trackPos = decay3body.template track0_as(); + auto trackNeg = decay3body.template track1_as(); + auto trackBach = decay3body.template track2_as(); + + registry.fill(HIST("QA/EM/hCombinationCounterMixing"), 0.5); + + // selections bachelor track + if ((trackBach.sign() > 0 && !(track.sign() > 0)) || (trackBach.sign() < 0 && !(track.sign() < 0)) || trackBach.globalIndex() == track.globalIndex()) { // only combine if track has correct sign and is not same as trackBach + continue; + } + registry.fill(HIST("QA/EM/hCombinationCounterMixing"), 1.5); + if (track.pt() < 0.6) { // SVertexer selection + continue; + } + registry.fill(HIST("QA/EM/hCombinationCounterMixing"), 2.5); + buildVtx3BodyDataTableKFParticle(c1, trackPos, trackNeg, track, -1, bachelorcharge); + LOG(debug) << "buildVtx3BodyDataTableKFParticle called."; + } + } + } + PROCESS_SWITCH(decay3bodyBuilder, processRun3EMwithKFParticle, "Produce KFParticle decay3body mixed event tables", false); }; // build link from decay3body -> vtx3body @@ -1378,8 +1460,14 @@ struct kfdecay3bodyDataLinkBuilder { void init(InitContext const&) {} + void processDoNotBuildLink(aod::Collisions::iterator const&) + { + // dummy process function + } + PROCESS_SWITCH(kfdecay3bodyDataLinkBuilder, processDoNotBuildLink, "Do not build data link table.", false); + // build Decay3Body -> KFDecay3BodyData link table - void process(aod::Decay3Bodys const& decay3bodytable, aod::KFVtx3BodyDatas const& vtxdatatable) + void processBuildLink(aod::Decay3Bodys const& decay3bodytable, aod::KFVtx3BodyDatas const& vtxdatatable) { std::vector lIndices; lIndices.reserve(decay3bodytable.size()); @@ -1392,6 +1480,7 @@ struct kfdecay3bodyDataLinkBuilder { kfvtxdataLink(lIndices[ii]); } } + PROCESS_SWITCH(kfdecay3bodyDataLinkBuilder, processBuildLink, "Build data link table.", true); }; struct decay3bodyLabelBuilder { From 1a5f35632180ec6d22c88072afd124617eb23df5 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Fri, 29 Nov 2024 19:08:11 +0100 Subject: [PATCH 183/459] [PWGCF] FemtoUniverse: Fixing filtering with conf. from two tables (#8736) --- ...emtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index bfe87658a37..2f1e8ee4712 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -138,9 +138,9 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable ConfIntRateLow{"ConfIntRateLow", 0.0, "Lower limit for interaction rate"}; Configurable ConfIntRateHigh{"ConfIntRateHigh", 10000.0, "Higher limit for interaction rate"}; - Filter collfilter = (o2::aod::femtouniversecollision::multV0M > ConfV0MLow) && (o2::aod::femtouniversecollision::multV0M < ConfV0MHigh) && - (o2::aod::femtouniversecollision::irrate > ConfIntRateLow) && (o2::aod::femtouniversecollision::irrate < ConfIntRateHigh) && - (o2::aod::femtouniversecollision::occupancy > ConfTPCOccupancyLow) && (o2::aod::femtouniversecollision::occupancy < ConfTPCOccupancyHigh); + Filter collfilterFDtable = (o2::aod::femtouniversecollision::multV0M > ConfV0MLow) && (o2::aod::femtouniversecollision::multV0M < ConfV0MHigh); + Filter collfilterFDExttable = (o2::aod::femtouniversecollision::irrate > ConfIntRateLow) && (o2::aod::femtouniversecollision::irrate < ConfIntRateHigh) && + (o2::aod::femtouniversecollision::occupancy > ConfTPCOccupancyLow) && (o2::aod::femtouniversecollision::occupancy < ConfTPCOccupancyHigh); using FilteredFDCollisions = soa::Filtered>; using FilteredFDCollision = FilteredFDCollisions::iterator; // Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.ConfEtaMax); // example filtering on configurable From e7dacba596aff5bd2e9fb02d55bf32f71065c408 Mon Sep 17 00:00:00 2001 From: Evgeny Kryshen Date: Fri, 29 Nov 2024 21:12:05 +0300 Subject: [PATCH 184/459] [DPG] Plots for efficiency and mismatch studies vs contributors (#8741) --- DPG/Tasks/AOTEvent/eventSelectionQa.cxx | 65 ++++++++++++++++++++----- 1 file changed, 53 insertions(+), 12 deletions(-) diff --git a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx index da2cc2b5588..d62130e6dd0 100644 --- a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx +++ b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx @@ -35,6 +35,7 @@ using BCsRun2 = soa::Join; using ColEvSels = soa::Join; using FullTracksIU = soa::Join; +using FullTracksIUwithLabels = soa::Join; struct EventSelectionQaTask { Configurable isMC{"isMC", 0, "0 - data, 1 - MC"}; @@ -306,6 +307,11 @@ struct EventSelectionQaTask { histos.add("hVertexXMC", "", kTH1F, {axisVtxXY}); histos.add("hVertexYMC", "", kTH1F, {axisVtxXY}); histos.add("hVertexZMC", "", kTH1F, {axisVtxZ}); + histos.add("hNcontribColFromMC", "", kTH1F, {axisNcontrib}); + histos.add("hNcontribAccFromMC", "", kTH1F, {axisNcontrib}); + histos.add("hNcontribMisFromMC", "", kTH1F, {axisNcontrib}); + histos.add("hNcontribColFromData", "", kTH1F, {axisNcontrib}); + histos.add("hNcontribAccFromData", "", kTH1F, {axisNcontrib}); for (int i = 0; i < kNsel; i++) { histos.get(HIST("hSelCounter"))->GetXaxis()->SetBinLabel(i + 1, selectionLabels[i]); @@ -1062,10 +1068,24 @@ struct EventSelectionQaTask { histos.fill(HIST("hNcontribAcc"), nContributors); } // collisions + + // TVX efficiency after TF and ITS ROF border cuts + for (auto& col : cols) { + if (!col.selection_bit(kNoTimeFrameBorder) || !col.selection_bit(kNoITSROFrameBorder)) + continue; + + uint32_t nContrib = col.numContrib(); + histos.fill(HIST("hNcontribColFromData"), nContrib); + if (!col.selection_bit(kIsTriggerTVX)) + continue; + + histos.fill(HIST("hNcontribAccFromData"), nContrib); + } } PROCESS_SWITCH(EventSelectionQaTask, processRun3, "Process Run3 event selection QA", false); - void processMCRun3(aod::McCollisions const& mcCols, soa::Join const& cols, BCsRun3 const&, aod::FT0s const&) + Partition pvTracks = ((aod::track::flags & static_cast(o2::aod::track::PVContributor)) == static_cast(o2::aod::track::PVContributor)); + void processMCRun3(aod::McCollisions const& mcCols, soa::Join const& cols, FullTracksIUwithLabels const&, BCsRun3 const&, aod::FT0s const&, aod::McParticles const& mcParts) { for (const auto& mcCol : mcCols) { auto bc = mcCol.bc_as(); @@ -1082,19 +1102,40 @@ struct EventSelectionQaTask { histos.fill(HIST("hNcolMCVsBcInTF"), bcInTF); } - // check fraction of collisions matched to wrong bcs - for (const auto& col : cols) { - if (!col.has_mcCollision()) { - continue; + for (auto& col : cols) { + int32_t mcColIdFromCollision = col.mcCollisionId(); + // check if collision is built from tracks originating from different MC collisions + bool isCollisionAmbiguous = 0; + const auto& colPvTracks = pvTracks.sliceByCached(aod::track::collisionId, col.globalIndex(), cache); + for (auto& track : colPvTracks) { + int32_t mcPartId = track.mcParticleId(); + int32_t mcColId = mcPartId >= 0 ? mcParts.iteratorAt(mcPartId).mcCollisionId() : -1; + if (mcColId < 0 || mcColIdFromCollision != mcColId) { + isCollisionAmbiguous = 1; + break; + } } - uint64_t mcBC = col.mcCollision().bc_as().globalBC(); - uint64_t rcBC = col.foundBC_as().globalBC(); + + // skip ambiguous collisions + if (isCollisionAmbiguous) + continue; + + // skip collisions at the borders of TF and ITS ROF + if (!col.selection_bit(kNoTimeFrameBorder) || !col.selection_bit(kNoITSROFrameBorder)) + continue; + + uint32_t nContrib = col.numContrib(); + histos.fill(HIST("hNcontribColFromMC"), nContrib); + if (!col.selection_bit(kIsTriggerTVX)) + continue; + + histos.fill(HIST("hNcontribAccFromMC"), nContrib); + + int64_t rcBC = col.foundBC_as().globalBC(); + int64_t mcBC = col.mcCollision().bc_as().globalBC(); + if (mcBC != rcBC) { - histos.fill(HIST("hNcontribMis"), col.numContrib()); - if (col.collisionTimeRes() < 12) { - // ~ wrong bcs for collisions with T0F-matched tracks - histos.fill(HIST("hNcontribMisTOF"), col.numContrib()); - } + histos.fill(HIST("hNcontribMisFromMC"), nContrib); } } } From 50653b6e6e2436fe9c076d8e72c77d837c51a8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 29 Nov 2024 20:44:31 +0100 Subject: [PATCH 185/459] [Infrastructure] Add O2 linter (#7066) Co-authored-by: ALICE Builder --- .github/workflows/o2-linter.yml | 30 + Scripts/o2_linter.py | 1520 +++++++++++++++++++++++++++++++ 2 files changed, 1550 insertions(+) create mode 100644 .github/workflows/o2-linter.yml create mode 100644 Scripts/o2_linter.py diff --git a/.github/workflows/o2-linter.yml b/.github/workflows/o2-linter.yml new file mode 100644 index 00000000000..3f124b56750 --- /dev/null +++ b/.github/workflows/o2-linter.yml @@ -0,0 +1,30 @@ +--- +# Find issues in O2 code +name: O2 linter + +'on': [pull_request, push] +permissions: {} +env: + MAIN_BRANCH: master + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + +jobs: + o2-linter: + name: O2 linter + runs-on: ubuntu-24.04 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # needed to get the full history + - name: Run tests + run: | + # Diff against the common ancestor of the source branch and the main branch. + readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.MAIN_BRANCH }}...) + [ ${{ github.event_name }} == 'pull_request' ] && options="-g" + # shellcheck disable=SC2086 # Ignore unquoted options. + python3 Scripts/o2_linter.py $options "${files[@]}" + echo "Tip: If you allow actions in your fork repository, O2 linter will run when you push commits." diff --git a/Scripts/o2_linter.py b/Scripts/o2_linter.py new file mode 100644 index 00000000000..f88911d1ee9 --- /dev/null +++ b/Scripts/o2_linter.py @@ -0,0 +1,1520 @@ +#!/usr/bin/env python3 + +# Copyright 2019-2020 CERN and copyright holders of ALICE O2. +# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +# All rights not expressly granted are reserved. +# +# This software is distributed under the terms of the GNU General Public +# License v3 (GPL Version 3), copied verbatim in the file "COPYING". +# +# In applying this license CERN does not waive the privileges and immunities +# granted to it by virtue of its status as an Intergovernmental Organization +# or submit itself to any jurisdiction. + +"""! +@brief O2 linter (Find O2-specific issues in O2 code) +@author Vít Kučera , Inha University +@date 2024-07-14 +""" + +import argparse +import os +import re +import sys +from abc import ABC +from typing import Union + +github_mode = False # GitHub mode +prefix_disable = "o2-linter: disable=" # prefix for disabling tests + + +def is_camel_case(name: str) -> bool: + """forExample or ForExample""" + return "_" not in name and "-" not in name and " " not in name + + +def is_upper_camel_case(name: str) -> bool: + """ForExample""" + if not name: + return False + return name[0].isupper() and is_camel_case(name) + + +def is_lower_camel_case(name: str) -> bool: + """forExample""" + if not name: + return False + return name[0].islower() and is_camel_case(name) + + +def is_kebab_case(name: str) -> bool: + """for-example""" + if not name: + return False + return name.islower() and "_" not in name and " " not in name + + +def is_snake_case(name: str) -> bool: + """for_example""" + if not name: + return False + return name.islower() and "-" not in name and " " not in name + + +def is_screaming_snake_case(name: str) -> bool: + """FOR_EXAMPLE""" + if not name: + return False + return name.isupper() and "-" not in name and " " not in name + + +def kebab_case_to_camel_case_u(line: str) -> str: + """Convert kebab-case string to UpperCamelCase string.""" + return "".join([w.title() if w[0].isnumeric() else w.capitalize() for w in line.split("-")]) + + +def kebab_case_to_camel_case_l(line: str) -> str: + """Convert kebab-case string to lowerCamelCase string.""" + new_line = kebab_case_to_camel_case_u(line) + return f"{new_line[0].lower()}{new_line[1:]}" # start with lowercase letter + + +def camel_case_to_kebab_case(line: str) -> str: + """Convert CamelCase string to kebab-case string. + As done in O2/Framework/Foundation/include/Framework/TypeIdHelpers.h:type_to_task_name + """ + if not line.strip(): + return line + new_line = [] + for i, c in enumerate(line): + if i > 0 and c.isupper() and line[i - 1] != "-": + new_line.append("-") + new_line.append(c.lower()) + return "".join(new_line) + + +def print_error(path: str, line: Union[int, None], title: str, message: str): + """Format and print error message.""" + # return # Use to suppress error messages. + str_line = "" if line is None else f"{line}:" + print(f"{path}:{str_line} {message} [{title}]") # terminal format + if github_mode: + str_line = "" if line is None else f",line={line}" + print(f"::warning file={path}{str_line},title=[{title}]::{message}") # GitHub annotation format + + +def is_comment_cpp(line: str) -> bool: + """Test whether a line is a C++ comment.""" + return line.strip().startswith(("//", "/*")) + + +def remove_comment_cpp(line: str) -> str: + """Remove C++ comments from the end of a line.""" + for keyword in ("//", "/*"): + if keyword in line: + line = line[: line.index(keyword)] + return line.strip() + + +def block_ranges(line: str, char_open: str, char_close: str) -> "list[list[int]]": + """Get list of index ranges of longest blocks opened with char_open and closed with char_close.""" + # print(f"Looking for {char_open}{char_close} blocks in \"{line}\".") + # print(line) + list_ranges: "list[list[int]]" = [] + if not all((line, len(char_open) == 1, len(char_close) == 1)): + return list_ranges + + def direction(char: str) -> int: + if char == char_open: + return 1 + if char == char_close: + return -1 + return 0 + + list_levels = [] # list of block levels (net number of opened blocks) + level_sum = 0 # current block level (sum of previous directions) + for char in line: + list_levels.append(level_sum := level_sum + direction(char)) + level_min = min(list_levels) # minimum level (!= 0 if line has opened blocks) + # Look for openings (level_min + 1) and closings (level_min). + index_start = -1 + is_opened = False + # print(list_levels) + for i, level in enumerate(list_levels): + if not is_opened and level > level_min: + is_opened = True + index_start = i + # print(f"Opening at {i}") + elif is_opened and (level == level_min or i == len(list_levels) - 1): + is_opened = False + list_ranges.append([index_start, i]) + # print(f"Closing at {i}") + # print(f"block_ranges: Found {len(list_ranges)} blocks: {list_ranges}.") + if is_opened: + print("block_ranges: Block left opened.") + return list_ranges + + +class TestSpec(ABC): + """Prototype of a test class""" + + name = "test-template" # short name of the test + message = "Test failed" # error message + suffixes: "list[str]" = [] # suffixes of files to test + per_line = True # Test lines separately one by one. + n_issues = 0 # issue counter + + def file_matches(self, path: str) -> bool: + """Test whether the path matches the pattern for files to test.""" + return path.endswith(tuple(self.suffixes)) if self.suffixes else True + + def is_disabled(self, line: str, prefix_comment="//") -> bool: + """Detect whether the test is explicitly disabled.""" + for prefix in [prefix_comment, prefix_disable]: + if prefix not in line: + return False + line = line[(line.index(prefix) + len(prefix)) :] # Strip away part before prefix. + if self.name in line: + return True + return False + + def test_line(self, line: str) -> bool: + """Test a line.""" + raise NotImplementedError() + + def test_file(self, path: str, content) -> bool: + """Test a file in a way that cannot be done line by line.""" + raise NotImplementedError() + + def run(self, path: str, content) -> bool: + """Run the test.""" + # print(content) + passed = True + if not self.file_matches(path): + return passed + # print(f"Running test {self.name} for {path} with {len(content)} lines") + if self.per_line: + for i, line in enumerate(content): + if not isinstance(self, TestUsingDirectives): # Keep the indentation if needed. + line = line.strip() + if not line: + continue + # print(i + 1, line) + if self.is_disabled(line): + continue + if not self.test_line(line): + passed = False + self.n_issues += 1 + print_error(path, i + 1, self.name, self.message) + else: + passed = self.test_file(path, content) + if not passed: + self.n_issues += 1 + print_error(path, None, self.name, self.message) + return passed + + +########################## +# Implementations of tests +########################## + +# Bad practice + + +class TestIOStream(TestSpec): + """Detect included iostream.""" + + name = "include-iostream" + message = "Including iostream is discouraged. Use O2 logging instead." + suffixes = [".h", ".cxx"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + return not line.startswith("#include ") + + +class TestUsingStd(TestSpec): + """Detect importing names from the std namespace.""" + + name = "import-std-name" + message = "Importing names from the std namespace is not allowed in headers." + suffixes = [".h"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + return not line.startswith("using std::") + + +class TestUsingDirectives(TestSpec): + """Detect using directives in headers.""" + + name = "using-directive" + message = "Using directives are not allowed in headers." + suffixes = [".h"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + return not line.startswith("using namespace") + + +class TestStdPrefix(TestSpec): + """Detect missing std:: prefix for common names from the std namespace.""" + + name = "std-prefix" + message = "Use std:: prefix for names from the std namespace." + suffixes = [".h", ".cxx", ".C"] + prefix_bad = r"[^\w:\.\"]" + patterns = [ + r"vector<", + r"array[<\{\(]", + r"f?abs\(", + r"sqrt\(", + r"pow\(", + r"min\(", + r"max\(", + r"log(2|10)?\(", + r"exp\(", + r"a?(sin|cos|tan)h?\(", + r"atan2\(", + r"erfc?\(", + r"hypot\(", + ] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + line = remove_comment_cpp(line) + for pattern in self.patterns: + iterators = re.finditer(rf"{self.prefix_bad}{pattern}", line) + matches = [(it.start(), it.group()) for it in iterators] + if not matches: + continue + if '"' not in line: # Found a match which cannot be inside a string. + return False + # Ignore matches inside strings. + for match in matches: + n_quotes_before = line.count('"', 0, match[0]) # Count quotation marks before the match. + if n_quotes_before % 2: # If odd, we are inside a string and we should ignore this match. + continue + # We are not inside a string and this match is valid. + return False + return True + + +class TestROOT(TestSpec): + """Detect unnecessary use of ROOT entities.""" + + name = "root-entity" + message = "Consider replacing ROOT entities with equivalents from standard C++ or from O2." + suffixes = [".h", ".cxx"] + + def file_matches(self, path: str) -> bool: + return super().file_matches(path) and "Macros/" not in path + + def test_line(self, line: str) -> bool: + pattern = ( + r"TMath::(Abs|Sqrt|Power|Min|Max|Log(2|10)?|Exp|A?(Sin|Cos|Tan)H?|ATan2|Erfc?|Hypot)\(|" + r"(U?(Int|Char|Short)|Double(32)?|Float(16)?|U?Long(64)?|Bool)_t" + ) + if is_comment_cpp(line): + return True + line = remove_comment_cpp(line) + return re.search(pattern, line) is None + + +class TestPi(TestSpec): + """Detect use of external pi.""" + + name = "external-pi" + message = "Consider using the PI constant (and its multiples and fractions) defined in o2::constants::math." + suffixes = [".h", ".cxx"] + + def file_matches(self, path: str) -> bool: + return super().file_matches(path) and "Macros/" not in path + + def test_line(self, line: str) -> bool: + pattern = r"M_PI|TMath::(Two)?Pi" + if is_comment_cpp(line): + return True + line = remove_comment_cpp(line) + return re.search(pattern, line) is None + + +class TestTwoPiAddSubtract(TestSpec): + """Detect adding/subtracting of 2 pi.""" + + name = "two-pi-add-subtract" + message = "Consider using RecoDecay::constrainAngle to restrict angle to a given range." + suffixes = [".h", ".cxx"] + + def test_line(self, line: str) -> bool: + pattern_two_pi = ( + r"(2(\.0*f?)? \* (M_PI|TMath::Pi\(\)|(((o2::)?constants::)?math::)?PI)|" + r"(((o2::)?constants::)?math::)?TwoPI|TMath::TwoPi\(\))" + ) + pattern = rf"[\+-]=? {pattern_two_pi}" + if is_comment_cpp(line): + return True + line = remove_comment_cpp(line) + return re.search(pattern, line) is None + + +class TestPiMultipleFraction(TestSpec): + """Detect multiples/fractions of pi for existing equivalent constants.""" + + name = "pi-multiple-fraction" + message = "Consider using multiples/fractions of PI defined in o2::constants::math." + suffixes = [".h", ".cxx"] + + def test_line(self, line: str) -> bool: + pattern_pi = r"(M_PI|TMath::(Two)?Pi\(\)|(((o2::)?constants::)?math::)?(Two)?PI)" + pattern_multiple = r"(2(\.0*f?)?|0\.2?5f?) \* " # * 2, 0.25, 0.5 + pattern_fraction = r" / ((2|3|4)([ ,;\)]|\.0*f?))" # / 2, 3, 4 + pattern = rf"{pattern_multiple}{pattern_pi}|{pattern_pi}{pattern_fraction}" + if is_comment_cpp(line): + return True + line = remove_comment_cpp(line) + return re.search(pattern, line) is None + + +class TestPdgDatabase(TestSpec): + """Detect use of TDatabasePDG.""" + + name = "pdg/database" + message = ( + "Direct use of TDatabasePDG is not allowed. " + "Use o2::constants::physics::Mass... or Service." + ) + suffixes = [".h", ".cxx"] + + def file_matches(self, path: str) -> bool: + return super().file_matches(path) and "Macros/" not in path + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + line = remove_comment_cpp(line) + return "TDatabasePDG" not in line + + +class TestPdgCode(TestSpec): + """Detect use of hard-coded PDG codes.""" + + name = "pdg/explicit-code" + message = "Avoid using hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead." + suffixes = [".h", ".cxx", ".C"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + line = remove_comment_cpp(line) + if re.search(r"->(GetParticle|Mass)\([+-]?[0-9]+\)", line): + return False + match = re.search(r"[Pp][Dd][Gg][\w]* ={1,2} [+-]?([0-9]+);", line) + if match: + code = match.group(1) + if code not in ("0", "1", "999"): + return False + return True + + +class TestPdgMass(TestSpec): + """Detect unnecessary call of Mass() for a known PDG code.""" + + name = "pdg/known-mass" + message = ( + "Consider using o2::constants::physics::Mass... instead of calling a database method for a known PDG code." + ) + suffixes = [".h", ".cxx", ".C"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + line = remove_comment_cpp(line) + pattern_pdg_code = r"[+-]?(k[A-Z][a-zA-Z0-9]*|[0-9]+)" + if re.search(rf"->GetParticle\({pattern_pdg_code}\)->Mass\(\)", line): + return False + if re.search(rf"->Mass\({pattern_pdg_code}\)", line): + return False + return True + + +class TestLogging(TestSpec): + """Detect non-O2 logging.""" + + name = "logging" + message = "Consider using O2 logging (LOG, LOGF, LOGP)." + suffixes = [".h", ".cxx"] + + def file_matches(self, path: str) -> bool: + return super().file_matches(path) and "Macros/" not in path + + def test_line(self, line: str) -> bool: + pattern = r"^([Pp]rintf\(|(std::)?cout <)" + if is_comment_cpp(line): + return True + line = remove_comment_cpp(line) + return re.search(pattern, line) is None + + +class TestConstRefInForLoop(TestSpec): + """Test const refs in range-based for loops.""" + + name = "const-ref-in-for-loop" + message = "Use constant references for non-modified iterators in range-based for loops." + suffixes = [".h", ".cxx", ".C"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + line = remove_comment_cpp(line) + if not re.match(r"for \(.* :", line): + return True + line = line[: line.index(" :")] # keep only the iterator part + return re.search(r"(\w const|const \w+)& ", line) is not None + + +class TestConstRefInSubscription(TestSpec): + """Test const refs in process function subscriptions. + Test only top-level process functions (called process() or has PROCESS_SWITCH). + """ + + name = "const-ref-in-process" + message = "Use constant references for table subscriptions in process functions." + suffixes = [".cxx"] + per_line = False + + def test_file(self, path: str, content) -> bool: + passed = True + n_parens_opened = 0 # number of opened parentheses + arguments = "" # process function arguments + line_process = 0 # line number of the process function + # Find names of all top-level process functions. + names_functions = ["process"] # names of allowed process functions to test + for i, line in enumerate(content): + line = line.strip() + if is_comment_cpp(line): + continue + if not line.startswith("PROCESS_SWITCH"): + continue + words = line.split() + if len(words) < 2: + passed = False + print_error( + path, + i + 1, + self.name, + "Failed to get the process function name. Keep it on the same line as the switch.", + ) + continue + names_functions.append(words[1][:-1]) # Remove the trailing comma. + # print_error(path, i + 1, self.name, f"Got process function name {words[1][:-1]}.") + # Test process functions. + for i, line in enumerate(content): + line = line.strip() + if is_comment_cpp(line): + continue + if self.is_disabled(line): + continue + if "//" in line: # Remove comment. (Ignore /* to avoid truncating at /*parameter*/.) + line = line[: line.index("//")] + if (match := re.match(r"void (process[\w]*)\(", line)) and match.group(1) in names_functions: + line_process = i + 1 + i_closing = line.rfind(")") + i_start = line.index("(") + 1 + i_end = i_closing if i_closing != -1 else len(line) + arguments = line[i_start:i_end] # get arguments between parentheses + n_parens_opened = line.count("(") - line.count(")") + elif n_parens_opened > 0: + i_closing = line.rfind(")") + i_start = 0 + i_end = i_closing if i_closing != -1 else len(line) + arguments += " " + line[i_start:i_end] # get arguments between parentheses + n_parens_opened += line.count("(") - line.count(")") + if line_process > 0 and n_parens_opened == 0: + # Process arguments. + # Sanitise arguments with spaces between <>. + for start, end in block_ranges(arguments, "<", ">"): + arg = arguments[start : (end + 1)] + # print(f"Found argument \"{arg}\" in [{start}, {end}]") + if ", " in arg: + arguments = arguments.replace(arg, arg.replace(", ", "__")) + # Extract arguments. + words = arguments.split(", ") + # Test each argument. + for arg in words: + if not re.search(r"([\w>] const|const [\w<>:]+)&", arg): + passed = False + print_error(path, i + 1, self.name, f"Argument {arg} is not const&.") + line_process = 0 + return passed + + +class TestWorkflowOptions(TestSpec): + """Detect usage of workflow options in defineDataProcessing. (Not supported on AliHyperloop.)""" + + name = "o2-workflow-options" + message = ( + "Do not use workflow options to customise workflow topology composition in defineDataProcessing. " + "Use process function switches or metadata instead." + ) + suffixes = [".cxx"] + per_line = False + + def test_file(self, path: str, content) -> bool: + is_inside_define = False # Are we inside defineDataProcessing? + for i, line in enumerate(content): # pylint: disable=unused-variable + if not line.strip(): + continue + if self.is_disabled(line): + continue + if is_comment_cpp(line): + continue + line = remove_comment_cpp(line) + # Wait for defineDataProcessing. + if not is_inside_define: + if not re.match(r"((o2::)?framework::)?WorkflowSpec defineDataProcessing\(", line): + continue + # print(f"{i + 1}: Entering define.") + is_inside_define = True + # Return at the end of defineDataProcessing. + if is_inside_define and line[0] == "}": + # print(f"{i + 1}: Exiting define.") + break + # Detect options. + if ".options()" in line: + return False + return True + + +# Documentation +# Reference: https://rawgit.com/AliceO2Group/CodingGuidelines/master/comments_guidelines.html + + +class TestDocumentationFile(TestSpec): + """Test mandatory documentation of C++ files.""" + + name = "doc/file" + message = "Provide mandatory file documentation." + suffixes = [".h", ".cxx", ".C"] + per_line = False + + def test_file(self, path: str, content) -> bool: + passed = False + doc_items = [] + doc_items.append({"keyword": "file", "pattern": rf"{os.path.basename(path)}$", "found": False}) + doc_items.append({"keyword": "brief", "pattern": r"\w.* \w", "found": False}) # at least two words + doc_items.append({"keyword": "author", "pattern": r"[\w]+", "found": False}) + doc_prefix = "///" + n_lines_copyright = 11 + last_doc_line = n_lines_copyright + + for i, line in enumerate(content): + if i < n_lines_copyright: # Skip copyright lines. + continue + if line.strip() and not line.startswith(doc_prefix): # Stop at the first non-empty non-doc line. + break + if line.startswith(doc_prefix): + last_doc_line = i + 1 + for item in doc_items: + if re.search(rf"^{doc_prefix} [\\@]{item['keyword']} +{item['pattern']}", line): + item["found"] = True + # print_error(path, i + 1, self.name, f"Found \{item['keyword']}.") + break + if all(item["found"] for item in doc_items): # All items have been found. + passed = True + break + if not passed: + for item in doc_items: + if not item["found"]: + print_error( + path, + last_doc_line, + self.name, + f"Documentation for \\{item['keyword']} is missing, incorrect or misplaced.", + ) + return passed + + +# Naming conventions +# Reference: https://rawgit.com/AliceO2Group/CodingGuidelines/master/naming_formatting.html + + +class TestNameFunctionVariable(TestSpec): + """Test names of functions and of most variables. + Might report false positives. + Does not detect multiple variable declarations, i.e. "type name1, name2;" + Does not detect function arguments on the same line as the function declaration. + Does not detect multi-line declarations. + Does not check capitalisation for constexpr because of special rules for constants. See TestNameConstant. + """ + + name = "name/function-variable" + message = "Use lowerCamelCase for names of functions and variables." + suffixes = [".h", ".cxx", ".C"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + # Look for declarations of functions and variables. + + # Strip away irrelevant remainders of the line after the object name. + # For functions, stripping after "(" is enough but this way we also identify many declarations of variables. + for keyword in ("(", "{", ";", " = ", "//", "/*"): + if keyword in line: + line = line[: line.index(keyword)] + + # Check the words. + words = line.split() + + # number of words + if len(words) < 2: + return True + + # First word starts with a letter. + if not words[0][0].isalpha(): + return True + + # Reject false positives with same structure. + if words[0] in ( + "return", + "if", + "else", + "new", + "delete", + "delete[]", + "case", + "typename", + "using", + "typedef", + "enum", + "namespace", + "struct", + "class", + ): + return True + if len(words) > 2 and words[1] in ("typename", "class", "struct"): + return True + + # Identify the position of the name for cases "name[n + m]". + funval_name = words[-1] # expecting the name in the last word + if ( + funval_name.endswith("]") and "[" not in funval_name + ): # it's an array and we do not have the name before "[" here + opens_brackets = ["[" in w for w in words] + if not any(opens_brackets): # The opening "[" is not on this line. We have to give up. + return True + index_name = opens_brackets.index(True) # the name is in the first element with "[" + funval_name = words[index_name] + words = words[: (index_name + 1)] # Strip away words after the name. + if len(words) < 2: # Check the adjusted number of words. + return True + + # All words before the name start with an alphanumeric character (underscores not allowed). + # Rejects expressions, e.g. * = += << }, but accepts numbers in array declarations. + if not all(w[0].isalnum() for w in words[:-1]): + return True + + # Extract function/variable name. + if "[" in funval_name: # Remove brackets for arrays. + funval_name = funval_name[: funval_name.index("[")] + if "::" in funval_name: # Remove the class prefix for methods. + funval_name = funval_name.split("::")[-1] + + # Check the name candidate. + + # Names of variables and functions are identifiers. + if not funval_name.isidentifier(): # should be same as ^[\w]+$ + return True + + # print(f"{line} -> {funval_name}") + # return True + # The actual test comes here. + if "constexpr" in words[:-1]: + return is_camel_case(funval_name) + return is_lower_camel_case(funval_name) + + +class TestNameMacro(TestSpec): + """Test macro names.""" + + name = "name/macro" + message = "Use SCREAMING_SNAKE_CASE for names of macros. Leading and double underscores are not allowed." + suffixes = [".h", ".cxx", ".C"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + if not line.startswith("#define "): + return True + # Extract macro name. + macro_name = line.split()[1] + if "(" in macro_name: + macro_name = macro_name.split("(")[0] + # The actual test comes here. + if macro_name.startswith("_"): + return False + if "__" in macro_name: + return False + return is_screaming_snake_case(macro_name) + + +class TestNameConstant(TestSpec): + """Test constexpr constant names.""" + + name = "name/constexpr-constant" + message = ( + 'Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".' + ) + suffixes = [".h", ".cxx", ".C"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + line = remove_comment_cpp(line) + words = line.split() + if "constexpr" not in words or "=" not in words: + return True + # Extract constant name. + words = words[: words.index("=")] # keep only words before "=" + constant_name = words[-1] # last word before "=" + if ( + constant_name.endswith("]") and "[" not in constant_name + ): # it's an array and we do not have the name before "[" here + opens_brackets = ["[" in w for w in words] + if not any(opens_brackets): # The opening "[" is not on this line. We have to give up. + return True + constant_name = words[opens_brackets.index(True)] # the name is in the first element with "[" + if "[" in constant_name: # Remove brackets for arrays. + constant_name = constant_name[: constant_name.index("[")] + if "::" in constant_name: # Remove the class prefix for methods. + constant_name = constant_name.split("::")[-1] + # The actual test comes here. + if constant_name.startswith("k") and len(constant_name) > 1: # exception for special constants + constant_name = constant_name[1:] # test the name without "k" + return is_upper_camel_case(constant_name) + + +class TestNameColumn(TestSpec): + """Test names of O2 columns.""" + + name = "name/o2-column" + message = "Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters." + suffixes = [".h", ".cxx"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + if not (match := re.match(r"DECLARE(_[A-Z]+)*_COLUMN(_[A-Z]+)*\(", line)): + return True + # Extract names of the column type and getter. + line = remove_comment_cpp(line) + line = line[len(match.group()) :].strip() # Extract part after "(". + if not (match := re.match(r"([^,]+), ([^,\) ]+)", line)): + print(f'Failed to extract column type and getter from "{line}".') + return False + column_type_name = match.group(1) + column_getter_name = match.group(2) + # print(f"Got \"{column_type_name}\" \"{column_getter_name}\"") + # return True + if column_type_name[0] == "_": # probably a macro variable + return True + # The actual test comes here. + if not is_upper_camel_case(column_type_name): + return False + if not is_lower_camel_case(column_getter_name): + return False + return f"{column_type_name[0].lower()}{column_type_name[1:]}" == column_getter_name + + +class TestNameTable(TestSpec): + """Test names of O2 tables.""" + + name = "name/o2-table" + message = "Use UpperCamelCase for names of O2 tables." + suffixes = [".h", ".cxx"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + if not (match := re.match(r"DECLARE(_[A-Z]+)*_TABLES?(_[A-Z]+)*\(", line)): + return True + # Extract names of the table type. + line = remove_comment_cpp(line) + line = line[len(match.group()) :].strip() # Extract part after "(". + if not (match := re.match(r"([^,\) ]+)", line)): + print(f'Failed to extract table type from "{line}".') + return False + table_type_name = match.group(1) + # print(f"Got \"{table_type_name}\"") + # return True + # Check for a version suffix. + if match := re.match(r"(.*)_([0-9]{3})", line): + table_type_name = match.group(1) + # table_version = match.group(2) + # print(f"Got versioned table \"{table_type_name}\", version {table_version}") + if table_type_name[0] == "_": # probably a macro variable + return True + # The actual test comes here. + return is_upper_camel_case(table_type_name) + + +class TestNameNamespace(TestSpec): + """Test names of namespaces.""" + + name = "name/namespace" + message = "Use snake_case for names of namespaces. Double underscores are not allowed." + suffixes = [".h", ".cxx", ".C"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + if not line.startswith("namespace "): + return True + # Extract namespace name. + namespace_name = line.split()[1] + if namespace_name == "{": # ignore anonymous namespaces + return True + # The actual test comes here. + if "__" in namespace_name: + return False + return is_snake_case(namespace_name) + + +class TestNameType(TestSpec): + """Test names of defined types.""" + + name = "name/type" + message = "Use UpperCamelCase for names of defined types." + suffixes = [".h", ".cxx", ".C"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + if not (match := re.match(r"using (\w+) = ", line)): + return True + # Extract type name. + type_name = match.group(1) + # The actual test comes here. + return is_upper_camel_case(type_name) + + +class TestNameUpperCamelCase(TestSpec): + """Base class for a test of UpperCamelCase names.""" + + keyword = "key" + name = f"name/{keyword}" + message = f"Use UpperCamelCase for names of {keyword}." + suffixes = [".h", ".cxx", ".C"] + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + if not line.startswith(f"{self.keyword} "): + return True + # Extract object name. + words = line.split() + if not words[1].isalnum(): # "struct : ...", "enum { ..." + return True + object_name = words[1] + if object_name in ("class", "struct") and len(words) > 2: # enum class ... or enum struct + object_name = words[2] + # The actual test comes here. + return is_upper_camel_case(object_name) + + +class TestNameEnum(TestNameUpperCamelCase): + """Test names of enumerators.""" + + keyword = "enum" + name = "name/enum" + message = "Use UpperCamelCase for names of enumerators and their values." + + +class TestNameClass(TestNameUpperCamelCase): + """Test names of classes.""" + + keyword = "class" + name = "name/class" + message = "Use UpperCamelCase for names of classes." + + +class TestNameStruct(TestNameUpperCamelCase): + """Test names of structs.""" + + keyword = "struct" + name = "name/struct" + message = "Use UpperCamelCase for names of structs." + + +class TestNameFileCpp(TestSpec): + """Test names of C++ files.""" + + name = "name/file-cpp" + message = "Use lowerCamelCase or UpperCamelCase for names of C++ files. See the O2 naming conventions for details." + suffixes = [".h", ".cxx", ".C"] + per_line = False + + def test_file(self, path: str, content) -> bool: + file_name = os.path.basename(path) + # workflow file + if re.search(r"(TableProducer|Tasks)/.*\.cxx", path): + return is_lower_camel_case(file_name) + # data model file + if "DataModel/" in path: + return is_upper_camel_case(file_name) + # utility file + if re.search(r"[Uu]til(ity|ities|s)?", file_name): + return is_lower_camel_case(file_name) + return is_camel_case(file_name) + + +class TestNameFilePython(TestSpec): + """Test names of Python files.""" + + name = "name/file-python" + message = "Use snake_case for names of Python files." + suffixes = [".py", ".ipynb"] + per_line = False + + def test_file(self, path: str, content) -> bool: + file_name = os.path.basename(path) + return is_snake_case(file_name) + + +class TestNameWorkflow(TestSpec): + """Test names of O2 workflows.""" + + name = "name/o2-workflow" + message = "Use kebab-case for names of workflows and match the name of the workflow file." + suffixes = ["CMakeLists.txt"] + per_line = False + + def test_file(self, path: str, content) -> bool: + passed = True + workflow_name = "" + for i, line in enumerate(content): + if not line.startswith("o2physics_add_dpl_workflow("): + continue + if self.is_disabled(line, "#"): + continue + # Extract workflow name. + workflow_name = line.strip().split("(")[1].split()[0] + if not is_kebab_case(workflow_name): + passed = False + print_error(path, i + 1, self.name, f"Invalid workflow name: {workflow_name}.") + continue + # Extract workflow file name. + next_line = content[i + 1].strip() + words = next_line.split() + if words[0] != "SOURCES": + passed = False + print_error(path, i + 2, self.name, f"Did not find sources for workflow: {workflow_name}.") + continue + workflow_file_name = os.path.basename(words[1]) # the actual file name + # Generate the file name matching the workflow name. + expected_workflow_file_name = kebab_case_to_camel_case_l(workflow_name) + ".cxx" + # Compare the actual and expected file names. + if expected_workflow_file_name != workflow_file_name: + passed = False + print_error( + path, + i + 1, + self.name, + f"Workflow name {workflow_name} does not match its file name {workflow_file_name}. " + f"(Matches {expected_workflow_file_name}.)", + ) + return passed + + +class TestNameTask(TestSpec): + """Test explicit task names. + Detect usage of TaskName, check whether it is needed and whether the task name matches the struct name.""" + + name = "name/o2-task" + message = "Specify task name only when it cannot be derived from the struct name. Only append to the default name." + suffixes = [".cxx"] + per_line = False + + def test_file(self, path: str, content) -> bool: + is_inside_define = False # Are we inside defineDataProcessing? + is_inside_adapt = False # Are we inside adaptAnalysisTask? + struct_name = "" + struct_templated = False # Is the struct templated? + n_parens_opened = 0 # number of opened parentheses + passed = True + for i, line in enumerate(content): + if not line.strip(): + continue + if self.is_disabled(line): + continue + if is_comment_cpp(line): + continue + line = remove_comment_cpp(line) + # Wait for defineDataProcessing. + if not is_inside_define: + if not re.match(r"((o2::)?framework::)?WorkflowSpec defineDataProcessing\(", line): + continue + # print(f"{i + 1}: Entering define.") + is_inside_define = True + # Return at the end of defineDataProcessing. + if is_inside_define and line[0] == "}": + # print(f"{i + 1}: Exiting define.") + break + # Wait for adaptAnalysisTask. + if not is_inside_adapt: + if (index := line.find("adaptAnalysisTask<")) == -1: + continue + # print(f"{i + 1}: Entering adapt.") + is_inside_adapt = True + line = line[(index + len("adaptAnalysisTask<")) :] + # Extract struct name. + if not (match := re.match(r"([^>]+)", line)): + print_error(path, i + 1, self.name, f'Failed to extract struct name from "{line}".') + return False + struct_name = match.group(1) + if (index := struct_name.find("<")) > -1: + struct_templated = True + # print(f"{i + 1}: Got templated struct name {struct_name}") + struct_name = struct_name[:index] + # print(f"{i + 1}: Got struct name {struct_name}") + line = line[(line.index(struct_name) + len(struct_name)) :] + if is_inside_adapt: + n_parens_opened += line.count("(") - line.count(")") + # print(f"{i + 1}: {n_parens_opened} opened parens") + if n_parens_opened <= 0: + # print(f"{i + 1}: Exiting adapt.") + is_inside_adapt = False + # Find explicit task name. + if "TaskName{" not in line: + continue + passed = False + # Extract explicit task name. + if not (match := re.search(r"TaskName\{\"([^\}]+)\"\}", line)): + print_error(path, i + 1, self.name, f'Failed to extract explicit task name from "{line}".') + return False + task_name = match.group(1) + # print(f"{i + 1}: Got struct \"{struct_name}\" with task name \"{task_name}\".") + # Test explicit task name. + device_name_from_struct_name = camel_case_to_kebab_case( + struct_name + ) # default device name, in absence of TaskName + device_name_from_task_name = camel_case_to_kebab_case( + task_name + ) # actual device name, generated from TaskName + struct_name_from_device_name = kebab_case_to_camel_case_u( + device_name_from_task_name + ) # struct name matching the TaskName + if not is_kebab_case(device_name_from_task_name): + print_error( + path, + i + 1, + self.name, + f"Specified task name {task_name} produces an invalid device name " + f"{device_name_from_task_name}.", + ) + passed = False + elif device_name_from_struct_name == device_name_from_task_name: + # If the task name results in the same device name as the struct name would, + # TaskName is redundant and should be removed. + print_error( + path, + i + 1, + self.name, + f"Specified task name {task_name} and the struct name {struct_name} produce " + f"the same device name {device_name_from_struct_name}. TaskName is redundant.", + ) + passed = False + elif device_name_from_struct_name.replace("-", "") == device_name_from_task_name.replace("-", ""): + # If the device names generated from the task name and from the struct name differ in hyphenation, + # capitalisation of the struct name should be fixed and TaskName should be removed. + # (special cases: alice3-, -2prong) + print_error( + path, + i + 1, + self.name, + f"Device names {device_name_from_task_name} and {device_name_from_struct_name} generated " + f"from the specified task name {task_name} and from the struct name {struct_name}, " + f"respectively, differ in hyphenation. Consider fixing capitalisation of the struct name " + f"to {struct_name_from_device_name} and removing TaskName.", + ) + passed = False + elif device_name_from_task_name.startswith(device_name_from_struct_name): + # If the device name generated from the task name is an extension of the device name generated + # from the struct name, accept it if the struct is templated. If the struct is not templated, + # extension is acceptable if adaptAnalysisTask is called multiple times for the same struct. + if not struct_templated: + print_error( + path, + i + 1, + self.name, + f"Device name {device_name_from_task_name} from the specified task name " + f"{task_name} is an extension of the device name {device_name_from_struct_name} " + f"from the struct name {struct_name} but the struct is not templated. " + "Is it adapted multiple times?", + ) + passed = False + # else: + # print_error(path, i + 1, self.name, f"Device name {device_name_from_task_name} from + # the specified task name {task_name} is an extension of the device name + # {device_name_from_struct_name} from the struct name {struct_name} and the struct is templated. + # All good") + else: + # Other cases should be rejected. + print_error( + path, + i + 1, + self.name, + f"Specified task name {task_name} produces device name {device_name_from_task_name} " + f"which does not match the device name {device_name_from_struct_name} from " + f"the struct name {struct_name}. (Matching struct name {struct_name_from_device_name})", + ) + passed = False + return passed + + +class TestNameFileWorkflow(TestSpec): + """Test names of workflow files.""" + + name = "name/workflow-file" + message = ( + "Name of a workflow file must match the name of the main struct in it (without the PWG prefix). " + '(Class implementation files should be in "Core" directories.)' + ) + suffixes = [".cxx"] + per_line = False + + def file_matches(self, path: str) -> bool: + return super().file_matches(path) and "/Core/" not in path + + def test_file(self, path: str, content) -> bool: + file_name = os.path.basename(path).rstrip(".cxx") + base_struct_name = f"{file_name[0].upper()}{file_name[1:]}" # expected base of struct names + if "PWGHF/" in path: + base_struct_name = "Hf" + base_struct_name + # print(f"For file {file_name} expecting to find {base_struct_name}.") + struct_names = [] # actual struct names in the file + for line in content: + if self.is_disabled(line): + return True + if not line.startswith("struct "): + continue + # Extract struct name. + words = line.split() + if not words[1].isalnum(): # "struct : ..." + continue + struct_name = words[1] + struct_names.append(struct_name) + # print(f"Found structs: {struct_names}.") + for struct_name in struct_names: + if struct_name.startswith(base_struct_name): + return True + return False + + +class TestNameConfigurable(TestSpec): + """Test names of configurables.""" + + name = "name/configurable" + message = ( + "Use lowerCamelCase for names of configurables and use the same name " + "for the struct member as for the JSON string. (Declare the type and names on the same line.)" + ) + suffixes = [".h", ".cxx"] + + def file_matches(self, path: str) -> bool: + return super().file_matches(path) and "Macros/" not in path + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + if not line.startswith("Configurable"): + return True + # Extract Configurable name. + words = line.split() + if len(words) < 2: + return False + if len(words) > 2 and words[2] == "=": # expecting Configurable... nameCpp = {"nameJson", + name_cpp = words[1] # nameCpp + name_json = words[3][1:] # expecting "nameJson", + else: + names = words[1].split("{") # expecting Configurable... nameCpp{"nameJson", + if len(names) < 2: + return False + name_cpp = names[0] # nameCpp + name_json = names[1] # expecting "nameJson", + if not name_json: + return False + if name_json[0] != '"': # JSON name is not a literal string. + return True + name_json = name_json.strip('",') # expecting nameJson + # The actual test comes here. + return is_lower_camel_case(name_cpp) and name_cpp == name_json + + +# PWG-HF + + +class TestHfNameStructClass(TestSpec): + """PWGHF: Test names of structs and classes.""" + + name = "pwghf/name/struct-class" + message = 'Names of PWGHF structs and classes must start with "Hf".' + suffixes = [".h", ".cxx"] + + def file_matches(self, path: str) -> bool: + return super().file_matches(path) and "PWGHF/" in path and "Macros/" not in path + + def test_line(self, line: str) -> bool: + if is_comment_cpp(line): + return True + if not line.startswith(("struct ", "class ")): + return True + line = remove_comment_cpp(line) + # Extract struct/class name. + words = line.split() + if not words[1].isalnum(): # "struct : ..." + return True + struct_name = words[1] + # The actual test comes here. + return struct_name.startswith("Hf") + + +class TestHfNameFileTask(TestSpec): + """PWGHF: Test names of task workflow files.""" + + name = "pwghf/name/task-file" + message = 'Name of a PWGHF task workflow file must start with "task".' + suffixes = [".cxx"] + per_line = False + + def file_matches(self, path: str) -> bool: + return super().file_matches(path) and "PWGHF/" in path and "Macros/" not in path + + def test_file(self, path: str, content) -> bool: + file_name = os.path.basename(path) + if "/Tasks/" in path and not file_name.startswith("task"): + return False + return True + + +class TestHfStructMembers(TestSpec): + """PWGHF: Test order of struct members. + Caveat: Does not see Configurables in ConfigurableGroup.""" + + name = "pwghf/struct-member-order" + message = "Declare struct members in the conventional order. See the PWGHF coding guidelines." + suffixes = [".cxx"] + per_line = False + member_order = [ + "Spawns<", + "Builds<", + "Produces<", + "Configurable<", + "HfHelper ", + "SliceCache ", + "Service<", + "using ", + "Filter ", + "Preslice<", + "PresliceUnsorted<", + "Partition<", + "ConfigurableAxis ", + "AxisSpec ", + "HistogramRegistry ", + "OutputObj<", + "void init(", + "void process", + ] + + def file_matches(self, path: str) -> bool: + return super().file_matches(path) and "PWGHF/" in path + + def test_file(self, path: str, content) -> bool: + passed = True + dic_structs: dict[str, dict] = {} + struct_name = "" + for i, line in enumerate(content): + if is_comment_cpp(line): + continue + if line.startswith("struct "): # expecting no indentation + line = remove_comment_cpp(line) + struct_name = line.strip().split()[1] + dic_structs[struct_name] = {} + continue + if not struct_name: + continue + # Save line numbers of members of the current struct for each category. + for member in self.member_order: + if line.startswith(f" {member}"): # expecting single-level indentation for direct members + if member not in dic_structs[struct_name]: + dic_structs[struct_name][member] = [] + dic_structs[struct_name][member].append(i + 1) # save line number + break + # print(dic_struct) + # Detect members declared in a wrong order. + last_line_last_member = 0 # line number of the last member of the previous member category + index_last_member = 0 # index of the previous member category in the member_order list + for struct_name, dic_struct in dic_structs.items(): + for i_m, member in enumerate(self.member_order): + if member not in dic_struct: + continue + first_line = min(dic_struct[member]) # line number of the first member of this category + last_line = max(dic_struct[member]) # line number of the last member of this category + if ( + first_line < last_line_last_member + ): # The current category starts before the end of the previous category. + passed = False + print_error( + path, + first_line, + self.name, + f"{struct_name}: {member.strip()} appears too early " + f"(before end of {self.member_order[index_last_member].strip()}).", + ) + last_line_last_member = last_line + index_last_member = i_m + return passed + + +# End of test implementations + + +def main(): + """Main function""" + parser = argparse.ArgumentParser(description="O2 linter (Find O2-specific issues in O2 code)") + parser.add_argument("paths", type=str, nargs="+", help="File path(s)") + parser.add_argument( + "-g", + dest="github", + action="store_true", + help="Print messages also as GitHub annotations", + ) + args = parser.parse_args() + if args.github: + global github_mode # pylint: disable=global-statement + github_mode = True + + tests = [] # list of activated tests + + # Bad practice + enable_bad_practice = True + if enable_bad_practice: + tests.append(TestIOStream()) + tests.append(TestUsingStd()) + tests.append(TestUsingDirectives()) + tests.append(TestStdPrefix()) + tests.append(TestROOT()) + tests.append(TestPi()) + tests.append(TestTwoPiAddSubtract()) + tests.append(TestPiMultipleFraction()) + tests.append(TestPdgDatabase()) + tests.append(TestPdgCode()) + tests.append(TestPdgMass()) + tests.append(TestLogging()) + tests.append(TestConstRefInForLoop()) + tests.append(TestConstRefInSubscription()) + tests.append(TestWorkflowOptions()) + + # Documentation + enable_documentation = True + if enable_documentation: + tests.append(TestDocumentationFile()) + + # Naming conventions + enable_naming = True + if enable_naming: + tests.append(TestNameFunctionVariable()) + tests.append(TestNameMacro()) + tests.append(TestNameConstant()) + tests.append(TestNameColumn()) + tests.append(TestNameTable()) + tests.append(TestNameNamespace()) + tests.append(TestNameType()) + tests.append(TestNameEnum()) + tests.append(TestNameClass()) + tests.append(TestNameStruct()) + tests.append(TestNameFileCpp()) + tests.append(TestNameFilePython()) + tests.append(TestNameWorkflow()) + tests.append(TestNameTask()) + tests.append(TestNameFileWorkflow()) + tests.append(TestNameConfigurable()) + + # PWG-HF + enable_pwghf = True + if enable_pwghf: + tests.append(TestHfNameStructClass()) + tests.append(TestHfNameFileTask()) + tests.append(TestHfStructMembers()) + + test_names = [t.name for t in tests] # short names of activated tests + suffixes = tuple({s for test in tests for s in test.suffixes}) # all suffixes from all enabled tests + passed = True # global result of all tests + n_files_bad = {name: 0 for name in test_names} # counter of files with issues + + # Report overview before running. + print(f"Testing {len(args.paths)} files.") + # print(args.paths) + print("Enabled tests:", test_names) + print("Suffixes of tested files:", sorted(suffixes)) + # print(f"Github annotations: {github_mode}.") + + # Test files. + for path in args.paths: + # print(f"Processing path \"{path}\".") + # Skip not tested files. + if not path.endswith(suffixes): + # print(f"Skipping path \"{path}\".") + continue + try: + with open(path, "r", encoding="utf-8") as file: + content = file.readlines() + for test in tests: + result = test.run(path, content) + if not result: + n_files_bad[test.name] += 1 + passed = False + # print(f"File \"{path}\" {'passed' if result else 'failed'} the test {test.name}.") + except IOError: + print(f'Failed to open file "{path}".') + sys.exit(1) + + # Report results per test. + print("\nResults per test") + len_max = max(len(name) for name in test_names) + print(f"test{' ' * (len_max - len('test'))}\tissues\tbad files") + for test in tests: + print(f"{test.name}{' ' * (len_max - len(test.name))}\t{test.n_issues}\t{n_files_bad[test.name]}") + + # Report global result. + title_result = "O2 linter result" + if passed: + msg_result = "All tests passed." + if github_mode: + print(f"::notice title={title_result}::{msg_result}") + else: + print(f"{title_result}: {msg_result}") + else: + msg_result = "Issues have been found." + msg_disable = ( + f'You can disable a test for a line by adding a comment with "{prefix_disable}"' + " followed by the name of the test." + ) + if github_mode: + print(f"::error title={title_result}::{msg_result}") + print(f"::notice::{msg_disable}") + else: + print(f"\n{title_result}: {msg_result}") + print(msg_disable) + # Print tips. + print("\nTip: You can run the O2 linter locally with: python3 Scripts/o2_linter.py ") + if not passed: + sys.exit(1) + + +if __name__ == "__main__": + main() From 16c1813f3c9cd8c065d5b8251859f971b6b5c8b0 Mon Sep 17 00:00:00 2001 From: Ionut Cristian Arsene Date: Sat, 30 Nov 2024 00:30:21 +0100 Subject: [PATCH 186/459] [PWGDQ] Implement possibility to specify exclusive decay channels via MCSignal (#8744) Co-authored-by: Ionut Cristian Arsene Co-authored-by: ALICE Action Bot --- PWGDQ/Core/HistogramsLibrary.cxx | 1 + PWGDQ/Core/MCSignal.cxx | 31 +++++++---- PWGDQ/Core/MCSignal.h | 74 ++++++++++++++++++-------- PWGDQ/Core/MCSignalLibrary.cxx | 37 +++++++++++++ PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 5 +- 5 files changed, 114 insertions(+), 34 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 2155f9caade..af804d121b9 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -1355,6 +1355,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "TauzProj", "", false, 4000, -0.5, 0.5, VarManager::kVertexingTauzProjected); hm->AddHistogram(histClass, "TauxyProj", "", false, 4000, -0.5, 0.5, VarManager::kVertexingTauxyProjected); hm->AddHistogram(histClass, "CosPointingAngle", "", false, 100, 0.0, 1.0, VarManager::kCosPointingAngle); + hm->AddHistogram(histClass, "DCAxyzBetweenProngs", "", false, 100, 0.0, 1.0, VarManager::kKFDCAxyzBetweenProngs); } if (subGroupStr.Contains("multidimentional-vertexing-histograms")) { hm->AddHistogram(histClass, "Mass_Tauxy", "", false, 75, 4.0, 7.0, VarManager::kPairMass, 40, -0.0, 0.02, VarManager::kVertexingTauxy); diff --git a/PWGDQ/Core/MCSignal.cxx b/PWGDQ/Core/MCSignal.cxx index e66ebea3687..c35e0548e98 100644 --- a/PWGDQ/Core/MCSignal.cxx +++ b/PWGDQ/Core/MCSignal.cxx @@ -9,6 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include +#include + #include "PWGDQ/Core/MCSignal.h" using std::cout; @@ -22,7 +25,9 @@ MCSignal::MCSignal() : TNamed("", ""), fNProngs(0), fCommonAncestorIdxs({}), fExcludeCommonAncestor(false), - fTempAncestorLabel(-1) + fTempAncestorLabel(-1), + fDecayChannelIsExclusive(false), + fDecayChannelIsNotExclusive(false) { } @@ -32,23 +37,27 @@ MCSignal::MCSignal(int nProngs, const char* name /*= ""*/, const char* title /*= fNProngs(nProngs), fCommonAncestorIdxs({}), fExcludeCommonAncestor(false), - fTempAncestorLabel(-1) + fTempAncestorLabel(-1), + fDecayChannelIsExclusive(false), + fDecayChannelIsNotExclusive(false) { fProngs.reserve(nProngs); } //________________________________________________________________________________________________ -MCSignal::MCSignal(const char* name, const char* title, std::vector prongs, std::vector commonAncestors, bool excludeCommonAncestor) : TNamed(name, title), - fProngs(prongs), - fNProngs(prongs.size()), - fCommonAncestorIdxs(commonAncestors), - fExcludeCommonAncestor(excludeCommonAncestor), - fTempAncestorLabel(-1) +MCSignal::MCSignal(const char* name, const char* title, std::vector prongs, std::vector commonAncestors, bool excludeCommonAncestor) : TNamed(name, title), + fProngs(prongs), + fNProngs(prongs.size()), + fCommonAncestorIdxs(commonAncestors), + fExcludeCommonAncestor(excludeCommonAncestor), + fTempAncestorLabel(-1), + fDecayChannelIsExclusive(false), + fDecayChannelIsNotExclusive(false) { } //________________________________________________________________________________________________ -void MCSignal::SetProngs(std::vector prongs, std::vector commonAncestors) +void MCSignal::SetProngs(std::vector prongs, std::vector commonAncestors) { fProngs = prongs; fNProngs = fProngs.size(); @@ -56,7 +65,7 @@ void MCSignal::SetProngs(std::vector prongs, std::vector commonA } //________________________________________________________________________________________________ -void MCSignal::AddProng(MCProng prong, short commonAncestor) +void MCSignal::AddProng(MCProng prong, int8_t commonAncestor) { if (fProngs.size() < fNProngs) { fProngs.push_back(prong); @@ -71,6 +80,8 @@ void MCSignal::PrintConfig() { cout << "Name/Title: " << fName << " / " << fTitle << endl; cout << "Exclude common ancestor combinations: " << fExcludeCommonAncestor << endl; + cout << "Decay channel is exclusive: " << fDecayChannelIsExclusive << endl; + cout << "Decay channel is not exclusive: " << fDecayChannelIsNotExclusive << endl; cout << "Printing " << fNProngs << "/" << fProngs.size() << " prongs:" << endl; int i = 0; for (auto& pr : fProngs) { diff --git a/PWGDQ/Core/MCSignal.h b/PWGDQ/Core/MCSignal.h index c2fa8227de2..d91e8f7424d 100644 --- a/PWGDQ/Core/MCSignal.h +++ b/PWGDQ/Core/MCSignal.h @@ -66,13 +66,21 @@ class MCSignal : public TNamed { public: MCSignal(); - MCSignal(int nProngs, const char* name = "", const char* title = ""); - MCSignal(const char* name, const char* title, std::vector prongs, std::vector commonAncestors, bool excludeCommonAncestor = false); + MCSignal(int nProngs, const char* name = "", const char* title = ""); // NOLINT + MCSignal(const char* name, const char* title, std::vector prongs, std::vector commonAncestors, bool excludeCommonAncestor = false); MCSignal(const MCSignal& c) = default; ~MCSignal() override = default; - void SetProngs(std::vector prongs, std::vector commonAncestors); - void AddProng(MCProng prong, short commonAncestor = -1); + void SetProngs(std::vector prongs, std::vector commonAncestors); + void AddProng(MCProng prong, int8_t commonAncestor = -1); + void SetDecayChannelIsExclusive(bool option = true) + { + fDecayChannelIsExclusive = option; + } + void SetDecayChannelIsNotExclusive(bool option = true) + { + fDecayChannelIsNotExclusive = option; + } int GetNProngs() const { @@ -82,6 +90,14 @@ class MCSignal : public TNamed { return fProngs[0].fNGenerations; } + bool GetDecayChannelIsExclusive() const + { + return fDecayChannelIsExclusive; + } + bool GetDecayChannelIsNotExclusive() const + { + return fDecayChannelIsNotExclusive; + } template bool CheckSignal(bool checkSources, const T&... args) @@ -97,10 +113,12 @@ class MCSignal : public TNamed void PrintConfig(); private: - std::vector fProngs; - unsigned int fNProngs; - std::vector fCommonAncestorIdxs; - bool fExcludeCommonAncestor; + std::vector fProngs; // vector of MCProng + unsigned int fNProngs; // number of prongs + std::vector fCommonAncestorIdxs; // index of the most recent ancestor, relative to each prong's history + bool fExcludeCommonAncestor; // explicitly request that there is no common ancestor + bool fDecayChannelIsExclusive; // if true, then the indicated mother particle has a number of daughters which is equal to the number of prongs defined in this MC signal + bool fDecayChannelIsNotExclusive; // if true, then the indicated mother particle has a number of daughters which is larger than the number of prongs defined in this MC signal int fTempAncestorLabel; template @@ -139,6 +157,18 @@ bool MCSignal::CheckProng(int i, bool checkSources, const T& track) if (fNProngs > 1 && fCommonAncestorIdxs[i] == j) { if (i == 0) { fTempAncestorLabel = currentMCParticle.globalIndex(); + // In the case of decay channels marked as being "exclusive", check how many decay daughters this mother has registered + // in the stack and compare to the number of prongs defined for this MCSignal. + // If these numbers are equal, it means this decay MCSignal match is exclusive (there are no additional prongs for this mother besides the + // prongs defined here). + if (currentMCParticle.has_daughters()) { + if (fDecayChannelIsExclusive && currentMCParticle.daughtersIds()[1] - currentMCParticle.daughtersIds()[0] + 1 != fNProngs) { + return false; + } + if (fDecayChannelIsNotExclusive && currentMCParticle.daughtersIds()[1] - currentMCParticle.daughtersIds()[0] + 1 == fNProngs) { + return false; + } + } } else { if (currentMCParticle.globalIndex() != fTempAncestorLabel && !fExcludeCommonAncestor) return false; @@ -185,27 +215,27 @@ bool MCSignal::CheckProng(int i, bool checkSources, const T& track) // check each source uint64_t sourcesDecision = 0; // Check kPhysicalPrimary - if (fProngs[i].fSourceBits[j] & (uint64_t(1) << MCProng::kPhysicalPrimary)) { - if ((fProngs[i].fExcludeSource[j] & (uint64_t(1) << MCProng::kPhysicalPrimary)) != currentMCParticle.isPhysicalPrimary()) { - sourcesDecision |= (uint64_t(1) << MCProng::kPhysicalPrimary); + if (fProngs[i].fSourceBits[j] & (static_cast(1) << MCProng::kPhysicalPrimary)) { + if ((fProngs[i].fExcludeSource[j] & (static_cast(1) << MCProng::kPhysicalPrimary)) != currentMCParticle.isPhysicalPrimary()) { + sourcesDecision |= (static_cast(1) << MCProng::kPhysicalPrimary); } } // Check kProducedInTransport - if (fProngs[i].fSourceBits[j] & (uint64_t(1) << MCProng::kProducedInTransport)) { - if ((fProngs[i].fExcludeSource[j] & (uint64_t(1) << MCProng::kProducedInTransport)) != (!currentMCParticle.producedByGenerator())) { - sourcesDecision |= (uint64_t(1) << MCProng::kProducedInTransport); + if (fProngs[i].fSourceBits[j] & (static_cast(1) << MCProng::kProducedInTransport)) { + if ((fProngs[i].fExcludeSource[j] & (static_cast(1) << MCProng::kProducedInTransport)) != (!currentMCParticle.producedByGenerator())) { + sourcesDecision |= (static_cast(1) << MCProng::kProducedInTransport); } } // Check kProducedByGenerator - if (fProngs[i].fSourceBits[j] & (uint64_t(1) << MCProng::kProducedByGenerator)) { - if ((fProngs[i].fExcludeSource[j] & (uint64_t(1) << MCProng::kProducedByGenerator)) != currentMCParticle.producedByGenerator()) { - sourcesDecision |= (uint64_t(1) << MCProng::kProducedByGenerator); + if (fProngs[i].fSourceBits[j] & (static_cast(1) << MCProng::kProducedByGenerator)) { + if ((fProngs[i].fExcludeSource[j] & (static_cast(1) << MCProng::kProducedByGenerator)) != currentMCParticle.producedByGenerator()) { + sourcesDecision |= (static_cast(1) << MCProng::kProducedByGenerator); } } // Check kFromBackgroundEvent - if (fProngs[i].fSourceBits[j] & (uint64_t(1) << MCProng::kFromBackgroundEvent)) { - if ((fProngs[i].fExcludeSource[j] & (uint64_t(1) << MCProng::kFromBackgroundEvent)) != currentMCParticle.fromBackgroundEvent()) { - sourcesDecision |= (uint64_t(1) << MCProng::kFromBackgroundEvent); + if (fProngs[i].fSourceBits[j] & (static_cast(1) << MCProng::kFromBackgroundEvent)) { + if ((fProngs[i].fExcludeSource[j] & (static_cast(1) << MCProng::kFromBackgroundEvent)) != currentMCParticle.fromBackgroundEvent()) { + sourcesDecision |= (static_cast(1) << MCProng::kFromBackgroundEvent); } } // no source bit is fulfilled @@ -246,9 +276,9 @@ bool MCSignal::CheckProng(int i, bool checkSources, const T& track) } } - if (fProngs[i].fPDGInHistory.size() == 0) + if (fProngs[i].fPDGInHistory.size() == 0) { return true; - else { // check if mother pdg is in history + } else { // check if mother pdg is in history std::vector pdgInHistory; // while find mothers, check if the provided PDG codes are included or excluded in the particle decay history diff --git a/PWGDQ/Core/MCSignalLibrary.cxx b/PWGDQ/Core/MCSignalLibrary.cxx index b4061743a7d..8c1c8af9fde 100644 --- a/PWGDQ/Core/MCSignalLibrary.cxx +++ b/PWGDQ/Core/MCSignalLibrary.cxx @@ -11,6 +11,8 @@ // // Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no // +#include + #include #include "CommonConstants/PhysicsConstants.h" #include "PWGDQ/Core/MCSignalLibrary.h" @@ -405,6 +407,11 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) signal = new MCSignal(name, "Electrons from jpsi decays", {prong}, {-1}); return signal; } + if (!nameStr.compare("anythingFromJpsi")) { + MCProng prong(2, {MCProng::kPDGCodeNotAssigned, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Anything from jpsi decays", {prong}, {-1}); + return signal; + } if (!nameStr.compare("eFromPromptJpsi")) { MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); prong.SetSourceBit(0, MCProng::kPhysicalPrimary); @@ -701,6 +708,20 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) signal = new MCSignal(name, "ee pairs from j/psi decays", {prong, prong}, {1, 1}); // signal at pair level return signal; } + if (!nameStr.compare("eeFromJpsiExclusive")) { + MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + prong.SetSourceBit(0, MCProng::kPhysicalPrimary); + signal = new MCSignal(name, "ee pairs from j/psi decays", {prong, prong}, {1, 1}); // signal at pair level + signal->SetDecayChannelIsExclusive(true); + return signal; + } + if (!nameStr.compare("eeFromJpsiNotExclusive")) { + MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + prong.SetSourceBit(0, MCProng::kPhysicalPrimary); + signal = new MCSignal(name, "ee pairs from j/psi decays", {prong, prong}, {1, 1}); // signal at pair level + signal->SetDecayChannelIsNotExclusive(true); + return signal; + } if (!nameStr.compare("eePrimaryFromPromptJPsi")) { MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}, false, {503}, {true}); prong.SetSourceBit(0, MCProng::kPhysicalPrimary); @@ -1120,6 +1141,22 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) return signal; } + if (!nameStr.compare("eeKaonFromBplusExclusive")) { + MCProng pronge(3, {11, 443, 521}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + MCProng prongKaon(2, {321, 521}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Kaon and electron pair from B+", {pronge, pronge, prongKaon}, {2, 2, 1}); + signal->SetDecayChannelIsExclusive(true); + return signal; + } + + if (!nameStr.compare("eeKaonFromBplusNotExclusive")) { + MCProng pronge(3, {11, 443, 521}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + MCProng prongKaon(2, {321, 521}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Kaon and electron pair from B+", {pronge, pronge, prongKaon}, {2, 2, 1}); + signal->SetDecayChannelIsNotExclusive(true); + return signal; + } + if (!nameStr.compare("Bplus")) { MCProng prong(1, {521}, {true}, {false}, {0}, {0}, {false}); signal = new MCSignal(name, "B+", {prong}, {-1}); diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index b6ce89fdeec..1f190c9fae4 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -79,6 +79,7 @@ DECLARE_SOA_COLUMN(TauxyBcandidate, tauxyBcandidate, float); DECLARE_SOA_COLUMN(TauzBcandidate, tauzBcandidate, float); DECLARE_SOA_COLUMN(CosPBcandidate, cosPBcandidate, float); DECLARE_SOA_COLUMN(Chi2Bcandidate, chi2Bcandidate, float); +DECLARE_SOA_COLUMN(DCAxyzBetweenProngs, dcaxyzBetweenProngs, float); DECLARE_SOA_COLUMN(McFlag, mcFlag, int8_t); } // namespace dqanalysisflags @@ -88,7 +89,7 @@ DECLARE_SOA_TABLE(BarrelAmbiguities, "AOD", "DQBARRELAMB", dqanalysisflags::Barr DECLARE_SOA_TABLE(MuonTrackCuts, "AOD", "DQANAMUONCUTS", dqanalysisflags::IsMuonSelected); //! joinable to ReducedMuonsAssoc DECLARE_SOA_TABLE(MuonAmbiguities, "AOD", "DQMUONAMB", dqanalysisflags::MuonAmbiguityInBunch, dqanalysisflags::MuonAmbiguityOutOfBunch); //! joinable to ReducedMuonTracks DECLARE_SOA_TABLE(Prefilter, "AOD", "DQPREFILTER", dqanalysisflags::IsBarrelSelectedPrefilter); //! joinable to ReducedTracksAssoc -DECLARE_SOA_TABLE(BmesonCandidates, "AOD", "DQBMESONS", dqanalysisflags::massBcandidate, dqanalysisflags::pTBcandidate, dqanalysisflags::LxyBcandidate, dqanalysisflags::LxyzBcandidate, dqanalysisflags::LzBcandidate, dqanalysisflags::TauxyBcandidate, dqanalysisflags::TauzBcandidate, dqanalysisflags::CosPBcandidate, dqanalysisflags::Chi2Bcandidate, dqanalysisflags::McFlag); +DECLARE_SOA_TABLE(BmesonCandidates, "AOD", "DQBMESONS", dqanalysisflags::massBcandidate, dqanalysisflags::pTBcandidate, dqanalysisflags::LxyBcandidate, dqanalysisflags::LxyzBcandidate, dqanalysisflags::LzBcandidate, dqanalysisflags::TauxyBcandidate, dqanalysisflags::TauzBcandidate, dqanalysisflags::DCAxyzBetweenProngs, dqanalysisflags::CosPBcandidate, dqanalysisflags::Chi2Bcandidate, dqanalysisflags::McFlag); } // namespace o2::aod // Declarations of various short names @@ -2136,7 +2137,7 @@ struct AnalysisDileptonTrack { } } // table to be written out for ML analysis - BmesonsTable(fValuesHadron[VarManager::kPairMass], fValuesHadron[VarManager::kPairPt], fValuesHadron[VarManager::kVertexingLxy], fValuesHadron[VarManager::kVertexingLxyz], fValuesHadron[VarManager::kVertexingLz], fValuesHadron[VarManager::kVertexingTauxy], fValuesHadron[VarManager::kVertexingTauz], fValuesHadron[VarManager::kCosPointingAngle], fValuesHadron[VarManager::kVertexingChi2PCA], mcDecision); + BmesonsTable(fValuesHadron[VarManager::kPairMass], fValuesHadron[VarManager::kPairPt], fValuesHadron[VarManager::kVertexingLxy], fValuesHadron[VarManager::kVertexingLxyz], fValuesHadron[VarManager::kVertexingLz], fValuesHadron[VarManager::kVertexingTauxy], fValuesHadron[VarManager::kVertexingTauz], fValuesHadron[VarManager::kKFDCAxyzBetweenProngs], fValuesHadron[VarManager::kCosPointingAngle], fValuesHadron[VarManager::kVertexingChi2PCA], mcDecision); } } // end loop over dileptons } From 907fbc2acf871ffecd135366ac7360785c1d68b5 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Sat, 30 Nov 2024 23:28:49 +0100 Subject: [PATCH 187/459] [PWGEM/Dilepton] update prefiter task and phiv sorted by pT (#8748) --- PWGEM/Dilepton/Core/DielectronCut.cxx | 29 +-- PWGEM/Dilepton/Core/DielectronCut.h | 91 +------ PWGEM/Dilepton/Core/Dilepton.h | 56 ++-- PWGEM/Dilepton/Core/DileptonMC.h | 58 ++--- PWGEM/Dilepton/Core/EMEventCut.cxx | 6 + PWGEM/Dilepton/Core/EMEventCut.h | 15 +- PWGEM/Dilepton/Core/PhotonHBT.h | 6 +- PWGEM/Dilepton/Core/SingleTrackQC.h | 1 + PWGEM/Dilepton/Core/SingleTrackQCMC.h | 1 + PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 253 +++++++------------ PWGEM/Dilepton/Tasks/vpPairQC.cxx | 13 +- PWGEM/Dilepton/Tasks/vpPairQCMC.cxx | 8 +- PWGEM/Dilepton/Utils/PairUtilities.h | 20 +- 13 files changed, 187 insertions(+), 370 deletions(-) diff --git a/PWGEM/Dilepton/Core/DielectronCut.cxx b/PWGEM/Dilepton/Core/DielectronCut.cxx index 38e6e9c6103..baeeda564ec 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.cxx +++ b/PWGEM/Dilepton/Core/DielectronCut.cxx @@ -10,7 +10,7 @@ // or submit itself to any jurisdiction. // -// Class for dilepton Cut +// Class for dielectron Cut // #include @@ -54,18 +54,12 @@ void DielectronCut::SetPairOpAng(float minOpAng, float maxOpAng) mMaxOpAng = maxOpAng; LOG(info) << "Dielectron Cut, set pair opening angle range: " << mMinOpAng << " - " << mMaxOpAng; } -void DielectronCut::SetMaxPhivPairMeeDep(std::function meeDepCut) -{ - mMaxPhivPairMeeDep = meeDepCut; - LOG(info) << "Dielectron Cut, set max phiv pair mee dep: " << mMaxPhivPairMeeDep(0.02); -} -void DielectronCut::SetPhivPairRange(float min_phiv, float max_phiv, float min_mee, float max_mee) +void DielectronCut::SetMaxMeePhiVDep(std::function phivDepCut, float min_phiv, float max_phiv) { + mMaxMeePhiVDep = phivDepCut; mMinPhivPair = min_phiv; mMaxPhivPair = max_phiv; - mMinMeeForPhivPair = min_mee; - mMaxMeeForPhivPair = max_mee; - LOG(info) << "Dielectron Cut, set phiv range: " << mMinPhivPair << " - " << mMaxPhivPair << " and mee range: " << mMinMeeForPhivPair << " - " << mMaxMeeForPhivPair; + LOG(info) << "Dielectron Cut, set max mee phiv dep: " << mMaxMeePhiVDep(2.5); } void DielectronCut::SelectPhotonConversion(bool flag) { @@ -84,21 +78,6 @@ void DielectronCut::SetRequireDifferentSides(bool flag) mRequireDiffSides = flag; LOG(info) << "Dielectron Cut, require 2 tracks to be from different sides: " << mRequireDiffSides; } -void DielectronCut::SetPrefilterPhiV(float max_mee_uls, float max_phiv_uls, float max_mee_ls, float max_phiv_ls) -{ - mMaxMee_phiv_uls = max_mee_uls; - mMaxPhiV_uls = max_phiv_uls; - mSlope_phiv_ls = max_mee_ls / (M_PI - max_phiv_ls); - mIntercept_phiv_ls = max_mee_ls - mSlope_phiv_ls * M_PI; - LOG(info) << "Dielectron Cut, set phiv prefilter ULS: " << " mMaxMee_phiv_uls: " << mMaxMee_phiv_uls << " mMaxPhiV_uls: " << mMaxPhiV_uls; - LOG(info) << "Dielectron Cut, set phiv prefilter LS: " << " mSlope_phiv_ls: " << mSlope_phiv_ls << " mIntercept_phiv_ls: " << mIntercept_phiv_ls; -} -void DielectronCut::SetPrefilterMee(float min_mee_uls, float max_mee_uls) -{ - mMinMee_uls = min_mee_uls; - mMaxMee_uls = max_mee_uls; - LOG(info) << "Dielectron Cut, set mee prefilter ULS: " << " mMinMee_uls: " << mMinMee_uls << " mMaxMee_uls: " << mMaxMee_uls; -} void DielectronCut::SetTrackPtRange(float minPt, float maxPt) { mMinTrackPt = minPt; diff --git a/PWGEM/Dilepton/Core/DielectronCut.h b/PWGEM/Dilepton/Core/DielectronCut.h index f08d8cd3fcb..5c533671795 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.h +++ b/PWGEM/Dilepton/Core/DielectronCut.h @@ -128,14 +128,8 @@ class DielectronCut : public TNamed } if (mApplyPhiV) { - if (mMaxPhivPairMeeDep) { - if ((phiv < mMinPhivPair || mMaxPhivPairMeeDep(v12.M()) < phiv) ^ mSelectPC) { - return false; - } - } else { - if ((!(mMinPhivPair < phiv && phiv < mMaxPhivPair) && !(mMinMeeForPhivPair < v12.M() && v12.M() < mMaxMeeForPhivPair)) ^ mSelectPC) { - return false; - } + if (((mMinPhivPair < phiv && phiv < mMaxPhivPair) && v12.M() < mMaxMeePhiVDep(phiv)) ^ mSelectPC) { + return false; } } @@ -161,70 +155,6 @@ class DielectronCut : public TNamed return true; } - template - bool IsSelectedPair_PrefilterULS(TTrack1 const& t1, TTrack2 const& t2, const float bz) const - { - // don't move this function into IsSelectedPair. - if (!IsSelectedPair_PrefilterULS_Mee(t1, t2, bz)) { - return false; - } - if (!IsSelectedPair_PrefilterULS_PhiV(t1, t2, bz)) { - return false; - } - return true; - } - - template - bool IsSelectedPair_PrefilterULS_Mee(TTrack1 const& t1, TTrack2 const& t2, const float /*bz*/) const - { - // don't move this function into IsSelectedPair. - ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), o2::constants::physics::MassElectron); - ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassElectron); - ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - if (mMinMee_uls < v12.M() && v12.M() < mMaxMee_uls) { - return false; - } - return true; - } - - template - bool IsSelectedPair_PrefilterULS_PhiV(TTrack1 const& t1, TTrack2 const& t2, const float bz) const - { - // don't move this function into IsSelectedPair. - ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), o2::constants::physics::MassElectron); - ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassElectron); - ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - float phiv = getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), bz); - if (v12.M() < mMaxMee_phiv_uls && mMaxPhiV_uls < phiv) { - return false; - } - return true; - } - - template - bool IsSelectedPair_PrefilterLS(TTrack1 const& t1, TTrack2 const& t2, const float bz) const - { - // don't move this function into IsSelectedPair. - if (!IsSelectedPair_PrefilterLS_PhiV(t1, t2, bz)) { - return false; - } - return true; - } - - template - bool IsSelectedPair_PrefilterLS_PhiV(TTrack1 const& t1, TTrack2 const& t2, const float bz) const - { - // don't move this function into IsSelectedPair. - ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), o2::constants::physics::MassElectron); - ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassElectron); - ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - float phiv = getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), bz); - if (v12.M() < phiv * mSlope_phiv_ls + mIntercept_phiv_ls || v12.M() < (M_PI - phiv) * mSlope_phiv_ls + mIntercept_phiv_ls) { - return false; - } - return true; - } - template bool IsSelectedTrack(TTrack const& track, TCollision const& collision = 0) const { @@ -472,13 +402,10 @@ class DielectronCut : public TNamed void SetPairDCARange(float min = 0.f, float max = 1e10f); // 3D DCA in sigma void SetMeeRange(float min = 0.f, float max = 0.5); void SetPairOpAng(float minOpAng = 0.f, float maxOpAng = 1e10f); - void SetMaxPhivPairMeeDep(std::function meeDepCut); - void SetPhivPairRange(float min_phiv, float max_phiv, float min_mee, float max_mee); + void SetMaxMeePhiVDep(std::function phivDepCut, float min_phiv, float max_phiv); void SelectPhotonConversion(bool flag); void SetMindEtadPhi(bool flag, float min_deta, float min_dphi); void SetRequireDifferentSides(bool flag); - void SetPrefilterPhiV(float max_mee_uls, float max_phiv_uls, float max_mee_ls, float max_phiv_ls); - void SetPrefilterMee(float min_mee_uls, float max_mee_uls); void SetTrackPtRange(float minPt = 0.f, float maxPt = 1e10f); void SetTrackEtaRange(float minEta = -1e10f, float maxEta = 1e10f); @@ -537,20 +464,14 @@ class DielectronCut : public TNamed float mMinPairY{-1e10f}, mMaxPairY{1e10f}; // range in rapidity float mMinPairDCA3D{0.f}, mMaxPairDCA3D{1e10f}; // range in 3D DCA in sigma float mMinPhivPair{0.f}, mMaxPhivPair{+3.2}; - float mMinMeeForPhivPair{0.f}, mMaxMeeForPhivPair{1e10f}; - std::function mMaxPhivPairMeeDep{}; // max phiv as a function of mee - bool mSelectPC{false}; // flag to select photon conversion used in mMaxPhivPairMeeDep - bool mApplydEtadPhi{false}; // flag to apply deta, dphi cut between 2 tracks + std::function mMaxMeePhiVDep{}; // max mee as a function of phiv + bool mSelectPC{false}; // flag to select photon conversion used in mMaxPhivPairMeeDep + bool mApplydEtadPhi{false}; // flag to apply deta, dphi cut between 2 tracks float mMinDeltaEta{0.f}; float mMinDeltaPhi{0.f}; float mMinOpAng{0.f}, mMaxOpAng{1e10f}; bool mRequireDiffSides{false}; // flag to require 2 tracks to be from different sides. (A-C combination). If one wants 2 tracks to be in the same side (A-A or C-C), one can simply use track eta cut. - // only for prefilter - float mMinMee_uls{0.f}, mMaxMee_uls{0.f}; - float mMaxMee_phiv_uls{0.f}, mMaxPhiV_uls{0.f}; // rectangle - float mSlope_phiv_ls{0.f}, mIntercept_phiv_ls{0.f}; // mee > phiv * slope + intercept - // kinematic cuts float mMinTrackPt{0.f}, mMaxTrackPt{1e10f}; // range in pT float mMinTrackEta{-1e10f}, mMaxTrackEta{1e10f}; // range in eta diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 2a37b7be9b3..b7f237748ec 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -150,6 +150,7 @@ struct Dilepton { Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; } eventcuts; DielectronCut fDielectronCut; @@ -163,35 +164,27 @@ struct Dilepton { Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; Configurable cfg_apply_pf{"cfg_apply_pf", false, "flag to apply phiv prefilter"}; - Configurable cfg_apply_phiv_meedep{"cfg_apply_phiv_meedep", true, "flag to apply mee-dependent phiv cut"}; + Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; - Configurable cfg_min_mee_for_phiv{"cfg_min_mee_for_phiv", 0.0, "min mee for phiv (constant)"}; - Configurable cfg_max_mee_for_phiv{"cfg_max_mee_for_phiv", 1e+10, "max mee for phiv (constant)"}; Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; Configurable cfg_apply_dzrdphi_geom{"cfg_apply_dzrdphi_geom", false, "flag to apply generator dz-rdphi elliptic cut"}; - Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 1.2, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; - Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 2.4, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; + Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 5, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; + Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 20, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply phiv cut inherited from prefilter"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kFakeMatchITSTPC : 4] Please consider logical-OR among them."}; // see PairUtilities.h - Configurable cfgMinMee_uls{"cfgMinMee_uls", 0.0, "min mee for prefilter in GeV/c2"}; // only for ULS - Configurable cfgMaxMee_uls{"cfgMaxMee_uls", 0.01, "max mee for prefilter in GeV/c2"}; // only for ULS - Configurable cfgMaxMee_for_phiv_uls{"cfgMaxMee_for_phiv_uls", 0.65, "max mee at phiv = pi for ULS"}; // GeV/c2 - Configurable cfgMaxPhiV_uls{"cfgMaxPhiV_uls", 2.9, "min phiv for in ULS"}; // radian - Configurable cfgMaxMee_for_phiv_ls{"cfgMinMee_for_phiv", 0.25, "max mee at phiv = 0 and pi for LS"}; // GeV/c2 // symmetric - Configurable cfgMaxPhiV_ls{"cfgMaxPhiV_ls", 2.5, "min phiv for LS"}; // radian + Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrack : 4] Please consider logical-OR among them."}; // see PairUtilities.h Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; @@ -259,6 +252,7 @@ struct Dilepton { Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.1, "min pT for single track"}; + Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; @@ -537,7 +531,7 @@ struct Dilepton { if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca}, true); - fRegistry.add("Pair/same/uls/hsDeltaP", "difference of p between 2 tracks;|p_{T,1} - p_{T,2}|/|p_{T,1} + p_{T,2}|;#Delta#eta;#Delta#varphi (rad.);", kTHnSparseD, {{20, 0, 1}, {100, -0.5, +0.5}, {180, -M_PI, M_PI}}, true); + fRegistry.add("Pair/same/uls/hsDeltaP", "difference of p between 2 tracks;|p_{T,1} - p_{T,2}|/|p_{T,1} + p_{T,2}|;#Delta#eta;#Delta#varphi (rad.);", kTHnSparseD, {{20, 0, 1}, {100, -1, +1}, {180, -M_PI, M_PI}}, true); fRegistry.add("Pair/same/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {80, -20, 20}}, true); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron @@ -655,29 +649,15 @@ struct Dilepton { fDielectronCut.SetPairPtRange(dielectroncuts.cfg_min_pair_pt, dielectroncuts.cfg_max_pair_pt); fDielectronCut.SetPairYRange(dielectroncuts.cfg_min_pair_y, dielectroncuts.cfg_max_pair_y); fDielectronCut.SetPairDCARange(dielectroncuts.cfg_min_pair_dca3d, dielectroncuts.cfg_max_pair_dca3d); // in sigma - if (dielectroncuts.cfg_apply_phiv_meedep) { - fDielectronCut.SetMaxPhivPairMeeDep([&](float mll) { return (mll - dielectroncuts.cfg_phiv_intercept) / dielectroncuts.cfg_phiv_slope; }); - } else { - fDielectronCut.SetPhivPairRange(dielectroncuts.cfg_min_phiv, dielectroncuts.cfg_max_phiv, dielectroncuts.cfg_min_mee_for_phiv, dielectroncuts.cfg_max_mee_for_phiv); - } + fDielectronCut.SetMaxMeePhiVDep([&](float phiv) { return dielectroncuts.cfg_phiv_intercept + phiv * dielectroncuts.cfg_phiv_slope; }, dielectroncuts.cfg_min_phiv, dielectroncuts.cfg_max_phiv); fDielectronCut.ApplyPhiV(dielectroncuts.cfg_apply_phiv); fDielectronCut.ApplyPrefilter(dielectroncuts.cfg_apply_pf); fDielectronCut.SetMindEtadPhi(dielectroncuts.cfg_apply_detadphi, dielectroncuts.cfg_min_deta, dielectroncuts.cfg_min_dphi); fDielectronCut.SetPairOpAng(dielectroncuts.cfg_min_opang, dielectroncuts.cfg_max_opang); fDielectronCut.SetRequireDifferentSides(dielectroncuts.cfg_require_diff_sides); - // for prefilter - if (dielectroncuts.cfg_apply_cuts_from_prefilter) { - if ((dielectroncuts.cfg_prefilter_bits & (1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > 0) { - fDielectronCut.SetPrefilterMee(dielectroncuts.cfgMinMee_uls, dielectroncuts.cfgMaxMee_uls); - } - if ((dielectroncuts.cfg_prefilter_bits & (1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC))) > 0) { - fDielectronCut.SetPrefilterPhiV(dielectroncuts.cfgMaxMee_for_phiv_uls, dielectroncuts.cfgMaxPhiV_uls, dielectroncuts.cfgMaxMee_for_phiv_ls, dielectroncuts.cfgMaxPhiV_ls); - } - } - // for track - fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, 1e+10f); + fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, dielectroncuts.cfg_max_pt_track); fDielectronCut.SetTrackEtaRange(dielectroncuts.cfg_min_eta_track, dielectroncuts.cfg_max_eta_track); fDielectronCut.SetTrackPhiRange(dielectroncuts.cfg_min_phi_track, dielectroncuts.cfg_max_phi_track); fDielectronCut.SetMinNClustersTPC(dielectroncuts.cfg_min_ncluster_tpc); @@ -745,7 +725,7 @@ struct Dilepton { // for track fDimuonCut.SetTrackType(dimuoncuts.cfg_track_type); - fDimuonCut.SetTrackPtRange(dimuoncuts.cfg_min_pt_track, 1e10f); + fDimuonCut.SetTrackPtRange(dimuoncuts.cfg_min_pt_track, dimuoncuts.cfg_max_pt_track); fDimuonCut.SetTrackEtaRange(dimuoncuts.cfg_min_eta_track, dimuoncuts.cfg_max_eta_track); fDimuonCut.SetTrackEtaRange(dimuoncuts.cfg_min_phi_track, dimuoncuts.cfg_max_phi_track); fDimuonCut.SetNClustersMFT(dimuoncuts.cfg_min_ncluster_mft, 10); @@ -882,9 +862,9 @@ struct Dilepton { return false; } - if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { - return false; - } + // if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { + // return false; + // } if constexpr (ev_id == 0) { dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; @@ -1205,7 +1185,7 @@ struct Dilepton { Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC))) <= static_cast(0), true), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) <= static_cast(0), true), o2::aod::emprimaryelectron::pfbpi0 >= static_cast(0)); Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); @@ -1457,9 +1437,9 @@ struct Dilepton { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } - if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { - return false; - } + // if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { + // return false; + // } float dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; float dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; o2::math_utils::bringToPMPi(dphi_geom); diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index a8b57d937af..1bab04568a3 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -128,6 +128,7 @@ struct DileptonMC { Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; } eventcuts; DielectronCut fDielectronCut; @@ -141,35 +142,27 @@ struct DileptonMC { Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; Configurable cfg_apply_pf{"cfg_apply_pf", false, "flag to apply phiv prefilter"}; - Configurable cfg_apply_phiv_meedep{"cfg_apply_phiv_meedep", true, "flag to apply mee-dependent phiv cut"}; + Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; - Configurable cfg_min_mee_for_phiv{"cfg_min_mee_for_phiv", 0.0, "min mee for phiv (constant)"}; - Configurable cfg_max_mee_for_phiv{"cfg_max_mee_for_phiv", 1e+10, "max mee for phiv (constant)"}; Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; Configurable cfg_apply_dzrdphi_geom{"cfg_apply_dzrdphi_geom", false, "flag to apply generator dz-rdphi elliptic cut"}; - Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 1.2, "geometrical min deta between 2 electrons (elliptic cut)"}; - Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 2.4, "geometrical min dphi between 2 electrons (elliptic cut)"}; + Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 5, "geometrical min deta between 2 electrons (elliptic cut)"}; + Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 20, "geometrical min dphi between 2 electrons (elliptic cut)"}; Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply phiv cut inherited from prefilter"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kFakeMatchITSTPC : 4] Please consider logical-OR among them."}; // see PairUtilities.h - Configurable cfgMinMee_uls{"cfgMinMee_uls", 0.0, "min mee for prefilter in GeV/c2"}; // only for ULS - Configurable cfgMaxMee_uls{"cfgMaxMee_uls", 0.01, "max mee for prefilter in GeV/c2"}; // only for ULS - Configurable cfgMaxMee_for_phiv_uls{"cfgMaxMee_for_phiv_uls", 0.65, "max mee at phiv = pi for ULS"}; // GeV/c2 - Configurable cfgMaxPhiV_uls{"cfgMaxPhiV_uls", 2.9, "min phiv for in ULS"}; // radian - Configurable cfgMaxMee_for_phiv_ls{"cfgMinMee_for_phiv", 0.25, "max mee at phiv = 0 and pi for LS"}; // GeV/c2 // symmetric - Configurable cfgMaxPhiV_ls{"cfgMaxPhiV_ls", 2.5, "min phiv for LS"}; // radian + Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrack : 4] Please consider logical-OR among them."}; // see PairUtilities.h Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "max eta for single track"}; Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; @@ -237,6 +230,7 @@ struct DileptonMC { Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.1, "min pT for single track"}; + Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; @@ -555,29 +549,15 @@ struct DileptonMC { fDielectronCut.SetPairPtRange(dielectroncuts.cfg_min_pair_pt, dielectroncuts.cfg_max_pair_pt); fDielectronCut.SetPairYRange(dielectroncuts.cfg_min_pair_y, dielectroncuts.cfg_max_pair_y); fDielectronCut.SetPairDCARange(dielectroncuts.cfg_min_pair_dca3d, dielectroncuts.cfg_max_pair_dca3d); // in sigma - if (dielectroncuts.cfg_apply_phiv_meedep) { - fDielectronCut.SetMaxPhivPairMeeDep([&](float mll) { return (mll - dielectroncuts.cfg_phiv_intercept) / dielectroncuts.cfg_phiv_slope; }); - } else { - fDielectronCut.SetPhivPairRange(dielectroncuts.cfg_min_phiv, dielectroncuts.cfg_max_phiv, dielectroncuts.cfg_min_mee_for_phiv, dielectroncuts.cfg_max_mee_for_phiv); - } + fDielectronCut.SetMaxMeePhiVDep([&](float phiv) { return dielectroncuts.cfg_phiv_intercept + phiv * dielectroncuts.cfg_phiv_slope; }, dielectroncuts.cfg_min_phiv, dielectroncuts.cfg_max_phiv); fDielectronCut.ApplyPhiV(dielectroncuts.cfg_apply_phiv); fDielectronCut.ApplyPrefilter(dielectroncuts.cfg_apply_pf); fDielectronCut.SetMindEtadPhi(dielectroncuts.cfg_apply_detadphi, dielectroncuts.cfg_min_deta, dielectroncuts.cfg_min_dphi); fDielectronCut.SetPairOpAng(dielectroncuts.cfg_min_opang, dielectroncuts.cfg_max_opang); fDielectronCut.SetRequireDifferentSides(dielectroncuts.cfg_require_diff_sides); - // for prefilter - if (dielectroncuts.cfg_apply_cuts_from_prefilter) { - if ((dielectroncuts.cfg_prefilter_bits & (1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > 0) { - fDielectronCut.SetPrefilterMee(dielectroncuts.cfgMinMee_uls, dielectroncuts.cfgMaxMee_uls); - } - if ((dielectroncuts.cfg_prefilter_bits & (1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC))) > 0) { - fDielectronCut.SetPrefilterPhiV(dielectroncuts.cfgMaxMee_for_phiv_uls, dielectroncuts.cfgMaxPhiV_uls, dielectroncuts.cfgMaxMee_for_phiv_ls, dielectroncuts.cfgMaxPhiV_ls); - } - } - // for track - fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, 1e+10f); + fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, dielectroncuts.cfg_max_pt_track); fDielectronCut.SetTrackEtaRange(-dielectroncuts.cfg_max_eta_track, +dielectroncuts.cfg_max_eta_track); fDielectronCut.SetTrackPhiRange(-dielectroncuts.cfg_max_phi_track, +dielectroncuts.cfg_max_phi_track); fDielectronCut.SetMinNClustersTPC(dielectroncuts.cfg_min_ncluster_tpc); @@ -645,7 +625,7 @@ struct DileptonMC { // for track fDimuonCut.SetTrackType(dimuoncuts.cfg_track_type); - fDimuonCut.SetTrackPtRange(dimuoncuts.cfg_min_pt_track, 1e10f); + fDimuonCut.SetTrackPtRange(dimuoncuts.cfg_min_pt_track, dimuoncuts.cfg_max_pt_track); fDimuonCut.SetTrackEtaRange(dimuoncuts.cfg_min_eta_track, dimuoncuts.cfg_max_eta_track); fDimuonCut.SetTrackPhiRange(dimuoncuts.cfg_min_phi_track, dimuoncuts.cfg_max_phi_track); fDimuonCut.SetNClustersMFT(dimuoncuts.cfg_min_ncluster_mft, 10); @@ -744,9 +724,9 @@ struct DileptonMC { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } - if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { - return false; - } + // if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { + // return false; + // } if (dielectroncuts.cfg_x_to_go > 0.f) { auto track_par_cov1 = getTrackParCov(t1); @@ -1084,7 +1064,7 @@ struct DileptonMC { Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC))) <= static_cast(0), true), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) <= static_cast(0), true), o2::aod::emprimaryelectron::pfbpi0 >= static_cast(0)); Preslice perCollision_muon = aod::emprimarymuon::emeventId; @@ -1668,9 +1648,9 @@ struct DileptonMC { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } - if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { - return false; - } + // if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { + // return false; + // } if (dielectroncuts.cfg_x_to_go > 0.f) { auto track_par_cov1 = getTrackParCov(t1); track_par_cov1.setPID(o2::track::PID::Electron); @@ -1824,7 +1804,7 @@ struct DileptonMC { ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), leptonM2); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - if (t1.pt() < dielectroncuts.cfg_min_pt_track || t2.pt() < dielectroncuts.cfg_min_pt_track) { + if ((t1.pt() < dielectroncuts.cfg_min_pt_track || dielectroncuts.cfg_max_pt_track < t1.pt()) || (t2.pt() < dielectroncuts.cfg_min_pt_track || dielectroncuts.cfg_max_pt_track < t2.pt())) { return false; } if ((t1.eta() < dielectroncuts.cfg_min_eta_track || dielectroncuts.cfg_max_eta_track < t1.eta()) || (t2.eta() < dielectroncuts.cfg_min_eta_track || dielectroncuts.cfg_max_eta_track < t2.eta())) { @@ -1835,7 +1815,7 @@ struct DileptonMC { } return true; } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - if (t1.pt() < dimuoncuts.cfg_min_pt_track || t2.pt() < dimuoncuts.cfg_min_pt_track) { + if ((t1.pt() < dimuoncuts.cfg_min_pt_track || dimuoncuts.cfg_max_pt_track < t1.pt()) || (t2.pt() < dimuoncuts.cfg_min_pt_track || dimuoncuts.cfg_max_pt_track < t2.pt())) { return false; } if ((t1.eta() < dimuoncuts.cfg_min_eta_track || dimuoncuts.cfg_max_eta_track < t1.eta()) || (t2.eta() < dimuoncuts.cfg_min_eta_track || dimuoncuts.cfg_max_eta_track < t2.eta())) { diff --git a/PWGEM/Dilepton/Core/EMEventCut.cxx b/PWGEM/Dilepton/Core/EMEventCut.cxx index a32edb39a55..07bdaf8cb52 100644 --- a/PWGEM/Dilepton/Core/EMEventCut.cxx +++ b/PWGEM/Dilepton/Core/EMEventCut.cxx @@ -89,3 +89,9 @@ void EMEventCut::SetRequireNoCollInITSROFStrict(bool flag) mRequireNoCollInITSROFStrict = flag; LOG(info) << "EM Event Cut, require No collision in ITS ROF strict: " << mRequireNoCollInITSROFStrict; } + +void EMEventCut::SetRequireNoHighMultCollInPrevRof(bool flag) +{ + mRequireNoHighMultCollInPrevRof = flag; + LOG(info) << "EM Event Cut, require No HM collision in previous ITS ROF: " << mRequireNoHighMultCollInPrevRof; +} diff --git a/PWGEM/Dilepton/Core/EMEventCut.h b/PWGEM/Dilepton/Core/EMEventCut.h index 7287871bcc3..a5636c13630 100644 --- a/PWGEM/Dilepton/Core/EMEventCut.h +++ b/PWGEM/Dilepton/Core/EMEventCut.h @@ -42,6 +42,7 @@ class EMEventCut : public TNamed kNoCollInTimeRangeStrict, kNoCollInITSROFStandard, kNoCollInITSROFStrict, + kNoHighMultCollInPrevRof, kNCuts }; @@ -84,6 +85,9 @@ class EMEventCut : public TNamed if (mRequireNoCollInITSROFStrict && !IsSelected(collision, EMEventCuts::kNoCollInITSROFStrict)) { return false; } + if (mRequireNoHighMultCollInPrevRof && !IsSelected(collision, EMEventCuts::kNoHighMultCollInPrevRof)) { + return false; + } return true; } @@ -127,6 +131,9 @@ class EMEventCut : public TNamed case EMEventCuts::kNoCollInITSROFStrict: return collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict); + case EMEventCuts::kNoHighMultCollInPrevRof: + return collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof); + default: return true; } @@ -145,13 +152,14 @@ class EMEventCut : public TNamed void SetRequireNoCollInTimeRangeStrict(bool flag); void SetRequireNoCollInITSROFStandard(bool flag); void SetRequireNoCollInITSROFStrict(bool flag); + void SetRequireNoHighMultCollInPrevRof(bool flag); private: - bool mRequireSel8{true}; + bool mRequireSel8{false}; bool mRequireFT0AND{true}; float mMinZvtx{-10.f}, mMaxZvtx{+10.f}; - bool mRequireNoTFB{true}; - bool mRequireNoITSROFB{true}; + bool mRequireNoTFB{false}; + bool mRequireNoITSROFB{false}; bool mRequireNoSameBunchPileup{false}; bool mRequireVertexITSTPC{false}; bool mRequireGoodZvtxFT0vsPV{false}; @@ -159,6 +167,7 @@ class EMEventCut : public TNamed bool mRequireNoCollInTimeRangeStrict{false}; bool mRequireNoCollInITSROFStandard{false}; bool mRequireNoCollInITSROFStrict{false}; + bool mRequireNoHighMultCollInPrevRof{false}; ClassDef(EMEventCut, 1); }; diff --git a/PWGEM/Dilepton/Core/PhotonHBT.h b/PWGEM/Dilepton/Core/PhotonHBT.h index e522388d969..f52b2e626b3 100644 --- a/PWGEM/Dilepton/Core/PhotonHBT.h +++ b/PWGEM/Dilepton/Core/PhotonHBT.h @@ -535,11 +535,7 @@ struct PhotonHBT { fDielectronCut.SetMeeRange(dielectroncuts.cfg_min_mass, dielectroncuts.cfg_max_mass); fDielectronCut.SetPairPtRange(dielectroncuts.cfg_min_pair_pt, dielectroncuts.cfg_max_pair_pt); fDielectronCut.SetPairYRange(dielectroncuts.cfg_min_pair_y, dielectroncuts.cfg_max_pair_y); - if (dielectroncuts.cfg_apply_phiv_meedep) { - fDielectronCut.SetMaxPhivPairMeeDep([&](float mll) { return (mll - dielectroncuts.cfg_phiv_intercept) / dielectroncuts.cfg_phiv_slope; }); - } else { - fDielectronCut.SetPhivPairRange(dielectroncuts.cfg_min_phiv, dielectroncuts.cfg_max_phiv, dielectroncuts.cfg_min_mee_for_phiv, dielectroncuts.cfg_max_mee_for_phiv); - } + fDielectronCut.SetMaxMeePhiVDep([&](float phiv) { return dielectroncuts.cfg_phiv_intercept + phiv * dielectroncuts.cfg_phiv_slope; }, dielectroncuts.cfg_min_phiv, dielectroncuts.cfg_max_phiv); fDielectronCut.SetPairDCARange(dielectroncuts.cfg_min_pair_dca3d, dielectroncuts.cfg_max_pair_dca3d); // in sigma fDielectronCut.ApplyPhiV(dielectroncuts.cfg_apply_phiv); fDielectronCut.ApplyPrefilter(dielectroncuts.cfg_apply_pf); diff --git a/PWGEM/Dilepton/Core/SingleTrackQC.h b/PWGEM/Dilepton/Core/SingleTrackQC.h index 6bc3f83a2fe..b1efa7d026d 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQC.h @@ -104,6 +104,7 @@ struct SingleTrackQC { Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; } eventcuts; DielectronCut fDielectronCut; diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index 0ca97194716..6082f774fc3 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -108,6 +108,7 @@ struct SingleTrackQCMC { Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; } eventcuts; DielectronCut fDielectronCut; diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index e310074c815..406f1b1d54c 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -17,8 +17,8 @@ #include #include #include -// #include -// #include +#include +#include #include "TString.h" #include "Math/Vector4D.h" @@ -26,7 +26,7 @@ #include "Framework/AnalysisTask.h" #include "Framework/ASoAHelpers.h" #include "Common/Core/RecoDecay.h" -// #include "Common/Core/trackUtilities.h" +#include "Common/Core/trackUtilities.h" #include "DetectorsBase/Propagator.h" #include "DetectorsBase/GeometryManager.h" @@ -68,18 +68,12 @@ struct prefilterDielectron { Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgMinMee_uls{"cfgMinMee_uls", 0.0, "min mee for prefilter in GeV/c2"}; // only for ULS - Configurable cfgMaxMee_uls{"cfgMaxMee_uls", 0.01, "max mee for prefilter in GeV/c2"}; // only for ULS - Configurable cfgMaxMee_for_phiv_uls{"cfgMaxMee_for_phiv_uls", 0.65, "max mee at phiv = pi for ULS"}; // GeV/c2 - Configurable cfgMaxPhiV_uls{"cfgMaxPhiV_uls", 2.9, "min phiv for in ULS"}; // radian - Configurable cfgMaxMee_for_phiv_ls{"cfgMaxMee_for_phiv", 0.25, "max mee at phiv = 0 and pi for LS"}; // GeV/c2 // symmetric - Configurable cfgMaxPhiV_ls{"cfgMaxPhiV_ls", 2.5, "min phiv for LS"}; // radian EMEventCut fEMEventCut; struct : ConfigurableGroup { std::string prefix = "eventcut_group"; Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; - Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", true, "require no ITS readout frame border in event cut"}; @@ -94,9 +88,22 @@ struct prefilterDielectron { DielectronCut fDielectronCut; struct : ConfigurableGroup { std::string prefix = "dielectroncut_group"; + Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass for prefilter ULS"}; // region to be rejected + Configurable cfg_max_mass{"cfg_max_mass", 0.02, "max mass for prefilter ULS"}; // region to be rejected + Configurable cfg_apply_dzrdphi_geom{"cfg_apply_dzrdphi_geom", false, "flag to apply generator dz-rdphi elliptic cut"}; // region to be rejected + Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 5, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 20, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected + + Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; // region to be rejected + Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; // region to be rejected + Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; // region to be rejected + Configurable cfg_min_phiv{"cfg_min_phiv", -1.f, "min phiv"}; // region to be rejected + Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv"}; // region to be rejected + Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.9, "min eta for single track"}; + Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.9, "max eta for single track"}; Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; @@ -106,17 +113,17 @@ struct prefilterDielectron { Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.3, "max dca XY for single track in cm"}; + Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.3, "max dca Z for single track in cm"}; + Configurable cfg_require_itsib_any{"cfg_require_itsib_any", true, "flag to require ITS ib any hits"}; + Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", false, "flag to require ITS ib 1st hit"}; Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; Configurable cfg_min_p_its_cluster_size{"cfg_min_p_its_cluster_size", 0.0, "min p to apply ITS cluster size cut"}; Configurable cfg_max_p_its_cluster_size{"cfg_max_p_its_cluster_size", 0.0, "max p to apply ITS cluster size cut"}; Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; - // Configurable cfg_x_to_go{"cfg_x_to_go", -1, "x (cm) to be propagated in local coordinate"}; + Configurable cfg_x_to_go{"cfg_x_to_go", -1, "x (cm) to be propagated in local coordinate"}; Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; @@ -221,10 +228,8 @@ struct prefilterDielectron { // for pair fRegistry.add("Pair/before/uls/hMvsPt", "m_{ee} vs. p_{T,ee}", kTH2D, {axis_mass, axis_pair_pt}, true); fRegistry.add("Pair/before/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {axis_phiv, {200, 0, 1}}, true); - fRegistry.add("Pair/before/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {100, -0.5, +0.5}}, true); - // fRegistry.add("Pair/before/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -20, 20}, {100, -10, 10}}, true); - // fRegistry.add("Pair/before/uls/hMvsPhiV_prop", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - + fRegistry.add("Pair/before/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {100, -1, +1}}, true); + fRegistry.add("Pair/before/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {80, -20, 20}}, true); fRegistry.addClone("Pair/before/uls/", "Pair/before/lspp/"); fRegistry.addClone("Pair/before/uls/", "Pair/before/lsmm/"); fRegistry.addClone("Pair/before/", "Pair/after/"); @@ -258,12 +263,8 @@ struct prefilterDielectron { fDielectronCut.SetPairOpAng(0.f, 3.2f); fDielectronCut.SetRequireDifferentSides(false); - // for prefilter - fDielectronCut.SetPrefilterPhiV(cfgMaxMee_for_phiv_uls, cfgMaxPhiV_uls, cfgMaxMee_for_phiv_ls, cfgMaxPhiV_ls); - fDielectronCut.SetPrefilterMee(cfgMinMee_uls, cfgMaxMee_uls); - // for track - fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, 1e+10f); + fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, dielectroncuts.cfg_max_pt_track); fDielectronCut.SetTrackEtaRange(dielectroncuts.cfg_min_eta_track, dielectroncuts.cfg_max_eta_track); fDielectronCut.SetTrackPhiRange(dielectroncuts.cfg_min_phi_track, dielectroncuts.cfg_max_phi_track); fDielectronCut.SetMinNClustersTPC(dielectroncuts.cfg_min_ncluster_tpc); @@ -318,39 +319,25 @@ struct prefilterDielectron { } // end of PID ML } - // std::map, float> map_z_prop; // map -> geometrical z position at propagated point - // std::map, float> map_phi_prop; // map -> geometrical phi position at propagated point - // std::map, float> map_px_prop; // map -> px at propagated point - // std::map, float> map_py_prop; // map -> py at propagated point - // std::map, float> map_pz_prop; // map -> pz at propagated point - - // template - // void propagateElectron(TTracks const& tracks) - // { - // // this has to be called after initCCDB for bz. - // for (auto& track : tracks) { - // auto track_par_cov = getTrackParCov(track); - // track_par_cov.setPID(o2::track::PID::Electron); - // o2::base::Propagator::Instance()->propagateToX(track_par_cov, dielectroncuts.cfg_x_to_go, d_bz, o2::base::PropagatorImpl::MAX_SIN_PHI, o2::base::PropagatorImpl::MAX_STEP, matCorr); - // auto xyz = track_par_cov.getXYZGlo(); - // // float eta = RecoDecay::eta(std::array{xyz.X(), xyz.Y(), xyz.Z()}); - // float phi = RecoDecay::phi(std::array{xyz.X(), xyz.Y()}); - // o2::math_utils::bringTo02Pi(phi); - // map_z_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = xyz.Z(); - // map_phi_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = phi; - - // std::array pxpypz_prop = {0, 0, 0}; // px, py, pz - // getPxPyPz(track_par_cov, pxpypz_prop); - // map_px_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[0]; - // map_py_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[1]; - // map_pz_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[2]; - - // // float r = sqrt(pow(xyz.X(),2) + pow(xyz.Y(), 2)); - // // float theta = 2.f * std::atan(std::exp(-eta)); - // // float z = r/std::tan(theta); - // // LOGF(info, "r = %f, z = %f , xyz.Z() = %f", r, z, xyz.Z()); - // } - // } + std::map, float> map_z_prop; // map -> geometrical z position at propagated point + std::map, float> map_phi_prop; // map -> geometrical phi position at propagated point + + template + void propagateElectron(TTracks const& tracks) + { + // this has to be called after initCCDB for bz. + for (auto& track : tracks) { + auto track_par_cov = getTrackParCov(track); + track_par_cov.setPID(o2::track::PID::Electron); + o2::base::Propagator::Instance()->propagateToX(track_par_cov, dielectroncuts.cfg_x_to_go, d_bz, o2::base::PropagatorImpl::MAX_SIN_PHI, o2::base::PropagatorImpl::MAX_STEP, matCorr); + auto xyz = track_par_cov.getXYZGlo(); + // float eta = RecoDecay::eta(std::array{xyz.X(), xyz.Y(), xyz.Z()}); + float phi = RecoDecay::phi(std::array{xyz.X(), xyz.Y()}); + o2::math_utils::bringTo02Pi(phi); + map_z_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = xyz.Z(); + map_phi_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = phi; + } + } std::unordered_map map_pfb; // map track.globalIndex -> prefilter bit @@ -392,10 +379,10 @@ struct prefilterDielectron { continue; } - // if (dielectroncuts.cfg_x_to_go > 0.f) { - // propagateElectron(posTracks_per_coll); - // propagateElectron(negTracks_per_coll); - // } + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom) { + propagateElectron(posTracks_per_coll); + propagateElectron(negTracks_per_coll); + } // LOGF(info, "centrality = %f , posTracks_per_coll.size() = %d, negTracks_per_coll.size() = %d", centralities[cfgCentEstimator], posTracks_per_coll.size(), negTracks_per_coll.size()); @@ -413,33 +400,30 @@ struct prefilterDielectron { float dphi = pos.sign() * v1.Pt() > ele.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); - // float dz_geom = pos.sign() * pos.pt() > ele.sign() * ele.pt() ? map_z_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] : map_z_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())]; - // float dphi_geom = pos.sign() * pos.pt() > ele.sign() * ele.pt() ? map_phi_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] : map_phi_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())]; - // o2::math_utils::bringToPMPi(dphi_geom); - // float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; - - // ROOT::Math::PxPyPzMVector v1prop(map_px_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_py_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], o2::constants::physics::MassElectron); - // ROOT::Math::PxPyPzMVector v2prop(map_px_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_py_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], o2::constants::physics::MassElectron); - // ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; - // float mee_prop = v12prop.M(); - // float phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(map_px_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_py_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], - // map_px_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_py_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], - // pos.sign(), ele.sign(), d_bz); + float dz_geom = pos.sign() * pos.pt() > ele.sign() * ele.pt() ? map_z_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] : map_z_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())]; + float dphi_geom = pos.sign() * pos.pt() > ele.sign() * ele.pt() ? map_phi_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] : map_phi_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())]; + o2::math_utils::bringToPMPi(dphi_geom); + float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; fRegistry.fill(HIST("Pair/before/uls/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/before/uls/hMvsPt"), v12.M(), v12.Pt()); fRegistry.fill(HIST("Pair/before/uls/hDeltaEtaDeltaPhi"), dphi, deta); - // fRegistry.fill(HIST("Pair/before/uls/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - // fRegistry.fill(HIST("Pair/before/uls/hMvsPhiV_prop"), phiv_prop, mee_prop); + fRegistry.fill(HIST("Pair/before/uls/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (!fDielectronCut.IsSelectedPair_PrefilterULS_Mee(pos, ele, d_bz)) { + if (dielectroncuts.cfg_min_mass < v12.M() && v12.M() < dielectroncuts.cfg_max_mass) { map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee); map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee); } - if (!fDielectronCut.IsSelectedPair_PrefilterULS_PhiV(pos, ele, d_bz)) { - map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); - map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); + + if (dielectroncuts.cfg_apply_phiv && ((v12.M() < dielectroncuts.cfg_phiv_slope * phiv + dielectroncuts.cfg_phiv_intercept) && (dielectroncuts.cfg_min_phiv < phiv && phiv < dielectroncuts.cfg_max_phiv))) { + map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV); + map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV); } + + // if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { + // map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + // map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + // } } for (auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ @@ -456,28 +440,19 @@ struct prefilterDielectron { float dphi = pos1.sign() * v1.Pt() > pos2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); - // float dz_geom = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? map_z_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] : map_z_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())]; - // float dphi_geom = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? map_phi_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())]; - // o2::math_utils::bringToPMPi(dphi_geom); - // float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; - - // ROOT::Math::PxPyPzMVector v1prop(map_px_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_py_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], o2::constants::physics::MassElectron); - // ROOT::Math::PxPyPzMVector v2prop(map_px_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_py_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], o2::constants::physics::MassElectron); - // ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; - // float mee_prop = v12prop.M(); - // float phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(map_px_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_py_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], - // map_px_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_py_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], - // pos1.sign(), pos2.sign(), d_bz); + float dz_geom = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? map_z_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] : map_z_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())]; + float dphi_geom = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? map_phi_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())]; + o2::math_utils::bringToPMPi(dphi_geom); + float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; fRegistry.fill(HIST("Pair/before/lspp/hMvsPt"), v12.M(), v12.Pt()); fRegistry.fill(HIST("Pair/before/lspp/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/before/lspp/hDeltaEtaDeltaPhi"), dphi, deta); - // fRegistry.fill(HIST("Pair/before/lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - // fRegistry.fill(HIST("Pair/before/lspp/hMvsPhiV_prop"), phiv_prop, mee_prop); + fRegistry.fill(HIST("Pair/before/lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (!fDielectronCut.IsSelectedPair_PrefilterLS_PhiV(pos1, pos2, d_bz)) { - map_pfb[pos1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); - map_pfb[pos2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { + map_pfb[pos1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + map_pfb[pos2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); } } @@ -495,28 +470,19 @@ struct prefilterDielectron { float dphi = ele1.sign() * v1.Pt() > ele2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); - // float dz_geom = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? map_z_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] : map_z_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())]; - // float dphi_geom = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? map_phi_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())]; - // o2::math_utils::bringToPMPi(dphi_geom); - // float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; - - // ROOT::Math::PxPyPzMVector v1prop(map_px_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_py_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], o2::constants::physics::MassElectron); - // ROOT::Math::PxPyPzMVector v2prop(map_px_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_py_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], o2::constants::physics::MassElectron); - // ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; - // float mee_prop = v12prop.M(); - // float phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(map_px_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_py_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], - // map_px_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_py_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], - // ele1.sign(), ele2.sign(), d_bz); + float dz_geom = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? map_z_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] : map_z_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())]; + float dphi_geom = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? map_phi_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())]; + o2::math_utils::bringToPMPi(dphi_geom); + float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; fRegistry.fill(HIST("Pair/before/lsmm/hMvsPt"), v12.M(), v12.Pt()); fRegistry.fill(HIST("Pair/before/lsmm/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/before/lsmm/hDeltaEtaDeltaPhi"), dphi, deta); - // fRegistry.fill(HIST("Pair/before/lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - // fRegistry.fill(HIST("Pair/before/lsmm/hMvsPhiV_prop"), phiv_prop, mee_prop); + fRegistry.fill(HIST("Pair/before/lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (!fDielectronCut.IsSelectedPair_PrefilterLS_PhiV(ele1, ele2, d_bz)) { - map_pfb[ele1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); - map_pfb[ele2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kFakeMatchITSTPC); + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { + map_pfb[ele1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + map_pfb[ele2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); } } @@ -557,24 +523,15 @@ struct prefilterDielectron { float dphi = pos.sign() * v1.Pt() > ele.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); - // float dz_geom = pos.sign() * pos.pt() > ele.sign() * ele.pt() ? map_z_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] : map_z_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())]; - // float dphi_geom = pos.sign() * pos.pt() > ele.sign() * ele.pt() ? map_phi_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] : map_phi_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())]; - // o2::math_utils::bringToPMPi(dphi_geom); - // float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; - - // ROOT::Math::PxPyPzMVector v1prop(map_px_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_py_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], o2::constants::physics::MassElectron); - // ROOT::Math::PxPyPzMVector v2prop(map_px_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_py_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], o2::constants::physics::MassElectron); - // ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; - // float mee_prop = v12prop.M(); - // float phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(map_px_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_py_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())], - // map_px_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_py_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())], - // pos.sign(), ele.sign(), d_bz); + float dz_geom = pos.sign() * pos.pt() > ele.sign() * ele.pt() ? map_z_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] : map_z_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())]; + float dphi_geom = pos.sign() * pos.pt() > ele.sign() * ele.pt() ? map_phi_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] : map_phi_prop[std::make_tuple(ndf, ele.emeventId(), ele.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos.emeventId(), pos.globalIndex())]; + o2::math_utils::bringToPMPi(dphi_geom); + float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; fRegistry.fill(HIST("Pair/after/uls/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/after/uls/hMvsPt"), v12.M(), v12.Pt()); fRegistry.fill(HIST("Pair/after/uls/hDeltaEtaDeltaPhi"), dphi, deta); - // fRegistry.fill(HIST("Pair/after/uls/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - // fRegistry.fill(HIST("Pair/after/uls/hMvsPhiV_prop"), phiv_prop, mee_prop); + fRegistry.fill(HIST("Pair/after/uls/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); } for (auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ @@ -593,24 +550,15 @@ struct prefilterDielectron { float dphi = pos1.sign() * v1.Pt() > pos2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); - // float dz_geom = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? map_z_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] : map_z_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())]; - // float dphi_geom = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? map_phi_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())]; - // o2::math_utils::bringToPMPi(dphi_geom); - // float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; - - // ROOT::Math::PxPyPzMVector v1prop(map_px_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_py_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], o2::constants::physics::MassElectron); - // ROOT::Math::PxPyPzMVector v2prop(map_px_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_py_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], o2::constants::physics::MassElectron); - // ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; - // float mee_prop = v12prop.M(); - // float phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(map_px_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_py_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())], - // map_px_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_py_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], map_pz_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())], - // pos1.sign(), pos2.sign(), d_bz); + float dz_geom = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? map_z_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] : map_z_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] - map_z_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())]; + float dphi_geom = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? map_phi_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, pos2.emeventId(), pos2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, pos1.emeventId(), pos1.globalIndex())]; + o2::math_utils::bringToPMPi(dphi_geom); + float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; fRegistry.fill(HIST("Pair/after/lspp/hMvsPt"), v12.M(), v12.Pt()); fRegistry.fill(HIST("Pair/after/lspp/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/after/lspp/hDeltaEtaDeltaPhi"), dphi, deta); - // fRegistry.fill(HIST("Pair/after/lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - // fRegistry.fill(HIST("Pair/after/lspp/hMvsPhiV_prop"), phiv_prop, mee_prop); + fRegistry.fill(HIST("Pair/after/lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); } for (auto& [ele1, ele2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- @@ -629,24 +577,15 @@ struct prefilterDielectron { float dphi = ele1.sign() * v1.Pt() > ele2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); - // float dz_geom = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? map_z_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] : map_z_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())]; - // float dphi_geom = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? map_phi_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())]; - // o2::math_utils::bringToPMPi(dphi_geom); - // float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; - - // ROOT::Math::PxPyPzMVector v1prop(map_px_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_py_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], o2::constants::physics::MassElectron); - // ROOT::Math::PxPyPzMVector v2prop(map_px_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_py_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], o2::constants::physics::MassElectron); - // ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; - // float mee_prop = v12prop.M(); - // float phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(map_px_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_py_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())], - // map_px_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_py_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], map_pz_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())], - // ele1.sign(), ele2.sign(), d_bz); + float dz_geom = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? map_z_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] : map_z_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] - map_z_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())]; + float dphi_geom = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? map_phi_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, ele2.emeventId(), ele2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, ele1.emeventId(), ele1.globalIndex())]; + o2::math_utils::bringToPMPi(dphi_geom); + float rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; fRegistry.fill(HIST("Pair/after/lsmm/hMvsPt"), v12.M(), v12.Pt()); fRegistry.fill(HIST("Pair/after/lsmm/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/after/lsmm/hDeltaEtaDeltaPhi"), dphi, deta); - // fRegistry.fill(HIST("Pair/after/lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - // fRegistry.fill(HIST("Pair/after/lsmm/hMvsPhiV_prop"), phiv_prop, mee_prop); + fRegistry.fill(HIST("Pair/after/lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); } } // end of collision loop diff --git a/PWGEM/Dilepton/Tasks/vpPairQC.cxx b/PWGEM/Dilepton/Tasks/vpPairQC.cxx index f39f89bed10..29c0738f7f2 100644 --- a/PWGEM/Dilepton/Tasks/vpPairQC.cxx +++ b/PWGEM/Dilepton/Tasks/vpPairQC.cxx @@ -84,6 +84,7 @@ struct vpPairQC { Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; } eventcuts; DielectronCut fDielectronCut; @@ -103,13 +104,11 @@ struct vpPairQC { Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - Configurable cfg_apply_phiv_meedep{"cfg_apply_phiv_meedep", true, "flag to apply mee-dependent phiv cut"}; Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; - Configurable cfg_min_mee_for_phiv{"cfg_min_mee_for_phiv", 0.0, "min mee for phiv (constant)"}; - Configurable cfg_max_mee_for_phiv{"cfg_max_mee_for_phiv", 1e+10, "max mee for phiv (constant)"}; Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.1, "min pT for single track"}; + Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.9, "min eta for single track"}; Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.9, "max eta for single track"}; Configurable cfg_max_dca3dsigma_track{"cfg_max_dca3dsigma_track", 1e+10, "max DCA 3D in sigma"}; @@ -301,18 +300,14 @@ struct vpPairQC { fDielectronCut.SetPairPtRange(dielectroncuts.cfg_min_pair_pt, dielectroncuts.cfg_max_pair_pt); fDielectronCut.SetPairYRange(dielectroncuts.cfg_min_pair_y, dielectroncuts.cfg_max_pair_y); fDielectronCut.SetPairDCARange(dielectroncuts.cfg_min_pair_dca3d, dielectroncuts.cfg_max_pair_dca3d); // in sigma - if (dielectroncuts.cfg_apply_phiv_meedep) { - fDielectronCut.SetMaxPhivPairMeeDep([&](float mll) { return (mll - dielectroncuts.cfg_phiv_intercept) / dielectroncuts.cfg_phiv_slope; }); - } else { - fDielectronCut.SetPhivPairRange(dielectroncuts.cfg_min_phiv, dielectroncuts.cfg_max_phiv, dielectroncuts.cfg_min_mee_for_phiv, dielectroncuts.cfg_max_mee_for_phiv); - } + fDielectronCut.SetMaxMeePhiVDep([&](float phiv) { return dielectroncuts.cfg_phiv_intercept + phiv * dielectroncuts.cfg_phiv_slope; }, dielectroncuts.cfg_min_phiv, dielectroncuts.cfg_max_phiv); fDielectronCut.ApplyPhiV(dielectroncuts.cfg_apply_phiv); fDielectronCut.ApplyPrefilter(dielectroncuts.cfg_apply_pf); fDielectronCut.RequireITSibAny(dielectroncuts.cfg_require_itsib_any); fDielectronCut.RequireITSib1st(dielectroncuts.cfg_require_itsib_1st); // for track - fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, 1e+10f); + fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, dielectroncuts.cfg_max_pt_track); fDielectronCut.SetTrackEtaRange(dielectroncuts.cfg_min_eta_track, dielectroncuts.cfg_max_eta_track); fDielectronCut.SetTrackDca3DRange(0.f, dielectroncuts.cfg_max_dca3dsigma_track); // in sigma fDielectronCut.SetMinNClustersTPC(dielectroncuts.cfg_min_ncluster_tpc); diff --git a/PWGEM/Dilepton/Tasks/vpPairQCMC.cxx b/PWGEM/Dilepton/Tasks/vpPairQCMC.cxx index bfe6e1f3429..a687e5469a2 100644 --- a/PWGEM/Dilepton/Tasks/vpPairQCMC.cxx +++ b/PWGEM/Dilepton/Tasks/vpPairQCMC.cxx @@ -85,6 +85,7 @@ struct vpPairQCMC { Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; } eventcuts; DielectronCut fDielectronCut; @@ -104,8 +105,11 @@ struct vpPairQCMC { Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; + Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.1, "min pT for single track"}; + Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.9, "min eta for single track"}; Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.9, "max eta for single track"}; Configurable cfg_max_dca3dsigma_track{"cfg_max_dca3dsigma_track", 1e+10, "max DCA 3D in sigma"}; @@ -307,14 +311,14 @@ struct vpPairQCMC { fDielectronCut.SetPairPtRange(dielectroncuts.cfg_min_pair_pt, dielectroncuts.cfg_max_pair_pt); fDielectronCut.SetPairYRange(dielectroncuts.cfg_min_pair_y, dielectroncuts.cfg_max_pair_y); fDielectronCut.SetPairDCARange(dielectroncuts.cfg_min_pair_dca3d, dielectroncuts.cfg_max_pair_dca3d); // in sigma - fDielectronCut.SetMaxPhivPairMeeDep([&](float mll) { return (mll - dielectroncuts.cfg_phiv_intercept) / dielectroncuts.cfg_phiv_slope; }); + fDielectronCut.SetMaxMeePhiVDep([&](float phiv) { return dielectroncuts.cfg_phiv_intercept + phiv * dielectroncuts.cfg_phiv_slope; }, dielectroncuts.cfg_min_phiv, dielectroncuts.cfg_max_phiv); fDielectronCut.ApplyPhiV(dielectroncuts.cfg_apply_phiv); fDielectronCut.ApplyPrefilter(dielectroncuts.cfg_apply_pf); fDielectronCut.RequireITSibAny(dielectroncuts.cfg_require_itsib_any); fDielectronCut.RequireITSib1st(dielectroncuts.cfg_require_itsib_1st); // for track - fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, 1e+10f); + fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, dielectroncuts.cfg_max_pt_track); fDielectronCut.SetTrackEtaRange(-dielectroncuts.cfg_max_eta_track, +dielectroncuts.cfg_max_eta_track); fDielectronCut.SetTrackDca3DRange(0.f, dielectroncuts.cfg_max_dca3dsigma_track); // in sigma fDielectronCut.SetMinNClustersTPC(dielectroncuts.cfg_min_ncluster_tpc); diff --git a/PWGEM/Dilepton/Utils/PairUtilities.h b/PWGEM/Dilepton/Utils/PairUtilities.h index d157a811e48..a462720bd07 100644 --- a/PWGEM/Dilepton/Utils/PairUtilities.h +++ b/PWGEM/Dilepton/Utils/PairUtilities.h @@ -42,9 +42,9 @@ enum class DileptonAnalysisType : int { kHFll = 6, }; enum class DileptonPrefilterBit : int { - kMee = 0, // reject tracks from pi0 dalitz decays at very low mass where S/B > 1 - kPhiV = 1, // reject tracks from photon conversions - kFakeMatchITSTPC = 2, // reject tracks from photon conversions misreconstructed as ITS-TPC matched track + kMee = 0, // reject tracks from pi0 dalitz decays at very low mass where S/B > 1 + kPhiV = 1, // reject tracks from photon conversions + kSplitOrMergedTrack = 2, // reject split or marged tracks }; using SMatrix55 = ROOT::Math::SMatrix>; @@ -236,16 +236,20 @@ inline float getPhivPair(float pxpos, float pypos, float pzpos, float pxneg, flo std::array arr_ele{pxneg, pyneg, pzneg}; std::array pos_x_ele{0, 0, 0}; // LOGF(info, "Q1 = %d , Q2 = %d", cpos, cneg); + float ptpos = std::sqrt(std::pow(pxpos, 2) + std::pow(pypos, 2)); + float ptneg = std::sqrt(std::pow(pxneg, 2) + std::pow(pyneg, 2)); if (cpos * cneg > 0) { // Like Sign if (bz < 0) { - if (cpos > 0) { + // if (cpos > 0) { + if (cpos * ptpos > cneg * ptneg) { pos_x_ele = RecoDecay::crossProd(arr_pos, arr_ele); } else { pos_x_ele = RecoDecay::crossProd(arr_ele, arr_pos); } } else { - if (cpos > 0) { + // if (cpos > 0) { + if (cpos * ptpos > cneg * ptneg) { pos_x_ele = RecoDecay::crossProd(arr_ele, arr_pos); } else { pos_x_ele = RecoDecay::crossProd(arr_pos, arr_ele); @@ -253,13 +257,15 @@ inline float getPhivPair(float pxpos, float pypos, float pzpos, float pxneg, flo } } else { // Unlike Sign if (bz > 0) { - if (cpos > 0) { + // if (cpos > 0) { + if (cpos * ptpos > cneg * ptneg) { pos_x_ele = RecoDecay::crossProd(arr_pos, arr_ele); } else { pos_x_ele = RecoDecay::crossProd(arr_ele, arr_pos); } } else { - if (cpos > 0) { + // if (cpos > 0) { + if (cpos * ptpos > cneg * ptneg) { pos_x_ele = RecoDecay::crossProd(arr_ele, arr_pos); } else { pos_x_ele = RecoDecay::crossProd(arr_pos, arr_ele); From c52663bdcf596ef9b065296659313f2e15e68bc5 Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Sun, 1 Dec 2024 11:56:21 +0100 Subject: [PATCH 188/459] [PWGHF] Add PV contributors in D0 sparse for MC and remove unnecessary axes (#8717) --- PWGHF/D2H/Tasks/taskD0.cxx | 86 ++++++++++++++++++++++++++------------ 1 file changed, 59 insertions(+), 27 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index e5e12298f3f..b1c9eb92bd2 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -15,6 +15,8 @@ /// \author Gian Michele Innocenti , CERN /// \author Vít Kučera , CERN +#include + #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" @@ -64,6 +66,7 @@ struct HfTaskD0 { ConfigurableAxis thnConfigAxisCandType{"thnConfigAxisCandType", {4, -0.5, 3.5}, "D0 type"}; ConfigurableAxis thnConfigAxisGenPtD{"thnConfigAxisGenPtD", {500, 0, 50}, "Gen Pt D"}; ConfigurableAxis thnConfigAxisGenPtB{"thnConfigAxisGenPtB", {1000, 0, 100}, "Gen Pt B"}; + ConfigurableAxis thnConfigAxisNumPvContr{"thnConfigAxisNumPvContr", {200, -0.5, 199.5}, "Number of PV contributors"}; HfHelper hfHelper; @@ -77,6 +80,10 @@ struct HfTaskD0 { using D0CandidatesMlKF = soa::Join; using D0CandidatesMlMcKF = soa::Join; + using CollisionsWithMcLabels = soa::Join; + PresliceUnsorted colPerMcCollision = aod::mccollisionlabel::mcCollisionId; + SliceCache cache; + Partition selectedD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; Partition selectedD0CandidatesKF = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; Partition selectedD0CandidatesMc = aod::hf_sel_candidate_d0::isRecoHfFlag >= selectionFlagHf; @@ -220,19 +227,30 @@ struct HfTaskD0 { const AxisSpec thnAxisCandType{thnConfigAxisCandType, "D0 type"}; const AxisSpec thnAxisGenPtD{thnConfigAxisGenPtD, "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec thnAxisGenPtB{thnConfigAxisGenPtB, "#it{p}_{T}^{B} (GeV/#it{c})"}; + const AxisSpec thnAxisNumPvContr{thnConfigAxisNumPvContr, "Number of PV contributors"}; - registry.add("hSparseAcc", "Thn for generated D0 from charm and beauty", HistType::kTHnSparseD, {thnAxisGenPtD, thnAxisGenPtB, thnAxisY, thnAxisOrigin}); - registry.get(HIST("hSparseAcc"))->Sumw2(); + if (doprocessMcWithDCAFitterN || doprocessMcWithKFParticle || doprocessMcWithDCAFitterNMl || doprocessMcWithKFParticleMl) { + registry.add("hSparseAcc", "Thn for generated D0 from charm and beauty", HistType::kTHnSparseD, {thnAxisGenPtD, thnAxisGenPtB, thnAxisY, thnAxisOrigin, thnAxisNumPvContr}); + registry.get(HIST("hSparseAcc"))->Sumw2(); + } if (applyMl) { const AxisSpec thnAxisBkgScore{thnConfigAxisBkgScore, "BDT score bkg."}; const AxisSpec thnAxisNonPromptScore{thnConfigAxisNonPromptScore, "BDT score non-prompt."}; const AxisSpec thnAxisPromptScore{thnConfigAxisPromptScore, "BDT score prompt."}; - registry.add("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type", "Thn for D0 candidates with BDT scores", HistType::kTHnSparseD, {thnAxisBkgScore, thnAxisNonPromptScore, thnAxisPromptScore, thnAxisMass, thnAxisPt, thnAxisPtB, thnAxisY, thnAxisOrigin, thnAxisCandType}); + if (doprocessMcWithDCAFitterN || doprocessMcWithKFParticle || doprocessMcWithDCAFitterNMl || doprocessMcWithKFParticleMl) { + registry.add("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type", "Thn for D0 candidates with BDT scores", HistType::kTHnSparseD, {thnAxisBkgScore, thnAxisNonPromptScore, thnAxisPromptScore, thnAxisMass, thnAxisPt, thnAxisY, thnAxisCandType, thnAxisPtB, thnAxisOrigin, thnAxisNumPvContr}); + } else { + registry.add("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type", "Thn for D0 candidates with BDT scores", HistType::kTHnSparseD, {thnAxisBkgScore, thnAxisNonPromptScore, thnAxisPromptScore, thnAxisMass, thnAxisPt, thnAxisY, thnAxisCandType}); + } registry.get(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"))->Sumw2(); } else { - registry.add("hMassVsPtVsPtBVsYVsOriginVsD0Type", "Thn for D0 candidates without BDT scores", HistType::kTHnSparseD, {thnAxisMass, thnAxisPt, thnAxisPtB, thnAxisY, thnAxisOrigin, thnAxisCandType}); + if (doprocessMcWithDCAFitterN || doprocessMcWithKFParticle || doprocessMcWithDCAFitterNMl || doprocessMcWithKFParticleMl) { + registry.add("hMassVsPtVsPtBVsYVsOriginVsD0Type", "Thn for D0 candidates without BDT scores", HistType::kTHnSparseD, {thnAxisMass, thnAxisPt, thnAxisY, thnAxisCandType, thnAxisPtB, thnAxisOrigin}); + } else { + registry.add("hMassVsPtVsPtBVsYVsOriginVsD0Type", "Thn for D0 candidates without BDT scores", HistType::kTHnSparseD, {thnAxisMass, thnAxisPt, thnAxisY, thnAxisCandType}); + } registry.get(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"))->Sumw2(); } } @@ -299,17 +317,17 @@ struct HfTaskD0 { if constexpr (applyMl) { if (candidate.isSelD0() >= selectionFlagD0) { - registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0, ptCandidate, -1, hfHelper.yD0(candidate), 0, SigD0); + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0, ptCandidate, hfHelper.yD0(candidate), SigD0); } if (candidate.isSelD0bar() >= selectionFlagD0bar) { - registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0bar()[0], candidate.mlProbD0bar()[1], candidate.mlProbD0bar()[2], massD0bar, ptCandidate, -1, hfHelper.yD0(candidate), 0, SigD0bar); + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0bar()[0], candidate.mlProbD0bar()[1], candidate.mlProbD0bar()[2], massD0bar, ptCandidate, hfHelper.yD0(candidate), SigD0bar); } } else { if (candidate.isSelD0() >= selectionFlagD0) { - registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0, ptCandidate, -1, hfHelper.yD0(candidate), 0, SigD0); + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0, ptCandidate, hfHelper.yD0(candidate), SigD0); } if (candidate.isSelD0bar() >= selectionFlagD0bar) { - registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0bar, ptCandidate, -1, hfHelper.yD0(candidate), 0, SigD0bar); + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0bar, ptCandidate, hfHelper.yD0(candidate), SigD0bar); } } } @@ -341,7 +359,8 @@ struct HfTaskD0 { template void processMc(CandType const& candidates, soa::Join const& mcParticles, - aod::TracksWMc const&) + aod::TracksWMc const&, + CollisionsWithMcLabels const& collisions) { // MC rec. for (const auto& candidate : candidates) { @@ -351,6 +370,9 @@ struct HfTaskD0 { if (yCandRecoMax >= 0. && std::abs(hfHelper.yD0(candidate)) > yCandRecoMax) { continue; } + + auto collision = candidate.template collision_as(); + auto numPvContributors = collision.numContrib(); float massD0, massD0bar; if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) { massD0 = candidate.kfGeoMassD0(); @@ -476,9 +498,9 @@ struct HfTaskD0 { registry.fill(HIST("hDecLengthxyVsPtSig"), declengthxyCandidate, ptCandidate); registry.fill(HIST("hMassSigD0"), massD0, ptCandidate, rapidityCandidate); if constexpr (applyMl) { - registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0, ptCandidate, candidate.ptBhadMotherPart(), rapidityCandidate, candidate.originMcRec(), SigD0); + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0, ptCandidate, rapidityCandidate, SigD0, candidate.ptBhadMotherPart(), candidate.originMcRec(), numPvContributors); } else { - registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0, ptCandidate, candidate.ptBhadMotherPart(), rapidityCandidate, candidate.originMcRec(), SigD0); + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0, ptCandidate, rapidityCandidate, SigD0, candidate.ptBhadMotherPart(), candidate.originMcRec(), numPvContributors); } } else { registry.fill(HIST("hPtProng0Bkg"), ptProng0, rapidityCandidate); @@ -498,9 +520,9 @@ struct HfTaskD0 { if (candidate.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { registry.fill(HIST("hMassReflBkgD0"), massD0, ptCandidate, rapidityCandidate); if constexpr (applyMl) { - registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0, ptCandidate, candidate.ptBhadMotherPart(), rapidityCandidate, candidate.originMcRec(), ReflectedD0); + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0, ptCandidate, rapidityCandidate, ReflectedD0, candidate.ptBhadMotherPart(), candidate.originMcRec(), numPvContributors); } else { - registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0, ptCandidate, candidate.ptBhadMotherPart(), rapidityCandidate, candidate.originMcRec(), ReflectedD0); + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0, ptCandidate, rapidityCandidate, ReflectedD0, candidate.ptBhadMotherPart(), candidate.originMcRec(), numPvContributors); } } } @@ -510,18 +532,18 @@ struct HfTaskD0 { if (candidate.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { registry.fill(HIST("hMassSigD0bar"), massD0bar, ptCandidate, rapidityCandidate); if constexpr (applyMl) { - registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0bar()[0], candidate.mlProbD0bar()[1], candidate.mlProbD0bar()[2], massD0bar, ptCandidate, candidate.ptBhadMotherPart(), rapidityCandidate, candidate.originMcRec(), SigD0bar); + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0bar()[0], candidate.mlProbD0bar()[1], candidate.mlProbD0bar()[2], massD0bar, ptCandidate, rapidityCandidate, SigD0bar, candidate.ptBhadMotherPart(), candidate.originMcRec(), numPvContributors); } else { - registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0bar, ptCandidate, candidate.ptBhadMotherPart(), rapidityCandidate, candidate.originMcRec(), SigD0bar); + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0bar, ptCandidate, rapidityCandidate, SigD0bar, candidate.ptBhadMotherPart(), candidate.originMcRec(), numPvContributors); } } else { registry.fill(HIST("hMassBkgD0bar"), massD0bar, ptCandidate, rapidityCandidate); if (candidate.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { registry.fill(HIST("hMassReflBkgD0bar"), massD0bar, ptCandidate, rapidityCandidate); if constexpr (applyMl) { - registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0bar()[0], candidate.mlProbD0bar()[1], candidate.mlProbD0bar()[2], massD0bar, ptCandidate, candidate.ptBhadMotherPart(), rapidityCandidate, candidate.originMcRec(), ReflectedD0bar); + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0bar()[0], candidate.mlProbD0bar()[1], candidate.mlProbD0bar()[2], massD0bar, ptCandidate, rapidityCandidate, ReflectedD0bar, candidate.ptBhadMotherPart(), candidate.originMcRec(), numPvContributors); } else { - registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0bar, ptCandidate, candidate.ptBhadMotherPart(), rapidityCandidate, candidate.originMcRec(), ReflectedD0bar); + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0bar, ptCandidate, rapidityCandidate, ReflectedD0bar, candidate.ptBhadMotherPart(), candidate.originMcRec(), numPvContributors); } } } @@ -539,17 +561,23 @@ struct HfTaskD0 { registry.fill(HIST("hPtGen"), ptGen); registry.fill(HIST("hPtVsYGen"), ptGen, yGen); + unsigned maxNumContrib = 0; + const auto& recoCollsPerMcColl = collisions.sliceBy(colPerMcCollision, particle.mcCollision().globalIndex()); + for (const auto& recCol : recoCollsPerMcColl) { + maxNumContrib = recCol.numContrib() > maxNumContrib ? recCol.numContrib() : maxNumContrib; + } + if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { registry.fill(HIST("hPtGenPrompt"), ptGen); registry.fill(HIST("hYGenPrompt"), yGen); registry.fill(HIST("hPtVsYGenPrompt"), ptGen, yGen); - registry.fill(HIST("hSparseAcc"), ptGen, ptGenB, yGen, 1); + registry.fill(HIST("hSparseAcc"), ptGen, ptGenB, yGen, 1, maxNumContrib); } else { ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); registry.fill(HIST("hPtGenNonPrompt"), ptGen); registry.fill(HIST("hYGenNonPrompt"), yGen); registry.fill(HIST("hPtVsYGenNonPrompt"), ptGen, yGen); - registry.fill(HIST("hSparseAcc"), ptGen, ptGenB, yGen, 2); + registry.fill(HIST("hSparseAcc"), ptGen, ptGenB, yGen, 2, maxNumContrib); } registry.fill(HIST("hEtaGen"), particle.eta()); } @@ -558,33 +586,37 @@ struct HfTaskD0 { void processMcWithDCAFitterN(D0CandidatesMc const&, soa::Join const& mcParticles, - aod::TracksWMc const& tracks) + aod::TracksWMc const& tracks, + CollisionsWithMcLabels const& collisions) { - processMc(selectedD0CandidatesMc, mcParticles, tracks); + processMc(selectedD0CandidatesMc, mcParticles, tracks, collisions); } PROCESS_SWITCH(HfTaskD0, processMcWithDCAFitterN, "Process MC with DCAFitterN", false); void processMcWithKFParticle(D0CandidatesMcKF const&, soa::Join const& mcParticles, - aod::TracksWMc const& tracks) + aod::TracksWMc const& tracks, + CollisionsWithMcLabels const& collisions) { - processMc(selectedD0CandidatesMcKF, mcParticles, tracks); + processMc(selectedD0CandidatesMcKF, mcParticles, tracks, collisions); } PROCESS_SWITCH(HfTaskD0, processMcWithKFParticle, "Process MC with KFParticle", false); void processMcWithDCAFitterNMl(D0CandidatesMlMc const&, soa::Join const& mcParticles, - aod::TracksWMc const& tracks) + aod::TracksWMc const& tracks, + CollisionsWithMcLabels const& collisions) { - processMc(selectedD0CandidatesMlMc, mcParticles, tracks); + processMc(selectedD0CandidatesMlMc, mcParticles, tracks, collisions); } PROCESS_SWITCH(HfTaskD0, processMcWithDCAFitterNMl, "Process MC with DCAFitterN and ML selection", false); void processMcWithKFParticleMl(D0CandidatesMlMcKF const&, soa::Join const& mcParticles, - aod::TracksWMc const& tracks) + aod::TracksWMc const& tracks, + CollisionsWithMcLabels const& collisions) { - processMc(selectedD0CandidatesMlMcKF, mcParticles, tracks); + processMc(selectedD0CandidatesMlMcKF, mcParticles, tracks, collisions); } PROCESS_SWITCH(HfTaskD0, processMcWithKFParticleMl, "Process MC with KFParticle and ML selections", false); }; From 1ff94de8c61a76460b3cece741b19c585c035465 Mon Sep 17 00:00:00 2001 From: mvolkl <38325723+mvolkl@users.noreply.github.com> Date: Sun, 1 Dec 2024 11:48:42 +0000 Subject: [PATCH 189/459] [PWGHF] Updated LambdaB tree creator task (#8743) Co-authored-by: mvolkl --- PWGHF/TableProducer/treeCreatorLbToLcPi.cxx | 343 +++++++++----------- 1 file changed, 157 insertions(+), 186 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/treeCreatorLbToLcPi.cxx index 42e8001022f..d69de17d4e8 100644 --- a/PWGHF/TableProducer/treeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLbToLcPi.cxx @@ -21,8 +21,6 @@ #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" -#include "ALICE3/DataModel/RICH.h" - #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -34,6 +32,7 @@ namespace o2::aod { namespace full { +DECLARE_SOA_COLUMN(ImpactParameterXY, impactParameterXY, float); DECLARE_SOA_COLUMN(RSecondaryVertex, rSecondaryVertex, float); DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); DECLARE_SOA_COLUMN(PProng0, pProng0, float); @@ -52,20 +51,23 @@ DECLARE_SOA_COLUMN(DecayLength, decayLength, float); DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); -DECLARE_SOA_COLUMN(CPA, cpa, float); -DECLARE_SOA_COLUMN(CPAXY, cpaXY, float); +DECLARE_SOA_COLUMN(CPA, cPA, float); +DECLARE_SOA_COLUMN(CPAXY, cPAXY, float); DECLARE_SOA_COLUMN(Ct, ct, float); -DECLARE_SOA_COLUMN(MCflag, mcflag, int8_t); +DECLARE_SOA_COLUMN(McFlag, mcFlag, int8_t); DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); -DECLARE_SOA_COLUMN(NSigRICHTrk0Pi, nsigRICHTrk0Pi, float); -DECLARE_SOA_COLUMN(NSigfRICHTrk0Pi, nsigfRICHTrk0Pi, float); -DECLARE_SOA_COLUMN(NSigTOFTrk0Pi, nsigTOFTrk0Pi, float); +DECLARE_SOA_COLUMN(SignTrk0, signTrk0, int16_t); +DECLARE_SOA_COLUMN(NSigTOFTrk0Pi, nSigTOFTrk0Pi, float); +DECLARE_SOA_COLUMN(NSigTPCTrk0Pi, nSigTPCTrk0Pi, float); // Lc selection parameters DECLARE_SOA_COLUMN(LcM, lcM, float); DECLARE_SOA_COLUMN(LcCt, lcCt, float); DECLARE_SOA_COLUMN(LcY, lcY, float); DECLARE_SOA_COLUMN(LcE, lcE, float); DECLARE_SOA_COLUMN(LcEta, lcEta, float); +DECLARE_SOA_COLUMN(LcVertexX, lcVertexX, float); +DECLARE_SOA_COLUMN(LcVertexY, lcVertexY, float); +DECLARE_SOA_COLUMN(LcVertexZ, lcVertexZ, float); DECLARE_SOA_COLUMN(LcCPA, lcCPA, float); DECLARE_SOA_COLUMN(LcCPAXY, lcCPAXY, float); DECLARE_SOA_COLUMN(LcChi2PCA, lcChi2PCA, float); @@ -73,39 +75,58 @@ DECLARE_SOA_COLUMN(LcDecayLength, lcDecayLength, float); DECLARE_SOA_COLUMN(LcDecayLengthXY, lcDecayLengthXY, float); DECLARE_SOA_COLUMN(LcDecayLengthNormalised, lcDecayLengthNormalised, float); DECLARE_SOA_COLUMN(LcImpactParameter0, lcImpactParameter0, float); +DECLARE_SOA_COLUMN(LcImpactParameterError0, lcImpactParameterError0, float); DECLARE_SOA_COLUMN(LcImpactParameter1, lcImpactParameter1, float); +DECLARE_SOA_COLUMN(LcImpactParameterError1, lcImpactParameterError1, float); DECLARE_SOA_COLUMN(LcImpactParameter2, lcImpactParameter2, float); -DECLARE_SOA_COLUMN(NSigRICHTrk1Pi, nSigRICHTrk1Pi, float); -DECLARE_SOA_COLUMN(NSigRICHTrk1Pr, nSigRICHTrk1Pr, float); -DECLARE_SOA_COLUMN(NSigRICHTrk2Ka, nSigRICHTrk2Ka, float); -DECLARE_SOA_COLUMN(NSigRICHTrk3Pi, nSigRICHTrk3Pi, float); -DECLARE_SOA_COLUMN(NSigRICHTrk3Pr, nSigRICHTrk3Pr, float); -DECLARE_SOA_COLUMN(NSigfRICHTrk1Pi, nSigfRICHTrk1Pi, float); -DECLARE_SOA_COLUMN(NSigfRICHTrk1Pr, nSigfRICHTrk1Pr, float); -DECLARE_SOA_COLUMN(NSigfRICHTrk2Ka, nSigfRICHTrk2Ka, float); -DECLARE_SOA_COLUMN(NSigfRICHTrk3Pi, nSigfRICHTrk3Pi, float); -DECLARE_SOA_COLUMN(NSigfRICHTrk3Pr, nSigfRICHTrk3Pr, float); -DECLARE_SOA_COLUMN(NSigTOFTrk1Pi, nSigTOFrk1Pi, float); -DECLARE_SOA_COLUMN(NSigTOFTrk1Pr, nSigTOFrk1Pr, float); -DECLARE_SOA_COLUMN(NSigTOFTrk2Ka, nSigTOFrk2Ka, float); -DECLARE_SOA_COLUMN(NSigTOFTrk3Pi, nSigTOFrk3Pi, float); -DECLARE_SOA_COLUMN(NSigTOFTrk3Pr, nSigTOFrk3Pr, float); +DECLARE_SOA_COLUMN(LcImpactParameterError2, lcImpactParameterError2, float); +DECLARE_SOA_COLUMN(LcPx0, lcPx0, float); +DECLARE_SOA_COLUMN(LcPy0, lcPy0, float); +DECLARE_SOA_COLUMN(LcPz0, lcPz0, float); +DECLARE_SOA_COLUMN(LcPx1, lcPx1, float); +DECLARE_SOA_COLUMN(LcPy1, lcPy1, float); +DECLARE_SOA_COLUMN(LcPz1, lcPz1, float); +DECLARE_SOA_COLUMN(LcPx2, lcPx2, float); +DECLARE_SOA_COLUMN(LcPy2, lcPy2, float); +DECLARE_SOA_COLUMN(LcPz2, lcPz2, float); +DECLARE_SOA_COLUMN(LcSignProng0, lcSignProng0, int16_t); +DECLARE_SOA_COLUMN(LcSignProng1, lcSignProng1, int16_t); +DECLARE_SOA_COLUMN(LcSignProng2, lcSignProng2, int16_t); +DECLARE_SOA_COLUMN(LcNSigTPCPi0, lcNSigTPCPi0, float); +DECLARE_SOA_COLUMN(LcNSigTPCK0, lcNSigTPCK0, float); +DECLARE_SOA_COLUMN(LcNSigTPCPr0, lcNSigTPCPr0, float); +DECLARE_SOA_COLUMN(LcNSigTPCPi1, lcNSigTPCPi1, float); +DECLARE_SOA_COLUMN(LcNSigTPCK1, lcNSigTPCK1, float); +DECLARE_SOA_COLUMN(LcNSigTPCPr1, lcNSigTPCPr1, float); +DECLARE_SOA_COLUMN(LcNSigTPCPi2, lcNSigTPCPi2, float); +DECLARE_SOA_COLUMN(LcNSigTPCK2, lcNSigTPCK2, float); +DECLARE_SOA_COLUMN(LcNSigTPCPr2, lcNSigTPCPr2, float); +DECLARE_SOA_COLUMN(LcNSigTOFPr0, lcNSigTOFPr0, float); +DECLARE_SOA_COLUMN(LcNSigTOFK1, lcNSigTOFK1, float); +DECLARE_SOA_COLUMN(LcNSigTOFPi2, lcNSigTOFPi2, float); } // namespace full // put the arguments into the table DECLARE_SOA_TABLE(HfCandLbFulls, "AOD", "HFCANDLBFULL", + collision::PosX, collision::PosY, collision::PosZ, + hf_cand::XSecondaryVertex, hf_cand::YSecondaryVertex, hf_cand::ZSecondaryVertex, + hf_cand::ErrorDecayLength, hf_cand::ErrorDecayLengthXY, + hf_cand::Chi2PCA, + full::ImpactParameterXY, full::RSecondaryVertex, full::DecayLength, full::DecayLengthXY, full::DecayLengthNormalised, full::DecayLengthXYNormalised, - hf_cand::Chi2PCA, full::ImpactParameterNormalised0, full::PtProng0, full::PProng0, full::ImpactParameterNormalised1, full::PtProng1, full::PProng1, + full::SignTrk0, + full::NSigTOFTrk0Pi, + full::NSigTPCTrk0Pi, hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, @@ -116,29 +137,20 @@ DECLARE_SOA_TABLE(HfCandLbFulls, "AOD", "HFCANDLBFULL", hf_cand::ImpactParameter1, hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, - full::NSigTOFTrk0Pi, - full::NSigRICHTrk0Pi, - full::NSigRICHTrk1Pi, - full::NSigRICHTrk1Pr, - full::NSigRICHTrk2Ka, - full::NSigRICHTrk3Pi, - full::NSigRICHTrk3Pr, - full::NSigfRICHTrk0Pi, - full::NSigfRICHTrk1Pi, - full::NSigfRICHTrk1Pr, - full::NSigfRICHTrk2Ka, - full::NSigfRICHTrk3Pi, - full::NSigfRICHTrk3Pr, - full::NSigTOFTrk1Pi, - full::NSigTOFTrk1Pr, - full::NSigTOFTrk2Ka, - full::NSigTOFTrk3Pi, - full::NSigTOFTrk3Pr, + full::LcNSigTPCPi0, full::LcNSigTPCK0, full::LcNSigTPCPr0, + full::LcNSigTPCPi1, full::LcNSigTPCK1, full::LcNSigTPCPr1, + full::LcNSigTPCPi2, full::LcNSigTPCK2, full::LcNSigTPCPr2, + full::LcNSigTOFPr0, + full::LcNSigTOFK1, + full::LcNSigTOFPi2, full::LcM, full::LcCt, full::LcY, full::LcE, full::LcEta, + full::LcVertexX, + full::LcVertexY, + full::LcVertexZ, full::LcCPA, full::LcCPAXY, full::LcChi2PCA, @@ -146,8 +158,17 @@ DECLARE_SOA_TABLE(HfCandLbFulls, "AOD", "HFCANDLBFULL", full::LcDecayLengthXY, full::LcDecayLengthNormalised, full::LcImpactParameter0, + full::LcImpactParameterError0, full::LcImpactParameter1, + full::LcImpactParameterError1, full::LcImpactParameter2, + full::LcImpactParameterError2, + full::LcPx0, full::LcPy0, full::LcPz0, + full::LcPx1, full::LcPy1, full::LcPz1, + full::LcPx2, full::LcPy2, full::LcPz2, + full::LcSignProng0, + full::LcSignProng1, + full::LcSignProng2, full::CandidateSelFlag, full::M, full::Pt, @@ -158,47 +179,22 @@ DECLARE_SOA_TABLE(HfCandLbFulls, "AOD", "HFCANDLBFULL", full::Eta, full::Phi, full::Y, - full::MCflag, + full::McFlag, full::OriginMcRec); } // namespace o2::aod -namespace o2::aod -{ -namespace hf_track_index_alice3_pid -{ -DECLARE_SOA_INDEX_COLUMN(Track, track); //! -DECLARE_SOA_INDEX_COLUMN(RICH, rich); //! -DECLARE_SOA_INDEX_COLUMN(FRICH, frich); //! -} // namespace hf_track_index_alice3_pid - -DECLARE_SOA_INDEX_TABLE_USER(HfTrackIndexALICE3PID, Tracks, "HFTRKIDXA3PID", //! - hf_track_index_alice3_pid::TrackId, - hf_track_index_alice3_pid::RICHId, - hf_track_index_alice3_pid::FRICHId); -} // namespace o2::aod - -struct HfTreeCreatorLbToLcPiAlice3PidIndexBuilder { - Builds index; - - void init(InitContext&) {} -}; - /// Writes the full information in an output TTree struct HfTreeCreatorLbToLcPi { Produces rowCandidateFull; - HfHelper hfHelper; - using TracksWPid = soa::Join; + using TracksWPid = soa::Join; - void process(soa::Join const& candidates, - soa::Join const&, - TracksWPid const&, - aod::FRICHs const&, - aod::RICHs const&) + void process(soa::Join const& candidates, + soa::Join const&, + TracksWPid const&) { - // Filling candidate properties rowCandidateFull.reserve(candidates.size()); for (const auto& candidate : candidates) { @@ -206,121 +202,97 @@ struct HfTreeCreatorLbToLcPi { float FunctionInvMass, float FunctionCt, float FunctionY) { - if (FunctionSelection >= 1) { - auto candLc = candidate.prong0_as>(); - auto track0 = candidate.prong1_as(); // daughter pion track - auto track1 = candLc.prong0_as(); // granddaughter tracks (lc decay particles) - auto track2 = candLc.prong1_as(); - auto track3 = candLc.prong2_as(); - - auto RICHTrk0Pi = -5000.0; - auto RICHTrk1Pi = -5000.0; - auto RICHTrk1P = -5000.0; - auto RICHTrk2K = -5000.0; - auto RICHTrk3Pi = -5000.0; - auto RICHTrk3P = -5000.0; - - auto fRICHTrk0Pi = -5000.0; - auto fRICHTrk1Pi = -5000.0; - auto fRICHTrk1P = -5000.0; - auto fRICHTrk2K = -5000.0; - auto fRICHTrk3Pi = -5000.0; - auto fRICHTrk3P = -5000.0; - - if (track0.has_rich()) - RICHTrk0Pi = track0.rich().richNsigmaPi(); - if (track1.has_rich()) { - RICHTrk1Pi = track1.rich().richNsigmaPi(); - RICHTrk1P = track1.rich().richNsigmaPr(); - } - if (track2.has_rich()) - RICHTrk2K = track2.rich().richNsigmaKa(); - if (track3.has_rich()) { - RICHTrk3Pi = track3.rich().richNsigmaPi(); - RICHTrk3P = track3.rich().richNsigmaPr(); - } + auto candLc = candidate.prong0_as>(); + auto track0 = candidate.prong1_as(); // daughter pion track + auto track1 = candLc.prong0_as(); // granddaughter tracks (lc decay particles) + auto track2 = candLc.prong1_as(); + auto track3 = candLc.prong2_as(); - if (track0.has_frich()) - fRICHTrk0Pi = track0.frich().frichNsigmaPi(); - if (track1.has_frich()) { - fRICHTrk1Pi = track1.frich().frichNsigmaPi(); - fRICHTrk1P = track1.frich().frichNsigmaPr(); - } - if (track2.has_frich()) - fRICHTrk2K = track2.frich().frichNsigmaKa(); - if (track3.has_frich()) { - fRICHTrk3Pi = track3.frich().frichNsigmaPi(); - fRICHTrk3P = track3.frich().frichNsigmaPr(); - } + auto tempConst = -1; // For data - rowCandidateFull( - candidate.rSecondaryVertex(), - candidate.decayLength(), - candidate.decayLengthXY(), - candidate.decayLengthNormalised(), - candidate.decayLengthXYNormalised(), - candidate.chi2PCA(), - candidate.impactParameterNormalised0(), - candidate.ptProng0(), - RecoDecay::p(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), - candidate.impactParameterNormalised1(), - candidate.ptProng1(), - RecoDecay::p(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), - candidate.pxProng0(), - candidate.pyProng0(), - candidate.pzProng0(), - candidate.pxProng1(), - candidate.pyProng1(), - candidate.pzProng1(), - candidate.impactParameter0(), - candidate.impactParameter1(), - candidate.errorImpactParameter0(), - candidate.errorImpactParameter1(), - track0.tofNSigmaPi(), - RICHTrk0Pi, - RICHTrk1Pi, - RICHTrk1P, - RICHTrk2K, - RICHTrk3Pi, - RICHTrk3P, - fRICHTrk0Pi, - fRICHTrk1Pi, - fRICHTrk1P, - fRICHTrk2K, - fRICHTrk3Pi, - fRICHTrk3P, - track1.tofNSigmaPi(), - track1.tofNSigmaPr(), - track2.tofNSigmaKa(), - track3.tofNSigmaPi(), - track3.tofNSigmaPr(), - hfHelper.invMassLcToPKPi(candLc), - hfHelper.ctLc(candLc), - hfHelper.yLc(candLc), - hfHelper.eLc(candLc), - candLc.eta(), - candLc.cpa(), - candLc.cpaXY(), - candLc.chi2PCA(), - candLc.decayLength(), - candLc.decayLengthXY(), - candLc.decayLengthXYNormalised(), - candLc.impactParameter0(), - candLc.impactParameter1(), - candLc.impactParameter2(), - FunctionSelection, - FunctionInvMass, - candidate.pt(), - candidate.p(), - candidate.cpa(), - candidate.cpaXY(), - FunctionCt, - candidate.eta(), - candidate.phi(), - FunctionY, - candidate.flagMcMatchRec(), - candidate.originMcRec()); - } + rowCandidateFull( + candidate.posX(), + candidate.posY(), + candidate.posZ(), + candidate.xSecondaryVertex(), + candidate.ySecondaryVertex(), + candidate.zSecondaryVertex(), + candidate.errorDecayLength(), + candidate.errorDecayLengthXY(), + candidate.chi2PCA(), + candidate.impactParameterXY(), + candidate.rSecondaryVertex(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.decayLengthNormalised(), + candidate.decayLengthXYNormalised(), + candidate.impactParameterNormalised0(), + candidate.ptProng0(), + RecoDecay::p(candidate.pxProng0(), candidate.pyProng0(), candidate.pzProng0()), + candidate.impactParameterNormalised1(), + candidate.ptProng1(), + RecoDecay::p(candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()), + track0.sign(), + track0.tofNSigmaPi(), + track0.tpcNSigmaPi(), + candidate.pxProng0(), + candidate.pyProng0(), + candidate.pzProng0(), + candidate.pxProng1(), + candidate.pyProng1(), + candidate.pzProng1(), + candidate.impactParameter0(), + candidate.impactParameter1(), + candidate.errorImpactParameter0(), + candidate.errorImpactParameter1(), + track1.tpcNSigmaPi(), + track1.tpcNSigmaKa(), + track1.tpcNSigmaPr(), + track2.tpcNSigmaPi(), + track2.tpcNSigmaKa(), + track2.tpcNSigmaPr(), + track3.tpcNSigmaPi(), + track3.tpcNSigmaKa(), + track3.tpcNSigmaPr(), + track1.tofNSigmaPr(), + track2.tofNSigmaKa(), + track3.tofNSigmaPi(), + hfHelper.invMassLcToPKPi(candLc), + hfHelper.ctLc(candLc), + hfHelper.yLc(candLc), + hfHelper.eLc(candLc), + candLc.eta(), + candLc.xSecondaryVertex(), + candLc.ySecondaryVertex(), + candLc.zSecondaryVertex(), + candLc.cpa(), + candLc.cpaXY(), + candLc.chi2PCA(), + candLc.decayLength(), + candLc.decayLengthXY(), + candLc.decayLengthXYNormalised(), + candLc.impactParameter0(), + candLc.errorImpactParameter0(), + candLc.impactParameter1(), + candLc.errorImpactParameter1(), + candLc.impactParameter2(), + candLc.errorImpactParameter2(), + track1.px(), track1.py(), track1.pz(), + track2.px(), track2.py(), track2.pz(), + track3.px(), track3.py(), track3.pz(), + track1.sign(), track2.sign(), track3.sign(), + FunctionSelection, + FunctionInvMass, + candidate.pt(), + candidate.p(), + candidate.cpa(), + candidate.cpaXY(), + FunctionCt, + candidate.eta(), + candidate.phi(), + FunctionY, + tempConst, + tempConst); }; fillTable(candidate.isSelLbToLcPi(), hfHelper.invMassLbToLcPi(candidate), hfHelper.ctLb(candidate), hfHelper.yLb(candidate)); } @@ -330,7 +302,6 @@ struct HfTreeCreatorLbToLcPi { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow; - workflow.push_back(adaptAnalysisTask(cfgc)); workflow.push_back(adaptAnalysisTask(cfgc)); return workflow; } From 1d221da2f08ff6d433bfe1152ef3d09938fd2a29 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Sun, 1 Dec 2024 12:49:47 +0100 Subject: [PATCH 190/459] [PWGHF] added rapidity flag and corrected trigger condition (#8747) Co-authored-by: Prottay Das --- PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index a81e6acde41..f2b768ab36b 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -52,6 +52,7 @@ struct HfTaskDirectedFlowCharmHadrons { Configurable centralityMax{"centralityMax", 100., "Maximum centrality accepted in SP computation"}; Configurable storeMl{"storeMl", false, "Flag to store ML scores"}; Configurable direct{"direct", false, "Flag to calculate direct v1 odd and even"}; + Configurable userap{"userap", false, "Flag to fill rapidity vs eta "}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable> classMl{"classMl", {0, 2}, "Indices of BDT scores to be stored. Two indexes max."}; @@ -201,9 +202,11 @@ struct HfTaskDirectedFlowCharmHadrons { for (const auto& candidate : candidates) { double massCand = 0.; + double rapCand = 0.; std::vector outputMl = {-999., -999.}; if constexpr (std::is_same_v || std::is_same_v) { massCand = hfHelper.invMassDplusToPiKPi(candidate); + rapCand = hfHelper.yDplus(candidate); if constexpr (std::is_same_v) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)]; @@ -238,6 +241,9 @@ struct HfTaskDirectedFlowCharmHadrons { double cosNPhi = std::cos(phiCand); double sinNPhi = std::sin(phiCand); + if (userap) + etaCand = rapCand; + auto ux = cosNPhi; // real part of candidate q vector auto uy = sinNPhi; // imaginary part of candidate q vector auto uxQxp = ux * qxZDCA; From 6aca6d8957c46d63096b9861ae956d3a22ead385 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Sun, 1 Dec 2024 13:52:59 +0100 Subject: [PATCH 191/459] [PWGLF] updated code for flow of positive and negative charged hadrons (#8723) --- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 58 +++++++++++++++++++++---- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index 1635fd74e33..041ed4da0b6 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -179,6 +179,16 @@ struct lambdapolsp { histos.add("hpuxyQxypvscentpteta", "hpuxyQxypvscentpteta", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); histos.add("hpoddv1vscentpteta", "hpoddv1vscentpteta", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); histos.add("hpevenv1vscentpteta", "hpevenv1vscentpteta", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + + histos.add("hpuxQxpvscentptetaneg", "hpuxQxpvscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpuyQypvscentptetaneg", "hpuyQypvscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpuxQxtvscentptetaneg", "hpuxQxtvscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpuyQytvscentptetaneg", "hpuyQytvscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpuxyQxytvscentptetaneg", "hpuxyQxytvscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpuxyQxypvscentptetaneg", "hpuxyQxypvscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpoddv1vscentptetaneg", "hpoddv1vscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpevenv1vscentptetaneg", "hpevenv1vscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpQxtQxpvscent", "hpQxtQxpvscent", kTProfile, {centAxis}, true); histos.add("hpQytQypvscent", "hpQytQypvscent", kTProfile, {centAxis}, true); histos.add("hpQxytpvscent", "hpQxytpvscent", kTProfile, {centAxis}, true); @@ -193,6 +203,16 @@ struct lambdapolsp { histos.add("hpuxyQxypvscentpteta", "hpuxyQxypvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); histos.add("hpoddv1vscentpteta", "hpoddv1vscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); histos.add("hpevenv1vscentpteta", "hpevenv1vscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + + histos.add("hpuxQxpvscentptetaneg", "hpuxQxpvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuyQypvscentptetaneg", "hpuyQypvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxQxtvscentptetaneg", "hpuxQxtvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuyQytvscentptetaneg", "hpuyQytvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxyQxytvscentptetaneg", "hpuxyQxytvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxyQxypvscentptetaneg", "hpuxyQxypvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpoddv1vscentptetaneg", "hpoddv1vscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentptetaneg", "hpevenv1vscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpQxtQxpvscent", "hpQxtQxpvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); histos.add("hpQytQypvscent", "hpQytQypvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); histos.add("hpQxytpvscent", "hpQxytpvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); @@ -207,6 +227,16 @@ struct lambdapolsp { histos.add("hpuxyQxypvscentpteta", "hpuxyQxypvscentpteta", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); histos.add("hpoddv1vscentpteta", "hpoddv1vscentpteta", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); histos.add("hpevenv1vscentpteta", "hpevenv1vscentpteta", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + + histos.add("hpuxQxpvscentptetaneg", "hpuxQxpvscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpuyQypvscentptetaneg", "hpuyQypvscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpuxQxtvscentptetaneg", "hpuxQxtvscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpuyQytvscentptetaneg", "hpuyQytvscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpuxyQxytvscentptetaneg", "hpuxyQxytvscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpuxyQxypvscentptetaneg", "hpuxyQxypvscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpoddv1vscentptetaneg", "hpoddv1vscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpevenv1vscentptetaneg", "hpevenv1vscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpQxtQxpvscent", "hpQxtQxpvscent", HistType::kTHnSparseF, {configcentAxis, spAxis}, true); histos.add("hpQytQypvscent", "hpQytQypvscent", HistType::kTHnSparseF, {configcentAxis, spAxis}, true); histos.add("hpQxytpvscent", "hpQxytpvscent", HistType::kTHnSparseF, {configcentAxis, spAxis}, true); @@ -512,15 +542,27 @@ struct lambdapolsp { } } else { if (globalpt) { - histos.fill(HIST("hpuxQxpvscentpteta"), centrality, track.pt(), track.eta(), uxQxp); - histos.fill(HIST("hpuyQypvscentpteta"), centrality, track.pt(), track.eta(), uyQyp); - histos.fill(HIST("hpuxQxtvscentpteta"), centrality, track.pt(), track.eta(), uxQxt); - histos.fill(HIST("hpuyQytvscentpteta"), centrality, track.pt(), track.eta(), uyQyt); + if (sign > 0) { + histos.fill(HIST("hpuxQxpvscentpteta"), centrality, track.pt(), track.eta(), uxQxp); + histos.fill(HIST("hpuyQypvscentpteta"), centrality, track.pt(), track.eta(), uyQyp); + histos.fill(HIST("hpuxQxtvscentpteta"), centrality, track.pt(), track.eta(), uxQxt); + histos.fill(HIST("hpuyQytvscentpteta"), centrality, track.pt(), track.eta(), uyQyt); - histos.fill(HIST("hpuxyQxytvscentpteta"), centrality, track.pt(), track.eta(), uxyQxyt); - histos.fill(HIST("hpuxyQxypvscentpteta"), centrality, track.pt(), track.eta(), uxyQxyp); - histos.fill(HIST("hpoddv1vscentpteta"), centrality, track.pt(), track.eta(), oddv1); - histos.fill(HIST("hpevenv1vscentpteta"), centrality, track.pt(), track.eta(), evenv1); + histos.fill(HIST("hpuxyQxytvscentpteta"), centrality, track.pt(), track.eta(), uxyQxyt); + histos.fill(HIST("hpuxyQxypvscentpteta"), centrality, track.pt(), track.eta(), uxyQxyp); + histos.fill(HIST("hpoddv1vscentpteta"), centrality, track.pt(), track.eta(), oddv1); + histos.fill(HIST("hpevenv1vscentpteta"), centrality, track.pt(), track.eta(), evenv1); + } else { + histos.fill(HIST("hpuxQxpvscentptetaneg"), centrality, track.pt(), track.eta(), uxQxp); + histos.fill(HIST("hpuyQypvscentptetaneg"), centrality, track.pt(), track.eta(), uyQyp); + histos.fill(HIST("hpuxQxtvscentptetaneg"), centrality, track.pt(), track.eta(), uxQxt); + histos.fill(HIST("hpuyQytvscentptetaneg"), centrality, track.pt(), track.eta(), uyQyt); + + histos.fill(HIST("hpuxyQxytvscentptetaneg"), centrality, track.pt(), track.eta(), uxyQxyt); + histos.fill(HIST("hpuxyQxypvscentptetaneg"), centrality, track.pt(), track.eta(), uxyQxyp); + histos.fill(HIST("hpoddv1vscentptetaneg"), centrality, track.pt(), track.eta(), oddv1); + histos.fill(HIST("hpevenv1vscentptetaneg"), centrality, track.pt(), track.eta(), evenv1); + } } else { histos.fill(HIST("hpuxQxpvscentpteta"), centrality, track.tpcInnerParam(), track.eta(), uxQxp); histos.fill(HIST("hpuyQypvscentpteta"), centrality, track.tpcInnerParam(), track.eta(), uyQyp); From 864f716474138db0251b192082c59689381ed275 Mon Sep 17 00:00:00 2001 From: Evgeny Kryshen Date: Sun, 1 Dec 2024 16:59:52 +0300 Subject: [PATCH 192/459] [DPG] Added monitoring of ITS dead map vs time (#8749) --- DPG/Tasks/AOTEvent/eventSelectionQa.cxx | 90 +++++++++++++++++++------ 1 file changed, 68 insertions(+), 22 deletions(-) diff --git a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx index d62130e6dd0..2fce7d0325d 100644 --- a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx +++ b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx @@ -9,8 +9,14 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file eventSelectionQa.cxx +/// \brief Event selection QA task +/// +/// \author Evgeny Kryshen + #include #include +#include #include #include "Framework/runDataProcessing.h" @@ -24,6 +30,9 @@ #include "DataFormatsParameters/GRPLHCIFData.h" #include "DataFormatsParameters/GRPECSObject.h" #include "DataFormatsParameters/AggregatedRunInfo.h" +#include "DataFormatsITSMFT/NoiseMap.h" // missing include in TimeDeadMap.h +#include "DataFormatsITSMFT/TimeDeadMap.h" +#include "ITSMFTReconstruction/ChipMappingITS.h" #include "TH1F.h" #include "TH2F.h" @@ -59,7 +68,6 @@ struct EventSelectionQaTask { std::bitset bcPatternA; std::bitset bcPatternC; std::bitset bcPatternB; - SliceCache cache; Partition tracklets = (aod::track::trackType == static_cast(o2::aod::track::TrackTypeEnum::Run2Tracklet)); @@ -335,13 +343,13 @@ struct EventSelectionQaTask { { bool isINT1period = 0; if (!applySelection) { - auto first_bc = bcs.iteratorAt(0); - EventSelectionParams* par = ccdb->getForTimeStamp("EventSelection/EventSelectionParams", first_bc.timestamp()); + auto firstBC = bcs.iteratorAt(0); + EventSelectionParams* par = ccdb->getForTimeStamp("EventSelection/EventSelectionParams", firstBC.timestamp()); applySelection = par->GetSelection(0); for (int i = 0; i < kNsel; i++) { histos.get(HIST("hSelMask"))->SetBinContent(i + 1, applySelection[i]); } - isINT1period = first_bc.runNumber() <= 136377 || (first_bc.runNumber() >= 144871 && first_bc.runNumber() <= 159582); + isINT1period = firstBC.runNumber() <= 136377 || (firstBC.runNumber() >= 144871 && firstBC.runNumber() <= 159582); } // bc-based event selection qa @@ -449,10 +457,10 @@ struct EventSelectionQaTask { if (bc.has_fdd()) { auto fdd = bc.fdd(); - for (auto amplitude : fdd.chargeA()) { + for (const auto& amplitude : fdd.chargeA()) { multFDA += amplitude; } - for (auto amplitude : fdd.chargeC()) { + for (const auto& amplitude : fdd.chargeC()) { multFDC += amplitude; } } @@ -564,12 +572,50 @@ struct EventSelectionQaTask { bcPatternC = ~beamPatternA & beamPatternC; bcPatternB = beamPatternA & beamPatternC; - // fill once per DF + // fill once for (int i = 0; i < nBCsPerOrbit; i++) { histos.fill(HIST("hBcA"), i, bcPatternA[i] ? 1. : 0.); histos.fill(HIST("hBcB"), i, bcPatternB[i] ? 1. : 0.); histos.fill(HIST("hBcC"), i, bcPatternC[i] ? 1. : 0.); } + + // fill ITS dead maps + std::map metadata; + metadata["runNumber"] = Form("%d", run); + o2::itsmft::TimeDeadMap* itsDeadMap = ccdb->getSpecific("ITS/Calib/TimeDeadMap", (tsSOR + tsEOR) / 2, metadata); + + std::vector itsDeadMapOrbits = itsDeadMap->getEvolvingMapKeys(); // roughly every second, ~350 TFs = 350x32 orbits + std::vector itsDeadMapOrbitsDouble(itsDeadMapOrbits.begin(), itsDeadMapOrbits.end()); + const AxisSpec axisItsDeadMapOrbits{itsDeadMapOrbitsDouble}; + + for (int l = 0; l < o2::itsmft::ChipMappingITS::NLayers; l++) { + int nChips = o2::itsmft::ChipMappingITS::getNChipsOnLayer(l); + double idFirstChip = o2::itsmft::ChipMappingITS::getFirstChipsOnLayer(l); + // int nStaves = o2::itsmft::ChipMappingITS::getNStavesOnLr(l); + // double idFirstStave = o2::itsmft::ChipMappingITS::getFirstStavesOnLr(l); + histos.add(Form("hDeadChipsVsOrbitL%d", l), Form(";orbit; chip; Layer %d", l), kTH2C, {axisItsDeadMapOrbits, {nChips, idFirstChip, idFirstChip + nChips}}); + } + + std::vector closestVec; + for (const auto& orbit : itsDeadMapOrbits) { + itsDeadMap->getMapAtOrbit(orbit, closestVec); + for (size_t iel = 0; iel < closestVec.size(); iel++) { + uint16_t w1 = closestVec.at(iel); + bool isLastInSequence = (w1 & 0x8000) == 0; + uint16_t w2 = isLastInSequence ? w1 + 1 : closestVec.at(iel + 1); + int chipId1 = w1 & 0x7FFF; + int chipId2 = w2 & 0x7FFF; + for (int chipId = chipId1; chipId < chipId2; chipId++) { + histos.fill(HIST("hDeadChipsVsOrbitL0"), orbit, chipId, 1); + histos.fill(HIST("hDeadChipsVsOrbitL1"), orbit, chipId, 1); + histos.fill(HIST("hDeadChipsVsOrbitL2"), orbit, chipId, 1); + histos.fill(HIST("hDeadChipsVsOrbitL3"), orbit, chipId, 1); + histos.fill(HIST("hDeadChipsVsOrbitL4"), orbit, chipId, 1); + histos.fill(HIST("hDeadChipsVsOrbitL5"), orbit, chipId, 1); + histos.fill(HIST("hDeadChipsVsOrbitL6"), orbit, chipId, 1); + } + } + } } // create orbit-axis histograms on the fly with binning based on info from GRP if GRP is available @@ -615,12 +661,12 @@ struct EventSelectionQaTask { break; } deltaIndex++; - const auto& bc_past = bcs.iteratorAt(bc.globalIndex() - deltaIndex); - deltaBC = globalBC - bc_past.globalBC(); + const auto& bcPast = bcs.iteratorAt(bc.globalIndex() - deltaIndex); + deltaBC = globalBC - bcPast.globalBC(); if (deltaBC < maxDeltaBC) { - pastActivityFT0 |= bc_past.has_ft0(); - pastActivityFV0 |= bc_past.has_fv0a(); - pastActivityFDD |= bc_past.has_fdd(); + pastActivityFT0 |= bcPast.has_ft0(); + pastActivityFV0 |= bcPast.has_fv0a(); + pastActivityFDD |= bcPast.has_fdd(); } } @@ -722,7 +768,7 @@ struct EventSelectionQaTask { histos.fill(HIST("hOrbitFV0"), orbit - minOrbit); histos.fill(HIST("hBcFV0"), localBC); float multV0A = 0; - for (auto amplitude : bc.fv0a().amplitude()) { + for (const auto& amplitude : bc.fv0a().amplitude()) { multV0A += amplitude; } histos.fill(HIST("hMultV0Aall"), multV0A); @@ -766,11 +812,11 @@ struct EventSelectionQaTask { auto fdd = bc.fdd(); float multFDA = 0; - for (auto amplitude : fdd.chargeA()) { + for (const auto& amplitude : fdd.chargeA()) { multFDA += amplitude; } float multFDC = 0; - for (auto amplitude : fdd.chargeC()) { + for (const auto& amplitude : fdd.chargeC()) { multFDC += amplitude; } histos.fill(HIST("hMultFDAall"), multFDA); @@ -891,7 +937,7 @@ struct EventSelectionQaTask { int trackBcDiff = bcDiff + track.trackTime() / o2::constants::lhc::LHCBunchSpacingNS; if (!track.isPVContributor()) continue; - if (fabs(track.eta()) < 0.8 && track.tpcNClsFound() > 80 && track.tpcNClsCrossedRows() > 100) + if (std::fabs(track.eta()) < 0.8 && track.tpcNClsFound() > 80 && track.tpcNClsCrossedRows() > 100) nContributorsAfterEtaTPCCuts++; if (!track.hasTPC()) histos.fill(HIST("hITStrackBcDiff"), trackBcDiff); @@ -968,7 +1014,7 @@ struct EventSelectionQaTask { // FV0 float multV0A = 0; if (foundBC.has_fv0a()) { - for (auto amplitude : foundBC.fv0a().amplitude()) { + for (const auto& amplitude : foundBC.fv0a().amplitude()) { multV0A += amplitude; } } @@ -977,10 +1023,10 @@ struct EventSelectionQaTask { float multFDC = 0; if (foundBC.has_fdd()) { auto fdd = foundBC.fdd(); - for (auto amplitude : fdd.chargeA()) { + for (const auto& amplitude : fdd.chargeA()) { multFDA += amplitude; } - for (auto amplitude : fdd.chargeC()) { + for (const auto& amplitude : fdd.chargeC()) { multFDC += amplitude; } } @@ -1070,7 +1116,7 @@ struct EventSelectionQaTask { } // collisions // TVX efficiency after TF and ITS ROF border cuts - for (auto& col : cols) { + for (const auto& col : cols) { if (!col.selection_bit(kNoTimeFrameBorder) || !col.selection_bit(kNoITSROFrameBorder)) continue; @@ -1102,12 +1148,12 @@ struct EventSelectionQaTask { histos.fill(HIST("hNcolMCVsBcInTF"), bcInTF); } - for (auto& col : cols) { + for (const auto& col : cols) { int32_t mcColIdFromCollision = col.mcCollisionId(); // check if collision is built from tracks originating from different MC collisions bool isCollisionAmbiguous = 0; const auto& colPvTracks = pvTracks.sliceByCached(aod::track::collisionId, col.globalIndex(), cache); - for (auto& track : colPvTracks) { + for (const auto& track : colPvTracks) { int32_t mcPartId = track.mcParticleId(); int32_t mcColId = mcPartId >= 0 ? mcParts.iteratorAt(mcPartId).mcCollisionId() : -1; if (mcColId < 0 || mcColIdFromCollision != mcColId) { From 8b2a38ff0894c781a9b24d3118f6bbb2f42d1b38 Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Sun, 1 Dec 2024 15:59:19 +0100 Subject: [PATCH 193/459] [PWGHF] Update ccdb configuration as in central TOF task (#8751) --- PWGHF/TableProducer/mcPidTof.cxx | 207 ++++++++++++++----------------- 1 file changed, 90 insertions(+), 117 deletions(-) diff --git a/PWGHF/TableProducer/mcPidTof.cxx b/PWGHF/TableProducer/mcPidTof.cxx index c76fc6c656a..68429424b77 100644 --- a/PWGHF/TableProducer/mcPidTof.cxx +++ b/PWGHF/TableProducer/mcPidTof.cxx @@ -69,11 +69,12 @@ struct TOFCalibConfig { mTimestamp = opt.cfgTimestamp.value; mTimeShiftCCDBPathPos = opt.cfgTimeShiftCCDBPathPos.value; mTimeShiftCCDBPathNeg = opt.cfgTimeShiftCCDBPathNeg.value; + mTimeShiftCCDBPathPosMC = opt.cfgTimeShiftCCDBPathPosMC.value; + mTimeShiftCCDBPathNegMC = opt.cfgTimeShiftCCDBPathNegMC.value; mParamFileName = opt.cfgParamFileName.value; mParametrizationPath = opt.cfgParametrizationPath.value; mReconstructionPass = opt.cfgReconstructionPass.value; mReconstructionPassDefault = opt.cfgReconstructionPassDefault.value; - mLoadResponseFromCCDB = opt.cfgLoadResponseFromCCDB.value; mFatalOnPassNotAvailable = opt.cfgFatalOnPassNotAvailable.value; mEnableTimeDependentResponse = opt.cfgEnableTimeDependentResponse.value; mCollisionSystem = opt.cfgCollisionSystem.value; @@ -96,11 +97,12 @@ struct TOFCalibConfig { getCfg(initContext, "ccdb-timestamp", mTimestamp, task); getCfg(initContext, "timeShiftCCDBPathPos", mTimeShiftCCDBPathPos, task); getCfg(initContext, "timeShiftCCDBPathNeg", mTimeShiftCCDBPathNeg, task); + getCfg(initContext, "timeShiftCCDBPathPosMC", mTimeShiftCCDBPathPosMC, task); + getCfg(initContext, "timeShiftCCDBPathNegMC", mTimeShiftCCDBPathNegMC, task); getCfg(initContext, "paramFileName", mParamFileName, task); getCfg(initContext, "parametrizationPath", mParametrizationPath, task); getCfg(initContext, "reconstructionPass", mReconstructionPass, task); getCfg(initContext, "reconstructionPassDefault", mReconstructionPassDefault, task); - getCfg(initContext, "loadResponseFromCCDB", mLoadResponseFromCCDB, task); getCfg(initContext, "fatalOnPassNotAvailable", mFatalOnPassNotAvailable, task); getCfg(initContext, "enableTimeDependentResponse", mEnableTimeDependentResponse, task); getCfg(initContext, "collisionSystem", mCollisionSystem, task); @@ -148,18 +150,15 @@ struct TOFCalibConfig { } else { mRespParamsV3.setResolutionParametrization(paramCollection.getPars(mReconstructionPassDefault)); mRespParamsV3.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPassDefault)); - mRespParamsV3.printMomentumChargeShiftParameters(); } } } else { // Pass is available, load non standard parameters mRespParamsV3.setResolutionParametrization(paramCollection.getPars(mReconstructionPass)); mRespParamsV3.setMomentumChargeShiftParameters(paramCollection.getPars(mReconstructionPass)); - mRespParamsV3.printMomentumChargeShiftParameters(); } - } else if (mLoadResponseFromCCDB && !mEnableTimeDependentResponse) { // Loading it from CCDB + } else if (!mEnableTimeDependentResponse) { // Loading it from CCDB LOG(info) << "Loading exp. sigma parametrization from CCDB, using path: " << mParametrizationPath << " for timestamp " << mTimestamp; o2::tof::ParameterCollection* paramCollection = ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp); - paramCollection->print(); if (!paramCollection->retrieveParameters(mRespParamsV3, mReconstructionPass)) { // Attempt at loading the parameters with the pass defined if (mFatalOnPassNotAvailable) { LOG(fatal) << "Pass '" << mReconstructionPass << "' not available in the retrieved CCDB object"; @@ -171,50 +170,45 @@ struct TOFCalibConfig { } else { mRespParamsV3.setResolutionParametrization(paramCollection->getPars(mReconstructionPassDefault)); mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPassDefault)); - mRespParamsV3.printMomentumChargeShiftParameters(); } } } else { // Pass is available, load non standard parameters mRespParamsV3.setResolutionParametrization(paramCollection->getPars(mReconstructionPass)); mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPass)); - mRespParamsV3.printMomentumChargeShiftParameters(); } - } else { - std::unordered_map m; - mRespParamsV3.setResolutionParametrization(m); } // Loading additional calibration objects - if (mTimeShiftCCDBPathPos != "") { - if (mTimeShiftCCDBPathPos.find(".root") != std::string::npos) { - mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathPos, "ccdb_object", true); - } else if (!mEnableTimeDependentResponse) { - if (mReconstructionPass == "") { - mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathPos, mTimestamp), true); - } else { - std::map metadata; - metadata["RecoPassName"] = mReconstructionPass; - mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(mTimeShiftCCDBPathPos, mTimestamp, metadata), true); - } - } + std::map metadata; + if (!mReconstructionPass.empty()) { + metadata["RecoPassName"] = mReconstructionPass; } - if (mTimeShiftCCDBPathNeg != "") { - if (mTimeShiftCCDBPathNeg.find(".root") != std::string::npos) { - mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathNeg, "ccdb_object", false); - } else if (!mEnableTimeDependentResponse) { - if (mReconstructionPass == "") { - mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathNeg, mTimestamp), false); - } else { - std::map metadata; - metadata["RecoPassName"] = mReconstructionPass; - mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(mTimeShiftCCDBPathNeg, mTimestamp, metadata), false); - } + auto updateTimeShift = [&](const std::string& nameShift, bool isPositive) { + if (nameShift.empty()) { + return; } - } + const bool isFromFile = nameShift.find(".root") != std::string::npos; + if (isFromFile) { + LOG(info) << "Initializing the time shift for " << (isPositive ? "positive" : "negative") << " from file '" << nameShift << "'"; + mRespParamsV3.setTimeShiftParameters(nameShift, "ccdb_object", isPositive); + } else if (!mEnableTimeDependentResponse) { // If the response is fixed fetch it at the init time + LOG(info) << "Initializing the time shift for " << (isPositive ? "positive" : "negative") + << " from ccdb '" << nameShift << "' and timestamp " << mTimestamp + << " and pass '" << mReconstructionPass << "'"; + mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(nameShift, mTimestamp, metadata), isPositive); + } + LOG(info) << " test getTimeShift at 0 " << (isPositive ? "pos" : "neg") << ": " + << mRespParamsV3.getTimeShift(0, isPositive); + }; + + const std::string nameShiftPos = metadataInfo.isMC() ? mTimeShiftCCDBPathPosMC : mTimeShiftCCDBPathPos; + updateTimeShift(nameShiftPos, true); + const std::string nameShiftNeg = metadataInfo.isMC() ? mTimeShiftCCDBPathNegMC : mTimeShiftCCDBPathNeg; + updateTimeShift(nameShiftNeg, true); // Calibration object is defined LOG(info) << "Parametrization at init time:"; - mRespParamsV3.print(); + mRespParamsV3.printFullConfig(); } template @@ -232,8 +226,8 @@ struct TOFCalibConfig { // Check the beam type if (mCollisionSystem == -1) { - o2::parameters::GRPLHCIFData* grpo = ccdb->template getForTimeStamp(mPathGrpLhcIf, - mTimestamp); + o2::parameters::GRPLHCIFData* grpo = ccdb->template getSpecific(mPathGrpLhcIf, + mTimestamp); mCollisionSystem = CollisionSystemType::getCollisionTypeFromGrp(grpo); } else { LOG(debug) << "Not setting collisions system as already set to " << mCollisionSystem << " " << CollisionSystemType::getCollisionSystemName(mCollisionSystem); @@ -242,50 +236,55 @@ struct TOFCalibConfig { if (!mEnableTimeDependentResponse) { return; } - LOG(info) << "Updating parametrization from path '" << mParametrizationPath << "' and timestamp " << mTimestamp << " and reconstruction pass '" << mReconstructionPass << "'"; - if (mParamFileName.empty()) { // Not loading if parametrization from file - if (!ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->retrieveParameters(mRespParamsV3, mReconstructionPass)) { + LOG(info) << "Updating parametrization from path '" << mParametrizationPath << "' and timestamp " << mTimestamp << " and reconstruction pass '" << mReconstructionPass << "' for run number " << bc.runNumber(); + if (mParamFileName.empty()) { // Not loading if parametrization was taken from file + LOG(info) << "Updating parametrization from ccdb"; + const o2::tof::ParameterCollection* paramCollection = ccdb->template getSpecific(mParametrizationPath, mTimestamp); + if (!paramCollection->retrieveParameters(mRespParamsV3, mReconstructionPass)) { if (mFatalOnPassNotAvailable) { LOGF(fatal, "Pass '%s' not available in the retrieved CCDB object", mReconstructionPass.data()); } else { LOGF(warning, "Pass '%s' not available in the retrieved CCDB object, fetching '%s'", mReconstructionPass.data(), mReconstructionPassDefault.data()); - if (!ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->retrieveParameters(mRespParamsV3, mReconstructionPassDefault)) { - ccdb->template getForTimeStamp(mParametrizationPath, mTimestamp)->print(); + if (!paramCollection->retrieveParameters(mRespParamsV3, mReconstructionPassDefault)) { + paramCollection->print(); LOG(fatal) << "Cannot get default pass for calibration " << mReconstructionPassDefault; + } else { // Found the default case + mRespParamsV3.setResolutionParametrization(paramCollection->getPars(mReconstructionPassDefault)); + mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPassDefault)); } } + } else { // Found the non default case + mRespParamsV3.setResolutionParametrization(paramCollection->getPars(mReconstructionPass)); + mRespParamsV3.setMomentumChargeShiftParameters(paramCollection->getPars(mReconstructionPass)); } } // Loading additional calibration objects - if (mTimeShiftCCDBPathPos != "") { - if (mTimeShiftCCDBPathPos.find(".root") != std::string::npos) { - mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathPos, "ccdb_object", true); - } else { - if (mReconstructionPass == "") { - mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathPos, mTimestamp), true); - } else { - std::map metadata; - metadata["RecoPassName"] = mReconstructionPass; - mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(mTimeShiftCCDBPathPos, mTimestamp, metadata), true); - } - } + std::map metadata; + if (!mReconstructionPass.empty()) { + metadata["RecoPassName"] = mReconstructionPass; } - if (mTimeShiftCCDBPathNeg != "") { - if (mTimeShiftCCDBPathNeg.find(".root") != std::string::npos) { - mRespParamsV3.setTimeShiftParameters(mTimeShiftCCDBPathNeg, "ccdb_object", false); - } else { - if (mReconstructionPass == "") { - mRespParamsV3.setTimeShiftParameters(ccdb->template getForTimeStamp(mTimeShiftCCDBPathNeg, mTimestamp), false); - } else { - std::map metadata; - metadata["RecoPassName"] = mReconstructionPass; - mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(mTimeShiftCCDBPathNeg, mTimestamp, metadata), false); - } + auto updateTimeShift = [&](const std::string& nameShift, bool isPositive) { + if (nameShift.empty()) { + return; } - LOG(info) << " test getTimeShift neg: " << mRespParamsV3.getTimeShift(0, false); - } - return; + const bool isFromFile = nameShift.find(".root") != std::string::npos; + if (isFromFile) { + return; + } + LOG(info) << "Updating the time shift for " << (isPositive ? "positive" : "negative") + << " from ccdb '" << nameShift << "' and timestamp " << mTimestamp + << " and pass '" << mReconstructionPass << "'"; + mRespParamsV3.setTimeShiftParameters(ccdb->template getSpecific(nameShift, mTimestamp, metadata), isPositive); + LOG(info) << " test getTimeShift at 0 " << (isPositive ? "pos" : "neg") << ": " + << mRespParamsV3.getTimeShift(0, isPositive); + }; + + updateTimeShift(metadataInfo.isMC() ? mTimeShiftCCDBPathPosMC : mTimeShiftCCDBPathPos, true); + updateTimeShift(metadataInfo.isMC() ? mTimeShiftCCDBPathNegMC : mTimeShiftCCDBPathNeg, false); + + LOG(info) << "Parametrization at setup time:"; + mRespParamsV3.printFullConfig(); } bool autoSetProcessFunctions() const { return mAutoSetProcessFunctions; } @@ -301,11 +300,12 @@ struct TOFCalibConfig { int64_t mTimestamp; std::string mTimeShiftCCDBPathPos; std::string mTimeShiftCCDBPathNeg; + std::string mTimeShiftCCDBPathPosMC; + std::string mTimeShiftCCDBPathNegMC; std::string mParamFileName; std::string mParametrizationPath; std::string mReconstructionPass; std::string mReconstructionPassDefault; - bool mLoadResponseFromCCDB; bool mFatalOnPassNotAvailable; bool mEnableTimeDependentResponse; int mCollisionSystem; @@ -343,11 +343,12 @@ struct tofSignal { Configurable cfgTimestamp{"ccdb-timestamp", -1, "timestamp of the object"}; Configurable cfgTimeShiftCCDBPathPos{"timeShiftCCDBPathPos", "", "Path of the TOF time shift vs eta for pos. tracks. If empty none is taken"}; Configurable cfgTimeShiftCCDBPathNeg{"timeShiftCCDBPathNeg", "", "Path of the TOF time shift vs eta for neg. tracks. If empty none is taken"}; + Configurable cfgTimeShiftCCDBPathPosMC{"timeShiftCCDBPathPosMC", "", "Path of the TOF time shift for MC vs eta for pos. tracks. If empty none is taken"}; + Configurable cfgTimeShiftCCDBPathNegMC{"timeShiftCCDBPathNegMC", "", "Path of the TOF time shift for MC vs eta for neg. tracks. If empty none is taken"}; Configurable cfgParamFileName{"paramFileName", "", "Path to the parametrization object. If empty the parametrization is not taken from file"}; Configurable cfgParametrizationPath{"parametrizationPath", "TOF/Calib/Params", "Path of the TOF parametrization on the CCDB or in the file, if the paramFileName is not empty"}; Configurable cfgReconstructionPass{"reconstructionPass", "", {"Apass to use when fetching the calibration tables. Empty (default) does not check for any pass. Use `metadata` to fetch it from the AO2D metadata. Otherwise it will override the metadata."}}; Configurable cfgReconstructionPassDefault{"reconstructionPassDefault", "unanchored", {"Default pass to get if the standard one is not found"}}; - Configurable cfgLoadResponseFromCCDB{"loadResponseFromCCDB", false, "Flag to load the response from the CCDB"}; Configurable cfgFatalOnPassNotAvailable{"fatalOnPassNotAvailable", true, "Flag to throw a fatal if the pass is not available in the retrieved CCDB object"}; Configurable cfgEnableTimeDependentResponse{"enableTimeDependentResponse", false, "Flag to use the collision timestamp to fetch the PID Response"}; Configurable cfgCollisionSystem{"collisionSystem", -1, "Collision system: -1 (autoset), 0 (pp), 1 (PbPb), 2 (XeXe), 3 (pPb)"}; @@ -516,7 +517,7 @@ struct tofEventTime { void process(TrksWtof& tracks, aod::FT0s const&, EvTimeCollisionsFT0 const&, - aod::BCsWithTimestamps const&) + aod::BCsWithTimestamps const& bcs) { if (!enableTableTOFEvTime) { return; @@ -528,39 +529,24 @@ struct tofEventTime { if (enableTableEvTimeTOFOnly) { tableEvTimeTOFOnly.reserve(tracks.size()); } - bool calibUpdated = false; - for (auto const& track : tracks) { // Loop on all tracks - if (!track.has_collision()) { // Skipping tracks without collisions - continue; - } - const auto& coll = track.collision_as(); - if (!coll.has_bc()) { - continue; - } - mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, coll.bc_as()); // Update the calibration parameters - calibUpdated = true; - break; - } + + mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, bcs.iteratorAt(0)); // Update the calibration parameters // Autoset the processing mode for the event time computation - if (calibUpdated) { - if (mComputeEvTimeWithTOF == -1 || mComputeEvTimeWithFT0 == -1) { - switch (mTOFCalibConfig.collisionSystem()) { - case CollisionSystemType::kCollSyspp: // pp - mComputeEvTimeWithTOF.value = ((mComputeEvTimeWithTOF == -1) ? 0 : mComputeEvTimeWithTOF.value); - mComputeEvTimeWithFT0.value = ((mComputeEvTimeWithFT0 == -1) ? 1 : mComputeEvTimeWithFT0.value); - break; - case CollisionSystemType::kCollSysPbPb: // PbPb - mComputeEvTimeWithTOF.value = ((mComputeEvTimeWithTOF == -1) ? 1 : mComputeEvTimeWithTOF.value); - mComputeEvTimeWithFT0.value = ((mComputeEvTimeWithFT0 == -1) ? 0 : mComputeEvTimeWithFT0.value); - break; - default: - LOG(fatal) << "Collision system " << mTOFCalibConfig.collisionSystem() << " " << CollisionSystemType::getCollisionSystemName(mTOFCalibConfig.collisionSystem()) << " not supported for TOF event time computation"; - break; - } + if (mComputeEvTimeWithTOF == -1 || mComputeEvTimeWithFT0 == -1) { + switch (mTOFCalibConfig.collisionSystem()) { + case CollisionSystemType::kCollSyspp: // pp + mComputeEvTimeWithTOF.value = ((mComputeEvTimeWithTOF == -1) ? 0 : mComputeEvTimeWithTOF.value); + mComputeEvTimeWithFT0.value = ((mComputeEvTimeWithFT0 == -1) ? 1 : mComputeEvTimeWithFT0.value); + break; + case CollisionSystemType::kCollSysPbPb: // PbPb + mComputeEvTimeWithTOF.value = ((mComputeEvTimeWithTOF == -1) ? 1 : mComputeEvTimeWithTOF.value); + mComputeEvTimeWithFT0.value = ((mComputeEvTimeWithFT0 == -1) ? 0 : mComputeEvTimeWithFT0.value); + break; + default: + LOG(fatal) << "Collision system " << mTOFCalibConfig.collisionSystem() << " " << CollisionSystemType::getCollisionSystemName(mTOFCalibConfig.collisionSystem()) << " not supported for TOF event time computation"; + break; } - } else { - LOG(warning) << "Calibration not updated on " << tracks.size() << " tracks !!"; } LOG(debug) << "Running on " << CollisionSystemType::getCollisionSystemName(mTOFCalibConfig.collisionSystem()) << " mComputeEvTimeWithTOF " << mComputeEvTimeWithTOF.value << " mComputeEvTimeWithFT0 " << mComputeEvTimeWithFT0.value; @@ -940,27 +926,14 @@ struct mcPidTof { using ResponseImplementation = o2::pid::tof::ExpTimes; void processFillTables(TrksWtofWevTime const& tracks, Cols const&, - aod::BCsWithTimestamps const&, + aod::BCsWithTimestamps const& bcs, aod::McParticles const&) { constexpr auto responsePi = ResponseImplementation(); constexpr auto responseKa = ResponseImplementation(); constexpr auto responsePr = ResponseImplementation(); - for (auto const& track : tracks) { // Loop on all tracks - if (!track.has_collision()) { // Skipping tracks without collisions - continue; - } - const auto& coll = track.collision(); - if (!coll.has_bc()) { - continue; - } - mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, coll.bc_as()); // Update the calibration parameters - if (mcRecalib.enable && mTOFCalibConfig.collisionSystem() != CollisionSystemType::kCollSyspp) { - LOGP(fatal, "MC recalibration only available for pp! Change the mcRecalib.enable configurable to 0 and rerun"); - } - break; - } + mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, bcs.iteratorAt(0)); // Update the calibration parameters for (auto const& pidId : mEnabledParticles) { reserveTable(pidId, tracks.size(), false); From c5cad7b76f83975ce06d07d7201d63cf4db99dec Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Sun, 1 Dec 2024 19:07:40 +0100 Subject: [PATCH 194/459] [PWGCF] DptDpt - Splitting the PID QC information (#8754) Co-authored-by: Victor --- PWGCF/TableProducer/dptdptfilter.cxx | 11 +- PWGCF/TableProducer/dptdptfilter.h | 15 +- PWGCF/Tasks/match-reco-gen.cxx | 10 +- .../Tasks/efficiencyAndQc.cxx | 305 ++++++++++++------ 4 files changed, 228 insertions(+), 113 deletions(-) diff --git a/PWGCF/TableProducer/dptdptfilter.cxx b/PWGCF/TableProducer/dptdptfilter.cxx index a16d7737c84..35136acff91 100644 --- a/PWGCF/TableProducer/dptdptfilter.cxx +++ b/PWGCF/TableProducer/dptdptfilter.cxx @@ -32,6 +32,7 @@ #include "PWGCF/DataModel/DptDptFiltered.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/CollisionAssociationTables.h" +#include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" #include "Framework/RunningWorkflowInfo.h" #include @@ -778,6 +779,7 @@ struct DptDptFilterTracks { "PID criteria for muons"}; OutputObj fOutput{"DptDptFilterTracksInfo", OutputObjHandlingPolicy::AnalysisObject}; + Service fPDG; PIDSpeciesSelection pidselector; bool checkAmbiguousTracks = false; @@ -821,7 +823,6 @@ struct DptDptFilterTracks { fSystem = getSystemType(tmpstr); getTaskOptionValue(initContext, "dpt-dpt-filter", "datatype", tmpstr, false); fDataType = getDataType(tmpstr); - fPDG = TDatabasePDG::Instance(); /* required ambiguous tracks checks? */ if (dofilterDetectorLevelWithoutPIDAmbiguous || dofilterDetectorLevelWithPIDAmbiguous || dofilterDetectorLevelWithFullPIDAmbiguous || @@ -1181,9 +1182,10 @@ struct DptDptFilterTracks { } for (auto const& particle : particles) { - float charge = getCharge(particle); - int8_t pid = -1; + auto pdgpart = fPDG->GetParticle(particle.pdgCode()); + float charge = pdgpart != nullptr ? getCharge(pdgpart->Charge()) : 0; + if (charge != 0) { if (particle.has_mcCollision() && (particle.template mcCollision_as>()).collisionaccepted()) { auto mccollision = particle.template mcCollision_as>(); @@ -1505,8 +1507,9 @@ inline int8_t DptDptFilterTracks::identifySecFromMaterialParticle(ParticleObject template inline int8_t DptDptFilterTracks::selectParticle(ParticleObject const& particle, MCCollisionObject const& mccollision) { - float charge = getCharge(particle); int8_t sp = -127; + auto pdgpart = fPDG->GetParticle(particle.pdgCode()); + float charge = pdgpart != nullptr ? getCharge(pdgpart->Charge()) : 0; if (charge != 0) { /* before particle selection */ fillParticleHistosBeforeSelection(particle, mccollision, charge); diff --git a/PWGCF/TableProducer/dptdptfilter.h b/PWGCF/TableProducer/dptdptfilter.h index 10c453250fa..40cb60c13fb 100644 --- a/PWGCF/TableProducer/dptdptfilter.h +++ b/PWGCF/TableProducer/dptdptfilter.h @@ -352,8 +352,6 @@ float particleMaxDCAxy = 999.9f; float particleMaxDCAZ = 999.9f; bool traceCollId0 = false; -TDatabasePDG* fPDG = nullptr; - inline TriggerSelectionType getTriggerSelection(std::string const& triggstr) { if (triggstr.empty() || triggstr == "MB") { @@ -1107,14 +1105,9 @@ void exploreMothers(ParticleObject& particle, MCCollisionObject& collision) } } -template -inline float getCharge(ParticleObject& particle) +inline float getCharge(float pdgCharge) { - float charge = 0.0; - TParticlePDG* pdgparticle = fPDG->GetParticle(particle.pdgCode()); - if (pdgparticle != nullptr) { - charge = (pdgparticle->Charge() / 3 >= 1) ? 1.0 : ((pdgparticle->Charge() / 3 <= -1) ? -1.0 : 0); - } + float charge = (pdgCharge / 3 >= 1) ? 1.0 : ((pdgCharge / 3 <= -1) ? -1.0 : 0); return charge; } @@ -1129,15 +1122,13 @@ inline bool acceptParticle(ParticleObject& particle, MCCollisionObject const&) return false; } - float charge = getCharge(particle); - if (particle.isPhysicalPrimary()) { if ((particle.mcCollisionId() == 0) && traceCollId0) { LOGF(info, "Particle %d passed isPhysicalPrimary", particle.globalIndex()); } if (ptlow < particle.pt() && particle.pt() < ptup && etalow < particle.eta() && particle.eta() < etaup) { - return (charge != 0) ? true : false; + return true; } } else { if ((particle.mcCollisionId() == 0) && traceCollId0) { diff --git a/PWGCF/Tasks/match-reco-gen.cxx b/PWGCF/Tasks/match-reco-gen.cxx index 064b1739651..2b2fe0fa47e 100644 --- a/PWGCF/Tasks/match-reco-gen.cxx +++ b/PWGCF/Tasks/match-reco-gen.cxx @@ -22,11 +22,11 @@ #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" #include "PWGCF/Core/AnalysisConfigurableCuts.h" #include "PWGCF/DataModel/DptDptFiltered.h" #include "PWGCF/TableProducer/dptdptfilter.h" -#include #include #include #include @@ -71,6 +71,7 @@ struct CheckGeneratorLevelVsDetectorLevel { Configurable cfgTrackCollAssoc{"trackcollassoc", false, "Track collision id association, track-mcparticle-mccollision vs. track-collision-mccollision: true, false. Default false"}; HistogramRegistry histos{"RecoGenHistograms", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + Service fPDG; typedef enum { kBEFORE = 0, kAFTER } beforeafterselection; typedef enum { kPOSITIVE = 0, @@ -110,7 +111,6 @@ struct CheckGeneratorLevelVsDetectorLevel { /* if the system type is not known at this time, we have to put the initialization somewhere else */ fSystem = getSystemType(cfgSystem); fDataType = getDataType(cfgDataType); - fPDG = TDatabasePDG::Instance(); AxisSpec deltaEta = {100, -2, 2, "#Delta#eta"}; AxisSpec deltaPhi = {100, 0, constants::math::TwoPI, "#Delta#varphi (rad)"}; @@ -337,10 +337,10 @@ struct CheckGeneratorLevelVsDetectorLevel { size_t nreco = tracks.size(); size_t ngen = 0; - for (auto& part : mcParticles) { + for (auto const& part : mcParticles) { auto pdgpart = fPDG->GetParticle(part.pdgCode()); if (pdgpart != nullptr) { - float charge = (pdgpart->Charge() >= 3) ? 1.0 : ((pdgpart->Charge() <= -3) ? -1.0 : 0.0); + float charge = getCharge(pdgpart->Charge()); if (charge != 0.0) { ngen++; } @@ -394,7 +394,7 @@ struct CheckGeneratorLevelVsDetectorLevel { for (auto& part : mcParticles) { auto pdgpart = fPDG->GetParticle(part.pdgCode()); if (pdgpart != nullptr) { - float charge = (pdgpart->Charge() >= 3) ? 1.0 : ((pdgpart->Charge() <= -3) ? -1.0 : 0.0); + float charge = getCharge(pdgpart->Charge()); if (charge != 0.0) { ngen++; } diff --git a/PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx index d8e362b4895..60830fe414d 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx @@ -49,12 +49,20 @@ using namespace o2::framework::expressions; namespace efficiencyandqatask { /// \enum KindOfProcessQA -/// \brief The kind of processing for templating the procedures -enum KindOfProcess { +/// \brief The kind of data for templating the procedures +enum KindOfData { kReco = 0, ///< processing over reconstructed particles/tracks kGen ///< processing over generated particles }; +/// \enum KindOfProcess +/// \brief The kind of processing for templating the procedures and produce histograms +enum KindOfProcess { + kBASIC, ///< produce the basic histograms + kPID, ///< produce the basic PID histograms + kPIDEXTRA ///< produce the extra PID histograms +}; + /// \enum BeforeAfter /// \brief The kind of filling, before or after track selection enum BeforeAfter { @@ -153,7 +161,7 @@ struct QADataCollectingEngine { std::vector> fhTPC_CrossedRowsOverFindableCls_vs_PtA{nsp, nullptr}; std::vector> fhTPC_Chi2NCls_vs_PtA{nsp, nullptr}; - template + template void init(HistogramRegistry& registry, const char* dirname) { using namespace efficiencyandqatask; @@ -174,17 +182,17 @@ struct QADataCollectingEngine { const AxisSpec tpcCh2Axis{100, 0, 10, "#Chi^{2}/Cls TPC"}; /* the reconstructed and generated levels histograms */ - std::string recogen = (kind == kReco) ? "Reco" : "Gen"; - fhPtB[kind] = ADDHISTOGRAM(TH1, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "Pt", "#it{p}_{T}", kTH1F, {ptAxis}); - fhPt_vs_EtaB[kind] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "PtVsEta", "#it{p}_T vs #eta", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_ZvtxB[kind] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "PtVsZvtx", "#it{p}_T vs #it{z}_{vtx}", kTH2F, {zvtxAxis, ptAxis}); + std::string recogen = (kindOfData == kReco) ? "Reco" : "Gen"; + fhPtB[kindOfData] = ADDHISTOGRAM(TH1, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "Pt", "#it{p}_{T}", kTH1F, {ptAxis}); + fhPt_vs_EtaB[kindOfData] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "PtVsEta", "#it{p}_T vs #eta", kTH2F, {etaAxis, ptAxis}); + fhPt_vs_ZvtxB[kindOfData] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "PtVsZvtx", "#it{p}_T vs #it{z}_{vtx}", kTH2F, {zvtxAxis, ptAxis}); for (uint isp = 0; isp < nsp; ++isp) { - fhPtA[kind][isp] = ADDHISTOGRAM(TH1, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("Pt_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} %s", tnames[isp].c_str()), kTH1F, {ptAxis}); - fhPt_vs_EtaA[kind][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("PtVsEta_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} vs #eta %s", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_ZvtxA[kind][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("PtVsZvtx_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} vs #it{z}_{zvtx} %s", tnames[isp].c_str()), kTH2F, {zvtxAxis, ptAxis}); + fhPtA[kindOfData][isp] = ADDHISTOGRAM(TH1, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("Pt_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} %s", tnames[isp].c_str()), kTH1F, {ptAxis}); + fhPt_vs_EtaA[kindOfData][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("PtVsEta_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} vs #eta %s", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPt_vs_ZvtxA[kindOfData][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("PtVsZvtx_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} vs #it{z}_{zvtx} %s", tnames[isp].c_str()), kTH2F, {zvtxAxis, ptAxis}); } - if constexpr (kind == kReco) { + if constexpr (kindOfData == kReco) { /* only the reconstructed level histograms*/ fhITS_NCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSNCls", "ITS clusters", kTH2F, {ptAxis, itsNClsAxis}); fhITS_Chi2NCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSChi2NCls", "ITS #Chi^{2}", kTH2F, {ptAxis, itsCh2Axis}); @@ -290,22 +298,22 @@ struct QADataCollectingEngine { } } - template + template void processTrack(float zvtx, TrackObject const& track) { using namespace efficiencyandqatask; using namespace analysis::dptdptfilter; using namespace o2::aod::track; - fhPtB[kind]->Fill(track.pt()); - fhPt_vs_EtaB[kind]->Fill(track.eta(), track.pt()); - fhPt_vs_ZvtxB[kind]->Fill(zvtx, track.pt()); + fhPtB[kindOfData]->Fill(track.pt()); + fhPt_vs_EtaB[kindOfData]->Fill(track.eta(), track.pt()); + fhPt_vs_ZvtxB[kindOfData]->Fill(zvtx, track.pt()); if (!(track.trackacceptedid() < 0)) { - fhPtA[kind][track.trackacceptedid()]->Fill(track.pt()); - fhPt_vs_EtaA[kind][track.trackacceptedid()]->Fill(track.eta(), track.pt()); - fhPt_vs_ZvtxA[kind][track.trackacceptedid()]->Fill(zvtx, track.pt()); + fhPtA[kindOfData][track.trackacceptedid()]->Fill(track.pt()); + fhPt_vs_EtaA[kindOfData][track.trackacceptedid()]->Fill(track.eta(), track.pt()); + fhPt_vs_ZvtxA[kindOfData][track.trackacceptedid()]->Fill(zvtx, track.pt()); } - if constexpr (kind == kReco) { + if constexpr (kindOfData == kReco) { auto fillhisto = [&track](auto& h, bool cond) { if (cond) { h->Fill(track.eta(), track.pt()); @@ -405,7 +413,7 @@ struct QADataCollectingEngine { } } } - if constexpr (kind == kGen) { + if constexpr (kindOfData == kGen) { if (!(track.trackacceptedid() < 0)) { /* pure generator level */ if (track.isPhysicalPrimary()) { @@ -436,19 +444,8 @@ struct PidDataCollectingEngine { std::vector>> fhTOFnSigmasVsP{2, {nallmainsp, nullptr}}; std::vector> fhPvsTOFSqMass{2, nullptr}; std::vector>> fhTPCTOFSigmaVsP{2, {nmainsp, nullptr}}; - /* PID histograms */ - /* only after track selection */ - std::vector> fhIdTPCdEdxSignalVsP{nsp, nullptr}; - std::vector> fpIdTPCdEdxSignalVsPSigmas{nsp, nullptr}; - std::vector>> fhIdTPCdEdxSignalDiffVsP{nsp, {nmainsp, nullptr}}; - std::vector>> fhIdTPCnSigmasVsP{nsp, {nallmainsp, nullptr}}; - std::vector> fhIdTOFSignalVsP{nsp, nullptr}; - std::vector> fpIdTOFSignalVsPSigmas{nsp, nullptr}; - std::vector>> fhIdTOFSignalDiffVsP{nsp, {nmainsp, nullptr}}; - std::vector>> fhIdTOFnSigmasVsP{nsp, {nallmainsp, nullptr}}; - std::vector> fhIdPvsTOFSqMass{nsp, nullptr}; - template + template void init(HistogramRegistry& registry, const char* dirname) { using namespace efficiencyandqatask; @@ -457,7 +454,7 @@ struct PidDataCollectingEngine { AxisSpec pidPAxis{150, 0.1, 5.0, "#it{p} (GeV/#it{c})"}; pidPAxis.makeLogarithmic(); - if constexpr (kind == kReco) { + if constexpr (kindOfData == kReco) { /* PID histograms */ std::vector whenname{"Before", "After"}; char whenprefix[2]{'B', 'A'}; @@ -499,6 +496,108 @@ struct PidDataCollectingEngine { kTH2F, {pidPAxis, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TOF}^{%s}", allmainsptitles[isp].c_str())}}); } } + } + } + + template + void fillAllSpeciesPID(uint ix, TrackObject const& track, float mom) + { + if (track.sign() < 0) { + ix = 2 * ix + 1; + } else { + ix = 2 * ix; + } + for (uint when = 0; when < 2; ++when) { + fhTPCnSigmasVsP[when][ix]->Fill(mom, o2::aod::pidutils::tpcNSigma(track)); + fhTOFnSigmasVsP[when][ix]->Fill(mom, o2::aod::pidutils::tofNSigma(track)); + if (track.trackacceptedid() < 0) { + /* track not accepted */ + return; + } + } + } + + template + void fillSpeciesPID(uint ix, TrackObject const& track, float mom) + { + if (track.sign() < 0) { + ix = 2 * ix + 1; + } else { + ix = 2 * ix; + } + for (uint when = 0; when < 2; ++when) { + fhTPCdEdxSignalDiffVsP[when][ix]->Fill(mom, o2::aod::pidutils::tpcExpSignalDiff(track)); + fhTOFSignalDiffVsP[when][ix]->Fill(mom, o2::aod::pidutils::tofExpSignalDiff(track)); + fhTPCTOFSigmaVsP[when][ix]->Fill(mom, o2::aod::pidutils::tpcNSigma(track), o2::aod::pidutils::tofNSigma(track)); + if (track.trackacceptedid() < 0) { + /* track not accepted */ + return; + } + } + } + + template + void fillPID(TrackObject const& track, float mom) + { + for (uint when = 0; when < 2; ++when) { + fhTPCdEdxSignalVsP[when]->Fill(mom, track.tpcSignal()); + fhTOFSignalVsP[when]->Fill(mom, track.beta()); + fhPvsTOFSqMass[when]->Fill(track.mass() * track.mass(), mom); + if (track.trackacceptedid() < 0) { + /* track not accepted */ + return; + } + } + } + + template + void processTrack(TrackObject const& track, float mom) + { + using namespace efficiencyandqatask; + + if constexpr (kindOfData == kReco) { + fillPID(track, mom); + fillSpeciesPID(0, track, mom); + fillSpeciesPID(1, track, mom); + fillSpeciesPID(2, track, mom); + fillAllSpeciesPID(0, track, mom); + fillAllSpeciesPID(1, track, mom); + fillAllSpeciesPID(2, track, mom); + fillAllSpeciesPID(3, track, mom); + fillAllSpeciesPID(4, track, mom); + } + } +}; + +/* the PID extra data collecting engine */ +struct PidExtraDataCollectingEngine { + uint nsp = static_cast(efficiencyandqatask::tnames.size()); + uint nmainsp = static_cast(efficiencyandqatask::mainspnames.size()); + uint nallmainsp = static_cast(efficiencyandqatask::allmainspnames.size()); + + /* PID histograms */ + /* only after track selection */ + std::vector> fhIdTPCdEdxSignalVsP{nsp, nullptr}; + std::vector> fpIdTPCdEdxSignalVsPSigmas{nsp, nullptr}; + std::vector>> fhIdTPCdEdxSignalDiffVsP{nsp, {nmainsp, nullptr}}; + std::vector>> fhIdTPCnSigmasVsP{nsp, {nallmainsp, nullptr}}; + std::vector> fhIdTOFSignalVsP{nsp, nullptr}; + std::vector> fpIdTOFSignalVsPSigmas{nsp, nullptr}; + std::vector>> fhIdTOFSignalDiffVsP{nsp, {nmainsp, nullptr}}; + std::vector>> fhIdTOFnSigmasVsP{nsp, {nallmainsp, nullptr}}; + std::vector> fhIdPvsTOFSqMass{nsp, nullptr}; + + template + void init(HistogramRegistry& registry, const char* dirname) + { + using namespace efficiencyandqatask; + + const AxisSpec dEdxAxis{200, 0.0, 200.0, "dE/dx (au)"}; + AxisSpec pidPAxis{150, 0.1, 5.0, "#it{p} (GeV/#it{c})"}; + pidPAxis.makeLogarithmic(); + + if constexpr (kindOfData == kReco) { + /* PID histograms */ for (uint isp = 0; isp < nsp; ++isp) { fhIdTPCdEdxSignalVsP[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", "Selected"), HNAMESTRING("tpcSignalVsPSelected_%s", tnames[isp].c_str()), @@ -536,19 +635,15 @@ struct PidDataCollectingEngine { template void fillAllSpeciesPID(uint ix, TrackObject const& track, float mom) { + if (track.trackacceptedid() < 0) { + /* track not accepted */ + return; + } if (track.sign() < 0) { ix = 2 * ix + 1; } else { ix = 2 * ix; } - for (uint when = 0; when < 2; ++when) { - fhTPCnSigmasVsP[when][ix]->Fill(mom, o2::aod::pidutils::tpcNSigma(track)); - fhTOFnSigmasVsP[when][ix]->Fill(mom, o2::aod::pidutils::tofNSigma(track)); - if (track.trackacceptedid() < 0) { - /* track not accepted */ - return; - } - } fhIdTPCnSigmasVsP[track.trackacceptedid()][ix]->Fill(mom, o2::aod::pidutils::tpcNSigma(track)); fhIdTOFnSigmasVsP[track.trackacceptedid()][ix]->Fill(mom, o2::aod::pidutils::tofNSigma(track)); if (efficiencyandqatask::pidselector.isGlobalSpecies(track.trackacceptedid() / 2, id)) { @@ -559,46 +654,27 @@ struct PidDataCollectingEngine { } template - void fillSpeciesPID(uint ix, TrackObject const& track, float mom) + void fillSpeciesPID(uint, TrackObject const&, float) { - if (track.sign() < 0) { - ix = 2 * ix + 1; - } else { - ix = 2 * ix; - } - for (uint when = 0; when < 2; ++when) { - fhTPCdEdxSignalDiffVsP[when][ix]->Fill(mom, o2::aod::pidutils::tpcExpSignalDiff(track)); - fhTOFSignalDiffVsP[when][ix]->Fill(mom, o2::aod::pidutils::tofExpSignalDiff(track)); - fhTPCTOFSigmaVsP[when][ix]->Fill(mom, o2::aod::pidutils::tpcNSigma(track), o2::aod::pidutils::tofNSigma(track)); - if (track.trackacceptedid() < 0) { - /* track not accepted */ - return; - } - } } template void fillPID(TrackObject const& track, float mom) { - for (uint when = 0; when < 2; ++when) { - fhTPCdEdxSignalVsP[when]->Fill(mom, track.tpcSignal()); - fhTOFSignalVsP[when]->Fill(mom, track.beta()); - fhPvsTOFSqMass[when]->Fill(track.mass() * track.mass(), mom); - if (track.trackacceptedid() < 0) { - /* track not accepted */ - return; - } + if (track.trackacceptedid() < 0) { + /* track not accepted */ + return; } fhIdTPCdEdxSignalVsP[track.trackacceptedid()]->Fill(mom, track.tpcSignal()); fhIdTOFSignalVsP[track.trackacceptedid()]->Fill(mom, track.beta()); } - template + template void processTrack(TrackObject const& track, float mom) { using namespace efficiencyandqatask; - if constexpr (kind == kReco) { + if constexpr (kindOfData == kReco) { fillPID(track, mom); fillSpeciesPID(0, track, mom); fillSpeciesPID(1, track, mom); @@ -622,6 +698,7 @@ struct DptDptEfficiencyAndQc { /* the data collecting engine instances */ QADataCollectingEngine** qaDataCE; PidDataCollectingEngine** pidDataCE; + PidExtraDataCollectingEngine** pidExtraDataCE; /* the histogram registries */ HistogramRegistry registry_one{"registry_one", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -658,11 +735,16 @@ struct DptDptEfficiencyAndQc { using namespace analysis::dptdptfilter; /* do nothing if not active */ - if (!doprocessDetectorLevelNotStored && !doprocessDetectorLevelNotStoredNoPID && !doprocessGeneratorLevelNotStored && !doprocessReconstructedNotStored && !doprocessReconstructedNotStoredNoPID) { + if (!doprocessDetectorLevelNotStored && + !doprocessDetectorLevelNotStoredPID && + !doprocessDetectorLevelNotStoredPIDExtra && + !doprocessGeneratorLevelNotStored && + !doprocessReconstructedNotStored && + !doprocessReconstructedNotStoredPID && + !doprocessReconstructedNotStoredPIDExtra) { return; } - fPDG = TDatabasePDG::Instance(); /* Self configuration: requires dptdptfilter task in the workflow */ { /* the binning */ @@ -736,15 +818,20 @@ struct DptDptEfficiencyAndQc { fCentMultMin[0] = 0.0f; fCentMultMax[0] = 100.0f; } - bool doPidAnalysis = doprocessDetectorLevelNotStored || doprocessReconstructedNotStored; - qaDataCE = new QADataCollectingEngine*[ncmranges]; + bool doBasicAnalysis = doprocessDetectorLevelNotStored || doprocessReconstructedNotStored; + bool doPidAnalysis = doprocessDetectorLevelNotStoredPID || doprocessReconstructedNotStoredPID; + bool doPidExtraAnalysis = doprocessDetectorLevelNotStoredPIDExtra || doprocessReconstructedNotStoredPIDExtra; + + if (doBasicAnalysis) { + qaDataCE = new QADataCollectingEngine*[ncmranges]; + } if (doPidAnalysis) { pidDataCE = new PidDataCollectingEngine*[ncmranges]; } - std::string recogen; - if (!(doprocessReconstructedNotStored || doprocessReconstructedNotStoredNoPID) && !(doprocessDetectorLevelNotStored || doprocessDetectorLevelNotStoredNoPID)) { - LOGF(fatal, "Neither reco nor detector level not configured. Please, fix it!"); + if (doPidAnalysis) { + pidExtraDataCE = new PidExtraDataCollectingEngine*[ncmranges]; } + std::string recogen; if (ncmranges > registrybank.size()) { LOGF(fatal, "There are more centrality ranges configured than registries in the bank. Please fix it!"); } @@ -768,11 +855,21 @@ struct DptDptEfficiencyAndQc { initializeCEInstance(dce, TString::Format("EfficiencyAndPidData-%d-%d", static_cast(min), static_cast(max)), *pidregistrybank[i]); return dce; }; + auto buildPidExtraCEInstance = [&](float min, float max) { + auto* dce = new PidExtraDataCollectingEngine(); + initializeCEInstance(dce, TString::Format("EfficiencyAndPidData-%d-%d", static_cast(min), static_cast(max)), *pidregistrybank[i]); + return dce; + }; /* in reverse order for proper order in results file */ - qaDataCE[ncmranges - i - 1] = buildQACEInstance(fCentMultMin[ncmranges - i - 1], fCentMultMax[ncmranges - i - 1]); + if (doBasicAnalysis) { + qaDataCE[ncmranges - i - 1] = buildQACEInstance(fCentMultMin[ncmranges - i - 1], fCentMultMax[ncmranges - i - 1]); + } if (doPidAnalysis) { pidDataCE[ncmranges - i - 1] = buildPidCEInstance(fCentMultMin[ncmranges - i - 1], fCentMultMax[ncmranges - i - 1]); } + if (doPidExtraAnalysis) { + pidExtraDataCE[ncmranges - i - 1] = buildPidExtraCEInstance(fCentMultMin[ncmranges - i - 1], fCentMultMax[ncmranges - i - 1]); + } } for (uint i = 0; i < ncmranges; ++i) { LOGF(info, " centrality/multipliicty range: %d, low limit: %0.2f, up limit: %0.2f", i, fCentMultMin[i], fCentMultMax[i]); @@ -804,7 +901,7 @@ struct DptDptEfficiencyAndQc { } } - template + template void processTracks(FilteredCollisions::iterator const& collision, PassedTracks const& tracks) { using namespace efficiencyandqatask; @@ -818,9 +915,14 @@ struct DptDptEfficiencyAndQc { mom = track.tpcInnerParam(); } } - qaDataCE[ixDCE]->processTrack(collision.posZ(), track); - if constexpr (dopid) { - pidDataCE[ixDCE]->processTrack(track, mom); + if constexpr (kindOfProcess == kBASIC) { + qaDataCE[ixDCE]->processTrack(collision.posZ(), track); + } + if constexpr (kindOfProcess == kPID) { + pidDataCE[ixDCE]->processTrack(track, mom); + } + if constexpr (kindOfProcess == kPIDEXTRA) { + pidExtraDataCE[ixDCE]->processTrack(track, mom); } } } @@ -838,21 +940,21 @@ struct DptDptEfficiencyAndQc { Filter onlyacceptedcollisions = (aod::dptdptfilter::collisionaccepted == uint8_t(true)); void processReconstructedNotStored(soa::Filtered>::iterator const& collision, - soa::Join& tracks) + soa::Join& tracks) { using namespace efficiencyandqatask; - processTracks>, true, kReco>(collision, tracks); + processTracks>, kBASIC, kReco>(collision, tracks); } PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStored, "Process reconstructed efficiency and QA for not stored derived data", false); void processDetectorLevelNotStored(soa::Filtered>::iterator const& collision, - soa::Join& tracks, + soa::Join& tracks, soa::Join const&) { using namespace efficiencyandqatask; - processTracks>, true, kReco>(collision, tracks); + processTracks>, kBASIC, kReco>(collision, tracks); } PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStored, "Process MC detector level efficiency and QA for not stored derived data", false); @@ -861,28 +963,47 @@ struct DptDptEfficiencyAndQc { { using namespace efficiencyandqatask; - processTracks>, false, kGen>(collision, particles); + processTracks>, kBASIC, kGen>(collision, particles); } PROCESS_SWITCH(DptDptEfficiencyAndQc, processGeneratorLevelNotStored, "Process MC generator level efficiency and QA for not stored derived data", true); - void processReconstructedNotStoredNoPID(soa::Filtered>::iterator const& collision, - soa::Join& tracks) + void processReconstructedNotStoredPID(soa::Filtered>::iterator const& collision, + soa::Join& tracks) + { + using namespace efficiencyandqatask; + + processTracks>, kPID, kReco>(collision, tracks); + } + PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStoredPID, "Process reconstructed efficiency and QA for not stored derived data", false); + + void processReconstructedNotStoredPIDExtra(soa::Filtered>::iterator const& collision, + soa::Join& tracks) + { + using namespace efficiencyandqatask; + + processTracks>, kPIDEXTRA, kReco>(collision, tracks); + } + PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStoredPIDExtra, "Process reconstructed efficiency and QA for not stored derived data", false); + + void processDetectorLevelNotStoredPID(soa::Filtered>::iterator const& collision, + soa::Join& tracks, + soa::Join const&) { using namespace efficiencyandqatask; - processTracks>, false, kReco>(collision, tracks); + processTracks>, kPID, kReco>(collision, tracks); } - PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStoredNoPID, "Process reconstructed efficiency and QA for not stored derived data", false); + PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStoredPID, "Process MC detector level efficiency and QA for not stored derived data", true); - void processDetectorLevelNotStoredNoPID(soa::Filtered>::iterator const& collision, - soa::Join& tracks, - soa::Join const&) + void processDetectorLevelNotStoredPIDExtra(soa::Filtered>::iterator const& collision, + soa::Join& tracks, + soa::Join const&) { using namespace efficiencyandqatask; - processTracks>, false, kReco>(collision, tracks); + processTracks>, kPIDEXTRA, kReco>(collision, tracks); } - PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStoredNoPID, "Process MC detector level efficiency and QA for not stored derived data", true); + PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStoredPIDExtra, "Process MC detector level efficiency and QA for not stored derived data", true); }; using BCsWithTimestamps = soa::Join; From 548d479e78d2f114e734381e780399082de8ddbf Mon Sep 17 00:00:00 2001 From: Evgeny Kryshen Date: Sun, 1 Dec 2024 21:36:57 +0300 Subject: [PATCH 195/459] [DPG] Added counter of inactive chips per layer vs time (#8755) --- DPG/Tasks/AOTEvent/eventSelectionQa.cxx | 134 +++++++++++++++--------- 1 file changed, 83 insertions(+), 51 deletions(-) diff --git a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx index 2fce7d0325d..e8835587438 100644 --- a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx +++ b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx @@ -48,26 +48,23 @@ using FullTracksIUwithLabels = soa::Join isMC{"isMC", 0, "0 - data, 1 - MC"}; - Configurable nGlobalBCs{"nGlobalBCs", 100000, "number of global bcs"}; - Configurable minOrbitConf{"minOrbit", 0, "minimum orbit"}; - Configurable nOrbitsConf{"nOrbits", 10000, "number of orbits"}; + Configurable nGlobalBCs{"nGlobalBCs", 100000, "number of global bcs for detailed monitoring"}; Configurable isLowFlux{"isLowFlux", 1, "1 - low flux (pp, pPb), 0 - high flux (PbPb)"}; Service ccdb; HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; bool* applySelection = NULL; - int nBCsPerOrbit = 3564; - int lastRun = -1; - int nOrbits = nOrbitsConf; - int64_t minOrbit = minOrbitConf; - int64_t minGlobalBC = minOrbit * nBCsPerOrbit; + static const int32_t nBCsPerOrbit = o2::constants::lhc::LHCMaxBunches; + int32_t lastRun = -1; + int64_t nOrbits = 1; // number of orbits, setting 1 for unanchored MC + int64_t orbitSOR = 0; // first orbit, setting 0 for unanchored MC int64_t bcSOR = 0; // global bc of the start of the first orbit, setting 0 for unanchored MC int32_t nOrbitsPerTF = 128; // 128 in 2022, 32 in 2023, setting 128 for unanchored MC int64_t nBCsPerTF = nOrbitsPerTF * nBCsPerOrbit; // duration of TF in bcs - std::bitset bcPatternA; - std::bitset bcPatternC; - std::bitset bcPatternB; + std::bitset bcPatternA; + std::bitset bcPatternC; + std::bitset bcPatternB; SliceCache cache; Partition tracklets = (aod::track::trackType == static_cast(o2::aod::track::TrackTypeEnum::Run2Tracklet)); @@ -87,9 +84,6 @@ struct EventSelectionQaTask { void init(InitContext&) { - minGlobalBC = minOrbit * nBCsPerOrbit; - - // ccdb->setURL("http://ccdb-test.cern.ch:8080"); ccdb->setURL("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -388,22 +382,22 @@ struct EventSelectionQaTask { uint64_t globalBC = bc.globalBC(); // uint64_t orbit = globalBC / nBCsPerOrbit; int localBC = globalBC % nBCsPerOrbit; - histos.fill(HIST("hGlobalBcAll"), globalBC - minGlobalBC); - // histos.fill(HIST("hOrbitAll"), orbit - minOrbit); + histos.fill(HIST("hGlobalBcAll"), globalBC - bcSOR); + // histos.fill(HIST("hOrbitAll"), orbit - orbitSOR); histos.fill(HIST("hBcAll"), localBC); if (col.selection_bit(kIsBBV0A) || col.selection_bit(kIsBBV0C)) { - histos.fill(HIST("hGlobalBcFV0"), globalBC - minGlobalBC); - // histos.fill(HIST("hOrbitFV0"), orbit - minOrbit); + histos.fill(HIST("hGlobalBcFV0"), globalBC - bcSOR); + // histos.fill(HIST("hOrbitFV0"), orbit - orbitSOR); histos.fill(HIST("hBcFV0"), localBC); } if (col.selection_bit(kIsBBT0A) || col.selection_bit(kIsBBT0C)) { - histos.fill(HIST("hGlobalBcFT0"), globalBC - minGlobalBC); - // histos.fill(HIST("hOrbitFT0"), orbit - minOrbit); + histos.fill(HIST("hGlobalBcFT0"), globalBC - bcSOR); + // histos.fill(HIST("hOrbitFT0"), orbit - orbitSOR); histos.fill(HIST("hBcFT0"), localBC); } if (col.selection_bit(kIsBBFDA) || col.selection_bit(kIsBBFDC)) { - histos.fill(HIST("hGlobalBcFDD"), globalBC - minGlobalBC); - // histos.fill(HIST("hOrbitFDD"), orbit - minOrbit); + histos.fill(HIST("hGlobalBcFDD"), globalBC - bcSOR); + // histos.fill(HIST("hOrbitFDD"), orbit - orbitSOR); histos.fill(HIST("hBcFDD"), localBC); } @@ -550,13 +544,13 @@ struct EventSelectionQaTask { if (run >= 500000) { auto runInfo = o2::parameters::AggregatedRunInfo::buildAggregatedRunInfo(o2::ccdb::BasicCCDBManager::instance(), run); // first bc of the first orbit - bcSOR = runInfo.orbitSOR * o2::constants::lhc::LHCMaxBunches; + bcSOR = runInfo.orbitSOR * nBCsPerOrbit; // duration of TF in bcs - nBCsPerTF = runInfo.orbitsPerTF * o2::constants::lhc::LHCMaxBunches; + nBCsPerTF = runInfo.orbitsPerTF * nBCsPerOrbit; // number of orbits per TF nOrbitsPerTF = runInfo.orbitsPerTF; // first orbit - minOrbit = runInfo.orbitSOR; + orbitSOR = runInfo.orbitSOR; // total number of orbits nOrbits = runInfo.orbitEOR - runInfo.orbitSOR; // start-of-run timestamp @@ -594,17 +588,25 @@ struct EventSelectionQaTask { // int nStaves = o2::itsmft::ChipMappingITS::getNStavesOnLr(l); // double idFirstStave = o2::itsmft::ChipMappingITS::getFirstStavesOnLr(l); histos.add(Form("hDeadChipsVsOrbitL%d", l), Form(";orbit; chip; Layer %d", l), kTH2C, {axisItsDeadMapOrbits, {nChips, idFirstChip, idFirstChip + nChips}}); + histos.add(Form("hNumberOfInactiveChipsVsOrbitL%d", l), Form(";orbit; Layer %d", l), kTH1I, {axisItsDeadMapOrbits}); } - std::vector closestVec; + std::vector vClosest; + std::bitset alwaysDeadChips; + std::bitset deadChips; + alwaysDeadChips.set(); for (const auto& orbit : itsDeadMapOrbits) { - itsDeadMap->getMapAtOrbit(orbit, closestVec); - for (size_t iel = 0; iel < closestVec.size(); iel++) { - uint16_t w1 = closestVec.at(iel); + itsDeadMap->getMapAtOrbit(orbit, vClosest); + deadChips.reset(); + for (size_t iel = 0; iel < vClosest.size(); iel++) { + uint16_t w1 = vClosest[iel]; bool isLastInSequence = (w1 & 0x8000) == 0; - uint16_t w2 = isLastInSequence ? w1 + 1 : closestVec.at(iel + 1); - int chipId1 = w1 & 0x7FFF; - int chipId2 = w2 & 0x7FFF; + uint16_t w2 = isLastInSequence ? w1 + 1 : vClosest[iel + 1]; + uint16_t chipId1 = w1 & 0x7FFF; + uint16_t chipId2 = w2 & 0x7FFF; + // dead chips are stored as ranges + // vClosest contains first and last chip ids in the range + // last chip id in the range is marked with 0x8000 bit set to 1 for (int chipId = chipId1; chipId < chipId2; chipId++) { histos.fill(HIST("hDeadChipsVsOrbitL0"), orbit, chipId, 1); histos.fill(HIST("hDeadChipsVsOrbitL1"), orbit, chipId, 1); @@ -613,13 +615,43 @@ struct EventSelectionQaTask { histos.fill(HIST("hDeadChipsVsOrbitL4"), orbit, chipId, 1); histos.fill(HIST("hDeadChipsVsOrbitL5"), orbit, chipId, 1); histos.fill(HIST("hDeadChipsVsOrbitL6"), orbit, chipId, 1); + deadChips.set(chipId); } } + alwaysDeadChips &= deadChips; // chips active in the current orbit are set to 0 } - } + // std::cout << alwaysDeadChips << std::endl; + + // filling histograms with number of inactive chips per layer vs orbit (ignoring always inactive) + for (const auto& orbit : itsDeadMapOrbits) { + itsDeadMap->getMapAtOrbit(orbit, vClosest); + std::vector nInactiveChips(o2::itsmft::ChipMappingITS::NLayers, 0); + for (size_t iel = 0; iel < vClosest.size(); iel++) { + uint16_t w1 = vClosest[iel]; + bool isLastInSequence = (w1 & 0x8000) == 0; + uint16_t w2 = isLastInSequence ? w1 + 1 : vClosest[iel + 1]; + uint16_t chipId1 = w1 & 0x7FFF; + uint16_t chipId2 = w2 & 0x7FFF; + for (int chipId = chipId1; chipId < chipId2; chipId++) { + if (alwaysDeadChips[chipId]) // skip always inactive chips + continue; + int32_t layer = o2::itsmft::ChipMappingITS::getLayer(chipId); + nInactiveChips[layer]++; + } + } + histos.fill(HIST("hNumberOfInactiveChipsVsOrbitL0"), orbit, nInactiveChips[0]); + histos.fill(HIST("hNumberOfInactiveChipsVsOrbitL1"), orbit, nInactiveChips[1]); + histos.fill(HIST("hNumberOfInactiveChipsVsOrbitL2"), orbit, nInactiveChips[2]); + histos.fill(HIST("hNumberOfInactiveChipsVsOrbitL3"), orbit, nInactiveChips[3]); + histos.fill(HIST("hNumberOfInactiveChipsVsOrbitL4"), orbit, nInactiveChips[4]); + histos.fill(HIST("hNumberOfInactiveChipsVsOrbitL5"), orbit, nInactiveChips[5]); + histos.fill(HIST("hNumberOfInactiveChipsVsOrbitL6"), orbit, nInactiveChips[6]); + } + + } // run >= 500000 // create orbit-axis histograms on the fly with binning based on info from GRP if GRP is available - // otherwise default minOrbit and nOrbits will be used + // otherwise default orbitSOR and nOrbits will be used const AxisSpec axisOrbits{static_cast(nOrbits / nOrbitsPerTF), 0., static_cast(nOrbits), ""}; histos.add("hOrbitAll", "", kTH1F, {axisOrbits}); histos.add("hOrbitCol", "", kTH1F, {axisOrbits}); @@ -753,19 +785,19 @@ struct EventSelectionQaTask { histos.fill(HIST("hTimeFDCref"), timeFDC); } - histos.fill(HIST("hGlobalBcAll"), globalBC - minGlobalBC); - histos.fill(HIST("hOrbitAll"), orbit - minOrbit); + histos.fill(HIST("hGlobalBcAll"), globalBC - bcSOR); + histos.fill(HIST("hOrbitAll"), orbit - orbitSOR); histos.fill(HIST("hBcAll"), localBC); if (bc.selection_bit(kIsTriggerTVX)) { - histos.fill(HIST("hOrbitTVX"), orbit - minOrbit); + histos.fill(HIST("hOrbitTVX"), orbit - orbitSOR); histos.fill(HIST("hBcTVX"), localBC); } // FV0 if (bc.has_fv0a()) { - histos.fill(HIST("hGlobalBcFV0"), globalBC - minGlobalBC); - histos.fill(HIST("hOrbitFV0"), orbit - minOrbit); + histos.fill(HIST("hGlobalBcFV0"), globalBC - bcSOR); + histos.fill(HIST("hOrbitFV0"), orbit - orbitSOR); histos.fill(HIST("hBcFV0"), localBC); float multV0A = 0; for (const auto& amplitude : bc.fv0a().amplitude()) { @@ -779,8 +811,8 @@ struct EventSelectionQaTask { // FT0 if (bc.has_ft0()) { - histos.fill(HIST("hGlobalBcFT0"), globalBC - minGlobalBC); - histos.fill(HIST("hOrbitFT0"), orbit - minOrbit); + histos.fill(HIST("hGlobalBcFT0"), globalBC - bcSOR); + histos.fill(HIST("hOrbitFT0"), orbit - orbitSOR); histos.fill(HIST("hBcFT0"), localBC); float multT0A = bc.ft0().sumAmpA(); float multT0C = bc.ft0().sumAmpC(); @@ -806,8 +838,8 @@ struct EventSelectionQaTask { // FDD if (bc.has_fdd()) { - histos.fill(HIST("hGlobalBcFDD"), globalBC - minGlobalBC); - histos.fill(HIST("hOrbitFDD"), orbit - minOrbit); + histos.fill(HIST("hGlobalBcFDD"), globalBC - bcSOR); + histos.fill(HIST("hOrbitFDD"), orbit - orbitSOR); histos.fill(HIST("hBcFDD"), localBC); auto fdd = bc.fdd(); @@ -829,8 +861,8 @@ struct EventSelectionQaTask { // ZDC if (bc.has_zdc()) { - histos.fill(HIST("hGlobalBcZDC"), globalBC - minGlobalBC); - histos.fill(HIST("hOrbitZDC"), orbit - minOrbit); + histos.fill(HIST("hGlobalBcZDC"), globalBC - bcSOR); + histos.fill(HIST("hOrbitZDC"), orbit - orbitSOR); histos.fill(HIST("hBcZDC"), localBC); float multZNA = bc.zdc().energyCommonZNA(); float multZNC = bc.zdc().energyCommonZNC(); @@ -869,7 +901,7 @@ struct EventSelectionQaTask { for (const auto& bc : bcs) { int64_t globalBC = bc.globalBC(); // skip non-colliding bcs for data and anchored runs - if (run >= 500000 && bcPatternB[globalBC % o2::constants::lhc::LHCMaxBunches] == 0) { + if (run >= 500000 && bcPatternB[globalBC % nBCsPerOrbit] == 0) { continue; } if (bc.selection_bit(kIsBBT0A) || bc.selection_bit(kIsBBT0C)) { @@ -919,11 +951,11 @@ struct EventSelectionQaTask { uint64_t globalBC = bc.globalBC(); uint64_t orbit = globalBC / nBCsPerOrbit; int localBC = globalBC % nBCsPerOrbit; - histos.fill(HIST("hGlobalBcCol"), globalBC - minGlobalBC); - histos.fill(HIST("hOrbitCol"), orbit - minOrbit); + histos.fill(HIST("hGlobalBcCol"), globalBC - bcSOR); + histos.fill(HIST("hOrbitCol"), orbit - orbitSOR); histos.fill(HIST("hBcCol"), localBC); if (col.sel8()) { - histos.fill(HIST("hOrbitAcc"), orbit - minOrbit); + histos.fill(HIST("hOrbitAcc"), orbit - orbitSOR); } // search for nearest ft0a&ft0c entry @@ -1139,8 +1171,8 @@ struct EventSelectionQaTask { uint64_t orbit = globalBC / nBCsPerOrbit; int localBC = globalBC % nBCsPerOrbit; int64_t bcInTF = (globalBC - bcSOR) % nBCsPerTF; - histos.fill(HIST("hGlobalBcColMC"), globalBC - minGlobalBC); - histos.fill(HIST("hOrbitColMC"), orbit - minOrbit); + histos.fill(HIST("hGlobalBcColMC"), globalBC - bcSOR); + histos.fill(HIST("hOrbitColMC"), orbit - orbitSOR); histos.fill(HIST("hBcColMC"), localBC); histos.fill(HIST("hVertexXMC"), mcCol.posX()); histos.fill(HIST("hVertexYMC"), mcCol.posY()); From be262d4677be7652de6db32ac70c72d8b8086088 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 1 Dec 2024 20:08:00 +0100 Subject: [PATCH 196/459] [Common] latest centrality study additions (#8756) Co-authored-by: ALICE Builder --- Common/Tasks/centralityStudy.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index 1ffa639f474..1ce0eb39680 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -86,12 +86,14 @@ struct centralityStudy { ConfigurableAxis axisMultFDDA{"axisMultFDDA", {1000, 0, 100000}, "FDDA amplitude"}; ConfigurableAxis axisMultFDDC{"axisMultFDDC", {1000, 0, 100000}, "FDDC amplitude"}; ConfigurableAxis axisMultPVContributors{"axisMultPVContributors", {200, 0, 6000}, "Number of PV Contributors"}; + ConfigurableAxis axisMultGlobalTracks{"axisMultGlobalTracks", {500, 0, 5000}, "Number of global tracks"}; // For one-dimensional plots, where binning is no issue ConfigurableAxis axisMultUltraFineFV0A{"axisMultUltraFineFV0A", {60000, 0, 60000}, "FV0A amplitude"}; ConfigurableAxis axisMultUltraFineFT0M{"axisMultUltraFineFT0M", {50000, 0, 200000}, "FT0M amplitude"}; ConfigurableAxis axisMultUltraFineFT0C{"axisMultUltraFineFT0C", {60000, 0, 60000}, "FT0C amplitude"}; ConfigurableAxis axisMultUltraFinePVContributors{"axisMultUltraFinePVContributors", {10000, 0, 10000}, "Number of PV Contributors"}; + ConfigurableAxis axisMultUltraFineGlobalTracks{"axisMultUltraFineGlobalTracks", {5000, 0, 5000}, "Number of global tracks"}; ConfigurableAxis axisMultITSOnly{"axisMultITSOnly", {200, 0, 6000}, "Number of ITS only tracks"}; ConfigurableAxis axisMultITSTPC{"axisMultITSTPC", {200, 0, 6000}, "Number of ITSTPC matched tracks"}; @@ -128,10 +130,13 @@ struct centralityStudy { histos.add("hFT0C_Collisions", "hFT0C_Collisions", kTH1D, {axisMultUltraFineFT0C}); histos.add("hFT0M_Collisions", "hFT0M_Collisions", kTH1D, {axisMultUltraFineFT0M}); histos.add("hFV0A_Collisions", "hFV0A_Collisions", kTH1D, {axisMultUltraFineFV0A}); + histos.add("hNGlobalTracks", "hNGlobalTracks", kTH1D, {axisMultUltraFineGlobalTracks}); histos.add("hNPVContributors", "hNPVContributors", kTH1D, {axisMultUltraFinePVContributors}); histos.add("hFT0CvsPVz_Collisions_All", "hFT0CvsPVz_Collisions_All", kTProfile, {axisPVz}); histos.add("hFT0CvsPVz_Collisions", "hFT0CvsPVz_Collisions", kTProfile, {axisPVz}); + histos.add("hFV0AvsPVz_Collisions", "hFV0AvsPVz_Collisions", kTProfile, {axisPVz}); + histos.add("hNGlobalTracksvsPVz_Collisions", "hNGlobalTracksvsPVz_Collisions", kTProfile, {axisPVz}); } if (doprocessBCs) { @@ -151,6 +156,9 @@ struct centralityStudy { if (do2DPlots) { histos.add("hNContribsVsFT0C", "hNContribsVsFT0C", kTH2F, {axisMultFT0C, axisMultPVContributors}); + histos.add("hNGlobalTracksVsFT0C", "hNGlobalTracksVsFT0C", kTH2F, {axisMultFT0C, axisMultGlobalTracks}); + histos.add("hNContribsVsFV0A", "hNContribsVsFV0A", kTH2F, {axisMultFV0A, axisMultPVContributors}); + histos.add("hNGlobalTracksVsFV0A", "hNGlobalTracksVsFV0A", kTH2F, {axisMultFV0A, axisMultGlobalTracks}); histos.add("hMatchedVsITSOnly", "hMatchedVsITSOnly", kTH2F, {axisMultITSOnly, axisMultITSTPC}); // 2d correlation of fit signals @@ -274,12 +282,18 @@ struct centralityStudy { histos.fill(HIST("hFT0C_Collisions"), collision.multFT0C() * scaleSignalFT0C); histos.fill(HIST("hFT0M_Collisions"), (collision.multFT0A() + collision.multFT0C()) * scaleSignalFT0M); histos.fill(HIST("hFV0A_Collisions"), collision.multFV0A() * scaleSignalFV0A); + histos.fill(HIST("hNGlobalTracks"), collision.multNTracksGlobal()); histos.fill(HIST("hFT0CvsPVz_Collisions_All"), collision.multPVz(), collision.multFT0C() * scaleSignalFT0C); + histos.fill(HIST("hFV0AvsPVz_Collisions"), collision.multPVz(), collision.multFV0A() * scaleSignalFV0A); + histos.fill(HIST("hNGlobalTracksvsPVz_Collisions"), collision.multPVz(), collision.multNTracksGlobal()); if (collision.multFT0C() > minFT0CforVertexZ) { histos.fill(HIST("hFT0CvsPVz_Collisions"), collision.multPVz(), collision.multFT0C() * scaleSignalFT0C); } if (do2DPlots) { histos.fill(HIST("hNContribsVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multPVTotalContributors()); + histos.fill(HIST("hNGlobalTracksVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multNTracksGlobal()); + histos.fill(HIST("hNContribsVsFV0A"), collision.multFV0A() * scaleSignalFV0A, collision.multPVTotalContributors()); + histos.fill(HIST("hNGlobalTracksVsFV0A"), collision.multFV0A() * scaleSignalFV0A, collision.multNTracksGlobal()); histos.fill(HIST("hMatchedVsITSOnly"), collision.multNTracksITSOnly(), collision.multNTracksITSTPC()); // correlate also FIT detector signals @@ -301,7 +315,7 @@ struct centralityStudy { } } - void processCollisions(soa::Join::iterator const& collision) + void processCollisions(soa::Join::iterator const& collision) { genericProcessCollision(collision); } From 9ad8d26c2f5960b0de0e1891e6478b66e8d46c4f Mon Sep 17 00:00:00 2001 From: abilandz Date: Sun, 1 Dec 2024 21:10:11 +0100 Subject: [PATCH 197/459] [PWGCF] minor additions and fixes (#8746) --- .../Core/MuPa-Configurables.h | 31 +-- .../Core/MuPa-DataMembers.h | 4 +- .../Core/MuPa-Enums.h | 7 + .../Core/MuPa-MemberFunctions.h | 232 ++++++++++++------ .../Tasks/multiparticle-correlations-ab.cxx | 1 - 5 files changed, 182 insertions(+), 93 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h index 5a1a2e309de..578738396c9 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h @@ -32,7 +32,7 @@ struct : ConfigurableGroup { Configurable cfRandomSeed{"cfRandomSeed", 0, "0 = random seed is guaranteed to be unique in space and time"}; Configurable cfUseFisherYates{"cfUseFisherYates", false, "use or not Fisher-Yates algorithm to randomize particle indices"}; Configurable cfFixedNumberOfRandomlySelectedTracks{"cfFixedNumberOfRandomlySelectedTracks", -1, "set to some integer > 0, to apply and use. Set to <=0, to ignore."}; - Configurable cfUseStopwatch{"cfUseStopwatch", true, "if true, some basic info on time execution is printed, here and there. Very loosely, this can be used for execution time profiling."}; + Configurable cfUseStopwatch{"cfUseStopwatch", false, "if true, some basic info on time execution is printed, here and there. Very loosely, this can be used for execution time profiling."}; Configurable cfFloatingPointPrecision{"cfFloatingPointPrecision", 0.000001, "two floats are the same if TMath::Abs(f1 - f2) < fFloatingPointPrecision"}; Configurable cfSequentialBailout{"cfSequentialBailout", 0, "if fSequentialBailout > 0, then each fSequentialBailout events the function BailOut() is called. Can be used for real analysis and for IV"}; Configurable cfUseSpecificCuts{"cfUseSpecificCuts", false, "if true, analysis-specific cuts set via configurable cfWhichSpecificCuts are applied after DefaultCuts(). "}; @@ -45,20 +45,20 @@ struct : ConfigurableGroup { Configurable cfCheckUnderflowAndOverflow{"cfCheckUnderflowAndOverflow", false, "check and bail out if in event and particle histograms there are entries which went to underflow or overflow bins (use only locally)"}; Configurable cfRebin{"cfRebin", 1, "number of bins of selected heavy 2D histograms are devided with this number"}; Configurable cfFillQAEventHistograms2D{"cfFillQAEventHistograms2D", false, "if false, all QA 2D event histograms are not filled. if true, only the ones for which fBookQAEventHistograms2D[...] is true, are filled"}; - Configurable> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"Multiplicity_vs_ReferenceMultiplicity-1", "Multiplicity_vs_NContributors-1", "Multiplicity_vs_Centrality-1", "Multiplicity_vs_Vertex_z-1", "Multiplicity_vs_Occupancy-1", "ReferenceMultiplicity_vs_NContributors-1", "ReferenceMultiplicity_vs_Centrality-1", "ReferenceMultiplicity_vs_Vertex_z-1", "ReferenceMultiplicity_vs_Occupancy-1", "NContributors_vs_Centrality-1", "NContributors_vs_Vertex_z-1", "NContributors_vs_Occupancy-1", "Centrality_vs_Vertex_z-1", "Centrality_vs_Occupancy-1", "Vertex_z_vs_Occupancy-1", "CentFT0C_vs_CentNTPV-0", "CentFT0M_vs_CentNTPV-0", "CentRun2V0M_vs_CentRun2SPDTracklets-0", "TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange-1", "CurrentRunDuration_vs_InteractionRate-1"}, "book (1) or do not book (0) this QA 2D event histogram"}; + Configurable> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"1-Multiplicity_vs_ReferenceMultiplicity", "1-Multiplicity_vs_NContributors", "1-Multiplicity_vs_Centrality", "1-Multiplicity_vs_Vertex_z", "1-Multiplicity_vs_Occupancy", "1-ReferenceMultiplicity_vs_NContributors", "1-ReferenceMultiplicity_vs_Centrality", "1-ReferenceMultiplicity_vs_Vertex_z", "1-ReferenceMultiplicity_vs_Occupancy", "1-NContributors_vs_Centrality", "1-NContributors_vs_Vertex_z", "1-NContributors_vs_Occupancy", "1-Centrality_vs_Vertex_z", "1-Centrality_vs_Occupancy", "1-Vertex_z_vs_Occupancy", "0-CentFT0C_vs_CentNTPV", "0-CentFT0M_vs_CentNTPV", "0-CentRun2V0M_vs_CentRun2SPDTracklets", "1-TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange", "1-CurrentRunDuration_vs_InteractionRate"}, "book (1) or do not book (0) this QA 2D event histogram"}; Configurable cfFillQAParticleHistograms2D{"cfFillQAParticleHistograms2D", false, "if false, all QA 2D particle histograms are not filled. if true, only the ones for which fBookQAParticleHistograms2D[...] is true, are filled"}; - Configurable> cfBookQAParticleHistograms2D{"cfBookQAParticleHistograms2D", {"Pt_vs_dcaXY-1"}, "book (1) or do not book (0) this QA 2D particle histogram"}; + Configurable> cfBookQAParticleHistograms2D{"cfBookQAParticleHistograms2D", {"1-Pt_vs_dcaXY"}, "book (1) or do not book (0) this QA 2D particle histogram"}; } cf_qa; // *) Event histograms: struct : ConfigurableGroup { Configurable cfFillEventHistograms{"cfFillEventHistograms", true, "if false, all event histograms are not filled. if true, only the ones for which fBookEventHistograms[...] is true, are filled"}; - Configurable> cfBookEventHistograms{"cfBookEventHistograms", {"NumberOfEvents-1", "TotalMultiplicity-1", "Multiplicity-1", "ReferenceMultiplicity-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Occupancy-1", "InteractionRate-1", "CurrentRunDuration-1", "MultMCNParticlesEta08-0"}, "Book (1) or do not book (0) event histogram"}; + Configurable> cfBookEventHistograms{"cfBookEventHistograms", {"1-NumberOfEvents", "1-TotalMultiplicity", "1-Multiplicity", "1-ReferenceMultiplicity", "1-Centrality", "1-Vertex_x", "1-Vertex_y", "1-Vertex_z", "1-NContributors", "0-ImpactParameter", "1-Occupancy", "1-InteractionRate", "1-CurrentRunDuration", "0-MultMCNParticlesEta08"}, "Book (1) or do not book (0) event histogram"}; } cf_eh; // *) Event cuts: struct : ConfigurableGroup { - Configurable> cfUseEventCuts{"cfUseEventCuts", {"NumberOfEvents-1", "TotalMultiplicity-1", "Multiplicity-1", "ReferenceMultiplicity-1", "Centrality-1", "Vertex_x-1", "Vertex_y-1", "Vertex_z-1", "NContributors-1", "ImpactParameter-1", "Occupancy-1", "InteractionRate-1", "CurrentRunDuration-1", "MultMCNParticlesEta08-0", "Trigger-0", "Sel7-0", "Sel8-1", "MultiplicityEstimator-1", "ReferenceMultiplicityEstimator-1", "CentralityEstimator-1", "SelectedEvents-1", "NoSameBunchPileup-1", "IsGoodZvtxFT0vsPV-1", "IsVertexITSTPC-1", "IsVertexTOFmatched-1", "IsVertexTRDmatched-1", "OccupancyEstimator-1"}, "use (1) or do not use (0) event cuts"}; + Configurable> cfUseEventCuts{"cfUseEventCuts", {"1-NumberOfEvents", "1-TotalMultiplicity", "1-Multiplicity", "1-ReferenceMultiplicity", "1-Centrality", "1-Vertex_x", "1-Vertex_y", "1-Vertex_z", "1-NContributors", "1-ImpactParameter", "1-Occupancy", "1-InteractionRate", "1-CurrentRunDuration", "0-MultMCNParticlesEta08", "0-Trigger", "0-Sel7", "1-Sel8", "1-MultiplicityEstimator", "1-ReferenceMultiplicityEstimator", "1-CentralityEstimator", "1-SelectedEvents", "1-NoSameBunchPileup", "1-IsGoodZvtxFT0vsPV", "1-IsVertexITSTPC", "1-IsVertexTOFmatched", "1-IsVertexTRDmatched", "1-OccupancyEstimator"}, "use (1) or do not use (0) event cuts"}; Configurable cfUseEventCutCounterAbsolute{"cfUseEventCutCounterAbsolute", false, "profile and save how many times each event cut counter triggered (absolute). Use with care, as this is computationally heavy"}; Configurable cfUseEventCutCounterSequential{"cfUseEventCutCounterSequential", false, "profile and save how many times each event cut counter triggered (sequential). Use with care, as this is computationally heavy"}; Configurable cfPrintCutCounterContent{"cfPrintCutCounterContent", false, "if true, prints on the screen after each event the content of fEventCutCounterHist[*][*] (all which were booked)"}; @@ -97,15 +97,15 @@ struct : ConfigurableGroup { // *) Particle histograms: struct : ConfigurableGroup { - Configurable cfFillParticleHistograms{"cfFillParticleHistograms", false, "if false, all 1D particle histograms are not filled. if kTRUE, the ones for which fBookParticleHistograms[...] is kTRUE, are filled"}; - Configurable> cfBookParticleHistograms{"cfBookParticleHistograms", {"Phi-1", "Pt-1", "Eta-1", "Charge-1", "tpcNClsFindable-1", "tpcNClsShared-1", "tpcNClsFound-1", "tpcNClsCrossedRows-1", "itsNCls-1", "itsNClsInnerBarrel-1", "tpcCrossedRowsOverFindableCls-1", "tpcFoundOverFindableCls-1", "tpcFractionSharedCls-1", "dcaXY-1", "dcaZ-1", "PDG-0"}, "Book (1) or do not book (0) particle histogram"}; + Configurable cfFillParticleHistograms{"cfFillParticleHistograms", true, "if false, all 1D particle histograms are not filled. if kTRUE, the ones for which fBookParticleHistograms[...] is kTRUE, are filled"}; + Configurable> cfBookParticleHistograms{"cfBookParticleHistograms", {"1-Phi", "1-Pt", "1-Eta", "1-Charge", "1-tpcNClsFindable", "1-tpcNClsShared", "1-tpcNClsFound", "1-tpcNClsCrossedRows", "1-itsNCls", "1-itsNClsInnerBarrel", "1-tpcCrossedRowsOverFindableCls", "1-tpcFoundOverFindableCls", "1-tpcFractionSharedCls", "1-dcaXY", "1-dcaZ", "0-PDG"}, "Book (1) or do not book (0) particle histogram"}; Configurable cfFillParticleHistograms2D{"cfFillParticleHistograms2D", false, "if false, all 2D particle histograms are not filled. if kTRUE, the ones for which fBookParticleHistograms2D[...] is kTRUE, are filled"}; - Configurable> cfBookParticleHistograms2D{"cfBookParticleHistograms2D", {"Phi_vs_Pt-1", "Phi_vs_Eta-1"}, "Book (1) or do not book (0) 2D particle histograms"}; + Configurable> cfBookParticleHistograms2D{"cfBookParticleHistograms2D", {"1-Phi_vs_Pt", "1-Phi_vs_Eta"}, "Book (1) or do not book (0) 2D particle histograms"}; } cf_ph; // *) Particle cuts: struct : ConfigurableGroup { - Configurable> cfUseParticleCuts{"cfUseParticleCuts", {"Phi-1", "Pt-1", "Eta-1", "Charge-1", "tpcNClsFindable-1", "tpcNClsShared-1", "tpcNClsFound-1", "tpcNClsCrossedRows-1", "itsNCls-1", "itsNClsInnerBarrel-1", "tpcCrossedRowsOverFindableCls-1", "tpcFoundOverFindableCls-1", "tpcFractionSharedCls-1", "dcaXY-1", "dcaZ-1", "PDG-1", "trackCutFlagFb1-0", "trackCutFlagFb2-0", "isQualityTrack-0", "isPrimaryTrack-0", "isInAcceptanceTrack-0", "isGlobalTrack-0", "PtDependentDCAxyParameterization-0"}, "Use (1) or do not use (0) particle cuts"}; + Configurable> cfUseParticleCuts{"cfUseParticleCuts", {"1-Phi", "1-Pt", "1-Eta", "1-Charge", "1-tpcNClsFindable", "1-tpcNClsShared", "1-tpcNClsFound", "1-tpcNClsCrossedRows", "1-itsNCls", "1-itsNClsInnerBarrel", "1-tpcCrossedRowsOverFindableCls", "1-tpcFoundOverFindableCls", "1-tpcFractionSharedCls", "1-dcaXY", "1-dcaZ", "1-PDG", "0-trackCutFlagFb1", "0-trackCutFlagFb2", "0-isQualityTrack", "0-isPrimaryTrack", "0-isInAcceptanceTrack", "0-isGlobalTrack", "0-PtDependentDCAxyParameterization"}, "Use (1) or do not use (0) particle cuts"}; Configurable cfUseParticleCutCounterAbsolute{"cfUseParticleCutCounterAbsolute", false, "profile and save how many times each particle cut counter triggered (absolute). Use with care, as this is computationally heavy"}; Configurable cfUseParticleCutCounterSequential{"cfUseParticleCutCounterSequential", false, "profile and save how many times each particle cut counter triggered (sequential). Use with care, as this is computationally heavy"}; Configurable> cfPhi{"cfPhi", {0.0, TMath::TwoPi()}, "phi range: {min, max}[rad], with convention: min <= phi < max"}; @@ -136,7 +136,7 @@ struct : ConfigurableGroup { // *) Q-vector: struct : ConfigurableGroup { - Configurable cfCalculateQvectors{"cfCalculateQvectors", false, "calculate or not Q-vectors (all, also diff. ones). If I want only to fill control histograms, then set here false"}; + Configurable cfCalculateQvectors{"cfCalculateQvectors", true, "calculate or not Q-vectors (all, also diff. ones). If I want only to fill control histograms, then set here false"}; } cf_qv; // *) Multiparticle correlations: @@ -165,6 +165,7 @@ struct : ConfigurableGroup { Configurable cfCalculateTest0AsFunctionOfCurrentRunDuration{"cfCalculateTest0AsFunctionOfCurrentRunDuration", false, "calculate or not Test0 as a function of current run duration (i.e. vs. seconds since start of run)"}; Configurable cfFileWithLabels{"cfFileWithLabels", "/home/abilandz/DatasetsO2/labels.root", "path to external ROOT file which specifies all labels"}; // for AliEn file prepend "/alice/cern.ch/", for CCDB prepend "/alice-ccdb.cern.ch" Configurable cfUseDefaultLabels{"cfUseDefaultLabels", false, "use default internally hardwired labels, only for testing purposes"}; + Configurable cfWhichDefaultLabels{"cfWhichDefaultLabels", "standard", "only for testing purposes, select one set of default labels, see GetDefaultObjArrayWithLabels for supported options"}; } cf_t0; // *) Particle weights: @@ -218,11 +219,11 @@ struct : ConfigurableGroup { // Fixed-length binning (default): Configurable> cfFixedLength_mult_bins{"cfFixedLength_mult_bins", {2000, 0., 20000.}, "nMultBins, multMin, multMax (only for results histograms)"}; Configurable> cfFixedLength_cent_bins{"cfFixedLength_cent_bins", {110, 0., 110.}, "nCentBins, centMin, centMax (only for results histograms)"}; - Configurable> cfFixedLength_pt_bins{"cfFixedLength_pt_bins", {1000, 0., 100.}, "nPtBins, ptMin, ptMax (only for results histograms)"}; - Configurable> cfFixedLength_eta_bins{"cfFixedLength_eta_bins", {100, -2., 2.}, "nEtaBins, etaMin, etaMax (only for results histograms)"}; - Configurable> cfFixedLength_occu_bins{"cfFixedLength_occu_bins", {601, -100., 60000.}, "nOccuBins, occuMin, occuMax (only for results histograms)"}; - Configurable> cfFixedLength_ir_bins{"cfFixedLength_ir_bins", {210000, -10., 200.}, "nirBins, irMin, irMax (only for results histograms)"}; - Configurable> cfFixedLength_crd_bins{"cfFixedLength_crd_bins", {86401, -1., 86400.}, "nrdBins, rdMin, rdMax (only for results histograms)"}; + Configurable> cfFixedLength_pt_bins{"cfFixedLength_pt_bins", {1000, 0., 10.}, "nPtBins, ptMin, ptMax (only for results histograms)"}; + Configurable> cfFixedLength_eta_bins{"cfFixedLength_eta_bins", {80, -2., 2.}, "nEtaBins, etaMin, etaMax (only for results histograms)"}; + Configurable> cfFixedLength_occu_bins{"cfFixedLength_occu_bins", {600, 0., 60000.}, "nOccuBins, occuMin, occuMax (only for results histograms)"}; + Configurable> cfFixedLength_ir_bins{"cfFixedLength_ir_bins", {1000, 0., 100.}, "nirBins, irMin, irMax (only for results histograms)"}; + Configurable> cfFixedLength_crd_bins{"cfFixedLength_crd_bins", {1000, 0., 10000.}, "nrdBins, rdMin, rdMax (only for results histograms)"}; // Variable-length binning (per request): Configurable cfUseVariableLength_mult_bins{"cfUseVariableLength_mult_bins", false, "use or not variable-length multiplicity bins"}; diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h index a0081a68b89..ab4f7a28135 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h @@ -41,6 +41,7 @@ struct TaskConfiguration { TString fTaskName = ""; // task name - this one is used to get the right weights programatically for this analysis TString fRunNumber = ""; // over which run number this task is executed Bool_t fRunNumberIsDetermined = kFALSE; // ensures that run number is determined in process() and propagated to already booked objects only once + int64_t fRunTime[eRunTime_N] = {0}; // stores permanently start of run, end of run, and run duration Bool_t fDryRun = kFALSE; // book all histos and run without storing and calculating anything Bool_t fVerbose = kFALSE; // print additional info during debugging, but not for simply utility function or function calls per particle (see next) Bool_t fVerboseUtility = kFALSE; // print additional info during debugging also for simply utility function, but not for function calls per particle (see next) @@ -275,7 +276,8 @@ struct Test0 { TString* fTest0Labels[gMaxCorrelator][gMaxIndex] = {{NULL}}; // all labels: k-p'th order is stored in k-1'th index. So yes, I also store 1-p Bool_t fCalculateTest0AsFunctionOf[eAsFunctionOf_N] = {false}; //! [0=integrated,1=vs. multiplicity,2=vs. centrality,3=pT,4=eta,5=vs. occupancy, ...] TString fFileWithLabels = ""; // path to external ROOT file which specifies all labels of interest - Bool_t fUseDefaultLabels = kFALSE; // use default labels hardwired in GetDefaultObjArrayWithLabels() + Bool_t fUseDefaultLabels = kFALSE; // use default labels hardwired in GetDefaultObjArrayWithLabels(), the choice is made with cfWhichDefaultLabels + TString fWhichDefaultLabels = ""; // only for testing purposes, select one set of default labels, see GetDefaultObjArrayWithLabels for supported options TH1I* fTest0LabelsPlaceholder = NULL; // store all Test0 labels in this histogram } t0; // "t0" labels an instance of this group of histograms diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h index 90d87749281..410d339be1c 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h @@ -306,4 +306,11 @@ enum eSpecificCuts { eSpecificCuts_N }; +enum eRunTime { + eStartOfRun = 0, // in abs. seconds since Unix epoch + eEndOfRun, // in abs. seconds since Unix epoch + eDurationInSec, // in seconds + eRunTime_N +}; + #endif // PWGCF_MULTIPARTICLECORRELATIONS_CORE_MUPA_ENUMS_H_ diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h index ffb963a6c08..a4a699dfe90 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h @@ -370,10 +370,12 @@ void DefaultConfiguration() t0.fCalculateTest0AsFunctionOf[AFO_CENTRALITY] = cf_t0.cfCalculateTest0AsFunctionOfCentrality; t0.fCalculateTest0AsFunctionOf[AFO_PT] = cf_t0.cfCalculateTest0AsFunctionOfPt; t0.fCalculateTest0AsFunctionOf[AFO_ETA] = cf_t0.cfCalculateTest0AsFunctionOfEta; + t0.fCalculateTest0AsFunctionOf[AFO_OCCUPANCY] = cf_t0.cfCalculateTest0AsFunctionOfOccupancy; t0.fCalculateTest0AsFunctionOf[AFO_INTERACTIONRATE] = cf_t0.cfCalculateTest0AsFunctionOfInteractionRate; t0.fCalculateTest0AsFunctionOf[AFO_CURRENTRUNDURATION] = cf_t0.cfCalculateTest0AsFunctionOfCurrentRunDuration; t0.fFileWithLabels = TString(cf_t0.cfFileWithLabels); t0.fUseDefaultLabels = cf_t0.cfUseDefaultLabels; + t0.fWhichDefaultLabels = TString(cf_t0.cfWhichDefaultLabels); // *) Particle weights: pw.fUseWeights[wPHI] = cf_pw.cfUsePhiWeights; @@ -526,26 +528,21 @@ void DefaultConfiguration() qa.fEventHistogramsName2D[eMultiplicity_vs_Centrality] = Form("%s_vs_%s", eh.fEventHistogramsName[eMultiplicity].Data(), eh.fEventHistogramsName[eCentrality].Data()); qa.fEventHistogramsName2D[eMultiplicity_vs_Vertex_z] = Form("%s_vs_%s", eh.fEventHistogramsName[eMultiplicity].Data(), eh.fEventHistogramsName[eVertex_z].Data()); qa.fEventHistogramsName2D[eMultiplicity_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eMultiplicity].Data(), eh.fEventHistogramsName[eOccupancy].Data()); - qa.fEventHistogramsName2D[eReferenceMultiplicity_vs_NContributors] = Form("%s_vs_%s", eh.fEventHistogramsName[eReferenceMultiplicity].Data(), eh.fEventHistogramsName[eNContributors].Data()); qa.fEventHistogramsName2D[eReferenceMultiplicity_vs_Centrality] = Form("%s_vs_%s", eh.fEventHistogramsName[eReferenceMultiplicity].Data(), eh.fEventHistogramsName[eCentrality].Data()); qa.fEventHistogramsName2D[eReferenceMultiplicity_vs_Vertex_z] = Form("%s_vs_%s", eh.fEventHistogramsName[eReferenceMultiplicity].Data(), eh.fEventHistogramsName[eVertex_z].Data()); qa.fEventHistogramsName2D[eReferenceMultiplicity_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eReferenceMultiplicity].Data(), eh.fEventHistogramsName[eOccupancy].Data()); - qa.fEventHistogramsName2D[eNContributors_vs_Centrality] = Form("%s_vs_%s", eh.fEventHistogramsName[eNContributors].Data(), eh.fEventHistogramsName[eCentrality].Data()); qa.fEventHistogramsName2D[eNContributors_vs_Vertex_z] = Form("%s_vs_%s", eh.fEventHistogramsName[eNContributors].Data(), eh.fEventHistogramsName[eVertex_z].Data()); qa.fEventHistogramsName2D[eNContributors_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eNContributors].Data(), eh.fEventHistogramsName[eOccupancy].Data()); - qa.fEventHistogramsName2D[eCentrality_vs_Vertex_z] = Form("%s_vs_%s", eh.fEventHistogramsName[eCentrality].Data(), eh.fEventHistogramsName[eVertex_z].Data()); qa.fEventHistogramsName2D[eCentrality_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eCentrality].Data(), eh.fEventHistogramsName[eOccupancy].Data()); - qa.fEventHistogramsName2D[eVertex_z_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eVertex_z].Data(), eh.fEventHistogramsName[eOccupancy].Data()); - qa.fEventHistogramsName2D[eCentFT0C_vs_CentNTPV] = Form("%s_vs_%s", qa.fCentralityEstimatorName[eCentFT0C].Data(), qa.fCentralityEstimatorName[eCentNTPV].Data()); qa.fEventHistogramsName2D[eCentFT0M_vs_CentNTPV] = Form("%s_vs_%s", qa.fCentralityEstimatorName[eCentFT0M].Data(), qa.fCentralityEstimatorName[eCentNTPV].Data()); qa.fEventHistogramsName2D[eCentRun2V0M_vs_CentRun2SPDTracklets] = Form("%s_vs_%s", qa.fCentralityEstimatorName[eCentRun2V0M].Data(), qa.fCentralityEstimatorName[eCentRun2SPDTracklets].Data()); qa.fEventHistogramsName2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = Form("%s_vs_%s", qa.fOccupancyEstimatorName[eTrackOccupancyInTimeRange].Data(), qa.fOccupancyEstimatorName[eFT0COccupancyInTimeRange].Data()); - qa.fEventHistogramsName2D[eCurrentRunDuration_vs_InteractionRate] = Form("%s_vs_%s", "CurrentRunDuration", "InteractionRate"); // TBI 20241127 check if this is the permanent formatting for axis titles + qa.fEventHistogramsName2D[eCurrentRunDuration_vs_InteractionRate] = Form("%s_vs_%s", ec.fEventCutName[eCurrentRunDuration].Data(), ec.fEventCutName[eInteractionRate].Data()); // ***) Quick insanity check that all names are set: for (Int_t t = 0; t < eQAEventHistograms2D_N; t++) { @@ -574,7 +571,7 @@ void DefaultConfiguration() Bool_t Alright(TString s) { - // Simple utility function, which for a string formatted "someName-0" returns false, and for "someName-1" returns true. + // Simple utility function, which for a string formatted "0-someName" returns false, and for "1-someName" returns true. // a) Insanity check on the format; // b) Do the thing. @@ -597,15 +594,15 @@ Bool_t Alright(TString s) } // b) Do the thing: - // Algorithm: I split "someName-0" with respect to "-" as a field separator, and check what is in the 2nd field. - if (TString(oa->At(1)->GetName()).EqualTo("0")) { + // Algorithm: I split "0-someName" or "1-someName" with respect to "-" as a field separator, and check what is in the 1st field. + if (TString(oa->At(0)->GetName()).EqualTo("0")) { delete oa; returnValue = kFALSE; - } else if (TString(oa->At(1)->GetName()).EqualTo("1")) { + } else if (TString(oa->At(0)->GetName()).EqualTo("1")) { delete oa; returnValue = kTRUE; } else { - LOGF(fatal, "\033[1;31m%s at line %d : string expected in this function must be formatted as \"someName-0\" or \"someName-1\" => s = %s\033[0m", __FUNCTION__, __LINE__, s.Data()); + LOGF(fatal, "\033[1;31m%s at line %d : string expected in this function must be formatted as \"0-someName\" or \"1-someName\" => s = %s\033[0m", __FUNCTION__, __LINE__, s.Data()); } if (tc.fVerboseUtility) { @@ -651,8 +648,8 @@ void DefaultBooking() // *) Insanity check on the content and ordering of histogram names in the initialization in configurable cfBookEventHistograms: // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. for (Int_t name = 0; name < eEventHistograms_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookEventHistograms[name]).BeginsWith(eh.fEventHistogramsName[name].Data())) { + // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookEventHistograms[name]).EndsWith(eh.fEventHistogramsName[name].Data())) { LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookEventHistograms => name = %d, lBookEventHistograms[%d] = \"%s\", eh.fEventHistogramsName[%d] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, name, TString(lBookEventHistograms[name]).Data(), name, eh.fEventHistogramsName[name].Data()); } } @@ -695,8 +692,8 @@ void DefaultBooking() // *) Insanity check on the content and ordering of particle histograms in the initialization in configurable cfBookParticleHistograms: // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. for (Int_t name = 0; name < eParticleHistograms_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookParticleHistograms[name]).BeginsWith(ph.fParticleHistogramsName[name].Data())) { + // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookParticleHistograms[name]).EndsWith(ph.fParticleHistogramsName[name].Data())) { LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookParticleHistograms => name = %d, lBookParticleHistograms[name] = \"%s\", ph.fParticleHistogramsName[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookParticleHistograms[name]).Data(), ph.fParticleHistogramsName[name].Data()); } } @@ -770,8 +767,8 @@ void DefaultBooking() // *) Insanity check on the content and ordering of QA 2D event histograms in the initialization in configurable cfBookQAEventHistograms2D: // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. for (Int_t name = 0; name < eQAEventHistograms2D_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookQAEventHistograms2D[name]).BeginsWith(qa.fEventHistogramsName2D[name].Data())) { + // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookQAEventHistograms2D[name]).EndsWith(qa.fEventHistogramsName2D[name].Data())) { LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookQAEventHistograms2D => name = %d, lBookQAEventHistograms2D[name] = \"%s\", qa.fEventHistogramsName2D[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookQAEventHistograms2D[name]).Data(), qa.fEventHistogramsName2D[name].Data()); } } @@ -869,8 +866,8 @@ void DefaultBinning() eh.fEventHistogramsBins[eReferenceMultiplicity][1] = 0.; eh.fEventHistogramsBins[eReferenceMultiplicity][2] = 60000.; - eh.fEventHistogramsBins[eCentrality][0] = 120; // intentionally, because if centrality is not determined, it's set to 105.0 at the moment - eh.fEventHistogramsBins[eCentrality][1] = -10.; + eh.fEventHistogramsBins[eCentrality][0] = 110; // intentionally, because if centrality is not determined, it's set to 105.0 at the moment + eh.fEventHistogramsBins[eCentrality][1] = 0.; eh.fEventHistogramsBins[eCentrality][2] = 110.; eh.fEventHistogramsBins[eVertex_x][0] = 800; @@ -895,25 +892,25 @@ void DefaultBinning() if (ec.fsEventCuts[eOccupancyEstimator].EqualTo("TrackOccupancyInTimeRange", TString::kIgnoreCase)) { eh.fEventHistogramsBins[eOccupancy][0] = 150; - eh.fEventHistogramsBins[eOccupancy][1] = 0.; // It's set to -1 if not meaningful TBI 20241109 check this further + eh.fEventHistogramsBins[eOccupancy][1] = 0.; eh.fEventHistogramsBins[eOccupancy][2] = 15000.; } else if (ec.fsEventCuts[eOccupancyEstimator].EqualTo("FT0COccupancyInTimeRange", TString::kIgnoreCase)) { // keep in sync with values below for 2D QA eh.fEventHistogramsBins[eOccupancy][0] = 1000; - eh.fEventHistogramsBins[eOccupancy][1] = 0.; // It's set to -1 if not meaningful TBI 20241109 check this further + eh.fEventHistogramsBins[eOccupancy][1] = 0.; eh.fEventHistogramsBins[eOccupancy][2] = 100000.; } - // For 2D QA correlation plot, temporarily I set it to maximum of the 2 => TBI 20241114 this can be refined + // For 2D QA correlation plot, temporarily I set it to maximum of the two above: if (qa.fBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange]) { - eh.fEventHistogramsBins[eOccupancy][0] = 600; - eh.fEventHistogramsBins[eOccupancy][1] = 0.; // It's set to -1 if not meaningful TBI 20241109 check this further - eh.fEventHistogramsBins[eOccupancy][2] = 60000.; + eh.fEventHistogramsBins[eOccupancy][0] = 1000; // keep in sync. with definition above + eh.fEventHistogramsBins[eOccupancy][1] = 0.; + eh.fEventHistogramsBins[eOccupancy][2] = 100000.; } - eh.fEventHistogramsBins[eInteractionRate][0] = 20000; // TBI 20241127 Remember that I do not have configurables for binning of control histograms, only for results histograms + eh.fEventHistogramsBins[eInteractionRate][0] = 1000; eh.fEventHistogramsBins[eInteractionRate][1] = 0.; - eh.fEventHistogramsBins[eInteractionRate][2] = 200.; + eh.fEventHistogramsBins[eInteractionRate][2] = 100.; - eh.fEventHistogramsBins[eCurrentRunDuration][0] = 10000; // TBI 20241128 Remember that I do not have configurables for binning of control histograms, only for results histograms + eh.fEventHistogramsBins[eCurrentRunDuration][0] = 10000; eh.fEventHistogramsBins[eCurrentRunDuration][1] = 0.; eh.fEventHistogramsBins[eCurrentRunDuration][2] = 100000.; @@ -1243,8 +1240,8 @@ void DefaultCuts() // *) Insanity check on the content and ordering of event cuts in the initialization in configurable cfUseEventCuts: // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. for (Int_t name = 0; name < eEventCuts_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lUseEventCuts[name]).BeginsWith(ec.fEventCutName[name].Data())) { + // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lUseEventCuts[name]).EndsWith(ec.fEventCutName[name].Data())) { LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfUseEventCuts => name = %d, lUseEventCuts[name] = \"%s\", ec.fEventCutName[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lUseEventCuts[name]).Data(), ec.fEventCutName[name].Data()); } } @@ -1373,8 +1370,8 @@ void DefaultCuts() // *) Insanity check on the content and ordering of particle cuts in the initialization in configurable cfUseParticleCuts: // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. for (Int_t name = 0; name < eParticleCuts_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lUseParticleCuts[name]).BeginsWith(pc.fParticleCutName[name].Data())) { + // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lUseParticleCuts[name]).EndsWith(pc.fParticleCutName[name].Data())) { LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfUseParticleCuts => name = %d, lUseParticleCuts[name] = \"%s\", pc.fParticleCutName[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lUseParticleCuts[name]).Data(), pc.fParticleCutName[name].Data()); } } @@ -4052,7 +4049,7 @@ void Preprocess(T1 const& collision, T2 const& bcs) template void DetermineRunNumber(T1 const& collision, T2 const&) { - // Determine a run number. + // Determine run number and all related thingies. // Make sure in process(...) that this function is called only once. // TBI 20231018 At the moment I can access run number info only in process(...), but not in init(...) @@ -4068,12 +4065,33 @@ void DetermineRunNumber(T1 const& collision, T2 const&) // a) Determine run number for Run 3 real data: if constexpr (rs == eRec) { - auto bc = collision.template foundBC_as(); // TBI 20241126 I have the same code snippet at 2 other locations, I shall unify at some point + // **) Determine run number: + // Get start timestamp and end timemstamp for this run in miliseconds, and convert both of them in seconds: + // o see O2/CCDB/src/BasicCCDBManager.cxx, O2/CCDB/include/CCDB/BasicCCDBManager.h + // o example usage in O2Physics/PWGLF/TableProducer/Common/zdcSP.cxx + auto bc = collision.template foundBC_as(); // I have the same code snippet at other places, keep in sync. tc.fRunNumber = Form("%d", bc.runNumber()); if (tc.fRunNumber.EqualTo("")) { - LOGF(error, "\033[1;33m%s fRunNumber is empty, bc.runNumber() failed...\033[0m", __FUNCTION__); - LOGF(fatal, "bc.runNumber() = %d", bc.runNumber()); + LOGF(error, "\033[1;33m%fRunNumber is empty, bc.runNumber() failed...\033[0m"); + LOGF(fatal, "\033[1;31m%s at line %d : bc.runNumber() = %d \033[0m", __FUNCTION__, __LINE__, bc.runNumber()); + } + + // **) Determine SoR, EoR, and run duration: + auto runDuration = ccdb->getRunDuration(bc.runNumber()); // this is total run duration, not the current one (see below) + tc.fRunTime[eStartOfRun] = std::floor(runDuration.first * 0.001); // in seconds since Unix epoch + tc.fRunTime[eEndOfRun] = std::ceil(runDuration.second * 0.001); // in seconds since Unix epoch + tc.fRunTime[eDurationInSec] = tc.fRunTime[eEndOfRun] - tc.fRunTime[eStartOfRun]; // yes, this is now run duration in seconds + + if (!(tc.fRunTime[eStartOfRun] > 0)) { + LOGF(fatal, "\033[1;31m%s at line %d : tc.fRunTime[eStartOfRun] = %d is not positive\033[0m", __FUNCTION__, __LINE__, tc.fRunTime[eStartOfRun]); } + if (!(tc.fRunTime[eEndOfRun] > 0)) { + LOGF(fatal, "\033[1;31m%s at line %d : tc.fRunTime[eEndOfRun] = %d is not positive\033[0m", __FUNCTION__, __LINE__, tc.fRunTime[eEndOfRun]); + } + if (!(tc.fRunTime[eDurationInSec] > 0)) { + LOGF(fatal, "\033[1;31m%s at line %d : tc.fRunTime[eDurationInSec] = %d is not positive\033[0m", __FUNCTION__, __LINE__, tc.fRunTime[eDurationInSec]); + } + } else { // b) Determine run number for the rest. TBI 20241126 differentiate this support as well, e.g. for eRecSim and eSim. But Run 2 and Run 1 most likely will stay as before LOGF(fatal, "bc.runNumber() is not validated yet beyond eRec"); @@ -4245,7 +4263,8 @@ void PropagateRunNumber() template void CheckCurrentRunNumber(T1 const& collision, T2 const&) { - // Insanity check for the current run number. + // Insanity check for the current run number and related thingies. + // Used only during validation. // a) Support for Run 3 real data; // b) The rest. TBI 20241126 differentiate this support as well, e.g. for eRecSim and eSim. But Run 2 and Run 1 most likely will stay as before @@ -4257,12 +4276,37 @@ void CheckCurrentRunNumber(T1 const& collision, T2 const&) // a) Support for Run 3 real data: if constexpr (rs == eRec) { - auto bc = collision.template foundBC_as(); // TBI 20241126 I have the same code snippet at 2 other locations, I shall unify at some point + // **) Check run number: + auto bc = collision.template foundBC_as(); // I have the same code snippet at other places, keep in sync. if (!tc.fRunNumber.EqualTo(Form("%d", bc.runNumber()))) { LOGF(error, "\033[1;33m%s Run number changed within process(). This most likely indicates that a given masterjob is processing 2 or more different runs in one go.\033[0m", __FUNCTION__); LOGF(fatal, "tc.fRunNumber = %s, bc.runNumber() = %d", tc.fRunNumber.Data(), bc.runNumber()); } + // **) Check SoR, EoR, and run duration: + auto runDuration = ccdb->getRunDuration(bc.runNumber()); // this is total run duration, not the current one (see below) + int64_t startOfRun = std::floor(runDuration.first * 0.001); // in seconds since Unix epoch + int64_t endOfRun = std::ceil(runDuration.second * 0.001); // in seconds since Unix epoch + int64_t durationInSec = endOfRun - startOfRun; // yes, this is now run duration in seconds + + // **) Insanity check on SoR: + if (!(tc.fRunTime[eStartOfRun] == startOfRun)) { + LOGF(error, "\033[1;33m%s tc.fRunTime[eStartOfRun] changed within process(). This most likely indicates that a given masterjob is processing 2 or more different runs in one go.\033[0m", __FUNCTION__); + LOGF(fatal, "tc.fRunTime[eStartOfRun] = %d, startOfRun = %d", tc.fRunTime[eStartOfRun], startOfRun); + } + + // **) Insanity check on EoR: + if (!(tc.fRunTime[eEndOfRun] == endOfRun)) { + LOGF(error, "\033[1;33m%s tc.fRunTime[eEndOfRun] changed within process(). This most likely indicates that a given masterjob is processing 2 or more different runs in one go.\033[0m", __FUNCTION__); + LOGF(fatal, "tc.fRunTime[eEndOfRun] = %d, endOfRun = %d", tc.fRunTime[eEndOfRun], endOfRun); + } + + // **) Insanity check on run duration: + if (!(tc.fRunTime[eDurationInSec] == durationInSec)) { + LOGF(error, "\033[1;33m%s tc.fRunTime[eDurationInSec] changed within process(). This most likely indicates that a given masterjob is processing 2 or more different runs in one go.\033[0m", __FUNCTION__); + LOGF(fatal, "tc.fRunTime[eDurationInSec] = %d, durationInSec = %d", tc.fRunTime[eDurationInSec], durationInSec); + } + } else { // b) The rest: @@ -4410,10 +4454,13 @@ void EventCutsCounters(T1 const& collision, T2 const& tracks) } for (Int_t bin = ec.fEventCutCounterBinNumber[rec_sim]; bin <= eEventCuts_N; bin++) // implemented, but unused cuts in this analysis { - ec.fEventCutCounterHist[rec_sim][cc]->GetXaxis()->SetBinLabel(bin, "TBI"); + ec.fEventCutCounterHist[rec_sim][cc]->GetXaxis()->SetBinLabel(bin, Form("binNo = %d (unused cut)", bin)); + // Remark: I have to write here something concrete as a bin label, if I leave "TBI" for all bin labels here for cuts which were not used, + // I get this harmless but annoying warning during merging: + // Warning in : Histogram fEventCutCounterHist[rec][seq] has duplicate labels in the x axis. Bin contents will be merged in a single bin + // TBI 20241130 as a better solution, I shall re-define this histogram with the narower range on x-axis... } - // All cuts which were implemeted, not used, and tagged temporarily with "TBI", simply do not show: - // TBI 20240522 re-think if this is really what I want here. + // All cuts which were implemeted, but not used I simply do not show (i can always UnZoom x-axis in TBrowser, if I want to see 'em): ec.fEventCutCounterHist[rec_sim][cc]->GetXaxis()->SetRangeUser(ec.fEventCutCounterHist[rec_sim][cc]->GetBinLowEdge(1), ec.fEventCutCounterHist[rec_sim][cc]->GetBinLowEdge(ec.fEventCutCounterBinNumber[rec_sim])); } } @@ -5423,14 +5470,16 @@ void ParticleCutsCounters(T const& track) } for (Int_t bin = pc.fParticleCutCounterBinNumber[rec_sim]; bin <= eParticleCuts_N; bin++) // implemented, but unused particle cuts in this analysis { - pc.fParticleCutCounterHist[rec_sim][cc]->GetXaxis()->SetBinLabel(bin, "TBI"); + pc.fParticleCutCounterHist[rec_sim][cc]->GetXaxis()->SetBinLabel(bin, Form("binNo = %d (unused cut)", bin)); + // Remark: I have to write here something concrete as a bin label, if I leave "TBI" for all bin labels here for cuts which were not used, + // I get this harmless but annoying warning during merging: + // Warning in : Histogram fParticleCutCounterHist[rec][seq] has duplicate labels in the x axis. Bin contents will be merged in a single bin + // TBI 20241130 as a better solution, I shall re-define this histogram with the narower range on x-axis... } - // All cuts which were implemeted, not used, and tagged temporarily with "TBI", simply do not show: - // TBI 20240522 re-think if this is really what I want here. + // All cuts which were implemeted, but not used I simply do not show (i can always UnZoom x-axis in TBrowser, if I want to see 'em). pc.fParticleCutCounterHist[rec_sim][cc]->GetXaxis()->SetRangeUser(pc.fParticleCutCounterHist[rec_sim][cc]->GetBinLowEdge(1), pc.fParticleCutCounterHist[rec_sim][cc]->GetBinLowEdge(pc.fParticleCutCounterBinNumber[rec_sim])); } } - pc.fParticleCutCounterBinLabelingIsDone = kTRUE; // this flag ensures that this specific binning is performed only once, for the first processed particle // delete pc.fParticleCutCounterMap[eRec]; // TBI 20240508 if i do not need them later, I could delete here // delete pc.fParticleCutCounterMap[eSim]; @@ -8356,27 +8405,72 @@ TH1D* GetHistogramWithCentralityWeights(const char* filePath, const char* runNum //============================================================ -TObjArray* GetDefaultObjArrayWithLabels() +TObjArray* GetDefaultObjArrayWithLabels(const char* whichDefaultLabels) { // To speed up testing, I hardwire here some labels and use them directly as they are. + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + // Define TObjArray: TObjArray* arr = new TObjArray(); arr->SetOwner(); - // Define some labels: - const Int_t nLabels = 7; - TString labels[nLabels] = {"1 -1", "2 -2", "3 -3", "2 1 -1 -2", "3 1 -1 -3", "3 2 -2 -3", "3 2 1 -1 -2 -3"}; + // Define some labels, depending on the chosen option for whichDefaultLabels: + if (TString(whichDefaultLabels).EqualTo("trivial")) { + const Int_t nLabels = 1; + TString labels[nLabels] = {"2 -2"}; + for (Int_t l = 0; l < nLabels; l++) { + TObjString* objstr = new TObjString(labels[l].Data()); + arr->Add(objstr); + } + } else if (TString(whichDefaultLabels).EqualTo("standard")) { + const Int_t nLabels = 7; + TString labels[nLabels] = {"1 -1", "2 -2", "3 -3", "2 1 -1 -2", "3 1 -1 -3", "3 2 -2 -3", "3 2 1 -1 -2 -3"}; + for (Int_t l = 0; l < nLabels; l++) { + TObjString* objstr = new TObjString(labels[l].Data()); + arr->Add(objstr); + } + } else if (TString(whichDefaultLabels).EqualTo("isotropic")) { + const Int_t nLabels = 8; + TString labels[nLabels] = {"1 -1", "2 -2", "3 -3", "4 -4", "1 1 -1 -1", "2 2 -2 -2", "3 3 -3 -3", "4 4 -4 -4"}; + for (Int_t l = 0; l < nLabels; l++) { + TObjString* objstr = new TObjString(labels[l].Data()); + arr->Add(objstr); + } + } else if (TString(whichDefaultLabels).EqualTo("upto8th")) { + const Int_t nLabels = 7; // yes, because I do not care about 1-p + TString labels[nLabels] = {"1 -1", "1 1 -1", "1 1 -1 -1", "1 1 -1 -1 -1", "1 1 1 -1 -1 -1", "1 1 1 1 -1 -1 -1", "1 1 1 1 -1 -1 -1 -1"}; + for (Int_t l = 0; l < nLabels; l++) { + TObjString* objstr = new TObjString(labels[l].Data()); + arr->Add(objstr); + } + } else if (TString(whichDefaultLabels).EqualTo("upto10th")) { + const Int_t nLabels = 9; // yes, because I do not care about 1-p + TString labels[nLabels] = {"1 -1", "1 1 -1", "1 1 -1 -1", "1 1 -1 -1 -1", "1 1 1 -1 -1 -1", "1 1 1 1 -1 -1 -1", "1 1 1 1 -1 -1 -1 -1", "1 1 1 1 -1 -1 -1 -1 -1", "1 1 1 1 1 -1 -1 -1 -1 -1"}; + for (Int_t l = 0; l < nLabels; l++) { + TObjString* objstr = new TObjString(labels[l].Data()); + arr->Add(objstr); + } + } else if (TString(whichDefaultLabels).EqualTo("upto12th")) { + const Int_t nLabels = 11; // yes, because I do not care about 1-p + TString labels[nLabels] = {"1 -1", "1 1 -1", "1 1 -1 -1", "1 1 -1 -1 -1", "1 1 1 -1 -1 -1", "1 1 1 1 -1 -1 -1", "1 1 1 1 -1 -1 -1 -1", "1 1 1 1 -1 -1 -1 -1 -1", "1 1 1 1 1 -1 -1 -1 -1 -1", "1 1 1 1 1 1 -1 -1 -1 -1 -1", "1 1 1 1 1 1 -1 -1 -1 -1 -1 -1"}; + for (Int_t l = 0; l < nLabels; l++) { + TObjString* objstr = new TObjString(labels[l].Data()); + arr->Add(objstr); + } + } else { + LOGF(fatal, "\033[1;31m%s at line %d : whichDefaultLabels = %s is not supported yet \033[0m", __FUNCTION__, __LINE__, whichDefaultLabels); + } - // Make a transfer: - for (Int_t l = 0; l < nLabels; l++) { - TObjString* objstr = new TObjString(labels[l].Data()); - arr->Add(objstr); + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); } return arr; -} // TObjArray* GetDefaultObjArrayWithLabels() +} // TObjArray* GetDefaultObjArrayWithLabels(const char* whichDefaultLabels) //============================================================ @@ -8684,7 +8778,7 @@ void StoreLabelsInPlaceholder() // b) Fetch TObjArray with labels from an external file: TObjArray* oa = NULL; if (t0.fUseDefaultLabels) { - oa = GetDefaultObjArrayWithLabels(); + oa = GetDefaultObjArrayWithLabels(t0.fWhichDefaultLabels.Data()); } else { oa = GetObjArrayWithLabels(t0.fFileWithLabels.Data()); } @@ -10062,20 +10156,7 @@ void DetermineInteractionRate(T1 const& collision, T2 const&) // a) Determine interaction rate only for eRec: if constexpr (rs == eRec) { - auto bc = collision.template foundBC_as(); // TBI 20241126 this seems to works as expected, but check and validate further - // cout << bc.runNumber() << endl; // works as expected - // cout << bc.timestamp() << endl; // works as expected - // TBI 20241126 I have the same code snippet at 2 other locations, I shall unify at some point - - // Get start timestamp and end timemstamp for this run in miliseconds, and convert both of them in seconds: - // o see O2/CCDB/src/BasicCCDBManager.cxx, O2/CCDB/include/CCDB/BasicCCDBManager.h - // o example usage in O2Physics/PWGLF/TableProducer/Common/zdcSP.cxx - auto runDuration = ccdb->getRunDuration(bc.runNumber()); // this is total run duration, not the current one (see below) - int64_t startOfRun = std::floor(runDuration.first * 0.001); - int64_t endOfRun = std::ceil(runDuration.second * 0.001); - int64_t runDurationInSec = endOfRun - startOfRun; // yes, this is now in seconds - - // From documentation: double ctpRateFetcher::fetch(o2::ccdb::BasicCCDBManager* ccdb, uint64_t timeStamp, int runNumber, std::string sourceName) + auto bc = collision.template foundBC_as(); // I have the same code snippet at other places, keep in sync. double hadronicRate = mRateFetcher.fetch(ccdb.service, static_cast(bc.timestamp()), static_cast(bc.runNumber()), "ZNC hadronic") * 1.e-3; if (hadronicRate > 0.) { ebye.fInteractionRate = static_cast(hadronicRate); @@ -10083,15 +10164,14 @@ void DetermineInteractionRate(T1 const& collision, T2 const&) LOGF(fatal, "\033[1;31m%s at line %d : hadronicRate = %f is meaningless \033[0m", __FUNCTION__, __LINE__, hadronicRate); } - // If I feel 2D QA eCurrentRunDuration_vs_InteractionRate , extract still the current run duration: - if (qa.fBookQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate]) { // TBI 20241127 do I check this flag, of pointers, like in FillEventHistograms(...) ? - ebye.fCurrentRunDuration = std::floor(bc.timestamp() * 0.001) - startOfRun; - if (ebye.fCurrentRunDuration > runDurationInSec) { - LOGF(fatal, "\033[1;31m%s at line %d : ebye.fCurrentRunDuration = %d is bigger than runDurationInSec = %d, which is meaningless \033[0m", __FUNCTION__, __LINE__, static_cast(ebye.fCurrentRunDuration), static_cast(runDurationInSec)); + // If I fill 2D QA histogram eCurrentRunDuration_vs_InteractionRate , extract still the current run duration: + if (qa.fBookQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate]) { // TBI 20241127 do I check this flag, or pointer, like in FillEventHistograms(...) ? + ebye.fCurrentRunDuration = std::floor(bc.timestamp() * 0.001) - tc.fRunTime[eStartOfRun]; + if (ebye.fCurrentRunDuration > tc.fRunTime[eDurationInSec]) { + LOGF(fatal, "\033[1;31m%s at line %d : ebye.fCurrentRunDuration = %d is bigger than tc.fRunTime[eDurationInSec] = %d, which is meaningless \033[0m", __FUNCTION__, __LINE__, static_cast(ebye.fCurrentRunDuration), static_cast(tc.fRunTime[eDurationInSec])); } } } else { - ebye.fInteractionRate = -1.; ebye.fCurrentRunDuration = -1.; } @@ -10099,7 +10179,7 @@ void DetermineInteractionRate(T1 const& collision, T2 const&) // c) Print interaction rate and run duration for the audience...: if (tc.fVerbose) { LOGF(info, "\033[1;32m ebye.fInteractionRate = %f kHz\033[0m", ebye.fInteractionRate); - if (qa.fBookQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate]) { // TBI 20241127 do I check this flag, of pointers, like in FillEventHistograms(...) ? + if (qa.fBookQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate]) { // TBI 20241127 do I check this flag, or pointer, like in FillEventHistograms(...) ? LOGF(info, "\033[1;32m ebye.fCurrentRunDuration = %f s (in seconds after SOR)\033[0m", ebye.fCurrentRunDuration); } ExitFunction(__FUNCTION__); diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx index 5787746f82d..16ff6dae966 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx @@ -12,7 +12,6 @@ // O2: #include #include "Common/CCDB/ctpRateFetcher.h" -// #include "Common/CCDB/ctpRateFetcher.cxx" // TBI 20241126 if I include instead only .h file, linker fails, check this further #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" From 50f7e2d0a54708b4f3ccee7bd043fd4df6fe03ff Mon Sep 17 00:00:00 2001 From: Noor Koster <82090643+cnkoster@users.noreply.github.com> Date: Sun, 1 Dec 2024 21:17:32 +0100 Subject: [PATCH 198/459] [PWGCF] Task for flow analysis relative to Spectator Plane (#8739) Co-authored-by: ALICE Action Bot --- PWGCF/Flow/Tasks/CMakeLists.txt | 5 + PWGCF/Flow/Tasks/flowSP.cxx | 343 ++++++++++++++++++++++++++++++++ 2 files changed, 348 insertions(+) create mode 100644 PWGCF/Flow/Tasks/flowSP.cxx diff --git a/PWGCF/Flow/Tasks/CMakeLists.txt b/PWGCF/Flow/Tasks/CMakeLists.txt index f3c0c3f120b..eaee5ac70ed 100644 --- a/PWGCF/Flow/Tasks/CMakeLists.txt +++ b/PWGCF/Flow/Tasks/CMakeLists.txt @@ -53,3 +53,8 @@ o2physics_add_dpl_workflow(flow-pid-cme SOURCES pidcme.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(flow-sp + SOURCES flowSP.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore + COMPONENT_NAME Analysis) diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx new file mode 100644 index 00000000000..62c237bb0f0 --- /dev/null +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -0,0 +1,343 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// author: Noor Koster noor.koster@cern.ch + +#include +#include +#include +#include +#include +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/HistogramRegistry.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Qvectors.h" + +#include "PWGCF/DataModel/SPTableZDC.h" +#include "TF1.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +// using namespace o2::analysis; + +#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; + +struct flowAnalysisSP { + + O2_DEFINE_CONFIGURABLE(cfgDCAxy, float, 0.2, "Cut on DCA in the transverse direction (cm)"); + O2_DEFINE_CONFIGURABLE(cfgDCAz, float, 2, "Cut on DCA in the longitudinal direction (cm)"); + O2_DEFINE_CONFIGURABLE(cfgNcls, float, 70, "Cut on number of TPC clusters found"); + O2_DEFINE_CONFIGURABLE(cfgPtmin, float, 0.2, "minimum pt (GeV/c)"); + O2_DEFINE_CONFIGURABLE(cfgPtmax, float, 10, "maximum pt (GeV/c)"); + O2_DEFINE_CONFIGURABLE(cfgEta, float, 0.8, "eta cut"); + O2_DEFINE_CONFIGURABLE(cfgVtxZ, float, 10, "vertex cut (cm)"); + O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried"); + O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, true, "Bool to enable Additional Event Cut"); + O2_DEFINE_CONFIGURABLE(cfgUseAdditionalTrackCut, bool, true, "Bool to enable Additional Track Cut"); + + O2_DEFINE_CONFIGURABLE(cfgDoubleTrackFunction, bool, true, "Include track cut at low pt"); + O2_DEFINE_CONFIGURABLE(cfgTrackCutSize, float, 0.06, "Spread of track cut"); + O2_DEFINE_CONFIGURABLE(cfgMaxOccupancy, int, 500, "Maximum occupancy of selected events"); + O2_DEFINE_CONFIGURABLE(cfgNoSameBunchPileupCut, bool, true, "kNoSameBunchPileupCut"); + O2_DEFINE_CONFIGURABLE(cfgIsGoodZvtxFT0vsPV, bool, true, "kIsGoodZvtxFT0vsPV"); + O2_DEFINE_CONFIGURABLE(cfgNoCollInTimeRangeStandard, bool, true, "kNoCollInTimeRangeStandard"); + O2_DEFINE_CONFIGURABLE(cfgDoOccupancySel, bool, true, "Bool for event selection on detector occupancy"); + O2_DEFINE_CONFIGURABLE(cfgMultCut, bool, true, "Use additional evenr cut on mult correlations"); + O2_DEFINE_CONFIGURABLE(cfgTVXinTRD, bool, true, "Use kTVXinTRD (reject TRD triggered events)"); + O2_DEFINE_CONFIGURABLE(cfgIsVertexITSTPC, bool, true, "Selects collisions with at least one ITS-TPC track"); + + Filter collisionFilter = nabs(aod::collision::posZ) < cfgVtxZ; + Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && nabs(aod::track::dcaXY) < cfgDCAxy&& nabs(aod::track::dcaZ) < cfgDCAz; + using myCollisions = soa::Filtered>; + using myTracks = soa::Filtered>; + + // Connect to ccdb + Service ccdb; + + HistogramRegistry registry{"registry"}; + + // Event selection cuts - Alex + TF1* fPhiCutLow = nullptr; + TF1* fPhiCutHigh = nullptr; + TF1* fMultPVCutLow = nullptr; + TF1* fMultPVCutHigh = nullptr; + TF1* fMultCutLow = nullptr; + TF1* fMultCutHigh = nullptr; + TF1* fMultMultPVCut = nullptr; + + void init(InitContext const&) + { + std::vector ptbinning = {0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}; + + AxisSpec phiModAxis = {100, 0, constants::math::PI / 9, "fmod(#varphi,#pi/9)"}; + AxisSpec ptAxis = {ptbinning, "#it{p}_{T} GeV/#it{c}"}; + + ccdb->setURL("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + + int64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + ccdb->setCreatedNotAfter(now); + + registry.add("hSPplaneA", "hSPplaneA", kTH1D, {{100, -3, 3}}); + registry.add("hSPplaneC", "hSPplaneC", kTH1D, {{100, -3, 3}}); + registry.add("hSPplaneA-C", "hSPplaneA-C", kTH1D, {{100, -3, 3}}); + registry.add("hCent", "hCent", kTH1D, {{80, 0, 80}}); + + registry.add("hqIm", "hqIm", kTH1D, {{100, -2, 2}}); + registry.add("hqRe", "hqRe", kTH1D, {{100, -2, 2}}); + + registry.add("hCosdPhi", "hCosdPhi; Centrality(%); #LT Cos( #Psi^{A}-#Psi^{C})#GT", kTProfile, {{80, 0, 80}}); + registry.add("hSindPhi", "hSindPhi; Centrality(%); #LT Sin( #Psi^{A}-#Psi^{C})#GT", kTProfile, {{80, 0, 80}}); + registry.add("hSPlaneRes", "hSPlaneRes; Centrality(%); ", kTProfile, {{80, 0, 80}}); + + registry.add("pt_phi_bef", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); + registry.add("pt_phi_aft", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); + + registry.add("v1_eta", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1A_eta", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1C_eta", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1AC_eta", "", kTProfile, {{10, -.8, .8}}); + + registry.add("v2_cent", "", kTProfile, {{80, 0, 80}}); + registry.add("v2A_cent", "", kTProfile, {{80, 0, 80}}); + registry.add("v2C_cent", "", kTProfile, {{80, 0, 80}}); + registry.add("v2AC_cent", "", kTProfile, {{80, 0, 80}}); + + registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{10, 0, 10}}}); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(1, "Filtered event"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(2, "sel8"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(3, "occupancy"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(4, "kTVXinTRD"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(5, "kNoSameBunchPileup"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(6, "kIsGoodZvtxFT0vsPV"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(7, "kNoCollInTimeRangeStandard"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(8, "kIsVertexITSTPC"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(9, "after Mult cuts"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(10, "isSelected"); + + if (cfgUseAdditionalEventCut) { + fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x - 3.5*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", 0, 100); + fMultPVCutLow->SetParameters(3257.29, -121.848, 1.98492, -0.0172128, 6.47528e-05, 154.756, -1.86072, -0.0274713, 0.000633499, -3.37757e-06); + fMultPVCutHigh = new TF1("fMultPVCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x + 3.5*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", 0, 100); + fMultPVCutHigh->SetParameters(3257.29, -121.848, 1.98492, -0.0172128, 6.47528e-05, 154.756, -1.86072, -0.0274713, 0.000633499, -3.37757e-06); + + fMultCutLow = new TF1("fMultCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); + fMultCutLow->SetParameters(1654.46, -47.2379, 0.449833, -0.0014125, 150.773, -3.67334, 0.0530503, -0.000614061, 3.15956e-06); + fMultCutHigh = new TF1("fMultCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 3.*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); + fMultCutHigh->SetParameters(1654.46, -47.2379, 0.449833, -0.0014125, 150.773, -3.67334, 0.0530503, -0.000614061, 3.15956e-06); + } + + if (cfgUseAdditionalTrackCut) { + fPhiCutLow = new TF1("fPhiCutLow", "0.06/x+pi/18.0-0.06", 0, 100); + fPhiCutHigh = new TF1("fPhiCutHigh", "0.1/x+pi/18.0+0.06", 0, 100); + } + } + + int getMagneticField(uint64_t timestamp) + { + // TODO done only once (and not per run). Will be replaced by CCDBConfigurable + // static o2::parameters::GRPObject* grpo = nullptr; + static o2::parameters::GRPMagField* grpo = nullptr; + if (grpo == nullptr) { + // grpo = ccdb->getForTimeStamp("GLO/GRP/GRP", timestamp); + grpo = ccdb->getForTimeStamp("GLO/Config/GRPMagField", timestamp); + if (grpo == nullptr) { + LOGF(fatal, "GRP object not found for timestamp %llu", timestamp); + return 0; + } + LOGF(info, "Retrieved GRP for timestamp %llu with magnetic field of %d kG", timestamp, grpo->getNominalL3Field()); + } + return grpo->getNominalL3Field(); + } + + template + bool eventSelected(TCollision collision, const int& multTrk, const float& centrality) + { + if (cfgTVXinTRD) { + if (collision.alias_bit(kTVXinTRD)) { + // TRD triggered + // "CMTVX-B-NOPF-TRD,minbias_TVX" + return 0; + } + registry.fill(HIST("hEventCount"), 3.5); + } + + if (cfgNoSameBunchPileupCut) { + if (!collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + // rejects collisions which are associated with the same "found-by-T0" bunch crossing + // https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof + return 0; + } + registry.fill(HIST("hEventCount"), 4.5); + } + if (cfgIsGoodZvtxFT0vsPV) { + if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + // removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference + // use this cut at low multiplicities with caution + return 0; + } + registry.fill(HIST("hEventCount"), 5.5); + } + if (cfgNoCollInTimeRangeStandard) { + if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + // Rejection of the collisions which have other events nearby + return 0; + } + registry.fill(HIST("hEventCount"), 6.5); + } + + if (cfgIsVertexITSTPC) { + if (!collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + // selects collisions with at least one ITS-TPC track, and thus rejects vertices built from ITS-only tracks + return 0; + } + registry.fill(HIST("hEventCount"), 7.5); + } + + float vtxz = -999; + if (collision.numContrib() > 1) { + vtxz = collision.posZ(); + float zRes = TMath::Sqrt(collision.covZZ()); + if (zRes > 0.25 && collision.numContrib() < 20) + vtxz = -999; + } + // auto multV0A = collision.multFV0A(); + // auto multT0A = collision.multFT0A(); + // auto multT0C = collision.multFT0C(); + auto multNTracksPV = collision.multNTracksPV(); + + if (vtxz > 10 || vtxz < -10) + return 0; + if (multNTracksPV < fMultPVCutLow->Eval(centrality)) + return 0; + if (multNTracksPV > fMultPVCutHigh->Eval(centrality)) + return 0; + if (multTrk < fMultCutLow->Eval(centrality)) + return 0; + if (multTrk > fMultCutHigh->Eval(centrality)) + return 0; + + registry.fill(HIST("hEventCount"), 8.5); + + return 1; + } + + template + bool trackSelected(TTrack track, const int& field) + { + double phimodn = track.phi(); + if (field < 0) // for negative polarity field + phimodn = TMath::TwoPi() - phimodn; + if (track.sign() < 0) // for negative charge + phimodn = TMath::TwoPi() - phimodn; + if (phimodn < 0) + LOGF(warning, "phi < 0: %g", phimodn); + + phimodn += TMath::Pi() / 18.0; // to center gap in the middle + phimodn = fmod(phimodn, TMath::Pi() / 9.0); + registry.fill(HIST("pt_phi_bef"), track.pt(), phimodn); + if (phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt())) + return false; // reject track + registry.fill(HIST("pt_phi_aft"), track.pt(), phimodn); + return true; + } + + void process(myCollisions::iterator const& collision, aod::BCsWithTimestamps const&, myTracks const& tracks) + { + // Hier sum over collisions and get ZDC data. + registry.fill(HIST("hEventCount"), .5); + + if (!collision.sel8()) + return; + registry.fill(HIST("hEventCount"), 1.5); + + auto bc = collision.bc_as(); + auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; + + auto centrality = collision.centFT0C(); + // auto bc = collision.template bc_as(); + if (!eventSelected(collision, tracks.size(), centrality)) + return; + + if (collision.isSelected()) { + registry.fill(HIST("hEventCount"), 9.5); + + registry.fill(HIST("hCent"), centrality); + + double qxA = collision.qxA(); + double qyA = collision.qyA(); + double qxC = collision.qxC(); + double qyC = collision.qyC(); + + double Psi_A = 1.0 * TMath::ATan2(qyA, qxA); + registry.fill(HIST("hSPplaneA"), Psi_A, 1); + + double Psi_C = 1.0 * TMath::ATan2(qyC, qxC); + registry.fill(HIST("hSPplaneC"), Psi_C, 1); + + registry.fill(HIST("hSPplaneA-C"), Psi_A - Psi_C, 1); + + registry.fill(HIST("hCosdPhi"), centrality, TMath::Cos(Psi_A - Psi_C)); + if (TMath::Cos(Psi_A - Psi_C) < 0) + registry.fill(HIST("hSPlaneRes"), centrality, TMath::Sqrt(-1. * TMath::Cos(Psi_A - Psi_C))); + registry.fill(HIST("hSindPhi"), centrality, TMath::Sin(Psi_A - Psi_C)); + + for (auto& track : tracks) { + if (!trackSelected(track, field)) + continue; + + double v1A = TMath::Cos(track.phi() - Psi_A); + double v1C = TMath::Cos(track.phi() - Psi_C); + + double v1AC = TMath::Cos(track.phi() - (Psi_A - Psi_C)); + + registry.fill(HIST("v1_eta"), track.eta(), (1. / TMath::Sqrt(2)) * (v1A - v1C)); + registry.fill(HIST("v1A_eta"), track.eta(), (v1A)); + registry.fill(HIST("v1C_eta"), track.eta(), (v1C)); + registry.fill(HIST("v1AC_eta"), track.eta(), (v1AC)); + + double v2A = TMath::Cos(2 * (track.phi() - Psi_A)); + double v2C = TMath::Cos(2 * (track.phi() - Psi_C)); + double v2AC = TMath::Cos(2 * (track.phi() - (Psi_A - Psi_C))); + + registry.fill(HIST("v2_cent"), centrality, (1. / TMath::Sqrt(2)) * (v2A - v2C)); + registry.fill(HIST("v2A_cent"), centrality, (v2A)); + registry.fill(HIST("v2C_cent"), centrality, (v2C)); + registry.fill(HIST("v2AC_cent"), centrality, (v2AC)); + } + + float qIm = collision.qvecIm()[0]; + float qRe = collision.qvecRe()[0]; + + registry.fill(HIST("hqIm"), qIm); + registry.fill(HIST("hqRe"), qRe); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + }; +} From a9e55f65825d056ba09c343a793272a9860f82c7 Mon Sep 17 00:00:00 2001 From: Evgeny Kryshen Date: Sun, 1 Dec 2024 23:39:53 +0300 Subject: [PATCH 199/459] [DPG] Added check for lastRun in processRun2 (#8757) --- DPG/Tasks/AOTEvent/eventSelectionQa.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx index e8835587438..a4069a27764 100644 --- a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx +++ b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx @@ -53,7 +53,7 @@ struct EventSelectionQaTask { Service ccdb; HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - bool* applySelection = NULL; + static const int32_t nBCsPerOrbit = o2::constants::lhc::LHCMaxBunches; int32_t lastRun = -1; int64_t nOrbits = 1; // number of orbits, setting 1 for unanchored MC @@ -336,14 +336,17 @@ struct EventSelectionQaTask { aod::FDDs const&) { bool isINT1period = 0; - if (!applySelection) { + + int run = bcs.iteratorAt(0).runNumber(); + if (run != lastRun) { + lastRun = run; auto firstBC = bcs.iteratorAt(0); EventSelectionParams* par = ccdb->getForTimeStamp("EventSelection/EventSelectionParams", firstBC.timestamp()); - applySelection = par->GetSelection(0); + bool* applySelection = par->GetSelection(0); for (int i = 0; i < kNsel; i++) { histos.get(HIST("hSelMask"))->SetBinContent(i + 1, applySelection[i]); } - isINT1period = firstBC.runNumber() <= 136377 || (firstBC.runNumber() >= 144871 && firstBC.runNumber() <= 159582); + isINT1period = run <= 136377 || (run >= 144871 && run <= 159582); } // bc-based event selection qa From 71801cf032df0b36dffefff28608f53a069b593a Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Mon, 2 Dec 2024 00:08:02 +0100 Subject: [PATCH 200/459] [PWGCF] DptDpt - NUA&NUE corrections with configurable dimensions (#8758) Co-authored-by: Victor --- PWGCF/Tasks/dptdptcorrelations.cxx | 55 ++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/PWGCF/Tasks/dptdptcorrelations.cxx b/PWGCF/Tasks/dptdptcorrelations.cxx index d8c88981dbe..2d751a00db0 100644 --- a/PWGCF/Tasks/dptdptcorrelations.cxx +++ b/PWGCF/Tasks/dptdptcorrelations.cxx @@ -100,7 +100,7 @@ struct DptDptCorrelationsTask { std::vector fhSum1Pt_vsEtaPhi{nch, nullptr}; //! fhN1_vsZEtaPhiPt{nch, nullptr}; //! fhSum1Pt_vsZEtaPhiPt{nch, nullptr}; //! fhNuaNue_vsZEtaPhiPt{nch, nullptr}; //! fhNuaNue{nch, nullptr}; //! fhPtAvg_vsEtaPhi{nch, nullptr}; //!> fhN2_vsPtPt{nch, {nch, nullptr}}; //!> fhN2_vsDEtaDPhi{nch, {nch, nullptr}}; //! corrs) + void storeTrackCorrections(std::vector corrs) { LOGF(info, "Stored NUA&NUE corrections for %d track ids", corrs.size()); for (uint i = 0; i < corrs.size(); ++i) { - LOGF(info, " Stored NUA&NUE corrections %s for track id %d %s", corrs[i] != nullptr ? corrs[i]->GetName() : "nullptr", i, corrs[i] != nullptr ? "yes" : "no"); - fhNuaNue_vsZEtaPhiPt[i] = corrs[i]; - if (fhNuaNue_vsZEtaPhiPt[i] != nullptr) { + int nDimensions = corrs[i] != nullptr ? corrs[i]->GetDimension() : 0; + LOGF(info, " Stored NUA&NUE corrections %s for track id %d with %d dimensions %s", + corrs[i] != nullptr ? corrs[i]->GetName() : "nullptr", i, nDimensions, corrs[i] != nullptr ? "yes" : "no"); + fhNuaNue[i] = corrs[i]; + if (fhNuaNue[i] != nullptr) { int nbins = 0; double avg = 0.0; - for (int ix = 0; ix < fhNuaNue_vsZEtaPhiPt[i]->GetNbinsX(); ++ix) { - for (int iy = 0; iy < fhNuaNue_vsZEtaPhiPt[i]->GetNbinsY(); ++iy) { - for (int iz = 0; iz < fhNuaNue_vsZEtaPhiPt[i]->GetNbinsZ(); ++iz) { - nbins++; - avg += fhNuaNue_vsZEtaPhiPt[i]->GetBinContent(ix + 1, iy + 1, iz + 1); + for (int ix = 0; ix < fhNuaNue[i]->GetNbinsX(); ++ix) { + if (nDimensions == 1) { + nbins++; + avg += fhNuaNue[i]->GetBinContent(ix + 1); + } else { + for (int iy = 0; iy < fhNuaNue[i]->GetNbinsY(); ++iy) { + if (nDimensions == 2) { + nbins++; + avg += fhNuaNue[i]->GetBinContent(ix + 1, iy + 1); + } else { + for (int iz = 0; iz < fhNuaNue[i]->GetNbinsZ(); ++iz) { + nbins++; + avg += fhNuaNue[i]->GetBinContent(ix + 1, iy + 1, iz + 1); + } + } } } } @@ -332,8 +344,15 @@ struct DptDptCorrelationsTask { std::vector* corr = new std::vector(tracks.size(), 1.0f); int index = 0; for (auto& t : tracks) { - if (fhNuaNue_vsZEtaPhiPt[t.trackacceptedid()] != nullptr) { - (*corr)[index] = fhNuaNue_vsZEtaPhiPt[t.trackacceptedid()]->GetBinContent(fhNuaNue_vsZEtaPhiPt[t.trackacceptedid()]->FindFixBin(zvtx, GetEtaPhiIndex(t) + 0.5, t.pt())); + if (fhNuaNue[t.trackacceptedid()] != nullptr) { + int nDimensions = fhNuaNue[t.trackacceptedid()]->GetDimension(); + if (nDimensions == 1) { + (*corr)[index] = fhNuaNue[t.trackacceptedid()]->GetBinContent(fhNuaNue[t.trackacceptedid()]->FindFixBin(t.pt())); + } else if (nDimensions == 2) { + (*corr)[index] = fhNuaNue[t.trackacceptedid()]->GetBinContent(fhNuaNue[t.trackacceptedid()]->FindFixBin(t.eta(), t.pt())); + } else { + (*corr)[index] = fhNuaNue[t.trackacceptedid()]->GetBinContent(fhNuaNue[t.trackacceptedid()]->FindFixBin(zvtx, GetEtaPhiIndex(t) + 0.5, t.pt())); + } } index++; } @@ -690,7 +709,7 @@ struct DptDptCorrelationsTask { fhSum1Pt_vsZEtaPhiPt[i]->SetBit(TH1::kIsNotW); fhSum1Pt_vsZEtaPhiPt[i]->Sumw2(false); } - fhNuaNue_vsZEtaPhiPt[i] = nullptr; + fhNuaNue[i] = nullptr; fhPtAvg_vsEtaPhi[i] = nullptr; fOutputList->Add(fhN1_vsPt[i]); @@ -724,7 +743,7 @@ struct DptDptCorrelationsTask { 100, 0.0, 100.0); fhSum1Ptnw_vsC[i] = new TProfile(TString::Format("sumPtNw_%s_vsM", tnames[i].c_str()).Data(), TString::Format("#LT #Sigma p_{t,%s} #GT;Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tnames[i].c_str(), tnames[i].c_str()).Data(), 100, 0.0, 100.0); - fhNuaNue_vsZEtaPhiPt[i] = nullptr; + fhNuaNue[i] = nullptr; fhPtAvg_vsEtaPhi[i] = nullptr; fOutputList->Add(fhN1_vsEtaPhi[i]); fOutputList->Add(fhSum1Pt_vsEtaPhi[i]); @@ -1200,9 +1219,9 @@ struct DptDptCorrelationsTask { } storePtAverages(ptavgs); } else { - std::vector corrs{tnames.size(), nullptr}; + std::vector corrs{tnames.size(), nullptr}; for (uint isp = 0; isp < tnames.size(); ++isp) { - corrs[isp] = reinterpret_cast(ccdblst->FindObject( + corrs[isp] = reinterpret_cast(ccdblst->FindObject( TString::Format("correction_%02d-%02d_%s", static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), @@ -1274,9 +1293,9 @@ struct DptDptCorrelationsTask { } dataCEME[ixDCE]->storePtAverages(ptavgs); } else { - std::vector corrs{tnames.size(), nullptr}; + std::vector corrs{tnames.size(), nullptr}; for (uint isp = 0; isp < tnames.size(); ++isp) { - corrs[isp] = reinterpret_cast(ccdblst->FindObject( + corrs[isp] = reinterpret_cast(ccdblst->FindObject( TString::Format("correction_%02d-%02d_%s", static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), From 9faeb7598585e1e1a81f3c3d6b87344d0f5ed5b9 Mon Sep 17 00:00:00 2001 From: yakparo Date: Mon, 2 Dec 2024 07:55:16 +0100 Subject: [PATCH 201/459] [PWGLF] change in hStrangeCorrelation (#8745) Co-authored-by: Yakiv <5348341@upjs.sk> --- PWGLF/DataModel/LFHStrangeCorrelationTables.h | 45 +++-- .../Strangeness/hStrangeCorrelationFilter.cxx | 38 +++- .../Tasks/Strangeness/hStrangeCorrelation.cxx | 185 ++++++++++++++---- 3 files changed, 211 insertions(+), 57 deletions(-) diff --git a/PWGLF/DataModel/LFHStrangeCorrelationTables.h b/PWGLF/DataModel/LFHStrangeCorrelationTables.h index 1b31239f406..7f7578b3632 100644 --- a/PWGLF/DataModel/LFHStrangeCorrelationTables.h +++ b/PWGLF/DataModel/LFHStrangeCorrelationTables.h @@ -50,26 +50,33 @@ DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Assoc"); //! } // namespace assocPions DECLARE_SOA_TABLE(AssocPions, "AOD", "ASSOCPIONS", o2::soa::Index<>, assocPions::CollisionId, assocPions::TrackId); + +namespace assocHadrons +{ +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! +DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Assoc"); //! +} // namespace assocHadrons +DECLARE_SOA_TABLE(AssocHadrons, "AOD", "ASSOCHADRONS", o2::soa::Index<>, assocHadrons::CollisionId, assocHadrons::TrackId); /// _________________________________________ /// Table for storing associated V0 indices namespace assocV0s { -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! -DECLARE_SOA_INDEX_COLUMN(V0Core, v0Core); //! +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! +DECLARE_SOA_INDEX_COLUMN(V0Core, v0Core); //! // dEdx compatibility is done via encoded integer: 0: passes loose; 1: passes normal, 2: passes tight; definition of loose/normal/tight is in hStrangeCorrelationFilter DECLARE_SOA_COLUMN(CompatibleK0Short, compatibleK0Short, int); // compatible with K0Short dEdx, encoded syst checks DECLARE_SOA_COLUMN(CompatibleLambda, compatibleLambda, int); // compatible with Lambda dEdx, encoded syst checks DECLARE_SOA_COLUMN(CompatibleAntiLambda, compatibleAntiLambda, int); // compatible with AntiLambda dEdx, encoded syst checks -DECLARE_SOA_COLUMN(MCTrueK0Short, mcTrueK0Short, bool); // true K0Short in MC -DECLARE_SOA_COLUMN(MCTrueLambda, mcTrueLambda, bool); // true Lambda in MC -DECLARE_SOA_COLUMN(MCTrueAntiLambda, mcTrueAntiLambda, bool); // true AntiLambda in MC -DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // true physical primary flag -DECLARE_SOA_COLUMN(NSigmaMassK0Short, nSigmaMassK0Short, float); // -DECLARE_SOA_COLUMN(NSigmaMassLambda, nSigmaMassLambda, float); // +DECLARE_SOA_COLUMN(MCTrueK0Short, mcTrueK0Short, bool); // true K0Short in MC +DECLARE_SOA_COLUMN(MCTrueLambda, mcTrueLambda, bool); // true Lambda in MC +DECLARE_SOA_COLUMN(MCTrueAntiLambda, mcTrueAntiLambda, bool); // true AntiLambda in MC +DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // true physical primary flag +DECLARE_SOA_COLUMN(NSigmaMassK0Short, nSigmaMassK0Short, float); // +DECLARE_SOA_COLUMN(NSigmaMassLambda, nSigmaMassLambda, float); // DECLARE_SOA_COLUMN(NSigmaMassAntiLambda, nSigmaMassAntiLambda, float); // -DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar) +DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar) [](int cK0Short, int cLambda, int cAntiLambda, int value, int compatibilityLevel) -> bool { if (value == 0 && bitcheck(cK0Short, compatibilityLevel)) return true; @@ -119,8 +126,8 @@ DECLARE_SOA_TABLE(AssocV0s, "AOD", "ASSOCV0S", o2::soa::Index<>, /// Table for storing associated casc indices namespace assocCascades { -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! -DECLARE_SOA_INDEX_COLUMN(CascData, cascData); //! +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! +DECLARE_SOA_INDEX_COLUMN(CascData, cascData); //! // dEdx compatibility is done via encoded integer: 0: passes loose; 1: passes normal, 2: passes tight; definition of loose/normal/tight is in hStrangeCorrelationFilter DECLARE_SOA_COLUMN(CompatibleXiMinus, compatibleXiMinus, int); // compatible with XiMinus @@ -128,14 +135,14 @@ DECLARE_SOA_COLUMN(CompatibleXiPlus, compatibleXiPlus, int); // compatib DECLARE_SOA_COLUMN(CompatibleOmegaMinus, compatibleOmegaMinus, int); // compatible with OmegaMinus DECLARE_SOA_COLUMN(CompatibleOmegaPlus, compatibleOmegaPlus, int); // compatible with OmegaPlus -DECLARE_SOA_COLUMN(MCTrueXiMinus, mcTrueXiMinus, bool); // true XiMinus in mc -DECLARE_SOA_COLUMN(MCTrueXiPlus, mcTrueXiPlus, bool); // true XiPlus in mc -DECLARE_SOA_COLUMN(MCTrueOmegaMinus, mcTrueOmegaMinus, bool); // true OmegaMinus in mc -DECLARE_SOA_COLUMN(MCTrueOmegaPlus, mcTrueOmegaPlus, bool); // true OmegaPlus in mc -DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // physical primary in MC -DECLARE_SOA_COLUMN(NSigmaMassXi, nSigmaMassXi, float); // -DECLARE_SOA_COLUMN(NSigmaMassOmega, nSigmaMassOmega, float); // -DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar) +DECLARE_SOA_COLUMN(MCTrueXiMinus, mcTrueXiMinus, bool); // true XiMinus in mc +DECLARE_SOA_COLUMN(MCTrueXiPlus, mcTrueXiPlus, bool); // true XiPlus in mc +DECLARE_SOA_COLUMN(MCTrueOmegaMinus, mcTrueOmegaMinus, bool); // true OmegaMinus in mc +DECLARE_SOA_COLUMN(MCTrueOmegaPlus, mcTrueOmegaPlus, bool); // true OmegaPlus in mc +DECLARE_SOA_COLUMN(MCPhysicalPrimary, mcPhysicalPrimary, bool); // physical primary in MC +DECLARE_SOA_COLUMN(NSigmaMassXi, nSigmaMassXi, float); // +DECLARE_SOA_COLUMN(NSigmaMassOmega, nSigmaMassOmega, float); // +DECLARE_SOA_DYNAMIC_COLUMN(Compatible, compatible, //! check compatibility with a hypothesis of a certain number (0 - K0, 1 - L, 2 - Lbar) [](int cXiMinus, int cXiPlus, int cOmegaMinus, int cOmegaPlus, int value, int compatibilityLevel) -> bool { if (value == 0 && bitcheck(cXiMinus, compatibilityLevel)) return true; diff --git a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx index 0dd6cf1d4ec..220670d1e4a 100644 --- a/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx +++ b/PWGLF/TableProducer/Strangeness/hStrangeCorrelationFilter.cxx @@ -141,6 +141,7 @@ struct hstrangecorrelationfilter { Produces assocPion; Produces assocV0; Produces assocCascades; + Produces assocHadrons; TF1* fK0Mean = new TF1("fK0Mean", "[0]+[1]*x+[2]*TMath::Exp(-[3]*x)"); TF1* fK0Width = new TF1("fK0Width", "[0]+[1]*x+[2]*TMath::Exp(-[3]*x)"); @@ -314,7 +315,41 @@ struct hstrangecorrelationfilter { continue; } - assocPion( + assocHadrons( + track.collisionId(), + track.globalIndex()); + } + } + + void processAssocHadrons(soa::Join::iterator const& collision, soa::Filtered> const& tracks) + { + // Perform basic event selection + if (!collision.sel8()) { + return; + } + // No need to correlate stuff that's in far collisions + if (TMath::Abs(collision.posZ()) > 10.0) { + return; + } + + /// _________________________________________________ + /// Step 1: Populate table with trigger tracks + for (auto const& track : tracks) { + if (track.eta() > assocEtaMax || track.eta() < assocEtaMin) { + continue; + } + // if (track.sign()= 1 ) {continue;} + if (track.pt() > assocPtCutMax || track.pt() < assocPtCutMin) { + continue; + } + if (track.tpcNClsCrossedRows() < minTPCNCrossedRows) { + continue; // crossed rows + } + if (!track.hasITS() && triggerRequireITS) { + continue; // skip, doesn't have ITS signal (skips lots of TPC-only!) + } + + assocHadrons( track.collisionId(), track.globalIndex()); } @@ -494,6 +529,7 @@ struct hstrangecorrelationfilter { PROCESS_SWITCH(hstrangecorrelationfilter, processV0s, "Produce associated V0 tables", true); PROCESS_SWITCH(hstrangecorrelationfilter, processAssocPions, "Produce associated Pion tables", true); PROCESS_SWITCH(hstrangecorrelationfilter, processCascades, "Produce associated cascade tables", true); + PROCESS_SWITCH(hstrangecorrelationfilter, processAssocHadrons, "Produce associated Hadron tables", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx index 4e16c31f995..e1fe312d225 100644 --- a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx @@ -56,6 +56,7 @@ struct correlateStrangeness { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + Configurable doCorrelationHadron{"doCorrelationHadron", false, "do Hadron correlation"}; Configurable doCorrelationK0Short{"doCorrelationK0Short", true, "do K0Short correlation"}; Configurable doCorrelationLambda{"doCorrelationLambda", false, "do Lambda correlation"}; Configurable doCorrelationAntiLambda{"doCorrelationAntiLambda", false, "do AntiLambda correlation"}; @@ -152,6 +153,8 @@ struct correlateStrangeness { TH2F* hEfficiencyOmegaMinus; TH2F* hEfficiencyOmegaPlus; + TH2F* hEfficiencyHadron; + using BinningType = ColumnBinningPolicy; BinningType colBinning{{axisVtxZ, axisMult}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. @@ -159,15 +162,16 @@ struct correlateStrangeness { Preslice collisionSliceTracks = aod::triggerTracks::collisionId; Preslice collisionSliceV0s = aod::assocV0s::collisionId; Preslice collisionSliceCascades = aod::assocCascades::collisionId; - Preslice collisionSlicePions = aod::assocPions::collisionId; + // Preslice collisionSlicePions = aod::assocHadrons::collisionId; + Preslice collisionSliceHadrons = aod::assocHadrons::collisionId; Preslice perCollision = aod::mcparticle::mcCollisionId; static constexpr std::string_view v0names[] = {"K0Short", "Lambda", "AntiLambda"}; static constexpr std::string_view cascadenames[] = {"XiMinus", "XiPlus", "OmegaMinus", "OmegaPlus"}; - static constexpr std::string_view particlenames[] = {"K0Short", "Lambda", "AntiLambda", "XiMinus", "XiPlus", "OmegaMinus", "OmegaPlus", "Pion"}; + static constexpr std::string_view particlenames[] = {"K0Short", "Lambda", "AntiLambda", "XiMinus", "XiPlus", "OmegaMinus", "OmegaPlus", "Pion", "Hadron"}; static constexpr int pdgCodes[] = {310, 3122, -3122, 3312, -3312, 3334, -3334, 211}; - uint8_t doCorrelation; + uint16_t doCorrelation; int mRunNumber; std::vector> axisRanges; @@ -449,7 +453,7 @@ struct correlateStrangeness { } } - void fillCorrelationsPion(aod::TriggerTracks const& triggers, aod::AssocPions const& assocs, bool mixing, float pvz, float mult) + void fillCorrelationsHadron(aod::TriggerTracks const& triggers, aod::AssocHadrons const& assocs, bool mixing, float pvz, float mult, int indexAssoc) { for (auto& triggerTrack : triggers) { @@ -459,15 +463,20 @@ struct correlateStrangeness { if (!isValidTrigger(trigg)) continue; + static_for<7, 8>([&](auto i) { + constexpr int index = i.value; + if (bitcheck(doCorrelation, i)) { if (!mixing) - histos.fill(HIST("sameEvent/TriggerParticlesPion"), trigg.pt(), mult); + histos.fill(HIST("sameEvent/TriggerParticles") + HIST(particlenames[index]), trigg.pt(), mult); for (auto& assocTrack : assocs) { auto assoc = assocTrack.track_as(); + + //---] removing autocorrelations [--- if (doAutocorrelationRejection) { if (trigg.globalIndex() == assoc.globalIndex()) { - histos.fill(HIST("hNumberOfRejectedPairsPions"), 0.5); + histos.fill(HIST("hNumberOfRejectedPairs") + HIST(particlenames[index]), 0.5); continue; } } @@ -490,10 +499,11 @@ struct correlateStrangeness { continue; if (!mixing) - histos.fill(HIST("sameEvent/Pion"), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); + histos.fill(HIST("sameEvent/Signal/") + HIST(particlenames[index]), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); else - histos.fill(HIST("mixedEvent/Pion"), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); + histos.fill(HIST("mixedEvent/Signal/") + HIST(particlenames[index]), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult); } + } }); } } @@ -509,6 +519,8 @@ struct correlateStrangeness { hEfficiencyOmegaMinus = 0x0; hEfficiencyOmegaPlus = 0x0; + hEfficiencyHadron = 0x0; + // set bitmap for convenience doCorrelation = 0; if (doCorrelationK0Short) @@ -527,6 +539,8 @@ struct correlateStrangeness { bitset(doCorrelation, 6); if (doCorrelationPion) bitset(doCorrelation, 7); + if (doCorrelationHadron) + bitset(doCorrelation, 8); // Store axis ranges to prevent spurious filling // axis status: @@ -688,10 +702,12 @@ struct correlateStrangeness { histos.add("hClosureTestEventCounter", "hClosureTestEventCounter", kTH1F, {{10, 0, 10}}); + histos.add("hNumberOfRejectedPairsHadron", "hNumberOfRejectedPairsHadron", kTH1F, {{1, 0, 1}}); histos.add("hNumberOfRejectedPairsV0", "hNumberOfRejectedPairsV0", kTH1F, {{1, 0, 1}}); histos.add("hNumberOfRejectedPairsCascades", "hNumberOfRejectedPairsCascades", kTH1F, {{1, 0, 1}}); - histos.add("hNumberOfRejectedPairsPions", "hNumberOfRejectedPairsPions", kTH1F, {{1, 0, 1}}); + histos.add("hNumberOfRejectedPairsPion", "hNumberOfRejectedPairsPion", kTH1F, {{1, 0, 1}}); + histos.add("sameEvent/TriggerParticlesHadron", "TriggersHadron", kTH2F, {axisPtQA, axisMult}); histos.add("sameEvent/TriggerParticlesV0", "TriggersV0", kTH2F, {axisPtQA, axisMult}); histos.add("sameEvent/TriggerParticlesCascade", "TriggersCascade", kTH2F, {axisPtQA, axisMult}); histos.add("sameEvent/TriggerParticlesPion", "TriggersPion", kTH2F, {axisPtQA, axisMult}); @@ -712,23 +728,23 @@ struct correlateStrangeness { histos.add("hTriggerPtResolution", ";p_{T}^{reconstructed} (GeV/c); p_{T}^{generated} (GeV/c)", kTH2F, {axisPtQA, axisPtQA}); histos.add("hTriggerPrimaryEtaVsPt", "hTriggerPrimaryEtaVsPt", kTH3F, {axisPtQA, axisEta, axisMult}); histos.add("hTrackEtaVsPtVsPhi", "hTrackEtaVsPtVsPhi", kTH3F, {axisPtQA, axisEta, axisPhi}); + histos.add("hTrackAttempt", "Attempt", kTH3F, {axisPtQA, axisEta, axisPhi}); bool hStrange = false; - for (int i = 0; i < 8; i++) { - if ((doprocessSameEventHV0s && i < 3) || (doprocessSameEventHCascades && i > 2 && i < 7) || (doprocessSameEventHPions && i == 7)) - histos.add(fmt::format("h{}EtaVsPtVsPhi", particlenames[i]).c_str(), "", kTH3F, {axisPtQA, axisEta, axisPhi}); - if ((doprocessSameEventHV0s && i < 3) || (doprocessSameEventHCascades && i > 2 && i < 7)) - histos.add(fmt::format("h{}EtaVsPtVsPhiBg", particlenames[i]).c_str(), "", kTH3F, {axisPtQA, axisEta, axisPhi}); + for (int i = 0; i < 9; i++) { if (bitcheck(doCorrelation, i)) { - histos.add(fmt::format("hITSClusters{}NegativeDaughterToward", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); - histos.add(fmt::format("hITSClusters{}PositiveDaughterToward", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); - histos.add(fmt::format("hITSClusters{}NegativeDaughterTransverse", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); - histos.add(fmt::format("hITSClusters{}PositiveDaughterTransverse", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + histos.add(fmt::format("h{}EtaVsPtVsPhi", particlenames[i]).c_str(), "", kTH3F, {axisPtQA, axisEta, axisPhi}); histos.add(fmt::format("h3d{}Spectrum", particlenames[i]).c_str(), fmt::format("h3d{}Spectrum", particlenames[i]).c_str(), kTH3F, {axisPtQA, axisMult, axisMassNSigma}); histos.add(fmt::format("h3d{}SpectrumY", particlenames[i]).c_str(), fmt::format("h3d{}SpectrumY", particlenames[i]).c_str(), kTH3F, {axisPtQA, axisMult, axisMassNSigma}); histos.add(fmt::format("sameEvent/Signal/{}", particlenames[i]).c_str(), "", kTHnF, {axisDeltaPhiNDim, axisDeltaEtaNDim, axisPtAssocNDim, axisPtTriggerNDim, axisVtxZNDim, axisMultNDim}); - if (i < 7) + if (i < 7) { hStrange = true; + histos.add(fmt::format("h{}EtaVsPtVsPhiBg", particlenames[i]).c_str(), "", kTH3F, {axisPtQA, axisEta, axisPhi}); + histos.add(fmt::format("hITSClusters{}NegativeDaughterToward", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + histos.add(fmt::format("hITSClusters{}PositiveDaughterToward", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + histos.add(fmt::format("hITSClusters{}NegativeDaughterTransverse", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + histos.add(fmt::format("hITSClusters{}PositiveDaughterTransverse", particlenames[i]).c_str(), "", kTH3F, {axisPtAssoc, {8, -0.5, 7.5}, {20, 0, 10}}); + } } } if (hStrange) { @@ -738,7 +754,7 @@ struct correlateStrangeness { LOGF(info, "Init THnFs done"); // mixed-event correlation functions - if (doprocessMixedEventHV0s || doprocessMixedEventHCascades || doprocessMixedEventHPions) { + if (doprocessMixedEventHV0s || doprocessMixedEventHCascades || doprocessMixedEventHPions || doprocessMixedEventHHadrons) { histos.addClone("sameEvent/", "mixedEvent/"); } @@ -823,6 +839,61 @@ struct correlateStrangeness { } } + void processSameEventHHadrons(soa::Join::iterator const& collision, + aod::AssocHadrons const& assocHadrons, aod::TriggerTracks const& triggerTracks, + TracksComplete const&, aod::BCsWithTimestamps const&) + { + // ________________________________________________ + // skip if desired trigger not found + if (triggerPresenceMap.size() > 0 && !bitcheck(triggerPresenceMap[collision.globalIndex()], triggerBinToSelect)) { + return; + } + + // ________________________________________________ + // Perform basic event selection + if (!collision.sel8()) { + return; + } + if (TMath::Abs(collision.posZ()) > zVertexCut) { + return; + } + if (collision.centFT0M() > axisRanges[5][1] || collision.centFT0M() < axisRanges[5][0]) { + return; + } + if (!collision.isInelGt0() && selectINELgtZERO) { + return; + } + // ________________________________________________ + if (!doprocessSameEventHCascades && !doprocessSameEventHV0s && !doprocessSameEventHPions) { + histos.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({collision.posZ(), collision.centFT0M()})); + histos.fill(HIST("EventQA/hMult"), collision.centFT0M()); + histos.fill(HIST("EventQA/hPvz"), collision.posZ()); + } + + // Do basic QA + for (auto const& hadron : assocHadrons) { + auto hadronTrack = hadron.track_as(); + histos.fill(HIST("hHadronEtaVsPtVsPhi"), hadronTrack.pt(), hadronTrack.eta(), hadronTrack.phi()); + } + if (!doprocessSameEventHCascades && !doprocessSameEventHV0s && !doprocessSameEventHPions) { + for (auto const& triggerTrack : triggerTracks) { + auto track = triggerTrack.track_as(); + if (!isValidTrigger(track)) + continue; + histos.fill(HIST("hTriggerAllSelectedEtaVsPt"), track.pt(), track.eta(), collision.centFT0M()); + histos.fill(HIST("hTriggerPtResolution"), track.pt(), triggerTrack.mcOriginalPt()); + if (doTriggPhysicalPrimary && !triggerTrack.mcPhysicalPrimary()) + continue; + histos.fill(HIST("hTriggerPrimaryEtaVsPt"), track.pt(), track.eta(), collision.centFT0M()); + histos.fill(HIST("hTrackEtaVsPtVsPhi"), track.pt(), track.eta(), track.phi()); + } + } + + // ________________________________________________ + // Do hadron - hadron correlations + fillCorrelationsHadron(triggerTracks, assocHadrons, false, collision.posZ(), collision.centFT0M(), 7); + } + void processSameEventHV0s(soa::Join::iterator const& collision, aod::AssocV0s const& associatedV0s, aod::TriggerTracks const& triggerTracks, V0DatasWithoutTrackX const&, aod::V0sLinked const&, TracksComplete const&, aod::BCsWithTimestamps const&) @@ -1023,7 +1094,7 @@ struct correlateStrangeness { fillCorrelationsCascade(triggerTracks, associatedCascades, false, collision.posX(), collision.posY(), collision.posZ(), collision.centFT0M()); } void processSameEventHPions(soa::Join::iterator const& collision, - aod::AssocPions const& associatedPions, aod::TriggerTracks const& triggerTracks, + aod::AssocHadrons const& associatedPions, aod::TriggerTracks const& triggerTracks, TracksComplete const&, aod::BCsWithTimestamps const&) { // ________________________________________________ @@ -1073,8 +1144,51 @@ struct correlateStrangeness { // ________________________________________________ // Do hadron - Pion correlations - fillCorrelationsPion(triggerTracks, associatedPions, false, collision.posZ(), collision.centFT0M()); + fillCorrelationsHadron(triggerTracks, associatedPions, false, collision.posZ(), collision.centFT0M(), 8); + } + + void processMixedEventHHadrons(soa::Join const& collisions, + aod::AssocHadrons const& assocHadrons, aod::TriggerTracks const& triggerTracks, + TracksComplete const&) + { + for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, mixingParameter, -1, collisions, collisions)) { + + // ________________________________________________ + // skip if desired trigger not found + if (triggerPresenceMap.size() > 0 && (!bitcheck(triggerPresenceMap[collision1.globalIndex()], triggerBinToSelect) || !bitcheck(triggerPresenceMap[collision2.globalIndex()], triggerBinToSelect))) { + return; + } + + // ________________________________________________ + // Perform basic event selection on both collisions + if (!collision1.sel8() || !collision2.sel8()) + continue; + if (TMath::Abs(collision1.posZ()) > zVertexCut || TMath::Abs(collision2.posZ()) > zVertexCut) + continue; + if (collision1.centFT0M() > axisRanges[5][1] || collision1.centFT0M() < axisRanges[5][0]) + continue; + if (collision2.centFT0M() > axisRanges[5][1] || collision2.centFT0M() < axisRanges[5][0]) + continue; + if ((!collision1.isInelGt0() || !collision2.isInelGt0()) && selectINELgtZERO) + continue; + + if (collision1.globalIndex() == collision2.globalIndex()) { + histos.fill(HIST("MixingQA/hMixingQA"), 0.0f); // same-collision pair counting + } + + histos.fill(HIST("MixingQA/hMEpvz1"), collision1.posZ()); + histos.fill(HIST("MixingQA/hMEpvz2"), collision2.posZ()); + histos.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), collision1.centFT0M()})); + // ________________________________________________ + // Do slicing + auto slicedTriggerTracks = triggerTracks.sliceBy(collisionSliceTracks, collision1.globalIndex()); + auto slicedAssocHadrons = assocHadrons.sliceBy(collisionSliceHadrons, collision2.globalIndex()); + // ________________________________________________ + // Do hadron - hadron correlations + fillCorrelationsHadron(slicedTriggerTracks, slicedAssocHadrons, true, collision1.posZ(), collision1.centFT0M(), 7); + } } + void processMixedEventHV0s(soa::Join const& collisions, aod::AssocV0s const& associatedV0s, aod::TriggerTracks const& triggerTracks, V0DatasWithoutTrackX const&, aod::V0sLinked const&, TracksComplete const&, aod::BCsWithTimestamps const&) @@ -1165,7 +1279,7 @@ struct correlateStrangeness { } } void processMixedEventHPions(soa::Join const& collisions, - aod::AssocPions const& assocPions, aod::TriggerTracks const& triggerTracks, + aod::AssocHadrons const& assocPions, aod::TriggerTracks const& triggerTracks, TracksComplete const&) { for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, mixingParameter, -1, collisions, collisions)) { @@ -1199,10 +1313,10 @@ struct correlateStrangeness { // ________________________________________________ // Do slicing auto slicedTriggerTracks = triggerTracks.sliceBy(collisionSliceTracks, collision1.globalIndex()); - auto slicedAssocPions = assocPions.sliceBy(collisionSlicePions, collision2.globalIndex()); + auto slicedAssocPions = assocPions.sliceBy(collisionSliceHadrons, collision2.globalIndex()); // ________________________________________________ // Do hadron - cascade correlations - fillCorrelationsPion(slicedTriggerTracks, slicedAssocPions, true, collision1.posZ(), collision1.centFT0M()); + fillCorrelationsHadron(slicedTriggerTracks, slicedAssocPions, true, collision1.posZ(), collision1.centFT0M(), 8); } } @@ -1451,16 +1565,9 @@ struct correlateStrangeness { continue; } if (abs(mcParticle.pdgCode()) == 211 || abs(mcParticle.pdgCode()) == 321 || abs(mcParticle.pdgCode()) == 2212 || abs(mcParticle.pdgCode()) == 11 || abs(mcParticle.pdgCode()) == 13) { - Int_t charge = 0; - if (mcParticle.pdgCode() < 0) - charge = -1; - if (mcParticle.pdgCode() > 0) - charge = 1; if (!doTriggPhysicalPrimary || mcParticle.isPhysicalPrimary()) { - if ((triggerParticleCharge > 0 && charge > 0) || (triggerParticleCharge < 0 && charge < 0) || triggerParticleCharge == 0) { - triggerIndices.emplace_back(iteratorNum); - histos.fill(HIST("ClosureTest/hTrigger"), gpt, geta, bestCollisionFT0Mpercentile); - } + triggerIndices.emplace_back(iteratorNum); + histos.fill(HIST("ClosureTest/hTrigger"), gpt, geta, bestCollisionFT0Mpercentile); } } if (!doAssocPhysicalPrimary || mcParticle.isPhysicalPrimary()) { @@ -1545,15 +1652,19 @@ struct correlateStrangeness { } } - PROCESS_SWITCH(correlateStrangeness, processSelectEventWithTrigger, "Select events with trigger only", false); + PROCESS_SWITCH(correlateStrangeness, processSelectEventWithTrigger, "Select events with trigger only", true); PROCESS_SWITCH(correlateStrangeness, processSameEventHV0s, "Process same events, h-V0s", true); PROCESS_SWITCH(correlateStrangeness, processSameEventHCascades, "Process same events, h-Cascades", true); PROCESS_SWITCH(correlateStrangeness, processSameEventHPions, "Process same events, h-Pion", true); + PROCESS_SWITCH(correlateStrangeness, processSameEventHHadrons, "Process same events, h-h", true); + PROCESS_SWITCH(correlateStrangeness, processMixedEventHV0s, "Process mixed events, h-V0s", true); PROCESS_SWITCH(correlateStrangeness, processMixedEventHCascades, "Process mixed events, h-Cascades", true); PROCESS_SWITCH(correlateStrangeness, processMixedEventHPions, "Process mixed events, h-Pion", true); - PROCESS_SWITCH(correlateStrangeness, processMCGenerated, "Process MC generated", true); - PROCESS_SWITCH(correlateStrangeness, processClosureTest, "Process Closure Test", true); + PROCESS_SWITCH(correlateStrangeness, processMixedEventHHadrons, "Process mixed events, h-h", true); + + PROCESS_SWITCH(correlateStrangeness, processMCGenerated, "Process MC generated", false); + PROCESS_SWITCH(correlateStrangeness, processClosureTest, "Process Closure Test", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 5312de2a7c89ad311f895991afed6b95be8c42ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 2 Dec 2024 07:59:32 +0100 Subject: [PATCH 202/459] [Common] [TOF] fix parameters for negative tracks (#8753) --- Common/TableProducer/PID/pidTOFMerge.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/TableProducer/PID/pidTOFMerge.cxx b/Common/TableProducer/PID/pidTOFMerge.cxx index df682d4ffb8..e2c5489ab65 100644 --- a/Common/TableProducer/PID/pidTOFMerge.cxx +++ b/Common/TableProducer/PID/pidTOFMerge.cxx @@ -206,7 +206,7 @@ struct TOFCalibConfig { const std::string nameShiftPos = metadataInfo.isMC() ? mTimeShiftCCDBPathPosMC : mTimeShiftCCDBPathPos; updateTimeShift(nameShiftPos, true); const std::string nameShiftNeg = metadataInfo.isMC() ? mTimeShiftCCDBPathNegMC : mTimeShiftCCDBPathNeg; - updateTimeShift(nameShiftNeg, true); + updateTimeShift(nameShiftNeg, false); // Calibration object is defined LOG(info) << "Parametrization at init time:"; @@ -690,7 +690,7 @@ struct tofEventTime { if constexpr (removeTOFEvTimeBias) { evTimeMakerTOF.removeBias(trk, nGoodTracksForTOF, t0TOF[0], t0TOF[1], 2); } - if (t0TOF[1] < errDiamond && (maxEvTimeTOF <= 0 || abs(t0TOF[0]) < maxEvTimeTOF)) { + if (t0TOF[1] < errDiamond && (maxEvTimeTOF <= 0 || std::abs(t0TOF[0]) < maxEvTimeTOF)) { flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF; weight = 1.f / (t0TOF[1] * t0TOF[1]); @@ -754,7 +754,7 @@ struct tofEventTime { evTimeMakerTOF.removeBias(trk, nGoodTracksForTOF, et, erret, 2); } uint8_t flags = 0; - if (erret < errDiamond && (maxEvTimeTOF <= 0.f || abs(et) < maxEvTimeTOF)) { + if (erret < errDiamond && (maxEvTimeTOF <= 0.f || std::abs(et) < maxEvTimeTOF)) { flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF; } else { et = 0.f; From d4d9320e0603bee44c3cc3910f9099366862904b Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Mon, 2 Dec 2024 09:17:27 +0100 Subject: [PATCH 203/459] Fix wrong type for receiving container (#8762) --- DPG/Tasks/AOTEvent/eventSelectionQa.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx index a4069a27764..f378cb2acd2 100644 --- a/DPG/Tasks/AOTEvent/eventSelectionQa.cxx +++ b/DPG/Tasks/AOTEvent/eventSelectionQa.cxx @@ -581,7 +581,7 @@ struct EventSelectionQaTask { metadata["runNumber"] = Form("%d", run); o2::itsmft::TimeDeadMap* itsDeadMap = ccdb->getSpecific("ITS/Calib/TimeDeadMap", (tsSOR + tsEOR) / 2, metadata); - std::vector itsDeadMapOrbits = itsDeadMap->getEvolvingMapKeys(); // roughly every second, ~350 TFs = 350x32 orbits + auto itsDeadMapOrbits = itsDeadMap->getEvolvingMapKeys(); // roughly every second, ~350 TFs = 350x32 orbits std::vector itsDeadMapOrbitsDouble(itsDeadMapOrbits.begin(), itsDeadMapOrbits.end()); const AxisSpec axisItsDeadMapOrbits{itsDeadMapOrbitsDouble}; From c1a55ff5a3e61734efeb3e62b4423394b8e760fd Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Mon, 2 Dec 2024 09:19:11 +0100 Subject: [PATCH 204/459] Drop unneeded semicolon (#8763) --- Common/TableProducer/multiplicityTable.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/TableProducer/multiplicityTable.cxx b/Common/TableProducer/multiplicityTable.cxx index 7c36fe4363e..6d468282b55 100644 --- a/Common/TableProducer/multiplicityTable.cxx +++ b/Common/TableProducer/multiplicityTable.cxx @@ -9,10 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include ; -#include ; -#include ; -#include ; +#include +#include +#include +#include #include "Framework/ConfigParamSpec.h" #include "Framework/runDataProcessing.h" From 7ebe44a48b0e96631ae80776e65dffc689ac75a5 Mon Sep 17 00:00:00 2001 From: choich08365 <157435123+choich08365@users.noreply.github.com> Date: Mon, 2 Dec 2024 23:00:09 +0900 Subject: [PATCH 205/459] [PWGJE] Add an extra table and vertexClustering function for GNN b-jet tagging (#8597) Co-authored-by: chchoi --- PWGJE/Core/JetTaggingUtilities.h | 173 +++++++++++++++++++++++ PWGJE/Tasks/bjetTreeCreator.cxx | 227 ++++++++++++++++++++++++++++++- 2 files changed, 399 insertions(+), 1 deletion(-) diff --git a/PWGJE/Core/JetTaggingUtilities.h b/PWGJE/Core/JetTaggingUtilities.h index 8f5c44362e1..c607a44c6da 100644 --- a/PWGJE/Core/JetTaggingUtilities.h +++ b/PWGJE/Core/JetTaggingUtilities.h @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include "TF1.h" #include "Framework/Logger.h" @@ -629,6 +631,177 @@ bool isTaggedJetSV(T const jet, U const& /*prongs*/, float const& prongChi2PCAMi return true; } +/** + * Clusters jet constituent tracks into groups of tracks originating from same mcParticle position (trkVtxIndex), and finds each track origin (trkOrigin). (for GNN b-jet tagging) + * @param trkLabels Track labels for GNN vertex and track origin predictions. trkVtxIndex: The index value of each vertex (cluster) which is determined by the function. trkOrigin: The category of the track origin (0: not physical primary, 1: charm, 2: beauty, 3: primary vertex, 4: other secondary vertex). + * @param vtxResParam Vertex resolution parameter which determines the cluster size. (cm) + * @param trackPtMin Minimum value of track pT. + * @return The number of vertices (clusters) in the jet. + */ +template +int vertexClustering(AnyCollision const& collision, AnalysisJet const& jet, AnyTracks const&, AnyParticles const& particles, AnyOriginalParticles const&, std::unordered_map>& trkLabels, bool searchUpToQuark, float vtxResParam = 0.01 /* 0.01cm = 100um */, float trackPtMin = 0.5) +{ + const auto& tracks = jet.template tracks_as(); + const int n_trks = tracks.size(); + + // trkVtxIndex + + std::vector tempTrkVtxIndex; + + int i = 0; + for (const auto& constituent : tracks) { + if (!constituent.has_mcParticle() || !constituent.template mcParticle_as().isPhysicalPrimary() || constituent.pt() < trackPtMin) + tempTrkVtxIndex.push_back(-1); + else + tempTrkVtxIndex.push_back(i++); + } + tempTrkVtxIndex.push_back(i); // temporary index for PV + if (n_trks < 1) { // the process should be done for n_trks == 1 as well + trkLabels["trkVtxIndex"] = tempTrkVtxIndex; + return n_trks; + } + + int n_pos = n_trks + 1; + std::vector dists(n_pos * (n_pos - 1) / 2); + auto trk_pair_idx = [n_pos](int ti, int tj) { + if (ti == tj || ti >= n_pos || tj >= n_pos || ti < 0 || tj < 0) { + LOGF(info, "Track pair index out of range"); + return -1; + } else { + return (ti < tj) ? (ti * n_pos - (ti * (ti + 1)) / 2 + tj - ti - 1) : (tj * n_pos - (tj * (tj + 1)) / 2 + ti - tj - 1); + } + }; // index n_trks is for PV + + for (int ti = 0; ti < n_pos - 1; ti++) + for (int tj = ti + 1; tj < n_pos; tj++) { + std::array posi, posj; + + if (tj < n_trks) { + if (tracks[tj].has_mcParticle()) { + const auto& pj = tracks[tj].template mcParticle_as().template mcParticle_as(); + posj = std::array{pj.vx(), pj.vy(), pj.vz()}; + } else { + dists[trk_pair_idx(ti, tj)] = std::numeric_limits::max(); + continue; + } + } else { + posj = std::array{collision.posX(), collision.posY(), collision.posZ()}; + } + + if (tracks[ti].has_mcParticle()) { + const auto& pi = tracks[ti].template mcParticle_as().template mcParticle_as(); + posi = std::array{pi.vx(), pi.vy(), pi.vz()}; + } else { + dists[trk_pair_idx(ti, tj)] = std::numeric_limits::max(); + continue; + } + + dists[trk_pair_idx(ti, tj)] = RecoDecay::distance(posi, posj); + } + + int clusteri = -1, clusterj = -1; + float min_min_dist = -1.f; // If there is an not-merge-able min_dist pair, check the 2nd-min_dist pair. + while (true) { + + float min_dist = -1.f; // Get min_dist pair + for (int ti = 0; ti < n_pos - 1; ti++) + for (int tj = ti + 1; tj < n_pos; tj++) + if (tempTrkVtxIndex[ti] != tempTrkVtxIndex[tj] && tempTrkVtxIndex[ti] >= 0 && tempTrkVtxIndex[tj] >= 0) { + float dist = dists[trk_pair_idx(ti, tj)]; + if ((dist < min_dist || min_dist < 0.f) && dist > min_min_dist) { + min_dist = dist; + clusteri = ti; + clusterj = tj; + } + } + if (clusteri < 0 || clusterj < 0) + break; + + bool mrg = true; // Merge-ability check + for (int ti = 0; ti < n_pos && mrg; ti++) + if (tempTrkVtxIndex[ti] == tempTrkVtxIndex[clusteri] && tempTrkVtxIndex[ti] >= 0) { + for (int tj = 0; tj < n_pos && mrg; tj++) + if (tj != ti && tempTrkVtxIndex[tj] == tempTrkVtxIndex[clusterj] && tempTrkVtxIndex[tj] >= 0) { + if (dists[trk_pair_idx(ti, tj)] > vtxResParam) { // If there is more distant pair compared to vtx_res between two clusters, they cannot be merged. + mrg = false; + min_min_dist = min_dist; + } + } + } + if (min_dist > vtxResParam || min_dist < 0.f) + break; + + if (mrg) { // Merge two clusters + int old_index = tempTrkVtxIndex[clusterj]; + for (int t = 0; t < n_pos; t++) + if (tempTrkVtxIndex[t] == old_index) + tempTrkVtxIndex[t] = tempTrkVtxIndex[clusteri]; + } + } + + int n_vertices = 0; + + // Sort the indices from PV (as 0) to the most distant SV (as 1~). + int idxPV = tempTrkVtxIndex[n_trks]; + for (int t = 0; t < n_trks; t++) + if (tempTrkVtxIndex[t] == idxPV) { + tempTrkVtxIndex[t] = -2; + n_vertices = 1; // There is a track originating from PV + } + + std::unordered_map avgDistances; + std::unordered_map count; + for (int t = 0; t < n_trks; t++) { + if (tempTrkVtxIndex[t] >= 0) { + avgDistances[tempTrkVtxIndex[t]] += dists[trk_pair_idx(t, n_trks)]; + count[tempTrkVtxIndex[t]]++; + } + } + + trkLabels["trkVtxIndex"] = std::vector(n_trks, -1); + if (count.size() != 0) { // If there is any SV cluster not only PV cluster + for (auto& [idx, avgDistance] : avgDistances) + avgDistance /= count[idx]; + + n_vertices += avgDistances.size(); + + std::vector> sortedIndices(avgDistances.begin(), avgDistances.end()); + std::sort(sortedIndices.begin(), sortedIndices.end(), [](const auto& a, const auto& b) { return a.second < b.second; }); + int rank = 1; + for (const auto& [idx, avgDistance] : sortedIndices) { + bool found = false; + for (int t = 0; t < n_trks; t++) + if (tempTrkVtxIndex[t] == idx) { + trkLabels["trkVtxIndex"][t] = rank; + found = true; + } + rank += found; + } + } + + for (int t = 0; t < n_trks; t++) + if (tempTrkVtxIndex[t] == -2) + trkLabels["trkVtxIndex"][t] = 0; + + // trkOrigin + + int trkIdx = 0; + for (auto& constituent : jet.template tracks_as()) { + if (!constituent.has_mcParticle() || !constituent.template mcParticle_as().isPhysicalPrimary() || constituent.pt() < trackPtMin) { + trkLabels["trkOrigin"].push_back(0); + } else { + const auto& particle = constituent.template mcParticle_as(); + int orig = RecoDecay::getParticleOrigin(particles, particle, searchUpToQuark); + trkLabels["trkOrigin"].push_back((orig > 0) ? orig : (trkLabels["trkVtxIndex"][trkIdx] == 0) ? 3 + : 4); + } + + trkIdx++; + } + + return n_vertices; +} + }; // namespace jettaggingutilities #endif // PWGJE_CORE_JETTAGGINGUTILITIES_H_ diff --git a/PWGJE/Tasks/bjetTreeCreator.cxx b/PWGJE/Tasks/bjetTreeCreator.cxx index 2d60344085a..5c291077d81 100644 --- a/PWGJE/Tasks/bjetTreeCreator.cxx +++ b/PWGJE/Tasks/bjetTreeCreator.cxx @@ -15,6 +15,11 @@ /// /// \author Hadi Hassan , University of Jyväskylä +#include +#include +#include +#include + #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" #include "Framework/ASoA.h" @@ -81,6 +86,15 @@ DECLARE_SOA_COLUMN(SignedIP3D, ip3d, float); //! The t DECLARE_SOA_COLUMN(SignedIP3DSign, ip3dsigma, float); //! The track signed 3D IP significance DECLARE_SOA_COLUMN(MomFraction, momfraction, float); //! The track momentum fraction of the jets DECLARE_SOA_COLUMN(DeltaRTrackVertex, rtrackvertex, float); //! DR between the track and the closest SV, to be decided whether to add to or not +DECLARE_SOA_COLUMN(TrackPhi, trackphi, float); //! The track phi +DECLARE_SOA_COLUMN(TrackCharge, trackcharge, float); //! The track sign (charge) +DECLARE_SOA_COLUMN(TrackITSChi2NCl, trackitschi2ncl, float); //! The track ITS Chi2NCl +DECLARE_SOA_COLUMN(TrackTPCChi2NCl, tracktpcchi2ncl, float); //! The track TPC Chi2NCl +DECLARE_SOA_COLUMN(TrackITSNCls, trackitsncls, float); //! The track ITS NCls +DECLARE_SOA_COLUMN(TrackTPCNCls, tracktpcncls, float); //! The track TPC NCls (Found) +DECLARE_SOA_COLUMN(TrackTPCNCrossedRows, tracktpcncrossedrows, float); //! The track TPC NCrossedRows +DECLARE_SOA_COLUMN(TrackOrigin, trk_origin, int); //! The track origin label for GNN track origin predictions +DECLARE_SOA_COLUMN(TrackVtxIndex, trk_vtx_index, int); //! The track vertex index for GNN vertex predictions // DECLARE_SOA_COLUMN(DCATrackJet, dcatrackjet, float); //! The distance between track and jet, unfortunately it cannot be calculated in O2 } // namespace trackInfo @@ -101,6 +115,20 @@ DECLARE_SOA_TABLE(bjetTracksParams, "AOD", "BJETTRACKSPARAM", using bjetTracksParam = bjetTracksParams::iterator; +DECLARE_SOA_TABLE(bjetTracksParamsExtra, "AOD", "BJETTRACKSEXTRA", + // o2::soa::Index<>, + trackInfo::TrackPhi, + trackInfo::TrackCharge, + trackInfo::TrackITSChi2NCl, + trackInfo::TrackTPCChi2NCl, + trackInfo::TrackITSNCls, + trackInfo::TrackTPCNCls, + trackInfo::TrackTPCNCrossedRows, + trackInfo::TrackOrigin, + trackInfo::TrackVtxIndex); + +using bjetTracksParamExtra = bjetTracksParamsExtra::iterator; + namespace SVInfo { DECLARE_SOA_INDEX_COLUMN(bjetParam, jetindex); //! The jet index @@ -154,6 +182,7 @@ struct BJetTreeCreator { Produces bjetParamsTable; Produces bjetTracksParamsTable; + Produces bjetTracksExtraTable; Produces bjetSVParamsTable; Produces bjetConstituentsTable; @@ -196,6 +225,8 @@ struct BJetTreeCreator { Configurable produceTree{"produceTree", true, "produce the jet TTree"}; + Configurable vtxRes{"vtxRes", 0.01, "Vertex position resolution (cluster size) for GNN vertex predictions (cm)"}; + int eventSelection = -1; std::vector jetRadiiValues; @@ -225,7 +256,7 @@ struct BJetTreeCreator { registry.add("h2_jetMass_jetpT", "Jet mass;#it{p}_{T,jet} (GeV/#it{c});#it{m}_{jet} (GeV/#it{c}^{2})", {HistType::kTH2F, {{200, 0., 200.}, {50, 0, 50.0}}}); registry.add("h2_SVMass_jetpT", "Secondary vertex mass;#it{p}_{T,jet} (GeV/#it{c});#it{m}_{SV} (GeV/#it{c}^{2})", {HistType::kTH2F, {{200, 0., 200.}, {50, 0, 10}}}); - if (doprocessMCJets) { + if (doprocessMCJets || doprocessMCJetsForGNN) { registry.add("h2_SIPs2D_jetpT_bjet", "2D IP significance b-jets;#it{p}_{T,jet} (GeV/#it{c});IPs", {HistType::kTH2F, {{200, 0., 200.}, {100, -50.0, 50.0}}}); registry.add("h2_SIPs3D_jetpT_bjet", "3D IP significance b-jets;#it{p}_{T,jet} (GeV/#it{c});IPs", {HistType::kTH2F, {{200, 0., 200.}, {100, -50.0, 50.0}}}); registry.add("h2_LxyS_jetpT_bjet", "Decay length in XY b-jets;#it{p}_{T,jet} (GeV/#it{c});S#it{L}_{xy}", {HistType::kTH2F, {{200, 0., 200.}, {100, 0., 100.0}}}); @@ -259,6 +290,46 @@ struct BJetTreeCreator { registry.add("h2_Response_DetjetpT_PartjetpT_cjet", "Response matrix c-jets;#it{p}_{T,jet}^{det} (GeV/#it{c});#it{p}_{T,jet}^{part} (GeV/#it{c})", {HistType::kTH2F, {{200, 0., 200.}, {200, 0., 200.}}}); registry.add("h2_Response_DetjetpT_PartjetpT_lfjet", "Response matrix lf-jet;#it{p}_{T,jet}^{det} (GeV/#it{c});#it{p}_{T,jet}^{part} (GeV/#it{c})", {HistType::kTH2F, {{200, 0., 200.}, {200, 0., 200.}}}); } + + if (doprocessMCJetsForGNN) { + //+jet + registry.add("h_jet_pt", "jet_pt;#it{p}_{T}^{ch jet} (GeV/#it{c});Entries", {HistType::kTH1F, {{100, 0., 200.}}}); + registry.add("h_jet_eta", "jet_eta;#it{#eta}_{ch jet};Entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("h_jet_phi", "jet_phi;#it{#phi}_{ch jet};Entries", {HistType::kTH1F, {{100, 0., 2. * M_PI}}}); + registry.add("h_jet_flav", "jet_flav;jet flavor;Entries", {HistType::kTH1F, {{4, 0., 4.}}}); + registry.add("h_n_trks", "n_trks;#it{n}_{tracks};Entries", {HistType::kTH1F, {{50, 0., 50.}}}); + registry.add("h_jet_mass", "jet_mass;#it{m}_{jet} (GeV/#it{c}^2);Entries", {HistType::kTH1F, {{100, 0., 50.}}}); + auto h_jet_flav = registry.get(HIST("h_jet_flav")); + h_jet_flav->GetXaxis()->SetBinLabel(1, "no mcparticle"); // 0 + h_jet_flav->GetXaxis()->SetBinLabel(2, "c-jet"); // 1 + h_jet_flav->GetXaxis()->SetBinLabel(3, "b-jet"); // 2 + h_jet_flav->GetXaxis()->SetBinLabel(4, "lf-jet"); // 3 + registry.add("h_n_vertices", "n_vertices;#it{n}_{vertex};Entries", {HistType::kTH1F, {{50, 0., 50.}}}); + //+trk + registry.add("h_trk_pt", "trk_pt;#it{p}_{T} (GeV/#it{c});Entries", {HistType::kTH1F, {{100, 0., 100.}}}); + registry.add("h_trk_eta", "trk_eta;#it{#eta};Entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("h_trk_phi", "trk_phi;#it{#phi};Entries", {HistType::kTH1F, {{100, 0., 2. * M_PI}}}); + registry.add("h_trk_charge", "trk_charge;#it{q};Entries", {HistType::kTH1F, {{3, -1.5, 1.5}}}); + registry.add("h_trk_dcaxy", "trk_dcaxy;#it{DCA}_{xy} (cm);Entries", {HistType::kTH1F, {{100, -0.1, 0.1}}}); + registry.add("h_trk_dcaxyz", "trk_dcaxyz;#it{DCA}_{xyz} (cm);Entries", {HistType::kTH1F, {{100, -0.1, 0.1}}}); + registry.add("h_trk_sigmadcaxy", "trk_sigmadcaxy;#it{#sigma}_{#it{DCA}_{xy}} (cm);Entries", {HistType::kTH1F, {{100, 0., 0.1}}}); + registry.add("h_trk_sigmadcaxyz", "trk_sigmadcaxyz;#it{#sigma}_{#it{DCA}_{xyz}} (cm);Entries", {HistType::kTH1F, {{100, 0., 0.1}}}); + registry.add("h_trk_itsncls", "trk_itsncls;ITS NCls;Entries", {HistType::kTH1F, {{10, 0., 10.}}}); + registry.add("h_trk_tpcncls", "trk_tpcncls;TPC NCls (Found);Entries", {HistType::kTH1F, {{200, 0., 200.}}}); + registry.add("h_trk_tpcncrs", "trk_tpcncrs;TPC NCrossedRows;Entries", {HistType::kTH1F, {{200, 0., 200.}}}); + registry.add("h_trk_itschi2ncl", "trk_itschi2ncl;ITS #it{#chi}^{2}/ndf;Entries", {HistType::kTH1F, {{100, 0., 20.}}}); + registry.add("h_trk_tpcchi2ncl", "trk_tpcchi2ncl;TPC #it{#chi}^{2}/ndf;Entries", {HistType::kTH1F, {{100, 0., 10.}}}); + registry.add("h_jtrack_counter", "jtrack counter", {HistType::kTH1F, {{1, 0., 1.}}}); + registry.add("h2_trk_jtrackpt_vs_origtrackpt", "JTracks::pt vs Tracks::pt", {HistType::kTH2F, {{100, 0., 100.}, {100, 0., 100.}}}); + registry.add("h_trk_vtx_index", "trk_vtx_index;Vertex index;Entries", {HistType::kTH1F, {{20, 0., 20.}}}); + registry.add("h_trk_origin", "trk_origin;Track origin;Entries", {HistType::kTH1F, {{5, 0., 5.}}}); + auto h_trk_origin = registry.get(HIST("h_trk_origin")); + h_trk_origin->GetXaxis()->SetBinLabel(1, "NotPhysPrim"); + h_trk_origin->GetXaxis()->SetBinLabel(2, "Charm"); + h_trk_origin->GetXaxis()->SetBinLabel(3, "Beauty"); + h_trk_origin->GetXaxis()->SetBinLabel(4, "Primary"); + h_trk_origin->GetXaxis()->SetBinLabel(5, "OtherSecondary"); + } } // FIXME filtering only works when you loop directly over the list, but if you loop over it as a constituent they will not be filtered @@ -272,6 +343,8 @@ struct BJetTreeCreator { using JetTracksMCDwID = soa::Filtered>; using DataJets = soa::Filtered>; + using OriginalTracks = soa::Join; + // Function to get the reduction factor based on jet pT double getReductionFactor(double jetPT) { @@ -347,6 +420,8 @@ struct BJetTreeCreator { } } + using TrackLabelMap = std::unordered_map>; + template void analyzeJetTrackInfo(AnyCollision const& /*collision*/, AnalysisJet const& analysisJet, AnyTracks const& /*allTracks*/, SecondaryVertices const& /*allSVs*/, std::vector& trackIndices, int jetFlavor = 0, double eventweight = 1.0) { @@ -392,6 +467,77 @@ struct BJetTreeCreator { } } + template + void analyzeJetTrackInfoForGNN(AnyCollision const& /*collision*/, AnalysisJet const& analysisJet, AnyTracks const& /*allTracks*/, AnyOriginalTracks const&, std::vector& trackIndices, int jetFlavor = 0, double eventweight = 1.0, TrackLabelMap* trkLabels = nullptr) + { + int trkIdx = -1; + for (auto& constituent : analysisJet.template tracks_as()) { + + trkIdx++; + + if (constituent.pt() < trackPtMin) { + continue; + } + + double deltaRJetTrack = jetutilities::deltaR(analysisJet, constituent); + double dotProduct = RecoDecay::dotProd(std::array{analysisJet.px(), analysisJet.py(), analysisJet.pz()}, std::array{constituent.px(), constituent.py(), constituent.pz()}); + int sign = jettaggingutilities::getGeoSign(analysisJet, constituent); + + registry.fill(HIST("h2_SIPs2D_jetpT"), analysisJet.pt(), sign * std::abs(constituent.dcaXY()) / constituent.sigmadcaXY(), eventweight); + registry.fill(HIST("h2_SIPs3D_jetpT"), analysisJet.pt(), sign * std::abs(constituent.dcaXYZ()) / constituent.sigmadcaXYZ(), eventweight); + + if (doprocessMCJetsForGNN) { + if (jetFlavor == 2) { + registry.fill(HIST("h2_SIPs2D_jetpT_bjet"), analysisJet.pt(), sign * std::abs(constituent.dcaXY()) / constituent.sigmadcaXY(), eventweight); + registry.fill(HIST("h2_SIPs3D_jetpT_bjet"), analysisJet.pt(), sign * std::abs(constituent.dcaXYZ()) / constituent.sigmadcaXYZ(), eventweight); + } else if (jetFlavor == 1) { + registry.fill(HIST("h2_SIPs2D_jetpT_cjet"), analysisJet.pt(), sign * std::abs(constituent.dcaXY()) / constituent.sigmadcaXY(), eventweight); + registry.fill(HIST("h2_SIPs3D_jetpT_cjet"), analysisJet.pt(), sign * std::abs(constituent.dcaXYZ()) / constituent.sigmadcaXYZ(), eventweight); + } else { + registry.fill(HIST("h2_SIPs2D_jetpT_lfjet"), analysisJet.pt(), sign * std::abs(constituent.dcaXY()) / constituent.sigmadcaXY(), eventweight); + registry.fill(HIST("h2_SIPs3D_jetpT_lfjet"), analysisJet.pt(), sign * std::abs(constituent.dcaXYZ()) / constituent.sigmadcaXYZ(), eventweight); + } + + auto origConstit = constituent.template track_as(); + + //+ + int trkVtxIndex = 0; + int trkOrigin = 0; + if (trkLabels != nullptr) { + trkVtxIndex = (*trkLabels)["trkVtxIndex"][trkIdx]; + trkOrigin = (*trkLabels)["trkOrigin"][trkIdx]; + } + + //+trk + registry.fill(HIST("h_trk_pt"), constituent.pt(), eventweight); + registry.fill(HIST("h_trk_eta"), constituent.eta(), eventweight); + registry.fill(HIST("h_trk_phi"), origConstit.phi(), eventweight); + registry.fill(HIST("h_trk_charge"), constituent.sign(), eventweight); + registry.fill(HIST("h_trk_dcaxy"), std::abs(constituent.dcaXY()) * sign, eventweight); + registry.fill(HIST("h_trk_dcaxyz"), std::abs(constituent.dcaXYZ()) * sign, eventweight); + registry.fill(HIST("h_trk_sigmadcaxy"), constituent.sigmadcaXY(), eventweight); + registry.fill(HIST("h_trk_sigmadcaxyz"), constituent.sigmadcaXYZ(), eventweight); + registry.fill(HIST("h_trk_itsncls"), origConstit.itsNCls(), eventweight); + registry.fill(HIST("h_trk_tpcncls"), origConstit.tpcNClsFound(), eventweight); + registry.fill(HIST("h_trk_tpcncrs"), origConstit.tpcNClsCrossedRows(), eventweight); + registry.fill(HIST("h_trk_itschi2ncl"), origConstit.itsChi2NCl(), eventweight); + registry.fill(HIST("h_trk_tpcchi2ncl"), origConstit.tpcChi2NCl(), eventweight); + registry.fill(HIST("h2_trk_jtrackpt_vs_origtrackpt"), constituent.pt(), origConstit.pt(), eventweight); // jtrack & new extra table are well joined (linear correlation) + registry.fill(HIST("h_trk_vtx_index"), trkVtxIndex); + registry.fill(HIST("h_trk_origin"), trkOrigin); + + if (produceTree) { + bjetTracksExtraTable(/*bjetParamsTable.lastIndex() + 1, */ origConstit.phi(), constituent.sign(), origConstit.itsChi2NCl(), origConstit.tpcChi2NCl(), origConstit.itsNCls(), origConstit.tpcNClsFound(), origConstit.tpcNClsCrossedRows(), trkOrigin, trkVtxIndex); //+ + } + } + + if (produceTree) { + bjetTracksParamsTable(bjetParamsTable.lastIndex() + 1, constituent.pt(), constituent.eta(), dotProduct, dotProduct / analysisJet.p(), deltaRJetTrack, std::abs(constituent.dcaXY()) * sign, constituent.sigmadcaXY(), std::abs(constituent.dcaXYZ()) * sign, constituent.sigmadcaXYZ(), constituent.p() / analysisJet.p(), 0.); + } + trackIndices.push_back(bjetTracksParamsTable.lastIndex()); + } + } + void processDummy(FilteredCollision::iterator const& /*collision*/) { } @@ -548,6 +694,85 @@ struct BJetTreeCreator { } PROCESS_SWITCH(BJetTreeCreator, processMCJets, "jet information in MC", false); + using MCDJetTableNoSV = soa::Filtered>; + using JetParticleswID = soa::Join; + + void processMCJetsForGNN(FilteredCollisionMCD::iterator const& collision, aod::JMcCollisions const&, MCDJetTableNoSV const& MCDjets, MCPJetTable const& MCPjets, JetTracksMCDwID const& allTracks, JetParticleswID const& MCParticles, OriginalTracks const& origTracks, aod::McParticles const& origParticles) + { + if (!jetderiveddatautilities::selectCollision(collision, eventSelection) || (static_cast(std::rand()) / RAND_MAX < eventReductionFactor)) { + return; + } + + registry.fill(HIST("h_vertexZ"), collision.posZ()); + + auto const mcParticlesPerColl = MCParticles.sliceBy(McParticlesPerCollision, collision.mcCollisionId()); + auto const mcPJetsPerColl = MCPjets.sliceBy(McPJetsPerCollision, collision.mcCollisionId()); + + for (const auto& analysisJet : MCDjets) { + + bool jetIncluded = false; + for (auto jetR : jetRadiiValues) { + if (analysisJet.r() == static_cast(jetR * 100)) { + jetIncluded = true; + break; + } + } + + if (!jetIncluded) { + continue; + } + + std::vector tracksIndices; + std::vector SVsIndices; + + int16_t jetFlavor = 0; + + for (auto& mcpjet : analysisJet.template matchedJetGeo_as()) { + if (useQuarkDef) { + jetFlavor = jettaggingutilities::getJetFlavor(mcpjet, mcParticlesPerColl); + } else { + jetFlavor = jettaggingutilities::getJetFlavorHadron(mcpjet, mcParticlesPerColl); + } + } + + float eventWeight = analysisJet.eventWeight(); + + //+ + TrackLabelMap trkLabels{{"trkVtxIndex", {}}, {"trkOrigin", {}}}; + int nVertices = jettaggingutilities::vertexClustering(collision.template mcCollision_as(), analysisJet, allTracks, MCParticles, origParticles, trkLabels, true, vtxRes, trackPtMin); + analyzeJetTrackInfoForGNN(collision, analysisJet, allTracks, origTracks, tracksIndices, jetFlavor, eventWeight, &trkLabels); + + registry.fill(HIST("h2_jetMass_jetpT"), analysisJet.pt(), analysisJet.mass(), eventWeight); + registry.fill(HIST("h2_nTracks_jetpT"), analysisJet.pt(), tracksIndices.size()); + + //+jet + registry.fill(HIST("h_jet_pt"), analysisJet.pt()); + registry.fill(HIST("h_jet_eta"), analysisJet.eta()); + registry.fill(HIST("h_jet_phi"), analysisJet.phi()); + registry.fill(HIST("h_jet_flav"), jetFlavor); + registry.fill(HIST("h_n_trks"), tracksIndices.size()); + registry.fill(HIST("h_jet_mass"), analysisJet.mass()); + registry.fill(HIST("h_n_vertices"), nVertices); + + if (jetFlavor == 2) { + registry.fill(HIST("h2_jetMass_jetpT_bjet"), analysisJet.pt(), analysisJet.mass(), eventWeight); + registry.fill(HIST("h_jetpT_detector_bjet"), analysisJet.pt(), eventWeight); + } else if (jetFlavor == 1) { + registry.fill(HIST("h2_jetMass_jetpT_cjet"), analysisJet.pt(), analysisJet.mass(), eventWeight); + registry.fill(HIST("h_jetpT_detector_cjet"), analysisJet.pt(), eventWeight); + } else { + registry.fill(HIST("h2_jetMass_jetpT_lfjet"), analysisJet.pt(), analysisJet.mass(), eventWeight); + registry.fill(HIST("h_jetpT_detector_lfjet"), analysisJet.pt(), eventWeight); + } + + if (produceTree) { + bjetConstituentsTable(bjetParamsTable.lastIndex() + 1, tracksIndices, SVsIndices); + bjetParamsTable(analysisJet.pt(), analysisJet.eta(), analysisJet.phi(), tracksIndices.size(), nVertices, analysisJet.mass(), jetFlavor, analysisJet.r()); + } + } + } + PROCESS_SWITCH(BJetTreeCreator, processMCJetsForGNN, "jet information in MC for GNN", false); + Filter mccollisionFilter = nabs(aod::jmccollision::posZ) < vertexZCut; using FilteredCollisionMCP = soa::Filtered; From 7935ce911458b552c709763dfd4263d4e27c6939 Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Mon, 2 Dec 2024 17:11:41 +0100 Subject: [PATCH 206/459] [PWGHF] Add info about number of tracks decayed to muons for D* spin alignment (#8750) --- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 80 ++++++++++++----------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index 1594cc5e9cc..8dc690b0be6 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -288,6 +288,7 @@ struct TaskPolarisationCharmHadrons { const AxisSpec thnAxisNumPvContributors{configThnAxisNumPvContributors, "num PV contributors"}; const AxisSpec thnAxisPtB{configThnAxisPtB, "#it{p}_{T}(B mother) (GeV/#it{c})"}; const AxisSpec thnAxisDausAcc{2, -0.5f, 1.5f, "daughters in acceptance"}; + const AxisSpec thnAxisDauToMuons{4, -0.5f, 3.5f, "daughters decayed to muons"}; const AxisSpec thnAxisResoChannelLc{4, -0.5, 3.5, "0: direct 1,2,3: resonant"}; // 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± const AxisSpec thnAxisAbsEtaTrackMin{configThnAxisAbsEtaTrackMin, "min |#it{#eta_{track}}|"}; const AxisSpec thnAxisNumItsClsMin{configThnAxisNumItsClsMin, "min #it{N}_{cls ITS}"}; @@ -323,20 +324,20 @@ struct TaskPolarisationCharmHadrons { } } else { if (activateTHnSparseCosThStarHelicity) { - registry.add("hRecoPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } if (activateTHnSparseCosThStarProduction) { - registry.add("hRecoPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } if (activateTHnSparseCosThStarBeam) { - registry.add("hRecoPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } if (activateTHnSparseCosThStarRandom) { - registry.add("hRecoPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis and BDT scores -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisMlBkg, thnAxisMlNonPrompt, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } } } else if (doprocessLcToPKPiWithMl || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) { @@ -410,20 +411,20 @@ struct TaskPolarisationCharmHadrons { } } else { if (activateTHnSparseCosThStarHelicity) { - registry.add("hRecoPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarHelicity, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } if (activateTHnSparseCosThStarProduction) { - registry.add("hRecoPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarProduction, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } if (activateTHnSparseCosThStarBeam) { - registry.add("hRecoPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarBeam, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } if (activateTHnSparseCosThStarRandom) { - registry.add("hRecoPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin}); - registry.add("hRecoNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisPtB}); + registry.add("hRecoPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis -- reco prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons}); + registry.add("hRecoNonPromptRandom", "THn for polarisation studies with cosThStar w.r.t. random axis -- reco non-prompt signal", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisInvMassD0, thnAxisCosThetaStarRandom, thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisDauToMuons, thnAxisPtB}); } } } else if (doprocessLcToPKPi || doprocessLcToPKPiMc) { @@ -536,7 +537,7 @@ struct TaskPolarisationCharmHadrons { /// \param numItsClsMin is the minimum number of ITS clusters of the daughter tracks /// \param numTpcClsMin is the minimum number of TPC clusters of the daughter tracks template - void fillRecoHistos(float invMassCharmHad, float ptCharmHad, int numPvContributors, float rapCharmHad, float invMassD0, float invMassKPiLc, float cosThetaStar, float phiEuler, std::array outputMl, int isRotatedCandidate, int8_t origin, float ptBhadMother, int8_t resoChannelLc, float absEtaMin, int numItsClsMin, int numTpcClsMin, int8_t charge) + void fillRecoHistos(float invMassCharmHad, float ptCharmHad, int numPvContributors, float rapCharmHad, float invMassD0, float invMassKPiLc, float cosThetaStar, float phiEuler, std::array outputMl, int isRotatedCandidate, int8_t origin, float ptBhadMother, int8_t resoChannelLc, float absEtaMin, int numItsClsMin, int numTpcClsMin, int8_t charge, int8_t nMuons) { if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::Helicity) { // Helicity if constexpr (!doMc) { // data @@ -563,7 +564,7 @@ struct TaskPolarisationCharmHadrons { if constexpr (withMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -572,7 +573,7 @@ struct TaskPolarisationCharmHadrons { } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -583,7 +584,7 @@ struct TaskPolarisationCharmHadrons { } else { // without ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -592,7 +593,7 @@ struct TaskPolarisationCharmHadrons { } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptHelicity"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -627,7 +628,7 @@ struct TaskPolarisationCharmHadrons { if constexpr (withMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -636,7 +637,7 @@ struct TaskPolarisationCharmHadrons { } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -647,7 +648,7 @@ struct TaskPolarisationCharmHadrons { } else { // without ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -656,7 +657,7 @@ struct TaskPolarisationCharmHadrons { } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptProduction"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -691,7 +692,7 @@ struct TaskPolarisationCharmHadrons { if constexpr (withMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -700,7 +701,7 @@ struct TaskPolarisationCharmHadrons { } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -711,7 +712,7 @@ struct TaskPolarisationCharmHadrons { } else { // without ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -720,7 +721,7 @@ struct TaskPolarisationCharmHadrons { } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptBeam"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); if (activateTHnEulerPhiMonitor) { @@ -749,13 +750,13 @@ struct TaskPolarisationCharmHadrons { if constexpr (withMl) { // with ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, outputMl[0], /*outputMl[1],*/ outputMl[2], resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); } @@ -763,13 +764,13 @@ struct TaskPolarisationCharmHadrons { } else { // without ML if (origin == RecoDecay::OriginType::Prompt) { // prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin); + registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); } } else { // non-prompt if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { // D*+ - registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, ptBhadMother); + registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassD0, cosThetaStar, absEtaMin, numItsClsMin, numTpcClsMin, nMuons, ptBhadMother); } else if constexpr (channel == charm_polarisation::DecayChannel::LcToPKPi) { // Lc+ registry.fill(HIST("hRecoNonPromptRandom"), invMassCharmHad, ptCharmHad, numPvContributors, rapCharmHad, invMassKPiLc, cosThetaStar, resoChannelLc, absEtaMin, numItsClsMin, numTpcClsMin, charge); } @@ -1222,29 +1223,34 @@ struct TaskPolarisationCharmHadrons { // random float cosThetaStarRandom = -10.f; + int8_t nMuons{0u}; + if constexpr (doMc) { + nMuons = candidate.nTracksDecayed(); + } + if (activateTHnSparseCosThStarHelicity) { // helicity cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(helicityVec.Mag2()); phiHelicity = std::atan2(beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()), normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2()))); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarHelicity, phiHelicity, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarHelicity, phiHelicity, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons); } if (activateTHnSparseCosThStarProduction) { // production cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(normalVec.Mag2()); phiProduction = std::atan2(normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())), helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2()))); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarProduction, phiProduction, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarProduction, phiProduction, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons); } if (activateTHnSparseCosThStarBeam) { // beam cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); phiBeam = std::atan2(helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())), beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2())); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarBeam, phiBeam, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarBeam, phiBeam, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons); } if (activateTHnSparseCosThStarRandom) { // random ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarRandom, -99.f, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge); + fillRecoHistos(invMassCharmHadForSparse, ptCharmHad, numPvContributors, rapidity, invMassD0, invMassKPiLc, cosThetaStarRandom, -99.f, outputMl, isRotatedCandidate, origin, ptBhadMother, resoChannelLc, absEtaTrackMin, numItsClsMin, numTpcClsMin, charge, nMuons); } /// Table for Lc->pKpi background studies From 1e831b5e4d117f27b3230f127abe8b6ebd4493d6 Mon Sep 17 00:00:00 2001 From: Andrea Giovanni Riffero Date: Mon, 2 Dec 2024 17:53:11 +0100 Subject: [PATCH 207/459] [PWGUD] Modify MC saved tables (#8761) Co-authored-by: ariffero Co-authored-by: ALICE Action Bot --- PWGUD/Tasks/fwdMuonsUPC.cxx | 323 ++++++++++++++++++++---------------- 1 file changed, 180 insertions(+), 143 deletions(-) diff --git a/PWGUD/Tasks/fwdMuonsUPC.cxx b/PWGUD/Tasks/fwdMuonsUPC.cxx index 418995de88c..de1fde95115 100644 --- a/PWGUD/Tasks/fwdMuonsUPC.cxx +++ b/PWGUD/Tasks/fwdMuonsUPC.cxx @@ -20,6 +20,7 @@ #include #include "Framework/runDataProcessing.h" +#include "Framework/O2DatabasePDGPlugin.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" #include "CCDB/BasicCCDBManager.h" @@ -27,7 +28,6 @@ #include "DataFormatsParameters/GRPECSObject.h" #include "PWGUD/DataModel/UDTables.h" -#include "TDatabasePDG.h" #include "TLorentzVector.h" #include "TSystem.h" #include "TMath.h" @@ -38,7 +38,7 @@ namespace dimu { // dimuon DECLARE_SOA_COLUMN(M, m, float); -DECLARE_SOA_COLUMN(E, energy, float); +DECLARE_SOA_COLUMN(Energy, energy, float); DECLARE_SOA_COLUMN(Px, px, float); DECLARE_SOA_COLUMN(Py, py, float); DECLARE_SOA_COLUMN(Pz, pz, float); @@ -48,14 +48,14 @@ DECLARE_SOA_COLUMN(Phi, phi, float); DECLARE_SOA_COLUMN(PhiAv, phiAv, float); DECLARE_SOA_COLUMN(PhiCh, phiCh, float); // tracks positive (p) and negative (n) -DECLARE_SOA_COLUMN(Ep, energyp, float); +DECLARE_SOA_COLUMN(EnergyP, energyP, float); DECLARE_SOA_COLUMN(Pxp, pxp, float); DECLARE_SOA_COLUMN(Pyp, pyp, float); DECLARE_SOA_COLUMN(Pzp, pzp, float); DECLARE_SOA_COLUMN(Ptp, ptp, float); DECLARE_SOA_COLUMN(Etap, etap, float); DECLARE_SOA_COLUMN(Phip, phip, float); -DECLARE_SOA_COLUMN(En, energyn, float); +DECLARE_SOA_COLUMN(EnergyN, energyN, float); DECLARE_SOA_COLUMN(Pxn, pxn, float); DECLARE_SOA_COLUMN(Pyn, pyn, float); DECLARE_SOA_COLUMN(Pzn, pzn, float); @@ -73,17 +73,46 @@ DECLARE_SOA_COLUMN(Nclass, nclass, int); namespace o2::aod { DECLARE_SOA_TABLE(DiMu, "AOD", "DIMU", - dimu::M, dimu::E, dimu::Px, dimu::Py, dimu::Pz, dimu::Pt, dimu::Rap, dimu::Phi, + dimu::M, dimu::Energy, dimu::Px, dimu::Py, dimu::Pz, dimu::Pt, dimu::Rap, dimu::Phi, dimu::PhiAv, dimu::PhiCh, - dimu::Ep, dimu::Pxp, dimu::Pyp, dimu::Pzp, dimu::Ptp, dimu::Etap, dimu::Phip, - dimu::En, dimu::Pxn, dimu::Pyn, dimu::Pzn, dimu::Ptn, dimu::Etan, dimu::Phin, + dimu::EnergyP, dimu::Pxp, dimu::Pyp, dimu::Pzp, dimu::Ptp, dimu::Etap, dimu::Phip, + dimu::EnergyN, dimu::Pxn, dimu::Pyn, dimu::Pzn, dimu::Ptn, dimu::Etan, dimu::Phin, dimu::Tzna, dimu::Ezna, dimu::Tznc, dimu::Eznc, dimu::Nclass); } // namespace o2::aod +// for saving tree with info on gen MC +namespace gendimu +{ +// dimuon +DECLARE_SOA_COLUMN(M, m, float); +DECLARE_SOA_COLUMN(Pt, pt, float); +DECLARE_SOA_COLUMN(Rap, rap, float); +DECLARE_SOA_COLUMN(Phi, phi, float); +DECLARE_SOA_COLUMN(PhiAv, phiAv, float); +DECLARE_SOA_COLUMN(PhiCh, phiCh, float); +// tracks positive (p) and negative (n) +DECLARE_SOA_COLUMN(Ptp, ptp, float); +DECLARE_SOA_COLUMN(Etap, etap, float); +DECLARE_SOA_COLUMN(Phip, phip, float); +DECLARE_SOA_COLUMN(Ptn, ptn, float); +DECLARE_SOA_COLUMN(Etan, etan, float); +DECLARE_SOA_COLUMN(Phin, phin, float); +} // namespace gendimu + +namespace o2::aod +{ +DECLARE_SOA_TABLE(GenDimu, "AOD", "GENDIMU", + gendimu::M, gendimu::Pt, gendimu::Rap, gendimu::Phi, + gendimu::PhiAv, gendimu::PhiCh, + gendimu::Ptp, gendimu::Etap, gendimu::Phip, + gendimu::Ptn, gendimu::Etan, gendimu::Phin); +} // namespace o2::aod + // for saving tree with info on reco MC namespace recodimu { // dimuon +DECLARE_SOA_COLUMN(M, m, float); DECLARE_SOA_COLUMN(Pt, pt, float); DECLARE_SOA_COLUMN(Rap, rap, float); DECLARE_SOA_COLUMN(Phi, phi, float); @@ -97,22 +126,22 @@ DECLARE_SOA_COLUMN(Ptn, ptn, float); DECLARE_SOA_COLUMN(Etan, etan, float); DECLARE_SOA_COLUMN(Phin, phin, float); // gen info dimuon -DECLARE_SOA_COLUMN(GenPt, gen_pt, float); -DECLARE_SOA_COLUMN(GenRap, gen_rap, float); -DECLARE_SOA_COLUMN(GenPhi, gen_phi, float); +DECLARE_SOA_COLUMN(GenPt, genPt, float); +DECLARE_SOA_COLUMN(GenRap, genRap, float); +DECLARE_SOA_COLUMN(GenPhi, genPhi, float); // gen info trks -DECLARE_SOA_COLUMN(GenPtp, gen_ptp, float); -DECLARE_SOA_COLUMN(GenEtap, gen_etap, float); -DECLARE_SOA_COLUMN(GenPhip, gen_phip, float); -DECLARE_SOA_COLUMN(GenPtn, gen_ptn, float); -DECLARE_SOA_COLUMN(GenEtan, gen_etan, float); -DECLARE_SOA_COLUMN(GenPhin, gen_phin, float); +DECLARE_SOA_COLUMN(GenPtp, genPtp, float); +DECLARE_SOA_COLUMN(GenEtap, genEtap, float); +DECLARE_SOA_COLUMN(GenPhip, genPhip, float); +DECLARE_SOA_COLUMN(GenPtn, genPtn, float); +DECLARE_SOA_COLUMN(GenEtan, genEtan, float); +DECLARE_SOA_COLUMN(GenPhin, genPhin, float); } // namespace recodimu namespace o2::aod { -DECLARE_SOA_TABLE(recoDiMu, "AOD", "RECODIMU", - recodimu::Pt, recodimu::Rap, recodimu::Phi, +DECLARE_SOA_TABLE(RecoDimu, "AOD", "RECODIMU", + recodimu::M, recodimu::Pt, recodimu::Rap, recodimu::Phi, recodimu::PhiAv, recodimu::PhiCh, recodimu::Ptp, recodimu::Etap, recodimu::Phip, recodimu::Ptn, recodimu::Etan, recodimu::Phin, @@ -138,24 +167,26 @@ const float kPtMin = 0.; struct fwdMuonsUPC { // a pdg object - TDatabasePDG* pdg = nullptr; + Service pdg; using CandidatesFwd = soa::Join; using ForwardTracks = soa::Join; using CompleteFwdTracks = soa::Join; Produces dimuSel; - Produces dimuReco; + Produces dimuGen; + Produces dimuReco; // defining histograms using histogram registry: different histos for the different process functions HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry reg0n0n{"reg0n0n", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry regXn0n{"regXn0n", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry regXnXn{"regXnXn", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry McGenRegistry{"McGenRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry McRecoRegistry{"McRecoRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry mcGenRegistry{"mcGenRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry mcRecoRegistry{"mcRecoRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; // CONFIGURABLES + static constexpr double Pi = o2::constants::math::PI; // pT of muon pairs Configurable nBinsPt{"nBinsPt", 250, "N bins in pT histo"}; Configurable lowPt{"lowPt", 0., "lower limit in pT histo"}; @@ -174,8 +205,8 @@ struct fwdMuonsUPC { Configurable highRapidity{"highRapidity", -2., "upper limit in rapidity histo"}; // phi of muon pairs Configurable nBinsPhi{"nBinsPhi", 600, "N bins in phi histo"}; - Configurable lowPhi{"lowPhi", -TMath::Pi(), "lower limit in phi histo"}; - Configurable highPhi{"highPhi", TMath::Pi(), "upper limit in phi histo"}; + Configurable lowPhi{"lowPhi", -Pi, "lower limit in phi histo"}; + Configurable highPhi{"highPhi", Pi, "upper limit in phi histo"}; // pT of single muons Configurable nBinsPtSingle{"nBinsPtSingle", 500, "N bins in pT histo single muon"}; Configurable lowPtSingle{"lowPtSingle", 0., "lower limit in pT histo single muon"}; @@ -186,8 +217,8 @@ struct fwdMuonsUPC { Configurable highEtaSingle{"highEtaSingle", -2., "upper limit in eta histo single muon"}; // phi of single muons Configurable nBinsPhiSingle{"nBinsPhiSingle", 600, "N bins in phi histo single muon"}; - Configurable lowPhiSingle{"lowPhiSingle", -TMath::Pi(), "lower limit in phi histo single muon"}; - Configurable highPhiSingle{"highPhiSingle", TMath::Pi(), "upper limit in phi histo single muon"}; + Configurable lowPhiSingle{"lowPhiSingle", -Pi, "lower limit in phi histo single muon"}; + Configurable highPhiSingle{"highPhiSingle", Pi, "upper limit in phi histo single muon"}; // ZDC Configurable nBinsZDCen{"nBinsZDCen", 200, "N bins in ZN energy"}; Configurable lowEnZN{"lowEnZN", -50., "lower limit in ZN energy histo"}; @@ -195,9 +226,6 @@ struct fwdMuonsUPC { void init(InitContext&) { - // PDG - pdg = TDatabasePDG::Instance(); - // binning of pT axis fr fit std::vector ptFitBinning = { 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, @@ -264,56 +292,52 @@ struct fwdMuonsUPC { regXnXn.add("hPtFit", "Transverse momentum of muon pairs - XnXn;;#counts", kTH1D, {axisPtFit}); // gen MC - McGenRegistry.add("hMass", "Invariant mass of muon pairs;;#counts", kTH1D, {axisMass}); - McGenRegistry.add("hPt", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPt}); - McGenRegistry.add("hEta", "Pseudorapidty of muon pairs;;#counts", kTH1D, {axisEta}); - McGenRegistry.add("hRapidity", "Rapidty of muon pairs;;#counts", kTH1D, {axisRapidity}); - McGenRegistry.add("hPhi", "#varphi of muon pairs;;#counts", kTH1D, {axisPhi}); - McGenRegistry.add("hPtTrkPos", "Pt of positive muons;;#counts", kTH1D, {axisPtSingle}); - McGenRegistry.add("hPtTrkNeg", "Pt of negative muons;;#counts", kTH1D, {axisPtSingle}); - McGenRegistry.add("hEtaTrkPos", "#eta of positive muons;;#counts", kTH1D, {axisEtaSingle}); - McGenRegistry.add("hEtaTrkNeg", "#eta of negative muons;;#counts", kTH1D, {axisEtaSingle}); - McGenRegistry.add("hPhiTrkPos", "#varphi of positive muons;;#counts", kTH1D, {axisPhiSingle}); - McGenRegistry.add("hPhiTrkNeg", "#varphi of negative muons;;#counts", kTH1D, {axisPhiSingle}); - McGenRegistry.add("hPhiCharge", "#phi #it{charge}", kTH1D, {axisPhi}); - McGenRegistry.add("hPhiAverage", "#phi #it{average}", kTH1D, {axisPhi}); + mcGenRegistry.add("hMass", "Invariant mass of muon pairs;;#counts", kTH1D, {axisMass}); + mcGenRegistry.add("hPt", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPt}); + mcGenRegistry.add("hEta", "Pseudorapidty of muon pairs;;#counts", kTH1D, {axisEta}); + mcGenRegistry.add("hRapidity", "Rapidty of muon pairs;;#counts", kTH1D, {axisRapidity}); + mcGenRegistry.add("hPhi", "#varphi of muon pairs;;#counts", kTH1D, {axisPhi}); + mcGenRegistry.add("hPtTrkPos", "Pt of positive muons;;#counts", kTH1D, {axisPtSingle}); + mcGenRegistry.add("hPtTrkNeg", "Pt of negative muons;;#counts", kTH1D, {axisPtSingle}); + mcGenRegistry.add("hEtaTrkPos", "#eta of positive muons;;#counts", kTH1D, {axisEtaSingle}); + mcGenRegistry.add("hEtaTrkNeg", "#eta of negative muons;;#counts", kTH1D, {axisEtaSingle}); + mcGenRegistry.add("hPhiTrkPos", "#varphi of positive muons;;#counts", kTH1D, {axisPhiSingle}); + mcGenRegistry.add("hPhiTrkNeg", "#varphi of negative muons;;#counts", kTH1D, {axisPhiSingle}); + mcGenRegistry.add("hPhiCharge", "#phi #it{charge}", kTH1D, {axisPhi}); + mcGenRegistry.add("hPhiAverage", "#phi #it{average}", kTH1D, {axisPhi}); // reco MC - McRecoRegistry.add("hMass", "Invariant mass of muon pairs;;#counts", kTH1D, {axisMass}); - McRecoRegistry.add("hPt", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPt}); - McRecoRegistry.add("hPtFit", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPtFit}); - McRecoRegistry.add("hEta", "Pseudorapidty of muon pairs;;#counts", kTH1D, {axisEta}); - McRecoRegistry.add("hRapidity", "Rapidty of muon pairs;;#counts", kTH1D, {axisRapidity}); - McRecoRegistry.add("hPhi", "#varphi of muon pairs;;#counts", kTH1D, {axisPhi}); - McRecoRegistry.add("hCharge", "Charge;;;#counts", kTH1D, {{5, -2.5, 2.5}}); - McRecoRegistry.add("hContrib", "hContrib;;#counts", kTH1D, {{6, -0.5, 5.5}}); - McRecoRegistry.add("hEvSign", "Sum of the charges of all the tracks in each event;;#counts", kTH1D, {{5, -2.5, 2.5}}); - McRecoRegistry.add("hPtTrkPos", "Pt of positive muons;;#counts", kTH1D, {axisPtSingle}); - McRecoRegistry.add("hPtTrkNeg", "Pt of negative muons;;#counts", kTH1D, {axisPtSingle}); - McRecoRegistry.add("hEtaTrkPos", "#eta of positive muons;;#counts", kTH1D, {axisEtaSingle}); - McRecoRegistry.add("hEtaTrkNeg", "#eta of negative muons;;#counts", kTH1D, {axisEtaSingle}); - McRecoRegistry.add("hPhiTrkPos", "#varphi of positive muons;;#counts", kTH1D, {axisPhiSingle}); - McRecoRegistry.add("hPhiTrkNeg", "#varphi of negative muons;;#counts", kTH1D, {axisPhiSingle}); - McRecoRegistry.add("hSameSign", "hSameSign;;#counts", kTH1D, {{6, -0.5, 5.5}}); - McRecoRegistry.add("hPhiCharge", "#phi #it{charge}", kTH1D, {axisPhi}); - McRecoRegistry.add("hPhiAverage", "#phi #it{average}", kTH1D, {axisPhi}); + mcRecoRegistry.add("hMass", "Invariant mass of muon pairs;;#counts", kTH1D, {axisMass}); + mcRecoRegistry.add("hPt", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPt}); + mcRecoRegistry.add("hPtFit", "Transverse momentum of muon pairs;;#counts", kTH1D, {axisPtFit}); + mcRecoRegistry.add("hEta", "Pseudorapidty of muon pairs;;#counts", kTH1D, {axisEta}); + mcRecoRegistry.add("hRapidity", "Rapidty of muon pairs;;#counts", kTH1D, {axisRapidity}); + mcRecoRegistry.add("hPhi", "#varphi of muon pairs;;#counts", kTH1D, {axisPhi}); + mcRecoRegistry.add("hCharge", "Charge;;;#counts", kTH1D, {{5, -2.5, 2.5}}); + mcRecoRegistry.add("hContrib", "hContrib;;#counts", kTH1D, {{6, -0.5, 5.5}}); + mcRecoRegistry.add("hEvSign", "Sum of the charges of all the tracks in each event;;#counts", kTH1D, {{5, -2.5, 2.5}}); + mcRecoRegistry.add("hPtTrkPos", "Pt of positive muons;;#counts", kTH1D, {axisPtSingle}); + mcRecoRegistry.add("hPtTrkNeg", "Pt of negative muons;;#counts", kTH1D, {axisPtSingle}); + mcRecoRegistry.add("hEtaTrkPos", "#eta of positive muons;;#counts", kTH1D, {axisEtaSingle}); + mcRecoRegistry.add("hEtaTrkNeg", "#eta of negative muons;;#counts", kTH1D, {axisEtaSingle}); + mcRecoRegistry.add("hPhiTrkPos", "#varphi of positive muons;;#counts", kTH1D, {axisPhiSingle}); + mcRecoRegistry.add("hPhiTrkNeg", "#varphi of negative muons;;#counts", kTH1D, {axisPhiSingle}); + mcRecoRegistry.add("hSameSign", "hSameSign;;#counts", kTH1D, {{6, -0.5, 5.5}}); + mcRecoRegistry.add("hPhiCharge", "#phi #it{charge}", kTH1D, {axisPhi}); + mcRecoRegistry.add("hPhiAverage", "#phi #it{average}", kTH1D, {axisPhi}); // corr gen-reco - McRecoRegistry.add("hPtcorr", "gen pT vs reco pT", kTH2D, {axisPt, axisPt}); - McRecoRegistry.add("hRapcorr", "gen rapidity vs reco rapidity", kTH2D, {axisRapidity, axisRapidity}); - McRecoRegistry.add("hPhicorr", "gen #phi vs reco #phi", kTH2D, {axisPhi, axisPhi}); + mcRecoRegistry.add("hPtcorr", "gen pT vs reco pT", kTH2D, {axisPt, axisPt}); + mcRecoRegistry.add("hRapcorr", "gen rapidity vs reco rapidity", kTH2D, {axisRapidity, axisRapidity}); + mcRecoRegistry.add("hPhicorr", "gen #phi vs reco #phi", kTH2D, {axisPhi, axisPhi}); } // FUNCTIONS // retrieve particle mass (GeV/c^2) from TDatabasePDG - float particleMass(TDatabasePDG* pdg, int pid) + float particleMass(int pid) { - auto mass = 0.; - TParticlePDG* pdgparticle = pdg->GetParticle(pid); - if (pdgparticle != nullptr) { - mass = pdgparticle->Mass(); - } + auto mass = pdg->Mass(pid); return mass; } @@ -382,10 +406,10 @@ struct fwdMuonsUPC { // function that fills a map with the collision id of each udcollision as key // and a ZDCinfo struct with the ZDC information - void collectCandZDCInfo(std::unordered_map& zdcPerCand, o2::aod::UDZdcsReduced& ZDCs) + void collectCandZDCInfo(std::unordered_map& zdcPerCand, o2::aod::UDZdcsReduced const& ZDCs) { - for (auto& zdc : ZDCs) { + for (const auto& zdc : ZDCs) { int32_t candId = zdc.udCollisionId(); if (candId < 0) { continue; @@ -415,7 +439,7 @@ struct fwdMuonsUPC { float rAbs = fwdTrack.rAtAbsorberEnd(); float pDca = fwdTrack.pDca(); TLorentzVector p; - auto mMu = particleMass(pdg, 13); + auto mMu = particleMass(13); p.SetXYZM(fwdTrack.px(), fwdTrack.py(), fwdTrack.pz(), mMu); float eta = p.Eta(); float pt = p.Pt(); @@ -464,7 +488,7 @@ struct fwdMuonsUPC { // used for real data void processCand(CandidatesFwd::iterator const& cand, ForwardTracks::iterator const& tr1, ForwardTracks::iterator const& tr2, - ZDCinfo& zdc) + ZDCinfo const& zdc) { // V0 selection const auto& ampsV0A = cand.amplitudesV0A(); @@ -499,7 +523,7 @@ struct fwdMuonsUPC { // form Lorentz vectors TLorentzVector p1, p2; - auto mMu = particleMass(pdg, 13); + auto mMu = particleMass(13); p1.SetXYZM(tr1.px(), tr1.py(), tr1.pz(), mMu); p2.SetXYZM(tr2.px(), tr2.py(), tr2.pz(), mMu); TLorentzVector p = p1 + p2; @@ -527,47 +551,47 @@ struct fwdMuonsUPC { computePhiAnis(p1, p2, tr1.sign(), phiAverage, phiCharge); // zdc info - if (TMath::Abs(zdc.timeA) < 10) + if (std::abs(zdc.timeA) < 10) registry.fill(HIST("hTimeZNA"), zdc.timeA); - if (TMath::Abs(zdc.timeC) < 10) + if (std::abs(zdc.timeC) < 10) registry.fill(HIST("hTimeZNC"), zdc.timeC); registry.fill(HIST("hEnergyZN"), zdc.enA, zdc.enC); // divide the events in neutron classes - bool neutron_A = false; - bool neutron_C = false; + bool neutronA = false; + bool neutronC = false; int znClass = -1; - if (TMath::Abs(zdc.timeA) < 2) - neutron_A = true; - if (TMath::Abs(zdc.timeC) < 2) - neutron_C = true; + if (std::abs(zdc.timeA) < 2) + neutronA = true; + if (std::abs(zdc.timeC) < 2) + neutronC = true; if (std::isinf(zdc.timeC)) - neutron_C = false; + neutronC = false; if (std::isinf(zdc.timeA)) - neutron_A = false; + neutronA = false; // fill the histos in neutron classes and assign neutron class label // 0n0n - if (neutron_C == false && neutron_A == false) { + if (neutronC == false && neutronA == false) { znClass = 1; reg0n0n.fill(HIST("hMass"), p.M()); reg0n0n.fill(HIST("hPt"), p.Pt()); reg0n0n.fill(HIST("hPtFit"), p.Pt()); reg0n0n.fill(HIST("hEta"), p.Eta()); reg0n0n.fill(HIST("hRapidity"), p.Rapidity()); - } else if (neutron_A ^ neutron_C) { // Xn0n + 0nXn - if (neutron_A) + } else if (neutronA ^ neutronC) { // Xn0n + 0nXn + if (neutronA) znClass = 2; - else if (neutron_C) + else if (neutronC) znClass = 3; regXn0n.fill(HIST("hMass"), p.M()); regXn0n.fill(HIST("hPt"), p.Pt()); regXn0n.fill(HIST("hPtFit"), p.Pt()); regXn0n.fill(HIST("hEta"), p.Eta()); regXn0n.fill(HIST("hRapidity"), p.Rapidity()); - } else if (neutron_A && neutron_C) { // XnXn + } else if (neutronA && neutronC) { // XnXn znClass = 4; regXnXn.fill(HIST("hMass"), p.M()); regXnXn.fill(HIST("hPt"), p.Pt()); @@ -624,7 +648,7 @@ struct fwdMuonsUPC { // create Lorentz vectors TLorentzVector p1, p2; - auto mMu = particleMass(pdg, 13); + auto mMu = particleMass(13); p1.SetXYZM(McPart1.px(), McPart1.py(), McPart1.pz(), mMu); p2.SetXYZM(McPart2.px(), McPart2.py(), McPart2.pz(), mMu); TLorentzVector p = p1 + p2; @@ -649,22 +673,35 @@ struct fwdMuonsUPC { // compute phi for azimuth anisotropy float phiAverage = 0; float phiCharge = 0; - computePhiAnis(p1, p2, McPart1.pdgCode(), phiAverage, phiCharge); + computePhiAnis(p1, p2, -McPart1.pdgCode(), phiAverage, phiCharge); // fill the histos - McGenRegistry.fill(HIST("hPtTrkPos"), p1.Pt()); - McGenRegistry.fill(HIST("hPtTrkNeg"), p2.Pt()); - McGenRegistry.fill(HIST("hEtaTrkPos"), p1.Eta()); - McGenRegistry.fill(HIST("hEtaTrkNeg"), p2.Eta()); - McGenRegistry.fill(HIST("hPhiTrkPos"), p1.Phi()); - McGenRegistry.fill(HIST("hPhiTrkNeg"), p2.Phi()); - McGenRegistry.fill(HIST("hMass"), p.M()); - McGenRegistry.fill(HIST("hPt"), p.Pt()); - McGenRegistry.fill(HIST("hEta"), p.Eta()); - McGenRegistry.fill(HIST("hRapidity"), p.Rapidity()); - McGenRegistry.fill(HIST("hPhi"), p.Phi()); - McGenRegistry.fill(HIST("hPhiAverage"), phiAverage); - McGenRegistry.fill(HIST("hPhiCharge"), phiCharge); + mcGenRegistry.fill(HIST("hPtTrkPos"), p1.Pt()); + mcGenRegistry.fill(HIST("hPtTrkNeg"), p2.Pt()); + mcGenRegistry.fill(HIST("hEtaTrkPos"), p1.Eta()); + mcGenRegistry.fill(HIST("hEtaTrkNeg"), p2.Eta()); + mcGenRegistry.fill(HIST("hPhiTrkPos"), p1.Phi()); + mcGenRegistry.fill(HIST("hPhiTrkNeg"), p2.Phi()); + mcGenRegistry.fill(HIST("hMass"), p.M()); + mcGenRegistry.fill(HIST("hPt"), p.Pt()); + mcGenRegistry.fill(HIST("hEta"), p.Eta()); + mcGenRegistry.fill(HIST("hRapidity"), p.Rapidity()); + mcGenRegistry.fill(HIST("hPhi"), p.Phi()); + mcGenRegistry.fill(HIST("hPhiAverage"), phiAverage); + mcGenRegistry.fill(HIST("hPhiCharge"), phiCharge); + + // store the event to save it into a tree + if (McPart1.pdgCode() < 0) { + dimuGen(p.M(), p.Pt(), p.Rapidity(), p.Phi(), + phiAverage, phiCharge, + p1.Pt(), p1.PseudoRapidity(), p1.Phi(), + p2.Pt(), p2.PseudoRapidity(), p2.Phi()); + } else { + dimuGen(p.M(), p.Pt(), p.Rapidity(), p.Phi(), + phiAverage, phiCharge, + p2.Pt(), p2.PseudoRapidity(), p2.Phi(), + p1.Pt(), p1.PseudoRapidity(), p1.Phi()); + } } // function that processes MC reco candidates @@ -706,7 +743,7 @@ struct fwdMuonsUPC { // form Lorentz vectors TLorentzVector p1, p2; - auto mMu = particleMass(pdg, 13); + auto mMu = particleMass(13); p1.SetXYZM(tr1.px(), tr1.py(), tr1.pz(), mMu); p2.SetXYZM(tr2.px(), tr2.py(), tr2.pz(), mMu); TLorentzVector p = p1 + p2; @@ -742,7 +779,7 @@ struct fwdMuonsUPC { // compute gen phi for azimuth anisotropy float phiGenAverage = 0; float phiGenCharge = 0; - computePhiAnis(p1, p2, McPart1.pdgCode(), phiGenAverage, phiGenCharge); + computePhiAnis(p1, p2, -McPart1.pdgCode(), phiGenAverage, phiGenCharge); // print info in case of problems if (tr1.sign() * McPart1.pdgCode() > 0 || tr2.sign() * McPart2.pdgCode() > 0) { @@ -754,48 +791,48 @@ struct fwdMuonsUPC { // fill the histos // reco info - McRecoRegistry.fill(HIST("hContrib"), cand.numContrib()); - McRecoRegistry.fill(HIST("hPtTrkPos"), p1.Pt()); - McRecoRegistry.fill(HIST("hPtTrkNeg"), p2.Pt()); - McRecoRegistry.fill(HIST("hEtaTrkPos"), p1.Eta()); - McRecoRegistry.fill(HIST("hEtaTrkNeg"), p2.Eta()); - McRecoRegistry.fill(HIST("hPhiTrkPos"), p1.Phi()); - McRecoRegistry.fill(HIST("hPhiTrkNeg"), p2.Phi()); - McRecoRegistry.fill(HIST("hEvSign"), cand.netCharge()); - McRecoRegistry.fill(HIST("hMass"), p.M()); - McRecoRegistry.fill(HIST("hPt"), p.Pt()); - McRecoRegistry.fill(HIST("hPtFit"), p.Pt()); - McRecoRegistry.fill(HIST("hEta"), p.Eta()); - McRecoRegistry.fill(HIST("hRapidity"), p.Rapidity()); - McRecoRegistry.fill(HIST("hPhi"), p.Phi()); - McRecoRegistry.fill(HIST("hCharge"), tr1.sign()); - McRecoRegistry.fill(HIST("hCharge"), tr2.sign()); - McRecoRegistry.fill(HIST("hPhiAverage"), phiAverage); - McRecoRegistry.fill(HIST("hPhiCharge"), phiCharge); + mcRecoRegistry.fill(HIST("hContrib"), cand.numContrib()); + mcRecoRegistry.fill(HIST("hPtTrkPos"), p1.Pt()); + mcRecoRegistry.fill(HIST("hPtTrkNeg"), p2.Pt()); + mcRecoRegistry.fill(HIST("hEtaTrkPos"), p1.Eta()); + mcRecoRegistry.fill(HIST("hEtaTrkNeg"), p2.Eta()); + mcRecoRegistry.fill(HIST("hPhiTrkPos"), p1.Phi()); + mcRecoRegistry.fill(HIST("hPhiTrkNeg"), p2.Phi()); + mcRecoRegistry.fill(HIST("hEvSign"), cand.netCharge()); + mcRecoRegistry.fill(HIST("hMass"), p.M()); + mcRecoRegistry.fill(HIST("hPt"), p.Pt()); + mcRecoRegistry.fill(HIST("hPtFit"), p.Pt()); + mcRecoRegistry.fill(HIST("hEta"), p.Eta()); + mcRecoRegistry.fill(HIST("hRapidity"), p.Rapidity()); + mcRecoRegistry.fill(HIST("hPhi"), p.Phi()); + mcRecoRegistry.fill(HIST("hCharge"), tr1.sign()); + mcRecoRegistry.fill(HIST("hCharge"), tr2.sign()); + mcRecoRegistry.fill(HIST("hPhiAverage"), phiAverage); + mcRecoRegistry.fill(HIST("hPhiCharge"), phiCharge); // gen info (of reco events) - McGenRegistry.fill(HIST("hPtTrkPos"), p1Mc.Pt()); - McGenRegistry.fill(HIST("hPtTrkNeg"), p2Mc.Pt()); - McGenRegistry.fill(HIST("hEtaTrkPos"), p1Mc.Eta()); - McGenRegistry.fill(HIST("hEtaTrkNeg"), p2Mc.Eta()); - McGenRegistry.fill(HIST("hPhiTrkPos"), p1Mc.Phi()); - McGenRegistry.fill(HIST("hPhiTrkNeg"), p2Mc.Phi()); - McGenRegistry.fill(HIST("hMass"), pMc.M()); - McGenRegistry.fill(HIST("hPt"), pMc.Pt()); - McGenRegistry.fill(HIST("hEta"), pMc.Eta()); - McGenRegistry.fill(HIST("hRapidity"), pMc.Rapidity()); - McGenRegistry.fill(HIST("hPhi"), pMc.Phi()); - McGenRegistry.fill(HIST("hPhiAverage"), phiGenAverage); - McGenRegistry.fill(HIST("hPhiCharge"), phiGenCharge); + mcGenRegistry.fill(HIST("hPtTrkPos"), p1Mc.Pt()); + mcGenRegistry.fill(HIST("hPtTrkNeg"), p2Mc.Pt()); + mcGenRegistry.fill(HIST("hEtaTrkPos"), p1Mc.Eta()); + mcGenRegistry.fill(HIST("hEtaTrkNeg"), p2Mc.Eta()); + mcGenRegistry.fill(HIST("hPhiTrkPos"), p1Mc.Phi()); + mcGenRegistry.fill(HIST("hPhiTrkNeg"), p2Mc.Phi()); + mcGenRegistry.fill(HIST("hMass"), pMc.M()); + mcGenRegistry.fill(HIST("hPt"), pMc.Pt()); + mcGenRegistry.fill(HIST("hEta"), pMc.Eta()); + mcGenRegistry.fill(HIST("hRapidity"), pMc.Rapidity()); + mcGenRegistry.fill(HIST("hPhi"), pMc.Phi()); + mcGenRegistry.fill(HIST("hPhiAverage"), phiGenAverage); + mcGenRegistry.fill(HIST("hPhiCharge"), phiGenCharge); // reco-gen correlations - McRecoRegistry.fill(HIST("hPtcorr"), p.Pt(), pMc.Pt()); - McRecoRegistry.fill(HIST("hRapcorr"), p.Eta(), pMc.Eta()); - McRecoRegistry.fill(HIST("hPhicorr"), p.Phi(), pMc.Phi()); + mcRecoRegistry.fill(HIST("hPtcorr"), p.Pt(), pMc.Pt()); + mcRecoRegistry.fill(HIST("hRapcorr"), p.Rapidity(), pMc.Rapidity()); + mcRecoRegistry.fill(HIST("hPhicorr"), p.Phi(), pMc.Phi()); // store the event to save it into a tree if (tr1.sign() > 0) { - dimuReco(p.Pt(), p.Rapidity(), p.Phi(), + dimuReco(p.M(), p.Pt(), p.Rapidity(), p.Phi(), phiAverage, phiCharge, p1.Pt(), p1.PseudoRapidity(), p1.Phi(), p2.Pt(), p2.PseudoRapidity(), p2.Phi(), @@ -804,7 +841,7 @@ struct fwdMuonsUPC { p1Mc.Pt(), p1Mc.PseudoRapidity(), p1Mc.Phi(), p2Mc.Pt(), p2Mc.PseudoRapidity(), p2Mc.Phi()); } else { - dimuReco(p.Pt(), p.Rapidity(), p.Phi(), + dimuReco(p.M(), p.Pt(), p.Rapidity(), p.Phi(), phiAverage, phiCharge, p2.Pt(), p2.PseudoRapidity(), p2.Phi(), p1.Pt(), p1.PseudoRapidity(), p1.Phi(), @@ -817,7 +854,7 @@ struct fwdMuonsUPC { // PROCESS FUNCTION void processData(CandidatesFwd const& eventCandidates, - o2::aod::UDZdcsReduced& ZDCs, + o2::aod::UDZdcsReduced const& ZDCs, ForwardTracks const& fwdTracks) { From 9c6838ad2c8d8169451e72870d29aa68f5ca0d39 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:23:44 +0100 Subject: [PATCH 208/459] [PWGJE,EMCAL-670] Add separate HG/LG cell time QC histos for time calib (#8769) Co-authored-by: Nicolas Strangmann --- PWGJE/TableProducer/emcalCorrectionTask.cxx | 40 +++++++++++++++------ 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index e14c347eb37..0a84a66b23b 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -183,6 +183,15 @@ struct EmcalCorrectionTask { LOG(debug) << "Completed init!"; + // Define the cell energy binning + std::vector cellEnergyBins; + for (int i = 0; i < 51; i++) + cellEnergyBins.emplace_back(0.1 * (i - 0) + 0.0); // from 0 to 5 GeV/c, every 0.1 GeV + for (int i = 51; i < 76; i++) + cellEnergyBins.emplace_back(0.2 * (i - 51) + 5.2); // from 5.2 to 10.0 GeV, every 0.2 GeV + for (int i = 76; i < 166; i++) + cellEnergyBins.emplace_back(1. * (i - 76) + 11.); // from 11.0 to 100. GeV, every 1 GeV + // Setup QA hists. // NOTE: This is not comprehensive. using o2HistType = o2::framework::HistType; @@ -195,7 +204,8 @@ struct EmcalCorrectionTask { mHistManager.add("hCellE", "hCellE", o2HistType::kTH1F, {energyAxis}); mHistManager.add("hCellTowerID", "hCellTowerID", o2HistType::kTH1D, {{20000, 0, 20000}}); mHistManager.add("hCellEtaPhi", "hCellEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); - mHistManager.add("hCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, {200, 0., 20.}}); + mHistManager.add("hHGCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for high gain cells (low energies) + mHistManager.add("hLGCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for low gain cells (high energies) // NOTE: Reversed column and row because it's more natural for presentation. mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", o2HistType::kTH2D, {{96, -0.5, 95.5}, {208, -0.5, 207.5}}); mHistManager.add("hClusterE", "hClusterE", o2HistType::kTH1F, {energyAxis}); @@ -276,7 +286,7 @@ struct EmcalCorrectionTask { } cellsBC.emplace_back(cell.cellNumber(), amplitude, - cell.time() + getCellTimeShift(cell.cellNumber(), amplitude), + cell.time() + getCellTimeShift(cell.cellNumber(), amplitude, o2::emcal::intToChannelType(cell.cellType())), o2::emcal::intToChannelType(cell.cellType())); cellIndicesBC.emplace_back(cell.globalIndex()); } @@ -395,7 +405,7 @@ struct EmcalCorrectionTask { } cellsBC.emplace_back(cell.cellNumber(), amplitude, - cell.time() + getCellTimeShift(cell.cellNumber(), amplitude), + cell.time() + getCellTimeShift(cell.cellNumber(), amplitude, o2::emcal::intToChannelType(cell.cellType())), o2::emcal::intToChannelType(cell.cellType())); cellIndicesBC.emplace_back(cell.globalIndex()); cellLabels.emplace_back(cell.mcParticleIds(), cell.amplitudeA()); @@ -497,7 +507,7 @@ struct EmcalCorrectionTask { for (auto& cell : cellsInBC) { cellsBC.emplace_back(cell.cellNumber(), cell.amplitude(), - cell.time() + getCellTimeShift(cell.cellNumber(), cell.amplitude()), + cell.time() + getCellTimeShift(cell.cellNumber(), cell.amplitude(), o2::emcal::intToChannelType(cell.cellType())), o2::emcal::intToChannelType(cell.cellType())); cellIndicesBC.emplace_back(cell.globalIndex()); } @@ -779,7 +789,10 @@ struct EmcalCorrectionTask { // For convenience, use the clusterizer stored geometry to get the eta-phi for (auto& cell : cellsBC) { mHistManager.fill(HIST("hCellE"), cell.getEnergy()); - mHistManager.fill(HIST("hCellTimeEnergy"), cell.getTimeStamp(), cell.getEnergy()); + if (cell.getLowGain()) + mHistManager.fill(HIST("hLGCellTimeEnergy"), cell.getTimeStamp(), cell.getEnergy()); + else if (cell.getHighGain()) + mHistManager.fill(HIST("hHGCellTimeEnergy"), cell.getTimeStamp(), cell.getEnergy()); mHistManager.fill(HIST("hCellTowerID"), cell.getTower()); auto res = mClusterizers.at(0)->getGeometry()->EtaPhiFromIndex(cell.getTower()); mHistManager.fill(HIST("hCellEtaPhi"), std::get<0>(res), TVector2::Phi_0_2pi(std::get<1>(res))); @@ -809,7 +822,7 @@ struct EmcalCorrectionTask { // Apply shift of the cell time in data and MC // In MC this has to be done to shift the cell time, which is not calibrated to 0 due to the flight time of the particles to the EMCal surface (~15ns) // In data this is done to correct for the time walk effect - float getCellTimeShift(const int16_t cellID, const float cellEnergy) + float getCellTimeShift(const int16_t cellID, const float cellEnergy, const o2::emcal::ChannelType_t cellType) { if (!applyCellTimeCorrection) { return 0.f; @@ -825,13 +838,18 @@ struct EmcalCorrectionTask { // Also smear the time to account for the broader time resolution in data than in MC timesmear = normalgaus(rdgen) * (1.6 + 9.5 * TMath::Exp(-3. * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods } else { // data - if (cellEnergy < 0.3) // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration + if (cellEnergy < 0.3) { // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration timeshift = 0.; - else if (cellEnergy < 4.) // Low energy regime - timeshift = 0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods - else // High energy regime - timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods + } else if (cellType == o2::emcal::ChannelType_t::HIGH_GAIN) { // High gain cells -> Low energies + if (cellEnergy < 4.) // Low energy regime + timeshift = 0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods + else // Medium energy regime + timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods + } else if (cellType == o2::emcal::ChannelType_t::LOW_GAIN) { // Low gain cells -> High energies + timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), will be updated by LHC24aj input + } } + LOG(debug) << "Shift the cell time by " << timeshift << " + " << timesmear << " ns"; return timeshift + timesmear; } From b20886db57f21b05df73c5ae6da349441d7a6b7f Mon Sep 17 00:00:00 2001 From: rolavick Date: Mon, 2 Dec 2024 18:54:40 +0100 Subject: [PATCH 209/459] [PWGUD] Update of personal task (#8768) Co-authored-by: ALICE Action Bot --- PWGUD/Core/UPCTauCentralBarrelHelperRL.h | 14 +- PWGUD/Tasks/upcTauCentralBarrelRL.cxx | 185 ++++++++++++++--------- 2 files changed, 120 insertions(+), 79 deletions(-) diff --git a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h index d454cab0296..a6147089ecc 100644 --- a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h +++ b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h @@ -19,10 +19,6 @@ #include #include -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; - enum MyParticle { P_ELECTRON = 0, P_MUON = 1, @@ -160,6 +156,12 @@ int enumMyParticle(int valuePDG) } } +float pt(float px, float py) +// Just a simple function to return pt +{ + return std::sqrt(px * px + py * py); +} + float momentum(float px, float py, float pz) // Just a simple function to return momentum { @@ -219,7 +221,7 @@ int countPhysicalPrimary(Ps particles) // Function to loop over particles associated to a mcCollision and return total of physical primary particles { int nTotal = 0; - for (auto& particle : particles) { + for (const auto& particle : particles) { if (!particle.isPhysicalPrimary()) continue; nTotal++; @@ -232,7 +234,7 @@ int countParticlesWithoutMother(Ps particles) // Function to loop over particles associated to a mcCollision and return total of particles without mothers (hopely alternative to isPhysicalPrimary) { int nTotal = 0; - for (auto& particle : particles) { + for (const auto& particle : particles) { if (particle.has_mothers()) continue; nTotal++; diff --git a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx index 01e8f7a5d6a..5b80f5972ae 100644 --- a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx +++ b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx @@ -8,8 +8,8 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// -/// \brief +/// \file upcTauCentralBarrelRL.cxx +/// \brief Personal task to analyze tau events from UPC collisions /// \author Roman Lavicka, roman.lavicka@cern.ch /// \since 12.07.2022 @@ -40,8 +40,7 @@ // ROOT headers #include "TLorentzVector.h" -#include "TEfficiency.h" -#include "TF1.h" +#include "TPDGCode.h" using namespace o2; using namespace o2::framework; @@ -132,7 +131,7 @@ struct UpcTauCentralBarrelRL { ConfigurableAxis axisMomWide{"axisMomWide", {1000, 0., 10.}, "Momentum (GeV/c), wider range"}; ConfigurableAxis axisMomSigned{"axisMomSigned", {800, -2., 2.}, "Signed momentum (GeV/c)"}; ConfigurableAxis axisPt{"axisPt", {400, 0., 2.}, "Transversal momentum (GeV/c)"}; - ConfigurableAxis axisPhi{"axisPhi", {64, -2 * o2::constants::math::PI, 2 * o2::constants::math::PI}, "Azimuthal angle (a.y.)"}; + ConfigurableAxis axisPhi{"axisPhi", {64, -o2::constants::math::TwoPI, o2::constants::math::TwoPI}, "Azimuthal angle (a.y.)"}; ConfigurableAxis axisModPhi{"axisModPhi", {400, 0., .4}, "Track fmod(#phi,#pi/9)"}; ConfigurableAxis axisEta{"axisEta", {50, -1.2, 1.2}, "Pseudorapidity (a.u.)"}; ConfigurableAxis axisRap{"axisRap", {50, -1.2, 1.2}, "Rapidity (a.u.)"}; @@ -644,7 +643,7 @@ struct UpcTauCentralBarrelRL { histos.add("EventSixTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); histos.add("EventSixTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); histos.add("EventSixTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventSixTracks//hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); + histos.add("EventSixTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); histos.add("EventSixTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); histos.add("EventSixTracks/SixPions/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); @@ -670,6 +669,22 @@ struct UpcTauCentralBarrelRL { histos.add("Events/Truth/hNmuons", ";Number of muons in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); histos.add("Events/Truth/hNpions", ";Number of pions in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); histos.add("Events/Truth/hNphysPartVsNwoutMotherParts", ";Number of physical primary particles (-);Number of particles without mother(-)", HistType::kTH2D, {confAxis.axisNparticles, confAxis.axisNparticles}); + histos.add("Tracks/Truth/hTauP", ";Tau #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("Tracks/Truth/hTauPt", ";Tau #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("Tracks/Truth/hTauPhi", ";Tau #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("Tracks/Truth/hTauEta", ";Tau #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); + histos.add("Tracks/Truth/hElectronP", ";Electron #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("Tracks/Truth/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("Tracks/Truth/hElectronPhi", ";Electron #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("Tracks/Truth/hElectronEta", ";Electron #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); + histos.add("Tracks/Truth/hMuonP", ";Muon #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("Tracks/Truth/hMuonPt", ";Muon #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("Tracks/Truth/hMuonPhi", ";Muon #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("Tracks/Truth/hMuonEta", ";Muon #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); + histos.add("Tracks/Truth/hPionP", ";Pion #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); + histos.add("Tracks/Truth/hPionPt", ";Pion #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); + histos.add("Tracks/Truth/hPionPhi", ";Pion #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); + histos.add("Tracks/Truth/hPionEta", ";Pion #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); } } // end init @@ -779,10 +794,10 @@ struct UpcTauCentralBarrelRL { if (eta(track.px(), track.py(), track.pz()) < -0.8 || eta(track.px(), track.py(), track.pz()) > 0.8) return false; // kPrimaryTracks - if (abs(track.dcaZ()) > 2.0) + if (std::abs(track.dcaZ()) > 2.0) return false; - float maxDCA = 0.0105f + 0.0350f / pow(track.pt(), 1.1f); - if (abs(track.dcaXY()) > maxDCA) + float maxDCA = 0.0105f + 0.0350f / std::pow(track.pt(), 1.1f); + if (std::abs(track.dcaXY()) > maxDCA) return false; // kQualityTrack // ITS @@ -876,8 +891,8 @@ struct UpcTauCentralBarrelRL { daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); mother = daug[0] + daug[1]; - pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(211), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(211), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kPiPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kPiMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); motherOfPions = pion[0] + pion[1]; if (cutTauEvent.cutOppositeCharge && (trkDaug1.sign() * trkDaug2.sign() > 0)) return false; @@ -998,11 +1013,11 @@ struct UpcTauCentralBarrelRL { daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); mother = daug[0] + daug[1]; - pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(211), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(211), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kPiPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kPiMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); motherOfPions = pion[0] + pion[1]; - muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(13), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(13), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kMuonPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kMuonMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); motherOfMuons = muon[0] + muon[1]; const auto acoplanarity = calculateAcoplanarity(daug[0].Phi(), daug[1].Phi()); if (cutTauEvent.applyTauEventSelection && !selectedTauEvent(trkDaug1, trkDaug2)) { @@ -1614,10 +1629,10 @@ struct UpcTauCentralBarrelRL { const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(vecPVidx[1]); daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); - pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(211), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(211), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); - muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(13), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); - muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(13), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kPiPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kPiMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); + muon[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kMuonPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); + muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kMuonMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); if (cutTauEvent.applyTauEventSelection && !selectedTauEvent(trkDaug1, trkDaug2)) { return; } @@ -2081,6 +2096,82 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("Events/FIT/hTimeFV0AvsFT0A"))->Fill(reconstructedCollision.timeFV0A(), reconstructedCollision.timeFT0A()); } + void fillTruthHistograms(aod::UDMcParticles const& particles) + { + histos.get(HIST("Events/Truth/hCountCollisions"))->Fill(1); + histos.get(HIST("Events/Truth/hNparticles"))->Fill(particles.size()); + histos.get(HIST("Events/Truth/hNphysPartVsNwoutMotherParts"))->Fill(countPhysicalPrimary(particles), countParticlesWithoutMother(particles)); + + int countElectrons = 0; + int countMuons = 0; + int countPions = 0; + + for (const auto& particle : particles) { + histos.get(HIST("Events/Truth/hPDGcodesAll"))->Fill(particle.pdgCode()); + // if (!particle.isPhysicalPrimary()) continue; + if (particle.has_mothers()) + continue; + histos.get(HIST("Events/Truth/hPDGcodesNoMother"))->Fill(particle.pdgCode()); + histos.get(HIST("Tracks/Truth/hTauPt"))->Fill(pt(particle.px(), particle.py())); + histos.get(HIST("Tracks/Truth/hTauP"))->Fill(momentum(particle.px(), particle.py(), particle.pz())); + histos.get(HIST("Tracks/Truth/hTauPhi"))->Fill(phi(particle.px(), particle.py())); + histos.get(HIST("Tracks/Truth/hTauEta"))->Fill(eta(particle.px(), particle.py(), particle.pz())); + const auto& daughters = particle.daughters_as(); + histos.get(HIST("Events/Truth/hNtauDaughters"))->Fill(daughters.size()); + for (const auto& daughter : daughters) { + histos.get(HIST("Events/Truth/hPDGcodesTauDaughters"))->Fill(daughter.pdgCode()); + if (enumMyParticle(daughter.pdgCode()) == P_ELECTRON) { + countElectrons++; + histos.get(HIST("Tracks/Truth/hElectronPt"))->Fill(pt(daughter.px(), daughter.py())); + histos.get(HIST("Tracks/Truth/hElectronP"))->Fill(momentum(daughter.px(), daughter.py(), daughter.pz())); + histos.get(HIST("Tracks/Truth/hElectronPhi"))->Fill(phi(daughter.px(), daughter.py())); + histos.get(HIST("Tracks/Truth/hElectronEta"))->Fill(eta(daughter.px(), daughter.py(), daughter.pz())); + } + if (enumMyParticle(daughter.pdgCode()) == P_MUON) { + countMuons++; + histos.get(HIST("Tracks/Truth/hMuonPt"))->Fill(pt(daughter.px(), daughter.py())); + histos.get(HIST("Tracks/Truth/hMuonP"))->Fill(momentum(daughter.px(), daughter.py(), daughter.pz())); + histos.get(HIST("Tracks/Truth/hMuonPhi"))->Fill(phi(daughter.px(), daughter.py())); + histos.get(HIST("Tracks/Truth/hMuonEta"))->Fill(eta(daughter.px(), daughter.py(), daughter.pz())); + } + if (enumMyParticle(daughter.pdgCode()) == P_PION) { + countPions++; + histos.get(HIST("Tracks/Truth/hPionPt"))->Fill(pt(daughter.px(), daughter.py())); + histos.get(HIST("Tracks/Truth/hPionP"))->Fill(momentum(daughter.px(), daughter.py(), daughter.pz())); + histos.get(HIST("Tracks/Truth/hPionPhi"))->Fill(phi(daughter.px(), daughter.py())); + histos.get(HIST("Tracks/Truth/hPionEta"))->Fill(eta(daughter.px(), daughter.py(), daughter.pz())); + } + } + } + + histos.get(HIST("Events/Truth/hNelectrons"))->Fill(countElectrons); + histos.get(HIST("Events/Truth/hNmuons"))->Fill(countMuons); + histos.get(HIST("Events/Truth/hNpions"))->Fill(countPions); + + if (countElectrons == 2) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EE); + if (countElectrons == 1 && countMuons == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMU); + if (countElectrons == 1 && countPions == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EPI); + if ((countElectrons == 1 && countMuons == 1) || (countElectrons == 1 && countPions == 1)) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMUPI); + if (countMuons == 2) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUMU); + if (countMuons == 1 && countPions == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUPI); + if (countPions == 2) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_PIPI); + if (countPions == 4) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_FOURPI); + if (countPions == 3 && countElectrons == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_ETHREEPI); + if (countPions == 3 && countMuons == 1) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUTHREEPI); + if (countPions == 6) + histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_SIXPI); + } + void processDataDG(FullUDCollision const& reconstructedCollision, FullUDTracks const& reconstructedBarrelTracks) { @@ -2205,64 +2296,12 @@ struct UpcTauCentralBarrelRL { } if (doTruthHistos) { - histos.get(HIST("Events/Truth/hCountCollisions"))->Fill(1); - histos.get(HIST("Events/Truth/hNparticles"))->Fill(particles.size()); - histos.get(HIST("Events/Truth/hNphysPartVsNwoutMotherParts"))->Fill(countPhysicalPrimary(particles), countParticlesWithoutMother(particles)); - - int countElectrons = 0; - int countMuons = 0; - int countPions = 0; - - for (const auto& particle : particles) { - histos.get(HIST("Events/Truth/hPDGcodesAll"))->Fill(particle.pdgCode()); - // if (!particle.isPhysicalPrimary()) continue; - if (particle.has_mothers()) - continue; - histos.get(HIST("Events/Truth/hPDGcodesNoMother"))->Fill(particle.pdgCode()); - const auto& daughters = particle.daughters_as(); - histos.get(HIST("Events/Truth/hNtauDaughters"))->Fill(daughters.size()); - for (const auto& daughter : daughters) { - histos.get(HIST("Events/Truth/hPDGcodesTauDaughters"))->Fill(daughter.pdgCode()); - if (enumMyParticle(daughter.pdgCode()) == P_ELECTRON) - countElectrons++; - if (enumMyParticle(daughter.pdgCode()) == P_MUON) - countMuons++; - if (enumMyParticle(daughter.pdgCode()) == P_PION) - countPions++; - } - } - - histos.get(HIST("Events/Truth/hNelectrons"))->Fill(countElectrons); - histos.get(HIST("Events/Truth/hNmuons"))->Fill(countMuons); - histos.get(HIST("Events/Truth/hNpions"))->Fill(countPions); - - if (countElectrons == 2) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EE); - if (countElectrons == 1 && countMuons == 1) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMU); - if (countElectrons == 1 && countPions == 1) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EPI); - if ((countElectrons == 1 && countMuons == 1) || (countElectrons == 1 && countPions == 1)) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMUPI); - if (countMuons == 2) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUMU); - if (countMuons == 1 && countPions == 1) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUPI); - if (countPions == 2) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_PIPI); - if (countPions == 4) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_FOURPI); - if (countPions == 3 && countElectrons == 1) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_ETHREEPI); - if (countPions == 3 && countMuons == 1) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUTHREEPI); - if (countPions == 6) - histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_SIXPI); + fillTruthHistograms(particles); } } // end processMCgenDG - void processTestMC(FullMCSGUDCollision const& reconstructedCollision, + void processTestMC(FullMCUDCollision const& reconstructedCollision, FullMCUDTracks const& reconstructedBarrelTracks, aod::UDMcCollisions const&, aod::UDMcParticles const&) From 216fa6cbfa9f2d406b07b757a2926be065915b26 Mon Sep 17 00:00:00 2001 From: a-m-andrushko <96832230+a-m-andrushko@users.noreply.github.com> Date: Mon, 2 Dec 2024 19:50:08 +0100 Subject: [PATCH 210/459] [PWGCF] FemtoUniverse -- Add track-nucleus analysis. (#8767) --- PWGCF/FemtoUniverse/Tasks/CMakeLists.txt | 7 +- .../femtoUniversePairTaskTrackNucleus.cxx | 843 ++++++++++++++++++ ...iversePairTaskTrackTrackMultKtExtended.cxx | 112 +-- 3 files changed, 864 insertions(+), 98 deletions(-) create mode 100644 PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx diff --git a/PWGCF/FemtoUniverse/Tasks/CMakeLists.txt b/PWGCF/FemtoUniverse/Tasks/CMakeLists.txt index 7e82d3c4525..0a4682a7f7a 100644 --- a/PWGCF/FemtoUniverse/Tasks/CMakeLists.txt +++ b/PWGCF/FemtoUniverse/Tasks/CMakeLists.txt @@ -29,6 +29,11 @@ o2physics_add_dpl_workflow(femtouniverse-pair-track-track-mult-kt-extended PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtouniverse-pair-track-nucleus + SOURCES femtoUniversePairTaskTrackNucleus.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtouniverse-pair-track-track-threedrelmom-mult-kt-extended SOURCES femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore @@ -92,4 +97,4 @@ o2physics_add_dpl_workflow(femtouniverse-efficiency-base o2physics_add_executable(femtouniverse-cutculator SOURCES femtoUniverseCutCulator.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx new file mode 100644 index 00000000000..4906ec103c0 --- /dev/null +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx @@ -0,0 +1,843 @@ +// Copyright 2019-2022 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file femtoUniversePairTaskTrackNucleus.cxx +/// \brief Tasks that reads the track tables used for the pairing and builds pairs of a track and a nucleus +/// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de +/// \author Georgios Mantzaridis, TU München, georgios.mantzaridis@tum.de +/// \author Anton Riedel, TU München, anton.riedel@tum.de +/// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch +/// \author Alicja Płachta, WUT Warsaw, alicja.plachta.stud@pw.edu.pl +/// \author Anna-Mariia Andrushko, WUT Warsaw, anna-mariia.andrushko@cern.ch + +#include +#include +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "TDatabasePDG.h" +#include "ReconstructionDataFormats/PID.h" +#include "Common/DataModel/PIDResponse.h" + +#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniversePairWithCentMultKt.h" + +using namespace o2; +using namespace o2::analysis::femtoUniverse; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; + +namespace +{ +static constexpr int nPart = 2; +static constexpr int nCuts = 5; +static const std::vector partNames{"Track", "Nucleus"}; +static const std::vector cutNames{"MaxPt", "PIDthr", "nSigmaTPC", "nSigmaTPCTOF", "MaxP"}; +static const float cutsTable[nPart][nCuts]{{4.05f, 1.f, 3.f, 3.f, 100.f}, {4.05f, 1.f, 3.f, 3.f, 100.f}}; +} // namespace + +struct femtoUniversePairTaskTrackNucleus { + + Service pdg; + + /// Selection part + + /// Table for both objects + struct : o2::framework::ConfigurableGroup { + Configurable IsKaonNsigma{"IsKaonNsigma", false, "Enable a strict cut selection for K+ and K-"}; + Configurable ConfNsigmaCombined{"ConfNsigmaCombined", 3.0f, "TPC and TOF Pion Sigma (combined) for momentum > ConfTOFpMin"}; + Configurable ConfNsigmaTPC{"ConfNsigmaTPC", 3.0f, "TPC Pion Sigma for momentum < ConfTOFpMin"}; + Configurable ConfTOFpMin{"ConfTOFpMin", 0.5f, "Min. momentum for which TOF is required for PID."}; + Configurable ConfEtaMax{"ConfEtaMax", 0.8f, "Higher limit for |Eta| (the same for both particles)"}; + + Configurable> ConfCutTable{"ConfCutTable", {cutsTable[0], nPart, nCuts, partNames, cutNames}, "Particle selections"}; + Configurable ConfNspecies{"ConfNspecies", 2, "Number of particle spieces with PID info"}; + Configurable ConfIsMC{"ConfIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; + Configurable> ConfTrkPIDnSigmaMax{"ConfTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; + Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; + } twoobjectsconfigs; + + /// Table for separate deuteron configurables + struct : o2::framework::ConfigurableGroup { + Configurable ConfNsigmaTPCDe{"ConfNsigmaTPCDe", 2.0f, "TPC Deuteron Sigma for momentum < ConfTOFpMinDe"}; + Configurable ConfNsigmaTOFDe{"ConfNsigmaTOFDe", 2.0f, "TOF Deuteron Sigma"}; + Configurable ConfTOFpMinDe{"ConfTOFpMinDe", 0.5f, "Min. momentum for deuterons for which TOF is required for PID"}; + Configurable ConfPLowDe{"ConfPLowDe", 0.8f, "Lower limit for momentum for deuterons"}; + Configurable ConfPHighDe{"ConfPHighDe", 1.8f, "Higher limit for momentum for deuterons"}; + } deuteronconfigs; + + /// Table for linear cut for TPC Deuteron Sigma + struct : o2::framework::ConfigurableGroup { + Configurable ConfIsLine{"ConfIsLine", false, "Enable a separation line for clearer TPC Deuteron Sigma"}; + Configurable LinCutpLow{"LinCutpLow", 0.0f, "Lower limit of momentum for linear cut of TPC Deuteron Sigma"}; + Configurable LinCutpHigh{"LinCutpHigh", 1.4f, "Higher limit of momentum for linear cut of TPC Deuteron Sigma"}; + Configurable LinCutParA{"LinCutParA", -167.0f, "Parameter 'A' of a linear function 'y = A * x + B'"}; + Configurable LinCutParB{"B", 300.0f, "Parameter 'B' of a linear function 'y = A * x + B'"}; + } lincut; + + /// Table for polynomial 3 cut for TPC Deuteron Sigma + struct : o2::framework::ConfigurableGroup { + Configurable ConfIsPol{"ConfIsPol", false, "Enable a separation polynomial 3 curve for clearer TPC Deuteron Sigma"}; + Configurable PolCutParA{"PolCutParA", -52.2f, "Parameter 'A' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; + Configurable PolCutParB{"PolCutParB", 357.7f, "Parameter 'B' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; + Configurable PolCutParC{"PolCutParC", -834.7f, "Parameter 'C' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; + Configurable PolCutParD{"PolCutParD", 705.8f, "Parameter 'D' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; + } polcut; + + using FemtoFullParticles = soa::Join; + + // Filters for selection + Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twoobjectsconfigs.ConfEtaMax); // example filtering on configurable + using FilteredFemtoFullParticles = soa::Filtered; + // using FilteredFemtoFullParticles = FemtoFullParticles; //if no filtering is applied uncomment this option + + SliceCache cache; + Preslice perCol = aod::femtouniverseparticle::fdCollisionId; + + /// Track + struct : o2::framework::ConfigurableGroup { + Configurable ConfPDGCodeTrack{"ConfPDGCodeTrack", 321, "Track -- PDG code"}; + // Configurable ConfCutTrack{"ConfCutTrack", 5542474, "Track -- Selection bit from cutCulator"}; + Configurable ConfPIDTrack{"ConfPIDTrack", 3, "Track -- Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector>int>> + Configurable ConfPtLowTrack{"ConfPtLowTrack", 0.14, "Lower pT limit for track"}; + Configurable ConfPtHighTrack{"ConfPtHighTrack", 1.5, "Higher pT limit for track"}; + Configurable ConfChargeTrack{"ConfChargeTrack", 1, "Track sign"}; // -1 means anti-particle + } trackfilter; + + /// Partition for track + Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackfilter.ConfChargeTrack && aod::femtouniverseparticle::pt < trackfilter.ConfPtHighTrack && aod::femtouniverseparticle::pt > trackfilter.ConfPtLowTrack; + + Partition> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackfilter.ConfChargeTrack && aod::femtouniverseparticle::pt < trackfilter.ConfPtHighTrack && aod::femtouniverseparticle::pt > trackfilter.ConfPtLowTrack; + + /// Histogramming for track + FemtoUniverseParticleHisto trackHistoTrack; + + /// Nucleus + struct : o2::framework::ConfigurableGroup { + Configurable ConfPDGCodeNucleus{"ConfPDGCodeNucleus", 1000010020, "Nucleus -- PDG code"}; + // Configurable ConfCutNucleus{"ConfCutNucleus", 5542474, "Nucleus -- Selection bit"}; + Configurable ConfPIDNucleus{"ConfPIDNucleus", 5, "Nucleus -- Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> + Configurable ConfPtLowNucleus{"ConfPtLowNucleus", 0, "Lower pT limit for nucleus"}; + Configurable ConfPtHighNucleus{"ConfPtHighNucleus", 5, "Higher pT limit for nucleus"}; + Configurable ConfChargeNucleus{"ConfChargeNucleus", 1, "Nucleus sign"}; // -1 means anti-nucleus + } nucleusfilter; + + /// Partition for nucleus + Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == nucleusfilter.ConfChargeNucleus) && aod::femtouniverseparticle::pt < nucleusfilter.ConfPtHighNucleus && aod::femtouniverseparticle::pt > nucleusfilter.ConfPtLowNucleus; + + Partition> partsTwoMC = aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack) && (aod::femtouniverseparticle::sign == nucleusfilter.ConfChargeNucleus) && aod::femtouniverseparticle::pt < nucleusfilter.ConfPtHighNucleus && aod::femtouniverseparticle::pt > nucleusfilter.ConfPtLowNucleus; + + /// Histogramming for nucleus + FemtoUniverseParticleHisto trackHistoNucleus; + + /// Histogramming for Event + FemtoUniverseEventHisto eventHisto; + + /// The configurables need to be passed to an std::vector + int vPIDTrack, vPIDNucleus; + std::vector kNsigma; + + /// Event part + Configurable ConfV0MLow{"ConfV0MLow", 0.0, "Lower limit for V0M multiplicity"}; + Configurable ConfV0MHigh{"ConfV0MHigh", 25000.0, "Upper limit for V0M multiplicity"}; + Configurable ConfSphericityCutMin{"ConfSphericityCutMin", 0, "Min. sphericity"}; + Configurable ConfSphericityCutMax{"ConfSphericityCutMax", 3, "Max. sphericity"}; + + Filter collV0Mfilter = ((o2::aod::femtouniversecollision::multV0M > ConfV0MLow) && (o2::aod::femtouniversecollision::multV0M < ConfV0MHigh)); + Filter colSpherfilter = ((o2::aod::femtouniversecollision::sphericity > ConfSphericityCutMin) && (o2::aod::femtouniversecollision::sphericity < ConfSphericityCutMax)); + // Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twoobjectsconfigs.ConfEtaMax); // example filtering on configurable + + /// Particle part + ConfigurableAxis ConfTempFitVarBins{"ConfDTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis ConfTempFitVarpTBins{"ConfTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; + + /// Correlation part + ConfigurableAxis ConfMultBins{"ConfMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f, 99999.f}, "Mixing bins -- multiplicity or centrality"}; // \todo to be obtained from the hash task + ConfigurableAxis ConfMultKstarBins{"ConfMultKstarBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 100.0f, 99999.f}, "Bins for kstar analysis in multiplicity or centrality bins (10 is maximum)"}; + ConfigurableAxis ConfKtKstarBins{"ConfKtKstarBins", {VARIABLE_WIDTH, 0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0f, 2.0f, 99999.f}, "Bins for kstar analysis in kT bins (10 is maximum)"}; + ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -5.f, 0.f, 5.f, 10.f}, "Mixing bins -- z-vertex"}; + + ConfigurableAxis ConfmTBins3D{"ConfmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + ConfigurableAxis ConfmultBins3D{"ConfmultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + + ColumnBinningPolicy colBinning{{ConfVtxBins, ConfMultBins}, true}; + + ConfigurableAxis ConfkstarBins{"ConfkstarBins", {1500, 0., 6.}, "binning kstar"}; + ConfigurableAxis ConfkTBins{"ConfkTBins", {150, 0., 9.}, "binning kT"}; + ConfigurableAxis ConfmTBins{"ConfmTBins", {225, 0., 7.5}, "binning mT"}; + Configurable ConfNEventsMix{"ConfNEventsMix", 5, "Number of events for mixing"}; + Configurable ConfIsCPR{"ConfIsCPR", true, "Close Pair Rejection"}; + Configurable ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"}; + Configurable ConfCPRdeltaPhiCutMax{"ConfCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; + Configurable ConfCPRdeltaPhiCutMin{"ConfCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; + Configurable ConfCPRdeltaEtaCutMax{"ConfCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; + Configurable ConfCPRdeltaEtaCutMin{"ConfCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; + Configurable ConfCPRChosenRadii{"ConfCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; + + Configurable IsPairIdentical{"IsPairIdentical", true, "'true' for identical particles, 'false' for non-identical particles"}; + Configurable cfgProcessPM{"cfgProcessPM", true, "Process differently charged particles (plus-minus)"}; + Configurable cfgProcessPP{"cfgProcessPP", true, "Process positively charged particles (plus-plus)"}; + Configurable cfgProcessMM{"cfgProcessMM", true, "Process negatively charged particles (minus-minus)"}; + Configurable cfgProcessMultBins{"cfgProcessMultBins", true, "Process kstar histograms (in multiplicity bins)"}; + Configurable cfgProcessKtBins{"cfgProcessKtBins", true, "Process kstar histograms in kT bins (if 'cfgProcessMultBins' is false, it will not be processed regardless of 'cfgProcessKtBins' state)"}; + Configurable cfgProcessKtMt3DCF{"cfgProcessKtMt3DCF", false, "Process 3D histograms in kT and MultBins"}; + + FemtoUniverseFemtoContainer sameEventCont; + FemtoUniverseFemtoContainer mixedEventCont; + + FemtoUniverseFemtoContainer sameEventContPP; + FemtoUniverseFemtoContainer mixedEventContPP; + + FemtoUniverseFemtoContainer sameEventContMM; + FemtoUniverseFemtoContainer mixedEventContMM; + + FemtoUniversePairCleaner pairCleaner; + FemtoUniverseDetaDphiStar pairCloseRejection; + FemtoUniverseTrackSelection trackCuts; + + PairWithCentMultKt sameEventMultCont; + PairWithCentMultKt mixedEventMultCont; + + PairWithCentMultKt sameEventMultContPP; + PairWithCentMultKt mixedEventMultContPP; + + PairWithCentMultKt sameEventMultContMM; + PairWithCentMultKt mixedEventMultContMM; + + float mass1 = -1; + float mass2 = -1; + + /// Histogram output + HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry resultRegistryPM{"CorrelationsPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry resultRegistryPP{"CorrelationsPP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry resultRegistryMM{"CorrelationsMM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MixQaRegistry{"MixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; + + HistogramRegistry SameMultRegistryPM{"SameMultRegistryPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MixedMultRegistryPM{"MixedMultRegistryPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + HistogramRegistry SameMultRegistryPP{"SameMultRegistryPP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MixedMultRegistryPP{"MixedMultRegistryPP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + HistogramRegistry SameMultRegistryMM{"SameMultRegistryMM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MixedMultRegistryMM{"MixedMultRegistryMM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + HistogramRegistry sphericityRegistry{"SphericityHisto", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + /// TPC Pion/Kaon/Proton Sigma selection (general) + bool IsNSigma(float mom, float nsigmaTPC, float nsigmaTOF) + { + // |nsigma_TPC| < 3 for p < 0.5 GeV/c + // |nsigma_combined| < 3 for p > 0.5 + + // using configurables: + // ConfTOFpMin -- momentum value when we start using TOF; set to 1000 if TOF not needed + // ConfNsigmaTPC -> TPC Sigma for momentum < ConfTOFpMin + // ConfNsigmaCombined -> TPC and TOF Sigma (combined) for momentum > ConfTOFpMin + + if (mom < twoobjectsconfigs.ConfTOFpMin) { + return TMath::Abs(nsigmaTPC) < twoobjectsconfigs.ConfNsigmaTPC; + } else { + return TMath::Hypot(nsigmaTOF, nsigmaTPC) < twoobjectsconfigs.ConfNsigmaCombined; + } + } + + /// TPC Kaon Sigma selection (stricter cuts for K+ and K-) -- based on Run2 results + bool IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK) + { + if (twoobjectsconfigs.IsKaonNsigma == true) { + if (mom < 0.4) { + return TMath::Abs(nsigmaTPCK) < 2; + } else if (mom > 0.4 && mom < 0.45) { + return TMath::Abs(nsigmaTPCK) < 1; + } else if (mom > 0.45 && mom < 0.8) { + return (TMath::Abs(nsigmaTPCK) < 3 && TMath::Abs(nsigmaTOFK) < 2); + } else if (mom > 0.8 && mom < 1.5) { + return (TMath::Abs(nsigmaTPCK) < 3 && TMath::Abs(nsigmaTOFK) < 1.5); + } else { + return false; + } + } else { + return IsNSigma(mom, nsigmaTPCK, nsigmaTOFK); + } + } + + /// TPC Deuteron Sigma selection + bool IsDeuteronNSigma(float mom, float nsigmaTPCDe, float nsigmaTOFDe) + { + if (mom > deuteronconfigs.ConfPLowDe && mom < deuteronconfigs.ConfPHighDe) { + if (mom < deuteronconfigs.ConfTOFpMinDe) { + return (TMath::Abs(nsigmaTPCDe) < deuteronconfigs.ConfNsigmaTPCDe); + } else { + return (TMath::Abs(nsigmaTOFDe) < deuteronconfigs.ConfNsigmaTOFDe && (TMath::Abs(nsigmaTPCDe) < deuteronconfigs.ConfNsigmaTPCDe)); + } + } else { + return false; + } + } + + /// Linear cut for clearer TPC Deuteron Sigma + bool IsDeuteronNSigmaLinearCut(float mom, float nsigmaTPCDe, float nsigmaTOFDe, float tpcSignal) + { + if (lincut.ConfIsLine == true) { + if (mom > lincut.LinCutpLow && mom < lincut.LinCutpHigh) { + if (tpcSignal > lincut.LinCutParA * mom + lincut.LinCutParB) { + return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); + } else { + return false; + } + } else { + return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); + } + } else { + return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); + } + } + + /// Polynomial 3 cut for clearer TPC Deuteron Sigma + bool IsDeuteronNSigmaPolCut(float mom, float nsigmaTPCDe, float nsigmaTOFDe, float tpcSignal) + { + if (polcut.ConfIsPol == true) { + if (tpcSignal > polcut.PolCutParA * TMath::Power(mom, 3) + polcut.PolCutParB * TMath::Power(mom, 2) + polcut.PolCutParC * mom + polcut.PolCutParD) { + return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); + } else { + return false; + } + } else { + return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); + } + } + + bool IsParticleNSigma(int8_t object_number, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK, float nsigmaTPCDe, float nsigmaTOFDe, float tpcSignal) + { + if (object_number == 1) { + switch (trackfilter.ConfPDGCodeTrack) { + case 2212: // Proton + case -2212: // Anti-proton + return IsNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); + break; + case 211: // Pion+ + case -211: // Pion- + case 111: // Pion 0 + return IsNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); + break; + case 321: // Kaon+ + case -321: // Kaon- + return IsKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); + break; + case 130: // Kaon 0 LONG + case 310: // Kaon 0 SHORT + return IsNSigma(mom, nsigmaTPCK, nsigmaTOFK); + break; + case 1000010020: // Deuteron + case -1000010020: // Anti-deuteron + return IsDeuteronNSigmaPolCut(mom, nsigmaTPCDe, nsigmaTOFDe, tpcSignal); + break; + default: + return false; + } + return false; + } else if (object_number == 2) { + switch (nucleusfilter.ConfPDGCodeNucleus) { + case 2212: // Proton + case -2212: // Anti-proton + return IsNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); + break; + case 211: // Pion+ + case -211: // Pion- + case 111: // Pion 0 + return IsNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); + break; + case 321: // Kaon+ + case -321: // Kaon- + return IsKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); + break; + case 130: // Kaon 0 LONG + case 310: // Kaon 0 SHORT + return IsNSigma(mom, nsigmaTPCK, nsigmaTOFK); + break; + case 1000010020: // Deuteron + case -1000010020: // Anti-deuteron + return IsDeuteronNSigmaPolCut(mom, nsigmaTPCDe, nsigmaTOFDe, tpcSignal); + break; + default: + return false; + } + return false; + } else { + LOGF(fatal, "Wrong number of objects chosen! It should be 1 or 2. It is -> %d", object_number); + } + return false; + } + + void init(InitContext&) + { + eventHisto.init(&qaRegistry); + sphericityRegistry.add("sphericity", ";Sphericity;Entries", kTH1F, {{150, 0.0, 3, "Sphericity"}}); + + trackHistoTrack.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarBins, twoobjectsconfigs.ConfIsMC, trackfilter.ConfPDGCodeTrack, true); + + trackHistoNucleus.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarBins, twoobjectsconfigs.ConfIsMC, nucleusfilter.ConfPDGCodeNucleus, true); + + MixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + MixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + + mass1 = pdg->Mass(trackfilter.ConfPDGCodeTrack); + mass2 = pdg->Mass(nucleusfilter.ConfPDGCodeNucleus); + + if (cfgProcessPM) { + sameEventCont.init(&resultRegistryPM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + mixedEventCont.init(&resultRegistryPM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + + sameEventCont.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + mixedEventCont.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + + if (cfgProcessMultBins) { + sameEventMultCont.init(&SameMultRegistryPM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + mixedEventMultCont.init(&MixedMultRegistryPM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + } + } + + if (cfgProcessPP) { + sameEventContPP.init(&resultRegistryPP, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + mixedEventContPP.init(&resultRegistryPP, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + sameEventContPP.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + mixedEventContPP.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + + if (cfgProcessMultBins) { + sameEventMultContPP.init(&SameMultRegistryPP, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + mixedEventMultContPP.init(&MixedMultRegistryPP, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + } + } + + if (cfgProcessMM) { + sameEventContMM.init(&resultRegistryMM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + mixedEventContMM.init(&resultRegistryMM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + sameEventContMM.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + mixedEventContMM.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + + if (cfgProcessMultBins) { + sameEventMultContMM.init(&SameMultRegistryMM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + mixedEventMultContMM.init(&MixedMultRegistryMM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + } + } + + pairCleaner.init(&qaRegistry); + if (ConfIsCPR.value) { + pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); + } + + vPIDTrack = trackfilter.ConfPIDTrack.value; + vPIDNucleus = nucleusfilter.ConfPIDNucleus.value; + kNsigma = twoobjectsconfigs.ConfTrkPIDnSigmaMax.value; + } + + template + void fillCollision(CollisionType col) + { + MixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multV0M()})); + eventHisto.fillQA(col); + } + + /// This function processes 'same event' and takes care of all the histogramming + /// \todo the trivial loops over the tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... + /// \tparam PartitionType + /// \tparam PartType + /// \tparam isMC: enables Monte Carlo truth specific histograms + /// \param groupTrack partition for track passed by the process function + /// \param groupNucleus partition for nucleus passed by the process function + /// \param parts femtoUniverseParticles table (in case of Monte Carlo joined with FemtoUniverseMCLabels) + /// \param magFieldTesla magnetic field of the collision + /// \param multCol multiplicity of the collision + /// \param pairType describes charge of correlation pair (plus-minus (1), plus-plus (2), minus-minus (3)) + /// \param fillQA enables filling of QA histograms + template + void doSameEvent(PartitionType groupTrack, PartitionType groupNucleus, PartType parts, float magFieldTesla, int multCol, int pairType, bool fillQA) + { + /// Histogramming SameEvent + if ((pairType == 1 || pairType == 2) && fillQA) { + for (auto& part : groupTrack) { + if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { + continue; + } + trackHistoTrack.fillQA(part); + } + } + + if ((pairType == 1 || pairType == 3) && fillQA) { + for (auto& part : groupNucleus) { + if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { + continue; + } + trackHistoNucleus.fillQA(part); + } + } + + if (pairType == 1) { + /// Combinations for non-identical pairs + for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupTrack, groupNucleus))) { + + if (!IsParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + continue; + } + + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + continue; + } + + if (ConfIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + continue; + } + } + + // Cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } + + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + sameEventCont.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + sameEventMultCont.fill(kstar, multCol, kT); + } + } else { + /// Combinations for identical pairs + for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupTrack, groupTrack))) { + + if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + continue; + } + + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + continue; + } + + if (ConfIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + continue; + } + } + + // Cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } + + switch (pairType) { + case 2: { + if (IsPairIdentical == true) { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass1); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass1); + + sameEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + sameEventMultContPP.fill(kstar, multCol, kT); + } else { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + sameEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + sameEventMultContPP.fill(kstar, multCol, kT); + } + + break; + } + + case 3: { + if (IsPairIdentical == true) { + float kstar = FemtoUniverseMath::getkstar(p1, mass2, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass2, p2, mass2); + + sameEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + sameEventMultContMM.fill(kstar, multCol, kT); + } else { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + sameEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + sameEventMultContMM.fill(kstar, multCol, kT); + } + + break; + } + + default: + break; + } + } + } + } + + /// Process function to call doSameEvent with Data + /// \param col subscribe to the collision table (Data) + /// \param parts subscribe to the femtoUniverseParticleTable + void processSameEvent(soa::Filtered::iterator& col, + FilteredFemtoFullParticles& parts) + { + fillCollision(col); + sphericityRegistry.fill(HIST("sphericity"), col.sphericity()); + + auto thegroupTrack = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupNucleus = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + + bool fillQA = true; + + if (cfgProcessPM) { + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 1, fillQA); + fillQA = false; + } + + if (cfgProcessPP) + doSameEvent(thegroupTrack, thegroupTrack, parts, col.magField(), col.multV0M(), 2, fillQA); + + if (cfgProcessMM) + doSameEvent(thegroupNucleus, thegroupNucleus, parts, col.magField(), col.multV0M(), 3, fillQA); + } + PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processSameEvent, "Enable processing same event", true); + + /// Process function to call doSameEvent with Monte Carlo + /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) + /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth + /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo Truth table + void processSameEventMC(o2::aod::FDCollision& col, + soa::Join& parts, + o2::aod::FDMCParticles&) + { + fillCollision(col); + + auto thegroupTrack = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupNucleus = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + + bool fillQA = true; + + if (cfgProcessPM) { + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 1, fillQA); + fillQA = false; + } + + if (cfgProcessPP) + doSameEvent(thegroupTrack, thegroupTrack, parts, col.magField(), col.multV0M(), 2, fillQA); + + if (cfgProcessMM) + doSameEvent(thegroupNucleus, thegroupNucleus, parts, col.magField(), col.multV0M(), 3, fillQA); + } + PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processSameEventMC, "Enable processing same event for Monte Carlo", false); + + /// This function processes 'mixed event' + /// \todo the trivial loops over the collisions and tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... + /// \tparam PartitionType + /// \tparam PartType + /// \tparam isMC: enables Monte Carlo truth specific histograms + /// \param groupTrack partition for track passed by the process function + /// \param groupNucleus partition for nucleus passed by the process function + /// \param parts femtoUniverseParticles table (in case of Monte Carlo joined with FemtoUniverseMCLabels) + /// \param magFieldTesla magnetic field of the collision + /// \param multCol multiplicity of the collision + /// \param pairType describes charge of correlation pair (plus-minus (1), plus-plus (2), minus-minus (3)) + template + void doMixedEvent(PartitionType groupTrack, PartitionType groupNucleus, PartType parts, float magFieldTesla, int multCol, int pairType) + { + for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupTrack, groupNucleus))) { + + if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + continue; + } + + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + continue; + } + + if (ConfIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { + continue; + } + } + + switch (pairType) { + case 1: { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + mixedEventCont.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + mixedEventMultCont.fill(kstar, multCol, kT); + + break; + } + + case 2: { + if (IsPairIdentical == true) { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass1); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass1); + + mixedEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + mixedEventMultContPP.fill(kstar, multCol, kT); + } else { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + mixedEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + mixedEventMultContPP.fill(kstar, multCol, kT); + } + + break; + } + + case 3: { + if (IsPairIdentical == true) { + float kstar = FemtoUniverseMath::getkstar(p1, mass2, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass2, p2, mass2); + + mixedEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + mixedEventMultContMM.fill(kstar, multCol, kT); + } else { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + mixedEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + mixedEventMultContMM.fill(kstar, multCol, kT); + } + + break; + } + + default: + break; + } + } + } + + /// Process function to call doMixedEvent with Data + /// \param cols subscribe to the collisions table (Data) + /// \param parts subscribe to the femtoUniverseParticleTable + void processMixedEvent(soa::Filtered& cols, + FilteredFemtoFullParticles& parts) + { + for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + + const int multiplicityCol = collision1.multV0M(); + MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + + const auto& magFieldTesla1 = collision1.magField(); + const auto& magFieldTesla2 = collision2.magField(); + + if (magFieldTesla1 != magFieldTesla2) { + continue; + } + + if (cfgProcessPM) { + auto groupTrack = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 1); + } + + if (cfgProcessPP) { + auto groupTrack = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 2); + } + + if (cfgProcessMM) { + auto groupTrack = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 3); + } + } + } + PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processMixedEvent, "Enable processing mixed events", true); + + /// Process function to call doMixedEvent with Monte Carlo + /// \param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) + /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth + /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table + void processMixedEventMC(o2::aod::FDCollisions& cols, + soa::Join& parts, + o2::aod::FDMCParticles&) + { + for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + + const int multiplicityCol = collision1.multV0M(); + MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + + const auto& magFieldTesla1 = collision1.magField(); + const auto& magFieldTesla2 = collision2.magField(); + + if (magFieldTesla1 != magFieldTesla2) { + continue; + } + /// \todo before mixing we should check whether both collisions contain a pair of particles! + // if (partsOne.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partsTwo.size() == 0 ) continue; + + if (cfgProcessPM) { + auto groupTrack = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 1); + } + + if (cfgProcessPP) { + auto groupTrack = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 2); + } + + if (cfgProcessMM) { + auto groupTrack = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 3); + } + } + } + PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processMixedEventMC, "Enable processing mixed events MC", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{ + adaptAnalysisTask(cfgc), + }; + + return workflow; +} diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx index f7f9baa6d87..41bbc51b54e 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx @@ -77,33 +77,6 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; } twotracksconfigs; - /// Table for separate deuteron configurables - struct : o2::framework::ConfigurableGroup { - Configurable ConfNsigmaTPCDe{"ConfNsigmaTPCDe", 2.0f, "TPC Deuteron Sigma for momentum < ConfTOFpMinDe"}; - Configurable ConfNsigmaTOFDe{"ConfNsigmaTOFDe", 2.0f, "TOF Deuteron Sigma"}; - Configurable ConfTOFpMinDe{"ConfTOFpMinDe", 0.5f, "Min. momentum for deuterons for which TOF is required for PID"}; - Configurable ConfPLowDe{"ConfPLowDe", 0.8f, "Lower limit for momentum for deuterons"}; - Configurable ConfPHighDe{"ConfPHighDe", 1.8f, "Higher limit for momentum for deuterons"}; - } deuteronconfigs; - - /// Table for linear cut for TPC Deuteron Sigma - struct : o2::framework::ConfigurableGroup { - Configurable ConfIsLine{"ConfIsLine", false, "Enable a separation line for clearer TPC Deuteron Sigma"}; - Configurable pLow{"pLow", 0.0f, "Lower limit of momentum for linear cut of TPC Deuteron Sigma"}; - Configurable pHigh{"pHigh", 1.4f, "Higher limit of momentum for linear cut of TPC Deuteron Sigma"}; - Configurable a{"a", -167.0f, "Parameter 'a' of a linear function 'y = a * x + b'"}; - Configurable b{"b", 300.0f, "Parameter 'b' of a linear function 'y = a * x + b'"}; - } lincut; - - /// Table for polynomial 3 cut for TPC Deuteron Sigma - struct : o2::framework::ConfigurableGroup { - Configurable ConfIsPol{"ConfIsPol", false, "Enable a separation polynomial 3 curve for clearer TPC Deuteron Sigma"}; - Configurable A{"A", -52.2f, "Parameter 'A' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; - Configurable B{"B", 357.7f, "Parameter 'B' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; - Configurable C{"C", -834.7f, "Parameter 'C' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; - Configurable D{"D", 705.8f, "Parameter 'D' of a polynomial function 'y = A * x^3 + B * x^2 + C * x + D'"}; - } polcut; - using FemtoFullParticles = soa::Join; // Filters for selecting particles (both p1 and p2) Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.ConfEtaMax); // example filtering on configurable @@ -118,15 +91,15 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { Configurable ConfPDGCodePartOne{"ConfPDGCodePartOne", 211, "Particle 1 -- PDG code"}; // Configurable ConfCutPartOne{"ConfCutPartOne", 5542474, "Particle 1 -- Selection bit from cutCulator"}; Configurable ConfPIDPartOne{"ConfPIDPartOne", 2, "Particle 1 -- Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector>int>> - Configurable ConfPtLowPart1{"ConfPtLowPart1", 0.14, "Lower limit for Pt for the first particle"}; + Configurable ConfpLowPart1{"ConfpLowPart1", 0.14, "Lower limit for Pt for the first particle"}; Configurable ConfPtHighPart1{"ConfPtHighPart1", 1.5, "Higher limit for Pt for the first particle"}; Configurable ConfChargePart1{"ConfChargePart1", 1, "Particle 1 sign"}; } trackonefilter; /// Partition for particle 1 - Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackonefilter.ConfChargePart1 && aod::femtouniverseparticle::pt < trackonefilter.ConfPtHighPart1 && aod::femtouniverseparticle::pt > trackonefilter.ConfPtLowPart1; + Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackonefilter.ConfChargePart1 && aod::femtouniverseparticle::pt < trackonefilter.ConfPtHighPart1 && aod::femtouniverseparticle::pt > trackonefilter.ConfpLowPart1; - Partition> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackonefilter.ConfChargePart1 && aod::femtouniverseparticle::pt < trackonefilter.ConfPtHighPart1 && aod::femtouniverseparticle::pt > trackonefilter.ConfPtLowPart1; + Partition> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackonefilter.ConfChargePart1 && aod::femtouniverseparticle::pt < trackonefilter.ConfPtHighPart1 && aod::femtouniverseparticle::pt > trackonefilter.ConfpLowPart1; /// Histogramming for particle 1 FemtoUniverseParticleHisto trackHistoPartOne; @@ -136,15 +109,15 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { Configurable ConfPDGCodePartTwo{"ConfPDGCodePartTwo", 211, "Particle 2 -- PDG code"}; // Configurable ConfCutPartTwo{"ConfCutPartTwo", 5542474, "Particle 2 -- Selection bit"}; Configurable ConfPIDPartTwo{"ConfPIDPartTwo", 2, "Particle 2 -- Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> - Configurable ConfPtLowPart2{"ConfPtLowPart2", 0.14, "Lower limit for Pt for the second particle"}; + Configurable ConfpLowPart2{"ConfpLowPart2", 0.14, "Lower limit for Pt for the second particle"}; Configurable ConfPtHighPart2{"ConfPtHighPart2", 1.5, "Higher limit for Pt for the second particle"}; Configurable ConfChargePart2{"ConfChargePart2", -1, "Particle 2 sign"}; } tracktwofilter; /// Partition for particle 2 - Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == tracktwofilter.ConfChargePart2) && aod::femtouniverseparticle::pt < tracktwofilter.ConfPtHighPart2 && aod::femtouniverseparticle::pt > tracktwofilter.ConfPtLowPart2; + Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == tracktwofilter.ConfChargePart2) && aod::femtouniverseparticle::pt < tracktwofilter.ConfPtHighPart2 && aod::femtouniverseparticle::pt > tracktwofilter.ConfpLowPart2; - Partition> partsTwoMC = aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack) && (aod::femtouniverseparticle::sign == tracktwofilter.ConfChargePart2) && aod::femtouniverseparticle::pt < tracktwofilter.ConfPtHighPart2 && aod::femtouniverseparticle::pt > tracktwofilter.ConfPtLowPart2; + Partition> partsTwoMC = aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack) && (aod::femtouniverseparticle::sign == tracktwofilter.ConfChargePart2) && aod::femtouniverseparticle::pt < tracktwofilter.ConfPtHighPart2 && aod::femtouniverseparticle::pt > tracktwofilter.ConfpLowPart2; /// Histogramming for particle 2 FemtoUniverseParticleHisto trackHistoPartTwo; @@ -283,53 +256,7 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { } } - /// TPC Deuteron Sigma selection - bool IsDeuteronNSigma(float mom, float nsigmaTPCDe, float nsigmaTOFDe) - { - if (mom > deuteronconfigs.ConfPLowDe && mom < deuteronconfigs.ConfPHighDe) { - if (mom < deuteronconfigs.ConfTOFpMinDe) { - return TMath::Abs(nsigmaTPCDe) < deuteronconfigs.ConfNsigmaTPCDe; - } else { - return (TMath::Abs(nsigmaTOFDe) < deuteronconfigs.ConfNsigmaTOFDe && (TMath::Abs(nsigmaTPCDe) < deuteronconfigs.ConfNsigmaTPCDe)); - } - } else { - return false; - } - } - - /// Linear cut for clearer TPC Deuteron Sigma - bool IsDeuteronNSigmaLinearCut(float mom, float nsigmaTPCDe, float nsigmaTOFDe, float tpcSignal) - { - if (lincut.ConfIsLine == true) { - if (mom > lincut.pLow && mom < lincut.pHigh) { - if (tpcSignal > lincut.a * mom + lincut.b) { - return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); - } else { - return false; - } - } else { - return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); - } - } else { - return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); - } - } - - /// Polynomial 3 cut for clearer TPC Deuteron Sigma - bool IsDeuteronNSigmaPolCut(float mom, float nsigmaTPCDe, float nsigmaTOFDe, float tpcSignal) - { - if (polcut.ConfIsPol == true) { - if (tpcSignal > polcut.A * TMath::Power(mom, 3) + polcut.B * TMath::Power(mom, 2) + polcut.C * mom + polcut.D) { - return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); - } else { - return false; - } - } else { - return IsDeuteronNSigma(mom, nsigmaTPCDe, nsigmaTOFDe); - } - } - - bool IsParticleNSigma(int8_t particle_number, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK, float nsigmaTPCDe, float nsigmaTOFDe, float tpcSignal) + bool IsParticleNSigma(int8_t particle_number, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) { if (particle_number == 1) { switch (trackonefilter.ConfPDGCodePartOne) { @@ -350,10 +277,6 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { case 310: // Kaon 0 SHORT return IsNSigma(mom, nsigmaTPCK, nsigmaTOFK); break; - case 1000010020: // Deuteron+ - case -1000010020: // Deuteron- - return IsDeuteronNSigmaPolCut(mom, nsigmaTPCDe, nsigmaTOFDe, tpcSignal); - break; default: return false; } @@ -377,11 +300,6 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { case 310: // Kaon 0 SHORT return IsNSigma(mom, nsigmaTPCK, nsigmaTOFK); break; - case 1000010020: // Deuteron+ - case -1000010020: // Deuteron- - return IsDeuteronNSigmaPolCut(mom, nsigmaTPCDe, nsigmaTOFDe, tpcSignal); - break; - default: return false; } return false; @@ -479,7 +397,7 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { /// Histogramming same event if ((pairType == 1 || pairType == 2) && fillQA) { for (auto& part : groupPartsOne) { - if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { + if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { continue; } trackHistoPartOne.fillQA(part); @@ -488,7 +406,7 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { if ((pairType == 1 || pairType == 3) && fillQA) { for (auto& part : groupPartsTwo) { - if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { + if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { continue; } trackHistoPartTwo.fillQA(part); @@ -500,11 +418,11 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { /// Now build the combinations for non-identical particle pairs for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (!IsParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + if (!IsParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon))) { continue; } - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon))) { continue; } @@ -530,11 +448,11 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { /// Now build the combinations for identical particles pairs for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsOne, groupPartsOne))) { - if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon))) { continue; } - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon))) { continue; } @@ -663,11 +581,11 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon))) { continue; } - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon))) { continue; } From d501264b26dd207a8e4d55f3c527af6310be1102 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 2 Dec 2024 19:56:37 +0100 Subject: [PATCH 211/459] [Common] centrality study update (#8773) Co-authored-by: ALICE Builder --- Common/Tasks/centralityStudy.cxx | 91 +++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 7 deletions(-) diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index 1ce0eb39680..bcb714d2a87 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -35,6 +35,11 @@ struct centralityStudy { // Configurables Configurable do2DPlots{"do2DPlots", true, "0 - no, 1 - yes"}; + Configurable doOccupancyStudyVsCentrality2d{"doOccupancyStudyVsCentrality2d", true, "0 - no, 1 - yes"}; + Configurable doOccupancyStudyVsRawValues2d{"doOccupancyStudyVsRawValues2d", true, "0 - no, 1 - yes"}; + Configurable doOccupancyStudyVsCentrality3d{"doOccupancyStudyVsCentrality3d", false, "0 - no, 1 - yes"}; + Configurable doOccupancyStudyVsRawValues3d{"doOccupancyStudyVsRawValues3d", false, "0 - no, 1 - yes"}; + Configurable doNGlobalTracksVsRawSignals{"doNGlobalTracksVsRawSignals", true, "0 - no, 1 - yes"}; Configurable applySel8{"applySel8", true, "0 - no, 1 - yes"}; Configurable applyVtxZ{"applyVtxZ", true, "0 - no, 1 - yes"}; @@ -88,6 +93,9 @@ struct centralityStudy { ConfigurableAxis axisMultPVContributors{"axisMultPVContributors", {200, 0, 6000}, "Number of PV Contributors"}; ConfigurableAxis axisMultGlobalTracks{"axisMultGlobalTracks", {500, 0, 5000}, "Number of global tracks"}; + ConfigurableAxis axisTrackOccupancy{"axisTrackOccupancy", {50, 0, 5000}, "Track occupancy"}; + ConfigurableAxis axisFT0COccupancy{"axisFT0COccupancy", {50, 0, 80000}, "FT0C occupancy"}; + // For one-dimensional plots, where binning is no issue ConfigurableAxis axisMultUltraFineFV0A{"axisMultUltraFineFV0A", {60000, 0, 60000}, "FV0A amplitude"}; ConfigurableAxis axisMultUltraFineFT0M{"axisMultUltraFineFT0M", {50000, 0, 200000}, "FT0M amplitude"}; @@ -144,21 +152,16 @@ struct centralityStudy { histos.add("hFT0C_BCs", "hFT0C_BCs", kTH1D, {axisMultUltraFineFT0C}); histos.add("hFT0M_BCs", "hFT0M_BCs", kTH1D, {axisMultUltraFineFT0M}); histos.add("hFV0A_BCs", "hFV0A_BCs", kTH1D, {axisMultUltraFineFV0A}); - histos.add("hFT0CvsPVz_BCs_All", "hFT0CvsPVz_BCs_All", kTProfile, {axisPVz}); histos.add("hFT0CvsPVz_BCs", "hFT0CvsPVz_BCs", kTProfile, {axisPVz}); - histos.add("hVertexZ_BCvsCO", "hVertexZ_BCvsCO", kTH2D, {axisPVz, axisPVz}); - histos.add("hZNAvsFT0C_BCs", "hZNAvsFT0C_BCs", kTH2D, {axisMultFT0C, axisZN}); histos.add("hZNCvsFT0C_BCs", "hZNCvsFT0C_BCs", kTH2D, {axisMultFT0C, axisZN}); } if (do2DPlots) { histos.add("hNContribsVsFT0C", "hNContribsVsFT0C", kTH2F, {axisMultFT0C, axisMultPVContributors}); - histos.add("hNGlobalTracksVsFT0C", "hNGlobalTracksVsFT0C", kTH2F, {axisMultFT0C, axisMultGlobalTracks}); histos.add("hNContribsVsFV0A", "hNContribsVsFV0A", kTH2F, {axisMultFV0A, axisMultPVContributors}); - histos.add("hNGlobalTracksVsFV0A", "hNGlobalTracksVsFV0A", kTH2F, {axisMultFV0A, axisMultGlobalTracks}); histos.add("hMatchedVsITSOnly", "hMatchedVsITSOnly", kTH2F, {axisMultITSOnly, axisMultITSTPC}); // 2d correlation of fit signals @@ -168,6 +171,30 @@ struct centralityStudy { histos.add("hFDDCVsFT0C", "hFDDCVsFT0C", kTH2F, {axisMultFT0C, axisMultFDDC}); } + if (doNGlobalTracksVsRawSignals) { + histos.add("hNGlobalTracksVsFT0A", "hNGlobalTracksVsFT0A", kTH2F, {axisMultFT0A, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsFT0C", "hNGlobalTracksVsFT0C", kTH2F, {axisMultFT0C, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsFV0A", "hNGlobalTracksVsFV0A", kTH2F, {axisMultFV0A, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsFDDA", "hNGlobalTracksVsFDDA", kTH2F, {axisMultFDDA, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsFDDC", "hNGlobalTracksVsFDDC", kTH2F, {axisMultFDDC, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsZNA", "hNGlobalTracksVsZNA", kTH2F, {axisZN, axisMultGlobalTracks}); + histos.add("hNGlobalTracksVsZNC", "hNGlobalTracksVsZNC", kTH2F, {axisZN, axisMultGlobalTracks}); + } + + if (doOccupancyStudyVsRawValues2d) { + histos.add("hNcontribsProfileVsTrackOccupancyVsFT0C", "hNcontribsProfileVsTrackOccupancyVsFT0C", kTProfile2D, {axisTrackOccupancy, axisMultFT0C}); + histos.add("hNGlobalTracksProfileVsTrackOccupancyVsFT0C", "hNGlobalTracksProfileVsTrackOccupancyVsFT0C", kTProfile2D, {axisTrackOccupancy, axisMultFT0C}); + histos.add("hNcontribsProfileVsFT0COccupancyVsFT0C", "hNcontribsProfileVsFT0COccupancyVsFT0C", kTProfile2D, {axisFT0COccupancy, axisMultFT0C}); + histos.add("hNGlobalTracksProfileVsFT0COccupancyVsFT0C", "hNGlobalTracksProfileVsFT0COccupancyVsFT0C", kTProfile2D, {axisFT0COccupancy, axisMultFT0C}); + } + + if (doOccupancyStudyVsRawValues3d) { + histos.add("hTrackOccupancyVsNContribsVsFT0C", "hTrackOccupancyVsNContribsVsFT0C", kTH3F, {axisTrackOccupancy, axisMultPVContributors, axisMultFT0C}); + histos.add("hTrackOccupancyVsNGlobalTracksVsFT0C", "hTrackOccupancyVsNGlobalTracksVsFT0C", kTH3F, {axisTrackOccupancy, axisMultGlobalTracks, axisMultFT0C}); + histos.add("hFT0COccupancyVsNContribsVsFT0C", "hFT0COccupancyVsNContribsVsFT0C", kTH3F, {axisFT0COccupancy, axisMultPVContributors, axisMultFT0C}); + histos.add("hFT0COccupancyVsNGlobalTracksVsFT0C", "hFT0COccupancyVsNGlobalTracksVsFT0C", kTH3F, {axisFT0COccupancy, axisMultGlobalTracks, axisMultFT0C}); + } + if (doprocessCollisionsWithCentrality) { // in case requested: do vs centrality debugging histos.add("hCentrality", "hCentrality", kTH1F, {axisCentrality}); @@ -177,6 +204,20 @@ struct centralityStudy { histos.add("hNGlobalTracksVsCentrality", "hNGlobalTracksVsCentrality", kTH2F, {axisCentrality, axisMultPVContributors}); histos.add("hPVChi2VsCentrality", "hPVChi2VsCentrality", kTH2F, {axisCentrality, axisPVChi2}); histos.add("hDeltaTimeVsCentrality", "hDeltaTimeVsCentrality", kTH2F, {axisCentrality, axisDeltaTime}); + + if (doOccupancyStudyVsCentrality2d) { + histos.add("hNcontribsProfileVsTrackOccupancyVsCentrality", "hNcontribsProfileVsTrackOccupancyVsCentrality", kTProfile2D, {axisTrackOccupancy, axisCentrality}); + histos.add("hNGlobalTracksProfileVsTrackOccupancyVsCentrality", "hNGlobalTracksProfileVsTrackOccupancyVsCentrality", kTProfile2D, {axisTrackOccupancy, axisCentrality}); + histos.add("hNcontribsProfileVsFT0COccupancyVsCentrality", "hNcontribsProfileVsFT0COccupancyVsCentrality", kTProfile2D, {axisFT0COccupancy, axisCentrality}); + histos.add("hNGlobalTracksProfileVsFT0COccupancyVsCentrality", "hNGlobalTracksProfileVsFT0COccupancyVsCentrality", kTProfile2D, {axisFT0COccupancy, axisCentrality}); + } + + if (doOccupancyStudyVsCentrality3d) { + histos.add("hTrackOccupancyVsNContribsVsCentrality", "hTrackOccupancyVsNContribsVsCentrality", kTH3F, {axisTrackOccupancy, axisMultPVContributors, axisCentrality}); + histos.add("hTrackOccupancyVsNGlobalTracksVsCentrality", "hTrackOccupancyVsNGlobalTracksVsCentrality", kTH3F, {axisTrackOccupancy, axisMultGlobalTracks, axisCentrality}); + histos.add("hFT0COccupancyVsNContribsVsCentrality", "hFT0COccupancyVsNContribsVsCentrality", kTH3F, {axisFT0COccupancy, axisMultPVContributors, axisCentrality}); + histos.add("hFT0COccupancyVsNGlobalTracksVsCentrality", "hFT0COccupancyVsNGlobalTracksVsCentrality", kTH3F, {axisFT0COccupancy, axisMultGlobalTracks, axisCentrality}); + } } } @@ -291,9 +332,7 @@ struct centralityStudy { } if (do2DPlots) { histos.fill(HIST("hNContribsVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multPVTotalContributors()); - histos.fill(HIST("hNGlobalTracksVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multNTracksGlobal()); histos.fill(HIST("hNContribsVsFV0A"), collision.multFV0A() * scaleSignalFV0A, collision.multPVTotalContributors()); - histos.fill(HIST("hNGlobalTracksVsFV0A"), collision.multFV0A() * scaleSignalFV0A, collision.multNTracksGlobal()); histos.fill(HIST("hMatchedVsITSOnly"), collision.multNTracksITSOnly(), collision.multNTracksITSTPC()); // correlate also FIT detector signals @@ -303,6 +342,30 @@ struct centralityStudy { histos.fill(HIST("hFDDCVsFT0C"), collision.multFT0C() * scaleSignalFT0C, collision.multFDDC()); } + if (doOccupancyStudyVsCentrality2d) { + histos.fill(HIST("hNcontribsProfileVsTrackOccupancyVsFT0C"), collision.trackOccupancyInTimeRange(), collision.multFT0C(), collision.multPVTotalContributors()); + histos.fill(HIST("hNGlobalTracksProfileVsTrackOccupancyVsFT0C"), collision.trackOccupancyInTimeRange(), collision.multFT0C(), collision.multNTracksGlobal()); + histos.fill(HIST("hNcontribsProfileVsFT0COccupancyVsFT0C"), collision.ft0cOccupancyInTimeRange(), collision.multFT0C(), collision.multPVTotalContributors()); + histos.fill(HIST("hNGlobalTracksProfileVsFT0COccupancyVsFT0C"), collision.ft0cOccupancyInTimeRange(), collision.multFT0C(), collision.multNTracksGlobal()); + } + + if (doOccupancyStudyVsRawValues3d) { + histos.fill(HIST("hTrackOccupancyVsNContribsVsFT0C"), collision.trackOccupancyInTimeRange(), collision.multPVTotalContributors(), collision.multFT0C()); + histos.fill(HIST("hTrackOccupancyVsNGlobalTracksVsFT0C"), collision.trackOccupancyInTimeRange(), collision.multNTracksGlobal(), collision.multFT0C()); + histos.fill(HIST("hFT0COccupancyVsNContribsVsFT0C"), collision.ft0cOccupancyInTimeRange(), collision.multPVTotalContributors(), collision.multFT0C()); + histos.fill(HIST("hFT0COccupancyVsNGlobalTracksVsFT0C"), collision.ft0cOccupancyInTimeRange(), collision.multNTracksGlobal(), collision.multFT0C()); + } + + if (doNGlobalTracksVsRawSignals) { + histos.fill(HIST("hNGlobalTracksVsFT0A"), collision.multFT0A(), collision.multNTracksGlobal()); + histos.fill(HIST("hNGlobalTracksVsFT0C"), collision.multFT0C(), collision.multNTracksGlobal()); + histos.fill(HIST("hNGlobalTracksVsFV0A"), collision.multFV0A(), collision.multNTracksGlobal()); + histos.fill(HIST("hNGlobalTracksVsFDDA"), collision.multFDDA(), collision.multNTracksGlobal()); + histos.fill(HIST("hNGlobalTracksVsFDDC"), collision.multFDDC(), collision.multNTracksGlobal()); + histos.fill(HIST("hNGlobalTracksVsZNA"), collision.multZNA(), collision.multNTracksGlobal()); + histos.fill(HIST("hNGlobalTracksVsZNC"), collision.multZNC(), collision.multNTracksGlobal()); + } + // if the table has centrality information if constexpr (requires { collision.centFT0C(); }) { // process FT0C centrality plots @@ -312,6 +375,20 @@ struct centralityStudy { histos.fill(HIST("hNITSOnlyTracksVsCentrality"), collision.centFT0C(), collision.multNTracksITSOnly()); histos.fill(HIST("hNGlobalTracksVsCentrality"), collision.centFT0C(), collision.multNTracksGlobal()); histos.fill(HIST("hPVChi2VsCentrality"), collision.centFT0C(), collision.multPVChi2()); + + if (doOccupancyStudyVsCentrality2d) { + histos.fill(HIST("hNcontribsProfileVsTrackOccupancyVsCentrality"), collision.trackOccupancyInTimeRange(), collision.centFT0C(), collision.multPVTotalContributors()); + histos.fill(HIST("hNGlobalTracksProfileVsTrackOccupancyVsCentrality"), collision.trackOccupancyInTimeRange(), collision.centFT0C(), collision.multNTracksGlobal()); + histos.fill(HIST("hNcontribsProfileVsFT0COccupancyVsCentrality"), collision.ft0cOccupancyInTimeRange(), collision.centFT0C(), collision.multPVTotalContributors()); + histos.fill(HIST("hNGlobalTracksProfileVsFT0COccupancyVsCentrality"), collision.ft0cOccupancyInTimeRange(), collision.centFT0C(), collision.multNTracksGlobal()); + } + + if (doOccupancyStudyVsCentrality3d) { + histos.fill(HIST("hTrackOccupancyVsNContribsVsCentrality"), collision.trackOccupancyInTimeRange(), collision.multPVTotalContributors(), collision.centFT0C()); + histos.fill(HIST("hTrackOccupancyVsNGlobalTracksVsCentrality"), collision.trackOccupancyInTimeRange(), collision.multNTracksGlobal(), collision.centFT0C()); + histos.fill(HIST("hFT0COccupancyVsNContribsVsCentrality"), collision.ft0cOccupancyInTimeRange(), collision.multPVTotalContributors(), collision.centFT0C()); + histos.fill(HIST("hFT0COccupancyVsNGlobalTracksVsCentrality"), collision.ft0cOccupancyInTimeRange(), collision.multNTracksGlobal(), collision.centFT0C()); + } } } From e483a3e2e145a10f60578cac8f81699828bb0b0f Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Mon, 2 Dec 2024 21:59:22 +0100 Subject: [PATCH 212/459] [Common,PWGLF] feat(nucleiSpectra): Add matching study histograms (#8775) --- Common/DataModel/PIDResponseITS.h | 6 ++++ PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx | 31 ++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/Common/DataModel/PIDResponseITS.h b/Common/DataModel/PIDResponseITS.h index 5ee5b386810..3b5e13d94fd 100644 --- a/Common/DataModel/PIDResponseITS.h +++ b/Common/DataModel/PIDResponseITS.h @@ -81,6 +81,12 @@ struct ITSResponse { return (average * coslInv - exp) / resolution; }; + template + static float nSigmaITS(const T& track) + { + return nSigmaITS(track.itsClusterSizes(), track.p(), track.eta()); + } + static void setParameters(float p0, float p1, float p2, float p0_Z2, float p1_Z2, float p2_Z2, float p0_res, float p1_res, float p2_res) { if (mIsInitialized) { diff --git a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx index b0ae705f374..34429b2c053 100644 --- a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx @@ -35,6 +35,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/PIDResponseITS.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/Core/PID/PIDTOF.h" #include "Common/TableProducer/PID/pidTOFBase.h" @@ -203,6 +204,7 @@ std::shared_ptr hGloTOFtracks[2]; std::shared_ptr hDeltaP[2][5]; std::shared_ptr hFlowHists[2][5]; std::shared_ptr hDCAHists[2][5]; +std::shared_ptr hMatchingStudy[2]; o2::base::MatLayerCylSet* lut = nullptr; std::vector candidates; @@ -463,6 +465,12 @@ struct nucleiSpectra { } } + if (doprocessMatching) { + for (int iC{0}; iC < 2; ++iC) { + nuclei::hMatchingStudy[iC] = spectra.add(fmt::format("hMatchingStudy{}", nuclei::matter[iC]).data(), ";#it{p}_{T};#phi;#eta;n#sigma_{ITS};n#sigma{TPC};n#sigma_{TOF}", HistType::kTHnSparseF, {{20, 1., 9.}, {10, 0., o2::constants::math::TwoPI}, {10, -1., 1.}, {50, -5., 5.}, {50, -5., 5.}, {50, 0., 1.}}); + } + } + nuclei::lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get("GLO/Param/MatLUT")); // TrackTuner initialization if (cfgUseTrackTuner) { @@ -890,6 +898,29 @@ struct nucleiSpectra { } } PROCESS_SWITCH(nucleiSpectra, processMC, "MC analysis", false); + + void processMatching(soa::Join::iterator const& collision, TrackCandidates const& tracks, aod::BCsWithTimestamps const&) + { + if (!eventSelection(collision)) { + return; + } + o2::aod::ITSResponse itsResponse; + for (auto& track : tracks) { + if (std::abs(track.eta()) > cfgCutEta || + track.itsNCls() < 7 || + track.itsChi2NCl() > 36.f || + itsResponse.nSigmaITS(track) < -1.) { + continue; + } + double expBethe{tpc::BetheBlochAleph(static_cast(track.tpcInnerParam() * 2. / o2::constants::physics::MassHelium3), cfgBetheBlochParams->get(4, 0u), cfgBetheBlochParams->get(4, 1u), cfgBetheBlochParams->get(4, 2u), cfgBetheBlochParams->get(4, 3u), cfgBetheBlochParams->get(4, 4u))}; + double expSigma{expBethe * cfgBetheBlochParams->get(4, 5u)}; + double nSigmaTPC{(track.tpcSignal() - expBethe) / expSigma}; + int iC = track.signed1Pt() > 0; + nuclei::hMatchingStudy[iC]->Fill(track.pt() * 2, track.phi(), track.eta(), itsResponse.nSigmaITS(track), nSigmaTPC, o2::pid::tof::Beta::GetBeta(track)); + } + } + + PROCESS_SWITCH(nucleiSpectra, processMatching, "Matching analysis", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From c50c86c77c63ba35330168ce9f00e630724ae82b Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Mon, 2 Dec 2024 22:30:04 +0100 Subject: [PATCH 213/459] [PWGHF] Add missing subscription to MC collisions (#8777) --- PWGHF/D2H/Tasks/taskD0.cxx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index b1c9eb92bd2..f76d9d7bfb8 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -360,7 +360,8 @@ struct HfTaskD0 { void processMc(CandType const& candidates, soa::Join const& mcParticles, aod::TracksWMc const&, - CollisionsWithMcLabels const& collisions) + CollisionsWithMcLabels const& collisions, + aod::McCollisions const&) { // MC rec. for (const auto& candidate : candidates) { @@ -587,36 +588,40 @@ struct HfTaskD0 { void processMcWithDCAFitterN(D0CandidatesMc const&, soa::Join const& mcParticles, aod::TracksWMc const& tracks, - CollisionsWithMcLabels const& collisions) + CollisionsWithMcLabels const& collisions, + aod::McCollisions const& mcCollisions) { - processMc(selectedD0CandidatesMc, mcParticles, tracks, collisions); + processMc(selectedD0CandidatesMc, mcParticles, tracks, collisions, mcCollisions); } PROCESS_SWITCH(HfTaskD0, processMcWithDCAFitterN, "Process MC with DCAFitterN", false); void processMcWithKFParticle(D0CandidatesMcKF const&, soa::Join const& mcParticles, aod::TracksWMc const& tracks, - CollisionsWithMcLabels const& collisions) + CollisionsWithMcLabels const& collisions, + aod::McCollisions const& mcCollisions) { - processMc(selectedD0CandidatesMcKF, mcParticles, tracks, collisions); + processMc(selectedD0CandidatesMcKF, mcParticles, tracks, collisions, mcCollisions); } PROCESS_SWITCH(HfTaskD0, processMcWithKFParticle, "Process MC with KFParticle", false); void processMcWithDCAFitterNMl(D0CandidatesMlMc const&, soa::Join const& mcParticles, aod::TracksWMc const& tracks, - CollisionsWithMcLabels const& collisions) + CollisionsWithMcLabels const& collisions, + aod::McCollisions const& mcCollisions) { - processMc(selectedD0CandidatesMlMc, mcParticles, tracks, collisions); + processMc(selectedD0CandidatesMlMc, mcParticles, tracks, collisions, mcCollisions); } PROCESS_SWITCH(HfTaskD0, processMcWithDCAFitterNMl, "Process MC with DCAFitterN and ML selection", false); void processMcWithKFParticleMl(D0CandidatesMlMcKF const&, soa::Join const& mcParticles, aod::TracksWMc const& tracks, - CollisionsWithMcLabels const& collisions) + CollisionsWithMcLabels const& collisions, + aod::McCollisions const& mcCollisions) { - processMc(selectedD0CandidatesMlMcKF, mcParticles, tracks, collisions); + processMc(selectedD0CandidatesMlMcKF, mcParticles, tracks, collisions, mcCollisions); } PROCESS_SWITCH(HfTaskD0, processMcWithKFParticleMl, "Process MC with KFParticle and ML selections", false); }; From bcdafab863bfa40467e525857878afcede4b3f9e Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Mon, 2 Dec 2024 23:00:49 +0100 Subject: [PATCH 214/459] [PWGHF] task to calculate directed flow of Dstar (#8778) --- .../Tasks/taskDirectedFlowCharmHadrons.cxx | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index f2b768ab36b..a4d9b9fcfe1 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -43,10 +43,12 @@ using namespace o2::hf_evsel; enum DecayChannel { DplusToPiKPi = 0, D0ToPiK, - D0ToKPi }; + D0ToKPi, + DstarToD0Pi }; struct HfTaskDirectedFlowCharmHadrons { Configurable centEstimator{"centEstimator", 2, "Centrality estimation (FT0A: 1, FT0C: 2, FT0M: 3, FV0A: 4)"}; + Configurable selectionFlagDstar{"selectionFlagDstar", false, "Selection Flag for Dstar"}; Configurable selectionFlag{"selectionFlag", 1, "Selection Flag for hadron (e.g. 1 for skimming, 3 for topo. and kine., 7 for PID)"}; Configurable centralityMin{"centralityMin", 0., "Minimum centrality accepted in SP computation"}; Configurable centralityMax{"centralityMax", 100., "Maximum centrality accepted in SP computation"}; @@ -69,11 +71,14 @@ struct HfTaskDirectedFlowCharmHadrons { using CandDplusData = soa::Filtered>; using CandD0DataWMl = soa::Filtered>; using CandD0Data = soa::Filtered>; + using CandDstarDataWMl = soa::Filtered>; + using CandDstarData = soa::Filtered>; using CollsWithQvecs = soa::Join; using TracksWithExtra = soa::Join; Filter filterSelectDplusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlag; Filter filterSelectD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlag || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlag; + Filter filterSelectDstarCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == selectionFlagDstar; Partition selectedD0ToPiK = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlag; Partition selectedD0ToKPi = aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlag; @@ -92,7 +97,7 @@ struct HfTaskDirectedFlowCharmHadrons { { /// check process functions - std::array processes = {doprocessDplusStd, doprocessDplusMl, doprocessD0Std, doprocessD0Ml}; + std::array processes = {doprocessDplusStd, doprocessDplusMl, doprocessD0Std, doprocessD0Ml, doprocessDstarStd, doprocessDstarMl}; const int nProcesses = std::accumulate(processes.begin(), processes.end(), 0); if (nProcesses > 1) { LOGP(fatal, "Only one process function should be enabled at a time, please check your configuration"); @@ -203,6 +208,7 @@ struct HfTaskDirectedFlowCharmHadrons { for (const auto& candidate : candidates) { double massCand = 0.; double rapCand = 0.; + double signDstarCand = 0.0; std::vector outputMl = {-999., -999.}; if constexpr (std::is_same_v || std::is_same_v) { massCand = hfHelper.invMassDplusToPiKPi(candidate); @@ -230,6 +236,19 @@ struct HfTaskDirectedFlowCharmHadrons { default: break; } + } else if constexpr (std::is_same_v || std::is_same_v) { + signDstarCand = candidate.signSoftPi(); + if (candidate.signSoftPi() > 0) { + massCand = std::abs(candidate.invMassDstar() - candidate.invMassD0()); + rapCand = candidate.y(candidate.invMassDstar()); + } else if (candidate.signSoftPi() < 0) { + massCand = std::abs(candidate.invMassAntiDstar() - candidate.invMassD0Bar()); + rapCand = candidate.y(candidate.invMassAntiDstar()); + } + if constexpr (std::is_same_v) { + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + outputMl[iclass] = candidate.mlProbDstarToD0Pi()[classMl->at(iclass)]; + } } auto trackprong0 = candidate.template prong0_as(); @@ -244,6 +263,9 @@ struct HfTaskDirectedFlowCharmHadrons { if (userap) etaCand = rapCand; + if (selectionFlagDstar) + sign = signDstarCand; + auto ux = cosNPhi; // real part of candidate q vector auto uy = sinNPhi; // imaginary part of candidate q vector auto uxQxp = ux * qxZDCA; @@ -322,6 +344,24 @@ struct HfTaskDirectedFlowCharmHadrons { } PROCESS_SWITCH(HfTaskDirectedFlowCharmHadrons, processDplusStd, "Process Dplus candidates with rectangular cuts", true); + // Dstar with ML + void processDstarMl(CollsWithQvecs::iterator const& collision, + CandDstarDataWMl const& candidatesDstar, + TracksWithExtra const& tracks) + { + runFlowAnalysis(collision, candidatesDstar, tracks); + } + PROCESS_SWITCH(HfTaskDirectedFlowCharmHadrons, processDstarMl, "Process Dstar candidates with ML", false); + + // Dstar with rectangular cuts + void processDstarStd(CollsWithQvecs::iterator const& collision, + CandDstarData const& candidatesDstar, + TracksWithExtra const& tracks) + { + runFlowAnalysis(collision, candidatesDstar, tracks); + } + PROCESS_SWITCH(HfTaskDirectedFlowCharmHadrons, processDstarStd, "Process Dstar candidates with rectangular cuts", true); + }; // End struct HfTaskDirectedFlowCharmHadrons WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 2b0f6cf9602aab1f1a4522f2a727b9711cc78a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Mon, 2 Dec 2024 23:48:28 +0100 Subject: [PATCH 215/459] [PWGHF] Use the Hf event selection for both tracks and charm hadrons (#8706) --- PWGHF/HFC/TableProducer/CMakeLists.txt | 2 +- .../HFC/TableProducer/femtoDreamProducer.cxx | 88 ++++++++++++++----- PWGHF/Utils/utilsEvSelHf.h | 2 +- 3 files changed, 67 insertions(+), 25 deletions(-) diff --git a/PWGHF/HFC/TableProducer/CMakeLists.txt b/PWGHF/HFC/TableProducer/CMakeLists.txt index 2b01aad32c6..e3fc1bd5938 100644 --- a/PWGHF/HFC/TableProducer/CMakeLists.txt +++ b/PWGHF/HFC/TableProducer/CMakeLists.txt @@ -61,5 +61,5 @@ o2physics_add_dpl_workflow(correlator-lc-hadrons o2physics_add_dpl_workflow(femto-dream-producer SOURCES femtoDreamProducer.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) diff --git a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx index 5328703d76c..3ed86b564cf 100644 --- a/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx +++ b/PWGHF/HFC/TableProducer/femtoDreamProducer.cxx @@ -12,6 +12,7 @@ /// \file femtoDreamProducer.cxx /// \brief Tasks that produces the track tables used for the pairing /// \author Ravindra Singh, GSI, ravindra.singh@cern.ch +/// \author Biao Zhang, Heidelberg University, biao.zhang@cern.ch #include #include @@ -39,11 +40,25 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" +#include "PWGHF/Utils/utilsEvSelHf.h" +#include "PWGHF/Core/CentralityEstimation.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::analysis::femtoDream; +using namespace o2::hf_evsel; +using namespace o2::hf_centrality; + +// event types +enum Event : uint8_t { + kAll = 0, + kRejEveSel, + kRejNoTracksAndCharm, + kTrackSelected, + kCharmSelected, + kPairSelected +}; struct HfFemtoDreamProducer { @@ -69,19 +84,6 @@ struct HfFemtoDreamProducer { // Configurable isForceGRP{"isForceGRP", false, "Set true if the magnetic field configuration is not available in the usual CCDB directory (e.g. for Run 2 converted data or unanchorad Monte Carlo)"}; - /// Event selection - // Configurable evtZvtx{"evtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; - // Configurable evtTriggerCheck{"evtTriggerCheck", true, "Evt sel: check for trigger"}; - // Configurable evtTriggerSel{"evtTriggerSel", kINT7, "Evt sel: trigger"}; - // Configurable evtOfflineCheck{"evtOfflineCheck", false, "Evt sel: check for offline selection"}; - // Configurable evtAddOfflineCheck{"evtAddOfflineCheck", false, "Evt sel: additional checks for offline selection (not part of sel8 yet)"}; - - Configurable evtAddOfflineCheck{"evtAddOfflineCheck", false, "Evt sel: additional checks for offline selection (not part of sel8 yet)"}; - Configurable evtOfflineCheck{"evtOfflineCheck", false, "Evt sel: check for offline selection"}; - Configurable evtTriggerCheck{"evtTriggerCheck", true, "Evt sel: check for trigger"}; - Configurable evtTriggerSel{"evtTriggerSel", kINT7, "Evt sel: trigger"}; - Configurable evtZvtx{"evtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; - Configurable isDebug{"isDebug", true, "Enable Debug tables"}; Configurable isRun3{"isRun3", true, "Running on Run3 or pilot"}; @@ -121,7 +123,6 @@ struct HfFemtoDreamProducer { using GeneratedMc = soa::Filtered>; - FemtoDreamCollisionSelection colCuts; FemtoDreamTrackSelection trackCuts; Filter filterSelectCandidateLc = (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); @@ -130,6 +131,7 @@ struct HfFemtoDreamProducer { HistogramRegistry TrackRegistry{"Tracks", {}, OutputObjHandlingPolicy::AnalysisObject}; HfHelper hfHelper; + o2::hf_evsel::HfEventSelection hfEvSel; float magField; int runNumber; @@ -148,8 +150,21 @@ struct HfFemtoDreamProducer { int CutBits = 8 * sizeof(o2::aod::femtodreamparticle::cutContainerType); TrackRegistry.add("AnalysisQA/CutCounter", "; Bit; Counter", kTH1F, {{CutBits + 1, -0.5, CutBits + 0.5}}); - colCuts.setCuts(evtZvtx.value, evtTriggerCheck.value, evtTriggerSel.value, evtOfflineCheck.value, evtAddOfflineCheck.value, isRun3.value); - colCuts.init(&qaRegistry); + // event QA histograms + constexpr int kEventTypes = kPairSelected + 1; + std::string labels[kEventTypes]; + labels[Event::kAll] = "All events"; + labels[Event::kRejEveSel] = "rejected by event selection"; + labels[Event::kRejNoTracksAndCharm] = "rejected by no tracks and charm"; + labels[Event::kTrackSelected] = "with tracks "; + labels[Event::kCharmSelected] = "with charm hadrons "; + labels[Event::kPairSelected] = "with pairs"; + + static const AxisSpec axisEvents = {kEventTypes, 0.5, kEventTypes + 0.5, ""}; + qaRegistry.add("hEventQA", "Events;;entries", HistType::kTH1F, {axisEvents}); + for (int iBin = 0; iBin < kEventTypes; iBin++) { + qaRegistry.get(HIST("hEventQA"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); + } trackCuts.setSelection(trkCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); trackCuts.setSelection(trkPtmin, femtoDreamTrackSelection::kpTMin, femtoDreamSelection::kLowerLimit); @@ -175,6 +190,8 @@ struct HfFemtoDreamProducer { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); + hfEvSel.addHistograms(qaRegistry); // collision monitoring + int64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); ccdb->setCreatedNotAfter(now); } @@ -335,8 +352,7 @@ struct HfFemtoDreamProducer { { const auto vtxZ = col.posZ(); const auto sizeCand = candidates.size(); - - const auto spher = colCuts.computeSphericity(col, tracks); + const auto spher = 2.; // dummy value for the moment float mult = 0; int multNtr = 0; if (isRun3) { @@ -351,15 +367,20 @@ struct HfFemtoDreamProducer { multNtr = col.multTracklets(); } - colCuts.fillQA(col, mult); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(col, mult, ccdb, qaRegistry); + + qaRegistry.fill(HIST("hEventQA"), 1 + Event::kAll); - // check whether the basic event selection criteria are fulfilled - // that included checking if there is at least on usable track or V0 - if (!colCuts.isSelectedCollision(col)) { + /// monitor the satisfied event selections + hfEvSel.fillHistograms(col, rejectionMask, mult); + if (rejectionMask != 0) { + /// at least one event selection not satisfied --> reject the candidate + qaRegistry.fill(HIST("hEventQA"), 1 + Event::kRejEveSel); return; } - if (colCuts.isEmptyCollision(col, tracks, trackCuts)) { + if (isNoSelectedTracks(col, tracks, trackCuts) && sizeCand <= 0) { + qaRegistry.fill(HIST("hEventQA"), 1 + Event::kRejNoTracksAndCharm); return; } @@ -437,18 +458,39 @@ struct HfFemtoDreamProducer { aod::femtodreamcollision::BitMaskType bitTrack = 0; if (isTrackFilled) { bitTrack |= 1 << 0; + qaRegistry.fill(HIST("hEventQA"), 1 + Event::kTrackSelected); } aod::femtodreamcollision::BitMaskType bitCand = 0; if (sizeCand > 0) { bitCand |= 1 << 0; + qaRegistry.fill(HIST("hEventQA"), 1 + Event::kCharmSelected); } + if (isTrackFilled && (sizeCand > 0)) + qaRegistry.fill(HIST("hEventQA"), 1 + Event::kPairSelected); + rowMasks(static_cast(bitTrack), static_cast(bitCand), 0); } + // check if there is no selected track + /// \param C type of the collision + /// \param T type of the tracks + /// \param TC type of the femto track cuts + /// \return whether or not the tracks fulfills the all selections + template + bool isNoSelectedTracks(C const& /*col*/, T const& tracks, TC& trackCuts) + { + for (auto const& track : tracks) { + if (trackCuts.isSelectedMinimal(track)) { + return false; + } + } + return true; + } + template void fillCharmHadMcGen(ParticleType particles) { diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 616608116bb..9382108dee3 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -106,7 +106,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable useNoCollInRofStandard{"useNoCollInRofStandard", false, "Reject collisions in ROF standard"}; o2::framework::Configurable softwareTrigger{"softwareTrigger", "", "Label of software trigger. Multiple triggers can be selected dividing them by a comma. Set None if you want bcs that are not selected by any trigger"}; o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; - o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "Users/m/mpuccio/EventFiltering/OTS/", "ccdb path for ZORRO objects"}; + o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "Users/m/mpuccio/EventFiltering/OTS/Chunked/", "ccdb path for ZORRO objects"}; o2::framework::ConfigurableAxis th2ConfigAxisCent{"th2ConfigAxisCent", {100, 0., 100.}, ""}; o2::framework::ConfigurableAxis th2ConfigAxisOccupancy{"th2ConfigAxisOccupancy", {14, 0, 140000}, ""}; From 1eb245ca1183e3da6f17bcfec0ed866b4018f004 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Tue, 3 Dec 2024 00:05:06 +0100 Subject: [PATCH 216/459] [PWGEM/Dilepton] update prefilter task for geom cut in ULS (#8782) --- PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 29 ++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index 406f1b1d54c..a787d9acd6c 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -88,13 +88,14 @@ struct prefilterDielectron { DielectronCut fDielectronCut; struct : ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass for prefilter ULS"}; // region to be rejected - Configurable cfg_max_mass{"cfg_max_mass", 0.02, "max mass for prefilter ULS"}; // region to be rejected - Configurable cfg_apply_dzrdphi_geom{"cfg_apply_dzrdphi_geom", false, "flag to apply generator dz-rdphi elliptic cut"}; // region to be rejected - Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 5, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected - Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 20, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected - - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; // region to be rejected + Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass for prefilter ULS"}; // region to be rejected + Configurable cfg_max_mass{"cfg_max_mass", 0.0, "max mass for prefilter ULS"}; // region to be rejected + Configurable cfg_apply_dzrdphi_geom_uls{"cfg_apply_dzrdphi_geom_uls", false, "flag to apply generator dz-rdphi elliptic cut in ULS"}; // region to be rejected + Configurable cfg_apply_dzrdphi_geom_ls{"cfg_apply_dzrdphi_geom_ls", false, "flag to apply generator dz-rdphi elliptic cut in LS"}; // region to be rejected + Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 5, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 20, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected + + Configurable cfg_apply_phiv{"cfg_apply_phiv", false, "flag to apply phiv cut"}; // region to be rejected Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; // region to be rejected Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; // region to be rejected Configurable cfg_min_phiv{"cfg_min_phiv", -1.f, "min phiv"}; // region to be rejected @@ -379,7 +380,7 @@ struct prefilterDielectron { continue; } - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom) { + if (dielectroncuts.cfg_x_to_go > 0.f && (dielectroncuts.cfg_apply_dzrdphi_geom_uls || dielectroncuts.cfg_apply_dzrdphi_geom_ls)) { propagateElectron(posTracks_per_coll); propagateElectron(negTracks_per_coll); } @@ -420,10 +421,10 @@ struct prefilterDielectron { map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV); } - // if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { - // map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); - // map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); - // } + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_uls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { + map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + } } for (auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ @@ -450,7 +451,7 @@ struct prefilterDielectron { fRegistry.fill(HIST("Pair/before/lspp/hDeltaEtaDeltaPhi"), dphi, deta); fRegistry.fill(HIST("Pair/before/lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { map_pfb[pos1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); map_pfb[pos2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); } @@ -480,7 +481,7 @@ struct prefilterDielectron { fRegistry.fill(HIST("Pair/before/lsmm/hDeltaEtaDeltaPhi"), dphi, deta); fRegistry.fill(HIST("Pair/before/lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { map_pfb[ele1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); map_pfb[ele2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); } From 2241bff18e3cfb0994450ffb45a7a0c3d346a2c7 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Tue, 3 Dec 2024 00:46:45 +0100 Subject: [PATCH 217/459] [PWGCF] DptDpt - Efficiency and QC - Fixing linter errors (#8783) Co-authored-by: Victor --- .../Tasks/CMakeLists.txt | 4 +- ...ncyAndQc.cxx => dptdptEfficiencyAndQc.cxx} | 456 +++++++++--------- 2 files changed, 232 insertions(+), 228 deletions(-) rename PWGCF/TwoParticleCorrelations/Tasks/{efficiencyAndQc.cxx => dptdptEfficiencyAndQc.cxx} (66%) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index 3d939cff243..bf93c33d24c 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -33,8 +33,8 @@ o2physics_add_dpl_workflow(identifiedbf-filter-qa PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(twopartcorr-efficiency-qc - SOURCES efficiencyAndQc.cxx +o2physics_add_dpl_workflow(dptdpt-efficiency-and-qc + SOURCES dptdptEfficiencyAndQc.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/dptdptEfficiencyAndQc.cxx similarity index 66% rename from PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx rename to PWGCF/TwoParticleCorrelations/Tasks/dptdptEfficiencyAndQc.cxx index 60830fe414d..6d8bff1d6a0 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/efficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/dptdptEfficiencyAndQc.cxx @@ -9,6 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file dptdptEfficiencyAndQc.cxx +/// \brief Provides efficiency extraction and QC for track cuts and PID +/// \author victor.gonzalez.sebastian@gmail.com + #include #include #include @@ -103,63 +107,63 @@ struct QADataCollectingEngine { /* when two indexes, first index reco and detector level, second index generator level */ /* when no indexes, reco and detector level */ std::vector> fhPtB{2, nullptr}; - std::vector> fhPt_vs_EtaB{2, nullptr}; - std::vector> fhPt_vs_ZvtxB{2, nullptr}; + std::vector> fhPtVsEtaB{2, nullptr}; + std::vector> fhPtVsZvtxB{2, nullptr}; std::vector>> fhPtA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_ZvtxA{2, {nsp, nullptr}}; - std::shared_ptr fhPt_vs_EtaItsAcc{nullptr}; - std::shared_ptr fhPt_vs_EtaTpcAcc{nullptr}; - std::shared_ptr fhPt_vs_EtaItsTpcAcc{nullptr}; - std::shared_ptr fhPt_vs_EtaItsTofAcc{nullptr}; - std::shared_ptr fhPt_vs_EtaTpcTofAcc{nullptr}; - std::shared_ptr fhPt_vs_EtaItsTpcTofAcc{nullptr}; - std::vector> fhPt_vs_EtaItsA{nsp, nullptr}; - std::vector> fhPt_vs_EtaTpcA{nsp, nullptr}; - std::vector> fhPt_vs_EtaItsTpcA{nsp, nullptr}; - std::vector> fhPt_vs_EtaItsTofA{nsp, nullptr}; - std::vector> fhPt_vs_EtaTpcTofA{nsp, nullptr}; - std::vector> fhPt_vs_EtaItsTpcTofA{nsp, nullptr}; + std::vector>> fhPtVsEtaA{2, {nsp, nullptr}}; + std::vector>> fhPtVsZvtxA{2, {nsp, nullptr}}; + std::shared_ptr fhPtVsEtaItsAcc{nullptr}; + std::shared_ptr fhPtVsEtaTpcAcc{nullptr}; + std::shared_ptr fhPtVsEtaItsTpcAcc{nullptr}; + std::shared_ptr fhPtVsEtaItsTofAcc{nullptr}; + std::shared_ptr fhPtVsEtaTpcTofAcc{nullptr}; + std::shared_ptr fhPtVsEtaItsTpcTofAcc{nullptr}; + std::vector> fhPtVsEtaItsA{nsp, nullptr}; + std::vector> fhPtVsEtaTpcA{nsp, nullptr}; + std::vector> fhPtVsEtaItsTpcA{nsp, nullptr}; + std::vector> fhPtVsEtaItsTofA{nsp, nullptr}; + std::vector> fhPtVsEtaTpcTofA{nsp, nullptr}; + std::vector> fhPtVsEtaItsTpcTofA{nsp, nullptr}; /* primaries and secondaries */ /* overall, first index detector level second index generator level */ /* detailed, first index detector level, second index associated particle */ std::shared_ptr fhPtPurityPosPrimA{nullptr}; std::shared_ptr fhPtPurityNegPrimA{nullptr}; - std::vector> fhPt_vs_EtaPrimA{nsp, nullptr}; - std::vector>> fhPt_vs_EtaPrimItsA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaPrimItsTpcA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaPrimItsTpcTofA{2, {nsp, nullptr}}; + std::vector> fhPtVsEtaPrimA{nsp, nullptr}; + std::vector>> fhPtVsEtaPrimItsA{2, {nsp, nullptr}}; + std::vector>> fhPtVsEtaPrimItsTpcA{2, {nsp, nullptr}}; + std::vector>> fhPtVsEtaPrimItsTpcTofA{2, {nsp, nullptr}}; std::shared_ptr fhPtPurityPosSecA{nullptr}; std::shared_ptr fhPtPurityNegSecA{nullptr}; - std::vector> fhPt_vs_EtaSecA{nsp, nullptr}; - std::vector>> fhPt_vs_EtaSecItsA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaSecItsTpcA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaSecItsTpcTofA{2, {nsp, nullptr}}; + std::vector> fhPtVsEtaSecA{nsp, nullptr}; + std::vector>> fhPtVsEtaSecItsA{2, {nsp, nullptr}}; + std::vector>> fhPtVsEtaSecItsTpcA{2, {nsp, nullptr}}; + std::vector>> fhPtVsEtaSecItsTpcTofA{2, {nsp, nullptr}}; std::shared_ptr fhPtPurityPosMatA{nullptr}; std::shared_ptr fhPtPurityNegMatA{nullptr}; - std::vector> fhPt_vs_EtaMatA{nsp, nullptr}; - std::vector>> fhPt_vs_EtaMatItsA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaMatItsTpcA{2, {nsp, nullptr}}; - std::vector>> fhPt_vs_EtaMatItsTpcTofA{2, {nsp, nullptr}}; + std::vector> fhPtVsEtaMatA{nsp, nullptr}; + std::vector>> fhPtVsEtaMatItsA{2, {nsp, nullptr}}; + std::vector>> fhPtVsEtaMatItsTpcA{2, {nsp, nullptr}}; + std::vector>> fhPtVsEtaMatItsTpcTofA{2, {nsp, nullptr}}; /* QC histograms */ - std::shared_ptr fhITS_NCls_vs_PtB{nullptr}; - std::shared_ptr fhITS_Chi2NCls_vs_PtB{nullptr}; - std::shared_ptr fhTPC_FindableNCls_vs_PtB{nullptr}; - std::shared_ptr fhTPC_FoundNCls_vs_PtB{nullptr}; - std::shared_ptr fhTPC_SharedNCls_vs_PtB{nullptr}; - std::shared_ptr fhTPC_FractionSharedCls_vs_PtB{nullptr}; - std::shared_ptr fhTPC_CrossedRows_vs_PtB{nullptr}; - std::shared_ptr fhTPC_CrossedRowsOverFindableCls_vs_PtB{nullptr}; - std::shared_ptr fhTPC_Chi2NCls_vs_PtB{nullptr}; - std::vector> fhITS_NCls_vs_PtA{nsp, nullptr}; - std::vector> fhITS_Chi2NCls_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_FindableNCls_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_FoundNCls_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_SharedNCls_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_FractionSharedCls_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_CrossedRows_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_CrossedRowsOverFindableCls_vs_PtA{nsp, nullptr}; - std::vector> fhTPC_Chi2NCls_vs_PtA{nsp, nullptr}; + std::shared_ptr fhItsNClsVsPtB{nullptr}; + std::shared_ptr fhItsChi2NClsVsPtB{nullptr}; + std::shared_ptr fhTpcFindableNClsVsPtB{nullptr}; + std::shared_ptr fhTpcFoundNClsVsPtB{nullptr}; + std::shared_ptr fhTpcSharedNClsVsPtB{nullptr}; + std::shared_ptr fhTpcFractionSharedClsVsPtB{nullptr}; + std::shared_ptr fhTpcCrossedRowsVsPtB{nullptr}; + std::shared_ptr fhTpcCrossedRowsOverFindableClsVsPtB{nullptr}; + std::shared_ptr fhTpcChi2NClsVsPtB{nullptr}; + std::vector> fhItsNClsVsPtA{nsp, nullptr}; + std::vector> fhItsChi2NClsVsPtA{nsp, nullptr}; + std::vector> fhTpcFindableNClsVsPtA{nsp, nullptr}; + std::vector> fhTpcFoundNClsVsPtA{nsp, nullptr}; + std::vector> fhTpcSharedNClsVsPtA{nsp, nullptr}; + std::vector> fhTpcFractionSharedClsVsPtA{nsp, nullptr}; + std::vector> fhTpcCrossedRowsVsPtA{nsp, nullptr}; + std::vector> fhTpcCrossedRowsOverFindableClsVsPtA{nsp, nullptr}; + std::vector> fhTpcChi2NClsVsPtA{nsp, nullptr}; template void init(HistogramRegistry& registry, const char* dirname) @@ -184,50 +188,50 @@ struct QADataCollectingEngine { /* the reconstructed and generated levels histograms */ std::string recogen = (kindOfData == kReco) ? "Reco" : "Gen"; fhPtB[kindOfData] = ADDHISTOGRAM(TH1, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "Pt", "#it{p}_{T}", kTH1F, {ptAxis}); - fhPt_vs_EtaB[kindOfData] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "PtVsEta", "#it{p}_T vs #eta", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_ZvtxB[kindOfData] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "PtVsZvtx", "#it{p}_T vs #it{z}_{vtx}", kTH2F, {zvtxAxis, ptAxis}); + fhPtVsEtaB[kindOfData] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "PtVsEta", "#it{p}_T vs #eta", kTH2F, {etaAxis, ptAxis}); + fhPtVsZvtxB[kindOfData] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "Before"), "PtVsZvtx", "#it{p}_T vs #it{z}_{vtx}", kTH2F, {zvtxAxis, ptAxis}); for (uint isp = 0; isp < nsp; ++isp) { fhPtA[kindOfData][isp] = ADDHISTOGRAM(TH1, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("Pt_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} %s", tnames[isp].c_str()), kTH1F, {ptAxis}); - fhPt_vs_EtaA[kindOfData][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("PtVsEta_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} vs #eta %s", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_ZvtxA[kindOfData][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("PtVsZvtx_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} vs #it{z}_{zvtx} %s", tnames[isp].c_str()), kTH2F, {zvtxAxis, ptAxis}); + fhPtVsEtaA[kindOfData][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("PtVsEta_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} vs #eta %s", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsZvtxA[kindOfData][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, recogen.c_str(), "After"), HNAMESTRING("PtVsZvtx_%s", tnames[isp].c_str()), HTITLESTRING("#it{p}_{T} vs #it{z}_{zvtx} %s", tnames[isp].c_str()), kTH2F, {zvtxAxis, ptAxis}); } if constexpr (kindOfData == kReco) { /* only the reconstructed level histograms*/ - fhITS_NCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSNCls", "ITS clusters", kTH2F, {ptAxis, itsNClsAxis}); - fhITS_Chi2NCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSChi2NCls", "ITS #Chi^{2}", kTH2F, {ptAxis, itsCh2Axis}); - fhTPC_FindableNCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFindableNCls", "TPC findable clusters", kTH2F, {ptAxis, tpcNClsAxis}); - fhTPC_FoundNCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFoundNCls", "TPC found clusters", kTH2F, {ptAxis, tpcNClsAxis}); - fhTPC_SharedNCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCSharedNCls", "TPC shared clusters", kTH2F, {ptAxis, tpcNClsAxis}); - fhTPC_FractionSharedCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFractionSharedCls", "TPC fraction shared clusters", kTH2F, {ptAxis, tpcFractionAxis}); - fhTPC_CrossedRows_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCXrows", "TPC crossed rows", kTH2F, {ptAxis, tpcNRowsAxis}); - fhTPC_CrossedRowsOverFindableCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "XRowsOverFindableCls", "TPC xrows over findable clusters", kTH2F, {ptAxis, tpcXRowsOverFindClsAxis}); - fhTPC_Chi2NCls_vs_PtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCChi2NCls", "TPC #Chi^{2}", kTH2F, {ptAxis, tpcCh2Axis}); + fhItsNClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSNCls", "ITS clusters", kTH2F, {ptAxis, itsNClsAxis}); + fhItsChi2NClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSChi2NCls", "ITS #Chi^{2}", kTH2F, {ptAxis, itsCh2Axis}); + fhTpcFindableNClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFindableNCls", "TPC findable clusters", kTH2F, {ptAxis, tpcNClsAxis}); + fhTpcFoundNClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFoundNCls", "TPC found clusters", kTH2F, {ptAxis, tpcNClsAxis}); + fhTpcSharedNClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCSharedNCls", "TPC shared clusters", kTH2F, {ptAxis, tpcNClsAxis}); + fhTpcFractionSharedClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFractionSharedCls", "TPC fraction shared clusters", kTH2F, {ptAxis, tpcFractionAxis}); + fhTpcCrossedRowsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCXrows", "TPC crossed rows", kTH2F, {ptAxis, tpcNRowsAxis}); + fhTpcCrossedRowsOverFindableClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "XRowsOverFindableCls", "TPC xrows over findable clusters", kTH2F, {ptAxis, tpcXRowsOverFindClsAxis}); + fhTpcChi2NClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCChi2NCls", "TPC #Chi^{2}", kTH2F, {ptAxis, tpcCh2Axis}); /* efficiency histograms */ fhPvsInnerP = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "pVsInnerP", "#it{p} versus TPC inner wall #it{p}", kTH2F, {pidPAxis, pidPAxis}); - fhPt_vs_EtaItsAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsAcc", "ITS tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaTpcAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptTpcAcc", "TPC tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaItsTpcAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTpcAcc", "ITS&TPC tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaItsTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTofAcc", "ITS&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaTpcTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptTpcTofAcc", "TPC&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaItsTpcTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTpcTofAcc", "ITS&TPC&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsAcc", "ITS tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaTpcAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptTpcAcc", "TPC tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsTpcAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTpcAcc", "ITS&TPC tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTofAcc", "ITS&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaTpcTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptTpcTofAcc", "TPC&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsTpcTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTpcTofAcc", "ITS&TPC&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); for (uint isp = 0; isp < nsp; ++isp) { - fhITS_NCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("ITSNCls_%s", tnames[isp].c_str()), HTITLESTRING("ITS clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, itsNClsAxis}); - fhITS_Chi2NCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("ITSChi2NCls_%s", tnames[isp].c_str()), HTITLESTRING("ITS #Chi^{2} %s", tnames[isp].c_str()), kTH2F, {ptAxis, itsCh2Axis}); - fhTPC_FindableNCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFindableNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC findable clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); - fhTPC_FoundNCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFoundNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC found clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); - fhTPC_SharedNCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCSharedNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC shared clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); - fhTPC_FractionSharedCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFractionSharedCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC fraction shared clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcFractionAxis}); - fhTPC_CrossedRows_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCXrows_%s", tnames[isp].c_str()), HTITLESTRING("TPC crossed rows %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNRowsAxis}); - fhTPC_CrossedRowsOverFindableCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("XRowsOverFindableCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC xrows over findable clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcXRowsOverFindClsAxis}); - fhTPC_Chi2NCls_vs_PtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCChi2NCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC #Chi^{2} %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcCh2Axis}); + fhItsNClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("ITSNCls_%s", tnames[isp].c_str()), HTITLESTRING("ITS clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, itsNClsAxis}); + fhItsChi2NClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("ITSChi2NCls_%s", tnames[isp].c_str()), HTITLESTRING("ITS #Chi^{2} %s", tnames[isp].c_str()), kTH2F, {ptAxis, itsCh2Axis}); + fhTpcFindableNClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFindableNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC findable clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); + fhTpcFoundNClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFoundNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC found clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); + fhTpcSharedNClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCSharedNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC shared clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); + fhTpcFractionSharedClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFractionSharedCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC fraction shared clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcFractionAxis}); + fhTpcCrossedRowsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCXrows_%s", tnames[isp].c_str()), HTITLESTRING("TPC crossed rows %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNRowsAxis}); + fhTpcCrossedRowsOverFindableClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("XRowsOverFindableCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC xrows over findable clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcXRowsOverFindClsAxis}); + fhTpcChi2NClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCChi2NCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC #Chi^{2} %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcCh2Axis}); /* efficiency histograms */ - fhPt_vs_EtaItsA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptIts_%s", tnames[isp].c_str()), HTITLESTRING("ITS %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaTpcA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptTpc_%s", tnames[isp].c_str()), HTITLESTRING("TPC %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaItsTpcA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTpc_%s", tnames[isp].c_str()), HTITLESTRING("ITS&TPC %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaItsTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTof_%s", tnames[isp].c_str()), HTITLESTRING("ITS&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaTpcTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptTpcTof_%s", tnames[isp].c_str()), HTITLESTRING("TPC&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaItsTpcTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTpcTof_%s", tnames[isp].c_str()), HTITLESTRING("ITS&TPC&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptIts%s", tnames[isp].c_str()), HTITLESTRING("ITS %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaTpcA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptTpc%s", tnames[isp].c_str()), HTITLESTRING("TPC %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsTpcA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTpc%s", tnames[isp].c_str()), HTITLESTRING("ITS&TPC %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTof_%s", tnames[isp].c_str()), HTITLESTRING("ITS&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaTpcTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptTpcTof_%s", tnames[isp].c_str()), HTITLESTRING("TPC&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaItsTpcTofA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), HNAMESTRING("ptItsTpcTof_%s", tnames[isp].c_str()), HTITLESTRING("ITS&TPC&TOF %s tracks", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); } } else { AxisSpec recoSpecies{static_cast(nsp) + 1, -0.5, nsp - 0.5, "reco species"}; @@ -242,57 +246,57 @@ struct QADataCollectingEngine { fhPtPurityNegMatA = ADDHISTOGRAM(TH3, DIRECTORYSTRING("%s/%s", dirname, "Purity"), "ptPurityNegMat", "Secondaries from material for reconstructed negative", kTH3F, {recoSpecies, trueSpecies, ptAxis}); for (uint isp = 0; isp < nsp; ++isp) { /* detector level and generator level histograms */ - fhPt_vs_EtaPrimA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Gen"), - HNAMESTRING("ptPrim%s", tnames[isp].c_str()), - HTITLESTRING("ITS %s tracks (primaries)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaSecA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Gen"), - HNAMESTRING("ptSec%s", tnames[isp].c_str()), - HTITLESTRING("ITS %s tracks (secondaries)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaMatA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Gen"), - HNAMESTRING("ptMat%s", tnames[isp].c_str()), - HTITLESTRING("ITS %s tracks (from material)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaPrimA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Gen"), + HNAMESTRING("ptPrim%s", tnames[isp].c_str()), + HTITLESTRING("ITS %s tracks (primaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaSecA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Gen"), + HNAMESTRING("ptSec%s", tnames[isp].c_str()), + HTITLESTRING("ITS %s tracks (secondaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaMatA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Gen"), + HNAMESTRING("ptMat%s", tnames[isp].c_str()), + HTITLESTRING("ITS %s tracks (from material)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); const std::vector detectedorigin = {"DetReco", "DetAssoc"}; for (uint ix = 0; ix < detectedorigin.size(); ++ix) { - fhPt_vs_EtaPrimItsA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsPrim_%s", tnames[isp].c_str()), - HTITLESTRING("ITS %s tracks (primaries)", tnames[isp].c_str()), + fhPtVsEtaPrimItsA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsPrim_%s", tnames[isp].c_str()), + HTITLESTRING("ITS %s tracks (primaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaPrimItsTpcA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsTpcPrim_%s", tnames[isp].c_str()), + HTITLESTRING("ITS&TPC %s tracks (primaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaPrimItsTpcTofA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsTpcTofPrim_%s", tnames[isp].c_str()), + HTITLESTRING("ITS&TPC&TOF %s tracks (primaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaSecItsA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsSec_%s", tnames[isp].c_str()), + HTITLESTRING("ITS %s tracks (secondaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaSecItsTpcA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsTpcSec_%s", tnames[isp].c_str()), + HTITLESTRING("ITS&TPC %s tracks (secondaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaSecItsTpcTofA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsTpcTofSec_%s", tnames[isp].c_str()), + HTITLESTRING("ITS&TPC&TOF %s tracks (secondaries)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaMatItsA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsMat_%s", tnames[isp].c_str()), + HTITLESTRING("ITS %s tracks (from material)", tnames[isp].c_str()), + kTH2F, {etaAxis, ptAxis}); + fhPtVsEtaMatItsTpcA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsTpcMat_%s", tnames[isp].c_str()), + HTITLESTRING("ITS&TPC %s tracks (from material)", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaPrimItsTpcA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsTpcPrim_%s", tnames[isp].c_str()), - HTITLESTRING("ITS&TPC %s tracks (primaries)", tnames[isp].c_str()), + fhPtVsEtaMatItsTpcTofA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), + HNAMESTRING("ptItsTpcTofMat_%s", tnames[isp].c_str()), + HTITLESTRING("ITS&TPC&TOF %s tracks (from material)", tnames[isp].c_str()), kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaPrimItsTpcTofA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsTpcTofPrim_%s", tnames[isp].c_str()), - HTITLESTRING("ITS&TPC&TOF %s tracks (primaries)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaSecItsA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsSec_%s", tnames[isp].c_str()), - HTITLESTRING("ITS %s tracks (secondaries)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaSecItsTpcA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsTpcSec_%s", tnames[isp].c_str()), - HTITLESTRING("ITS&TPC %s tracks (secondaries)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaSecItsTpcTofA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsTpcTofSec_%s", tnames[isp].c_str()), - HTITLESTRING("ITS&TPC&TOF %s tracks (secondaries)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaMatItsA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsMat_%s", tnames[isp].c_str()), - HTITLESTRING("ITS %s tracks (from material)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaMatItsTpcA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsTpcMat_%s", tnames[isp].c_str()), - HTITLESTRING("ITS&TPC %s tracks (from material)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); - fhPt_vs_EtaMatItsTpcTofA[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", detectedorigin[ix].c_str()), - HNAMESTRING("ptItsTpcTofMat_%s", tnames[isp].c_str()), - HTITLESTRING("ITS&TPC&TOF %s tracks (from material)", tnames[isp].c_str()), - kTH2F, {etaAxis, ptAxis}); } } } @@ -306,12 +310,12 @@ struct QADataCollectingEngine { using namespace o2::aod::track; fhPtB[kindOfData]->Fill(track.pt()); - fhPt_vs_EtaB[kindOfData]->Fill(track.eta(), track.pt()); - fhPt_vs_ZvtxB[kindOfData]->Fill(zvtx, track.pt()); + fhPtVsEtaB[kindOfData]->Fill(track.eta(), track.pt()); + fhPtVsZvtxB[kindOfData]->Fill(zvtx, track.pt()); if (!(track.trackacceptedid() < 0)) { fhPtA[kindOfData][track.trackacceptedid()]->Fill(track.pt()); - fhPt_vs_EtaA[kindOfData][track.trackacceptedid()]->Fill(track.eta(), track.pt()); - fhPt_vs_ZvtxA[kindOfData][track.trackacceptedid()]->Fill(zvtx, track.pt()); + fhPtVsEtaA[kindOfData][track.trackacceptedid()]->Fill(track.eta(), track.pt()); + fhPtVsZvtxA[kindOfData][track.trackacceptedid()]->Fill(zvtx, track.pt()); } if constexpr (kindOfData == kReco) { auto fillhisto = [&track](auto& h, bool cond) { @@ -323,42 +327,42 @@ struct QADataCollectingEngine { bool hastpc = track.hasTPC() && TrackSelectionFlags::checkFlag(track.trackCutFlag(), TrackSelectionTPC); bool hastof = track.hasTOF(); - fhITS_NCls_vs_PtB->Fill(track.pt(), track.itsNCls()); - fhITS_Chi2NCls_vs_PtB->Fill(track.pt(), track.itsChi2NCl()); - fhTPC_FindableNCls_vs_PtB->Fill(track.pt(), track.tpcNClsFindable()); - fhTPC_FoundNCls_vs_PtB->Fill(track.pt(), track.tpcNClsFound()); - fhTPC_SharedNCls_vs_PtB->Fill(track.pt(), track.tpcNClsShared()); - fhTPC_FractionSharedCls_vs_PtB->Fill(track.pt(), track.tpcFractionSharedCls()); - fhTPC_CrossedRows_vs_PtB->Fill(track.pt(), track.tpcNClsCrossedRows()); - fhTPC_CrossedRowsOverFindableCls_vs_PtB->Fill(track.pt(), track.tpcCrossedRowsOverFindableCls()); - fhTPC_Chi2NCls_vs_PtB->Fill(track.pt(), track.tpcChi2NCl()); + fhItsNClsVsPtB->Fill(track.pt(), track.itsNCls()); + fhItsChi2NClsVsPtB->Fill(track.pt(), track.itsChi2NCl()); + fhTpcFindableNClsVsPtB->Fill(track.pt(), track.tpcNClsFindable()); + fhTpcFoundNClsVsPtB->Fill(track.pt(), track.tpcNClsFound()); + fhTpcSharedNClsVsPtB->Fill(track.pt(), track.tpcNClsShared()); + fhTpcFractionSharedClsVsPtB->Fill(track.pt(), track.tpcFractionSharedCls()); + fhTpcCrossedRowsVsPtB->Fill(track.pt(), track.tpcNClsCrossedRows()); + fhTpcCrossedRowsOverFindableClsVsPtB->Fill(track.pt(), track.tpcCrossedRowsOverFindableCls()); + fhTpcChi2NClsVsPtB->Fill(track.pt(), track.tpcChi2NCl()); if (inTheAcceptance(track)) { /* efficiency histograms */ - fillhisto(fhPt_vs_EtaItsAcc, hasits); - fillhisto(fhPt_vs_EtaTpcAcc, hastpc); - fillhisto(fhPt_vs_EtaItsTpcAcc, hasits && hastpc); - fillhisto(fhPt_vs_EtaItsTofAcc, hasits && hastof); - fillhisto(fhPt_vs_EtaTpcTofAcc, hastpc && hastof); - fillhisto(fhPt_vs_EtaItsTpcTofAcc, hasits && hastpc && hastof); + fillhisto(fhPtVsEtaItsAcc, hasits); + fillhisto(fhPtVsEtaTpcAcc, hastpc); + fillhisto(fhPtVsEtaItsTpcAcc, hasits && hastpc); + fillhisto(fhPtVsEtaItsTofAcc, hasits && hastof); + fillhisto(fhPtVsEtaTpcTofAcc, hastpc && hastof); + fillhisto(fhPtVsEtaItsTpcTofAcc, hasits && hastpc && hastof); } if (!(track.trackacceptedid() < 0)) { - fhITS_NCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.itsNCls()); - fhITS_Chi2NCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.itsChi2NCl()); - fhTPC_FindableNCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsFindable()); - fhTPC_FoundNCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsFound()); - fhTPC_SharedNCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsShared()); - fhTPC_FractionSharedCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcFractionSharedCls()); - fhTPC_CrossedRows_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsCrossedRows()); - fhTPC_CrossedRowsOverFindableCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcCrossedRowsOverFindableCls()); - fhTPC_Chi2NCls_vs_PtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcChi2NCl()); + fhItsNClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.itsNCls()); + fhItsChi2NClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.itsChi2NCl()); + fhTpcFindableNClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsFindable()); + fhTpcFoundNClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsFound()); + fhTpcSharedNClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsShared()); + fhTpcFractionSharedClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcFractionSharedCls()); + fhTpcCrossedRowsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsCrossedRows()); + fhTpcCrossedRowsOverFindableClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcCrossedRowsOverFindableCls()); + fhTpcChi2NClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcChi2NCl()); /* efficiency histograms */ fhPvsInnerP->Fill(track.tpcInnerParam(), track.p()); - fillhisto(fhPt_vs_EtaItsA[track.trackacceptedid()], hasits); - fillhisto(fhPt_vs_EtaTpcA[track.trackacceptedid()], hastpc); - fillhisto(fhPt_vs_EtaItsTpcA[track.trackacceptedid()], hasits && hastpc); - fillhisto(fhPt_vs_EtaItsTofA[track.trackacceptedid()], hasits && hastof); - fillhisto(fhPt_vs_EtaTpcTofA[track.trackacceptedid()], hastpc && hastof); - fillhisto(fhPt_vs_EtaItsTpcTofA[track.trackacceptedid()], hasits && hastpc && hastof); + fillhisto(fhPtVsEtaItsA[track.trackacceptedid()], hasits); + fillhisto(fhPtVsEtaTpcA[track.trackacceptedid()], hastpc); + fillhisto(fhPtVsEtaItsTpcA[track.trackacceptedid()], hasits && hastpc); + fillhisto(fhPtVsEtaItsTofA[track.trackacceptedid()], hasits && hastof); + fillhisto(fhPtVsEtaTpcTofA[track.trackacceptedid()], hastpc && hastof); + fillhisto(fhPtVsEtaItsTpcTofA[track.trackacceptedid()], hasits && hastpc && hastof); /* the detector / generator combined level */ if constexpr (framework::has_type_v) { auto findgenid = [&](auto& part) { @@ -397,18 +401,18 @@ struct QADataCollectingEngine { h->Fill(eta, pt); } }; - std::vector t_pt = {track.pt(), mcparticle.pt()}; - std::vector t_eta = {track.eta(), mcparticle.eta()}; - for (uint ix = 0; ix < t_pt.size(); ++ix) { - fillhisto(fhPt_vs_EtaPrimItsA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits, isprimary); - fillhisto(fhPt_vs_EtaPrimItsTpcA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits && hastpc, isprimary); - fillhisto(fhPt_vs_EtaPrimItsTpcTofA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits && hastof, isprimary); - fillhisto(fhPt_vs_EtaSecItsA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits, issecdecay); - fillhisto(fhPt_vs_EtaSecItsTpcA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits && hastpc, issecdecay); - fillhisto(fhPt_vs_EtaSecItsTpcTofA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits && hastof, issecdecay); - fillhisto(fhPt_vs_EtaMatItsA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits, isfrommaterial); - fillhisto(fhPt_vs_EtaMatItsTpcA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits && hastpc, isfrommaterial); - fillhisto(fhPt_vs_EtaMatItsTpcTofA[ix][track.trackacceptedid()], t_pt[ix], t_eta[ix], hasits && hastof, isfrommaterial); + std::vector tPt = {track.pt(), mcparticle.pt()}; + std::vector tEta = {track.eta(), mcparticle.eta()}; + for (uint ix = 0; ix < tPt.size(); ++ix) { + fillhisto(fhPtVsEtaPrimItsA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits, isprimary); + fillhisto(fhPtVsEtaPrimItsTpcA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastpc, isprimary); + fillhisto(fhPtVsEtaPrimItsTpcTofA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastof, isprimary); + fillhisto(fhPtVsEtaSecItsA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits, issecdecay); + fillhisto(fhPtVsEtaSecItsTpcA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastpc, issecdecay); + fillhisto(fhPtVsEtaSecItsTpcTofA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastof, issecdecay); + fillhisto(fhPtVsEtaMatItsA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits, isfrommaterial); + fillhisto(fhPtVsEtaMatItsTpcA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastpc, isfrommaterial); + fillhisto(fhPtVsEtaMatItsTpcTofA[ix][track.trackacceptedid()], tPt[ix], tEta[ix], hasits && hastof, isfrommaterial); } } } @@ -417,11 +421,11 @@ struct QADataCollectingEngine { if (!(track.trackacceptedid() < 0)) { /* pure generator level */ if (track.isPhysicalPrimary()) { - fhPt_vs_EtaPrimA[track.trackacceptedid()]->Fill(track.eta(), track.pt()); + fhPtVsEtaPrimA[track.trackacceptedid()]->Fill(track.eta(), track.pt()); } else if (track.getProcess() == 4) { - fhPt_vs_EtaSecA[track.trackacceptedid()]->Fill(track.eta(), track.pt()); + fhPtVsEtaSecA[track.trackacceptedid()]->Fill(track.eta(), track.pt()); } else { - fhPt_vs_EtaMatA[track.trackacceptedid()]->Fill(track.eta(), track.pt()); + fhPtVsEtaMatA[track.trackacceptedid()]->Fill(track.eta(), track.pt()); } } } @@ -701,33 +705,33 @@ struct DptDptEfficiencyAndQc { PidExtraDataCollectingEngine** pidExtraDataCE; /* the histogram registries */ - HistogramRegistry registry_one{"registry_one", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_two{"registry_two", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_three{"registry_three", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_four{"registry_four", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_five{"registry_five", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_six{"registry_six", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_seven{"registry_seven", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_eight{"registry_eight", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_nine{"registry_nine", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_ten{"registry_ten", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidone{"pidregistry_one", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidtwo{"pidregistry_two", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidthree{"pidregistry_three", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidfour{"pidregistry_four", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidfive{"pidregistry_five", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidsix{"pidregistry_six", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidseven{"pidregistry_seven", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pideight{"pidregistry_eight", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidnine{"pidregistry_nine", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registry_pidten{"pidregistry_ten", {}, OutputObjHandlingPolicy::AnalysisObject}; - std::vector registrybank{®istry_one, ®istry_two, ®istry_three, ®istry_four, ®istry_five, - ®istry_six, ®istry_seven, ®istry_eight, ®istry_nine, ®istry_ten}; - std::vector pidregistrybank{®istry_pidone, ®istry_pidtwo, ®istry_pidthree, ®istry_pidfour, ®istry_pidfive, - ®istry_pidsix, ®istry_pidseven, ®istry_pideight, ®istry_pidnine, ®istry_pidten}; - - Configurable inCentralityClasses{"usecentrality", false, "Perform the task using centrality/multiplicity classes. Default value: false"}; - Configurable useTPCInnerWallMomentum{"useinnerwallmomm", false, "Use the TPC inner wall momentum. Default: false"}; + HistogramRegistry registryOne{"registryOne", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryTwo{"registryTwo", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryThree{"registryThree", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryFour{"registryFour", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryFive{"registryFive", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registrySix{"registrySix", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registrySeven{"registrySeven", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryEight{"registryEight", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryNine{"registryNine", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryTen{"registryTen", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidOne{"pidregistryOne", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidTwo{"pidregistryTwo", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidThree{"pidregistryThree", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidFour{"pidregistryFour", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidFive{"pidregistryFive", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidSix{"pidregistrySix", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidSeven{"pidregistrySeven", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidEight{"pidregistryEight", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidNine{"pidregistryNine", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryPidTen{"pidregistryTen", {}, OutputObjHandlingPolicy::AnalysisObject}; + std::vector registrybank{®istryOne, ®istryTwo, ®istryThree, ®istryFour, ®istryFive, + ®istrySix, ®istrySeven, ®istryEight, ®istryNine, ®istryTen}; + std::vector pidregistrybank{®istryPidOne, ®istryPidTwo, ®istryPidThree, ®istryPidFour, ®istryPidFive, + ®istryPidSix, ®istryPidSeven, ®istryPidEight, ®istryPidNine, ®istryPidTen}; + + Configurable useCentrality{"useCentrality", false, "Perform the task using centrality/multiplicity classes. Default value: false"}; + Configurable useTPCInnerWallMomentum{"useTPCInnerWallMomentum", false, "Use the TPC inner wall momentum. Default: false"}; void init(o2::framework::InitContext& initContext) { @@ -796,7 +800,7 @@ struct DptDptEfficiencyAndQc { /* create the data collecting engine instances according to the configured centrality/multiplicity ranges */ std::string centspec; - if (inCentralityClasses.value && getTaskOptionValue(initContext, "dpt-dpt-filter", "centralities", centspec, false)) { + if (useCentrality.value && getTaskOptionValue(initContext, "dpt-dpt-filter", "centralities", centspec, false)) { LOGF(info, "Got the centralities specification: %s", centspec.c_str()); auto tokens = TString(centspec.c_str()).Tokenize(","); ncmranges = tokens->GetEntries(); @@ -828,7 +832,7 @@ struct DptDptEfficiencyAndQc { if (doPidAnalysis) { pidDataCE = new PidDataCollectingEngine*[ncmranges]; } - if (doPidAnalysis) { + if (doPidExtraAnalysis) { pidExtraDataCE = new PidExtraDataCollectingEngine*[ncmranges]; } std::string recogen; @@ -881,7 +885,7 @@ struct DptDptEfficiencyAndQc { template int getDCEindex(FilteredCollision collision) { - if (!inCentralityClasses.value) { + if (!useCentrality.value) { return 0; } else { int ixDCE = -1; @@ -908,7 +912,7 @@ struct DptDptEfficiencyAndQc { int ixDCE = getDCEindex(collision); if (!(ixDCE < 0)) { - for (auto& track : tracks) { + for (auto const& track : tracks) { float mom = track.p(); if (useTPCInnerWallMomentum.value) { if constexpr (!framework::has_type_v) { @@ -934,13 +938,13 @@ struct DptDptEfficiencyAndQc { LOGF(debug, "Received %d collisions", collisions.size()); } - using tpcPID = soa::Join; - using tofPID = soa::Join; + using TpcPID = soa::Join; + using TofPID = soa::Join; Filter onlyacceptedcollisions = (aod::dptdptfilter::collisionaccepted == uint8_t(true)); void processReconstructedNotStored(soa::Filtered>::iterator const& collision, - soa::Join& tracks) + soa::Join const& tracks) { using namespace efficiencyandqatask; @@ -949,7 +953,7 @@ struct DptDptEfficiencyAndQc { PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStored, "Process reconstructed efficiency and QA for not stored derived data", false); void processDetectorLevelNotStored(soa::Filtered>::iterator const& collision, - soa::Join& tracks, + soa::Join const& tracks, soa::Join const&) { using namespace efficiencyandqatask; @@ -959,7 +963,7 @@ struct DptDptEfficiencyAndQc { PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStored, "Process MC detector level efficiency and QA for not stored derived data", false); void processGeneratorLevelNotStored(soa::Filtered>::iterator const& collision, - soa::Join& particles) + soa::Join const& particles) { using namespace efficiencyandqatask; @@ -968,52 +972,52 @@ struct DptDptEfficiencyAndQc { PROCESS_SWITCH(DptDptEfficiencyAndQc, processGeneratorLevelNotStored, "Process MC generator level efficiency and QA for not stored derived data", true); void processReconstructedNotStoredPID(soa::Filtered>::iterator const& collision, - soa::Join& tracks) + soa::Join const& tracks) { using namespace efficiencyandqatask; processTracks>, kPID, kReco>(collision, tracks); } - PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStoredPID, "Process reconstructed efficiency and QA for not stored derived data", false); + PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStoredPID, "Process reconstructed PID QA for not stored derived data", false); void processReconstructedNotStoredPIDExtra(soa::Filtered>::iterator const& collision, - soa::Join& tracks) + soa::Join const& tracks) { using namespace efficiencyandqatask; processTracks>, kPIDEXTRA, kReco>(collision, tracks); } - PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStoredPIDExtra, "Process reconstructed efficiency and QA for not stored derived data", false); + PROCESS_SWITCH(DptDptEfficiencyAndQc, processReconstructedNotStoredPIDExtra, "Process reconstructed PID extra QA for not stored derived data", false); void processDetectorLevelNotStoredPID(soa::Filtered>::iterator const& collision, - soa::Join& tracks, + soa::Join const& tracks, soa::Join const&) { using namespace efficiencyandqatask; processTracks>, kPID, kReco>(collision, tracks); } - PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStoredPID, "Process MC detector level efficiency and QA for not stored derived data", true); + PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStoredPID, "Process MC detector level PID QA for not stored derived data", true); void processDetectorLevelNotStoredPIDExtra(soa::Filtered>::iterator const& collision, - soa::Join& tracks, + soa::Join const& tracks, soa::Join const&) { using namespace efficiencyandqatask; processTracks>, kPIDEXTRA, kReco>(collision, tracks); } - PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStoredPIDExtra, "Process MC detector level efficiency and QA for not stored derived data", true); + PROCESS_SWITCH(DptDptEfficiencyAndQc, processDetectorLevelNotStoredPIDExtra, "Process MC detector level PID extra QA for not stored derived data", true); }; using BCsWithTimestamps = soa::Join; -struct checkTimestamp { +struct CheckTimestamp { - o2::ccdb::CcdbApi ccdb_api; + o2::ccdb::CcdbApi ccdbApi; int mRunNumber; - ULong64_t runsor = 0; - ULong64_t runeor = 0; + uint64_t runsor = 0; + uint64_t runeor = 0; std::shared_ptr hTimeStampDiffNegative = nullptr; std::shared_ptr hTimeStampDiffPositive = nullptr; @@ -1028,7 +1032,7 @@ struct checkTimestamp { hTimeStampDiffNegative = registry.add("DiffNegative", "Time before SOR (s)", kTH2F, {{100, 0.5, 100.5, "Run number"}, diffAxis}); hTimeStampDiffPositive = registry.add("DiffPositive", "Time after EOR (s)", kTH2F, {{100, 0.5, 100.5, "Run number"}, diffAxis}); - ccdb_api.init(ccdburl); + ccdbApi.init(ccdburl); } void process(aod::Collisions const& collisions, BCsWithTimestamps const&) @@ -1041,7 +1045,7 @@ struct checkTimestamp { mRunNumber = bc.runNumber(); // read SOR and EOR timestamps from RCT CCDB via utility function - auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdb_api, mRunNumber, false); + auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, mRunNumber, false); runeor = soreor.second; runsor = soreor.first; } @@ -1066,6 +1070,6 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; return workflow; } From b559b1c95a44cd9b566b8798bc74f7d1e8f5d76e Mon Sep 17 00:00:00 2001 From: Rafael Manhart <56776511+RafRaf11@users.noreply.github.com> Date: Tue, 3 Dec 2024 06:52:47 +0100 Subject: [PATCH 218/459] [PWGLF] Update NucleiHistTask (#8765) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/NucleiHistTask.cxx | 190 ++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) diff --git a/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx b/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx index bacf180ca48..c7136664631 100644 --- a/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx +++ b/PWGLF/Tasks/Nuspex/NucleiHistTask.cxx @@ -17,6 +17,7 @@ #include #include #include +#include #include "ReconstructionDataFormats/Track.h" #include "Framework/runDataProcessing.h" @@ -506,6 +507,27 @@ struct NucleiHistTask { Configurable> Tpc_mSigma_shift_He3{"Tpc_mSigma_shift_He3", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting (anti)helium-3 nSigma values in TPC"}; Configurable> Tpc_mSigma_shift_Al{"Tpc_mSigma_shift_Al", {.0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f, .0f}, "Array for shifting (anti)helium-4 nSigma values in TPC"}; + TF1* Pion_Tpc_nSigma_shift = 0; + TF1* Proton_Tpc_nSigma_shift = 0; + TF1* Deuteron_Tpc_nSigma_shift = 0; + TF1* Triton_Tpc_nSigma_shift = 0; + TF1* He3_Tpc_nSigma_shift = 0; + TF1* He4_Tpc_nSigma_shift = 0; + + Configurable enable_pT_shift_pion_tpc_nSigma{"enable_pT_shift_pion_tpc_nSigma", false, "Enable Pi plus TPC nSigma recentering by TF1"}; + Configurable enable_pT_shift_proton_tpc_nSigma{"enable_pT_shift_proton_tpc_nSigma", false, "Enable Proton TPC nSigma recentering by TF1"}; + Configurable enable_pT_shift_deuteron_tpc_nSigma{"enable_pT_shift_deuteron_tpc_nSigma", false, "Enable Deuteron TPC nSigma recentering by TF1"}; + Configurable enable_pT_shift_triton_tpc_nSigma{"enable_pT_shift_triton_tpc_nSigma", false, "Enable Triton TPC nSigma recentering by TF1"}; + Configurable enable_pT_shift_He3_tpc_nSigma{"enable_pT_shift_He3_tpc_nSigma", false, "Enable Helium-3 TPC nSigma recentering by TF1"}; + Configurable enable_pT_shift_He4_tpc_nSigma{"enable_pT_shift_He4_tpc_nSigma", false, "Enable Helium-4 TPC nSigma recentering by TF1"}; + + Configurable> parShiftPtPion{"parShiftPtPion", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for Pi plus pT shift."}; + Configurable> parShiftPtProton{"parShiftPtProton", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for Proton pT shift."}; + Configurable> parShiftPtDeuteron{"parShiftPtDeuteron", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for Deuteron pT shift."}; + Configurable> parShiftPtTriton{"parShiftPtTriton", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for Triton pT shift."}; + Configurable> parShiftPtHe3{"parShiftPtHe3", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for Helium-3 pT shift."}; + Configurable> parShiftPtHe4{"parShiftPtHe4", {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, "Parameters for Alpha pT shift."}; + // *************************************************************************** int getBinIndex(const std::vector& ptBinning, float momentum) @@ -531,6 +553,37 @@ struct NucleiHistTask { spectra_reg.fill(HIST("histRecVtxZData"), event.posZ()); } + if (enable_pT_shift_pion_tpc_nSigma) { + Pion_Tpc_nSigma_shift = new TF1("Pion_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtPion; + Pion_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_proton_tpc_nSigma) { + Proton_Tpc_nSigma_shift = new TF1("Proton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtProton; + Proton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_deuteron_tpc_nSigma) { + Deuteron_Tpc_nSigma_shift = new TF1("Deuteron_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtDeuteron; + Deuteron_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_triton_tpc_nSigma) { + Triton_Tpc_nSigma_shift = new TF1("Triton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtTriton; + Triton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_He3_tpc_nSigma) { + He3_Tpc_nSigma_shift = new TF1("He3_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtHe3; + He3_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_He4_tpc_nSigma) { + He4_Tpc_nSigma_shift = new TF1("He4_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtHe4; + He4_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + for (auto track : tracks) { histTrackcuts_data->AddBinContent(1); @@ -690,6 +743,31 @@ struct NucleiHistTask { if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Al.value.size())) nSigmaHe4 += Tpc_mSigma_shift_Al.value[binIndex]; + if (enable_pT_shift_pion_tpc_nSigma) { + float nSigmaPion_shift = Pion_Tpc_nSigma_shift->Eval(momentum); + nSigmaPion -= nSigmaPion_shift; + } + if (enable_pT_shift_proton_tpc_nSigma) { + float nSigmaProton_shift = Proton_Tpc_nSigma_shift->Eval(momentum); + nSigmaProton -= nSigmaProton_shift; + } + if (enable_pT_shift_deuteron_tpc_nSigma) { + float nSigmaDeuteron_shift = Deuteron_Tpc_nSigma_shift->Eval(momentum); + nSigmaDeut -= nSigmaDeuteron_shift; + } + if (enable_pT_shift_triton_tpc_nSigma) { + float nSigmaTriton_shift = Triton_Tpc_nSigma_shift->Eval(momentum); + nSigmaTriton -= nSigmaTriton_shift; + } + if (enable_pT_shift_He3_tpc_nSigma) { + float nSigmaHe3_shift = He3_Tpc_nSigma_shift->Eval(momentum); + nSigmaHe3 -= nSigmaHe3_shift; + } + if (enable_pT_shift_He4_tpc_nSigma) { + float nSigmaHe4_shift = He4_Tpc_nSigma_shift->Eval(momentum); + nSigmaHe4 -= nSigmaHe4_shift; + } + if (track.sign() > 0) { pion_reg.fill(HIST("histTpcNsigmaData"), momentum, nSigmaPion); proton_reg.fill(HIST("histTpcNsigmaData"), momentum, nSigmaProton); @@ -1233,6 +1311,37 @@ struct NucleiHistTask { if (!event_selection_sel8) spectra_reg.fill(HIST("histCentrality"), event.centFT0C()); + if (enable_pT_shift_pion_tpc_nSigma) { + Pion_Tpc_nSigma_shift = new TF1("Pion_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtPion; + Pion_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_proton_tpc_nSigma) { + Proton_Tpc_nSigma_shift = new TF1("Proton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtProton; + Proton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_deuteron_tpc_nSigma) { + Deuteron_Tpc_nSigma_shift = new TF1("Deuteron_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtDeuteron; + Deuteron_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_triton_tpc_nSigma) { + Triton_Tpc_nSigma_shift = new TF1("Triton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtTriton; + Triton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_He3_tpc_nSigma) { + He3_Tpc_nSigma_shift = new TF1("He3_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtHe3; + He3_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_He4_tpc_nSigma) { + He4_Tpc_nSigma_shift = new TF1("He4_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtHe4; + He4_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + for (auto track : tracks) { if ((event_selection_sel8 && !event.sel8()) || (enable_Centrality_cut_global && (event.centFT0C() < minCentrality) && (event.centFT0C() > maxCentrality))) @@ -1334,6 +1443,31 @@ struct NucleiHistTask { if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Al.value.size())) nSigmaHe4 += Tpc_mSigma_shift_Al.value[binIndex]; + if (enable_pT_shift_pion_tpc_nSigma) { + float nSigmaPion_shift = Pion_Tpc_nSigma_shift->Eval(momentum); + nSigmaPion -= nSigmaPion_shift; + } + if (enable_pT_shift_proton_tpc_nSigma) { + float nSigmaProton_shift = Proton_Tpc_nSigma_shift->Eval(momentum); + nSigmaProton -= nSigmaProton_shift; + } + if (enable_pT_shift_deuteron_tpc_nSigma) { + float nSigmaDeuteron_shift = Deuteron_Tpc_nSigma_shift->Eval(momentum); + nSigmaDeut -= nSigmaDeuteron_shift; + } + if (enable_pT_shift_triton_tpc_nSigma) { + float nSigmaTriton_shift = Triton_Tpc_nSigma_shift->Eval(momentum); + nSigmaTriton -= nSigmaTriton_shift; + } + if (enable_pT_shift_He3_tpc_nSigma) { + float nSigmaHe3_shift = He3_Tpc_nSigma_shift->Eval(momentum); + nSigmaHe3 -= nSigmaHe3_shift; + } + if (enable_pT_shift_He4_tpc_nSigma) { + float nSigmaHe4_shift = He4_Tpc_nSigma_shift->Eval(momentum); + nSigmaHe4 -= nSigmaHe4_shift; + } + if (track.sign() > 0) { pion_reg.fill(HIST("histTpcNsigmaData_cent"), momentum, nSigmaPion, event.centFT0C()); @@ -1577,6 +1711,37 @@ struct NucleiHistTask { MC_recon_reg.fill(HIST("histRecVtxMC"), collisions.posZ()); MC_recon_reg.fill(HIST("histCentrality"), collisions.centFT0C()); + if (enable_pT_shift_pion_tpc_nSigma) { + Pion_Tpc_nSigma_shift = new TF1("Pion_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtPion; + Pion_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_proton_tpc_nSigma) { + Proton_Tpc_nSigma_shift = new TF1("Proton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtProton; + Proton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_deuteron_tpc_nSigma) { + Deuteron_Tpc_nSigma_shift = new TF1("Deuteron_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtDeuteron; + Deuteron_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_triton_tpc_nSigma) { + Triton_Tpc_nSigma_shift = new TF1("Triton_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtTriton; + Triton_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_He3_tpc_nSigma) { + He3_Tpc_nSigma_shift = new TF1("He3_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtHe3; + He3_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + if (enable_pT_shift_He4_tpc_nSigma) { + He4_Tpc_nSigma_shift = new TF1("He4_Tpc_nSigma_shift", "[0] * TMath::Exp([1] + [2] * x) + [3] + [4] * x + [5] * x * x", 0.f, 14.f); + auto par = (std::vector)parShiftPtHe4; + He4_Tpc_nSigma_shift->SetParameters(par[0], par[1], par[2], par[3], par[4], par[5]); + } + for (auto& track : tracks) { histTrackcuts_MC->AddBinContent(1); const auto particle = track.mcParticle(); @@ -1839,6 +2004,31 @@ struct NucleiHistTask { if (binIndex >= 0 && binIndex < static_cast(Tpc_mSigma_shift_Al.value.size())) nSigmaHe4 += Tpc_mSigma_shift_Al.value[binIndex]; + if (enable_pT_shift_pion_tpc_nSigma) { + float nSigmaPion_shift = Pion_Tpc_nSigma_shift->Eval(momentum); + nSigmaPion -= nSigmaPion_shift; + } + if (enable_pT_shift_proton_tpc_nSigma) { + float nSigmaProton_shift = Proton_Tpc_nSigma_shift->Eval(momentum); + nSigmaProton -= nSigmaProton_shift; + } + if (enable_pT_shift_deuteron_tpc_nSigma) { + float nSigmaDeuteron_shift = Deuteron_Tpc_nSigma_shift->Eval(momentum); + nSigmaDeuteron -= nSigmaDeuteron_shift; + } + if (enable_pT_shift_triton_tpc_nSigma) { + float nSigmaTriton_shift = Triton_Tpc_nSigma_shift->Eval(momentum); + nSigmaTriton -= nSigmaTriton_shift; + } + if (enable_pT_shift_He3_tpc_nSigma) { + float nSigmaHe3_shift = He3_Tpc_nSigma_shift->Eval(momentum); + nSigmaHe3 -= nSigmaHe3_shift; + } + if (enable_pT_shift_He4_tpc_nSigma) { + float nSigmaHe4_shift = He4_Tpc_nSigma_shift->Eval(momentum); + nSigmaHe4 -= nSigmaHe4_shift; + } + if (track.sign() > 0) { MC_recon_reg.fill(HIST("histTpcNsigmaDataPi"), momentum, nSigmaPion); MC_recon_reg.fill(HIST("histTpcNsigmaDataPr"), momentum, nSigmaProton); From 8293523dcf5fa03157efe8921fe1345f20907276 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Tue, 3 Dec 2024 06:58:18 +0100 Subject: [PATCH 219/459] [PWGLF] PWGLF/Tasks/Nuspex/spectraTOF.cxx (#8774) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 35 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 37c87eeaec0..ce950f9c0b9 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -1375,20 +1375,27 @@ struct tofSpectra { const auto& nsigmaTOFPi = o2::aod::pidutils::tofNSigma<2>(track); const auto& nsigmaTOFKa = o2::aod::pidutils::tofNSigma<3>(track); const auto& nsigmaTOFPr = o2::aod::pidutils::tofNSigma<4>(track); - histos.fill(HIST("nsigmatpc/test_occupancy/pos/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/neg/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/pos/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/neg/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/pos/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/neg/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); - - histos.fill(HIST("nsigmatof/test_occupancy/pos/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/neg/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/pos/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/neg/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/pos/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/neg/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); - + if (track.sign() > 0) { + histos.fill(HIST("nsigmatpc/test_occupancy/pos/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/pos/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/pos/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); + } else if (track.sign() < 0) { + histos.fill(HIST("nsigmatpc/test_occupancy/neg/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/neg/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/neg/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); + } + if (!track.hasTOF()) { + return; + } + if (track.sign() > 0) { + histos.fill(HIST("nsigmatof/test_occupancy/pos/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/pos/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/pos/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); + } else if (track.sign() < 0) { + histos.fill(HIST("nsigmatof/test_occupancy/neg/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/neg/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/neg/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); + } } // track } // process function PROCESS_SWITCH(tofSpectra, processOccupancy, "check for occupancy plots", false); From ac7804242a856560422accb484d4266c72b60e54 Mon Sep 17 00:00:00 2001 From: Astronica-Software Date: Tue, 3 Dec 2024 06:02:29 +0000 Subject: [PATCH 220/459] [PWGLF] v0ptinvmassplots task included memory/vector/string as requested by Megalinter. (#8305) Co-authored-by: nxk335-local --- PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx index 6ca3f353e07..0b1bb3c88ac 100644 --- a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx +++ b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// -/// \brief V0 task for production of invariant mass plots for Optimised Topological Cuts Analysis +/// \brief V0 task for production of invariant mass plots for Pt Spectrum Analysis /// \author Nikolaos Karatzenis (nikolaos.karatzenis@cern.ch) /// \author Roman Lietava (roman.lietava@cern.ch) @@ -28,6 +28,9 @@ This analysis includes two processes, one for Real Data and one for MC Data swit #include "Common/DataModel/EventSelection.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/DataModel/PIDResponse.h" +#include +#include +#include // namespace to be used for pt plots and bins namespace pthistos From 4a252088abc2c6afb30c04389dee98185ea0c4ab Mon Sep 17 00:00:00 2001 From: lauraser <45659867+lauraser@users.noreply.github.com> Date: Tue, 3 Dec 2024 07:35:50 +0100 Subject: [PATCH 221/459] =?UTF-8?q?Create=20derived=20data=20from=20derive?= =?UTF-8?q?d=20data=20to=20have=20only=20signal=20events=20for=20=E2=80=A6?= =?UTF-8?q?=20(#8785)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Laura Serksnyte --- PWGCF/DataModel/FemtoDerived.h | 146 ++++++------ PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h | 2 +- PWGCF/FemtoDream/TableProducer/CMakeLists.txt | 6 + ...toDreamProducerTaskForSpecificAnalysis.cxx | 211 ++++++++++++++++++ .../femtoDreamTripletTaskTrackTrackV0.cxx | 14 ++ 5 files changed, 305 insertions(+), 74 deletions(-) create mode 100644 PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx diff --git a/PWGCF/DataModel/FemtoDerived.h b/PWGCF/DataModel/FemtoDerived.h index ab9708cbaae..3e6ca985c1f 100644 --- a/PWGCF/DataModel/FemtoDerived.h +++ b/PWGCF/DataModel/FemtoDerived.h @@ -52,13 +52,13 @@ DECLARE_SOA_COLUMN(BitMaskTrackThree, bitmaskTrackThree, BitMaskType); //! Bit f DECLARE_SOA_COLUMN(Downsample, downsample, bool); //! Flag for downsampling } // namespace femtodreamcollision -DECLARE_SOA_TABLE(FDCollisions, "AOD", "FDCOLLISION", - o2::soa::Index<>, - o2::aod::collision::PosZ, - femtodreamcollision::MultV0M, - femtodreamcollision::MultNtr, - femtodreamcollision::Sphericity, - femtodreamcollision::MagField); +DECLARE_SOA_TABLE_STAGED(FDCollisions, "FDCOLLISION", + o2::soa::Index<>, + o2::aod::collision::PosZ, + femtodreamcollision::MultV0M, + femtodreamcollision::MultNtr, + femtodreamcollision::Sphericity, + femtodreamcollision::MagField); using FDCollision = FDCollisions::iterator; DECLARE_SOA_TABLE(FDColMasks, "AOD", "FDCOLMASK", @@ -74,16 +74,16 @@ namespace femtodreamMCcollision DECLARE_SOA_COLUMN(MultMCgenPartEta08, multMCgenPartEta08, int); //! Multiplicity of the event as given by the generator in |eta|<0.8 } -DECLARE_SOA_TABLE(FDMCCollisions, "AOD", "FDMCCOLLISION", - o2::soa::Index<>, - femtodreamMCcollision::MultMCgenPartEta08); +DECLARE_SOA_TABLE_STAGED(FDMCCollisions, "FDMCCOLLISION", + o2::soa::Index<>, + femtodreamMCcollision::MultMCgenPartEta08); using FDMCCollision = FDMCCollisions::iterator; namespace mcfdcolllabel { DECLARE_SOA_INDEX_COLUMN(FDMCCollision, fdMCCollision); //! MC collision for femtodreamcollision } -DECLARE_SOA_TABLE(FDMCCollLabels, "AOD", "FDMCCollLabel", mcfdcolllabel::FDMCCollisionId); +DECLARE_SOA_TABLE_STAGED(FDMCCollLabels, "FDMCCollLabel", mcfdcolllabel::FDMCCollisionId); /// FemtoDreamTrack namespace femtodreamparticle @@ -313,59 +313,59 @@ DECLARE_SOA_TABLE(FDParticlesIndex, "AOD", "FDPARTICLEINDEX", //! Table track in o2::soa::Index<>, fdhf::TrackId); -DECLARE_SOA_TABLE(FDParticles, "AOD", "FDPARTICLE", - o2::soa::Index<>, - femtodreamparticle::FDCollisionId, - femtodreamparticle::Pt, - femtodreamparticle::Eta, - femtodreamparticle::Phi, - femtodreamparticle::PartType, - femtodreamparticle::Cut, - femtodreamparticle::PIDCut, - femtodreamparticle::TempFitVar, - femtodreamparticle::ChildrenIds, - femtodreamparticle::MLambda, - femtodreamparticle::MAntiLambda, - femtodreamparticle::Theta, - femtodreamparticle::Px, - femtodreamparticle::Py, - femtodreamparticle::Pz, - femtodreamparticle::P); +DECLARE_SOA_TABLE_STAGED(FDParticles, "FDPARTICLE", + o2::soa::Index<>, + femtodreamparticle::FDCollisionId, + femtodreamparticle::Pt, + femtodreamparticle::Eta, + femtodreamparticle::Phi, + femtodreamparticle::PartType, + femtodreamparticle::Cut, + femtodreamparticle::PIDCut, + femtodreamparticle::TempFitVar, + femtodreamparticle::ChildrenIds, + femtodreamparticle::MLambda, + femtodreamparticle::MAntiLambda, + femtodreamparticle::Theta, + femtodreamparticle::Px, + femtodreamparticle::Py, + femtodreamparticle::Pz, + femtodreamparticle::P); using FDParticle = FDParticles::iterator; -DECLARE_SOA_TABLE(FDExtParticles, "AOD", "FDEXTPARTICLE", - femtodreamparticle::Sign, - femtodreamparticle::TPCNClsFound, - track::TPCNClsFindable, - femtodreamparticle::TPCNClsCrossedRows, - track::TPCNClsShared, - track::TPCInnerParam, - femtodreamparticle::ITSNCls, - femtodreamparticle::ITSNClsInnerBarrel, - track::DcaXY, - track::DcaZ, - track::TPCSignal, - femtodreamparticle::TPCNSigmaEl, - femtodreamparticle::TPCNSigmaPi, - femtodreamparticle::TPCNSigmaKa, - femtodreamparticle::TPCNSigmaPr, - femtodreamparticle::TPCNSigmaDe, - femtodreamparticle::TPCNSigmaTr, - femtodreamparticle::TPCNSigmaHe, - femtodreamparticle::TOFNSigmaEl, - femtodreamparticle::TOFNSigmaPi, - femtodreamparticle::TOFNSigmaKa, - femtodreamparticle::TOFNSigmaPr, - femtodreamparticle::TOFNSigmaDe, - femtodreamparticle::TOFNSigmaTr, - femtodreamparticle::TOFNSigmaHe, - femtodreamparticle::DaughDCA, - femtodreamparticle::TransRadius, - femtodreamparticle::DecayVtxX, - femtodreamparticle::DecayVtxY, - femtodreamparticle::DecayVtxZ, - femtodreamparticle::MKaon, - femtodreamparticle::TPCCrossedRowsOverFindableCls) +DECLARE_SOA_TABLE_STAGED(FDExtParticles, "FDEXTPARTICLE", + femtodreamparticle::Sign, + femtodreamparticle::TPCNClsFound, + track::TPCNClsFindable, + femtodreamparticle::TPCNClsCrossedRows, + track::TPCNClsShared, + track::TPCInnerParam, + femtodreamparticle::ITSNCls, + femtodreamparticle::ITSNClsInnerBarrel, + track::DcaXY, + track::DcaZ, + track::TPCSignal, + femtodreamparticle::TPCNSigmaEl, + femtodreamparticle::TPCNSigmaPi, + femtodreamparticle::TPCNSigmaKa, + femtodreamparticle::TPCNSigmaPr, + femtodreamparticle::TPCNSigmaDe, + femtodreamparticle::TPCNSigmaTr, + femtodreamparticle::TPCNSigmaHe, + femtodreamparticle::TOFNSigmaEl, + femtodreamparticle::TOFNSigmaPi, + femtodreamparticle::TOFNSigmaKa, + femtodreamparticle::TOFNSigmaPr, + femtodreamparticle::TOFNSigmaDe, + femtodreamparticle::TOFNSigmaTr, + femtodreamparticle::TOFNSigmaHe, + femtodreamparticle::DaughDCA, + femtodreamparticle::TransRadius, + femtodreamparticle::DecayVtxX, + femtodreamparticle::DecayVtxY, + femtodreamparticle::DecayVtxZ, + femtodreamparticle::MKaon, + femtodreamparticle::TPCCrossedRowsOverFindableCls) using FDFullParticle = FDExtParticles::iterator; /// FemtoDreamTrackMC @@ -411,25 +411,25 @@ DECLARE_SOA_COLUMN(PDGMCTruth, pdgMCTruth, int); //! Particle DECLARE_SOA_COLUMN(MotherPDG, motherPDG, int); //! Checks mother PDG, where mother is the primary particle for that decay chain } // namespace femtodreamMCparticle -DECLARE_SOA_TABLE(FDMCParticles, "AOD", "FDMCPARTICLE", - o2::soa::Index<>, - femtodreamMCparticle::PartOriginMCTruth, - femtodreamMCparticle::PDGMCTruth, - femtodreamparticle::Pt, - femtodreamparticle::Eta, - femtodreamparticle::Phi); +DECLARE_SOA_TABLE_STAGED(FDMCParticles, "FDMCPARTICLE", + o2::soa::Index<>, + femtodreamMCparticle::PartOriginMCTruth, + femtodreamMCparticle::PDGMCTruth, + femtodreamparticle::Pt, + femtodreamparticle::Eta, + femtodreamparticle::Phi); using FDMCParticle = FDMCParticles::iterator; -DECLARE_SOA_TABLE(FDExtMCParticles, "AOD", "FDEXTMCPARTICLE", - femtodreamMCparticle::MotherPDG); +DECLARE_SOA_TABLE_STAGED(FDExtMCParticles, "FDEXTMCPARTICLE", + femtodreamMCparticle::MotherPDG); using FDExtMCParticle = FDExtMCParticles::iterator; namespace mcfdlabel { DECLARE_SOA_INDEX_COLUMN(FDMCParticle, fdMCParticle); //! MC particle for femtodreamparticle } // namespace mcfdlabel -DECLARE_SOA_TABLE(FDMCLabels, "AOD", "FDMCLabel", //! Table joinable to FemtoDreamParticle containing the MC labels - mcfdlabel::FDMCParticleId); +DECLARE_SOA_TABLE_STAGED(FDMCLabels, "FDMCLabel", //! Table joinable to FemtoDreamParticle containing the MC labels + mcfdlabel::FDMCParticleId); namespace mcfdextlabel { DECLARE_SOA_INDEX_COLUMN(FDExtMCParticle, fdExtMCParticle); //! MC particle for femtodreamparticle diff --git a/PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h b/PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h index 7ae8ba40cc6..3cc1834de3f 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h +++ b/PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h @@ -70,7 +70,7 @@ class FemtoDreamPairCleaner } const auto& posChild = particles.iteratorAt(part2.index() - 2); const auto& negChild = particles.iteratorAt(part2.index() - 1); - if (part1.globalIndex() != posChild.childrenIds()[0] && part1.globalIndex() != negChild.childrenIds()[1]) { + if (part1.index() != posChild.childrenIds()[0] && part1.index() != negChild.childrenIds()[1]) { return true; } return false; diff --git a/PWGCF/FemtoDream/TableProducer/CMakeLists.txt b/PWGCF/FemtoDream/TableProducer/CMakeLists.txt index 569a6de54cc..4f48c6bf10a 100644 --- a/PWGCF/FemtoDream/TableProducer/CMakeLists.txt +++ b/PWGCF/FemtoDream/TableProducer/CMakeLists.txt @@ -18,3 +18,9 @@ o2physics_add_dpl_workflow(femtodream-producer-reduced SOURCES femtoDreamProducerReducedTask.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(femtodream-producer-for-specific-analysis + SOURCES femtoDreamProducerTaskForSpecificAnalysis.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx new file mode 100644 index 00000000000..b6ea6cd5f90 --- /dev/null +++ b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx @@ -0,0 +1,211 @@ +// Copyright 2019-2022 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file femtoDreamProducerTaskForSpecificAnalysis.cxx +/// \brief Tasks that reads the track tables and creates track triplets; only three identical particles can be used +/// \author Laura Serksnyte, TU München, laura.serksnyte@tum.de + +#include +#include +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "TDatabasePDG.h" + +#include "PWGCF/DataModel/FemtoDerived.h" +#include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamEventHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h" +#include "PWGCF/FemtoDream/Core/femtoDreamContainerThreeBody.h" +#include "PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h" +#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" + +using namespace o2; +using namespace o2::analysis::femtoDream; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; + +struct femtoDreamProducerTaskForSpecificAnalysis { + + SliceCache cache; + + Produces outputCollision; + Produces outputParts; + + Preslice perCol = aod::femtodreamparticle::fdCollisionId; + float mMassOne = -999, mMassTwo = -999, mMassThree = -999; + int collisions = 0; + + Configurable ConfNumberOfTracks{"ConfNumberOfTracks", 3, "Number of tracks"}; + Configurable ConfNumberOfV0{"ConfNumberOfV0", 0, "Number of V0"}; + + /// Track selection + Configurable ConfPIDthrMom{"ConfPIDthrMom", 1.f, "Momentum threshold from which TPC and TOF are required for PID"}; + Configurable ConfTPCPIDBit{"ConfTPCPIDBit", 16, "PID TPC bit from cutCulator "}; + Configurable ConfTPCTOFPIDBit{"ConfTPCTOFPIDBit", 8, "PID TPCTOF bit from cutCulator"}; + + /// Partition for selected particles + Partition SelectedParts = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) && + ifnode(aod::femtodreamparticle::pt * (nexp(aod::femtodreamparticle::eta) + nexp(-1.f * aod::femtodreamparticle::eta)) / 2.f <= ConfPIDthrMom, ncheckbit(aod::femtodreamparticle::pidcut, ConfTPCPIDBit), ncheckbit(aod::femtodreamparticle::pidcut, ConfTPCTOFPIDBit)); + + /// V0 selection + Configurable Conf_minInvMass_V0{"Conf_minInvMass_V0", 1.08, "Minimum invariant mass of V0 (particle)"}; + Configurable Conf_maxInvMass_V0{"Conf_maxInvMass_V0", 1.15, "Maximum invariant mass of V0 (particle)"}; + Configurable Conf_minInvMassAnti_V0{"Conf_minInvMassAnti_V0", 1.08, "Minimum invariant mass of V0 (antiparticle)"}; + Configurable Conf_maxInvMassAnti_V0{"Conf_maxInvMassAnti_V0", 1.15, "Maximum invariant mass of V0 (antiparticle)"}; + + // Partition for selected particles + Partition SelectedV0s = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)); + + HistogramRegistry EventRegistry{"EventRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; + + template + int getRowDaughters(int daughID, T const& vecID) + { + int rowInPrimaryTrackTableDaugh = -1; + for (size_t i = 0; i < vecID.size(); i++) { + if (vecID.at(i) == daughID) { + rowInPrimaryTrackTableDaugh = i; + break; + } + } + return rowInPrimaryTrackTableDaugh; + } + + void init(InitContext&) + { + EventRegistry.add("hStatistiscs", ";bin;Entries", kTH1F, {{3, 0, 3}}); + // get bit for the collision mask + } + /// This function stores accepted collisions in derived data + /// @tparam PartitionType + /// @tparam PartType + /// @tparam isMC: enables Monte Carlo truth specific histograms + /// @param groupSelectedTracks partition for the first particle passed by the process function + /// @param groupSelectedV0s partition for the second particle passed by the process function + /// @param parts femtoDreamParticles table + template + void createSpecifiedDerivedData(o2::aod::FDCollision& col, PartitionType groupSelectedTracks, PartitionType groupSelectedV0s, PartType parts) + { + /// check tracks + int tracksCount = 0; + int antitracksCount = 0; + for (auto& part : groupSelectedTracks) { + if (part.cut() & 1) { + antitracksCount++; + } else { + tracksCount++; + } + } + + /// check V0s + int V0Count = 0; + int antiV0Count = 0; + for (auto& V0 : groupSelectedV0s) { + if ((V0.mLambda() > Conf_minInvMass_V0) && (V0.mLambda() < Conf_maxInvMass_V0)) { + V0Count++; + } else if ((V0.mAntiLambda() > Conf_minInvMassAnti_V0) && (V0.mAntiLambda() < Conf_maxInvMassAnti_V0)) { + antiV0Count++; + } + } + + std::vector tmpIDtrack; + + if ((V0Count >= ConfNumberOfV0 && tracksCount >= ConfNumberOfTracks) || (antiV0Count >= ConfNumberOfV0 && antitracksCount >= ConfNumberOfTracks)) { + EventRegistry.fill(HIST("hStatistiscs"), 1); + outputCollision(col.posZ(), col.multV0M(), col.multNtr(), col.sphericity(), col.magField()); + for (auto& femtoParticle : parts) { + if (aod::femtodreamparticle::ParticleType::kTrack == femtoParticle.partType()) { + std::vector childIDs = {0, 0}; + outputParts(outputCollision.lastIndex(), + femtoParticle.pt(), + femtoParticle.eta(), + femtoParticle.phi(), + femtoParticle.partType(), + femtoParticle.cut(), + femtoParticle.pidcut(), + femtoParticle.tempFitVar(), + childIDs, + femtoParticle.mLambda(), + femtoParticle.mAntiLambda()); + tmpIDtrack.push_back(femtoParticle.index()); + } + if (aod::femtodreamparticle::ParticleType::kV0Child == femtoParticle.partType()) { + std::vector childIDs = {0, 0}; + const auto& children = femtoParticle.childrenIds(); + int childId = (children[0] != 0) ? children[0] : children[1]; + if (childId != -1) { + int rowInPrimaryTrackTable = getRowDaughters(childId, tmpIDtrack); + childIDs = (children[0] != 0) ? std::vector{rowInPrimaryTrackTable, 0} : std::vector{0, rowInPrimaryTrackTable}; + } else { + childIDs = (children[0] != 0) ? std::vector{-1, 0} : std::vector{0, -1}; + } + outputParts(outputCollision.lastIndex(), + femtoParticle.pt(), + femtoParticle.eta(), + femtoParticle.phi(), + femtoParticle.partType(), + femtoParticle.cut(), + femtoParticle.pidcut(), + femtoParticle.tempFitVar(), + childIDs, + femtoParticle.mLambda(), + femtoParticle.mAntiLambda()); + } + if (aod::femtodreamparticle::ParticleType::kV0 == femtoParticle.partType()) { + // If the order in primary producer is changed of storing first pos, neg daughters and then V0 - this must be updated + const int rowOfLastTrack = outputParts.lastIndex(); + std::vector childIDs = {rowOfLastTrack - 1, rowOfLastTrack}; + outputParts(outputCollision.lastIndex(), + femtoParticle.pt(), + femtoParticle.eta(), + femtoParticle.phi(), + femtoParticle.partType(), + femtoParticle.cut(), + femtoParticle.pidcut(), + femtoParticle.tempFitVar(), + childIDs, + femtoParticle.mLambda(), + femtoParticle.mAntiLambda()); + } + } + } else { + EventRegistry.fill(HIST("hStatistiscs"), 2); + } + } + + /// process function to create derived data with only collisions containing n tracks + /// \param col subscribe to the collision table (Data) + /// \param parts subscribe to the femtoDreamParticleTable + void processCollisionsWithNTracksAndNV0(o2::aod::FDCollision& col, + o2::aod::FDParticles& parts) + { + EventRegistry.fill(HIST("hStatistiscs"), 0); + auto thegroupSelectedParts = SelectedParts->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupSelectedV0s = SelectedV0s->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + + createSpecifiedDerivedData(col, thegroupSelectedParts, thegroupSelectedV0s, parts); + } + PROCESS_SWITCH(femtoDreamProducerTaskForSpecificAnalysis, processCollisionsWithNTracksAndNV0, "Enable producing data with ppp collisions for data", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{ + adaptAnalysisTask(cfgc), + }; + return workflow; +} diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx index aecca490b80..05892a71bf1 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx @@ -203,6 +203,9 @@ struct femtoDreamTripletTaskTrackTrackV0 { std::vector tmpVecMult = ConfMultBins; framework::AxisSpec multAxis = {tmpVecMult, "Multiplicity"}; ThreeBodyQARegistry.add("TripletTaskQA/hSEMultVSGoodTracks", ";Mult;GoodT", kTH2F, {multAxis, {100, 0, 100}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleaner", ";posDaughtID; negDaughID", kTH2F, {{100, -10000, 10000}, {100, -10000, 10000}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleanerPos", ";primaryTrack; posDaughtID", kTH2F, {{100, -200, 200}, {100, -200, 200}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleanerNeg", ";primaryTrack; negDaughtID", kTH2F, {{100, -200, 200}, {100, -200, 200}}); sameEventCont.init(&resultRegistry, ConfQ3Bins, ConfMultBins, ConfIsMC); mixedEventCont.init(&resultRegistry, ConfQ3Bins, ConfMultBins, ConfIsMC); @@ -312,6 +315,13 @@ struct femtoDreamTripletTaskTrackTrackV0 { for (auto& V0 : groupSelectedV0s) { const auto& posChild = parts.iteratorAt(V0.index() - 2); const auto& negChild = parts.iteratorAt(V0.index() - 1); + + const auto& childrenPos = posChild.childrenIds(); + const auto& childrenNeg = negChild.childrenIds(); + auto posID = childrenPos[0]; + auto negID = childrenNeg[1]; + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleaner"), posID, negID); + if (!((posChild.cut() & Conf_ChildPos_CutV0) == Conf_ChildPos_CutV0 && (posChild.pidcut() & Conf_ChildPos_TPCBitV0) == Conf_ChildPos_TPCBitV0 && (negChild.cut() & Conf_ChildNeg_CutV0) == Conf_ChildNeg_CutV0 && @@ -320,6 +330,10 @@ struct femtoDreamTripletTaskTrackTrackV0 { } for (auto& [T1, T2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupSelectedTracks, groupSelectedTracks))) { + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerPos"), T1.index(), posID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerNeg"), T1.index(), negID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerPos"), T2.index(), posID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerNeg"), T2.index(), negID); auto Q3 = FemtoDreamMath::getQ3(T1, mMassOne, T2, mMassTwo, V0, mMassThree); // Close pair rejection if (ConfIsCPR.value) { From 58bb074b8f5177bed6cb2d385edf16d490ea38f5 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Tue, 3 Dec 2024 07:40:45 +0100 Subject: [PATCH 222/459] [PWGLF] added shift callibration (#8720) Co-authored-by: Prottay Das --- PWGLF/TableProducer/Common/spvector.cxx | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/PWGLF/TableProducer/Common/spvector.cxx b/PWGLF/TableProducer/Common/spvector.cxx index 5309156b345..a5a3a03d9d1 100644 --- a/PWGLF/TableProducer/Common/spvector.cxx +++ b/PWGLF/TableProducer/Common/spvector.cxx @@ -126,6 +126,8 @@ struct spvector { Configurable lfinebinCent{"lfinebinCent", 0.0, "lower bin value in cent fine histograms"}; Configurable hfinebinCent{"hfinebinCent", 80.0, "higher bin value in cent fine histograms"}; Configurable QA{"QA", false, "QA histograms"}; + Configurable useShift{"useShift", false, "shift histograms"}; + Configurable nshift{"nshift", 10, "no. of iterations in shifting"}; Configurable ispolarization{"ispolarization", false, "Flag to check polarization"}; Configurable finecorrection{"finecorrection", false, "Flag to check fine correction"}; Configurable rejbadevent{"rejbadevent", true, "Flag to check bad events"}; @@ -150,6 +152,8 @@ struct spvector { Configurable ConfRecenterevySp{"ConfRecenterevySp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere"}; Configurable ConfRecenterevzSp{"ConfRecenterevzSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere"}; Configurable ConfRecenteresqSp{"ConfRecenteresqSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recenteresq"}; + Configurable ConfShiftC{"ConfShiftC", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift C"}; + Configurable ConfShiftA{"ConfShiftA", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift A"}; // Event selection cuts - Alex TF1* fMultPVCutLow = nullptr; @@ -197,6 +201,8 @@ struct spvector { AxisSpec vxfineAxis = {VxfineNbins, lfinebinVx, hfinebinVx, "vxfine"}; AxisSpec vyfineAxis = {VyfineNbins, lfinebinVy, hfinebinVy, "vyfine"}; AxisSpec centfineAxis = {CentfineNbins, lfinebinCent, hfinebinCent, "V0M (%) fine"}; + AxisSpec shiftAxis = {10, 0, 10, "shift"}; + AxisSpec basisAxis = {2, 0, 2, "basis"}; histos.add("hCentrality", "hCentrality", kTH1F, {{centfineAxis}}); histos.add("hpQxZDCAC", "hpQxZDCAC", kTProfile, {centfineAxis}); @@ -246,6 +252,8 @@ struct spvector { histos.add("ZDCAmp", "ZDCAmp", kTProfile2D, {channelZDCAxis, vzfineAxis}); histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile2D, {{2, 0.0, 2.0}, vzfineAxis}); // histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile3D, {{2,0.0,2.0}, vzfineAxis, centfineAxis}); + histos.add("ShiftZDCC", "ShiftZDCC", kTProfile3D, {centfineAxis, basisAxis, shiftAxis}); + histos.add("ShiftZDCA", "ShiftZDCA", kTProfile3D, {centfineAxis, basisAxis, shiftAxis}); if (QA) { histos.add("Vz", "Vz", kTH1F, {vzfineAxis}); @@ -283,6 +291,8 @@ struct spvector { TH2F* hrecenterevySp; TH2F* hrecenterevzSp; THnF* hrecenteresqSp; + TProfile3D* shiftprofileA; + TProfile3D* shiftprofileC; // Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; // Filter centralityFilter = (nabs(aod::cent::centFT0C) < cfgCutCentralityMax && nabs(aod::cent::centFT0C) > cfgCutCentralityMin); @@ -422,6 +432,11 @@ struct spvector { qxZDCC = qxZDCC / sumC; qyZDCC = qyZDCC / sumC; } + } else { + qxZDCA = qxZDCA; + qxZDCC = qxZDCC; + qyZDCA = qyZDCA; + qyZDCC = qyZDCC; } if (sumA <= 1e-4 || sumC <= 1e-4) { qxZDCA = 0.0; @@ -654,6 +669,32 @@ struct spvector { psiZDCC = 1.0 * TMath::ATan2(qyZDCC, qxZDCC); psiZDCA = 1.0 * TMath::ATan2(qyZDCA, qxZDCA); + if (useShift && (currentRunNumber != lastRunNumber)) { + shiftprofileC = ccdb->getForTimeStamp(ConfShiftC.value, bc.timestamp()); + shiftprofileA = ccdb->getForTimeStamp(ConfShiftA.value, bc.timestamp()); + } + if (useShift) { + auto deltapsiZDCC = 0.0; + auto deltapsiZDCA = 0.0; + for (int ishift = 1; ishift <= nshift; ishift++) { + auto coeffshiftxZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 0.5, ishift - 0.5)); + auto coeffshiftyZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 1.5, ishift - 0.5)); + auto coeffshiftxZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 0.5, ishift - 0.5)); + auto coeffshiftyZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 1.5, ishift - 0.5)); + deltapsiZDCC = deltapsiZDCC + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCC * TMath::Cos(ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * TMath::Sin(ishift * 1.0 * psiZDCC))); + deltapsiZDCA = deltapsiZDCA + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCA * TMath::Cos(ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * TMath::Sin(ishift * 1.0 * psiZDCA))); + } + psiZDCC = psiZDCC + deltapsiZDCC; + psiZDCA = psiZDCA + deltapsiZDCA; + } + + for (int ishift = 1; ishift <= nshift; ishift++) { + histos.fill(HIST("ShiftZDCC"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCC)); + histos.fill(HIST("ShiftZDCC"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCC)); + histos.fill(HIST("ShiftZDCA"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCA)); + histos.fill(HIST("ShiftZDCA"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCA)); + } + histos.fill(HIST("hpQxZDCAC"), centrality, (qxZDCA * qxZDCC)); histos.fill(HIST("hpQyZDCAC"), centrality, (qyZDCA * qyZDCC)); histos.fill(HIST("hpQxZDCAQyZDCC"), centrality, (qxZDCA * qyZDCC)); From 3396fe98099d2ccbc119b48eea0377f68c0ba2a0 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Tue, 3 Dec 2024 08:10:12 +0100 Subject: [PATCH 223/459] [PWGEM/Dilepton] quick fix to phiv prefilter (#8784) --- PWGEM/Dilepton/Core/Dilepton.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index b7f237748ec..d3de41a05f7 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -1185,6 +1185,7 @@ struct Dilepton { Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) <= static_cast(0), true) && ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) <= static_cast(0), true), o2::aod::emprimaryelectron::pfbpi0 >= static_cast(0)); From cf1f3b66fd849af93858add35465a6479eae4f97 Mon Sep 17 00:00:00 2001 From: creetz16 <79141119+creetz16@users.noreply.github.com> Date: Tue, 3 Dec 2024 08:31:00 +0100 Subject: [PATCH 224/459] [PWGLF] Fix KF cascade daughter DCA calculation in cascadebuilder (#8669) --- PWGLF/TableProducer/Strangeness/cascadebuilder.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx b/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx index a9a41f83f8c..6a7c74dc273 100644 --- a/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadebuilder.cxx @@ -1412,12 +1412,8 @@ struct cascadeBuilder { KFXi.TransportToDecayVertex(); KFOmega.TransportToDecayVertex(); - // get DCA of updated daughters at vertex - KFParticle kfpBachPionUpd = kfpBachPion; - KFParticle kfpV0Upd = kfpV0; - kfpBachPionUpd.SetProductionVertex(KFXi); - kfpV0Upd.SetProductionVertex(KFXi); - cascadecandidate.dcacascdau = kfpBachPionUpd.GetDistanceFromParticle(kfpV0Upd); + // get DCA of daughters at vertex + cascadecandidate.dcacascdau = kfpBachPion.GetDistanceFromParticle(kfpV0); if (cascadecandidate.dcacascdau > dcacascdau) return false; From f99abfa397dff940f621b71f2af75998c28143fe Mon Sep 17 00:00:00 2001 From: nzardosh Date: Tue, 3 Dec 2024 10:25:02 +0100 Subject: [PATCH 225/459] [PWGHF,PWGJE] Declare common derived tables with macros (#8780) --- PWGHF/DataModel/DerivedTables.h | 517 ++++++------------ .../derivedDataCreatorBplusToD0Pi.cxx | 17 +- .../derivedDataCreatorD0ToKPi.cxx | 7 +- PWGJE/Core/JetHFUtilities.h | 2 +- 4 files changed, 193 insertions(+), 350 deletions(-) diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 441d412ea2f..0066f9fe456 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -32,18 +32,13 @@ namespace o2::aod { // basic species: // D0 -> K- + pi+ (done) -// Lc -> pi+ K- p (existing 3P table to be renamed Lc) +// Lc -> pi+ K- p // D+ -> K- + pi+ + pi+ (3P table with adapted PID columns) // Ds+ -> K- + K+ + pi+ (3P table with adapted PID columns) // composite species // B0 -> D- + pi+ // B+ -> D0 + pi+ (in progress) // D*+ -> D0 + pi+ -constexpr uint MarkerBase = 2; -constexpr uint MarkerD0 = 3; -constexpr uint Marker3P = 4; -constexpr uint MarkerBplus = 5; -constexpr uint MarkerB0 = 6; // ================ // Collision tables @@ -62,172 +57,66 @@ DECLARE_SOA_COLUMN(CentFDDM, centFDDM, float); //! FDDM centrali DECLARE_SOA_COLUMN(MultZeqNTracksPV, multZeqNTracksPV, float); //! z-equalised barrel multiplicity } // namespace hf_coll_base -// base - -DECLARE_SOA_TABLE_STAGED(HfCollBases, "HFCOLLBASE", //! Table with basic collision info - o2::soa::Index<>, - collision::PosX, - collision::PosY, - collision::PosZ, - collision::NumContrib, - hf_coll_base::CentFT0A, - hf_coll_base::CentFT0C, - hf_coll_base::CentFT0M, - hf_coll_base::CentFV0A, - hf_coll_base::MultZeqNTracksPV, - // hf_coll_base::IsEventReject, - // bc::RunNumber, - o2::soa::Marker); - -using HfCollBase = HfCollBases::iterator; - -DECLARE_SOA_TABLE_STAGED(HfCollIds, "HFCOLLID", //! Table with original global indices of collisions - hf_cand::CollisionId, - o2::soa::Marker); - -// D0 (to be replaced by base version) - -DECLARE_SOA_TABLE_STAGED(HfD0CollBases, "HFD0COLLBASE", //! Table with basic collision info - o2::soa::Index<>, - collision::PosX, - collision::PosY, - collision::PosZ, - collision::NumContrib, - hf_coll_base::CentFT0A, - hf_coll_base::CentFT0C, - hf_coll_base::CentFT0M, - hf_coll_base::CentFV0A, - hf_coll_base::MultZeqNTracksPV, - // hf_coll_base::IsEventReject, - // bc::RunNumber, - o2::soa::Marker); - -using HfD0CollBase = HfD0CollBases::iterator; -using StoredHfD0CollBase = StoredHfD0CollBases::iterator; - -DECLARE_SOA_TABLE_STAGED(HfD0CollIds, "HFD0COLLID", //! Table with original global indices of collisions - hf_cand::CollisionId, - o2::soa::Marker); - -// 3-prong decays (to be replaced by base version) - -DECLARE_SOA_TABLE_STAGED(Hf3PCollBases, "HF3PCOLLBASE", //! Table with basic collision info - o2::soa::Index<>, - collision::PosX, - collision::PosY, - collision::PosZ, - collision::NumContrib, - hf_coll_base::CentFT0A, - hf_coll_base::CentFT0C, - hf_coll_base::CentFT0M, - hf_coll_base::CentFV0A, - hf_coll_base::MultZeqNTracksPV, - // hf_coll_base::IsEventReject, - // bc::RunNumber, - o2::soa::Marker); - -using Hf3PCollBase = Hf3PCollBases::iterator; -using StoredHf3PCollBase = StoredHf3PCollBases::iterator; - -DECLARE_SOA_TABLE_STAGED(Hf3PCollIds, "HF3PCOLLID", //! Table with original global indices of collisions - hf_cand::CollisionId, - o2::soa::Marker); - -// =================== -// MC collision tables -// =================== - -// MC collision columns namespace hf_mc_coll { -DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! original global index of the MC collision -DECLARE_SOA_ARRAY_INDEX_COLUMN(HfCollBase, hfCollBases); //! collision index array pointing to the derived reconstructed collisions for D0 candidates -namespace der_d0 -{ -DECLARE_SOA_ARRAY_INDEX_COLUMN(HfD0CollBase, hfCollBases); //! collision index array pointing to the derived reconstructed collisions for D0 candidates -} -namespace der_3p -{ -DECLARE_SOA_ARRAY_INDEX_COLUMN(Hf3PCollBase, hfCollBases); //! collision index array pointing to the derived reconstructed collisions for 3-prong candidates -} +DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! original global index of the MC collision } // namespace hf_mc_coll -// base - -DECLARE_SOA_TABLE_STAGED(HfMcCollBases, "HFMCCOLLBASE", //! Table with basic MC collision info - o2::soa::Index<>, - mccollision::PosX, - mccollision::PosY, - mccollision::PosZ, - o2::soa::Marker); - -using HfMcCollBase = HfMcCollBases::iterator; - -DECLARE_SOA_TABLE_STAGED(HfMcCollIds, "HFMCCOLLID", //! Table with original global indices of MC collisions - hf_mc_coll::McCollisionId, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(HfMcRCollIds, "HFMCRCOLLID", //! Table with indices pointing to the derived reconstructed-collision table - hf_mc_coll::HfCollBaseIds); - -// D0 - -DECLARE_SOA_TABLE_STAGED(HfD0McCollBases, "HFD0MCCOLLBASE", //! Table with basic MC collision info - o2::soa::Index<>, - mccollision::PosX, - mccollision::PosY, - mccollision::PosZ, - o2::soa::Marker); - -using HfD0McCollBase = HfD0McCollBases::iterator; -using StoredHfD0McCollBase = StoredHfD0McCollBases::iterator; - -DECLARE_SOA_TABLE_STAGED(HfD0McCollIds, "HFD0MCCOLLID", //! Table with original global indices of MC collisions - hf_mc_coll::McCollisionId, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(HfD0McRCollIds, "HFD0MCRCOLLID", //! Table with indices pointing to the derived reconstructed-collision table - hf_mc_coll::der_d0::HfD0CollBaseIds); - -// 3-prong decays - -DECLARE_SOA_TABLE_STAGED(Hf3PMcCollBases, "HF3PMCCOLLBASE", //! Table with basic MC collision info - o2::soa::Index<>, - mccollision::PosX, - mccollision::PosY, - mccollision::PosZ, - cent::CentFT0M, - o2::soa::Marker); - -using Hf3PMcCollBase = Hf3PMcCollBases::iterator; -using StoredHf3PMcCollBase = StoredHf3PMcCollBases::iterator; +// Defines the collision table +#define DECLARE_COLL_TABLE(_hf_type_, _hf_description_) \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##CollBases, "HF" _hf_description_ "COLLBASE", \ + o2::soa::Index<>, \ + collision::PosX, \ + collision::PosY, \ + collision::PosZ, \ + collision::NumContrib, \ + hf_coll_base::CentFT0A, \ + hf_coll_base::CentFT0C, \ + hf_coll_base::CentFT0M, \ + hf_coll_base::CentFV0A, \ + hf_coll_base::MultZeqNTracksPV, \ + o2::soa::Marker); \ + \ + using Hf##_hf_type_##CollBase = Hf##_hf_type_##CollBases::iterator; \ + using StoredHf##_hf_type_##CollBase = StoredHf##_hf_type_##CollBases::iterator; \ + \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##CollIds, "HF" _hf_description_ "COLLID", \ + hf_cand::CollisionId, \ + o2::soa::Marker); + +// Defines the mc collision table +#define DECLARE_MCCOLL_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ + namespace hf_mc_coll \ + { \ + namespace der_##_hf_namespace_ \ + { \ + DECLARE_SOA_ARRAY_INDEX_COLUMN(Hf##_hf_type_##CollBase, hfCollBases); \ + } \ + } \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McCollBases, "HF" _hf_description_ "MCCOLLBASE", \ + o2::soa::Index<>, \ + mccollision::PosX, \ + mccollision::PosY, \ + mccollision::PosZ, \ + cent::CentFT0M, \ + o2::soa::Marker); \ + \ + using Hf##_hf_type_##McCollBase = Hf##_hf_type_##McCollBases::iterator; \ + using StoredHf##_hf_type_##McCollBase = StoredHf##_hf_type_##McCollBases::iterator; \ + \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McCollIds, "HF" _hf_description_ "MCCOLLID", \ + hf_mc_coll::McCollisionId, \ + o2::soa::Marker); \ + \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McRCollIds, "HF" _hf_description_ "MCRCOLLID", \ + hf_mc_coll::der_##_hf_namespace_::Hf##_hf_type_##CollBaseIds); + +#define DECLARE_COLL_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_COLL_TABLE(_hf_type_, _hf_description_) \ + DECLARE_MCCOLL_TABLE(_hf_type_, _hf_description_, _hf_namespace_) -DECLARE_SOA_TABLE_STAGED(Hf3PMcCollIds, "HF3PMCCOLLID", //! Table with original global indices of MC collisions - hf_mc_coll::McCollisionId, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(Hf3PMcRCollIds, "HF3PMCRCOLLID", //! Table with indices pointing to the derived reconstructed-collision table - hf_mc_coll::der_3p::Hf3PCollBaseIds); - -// ================ -// Candidate tables -// ================ - -// Basic candidate properties namespace hf_cand_base { -namespace der_d0 -{ -DECLARE_SOA_INDEX_COLUMN(HfD0CollBase, hfCollBase); //! collision index pointing to the derived collision table for D0 candidates -} -namespace der_bplus -{ -DECLARE_SOA_INDEX_COLUMN(HfCollBase, hfCollBase); //! collision index pointing to the derived collision table for B+ candidates -} -namespace der_3p -{ -DECLARE_SOA_INDEX_COLUMN(Hf3PCollBase, hfCollBase); //! collision index pointing to the derived collision table for 3-prong candidates -} DECLARE_SOA_COLUMN(Eta, eta, float); //! pseudorapidity DECLARE_SOA_COLUMN(M, m, float); //! invariant mass DECLARE_SOA_COLUMN(Phi, phi, float); //! azimuth @@ -243,6 +132,127 @@ DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! momentum [](float pt, float eta) -> float { return RecoDecayPtEtaPhi::p(pt, eta); }); } // namespace hf_cand_base +// Candidate MC columns +namespace hf_cand_mc +{ +DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); //! flag for reconstruction level matching +DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); //! particle origin, reconstruction level +DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int8_t); //! swapping of the prongs order +DECLARE_SOA_COLUMN(FlagMcDecayChanRec, flagMcDecayChanRec, int8_t); //! resonant decay channel flag, reconstruction level +DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class +DECLARE_SOA_COLUMN(MlScoreBkg, mlScoreBkg, float); //! ML score for background class +DECLARE_SOA_COLUMN(MlScorePrompt, mlScorePrompt, float); //! ML score for prompt class +DECLARE_SOA_COLUMN(MlScoreNonPrompt, mlScoreNonPrompt, float); //! ML score for non-prompt class +DECLARE_SOA_COLUMN(MlScores, mlScores, std::vector); //! vector of ML scores +} // namespace hf_cand_mc + +namespace hf_mc_particle +{ +DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! MC collision of this particle +DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! MC particle +DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); //! flag for generator level matching +DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); //! particle origin, generator level +DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant decay channel flag, generator level +} // namespace hf_mc_particle + +#define DECLARE_CAND_BASE_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ + namespace hf_cand_base \ + { \ + namespace der_##_hf_namespace_ \ + { \ + DECLARE_SOA_INDEX_COLUMN(Hf##_hf_type_##CollBase, hfCollBase); \ + } \ + } \ + \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##Bases, "HF" _hf_description_ "BASE", \ + o2::soa::Index<>, \ + hf_cand_base::der_##_hf_namespace_::Hf##_hf_type_##CollBaseId, \ + hf_cand_base::Pt, \ + hf_cand_base::Eta, \ + hf_cand_base::Phi, \ + hf_cand_base::M, \ + hf_cand_base::Y, \ + hf_cand_base::Px, \ + hf_cand_base::Py, \ + hf_cand_base::Pz, \ + hf_cand_base::P, \ + o2::soa::Marker); + +#define DECLARE_CAND_2P_ID_TABLE(_hf_type_, _hf_description_) \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##Ids, "HF" _hf_description_ "ID", \ + hf_cand::CollisionId, \ + hf_track_index::Prong0Id, \ + hf_track_index::Prong1Id, \ + o2::soa::Marker); + +#define DECLARE_CAND_3P_ID_TABLE(_hf_type_, _hf_description_) \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##Ids, "HF" _hf_description_ "ID", \ + hf_cand::CollisionId, \ + hf_track_index::Prong0Id, \ + hf_track_index::Prong1Id, \ + hf_track_index::Prong2Id, \ + o2::soa::Marker); + +#define DECLARE_MCCAND_BASE_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ + namespace hf_mc_particle \ + { \ + namespace der_##_hf_namespace_ \ + { \ + DECLARE_SOA_INDEX_COLUMN(Hf##_hf_type_##McCollBase, hfMcCollBase); \ + } \ + } \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##PBases, "HF" _hf_description_ "PBASE", \ + o2::soa::Index<>, \ + hf_mc_particle::der_##_hf_namespace_::Hf##_hf_type_##McCollBaseId, \ + hf_cand_base::Pt, \ + hf_cand_base::Eta, \ + hf_cand_base::Phi, \ + hf_cand_base::Y, \ + hf_mc_particle::FlagMcMatchGen, \ + hf_mc_particle::OriginMcGen, \ + hf_cand_base::Px, \ + hf_cand_base::Py, \ + hf_cand_base::Pz, \ + hf_cand_base::P, \ + o2::soa::Marker); + +#define DECLARE_MCCAND_ID_TABLE(_hf_type_, _hf_description_) \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##PIds, "HF" _hf_description_ "PID", \ + hf_mc_particle::McCollisionId, \ + hf_mc_particle::McParticleId, \ + o2::soa::Marker); + +#define DECLARE_CAND_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_BASE_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_MCCAND_BASE_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_MCCAND_ID_TABLE(_hf_type_, _hf_description_) + +#define DECLARE_CAND_2P_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_2P_ID_TABLE(_hf_type_, _hf_description_) + +#define DECLARE_CAND_3P_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_3P_ID_TABLE(_hf_type_, _hf_description_) + +#define DECLARE_2P_TABLES(_hf_type_, _hf_description_, _hf_namespace_, _marker_number_) \ + constexpr uint Marker##_hf_type_ = _marker_number_; \ + DECLARE_COLL_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_2P_TABLES(_hf_type_, _hf_description_, _hf_namespace_) + +#define DECLARE_3P_TABLES(_hf_type_, _hf_description_, _hf_namespace_, _marker_number_) \ + constexpr uint Marker##_hf_type_ = _marker_number_; \ + DECLARE_COLL_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_3P_TABLES(_hf_type_, _hf_description_, _hf_namespace_) + +DECLARE_2P_TABLES(D0, "D0", d0, 2); +DECLARE_3P_TABLES(3P, "3P", 3p, 3); +DECLARE_3P_TABLES(Bplus, "BP", bplus, 4); + +// ================ +// Candidate tables +// ================ + // Candidate properties used for selection namespace hf_cand_par { @@ -387,20 +397,6 @@ namespace hf_cand_sel DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int8_t); //! bitmap of the selected candidate type } -// Candidate MC columns -namespace hf_cand_mc -{ -DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); //! flag for reconstruction level matching -DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); //! particle origin, reconstruction level -DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int8_t); //! swapping of the prongs order -DECLARE_SOA_COLUMN(FlagMcDecayChanRec, flagMcDecayChanRec, int8_t); //! resonant decay channel flag, reconstruction level -DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class -DECLARE_SOA_COLUMN(MlScoreBkg, mlScoreBkg, float); //! ML score for background class -DECLARE_SOA_COLUMN(MlScorePrompt, mlScorePrompt, float); //! ML score for prompt class -DECLARE_SOA_COLUMN(MlScoreNonPrompt, mlScoreNonPrompt, float); //! ML score for non-prompt class -DECLARE_SOA_COLUMN(MlScores, mlScores, std::vector); //! vector of ML scores -} // namespace hf_cand_mc - // Candidate MC columns of the charm daughter namespace hf_cand_mc_charm { @@ -415,22 +411,6 @@ DECLARE_SOA_COLUMN(MlScoreNonPromptCharm, mlScoreNonPromptCharm, float); // DECLARE_SOA_COLUMN(MlScoresCharm, mlScoresCharm, std::vector); //! vector of ML scores } // namespace hf_cand_mc_charm -// D0 - -DECLARE_SOA_TABLE_STAGED(HfD0Bases, "HFD0BASE", //! Table with basic candidate properties used in the analyses - o2::soa::Index<>, - hf_cand_base::der_d0::HfD0CollBaseId, - hf_cand_base::Pt, - hf_cand_base::Eta, - hf_cand_base::Phi, - hf_cand_base::M, - hf_cand_base::Y, - hf_cand_base::Px, - hf_cand_base::Py, - hf_cand_base::Pz, - hf_cand_base::P, - o2::soa::Marker); - // candidates for removal: // PxProng0, PyProng0, PzProng0,... (same for 1, 2), we can keep Pt, Eta, Phi instead // XY: CpaXY, DecayLengthXY, ErrorDecayLengthXY @@ -495,33 +475,11 @@ DECLARE_SOA_TABLE_STAGED(HfD0Mls, "HFD0ML", //! Table with candidate selection M hf_cand_mc::MlScores, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(HfD0Ids, "HFD0ID", //! Table with original global indices for candidates - hf_cand::CollisionId, - hf_track_index::Prong0Id, - hf_track_index::Prong1Id, - o2::soa::Marker); - DECLARE_SOA_TABLE_STAGED(HfD0Mcs, "HFD0MC", //! Table with MC candidate info hf_cand_mc::FlagMcMatchRec, hf_cand_mc::OriginMcRec, o2::soa::Marker); -// B+ - -DECLARE_SOA_TABLE_STAGED(HfBplusBases, "HFBPBASE", //! Table with basic candidate properties used in the analyses - o2::soa::Index<>, - hf_cand_base::der_bplus::HfCollBaseId, - hf_cand_base::Pt, - hf_cand_base::Eta, - hf_cand_base::Phi, - hf_cand_base::M, - hf_cand_base::Y, - hf_cand_base::Px, - hf_cand_base::Py, - hf_cand_base::Pz, - hf_cand_base::P, - o2::soa::Marker); - // candidates for removal: // PxProng0, PyProng0, PzProng0,... (same for 1, 2), we can keep Pt, Eta, Phi instead // XY: CpaXY, DecayLengthXY, ErrorDecayLengthXY @@ -585,42 +543,19 @@ DECLARE_SOA_TABLE_STAGED(HfBplusParEs, "HFBPPARE", //! Table with additional can hf_cand_par::Ct, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(HfBplusMls, "HFBPML", //! Table with candidate selection ML scores - hf_cand_mc::MlScoreSig, +DECLARE_SOA_TABLE_STAGED(HfBplusMls, "HFBPML", //! Table with candidate selection ML scores + hf_cand_mc::MlScoreSig, // why is this the signal ML score instead of the full one? o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfBplusMlD0s, "HFBPMLD0", //! Table with D0 candidate selection ML scores hf_cand_mc_charm::MlScoresCharm, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(HfBplusIds, "HFBPID", //! Table with original global indices for candidates - hf_cand::CollisionId, - hf_track_index::Prong0Id, // D0 prong 0 - hf_track_index::Prong1Id, // D0 prong 1 - hf_track_index::Prong2Id, // bachelor pion - o2::soa::Marker); - DECLARE_SOA_TABLE_STAGED(HfBplusMcs, "HFBPMC", //! Table with MC candidate info hf_cand_mc::FlagMcMatchRec, hf_cand_mc::OriginMcRec, o2::soa::Marker); -// 3-prong decays - -DECLARE_SOA_TABLE_STAGED(Hf3PBases, "HF3PBASE", //! Table with basic candidate properties used in the analyses - o2::soa::Index<>, - hf_cand_base::der_3p::Hf3PCollBaseId, - hf_cand_base::Pt, - hf_cand_base::Eta, - hf_cand_base::Phi, - hf_cand_base::M, - hf_cand_base::Y, - hf_cand_base::Px, - hf_cand_base::Py, - hf_cand_base::Pz, - hf_cand_base::P, - o2::soa::Marker); - // candidates for removal: // PxProng0, PyProng0, PzProng0,... (same for 1, 2), we can keep Pt, Eta, Phi instead // XY: CpaXY, DecayLengthXY, ErrorDecayLengthXY @@ -693,110 +628,12 @@ DECLARE_SOA_TABLE_STAGED(Hf3PMls, "HF3PML", //! Table with candidate selection M hf_cand_mc::MlScores, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(Hf3PIds, "HF3PID", //! Table with original global indices for candidates - hf_cand::CollisionId, - hf_track_index::Prong0Id, - hf_track_index::Prong1Id, - hf_track_index::Prong2Id, - o2::soa::Marker); - DECLARE_SOA_TABLE_STAGED(Hf3PMcs, "HF3PMC", //! Table with MC candidate info hf_cand_mc::FlagMcMatchRec, hf_cand_mc::OriginMcRec, hf_cand_mc::IsCandidateSwapped, o2::soa::Marker); -// ================== -// MC particle tables -// ================== - -// MC particle columns -namespace hf_mc_particle -{ -DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! MC collision of this particle -DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! MC particle -namespace der_d0 -{ -DECLARE_SOA_INDEX_COLUMN(HfD0McCollBase, hfMcCollBase); //! collision index pointing to the derived MC collision table for D0 candidates -} -namespace der_bplus -{ -DECLARE_SOA_INDEX_COLUMN(HfMcCollBase, hfMcCollBase); //! collision index pointing to the derived MC collision table for B+ candidates -} -namespace der_3p -{ -DECLARE_SOA_INDEX_COLUMN(Hf3PMcCollBase, hfMcCollBase); //! collision index pointing to the derived MC collision table for 3-prong candidates -} -DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); //! flag for generator level matching -DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); //! particle origin, generator level -DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant decay channel flag, generator level -} // namespace hf_mc_particle - -// D0 - -DECLARE_SOA_TABLE_STAGED(HfD0PBases, "HFD0PBASE", //! Table with MC particle info - o2::soa::Index<>, - hf_mc_particle::der_d0::HfD0McCollBaseId, - hf_cand_base::Pt, - hf_cand_base::Eta, - hf_cand_base::Phi, - hf_cand_base::Y, - hf_mc_particle::FlagMcMatchGen, - hf_mc_particle::OriginMcGen, - hf_cand_base::Px, - hf_cand_base::Py, - hf_cand_base::Pz, - hf_cand_base::P, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(HfD0PIds, "HFD0PID", //! Table with original global indices for MC particles - hf_mc_particle::McCollisionId, - hf_mc_particle::McParticleId, - o2::soa::Marker); - -// B+ - -DECLARE_SOA_TABLE_STAGED(HfBplusPBases, "HFBPPBASE", //! Table with MC particle info - o2::soa::Index<>, - hf_mc_particle::der_bplus::HfMcCollBaseId, - hf_cand_base::Pt, - hf_cand_base::Eta, - hf_cand_base::Phi, - hf_cand_base::Y, - hf_mc_particle::FlagMcMatchGen, - hf_mc_particle::OriginMcGen, - hf_cand_base::Px, - hf_cand_base::Py, - hf_cand_base::Pz, - hf_cand_base::P, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(HfBplusPIds, "HFBPPID", //! Table with original global indices for MC particles - hf_mc_particle::McCollisionId, - hf_mc_particle::McParticleId, - o2::soa::Marker); - -// 3-prong decays - -DECLARE_SOA_TABLE_STAGED(Hf3PPBases, "HF3PPBASE", //! Table with MC particle info - o2::soa::Index<>, - hf_mc_particle::der_3p::Hf3PMcCollBaseId, - hf_cand_base::Pt, - hf_cand_base::Eta, - hf_cand_base::Phi, - hf_cand_base::Y, - hf_mc_particle::FlagMcMatchGen, - hf_mc_particle::OriginMcGen, - hf_cand_base::Px, - hf_cand_base::Py, - hf_cand_base::Pz, - hf_cand_base::P, - o2::soa::Marker); - -DECLARE_SOA_TABLE_STAGED(Hf3PPIds, "HF3PPID", //! Table with original global indices for MC particles - hf_mc_particle::McCollisionId, - hf_mc_particle::McParticleId, - o2::soa::Marker); } // namespace o2::aod #endif // PWGHF_DATAMODEL_DERIVEDTABLES_H_ diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx index 6c0ada5de5b..3ee02a28bb8 100644 --- a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -27,6 +27,8 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/Multiplicity.h" +#include "PWGLF/DataModel/mcCentrality.h" + #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -52,12 +54,12 @@ struct HfDerivedDataCreatorBplusToD0Pi { Produces rowCandidateId; Produces rowCandidateMc; // Collisions - Produces rowCollBase; - Produces rowCollId; + Produces rowCollBase; + Produces rowCollId; // MC collisions - Produces rowMcCollBase; - Produces rowMcCollId; - Produces rowMcRCollId; + Produces rowMcCollBase; + Produces rowMcCollId; + Produces rowMcRCollId; // MC particles Produces rowParticleBase; Produces rowParticleId; @@ -95,7 +97,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { using SelectedCandidatesMl = soa::Filtered>; using SelectedCandidatesMcMl = soa::Filtered>; using MatchedGenCandidatesMc = soa::Filtered>; - using TypeMcCollisions = aod::McCollisions; + using TypeMcCollisions = soa::Join; using THfCandDaughters = aod::HfCand2ProngWPid; using THfCandDaughtersMl = soa::Join; @@ -165,7 +167,8 @@ struct HfDerivedDataCreatorBplusToD0Pi { rowMcCollBase( mcCollision.posX(), mcCollision.posY(), - mcCollision.posZ()); + mcCollision.posZ(), + mcCollision.centFT0M()); } if (fillMcCollId) { rowMcCollId( diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index de26dc1dff3..212916981d7 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -27,6 +27,8 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/Multiplicity.h" +#include "PWGLF/DataModel/mcCentrality.h" + #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -97,7 +99,7 @@ struct HfDerivedDataCreatorD0ToKPi { using SelectedCandidatesMcMl = soa::Filtered>; using SelectedCandidatesMcKfMl = soa::Filtered>; using MatchedGenCandidatesMc = soa::Filtered>; - using TypeMcCollisions = aod::McCollisions; + using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_d0::isSelD0 >= 1 || aod::hf_sel_candidate_d0::isSelD0bar >= 1; Filter filterMcGenMatching = nabs(aod::hf_cand_2prong::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); @@ -178,7 +180,8 @@ struct HfDerivedDataCreatorD0ToKPi { rowMcCollBase( mcCollision.posX(), mcCollision.posY(), - mcCollision.posZ()); + mcCollision.posZ(), + mcCollision.centFT0M()); } if (fillMcCollId) { rowMcCollId( diff --git a/PWGJE/Core/JetHFUtilities.h b/PWGJE/Core/JetHFUtilities.h index d76c8d19121..f636eda3d7f 100644 --- a/PWGJE/Core/JetHFUtilities.h +++ b/PWGJE/Core/JetHFUtilities.h @@ -542,7 +542,7 @@ void fillHFCollisionTable(T const& collision, U const& /*candidates*/, V& HFColl template void fillD0McCollisionTable(T const& mcCollision, U& D0McCollisionTable, int32_t& D0McCollisionTableIndex) { - D0McCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()); + D0McCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.centFT0M()); D0McCollisionTableIndex = D0McCollisionTable.lastIndex(); } From ab766b2d35aaf3f4345be915d3b00ba9a2af1908 Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Tue, 3 Dec 2024 10:28:38 +0100 Subject: [PATCH 226/459] [PWGHF] Fix typo in configurable name (#8788) --- PWGHF/Utils/utilsEvSelHf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 9382108dee3..f6f713b9914 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -93,7 +93,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable useItsRofBorderCut{"useItsRofBorderCut", true, "Apply ITS ROF border cut"}; o2::framework::Configurable useIsGoodZvtxFT0vsPV{"useIsGoodZvtxFT0vsPV", false, "Check consistency between PVz from central barrel with that from FT0 timing"}; o2::framework::Configurable useNoSameBunchPileup{"useNoSameBunchPileup", false, "Exclude collisions in bunches with more than 1 reco. PV"}; // POTENTIALLY BAD FOR BEAUTY ANALYSES - o2::framework::Configurable useOccupancyCut{"useOccupancyCut ", false, "Apply occupancy selection (num. ITS tracks with at least 5 clusters or num. of signals in FT0c in +-100us from current collision)"}; + o2::framework::Configurable useOccupancyCut{"useOccupancyCut", false, "Apply occupancy selection (num. ITS tracks with at least 5 clusters or num. of signals in FT0c in +-100us from current collision)"}; o2::framework::Configurable occEstimator{"occEstimator", 1, "Occupancy estimation (1: ITS, 2: FT0C)"}; o2::framework::Configurable occupancyMin{"occupancyMin", 0, "Minimum occupancy"}; o2::framework::Configurable occupancyMax{"occupancyMax", 1000000, "Maximum occupancy"}; From 0d06a7e2f77cfbaf06648d3ffe76ccd28344a15a Mon Sep 17 00:00:00 2001 From: Daniel Samitz <69901155+DanielSamitz@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:13:41 +0100 Subject: [PATCH 227/459] [PWGEM] [PGWEM] fix FT0 occupancy cut in treeCreatorElectronML (#8790) --- PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx index 41e9e58209c..7643f79a984 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx @@ -185,7 +185,7 @@ struct TreeCreatorElectronML { // collision Configurable maxVtxZ{"maxVtxZ", 10.0, "max VtxZ [cm]"}; Configurable maxTrackOccupancy{"maxTrackOccupancy", 999999, "max. track occupancy"}; - Configurable maxFT0Occupancy{"maxFT0Occupancy", 999999, "max. FT0 occupancy"}; + Configurable maxFT0Occupancy{"maxFT0Occupancy", 999999., "max. FT0 occupancy"}; // track Configurable mincrossedrows{"mincrossedrows", 70, "min. crossed rows"}; From 998bbd199dcaa220aa77e3d4663aabe418be0075 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Tue, 3 Dec 2024 14:36:16 +0100 Subject: [PATCH 228/459] [PWGHF,PWGJE] Adding B+ to the jet framework and renaming 3P->Lc in Derived HF tables (#8792) --- PWGHF/DataModel/DerivedTables.h | 22 +- .../derivedDataCreatorLcToPKPi.cxx | 28 +- PWGJE/Core/JetCandidateUtilities.h | 14 +- PWGJE/Core/JetDQUtilities.h | 12 +- PWGJE/Core/JetHFUtilities.h | 240 +++++++++--------- PWGJE/DataModel/Jet.h | 22 +- PWGJE/DataModel/JetReducedDataDQ.h | 14 +- PWGJE/DataModel/JetReducedDataHF.h | 63 +++++ PWGJE/DataModel/JetSubstructure.h | 4 +- PWGJE/DataModel/JetSubtraction.h | 16 +- PWGJE/JetFinders/CMakeLists.txt | 15 ++ .../JetFinders/jetFinderBplusDataCharged.cxx | 29 +++ PWGJE/JetFinders/jetFinderBplusMCDCharged.cxx | 29 +++ PWGJE/JetFinders/jetFinderBplusMCPCharged.cxx | 29 +++ PWGJE/JetFinders/jetFinderHF.cxx | 16 -- PWGJE/TableProducer/CMakeLists.txt | 5 + PWGJE/TableProducer/Matching/CMakeLists.txt | 15 ++ .../TableProducer/Matching/jetMatchingMC.cxx | 8 - .../Matching/jetMatchingMCBplusCharged.cxx | 31 +++ .../Matching/jetMatchingMCSub.cxx | 6 - .../Matching/jetMatchingMCSubBplusCharged.cxx | 29 +++ .../TableProducer/Matching/jetMatchingSub.cxx | 7 - .../Matching/jetMatchingSubBplusCharged.cxx | 30 +++ PWGJE/TableProducer/derivedDataProducer.cxx | 44 +++- .../derivedDataProducerDummy.cxx | 34 ++- .../derivedDataProducerDummyBplus.cxx | 69 +++++ .../derivedDataProducerDummyD0.cxx | 32 ++- .../derivedDataProducerDummyDielectron.cxx | 32 ++- .../derivedDataProducerDummyLc.cxx | 12 + PWGJE/TableProducer/derivedDataWriter.cxx | 216 +++++++++++++--- .../eventwiseConstituentSubtractor.cxx | 4 +- PWGJE/TableProducer/rhoEstimator.cxx | 4 +- PWGJE/Tasks/CMakeLists.txt | 12 + PWGJE/Tasks/jetFinderBplusQA.cxx | 27 ++ PWGJE/Tasks/jetSubstructureBplus.cxx | 27 ++ PWGJE/Tasks/jetSubstructureBplusOutput.cxx | 26 ++ PWGJE/Tasks/jetSubstructureD0Output.cxx | 2 +- .../Tasks/jetSubstructureDielectronOutput.cxx | 2 +- PWGJE/Tasks/jetSubstructureHF.cxx | 1 - PWGJE/Tasks/jetSubstructureHFOutput.cxx | 15 +- PWGJE/Tasks/jetSubstructureLcOutput.cxx | 2 +- 41 files changed, 933 insertions(+), 312 deletions(-) create mode 100644 PWGJE/JetFinders/jetFinderBplusDataCharged.cxx create mode 100644 PWGJE/JetFinders/jetFinderBplusMCDCharged.cxx create mode 100644 PWGJE/JetFinders/jetFinderBplusMCPCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCBplusCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingMCSubBplusCharged.cxx create mode 100644 PWGJE/TableProducer/Matching/jetMatchingSubBplusCharged.cxx create mode 100644 PWGJE/TableProducer/derivedDataProducerDummyBplus.cxx create mode 100644 PWGJE/Tasks/jetFinderBplusQA.cxx create mode 100644 PWGJE/Tasks/jetSubstructureBplus.cxx create mode 100644 PWGJE/Tasks/jetSubstructureBplusOutput.cxx diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 0066f9fe456..55bf8e57cc4 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -246,7 +246,7 @@ DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant DECLARE_CAND_3P_TABLES(_hf_type_, _hf_description_, _hf_namespace_) DECLARE_2P_TABLES(D0, "D0", d0, 2); -DECLARE_3P_TABLES(3P, "3P", 3p, 3); +DECLARE_3P_TABLES(Lc, "LC", lc, 3); DECLARE_3P_TABLES(Bplus, "BP", bplus, 4); // ================ @@ -560,7 +560,7 @@ DECLARE_SOA_TABLE_STAGED(HfBplusMcs, "HFBPMC", //! Table with MC candidate info // PxProng0, PyProng0, PzProng0,... (same for 1, 2), we can keep Pt, Eta, Phi instead // XY: CpaXY, DecayLengthXY, ErrorDecayLengthXY // normalised: DecayLengthNormalised, DecayLengthXYNormalised, ImpactParameterNormalised0 -DECLARE_SOA_TABLE_STAGED(Hf3PPars, "HF3PPAR", //! Table with candidate properties used for selection +DECLARE_SOA_TABLE_STAGED(HfLcPars, "HFLCPAR", //! Table with candidate properties used for selection hf_cand::Chi2PCA, hf_cand::NProngsContributorsPV, hf_cand_par::Cpa, @@ -593,9 +593,9 @@ DECLARE_SOA_TABLE_STAGED(Hf3PPars, "HF3PPAR", //! Table with candidate propertie hf_cand_par::NSigTofPr2, hf_cand_par::NSigTpcTofPi2, hf_cand_par::NSigTpcTofPr2, - o2::soa::Marker); + o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(Hf3PParEs, "HF3PPARE", //! Table with additional candidate properties used for selection +DECLARE_SOA_TABLE_STAGED(HfLcParEs, "HFLCPARE", //! Table with additional candidate properties used for selection hf_cand::XSecondaryVertex, hf_cand::YSecondaryVertex, hf_cand::ZSecondaryVertex, @@ -618,21 +618,21 @@ DECLARE_SOA_TABLE_STAGED(Hf3PParEs, "HF3PPARE", //! Table with additional candid hf_cand::ErrorImpactParameter1, hf_cand::ErrorImpactParameter2, hf_cand_par::Ct, - o2::soa::Marker); + o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(Hf3PSels, "HF3PSEL", //! Table with candidate selection flags +DECLARE_SOA_TABLE_STAGED(HfLcSels, "HFLCSEL", //! Table with candidate selection flags hf_cand_sel::CandidateSelFlag, - o2::soa::Marker); + o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(Hf3PMls, "HF3PML", //! Table with candidate selection ML scores +DECLARE_SOA_TABLE_STAGED(HfLcMls, "HFLCML", //! Table with candidate selection ML scores hf_cand_mc::MlScores, - o2::soa::Marker); + o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(Hf3PMcs, "HF3PMC", //! Table with MC candidate info +DECLARE_SOA_TABLE_STAGED(HfLcMcs, "HFLCMC", //! Table with MC candidate info hf_cand_mc::FlagMcMatchRec, hf_cand_mc::OriginMcRec, hf_cand_mc::IsCandidateSwapped, - o2::soa::Marker); + o2::soa::Marker); } // namespace o2::aod diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index e16c498cd11..6353241bc38 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -43,23 +43,23 @@ using namespace o2::analysis::hf_derived; /// Writes the full information in an output TTree struct HfDerivedDataCreatorLcToPKPi { // Candidates - Produces rowCandidateBase; - Produces rowCandidatePar; - Produces rowCandidateParE; - Produces rowCandidateSel; - Produces rowCandidateMl; - Produces rowCandidateId; - Produces rowCandidateMc; + Produces rowCandidateBase; + Produces rowCandidatePar; + Produces rowCandidateParE; + Produces rowCandidateSel; + Produces rowCandidateMl; + Produces rowCandidateId; + Produces rowCandidateMc; // Collisions - Produces rowCollBase; - Produces rowCollId; + Produces rowCollBase; + Produces rowCollId; // MC collisions - Produces rowMcCollBase; - Produces rowMcCollId; - Produces rowMcRCollId; + Produces rowMcCollBase; + Produces rowMcCollId; + Produces rowMcRCollId; // MC particles - Produces rowParticleBase; - Produces rowParticleId; + Produces rowParticleBase; + Produces rowParticleId; // Switches for filling tables Configurable fillCandidateBase{"fillCandidateBase", true, "Fill candidate base properties"}; diff --git a/PWGJE/Core/JetCandidateUtilities.h b/PWGJE/Core/JetCandidateUtilities.h index 37e5e53d96b..6c5c0328ef5 100644 --- a/PWGJE/Core/JetCandidateUtilities.h +++ b/PWGJE/Core/JetCandidateUtilities.h @@ -373,30 +373,30 @@ float getCandidateInvariantMass(T const& candidate) } template -void fillCandidateCollisionTable(T const& collision, U const& candidates, V& CandiateCollisionTable, int32_t& CandidateCollisionTableIndex) +void fillCandidateCollisionTable(T const& collision, U const& /*candidates*/, V& CandiateCollisionTable, int32_t& CandidateCollisionTableIndex) { if constexpr (jethfutilities::isHFTable()) { - jethfutilities::fillHFCollisionTable(collision, candidates, CandiateCollisionTable, CandidateCollisionTableIndex); + jethfutilities::fillHFCollisionTable(collision, CandiateCollisionTable, CandidateCollisionTableIndex); } else if constexpr (jetdqutilities::isDielectronTable()) { jetdqutilities::fillDielectronCollisionTable(collision, CandiateCollisionTable, CandidateCollisionTableIndex); // if more dilepton tables are added we would need a fillDQCollisionTable } } template -void fillCandidateMcCollisionTable(T const& mcCollision, U const& candidates, V& CandiateMcCollisionTable, int32_t& CandidateMcCollisionTableIndex) +void fillCandidateMcCollisionTable(T const& mcCollision, U const& /*candidates*/, V& CandiateMcCollisionTable, int32_t& CandidateMcCollisionTableIndex) { if constexpr (jethfutilities::isHFMcTable()) { - jethfutilities::fillHFMcCollisionTable(mcCollision, candidates, CandiateMcCollisionTable, CandidateMcCollisionTableIndex); + jethfutilities::fillHFMcCollisionTable(mcCollision, CandiateMcCollisionTable, CandidateMcCollisionTableIndex); } else if constexpr (jetdqutilities::isDielectronMcTable()) { jetdqutilities::fillDielectronMcCollisionTable(mcCollision, CandiateMcCollisionTable, CandidateMcCollisionTableIndex); } } -template -void fillCandidateTable(T const& candidate, int32_t collisionIndex, U& BaseTable, V& HFParTable, M& HFParETable, N& HFSelectionFlagTable, O& HFMlTable, P& HFMCDTable, int32_t& candidateTableIndex) +template +void fillCandidateTable(T const& candidate, int32_t collisionIndex, U& BaseTable, V& HFParTable, M& HFParETable, N& HFParDaughterTable, O& HFSelectionFlagTable, P& HFMlTable, Q& HFMlDaughterTable, S& HFMCDTable, int32_t& candidateTableIndex) { if constexpr (jethfutilities::isHFCandidate()) { - jethfutilities::fillHFCandidateTable(candidate, collisionIndex, BaseTable, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable, candidateTableIndex); + jethfutilities::fillHFCandidateTable(candidate, collisionIndex, BaseTable, HFParTable, HFParETable, HFParDaughterTable, HFSelectionFlagTable, HFMlTable, HFMlDaughterTable, HFMCDTable, candidateTableIndex); } else if constexpr (jetdqutilities::isDielectronCandidate()) { jetdqutilities::fillDielectronCandidateTable(candidate, collisionIndex, BaseTable, candidateTableIndex); } diff --git a/PWGJE/Core/JetDQUtilities.h b/PWGJE/Core/JetDQUtilities.h index e68a23494f6..91b4c3cdd30 100644 --- a/PWGJE/Core/JetDQUtilities.h +++ b/PWGJE/Core/JetDQUtilities.h @@ -188,11 +188,7 @@ auto slicedPerDielectronCollision(T const& table, U const& /*candidates*/, V con template int getDielectronCandidateCollisionId(T const& candidate) { - if constexpr (isDielectronCandidate()) { - return candidate.reducedeventId(); - } else { - return -1; - } + return candidate.reducedeventId(); } /** @@ -275,11 +271,7 @@ float getDielectronTablePDGMass() template float getDielectronCandidateInvariantMass(T const& candidate) { - if constexpr (isDielectronCandidate()) { - return candidate.mass(); - } else { - return -1.0; - } + return candidate.mass(); } template diff --git a/PWGJE/Core/JetHFUtilities.h b/PWGJE/Core/JetHFUtilities.h index f636eda3d7f..00d88d728a0 100644 --- a/PWGJE/Core/JetHFUtilities.h +++ b/PWGJE/Core/JetHFUtilities.h @@ -296,7 +296,7 @@ bool isHFDaughterTrack(T& track, U& candidate, V const& /*tracks*/) return false; } } else if constexpr (isBplusCandidate()) { - if (candidate.template prong0_as().template prong0_as().globalIndex() == track.globalIndex() || candidate.template prong0_as().template prong1_as().globalIndex() == track.globalIndex() || candidate.template prong1_as().globalIndex() == track.globalIndex()) { + if (candidate.prong0Id() == track.globalIndex() || candidate.prong1Id() == track.globalIndex() || candidate.prong2Id() == track.globalIndex()) { return true; } else { return false; @@ -382,15 +382,7 @@ auto slicedPerHFCollision(T const& table, U const& /*candidates*/, V const& coll template int getHFCandidateCollisionId(T const& candidate) { - if constexpr (isD0Candidate()) { - return candidate.hfCollBaseId(); - } else if constexpr (isLcCandidate()) { - return candidate.hfCollBaseId(); - } else if constexpr (isBplusCandidate()) { - return candidate.hfCollBaseId(); - } else { - return -1; - } + return candidate.hfCollBaseId(); } /** @@ -401,15 +393,7 @@ int getHFCandidateCollisionId(T const& candidate) template int getHFMcCandidateCollisionId(T const& candidate) { - if constexpr (isD0McCandidate()) { - return candidate.hfMcCollBaseId(); - } else if constexpr (isLcMcCandidate()) { - return candidate.hfMcCollBaseId(); - } else if constexpr (isBplusMcCandidate()) { - return candidate.hfMcCollBaseId(); - } else { - return -1; - } + return candidate.hfMcCollBaseId(); } /** @@ -422,11 +406,9 @@ int getHFCandidatePDG(T const& /*candidate*/) { if constexpr (isD0Candidate() || isD0McCandidate()) { return static_cast(o2::constants::physics::Pdg::kD0); - } - if constexpr (isLcCandidate() || isLcMcCandidate()) { + } else if constexpr (isLcCandidate() || isLcMcCandidate()) { return static_cast(o2::constants::physics::Pdg::kLambdaCPlus); - } - if constexpr (isBplusCandidate() || isBplusMcCandidate()) { + } else if constexpr (isBplusCandidate() || isBplusMcCandidate()) { return static_cast(o2::constants::physics::Pdg::kBPlus); } else { return 0; @@ -441,11 +423,9 @@ int getHFTablePDG() { if constexpr (isD0Table() || isD0McTable()) { return static_cast(o2::constants::physics::Pdg::kD0); - } - if constexpr (isLcTable() || isLcMcTable()) { + } else if constexpr (isLcTable() || isLcMcTable()) { return static_cast(o2::constants::physics::Pdg::kLambdaCPlus); - } - if constexpr (isBplusTable() || isBplusMcTable()) { + } else if constexpr (isBplusTable() || isBplusMcTable()) { return static_cast(o2::constants::physics::Pdg::kBPlus); } else { return 0; @@ -462,11 +442,9 @@ float getHFCandidatePDGMass(T const& /*candidate*/) { if constexpr (isD0Candidate() || isD0McCandidate()) { return static_cast(o2::constants::physics::MassD0); - } - if constexpr (isLcCandidate() || isLcMcCandidate()) { + } else if constexpr (isLcCandidate() || isLcMcCandidate()) { return static_cast(o2::constants::physics::MassLambdaCPlus); - } - if constexpr (isBplusCandidate() || isBplusMcCandidate()) { + } else if constexpr (isBplusCandidate() || isBplusMcCandidate()) { return static_cast(o2::constants::physics::MassBPlus); } else { return -1.0; @@ -482,11 +460,9 @@ float getHFTablePDGMass() { if constexpr (isD0Table() || isD0McTable()) { return static_cast(o2::constants::physics::MassD0); - } - if constexpr (isLcTable() || isLcMcTable()) { + } else if constexpr (isLcTable() || isLcMcTable()) { return static_cast(o2::constants::physics::MassLambdaCPlus); - } - if constexpr (isBplusTable() || isBplusMcTable()) { + } else if constexpr (isBplusTable() || isBplusMcTable()) { return static_cast(o2::constants::physics::MassBPlus); } else { return -1.0; @@ -501,74 +477,26 @@ float getHFTablePDGMass() template float getHFCandidateInvariantMass(T const& candidate) { - if constexpr (isD0Candidate()) { - return candidate.m(); - } - if constexpr (isLcCandidate()) { - return candidate.m(); - } - if constexpr (isBplusCandidate()) { - return candidate.m(); - } else { - return -1.0; - } + return candidate.m(); } template -void fillD0CollisionTable(T const& collision, U& D0CollisionTable, int32_t& D0CollisionTableIndex) +void fillHFCollisionTable(T const& collision, U& HFCollisionTable, int32_t& HFCollisionTableIndex) { - D0CollisionTable(collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), collision.centFT0A(), collision.centFT0C(), collision.centFT0M(), collision.centFV0A(), collision.multZeqNTracksPV()); - D0CollisionTableIndex = D0CollisionTable.lastIndex(); + HFCollisionTable(collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), collision.centFT0A(), collision.centFT0C(), collision.centFT0M(), collision.centFV0A(), collision.multZeqNTracksPV()); + HFCollisionTableIndex = HFCollisionTable.lastIndex(); } template -void fillLcCollisionTable(T const& collision, U& LcCollisionTable, int32_t& LcCollisionTableIndex) +void fillHFMcCollisionTable(T const& mcCollision, U& HFMcCollisionTable, int32_t& HFMcCollisionTableIndex) { - LcCollisionTable(collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), collision.centFT0A(), collision.centFT0C(), collision.centFT0M(), collision.centFV0A(), collision.multZeqNTracksPV()); - LcCollisionTableIndex = LcCollisionTable.lastIndex(); + HFMcCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.centFT0M()); + HFMcCollisionTableIndex = HFMcCollisionTable.lastIndex(); } -template -void fillHFCollisionTable(T const& collision, U const& /*candidates*/, V& HFCollisionTable, int32_t& HFCollisionTableIndex) +template +void fillD0CandidateTable(T const& candidate, U& D0ParTable, V& D0ParETable, M& D0SelectionFlagTable, N& D0MlTable, O& D0MCDTable) { - if constexpr (isD0Table()) { - fillD0CollisionTable(collision, HFCollisionTable, HFCollisionTableIndex); - } - if constexpr (isLcTable()) { - fillLcCollisionTable(collision, HFCollisionTable, HFCollisionTableIndex); - } -} - -template -void fillD0McCollisionTable(T const& mcCollision, U& D0McCollisionTable, int32_t& D0McCollisionTableIndex) -{ - D0McCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.centFT0M()); - D0McCollisionTableIndex = D0McCollisionTable.lastIndex(); -} - -template -void fillLcMcCollisionTable(T const& mcCollision, U& LcMcCollisionTable, int32_t& LcMcCollisionTableIndex) -{ - LcMcCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.centFT0M()); - LcMcCollisionTableIndex = LcMcCollisionTable.lastIndex(); -} - -template -void fillHFMcCollisionTable(T const& mcCollision, U const& /*candidates*/, V& HFMcCollisionTable, int32_t& HFMcCollisionTableIndex) -{ - if constexpr (isD0McTable()) { - fillD0McCollisionTable(mcCollision, HFMcCollisionTable, HFMcCollisionTableIndex); - } - if constexpr (isLcMcTable()) { - fillLcMcCollisionTable(mcCollision, HFMcCollisionTable, HFMcCollisionTableIndex); - } -} - -template -void fillD0CandidateTable(T const& candidate, int32_t collisionIndex, U& D0BaseTable, V& D0ParTable, M& D0ParETable, N& D0SelectionFlagTable, O& D0MlTable, P& D0MCDTable, int32_t& D0CandidateTableIndex) -{ - D0BaseTable(collisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.m(), candidate.y()); - D0ParTable( candidate.chi2PCA(), candidate.cpa(), @@ -620,22 +548,20 @@ void fillD0CandidateTable(T const& candidate, int32_t collisionIndex, U& D0BaseT candidate.ct()); D0SelectionFlagTable(candidate.candidateSelFlag()); - if constexpr (isMc) { - D0MCDTable(candidate.flagMcMatchRec(), candidate.originMcRec()); - } std::vector mlScoresVector; auto mlScoresSpan = candidate.mlScores(); std::copy(mlScoresSpan.begin(), mlScoresSpan.end(), std::back_inserter(mlScoresVector)); D0MlTable(mlScoresVector); - D0CandidateTableIndex = D0BaseTable.lastIndex(); + if constexpr (isMc) { + D0MCDTable(candidate.flagMcMatchRec(), candidate.originMcRec()); + } } -template -void fillLcCandidateTable(T const& candidate, int32_t collisionIndex, U& LcBaseTable, V& LcParTable, M& LcParETable, N& LcSelectionFlagTable, O& LcMlTable, P& LcMCDTable, int32_t& LcCandidateTableIndex) +template +void fillLcCandidateTable(T const& candidate, U& LcParTable, V& LcParETable, M& LcSelectionFlagTable, N& LcMlTable, O& LcMCDTable) { - LcBaseTable(collisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.m(), candidate.y()); LcParTable( candidate.chi2PCA(), @@ -696,51 +622,115 @@ void fillLcCandidateTable(T const& candidate, int32_t collisionIndex, U& LcBaseT candidate.ct()); LcSelectionFlagTable(candidate.candidateSelFlag()); - if constexpr (isMc) { - LcMCDTable(candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.isCandidateSwapped()); - } std::vector mlScoresVector; auto mlScoresSpan = candidate.mlScores(); std::copy(mlScoresSpan.begin(), mlScoresSpan.end(), std::back_inserter(mlScoresVector)); LcMlTable(mlScoresVector); - LcCandidateTableIndex = LcBaseTable.lastIndex(); + if constexpr (isMc) { + LcMCDTable(candidate.flagMcMatchRec(), candidate.originMcRec(), candidate.isCandidateSwapped()); + } } +// need to update this template -void fillHFCandidateTable(T const& candidate, int32_t collisionIndex, U& HFBaseTable, V& HFParTable, M& HFParETable, N& HFSelectionFlagTable, O& HFMlTable, P& HFMCDTable, int32_t& HFCandidateTableIndex) +void fillBplusCandidateTable(T const& candidate, U& BplusParTable, V& BplusParETable, M& BplusParD0Table, N& BplusMlTable, O& BplusMlD0Table, P& BplusMCDTable) { - if constexpr (isD0Candidate()) { - fillD0CandidateTable(candidate, collisionIndex, HFBaseTable, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable, HFCandidateTableIndex); - } - if constexpr (isLcCandidate()) { - fillLcCandidateTable(candidate, collisionIndex, HFBaseTable, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable, HFCandidateTableIndex); + + BplusParTable( + candidate.chi2PCA(), + candidate.cpa(), + candidate.cpaXY(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.decayLengthNormalised(), + candidate.decayLengthXYNormalised(), + candidate.ptProng0(), + candidate.ptProng1(), + candidate.impactParameter0(), + candidate.impactParameter1(), + candidate.impactParameterNormalised0(), + candidate.impactParameterNormalised1(), + candidate.nSigTpcPiExpPi(), + candidate.nSigTofPiExpPi(), + candidate.nSigTpcTofPiExpPi(), + candidate.nSigTpcKaExpPi(), + candidate.nSigTofKaExpPi(), + candidate.nSigTpcTofKaExpPi(), + candidate.maxNormalisedDeltaIP(), + candidate.impactParameterProduct()); + + BplusParETable( + candidate.xSecondaryVertex(), + candidate.ySecondaryVertex(), + candidate.zSecondaryVertex(), + candidate.errorDecayLength(), + candidate.errorDecayLengthXY(), + candidate.rSecondaryVertex(), + candidate.pProng1(), + candidate.pxProng1(), + candidate.pyProng1(), + candidate.pzProng1(), + candidate.errorImpactParameter1(), + candidate.cosThetaStar(), + candidate.ct()); + + BplusParD0Table( + candidate.cpaCharm(), + candidate.decayLengthCharm(), + candidate.impactParameter0Charm(), + candidate.impactParameter1Charm(), + candidate.impactParameterProductCharm(), + candidate.nSigTpcPiExpPiCharm(), + candidate.nSigTofPiExpPiCharm(), + candidate.nSigTpcTofPiExpPiCharm(), + candidate.nSigTpcKaExpPiCharm(), + candidate.nSigTofKaExpPiCharm(), + candidate.nSigTpcTofKaExpPiCharm(), + candidate.nSigTpcPiExpKaCharm(), + candidate.nSigTofPiExpKaCharm(), + candidate.nSigTpcTofPiExpKaCharm(), + candidate.nSigTpcKaExpKaCharm(), + candidate.nSigTofKaExpKaCharm(), + candidate.nSigTpcTofKaExpKaCharm()); + + // BplusSelectionFlagTable(candidate.candidateSelFlag()); + + BplusMlTable(candidate.mlScoreSig()); + + std::vector mlScoresCharmVector; + auto mlScoresCharmSpan = candidate.mlScoresCharm(); + std::copy(mlScoresCharmSpan.begin(), mlScoresCharmSpan.end(), std::back_inserter(mlScoresCharmVector)); + BplusMlD0Table(mlScoresCharmVector); + + if constexpr (isMc) { + BplusMCDTable(candidate.flagMcMatchRec(), candidate.originMcRec()); } } -template -void fillD0CandidateMcTable(T const& candidate, int32_t mcCollisionIndex, U& D0PBaseTable, int32_t& D0CandidateTableIndex) -{ - D0PBaseTable(mcCollisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.y(), candidate.flagMcMatchGen(), candidate.originMcGen()); - D0CandidateTableIndex = D0PBaseTable.lastIndex(); -} -template -void fillLcCandidateMcTable(T const& candidate, int32_t mcCollisionIndex, U& LcPBaseTable, int32_t& LcCandidateTableIndex) +template +void fillHFCandidateTable(T const& candidate, int32_t collisionIndex, U& HFBaseTable, V& HFParTable, M& HFParETable, N& HFParDaughterTable, O& HFSelectionFlagTable, P& HFMlTable, Q& HFMlDaughterTable, S& HFMCDTable, int32_t& HFCandidateTableIndex) { - LcPBaseTable(mcCollisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.y(), candidate.flagMcMatchGen(), candidate.originMcGen()); - LcCandidateTableIndex = LcPBaseTable.lastIndex(); + HFBaseTable(collisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.m(), candidate.y()); + HFCandidateTableIndex = HFBaseTable.lastIndex(); + + if constexpr (isD0Candidate()) { + fillD0CandidateTable(candidate, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable); + } + if constexpr (isLcCandidate()) { + fillLcCandidateTable(candidate, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable); + } + if constexpr (isBplusCandidate()) { + fillBplusCandidateTable(candidate, HFParTable, HFParETable, HFParDaughterTable, HFMlTable, HFMlDaughterTable, HFMCDTable); + } } template void fillHFCandidateMcTable(T const& candidate, int32_t mcCollisionIndex, U& BaseMcTable, int32_t& candidateTableIndex) { - if constexpr (isD0McCandidate()) { - fillD0CandidateMcTable(candidate, mcCollisionIndex, BaseMcTable, candidateTableIndex); - } - if constexpr (isLcMcCandidate()) { - fillLcCandidateMcTable(candidate, mcCollisionIndex, BaseMcTable, candidateTableIndex); - } + BaseMcTable(mcCollisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.y(), candidate.flagMcMatchGen(), candidate.originMcGen()); + candidateTableIndex = BaseMcTable.lastIndex(); } }; // namespace jethfutilities diff --git a/PWGJE/DataModel/Jet.h b/PWGJE/DataModel/Jet.h index 0ba6ff484d4..423240fe799 100644 --- a/PWGJE/DataModel/Jet.h +++ b/PWGJE/DataModel/Jet.h @@ -179,8 +179,8 @@ DECLARE_JET_TABLES_LEVELS(Charged, JTrackSub, HfD0Bases, HfD0PBases, "C"); DECLARE_JET_TABLES_LEVELS(Full, JTrackSub, HfD0Bases, HfD0PBases, "F"); DECLARE_JET_TABLES_LEVELS(Neutral, JTrackSub, HfD0Bases, HfD0PBases, "N"); DECLARE_JET_TABLES_LEVELS(D0Charged, JTrackD0Sub, HfD0Bases, HfD0PBases, "D0"); -DECLARE_JET_TABLES_LEVELS(LcCharged, JTrackLcSub, Hf3PBases, Hf3PPBases, "Lc"); -DECLARE_JET_TABLES_LEVELS(BplusCharged, JTrackBplusSub, HfCandBplus, HfD0PBases, "BPl"); +DECLARE_JET_TABLES_LEVELS(LcCharged, JTrackLcSub, HfLcBases, HfLcPBases, "Lc"); +DECLARE_JET_TABLES_LEVELS(BplusCharged, JTrackBplusSub, HfBplusBases, HfBplusPBases, "BP"); DECLARE_JET_TABLES_LEVELS(V0Charged, JTrackSub, V0Cores, JV0Mcs, "V0"); DECLARE_JET_TABLES_LEVELS(DielectronCharged, JTrackSub, Dielectrons, JDielectronMcs, "DIEL"); @@ -219,19 +219,21 @@ using JetParticlesSubD0 = JMcParticleD0Subs; using McCollisionsD0 = o2::soa::Join; using CandidatesD0MCP = o2::soa::Join; -using CollisionsLc = o2::soa::Join; -using CandidatesLcData = o2::soa::Join; -using CandidatesLcMCD = o2::soa::Join; +using CollisionsLc = o2::soa::Join; +using CandidatesLcData = o2::soa::Join; +using CandidatesLcMCD = o2::soa::Join; using JetTracksSubLc = JTrackLcSubs; using JetParticlesSubLc = JMcParticleLcSubs; -using McCollisionsLc = o2::soa::Join; -using CandidatesLcMCP = o2::soa::Join; +using McCollisionsLc = o2::soa::Join; +using CandidatesLcMCP = o2::soa::Join; -using CandidatesBplusData = o2::soa::Join; -using CandidatesBplusMCD = o2::soa::Join; +using CollisionsBplus = o2::soa::Join; +using CandidatesBplusData = o2::soa::Join; +using CandidatesBplusMCD = o2::soa::Join; using JetTracksSubBplus = JTrackBplusSubs; using JetParticlesSubBplus = JMcParticleBplusSubs; -using CandidatesBplusMCP = o2::soa::Join; +using McCollisionsBplus = o2::soa::Join; +using CandidatesBplusMCP = o2::soa::Join; using CandidatesV0Data = o2::soa::Join; using CandidatesV0MCD = o2::soa::Join; diff --git a/PWGJE/DataModel/JetReducedDataDQ.h b/PWGJE/DataModel/JetReducedDataDQ.h index 8641b3d612e..a5779ebd3b4 100644 --- a/PWGJE/DataModel/JetReducedDataDQ.h +++ b/PWGJE/DataModel/JetReducedDataDQ.h @@ -115,35 +115,37 @@ DECLARE_SOA_COLUMN(DummyDQ, dummyDQ, bool); } // namespace jdummydq DECLARE_SOA_TABLE(JDielectron1Dummys, "AOD", "JDIEL1DUMMY", - o2::soa::Index<>, jdummydq::DummyDQ, o2::soa::Marker<1>); DECLARE_SOA_TABLE(JDielectron2Dummys, "AOD", "JDIEL2DUMMY", - o2::soa::Index<>, jdummydq::DummyDQ, o2::soa::Marker<2>); DECLARE_SOA_TABLE(JDielectron3Dummys, "AOD", "JDIEL3DUMMY", - o2::soa::Index<>, jdummydq::DummyDQ, o2::soa::Marker<3>); DECLARE_SOA_TABLE(JDielectron4Dummys, "AOD", "JDIEL4DUMMY", - o2::soa::Index<>, jdummydq::DummyDQ, o2::soa::Marker<4>); DECLARE_SOA_TABLE(JDielectron5Dummys, "AOD", "JDIEL5DUMMY", - o2::soa::Index<>, jdummydq::DummyDQ, o2::soa::Marker<5>); DECLARE_SOA_TABLE(JDielectron6Dummys, "AOD", "JDIEL6DUMMY", - o2::soa::Index<>, jdummydq::DummyDQ, o2::soa::Marker<6>); +DECLARE_SOA_TABLE(JDielectron7Dummys, "AOD", "JDIEL7DUMMY", + jdummydq::DummyDQ, + o2::soa::Marker<7>); + +DECLARE_SOA_TABLE(JDielectron8Dummys, "AOD", "JDIEL8DUMMY", + jdummydq::DummyDQ, + o2::soa::Marker<8>); + } // namespace o2::aod #endif // PWGJE_DATAMODEL_JETREDUCEDDATADQ_H_ diff --git a/PWGJE/DataModel/JetReducedDataHF.h b/PWGJE/DataModel/JetReducedDataHF.h index 1c196c173d9..c00a89e029e 100644 --- a/PWGJE/DataModel/JetReducedDataHF.h +++ b/PWGJE/DataModel/JetReducedDataHF.h @@ -50,6 +50,19 @@ DECLARE_SOA_TABLE_STAGED(JD0PIds, "JD0PID", jd0indices::JMcCollisionId, jd0indices::JMcParticleId); +namespace jdummyd0 +{ +DECLARE_SOA_COLUMN(DummyD0, dummyD0, bool); +} // namespace jdummyd0 + +DECLARE_SOA_TABLE(JDumD0ParDaus, "AOD", "JDUMD0PARDAU", + jdummyd0::DummyD0, + o2::soa::Marker<1>); + +DECLARE_SOA_TABLE(JDumD0MlDaus, "AOD", "JDumD0MLDAU", + jdummyd0::DummyD0, + o2::soa::Marker<2>); + namespace jlcindices { DECLARE_SOA_INDEX_COLUMN(JCollision, collision); @@ -76,6 +89,56 @@ DECLARE_SOA_TABLE_STAGED(JLcPIds, "JLCPID", jlcindices::JMcCollisionId, jlcindices::JMcParticleId); +namespace jdummylc +{ + +DECLARE_SOA_COLUMN(DummyLc, dummyLc, bool); + +} // namespace jdummylc +DECLARE_SOA_TABLE(JDumLcParDaus, "AOD", "JDUMLCPARDAU", + jdummylc::DummyLc, + o2::soa::Marker<1>); + +DECLARE_SOA_TABLE(JDumLcMlDaus, "AOD", "JDUMLCMLDAU", + jdummylc::DummyLc, + o2::soa::Marker<2>); + +namespace jbplusindices +{ +DECLARE_SOA_INDEX_COLUMN(JCollision, collision); +DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, JTracks, "_0"); +DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, JTracks, "_1"); +DECLARE_SOA_INDEX_COLUMN_FULL(Prong2, prong2, int, JTracks, "_2"); +DECLARE_SOA_INDEX_COLUMN(JMcCollision, mcCollision); +DECLARE_SOA_INDEX_COLUMN(JMcParticle, mcParticle); +} // namespace jbplusindices + +DECLARE_SOA_TABLE_STAGED(JBplusCollisionIds, "JBPCOLLID", + jbplusindices::JCollisionId); + +DECLARE_SOA_TABLE_STAGED(JBplusMcCollisionIds, "JBPMCCOLLID", + jbplusindices::JMcCollisionId); + +DECLARE_SOA_TABLE_STAGED(JBplusIds, "JBPID", + jbplusindices::JCollisionId, + jbplusindices::Prong0Id, + jbplusindices::Prong1Id, + jbplusindices::Prong2Id); + +DECLARE_SOA_TABLE_STAGED(JBplusPIds, "JBPPID", + jbplusindices::JMcCollisionId, + jbplusindices::JMcParticleId); + +namespace jdummybplus +{ + +DECLARE_SOA_COLUMN(DummyBplus, dummyBplus, bool); + +} // namespace jdummybplus +DECLARE_SOA_TABLE(JDumBplusSels, "AOD", "JDUMBPUSSEL", + jdummybplus::DummyBplus, + o2::soa::Marker<1>); + } // namespace o2::aod #endif // PWGJE_DATAMODEL_JETREDUCEDDATAHF_H_ diff --git a/PWGJE/DataModel/JetSubstructure.h b/PWGJE/DataModel/JetSubstructure.h index 2e5d03f46d0..9b606b8dcfd 100644 --- a/PWGJE/DataModel/JetSubstructure.h +++ b/PWGJE/DataModel/JetSubstructure.h @@ -122,8 +122,8 @@ DECLARE_SOA_COLUMN(JetNConstituents, jetNConstituents, int); //! JETSUBSTRUCTURE_TABLES_DEF(C, "C", CJetCOs, "CJETCO", CEWSJetCOs, "CEWSJETCO", CMCDJetCOs, "CMCDJETCO", CMCPJetCOs, "CMCPJETCO"); JETSUBSTRUCTURE_TABLES_DEF(D0C, "D0C", HfD0Bases, "HFD0BASE", HfD0Bases, "HFD0BASE", HfD0Bases, "HFD0BASE", HfD0PBases, "HFD0PBASE"); -JETSUBSTRUCTURE_TABLES_DEF(LcC, "LCC", Hf3PBases, "HF3PBASE", Hf3PBases, "HF3PBASE", Hf3PBases, "HF3PBASE", Hf3PPBases, "HF3PPBASE"); -JETSUBSTRUCTURE_TABLES_DEF(BplusC, "BPLUSC", HfD0Bases, "HFD0BASE", HfD0Bases, "HFD0BASE", HfD0Bases, "HFD0BASE", HfD0PBases, "HFD0PBASE"); +JETSUBSTRUCTURE_TABLES_DEF(LcC, "LCC", HfLcBases, "HFLcBASE", HfLcBases, "HFLcBASE", HfLcBases, "HFLcBASE", HfLcPBases, "HFLcPBASE"); +JETSUBSTRUCTURE_TABLES_DEF(BplusC, "BPC", HfBplusBases, "HFBPBASE", HfBplusBases, "HFBPBASE", HfBplusBases, "HFBPBASE", HfBplusPBases, "HFBPPBASE"); JETSUBSTRUCTURE_TABLES_DEF(DielectronC, "DIELC", Dielectrons, "RTDIELECTRON", Dielectrons, "RTDIELECTRON", Dielectrons, "RTDIELECTRON", JDielectronMcs, "JDIELMC"); } // namespace o2::aod diff --git a/PWGJE/DataModel/JetSubtraction.h b/PWGJE/DataModel/JetSubtraction.h index 1992283865c..3f78c05ec58 100644 --- a/PWGJE/DataModel/JetSubtraction.h +++ b/PWGJE/DataModel/JetSubtraction.h @@ -54,22 +54,22 @@ DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfD0PBases, "_0"); namespace bkglc { -DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, Hf3PBases, "_0"); +DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfLcBases, "_0"); } // namespace bkglc namespace bkglcmc { -DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, Hf3PPBases, "_0"); +DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfLcPBases, "_0"); } // namespace bkglcmc namespace bkgbplus { -DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfCandBplus, "_0"); +DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfBplusBases, "_0"); } // namespace bkgbplus namespace bkgbplusmc { -DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfCandBplusMcGen, "_0"); // change this!! +DECLARE_SOA_INDEX_COLUMN_FULL(Candidate, candidate, int, HfBplusPBases, "_0"); } // namespace bkgbplusmc namespace bkgdielectron @@ -117,13 +117,13 @@ DECLARE_SOA_TABLE(BkgLcMcRhos, "AOD", "BkgLcMcRho", bkgrho::RhoM, o2::soa::Marker<5>); -DECLARE_SOA_TABLE(BkgBplusRhos, "AOD", "BkgBPlRho", +DECLARE_SOA_TABLE(BkgBplusRhos, "AOD", "BkgRho", o2::soa::Index<>, bkgrho::Rho, bkgrho::RhoM, o2::soa::Marker<6>); -DECLARE_SOA_TABLE(BkgBplusMcRhos, "AOD", "BkgBPlMcRho", +DECLARE_SOA_TABLE(BkgBplusMcRhos, "AOD", "BkgBPMcRho", o2::soa::Index<>, bkgrho::Rho, bkgrho::RhoM, @@ -246,7 +246,7 @@ DECLARE_SOA_TABLE(JMcParticleLcSubs, "AOD", "JMcPartLcSubs", using JMcParticleLcSub = JMcParticleLcSubs::iterator; -DECLARE_SOA_TABLE(JTrackBplusSubs, "AOD", "JTrackBPlSubs", +DECLARE_SOA_TABLE(JTrackBplusSubs, "AOD", "JTrackBPSubs", o2::soa::Index<>, bkgbplus::CandidateId, jtrack::Pt, @@ -261,7 +261,7 @@ DECLARE_SOA_TABLE(JTrackBplusSubs, "AOD", "JTrackBPlSubs", using JTrackBplusSub = JTrackBplusSubs::iterator; -DECLARE_SOA_TABLE(JMcParticleBplusSubs, "AOD", "JMcPartBPlSubs", +DECLARE_SOA_TABLE(JMcParticleBplusSubs, "AOD", "JMcPartBPSubs", o2::soa::Index<>, bkgbplusmc::CandidateId, jmcparticle::Pt, diff --git a/PWGJE/JetFinders/CMakeLists.txt b/PWGJE/JetFinders/CMakeLists.txt index 9be82d6180b..ba4dbb132fc 100644 --- a/PWGJE/JetFinders/CMakeLists.txt +++ b/PWGJE/JetFinders/CMakeLists.txt @@ -89,6 +89,21 @@ o2physics_add_dpl_workflow(jet-finder-lc-mcp-charged PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(jet-finder-bplus-data-charged + SOURCES jetFinderBplusDataCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-finder-bplus-mcd-charged + SOURCES jetFinderBplusMCDCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(jet-finder-bplus-mcp-charged + SOURCES jetFinderBplusMCPCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-finder-v0-data-charged SOURCES jetFinderV0DataCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport diff --git a/PWGJE/JetFinders/jetFinderBplusDataCharged.cxx b/PWGJE/JetFinders/jetFinderBplusDataCharged.cxx new file mode 100644 index 00000000000..402527211fb --- /dev/null +++ b/PWGJE/JetFinders/jetFinderBplusDataCharged.cxx @@ -0,0 +1,29 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet finder B+ data charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/JetFinders/jetFinderHF.cxx" + +using JetFinderBplusDataCharged = JetFinderHFTask; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{{{"processChargedJetsData", true}}}, + TaskName{"jet-finder-bplus-data-charged"})); + + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/JetFinders/jetFinderBplusMCDCharged.cxx b/PWGJE/JetFinders/jetFinderBplusMCDCharged.cxx new file mode 100644 index 00000000000..4eed52e30b3 --- /dev/null +++ b/PWGJE/JetFinders/jetFinderBplusMCDCharged.cxx @@ -0,0 +1,29 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet finder B+ mcd charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/JetFinders/jetFinderHF.cxx" + +using JetFinderBplusMCDetectorLevelCharged = JetFinderHFTask; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{{{"processChargedJetsMCD", true}}}, + TaskName{"jet-finder-bplus-mcd-charged"})); + + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/JetFinders/jetFinderBplusMCPCharged.cxx b/PWGJE/JetFinders/jetFinderBplusMCPCharged.cxx new file mode 100644 index 00000000000..83a1e7c9d60 --- /dev/null +++ b/PWGJE/JetFinders/jetFinderBplusMCPCharged.cxx @@ -0,0 +1,29 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet finder B+ mcp charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/JetFinders/jetFinderHF.cxx" + +using JetFinderBplusMCParticleLevelCharged = JetFinderHFTask; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{{{"processChargedJetsMCP", true}}}, + TaskName{"jet-finder-bplus-mcp-charged"})); + + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/JetFinders/jetFinderHF.cxx b/PWGJE/JetFinders/jetFinderHF.cxx index 3117ac42f29..53b6114cbe7 100644 --- a/PWGJE/JetFinders/jetFinderHF.cxx +++ b/PWGJE/JetFinders/jetFinderHF.cxx @@ -26,22 +26,6 @@ using namespace o2::analysis; using namespace o2::framework; using namespace o2::framework::expressions; -/* -void customize(std::vector& workflowOptions) -{ - std::vector hfjetworkflows{{"d0-data-charged", VariantType::Int, 1, {"D0 jets charged data"}}, - {"d0-mcd-charged", VariantType::Int, 0, {"D0 jets charged MCD"}}, - {"d0-mcp-charged", VariantType::Int, 0, {"D0 jets charged MCD"}}, - {"bplus-data-charged", VariantType::Int, 0, {"B+ jets charged MCD"}}, - {"bplus-mcd-charged", VariantType::Int, 0, {"B+ jets charged MCD"}}, - {"bplus-mcp-charged", VariantType::Int, 0, {"B+ jets charged MCD"}}, - {"lc-data-charged", VariantType::Int, 0, {"Lc jets charged MCD"}}, - {"lc-mcd-charged", VariantType::Int, 0, {"Lc jets charged MCD"}}, - {"lc-mcp-charged", VariantType::Int, 0, {"Lc jets charged MCD"}}}; - std::swap(workflowOptions, hfjetworkflows); -} -*/ - // NB: runDataProcessing.h must be included after customize! #include "Framework/runDataProcessing.h" diff --git a/PWGJE/TableProducer/CMakeLists.txt b/PWGJE/TableProducer/CMakeLists.txt index 8efe1878755..4e8141566f3 100644 --- a/PWGJE/TableProducer/CMakeLists.txt +++ b/PWGJE/TableProducer/CMakeLists.txt @@ -38,6 +38,11 @@ o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy-lc PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy-bplus + SOURCES derivedDataProducerDummyBplus.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-deriveddata-producer-dummy-dielectron SOURCES derivedDataProducerDummyDielectron.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore diff --git a/PWGJE/TableProducer/Matching/CMakeLists.txt b/PWGJE/TableProducer/Matching/CMakeLists.txt index 5cb655eae3a..a3848f352e7 100644 --- a/PWGJE/TableProducer/Matching/CMakeLists.txt +++ b/PWGJE/TableProducer/Matching/CMakeLists.txt @@ -38,6 +38,11 @@ o2physics_add_dpl_workflow(jet-matching-mc-lc-ch PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(jet-matching-mc-bplus-ch + SOURCES jetMatchingMCBplusCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-matching-mc-dielectron-ch SOURCES jetMatchingMCDielectronCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport @@ -63,6 +68,11 @@ o2physics_add_dpl_workflow(jet-matching-mc-sub-lc-ch PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(jet-matching-mc-sub-bplus-ch + SOURCES jetMatchingMCSubBplusCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-matching-mc-sub-dielectron-ch SOURCES jetMatchingMCSubDielectronCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport @@ -83,6 +93,11 @@ o2physics_add_dpl_workflow(jet-matching-sub-lc-ch PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(jet-matching-sub-bplus-ch + SOURCES jetMatchingSubBplusCharged.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-matching-sub-dielectron-ch SOURCES jetMatchingSubDielectronCharged.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2::FrameworkPhysicsSupport diff --git a/PWGJE/TableProducer/Matching/jetMatchingMC.cxx b/PWGJE/TableProducer/Matching/jetMatchingMC.cxx index 39688616eba..ef56702af09 100644 --- a/PWGJE/TableProducer/Matching/jetMatchingMC.cxx +++ b/PWGJE/TableProducer/Matching/jetMatchingMC.cxx @@ -102,11 +102,3 @@ struct JetMatchingMc { } PROCESS_SWITCH(JetMatchingMc, processJets, "Perform jet matching", true); }; - -/*using BplusChargedJetMatching = JetMatchingMc, - soa::Join, - aod::BplusChargedMCDetectorLevelJetsMatchedToBplusChargedMCParticleLevelJets, - aod::BplusChargedMCParticleLevelJetsMatchedToBplusChargedMCDetectorLevelJets, - aod::CandidatesBplusMCD, - aod::CandidatesBplusMCP, - aod::JDummys>>;*/ diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCBplusCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCBplusCharged.cxx new file mode 100644 index 00000000000..8a5705f273f --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCBplusCharged.cxx @@ -0,0 +1,31 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc B+ charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMC.cxx" + +using BplusChargedJetMatchingMC = JetMatchingMc, + soa::Join, + aod::BplusChargedMCDetectorLevelJetsMatchedToBplusChargedMCParticleLevelJets, + aod::BplusChargedMCParticleLevelJetsMatchedToBplusChargedMCDetectorLevelJets, + aod::CandidatesBplusMCD, + aod::CandidatesBplusMCP, + aod::JDummys>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-bplus-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx index 26dc0a63b53..9db070ec7b6 100644 --- a/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx +++ b/PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx @@ -90,9 +90,3 @@ struct JetMatchingMcSub { } PROCESS_SWITCH(JetMatchingMcSub, processJets, "Perform jet matching", true); }; - -/*using BplusChargedJetMatching = JetMatchingMcSub, - soa::Join, - aod::BplusChargedMCDetectorLevelJetsMatchedToBplusChargedMCDetectorLevelEventWiseSubtractedJets, - aod::BplusChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToBplusChargedMCDetectorLevelJets, - aod::CandidatesBplusMCD>;*/ diff --git a/PWGJE/TableProducer/Matching/jetMatchingMCSubBplusCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingMCSubBplusCharged.cxx new file mode 100644 index 00000000000..86db7221aa6 --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingMCSubBplusCharged.cxx @@ -0,0 +1,29 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching mc subtracted B+ charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingMCSub.cxx" + +using D0ChargedJetMatchingMCSub = JetMatchingMcSub, + soa::Join, + aod::D0ChargedMCDetectorLevelJetsMatchedToD0ChargedMCDetectorLevelEventWiseSubtractedJets, + aod::D0ChargedMCDetectorLevelEventWiseSubtractedJetsMatchedToD0ChargedMCDetectorLevelJets, + aod::CandidatesD0MCD>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-mc-sub-d0-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/Matching/jetMatchingSub.cxx b/PWGJE/TableProducer/Matching/jetMatchingSub.cxx index 7c31ba437d7..36e809b5129 100644 --- a/PWGJE/TableProducer/Matching/jetMatchingSub.cxx +++ b/PWGJE/TableProducer/Matching/jetMatchingSub.cxx @@ -88,10 +88,3 @@ struct JetMatchingSub { } PROCESS_SWITCH(JetMatchingSub, processJets, "Perform jet matching", true); }; - -/*using BplusChargedJetMatching = JetMatchingSub, - soa::Join, - aod::BplusChargedJetsMatchedToBplusChargedEventWiseSubtractedJets, - aod::BplusChargedEventWiseSubtractedJetsMatchedToBplusChargedJets, - aod::JTrackBplusSubs, - aod::CandidatesBplusData>;*/ diff --git a/PWGJE/TableProducer/Matching/jetMatchingSubBplusCharged.cxx b/PWGJE/TableProducer/Matching/jetMatchingSubBplusCharged.cxx new file mode 100644 index 00000000000..a24b7c6de6f --- /dev/null +++ b/PWGJE/TableProducer/Matching/jetMatchingSubBplusCharged.cxx @@ -0,0 +1,30 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet matching subtracted B+ charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/TableProducer/Matching/jetMatchingSub.cxx" + +using BplusChargedJetMatchingSub = JetMatchingSub, + soa::Join, + aod::BplusChargedJetsMatchedToBplusChargedEventWiseSubtractedJets, + aod::BplusChargedEventWiseSubtractedJetsMatchedToBplusChargedJets, + aod::JTrackBplusSubs, + aod::CandidatesBplusData>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, TaskName{"jet-matching-sub-bplus-ch"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/TableProducer/derivedDataProducer.cxx b/PWGJE/TableProducer/derivedDataProducer.cxx index e0fcdc959ea..0167ceeed5b 100644 --- a/PWGJE/TableProducer/derivedDataProducer.cxx +++ b/PWGJE/TableProducer/derivedDataProducer.cxx @@ -89,6 +89,10 @@ struct JetDerivedDataProducerTask { Produces jLcMcCollisionIdsTable; Produces jLcIdsTable; Produces jLcParticleIdsTable; + Produces jBplusCollisionIdsTable; + Produces jBplusMcCollisionIdsTable; + Produces jBplusIdsTable; + Produces jBplusParticleIdsTable; Produces jV0IdsTable; Produces jV0McCollisionsTable; Produces jV0McCollisionIdsTable; @@ -429,19 +433,19 @@ struct JetDerivedDataProducerTask { } PROCESS_SWITCH(JetDerivedDataProducerTask, processD0MC, "produces derived index for D0 particles", false); - void processLcCollisions(aod::Hf3PCollIds::iterator const& LcCollision) + void processLcCollisions(aod::HfLcCollIds::iterator const& LcCollision) { jLcCollisionIdsTable(LcCollision.collisionId()); } PROCESS_SWITCH(JetDerivedDataProducerTask, processLcCollisions, "produces derived index for Lc collisions", false); - void processLcMcCollisions(aod::Hf3PMcCollIds::iterator const& LcMcCollision) + void processLcMcCollisions(aod::HfLcMcCollIds::iterator const& LcMcCollision) { jLcMcCollisionIdsTable(LcMcCollision.mcCollisionId()); } PROCESS_SWITCH(JetDerivedDataProducerTask, processLcMcCollisions, "produces derived index for Lc MC collisions", false); - void processLc(aod::Hf3PIds::iterator const& Lc, aod::Tracks const&) + void processLc(aod::HfLcIds::iterator const& Lc, aod::Tracks const&) { auto JProng0ID = trackCollisionMapping.find({Lc.prong0Id(), Lc.prong0_as().collisionId()}); auto JProng1ID = trackCollisionMapping.find({Lc.prong1Id(), Lc.prong1_as().collisionId()}); @@ -455,12 +459,44 @@ struct JetDerivedDataProducerTask { } PROCESS_SWITCH(JetDerivedDataProducerTask, processLc, "produces derived index for Lc candidates", false); - void processLcMC(aod::Hf3PPIds::iterator const& Lc) + void processLcMC(aod::HfLcPIds::iterator const& Lc) { jLcParticleIdsTable(Lc.mcCollisionId(), Lc.mcParticleId()); } PROCESS_SWITCH(JetDerivedDataProducerTask, processLcMC, "produces derived index for Lc particles", false); + void processBplusCollisions(aod::HfBplusCollIds::iterator const& BplusCollision) + { + jBplusCollisionIdsTable(BplusCollision.collisionId()); + } + PROCESS_SWITCH(JetDerivedDataProducerTask, processBplusCollisions, "produces derived index for Bplus collisions", false); + + void processBplusMcCollisions(aod::HfBplusMcCollIds::iterator const& BplusMcCollision) + { + jBplusMcCollisionIdsTable(BplusMcCollision.mcCollisionId()); + } + PROCESS_SWITCH(JetDerivedDataProducerTask, processBplusMcCollisions, "produces derived index for Bplus MC collisions", false); + + void processBplus(aod::HfBplusIds::iterator const& Bplus, aod::Tracks const&) + { + auto JProng0ID = trackCollisionMapping.find({Bplus.prong0Id(), Bplus.prong0_as().collisionId()}); + auto JProng1ID = trackCollisionMapping.find({Bplus.prong1Id(), Bplus.prong1_as().collisionId()}); + auto JProng2ID = trackCollisionMapping.find({Bplus.prong2Id(), Bplus.prong2_as().collisionId()}); + if (withCollisionAssociator) { + JProng0ID = trackCollisionMapping.find({Bplus.prong0Id(), Bplus.collisionId()}); + JProng1ID = trackCollisionMapping.find({Bplus.prong1Id(), Bplus.collisionId()}); + JProng2ID = trackCollisionMapping.find({Bplus.prong2Id(), Bplus.collisionId()}); + } + jBplusIdsTable(Bplus.collisionId(), JProng0ID->second, JProng1ID->second, JProng2ID->second); + } + PROCESS_SWITCH(JetDerivedDataProducerTask, processBplus, "produces derived index for Bplus candidates", false); + + void processBplusMC(aod::HfBplusPIds::iterator const& Bplus) + { + jBplusParticleIdsTable(Bplus.mcCollisionId(), Bplus.mcParticleId()); + } + PROCESS_SWITCH(JetDerivedDataProducerTask, processBplusMC, "produces derived index for Bplus particles", false); + void processV0(aod::V0Indices::iterator const& V0, aod::Tracks const&) { auto JPosTrackID = trackCollisionMapping.find({V0.posTrackId(), V0.posTrack_as().collisionId()}); diff --git a/PWGJE/TableProducer/derivedDataProducerDummy.cxx b/PWGJE/TableProducer/derivedDataProducerDummy.cxx index efbd1fa4cf5..da60109d94f 100644 --- a/PWGJE/TableProducer/derivedDataProducerDummy.cxx +++ b/PWGJE/TableProducer/derivedDataProducerDummy.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// temporary task to produce HF tables needed when making inclusive derived data - should become obsolete when tables are able to be prouduced based on a configurable +// temporary task to produce HF and DQ tables needed when making inclusive derived data - should become obsolete when tables are able to be prouduced based on a configurable // /// \author Nima Zardoshti @@ -38,16 +38,28 @@ struct JetDerivedDataProducerDummyTask { Produces d0McCollisionsTable; Produces d0ParticlesTable; - Produces lcCollisionsTable; - Produces lcCollisionsMatchingTable; - Produces lcsTable; - Produces lcParsTable; - Produces lcParExtrasTable; - Produces lcSelsTable; - Produces lcMlsTable; - Produces lcMcsTable; - Produces lcMcCollisionsTable; - Produces lcParticlesTable; + Produces lcCollisionsTable; + Produces lcCollisionsMatchingTable; + Produces lcsTable; + Produces lcParsTable; + Produces lcParExtrasTable; + Produces lcSelsTable; + Produces lcMlsTable; + Produces lcMcsTable; + Produces lcMcCollisionsTable; + Produces lcParticlesTable; + + Produces bplusCollisionsTable; + Produces bplusCollisionsMatchingTable; + Produces bplussTable; + Produces bplusParsTable; + Produces bplusParExtrasTable; + Produces bplusParD0sTable; + Produces bplusMlsTable; + Produces bplusMlD0sTable; + Produces bplusMcsTable; + Produces bplusMcCollisionsTable; + Produces bplusParticlesTable; Produces dielectronCollisionsTable; Produces dielectronTable; diff --git a/PWGJE/TableProducer/derivedDataProducerDummyBplus.cxx b/PWGJE/TableProducer/derivedDataProducerDummyBplus.cxx new file mode 100644 index 00000000000..8f3e238710a --- /dev/null +++ b/PWGJE/TableProducer/derivedDataProducerDummyBplus.cxx @@ -0,0 +1,69 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// temporary task to produce HF and DQ tables needed when making B+ jet derived data - should become obsolete when tables are able to be prouduced based on a configurable +// +/// \author Nima Zardoshti + +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoA.h" +#include "Framework/runDataProcessing.h" +#include "PWGJE/DataModel/JetReducedData.h" +#include "PWGHF/DataModel/DerivedTables.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct JetDerivedDataProducerDummyTask { + + Produces d0CollisionsTable; + Produces d0CollisionsMatchingTable; + Produces d0sTable; + Produces d0ParsTable; + Produces d0ParExtrasTable; + Produces d0SelsTable; + Produces d0MlsTable; + Produces d0McsTable; + Produces d0McCollisionsTable; + Produces d0ParticlesTable; + + Produces lcCollisionsTable; + Produces lcCollisionsMatchingTable; + Produces lcsTable; + Produces lcParsTable; + Produces lcParExtrasTable; + Produces lcSelsTable; + Produces lcMlsTable; + Produces lcMcsTable; + Produces lcMcCollisionsTable; + Produces lcParticlesTable; + + Produces dielectronCollisionsTable; + Produces dielectronTable; + + void init(InitContext const&) + { + } + + void processDummy(aod::JDummys const&) + { + } + PROCESS_SWITCH(JetDerivedDataProducerDummyTask, processDummy, "leaves all tables empty", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"jet-deriveddata-producer-dummy"})}; +} diff --git a/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx b/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx index 8b02d7cdeab..c28b0e44dfe 100644 --- a/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx +++ b/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx @@ -27,16 +27,28 @@ using namespace o2::framework::expressions; struct JetDerivedDataProducerDummyD0Task { - Produces lcCollisionsTable; - Produces lcCollisionsMatchingTable; - Produces lcsTable; - Produces lcParsTable; - Produces lcParExtrasTable; - Produces lcSelsTable; - Produces lcMlsTable; - Produces lcMcsTable; - Produces lcMcCollisionsTable; - Produces lcParticlesTable; + Produces lcCollisionsTable; + Produces lcCollisionsMatchingTable; + Produces lcsTable; + Produces lcParsTable; + Produces lcParExtrasTable; + Produces lcSelsTable; + Produces lcMlsTable; + Produces lcMcsTable; + Produces lcMcCollisionsTable; + Produces lcParticlesTable; + + Produces bplusCollisionsTable; + Produces bplusCollisionsMatchingTable; + Produces bplussTable; + Produces bplusParsTable; + Produces bplusParExtrasTable; + Produces bplusParD0sTable; + Produces bplusMlsTable; + Produces bplusMlD0sTable; + Produces bplusMcsTable; + Produces bplusMcCollisionsTable; + Produces bplusParticlesTable; Produces dielectronCollisionsTable; Produces dielectronTable; diff --git a/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx b/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx index 784fa3e4826..9df74703902 100644 --- a/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx +++ b/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx @@ -38,16 +38,28 @@ struct JetDerivedDataProducerDummyDielectronTask { Produces d0McCollisionsTable; Produces d0ParticlesTable; - Produces lcCollisionsTable; - Produces lcCollisionsMatchingTable; - Produces lcsTable; - Produces lcParsTable; - Produces lcParExtrasTable; - Produces lcSelsTable; - Produces lcMlsTable; - Produces lcMcsTable; - Produces lcMcCollisionsTable; - Produces lcParticlesTable; + Produces lcCollisionsTable; + Produces lcCollisionsMatchingTable; + Produces lcsTable; + Produces lcParsTable; + Produces lcParExtrasTable; + Produces lcSelsTable; + Produces lcMlsTable; + Produces lcMcsTable; + Produces lcMcCollisionsTable; + Produces lcParticlesTable; + + Produces bplusCollisionsTable; + Produces bplusCollisionsMatchingTable; + Produces bplussTable; + Produces bplusParsTable; + Produces bplusParExtrasTable; + Produces bplusParD0sTable; + Produces bplusMlsTable; + Produces bplusMlD0sTable; + Produces bplusMcsTable; + Produces bplusMcCollisionsTable; + Produces bplusParticlesTable; void init(InitContext const&) { diff --git a/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx b/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx index 05e1384deac..5550e97a9ae 100644 --- a/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx +++ b/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx @@ -38,6 +38,18 @@ struct JetDerivedDataProducerDummyLcTask { Produces d0McCollisionsTable; Produces d0ParticlesTable; + Produces bplusCollisionsTable; + Produces bplusCollisionsMatchingTable; + Produces bplussTable; + Produces bplusParsTable; + Produces bplusParExtrasTable; + Produces bplusParD0sTable; + Produces bplusMlsTable; + Produces bplusMlD0sTable; + Produces bplusMcsTable; + Produces bplusMcCollisionsTable; + Produces bplusParticlesTable; + Produces dielectronCollisionsTable; Produces dielectronTable; diff --git a/PWGJE/TableProducer/derivedDataWriter.cxx b/PWGJE/TableProducer/derivedDataWriter.cxx index eb5858184da..d82f8d58b45 100644 --- a/PWGJE/TableProducer/derivedDataWriter.cxx +++ b/PWGJE/TableProducer/derivedDataWriter.cxx @@ -51,6 +51,9 @@ struct JetDerivedDataWriter { Configurable thresholdChargedLcJetPtMin{"thresholdChargedLcJetPtMin", 0.0, "Minimum charged Lc jet pt to accept event"}; Configurable thresholdChargedEventWiseSubtractedLcJetPtMin{"thresholdChargedEventWiseSubtractedLcJetPtMin", 0.0, "Minimum charged event-wise subtracted Lc jet pt to accept event"}; Configurable thresholdChargedLcMCPJetPtMin{"thresholdChargedLcMCPJetPtMin", 0.0, "Minimum charged Lc mcp jet pt to accept event"}; + Configurable thresholdChargedBplusJetPtMin{"thresholdChargedBplusJetPtMin", 0.0, "Minimum charged Bplus jet pt to accept event"}; + Configurable thresholdChargedEventWiseSubtractedBplusJetPtMin{"thresholdChargedEventWiseSubtractedBplusJetPtMin", 0.0, "Minimum charged event-wise subtracted Bplus jet pt to accept event"}; + Configurable thresholdChargedBplusMCPJetPtMin{"thresholdChargedBplusMCPJetPtMin", 0.0, "Minimum charged Bplus mcp jet pt to accept event"}; Configurable thresholdChargedDielectronJetPtMin{"thresholdChargedDielectronJetPtMin", 0.0, "Minimum charged Dielectron jet pt to accept event"}; Configurable thresholdChargedEventWiseSubtractedDielectronJetPtMin{"thresholdChargedEventWiseSubtractedDielectronJetPtMin", 0.0, "Minimum charged event-wise subtracted Dielectron jet pt to accept event"}; Configurable thresholdChargedDielectronMCPJetPtMin{"thresholdChargedDielectronMCPJetPtMin", 0.0, "Minimum charged Dielectron mcp jet pt to accept event"}; @@ -67,9 +70,10 @@ struct JetDerivedDataWriter { Configurable trackEtaSelectionMax{"trackEtaSelectionMax", 0.9, "only save tracks that have an eta smaller than this eta"}; Configurable saveBCsTable{"saveBCsTable", true, "save the bunch crossing table to the output"}; Configurable saveClustersTable{"saveClustersTable", false, "save the clusters table to the output"}; - Configurable saveD0Table{"saveD0Table", false, "save the D0 table to the output"}; - Configurable saveLcTable{"saveLcTable", false, "save the Lc table to the output"}; - Configurable saveDielectronTable{"saveDielectronTable", false, "save the Dielectron table to the output"}; + Configurable saveD0Table{"saveD0Table", false, "save the D0 tables to the output"}; + Configurable saveLcTable{"saveLcTable", false, "save the Lc tables to the output"}; + Configurable saveBplusTable{"saveBplusTable", false, "save the Bplus tables to the output"}; + Configurable saveDielectronTable{"saveDielectronTable", false, "save the Dielectron tables to the output"}; Configurable triggerMasks{"triggerMasks", "", "possible JE Trigger masks: fJetChLowPt,fJetChHighPt,fTrackLowPt,fTrackHighPt,fJetD0ChLowPt,fJetD0ChHighPt,fJetLcChLowPt,fJetLcChHighPt,fEMCALReadout,fJetFullHighPt,fJetFullLowPt,fJetNeutralHighPt,fJetNeutralLowPt,fGammaVeryHighPtEMCAL,fGammaVeryHighPtDCAL,fGammaHighPtEMCAL,fGammaHighPtDCAL,fGammaLowPtEMCAL,fGammaLowPtDCAL,fGammaVeryLowPtEMCAL,fGammaVeryLowPtDCAL"}; } config; @@ -102,8 +106,10 @@ struct JetDerivedDataWriter { Produces storedD0sTable; Produces storedD0ParsTable; Produces storedD0ParExtrasTable; + Produces storedD0ParDaughtersDummyTable; Produces storedD0SelsTable; Produces storedD0MlsTable; + Produces storedD0MlDughtersDummyTable; Produces storedD0McsTable; Produces storedD0IdsTable; Produces storedD0McCollisionsTable; @@ -112,21 +118,40 @@ struct JetDerivedDataWriter { Produces storedD0ParticlesTable; Produces storedD0ParticleIdsTable; - Produces storedLcCollisionsTable; + Produces storedLcCollisionsTable; Produces storedLcCollisionIdsTable; - Produces storedLcsTable; - Produces storedLcParsTable; - Produces storedLcParExtrasTable; - Produces storedLcSelsTable; - Produces storedLcMlsTable; - Produces storedLcMcsTable; + Produces storedLcsTable; + Produces storedLcParsTable; + Produces storedLcParExtrasTable; + Produces storedLcParDaughtersDummyTable; + Produces storedLcSelsTable; + Produces storedLcMlsTable; + Produces storedLcMlDughtersDummyTable; + Produces storedLcMcsTable; Produces storedLcIdsTable; - Produces storedLcMcCollisionsTable; + Produces storedLcMcCollisionsTable; Produces storedLcMcCollisionIdsTable; - Produces storedLcMcCollisionsMatchingTable; - Produces storedLcParticlesTable; + Produces storedLcMcCollisionsMatchingTable; + Produces storedLcParticlesTable; Produces storedLcParticleIdsTable; + Produces storedBplusCollisionsTable; + Produces storedBplusCollisionIdsTable; + Produces storedBplussTable; + Produces storedBplusParsTable; + Produces storedBplusParExtrasTable; + Produces storedBplusParD0sTable; + Produces storedBplusSelsDummyTable; + Produces storedBplusMlsTable; + Produces storedBplusMlD0sTable; + Produces storedBplusMcsTable; + Produces storedBplusIdsTable; + Produces storedBplusMcCollisionsTable; + Produces storedBplusMcCollisionIdsTable; + Produces storedBplusMcCollisionsMatchingTable; + Produces storedBplusParticlesTable; + Produces storedBplusParticleIdsTable; + Produces storedDielectronCollisionsTable; Produces storedDielectronCollisionIdsTable; Produces storedDielectronsTable; @@ -143,13 +168,16 @@ struct JetDerivedDataWriter { Preslice> TracksPerCollision = aod::jtrack::collisionId; Preslice> ClustersPerCollision = aod::jcluster::collisionId; Preslice> D0McCollisionsPerMcCollision = aod::jd0indices::mcCollisionId; - Preslice> LcMcCollisionsPerMcCollision = aod::jlcindices::mcCollisionId; + Preslice> LcMcCollisionsPerMcCollision = aod::jlcindices::mcCollisionId; + Preslice> BplusMcCollisionsPerMcCollision = aod::jbplusindices::mcCollisionId; Preslice DielectronMcCollisionsPerMcCollision = aod::jdielectronindices::mcCollisionId; Preslice D0CollisionsPerCollision = aod::jd0indices::collisionId; Preslice LcCollisionsPerCollision = aod::jlcindices::collisionId; + Preslice BplusCollisionsPerCollision = aod::jbplusindices::collisionId; Preslice DielectronCollisionsPerCollision = aod::jdielectronindices::collisionId; Preslice D0sPerCollision = aod::jd0indices::collisionId; Preslice LcsPerCollision = aod::jlcindices::collisionId; + Preslice BplussPerCollision = aod::jbplusindices::collisionId; Preslice DielectronsPerCollision = aod::jdielectronindices::collisionId; PresliceUnsorted EMCTrackPerTrack = aod::jemctrack::trackId; @@ -277,6 +305,12 @@ struct JetDerivedDataWriter { selectionObjectPtMin = config.thresholdChargedEventWiseSubtractedLcJetPtMin; } else if constexpr (std::is_same_v, aod::LcChargedMCParticleLevelJets>) { selectionObjectPtMin = config.thresholdChargedLcMCPJetPtMin; + } else if constexpr (std::is_same_v, aod::BplusChargedJets> || std::is_same_v, aod::BplusChargedMCDetectorLevelJets>) { + selectionObjectPtMin = config.thresholdChargedBplusJetPtMin; + } else if constexpr (std::is_same_v, aod::BplusChargedEventWiseSubtractedJets> || std::is_same_v, aod::BplusChargedMCDetectorLevelEventWiseSubtractedJets>) { + selectionObjectPtMin = config.thresholdChargedEventWiseSubtractedBplusJetPtMin; + } else if constexpr (std::is_same_v, aod::BplusChargedMCParticleLevelJets>) { + selectionObjectPtMin = config.thresholdChargedBplusMCPJetPtMin; } else if constexpr (std::is_same_v, aod::DielectronChargedJets> || std::is_same_v, aod::DielectronChargedMCDetectorLevelJets>) { selectionObjectPtMin = config.thresholdChargedDielectronJetPtMin; } else if constexpr (std::is_same_v, aod::DielectronChargedEventWiseSubtractedJets> || std::is_same_v, aod::DielectronChargedMCDetectorLevelEventWiseSubtractedJets>) { @@ -346,6 +380,11 @@ struct JetDerivedDataWriter { PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingLcChargedMCDJets, "process Lc charged mcd jets", false); PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingLcChargedMCDetectorLevelEventWiseSubtractedJets, "process Lc event-wise subtracted charged mcd jets", false); PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingLcChargedMCPJets, "process Lc charged mcp jets", false); + PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingBplusChargedJets, "process Bplus charged jets", false); + PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingBplusChargedEventWiseSubtractedJets, "process Bplus event-wise subtracted charged jets", false); + PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingBplusChargedMCDJets, "process Bplus charged mcd jets", false); + PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingBplusChargedMCDetectorLevelEventWiseSubtractedJets, "process Bplus event-wise subtracted charged mcd jets", false); + PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingBplusChargedMCPJets, "process Bplus charged mcp jets", false); PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingDielectronChargedJets, "process Dielectron charged jets", false); PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingDielectronChargedEventWiseSubtractedJets, "process Dielectron event-wise subtracted charged jets", false); PROCESS_SWITCH_FULL(JetDerivedDataWriter, processSelectionObjects, processSelectingDielectronChargedMCDJets, "process Dielectron charged mcd jets", false); @@ -363,7 +402,7 @@ struct JetDerivedDataWriter { } PROCESS_SWITCH(JetDerivedDataWriter, processStoreDummyTable, "write out dummy output table", true); - void processStoreData(soa::Join::iterator const& collision, soa::Join const&, soa::Join const& tracks, aod::JEMCTracks const& emcTracks, soa::Join const& clusters, aod::CollisionsD0 const& D0Collisions, aod::CandidatesD0Data const& D0s, aod::CollisionsLc const& LcCollisions, aod::CandidatesLcData const& Lcs, aod::CollisionsDielectron const& DielectronCollisions, aod::CandidatesDielectronData const& Dielectrons) + void processStoreData(soa::Join::iterator const& collision, soa::Join const&, soa::Join const& tracks, aod::JEMCTracks const& emcTracks, soa::Join const& clusters, aod::CollisionsD0 const& D0Collisions, aod::CandidatesD0Data const& D0s, aod::CollisionsLc const& LcCollisions, aod::CandidatesLcData const& Lcs, aod::CollisionsBplus const& BplusCollisions, aod::CandidatesBplusData const& Bpluss, aod::CollisionsDielectron const& DielectronCollisions, aod::CandidatesDielectronData const& Dielectrons) { std::map bcMapping; std::map trackMapping; @@ -429,12 +468,12 @@ struct JetDerivedDataWriter { if (config.saveD0Table) { int32_t collisionD0Index = -1; for (const auto& D0Collision : D0Collisions) { // should only ever be one - jethfutilities::fillD0CollisionTable(D0Collision, products.storedD0CollisionsTable, collisionD0Index); + jethfutilities::fillHFCollisionTable(D0Collision, products.storedD0CollisionsTable, collisionD0Index); products.storedD0CollisionIdsTable(products.storedJCollisionsTable.lastIndex()); } for (const auto& D0 : D0s) { int32_t D0Index = -1; - jethfutilities::fillD0CandidateTable(D0, collisionD0Index, products.storedD0sTable, products.storedD0ParsTable, products.storedD0ParExtrasTable, products.storedD0SelsTable, products.storedD0MlsTable, products.storedD0McsTable, D0Index); + jethfutilities::fillHFCandidateTable(D0, collisionD0Index, products.storedD0sTable, products.storedD0ParsTable, products.storedD0ParExtrasTable, products.storedD0ParDaughtersDummyTable, products.storedD0SelsTable, products.storedD0MlsTable, products.storedD0MlDughtersDummyTable, products.storedD0McsTable, D0Index); int32_t prong0Id = -1; int32_t prong1Id = -1; @@ -453,12 +492,12 @@ struct JetDerivedDataWriter { if (config.saveLcTable) { int32_t collisionLcIndex = -1; for (const auto& LcCollision : LcCollisions) { // should only ever be one - jethfutilities::fillLcCollisionTable(LcCollision, products.storedLcCollisionsTable, collisionLcIndex); + jethfutilities::fillHFCollisionTable(LcCollision, products.storedLcCollisionsTable, collisionLcIndex); products.storedLcCollisionIdsTable(products.storedJCollisionsTable.lastIndex()); } for (const auto& Lc : Lcs) { int32_t LcIndex = -1; - jethfutilities::fillLcCandidateTable(Lc, collisionLcIndex, products.storedLcsTable, products.storedLcParsTable, products.storedLcParExtrasTable, products.storedLcSelsTable, products.storedLcMlsTable, products.storedLcMcsTable, LcIndex); + jethfutilities::fillHFCandidateTable(Lc, collisionLcIndex, products.storedLcsTable, products.storedLcParsTable, products.storedLcParExtrasTable, products.storedLcParDaughtersDummyTable, products.storedLcSelsTable, products.storedLcMlsTable, products.storedLcMlDughtersDummyTable, products.storedLcMcsTable, LcIndex); int32_t prong0Id = -1; int32_t prong1Id = -1; @@ -478,6 +517,34 @@ struct JetDerivedDataWriter { products.storedLcIdsTable(products.storedJCollisionsTable.lastIndex(), prong0Id, prong1Id, prong2Id); } } + if (config.saveBplusTable) { + int32_t collisionBplusIndex = -1; + for (const auto& BplusCollision : BplusCollisions) { // should only ever be one + jethfutilities::fillHFCollisionTable(BplusCollision, products.storedBplusCollisionsTable, collisionBplusIndex); + products.storedBplusCollisionIdsTable(products.storedJCollisionsTable.lastIndex()); + } + for (const auto& Bplus : Bpluss) { + int32_t BplusIndex = -1; + jethfutilities::fillHFCandidateTable(Bplus, collisionBplusIndex, products.storedBplussTable, products.storedBplusParsTable, products.storedBplusParExtrasTable, products.storedBplusParD0sTable, products.storedBplusSelsDummyTable, products.storedBplusMlsTable, products.storedBplusMlD0sTable, products.storedBplusMcsTable, BplusIndex); + + int32_t prong0Id = -1; + int32_t prong1Id = -1; + int32_t prong2Id = -1; + auto JtrackIndex = trackMapping.find(Bplus.prong0Id()); + if (JtrackIndex != trackMapping.end()) { + prong0Id = JtrackIndex->second; + } + JtrackIndex = trackMapping.find(Bplus.prong1Id()); + if (JtrackIndex != trackMapping.end()) { + prong1Id = JtrackIndex->second; + } + JtrackIndex = trackMapping.find(Bplus.prong2Id()); + if (JtrackIndex != trackMapping.end()) { + prong2Id = JtrackIndex->second; + } + products.storedBplusIdsTable(products.storedJCollisionsTable.lastIndex(), prong0Id, prong1Id, prong2Id); + } + } if (config.saveDielectronTable) { int32_t collisionDielectronIndex = -1; for (const auto& DielectronCollision : DielectronCollisions) { // should only ever be one @@ -507,13 +574,14 @@ struct JetDerivedDataWriter { // to run after all jet selections PROCESS_SWITCH(JetDerivedDataWriter, processStoreData, "write out data output tables", false); - void processStoreMC(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const&, soa::Join const& tracks, aod::JEMCTracks const& emcTracks, soa::Join const& clusters, soa::Join const& particles, aod::CollisionsD0 const& D0Collisions, aod::CandidatesD0MCD const& D0s, soa::Join const& D0McCollisions, aod::CandidatesD0MCP const& D0Particles, aod::CollisionsLc const& LcCollisions, aod::CandidatesLcMCD const& Lcs, soa::Join const& LcMcCollisions, aod::CandidatesLcMCP const& LcParticles, aod::CollisionsDielectron const& DielectronCollisions, aod::CandidatesDielectronMCD const& Dielectrons, aod::McCollisionsDielectron const& DielectronMcCollisions, aod::CandidatesDielectronMCP const& DielectronParticles) + void processStoreMC(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const&, soa::Join const& tracks, aod::JEMCTracks const& emcTracks, soa::Join const& clusters, soa::Join const& particles, aod::CollisionsD0 const& D0Collisions, aod::CandidatesD0MCD const& D0s, soa::Join const& D0McCollisions, aod::CandidatesD0MCP const& D0Particles, aod::CollisionsLc const& LcCollisions, aod::CandidatesLcMCD const& Lcs, soa::Join const& LcMcCollisions, aod::CandidatesLcMCP const& LcParticles, aod::CollisionsBplus const& BplusCollisions, aod::CandidatesBplusMCD const& Bpluss, soa::Join const& BplusMcCollisions, aod::CandidatesBplusMCP const& BplusParticles, aod::CollisionsDielectron const& DielectronCollisions, aod::CandidatesDielectronMCD const& Dielectrons, aod::McCollisionsDielectron const& DielectronMcCollisions, aod::CandidatesDielectronMCP const& DielectronParticles) { std::map bcMapping; std::map paticleMapping; std::map mcCollisionMapping; std::map D0CollisionMapping; std::map LcCollisionMapping; + std::map BplusCollisionMapping; int particleTableIndex = 0; for (auto mcCollision : mcCollisions) { bool collisionSelected = false; @@ -571,12 +639,12 @@ struct JetDerivedDataWriter { const auto d0McCollisionsPerMcCollision = D0McCollisions.sliceBy(D0McCollisionsPerMcCollision, mcCollision.globalIndex()); int32_t mcCollisionD0Index = -1; for (const auto& d0McCollisionPerMcCollision : d0McCollisionsPerMcCollision) { // should only ever be one - jethfutilities::fillD0McCollisionTable(d0McCollisionPerMcCollision, products.storedD0McCollisionsTable, mcCollisionD0Index); + jethfutilities::fillHFMcCollisionTable(d0McCollisionPerMcCollision, products.storedD0McCollisionsTable, mcCollisionD0Index); products.storedD0McCollisionIdsTable(products.storedJMcCollisionsTable.lastIndex()); } for (const auto& D0Particle : D0Particles) { int32_t D0ParticleIndex = -1; - jethfutilities::fillD0CandidateMcTable(D0Particle, mcCollisionD0Index, products.storedD0ParticlesTable, D0ParticleIndex); + jethfutilities::fillHFCandidateMcTable(D0Particle, mcCollisionD0Index, products.storedD0ParticlesTable, D0ParticleIndex); int32_t D0ParticleId = -1; auto JParticleIndex = paticleMapping.find(D0Particle.mcParticleId()); if (JParticleIndex != paticleMapping.end()) { @@ -590,12 +658,12 @@ struct JetDerivedDataWriter { const auto lcMcCollisionsPerMcCollision = LcMcCollisions.sliceBy(LcMcCollisionsPerMcCollision, mcCollision.globalIndex()); int32_t mcCollisionLcIndex = -1; for (const auto& lcMcCollisionPerMcCollision : lcMcCollisionsPerMcCollision) { // should only ever be one - jethfutilities::fillLcMcCollisionTable(lcMcCollisionPerMcCollision, products.storedLcMcCollisionsTable, mcCollisionLcIndex); + jethfutilities::fillHFMcCollisionTable(lcMcCollisionPerMcCollision, products.storedLcMcCollisionsTable, mcCollisionLcIndex); products.storedLcMcCollisionIdsTable(products.storedJMcCollisionsTable.lastIndex()); } for (const auto& LcParticle : LcParticles) { int32_t LcParticleIndex = -1; - jethfutilities::fillLcCandidateMcTable(LcParticle, mcCollisionLcIndex, products.storedLcParticlesTable, LcParticleIndex); + jethfutilities::fillHFCandidateMcTable(LcParticle, mcCollisionLcIndex, products.storedLcParticlesTable, LcParticleIndex); int32_t LcParticleId = -1; auto JParticleIndex = paticleMapping.find(LcParticle.mcParticleId()); if (JParticleIndex != paticleMapping.end()) { @@ -604,6 +672,24 @@ struct JetDerivedDataWriter { products.storedLcParticleIdsTable(products.storedJMcCollisionsTable.lastIndex(), LcParticleId); } } + if (config.saveBplusTable) { + const auto lcMcCollisionsPerMcCollision = BplusMcCollisions.sliceBy(BplusMcCollisionsPerMcCollision, mcCollision.globalIndex()); + int32_t mcCollisionBplusIndex = -1; + for (const auto& lcMcCollisionPerMcCollision : lcMcCollisionsPerMcCollision) { // should only ever be one + jethfutilities::fillHFMcCollisionTable(lcMcCollisionPerMcCollision, products.storedBplusMcCollisionsTable, mcCollisionBplusIndex); + products.storedBplusMcCollisionIdsTable(products.storedJMcCollisionsTable.lastIndex()); + } + for (const auto& BplusParticle : BplusParticles) { + int32_t BplusParticleIndex = -1; + jethfutilities::fillHFCandidateMcTable(BplusParticle, mcCollisionBplusIndex, products.storedBplusParticlesTable, BplusParticleIndex); + int32_t BplusParticleId = -1; + auto JParticleIndex = paticleMapping.find(BplusParticle.mcParticleId()); + if (JParticleIndex != paticleMapping.end()) { + BplusParticleId = JParticleIndex->second; + } + products.storedBplusParticleIdsTable(products.storedJMcCollisionsTable.lastIndex(), BplusParticleId); + } + } if (config.saveDielectronTable) { const auto dielectronMcCollisionsPerMcCollision = DielectronMcCollisions.sliceBy(DielectronMcCollisionsPerMcCollision, mcCollision.globalIndex()); int32_t mcCollisionDielectronIndex = -1; @@ -752,14 +838,14 @@ struct JetDerivedDataWriter { const auto d0CollisionsPerCollision = D0Collisions.sliceBy(D0CollisionsPerCollision, collision.globalIndex()); int32_t collisionD0Index = -1; for (const auto& d0CollisionPerCollision : d0CollisionsPerCollision) { // should only ever be one - jethfutilities::fillD0CollisionTable(d0CollisionPerCollision, products.storedD0CollisionsTable, collisionD0Index); + jethfutilities::fillHFCollisionTable(d0CollisionPerCollision, products.storedD0CollisionsTable, collisionD0Index); products.storedD0CollisionIdsTable(products.storedJCollisionsTable.lastIndex()); D0CollisionMapping.insert(std::make_pair(d0CollisionPerCollision.globalIndex(), products.storedD0CollisionsTable.lastIndex())); } const auto d0sPerCollision = D0s.sliceBy(D0sPerCollision, collision.globalIndex()); for (const auto& D0 : d0sPerCollision) { int32_t D0Index = -1; - jethfutilities::fillD0CandidateTable(D0, collisionD0Index, products.storedD0sTable, products.storedD0ParsTable, products.storedD0ParExtrasTable, products.storedD0SelsTable, products.storedD0MlsTable, products.storedD0McsTable, D0Index); + jethfutilities::fillHFCandidateTable(D0, collisionD0Index, products.storedD0sTable, products.storedD0ParsTable, products.storedD0ParExtrasTable, products.storedD0ParDaughtersDummyTable, products.storedD0SelsTable, products.storedD0MlsTable, products.storedD0MlDughtersDummyTable, products.storedD0McsTable, D0Index); int32_t prong0Id = -1; int32_t prong1Id = -1; @@ -779,14 +865,14 @@ struct JetDerivedDataWriter { const auto lcCollisionsPerCollision = LcCollisions.sliceBy(LcCollisionsPerCollision, collision.globalIndex()); int32_t collisionLcIndex = -1; for (const auto& lcCollisionPerCollision : lcCollisionsPerCollision) { // should only ever be one - jethfutilities::fillLcCollisionTable(lcCollisionPerCollision, products.storedLcCollisionsTable, collisionLcIndex); + jethfutilities::fillHFCollisionTable(lcCollisionPerCollision, products.storedLcCollisionsTable, collisionLcIndex); products.storedLcCollisionIdsTable(products.storedJCollisionsTable.lastIndex()); LcCollisionMapping.insert(std::make_pair(lcCollisionPerCollision.globalIndex(), products.storedLcCollisionsTable.lastIndex())); } const auto lcsPerCollision = Lcs.sliceBy(LcsPerCollision, collision.globalIndex()); for (const auto& Lc : lcsPerCollision) { int32_t LcIndex = -1; - jethfutilities::fillLcCandidateTable(Lc, collisionLcIndex, products.storedLcsTable, products.storedLcParsTable, products.storedLcParExtrasTable, products.storedLcSelsTable, products.storedLcMlsTable, products.storedLcMcsTable, LcIndex); + jethfutilities::fillHFCandidateTable(Lc, collisionLcIndex, products.storedLcsTable, products.storedLcParsTable, products.storedLcParExtrasTable, products.storedLcParDaughtersDummyTable, products.storedLcSelsTable, products.storedLcMlsTable, products.storedLcMlDughtersDummyTable, products.storedLcMcsTable, LcIndex); int32_t prong0Id = -1; int32_t prong1Id = -1; @@ -807,6 +893,38 @@ struct JetDerivedDataWriter { } } + if (config.saveBplusTable) { + const auto lcCollisionsPerCollision = BplusCollisions.sliceBy(BplusCollisionsPerCollision, collision.globalIndex()); + int32_t collisionBplusIndex = -1; + for (const auto& lcCollisionPerCollision : lcCollisionsPerCollision) { // should only ever be one + jethfutilities::fillHFCollisionTable(lcCollisionPerCollision, products.storedBplusCollisionsTable, collisionBplusIndex); + products.storedBplusCollisionIdsTable(products.storedJCollisionsTable.lastIndex()); + BplusCollisionMapping.insert(std::make_pair(lcCollisionPerCollision.globalIndex(), products.storedBplusCollisionsTable.lastIndex())); + } + const auto lcsPerCollision = Bpluss.sliceBy(BplussPerCollision, collision.globalIndex()); + for (const auto& Bplus : lcsPerCollision) { + int32_t BplusIndex = -1; + jethfutilities::fillHFCandidateTable(Bplus, collisionBplusIndex, products.storedBplussTable, products.storedBplusParsTable, products.storedBplusParExtrasTable, products.storedBplusParD0sTable, products.storedBplusSelsDummyTable, products.storedBplusMlsTable, products.storedBplusMlD0sTable, products.storedBplusMcsTable, BplusIndex); + + int32_t prong0Id = -1; + int32_t prong1Id = -1; + int32_t prong2Id = -1; + auto JtrackIndex = trackMapping.find(Bplus.prong0Id()); + if (JtrackIndex != trackMapping.end()) { + prong0Id = JtrackIndex->second; + } + JtrackIndex = trackMapping.find(Bplus.prong1Id()); + if (JtrackIndex != trackMapping.end()) { + prong1Id = JtrackIndex->second; + } + JtrackIndex = trackMapping.find(Bplus.prong2Id()); + if (JtrackIndex != trackMapping.end()) { + prong2Id = JtrackIndex->second; + } + products.storedBplusIdsTable(products.storedJCollisionsTable.lastIndex(), prong0Id, prong1Id, prong2Id); + } + } + if (config.saveDielectronTable) { const auto dielectronCollisionsPerCollision = DielectronCollisions.sliceBy(DielectronCollisionsPerCollision, collision.globalIndex()); int32_t collisionDielectronIndex = -1; @@ -862,6 +980,20 @@ struct JetDerivedDataWriter { products.storedLcMcCollisionsMatchingTable(lcCollisionIDs); } } + + if (config.saveBplusTable) { + const auto lcMcCollisionsPerMcCollision = BplusMcCollisions.sliceBy(BplusMcCollisionsPerMcCollision, mcCollision.globalIndex()); + for (const auto& lcMcCollisionPerMcCollision : lcMcCollisionsPerMcCollision) { // should just be one + std::vector lcCollisionIDs; + for (auto const& lcCollisionPerMcCollision : lcMcCollisionPerMcCollision.template hfCollBases_as()) { + auto lcCollisionIndex = BplusCollisionMapping.find(lcCollisionPerMcCollision.globalIndex()); + if (lcCollisionIndex != BplusCollisionMapping.end()) { + lcCollisionIDs.push_back(lcCollisionIndex->second); + } + } + products.storedBplusMcCollisionsMatchingTable(lcCollisionIDs); + } + } } } } @@ -869,7 +1001,7 @@ struct JetDerivedDataWriter { // to run after all jet selections PROCESS_SWITCH(JetDerivedDataWriter, processStoreMC, "write out data output tables for mc", false); - void processStoreMCP(soa::Join const& mcCollisions, soa::Join const& particles, aod::McCollisionsD0 const& D0McCollisions, aod::CandidatesD0MCP const& D0Particles, aod::McCollisionsLc const& LcMcCollisions, aod::CandidatesLcMCP const& LcParticles, aod::McCollisionsDielectron const& DielectronMcCollisions, aod::CandidatesDielectronMCP const& DielectronParticles) + void processStoreMCP(soa::Join const& mcCollisions, soa::Join const& particles, aod::McCollisionsD0 const& D0McCollisions, aod::CandidatesD0MCP const& D0Particles, aod::McCollisionsLc const& LcMcCollisions, aod::CandidatesLcMCP const& LcParticles, aod::McCollisionsBplus const& BplusMcCollisions, aod::CandidatesBplusMCP const& BplusParticles, aod::McCollisionsDielectron const& DielectronMcCollisions, aod::CandidatesDielectronMCP const& DielectronParticles) { int particleTableIndex = 0; @@ -918,12 +1050,12 @@ struct JetDerivedDataWriter { const auto d0McCollisionsPerMcCollision = D0McCollisions.sliceBy(D0McCollisionsPerMcCollision, mcCollision.globalIndex()); int32_t mcCollisionD0Index = -1; for (const auto& d0McCollisionPerMcCollision : d0McCollisionsPerMcCollision) { // should only ever be one - jethfutilities::fillD0McCollisionTable(d0McCollisionPerMcCollision, products.storedD0McCollisionsTable, mcCollisionD0Index); + jethfutilities::fillHFMcCollisionTable(d0McCollisionPerMcCollision, products.storedD0McCollisionsTable, mcCollisionD0Index); products.storedD0McCollisionIdsTable(products.storedJMcCollisionsTable.lastIndex()); } for (const auto& D0Particle : D0Particles) { int32_t D0ParticleIndex = -1; - jethfutilities::fillD0CandidateMcTable(D0Particle, mcCollisionD0Index, products.storedD0ParticlesTable, D0ParticleIndex); + jethfutilities::fillHFCandidateMcTable(D0Particle, mcCollisionD0Index, products.storedD0ParticlesTable, D0ParticleIndex); int32_t D0ParticleId = -1; auto JParticleIndex = paticleMapping.find(D0Particle.mcParticleId()); if (JParticleIndex != paticleMapping.end()) { @@ -936,12 +1068,12 @@ struct JetDerivedDataWriter { const auto lcMcCollisionsPerMcCollision = LcMcCollisions.sliceBy(LcMcCollisionsPerMcCollision, mcCollision.globalIndex()); int32_t mcCollisionLcIndex = -1; for (const auto& lcMcCollisionPerMcCollision : lcMcCollisionsPerMcCollision) { // should only ever be one - jethfutilities::fillLcMcCollisionTable(lcMcCollisionPerMcCollision, products.storedLcMcCollisionsTable, mcCollisionLcIndex); + jethfutilities::fillHFMcCollisionTable(lcMcCollisionPerMcCollision, products.storedLcMcCollisionsTable, mcCollisionLcIndex); products.storedLcMcCollisionIdsTable(products.storedJMcCollisionsTable.lastIndex()); } for (const auto& LcParticle : LcParticles) { int32_t LcParticleIndex = -1; - jethfutilities::fillLcCandidateMcTable(LcParticle, mcCollisionLcIndex, products.storedLcParticlesTable, LcParticleIndex); + jethfutilities::fillHFCandidateMcTable(LcParticle, mcCollisionLcIndex, products.storedLcParticlesTable, LcParticleIndex); int32_t LcParticleId = -1; auto JParticleIndex = paticleMapping.find(LcParticle.mcParticleId()); if (JParticleIndex != paticleMapping.end()) { @@ -950,6 +1082,24 @@ struct JetDerivedDataWriter { products.storedLcParticleIdsTable(products.storedJMcCollisionsTable.lastIndex(), LcParticleId); } } + if (config.saveBplusTable) { + const auto lcMcCollisionsPerMcCollision = BplusMcCollisions.sliceBy(BplusMcCollisionsPerMcCollision, mcCollision.globalIndex()); + int32_t mcCollisionBplusIndex = -1; + for (const auto& lcMcCollisionPerMcCollision : lcMcCollisionsPerMcCollision) { // should only ever be one + jethfutilities::fillHFMcCollisionTable(lcMcCollisionPerMcCollision, products.storedBplusMcCollisionsTable, mcCollisionBplusIndex); + products.storedBplusMcCollisionIdsTable(products.storedJMcCollisionsTable.lastIndex()); + } + for (const auto& BplusParticle : BplusParticles) { + int32_t BplusParticleIndex = -1; + jethfutilities::fillHFCandidateMcTable(BplusParticle, mcCollisionBplusIndex, products.storedBplusParticlesTable, BplusParticleIndex); + int32_t BplusParticleId = -1; + auto JParticleIndex = paticleMapping.find(BplusParticle.mcParticleId()); + if (JParticleIndex != paticleMapping.end()) { + BplusParticleId = JParticleIndex->second; + } + products.storedBplusParticleIdsTable(products.storedJMcCollisionsTable.lastIndex(), BplusParticleId); + } + } if (config.saveDielectronTable) { const auto dielectronMcCollisionsPerMcCollision = DielectronMcCollisions.sliceBy(DielectronMcCollisionsPerMcCollision, mcCollision.globalIndex()); int32_t mcCollisionDielectronIndex = -1; diff --git a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx index 18b1249ed95..f1dae6bb061 100644 --- a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx +++ b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx @@ -163,7 +163,7 @@ struct eventWiseConstituentSubtractorTask { analyseHFMc(tracks, candidates, particleSubtractedLcTable); } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processLcMcCollisions, "Fill table of subtracted tracks for collisions with Lc MCP candidates", false); - /* + void processBplusCollisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { analyseHF(tracks, candidates, trackSubtractedBplusTable); @@ -175,7 +175,7 @@ struct eventWiseConstituentSubtractorTask { analyseHFMc(tracks, candidates, particleSubtractedBplusTable); } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processBplusMcCollisions, "Fill table of subtracted tracks for collisions with Bplus MCP candidates", false); - */ + void processDielectronCollisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { analyseHF(tracks, candidates, trackSubtractedDielectronTable); diff --git a/PWGJE/TableProducer/rhoEstimator.cxx b/PWGJE/TableProducer/rhoEstimator.cxx index 83429af3f5b..ff0072f7052 100644 --- a/PWGJE/TableProducer/rhoEstimator.cxx +++ b/PWGJE/TableProducer/rhoEstimator.cxx @@ -152,7 +152,7 @@ struct RhoEstimatorTask { } } PROCESS_SWITCH(RhoEstimatorTask, processLcMcCollisions, "Fill rho tables for collisions with Lc MCP candidates", false); - /* + void processBplusCollisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesBplusData const& candidates) { inputParticles.clear(); @@ -178,7 +178,7 @@ struct RhoEstimatorTask { } } PROCESS_SWITCH(RhoEstimatorTask, processBplusMcCollisions, "Fill rho tables for collisions with Bplus MCP candidates", false); - */ + void processDielectronCollisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesDielectronData const& candidates) { inputParticles.clear(); diff --git a/PWGJE/Tasks/CMakeLists.txt b/PWGJE/Tasks/CMakeLists.txt index 50f9600c2ed..4582452a7ab 100644 --- a/PWGJE/Tasks/CMakeLists.txt +++ b/PWGJE/Tasks/CMakeLists.txt @@ -60,6 +60,10 @@ if(FastJet_FOUND) SOURCES jetSubstructureLc.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(jet-substructure-bplus + SOURCES jetSubstructureBplus.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-substructure-dielectron SOURCES jetSubstructureDielectron.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore @@ -72,6 +76,10 @@ if(FastJet_FOUND) SOURCES jetSubstructureLcOutput.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-substructure-bplus-output + SOURCES jetSubstructureBplusOutput.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-substructure-dielectron-output SOURCES jetSubstructureDielectronOutput.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore @@ -104,6 +112,10 @@ if(FastJet_FOUND) SOURCES jetFinderLcQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-finder-bplus-qa + SOURCES jetFinderBplusQA.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-finder-dielectron-qa SOURCES jetFinderDielectronQA.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore diff --git a/PWGJE/Tasks/jetFinderBplusQA.cxx b/PWGJE/Tasks/jetFinderBplusQA.cxx new file mode 100644 index 00000000000..4b7c42b4580 --- /dev/null +++ b/PWGJE/Tasks/jetFinderBplusQA.cxx @@ -0,0 +1,27 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet finder B+ charged QA task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetFinderHFQA.cxx" + +using JetFinderBplusQATask = JetFinderHFQATask; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{}, + TaskName{"jet-finder-charged-bplus-qa"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetSubstructureBplus.cxx b/PWGJE/Tasks/jetSubstructureBplus.cxx new file mode 100644 index 00000000000..61228fe5b19 --- /dev/null +++ b/PWGJE/Tasks/jetSubstructureBplus.cxx @@ -0,0 +1,27 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet substructure B+ charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetSubstructureHF.cxx" + +using JetSubstructureBplus = JetSubstructureHFTask, soa::Join, soa::Join, soa::Join, aod::CandidatesBplusData, aod::CandidatesBplusMCP, aod::BplusCJetSSs, aod::BplusCMCDJetSSs, aod::BplusCMCPJetSSs, aod::BplusCEWSJetSSs, aod::JTrackBplusSubs>; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, + SetDefaultProcesses{}, + TaskName{"jet-substructure-bplus"})); + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetSubstructureBplusOutput.cxx b/PWGJE/Tasks/jetSubstructureBplusOutput.cxx new file mode 100644 index 00000000000..89c0b94560f --- /dev/null +++ b/PWGJE/Tasks/jetSubstructureBplusOutput.cxx @@ -0,0 +1,26 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// jet substructure output B+ charged task +// +/// \author Nima Zardoshti + +#include "PWGJE/Tasks/jetSubstructureHFOutput.cxx" + +using JetSubstructureOutputBplus = JetSubstructureHFOutputTask, aod::CandidatesBplusData, aod::CandidatesBplusMCD, aod::CandidatesBplusMCP, aod::JTrackBplusSubs, soa::Join, soa::Join, aod::BplusCJetCOs, aod::BplusCJetOs, aod::BplusCJetSSOs, aod::BplusCJetMOs, soa::Join, aod::BplusCMCDJetCOs, aod::BplusCMCDJetOs, aod::BplusCMCDJetSSOs, aod::BplusCMCDJetMOs, soa::Join, aod::BplusCMCPJetCOs, aod::BplusCMCPJetOs, aod::BplusCMCPJetSSOs, aod::BplusCMCPJetMOs, soa::Join, aod::BplusCEWSJetCOs, aod::BplusCEWSJetOs, aod::BplusCEWSJetSSOs, aod::BplusCEWSJetMOs, aod::StoredHfBplusCollBase, aod::StoredHfBplusBases, aod::StoredHfBplusPars, aod::StoredHfBplusParEs, aod::StoredHfBplusParD0s, aod::JDumBplusSels, aod::StoredHfBplusMls, aod::StoredHfBplusMlD0s, aod::StoredHfBplusMcs, aod::StoredHfBplusMcCollBases, aod::StoredHfBplusMcRCollIds, aod::StoredHfBplusPBases>; // all the 3P tables have been made into Bplus but they might be made common + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + std::vector tasks; + tasks.emplace_back(adaptAnalysisTask(cfgc, SetDefaultProcesses{}, TaskName{"jet-substructure-bplus-output"})); + + return WorkflowSpec{tasks}; +} diff --git a/PWGJE/Tasks/jetSubstructureD0Output.cxx b/PWGJE/Tasks/jetSubstructureD0Output.cxx index d53894fba01..7eb6b474eaf 100644 --- a/PWGJE/Tasks/jetSubstructureD0Output.cxx +++ b/PWGJE/Tasks/jetSubstructureD0Output.cxx @@ -15,7 +15,7 @@ #include "PWGJE/Tasks/jetSubstructureHFOutput.cxx" -using JetSubstructureOutputD0 = JetSubstructureHFOutputTask, aod::CandidatesD0Data, aod::CandidatesD0MCD, aod::CandidatesD0MCP, aod::JTrackD0Subs, soa::Join, soa::Join, aod::D0CJetCOs, aod::D0CJetOs, aod::D0CJetSSOs, aod::D0CJetMOs, soa::Join, aod::D0CMCDJetCOs, aod::D0CMCDJetOs, aod::D0CMCDJetSSOs, aod::D0CMCDJetMOs, soa::Join, aod::D0CMCPJetCOs, aod::D0CMCPJetOs, aod::D0CMCPJetSSOs, aod::D0CMCPJetMOs, soa::Join, aod::D0CEWSJetCOs, aod::D0CEWSJetOs, aod::D0CEWSJetSSOs, aod::D0CEWSJetMOs, aod::StoredHfD0CollBase, aod::StoredHfD0Bases, aod::StoredHfD0Pars, aod::StoredHfD0ParEs, aod::StoredHfD0Sels, aod::StoredHfD0Mls, aod::StoredHfD0Mcs, aod::StoredHfD0McCollBases, aod::StoredHfD0McRCollIds, aod::StoredHfD0PBases>; +using JetSubstructureOutputD0 = JetSubstructureHFOutputTask, aod::CandidatesD0Data, aod::CandidatesD0MCD, aod::CandidatesD0MCP, aod::JTrackD0Subs, soa::Join, soa::Join, aod::D0CJetCOs, aod::D0CJetOs, aod::D0CJetSSOs, aod::D0CJetMOs, soa::Join, aod::D0CMCDJetCOs, aod::D0CMCDJetOs, aod::D0CMCDJetSSOs, aod::D0CMCDJetMOs, soa::Join, aod::D0CMCPJetCOs, aod::D0CMCPJetOs, aod::D0CMCPJetSSOs, aod::D0CMCPJetMOs, soa::Join, aod::D0CEWSJetCOs, aod::D0CEWSJetOs, aod::D0CEWSJetSSOs, aod::D0CEWSJetMOs, aod::StoredHfD0CollBase, aod::StoredHfD0Bases, aod::StoredHfD0Pars, aod::StoredHfD0ParEs, aod::JDumD0ParDaus, aod::StoredHfD0Sels, aod::StoredHfD0Mls, aod::JDumD0MlDaus, aod::StoredHfD0Mcs, aod::StoredHfD0McCollBases, aod::StoredHfD0McRCollIds, aod::StoredHfD0PBases>; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/Tasks/jetSubstructureDielectronOutput.cxx b/PWGJE/Tasks/jetSubstructureDielectronOutput.cxx index 2e1e7eb12df..76cdd6e7643 100644 --- a/PWGJE/Tasks/jetSubstructureDielectronOutput.cxx +++ b/PWGJE/Tasks/jetSubstructureDielectronOutput.cxx @@ -15,7 +15,7 @@ #include "PWGJE/Tasks/jetSubstructureHFOutput.cxx" -using JetSubstructureOutputDielectron = JetSubstructureHFOutputTask, soa::Join, aod::DielectronCJetCOs, aod::DielectronCJetOs, aod::DielectronCJetSSOs, aod::DielectronCJetMOs, soa::Join, aod::DielectronCMCDJetCOs, aod::DielectronCMCDJetOs, aod::DielectronCMCDJetSSOs, aod::DielectronCMCDJetMOs, soa::Join, aod::DielectronCMCPJetCOs, aod::DielectronCMCPJetOs, aod::DielectronCMCPJetSSOs, aod::DielectronCMCPJetMOs, soa::Join, aod::DielectronCEWSJetCOs, aod::DielectronCEWSJetOs, aod::DielectronCEWSJetSSOs, aod::DielectronCEWSJetMOs, aod::StoredReducedEvents, aod::StoredDielectrons, aod::JDielectron1Dummys, aod::JDielectron2Dummys, aod::JDielectron3Dummys, aod::JDielectron4Dummys, aod::JDielectron5Dummys, aod::StoredJDielectronMcCollisions, aod::JDielectron6Dummys, aod::StoredJDielectronMcs>; +using JetSubstructureOutputDielectron = JetSubstructureHFOutputTask, soa::Join, aod::DielectronCJetCOs, aod::DielectronCJetOs, aod::DielectronCJetSSOs, aod::DielectronCJetMOs, soa::Join, aod::DielectronCMCDJetCOs, aod::DielectronCMCDJetOs, aod::DielectronCMCDJetSSOs, aod::DielectronCMCDJetMOs, soa::Join, aod::DielectronCMCPJetCOs, aod::DielectronCMCPJetOs, aod::DielectronCMCPJetSSOs, aod::DielectronCMCPJetMOs, soa::Join, aod::DielectronCEWSJetCOs, aod::DielectronCEWSJetOs, aod::DielectronCEWSJetSSOs, aod::DielectronCEWSJetMOs, aod::StoredReducedEvents, aod::StoredDielectrons, aod::JDielectron1Dummys, aod::JDielectron2Dummys, aod::JDielectron3Dummys, aod::JDielectron4Dummys, aod::JDielectron5Dummys, aod::JDielectron6Dummys, aod::JDielectron7Dummys, aod::StoredJDielectronMcCollisions, aod::JDielectron8Dummys, aod::StoredJDielectronMcs>; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGJE/Tasks/jetSubstructureHF.cxx b/PWGJE/Tasks/jetSubstructureHF.cxx index 16bcd3acd13..2ad5ddb4bac 100644 --- a/PWGJE/Tasks/jetSubstructureHF.cxx +++ b/PWGJE/Tasks/jetSubstructureHF.cxx @@ -291,4 +291,3 @@ struct JetSubstructureHFTask { } PROCESS_SWITCH(JetSubstructureHFTask, processChargedJetsMCP, "HF jet substructure on MC particle level", false); }; -// using JetSubstructureBplus = JetSubstructureHFTask,soa::Join,soa::Join,soa::Join, aod::CandidatesBplusData, aod::CandidatesBplusMCP, aod::BplusCJetSSs,aod::BplusCMCDJetSSs,aod::BplusCMCPJetSSs, aod::BplusCEWSJetSSs, aod::JTrackBplusSubs>; diff --git a/PWGJE/Tasks/jetSubstructureHFOutput.cxx b/PWGJE/Tasks/jetSubstructureHFOutput.cxx index f0ca793c4a9..d651f2d8e5b 100644 --- a/PWGJE/Tasks/jetSubstructureHFOutput.cxx +++ b/PWGJE/Tasks/jetSubstructureHFOutput.cxx @@ -42,7 +42,7 @@ using namespace o2::framework::expressions; // NB: runDataProcessing.h must be included after customize! #include "Framework/runDataProcessing.h" -template +template struct JetSubstructureHFOutputTask { Produces collisionOutputTableData; @@ -65,8 +65,10 @@ struct JetSubstructureHFOutputTask { Produces candidateTable; Produces candidateParsTable; Produces candidateParExtrasTable; + Produces candidateParsDaughterTable; Produces candidateSelsTable; Produces candidateMlsTable; + Produces candidateMlsDaughterTable; Produces candidateMcsTable; Produces hfMcCollisionsTable; Produces hfMcCollisionsMatchingTable; @@ -102,9 +104,11 @@ struct JetSubstructureHFOutputTask { PresliceUnsorted> CollisionsPerMcCollision = aod::jmccollisionlb::mcCollisionId; PresliceOptional D0CollisionsPerCollision = aod::jd0indices::collisionId; PresliceOptional LcCollisionsPerCollision = aod::jlcindices::collisionId; + PresliceOptional BplusCollisionsPerCollision = aod::jbplusindices::collisionId; PresliceOptional DielectronCollisionsPerCollision = aod::jdielectronindices::collisionId; PresliceOptional> D0McCollisionsPerMcCollision = aod::jd0indices::mcCollisionId; - PresliceOptional> LcMcCollisionsPerMcCollision = aod::jlcindices::mcCollisionId; + PresliceOptional> LcMcCollisionsPerMcCollision = aod::jlcindices::mcCollisionId; + PresliceOptional> BplusMcCollisionsPerMcCollision = aod::jbplusindices::mcCollisionId; PresliceOptional DielectronMcCollisionsPerMcCollision = aod::jdielectronindices::mcCollisionId; void init(InitContext const&) @@ -207,7 +211,7 @@ struct JetSubstructureHFOutputTask { if (hfCollisionIndex != candidateCollisionMapping.end()) { candidateCollisionIndex = hfCollisionIndex->second; } - jetcandidateutilities::fillCandidateTable(candidate, candidateCollisionIndex, candidateTable, candidateParsTable, candidateParExtrasTable, candidateSelsTable, candidateMlsTable, candidateMcsTable, candidateIndex); + jetcandidateutilities::fillCandidateTable(candidate, candidateCollisionIndex, candidateTable, candidateParsTable, candidateParExtrasTable, candidateParsDaughterTable, candidateSelsTable, candidateMlsTable, candidateMlsDaughterTable, candidateMcsTable, candidateIndex); } candidateMap.insert(std::make_pair(candidate.globalIndex(), candidateIndex)); } @@ -322,7 +326,7 @@ struct JetSubstructureHFOutputTask { if constexpr (!isMCPOnly) { for (const auto& collision : collisions) { if (collisionFlag[collision.globalIndex()]) { - const auto hfCollisionsPerCollision = jetcandidateutilities::slicedPerCandidateCollision(hfCollisions, candidates, collision, D0CollisionsPerCollision, LcCollisionsPerCollision, D0CollisionsPerCollision, DielectronCollisionsPerCollision); // add Bplus later + const auto hfCollisionsPerCollision = jetcandidateutilities::slicedPerCandidateCollision(hfCollisions, candidates, collision, D0CollisionsPerCollision, LcCollisionsPerCollision, BplusCollisionsPerCollision, DielectronCollisionsPerCollision); // add Bplus later int32_t candidateCollisionIndex = -1; for (const auto& hfCollisionPerCollision : hfCollisionsPerCollision) { // should only ever be one auto hfCollisionTableIndex = candidateCollisionMapping.find(hfCollisionPerCollision.globalIndex()); @@ -338,7 +342,7 @@ struct JetSubstructureHFOutputTask { if constexpr (isMC) { for (const auto& mcCollision : mcCollisions) { if (mcCollisionFlag[mcCollision.globalIndex()]) { - const auto hfMcCollisionsPerMcCollision = jetcandidateutilities::slicedPerCandidateCollision(hfMcCollisions, candidatesMCP, mcCollision, D0McCollisionsPerMcCollision, LcMcCollisionsPerMcCollision, D0McCollisionsPerMcCollision, DielectronMcCollisionsPerMcCollision); // add Bplus later + const auto hfMcCollisionsPerMcCollision = jetcandidateutilities::slicedPerCandidateCollision(hfMcCollisions, candidatesMCP, mcCollision, D0McCollisionsPerMcCollision, LcMcCollisionsPerMcCollision, BplusMcCollisionsPerMcCollision, DielectronMcCollisionsPerMcCollision); // add Bplus later int32_t candidateMcCollisionIndex = -1; for (const auto& hfMcCollisionPerMcCollision : hfMcCollisionsPerMcCollision) { // should only ever be one auto hfMcCollisionTableIndex = candidateMcCollisionMapping.find(hfMcCollisionPerMcCollision.globalIndex()); @@ -499,4 +503,3 @@ struct JetSubstructureHFOutputTask { } PROCESS_SWITCH(JetSubstructureHFOutputTask, processOutputMatchingMC, "jet matching output MC", false); }; -// using JetSubstructureOutputBplus = JetSubstructureHFOutputTask, aod::CandidatesBplusData, aod::CandidatesBplusMCD, aod::CandidatesBplusMCP, aod::JTrackBplusSubs, soa::Join, soa::Join, aod::BplusCJetCOs, aod::BplusCJetOs, aod::BplusCJetSSOs, aod::BplusCJetMOs, soa::Join, aod::BplusCMCDJetCOs, aod::BplusCMCDJetOs, aod::BplusCMCDJetSSOs, aod::BplusCMCDJetMOs, soa::Join, aod::BplusCMCPJetCOs, aod::BplusCMCPJetOs, aod::BplusCMCPJetSSOs, aod::BplusCMCPJetMOs, soa::Join, aod::BplusCEWSJetCOs, aod::BplusCEWSJetOs, aod::BplusCEWSJetSSOs, aod::BplusCEWSJetMOs, aod::StoredHfBplusCollBase, aod::StoredHfBplusBases, aod::StoredHfBplusPars, aod::StoredHfBplusParEs, aod::StoredHfBplusSels, aod::StoredHfBplusMls, aod::StoredHfBplusMcs, aod::StoredHfBplusPBases>; diff --git a/PWGJE/Tasks/jetSubstructureLcOutput.cxx b/PWGJE/Tasks/jetSubstructureLcOutput.cxx index 34361a1148e..dad7b2a52b5 100644 --- a/PWGJE/Tasks/jetSubstructureLcOutput.cxx +++ b/PWGJE/Tasks/jetSubstructureLcOutput.cxx @@ -15,7 +15,7 @@ #include "PWGJE/Tasks/jetSubstructureHFOutput.cxx" -using JetSubstructureOutputLc = JetSubstructureHFOutputTask, aod::CandidatesLcData, aod::CandidatesLcMCD, aod::CandidatesLcMCP, aod::JTrackLcSubs, soa::Join, soa::Join, aod::LcCJetCOs, aod::LcCJetOs, aod::LcCJetSSOs, aod::LcCJetMOs, soa::Join, aod::LcCMCDJetCOs, aod::LcCMCDJetOs, aod::LcCMCDJetSSOs, aod::LcCMCDJetMOs, soa::Join, aod::LcCMCPJetCOs, aod::LcCMCPJetOs, aod::LcCMCPJetSSOs, aod::LcCMCPJetMOs, soa::Join, aod::LcCEWSJetCOs, aod::LcCEWSJetOs, aod::LcCEWSJetSSOs, aod::LcCEWSJetMOs, aod::StoredHf3PCollBase, aod::StoredHf3PBases, aod::StoredHf3PPars, aod::StoredHf3PParEs, aod::StoredHf3PSels, aod::StoredHf3PMls, aod::StoredHf3PMcs, aod::StoredHf3PMcCollBases, aod::StoredHf3PMcRCollIds, aod::StoredHf3PPBases>; +using JetSubstructureOutputLc = JetSubstructureHFOutputTask, aod::CandidatesLcData, aod::CandidatesLcMCD, aod::CandidatesLcMCP, aod::JTrackLcSubs, soa::Join, soa::Join, aod::LcCJetCOs, aod::LcCJetOs, aod::LcCJetSSOs, aod::LcCJetMOs, soa::Join, aod::LcCMCDJetCOs, aod::LcCMCDJetOs, aod::LcCMCDJetSSOs, aod::LcCMCDJetMOs, soa::Join, aod::LcCMCPJetCOs, aod::LcCMCPJetOs, aod::LcCMCPJetSSOs, aod::LcCMCPJetMOs, soa::Join, aod::LcCEWSJetCOs, aod::LcCEWSJetOs, aod::LcCEWSJetSSOs, aod::LcCEWSJetMOs, aod::StoredHfLcCollBase, aod::StoredHfLcBases, aod::StoredHfLcPars, aod::StoredHfLcParEs, aod::JDumLcParDaus, aod::StoredHfLcSels, aod::StoredHfLcMls, aod::JDumLcMlDaus, aod::StoredHfLcMcs, aod::StoredHfLcMcCollBases, aod::StoredHfLcMcRCollIds, aod::StoredHfLcPBases>; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 03dee9ae030a9b0b934bff4bc6ab5791c01987a3 Mon Sep 17 00:00:00 2001 From: sarjeetagami <162087855+sarjeetagami@users.noreply.github.com> Date: Tue, 3 Dec 2024 20:18:54 +0530 Subject: [PATCH 229/459] [PWGLF] occupancy checks for MC (#8787) Co-authored-by: sarjeeta gami --- .../Tasks/Resonances/phianalysisrun3_PbPb.cxx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx b/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx index d3b249a65be..d9e3eb99f44 100644 --- a/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx +++ b/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx @@ -79,7 +79,6 @@ struct phianalysisrun3_PbPb { Configurable cfgNoMixedEvents{"cfgNoMixedEvents", 5, "Number of mixed events per event"}; Configurable fillOccupancy{"fillOccupancy", true, "fill Occupancy"}; Configurable cfgOccupancyCut{"cfgOccupancyCut", 2500, "Occupancy cut"}; - Configurable cfgCutTOFBeta{"cfgCutTOFBeta", 0.0, "cut TOF beta"}; Configurable isNoTOF{"isNoTOF", false, "isNoTOF"}; Configurable additionalEvSel2{"additionalEvSel2", true, "Additional evsel2"}; Configurable additionalEvSel3{"additionalEvSel3", true, "Additional evsel3"}; @@ -179,7 +178,7 @@ struct phianalysisrun3_PbPb { if (!candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC) { return true; } - if (candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaKa()) < nsigmaCutTOF) { + if (candidate.hasTOF() && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC && TMath::Abs(candidate.tofNSigmaKa()) < nsigmaCutTOF) { return true; } return false; @@ -228,17 +227,17 @@ struct phianalysisrun3_PbPb { Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); using EventCandidates = soa::Filtered>; - using TrackCandidates = soa::Filtered>; + using TrackCandidates = soa::Filtered>; // using EventCandidatesMC = soa::Join; using EventCandidatesMC = soa::Join; using TrackCandidatesMC = soa::Filtered>; using CollisionMCTrueTable = aod::McCollisions; using TrackMCTrueTable = aod::McParticles; using CollisionMCRecTableCentFT0C = soa::SmallGroups>; - using TrackMCRecTable = soa::Join; + using TrackMCRecTable = soa::Join; using FilTrackMCRecTable = soa::Filtered; ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for bin"}; @@ -582,6 +581,11 @@ struct phianalysisrun3_PbPb { if (!collision.sel8() || std::abs(collision.mcCollision().posZ()) > cfgCutVertex) { continue; } + int occupancy = collision.trackOccupancyInTimeRange(); + if (fillOccupancy && occupancy > cfgOccupancyCut) // occupancy info is available for this collision (*) + { + continue; + } multiplicity = collision.centFT0C(); histos.fill(HIST("Centgen"), multiplicity); SelectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); @@ -631,6 +635,11 @@ struct phianalysisrun3_PbPb { if (std::abs(collision.mcCollision().posZ()) > cfgCutVertex || !collision.sel8()) { return; } + int occupancy = collision.trackOccupancyInTimeRange(); + if (fillOccupancy && occupancy > cfgOccupancyCut) // occupancy info is available for this collision (*) + { + return; + } auto multiplicity = collision.centFT0C(); histos.fill(HIST("Centrec"), multiplicity); histos.fill(HIST("hMC"), 5.5); From 7ddac796205d166d28b95c559a910aa922b46c69 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Tue, 3 Dec 2024 17:06:09 +0100 Subject: [PATCH 230/459] [PWGCF] DptDpt - Efficiency and QC fixing linter errors on file name (#8796) Co-authored-by: Victor --- PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt | 4 ++-- .../{dptdptEfficiencyAndQc.cxx => dptDptEfficiencyAndQc.cxx} | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename PWGCF/TwoParticleCorrelations/Tasks/{dptdptEfficiencyAndQc.cxx => dptDptEfficiencyAndQc.cxx} (99%) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index bf93c33d24c..bb41ca1ccab 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -33,8 +33,8 @@ o2physics_add_dpl_workflow(identifiedbf-filter-qa PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(dptdpt-efficiency-and-qc - SOURCES dptdptEfficiencyAndQc.cxx +o2physics_add_dpl_workflow(dpt-dpt-efficiency-and-qc + SOURCES dptDptEfficiencyAndQc.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/dptdptEfficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx similarity index 99% rename from PWGCF/TwoParticleCorrelations/Tasks/dptdptEfficiencyAndQc.cxx rename to PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx index 6d8bff1d6a0..890a2c78fdc 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/dptdptEfficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file dptdptEfficiencyAndQc.cxx +/// \file dptDptEfficiencyAndQc.cxx /// \brief Provides efficiency extraction and QC for track cuts and PID /// \author victor.gonzalez.sebastian@gmail.com From c38ac2897e1d9cee8488c6b45aae53c4e9c5fbbe Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Wed, 4 Dec 2024 07:34:09 +0100 Subject: [PATCH 231/459] [Common] TrackQA: Add converter for _000 to _001 (#8404) --- .../TableProducer/Converters/CMakeLists.txt | 5 ++ .../Converters/trackQAConverter.cxx | 60 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 Common/TableProducer/Converters/trackQAConverter.cxx diff --git a/Common/TableProducer/Converters/CMakeLists.txt b/Common/TableProducer/Converters/CMakeLists.txt index 48aba0a771a..0bf0ff823d4 100644 --- a/Common/TableProducer/Converters/CMakeLists.txt +++ b/Common/TableProducer/Converters/CMakeLists.txt @@ -83,3 +83,8 @@ o2physics_add_dpl_workflow(multmcextras-converter SOURCES multMCExtrasConverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(trackqa-converter + SOURCES trackQAConverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/Common/TableProducer/Converters/trackQAConverter.cxx b/Common/TableProducer/Converters/trackQAConverter.cxx new file mode 100644 index 00000000000..bdfecbca8d0 --- /dev/null +++ b/Common/TableProducer/Converters/trackQAConverter.cxx @@ -0,0 +1,60 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" + +using namespace o2; +using namespace o2::framework; + +struct trackQAConverter { + Produces tracksQA_001; + + void process(aod::TracksQA_000 const& tracksQA_000) + { + for (const auto& trackQA : tracksQA_000) { + tracksQA_001( + trackQA.trackId(), + trackQA.tpcTime0(), + trackQA.tpcdcaR(), + trackQA.tpcdcaZ(), + trackQA.tpcClusterByteMask(), + trackQA.tpcdEdxMax0R(), + trackQA.tpcdEdxMax1R(), + trackQA.tpcdEdxMax2R(), + trackQA.tpcdEdxMax3R(), + trackQA.tpcdEdxTot0R(), + trackQA.tpcdEdxTot1R(), + trackQA.tpcdEdxTot2R(), + trackQA.tpcdEdxTot3R(), + // dummy values, not available in _000 + std::numeric_limits::min(), // deltaRefContParamY + std::numeric_limits::min(), // deltaRefContParamZ + std::numeric_limits::min(), // deltaRefContParamSnp + std::numeric_limits::min(), // deltaRefContParamTgl + std::numeric_limits::min(), // deltaRefContParamQ2Pt + std::numeric_limits::min(), // deltaRefGloParamY + std::numeric_limits::min(), // deltaRefGloParamZ + std::numeric_limits::min(), // deltaRefGloParamSnp + std::numeric_limits::min(), // deltaRefGloParamTgl + std::numeric_limits::min()); // deltaRefGloParamQ2Pt + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + }; +} From d91612722bb1bb516e45eb894fc7ed7b11cf0283 Mon Sep 17 00:00:00 2001 From: kkimura0623 Date: Wed, 4 Dec 2024 17:23:43 +0900 Subject: [PATCH 232/459] [PWGDQ] Add calculation of muon pair production rate asymmetry (#8759) Co-authored-by: kkimura0623 --- PWGDQ/Core/HistogramsLibrary.cxx | 26 ++++++++++++++++++++++++++ PWGDQ/Core/VarManager.cxx | 2 ++ PWGDQ/Core/VarManager.h | 11 +++++++++++ 3 files changed, 39 insertions(+) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index af804d121b9..5e9180c6a8a 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -1030,6 +1030,18 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS_phiCS", "", 4, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE); hm->AddHistogram(histClass, "Mass_y_cosThetaCS_phiCS", "", 4, varsrapCS, binsy, xminy, xmaxy, 0, -1, kFALSE); } + if (subGroupStr.Contains("dimuon-polarization-vp")) { + int varspTCS[3] = {VarManager::kMass, VarManager::kPt, VarManager::kPhiVP}; + int varsrapCS[3] = {VarManager::kMass, VarManager::kRap, VarManager::kPhiVP}; + int binspT[3] = {100, 20, 24}; + int binsy[3] = {100, 10, 24}; + double xminpT[3] = {1., 0., 0.}; + double xmaxpT[3] = {5., 20., +3.14}; + double xminy[3] = {1., 2.5, 0.}; + double xmaxy[3] = {5., 4.0, +3.14}; + hm->AddHistogram(histClass, "Mass_Pt_phiVP", "", 3, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE); + hm->AddHistogram(histClass, "Mass_y_phiVP", "", 3, varsrapCS, binsy, xminy, xmaxy, 0, -1, kFALSE); + } if (subGroupStr.Contains("dimuon-rap")) { int vars[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kRap}; int binspT[4] = {150, 200, 10, 6}; @@ -1065,6 +1077,20 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h double xmaxpT[5] = {1.2, 3., 100, 1., 3.14}; hm->AddHistogram(histClass, "Mass_Pt_Cent_cosThetaCS_lowmass", "", 5, varsCSpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); } + if (subGroupStr.Contains("dimuon-polarization-vp-pbpb")) { + int varsHEpbpb[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kPhiVP}; + int binspT[4] = {150, 30, 10, 24}; + double xminpT[4] = {2., 0., 0, 0.}; + double xmaxpT[4] = {5., 3., 100, 3.14}; + hm->AddHistogram(histClass, "Mass_Pt_Cent_phiVP", "", 4, varsHEpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); + } + if (subGroupStr.Contains("dimuon-polarization-lowmass-vp-pbpb")) { + int varsHEpbpb[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kPhiVP}; + int binspT[4] = {200, 30, 10, 24}; + double xminpT[4] = {0.2, 0., 0, 0.}; + double xmaxpT[4] = {1.2, 3., 100, 3.14}; + hm->AddHistogram(histClass, "Mass_Pt_Cent_phiVP_lowmass", "", 4, varsHEpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); + } if (subGroupStr.Contains("dimuon-rap-polarization-he-pbpb")) { int varsHEpbpb[5] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kCosThetaHE, VarManager::kRap}; int binspT[5] = {150, 30, 10, 10, 6}; diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index bd9055b6cdc..537afde077b 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -863,6 +863,8 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kCosThetaCS] = ""; fgVariableNames[kPhiCS] = "#varphi_{CS}"; fgVariableUnits[kPhiCS] = "rad."; + fgVariableNames[kPhiVP] = "#varphi_{VP} - #Psi_{2}"; + fgVariableUnits[kPhiVP] = "rad."; fgVariableNames[kDeltaPhiPair2] = "#Delta#phi"; fgVariableUnits[kDeltaPhiPair2] = "rad."; fgVariableNames[kDeltaEtaPair2] = "#Delta#eta"; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 6b0af177765..9e10ea58049 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -611,6 +611,7 @@ class VarManager : public TObject kCosThetaCS, kPhiHE, kPhiCS, + kPhiVP, kDeltaPhiPair2, kDeltaEtaPair2, kPsiPair, @@ -4335,6 +4336,16 @@ void VarManager::FillPairVn(T1 const& t1, T2 const& t2, float* values) values[kCORR2REF] = std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) ? 0 : values[kCORR2REF]; values[kCORR4REF] = std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kCORR4REF]; } + + ROOT::Math::PtEtaPhiMVector v1_vp(v1.Pt(), v1.Eta(), v1.Phi() - Psi2B, v1.M()); + ROOT::Math::PtEtaPhiMVector v2_vp(v2.Pt(), v2.Eta(), v2.Phi() - Psi2B, v2.M()); + ROOT::Math::PtEtaPhiMVector v12_vp = v1_vp + v2_vp; + auto p12_vp = ROOT::Math::XYZVectorF(v12_vp.Px(), v12_vp.Py(), v12_vp.Pz()); + auto p12_vp_projXZ = ROOT::Math::XYZVectorF(p12_vp.X(), 0, p12_vp.Z()); + auto vDimu = (t1.sign() > 0 ? ROOT::Math::XYZVectorF(v1_vp.Px(), v1_vp.Py(), v1_vp.Pz()).Cross(ROOT::Math::XYZVectorF(v2_vp.Px(), v2_vp.Py(), v2_vp.Pz())) + : ROOT::Math::XYZVectorF(v2_vp.Px(), v2_vp.Py(), v2_vp.Pz()).Cross(ROOT::Math::XYZVectorF(v1_vp.Px(), v1_vp.Py(), v1_vp.Pz()))); + auto vRef = p12_vp.Cross(p12_vp_projXZ); + values[kPhiVP] = std::acos(vDimu.Dot(vRef) / (vRef.R() * vDimu.R())); } template From e2c2cc38827e2adcca73987b1415aa43473d7290 Mon Sep 17 00:00:00 2001 From: Yash Patley <52608802+yashpatley@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:53:57 +0530 Subject: [PATCH 233/459] [PWGCF] Update lambdaR2Correlation.cxx (#8779) --- .../Tasks/lambdaR2Correlation.cxx | 1171 ++++++++--------- 1 file changed, 519 insertions(+), 652 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx index 55222b26eb4..fa0d783fe52 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file lambdaCorrelationAnalysis.cxx +/// \file lambdaR2Correlation.cxx /// \brief R2 correlation of Lambda baryons. /// \author Yash Patley @@ -33,6 +33,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::constants::physics; +using namespace o2::constants::math; namespace o2::aod { @@ -50,11 +51,11 @@ using LambdaCollision = LambdaCollisions::iterator; namespace lambdamcgencollision { } -DECLARE_SOA_TABLE(LambdaMCGenCollisions, "AOD", "LMCGENCOLS", o2::soa::Index<>, +DECLARE_SOA_TABLE(LambdaMcGenCollisions, "AOD", "LMCGENCOLS", o2::soa::Index<>, o2::aod::mccollision::PosX, o2::aod::mccollision::PosY, o2::aod::mccollision::PosZ); -using LambdaMCGenCollision = LambdaMCGenCollisions::iterator; +using LambdaMcGenCollision = LambdaMcGenCollisions::iterator; namespace lambdatrack { @@ -67,11 +68,12 @@ DECLARE_SOA_COLUMN(Eta, eta, float); DECLARE_SOA_COLUMN(Phi, phi, float); DECLARE_SOA_COLUMN(Rap, rap, float); DECLARE_SOA_COLUMN(Mass, mass, float); -DECLARE_SOA_COLUMN(PosTrackId, postrackid, int64_t); -DECLARE_SOA_COLUMN(NegTrackId, negtrackid, int64_t); -DECLARE_SOA_COLUMN(V0Type, v0type, int8_t); -DECLARE_SOA_COLUMN(Cospa, cospa, float); -DECLARE_SOA_COLUMN(DcaDau, dcadau, float); +DECLARE_SOA_COLUMN(PosTrackId, posTrackId, int64_t); +DECLARE_SOA_COLUMN(NegTrackId, negTrackId, int64_t); +DECLARE_SOA_COLUMN(V0Type, v0Type, int8_t); +DECLARE_SOA_COLUMN(CosPA, cosPA, float); +DECLARE_SOA_COLUMN(DcaDau, dcaDau, float); +DECLARE_SOA_COLUMN(CorrFact, corrFact, float); } // namespace lambdatrack DECLARE_SOA_TABLE(LambdaTracks, "AOD", "LAMBDATRACKS", o2::soa::Index<>, lambdatrack::LambdaCollisionId, @@ -86,16 +88,17 @@ DECLARE_SOA_TABLE(LambdaTracks, "AOD", "LAMBDATRACKS", o2::soa::Index<>, lambdatrack::PosTrackId, lambdatrack::NegTrackId, lambdatrack::V0Type, - lambdatrack::Cospa, - lambdatrack::DcaDau); + lambdatrack::CosPA, + lambdatrack::DcaDau, + lambdatrack::CorrFact); using LambdaTrack = LambdaTracks::iterator; namespace lambdamcgentrack { -DECLARE_SOA_INDEX_COLUMN(LambdaMCGenCollision, lambdaMcGenCollision); +DECLARE_SOA_INDEX_COLUMN(LambdaMcGenCollision, lambdaMcGenCollision); } -DECLARE_SOA_TABLE(LambdaMCGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, - lambdamcgentrack::LambdaMCGenCollisionId, +DECLARE_SOA_TABLE(LambdaMcGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, + lambdamcgentrack::LambdaMcGenCollisionId, o2::aod::mcparticle::Px, o2::aod::mcparticle::Py, o2::aod::mcparticle::Pz, @@ -107,9 +110,10 @@ DECLARE_SOA_TABLE(LambdaMCGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, lambdatrack::PosTrackId, lambdatrack::NegTrackId, lambdatrack::V0Type, - lambdatrack::Cospa, - lambdatrack::DcaDau); -using LambdaMCGenTrack = LambdaMCGenTracks::iterator; + lambdatrack::CosPA, + lambdatrack::DcaDau, + lambdatrack::CorrFact); +using LambdaMcGenTrack = LambdaMcGenTracks::iterator; } // namespace o2::aod @@ -129,69 +133,91 @@ enum RecGenType { kGen }; -struct lambdaCorrTableProducer { +enum DMCType { + kData = 0, + kMC +}; + +struct LambdaCorrTableProducer { Produces lambdaCollisionTable; Produces lambdaTrackTable; - Produces lambdaMCGenCollisionTable; - Produces lambdaMCGenTrackTable; + Produces lambdaMCGenCollisionTable; + Produces lambdaMCGenTrackTable; // Collisions - Configurable cfg_min_z_vtx{"cfg_min_z_vtx", -10.0, "z vertex cut"}; - Configurable cfg_max_z_vtx{"cfg_max_z_vtx", 10.0, "z vertex cut"}; - Configurable cfg_sel8_sel{"cfg_sel8_sel", true, "Sel8 (T0A + T0C) Selection"}; - Configurable cfg_trigger_tvx_sel{"cfg_trigger_tvx_sel", false, "Trigger Time and Vertex Selection"}; - Configurable cfg_tf_border{"cfg_tf_border", false, "Timeframe Border Selection"}; - Configurable cfg_noitsro_border{"cfg_noitsro_border", false, "No ITSRO Border Cut"}; - Configurable cfg_itstpc_vtx{"cfg_itstpc_vtx", false, "ITS+TPC Vertex Selection"}; - Configurable cfg_pileup_reject{"cfg_pileup_reject", false, "Pileup rejection"}; - Configurable cfg_zvtx_time_diff{"cfg_zvtx_time_diff", false, "z-vtx time diff selection"}; + Configurable cMinZVtx{"cMinZVtx", -10.0, "z vertex cut"}; + Configurable cMaxZVtx{"cMaxZVtx", 10.0, "z vertex cut"}; + Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection"}; + Configurable cTriggerTvxSel{"cTriggerTvxSel", false, "Trigger Time and Vertex Selection"}; + Configurable cTFBorder{"cTFBorder", false, "Timeframe Border Selection"}; + Configurable cNoItsROBorder{"cNoItsROBorder", false, "No ITSRO Border Cut"}; + Configurable cItsTpcVtx{"cItsTpcVtx", false, "ITS+TPC Vertex Selection"}; + Configurable cPileupReject{"cPileupReject", false, "Pileup rejection"}; + Configurable cZVtxTimeDiff{"cZVtxTimeDiff", false, "z-vtx time diff selection"}; // Tracks - Configurable cfg_pt_min{"cfg_pt_min", 0.2, "p_{T} minimum"}; - Configurable cfg_pt_max{"cfg_pt_max", 4.0, "p_{T} minimum"}; - Configurable cfg_eta_cut{"cfg_eta_cut", 0.8, "Pseudorapidity cut"}; - Configurable cfg_min_crossed_rows{"cfg_min_crossed_rows", 70, "min crossed rows"}; - Configurable cfg_tpc_nsigma{"cfg_tpc_nsigma", 2.0, "TPC NSigma Selection Cut"}; - Configurable cfg_track_dcaXY_min{"cfg_track_dcaXY_min", 0.05, "Minimum DcaXY of Daughter Tracks"}; + Configurable cTrackMinPt{"cTrackMinPt", 0.2, "p_{T} minimum"}; + Configurable cTrackMaxPt{"cTrackMaxPt", 4.0, "p_{T} minimum"}; + Configurable cTrackEtaCut{"cTrackEtaCut", 0.8, "Pseudorapidity cut"}; + Configurable cMinTpcCrossedRows{"cMinTpcCrossedRows", 70, "min crossed rows"}; + Configurable cTpcNsigmaCut{"cTpcNsigmaCut", 2.0, "TPC NSigma Selection Cut"}; + Configurable cTrackMinDcaXY{"cTrackMinDcaXY", 0.05, "Minimum DcaXY of Daughter Tracks"}; // V0s - Configurable cfg_min_dca_V0_daughters{"cfg_min_dca_V0_daughters", 1.0, "min DCA between V0 daughters"}; - Configurable cfg_min_dca_pos_to_PV{"cfg_min_dca_pos_to_PV", 0.1, "Minimum V0 Positive Track DCAr cut to PV"}; - Configurable cfg_min_dca_neg_to_PV{"cfg_min_dca_neg_to_PV", 0.1, "Minimum V0 Negative Track DCAr cut to PV"}; - Configurable cfg_min_dca_V0_to_PV{"cfg_min_dca_V0_to_PV", 0.6, "Minimum DCA V0 to PV"}; - Configurable cfg_min_V0_radius{"cfg_min_V0_radius", 0.0, "Minimum V0 radius from PV"}; - Configurable cfg_max_V0_radius{"cfg_max_V0_radius", 50.0, "Maximum V0 radius from PV"}; - Configurable cfg_min_ctau{"cfg_min_ctau", 0.0, "Minimum ctau"}; - Configurable cfg_max_ctau{"cfg_max_ctau", 50.0, "Maximum ctau"}; - Configurable cfg_min_V0_cosPA{"cfg_min_V0_cosPA", 0.998, "Minimum V0 CosPA to PV"}; - Configurable cfg_lambda_mass_window{"cfg_lambda_mass_window", 0.007, "Mass Window to select Lambda"}; - Configurable cfg_kshort_rej{"cfg_kshort_rej", 0.005, "Reject K0Short Candidates"}; - Configurable cfg_kshort_rej_flag{"cfg_kshort_rej_flag", false, "K0short Mass Rej Flag"}; - Configurable cfg_armpod_flag{"cfg_armpod_flag", true, "Armentros-Podolanski Cut Flag"}; - Configurable cfg_armpod_val{"cfg_armpod_val", 0.5, "Armentros-Podolanski Slope Parameter"}; + Configurable cMinV0DcaDaughters{"cMinV0DcaDaughters", 1.0, "min DCA between V0 daughters"}; + Configurable cMinDcaPosToPV{"cMinDcaPosToPV", 0.1, "Minimum V0 Positive Track DCAr cut to PV"}; + Configurable cMinDcaNegToPV{"cMinDcaNegToPV", 0.1, "Minimum V0 Negative Track DCAr cut to PV"}; + Configurable cMinDcaV0ToPV{"cMinDcaV0ToPV", 0.6, "Minimum DCA V0 to PV"}; + Configurable cMinV0TransRadius{"cMinV0TransRadius", 0.0, "Minimum V0 radius from PV"}; + Configurable cMaxV0TransRadius{"cMaxV0TransRadius", 50.0, "Maximum V0 radius from PV"}; + Configurable cMinV0CTau{"cMinV0CTau", 0.0, "Minimum ctau"}; + Configurable cMaxV0CTau{"cMaxV0CTau", 50.0, "Maximum ctau"}; + Configurable cMinV0CosPA{"cMinV0CosPA", 0.998, "Minimum V0 CosPA to PV"}; + Configurable cLambdaMassWindow{"cLambdaMassWindow", 0.007, "Mass Window to select Lambda"}; + Configurable cKshortRejMassWindow{"cKshortRejMassWindow", 0.005, "Reject K0Short Candidates"}; + Configurable cKshortRejFlag{"cKshortRejFlag", false, "K0short Mass Rej Flag"}; + Configurable cArmPodCutValue{"cArmPodCutValue", 0.5, "Armentros-Podolanski Slope Parameter"}; + Configurable cArmPodCutFlag{"cArmPodCutFlag", true, "Armentros-Podolanski Cut Flag"}; // V0s kinmatic acceptance - Configurable cfg_v0_pt_min{"cfg_v0_pt_min", 0.3, "Minimum V0 pT"}; - Configurable cfg_v0_pt_max{"cfg_v0_pt_max", 3.0, "Minimum V0 pT"}; - Configurable cfg_v0_rap_max{"cfg_v0_rap_max", 0.8, "|rap| cut"}; - - // bool eta/rapidity - Configurable cfg_do_eta_analysis{"cfg_do_eta_analysis", false, "Eta Analysis"}; + Configurable cMinV0Pt{"cMinV0Pt", 0.8, "Minimum V0 pT"}; + Configurable cMaxV0Pt{"cMaxV0Pt", 3.2, "Minimum V0 pT"}; + Configurable cMaxV0Rap{"cMaxV0Rap", 0.6, "|rap| cut"}; // V0s MC - Configurable cfg_has_mc_flag{"cfg_has_mc_flag", true, "Has Mc Tag"}; - Configurable cfg_rec_primary_lambda{"cfg_rec_primary_lambda", false, "Primary Lambda"}; - Configurable cfg_rec_secondary_lambda{"cfg_rec_secondary_lambda", false, "Secondary Lambda"}; - Configurable cfg_rec_pid_flag{"cfg_rec_pid_flag", false, "PID Flag"}; - Configurable cfg_gen_primary_lambda{"cfg_gen_primary_lambda", true, "Primary Lambda"}; + Configurable cHasMcFlag{"cHasMcFlag", true, "Has Mc Tag"}; + Configurable cSelectTrueLambda{"cSelectTrueLambda", true, "Select True Lambda"}; + Configurable cRecPrimaryLambda{"cRecPrimaryLambda", true, "Primary Lambda"}; + Configurable cGenPrimaryLambda{"cGenPrimaryLambda", true, "Primary Lambda"}; + + // Efficiency Correction + Configurable cCorrectionFlag{"cCorrectionFlag", true, "Efficiency Correction Flag"}; + Configurable cCorrFactHistType{"cCorrFactHistType", 0, "Histogram Type {TH1F, TH2F, TH3F}"}; + + // CCDB + Configurable cUrlCCDB{"cUrlCCDB", "http://ccdb-test.cern.ch:8080", "url of ccdb"}; + Configurable cPathCCDB{"cPathCCDB", "Users/y/ypatley/lambda_corr_fact", "Path for ccdb-object"}; + + // Initialize CCDB Service + Service ccdb; // Histogram Registry. HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + // initialize corr_factor objects + std::vector> vCorrFactStrings = {{"h1f_LaP_cf", "h1f_LaM_cf"}, + {"h2f_LaP_cf", "h2f_LaM_cf"}, + {"h3f_LaP_cf", "h3f_LaM_cf"}}; + void init(InitContext const&) { - const AxisSpec axisCol(10, 0, 10, ""); + // Set CCDB url + ccdb->setURL(cUrlCCDB.value); + ccdb->setCaching(true); + + // initialize axis specifications + const AxisSpec axisCol(20, 0, 20, ""); const AxisSpec axisCent(105, 0, 105, "FT0M (%)"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisVz(220, -11, 11, "V_{z} (cm)"); @@ -201,7 +227,7 @@ struct lambdaCorrTableProducer { const AxisSpec axisV0Pt(32, 0.3, 3.5, "p_{T} (GeV/#it{c})"); const AxisSpec axisV0Rap(24, -1.2, 1.2, "y"); const AxisSpec axisV0Eta(24, -1.2, 1.2, "#eta"); - const AxisSpec axisV0Phi(36, 0., 2. * TMath::Pi(), "#phi (rad)"); + const AxisSpec axisV0Phi(36, 0., TwoPI, "#phi (rad)"); const AxisSpec axisRadius(400, 0, 200, "r(cm)"); const AxisSpec axisCosPA(100, 0.99, 1.0, "cos(#theta_{PA})"); @@ -221,125 +247,94 @@ struct lambdaCorrTableProducer { // Create Histograms. // Event histograms - histos.add("Event/h1d_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); - histos.add("Event/h1d_collisions_info", "# of Collisions", kTH1F, {axisCol}); + histos.add("Events/h1f_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); + histos.add("Events/h1f_collisions_info", "# of Collisions", kTH1F, {axisCol}); // QA - histos.add("QA_Checks/h1d_tracks_info", "# of tracks", kTH1F, {axisCol}); - histos.add("QA_Checks/h1d_lambda_mass", "M_{#Lambda}", kTH1F, {axisV0Mass}); - histos.add("QA_Checks/h1d_antilambda_mass", "M_{#Lambda}", kTH1F, {axisV0Mass}); - histos.add("QA_Checks/h2d_lambda_pt_vs_mass", "p_{T} vs M_{#Lambda}", kTH2F, {axisV0Mass, axisV0Pt}); - histos.add("QA_Checks/h2d_antilambda_pt_vs_mass", "p_{T} vs M_{#Lambda}", kTH2F, {axisV0Mass, axisV0Pt}); - histos.add("QA_Checks/h2d_before_topo_cuts_pt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); - histos.add("QA_Checks/h2d_after_topo_cuts_pt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); - histos.add("QA_Checks/h2d_before_masswincut_pt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); - histos.add("QA_Checks/h2d_after_masswincut_pt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); + histos.add("Tracks/h1f_tracks_info", "# of tracks", kTH1F, {axisCol}); + histos.add("Tracks/h2f_armpod_before_sel", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); + histos.add("Tracks/h2f_armpod_after_sel", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); + histos.add("Tracks/h1f_lambda_pt_vs_invm", "p_{T} vs M_{#Lambda}", kTH2F, {axisV0Mass, axisV0Pt}); + histos.add("Tracks/h1f_antilambda_pt_vs_invm", "p_{T} vs M_{#bar{#Lambda}}", kTH2F, {axisV0Mass, axisV0Pt}); // QA Lambda - histos.add("QA_Sel_Lambda/h1d_V0_inv_mass", "V_{0} mass", kTH1F, {axisV0Mass}); - histos.add("QA_Sel_Lambda/h1d_V0_pt", "V_{0} p_{T}", kTH1F, {axisV0Pt}); - histos.add("QA_Sel_Lambda/h1d_V0_eta", "#eta-distribution", kTH1F, {axisV0Eta}); - histos.add("QA_Sel_Lambda/h1d_V0_rap", "y-distribution", kTH1F, {axisV0Rap}); - histos.add("QA_Sel_Lambda/h1d_V0_phi", "#phi-distribution", kTH1F, {axisV0Phi}); - histos.add("QA_Sel_Lambda/h2d_V0_pt_vs_eta", "p_{T} vs #eta", kTH2F, {axisV0Eta, axisV0Pt}); - histos.add("QA_Sel_Lambda/h2d_V0_pt_vs_rap", "p_{T} vs y", kTH2F, {axisV0Rap, axisV0Pt}); - histos.add("QA_Sel_Lambda/h2d_V0_pt_vs_phi", "p_{T} vs #phi", kTH2F, {axisV0Phi, axisV0Pt}); - histos.add("QA_Sel_Lambda/h2d_V0_pt_vs_mass", "p_{T} vs M_{p#pi}", kTH2F, {axisV0Mass, axisV0Pt}); - - histos.add("QA_Sel_Lambda/h1d_dca_V0_daughters", "DCA between V0 daughters", kTH1F, {axisDcaDau}); - histos.add("QA_Sel_Lambda/h1d_dca_pos_to_PV", "DCA positive prong to PV", kTH1F, {axisDcaProngPV}); - histos.add("QA_Sel_Lambda/h1d_dca_neg_to_PV", "DCA negative prong to PV", kTH1F, {axisDcaProngPV}); - histos.add("QA_Sel_Lambda/h1d_dca_V0_to_PV", "DCA V0 to PV", kTH1F, {axisDcaV0PV}); - histos.add("QA_Sel_Lambda/h1d_V0_cospa", "cos(#theta_{PA})", kTH1F, {axisCosPA}); - histos.add("QA_Sel_Lambda/h1d_V0_radius", "V_{0} Decay Radius in XY plane", kTH1F, {axisRadius}); - histos.add("QA_Sel_Lambda/h1d_V0_ctau", "V_{0} c#tau", kTH1F, {axisCTau}); - histos.add("QA_Sel_Lambda/h1d_V0_gctau", "V_{0} #gammac#tau", kTH1F, {axisGCTau}); - histos.add("QA_Sel_Lambda/h2d_qt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); - - histos.add("QA_Sel_Lambda/h1d_pos_prong_pt", "Pos-Prong p_{T}", kTH1F, {axisTrackPt}); - histos.add("QA_Sel_Lambda/h1d_neg_prong_pt", "Neg-Prong p_{T}", kTH1F, {axisTrackPt}); - histos.add("QA_Sel_Lambda/h1d_pos_prong_eta", "Pos-Prong #eta-distribution", kTH1F, {axisV0Eta}); - histos.add("QA_Sel_Lambda/h1d_neg_prong_eta", "Neg-Prong #eta-distribution", kTH1F, {axisV0Eta}); - histos.add("QA_Sel_Lambda/h1d_pos_prong_phi", "Pos-Prong #phi-distribution", kTH1F, {axisV0Phi}); - histos.add("QA_Sel_Lambda/h1d_neg_prong_phi", "Neg-Prong #phi-distribution", kTH1F, {axisV0Phi}); - - histos.add("QA_Sel_Lambda/h2d_pos_prong_dcaXY_vs_pt", "DCA vs p_{T}", kTH2F, {axisTrackPt, axisTrackDCA}); - histos.add("QA_Sel_Lambda/h2d_neg_prong_dcaXY_vs_pt", "DCA vs p_{T}", kTH2F, {axisTrackPt, axisTrackDCA}); - histos.add("QA_Sel_Lambda/h2d_pos_prong_dEdx_vs_p", "TPC Signal Pos-Prong", kTH2F, {axisMomPID, axisdEdx}); - histos.add("QA_Sel_Lambda/h2d_neg_prong_dEdx_vs_p", "TPC Signal Neg-Prong", kTH2F, {axisMomPID, axisdEdx}); - histos.add("QA_Sel_Lambda/h2d_pos_prong_tpc_nsigma_pr_vs_p", "TPC n#sigma Pos Prong", kTH2F, {axisMomPID, axisNsigma}); - histos.add("QA_Sel_Lambda/h2d_neg_prong_tpc_nsigma_pr_vs_p", "TPC n#sigma Neg Prong", kTH2F, {axisMomPID, axisNsigma}); - histos.add("QA_Sel_Lambda/h2d_pos_prong_tpc_nsigma_pi_vs_p", "TPC n#sigma Pos Prong", kTH2F, {axisMomPID, axisNsigma}); - histos.add("QA_Sel_Lambda/h2d_neg_prong_tpc_nsigma_pi_vs_p", "TPC n#sigma Neg Prong", kTH2F, {axisMomPID, axisNsigma}); + histos.add("QA/Lambda/h2f_qt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); + histos.add("QA/Lambda/h1f_dca_V0_daughters", "DCA between V0 daughters", kTH1F, {axisDcaDau}); + histos.add("QA/Lambda/h1f_dca_pos_to_PV", "DCA positive prong to PV", kTH1F, {axisDcaProngPV}); + histos.add("QA/Lambda/h1f_dca_neg_to_PV", "DCA negative prong to PV", kTH1F, {axisDcaProngPV}); + histos.add("QA/Lambda/h1f_dca_V0_to_PV", "DCA V0 to PV", kTH1F, {axisDcaV0PV}); + histos.add("QA/Lambda/h1f_V0_cospa", "cos(#theta_{PA})", kTH1F, {axisCosPA}); + histos.add("QA/Lambda/h1f_V0_radius", "V_{0} Decay Radius in XY plane", kTH1F, {axisRadius}); + histos.add("QA/Lambda/h1f_V0_ctau", "V_{0} c#tau", kTH1F, {axisCTau}); + histos.add("QA/Lambda/h1f_V0_gctau", "V_{0} #gammac#tau", kTH1F, {axisGCTau}); + + histos.add("QA/Lambda/h1f_pos_prong_pt", "Pos-Prong p_{T}", kTH1F, {axisTrackPt}); + histos.add("QA/Lambda/h1f_neg_prong_pt", "Neg-Prong p_{T}", kTH1F, {axisTrackPt}); + histos.add("QA/Lambda/h1f_pos_prong_eta", "Pos-Prong #eta-distribution", kTH1F, {axisV0Eta}); + histos.add("QA/Lambda/h1f_neg_prong_eta", "Neg-Prong #eta-distribution", kTH1F, {axisV0Eta}); + histos.add("QA/Lambda/h1f_pos_prong_phi", "Pos-Prong #phi-distribution", kTH1F, {axisV0Phi}); + histos.add("QA/Lambda/h1f_neg_prong_phi", "Neg-Prong #phi-distribution", kTH1F, {axisV0Phi}); + + histos.add("QA/Lambda/h2f_pos_prong_dcaXY_vs_pt", "DCA vs p_{T}", kTH2F, {axisTrackPt, axisTrackDCA}); + histos.add("QA/Lambda/h2f_neg_prong_dcaXY_vs_pt", "DCA vs p_{T}", kTH2F, {axisTrackPt, axisTrackDCA}); + histos.add("QA/Lambda/h2f_pos_prong_dEdx_vs_p", "TPC Signal Pos-Prong", kTH2F, {axisMomPID, axisdEdx}); + histos.add("QA/Lambda/h2f_neg_prong_dEdx_vs_p", "TPC Signal Neg-Prong", kTH2F, {axisMomPID, axisdEdx}); + histos.add("QA/Lambda/h2f_pos_prong_tpc_nsigma_pr_vs_p", "TPC n#sigma Pos Prong", kTH2F, {axisMomPID, axisNsigma}); + histos.add("QA/Lambda/h2f_neg_prong_tpc_nsigma_pr_vs_p", "TPC n#sigma Neg Prong", kTH2F, {axisMomPID, axisNsigma}); + histos.add("QA/Lambda/h2f_pos_prong_tpc_nsigma_pi_vs_p", "TPC n#sigma Pos Prong", kTH2F, {axisMomPID, axisNsigma}); + histos.add("QA/Lambda/h2f_neg_prong_tpc_nsigma_pi_vs_p", "TPC n#sigma Neg Prong", kTH2F, {axisMomPID, axisNsigma}); // QA Anti-Lambda - histos.addClone("QA_Sel_Lambda/", "QA_Sel_AntiLambda/"); + histos.addClone("QA/Lambda/", "QA/AntiLambda/"); // MC Generated Histograms if (doprocessMCGen) { // McReco Histos - histos.add("QA_Checks/h2d_tracks_pid_before_sel", "PIDs", kTH2F, {axisPID, axisV0Pt}); - histos.add("QA_Checks/h2d_tracks_pid_after_sel", "PIDs", kTH2F, {axisPID, axisV0Pt}); - histos.add("QA_Checks/h2d_lambda_from_sigma", "PIDs", kTH2F, {axisPID, axisV0Pt}); - histos.add("QA_Checks/h2d_lambda_from_cascade", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_tracks_pid_before_sel", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_tracks_pid_after_sel", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_lambda_from_sigma", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_lambda_from_cascade", "PIDs", kTH2F, {axisPID, axisV0Pt}); // McGen Histos - histos.add("McGen/h1d_collisions_info", "# of collisions", kTH1F, {axisCol}); - histos.add("McGen/h1d_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); - histos.add("McGen/h1d_lambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); - histos.add("McGen/h1d_antilambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); - histos.add("McGen/h1d_mass_lambda", "M_{#Lambda}", kTH1F, {axisV0Mass}); - histos.add("McGen/h1d_pt_lambda", "#Lambda p_{T}", kTH1F, {axisV0Pt}); - histos.add("McGen/h1d_eta_lambda", "#Lambda #eta-distribution", kTH1F, {axisV0Eta}); - histos.add("McGen/h1d_y_lambda", "#Lambda y-distribution", kTH1F, {axisV0Rap}); - histos.add("McGen/h1d_phi_lambda", "#Lambda #phi-distribution", kTH1F, {axisV0Phi}); - histos.add("McGen/h2d_pteta_lambda", "#Lambda p_{T} vs #eta", kTH2F, {axisV0Eta, axisV0Pt}); - histos.add("McGen/h2d_ptrap_lambda", "#Lambda p_{T} vs y", kTH2F, {axisV0Rap, axisV0Pt}); - histos.add("McGen/h2d_ptphi_lambda", "#Lambda p_{T} vs #phi", kTH2F, {axisV0Phi, axisV0Pt}); - histos.add("McGen/h1d_mass_antilambda", "M_{#bar{#Lambda}}", kTH1F, {axisV0Mass}); - histos.add("McGen/h1d_pt_antilambda", "#bar{#Lambda} p_{T}", kTH1F, {axisV0Pt}); - histos.add("McGen/h1d_eta_antilambda", "#bar{#Lambda} #eta-distribution", kTH1F, {axisV0Eta}); - histos.add("McGen/h1d_y_antilambda", "#bar{#Lambda} y-distribution", kTH1F, {axisV0Rap}); - histos.add("McGen/h1d_phi_antilambda", "#bar{#Lambda} #phi-distribution", kTH1F, {axisV0Phi}); - histos.add("McGen/h2d_pteta_antilambda", "#bar{#Lambda} p_{T} vs #eta", kTH2F, {axisV0Eta, axisV0Pt}); - histos.add("McGen/h2d_ptrap_antilambda", "#bar{#Lambda} p_{T} vs y", kTH2F, {axisV0Rap, axisV0Pt}); - histos.add("McGen/h2d_ptphi_antilambda", "#bar{#Lambda} p_{T} vs #phi", kTH2F, {axisV0Phi, axisV0Pt}); + histos.add("McGen/h1f_collisions_info", "# of collisions", kTH1F, {axisCol}); + histos.add("McGen/h1f_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); + histos.add("McGen/h1f_lambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); + histos.add("McGen/h1f_antilambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); } } template - bool selCol(C const& col) + bool selCollision(C const& col) { - - if (col.posZ() < cfg_min_z_vtx || col.posZ() >= cfg_max_z_vtx) { + if (col.posZ() < cMinZVtx || col.posZ() >= cMaxZVtx) { return false; } - if (!col.sel8() && cfg_sel8_sel) { + if (!col.sel8() && cSel8Trig) { return false; } - if (!col.selection_bit(aod::evsel::kIsTriggerTVX) && cfg_trigger_tvx_sel) { + if (!col.selection_bit(aod::evsel::kIsTriggerTVX) && cTriggerTvxSel) { return false; } - if (!col.selection_bit(aod::evsel::kNoTimeFrameBorder) && cfg_tf_border) { + if (!col.selection_bit(aod::evsel::kNoTimeFrameBorder) && cTFBorder) { return false; } - if (!col.selection_bit(aod::evsel::kNoITSROFrameBorder) && cfg_noitsro_border) { + if (!col.selection_bit(aod::evsel::kNoITSROFrameBorder) && cNoItsROBorder) { return false; } - if (!col.selection_bit(aod::evsel::kIsVertexITSTPC) && cfg_itstpc_vtx) { + if (!col.selection_bit(aod::evsel::kIsVertexITSTPC) && cItsTpcVtx) { return false; } - if (!col.selection_bit(aod::evsel::kNoSameBunchPileup) && cfg_pileup_reject) { + if (!col.selection_bit(aod::evsel::kNoSameBunchPileup) && cPileupReject) { return false; } - if (!col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && cfg_zvtx_time_diff) { + if (!col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && cZVtxTimeDiff) { return false; } @@ -347,22 +342,21 @@ struct lambdaCorrTableProducer { } template - bool dauTrackSelection(T const& track) + bool selDaughterTracks(T const& track) { - - if (track.pt() < cfg_pt_min || track.pt() > cfg_pt_max) { + if (track.pt() < cTrackMinPt || track.pt() > cTrackMaxPt) { return false; } - if (fabs(track.eta()) >= cfg_eta_cut) { + if (std::abs(track.eta()) >= cTrackEtaCut) { return false; } - if (track.tpcNClsCrossedRows() < cfg_min_crossed_rows) { + if (track.tpcNClsCrossedRows() < cMinTpcCrossedRows) { return false; } - if (fabs(track.dcaXY()) < cfg_track_dcaXY_min) { + if (std::abs(track.dcaXY()) < cTrackMinDcaXY) { return false; } @@ -370,43 +364,69 @@ struct lambdaCorrTableProducer { } template - bool topologicalCutsV0(C const& col, V const& v0, T const&) + bool selLambdaWithTopoKinCuts(C const& col, V const& v0, T const&) { - auto postrack = v0.template posTrack_as(); auto negtrack = v0.template negTrack_as(); - if (!dauTrackSelection(postrack) || !dauTrackSelection(negtrack)) { + if (!selDaughterTracks(postrack) || !selDaughterTracks(negtrack)) { return false; } - if (v0.dcaV0daughters() > cfg_min_dca_V0_daughters) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 2.5); + + if (v0.dcaV0daughters() > cMinV0DcaDaughters) { return false; } - if (fabs(v0.dcapostopv()) < cfg_min_dca_pos_to_PV) { + if (std::abs(v0.dcapostopv()) < cMinDcaPosToPV) { return false; } - if (fabs(v0.dcanegtopv()) < cfg_min_dca_neg_to_PV) { + if (std::abs(v0.dcanegtopv()) < cMinDcaNegToPV) { return false; } - if (v0.dcav0topv() > cfg_min_dca_V0_to_PV) { + if (v0.dcav0topv() > cMinDcaV0ToPV) { return false; } - if ((v0.v0radius() > cfg_max_V0_radius) || (v0.v0radius() < cfg_min_V0_radius)) { + if ((v0.v0radius() > cMaxV0TransRadius) || (v0.v0radius() < cMinV0TransRadius)) { return false; } // ctau float ctau = v0.distovertotmom(col.posX(), col.posY(), col.posZ()) * MassLambda0; - if (ctau < cfg_min_ctau || ctau > cfg_max_ctau) { + if (ctau < cMinV0CTau || ctau > cMaxV0CTau) { + return false; + } + + // cosine of pointing angle + if (v0.v0cosPA() < cMinV0CosPA) { + return false; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), 3.5); + + // pT cut + if (v0.pt() <= cMinV0Pt || v0.pt() >= cMaxV0Pt) { + return false; + } + + // rapidity cut + if (std::abs(v0.yLambda()) >= cMaxV0Rap) { return false; } - if (v0.v0cosPA() < cfg_min_V0_cosPA) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 4.5); + + // Armentros-Podolanski Selection + if (cArmPodCutFlag && (std::abs(v0.alpha()) < v0.qtarm() / cArmPodCutValue)) { + return false; + } + + // Kshort mass rejection hypothesis + if (cKshortRejFlag && (std::abs(v0.mK0Short() - MassK0Short) <= cKshortRejMassWindow)) { return false; } @@ -414,9 +434,9 @@ struct lambdaCorrTableProducer { } template - bool selPIDTrack(T const& postrack, T const& negtrack) + bool selLambdaDauWithTpcPid(T const& postrack, T const& negtrack) { - bool return_flag = false; + bool returnFlag = false; float tpcNSigmaPr = 0., tpcNSigmaPi = 0.; switch (part) { @@ -433,62 +453,130 @@ struct lambdaCorrTableProducer { break; } - if (fabs(tpcNSigmaPr) < cfg_tpc_nsigma && fabs(tpcNSigmaPi) < cfg_tpc_nsigma) { - return_flag = true; + if (std::abs(tpcNSigmaPr) < cTpcNsigmaCut && std::abs(tpcNSigmaPi) < cTpcNsigmaCut) { + returnFlag = true; } - return return_flag; + return returnFlag; } - template - bool checkKinCuts(T const& v0track) + template + bool selLambdaMassWindow(V const& v0, T const&, ParticleType& v0type) { + // initialize daughter tracks + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); - // pT cut - if (v0track.pt() <= cfg_v0_pt_min || v0track.pt() >= cfg_v0_pt_max) { - return false; + // initialize selection flags + bool lambdaFlag = false, antiLambdaFlag = false; + + // get v0 track as lambda + if ((std::abs(v0.mLambda() - MassLambda0) < cLambdaMassWindow) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + lambdaFlag = true; + v0type = kLambda; } - // apply rapidity/pseudorapidity acceptance - float rap = 0.; - if (cfg_do_eta_analysis) { - rap = v0track.eta(); - } else { - rap = v0track.yLambda(); + // get v0 track as anti-lambda + if ((std::abs(v0.mAntiLambda() - MassLambda0) < cLambdaMassWindow) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + antiLambdaFlag = true; + v0type = kAntiLambda; } - if (fabs(rap) >= cfg_v0_rap_max) { + if (!lambdaFlag && !antiLambdaFlag) { // neither Lambda nor Anti-Lambda + histos.fill(HIST("Tracks/h1f_tracks_info"), 18.5); + return false; + } else if (lambdaFlag && antiLambdaFlag) { // check if the track is identified as lambda and anti-lambda both (DISCARD THIS TRACK) + histos.fill(HIST("Tracks/h1f_tracks_info"), 19.5); return false; } return true; } - template - void getPDGsIDs(T const& mcparts, std::vector& PDGs, std::vector& IDs) + template + bool selTrueMcRecLambda(V const& v0, T const&) { + auto mcpart = v0.template mcParticle_as(); - for (auto mcpart : mcparts) { - if (mcpart.globalIndex() != 0) { - IDs.push_back(mcpart.globalIndex()); - PDGs.push_back(mcpart.pdgCode()); - } + // check for lambda/anti-lambda + if (std::abs(mcpart.pdgCode()) != kLambda0) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 10.5); + return false; } - while (IDs.size() > 2) { - IDs.pop_back(); + // check for primary/secondary lambda + if (cRecPrimaryLambda && !mcpart.isPhysicalPrimary()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 11.5); + return false; + } else if (!cRecPrimaryLambda && mcpart.isPhysicalPrimary()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 12.5); + return false; } - while (PDGs.size() > 2) { - PDGs.pop_back(); + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); + + // check if the daughters have corresponding mcparticle + if (!postrack.has_mcParticle() || !negtrack.has_mcParticle()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 13.5); + return false; } + + auto mcpostrack = postrack.template mcParticle_as(); + auto mcnegtrack = negtrack.template mcParticle_as(); + + if (std::abs(mcpostrack.pdgCode()) != kProton || std::abs(mcnegtrack.pdgCode()) != kPiPlus) { // incorrect decay channel -> return false + histos.fill(HIST("Tracks/h1f_tracks_info"), 14.5); + return false; + } + + return true; } - template - void fillQALambda(C const& col, V const& v0, T const&) + template + float getCorrectionFactors(C const& col, V const& v0) { + // Check for efficiency correction flag and Rec/Gen Data + if (!cCorrectionFlag) { + return 1.; + } + + // Get from CCDB + auto ccdbObj = ccdb->getForTimeStamp(cPathCCDB.value, -1); - static constexpr std::string_view sub_dir[] = {"QA_Sel_Lambda/", "QA_Sel_AntiLambda/"}; + // Check CCDB Object + if (!ccdbObj) { + LOGF(warning, "CCDB OBJECT NOT FOUND"); + return 1.; + } + + // get ccdb object + TObject* obj = reinterpret_cast(ccdbObj->FindObject(Form("%s", vCorrFactStrings[cCorrFactHistType][part].c_str()))); + + if (obj->InheritsFrom("TH1F")) { + TH1F* hist = reinterpret_cast(obj->Clone()); + int ptBin = hist->GetXaxis()->FindBin(v0.pt()); + return hist->GetBinContent(ptBin); + } else if (obj->InheritsFrom("TH2F")) { + TH2F* hist = reinterpret_cast(obj->Clone()); + int ptBin = hist->GetXaxis()->FindBin(v0.pt()); + int rapBin = hist->GetYaxis()->FindBin(v0.yLambda()); + return hist->GetBinContent(ptBin, rapBin); + } else if (obj->InheritsFrom("TH3F")) { + TH3F* hist = reinterpret_cast(obj->Clone()); + int ptBin = hist->GetXaxis()->FindBin(v0.pt()); + int rapBin = hist->GetYaxis()->FindBin(v0.yLambda()); + int vzBin = hist->GetZaxis()->FindBin(col.posZ()); + return hist->GetBinContent(ptBin, rapBin, vzBin); + } else { + return 1.; + } + } + + template + void fillLambdaQAHistos(C const& col, V const& v0, T const&) + { + static constexpr std::string_view SubDir[] = {"QA/Lambda/", "QA/AntiLambda/"}; // daugthers auto postrack = v0.template posTrack_as(); @@ -507,168 +595,117 @@ struct lambdaCorrTableProducer { float ctau = v0.distovertotmom(col.posX(), col.posY(), col.posZ()) * MassLambda0; float gctau = ctau * gamma; - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_inv_mass"), mass); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_pt"), v0.pt()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_eta"), v0.eta()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_rap"), v0.yLambda()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_phi"), v0.phi()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_V0_pt_vs_eta"), v0.eta(), v0.pt()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_V0_pt_vs_rap"), v0.yLambda(), v0.pt()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_V0_pt_vs_phi"), v0.phi(), v0.pt()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_V0_pt_vs_mass"), mass, v0.pt()); - - histos.fill(HIST(sub_dir[part]) + HIST("h1d_dca_V0_daughters"), v0.dcaV0daughters()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_dca_pos_to_PV"), v0.dcapostopv()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_dca_neg_to_PV"), v0.dcanegtopv()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_dca_V0_to_PV"), v0.dcav0topv()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_cospa"), v0.v0cosPA()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_radius"), v0.v0radius()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_ctau"), ctau); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_V0_gctau"), gctau); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_qt_vs_alpha"), v0.alpha(), v0.qtarm()); - - histos.fill(HIST(sub_dir[part]) + HIST("h1d_pos_prong_pt"), postrack.pt()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_pos_prong_eta"), postrack.eta()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_pos_prong_phi"), postrack.phi()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_neg_prong_pt"), negtrack.pt()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_neg_prong_eta"), negtrack.eta()); - histos.fill(HIST(sub_dir[part]) + HIST("h1d_neg_prong_phi"), negtrack.phi()); - - histos.fill(HIST(sub_dir[part]) + HIST("h2d_pos_prong_dcaXY_vs_pt"), postrack.pt(), postrack.dcaXY()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_neg_prong_dcaXY_vs_pt"), negtrack.pt(), negtrack.dcaXY()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_pos_prong_dEdx_vs_p"), postrack.tpcInnerParam(), postrack.tpcSignal()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_neg_prong_dEdx_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcSignal()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_pos_prong_tpc_nsigma_pr_vs_p"), postrack.tpcInnerParam(), postrack.tpcNSigmaPr()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_neg_prong_tpc_nsigma_pr_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPr()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_pos_prong_tpc_nsigma_pi_vs_p"), postrack.tpcInnerParam(), postrack.tpcNSigmaPi()); - histos.fill(HIST(sub_dir[part]) + HIST("h2d_neg_prong_tpc_nsigma_pi_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPi()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_qt_vs_alpha"), v0.alpha(), v0.qtarm()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_dca_V0_daughters"), v0.dcaV0daughters()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_dca_pos_to_PV"), v0.dcapostopv()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_dca_neg_to_PV"), v0.dcanegtopv()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_dca_V0_to_PV"), v0.dcav0topv()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_V0_cospa"), v0.v0cosPA()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_V0_radius"), v0.v0radius()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_V0_ctau"), ctau); + histos.fill(HIST(SubDir[part]) + HIST("h1f_V0_gctau"), gctau); + + histos.fill(HIST(SubDir[part]) + HIST("h1f_pos_prong_pt"), postrack.pt()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_pos_prong_eta"), postrack.eta()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_pos_prong_phi"), postrack.phi()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_neg_prong_pt"), negtrack.pt()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_neg_prong_eta"), negtrack.eta()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_neg_prong_phi"), negtrack.phi()); + + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_dcaXY_vs_pt"), postrack.pt(), postrack.dcaXY()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_dcaXY_vs_pt"), negtrack.pt(), negtrack.dcaXY()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_dEdx_vs_p"), postrack.tpcInnerParam(), postrack.tpcSignal()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_dEdx_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcSignal()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_tpc_nsigma_pr_vs_p"), postrack.tpcInnerParam(), postrack.tpcNSigmaPr()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_tpc_nsigma_pr_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPr()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_tpc_nsigma_pi_vs_p"), postrack.tpcInnerParam(), postrack.tpcNSigmaPi()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_tpc_nsigma_pi_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPi()); } - template - void selV0Particle(C const& collision, V const& v0track, T const& tracks) + template + void fillLambdaTables(C const& collision, V const& v0tracks, T const& tracks) { - - // apply kinematic cuts - if (!checkKinCuts(v0track)) { - return; - } - - // initialize daughter tracks - auto postrack = v0track.template posTrack_as(); - auto negtrack = v0track.template negTrack_as(); - - // initialize mass and v0lambda/v0antilambda - float mass = 0.; - ParticleType v0part; - - // apply daughter particle id - // check for Lambda / Anti-Lambda - if (selPIDTrack(postrack, negtrack)) { - mass = v0track.mLambda(); - v0part = kLambda; - } else if (selPIDTrack(postrack, negtrack)) { - mass = v0track.mAntiLambda(); - v0part = kAntiLambda; - } else { - return; - } - - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 3.5); - histos.fill(HIST("QA_Checks/h2d_before_masswincut_pt_vs_alpha"), v0track.alpha(), v0track.qtarm()); - - // apply Armentros-Podolanski Selection - if (cfg_armpod_flag && (fabs(v0track.alpha()) < v0track.qtarm() / cfg_armpod_val)) { - return; - } - - // apply kshort rejection hypothesis - if (cfg_kshort_rej_flag && (fabs(v0track.mK0Short() - MassK0Short) <= cfg_kshort_rej)) { - return; + if constexpr (dmc == kMC) { + histos.fill(HIST("Events/h1f_collisions_info"), 0.5); + if (!collision.has_mcCollision()) { + return; + } } - // fill mass histograms before applying mass window cut to get % purity - if (v0part == kLambda) { - histos.fill(HIST("QA_Checks/h1d_lambda_mass"), mass); - histos.fill(HIST("QA_Checks/h2d_lambda_pt_vs_mass"), mass, v0track.pt()); - } else if (v0part == kAntiLambda) { - histos.fill(HIST("QA_Checks/h1d_antilambda_mass"), mass); - histos.fill(HIST("QA_Checks/h2d_antilambda_pt_vs_mass"), mass, v0track.pt()); - } + histos.fill(HIST("Events/h1f_collisions_info"), 1.5); - // apply mass window cut (Selection of Lambda/AntiLambda) - if (fabs(mass - MassLambda0) >= cfg_lambda_mass_window) { + // select collision + if (!selCollision(collision)) { return; } - histos.fill(HIST("QA_Checks/h2d_after_masswincut_pt_vs_alpha"), v0track.alpha(), v0track.qtarm()); - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 4.5); + histos.fill(HIST("Events/h1f_collisions_info"), 2.5); + histos.fill(HIST("Events/h1f_collision_posZ"), collision.posZ()); - // MC Reco Analysis - if constexpr (reco) { - auto v0mcpart = v0track.mcParticle(); - - // Get information of all the reconstructed V0s - histos.fill(HIST("QA_Checks/h2d_tracks_pid_before_sel"), v0mcpart.pdgCode(), v0mcpart.pt()); - - // Get Daughters and Mothers - bool decay_channel_flag = false; - std::vector daughterPDGs{}, daughterIDs{}, motherPDGs{}, motherIDs{}; - auto mcpart_daughters = v0mcpart.template daughters_as(); - auto mcpart_mothers = v0mcpart.template mothers_as(); + lambdaCollisionTable(collision.centFT0M(), collision.posX(), collision.posY(), collision.posZ()); - if (cfg_rec_pid_flag) { + // initialize v0track objects + ParticleType v0type = kLambda; + float mass = 0., corr_fact = 1.; - if (v0part == kLambda && v0mcpart.pdgCode() != kLambda0) { - return; - } else if (v0part == kAntiLambda && v0mcpart.pdgCode() != kLambda0Bar) { - return; + for (auto const& v0 : v0tracks) { + // check for corresponding MCGen Particle + if constexpr (dmc == kMC) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 0.5); + if (!v0.has_mcParticle()) { + continue; } + } - getPDGsIDs(mcpart_daughters, daughterPDGs, daughterIDs); - getPDGsIDs(mcpart_mothers, motherPDGs, motherIDs); + histos.fill(HIST("Tracks/h1f_tracks_info"), 1.5); + histos.fill(HIST("Tracks/h2f_armpod_before_sel"), v0.alpha(), v0.qtarm()); - // Decay to Proton-Pion - if (abs(daughterPDGs[0]) == kProton && abs(daughterPDGs[1]) == kPiPlus) { - decay_channel_flag = true; - } + // topological and kinematic selection + // armeteros-podolanski selection | kshort mass rejection hypothesis + if (!selLambdaWithTopoKinCuts(collision, v0, tracks)) { + continue; + } - // check for correct decay channel - if (!decay_channel_flag) { - return; - } + histos.fill(HIST("Tracks/h1f_tracks_info"), 5.5); - // check whether the selected lambda is a Physical Primary / Secondary - if (cfg_rec_primary_lambda && !v0mcpart.isPhysicalPrimary()) { - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 7.5); - return; - } else if (cfg_rec_secondary_lambda && v0mcpart.isPhysicalPrimary()) { - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 8.5); - return; - } + // select v0 as lambda / anti-lambda + if (!selLambdaMassWindow(v0, tracks, v0type)) { + continue; + } - // check the secondary lambdas coming from Sigma, Cascades and Omegas - if (abs(motherPDGs[0]) == kSigma0 || abs(motherPDGs[1]) == kSigma0Bar) { - histos.fill(HIST("QA_Checks/h2d_lambda_from_sigma"), v0mcpart.pdgCode(), v0mcpart.pt()); - } + histos.fill(HIST("Tracks/h1f_tracks_info"), 6.5); + histos.fill(HIST("Tracks/h2f_armpod_after_sel"), v0.alpha(), v0.qtarm()); - if (abs(motherPDGs[0]) == kXiMinus || abs(motherPDGs[1]) == kXiMinus) { - histos.fill(HIST("QA_Checks/h2d_lambda_from_cascade"), v0mcpart.pdgCode(), v0mcpart.pt()); + // we have v0 as lambda + // do MC analysis + if constexpr (dmc == kMC) { + histos.fill(HIST("Tracks/h2f_tracks_pid_before_sel"), v0.mcParticle().pdgCode(), v0.pt()); + if (cSelectTrueLambda && !selTrueMcRecLambda(v0, tracks)) { + continue; } + histos.fill(HIST("Tracks/h1f_tracks_info"), 7.5); + histos.fill(HIST("Tracks/h2f_tracks_pid_after_sel"), v0.mcParticle().pdgCode(), v0.pt()); } - // Fill the counter for selected primary/secondary Lambda/AntiLambda - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 5.5); - histos.fill(HIST("QA_Checks/h2d_tracks_pid_after_sel"), v0mcpart.pdgCode(), v0mcpart.pt()); - } + // get correction factors and mass + corr_fact = (v0type == kLambda) ? getCorrectionFactors(collision, v0) : getCorrectionFactors(collision, v0); + mass = (v0type == kLambda) ? v0.mLambda() : v0.mAntiLambda(); - if (v0part == kLambda) { - fillQALambda(collision, v0track, tracks); - } else { - fillQALambda(collision, v0track, tracks); - } + // fill lambda qa + if (v0type == kLambda) { + histos.fill(HIST("Tracks/h1f_lambda_pt_vs_invm"), mass, v0.pt()); + fillLambdaQAHistos(collision, v0, tracks); + } else { + histos.fill(HIST("Tracks/h1f_antilambda_pt_vs_invm"), mass, v0.pt()); + fillLambdaQAHistos(collision, v0, tracks); + } - // Fill Lambda/AntiLambda Table - lambdaTrackTable(lambdaCollisionTable.lastIndex(), v0track.px(), v0track.py(), v0track.pz(), v0track.pt(), v0track.eta(), v0track.phi(), v0track.yLambda(), mass, postrack.index(), negtrack.index(), (int8_t)v0part, v0track.v0cosPA(), v0track.dcaV0daughters()); + // Fill Lambda/AntiLambda Table + lambdaTrackTable(lambdaCollisionTable.lastIndex(), v0.px(), v0.py(), v0.pz(), + v0.pt(), v0.eta(), v0.phi(), v0.yLambda(), mass, + v0.template posTrack_as().index(), v0.template negTrack_as().index(), + (int8_t)v0type, v0.v0cosPA(), v0.dcaV0daughters(), corr_fact); + } } using Collisions = soa::Join; @@ -676,219 +713,89 @@ struct lambdaCorrTableProducer { void processData(Collisions::iterator const& collision, aod::V0Datas const& V0s, Tracks const& tracks) { - - histos.fill(HIST("Event/h1d_collisions_info"), 1.5); - - // select collision - if (!selCol(collision)) { - return; - } - - histos.fill(HIST("Event/h1d_collisions_info"), 2.5); - histos.fill(HIST("Event/h1d_collision_posZ"), collision.posZ()); - - lambdaCollisionTable(collision.centFT0M(), collision.posX(), collision.posY(), collision.posZ()); - - for (auto const& v0 : V0s) { - - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 1.5); - histos.fill(HIST("QA_Checks/h2d_before_topo_cuts_pt_vs_alpha"), v0.alpha(), v0.qtarm()); - - // apply topological cuts on v0 candidates - if (!topologicalCutsV0(collision, v0, tracks)) { - continue; - } - - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 2.5); - histos.fill(HIST("QA_Checks/h2d_after_topo_cuts_pt_vs_alpha"), v0.alpha(), v0.qtarm()); - - selV0Particle(collision, v0, tracks); - } + fillLambdaTables(collision, V0s, tracks); } - PROCESS_SWITCH(lambdaCorrTableProducer, processData, "Process for DATA", true); - - Preslice> perCol = aod::track::collisionId; - Preslice perMCCol = aod::mcparticle::mcCollisionId; + PROCESS_SWITCH(LambdaCorrTableProducer, processData, "Process for DATA", true); - SliceCache cache1; - - // Service pdgDB; - - using CollisionsWithMcLabels = soa::Join; - // using McCollisions = soa::Join; - using McCollisions = aod::McCollisions; using McV0Tracks = soa::Join; using TracksMC = soa::Join; - void processMCReco(CollisionsWithMcLabels const& collisions, McCollisions const&, McV0Tracks const& V0s, aod::McParticles const& /*mcParticles*/, TracksMC const& tracks) + void processMCReco(soa::Join::iterator const& collision, aod::McCollisions const&, + McV0Tracks const& V0s, aod::McParticles const&, TracksMC const& tracks) { - - for (auto const& collision : collisions) { - - histos.fill(HIST("Event/h1d_collisions_info"), 1.5); - - // select collision - if (!selCol(collision)) { - continue; - } - - histos.fill(HIST("Event/h1d_collisions_info"), 2.5); - - // check for corresponding MCGen Collision - if (cfg_has_mc_flag && !collision.has_mcCollision()) { - continue; - } - - histos.fill(HIST("Event/h1d_collisions_info"), 3.5); - histos.fill(HIST("Event/h1d_collision_posZ"), collision.posZ()); - - lambdaCollisionTable(collision.centFT0M(), collision.posX(), collision.posY(), collision.posZ()); - - // auto const& mcCollision = collision.mcCollision_as(); - - // v0-track loop - auto v0sThisCollision = V0s.sliceBy(perCol, collision.globalIndex()); - for (auto const& v0 : v0sThisCollision) { - - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 0.5); - - // check for corresponding MCGen Particle - if (cfg_has_mc_flag && !v0.has_mcParticle()) { - continue; - } - - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 1.5); - histos.fill(HIST("QA_Checks/h2d_before_topo_cuts_pt_vs_alpha"), v0.alpha(), v0.qtarm()); - - // apply topological cuts on v0 candidates - if (!topologicalCutsV0(collision, v0, tracks)) { - continue; - } - - histos.fill(HIST("QA_Checks/h1d_tracks_info"), 2.5); - histos.fill(HIST("QA_Checks/h2d_after_topo_cuts_pt_vs_alpha"), v0.alpha(), v0.qtarm()); - - selV0Particle(collision, v0, tracks); - } - } + fillLambdaTables(collision, V0s, tracks); } - PROCESS_SWITCH(lambdaCorrTableProducer, processMCReco, "Process for MC Reconstructed", false); + PROCESS_SWITCH(LambdaCorrTableProducer, processMCReco, "Process for MC Reconstructed", false); - void processMCGen(McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles) + void processMCGen(aod::McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles) { - - histos.fill(HIST("McGen/h1d_collisions_info"), 1.5); + histos.fill(HIST("McGen/h1f_collisions_info"), 1.5); // apply collision cuts - if (mcCollision.posZ() < cfg_min_z_vtx || mcCollision.posZ() > cfg_max_z_vtx) { + if (mcCollision.posZ() < cMinZVtx || mcCollision.posZ() > cMaxZVtx) { return; } - histos.fill(HIST("McGen/h1d_collisions_info"), 2.5); - histos.fill(HIST("McGen/h1d_collision_posZ"), mcCollision.posZ()); + histos.fill(HIST("McGen/h1f_collisions_info"), 2.5); + histos.fill(HIST("McGen/h1f_collision_posZ"), mcCollision.posZ()); lambdaMCGenCollisionTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()); - float mass = 0.; + + // initialize track objects + ParticleType v0type = kLambda; for (auto const& mcpart : mcParticles) { // check for Lambda first - if (abs(mcpart.pdgCode()) != kLambda0) { + if (mcpart.pdgCode() == kLambda0) { + v0type = kLambda; + } else if (mcpart.pdgCode() == kLambda0Bar) { + v0type = kAntiLambda; + } else { continue; } // check for Primary Lambdas/AntiLambdas - if (cfg_gen_primary_lambda && !mcpart.isPhysicalPrimary()) { + if (cGenPrimaryLambda && !mcpart.isPhysicalPrimary()) { continue; } // apply kinematic acceptance - if (mcpart.pt() <= cfg_v0_pt_min || mcpart.pt() >= cfg_v0_pt_max) { - continue; - } - - float rap = 0.; - if (cfg_do_eta_analysis) { - rap = mcpart.eta(); - } else { - rap = mcpart.y(); - } - - if (fabs(rap) >= cfg_v0_rap_max) { + if (mcpart.pt() <= cMinV0Pt || mcpart.pt() >= cMaxV0Pt || std::abs(mcpart.y()) >= cMaxV0Rap) { continue; } - // Get Daughters and Mothers - bool decay_channel_flag = false; - std::vector daughterPDGs{}, daughterIDs{}, motherPDGs{}, motherIDs{}; - auto mcpart_daughters = mcpart.template daughters_as(); - auto mcpart_mothers = mcpart.template mothers_as(); - getPDGsIDs(mcpart_daughters, daughterPDGs, daughterIDs); - getPDGsIDs(mcpart_mothers, motherPDGs, motherIDs); - - // Decay to Proton-Pion - if (abs(daughterPDGs[0]) == kProton && abs(daughterPDGs[1]) == kPiPlus) { - decay_channel_flag = true; + // check for correct decay channel + auto dautracks = mcpart.template daughters_as(); + std::vector daughterPDGs, daughterIDs; + for (auto const& dautrack : dautracks) { + daughterPDGs.push_back(dautrack.pdgCode()); + daughterIDs.push_back(dautrack.globalIndex()); } - - if (!decay_channel_flag) { + if (std::abs(daughterPDGs[0]) != kProton || std::abs(daughterPDGs[1]) != kPiPlus) { continue; } - mass = RecoDecay::m(mcpart.p(), mcpart.e()); - - // Fill histograms - if (mcpart.pdgCode() == kLambda0) { - histos.fill(HIST("McGen/h1d_lambda_daughter_PDG"), daughterPDGs[0]); - histos.fill(HIST("McGen/h1d_lambda_daughter_PDG"), daughterPDGs[1]); - histos.fill(HIST("McGen/h1d_mass_lambda"), mass); - histos.fill(HIST("McGen/h1d_pt_lambda"), mcpart.pt()); - histos.fill(HIST("McGen/h1d_eta_lambda"), mcpart.eta()); - histos.fill(HIST("McGen/h1d_y_lambda"), mcpart.y()); - histos.fill(HIST("McGen/h1d_phi_lambda"), mcpart.phi()); - histos.fill(HIST("McGen/h2d_pteta_lambda"), mcpart.eta(), mcpart.pt()); - histos.fill(HIST("McGen/h2d_ptrap_lambda"), mcpart.y(), mcpart.pt()); - histos.fill(HIST("McGen/h2d_ptphi_lambda"), mcpart.phi(), mcpart.pt()); - lambdaMCGenTrackTable(lambdaMCGenCollisionTable.lastIndex(), mcpart.px(), mcpart.py(), mcpart.pz(), mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), mass, daughterIDs[0], daughterIDs[1], (int8_t)kLambda, -999., -999.); - } else if (mcpart.pdgCode() == kLambda0Bar) { - histos.fill(HIST("McGen/h1d_antilambda_daughter_PDG"), daughterPDGs[0]); - histos.fill(HIST("McGen/h1d_antilambda_daughter_PDG"), daughterPDGs[1]); - histos.fill(HIST("McGen/h1d_mass_antilambda"), mass); - histos.fill(HIST("McGen/h1d_pt_antilambda"), mcpart.pt()); - histos.fill(HIST("McGen/h1d_eta_antilambda"), mcpart.eta()); - histos.fill(HIST("McGen/h1d_y_antilambda"), mcpart.y()); - histos.fill(HIST("McGen/h1d_phi_antilambda"), mcpart.phi()); - histos.fill(HIST("McGen/h2d_pteta_antilambda"), mcpart.eta(), mcpart.pt()); - histos.fill(HIST("McGen/h2d_ptrap_antilambda"), mcpart.y(), mcpart.pt()); - histos.fill(HIST("McGen/h2d_ptphi_antilambda"), mcpart.phi(), mcpart.pt()); - lambdaMCGenTrackTable(lambdaMCGenCollisionTable.lastIndex(), mcpart.px(), mcpart.py(), mcpart.pz(), mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), mass, daughterIDs[1], daughterIDs[0], (int8_t)kAntiLambda, -999., -999.); - } + lambdaMCGenTrackTable(lambdaMCGenCollisionTable.lastIndex(), mcpart.px(), mcpart.py(), mcpart.pz(), + mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), RecoDecay::m(mcpart.p(), mcpart.e()), + daughterIDs[0], daughterIDs[1], (int8_t)v0type, -999., -999., 1.); } } - PROCESS_SWITCH(lambdaCorrTableProducer, processMCGen, "Process for MC Generated", false); + PROCESS_SWITCH(LambdaCorrTableProducer, processMCGen, "Process for MC Generated", false); }; -struct lambdaCorrelationAnalysis { +struct LambdaR2Correlation { // Global Configurables - Configurable cfg_nRapBins{"cfg_nRapBins", 12, "N Rapidity Bins"}; - Configurable cfg_Rap_Min{"cfg_Rap_Min", -0.6, "Minimum Rapidity"}; - Configurable cfg_Rap_Max{"cfg_Rap_Max", 0.6, "Maximum Rapidity"}; - Configurable cfg_nPhiBins{"cfg_nPhiBins", 64, "N Phi Bins"}; - Configurable cfg_Phi_Min{"cfg_Phi_Min", 0, "Minimum Phi"}; - Configurable cfg_Phi_Max{"cfg_Phi_Max", 2 * TMath::Pi(), "Maximum Phi"}; + Configurable cNRapBins{"cNRapBins", 12, "N Rapidity Bins"}; + Configurable cMinRap{"cMinRap", -0.6, "Minimum Rapidity"}; + Configurable cMaxRap{"cMaxRap", 0.6, "Maximum Rapidity"}; + Configurable cNPhiBins{"cNPhiBins", 64, "N Phi Bins"}; // remove lambda with shared daughters - Configurable cfg_remove_lambda{"cfg_remove_lambda", true, "Flag to remove lambda"}; - - // Efficiency Correction - Configurable cfg_eff_corr_flag{"cfg_eff_corr_flag", true, "Efficiency Correction Flag"}; - - // CCDB - Configurable cfg_ccdb_url{"cfg_ccdb_url", "http://ccdb-test.cern.ch:8080", "url of ccdb"}; - Configurable cfg_ccdb_path{"cfg_ccdb_path", "Users/y/ypatley/lambda_corr_fact", "Path for ccdb-object"}; + Configurable cRemoveLambdaSharingDau{"cRemoveLambdaSharingDau", true, "Flag to remove lambda"}; // Histogram Registry. HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -899,33 +806,23 @@ struct lambdaCorrelationAnalysis { float kmaxrap = 0.; float nphibins = 0.; float kminphi = 0.; - float kmaxphi = 0.; + float kmaxphi = TwoPI; float rapbinwidth = 0.; float phibinwidth = 0.; float q = 0., e = 0., qinv = 0.; - // Initialize CCDB Service - Service ccdb; - void init(InitContext const&) { - - // Set CCDB url - ccdb->setURL(cfg_ccdb_url.value); - ccdb->setCaching(true); - // Set Density Histogram Attributes - nrapbins = static_cast(cfg_nRapBins); - kminrap = static_cast(cfg_Rap_Min); - kmaxrap = static_cast(cfg_Rap_Max); - nphibins = static_cast(cfg_nPhiBins); - kminphi = static_cast(cfg_Phi_Min); - kmaxphi = static_cast(cfg_Phi_Max); + nrapbins = static_cast(cNRapBins); + kminrap = static_cast(cMinRap); + kmaxrap = static_cast(cMaxRap); + nphibins = static_cast(cNPhiBins); rapbinwidth = (kmaxrap - kminrap) / nrapbins; phibinwidth = (kmaxphi - kminphi) / nphibins; - int knrapphibins = static_cast(cfg_nRapBins) * static_cast(cfg_nPhiBins); + int knrapphibins = static_cast(cNRapBins) * static_cast(cNPhiBins); float kminrapphi = 0.; float kmaxrapphi = knrapphibins; @@ -934,39 +831,43 @@ struct lambdaCorrelationAnalysis { const AxisSpec axisCent(105, 0, 105, "FT0M (%)"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisMass(100, 1.06, 1.16, "Inv Mass (GeV/#it{c}^{2})"); - const AxisSpec axisPt(64, 0.3, 3.5, "p_{T} (GeV/#it{c})"); + const AxisSpec axisPt(64, 0.2, 3.5, "p_{T} (GeV/#it{c})"); const AxisSpec axisEta(24, -1.2, 1.2, "#eta"); const AxisSpec axisCPA(100, 0.99, 1.0, "cos(#theta_{PA})"); const AxisSpec axisDcaDau(75, 0., 1.5, "Daug DCA (#sigma)"); - const AxisSpec axisRap(cfg_nRapBins, cfg_Rap_Min, cfg_Rap_Max, "y"); - const AxisSpec axisPhi(cfg_nPhiBins, cfg_Phi_Min, cfg_Phi_Max, "#phi (rad)"); + const AxisSpec axisRap(cNRapBins, cMinRap, cMaxRap, "y"); + const AxisSpec axisPhi(cNPhiBins, 0., TwoPI, "#phi (rad)"); const AxisSpec axisRapPhi(knrapphibins, kminrapphi, kmaxrapphi, "y #phi"); const AxisSpec axisQinv(100, 0, 10, "q_{inv} (GeV/#it{c})"); - const AxisSpec axisEfPt(16, 0.3, 3.5, "p_{T}"); + const AxisSpec axisEfPt(19, 0.2, 4.0, "p_{T}"); const AxisSpec axisEfEta(24, -1.2, 1.2, "#eta"); const AxisSpec axisEfRap(24, -1.2, 1.2, "y"); const AxisSpec axisEfPosZ(10, -10., 10., "V_{Z}"); // Create Histograms. // Event - histos.add("Event/Reco/h1d_collision_posz", "V_{Z} Distribution", kTH1F, {axisPosZ}); - histos.add("Event/Reco/h1d_ft0m_mult_percentile", "FT0M (%)", kTH1F, {axisCent}); - histos.add("Event/Reco/h1d_lambda_multiplicity", "#Lambda - Multiplicity", kTH1I, {axisMult}); - histos.add("Event/Reco/h1d_antilambda_multiplicity", "#bar{#Lambda} - Multiplicity", kTH1I, {axisMult}); - histos.add("Event/Reco/h1d_lambda_sdau", "#Lambda - Multiplicity", kTH1I, {axisMult}); - histos.add("Event/Reco/h1d_antilambda_sdau", "#bar{#Lambda} - Multiplicity", kTH1I, {axisMult}); - histos.add("Event/Reco/h1d_lambda_totmult", "#Lambda - Multiplicity", kTH1I, {axisMult}); - histos.add("Event/Reco/h1d_antilambda_totmult", "#bar{#Lambda} - Multiplicity", kTH1I, {axisMult}); + histos.add("Event/Reco/h1f_collision_posz", "V_{Z} Distribution", kTH1F, {axisPosZ}); + histos.add("Event/Reco/h1f_ft0m_mult_percentile", "FT0M (%)", kTH1F, {axisCent}); + histos.add("Event/Reco/h1i_lambda_multiplicity", "#Lambda - Multiplicity", kTH1I, {axisMult}); + histos.add("Event/Reco/h1i_antilambda_multiplicity", "#bar{#Lambda} - Multiplicity", kTH1I, {axisMult}); + histos.add("Event/Reco/h1i_lambda_sdau", "#Lambda - Multiplicity", kTH1I, {axisMult}); + histos.add("Event/Reco/h1i_antilambda_sdau", "#bar{#Lambda} - Multiplicity", kTH1I, {axisMult}); + histos.add("Event/Reco/h1i_lambda_totmult", "#Lambda - Multiplicity", kTH1I, {axisMult}); + histos.add("Event/Reco/h1i_antilambda_totmult", "#bar{#Lambda} - Multiplicity", kTH1I, {axisMult}); // InvMass, DcaDau and CosPA - histos.add("Reco/QA_Lambda/h1d_V0_mass", "M_{p#pi}", kTH1F, {axisMass}); - histos.add("Reco/QA_Lambda/h1d_V0_cpa", "cos(#theta_{PA})", kTH1F, {axisCPA}); - histos.add("Reco/QA_Lambda/h1d_V0_dcadau", "DCA_{p#pi} at V0 Decay Vertex", kTH1F, {axisDcaDau}); + histos.add("Reco/QA_Lambda/h1f_invmass", "M_{p#pi}", kTH1F, {axisMass}); + histos.add("Reco/QA_Lambda/h1f_cospa", "cos(#theta_{PA})", kTH1F, {axisCPA}); + histos.add("Reco/QA_Lambda/h1f_dcadau", "DCA_{p#pi} at V0 Decay Vertex", kTH1F, {axisDcaDau}); histos.addClone("Reco/QA_Lambda/", "Reco/QA_AntiLambda/"); // Efficiency Histograms + histos.add("Reco/Efficiency/h2f_n1_pteta_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisEfPt, axisEfEta}); + histos.add("Reco/Efficiency/h2f_n1_pteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisEfPt, axisEfEta}); + histos.add("Reco/Efficiency/h2f_n1_ptrap_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisEfPt, axisEfRap}); + histos.add("Reco/Efficiency/h2f_n1_ptrap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisEfPt, axisEfRap}); histos.add("Reco/Efficiency/h3f_n1_ptetaposz_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisEfPt, axisEfEta, axisEfPosZ}); histos.add("Reco/Efficiency/h3f_n1_ptetaposz_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisEfPt, axisEfEta, axisEfPosZ}); histos.add("Reco/Efficiency/h3f_n1_ptrapposz_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisEfPt, axisEfRap, axisEfPosZ}); @@ -982,16 +883,26 @@ struct lambdaCorrelationAnalysis { histos.add("Reco/h1d_n1_rap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH1D, {axisEta}); histos.add("Reco/h1d_n1_phi_LaP", "#rho_{1}^{#Lambda}", kTH1D, {axisPhi}); histos.add("Reco/h1d_n1_phi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH1D, {axisPhi}); + + // rho1 for R2 deta dphi histograms + histos.add("Reco/h2d_n1_rapphi_LaP", "#rho_{1}^{#Lambda}", kTH2D, {axisRap, axisPhi}); + histos.add("Reco/h2d_n1_rapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2D, {axisRap, axisPhi}); + + // rho1 for R2 qinv histograms + histos.add("Reco/h2d_n1_ptrap_LaP", "#rho_{1}^{#Lambda}", kTH2D, {axisPt, axisRap}); + histos.add("Reco/h2d_n1_ptrap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2D, {axisPt, axisRap}); + + // rho2 for R2 deta dphi histograms + histos.add("Reco/h2d_n2_rapphi_LaP_LaM", "#rho_{2}^{#Lambda - #bar{#Lambda}}", kTH2D, {axisRapPhi, axisRapPhi}); + histos.add("Reco/h2d_n2_rapphi_LaP_LaP", "#rho_{2}^{#Lambda - #Lambda}", kTH2D, {axisRapPhi, axisRapPhi}); + histos.add("Reco/h2d_n2_rapphi_LaM_LaM", "#rho_{2}^{#bar{#Lambda} - #bar{#Lambda}}", kTH2D, {axisRapPhi, axisRapPhi}); + + // rho2 for R2 qinv histograms histos.add("Reco/h1d_n2_qinv_LaP_LaM", "#rho_{2}^{#Lambda-#bar{#Lambda}}", kTH1D, {axisQinv}); histos.add("Reco/h1d_n2_qinv_LaP_LaP", "#rho_{2}^{#Lambda-#Lambda}", kTH1D, {axisQinv}); histos.add("Reco/h1d_n2_qinv_LaM_LaM", "#rho_{2}^{#bar{#Lambda}-#bar{#Lambda}}", kTH1D, {axisQinv}); - // 2D Histograms - histos.add("Reco/h2d_n1_LaP", "#rho_{1}^{#Lambda}", kTH2D, {axisRap, axisPhi}); - histos.add("Reco/h2d_n1_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2D, {axisRap, axisPhi}); - histos.add("Reco/h2d_n2_LaP_LaM", "#rho_{2}^{#Lambda - #bar{#Lambda}}", kTH2D, {axisRapPhi, axisRapPhi}); - histos.add("Reco/h2d_n2_LaP_LaP", "#rho_{2}^{#Lambda - #Lambda}", kTH2D, {axisRapPhi, axisRapPhi}); - histos.add("Reco/h2d_n2_LaM_LaM", "#rho_{2}^{#bar{#Lambda} - #bar{#Lambda}}", kTH2D, {axisRapPhi, axisRapPhi}); + // rho2 for qa checks histos.add("Reco/h2d_n2_pt1pt2_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH2D, {axisPt, axisPt}); histos.add("Reco/h2d_n2_pt1pt2_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH2D, {axisPt, axisPt}); histos.add("Reco/h2d_n2_pt1pt2_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH2D, {axisPt, axisPt}); @@ -1025,75 +936,37 @@ struct lambdaCorrelationAnalysis { bool removeLambdaSharingDau(T const& v, V const& vs) { // check whether to remove lambda or not - if (!cfg_remove_lambda) { + if (!cRemoveLambdaSharingDau) { return true; } - static constexpr std::string_view sub_dir_recgen[] = {"Reco/", "McGen/"}; - static constexpr std::string_view sub_dir[] = {"QA_Lambda/", "QA_AntiLambda/"}; + static constexpr std::string_view SubDirRecGen[] = {"Reco/", "McGen/"}; + static constexpr std::string_view SubDirHist[] = {"QA_Lambda/", "QA_AntiLambda/"}; - bool ret_flag = true; + bool retFlag = true; for (auto const& x : vs) { - if ((v.index() != x.index()) && (v.postrackid() == x.postrackid() || v.negtrackid() == x.negtrackid())) { + if ((v.index() != x.index()) && (v.posTrackId() == x.posTrackId() || v.negTrackId() == x.negTrackId())) { if (fillHist) { - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST(sub_dir[part]) + HIST("h1d_V0_mass"), x.mass()); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST(sub_dir[part]) + HIST("h1d_V0_cpa"), x.cospa()); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST(sub_dir[part]) + HIST("h1d_V0_dcadau"), x.dcadau()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirHist[part]) + HIST("h1f_invmass"), x.mass()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirHist[part]) + HIST("h1f_cospa"), x.cosPA()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirHist[part]) + HIST("h1f_dcadau"), x.dcaDau()); } if (std::abs(v.mass() - MassLambda0) > std::abs(x.mass() - MassLambda0)) { - ret_flag = false; + retFlag = false; break; } } } - return ret_flag; + return retFlag; } - template - void get_corr_factor(float& corfact, C const& col, T const& track) + template + void fillPairHistos(U& p1, U& p2) { - - // Check for efficiency correction flag and Rec/Gen Data - if (!cfg_eff_corr_flag || rec_gen == kGen) { - return; - } - - // Get from CCDB - auto ccdb_obj = ccdb->getForTimeStamp(cfg_ccdb_path.value, -1); - - // Check CCDB Object - if (!ccdb_obj) { - LOGF(warning, "CCDB OBJECT NOT FOUND"); - return; - } - - std::string str; - - if (track.v0type() == kLambda) { - str = "h3f_lambda_corr_fact"; - } else { - str = "h3f_antilambda_corr_fact"; - } - - TH3F* hist = reinterpret_cast(ccdb_obj->FindObject(Form("%s", str.c_str()))); - - int pt_bin = hist->GetXaxis()->FindBin(track.pt()); - int eta_bin = hist->GetYaxis()->FindBin(track.eta()); - int vz_bin = hist->GetZaxis()->FindBin(col.posZ()); - - corfact = hist->GetBinContent(pt_bin + 0.00001, eta_bin + 0.00001, vz_bin + 0.01); - - return; - } - - template - void fillPairHistos(C const& col, U& p1, U& p2) - { - - static constexpr std::string_view sub_dir_recgen[] = {"Reco/", "McGen/"}; - static constexpr std::string_view sub_dir_hist[] = {"LaP_LaM", "LaP_LaP", "LaM_LaM"}; + static constexpr std::string_view SubDirRecGen[] = {"Reco/", "McGen/"}; + static constexpr std::string_view SubDirHist[] = {"LaP_LaM", "LaP_LaP", "LaM_LaM"}; int rapbin1 = static_cast((p1.rap() - kminrap) / rapbinwidth); int rapbin2 = static_cast((p2.rap() - kminrap) / rapbinwidth); @@ -1101,43 +974,38 @@ struct lambdaCorrelationAnalysis { int phibin1 = static_cast(p1.phi() / phibinwidth); int phibin2 = static_cast(p2.phi() / phibinwidth); - float corfac1 = 1., corfac2 = 1.; + float corfac1 = p1.corrFact(), corfac2 = p2.corrFact(); - get_corr_factor(corfac1, col, p1); - get_corr_factor(corfac2, col, p2); - - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_pt1pt2_") + HIST(sub_dir_hist[part_pair]), p1.pt(), p2.pt(), corfac1 * corfac2); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_eta1eta2_") + HIST(sub_dir_hist[part_pair]), p1.eta(), p2.eta(), corfac1 * corfac2); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_phi1phi2_") + HIST(sub_dir_hist[part_pair]), p1.phi(), p2.phi(), corfac1 * corfac2); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_rap1rap2_") + HIST(sub_dir_hist[part_pair]), p1.rap(), p2.rap(), corfac1 * corfac2); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_pt1eta2_") + HIST(sub_dir_hist[part_pair]), p1.pt(), p2.eta(), corfac1 * corfac2); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_pt1phi2_") + HIST(sub_dir_hist[part_pair]), p1.pt(), p2.phi(), corfac1 * corfac2); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_pt1rap2_") + HIST(sub_dir_hist[part_pair]), p1.pt(), p2.rap(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_pt1pt2_") + HIST(SubDirHist[part_pair]), p1.pt(), p2.pt(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_eta1eta2_") + HIST(SubDirHist[part_pair]), p1.eta(), p2.eta(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_phi1phi2_") + HIST(SubDirHist[part_pair]), p1.phi(), p2.phi(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_rap1rap2_") + HIST(SubDirHist[part_pair]), p1.rap(), p2.rap(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_pt1eta2_") + HIST(SubDirHist[part_pair]), p1.pt(), p2.eta(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_pt1phi2_") + HIST(SubDirHist[part_pair]), p1.pt(), p2.phi(), corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_pt1rap2_") + HIST(SubDirHist[part_pair]), p1.pt(), p2.rap(), corfac1 * corfac2); if (rapbin1 >= 0 && rapbin2 >= 0 && phibin1 >= 0 && phibin2 >= 0 && rapbin1 < nrapbins && rapbin2 < nrapbins && phibin1 < nphibins && phibin2 < nphibins) { int rapphix = rapbin1 * nphibins + phibin1; int rapphiy = rapbin2 * nphibins + phibin2; - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n2_") + HIST(sub_dir_hist[part_pair]), rapphix + 0.5, rapphiy + 0.5, corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n2_rapphi_") + HIST(SubDirHist[part_pair]), rapphix + 0.5, rapphiy + 0.5, corfac1 * corfac2); } // qinv histos q = RecoDecay::p((p1.px() - p2.px()), (p1.py() - p2.py()), (p1.pz() - p2.pz())); e = RecoDecay::e(p1.px(), p1.py(), p1.pz(), MassLambda0) - RecoDecay::e(p2.px(), p2.py(), p2.pz(), MassLambda0); qinv = std::sqrt(-RecoDecay::m2(q, e)); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_n2_qinv_") + HIST(sub_dir_hist[part_pair]), qinv, corfac1 * corfac2); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h1d_n2_qinv_") + HIST(SubDirHist[part_pair]), qinv, corfac1 * corfac2); } template void analyzeSingles(C const& col, T const& tracks) { - - static constexpr std::string_view sub_dir_recgen[] = {"Reco/", "McGen/"}; - static constexpr std::string_view sub_dir_hist[] = {"LaP", "LaM"}; + static constexpr std::string_view SubDirRecGen[] = {"Reco/", "McGen/"}; + static constexpr std::string_view SubDirHist[] = {"LaP", "LaM"}; int ntrk1 = 0, ntrk2 = 0, ntrk3 = 0; - float corfac = 1.; for (auto const& track : tracks) { ++ntrk1; @@ -1147,51 +1015,51 @@ struct lambdaCorrelationAnalysis { } ++ntrk3; - // Get Correction Factor - get_corr_factor(corfac, col, track); - // QA Plots - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_n1_pt_") + HIST(sub_dir_hist[part]), track.pt(), corfac); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_n1_eta_") + HIST(sub_dir_hist[part]), track.eta(), corfac); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_n1_phi_") + HIST(sub_dir_hist[part]), track.phi(), corfac); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_n1_rap_") + HIST(sub_dir_hist[part]), track.rap(), corfac); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h1d_n1_pt_") + HIST(SubDirHist[part]), track.pt(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h1d_n1_eta_") + HIST(SubDirHist[part]), track.eta(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h1d_n1_phi_") + HIST(SubDirHist[part]), track.phi(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h1d_n1_rap_") + HIST(SubDirHist[part]), track.rap(), track.corrFact()); // Efficiency Calculation Plots - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("Efficiency/h3f_n1_ptetaposz_") + HIST(sub_dir_hist[part]), track.pt(), track.eta(), col.posZ()); - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("Efficiency/h3f_n1_ptrapposz_") + HIST(sub_dir_hist[part]), track.pt(), track.rap(), col.posZ()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("Efficiency/h2f_n1_pteta_") + HIST(SubDirHist[part]), track.pt(), track.eta()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("Efficiency/h2f_n1_ptrap_") + HIST(SubDirHist[part]), track.pt(), track.rap()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("Efficiency/h3f_n1_ptetaposz_") + HIST(SubDirHist[part]), track.pt(), track.eta(), col.posZ()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("Efficiency/h3f_n1_ptrapposz_") + HIST(SubDirHist[part]), track.pt(), track.rap(), col.posZ()); // Rho1 for R2 Calculation - histos.fill(HIST(sub_dir_recgen[rec_gen]) + HIST("h2d_n1_") + HIST(sub_dir_hist[part]), track.rap(), track.phi(), corfac); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n1_ptrap_") + HIST(SubDirHist[part]), track.pt(), track.rap(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h2d_n1_rapphi_") + HIST(SubDirHist[part]), track.rap(), track.phi(), track.corrFact()); } // fill multiplicity histograms if (ntrk1 != 0) { if (part == kLambda) { - histos.fill(HIST("Event/") + HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_lambda_totmult"), ntrk1); + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h1i_lambda_totmult"), ntrk1); } else { - histos.fill(HIST("Event/") + HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_antilambda_totmult"), ntrk1); + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h1i_antilambda_totmult"), ntrk1); } } if (ntrk2 != 0) { if (part == kLambda) { - histos.fill(HIST("Event/") + HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_lambda_sdau"), ntrk2); + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h1i_lambda_sdau"), ntrk2); } else { - histos.fill(HIST("Event/") + HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_antilambda_sdau"), ntrk2); + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h1i_antilambda_sdau"), ntrk2); } } if (ntrk3 != 0) { if (part == kLambda) { - histos.fill(HIST("Event/") + HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_lambda_multiplicity"), ntrk3); + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h1i_lambda_multiplicity"), ntrk3); } else { - histos.fill(HIST("Event/") + HIST(sub_dir_recgen[rec_gen]) + HIST("h1d_antilambda_multiplicity"), ntrk3); + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h1i_antilambda_multiplicity"), ntrk3); } } } - template - void analyzePairs(C const& col, T const& trks_1, T const& trks_2) + template + void analyzePairs(T const& trks_1, T const& trks_2) { for (auto const& trk_1 : trks_1) { if (!removeLambdaSharingDau(trk_1, trks_1)) { @@ -1202,68 +1070,67 @@ struct lambdaCorrelationAnalysis { if (samelambda && ((trk_1.index() == trk_2.index()))) { continue; } - // check if Lambda shares a daughter and select the one closest to PDG Mass if (!removeLambdaSharingDau(trk_2, trks_2)) { continue; } - fillPairHistos(col, trk_1, trk_2); + fillPairHistos(trk_1, trk_2); } } } - using Lambda_Collisions = aod::LambdaCollisions; - using Lambda_Tracks = aod::LambdaTracks; + using LambdaCollisions = aod::LambdaCollisions; + using LambdaTracks = aod::LambdaTracks; SliceCache cache; - Partition part_lambda_tracks = (aod::lambdatrack::v0type == (int8_t)kLambda); - Partition part_anti_lambda_tracks = (aod::lambdatrack::v0type == (int8_t)kAntiLambda); + Partition partLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda); + Partition partAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda); - void processDataReco(Lambda_Collisions::iterator const& collision, Lambda_Tracks const&) + void processDataReco(LambdaCollisions::iterator const& collision, LambdaTracks const&) { - histos.fill(HIST("Event/Reco/h1d_collision_posz"), collision.posZ()); - histos.fill(HIST("Event/Reco/h1d_ft0m_mult_percentile"), collision.cent()); + histos.fill(HIST("Event/Reco/h1f_collision_posz"), collision.posZ()); + histos.fill(HIST("Event/Reco/h1f_ft0m_mult_percentile"), collision.cent()); - auto lambda_tracks = part_lambda_tracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); - auto anti_lambda_tracks = part_anti_lambda_tracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto lambdaTracks = partLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto antiLambdaTracks = partAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); - analyzeSingles(collision, lambda_tracks); - analyzeSingles(collision, anti_lambda_tracks); - analyzePairs(collision, lambda_tracks, anti_lambda_tracks); - analyzePairs(collision, lambda_tracks, lambda_tracks); - analyzePairs(collision, anti_lambda_tracks, anti_lambda_tracks); + analyzeSingles(collision, lambdaTracks); + analyzeSingles(collision, antiLambdaTracks); + analyzePairs(lambdaTracks, antiLambdaTracks); + analyzePairs(lambdaTracks, lambdaTracks); + analyzePairs(antiLambdaTracks, antiLambdaTracks); } - PROCESS_SWITCH(lambdaCorrelationAnalysis, processDataReco, "Process for Data and MCReco", true); + PROCESS_SWITCH(LambdaR2Correlation, processDataReco, "Process for Data and MCReco", true); - using LambdaMCGenCollisions = aod::LambdaMCGenCollisions; - using LambdaMCGenTracks = aod::LambdaMCGenTracks; + using LambdaMcGenCollisions = aod::LambdaMcGenCollisions; + using LambdaMcGenTracks = aod::LambdaMcGenTracks; SliceCache cachemc; - Partition part_lambda_mcgen_tracks = aod::lambdatrack::v0type == (int8_t)kLambda; - Partition part_antilambda_mcgen_tracks = aod::lambdatrack::v0type == (int8_t)kAntiLambda; + Partition partLambdaMcGenTracks = aod::lambdatrack::v0Type == (int8_t)kLambda; + Partition partAntiLambdaMcGenTracks = aod::lambdatrack::v0Type == (int8_t)kAntiLambda; - void processMCGen(LambdaMCGenCollisions::iterator const& mcgencol, LambdaMCGenTracks const&) + void processMCGen(LambdaMcGenCollisions::iterator const& mcgencol, LambdaMcGenTracks const&) { - histos.fill(HIST("Event/McGen/h1d_collision_posz"), mcgencol.posZ()); + histos.fill(HIST("Event/McGen/h1f_collision_posz"), mcgencol.posZ()); - auto lambda_mcgen_tracks = part_lambda_mcgen_tracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); - auto antilambda_mcgen_tracks = part_antilambda_mcgen_tracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); + auto lambdaMcGenTracks = partLambdaMcGenTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); + auto antiLambdaMcGenTracks = partAntiLambdaMcGenTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); - analyzeSingles(mcgencol, lambda_mcgen_tracks); - analyzeSingles(mcgencol, antilambda_mcgen_tracks); - analyzePairs(mcgencol, lambda_mcgen_tracks, antilambda_mcgen_tracks); - analyzePairs(mcgencol, lambda_mcgen_tracks, lambda_mcgen_tracks); - analyzePairs(mcgencol, antilambda_mcgen_tracks, antilambda_mcgen_tracks); + analyzeSingles(mcgencol, lambdaMcGenTracks); + analyzeSingles(mcgencol, antiLambdaMcGenTracks); + analyzePairs(lambdaMcGenTracks, antiLambdaMcGenTracks); + analyzePairs(lambdaMcGenTracks, lambdaMcGenTracks); + analyzePairs(antiLambdaMcGenTracks, antiLambdaMcGenTracks); } - PROCESS_SWITCH(lambdaCorrelationAnalysis, processMCGen, "Process for MC Generated", false); + PROCESS_SWITCH(LambdaR2Correlation, processMCGen, "Process for MC Generated", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; } From a0974851ce4936ef494ea97aabdae9651ee113d0 Mon Sep 17 00:00:00 2001 From: Noor Koster <82090643+cnkoster@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:24:12 +0100 Subject: [PATCH 234/459] [PWGCF] added SPM and corrected phi range (#8797) Co-authored-by: ALICE Action Bot --- PWGCF/Flow/TableProducer/CMakeLists.txt | 4 +- .../{ZDCQvectors.cxx => zdcQVectors.cxx} | 493 +++++++++--------- PWGCF/Flow/Tasks/flowSP.cxx | 142 +++-- 3 files changed, 350 insertions(+), 289 deletions(-) rename PWGCF/Flow/TableProducer/{ZDCQvectors.cxx => zdcQVectors.cxx} (57%) diff --git a/PWGCF/Flow/TableProducer/CMakeLists.txt b/PWGCF/Flow/TableProducer/CMakeLists.txt index 667fcde6866..8774e589414 100644 --- a/PWGCF/Flow/TableProducer/CMakeLists.txt +++ b/PWGCF/Flow/TableProducer/CMakeLists.txt @@ -10,7 +10,7 @@ # or submit itself to any jurisdiction. -o2physics_add_dpl_workflow(flow-zdc-qvectors - SOURCES ZDCQvectors.cxx +o2physics_add_dpl_workflow(zdc-q-vectors + SOURCES zdcQVectors.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGCF/Flow/TableProducer/ZDCQvectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx similarity index 57% rename from PWGCF/Flow/TableProducer/ZDCQvectors.cxx rename to PWGCF/Flow/TableProducer/zdcQVectors.cxx index f8cfb02a8a4..de946251704 100644 --- a/PWGCF/Flow/TableProducer/ZDCQvectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -9,7 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// In this task the energy calibration and recentring of Q-vectors constructed in the ZDCs will be done +/// \file zdcQVectors.cxx +/// \author Noor Koster +/// \since 11/2024 +/// \brief In this task the energy calibration and recentring of Q-vectors constructed in the ZDCs will be done #include #include @@ -62,7 +65,7 @@ using namespace o2::aod::track; using namespace o2::aod::evsel; // define my..... -using myCollisions = soa::Join; +using UsedCollisions = soa::Join; using BCsRun3 = soa::Join; namespace o2::analysis::qvectortask @@ -71,45 +74,34 @@ namespace o2::analysis::qvectortask int counter = 0; // step0 -> Energy calib -std::shared_ptr ZN_Energy[10] = {{nullptr}}; -std::shared_ptr hQx_vs_Qy[6] = {{nullptr}}; +std::shared_ptr energyZN[10] = {{nullptr}}; +std::shared_ptr hQxvsQy[6] = {{nullptr}}; // and -std::shared_ptr COORD_correlations[6][4] = {{nullptr}}; -std::vector hZN_mean(10, nullptr); // Get from calibration file - -// step1: 4D large bins -std::vector mean_10perCent_v(4, nullptr); // hQXA, hQYA, hQXC, hQYC - -// step2: Small bins 1D -std::vector mean_cent_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC -std::vector mean_vx_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC -std::vector mean_vy_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC -std::vector mean_vz_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC +std::shared_ptr hCOORDcorrelations[6][4] = {{nullptr}}; // Define histogrm names here to use same names for creating and later uploading and retrieving data from ccdb // Energy calibration: -std::vector names_Ecal(10, ""); +std::vector namesEcal(10, ""); std::vector> names(5, std::vector()); //(1x 4d 4x 1d) std::vector vnames = {"hvertex_vx", "hvertex_vy"}; // https://alice-notes.web.cern.ch/system/files/notes/analysis/620/017-May-31-analysis_note-ALICE_analysis_note_v2.pdf -std::vector ZDC_px = {-1.75, 1.75, -1.75, 1.75}; -std::vector ZDC_py = {-1.75, -1.75, 1.75, 1.75}; +std::vector pxZDC = {-1.75, 1.75, -1.75, 1.75}; +std::vector pyZDC = {-1.75, -1.75, 1.75, 1.75}; double alphaZDC = 0.395; // step 0 tm 5 A&C std::vector>> q(6, std::vector>(7, std::vector(4, 0.0))); // 5 iterations with 5 steps, each with 4 values // for energy calibration -std::vector EZN(8); // uncalibrated energy for the 2x4 towers (a1, a2, a3, a4, c1, c2, c3, c4) +std::vector eZN(8); // uncalibrated energy for the 2x4 towers (a1, a2, a3, a4, c1, c2, c3, c4) std::vector meanEZN(10); // mean energies from calibration histos (common A, t1-4 A,common C, t1-4C) std::vector e(8, 0.); // calibrated energies (a1, a2, a3, a4, c1, c2, c3, c4)) // Define variables needed to do the recentring steps. double centrality = 0; int runnumber = 0; -int lastRunnumber = 0; std::vector v(3, 0); // vx, vy, vz bool isSelected = false; @@ -117,16 +109,16 @@ bool isSelected = false; using namespace o2::analysis::qvectortask; -struct ZDCqvectors { +struct ZdcQVectors { - Produces SPtableZDC; + Produces spTableZDC; ConfigurableAxis axisCent{"axisCent", {90, 0, 90}, "Centrality axis in 1% bins"}; ConfigurableAxis axisCent10{"axisCent10", {9, 0, 90}, "Centrality axis in 10% bins"}; ConfigurableAxis axisQ{"axisQ", {100, -2, 2}, "Q vector (xy) in ZDC"}; - ConfigurableAxis axisVx_big{"axisVx_big", {3, -0.01, 0.01}, "for Pos X of collision"}; - ConfigurableAxis axisVy_big{"axisVy_big", {3, -0.01, 0.01}, "for Pos Y of collision"}; - ConfigurableAxis axisVz_big{"axisVz_big", {3, -10, 10}, "for Pos Z of collision"}; + ConfigurableAxis axisVxBig{"axisVxBig", {3, -0.01, 0.01}, "for Pos X of collision"}; + ConfigurableAxis axisVyBig{"axisVyBig", {3, -0.01, 0.01}, "for Pos Y of collision"}; + ConfigurableAxis axisVzBig{"axisVzBig", {3, -10, 10}, "for Pos Z of collision"}; ConfigurableAxis axisVx{"axisVx", {10, -0.01, 0.01}, "for Pos X of collision"}; ConfigurableAxis axisVy{"axisVy", {10, -0.01, 0.01}, "for Pos Y of collision"}; ConfigurableAxis axisVz{"axisVz", {10, -10, 1}, "for vz of collision"}; @@ -139,14 +131,14 @@ struct ZDCqvectors { 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(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried") - O2_DEFINE_CONFIGURABLE(cfgEnergyCal, std::string, "", "ccdb path for energy calibration histos") - O2_DEFINE_CONFIGURABLE(cfgMeanv, std::string, "", "ccdb path for mean v histos") + O2_DEFINE_CONFIGURABLE(cfgEnergyCal, std::string, "Users/c/ckoster/ZDC/LHC23_zzh_pass4/Energy", "ccdb path for energy calibration histos") + O2_DEFINE_CONFIGURABLE(cfgMeanv, std::string, "Users/c/ckoster/ZDC/LHC23_zzh_pass4/vmean", "ccdb path for mean v histos") - Configurable> cfgRec1{"cfgRec1", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 1"}; - Configurable> cfgRec2{"cfgRec2", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 2"}; - Configurable> cfgRec3{"cfgRec3", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 3"}; - Configurable> cfgRec4{"cfgRec4", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 4"}; - Configurable> cfgRec5{"cfgRec5", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 5"}; + Configurable> cfgRec1{"cfgRec1", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step5"}, "ccdb paths for recentering calibration histos iteration 1"}; + Configurable> cfgRec2{"cfgRec2", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step5"}, "ccdb paths for recentering calibration histos iteration 2"}; + Configurable> cfgRec3{"cfgRec3", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it3_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it3_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it3_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it3_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it3_step5"}, "ccdb paths for recentering calibration histos iteration 3"}; + Configurable> cfgRec4{"cfgRec4", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it4_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it4_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it4_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it4_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it4_step5"}, "ccdb paths for recentering calibration histos iteration 4"}; + Configurable> cfgRec5{"cfgRec5", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it5_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it5_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it5_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it5_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it5_step5"}, "ccdb paths for recentering calibration histos iteration 5"}; // Define output HistogramRegistry registry{"Registry"}; @@ -171,35 +163,34 @@ struct ZDCqvectors { ccdb->setCreatedNotAfter(now); std::vector sides = {"A", "C"}; - std::vector coords = {"x", "y", "z"}; - std::vector COORDS = {"X", "Y"}; + std::vector capCOORDS = {"X", "Y"}; // Tower mean energies vs. centrality used for tower gain equalisation for (int tower = 0; tower < 10; tower++) { - names_Ecal[tower] = TString::Format("hZN%s_mean_t%i_cent", sides[(tower < 5) ? 0 : 1], tower % 5); - ZN_Energy[tower] = registry.add(Form("Energy/%s", names_Ecal[tower].Data()), Form("%s", names_Ecal[tower].Data()), kTProfile2D, {{1, 0, 1}, axisCent}); + namesEcal[tower] = TString::Format("hZN%s_mean_t%i_cent", sides[(tower < 5) ? 0 : 1], tower % 5); + energyZN[tower] = registry.add(Form("Energy/%s", namesEcal[tower].Data()), Form("%s", namesEcal[tower].Data()), kTProfile2D, {{1, 0, 1}, axisCent}); } // Qx_vs_Qy for each step for ZNA and ZNC for (int step = 0; step < 6; step++) { registry.add(Form("step%i/QA/hSPplaneA", step), "hSPplaneA", kTH2D, {{100, -4, 4}, axisCent10}); registry.add(Form("step%i/QA/hSPplaneC", step), "hSPplaneC", kTH2D, {{100, -4, 4}, axisCent10}); - for (const char* side : sides) { - hQx_vs_Qy[step] = registry.add(Form("step%i/hZN%s_Qx_vs_Qy", step, side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ}); + for (const auto& side : sides) { + hQxvsQy[step] = registry.add(Form("step%i/hZN%s_Qx_vs_Qy", step, side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ}); } int i = 0; - for (const char* COORD1 : COORDS) { - for (const char* COORD2 : COORDS) { + for (const auto& COORD1 : capCOORDS) { + for (const auto& COORD2 : capCOORDS) { // Now we get: & vs. Centrality - COORD_correlations[step][i] = registry.add(Form("step%i/QA/hQ%sA_Q%sC_vs_cent", step, COORD1, COORD2), Form("hQ%sA_Q%sC_vs_cent", COORD1, COORD2), kTProfile, {axisCent10}); + hCOORDcorrelations[step][i] = registry.add(Form("step%i/QA/hQ%sA_Q%sC_vs_cent", step, COORD1, COORD2), Form("hQ%sA_Q%sC_vs_cent", COORD1, COORD2), kTProfile, {axisCent10}); i++; } } // Add histograms for each step in the calibration process. - // Sides is {A,C} and coords is {X,Y} - for (const char* side : sides) { - for (const char* coord : COORDS) { + // Sides is {A,C} and capcoords is {X,Y} + for (const auto& side : sides) { + for (const auto& coord : capCOORDS) { registry.add(Form("step%i/QA/hQ%s%s_vs_cent", step, coord, side), Form("hQ%s%s_vs_cent", coord, side), {HistType::kTProfile, {axisCent10}}); registry.add(Form("step%i/QA/hQ%s%s_vs_vx", step, coord, side), Form("hQ%s%s_vs_vx", coord, side), {HistType::kTProfile, {axisVx}}); registry.add(Form("step%i/QA/hQ%s%s_vs_vy", step, coord, side), Form("hQ%s%s_vs_vy", coord, side), {HistType::kTProfile, {axisVy}}); @@ -207,7 +198,7 @@ struct ZDCqvectors { if (step == 1 || step == 5) { TString name = TString::Format("hQ%s%s_mean_Cent_V_run", coord, side); - registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_Cent_V_run", coord, side), {HistType::kTHnSparseD, {axisCent10, axisVx_big, axisVy_big, axisVz_big, axisQ}}); + registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_Cent_V_run", coord, side), {HistType::kTHnSparseD, {axisCent10, axisVxBig, axisVyBig, axisVzBig, axisQ}}); if (step == 1) names[step - 1].push_back(name); } @@ -231,7 +222,7 @@ struct ZDCqvectors { registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_vz_run", coord, side), kTProfile, {axisVz}); names[step - 1].push_back(name); } - } // end of COORDS + } // end of capCOORDS } // end of sides } // end of sum over steps @@ -333,45 +324,44 @@ struct ZDCqvectors { registry.fill(HIST("step0/QA/hQXC_vs_vz"), v[2], q[0][0][2]); registry.fill(HIST("step0/QA/hQYC_vs_vz"), v[2], q[0][0][3]); - static constexpr std::string_view subdir[] = {"step1/", "step2/", "step3/", "step4/", "step5/"}; - static_for<0, 4>([&](auto ind) { - constexpr int index = ind.value; - int index_rt = index + 1; + static constexpr std::string_view SubDir[] = {"step1/", "step2/", "step3/", "step4/", "step5/"}; + static_for<0, 4>([&](auto Ind) { + constexpr int Index = Ind.value; + int indexRt = Index + 1; - registry.fill(HIST(subdir[index]) + HIST("hZNA_Qx_vs_Qy"), q[iteration][index_rt][0], q[iteration][index_rt][1]); - registry.fill(HIST(subdir[index]) + HIST("hZNC_Qx_vs_Qy"), q[iteration][index_rt][2], q[iteration][index_rt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("hZNA_Qx_vs_Qy"), q[iteration][indexRt][0], q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("hZNC_Qx_vs_Qy"), q[iteration][indexRt][2], q[iteration][indexRt][3]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_QXC_vs_cent"), centrality, q[iteration][index_rt][0] * q[iteration][index_rt][2]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_QYC_vs_cent"), centrality, q[iteration][index_rt][1] * q[iteration][index_rt][3]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_QXC_vs_cent"), centrality, q[iteration][index_rt][1] * q[iteration][index_rt][2]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_QYC_vs_cent"), centrality, q[iteration][index_rt][0] * q[iteration][index_rt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXA_QXC_vs_cent"), centrality, q[iteration][indexRt][0] * q[iteration][indexRt][2]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYA_QYC_vs_cent"), centrality, q[iteration][indexRt][1] * q[iteration][indexRt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYA_QXC_vs_cent"), centrality, q[iteration][indexRt][1] * q[iteration][indexRt][2]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXA_QYC_vs_cent"), centrality, q[iteration][indexRt][0] * q[iteration][indexRt][3]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_vs_cent"), centrality, q[iteration][index_rt][0]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_cent"), centrality, q[iteration][index_rt][1]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_cent"), centrality, q[iteration][index_rt][2]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_cent"), centrality, q[iteration][index_rt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXA_vs_cent"), centrality, q[iteration][indexRt][0]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYA_vs_cent"), centrality, q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXC_vs_cent"), centrality, q[iteration][indexRt][2]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYC_vs_cent"), centrality, q[iteration][indexRt][3]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_vs_vx"), v[0], q[iteration][index_rt][0]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_vx"), v[0], q[iteration][index_rt][1]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_vx"), v[0], q[iteration][index_rt][2]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_vx"), v[0], q[iteration][index_rt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXA_vs_vx"), v[0], q[iteration][indexRt][0]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYA_vs_vx"), v[0], q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXC_vs_vx"), v[0], q[iteration][indexRt][2]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYC_vs_vx"), v[0], q[iteration][indexRt][3]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_vs_vy"), v[1], q[iteration][index_rt][0]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_vy"), v[1], q[iteration][index_rt][1]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_vy"), v[1], q[iteration][index_rt][2]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_vy"), v[1], q[iteration][index_rt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXA_vs_vy"), v[1], q[iteration][indexRt][0]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYA_vs_vy"), v[1], q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXC_vs_vy"), v[1], q[iteration][indexRt][2]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYC_vs_vy"), v[1], q[iteration][indexRt][3]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_vs_vz"), v[2], q[iteration][index_rt][0]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_vz"), v[2], q[iteration][index_rt][1]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_vz"), v[2], q[iteration][index_rt][2]); - registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_vz"), v[2], q[iteration][index_rt][3]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXA_vs_vz"), v[2], q[iteration][indexRt][0]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYA_vs_vz"), v[2], q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXC_vs_vz"), v[2], q[iteration][indexRt][2]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYC_vs_vz"), v[2], q[iteration][indexRt][3]); // add psi!! - double Psi_A = 1.0 * TMath::ATan2(q[iteration][index_rt][2], q[iteration][index_rt][0]); - registry.fill(HIST(subdir[index]) + HIST("QA/hSPplaneA"), Psi_A, centrality, 1); - double Psi_C = 1.0 * TMath::ATan2(q[iteration][index_rt][3], q[iteration][index_rt][1]); - registry.fill(HIST(subdir[index]) + HIST("QA/hSPplaneC"), Psi_C, centrality, 1); - + double psiA = 1.0 * std::atan2(q[iteration][indexRt][2], q[iteration][indexRt][0]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hSPplaneA"), psiA, centrality, 1); + double psiC = 1.0 * std::atan2(q[iteration][indexRt][3], q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hSPplaneC"), psiC, centrality, 1); }); } @@ -456,10 +446,9 @@ struct ZDCqvectors { // needed for energy calibration! TProfile2D* h = reinterpret_cast(hist); TString name = h->GetName(); - int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); + int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%d", runnumber)); int bin = h->GetYaxis()->FindBin(centrality); calibConstant = h->GetBinContent(binrunnumber, bin); - } else if (hist->InheritsFrom("TProfile")) { TProfile* h = reinterpret_cast(hist); TString name = h->GetName(); @@ -504,7 +493,7 @@ struct ZDCqvectors { fillCommonRegistry(iteration); } - void process(myCollisions::iterator const& collision, + void process(UsedCollisions::iterator const& collision, BCsRun3 const& /*bcs*/, aod::Zdcs const& /*zdcs*/) { @@ -517,8 +506,7 @@ struct ZDCqvectors { auto cent = collision.centFT0C(); if (cent < 0 || cent > 90) { - SPtableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); - lastRunnumber = runnumber; + spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); return; } @@ -527,215 +515,208 @@ struct ZDCqvectors { const auto& foundBC = collision.foundBC_as(); if (!foundBC.has_zdc()) { - SPtableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); - lastRunnumber = runnumber; + spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); return; } - v[0] = collision.posX(); - v[1] = collision.posY(); - v[2] = collision.posZ(); - centrality = cent; - runnumber = foundBC.runNumber(); + v[0] = collision.posX(); + v[1] = collision.posY(); + v[2] = collision.posZ(); + centrality = cent; + runnumber = foundBC.runNumber(); - const auto& zdcCol = foundBC.zdc(); + const auto& zdcCol = foundBC.zdc(); - // Get the raw energies EZN[8] (not the common A,C) - for (int tower = 0; tower < 8; tower++) { - EZN[tower] = (tower < 4) ? zdcCol.energySectorZNA()[tower] : zdcCol.energySectorZNC()[tower % 4]; - } + // Get the raw energies eZN[8] (not the common A,C) + for (int tower = 0; tower < 8; tower++) { + eZN[tower] = (tower < 4) ? zdcCol.energySectorZNA()[tower] : zdcCol.energySectorZNC()[tower % 4]; + } - // load the calibration histos for iteration 0 step 0 (Energy Calibration) - if (runnumber != lastRunnumber) - loadCalibrations(0, 0, foundBC.timestamp(), cfgEnergyCal, names_Ecal); - if (!cal.calibfilesLoaded[0][0]) { - if (counter < 1) { - LOGF(info, " --> No Energy calibration files found.. -> Only Energy calibration will be done. "); - } - } - // load the calibrations for the mean v - if (runnumber != lastRunnumber) - loadCalibrations(0, 1, foundBC.timestamp(), cfgMeanv, vnames); - if (!cal.calibfilesLoaded[0][1]) { - if (counter < 1) - LOGF(warning, " --> No mean V found.. -> THis wil lead to wrong axis for vx, vy (will be created in vmean/)"); - registry.get(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]); - registry.get(HIST("vmean/hvertex_vy"))->Fill(Form("%d", runnumber), v[1]); + // load the calibration histos for iteration 0 step 0 (Energy Calibration) + loadCalibrations(0, 0, foundBC.timestamp(), cfgEnergyCal.value, namesEcal); + + if (!cal.calibfilesLoaded[0][0]) { + if (counter < 1) { + LOGF(info, " --> No Energy calibration files found.. -> Only Energy calibration will be done. "); } + } + // load the calibrations for the mean v + loadCalibrations(0, 1, foundBC.timestamp(), cfgMeanv.value, vnames); + if (!cal.calibfilesLoaded[0][1]) { if (counter < 1) - LOGF(info, "=====================> .....Start Energy Calibration..... <====================="); + LOGF(warning, " --> No mean V found.. -> THis wil lead to wrong axis for vx, vy (will be created in vmean/)"); + registry.get(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]); + registry.get(HIST("vmean/hvertex_vy"))->Fill(Form("%d", runnumber), v[1]); + } - bool isZNAhit = true; - bool isZNChit = true; + if (counter < 1) + LOGF(info, "=====================> .....Start Energy Calibration..... <====================="); - for (int i = 0; i < 8; ++i) { - if (i < 4 && EZN[i] <= 0) - isZNAhit = false; - if (i > 3 && EZN[i] <= 0) - isZNChit = false; - } + bool isZNAhit = true; + bool isZNChit = true; - if (zdcCol.energyCommonZNA() <= 0) + for (int i = 0; i < 8; ++i) { + if (i < 4 && eZN[i] <= 0) isZNAhit = false; - if (zdcCol.energyCommonZNC() <= 0) + if (i > 3 && eZN[i] <= 0) isZNChit = false; + } - // Fill to get mean energy per tower in 1% centrality bins - for (int tower = 0; tower < 5; tower++) { - if (tower == 0) { - if (isZNAhit) - ZN_Energy[tower]->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNA(), 1); - if (isZNChit) - ZN_Energy[tower + 5]->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNC(), 1); - LOGF(debug, "Common A tower filled with: %i, %.2f, %.2f", runnumber, cent, zdcCol.energyCommonZNA()); - } else { - if (isZNAhit) - ZN_Energy[tower]->Fill(Form("%d", runnumber), cent, EZN[tower - 1], 1); - if (isZNChit) - ZN_Energy[tower + 5]->Fill(Form("%d", runnumber), cent, EZN[tower - 1 + 4], 1); - LOGF(debug, "Tower ZNC[%i] filled with: %i, %.2f, %.2f", tower, runnumber, cent, EZN[tower - 1 + 4]); - } + if (zdcCol.energyCommonZNA() <= 0) + isZNAhit = false; + if (zdcCol.energyCommonZNC() <= 0) + isZNChit = false; + + // Fill to get mean energy per tower in 1% centrality bins + for (int tower = 0; tower < 5; tower++) { + if (tower == 0) { + if (isZNAhit) + energyZN[tower]->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNA(), 1); + if (isZNChit) + energyZN[tower + 5]->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNC(), 1); + LOGF(debug, "Common A tower filled with: %i, %.2f, %.2f", runnumber, cent, zdcCol.energyCommonZNA()); + } else { + if (isZNAhit) + energyZN[tower]->Fill(Form("%d", runnumber), cent, eZN[tower - 1], 1); + if (isZNChit) + energyZN[tower + 5]->Fill(Form("%d", runnumber), cent, eZN[tower - 1 + 4], 1); + LOGF(debug, "Tower ZNC[%i] filled with: %i, %.2f, %.2f", tower, runnumber, cent, eZN[tower - 1 + 4]); } + } - // if ZNA or ZNC not hit correctly.. do not use event in q-vector calculation - if (!isZNAhit || !isZNChit) { - counter++; - SPtableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); - lastRunnumber = runnumber; - return; - } + // if ZNA or ZNC not hit correctly.. do not use event in q-vector calculation + if (!isZNAhit || !isZNChit) { + counter++; + spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + return; + } - if (!cal.calibfilesLoaded[0][0]) { - counter++; - SPtableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); - lastRunnumber = runnumber; - return; - } + if (!cal.calibfilesLoaded[0][0]) { + counter++; + spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + return; + } - if (counter < 1) - LOGF(info, "files for step 0 (energy Calibraton) are open!"); + if (counter < 1) + LOGF(info, "files for step 0 (energy Calibraton) are open!"); - if (counter < 1) { - LOGF(info, "=====================> .....Start Calculating Q-Vectors..... <====================="); - } + if (counter < 1) { + LOGF(info, "=====================> .....Start Calculating Q-Vectors..... <====================="); + } - // Now start gain equalisation! - // Fill the list with calibration constants. - for (int tower = 0; tower < 10; tower++) { - meanEZN[tower] = getCorrection(0, 0, names_Ecal[tower].Data()); - } + // Now start gain equalisation! + // Fill the list with calibration constants. + for (int tower = 0; tower < 10; tower++) { + meanEZN[tower] = getCorrection(0, 0, namesEcal[tower].Data()); + } - // Use the calibration constants but now only loop over towers 1-4 - int calibtower = 0; - std::vector towers_nocom = {1, 2, 3, 4, 6, 7, 8, 9}; + // Use the calibration constants but now only loop over towers 1-4 + int calibtower = 0; + std::vector towersNocom = {1, 2, 3, 4, 6, 7, 8, 9}; - for (int tower : towers_nocom) { - if (meanEZN[tower] > 0) { - double ecommon = (tower > 4) ? meanEZN[5] : meanEZN[0]; - e[calibtower] = EZN[calibtower] * (0.25 * ecommon) / meanEZN[tower]; - } - calibtower++; - } + for (const auto& tower : towersNocom) { + if (meanEZN[tower] > 0) { + double ecommon = (tower > 4) ? meanEZN[5] : meanEZN[0]; + e[calibtower] = eZN[calibtower] * (0.25 * ecommon) / meanEZN[tower]; + } + calibtower++; + } - for (int i = 0; i < 4; i++) { - float bincenter = i + .5; - registry.fill(HIST("QA/ZNA_Energy"), bincenter, EZN[i]); - registry.fill(HIST("QA/ZNA_Energy"), bincenter + 4, e[i]); - registry.fill(HIST("QA/ZNC_Energy"), bincenter, EZN[i + 4]); - registry.fill(HIST("QA/ZNC_Energy"), bincenter + 4, e[i + 4]); - } + for (int i = 0; i < 4; i++) { + float bincenter = i + .5; + registry.fill(HIST("QA/ZNA_Energy"), bincenter, eZN[i]); + registry.fill(HIST("QA/ZNA_Energy"), bincenter + 4, e[i]); + registry.fill(HIST("QA/ZNC_Energy"), bincenter, eZN[i + 4]); + registry.fill(HIST("QA/ZNC_Energy"), bincenter + 4, e[i + 4]); + } - // Now calculate Q-vector - for (int tower = 0; tower < 8; tower++) { - int side = (tower > 3) ? 1 : 0; - int sector = tower % 4; - double energy = std::pow(e[tower], alphaZDC); - sumZN[side] += energy; - xEnZN[side] += (side == 0) ? ZDC_px[sector] * energy : -1.0 * ZDC_px[sector] * energy; - yEnZN[side] += ZDC_py[sector] * energy; - } + // Now calculate Q-vector + for (int tower = 0; tower < 8; tower++) { + int side = (tower > 3) ? 1 : 0; + int sector = tower % 4; + double energy = std::pow(e[tower], alphaZDC); + sumZN[side] += energy; + xEnZN[side] += (side == 0) ? pxZDC[sector] * energy : -1.0 * pxZDC[sector] * energy; + yEnZN[side] += pyZDC[sector] * energy; + } - // "QXA", "QYA", "QXC", "QYC" - for (int i = 0; i < 2; ++i) { - if (sumZN[i] > 0) { - q[0][0][i * 2] = xEnZN[i] / sumZN[i]; // for QXA[0] and QXC[2] - q[0][0][i * 2 + 1] = yEnZN[i] / sumZN[i]; // for QYA[1] and QYC[3] - } - } + // "QXA", "QYA", "QXC", "QYC" + for (int i = 0; i < 2; ++i) { + if (sumZN[i] > 0) { + q[0][0][i * 2] = xEnZN[i] / sumZN[i]; // for QXA[0] and QXC[2] + q[0][0][i * 2 + 1] = yEnZN[i] / sumZN[i]; // for QYA[1] and QYC[3] + } + } - if (cal.calibfilesLoaded[0][1]) { - if (counter < 1) - LOGF(info, "=====================> Setting v to vmean!"); - v[0] = v[0] - getCorrection(0, 1, vnames[0].Data()); - v[1] = v[1] - getCorrection(0, 1, vnames[1].Data()); - } + if (cal.calibfilesLoaded[0][1]) { + if (counter < 1) + LOGF(info, "=====================> Setting v to vmean!"); + v[0] = v[0] - getCorrection(0, 1, vnames[0].Data()); + v[1] = v[1] - getCorrection(0, 1, vnames[1].Data()); + } - if (runnumber != lastRunnumber) { - for (int iteration = 1; iteration < 6; iteration++) { - std::vector ccdb_dirs; - if (iteration == 1) - ccdb_dirs = cfgRec1.value; - if (iteration == 2) - ccdb_dirs = cfgRec2.value; - if (iteration == 3) - ccdb_dirs = cfgRec3.value; - if (iteration == 4) - ccdb_dirs = cfgRec4.value; - if (iteration == 5) - ccdb_dirs = cfgRec5.value; - - for (int step = 0; step < 5; step++) { - loadCalibrations(iteration, step, foundBC.timestamp(), (ccdb_dirs)[step], names[step]); - } - } - } + for (int iteration = 1; iteration < 6; iteration++) { + std::vector ccdbDirs; + if (iteration == 1) + ccdbDirs = cfgRec1.value; + if (iteration == 2) + ccdbDirs = cfgRec2.value; + if (iteration == 3) + ccdbDirs = cfgRec3.value; + if (iteration == 4) + ccdbDirs = cfgRec4.value; + if (iteration == 5) + ccdbDirs = cfgRec5.value; + + for (int step = 0; step < 5; step++) { + loadCalibrations(iteration, step, foundBC.timestamp(), (ccdbDirs)[step], names[step]); + } + } - if (cal.atIteration == 0) { - if (counter < 1) - LOGF(warning, "Calibation files missing!!! Output created with q-vectors right after energy gain eq. !!"); - fillAllRegistries(0, 0); - SPtableZDC(runnumber, centrality, v[0], v[1], v[2], q[0][0][0], q[0][0][1], q[0][0][2], q[0][0][3], true, 0, 0); - lastRunnumber = runnumber; - counter++; - return; - } else { - for (int iteration = 1; iteration <= cal.atIteration; iteration++) { - for (int step = 0; step < cal.atStep + 1; step++) { - if (cal.calibfilesLoaded[iteration][step]) { - for (int i = 0; i < 4; i++) { - if (step == 0) { - if (iteration == 1) { - q[iteration][step + 1][i] = q[0][0][i] - getCorrection(iteration, step, names[step][i].Data()); - } else { - q[iteration][step + 1][i] = q[iteration - 1][5][i] - getCorrection(iteration, step, names[step][i].Data()); - } - } else { - q[iteration][step + 1][i] = q[iteration][step][i] - getCorrection(iteration, step, names[step][i].Data()); - } + if (cal.atIteration == 0) { + if (counter < 1) + LOGF(warning, "Calibation files missing!!! Output created with q-vectors right after energy gain eq. !!"); + fillAllRegistries(0, 0); + spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[0][0][0], q[0][0][1], q[0][0][2], q[0][0][3], true, 0, 0); + counter++; + return; + } else { + for (int iteration = 1; iteration <= cal.atIteration; iteration++) { + for (int step = 0; step < cal.atStep + 1; step++) { + if (cal.calibfilesLoaded[iteration][step]) { + for (int i = 0; i < 4; i++) { + if (step == 0) { + if (iteration == 1) { + q[iteration][step + 1][i] = q[0][0][i] - getCorrection(iteration, step, names[step][i].Data()); + } else { + q[iteration][step + 1][i] = q[iteration - 1][5][i] - getCorrection(iteration, step, names[step][i].Data()); } } else { - if (counter < 1) - LOGF(warning, "Something went wrong in calibration loop! File not loaded but bool set to tue"); - } // end of (cal.calibLoaded) - } // end of step - } // end of iteration - - if (counter < 1) - LOGF(info, "Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep + 1); - fillAllRegistries(cal.atIteration, cal.atStep + 1); - registry.fill(HIST("QA/centrality_after"), centrality); - SPtableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], true, cal.atIteration, cal.atStep); - lastRunnumber = runnumber; - counter++; - return; - } - LOGF(warning, "We return without saving table... -> THis is a problem"); + q[iteration][step + 1][i] = q[iteration][step][i] - getCorrection(iteration, step, names[step][i].Data()); + } + } + } else { + if (counter < 1) + LOGF(warning, "Something went wrong in calibration loop! File not loaded but bool set to tue"); + } // end of (cal.calibLoaded) + } // end of step + } // end of iteration + + if (counter < 1) + LOGF(info, "Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep + 1); + fillAllRegistries(cal.atIteration, cal.atStep + 1); + registry.fill(HIST("QA/centrality_after"), centrality); + spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], true, cal.atIteration, cal.atStep); + counter++; + return; + } + LOGF(warning, "We return without saving table... -> THis is a problem"); } // end of process }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index 62c237bb0f0..975698931bf 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -9,7 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// author: Noor Koster noor.koster@cern.ch +/// \file flowSP.cxx +/// \author Noor Koster +/// \since 01/12/2024 +/// \brief task to evaluate flow with respect to spectator plane. #include #include @@ -30,6 +33,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/Qvectors.h" +#include "Common/Core/RecoDecay.h" #include "PWGCF/DataModel/SPTableZDC.h" #include "TF1.h" @@ -41,7 +45,7 @@ using namespace o2::framework::expressions; #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; -struct flowAnalysisSP { +struct FlowSP { O2_DEFINE_CONFIGURABLE(cfgDCAxy, float, 0.2, "Cut on DCA in the transverse direction (cm)"); O2_DEFINE_CONFIGURABLE(cfgDCAz, float, 2, "Cut on DCA in the longitudinal direction (cm)"); @@ -53,6 +57,8 @@ struct flowAnalysisSP { O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried"); O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, true, "Bool to enable Additional Event Cut"); O2_DEFINE_CONFIGURABLE(cfgUseAdditionalTrackCut, bool, true, "Bool to enable Additional Track Cut"); + O2_DEFINE_CONFIGURABLE(cfgCentMax, float, 60, "Maximum cenrality for selected events"); + O2_DEFINE_CONFIGURABLE(cfgCentMin, float, 10, "Minimum cenrality for selected events"); O2_DEFINE_CONFIGURABLE(cfgDoubleTrackFunction, bool, true, "Include track cut at low pt"); O2_DEFINE_CONFIGURABLE(cfgTrackCutSize, float, 0.06, "Spread of track cut"); @@ -67,8 +73,8 @@ struct flowAnalysisSP { Filter collisionFilter = nabs(aod::collision::posZ) < cfgVtxZ; Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && nabs(aod::track::dcaXY) < cfgDCAxy&& nabs(aod::track::dcaZ) < cfgDCAz; - using myCollisions = soa::Filtered>; - using myTracks = soa::Filtered>; + using UsedCollisions = soa::Filtered>; + using UsedTracks = soa::Filtered>; // Connect to ccdb Service ccdb; @@ -118,6 +124,22 @@ struct flowAnalysisSP { registry.add("v1C_eta", "", kTProfile, {{10, -.8, .8}}); registry.add("v1AC_eta", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_even", "", kTProfile, {{10, -.8, .8}}); + + registry.add("v1_eta_odd_dev", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_even_dev", "", kTProfile, {{10, -.8, .8}}); + + registry.add("v1_eta_odd_dev_pos", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_even_dev_pos", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd_pos", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_even_pos", "", kTProfile, {{10, -.8, .8}}); + + registry.add("v1_eta_odd_dev_neg", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_even_dev_neg", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd_neg", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_even_neg", "", kTProfile, {{10, -.8, .8}}); + registry.add("v2_cent", "", kTProfile, {{80, 0, 80}}); registry.add("v2A_cent", "", kTProfile, {{80, 0, 80}}); registry.add("v2C_cent", "", kTProfile, {{80, 0, 80}}); @@ -133,7 +155,8 @@ struct flowAnalysisSP { registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(7, "kNoCollInTimeRangeStandard"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(8, "kIsVertexITSTPC"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(9, "after Mult cuts"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(10, "isSelected"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(10, "after Cent cuts"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(11, "isSelected"); if (cfgUseAdditionalEventCut) { fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x - 3.5*([5]+[6]*x+[7]*x*x+[8]*x*x*x+[9]*x*x*x*x)", 0, 100); @@ -217,7 +240,7 @@ struct flowAnalysisSP { float vtxz = -999; if (collision.numContrib() > 1) { vtxz = collision.posZ(); - float zRes = TMath::Sqrt(collision.covZZ()); + float zRes = std::sqrt(collision.covZZ()); if (zRes > 0.25 && collision.numContrib() < 20) vtxz = -999; } @@ -239,6 +262,11 @@ struct flowAnalysisSP { registry.fill(HIST("hEventCount"), 8.5); + if (centrality > cfgCentMax || centrality < cfgCentMin) + return 0; + + registry.fill(HIST("hEventCount"), 9.5); + return 1; } @@ -247,14 +275,14 @@ struct flowAnalysisSP { { double phimodn = track.phi(); if (field < 0) // for negative polarity field - phimodn = TMath::TwoPi() - phimodn; + phimodn = o2::constants::math::TwoPI - phimodn; if (track.sign() < 0) // for negative charge - phimodn = TMath::TwoPi() - phimodn; + phimodn = o2::constants::math::TwoPI - phimodn; if (phimodn < 0) LOGF(warning, "phi < 0: %g", phimodn); - phimodn += TMath::Pi() / 18.0; // to center gap in the middle - phimodn = fmod(phimodn, TMath::Pi() / 9.0); + phimodn += o2::constants::math::PI / 18.0; // to center gap in the middle + phimodn = fmod(phimodn, o2::constants::math::PI / 9.0); registry.fill(HIST("pt_phi_bef"), track.pt(), phimodn); if (phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt())) return false; // reject track @@ -262,7 +290,7 @@ struct flowAnalysisSP { return true; } - void process(myCollisions::iterator const& collision, aod::BCsWithTimestamps const&, myTracks const& tracks) + void process(UsedCollisions::iterator const& collision, aod::BCsWithTimestamps const&, UsedTracks const& tracks) { // Hier sum over collisions and get ZDC data. registry.fill(HIST("hEventCount"), .5); @@ -280,7 +308,7 @@ struct flowAnalysisSP { return; if (collision.isSelected()) { - registry.fill(HIST("hEventCount"), 9.5); + registry.fill(HIST("hEventCount"), 10.5); registry.fill(HIST("hCent"), centrality); @@ -289,38 +317,90 @@ struct flowAnalysisSP { double qxC = collision.qxC(); double qyC = collision.qyC(); - double Psi_A = 1.0 * TMath::ATan2(qyA, qxA); - registry.fill(HIST("hSPplaneA"), Psi_A, 1); + double psiA = 1.0 * std::atan2(qyA, qxA); + registry.fill(HIST("hSPplaneA"), psiA, 1); + + double psiC = 1.0 * std::atan2(qyC, qxC); + registry.fill(HIST("hSPplaneC"), psiC, 1); + + registry.fill(HIST("hSPplaneA-C"), psiA - psiC, 1); - double Psi_C = 1.0 * TMath::ATan2(qyC, qxC); - registry.fill(HIST("hSPplaneC"), Psi_C, 1); + registry.fill(HIST("hCosdPhi"), centrality, std::cos(psiA - psiC)); + if (std::cos(psiA - psiC) < 0) + registry.fill(HIST("hSPlaneRes"), centrality, std::sqrt(-1. * std::cos(psiA - psiC))); - registry.fill(HIST("hSPplaneA-C"), Psi_A - Psi_C, 1); + registry.fill(HIST("hSindPhi"), centrality, std::sin(psiA - psiC)); - registry.fill(HIST("hCosdPhi"), centrality, TMath::Cos(Psi_A - Psi_C)); - if (TMath::Cos(Psi_A - Psi_C) < 0) - registry.fill(HIST("hSPlaneRes"), centrality, TMath::Sqrt(-1. * TMath::Cos(Psi_A - Psi_C))); - registry.fill(HIST("hSindPhi"), centrality, TMath::Sin(Psi_A - Psi_C)); + auto qxAqxC = qxA * qxC; + auto qyAqyC = qyA * qyC; - for (auto& track : tracks) { + for (const auto& track : tracks) { if (!trackSelected(track, field)) continue; - double v1A = TMath::Cos(track.phi() - Psi_A); - double v1C = TMath::Cos(track.phi() - Psi_C); + bool pos; + if (track.sign() == 0.0) + continue; + if (track.sign() > 0) { + pos = true; + } else { + pos = false; + } + + // constrain angle to 0 -> [0,0+2pi] + auto phi = RecoDecay::constrainAngle(track.phi(), 0); - double v1AC = TMath::Cos(track.phi() - (Psi_A - Psi_C)); + auto ux = std::cos(phi); + auto uy = std::sin(phi); - registry.fill(HIST("v1_eta"), track.eta(), (1. / TMath::Sqrt(2)) * (v1A - v1C)); + auto uxQxA = ux * qxA; + auto uyQyA = uy * qyA; + auto uxyQxyA = uxQxA + uyQyA; + auto uxQxC = ux * qxC; + auto uyQyC = uy * qyC; + auto uxyQxyC = uxQxC + uyQyC; + + auto oddv1 = ux * (qxA - qxC) + uy * (qyA - qyC); + auto evenv1 = ux * (qxA + qxC) + uy * (qyA + qyC); + + auto oddv1Dev = ux * (qxA - qxC) / std::sqrt(std::abs(qxAqxC)) + uy * (qyA - qyC) / std::sqrt(std::abs(qyAqyC)); + auto evenv1Dev = ux * (qxA + qxC) / std::sqrt(std::abs(qxAqxC)) + uy * (qyA + qyC) / std::sqrt(std::abs(qyAqyC)); + + double v1A = std::cos(phi - psiA); + double v1C = std::cos(phi - psiC); + + double v1AC = std::cos(phi - (psiA - psiC)); + + registry.fill(HIST("v1_eta"), track.eta(), (1. / std::sqrt(2)) * (v1A - v1C)); registry.fill(HIST("v1A_eta"), track.eta(), (v1A)); registry.fill(HIST("v1C_eta"), track.eta(), (v1C)); registry.fill(HIST("v1AC_eta"), track.eta(), (v1AC)); - double v2A = TMath::Cos(2 * (track.phi() - Psi_A)); - double v2C = TMath::Cos(2 * (track.phi() - Psi_C)); - double v2AC = TMath::Cos(2 * (track.phi() - (Psi_A - Psi_C))); + registry.fill(HIST("v1_eta_odd"), track.eta(), oddv1); + registry.fill(HIST("v1_eta_even"), track.eta(), evenv1); + + registry.fill(HIST("v1_eta_odd_dev"), track.eta(), oddv1Dev); + registry.fill(HIST("v1_eta_even_dev"), track.eta(), evenv1Dev); + + if (pos) { + registry.fill(HIST("v1_eta_odd_pos"), track.eta(), oddv1); + registry.fill(HIST("v1_eta_even_pos"), track.eta(), evenv1); + + registry.fill(HIST("v1_eta_odd_dev_pos"), track.eta(), oddv1Dev); + registry.fill(HIST("v1_eta_even_dev_pos"), track.eta(), evenv1Dev); + } else { + registry.fill(HIST("v1_eta_odd_neg"), track.eta(), oddv1); + registry.fill(HIST("v1_eta_even_neg"), track.eta(), evenv1); + + registry.fill(HIST("v1_eta_odd_dev_neg"), track.eta(), oddv1Dev); + registry.fill(HIST("v1_eta_even_dev_neg"), track.eta(), evenv1Dev); + } + + double v2A = std::cos(2 * (phi - psiA)); + double v2C = std::cos(2 * (phi - psiC)); + double v2AC = std::cos(2 * (phi - (psiA - psiC))); - registry.fill(HIST("v2_cent"), centrality, (1. / TMath::Sqrt(2)) * (v2A - v2C)); + registry.fill(HIST("v2_cent"), centrality, (1. / std::sqrt(2)) * (v2A - v2C)); registry.fill(HIST("v2A_cent"), centrality, (v2A)); registry.fill(HIST("v2C_cent"), centrality, (v2C)); registry.fill(HIST("v2AC_cent"), centrality, (v2AC)); @@ -338,6 +418,6 @@ struct flowAnalysisSP { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; } From b049b2907acfd8179d4fbfca58d1c6519ca84437 Mon Sep 17 00:00:00 2001 From: Marvin Hemmer <53471402+mhemmer-cern@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:24:28 +0100 Subject: [PATCH 235/459] [PWGEM,PWGEM-36] EMCal rotation background add SM edges (#8800) Co-authored-by: ALICE Action Bot --- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 103 +++++-- PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx | 294 +++++++++++++------- 2 files changed, 272 insertions(+), 125 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index e5437da59cf..8856fdaf6dd 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -11,8 +11,10 @@ // // ======================== // -// This code loops over photons and makes pairs for neutral mesons analyses. -// Please write to: daiki.sekihata@cern.ch +/// \file Pi0EtaToGammaGamma.h +/// \brief This code loops over photons and makes pairs for neutral mesons analyses. +/// +/// \author D. Sekihata, daiki.sekihata@cern.ch #ifndef PWGEM_PHOTONMESON_CORE_PI0ETATOGAMMAGAMMA_H_ #define PWGEM_PHOTONMESON_CORE_PI0ETATOGAMMAGAMMA_H_ @@ -189,6 +191,7 @@ struct Pi0EtaToGammaGamma { Configurable> EMC_TM_Phi{"EMC_TM_Phi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; Configurable EMC_Eoverp{"EMC_Eoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; Configurable EMC_UseExoticCut{"EMC_UseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; + Configurable cfgDistanceToEdge{"cfgDistanceToEdge", 1, "Distance to edge in cells required for rotated cluster to be accepted"}; } emccuts; PHOSPhotonCut fPHOSCut; @@ -268,7 +271,7 @@ struct Pi0EtaToGammaGamma { if (d_bz_input > -990) { d_bz = d_bz_input; o2::parameters::GRPMagField grpmag; - if (fabs(d_bz) > 1e-5) { + if (std::fabs(d_bz) > 1e-5) { grpmag.setL3Current(30000.f / (d_bz / 5.0f)); } mRunNumber = collision.runNumber(); @@ -424,8 +427,8 @@ struct Pi0EtaToGammaGamma { fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); fEMCCut.SetTimeRange(emccuts.EMC_minTime, emccuts.EMC_maxTime); - fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + pow(pT + b, c); }); - fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + pow(pT + e, f); }); + fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + std::pow(pT + b, c); }); + fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + std::pow(pT + e, f); }); fEMCCut.SetMinEoverP(emccuts.EMC_Eoverp); fEMCCut.SetUseExoticCut(emccuts.EMC_UseExoticCut); @@ -436,6 +439,42 @@ struct Pi0EtaToGammaGamma { fPHOSCut.SetEnergyRange(phoscuts.cfg_min_Ecluster, 1e+10); } + /// \brief returns if cluster is too close to edge of EMCal (using rotation background method only for EMCal!) + bool IsTooCloseToEdge(const int cellID, const int DistanceToBorder = 1) + { + if (DistanceToBorder <= 0) { + return false; + } + if (cellID < 0) { + return true; + } + + int iBadCell = -1; + + // check distance to border in case the cell is okay + auto [iSupMod, iMod, iPhi, iEta] = emcalGeom->GetCellIndex(cellID); + auto [irow, icol] = emcalGeom->GetCellPhiEtaIndexInSModule(iSupMod, iMod, iPhi, iEta); + + // Check rows/phi + int iRowLast = 24; + if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::EMCAL_HALF) { + iRowLast /= 2; // 2/3 sm case + } else if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::EMCAL_THIRD) { + iRowLast /= 3; // 1/3 sm case + } else if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::DCAL_EXT) { + iRowLast /= 3; // 1/3 sm case + } + + if (irow < DistanceToBorder || (iRowLast - irow) <= DistanceToBorder) { + iBadCell = 1; + } + + if (iBadCell > 0) { + return true; + } + return false; + } + /// \brief Calculate background (using rotation background method only for EMCal!) template void RotationBackground(const ROOT::Math::PtEtaPhiMVector& meson, ROOT::Math::PtEtaPhiMVector photon1, ROOT::Math::PtEtaPhiMVector photon2, TPhotons const& photons_coll, unsigned int ig1, unsigned int ig2, float eventWeight) @@ -455,11 +494,17 @@ struct Pi0EtaToGammaGamma { try { iCellID_photon1 = emcalGeom->GetAbsCellIdFromEtaPhi(photon1.Eta(), photon1.Phi()); + if (IsTooCloseToEdge(iCellID_photon1, emccuts.cfgDistanceToEdge.value)) { + iCellID_photon1 = -1; + } } catch (o2::emcal::InvalidPositionException& e) { iCellID_photon1 = -1; } try { iCellID_photon2 = emcalGeom->GetAbsCellIdFromEtaPhi(photon2.Eta(), photon2.Phi()); + if (IsTooCloseToEdge(iCellID_photon2, emccuts.cfgDistanceToEdge.value)) { + iCellID_photon2 = -1; + } } catch (o2::emcal::InvalidPositionException& e) { iCellID_photon2 = -1; } @@ -467,7 +512,7 @@ struct Pi0EtaToGammaGamma { return; } - for (auto& photon : photons_coll) { + for (const auto& photon : photons_coll) { if (photon.globalIndex() == ig1 || photon.globalIndex() == ig2) { // only combine rotated photons with other photons continue; @@ -483,10 +528,10 @@ struct Pi0EtaToGammaGamma { float openingAngle1 = std::acos(photon1.Vect().Dot(photon3.Vect()) / (photon1.P() * photon3.P())); float openingAngle2 = std::acos(photon2.Vect().Dot(photon3.Vect()) / (photon2.P() * photon3.P())); - if (openingAngle1 > emccuts.minOpenAngle && abs(mother1.Rapidity()) < maxY && iCellID_photon1 > 0) { + if (openingAngle1 > emccuts.minOpenAngle && std::abs(mother1.Rapidity()) < maxY && iCellID_photon1 > 0) { fRegistry.fill(HIST("Pair/rotation/hs"), mother1.M(), mother1.Pt(), eventWeight); } - if (openingAngle2 > emccuts.minOpenAngle && abs(mother2.Rapidity()) < maxY && iCellID_photon2 > 0) { + if (openingAngle2 > emccuts.minOpenAngle && std::abs(mother2.Rapidity()) < maxY && iCellID_photon2 > 0) { fRegistry.fill(HIST("Pair/rotation/hs"), mother2.M(), mother2.Pt(), eventWeight); } } @@ -515,14 +560,14 @@ struct Pi0EtaToGammaGamma { TPreslice1 const& perCollision1, TPreslice2 const& perCollision2, TCut1 const& cut1, TCut2 const& cut2) { - for (auto& collision : collisions) { + for (const auto& collision : collisions) { initCCDB(collision); int ndiphoton = 0; if ((pairtype == PairType::kPHOSPHOS || pairtype == PairType::kPCMPHOS) && !collision.alias_bit(triggerAliases::kTVXinPHOS)) { continue; } - if (eventcuts.onlyKeepWeightedEvents && fabs(collision.weight() - 1.) < 1E-10) { + if (eventcuts.onlyKeepWeightedEvents && std::fabs(collision.weight() - 1.) < 1E-10) { continue; } @@ -578,7 +623,7 @@ struct Pi0EtaToGammaGamma { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); auto photons2_per_collision = photons2.sliceBy(perCollision2, collision.globalIndex()); - for (auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photons1_per_collision, photons2_per_collision))) { + for (const auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photons1_per_collision, photons2_per_collision))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) { continue; } @@ -586,7 +631,7 @@ struct Pi0EtaToGammaGamma { ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - if (abs(v12.Rapidity()) > maxY) { + if (std::abs(v12.Rapidity()) > maxY) { continue; } @@ -614,7 +659,7 @@ struct Pi0EtaToGammaGamma { auto positrons_per_collision = positrons->sliceByCached(o2::aod::emprimaryelectron::emeventId, collision.globalIndex(), cache); auto electrons_per_collision = electrons->sliceByCached(o2::aod::emprimaryelectron::emeventId, collision.globalIndex(), cache); - for (auto& g1 : photons1_per_collision) { + for (const auto& g1 : photons1_per_collision) { if (!cut1.template IsSelected(g1)) { continue; } @@ -622,7 +667,7 @@ struct Pi0EtaToGammaGamma { auto ele1 = g1.template negTrack_as(); ROOT::Math::PtEtaPhiMVector v_gamma(g1.pt(), g1.eta(), g1.phi(), 0.); - for (auto& [pos2, ele2] : combinations(CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { + for (const auto& [pos2, ele2] : combinations(CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { if (pos2.trackId() == ele2.trackId()) { // this is protection against pairing identical 2 tracks. continue; @@ -643,7 +688,7 @@ struct Pi0EtaToGammaGamma { ROOT::Math::PtEtaPhiMVector v_ele(ele2.pt(), ele2.eta(), ele2.phi(), o2::constants::physics::MassElectron); ROOT::Math::PtEtaPhiMVector v_ee = v_pos + v_ele; ROOT::Math::PtEtaPhiMVector veeg = v_gamma + v_pos + v_ele; - if (abs(veeg.Rapidity()) > maxY) { + if (std::abs(veeg.Rapidity()) > maxY) { continue; } @@ -666,14 +711,14 @@ struct Pi0EtaToGammaGamma { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); auto photons2_per_collision = photons2.sliceBy(perCollision2, collision.globalIndex()); - for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { + for (const auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) { continue; } ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - if (abs(v12.Rapidity()) > maxY) { + if (std::abs(v12.Rapidity()) > maxY) { continue; } @@ -707,7 +752,7 @@ struct Pi0EtaToGammaGamma { auto collisionIds2_in_mixing_pool = emh2->GetCollisionIdsFromEventPool(key_bin); if constexpr (pairtype == PairType::kPCMPCM || pairtype == PairType::kPHOSPHOS || pairtype == PairType::kEMCEMC) { // same kinds pairing - for (auto& mix_dfId_collisionId : collisionIds1_in_mixing_pool) { + for (const auto& mix_dfId_collisionId : collisionIds1_in_mixing_pool) { int mix_dfId = mix_dfId_collisionId.first; int64_t mix_collisionId = mix_dfId_collisionId.second; @@ -718,12 +763,12 @@ struct Pi0EtaToGammaGamma { auto photons1_from_event_pool = emh1->GetTracksPerCollision(mix_dfId_collisionId); // LOGF(info, "Do event mixing: current event (%d, %d), ngamma = %d | event pool (%d, %d), ngamma = %d", ndf, collision.globalIndex(), selected_photons1_in_this_event.size(), mix_dfId, mix_collisionId, photons1_from_event_pool.size()); - for (auto& g1 : selected_photons1_in_this_event) { - for (auto& g2 : photons1_from_event_pool) { + for (const auto& g1 : selected_photons1_in_this_event) { + for (const auto& g2 : photons1_from_event_pool) { ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - if (abs(v12.Rapidity()) > maxY) { + if (std::abs(v12.Rapidity()) > maxY) { continue; } @@ -733,7 +778,7 @@ struct Pi0EtaToGammaGamma { } // end of loop over mixed event pool } else { // [photon1 from event1, photon2 from event2] and [photon1 from event2, photon2 from event1] - for (auto& mix_dfId_collisionId : collisionIds2_in_mixing_pool) { + for (const auto& mix_dfId_collisionId : collisionIds2_in_mixing_pool) { int mix_dfId = mix_dfId_collisionId.first; int64_t mix_collisionId = mix_dfId_collisionId.second; @@ -744,22 +789,22 @@ struct Pi0EtaToGammaGamma { auto photons2_from_event_pool = emh2->GetTracksPerCollision(mix_dfId_collisionId); // LOGF(info, "Do event mixing: current event (%d, %d), ngamma = %d | event pool (%d, %d), nll = %d", ndf, collision.globalIndex(), selected_photons1_in_this_event.size(), mix_dfId, mix_collisionId, photons2_from_event_pool.size()); - for (auto& g1 : selected_photons1_in_this_event) { - for (auto& g2 : photons2_from_event_pool) { + for (const auto& g1 : selected_photons1_in_this_event) { + for (const auto& g2 : photons2_from_event_pool) { ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); if constexpr (pairtype == PairType::kPCMDalitzEE || pairtype == PairType::kPCMDalitzMuMu) { //[photon from event1, dilepton from event2] and [photon from event2, dilepton from event1] v2.SetM(g2.mass()); } ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - if (abs(v12.Rapidity()) > maxY) { + if (std::abs(v12.Rapidity()) > maxY) { continue; } fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), collision.weight()); } } } // end of loop over mixed event pool - for (auto& mix_dfId_collisionId : collisionIds1_in_mixing_pool) { + for (const auto& mix_dfId_collisionId : collisionIds1_in_mixing_pool) { int mix_dfId = mix_dfId_collisionId.first; int64_t mix_collisionId = mix_dfId_collisionId.second; @@ -770,15 +815,15 @@ struct Pi0EtaToGammaGamma { auto photons1_from_event_pool = emh1->GetTracksPerCollision(mix_dfId_collisionId); // LOGF(info, "Do event mixing: current event (%d, %d), nll = %d | event pool (%d, %d), ngamma = %d", ndf, collision.globalIndex(), selected_photons2_in_this_event.size(), mix_dfId, mix_collisionId, photons1_from_event_pool.size()); - for (auto& g1 : selected_photons2_in_this_event) { - for (auto& g2 : photons1_from_event_pool) { + for (const auto& g1 : selected_photons2_in_this_event) { + for (const auto& g2 : photons1_from_event_pool) { ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); if constexpr (pairtype == PairType::kPCMDalitzEE || pairtype == PairType::kPCMDalitzMuMu) { //[photon from event1, dilepton from event2] and [photon from event2, dilepton from event1] v1.SetM(g1.mass()); } ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - if (abs(v12.Rapidity()) > maxY) { + if (std::abs(v12.Rapidity()) > maxY) { continue; } fRegistry.fill(HIST("Pair/mix/hs"), v12.M(), v12.Pt(), collision.weight()); diff --git a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx index 83d5af15a8e..e99f1dba904 100644 --- a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx @@ -39,6 +39,7 @@ #include "Common/Core/EventPlaneHelper.h" #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Qvectors.h" +#include "CommonConstants/MathConstants.h" #include "DetectorsBase/GeometryManager.h" #include "DataFormatsEMCAL/Constants.h" @@ -77,7 +78,7 @@ enum CentralityEstimator { None = 0, NCentralityEstimators }; -struct EMfTaskPi0Flow { +struct TaskPi0FlowEMC { // configurable for flow Configurable harmonic{"harmonic", 2, "harmonic number"}; Configurable qvecDetector{"qvecDetector", 0, "Detector for Q vector estimation (FT0M: 0, FT0A: 1, FT0C: 2, TPC Pos: 3, TPC Neg: 4, TPC Tot: 5)"}; @@ -90,6 +91,7 @@ struct EMfTaskPi0Flow { Configurable cfgDoRotation{"cfgDoRotation", true, "Flag to enable rotation background method"}; Configurable cfgDownsampling{"cfgDownsampling", 1, "Calculate rotation background only for every collision"}; Configurable cfgRotAngle{"cfgRotAngle", M_PI / 2., "Angle used for the rotation method"}; + Configurable cfgDistanceToEdge{"cfgDistanceToEdge", 1, "Distance to edge in cells required for rotated cluster to be accepted"}; // configurable axis ConfigurableAxis thnConfigAxisInvMass{"thnConfigAxisInvMass", {200, 0.0, 0.4}, ""}; @@ -101,7 +103,7 @@ struct EMfTaskPi0Flow { EMPhotonEventCut fEMEventCut; struct : ConfigurableGroup { - std::string prefix = "eventcut_group"; + std::string prefix = "eventcuts"; Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; @@ -119,64 +121,72 @@ struct EMfTaskPi0Flow { Configurable cfgMinCent{"cfgMinCent", 0, "min. centrality (%)"}; Configurable cfgMaxCent{"cfgMaxCent", 90, "max. centrality (%)"}; Configurable onlyKeepWeightedEvents{"onlyKeepWeightedEvents", false, "flag to keep only weighted events (for JJ MCs) and remove all MB events (with weight = 1)"}; - Configurable enableQA{"enableQA", false, "flag to turn QA plots on/off"}; + Configurable cfgEnableQA{"cfgEnableQA", false, "flag to turn QA plots on/off"}; } eventcuts; EMCPhotonCut fEMCCut; struct : ConfigurableGroup { - std::string prefix = "emccut_group"; - Configurable EMC_minTime{"EMC_minTime", -25., "Minimum cluster time for EMCal time cut"}; - Configurable EMC_maxTime{"EMC_maxTime", +30., "Maximum cluster time for EMCal time cut"}; - Configurable EMC_minM02{"EMC_minM02", 0.1, "Minimum M02 for EMCal M02 cut"}; - Configurable EMC_maxM02{"EMC_maxM02", 0.7, "Maximum M02 for EMCal M02 cut"}; - Configurable EMC_minE{"EMC_minE", 0.7, "Minimum cluster energy for EMCal energy cut"}; - Configurable EMC_minNCell{"EMC_minNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; - Configurable> EMC_TM_Eta{"EMC_TM_Eta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; - Configurable> EMC_TM_Phi{"EMC_TM_Phi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; - Configurable EMC_Eoverp{"EMC_Eoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; - Configurable EMC_UseExoticCut{"EMC_UseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; - Configurable EMC_UseTM{"EMC_UseTM", false, "flag to use EMCal track matching cut or not"}; - Configurable enableQA{"enableQA", false, "flag to turn QA plots on/off"}; + std::string prefix = "emccuts"; + Configurable cfgEMCminTime{"cfgEMCminTime", -25., "Minimum cluster time for EMCal time cut"}; + Configurable cfgEMCmaxTime{"cfgEMCmaxTime", +30., "Maximum cluster time for EMCal time cut"}; + Configurable cfgEMCminM02{"cfgEMCminM02", 0.1, "Minimum M02 for EMCal M02 cut"}; + Configurable cfgEMCmaxM02{"cfgEMCmaxM02", 0.7, "Maximum M02 for EMCal M02 cut"}; + Configurable cfgEMCminE{"cfgEMCminE", 0.7, "Minimum cluster energy for EMCal energy cut"}; + Configurable cfgEMCminNCell{"cfgEMCminNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; + Configurable> cfgEMCTMEta{"cfgEMCTMEta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + Configurable> cfgEMCTMPhi{"cfgEMCTMPhi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + Configurable cfgEMCEoverp{"cfgEMCEoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; + Configurable cfgEMCUseExoticCut{"cfgEMCUseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; + Configurable cfgEMCUseTM{"cfgEMCUseTM", false, "flag to use EMCal track matching cut or not"}; + Configurable cfgEnableQA{"cfgEnableQA", false, "flag to turn QA plots on/off"}; } emccuts; struct : ConfigurableGroup { - std::string prefix = "meson"; + std::string prefix = "mesonConfig"; Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle. Default value one EMCal cell"}; Configurable enableTanThetadPhi{"enableTanThetadPhi", false, "flag to turn cut opening angle in delta theta delta phi on/off"}; Configurable minTanThetadPhi{"minTanThetadPhi", 4., "apply min opening angle in delta theta delta phi to cut on late conversion"}; Configurable maxEnergyAsymmetry{"maxEnergyAsymmetry", 1., "apply max energy asymmetry for meson candidate"}; - Configurable enableQA{"enableQA", false, "flag to turn QA plots on/off"}; + Configurable cfgEnableQA{"cfgEnableQA", false, "flag to turn QA plots on/off"}; ConfigurableAxis thConfigAxisTanThetaPhi{"thConfigAxisTanThetaPhi", {180, -90.f, 90.f}, ""}; } mesonConfig; struct : ConfigurableGroup { - std::string prefix = "event-mixing"; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f}, "Mixing bins - centrality"}; - ConfigurableAxis ConfEPBins{"ConfEPBins", {8, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"}; - ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, 0, 100, 500, 1000, 2000}, "Mixing bins - occupancy"}; - Configurable ConfMixingDepth{"ConfMixingDepth", 2, "Mixing depth"}; + std::string prefix = "mixingConfig"; + ConfigurableAxis cfgVtxBins{"cfgVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + ConfigurableAxis cfgCentBins{"cfgCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f}, "Mixing bins - centrality"}; + ConfigurableAxis cfgEPBins{"cfgEPBins", {8, o2::constants::math::PIHalf, o2::constants::math::PIHalf}, "Mixing bins - event plane angle"}; + ConfigurableAxis cfgOccupancyBins{"cfgOccupancyBins", {VARIABLE_WIDTH, 0, 100, 500, 1000, 2000}, "Mixing bins - occupancy"}; + Configurable cfgMixingDepth{"cfgMixingDepth", 2, "Mixing depth"}; } mixingConfig; + struct : ConfigurableGroup { + std::string prefix = "correctionConfig"; + Configurable cfgSpresoPath{"cfgSpresoPath", "Users/m/mhemmer/EM/Flow/Resolution", "Path to SP resolution file"}; + Configurable cfgApplySPresolution{"cfgApplySPresolution", 0, "Apply resolution correction"}; + } correctionConfig; + SliceCache cache; EventPlaneHelper epHelper; o2::framework::Service ccdb; - Filter clusterFilter = aod::skimmedcluster::time >= emccuts.EMC_minTime && aod::skimmedcluster::time <= emccuts.EMC_maxTime && aod::skimmedcluster::m02 >= emccuts.EMC_minM02 && aod::skimmedcluster::m02 <= emccuts.EMC_maxM02 && skimmedcluster::e >= emccuts.EMC_minE; + Filter clusterFilter = aod::skimmedcluster::time >= emccuts.cfgEMCminTime && aod::skimmedcluster::time <= emccuts.cfgEMCmaxTime && aod::skimmedcluster::m02 >= emccuts.cfgEMCminM02 && aod::skimmedcluster::m02 <= emccuts.cfgEMCmaxM02 && skimmedcluster::e >= emccuts.cfgEMCminE; Filter collisionFilter = aod::evsel::sel8 && nabs(aod::collision::posZ) <= eventcuts.cfgZvtxMax && aod::evsel::trackOccupancyInTimeRange <= eventcuts.cfgTrackOccupancyMax && aod::evsel::trackOccupancyInTimeRange >= eventcuts.cfgTrackOccupancyMin && aod::evsel::ft0cOccupancyInTimeRange <= eventcuts.cfgFT0COccupancyMax && aod::evsel::ft0cOccupancyInTimeRange >= eventcuts.cfgFT0COccupancyMin; using FilteredEMCalPhotons = soa::Filtered>; using EMCalPhotons = soa::Join; using FilteredCollsWithQvecs = soa::Filtered>; using CollsWithQvecs = soa::Join; - Preslice perCollision_emc = aod::emccluster::emeventId; - Preslice perCollision_emc_filtered = aod::emccluster::emeventId; + Preslice perCollisionEMC = aod::emccluster::emeventId; + Preslice perCollisionEMCFiltered = aod::emccluster::emeventId; HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; o2::emcal::Geometry* emcalGeom; + TH1D* h1SPResolution = nullptr; + float epsilon = 1.e-8; - void DefineEMEventCut() + void defineEMEventCut() { fEMEventCut = EMPhotonEventCut("fEMEventCut", "fEMEventCut"); fEMEventCut.SetRequireSel8(eventcuts.cfgRequireSel8); @@ -191,26 +201,26 @@ struct EMfTaskPi0Flow { fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); } - void DefineEMCCut() + void defineEMCCut() { fEMCCut = EMCPhotonCut("fEMCCut", "fEMCCut"); - const float a = emccuts.EMC_TM_Eta->at(0); - const float b = emccuts.EMC_TM_Eta->at(1); - const float c = emccuts.EMC_TM_Eta->at(2); + const float a = emccuts.cfgEMCTMEta->at(0); + const float b = emccuts.cfgEMCTMEta->at(1); + const float c = emccuts.cfgEMCTMEta->at(2); - const float d = emccuts.EMC_TM_Phi->at(0); - const float e = emccuts.EMC_TM_Phi->at(1); - const float f = emccuts.EMC_TM_Phi->at(2); + const float d = emccuts.cfgEMCTMPhi->at(0); + const float e = emccuts.cfgEMCTMPhi->at(1); + const float f = emccuts.cfgEMCTMPhi->at(2); LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); - fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + pow(pT + b, c); }); - fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + pow(pT + e, f); }); - fEMCCut.SetMinEoverP(emccuts.EMC_Eoverp); - - fEMCCut.SetMinE(emccuts.EMC_minE); - fEMCCut.SetMinNCell(emccuts.EMC_minNCell); - fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); - fEMCCut.SetTimeRange(emccuts.EMC_minTime, emccuts.EMC_maxTime); - fEMCCut.SetUseExoticCut(emccuts.EMC_UseExoticCut); + fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + std::pow(pT + b, c); }); + fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + std::pow(pT + e, f); }); + fEMCCut.SetMinEoverP(emccuts.cfgEMCEoverp); + + fEMCCut.SetMinE(emccuts.cfgEMCminE); + fEMCCut.SetMinNCell(emccuts.cfgEMCminNCell); + fEMCCut.SetM02Range(emccuts.cfgEMCminM02, emccuts.cfgEMCmaxM02); + fEMCCut.SetTimeRange(emccuts.cfgEMCminTime, emccuts.cfgEMCmaxTime); + fEMCCut.SetUseExoticCut(emccuts.cfgEMCUseExoticCut); } void init(InitContext&) @@ -219,9 +229,9 @@ struct EMfTaskPi0Flow { LOG(info) << "Harmonic was set to " << harmonic << " but can only be 2 or 3!"; } - DefineEMEventCut(); - DefineEMCCut(); - fEMCCut.SetUseTM(emccuts.EMC_UseTM); // disables TM + defineEMEventCut(); + defineEMCCut(); + fEMCCut.SetUseTM(emccuts.cfgEMCUseTM); // disables TM o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(®istry); // Load EMCal geometry @@ -242,7 +252,9 @@ struct EMfTaskPi0Flow { const AxisSpec thAxisEta{160, -0.8, 0.8, "#eta"}; const AxisSpec thAxisPhi{72, 0, 2 * 3.14159, "phi"}; const AxisSpec thAxisNCell{17664, 0.5, +17664.5, "#it{N}_{cell}"}; - const AxisSpec thAxisPsi{360 / harmonic.value, -(1. / static_cast(harmonic.value)) * M_PI, (1. / static_cast(harmonic.value)) * M_PI, Form("#Psi_{%d}", harmonic.value)}; + const AxisSpec thAxisPsi{360 / harmonic.value, -(1. / static_cast(harmonic.value)) * std::numbers::pi_v, (1. / static_cast(harmonic.value)) * std::numbers::pi_v, Form("#Psi_{%d}", harmonic.value)}; + const AxisSpec thAxisCN{8, 0.5, 8.5, "#it{c}_{n}"}; + const AxisSpec thAxisSN{8, 0.5, 8.5, "#it{s}_{n}"}; registry.add("hSparsePi0Flow", "THn for SP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisScalarProd}); registry.add("hSparseBkgFlow", "THn for SP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisScalarProd}); @@ -283,8 +295,20 @@ struct EMfTaskPi0Flow { registry.add("epReso/hEpResoFT0mTPCneg", "hEpResoFT0mTPCneg; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); registry.add("epReso/hEpResoFT0mTPCtot", "hEpResoFT0mTPCtot; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); registry.add("epReso/hEpResoTPCposTPCneg", "hEpResoTPCposTPCneg; centrality; #Delta#Psi_{sub}", HistType::kTH2D, {thnAxisCent, thnAxisCosNPhi}); + registry.add("epReso/hEpCosCoefficientsFT0c", "hEpCosCoefficientsFT0c; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsFT0c", "hEpSinCoefficientsFT0c; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); + registry.add("epReso/hEpCosCoefficientsFT0a", "hEpCosCoefficientsFT0a; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsFT0a", "hEpSinCoefficientsFT0a; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); + registry.add("epReso/hEpCosCoefficientsFT0m", "hEpCosCoefficientsFT0m; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsFT0m", "hEpSinCoefficientsFT0m; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); + registry.add("epReso/hEpCosCoefficientsTPCpos", "hEpCosCoefficientsTPCpos; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsTPCpos", "hEpSinCoefficientsTPCpos; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); + registry.add("epReso/hEpCosCoefficientsTPCneg", "hEpCosCoefficientsTPCneg; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsTPCneg", "hEpSinCoefficientsTPCneg; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); + registry.add("epReso/hEpCosCoefficientsTPCTots", "hEpCosCoefficientsTPCTots; centrality; c_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisCN}); + registry.add("epReso/hEpSinCoefficientsTPCTots", "hEpSinCoefficientsTPCTots; centrality; s_{n}", HistType::kTProfile2D, {thnAxisCent, thAxisSN}); } - if (eventcuts.enableQA) { + if (eventcuts.cfgEnableQA) { auto hCollisionEMCCheck = registry.add("hCollisionEMCCheck", "collision counter;;Counts", kTH1D, {{7, 0.5, 7.5}}, false); hCollisionEMCCheck->GetXaxis()->SetBinLabel(1, "all"); hCollisionEMCCheck->GetXaxis()->SetBinLabel(2, "EMC MB Readout"); @@ -299,12 +323,12 @@ struct EMfTaskPi0Flow { registry.add("LED/hNCell", "hNCell", HistType::kTH1D, {thAxisNCell}); } - if (emccuts.enableQA) { + if (emccuts.cfgEnableQA) { registry.add("hEClusterBefore", "Histo for cluster energy before cuts", HistType::kTH1D, {thAxisClusterEnergy}); registry.add("hEClusterAfter", "Histo for cluster energy after cuts", HistType::kTH1D, {thAxisClusterEnergy}); } - if (mesonConfig.enableQA) { + if (mesonConfig.cfgEnableQA) { registry.add("hInvMassPt", "Histo for inv pair mass vs pt", HistType::kTH2D, {thnAxisInvMass, thnAxisPt}); registry.add("hTanThetaPhi", "Histo for identification of conversion cluster", HistType::kTH2D, {thnAxisInvMass, thAxisTanThetaPhi}); registry.add("hAlphaPt", "Histo of meson asymmetry vs pT", HistType::kTH2D, {thAxisAlpha, thnAxisPt}); @@ -313,11 +337,20 @@ struct EMfTaskPi0Flow { ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); LOG(info) << "thnConfigAxisInvMass.value[1] = " << thnConfigAxisInvMass.value[1] << " thnConfigAxisInvMass.value.back() = " << thnConfigAxisInvMass.value.back(); LOG(info) << "thnConfigAxisPt.value[1] = " << thnConfigAxisPt.value[1] << " thnConfigAxisPt.value.back() = " << thnConfigAxisPt.value.back(); }; // end init + template + void initCCDB(TCollision const& collision) + { + if (correctionConfig.cfgApplySPresolution.value) { + h1SPResolution = ccdb->getForTimeStamp(correctionConfig.cfgSpresoPath.value, collision.timestamp()); + } + } + /// Change radians to degree /// \param angle in radians /// \return angle in degree @@ -470,7 +503,7 @@ struct EMfTaskPi0Flow { bool isQvecGood(std::vector const& QVecs) { bool isgood = true; - for (auto& QVec : QVecs) { + for (const auto& QVec : QVecs) { if (std::fabs(QVec) > 20.f) { isgood = false; break; @@ -479,9 +512,44 @@ struct EMfTaskPi0Flow { return isgood; } + bool isTooCloseToEdge(const int cellID, const int DistanceToBorder = 1) + { + if (DistanceToBorder <= 0) { + return false; + } + if (cellID < 0) { + return true; + } + + int iBadCell = -1; + + // check distance to border in case the cell is okay + auto [iSupMod, iMod, iPhi, iEta] = emcalGeom->GetCellIndex(cellID); + auto [irow, icol] = emcalGeom->GetCellPhiEtaIndexInSModule(iSupMod, iMod, iPhi, iEta); + + // Check rows/phi + int iRowLast = 24; + if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::EMCAL_HALF) { + iRowLast /= 2; // 2/3 sm case + } else if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::EMCAL_THIRD) { + iRowLast /= 3; // 1/3 sm case + } else if (emcalGeom->GetSMType(iSupMod) == o2::emcal::EMCALSMType::DCAL_EXT) { + iRowLast /= 3; // 1/3 sm case + } + + if (irow < DistanceToBorder || (iRowLast - irow) <= DistanceToBorder) { + iBadCell = 1; + } + + if (iBadCell > 0) { + return true; + } + return false; + } + /// \brief Calculate background using rotation background method template - void RotationBackground(const ROOT::Math::PtEtaPhiMVector& meson, ROOT::Math::PtEtaPhiMVector photon1, ROOT::Math::PtEtaPhiMVector photon2, TPhotons const& photons_coll, unsigned int ig1, unsigned int ig2, CollsWithQvecs::iterator const& collision) + void rotationBackground(const ROOT::Math::PtEtaPhiMVector& meson, ROOT::Math::PtEtaPhiMVector photon1, ROOT::Math::PtEtaPhiMVector photon2, TPhotons const& photons_coll, unsigned int ig1, unsigned int ig2, CollsWithQvecs::iterator const& collision) { // if less than 3 clusters are present skip event since we need at least 3 clusters if (photons_coll.size() < 3) { @@ -490,8 +558,8 @@ struct EMfTaskPi0Flow { auto [xQVec, yQVec] = getQvec(collision, qvecDetector); float cent = getCentrality(collision); - int iCellID_photon1 = 0; - int iCellID_photon2 = 0; + int iCellIDPhoton1 = 0; + int iCellIDPhoton = 0; ROOT::Math::AxisAngle rotationAxis(meson.Vect(), cfgRotAngle.value); ROOT::Math::Rotation3D rotationMatrix(rotationAxis); @@ -499,20 +567,26 @@ struct EMfTaskPi0Flow { photon2 = rotationMatrix * photon2; try { - iCellID_photon1 = emcalGeom->GetAbsCellIdFromEtaPhi(photon1.Eta(), photon1.Phi()); + iCellIDPhoton1 = emcalGeom->GetAbsCellIdFromEtaPhi(photon1.Eta(), photon1.Phi()); + if (isTooCloseToEdge(iCellIDPhoton1, cfgDistanceToEdge.value)) { + iCellIDPhoton1 = -1; + } } catch (o2::emcal::InvalidPositionException& e) { - iCellID_photon1 = -1; + iCellIDPhoton1 = -1; } try { - iCellID_photon2 = emcalGeom->GetAbsCellIdFromEtaPhi(photon2.Eta(), photon2.Phi()); + iCellIDPhoton = emcalGeom->GetAbsCellIdFromEtaPhi(photon2.Eta(), photon2.Phi()); + if (isTooCloseToEdge(iCellIDPhoton, cfgDistanceToEdge.value)) { + iCellIDPhoton = -1; + } } catch (o2::emcal::InvalidPositionException& e) { - iCellID_photon2 = -1; + iCellIDPhoton = -1; } - if (iCellID_photon1 == -1 && iCellID_photon2 == -1) { + if (iCellIDPhoton1 == -1 && iCellIDPhoton == -1) { return; } - for (auto& photon : photons_coll) { + for (const auto& photon : photons_coll) { if (photon.globalIndex() == ig1 || photon.globalIndex() == ig2) { // only combine rotated photons with other photons continue; @@ -521,17 +595,22 @@ struct EMfTaskPi0Flow { continue; } ROOT::Math::PtEtaPhiMVector photon3(photon.pt(), photon.eta(), photon.phi(), 0.); - if (iCellID_photon1 > 0) { + if (iCellIDPhoton1 > 0) { ROOT::Math::PtEtaPhiMVector mother1 = photon1 + photon3; float openingAngle1 = std::acos(photon1.Vect().Dot(photon3.Vect()) / (photon1.P() * photon3.P())); float cosNPhi1 = std::cos(harmonic * mother1.Phi()); float sinNPhi1 = std::sin(harmonic * mother1.Phi()); float scalprodCand1 = cosNPhi1 * xQVec + sinNPhi1 * yQVec; + + if (correctionConfig.cfgApplySPresolution.value) { + scalprodCand1 = scalprodCand1 / h1SPResolution->GetBinContent(h1SPResolution->FindBin(cent + epsilon)); + } + if (openingAngle1 > mesonConfig.minOpenAngle && thnConfigAxisInvMass.value[1] <= mother1.M() && thnConfigAxisInvMass.value.back() >= mother1.M() && thnConfigAxisPt.value[1] <= mother1.Pt() && thnConfigAxisPt.value.back() >= mother1.Pt()) { if (mesonConfig.enableTanThetadPhi) { float dTheta = photon1.Theta() - photon3.Theta(); float dPhi = photon1.Phi() - photon3.Phi(); - if (mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(atan(dTheta / dPhi)))) { + if (mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(std::atan(dTheta / dPhi)))) { registry.fill(HIST("hSparseBkgFlow"), mother1.M(), mother1.Pt(), cent, scalprodCand1); } } else { @@ -539,18 +618,22 @@ struct EMfTaskPi0Flow { } } } - if (iCellID_photon2 > 0) { + if (iCellIDPhoton > 0) { ROOT::Math::PtEtaPhiMVector mother2 = photon2 + photon3; float openingAngle2 = std::acos(photon2.Vect().Dot(photon3.Vect()) / (photon2.P() * photon3.P())); float cosNPhi2 = std::cos(harmonic * mother2.Phi()); float sinNPhi2 = std::sin(harmonic * mother2.Phi()); float scalprodCand2 = cosNPhi2 * xQVec + sinNPhi2 * yQVec; + if (correctionConfig.cfgApplySPresolution.value) { + scalprodCand2 = scalprodCand2 / h1SPResolution->GetBinContent(h1SPResolution->FindBin(cent + epsilon)); + } + if (openingAngle2 > mesonConfig.minOpenAngle && thnConfigAxisInvMass.value[1] <= mother2.M() && thnConfigAxisInvMass.value.back() >= mother2.M() && thnConfigAxisPt.value[1] <= mother2.Pt() && thnConfigAxisPt.value.back() >= mother2.Pt()) { if (mesonConfig.enableTanThetadPhi) { float dTheta = photon2.Theta() - photon3.Theta(); float dPhi = photon2.Phi() - photon3.Phi(); - if (mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(atan(dTheta / dPhi)))) { + if (mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(std::atan(dTheta / dPhi)))) { registry.fill(HIST("hSparseBkgFlow"), mother2.M(), mother2.Pt(), cent, scalprodCand2); } } else { @@ -578,6 +661,10 @@ struct EMfTaskPi0Flow { float sinNPhi = std::sin(harmonic * phiCand); float scalprodCand = cosNPhi * xQVec + sinNPhi * yQVec; + if (correctionConfig.cfgApplySPresolution.value) { + scalprodCand = scalprodCand / h1SPResolution->GetBinContent(h1SPResolution->FindBin(cent + epsilon)); + } + fillThn(massCand, ptCand, cent, scalprodCand); return; } @@ -585,27 +672,27 @@ struct EMfTaskPi0Flow { // Pi0 from EMCal void processEMCal(CollsWithQvecs const& collisions, EMCalPhotons const& clusters) { - int NColl = 1; - for (auto& collision : collisions) { - auto photons_per_collision = clusters.sliceBy(perCollision_emc, collision.globalIndex()); + int nColl = 1; + for (const auto& collision : collisions) { + auto photonsPerCollision = clusters.sliceBy(perCollisionEMC, collision.globalIndex()); - if (eventcuts.enableQA) { + if (eventcuts.cfgEnableQA) { // TODO: check EMCal NCells in collisions without EMC Readout registry.fill(HIST("hCollisionEMCCheck"), 1.); // all if (collision.alias_bit(kTVXinEMC) == true) { registry.fill(HIST("hCollisionEMCCheck"), 2.); // has EMC read out - if (photons_per_collision.size() > 0) { + if (photonsPerCollision.size() > 0) { registry.fill(HIST("hCollisionEMCCheck"), 3.); // has EMC cluster registry.fill(HIST("hCollisionEMCCheck"), 4.); // has EMC read out and clusters } else { registry.fill(HIST("hCollisionEMCCheck"), 5.); // has EMC read out but no clusters } } else { - if (photons_per_collision.size() > 0) { + if (photonsPerCollision.size() > 0) { registry.fill(HIST("hCollisionEMCCheck"), 3.); // has EMC cluster registry.fill(HIST("hCollisionEMCCheck"), 6.); // has no EMC read out and clusters registry.fill(HIST("LED/hMult"), collision.multFT0C()); - for (auto& photon : photons_per_collision) { + for (const auto& photon : photonsPerCollision) { registry.fill(HIST("LED/hClusterEtaPhi"), photon.phi(), photon.eta()); registry.fill(HIST("LED/clusterTimeVsE"), photon.time(), photon.e()); registry.fill(HIST("LED/hNCell"), photon.nCells()); @@ -619,7 +706,6 @@ struct EMfTaskPi0Flow { if (!(fEMEventCut.IsSelected(collision))) { // general event selection continue; - continue; } if (!(eventcuts.cfgTrackOccupancyMin <= collision.trackOccupancyInTimeRange() && collision.trackOccupancyInTimeRange() < eventcuts.cfgTrackOccupancyMax)) { // occupancy selection @@ -634,12 +720,13 @@ struct EMfTaskPi0Flow { // selection based on QVector continue; } + initCCDB(collision); o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(®istry, collision); registry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted registry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted - if (emccuts.enableQA) { - for (auto& photon : photons_per_collision) { + if (emccuts.cfgEnableQA) { + for (const auto& photon : photonsPerCollision) { registry.fill(HIST("hEClusterBefore"), photon.e()); // before cuts if (!(fEMCCut.IsSelected(photon))) { continue; @@ -647,7 +734,7 @@ struct EMfTaskPi0Flow { registry.fill(HIST("hEClusterAfter"), photon.e()); // accepted after cuts } } - for (auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photons_per_collision, photons_per_collision))) { + for (const auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photonsPerCollision, photonsPerCollision))) { if (!(fEMCCut.IsSelected(g1)) || !(fEMCCut.IsSelected(g2))) { continue; } @@ -663,8 +750,8 @@ struct EMfTaskPi0Flow { continue; } if (cfgDoRotation) { - if (NColl % cfgDownsampling.value == 0) { - RotationBackground(vMeson, v1, v2, photons_per_collision, g1.globalIndex(), g2.globalIndex(), collision); + if (nColl % cfgDownsampling.value == 0) { + rotationBackground(vMeson, v1, v2, photonsPerCollision, g1.globalIndex(), g2.globalIndex(), collision); } } if (thnConfigAxisInvMass.value[1] > vMeson.M() || thnConfigAxisInvMass.value.back() < vMeson.M()) { @@ -675,12 +762,12 @@ struct EMfTaskPi0Flow { registry.fill(HIST("hClusterCuts"), 4); continue; } - if (mesonConfig.enableQA) { + if (mesonConfig.cfgEnableQA) { registry.fill(HIST("hInvMassPt"), vMeson.M(), vMeson.Pt()); - registry.fill(HIST("hTanThetaPhi"), vMeson.M(), getAngleDegree(atan(dTheta / dPhi))); + registry.fill(HIST("hTanThetaPhi"), vMeson.M(), getAngleDegree(std::atan(dTheta / dPhi))); registry.fill(HIST("hAlphaPt"), (v1.E() - v2.E()) / (v1.E() + v2.E()), vMeson.Pt()); } - if (mesonConfig.enableTanThetadPhi && mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(atan(dTheta / dPhi)))) { + if (mesonConfig.enableTanThetadPhi && mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(std::atan(dTheta / dPhi)))) { registry.fill(HIST("hClusterCuts"), 5); continue; } @@ -688,15 +775,15 @@ struct EMfTaskPi0Flow { runFlowAnalysis(collision, vMeson); } if (cfgDoRotation) { - if (NColl % cfgDownsampling.value == 0) { - NColl = 1; // reset counter + if (nColl % cfgDownsampling.value == 0) { + nColl = 1; // reset counter } else { - NColl++; + nColl++; } } } } - PROCESS_SWITCH(EMfTaskPi0Flow, processEMCal, "Process EMCal Pi0 candidates", true); + PROCESS_SWITCH(TaskPi0FlowEMC, processEMCal, "Process EMCal Pi0 candidates", true); // Pi0 from EMCal void processEMCalMixed(FilteredCollsWithQvecs const& collisions, FilteredEMCalPhotons const& clusters) @@ -708,12 +795,12 @@ struct EMfTaskPi0Flow { }; using BinningType = FlexibleBinningPolicy, aod::collision::PosZ, aod::cent::CentFT0C, emevent::EP2FT0M>; - BinningType binningWithLambda{{getClustersSize}, {mixingConfig.ConfVtxBins, mixingConfig.ConfCentBins, mixingConfig.ConfEPBins}, true}; + BinningType binningWithLambda{{getClustersSize}, {mixingConfig.cfgVtxBins, mixingConfig.cfgCentBins, mixingConfig.cfgEPBins}, true}; auto clustersTuple = std::make_tuple(clusters); - SameKindPair pair{binningWithLambda, mixingConfig.ConfMixingDepth, -1, collisions, clustersTuple, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored + SameKindPair pair{binningWithLambda, mixingConfig.cfgMixingDepth, -1, collisions, clustersTuple, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored - for (auto& [c1, clusters1, c2, clusters2] : pair) { + for (const auto& [c1, clusters1, c2, clusters2] : pair) { if (!(fEMEventCut.IsSelected(c1)) || !(fEMEventCut.IsSelected(c2))) { // general event selection continue; @@ -730,7 +817,8 @@ struct EMfTaskPi0Flow { // selection based on QVector continue; } - for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(clusters1, clusters2))) { + initCCDB(c1); + for (const auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(clusters1, clusters2))) { if (!(fEMCCut.IsSelected(g1)) || !(fEMCCut.IsSelected(g2))) { continue; } @@ -755,12 +843,12 @@ struct EMfTaskPi0Flow { registry.fill(HIST("hClusterCuts"), 4); continue; } - if (mesonConfig.enableQA) { + if (mesonConfig.cfgEnableQA) { registry.fill(HIST("hInvMassPt"), vMeson.M(), vMeson.Pt()); - registry.fill(HIST("hTanThetaPhi"), vMeson.M(), getAngleDegree(atan(dTheta / dPhi))); + registry.fill(HIST("hTanThetaPhi"), vMeson.M(), getAngleDegree(std::atan(dTheta / dPhi))); registry.fill(HIST("hAlphaPt"), (v1.E() - v2.E()) / (v1.E() + v2.E()), vMeson.Pt()); } - if (mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(atan(dTheta / dPhi)))) { + if (mesonConfig.minTanThetadPhi > std::fabs(getAngleDegree(std::atan(dTheta / dPhi)))) { registry.fill(HIST("hClusterCuts"), 5); continue; } @@ -769,7 +857,7 @@ struct EMfTaskPi0Flow { } } } - PROCESS_SWITCH(EMfTaskPi0Flow, processEMCalMixed, "Process EMCal Pi0 mixed event candidates", false); + PROCESS_SWITCH(TaskPi0FlowEMC, processEMCalMixed, "Process EMCal Pi0 mixed event candidates", false); // Resolution void processResolution(CollsWithQvecs::iterator const& collision) @@ -873,13 +961,27 @@ struct EMfTaskPi0Flow { registry.fill(HIST("epReso/hEpResoFT0mTPCneg"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFT0m, epBNegs))); registry.fill(HIST("epReso/hEpResoFT0mTPCtot"), centrality, std::cos(harmonic * getDeltaPsiInRange(epFT0m, epBTots))); registry.fill(HIST("epReso/hEpResoTPCposTPCneg"), centrality, std::cos(harmonic * getDeltaPsiInRange(epBPoss, epBNegs))); + for (int n = 1; n <= 8; n++) { + registry.fill(HIST("epReso/hEpCosCoefficientsFT0c"), centrality, n, std::cos(n * epFT0c)); + registry.fill(HIST("epReso/hEpSinCoefficientsFT0c"), centrality, n, std::sin(n * epFT0c)); + registry.fill(HIST("epReso/hEpCosCoefficientsFT0a"), centrality, n, std::cos(n * epFT0a)); + registry.fill(HIST("epReso/hEpSinCoefficientsFT0a"), centrality, n, std::sin(n * epFT0a)); + registry.fill(HIST("epReso/hEpCosCoefficientsFT0m"), centrality, n, std::cos(n * epFT0m)); + registry.fill(HIST("epReso/hEpSinCoefficientsFT0m"), centrality, n, std::sin(n * epFT0m)); + registry.fill(HIST("epReso/hEpCosCoefficientsTPCpos"), centrality, n, std::cos(n * epBPoss)); + registry.fill(HIST("epReso/hEpSinCoefficientsTPCpos"), centrality, n, std::sin(n * epBPoss)); + registry.fill(HIST("epReso/hEpCosCoefficientsTPCneg"), centrality, n, std::cos(n * epBNegs)); + registry.fill(HIST("epReso/hEpSinCoefficientsTPCneg"), centrality, n, std::sin(n * epBNegs)); + registry.fill(HIST("epReso/hEpCosCoefficientsTPCTots"), centrality, n, std::cos(n * epBTots)); + registry.fill(HIST("epReso/hEpSinCoefficientsTPCTots"), centrality, n, std::sin(n * epBTots)); + } } } - PROCESS_SWITCH(EMfTaskPi0Flow, processResolution, "Process resolution", false); + PROCESS_SWITCH(TaskPi0FlowEMC, processResolution, "Process resolution", false); -}; // End struct EMfTaskPi0Flow +}; // End struct TaskPi0FlowEMC WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 4c3e7e0247e22f03c73b5564cd0bacf80522f75f Mon Sep 17 00:00:00 2001 From: rolavick Date: Wed, 4 Dec 2024 09:24:46 +0100 Subject: [PATCH 236/459] [PWGUD] suppress SGProducers printouts to terminal (#8791) --- PWGUD/TableProducer/SGCandProducer.cxx | 52 +++++++++++++++++--------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/PWGUD/TableProducer/SGCandProducer.cxx b/PWGUD/TableProducer/SGCandProducer.cxx index aabaa4357ae..967e7a838d0 100644 --- a/PWGUD/TableProducer/SGCandProducer.cxx +++ b/PWGUD/TableProducer/SGCandProducer.cxx @@ -34,6 +34,7 @@ struct SGCandProducer { // get an SGCutparHolder SGCutParHolder sameCuts = SGCutParHolder(); // SGCutparHolder Configurable SGCuts{"SGCuts", {}, "SG event cuts"}; + Configurable verboseInfo{"verboseInfo", false, "Print general info to terminal; default it false."}; Configurable saveAllTracks{"saveAllTracks", true, "save only PV contributors or all tracks associated to a collision"}; Configurable savenonPVCITSOnlyTracks{"savenonPVCITSOnlyTracks", false, "save non PV contributors with ITS only information"}; Configurable rejectAtTFBoundary{"rejectAtTFBoundary", true, "reject collisions at a TF boundary"}; @@ -172,7 +173,8 @@ struct SGCandProducer { void process(CC const& collision, BCs const& bcs, TCs& tracks, FWs& fwdtracks, aod::Zdcs& /*zdcs*/, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds) { - LOGF(debug, " collision %d", collision.globalIndex()); + if (verboseInfo) + LOGF(debug, " collision %d", collision.globalIndex()); registry.get(HIST("reco/Stat"))->Fill(0., 1.); // reject collisions at TF boundaries if (rejectAtTFBoundary && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { @@ -215,11 +217,13 @@ struct SGCandProducer { if (isSGEvent.bc && issgevent < 2) { newbc = *(isSGEvent.bc); } else { - LOGF(info, "No Newbc %i", bc.globalBC()); + if (verboseInfo) + LOGF(info, "No Newbc %i", bc.globalBC()); } registry.get(HIST("reco/Stat"))->Fill(issgevent + 8, 1.); if (issgevent <= 2) { - // LOGF(info, "Current BC: %i, %i, %i", bc.globalBC(), newbc.globalBC(), issgevent); + if (verboseInfo) + LOGF(info, "Current BC: %i, %i, %i", bc.globalBC(), newbc.globalBC(), issgevent); if (sameCuts.minRgtrwTOF()) { if (udhelpers::rPVtrwTOF(tracks, collision.numContrib()) < sameCuts.minRgtrwTOF()) return; @@ -281,6 +285,7 @@ struct SGCandProducer { struct McSGCandProducer { // MC tables + Configurable verboseInfoMC{"verboseInfoMC", false, "Print general info to terminal; default it false."}; Produces outputMcCollisions; Produces outputMcParticles; Produces outputMcCollsLabels; @@ -374,7 +379,8 @@ struct McSGCandProducer { auto oldmids = mcpart.mothersIds(); for (auto oldmid : oldmids) { auto m = McParts.rawIteratorAt(oldmid); - LOGF(debug, " m %d", m.globalIndex()); + if (verboseInfoMC) + LOGF(debug, " m %d", m.globalIndex()); if (mcPartIsSaved.find(oldmid) != mcPartIsSaved.end()) { newval = mcPartIsSaved[oldmid]; } else { @@ -392,7 +398,8 @@ struct McSGCandProducer { } newdids[ii] = newval; } - LOGF(debug, " ms %i ds %i", oldmids.size(), olddids.size()); + if (verboseInfoMC) + LOGF(debug, " ms %i ds %i", oldmids.size(), olddids.size()); // update UDMcParticles outputMcParticles(McCollisionId, @@ -474,11 +481,14 @@ struct McSGCandProducer { UDCCs const& sgcands, UDTCs const& udtracks, CCs const& /*collisions*/, BCs const& /*bcs*/, TCs const& /*tracks*/) { - LOGF(info, "Number of McCollisions %d", mccols.size()); - LOGF(info, "Number of SG candidates %d", sgcands.size()); - LOGF(info, "Number of UD tracks %d", udtracks.size()); + if (verboseInfoMC) { + LOGF(info, "Number of McCollisions %d", mccols.size()); + LOGF(info, "Number of SG candidates %d", sgcands.size()); + LOGF(info, "Number of UD tracks %d", udtracks.size()); + } if (sgcands.size() <= 0) { - LOGF(info, "No DG candidates to save!"); + if (verboseInfoMC) + LOGF(info, "No DG candidates to save!"); return; } @@ -519,14 +529,16 @@ struct McSGCandProducer { // colId = -1; mcsgId = -1; } - LOGF(info, "\nStart of loop mcsgId %d mccolId %d", mcsgId, mccolId); + if (verboseInfoMC) + LOGF(info, "\nStart of loop mcsgId %d mccolId %d", mcsgId, mccolId); // two cases to consider // 1. mcdgId <= mccolId: the event to process is a dgcand. In this case the Mc tables as well as the McLabel tables are updated // 2. mccolId < mcdgId: the event to process is an MC event of interest without reconstructed dgcand. In this case only the Mc tables are updated if ((!sgcandAtEnd && !mccolAtEnd && (mcsgId <= mccolId)) || mccolAtEnd) { // this is case 1. - // LOGF(info, "Doing case 1 with mcsgId %d", mcsgId); + if (verboseInfoMC) + LOGF(info, "Doing case 1 with mcsgId %d", mcsgId); // update UDMcCollisions and UDMcColsLabels (for each UDCollision -> UDMcCollisions) // update UDMcParticles and UDMcTrackLabels (for each UDTrack -> UDMcParticles) @@ -537,7 +549,8 @@ struct McSGCandProducer { // McParticles are saved if (mcsgId >= 0) { if (mcColIsSaved.find(mcsgId) == mcColIsSaved.end()) { - LOGF(info, " Saving McCollision %d", mcsgId); + if (verboseInfoMC) + LOGF(info, " Saving McCollision %d", mcsgId); // update UDMcCollisions auto sgcandMcCol = sgcand.collision_as().mcCollision(); updateUDMcCollisions(sgcandMcCol, globBC); @@ -557,7 +570,8 @@ struct McSGCandProducer { } else { // If the sgcand has no associated McCollision then only the McParticles which are associated // with the tracks of the sgcand are saved - // LOGF(info, " Saving McCollision %d", -1); + if (verboseInfoMC) + LOGF(info, " Saving McCollision %d", -1); // update UDMcColsLabels (for each UDCollision -> UDMcCollisions) outputMcCollsLabels(-1); @@ -587,11 +601,13 @@ struct McSGCandProducer { } } else { // this is case 2. - LOGF(info, "Doing case 2"); + if (verboseInfoMC) + LOGF(info, "Doing case 2"); // update UDMcCollisions and UDMcParticles if (mcColIsSaved.find(mccolId) == mcColIsSaved.end()) { - LOGF(info, " Saving McCollision %d", mccolId); + if (verboseInfoMC) + LOGF(info, " Saving McCollision %d", mccolId); // update UDMcCollisions updateUDMcCollisions(mccol, globBC); mcColIsSaved[mccolId] = outputMcCollisions.lastIndex(); @@ -611,14 +627,16 @@ struct McSGCandProducer { } goon = !sgcandAtEnd || !mccolAtEnd; - // LOGF(info, "End of loop mcsgId %d mccolId %d", mcsgId, mccolId); + if (verboseInfoMC) + LOGF(info, "End of loop mcsgId %d mccolId %d", mcsgId, mccolId); } } PROCESS_SWITCH(McSGCandProducer, processMC, "Produce MC tables", false); void processDummy(aod::Collisions const& /*collisions*/) { // do nothing - LOGF(info, "Running dummy process function!"); + if (verboseInfoMC) + LOGF(info, "Running dummy process function!"); } PROCESS_SWITCH(McSGCandProducer, processDummy, "Dummy function", true); }; From 3ee731e9a14999a31432eabcdb0c459f57a996ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jura=C4=8Dka?= <137087737+jjuracka@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:25:03 +0100 Subject: [PATCH 237/459] [PWGUD] updates to upcRhoAnalysis.cxx (#8806) --- PWGUD/Tasks/upcRhoAnalysis.cxx | 247 +++++++++++++++++++++------------ 1 file changed, 156 insertions(+), 91 deletions(-) diff --git a/PWGUD/Tasks/upcRhoAnalysis.cxx b/PWGUD/Tasks/upcRhoAnalysis.cxx index d4a45ed7442..8684bf99550 100644 --- a/PWGUD/Tasks/upcRhoAnalysis.cxx +++ b/PWGUD/Tasks/upcRhoAnalysis.cxx @@ -61,10 +61,10 @@ DECLARE_SOA_COLUMN(TimeFV0A, timeFV0A, float); DECLARE_SOA_COLUMN(TimeFDDA, timeFDDA, float); DECLARE_SOA_COLUMN(TimeFDDC, timeFDDC, float); // ZDC info -DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); -DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float); -DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); -DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); +// DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); +// DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float); +// DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); +// DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); DECLARE_SOA_COLUMN(NeutronClass, neutronClass, int); // Rhos DECLARE_SOA_COLUMN(TotalCharge, totalCharge, int); @@ -89,9 +89,14 @@ DECLARE_SOA_COLUMN(TrackElPID, trackElPID, std::vector); DECLARE_SOA_COLUMN(TrackDcaXY, trackDcaXY, std::vector); DECLARE_SOA_COLUMN(TrackDcaZ, trackDcaZ, std::vector); DECLARE_SOA_COLUMN(TrackTpcSignal, trackTpcSignal, std::vector); -DECLARE_SOA_COLUMN(TofClass, tofClass, int); } // namespace tree -DECLARE_SOA_TABLE(Tree, "AOD", "TREE", tree::RunNumber, tree::GlobalBC, tree::NumContrib, tree::PosX, tree::PosY, tree::PosZ, tree::TotalFT0AmplitudeA, tree::TotalFT0AmplitudeC, tree::TotalFV0AmplitudeA, tree::TotalFDDAmplitudeA, tree::TotalFDDAmplitudeC, tree::TimeFT0A, tree::TimeFT0C, tree::TimeFV0A, tree::TimeFDDA, tree::TimeFDDC, tree::EnergyCommonZNA, tree::EnergyCommonZNC, tree::TimeZNA, tree::TimeZNC, tree::NeutronClass, tree::TotalCharge, tree::RhoPt, tree::RhoEta, tree::RhoPhi, tree::RhoM, tree::RhoPhiRandom, tree::RhoPhiCharge, tree::TrackSign, tree::TrackPt, tree::TrackEta, tree::TrackPhi, tree::TrackM, tree::TrackPiPID, tree::TrackElPID, tree::TrackDcaXY, tree::TrackDcaZ, tree::TrackTpcSignal, tree::TofClass); +DECLARE_SOA_TABLE(Tree, "AOD", "TREE", + tree::RunNumber, tree::GlobalBC, tree::NumContrib, + tree::PosX, tree::PosY, tree::PosZ, tree::TotalFT0AmplitudeA, tree::TotalFT0AmplitudeC, tree::TotalFV0AmplitudeA, tree::TotalFDDAmplitudeA, tree::TotalFDDAmplitudeC, + tree::TimeFT0A, tree::TimeFT0C, tree::TimeFV0A, tree::TimeFDDA, tree::TimeFDDC, + /* tree::EnergyCommonZNA, tree::EnergyCommonZNC, tree::TimeZNA, tree::TimeZNC, */ tree::NeutronClass, + tree::TotalCharge, tree::RhoPt, tree::RhoEta, tree::RhoPhi, tree::RhoM, tree::RhoPhiRandom, tree::RhoPhiCharge, + tree::TrackSign, tree::TrackPt, tree::TrackEta, tree::TrackPhi, tree::TrackM, tree::TrackPiPID, tree::TrackElPID, tree::TrackDcaXY, tree::TrackDcaZ, tree::TrackTpcSignal); } // namespace o2::aod struct upcRhoAnalysis { @@ -99,6 +104,7 @@ struct upcRhoAnalysis { double PcEtaCut = 0.9; // physics coordination recommendation Configurable requireTof{"requireTof", false, "require TOF signal"}; + Configurable do4pi{"do4pi", true, "do 4pi analysis"}; Configurable collisionsPosZMaxCut{"collisionsPosZMaxCut", 10.0, "max Z position cut on collisions"}; Configurable ZNcommonEnergyCut{"ZNcommonEnergyCut", 0.0, "ZN common energy cut"}; @@ -125,12 +131,13 @@ struct upcRhoAnalysis { ConfigurableAxis ptAxis{"ptAxis", {1000, 0.0, 10.0}, "p_{T} (GeV/#it{c})"}; ConfigurableAxis ptCutAxis{"ptCutAxis", {100, 0.0, 0.1}, "p_{T} (GeV/#it{c})"}; ConfigurableAxis pt2Axis{"pt2Axis", {100, 0.0, 0.01}, "p_{T}^{2} (GeV^{2}/#it{c}^{2})"}; - ConfigurableAxis etaAxis{"etaAxis", {180, -0.9, 0.9}, "#eta"}; + ConfigurableAxis etaAxis{"etaAxis", {800, -4.0, 4.0}, "#eta"}; + ConfigurableAxis etaCutAxis{"etaCutAxis", {180, -0.9, 0.9}, "#eta"}; ConfigurableAxis yAxis{"yAxis", {180, -0.9, 0.9}, "y"}; ConfigurableAxis phiAxis{"phiAxis", {180, 0.0, o2::constants::math::TwoPI}, "#phi"}; ConfigurableAxis phiAsymmAxis{"phiAsymmAxis", {182, -o2::constants::math::PI, o2::constants::math::PI}, "#phi"}; ConfigurableAxis momentumFromPhiAxis{"momentumFromPhiAxis", {400, -0.1, 0.1}, "p (GeV/#it{c})"}; - ConfigurableAxis ptQuantileAxis{"ptQuantileAxis", {0, 0.0181689, 0.0263408, 0.0330488, 0.0390369, 0.045058, 0.0512604, 0.0582598, 0.066986, 0.0788085, 0.1}, "p_{T} (GeV/#it{c})"}; + // ConfigurableAxis ptQuantileAxis{"ptQuantileAxis", {0, 0.0181689, 0.0263408, 0.0330488, 0.0390369, 0.045058, 0.0512604, 0.0582598, 0.066986, 0.0788085, 0.1}, "p_{T} (GeV/#it{c})"}; HistogramRegistry QC{"QC", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry Pions{"Pions", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -183,9 +190,9 @@ struct upcRhoAnalysis { QC.add("QC/tracks/raw/hTpcChi2NCl", ";TPC #chi^{2}/N_{cls};counts", kTH1D, {{1000, 0.0, 100.0}}); QC.add("QC/tracks/raw/hTpcNCls", ";TPC N_{cls} found;counts", kTH1D, {{200, 0.0, 200.0}}); QC.add("QC/tracks/raw/hTpcNClsCrossedRows", ";TPC crossed rows;counts", kTH1D, {{200, 0.0, 200.0}}); - QC.add("QC/tracks/raw/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {{1000, 0.0, 10.0}}); - QC.add("QC/tracks/raw/hEta", ";y;counts", kTH1D, {{180, -0.9, 0.9}}); - QC.add("QC/tracks/raw/hPhi", ";#phi;counts", kTH1D, {{180, 0.0, o2::constants::math::TwoPI}}); // tracks passing selections + QC.add("QC/tracks/raw/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + QC.add("QC/tracks/raw/hEta", ";y;counts", kTH1D, {etaAxis}); + QC.add("QC/tracks/raw/hPhi", ";#phi;counts", kTH1D, {phiAxis}); // tracks passing selections QC.add("QC/tracks/cut/hTpcNSigmaPi2D", ";TPC n#sigma(#pi_{leading});TPC n#sigma(#pi_{subleading});counts", kTH2D, {{400, -10.0, 30.0}, {400, -10.0, 30.0}}); QC.add("QC/tracks/cut/hTpcNSigmaEl2D", ";TPC n#sigma(e_{leading});TPC n#sigma(e_{subleading});counts", kTH2D, {{400, -10.0, 30.0}, {400, -10.0, 30.0}}); QC.add("QC/tracks/cut/hTpcSignalVsP", ";p (GeV/#it{c});TPC signal;counts", kTH2D, {ptAxis, {500, 0.0, 500.0}}); @@ -206,17 +213,17 @@ struct upcRhoAnalysis { // PIONS // no selection Pions.add("pions/no-selection/unlike-sign/hPt", ";p_{T}(#pi_{leading}) (GeV/#it{c});p_{T}(#pi_{subleading}) (GeV/#it{c});counts", kTH2D, {ptAxis, ptAxis}); - Pions.add("pions/no-selection/unlike-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaAxis, etaAxis}); + Pions.add("pions/no-selection/unlike-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaCutAxis, etaCutAxis}); Pions.add("pions/no-selection/unlike-sign/hPhi", ";#phi(#pi_{leading});#phi(#pi_{subleading});counts", kTH2D, {phiAxis, phiAxis}); Pions.add("pions/no-selection/like-sign/hPt", ";p_{T}(#pi_{leading}) (GeV/#it{c});p_{T}(#pi_{subleading}) (GeV/#it{c});counts", kTH2D, {ptAxis, ptAxis}); - Pions.add("pions/no-selection/like-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaAxis, etaAxis}); + Pions.add("pions/no-selection/like-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaCutAxis, etaCutAxis}); Pions.add("pions/no-selection/like-sign/hPhi", ";#phi(#pi_{leading});#phi(#pi_{subleading});counts", kTH2D, {phiAxis, phiAxis}); // selected Pions.add("pions/selected/unlike-sign/hPt", ";p_{T}(#pi_{leading}) (GeV/#it{c});p_{T}(#pi_{subleading}) (GeV/#it{c});counts", kTH2D, {ptAxis, ptAxis}); - Pions.add("pions/selected/unlike-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaAxis, etaAxis}); + Pions.add("pions/selected/unlike-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaCutAxis, etaCutAxis}); Pions.add("pions/selected/unlike-sign/hPhi", ";#phi(#pi_{leading});#phi(#pi_{subleading});counts", kTH2D, {phiAxis, phiAxis}); Pions.add("pions/selected/like-sign/hPt", ";p_{T}(#pi_{leading}) (GeV/#it{c});p_{T}(#pi_{subleading}) (GeV/#it{c});counts", kTH2D, {ptAxis, ptAxis}); - Pions.add("pions/selected/like-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaAxis, etaAxis}); + Pions.add("pions/selected/like-sign/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaCutAxis, etaCutAxis}); Pions.add("pions/selected/like-sign/hPhi", ";#phi(#pi_{leading});#phi(#pi_{subleading});counts", kTH2D, {phiAxis, phiAxis}); // RAW RHOS @@ -224,14 +231,17 @@ struct upcRhoAnalysis { System.add("system/raw/unlike-sign/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); System.add("system/raw/unlike-sign/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mAxis, ptAxis}); System.add("system/raw/unlike-sign/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/raw/unlike-sign/hPhi", ";#phi;counts", kTH1D, {phiAxis}); System.add("system/raw/like-sign/positive/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); System.add("system/raw/like-sign/positive/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); System.add("system/raw/like-sign/positive/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mAxis, ptAxis}); System.add("system/raw/like-sign/positive/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/raw/like-sign/positive/hPhi", ";#phi;counts", kTH1D, {phiAxis}); System.add("system/raw/like-sign/negative/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); System.add("system/raw/like-sign/negative/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); System.add("system/raw/like-sign/negative/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mAxis, ptAxis}); System.add("system/raw/like-sign/negative/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/raw/like-sign/negative/hPhi", ";#phi;counts", kTH1D, {phiAxis}); // SELECTED RHOS // no selection @@ -240,45 +250,39 @@ struct upcRhoAnalysis { System.add("system/cut/no-selection/unlike-sign/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/no-selection/unlike-sign/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/no-selection/unlike-sign/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/no-selection/unlike-sign/hPhi", ";#phi;counts", kTH1D, {phiAxis}); System.add("system/cut/no-selection/unlike-sign/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/no-selection/unlike-sign/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/no-selection/unlike-sign/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); System.add("system/cut/no-selection/unlike-sign/hPhiChargeVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); System.add("system/cut/no-selection/unlike-sign/hPyVsPxRandom", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); System.add("system/cut/no-selection/unlike-sign/hPyVsPxCharge", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); - System.add("system/cut/no-selection/unlike-sign/hTofClassVsM", ";m (GeV/#it{c}^{2});TOF class;counts", kTH2D, {mCutAxis, {4, -0.5, 3.5}}); - System.add("system/cut/no-selection/unlike-sign/hTofClassVsPt", ";p_{T} (GeV/#it{c});TOF class;counts", kTH2D, {ptCutAxis, {4, -0.5, 3.5}}); - System.add("system/cut/no-selection/unlike-sign/hTofClassVsY", ";y;TOF class;counts", kTH2D, {yAxis, {4, -0.5, 3.5}}); System.add("system/cut/no-selection/like-sign/positive/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mCutAxis}); System.add("system/cut/no-selection/like-sign/positive/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptCutAxis}); System.add("system/cut/no-selection/like-sign/positive/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/no-selection/like-sign/positive/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/no-selection/like-sign/positive/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/no-selection/like-sign/positive/hPhi", ";#phi;counts", kTH1D, {phiAxis}); System.add("system/cut/no-selection/like-sign/positive/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/positive/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/positive/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/positive/hPhiChargeVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/positive/hPyVsPxRandom", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); System.add("system/cut/no-selection/like-sign/positive/hPyVsPxCharge", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); - System.add("system/cut/no-selection/like-sign/positive/hTofClassVsM", ";m (GeV/#it{c}^{2});TOF class;counts", kTH2D, {mCutAxis, {4, -0.5, 3.5}}); - System.add("system/cut/no-selection/like-sign/positive/hTofClassVsPt", ";p_{T} (GeV/#it{c});TOF class;counts", kTH2D, {ptCutAxis, {4, -0.5, 3.5}}); - System.add("system/cut/no-selection/like-sign/positive/hTofClassVsY", ";y;TOF class;counts", kTH2D, {yAxis, {4, -0.5, 3.5}}); System.add("system/cut/no-selection/like-sign/negative/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mCutAxis}); System.add("system/cut/no-selection/like-sign/negative/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptCutAxis}); System.add("system/cut/no-selection/like-sign/negative/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/no-selection/like-sign/negative/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/no-selection/like-sign/negative/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/no-selection/like-sign/negative/hPhi", ";#phi;counts", kTH1D, {phiAxis}); System.add("system/cut/no-selection/like-sign/negative/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/negative/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/negative/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/negative/hPhiChargeVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); System.add("system/cut/no-selection/like-sign/negative/hPyVsPxRandom", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); System.add("system/cut/no-selection/like-sign/negative/hPyVsPxCharge", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); - System.add("system/cut/no-selection/like-sign/negative/hTofClassVsM", ";m (GeV/#it{c}^{2});TOF class;counts", kTH2D, {mCutAxis, {4, -0.5, 3.5}}); - System.add("system/cut/no-selection/like-sign/negative/hTofClassVsPt", ";p_{T} (GeV/#it{c});TOF class;counts", kTH2D, {ptCutAxis, {4, -0.5, 3.5}}); - System.add("system/cut/no-selection/like-sign/negative/hTofClassVsY", ";y;TOF class;counts", kTH2D, {yAxis, {4, -0.5, 3.5}}); // 0n0n System.add("system/cut/0n0n/unlike-sign/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mCutAxis}); @@ -286,6 +290,7 @@ struct upcRhoAnalysis { System.add("system/cut/0n0n/unlike-sign/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/0n0n/unlike-sign/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/0n0n/unlike-sign/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/0n0n/unlike-sign/hPhi", ";#phi;counts", kTH1D, {phiAxis}); System.add("system/cut/0n0n/unlike-sign/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/unlike-sign/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/unlike-sign/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -298,6 +303,7 @@ struct upcRhoAnalysis { System.add("system/cut/0n0n/like-sign/positive/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/0n0n/like-sign/positive/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/0n0n/like-sign/positive/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/0n0n/like-sign/positive/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/like-sign/positive/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/like-sign/positive/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/like-sign/positive/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -310,6 +316,7 @@ struct upcRhoAnalysis { System.add("system/cut/0n0n/like-sign/negative/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/0n0n/like-sign/negative/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/0n0n/like-sign/negative/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/0n0n/like-sign/negative/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/like-sign/negative/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/like-sign/negative/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0n0n/like-sign/negative/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -323,6 +330,7 @@ struct upcRhoAnalysis { System.add("system/cut/Xn0n/unlike-sign/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/Xn0n/unlike-sign/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/Xn0n/unlike-sign/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/Xn0n/unlike-sign/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/unlike-sign/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/unlike-sign/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/unlike-sign/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -335,6 +343,7 @@ struct upcRhoAnalysis { System.add("system/cut/Xn0n/like-sign/positive/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/Xn0n/like-sign/positive/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/Xn0n/like-sign/positive/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/Xn0n/like-sign/positive/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/like-sign/positive/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/like-sign/positive/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/like-sign/positive/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -347,6 +356,7 @@ struct upcRhoAnalysis { System.add("system/cut/Xn0n/like-sign/negative/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/Xn0n/like-sign/negative/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/Xn0n/like-sign/negative/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/Xn0n/like-sign/negative/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/like-sign/negative/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/like-sign/negative/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/Xn0n/like-sign/negative/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -360,6 +370,7 @@ struct upcRhoAnalysis { System.add("system/cut/0nXn/unlike-sign/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/0nXn/unlike-sign/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/0nXn/unlike-sign/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/0nXn/unlike-sign/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/unlike-sign/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/unlike-sign/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/unlike-sign/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -372,6 +383,7 @@ struct upcRhoAnalysis { System.add("system/cut/0nXn/like-sign/positive/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/0nXn/like-sign/positive/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/0nXn/like-sign/positive/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/0nXn/like-sign/positive/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/like-sign/positive/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/like-sign/positive/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/like-sign/positive/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -384,6 +396,7 @@ struct upcRhoAnalysis { System.add("system/cut/0nXn/like-sign/negative/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/0nXn/like-sign/negative/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/0nXn/like-sign/negative/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/0nXn/like-sign/negative/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/like-sign/negative/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/like-sign/negative/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/0nXn/like-sign/negative/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -397,6 +410,7 @@ struct upcRhoAnalysis { System.add("system/cut/XnXn/unlike-sign/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/XnXn/unlike-sign/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/XnXn/unlike-sign/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/XnXn/unlike-sign/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/unlike-sign/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/unlike-sign/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/unlike-sign/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -409,6 +423,7 @@ struct upcRhoAnalysis { System.add("system/cut/XnXn/like-sign/positive/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/XnXn/like-sign/positive/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/XnXn/like-sign/positive/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/XnXn/like-sign/positive/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/like-sign/positive/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/like-sign/positive/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/like-sign/positive/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -421,6 +436,7 @@ struct upcRhoAnalysis { System.add("system/cut/XnXn/like-sign/negative/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); System.add("system/cut/XnXn/like-sign/negative/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mCutAxis, ptCutAxis}); System.add("system/cut/XnXn/like-sign/negative/hY", ";y;counts", kTH1D, {yAxis}); + System.add("system/cut/XnXn/like-sign/negative/hPhi", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/like-sign/negative/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/like-sign/negative/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); System.add("system/cut/XnXn/like-sign/negative/hPhiRandomVsM", ";m (GeV/#it{c}^{2});#phi;counts", kTH2D, {mCutAxis, phiAsymmAxis}); @@ -429,32 +445,46 @@ struct upcRhoAnalysis { System.add("system/cut/XnXn/like-sign/negative/hPyVsPxCharge", ";p_{x} (GeV/#it{c});p_{y} (GeV/#it{c});counts", kTH2D, {momentumFromPhiAxis, momentumFromPhiAxis}); // MC - MC.add("MC/QC/hPosXY", ";x (cm);y (cm);counts", kTH2D, {{2000, -0.1, 0.1}, {2000, -0.1, 0.1}}); - MC.add("MC/QC/hPosZ", ";z (cm);counts", kTH1D, {{400, -20.0, 20.0}}); - MC.add("MC/QC/hPdgCode", ";pdg code;counts", kTH1D, {{2001, -1000.5, 1000.5}}); - MC.add("MC/QC/hProducedByGenerator", ";produced by generator;counts", kTH1D, {{2, -0.5, 1.5}}); - MC.add("MC/QC/hNPions", ";number of pions;counts", kTH1D, {{11, -0.5, 10.5}}); - - MC.add("MC/tracks/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); - MC.add("MC/tracks/hEta", ";#eta;counts", kTH1D, {etaAxis}); - MC.add("MC/tracks/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + MC.add("MC/collisions/hPosXY", ";x (cm);y (cm);counts", kTH2D, {{2000, -0.1, 0.1}, {2000, -0.1, 0.1}}); + MC.add("MC/collisions/hPosZ", ";z (cm);counts", kTH1D, {{400, -20.0, 20.0}}); + MC.add("MC/collisions/hNPions", ";number of pions;counts", kTH1D, {{11, -0.5, 10.5}}); + + MC.add("MC/tracks/all/hPdgCode", ";pdg code;counts", kTH1D, {{2001, -1000.5, 1000.5}}); + MC.add("MC/tracks/all/hProducedByGenerator", ";produced by generator;counts", kTH1D, {{2, -0.5, 1.5}}); + MC.add("MC/tracks/all/hIsPhysicalPrimary", ";is physical primary;counts", kTH1D, {{2, -0.5, 1.5}}); + MC.add("MC/tracks/all/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + MC.add("MC/tracks/all/hEta", ";#eta;counts", kTH1D, {etaAxis}); + MC.add("MC/tracks/all/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + MC.add("MC/tracks/pions/hPt", ";p_{T}(#pi_{leading}) (GeV/#it{c});p_{T}(#pi_{subleading}) (GeV/#it{c});counts", kTH2D, {ptAxis, ptAxis}); + MC.add("MC/tracks/pions/hEta", ";#eta(#pi_{leading});#eta(#pi_{subleading});counts", kTH2D, {etaAxis, etaAxis}); + MC.add("MC/tracks/pions/hPhi", ";#phi(#pi_{leading});#phi(#pi_{subleading});counts", kTH2D, {phiAxis, phiAxis}); MC.add("MC/system/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); MC.add("MC/system/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); MC.add("MC/system/hPt2", ";p_{T}^{2} (GeV^{2}/#it{c}^{2});counts", kTH1D, {pt2Axis}); MC.add("MC/system/hPtVsM", ";m (GeV/#it{c}^{2});p_{T} (GeV/#it{c});counts", kTH2D, {mAxis, ptAxis}); MC.add("MC/system/hY", ";y;counts", kTH1D, {yAxis}); + MC.add("MC/system/hPhi", ";#phi;counts", kTH1D, {phiAxis}); MC.add("MC/system/hPhiRandom", ";#phi;counts", kTH1D, {phiAsymmAxis}); MC.add("MC/system/hPhiCharge", ";#phi;counts", kTH1D, {phiAsymmAxis}); // 4 pi QA - FourPiQA.add("FourPiQA/tracks/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); - FourPiQA.add("FourPiQA/tracks/hEta", ";#eta;counts", kTH1D, {etaAxis}); - FourPiQA.add("FourPiQA/tracks/hPhi", ";#phi;counts", kTH1D, {phiAxis}); - FourPiQA.add("FourPiQA/system/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); - FourPiQA.add("FourPiQA/system/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); - FourPiQA.add("FourPiQA/system/hY", ";y;counts", kTH1D, {yAxis}); - FourPiQA.add("FourPiQA/system/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + if (do4pi) { + FourPiQA.add("FourPiQA/reco/tracks/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + FourPiQA.add("FourPiQA/reco/tracks/hEta", ";#eta;counts", kTH1D, {etaAxis}); + FourPiQA.add("FourPiQA/reco/tracks/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + FourPiQA.add("FourPiQA/reco/system/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); + FourPiQA.add("FourPiQA/reco/system/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + FourPiQA.add("FourPiQA/reco/system/hY", ";y;counts", kTH1D, {yAxis}); + FourPiQA.add("FourPiQA/reco/system/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + FourPiQA.add("FourPiQA/MC/tracks/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + FourPiQA.add("FourPiQA/MC/tracks/hEta", ";#eta;counts", kTH1D, {etaAxis}); + FourPiQA.add("FourPiQA/MC/tracks/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + FourPiQA.add("FourPiQA/MC/system/hM", ";m (GeV/#it{c}^{2});counts", kTH1D, {mAxis}); + FourPiQA.add("FourPiQA/MC/system/hPt", ";p_{T} (GeV/#it{c});counts", kTH1D, {ptAxis}); + FourPiQA.add("FourPiQA/MC/system/hY", ";y;counts", kTH1D, {yAxis}); + FourPiQA.add("FourPiQA/MC/system/hPhi", ";#phi;counts", kTH1D, {phiAxis}); + } } template @@ -533,6 +563,15 @@ struct upcRhoAnalysis { return charge; } + template + int tracksTotalChargeMC(const T& cutTracks) // total charge of selected tracks + { + int charge = 0; + for (const auto& track : cutTracks) + charge += track.pdgCode(); + return charge; + } + bool systemPassCuts(const TLorentzVector& system) // system cuts { if (system.M() < systemMassMinCut || system.M() > systemMassMaxCut) @@ -667,19 +706,26 @@ struct upcRhoAnalysis { LOG(error); return; } + // reonstruct system and calculate total charge, save commonly used values into variables + TLorentzVector system = reconstructSystem(cutTracks4Vecs); + int totalCharge = tracksTotalCharge(cutTracks); + double mass = system.M(); + double pT = system.Pt(); + double pTsquare = pT * pT; + double rapidity = system.Rapidity(); + double systemPhi = system.Phi() + o2::constants::math::PI; - if (cutTracks.size() == 4) { + if (do4pi && cutTracks.size() == 4 && totalCharge == 0) { // fill out some 4pi QC histograms for (int i = 0; i < static_cast(cutTracks.size()); i++) { - FourPiQA.fill(HIST("FourPiQA/tracks/hPt"), cutTracks[i].pt()); - FourPiQA.fill(HIST("FourPiQA/tracks/hEta"), eta(cutTracks[i].px(), cutTracks[i].py(), cutTracks[i].pz())); - FourPiQA.fill(HIST("FourPiQA/tracks/hPhi"), phi(cutTracks[i].px(), cutTracks[i].py())); + FourPiQA.fill(HIST("FourPiQA/reco/tracks/hPt"), cutTracks[i].pt()); + FourPiQA.fill(HIST("FourPiQA/reco/tracks/hEta"), eta(cutTracks[i].px(), cutTracks[i].py(), cutTracks[i].pz())); + FourPiQA.fill(HIST("FourPiQA/reco/tracks/hPhi"), phi(cutTracks[i].px(), cutTracks[i].py())); } - TLorentzVector system = reconstructSystem(cutTracks4Vecs); - FourPiQA.fill(HIST("FourPiQA/system/hM"), system.M()); - FourPiQA.fill(HIST("FourPiQA/system/hPt"), system.Pt()); - FourPiQA.fill(HIST("FourPiQA/system/hY"), system.Rapidity()); - FourPiQA.fill(HIST("FourPiQA/system/hPhi"), system.Phi()); + FourPiQA.fill(HIST("FourPiQA/reco/system/hM"), mass); + FourPiQA.fill(HIST("FourPiQA/reco/system/hPt"), pT); + FourPiQA.fill(HIST("FourPiQA/reco/system/hY"), rapidity); + FourPiQA.fill(HIST("FourPiQA/reco/system/hPhi"), systemPhi); } // further consider only two pion systems @@ -696,13 +742,6 @@ struct upcRhoAnalysis { for (int i = 0; i < static_cast(cutTracks.size()); i++) QC.fill(HIST("QC/tracks/hSelectionCounter"), 15); - // reonstruct system and calculate total charge, save commonly used values into variables - TLorentzVector system = reconstructSystem(cutTracks4Vecs); - int totalCharge = tracksTotalCharge(cutTracks); - double mass = system.M(); - double pT = system.Pt(); - double pTsquare = pT * pT; - double rapidity = system.Rapidity(); double phiRandom = getPhiRandom(cutTracks4Vecs); double phiCharge = getPhiCharge(cutTracks, cutTracks4Vecs); @@ -717,15 +756,6 @@ struct upcRhoAnalysis { double subleadingPhi = phi(subleadingMomentumTrack.px(), subleadingMomentumTrack.py()); // fill TOF hit checker QC.fill(HIST("QC/tracks/hTofHitCheck"), leadingMomentumTrack.hasTOF(), subleadingMomentumTrack.hasTOF()); - int tofClass = -1; - if (!leadingMomentumTrack.hasTOF() && !subleadingMomentumTrack.hasTOF()) - tofClass = 0; - else if (leadingMomentumTrack.hasTOF() && !subleadingMomentumTrack.hasTOF()) - tofClass = 1; - else if (!leadingMomentumTrack.hasTOF() && subleadingMomentumTrack.hasTOF()) - tofClass = 2; - else if (leadingMomentumTrack.hasTOF() && subleadingMomentumTrack.hasTOF()) - tofClass = 3; // fill tree std::vector trackSigns = {leadingMomentumTrack.sign(), subleadingMomentumTrack.sign()}; @@ -738,9 +768,13 @@ struct upcRhoAnalysis { std::vector trackDcaXYs = {leadingMomentumTrack.dcaXY(), subleadingMomentumTrack.dcaXY()}; std::vector trackDcaZs = {leadingMomentumTrack.dcaZ(), subleadingMomentumTrack.dcaZ()}; std::vector trackTpcSignals = {leadingMomentumTrack.tpcSignal(), subleadingMomentumTrack.tpcSignal()}; - Tree(collision.runNumber(), collision.globalBC(), collision.numContrib(), collision.posX(), collision.posY(), collision.posZ(), collision.totalFT0AmplitudeA(), collision.totalFT0AmplitudeC(), collision.totalFV0AmplitudeA(), collision.totalFDDAmplitudeA(), collision.totalFDDAmplitudeC(), collision.timeFT0A(), collision.timeFT0C(), collision.timeFV0A(), collision.timeFDDA(), collision.timeFDDC(), collision.energyCommonZNA(), collision.energyCommonZNC(), collision.timeZNA(), collision.timeZNC(), neutronClass, + Tree(collision.runNumber(), collision.globalBC(), collision.numContrib(), + collision.posX(), collision.posY(), collision.posZ(), + collision.totalFT0AmplitudeA(), collision.totalFT0AmplitudeC(), collision.totalFV0AmplitudeA(), collision.totalFDDAmplitudeA(), collision.totalFDDAmplitudeC(), + collision.timeFT0A(), collision.timeFT0C(), collision.timeFV0A(), collision.timeFDDA(), collision.timeFDDC(), + /* collision.energyCommonZNA(), collision.energyCommonZNC(), collision.timeZNA(), collision.timeZNC(), */ neutronClass, totalCharge, pT, system.Eta(), system.Phi(), mass, phiRandom, phiCharge, - trackSigns, trackPts, trackEtas, trackPhis, trackMs, trackPiPIDs, trackElPIDs, trackDcaXYs, trackDcaZs, trackTpcSignals, tofClass); + trackSigns, trackPts, trackEtas, trackPhis, trackMs, trackPiPIDs, trackElPIDs, trackDcaXYs, trackDcaZs, trackTpcSignals); // fill raw histograms according to the total charge switch (totalCharge) { case 0: @@ -751,6 +785,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/raw/unlike-sign/hPt"), pT); System.fill(HIST("system/raw/unlike-sign/hPtVsM"), mass, pT); System.fill(HIST("system/raw/unlike-sign/hY"), rapidity); + System.fill(HIST("system/raw/unlike-sign/hPhi"), systemPhi); break; case 2: @@ -761,6 +796,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/raw/like-sign/positive/hPt"), pT); System.fill(HIST("system/raw/like-sign/positive/hPtVsM"), mass, pT); System.fill(HIST("system/raw/like-sign/positive/hY"), rapidity); + System.fill(HIST("system/raw/like-sign/positive/hPhi"), systemPhi); break; case -2: @@ -771,6 +807,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/raw/like-sign/negative/hPt"), pT); System.fill(HIST("system/raw/like-sign/negative/hPtVsM"), mass, pT); System.fill(HIST("system/raw/like-sign/negative/hY"), rapidity); + System.fill(HIST("system/raw/like-sign/negative/hPhi"), systemPhi); break; default: @@ -808,21 +845,20 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/no-selection/unlike-sign/hPt2"), pTsquare); System.fill(HIST("system/cut/no-selection/unlike-sign/hPtVsM"), mass, pT); System.fill(HIST("system/cut/no-selection/unlike-sign/hY"), rapidity); + System.fill(HIST("system/cut/no-selection/unlike-sign/hPhi"), systemPhi); System.fill(HIST("system/cut/no-selection/unlike-sign/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/no-selection/unlike-sign/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/no-selection/unlike-sign/hPhiRandomVsM"), mass, phiRandom); System.fill(HIST("system/cut/no-selection/unlike-sign/hPhiChargeVsM"), mass, phiCharge); System.fill(HIST("system/cut/no-selection/unlike-sign/hPyVsPxRandom"), pT * std::cos(phiRandom), pT * std::sin(phiRandom)); System.fill(HIST("system/cut/no-selection/unlike-sign/hPyVsPxCharge"), pT * std::cos(phiCharge), pT * std::sin(phiCharge)); - System.fill(HIST("system/cut/no-selection/unlike-sign/hTofClassVsM"), mass, tofClass); - System.fill(HIST("system/cut/no-selection/unlike-sign/hTofClassVsPt"), pT, tofClass); - System.fill(HIST("system/cut/no-selection/unlike-sign/hTofClassVsY"), rapidity, tofClass); if (OnOn) { System.fill(HIST("system/cut/0n0n/unlike-sign/hM"), mass); System.fill(HIST("system/cut/0n0n/unlike-sign/hPt"), pT); System.fill(HIST("system/cut/0n0n/unlike-sign/hPt2"), pTsquare); System.fill(HIST("system/cut/0n0n/unlike-sign/hPtVsM"), mass, pT); System.fill(HIST("system/cut/0n0n/unlike-sign/hY"), rapidity); + System.fill(HIST("system/cut/0n0n/unlike-sign/hPhi"), systemPhi); System.fill(HIST("system/cut/0n0n/unlike-sign/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/0n0n/unlike-sign/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/0n0n/unlike-sign/hPhiRandomVsM"), mass, phiRandom); @@ -835,6 +871,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/Xn0n/unlike-sign/hPt2"), pTsquare); System.fill(HIST("system/cut/Xn0n/unlike-sign/hPtVsM"), mass, pT); System.fill(HIST("system/cut/Xn0n/unlike-sign/hY"), rapidity); + System.fill(HIST("system/cut/Xn0n/unlike-sign/hPhi"), systemPhi); System.fill(HIST("system/cut/Xn0n/unlike-sign/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/Xn0n/unlike-sign/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/Xn0n/unlike-sign/hPhiRandomVsM"), mass, phiRandom); @@ -847,6 +884,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/0nXn/unlike-sign/hPt2"), pTsquare); System.fill(HIST("system/cut/0nXn/unlike-sign/hPtVsM"), mass, pT); System.fill(HIST("system/cut/0nXn/unlike-sign/hY"), rapidity); + System.fill(HIST("system/cut/0nXn/unlike-sign/hPhi"), systemPhi); System.fill(HIST("system/cut/0nXn/unlike-sign/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/0nXn/unlike-sign/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/0nXn/unlike-sign/hPhiRandomVsM"), mass, phiRandom); @@ -859,6 +897,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/XnXn/unlike-sign/hPt2"), pTsquare); System.fill(HIST("system/cut/XnXn/unlike-sign/hPtVsM"), mass, pT); System.fill(HIST("system/cut/XnXn/unlike-sign/hY"), rapidity); + System.fill(HIST("system/cut/XnXn/unlike-sign/hPhi"), systemPhi); System.fill(HIST("system/cut/XnXn/unlike-sign/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/XnXn/unlike-sign/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/XnXn/unlike-sign/hPhiRandomVsM"), mass, phiRandom); @@ -877,21 +916,20 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/no-selection/like-sign/positive/hPt2"), pTsquare); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPtVsM"), mass, pT); System.fill(HIST("system/cut/no-selection/like-sign/positive/hY"), rapidity); + System.fill(HIST("system/cut/no-selection/like-sign/positive/hPhi"), systemPhi); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPhiRandomVsM"), mass, phiRandom); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPhiChargeVsM"), mass, phiCharge); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPyVsPxRandom"), pT * std::cos(phiRandom), pT * std::sin(phiRandom)); System.fill(HIST("system/cut/no-selection/like-sign/positive/hPyVsPxCharge"), pT * std::cos(phiCharge), pT * std::sin(phiCharge)); - System.fill(HIST("system/cut/no-selection/like-sign/positive/hTofClassVsM"), mass, tofClass); - System.fill(HIST("system/cut/no-selection/like-sign/positive/hTofClassVsPt"), pT, tofClass); - System.fill(HIST("system/cut/no-selection/like-sign/positive/hTofClassVsY"), rapidity, tofClass); if (OnOn) { System.fill(HIST("system/cut/0n0n/like-sign/positive/hM"), mass); System.fill(HIST("system/cut/0n0n/like-sign/positive/hPt"), pT); System.fill(HIST("system/cut/0n0n/like-sign/positive/hPt2"), pTsquare); System.fill(HIST("system/cut/0n0n/like-sign/positive/hPtVsM"), mass, pT); System.fill(HIST("system/cut/0n0n/like-sign/positive/hY"), rapidity); + System.fill(HIST("system/cut/0n0n/like-sign/positive/hPhi"), systemPhi); System.fill(HIST("system/cut/0n0n/like-sign/positive/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/0n0n/like-sign/positive/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/0n0n/like-sign/positive/hPhiRandomVsM"), mass, phiRandom); @@ -904,6 +942,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/Xn0n/like-sign/positive/hPt2"), pTsquare); System.fill(HIST("system/cut/Xn0n/like-sign/positive/hPtVsM"), mass, pT); System.fill(HIST("system/cut/Xn0n/like-sign/positive/hY"), rapidity); + System.fill(HIST("system/cut/Xn0n/like-sign/positive/hPhi"), systemPhi); System.fill(HIST("system/cut/Xn0n/like-sign/positive/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/Xn0n/like-sign/positive/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/Xn0n/like-sign/positive/hPhiRandomVsM"), mass, phiRandom); @@ -916,6 +955,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/0nXn/like-sign/positive/hPt2"), pTsquare); System.fill(HIST("system/cut/0nXn/like-sign/positive/hPtVsM"), mass, pT); System.fill(HIST("system/cut/0nXn/like-sign/positive/hY"), rapidity); + System.fill(HIST("system/cut/0nXn/like-sign/positive/hPhi"), systemPhi); System.fill(HIST("system/cut/0nXn/like-sign/positive/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/0nXn/like-sign/positive/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/0nXn/like-sign/positive/hPhiRandomVsM"), mass, phiRandom); @@ -928,6 +968,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/XnXn/like-sign/positive/hPt2"), pTsquare); System.fill(HIST("system/cut/XnXn/like-sign/positive/hPtVsM"), mass, pT); System.fill(HIST("system/cut/XnXn/like-sign/positive/hY"), rapidity); + System.fill(HIST("system/cut/XnXn/like-sign/positive/hPhi"), systemPhi); System.fill(HIST("system/cut/XnXn/like-sign/positive/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/XnXn/like-sign/positive/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/XnXn/like-sign/positive/hPhiRandomVsM"), mass, phiRandom); @@ -946,21 +987,20 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/no-selection/like-sign/negative/hPt2"), pTsquare); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPtVsM"), mass, pT); System.fill(HIST("system/cut/no-selection/like-sign/negative/hY"), rapidity); + System.fill(HIST("system/cut/no-selection/like-sign/negative/hPhi"), systemPhi); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPhiRandomVsM"), mass, phiRandom); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPhiChargeVsM"), mass, phiCharge); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPyVsPxRandom"), pT * std::cos(phiRandom), pT * std::sin(phiRandom)); System.fill(HIST("system/cut/no-selection/like-sign/negative/hPyVsPxCharge"), pT * std::cos(phiCharge), pT * std::sin(phiCharge)); - System.fill(HIST("system/cut/no-selection/like-sign/negative/hTofClassVsM"), mass, tofClass); - System.fill(HIST("system/cut/no-selection/like-sign/negative/hTofClassVsPt"), pT, tofClass); - System.fill(HIST("system/cut/no-selection/like-sign/negative/hTofClassVsY"), rapidity, tofClass); if (OnOn) { System.fill(HIST("system/cut/0n0n/like-sign/negative/hM"), mass); System.fill(HIST("system/cut/0n0n/like-sign/negative/hPt"), pT); System.fill(HIST("system/cut/0n0n/like-sign/negative/hPt2"), pTsquare); System.fill(HIST("system/cut/0n0n/like-sign/negative/hPtVsM"), mass, pT); System.fill(HIST("system/cut/0n0n/like-sign/negative/hY"), rapidity); + System.fill(HIST("system/cut/0n0n/like-sign/negative/hPhi"), systemPhi); System.fill(HIST("system/cut/0n0n/like-sign/negative/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/0n0n/like-sign/negative/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/0n0n/like-sign/negative/hPhiRandomVsM"), mass, phiRandom); @@ -973,6 +1013,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/Xn0n/like-sign/negative/hPt2"), pTsquare); System.fill(HIST("system/cut/Xn0n/like-sign/negative/hPtVsM"), mass, pT); System.fill(HIST("system/cut/Xn0n/like-sign/negative/hY"), rapidity); + System.fill(HIST("system/cut/Xn0n/like-sign/negative/hPhi"), systemPhi); System.fill(HIST("system/cut/Xn0n/like-sign/negative/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/Xn0n/like-sign/negative/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/Xn0n/like-sign/negative/hPhiRandomVsM"), mass, phiRandom); @@ -985,6 +1026,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/0nXn/like-sign/negative/hPt2"), pTsquare); System.fill(HIST("system/cut/0nXn/like-sign/negative/hPtVsM"), mass, pT); System.fill(HIST("system/cut/0nXn/like-sign/negative/hY"), rapidity); + System.fill(HIST("system/cut/0nXn/like-sign/negative/hPhi"), systemPhi); System.fill(HIST("system/cut/0nXn/like-sign/negative/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/0nXn/like-sign/negative/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/0nXn/like-sign/negative/hPhiRandomVsM"), mass, phiRandom); @@ -997,6 +1039,7 @@ struct upcRhoAnalysis { System.fill(HIST("system/cut/XnXn/like-sign/negative/hPt2"), pTsquare); System.fill(HIST("system/cut/XnXn/like-sign/negative/hPtVsM"), mass, pT); System.fill(HIST("system/cut/XnXn/like-sign/negative/hY"), rapidity); + System.fill(HIST("system/cut/XnXn/like-sign/negative/hPhi"), systemPhi); System.fill(HIST("system/cut/XnXn/like-sign/negative/hPhiRandom"), phiRandom); System.fill(HIST("system/cut/XnXn/like-sign/negative/hPhiCharge"), phiCharge); System.fill(HIST("system/cut/XnXn/like-sign/negative/hPhiRandomVsM"), mass, phiRandom); @@ -1014,48 +1057,70 @@ struct upcRhoAnalysis { template void processMC(C const& mcCollision, T const& mcParticles) { - MC.fill(HIST("MC/QC/hPosXY"), mcCollision.posX(), mcCollision.posY()); - MC.fill(HIST("MC/QC/hPosZ"), mcCollision.posZ()); + MC.fill(HIST("MC/collisions/hPosXY"), mcCollision.posX(), mcCollision.posY()); + MC.fill(HIST("MC/collisions/hPosZ"), mcCollision.posZ()); std::vector cutMcParticles; std::vector mcParticles4Vecs; for (auto const& mcParticle : mcParticles) { - MC.fill(HIST("MC/QC/hPdgCode"), mcParticle.pdgCode()); - MC.fill(HIST("MC/QC/hProducedByGenerator"), mcParticle.producedByGenerator()); - MC.fill(HIST("MC/tracks/hPt"), std::sqrt(mcParticle.px() * mcParticle.px() + mcParticle.py() * mcParticle.py())); - MC.fill(HIST("MC/tracks/hEta"), eta(mcParticle.px(), mcParticle.py(), mcParticle.pz())); - MC.fill(HIST("MC/tracks/hPhi"), phi(mcParticle.px(), mcParticle.py())); - if (!mcParticle.producedByGenerator() || std::abs(mcParticle.pdgCode()) != 211) + MC.fill(HIST("MC/tracks/all/hPdgCode"), mcParticle.pdgCode()); + MC.fill(HIST("MC/tracks/all/hProducedByGenerator"), mcParticle.producedByGenerator()); + MC.fill(HIST("MC/tracks/all/hIsPhysicalPrimary"), mcParticle.isPhysicalPrimary()); + MC.fill(HIST("MC/tracks/all/hPt"), pt(mcParticle.px(), mcParticle.py())); + MC.fill(HIST("MC/tracks/all/hEta"), eta(mcParticle.px(), mcParticle.py(), mcParticle.pz())); + MC.fill(HIST("MC/tracks/all/hPhi"), phi(mcParticle.px(), mcParticle.py())); + if (!mcParticle.isPhysicalPrimary() || std::abs(mcParticle.pdgCode()) != 211) continue; cutMcParticles.push_back(mcParticle); TLorentzVector pion4Vec; pion4Vec.SetPxPyPzE(mcParticle.px(), mcParticle.py(), mcParticle.pz(), mcParticle.e()); mcParticles4Vecs.push_back(pion4Vec); } - MC.fill(HIST("MC/QC/hNPions"), cutMcParticles.size()); + MC.fill(HIST("MC/collisions/hNPions"), cutMcParticles.size()); - if (mcParticles4Vecs.size() != 2 || cutMcParticles.size() != 2) + if (mcParticles4Vecs.size() != cutMcParticles.size()) return; - if (cutMcParticles[0].pdgCode() * cutMcParticles[1].pdgCode() > 0) // unlike-sign + if (tracksTotalChargeMC(cutMcParticles) != 0) // shouldn't happen in theory return; - TLorentzVector system = mcParticles4Vecs[0] + mcParticles4Vecs[1]; + TLorentzVector system = reconstructSystem(mcParticles4Vecs); double mass = system.M(); double pT = system.Pt(); double pTsquare = pT * pT; double rapidity = system.Rapidity(); - double phiRandom = getPhiRandom(mcParticles4Vecs); - double phiCharge = getPhiChargeMC(cutMcParticles, mcParticles4Vecs); + double systemPhi = system.Phi() + o2::constants::math::PI; + + if (do4pi && cutMcParticles.size() == 4) { + for (int i = 0; i < static_cast(cutMcParticles.size()); i++) { + FourPiQA.fill(HIST("FourPiQA/MC/tracks/hPt"), pt(cutMcParticles[i].px(), cutMcParticles[i].py())); + FourPiQA.fill(HIST("FourPiQA/MC/tracks/hEta"), eta(cutMcParticles[i].px(), cutMcParticles[i].py(), cutMcParticles[i].pz())); + FourPiQA.fill(HIST("FourPiQA/MC/tracks/hPhi"), phi(cutMcParticles[i].px(), cutMcParticles[i].py())); + } + FourPiQA.fill(HIST("FourPiQA/MC/system/hM"), mass); + FourPiQA.fill(HIST("FourPiQA/MC/system/hPt"), pT); + FourPiQA.fill(HIST("FourPiQA/MC/system/hY"), rapidity); + FourPiQA.fill(HIST("FourPiQA/MC/system/hPhi"), systemPhi); + } - if (std::abs(rapidity) > systemYCut) + if (cutMcParticles.size() != 2) return; + auto leadingMomentumPion = momentum(cutMcParticles[0].px(), cutMcParticles[0].py(), cutMcParticles[0].pz()) > momentum(cutMcParticles[1].px(), cutMcParticles[1].py(), cutMcParticles[1].pz()) ? cutMcParticles[0] : cutMcParticles[1]; + auto subleadingMomentumPion = (leadingMomentumPion == cutMcParticles[0]) ? cutMcParticles[1] : cutMcParticles[0]; + MC.fill(HIST("MC/tracks/pions/hPt"), pt(leadingMomentumPion.px(), leadingMomentumPion.py()), pt(subleadingMomentumPion.px(), subleadingMomentumPion.py())); + MC.fill(HIST("MC/tracks/pions/hEta"), eta(leadingMomentumPion.px(), leadingMomentumPion.py(), leadingMomentumPion.pz()), eta(subleadingMomentumPion.px(), subleadingMomentumPion.py(), subleadingMomentumPion.pz())); + MC.fill(HIST("MC/tracks/pions/hPhi"), phi(leadingMomentumPion.px(), leadingMomentumPion.py()), phi(subleadingMomentumPion.px(), subleadingMomentumPion.py())); + + double phiRandom = getPhiRandom(mcParticles4Vecs); + double phiCharge = getPhiChargeMC(cutMcParticles, mcParticles4Vecs); + MC.fill(HIST("MC/system/hM"), mass); MC.fill(HIST("MC/system/hPt"), pT); MC.fill(HIST("MC/system/hPtVsM"), mass, pT); MC.fill(HIST("MC/system/hPt2"), pTsquare); MC.fill(HIST("MC/system/hY"), rapidity); + MC.fill(HIST("MC/system/hPhi"), systemPhi); MC.fill(HIST("MC/system/hPhiRandom"), phiRandom); MC.fill(HIST("MC/system/hPhiCharge"), phiCharge); } From 78d2db10707d26bb6bf38c762b15c48ef3eb6d3d Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 4 Dec 2024 09:25:16 +0100 Subject: [PATCH 238/459] [PWGLF] ebyeMult: get trigger efficiency + improve gen particle cuts (#8805) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/ebyeMult.cxx | 257 +++++++++++++++++++++----------- 1 file changed, 170 insertions(+), 87 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/ebyeMult.cxx b/PWGLF/Tasks/Nuspex/ebyeMult.cxx index 66231c71549..42a316319de 100644 --- a/PWGLF/Tasks/Nuspex/ebyeMult.cxx +++ b/PWGLF/Tasks/Nuspex/ebyeMult.cxx @@ -9,8 +9,13 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include +/// \file ebyeMult.cxx +/// \brief task to carry out multiplicity measurements for lf ebye analyses +/// \author Mario Ciacco + +#include #include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -28,7 +33,6 @@ #include "DataFormatsParameters/GRPMagField.h" #include "CCDB/BasicCCDBManager.h" -#include "TDatabasePDG.h" #include "TFormula.h" using namespace o2; @@ -64,7 +68,7 @@ struct CandidateEvent { int nTklRec = -1; }; -struct tagRun2V0MCalibration { +struct TagRun2V0MCalibration { bool mCalibrationStored = false; TH1* mhVtxAmpCorrV0A = nullptr; TH1* mhVtxAmpCorrV0C = nullptr; @@ -85,30 +89,30 @@ enum PartTypes { kOther = 8 }; -struct ebyeMult { +struct EbyeMult { std::vector candidateTracks; Service ccdb; CandidateEvent candidateEvent; int mRunNumber; - float d_bz; + float dBz; uint8_t nTrackletsColl; ConfigurableAxis centAxis{"centAxis", {106, 0, 106}, "binning for the centrality"}; - ConfigurableAxis zVtxAxis{"zVtxBins", {100, -20.f, 20.f}, "Binning for the vertex z in cm"}; - ConfigurableAxis multAxis{"multAxis", {100, 0, 10000}, "Binning for the multiplicity axis"}; - ConfigurableAxis multFt0Axis{"multFt0Axis", {100, 0, 100000}, "Binning for the ft0 multiplicity axis"}; - Configurable genName{"genname", "", "Genearator name: HIJING, PYTHIA8, ... Default: \"\""}; + ConfigurableAxis zVtxAxis{"zVtxAxis", {100, -20.f, 20.f}, "Binning for the vertex z in cm"}; + ConfigurableAxis multAxis{"multAxis", {100, 0.f, 100.f}, "Binning for the multiplicity axis"}; + ConfigurableAxis multFt0Axis{"multFt0Axis", {100, 0.f, 100.f}, "Binning for the ft0 multiplicity axis"}; + Configurable genName{"genName", "", "Genearator name: HIJING, PYTHIA8, ... Default: \"\""}; Configurable zVtxMax{"zVtxMax", 10.0f, "maximum z position of the primary vertex"}; Configurable etaMax{"etaMax", 0.8f, "maximum eta"}; - Configurable ptMin{"ptMin", 0.4f, "minimum pT (GeV/c)"}; - Configurable ptMax{"ptMax", 4.f, "maximum pT (GeV/c)"}; + Configurable ptMin{"ptMin", 0.05f, "minimum pT (GeV/c)"}; + Configurable ptMax{"ptMax", 10.f, "maximum pT (GeV/c)"}; Configurable trackNcrossedRows{"trackNcrossedRows", 70, "Minimum number of crossed TPC rows"}; - Configurable trackNclusItsCut{"trackNclusITScut", 2, "Minimum number of ITS clusters"}; - Configurable trackNclusTpcCut{"trackNclusTPCcut", 60, "Minimum number of TPC clusters"}; + Configurable trackNclusITScut{"trackNclusITScut", 2, "Minimum number of ITS clusters"}; + Configurable trackNclusTPCcut{"trackNclusTPCcut", 60, "Minimum number of TPC clusters"}; Configurable trackChi2Cut{"trackChi2Cut", 4.f, "Maximum chi2/ncls in TPC"}; Configurable> cfgDcaSels{"cfgDcaSels", {dcaSels, 1, 3, particleName, dcaSelsNames}, "DCA selections"}; @@ -153,8 +157,8 @@ struct ebyeMult { if (!(track.itsClusterMap() & 0x01) && !(track.itsClusterMap() & 0x02)) { return false; } - if (track.itsNCls() < trackNclusItsCut || - track.tpcNClsFound() < trackNclusTpcCut || + if (track.itsNCls() < trackNclusITScut || + track.tpcNClsFound() < trackNclusTPCcut || track.tpcNClsCrossedRows() < trackNcrossedRows || track.tpcNClsCrossedRows() < 0.8 * track.tpcNClsFindable() || track.tpcChi2NCl() > trackChi2Cut || @@ -224,46 +228,46 @@ struct ebyeMult { o2::base::Propagator::initFieldFromGRP(grpmag); } // Fetch magnetic field from ccdb for current collision - d_bz = o2::base::Propagator::Instance()->getNominalBz(); - LOG(info) << "Retrieved GRP for timestamp " << timestamp << " with magnetic field of " << d_bz << " kG"; + dBz = o2::base::Propagator::Instance()->getNominalBz(); + LOG(info) << "Retrieved GRP for timestamp " << timestamp << " with magnetic field of " << dBz << " kG"; mRunNumber = bc.runNumber(); } - // float getV0M(int64_t const id, float const zvtx, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs) - // { - // auto fv0a = fv0as.rawIteratorAt(id); - // auto fv0c = fv0cs.rawIteratorAt(id); - // float multFV0A = 0; - // float multFV0C = 0; - // for (float amplitude : fv0a.amplitude()) { - // multFV0A += amplitude; - // } - - // for (float amplitude : fv0c.amplitude()) { - // multFV0C += amplitude; - // } - - // float v0m = -1; - // auto scaleMC = [](float x, float pars[6]) { - // return pow(((pars[0] + pars[1] * pow(x, pars[2])) - pars[3]) / pars[4], 1.0f / pars[5]); - // }; - - // if (Run2V0MInfo.mMCScale != nullptr) { - // float multFV0M = multFV0A + multFV0C; - // v0m = scaleMC(multFV0M, Run2V0MInfo.mMCScalePars); - // LOGF(debug, "Unscaled v0m: %f, scaled v0m: %f", multFV0M, v0m); - // } else { - // v0m = multFV0A * Run2V0MInfo.mhVtxAmpCorrV0A->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0A->FindFixBin(zvtx)) + - // multFV0C * Run2V0MInfo.mhVtxAmpCorrV0C->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0C->FindFixBin(zvtx)); - // } - // return v0m; - // } + float getV0M(int64_t const id, float const zvtx, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs) + { + auto fv0a = fv0as.rawIteratorAt(id); + auto fv0c = fv0cs.rawIteratorAt(id); + float multFV0A = 0; + float multFV0C = 0; + for (float const& amplitude : fv0a.amplitude()) { + multFV0A += amplitude; + } + + for (float const& amplitude : fv0c.amplitude()) { + multFV0C += amplitude; + } + + float v0m = -1; + auto scaleMC = [](float x, float pars[6]) { + return std::pow(((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4], 1.0f / pars[5]); + }; + + if (Run2V0MInfo.mMCScale != nullptr) { + float multFV0M = multFV0A + multFV0C; + v0m = scaleMC(multFV0M, Run2V0MInfo.mMCScalePars); + LOGF(debug, "Unscaled v0m: %f, scaled v0m: %f", multFV0M, v0m); + } else { + v0m = multFV0A * Run2V0MInfo.mhVtxAmpCorrV0A->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0A->FindFixBin(zvtx)) + + multFV0C * Run2V0MInfo.mhVtxAmpCorrV0C->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0C->FindFixBin(zvtx)); + } + return v0m; + } void init(o2::framework::InitContext&) { mRunNumber = 0; - d_bz = 0; + dBz = 0; ccdb->setURL("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); @@ -275,33 +279,52 @@ struct ebyeMult { histos.add("QA/V0MvsCL0", ";Centrality CL0 (%);Centrality V0M (%)", HistType::kTH2F, {centAxis, centAxis}); histos.add("QA/trackletsVsV0M", ";Centrality CL0 (%);Centrality V0M (%)", HistType::kTH2F, {centAxis, multAxis}); histos.add("QA/nTrklCorrelation", ";Tracklets |#eta| > 0.7; Tracklets |#eta| < 0.6", HistType::kTH2D, {{201, -0.5, 200.5}, {201, -0.5, 200.5}}); + histos.add("QA/nV0MCorrelation", ";V0M Multiplicity (%); Tracklets |#eta| < 0.6", HistType::kTH2D, {multAxis, {201, -0.5, 200.5}}); histos.add("QA/TrklEta", ";Tracklets #eta; Entries", HistType::kTH1D, {{100, -3., 3.}}); // rec tracks histos.add("RecTracks", ";Tracklets |#eta| > 0.7;#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {{201, -0.5, 200.5}, {100, -5., 5.}, {200, -1., 1.}}); + histos.add("RecTracksV0M", ";V0M Multiplicity (%);#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {multAxis, {100, -5., 5.}, {200, -1., 1.}}); // rec tracks and tracklets distribution histos.add("TracksDistr", ";Tracklets |#eta| > 0.7;#it{N}_{trk}", HistType::kTH2D, {{201, -0.5, 200.5}, {201, -0.5, 200.5}}); histos.add("TrackletsDistr", ";Tracklets |#eta| > 0.7;#it{N}_{tkl}", HistType::kTH2D, {{201, -0.5, 200.5}, {201, -0.5, 200.5}}); + histos.add("TracksDistrV0M", ";V0M Multiplicity (%);#it{N}_{trk}", HistType::kTH2D, {multAxis, {201, -0.5, 200.5}}); + histos.add("TrackletsDistrV0M", ";V0M Multiplicity (%);#it{N}_{tkl}", HistType::kTH2D, {multAxis, {201, -0.5, 200.5}}); + if (doprocessMcRun2) { // rec & gen particles (per species) histos.add("RecPart", ";Tracklets |#eta| > 0.7;#it{p}_{T} (GeV/#it{c});Species", HistType::kTH3D, {{201, -0.5, 200.5}, {100, -5., 5.}, {10, 0, 10}}); histos.add("GenPart", ";Tracklets |#eta| > 0.7;#it{p}_{T} (GeV/#it{c});Species", HistType::kTH3D, {{201, -0.5, 200.5}, {100, -5., 5.}, {10, 0, 10}}); + histos.add("RecPartV0M", ";V0M Multiplicity (%);#it{p}_{T} (GeV/#it{c});Species", HistType::kTH3D, {multAxis, {100, -5., 5.}, {10, 0, 10}}); + histos.add("GenPartV0M", ";V0M Multiplicity (%);#it{p}_{T} (GeV/#it{c});Species", HistType::kTH3D, {multAxis, {100, -5., 5.}, {10, 0, 10}}); + // dca_xy templates histos.add("PrimTracks", ";Tracklets |#eta| > 0.7;#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {{201, -0.5, 200.5}, {100, -5., 5.}, {200, -1., 1.}}); histos.add("SecWDTracks", ";Tracklets |#eta| > 0.7;#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {{201, -0.5, 200.5}, {100, -5., 5.}, {200, -1., 1.}}); histos.add("SecTracks", ";Tracklets |#eta| > 0.7;#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {{201, -0.5, 200.5}, {100, -5., 5.}, {200, -1., 1.}}); + histos.add("PrimTracksV0M", ";V0M Multiplicity (%);#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {multAxis, {100, -5., 5.}, {200, -1., 1.}}); + histos.add("SecWDTracksV0M", ";V0M Multiplicity (%);#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {multAxis, {100, -5., 5.}, {200, -1., 1.}}); + histos.add("SecTracksV0M", ";V0M Multiplicity (%);#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH3D, {multAxis, {100, -5., 5.}, {200, -1., 1.}}); + // response - histos.add("GenRecTracks", ";Tracklets |#eta| > 0.7#it;#it{N}_{trk};#it{N}_{gen}", HistType::kTH3D, {{201, -0.5, 200.5}, {201, -0.5, 200.5}, {201, -0.5, 200.5}}); + histos.add("GenRecTracks", ";Tracklets |#eta| > 0.7;#it{N}_{trk};#it{N}_{gen}", HistType::kTH3D, {{201, -0.5, 200.5}, {201, -0.5, 200.5}, {201, -0.5, 200.5}}); histos.add("GenRecTracklets", ";Tracklets |#eta| > 0.7;#it{N}_{tkl};#it{N}_{gen}", HistType::kTH3D, {{201, -0.5, 200.5}, {201, -0.5, 200.5}, {201, -0.5, 200.5}}); + + histos.add("GenRecTracksV0M", ";V0M Multiplicity (%);#it{N}_{trk};#it{N}_{gen}", HistType::kTH3D, {multAxis, {201, -0.5, 200.5}, {201, -0.5, 200.5}}); + histos.add("GenRecTrackletsV0M", ";V0M Multiplicity (%);#it{N}_{tkl};#it{N}_{gen}", HistType::kTH3D, {multAxis, {201, -0.5, 200.5}, {201, -0.5, 200.5}}); } + + // histograms for the evaluation of trigger efficiency + histos.add("GenINELgtZERO", ";#it{N}_{gen}", HistType::kTH1D, {multAxis}); + histos.add("RecINELgtZERO", ";#it{N}_{gen}", HistType::kTH1D, {multAxis}); } template - void fillRecoEvent(C const& collision, T const& tracksAll /* , float const& centrality */) + void fillRecoEvent(C const& collision, T const& tracksAll, float const& centrality) { auto tracks = tracksAll.sliceBy(perCollisionTracksFull, collision.globalIndex()); candidateTracks.clear(); @@ -336,6 +359,8 @@ struct ebyeMult { CandidateTrack candTrack; candTrack.pt = track.sign() > 0. ? trackPt : -trackPt; + if (trackPt < ptMin || trackPt > ptMax) + continue; candTrack.eta = trackEta; candTrack.dcapv = dca; candTrack.dcaxypv = dcaInfo[0]; @@ -343,79 +368,87 @@ struct ebyeMult { candTrack.globalIndex = track.globalIndex(); candidateTracks.push_back(candTrack); - if (std::abs(dcaInfo[0]) < cfgDcaSels->get("dcaxy")) { // dcaxy + if (std::abs(dcaInfo[0]) < cfgDcaSels->get("dcaxy")) { // dcaxy TODO: add pt dependent dcaxy cut ++nTracks; } } histos.fill(HIST("QA/nTrklCorrelation"), nTracklets[0], nTracklets[1]); + histos.fill(HIST("QA/nV0MCorrelation"), nTracklets[0], centrality); nTrackletsColl = nTracklets[1]; candidateEvent.nTklRec = nTracklets[0]; histos.fill(HIST("TracksDistr"), nTracklets[1], nTracks); histos.fill(HIST("TrackletsDistr"), nTracklets[1], nTracklets[0]); + histos.fill(HIST("TracksDistrV0M"), centrality, nTracks); + histos.fill(HIST("TrackletsDistrV0M"), centrality, nTracklets[0]); } template - void fillMcEvent(C const& collision, T const& tracks /* , float const& centrality */, aod::McParticles const&, aod::McTrackLabels const& mcLabels) + void fillMcEvent(C const& collision, T const& tracks, float const& centrality, aod::McParticles const&, aod::McTrackLabels const& mcLabels) { - fillRecoEvent(collision, tracks /* , centrality */); + fillRecoEvent(collision, tracks, centrality); int nTracks{0}; - for (auto& candidateTrack : candidateTracks) { - candidateTrack.isreco = true; + for (int iT{0}; iT < static_cast(candidateTracks.size()); ++iT) { + candidateTracks[iT].isreco = true; - auto mcLab = mcLabels.rawIteratorAt(candidateTrack.globalIndex); + auto mcLab = mcLabels.rawIteratorAt(candidateTracks[iT].globalIndex); if (mcLab.has_mcParticle()) { auto mcTrack = mcLab.template mcParticle_as(); if (((mcTrack.flags() & 0x8) && (doprocessMcRun2)) || (mcTrack.flags() & 0x2)) continue; if (!mcTrack.isPhysicalPrimary()) { if (mcTrack.has_mothers()) { // sec WD - histos.fill(HIST("SecWDTracks"), nTrackletsColl, candidateTrack.pt, candidateTrack.dcaxypv); + histos.fill(HIST("SecWDTracks"), nTrackletsColl, candidateTracks[iT].pt, candidateTracks[iT].dcaxypv); + histos.fill(HIST("SecWDTracksV0M"), centrality, candidateTracks[iT].pt, candidateTracks[iT].dcaxypv); } else { // from material - histos.fill(HIST("SecTracks"), nTrackletsColl, candidateTrack.pt, candidateTrack.dcaxypv); + histos.fill(HIST("SecTracks"), nTrackletsColl, candidateTracks[iT].pt, candidateTracks[iT].dcaxypv); + histos.fill(HIST("SecTracksV0M"), centrality, candidateTracks[iT].pt, candidateTracks[iT].dcaxypv); } } - if ((mcTrack.flags() & 0x1)) - continue; + if (std::abs(candidateTracks[iT].dcaxypv) > cfgDcaSels->get("dcaxy")) { // TODO: add pt dependent cut + ++nTracks; + } + if (mcTrack.isPhysicalPrimary()) { // primary - histos.fill(HIST("PrimTracks"), nTrackletsColl, candidateTrack.pt, candidateTrack.dcaxypv); + histos.fill(HIST("PrimTracks"), nTrackletsColl, candidateTracks[iT].pt, candidateTracks[iT].dcaxypv); + histos.fill(HIST("PrimTracksV0M"), centrality, candidateTracks[iT].pt, candidateTracks[iT].dcaxypv); } - if (std::abs(candidateTrack.dcaxypv) > cfgDcaSels->get("dcaxy")) + if (std::abs(candidateTracks[iT].dcaxypv) > cfgDcaSels->get("dcaxy")) continue; int partType = getPartType(mcTrack.pdgCode()); if (mcTrack.isPhysicalPrimary()) { // primary - histos.fill(HIST("RecPart"), nTrackletsColl, candidateTrack.pt, partType); - if (partType < PartTypes::kOther) { - ++nTracks; - } + histos.fill(HIST("RecPart"), nTrackletsColl, candidateTracks[iT].pt, partType); + histos.fill(HIST("RecPartV0M"), centrality, candidateTracks[iT].pt, partType); } auto genPt = std::hypot(mcTrack.px(), mcTrack.py()); - candidateTrack.pdgcode = mcTrack.pdgCode(); - candidateTrack.genpt = genPt; - candidateTrack.geneta = mcTrack.eta(); - candidateTrack.mcIndex = mcTrack.globalIndex(); + candidateTracks[iT].pdgcode = mcTrack.pdgCode(); + candidateTracks[iT].genpt = genPt; + candidateTracks[iT].geneta = mcTrack.eta(); + candidateTracks[iT].mcIndex = mcTrack.globalIndex(); } } candidateEvent.nTrkRec = nTracks; } - void fillMcGen(aod::McParticles const& mcParticles, aod::McTrackLabels const& /*mcLab*/, uint64_t const& collisionId) + void fillMcGen(aod::McParticles const& mcParticles, aod::McTrackLabels const& /*mcLab*/, uint64_t const& collisionId, float const& centrality) { int nParticles = 0; - auto mcParticles_thisCollision = mcParticles.sliceBy(perCollisionMcParts, collisionId); - for (auto& mcPart : mcParticles_thisCollision) { + auto mcParticlesThisCollision = mcParticles.sliceBy(perCollisionMcParts, collisionId); + for (auto const& mcPart : mcParticlesThisCollision) { auto genEta = mcPart.eta(); if (std::abs(genEta) > etaMax) { continue; } - if (((mcPart.flags() & 0x8) && (doprocessMcRun2)) || (mcPart.flags() & 0x2) || (mcPart.flags() & 0x1)) + if (((mcPart.flags() & 0x8) && (doprocessMcRun2)) || (mcPart.flags() & 0x2)) continue; if (!mcPart.isPhysicalPrimary() /* && !mcPart.has_mothers() */) continue; auto genPt = std::hypot(mcPart.px(), mcPart.py()); + if (genPt < ptMin || genPt > ptMax) + continue; CandidateTrack candTrack; candTrack.genpt = genPt; candTrack.geneta = mcPart.eta(); @@ -426,6 +459,7 @@ struct ebyeMult { ++nParticles; } histos.fill(HIST("GenPart"), nTrackletsColl, mcPart.pdgCode() > 0 ? genPt : -genPt, partType); + histos.fill(HIST("GenPartV0M"), centrality, mcPart.pdgCode() > 0 ? genPt : -genPt, partType); auto it = find_if(candidateTracks.begin(), candidateTracks.end(), [&](CandidateTrack trk) { return trk.mcIndex == mcPart.globalIndex(); }); if (it != candidateTracks.end()) { @@ -434,11 +468,45 @@ struct ebyeMult { candidateTracks.emplace_back(candTrack); } } + histos.fill(HIST("RecINELgtZERO"), nParticles); histos.fill(HIST("GenRecTracks"), nTrackletsColl, candidateEvent.nTrkRec, nParticles); histos.fill(HIST("GenRecTracklets"), nTrackletsColl, candidateEvent.nTklRec, nParticles); + histos.fill(HIST("GenRecTracksV0M"), centrality, candidateEvent.nTrkRec, nParticles); + histos.fill(HIST("GenRecTrackletsV0M"), centrality, candidateEvent.nTklRec, nParticles); } - void processRun2(soa::Join const& collisions, TracksFull const& tracks /* , aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs */, BCsWithRun2Info const&) + template + int genMultINELgtZERO(C const& collision, P const& particles) + { + if (std::abs(collision.posZ()) > zVtxMax) + return -1; + + int nParticles = 0; + int partInAcc = 0; + auto particlesThisCollision = particles.sliceBy(perCollisionMcParts, collision.globalIndex()); + for (auto const& particle : particlesThisCollision) { + if (((particle.flags() & 0x8) && (doprocessMcRun2)) || (particle.flags() & 0x2)) + continue; + if (!particle.isPhysicalPrimary() /* && !particle.has_mothers() */) + continue; + auto pt = std::hypot(particle.px(), particle.py()); + if (pt < ptMin || pt > ptMax) + continue; + + int partType = getPartType(particle.pdgCode()); + if (partType < PartTypes::kOther) { + ++nParticles; + if (std::abs(particle.eta()) < 1.f) { + ++partInAcc; + } + } + } + if (partInAcc > 0) + return nParticles; + return -1; + } + + void processRun2(soa::Join const& collisions, TracksFull const& tracks, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, BCsWithRun2Info const&) { for (const auto& collision : collisions) { @@ -454,24 +522,28 @@ struct ebyeMult { if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) continue; - // float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); - // float cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kINELgtZERO))) + continue; + + float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); + float cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); histos.fill(HIST("QA/zVtx"), collision.posZ()); - fillRecoEvent(collision, tracks /* , cV0M */); + fillRecoEvent(collision, tracks, cV0M); - for (auto t : candidateTracks) { + for (auto const& t : candidateTracks) { histos.fill(HIST("RecTracks"), nTrackletsColl, t.pt, t.dcaxypv); + histos.fill(HIST("RecTracksV0M"), cV0M, t.pt, t.dcaxypv); } } } - PROCESS_SWITCH(ebyeMult, processRun2, "process (Run 2)", false); + PROCESS_SWITCH(EbyeMult, processRun2, "process (Run 2)", false); - void processMcRun2(soa::Join const& collisions, aod::McCollisions const& /*mcCollisions*/, TracksFull const& tracks /* , aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs */, aod::McParticles const& mcParticles, aod::McTrackLabels const& mcLab, BCsWithRun2Info const&) + void processMcRun2(soa::Join const& collisions, aod::McCollisions const& mcCollisions, TracksFull const& tracks, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, aod::McParticles const& mcParticles, aod::McTrackLabels const& mcLab, BCsWithRun2Info const&) { - for (const auto& collision : collisions) { + for (const auto& collision : collisions) { // TODO: fill numerator for trigger efficiency auto bc = collision.bc_as(); initCCDB(bc); @@ -481,20 +553,31 @@ struct ebyeMult { if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) continue; - // float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); - // float cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kINELgtZERO))) + continue; + + float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); + float cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); histos.fill(HIST("QA/zVtx"), collision.posZ()); - fillMcEvent(collision, tracks /* , cV0M */, mcParticles, mcLab); - fillMcGen(mcParticles, mcLab, collision.mcCollisionId()); + fillMcEvent(collision, tracks, cV0M, mcParticles, mcLab); + fillMcGen(mcParticles, mcLab, collision.mcCollisionId(), cV0M); + } + + // search generated INEL > 0 (one charged particle in |eta| < 1) + for (const auto& mcCollision : mcCollisions) { + int mult = genMultINELgtZERO(mcCollision, mcParticles) > 0; + if (mult > 0) { + histos.fill(HIST("GenINELgtZERO"), mult); + } } } - PROCESS_SWITCH(ebyeMult, processMcRun2, "process mc (Run 2)", false); + PROCESS_SWITCH(EbyeMult, processMcRun2, "process mc (Run 2)", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } From 574fec16ce32b24badcb487291946cf9b5ab4801 Mon Sep 17 00:00:00 2001 From: mhartung71 <50153519+mhartung71@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:25:41 +0100 Subject: [PATCH 239/459] [PWGLF] Fix unbound indices in KF hypernuclei code (#8803) Co-authored-by: ALICE Action Bot --- PWGLF/DataModel/LFHypernucleiKfTables.h | 50 +++++++++---------- PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx | 10 ++-- .../TableProducer/Nuspex/hypKfTreeCreator.cxx | 20 ++++---- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/PWGLF/DataModel/LFHypernucleiKfTables.h b/PWGLF/DataModel/LFHypernucleiKfTables.h index ed50e56b17f..328ab07f6b3 100644 --- a/PWGLF/DataModel/LFHypernucleiKfTables.h +++ b/PWGLF/DataModel/LFHypernucleiKfTables.h @@ -24,17 +24,17 @@ namespace hykfmcColl { DECLARE_SOA_COLUMN(PassedEvSel, passedEvSel, bool); //! } -DECLARE_SOA_TABLE(HypKfMcCollisions, "AOD", "HYPKFMCCOLL", +DECLARE_SOA_TABLE(HypKfMcColls, "AOD", "HYPKFMCCOLL", o2::soa::Index<>, hykfmcColl::PassedEvSel, mccollision::PosX, mccollision::PosY, mccollision::PosZ); -using HypKfMcCollision = HypKfMcCollisions::iterator; +using HypKfMcColl = HypKfMcColls::iterator; namespace hykfmc { -DECLARE_SOA_INDEX_COLUMN(HypKfMcCollision, hypKfMcCollision); +DECLARE_SOA_INDEX_COLUMN(HypKfMcColl, hypKfMcColl); DECLARE_SOA_COLUMN(Species, species, int8_t); //! DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); //! DECLARE_SOA_COLUMN(Svx, svx, float); //! @@ -46,9 +46,9 @@ DECLARE_SOA_DYNAMIC_COLUMN(Mass, mass, [](float E, float px, float py, float pz) DECLARE_SOA_DYNAMIC_COLUMN(IsMatter, isMatter, [](int pdgCode) { return pdgCode > 0; }); } // namespace hykfmc -DECLARE_SOA_TABLE(HypKfMcParticles, "AOD", "HYPKFMCPART", +DECLARE_SOA_TABLE(HypKfMcParts, "AOD", "HYPKFMCPART", o2::soa::Index<>, - hykfmc::HypKfMcCollisionId, + hykfmc::HypKfMcCollId, hykfmc::Species, mcparticle::PdgCode, hykfmc::IsPhysicalPrimary, @@ -63,23 +63,23 @@ DECLARE_SOA_TABLE(HypKfMcParticles, "AOD", "HYPKFMCPART", hykfmc::Y, hykfmc::Mass, hykfmc::IsMatter); -using HypKfMcParticle = HypKfMcParticles::iterator; +using HypKfMcPart = HypKfMcParts::iterator; -DECLARE_SOA_TABLE(HypKfCollisions, "AOD", "HYPKFCOLL", +DECLARE_SOA_TABLE(HypKfColls, "AOD", "HYPKFCOLL", o2::soa::Index<>, hykfmcColl::PassedEvSel, - hykfmc::HypKfMcCollisionId, + hykfmc::HypKfMcCollId, collision::PosX, collision::PosY, collision::PosZ, cent::CentFT0A, cent::CentFT0C, cent::CentFT0M); -using HypKfCollision = HypKfCollisions::iterator; +using HypKfColl = HypKfColls::iterator; namespace hykftrk { -DECLARE_SOA_INDEX_COLUMN(HypKfCollision, hypKfCollision); +DECLARE_SOA_INDEX_COLUMN(HypKfColl, hypKfColl); DECLARE_SOA_COLUMN(Rigidity, rigidity, float); //! DECLARE_SOA_COLUMN(TPCnCluster, tpcNcluster, float); //! DECLARE_SOA_COLUMN(TPCnSigma, tpcNsigma, float); //! @@ -149,12 +149,12 @@ DECLARE_SOA_TABLE(HypKfTracks, "AOD", "HYPKFTRACK", hykftrk::ITSmeanClsSize); using HypKfTrack = HypKfTracks::iterator; -DECLARE_SOA_TABLE(HypKfSubDaughters, "AOD", "HYPKFSUBD", +DECLARE_SOA_TABLE(HypKfSubDs, "AOD", "HYPKFSUBD", o2::soa::Index<>, hykftrk::SubMass); -using HypKfSubDaughter = HypKfSubDaughters::iterator; +using HypKfSubD = HypKfSubDs::iterator; -DECLARE_SOA_TABLE(HypKfDaughterAddons, "AOD", "HYPKFDADD", +DECLARE_SOA_TABLE(HypKfDaughtAdds, "AOD", "HYPKFDAUGHTADD", o2::soa::Index<>, track::X, track::Y, @@ -162,16 +162,16 @@ DECLARE_SOA_TABLE(HypKfDaughterAddons, "AOD", "HYPKFDADD", mcparticle::Px, mcparticle::Py, mcparticle::Pz); -using HypKfDaughterAddon = HypKfDaughterAddons::iterator; +using HypKfDaughtAdd = HypKfDaughtAdds::iterator; namespace hykfhyp { -DECLARE_SOA_INDEX_COLUMN(HypKfCollision, hypKfCollision); -DECLARE_SOA_INDEX_COLUMN(HypKfMcParticle, hypKfMcParticle); -DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfDaughterAddon, addons); +DECLARE_SOA_INDEX_COLUMN(HypKfColl, hypKfColl); +DECLARE_SOA_INDEX_COLUMN(HypKfMcPart, hypKfMcPart); +DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfDaughtAdd, addons); DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfTrack, daughterTracks); -DECLARE_SOA_SELF_INDEX_COLUMN(HypDaughter, hypDaughter); -DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfSubDaughter, subDaughters); +DECLARE_SOA_SELF_INDEX_COLUMN_FULL(HypDaughter, hypDaughter, int, "HypKfHypNucs"); +DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfSubD, subDaughters); DECLARE_SOA_COLUMN(Primary, primary, bool); //! DECLARE_SOA_COLUMN(Mass, mass, float); //! DECLARE_SOA_COLUMN(Px, px, float); //! @@ -188,19 +188,19 @@ DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](float px, float py, float pz) { return R DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](float px, float py) { return RecoDecay::phi(std::array{px, py}); }); DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float px, float py, float pz) { return RecoDecay::p(px, py, pz); }); // DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float px, float py, float pz, float mass) { return RecoDecay::y(std::array{px, py, pz}, mass); }); -DECLARE_SOA_DYNAMIC_COLUMN(McTrue, mcTrue, [](int hypKfMcParticleId) { return hypKfMcParticleId > 0; }); +DECLARE_SOA_DYNAMIC_COLUMN(McTrue, mcTrue, [](int hypKfMcPartId) { return hypKfMcPartId > 0; }); DECLARE_SOA_DYNAMIC_COLUMN(IsMatter, isMatter, [](int8_t species) { return species > 0; }); DECLARE_SOA_DYNAMIC_COLUMN(Cascade, cascade, [](int hypDaughter) { return hypDaughter > 0; }); } // namespace hykfhyp DECLARE_SOA_TABLE(HypKfHypNucs, "AOD", "HYPKFHYPNUC", o2::soa::Index<>, - hykfhyp::HypKfMcParticleId, - hykfhyp::HypKfCollisionId, + hykfhyp::HypKfMcPartId, + hykfhyp::HypKfCollId, hykfhyp::HypKfTrackIds, - hykfhyp::HypKfDaughterAddonIds, + hykfhyp::HypKfDaughtAddIds, hykfhyp::HypDaughterId, - hykfhyp::HypKfSubDaughterIds, + hykfhyp::HypKfSubDIds, hykfmc::Species, hykfhyp::Primary, hykfhyp::Mass, @@ -221,7 +221,7 @@ DECLARE_SOA_TABLE(HypKfHypNucs, "AOD", "HYPKFHYPNUC", hykfhyp::Eta, hykfhyp::Phi, hykfhyp::P, - hykfhyp::McTrue, + hykfhyp::McTrue, hykfhyp::IsMatter, hykfhyp::Cascade); using HypKfHypNuc = HypKfHypNucs::iterator; diff --git a/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx index a1c4e21a9a7..353459c835b 100644 --- a/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx @@ -405,12 +405,12 @@ std::vector> hInvMass; //---------------------------------------------------------------------------------------------------------------- struct hypKfRecoTask { - Produces outputMcCollisionTable; - Produces outputMcParticleTable; - Produces outputCollisionTable; + Produces outputMcCollisionTable; + Produces outputMcParticleTable; + Produces outputCollisionTable; Produces outputTrackTable; - Produces outputDaughterAddonTable; - Produces outputSubDaughterTable; + Produces outputDaughterAddonTable; + Produces outputSubDaughterTable; Produces outputHypNucTable; Preslice perCollision = aod::track_association::collisionId; diff --git a/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx b/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx index 5666a06efc2..bba41fdfeac 100644 --- a/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx +++ b/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx @@ -329,7 +329,7 @@ struct hypKfTreeCreator { Produces outputTableMcTwoThree; Produces outputTableThreeTwo; Produces outputTableMcThreeTwo; - PresliceUnsorted perMcParticle = aod::hykfhyp::hypKfMcParticleId; + PresliceUnsorted perMcParticle = aod::hykfhyp::hypKfMcPartId; Configurable cfgSpecies{"cfgSpecies", 0, "Select species"}; Configurable cfgNprimDaughters{"cfgNprimDaughters", 0, "Number of primary daughters"}; @@ -354,7 +354,7 @@ struct hypKfTreeCreator { } //___________________________________________________________________________________________________________________________________________________________ - void processData(aod::HypKfHypNucs const& hypNucs, aod::HypKfCollisions const& hypKfColls, aod::HypKfTracks const& hypKfTrks, aod::HypKfDaughterAddons const& hypKfDAdd, aod::HypKfSubDaughters const& hypKfDSub) + void processData(aod::HypKfHypNucs const& hypNucs, aod::HypKfColls const& hypKfColls, aod::HypKfTracks const& hypKfTrks, aod::HypKfDaughtAdds const& hypKfDAdd, aod::HypKfSubDs const& hypKfDSub) { for (auto& hypNuc : hypNucs) { if (std::abs(hypNuc.species()) != cfgSpecies) @@ -514,12 +514,12 @@ struct hypKfTreeCreator { } //___________________________________________________________________________________________________________________________________________________________ - void fillCandidate(hyperNucleus& cand, hyperNucleus& hypDaughter, aod::HypKfHypNuc const& hypNuc, aod::HypKfHypNucs const&, aod::HypKfCollisions const&, aod::HypKfTracks const&, aod::HypKfDaughterAddons const&, aod::HypKfSubDaughters const&) + void fillCandidate(hyperNucleus& cand, hyperNucleus& hypDaughter, aod::HypKfHypNuc const& hypNuc, aod::HypKfHypNucs const&, aod::HypKfColls const&, aod::HypKfTracks const&, aod::HypKfDaughtAdds const&, aod::HypKfSubDs const&) { cand.daughterTracks.clear(); cand.subDaughterMassVec.clear(); - auto coll = hypNuc.hypKfCollision(); - auto addOns = hypNuc.addons_as(); + auto coll = hypNuc.hypKfColl(); + auto addOns = hypNuc.addons_as(); auto posVec = posVector(addOns); cand.Species = std::abs(hypNuc.species()); cand.IsMatter = hypNuc.isMatter(); @@ -584,20 +584,20 @@ struct hypKfTreeCreator { return; trackCount = 0; - auto subDaughters = hypNuc.subDaughters_as(); + auto subDaughters = hypNuc.subDaughters_as(); for (auto& subDaughter : subDaughters) { cand.daughterTracks.at(trackCount++).SubMass = subDaughter.subMass(); } } //___________________________________________________________________________________________________________________________________________________________ - void processMC(aod::HypKfMcParticles const& mcHypNucs, aod::HypKfHypNucs const& hypNucs, aod::HypKfMcCollisions const&, aod::HypKfCollisions const& hypKfColls, aod::HypKfTracks const& hypKfTrks, aod::HypKfDaughterAddons const& hypKfDAdd, aod::HypKfSubDaughters const& hypKfDSub) + void processMC(aod::HypKfMcParts const& mcHypNucs, aod::HypKfHypNucs const& hypNucs, aod::HypKfMcColls const&, aod::HypKfColls const& hypKfColls, aod::HypKfTracks const& hypKfTrks, aod::HypKfDaughtAdds const& hypKfDAdd, aod::HypKfSubDs const& hypKfDSub) { isMC = true; for (auto& mcHypNuc : mcHypNucs) { if (std::abs(mcHypNuc.species()) != cfgSpecies) continue; - auto mcColl = mcHypNuc.hypKfMcCollision(); + auto mcColl = mcHypNuc.hypKfMcColl(); const auto mcParticleIdx = mcHypNuc.globalIndex(); auto hypNucsByMc = hypNucs.sliceBy(perMcParticle, mcParticleIdx); hyperNucleus candidate, hypDaughter, dummy; @@ -620,8 +620,8 @@ struct hypKfTreeCreator { candidate.SvyGen = mcHypNuc.svy(); candidate.SvzGen = mcHypNuc.svz(); for (auto& hypNuc : hypNucsByMc) { - auto coll = hypNuc.hypKfCollision(); - if (coll.hypKfMcCollisionId() == mcHypNuc.hypKfMcCollisionId()) { + auto coll = hypNuc.hypKfColl(); + if (coll.hypKfMcCollId() == mcHypNuc.hypKfMcCollId()) { candidate.CollisionMcTrue = true; } candidate.IsReconstructed++; From 5ba143c368039d3f18790a0803b3c22f316f5baf Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Wed, 4 Dec 2024 09:48:27 +0100 Subject: [PATCH 240/459] [PWGCF] DptDpt Efficiency an QC, configurable nsigma axes (#8808) Co-authored-by: Victor --- .../Tasks/dptDptEfficiencyAndQc.cxx | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx index 890a2c78fdc..b902057451a 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx @@ -74,6 +74,12 @@ enum BeforeAfter { kAfter ///< filling after track selection }; +/* the configuration of the nsigma axis */ +float minNSigma = -4.05f; +float maxNSigma = 4.05f; +float widthNSigmaBin = 0.1f; +int noOfNSigmaBins = static_cast((maxNSigma - minNSigma) / widthNSigmaBin); + /* the PID selector object to help with the configuration and the id of the selected particles */ o2::analysis::dptdptfilter::PIDSpeciesSelection pidselector; @@ -487,17 +493,17 @@ struct PidDataCollectingEngine { fhTPCTOFSigmaVsP[ix][isp] = ADDHISTOGRAM(TH3, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", whenname[ix].c_str()), HNAMESTRING("toftpcNSigmasVsP%c_%s", whenprefix[ix], mainspnames[isp].c_str()), HTITLESTRING("n#sigma to the %s line %s", mainsptitles[isp].c_str(), whentitle[ix].c_str()), - kTH3F, {pidPAxis, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TPC}^{%s}", mainsptitles[isp].c_str())}, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TOF}^{%s}", mainsptitles[isp].c_str())}}); + kTH3F, {pidPAxis, {noOfNSigmaBins, minNSigma, maxNSigma, FORMATSTRING("n#sigma_{TPC}^{%s}", mainsptitles[isp].c_str())}, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TOF}^{%s}", mainsptitles[isp].c_str())}}); } for (uint isp = 0; isp < nallmainsp; ++isp) { fhTPCnSigmasVsP[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", whenname[ix].c_str()), HNAMESTRING("tpcNSigmasVsP%c_%s", whenprefix[ix], allmainspnames[isp].c_str()), HTITLESTRING("TPC n#sigma to the %s line %s", allmainsptitles[isp].c_str(), whentitle[ix].c_str()), - kTH2F, {pidPAxis, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TPC}^{%s}", allmainsptitles[isp].c_str())}}); + kTH2F, {pidPAxis, {noOfNSigmaBins, minNSigma, maxNSigma, FORMATSTRING("n#sigma_{TPC}^{%s}", allmainsptitles[isp].c_str())}}); fhTOFnSigmasVsP[ix][isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", whenname[ix].c_str()), HNAMESTRING("tofNSigmasVsP%c_%s", whenprefix[ix], allmainspnames[isp].c_str()), HTITLESTRING("TOF n#sigma to the %s line %s", allmainsptitles[isp].c_str(), whentitle[ix].c_str()), - kTH2F, {pidPAxis, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TOF}^{%s}", allmainsptitles[isp].c_str())}}); + kTH2F, {pidPAxis, {noOfNSigmaBins, minNSigma, maxNSigma, FORMATSTRING("n#sigma_{TOF}^{%s}", allmainsptitles[isp].c_str())}}); } } } @@ -625,11 +631,11 @@ struct PidExtraDataCollectingEngine { fhIdTPCnSigmasVsP[isp][imainsp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", "Selected"), HNAMESTRING("tpcNSigmasVsPSelected_%s_to%s", tnames[isp].c_str(), allmainspnames[imainsp].c_str()), HTITLESTRING("TPC n#sigma for selected %s to the %s line", tnames[isp].c_str(), allmainsptitles[imainsp].c_str()), - kTH2F, {pidPAxis, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TPC}^{%s}", mainsptitles[isp].c_str())}}); + kTH2F, {pidPAxis, {noOfNSigmaBins, minNSigma, maxNSigma, FORMATSTRING("n#sigma_{TPC}^{%s}", mainsptitles[isp].c_str())}}); fhIdTOFnSigmasVsP[isp][imainsp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "PID", "Selected"), HNAMESTRING("tofNSigmasVsPSelected_%s_to%s", tnames[isp].c_str(), allmainspnames[imainsp].c_str()), HTITLESTRING("TOF n#sigma for selected %s to the %s line", tnames[isp].c_str(), allmainsptitles[imainsp].c_str()), - kTH2F, {pidPAxis, {120, -6.0, 6.0, FORMATSTRING("n#sigma_{TOF}^{%s}", mainsptitles[isp].c_str())}}); + kTH2F, {pidPAxis, {noOfNSigmaBins, minNSigma, maxNSigma, FORMATSTRING("n#sigma_{TOF}^{%s}", mainsptitles[isp].c_str())}}); } } } @@ -732,6 +738,9 @@ struct DptDptEfficiencyAndQc { Configurable useCentrality{"useCentrality", false, "Perform the task using centrality/multiplicity classes. Default value: false"}; Configurable useTPCInnerWallMomentum{"useTPCInnerWallMomentum", false, "Use the TPC inner wall momentum. Default: false"}; + Configurable cfgMinNSigma{"cfgMinNSigma", -4.05f, "nsigma axes lowest value. Default: -4.05"}; + Configurable cfgMaxNSigma{"cfgMaxNSigma", 4.05f, "nsigma axes highest value. Default: 4.05"}; + Configurable cfgWidthNSigmaBin{"cfgWidthNSigmaBin", 0.1, "nsigma axes bin width. Deafault: 0.1"}; void init(o2::framework::InitContext& initContext) { @@ -822,6 +831,12 @@ struct DptDptEfficiencyAndQc { fCentMultMin[0] = 0.0f; fCentMultMax[0] = 100.0f; } + /* configure nsigma axes */ + minNSigma = cfgMinNSigma.value; + maxNSigma = cfgMaxNSigma.value; + widthNSigmaBin = cfgWidthNSigmaBin.value; + noOfNSigmaBins = static_cast((maxNSigma - minNSigma) / widthNSigmaBin); + bool doBasicAnalysis = doprocessDetectorLevelNotStored || doprocessReconstructedNotStored; bool doPidAnalysis = doprocessDetectorLevelNotStoredPID || doprocessReconstructedNotStoredPID; bool doPidExtraAnalysis = doprocessDetectorLevelNotStoredPIDExtra || doprocessReconstructedNotStoredPIDExtra; From 4c79e5495e40ed4e8cedc010ee810e724db7fa56 Mon Sep 17 00:00:00 2001 From: m-rasa <99010072+m-rasa@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:07:41 +0100 Subject: [PATCH 241/459] [PWGLF] Adding cut for selecting antitriton for tree saving (#8678) --- PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx index 34429b2c053..c0c4de3c8c1 100644 --- a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx @@ -707,8 +707,10 @@ struct nucleiSpectra { collision.multTPC()}); } if (fillTree) { - if (track.pt() < cfgCutPtMinTree || track.pt() > cfgCutPtMaxTree) - continue; + if (flag & BIT(2)) { + if (track.pt() < cfgCutPtMinTree || track.pt() > cfgCutPtMaxTree || track.sign() > 0) + continue; + } } nuclei::candidates.emplace_back(NucleusCandidate{ static_cast(track.globalIndex()), static_cast(track.collisionId()), (1 - 2 * iC) * mTrackParCov.getPt(), mTrackParCov.getEta(), mTrackParCov.getPhi(), From 7a9b58039b495c43ebcf198d0214ace8f84f9ffb Mon Sep 17 00:00:00 2001 From: Sergio Garcia <47090312+singiamtel@users.noreply.github.com> Date: Wed, 4 Dec 2024 10:26:18 +0100 Subject: [PATCH 242/459] [Infrastructure] Don't try to lint when no files are found (#8772) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera --- .github/workflows/o2-linter.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/o2-linter.yml b/.github/workflows/o2-linter.yml index 3f124b56750..8e150e970fd 100644 --- a/.github/workflows/o2-linter.yml +++ b/.github/workflows/o2-linter.yml @@ -24,6 +24,10 @@ jobs: run: | # Diff against the common ancestor of the source branch and the main branch. readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.MAIN_BRANCH }}...) + if [ ${#files[@]} -eq 0 ]; then + echo "::notice::No files to lint." + exit 0 + fi [ ${{ github.event_name }} == 'pull_request' ] && options="-g" # shellcheck disable=SC2086 # Ignore unquoted options. python3 Scripts/o2_linter.py $options "${files[@]}" From 256c724bb068268a0ed6888d5af1d31338b8d3ee Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Wed, 4 Dec 2024 11:28:28 +0100 Subject: [PATCH 243/459] =?UTF-8?q?[PWGDQ]=20Adding=20Tprofiles=20with=20C?= =?UTF-8?q?umulants=20weights=20+=20fixing=20Pi=20constant=20=E2=80=A6=20(?= =?UTF-8?q?#8813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PWGDQ/Core/HistogramsLibrary.cxx | 88 ++++++++++++-------------------- PWGDQ/Core/HistogramsLibrary.h | 1 + 2 files changed, 34 insertions(+), 55 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 5e9180c6a8a..92fbdd9fb3e 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -13,6 +13,7 @@ // #include "PWGDQ/Core/HistogramsLibrary.h" #include "VarManager.h" +#include "CommonConstants/MathConstants.h" void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* histClass, const char* groupName, const char* subGroupName) { @@ -249,6 +250,9 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "Run2_centrFT0C_Corr2REFetagap_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "Run2_centrFT0C_Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2Corr4REF_ev", "Run2_centrFT0C_Corr2Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2CORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); + hm->AddHistogram(histClass, "centrFT0C_M11REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 1000000.0, VarManager::kM11REF); + hm->AddHistogram(histClass, "centrFT0C_M11etagap_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 10000000.0, VarManager::kM11REFetagap); + hm->AddHistogram(histClass, "centrFT0C_M1111REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 100000000000000.0, VarManager::kM1111REF); if (subGroupStr.Contains("cross")) { hm->AddHistogram(histClass, "Q1ZNACXX_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACXX); hm->AddHistogram(histClass, "Q1ZNACYY_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACYY); @@ -354,8 +358,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (!groupStr.CompareTo("track")) { hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); - hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi); hm->AddHistogram(histClass, "IsPVcontrib_pt", "is PV contributor vs pt", false, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); hm->AddHistogram(histClass, "IsPVcontrib_pt_prof", "is PV contributor vs pt", true, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); if (subGroupStr.Contains("ambiguity") && !subGroupStr.Contains("muon")) { @@ -367,10 +371,10 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("cent")) { hm->AddHistogram(histClass, "Pt_CentFT0C", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt, 20, 0.0, 100.0, VarManager::kCentFT0C); hm->AddHistogram(histClass, "Eta_CentFT0C", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta, 20, 0.0, 100.0, VarManager::kCentFT0C); - hm->AddHistogram(histClass, "Phi_CentFT0C", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi, 20, 0.0, 100.0, VarManager::kCentFT0C); + hm->AddHistogram(histClass, "Phi_CentFT0C", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi, 20, 0.0, 100.0, VarManager::kCentFT0C); } if (subGroupStr.Contains("kine")) { - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); hm->AddHistogram(histClass, "Eta_Pt", "", false, 20, -1.0, 1.0, VarManager::kEta, 100, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta_VtxZ", "", false, 100, -1.0, 1.0, VarManager::kEta, 300, -15.0, 15.0, VarManager::kVtxZ); hm->AddHistogram(histClass, "Px", "p_{x} distribution", false, 200, 0.0, 20.0, VarManager::kPx); @@ -429,8 +433,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("tpc")) { hm->AddHistogram(histClass, "TPCncls", "Number of cluster in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCncls_vsTimeFromSOR", "Number of cluster in TPC vs time from SOR", true, 10000, 0.0, 1000., VarManager::kTimeFromSOR, 160, -0.5, 159.5, VarManager::kTPCncls); - hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); - hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCnclsCR", "Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCnclsCR); hm->AddHistogram(histClass, "TPCncls_TPCnclsCR", "Number of TPC cluster vs Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls, 160, -0.5, 159.5, VarManager::kTPCnclsCR); hm->AddHistogram(histClass, "IsTPCrefit", "", false, 2, -0.5, 1.5, VarManager::kIsTPCrefit); @@ -743,14 +747,14 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "MCHBitMap_vs_pt", "MCH vs pt", false, 1025, 0.0, 1025.0, VarManager::kMCHBitMap, 400, 0, 100, VarManager::kPt); hm->AddHistogram(histClass, "MuonTime", "", false, 100, -1.0, 1.0, VarManager::kMuonTime); hm->AddHistogram(histClass, "MuonTimeRes", "", false, 100, -1.0, 1.0, VarManager::kMuonTimeRes); - hm->AddHistogram(histClass, "MuonDcaX_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); - hm->AddHistogram(histClass, "MuonDcaY_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "MuonDcaX_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "MuonDcaY_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); hm->AddHistogram(histClass, "MuonDcaX_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "MuonDcaY_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 500, -5.0, 5.0, VarManager::kEta); } else { hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); hm->AddHistogram(histClass, "AmbiguityInBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsInBunch); hm->AddHistogram(histClass, "AmbiguityOutOfBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsOutOfBunch); hm->AddHistogram(histClass, "AmbiguityInBunch_pt", "in bunch collision ambiguity vs p_{T}", false, 50, 0.0, 10.0, VarManager::kPt, 10, 0., 10., VarManager::kMuonNAssocsInBunch); @@ -773,7 +777,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("mc")) { hm->AddHistogram(histClass, "Pt_vs_PtMC", "pT vs MC pT", false, 200, 0.0, 20.0, VarManager::kPt, 200, 0.0, 20.0, VarManager::kMCPt); hm->AddHistogram(histClass, "Eta_vs_EtaMC", "#eta vs MC #eta", false, 50, -1.0, 1.0, VarManager::kEta, 50, -1.0, 1.0, VarManager::kMCEta); - hm->AddHistogram(histClass, "Phi_vs_PhiMC", "#varphi vs MC #varphi", false, 50, 0.0, 2. * TMath::Pi(), VarManager::kPhi, 50, 0.0, 2. * TMath::Pi(), VarManager::kMCPhi); + hm->AddHistogram(histClass, "Phi_vs_PhiMC", "#varphi vs MC #varphi", false, 50, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 50, 0.0, o2::constants::math::TwoPI, VarManager::kMCPhi); hm->AddHistogram(histClass, "TrackPDGcode", "PDG code of track", false, 10001, -5000, 5000, VarManager::kMCPdgCode); } if (subGroupStr.Contains("mcmother")) { @@ -794,7 +798,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt_lepton1", "", false, 100, -2.0, 2.0, VarManager::kEta1, 200, 0.0, 20.0, VarManager::kPt1); hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2); hm->AddHistogram(histClass, "Eta_Pt_Photon", "", false, 100, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kPairEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPairPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kPairEta, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPairPhi); hm->AddHistogram(histClass, "Mass_Dilepton", "", false, 4500, 0.0, 4.5, VarManager::kPairMassDau); hm->AddHistogram(histClass, "Mass_Photon", "", false, 500, 0.0, 0.1, VarManager::kMassDau); hm->AddHistogram(histClass, "Mass_Dilepton_Mass_Photon", "", false, 500, 0.0, 5.0, VarManager::kPairMassDau, 500, 0.0, 5.0, VarManager::kMassDau); @@ -816,7 +820,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2); hm->AddHistogram(histClass, "Mass", "", false, 500, 0.0, 5.0, VarManager::kMass); hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); } if (!groupStr.CompareTo("mctruth_track")) { hm->AddHistogram(histClass, "PtMC", "MC pT", false, 200, 0.0, 20.0, VarManager::kMCPt); @@ -861,12 +865,12 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("polarization")) { hm->AddHistogram(histClass, "cosThetaHE", "", false, 100, -1., 1., VarManager::kCosThetaHE); hm->AddHistogram(histClass, "cosThetaCS", "", false, 100, -1., 1., VarManager::kCosThetaCS); - hm->AddHistogram(histClass, "PhiHE", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kPhiHE); - hm->AddHistogram(histClass, "PhiCS", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kPhiCS); + hm->AddHistogram(histClass, "PhiHE", "", false, 100, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiHE); + hm->AddHistogram(histClass, "PhiCS", "", false, 100, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiCS); hm->AddHistogram(histClass, "Mass_Pt_cosThetaHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -1., 1., VarManager::kCosThetaHE); hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -1., 1., VarManager::kCosThetaCS); - hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -TMath::Pi(), TMath::Pi(), VarManager::kPhiHE); - hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -TMath::Pi(), TMath::Pi(), VarManager::kPhiCS); + hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiHE); + hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiCS); } if (subGroupStr.Contains("upsilon")) { hm->AddHistogram(histClass, "MassUpsilon_Pt", "", false, 500, 7.0, 12.0, VarManager::kMass, 400, 0.0, 40.0, VarManager::kPt); @@ -1030,18 +1034,6 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS_phiCS", "", 4, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE); hm->AddHistogram(histClass, "Mass_y_cosThetaCS_phiCS", "", 4, varsrapCS, binsy, xminy, xmaxy, 0, -1, kFALSE); } - if (subGroupStr.Contains("dimuon-polarization-vp")) { - int varspTCS[3] = {VarManager::kMass, VarManager::kPt, VarManager::kPhiVP}; - int varsrapCS[3] = {VarManager::kMass, VarManager::kRap, VarManager::kPhiVP}; - int binspT[3] = {100, 20, 24}; - int binsy[3] = {100, 10, 24}; - double xminpT[3] = {1., 0., 0.}; - double xmaxpT[3] = {5., 20., +3.14}; - double xminy[3] = {1., 2.5, 0.}; - double xmaxy[3] = {5., 4.0, +3.14}; - hm->AddHistogram(histClass, "Mass_Pt_phiVP", "", 3, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE); - hm->AddHistogram(histClass, "Mass_y_phiVP", "", 3, varsrapCS, binsy, xminy, xmaxy, 0, -1, kFALSE); - } if (subGroupStr.Contains("dimuon-rap")) { int vars[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kRap}; int binspT[4] = {150, 200, 10, 6}; @@ -1077,20 +1069,6 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h double xmaxpT[5] = {1.2, 3., 100, 1., 3.14}; hm->AddHistogram(histClass, "Mass_Pt_Cent_cosThetaCS_lowmass", "", 5, varsCSpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); } - if (subGroupStr.Contains("dimuon-polarization-vp-pbpb")) { - int varsHEpbpb[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kPhiVP}; - int binspT[4] = {150, 30, 10, 24}; - double xminpT[4] = {2., 0., 0, 0.}; - double xmaxpT[4] = {5., 3., 100, 3.14}; - hm->AddHistogram(histClass, "Mass_Pt_Cent_phiVP", "", 4, varsHEpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); - } - if (subGroupStr.Contains("dimuon-polarization-lowmass-vp-pbpb")) { - int varsHEpbpb[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kPhiVP}; - int binspT[4] = {200, 30, 10, 24}; - double xminpT[4] = {0.2, 0., 0, 0.}; - double xmaxpT[4] = {1.2, 3., 100, 3.14}; - hm->AddHistogram(histClass, "Mass_Pt_Cent_phiVP_lowmass", "", 4, varsHEpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); - } if (subGroupStr.Contains("dimuon-rap-polarization-he-pbpb")) { int varsHEpbpb[5] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kCosThetaHE, VarManager::kRap}; int binspT[5] = {150, 30, 10, 10, 6}; @@ -1222,19 +1200,19 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "DeltaPhiPair", "", false, 130, -6.5, 6.5, VarManager::kDeltaPhiPair); } if (subGroupStr.Contains("correlation-emu")) { - hm->AddHistogram(histClass, "DeltaPhiPair2", "", false, 600, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), VarManager::kDeltaPhiPair2); + hm->AddHistogram(histClass, "DeltaPhiPair2", "", false, 600, -o2::constants::math::PIHalf, 1.5 * o2::constants::math::PI, VarManager::kDeltaPhiPair2); hm->AddHistogram(histClass, "DeltaEtaPair2", "", false, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); - hm->AddHistogram(histClass, "DeltaPhiPair2_DeltaEtaPair2", "", false, 600, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), VarManager::kDeltaPhiPair2, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); + hm->AddHistogram(histClass, "DeltaPhiPair2_DeltaEtaPair2", "", false, 600, -o2::constants::math::PIHalf, 1.5 * o2::constants::math::PI, VarManager::kDeltaPhiPair2, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); } if (subGroupStr.Contains("dielectrons")) { if (subGroupStr.Contains("prefilter")) { hm->AddHistogram(histClass, "MassLow_OpeningAngle", "", false, 150, 0., 0.15, VarManager::kMass, 80, 0., 0.8, VarManager::kOpeningAngle); } if (subGroupStr.Contains("phiv")) { - hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, TMath::Pi(), VarManager::kPairPhiv); + hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, o2::constants::math::PI, VarManager::kPairPhiv); } if (subGroupStr.Contains("double-phi-v")) { - hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, TMath::Pi(), VarManager::kPairPhiv, "", "", "", -1, -1, true); + hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, o2::constants::math::PI, VarManager::kPairPhiv, "", "", "", -1, -1, true); } if (subGroupStr.Contains("largemass-phi-v")) { // binning for mee at large scales: @@ -1261,7 +1239,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h // steps of size pi/100 double phiv_bins[101]; for (int i = 0; i <= 100; i++) - phiv_bins[i] = TMath::Pi() / 100. * i; + phiv_bins[i] = o2::constants::math::PI / 100. * i; int nbins_phiv = sizeof(phiv_bins) / sizeof(*phiv_bins) - 1; // 3D histo @@ -1450,29 +1428,29 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.EqualTo("jpsitomumu")) { hm->AddHistogram(histClass, "hMassVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 50, -4.5f, -2.0f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); } else if (subGroupStr.EqualTo("jpsitoee")) { hm->AddHistogram(histClass, "hMassVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 60, -1.5f, 1.5f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); } else if (subGroupStr.EqualTo("dmeson")) { hm->AddHistogram(histClass, "hMassVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 200, 1.7f, 2.1f, VarManager::kMassCharmHadron); hm->AddHistogram(histClass, "hRapVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 60, -1.5f, 1.5f, VarManager::kRapCharmHadron); - hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., 2 * constants::math::PI, VarManager::kPhiCharmHadron); + hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., o2::constants::math::TwoPI, VarManager::kPhiCharmHadron); } else if (subGroupStr.EqualTo("jpsitomumudmeson")) { hm->AddHistogram(histClass, "hMassVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 50, -4.5f, -2.0f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "hMassVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 200, 1.7f, 2.1f, VarManager::kMassCharmHadron); hm->AddHistogram(histClass, "hRapVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 60, -1.5f, 1.5f, VarManager::kRapCharmHadron); - hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., 2 * constants::math::PI, VarManager::kPhiCharmHadron); + hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., o2::constants::math::TwoPI, VarManager::kPhiCharmHadron); } else if (subGroupStr.EqualTo("jpsitoeedmeson")) { hm->AddHistogram(histClass, "hMassVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 60, -1.5f, 1.5f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "hMassVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 200, 1.7f, 2.1f, VarManager::kMassCharmHadron); hm->AddHistogram(histClass, "hRapVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 60, -1.5f, 1.5f, VarManager::kRapCharmHadron); - hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., 2 * constants::math::PI, VarManager::kPhiCharmHadron); + hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., o2::constants::math::TwoPI, VarManager::kPhiCharmHadron); } } if (!groupStr.CompareTo("dilepton-dihadron")) { @@ -1534,7 +1512,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Pt_Photon", "p_{T} distribution", false, 4500, 0.0, 4.5, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "Eta_Pt", "", false, 100, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); hm->AddHistogram(histClass, "Mass_Photon", "", false, 500, 0.0, 0.1, VarManager::kMassDau); hm->AddHistogram(histClass, "Mass_Pt", "", false, 500, 0.0, 5.0, VarManager::kMassDau, 200, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Rapidity", "", false, 400, -4.0, 4.0, VarManager::kRap); diff --git a/PWGDQ/Core/HistogramsLibrary.h b/PWGDQ/Core/HistogramsLibrary.h index 60fe4cc8714..aa53a2674cc 100644 --- a/PWGDQ/Core/HistogramsLibrary.h +++ b/PWGDQ/Core/HistogramsLibrary.h @@ -18,6 +18,7 @@ #include #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/VarManager.h" +#include "CommonConstants/MathConstants.h" namespace o2::aod { From e252567ddfca3e5ec2e65a7b2ac072d0864687d2 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 4 Dec 2024 11:38:14 +0100 Subject: [PATCH 244/459] [PWGLF] ebyeMaker: CL0 correlation checks only for Run 2 (#8814) --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index f6efa86fc3a..98580beb99b 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -418,12 +418,14 @@ struct ebyeMaker { } else { LOGF(fatal, "Calibration information from V0M for run %d corrupted", bc.runNumber()); } - Run2CL0Info.mhVtxAmpCorr = getccdb("hVtx_fnSPDClusters0_Normalized"); - Run2CL0Info.mhMultSelCalib = getccdb("hMultSelCalib_CL0"); - if ((Run2CL0Info.mhVtxAmpCorr != nullptr) && (Run2CL0Info.mhMultSelCalib != nullptr)) { - Run2CL0Info.mCalibrationStored = true; - } else { - LOGF(fatal, "Calibration information from CL0 multiplicity for run %d corrupted", bc.runNumber()); + if (doprocessRun2) { + Run2CL0Info.mhVtxAmpCorr = getccdb("hVtx_fnSPDClusters0_Normalized"); + Run2CL0Info.mhMultSelCalib = getccdb("hMultSelCalib_CL0"); + if ((Run2CL0Info.mhVtxAmpCorr != nullptr) && (Run2CL0Info.mhMultSelCalib != nullptr)) { + Run2CL0Info.mCalibrationStored = true; + } else { + LOGF(fatal, "Calibration information from CL0 multiplicity for run %d corrupted", bc.runNumber()); + } } } else { auto grpmagPath{"GLO/Config/GRPMagField"}; From 1abb1f88d0d3016d8a13aa2d07423c78aac8558f Mon Sep 17 00:00:00 2001 From: Ionut Cristian Arsene Date: Wed, 4 Dec 2024 12:17:13 +0100 Subject: [PATCH 245/459] [PWGDQ] Adding TPC occupancy variables for PbPb (for now just testing) (#8809) Co-authored-by: Ionut Cristian Arsene --- PWGDQ/Core/HistogramsLibrary.cxx | 26 ++ PWGDQ/Core/VarManager.cxx | 27 +++ PWGDQ/Core/VarManager.h | 38 ++- PWGDQ/DataModel/ReducedInfoTables.h | 27 ++- PWGDQ/TableProducer/tableMaker.cxx | 2 +- PWGDQ/TableProducer/tableMakerMC.cxx | 92 +++---- .../TableProducer/tableMakerMC_withAssoc.cxx | 2 +- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 227 +++++++++++++++++- 8 files changed, 374 insertions(+), 67 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 92fbdd9fb3e..13ba242d8e8 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -132,6 +132,32 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "TPCpileupZC", "TPC pileup Z, C-side", false, 200, -50.0, 50.0, VarManager::kNTPCpileupZC); hm->AddHistogram(histClass, "TPCpileupNcontribA", "TPC pileup n-contributors, A-side", false, 300, 0.0, 3000.0, VarManager::kNTPCpileupContribA); hm->AddHistogram(histClass, "TPCpileupNcontribC", "TPC pileup n-contributors, C-side", false, 300, 0.0, 3000.0, VarManager::kNTPCpileupContribC); + hm->AddHistogram(histClass, "TPCoccupContribLongA", "TPC occupancy from pileup, n-contrib, A-side, long time range", false, 100, 0.0, 10000.0, VarManager::kNTPCcontribLongA); + hm->AddHistogram(histClass, "TPCoccupContribLongAvsTime", "TPC occupancy from pileup, n-contrib, A-side, long time range", true, 1000, 0.0, 1000.0, VarManager::kTimeFromSOR, 10, 0.0, 10000.0, VarManager::kNTPCcontribLongA); + hm->AddHistogram(histClass, "TPCoccupContribLongAvsContribPV", "TPC occupancy from pileup, n-contrib, A-side, long time range, vs n.contrib", false, 100, 0.0, 5000.0, VarManager::kVtxNcontribReal, 100, 0.0, 10000.0, VarManager::kNTPCcontribLongA); + hm->AddHistogram(histClass, "TPCoccupContribLongC", "TPC occupancy from pileup, n-contrib, C-side, long time range", false, 100, 0.0, 10000.0, VarManager::kNTPCcontribLongC); + hm->AddHistogram(histClass, "TPCoccupContribLongCvsTime", "TPC occupancy from pileup, n-contrib, C-side, long time range", true, 1000, 0.0, 1000.0, VarManager::kTimeFromSOR, 10, 0.0, 10000.0, VarManager::kNTPCcontribLongC); + hm->AddHistogram(histClass, "TPCoccupContribLongCvsContribPV", "TPC occupancy from pileup, n-contrib, C-side, long time range, vs n.contrib", false, 100, 0.0, 5000.0, VarManager::kVtxNcontribReal, 100, 0.0, 10000.0, VarManager::kNTPCcontribLongC); + hm->AddHistogram(histClass, "TPCoccupContribLongAvsC", "TPC occupancy from pileup, n-contrib, A-side vs C-side, long time range", false, 100, 0.0, 10000.0, VarManager::kNTPCcontribLongA, 100, 0.0, 10000.0, VarManager::kNTPCcontribLongC); + hm->AddHistogram(histClass, "TPCoccupMeanTimeLongA", "TPC occupancy from pileup, mean time, A-side, long time range", false, 100, -100.0, 100.0, VarManager::kNTPCmeanTimeLongA); + hm->AddHistogram(histClass, "TPCoccupMeanTimeLongC", "TPC occupancy from pileup, mean time, C-side, long time range", false, 100, -100.0, 100.0, VarManager::kNTPCmeanTimeLongC); + hm->AddHistogram(histClass, "TPCoccupMeanTimeLongAvsC", "TPC occupancy from pileup, mean time, A-side vs C-side, long time range", false, 100, -100.0, 100.0, VarManager::kNTPCmeanTimeLongA, 100, -100.0, 100.0, VarManager::kNTPCmeanTimeLongC); + hm->AddHistogram(histClass, "TPCoccupMedianTimeLongA", "TPC occupancy from pileup, median time, A-side, long time range", false, 100, -100.0, 100.0, VarManager::kNTPCmedianTimeLongA); + hm->AddHistogram(histClass, "TPCoccupMedianTimeLongC", "TPC occupancy from pileup, median time, C-side, long time range", false, 100, -100.0, 100.0, VarManager::kNTPCmedianTimeLongC); + hm->AddHistogram(histClass, "TPCoccupMedianTimeLongAvsC", "TPC occupancy from pileup, median time, A-side vs C-side, long time range", false, 100, -100.0, 100.0, VarManager::kNTPCmedianTimeLongA, 100, -100.0, 100.0, VarManager::kNTPCmedianTimeLongC); + hm->AddHistogram(histClass, "TPCoccupContribShortA", "TPC occupancy from pileup, n-contrib, A-side, short time range", false, 100, 0.0, 7000.0, VarManager::kNTPCcontribShortA); + hm->AddHistogram(histClass, "TPCoccupContribShortAvsTime", "TPC occupancy from pileup, n-contrib, A-side, short time range", true, 1000, 0.0, 1000.0, VarManager::kTimeFromSOR, 10, 0.0, 10000.0, VarManager::kNTPCcontribShortA); + hm->AddHistogram(histClass, "TPCoccupContribShortAvsContribPV", "TPC occupancy from pileup, n-contrib, A-side, short time range, vs n.contrib", false, 100, 0.0, 5000.0, VarManager::kVtxNcontribReal, 100, 0.0, 7000.0, VarManager::kNTPCcontribShortA); + hm->AddHistogram(histClass, "TPCoccupContribShortC", "TPC occupancy from pileup, n-contrib, C-side, short time range", false, 100, 0.0, 7000.0, VarManager::kNTPCcontribShortC); + hm->AddHistogram(histClass, "TPCoccupContribShortCvsTime", "TPC occupancy from pileup, n-contrib, C-side, short time range", true, 1000, 0.0, 1000.0, VarManager::kTimeFromSOR, 10, 0.0, 10000.0, VarManager::kNTPCcontribShortC); + hm->AddHistogram(histClass, "TPCoccupContribShortAvsC", "TPC occupancy from pileup, n-contrib, A-side vs C-side, short time range", false, 100, 0.0, 7000.0, VarManager::kNTPCcontribShortA, 100, 0.0, 7000.0, VarManager::kNTPCcontribShortC); + hm->AddHistogram(histClass, "TPCoccupContribShortCvsContribPV", "TPC occupancy from pileup, n-contrib, C-side, short time range, vs n.contrib", false, 100, 0.0, 5000.0, VarManager::kVtxNcontribReal, 100, 0.0, 7000.0, VarManager::kNTPCcontribShortC); + hm->AddHistogram(histClass, "TPCoccupMeanTimeShortA", "TPC occupancy from pileup, mean time, A-side, short time range", false, 100, -20.0, 20.0, VarManager::kNTPCmeanTimeShortA); + hm->AddHistogram(histClass, "TPCoccupMeanTimeShortC", "TPC occupancy from pileup, mean time, C-side, short time range", false, 100, -20.0, 20.0, VarManager::kNTPCmeanTimeShortC); + hm->AddHistogram(histClass, "TPCoccupMeanTimeShortAvsC", "TPC occupancy from pileup, mean time, A-side vs C-side, short time range", false, 100, -20.0, 20.0, VarManager::kNTPCmeanTimeShortA, 100, -20.0, 20.0, VarManager::kNTPCmeanTimeShortC); + hm->AddHistogram(histClass, "TPCoccupMedianTimeShortA", "TPC occupancy from pileup, median time, A-side, short time range", false, 100, -20.0, 20.0, VarManager::kNTPCmedianTimeShortA); + hm->AddHistogram(histClass, "TPCoccupMedianTimeShortC", "TPC occupancy from pileup, median time, C-side, short time range", false, 100, -20.0, 20.0, VarManager::kNTPCmedianTimeShortC); + hm->AddHistogram(histClass, "TPCoccupMedianTimeShortAvsC", "TPC occupancy from pileup, median time, A-side vs C-side, short time range", false, 100, -20.0, 20.0, VarManager::kNTPCmedianTimeShortA, 100, -20.0, 20.0, VarManager::kNTPCmedianTimeShortC); } } if (subGroupStr.Contains("ftmulpbpb")) { diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index 537afde077b..77de7838f8e 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -9,6 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. #include +#include +#include +#include #include "PWGDQ/Core/VarManager.h" #include "Tools/KFparticle/KFUtilities.h" @@ -378,6 +381,30 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kNTPCtracksInPast] = ""; fgVariableNames[kNTPCtracksInFuture] = "# TPC tracks in future"; fgVariableUnits[kNTPCtracksInFuture] = ""; + fgVariableNames[kNTPCcontribLongA] = "# TPC-A pileup, long time range"; + fgVariableUnits[kNTPCcontribLongA] = ""; + fgVariableNames[kNTPCcontribLongC] = "# TPC-C pileup, long time range"; + fgVariableUnits[kNTPCcontribLongC] = ""; + fgVariableNames[kNTPCmeanTimeLongA] = "# TPC-A pileup mean time, long time range"; + fgVariableUnits[kNTPCmeanTimeLongA] = "#mu s"; + fgVariableNames[kNTPCmeanTimeLongC] = "# TPC-C pileup mean time, long time range"; + fgVariableUnits[kNTPCmeanTimeLongC] = "#mu s"; + fgVariableNames[kNTPCmedianTimeLongA] = "# TPC-A pileup median time, long time range"; + fgVariableUnits[kNTPCmedianTimeLongA] = "#mu s"; + fgVariableNames[kNTPCmedianTimeLongC] = "# TPC-C pileup median time, long time range"; + fgVariableUnits[kNTPCmedianTimeLongC] = "#mu s"; + fgVariableNames[kNTPCcontribShortA] = "# TPC-A pileup, short time range"; + fgVariableUnits[kNTPCcontribShortA] = ""; + fgVariableNames[kNTPCcontribShortC] = "# TPC-C pileup, short time range"; + fgVariableUnits[kNTPCcontribShortC] = ""; + fgVariableNames[kNTPCmeanTimeShortA] = "# TPC-A pileup mean time, short time range"; + fgVariableUnits[kNTPCmeanTimeShortA] = "#mu s"; + fgVariableNames[kNTPCmeanTimeShortC] = "# TPC-C pileup mean time, short time range"; + fgVariableUnits[kNTPCmeanTimeShortC] = "#mu s"; + fgVariableNames[kNTPCmedianTimeShortA] = "# TPC-A pileup median time, short time range"; + fgVariableUnits[kNTPCmedianTimeShortA] = "#mu s"; + fgVariableNames[kNTPCmedianTimeShortC] = "# TPC-C pileup median time, short time range"; + fgVariableUnits[kNTPCmedianTimeShortC] = "#mu s"; fgVariableNames[kPt] = "p_{T}"; fgVariableUnits[kPt] = "GeV/c"; fgVariableNames[kInvPt] = "1/p_{T}"; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 9e10ea58049..8a24d5aec51 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -244,6 +244,18 @@ class VarManager : public TObject kNTPCpileupZC, kNTPCtracksInPast, kNTPCtracksInFuture, + kNTPCcontribLongA, + kNTPCcontribLongC, + kNTPCmeanTimeLongA, + kNTPCmeanTimeLongC, + kNTPCmedianTimeLongA, + kNTPCmedianTimeLongC, + kNTPCcontribShortA, + kNTPCcontribShortC, + kNTPCmeanTimeShortA, + kNTPCmeanTimeShortC, + kNTPCmedianTimeShortA, + kNTPCmedianTimeShortC, kMCEventGeneratorId, kMCEventSubGeneratorId, kMCVtxX, @@ -1474,12 +1486,18 @@ void VarManager::FillEvent(T const& event, float* values) values[kMultAllTracksTPCOnly] = event.multAllTracksTPCOnly(); values[kMultAllTracksITSTPC] = event.multAllTracksITSTPC(); if constexpr ((fillMap & ReducedEventMultExtra) > 0) { - values[kNTPCpileupContribA] = event.nTPCpileupContribA(); - values[kNTPCpileupContribC] = event.nTPCpileupContribC(); - values[kNTPCpileupZA] = event.nTPCpileupZA(); - values[kNTPCpileupZC] = event.nTPCpileupZC(); - values[kNTPCtracksInPast] = event.nTPCtracksInPast(); - values[kNTPCtracksInFuture] = event.nTPCtracksInFuture(); + values[kNTPCcontribLongA] = event.nTPCoccupContribLongA(); + values[kNTPCcontribLongC] = event.nTPCoccupContribLongC(); + values[kNTPCcontribShortA] = event.nTPCoccupContribShortA(); + values[kNTPCcontribShortC] = event.nTPCoccupContribShortC(); + values[kNTPCmeanTimeLongA] = event.nTPCoccupMeanTimeLongA(); + values[kNTPCmeanTimeLongC] = event.nTPCoccupMeanTimeLongC(); + values[kNTPCmeanTimeShortA] = event.nTPCoccupMeanTimeShortA(); + values[kNTPCmeanTimeShortC] = event.nTPCoccupMedianTimeShortC(); + values[kNTPCmedianTimeLongA] = event.nTPCoccupMedianTimeLongA(); + values[kNTPCmedianTimeLongC] = event.nTPCoccupMedianTimeLongC(); + values[kNTPCmedianTimeShortA] = event.nTPCoccupMedianTimeShortA(); + values[kNTPCmedianTimeShortC] = event.nTPCoccupMedianTimeShortC(); } } // TODO: need to add EvSels and Cents tables, etc. in case of the central data model @@ -1756,11 +1774,11 @@ void VarManager::FillEvent(T const& event, float* values) } if constexpr ((fillMap & EventFilter) > 0) { - values[kIsDoubleGap] = (event.eventFilter() & (uint64_t(1) << kDoubleGap)) > 0; - values[kIsSingleGapA] = (event.eventFilter() & (uint64_t(1) << kSingleGapA)) > 0; - values[kIsSingleGapC] = (event.eventFilter() & (uint64_t(1) << kSingleGapC)) > 0; + values[kIsDoubleGap] = (event.eventFilter() & (static_cast(1) << kDoubleGap)) > 0; + values[kIsSingleGapA] = (event.eventFilter() & (static_cast(1) << kSingleGapA)) > 0; + values[kIsSingleGapC] = (event.eventFilter() & (static_cast(1) << kSingleGapC)) > 0; values[kIsSingleGap] = values[kIsSingleGapA] || values[kIsSingleGapC]; - values[kIsITSUPCMode] = (event.eventFilter() & (uint64_t(1) << kITSUPCMode)) > 0; + values[kIsITSUPCMode] = (event.eventFilter() & (static_cast(1) << kITSUPCMode)) > 0; } if constexpr ((fillMap & ReducedZdc) > 0) { diff --git a/PWGDQ/DataModel/ReducedInfoTables.h b/PWGDQ/DataModel/ReducedInfoTables.h index f50c92dc5ec..587c70349e2 100644 --- a/PWGDQ/DataModel/ReducedInfoTables.h +++ b/PWGDQ/DataModel/ReducedInfoTables.h @@ -16,6 +16,7 @@ #define PWGDQ_DATAMODEL_REDUCEDINFOTABLES_H_ #include +#include #include "Framework/ASoA.h" #include "Framework/AnalysisDataModel.h" #include "Common/DataModel/Centrality.h" @@ -47,12 +48,18 @@ DECLARE_SOA_BITMAP_COLUMN(Tag, tag, 64); //! Bit-field for storing event DECLARE_SOA_COLUMN(MCPosX, mcPosX, float); //! MC event position X DECLARE_SOA_COLUMN(MCPosY, mcPosY, float); //! MC event position Y DECLARE_SOA_COLUMN(MCPosZ, mcPosZ, float); //! MC event position Z -DECLARE_SOA_COLUMN(NTPCpileupContribA, nTPCpileupContribA, int); //! Number of TPC pileup tracks on A side -DECLARE_SOA_COLUMN(NTPCpileupContribC, nTPCpileupContribC, int); //! Number of TPC pileup tracks on C side -DECLARE_SOA_COLUMN(NTPCpileupZA, nTPCpileupZA, float); //! Median Z position of pileup tracks on A side -DECLARE_SOA_COLUMN(NTPCpileupZC, nTPCpileupZC, float); //! Median Z position of pileup tracks on C side -DECLARE_SOA_COLUMN(NTPCtracksInPast, nTPCtracksInPast, int); //! Number of TPC tracks in the past events (configurable, but e.g. one drift time) -DECLARE_SOA_COLUMN(NTPCtracksInFuture, nTPCtracksInFuture, int); //! Number of TPC tracks in the future events (configurable, but e.g. one drift time) +DECLARE_SOA_COLUMN(NTPCoccupContribLongA, nTPCoccupContribLongA, int); //! TPC pileup occupancy on A side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupContribLongC, nTPCoccupContribLongC, int); //! TPC pileup occupancy on C side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupMeanTimeLongA, nTPCoccupMeanTimeLongA, float); //! TPC pileup mean time on A side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupMeanTimeLongC, nTPCoccupMeanTimeLongC, float); //! TPC pileup mean time on C side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupMedianTimeLongA, nTPCoccupMedianTimeLongA, float); //! TPC pileup median time on A side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupMedianTimeLongC, nTPCoccupMedianTimeLongC, float); //! TPC pileup median time on C side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupContribShortA, nTPCoccupContribShortA, int); //! TPC pileup occupancy on A side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupContribShortC, nTPCoccupContribShortC, int); //! TPC pileup occupancy on C side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupMeanTimeShortA, nTPCoccupMeanTimeShortA, float); //! TPC pileup mean time on A side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupMeanTimeShortC, nTPCoccupMeanTimeShortC, float); //! TPC pileup mean time on C side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupMedianTimeShortA, nTPCoccupMedianTimeShortA, float); //! TPC pileup median time on A side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupMedianTimeShortC, nTPCoccupMedianTimeShortC, float); //! TPC pileup median time on C side (short time range) // Columns declared to guarantee the backward compatibility of the tables DECLARE_SOA_COLUMN(QvecBPosRe, qvecBPosRe, float); @@ -129,8 +136,12 @@ DECLARE_SOA_TABLE(ReducedEventsMultPV, "AOD", "REMULTPV", //! Multiplicity info DECLARE_SOA_TABLE(ReducedEventsMultAll, "AOD", "REMULTALL", //! Multiplicity information for all tracks in the event mult::MultAllTracksTPCOnly, mult::MultAllTracksITSTPC, - reducedevent::NTPCpileupContribA, reducedevent::NTPCpileupContribC, reducedevent::NTPCpileupZA, reducedevent::NTPCpileupZC, - reducedevent::NTPCtracksInPast, reducedevent::NTPCtracksInFuture); + reducedevent::NTPCoccupContribLongA, reducedevent::NTPCoccupContribLongC, + reducedevent::NTPCoccupMeanTimeLongA, reducedevent::NTPCoccupMeanTimeLongC, + reducedevent::NTPCoccupMedianTimeLongA, reducedevent::NTPCoccupMedianTimeLongC, + reducedevent::NTPCoccupContribShortA, reducedevent::NTPCoccupContribShortC, + reducedevent::NTPCoccupMeanTimeShortA, reducedevent::NTPCoccupMeanTimeShortC, + reducedevent::NTPCoccupMedianTimeShortA, reducedevent::NTPCoccupMedianTimeShortC); DECLARE_SOA_TABLE(ReducedEventsVtxCov, "AOD", "REVTXCOV", //! Event vertex covariance matrix collision::CovXX, collision::CovXY, collision::CovXZ, diff --git a/PWGDQ/TableProducer/tableMaker.cxx b/PWGDQ/TableProducer/tableMaker.cxx index 5a6fc2f09a7..0e54baa926f 100644 --- a/PWGDQ/TableProducer/tableMaker.cxx +++ b/PWGDQ/TableProducer/tableMaker.cxx @@ -492,7 +492,7 @@ struct TableMaker { multPV(collision.multNTracksHasITS(), collision.multNTracksHasTPC(), collision.multNTracksHasTOF(), collision.multNTracksHasTRD(), collision.multNTracksITSOnly(), collision.multNTracksTPCOnly(), collision.multNTracksITSTPC(), collision.trackOccupancyInTimeRange()); multAll(collision.multAllTracksTPCOnly(), collision.multAllTracksITSTPC(), - 0, 0, 0.0, 0.0, 0, 0); + 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0.0, 0.0, 0.0, 0.0); } uint64_t trackFilteringTag = 0; diff --git a/PWGDQ/TableProducer/tableMakerMC.cxx b/PWGDQ/TableProducer/tableMakerMC.cxx index fde24653c03..cd25c5c1a9d 100644 --- a/PWGDQ/TableProducer/tableMakerMC.cxx +++ b/PWGDQ/TableProducer/tableMakerMC.cxx @@ -17,6 +17,10 @@ // and the MC truth particles corresponding to the reconstructed tracks selected by the specified track cuts on reconstructed data. #include +#include +#include +#include +#include #include "TList.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -397,7 +401,7 @@ struct TableMakerMC { // store the selection decisions uint64_t tag = collision.selection_raw(); if (collision.sel7()) { - tag |= (uint64_t(1) << evsel::kNsel); //! SEL7 stored at position kNsel in the tag bit map + tag |= (static_cast(1) << evsel::kNsel); //! SEL7 stored at position kNsel in the tag bit map } auto mcCollision = collision.mcCollision(); @@ -413,7 +417,7 @@ struct TableMakerMC { } // fill stats information, before selections for (int i = 0; i < kNaliases; i++) { - if (triggerAliases & (uint32_t(1) << i)) { + if (triggerAliases & (static_cast(1) << i)) { (reinterpret_cast(fStatsList->At(0)))->Fill(2.0, static_cast(i)); } } @@ -429,7 +433,7 @@ struct TableMakerMC { // fill stats information, after selections for (int i = 0; i < kNaliases; i++) { - if (triggerAliases & (uint32_t(1) << i)) { + if (triggerAliases & (static_cast(1) << i)) { (reinterpret_cast(fStatsList->At(0)))->Fill(3.0, static_cast(i)); } } @@ -466,7 +470,7 @@ struct TableMakerMC { multPV(collision.multNTracksHasITS(), collision.multNTracksHasTPC(), collision.multNTracksHasTOF(), collision.multNTracksHasTRD(), collision.multNTracksITSOnly(), collision.multNTracksTPCOnly(), collision.multNTracksITSTPC(), collision.trackOccupancyInTimeRange()); multAll(collision.multAllTracksTPCOnly(), collision.multAllTracksITSTPC(), - 0, 0, 0.0, 0.0, 0, 0); + 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0.0, 0.0, 0.0, 0.0); } // loop over the MC truth tracks and find those that need to be written @@ -484,7 +488,7 @@ struct TableMakerMC { checked = sig.CheckSignal(true, mctrack); } if (checked) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); } i++; } @@ -505,7 +509,7 @@ struct TableMakerMC { VarManager::FillTrackMC(mcTracks, mctrack); int j = 0; for (auto signal = fMCSignals.begin(); signal != fMCSignals.end(); signal++, j++) { - if (mcflags & (uint16_t(1) << j)) { + if (mcflags & (static_cast(1) << j)) { fHistMan->FillHistClass(Form("MCTruth_%s", (*signal).GetName()), VarManager::fgValues); } } @@ -539,8 +543,8 @@ struct TableMakerMC { } } } - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); VarManager::FillTrack(track); // If no MC particle is found, skip the track if (!track.has_mcParticle()) { @@ -576,23 +580,23 @@ struct TableMakerMC { // store filtering information if (track.isGlobalTrack()) { - trackFilteringTag |= (uint64_t(1) << 0); // BIT0: global track + trackFilteringTag |= (static_cast(1) << 0); // BIT0: global track } if (track.isGlobalTrackSDD()) { - trackFilteringTag |= (uint64_t(1) << 1); // BIT1: global track SSD + trackFilteringTag |= (static_cast(1) << 1); // BIT1: global track SSD } if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackV0Bits)) { // BIT2-6: V0Bits - trackFilteringTag |= (uint64_t(track.pidbit()) << 2); + trackFilteringTag |= (static_cast(track.pidbit()) << 2); for (int iv0 = 0; iv0 < 5; iv0++) { - if (track.pidbit() & (uint8_t(1) << iv0)) { + if (track.pidbit() & (static_cast(1) << iv0)) { (reinterpret_cast(fStatsList->At(1)))->Fill(fTrackCuts.size() + static_cast(iv0)); } } } if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::DalitzBits)) { - trackFilteringTag |= (uint64_t(track.dalitzBits()) << 7); // BIT7-14: Dalitz + trackFilteringTag |= (static_cast(track.dalitzBits()) << 7); // BIT7-14: Dalitz } - trackFilteringTag |= (uint64_t(trackTempFilterMap) << 15); // BIT15-...: user track filters + trackFilteringTag |= (static_cast(trackTempFilterMap) << 15); // BIT15-...: user track filters mcflags = 0; i = 0; // runs over the MC signals @@ -600,7 +604,7 @@ struct TableMakerMC { // check all the specified signals and fill histograms for MC truth matched tracks for (auto& sig : fMCSignals) { if (sig.CheckSignal(true, mctrack)) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); if (fDoDetailedQA) { j = 0; for (auto& cut : fTrackCuts) { @@ -678,7 +682,7 @@ struct TableMakerMC { // check all the specified signals and fill histograms for MC truth matched tracks for (auto& sig : fMCSignals) { if (sig.CheckSignal(true, mctrack)) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); } i++; } @@ -735,8 +739,8 @@ struct TableMakerMC { std::map newMFTMatchIndex; for (auto& muon : groupedMuons) { - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); if (!muon.has_mcParticle()) { continue; @@ -785,8 +789,8 @@ struct TableMakerMC { } } - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); if (!muon.has_mcParticle()) { continue; @@ -821,7 +825,7 @@ struct TableMakerMC { continue; } // store the cut decisions - trackFilteringTag |= uint64_t(trackTempFilterMap); // BIT0-7: user selection cuts + trackFilteringTag |= static_cast(trackTempFilterMap); // BIT0-7: user selection cuts mcflags = 0; i = 0; // runs over the MC signals @@ -829,7 +833,7 @@ struct TableMakerMC { // check all the specified signals and fill histograms for MC truth matched tracks for (auto& sig : fMCSignals) { if (sig.CheckSignal(true, mctrack)) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); if (fDoDetailedQA) { for (auto& cut : fMuonCuts) { if (trackTempFilterMap & (uint8_t(1) << j)) { @@ -962,7 +966,7 @@ struct TableMakerMC { mctrack.weight(), mctrack.pt(), mctrack.eta(), mctrack.phi(), mctrack.e(), mctrack.vx(), mctrack.vy(), mctrack.vz(), mctrack.vt(), mcflags); for (unsigned int isig = 0; isig < fMCSignals.size(); isig++) { - if (mcflags & (uint16_t(1) << isig)) { + if (mcflags & (static_cast(1) << isig)) { (reinterpret_cast(fStatsList->At(3)))->Fill(static_cast(isig)); } } @@ -1035,7 +1039,7 @@ struct TableMakerMC { // store the selection decisions uint64_t tag = collision.selection_raw(); if (collision.sel7()) { - tag |= (uint64_t(1) << evsel::kNsel); //! SEL7 stored at position kNsel in the tag bit map + tag |= (static_cast(1) << evsel::kNsel); //! SEL7 stored at position kNsel in the tag bit map } auto mcCollision = collision.mcCollision(); @@ -1051,7 +1055,7 @@ struct TableMakerMC { } // fill stats information, before selections for (int i = 0; i < kNaliases; i++) { - if (triggerAliases & (uint32_t(1) << i)) { + if (triggerAliases & (static_cast(1) << i)) { (reinterpret_cast(fStatsList->At(0)))->Fill(2.0, static_cast(i)); } } @@ -1067,7 +1071,7 @@ struct TableMakerMC { // fill stats information, after selections for (int i = 0; i < kNaliases; i++) { - if (triggerAliases & (uint32_t(1) << i)) { + if (triggerAliases & (static_cast(1) << i)) { (reinterpret_cast(fStatsList->At(0)))->Fill(3.0, static_cast(i)); } } @@ -1116,7 +1120,7 @@ struct TableMakerMC { checked = sig.CheckSignal(true, mctrack); } if (checked) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); } i++; } @@ -1137,7 +1141,7 @@ struct TableMakerMC { VarManager::FillTrackMC(mcTracks, mctrack); int j = 0; for (auto signal = fMCSignals.begin(); signal != fMCSignals.end(); signal++, j++) { - if (mcflags & (uint16_t(1) << j)) { + if (mcflags & (static_cast(1) << j)) { fHistMan->FillHistClass(Form("MCTruth_%s", (*signal).GetName()), VarManager::fgValues); } } @@ -1166,8 +1170,8 @@ struct TableMakerMC { isAmbiguous = (track.compatibleCollIds().size() != 1); } } - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); VarManager::FillTrack(track); // If no MC particle is found, skip the track if (!track.has_mcParticle()) { @@ -1203,23 +1207,23 @@ struct TableMakerMC { // store filtering information if (track.isGlobalTrack()) { - trackFilteringTag |= (uint64_t(1) << 0); // BIT0: global track + trackFilteringTag |= (static_cast(1) << 0); // BIT0: global track } if (track.isGlobalTrackSDD()) { - trackFilteringTag |= (uint64_t(1) << 1); // BIT1: global track SSD + trackFilteringTag |= (static_cast(1) << 1); // BIT1: global track SSD } if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackV0Bits)) { // BIT2-6: V0Bits - trackFilteringTag |= (uint64_t(track.pidbit()) << 2); + trackFilteringTag |= (static_cast(track.pidbit()) << 2); for (int iv0 = 0; iv0 < 5; iv0++) { - if (track.pidbit() & (uint8_t(1) << iv0)) { + if (track.pidbit() & (static_cast(1) << iv0)) { (reinterpret_cast(fStatsList->At(1)))->Fill(fTrackCuts.size() + static_cast(iv0)); } } } if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::DalitzBits)) { - trackFilteringTag |= (uint64_t(track.dalitzBits()) << 7); // BIT7-14: Dalitz + trackFilteringTag |= (static_cast(track.dalitzBits()) << 7); // BIT7-14: Dalitz } - trackFilteringTag |= (uint64_t(trackTempFilterMap) << 15); // BIT15-...: user track filters + trackFilteringTag |= (static_cast(trackTempFilterMap) << 15); // BIT15-...: user track filters mcflags = 0; i = 0; // runs over the MC signals @@ -1227,7 +1231,7 @@ struct TableMakerMC { // check all the specified signals and fill histograms for MC truth matched tracks for (auto& sig : fMCSignals) { if (sig.CheckSignal(true, mctrack)) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); if (fDoDetailedQA) { j = 0; for (auto& cut : fTrackCuts) { @@ -1298,8 +1302,8 @@ struct TableMakerMC { for (auto& muonId : fwdtrackIdsThisCollision) { auto muon = muonId.template fwdtrack_as(); - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); if (!muon.has_mcParticle()) { continue; @@ -1343,8 +1347,8 @@ struct TableMakerMC { } } - trackFilteringTag = uint64_t(0); - trackTempFilterMap = uint8_t(0); + trackFilteringTag = static_cast(0); + trackTempFilterMap = static_cast(0); if (!muon.has_mcParticle()) { continue; @@ -1381,7 +1385,7 @@ struct TableMakerMC { continue; } // store the cut decisions - trackFilteringTag |= uint64_t(trackTempFilterMap); // BIT0-7: user selection cuts + trackFilteringTag |= static_cast(trackTempFilterMap); // BIT0-7: user selection cuts mcflags = 0; i = 0; // runs over the MC signals @@ -1389,7 +1393,7 @@ struct TableMakerMC { // check all the specified signals and fill histograms for MC truth matched tracks for (auto& sig : fMCSignals) { if (sig.CheckSignal(true, mctrack)) { - mcflags |= (uint16_t(1) << i); + mcflags |= (static_cast(1) << i); if (fDoDetailedQA) { for (auto& cut : fMuonCuts) { if (trackTempFilterMap & (uint8_t(1) << j)) { @@ -1504,7 +1508,7 @@ struct TableMakerMC { mctrack.weight(), mctrack.pt(), mctrack.eta(), mctrack.phi(), mctrack.e(), mctrack.vx(), mctrack.vy(), mctrack.vz(), mctrack.vt(), mcflags); for (unsigned int isig = 0; isig < fMCSignals.size(); isig++) { - if (mcflags & (uint16_t(1) << isig)) { + if (mcflags & (static_cast(1) << isig)) { (reinterpret_cast(fStatsList->At(3)))->Fill(static_cast(isig)); } } diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index d6a4270bb10..c85d44a4a19 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -532,7 +532,7 @@ struct TableMakerMC { multPV(collision.multNTracksHasITS(), collision.multNTracksHasTPC(), collision.multNTracksHasTOF(), collision.multNTracksHasTRD(), collision.multNTracksITSOnly(), collision.multNTracksTPCOnly(), collision.multNTracksITSTPC(), collision.trackOccupancyInTimeRange()); multAll(collision.multAllTracksTPCOnly(), collision.multAllTracksITSTPC(), - 0, 0, 0.0, 0.0, 0, 0); + 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0.0, 0.0, 0.0, 0.0); } // add an element for this collision into the map diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 8f437b7955c..5aae38f65df 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -235,6 +235,13 @@ struct TableMaker { Configurable fRefitGlobalMuon{"cfgRefitGlobalMuon", true, "Correct global muon parameters"}; Configurable fMuonMatchEtaMin{"cfgMuonMatchEtaMin", -4.0f, "Definition of the acceptance of muon tracks to be matched with MFT"}; Configurable fMuonMatchEtaMax{"cfgMuonMatchEtaMax", -2.5f, "Definition of the acceptance of muon tracks to be matched with MFT"}; + + // TPC occupancy related variables + Configurable fTPCShortPast{"cfgTPCShortPast", 8.0f, "Time in short past to look for occupancy (micro-seconds)"}; + Configurable fTPCShortFuture{"cfgTPCShortFuture", 8.0f, "Time in short future to look for occupancy (micro-seconds)"}; + Configurable fTPCLongPast{"cfgTPCLongPast", 100.0f, "Time in long past to look for occupancy (micro-seconds)"}; + Configurable fTPCLongFuture{"cfgTPCLongFuture", 100.0f, "Time in long future to look for occupancy (micro-seconds)"}; + Configurable fExcludeShort{"cfgTPCExcludeShort", true, "Exclude short term from long term occupancy (micro-seconds)"}; } fConfigVariousOptions; Service fCCDB; @@ -273,6 +280,25 @@ struct TableMaker { Preslice fwdtrackIndicesPerCollision = aod::track_association::collisionId; Preslice mfttrackIndicesPerCollision = aod::track_association::collisionId; + Preslice preslice = aod::track::collisionId; + Partition tracksPos = (((aod::track::flags & static_cast(o2::aod::track::PVContributor)) == static_cast(o2::aod::track::PVContributor)) && (aod::track::tgl > static_cast(0.05))); + Partition tracksNeg = (((aod::track::flags & static_cast(o2::aod::track::PVContributor)) == static_cast(o2::aod::track::PVContributor)) && (aod::track::tgl < static_cast(-0.05))); + + struct { + std::map oMeanTimeShortA; + std::map oMeanTimeShortC; + std::map oMeanTimeLongA; + std::map oMeanTimeLongC; + std::map oMedianTimeShortA; + std::map oMedianTimeShortC; + std::map oMedianTimeLongA; + std::map oMedianTimeLongC; + std::map oContribShortA; + std::map oContribShortC; + std::map oContribLongA; + std::map oContribLongC; + } fOccup; + void init(o2::framework::InitContext& context) { // CCDB configuration @@ -497,8 +523,183 @@ struct TableMaker { fStatsList->AddAt(histZorroSel, kStatsZorroSel); } + template + void computeOccupancyEstimators(TEvents const& collisions, TTracks const& /*tracks*/, Preslice& preslice, TBCs const&) + { + + // clear the occupancy maps for this time frame + fOccup.oMeanTimeLongA.clear(); + fOccup.oMeanTimeLongC.clear(); + fOccup.oMeanTimeShortA.clear(); + fOccup.oMeanTimeShortC.clear(); + fOccup.oMedianTimeLongA.clear(); + fOccup.oMedianTimeLongC.clear(); + fOccup.oMedianTimeShortA.clear(); + fOccup.oMedianTimeShortC.clear(); + fOccup.oContribLongA.clear(); + fOccup.oContribLongC.clear(); + fOccup.oContribShortA.clear(); + fOccup.oContribShortC.clear(); + + std::map oBC; // key: collision index; value: global BC + std::map> oBCreversed; // key: global BC, value: list of collisions attached to this BC + std::map oVtxZ; // key: collision index; value: vtx-z position + std::map collMultPos; // key: collision index; value: tpc multiplicity on the A side + std::map collMultNeg; // key: collision index; value: tpc multiplicity on the C side + + const double bcUS = o2::constants::lhc::LHCBunchSpacingNS / 1000.0; // BC spacing in micro-seconds + const double vdrift = 2.5; // cm / mus + int32_t bcShortPast = std::lrint(fConfigVariousOptions.fTPCShortPast / bcUS); // (close in time collisions) 8 micro-seconds in BC intervals + int32_t bcShortFuture = std::lrint(fConfigVariousOptions.fTPCShortFuture / bcUS); // (close in time collisions) 8 micro-seconds in BC intervals + int32_t bcLongPast = std::lrint(fConfigVariousOptions.fTPCLongPast / bcUS); // (wide time range collisions) past 40 micro-seconds in BC intervals + int32_t bcLongFuture = std::lrint(fConfigVariousOptions.fTPCLongFuture / bcUS); // // (wide time range collisions) future 100 micro-seconds in BC intervals + + // Loop over collisions and extract needed info (BC, vtxZ, multiplicity separately in A and C sides) + for (const auto& collision : collisions) { + + auto bcEvSel = collision.template foundBC_as(); + int64_t bc = bcEvSel.globalBC(); + oBC[collision.globalIndex()] = bc; + oVtxZ[collision.globalIndex()] = collision.posZ(); + + // if more than one collision per bunch, add that collision to the list for that bunch + if (oBCreversed.find(bc) == oBCreversed.end()) { + std::vector evs = {collision.globalIndex()}; + oBCreversed[bc] = evs; + } else { + auto& evs = oBCreversed[bc]; + evs.push_back(collision.globalIndex()); + } + + // make a slice for this collision and get the number of tracks + auto thisCollTrackPos = tracksPos.sliceBy(preslice, collision.globalIndex()); + auto thisCollTrackNeg = tracksNeg.sliceBy(preslice, collision.globalIndex()); + collMultPos[collision.globalIndex()] = thisCollTrackPos.size(); + collMultNeg[collision.globalIndex()] = thisCollTrackNeg.size(); + } + + // loop over collisions and sum the multiplicity in the past and future + for (const auto& [collision, bc] : oBC) { + + int64_t pastShortBC = oBCreversed.lower_bound(bc - bcShortPast)->first; + int64_t futureShortBC = oBCreversed.lower_bound(bc + bcShortFuture)->first; + int64_t pastLongBC = oBCreversed.lower_bound(bc - bcLongPast)->first; + int64_t futureLongBC = oBCreversed.lower_bound(bc + bcLongFuture)->first; + + fOccup.oContribLongA[collision] = 0; + fOccup.oContribLongC[collision] = 0; + fOccup.oMeanTimeLongA[collision] = 0.0; + fOccup.oMeanTimeLongC[collision] = 0.0; + fOccup.oContribShortA[collision] = 0; + fOccup.oContribShortC[collision] = 0; + fOccup.oMeanTimeShortA[collision] = 0.0; + fOccup.oMeanTimeShortC[collision] = 0.0; + std::map oTimeMapShortA; + std::map oTimeMapShortC; + std::map oTimeMapLongA; + std::map oTimeMapLongC; + // loop over the BCs in the past and future wrt this one + for (auto bcIt = oBCreversed.find(pastLongBC); bcIt != oBCreversed.find(futureLongBC); ++bcIt) { + int64_t thisBC = bcIt->first; + auto colls = bcIt->second; + // delta time due to the different BCs + float dt = (thisBC - bc) * bcUS; + // check if this collision is also within the short time range + bool isShort = (thisBC >= pastShortBC && thisBC < futureShortBC); + // loop over all collisions in this BC + for (auto& thisColl : colls) { + // skip if this is the same collision + if (thisColl == collision) { + continue; + } + // compute the delta time due to the difference in longitudinal position + float dtDrift = (oVtxZ[thisColl] - oVtxZ[collision]) / vdrift; + + if (!(fConfigVariousOptions.fExcludeShort && isShort)) { + // sum the collision multiplicity on A and C sides + fOccup.oContribLongA[collision] += collMultPos[thisColl]; + fOccup.oContribLongC[collision] += collMultNeg[thisColl]; + // compute the multiplicity weighted average time + fOccup.oMeanTimeLongA[collision] += collMultPos[thisColl] * (dt + dtDrift); + fOccup.oMeanTimeLongC[collision] += collMultNeg[thisColl] * (dt - dtDrift); + // fill the time map + oTimeMapLongA[dt + dtDrift] = collMultPos[thisColl]; + oTimeMapLongC[dt - dtDrift] = collMultNeg[thisColl]; + } + + if (isShort) { + fOccup.oContribShortA[collision] += collMultPos[thisColl]; + fOccup.oContribShortC[collision] += collMultNeg[thisColl]; + fOccup.oMeanTimeShortA[collision] += collMultPos[thisColl] * (dt + dtDrift); + fOccup.oMeanTimeShortC[collision] += collMultNeg[thisColl] * (dt - dtDrift); + oTimeMapShortA[dt + dtDrift] = collMultPos[thisColl]; + oTimeMapShortC[dt - dtDrift] = collMultNeg[thisColl]; + } + } + } + // normalize to obtain the mean time + if (fOccup.oContribLongA[collision] > 0) { + fOccup.oMeanTimeLongA[collision] /= fOccup.oContribLongA[collision]; + } + if (fOccup.oContribLongC[collision] > 0) { + fOccup.oMeanTimeLongC[collision] /= fOccup.oContribLongC[collision]; + } + if (fOccup.oContribShortA[collision] > 0) { + fOccup.oMeanTimeShortA[collision] /= fOccup.oContribShortA[collision]; + } + if (fOccup.oContribShortC[collision] > 0) { + fOccup.oMeanTimeShortC[collision] /= fOccup.oContribShortC[collision]; + } + // iterate over the time maps to obtain the median time + fOccup.oMedianTimeLongA[collision] = 0.0; + float sumMult = 0.0; + if (oTimeMapLongA.size() > 0) { + for (auto& [dt, mult] : oTimeMapLongA) { + sumMult += mult; + if (sumMult > fOccup.oContribLongA[collision] / 2.0) { + fOccup.oMedianTimeLongA[collision] = dt; + break; + } + } + } + fOccup.oMedianTimeLongC[collision] = 0.0; + sumMult = 0.0; + if (oTimeMapLongC.size() > 0) { + for (auto& [dt, mult] : oTimeMapLongC) { + sumMult += mult; + if (sumMult > fOccup.oContribLongC[collision] / 2.0) { + fOccup.oMedianTimeLongC[collision] = dt; + break; + } + } + } + fOccup.oMedianTimeShortA[collision] = 0.0; + sumMult = 0.0; + if (oTimeMapShortA.size() > 0) { + for (auto& [dt, mult] : oTimeMapShortA) { + sumMult += mult; + if (sumMult > fOccup.oContribShortA[collision] / 2.0) { + fOccup.oMedianTimeShortA[collision] = dt; + break; + } + } + } + fOccup.oMedianTimeShortC[collision] = 0.0; + sumMult = 0.0; + if (oTimeMapShortC.size() > 0) { + for (auto& [dt, mult] : oTimeMapShortC) { + sumMult += mult; + if (sumMult > fOccup.oContribShortC[collision] / 2.0) { + fOccup.oMedianTimeShortC[collision] = dt; + break; + } + } + } + } // end loop over collisions + } + template - void skimCollisions(TEvents const& collisions, TBCs const& /*bcs*/, TZdcs const& /*zdcs*/, + void skimCollisions(TEvents const& collisions, TBCs const& bcs, TZdcs const& /*zdcs*/, TTrackAssoc const& trackAssocs, TTracks const& tracks) { // Skim collisions @@ -562,6 +763,21 @@ struct TableMaker { auto groupedTrackIndices = trackAssocs.sliceBy(trackIndicesPerCollision, collision.globalIndex()); VarManager::FillEventTrackEstimators(collision, groupedTrackIndices, tracks); } + // Exceptionally fill the TPC occupancy quantities here + if constexpr ((TEventFillMap & VarManager::ObjTypes::CollisionMultExtra) > 0) { + VarManager::fgValues[VarManager::kNTPCcontribLongA] = fOccup.oContribLongA[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCcontribLongC] = fOccup.oContribLongC[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmeanTimeLongA] = fOccup.oMeanTimeLongA[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmeanTimeLongC] = fOccup.oMeanTimeLongC[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmedianTimeLongA] = fOccup.oMedianTimeLongA[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmedianTimeLongC] = fOccup.oMedianTimeLongC[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCcontribShortA] = fOccup.oContribShortA[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCcontribShortC] = fOccup.oContribShortC[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmeanTimeShortA] = fOccup.oMeanTimeShortA[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmeanTimeShortC] = fOccup.oMeanTimeShortC[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmedianTimeShortA] = fOccup.oMedianTimeShortA[collision.globalIndex()]; + VarManager::fgValues[VarManager::kNTPCmedianTimeShortC] = fOccup.oMedianTimeShortC[collision.globalIndex()]; + } if (fDoDetailedQA) { fHistMan->FillHistClass("Event_BeforeCuts", VarManager::fgValues); } @@ -637,8 +853,12 @@ struct TableMaker { collision.multNTracksITSOnly(), collision.multNTracksTPCOnly(), collision.multNTracksITSTPC(), collision.trackOccupancyInTimeRange()); multAll(collision.multAllTracksTPCOnly(), collision.multAllTracksITSTPC(), - VarManager::fgValues[VarManager::kNTPCpileupContribA], VarManager::fgValues[VarManager::kNTPCpileupContribC], - VarManager::fgValues[VarManager::kNTPCpileupZA], VarManager::fgValues[VarManager::kNTPCpileupZC], 0, 0); + fOccup.oContribLongA[collision.globalIndex()], fOccup.oContribLongC[collision.globalIndex()], + fOccup.oMeanTimeLongA[collision.globalIndex()], fOccup.oMeanTimeLongC[collision.globalIndex()], + fOccup.oMedianTimeLongA[collision.globalIndex()], fOccup.oMedianTimeLongC[collision.globalIndex()], + fOccup.oContribShortA[collision.globalIndex()], fOccup.oContribShortC[collision.globalIndex()], + fOccup.oMeanTimeShortA[collision.globalIndex()], fOccup.oMeanTimeShortC[collision.globalIndex()], + fOccup.oMedianTimeShortA[collision.globalIndex()], fOccup.oMedianTimeShortC[collision.globalIndex()]); } fCollIndexMap[collision.globalIndex()] = event.lastIndex(); @@ -1148,6 +1368,7 @@ struct TableMaker { MyBarrelTracksWithV0Bits const& tracksBarrel, TrackAssoc const& trackAssocs) { + computeOccupancyEstimators(collisions, tracksBarrel, preslice, bcs); fullSkimming(collisions, bcs, nullptr, tracksBarrel, nullptr, nullptr, trackAssocs, nullptr, nullptr); } From 1e6fb75841f8ff3bc177dff9f768ae43d3185557 Mon Sep 17 00:00:00 2001 From: MaolinZH <109225729+MaolinZH@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:49:55 +0100 Subject: [PATCH 246/459] [PWGDQ] Add the electron-muon pair process in filterPPwithAssociation (#8716) --- PWGDQ/Tasks/filterPPwithAssociation.cxx | 228 ++++++++++++++++++++---- 1 file changed, 197 insertions(+), 31 deletions(-) diff --git a/PWGDQ/Tasks/filterPPwithAssociation.cxx b/PWGDQ/Tasks/filterPPwithAssociation.cxx index 4f92cf7cc90..d2d374b06ef 100644 --- a/PWGDQ/Tasks/filterPPwithAssociation.cxx +++ b/PWGDQ/Tasks/filterPPwithAssociation.cxx @@ -13,6 +13,8 @@ // #include #include +#include +#include #include #include #include @@ -68,6 +70,7 @@ enum DQTriggers { kSingleMuLow, kSingleMuHigh, kDiMuon, + // kElectronMuon, // the ElectronMuon trigger is not available now kNTriggersDQ }; } // namespace @@ -78,6 +81,8 @@ namespace dqppfilter DECLARE_SOA_COLUMN(IsDQEventSelected, isDQEventSelected, int); DECLARE_SOA_COLUMN(IsDQBarrelSelected, isDQBarrelSelected, uint32_t); DECLARE_SOA_COLUMN(IsDQMuonSelected, isDQMuonSelected, uint32_t); +DECLARE_SOA_COLUMN(IsDQEMuBarrelSelected, isDQEMuBarrelSelected, uint32_t); // for electron-muon pair +DECLARE_SOA_COLUMN(IsDQEMuMuonSelected, isDQEMuMuonSelected, uint32_t); // for electron-muon pair DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! Collision index DECLARE_SOA_INDEX_COLUMN(Track, track); //! Track index DECLARE_SOA_INDEX_COLUMN(FwdTrack, fwdtrack); //! FwdTrack index @@ -86,6 +91,8 @@ DECLARE_SOA_INDEX_COLUMN(FwdTrack, fwdtrack); //! FwdTrack index DECLARE_SOA_TABLE(DQEventCuts, "AOD", "DQEVENTCUTS", dqppfilter::IsDQEventSelected); DECLARE_SOA_TABLE(DQBarrelTrackCuts, "AOD", "DQBARRELCUTS", dqppfilter::IsDQBarrelSelected); DECLARE_SOA_TABLE(DQMuonsCuts, "AOD", "DQMUONCUTS", dqppfilter::IsDQMuonSelected); +DECLARE_SOA_TABLE(DQEMuBarrelTrackCuts, "AOD", "DQEMUBARRELCUTS", dqppfilter::IsDQEMuBarrelSelected); // for electron-muon pair +DECLARE_SOA_TABLE(DQEMuMuonsCuts, "AOD", "DQEMUMUONCUTS", dqppfilter::IsDQEMuMuonSelected); // for electron-muon pair } // namespace o2::aod using MyEvents = soa::Join; @@ -103,10 +110,10 @@ using MyBarrelTracksSelected = soa::Join; -using MyBarrelTracksAssocSelected = soa::Join; // As the kinelatic values must be re-computed for the tracks everytime it is associated to a collision, the selection is done not on the tracks, but on the track-collision association +using MyBarrelTracksAssocSelected = soa::Join; // As the kinelatic values must be re-computed for the tracks everytime it is associated to a collision, the selection is done not on the tracks, but on the track-collision association using MyMuons = soa::Join; -using MyMuonsAssocSelected = soa::Join; // As the kinelatic values must be re-computed for the muons tracks everytime it is associated to a collision, the selection is done not on the muon, but on the muon-collision association +using MyMuonsAssocSelected = soa::Join; // As the kinelatic values must be re-computed for the muons tracks everytime it is associated to a collision, the selection is done not on the muon, but on the muon-collision association constexpr static uint32_t gkEventFillMap = VarManager::ObjTypes::BC | VarManager::ObjTypes::Collision; constexpr static uint32_t gkTrackFillMap = VarManager::ObjTypes::Track | VarManager::ObjTypes::TrackExtra | VarManager::ObjTypes::TrackDCA | VarManager::ObjTypes::TrackPID; @@ -185,10 +192,12 @@ struct DQEventSelectionTask { struct DQBarrelTrackSelection { Produces trackSel; + Produces emuSel; OutputObj fOutputList{"output"}; HistogramManager* fHistMan; Configurable fConfigCuts{"cfgBarrelTrackCuts", "jpsiPID1", "Comma separated list of barrel track cuts"}; + Configurable fConfigCutsForEMu{"cfgBarrelTrackCutsForEMu", "jpsiPID1", "Comma separated list of barrel track cuts"}; Configurable fConfigQA{"cfgWithQA", false, "If true, fill QA histograms"}; Configurable fPropTrack{"cfgPropTrack", false, "Propgate tracks to associated collision to recalculate DCA and momentum vector"}; Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -201,6 +210,7 @@ struct DQBarrelTrackSelection { Preslice barrelTrackIndicesPerCollision = aod::track_association::collisionId; std::vector fTrackCuts; + std::vector fEMuTrackCuts; std::vector fCutHistNames; int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. @@ -208,6 +218,7 @@ struct DQBarrelTrackSelection { void init(o2::framework::InitContext&) { TString cutNamesStr = fConfigCuts.value; + TString cutEMuNamesStr = fConfigCutsForEMu.value; if (!cutNamesStr.IsNull()) { std::unique_ptr objArray(cutNamesStr.Tokenize(",")); for (int icut = 0; icut < objArray->GetEntries(); ++icut) { @@ -219,6 +230,17 @@ struct DQBarrelTrackSelection { } } } + if (!cutEMuNamesStr.IsNull()) { + std::unique_ptr objArray2(cutEMuNamesStr.Tokenize(",")); + for (int icut = 0; icut < objArray2->GetEntries(); ++icut) { + AnalysisCompositeCut* cut2 = dqcuts::GetCompositeCut(objArray2->At(icut)->GetName()); + if (cut2) { + fEMuTrackCuts.push_back(*cut2); + } else { + LOGF(fatal, "Invalid e-mu cut provided: %s", objArray2->At(icut)->GetName()); + } + } + } VarManager::SetUseVars(AnalysisCut::fgUsedVars); // provide the list of required variables so that VarManager knows what to fill if (fConfigQA) { @@ -272,12 +294,15 @@ struct DQBarrelTrackSelection { // o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; - uint32_t filterMap = uint32_t(0); + uint32_t filterMap = static_cast(0); + uint32_t filterMapEMu = static_cast(0); trackSel.reserve(tracksBarrel.size()); + emuSel.reserve(tracksBarrel.size()); VarManager::ResetValues(0, VarManager::kNBarrelTrackVariables); for (auto& trackAssoc : trackAssocs) { - filterMap = uint32_t(0); + filterMap = static_cast(0); + filterMapEMu = static_cast(0); auto track = trackAssoc.template track_as(); @@ -292,13 +317,20 @@ struct DQBarrelTrackSelection { int i = 0; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); ++cut, ++i) { if ((*cut).IsSelected(VarManager::fgValues)) { - filterMap |= (uint32_t(1) << i); + filterMap |= (static_cast(1) << i); if (fConfigQA) { fHistMan->FillHistClass(fCutHistNames[i].Data(), VarManager::fgValues); } } } + int j = 0; + for (auto cut = fEMuTrackCuts.begin(); cut != fEMuTrackCuts.end(); ++cut, ++j) { + if ((*cut).IsSelected(VarManager::fgValues)) { + filterMapEMu |= (static_cast(1) << j); + } + } trackSel(filterMap); + emuSel(filterMapEMu); } // end loop over tracks } @@ -321,10 +353,12 @@ struct DQBarrelTrackSelection { struct DQMuonsSelection { Produces trackSel; + Produces emuSel; OutputObj fOutputList{"output"}; HistogramManager* fHistMan; Configurable fConfigCuts{"cfgMuonsCuts", "muonQualityCuts", "Comma separated list of ADDITIONAL muon track cuts"}; + Configurable fConfigCutsForEMu{"cfgMuonsCutsForEMu", "muonQualityCuts", "Comma separated list of ADDITIONAL muon track cuts"}; Configurable fConfigQA{"cfgWithQA", false, "If true, fill QA histograms"}; Configurable fPropMuon{"cfgPropMuon", false, "Propgate muon tracks through absorber"}; Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -341,6 +375,7 @@ struct DQMuonsSelection { // TODO: configure the histogram classes to be filled by QA std::vector fTrackCuts; + std::vector fEMuTrackCuts; std::vector fCutHistNames; void init(o2::framework::InitContext&) @@ -355,12 +390,19 @@ struct DQMuonsSelection { } TString cutNamesStr = fConfigCuts.value; + TString cutEMuNamesStr = fConfigCutsForEMu.value; if (!cutNamesStr.IsNull()) { std::unique_ptr objArray(cutNamesStr.Tokenize(",")); for (int icut = 0; icut < objArray->GetEntries(); ++icut) { fTrackCuts.push_back(*dqcuts::GetCompositeCut(objArray->At(icut)->GetName())); } } + if (!cutEMuNamesStr.IsNull()) { + std::unique_ptr objArray2(cutEMuNamesStr.Tokenize(",")); + for (int icut = 0; icut < objArray2->GetEntries(); ++icut) { + fEMuTrackCuts.push_back(*dqcuts::GetCompositeCut(objArray2->At(icut)->GetName())); + } + } VarManager::SetUseVars(AnalysisCut::fgUsedVars); if (fConfigQA) { @@ -396,13 +438,16 @@ struct DQMuonsSelection { } } - uint32_t filterMap = uint32_t(0); + uint32_t filterMap = static_cast(0); + uint32_t filterMapEMu = static_cast(0); trackSel.reserve(muons.size()); + emuSel.reserve(muons.size()); VarManager::ResetValues(0, VarManager::kNMuonTrackVariables); for (auto& muonAssoc : muonAssocs) { - filterMap = uint32_t(0); + filterMap = static_cast(0); + filterMapEMu = static_cast(0); auto muon = muonAssoc.template fwdtrack_as(); VarManager::FillTrack(muon); if (fPropMuon) { @@ -414,13 +459,20 @@ struct DQMuonsSelection { int i = 0; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); ++cut, ++i) { if ((*cut).IsSelected(VarManager::fgValues)) { - filterMap |= (uint32_t(1) << i); + filterMap |= (static_cast(1) << i); if (fConfigQA) { fHistMan->FillHistClass(fCutHistNames[i].Data(), VarManager::fgValues); } } } + int j = 0; + for (auto cut = fEMuTrackCuts.begin(); cut != fEMuTrackCuts.end(); ++cut, ++j) { + if ((*cut).IsSelected(VarManager::fgValues)) { + filterMapEMu |= (static_cast(1) << j); + } + } trackSel(filterMap); + emuSel(filterMapEMu); } // end loop over muons } @@ -510,10 +562,11 @@ struct DQFilterPPTask { Configurable fConfigBarrelSelections{"cfgBarrelSels", "jpsiPID1:pairMassLow:1", ":[]:,[:[]:],..."}; Configurable fConfigMuonSelections{"cfgMuonSels", "muonQualityCuts:pairNoCut:1", ":[]:"}; + Configurable fConfigElectronMuonSelections{"cfgElectronMuonSels", "jpsiPID1:muonQualityCuts:pairNoCut:1", "::[]:"}; Configurable fConfigQA{"cfgWithQA", false, "If true, fill QA histograms"}; Configurable fConfigFilterLsBarrelTracksPairs{"cfgWithBarrelLS", "false", "Comma separated list of booleans for each trigger, If true, also select like sign (--/++) barrel track pairs"}; Configurable fConfigFilterLsMuonsPairs{"cfgWithMuonLS", "false", "Comma separated list of booleans for each trigger, If true, also select like sign (--/++) muon pairs"}; - + Configurable fConfigFilterLsElectronMuonsPairs{"cfgWithElectronMuonLS", "false", "Comma separated list of booleans for each trigger, If true, also select like sign (--/++) muon pairs"}; Configurable fPropMuon{"cfgPropMuon", false, "Propgate muon tracks through absorber"}; Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; @@ -526,14 +579,19 @@ struct DQFilterPPTask { int fNBarrelCuts; // number of barrel selections int fNMuonCuts; // number of muon selections + int fNElectronMuonCuts; // number of electron-muon selections std::vector fBarrelRunPairing; // bit map on whether the selections require pairing (barrel) std::vector fMuonRunPairing; // bit map on whether the selections require pairing (muon) + std::vector fElectronMuonRunPairing; // bit map on whether the selections require pairing (e-mu) std::vector fBarrelNreqObjs; // minimal number of tracks/pairs required (barrel) std::vector fMuonNreqObjs; // minimal number of tracks/pairs required (muon) + std::vector fElectronMuonNreqObjs; // minimal number of electron-muon pairs required std::map fBarrelPairCuts; // map of barrel pair cuts std::map fMuonPairCuts; // map of muon pair cuts + std::map fElectronMuonPairCuts; // map of electron-muon pair cuts std::map fBarrelPairHistNames; // map with names of the barrel pairing histogram directories std::map fMuonPairHistNames; // map with names of the muon pairing histogram directories + std::map fElectronMuonPairHistNames; // map with names of the electron-muon pairing histogram directories std::map fFiltersMap; // map of filters for events that passed at least one filter std::map> fCEFPfilters; // map of CEFP filters for events that passed at least one filter @@ -584,10 +642,32 @@ struct DQFilterPPTask { } } } + // electron-muon pair + TString electronMuonSelsStr = fConfigElectronMuonSelections.value; + std::unique_ptr objArray3(electronMuonSelsStr.Tokenize(",")); + fNElectronMuonCuts = objArray3->GetEntries(); + if (fNElectronMuonCuts) { + for (int icut = 0; icut < fNElectronMuonCuts; ++icut) { + TString selStr = objArray3->At(icut)->GetName(); + std::unique_ptr sel(selStr.Tokenize(":")); + if (sel->GetEntries() < 3 || sel->GetEntries() > 4) { + continue; + } + if (sel->GetEntries() == 4) { + fElectronMuonPairCuts[icut] = (*dqcuts::GetCompositeCut(sel->At(2)->GetName())); + fElectronMuonRunPairing.push_back(true); + fElectronMuonNreqObjs.push_back(std::atoi(sel->At(3)->GetName())); + fElectronMuonPairHistNames[icut] = Form("PairsElectronMuonSEPM_%s_%s_%s", sel->At(0)->GetName(), sel->At(1)->GetName(), sel->At(2)->GetName()); + } else { + fElectronMuonNreqObjs.push_back(std::atoi(sel->At(2)->GetName())); + fElectronMuonRunPairing.push_back(false); + } + } + } VarManager::SetUseVars(AnalysisCut::fgUsedVars); // setup the Stats histogram - fStats.setObject(new TH1D("Statistics", "Stats for DQ triggers", fNBarrelCuts + fNMuonCuts + 2, -2.5, -0.5 + fNBarrelCuts + fNMuonCuts)); + fStats.setObject(new TH1D("Statistics", "Stats for DQ triggers", fNBarrelCuts + fNMuonCuts + fNElectronMuonCuts + 2, -2.5, -0.5 + fNBarrelCuts + fNMuonCuts + fNElectronMuonCuts)); fStats->GetXaxis()->SetBinLabel(1, "Events inspected"); fStats->GetXaxis()->SetBinLabel(2, "Events selected"); if (fNBarrelCuts) { @@ -600,6 +680,11 @@ struct DQFilterPPTask { fStats->GetXaxis()->SetBinLabel(ib, objArray2->At(ib - 3 - fNBarrelCuts)->GetName()); } } + if (fNElectronMuonCuts) { + for (int ib = 3 + fNBarrelCuts + fNMuonCuts; ib < 3 + fNBarrelCuts + fNMuonCuts + fNElectronMuonCuts; ib++) { + fStats->GetXaxis()->SetBinLabel(ib, objArray3->At(ib - 3 - fNBarrelCuts - fNMuonCuts)->GetName()); + } + } } void init(o2::framework::InitContext&) @@ -629,6 +714,10 @@ struct DQFilterPPTask { histNames += value; histNames += ";"; } + for (const auto& [key, value] : fElectronMuonPairHistNames) { + histNames += value; + histNames += ";"; + } DefineHistograms(fHistMan, histNames.Data()); VarManager::SetUseVars(fHistMan->GetUsedVars()); fOutputList.setObject(fHistMan->GetMainHistogramList()); @@ -661,7 +750,7 @@ struct DQFilterPPTask { // count the number of barrel tracks fulfilling each cut for (auto trackAssoc : barrelAssocs) { for (int i = 0; i < fNBarrelCuts; ++i) { - if (trackAssoc.isDQBarrelSelected() & (uint32_t(1) << i)) { + if (trackAssoc.isDQBarrelSelected() & (static_cast(1) << i)) { objCountersBarrel[i] += 1; } } @@ -672,7 +761,7 @@ struct DQFilterPPTask { for (int i = 0; i < fNBarrelCuts; i++) { if (fBarrelRunPairing[i]) { if (objCountersBarrel[i] > 1) { // pairing has to be enabled and at least two tracks are needed - pairingMask |= (uint32_t(1) << i); + pairingMask |= (static_cast(1) << i); } objCountersBarrel[i] = 0; // reset counters for selections where pairing is needed (count pairs instead) } @@ -685,7 +774,7 @@ struct DQFilterPPTask { for (int icut = 0; icut < fNBarrelCuts; icut++) { TString objStr = objArrayLS->At(icut)->GetName(); if (!objStr.CompareTo("true")) { - pairingLS |= (uint32_t(1) << icut); + pairingLS |= (static_cast(1) << icut); } } @@ -708,13 +797,13 @@ struct DQFilterPPTask { VarManager::FillPair(t1, t2); // compute pair quantities for (int icut = 0; icut < fNBarrelCuts; icut++) { // select like-sign pairs if trigger has set boolean true within fConfigFilterLsBarrelTracksPairs - if (!(pairingLS & (uint32_t(1) << icut))) { + if (!(pairingLS & (static_cast(1) << icut))) { if (t1.sign() * t2.sign() > 0) { continue; } } - if (!(pairFilter & (uint32_t(1) << icut))) { + if (!(pairFilter & (static_cast(1) << icut))) { continue; } if (!fBarrelPairCuts[icut].IsSelected(VarManager::fgValues)) { @@ -732,7 +821,7 @@ struct DQFilterPPTask { // count the number of muon-collision associations fulfilling each selection for (auto muon : muonAssocs) { for (int i = 0; i < fNMuonCuts; ++i) { - if (muon.isDQMuonSelected() & (uint32_t(1) << i)) { + if (muon.isDQMuonSelected() & (static_cast(1) << i)) { objCountersMuon[i] += 1; } } @@ -743,7 +832,7 @@ struct DQFilterPPTask { for (int i = 0; i < fNMuonCuts; i++) { if (fMuonRunPairing[i]) { // pairing has to be enabled and at least two tracks are needed if (objCountersMuon[i] > 1) { - pairingMask |= (uint32_t(1) << i); + pairingMask |= (static_cast(1) << i); } objCountersMuon[i] = 0; // reset counters for selections where pairing is needed (count pairs instead) } @@ -756,7 +845,7 @@ struct DQFilterPPTask { for (int icut = 0; icut < fNMuonCuts; icut++) { TString objStr = objArrayMuonLS->At(icut)->GetName(); if (!objStr.CompareTo("true")) { - pairingLS |= (uint32_t(1) << icut); + pairingLS |= (static_cast(1) << icut); } } @@ -783,12 +872,12 @@ struct DQFilterPPTask { } for (int icut = 0; icut < fNMuonCuts; icut++) { // select like-sign pairs if trigger has set boolean true within fConfigFilterLsMuonsPairs - if (!(pairingLS & (uint32_t(1) << icut))) { + if (!(pairingLS & (static_cast(1) << icut))) { if (t1.sign() * t2.sign() > 0) { continue; } } - if (!(pairFilter & (uint32_t(1) << icut))) { + if (!(pairFilter & (static_cast(1) << icut))) { continue; } if (!fMuonPairCuts[icut].IsSelected(VarManager::fgValues)) { @@ -802,16 +891,79 @@ struct DQFilterPPTask { } } + // electron-muon pair + std::vector objCountersElectronMuon(fNElectronMuonCuts, 0); // init all counters to zero + pairingMask = 0; + for (auto& [trackAssoc, muon] : combinations(barrelAssocs, muonAssocs)) { + for (int i = 0; i < fNElectronMuonCuts; ++i) { + if (trackAssoc.isDQEMuBarrelSelected() & muon.isDQEMuMuonSelected() & (static_cast(1) << i)) { + if (fElectronMuonRunPairing[i]) { + pairingMask |= (static_cast(1) << i); + } + } + } + } + // check which selection should use like sign (LS) (--/++) muon track pairs + pairingLS = 0; // reset the decisions for electron-muons + TString electronMuonLSstr = fConfigFilterLsElectronMuonsPairs.value; + std::unique_ptr objArrayElectronMuonLS(electronMuonLSstr.Tokenize(",")); + for (int icut = 0; icut < fNElectronMuonCuts; icut++) { + TString objStr = objArrayElectronMuonLS->At(icut)->GetName(); + if (!objStr.CompareTo("true")) { + pairingLS |= (static_cast(1) << icut); + } + } + + // run pairing if there is at least one selection that requires it + pairFilter = 0; + if (pairingMask > 0) { + // pairing is done using the collision grouped electron and muon associations + for (auto& [a1, a2] : combinations(barrelAssocs, muonAssocs)) { + // check the pairing mask and that the tracks share a cut bit + pairFilter = pairingMask & a1.isDQEMuBarrelSelected() & a2.isDQEMuMuonSelected(); + if (pairFilter == 0) { + continue; + } + // get the real electron and muon tracks + auto t1 = a1.template track_as(); + auto t2 = a2.template fwdtrack_as(); + // construct the pair and apply cuts + VarManager::FillPair(t1, t2); // compute pair quantities + for (int icut = 0; icut < fNElectronMuonCuts; icut++) { + // select like-sign pairs if trigger has set boolean true within fConfigFilterLsElectronMuonsPairs + if (!(pairingLS & (static_cast(1) << icut))) { + if (t1.sign() * t2.sign() > 0) { + continue; + } + } + if (!(pairFilter & (static_cast(1) << icut))) { + continue; + } + if (!fElectronMuonPairCuts[icut].IsSelected(VarManager::fgValues)) { + continue; + } + objCountersElectronMuon[icut] += 1; + if (fConfigQA) { + fHistMan->FillHistClass(fElectronMuonPairHistNames[icut].Data(), VarManager::fgValues); + } + } + } + } // compute the decisions and publish uint64_t filter = 0; for (int i = 0; i < fNBarrelCuts; i++) { if (objCountersBarrel[i] >= fBarrelNreqObjs[i]) { - filter |= (uint64_t(1) << i); + filter |= (static_cast(1) << i); } } for (int i = 0; i < fNMuonCuts; i++) { if (objCountersMuon[i] >= fMuonNreqObjs[i]) { - filter |= (uint64_t(1) << (i + fNBarrelCuts)); + filter |= (static_cast(1) << (i + fNBarrelCuts)); + } + } + for (int i = 0; i < fNElectronMuonCuts; i++) { + if (objCountersElectronMuon[i] >= fElectronMuonNreqObjs[i]) { + filter |= (static_cast(1) << (i + fNBarrelCuts + fNMuonCuts)); } } return filter; @@ -833,13 +985,12 @@ struct DQFilterPPTask { uint64_t barrelMask = 0; for (int i = 0; i < fNBarrelCuts; i++) { - barrelMask |= (uint64_t(1) << i); + barrelMask |= (static_cast(1) << i); } uint64_t muonMask = 0; for (int i = fNBarrelCuts; i < fNBarrelCuts + fNMuonCuts; i++) { - muonMask |= (uint64_t(1) << i); + muonMask |= (static_cast(1) << i); } - // Loop over collisions // int event = 0; int eventsFired = 0; @@ -866,20 +1017,29 @@ struct DQFilterPPTask { // compute the CEPF decisions (this is done in a spacial setup with exactly kNTriggersDQ configured triggers) std::vector decisions(kNTriggersDQ, false); // event decisions to be transmitted to CEFP for (int i = 0; i < fNBarrelCuts; i++) { - if (filter & (uint64_t(1) << i)) { + if (filter & (static_cast(1) << i)) { if (i < kNTriggersDQ) { decisions[i] = true; } } } for (int i = fNBarrelCuts; i < fNBarrelCuts + fNMuonCuts; i++) { - if (filter & (uint64_t(1) << i)) { + if (filter & (static_cast(1) << i)) { if (i < kNTriggersDQ) { decisions[i] = true; } } } - + // the ElectronMuon trigger is not available now + /* + for (int i = fNBarrelCuts + fNMuonCuts; i < fNBarrelCuts + fNMuonCuts + fNElectronMuonCuts; i++) { + if (filter & (static_cast(1) << i)) { + if (i < kNTriggersDQ) { + decisions[i] = true; + } + } + } + */ // if this collision fired at least one input, add it to the map, or if it is there already, update the decisions with a logical OR // This may happen in the case when some collisions beyond the iterator are added because they contain ambiguous tracks fired on by another collision if (fFiltersMap.find(collision.globalIndex()) == fFiltersMap.end()) { @@ -961,6 +1121,7 @@ struct DQFilterPPTask { if (!collision.isDQEventSelected()) { eventFilter(0); dqtable(false, false, false, false, false, false, false); + // dqtable(false, false, false, false, false, false, false, false); // the ElectronMuon trigger is not available now continue; } fStats->Fill(-1.0); @@ -968,15 +1129,17 @@ struct DQFilterPPTask { if (fFiltersMap.find(collision.globalIndex()) == fFiltersMap.end()) { eventFilter(0); dqtable(false, false, false, false, false, false, false); + // dqtable(false, false, false, false, false, false, false, false); // the ElectronMuon trigger is not available now } else { totalEventsTriggered++; - for (int i = 0; i < fNBarrelCuts + fNMuonCuts; i++) { - if (fFiltersMap[collision.globalIndex()] & (uint32_t(1) << i)) + for (int i = 0; i < fNBarrelCuts + fNMuonCuts + fNElectronMuonCuts; i++) { + if (fFiltersMap[collision.globalIndex()] & (static_cast(1) << i)) fStats->Fill(static_cast(i)); } eventFilter(fFiltersMap[collision.globalIndex()]); auto dqDecisions = fCEFPfilters[collision.globalIndex()]; dqtable(dqDecisions[0], dqDecisions[1], dqDecisions[2], dqDecisions[3], dqDecisions[4], dqDecisions[5], dqDecisions[6]); + // dqtable(dqDecisions[0], dqDecisions[1], dqDecisions[2], dqDecisions[3], dqDecisions[4], dqDecisions[5], dqDecisions[6], dqDecisions[7]); // the ElectronMuon trigger is not available now } } @@ -1021,7 +1184,7 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses) dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", "its,tpcpid,dca"); } - if (classStr.Contains("Muon")) { + if (classStr.Contains("Muon") && !classStr.Contains("Electron")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "track", "muon"); } @@ -1032,6 +1195,9 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses) if (classStr.Contains("Forward")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "pair", "dimuon,vertexing-forward"); } + if (classStr.Contains("ElectronMuon")) { + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "pair", "electronmuon"); + } } } } From c6d87dd4d0c7da27482a8780d745354af488aa58 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:59:52 +0100 Subject: [PATCH 247/459] [PWGJE,EMCAL-670] Add LG cell time correction parameters (#8815) Co-authored-by: Nicolas Strangmann --- PWGJE/TableProducer/emcalCorrectionTask.cxx | 253 ++++++++++---------- 1 file changed, 132 insertions(+), 121 deletions(-) diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index 0a84a66b23b..e2a0b1a3a9d 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -8,14 +8,17 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. - -// EMCAL Correction Task -// -/// \author Raymond Ehlers , ORNL -/// \author Florian Jonas +/// +/// EMCAL Correction Task +/// +/// \file emcalCorrectionTask.cxx +/// +/// \brief Task that provides EMCal clusters and applies necessary corrections +/// +/// \author Raymond Ehlers (raymond.ehlers@cern.ch) ORNL, Florian Jonas (florian.jonas@cern.ch) +/// #include -#include #include #include #include @@ -51,12 +54,12 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using myGlobTracks = o2::soa::Join; -using bcEvSels = o2::soa::Join; -using collEventSels = o2::soa::Join; -using filteredCells = o2::soa::Filtered; -using mcCells = o2::soa::Join; -using filteredMCCells = o2::soa::Filtered; +using MyGlobTracks = o2::soa::Join; +using BcEvSels = o2::soa::Join; +using CollEventSels = o2::soa::Join; +using FilteredCells = o2::soa::Filtered; +using McCells = o2::soa::Join; +using FilteredMcCells = o2::soa::Filtered; struct EmcalCorrectionTask { Produces clusters; @@ -68,22 +71,22 @@ struct EmcalCorrectionTask { Produces emcalcollisionmatch; // Preslices - Preslice perCollision = o2::aod::track::collisionId; - PresliceUnsorted collisionsPerFoundBC = aod::evsel::foundBCId; + Preslice perCollision = o2::aod::track::collisionId; + PresliceUnsorted collisionsPerFoundBC = aod::evsel::foundBCId; Preslice collisionsPerBC = aod::collision::bcId; - Preslice cellsPerFoundBC = aod::calo::bcId; - Preslice mcCellsPerFoundBC = aod::calo::bcId; + Preslice cellsPerFoundBC = aod::calo::bcId; + Preslice mcCellsPerFoundBC = aod::calo::bcId; // Options for the clusterization // 1 corresponds to EMCAL cells based on the Run2 definition. Configurable selectedCellType{"selectedCellType", 1, "EMCAL Cell type"}; - Configurable clusterDefinitions{"clusterDefinition", "kV3Default", "cluster definition to be selected, e.g. V3Default. Multiple definitions can be specified separated by comma"}; + Configurable clusterDefinitions{"clusterDefinitions", "kV3Default", "cluster definition to be selected, e.g. V3Default. Multiple definitions can be specified separated by comma"}; Configurable maxMatchingDistance{"maxMatchingDistance", 0.4f, "Max matching distance track-cluster"}; Configurable nonlinearityFunction{"nonlinearityFunction", "DATA_TestbeamFinal", "Nonlinearity correction at cluster level"}; Configurable disableNonLin{"disableNonLin", false, "Disable NonLin correction if set to true"}; Configurable hasShaperCorrection{"hasShaperCorrection", true, "Apply correction for shaper saturation"}; Configurable applyCellAbsScale{"applyCellAbsScale", 0, "Enable absolute cell energy scale to correct for energy loss in material in front of EMCal"}; - Configurable> vCellAbsScaleFactor{"cellAbsScaleFactor", {1.f}, "values for absolute cell energy calibration. Different values correspond to different regions or SM types of EMCal"}; + Configurable> cellAbsScaleFactors{"cellAbsScaleFactors", {1.f}, "values for absolute cell energy calibration. Different values correspond to different regions or SM types of EMCal"}; Configurable logWeight{"logWeight", 4.5, "logarithmic weight for the cluster center of gravity calculation"}; Configurable exoticCellFraction{"exoticCellFraction", 0.97, "Good cell if fraction < 1-ecross/ecell"}; Configurable exoticCellDiffTime{"exoticCellDiffTime", 1.e6, "If time of candidate to exotic and close cell is larger than exoticCellDiffTime (in ns), it must be noisy, set amp to 0"}; @@ -159,7 +162,7 @@ struct EmcalCorrectionTask { mClusterFactories.setExoticCellMinAmplitude(exoticCellMinAmplitude); mClusterFactories.setExoticCellInCrossMinAmplitude(exoticCellInCrossMinAmplitude); mClusterFactories.setUseWeightExotic(useWeightExotic); - for (auto& clusterDefinition : mClusterDefinitions) { + for (const auto& clusterDefinition : mClusterDefinitions) { mClusterizers.emplace_back(std::make_unique>(1E9, clusterDefinition.timeMin, clusterDefinition.timeMax, clusterDefinition.gradientCut, clusterDefinition.doGradientCut, clusterDefinition.seedEnergy, clusterDefinition.minCellEnergy)); LOG(info) << "Cluster definition initialized: " << clusterDefinition.toString(); LOG(info) << "timeMin: " << clusterDefinition.timeMin; @@ -169,7 +172,7 @@ struct EmcalCorrectionTask { LOG(info) << "minCellEnergy: " << clusterDefinition.minCellEnergy; LOG(info) << "storageID" << clusterDefinition.storageID; } - for (auto& clusterizer : mClusterizers) { + for (const auto& clusterizer : mClusterizers) { clusterizer->setGeometry(geometry); } @@ -194,39 +197,38 @@ struct EmcalCorrectionTask { // Setup QA hists. // NOTE: This is not comprehensive. - using o2HistType = o2::framework::HistType; - using o2Axis = o2::framework::AxisSpec; - o2Axis energyAxis{200, 0., 100., "E (GeV)"}, + using O2HistType = o2::framework::HistType; + o2::framework::AxisSpec energyAxis{200, 0., 100., "E (GeV)"}, timeAxis{300, -100, 200., "t (ns)"}, etaAxis{160, -0.8, 0.8, "#eta"}, phiAxis{72, 0, 2 * 3.14159, "phi"}, nlmAxis{50, -0.5, 49.5, "NLM"}; - mHistManager.add("hCellE", "hCellE", o2HistType::kTH1F, {energyAxis}); - mHistManager.add("hCellTowerID", "hCellTowerID", o2HistType::kTH1D, {{20000, 0, 20000}}); - mHistManager.add("hCellEtaPhi", "hCellEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); - mHistManager.add("hHGCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for high gain cells (low energies) - mHistManager.add("hLGCellTimeEnergy", "hCellTime", o2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for low gain cells (high energies) + mHistManager.add("hCellE", "hCellE", O2HistType::kTH1F, {energyAxis}); + mHistManager.add("hCellTowerID", "hCellTowerID", O2HistType::kTH1D, {{20000, 0, 20000}}); + mHistManager.add("hCellEtaPhi", "hCellEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis}); + mHistManager.add("hHGCellTimeEnergy", "hCellTime", O2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for high gain cells (low energies) + mHistManager.add("hLGCellTimeEnergy", "hCellTime", O2HistType::kTH2F, {{300, -30, 30}, cellEnergyBins}); // Cell time vs energy for low gain cells (high energies) // NOTE: Reversed column and row because it's more natural for presentation. - mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", o2HistType::kTH2D, {{96, -0.5, 95.5}, {208, -0.5, 207.5}}); - mHistManager.add("hClusterE", "hClusterE", o2HistType::kTH1F, {energyAxis}); - mHistManager.add("hClusterNLM", "hClusterNLM", o2HistType::kTH1F, {nlmAxis}); - mHistManager.add("hClusterEtaPhi", "hClusterEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); - mHistManager.add("hClusterTime", "hClusterTime", o2HistType::kTH1F, {timeAxis}); - mHistManager.add("hGlobalTrackEtaPhi", "hGlobalTrackEtaPhi", o2HistType::kTH2F, {etaAxis, phiAxis}); - mHistManager.add("hGlobalTrackMult", "hGlobalTrackMult", o2HistType::kTH1D, {{200, -0.5, 199.5, "N_{trk}"}}); - mHistManager.add("hCollisionType", "hCollisionType;;#it{count}", o2HistType::kTH1D, {{3, -0.5, 2.5}}); + mHistManager.add("hCellRowCol", "hCellRowCol;Column;Row", O2HistType::kTH2D, {{96, -0.5, 95.5}, {208, -0.5, 207.5}}); + mHistManager.add("hClusterE", "hClusterE", O2HistType::kTH1F, {energyAxis}); + mHistManager.add("hClusterNLM", "hClusterNLM", O2HistType::kTH1F, {nlmAxis}); + mHistManager.add("hClusterEtaPhi", "hClusterEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis}); + mHistManager.add("hClusterTime", "hClusterTime", O2HistType::kTH1F, {timeAxis}); + mHistManager.add("hGlobalTrackEtaPhi", "hGlobalTrackEtaPhi", O2HistType::kTH2F, {etaAxis, phiAxis}); + mHistManager.add("hGlobalTrackMult", "hGlobalTrackMult", O2HistType::kTH1D, {{200, -0.5, 199.5, "N_{trk}"}}); + mHistManager.add("hCollisionType", "hCollisionType;;#it{count}", O2HistType::kTH1D, {{3, -0.5, 2.5}}); auto hCollisionType = mHistManager.get(HIST("hCollisionType")); hCollisionType->GetXaxis()->SetBinLabel(1, "no collision"); hCollisionType->GetXaxis()->SetBinLabel(2, "normal collision"); hCollisionType->GetXaxis()->SetBinLabel(3, "mult. collisions"); - mHistManager.add("hClusterType", "hClusterType;;#it{count}", o2HistType::kTH1D, {{3, -0.5, 2.5}}); + mHistManager.add("hClusterType", "hClusterType;;#it{count}", O2HistType::kTH1D, {{3, -0.5, 2.5}}); auto hClusterType = mHistManager.get(HIST("hClusterType")); hClusterType->GetXaxis()->SetBinLabel(1, "no collision"); hClusterType->GetXaxis()->SetBinLabel(2, "normal collision"); hClusterType->GetXaxis()->SetBinLabel(3, "mult. collisions"); - mHistManager.add("hCollPerBC", "hCollPerBC;#it{N}_{coll.};#it{count}", o2HistType::kTH1D, {{100, -0.5, 99.5}}); - mHistManager.add("hBC", "hBC;;#it{count}", o2HistType::kTH1D, {{8, -0.5, 7.5}}); - mHistManager.add("hCollisionTimeReso", "hCollisionTimeReso;#Delta t_{coll};#it{count}", o2HistType::kTH1D, {{2000, 0, 2000}}); + mHistManager.add("hCollPerBC", "hCollPerBC;#it{N}_{coll.};#it{count}", O2HistType::kTH1D, {{100, -0.5, 99.5}}); + mHistManager.add("hBC", "hBC;;#it{count}", O2HistType::kTH1D, {{8, -0.5, 7.5}}); + mHistManager.add("hCollisionTimeReso", "hCollisionTimeReso;#Delta t_{coll};#it{count}", O2HistType::kTH1D, {{2000, 0, 2000}}); auto hBC = mHistManager.get(HIST("hBC")); hBC->GetXaxis()->SetBinLabel(1, "with EMCal cells"); hBC->GetXaxis()->SetBinLabel(2, "with EMCal cells but no collision"); @@ -237,8 +239,8 @@ struct EmcalCorrectionTask { hBC->GetXaxis()->SetBinLabel(7, "no EMCal cells and mult. collisions"); hBC->GetXaxis()->SetBinLabel(8, "all BC"); if (isMC) { - mHistManager.add("hContributors", "hContributors;contributor per cell hit;#it{counts}", o2HistType::kTH1I, {{20, 0, 20}}); - mHistManager.add("hMCParticleEnergy", "hMCParticleEnergy;#it{E} (GeV/#it{c});#it{counts}", o2HistType::kTH1F, {energyAxis}); + mHistManager.add("hContributors", "hContributors;contributor per cell hit;#it{counts}", O2HistType::kTH1I, {{20, 0, 20}}); + mHistManager.add("hMCParticleEnergy", "hMCParticleEnergy;#it{E} (GeV/#it{c});#it{counts}", O2HistType::kTH1F, {energyAxis}); } } @@ -247,7 +249,7 @@ struct EmcalCorrectionTask { // void process(aod::BCs const& bcs, aod::Collision const& collision, aod::Calos const& cells) // Appears to need the BC to be accessed to be available in the collision table... - void processFull(bcEvSels const& bcs, collEventSels const& collisions, myGlobTracks const& tracks, filteredCells const& cells) + void processFull(BcEvSels const& bcs, CollEventSels const& collisions, MyGlobTracks const& tracks, FilteredCells const& cells) { LOG(debug) << "Starting process full."; @@ -255,7 +257,7 @@ struct EmcalCorrectionTask { int nCellsProcessed = 0; std::unordered_map numberCollsInBC; // Number of collisions mapped to the global BC index of all BCs std::unordered_map numberCellsInBC; // Number of cells mapped to the global BC index of all BCs to check whether EMCal was readout - for (auto bc : bcs) { + for (const auto& bc : bcs) { LOG(debug) << "Next BC"; // Convert aod::Calo to o2::emcal::Cell which can be used with the clusterizer. // In particular, we need to filter only EMCAL cells. @@ -276,13 +278,13 @@ struct EmcalCorrectionTask { countBC(collisionsInFoundBC.size(), true); std::vector cellsBC; std::vector cellIndicesBC; - for (auto& cell : cellsInBC) { + for (const auto& cell : cellsInBC) { auto amplitude = cell.amplitude(); if (static_cast(hasShaperCorrection)) { amplitude = o2::emcal::NonlinearityHandler::evaluateShaperCorrectionCellEnergy(amplitude); } if (applyCellAbsScale) { - amplitude *= GetAbsCellScale(cell.cellNumber()); + amplitude *= getAbsCellScale(cell.cellNumber()); } cellsBC.emplace_back(cell.cellNumber(), amplitude, @@ -297,7 +299,7 @@ struct EmcalCorrectionTask { // TODO: Helpful for now, but should be removed. LOG(debug) << "Converted EMCAL cells"; - for (auto& cell : cellsBC) { + for (const auto& cell : cellsBC) { LOG(debug) << cell.getTower() << ": E: " << cell.getEnergy() << ", time: " << cell.getTimeStamp() << ", type: " << cell.getType(); } @@ -315,17 +317,17 @@ struct EmcalCorrectionTask { mHistManager.fill(HIST("hCollisionTimeReso"), col.collisionTimeRes()); mHistManager.fill(HIST("hCollPerBC"), 1); mHistManager.fill(HIST("hCollisionType"), 1); - math_utils::Point3D vertex_pos = {col.posX(), col.posY(), col.posZ()}; + math_utils::Point3D vertexPos = {col.posX(), col.posY(), col.posZ()}; std::vector> clusterToTrackIndexMap; std::vector> trackToClusterIndexMap; - std::tuple>, std::vector>> IndexMapPair{clusterToTrackIndexMap, trackToClusterIndexMap}; + std::tuple>, std::vector>> indexMapPair{clusterToTrackIndexMap, trackToClusterIndexMap}; std::vector trackGlobalIndex; - doTrackMatching(col, tracks, IndexMapPair, vertex_pos, trackGlobalIndex); + doTrackMatching(col, tracks, indexMapPair, vertexPos, trackGlobalIndex); // Store the clusters in the table where a matching collision could // be identified. - FillClusterTable(col, vertex_pos, iClusterizer, cellIndicesBC, IndexMapPair, trackGlobalIndex); + fillClusterTable(col, vertexPos, iClusterizer, cellIndicesBC, indexMapPair, trackGlobalIndex); } } } else { // ambiguous @@ -338,7 +340,7 @@ struct EmcalCorrectionTask { hasCollision = true; mHistManager.fill(HIST("hCollisionType"), 2); } - FillAmbigousClusterTable(bc, iClusterizer, cellIndicesBC, hasCollision); + fillAmbigousClusterTable(bc, iClusterizer, cellIndicesBC, hasCollision); } LOG(debug) << "Cluster loop done for clusterizer " << iClusterizer; @@ -349,7 +351,7 @@ struct EmcalCorrectionTask { // Loop through all collisions and fill emcalcollisionmatch with a boolean stating, whether the collision was ambiguous (not the only collision in its BC) for (const auto& collision : collisions) { - auto globalbcid = collision.foundBC_as().globalIndex(); + auto globalbcid = collision.foundBC_as().globalIndex(); auto foundColls = numberCollsInBC.find(globalbcid); auto foundCells = numberCellsInBC.find(globalbcid); if (foundColls != numberCollsInBC.end() && foundCells != numberCellsInBC.end()) { @@ -363,7 +365,7 @@ struct EmcalCorrectionTask { } PROCESS_SWITCH(EmcalCorrectionTask, processFull, "run full analysis", true); - void processMCFull(bcEvSels const& bcs, collEventSels const& collisions, myGlobTracks const& tracks, filteredMCCells const& cells, aod::StoredMcParticles_001 const&) + void processMCFull(BcEvSels const& bcs, CollEventSels const& collisions, MyGlobTracks const& tracks, FilteredMcCells const& cells, aod::StoredMcParticles_001 const&) { LOG(debug) << "Starting process full."; @@ -371,7 +373,7 @@ struct EmcalCorrectionTask { int nCellsProcessed = 0; std::unordered_map numberCollsInBC; // Number of collisions mapped to the global BC index of all BCs std::unordered_map numberCellsInBC; // Number of cells mapped to the global BC index of all BCs to check whether EMCal was readout - for (auto bc : bcs) { + for (const auto& bc : bcs) { LOG(debug) << "Next BC"; // Convert aod::Calo to o2::emcal::Cell which can be used with the clusterizer. // In particular, we need to filter only EMCAL cells. @@ -393,10 +395,10 @@ struct EmcalCorrectionTask { std::vector cellsBC; std::vector cellIndicesBC; std::vector cellLabels; - for (auto& cell : cellsInBC) { + for (const auto& cell : cellsInBC) { mHistManager.fill(HIST("hContributors"), cell.mcParticle_as().size()); auto cellParticles = cell.mcParticle_as(); - for (auto& cellparticle : cellParticles) { + for (const auto& cellparticle : cellParticles) { mHistManager.fill(HIST("hMCParticleEnergy"), cellparticle.e()); } auto amplitude = cell.amplitude(); @@ -417,7 +419,7 @@ struct EmcalCorrectionTask { // TODO: Helpful for now, but should be removed. LOG(debug) << "Converted EMCAL cells"; - for (auto& cell : cellsBC) { + for (const auto& cell : cellsBC) { LOG(debug) << cell.getTower() << ": E: " << cell.getEnergy() << ", time: " << cell.getTimeStamp() << ", type: " << cell.getType(); } @@ -434,17 +436,17 @@ struct EmcalCorrectionTask { if (col.foundBCId() == bc.globalIndex()) { mHistManager.fill(HIST("hCollPerBC"), 1); mHistManager.fill(HIST("hCollisionType"), 1); - math_utils::Point3D vertex_pos = {col.posX(), col.posY(), col.posZ()}; + math_utils::Point3D vertexPos = {col.posX(), col.posY(), col.posZ()}; std::vector> clusterToTrackIndexMap; std::vector> trackToClusterIndexMap; - std::tuple>, std::vector>> IndexMapPair{clusterToTrackIndexMap, trackToClusterIndexMap}; + std::tuple>, std::vector>> indexMapPair{clusterToTrackIndexMap, trackToClusterIndexMap}; std::vector trackGlobalIndex; - doTrackMatching(col, tracks, IndexMapPair, vertex_pos, trackGlobalIndex); + doTrackMatching(col, tracks, indexMapPair, vertexPos, trackGlobalIndex); // Store the clusters in the table where a matching collision could // be identified. - FillClusterTable(col, vertex_pos, iClusterizer, cellIndicesBC, IndexMapPair, trackGlobalIndex); + fillClusterTable(col, vertexPos, iClusterizer, cellIndicesBC, indexMapPair, trackGlobalIndex); } } } else { // ambiguous @@ -457,7 +459,7 @@ struct EmcalCorrectionTask { hasCollision = true; mHistManager.fill(HIST("hCollisionType"), 2); } - FillAmbigousClusterTable(bc, iClusterizer, cellIndicesBC, hasCollision); + fillAmbigousClusterTable(bc, iClusterizer, cellIndicesBC, hasCollision); } LOG(debug) << "Cluster loop done for clusterizer " << iClusterizer; } // end of clusterizer loop @@ -467,7 +469,7 @@ struct EmcalCorrectionTask { // Loop through all collisions and fill emcalcollisionmatch with a boolean stating, whether the collision was ambiguous (not the only collision in its BC) for (const auto& collision : collisions) { - auto globalbcid = collision.foundBC_as().globalIndex(); + auto globalbcid = collision.foundBC_as().globalIndex(); auto foundColls = numberCollsInBC.find(globalbcid); auto foundCells = numberCellsInBC.find(globalbcid); if (foundColls != numberCollsInBC.end() && foundCells != numberCellsInBC.end()) { @@ -480,12 +482,12 @@ struct EmcalCorrectionTask { LOG(detail) << "Processed " << nBCsProcessed << " BCs with " << nCellsProcessed << " cells"; } PROCESS_SWITCH(EmcalCorrectionTask, processMCFull, "run full analysis with MC info", false); - void processStandalone(aod::BCs const& bcs, aod::Collisions const& collisions, filteredCells const& cells) + void processStandalone(aod::BCs const& bcs, aod::Collisions const& collisions, FilteredCells const& cells) { LOG(debug) << "Starting process standalone."; int nBCsProcessed = 0; int nCellsProcessed = 0; - for (auto bc : bcs) { + for (const auto& bc : bcs) { LOG(debug) << "Next BC"; // Convert aod::Calo to o2::emcal::Cell which can be used with the clusterizer. // In particular, we need to filter only EMCAL cells. @@ -504,7 +506,7 @@ struct EmcalCorrectionTask { countBC(collisionsInBC.size(), true); std::vector cellsBC; std::vector cellIndicesBC; - for (auto& cell : cellsInBC) { + for (const auto& cell : cellsInBC) { cellsBC.emplace_back(cell.cellNumber(), cell.amplitude(), cell.time() + getCellTimeShift(cell.cellNumber(), cell.amplitude(), o2::emcal::intToChannelType(cell.cellType())), @@ -518,7 +520,7 @@ struct EmcalCorrectionTask { // TODO: Helpful for now, but should be removed. LOG(debug) << "Converted EMCAL cells"; - for (auto& cell : cellsBC) { + for (const auto& cell : cellsBC) { LOG(debug) << cell.getTower() << ": E: " << cell.getEnergy() << ", time: " << cell.getTimeStamp() << ", type: " << cell.getType(); } @@ -535,11 +537,11 @@ struct EmcalCorrectionTask { for (const auto& col : collisionsInBC) { mHistManager.fill(HIST("hCollPerBC"), 1); mHistManager.fill(HIST("hCollisionType"), 1); - math_utils::Point3D vertex_pos = {col.posX(), col.posY(), col.posZ()}; + math_utils::Point3D vertexPos = {col.posX(), col.posY(), col.posZ()}; // Store the clusters in the table where a matching collision could // be identified. - FillClusterTable(col, vertex_pos, iClusterizer, cellIndicesBC); + fillClusterTable(col, vertexPos, iClusterizer, cellIndicesBC); } } else { // ambiguous // LOG(warning) << "No vertex found for event. Assuming (0,0,0)."; @@ -551,7 +553,7 @@ struct EmcalCorrectionTask { hasCollision = true; mHistManager.fill(HIST("hCollisionType"), 2); } - FillAmbigousClusterTable(bc, iClusterizer, cellIndicesBC, hasCollision); + fillAmbigousClusterTable(bc, iClusterizer, cellIndicesBC, hasCollision); } LOG(debug) << "Cluster loop done for clusterizer " << iClusterizer; @@ -599,7 +601,7 @@ struct EmcalCorrectionTask { } template - void FillClusterTable(Collision const& col, math_utils::Point3D const& vertex_pos, size_t iClusterizer, const gsl::span cellIndicesBC, std::optional>, std::vector>>> const& IndexMapPair = std::nullopt, std::optional> const& trackGlobalIndex = std::nullopt) + void fillClusterTable(Collision const& col, math_utils::Point3D const& vertexPos, size_t iClusterizer, const gsl::span cellIndicesBC, std::optional>, std::vector>>> const& indexMapPair = std::nullopt, std::optional> const& trackGlobalIndex = std::nullopt) { // we found a collision, put the clusters into the none ambiguous table clusters.reserve(mAnalysisClusters.size()); @@ -611,7 +613,7 @@ struct EmcalCorrectionTask { for (const auto& cluster : mAnalysisClusters) { // Determine the cluster eta, phi, correcting for the vertex position. auto pos = cluster.getGlobalPosition(); - pos = pos - vertex_pos; + pos = pos - vertexPos; // Normalize the vector and rescale by energy. pos *= (cluster.E() / std::sqrt(pos.Mag2())); @@ -651,11 +653,11 @@ struct EmcalCorrectionTask { mHistManager.fill(HIST("hClusterNLM"), cluster.getNExMax()); mHistManager.fill(HIST("hClusterTime"), cluster.getClusterTime()); mHistManager.fill(HIST("hClusterEtaPhi"), pos.Eta(), TVector2::Phi_0_2pi(pos.Phi())); - if (IndexMapPair && trackGlobalIndex) { - for (unsigned int iTrack = 0; iTrack < std::get<0>(*IndexMapPair)[iCluster].size(); iTrack++) { - if (std::get<0>(*IndexMapPair)[iCluster][iTrack] >= 0) { - LOG(debug) << "Found track " << (*trackGlobalIndex)[std::get<0>(*IndexMapPair)[iCluster][iTrack]] << " in cluster " << cluster.getID(); - matchedTracks(clusters.lastIndex(), (*trackGlobalIndex)[std::get<0>(*IndexMapPair)[iCluster][iTrack]]); + if (indexMapPair && trackGlobalIndex) { + for (unsigned int iTrack = 0; iTrack < std::get<0>(*indexMapPair)[iCluster].size(); iTrack++) { + if (std::get<0>(*indexMapPair)[iCluster][iTrack] >= 0) { + LOG(debug) << "Found track " << (*trackGlobalIndex)[std::get<0>(*indexMapPair)[iCluster][iTrack]] << " in cluster " << cluster.getID(); + matchedTracks(clusters.lastIndex(), (*trackGlobalIndex)[std::get<0>(*indexMapPair)[iCluster][iTrack]]); } } } @@ -664,7 +666,7 @@ struct EmcalCorrectionTask { } template - void FillAmbigousClusterTable(BC const& bc, size_t iClusterizer, const gsl::span cellIndicesBC, bool hasCollision) + void fillAmbigousClusterTable(BC const& bc, size_t iClusterizer, const gsl::span cellIndicesBC, bool hasCollision) { int cellindex = -1; clustersAmbiguous.reserve(mAnalysisClusters.size()); @@ -706,23 +708,23 @@ struct EmcalCorrectionTask { } template - void doTrackMatching(Collision const& col, myGlobTracks const& tracks, std::tuple>, std::vector>>& IndexMapPair, math_utils::Point3D& vertex_pos, std::vector& trackGlobalIndex) + void doTrackMatching(Collision const& col, MyGlobTracks const& tracks, std::tuple>, std::vector>>& indexMapPair, math_utils::Point3D& vertexPos, std::vector& trackGlobalIndex) { auto groupedTracks = tracks.sliceBy(perCollision, col.globalIndex()); - int NTracksInCol = groupedTracks.size(); + int nTracksInCol = groupedTracks.size(); std::vector trackPhi; std::vector trackEta; // reserve memory to reduce on the fly memory allocation - trackPhi.reserve(NTracksInCol); - trackEta.reserve(NTracksInCol); - trackGlobalIndex.reserve(NTracksInCol); - FillTrackInfo(groupedTracks, trackPhi, trackEta, trackGlobalIndex); + trackPhi.reserve(nTracksInCol); + trackEta.reserve(nTracksInCol); + trackGlobalIndex.reserve(nTracksInCol); + fillTrackInfo(groupedTracks, trackPhi, trackEta, trackGlobalIndex); - int NClusterInCol = mAnalysisClusters.size(); + int nClusterInCol = mAnalysisClusters.size(); std::vector clusterPhi; std::vector clusterEta; - clusterPhi.reserve(NClusterInCol); - clusterEta.reserve(NClusterInCol); + clusterPhi.reserve(nClusterInCol); + clusterEta.reserve(nClusterInCol); // TODO one loop that could in principle be combined with the other // loop to improve performance @@ -730,40 +732,40 @@ struct EmcalCorrectionTask { // Determine the cluster eta, phi, correcting for the vertex // position. auto pos = cluster.getGlobalPosition(); - pos = pos - vertex_pos; + pos = pos - vertexPos; // Normalize the vector and rescale by energy. pos *= (cluster.E() / std::sqrt(pos.Mag2())); clusterPhi.emplace_back(TVector2::Phi_0_2pi(pos.Phi())); clusterEta.emplace_back(pos.Eta()); } - IndexMapPair = + indexMapPair = jetutilities::MatchClustersAndTracks(clusterPhi, clusterEta, trackPhi, trackEta, maxMatchingDistance, 20); } template - void FillTrackInfo(Tracks const& tracks, std::vector& trackPhi, std::vector& trackEta, std::vector& trackGlobalIndex) + void fillTrackInfo(Tracks const& tracks, std::vector& trackPhi, std::vector& trackEta, std::vector& trackGlobalIndex) { - int NTrack = 0; - for (auto& track : tracks) { + int nTrack = 0; + for (const auto& track : tracks) { // TODO only consider tracks in current emcal/dcal acceptanc if (!track.isGlobalTrack()) { // only global tracks continue; } - NTrack++; + nTrack++; trackPhi.emplace_back(TVector2::Phi_0_2pi(track.trackPhiEmcal())); trackEta.emplace_back(track.trackEtaEmcal()); mHistManager.fill(HIST("hGlobalTrackEtaPhi"), track.trackEtaEmcal(), TVector2::Phi_0_2pi(track.trackPhiEmcal())); trackGlobalIndex.emplace_back(track.globalIndex()); } - mHistManager.fill(HIST("hGlobalTrackMult"), NTrack); + mHistManager.fill(HIST("hGlobalTrackMult"), nTrack); } - void countBC(int numberOfCollisions, bool hasEMCcells) + void countBC(int numberOfCollisions, bool hasEMCCells) { - int emcDataOffset = hasEMCcells ? 0 : 3; + int emcDataOffset = hasEMCCells ? 0 : 3; int collisionOffset = 2; switch (numberOfCollisions) { case 0: @@ -777,7 +779,7 @@ struct EmcalCorrectionTask { break; } mHistManager.fill(HIST("hBC"), 7); // All collisions - if (hasEMCcells) { + if (hasEMCCells) { mHistManager.fill(HIST("hBC"), 0); } mHistManager.fill(HIST("hBC"), 1 + emcDataOffset + collisionOffset); @@ -787,7 +789,7 @@ struct EmcalCorrectionTask { { // Cell QA // For convenience, use the clusterizer stored geometry to get the eta-phi - for (auto& cell : cellsBC) { + for (const auto& cell : cellsBC) { mHistManager.fill(HIST("hCellE"), cell.getEnergy()); if (cell.getLowGain()) mHistManager.fill(HIST("hLGCellTimeEnergy"), cell.getTimeStamp(), cell.getEnergy()); @@ -802,18 +804,18 @@ struct EmcalCorrectionTask { } } - float GetAbsCellScale(const int cellID) + float getAbsCellScale(const int cellID) { // Apply cell scale based on SM types (Full, Half (not used), EMC 1/3, DCal, DCal 1/3) // Same as in Run2 data if (applyCellAbsScale == 1) { int iSM = mClusterizers.at(0)->getGeometry()->GetSuperModuleNumber(cellID); - return vCellAbsScaleFactor.value[mClusterizers.at(0)->getGeometry()->GetSMType(iSM)]; + return cellAbsScaleFactors.value[mClusterizers.at(0)->getGeometry()->GetSMType(iSM)]; // Apply cell scale based on columns to accoutn for material of TRD structures } else if (applyCellAbsScale == 2) { auto res = mClusterizers.at(0)->getGeometry()->GlobalRowColFromIndex(cellID); - return vCellAbsScaleFactor.value[std::get<1>(res)]; + return cellAbsScaleFactors.value[std::get<1>(res)]; } else { return 1.f; } @@ -822,41 +824,50 @@ struct EmcalCorrectionTask { // Apply shift of the cell time in data and MC // In MC this has to be done to shift the cell time, which is not calibrated to 0 due to the flight time of the particles to the EMCal surface (~15ns) // In data this is done to correct for the time walk effect - float getCellTimeShift(const int16_t cellID, const float cellEnergy, const o2::emcal::ChannelType_t cellType) + float getCellTimeShift(const int16_t cellID, const float cellEnergy, const emcal::ChannelType_t cellType) { if (!applyCellTimeCorrection) { return 0.f; } float timeshift = 0.f; float timesmear = 0.f; - if (isMC) { + if (isMC) { // ---> MC // Shift the time to 0, as the TOF was simulated -> eta dependent shift (as larger eta values are further away from collision point) // Use distance between vertex and EMCal (at eta = 0) and distance on EMCal surface (cell size times column) to calculate distance to cell // 0.2 is cell size in m (0.06) divided by the speed of light in m/ns (0.3) - 47.5 is the "middle" of the EMCal (2*48 cells in one column) float timeCol = 0.2f * (geometry->GlobalCol(cellID) - 47.5f); // calculate time to get to specific column - timeshift = -sqrt(215.f + timeCol * timeCol); // 215 is 14.67ns^2 (time it takes to get the cell at eta = 0) + timeshift = -std::sqrt(215.f + timeCol * timeCol); // 215 is 14.67ns^2 (time it takes to get the cell at eta = 0) + // Also smear the time to account for the broader time resolution in data than in MC - timesmear = normalgaus(rdgen) * (1.6 + 9.5 * TMath::Exp(-3. * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods - } else { // data - if (cellEnergy < 0.3) { // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration - timeshift = 0.; - } else if (cellType == o2::emcal::ChannelType_t::HIGH_GAIN) { // High gain cells -> Low energies - if (cellEnergy < 4.) // Low energy regime - timeshift = 0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods - else // Medium energy regime - timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods - } else if (cellType == o2::emcal::ChannelType_t::LOW_GAIN) { // Low gain cells -> High energies - timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), will be updated by LHC24aj input + if (cellEnergy < 0.3) // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration + timesmear = 0.; // They will therefore not be smeared and only get their shift + else if (cellType == emcal::ChannelType_t::HIGH_GAIN) // High gain cells -> Low energies + timesmear = normalgaus(rdgen) * (1.6 + 9.5 * std::exp(-3. * cellEnergy)); // Parameters extracted from LHC24f3b & LHC22o (pp), but also usable for other periods + else if (cellType == emcal::ChannelType_t::LOW_GAIN) // Low gain cells -> High energies + timesmear = normalgaus(rdgen) * (5.0); // Parameters extracted from LHC24g4 & LHC24aj (pp), but also usable for other periods + + } else { // ---> Data + if (cellEnergy < 0.3) { // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration + timeshift = 0.; // In data they will not be shifted (they are close to 0 anyways) + } else if (cellType == emcal::ChannelType_t::HIGH_GAIN) { // High gain cells -> Low energies + if (cellEnergy < 4.) // Low energy regime + timeshift = 0.8 * std::log(2.7 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods + else // Medium energy regime + timeshift = 1.5 * std::log(0.9 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods + } else if (cellType == emcal::ChannelType_t::LOW_GAIN) { // Low gain cells -> High energies + if (cellEnergy < 30.) // High energy regime + timeshift = 1.9 * std::log(0.09 * cellEnergy); // Parameters extracted from LHC24aj (pp), but also usable for other periods + else // Very high energy regime + timeshift = 1.9; // Parameters extracted from LHC24aj (pp), but also usable for other periods } + LOG(debug) << "Shift the cell time by " << timeshift << " + " << timesmear << " ns"; + return timeshift + timesmear; } - - LOG(debug) << "Shift the cell time by " << timeshift << " + " << timesmear << " ns"; - return timeshift + timesmear; - } + }; }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc, TaskName{"emcal-correction-task"})}; + adaptAnalysisTask(cfgc)}; } From 7c258d3fae5fd8ab169b23de773851f874660bfb Mon Sep 17 00:00:00 2001 From: Sandeep Dudi <69388148+sdudi123@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:34:29 +0530 Subject: [PATCH 248/459] [PWGUD] mixed event bkg added (#8812) Co-authored-by: Sandeep Dudi --- PWGUD/Tasks/sginclusivePhiKstarSD.cxx | 314 ++++++++++++++++++++++---- 1 file changed, 266 insertions(+), 48 deletions(-) diff --git a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx index 90b692a9af3..29cab7ee483 100644 --- a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx +++ b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx @@ -13,21 +13,27 @@ // \since May 2024 #include +#include +#include +#include +#include +#include "Math/Vector4D.h" +#include "Math/Vector3D.h" +#include "Math/GenVector/Boost.h" + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" #include "Framework/ASoA.h" #include "Framework/ASoAHelpers.h" +#include "ReconstructionDataFormats/Vertex.h" + #include "PWGUD/DataModel/UDTables.h" #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" +#include "PWGUD/Core/UPCHelpers.h" + #include "Common/DataModel/PIDResponse.h" -#include -#include "TLorentzVector.h" -#include -#include "Math/Vector4D.h" -#include "Math/Vector3D.h" -#include "Math/GenVector/Boost.h" using namespace std; using namespace o2; @@ -59,17 +65,22 @@ struct SGResonanceAnalyzer { Configurable itsChi2_cut{"itsChi2_cut", 36, "Max itsChi2NCl"}; Configurable eta_cut{"eta_cut", 0.9, "Track Pseudorapidity"}; Configurable pt_cut{"pt_cut", 0.15, "Track pt cut"}; + Configurable pt1{"pt1", 0.3, "pid selection pt1"}; + Configurable pt2{"pt2", 0.4, "pid selection pt2"}; + Configurable pt3{"pt3", 0.5, "pid selection pt3"}; Configurable EtaGapMin{"EtaGapMin", 0.0, "Track eta min"}; Configurable EtaGapMax{"EtaGapMax", 0.9, "Track eta min"}; Configurable EtaDG{"EtaDG", 0.5, "Track eta DG"}; + Configurable nsigmatpc_cut1{"nsigmatpc1", 3.0, "nsigma tpc cut1"}; + Configurable nsigmatpc_cut2{"nsigmatpc2", 3.0, "nsigma tpc cut2"}; + Configurable nsigmatpc_cut3{"nsigmatpc3", 3.0, "nsigma tpc cut3"}; Configurable nsigmatpc_cut{"nsigmatpc", 3.0, "nsigma tpc cut"}; Configurable nsigmatof_cut{"nsigmatof", 9.0, "nsigma tof cut"}; Configurable mintrack{"min_track", 1, "min track"}; Configurable maxtrack{"max_track", 50, "max track"}; - Configurable use_tof{"Use_TOF", true, "TOF PID"}; Configurable QA{"QA", true, ""}; Configurable rapidity_gap{"rapidity_gap", true, ""}; @@ -78,17 +89,32 @@ struct SGResonanceAnalyzer { Configurable rho{"rho", true, ""}; Configurable kstar{"kstar", true, ""}; Configurable fourpion{"fourpion", true, ""}; + + Configurable cfgNoMixedEvents{"cfgNoMixedEvents", 1, "Number of mixed events per event"}; + Configurable nBkgRotations{"nBkgRotations", 9, "Number of rotated copies (background) per each original candidate"}; + Configurable fillRotation{"fillRotation", true, "fill rotation"}; + Configurable confMinRot{"confMinRot", 5.0 * TMath::Pi() / 6.0, "Minimum of rotation"}; + Configurable confMaxRot{"confMaxRot", 7.0 * TMath::Pi() / 6.0, "Maximum of rotation"}; + void init(InitContext const&) { registry.add("GapSide", "Gap Side; Entries", kTH1F, {{4, -1.5, 2.5}}); registry.add("TrueGapSide", "Gap Side; Entries", kTH1F, {{4, -1.5, 2.5}}); if (phi) { - registry.add("os_KK_pT_0", "pt kaon pair", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_KK_pT_1", "pt kaon pair", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_KK_pT_2", "pt kaon pair", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_KK_ls_pT_0", "kaon pair like sign", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_KK_ls_pT_1", "kaon pair like sign", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_KK_ls_pT_2", "kaon pair like sign", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_pT_0", "pt kaon pair", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_pT_1", "pt kaon pair", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_pT_2", "pt kaon pair", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_ls_pT_0", "kaon pair like sign", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_ls_pT_1", "kaon pair like sign", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_ls_pT_2", "kaon pair like sign", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + + registry.add("os_KK_mix_pT_0", "kaon pair mix event", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_mix_pT_1", "kaon pair mix event", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_mix_pT_2", "kaon pair mix event", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + + registry.add("os_KK_rot_pT_0", "kaon pair mix event", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_rot_pT_1", "kaon pair mix event", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_KK_rot_pT_2", "kaon pair mix event", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); } if (rho) { registry.add("os_pp_pT_0", "pt pion pair", kTH3F, {{120, 1.44, 2.04}, {80, -2.0, 2.0}, {100, 0, 10}}); @@ -102,13 +128,26 @@ struct SGResonanceAnalyzer { registry.add("os_pk_pT_0", "pion-kaon pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); registry.add("os_pk_pT_1", "pion-kaon pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); registry.add("os_pk_pT_2", "pion-kaon pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + + registry.add("os_pk_mix_pT_0", "pion-kaon mix pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_pk_mix_pT_1", "pion-kaon mix pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_pk_mix_pT_2", "pion-kaon mix pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + + registry.add("os_pk_rot_pT_0", "pion-kaon rotional pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_pk_rot_pT_1", "pion-kaon rotional pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_pk_rot_pT_2", "pion-kaon rotional pair", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_pk_ls_pT_0", "pion-kaon pair like sign", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); registry.add("os_pk_ls_pT_1", "pion-kaon like sign", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); registry.add("os_pk_ls_pT_2", "pion-kaon like sign", kTH3F, {{400, 0.0, 2.0}, {80, -2.0, 2.0}, {100, 0, 10}}); + + registry.add("hRotation", "hRotation", kTH1F, {{360, 0.0, 2.0 * TMath::Pi()}}); } // QA plots if (QA) { registry.add("tpc_dedx", "p vs dE/dx", kTH2F, {{100, 0.0, 10.0}, {5000, 0.0, 5000.0}}); + registry.add("tof_beta", "p vs beta", kTH2F, {{100, 0.0, 10.0}, {5000, 0.0, 5000.0}}); + registry.add("tpc_dedx_kaon", "p#k dE/dx", kTH2F, {{100, 0.0, 10.0}, {5000, 0.0, 5000.0}}); registry.add("tpc_dedx_pion", "p#pi dE/dx", kTH2F, {{100, 0.0, 10.0}, {5000, 0.0, 5000.0}}); registry.add("tpc_dedx_kaon_1", "tpc+tof pid cut p#k dE/dx", kTH2F, {{100, 0.0, 10.0}, {5000, 0.0, 5000.0}}); @@ -119,6 +158,9 @@ struct SGResonanceAnalyzer { registry.add("tpc_tof_nsigma_kaon", "p#k n#sigma TPC vs TOF", kTH2F, {{100, -10.0, 10.0}, {100, -10.0, 10.0}}); registry.add("tpc_tof_nsigma_pion", "p#pi n#sigma TPC vs TOF", kTH2F, {{100, -10.0, 10.0}, {100, -10.0, 10.0}}); + registry.add("tof_nsigma_kaon", "p#k n#sigma", kTH2F, {{100, 0.0, 10.0}, {100, -10.0, 10.0}}); + registry.add("tof_nsigma_pion", "p#pi n#sigma", kTH2F, {{100, 0.0, 10.0}, {100, -10.0, 10.0}}); + registry.add("FT0A", "T0A amplitude", kTH1F, {{500, 0.0, 500.0}}); registry.add("FT0A_0", "T0A amplitude", kTH1F, {{500, 0.0, 500.0}}); registry.add("FT0A_1", "T0A amplitude", kTH1F, {{20000, 0.0, 20000.0}}); @@ -150,31 +192,32 @@ struct SGResonanceAnalyzer { registry.add("rap2_mult3", "rap2_mult3", kTH1F, {{150, 0, 150}}); } } + registry.add("gap_mult0", "Mult 0", kTH1F, {{100, 0.0, 100.0}}); registry.add("gap_mult1", "Mult 1", kTH1F, {{100, 0.0, 100.0}}); registry.add("gap_mult2", "Mult 2", kTH1F, {{100, 0.0, 100.0}}); // Multiplicity plot if (rapidity_gap && phi) { - registry.add("os_kk_mass_rap", "phi mass1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass_rap1", "phi mass2", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass_rap2", "phi mass3", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass1_rap", "phi mass1 gap1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass1_rap1", "phi mass2 gap1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass1_rap2", "phi mass3 gap1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass2_rap", "phi mass1 DG", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass2_rap1", "phi mass2 DG", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_mass2_rap2", "phi mass3 DG", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass_rap", "phi mass1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass_rap1", "phi mass2", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass_rap2", "phi mass3", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass1_rap", "phi mass1 gap1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass1_rap1", "phi mass2 gap1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass1_rap2", "phi mass3 gap1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass2_rap", "phi mass1 DG", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass2_rap1", "phi mass2 DG", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_mass2_rap2", "phi mass3 DG", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); // like sign bkg - registry.add("os_kk_ls_mass_rap", "phi ls mass1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass_rap1", "phi ls mass2", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass_rap2", "phi ls mass3", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass1_rap", "phi ls mass1 gap1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass1_rap1", "phi ls mass2 gap1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass1_rap2", "phi ls mass3 gap1", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass2_rap", "phi ls mass1 DG", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass2_rap1", "phi ls mass2 DG", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); - registry.add("os_kk_ls_mass2_rap2", "phi ls mass3 DG", kTH3F, {{220, 0.98, 1.12}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass_rap", "phi ls mass1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass_rap1", "phi ls mass2", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass_rap2", "phi ls mass3", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass1_rap", "phi ls mass1 gap1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass1_rap1", "phi ls mass2 gap1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass1_rap2", "phi ls mass3 gap1", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass2_rap", "phi ls mass1 DG", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass2_rap1", "phi ls mass2 DG", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); + registry.add("os_kk_ls_mass2_rap2", "phi ls mass3 DG", kTH3F, {{220, 0.98, 1.2}, {80, -2.0, 2.0}, {100, 0, 10}}); } if (rapidity_gap && kstar) { @@ -246,6 +289,53 @@ struct SGResonanceAnalyzer { Double_t CosThetaCS = zaxis_CS.Dot((v1_CM)); return CosThetaCS; } + + template + bool selectionPIDKaon1(const T& candidate) + { + auto pt = TMath::Sqrt(candidate.px() * candidate.px() + candidate.py() * candidate.py()); + // float pt1, pt2, pt3 , nsigmatpc_cut1, nsigmatpc_cut2, nsigmatpc_cut3; + if (use_tof && pt < pt1 && std::abs(candidate.tpcNSigmaKa()) < nsigmatpc_cut1) { + return true; + } + if (use_tof && pt >= pt1 && pt < pt2 && std::abs(candidate.tpcNSigmaKa()) < nsigmatpc_cut2) { + return true; + } + if (use_tof && pt >= pt2 && pt < pt3 && std::abs(candidate.tpcNSigmaKa()) < nsigmatpc_cut3) { + return true; + } + if (pt > pt3 && use_tof && candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < nsigmatof_cut) { + return true; + } + if (!use_tof && std::abs(candidate.tpcNSigmaKa()) < nsigmatpc_cut) { + return true; + } + return false; + } + + template + bool selectionPIDPion1(const T& candidate) + { + auto pt = TMath::Sqrt(candidate.px() * candidate.px() + candidate.py() * candidate.py()); + + if (use_tof && pt < pt1 && std::abs(candidate.tpcNSigmaPi()) < nsigmatpc_cut1) { + return true; + } + if (use_tof && pt >= pt1 && pt < pt2 && std::abs(candidate.tpcNSigmaPi()) < nsigmatpc_cut2) { + return true; + } + if (use_tof && pt >= pt2 && pt < pt3 && std::abs(candidate.tpcNSigmaPi()) < nsigmatpc_cut3) { + return true; + } + if (pt > pt3 && use_tof && candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < nsigmatof_cut) { + return true; + } + if (!use_tof && std::abs(candidate.tpcNSigmaPi()) < nsigmatpc_cut) { + return true; + } + return false; + } + //------------------------------------------------------------------------------------------------------ Double_t PhiCollinsSoperFrame(ROOT::Math::PtEtaPhiMVector pair1, ROOT::Math::PtEtaPhiMVector pair2, ROOT::Math::PtEtaPhiMVector fourpion) { @@ -285,6 +375,11 @@ struct SGResonanceAnalyzer { TLorentzVector v1; TLorentzVector v01; TLorentzVector v0_1; + int gapSide = collision.gapSide(); + float FIT_cut[5] = {FV0_cut, FT0A_cut, FT0C_cut, FDDA_cut, FDDC_cut}; + std::vector parameters = {PV_cut, dcaZ_cut, dcaXY_cut, tpcChi2_cut, tpcNClsFindable_cut, itsChi2_cut, eta_cut, pt_cut}; + int truegapSide = sgSelector.trueGap(collision, FIT_cut[0], FIT_cut[1], FIT_cut[2], ZDC_cut); + ROOT::Math::PtEtaPhiMVector phiv; ROOT::Math::PtEtaPhiMVector phiv1; @@ -297,10 +392,6 @@ struct SGResonanceAnalyzer { std::vector onlyPionTracks_n; std::vector rawPionTracks_n; - int gapSide = collision.gapSide(); - float FIT_cut[5] = {FV0_cut, FT0A_cut, FT0C_cut, FDDA_cut, FDDC_cut}; - std::vector parameters = {PV_cut, dcaZ_cut, dcaXY_cut, tpcChi2_cut, tpcNClsFindable_cut, itsChi2_cut, eta_cut, pt_cut}; - int truegapSide = sgSelector.trueGap(collision, FIT_cut[0], FIT_cut[1], FIT_cut[2], ZDC_cut); registry.fill(HIST("GapSide"), gapSide); registry.fill(HIST("TrueGapSide"), truegapSide); gapSide = truegapSide; @@ -331,7 +422,7 @@ struct SGResonanceAnalyzer { continue; v0.SetXYZM(track1.px(), track1.py(), track1.pz(), o2::constants::physics::MassPionCharged); ROOT::Math::PtEtaPhiMVector vv1(v0.Pt(), v0.Eta(), v0.Phi(), o2::constants::physics::MassPionCharged); - if (selectionPIDPion(track1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (selectionPIDPion1(track1)) { onlyPionTracks_pm.push_back(vv1); rawPionTracks_pm.push_back(track1); if (track1.sign() == 1) { @@ -371,20 +462,24 @@ struct SGResonanceAnalyzer { if (QA) { registry.fill(HIST("tpc_dedx"), v0.P(), track1.tpcSignal()); + registry.fill(HIST("tof_beta"), v0.P(), track1.beta()); + registry.fill(HIST("tof_nsigma_kaon"), v0.Pt(), track1.tofNSigmaKa()); + registry.fill(HIST("tof_nsigma_pion"), v0.Pt(), track1.tofNSigmaPi()); + if (std::abs(track1.tpcNSigmaKa()) < 3.0) { registry.fill(HIST("tpc_dedx_kaon"), v0.P(), track1.tpcSignal()); } else if (std::abs(track1.tpcNSigmaPi()) < 3.0) { registry.fill(HIST("tpc_dedx_pion"), v0.P(), track1.tpcSignal()); } - if (selectionPIDKaon(track1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (selectionPIDKaon1(track1)) { registry.fill(HIST("tpc_dedx_kaon_1"), v0.P(), track1.tpcSignal()); registry.fill(HIST("tpc_nsigma_kaon"), v0.Pt(), track1.tpcNSigmaKa()); registry.fill(HIST("tpc_tof_nsigma_kaon"), track1.tpcNSigmaKa(), track1.tofNSigmaKa()); } - if (selectionPIDKaon(track1, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(track1.tpcNSigmaPi()) > 3.0) { + if (selectionPIDKaon1(track1) && std::abs(track1.tpcNSigmaPi()) > 3.0) { registry.fill(HIST("tpc_dedx_kaon_2"), v0.P(), track1.tpcSignal()); } - if (selectionPIDPion(track1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (selectionPIDPion1(track1)) { registry.fill(HIST("tpc_dedx_pion_1"), v0.P(), track1.tpcSignal()); registry.fill(HIST("tpc_nsigma_pion"), v0.Pt(), track1.tpcNSigmaPi()); registry.fill(HIST("tpc_tof_nsigma_pion"), track1.tpcNSigmaPi(), track1.tofNSigmaPi()); @@ -467,7 +562,7 @@ struct SGResonanceAnalyzer { for (auto& [t0, t1] : combinations(tracks, tracks)) { if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) continue; - if (phi && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && selectionPIDKaon(t1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (phi && selectionPIDKaon1(t0) && selectionPIDKaon1(t1)) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassKaonCharged); @@ -496,7 +591,7 @@ struct SGResonanceAnalyzer { } } } - if (kstar && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion(t1, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t1.tpcNSigmaKa()) > 3.0) { + if (kstar && selectionPIDKaon1(t0) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(t1) && std::abs(t1.tpcNSigmaKa()) > 3.0) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); @@ -532,7 +627,7 @@ struct SGResonanceAnalyzer { for (auto& [t0, t1] : combinations(tracks, tracks)) { if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) continue; - if (phi && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && selectionPIDKaon(t1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (phi && selectionPIDKaon1(t0) && selectionPIDKaon1(t1)) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassKaonCharged); @@ -561,7 +656,7 @@ struct SGResonanceAnalyzer { } } } - if (kstar && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion(t1, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t1.tpcNSigmaKa()) > 3.0) { + if (kstar && selectionPIDKaon1(t0) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(t1) && std::abs(t1.tpcNSigmaKa()) > 3.0) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); @@ -596,7 +691,7 @@ struct SGResonanceAnalyzer { for (auto& [t0, t1] : combinations(tracks, tracks)) { if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) continue; - if (phi && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && selectionPIDKaon(t1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (phi && selectionPIDKaon1(t0) && selectionPIDKaon1(t1)) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassKaonCharged); @@ -625,7 +720,7 @@ struct SGResonanceAnalyzer { } } } - if (kstar && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion(t1, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t1.tpcNSigmaKa()) > 3.0) { + if (kstar && selectionPIDKaon1(t0) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(t1) && std::abs(t1.tpcNSigmaKa()) > 3.0) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); @@ -661,7 +756,7 @@ struct SGResonanceAnalyzer { for (auto& [t0, t1] : combinations(tracks, tracks)) { if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) continue; - if (phi && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && selectionPIDKaon(t1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (phi && selectionPIDKaon1(t0) && selectionPIDKaon1(t1)) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassKaonCharged); @@ -690,8 +785,36 @@ struct SGResonanceAnalyzer { registry.fill(HIST("os_KK_ls_pT_2"), v01.M(), v01.Rapidity(), v01.Pt()); } } + + if (fillRotation) { + for (int nrotbkg = 0; nrotbkg < nBkgRotations; nrotbkg++) { + auto anglestart = confMinRot; + auto angleend = confMaxRot; + auto anglestep = (angleend - anglestart) / (1.0 * (nBkgRotations - 1)); + auto rotangle = anglestart + nrotbkg * anglestep; + registry.fill(HIST("hRotation"), rotangle); + + auto rotkaonPx = t0.px() * std::cos(rotangle) - t0.py() * std::sin(rotangle); + auto rotkaonPy = t0.px() * std::sin(rotangle) + t0.py() * std::cos(rotangle); + + v0.SetXYZM(rotkaonPx, rotkaonPy, t0.pz(), o2::constants::physics::MassKaonCharged); + v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassKaonCharged); + v01 = v0 + v1; + if (t0.sign() != t1.sign()) { + if (gapSide == 0) { + registry.fill(HIST("os_KK_rot_pT_0"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (gapSide == 1) { + registry.fill(HIST("os_KK_rot_pT_1"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (gapSide == 2) { + registry.fill(HIST("os_KK_rot_pT_2"), v01.M(), v01.Rapidity(), v01.Pt()); + } + } + } + } } - if (rho && selectionPIDProton(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && selectionPIDPion(t1, use_tof, nsigmatpc_cut, nsigmatof_cut)) { + if (rho && selectionPIDPion1(t0) && selectionPIDPion1(t1)) { v0.SetXYZM(t0.px(), t0.py(), t0.pz(), mproton); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); v01 = v0 + v1; @@ -719,7 +842,7 @@ struct SGResonanceAnalyzer { } } } - if (kstar && selectionPIDKaon(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion(t1, use_tof, nsigmatpc_cut, nsigmatof_cut) && std::abs(t1.tpcNSigmaKa()) > 3.0) { + if (kstar && selectionPIDKaon1(t0) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(t1) && std::abs(t1.tpcNSigmaKa()) > 3.0) { v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); v01 = v0 + v1; @@ -746,6 +869,33 @@ struct SGResonanceAnalyzer { registry.fill(HIST("os_pk_ls_pT_2"), v01.M(), v01.Rapidity(), v01.Pt()); } } + if (fillRotation) { + for (int nrotbkg = 0; nrotbkg < nBkgRotations; nrotbkg++) { + auto anglestart = confMinRot; + auto angleend = confMaxRot; + auto anglestep = (angleend - anglestart) / (1.0 * (nBkgRotations - 1)); + auto rotangle = anglestart + nrotbkg * anglestep; + registry.fill(HIST("hRotation"), rotangle); + + auto rotkaonPx = t0.px() * std::cos(rotangle) - t0.py() * std::sin(rotangle); + auto rotkaonPy = t0.px() * std::sin(rotangle) + t0.py() * std::cos(rotangle); + + v0.SetXYZM(rotkaonPx, rotkaonPy, t0.pz(), o2::constants::physics::MassKaonCharged); + v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); + v01 = v0 + v1; + if (t0.sign() != t1.sign()) { + if (gapSide == 0) { + registry.fill(HIST("os_pk_rot_pT_0"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (gapSide == 1) { + registry.fill(HIST("os_pk_rot_pT_1"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (gapSide == 2) { + registry.fill(HIST("os_pk_rot_pT_2"), v01.M(), v01.Rapidity(), v01.Pt()); + } + } + } + } } } if (fourpion) { @@ -791,6 +941,74 @@ struct SGResonanceAnalyzer { } } } + PROCESS_SWITCH(SGResonanceAnalyzer, process, "Process unlike event", false); + + using UDCollisionsFull1 = soa::Join; // + SliceCache cache; + Partition posTracks = aod::udtrack::sign > 0; + Partition negTracks = aod::udtrack::sign < 0; + + ConfigurableAxis axisVertex{"axisVertex", {10, -10, 10}, "vertex axis for bin"}; + ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {10, 0, 100}, "multiplicity percentile for bin"}; + using BinningTypeVertexContributor = ColumnBinningPolicy; + void mixprocess(UDCollisionsFull1 const& collisions, udtracksfull const& track) + { + TLorentzVector v0; + TLorentzVector v1; + TLorentzVector v01; + float FIT_cut[5] = {FV0_cut, FT0A_cut, FT0C_cut, FDDA_cut, FDDC_cut}; + std::vector parameters = {PV_cut, dcaZ_cut, dcaXY_cut, tpcChi2_cut, tpcNClsFindable_cut, itsChi2_cut, eta_cut, pt_cut}; + BinningTypeVertexContributor binningOnPositions{{axisVertex, axisMultiplicityClass}, true}; + for (auto const& [collision1, collision2] : o2::soa::selfCombinations(binningOnPositions, cfgNoMixedEvents, -1, collisions, collisions)) { + int truegapSide1 = sgSelector.trueGap(collision1, FIT_cut[0], FIT_cut[1], FIT_cut[2], ZDC_cut); + int truegapSide2 = sgSelector.trueGap(collision2, FIT_cut[0], FIT_cut[1], FIT_cut[2], ZDC_cut); + if (truegapSide1 != truegapSide2) + continue; + if (truegapSide1 == -1) + continue; + auto posThisColl = posTracks->sliceByCached(aod::udtrack::udCollisionId, collision1.globalIndex(), cache); + auto negThisColl = negTracks->sliceByCached(aod::udtrack::udCollisionId, collision2.globalIndex(), cache); + for (auto& [track1, track2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(posThisColl, negThisColl))) { + if (!trackselector(track1, parameters) || !trackselector(track2, parameters)) + continue; + if (selectionPIDKaon1(track1) && selectionPIDKaon1(track2)) { + v0.SetXYZM(track1.px(), track1.py(), track1.pz(), o2::constants::physics::MassKaonCharged); + v1.SetXYZM(track2.px(), track2.py(), track2.pz(), o2::constants::physics::MassKaonCharged); + v01 = v0 + v1; + // Opposite sign pairs + if (track1.sign() != track2.sign()) { + if (truegapSide1 == 0) { + registry.fill(HIST("os_KK_mix_pT_0"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (truegapSide1 == 1) { + registry.fill(HIST("os_KK_mix_pT_1"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (truegapSide1 == 2) { + registry.fill(HIST("os_KK_mix_pT_2"), v01.M(), v01.Rapidity(), v01.Pt()); + } + } + } + if (selectionPIDKaon1(track1) && std::abs(track1.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(track2) && std::abs(track2.tpcNSigmaKa()) > 3.0) { + v0.SetXYZM(track1.px(), track1.py(), track1.pz(), o2::constants::physics::MassKaonCharged); + v1.SetXYZM(track2.px(), track2.py(), track2.pz(), o2::constants::physics::MassPionCharged); + v01 = v0 + v1; + // Opposite sign pairs + if (track1.sign() != track2.sign()) { + if (truegapSide1 == 0) { + registry.fill(HIST("os_pk_mix_pT_0"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (truegapSide1 == 1) { + registry.fill(HIST("os_pk_mix_pT_1"), v01.M(), v01.Rapidity(), v01.Pt()); + } + if (truegapSide1 == 2) { + registry.fill(HIST("os_pk_mix_pT_2"), v01.M(), v01.Rapidity(), v01.Pt()); + } + } + } + } + } + } + PROCESS_SWITCH(SGResonanceAnalyzer, mixprocess, "Process Mixed event", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 1fd92eb6eeac45cacf94c6be4cbbfc113664f1de Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:29:49 +0100 Subject: [PATCH 249/459] =?UTF-8?q?[PWGDQ]=20Revert=20"[PWGDQ]=20Adding=20?= =?UTF-8?q?Tprofiles=20with=20Cumulants=20weights=20+=20fixing=20Pi=20cons?= =?UTF-8?q?tant=20=E2=80=A6"=20(#8818)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PWGDQ/Core/HistogramsLibrary.cxx | 88 ++++++++++++++++++++------------ PWGDQ/Core/HistogramsLibrary.h | 1 - 2 files changed, 55 insertions(+), 34 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 13ba242d8e8..4bc43fe386e 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -13,7 +13,6 @@ // #include "PWGDQ/Core/HistogramsLibrary.h" #include "VarManager.h" -#include "CommonConstants/MathConstants.h" void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* histClass, const char* groupName, const char* subGroupName) { @@ -276,9 +275,6 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "Run2_centrFT0C_Corr2REFetagap_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "Run2_centrFT0C_Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2Corr4REF_ev", "Run2_centrFT0C_Corr2Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2CORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); - hm->AddHistogram(histClass, "centrFT0C_M11REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 1000000.0, VarManager::kM11REF); - hm->AddHistogram(histClass, "centrFT0C_M11etagap_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 10000000.0, VarManager::kM11REFetagap); - hm->AddHistogram(histClass, "centrFT0C_M1111REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 100000000000000.0, VarManager::kM1111REF); if (subGroupStr.Contains("cross")) { hm->AddHistogram(histClass, "Q1ZNACXX_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACXX); hm->AddHistogram(histClass, "Q1ZNACYY_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACYY); @@ -384,8 +380,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (!groupStr.CompareTo("track")) { hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); - hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi); hm->AddHistogram(histClass, "IsPVcontrib_pt", "is PV contributor vs pt", false, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); hm->AddHistogram(histClass, "IsPVcontrib_pt_prof", "is PV contributor vs pt", true, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); if (subGroupStr.Contains("ambiguity") && !subGroupStr.Contains("muon")) { @@ -397,10 +393,10 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("cent")) { hm->AddHistogram(histClass, "Pt_CentFT0C", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt, 20, 0.0, 100.0, VarManager::kCentFT0C); hm->AddHistogram(histClass, "Eta_CentFT0C", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta, 20, 0.0, 100.0, VarManager::kCentFT0C); - hm->AddHistogram(histClass, "Phi_CentFT0C", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi, 20, 0.0, 100.0, VarManager::kCentFT0C); + hm->AddHistogram(histClass, "Phi_CentFT0C", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi, 20, 0.0, 100.0, VarManager::kCentFT0C); } if (subGroupStr.Contains("kine")) { - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); hm->AddHistogram(histClass, "Eta_Pt", "", false, 20, -1.0, 1.0, VarManager::kEta, 100, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta_VtxZ", "", false, 100, -1.0, 1.0, VarManager::kEta, 300, -15.0, 15.0, VarManager::kVtxZ); hm->AddHistogram(histClass, "Px", "p_{x} distribution", false, 200, 0.0, 20.0, VarManager::kPx); @@ -459,8 +455,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("tpc")) { hm->AddHistogram(histClass, "TPCncls", "Number of cluster in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCncls_vsTimeFromSOR", "Number of cluster in TPC vs time from SOR", true, 10000, 0.0, 1000., VarManager::kTimeFromSOR, 160, -0.5, 159.5, VarManager::kTPCncls); - hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); - hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCnclsCR", "Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCnclsCR); hm->AddHistogram(histClass, "TPCncls_TPCnclsCR", "Number of TPC cluster vs Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls, 160, -0.5, 159.5, VarManager::kTPCnclsCR); hm->AddHistogram(histClass, "IsTPCrefit", "", false, 2, -0.5, 1.5, VarManager::kIsTPCrefit); @@ -773,14 +769,14 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "MCHBitMap_vs_pt", "MCH vs pt", false, 1025, 0.0, 1025.0, VarManager::kMCHBitMap, 400, 0, 100, VarManager::kPt); hm->AddHistogram(histClass, "MuonTime", "", false, 100, -1.0, 1.0, VarManager::kMuonTime); hm->AddHistogram(histClass, "MuonTimeRes", "", false, 100, -1.0, 1.0, VarManager::kMuonTimeRes); - hm->AddHistogram(histClass, "MuonDcaX_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); - hm->AddHistogram(histClass, "MuonDcaY_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "MuonDcaX_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "MuonDcaY_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); hm->AddHistogram(histClass, "MuonDcaX_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "MuonDcaY_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 500, -5.0, 5.0, VarManager::kEta); } else { hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); hm->AddHistogram(histClass, "AmbiguityInBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsInBunch); hm->AddHistogram(histClass, "AmbiguityOutOfBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsOutOfBunch); hm->AddHistogram(histClass, "AmbiguityInBunch_pt", "in bunch collision ambiguity vs p_{T}", false, 50, 0.0, 10.0, VarManager::kPt, 10, 0., 10., VarManager::kMuonNAssocsInBunch); @@ -803,7 +799,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("mc")) { hm->AddHistogram(histClass, "Pt_vs_PtMC", "pT vs MC pT", false, 200, 0.0, 20.0, VarManager::kPt, 200, 0.0, 20.0, VarManager::kMCPt); hm->AddHistogram(histClass, "Eta_vs_EtaMC", "#eta vs MC #eta", false, 50, -1.0, 1.0, VarManager::kEta, 50, -1.0, 1.0, VarManager::kMCEta); - hm->AddHistogram(histClass, "Phi_vs_PhiMC", "#varphi vs MC #varphi", false, 50, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 50, 0.0, o2::constants::math::TwoPI, VarManager::kMCPhi); + hm->AddHistogram(histClass, "Phi_vs_PhiMC", "#varphi vs MC #varphi", false, 50, 0.0, 2. * TMath::Pi(), VarManager::kPhi, 50, 0.0, 2. * TMath::Pi(), VarManager::kMCPhi); hm->AddHistogram(histClass, "TrackPDGcode", "PDG code of track", false, 10001, -5000, 5000, VarManager::kMCPdgCode); } if (subGroupStr.Contains("mcmother")) { @@ -824,7 +820,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt_lepton1", "", false, 100, -2.0, 2.0, VarManager::kEta1, 200, 0.0, 20.0, VarManager::kPt1); hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2); hm->AddHistogram(histClass, "Eta_Pt_Photon", "", false, 100, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kPairEta, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPairPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kPairEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPairPhi); hm->AddHistogram(histClass, "Mass_Dilepton", "", false, 4500, 0.0, 4.5, VarManager::kPairMassDau); hm->AddHistogram(histClass, "Mass_Photon", "", false, 500, 0.0, 0.1, VarManager::kMassDau); hm->AddHistogram(histClass, "Mass_Dilepton_Mass_Photon", "", false, 500, 0.0, 5.0, VarManager::kPairMassDau, 500, 0.0, 5.0, VarManager::kMassDau); @@ -846,7 +842,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2); hm->AddHistogram(histClass, "Mass", "", false, 500, 0.0, 5.0, VarManager::kMass); hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); } if (!groupStr.CompareTo("mctruth_track")) { hm->AddHistogram(histClass, "PtMC", "MC pT", false, 200, 0.0, 20.0, VarManager::kMCPt); @@ -891,12 +887,12 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("polarization")) { hm->AddHistogram(histClass, "cosThetaHE", "", false, 100, -1., 1., VarManager::kCosThetaHE); hm->AddHistogram(histClass, "cosThetaCS", "", false, 100, -1., 1., VarManager::kCosThetaCS); - hm->AddHistogram(histClass, "PhiHE", "", false, 100, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiHE); - hm->AddHistogram(histClass, "PhiCS", "", false, 100, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiCS); + hm->AddHistogram(histClass, "PhiHE", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kPhiHE); + hm->AddHistogram(histClass, "PhiCS", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kPhiCS); hm->AddHistogram(histClass, "Mass_Pt_cosThetaHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -1., 1., VarManager::kCosThetaHE); hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -1., 1., VarManager::kCosThetaCS); - hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiHE); - hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiCS); + hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -TMath::Pi(), TMath::Pi(), VarManager::kPhiHE); + hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -TMath::Pi(), TMath::Pi(), VarManager::kPhiCS); } if (subGroupStr.Contains("upsilon")) { hm->AddHistogram(histClass, "MassUpsilon_Pt", "", false, 500, 7.0, 12.0, VarManager::kMass, 400, 0.0, 40.0, VarManager::kPt); @@ -1060,6 +1056,18 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS_phiCS", "", 4, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE); hm->AddHistogram(histClass, "Mass_y_cosThetaCS_phiCS", "", 4, varsrapCS, binsy, xminy, xmaxy, 0, -1, kFALSE); } + if (subGroupStr.Contains("dimuon-polarization-vp")) { + int varspTCS[3] = {VarManager::kMass, VarManager::kPt, VarManager::kPhiVP}; + int varsrapCS[3] = {VarManager::kMass, VarManager::kRap, VarManager::kPhiVP}; + int binspT[3] = {100, 20, 24}; + int binsy[3] = {100, 10, 24}; + double xminpT[3] = {1., 0., 0.}; + double xmaxpT[3] = {5., 20., +3.14}; + double xminy[3] = {1., 2.5, 0.}; + double xmaxy[3] = {5., 4.0, +3.14}; + hm->AddHistogram(histClass, "Mass_Pt_phiVP", "", 3, varspTCS, binspT, xminpT, xmaxpT, 0, -1, kFALSE); + hm->AddHistogram(histClass, "Mass_y_phiVP", "", 3, varsrapCS, binsy, xminy, xmaxy, 0, -1, kFALSE); + } if (subGroupStr.Contains("dimuon-rap")) { int vars[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kRap}; int binspT[4] = {150, 200, 10, 6}; @@ -1095,6 +1103,20 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h double xmaxpT[5] = {1.2, 3., 100, 1., 3.14}; hm->AddHistogram(histClass, "Mass_Pt_Cent_cosThetaCS_lowmass", "", 5, varsCSpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); } + if (subGroupStr.Contains("dimuon-polarization-vp-pbpb")) { + int varsHEpbpb[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kPhiVP}; + int binspT[4] = {150, 30, 10, 24}; + double xminpT[4] = {2., 0., 0, 0.}; + double xmaxpT[4] = {5., 3., 100, 3.14}; + hm->AddHistogram(histClass, "Mass_Pt_Cent_phiVP", "", 4, varsHEpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); + } + if (subGroupStr.Contains("dimuon-polarization-lowmass-vp-pbpb")) { + int varsHEpbpb[4] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kPhiVP}; + int binspT[4] = {200, 30, 10, 24}; + double xminpT[4] = {0.2, 0., 0, 0.}; + double xmaxpT[4] = {1.2, 3., 100, 3.14}; + hm->AddHistogram(histClass, "Mass_Pt_Cent_phiVP_lowmass", "", 4, varsHEpbpb, binspT, xminpT, xmaxpT, 0, -1, kFALSE); + } if (subGroupStr.Contains("dimuon-rap-polarization-he-pbpb")) { int varsHEpbpb[5] = {VarManager::kMass, VarManager::kPt, VarManager::kCentFT0C, VarManager::kCosThetaHE, VarManager::kRap}; int binspT[5] = {150, 30, 10, 10, 6}; @@ -1226,19 +1248,19 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "DeltaPhiPair", "", false, 130, -6.5, 6.5, VarManager::kDeltaPhiPair); } if (subGroupStr.Contains("correlation-emu")) { - hm->AddHistogram(histClass, "DeltaPhiPair2", "", false, 600, -o2::constants::math::PIHalf, 1.5 * o2::constants::math::PI, VarManager::kDeltaPhiPair2); + hm->AddHistogram(histClass, "DeltaPhiPair2", "", false, 600, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), VarManager::kDeltaPhiPair2); hm->AddHistogram(histClass, "DeltaEtaPair2", "", false, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); - hm->AddHistogram(histClass, "DeltaPhiPair2_DeltaEtaPair2", "", false, 600, -o2::constants::math::PIHalf, 1.5 * o2::constants::math::PI, VarManager::kDeltaPhiPair2, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); + hm->AddHistogram(histClass, "DeltaPhiPair2_DeltaEtaPair2", "", false, 600, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), VarManager::kDeltaPhiPair2, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); } if (subGroupStr.Contains("dielectrons")) { if (subGroupStr.Contains("prefilter")) { hm->AddHistogram(histClass, "MassLow_OpeningAngle", "", false, 150, 0., 0.15, VarManager::kMass, 80, 0., 0.8, VarManager::kOpeningAngle); } if (subGroupStr.Contains("phiv")) { - hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, o2::constants::math::PI, VarManager::kPairPhiv); + hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, TMath::Pi(), VarManager::kPairPhiv); } if (subGroupStr.Contains("double-phi-v")) { - hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, o2::constants::math::PI, VarManager::kPairPhiv, "", "", "", -1, -1, true); + hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, TMath::Pi(), VarManager::kPairPhiv, "", "", "", -1, -1, true); } if (subGroupStr.Contains("largemass-phi-v")) { // binning for mee at large scales: @@ -1265,7 +1287,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h // steps of size pi/100 double phiv_bins[101]; for (int i = 0; i <= 100; i++) - phiv_bins[i] = o2::constants::math::PI / 100. * i; + phiv_bins[i] = TMath::Pi() / 100. * i; int nbins_phiv = sizeof(phiv_bins) / sizeof(*phiv_bins) - 1; // 3D histo @@ -1454,29 +1476,29 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.EqualTo("jpsitomumu")) { hm->AddHistogram(histClass, "hMassVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 50, -4.5f, -2.0f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); } else if (subGroupStr.EqualTo("jpsitoee")) { hm->AddHistogram(histClass, "hMassVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 60, -1.5f, 1.5f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsi", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); } else if (subGroupStr.EqualTo("dmeson")) { hm->AddHistogram(histClass, "hMassVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 200, 1.7f, 2.1f, VarManager::kMassCharmHadron); hm->AddHistogram(histClass, "hRapVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 60, -1.5f, 1.5f, VarManager::kRapCharmHadron); - hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., o2::constants::math::TwoPI, VarManager::kPhiCharmHadron); + hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmeson", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., 2 * constants::math::PI, VarManager::kPhiCharmHadron); } else if (subGroupStr.EqualTo("jpsitomumudmeson")) { hm->AddHistogram(histClass, "hMassVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 50, -4.5f, -2.0f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "hMassVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 200, 1.7f, 2.1f, VarManager::kMassCharmHadron); hm->AddHistogram(histClass, "hRapVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 60, -1.5f, 1.5f, VarManager::kRapCharmHadron); - hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., o2::constants::math::TwoPI, VarManager::kPhiCharmHadron); + hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., 2 * constants::math::PI, VarManager::kPhiCharmHadron); } else if (subGroupStr.EqualTo("jpsitoeedmeson")) { hm->AddHistogram(histClass, "hMassVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 300, 2.f, 5.f, VarManager::kMass); hm->AddHistogram(histClass, "hRapVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 60, -1.5f, 1.5f, VarManager::kRap); - hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "hPhiVsPtJPsiWithDmeson", "", false, 100, 0.f, 50.f, VarManager::kPt, 180, -constants::math::PI, constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "hMassVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 200, 1.7f, 2.1f, VarManager::kMassCharmHadron); hm->AddHistogram(histClass, "hRapVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 60, -1.5f, 1.5f, VarManager::kRapCharmHadron); - hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., o2::constants::math::TwoPI, VarManager::kPhiCharmHadron); + hm->AddHistogram(histClass, "hPhiVsPtVsBdtDmesonWithJPsi", "", false, 100, 0.f, 1.f, VarManager::kBdtCharmHadron, 100, 0.f, 50.f, VarManager::kPtCharmHadron, 180, 0., 2 * constants::math::PI, VarManager::kPhiCharmHadron); } } if (!groupStr.CompareTo("dilepton-dihadron")) { @@ -1538,7 +1560,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Pt_Photon", "p_{T} distribution", false, 4500, 0.0, 4.5, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "Eta_Pt", "", false, 100, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -o2::constants::math::TwoPI, o2::constants::math::TwoPI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); hm->AddHistogram(histClass, "Mass_Photon", "", false, 500, 0.0, 0.1, VarManager::kMassDau); hm->AddHistogram(histClass, "Mass_Pt", "", false, 500, 0.0, 5.0, VarManager::kMassDau, 200, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Rapidity", "", false, 400, -4.0, 4.0, VarManager::kRap); diff --git a/PWGDQ/Core/HistogramsLibrary.h b/PWGDQ/Core/HistogramsLibrary.h index aa53a2674cc..60fe4cc8714 100644 --- a/PWGDQ/Core/HistogramsLibrary.h +++ b/PWGDQ/Core/HistogramsLibrary.h @@ -18,7 +18,6 @@ #include #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/VarManager.h" -#include "CommonConstants/MathConstants.h" namespace o2::aod { From 5dfcdf4a7d8c83b191ea8ef1f618147a399c2504 Mon Sep 17 00:00:00 2001 From: rolavick Date: Thu, 5 Dec 2024 02:34:29 +0100 Subject: [PATCH 250/459] [PWGUD] update of personal task (#8819) --- PWGUD/Tasks/upcTauCentralBarrelRL.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx index 5b80f5972ae..819301ea6a1 100644 --- a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx +++ b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx @@ -2148,27 +2148,27 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("Events/Truth/hNmuons"))->Fill(countMuons); histos.get(HIST("Events/Truth/hNpions"))->Fill(countPions); - if (countElectrons == 2) + if (countElectrons == 2 && countMuons == 0 && countPions == 0) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EE); - if (countElectrons == 1 && countMuons == 1) + if (countElectrons == 1 && countMuons == 1 && countPions == 0) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMU); - if (countElectrons == 1 && countPions == 1) + if (countElectrons == 1 && countMuons == 0 && countPions == 1) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EPI); - if ((countElectrons == 1 && countMuons == 1) || (countElectrons == 1 && countPions == 1)) + if ((countElectrons == 1 && countMuons == 1 && countPions == 0) || (countElectrons == 1 && countMuons == 0 && countPions == 1)) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_EMUPI); - if (countMuons == 2) + if (countElectrons == 0 && countMuons == 2 && countPions == 0) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUMU); - if (countMuons == 1 && countPions == 1) + if (countElectrons == 0 && countMuons == 1 && countPions == 1) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUPI); - if (countPions == 2) + if (countElectrons == 0 && countMuons == 0 && countPions == 2) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_PIPI); - if (countPions == 4) + if (countElectrons == 0 && countMuons == 0 && countPions == 4) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_FOURPI); - if (countPions == 3 && countElectrons == 1) + if (countElectrons == 1 && countMuons == 0 && countPions == 3) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_ETHREEPI); - if (countPions == 3 && countMuons == 1) + if (countElectrons == 0 && countMuons == 1 && countPions == 3) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_MUTHREEPI); - if (countPions == 6) + if (countElectrons == 0 && countMuons == 0 && countPions == 6) histos.get(HIST("Events/Truth/hChannels"))->Fill(CH_SIXPI); } From 08342bf8b98c0147829fac56ef65f29b3fb8448b Mon Sep 17 00:00:00 2001 From: Katarzyna <116073883+kgwizdzi@users.noreply.github.com> Date: Thu, 5 Dec 2024 03:57:44 +0100 Subject: [PATCH 251/459] [PWGCF] FemtoUniverse - D0 task update (#8821) --- .../Tasks/femtoUniversePairTaskTrackD0.cxx | 391 +++++++++--------- 1 file changed, 198 insertions(+), 193 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx index 273ff0e629e..a994a047157 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx @@ -26,7 +26,6 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/StepTHn.h" #include "Framework/O2DatabasePDGPlugin.h" -#include "TDatabasePDG.h" #include "ReconstructionDataFormats/PID.h" #include "Common/DataModel/PIDResponse.h" @@ -53,11 +52,11 @@ using namespace o2::soa; namespace { -static constexpr int nPart = 2; -static constexpr int nCuts = 5; +static constexpr int kNPart = 2; +static constexpr int kNCuts = 5; static const std::vector partNames{"D0", "Track"}; static const std::vector cutNames{"MaxPt", "PIDthr", "nSigmaTPC", "nSigmaTPCTOF", "MaxP"}; -static const float cutsTable[nPart][nCuts]{{4.05f, 1.f, 3.f, 3.f, 100.f}, {4.05f, 1.f, 3.f, 3.f, 100.f}}; +static const float cutsTable[kNPart][kNCuts]{{4.05f, 1.f, 3.f, 3.f, 100.f}, {4.05f, 1.f, 3.f, 3.f, 100.f}}; } // namespace /// Returns deltaPhi value within the range [-pi/2, 3/2*pi] @@ -73,16 +72,13 @@ double wrapDeltaPhi0PI(double phiD, double phiDbar) { double deltaPhi = 0.0; deltaPhi = RecoDecay::constrainAngle(phiDbar - phiD, 0.0); - if (deltaPhi < 0.) { - deltaPhi = deltaPhi + o2::constants::math::TwoPI; - } if (deltaPhi > o2::constants::math::TwoPI) { deltaPhi = o2::constants::math::TwoPI - deltaPhi; } return deltaPhi; } -struct femtoUniversePairTaskTrackD0 { +struct FemtoUniversePairTaskTrackD0 { using FemtoFullParticles = soa::Join; SliceCache cache; @@ -90,56 +86,55 @@ struct femtoUniversePairTaskTrackD0 { /// Table for both particles struct : o2::framework::ConfigurableGroup { - Configurable ConfNsigmaCombinedProton{"ConfNsigmaCombinedProton", 3.0, "TPC and TOF Proton Sigma (combined) for momentum > 0.5"}; - Configurable ConfNsigmaTPCProton{"ConfNsigmaTPCProton", 3.0, "TPC Proton Sigma for momentum < 0.5"}; - Configurable ConfNsigmaCombinedPion{"ConfNsigmaCombinedPion", 3.0, "TPC and TOF Pion Sigma (combined) for momentum > 0.5"}; - Configurable ConfNsigmaTPCPion{"ConfNsigmaTPCPion", 3.0, "TPC Pion Sigma for momentum < 0.5"}; - - Configurable> ConfCutTable{"ConfCutTable", {cutsTable[0], nPart, nCuts, partNames, cutNames}, "Particle selections"}; - Configurable ConfNspecies{"ConfNspecies", 2, "Number of particle spieces with PID info"}; - Configurable ConfIsMC{"ConfIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; - Configurable> ConfTrkPIDnSigmaMax{"ConfTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; - Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; - Configurable ConfPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"}; - Configurable ConfEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"}; + Configurable confNsigmaCombinedProton{"confNsigmaCombinedProton", 3.0, "TPC and TOF Proton Sigma (combined) for momentum > 0.5"}; + Configurable confNsigmaTPCProton{"confNsigmaTPCProton", 3.0, "TPC Proton Sigma for momentum < 0.5"}; + Configurable confNsigmaCombinedPion{"confNsigmaCombinedPion", 3.0, "TPC and TOF Pion Sigma (combined) for momentum > 0.5"}; + Configurable confNsigmaTPCPion{"confNsigmaTPCPion", 3.0, "TPC Pion Sigma for momentum < 0.5"}; + + Configurable> confCutTable{"confCutTable", {cutsTable[0], kNPart, kNCuts, partNames, cutNames}, "Particle selections"}; + Configurable confNspecies{"confNspecies", 2, "Number of particle spieces with PID info"}; + Configurable confIsMC{"confIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; + Configurable> confTrkPIDnSigmaMax{"confTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; + Configurable confUse3D{"confUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; + Configurable confPhiBins{"confPhiBins", 29, "Number of phi bins in deta dphi"}; + Configurable confEtaBins{"confEtaBins", 29, "Number of eta bins in deta dphi"}; } ConfBothTracks; /// Particle 1 --- IDENTIFIED TRACK struct : o2::framework::ConfigurableGroup { - Configurable ConfIsSame{"ConfIsSame", false, "Pairs of the same particle"}; - Configurable ConfPDGCodeTrack{"ConfPDGCodeTrack", 2212, "Particle 2 - PDG code"}; - Configurable ConfPIDTrack{"ConfPIDTrack", 2, "Particle 2 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> - Configurable ConfTrackSign{"ConfTrackSign", 1, "Track sign"}; - Configurable ConfIsTrackIdentified{"ConfIsTrackIdentified", true, "Enable PID for the track"}; - Configurable ConfTrackLowPtCut{"ConfTrackLowPtCut", 0.5, "Low pT cut of the track"}; - Configurable ConfTrackHighPtCut{"ConfTrackHighPtCut", 2.5, "High pT cut of the track"}; + Configurable confIsSame{"confIsSame", false, "Pairs of the same particle"}; + Configurable confPDGCodeTrack{"confPDGCodeTrack", 2212, "Particle 2 - PDG code"}; + Configurable confPIDTrack{"confPIDTrack", 2, "Particle 2 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> + Configurable confTrackSign{"confTrackSign", 1, "Track sign"}; + Configurable confIsTrackIdentified{"confIsTrackIdentified", true, "Enable PID for the track"}; + Configurable confTrackLowPtCut{"confTrackLowPtCut", 0.5, "Low pT cut of the track"}; + Configurable confTrackHighPtCut{"confTrackHighPtCut", 2.5, "High pT cut of the track"}; } ConfTrack; /// Particle 2 --- D0/D0bar meson struct : o2::framework::ConfigurableGroup { - Configurable ConfPDGCodeD0{"ConfPDGCodeD0", 421, "D0 meson - PDG code"}; - Configurable ConfPDGCodeD0bar{"ConfPDGCodeD0bar", -421, "D0bar meson - PDG code"}; - Configurable ConfMinPtD0D0bar{"ConfMinPtD0D0bar", 3.0, "D0/D0bar sel. - min. pT"}; - Configurable ConfMaxPtD0D0bar{"ConfMaxPtD0D0bar", 5.0, "D0/D0bar sel. - max. pT"}; - Configurable ConfMinInvMassD0D0bar{"ConfMinInvMassD0D0bar", 1.65, "D0/D0bar sel. - min. invMass"}; - Configurable ConfMaxInvMassD0D0bar{"ConfMaxInvMassD0D0bar", 2.05, "D0/D0bar sel. - max. invMass"}; + Configurable confPDGCodeD0{"confPDGCodeD0", 421, "D0 meson - PDG code"}; + Configurable confPDGCodeD0bar{"confPDGCodeD0bar", -421, "D0bar meson - PDG code"}; + Configurable confMinPtD0D0bar{"confMinPtD0D0bar", 1.0, "D0/D0bar sel. - min. pT"}; + Configurable confMaxPtD0D0bar{"confMaxPtD0D0bar", 3.0, "D0/D0bar sel. - max. pT"}; + Configurable confMinInvMassD0D0bar{"confMinInvMassD0D0bar", 1.65, "D0/D0bar sel. - min. invMass"}; + Configurable confMaxInvMassD0D0bar{"confMaxInvMassD0D0bar", 2.05, "D0/D0bar sel. - max. invMass"}; } ConfDmesons; struct : o2::framework::ConfigurableGroup { - Configurable ConfSignalRegionMin{"ConfSignalRegionMin", 1.810, "Min. inv. mass for D0/D0bar in the signal region"}; - Configurable ConfSignalRegionMax{"ConfSignalRegionMax", 1.922, "Max. inv. mass for D0/D0bar in the signal region"}; - Configurable ConfMinInvMassLeftSB{"ConfMinInvMassLeftSB", 1.642, "Min. inv. mass for D0/D0bar in the left sideband region"}; - Configurable ConfMaxInvMassLeftSB{"ConfMaxInvMassLeftSB", 1.754, "Max. inv. mass for D0/D0bar in the left sideband region"}; - Configurable ConfMinInvMassRightSB{"ConfMinInvMassRightSB", 1.978, "Min. inv. mass for D0/D0bar in the right sideband region"}; - Configurable ConfMaxInvMassRightSB{"ConfMaxInvMassRightSB", 2.090, "Max. inv. mass for D0/D0bar in the right sideband region"}; + Configurable confSignalRegionMin{"confSignalRegionMin", 1.810, "Min. inv. mass for D0/D0bar in the signal region"}; + Configurable confSignalRegionMax{"confSignalRegionMax", 1.922, "Max. inv. mass for D0/D0bar in the signal region"}; + Configurable confMinInvMassLeftSB{"confMinInvMassLeftSB", 1.642, "Min. inv. mass for D0/D0bar in the left sideband region"}; + Configurable confMaxInvMassLeftSB{"confMaxInvMassLeftSB", 1.754, "Max. inv. mass for D0/D0bar in the left sideband region"}; + Configurable confMinInvMassRightSB{"confMinInvMassRightSB", 1.978, "Min. inv. mass for D0/D0bar in the right sideband region"}; + Configurable confMaxInvMassRightSB{"confMaxInvMassRightSB", 2.090, "Max. inv. mass for D0/D0bar in the right sideband region"}; } ConfD0D0barSideBand; Configurable> binsPt{"binsPt", std::vector{hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits"}; - Configurable ConfChooseD0trackCorr{"ConfChooseD0trackCorr", 3, "If 0 - only D0s, 1 - only D0bars, 2 - D0/D0bar (one mass hypo.), 3 - all D0/D0bar cand."}; - Configurable ConfUseMassCutForD0D0bar{"ConfUseMassCutForD0D0bar", false, "Switch to save D0/D0bar within declared inv. mass range"}; + Configurable confChooseD0trackCorr{"confChooseD0trackCorr", 2, "If 0 - only D0s, 1 - only D0bars, 2 - D0/D0bar (one mass hypo.), 3 - all D0/D0bar cand."}; /// Partitions for particle 1 - Partition partsTrack = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == int8_t(ConfTrack.ConfTrackSign)) && (aod::femtouniverseparticle::pt > ConfTrack.ConfTrackLowPtCut) && (aod::femtouniverseparticle::pt < ConfTrack.ConfTrackHighPtCut); + Partition partsTrack = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == int8_t(ConfTrack.confTrackSign)) && (aod::femtouniverseparticle::pt > ConfTrack.confTrackLowPtCut) && (aod::femtouniverseparticle::pt < ConfTrack.confTrackHighPtCut); Partition> partsTrackMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)); /// Partitions for particle 2 @@ -148,9 +143,9 @@ struct femtoUniversePairTaskTrackD0 { /// Partition with D0/D0bar candidates, which pass only one mass hypothesis Partition partsOnlyD0D0bar = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda < 0.0f || aod::femtouniverseparticle::mAntiLambda < 0.0f); /// Partition with D0 mesons only (one mass hypothesis) - Partition partsD0s = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda > 0.0f) && (aod::femtouniverseparticle::mAntiLambda < 0.0f) && (aod::femtouniverseparticle::pt > ConfDmesons.ConfMinPtD0D0bar) && (aod::femtouniverseparticle::pt < ConfDmesons.ConfMaxPtD0D0bar); + Partition partsD0s = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda > ConfDmesons.confMinInvMassD0D0bar) && (aod::femtouniverseparticle::mLambda < ConfDmesons.confMaxInvMassD0D0bar) && (aod::femtouniverseparticle::mAntiLambda < 0.0f) && (aod::femtouniverseparticle::pt > ConfDmesons.confMinPtD0D0bar) && (aod::femtouniverseparticle::pt < ConfDmesons.confMaxPtD0D0bar); /// Partition with D0bar mesons only (one mass hypothesis) - Partition partsD0bars = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda < 0.0f) && (aod::femtouniverseparticle::mAntiLambda > 0.0f) && (aod::femtouniverseparticle::pt > ConfDmesons.ConfMinPtD0D0bar) && (aod::femtouniverseparticle::pt < ConfDmesons.ConfMaxPtD0D0bar); + Partition partsD0bars = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)) && (aod::femtouniverseparticle::mLambda < 0.0f) && (aod::femtouniverseparticle::mAntiLambda > ConfDmesons.confMinInvMassD0D0bar) && (aod::femtouniverseparticle::mAntiLambda < ConfDmesons.confMaxInvMassD0D0bar) && (aod::femtouniverseparticle::pt > ConfDmesons.confMinPtD0D0bar) && (aod::femtouniverseparticle::pt < ConfDmesons.confMaxPtD0D0bar); /// Partition for D0/D0bar mesons from MC Partition> partsD0D0barMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kD0)); @@ -171,33 +166,33 @@ struct femtoUniversePairTaskTrackD0 { std::vector kNsigma; /// particle part - ConfigurableAxis ConfTempFitVarBins{"ConfDTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfTempFitVarInvMassBins{"ConfDTempFitVarInvMassBins", {6000, 0.9, 4.0}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfTempFitVarpTBins{"ConfTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; + ConfigurableAxis confTempFitVarBins{"confTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis confTempFitVarInvMassBins{"confTempFitVarInvMassBins", {6000, 0.9, 4.0}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis confTempFitVarpTBins{"confTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; /// Correlation part - ConfigurableAxis ConfMultBins{"ConfMultBins", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; // \todo to be obtained from the hash task - // ConfigurableAxis ConfMultBins{"CfgMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis ConfmTBins3D{"ConfmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - ConfigurableAxis ConfmultBins3D{"ConfmultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - - ColumnBinningPolicy colBinning{{ConfVtxBins, ConfMultBins}, true}; - - ConfigurableAxis ConfkstarBins{"ConfkstarBins", {1500, 0., 6.}, "binning kstar"}; - ConfigurableAxis ConfkTBins{"ConfkTBins", {150, 0., 9.}, "binning kT"}; - ConfigurableAxis ConfmTBins{"ConfmTBins", {225, 0., 7.5}, "binning mT"}; - ConfigurableAxis ConfPtBins{"ConfPtBins", {360, 0., 36.}, "binning pT"}; - ConfigurableAxis ConfInvMassBins{"ConfInvMassBins", {500, 0., 5.0}, "binning inv. mass"}; - ConfigurableAxis ConfInvMassFinerBins{"ConfInvMassFinerBins", {120, 1.5848, 2.1848}, "finer binning of inv. mass"}; - - Configurable ConfIsCPR{"ConfIsCPR", true, "Close Pair Rejection"}; - Configurable ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"}; - Configurable ConfCPRdeltaPhiCutMax{"ConfCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaPhiCutMin{"ConfCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaEtaCutMax{"ConfCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaEtaCutMin{"ConfCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; - Configurable ConfCPRChosenRadii{"ConfCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; + ConfigurableAxis confMultBins{"confMultBins", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; // \todo to be obtained from the hash task + // ConfigurableAxis confMultBins{"confMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; + ConfigurableAxis confVtxBins{"confVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + ConfigurableAxis confmTBins3D{"confmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + ConfigurableAxis confmultBins3D{"confmultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + + ColumnBinningPolicy colBinning{{confVtxBins, confMultBins}, true}; + + ConfigurableAxis confkstarBins{"confkstarBins", {1500, 0., 6.}, "binning kstar"}; + ConfigurableAxis confkTBins{"confkTBins", {150, 0., 9.}, "binning kT"}; + ConfigurableAxis confmTBins{"confmTBins", {225, 0., 7.5}, "binning mT"}; + ConfigurableAxis confPtBins{"confPtBins", {360, 0., 36.}, "binning pT"}; + ConfigurableAxis confInvMassBins{"confInvMassBins", {500, 0., 5.0}, "binning inv. mass"}; + ConfigurableAxis confInvMassFinerBins{"confInvMassFinerBins", {120, 1.5848, 2.1848}, "finer binning of inv. mass"}; + + Configurable confIsCPR{"confIsCPR", true, "Close Pair Rejection"}; + Configurable confCPRPlotPerRadii{"confCPRPlotPerRadii", false, "Plot CPR per radii"}; + Configurable confCPRdeltaPhiCutMax{"confCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; + Configurable confCPRdeltaPhiCutMin{"confCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; + Configurable confCPRdeltaEtaCutMax{"confCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; + Configurable confCPRdeltaEtaCutMin{"confCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; + Configurable confCPRChosenRadii{"confCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; FemtoUniverseFemtoContainer sameEventFemtoCont; FemtoUniverseFemtoContainer mixedEventFemtoCont; @@ -210,18 +205,18 @@ struct femtoUniversePairTaskTrackD0 { /// Histogram output HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry MixQaRegistry{"MixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry mixQaRegistry{"mixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry registry{"registry", - {{"hInvMassD0", ";#it{M}(K^{-}#pi^{+}) (GeV/#it{c}^{2});counts", {HistType::kTH1F, {ConfInvMassBins}}}, - {"hInvMassD0bar", ";#it{M}(#pi^{-}K^{+}) (GeV/#it{c}^{2});counts", {HistType::kTH1F, {ConfInvMassBins}}}, - {"hPtDmesonCand", "2-prong candidates;#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {ConfPtBins}}}, - {"hPtD0", "D^{0} cand.;#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {ConfPtBins}}}, - {"hPtD0bar", "#bar{D^{0}};#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {ConfPtBins}}}, - {"hPtD0D0bar", "#bar{D^{0}};#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {ConfPtBins}}}, - {"hPhiDmesonCand", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., 2. * o2::constants::math::PI}}}}, - {"hPhiD0", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., 2. * o2::constants::math::PI}}}}, - {"hPhiD0bar", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., 2. * o2::constants::math::PI}}}}, + {{"hInvMassD0", ";#it{M}(K^{-}#pi^{+}) (GeV/#it{c}^{2});counts", {HistType::kTH1F, {confInvMassBins}}}, + {"hInvMassD0bar", ";#it{M}(#pi^{-}K^{+}) (GeV/#it{c}^{2});counts", {HistType::kTH1F, {confInvMassBins}}}, + {"hPtDmesonCand", "2-prong candidates;#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {confPtBins}}}, + {"hPtD0", "D^{0} cand.;#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {confPtBins}}}, + {"hPtD0bar", "#bar{D^{0}};#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {confPtBins}}}, + {"hPtD0D0bar", "#bar{D^{0}};#it{p}_{T} (GeV/#it{c});counts", {HistType::kTH1F, {confPtBins}}}, + {"hPhiDmesonCand", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., o2::constants::math::TwoPI}}}}, + {"hPhiD0", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., o2::constants::math::TwoPI}}}}, + {"hPhiD0bar", ";#varphi (rad);counts", {HistType::kTH1F, {{80, 0., o2::constants::math::TwoPI}}}}, {"hEtaDmesonCand", ";#eta ;counts", {HistType::kTH1F, {{200, -1., 1.}}}}, {"hEtaD0", ";#eta ;counts", {HistType::kTH1F, {{200, -1., 1.}}}}, {"hEtaD0bar", ";#eta ;counts", {HistType::kTH1F, {{200, -1., 1.}}}}, @@ -235,16 +230,16 @@ struct femtoUniversePairTaskTrackD0 { {"hDCAzDaughters", "; #it{DCA}_{z} (cm); counts", {HistType::kTH1F, {{140, 0., 0.14}}}}}}; // PID for protons - bool IsProtonNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr) // previous version from: https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx + bool isProtonNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr) // previous version from: https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx { if (mom < 0.5) { - if (TMath::Abs(nsigmaTPCPr) < ConfBothTracks.ConfNsigmaTPCProton) { + if (std::abs(nsigmaTPCPr) < ConfBothTracks.confNsigmaTPCProton) { return true; } else { return false; } } else if (mom > 0.4) { - if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfNsigmaCombinedProton) { + if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.confNsigmaCombinedProton) { return true; } else { return false; @@ -253,28 +248,28 @@ struct femtoUniversePairTaskTrackD0 { return false; } - bool IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK) + bool isKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK) { if (mom < 0.3) { // 0.0-0.3 - if (TMath::Abs(nsigmaTPCK) < 3.0) { + if (std::abs(nsigmaTPCK) < 3.0) { return true; } else { return false; } } else if (mom < 0.45) { // 0.30 - 0.45 - if (TMath::Abs(nsigmaTPCK) < 2.0) { + if (std::abs(nsigmaTPCK) < 2.0) { return true; } else { return false; } } else if (mom < 0.55) { // 0.45-0.55 - if (TMath::Abs(nsigmaTPCK) < 1.0) { + if (std::abs(nsigmaTPCK) < 1.0) { return true; } else { return false; } } else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF) - if ((TMath::Abs(nsigmaTOFK) < 3.0) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < 3.0) && (std::abs(nsigmaTPCK) < 3.0)) { { return true; } @@ -282,7 +277,7 @@ struct femtoUniversePairTaskTrackD0 { return false; } } else if (mom > 1.5) { - if ((TMath::Abs(nsigmaTOFK) < 2.0) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < 2.0) && (std::abs(nsigmaTPCK) < 3.0)) { return true; } else { return false; @@ -292,23 +287,23 @@ struct femtoUniversePairTaskTrackD0 { } } - bool IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi) + bool isPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi) { //|nsigma_TPC| < 3 for p < 0.5 GeV/c //|nsigma_combined| < 3 for p > 0.5 // using configurables: - // ConfNsigmaTPCPion -> TPC Kaon Sigma for momentum < 0.5 - // ConfNsigmaCombinedPion -> TPC and TOF Pion Sigma (combined) for momentum > 0.5 + // confNsigmaTPCPion -> TPC Kaon Sigma for momentum < 0.5 + // confNsigmaCombinedPion -> TPC and TOF Pion Sigma (combined) for momentum > 0.5 if (true) { if (mom < 0.5) { - if (TMath::Abs(nsigmaTPCPi) < ConfBothTracks.ConfNsigmaTPCPion) { + if (std::abs(nsigmaTPCPi) < ConfBothTracks.confNsigmaTPCPion) { return true; } else { return false; } } else if (mom > 0.5) { - if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.ConfNsigmaCombinedPion) { + if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.confNsigmaCombinedPion) { return true; } else { return false; @@ -318,20 +313,20 @@ struct femtoUniversePairTaskTrackD0 { return false; } - bool IsParticleNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) + bool isParticleNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) { - switch (ConfTrack.ConfPDGCodeTrack) { + switch (ConfTrack.confPDGCodeTrack) { case 2212: // Proton case -2212: // anty Proton - return IsProtonNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); + return isProtonNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); break; case 211: // Pion case -211: // Pion- - return IsPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); + return isPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); break; case 321: // Kaon+ case -321: // Kaon- - return IsKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); + return isKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); break; default: return false; @@ -341,32 +336,36 @@ struct femtoUniversePairTaskTrackD0 { void init(InitContext&) { eventHisto.init(&qaRegistry); + qaRegistry.add("QA_D0D0barSelection/hInvMassD0", ";#it{M}(K^{-}#pi^{+}) (GeV/#it{c}^{2});counts", kTH1F, {confInvMassBins}); + qaRegistry.add("QA_D0D0barSelection/hPtD0", "D^{0} cand.;#it{p}_{T} (GeV/#it{c});counts", kTH1F, {confPtBins}); + qaRegistry.add("QA_D0D0barSelection/hInvMassD0bar", ";#it{M}(K^{-}#pi^{+}) (GeV/#it{c}^{2});counts", kTH1F, {confInvMassBins}); + qaRegistry.add("QA_D0D0barSelection/hPtD0bar", "#bar{D^{0}} cand.;#it{p}_{T} (GeV/#it{c});counts", kTH1F, {confPtBins}); qaRegistry.add("D0_pos_daugh/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0_pos_daugh/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0_pos_daugh/pt", "; #it{p_T} (GeV/#it{c}); Counts", kTH1F, {{100, 0, 10}}); qaRegistry.add("D0_pos_daugh/eta", "; #it{eta}; Counts", kTH1F, {{200, -1.5, 1.5}}); - qaRegistry.add("D0_pos_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, 2. * M_PI}}); + qaRegistry.add("D0_pos_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, o2::constants::math::TwoPI}}); qaRegistry.add("D0_pos_daugh/hDCAxy", "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); qaRegistry.add("D0_neg_daugh/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0_neg_daugh/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0_neg_daugh/pt", "; #it{p_T} (GeV/#it{c}); Counts", kTH1F, {{100, 0, 10}}); qaRegistry.add("D0_neg_daugh/eta", "; #it{eta}; Counts", kTH1F, {{200, -1.5, 1.5}}); - qaRegistry.add("D0_neg_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, 2. * M_PI}}); + qaRegistry.add("D0_neg_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, o2::constants::math::TwoPI}}); qaRegistry.add("D0_neg_daugh/hDCAxy", "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); qaRegistry.add("D0bar_pos_daugh/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0bar_pos_daugh/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0bar_pos_daugh/pt", "; #it{p_T} (GeV/#it{c}); Counts", kTH1F, {{100, 0, 10}}); qaRegistry.add("D0bar_pos_daugh/eta", "; #it{eta}; Counts", kTH1F, {{200, -1.5, 1.5}}); - qaRegistry.add("D0bar_pos_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, 2. * M_PI}}); + qaRegistry.add("D0bar_pos_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, o2::constants::math::TwoPI}}); qaRegistry.add("D0bar_pos_daugh/hDCAxy", "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); qaRegistry.add("D0bar_neg_daugh/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0bar_neg_daugh/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("D0bar_neg_daugh/pt", "; #it{p_T} (GeV/#it{c}); Counts", kTH1F, {{100, 0, 10}}); qaRegistry.add("D0bar_neg_daugh/eta", "; #it{eta}; Counts", kTH1F, {{200, -1.5, 1.5}}); - qaRegistry.add("D0bar_neg_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, 2. * M_PI}}); + qaRegistry.add("D0bar_neg_daugh/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, o2::constants::math::TwoPI}}); qaRegistry.add("D0bar_neg_daugh/hDCAxy", "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); qaRegistry.add("Hadron/nSigmaTPCPr", "; #it{p} (GeV/#it{c}); n#sigma_{TPCPr}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); @@ -376,36 +375,36 @@ struct femtoUniversePairTaskTrackD0 { qaRegistry.add("Hadron/nSigmaTPCKa", "; #it{p} (GeV/#it{c}); n#sigma_{TPCKa}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("Hadron/nSigmaTOFKa", "; #it{p} (GeV/#it{c}); n#sigma_{TOFKa}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); - trackHistoPartD0D0bar.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarInvMassBins, ConfBothTracks.ConfIsMC, ConfDmesons.ConfPDGCodeD0); - if (!ConfTrack.ConfIsSame) { - trackHistoPartTrack.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarBins, ConfBothTracks.ConfIsMC, ConfTrack.ConfPDGCodeTrack); + trackHistoPartD0D0bar.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarInvMassBins, ConfBothTracks.confIsMC, ConfDmesons.confPDGCodeD0); + if (!ConfTrack.confIsSame) { + trackHistoPartTrack.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarBins, ConfBothTracks.confIsMC, ConfTrack.confPDGCodeTrack); } - MixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); - MixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + mixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + mixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); - sameEventFemtoCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfBothTracks.ConfIsMC, ConfBothTracks.ConfUse3D); - mixedEventFemtoCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfBothTracks.ConfIsMC, ConfBothTracks.ConfUse3D); - sameEventAngularCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfBothTracks.ConfEtaBins, ConfBothTracks.ConfPhiBins, ConfBothTracks.ConfIsMC, ConfBothTracks.ConfUse3D); - mixedEventAngularCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfBothTracks.ConfEtaBins, ConfBothTracks.ConfPhiBins, ConfBothTracks.ConfIsMC, ConfBothTracks.ConfUse3D); + sameEventFemtoCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, ConfBothTracks.confIsMC, ConfBothTracks.confUse3D); + mixedEventFemtoCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, ConfBothTracks.confIsMC, ConfBothTracks.confUse3D); + sameEventAngularCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, ConfBothTracks.confEtaBins, ConfBothTracks.confPhiBins, ConfBothTracks.confIsMC, ConfBothTracks.confUse3D); + mixedEventAngularCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, ConfBothTracks.confEtaBins, ConfBothTracks.confPhiBins, ConfBothTracks.confIsMC, ConfBothTracks.confUse3D); - sameEventFemtoCont.setPDGCodes(ConfDmesons.ConfPDGCodeD0, ConfTrack.ConfPDGCodeTrack); - mixedEventFemtoCont.setPDGCodes(ConfDmesons.ConfPDGCodeD0, ConfTrack.ConfPDGCodeTrack); - sameEventAngularCont.setPDGCodes(ConfDmesons.ConfPDGCodeD0, ConfTrack.ConfPDGCodeTrack); - mixedEventAngularCont.setPDGCodes(ConfDmesons.ConfPDGCodeD0, ConfTrack.ConfPDGCodeTrack); + sameEventFemtoCont.setPDGCodes(ConfDmesons.confPDGCodeD0, ConfTrack.confPDGCodeTrack); + mixedEventFemtoCont.setPDGCodes(ConfDmesons.confPDGCodeD0, ConfTrack.confPDGCodeTrack); + sameEventAngularCont.setPDGCodes(ConfDmesons.confPDGCodeD0, ConfTrack.confPDGCodeTrack); + mixedEventAngularCont.setPDGCodes(ConfDmesons.confPDGCodeD0, ConfTrack.confPDGCodeTrack); pairCleaner.init(&qaRegistry); - if (ConfIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); + if (confIsCPR.value) { + pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } - vPIDTrack = ConfTrack.ConfPIDTrack.value; - kNsigma = ConfBothTracks.ConfTrkPIDnSigmaMax.value; + vPIDTrack = ConfTrack.confPIDTrack.value; + kNsigma = ConfBothTracks.confTrkPIDnSigmaMax.value; // D0/D0bar histograms auto vbins = (std::vector)binsPt; - registry.add("D0D0bar_oneMassHypo/hMassVsPt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {ConfInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("D0D0bar_oneMassHypo/hMassVsPtFinerBinning", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {ConfInvMassFinerBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("D0D0bar_oneMassHypo/hMassVsPt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("D0D0bar_oneMassHypo/hMassVsPtFinerBinning", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassFinerBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hDeltaPhiSigSig", "SxS correlation;#Delta#varphi (rad);counts", {HistType::kTH1F, {{10, 0.0, o2::constants::math::PI}}}); registry.add("hDeltaPhiD0BgD0barSig", "B(D0)x S(D0bar) correlation;#Delta#varphi (rad);counts", {HistType::kTH1F, {{10, 0.0, o2::constants::math::PI}}}); registry.add("hDeltaPhiD0SigD0barBg", "S(D0)x B(D0bar) correlation;#Delta#varphi (rad);counts", {HistType::kTH1F, {{10, 0.0, o2::constants::math::PI}}}); @@ -417,11 +416,31 @@ struct femtoUniversePairTaskTrackD0 { template void fillCollision(CollisionType col) { - MixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); + mixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); } - void processD0mesons(o2::aod::FDCollision& col, FemtoFullParticles&) + void processQAD0D0barSel(o2::aod::FDCollision const& col, FemtoFullParticles const&) + { + auto groupPartsD0s = partsD0s->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto groupPartsD0bars = partsD0bars->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + + // loop over selected D0 candidates + for (auto const& d0cand : groupPartsD0s) { + + qaRegistry.fill(HIST("QA_D0D0barSelection/hInvMassD0"), d0cand.mLambda()); + qaRegistry.fill(HIST("QA_D0D0barSelection/hPtD0"), d0cand.pt()); + } + // loop over selected D0bar candidates + for (auto const& d0barcand : groupPartsD0bars) { + + qaRegistry.fill(HIST("QA_D0D0barSelection/hInvMassD0bar"), d0barcand.mAntiLambda()); + qaRegistry.fill(HIST("QA_D0D0barSelection/hPtD0bar"), d0barcand.pt()); + } + } + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processQAD0D0barSel, "Enable filling QA plots for selected D0/D0bar cand.", true); + + void processD0mesons(o2::aod::FDCollision const& col, FemtoFullParticles const&) { auto groupPartsOnlyD0D0bar = partsOnlyD0D0bar->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto groupPartsAllDmesons = partsAllDmesons->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); @@ -442,18 +461,14 @@ struct femtoUniversePairTaskTrackD0 { if (d0d0bar.mLambda() > 0.0f && d0d0bar.mAntiLambda() < 0.0f) { registry.fill(HIST("D0D0bar_oneMassHypo/hMassVsPt"), d0d0bar.mLambda(), d0d0bar.pt()); - if (d0d0bar.mLambda() > ConfDmesons.ConfMinInvMassD0D0bar && d0d0bar.mLambda() < ConfDmesons.ConfMaxInvMassD0D0bar) { - registry.fill(HIST("hInvMassD0"), d0d0bar.mLambda()); - } + registry.fill(HIST("hInvMassD0"), d0d0bar.mLambda()); registry.fill(HIST("hPtD0"), d0d0bar.pt()); registry.fill(HIST("hPhiD0"), d0d0bar.phi()); registry.fill(HIST("hEtaD0"), d0d0bar.eta()); } if (d0d0bar.mLambda() < 0.0f && d0d0bar.mAntiLambda() > 0.0f) { registry.fill(HIST("D0D0bar_oneMassHypo/hMassVsPt"), d0d0bar.mAntiLambda(), d0d0bar.pt()); - if (d0d0bar.mAntiLambda() > ConfDmesons.ConfMinInvMassD0D0bar && d0d0bar.mAntiLambda() < ConfDmesons.ConfMaxInvMassD0D0bar) { - registry.fill(HIST("hInvMassD0bar"), d0d0bar.mAntiLambda()); - } + registry.fill(HIST("hInvMassD0bar"), d0d0bar.mAntiLambda()); registry.fill(HIST("hPtD0bar"), d0d0bar.pt()); registry.fill(HIST("hPhiD0bar"), d0d0bar.phi()); registry.fill(HIST("hEtaD0bar"), d0d0bar.eta()); @@ -490,10 +505,10 @@ struct femtoUniversePairTaskTrackD0 { } } } - PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processD0mesons, "Enable processing D0 mesons", true); + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processD0mesons, "Enable processing D0 mesons", true); // D0-D0bar pair correlations (side-band methode) - void processSideBand(o2::aod::FDCollision& col, FemtoFullParticles&) + void processSideBand(o2::aod::FDCollision const& col, FemtoFullParticles const&) { auto groupPartsOnlyD0D0bar = partsOnlyD0D0bar->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); @@ -521,33 +536,33 @@ struct femtoUniversePairTaskTrackD0 { registry.fill(HIST("hDeltaEtaDeltaPhi"), deltaEta, deltaPhi); // ----------------------------------- Creating D0-D0bar pairs correlations ------------------------------------------------ - if (cand1.mLambda() > ConfD0D0barSideBand.ConfSignalRegionMin.value && cand1.mLambda() < ConfD0D0barSideBand.ConfSignalRegionMax.value) { + if (cand1.mLambda() > ConfD0D0barSideBand.confSignalRegionMin.value && cand1.mLambda() < ConfD0D0barSideBand.confSignalRegionMax.value) { // S(D0) x S(D0bar) correlation - if (cand2.mAntiLambda() > ConfD0D0barSideBand.ConfSignalRegionMin.value && cand2.mAntiLambda() < ConfD0D0barSideBand.ConfSignalRegionMax.value) { + if (cand2.mAntiLambda() > ConfD0D0barSideBand.confSignalRegionMin.value && cand2.mAntiLambda() < ConfD0D0barSideBand.confSignalRegionMax.value) { registry.fill(HIST("hDeltaPhiSigSig"), deltaPhi); } // S(D0) x B(D0bar) correlation - if ((cand2.mAntiLambda() > ConfD0D0barSideBand.ConfMinInvMassLeftSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.ConfMaxInvMassLeftSB.value) || - (cand2.mAntiLambda() > ConfD0D0barSideBand.ConfMinInvMassRightSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.ConfMaxInvMassRightSB.value)) { + if ((cand2.mAntiLambda() > ConfD0D0barSideBand.confMinInvMassLeftSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.confMaxInvMassLeftSB.value) || + (cand2.mAntiLambda() > ConfD0D0barSideBand.confMinInvMassRightSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.confMaxInvMassRightSB.value)) { registry.fill(HIST("hDeltaPhiD0SigD0barBg"), deltaPhi); } } - if ((cand1.mLambda() > ConfD0D0barSideBand.ConfMinInvMassLeftSB.value && cand1.mLambda() < ConfD0D0barSideBand.ConfMaxInvMassLeftSB.value) || - (cand1.mLambda() > ConfD0D0barSideBand.ConfMinInvMassRightSB.value && cand1.mLambda() < ConfD0D0barSideBand.ConfMaxInvMassRightSB.value)) { + if ((cand1.mLambda() > ConfD0D0barSideBand.confMinInvMassLeftSB.value && cand1.mLambda() < ConfD0D0barSideBand.confMaxInvMassLeftSB.value) || + (cand1.mLambda() > ConfD0D0barSideBand.confMinInvMassRightSB.value && cand1.mLambda() < ConfD0D0barSideBand.confMaxInvMassRightSB.value)) { // B(D0) x S (D0bar) correlation - if (cand2.mAntiLambda() > ConfD0D0barSideBand.ConfSignalRegionMin.value && cand2.mAntiLambda() < ConfD0D0barSideBand.ConfSignalRegionMax.value) { + if (cand2.mAntiLambda() > ConfD0D0barSideBand.confSignalRegionMin.value && cand2.mAntiLambda() < ConfD0D0barSideBand.confSignalRegionMax.value) { registry.fill(HIST("hDeltaPhiD0BgD0barSig"), deltaPhi); } // B(D0) x B(D0bar) correlation - if ((cand2.mAntiLambda() > ConfD0D0barSideBand.ConfMinInvMassLeftSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.ConfMaxInvMassLeftSB.value) || - (cand2.mAntiLambda() > ConfD0D0barSideBand.ConfMinInvMassRightSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.ConfMaxInvMassRightSB.value)) { + if ((cand2.mAntiLambda() > ConfD0D0barSideBand.confMinInvMassLeftSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.confMaxInvMassLeftSB.value) || + (cand2.mAntiLambda() > ConfD0D0barSideBand.confMinInvMassRightSB.value && cand2.mAntiLambda() < ConfD0D0barSideBand.confMaxInvMassRightSB.value)) { registry.fill(HIST("hDeltaPhiBgBg"), deltaPhi); } } } // It is the end of the for loop over D0bar mesons } // It is the end of the for loop over all candidates } - PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processSideBand, "Enable processing side-band methode", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processSideBand, "Enable processing side-band methode", false); /// This function processes the same event and takes care of all the histogramming /// \todo the trivial loops over the tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... @@ -564,16 +579,16 @@ struct femtoUniversePairTaskTrackD0 { { /// Histogramming same event - for (auto& d0candidate : groupPartsD0) { + for (auto const& d0candidate : groupPartsD0) { trackHistoPartD0D0bar.fillQA(d0candidate); } float tpcNSigmaPr, tofNSigmaPr, tpcNSigmaPi, tofNSigmaPi, tpcNSigmaKa, tofNSigmaKa; - if (!ConfTrack.ConfIsSame) { - for (auto& track : groupPartsTrack) { - if (ConfTrack.ConfIsTrackIdentified) { - if (!IsParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { + if (!ConfTrack.confIsSame) { + for (auto const& track : groupPartsTrack) { + if (ConfTrack.confIsTrackIdentified) { + if (!isParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } } @@ -595,20 +610,14 @@ struct femtoUniversePairTaskTrackD0 { } } /// Now build the combinations - for (auto& [track, d0candidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsD0))) { - if (ConfTrack.ConfIsTrackIdentified) { - if (!IsParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { - continue; - } - } - // // Set inv. mass cut for D0/D0bar candidates - if (ConfUseMassCutForD0D0bar) { - if ((d0candidate.mLambda() < ConfD0D0barSideBand.ConfSignalRegionMin || d0candidate.mLambda() > ConfD0D0barSideBand.ConfSignalRegionMax) || (d0candidate.mAntiLambda() < ConfD0D0barSideBand.ConfSignalRegionMin || d0candidate.mAntiLambda() > ConfD0D0barSideBand.ConfSignalRegionMax)) { + for (auto const& [track, d0candidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsD0))) { + if (ConfTrack.confIsTrackIdentified) { + if (!isParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } } // // Close Pair Rejection - if (ConfIsCPR.value) { + if (confIsCPR.value) { if (pairCloseRejection.isClosePair(track, d0candidate, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { continue; } @@ -618,16 +627,16 @@ struct femtoUniversePairTaskTrackD0 { if (!pairCleaner.isCleanPair(track, d0candidate, parts)) { continue; } - sameEventFemtoCont.setPair(track, d0candidate, multCol, ConfBothTracks.ConfUse3D); - sameEventAngularCont.setPair(track, d0candidate, multCol, ConfBothTracks.ConfUse3D); + sameEventFemtoCont.setPair(track, d0candidate, multCol, ConfBothTracks.confUse3D); + sameEventAngularCont.setPair(track, d0candidate, multCol, ConfBothTracks.confUse3D); } } /// process function for to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(o2::aod::FDCollision& col, - FemtoFullParticles& parts) + void processSameEvent(o2::aod::FDCollision const& col, + FemtoFullParticles const& parts) { fillCollision(col); @@ -637,7 +646,7 @@ struct femtoUniversePairTaskTrackD0 { auto theGroupPartsD0s = partsD0s->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto theGroupPartsD0bars = partsD0bars->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - switch (ConfChooseD0trackCorr) { + switch (confChooseD0trackCorr) { case 0: doSameEvent(thegroupPartsTrack, theGroupPartsD0s, parts, col.magField(), col.multNtr()); break; @@ -649,19 +658,20 @@ struct femtoUniversePairTaskTrackD0 { break; case 3: doSameEvent(thegroupPartsTrack, thegroupPartsAllD0D0bar, parts, col.magField(), col.multNtr()); + break; default: break; } } - PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processSameEvent, "Enable processing same event", true); + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processSameEvent, "Enable processing same event", true); /// process function for to call doSameEvent with Monte Carlo /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(o2::aod::FDCollision& col, - soa::Join& parts, - o2::aod::FDMCParticles&) + void processSameEventMC(o2::aod::FDCollision const& col, + soa::Join const& parts, + o2::aod::FDMCParticles const&) { fillCollision(col); @@ -670,7 +680,7 @@ struct femtoUniversePairTaskTrackD0 { doSameEvent(thegroupPartsTrack, thegroupPartsD0, parts, col.magField(), col.multNtr()); } - PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processSameEventMC, "Enable processing same event for Monte Carlo", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processSameEventMC, "Enable processing same event for Monte Carlo", false); /// This function processes the mixed event /// \todo the trivial loops over the collisions and tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... @@ -686,40 +696,34 @@ struct femtoUniversePairTaskTrackD0 { void doMixedEvent(PartitionType groupPartsTrack, PartitionType groupPartsD0, PartType parts, float magFieldTesla, int multCol) { - for (auto& [track, d0candidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsD0))) { - if (ConfTrack.ConfIsTrackIdentified) { - if (!IsParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { - continue; - } - } - // // Set inv. mass cut for D0/D0bar candidates - if (ConfUseMassCutForD0D0bar) { - if ((d0candidate.mLambda() < ConfD0D0barSideBand.ConfSignalRegionMin || d0candidate.mLambda() > ConfD0D0barSideBand.ConfSignalRegionMax) || (d0candidate.mAntiLambda() < ConfD0D0barSideBand.ConfSignalRegionMin || d0candidate.mAntiLambda() > ConfD0D0barSideBand.ConfSignalRegionMax)) { + for (auto const& [track, d0candidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsD0))) { + if (ConfTrack.confIsTrackIdentified) { + if (!isParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } } // // Close Pair Rejection - if (ConfIsCPR.value) { + if (confIsCPR.value) { if (pairCloseRejection.isClosePair(track, d0candidate, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { continue; } } - mixedEventFemtoCont.setPair(track, d0candidate, multCol, ConfBothTracks.ConfUse3D); - mixedEventAngularCont.setPair(track, d0candidate, multCol, ConfBothTracks.ConfUse3D); + mixedEventFemtoCont.setPair(track, d0candidate, multCol, ConfBothTracks.confUse3D); + mixedEventAngularCont.setPair(track, d0candidate, multCol, ConfBothTracks.confUse3D); } } /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(o2::aod::FDCollisions& cols, - FemtoFullParticles& parts) + void processMixedEvent(o2::aod::FDCollisions const& cols, + FemtoFullParticles const& parts) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + for (auto const& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { const int multiplicityCol = collision1.multNtr(); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); auto groupPartsTrack = partsTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); auto groupPartsAllD0D0bar = partsAllDmesons->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); @@ -734,9 +738,9 @@ struct femtoUniversePairTaskTrackD0 { continue; } /// \todo before mixing we should check whether both collisions contain a pair of particles! - // if (partsD0.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partsTrack.size() == 0 ) continue; + // if (partsD0.size() == 0 || kNPart2Evt1 == 0 || kNPart1Evt2 == 0 || partsTrack.size() == 0 ) continue; - switch (ConfChooseD0trackCorr) { + switch (confChooseD0trackCorr) { case 0: doMixedEvent(groupPartsTrack, theGroupPartsD0s, parts, magFieldTesla1, multiplicityCol); break; @@ -748,25 +752,26 @@ struct femtoUniversePairTaskTrackD0 { break; case 3: doMixedEvent(groupPartsTrack, groupPartsAllD0D0bar, parts, magFieldTesla1, multiplicityCol); + break; default: break; } } } - PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processMixedEvent, "Enable processing mixed events", true); + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processMixedEvent, "Enable processing mixed events", true); /// brief process function for to call doMixedEvent with Monte Carlo /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(o2::aod::FDCollisions& cols, - soa::Join& parts, - o2::aod::FDMCParticles&) + void processMixedEventMC(o2::aod::FDCollisions const& cols, + soa::Join const& parts, + o2::aod::FDMCParticles const&) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + for (auto const& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { const int multiplicityCol = collision1.multNtr(); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); auto groupPartsTrack = partsTrackMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); auto groupPartsD0 = partsD0D0barMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); @@ -778,18 +783,18 @@ struct femtoUniversePairTaskTrackD0 { continue; } /// \todo before mixing we should check whether both collisions contain a pair of particles! - // if (partsD0.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partsTrack.size() == 0 ) continue; + // if (partsD0.size() == 0 || kNPart2Evt1 == 0 || kNPart1Evt2 == 0 || partsTrack.size() == 0 ) continue; doMixedEvent(groupPartsTrack, groupPartsD0, parts, magFieldTesla1, multiplicityCol); } } - PROCESS_SWITCH(femtoUniversePairTaskTrackD0, processMixedEventMC, "Enable processing mixed events MC", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackD0, processMixedEventMC, "Enable processing mixed events MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; return workflow; } From d5a52eadfc711ad9ae73047328618dfb6b2b182a Mon Sep 17 00:00:00 2001 From: yuanzhe <90246048+wang-yuanzhe@users.noreply.github.com> Date: Thu, 5 Dec 2024 09:28:59 +0100 Subject: [PATCH 252/459] [PWGLF] Add Zorro tool to get normalisation factor of trigger for analysis of H3L 3body decay (#8823) Co-authored-by: ALICE Action Bot --- PWGLF/TableProducer/Nuspex/CMakeLists.txt | 2 +- .../Nuspex/threebodyRecoTask.cxx | 225 +++++++++++------- 2 files changed, 144 insertions(+), 83 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/CMakeLists.txt b/PWGLF/TableProducer/Nuspex/CMakeLists.txt index 29c6f4ea637..99b1df8d314 100644 --- a/PWGLF/TableProducer/Nuspex/CMakeLists.txt +++ b/PWGLF/TableProducer/Nuspex/CMakeLists.txt @@ -66,7 +66,7 @@ o2physics_add_dpl_workflow(threebodymcfinder o2physics_add_dpl_workflow(threebody-reco-task SOURCES threebodyRecoTask.cxx - PUBLIC_LINK_LIBRARIES O2::DCAFitter O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2::DCAFitter O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(ebye-maker diff --git a/PWGLF/TableProducer/Nuspex/threebodyRecoTask.cxx b/PWGLF/TableProducer/Nuspex/threebodyRecoTask.cxx index 0f728f37574..624ab1efa1b 100644 --- a/PWGLF/TableProducer/Nuspex/threebodyRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/threebodyRecoTask.cxx @@ -9,14 +9,16 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // -// StoredVtx3BodyDatas analysis task -// ======================== +/// \file threebodyRecoTask.cxx +/// \brief Analysis task for 3-body decay process (now mainly for hypertriton) +/// \author Yuanzhe Wang #include #include #include #include #include +#include #include #include "Framework/runDataProcessing.h" @@ -34,11 +36,14 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/PIDResponse.h" #include "CommonConstants/PhysicsConstants.h" +#include "CCDB/BasicCCDBManager.h" + +#include "EventFiltering/Zorro.h" +#include "EventFiltering/ZorroSummary.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; using FullTracksExtIU = soa::Join; using MCLabeledTracksIU = soa::Join; @@ -76,17 +81,21 @@ struct Candidate3body { bool isSignal = false; bool isReco = false; int pdgCode = -1; - bool SurvivedEventSelection = false; + bool survivedEventSelection = false; }; -struct threebodyRecoTask { +struct ThreebodyRecoTask { Produces outputDataTable; Produces outputMCTable; - std::vector Candidates3body; + std::vector candidates3body; std::vector filledMothers; std::vector isGoodCollision; + Service ccdb; + Zorro zorro; + OutputObj zorroSummary{"zorroSummary"}; + //------------------------------------------------------------------ Preslice perCollisionVtx3BodyDatas = o2::aod::vtx3body::collisionId; @@ -96,9 +105,9 @@ struct threebodyRecoTask { Configurable dcapiontopv{"dcapiontopv", .05, "DCA Pion To PV"}; Configurable etacut{"etacut", 0.9, "etacut"}; Configurable rapiditycut{"rapiditycut", 1, "rapiditycut"}; - Configurable TofPidNsigmaMin{"TofPidNsigmaMin", -5, "TofPidNsigmaMin"}; - Configurable TofPidNsigmaMax{"TofPidNsigmaMax", 5, "TofPidNsigmaMax"}; - Configurable TpcPidNsigmaCut{"TpcPidNsigmaCut", 5, "TpcPidNsigmaCut"}; + Configurable tofPIDNSigmaMin{"tofPIDNSigmaMin", -5, "tofPIDNSigmaMin"}; + Configurable tofPIDNSigmaMax{"tofPIDNSigmaMax", 5, "tofPIDNSigmaMax"}; + Configurable tpcPIDNSigmaCut{"tpcPIDNSigmaCut", 5, "tpcPIDNSigmaCut"}; Configurable event_sel8_selection{"event_sel8_selection", true, "event selection count post sel8 cut"}; Configurable mc_event_selection{"mc_event_selection", true, "mc event selection count post kIsTriggerTVX and kNoTimeFrameBorder"}; Configurable event_posZ_selection{"event_posZ_selection", true, "event selection count post poZ cut"}; @@ -124,10 +133,22 @@ struct threebodyRecoTask { float lowersignallimit = o2::constants::physics::MassHyperTriton - 3 * mcsigma; float uppersignallimit = o2::constants::physics::MassHyperTriton + 3 * mcsigma; + // CCDB options + Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; + Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; + Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + Configurable pidPath{"pidPath", "", "Path to the PID response object"}; + + // Zorro counting + Configurable cfgSkimmedProcessing{"cfgSkimmedProcessing", false, "Skimmed dataset processing"}; + HistogramRegistry registry{ "registry", { - {"hEventCounter", "hEventCounter", {HistType::kTH1F, {{4, 0.0f, 4.0f}}}}, + {"hEventCounter", "hEventCounter", {HistType::kTH1F, {{5, 0.0f, 5.0f}}}}, {"hCentFT0C", "hCentFT0C", {HistType::kTH1F, {{100, 0.0f, 100.0f, "FT0C Centrality"}}}}, {"hCandidatesCounter", "hCandidatesCounter", {HistType::kTH1F, {{12, 0.0f, 12.0f}}}}, {"hMassHypertriton", "hMassHypertriton", {HistType::kTH1F, {{80, 2.96f, 3.04f}}}}, @@ -149,7 +170,7 @@ struct threebodyRecoTask { //------------------------------------------------------------------ // Fill stats histograms - enum vtxstep { kCandAll = 0, + enum Vtxstep { kCandAll = 0, kCandDauEta, kCandDauPt, kCandTPCNcls, @@ -170,12 +191,12 @@ struct threebodyRecoTask { void resetHistos() { - for (Int_t ii = 0; ii < kNCandSteps; ii++) { + for (int ii = 0; ii < kNCandSteps; ii++) { statisticsRegistry.candstats[ii] = 0; statisticsRegistry.truecandstats[ii] = 0; } } - void FillCandCounter(int kn, bool istrue = false) + void fillCandCounter(int kn, bool istrue = false) { statisticsRegistry.candstats[kn]++; if (istrue) { @@ -184,7 +205,7 @@ struct threebodyRecoTask { } void fillHistos() { - for (Int_t ii = 0; ii < kNCandSteps; ii++) { + for (int ii = 0; ii < kNCandSteps; ii++) { registry.fill(HIST("hCandidatesCounter"), ii, statisticsRegistry.candstats[ii]); if (doprocessMC == true) { registry.fill(HIST("hTrueHypertritonCounter"), ii, statisticsRegistry.truecandstats[ii]); @@ -192,15 +213,24 @@ struct threebodyRecoTask { } } - ConfigurableAxis dcaBinning{"dca-binning", {200, 0.0f, 1.0f}, ""}; - ConfigurableAxis ptBinning{"pt-binning", {200, 0.0f, 10.0f}, ""}; + int mRunNumber; void init(InitContext const&) { + + zorroSummary.setObject(zorro.getZorroSummary()); + mRunNumber = 0; + + ccdb->setURL(ccdburl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); + registry.get(HIST("hEventCounter"))->GetXaxis()->SetBinLabel(1, "total"); registry.get(HIST("hEventCounter"))->GetXaxis()->SetBinLabel(2, "sel8"); registry.get(HIST("hEventCounter"))->GetXaxis()->SetBinLabel(3, "vertexZ"); - registry.get(HIST("hEventCounter"))->GetXaxis()->SetBinLabel(4, "has Candidate"); + registry.get(HIST("hEventCounter"))->GetXaxis()->SetBinLabel(4, "Zorro H3L 3body event"); + registry.get(HIST("hEventCounter"))->GetXaxis()->SetBinLabel(5, "has Candidate"); // Check for selection criteria !!! TracksIU required !!! registry.add("hDiffRVtxProton", "hDiffRVtxProton", HistType::kTH1F, {{100, -10, 10}}); // difference between the radius of decay vertex and minR of proton @@ -227,15 +257,29 @@ struct threebodyRecoTask { registry.add("hRapidityGeneratedAntiHypertriton", "hRapidityGeneratedAntiHypertriton", HistType::kTH1F, {{40, -2.0f, 2.0f}}); } - TString CandCounterbinLabel[kNCandSteps] = {"Total", "TrackEta", "DauPt", "TPCNcls", "TPCPID", "d TOFPID", "PionDcatoPV", "MomRapidity", "Lifetime", "VtxCosPA", "VtxDcaDau", "InvMass"}; + TString candCounterbinLabel[kNCandSteps] = {"Total", "TrackEta", "DauPt", "TPCNcls", "TPCPID", "d TOFPID", "PionDcatoPV", "MomRapidity", "Lifetime", "VtxCosPA", "VtxDcaDau", "InvMass"}; for (int i{0}; i < kNCandSteps; i++) { - registry.get(HIST("hCandidatesCounter"))->GetXaxis()->SetBinLabel(i + 1, CandCounterbinLabel[i]); + registry.get(HIST("hCandidatesCounter"))->GetXaxis()->SetBinLabel(i + 1, candCounterbinLabel[i]); if (doprocessMC == true) { - registry.get(HIST("hTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(i + 1, CandCounterbinLabel[i]); + registry.get(HIST("hTrueHypertritonCounter"))->GetXaxis()->SetBinLabel(i + 1, candCounterbinLabel[i]); } } } + void initCCDB(aod::BCsWithTimestamps::iterator const& bc) + { + if (mRunNumber == bc.runNumber()) { + return; + } + + if (cfgSkimmedProcessing) { + zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), "fH3L3Body"); + zorro.populateHistRegistry(registry, bc.runNumber()); + } + + mRunNumber = bc.runNumber(); + } + //------------------------------------------------------------------ // Check if the mcparticle is hypertriton which decays into 3 daughters template @@ -246,7 +290,7 @@ struct threebodyRecoTask { } bool haveProton = false, havePion = false, haveBachelor = false; bool haveAntiProton = false, haveAntiPion = false, haveAntiBachelor = false; - for (auto& mcparticleDaughter : particle.template daughters_as()) { + for (const auto& mcparticleDaughter : particle.template daughters_as()) { if (mcparticleDaughter.pdgCode() == 2212) haveProton = true; if (mcparticleDaughter.pdgCode() == -2212) @@ -271,7 +315,7 @@ struct threebodyRecoTask { //------------------------------------------------------------------ // Fill candidate table template - void FillCand(TCollisionTable const& collision, TCandTable const& candData, TTrackTable const& trackProton, TTrackTable const& trackPion, TTrackTable const& trackDeuteron, bool isMatter, bool isTrueCand = false, int lLabel = -1, TLorentzVector lmother = {0, 0, 0, 0}, double MClifetime = -1) + void fillCand(TCollisionTable const& collision, TCandTable const& candData, TTrackTable const& trackProton, TTrackTable const& trackPion, TTrackTable const& trackDeuteron, bool isMatter, bool isTrueCand = false, int lLabel = -1, TLorentzVector lmother = {0, 0, 0, 0}, double MClifetime = -1) { double cospa = candData.vtxcosPA(collision.posX(), collision.posY(), collision.posZ()); @@ -327,11 +371,11 @@ struct threebodyRecoTask { cand3body.isSignal = true; cand3body.isReco = true; cand3body.pdgCode = cand3body.isMatter ? motherPdgCode : -motherPdgCode; - cand3body.SurvivedEventSelection = true; + cand3body.survivedEventSelection = true; filledMothers.push_back(lLabel); } - Candidates3body.push_back(cand3body); + candidates3body.push_back(cand3body); registry.fill(HIST("hProtonTPCBB"), trackProton.sign() * trackProton.p(), trackProton.tpcSignal()); registry.fill(HIST("hPionTPCBB"), trackPion.sign() * trackPion.p(), trackPion.tpcSignal()); @@ -350,85 +394,85 @@ struct threebodyRecoTask { //------------------------------------------------------------------ // Selections for candidates template - bool SelectCand(TCollisionTable const& collision, TCandTable const& candData, TTrackTable const& trackProton, TTrackTable const& trackPion, TTrackTable const& trackDeuteron, bool isMatter, bool isTrueCand = false) + bool selectCand(TCollisionTable const& collision, TCandTable const& candData, TTrackTable const& trackProton, TTrackTable const& trackPion, TTrackTable const& trackDeuteron, bool isMatter, bool isTrueCand = false) { - FillCandCounter(kCandAll, isTrueCand); + fillCandCounter(kCandAll, isTrueCand); // Selection on daughters if (std::abs(trackProton.eta()) > etacut || std::abs(trackPion.eta()) > etacut || std::abs(trackDeuteron.eta()) > etacut) { return false; } - FillCandCounter(kCandDauEta, isTrueCand); + fillCandCounter(kCandDauEta, isTrueCand); if (trackProton.pt() < minProtonPt || trackProton.pt() > maxProtonPt || trackPion.pt() < minPionPt || trackPion.pt() > maxPionPt || trackDeuteron.pt() < minDeuteronPt || trackDeuteron.pt() > maxDeuteronPt) { return false; } - FillCandCounter(kCandDauPt, isTrueCand); + fillCandCounter(kCandDauPt, isTrueCand); if (trackProton.tpcNClsFound() < mintpcNClsproton || trackPion.tpcNClsFound() < mintpcNClspion || trackDeuteron.tpcNClsFound() < mintpcNClsdeuteron) { return false; } - FillCandCounter(kCandTPCNcls, isTrueCand); + fillCandCounter(kCandTPCNcls, isTrueCand); - if (std::abs(trackProton.tpcNSigmaPr()) > TpcPidNsigmaCut || std::abs(trackPion.tpcNSigmaPi()) > TpcPidNsigmaCut || std::abs(trackDeuteron.tpcNSigmaDe()) > TpcPidNsigmaCut) { + if (std::abs(trackProton.tpcNSigmaPr()) > tpcPIDNSigmaCut || std::abs(trackPion.tpcNSigmaPi()) > tpcPIDNSigmaCut || std::abs(trackDeuteron.tpcNSigmaDe()) > tpcPIDNSigmaCut) { return false; } - FillCandCounter(kCandTPCPID, isTrueCand); + fillCandCounter(kCandTPCPID, isTrueCand); registry.fill(HIST("hDeuteronTOFVsPBeforeTOFCut"), trackDeuteron.sign() * trackDeuteron.p(), candData.tofNSigmaBachDe()); - if ((candData.tofNSigmaBachDe() < TofPidNsigmaMin || candData.tofNSigmaBachDe() > TofPidNsigmaMax) && trackDeuteron.p() > minDeuteronPUseTOF) { + if ((candData.tofNSigmaBachDe() < tofPIDNSigmaMin || candData.tofNSigmaBachDe() > tofPIDNSigmaMax) && trackDeuteron.p() > minDeuteronPUseTOF) { return false; } - FillCandCounter(kCandTOFPID, isTrueCand); + fillCandCounter(kCandTOFPID, isTrueCand); registry.fill(HIST("hDeuteronTOFVsPAtferTOFCut"), trackDeuteron.sign() * trackDeuteron.p(), candData.tofNSigmaBachDe()); double dcapion = isMatter ? candData.dcatrack1topv() : candData.dcatrack0topv(); if (std::abs(dcapion) < dcapiontopv) { return false; } - FillCandCounter(kCandDcaToPV, isTrueCand); + fillCandCounter(kCandDcaToPV, isTrueCand); // Selection on candidate hypertriton if (std::abs(candData.yHypertriton()) > rapiditycut) { return false; } - FillCandCounter(kCandRapidity, isTrueCand); + fillCandCounter(kCandRapidity, isTrueCand); double ct = candData.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassHyperTriton; if (ct > lifetimecut) { return false; } - FillCandCounter(kCandct, isTrueCand); + fillCandCounter(kCandct, isTrueCand); double cospa = candData.vtxcosPA(collision.posX(), collision.posY(), collision.posZ()); if (cospa < vtxcospa) { return false; } - FillCandCounter(kCandCosPA, isTrueCand); + fillCandCounter(kCandCosPA, isTrueCand); if (candData.dcaVtxdaughters() > dcavtxdau) { return false; } - FillCandCounter(kCandDcaDau, isTrueCand); + fillCandCounter(kCandDcaDau, isTrueCand); if ((isMatter && candData.mHypertriton() > h3LMassLowerlimit && candData.mHypertriton() < h3LMassUpperlimit)) { // Hypertriton registry.fill(HIST("hMassHypertriton"), candData.mHypertriton()); registry.fill(HIST("hMassHypertritonTotal"), candData.mHypertriton()); if (candData.mHypertriton() > lowersignallimit && candData.mHypertriton() < uppersignallimit) { - registry.fill(HIST("hDalitz"), RecoDecay::m2(array{array{candData.pxtrack0(), candData.pytrack0(), candData.pztrack0()}, array{candData.pxtrack2(), candData.pytrack2(), candData.pztrack2()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}), RecoDecay::m2(array{array{candData.pxtrack0(), candData.pytrack0(), candData.pztrack0()}, array{candData.pxtrack1(), candData.pytrack1(), candData.pztrack1()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged})); + registry.fill(HIST("hDalitz"), RecoDecay::m2(std::array{std::array{candData.pxtrack0(), candData.pytrack0(), candData.pztrack0()}, std::array{candData.pxtrack2(), candData.pytrack2(), candData.pztrack2()}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}), RecoDecay::m2(std::array{std::array{candData.pxtrack0(), candData.pytrack0(), candData.pztrack0()}, std::array{candData.pxtrack1(), candData.pytrack1(), candData.pztrack1()}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged})); } } else if ((!isMatter && candData.mAntiHypertriton() > h3LMassLowerlimit && candData.mAntiHypertriton() < h3LMassUpperlimit)) { // AntiHypertriton registry.fill(HIST("hMassAntiHypertriton"), candData.mAntiHypertriton()); registry.fill(HIST("hMassHypertritonTotal"), candData.mAntiHypertriton()); if (candData.mAntiHypertriton() > lowersignallimit && candData.mAntiHypertriton() < uppersignallimit) { - registry.fill(HIST("hDalitz"), RecoDecay::m2(array{array{candData.pxtrack1(), candData.pytrack1(), candData.pztrack1()}, array{candData.pxtrack2(), candData.pytrack2(), candData.pztrack2()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}), RecoDecay::m2(array{array{candData.pxtrack1(), candData.pytrack1(), candData.pztrack1()}, array{candData.pxtrack0(), candData.pytrack0(), candData.pztrack0()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged})); + registry.fill(HIST("hDalitz"), RecoDecay::m2(std::array{std::array{candData.pxtrack1(), candData.pytrack1(), candData.pztrack1()}, std::array{candData.pxtrack2(), candData.pytrack2(), candData.pztrack2()}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}), RecoDecay::m2(std::array{std::array{candData.pxtrack1(), candData.pytrack1(), candData.pztrack1()}, std::array{candData.pxtrack0(), candData.pytrack0(), candData.pztrack0()}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged})); } } else { return false; } - FillCandCounter(kCandInvMass, isTrueCand); + fillCandCounter(kCandInvMass, isTrueCand); return true; } @@ -436,7 +480,7 @@ struct threebodyRecoTask { //------------------------------------------------------------------ // Analysis process for a single candidate template - void CandidateAnalysis(TCollisionTable const& collision, TCandTable const& candData, bool& if_hasvtx, bool isTrueCand = false, int lLabel = -1, TLorentzVector lmother = {0, 0, 0, 0}, double MClifetime = -1) + void candidateAnalysis(TCollisionTable const& collision, TCandTable const& candData, bool& if_hasvtx, bool isTrueCand = false, int lLabel = -1, TLorentzVector lmother = {0, 0, 0, 0}, double MClifetime = -1) { auto track0 = candData.template track0_as(); @@ -449,16 +493,16 @@ struct threebodyRecoTask { auto& trackPion = isMatter ? track1 : track0; auto& trackDeuteron = track2; - if (SelectCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand)) { + if (selectCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand)) { if_hasvtx = true; - FillCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand, lLabel, lmother, MClifetime); + fillCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand, lLabel, lmother, MClifetime); } } //------------------------------------------------------------------ // Analysis process for like-sign background : (p pi- anti-d) or (anti-p pi+ d) template - void LikeSignAnalysis(TCollisionTable const& collision, TCandTable const& candData, bool& if_hasvtx, bool isTrueCand = false, int lLabel = -1, TLorentzVector lmother = {0, 0, 0, 0}, double MClifetime = -1) + void likeSignAnalysis(TCollisionTable const& collision, TCandTable const& candData, bool& if_hasvtx, bool isTrueCand = false, int lLabel = -1, TLorentzVector lmother = {0, 0, 0, 0}, double MClifetime = -1) { auto track0 = candData.template track0_as(); @@ -472,9 +516,9 @@ struct threebodyRecoTask { auto& trackPion = isMatter ? track1 : track0; auto& trackDeuteron = track2; - if (SelectCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand)) { + if (selectCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand)) { if_hasvtx = true; - FillCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand, lLabel, lmother, MClifetime); + fillCand(collision, candData, trackProton, trackPion, trackDeuteron, isMatter, isTrueCand, lLabel, lmother, MClifetime); // QA for if signals have the possibility to be reconginzed as a like-sign background if (isMatter) { registry.fill(HIST("hCorrectMassHypertriton"), candData.mHypertriton()); @@ -486,9 +530,9 @@ struct threebodyRecoTask { //------------------------------------------------------------------ // collect information for generated hypertriton (should be called after event selection) - void GetGeneratedH3LInfo(aod::McParticles const& particlesMC) + void getGeneratedH3LInfo(aod::McParticles const& particlesMC) { - for (auto& mcparticle : particlesMC) { + for (const auto& mcparticle : particlesMC) { if (std::abs(mcparticle.pdgCode()) != motherPdgCode) { continue; } @@ -497,7 +541,7 @@ struct threebodyRecoTask { bool haveProton = false, havePionPlus = false, haveDeuteron = false; bool haveAntiProton = false, havePionMinus = false, haveAntiDeuteron = false; double MClifetime = -1; - for (auto& mcparticleDaughter : mcparticle.template daughters_as()) { + for (const auto& mcparticleDaughter : mcparticle.template daughters_as()) { if (mcparticleDaughter.pdgCode() == 2212) haveProton = true; if (mcparticleDaughter.pdgCode() == -2212) @@ -533,32 +577,42 @@ struct threebodyRecoTask { //------------------------------------------------------------------ // process real data analysis - void processData(soa::Join const& collisions, aod::Vtx3BodyDatas const& vtx3bodydatas, FullTracksExtIU const& /*tracks*/) + void processData(soa::Join const& collisions, aod::Vtx3BodyDatas const& vtx3bodydatas, FullTracksExtIU const&, aod::BCsWithTimestamps const&) { - for (auto collision : collisions) { - Candidates3body.clear(); + for (const auto& collision : collisions) { + candidates3body.clear(); + + auto bc = collision.bc_as(); + initCCDB(bc); registry.fill(HIST("hEventCounter"), 0.5); if (event_sel8_selection && !collision.sel8()) { continue; } registry.fill(HIST("hEventCounter"), 1.5); - if (event_posZ_selection && abs(collision.posZ()) > 10.f) { // 10cm + if (event_posZ_selection && std::abs(collision.posZ()) > 10.f) { // 10cm continue; } registry.fill(HIST("hEventCounter"), 2.5); registry.fill(HIST("hCentFT0C"), collision.centFT0C()); + if (cfgSkimmedProcessing) { + bool zorroSelected = zorro.isSelected(collision.bc_as().globalBC()); /// Just let Zorro do the accounting + if (zorroSelected) { + registry.fill(HIST("hEventCounter"), 3.5); + } + } + bool if_hasvtx = false; auto d3bodyCands = vtx3bodydatas.sliceBy(perCollisionVtx3BodyDatas, collision.globalIndex()); - for (auto vtx : d3bodyCands) { - CandidateAnalysis(collision, vtx, if_hasvtx); + for (const auto& vtx : d3bodyCands) { + candidateAnalysis(collision, vtx, if_hasvtx); } if (if_hasvtx) - registry.fill(HIST("hEventCounter"), 3.5); + registry.fill(HIST("hEventCounter"), 4.5); fillHistos(); resetHistos(); - for (auto& cand3body : Candidates3body) { + for (const auto& cand3body : candidates3body) { outputDataTable(collision.centFT0C(), cand3body.isMatter, cand3body.invmass, cand3body.lcand.P(), cand3body.lcand.Pt(), cand3body.ct, cand3body.cosPA, cand3body.dcadaughters, cand3body.dcacandtopv, cand3body.vtxradius, @@ -573,36 +627,43 @@ struct threebodyRecoTask { } } } - PROCESS_SWITCH(threebodyRecoTask, processData, "Real data reconstruction", true); + PROCESS_SWITCH(ThreebodyRecoTask, processData, "Real data reconstruction", true); //------------------------------------------------------------------ // process like-sign signal void processDataLikeSign(soa::Join const& collisions, aod::Vtx3BodyDatas const& vtx3bodydatas, FullTracksExtIU const& /*tracks*/) { - for (auto collision : collisions) { - Candidates3body.clear(); + for (const auto& collision : collisions) { + candidates3body.clear(); registry.fill(HIST("hEventCounter"), 0.5); if (event_sel8_selection && !collision.sel8()) { continue; } registry.fill(HIST("hEventCounter"), 1.5); - if (event_posZ_selection && abs(collision.posZ()) > 10.f) { // 10cm + if (event_posZ_selection && std::abs(collision.posZ()) > 10.f) { // 10cm continue; } registry.fill(HIST("hEventCounter"), 2.5); registry.fill(HIST("hCentFT0C"), collision.centFT0C()); + if (cfgSkimmedProcessing) { + bool zorroSelected = zorro.isSelected(collision.bc_as().globalBC()); /// Just let Zorro do the accounting + if (zorroSelected) { + registry.fill(HIST("hEventCounter"), 3.5); + } + } + bool if_hasvtx = false; auto d3bodyCands = vtx3bodydatas.sliceBy(perCollisionVtx3BodyDatas, collision.globalIndex()); - for (auto vtx : d3bodyCands) { - LikeSignAnalysis(collision, vtx, if_hasvtx); + for (const auto& vtx : d3bodyCands) { + likeSignAnalysis(collision, vtx, if_hasvtx); } if (if_hasvtx) - registry.fill(HIST("hEventCounter"), 3.5); + registry.fill(HIST("hEventCounter"), 4.5); fillHistos(); resetHistos(); - for (auto& cand3body : Candidates3body) { + for (const auto& cand3body : candidates3body) { outputDataTable(collision.centFT0C(), cand3body.isMatter, cand3body.invmass, cand3body.lcand.P(), cand3body.lcand.Pt(), cand3body.ct, cand3body.cosPA, cand3body.dcadaughters, cand3body.dcacandtopv, cand3body.vtxradius, @@ -617,24 +678,24 @@ struct threebodyRecoTask { } } } - PROCESS_SWITCH(threebodyRecoTask, processDataLikeSign, "Like-sign signal reconstruction", false); + PROCESS_SWITCH(ThreebodyRecoTask, processDataLikeSign, "Like-sign signal reconstruction", false); //------------------------------------------------------------------ // process mc analysis void processMC(soa::Join const& collisions, aod::Vtx3BodyDatas const& vtx3bodydatas, aod::McParticles const& particlesMC, MCLabeledTracksIU const& /*tracks*/, aod::McCollisions const& mcCollisions) { filledMothers.clear(); - GetGeneratedH3LInfo(particlesMC); + getGeneratedH3LInfo(particlesMC); isGoodCollision.resize(mcCollisions.size(), false); for (const auto& collision : collisions) { - Candidates3body.clear(); + candidates3body.clear(); registry.fill(HIST("hEventCounter"), 0.5); if (mc_event_selection && (!collision.selection_bit(aod::evsel::kIsTriggerTVX) || !collision.selection_bit(aod::evsel::kNoTimeFrameBorder))) { continue; } registry.fill(HIST("hEventCounter"), 1.5); - if (event_posZ_selection && abs(collision.posZ()) > 10.f) { // 10cm + if (event_posZ_selection && std::abs(collision.posZ()) > 10.f) { // 10cm continue; } registry.fill(HIST("hEventCounter"), 2.5); @@ -647,7 +708,7 @@ struct threebodyRecoTask { bool if_hasvtx = false; auto vtxsthiscol = vtx3bodydatas.sliceBy(perCollisionVtx3BodyDatas, collision.globalIndex()); - for (auto& vtx : vtxsthiscol) { + for (const auto& vtx : vtxsthiscol) { int lLabel = -1; int lPDG = -1; double MClifetime = -1; @@ -661,9 +722,9 @@ struct threebodyRecoTask { auto lMCTrack1 = track1.mcParticle_as(); auto lMCTrack2 = track2.mcParticle_as(); if (lMCTrack0.has_mothers() && lMCTrack1.has_mothers() && lMCTrack2.has_mothers()) { - for (auto& lMother0 : lMCTrack0.mothers_as()) { - for (auto& lMother1 : lMCTrack1.mothers_as()) { - for (auto& lMother2 : lMCTrack2.mothers_as()) { + for (const auto& lMother0 : lMCTrack0.mothers_as()) { + for (const auto& lMother1 : lMCTrack1.mothers_as()) { + for (const auto& lMother2 : lMCTrack2.mothers_as()) { if (lMother0.globalIndex() == lMother1.globalIndex() && lMother0.globalIndex() == lMother2.globalIndex()) { lLabel = lMother0.globalIndex(); lPDG = lMother0.pdgCode(); @@ -680,15 +741,15 @@ struct threebodyRecoTask { } } - CandidateAnalysis(collision, vtx, if_hasvtx, isTrueCand, lLabel, lmother, MClifetime); + candidateAnalysis(collision, vtx, if_hasvtx, isTrueCand, lLabel, lmother, MClifetime); } if (if_hasvtx) - registry.fill(HIST("hEventCounter"), 3.5); + registry.fill(HIST("hEventCounter"), 4.5); fillHistos(); resetHistos(); - for (auto& cand3body : Candidates3body) { + for (const auto& cand3body : candidates3body) { outputMCTable(collision.centFT0C(), cand3body.isMatter, cand3body.invmass, cand3body.lcand.P(), cand3body.lcand.Pt(), cand3body.ct, cand3body.cosPA, cand3body.dcadaughters, cand3body.dcacandtopv, cand3body.vtxradius, @@ -701,12 +762,12 @@ struct threebodyRecoTask { cand3body.daudcaxytopv[0], cand3body.daudcaxytopv[1], cand3body.daudcaxytopv[2], cand3body.daudcatopv[0], cand3body.daudcatopv[1], cand3body.daudcatopv[2], cand3body.lgencand.P(), cand3body.lgencand.Pt(), cand3body.genct, cand3body.lgencand.Phi(), cand3body.lgencand.Eta(), cand3body.lgencand.Rapidity(), - cand3body.isSignal, cand3body.isReco, cand3body.pdgCode, cand3body.SurvivedEventSelection); + cand3body.isSignal, cand3body.isReco, cand3body.pdgCode, cand3body.survivedEventSelection); } } // now we fill only the signal candidates that were not reconstructed - for (auto& mcparticle : particlesMC) { + for (const auto& mcparticle : particlesMC) { if (!is3bodyDecayed(mcparticle)) { continue; } @@ -715,7 +776,7 @@ struct threebodyRecoTask { } bool isSurEvSelection = isGoodCollision[mcparticle.mcCollisionId()]; std::array posSV{0.f}; - for (auto& mcDaughter : mcparticle.daughters_as()) { + for (const auto& mcDaughter : mcparticle.daughters_as()) { if (std::abs(mcDaughter.pdgCode()) == bachelorPdgCode) { posSV = {mcDaughter.vx(), mcDaughter.vy(), mcDaughter.vz()}; } @@ -736,12 +797,12 @@ struct threebodyRecoTask { true, false, mcparticle.pdgCode(), isSurEvSelection); } } - PROCESS_SWITCH(threebodyRecoTask, processMC, "MC reconstruction", false); + PROCESS_SWITCH(ThreebodyRecoTask, processMC, "MC reconstruction", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; } From a0976b406e963d9fa3d284e3742b7f0d1961cefc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johanna=20L=C3=B6mker?= Date: Thu, 5 Dec 2024 11:32:02 +0100 Subject: [PATCH 253/459] [PWGJE] fix snp binning trackJetQA.cxx (#8824) --- PWGJE/Tasks/trackJetQA.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/Tasks/trackJetQA.cxx b/PWGJE/Tasks/trackJetQA.cxx index 9477f88d66e..437fdd914a0 100644 --- a/PWGJE/Tasks/trackJetQA.cxx +++ b/PWGJE/Tasks/trackJetQA.cxx @@ -171,7 +171,7 @@ struct TrackJetQa { histos.add("TrackPar/xyz", "track #it{x}, #it{y}, #it{z} position at dca in local coordinate system", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, axisTrackX, axisTrackY, axisTrackZ, axisPercentileFT0A, axisPercentileFT0C}); histos.add("TrackPar/alpha", "rotation angle of local wrt. global coordinate system", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, axisRotation, axisPercentileFT0A, axisPercentileFT0C}); histos.add("TrackPar/signed1Pt", "track signed 1/#it{p}_{T}", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, axisSignedPt, axisPercentileFT0A, axisPercentileFT0C}); - histos.add("TrackPar/snp", "sinus of track momentum azimuthal angle (snp)", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, {11, -0.05, 0.5, "snp"}, axisPercentileFT0A, axisPercentileFT0C}); + histos.add("TrackPar/snp", "sinus of track momentum azimuthal angle (snp)", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, {11, -0.5, 0.5, "snp"}, axisPercentileFT0A, axisPercentileFT0C}); histos.add("TrackPar/tgl", "tangent of the track momentum dip angle (tgl)", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, {200, -1., 1., "tgl"}, axisPercentileFT0A, axisPercentileFT0C}); histos.add("TrackPar/flags", "track flag;#it{p}_{T} [GeV/c];flag bit", {HistType::kTH2F, {{200, 0, 200}, {64, -0.5, 63.5}}}); histos.add("TrackPar/dcaXY", "distance of closest approach in #it{xy} plane", HistType::kTHnSparseD, {axisPt, axisSigma1OverPt, axisDcaXY, axisPercentileFT0A, axisPercentileFT0C}); From 2562717d1fe808589473ed23dc17015107a5308c Mon Sep 17 00:00:00 2001 From: Fabrizio Chinu <91954233+fchinu@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:39:02 +0100 Subject: [PATCH 254/459] [PWGHF] Add variables and selections to pid studies task (#8807) --- PWGHF/Tasks/CMakeLists.txt | 10 +- .../{pidStudies.cxx => taskPidStudies.cxx} | 133 ++++++++++++++---- 2 files changed, 108 insertions(+), 35 deletions(-) rename PWGHF/Tasks/{pidStudies.cxx => taskPidStudies.cxx} (75%) diff --git a/PWGHF/Tasks/CMakeLists.txt b/PWGHF/Tasks/CMakeLists.txt index 888961a70de..9a46eeba773 100644 --- a/PWGHF/Tasks/CMakeLists.txt +++ b/PWGHF/Tasks/CMakeLists.txt @@ -44,12 +44,12 @@ o2physics_add_dpl_workflow(task-multiplicity-estimator-correlation PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(task-pid-studies + SOURCES taskPidStudies.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + # o2physics_add_dpl_workflow(task-sel-optimisation # SOURCES taskSelOptimisation.cxx # PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore # COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(pid-studies - SOURCES pidStudies.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) diff --git a/PWGHF/Tasks/pidStudies.cxx b/PWGHF/Tasks/taskPidStudies.cxx similarity index 75% rename from PWGHF/Tasks/pidStudies.cxx rename to PWGHF/Tasks/taskPidStudies.cxx index 6b72dc01378..8516963bafc 100644 --- a/PWGHF/Tasks/pidStudies.cxx +++ b/PWGHF/Tasks/taskPidStudies.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file pidStudies.cxx +/// \file taskPidStudies.cxx /// \brief task for studies of PID performance /// /// \author Fabrizio Chinu , Università and INFN Torino @@ -49,8 +49,12 @@ DECLARE_SOA_COLUMN(MassAntiLambda, massAntiLambda, float); //! Candidate mass DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of the candidate (GeV/c) DECLARE_SOA_COLUMN(PtPos, ptPos, float); //! Transverse momentum of positive track (GeV/c) DECLARE_SOA_COLUMN(PtNeg, ptNeg, float); //! Transverse momentum of negative track (GeV/c) +DECLARE_SOA_COLUMN(TpcInnerParPos, tpcInnerParPos, float); //! Momentum of positive track at inner wall of TPC (GeV/c) +DECLARE_SOA_COLUMN(TpcInnerParNeg, tpcInnerParNeg, float); //! Momentum of negative track at inner wall of TPC (GeV/c) DECLARE_SOA_COLUMN(Radius, radius, float); //! Radius DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine of pointing angle +DECLARE_SOA_COLUMN(DcaV0Daughters, dcaV0Daughters, float); //! DCA between V0 daughters +DECLARE_SOA_COLUMN(DcaV0ToPv, dcaV0ToPv, float); //! DCA V0 to PV DECLARE_SOA_COLUMN(NSigmaTpcPosPi, nSigmaTpcPosPi, float); //! nSigmaTPC of positive track with pion hypothesis DECLARE_SOA_COLUMN(NSigmaTpcNegPi, nSigmaTpcNegPi, float); //! nSigmaTPC of negative track with pion hypothesis DECLARE_SOA_COLUMN(NSigmaTpcPosPr, nSigmaTpcPosPr, float); //! nSigmaTPC of positive track with proton hypothesis @@ -66,10 +70,10 @@ DECLARE_SOA_COLUMN(QtArm, qtArm, float); //! Armenteros Qt DECLARE_SOA_COLUMN(MassOmega, massOmega, float); //! Candidate mass DECLARE_SOA_COLUMN(MassXi, massXi, float); //! Candidate mass DECLARE_SOA_COLUMN(BachPt, bachPt, float); //! Transverse momentum of the bachelor (GeV/c) +DECLARE_SOA_COLUMN(TpcInnerParBach, tpcInnerParBach, float); //! Transverse momentum of the bachelor (GeV/c) +DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! Daughter lambda mass (GeV/c^2) DECLARE_SOA_COLUMN(V0cosPA, v0cosPA, float); //! V0 CPA -DECLARE_SOA_COLUMN(CascCosPA, casccosPA, float); //! Cascade CPA -DECLARE_SOA_COLUMN(DCAV0daughters, dcaV0daughters, float); //! DCA of V0 daughters -DECLARE_SOA_COLUMN(DCAv0topv, dcav0topv, float); //! V0 DCA to PV +DECLARE_SOA_COLUMN(CascCosPa, cascCosPa, float); //! Cascade CPA DECLARE_SOA_COLUMN(NSigmaTpcBachKa, nSigmaTpcBachKa, float); //! nSigmaTPC of bachelor with kaon hypothesis DECLARE_SOA_COLUMN(NSigmaTofBachKa, nSigmaTofBachKa, float); //! nSigmaTOF of bachelor with kaon hypothesis @@ -88,8 +92,12 @@ DECLARE_SOA_TABLE(PidV0s, "AOD", "PIDV0S", //! Table with PID information pid_studies::Pt, pid_studies::PtPos, pid_studies::PtNeg, + pid_studies::TpcInnerParPos, + pid_studies::TpcInnerParNeg, pid_studies::Radius, pid_studies::Cpa, + pid_studies::DcaV0Daughters, + pid_studies::DcaV0ToPv, pid_studies::NSigmaTpcPosPi, pid_studies::NSigmaTpcNegPi, pid_studies::NSigmaTpcPosPr, @@ -110,11 +118,13 @@ DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID informat pid_studies::MassOmega, pid_studies::Pt, pid_studies::BachPt, + pid_studies::TpcInnerParBach, + pid_studies::MLambda, pid_studies::V0cosPA, pid_studies::MassXi, - pid_studies::CascCosPA, - pid_studies::DCAV0daughters, - pid_studies::DCAv0topv, + pid_studies::CascCosPa, + pid_studies::DcaV0Daughters, + pid_studies::DcaV0ToPv, pid_studies::NSigmaTpcBachKa, pid_studies::NSigmaTofBachKa, pid_studies::OccupancyFt0c, @@ -124,7 +134,7 @@ DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID informat pid_studies::CandFlag); } // namespace o2::aod -struct HfPidStudies { +struct HfTaskPidStudies { Produces pidV0; Produces pidCascade; @@ -134,6 +144,8 @@ struct HfPidStudies { Configurable massLambdaMax{"massLambdaMax", 1.3, "Maximum mass for lambda"}; Configurable massOmegaMin{"massOmegaMin", 1.5, "Minimum mass for omega"}; Configurable massOmegaMax{"massOmegaMax", 1.8, "Maximum mass for omega"}; + Configurable qtArmenterosMinForK0{"qtArmenterosMinForK0", 0.12, "Minimum Armenteros' qt for K0"}; + Configurable qtArmenterosMaxForLambda{"qtArmenterosMaxForLambda", 0.12, "Minimum Armenteros' qt for (anti)Lambda"}; Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of candidates to keep"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; @@ -144,6 +156,13 @@ struct HfPidStudies { using V0sMcRec = soa::Join; using CascsMcRec = soa::Join; + void init(InitContext&) + { + if ((doprocessV0Mc && doprocessV0Data) || (doprocessCascMc && doprocessCascData)) { + LOGP(fatal, "Both data and MC process functions were enabled! Please check your configuration!"); + } + } + template void fillTree(Cand const& candidate, const int flag) { @@ -163,8 +182,12 @@ struct HfPidStudies { candidate.pt(), posTrack.pt(), negTrack.pt(), + posTrack.tpcInnerParam(), + negTrack.tpcInnerParam(), candidate.v0radius(), candidate.v0cosPA(), + candidate.dcaV0daughters(), + candidate.dcav0topv(), posTrack.tofNSigmaPi(), negTrack.tofNSigmaPi(), posTrack.tofNSigmaPr(), @@ -186,6 +209,8 @@ struct HfPidStudies { candidate.mOmega(), candidate.pt(), candidate.bachelorpt(), + bachTrack.tpcInnerParam(), + candidate.mLambda(), candidate.v0cosPA(coll.posX(), coll.posY(), coll.posZ()), candidate.mXi(), candidate.casccosPA(coll.posX(), coll.posY(), coll.posZ()), @@ -242,25 +267,78 @@ struct HfPidStudies { return aod::pid_studies::Particle::NotMatched; } - void processMc(V0sMcRec const& V0s, - aod::V0MCCores const&, - CascsMcRec const& cascades, - aod::CascMCCores const&, - CollSels const&, - PidTracks const&) + template + bool isSelectedV0AsK0s(const V0Cand& v0) + { + if (v0.mK0Short() < massK0Min || v0.mK0Short() > massK0Max) { + return false; + } + if (v0.qtarm() < qtArmenterosMinForK0) { + return false; + } + return true; + } + + template + bool isSelectedV0AsLambda(const V0Cand& v0) + { + if ((v0.mLambda() < massLambdaMin || v0.mLambda() > massLambdaMax) && + (v0.mAntiLambda() < massLambdaMin || v0.mAntiLambda() > massLambdaMax)) { + return false; + } + if (v0.qtarm() > qtArmenterosMaxForLambda) { + return false; + } + return true; + } + + template + bool isSelectedCascAsOmega(const CascCand& casc) + { + if (casc.mOmega() < massOmegaMin || casc.mOmega() > massOmegaMax) { + return false; + } + if (casc.mLambda() < massLambdaMin || casc.mLambda() > massLambdaMax) { + return false; + } + return true; + } + + void processV0Mc(V0sMcRec const& V0s, + aod::V0MCCores const&, + CollSels const&, + PidTracks const&) { for (const auto& v0 : V0s) { - if ((v0.mK0Short() > massK0Min && v0.mK0Short() < massK0Max) || - (v0.mLambda() > massLambdaMin && v0.mLambda() < massLambdaMax) || - (v0.mAntiLambda() > massLambdaMin && v0.mAntiLambda() < massLambdaMax)) { + if (isSelectedV0AsK0s(v0) || isSelectedV0AsLambda(v0)) { int matched = isMatched(v0); if (matched != aod::pid_studies::Particle::NotMatched) { fillTree(v0, matched); } } } + } + PROCESS_SWITCH(HfTaskPidStudies, processV0Mc, "Process MC", true); + + void processV0Data(aod::V0Datas const& V0s, + CollSels const&, + PidTracks const&) + { + for (const auto& v0 : V0s) { + if (isSelectedV0AsK0s(v0) || isSelectedV0AsLambda(v0)) { + fillTree(v0, aod::pid_studies::Particle::NotMatched); + } + } + } + PROCESS_SWITCH(HfTaskPidStudies, processV0Data, "Process data", false); + + void processCascMc(CascsMcRec const& cascades, + aod::CascMCCores const&, + CollSels const&, + PidTracks const&) + { for (const auto& casc : cascades) { - if (casc.mOmega() > massOmegaMin && casc.mOmega() < massOmegaMax && casc.mLambda() > massLambdaMin && casc.mLambda() < massLambdaMax) { + if (isSelectedCascAsOmega(casc)) { int matched = isMatched(casc); if (matched != aod::pid_studies::Particle::NotMatched) { fillTree(casc, matched); @@ -268,27 +346,22 @@ struct HfPidStudies { } } } - PROCESS_SWITCH(HfPidStudies, processMc, "Process MC", true); + PROCESS_SWITCH(HfTaskPidStudies, processCascMc, "Process MC", true); - void processData(aod::V0Datas const& V0s, aod::CascDatas const& cascades, CollSels const&, PidTracks const&) + void processCascData(aod::CascDatas const& cascades, + CollSels const&, + PidTracks const&) { - for (const auto& v0 : V0s) { - if ((v0.mK0Short() > massK0Min && v0.mK0Short() < massK0Max) || - (v0.mLambda() > massLambdaMin && v0.mLambda() < massLambdaMax) || - (v0.mAntiLambda() > massLambdaMin && v0.mAntiLambda() < massLambdaMax)) { - fillTree(v0, aod::pid_studies::Particle::NotMatched); - } - } for (const auto& casc : cascades) { - if (casc.mOmega() > massOmegaMin && casc.mOmega() < massOmegaMax && casc.mLambda() > massLambdaMin && casc.mLambda() < massLambdaMax) { + if (isSelectedCascAsOmega(casc)) { fillTree(casc, aod::pid_studies::Particle::NotMatched); } } } - PROCESS_SWITCH(HfPidStudies, processData, "Process data", false); + PROCESS_SWITCH(HfTaskPidStudies, processCascData, "Process data", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 63c6c795a407627cbbd95d38097cd3f1e639e776 Mon Sep 17 00:00:00 2001 From: dajones2 <140733426+dajones2@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:06:08 +0000 Subject: [PATCH 255/459] [PWGJE] Adding 1D matched histograms for jet efficiency (#8822) --- PWGJE/Tasks/jetHadronRecoil.cxx | 218 ++++++++++++++++---------------- 1 file changed, 111 insertions(+), 107 deletions(-) diff --git a/PWGJE/Tasks/jetHadronRecoil.cxx b/PWGJE/Tasks/jetHadronRecoil.cxx index df4569a415e..b6cb7d9ee6d 100644 --- a/PWGJE/Tasks/jetHadronRecoil.cxx +++ b/PWGJE/Tasks/jetHadronRecoil.cxx @@ -8,10 +8,10 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. - -// h+jet analysis task // -// Authors: Daniel Jones +/// \file jetHadronRecoil.cxx +/// \brief Task for analysing hadron triggered events. +/// \author Daniel Jones #include #include @@ -45,27 +45,27 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -struct hJetAnalysis { +struct JetHadronRecoil { - Configurable eventSelections{"eventSelection", "sel8", "choose event selection"}; - Configurable trackSelections{"trackSelection", "globalTracks", "set track selections"}; + Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; + Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; Configurable trackPtMin{"trackPtMin", 0.15, "minimum pT acceptance for tracks"}; Configurable trackPtMax{"trackPtMax", 100.0, "maximum pT acceptance for tracks"}; Configurable trackEtaMin{"trackEtaMin", -0.9, "minimum eta acceptance for tracks"}; Configurable trackEtaMax{"trackEtaMax", 0.9, "maximum eta acceptance for tracks"}; Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; - Configurable pt_TTref_min{"pt_TTref_min", 5, "reference minimum trigger track pt"}; - Configurable pt_TTref_max{"pt_TTref_max", 7, "reference maximum trigger track pt"}; - Configurable pt_TTsig_min{"pt_TTsig_min", 20, "signal minimum trigger track pt"}; - Configurable pt_TTsig_max{"pt_TTsig_max", 50, "signal maximum trigger track pt"}; - Configurable frac_sig{"frac_sig", 0.5, "fraction of events to use for signal"}; + Configurable ptTTrefMin{"ptTTrefMin", 5, "reference minimum trigger track pt"}; + Configurable ptTTrefMax{"ptTTrefMax", 7, "reference maximum trigger track pt"}; + Configurable ptTTsigMin{"ptTTsigMin", 20, "signal minimum trigger track pt"}; + Configurable ptTTsigMax{"ptTTsigMax", 50, "signal maximum trigger track pt"}; + Configurable fracSig{"fracSig", 0.5, "fraction of events to use for signal"}; Configurable jetR{"jetR", 0.4, "jet resolution parameter"}; Configurable pTHatExponent{"pTHatExponent", 6.0, "exponent of the event weight for the calculation of pTHat"}; Configurable pTHatMaxMCD{"pTHatMaxMCD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"}; Configurable pTHatMaxMCP{"pTHatMaxMCP", 999.0, "maximum fraction of hard scattering for jet acceptance in particle MC"}; Configurable triggerMasks{"triggerMasks", "", "possible JE Trigger masks: fJetChLowPt,fJetChHighPt,fTrackLowPt,fTrackHighPt,fJetD0ChLowPt,fJetD0ChHighPt,fJetLcChLowPt,fJetLcChHighPt,fEMCALReadout,fJetFullHighPt,fJetFullLowPt,fJetNeutralHighPt,fJetNeutralLowPt,fGammaVeryHighPtEMCAL,fGammaVeryHighPtDCAL,fGammaHighPtEMCAL,fGammaHighPtDCAL,fGammaLowPtEMCAL,fGammaLowPtDCAL,fGammaVeryLowPtEMCAL,fGammaVeryLowPtDCAL"}; - Preslice> PartJetsPerCollision = aod::jet::mcCollisionId; + Preslice> partJetsPerCollision = aod::jet::mcCollisionId; TRandom3* rand = new TRandom3(0); @@ -79,18 +79,18 @@ struct hJetAnalysis { {"hPtTrack", "Track p_{T};p_{T};entries", {HistType::kTH1F, {{200, 0, 200}}}}, {"hEtaTrack", "Track #eta;#eta;entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}}, {"hPhiTrack", "Track #phi;#phi;entries", {HistType::kTH1F, {{160, -1.0, 7.0}}}}, - {"hReferencePtDPhi", "jet p_{T} vs DPhi;#Delta#phi;p_{T,jet}", {HistType::kTH2F, {{100, 0, 2 * o2::constants::math::PI}, {150, 0, 150}}}}, - {"hSignalPtDPhi", "jet p_{T} vs DPhi;#Delta#phi;p_{T,jet}", {HistType::kTH2F, {{100, 0, 2 * o2::constants::math::PI}, {150, 0, 150}}}}, + {"hReferencePtDPhi", "jet p_{T} vs DPhi;#Delta#phi;p_{T,jet}", {HistType::kTH2F, {{100, 0, o2::constants::math::TwoPI}, {150, 0, 150}}}}, + {"hSignalPtDPhi", "jet p_{T} vs DPhi;#Delta#phi;p_{T,jet}", {HistType::kTH2F, {{100, 0, o2::constants::math::TwoPI}, {150, 0, 150}}}}, {"hReferencePt", "jet p_{T};p_{T,jet};entries", {HistType::kTH1F, {{150, 0, 150}}}}, {"hSignalPt", "jet p_{T};p_{T,jet};entries", {HistType::kTH1F, {{150, 0, 150}}}}, - {"hSignalLeadingTrack", "leading track p_{T};p_{T,jet};#Delta#phi;leading track p_{T}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, 2 * o2::constants::math::PI}, {150, 0, 150}}}}, - {"hReferenceLeadingTrack", "leading track p_{T};p_{T,jet};#Delta#phi;leading track p_{T}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, 2 * o2::constants::math::PI}, {150, 0, 150}}}}, + {"hSignalLeadingTrack", "leading track p_{T};p_{T,jet};#Delta#phi;leading track p_{T}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, o2::constants::math::TwoPI}, {150, 0, 150}}}}, + {"hReferenceLeadingTrack", "leading track p_{T};p_{T,jet};#Delta#phi;leading track p_{T}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, o2::constants::math::TwoPI}, {150, 0, 150}}}}, {"hJetSignalMultiplicity", "jet multiplicity;N_{jets};entries", {HistType::kTH1F, {{10, 0, 10}}}}, {"hJetReferenceMultiplicity", "jet multiplicity;N_{jets};entries", {HistType::kTH1F, {{10, 0, 10}}}}, - {"hJetSignalConstituentMultiplicity", "jet constituent multiplicity;p_{T,jet};#Delta#phi;N_{constituents}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, 2 * o2::constants::math::PI}, {50, 0, 50}}}}, - {"hJetReferenceConstituentMultiplicity", "jet constituent multiplicity;p_{T,jet};#Delta#phi;N_{constituents}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, 2 * o2::constants::math::PI}, {50, 0, 50}}}}, - {"hJetSignalConstituentPt", "jet constituent p_{T};p_{T,jet};#Delta#phi;p_{T,constituent}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, 2 * o2::constants::math::PI}, {150, 0, 150}}}}, - {"hJetReferenceConstituentPt", "jet constituent p_{T};p_{T,jet};#Delta#phi;p_{T,constituent}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, 2 * o2::constants::math::PI}, {150, 0, 150}}}}, + {"hJetSignalConstituentMultiplicity", "jet constituent multiplicity;p_{T,jet};#Delta#phi;N_{constituents}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, o2::constants::math::TwoPI}, {50, 0, 50}}}}, + {"hJetReferenceConstituentMultiplicity", "jet constituent multiplicity;p_{T,jet};#Delta#phi;N_{constituents}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, o2::constants::math::TwoPI}, {50, 0, 50}}}}, + {"hJetSignalConstituentPt", "jet constituent p_{T};p_{T,jet};#Delta#phi;p_{T,constituent}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, o2::constants::math::TwoPI}, {150, 0, 150}}}}, + {"hJetReferenceConstituentPt", "jet constituent p_{T};p_{T,jet};#Delta#phi;p_{T,constituent}", {HistType::kTH3F, {{150, 0, 150}, {100, 0, o2::constants::math::TwoPI}, {150, 0, 150}}}}, {"hSigEventTriggers", "N_{triggers};events", {HistType::kTH1F, {{10, 0, 10}}}}, {"hRefEventTriggers", "N_{triggers};events", {HistType::kTH1F, {{10, 0, 10}}}}, {"hJetPt", "jet p_{T};p_{T,jet};entries", {HistType::kTH1F, {{200, 0, 200}}}}, @@ -107,17 +107,19 @@ struct hJetAnalysis { {"hDeltaRSignalPart", "Particle #DeltaR;#DeltaR;#frac{1}{N_{jets}}#frac{dN_{jets}}{d#DeltaR}", {HistType::kTH1F, {{50, 0.0, 0.15}}}}, {"hDeltaRpTSignal", "jet p_{T} vs #DeltaR;p_{T,jet};#DeltaR", {HistType::kTH2F, {{200, 0, 200}, {50, 0.0, 0.15}}}}, {"hDeltaRpTSignalPart", "Particle jet p_{T} vs #DeltaR;p_{T,jet};#DeltaR", {HistType::kTH2F, {{200, 0, 200}, {50, 0.0, 0.15}}}}, - {"hDeltaRpTDPhiSignal", "jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, 2 * o2::constants::math::PI}, {50, 0.0, 0.15}}}}, - {"hDeltaRpTDPhiSignalPart", "Particle jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, 2 * o2::constants::math::PI}, {50, 0.0, 0.15}}}}, + {"hDeltaRpTDPhiSignal", "jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, o2::constants::math::TwoPI}, {50, 0.0, 0.15}}}}, + {"hDeltaRpTDPhiSignalPart", "Particle jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, o2::constants::math::TwoPI}, {50, 0.0, 0.15}}}}, {"hDeltaRReference", "#DeltaR;#DeltaR;#frac{dN_{jets}}{d#DeltaR}", {HistType::kTH1F, {{50, 0.0, 0.15}}}}, {"hDeltaRPartReference", "Particle #DeltaR;#DeltaR;#frac{1}{N_{jets}}#frac{dN_{jets}}{d#DeltaR}", {HistType::kTH1F, {{50, 0.0, 0.15}}}}, {"hDeltaRpTReference", "jet p_{T} vs #DeltaR;p_{T,jet};#DeltaR", {HistType::kTH2F, {{200, 0, 200}, {50, 0.0, 0.15}}}}, {"hDeltaRpTPartReference", "Particle jet p_{T} vs #DeltaR;p_{T,jet};#DeltaR", {HistType::kTH2F, {{200, 0, 200}, {50, 0.0, 0.15}}}}, - {"hDeltaRpTDPhiReference", "jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, 2 * o2::constants::math::PI}, {50, 0.0, 0.15}}}}, - {"hDeltaRpTDPhiReferencePart", "jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, 2 * o2::constants::math::PI}, {50, 0.0, 0.15}}}}, + {"hDeltaRpTDPhiReference", "jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, o2::constants::math::TwoPI}, {50, 0.0, 0.15}}}}, + {"hDeltaRpTDPhiReferencePart", "jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR", {HistType::kTH3F, {{200, 0, 200}, {100, 0, o2::constants::math::TwoPI}, {50, 0.0, 0.15}}}}, {"hPtMatched", "p_{T} matching;p_{T,det};p_{T,part}", {HistType::kTH2F, {{200, 0, 200}, {200, 0, 200}}}}, {"hPhiMatched", "#phi matching;#phi_{det};#phi_{part}", {HistType::kTH2F, {{160, -1.0, 7.0}, {160, -1.0, 7.0}}}}, {"hDeltaRMatched", "#DeltaR matching;#DeltaR_{det};#DeltaR_{part}", {HistType::kTH2F, {{50, 0.0, 0.15}, {50, 0.0, 0.15}}}}, + {"hPtMatched1d", "p_{T} matching 1d;p_{T,part}", {HistType::kTH1F, {{200, 0, 200}}}}, + {"hDeltaRMatched1d", "#DeltaR matching 1d;#DeltaR_{part}", {HistType::kTH1F, {{50, 0.0, 0.15}}}}, {"hPtResolution", "p_{T} resolution;p_{T,part};Relative Resolution", {HistType::kTH2F, {{200, 0, 200}, {1000, -5.0, 5.0}}}}, {"hPhiResolution", "#phi resolution;#p{T,part};Resolution", {HistType::kTH2F, {{200, 0, 200}, {1000, -7.0, 7.0}}}}, {"hDeltaRResolution", "#DeltaR Resolution;p_{T,part};Resolution", {HistType::kTH2F, {{200, 0, 200}, {1000, -0.15, 0.15}}}}, @@ -143,70 +145,70 @@ struct hJetAnalysis { template void fillHistograms(T const& jets, W const& /*jetsWTA*/, U const& tracks, float weight = 1.0) { - bool is_sig_col; - std::vector phi_TT_ar; - double phi_TT = 0; - int trig_number = 0; - int n_TT = 0; + bool isSigCol; + std::vector phiTTAr; + double phiTT = 0; + int trigNumber = 0; + int nTT = 0; double leadingPT = 0; float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent)); float dice = rand->Rndm(); - if (dice < frac_sig) - is_sig_col = true; + if (dice < fracSig) + isSigCol = true; else - is_sig_col = false; + isSigCol = false; - for (auto& track : tracks) { + for (const auto& track : tracks) { if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { continue; } - if (is_sig_col && track.pt() < pt_TTsig_max && track.pt() > pt_TTsig_min) { - phi_TT_ar.push_back(track.phi()); - n_TT++; + if (isSigCol && track.pt() < ptTTsigMax && track.pt() > ptTTsigMin) { + phiTTAr.push_back(track.phi()); + nTT++; } - if (!is_sig_col && track.pt() < pt_TTref_max && track.pt() > pt_TTref_min) { - phi_TT_ar.push_back(track.phi()); - n_TT++; + if (!isSigCol && track.pt() < ptTTrefMax && track.pt() > ptTTrefMin) { + phiTTAr.push_back(track.phi()); + nTT++; } registry.fill(HIST("hPtTrack"), track.pt(), weight); registry.fill(HIST("hEtaTrack"), track.eta(), weight); registry.fill(HIST("hPhiTrack"), track.phi(), weight); } - if (n_TT > 0) { - trig_number = rand->Integer(n_TT); - phi_TT = phi_TT_ar[trig_number]; - if (is_sig_col) { + if (nTT > 0) { + trigNumber = rand->Integer(nTT); + phiTT = phiTTAr[trigNumber]; + if (isSigCol) { registry.fill(HIST("hNtrig"), 1.5, weight); registry.fill(HIST("hJetSignalMultiplicity"), jets.size(), weight); - registry.fill(HIST("hSigEventTriggers"), n_TT, weight); + registry.fill(HIST("hSigEventTriggers"), nTT, weight); } - if (!is_sig_col) { + if (!isSigCol) { registry.fill(HIST("hNtrig"), 0.5, weight); registry.fill(HIST("hJetReferenceMultiplicity"), jets.size(), weight); - registry.fill(HIST("hRefEventTriggers"), n_TT, weight); + registry.fill(HIST("hRefEventTriggers"), nTT, weight); } } - for (auto& jet : jets) { + for (const auto& jet : jets) { if (jet.pt() > pTHatMaxMCD * pTHat) { continue; } registry.fill(HIST("hJetPt"), jet.pt(), weight); registry.fill(HIST("hJetEta"), jet.eta(), weight); registry.fill(HIST("hJetPhi"), jet.phi(), weight); - for (auto& jetWTA : jet.template matchedJetGeo_as>()) { + for (const auto& jetWTA : jet.template matchedJetGeo_as>()) { double deltaPhi = RecoDecay::constrainAngle(jetWTA.phi() - jet.phi(), -o2::constants::math::PI); double deltaEta = jetWTA.eta() - jet.eta(); double dR = RecoDecay::sqrtSumOfSquares(deltaPhi, deltaEta); registry.fill(HIST("hDeltaR"), dR, weight); registry.fill(HIST("hDeltaRpT"), jet.pt(), dR, weight); } - if (n_TT > 0) { - float dphi = RecoDecay::constrainAngle(jet.phi() - phi_TT); - if (is_sig_col) { - for (auto& jetWTA : jet.template matchedJetGeo_as>()) { + if (nTT > 0) { + float dphi = RecoDecay::constrainAngle(jet.phi() - phiTT); + if (isSigCol) { + for (const auto& jetWTA : jet.template matchedJetGeo_as>()) { double deltaPhi = RecoDecay::constrainAngle(jetWTA.phi() - jet.phi(), -o2::constants::math::PI); double deltaEta = jetWTA.eta() - jet.eta(); double dR = RecoDecay::sqrtSumOfSquares(deltaPhi, deltaEta); @@ -221,7 +223,7 @@ struct hJetAnalysis { registry.fill(HIST("hSignalPt"), jet.pt(), weight); } registry.fill(HIST("hJetSignalConstituentMultiplicity"), jet.pt(), dphi, jet.tracksIds().size(), weight); - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { if (constituent.pt() > leadingPT) { leadingPT = constituent.pt(); } @@ -229,8 +231,8 @@ struct hJetAnalysis { } registry.fill(HIST("hSignalLeadingTrack"), jet.pt(), dphi, leadingPT, weight); } - if (!is_sig_col) { - for (auto& jetWTA : jet.template matchedJetGeo_as>()) { + if (!isSigCol) { + for (const auto& jetWTA : jet.template matchedJetGeo_as>()) { double deltaPhi = RecoDecay::constrainAngle(jetWTA.phi() - jet.phi(), -o2::constants::math::PI); double deltaEta = jetWTA.eta() - jet.eta(); double dR = RecoDecay::sqrtSumOfSquares(deltaPhi, deltaEta); @@ -245,7 +247,7 @@ struct hJetAnalysis { registry.fill(HIST("hReferencePt"), jet.pt(), weight); } registry.fill(HIST("hJetReferenceConstituentMultiplicity"), jet.pt(), dphi, jet.tracksIds().size(), weight); - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { if (constituent.pt() > leadingPT) { leadingPT = constituent.pt(); } @@ -260,21 +262,21 @@ struct hJetAnalysis { template void fillMCPHistograms(T const& jets, W const& /*jetsWTA*/, U const& particles, float weight = 1.0) { - bool is_sig_col; - std::vector phi_TT_ar; - double phi_TT = 0; - int trig_number = 0; - int n_TT = 0; + bool isSigCol; + std::vector phiTTAr; + double phiTT = 0; + int trigNumber = 0; + int nTT = 0; double leadingPT = 0; float pTHat = 10. / (std::pow(weight, 1.0 / pTHatExponent)); float dice = rand->Rndm(); - if (dice < frac_sig) - is_sig_col = true; + if (dice < fracSig) + isSigCol = true; else - is_sig_col = false; + isSigCol = false; - for (auto& particle : particles) { + for (const auto& particle : particles) { auto pdgParticle = pdg->GetParticle(particle.pdgCode()); if (!pdgParticle) { continue; @@ -282,52 +284,52 @@ struct hJetAnalysis { if ((pdgParticle->Charge() == 0.0) || (!particle.isPhysicalPrimary())) { continue; } - if (is_sig_col && particle.pt() < pt_TTsig_max && particle.pt() > pt_TTsig_min) { - phi_TT_ar.push_back(particle.phi()); - n_TT++; + if (isSigCol && particle.pt() < ptTTsigMax && particle.pt() > ptTTsigMin) { + phiTTAr.push_back(particle.phi()); + nTT++; } - if (!is_sig_col && particle.pt() < pt_TTref_max && particle.pt() > pt_TTref_min) { - phi_TT_ar.push_back(particle.phi()); - n_TT++; + if (!isSigCol && particle.pt() < ptTTrefMax && particle.pt() > ptTTrefMin) { + phiTTAr.push_back(particle.phi()); + nTT++; } registry.fill(HIST("hPtPart"), particle.pt(), weight); registry.fill(HIST("hEtaPart"), particle.eta(), weight); registry.fill(HIST("hPhiPart"), particle.phi(), weight); } - if (n_TT > 0) { - trig_number = rand->Integer(n_TT); - phi_TT = phi_TT_ar[trig_number]; - if (is_sig_col) { + if (nTT > 0) { + trigNumber = rand->Integer(nTT); + phiTT = phiTTAr[trigNumber]; + if (isSigCol) { registry.fill(HIST("hNtrig"), 1.5, weight); registry.fill(HIST("hJetSignalMultiplicity"), jets.size(), weight); - registry.fill(HIST("hSigEventTriggers"), n_TT, weight); + registry.fill(HIST("hSigEventTriggers"), nTT, weight); } - if (!is_sig_col) { + if (!isSigCol) { registry.fill(HIST("hNtrig"), 0.5, weight); registry.fill(HIST("hJetReferenceMultiplicity"), jets.size(), weight); - registry.fill(HIST("hRefEventTriggers"), n_TT, weight); + registry.fill(HIST("hRefEventTriggers"), nTT, weight); } } - for (auto& jet : jets) { + for (const auto& jet : jets) { if (jet.pt() > pTHatMaxMCP * pTHat) { continue; } registry.fill(HIST("hJetPt"), jet.pt(), weight); registry.fill(HIST("hJetEta"), jet.eta(), weight); registry.fill(HIST("hJetPhi"), jet.phi(), weight); - for (auto& jetWTA : jet.template matchedJetGeo_as>()) { + for (const auto& jetWTA : jet.template matchedJetGeo_as>()) { double deltaPhi = RecoDecay::constrainAngle(jetWTA.phi() - jet.phi(), -o2::constants::math::PI); double deltaEta = jetWTA.eta() - jet.eta(); double dR = RecoDecay::sqrtSumOfSquares(deltaPhi, deltaEta); registry.fill(HIST("hDeltaRPart"), dR, weight); registry.fill(HIST("hDeltaRpTPart"), jet.pt(), dR, weight); } - if (n_TT > 0) { - float dphi = RecoDecay::constrainAngle(jet.phi() - phi_TT); - if (is_sig_col) { - for (auto& jetWTA : jet.template matchedJetGeo_as>()) { + if (nTT > 0) { + float dphi = RecoDecay::constrainAngle(jet.phi() - phiTT); + if (isSigCol) { + for (const auto& jetWTA : jet.template matchedJetGeo_as>()) { double deltaPhi = RecoDecay::constrainAngle(jetWTA.phi() - jet.phi(), -o2::constants::math::PI); double deltaEta = jetWTA.eta() - jet.eta(); double dR = RecoDecay::sqrtSumOfSquares(deltaPhi, deltaEta); @@ -342,7 +344,7 @@ struct hJetAnalysis { registry.fill(HIST("hSignalPt"), jet.pt(), weight); } registry.fill(HIST("hJetSignalConstituentMultiplicity"), jet.pt(), dphi, jet.tracksIds().size(), weight); - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { if (constituent.pt() > leadingPT) { leadingPT = constituent.pt(); } @@ -350,8 +352,8 @@ struct hJetAnalysis { } registry.fill(HIST("hSignalLeadingTrack"), jet.pt(), dphi, leadingPT, weight); } - if (!is_sig_col) { - for (auto& jetWTA : jet.template matchedJetGeo_as>()) { + if (!isSigCol) { + for (const auto& jetWTA : jet.template matchedJetGeo_as>()) { double deltaPhi = RecoDecay::constrainAngle(jetWTA.phi() - jet.phi(), -o2::constants::math::PI); double deltaEta = jetWTA.eta() - jet.eta(); double dR = RecoDecay::sqrtSumOfSquares(deltaPhi, deltaEta); @@ -366,7 +368,7 @@ struct hJetAnalysis { registry.fill(HIST("hReferencePt"), jet.pt(), weight); } registry.fill(HIST("hJetReferenceConstituentMultiplicity"), jet.pt(), dphi, jet.tracksIds().size(), weight); - for (auto& constituent : jet.template tracks_as()) { + for (const auto& constituent : jet.template tracks_as()) { if (constituent.pt() > leadingPT) { leadingPT = constituent.pt(); } @@ -401,7 +403,7 @@ struct hJetAnalysis { } if (jetBase.has_matchedJetGeo()) { - for (auto& jetTag : jetBase.template matchedJetGeo_as>()) { + for (const auto& jetTag : jetBase.template matchedJetGeo_as>()) { if (jetTag.pt() > pTHatMaxMCP * pTHat) { continue; } @@ -422,6 +424,8 @@ struct hJetAnalysis { registry.fill(HIST("hDeltaRMatched"), dR, dRp, weight); registry.fill(HIST("hDeltaRResolution"), jetTag.pt(), dRp - dR, weight); registry.fill(HIST("hFullMatching"), jetBase.pt(), jetTag.pt(), jetBase.phi(), jetTag.phi(), dR, dRp, weight); + registry.fill(HIST("hPtMatched1d"), jetTag.pt(), weight); + registry.fill(HIST("hDeltaRMatched1d"), dRp, weight); } } } @@ -440,7 +444,7 @@ struct hJetAnalysis { registry.fill(HIST("hZvtxSelected"), collision.posZ()); fillHistograms(jets, jetsWTA, tracks); } - PROCESS_SWITCH(hJetAnalysis, processData, "process data", true); + PROCESS_SWITCH(JetHadronRecoil, processData, "process data", true); void processMCD(soa::Filtered::iterator const& collision, soa::Filtered> const& jets, @@ -456,7 +460,7 @@ struct hJetAnalysis { registry.fill(HIST("hZvtxSelected"), collision.posZ()); fillHistograms(jets, jetsWTA, tracks); } - PROCESS_SWITCH(hJetAnalysis, processMCD, "process MC detector level", false); + PROCESS_SWITCH(JetHadronRecoil, processMCD, "process MC detector level", false); void processMCDWeighted(soa::Filtered>::iterator const& collision, aod::JMcCollisions const&, @@ -473,7 +477,7 @@ struct hJetAnalysis { registry.fill(HIST("hZvtxSelected"), collision.posZ(), collision.mcCollision().weight()); fillHistograms(jets, jetsWTA, tracks, collision.mcCollision().weight()); } - PROCESS_SWITCH(hJetAnalysis, processMCDWeighted, "process MC detector level with event weights", false); + PROCESS_SWITCH(JetHadronRecoil, processMCDWeighted, "process MC detector level with event weights", false); void processMCP(aod::JetMcCollision const& collision, soa::Filtered> const& jets, @@ -486,7 +490,7 @@ struct hJetAnalysis { registry.fill(HIST("hZvtxSelected"), collision.posZ()); fillMCPHistograms(jets, jetsWTA, particles); } - PROCESS_SWITCH(hJetAnalysis, processMCP, "process MC particle level", false); + PROCESS_SWITCH(JetHadronRecoil, processMCP, "process MC particle level", false); void processMCPWeighted(aod::JetMcCollision const& collision, soa::Filtered> const& jets, @@ -499,7 +503,7 @@ struct hJetAnalysis { registry.fill(HIST("hZvtxSelected"), collision.posZ(), collision.weight()); fillMCPHistograms(jets, jetsWTA, particles, collision.weight()); } - PROCESS_SWITCH(hJetAnalysis, processMCPWeighted, "process MC particle level with event weights", false); + PROCESS_SWITCH(JetHadronRecoil, processMCPWeighted, "process MC particle level with event weights", false); void processJetsMCPMCDMatched(soa::Filtered::iterator const& collision, soa::Filtered> const& mcdjets, @@ -517,12 +521,12 @@ struct hJetAnalysis { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ()); - const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); + const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(partJetsPerCollision, collision.mcCollisionId()); for (const auto& mcdjet : mcdjets) { fillMatchedHistograms(mcdjet, mcdjetsWTA, mcpjetsWTACut, mcpjets); } } - PROCESS_SWITCH(hJetAnalysis, processJetsMCPMCDMatched, "process MC matched (inc jets)", false); + PROCESS_SWITCH(JetHadronRecoil, processJetsMCPMCDMatched, "process MC matched (inc jets)", false); void processJetsMCPMCDMatchedWeighted(soa::Filtered::iterator const& collision, soa::Filtered> const& mcdjets, @@ -540,12 +544,12 @@ struct hJetAnalysis { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ()); - const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); + const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(partJetsPerCollision, collision.mcCollisionId()); for (const auto& mcdjet : mcdjets) { fillMatchedHistograms(mcdjet, mcdjetsWTA, mcpjetsWTACut, mcpjets, mcdjet.eventWeight()); } } - PROCESS_SWITCH(hJetAnalysis, processJetsMCPMCDMatchedWeighted, "process MC matched with event weights (inc jets)", false); + PROCESS_SWITCH(JetHadronRecoil, processJetsMCPMCDMatchedWeighted, "process MC matched with event weights (inc jets)", false); void processRecoilJetsMCPMCDMatched(soa::Filtered::iterator const& collision, soa::Filtered> const& mcdjets, @@ -563,10 +567,10 @@ struct hJetAnalysis { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ()); - const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); + const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(partJetsPerCollision, collision.mcCollisionId()); bool ishJetEvent = false; - for (auto& track : tracks) { - if (track.pt() < pt_TTsig_max && track.pt() > pt_TTsig_min) { + for (const auto& track : tracks) { + if (track.pt() < ptTTsigMax && track.pt() > ptTTsigMin) { ishJetEvent = true; break; } @@ -577,7 +581,7 @@ struct hJetAnalysis { } } } - PROCESS_SWITCH(hJetAnalysis, processRecoilJetsMCPMCDMatched, "process MC matched (recoil jets)", false); + PROCESS_SWITCH(JetHadronRecoil, processRecoilJetsMCPMCDMatched, "process MC matched (recoil jets)", false); void processRecoilJetsMCPMCDMatchedWeighted(soa::Filtered::iterator const& collision, soa::Filtered> const& mcdjets, @@ -595,10 +599,10 @@ struct hJetAnalysis { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ()); - const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); + const auto& mcpjetsWTACut = mcpjetsWTA.sliceBy(partJetsPerCollision, collision.mcCollisionId()); bool ishJetEvent = false; - for (auto& track : tracks) { - if (track.pt() < pt_TTsig_max && track.pt() > pt_TTsig_min) { + for (const auto& track : tracks) { + if (track.pt() < ptTTsigMax && track.pt() > ptTTsigMin) { ishJetEvent = true; break; } @@ -609,7 +613,7 @@ struct hJetAnalysis { } } } - PROCESS_SWITCH(hJetAnalysis, processRecoilJetsMCPMCDMatchedWeighted, "process MC matched with event weights (recoil jets)", false); + PROCESS_SWITCH(JetHadronRecoil, processRecoilJetsMCPMCDMatchedWeighted, "process MC matched with event weights (recoil jets)", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"hJetAnalysis"})}; } +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 19ab7056f1664ab5458fdb73dee2481dc686159c Mon Sep 17 00:00:00 2001 From: choich08365 <157435123+choich08365@users.noreply.github.com> Date: Thu, 5 Dec 2024 23:07:13 +0900 Subject: [PATCH 256/459] [PWGJE] Applied jet reduction factor for GNN process (#8811) Co-authored-by: chchoi --- PWGJE/Tasks/bjetTreeCreator.cxx | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/PWGJE/Tasks/bjetTreeCreator.cxx b/PWGJE/Tasks/bjetTreeCreator.cxx index 5c291077d81..6f9fe6a85b1 100644 --- a/PWGJE/Tasks/bjetTreeCreator.cxx +++ b/PWGJE/Tasks/bjetTreeCreator.cxx @@ -293,12 +293,12 @@ struct BJetTreeCreator { if (doprocessMCJetsForGNN) { //+jet - registry.add("h_jet_pt", "jet_pt;#it{p}_{T}^{ch jet} (GeV/#it{c});Entries", {HistType::kTH1F, {{100, 0., 200.}}}); - registry.add("h_jet_eta", "jet_eta;#it{#eta}_{ch jet};Entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("h_jet_phi", "jet_phi;#it{#phi}_{ch jet};Entries", {HistType::kTH1F, {{100, 0., 2. * M_PI}}}); + registry.add("h_jet_pt", "jet_pt;#it{p}_{T}^{ch jet} (GeV/#it{c});Entries", {HistType::kTH1F, {{200, 0., 200.}}}); + registry.add("h_jet_eta", "jet_eta;#it{#eta}_{ch jet};Entries", {HistType::kTH1F, {{200, -2., 2.}}}); + registry.add("h_jet_phi", "jet_phi;#it{#phi}_{ch jet};Entries", {HistType::kTH1F, {{200, 0., 2. * M_PI}}}); registry.add("h_jet_flav", "jet_flav;jet flavor;Entries", {HistType::kTH1F, {{4, 0., 4.}}}); registry.add("h_n_trks", "n_trks;#it{n}_{tracks};Entries", {HistType::kTH1F, {{50, 0., 50.}}}); - registry.add("h_jet_mass", "jet_mass;#it{m}_{jet} (GeV/#it{c}^2);Entries", {HistType::kTH1F, {{100, 0., 50.}}}); + registry.add("h_jet_mass", "jet_mass;#it{m}_{jet} (GeV/#it{c}^2);Entries", {HistType::kTH1F, {{200, 0., 50.}}}); auto h_jet_flav = registry.get(HIST("h_jet_flav")); h_jet_flav->GetXaxis()->SetBinLabel(1, "no mcparticle"); // 0 h_jet_flav->GetXaxis()->SetBinLabel(2, "c-jet"); // 1 @@ -306,21 +306,20 @@ struct BJetTreeCreator { h_jet_flav->GetXaxis()->SetBinLabel(4, "lf-jet"); // 3 registry.add("h_n_vertices", "n_vertices;#it{n}_{vertex};Entries", {HistType::kTH1F, {{50, 0., 50.}}}); //+trk - registry.add("h_trk_pt", "trk_pt;#it{p}_{T} (GeV/#it{c});Entries", {HistType::kTH1F, {{100, 0., 100.}}}); - registry.add("h_trk_eta", "trk_eta;#it{#eta};Entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("h_trk_phi", "trk_phi;#it{#phi};Entries", {HistType::kTH1F, {{100, 0., 2. * M_PI}}}); + registry.add("h_trk_pt", "trk_pt;#it{p}_{T} (GeV/#it{c});Entries", {HistType::kTH1F, {{200, 0., 100.}}}); + registry.add("h_trk_eta", "trk_eta;#it{#eta};Entries", {HistType::kTH1F, {{200, -2., 2.}}}); + registry.add("h_trk_phi", "trk_phi;#it{#phi};Entries", {HistType::kTH1F, {{200, 0., 2. * M_PI}}}); registry.add("h_trk_charge", "trk_charge;#it{q};Entries", {HistType::kTH1F, {{3, -1.5, 1.5}}}); - registry.add("h_trk_dcaxy", "trk_dcaxy;#it{DCA}_{xy} (cm);Entries", {HistType::kTH1F, {{100, -0.1, 0.1}}}); - registry.add("h_trk_dcaxyz", "trk_dcaxyz;#it{DCA}_{xyz} (cm);Entries", {HistType::kTH1F, {{100, -0.1, 0.1}}}); - registry.add("h_trk_sigmadcaxy", "trk_sigmadcaxy;#it{#sigma}_{#it{DCA}_{xy}} (cm);Entries", {HistType::kTH1F, {{100, 0., 0.1}}}); - registry.add("h_trk_sigmadcaxyz", "trk_sigmadcaxyz;#it{#sigma}_{#it{DCA}_{xyz}} (cm);Entries", {HistType::kTH1F, {{100, 0., 0.1}}}); + registry.add("h_trk_dcaxy", "trk_dcaxy;#it{DCA}_{xy} (cm);Entries", {HistType::kTH1F, {{200, -0.1, 0.1}}}); + registry.add("h_trk_dcaxyz", "trk_dcaxyz;#it{DCA}_{xyz} (cm);Entries", {HistType::kTH1F, {{200, -0.1, 0.1}}}); + registry.add("h_trk_sigmadcaxy", "trk_sigmadcaxy;#it{#sigma}_{#it{DCA}_{xy}} (cm);Entries", {HistType::kTH1F, {{200, 0., 0.1}}}); + registry.add("h_trk_sigmadcaxyz", "trk_sigmadcaxyz;#it{#sigma}_{#it{DCA}_{xyz}} (cm);Entries", {HistType::kTH1F, {{200, 0., 0.1}}}); registry.add("h_trk_itsncls", "trk_itsncls;ITS NCls;Entries", {HistType::kTH1F, {{10, 0., 10.}}}); registry.add("h_trk_tpcncls", "trk_tpcncls;TPC NCls (Found);Entries", {HistType::kTH1F, {{200, 0., 200.}}}); registry.add("h_trk_tpcncrs", "trk_tpcncrs;TPC NCrossedRows;Entries", {HistType::kTH1F, {{200, 0., 200.}}}); - registry.add("h_trk_itschi2ncl", "trk_itschi2ncl;ITS #it{#chi}^{2}/ndf;Entries", {HistType::kTH1F, {{100, 0., 20.}}}); - registry.add("h_trk_tpcchi2ncl", "trk_tpcchi2ncl;TPC #it{#chi}^{2}/ndf;Entries", {HistType::kTH1F, {{100, 0., 10.}}}); - registry.add("h_jtrack_counter", "jtrack counter", {HistType::kTH1F, {{1, 0., 1.}}}); - registry.add("h2_trk_jtrackpt_vs_origtrackpt", "JTracks::pt vs Tracks::pt", {HistType::kTH2F, {{100, 0., 100.}, {100, 0., 100.}}}); + registry.add("h_trk_itschi2ncl", "trk_itschi2ncl;ITS #it{#chi}^{2}/ndf;Entries", {HistType::kTH1F, {{200, 0., 20.}}}); + registry.add("h_trk_tpcchi2ncl", "trk_tpcchi2ncl;TPC #it{#chi}^{2}/ndf;Entries", {HistType::kTH1F, {{200, 0., 10.}}}); + registry.add("h2_trk_jtrackpt_vs_origtrackpt", "JTracks::pt vs Tracks::pt", {HistType::kTH2F, {{200, 0., 100.}, {200, 0., 100.}}}); registry.add("h_trk_vtx_index", "trk_vtx_index;Vertex index;Entries", {HistType::kTH1F, {{20, 0., 20.}}}); registry.add("h_trk_origin", "trk_origin;Track origin;Entries", {HistType::kTH1F, {{5, 0., 5.}}}); auto h_trk_origin = registry.get(HIST("h_trk_origin")); @@ -735,6 +734,10 @@ struct BJetTreeCreator { } } + if ((jetFlavor != JetTaggingSpecies::charm && jetFlavor != JetTaggingSpecies::beauty) && (static_cast(std::rand()) / RAND_MAX < getReductionFactor(analysisJet.pt()))) { + continue; + } + float eventWeight = analysisJet.eventWeight(); //+ From 4f834678a14e39216bd2669b35704da50b12b845 Mon Sep 17 00:00:00 2001 From: Ionut Cristian Arsene Date: Thu, 5 Dec 2024 17:26:16 +0100 Subject: [PATCH 257/459] [PWGDQ] Adding protections to the prefiltering task; fix problem with exclusive MCSignals (#8831) Co-authored-by: Ionut Cristian Arsene --- PWGDQ/Core/MCSignal.cxx | 10 ++-- PWGDQ/Core/MCSignal.h | 19 ++++--- PWGDQ/Core/MCSignalLibrary.cxx | 8 +-- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 75 ++++++++++++++++---------- PWGDQ/Tasks/tableReader_withAssoc.cxx | 75 ++++++++++++++++---------- 5 files changed, 119 insertions(+), 68 deletions(-) diff --git a/PWGDQ/Core/MCSignal.cxx b/PWGDQ/Core/MCSignal.cxx index c35e0548e98..bf08b1fab4e 100644 --- a/PWGDQ/Core/MCSignal.cxx +++ b/PWGDQ/Core/MCSignal.cxx @@ -27,7 +27,8 @@ MCSignal::MCSignal() : TNamed("", ""), fExcludeCommonAncestor(false), fTempAncestorLabel(-1), fDecayChannelIsExclusive(false), - fDecayChannelIsNotExclusive(false) + fDecayChannelIsNotExclusive(false), + fNAncestorDirectProngs(0) { } @@ -39,7 +40,8 @@ MCSignal::MCSignal(int nProngs, const char* name /*= ""*/, const char* title /*= fExcludeCommonAncestor(false), fTempAncestorLabel(-1), fDecayChannelIsExclusive(false), - fDecayChannelIsNotExclusive(false) + fDecayChannelIsNotExclusive(false), + fNAncestorDirectProngs(0) { fProngs.reserve(nProngs); } @@ -52,7 +54,8 @@ MCSignal::MCSignal(const char* name, const char* title, std::vector pro fExcludeCommonAncestor(excludeCommonAncestor), fTempAncestorLabel(-1), fDecayChannelIsExclusive(false), - fDecayChannelIsNotExclusive(false) + fDecayChannelIsNotExclusive(false), + fNAncestorDirectProngs(0) { } @@ -82,6 +85,7 @@ void MCSignal::PrintConfig() cout << "Exclude common ancestor combinations: " << fExcludeCommonAncestor << endl; cout << "Decay channel is exclusive: " << fDecayChannelIsExclusive << endl; cout << "Decay channel is not exclusive: " << fDecayChannelIsNotExclusive << endl; + cout << "Decay channel direct prongs for the common ancestor: " << fNAncestorDirectProngs << endl; cout << "Printing " << fNProngs << "/" << fProngs.size() << " prongs:" << endl; int i = 0; for (auto& pr : fProngs) { diff --git a/PWGDQ/Core/MCSignal.h b/PWGDQ/Core/MCSignal.h index d91e8f7424d..0e979aae8b2 100644 --- a/PWGDQ/Core/MCSignal.h +++ b/PWGDQ/Core/MCSignal.h @@ -73,13 +73,15 @@ class MCSignal : public TNamed void SetProngs(std::vector prongs, std::vector commonAncestors); void AddProng(MCProng prong, int8_t commonAncestor = -1); - void SetDecayChannelIsExclusive(bool option = true) + void SetDecayChannelIsExclusive(int nProngs, bool option = true) { fDecayChannelIsExclusive = option; + fNAncestorDirectProngs = nProngs; } - void SetDecayChannelIsNotExclusive(bool option = true) + void SetDecayChannelIsNotExclusive(int nProngs, bool option = true) { fDecayChannelIsNotExclusive = option; + fNAncestorDirectProngs = nProngs; } int GetNProngs() const @@ -98,6 +100,10 @@ class MCSignal : public TNamed { return fDecayChannelIsNotExclusive; } + int GetNAncestorDirectProngs() const + { + return fNAncestorDirectProngs; + } template bool CheckSignal(bool checkSources, const T&... args) @@ -117,8 +123,9 @@ class MCSignal : public TNamed unsigned int fNProngs; // number of prongs std::vector fCommonAncestorIdxs; // index of the most recent ancestor, relative to each prong's history bool fExcludeCommonAncestor; // explicitly request that there is no common ancestor - bool fDecayChannelIsExclusive; // if true, then the indicated mother particle has a number of daughters which is equal to the number of prongs defined in this MC signal - bool fDecayChannelIsNotExclusive; // if true, then the indicated mother particle has a number of daughters which is larger than the number of prongs defined in this MC signal + bool fDecayChannelIsExclusive; // if true, then the indicated mother particle has a number of daughters which is equal to the number of direct prongs defined in this MC signal + bool fDecayChannelIsNotExclusive; // if true, then the indicated mother particle has a number of daughters which is larger than the number of direct prongs defined in this MC signal + int fNAncestorDirectProngs; // number of direct prongs belonging to the common ancestor specified by this signal int fTempAncestorLabel; template @@ -162,10 +169,10 @@ bool MCSignal::CheckProng(int i, bool checkSources, const T& track) // If these numbers are equal, it means this decay MCSignal match is exclusive (there are no additional prongs for this mother besides the // prongs defined here). if (currentMCParticle.has_daughters()) { - if (fDecayChannelIsExclusive && currentMCParticle.daughtersIds()[1] - currentMCParticle.daughtersIds()[0] + 1 != fNProngs) { + if (fDecayChannelIsExclusive && currentMCParticle.daughtersIds()[1] - currentMCParticle.daughtersIds()[0] + 1 != fNAncestorDirectProngs) { return false; } - if (fDecayChannelIsNotExclusive && currentMCParticle.daughtersIds()[1] - currentMCParticle.daughtersIds()[0] + 1 == fNProngs) { + if (fDecayChannelIsNotExclusive && currentMCParticle.daughtersIds()[1] - currentMCParticle.daughtersIds()[0] + 1 == fNAncestorDirectProngs) { return false; } } diff --git a/PWGDQ/Core/MCSignalLibrary.cxx b/PWGDQ/Core/MCSignalLibrary.cxx index 8c1c8af9fde..54cf2cb549a 100644 --- a/PWGDQ/Core/MCSignalLibrary.cxx +++ b/PWGDQ/Core/MCSignalLibrary.cxx @@ -712,14 +712,14 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); prong.SetSourceBit(0, MCProng::kPhysicalPrimary); signal = new MCSignal(name, "ee pairs from j/psi decays", {prong, prong}, {1, 1}); // signal at pair level - signal->SetDecayChannelIsExclusive(true); + signal->SetDecayChannelIsExclusive(2, true); return signal; } if (!nameStr.compare("eeFromJpsiNotExclusive")) { MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); prong.SetSourceBit(0, MCProng::kPhysicalPrimary); signal = new MCSignal(name, "ee pairs from j/psi decays", {prong, prong}, {1, 1}); // signal at pair level - signal->SetDecayChannelIsNotExclusive(true); + signal->SetDecayChannelIsNotExclusive(2, true); return signal; } if (!nameStr.compare("eePrimaryFromPromptJPsi")) { @@ -1145,7 +1145,7 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) MCProng pronge(3, {11, 443, 521}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); MCProng prongKaon(2, {321, 521}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); signal = new MCSignal(name, "Kaon and electron pair from B+", {pronge, pronge, prongKaon}, {2, 2, 1}); - signal->SetDecayChannelIsExclusive(true); + signal->SetDecayChannelIsExclusive(2, true); return signal; } @@ -1153,7 +1153,7 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) MCProng pronge(3, {11, 443, 521}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); MCProng prongKaon(2, {321, 521}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); signal = new MCSignal(name, "Kaon and electron pair from B+", {pronge, pronge, prongKaon}, {2, 2, 1}); - signal->SetDecayChannelIsNotExclusive(true); + signal->SetDecayChannelIsNotExclusive(2, true); return signal; } diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 1f190c9fae4..62dfcd46652 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -919,7 +919,7 @@ struct AnalysisPrefilterSelection { Configurable fConfigPrefilterPairCut{"cfgPrefilterPairCut", "", "Prefilter pair cut"}; Configurable fConfigTrackCuts{"cfgTrackCuts", "", "Track cuts for which to run the prefilter"}; // Track related options - Configurable fPropTrack{"cfgPropTrack", true, "Propgate tracks to associated collision to recalculate DCA and momentum vector"}; + Configurable fPropTrack{"cfgPropTrack", false, "Propgate tracks to associated collision to recalculate DCA and momentum vector"}; std::map fPrefilterMap; AnalysisCompositeCut* fPairCut; @@ -934,23 +934,39 @@ struct AnalysisPrefilterSelection { return; } + bool runPrefilter = true; // get the list of track cuts to be prefiltered TString trackCutsStr = fConfigTrackCuts.value; TObjArray* objArrayTrackCuts = nullptr; if (!trackCutsStr.IsNull()) { objArrayTrackCuts = trackCutsStr.Tokenize(","); + if (objArrayTrackCuts == nullptr) { + runPrefilter = false; + } + } else { + LOG(warn) << " No track cuts to prefilter! Prefilter will not be run"; + runPrefilter = false; + } + // get the cut to be used as loose selection + TString prefilterTrackCutStr = fConfigPrefilterTrackCut.value; + if (prefilterTrackCutStr.IsNull()) { + LOG(warn) << " No prefilter loose selection specified! Prefilter will not be run"; + runPrefilter = false; } - // get the list of cuts that were computed in the barrel track-selection task and create a bit mask - // to mark just the ones we want to apply a prefilter on fPrefilterMask = 0; fPrefilterCutBit = -1; - string trackCuts; - getTaskOptionValue(context, "analysis-track-selection", "cfgTrackCuts", trackCuts, false); - TString allTrackCutsStr = trackCuts; - TString prefilterTrackCutStr = fConfigPrefilterTrackCut.value; - if (!trackCutsStr.IsNull()) { + if (runPrefilter) { + // get the list of cuts that were computed in the barrel track-selection task and create a bit mask + // to mark just the ones we want to apply a prefilter on + string trackCuts; + getTaskOptionValue(context, "analysis-track-selection", "cfgTrackCuts", trackCuts, false); + TString allTrackCutsStr = trackCuts; + std::unique_ptr objArray(allTrackCutsStr.Tokenize(",")); + if (objArray == nullptr) { + LOG(fatal) << " Not getting any track cuts from the barrel-track-selection "; + } if (objArray->FindObject(prefilterTrackCutStr.Data()) == nullptr) { LOG(fatal) << " Prefilter track cut not among the cuts calculated by the track-selection task! "; } @@ -963,18 +979,15 @@ struct AnalysisPrefilterSelection { fPrefilterCutBit = icut; } } + // setup the prefilter pair cut + fPairCut = new AnalysisCompositeCut(true); + TString pairCutStr = fConfigPrefilterPairCut.value; + if (!pairCutStr.IsNull()) { + fPairCut = dqcuts::GetCompositeCut(pairCutStr.Data()); + } } - // NOTE: If no prefilter loose cut is specified to be "prefiltered" or no track cuts are asked to be prefiltered, - // then make a warning. In the processing, the produced table will just lead to a neutral behaviour (no prefilter applied) if (fPrefilterMask == static_cast(0) || fPrefilterCutBit < 0) { - LOG(warn) << "No loose cut or track cuts for prefiltering are specified. This task will do nothing."; - } - - // setup the prefilter pair cut - fPairCut = new AnalysisCompositeCut(true); - TString pairCutStr = fConfigPrefilterPairCut.value; - if (!pairCutStr.IsNull()) { - fPairCut = dqcuts::GetCompositeCut(pairCutStr.Data()); + LOG(warn) << "No specified loose cut or track cuts for prefiltering. This task will do nothing."; } VarManager::SetUseVars(AnalysisCut::fgUsedVars); // provide the list of required variables so that VarManager knows what to fill @@ -1039,18 +1052,26 @@ struct AnalysisPrefilterSelection { runPrefilter(event, groupedAssocs, tracks); } } + uint32_t mymap = -1; - for (auto& assoc : assocs) { - auto track = assoc.template reducedtrack_as(); - mymap = -1; - // If cuts were not configured, then produce a map with all 1's - if (fPrefilterCutBit < 0 || fPrefilterMask == 0) { - prefilter(mymap); - } else if (fPrefilterMap.find(track.globalIndex()) != fPrefilterMap.end()) { - // NOTE: publish the bitwise negated bits (~), so there will be zeroes for cuts that failed the prefiltering and 1 everywhere else - mymap = ~fPrefilterMap[track.globalIndex()]; + // If cuts were not configured, then produce a map with all 1's and publish it for all associations + if (fPrefilterCutBit < 0 || fPrefilterMask == 0) { + for (int i = 0; i < assocs.size(); ++i) { prefilter(mymap); } + } else { + for (auto& assoc : assocs) { + // TODO: just use the index from the assoc (no need to cast the whole track) + auto track = assoc.template reducedtrack_as(); + mymap = -1; + if (fPrefilterMap.find(track.globalIndex()) != fPrefilterMap.end()) { + // NOTE: publish the bitwise negated bits (~), so there will be zeroes for cuts that failed the prefiltering and 1 everywhere else + mymap = ~fPrefilterMap[track.globalIndex()]; + prefilter(mymap); + } else { + prefilter(mymap); // track did not pass the prefilter selections, so publish just 1's + } + } } } diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 194dd3b67ef..65c89b78918 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -856,32 +856,47 @@ struct AnalysisPrefilterSelection { uint32_t fPrefilterMask; int fPrefilterCutBit; + Preslice trackAssocsPerCollision = aod::reducedtrack_association::reducedeventId; + void init(o2::framework::InitContext& context) { if (context.mOptions.get("processDummy")) { return; } + bool runPrefilter = true; // get the list of track cuts to be prefiltered TString trackCutsStr = fConfigTrackCuts.value; TObjArray* objArrayTrackCuts = nullptr; if (!trackCutsStr.IsNull()) { objArrayTrackCuts = trackCutsStr.Tokenize(","); + if (objArrayTrackCuts == nullptr) { + runPrefilter = false; + } + } else { + LOG(warn) << " No track cuts to prefilter! Prefilter will not be run"; + runPrefilter = false; } - if (objArrayTrackCuts->GetEntries() == 0) { - LOG(fatal) << " No track cuts to prefilter!"; + // get the cut to be used as loose selection + TString prefilterTrackCutStr = fConfigPrefilterTrackCut.value; + if (prefilterTrackCutStr.IsNull()) { + LOG(warn) << " No prefilter loose selection specified! Prefilter will not be run"; + runPrefilter = false; } - // get the list of cuts that were computed in the barrel track-selection task and create a bit mask - // to mark just the ones we want to apply a prefilter on fPrefilterMask = static_cast(0); fPrefilterCutBit = -1; - string trackCuts; - getTaskOptionValue(context, "analysis-track-selection", "cfgTrackCuts", trackCuts, false); - TString allTrackCutsStr = trackCuts; - TString prefilterTrackCutStr = fConfigPrefilterTrackCut.value; - if (!trackCutsStr.IsNull()) { + if (runPrefilter) { + // get the list of cuts that were computed in the barrel track-selection task and create a bit mask + // to mark just the ones we want to apply a prefilter on + string trackCuts; + getTaskOptionValue(context, "analysis-track-selection", "cfgTrackCuts", trackCuts, false); + TString allTrackCutsStr = trackCuts; + std::unique_ptr objArray(allTrackCutsStr.Tokenize(",")); + if (objArray == nullptr) { + LOG(fatal) << " Not getting any track cuts from the barrel-track-selection "; + } if (objArray->FindObject(prefilterTrackCutStr.Data()) == nullptr) { LOG(fatal) << " Prefilter track cut not among the cuts calculated by the track-selection task! "; } @@ -894,18 +909,17 @@ struct AnalysisPrefilterSelection { fPrefilterCutBit = icut; } } + // setup the prefilter pair cut + fPairCut = new AnalysisCompositeCut(true); + TString pairCutStr = fConfigPrefilterPairCut.value; + if (!pairCutStr.IsNull()) { + fPairCut = dqcuts::GetCompositeCut(pairCutStr.Data()); + } } if (fPrefilterMask == static_cast(0) || fPrefilterCutBit < 0) { LOG(warn) << "No specified loose cut or track cuts for prefiltering. This task will do nothing."; } - // setup the prefilter pair cut - fPairCut = new AnalysisCompositeCut(true); - TString pairCutStr = fConfigPrefilterPairCut.value; - if (!pairCutStr.IsNull()) { - fPairCut = dqcuts::GetCompositeCut(pairCutStr.Data()); - } - VarManager::SetUseVars(AnalysisCut::fgUsedVars); // provide the list of required variables so that VarManager knows what to fill VarManager::SetDefaultVarNames(); @@ -955,11 +969,8 @@ struct AnalysisPrefilterSelection { } // end loop over combinations } - Preslice trackAssocsPerCollision = aod::reducedtrack_association::reducedeventId; - void processBarrelSkimmed(MyEvents const& events, soa::Join const& assocs, MyBarrelTracks const& tracks) { - fPrefilterMap.clear(); for (auto& event : events) { @@ -968,18 +979,26 @@ struct AnalysisPrefilterSelection { runPrefilter(groupedAssocs, tracks); } } + uint32_t mymap = -1; - for (auto& assoc : assocs) { - auto track = assoc.template reducedtrack_as(); - mymap = -1; - // If cuts were not configured, then produce a map with all 1's - if (fPrefilterCutBit < 0 || fPrefilterMask == 0) { - prefilter(mymap); - } else if (fPrefilterMap.find(track.globalIndex()) != fPrefilterMap.end()) { - // NOTE: publish the bitwise negated bits (~), so there will be zeroes for cuts that failed the prefiltering and 1 everywhere else - mymap = ~fPrefilterMap[track.globalIndex()]; + // If cuts were not configured, then produce a map with all 1's and publish it for all associations + if (fPrefilterCutBit < 0 || fPrefilterMask == 0) { + for (int i = 0; i < assocs.size(); ++i) { prefilter(mymap); } + } else { + for (auto& assoc : assocs) { + // TODO: just use the index from the assoc (no need to cast the whole track) + auto track = assoc.template reducedtrack_as(); + mymap = -1; + if (fPrefilterMap.find(track.globalIndex()) != fPrefilterMap.end()) { + // NOTE: publish the bitwise negated bits (~), so there will be zeroes for cuts that failed the prefiltering and 1 everywhere else + mymap = ~fPrefilterMap[track.globalIndex()]; + prefilter(mymap); + } else { + prefilter(mymap); // track did not pass the prefilter selections, so publish just 1's + } + } } } From 9ee9d58e1c600b65212f0192927c2f1ec9f2a251 Mon Sep 17 00:00:00 2001 From: Stefano Cannito <143754257+scannito@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:09:15 +0100 Subject: [PATCH 258/459] [PWGLF] Fixed bug in histos filling in phik0sanalysis.cxx (#8832) --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 42 +++++++++++++++------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 6ad2e6a774e..11ef94f75ce 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -684,7 +684,8 @@ struct phik0shortanalysis { } } - TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -715,7 +716,8 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi(track.px(), track.py(), track.pz(), massPi); + TLorentzVector recPi; + recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); if (std::abs(recPi.Rapidity()) > cfgyAcceptance) continue; @@ -763,7 +765,9 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -835,7 +839,9 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector vecPi(track.px(), track.py(), track.pz(), massPi); + TLorentzVector vecPi; + vecPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); + if (std::abs(vecPi.Rapidity()) > cfgyAcceptance) continue; @@ -1001,7 +1007,8 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -1037,7 +1044,8 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi(track.px(), track.py(), track.pz(), massPi); + TLorentzVector recPi; + recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); if (std::abs(recPi.Rapidity()) > cfgyAcceptance) continue; @@ -1109,7 +1117,9 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -1219,7 +1229,9 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi(track.px(), track.py(), track.pz(), massPi); + TLorentzVector recPi; + recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); + if (std::abs(recPi.Rapidity()) > cfgyAcceptance) continue; @@ -1359,7 +1371,8 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -1390,7 +1403,8 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi(track.px(), track.py(), track.pz(), massPi); + TLorentzVector recPi; + recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); if (std::abs(recPi.Rapidity()) > cfgyAcceptance) continue; @@ -1441,7 +1455,9 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) continue; @@ -1514,7 +1530,9 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector vecPi(track.px(), track.py(), track.pz(), massPi); + TLorentzVector vecPi; + vecPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); + if (std::abs(vecPi.Rapidity()) > cfgyAcceptance) continue; From c1df461a7d86df651999d13e7e4e9f72bc9a031e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Eduardo=20Mu=C3=B1oz=20M=C3=A9ndez?= <56033627+jmunozme@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:50:57 -0600 Subject: [PATCH 259/459] [PWGLF] Modification to efficiency fit (#8810) --- PWGMM/UE/Tasks/uecharged.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGMM/UE/Tasks/uecharged.cxx b/PWGMM/UE/Tasks/uecharged.cxx index 18e59f8338d..12148212e49 100644 --- a/PWGMM/UE/Tasks/uecharged.cxx +++ b/PWGMM/UE/Tasks/uecharged.cxx @@ -198,7 +198,7 @@ void ueCharged::init(InitContext const&) ConfigurableAxis ptBinning{"ptBinning", {0, 0.0, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0, 40.0, 50.0}, "pTassoc bin limits"}; AxisSpec ptAxis = {ptBinning, "#it{p}_{T}^{assoc} (GeV/#it{c})"}; - f_Eff.setObject(new TF1("fpara", "(x<0.3)*((0.221456)+x*(3.4271)+x*x*(-6.7668))+(x>=0.3&&x<2.1)*((0.610649)+(0.148627)*x+(-0.0772185)*x*x+(0.0157586)*x*x*x)+(x>=2.1)*(0.726557)", 0., 1e5)); + f_Eff.setObject(new TF1("fpara", "(x<0.3)*((0.283781)+x*(3.0492)+x*x*(-6.17018)) + (x>=0.3&&x<1.8)*((0.597121)+(0.200737)*x+(-0.11255)*x*x+(0.0242807)*x*x*x) + (x>=1.8&&x<14.)*((0.729892)+(0.0018516)*x+(0.000257896)*x*x+(-2.05202e-05)*x*x*x) + (x>=14)*(0.749313)", 0., 1e5)); if (doprocessMC) { ue.add("hPtOut", "pT all rec; pT; Nch", HistType::kTH1D, {ptAxis}); From 9efac545c5375251817be143312252020dd32e6a Mon Sep 17 00:00:00 2001 From: Rik Spijkers <78484875+rspijkers@users.noreply.github.com> Date: Thu, 5 Dec 2024 19:07:19 +0100 Subject: [PATCH 260/459] [PWGLF] Add rapidity cut and trigger selection to cascade correlations task (#8817) --- PWGLF/Tasks/Strangeness/CMakeLists.txt | 2 +- .../Tasks/Strangeness/cascadecorrelations.cxx | 215 ++++++++++++------ 2 files changed, 145 insertions(+), 72 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/CMakeLists.txt b/PWGLF/Tasks/Strangeness/CMakeLists.txt index 660c7ce8610..bdc6624af49 100644 --- a/PWGLF/Tasks/Strangeness/CMakeLists.txt +++ b/PWGLF/Tasks/Strangeness/CMakeLists.txt @@ -41,7 +41,7 @@ o2physics_add_dpl_workflow(v0postprocessing o2physics_add_dpl_workflow(cascadecorrelations SOURCES cascadecorrelations.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(non-prompt-cascade diff --git a/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx b/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx index c9ff1f74f88..4c8531213bb 100644 --- a/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx +++ b/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -35,6 +37,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponse.h" #include "CCDB/BasicCCDBManager.h" +#include "EventFiltering/Zorro.h" #include #include @@ -42,7 +45,7 @@ #include #include #include -#include +// #include using namespace o2; using namespace o2::soa; @@ -57,6 +60,8 @@ using FullTracksExtIU = soa::Join; using FullTracksExtIUWithPID = soa::Join; +Zorro zorro; + // Add a column to the cascdataext table: IsSelected. // 0 = not selected, 1 = Xi, 2 = both, 3 = Omega namespace o2::aod @@ -70,16 +75,29 @@ DECLARE_SOA_TABLE(CascadeFlags, "AOD", "CASCADEFLAGS", //! using CascDataExtSelected = soa::Join; } // namespace o2::aod -struct cascadeSelector { +using MyCollisions = soa::Join; +using MyCollisionsMult = soa::Join; +using MyCascades = soa::Filtered; + +struct CascadeSelector { + Service ccdb; + Produces cascflags; // Configurables + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "CCDB url"}; + Configurable useTrigger{"useTrigger", false, "Use trigger selection on skimmed data"}; + Configurable triggerList{"triggerList", "fDoubleXi, fDoubleOmega, fOmegaXi", "List of triggers used to select events"}; + Configurable doTFBorderCut{"doTFBorderCut", true, "Switch to apply TimeframeBorderCut event selection"}; + Configurable doSel8{"doSel8", true, "Switch to apply sel8 event selection"}; + + // Tracklevel Configurable tpcNsigmaBachelor{"tpcNsigmaBachelor", 3, "TPC NSigma bachelor"}; Configurable tpcNsigmaProton{"tpcNsigmaProton", 3, "TPC NSigma proton <- lambda"}; Configurable tpcNsigmaPion{"tpcNsigmaPion", 3, "TPC NSigma pion <- lambda"}; Configurable minTPCCrossedRows{"minTPCCrossedRows", 80, "min N TPC crossed rows"}; // TODO: finetune! 80 > 159/2, so no split tracks? Configurable minITSClusters{"minITSClusters", 4, "minimum number of ITS clusters"}; - // Configurable etaTracks{"etaTracks", 0.8, "min/max of eta for tracks"} + Configurable etaTracks{"etaTracks", 1.0, "min/max of eta for tracks"}; // Selection criteria - compatible with core wagon autodetect - copied from cascadeanalysis.cxx //*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+* @@ -132,23 +150,50 @@ struct cascadeSelector { {"hITSnClustersPos", "hITSnClustersPos", {HistType::kTH3F, {{8, -0.5, 7.5, "number of ITS clusters"}, invMassAxis, ptAxis}}}, {"hITSnClustersNeg", "hITSnClustersNeg", {HistType::kTH3F, {{8, -0.5, 7.5, "number of ITS clusters"}, invMassAxis, ptAxis}}}, {"hITSnClustersBach", "hITSnClustersBach", {HistType::kTH3F, {{8, -0.5, 7.5, "number of ITS clusters"}, invMassAxis, ptAxis}}}, + + {"hTriggerQA", "hTriggerQA", {HistType::kTH1F, {{2, -0.5, 1.5, "Trigger y/n"}}}}, }, }; // Keep track of which selections the candidates pass void init(InitContext const&) { + ccdb->setURL(ccdbUrl); + ccdb->setCaching(true); + auto h = registry.add("hSelectionStatus", "hSelectionStatus", HistType::kTH1I, {{10, 0, 10, "status"}}); h->GetXaxis()->SetBinLabel(1, "All"); h->GetXaxis()->SetBinLabel(2, "nTPC OK"); h->GetXaxis()->SetBinLabel(3, "nITS OK"); h->GetXaxis()->SetBinLabel(4, "Topo OK"); - h->GetXaxis()->SetBinLabel(5, "V0 PID OK"); - h->GetXaxis()->SetBinLabel(6, "Bach PID OK"); + h->GetXaxis()->SetBinLabel(5, "Track eta OK"); + h->GetXaxis()->SetBinLabel(6, "V0 PID OK"); + h->GetXaxis()->SetBinLabel(7, "Bach PID OK"); } - void process(soa::Join::iterator const& collision, aod::CascDataExt const& Cascades, FullTracksExtIUWithPID const&) + void process(MyCollisions::iterator const& collision, aod::CascDataExt const& Cascades, FullTracksExtIUWithPID const&, aod::BCsWithTimestamps const&) { - for (auto& casc : Cascades) { + bool evSel = true; + if (useTrigger) { + auto bc = collision.bc_as(); + zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), triggerList); + bool eventTrigger = zorro.isSelected(bc.globalBC()); + if (eventTrigger) { + registry.fill(HIST("hTriggerQA"), 1); + } else { + registry.fill(HIST("hTriggerQA"), 0); + evSel = false; + } + } + + if ((doSel8 && !collision.sel8()) || (doTFBorderCut && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder))) { + evSel = false; // do not skip the collision - this will lead to the cascadeFlag table having less entries than the Cascade table, and therefor not joinable. + } + + for (auto const& casc : Cascades) { + if (!evSel) { + cascflags(0); + continue; + } // these are the tracks: auto bachTrack = casc.bachelor_as(); @@ -178,7 +223,7 @@ struct cascadeSelector { registry.fill(HIST("hSelectionStatus"), 0); // all the cascade before selections registry.fill(HIST("hMassXi0"), casc.mXi(), casc.pt()); - // TPC N crossed rows + // TPC N crossed rows todo: check if minTPCCrossedRows > 50 if (posTrack.tpcNClsCrossedRows() < minTPCCrossedRows || negTrack.tpcNClsCrossedRows() < minTPCCrossedRows || bachTrack.tpcNClsCrossedRows() < minTPCCrossedRows) { cascflags(0); continue; @@ -186,7 +231,7 @@ struct cascadeSelector { registry.fill(HIST("hSelectionStatus"), 1); // passes nTPC crossed rows registry.fill(HIST("hMassXi1"), casc.mXi(), casc.pt()); - // ITS N clusters + // ITS N clusters todo: check if minITSClusters > 0 if (posTrack.itsNCls() < minITSClusters || negTrack.itsNCls() < minITSClusters || bachTrack.itsNCls() < minITSClusters) { cascflags(0); continue; @@ -211,6 +256,12 @@ struct cascadeSelector { registry.fill(HIST("hSelectionStatus"), 3); // passes topo registry.fill(HIST("hMassXi3"), casc.mXi(), casc.pt()); + if (TMath::Abs(posTrack.eta()) > etaTracks || TMath::Abs(negTrack.eta()) > etaTracks || TMath::Abs(bachTrack.eta()) > etaTracks) { + cascflags(0); + continue; + } + registry.fill(HIST("hSelectionStatus"), 4); // passes track eta + // TODO: TOF (for pT > 2 GeV per track?) //// TPC PID //// @@ -238,7 +289,7 @@ struct cascadeSelector { continue; } } - registry.fill(HIST("hSelectionStatus"), 4); // fails at V0 daughters PID + registry.fill(HIST("hSelectionStatus"), 5); // passes V0 daughters PID registry.fill(HIST("hMassXi4"), casc.mXi(), casc.pt()); // Bachelor check @@ -246,42 +297,49 @@ struct cascadeSelector { if (TMath::Abs(bachTrack.tpcNSigmaKa()) < tpcNsigmaBachelor) { // consistent with both! cascflags(2); - registry.fill(HIST("hSelectionStatus"), 5); // passes bach PID + registry.fill(HIST("hSelectionStatus"), 6); // passes bach PID registry.fill(HIST("hMassXi5"), casc.mXi(), casc.pt()); continue; } cascflags(1); - registry.fill(HIST("hSelectionStatus"), 5); // passes bach PID + registry.fill(HIST("hSelectionStatus"), 6); // passes bach PID registry.fill(HIST("hMassXi5"), casc.mXi(), casc.pt()); continue; } else if (TMath::Abs(bachTrack.tpcNSigmaKa()) < tpcNsigmaBachelor) { cascflags(3); - registry.fill(HIST("hSelectionStatus"), 5); // passes bach PID + registry.fill(HIST("hSelectionStatus"), 6); // passes bach PID continue; } // if we reach here, the bachelor was neither pion nor kaon cascflags(0); } // cascade loop - } // process -}; // struct + } // process +}; // struct -struct cascadeCorrelations { +struct CascadeCorrelations { Service ccdb; + OutputObj zorroSummary{"zorroSummary"}; + // Configurables + Configurable maxRapidity{"maxRapidity", 0.5, "|y| < maxRapidity"}; Configurable zVertexCut{"zVertexCut", 10, "Cut on PV position"}; Configurable nMixedEvents{"nMixedEvents", 10, "Number of events to be mixed"}; Configurable doEfficiencyCorrection{"doEfficiencyCorrection", true, "flag to do efficiency corrections"}; - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "CCDB url"}; + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "CCDB url"}; + Configurable useTrigger{"useTrigger", false, "Use trigger selection on skimmed data"}; + Configurable triggerList{"triggerList", "fDoubleXi, fDoubleOmega, fOmegaXi", "List of triggers used to select events"}; Configurable efficiencyCCDBPath{"efficiencyCCDBPath", "Users/r/rspijker/test/EffTest", "Path of the efficiency corrections"}; + Configurable doTFBorderCut{"doTFBorderCut", true, "Switch to apply TimeframeBorderCut event selection"}; + Configurable doSel8{"doSel8", true, "Switch to apply sel8 event selection"}; - AxisSpec invMassAxis = {2000, 1.0f, 3.0f, "Inv. Mass (GeV/c^{2})"}; - AxisSpec deltaPhiAxis = {100, -PI / 2, 1.5 * PI, "#Delta#varphi"}; - AxisSpec deltaYAxis = {40, -2, 2, "#Delta y"}; // TODO: narrower range? - AxisSpec ptAxis = {200, 0, 15, "#it{p}_{T}"}; + AxisSpec invMassAxis = {1000, 1.0f, 2.0f, "Inv. Mass (GeV/c^{2})"}; + AxisSpec deltaPhiAxis = {180, -PIHalf, 3 * PIHalf, "#Delta#varphi"}; // 180 is divisible by 18 (tpc sectors) and 20 (run 2 binning) + AxisSpec deltaYAxis = {40, -2 * maxRapidity, 2 * maxRapidity, "#Delta y"}; // TODO: narrower range? + AxisSpec ptAxis = {150, 0, 15, "#it{p}_{T}"}; AxisSpec selectionFlagAxis = {4, -0.5f, 3.5f, "Selection flag of casc candidate"}; AxisSpec vertexAxis = {200, -10.0f, 10.0f, "cm"}; AxisSpec multiplicityAxis{100, 0, 100, "Multiplicity (MultFT0M?)"}; - AxisSpec rapidityAxis{100, -2, 2, "y"}; + AxisSpec rapidityAxis{100, -maxRapidity, maxRapidity, "y"}; // initialize efficiency maps TH1D* hEffXiMin; @@ -291,7 +349,7 @@ struct cascadeCorrelations { void init(InitContext const&) { - ccdb->setURL(ccdburl); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); if (doEfficiencyCorrection) { TList* effList = ccdb->getForTimeStamp(efficiencyCCDBPath, 1); @@ -303,6 +361,8 @@ struct cascadeCorrelations { hEffOmegaMin = static_cast(effList->FindObject("hOmegaMinEff")); hEffOmegaPlus = static_cast(effList->FindObject("hOmegaPlusEff")); } + + zorroSummary.setObject(zorro.getZorroSummary()); } double getEfficiency(TH1D* h, double pT) @@ -323,6 +383,9 @@ struct cascadeCorrelations { {"hMassXiEffCorrected", "hMassXiEffCorrected", {HistType::kTHnSparseF, {invMassAxis, ptAxis, rapidityAxis, vertexAxis, multiplicityAxis}}, true}, {"hMassOmegaEffCorrected", "hMassOmegaEffCorrected", {HistType::kTHnSparseF, {invMassAxis, ptAxis, rapidityAxis, vertexAxis, multiplicityAxis}}, true}, + // trigger QA + {"hTriggerQA", "hTriggerQA", {HistType::kTH1F, {{2, -0.5, 1.5, "Trigger y/n"}}}}, + // basic selection variables {"hV0Radius", "hV0Radius", {HistType::kTH1F, {{1000, 0.0f, 100.0f, "cm"}}}}, {"hCascRadius", "hCascRadius", {HistType::kTH1F, {{1000, 0.0f, 100.0f, "cm"}}}}, @@ -339,7 +402,7 @@ struct cascadeCorrelations { {"hSelectionFlag", "hSelectionFlag", {HistType::kTH1I, {selectionFlagAxis}}}, {"hAutoCorrelation", "hAutoCorrelation", {HistType::kTH1I, {{4, -0.5f, 3.5f, "Types of SS autocorrelation"}}}}, {"hAutoCorrelationOS", "hAutoCorrelationOS", {HistType::kTH1I, {{2, -1.f, 1.f, "Charge of OS autocorrelated track"}}}}, - {"hPhi", "hPhi", {HistType::kTH1F, {{100, 0, 2 * PI, "#varphi"}}}}, + {"hPhi", "hPhi", {HistType::kTH1F, {{180, 0, TwoPI, "#varphi"}}}}, {"hEta", "hEta", {HistType::kTH1F, {{100, -2, 2, "#eta"}}}}, {"hRapidityXi", "hRapidityXi", {HistType::kTH1F, {rapidityAxis}}}, {"hRapidityOmega", "hRapidityOmega", {HistType::kTH1F, {rapidityAxis}}}, @@ -376,29 +439,33 @@ struct cascadeCorrelations { }; // cascade filter - Filter Selector = aod::cascadeflags::isSelected > 0; - - // Mixed events setup: - using myCascades = soa::Filtered; - using myCollisions = soa::Join; + Filter cascadeSelector = aod::cascadeflags::isSelected > 0; SliceCache cache; ConfigurableAxis axisVtxZ{"axisVtxZ", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis axisMult{"axisMult", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 100, 1000}, "Mixing bins - multiplicity"}; - using BinningType = ColumnBinningPolicy>; - BinningType colBinning{{axisVtxZ, axisMult}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. - // Preslice collisionSliceCascades = aod::CascDataExtSelected::collisionId; - SameKindPair pair{colBinning, nMixedEvents, -1, &cache}; + // ConfigurableAxis axisMult{"axisMult", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 100, 1000}, "Mixing bins - multiplicity"}; - void processSameEvent(myCollisions::iterator const& collision, myCascades const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIU const&) + void processSameEvent(MyCollisionsMult::iterator const& collision, MyCascades const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIU const&, aod::BCsWithTimestamps const&) { - if (!collision.sel8()) { + if (useTrigger) { + auto bc = collision.bc_as(); + zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), triggerList); + bool eventTrigger = zorro.isSelected(bc.globalBC()); + if (eventTrigger) { + registry.fill(HIST("hTriggerQA"), 1); + } else { + registry.fill(HIST("hTriggerQA"), 0); + return; + } + } + + if ((doSel8 && !collision.sel8()) || (doTFBorderCut && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder))) { return; } double weight; // Some QA on the cascades - for (auto& casc : Cascades) { + for (auto const& casc : Cascades) { if (casc.isSelected() <= 2) { // not exclusively an Omega --> consistent with Xi or both if (casc.sign() < 0) { registry.fill(HIST("hMassXiMinus"), casc.mXi(), casc.pt()); @@ -407,6 +474,7 @@ struct cascadeCorrelations { registry.fill(HIST("hMassXiPlus"), casc.mXi(), casc.pt()); weight = 1. / getEfficiency(hEffXiPlus, casc.pt()); } + // LOGF(info, "casc pt %f, weight %f", casc.pt(), weight); registry.fill(HIST("hMassXiEffCorrected"), casc.mXi(), casc.pt(), casc.yXi(), collision.posZ(), collision.multFT0M(), weight); registry.fill(HIST("hRapidityXi"), casc.yXi()); } @@ -456,7 +524,7 @@ struct cascadeCorrelations { int negIdAssoc = assoc.negTrackId(); // calculate angular correlations - double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -0.5 * PI); + double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -PIHalf); double invMassXiTrigg = trigger.mXi(); double invMassOmTrigg = trigger.mOmega(); @@ -495,29 +563,29 @@ struct cascadeCorrelations { } registry.fill(HIST("hDeltaPhiOS"), dphi); // Fill the different THnSparses depending on PID logic (important for rapidity & inv mass information) - if (trigger.isSelected() <= 2) { // trigger Xi + if (trigger.isSelected() <= 2 && TMath::Abs(trigger.yXi()) < maxRapidity) { // trigger Xi if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffXiMin, trigger.pt()) : 1. / getEfficiency(hEffXiPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("hXiXiOS"), dphi, trigger.yXi() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("hXiOmOS"), dphi, trigger.yXi() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); } } - if (trigger.isSelected() >= 2) { // trigger Omega + if (trigger.isSelected() >= 2 && TMath::Abs(trigger.yOmega()) < maxRapidity) { // trigger Omega if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, trigger.pt()) : 1. / getEfficiency(hEffOmegaPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("hOmXiOS"), dphi, trigger.yOmega() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassXiAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("hOmOmOS"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); @@ -559,29 +627,29 @@ struct cascadeCorrelations { } registry.fill(HIST("hDeltaPhiSS"), dphi); // Fill the different THnSparses depending on PID logic (important for rapidity & inv mass information) - if (trigger.isSelected() <= 2) { // trigger Xi + if (trigger.isSelected() <= 2 && TMath::Abs(trigger.yXi()) < maxRapidity) { // trigger Xi if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffXiMin, trigger.pt()) : 1. / getEfficiency(hEffXiPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("hXiXiSS"), dphi, trigger.yXi() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("hXiOmSS"), dphi, trigger.yXi() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); } } - if (trigger.isSelected() >= 2) { // trigger Omega + if (trigger.isSelected() >= 2 && TMath::Abs(trigger.yOmega()) < maxRapidity) { // trigger Omega if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, trigger.pt()) : 1. / getEfficiency(hEffOmegaPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("hOmXiSS"), dphi, trigger.yOmega() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassXiAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("hOmOmSS"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, collision.posZ(), collision.multFT0M(), weightTrigg * weightAssoc); @@ -591,12 +659,17 @@ struct cascadeCorrelations { } // correlations } // process same event - void processMixedEvent(myCollisions const& /*collisions*/, myCascades const& /*Cascades*/, + void processMixedEvent(MyCollisionsMult const& /*collisions*/, MyCascades const& /*Cascades*/, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIU const&) { // mixed events + // using BinningType = ColumnBinningPolicy>; + // BinningType colBinning{{axisVtxZ, axisMult}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. + using BinningType = ColumnBinningPolicy; + BinningType colBinning{{axisVtxZ}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. + SameKindPair pair{colBinning, nMixedEvents, -1, &cache}; - for (auto& [col1, cascades1, col2, cascades2] : pair) { + for (auto const& [col1, cascades1, col2, cascades2] : pair) { if (!col1.sel8() || !col2.sel8()) continue; if (TMath::Abs(col1.posZ()) > zVertexCut || TMath::Abs(col2.posZ()) > zVertexCut) @@ -624,7 +697,7 @@ struct cascadeCorrelations { continue; } - double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -0.5 * PI); + double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -PIHalf); double invMassXiTrigg = trigger.mXi(); double invMassOmTrigg = trigger.mOmega(); @@ -671,29 +744,29 @@ struct cascadeCorrelations { registry.fill(HIST("MixedEvents/hMEDeltaPhiOS"), dphi); // Fill the different THnSparses depending on PID logic (important for rapidity & inv mass information) - if (trigger.isSelected() <= 2) { // trigger Xi + if (trigger.isSelected() <= 2 && TMath::Abs(trigger.yXi()) < maxRapidity) { // trigger Xi if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffXiMin, trigger.pt()) : 1. / getEfficiency(hEffXiPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEXiXiOS"), dphi, trigger.yXi() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEXiOmOS"), dphi, trigger.yXi() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); } } - if (trigger.isSelected() >= 2) { // trigger Omega + if (trigger.isSelected() >= 2 && TMath::Abs(trigger.yOmega()) < maxRapidity) { // trigger Omega if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, trigger.pt()) : 1. / getEfficiency(hEffOmegaPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEOmXiOS"), dphi, trigger.yOmega() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassXiAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEOmOmOS"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); @@ -736,29 +809,29 @@ struct cascadeCorrelations { registry.fill(HIST("MixedEvents/hMEDeltaPhiSS"), dphi); - if (trigger.isSelected() <= 2) { // trigger Xi + if (trigger.isSelected() <= 2 && TMath::Abs(trigger.yXi()) < maxRapidity) { // trigger Xi if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffXiMin, trigger.pt()) : 1. / getEfficiency(hEffXiPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEXiXiSS"), dphi, trigger.yXi() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEXiOmSS"), dphi, trigger.yXi() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); } } - if (trigger.isSelected() >= 2) { // trigger Omega + if (trigger.isSelected() >= 2 && TMath::Abs(trigger.yOmega()) < maxRapidity) { // trigger Omega if (doEfficiencyCorrection) weightTrigg = trigger.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, trigger.pt()) : 1. / getEfficiency(hEffOmegaPlus, trigger.pt()); - if (assoc.isSelected() <= 2) { // assoc Xi + if (assoc.isSelected() <= 2 && TMath::Abs(assoc.yXi()) < maxRapidity) { // assoc Xi if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffXiMin, assoc.pt()) : 1. / getEfficiency(hEffXiPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEOmXiSS"), dphi, trigger.yOmega() - assoc.yXi(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassXiAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); } - if (assoc.isSelected() >= 2) { // assoc Omega + if (assoc.isSelected() >= 2 && TMath::Abs(assoc.yOmega()) < maxRapidity) { // assoc Omega if (doEfficiencyCorrection) weightAssoc = assoc.sign() < 0 ? 1. / getEfficiency(hEffOmegaMin, assoc.pt()) : 1. / getEfficiency(hEffOmegaPlus, assoc.pt()); registry.fill(HIST("MixedEvents/hMEOmOmSS"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, col1.posZ(), col1.multFT0M(), weightTrigg * weightAssoc); @@ -766,17 +839,17 @@ struct cascadeCorrelations { } } // same sign } // correlations - } // collisions + } // collisions } // process mixed events - PROCESS_SWITCH(cascadeCorrelations, processSameEvent, "Process same events", true); - PROCESS_SWITCH(cascadeCorrelations, processMixedEvent, "Process mixed events", true); + PROCESS_SWITCH(CascadeCorrelations, processSameEvent, "Process same events", true); + PROCESS_SWITCH(CascadeCorrelations, processMixedEvent, "Process mixed events", true); -}; // struct +}; // struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; } From 4c4d354b2e2a8d9f4a5de604be0b42390eb23b66 Mon Sep 17 00:00:00 2001 From: Sergio Garcia <47090312+singiamtel@users.noreply.github.com> Date: Thu, 5 Dec 2024 19:16:09 +0100 Subject: [PATCH 261/459] [PWGDQ] Fix vector type (#8825) --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 5aae38f65df..7d14f564809 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -542,7 +542,7 @@ struct TableMaker { fOccup.oContribShortC.clear(); std::map oBC; // key: collision index; value: global BC - std::map> oBCreversed; // key: global BC, value: list of collisions attached to this BC + std::map> oBCreversed; // key: global BC, value: list of collisions attached to this BC std::map oVtxZ; // key: collision index; value: vtx-z position std::map collMultPos; // key: collision index; value: tpc multiplicity on the A side std::map collMultNeg; // key: collision index; value: tpc multiplicity on the C side @@ -564,7 +564,7 @@ struct TableMaker { // if more than one collision per bunch, add that collision to the list for that bunch if (oBCreversed.find(bc) == oBCreversed.end()) { - std::vector evs = {collision.globalIndex()}; + std::vector evs = {collision.globalIndex()}; oBCreversed[bc] = evs; } else { auto& evs = oBCreversed[bc]; From 29872744ad991220b7259bad48724f2ded9c42d7 Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:30:37 +0100 Subject: [PATCH 262/459] [PWGDQ] Adding TProfile with cumulants weights + PI constants correctly (#8828) --- PWGDQ/Core/HistogramsLibrary.cxx | 48 +++++++++++++++++--------------- PWGDQ/Core/HistogramsLibrary.h | 1 + 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 4bc43fe386e..8c5723839cc 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -13,6 +13,7 @@ // #include "PWGDQ/Core/HistogramsLibrary.h" #include "VarManager.h" +#include "CommonConstants/MathConstants.h" void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* histClass, const char* groupName, const char* subGroupName) { @@ -275,6 +276,9 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "Run2_centrFT0C_Corr2REFetagap_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "Run2_centrFT0C_Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2Corr4REF_ev", "Run2_centrFT0C_Corr2Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2CORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); + hm->AddHistogram(histClass, "centrFT0C_M11REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 1000000.0, VarManager::kM11REF); + hm->AddHistogram(histClass, "centrFT0C_M11etagap_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 10000000.0, VarManager::kM11REFetagap); + hm->AddHistogram(histClass, "centrFT0C_M1111REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 100000000000000.0, VarManager::kM1111REF); if (subGroupStr.Contains("cross")) { hm->AddHistogram(histClass, "Q1ZNACXX_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACXX); hm->AddHistogram(histClass, "Q1ZNACYY_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 4000, -2, 2, VarManager::kQ1ZNACYY); @@ -380,8 +384,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (!groupStr.CompareTo("track")) { hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); - hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Pt", "#varphi distribution", false, 50, 0.0, 10.0, VarManager::kPt, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi); hm->AddHistogram(histClass, "IsPVcontrib_pt", "is PV contributor vs pt", false, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); hm->AddHistogram(histClass, "IsPVcontrib_pt_prof", "is PV contributor vs pt", true, 50, 0.0, 50.0, VarManager::kPt, 2, -0.5, 1.5, VarManager::kPVContributor); if (subGroupStr.Contains("ambiguity") && !subGroupStr.Contains("muon")) { @@ -393,10 +397,10 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("cent")) { hm->AddHistogram(histClass, "Pt_CentFT0C", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt, 20, 0.0, 100.0, VarManager::kCentFT0C); hm->AddHistogram(histClass, "Eta_CentFT0C", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta, 20, 0.0, 100.0, VarManager::kCentFT0C); - hm->AddHistogram(histClass, "Phi_CentFT0C", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi, 20, 0.0, 100.0, VarManager::kCentFT0C); + hm->AddHistogram(histClass, "Phi_CentFT0C", "#varphi distribution", false, 500, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi, 20, 0.0, 100.0, VarManager::kCentFT0C); } if (subGroupStr.Contains("kine")) { - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "Eta_Pt", "", false, 20, -1.0, 1.0, VarManager::kEta, 100, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta_VtxZ", "", false, 100, -1.0, 1.0, VarManager::kEta, 300, -15.0, 15.0, VarManager::kVtxZ); hm->AddHistogram(histClass, "Px", "p_{x} distribution", false, 200, 0.0, 20.0, VarManager::kPx); @@ -455,8 +459,8 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("tpc")) { hm->AddHistogram(histClass, "TPCncls", "Number of cluster in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCncls_vsTimeFromSOR", "Number of cluster in TPC vs time from SOR", true, 10000, 0.0, 1000., VarManager::kTimeFromSOR, 160, -0.5, 159.5, VarManager::kTPCncls); - hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); - hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, TMath::TwoPi(), VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_Phi", "Number of cluster in TPC vs #varphi", true, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); + hm->AddHistogram(histClass, "TPCncls_PhiPt", "Number of cluster in TPC vs p_{T} and #varphi", true, 20, 0.0, 10.0, VarManager::kPt, 720, 0.0, o2::constants::math::TwoPI, VarManager::kPhi, 10, 0.0, 200.0, VarManager::kTPCncls); hm->AddHistogram(histClass, "TPCnclsCR", "Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCnclsCR); hm->AddHistogram(histClass, "TPCncls_TPCnclsCR", "Number of TPC cluster vs Number of crossed rows in TPC", false, 160, -0.5, 159.5, VarManager::kTPCncls, 160, -0.5, 159.5, VarManager::kTPCnclsCR); hm->AddHistogram(histClass, "IsTPCrefit", "", false, 2, -0.5, 1.5, VarManager::kIsTPCrefit); @@ -769,14 +773,14 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "MCHBitMap_vs_pt", "MCH vs pt", false, 1025, 0.0, 1025.0, VarManager::kMCHBitMap, 400, 0, 100, VarManager::kPt); hm->AddHistogram(histClass, "MuonTime", "", false, 100, -1.0, 1.0, VarManager::kMuonTime); hm->AddHistogram(histClass, "MuonTimeRes", "", false, 100, -1.0, 1.0, VarManager::kMuonTimeRes); - hm->AddHistogram(histClass, "MuonDcaX_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); - hm->AddHistogram(histClass, "MuonDcaY_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "MuonDcaX_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); + hm->AddHistogram(histClass, "MuonDcaY_vs_phi", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "MuonDcaX_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAx, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "MuonDcaY_vs_eta", "", false, 2000, -20.0, 20.0, VarManager::kMuonDCAy, 500, -5.0, 5.0, VarManager::kEta); } else { hm->AddHistogram(histClass, "Pt", "p_{T} distribution", false, 2000, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "AmbiguityInBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsInBunch); hm->AddHistogram(histClass, "AmbiguityOutOfBunch", "", false, 10, 0.0, 10., VarManager::kMuonNAssocsOutOfBunch); hm->AddHistogram(histClass, "AmbiguityInBunch_pt", "in bunch collision ambiguity vs p_{T}", false, 50, 0.0, 10.0, VarManager::kPt, 10, 0., 10., VarManager::kMuonNAssocsInBunch); @@ -799,7 +803,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("mc")) { hm->AddHistogram(histClass, "Pt_vs_PtMC", "pT vs MC pT", false, 200, 0.0, 20.0, VarManager::kPt, 200, 0.0, 20.0, VarManager::kMCPt); hm->AddHistogram(histClass, "Eta_vs_EtaMC", "#eta vs MC #eta", false, 50, -1.0, 1.0, VarManager::kEta, 50, -1.0, 1.0, VarManager::kMCEta); - hm->AddHistogram(histClass, "Phi_vs_PhiMC", "#varphi vs MC #varphi", false, 50, 0.0, 2. * TMath::Pi(), VarManager::kPhi, 50, 0.0, 2. * TMath::Pi(), VarManager::kMCPhi); + hm->AddHistogram(histClass, "Phi_vs_PhiMC", "#varphi vs MC #varphi", false, 50, 0.0, 2. * o2::constants::math::PI, VarManager::kPhi, 50, 0.0, 2. * o2::constants::math::PI, VarManager::kMCPhi); hm->AddHistogram(histClass, "TrackPDGcode", "PDG code of track", false, 10001, -5000, 5000, VarManager::kMCPdgCode); } if (subGroupStr.Contains("mcmother")) { @@ -820,7 +824,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt_lepton1", "", false, 100, -2.0, 2.0, VarManager::kEta1, 200, 0.0, 20.0, VarManager::kPt1); hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2); hm->AddHistogram(histClass, "Eta_Pt_Photon", "", false, 100, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kPairEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPairPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kPairEta, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPairPhi); hm->AddHistogram(histClass, "Mass_Dilepton", "", false, 4500, 0.0, 4.5, VarManager::kPairMassDau); hm->AddHistogram(histClass, "Mass_Photon", "", false, 500, 0.0, 0.1, VarManager::kMassDau); hm->AddHistogram(histClass, "Mass_Dilepton_Mass_Photon", "", false, 500, 0.0, 5.0, VarManager::kPairMassDau, 500, 0.0, 5.0, VarManager::kMassDau); @@ -842,7 +846,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt_lepton2", "", false, 100, -2.0, 2.0, VarManager::kEta2, 200, 0.0, 20.0, VarManager::kPt2); hm->AddHistogram(histClass, "Mass", "", false, 500, 0.0, 5.0, VarManager::kMass); hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); } if (!groupStr.CompareTo("mctruth_track")) { hm->AddHistogram(histClass, "PtMC", "MC pT", false, 200, 0.0, 20.0, VarManager::kMCPt); @@ -887,12 +891,12 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h if (subGroupStr.Contains("polarization")) { hm->AddHistogram(histClass, "cosThetaHE", "", false, 100, -1., 1., VarManager::kCosThetaHE); hm->AddHistogram(histClass, "cosThetaCS", "", false, 100, -1., 1., VarManager::kCosThetaCS); - hm->AddHistogram(histClass, "PhiHE", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kPhiHE); - hm->AddHistogram(histClass, "PhiCS", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kPhiCS); + hm->AddHistogram(histClass, "PhiHE", "", false, 100, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiHE); + hm->AddHistogram(histClass, "PhiCS", "", false, 100, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiCS); hm->AddHistogram(histClass, "Mass_Pt_cosThetaHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -1., 1., VarManager::kCosThetaHE); hm->AddHistogram(histClass, "Mass_Pt_cosThetaCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -1., 1., VarManager::kCosThetaCS); - hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -TMath::Pi(), TMath::Pi(), VarManager::kPhiHE); - hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -TMath::Pi(), TMath::Pi(), VarManager::kPhiCS); + hm->AddHistogram(histClass, "Mass_Pt_PhiHE", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiHE); + hm->AddHistogram(histClass, "Mass_Pt_PhiCS", "", false, 100, 1.0, 5.0, VarManager::kMass, 250, 0.0, 25.0, VarManager::kPt, 40, -o2::constants::math::PI, o2::constants::math::PI, VarManager::kPhiCS); } if (subGroupStr.Contains("upsilon")) { hm->AddHistogram(histClass, "MassUpsilon_Pt", "", false, 500, 7.0, 12.0, VarManager::kMass, 400, 0.0, 40.0, VarManager::kPt); @@ -1248,19 +1252,19 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "DeltaPhiPair", "", false, 130, -6.5, 6.5, VarManager::kDeltaPhiPair); } if (subGroupStr.Contains("correlation-emu")) { - hm->AddHistogram(histClass, "DeltaPhiPair2", "", false, 600, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), VarManager::kDeltaPhiPair2); + hm->AddHistogram(histClass, "DeltaPhiPair2", "", false, 600, -o2::constants::math::PIHalf, 1.5 * o2::constants::math::PI, VarManager::kDeltaPhiPair2); hm->AddHistogram(histClass, "DeltaEtaPair2", "", false, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); - hm->AddHistogram(histClass, "DeltaPhiPair2_DeltaEtaPair2", "", false, 600, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), VarManager::kDeltaPhiPair2, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); + hm->AddHistogram(histClass, "DeltaPhiPair2_DeltaEtaPair2", "", false, 600, -o2::constants::math::PIHalf, 1.5 * o2::constants::math::PI, VarManager::kDeltaPhiPair2, 350, 1.5, 5.0, VarManager::kDeltaEtaPair2); } if (subGroupStr.Contains("dielectrons")) { if (subGroupStr.Contains("prefilter")) { hm->AddHistogram(histClass, "MassLow_OpeningAngle", "", false, 150, 0., 0.15, VarManager::kMass, 80, 0., 0.8, VarManager::kOpeningAngle); } if (subGroupStr.Contains("phiv")) { - hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, TMath::Pi(), VarManager::kPairPhiv); + hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, o2::constants::math::PI, VarManager::kPairPhiv); } if (subGroupStr.Contains("double-phi-v")) { - hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, TMath::Pi(), VarManager::kPairPhiv, "", "", "", -1, -1, true); + hm->AddHistogram(histClass, "Mass_Pt_PhiV", "", false, 20, 0.0, 0.2, VarManager::kMass, 100, 0.0, 10.0, VarManager::kPt, 100, 0.0, o2::constants::math::PI, VarManager::kPairPhiv, "", "", "", -1, -1, true); } if (subGroupStr.Contains("largemass-phi-v")) { // binning for mee at large scales: @@ -1287,7 +1291,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h // steps of size pi/100 double phiv_bins[101]; for (int i = 0; i <= 100; i++) - phiv_bins[i] = TMath::Pi() / 100. * i; + phiv_bins[i] = o2::constants::math::PI / 100. * i; int nbins_phiv = sizeof(phiv_bins) / sizeof(*phiv_bins) - 1; // 3D histo @@ -1560,7 +1564,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Pt_Photon", "p_{T} distribution", false, 4500, 0.0, 4.5, VarManager::kPt); hm->AddHistogram(histClass, "Eta", "#eta distribution", false, 500, -5.0, 5.0, VarManager::kEta); hm->AddHistogram(histClass, "Eta_Pt", "", false, 100, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); - hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * TMath::Pi(), 2. * TMath::Pi(), VarManager::kPhi); + hm->AddHistogram(histClass, "Phi", "#varphi distribution", false, 500, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); hm->AddHistogram(histClass, "Mass_Photon", "", false, 500, 0.0, 0.1, VarManager::kMassDau); hm->AddHistogram(histClass, "Mass_Pt", "", false, 500, 0.0, 5.0, VarManager::kMassDau, 200, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Rapidity", "", false, 400, -4.0, 4.0, VarManager::kRap); diff --git a/PWGDQ/Core/HistogramsLibrary.h b/PWGDQ/Core/HistogramsLibrary.h index 60fe4cc8714..aa53a2674cc 100644 --- a/PWGDQ/Core/HistogramsLibrary.h +++ b/PWGDQ/Core/HistogramsLibrary.h @@ -18,6 +18,7 @@ #include #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/VarManager.h" +#include "CommonConstants/MathConstants.h" namespace o2::aod { From 82b7d6f19158c479cfe0d22663adeeb257e3ada7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 5 Dec 2024 21:04:11 +0100 Subject: [PATCH 263/459] [PWGHF] Remove unnecessary subscriptions from B+ derived data creator (#8829) --- PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx index 3ee02a28bb8..c2e424c460c 100644 --- a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -91,7 +91,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { using CollisionsWCentMult = soa::Join; using CollisionsWMcCentMult = soa::Join; - using TracksWPid = soa::Join; + using TracksWPid = soa::Join; using SelectedCandidates = soa::Filtered>; using SelectedCandidatesMc = soa::Filtered>; using SelectedCandidatesMl = soa::Filtered>; From 54b25cc2017d7bc57e84249590df1899e8e735c8 Mon Sep 17 00:00:00 2001 From: Ionut Cristian Arsene Date: Fri, 6 Dec 2024 08:00:49 +0100 Subject: [PATCH 264/459] [PWGDQ] Small fixes for data type of collision indices (#8837) Co-authored-by: Ionut Cristian Arsene --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 7d14f564809..e87c49de296 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -541,11 +541,11 @@ struct TableMaker { fOccup.oContribShortA.clear(); fOccup.oContribShortC.clear(); - std::map oBC; // key: collision index; value: global BC + std::map oBC; // key: collision index; value: global BC std::map> oBCreversed; // key: global BC, value: list of collisions attached to this BC - std::map oVtxZ; // key: collision index; value: vtx-z position - std::map collMultPos; // key: collision index; value: tpc multiplicity on the A side - std::map collMultNeg; // key: collision index; value: tpc multiplicity on the C side + std::map oVtxZ; // key: collision index; value: vtx-z position + std::map collMultPos; // key: collision index; value: tpc multiplicity on the A side + std::map collMultNeg; // key: collision index; value: tpc multiplicity on the C side const double bcUS = o2::constants::lhc::LHCBunchSpacingNS / 1000.0; // BC spacing in micro-seconds const double vdrift = 2.5; // cm / mus From 7ccff5cc85ea0c50d2db17440e9cadf1aa337b16 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Fri, 6 Dec 2024 09:12:19 +0100 Subject: [PATCH 265/459] [PWGLF] fix trigger efficiency (#8839) --- PWGLF/Tasks/Nuspex/ebyeMult.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/ebyeMult.cxx b/PWGLF/Tasks/Nuspex/ebyeMult.cxx index 42a316319de..441a42f841a 100644 --- a/PWGLF/Tasks/Nuspex/ebyeMult.cxx +++ b/PWGLF/Tasks/Nuspex/ebyeMult.cxx @@ -495,7 +495,8 @@ struct EbyeMult { int partType = getPartType(particle.pdgCode()); if (partType < PartTypes::kOther) { - ++nParticles; + if (std::abs(particle.eta()) < etaMax) + ++nParticles; if (std::abs(particle.eta()) < 1.f) { ++partInAcc; } @@ -567,7 +568,7 @@ struct EbyeMult { // search generated INEL > 0 (one charged particle in |eta| < 1) for (const auto& mcCollision : mcCollisions) { - int mult = genMultINELgtZERO(mcCollision, mcParticles) > 0; + int mult = genMultINELgtZERO(mcCollision, mcParticles); if (mult > 0) { histos.fill(HIST("GenINELgtZERO"), mult); } From c212fb9d3599fda945a12e32feeef153e253c254 Mon Sep 17 00:00:00 2001 From: Rohaan Deb <67634136+RD0407@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:05:47 +0100 Subject: [PATCH 266/459] [PWGLF] Update PWGLF/Tasks/Nuspex/spectraTOF.cxx (#8826) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 40 ++++++++++++++++--------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index ce950f9c0b9..dd7d43705f6 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -735,7 +735,6 @@ struct tofSpectra { const auto& nsigmaTPC = o2::aod::pidutils::tpcNSigma(track); // const auto id = track.sign() > 0 ? id : id + Np; const float multiplicity = getMultiplicity(collision); - if (multiplicityEstimator == MultCodes::kNoMultiplicity) { if (track.sign() > 0) { histos.fill(HIST(hnsigmatpc[id]), track.pt(), nsigmaTPC); @@ -1345,6 +1344,15 @@ struct tofSpectra { if (!isTrackSelected(track, collision)) { continue; } + if (std::abs(track.rapidity(PID::getMass(2))) > trkselOptions.cfgCutY) { + return; + } + if (std::abs(track.rapidity(PID::getMass(3))) > trkselOptions.cfgCutY) { + return; + } + if (std::abs(track.rapidity(PID::getMass(4))) > trkselOptions.cfgCutY) { + return; + } if (includeCentralityToTracks) { if (track.sign() > 0) { @@ -1369,32 +1377,26 @@ struct tofSpectra { } } } - const auto& nsigmaTPCPi = o2::aod::pidutils::tpcNSigma<2>(track); - const auto& nsigmaTPCKa = o2::aod::pidutils::tpcNSigma<3>(track); - const auto& nsigmaTPCPr = o2::aod::pidutils::tpcNSigma<4>(track); - const auto& nsigmaTOFPi = o2::aod::pidutils::tofNSigma<2>(track); - const auto& nsigmaTOFKa = o2::aod::pidutils::tofNSigma<3>(track); - const auto& nsigmaTOFPr = o2::aod::pidutils::tofNSigma<4>(track); if (track.sign() > 0) { - histos.fill(HIST("nsigmatpc/test_occupancy/pos/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/pos/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/pos/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/pos/pi"), track.pt(), track.tpcNSigmaPi(), multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/pos/ka"), track.pt(), track.tpcNSigmaKa(), multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/pos/pr"), track.pt(), track.tpcNSigmaPr(), multiplicity, occupancy); } else if (track.sign() < 0) { - histos.fill(HIST("nsigmatpc/test_occupancy/neg/pi"), track.pt(), nsigmaTPCPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/neg/ka"), track.pt(), nsigmaTPCKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatpc/test_occupancy/neg/pr"), track.pt(), nsigmaTPCPr, multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/neg/pi"), track.pt(), track.tpcNSigmaPi(), multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/neg/ka"), track.pt(), track.tpcNSigmaKa(), multiplicity, occupancy); + histos.fill(HIST("nsigmatpc/test_occupancy/neg/pr"), track.pt(), track.tpcNSigmaPr(), multiplicity, occupancy); } if (!track.hasTOF()) { return; } if (track.sign() > 0) { - histos.fill(HIST("nsigmatof/test_occupancy/pos/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/pos/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/pos/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/pos/pi"), track.pt(), track.tofNSigmaPi(), multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/pos/ka"), track.pt(), track.tofNSigmaKa(), multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/pos/pr"), track.pt(), track.tofNSigmaPr(), multiplicity, occupancy); } else if (track.sign() < 0) { - histos.fill(HIST("nsigmatof/test_occupancy/neg/pi"), track.pt(), nsigmaTOFPi, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/neg/ka"), track.pt(), nsigmaTOFKa, multiplicity, occupancy); - histos.fill(HIST("nsigmatof/test_occupancy/neg/pr"), track.pt(), nsigmaTOFPr, multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/neg/pi"), track.pt(), track.tofNSigmaPi(), multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/neg/ka"), track.pt(), track.tofNSigmaKa(), multiplicity, occupancy); + histos.fill(HIST("nsigmatof/test_occupancy/neg/pr"), track.pt(), track.tofNSigmaPr(), multiplicity, occupancy); } } // track } // process function From 2d7ae45b738b6bed9c5317384aa8745a07e0f2c9 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:20:04 +0100 Subject: [PATCH 267/459] [PWGEM/PhotonMeson,PWGJE] Add clusterizer selection to EM tasks (#8820) Co-authored-by: Nicolas Strangmann --- PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx | 12 +++++++++++- PWGEM/PhotonMeson/Core/EMCPhotonCut.h | 11 ++++++++++- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 2 ++ PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 2 ++ PWGEM/PhotonMeson/DataModel/gammaTables.h | 2 +- .../TableProducer/skimmerGammaCalo.cxx | 3 ++- PWGEM/PhotonMeson/Tasks/emcalQC.cxx | 17 ++++++++++++----- PWGJE/TableProducer/emcalCorrectionTask.cxx | 2 +- 8 files changed, 41 insertions(+), 10 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx b/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx index 4fea46fe3cd..582b9754057 100644 --- a/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx +++ b/PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx @@ -13,13 +13,20 @@ // Class for EMCal cluster selection // +#include #include "Framework/Logger.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" +#include "PWGJE/DataModel/EMCALClusters.h" ClassImp(EMCPhotonCut); -const char* EMCPhotonCut::mCutNames[static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts)] = {"Energy", "NCell", "M02", "Timing", "TrackMatching", "Exotic"}; +const char* EMCPhotonCut::mCutNames[static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts)] = {"Definition", "Energy", "NCell", "M02", "Timing", "TrackMatching", "Exotic"}; +void EMCPhotonCut::SetClusterizer(std::string clusterDefinitionString) +{ + mDefinition = static_cast(o2::aod::emcalcluster::getClusterDefinitionFromString(clusterDefinitionString)); + LOG(info) << "EMCal Photon Cut, set cluster definition to: " << mDefinition << " (" << clusterDefinitionString << ")"; +} void EMCPhotonCut::SetMinE(float min) { mMinE = min; @@ -72,6 +79,9 @@ void EMCPhotonCut::print() const LOG(info) << "EMCal Photon Cut:"; for (int i = 0; i < static_cast(EMCPhotonCuts::kNCuts); i++) { switch (static_cast(i)) { + case EMCPhotonCuts::kDefinition: + LOG(info) << mCutNames[i] << " > " << mDefinition; + break; case EMCPhotonCuts::kEnergy: LOG(info) << mCutNames[i] << " > " << mMinE; break; diff --git a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h index 2ce3d91173c..8bfd8ca630f 100644 --- a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h +++ b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h @@ -34,7 +34,8 @@ class EMCPhotonCut : public TNamed enum class EMCPhotonCuts : int { // cluster cut - kEnergy = 0, + kDefinition = 0, + kEnergy, kNCell, kM02, kTiming, @@ -49,6 +50,9 @@ class EMCPhotonCut : public TNamed template bool IsSelected(Cluster const& cluster) const { + if (!IsSelectedEMCal(EMCPhotonCuts::kDefinition, cluster)) { + return false; + } if (!IsSelectedEMCal(EMCPhotonCuts::kEnergy, cluster)) { return false; } @@ -75,6 +79,9 @@ class EMCPhotonCut : public TNamed bool IsSelectedEMCal(const EMCPhotonCuts& cut, Cluster const& cluster) const { switch (cut) { + case EMCPhotonCuts::kDefinition: + return cluster.definition() == mDefinition; + case EMCPhotonCuts::kEnergy: return cluster.e() > mMinE; @@ -113,6 +120,7 @@ class EMCPhotonCut : public TNamed } // Setters + void SetClusterizer(std::string clusterDefinitionString = "kV3Default"); void SetMinE(float min = 0.7f); void SetMinNCell(int min = 1); void SetM02Range(float min = 0.1f, float max = 0.7f); @@ -128,6 +136,7 @@ class EMCPhotonCut : public TNamed private: // EMCal cluster cuts + int mDefinition{10}; ///< clusterizer definition float mMinE{0.7f}; ///< minimum energy int mMinNCell{1}; ///< minimum number of cells per cluster float mMinM02{0.1f}; ///< minimum M02 for a cluster diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index 8856fdaf6dd..b452030bc24 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -180,6 +180,7 @@ struct Pi0EtaToGammaGamma { EMCPhotonCut fEMCCut; struct : ConfigurableGroup { std::string prefix = "emccut_group"; + Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; @@ -422,6 +423,7 @@ struct Pi0EtaToGammaGamma { fEMCCut = EMCPhotonCut("fEMCCut", "fEMCCut"); + fEMCCut.SetClusterizer(emccuts.clusterDefinition); fEMCCut.SetMinE(emccuts.EMC_minE); fEMCCut.SetMinNCell(emccuts.EMC_minNCell); fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index c342423eff9..4ce009632dc 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -168,6 +168,7 @@ struct Pi0EtaToGammaGammaMC { EMCPhotonCut fEMCCut; struct : ConfigurableGroup { std::string prefix = "emccut_group"; + Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; @@ -385,6 +386,7 @@ struct Pi0EtaToGammaGammaMC { fEMCCut = EMCPhotonCut("fEMCCut", "fEMCCut"); + fEMCCut.SetClusterizer(emccuts.clusterDefinition); fEMCCut.SetMinE(emccuts.EMC_minE); fEMCCut.SetMinNCell(emccuts.EMC_minNCell); fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index 9b91eb0864f..5c366715b44 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -459,7 +459,7 @@ DECLARE_SOA_COLUMN(TrackPt, trackpt, std::vector); DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float e, float eta, float m = 0) -> float { return sqrt(e * e - m * m) / cosh(eta); }); //! cluster pt, mass to be given as argument when getter is called! } // namespace emccluster DECLARE_SOA_TABLE(SkimEMCClusters, "AOD", "SKIMEMCCLUSTERS", //! table of skimmed EMCal clusters - o2::soa::Index<>, skimmedcluster::CollisionId, skimmedcluster::E, skimmedcluster::Eta, skimmedcluster::Phi, + o2::soa::Index<>, skimmedcluster::CollisionId, emccluster::Definition, skimmedcluster::E, skimmedcluster::Eta, skimmedcluster::Phi, skimmedcluster::M02, skimmedcluster::NCells, skimmedcluster::Time, emccluster::IsExotic, emccluster::TrackEta, emccluster::TrackPhi, emccluster::TrackP, emccluster::TrackPt, emccluster::Pt); using SkimEMCCluster = SkimEMCClusters::iterator; diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx index aff407a83f3..c7da3fa270f 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaCalo.cxx @@ -14,6 +14,7 @@ /// \author marvin.hemmer@cern.ch #include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -137,7 +138,7 @@ struct skimmerGammaCalo { historeg.fill(HIST("hCaloClusterEOut"), emccluster.energy()); historeg.fill(HIST("hCaloClusterFilter"), 4); - tableGammaEMCReco(emccluster.collisionId(), emccluster.energy(), emccluster.eta(), emccluster.phi(), emccluster.m02(), + tableGammaEMCReco(emccluster.collisionId(), emccluster.definition(), emccluster.energy(), emccluster.eta(), emccluster.phi(), emccluster.m02(), emccluster.nCells(), emccluster.time(), emccluster.isExotic(), vEta, vPhi, vP, vPt); } } diff --git a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx index dc5590fd795..fe81608516c 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx @@ -76,6 +76,7 @@ struct emcalQC { EMCPhotonCut fEMCCut; struct : ConfigurableGroup { std::string prefix = "emccut_group"; + Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; @@ -115,6 +116,7 @@ struct emcalQC { const float f = emccuts.EMC_TM_Phi->at(2); LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); + fEMCCut.SetClusterizer(emccuts.clusterDefinition); fEMCCut.SetMinE(emccuts.EMC_minE); fEMCCut.SetMinNCell(emccuts.EMC_minNCell); fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); @@ -193,9 +195,13 @@ struct emcalQC { auto clusters_per_coll = clusters.sliceBy(perCollision, collision.collisionId()); fRegistry.fill(HIST("Cluster/before/hNgamma"), clusters_per_coll.size(), collision.weight()); - int ng = 0; + int ngBefore = 0; + int ngAfter = 0; for (auto& cluster : clusters_per_coll) { // Fill the cluster properties before applying any cuts + if (!fEMCCut.IsSelectedEMCal(EMCPhotonCut::EMCPhotonCuts::kDefinition, cluster)) + continue; + ngBefore++; o2::aod::pwgem::photonmeson::utils::clusterhistogram::fillClusterHistograms<0>(&fRegistry, cluster, cfgDo2DQA, collision.weight()); // Apply cuts one by one and fill in hClusterQualityCuts histogram @@ -205,10 +211,10 @@ struct emcalQC { bool survivesIsSelectedEMCalCuts = true; // Survives "manual" cuts listed in this task bool survivesIsSelectedCuts = fEMCCut.IsSelected(cluster); // Survives the cutlist defines in EMCPhotonCut.h, which is also used in the Pi0Eta task - for (int icut = 0; icut < static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts); icut++) { // Loop through different cut observables + for (int icut = 1; icut < static_cast(EMCPhotonCut::EMCPhotonCuts::kNCuts); icut++) { // Loop through different cut observables, start at 1 to ignore ClusterDefinition EMCPhotonCut::EMCPhotonCuts specificcut = static_cast(icut); if (!fEMCCut.IsSelectedEMCal(specificcut, cluster)) { // Check whether cluster passes this cluster requirement, if not, fill why in the next row - fRegistry.fill(HIST("Cluster/hClusterQualityCuts"), icut + 1, cluster.e(), collision.weight()); + fRegistry.fill(HIST("Cluster/hClusterQualityCuts"), icut, cluster.e(), collision.weight()); survivesIsSelectedEMCalCuts = false; } } @@ -220,10 +226,11 @@ struct emcalQC { if (survivesIsSelectedCuts) { o2::aod::pwgem::photonmeson::utils::clusterhistogram::fillClusterHistograms<1>(&fRegistry, cluster, cfgDo2DQA, collision.weight()); fRegistry.fill(HIST("Cluster/hClusterQualityCuts"), 7., cluster.e(), collision.weight()); - ng++; + ngAfter++; } } - fRegistry.fill(HIST("Cluster/after/hNgamma"), ng, collision.weight()); + fRegistry.fill(HIST("Cluster/before/hNgamma"), ngBefore, collision.weight()); + fRegistry.fill(HIST("Cluster/after/hNgamma"), ngAfter, collision.weight()); } // end of collision loop } // end of process diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index e2a0b1a3a9d..576df1a585a 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -861,8 +861,8 @@ struct EmcalCorrectionTask { timeshift = 1.9; // Parameters extracted from LHC24aj (pp), but also usable for other periods } LOG(debug) << "Shift the cell time by " << timeshift << " + " << timesmear << " ns"; - return timeshift + timesmear; } + return timeshift + timesmear; }; }; From 97ae92d50d0a8dcd549b7af61f519cc0a976f5f1 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Fri, 6 Dec 2024 13:23:58 +0100 Subject: [PATCH 268/459] [PWGLF] revert flag checks (#8842) --- PWGLF/Tasks/Nuspex/ebyeMult.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/ebyeMult.cxx b/PWGLF/Tasks/Nuspex/ebyeMult.cxx index 441a42f841a..7763d1d3e3b 100644 --- a/PWGLF/Tasks/Nuspex/ebyeMult.cxx +++ b/PWGLF/Tasks/Nuspex/ebyeMult.cxx @@ -373,8 +373,8 @@ struct EbyeMult { } } - histos.fill(HIST("QA/nTrklCorrelation"), nTracklets[0], nTracklets[1]); - histos.fill(HIST("QA/nV0MCorrelation"), nTracklets[0], centrality); + histos.fill(HIST("QA/nTrklCorrelation"), nTracklets[1], nTracklets[0]); + histos.fill(HIST("QA/nV0MCorrelation"), centrality, nTracklets[0]); nTrackletsColl = nTracklets[1]; candidateEvent.nTklRec = nTracklets[0]; @@ -396,7 +396,7 @@ struct EbyeMult { auto mcLab = mcLabels.rawIteratorAt(candidateTracks[iT].globalIndex); if (mcLab.has_mcParticle()) { auto mcTrack = mcLab.template mcParticle_as(); - if (((mcTrack.flags() & 0x8) && (doprocessMcRun2)) || (mcTrack.flags() & 0x2)) + if (((mcTrack.flags() & 0x8) && (doprocessMcRun2)) || (mcTrack.flags() & 0x2) || (mcTrack.flags() & 0x1)) continue; if (!mcTrack.isPhysicalPrimary()) { if (mcTrack.has_mothers()) { // sec WD @@ -442,7 +442,7 @@ struct EbyeMult { if (std::abs(genEta) > etaMax) { continue; } - if (((mcPart.flags() & 0x8) && (doprocessMcRun2)) || (mcPart.flags() & 0x2)) + if (((mcPart.flags() & 0x8) && (doprocessMcRun2)) || (mcPart.flags() & 0x2) || (mcPart.flags() & 0x1)) continue; if (!mcPart.isPhysicalPrimary() /* && !mcPart.has_mothers() */) continue; @@ -485,7 +485,7 @@ struct EbyeMult { int partInAcc = 0; auto particlesThisCollision = particles.sliceBy(perCollisionMcParts, collision.globalIndex()); for (auto const& particle : particlesThisCollision) { - if (((particle.flags() & 0x8) && (doprocessMcRun2)) || (particle.flags() & 0x2)) + if (((particle.flags() & 0x8) && (doprocessMcRun2)) || (particle.flags() & 0x2) || (particle.flags() & 0x1)) continue; if (!particle.isPhysicalPrimary() /* && !particle.has_mothers() */) continue; From 5e8067463154ade1eef6f80c08350375fa4df692 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Fri, 6 Dec 2024 14:05:57 +0100 Subject: [PATCH 269/459] [PWGJE] fixing default process functions (#8846) --- PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx | 2 +- PWGJE/TableProducer/rhoEstimator.cxx | 2 +- PWGJE/Tasks/jetSubstructureHF.cxx | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx index f1dae6bb061..c1c1dc19b54 100644 --- a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx +++ b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx @@ -138,7 +138,7 @@ struct eventWiseConstituentSubtractorTask { particleSubtractedTable(mcCollision.globalIndex(), trackSubtracted.pt(), trackSubtracted.eta(), trackSubtracted.phi(), trackSubtracted.rap(), trackSubtracted.e(), 211, 1, 1, 1); // everything after phi is artificial and should not be used for analyses } } - PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processMcCollisions, "Fill table of subtracted tracks for Mc collisions", true); + PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processMcCollisions, "Fill table of subtracted tracks for Mc collisions", false); void processD0Collisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { diff --git a/PWGJE/TableProducer/rhoEstimator.cxx b/PWGJE/TableProducer/rhoEstimator.cxx index ff0072f7052..b8a74936bfd 100644 --- a/PWGJE/TableProducer/rhoEstimator.cxx +++ b/PWGJE/TableProducer/rhoEstimator.cxx @@ -99,7 +99,7 @@ struct RhoEstimatorTask { auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); rhoChargedMcTable(rho, rhoM); } - PROCESS_SWITCH(RhoEstimatorTask, processChargedMcCollisions, "Fill rho tables for MC collisions using charged tracks", true); + PROCESS_SWITCH(RhoEstimatorTask, processChargedMcCollisions, "Fill rho tables for MC collisions using charged tracks", false); void processD0Collisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesD0Data const& candidates) { diff --git a/PWGJE/Tasks/jetSubstructureHF.cxx b/PWGJE/Tasks/jetSubstructureHF.cxx index 2ad5ddb4bac..46572c17f07 100644 --- a/PWGJE/Tasks/jetSubstructureHF.cxx +++ b/PWGJE/Tasks/jetSubstructureHF.cxx @@ -243,11 +243,6 @@ struct JetSubstructureHFTask { outputTable(energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec, nSub[0], nSub[1], nSub[2], pairPtVec, pairEnergyVec, pairThetaVec, angularity); } - void processDummy(aod::JetTracks const&) - { - } - PROCESS_SWITCH(JetSubstructureHFTask, processDummy, "Dummy process function turned on by default", true); - void processChargedJetsData(typename JetTableData::iterator const& jet, CandidateTable const& candidates, aod::JetTracks const& tracks) From e5661a2f884ebabce6669a3695624731496e5646 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Fri, 6 Dec 2024 16:36:40 +0100 Subject: [PATCH 270/459] [PWGLF] added checks for misidentification of particle with antiparticle and comparison with other particles (#8830) Co-authored-by: Prottay Das --- PWGLF/Tasks/Resonances/lambdav2.cxx | 700 +++++++++++------------- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 53 +- 2 files changed, 346 insertions(+), 407 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambdav2.cxx b/PWGLF/Tasks/Resonances/lambdav2.cxx index 4fbb16beddc..4a43c5d2d4b 100644 --- a/PWGLF/Tasks/Resonances/lambdav2.cxx +++ b/PWGLF/Tasks/Resonances/lambdav2.cxx @@ -8,47 +8,53 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// -/// \brief this is a code for flow of lambda baryons for exotic pheno -/// \author prottay das -/// \since 25/04/2024 +// Particle flow task +// prottay.das@cern.ch -#include -#include -#include #include -#include +#include #include #include #include #include +#include +#include +#include #include -#include "TF1.h" - -#include +#include #include +#include #include -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" +#include "TRandom3.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "Math/GenVector/Boost.h" +#include "TF1.h" + +// #include "Common/DataModel/Qvectors.h" +#include "PWGLF/DataModel/SPCalibrationTables.h" +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/Core/trackUtilities.h" #include "CommonConstants/PhysicsConstants.h" +#include "Common/Core/TrackSelection.h" #include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StepTHn.h" -#include "Framework/runDataProcessing.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" #include "ReconstructionDataFormats/Track.h" - -#include "PWGLF/DataModel/EPCalibrationTables.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "CCDB/BasicCCDBManager.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/DataModel/FT0Corrected.h" using namespace o2; using namespace o2::framework; @@ -57,302 +63,148 @@ using std::array; struct lambdav2 { - // Connect to ccdb - Service ccdb; - Configurable nolaterthan{ - "ccdb-no-later-than", - std::chrono::duration_cast( - std::chrono::system_clock::now().time_since_epoch()) - .count(), - "latest acceptable timestamp of creation for the object"}; - Configurable url{"ccdb-url", "http://ccdb-test.cern.ch:8080", - "url of the ccdb repository"}; - - SliceCache cache; - - // Histograms are defined with HistogramRegistry - HistogramRegistry rEventSelection{"eventSelection", - {}, - OutputObjHandlingPolicy::AnalysisObject, - true, - true}; - HistogramRegistry histos{ - "histos", - {}, - OutputObjHandlingPolicy::AnalysisObject, - true, - true}; - - // Configurable for histograms - Configurable nBins{"nBins", 100, "N bins in all histos"}; - // Confugrable for QA histograms - Configurable QA{"QA", true, "QA"}; - Configurable QAv0{"QAv0", false, "QAv0"}; - // Configurable for event selection - Configurable cutzvertex{"cutzvertex", 10.0f, - "Accepted z-vertex range (cm)"}; - // Configurable parameters for V0 selection - Configurable ConfV0PtMin{"ConfV0PtMin", 0.f, - "Minimum transverse momentum of V0"}; - Configurable ConfV0DCADaughMax{"ConfV0DCADaughMax", 1.0f, - "Maximum DCA between the V0 daughters"}; - Configurable ConfV0CPAMin{"ConfV0CPAMin", 0.985f, "Minimum CPA of V0"}; - Configurable ConfV0TranRadV0Min{"ConfV0TranRadV0Min", 0.5f, - "Minimum transverse radius"}; - Configurable ConfV0TranRadV0Max{"ConfV0TranRadV0Max", 200.f, - "Maximum transverse radius"}; - Configurable cMaxV0LifeTime{"cMaxV0LifeTime", 4, - "Maximum V0 life time"}; - Configurable cMaxV0DCA{"cMaxV0DCA", 0.3, "DCA V0 to PV"}; - Configurable cSigmaMassLambda{"cSigmaMassLambda", 4, - "n Sigma cut on Lambda mass"}; - Configurable cWidthLambda{"cWidthLambda", 0.005, "Width of Lambda"}; - Configurable ConfDaughEta{"ConfDaughEta", 0.8f, - "V0 Daugh sel: max eta"}; - Configurable ConfDaughTPCnclsMin{"ConfDaughTPCnclsMin", 70.f, - "V0 Daugh sel: Min. nCls TPC"}; - Configurable ConfDaughDCAMin{ - "ConfDaughDCAMin", 0.06f, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"}; - Configurable ConfDaughPIDCuts{"ConfDaughPIDCuts", 4, - "PID selections for KS0 daughters"}; - - // Configurables for track selections - Configurable cfgCutPT{"cfgCutPT", 0.2f, "PT cut on daughter track"}; - Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta cut on daughter track"}; - Configurable cfgCutDCAxy{"cfgCutDCAxy", 2.0f, - "DCAxy range for tracks"}; - Configurable cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"}; - Configurable nsigmaCutTPC{"nsigmacutTPC", 3.0, - "Value of the TPC Nsigma cut"}; - Configurable nsigmaCutTOF{"nsigmacutTOF", 3.0, - "Value of the TOF Nsigma cut"}; - Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, - "Value of the Combined Nsigma cut"}; - Configurable iscustomDCAcut{"iscustomDCAcut", false, "iscustomDCAcut"}; - Configurable ismanualDCAcut{"ismanualDCAcut", true, "ismanualDCAcut"}; - Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; + int mRunNumber; + int multEstimator; + float d_bz; + Service ccdb; + Service pdg; + + // fill output + Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; + Configurable additionalEvSel2{"additionalEvSel2", false, "additionalEvSel2"}; + Configurable additionalEvSel3{"additionalEvSel3", false, "additionalEvSel3"}; + Configurable correction1{"correction1", false, "fill histograms including corrections 1"}; + Configurable correction2{"correction2", false, "fill histograms including corrections 2"}; + Configurable QA{"QA", false, "flag for QA"}; + Configurable mycut{"mycut", false, "select tracks based on my cuts"}; + Configurable tofhit{"tofhit", true, "select tracks based on tof hit"}; + Configurable globalpt{"globalpt", true, "select tracks based on pt global vs tpc"}; + Configurable useprofile{"useprofile", 3, "flag to select profile vs Sparse"}; + Configurable QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"}; + Configurable lbinQxy{"lbinQxy", -5.0, "lower bin value in QxQy histograms"}; + Configurable hbinQxy{"hbinQxy", 5.0, "higher bin value in QxQy histograms"}; + Configurable cfgMaxOccupancy{"cfgMaxOccupancy", 1000, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + Configurable cfgMinOccupancy{"cfgMinOccupancy", 0, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + + // events + Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; + Configurable cfgCutCentralityMax{"cfgCutCentralityMax", 50.0f, "Accepted maximum Centrality"}; + Configurable cfgCutCentralityMin{"cfgCutCentralityMin", 30.0f, "Accepted minimum Centrality"}; + // proton track cut + Configurable confRapidity{"confRapidity", 0.8, "cut on Rapidity"}; + Configurable cfgCutPT{"cfgCutPT", 0.15, "PT cut on daughter track"}; + Configurable cfgCutEta{"cfgCutEta", 0.8, "Eta cut on daughter track"}; + Configurable cfgCutDCAxy{"cfgCutDCAxy", 0.1f, "DCAxy range for tracks"}; + Configurable cfgCutDCAz{"cfgCutDCAz", 0.1f, "DCAz range for tracks"}; + Configurable cfgITScluster{"cfgITScluster", 5, "Number of ITS cluster"}; Configurable cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"}; - Configurable isNoTOF{"isNoTOF", false, "isNoTOF"}; - Configurable timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"}; - Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; - - // Event selection cuts - Alex - TF1* fMultPVCutLow = nullptr; - TF1* fMultPVCutHigh = nullptr; - TF1* fMultCutLow = nullptr; - TF1* fMultCutHigh = nullptr; - TF1* fMultMultPVCut = nullptr; - - void init(InitContext const&) - { - // Axes - AxisSpec vertexZAxis = {nBins, -10., 10., "vrtx_{Z} [cm]"}; - AxisSpec ptAxis = {200, 0.0f, 20.0f, "#it{p}_{T} (GeV/#it{c})"}; - - // Event selection - rEventSelection.add("hVertexZRec", "hVertexZRec", - {HistType::kTH1F, {vertexZAxis}}); - rEventSelection.add("hmult", "Centrality distribution", kTH1F, - {{100, 0.0f, 100.0f}}); - - // from sourav da - AxisSpec phiAxis = {500, -6.28, 6.28, "phi"}; - AxisSpec resAxis = {400, -2, 2, "Res"}; - AxisSpec centAxis = {100, 0, 100, "V0M (%)"}; - - if (QA) { - histos.add("hFTOCvsTPCNoCut", "Mult correlation FT0C vs. TPC without any cut", kTH2F, {{80, 0.0f, 80.0f}, {100, -0.5f, 5999.5f}}); - histos.add("hFTOCvsTPCSelected", "Mult correlation FT0C vs. TPC after selection", kTH2F, {{80, 0.0f, 80.0f}, {100, -0.5f, 5999.5f}}); - histos.add("hPsiFT0C", "PsiFT0C", kTH2F, {centAxis, phiAxis}); - histos.add("hPsiFT0A", "PsiFT0A", kTH2F, {centAxis, phiAxis}); - histos.add("hPsiTPC", "PsiTPC", kTH2F, {centAxis, phiAxis}); - histos.add("hPsiTPCR", "PsiTPCR", kTH2F, {centAxis, phiAxis}); - histos.add("hPsiTPCL", "PsiTPCL", kTH2F, {centAxis, phiAxis}); - // histogram for resolution - histos.add("ResFT0CTPC", "ResFT0CTPC", kTH2F, {centAxis, resAxis}); - histos.add("ResFT0CTPCR", "ResFT0CTPCR", kTH2F, {centAxis, resAxis}); - histos.add("ResFT0CTPCL", "ResFT0CTPCL", kTH2F, {centAxis, resAxis}); - histos.add("ResTPCRTPCL", "ResTPCRTPCL", kTH2F, {centAxis, resAxis}); - histos.add("ResFT0CFT0A", "ResFT0CFT0A", kTH2F, {centAxis, resAxis}); - histos.add("ResFT0ATPC", "ResFT0ATPC", kTH2F, {centAxis, resAxis}); - } - - if (QAv0) { - // Lambda topological cuts - histos.add("hDCAV0Daughters", "hDCAV0Daughters", - {HistType::kTH1F, {{50, 0.0f, 5.0f}}}); - histos.add("hLT", "hLT", {HistType::kTH1F, {{100, 0.0f, 50.0f}}}); - histos.add("hV0CosPA", "hV0CosPA", - {HistType::kTH1F, {{100, 0.95f, 1.f}}}); - } - - // CKStar histograms - histos.add("hLamInvMass", - "Invariant mass of Lambda baryon", kTHnSparseF, - {{100, 0.0, 100.0}, {200, 0.0f, 20.0f}, {200, 1.0, 1.2}, {100, -1, 1}}, true); - - // Event selection cut additional - Alex - if (additionalEvsel) { - fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); - fMultPVCutLow->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); - fMultPVCutHigh = new TF1("fMultPVCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); - fMultPVCutHigh->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); - fMultCutLow = new TF1("fMultCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x)", 0, 100); - fMultCutLow->SetParameters(1893.94, -53.86, 0.502913, -0.0015122, 109.625, -1.19253); - fMultCutHigh = new TF1("fMultCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 3.*([4]+[5]*x)", 0, 100); - fMultCutHigh->SetParameters(1893.94, -53.86, 0.502913, -0.0015122, 109.625, -1.19253); - fMultMultPVCut = new TF1("fMultMultPVCut", "[0]+[1]*x+[2]*x*x", 0, 5000); - fMultMultPVCut->SetParameters(-0.1, 0.785, -4.7e-05); - } - } + Configurable isPVContributor{"isPVContributor", true, "is PV contributor"}; + Configurable checkwithpub{"checkwithpub", true, "checking results with published"}; + Configurable nsigmaCutTPCPi{"nsigmaCutTPCPi", 3, "PID selections for Pions"}; + Configurable nsigmaCutTPCKa{"nsigmaCutTPCKa", 3, "PID selections for Kaons"}; + Configurable nsigmaCutTPCPr{"nsigmaCutTPCPr", 3, "PID selections for Protons"}; + Configurable nsigmaCutTOFPi{"nsigmaCutTOFPi", 3, "PID selections for TOF Pions"}; + Configurable nsigmaCutTOFKa{"nsigmaCutTOFKa", 3, "PID selections for TOF Kaons"}; + Configurable nsigmaCutTOFPr{"nsigmaCutTOFPr", 3, "PID selections for TOF Protons"}; + Configurable cfgCutTOFBeta{"cfgCutTOFBeta", 0, "Beta selections for Particles"}; + + Configurable CentNbins{"CentNbins", 16, "Number of bins in cent histograms"}; + Configurable lbinCent{"lbinCent", 0.0, "lower bin value in cent histograms"}; + Configurable hbinCent{"hbinCent", 80.0, "higher bin value in cent histograms"}; + Configurable SANbins{"SANbins", 20, "Number of bins in costhetastar"}; + Configurable lbinSA{"lbinSA", -1.0, "lower bin value in costhetastar histograms"}; + Configurable hbinSA{"hbinSA", 1.0, "higher bin value in costhetastar histograms"}; + Configurable PolNbins{"PolNbins", 20, "Number of bins in polarisation"}; + Configurable lbinPol{"lbinPol", -1.0, "lower bin value in #phi-#psi histograms"}; + Configurable hbinPol{"hbinPol", 1.0, "higher bin value in #phi-#psi histograms"}; + Configurable IMNbins{"IMNbins", 100, "Number of bins in invariant mass"}; + Configurable lbinIM{"lbinIM", 1.0, "lower bin value in IM histograms"}; + Configurable hbinIM{"hbinIM", 1.2, "higher bin value in IM histograms"}; + Configurable ptNbins{"ptNbins", 50, "Number of bins in pt"}; + Configurable lbinpt{"lbinpt", 0.0, "lower bin value in pt histograms"}; + Configurable hbinpt{"hbinpt", 10.0, "higher bin value in pt histograms"}; + Configurable resNbins{"resNbins", 50, "Number of bins in reso"}; + Configurable lbinres{"lbinres", 0.0, "lower bin value in reso histograms"}; + Configurable hbinres{"hbinres", 10.0, "higher bin value in reso histograms"}; + Configurable etaNbins{"etaNbins", 20, "Number of bins in eta"}; + Configurable lbineta{"lbineta", -1.0, "lower bin value in eta histograms"}; + Configurable hbineta{"hbineta", 1.0, "higher bin value in eta histograms"}; + Configurable spNbins{"spNbins", 2000, "Number of bins in sp"}; + Configurable lbinsp{"lbinsp", -1.0, "lower bin value in sp histograms"}; + Configurable hbinsp{"hbinsp", 1.0, "higher bin value in sp histograms"}; + Configurable phiNbins{"phiNbins", 30, "Number of bins in phi"}; + + ConfigurableAxis configcentAxis{"configcentAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "Cent V0M"}; + ConfigurableAxis configthnAxispT{"configthnAxisPt", {VARIABLE_WIDTH, 0.2, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.5, 8.0, 10.0, 100.0}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis configetaAxis{"configetaAxis", {VARIABLE_WIDTH, -0.8, -0.4, -0.2, 0, 0.2, 0.4, 0.8}, "Eta"}; + ConfigurableAxis configthnAxisPol{"configthnAxisPol", {VARIABLE_WIDTH, -1.0, -0.6, -0.2, 0, 0.2, 0.4, 0.8}, "Pol"}; + ConfigurableAxis configphiAxis{"configphiAxis", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.8, 1.0, 2.0, 2.5, 3.0, 4.0, 5.0, 5.5, 6.28}, "PhiAxis"}; - double massLambda = TDatabasePDG::Instance() - ->GetParticle(kLambda0) - ->Mass(); // FIXME: Get from the common header + SliceCache cache; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - template - bool eventSelected(TCollision collision, const float& centrality) + void init(o2::framework::InitContext&) { - if (collision.alias_bit(kTVXinTRD)) { - // TRD triggered - // return 0; - } - auto multNTracksPV = collision.multNTracksPV(); - if (multNTracksPV < fMultPVCutLow->Eval(centrality)) - return 0; - if (multNTracksPV > fMultPVCutHigh->Eval(centrality)) - return 0; - // if (multTrk < fMultCutLow->Eval(centrality)) - // return 0; - // if (multTrk > fMultCutHigh->Eval(centrality)) - // return 0; - // if (multTrk > fMultMultPVCut->Eval(multNTracksPV)) - // return 0; - - return 1; + AxisSpec thnAxispT{ptNbins, lbinpt, hbinpt, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec thnAxisRap{100, -0.5, 0.5, "Rapidity"}; + AxisSpec thnAxisres{resNbins, lbinres, hbinres, "Reso"}; + AxisSpec thnAxisInvMass{IMNbins, lbinIM, hbinIM, "#it{M} (GeV/#it{c}^{2})"}; + AxisSpec thnAxisPol{PolNbins, lbinPol, hbinPol, "Sin(#phi - #psi)"}; + AxisSpec thnAxisCosThetaStar{SANbins, lbinSA, hbinSA, "SA"}; + AxisSpec centAxis = {CentNbins, lbinCent, hbinCent, "V0M (%)"}; + AxisSpec etaAxis = {etaNbins, lbineta, hbineta, "Eta"}; + AxisSpec spAxis = {spNbins, lbinsp, hbinsp, "Sp"}; + AxisSpec qxZDCAxis = {QxyNbins, lbinQxy, hbinQxy, "Qx"}; + AxisSpec phiAxis = {phiNbins, 0.0, 6.28, "phi-phiStar"}; + /* + histos.add("hpuxQxpvscentpteta", "hpuxQxpvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuyQypvscentpteta", "hpuyQypvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxQxtvscentpteta", "hpuxQxtvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuyQytvscentpteta", "hpuyQytvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxyQxytvscentpteta", "hpuxyQxytvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxyQxypvscentpteta", "hpuxyQxypvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true);*/ + histos.add("hpoddv1vscentpteta", "hpoddv1vscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentpteta", "hpevenv1vscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpoddv1vscentptetakaon", "hpoddv1vscentptetakaon", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentptetakaon", "hpevenv1vscentptetakaon", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpoddv1vscentptetaproton", "hpoddv1vscentptetaproton", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentptetaproton", "hpevenv1vscentptetaproton", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + + /* histos.add("hpuxQxpvscentptetaneg", "hpuxQxpvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuyQypvscentptetaneg", "hpuyQypvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxQxtvscentptetaneg", "hpuxQxtvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuyQytvscentptetaneg", "hpuyQytvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxyQxytvscentptetaneg", "hpuxyQxytvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxyQxypvscentptetaneg", "hpuxyQxypvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true);*/ + histos.add("hpoddv1vscentptetaneg", "hpoddv1vscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentptetaneg", "hpevenv1vscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpoddv1vscentptetakaonneg", "hpoddv1vscentptetakaonneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentptetakaonneg", "hpevenv1vscentptetakaonneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpoddv1vscentptetaprotonneg", "hpoddv1vscentptetaprotonneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpevenv1vscentptetaprotonneg", "hpevenv1vscentptetaprotonneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + + histos.add("hpQxtQxpvscent", "hpQxtQxpvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + histos.add("hpQytQypvscent", "hpQytQypvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + histos.add("hpQxytpvscent", "hpQxytpvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + histos.add("hpQxtQypvscent", "hpQxtQypvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + histos.add("hpQxpQytvscent", "hpQxpQytvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + + histos.add("hCentrality", "Centrality distribution", kTH1F, {{centAxis}}); } template bool selectionTrack(const T& candidate) - { - if (iscustomDCAcut && - (!candidate.isGlobalTrack() || !candidate.isPVContributor() || - candidate.itsNCls() < cfgITScluster)) { - return false; - } - - if (ismanualDCAcut && !(candidate.isGlobalTrackWoDCA() && candidate.isPVContributor() && std::abs(candidate.dcaXY()) < cfgCutDCAxy && std::abs(candidate.dcaZ()) < cfgCutDCAz && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster)) { - return false; - } - - return true; - } - - template - bool selectionPID(const T& candidate) { - if (!candidate.hasTOF() && - std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPC) { - return true; - } else if (candidate.hasTOF() && - std::abs(candidate.tofNSigmaPi()) < nsigmaCutTOF) { - return true; - } - - return false; - } - - template - bool SelectionV0(Collision const& collision, V0 const& candidate, - float /*multiplicity*/) - { - if (fabs(candidate.dcav0topv()) > cMaxV0DCA) { - return false; - } - - const float pT = candidate.pt(); - const float tranRad = candidate.v0radius(); - const float dcaDaughv0 = candidate.dcaV0daughters(); - const float cpav0 = candidate.v0cosPA(); - float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), - collision.posZ()) * - TDatabasePDG::Instance() - ->GetParticle(kLambda0) - ->Mass(); // FIXME: Get from the common header - // float lowmasscutks0 = 0.497 - cWidthKs0 * cSigmaMassKs0; - // float highmasscutks0 = 0.497 + cWidthKs0 * cSigmaMassKs0; - float lowmasscutlambda = 1.0; - float highmasscutlambda = 1.2; - // float decayLength = candidate.distovertotmom(collision.posX(), - // collision.posY(), collision.posZ()) * - // RecoDecay::sqrtSumOfSquares(candidate.px(), candidate.py(), - // candidate.pz()); - - if (pT < ConfV0PtMin) { - return false; - } - if (dcaDaughv0 > ConfV0DCADaughMax) { - return false; - } - if (cpav0 < ConfV0CPAMin) { - return false; - } - if (tranRad < ConfV0TranRadV0Min) { - return false; - } - if (tranRad > ConfV0TranRadV0Max) { - return false; - } - if (fabs(CtauK0s) > cMaxV0LifeTime || - candidate.mLambda() < lowmasscutlambda || - candidate.mLambda() > highmasscutlambda) { - return false; - } - - if (QAv0) { - histos.fill(HIST("hLT"), CtauK0s); - histos.fill(HIST("hDCAV0Daughters"), candidate.dcaV0daughters()); - histos.fill(HIST("hV0CosPA"), candidate.v0cosPA()); - } - return true; - } - - template - bool isSelectedV0Daughter(T const& track, float charge, - double nsigmaV0Daughter) - { - const auto eta = track.eta(); - const auto tpcNClsF = track.tpcNClsFound(); - const auto dcaXY = track.dcaXY(); - const auto sign = track.sign(); - - if (!track.hasTPC()) - return false; - if (track.tpcNClsCrossedRows() < 70) - return false; - if (track.tpcCrossedRowsOverFindableCls() < 0.8) - return false; - - if (charge < 0 && sign > 0) { - return false; - } - if (charge > 0 && sign < 0) { - return false; - } - if (std::abs(eta) > ConfDaughEta) { - return false; - } - if (tpcNClsF < ConfDaughTPCnclsMin) { - return false; - } - if (std::abs(dcaXY) < ConfDaughDCAMin) { - return false; - } - if (std::abs(nsigmaV0Daughter) > ConfDaughPIDCuts) { - return false; + if (mycut) { + if (!candidate.isGlobalTrack() || !candidate.isPVContributor() || !(candidate.itsNCls() > cfgITScluster) || !(candidate.tpcNClsFound() > cfgTPCcluster) || !(candidate.itsNClsInnerBarrel() >= 1)) { + return false; + } + } else { + if (!(candidate.isGlobalTrack() && candidate.isPVContributor() && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster && candidate.itsNClsInnerBarrel() >= 1)) { + return false; + } } - return true; } @@ -360,119 +212,183 @@ struct lambdav2 { { double result = phi; while (result < 0) { - result = result + 2. * TMath::Pi() / 2; + result = result + 2. * TMath::Pi(); } - while (result > 2. * TMath::Pi() / 2) { - result = result - 2. * TMath::Pi() / 2; + while (result > 2. * TMath::Pi()) { + result = result - 2. * TMath::Pi(); } return result; } - // Defining filters for events (event selection) - // Processed events will be already fulfilling the event selection - // requirements - // Filter eventFilter = (o2::aod::evsel::sel8 == true); - Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); - - Filter acceptanceFilter = - (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT); - - using EventCandidates = soa::Filtered>; - - using TrackCandidates = soa::Filtered>; - using V0TrackCandidate = aod::V0Datas; - - ROOT::Math::PxPyPzMVector Lambda; - - void processSE(EventCandidates::iterator const& collision, - TrackCandidates const& /*tracks*/, aod::V0Datas const& V0s, - aod::BCs const&) + template + bool SelectionPID(const T& candidate, int PID) + { + if (PID == 0) // pion + { + auto combPIDPi = TMath::Sqrt(TMath::Abs(candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi())); + if (!candidate.hasTOF() && candidate.tpcInnerParam() < 0.6 && TMath::Abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) { + return true; + } + if (candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && combPIDPi < nsigmaCutTOFPi) { + return true; + } + } else if (PID == 1) // kaon + { + auto combPIDKa = TMath::Sqrt(TMath::Abs(candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa())); + if (!candidate.hasTOF() && candidate.tpcInnerParam() < 0.45 && TMath::Abs(candidate.tpcNSigmaKa()) < nsigmaCutTPCKa) { + return true; + } + if (candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && combPIDKa < nsigmaCutTOFKa) { + return true; + } + } else // proton + { + auto combPIDPr = TMath::Sqrt(TMath::Abs(candidate.tofNSigmaPr() * candidate.tofNSigmaPr() + candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr())); + if (!candidate.hasTOF() && candidate.tpcInnerParam() < 0.6 && TMath::Abs(candidate.tpcNSigmaPr()) < nsigmaCutTPCPr) { + return true; + } + if (candidate.hasTOF() && candidate.beta() > cfgCutTOFBeta && combPIDPr < nsigmaCutTOFPr) { + return true; + } + } + return false; + } + ROOT::Math::PxPyPzMVector Lambda, Proton, Pion, fourVecDauCM; + // ROOT::Math::XYZVector threeVecDauCM, threeVecDauCMXY, eventplaneVec, eventplaneVecNorm, beamvector; + ROOT::Math::XYZVector threeVecDauCM, threeVecDauCMXY; + double phiangle = 0.0; + double massPi = o2::constants::physics::MassPionCharged; + double massKa = o2::constants::physics::MassKaonCharged; + double massPr = o2::constants::physics::MassProton; + + Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; + Filter centralityFilter = (nabs(aod::cent::centFT0C) < cfgCutCentralityMax && nabs(aod::cent::centFT0C) > cfgCutCentralityMin); + Filter acceptanceFilter = (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT); + Filter dcaCutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); + + using EventCandidates = soa::Filtered>; + // using AllTrackCandidates = soa::Join; + using AllTrackCandidates = soa::Filtered>; + using ResoV0s = aod::V0Datas; + + // void processData(EventCandidates::iterator const& collision, AllTrackCandidates const&, ResoV0s const& V0s, aod::BCs const&) + void processData(EventCandidates::iterator const& collision, AllTrackCandidates const& tracks, ResoV0s const& V0s, aod::BCs const&) { if (!collision.sel8()) { return; } - - float centrality = 0.0f; - centrality = collision.centFT0C(); - auto multTPC = collision.multNTracksPV(); - - if (timFrameEvsel && (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { + auto centrality = collision.centFT0C(); + // histos.fill(HIST("hCentrality0"), centrality); + if (!collision.triggereventsp()) { return; } + // histos.fill(HIST("hCentrality1"), centrality); - if (additionalEvsel && !eventSelected(collision, centrality)) { + if (additionalEvSel && (!collision.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) { return; } - - if (QA) { - histos.fill(HIST("hFTOCvsTPCNoCut"), centrality, multTPC); - } - if (!collision.triggereventep()) { + // histos.fill(HIST("hCentrality2"), centrality); + // if (additionalEvSel2 && (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard))) { + if (additionalEvSel2 && (collision.trackOccupancyInTimeRange() > cfgMaxOccupancy || collision.trackOccupancyInTimeRange() < cfgMinOccupancy)) { return; } - auto psiFT0C = collision.psiFT0C(); - auto psiFT0A = collision.psiFT0A(); - auto psiTPC = collision.psiTPC(); - auto psiTPCR = collision.psiTPCR(); - auto psiTPCL = collision.psiTPCL(); - if (QA) { - histos.fill(HIST("hFTOCvsTPCSelected"), centrality, multTPC); - histos.fill(HIST("hPsiFT0C"), centrality, psiFT0C); - histos.fill(HIST("hPsiFT0A"), centrality, psiFT0A); - histos.fill(HIST("hPsiTPC"), centrality, psiTPC); - histos.fill(HIST("hPsiTPCR"), centrality, psiTPCR); - histos.fill(HIST("hPsiTPCL"), centrality, psiTPCL); - histos.fill(HIST("ResFT0CTPC"), centrality, TMath::Cos(2.0 * (psiFT0C - psiTPC))); - histos.fill(HIST("ResFT0CTPCR"), centrality, TMath::Cos(2.0 * (psiFT0C - psiTPCR))); - histos.fill(HIST("ResFT0CTPCL"), centrality, TMath::Cos(2.0 * (psiFT0C - psiTPCL))); - histos.fill(HIST("ResTPCRTPCL"), centrality, TMath::Cos(2.0 * (psiTPCR - psiTPCL))); - histos.fill(HIST("ResFT0CFT0A"), centrality, TMath::Cos(2.0 * (psiFT0C - psiFT0A))); - histos.fill(HIST("ResFT0ATPC"), centrality, TMath::Cos(2.0 * (psiTPC - psiFT0A))); + // histos.fill(HIST("hCentrality3"), centrality); + if (additionalEvSel3 && (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { + return; } - // Fill the event counter - rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); - rEventSelection.fill(HIST("hmult"), centrality); + auto qxZDCA = collision.qxZDCA(); + auto qxZDCC = collision.qxZDCC(); + auto qyZDCA = collision.qyZDCA(); + auto qyZDCC = collision.qyZDCC(); + auto psiZDCC = collision.psiZDCC(); + auto psiZDCA = collision.psiZDCA(); + + histos.fill(HIST("hCentrality"), centrality); + + auto QxtQxp = qxZDCA * qxZDCC; + auto QytQyp = qyZDCA * qyZDCC; + auto Qxytp = QxtQxp + QytQyp; + auto QxpQyt = qxZDCA * qyZDCC; + auto QxtQyp = qxZDCC * qyZDCA; + + histos.fill(HIST("hpQxtQxpvscent"), centrality, QxtQxp); + histos.fill(HIST("hpQytQypvscent"), centrality, QytQyp); + histos.fill(HIST("hpQxytpvscent"), centrality, Qxytp); + histos.fill(HIST("hpQxpQytvscent"), centrality, QxpQyt); + histos.fill(HIST("hpQxtQypvscent"), centrality, QxtQyp); + + for (auto track : tracks) { + if (!selectionTrack(track)) { + continue; + } - for (auto& v0 : V0s) { + bool ispion = 0; + bool iskaon = 0; + bool isproton = 0; - auto postrack = v0.template posTrack_as(); - auto negtrack = v0.template negTrack_as(); - double nTPCSigmaPos[1]{postrack.tpcNSigmaPr()}; - double nTPCSigmaNeg[1]{negtrack.tpcNSigmaPi()}; - double nTPCSigmaPos2[1]{postrack.tpcNSigmaPi()}; - double nTPCSigmaNeg2[1]{negtrack.tpcNSigmaPr()}; + if (SelectionPID(track, 0)) + ispion = 1; + if (SelectionPID(track, 1)) + iskaon = 1; + if (SelectionPID(track, 2)) + isproton = 1; - if (!isSelectedV0Daughter(postrack, 1, nTPCSigmaPos[0]) && !isSelectedV0Daughter(postrack, 1, nTPCSigmaPos2[0])) { + if (ispion && iskaon) continue; - } - if (!isSelectedV0Daughter(negtrack, -1, nTPCSigmaNeg[0]) && !isSelectedV0Daughter(negtrack, -1, nTPCSigmaNeg2[0])) { + if (ispion && isproton) continue; - } - - if (!SelectionV0(collision, v0, centrality)) { + if (iskaon && isproton) continue; - } - - Lambda = ROOT::Math::PxPyPzMVector(v0.px(), v0.py(), v0.pz(), massLambda); - auto phiminuspsi = GetPhiInRange(Lambda.Phi() - psiFT0C); - auto v2 = TMath::Cos(2.0 * phiminuspsi); + float sign = track.sign(); + if (sign == 0.0) // removing neutral particles + continue; - if (TMath::Abs(Lambda.Rapidity()) < 0.5) { - histos.fill(HIST("hLamInvMass"), centrality, - Lambda.Pt(), v0.mLambda(), v2); + auto ux = TMath::Cos(GetPhiInRange(track.phi())); + auto uy = TMath::Sin(GetPhiInRange(track.phi())); + + auto uxQxp = ux * qxZDCA; + auto uyQyp = uy * qyZDCA; + auto uxyQxyp = uxQxp + uyQyp; + auto uxQxt = ux * qxZDCC; + auto uyQyt = uy * qyZDCC; + auto uxyQxyt = uxQxt + uyQyt; + auto oddv1 = ux * (qxZDCA - qxZDCC) + uy * (qyZDCA - qyZDCC); + auto evenv1 = ux * (qxZDCA + qxZDCC) + uy * (qyZDCA + qyZDCC); + + if (sign > 0) { + if (ispion) { + histos.fill(HIST("hpoddv1vscentpteta"), centrality, track.pt(), track.rapidity(massPi), oddv1); + histos.fill(HIST("hpevenv1vscentpteta"), centrality, track.pt(), track.rapidity(massPi), evenv1); + } else if (iskaon) { + histos.fill(HIST("hpoddv1vscentptetakaon"), centrality, track.pt(), track.rapidity(massKa), oddv1); + histos.fill(HIST("hpevenv1vscentptetakaon"), centrality, track.pt(), track.rapidity(massKa), evenv1); + } else if (isproton) { + histos.fill(HIST("hpoddv1vscentptetaproton"), centrality, track.pt(), track.rapidity(massPr), oddv1); + histos.fill(HIST("hpevenv1vscentptetaproton"), centrality, track.pt(), track.rapidity(massPr), evenv1); + } + + } else { + if (ispion) { + histos.fill(HIST("hpoddv1vscentptetaneg"), centrality, track.pt(), track.rapidity(massPi), oddv1); + histos.fill(HIST("hpevenv1vscentptetaneg"), centrality, track.pt(), track.rapidity(massPi), evenv1); + } else if (iskaon) { + histos.fill(HIST("hpoddv1vscentptetakaonneg"), centrality, track.pt(), track.rapidity(massKa), oddv1); + histos.fill(HIST("hpevenv1vscentptetakaonneg"), centrality, track.pt(), track.rapidity(massKa), evenv1); + } else if (isproton) { + histos.fill(HIST("hpoddv1vscentptetaprotonneg"), centrality, track.pt(), track.rapidity(massPr), oddv1); + histos.fill(HIST("hpevenv1vscentptetaprotonneg"), centrality, track.pt(), track.rapidity(massPr), evenv1); + } } } } - - PROCESS_SWITCH(lambdav2, processSE, "Process Same event", true); + PROCESS_SWITCH(lambdav2, processData, "Process data", true); }; - WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"lambdav2"})}; } diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index 041ed4da0b6..083790327b8 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -79,6 +79,8 @@ struct lambdapolsp { Configurable mycut{"mycut", false, "select tracks based on my cuts"}; Configurable tofhit{"tofhit", true, "select tracks based on tof hit"}; Configurable globalpt{"globalpt", true, "select tracks based on pt global vs tpc"}; + Configurable usefourvectormass{"usefourvectormass", true, "select invariant mass based on four vector"}; + Configurable checksign{"checksign", true, "check sign of daughter tracks"}; Configurable useprofile{"useprofile", 3, "flag to select profile vs Sparse"}; Configurable QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"}; Configurable lbinQxy{"lbinQxy", -5.0, "lower bin value in QxQy histograms"}; @@ -408,7 +410,7 @@ struct lambdapolsp { return result; } - ROOT::Math::PxPyPzMVector Lambda, Proton, Pion, fourVecDauCM; + ROOT::Math::PxPyPzMVector Lambda, Lambdacopy, Proton, Pion, fourVecDauCM; // ROOT::Math::XYZVector threeVecDauCM, threeVecDauCMXY, eventplaneVec, eventplaneVecNorm, beamvector; ROOT::Math::XYZVector threeVecDauCM, threeVecDauCMXY; double phiangle = 0.0; @@ -585,6 +587,14 @@ struct lambdapolsp { int LambdaTag = 0; int aLambdaTag = 0; + const auto signpos = postrack.sign(); + const auto signneg = negtrack.sign(); + + if (checksign) { + if (signpos < 0 || signneg > 0) + continue; + } + if (isSelectedV0Daughter(postrack, 0) && isSelectedV0Daughter(negtrack, 1)) { LambdaTag = 1; } @@ -608,6 +618,7 @@ struct lambdapolsp { Pion = ROOT::Math::PxPyPzMVector(postrack.px(), postrack.py(), postrack.pz(), massPi); } Lambda = Proton + Pion; + Lambdacopy = Proton + Pion; Lambda.SetM(massLambda); ROOT::Math::Boost boost{Lambda.BoostToCM()}; @@ -637,29 +648,41 @@ struct lambdapolsp { auto sinThetaStarcosphiphiStar = sinThetaStar * TMath::Cos(2 * GetPhiInRange(Lambda.Phi() - phiangle)); // A2 correction auto phiphiStar = GetPhiInRange(Lambda.Phi() - phiangle); + double candmass = 0.0; + if (LambdaTag) { - histos.fill(HIST("hSparseLambdaPolA"), v0.mLambda(), v0.pt(), v0.eta(), PolA, centrality); - histos.fill(HIST("hSparseLambdaPolC"), v0.mLambda(), v0.pt(), v0.eta(), PolC, centrality); + if (usefourvectormass) + candmass = Lambdacopy.M(); + else + candmass = v0.mLambda(); + + histos.fill(HIST("hSparseLambdaPolA"), candmass, v0.pt(), v0.eta(), PolA, centrality); + histos.fill(HIST("hSparseLambdaPolC"), candmass, v0.pt(), v0.eta(), PolC, centrality); if (correction1) { - histos.fill(HIST("hSparseLambda_corr1a"), v0.mLambda(), v0.pt(), v0.eta(), sinPhiStar, centrality); - histos.fill(HIST("hSparseLambda_corr1b"), v0.mLambda(), v0.pt(), v0.eta(), cosPhiStar, centrality); - histos.fill(HIST("hSparseLambda_corr1c"), v0.mLambda(), v0.pt(), v0.eta(), phiphiStar, centrality); + histos.fill(HIST("hSparseLambda_corr1a"), candmass, v0.pt(), v0.eta(), sinPhiStar, centrality); + histos.fill(HIST("hSparseLambda_corr1b"), candmass, v0.pt(), v0.eta(), cosPhiStar, centrality); + histos.fill(HIST("hSparseLambda_corr1c"), candmass, v0.pt(), v0.eta(), phiphiStar, centrality); if (correction2) { - histos.fill(HIST("hSparseLambda_corr2a"), v0.mLambda(), v0.pt(), v0.eta(), sinThetaStar, centrality); - histos.fill(HIST("hSparseLambda_corr2b"), v0.mLambda(), v0.pt(), v0.eta(), sinThetaStarcosphiphiStar, centrality); + histos.fill(HIST("hSparseLambda_corr2a"), candmass, v0.pt(), v0.eta(), sinThetaStar, centrality); + histos.fill(HIST("hSparseLambda_corr2b"), candmass, v0.pt(), v0.eta(), sinThetaStarcosphiphiStar, centrality); } } } if (aLambdaTag) { - histos.fill(HIST("hSparseAntiLambdaPolA"), v0.mAntiLambda(), v0.pt(), v0.eta(), PolA, centrality); - histos.fill(HIST("hSparseAntiLambdaPolC"), v0.mAntiLambda(), v0.pt(), v0.eta(), PolC, centrality); + if (usefourvectormass) + candmass = Lambdacopy.M(); + else + candmass = v0.mAntiLambda(); + + histos.fill(HIST("hSparseAntiLambdaPolA"), candmass, v0.pt(), v0.eta(), PolA, centrality); + histos.fill(HIST("hSparseAntiLambdaPolC"), candmass, v0.pt(), v0.eta(), PolC, centrality); if (correction1) { - histos.fill(HIST("hSparseAntiLambda_corr1a"), v0.mAntiLambda(), v0.pt(), v0.eta(), sinPhiStar, centrality); - histos.fill(HIST("hSparseAntiLambda_corr1b"), v0.mAntiLambda(), v0.pt(), v0.eta(), cosPhiStar, centrality); - histos.fill(HIST("hSparseAntiLambda_corr1c"), v0.mAntiLambda(), v0.pt(), v0.eta(), phiphiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1a"), candmass, v0.pt(), v0.eta(), sinPhiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1b"), candmass, v0.pt(), v0.eta(), cosPhiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1c"), candmass, v0.pt(), v0.eta(), phiphiStar, centrality); if (correction2) { - histos.fill(HIST("hSparseAntiLambda_corr2a"), v0.mAntiLambda(), v0.pt(), v0.eta(), sinThetaStar, centrality); - histos.fill(HIST("hSparseAntiLambda_corr2b"), v0.mAntiLambda(), v0.pt(), v0.eta(), sinThetaStarcosphiphiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr2a"), candmass, v0.pt(), v0.eta(), sinThetaStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr2b"), candmass, v0.pt(), v0.eta(), sinThetaStarcosphiphiStar, centrality); } } } From ded31734ac6c09edf76fdb7da1b59ea67c56aeb4 Mon Sep 17 00:00:00 2001 From: Thorkj <154221526+Thorkj@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:45:24 +0100 Subject: [PATCH 271/459] [PWGCF] Updated CorrSparse with added histograms and a changed dPhi definition (#8770) Co-authored-by: Thor Jensen Co-authored-by: ALICE Action Bot --- .../Tasks/CMakeLists.txt | 4 +- .../Tasks/{CorrSparse.cxx => corrSparse.cxx} | 64 ++++++++++--------- 2 files changed, 37 insertions(+), 31 deletions(-) rename PWGCF/TwoParticleCorrelations/Tasks/{CorrSparse.cxx => corrSparse.cxx} (75%) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index bb41ca1ccab..fe8f8ed9e1a 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -48,8 +48,8 @@ o2physics_add_dpl_workflow(twopartcorr-per-run-extraqc PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(corrsparses - SOURCES CorrSparse.cxx +o2physics_add_dpl_workflow(corr-sparse + SOURCES corrSparse.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx similarity index 75% rename from PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx rename to PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx index 0d840103eb2..9d7463534bf 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CorrSparse.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx @@ -9,6 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file corrSparse.cxx +/// \brief Provides a sparse with usefull two particle correlation info +/// \author Thor Jensen (djt288@alumni.ku.dk) + #include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -16,29 +20,25 @@ #include "Framework/ASoAHelpers.h" #include "Framework/HistogramRegistry.h" #include "Framework/RunningWorkflowInfo.h" -#include "Common/Core/RecoDecay.h" #include "CommonConstants/MathConstants.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/Centrality.h" #include "PWGCF/Core/CorrelationContainer.h" #include "PWGCF/Core/PairCuts.h" +#include "Common/Core/RecoDecay.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; struct CorrSparse { - Configurable cfgZVtxCut = {"zvtxcut", 10.0, "Vertex z cut. Default 10 cm"}; - Configurable cfgPtCutMin = {"minpt", 0.2, "Minimum accepted track pT. Default 0.2 GeV"}; - Configurable cfgPtCutMax = {"maxpt", 5.0, "Maximum accepted track pT. Default 5.0 GeV"}; - Configurable cfgEtaCut = {"etacut", 0.8, "Eta cut. Default 0.8"}; - Configurable cfgDCAzCut = {"dcacut", 0.3, "DCA z cut. Default 0.3 cm"}; - Configurable cfgDCAxyCut = {"dcacutxy", 0.3, "DCA xy cut. Default 0.2 cm"}; - Configurable cfgDCAxySigmaCut = {"dcacutxysigma", 1, "DCA xy sigma cut. Default 0.3"}; - Configurable cfgCutChi2prTPCcls = {"chi2cut", 2.5, "Chi2 cut. Default 2.5"}; + Configurable cfgZVtxCut = {"cfgZVtxCut", 10.0, "Vertex z cut. Default 10 cm"}; + Configurable cfgPtCutMin = {"cfgPtCutMin", 0.2, "Minimum accepted track pT. Default 0.2 GeV"}; + Configurable cfgPtCutMax = {"cfgPtCutMax", 5.0, "Maximum accepted track pT. Default 5.0 GeV"}; + Configurable cfgEtaCut = {"cfgEtaCut", 0.8, "Eta cut. Default 0.8"}; ConfigurableAxis axisVertex{"axisVertex", {7, -7, 7}, "vertex axis for histograms"}; - ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -constants::math::PIHalf, constants::math::PIHalf * 3}, "delta phi axis for histograms"}; + ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -PIHalf, PIHalf * 3}, "delta phi axis for histograms"}; ConfigurableAxis axisDeltaEta{"axisDeltaEta", {40, -2, 2}, "delta eta axis for histograms"}; ConfigurableAxis axisPtTrigger{"axisPtTrigger", {VARIABLE_WIDTH, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0}, "pt trigger axis for histograms"}; ConfigurableAxis axisPtAssoc{"axisPtAssoc", {VARIABLE_WIDTH, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0}, "pt associated axis for histograms"}; @@ -51,10 +51,15 @@ struct CorrSparse { { LOGF(info, "Starting init"); registry.add("Yield", "pT vs eta vs Nch", {HistType::kTH3F, {{40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}, {100, 0, 100, "Nch"}}}); // check to see total number of tracks - registry.add("etaphi_Trigger", "eta vs phi vs Nch", {HistType::kTH3F, {{100, -2, 2, "#eta"}, {200, 0, 2 * M_PI, "#varphi"}, {100, 0, 100, "Nch"}}}); + registry.add("etaphi_Trigger", "eta vs phi vs Nch", {HistType::kTH3F, {{100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}, {100, 0, 100, "Nch"}}}); + // Make histograms to check the distributions after cuts registry.add("deltaEta_deltaPhi_same", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); // check to see the delta eta and delta phi distribution registry.add("deltaEta_deltaPhi_mixed", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEta}}); + registry.add("Phi", "Phi", {HistType::kTH1D, {{72, 0, TwoPI, "Phi"}}}); + registry.add("Eta", "Eta", {HistType::kTH1D, {{40, -2, 2, "Eta"}}}); + registry.add("pT", "pT", {HistType::kTH1D, {axisPtTrigger}}); + registry.add("Nch", "N_{ch}", {HistType::kTH1D, {axisMultiplicity}}); registry.add("Sparse_mixed", "", {HistType::kTHnSparseD, {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); // Make the output sparse registry.add("Sparse_same", "", {HistType::kTHnSparseD, {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); @@ -63,12 +68,17 @@ struct CorrSparse { registry.add("eventcount", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); // histogram to see how many events are in the same and mixed event } + // fill multiple histograms template - void fillYield(TCollision collision, float centrality, TTracks tracks) // function to fill the yield and etaphi histograms. (This is not needed can be removed) + void fillYield(TCollision collision, float centrality, TTracks tracks) // function to fill the yield and etaphi histograms. { - for (auto& track1 : tracks) { + registry.fill(HIST("Nch"), tracks.size()); + for (auto const& track1 : tracks) { registry.fill(HIST("Yield"), track1.pt(), track1.eta(), track1.size()); - registry.fill(HIST("etaphi_Trigger"), track1.size(), track1.phi(), track1.eta()); + registry.fill(HIST("etaphi_Trigger"), track1.eta(), track1.phi(), track1.size()); + registry.fill(HIST("Phi"), track1.phi()); + registry.fill(HIST("Eta"), track1.eta()); + registry.fill(HIST("pT"), track1.pt()); } } @@ -94,9 +104,8 @@ struct CorrSparse { continue; } - float deltaPhi = track1.phi() - track2.phi(); + float deltaPhi = RecoDecay::constrainAngle(track1.phi() - track2.phi(), -PIHalf); float deltaEta = track1.eta() - track2.eta(); - RecoDecay::constrainAngle(deltaPhi, -PIHalf); // fill the right sparse and histograms if (system == 1) { @@ -110,21 +119,18 @@ struct CorrSparse { } } - // make the filters and cuts. I was told not to include chi2 since its not needed for run 3 data. + // make the filters and cuts. Filter collisionFilter = nabs(aod::collision::posZ) < cfgZVtxCut; - Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) - //&& (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) - && (nabs(aod::track::dcaZ) > cfgDCAzCut) && (cfgDCAxySigmaCut * (0.0015f + 0.005f / npow(aod::track::pt, 1.1f)) < nabs(aod::track::dcaXY)); - // + Filter trackFilter = (nabs(aod::track::eta) < cfgEtaCut) && (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)); // define the filtered collisions and tracks - using aodCollisions = soa::Filtered>; - using aodTracks = soa::Filtered>; - // process for the same event - void processSame(aodCollisions::iterator const& collision, aodTracks const& tracks) + using AodCollisions = soa::Filtered>; + using AodTracks = soa::Filtered>; + + void processSame(AodCollisions::iterator const& collision, AodTracks const& tracks) { const auto centrality = collision.centFT0C(); @@ -141,15 +147,15 @@ struct CorrSparse { ColumnBinningPolicy bindingOnVtxAndMult{{vtxBinsEdges, multBinsEdges}, true}; // true is for 'ignore overflows' (true by default) - SameKindPair> pair{bindingOnVtxAndMult, 5, -1, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored // the process for filling the mixed events - void processMixed(aodCollisions& collisions, aodTracks const& tracks) + void processMixed(AodCollisions const& collisions, AodTracks const& tracks) { - for (auto& [collision1, tracks1, collision2, tracks2] : pair) { + for (auto const& [collision1, tracks1, collision2, tracks2] : pair) { if (fillCollision(collision1, collision1.centFT0C()) == false) { continue; From 409d2d6b21b4215d52bfa8743ae984bff93f6363 Mon Sep 17 00:00:00 2001 From: Noor Koster <82090643+cnkoster@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:46:01 +0100 Subject: [PATCH 272/459] [PWGCF] Added pt bins and fixed bins in getCorrection function (#8845) Co-authored-by: ALICE Action Bot --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 45 +++++++++---- PWGCF/Flow/Tasks/flowSP.cxx | 82 ++++++++++++------------ 2 files changed, 72 insertions(+), 55 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index de946251704..f0f27f675af 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -103,7 +103,7 @@ std::vector e(8, 0.); // calibrated energies (a1, a2, a3, a4, c1, c2, double centrality = 0; int runnumber = 0; std::vector v(3, 0); // vx, vy, vz -bool isSelected = false; +bool isSelected = true; } // namespace o2::analysis::qvectortask @@ -133,6 +133,7 @@ struct ZdcQVectors { O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried") O2_DEFINE_CONFIGURABLE(cfgEnergyCal, std::string, "Users/c/ckoster/ZDC/LHC23_zzh_pass4/Energy", "ccdb path for energy calibration histos") O2_DEFINE_CONFIGURABLE(cfgMeanv, std::string, "Users/c/ckoster/ZDC/LHC23_zzh_pass4/vmean", "ccdb path for mean v histos") + O2_DEFINE_CONFIGURABLE(cfgMinEntriesSparseBin, int, 100, "Minimal number of entries allowed in 4D recentering histogram to use for recentering.") Configurable> cfgRec1{"cfgRec1", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it1_step5"}, "ccdb paths for recentering calibration histos iteration 1"}; Configurable> cfgRec2{"cfgRec2", {"Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step1", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step2", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step3", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step4", "Users/c/ckoster/ZDC/LHC23_zzh_pass4/it2_step5"}, "ccdb paths for recentering calibration histos iteration 2"}; @@ -229,8 +230,11 @@ struct ZdcQVectors { // recentered q-vectors (to check what steps are finished in the end) registry.add("hStep", "hStep", {HistType::kTH1D, {{10, 0., 10.}}}); registry.add("hIteration", "hIteration", {HistType::kTH1D, {{10, 0., 10.}}}); + registry.add("vmean/hvertex_vx", "hvertex_vx", kTProfile, {{1, 0., 1.}}); registry.add("vmean/hvertex_vy", "hvertex_vy", kTProfile, {{1, 0., 1.}}); + registry.add("vmean/hvertex_vz", "hvertex_vz", kTProfile, {{1, 0., 1.}}); + registry.add("QA/centrality_before", "centrality_before", kTH1D, {{200, 0, 100}}); registry.add("QA/centrality_after", "centrality_after", kTH1D, {{200, 0, 100}}); @@ -420,14 +424,14 @@ struct ZdcQVectors { return; } if (counter < 1) - LOGF(info, "<--------OK----------> Calibrations loaded for iteration %i and step %i", iteration, step + 1); + LOGF(info, "<--------OK----------> Calibrations loaded for cal.calibfilesLoaded[%i][%i]", iteration, step); cal.calibfilesLoaded[iteration][step] = true; cal.atIteration = iteration; cal.atStep = step; return; } else { if (counter < 1) - LOGF(info, "<--------X-----------> Calibrations not loaded for iteration %i and step %i cfg = empty!", iteration, step + 1); + LOGF(info, "<--------X-----------> Calibrations not loaded for iteration %i and step %i cfg = empty!", iteration, step); } } @@ -465,22 +469,25 @@ struct ZdcQVectors { bin = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); calibConstant = h->GetBinContent(bin); } else if (hist->InheritsFrom("THnSparse")) { - std::vector sparsePars; + std::vector sparsePars; THnSparseD* h = reinterpret_cast(hist); if (step == 0 && iteration > 0) { + // Axis(0) is runnuber, but we don't need this sparsePars.push_back(h->GetAxis(1)->FindBin(centrality)); sparsePars.push_back(h->GetAxis(2)->FindBin(v[0])); sparsePars.push_back(h->GetAxis(3)->FindBin(v[1])); sparsePars.push_back(h->GetAxis(4)->FindBin(v[2])); } - for (std::size_t i = 0; i < sparsePars.size(); i++) { - h->GetAxis(i)->SetRange(sparsePars[i], sparsePars[i]); + + for (std::size_t i = 0; i < sparsePars.size() + 1; i++) { + h->GetAxis(i + 1)->SetRange(sparsePars[i], sparsePars[i]); } - calibConstant = h->Projection(sparsePars.size())->GetMean(); + calibConstant = h->Projection(5)->GetMean(); - if (h->Projection(sparsePars.size())->GetEntries() < 2) { + if (h->Projection(sparsePars.size())->GetEntries() < cfgMinEntriesSparseBin) { LOGF(debug, "1 entry in sparse bin! Not used... (increase binsize)"); calibConstant = 0; + isSelected = false; } } return calibConstant; @@ -503,10 +510,13 @@ struct ZdcQVectors { std::vector xEnZN(2, 0.); std::vector yEnZN(2, 0.); + isSelected = true; + auto cent = collision.centFT0C(); if (cent < 0 || cent > 90) { - spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + isSelected = false; + spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); return; } @@ -515,7 +525,8 @@ struct ZdcQVectors { const auto& foundBC = collision.foundBC_as(); if (!foundBC.has_zdc()) { - spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + isSelected = false; + spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); return; } @@ -548,6 +559,7 @@ struct ZdcQVectors { LOGF(warning, " --> No mean V found.. -> THis wil lead to wrong axis for vx, vy (will be created in vmean/)"); registry.get(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]); registry.get(HIST("vmean/hvertex_vy"))->Fill(Form("%d", runnumber), v[1]); + registry.get(HIST("vmean/hvertex_vz"))->Fill(Form("%d", runnumber), v[2]); } if (counter < 1) @@ -588,13 +600,15 @@ struct ZdcQVectors { // if ZNA or ZNC not hit correctly.. do not use event in q-vector calculation if (!isZNAhit || !isZNChit) { counter++; - spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + isSelected = false; + spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); return; } if (!cal.calibfilesLoaded[0][0]) { counter++; - spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, false, 0, 0); + isSelected = false; + spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); return; } @@ -674,11 +688,14 @@ struct ZdcQVectors { } } + if (counter < 1) + LOGF(info, "We evaluate cal.atIteration=%i and cal.atStep=%i ", cal.atIteration, cal.atStep); + if (cal.atIteration == 0) { if (counter < 1) LOGF(warning, "Calibation files missing!!! Output created with q-vectors right after energy gain eq. !!"); fillAllRegistries(0, 0); - spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[0][0][0], q[0][0][1], q[0][0][2], q[0][0][3], true, 0, 0); + spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[0][0][0], q[0][0][1], q[0][0][2], q[0][0][3], isSelected, 0, 0); counter++; return; } else { @@ -707,7 +724,7 @@ struct ZdcQVectors { LOGF(info, "Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep + 1); fillAllRegistries(cal.atIteration, cal.atStep + 1); registry.fill(HIST("QA/centrality_after"), centrality); - spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], true, cal.atIteration, cal.atStep); + spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], isSelected, cal.atIteration, cal.atStep); counter++; return; } diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index 975698931bf..1bf72ba2bd9 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -119,33 +119,33 @@ struct FlowSP { registry.add("pt_phi_bef", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); registry.add("pt_phi_aft", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); - registry.add("v1_eta", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1A_eta", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1C_eta", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1AC_eta", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1A_eta", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1C_eta", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1AC_eta", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_odd", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_even", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_even", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_odd_dev", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_even_dev", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd_dev", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_even_dev", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_odd_dev_pos", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_even_dev_pos", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_odd_pos", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_even_pos", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd_dev_pos", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_even_dev_pos", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_odd_pos", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_even_pos", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_odd_dev_neg", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_even_dev_neg", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_odd_neg", "", kTProfile, {{10, -.8, .8}}); - registry.add("v1_eta_even_neg", "", kTProfile, {{10, -.8, .8}}); + registry.add("v1_eta_odd_dev_neg", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_even_dev_neg", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_odd_neg", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); + registry.add("v1_eta_even_neg", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v2_cent", "", kTProfile, {{80, 0, 80}}); - registry.add("v2A_cent", "", kTProfile, {{80, 0, 80}}); - registry.add("v2C_cent", "", kTProfile, {{80, 0, 80}}); - registry.add("v2AC_cent", "", kTProfile, {{80, 0, 80}}); + registry.add("v2_cent", "", kTProfile2D, {{80, 0, 80}, ptAxis}); + registry.add("v2A_cent", "", kTProfile2D, {{80, 0, 80}, ptAxis}); + registry.add("v2C_cent", "", kTProfile2D, {{80, 0, 80}, ptAxis}); + registry.add("v2AC_cent", "", kTProfile2D, {{80, 0, 80}, ptAxis}); - registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{10, 0, 10}}}); + registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{11, 0, 11}}}); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(1, "Filtered event"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(2, "sel8"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(3, "occupancy"); @@ -371,39 +371,39 @@ struct FlowSP { double v1AC = std::cos(phi - (psiA - psiC)); - registry.fill(HIST("v1_eta"), track.eta(), (1. / std::sqrt(2)) * (v1A - v1C)); - registry.fill(HIST("v1A_eta"), track.eta(), (v1A)); - registry.fill(HIST("v1C_eta"), track.eta(), (v1C)); - registry.fill(HIST("v1AC_eta"), track.eta(), (v1AC)); + registry.fill(HIST("v1_eta"), track.eta(), track.pt(), (1. / std::sqrt(2)) * (v1A - v1C)); + registry.fill(HIST("v1A_eta"), track.eta(), track.pt(), (v1A)); + registry.fill(HIST("v1C_eta"), track.eta(), track.pt(), (v1C)); + registry.fill(HIST("v1AC_eta"), track.eta(), track.pt(), (v1AC)); - registry.fill(HIST("v1_eta_odd"), track.eta(), oddv1); - registry.fill(HIST("v1_eta_even"), track.eta(), evenv1); + registry.fill(HIST("v1_eta_odd"), track.eta(), track.pt(), oddv1); + registry.fill(HIST("v1_eta_even"), track.eta(), track.pt(), evenv1); - registry.fill(HIST("v1_eta_odd_dev"), track.eta(), oddv1Dev); - registry.fill(HIST("v1_eta_even_dev"), track.eta(), evenv1Dev); + registry.fill(HIST("v1_eta_odd_dev"), track.eta(), track.pt(), oddv1Dev); + registry.fill(HIST("v1_eta_even_dev"), track.eta(), track.pt(), evenv1Dev); if (pos) { - registry.fill(HIST("v1_eta_odd_pos"), track.eta(), oddv1); - registry.fill(HIST("v1_eta_even_pos"), track.eta(), evenv1); + registry.fill(HIST("v1_eta_odd_pos"), track.eta(), track.pt(), oddv1); + registry.fill(HIST("v1_eta_even_pos"), track.eta(), track.pt(), evenv1); - registry.fill(HIST("v1_eta_odd_dev_pos"), track.eta(), oddv1Dev); - registry.fill(HIST("v1_eta_even_dev_pos"), track.eta(), evenv1Dev); + registry.fill(HIST("v1_eta_odd_dev_pos"), track.eta(), track.pt(), oddv1Dev); + registry.fill(HIST("v1_eta_even_dev_pos"), track.eta(), track.pt(), evenv1Dev); } else { - registry.fill(HIST("v1_eta_odd_neg"), track.eta(), oddv1); - registry.fill(HIST("v1_eta_even_neg"), track.eta(), evenv1); + registry.fill(HIST("v1_eta_odd_neg"), track.eta(), track.pt(), oddv1); + registry.fill(HIST("v1_eta_even_neg"), track.eta(), track.pt(), evenv1); - registry.fill(HIST("v1_eta_odd_dev_neg"), track.eta(), oddv1Dev); - registry.fill(HIST("v1_eta_even_dev_neg"), track.eta(), evenv1Dev); + registry.fill(HIST("v1_eta_odd_dev_neg"), track.eta(), track.pt(), oddv1Dev); + registry.fill(HIST("v1_eta_even_dev_neg"), track.eta(), track.pt(), evenv1Dev); } double v2A = std::cos(2 * (phi - psiA)); double v2C = std::cos(2 * (phi - psiC)); double v2AC = std::cos(2 * (phi - (psiA - psiC))); - registry.fill(HIST("v2_cent"), centrality, (1. / std::sqrt(2)) * (v2A - v2C)); - registry.fill(HIST("v2A_cent"), centrality, (v2A)); - registry.fill(HIST("v2C_cent"), centrality, (v2C)); - registry.fill(HIST("v2AC_cent"), centrality, (v2AC)); + registry.fill(HIST("v2_cent"), centrality, track.pt(), (1. / std::sqrt(2)) * (v2A - v2C)); + registry.fill(HIST("v2A_cent"), centrality, track.pt(), (v2A)); + registry.fill(HIST("v2C_cent"), centrality, track.pt(), (v2C)); + registry.fill(HIST("v2AC_cent"), centrality, track.pt(), (v2AC)); } float qIm = collision.qvecIm()[0]; From a249913e04e098720fc0ae5e32ff85dd27b8e89b Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Sat, 7 Dec 2024 13:03:04 +0100 Subject: [PATCH 273/459] [PWGLF] fill also zero in gen histogram (#8854) --- PWGLF/Tasks/Nuspex/ebyeMult.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/ebyeMult.cxx b/PWGLF/Tasks/Nuspex/ebyeMult.cxx index 7763d1d3e3b..7fc0ca8e941 100644 --- a/PWGLF/Tasks/Nuspex/ebyeMult.cxx +++ b/PWGLF/Tasks/Nuspex/ebyeMult.cxx @@ -502,7 +502,7 @@ struct EbyeMult { } } } - if (partInAcc > 0) + if (partInAcc >= 0) return nParticles; return -1; } @@ -569,7 +569,7 @@ struct EbyeMult { // search generated INEL > 0 (one charged particle in |eta| < 1) for (const auto& mcCollision : mcCollisions) { int mult = genMultINELgtZERO(mcCollision, mcParticles); - if (mult > 0) { + if (mult >= 0) { histos.fill(HIST("GenINELgtZERO"), mult); } } From 2dabccbd91e1084a4eaad1fa7017f5a7854f70c9 Mon Sep 17 00:00:00 2001 From: a-m-andrushko <96832230+a-m-andrushko@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:01:52 +0100 Subject: [PATCH 274/459] [PWGCF] FemtoUniverse -- Add minus-plus combination to track-nucleus task. (#8834) --- .../femtoUniversePairTaskTrackNucleus.cxx | 386 +++++++++--------- 1 file changed, 194 insertions(+), 192 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx index 4906ec103c0..b9bbf923c88 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx @@ -27,7 +27,6 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/StepTHn.h" #include "Framework/O2DatabasePDGPlugin.h" -#include "TDatabasePDG.h" #include "ReconstructionDataFormats/PID.h" #include "Common/DataModel/PIDResponse.h" @@ -68,7 +67,7 @@ struct femtoUniversePairTaskTrackNucleus { Configurable IsKaonNsigma{"IsKaonNsigma", false, "Enable a strict cut selection for K+ and K-"}; Configurable ConfNsigmaCombined{"ConfNsigmaCombined", 3.0f, "TPC and TOF Pion Sigma (combined) for momentum > ConfTOFpMin"}; Configurable ConfNsigmaTPC{"ConfNsigmaTPC", 3.0f, "TPC Pion Sigma for momentum < ConfTOFpMin"}; - Configurable ConfTOFpMin{"ConfTOFpMin", 0.5f, "Min. momentum for which TOF is required for PID."}; + Configurable ConfTOFpMin{"ConfTOFpMin", 0.45f, "Min. momentum for which TOF is required for PID."}; Configurable ConfEtaMax{"ConfEtaMax", 0.8f, "Higher limit for |Eta| (the same for both particles)"}; Configurable> ConfCutTable{"ConfCutTable", {cutsTable[0], nPart, nCuts, partNames, cutNames}, "Particle selections"}; @@ -82,7 +81,7 @@ struct femtoUniversePairTaskTrackNucleus { struct : o2::framework::ConfigurableGroup { Configurable ConfNsigmaTPCDe{"ConfNsigmaTPCDe", 2.0f, "TPC Deuteron Sigma for momentum < ConfTOFpMinDe"}; Configurable ConfNsigmaTOFDe{"ConfNsigmaTOFDe", 2.0f, "TOF Deuteron Sigma"}; - Configurable ConfTOFpMinDe{"ConfTOFpMinDe", 0.5f, "Min. momentum for deuterons for which TOF is required for PID"}; + Configurable ConfTOFpMinDe{"ConfTOFpMinDe", 1.0f, "Min. momentum for deuterons for which TOF is required for PID"}; Configurable ConfPLowDe{"ConfPLowDe", 0.8f, "Lower limit for momentum for deuterons"}; Configurable ConfPHighDe{"ConfPHighDe", 1.8f, "Higher limit for momentum for deuterons"}; } deuteronconfigs; @@ -93,7 +92,7 @@ struct femtoUniversePairTaskTrackNucleus { Configurable LinCutpLow{"LinCutpLow", 0.0f, "Lower limit of momentum for linear cut of TPC Deuteron Sigma"}; Configurable LinCutpHigh{"LinCutpHigh", 1.4f, "Higher limit of momentum for linear cut of TPC Deuteron Sigma"}; Configurable LinCutParA{"LinCutParA", -167.0f, "Parameter 'A' of a linear function 'y = A * x + B'"}; - Configurable LinCutParB{"B", 300.0f, "Parameter 'B' of a linear function 'y = A * x + B'"}; + Configurable LinCutParB{"LinCutParB", 300.0f, "Parameter 'B' of a linear function 'y = A * x + B'"}; } lincut; /// Table for polynomial 3 cut for TPC Deuteron Sigma @@ -126,9 +125,9 @@ struct femtoUniversePairTaskTrackNucleus { } trackfilter; /// Partition for track - Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackfilter.ConfChargeTrack && aod::femtouniverseparticle::pt < trackfilter.ConfPtHighTrack && aod::femtouniverseparticle::pt > trackfilter.ConfPtLowTrack; + Partition partTrack = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackfilter.ConfChargeTrack && aod::femtouniverseparticle::pt < trackfilter.ConfPtHighTrack && aod::femtouniverseparticle::pt > trackfilter.ConfPtLowTrack; - Partition> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackfilter.ConfChargeTrack && aod::femtouniverseparticle::pt < trackfilter.ConfPtHighTrack && aod::femtouniverseparticle::pt > trackfilter.ConfPtLowTrack; + Partition> partTrackMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackfilter.ConfChargeTrack && aod::femtouniverseparticle::pt < trackfilter.ConfPtHighTrack && aod::femtouniverseparticle::pt > trackfilter.ConfPtLowTrack; /// Histogramming for track FemtoUniverseParticleHisto trackHistoTrack; @@ -144,9 +143,9 @@ struct femtoUniversePairTaskTrackNucleus { } nucleusfilter; /// Partition for nucleus - Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == nucleusfilter.ConfChargeNucleus) && aod::femtouniverseparticle::pt < nucleusfilter.ConfPtHighNucleus && aod::femtouniverseparticle::pt > nucleusfilter.ConfPtLowNucleus; + Partition partNucleus = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == nucleusfilter.ConfChargeNucleus) && aod::femtouniverseparticle::pt < nucleusfilter.ConfPtHighNucleus && aod::femtouniverseparticle::pt > nucleusfilter.ConfPtLowNucleus; - Partition> partsTwoMC = aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack) && (aod::femtouniverseparticle::sign == nucleusfilter.ConfChargeNucleus) && aod::femtouniverseparticle::pt < nucleusfilter.ConfPtHighNucleus && aod::femtouniverseparticle::pt > nucleusfilter.ConfPtLowNucleus; + Partition> partNucleusMC = aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack) && (aod::femtouniverseparticle::sign == nucleusfilter.ConfChargeNucleus) && aod::femtouniverseparticle::pt < nucleusfilter.ConfPtHighNucleus && aod::femtouniverseparticle::pt > nucleusfilter.ConfPtLowNucleus; /// Histogramming for nucleus FemtoUniverseParticleHisto trackHistoNucleus; @@ -195,56 +194,66 @@ struct femtoUniversePairTaskTrackNucleus { Configurable ConfCPRdeltaEtaCutMin{"ConfCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; Configurable ConfCPRChosenRadii{"ConfCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; - Configurable IsPairIdentical{"IsPairIdentical", true, "'true' for identical particles, 'false' for non-identical particles"}; - Configurable cfgProcessPM{"cfgProcessPM", true, "Process differently charged particles (plus-minus)"}; Configurable cfgProcessPP{"cfgProcessPP", true, "Process positively charged particles (plus-plus)"}; Configurable cfgProcessMM{"cfgProcessMM", true, "Process negatively charged particles (minus-minus)"}; + Configurable cfgProcessPM{"cfgProcessPM", false, "Process differently charged particles (plus-minus)"}; + Configurable cfgProcessMP{"cfgProcessMP", false, "Process differently charged particles (minus-plus)"}; Configurable cfgProcessMultBins{"cfgProcessMultBins", true, "Process kstar histograms (in multiplicity bins)"}; Configurable cfgProcessKtBins{"cfgProcessKtBins", true, "Process kstar histograms in kT bins (if 'cfgProcessMultBins' is false, it will not be processed regardless of 'cfgProcessKtBins' state)"}; Configurable cfgProcessKtMt3DCF{"cfgProcessKtMt3DCF", false, "Process 3D histograms in kT and MultBins"}; - FemtoUniverseFemtoContainer sameEventCont; - FemtoUniverseFemtoContainer mixedEventCont; - FemtoUniverseFemtoContainer sameEventContPP; FemtoUniverseFemtoContainer mixedEventContPP; FemtoUniverseFemtoContainer sameEventContMM; FemtoUniverseFemtoContainer mixedEventContMM; + FemtoUniverseFemtoContainer sameEventContPM; + FemtoUniverseFemtoContainer mixedEventContPM; + + FemtoUniverseFemtoContainer sameEventContMP; + FemtoUniverseFemtoContainer mixedEventContMP; + FemtoUniversePairCleaner pairCleaner; FemtoUniverseDetaDphiStar pairCloseRejection; FemtoUniverseTrackSelection trackCuts; - PairWithCentMultKt sameEventMultCont; - PairWithCentMultKt mixedEventMultCont; - PairWithCentMultKt sameEventMultContPP; PairWithCentMultKt mixedEventMultContPP; PairWithCentMultKt sameEventMultContMM; PairWithCentMultKt mixedEventMultContMM; + PairWithCentMultKt sameEventMultContPM; + PairWithCentMultKt mixedEventMultContPM; + + PairWithCentMultKt sameEventMultContMP; + PairWithCentMultKt mixedEventMultContMP; + float mass1 = -1; float mass2 = -1; /// Histogram output HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry resultRegistryPM{"CorrelationsPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry resultRegistryPP{"CorrelationsPP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry resultRegistryMM{"CorrelationsMM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry resultRegistryPM{"CorrelationsPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry resultRegistryMP{"CorrelationsMP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry MixQaRegistry{"MixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry SameMultRegistryPM{"SameMultRegistryPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry MixedMultRegistryPM{"MixedMultRegistryPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry SameMultRegistryPP{"SameMultRegistryPP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry MixedMultRegistryPP{"MixedMultRegistryPP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry SameMultRegistryMM{"SameMultRegistryMM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry MixedMultRegistryMM{"MixedMultRegistryMM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry SameMultRegistryPM{"SameMultRegistryPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MixedMultRegistryPM{"MixedMultRegistryPM", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + HistogramRegistry SameMultRegistryMP{"SameMultRegistryMP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MixedMultRegistryMP{"MixedMultRegistryMP", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry sphericityRegistry{"SphericityHisto", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; /// TPC Pion/Kaon/Proton Sigma selection (general) @@ -408,19 +417,6 @@ struct femtoUniversePairTaskTrackNucleus { mass1 = pdg->Mass(trackfilter.ConfPDGCodeTrack); mass2 = pdg->Mass(nucleusfilter.ConfPDGCodeNucleus); - if (cfgProcessPM) { - sameEventCont.init(&resultRegistryPM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); - mixedEventCont.init(&resultRegistryPM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); - - sameEventCont.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); - mixedEventCont.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); - - if (cfgProcessMultBins) { - sameEventMultCont.init(&SameMultRegistryPM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); - mixedEventMultCont.init(&MixedMultRegistryPM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); - } - } - if (cfgProcessPP) { sameEventContPP.init(&resultRegistryPP, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); mixedEventContPP.init(&resultRegistryPP, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); @@ -445,6 +441,32 @@ struct femtoUniversePairTaskTrackNucleus { } } + if (cfgProcessPM) { + sameEventContPM.init(&resultRegistryPM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + mixedEventContPM.init(&resultRegistryPM, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + + sameEventContPM.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + mixedEventContPM.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + + if (cfgProcessMultBins) { + sameEventMultContPM.init(&SameMultRegistryPM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + mixedEventMultContPM.init(&MixedMultRegistryPM, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + } + } + + if (cfgProcessMP) { + sameEventContMP.init(&resultRegistryMP, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + mixedEventContMP.init(&resultRegistryMP, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, twoobjectsconfigs.ConfIsMC, twoobjectsconfigs.ConfUse3D); + + sameEventContMP.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + mixedEventContMP.setPDGCodes(trackfilter.ConfPDGCodeTrack, nucleusfilter.ConfPDGCodeNucleus); + + if (cfgProcessMultBins) { + sameEventMultContMP.init(&SameMultRegistryMP, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + mixedEventMultContMP.init(&MixedMultRegistryMP, ConfkstarBins, ConfMultKstarBins, ConfKtKstarBins, cfgProcessKtBins, cfgProcessKtMt3DCF); + } + } + pairCleaner.init(&qaRegistry); if (ConfIsCPR.value) { pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); @@ -472,132 +494,98 @@ struct femtoUniversePairTaskTrackNucleus { /// \param parts femtoUniverseParticles table (in case of Monte Carlo joined with FemtoUniverseMCLabels) /// \param magFieldTesla magnetic field of the collision /// \param multCol multiplicity of the collision - /// \param pairType describes charge of correlation pair (plus-minus (1), plus-plus (2), minus-minus (3)) + /// \param pairType describes charge of correlation pair (plus-plus (1), minus-minus (2), plus-minus (3), minus-plus (4)) /// \param fillQA enables filling of QA histograms template void doSameEvent(PartitionType groupTrack, PartitionType groupNucleus, PartType parts, float magFieldTesla, int multCol, int pairType, bool fillQA) { - /// Histogramming SameEvent - if ((pairType == 1 || pairType == 2) && fillQA) { - for (auto& part : groupTrack) { - if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { - continue; - } - trackHistoTrack.fillQA(part); + for (auto& part : groupTrack) { + if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { + continue; } + trackHistoTrack.fillQA(part); } - if ((pairType == 1 || pairType == 3) && fillQA) { - for (auto& part : groupNucleus) { - if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { - continue; - } - trackHistoNucleus.fillQA(part); + for (auto& part : groupNucleus) { + if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { + continue; } + trackHistoNucleus.fillQA(part); } - if (pairType == 1) { - /// Combinations for non-identical pairs - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupTrack, groupNucleus))) { + /// Combinations for identical pairs + for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupTrack, groupTrack))) { - if (!IsParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { - continue; - } - - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { - continue; - } + if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { + continue; + } - if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { - continue; - } - } + if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { + continue; + } - // Cleaning - if (!pairCleaner.isCleanPair(p1, p2, parts)) { + if (ConfIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { continue; } + } - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - - sameEventCont.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - - if (cfgProcessMultBins) - sameEventMultCont.fill(kstar, multCol, kT); + // Cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; } - } else { - /// Combinations for identical pairs - for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupTrack, groupTrack))) { - if (!IsParticleNSigma((int8_t)2, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p1, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p1, o2::track::PID::Deuteron), p1.tpcSignal())) { - continue; - } + switch (pairType) { + case 1: { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(p2, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(p2, o2::track::PID::Deuteron), p2.tpcSignal())) { - continue; - } + sameEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { - continue; - } - } + if (cfgProcessMultBins) + sameEventMultContPP.fill(kstar, multCol, kT); - // Cleaning - if (!pairCleaner.isCleanPair(p1, p2, parts)) { - continue; + break; } - switch (pairType) { - case 2: { - if (IsPairIdentical == true) { - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass1); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass1); - - sameEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + case 2: { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - if (cfgProcessMultBins) - sameEventMultContPP.fill(kstar, multCol, kT); - } else { - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + sameEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - sameEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + if (cfgProcessMultBins) + sameEventMultContMM.fill(kstar, multCol, kT); - if (cfgProcessMultBins) - sameEventMultContPP.fill(kstar, multCol, kT); - } + break; + } - break; - } + case 3: { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - case 3: { - if (IsPairIdentical == true) { - float kstar = FemtoUniverseMath::getkstar(p1, mass2, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass2, p2, mass2); + sameEventContPM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - sameEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + if (cfgProcessMultBins) + sameEventMultContPM.fill(kstar, multCol, kT); - if (cfgProcessMultBins) - sameEventMultContMM.fill(kstar, multCol, kT); - } else { - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + break; + } - sameEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + case 4: { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - if (cfgProcessMultBins) - sameEventMultContMM.fill(kstar, multCol, kT); - } + sameEventContMP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - break; - } + if (cfgProcessMultBins) + sameEventMultContMP.fill(kstar, multCol, kT); - default: - break; + break; } + + default: + break; } } } @@ -611,21 +599,26 @@ struct femtoUniversePairTaskTrackNucleus { fillCollision(col); sphericityRegistry.fill(HIST("sphericity"), col.sphericity()); - auto thegroupTrack = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - auto thegroupNucleus = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); bool fillQA = true; - if (cfgProcessPM) { + if (cfgProcessPP) doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 1, fillQA); + + if (cfgProcessMM) + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 2, fillQA); + + if (cfgProcessPM) { + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 3, fillQA); fillQA = false; } - if (cfgProcessPP) - doSameEvent(thegroupTrack, thegroupTrack, parts, col.magField(), col.multV0M(), 2, fillQA); - - if (cfgProcessMM) - doSameEvent(thegroupNucleus, thegroupNucleus, parts, col.magField(), col.multV0M(), 3, fillQA); + if (cfgProcessMP) { + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 4, fillQA); + fillQA = false; + } } PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processSameEvent, "Enable processing same event", true); @@ -639,21 +632,26 @@ struct femtoUniversePairTaskTrackNucleus { { fillCollision(col); - auto thegroupTrack = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - auto thegroupNucleus = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupTrack = partTrackMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + auto thegroupNucleus = partNucleusMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); bool fillQA = true; - if (cfgProcessPM) { + if (cfgProcessPP) doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 1, fillQA); + + if (cfgProcessMM) + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 2, fillQA); + + if (cfgProcessPM) { + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 3, fillQA); fillQA = false; } - if (cfgProcessPP) - doSameEvent(thegroupTrack, thegroupTrack, parts, col.magField(), col.multV0M(), 2, fillQA); - - if (cfgProcessMM) - doSameEvent(thegroupNucleus, thegroupNucleus, parts, col.magField(), col.multV0M(), 3, fillQA); + if (cfgProcessMP) { + doSameEvent(thegroupTrack, thegroupNucleus, parts, col.magField(), col.multV0M(), 4, fillQA); + fillQA = false; + } } PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processSameEventMC, "Enable processing same event for Monte Carlo", false); @@ -692,54 +690,46 @@ struct femtoUniversePairTaskTrackNucleus { float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - mixedEventCont.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + mixedEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); if (cfgProcessMultBins) - mixedEventMultCont.fill(kstar, multCol, kT); + mixedEventMultContPP.fill(kstar, multCol, kT); break; } case 2: { - if (IsPairIdentical == true) { - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass1); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass1); - - mixedEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - - if (cfgProcessMultBins) - mixedEventMultContPP.fill(kstar, multCol, kT); - } else { - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - mixedEventContPP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + mixedEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - if (cfgProcessMultBins) - mixedEventMultContPP.fill(kstar, multCol, kT); - } + if (cfgProcessMultBins) + mixedEventMultContMM.fill(kstar, multCol, kT); break; } case 3: { - if (IsPairIdentical == true) { - float kstar = FemtoUniverseMath::getkstar(p1, mass2, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass2, p2, mass2); + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - mixedEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + mixedEventContPM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); - if (cfgProcessMultBins) - mixedEventMultContMM.fill(kstar, multCol, kT); - } else { - float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); - float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + if (cfgProcessMultBins) + mixedEventMultContPM.fill(kstar, multCol, kT); - mixedEventContMM.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + break; + } - if (cfgProcessMultBins) - mixedEventMultContMM.fill(kstar, multCol, kT); - } + case 4: { + float kstar = FemtoUniverseMath::getkstar(p1, mass1, p2, mass2); + float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); + + mixedEventContMP.setPair(p1, p2, multCol, twoobjectsconfigs.ConfUse3D); + + if (cfgProcessMultBins) + mixedEventMultContMP.fill(kstar, multCol, kT); break; } @@ -768,23 +758,29 @@ struct femtoUniversePairTaskTrackNucleus { continue; } - if (cfgProcessPM) { - auto groupTrack = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); - auto groupNucleus = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + if (cfgProcessPP) { + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 1); } - if (cfgProcessPP) { - auto groupTrack = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); - auto groupNucleus = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + if (cfgProcessMM) { + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 2); } - if (cfgProcessMM) { - auto groupTrack = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); - auto groupNucleus = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + if (cfgProcessPM) { + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 3); } + + if (cfgProcessMP) { + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 4); + } } } PROCESS_SWITCH(femtoUniversePairTaskTrackNucleus, processMixedEvent, "Enable processing mixed events", true); @@ -809,24 +805,30 @@ struct femtoUniversePairTaskTrackNucleus { continue; } /// \todo before mixing we should check whether both collisions contain a pair of particles! - // if (partsOne.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partsTwo.size() == 0 ) continue; - - if (cfgProcessPM) { - auto groupTrack = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); - auto groupNucleus = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 1); - } + // if partTrack.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partNucleus.size() == 0 ) continue; if (cfgProcessPP) { - auto groupTrack = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); - auto groupNucleus = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 2); + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 1); } if (cfgProcessMM) { - auto groupTrack = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); - auto groupNucleus = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 3); + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 2); + } + + if (cfgProcessPM) { + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 3); + } + + if (cfgProcessMP) { + auto groupTrack = partTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupNucleus = partNucleus->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + doMixedEvent(groupTrack, groupNucleus, parts, magFieldTesla1, multiplicityCol, 4); } } } From db350cd63f440cf46e0d3c1ec6a096d7c80691fd Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Sat, 7 Dec 2024 15:59:44 +0100 Subject: [PATCH 275/459] [PWGLF] Update collision selection for Run2 converted data (#8836) Co-authored-by: ALICE Action Bot --- PWGLF/TableProducer/Resonances/CMakeLists.txt | 4 +- ...itializer.cxx => resonanceInitializer.cxx} | 356 +++++++++--------- PWGLF/Utils/collisionCuts.h | 90 +++-- 3 files changed, 238 insertions(+), 212 deletions(-) rename PWGLF/TableProducer/Resonances/{LFResonanceInitializer.cxx => resonanceInitializer.cxx} (80%) diff --git a/PWGLF/TableProducer/Resonances/CMakeLists.txt b/PWGLF/TableProducer/Resonances/CMakeLists.txt index b8a16e14c53..d6ca37b8d0c 100644 --- a/PWGLF/TableProducer/Resonances/CMakeLists.txt +++ b/PWGLF/TableProducer/Resonances/CMakeLists.txt @@ -25,8 +25,8 @@ o2physics_add_dpl_workflow(filterf1proton PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsVertexing COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(reso2initializer - SOURCES LFResonanceInitializer.cxx +o2physics_add_dpl_workflow(resonance-initializer + SOURCES resonanceInitializer.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase COMPONENT_NAME Analysis) diff --git a/PWGLF/TableProducer/Resonances/LFResonanceInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx similarity index 80% rename from PWGLF/TableProducer/Resonances/LFResonanceInitializer.cxx rename to PWGLF/TableProducer/Resonances/resonanceInitializer.cxx index 23876a82286..8a76e68ddef 100644 --- a/PWGLF/TableProducer/Resonances/LFResonanceInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx @@ -8,19 +8,17 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. - -/// \file LFResonanceInitializer.cxx -/// \brief Initializes variables for the resonance candidate producers -/// /// +/// \file resonanceInitializer.cxx +/// \brief Initializes variables for the resonance candidate producers /// \author Bong-Hwi Lim +/// #include #include #include "Common/DataModel/PIDResponse.h" #include "Common/Core/TrackSelection.h" #include "Common/DataModel/Centrality.h" -// #include "Common/DataModel/Multiplicity.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" @@ -40,19 +38,22 @@ #include "DataFormatsParameters/GRPObject.h" #include "DataFormatsParameters/GRPMagField.h" #include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "CommonConstants/MathConstants.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; +using namespace o2::constants::physics; +using namespace o2::constants::math; /// Initializer for the resonance candidate producers -struct reso2initializer { +struct ResonanceInitializer { SliceCache cache; - float cXiMass; int mRunNumber; int multEstimator; - float d_bz; + float dBz; Service ccdb; Service pdg; @@ -67,7 +68,7 @@ struct reso2initializer { Produces reso2mccascades; // CCDB options - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable ccdbURL{"ccdbURL", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; @@ -76,9 +77,9 @@ struct reso2initializer { Configurable cfgFatalWhenNull{"cfgFatalWhenNull", true, "Fatal when null on ccdb access"}; // Configurables - Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; - Configurable ConfFillQA{"ConfFillQA", false, "Fill QA histograms"}; - Configurable ConfBypassCCDB{"ConfBypassCCDB", true, "Bypass loading CCDB part to save CPU time and memory"}; // will be affected to b_z value. + Configurable dBzInput{"dBzInput", -999, "bz field, -999 is automatic"}; + Configurable cfgFillQA{"cfgFillQA", false, "Fill QA histograms"}; + Configurable cfgBypassCCDB{"cfgBypassCCDB", true, "Bypass loading CCDB part to save CPU time and memory"}; // will be affected to b_z value. // Track filter from tpcSkimsTableCreator Configurable trackSelection{"trackSelection", 0, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"}; @@ -90,22 +91,22 @@ struct reso2initializer { /// Event cuts o2::analysis::CollisonCuts colCuts; - Configurable ConfEvtZvtx{"ConfEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; - Configurable ConfEvtOccupancyInTimeRange{"ConfEvtOccupancyInTimeRange", -1, "Evt sel: maximum track occupancy"}; - Configurable ConfEvtTriggerCheck{"ConfEvtTriggerCheck", false, "Evt sel: check for trigger"}; - Configurable ConfEvtTriggerSel{"ConfEvtTriggerSel", 8, "Evt sel: trigger"}; - Configurable ConfEvtOfflineCheck{"ConfEvtOfflineCheck", true, "Evt sel: check for offline selection"}; - Configurable ConfEvtTriggerTVXSel{"ConfEvtTriggerTVXSel", false, "Evt sel: triggerTVX selection (MB)"}; - Configurable ConfEvtTFBorderCut{"ConfEvtTFBorderCut", false, "Evt sel: apply TF border cut"}; - Configurable ConfEvtUseITSTPCvertex{"ConfEvtUseITSTPCvertex", false, "Evt sel: use at lease on ITS-TPC track for vertexing"}; - Configurable ConfEvtZvertexTimedifference{"ConfEvtZvertexTimedifference", false, "Evt sel: apply Z-vertex time difference"}; - Configurable ConfEvtPileupRejection{"ConfEvtPileupRejection", false, "Evt sel: apply pileup rejection"}; - Configurable ConfEvtNoITSROBorderCut{"ConfEvtNoITSROBorderCut", false, "Evt sel: apply NoITSRO border cut"}; + Configurable cfgEvtZvtx{"cfgEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable cfgEvtOccupancyInTimeRange{"cfgEvtOccupancyInTimeRange", -1, "Evt sel: maximum track occupancy"}; + Configurable cfgEvtTriggerCheck{"cfgEvtTriggerCheck", false, "Evt sel: check for trigger"}; + Configurable cfgEvtTriggerSel{"cfgEvtTriggerSel", 8, "Evt sel: trigger"}; + Configurable cfgEvtOfflineCheck{"cfgEvtOfflineCheck", true, "Evt sel: check for offline selection"}; + Configurable cfgEvtTriggerTVXSel{"cfgEvtTriggerTVXSel", false, "Evt sel: triggerTVX selection (MB)"}; + Configurable cfgEvtTFBorderCut{"cfgEvtTFBorderCut", false, "Evt sel: apply TF border cut"}; + Configurable cfgEvtUseITSTPCvertex{"cfgEvtUseITSTPCvertex", false, "Evt sel: use at lease on ITS-TPC track for vertexing"}; + Configurable cfgEvtZvertexTimedifference{"cfgEvtZvertexTimedifference", false, "Evt sel: apply Z-vertex time difference"}; + Configurable cfgEvtPileupRejection{"cfgEvtPileupRejection", false, "Evt sel: apply pileup rejection"}; + Configurable cfgEvtNoITSROBorderCut{"cfgEvtNoITSROBorderCut", false, "Evt sel: apply NoITSRO border cut"}; Configurable cfgMultName{"cfgMultName", "FT0M", "The name of multiplicity estimator"}; // Qvector configuration - Configurable ConfBypassQvec{"ConfBypassQvec", true, "Bypass for qvector task"}; + Configurable cfgBypassQvec{"cfgBypassQvec", true, "Bypass for qvector task"}; Configurable cfgEvtPl{"cfgEvtPl", 40500, "Configuration of three subsystems for the event plane and its resolution, 10000*RefA + 100*RefB + S, where FT0C:0, FT0A:1, FT0M:2, FV0A:3, BPos:5, BNeg:6"}; // Pre-selection cuts @@ -127,7 +128,7 @@ struct reso2initializer { Configurable cMinV0CosPA{"cMinV0CosPA", 0.995, "Minimum V0 CosPA to PV"}; /// DCA Selections for Cascades - Configurable mincrossedrows_cascbach{"mincrossedrows_cascbach", 70, "min crossed rows for bachelor track from cascade"}; + Configurable cfgMinCrossedRowsCascBach{"cfgMinCrossedRowsCascBach", 70, "min crossed rows for bachelor track from cascade"}; Configurable cMinCascBachDCArToPVcut{"cMinCascBachDCArToPVcut", 0.05f, "Cascade Bachelor Track DCAr cut to PV Minimum"}; // Pre-selection Configurable cMaxCascBachDCArToPVcut{"cMaxCascBachDCArToPVcut", 999.0f, "Cascade Bachelor Track DCAr cut to PV Maximum"}; // Pre-selection Configurable cMaxCascDCAV0Daughters{"cMaxCascDCAV0Daughters", 1.6, "Cascade DCA between V0 daughters Maximum"}; @@ -155,9 +156,9 @@ struct reso2initializer { EventPlaneHelper helperEP; - int EvtPlRefAId = static_cast(cfgEvtPl / 10000); - int EvtPlRefBId = static_cast((cfgEvtPl - EvtPlRefAId * 10000) / 100); - int EvtPlDetId = cfgEvtPl - EvtPlRefAId * 10000 - EvtPlRefBId * 100; + int evtPlRefAId = static_cast(cfgEvtPl / 10000); + int evtPlRefBId = static_cast((cfgEvtPl - evtPlRefAId * 10000) / 100); + int evtPlDetId = cfgEvtPl - evtPlRefAId * 10000 - evtPlRefBId * 100; // MC Resonance parent filter Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == 313) // K* @@ -189,40 +190,41 @@ struct reso2initializer { using ResoV0sMC = soa::Join; using ResoCascades = aod::CascDatas; using ResoCascadesMC = soa::Join; + using BCsWithRun2Info = soa::Join; template - bool IsTrackSelected(CollisionType const&, TrackType const& track) + bool isTrackSelected(CollisionType const&, TrackType const& track) { // Track selection - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodTrackIndices"), 0.5); // MC case can be handled here if constexpr (isMC) { // MC check - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodMCTrackIndices"), 0.5); } // DCAxy cut - if (fabs(track.dcaXY()) > cMaxDCArToPVcut) + if (std::fabs(track.dcaXY()) > cMaxDCArToPVcut) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodTrackIndices"), 1.5); // DCAz cut - if (fabs(track.dcaZ()) > cMaxDCAzToPVcut || fabs(track.dcaZ()) < cMinDCAzToPVcut) + if (std::fabs(track.dcaZ()) > cMaxDCAzToPVcut || std::fabs(track.dcaZ()) < cMinDCAzToPVcut) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodTrackIndices"), 2.5); - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodTrackIndices"), 7.5); return true; } template - bool IsV0Selected(CollisionType const&, V0Type const& v0, TrackType const&) + bool isV0Selected(CollisionType const&, V0Type const& v0, TrackType const&) { // V0 selection - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodV0Indices"), 0.5); auto postrack = v0.template posTrack_as(); @@ -232,39 +234,39 @@ struct reso2initializer { return false; if (negtrack.tpcNClsCrossedRows() < mincrossedrows) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodV0Indices"), 1.5); - if (fabs(postrack.dcaXY()) < cMinV0PosDCArToPVcut) + if (std::fabs(postrack.dcaXY()) < cMinV0PosDCArToPVcut) return false; - if (fabs(negtrack.dcaXY()) < cMinV0NegDCArToPVcut) + if (std::fabs(negtrack.dcaXY()) < cMinV0NegDCArToPVcut) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodV0Indices"), 2.5); if ((v0.v0radius() > cMaxV0Radius) || (v0.v0radius() < cMinV0Radius)) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodV0Indices"), 3.5); if (v0.v0cosPA() < cMinV0CosPA) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodV0Indices"), 4.5); // MC case can be handled here if constexpr (isMC) { // MC check - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodMCV0Indices"), 0.5); } return true; } template - bool IsCascSelected(CollisionType const& collision, CascType const& casc, TrackType const&) + bool isCascSelected(CollisionType const& collision, CascType const& casc, TrackType const&) { // V0 selection - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 0.5); auto trackBach = casc.template bachelor_as(); @@ -272,16 +274,16 @@ struct reso2initializer { // auto trackNeg = casc.template negTrack_as(); // track cuts - if (trackBach.tpcNClsCrossedRows() < mincrossedrows_cascbach) + if (trackBach.tpcNClsCrossedRows() < cfgMinCrossedRowsCascBach) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 1.5); - if (fabs(trackBach.dcaXY()) < cMinCascBachDCArToPVcut) + if (std::fabs(trackBach.dcaXY()) < cMinCascBachDCArToPVcut) return false; - if (fabs(trackBach.dcaXY()) > cMaxCascBachDCArToPVcut) + if (std::fabs(trackBach.dcaXY()) > cMaxCascBachDCArToPVcut) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 2.5); // DCA daugthers @@ -289,7 +291,7 @@ struct reso2initializer { return false; if (casc.dcacascdaughters() > cMaxCascDCACascDaughters) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 3.5); // CPA cuts @@ -297,34 +299,34 @@ struct reso2initializer { return false; if (casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) < cMinCascV0CosPA) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 4.5); // V0 radius auto v0radius = casc.v0radius(); if ((v0radius > cMaxCascV0Radius) || (v0radius < cMinCascV0Radius)) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 5.5); // Casc radius auto cascradius = casc.cascradius(); if ((cascradius > cMaxCascRadius) || (cascradius < cMinCascRadius)) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 6.5); // Casc mass auto cascMass = casc.mXi(); - if (abs(cascMass - cXiMass) > cCascMassResol) + if (std::abs(cascMass - MassXiMinus) > cCascMassResol) return false; - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodCascIndices"), 7.5); // MC case can be handled here if constexpr (isMC) { // MC check - if (ConfFillQA) + if (cfgFillQA) qaRegistry.fill(HIST("hGoodMCCascIndices"), 0.5); } return true; @@ -332,9 +334,9 @@ struct reso2initializer { // Check if the collision is INEL>0 template - bool IsTrueINEL0(MCColl const& /*mccoll*/, MCPart const& mcparts) + bool isTrueINEL0(MCColl const& /*mccoll*/, MCPart const& mcparts) { - for (auto& mcparticle : mcparts) { + for (auto const& mcparticle : mcparts) { if (!mcparticle.isPhysicalPrimary()) continue; auto p = pdg->GetParticle(mcparticle.pdgCode()); @@ -350,7 +352,7 @@ struct reso2initializer { // Centralicity estimator selection template - float CentEst(ResoColl ResoEvents) + float centEst(ResoColl ResoEvents) { float returnValue = -999.0; switch (multEstimator) { @@ -380,7 +382,7 @@ struct reso2initializer { /// \param tracks All tracks /// \return value of the spherocity of the event template - float ComputeSpherocity(T const& tracks, int nTracksMin, int spdef) + float computeSpherocity(T const& tracks, int nTracksMin, int spdef) { // if number of tracks is not enough for spherocity estimation. int ntrks = tracks.size(); @@ -391,7 +393,7 @@ struct reso2initializer { float ptSum = 0.; for (auto const& track : tracks) { - if (ConfFillQA) { + if (cfgFillQA) { qaRegistry.fill(HIST("Phi"), track.phi()); } if (spdef == 0) { @@ -404,39 +406,39 @@ struct reso2initializer { float tempSph = 1.; for (int i = 0; i < 360 / 0.1; ++i) { float sum = 0., pt = 0.; - float phiparm = (TMath::Pi() * i * 0.1) / 180.; - float nx = TMath::Cos(phiparm); - float ny = TMath::Sin(phiparm); + float phiparm = (PI * i * 0.1) / 180.; + float nx = std::cos(phiparm); + float ny = std::sin(phiparm); for (auto const& trk : tracks) { pt = trk.pt(); if (spdef == 0) { pt = 1.; } float phi = trk.phi(); - float px = pt * TMath::Cos(phi); - float py = pt * TMath::Sin(phi); + float px = pt * std::cos(phi); + float py = pt * std::sin(phi); // sum += pt * abs(sin(phiparm - phi)); - sum += TMath::Abs(px * ny - py * nx); + sum += std::abs(px * ny - py * nx); } - float sph = TMath::Power((sum / ptSum), 2); + float sph = std::pow((sum / ptSum), 2); if (sph < tempSph) tempSph = sph; } - return TMath::Power(TMath::Pi() / 2., 2) * tempSph; + return std::pow(PIHalf, 2) * tempSph; } template - float GetEvtPl(ResoColl ResoEvents) + float getEvtPl(ResoColl ResoEvents) { float returnValue = -999.0; - if (ResoEvents.qvecAmp()[EvtPlDetId] > 1e-8) - returnValue = helperEP.GetEventPlane(ResoEvents.qvecRe()[EvtPlDetId * 4 + 3], ResoEvents.qvecIm()[EvtPlDetId * 4 + 3], 2); + if (ResoEvents.qvecAmp()[evtPlDetId] > 1e-8) + returnValue = helperEP.GetEventPlane(ResoEvents.qvecRe()[evtPlDetId * 4 + 3], ResoEvents.qvecIm()[evtPlDetId * 4 + 3], 2); return returnValue; } template - float GetEvtPlRes(ResoColl ResoEvents, int a, int b) + float getEvtPlRes(ResoColl ResoEvents, int a, int b) { float returnValue = -999.0; if (ResoEvents.qvecAmp()[a] < 1e-8 || ResoEvents.qvecAmp()[b] < 1e-8) @@ -450,8 +452,8 @@ struct reso2initializer { void fillTracks(CollisionType const& collision, TrackType const& tracks) { // Loop over tracks - for (auto& track : tracks) { - if (!IsTrackSelected(collision, track)) + for (auto const& track : tracks) { + if (!isTrackSelected(collision, track)) continue; reso2trks(resoCollisions.lastIndex(), track.pt(), @@ -500,8 +502,8 @@ struct reso2initializer { void fillV0s(CollisionType const& collision, V0Type const& v0s, TrackType const& tracks) { int childIDs[2] = {0, 0}; // these IDs are necessary to keep track of the children - for (auto& v0 : v0s) { - if (!IsV0Selected(collision, v0, tracks)) + for (auto const& v0 : v0s) { + if (!isV0Selected(collision, v0, tracks)) continue; childIDs[0] = v0.posTrackId(); childIDs[1] = v0.negTrackId(); @@ -545,8 +547,8 @@ struct reso2initializer { void fillCascades(CollisionType const& collision, CascType const& cascades, TrackType const& tracks) { int childIDs[3] = {0, 0, 0}; // these IDs are necessary to keep track of the children - for (auto& casc : cascades) { - if (!IsCascSelected(collision, casc, tracks)) + for (auto const& casc : cascades) { + if (!isCascSelected(collision, casc, tracks)) continue; childIDs[0] = casc.posTrackId(); childIDs[1] = casc.negTrackId(); @@ -602,7 +604,7 @@ struct reso2initializer { // ------ Temporal lambda function to prevent error in build auto getMothersIndeces = [&](auto const& theMcParticle) { std::vector lMothersIndeces{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother index lMother: %d", lMother.globalIndex()); lMothersIndeces.push_back(lMother.globalIndex()); } @@ -610,7 +612,7 @@ struct reso2initializer { }; auto getMothersPDGCodes = [&](auto const& theMcParticle) { std::vector lMothersPDGs{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother pdgcode lMother: %d", lMother.pdgCode()); lMothersPDGs.push_back(lMother.pdgCode()); } @@ -618,9 +620,9 @@ struct reso2initializer { }; auto getSiblingsIndeces = [&](auto const& theMcParticle) { std::vector lSiblingsIndeces{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother index lMother: %d", lMother.globalIndex()); - for (auto& lDaughter : lMother.template daughters_as()) { + for (auto const& lDaughter : lMother.template daughters_as()) { LOGF(debug, " daughter index lDaughter: %d", lDaughter.globalIndex()); if (lDaughter.globalIndex() != 0 && lDaughter.globalIndex() != theMcParticle.globalIndex()) { lSiblingsIndeces.push_back(lDaughter.globalIndex()); @@ -633,7 +635,7 @@ struct reso2initializer { std::vector mothers = {-1, -1}; std::vector motherPDGs = {-1, -1}; int siblings[2] = {0, 0}; - std::vector siblings_temp = {-1, -1}; + std::vector siblingsTemp = {-1, -1}; if (track.has_mcParticle()) { // // Get the MC particle @@ -641,16 +643,16 @@ struct reso2initializer { if (particle.has_mothers()) { mothers = getMothersIndeces(particle); motherPDGs = getMothersPDGCodes(particle); - siblings_temp = getSiblingsIndeces(particle); + siblingsTemp = getSiblingsIndeces(particle); } while (mothers.size() > 2) { mothers.pop_back(); motherPDGs.pop_back(); } - if (siblings_temp.size() > 0) - siblings[0] = siblings_temp[0]; - if (siblings_temp.size() > 1) - siblings[1] = siblings_temp[1]; + if (siblingsTemp.size() > 0) + siblings[0] = siblingsTemp[0]; + if (siblingsTemp.size() > 1) + siblings[1] = siblingsTemp[1]; reso2mctracks(particle.pdgCode(), mothers[0], motherPDGs[0], @@ -674,7 +676,7 @@ struct reso2initializer { // ------ Temporal lambda function to prevent error in build auto getMothersIndeces = [&](auto const& theMcParticle) { std::vector lMothersIndeces{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother index lMother: %d", lMother.globalIndex()); lMothersIndeces.push_back(lMother.globalIndex()); } @@ -682,7 +684,7 @@ struct reso2initializer { }; auto getMothersPDGCodes = [&](auto const& theMcParticle) { std::vector lMothersPDGs{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother pdgcode lMother: %d", lMother.pdgCode()); lMothersPDGs.push_back(lMother.pdgCode()); } @@ -690,7 +692,7 @@ struct reso2initializer { }; auto getDaughtersIndeces = [&](auto const& theMcParticle) { std::vector lDaughtersIndeces{}; - for (auto& lDaughter : theMcParticle.template daughters_as()) { + for (auto const& lDaughter : theMcParticle.template daughters_as()) { LOGF(debug, " daughter index lDaughter: %d", lDaughter.globalIndex()); if (lDaughter.globalIndex() != 0) { lDaughtersIndeces.push_back(lDaughter.globalIndex()); @@ -700,7 +702,7 @@ struct reso2initializer { }; auto getDaughtersPDGCodes = [&](auto const& theMcParticle) { std::vector lDaughtersPDGs{}; - for (auto& lDaughter : theMcParticle.template daughters_as()) { + for (auto const& lDaughter : theMcParticle.template daughters_as()) { LOGF(debug, " daughter pdgcode lDaughter: %d", lDaughter.pdgCode()); if (lDaughter.globalIndex() != 0) { lDaughtersPDGs.push_back(lDaughter.pdgCode()); @@ -760,7 +762,7 @@ struct reso2initializer { // ------ Temporal lambda function to prevent error in build auto getMothersIndeces = [&](auto const& theMcParticle) { std::vector lMothersIndeces{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother index lMother: %d", lMother.globalIndex()); lMothersIndeces.push_back(lMother.globalIndex()); } @@ -768,7 +770,7 @@ struct reso2initializer { }; auto getMothersPDGCodes = [&](auto const& theMcParticle) { std::vector lMothersPDGs{}; - for (auto& lMother : theMcParticle.template mothers_as()) { + for (auto const& lMother : theMcParticle.template mothers_as()) { LOGF(debug, " mother pdgcode lMother: %d", lMother.pdgCode()); lMothersPDGs.push_back(lMother.pdgCode()); } @@ -776,7 +778,7 @@ struct reso2initializer { }; auto getDaughtersIndeces = [&](auto const& theMcParticle) { std::vector lDaughtersIndeces{}; - for (auto& lDaughter : theMcParticle.template daughters_as()) { + for (auto const& lDaughter : theMcParticle.template daughters_as()) { LOGF(debug, " daughter index lDaughter: %d", lDaughter.globalIndex()); if (lDaughter.globalIndex() != 0) { lDaughtersIndeces.push_back(lDaughter.globalIndex()); @@ -786,7 +788,7 @@ struct reso2initializer { }; auto getDaughtersPDGCodes = [&](auto const& theMcParticle) { std::vector lDaughtersPDGs{}; - for (auto& lDaughter : theMcParticle.template daughters_as()) { + for (auto const& lDaughter : theMcParticle.template daughters_as()) { LOGF(debug, " daughter pdgcode lDaughter: %d", lDaughter.pdgCode()); if (lDaughter.globalIndex() != 0) { lDaughtersPDGs.push_back(lDaughter.pdgCode()); @@ -843,7 +845,7 @@ struct reso2initializer { template void fillMCParticles(SelectedMCPartType const& mcParts, TotalMCParts const& mcParticles) { - for (auto& mcPart : mcParts) { + for (auto const& mcPart : mcParts) { std::vector daughterPDGs; if (mcPart.has_daughters()) { auto daughter01 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[0] - mcParticles.offset()); @@ -876,11 +878,11 @@ struct reso2initializer { { auto centrality = 0.0; if constexpr (!isRun2) - centrality = CentEst(mccol); + centrality = centEst(mccol); else centrality = mccol.centRun2V0M(); - bool inVtx10 = (abs(mccol.mcCollision().posZ()) > 10.) ? false : true; - bool isTrueINELgt0 = IsTrueINEL0(mccol, mcparts); + bool inVtx10 = (std::abs(mccol.mcCollision().posZ()) > 10.) ? false : true; + bool isTrueINELgt0 = isTrueINEL0(mccol, mcparts); bool isTriggerTVX = mccol.selection_bit(aod::evsel::kIsTriggerTVX); bool isSel8 = mccol.sel8(); bool isSelected = colCuts.isSelected(mccol); @@ -928,9 +930,8 @@ struct reso2initializer { void init(InitContext&) { - cXiMass = pdg->GetParticle(3312)->Mass(); mRunNumber = 0; - d_bz = 0; + dBz = 0; // Multiplicity estimator selection (0: FT0M, 1: FT0C, 2: FT0A, 99: FV0A) if (cfgMultName.value == "FT0M") { multEstimator = 0; @@ -956,19 +957,19 @@ struct reso2initializer { // Case selector based on the process. if (doprocessTrackDataRun2 || doprocessTrackV0DataRun2 || doprocessTrackV0CascDataRun2 || doprocessTrackMCRun2 || doprocessTrackV0MCRun2 || doprocessTrackV0CascMCRun2) { - colCuts.setCuts(ConfEvtZvtx, ConfEvtTriggerCheck, ConfEvtTriggerSel, ConfEvtOfflineCheck, false); + colCuts.setCuts(cfgEvtZvtx, cfgEvtTriggerCheck, cfgEvtTriggerSel, cfgEvtOfflineCheck, false); } else if (doprocessTrackData || doprocessTrackV0Data || doprocessTrackV0CascData || doprocessTrackMC || doprocessTrackV0MC || doprocessTrackV0CascMC || doprocessTrackEPData) { - colCuts.setCuts(ConfEvtZvtx, ConfEvtTriggerCheck, ConfEvtTriggerSel, ConfEvtOfflineCheck, true, false, ConfEvtOccupancyInTimeRange); + colCuts.setCuts(cfgEvtZvtx, cfgEvtTriggerCheck, cfgEvtTriggerSel, cfgEvtOfflineCheck, true, false, cfgEvtOccupancyInTimeRange); } colCuts.init(&qaRegistry); - colCuts.setTriggerTVX(ConfEvtTriggerTVXSel); - colCuts.setApplyTFBorderCut(ConfEvtTFBorderCut); - colCuts.setApplyITSTPCvertex(ConfEvtUseITSTPCvertex); - colCuts.setApplyZvertexTimedifference(ConfEvtZvertexTimedifference); - colCuts.setApplyPileupRejection(ConfEvtPileupRejection); - colCuts.setApplyNoITSROBorderCut(ConfEvtNoITSROBorderCut); - if (!ConfBypassCCDB) { - ccdb->setURL(ccdburl.value); + colCuts.setTriggerTVX(cfgEvtTriggerTVXSel); + colCuts.setApplyTFBorderCut(cfgEvtTFBorderCut); + colCuts.setApplyITSTPCvertex(cfgEvtUseITSTPCvertex); + colCuts.setApplyZvertexTimedifference(cfgEvtZvertexTimedifference); + colCuts.setApplyPileupRejection(cfgEvtPileupRejection); + colCuts.setApplyNoITSROBorderCut(cfgEvtNoITSROBorderCut); + if (!cfgBypassCCDB) { + ccdb->setURL(ccdbURL.value); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setFatalWhenNull(cfgFatalWhenNull); @@ -983,7 +984,7 @@ struct reso2initializer { qaRegistry.add("Event/hMCEventIndices", "hMCEventIndices", kTH2D, {centAxis, idxMCAxis}); } AxisSpec idxAxis = {8, 0, 8, "Index"}; - if (ConfFillQA) { + if (cfgFillQA) { qaRegistry.add("hGoodTrackIndices", "hGoodTrackIndices", kTH1F, {idxAxis}); qaRegistry.add("hGoodMCTrackIndices", "hGoodMCTrackIndices", kTH1F, {idxAxis}); qaRegistry.add("hGoodV0Indices", "hGoodV0Indices", kTH1F, {idxAxis}); @@ -996,48 +997,53 @@ struct reso2initializer { void initCCDB(aod::BCsWithTimestamps::iterator const& bc) // Simple copy from LambdaKzeroFinder.cxx { - if (ConfBypassCCDB) + if (cfgBypassCCDB) return; if (mRunNumber == bc.runNumber()) { return; } // In case override, don't proceed, please - no CCDB access required - if (d_bz_input > -990) { - d_bz = d_bz_input; + if (dBzInput > -990) { + dBz = dBzInput; ; o2::parameters::GRPMagField grpmag; - if (fabs(d_bz) > 1e-5) { - grpmag.setL3Current(30000.f / (d_bz / 5.0f)); + if (std::fabs(dBz) > 1e-5) { + grpmag.setL3Current(30000.f / (dBz / 5.0f)); } o2::base::Propagator::initFieldFromGRP(&grpmag); mRunNumber = bc.runNumber(); return; } - auto run3grp_timestamp = bc.timestamp(); - o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(grpPath, run3grp_timestamp); + auto run3GRPTimestamp = bc.timestamp(); + o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(grpPath, run3GRPTimestamp); o2::parameters::GRPMagField* grpmag = 0x0; if (grpo) { o2::base::Propagator::initFieldFromGRP(grpo); // Fetch magnetic field from ccdb for current collision - d_bz = grpo->getNominalL3Field(); - LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; + dBz = grpo->getNominalL3Field(); + LOG(info) << "Retrieved GRP for timestamp " << run3GRPTimestamp << " with magnetic field of " << dBz << " kZG"; } else { - grpmag = ccdb->getForTimeStamp(grpmagPath, run3grp_timestamp); + grpmag = ccdb->getForTimeStamp(grpmagPath, run3GRPTimestamp); if (!grpmag) { - LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp; + LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3GRPTimestamp; } o2::base::Propagator::initFieldFromGRP(grpmag); // Fetch magnetic field from ccdb for current collision - d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f); - LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; + dBz = std::lround(5.f * grpmag->getL3Current() / 30000.f); + LOG(info) << "Retrieved GRP for timestamp " << run3GRPTimestamp << " with magnetic field of " << dBz << " kZG"; } mRunNumber = bc.runNumber(); // Set magnetic field value once known - LOGF(info, "Bz set to %f for run: ", d_bz, mRunNumber); + LOGF(info, "Bz set to %f for run: ", dBz, mRunNumber); } + void processDummy(ResoRun2Events const& collisions) + { + } + PROCESS_SWITCH(ResonanceInitializer, processDummy, "Process for dummy", true); + void processTrackData(ResoEvents::iterator const& collision, soa::Filtered const& tracks, aod::BCsWithTimestamps const&) @@ -1049,28 +1055,27 @@ struct reso2initializer { return; colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackData, "Process for data", true); + PROCESS_SWITCH(ResonanceInitializer, processTrackData, "Process for data", false); void processTrackDataRun2(ResoRun2Events::iterator const& collision, soa::Filtered const& tracks, - aod::BCsWithTimestamps const&) + BCsWithRun2Info const&) { - auto bc = collision.bc_as(); /// adding timestamp to access magnetic field later - initCCDB(bc); + auto bc = collision.bc_as(); // Default event selection if (!colCuts.isSelected(collision)) return; colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackDataRun2, "Process for data", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackDataRun2, "Process for data", false); void processTrackEPData(soa::Join::iterator const& collision, soa::Filtered const& tracks, @@ -1083,11 +1088,11 @@ struct reso2initializer { return; colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), GetEvtPl(collision), GetEvtPlRes(collision, EvtPlDetId, EvtPlRefAId), GetEvtPlRes(collision, EvtPlDetId, EvtPlRefBId), GetEvtPlRes(collision, EvtPlRefAId, EvtPlRefBId), d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), getEvtPl(collision), getEvtPlRes(collision, evtPlDetId, evtPlRefAId), getEvtPlRes(collision, evtPlDetId, evtPlRefBId), getEvtPlRes(collision, evtPlRefAId, evtPlRefBId), dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackEPData, "Process for data and ep ana", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackEPData, "Process for data and ep ana", false); void processTrackV0Data(ResoEvents::iterator const& collision, soa::Filtered const& tracks, @@ -1101,31 +1106,30 @@ struct reso2initializer { return; colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackV0Data, "Process for data", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0Data, "Process for data", false); void processTrackV0DataRun2(ResoRun2Events::iterator const& collision, soa::Filtered const& tracks, ResoV0s const& V0s, - aod::BCsWithTimestamps const&) + BCsWithRun2Info const&) { - auto bc = collision.bc_as(); /// adding timestamp to access magnetic field later - initCCDB(bc); + auto bc = collision.bc_as(); // Default event selection if (!colCuts.isSelected(collision)) return; colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackV0DataRun2, "Process for data", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0DataRun2, "Process for data", false); void processTrackV0CascData(ResoEvents::iterator const& collision, soa::Filtered const& tracks, @@ -1140,34 +1144,33 @@ struct reso2initializer { return; colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); fillCascades(collision, Cascades, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackV0CascData, "Process for data", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0CascData, "Process for data", false); void processTrackV0CascDataRun2(ResoRun2Events::iterator const& collision, soa::Filtered const& tracks, ResoV0s const& V0s, ResoCascades const& Cascades, - aod::BCsWithTimestamps const&) + BCsWithRun2Info const&) { - auto bc = collision.bc_as(); /// adding timestamp to access magnetic field later - initCCDB(bc); + auto bc = collision.bc_as(); // Default event selection if (!colCuts.isSelected(collision)) return; colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); fillCascades(collision, Cascades, tracks); } - PROCESS_SWITCH(reso2initializer, processTrackV0CascDataRun2, "Process for data", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0CascDataRun2, "Process for data", false); Preslice perMcCollision = aod::mcparticle::mcCollisionId; void processTrackMC(soa::Join::iterator const& collision, @@ -1178,7 +1181,7 @@ struct reso2initializer { initCCDB(bc); colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); auto mccollision = collision.mcCollision_as(); float impactpar = mccollision.impactParameter(); @@ -1191,7 +1194,7 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackMC, "Process for MC", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackMC, "Process for MC", false); void processTrackEPMC(soa::Join::iterator const& collision, aod::McCollisions const&, soa::Filtered const& tracks, @@ -1201,7 +1204,7 @@ struct reso2initializer { initCCDB(bc); colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), GetEvtPl(collision), GetEvtPlRes(collision, EvtPlDetId, EvtPlRefAId), GetEvtPlRes(collision, EvtPlDetId, EvtPlRefBId), GetEvtPlRes(collision, EvtPlRefAId, EvtPlRefBId), d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), getEvtPl(collision), getEvtPlRes(collision, evtPlDetId, evtPlRefAId), getEvtPlRes(collision, evtPlDetId, evtPlRefBId), getEvtPlRes(collision, evtPlRefAId, evtPlRefBId), dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1210,18 +1213,17 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackEPMC, "Process for MC and ep ana", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackEPMC, "Process for MC and ep ana", false); Preslice perMcCollisionRun2 = aod::mcparticle::mcCollisionId; void processTrackMCRun2(soa::Join::iterator const& collision, aod::McCollisions const&, soa::Filtered const& tracks, - aod::McParticles const& mcParticles, aod::BCsWithTimestamps const&) + aod::McParticles const& mcParticles, BCsWithRun2Info const&) { - auto bc = collision.bc_as(); /// adding timestamp to access magnetic field later - initCCDB(bc); + auto bc = collision.bc_as(); colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1231,7 +1233,7 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollisionRun2, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackMCRun2, "Process for MC", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackMCRun2, "Process for MC", false); void processTrackV0MC(soa::Join::iterator const& collision, aod::McCollisions const&, soa::Filtered const& tracks, @@ -1242,7 +1244,7 @@ struct reso2initializer { initCCDB(bc); colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1253,18 +1255,17 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackV0MC, "Process for MC", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0MC, "Process for MC", false); void processTrackV0MCRun2(soa::Join::iterator const& collision, aod::McCollisions const&, soa::Filtered const& tracks, ResoV0sMC const& V0s, - aod::McParticles const& mcParticles, aod::BCsWithTimestamps const&) + aod::McParticles const& mcParticles, BCsWithRun2Info const&) { - auto bc = collision.bc_as(); /// adding timestamp to access magnetic field later - initCCDB(bc); + auto bc = collision.bc_as(); colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1275,7 +1276,7 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackV0MCRun2, "Process for MC", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0MCRun2, "Process for MC", false); void processTrackV0CascMC(soa::Join::iterator const& collision, aod::McCollisions const&, soa::Filtered const& tracks, @@ -1287,7 +1288,7 @@ struct reso2initializer { initCCDB(bc); colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), CentEst(collision), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1300,19 +1301,18 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackV0CascMC, "Process for MC", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0CascMC, "Process for MC", false); void processTrackV0CascMCRun2(soa::Join::iterator const& collision, aod::McCollisions const&, soa::Filtered const& tracks, ResoV0sMC const& V0s, ResoCascadesMC const& Cascades, - aod::McParticles const& mcParticles, aod::BCsWithTimestamps const&) + aod::McParticles const& mcParticles, BCsWithRun2Info const&) { - auto bc = collision.bc_as(); /// adding timestamp to access magnetic field later - initCCDB(bc); + auto bc = collision.bc_as(); colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), ComputeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., d_bz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1325,12 +1325,12 @@ struct reso2initializer { auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); fillMCParticles(mcParts, mcParticles); } - PROCESS_SWITCH(reso2initializer, processTrackV0CascMCRun2, "Process for MC", false); + PROCESS_SWITCH(ResonanceInitializer, processTrackV0CascMCRun2, "Process for MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc, TaskName{"lf-reso2initializer"}), + adaptAnalysisTask(cfgc), }; } diff --git a/PWGLF/Utils/collisionCuts.h b/PWGLF/Utils/collisionCuts.h index 8d1e563d427..6322e272083 100644 --- a/PWGLF/Utils/collisionCuts.h +++ b/PWGLF/Utils/collisionCuts.h @@ -24,8 +24,6 @@ #include "Framework/Logger.h" #include "Common/DataModel/EventSelection.h" -using namespace o2::framework; - namespace o2::analysis { @@ -58,7 +56,7 @@ class CollisonCuts /// \param checkTrigger whether or not to check for the trigger alias /// \param trig Requested trigger alias /// \param checkOffline whether or not to check for offline selection criteria - void setCuts(float zvtxMax, bool checkTrigger, int trig, bool checkOffline, bool checkRun3, bool triggerTVXsel = false, int trackOccupancyInTimeRangeMax = -1) + void setCuts(float zvtxMax, bool checkTrigger, int trig, bool checkOffline, bool checkRun3, bool triggerTVXsel = false, int trackOccupancyInTimeRangeMax = -1, int trackOccupancyInTimeRangeMin = -1) { mCutsSet = true; mZvtxMax = zvtxMax; @@ -72,31 +70,33 @@ class CollisonCuts mApplyZvertexTimedifference = false; mApplyPileupRejection = false; mApplyNoITSROBorderCut = false; + mApplyCollInTimeRangeStandard = false; mtrackOccupancyInTimeRangeMax = trackOccupancyInTimeRangeMax; + mtrackOccupancyInTimeRangeMin = trackOccupancyInTimeRangeMin; } /// Initializes histograms for the task /// \param registry Histogram registry to be passed - void init(HistogramRegistry* registry) + void init(o2::framework::HistogramRegistry* registry) { if (!mCutsSet) { LOGF(error, "Event selection not set - quitting!"); } mHistogramRegistry = registry; - mHistogramRegistry->add("Event/posZ", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram after event selections - mHistogramRegistry->add("Event/posZ_noCut", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram before all selections + mHistogramRegistry->add("Event/posZ", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram after event selections + mHistogramRegistry->add("Event/posZ_noCut", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram before all selections if (mCheckIsRun3) { - mHistogramRegistry->add("Event/CentFV0A", "; vCentV0A; Entries", kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/CentFT0M", "; vCentT0M; Entries", kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/CentFT0C", "; vCentT0C; Entries", kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/CentFT0A", "; vCentT0A; Entries", kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/posZ_ITSOnly", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); - mHistogramRegistry->add("Event/posZ_ITSTPC", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); - mHistogramRegistry->add("Event/trackOccupancyInTimeRange_noCut", "; Occupancy; Entries", kTH1F, {{500, 0., 20000.}}); + mHistogramRegistry->add("Event/CentFV0A", "; vCentV0A; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentFT0M", "; vCentT0M; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentFT0C", "; vCentT0C; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentFT0A", "; vCentT0A; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/posZ_ITSOnly", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); + mHistogramRegistry->add("Event/posZ_ITSTPC", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); + mHistogramRegistry->add("Event/trackOccupancyInTimeRange_noCut", "; Occupancy; Entries", o2::framework::kTH1F, {{500, 0., 20000.}}); } else { - mHistogramRegistry->add("Event/CentRun2V0M", "; vCentV0M; Entries", kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentRun2V0M", "; vCentV0M; Entries", o2::framework::kTH1F, {{110, 0, 110}}); } - mHistogramRegistry->add("CollCutCounts", "; ; Entries", kTH1F, {{11, 0., 11.}}); + mHistogramRegistry->add("CollCutCounts", "; ; Entries", o2::framework::kTH1F, {{11, 0., 11.}}); mHistogramRegistry->get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(binLabel(EvtSel::kAllEvent), "all"); mHistogramRegistry->get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(binLabel(EvtSel::kFlagZvertex), "Zvtx"); mHistogramRegistry->get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(binLabel(EvtSel::kFlagTrigerTVX), "IsTriggerTVX"); @@ -113,8 +113,8 @@ class CollisonCuts /// Print some debug information void printCuts() { - LOGF(info, "Debug information for Collison Cuts \n Max. z-vertex: %f \n Check trigger: %d \n Trigger: %d \n Check offline: %d \n Check Run3: %d \n Trigger TVX selection: %d \n Apply time frame border cut: %d \n Apply ITS-TPC vertex: %d \n Apply Z-vertex time difference: %d \n Apply Pileup rejection: %d \n Apply NoITSRO frame border cut: %d \n Track occupancy in time range max: %d", - mZvtxMax, mCheckTrigger, mTrigger, mCheckOffline, mCheckIsRun3, mTriggerTVXselection, mApplyTFBorderCut, mApplyITSTPCvertex, mApplyZvertexTimedifference, mApplyPileupRejection, mApplyNoITSROBorderCut, mtrackOccupancyInTimeRangeMax); + LOGF(info, "Debug information for Collison Cuts \n Max. z-vertex: %f \n Check trigger: %d \n Trigger: %d \n Check offline: %d \n Check Run3: %d \n Trigger TVX selection: %d \n Apply time frame border cut: %d \n Apply ITS-TPC vertex: %d \n Apply Z-vertex time difference: %d \n Apply Pileup rejection: %d \n Apply NoITSRO frame border cut: %d \n Track occupancy in time range max: %d \n Track occupancy in time range min: %d \n Apply NoCollInTimeRangeStandard: %d", + mZvtxMax, mCheckTrigger, mTrigger, mCheckOffline, mCheckIsRun3, mTriggerTVXselection, mApplyTFBorderCut, mApplyITSTPCvertex, mApplyZvertexTimedifference, mApplyPileupRejection, mApplyNoITSROBorderCut, mtrackOccupancyInTimeRangeMax, mtrackOccupancyInTimeRangeMin, mApplyCollInTimeRangeStandard); } /// Set MB selection @@ -138,6 +138,16 @@ class CollisonCuts /// Set the NoITSRO frame border cut void setApplyNoITSROBorderCut(bool applyNoITSROBorderCut) { mApplyNoITSROBorderCut = applyNoITSROBorderCut; } + /// Set the track occupancy in time range cut + void setTrackOccupancyInTimeRange(int trackOccupancyInTimeRangeMax, int trackOccupancyInTimeRangeMin) + { + mtrackOccupancyInTimeRangeMax = trackOccupancyInTimeRangeMax; + mtrackOccupancyInTimeRangeMin = trackOccupancyInTimeRangeMin; + } + + /// Set the NoCollInTimeRangeStandard cut + void setApplyCollInTimeRangeStandard(bool applyCollInTimeRangeStandard) { mApplyCollInTimeRangeStandard = applyCollInTimeRangeStandard; } + /// Check whether the collisions fulfills the specified selections /// \tparam T type of the collision /// \param col Collision @@ -195,12 +205,25 @@ class CollisonCuts LOGF(debug, "trackOccupancyInTimeRange selection failed"); return false; } + if (mtrackOccupancyInTimeRangeMin > 0 && col.trackOccupancyInTimeRange() < mtrackOccupancyInTimeRangeMin) { + LOGF(debug, "trackOccupancyInTimeRange selection failed"); + return false; + } + if ((!col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) && mApplyCollInTimeRangeStandard) { + LOGF(debug, "NoCollInTimeRangeStandard selection failed"); + return false; + } mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagOccupancy); } else { // Run2 case if (mCheckOffline && !col.sel7()) { LOGF(debug, "Offline selection failed (sel7)"); return false; } + auto bc = col.template bc_as(); + if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) { + LOGF(debug, "Offline selection failed (AliEventCuts)"); + return false; + } mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagTrigerTVX); } if (mCheckTrigger && !col.alias_bit(mTrigger)) { @@ -253,21 +276,24 @@ class CollisonCuts } private: - HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output - bool mCutsSet = false; ///< Protection against running without cuts - bool mCheckTrigger = false; ///< Check for trigger - bool mTriggerTVXselection = false; ///< Check for trigger TVX selection - bool mCheckOffline = false; ///< Check for offline criteria (might change) - bool mCheckIsRun3 = false; ///< Check if running on Pilot Beam - bool mInitialTriggerScan = false; ///< Check trigger when the event is first selected - bool mApplyTFBorderCut = false; ///< Apply time frame border cut - bool mApplyITSTPCvertex = false; ///< Apply at least one ITS-TPC track for vertexing - bool mApplyZvertexTimedifference = false; ///< removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference. - bool mApplyPileupRejection = false; ///< Pileup rejection - bool mApplyNoITSROBorderCut = false; ///< Apply NoITSRO frame border cut - int mTrigger = kINT7; ///< Trigger to check for - float mZvtxMax = 999.f; ///< Maximal deviation from nominal z-vertex (cm) - int mtrackOccupancyInTimeRangeMax = -1; ///< Maximum trackOccupancyInTimeRange cut (-1 no cut) + using BCsWithRun2Info = soa::Join; + o2::framework::HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output + bool mCutsSet = false; ///< Protection against running without cuts + bool mCheckTrigger = false; ///< Check for trigger + bool mTriggerTVXselection = false; ///< Check for trigger TVX selection + bool mCheckOffline = false; ///< Check for offline criteria (might change) + bool mCheckIsRun3 = false; ///< Check if running on Pilot Beam + bool mInitialTriggerScan = false; ///< Check trigger when the event is first selected + bool mApplyTFBorderCut = false; ///< Apply time frame border cut + bool mApplyITSTPCvertex = false; ///< Apply at least one ITS-TPC track for vertexing + bool mApplyZvertexTimedifference = false; ///< removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference. + bool mApplyPileupRejection = false; ///< Pileup rejection + bool mApplyNoITSROBorderCut = false; ///< Apply NoITSRO frame border cut + bool mApplyCollInTimeRangeStandard = false; ///< Apply NoCollInTimeRangeStandard selection + int mTrigger = kINT7; ///< Trigger to check for + float mZvtxMax = 999.f; ///< Maximal deviation from nominal z-vertex (cm) + int mtrackOccupancyInTimeRangeMax = -1; ///< Maximum trackOccupancyInTimeRange cut (-1 no cut) + int mtrackOccupancyInTimeRangeMin = -1; ///< Minimum trackOccupancyInTimeRange cut (-1 no cut) }; } // namespace o2::analysis From 701c739c616c0cee9e7205cde2d10574f8264826 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Sat, 7 Dec 2024 20:58:33 +0100 Subject: [PATCH 276/459] [PWGCF] FemtoUniverse: Changing fillCollisionsCent to bool (#8847) --- .../femtoUniverseProducerTask.cxx | 207 ++++++++++-------- 1 file changed, 117 insertions(+), 90 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index a9853b29e1b..384cba579bc 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -17,13 +17,15 @@ /// \author Pritam Chakraborty, WUT Warsaw, pritam.chakraborty@cern.ch #include -#include // FIXME +#include #include #include #include +#include "CommonConstants/PhysicsConstants.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/trackUtilities.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" @@ -57,6 +59,7 @@ using namespace o2; using namespace o2::analysis::femtoUniverse; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::constants::physics; namespace o2::aod { @@ -297,25 +300,25 @@ struct femtoUniverseProducerTask { { if (mom < 0.3) { // 0.0-0.3 - if (TMath::Abs(nsigmaTPCK) < 3.0) { + if (std::abs(nsigmaTPCK) < 3.0) { return true; } else { return false; } } else if (mom < 0.45) { // 0.30 - 0.45 - if (TMath::Abs(nsigmaTPCK) < 2.0) { + if (std::abs(nsigmaTPCK) < 2.0) { return true; } else { return false; } } else if (mom < 0.55) { // 0.45-0.55 - if (TMath::Abs(nsigmaTPCK) < 1.0) { + if (std::abs(nsigmaTPCK) < 1.0) { return true; } else { return false; } } else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF) - if ((TMath::Abs(nsigmaTOFK) < 3.0) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < 3.0) && (std::abs(nsigmaTPCK) < 3.0)) { { return true; } @@ -323,7 +326,7 @@ struct femtoUniverseProducerTask { return false; } } else if (mom > 1.5) { // 1.5 - - if ((TMath::Abs(nsigmaTOFK) < 2.0) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < 2.0) && (std::abs(nsigmaTPCK) < 3.0)) { return true; } else { return false; @@ -337,31 +340,31 @@ struct femtoUniverseProducerTask { { if (mom < 0.3) { // 0.0-0.3 - if (TMath::Abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { + if (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { return true; } else { return false; } } else if (mom < 0.45) { // 0.30 - 0.45 - if (TMath::Abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { + if (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { return true; } else { return false; } } else if (mom < 0.55) { // 0.45-0.55 - if (TMath::Abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { + if (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { return true; } else { return false; } } else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF) - if ((TMath::Abs(nsigmaTOFK) < 3.0) && (TMath::Abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value)) { + if ((std::abs(nsigmaTOFK) < 3.0) && (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value)) { return true; } else { return false; } } else if (mom > 1.5) { // 1.5 - - if ((TMath::Abs(nsigmaTOFK) < 2.0) && (TMath::Abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value)) { + if ((std::abs(nsigmaTOFK) < 2.0) && (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value)) { return true; } else { return false; @@ -374,25 +377,25 @@ struct femtoUniverseProducerTask { bool IsKaonNSigmaTOFLoose(float mom, float nsigmaTPCK, float nsigmaTOFK) { if (mom < 0.3) { // 0.0-0.3 - if (TMath::Abs(nsigmaTPCK) < 3.0) { + if (std::abs(nsigmaTPCK) < 3.0) { return true; } else { return false; } } else if (mom < 0.45) { // 0.30 - 0.45 - if (TMath::Abs(nsigmaTPCK) < 2.0) { + if (std::abs(nsigmaTPCK) < 2.0) { return true; } else { return false; } } else if (mom < 0.55) { // 0.45-0.55 - if (TMath::Abs(nsigmaTPCK) < 1.0) { + if (std::abs(nsigmaTPCK) < 1.0) { return true; } else { return false; } } else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF) - if ((TMath::Abs(nsigmaTOFK) < ConfPhiSelection.ConfLooseTOFNSigmaValue.value) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < ConfPhiSelection.ConfLooseTOFNSigmaValue.value) && (std::abs(nsigmaTPCK) < 3.0)) { { return true; } @@ -400,7 +403,7 @@ struct femtoUniverseProducerTask { return false; } } else if (mom > 1.5) { // 1.5 - - if ((TMath::Abs(nsigmaTOFK) < ConfPhiSelection.ConfLooseTOFNSigmaValue.value) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < ConfPhiSelection.ConfLooseTOFNSigmaValue.value) && (std::abs(nsigmaTPCK) < 3.0)) { return true; } else { return false; @@ -413,16 +416,16 @@ struct femtoUniverseProducerTask { bool IsKaonRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi) { if (mom < 0.5) { - if (TMath::Abs(nsigmaTPCPi) < ConfPhiSelection.ConfNsigmaRejectPion.value) { + if (std::abs(nsigmaTPCPi) < ConfPhiSelection.ConfNsigmaRejectPion.value) { return true; - } else if (TMath::Abs(nsigmaTPCPr) < ConfPhiSelection.ConfNsigmaRejectProton.value) { + } else if (std::abs(nsigmaTPCPr) < ConfPhiSelection.ConfNsigmaRejectProton.value) { return true; } } if (mom > 0.5) { - if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfPhiSelection.ConfNsigmaRejectPion.value) { + if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfPhiSelection.ConfNsigmaRejectPion.value) { return true; - } else if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfPhiSelection.ConfNsigmaRejectProton.value) { + } else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfPhiSelection.ConfNsigmaRejectProton.value) { return true; } else { return false; @@ -449,10 +452,10 @@ struct femtoUniverseProducerTask { void init(InitContext&) { - if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data) == false && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == false) { + if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data || doprocessV0CentRun3Data || doprocessCascadeCentRun3Data) == false && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == false) { LOGF(fatal, "Neither processFullData nor processFullMC enabled. Please choose one."); } - if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data) == true && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == true) { + if ((doprocessFullData || doprocessTrackPhiData || doprocessTrackData || doprocessTrackV0 || doprocessTrackCascadeData || doprocessTrackD0mesonData || doprocessTrackCentRun2Data || doprocessTrackCentRun3Data || doprocessV0CentRun3Data || doprocessCascadeCentRun3Data) == true && (doprocessFullMC || doprocessTrackMC || doprocessTrackMCTruth || doprocessTrackMCGen || doprocessTruthAndFullMC || doprocessFullMCCent) == true) { LOGF(fatal, "Cannot enable process Data and process MC at the same time. " "Please choose one."); @@ -682,7 +685,7 @@ struct femtoUniverseProducerTask { int particleOrigin = 99; auto motherparticlesMC = particleMC.template mothers_as(); - if (abs(pdgCode) == abs(ConfPDGCodePartOne.value) || abs(pdgCode) == abs(ConfPDGCodePartTwo.value)) { + if (std::abs(pdgCode) == std::abs(ConfPDGCodePartOne.value) || std::abs(pdgCode) == std::abs(ConfPDGCodePartTwo.value)) { if (particleMC.isPhysicalPrimary()) { particleOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kPrimary; } else if (!motherparticlesMC.empty()) { @@ -717,7 +720,7 @@ struct femtoUniverseProducerTask { auto motherskaon1MC = kaon1MC.template mothers_as(); auto motherskaon2MC = kaon2MC.template mothers_as(); - if (abs(pdgCode1) == abs(321) || abs(pdgCode2) == abs(-321)) { + if (std::abs(pdgCode1) == std::abs(321) || std::abs(pdgCode2) == std::abs(-321)) { if ((kaon1MC.isPhysicalPrimary() && kaon2MC.isPhysicalPrimary()) && (!motherskaon1MC.empty() && !motherskaon2MC.empty())) { for (auto& particleMotherOfNeg : motherskaon1MC) { for (auto& particleMotherOfPos : motherskaon2MC) { @@ -738,8 +741,8 @@ struct femtoUniverseProducerTask { TLorentzVector part1Vec; TLorentzVector part2Vec; - float mMassOne = TDatabasePDG::Instance()->GetParticle(321)->Mass(); // FIXME: Get from the PDG service of the common header - float mMassTwo = TDatabasePDG::Instance()->GetParticle(-321)->Mass(); // FIXME: Get from the PDG service of the common header + const auto mMassOne = o2::constants::physics::MassKPlus; // FIXME: Get from the PDG service of the common header + const auto mMassTwo = o2::constants::physics::MassKMinus; // FIXME: Get from the PDG service of the common header part1Vec.SetPtEtaPhiM(kaon1MC.pt(), kaon1MC.eta(), kaon1MC.phi(), mMassOne); part2Vec.SetPtEtaPhiM(kaon2MC.pt(), kaon2MC.eta(), kaon2MC.phi(), mMassTwo); @@ -820,16 +823,12 @@ struct femtoUniverseProducerTask { } } - template - void fillCollisionsCentRun2(CollisionType const& col, TrackType const& tracks) + template + bool fillCollisionsCentRun2(CollisionType const& col) { const auto vtxZ = col.posZ(); - float cent = 0; - int multNtr = 0; - if (!ConfIsRun3) { - cent = col.centRun2V0M(); - multNtr = col.multNTracksPV(); - } + const auto cent = col.centRun2V0M(); + const auto multNtr = col.multNTracksPV(); // check whether the basic event selection criteria are fulfilled // if the basic selection is NOT fulfilled: @@ -837,54 +836,33 @@ struct femtoUniverseProducerTask { // in case of trigger run - store such collisions but don't store any // particle candidates for such collisions if (!colCuts.isSelected(col)) { - return; - } - - // colCuts.fillQA(col); //for now, TODO: create a configurable so in the FemroUniverseCollisionSelection.h there is an option to plot QA just for the posZ - if (ConfDoSpher) { - outputCollision(vtxZ, cent, multNtr, colCuts.computeSphericity(col, tracks), mMagField); + return false; } else { outputCollision(vtxZ, cent, multNtr, 2, mMagField); + return true; } } - template - void fillCollisionsCentRun3(CollisionType const& col, TrackType const& tracks, V0Type const& fullV0s, CascadeType const& fullCascades, double irrate) + template + bool fillCollisionsCentRun3(CollisionType const& col) { const auto vtxZ = col.posZ(); - float cent = 0; - int multNtr = 0; - if (ConfIsRun3) { - multNtr = col.multNTracksPV(); - cent = col.centFT0C(); - } + const auto multNtr = col.multNTracksPV(); + const auto cent = col.centFT0C(); - int occupancy = col.trackOccupancyInTimeRange(); // check whether the basic event selection criteria are fulfilled // if the basic selection is NOT fulfilled: // in case of skimming run - don't store such collisions // in case of trigger run - store such collisions but don't store any // particle candidates for such collisions if (!colCuts.isSelectedRun3(col)) { - return; - } - - // colCuts.fillQA(col); //for now, TODO: create a configurable so in the FemroUniverseCollisionSelection.h there is an option to plot QA just for the posZ - if ((col.selection_bit(aod::evsel::kNoSameBunchPileup)) && (col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) && (occupancy > ConfTPCOccupancyMin && occupancy <= ConfTPCOccupancyMax)) { - if (ConfDoSpher) { - outputCollision(vtxZ, cent, multNtr, colCuts.computeSphericity(col, tracks), mMagField); - } else { + return false; + } else { + if ((col.selection_bit(aod::evsel::kNoSameBunchPileup)) && (col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) { outputCollision(vtxZ, cent, multNtr, 2, mMagField); - } - - fillCollisionsCentRun3ColExtra(col, irrate); - - fillTracks(tracks); - if (ConfV0Selection.ConfIsFillV0s) { - fillV0(col, fullV0s, tracks); - } - if (ConfCascadeSelection.ConfIsFillCascades) { - fillCascade(col, fullCascades, tracks); + return true; + } else { + return false; } } } @@ -892,7 +870,7 @@ struct femtoUniverseProducerTask { template void fillCollisionsCentRun3ColExtra(CollisionType const& col, double irrate) { - int occupancy = col.trackOccupancyInTimeRange(); + const auto occupancy = col.trackOccupancyInTimeRange(); outputCollExtra(irrate, occupancy); } @@ -1347,8 +1325,8 @@ struct femtoUniverseProducerTask { TLorentzVector part1Vec; TLorentzVector part2Vec; - float mMassOne = TDatabasePDG::Instance()->GetParticle(321)->Mass(); // FIXME: Get from the PDG service of the common header - float mMassTwo = TDatabasePDG::Instance()->GetParticle(-321)->Mass(); // FIXME: Get from the PDG service of the common header + const auto mMassOne = o2::constants::physics::MassKPlus; // FIXME: Get from the PDG service of the common header + const auto mMassTwo = o2::constants::physics::MassKMinus; // FIXME: Get from the PDG service of the common header part1Vec.SetPtEtaPhiM(p1.pt(), p1.eta(), p1.phi(), mMassOne); part2Vec.SetPtEtaPhiM(p2.pt(), p2.eta(), p2.phi(), mMassTwo); @@ -1357,7 +1335,7 @@ struct femtoUniverseProducerTask { sumVec += part2Vec; float phiEta = sumVec.Eta(); - if (TMath::Abs(phiEta) > 0.8) { + if (std::abs(phiEta) > 0.8) { continue; } @@ -1366,12 +1344,13 @@ struct femtoUniverseProducerTask { continue; } - float phiPhi = sumVec.Phi(); + /*float phiPhi = sumVec.Phi(); if (sumVec.Phi() < 0) { - phiPhi = sumVec.Phi() + 2 * o2::constants::math::PI; + phiPhi = sumVec.Phi() + o2::constants::math::TwoPI; } else if (sumVec.Phi() >= 0) { phiPhi = sumVec.Phi(); - } + }*/ + float phiPhi = RecoDecay::constrainAngle(sumVec.Phi(), 0); float phiM = sumVec.M(); if (((phiM < ConfPhiSelection.ConfInvMassLowLimitPhi.value) || (phiM > ConfPhiSelection.ConfInvMassUpLimitPhi.value))) { @@ -1782,49 +1761,97 @@ struct femtoUniverseProducerTask { aod::BCsWithTimestamps const&, soa::Join const& tracks, aod::McCollisions const&, - aod::McParticles const&, - soa::Join const& fullV0s, - soa::Join const& fullCascades) + aod::McParticles const&) { // get magnetic field for run auto bc = col.bc_as(); getMagneticFieldTesla(bc); - double ir = 0.; - ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR + const double ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR // fill the tables - fillCollisionsCentRun3(col, tracks, fullV0s, fullCascades, ir); + const auto colcheck = fillCollisionsCentRun3(col); + if (colcheck) { + fillCollisionsCentRun3ColExtra(col, ir); + fillTracks(tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processFullMCCent, "Provide MC data with centrality bins", false); void processTrackCentRun2Data(aod::FemtoFullCollisionCentRun2 const& col, aod::BCsWithTimestamps const&, - aod::FemtoFullTracks const& tracks) + soa::Filtered const& tracks) { // get magnetic field for run - getMagneticFieldTesla(col.bc_as()); + auto bc = col.bc_as(); + getMagneticFieldTesla(bc); + const double ir = 0.0; // fetch IR + // fill the tables - fillCollisionsCentRun2(col, tracks); - fillTracks(tracks); + const auto colcheck = fillCollisionsCentRun2(col); + if (colcheck) { + fillCollisionsCentRun3ColExtra(col, ir); + fillTracks(tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackCentRun2Data, "Provide experimental data for Run 2 with centrality for track track", false); void processTrackCentRun3Data(aod::FemtoFullCollisionCentRun3 const& col, aod::BCsWithTimestamps const&, - soa::Filtered const& tracks, - aod::V0Datas const& fullV0s, - aod::CascDatas const& fullCascades) + soa::Filtered const& tracks) { // get magnetic field for run auto bc = col.bc_as(); getMagneticFieldTesla(bc); - double ir = 0.; - ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR + const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR // fill the tables - fillCollisionsCentRun3(col, tracks, fullV0s, fullCascades, ir); + const auto colcheck = fillCollisionsCentRun3(col); + if (colcheck) { + fillCollisionsCentRun3ColExtra(col, ir); + fillTracks(tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackCentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); + + void processV0CentRun3Data(aod::FemtoFullCollisionCentRun3 const& col, + aod::BCsWithTimestamps const&, + soa::Filtered const& tracks, + soa::Join const& fullV0s) + { + // get magnetic field for run + auto bc = col.bc_as(); + getMagneticFieldTesla(bc); + const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR + + // fill the tables + const auto colcheck = fillCollisionsCentRun3(col); + if (colcheck) { + fillCollisionsCentRun3ColExtra(col, ir); + fillTracks(tracks); + fillV0(col, fullV0s, tracks); + } + } + PROCESS_SWITCH(femtoUniverseProducerTask, processV0CentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); + + void processCascadeCentRun3Data(aod::FemtoFullCollisionCentRun3 const& col, + aod::BCsWithTimestamps const&, + soa::Filtered const& tracks, + aod::CascDatas const& fullCascades) + { + // get magnetic field for run + auto bc = col.bc_as(); + getMagneticFieldTesla(bc); + const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), mRunNumber, "ZNC hadronic") * 1.e-3; // fetch IR + + // fill the tables + const auto colcheck = fillCollisionsCentRun3(col); + if (colcheck) { + fillCollisionsCentRun3ColExtra(col, ir); + fillTracks(tracks); + fillCascade(col, fullCascades, tracks); + } + } + PROCESS_SWITCH(femtoUniverseProducerTask, processCascadeCentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From fa1a713168d246848c7c8e5bbfa08c79033551d4 Mon Sep 17 00:00:00 2001 From: Zhen Zhang <74494053+zz951@users.noreply.github.com> Date: Sat, 7 Dec 2024 21:32:17 +0100 Subject: [PATCH 277/459] [PWGHF] Fixing bugs for Lc-H correlation (#8799) Co-authored-by: Antonio Palasciano <52152842+apalasciano@users.noreply.github.com> --- .../HFC/TableProducer/correlatorLcHadrons.cxx | 56 ++++++++++--------- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 41 ++++++++++---- 2 files changed, 60 insertions(+), 37 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index c3ef512f6fa..d9ed5d26163 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -75,6 +75,7 @@ struct HfCorrelatorLcHadronsSelection { // filter on selection of Lc and decay channel Lc->PKPi Filter lcFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) != static_cast(0)) && (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); + /// Code to select collisions with at least one Lc - for real data and data-like analysis void processLcSelectionData(SelCollisions::iterator const& collision, CandidatesLcData const& candidates) { @@ -182,21 +183,11 @@ struct HfCorrelatorLcHadrons { Configurable> binsPtHadron{"binsPtHadron", std::vector{0.3, 2., 4., 8., 12., 50.}, "pT bin limits for assoc particle"}; Configurable> binsPtEfficiencyLc{"binsPtEfficiencyLc", std::vector{o2::analysis::hf_cuts_lc_to_p_k_pi::vecBinsPt}, "pT bin limits for efficiency"}; Configurable> efficiencyLc{"efficiencyLc", {1., 1., 1., 1., 1., 1.}, "efficiency values for Lc"}; - ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; - ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; - ConfigurableAxis binsMultiplicityMc{"binsMultiplicityMc", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks - ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; - ConfigurableAxis binsEta{"binsEta", {50, -2., 2.}, "#it{#eta}"}; - ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; - ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; - ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 6000.}, "Multiplicity as FT0M signal amplitude"}; - ConfigurableAxis binsMassLc{"binsMassLc", {200, 1.98, 2.58}, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its Lc mother instead of skipping it"}; Configurable correlateLcWithLeadingParticle{"correlateLcWithLeadingParticle", false, "Switch for correlation of Lc baryons with leading particle only"}; HfHelper hfHelper; SliceCache cache; - BinningType corrBinning{{binsZVtx, binsMultiplicity}, true}; int leadingIndex = 0; bool correlationStatus = false; @@ -218,6 +209,19 @@ struct HfCorrelatorLcHadrons { Filter lcFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) != static_cast(0)) && (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (nabs(aod::track::pt) > ptTrackMin) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); + // configurable axis definition + ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; + ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; + ConfigurableAxis binsMultiplicityMc{"binsMultiplicityMc", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks + ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; + ConfigurableAxis binsEta{"binsEta", {50, -2., 2.}, "#it{#eta}"}; + ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; + ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; + ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 6000.}, "Multiplicity as FT0M signal amplitude"}; + ConfigurableAxis binsMassLc{"binsMassLc", {200, 1.98, 2.58}, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; + + BinningType corrBinning{{binsZVtx, binsMultiplicity}, true}; + HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) { @@ -242,7 +246,7 @@ struct HfCorrelatorLcHadrons { registry.add("hEta", "Lc,Hadron candidates;candidate #it{#eta};entries", {HistType::kTH1F, {axisEta}}); registry.add("hPhi", "Lc,Hadron candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {axisPhi}}); registry.add("hY", "Lc,Hadron candidates;candidate #it{#y};entries", {HistType::kTH1F, {axisRapidity}}); - registry.add("hcountLcHadronPerEvent", "Lc,Hadron particles - MC gen;Number per event;entries", {HistType::kTH1F, {{21, -0.5, 20.5}}}); + registry.add("hCountLcHadronPerEvent", "Lc,Hadron particles - MC gen;Number per event;entries", {HistType::kTH1F, {{21, -0.5, 20.5}}}); registry.add("hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}); registry.add("hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}); registry.add("hMultFT0M", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}); @@ -293,6 +297,7 @@ struct HfCorrelatorLcHadrons { corrBinning = {{binsZVtx, binsMultiplicity}, true}; } + /// Lc-hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) void processData(SelCollisionsWithLc::iterator const& collision, TracksData const& tracks, CandidatesLcData const& candidates) @@ -409,7 +414,7 @@ struct HfCorrelatorLcHadrons { cntLc++; } // end outer Lc loop registry.fill(HIST("hZvtx"), collision.posZ()); - registry.fill(HIST("hMultT0M"), collision.multFT0M()); + registry.fill(HIST("hMultFT0M"), collision.multFT0M()); } PROCESS_SWITCH(HfCorrelatorLcHadrons, processData, "Process data", true); @@ -486,7 +491,7 @@ struct HfCorrelatorLcHadrons { registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeightLc); registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); - registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPKPi()); + registry.fill(HIST("hSelectionStatusLcToPKPiMcRec"), candidate.isSelLcToPKPi()); entryLcCandRecoInfo(hfHelper.invMassLcToPKPi(candidate), candidate.pt(), outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore entryLcCandGenInfo(isLcPrompt); } @@ -504,7 +509,7 @@ struct HfCorrelatorLcHadrons { registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeightLc); registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); - registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPiKP()); + registry.fill(HIST("hSelectionStatusLcToPiKPMcRec"), candidate.isSelLcToPiKP()); entryLcCandRecoInfo(hfHelper.invMassLcToPiKP(candidate), candidate.pt(), outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore entryLcCandGenInfo(isLcPrompt); } @@ -521,7 +526,7 @@ struct HfCorrelatorLcHadrons { registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeightLc); registry.fill(HIST("hMassLcMcRecBkg"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); - registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPKPi()); + registry.fill(HIST("hSelectionStatusLcToPKPiMcRec"), candidate.isSelLcToPKPi()); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { @@ -530,7 +535,7 @@ struct HfCorrelatorLcHadrons { registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeightLc); registry.fill(HIST("hMassLcMcRecBkg"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); - registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPiKP()); + registry.fill(HIST("hSelectionStatusLcToPiKPMcRec"), candidate.isSelLcToPiKP()); } } registry.fill(HIST("hLcBin"), poolBin); @@ -612,11 +617,11 @@ struct HfCorrelatorLcHadrons { } // end inner loop (Tracks) } // end outer Lc loop registry.fill(HIST("hZvtx"), collision.posZ()); - registry.fill(HIST("hMultT0M"), collision.multFT0M()); + registry.fill(HIST("hMultFT0M"), collision.multFT0M()); } PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcRec, "Process Mc Reco mode", false); - /// Lc-Hadron correlation pair builder - for Mc gen-level analysis + /// Lc-Hadron correlation pair builder - for Mc Gen-level analysis void processMcGen(SelCollisionsWithLcMc::iterator const& mcCollision, CandidatesLcMcGen const& mcParticles) { @@ -635,7 +640,7 @@ struct HfCorrelatorLcHadrons { leadingIndex = findLeadingParticleMcGen(mcParticles, etaTrackMax.value, ptTrackMin.value); } - // Mc gen level + // Mc Gen level for (const auto& particle : mcParticles) { if (std::abs(particle.pdgCode()) != Pdg::kLambdaCPlus) { continue; @@ -684,14 +689,14 @@ struct HfCorrelatorLcHadrons { continue; } if (particleAssoc.globalIndex() == prongsId[0] || particleAssoc.globalIndex() == prongsId[1] || particleAssoc.globalIndex() == prongsId[2]) { - continue; - } - if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { if (!storeAutoCorrelationFlag) { continue; } correlationStatus = true; } + if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { + continue; + } if (!particleAssoc.isPhysicalPrimary()) { continue; } @@ -723,9 +728,6 @@ struct HfCorrelatorLcHadrons { CandidatesLcData const& candidates, TracksData const& tracks) { - if (candidates.size() == 0) { - return; - } auto tracksTuple = std::make_tuple(candidates, tracks); Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; @@ -819,8 +821,8 @@ struct HfCorrelatorLcHadrons { int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); int poolBinLc = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())); registry.fill(HIST("hMultFT0M"), c1.multFT0M()); - registry.fill(HIST("hZVtx"), c1.posZ()); - registry.fill(HIST("TracksPoolBin"), poolBin); + registry.fill(HIST("hZvtx"), c1.posZ()); + registry.fill(HIST("hTracksPoolBin"), poolBin); registry.fill(HIST("hLcPoolBin"), poolBinLc); for (const auto& [candidate, pAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (std::abs(hfHelper.yLc(candidate)) > yCandMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) { diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index 6a6c241a518..734fa86b484 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -79,8 +79,8 @@ struct HfTaskCorrelationLcHadrons { Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; Configurable selNoSameBunchPileUpColl{"selNoSameBunchPileUpColl", true, "Flag for rejecting the collisions associated with the same bunch crossing"}; Configurable> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; - Configurable> mlOutputPrompt{"mlScorePrompt", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"}; - Configurable> mlOutputBkg{"mlScoreBkg", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"}; + Configurable> mlOutputPrompt{"mlOutputPrompt", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"}; + Configurable> mlOutputBkg{"mlOutputBkg", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"}; // Pt ranges for correlation plots: the default values are those embedded in hf_cuts_lc_to_p_k_pi (i.e. the mass Pt bins), but can be redefined via json files Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{vecBinsPtCorrelations}, "Pt bin limits for correlation plots"}; Configurable> binsPtHadron{"binsPtHadron", std::vector{0.3, 2., 4., 8., 12., 50.}, "Pt bin limits for assoc particle efficiency"}; @@ -117,20 +117,13 @@ struct HfTaskCorrelationLcHadrons { Configurable fdEffCcdbPath{"fdEffCcdbPath", "", "CCDB path for trigger efficiency"}; Configurable timestampCcdb{"timestampCcdb", -1, "timestamp of the efficiency files used to query in CCDB"}; Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; - // configurable axis definition - ConfigurableAxis binsMassLc{"binsMassLc", {200, 1.98, 2.58}, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; - ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; - ConfigurableAxis binsEta{"binsEta", {100, -2., 2.}, "#it{#eta}"}; - ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; - ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 8000.}, "Multiplicity as FT0M signal amplitude"}; - ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; - Service ccdb; std::shared_ptr mEfficiencyPrompt = nullptr; std::shared_ptr mEfficiencyFD = nullptr; std::shared_ptr mEfficiencyAssociated = nullptr; HfHelper hfHelper; + Service ccdb; enum CandidateStep { kCandidateStepMcGenAll = 0, kCandidateStepMcGenLcToPKPi, @@ -149,6 +142,14 @@ struct HfTaskCorrelationLcHadrons { Filter lcFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) != static_cast(0)) && (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); + // configurable axis definition + ConfigurableAxis binsMassLc{"binsMassLc", {200, 1.98, 2.58}, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; + ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; + ConfigurableAxis binsEta{"binsEta", {100, -2., 2.}, "#it{#eta}"}; + ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; + ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 8000.}, "Multiplicity as FT0M signal amplitude"}; + ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; + HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) @@ -164,11 +165,13 @@ struct HfTaskCorrelationLcHadrons { AxisSpec axisPoolBin = {binsPoolBin, "poolBin"}; AxisSpec axisLcPrompt = {2, -0.5, 1.5, "Prompt #Lambda_c"}; AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; + AxisSpec axisCorrelationState = {2, 0., 2., ""}; // Histograms for data analysis registry.add("hBdtScorePrompt", "Lc BDT prompt score", {HistType::kTH1F, {axisBdtScore}}); registry.add("hBdtScoreBkg", "Lc BDT bkg score", {HistType::kTH1F, {axisBdtScore}}); registry.add("hMassLcVsPt", "Lc candidates massVsPt", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); + registry.add("hMassLcVsPtWoEff", "Lc candidates massVsPt without efficiency", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}}); if (fillHistoData) { registry.add("hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}); registry.add("hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}); @@ -185,6 +188,11 @@ struct HfTaskCorrelationLcHadrons { registry.add("hCorrel2DVsPtSidebandLeft", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); registry.add("hCorrel2DVsPtSidebandRight", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + // Toward Transverse Away + registry.add("hToward", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.add("hTransverse", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.add("hAway", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.get(HIST("hCorrel2DVsPtSignalRegion"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtSidebands"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtSidebandLeft"))->Sumw2(); @@ -214,6 +222,11 @@ struct HfTaskCorrelationLcHadrons { registry.add("hCorrel2DVsPtSignalRegionPromptLcPromptHadronMcRec", stringLcHadron + "signal region PromptLc - Prompt Track MC reco", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); registry.add("hCorrel2DVsPtSignalRegionNonPromptLcNonPromptHadronMcRec", stringLcHadron + " signal region PromptLc - NonPrompt Track MC reco", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + // Toward Transverse Away for McRec + registry.add("hTowardRec", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.add("hTransverseRec", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.add("hAwayRec", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.get(HIST("hCorrel2DVsPtSignalRegionMcRec"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtSidebandsMcRec"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtSignalMcRec"))->Sumw2(); @@ -234,6 +247,11 @@ struct HfTaskCorrelationLcHadrons { registry.add("hCorrel2DVsPtMcGenNonPromptLcNonPromptHadron", stringLcHadron + " non prompt Lc non prompt h MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); registry.add("hCorrel2DVsPtMcGenNonPrompt", stringLcHadron + " NonPrompt MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + // Toward Transverse Away for McGen + registry.add("hTowardGen", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.add("hTransverseGen", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.add("hAwayGen", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); + registry.get(HIST("hCorrel2DVsPtMcGen"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtMcGenPrompt"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtMcGenNonPrompt"))->Sumw2(); @@ -320,6 +338,7 @@ struct HfTaskCorrelationLcHadrons { } } registry.fill(HIST("hMassLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hMassLcVsPtWoEff"), massLc, ptLc); registry.fill(HIST("hBdtScorePrompt"), bdtScorePrompt); registry.fill(HIST("hBdtScoreBkg"), bdtScoreBkg); } @@ -440,6 +459,7 @@ struct HfTaskCorrelationLcHadrons { efficiencyWeightLc = 1. / mEfficiencyPrompt->GetBinContent(mEfficiencyPrompt->FindBin(ptLc)); } registry.fill(HIST("hMassLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hMassLcVsPtWoEff"), massLc, ptLc); registry.fill(HIST("hMassPromptLcVsPt"), massLc, ptLc, efficiencyWeightLc); registry.fill(HIST("hBdtScorePrompt"), bdtScorePrompt); registry.fill(HIST("hBdtScoreBkg"), bdtScoreBkg); @@ -449,6 +469,7 @@ struct HfTaskCorrelationLcHadrons { efficiencyWeightLc = 1. / mEfficiencyFD->GetBinContent(mEfficiencyFD->FindBin(ptLc)); } registry.fill(HIST("hMassLcVsPt"), massLc, ptLc, efficiencyWeightLc); + registry.fill(HIST("hMassLcVsPtWoEff"), massLc, ptLc); registry.fill(HIST("hMassNonPromptLcVsPt"), massLc, ptLc, efficiencyWeightLc); registry.fill(HIST("hBdtScorePrompt"), bdtScorePrompt); registry.fill(HIST("hBdtScoreBkg"), bdtScoreBkg); From 46569dd3ee9ffad498927d6d630189c4e19b09ed Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Sun, 8 Dec 2024 09:55:04 +0100 Subject: [PATCH 278/459] [PWGCF] FemtoUniverse: Changing fillCollisions() to bool (#8856) --- .../femtoUniverseProducerTask.cxx | 123 +++++++++++------- 1 file changed, 73 insertions(+), 50 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 384cba579bc..0599cd04f02 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -123,6 +123,7 @@ struct femtoUniverseProducerTask { Configurable ConfIsForceGRP{"ConfIsForceGRP", false, "Set true if the magnetic field configuration is not available in the usual CCDB directory (e.g. for Run 2 converted data or unanchorad Monte Carlo)"}; Configurable ConfDoSpher{"ConfDoSpher", false, "Calculate sphericity. If false sphericity will take value of 2."}; + Configurable ConfFillCollExt{"ConfFillCollExt", false, "Option to fill collision extended table"}; /// Event cuts FemtoUniverseCollisionSelection colCuts; @@ -722,8 +723,8 @@ struct femtoUniverseProducerTask { if (std::abs(pdgCode1) == std::abs(321) || std::abs(pdgCode2) == std::abs(-321)) { if ((kaon1MC.isPhysicalPrimary() && kaon2MC.isPhysicalPrimary()) && (!motherskaon1MC.empty() && !motherskaon2MC.empty())) { - for (auto& particleMotherOfNeg : motherskaon1MC) { - for (auto& particleMotherOfPos : motherskaon2MC) { + for (const auto& particleMotherOfNeg : motherskaon1MC) { + for (const auto& particleMotherOfPos : motherskaon2MC) { if (particleMotherOfNeg == particleMotherOfPos && particleMotherOfNeg.pdgCode() == 333) { phiOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kPrimary; } else { @@ -762,7 +763,7 @@ struct femtoUniverseProducerTask { } template - void fillCollisions(CollisionType const& col, TrackType const& tracks) + bool fillCollisions(CollisionType const& col, TrackType const& tracks) { const auto vtxZ = col.posZ(); float mult = 0; @@ -785,28 +786,30 @@ struct femtoUniverseProducerTask { // in case of trigger run - store such collisions but don't store any // particle candidates for such collisions if (!colCuts.isSelected(col)) { - return; - } - if (!ConfIsUsePileUp) { - if (ConfDoSpher) { - outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); - } else { - outputCollision(vtxZ, mult, multNtr, 2, mMagField); - } + return false; } else { - if (ConfDoSpher && (!ConfEvNoSameBunchPileup || col.selection_bit(aod::evsel::kNoSameBunchPileup)) && (!ConfEvIsGoodZvtxFT0vsPV || col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) && (!ConfEvIsVertexITSTPC || col.selection_bit(aod::evsel::kIsVertexITSTPC))) { - outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); + if (!ConfIsUsePileUp) { + if (ConfDoSpher) { + outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); + } else { + outputCollision(vtxZ, mult, multNtr, 2, mMagField); + } } else { - outputCollision(vtxZ, mult, multNtr, 2, mMagField); + if (ConfDoSpher && (!ConfEvNoSameBunchPileup || col.selection_bit(aod::evsel::kNoSameBunchPileup)) && (!ConfEvIsGoodZvtxFT0vsPV || col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) && (!ConfEvIsVertexITSTPC || col.selection_bit(aod::evsel::kIsVertexITSTPC))) { + outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); + } else { + outputCollision(vtxZ, mult, multNtr, 2, mMagField); + } } + colCuts.fillQA(col); + return true; } - colCuts.fillQA(col); } template void fillMCTruthCollisions(CollisionType const& col, TrackType const& tracks) { - for (auto& c : col) { + for (const auto& c : col) { const auto vtxZ = c.posZ(); float mult = 0; int multNtr = 0; @@ -880,7 +883,7 @@ struct femtoUniverseProducerTask { std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children std::vector tmpIDtrack; // this vector keeps track of the matching of the primary track table row <-> aod::track table global index - for (auto& track : tracks) { + for (const auto& track : tracks) { /// if the most open selection criteria are not fulfilled there is no /// point looking further at the track if (!trackCuts.isSelectedMinimal(track)) { @@ -932,7 +935,7 @@ struct femtoUniverseProducerTask { { std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children std::vector tmpIDtrack; // this vector keeps track of the matching of the primary track table row <-> aod::track table global index - for (auto& v0 : fullV0s) { + for (const auto& v0 : fullV0s) { auto postrack = v0.template posTrack_as(); auto negtrack = v0.template negTrack_as(); ///\tocheck funnily enough if we apply the filter the @@ -1169,7 +1172,7 @@ struct femtoUniverseProducerTask { bool isD0D0bar = false; uint8_t daughFlag = 0; // flag = 0 (daugh of D0 or D0bar), 1 (daug of D0), -1 (daugh of D0bar) - for (auto const& hfCand : hfCands) { + for (const auto& hfCand : hfCands) { if (!(hfCand.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { continue; @@ -1283,7 +1286,7 @@ struct femtoUniverseProducerTask { std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children std::vector tmpIDtrack; // this vector keeps track of the matching of the primary track table row <-> aod::track table global index // lorentz vectors and filling the tables - for (auto& [p1, p2] : combinations(soa::CombinationsFullIndexPolicy(tracks, tracks))) { + for (const auto& [p1, p2] : combinations(soa::CombinationsFullIndexPolicy(tracks, tracks))) { if (!trackCuts.isSelectedMinimal(p1) || !trackCuts.isSelectedMinimal(p1)) { continue; } @@ -1429,7 +1432,7 @@ struct femtoUniverseProducerTask { std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children std::vector tmpIDtrack; - for (auto& particle : tracks) { + for (const auto& particle : tracks) { /// if the most open selection criteria are not fulfilled there is no /// point looking further at the track @@ -1536,13 +1539,15 @@ struct femtoUniverseProducerTask { typename CollisionType> void fillCollisionsAndTracksAndV0AndPhi(CollisionType const& col, TrackType const& tracks, V0Type const& fullV0s) { - fillCollisions(col, tracks); - fillTracks(tracks); - if (ConfIsActivateV0) { - fillV0(col, fullV0s, tracks); - } - if (ConfIsActivatePhi) { - fillPhi(col, tracks); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + if (ConfIsActivateV0) { + fillV0(col, fullV0s, tracks); + } + if (ConfIsActivatePhi) { + fillPhi(col, tracks); + } } // if (ConfIsActivateCascade) { // fillCascade(col, fullCascades, tracks); @@ -1581,9 +1586,11 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); - fillCascade(col, fullCascades, tracks); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + fillCascade(col, fullCascades, tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackCascadeData, "Provide experimental data for track cascades", false); @@ -1624,8 +1631,10 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackMC, "Provide MC data for track analysis", false); @@ -1638,9 +1647,11 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); - fillPhi(col, tracks); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + fillPhi(col, tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackPhiMC, "Provide MC data for track Phi analysis", false); @@ -1653,9 +1664,11 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); - // fillD0mesons(col, tracks, candidates); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + // fillD0mesons(col, tracks, candidates); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackD0MC, "Provide MC data for track D0 analysis", false); @@ -1665,9 +1678,15 @@ struct femtoUniverseProducerTask { { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); + const double ir = 0.0; // fetch IR // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + if (ConfFillCollExt) { + fillCollisionsCentRun3ColExtra(col, ir); + } + fillTracks(tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackData, "Provide experimental data for track track", true); @@ -1680,9 +1699,11 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); - fillPhi(col, tracks); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + fillPhi(col, tracks); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackPhiData, "Provide experimental data for track phi", false); @@ -1695,9 +1716,11 @@ struct femtoUniverseProducerTask { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); // fill the tables - fillCollisions(col, tracks); - fillTracks(tracks); - fillD0mesons(col, tracks, candidates); + const auto colcheck = fillCollisions(col, tracks); + if (colcheck) { + fillTracks(tracks); + fillD0mesons(col, tracks, candidates); + } } PROCESS_SWITCH(femtoUniverseProducerTask, processTrackD0mesonData, "Provide experimental data for track D0 meson", false); @@ -1736,19 +1759,19 @@ struct femtoUniverseProducerTask { { // recos std::set recoMcIds; - for (auto& col : collisions) { + for (const auto& col : collisions) { auto groupedTracks = tracks.sliceBy(perCollisionTracks, col.globalIndex()); auto groupedV0s = fullV0s.sliceBy(perCollisionV0s, col.globalIndex()); getMagneticFieldTesla(col.bc_as()); fillCollisionsAndTracksAndV0AndPhi(col, groupedTracks, groupedV0s); - for (auto& track : groupedTracks) { + for (const auto& track : groupedTracks) { if (trackCuts.isSelectedMinimal(track)) recoMcIds.insert(track.mcParticleId()); } } // truth - for (auto& mccol : mccols) { + for (const auto& mccol : mccols) { auto groupedMCParticles = mcParticles.sliceBy(perMCCollision, mccol.globalIndex()); auto groupedCollisions = collisions.sliceBy(recoCollsPerMCColl, mccol.globalIndex()); fillMCTruthCollisions(groupedCollisions, groupedMCParticles); // fills the reco collisions for mc collision From 4db72b9b072c91ac43a0b534b32c80a48d8a23d4 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Sun, 8 Dec 2024 17:05:09 +0100 Subject: [PATCH 279/459] [PWGEM/Dilepton] update prefilter (#8861) --- PWGEM/Dilepton/Core/Dilepton.h | 62 ++------------------ PWGEM/Dilepton/Core/DileptonMC.h | 12 ++-- PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 28 +++++---- PWGEM/Dilepton/Utils/PairUtilities.h | 7 ++- 4 files changed, 29 insertions(+), 80 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index d3de41a05f7..8e31f9c63a7 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -181,7 +181,7 @@ struct Dilepton { Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply phiv cut inherited from prefilter"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrack : 4] Please consider logical-OR among them."}; // see PairUtilities.h + Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; @@ -534,8 +534,7 @@ struct Dilepton { fRegistry.add("Pair/same/uls/hsDeltaP", "difference of p between 2 tracks;|p_{T,1} - p_{T,2}|/|p_{T,1} + p_{T,2}|;#Delta#eta;#Delta#varphi (rad.);", kTHnSparseD, {{20, 0, 1}, {100, -1, +1}, {180, -M_PI, M_PI}}, true); fRegistry.add("Pair/same/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {80, -20, 20}}, true); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron - fRegistry.add("Pair/same/uls/hMvsPhiV_prop", Form("m_{ee} vs. #varphi_{V} at r = %2.1f cm;#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", dielectroncuts.cfg_x_to_go.value), kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron + fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron fRegistry.add("Pair/same/uls/hMvsOpAng", "m_{ee} vs. angle between 2 tracks;#omega (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{100, 0, 2.0}, {20, 0.0f, 3.2}}, true); fRegistry.add("Pair/same/uls/hDCA1vsDCA2", "DCA of leg1 vs. DCA of leg2;DCA1(#sigma);DCA2 (#sigma)", kTH2D, {{100, 0, 10.0}, {100, 0, 10}}, true); } @@ -778,9 +777,6 @@ struct Dilepton { std::map, float> map_z_prop; // map -> geometrical z position at propagated point std::map, float> map_phi_prop; // map -> geometrical phi position at propagated point - std::map, float> map_px_prop; // map -> px at propagated point - std::map, float> map_py_prop; // map -> py at propagated point - std::map, float> map_pz_prop; // map -> pz at propagated point template void propagateElectron(TTracks const& tracks) @@ -796,17 +792,8 @@ struct Dilepton { o2::math_utils::bringTo02Pi(phi); map_z_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = xyz.Z(); map_phi_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = phi; - - std::array pxpypz_prop = {0, 0, 0}; // px, py, pz - getPxPyPz(track_par_cov, pxpypz_prop); - map_px_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[0]; - map_py_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[1]; - map_pz_prop[std::make_tuple(ndf, track.emeventId(), track.globalIndex())] = pxpypz_prop[2]; - - // float r = sqrt(pow(xyz.X(),2) + pow(xyz.Y(), 2)); - // float theta = 2.f * std::atan(std::exp(-eta)); - // float z = r/std::tan(theta); - // LOGF(info, "r = %f, z = %f , xyz.Z() = %f", r, z, xyz.Z()); + // std::array pxpypz_prop = {0, 0, 0}; // px, py, pz + // getPxPyPz(track_par_cov, pxpypz_prop); } } @@ -856,52 +843,20 @@ struct Dilepton { } float dphi_geom = 999.f, dz_geom = 999.f, rdphi_geom = 999.f; - float phiv_prop = 999.f, mee_prop = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } - - // if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { - // return false; - // } - if constexpr (ev_id == 0) { dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; o2::math_utils::bringToPMPi(dphi_geom); rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; - - float px1 = map_px_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; - float py1 = map_py_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; - float pz1 = map_pz_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; - float px2 = map_px_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())]; - float py2 = map_py_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())]; - float pz2 = map_pz_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())]; - - ROOT::Math::PxPyPzMVector v1prop(px1, py1, pz1, leptonM1); - ROOT::Math::PxPyPzMVector v2prop(px2, py2, pz2, leptonM2); - ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; - mee_prop = v12prop.M(); - phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(px1, py1, pz1, px2, py2, pz2, t1.sign(), t2.sign(), d_bz); } else { // mixed event dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())] - map_z_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] : map_z_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] - map_z_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; o2::math_utils::bringToPMPi(dphi_geom); rdphi_geom = dielectroncuts.cfg_x_to_go * dphi_geom; - - float px1 = map_px_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; - float py1 = map_py_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; - float pz1 = map_pz_prop[std::make_tuple(t1.dfId(), t1.collisionId(), t1.globalIndex())]; - float px2 = map_px_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())]; - float py2 = map_py_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())]; - float pz2 = map_pz_prop[std::make_tuple(t2.dfId(), t2.collisionId(), t2.globalIndex())]; - - ROOT::Math::PxPyPzMVector v1prop(px1, py1, pz1, leptonM1); - ROOT::Math::PxPyPzMVector v2prop(px2, py2, pz2, leptonM2); - ROOT::Math::PxPyPzMVector v12prop = v1prop + v2prop; - mee_prop = v12prop.M(); - phiv_prop = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(px1, py1, pz1, px2, py2, pz2, t1.sign(), t2.sign(), d_bz); } if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { return false; @@ -969,7 +924,6 @@ struct Dilepton { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hMvsPhiV"), phiv, v12.M(), weight); - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hMvsPhiV_prop"), phiv_prop, mee_prop, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hMvsOpAng"), opAng, v12.M(), weight); } } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ @@ -978,7 +932,6 @@ struct Dilepton { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hMvsPhiV"), phiv, v12.M(), weight); - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hMvsPhiV_prop"), phiv_prop, mee_prop, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hMvsOpAng"), opAng, v12.M(), weight); } } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- @@ -987,7 +940,6 @@ struct Dilepton { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hMvsPhiV"), phiv, v12.M(), weight); - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hMvsPhiV_prop"), phiv_prop, mee_prop, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hMvsOpAng"), opAng, v12.M(), weight); } } @@ -1186,7 +1138,8 @@ struct Dilepton { Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) <= static_cast(0), true) && ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) <= static_cast(0), true), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) <= static_cast(0), true), o2::aod::emprimaryelectron::pfbpi0 >= static_cast(0)); Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); @@ -1438,9 +1391,6 @@ struct Dilepton { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } - // if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { - // return false; - // } float dz_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_z_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_z_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; float dphi_geom = t1.sign() * t1.pt() > t2.sign() * t2.pt() ? map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] : map_phi_prop[std::make_tuple(ndf, t2.emeventId(), t2.globalIndex())] - map_phi_prop[std::make_tuple(ndf, t1.emeventId(), t1.globalIndex())]; o2::math_utils::bringToPMPi(dphi_geom); diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 1bab04568a3..c686c102a25 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -159,7 +159,7 @@ struct DileptonMC { Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply phiv cut inherited from prefilter"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrack : 4] Please consider logical-OR among them."}; // see PairUtilities.h + Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; @@ -724,9 +724,6 @@ struct DileptonMC { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } - // if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { - // return false; - // } if (dielectroncuts.cfg_x_to_go > 0.f) { auto track_par_cov1 = getTrackParCov(t1); @@ -1064,7 +1061,9 @@ struct DileptonMC { Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack))) <= static_cast(0), true), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) <= static_cast(0), true), o2::aod::emprimaryelectron::pfbpi0 >= static_cast(0)); Preslice perCollision_muon = aod::emprimarymuon::emeventId; @@ -1648,9 +1647,6 @@ struct DileptonMC { if (!cut.template IsSelectedPair(t1, t2, d_bz)) { return false; } - // if (!cut.template IsSelectedPair_PrefilterULS(t1, t2, d_bz) || !cut.template IsSelectedPair_PrefilterLS(t1, t2, d_bz)) { - // return false; - // } if (dielectroncuts.cfg_x_to_go > 0.f) { auto track_par_cov1 = getTrackParCov(t1); track_par_cov1.setPID(o2::track::PID::Electron); diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index a787d9acd6c..a5e7db3d50d 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -76,7 +76,7 @@ struct prefilterDielectron { Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; - Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", true, "require no ITS readout frame border in event cut"}; + Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; @@ -92,8 +92,10 @@ struct prefilterDielectron { Configurable cfg_max_mass{"cfg_max_mass", 0.0, "max mass for prefilter ULS"}; // region to be rejected Configurable cfg_apply_dzrdphi_geom_uls{"cfg_apply_dzrdphi_geom_uls", false, "flag to apply generator dz-rdphi elliptic cut in ULS"}; // region to be rejected Configurable cfg_apply_dzrdphi_geom_ls{"cfg_apply_dzrdphi_geom_ls", false, "flag to apply generator dz-rdphi elliptic cut in LS"}; // region to be rejected - Configurable cfg_min_dz_geom{"cfg_min_dz_geom", 5, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected - Configurable cfg_min_rdphi_geom{"cfg_min_rdphi_geom", 20, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_dz_geom_ls{"cfg_min_dz_geom_ls", 3, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_rdphi_geom_ls{"cfg_min_rdphi_geom_ls", 10, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_dz_geom_uls{"cfg_min_dz_geom_uls", 3, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_rdphi_geom_uls{"cfg_min_rdphi_geom_uls", 10, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected Configurable cfg_apply_phiv{"cfg_apply_phiv", false, "flag to apply phiv cut"}; // region to be rejected Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; // region to be rejected @@ -380,7 +382,7 @@ struct prefilterDielectron { continue; } - if (dielectroncuts.cfg_x_to_go > 0.f && (dielectroncuts.cfg_apply_dzrdphi_geom_uls || dielectroncuts.cfg_apply_dzrdphi_geom_ls)) { + if (dielectroncuts.cfg_x_to_go > 0.f) { propagateElectron(posTracks_per_coll); propagateElectron(negTracks_per_coll); } @@ -421,9 +423,9 @@ struct prefilterDielectron { map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV); } - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_uls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { - map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); - map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_uls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom_uls, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom_uls, 2) < 1.f) { + map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS); + map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS); } } @@ -451,9 +453,9 @@ struct prefilterDielectron { fRegistry.fill(HIST("Pair/before/lspp/hDeltaEtaDeltaPhi"), dphi, deta); fRegistry.fill(HIST("Pair/before/lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { - map_pfb[pos1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); - map_pfb[pos2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom_ls, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom_ls, 2) < 1.f) { + map_pfb[pos1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS); + map_pfb[pos2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS); } } @@ -481,9 +483,9 @@ struct prefilterDielectron { fRegistry.fill(HIST("Pair/before/lsmm/hDeltaEtaDeltaPhi"), dphi, deta); fRegistry.fill(HIST("Pair/before/lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom, 2) < 1.f) { - map_pfb[ele1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); - map_pfb[ele2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrack); + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom_ls, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom_ls, 2) < 1.f) { + map_pfb[ele1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS); + map_pfb[ele2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS); } } diff --git a/PWGEM/Dilepton/Utils/PairUtilities.h b/PWGEM/Dilepton/Utils/PairUtilities.h index a462720bd07..35dd675a92d 100644 --- a/PWGEM/Dilepton/Utils/PairUtilities.h +++ b/PWGEM/Dilepton/Utils/PairUtilities.h @@ -42,9 +42,10 @@ enum class DileptonAnalysisType : int { kHFll = 6, }; enum class DileptonPrefilterBit : int { - kMee = 0, // reject tracks from pi0 dalitz decays at very low mass where S/B > 1 - kPhiV = 1, // reject tracks from photon conversions - kSplitOrMergedTrack = 2, // reject split or marged tracks + kMee = 0, // reject tracks from pi0 dalitz decays at very low mass where S/B > 1 + kPhiV = 1, // reject tracks from photon conversions + kSplitOrMergedTrackLS = 2, // reject split or marged tracks in LS pairs + kSplitOrMergedTrackULS = 3, // reject split or marged tracks in ULS pairs }; using SMatrix55 = ROOT::Math::SMatrix>; From a1b421ef11f876746d1b1231eea61a140d99da94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Sun, 8 Dec 2024 17:48:20 +0100 Subject: [PATCH 280/459] [Common] RecoDecay::constrainAngle: Support harmonics (#8816) --- Common/Core/RecoDecay.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Common/Core/RecoDecay.h b/Common/Core/RecoDecay.h index a8e4de1216f..5cbb4bbae7e 100644 --- a/Common/Core/RecoDecay.h +++ b/Common/Core/RecoDecay.h @@ -208,18 +208,23 @@ struct RecoDecay { /// Constrains angle to be within a range. /// \note Inspired by TVector2::Phi_0_2pi in ROOT. /// \param angle angle - /// \param min minimum of the range - /// \return value within [min, min + 2π). + /// \param minimum minimum of the range + /// \param harmonic harmonic number + /// \return value of angle within [minimum, minimum + 2π / harmonic). template - static T constrainAngle(T angle, U min = 0.) + static T constrainAngle(T angle, U minimum = 0.0F, unsigned int harmonic = 1U) { - while (angle < min) { - angle += o2::constants::math::TwoPI; + auto period = o2::constants::math::TwoPI; + if (harmonic != 1U) { + period /= harmonic; } - while (angle >= min + o2::constants::math::TwoPI) { - angle -= o2::constants::math::TwoPI; + while (angle < minimum) { + angle += period; } - return (T)angle; + while (angle >= minimum + period) { + angle -= period; + } + return angle; } /// Calculates cosine of pointing angle. From ebb4bfccf7b9c7adb9b95bffdf2b1aefbd0a9dbb Mon Sep 17 00:00:00 2001 From: Tanu Gahlaut <154991749+TGahlaut1@users.noreply.github.com> Date: Sun, 8 Dec 2024 20:13:16 +0100 Subject: [PATCH 281/459] [PWGCF] Changes in Reconstructed level process (#8851) --- PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt | 2 +- ...nPtFlucIdentified.cxx => meanPtFlucId.cxx} | 678 ++++++++---------- 2 files changed, 319 insertions(+), 361 deletions(-) rename PWGCF/EbyEFluctuations/Tasks/{MeanPtFlucIdentified.cxx => meanPtFlucId.cxx} (64%) diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index 1332c9ef1dd..d22d2af4dd7 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -15,7 +15,7 @@ o2physics_add_dpl_workflow(meanpt-fluctuations COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(mean-pt-fluc-id - SOURCES MeanPtFlucIdentified.cxx + SOURCES meanPtFlucId.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/EbyEFluctuations/Tasks/MeanPtFlucIdentified.cxx b/PWGCF/EbyEFluctuations/Tasks/meanPtFlucId.cxx similarity index 64% rename from PWGCF/EbyEFluctuations/Tasks/MeanPtFlucIdentified.cxx rename to PWGCF/EbyEFluctuations/Tasks/meanPtFlucId.cxx index 709554718a1..60207675815 100644 --- a/PWGCF/EbyEFluctuations/Tasks/MeanPtFlucIdentified.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/meanPtFlucId.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file MeanPtFlucIdentified.cxx +/// \file meanPtFlucId.cxx /// \brief Calculate EbyE fluctuations with cumulant method. /// For charged particles and identified particles. /// For RUN-3 @@ -39,7 +39,7 @@ using namespace o2::framework::expressions; using namespace o2::constants::physics; using namespace std; -struct meanPtFlucId { +struct MeanPtFlucId { Configurable nPtBins{"nPtBins", 300, ""}; Configurable nPartBins{"nPartBins", 250, ""}; Configurable nCentBins{"nCentBins", 101, ""}; @@ -92,9 +92,9 @@ struct meanPtFlucId { ConfigurableAxis multFT0MMCBins{"multFT0MMCBins", {250, 0, 250}, "Forward Multiplicity bins"}; ConfigurableAxis dcaXYBins{"dcaXYBins", {100, -0.15, 0.15}, "dcaXY bins"}; ConfigurableAxis dcaZBins{"dcaZBins", {100, -1.2, 1.2}, "dcaZ bins"}; - ConfigurableAxis QnBins{"QnBins", {1000, 0., 100.}, "nth moments bins"}; - ConfigurableAxis TpNBins{"TpNBins", {300, 0., 3000.}, ""}; - ConfigurableAxis TpDBins{"TpDBins", {100, 0., 2000.}, ""}; + ConfigurableAxis qNBins{"qNBins", {1000, 0., 100.}, "nth moments bins"}; + ConfigurableAxis tpNBins{"tpNBins", {300, 0., 3000.}, ""}; + ConfigurableAxis tpDBins{"tpDBins", {100, 0., 2000.}, ""}; using MyAllTracks = soa::Join ", kTH1D, {axisMeanPt}); hist.add("Analysis/Charged/p_mean_pT_Mult_var", " ", kTProfile, {axisMultTPC}); - hist.add("Analysis/Charged/p_CheckNCH", " 1/denominator vs N_{TPC} ", kTProfile, {axisMultTPC}); - hist.add("Analysis/Charged/h_CheckNCH", " 1/denominator vs N_{TPC} ", DenoHist); - hist.add("Analysis/Charged/h_Q1_var", "Q1 vs N_{TPC}", QnHist); + hist.add("Analysis/Charged/p_CheckNCh", " 1/denominator vs N_{TPC} ", kTProfile, {axisMultTPC}); + hist.add("Analysis/Charged/h_CheckNCh", " 1/denominator vs N_{TPC} ", denoHist); + hist.add("Analysis/Charged/h_Q1_var", "Q1 vs N_{TPC}", qNHist); hist.add("Analysis/Charged/h_N_var", "N vs N_{TPC}", kTHnSparseD, {axisMultTPC, axisMult, axisMultFT0M}); hist.add("Analysis/Charged/h_twopart_nume_Mult_var", "twopart numerator", kTHnSparseD, {axisMultTPC, axisTpN, axisMultFT0M}); hist.add("Analysis/Charged/h_twopart_deno_Mult_var", "twopart denominator", kTHnSparseD, {axisMultTPC, axisTpD, axisMultFT0M}); - hist.add("Analysis/Charged/h_mean_pT_Mult_var", " vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_mean_pT_Mult_skew", " vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_mean_pT_Mult_kurto", " vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_twopart_Mult_var", "Twopart vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_twopart_Mult_skew", "Twopart vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_twopart_Mult_kurto", "Twopart vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_threepart_Mult_skew", "Threepart vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_threepart_Mult_kurto", "Threepart vs N_{TPC} ", PartHist); - hist.add("Analysis/Charged/h_fourpart_Mult_kurto", "Fourpart vs N_{TPC} ", PartHist); + hist.add("Analysis/Charged/h_mean_pT_Mult_var", " vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_mean_pT_Mult_skew", " vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_mean_pT_Mult_kurto", " vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_twopart_Mult_var", "Twopart vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_twopart_Mult_skew", "Twopart vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_twopart_Mult_kurto", "Twopart vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_threepart_Mult_skew", "Threepart vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_threepart_Mult_kurto", "Threepart vs N_{TPC} ", partHist); + hist.add("Analysis/Charged/h_fourpart_Mult_kurto", "Fourpart vs N_{TPC} ", partHist); hist.addClone("Analysis/Charged/", "Analysis/Pion/"); hist.addClone("Analysis/Charged/", "Analysis/Kaon/"); @@ -293,34 +293,34 @@ struct meanPtFlucId { hist.add("Gen/Charged/h_Mult", "Multiplicity", kTH1D, {axisMult}); hist.add("Gen/Charged/h_mean_pT", " ", kTH1D, {axisMeanPt}); - hist.add("Gen/Charged/h_Q1", "Q1", QnMCHist); - hist.add("Gen/Charged/h_Q2", "Q2", QnMCHist); - hist.add("Gen/Charged/h_Q3", "Q3", QnMCHist); - hist.add("Gen/Charged/h_Q4", "Q4", QnMCHist); - hist.add("Gen/Charged/h_Q1_var", "Q1 vs N_{TPC}", QnMCHist); + hist.add("Gen/Charged/h_Q1", "Q1", qNMCHist); + hist.add("Gen/Charged/h_Q2", "Q2", qNMCHist); + hist.add("Gen/Charged/h_Q3", "Q3", qNMCHist); + hist.add("Gen/Charged/h_Q4", "Q4", qNMCHist); + hist.add("Gen/Charged/h_Q1_var", "Q1 vs N_{TPC}", qNMCHist); hist.add("Gen/Charged/h_N_var", "N vs N_{TPC}", kTHnSparseD, {axisMultTPC, axisMult, axisMultFT0MMC}); hist.add("Gen/Charged/h_twopart_nume_Mult_var", "twopart numerator", kTHnSparseD, {axisMultTPC, axisTpN, axisMultFT0MMC}); hist.add("Gen/Charged/h_twopart_deno_Mult_var", "twopart denominator", kTHnSparseD, {axisMultTPC, axisTpD, axisMultFT0MMC}); hist.add("Gen/Charged/p_mean_pT_Mult_var", " ", kTProfile, {axisMultTPC}); - hist.add("Gen/Charged/p_CheckNCH", " 1/denominator vs N_{TPC} ", kTProfile, {axisMultTPC}); - hist.add("Gen/Charged/h_CheckNCH", " 1/denominator vs N_{TPC} ", DenoMCHist); - hist.add("Gen/Charged/h_mean_pT_Mult_var", " vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_mean_pT_Mult_skew", " vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_mean_pT_Mult_kurto", " vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_twopart_Mult_var", "Twopart vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_twopart_Mult_skew", "Twopart vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_twopart_Mult_kurto", "Twopart vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_threepart_Mult_skew", "Threepart vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_threepart_Mult_kurto", "Threepart vs N_{TPC} ", PartMCHist); - hist.add("Gen/Charged/h_fourpart_Mult_kurto", "Fourpart vs N_{TPC} ", PartMCHist); + hist.add("Gen/Charged/p_CheckNCh", " 1/denominator vs N_{TPC} ", kTProfile, {axisMultTPC}); + hist.add("Gen/Charged/h_CheckNCh", " 1/denominator vs N_{TPC} ", denoMCHist); + hist.add("Gen/Charged/h_mean_pT_Mult_var", " vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_mean_pT_Mult_skew", " vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_mean_pT_Mult_kurto", " vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_twopart_Mult_var", "Twopart vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_twopart_Mult_skew", "Twopart vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_twopart_Mult_kurto", "Twopart vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_threepart_Mult_skew", "Threepart vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_threepart_Mult_kurto", "Threepart vs N_{TPC} ", partMCHist); + hist.add("Gen/Charged/h_fourpart_Mult_kurto", "Fourpart vs N_{TPC} ", partMCHist); hist.addClone("Gen/Charged/", "Gen/Pion/"); hist.addClone("Gen/Charged/", "Gen/Kaon/"); hist.addClone("Gen/Charged/", "Gen/Proton/"); } - enum mode { + enum Mode { QA_Pion = 0, QA_Kaon, QA_Proton, @@ -334,7 +334,7 @@ struct meanPtFlucId { Gen_Proton }; - static constexpr std::string_view dire[] = { + static constexpr std::string_view Dire[] = { "QA/Pion/", "QA/Kaon/", "QA/Proton/", @@ -542,9 +542,9 @@ struct meanPtFlucId { // Fill hist before selection cuts: template - void FillBeforeQAHistos(T const& col, U const& tracks) + void fillBeforeQAHistos(T const& col, U const& tracks) { - for (auto& track : tracks) { + for (const auto& track : tracks) { hist.fill(HIST("QA/before/h_Eta"), track.eta()); hist.fill(HIST("QA/before/h_Phi"), track.phi()); hist.fill(HIST("QA/before/h_Pt"), track.pt()); @@ -564,50 +564,50 @@ struct meanPtFlucId { hist.fill(HIST("QA/before/h_VtxZ"), col.posZ()); hist.fill(HIST("QA/before/h_Counts"), 2); - int NTPC = col.multNTracksHasTPC(); - int N_FT0M = col.multFT0M(); - int N_FT0C = col.multFT0C(); - double cent_FT0C = col.centFT0C(); - - if (NTPC != 0 && N_FT0M != 0) { - hist.fill(HIST("QA/before/h_NTPC"), NTPC); - hist.fill(HIST("QA/before/h_Cent"), cent_FT0C); - hist.fill(HIST("QA/before/h_NFT0M"), N_FT0M); - hist.fill(HIST("QA/before/h_NFT0C"), N_FT0M); - hist.fill(HIST("QA/before/h2_NTPC_NFT0M"), N_FT0M, NTPC); - hist.fill(HIST("QA/before/h2_NTPC_NFT0C"), N_FT0C, NTPC); - hist.fill(HIST("QA/before/h2_NTPC_Cent"), cent_FT0C, NTPC); + int nTPC = col.multNTracksHasTPC(); + int nFT0M = col.multFT0M(); + int nFT0C = col.multFT0C(); + double centFT0C = col.centFT0C(); + + if (nTPC != 0 && nFT0M != 0) { + hist.fill(HIST("QA/before/h_NTPC"), nTPC); + hist.fill(HIST("QA/before/h_Cent"), centFT0C); + hist.fill(HIST("QA/before/h_NFT0M"), nFT0M); + hist.fill(HIST("QA/before/h_NFT0C"), nFT0M); + hist.fill(HIST("QA/before/h2_NTPC_NFT0M"), nFT0M, nTPC); + hist.fill(HIST("QA/before/h2_NTPC_NFT0C"), nFT0C, nTPC); + hist.fill(HIST("QA/before/h2_NTPC_Cent"), centFT0C, nTPC); } } // Fill hist after selection cuts: template - void FillAfterQAHistos(T const& col) + void fillAfterQAHistos(T const& col) { - int NTPC = col.multNTracksHasTPC(); - int N_FT0M = col.multFT0M(); - int N_FT0C = col.multFT0C(); - double cent_FT0C = col.centFT0C(); + int nTPC = col.multNTracksHasTPC(); + int nFT0M = col.multFT0M(); + int nFT0C = col.multFT0C(); + double centFT0C = col.centFT0C(); hist.fill(HIST("QA/after/h_VtxZ"), col.posZ()); hist.fill(HIST("QA/after/h_Counts"), 2); - if (NTPC != 0 && N_FT0M != 0) { - hist.fill(HIST("QA/after/h_NTPC"), NTPC); - hist.fill(HIST("QA/after/h_Cent"), cent_FT0C); - hist.fill(HIST("QA/after/h_NFT0M"), N_FT0M); - hist.fill(HIST("QA/after/h_NFT0C"), N_FT0C); - hist.fill(HIST("QA/after/h2_NTPC_NFT0M"), N_FT0M, NTPC); - hist.fill(HIST("QA/after/h2_NTPC_NFT0C"), N_FT0C, NTPC); - hist.fill(HIST("QA/after/h2_NTPC_Cent"), cent_FT0C, NTPC); - hist.fill(HIST("QA/after/p_NTPC_Cent"), cent_FT0C, NTPC); - hist.fill(HIST("QA/after/p_NTPC_NFT0M"), N_FT0M, NTPC); - hist.fill(HIST("QA/after/p_NTPC_NFT0C"), N_FT0C, NTPC); + if (nTPC != 0 && nFT0M != 0) { + hist.fill(HIST("QA/after/h_NTPC"), nTPC); + hist.fill(HIST("QA/after/h_Cent"), centFT0C); + hist.fill(HIST("QA/after/h_NFT0M"), nFT0M); + hist.fill(HIST("QA/after/h_NFT0C"), nFT0C); + hist.fill(HIST("QA/after/h2_NTPC_NFT0M"), nFT0M, nTPC); + hist.fill(HIST("QA/after/h2_NTPC_NFT0C"), nFT0C, nTPC); + hist.fill(HIST("QA/after/h2_NTPC_Cent"), centFT0C, nTPC); + hist.fill(HIST("QA/after/p_NTPC_Cent"), centFT0C, nTPC); + hist.fill(HIST("QA/after/p_NTPC_NFT0M"), nFT0M, nTPC); + hist.fill(HIST("QA/after/p_NTPC_NFT0C"), nFT0C, nTPC); } } // Fill Charged particles QA: template - void FillChargedQAHistos(T const& track) + void fillChargedQAHistos(T const& track) { hist.fill(HIST("QA/after/h_Eta"), track.eta()); hist.fill(HIST("QA/after/h_Phi"), track.phi()); @@ -629,7 +629,7 @@ struct meanPtFlucId { // Fill before PID cut QA hist: template - void FillBeforePIDQAHistos(T const& track) + void fillBeforePIDQAHistos(T const& track) { hist.fill(HIST("QA/before/h2_TOFSignal"), track.p(), track.beta()); hist.fill(HIST("QA/before/h2_TPCSignal"), track.p(), track.tpcSignal()); @@ -670,140 +670,140 @@ struct meanPtFlucId { } // Fill after PID cut QA hist: - template - void FillIdParticleQAHistos(T const& track, double rap, double nSigmaTPC, double nSigmaTOF, int& N, double& Q1, double& Q2, double& Q3, double& Q4) + template + void fillIdParticleQAHistos(T const& track, double rap, double nSigmaTPC, double nSigmaTOF, int& N, double& Q1, double& Q2, double& Q3, double& Q4) { N++; moments(track.pt(), Q1, Q2, Q3, Q4); - hist.fill(HIST(dire[mode]) + HIST("h_Pt"), track.pt()); + hist.fill(HIST(Dire[Mode]) + HIST("h_Pt"), track.pt()); if (track.sign() > 0) - hist.fill(HIST(dire[mode]) + HIST("h_PtPos"), track.pt()); + hist.fill(HIST(Dire[Mode]) + HIST("h_PtPos"), track.pt()); if (track.sign() < 0) - hist.fill(HIST(dire[mode]) + HIST("h_PtNeg"), track.pt()); - - hist.fill(HIST(dire[mode]) + HIST("h_Eta"), track.eta()); - hist.fill(HIST(dire[mode]) + HIST("h_Phi"), track.phi()); - hist.fill(HIST(dire[mode]) + HIST("h_rap"), rap); - hist.fill(HIST(dire[mode]) + HIST("h2_Pt_rap"), rap, track.pt()); - hist.fill(HIST(dire[mode]) + HIST("h_DcaZ"), track.dcaZ()); - hist.fill(HIST(dire[mode]) + HIST("h_DcaXY"), track.dcaXY()); - hist.fill(HIST(dire[mode]) + HIST("h2_DcaZ"), track.pt(), track.dcaZ()); - hist.fill(HIST(dire[mode]) + HIST("h2_DcaXY"), track.pt(), track.dcaXY()); - hist.fill(HIST(dire[mode]) + HIST("h2_Pt_Pinner"), track.tpcInnerParam(), track.pt()); - hist.fill(HIST(dire[mode]) + HIST("h2_P_Pinner"), track.tpcInnerParam(), track.p()); - - hist.fill(HIST(dire[mode]) + HIST("h2_TPCNsigma_El"), track.p(), track.tpcNSigmaEl()); - hist.fill(HIST(dire[mode]) + HIST("h2_TOFNsigma_El"), track.p(), track.tofNSigmaEl()); - hist.fill(HIST(dire[mode]) + HIST("h2_TPCNsigma"), track.p(), nSigmaTPC); - hist.fill(HIST(dire[mode]) + HIST("h2_TOFNsigma"), track.p(), nSigmaTOF); - hist.fill(HIST(dire[mode]) + HIST("h2_TpcTofNsigma"), nSigmaTPC, nSigmaTOF); - hist.fill(HIST(dire[mode]) + HIST("h2_TPCSignal"), track.p(), track.tpcSignal()); - hist.fill(HIST(dire[mode]) + HIST("h2_TOFSignal"), track.p(), track.beta()); - hist.fill(HIST(dire[mode]) + HIST("h2_pvsm2"), track.mass() * track.mass(), track.p()); + hist.fill(HIST(Dire[Mode]) + HIST("h_PtNeg"), track.pt()); + + hist.fill(HIST(Dire[Mode]) + HIST("h_Eta"), track.eta()); + hist.fill(HIST(Dire[Mode]) + HIST("h_Phi"), track.phi()); + hist.fill(HIST(Dire[Mode]) + HIST("h_rap"), rap); + hist.fill(HIST(Dire[Mode]) + HIST("h2_Pt_rap"), rap, track.pt()); + hist.fill(HIST(Dire[Mode]) + HIST("h_DcaZ"), track.dcaZ()); + hist.fill(HIST(Dire[Mode]) + HIST("h_DcaXY"), track.dcaXY()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_DcaZ"), track.pt(), track.dcaZ()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_DcaXY"), track.pt(), track.dcaXY()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_Pt_Pinner"), track.tpcInnerParam(), track.pt()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_P_Pinner"), track.tpcInnerParam(), track.p()); + + hist.fill(HIST(Dire[Mode]) + HIST("h2_TPCNsigma_El"), track.p(), track.tpcNSigmaEl()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_TOFNsigma_El"), track.p(), track.tofNSigmaEl()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_TPCNsigma"), track.p(), nSigmaTPC); + hist.fill(HIST(Dire[Mode]) + HIST("h2_TOFNsigma"), track.p(), nSigmaTOF); + hist.fill(HIST(Dire[Mode]) + HIST("h2_TpcTofNsigma"), nSigmaTPC, nSigmaTOF); + hist.fill(HIST(Dire[Mode]) + HIST("h2_TPCSignal"), track.p(), track.tpcSignal()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_TOFSignal"), track.p(), track.beta()); + hist.fill(HIST(Dire[Mode]) + HIST("h2_pvsm2"), track.mass() * track.mass(), track.p()); hist.fill(HIST("QA/after/h2_TPCSignal"), track.p(), track.tpcSignal()); hist.fill(HIST("QA/after/h2_TOFSignal"), track.p(), track.beta()); hist.fill(HIST("QA/after/h2_pvsm2"), track.mass() * track.mass(), track.p()); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TPCNsigma_El"), track.tpcInnerParam(), track.tpcNSigmaEl()); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TOFNsigma_El"), track.tpcInnerParam(), track.tofNSigmaEl()); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TPCNsigma"), track.tpcInnerParam(), nSigmaTPC); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TOFNsigma"), track.tpcInnerParam(), nSigmaTOF); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TpcTofNsigma"), nSigmaTPC, nSigmaTOF); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TPCSignal"), track.tpcInnerParam(), track.tpcSignal()); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_TOFSignal"), track.tpcInnerParam(), track.beta()); - hist.fill(HIST(dire[mode]) + HIST("innerParam/h2_pvsm2"), track.mass() * track.mass(), track.tpcInnerParam()); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TPCNsigma_El"), track.tpcInnerParam(), track.tpcNSigmaEl()); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TOFNsigma_El"), track.tpcInnerParam(), track.tofNSigmaEl()); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TPCNsigma"), track.tpcInnerParam(), nSigmaTPC); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TOFNsigma"), track.tpcInnerParam(), nSigmaTOF); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TpcTofNsigma"), nSigmaTPC, nSigmaTOF); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TPCSignal"), track.tpcInnerParam(), track.tpcSignal()); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_TOFSignal"), track.tpcInnerParam(), track.beta()); + hist.fill(HIST(Dire[Mode]) + HIST("innerParam/h2_pvsm2"), track.mass() * track.mass(), track.tpcInnerParam()); hist.fill(HIST("QA/after/innerParam/h2_TPCSignal"), track.tpcInnerParam(), track.tpcSignal()); hist.fill(HIST("QA/after/innerParam/h2_TOFSignal"), track.tpcInnerParam(), track.beta()); hist.fill(HIST("QA/after/innerParam/h2_pvsm2"), track.mass() * track.mass(), track.tpcInnerParam()); } - template - void FillPtMCHist(double pt, int PID, int pdgCodePos, int pdgCodeNeg) + template + void fillPtMCHist(double pt, int pid, int pdgCodePos, int pdgCodeNeg) { - hist.fill(HIST(dire[mode]) + HIST("h_PtTruth"), pt); - if (PID == pdgCodePos) { - hist.fill(HIST(dire[mode]) + HIST("h_PtPosTruth"), pt); + hist.fill(HIST(Dire[Mode]) + HIST("h_PtTruth"), pt); + if (pid == pdgCodePos) { + hist.fill(HIST(Dire[Mode]) + HIST("h_PtPosTruth"), pt); } - if (PID == pdgCodeNeg) { - hist.fill(HIST(dire[mode]) + HIST("h_PtNegTruth"), pt); + if (pid == pdgCodeNeg) { + hist.fill(HIST(Dire[Mode]) + HIST("h_PtNegTruth"), pt); } } - template - void FillAnalysisHistos(int NTPC, int N_FT0M, int N, double Q1, double Q2, double Q3, double Q4) + template + void fillAnalysisHistos(int nTPC, int nFT0M, int N, double Q1, double Q2, double Q3, double Q4) { - if (N == 0 /* || Q1 == 0 || Q2 == 0 || Q3 == 0 || Q4 == 0 */) { + if (N == 0) { return; } double twopart1 = ((Q1 * Q1) - Q2); double threepart1 = ((Q1 * Q1 * Q1) - (3 * Q2 * Q1) + 2 * Q3); double fourpart1 = ((Q1 * Q1 * Q1 * Q1) - (6 * Q2 * Q1 * Q1) + (3 * Q2 * Q2) + (8 * Q3 * Q1) - 6 * Q4); - hist.fill(HIST(dire[mode]) + HIST("h_Mult"), N); - hist.fill(HIST(dire[mode]) + HIST("h_Q1"), NTPC, Q1, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_Q2"), NTPC, Q2, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_Q3"), NTPC, Q3, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_Q4"), NTPC, Q4, N_FT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_Mult"), N); + hist.fill(HIST(Dire[Mode]) + HIST("h_Q1"), nTPC, Q1, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_Q2"), nTPC, Q2, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_Q3"), nTPC, Q3, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_Q4"), nTPC, Q4, nFT0M); if (N > 1) { - double mean_pT = Q1 / static_cast(N); - double N_pair = (static_cast(N) * (static_cast(N) - 1)); - double twopart = twopart1 / N_pair; - double checkN_deno_var = (1 / std::sqrt(1 - (1 / static_cast(N)))); - hist.fill(HIST(dire[mode]) + HIST("h_mean_pT"), mean_pT); - hist.fill(HIST(dire[mode]) + HIST("p_mean_pT_Mult_var"), NTPC, mean_pT); - - hist.fill(HIST(dire[mode]) + HIST("h_Q1_var"), NTPC, Q1, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_N_var"), NTPC, N, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_nume_Mult_var"), NTPC, twopart1, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_deno_Mult_var"), NTPC, N_pair, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_mean_pT_Mult_var"), NTPC, mean_pT, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_Mult_var"), NTPC, twopart, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("p_CheckNCH"), NTPC, checkN_deno_var); - hist.fill(HIST(dire[mode]) + HIST("h_CheckNCH"), NTPC, checkN_deno_var, N_FT0M); + double meanPt = Q1 / static_cast(N); + double nPair = (static_cast(N) * (static_cast(N) - 1)); + double twopart = twopart1 / nPair; + double checkNDenoVar = (1 / std::sqrt(1 - (1 / static_cast(N)))); + hist.fill(HIST(Dire[Mode]) + HIST("h_mean_pT"), meanPt); + hist.fill(HIST(Dire[Mode]) + HIST("p_mean_pT_Mult_var"), nTPC, meanPt); + + hist.fill(HIST(Dire[Mode]) + HIST("h_Q1_var"), nTPC, Q1, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_N_var"), nTPC, N, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_twopart_nume_Mult_var"), nTPC, twopart1, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_twopart_deno_Mult_var"), nTPC, nPair, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_mean_pT_Mult_var"), nTPC, meanPt, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_twopart_Mult_var"), nTPC, twopart, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("p_CheckNCh"), nTPC, checkNDenoVar); + hist.fill(HIST(Dire[Mode]) + HIST("h_CheckNCh"), nTPC, checkNDenoVar, nFT0M); if (N > 2) { - double N_triplet = (static_cast(N) * (static_cast(N) - 1) * (static_cast(N) - 2)); - double threepart = threepart1 / N_triplet; - hist.fill(HIST(dire[mode]) + HIST("h_mean_pT_Mult_skew"), NTPC, mean_pT, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_Mult_skew"), NTPC, twopart, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_threepart_Mult_skew"), NTPC, threepart, N_FT0M); + double nTriplet = (static_cast(N) * (static_cast(N) - 1) * (static_cast(N) - 2)); + double threepart = threepart1 / nTriplet; + hist.fill(HIST(Dire[Mode]) + HIST("h_mean_pT_Mult_skew"), nTPC, meanPt, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_twopart_Mult_skew"), nTPC, twopart, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_threepart_Mult_skew"), nTPC, threepart, nFT0M); if (N > 3) { - double N_quad = (static_cast(N) * (static_cast(N) - 1) * (static_cast(N) - 2) * (static_cast(N) - 3)); - double fourpart = fourpart1 / N_quad; - hist.fill(HIST(dire[mode]) + HIST("h_mean_pT_Mult_kurto"), NTPC, mean_pT, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_twopart_Mult_kurto"), NTPC, twopart, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_threepart_Mult_kurto"), NTPC, threepart, N_FT0M); - hist.fill(HIST(dire[mode]) + HIST("h_fourpart_Mult_kurto"), NTPC, fourpart, N_FT0M); + double nQuad = (static_cast(N) * (static_cast(N) - 1) * (static_cast(N) - 2) * (static_cast(N) - 3)); + double fourpart = fourpart1 / nQuad; + hist.fill(HIST(Dire[Mode]) + HIST("h_mean_pT_Mult_kurto"), nTPC, meanPt, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_twopart_Mult_kurto"), nTPC, twopart, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_threepart_Mult_kurto"), nTPC, threepart, nFT0M); + hist.fill(HIST(Dire[Mode]) + HIST("h_fourpart_Mult_kurto"), nTPC, fourpart, nFT0M); } } } } template - void FillHistos(T const& col, U const& tracks) + void fillHistos(T const& col, U const& tracks) { - int Nch = 0, N_TPC = 0, N_FT0M = 0; - int N_Pi = 0, N_Ka = 0, N_Pr = 0; - double pt_ch = 0, Q1_ch = 0, Q2_ch = 0, Q3_ch = 0, Q4_ch = 0; - double pt_Pi = 0, Q1_Pi = 0, Q2_Pi = 0, Q3_Pi = 0, Q4_Pi = 0; - double pt_Pr = 0, Q1_Pr = 0, Q2_Pr = 0, Q3_Pr = 0, Q4_Pr = 0; - double pt_Ka = 0, Q1_Ka = 0, Q2_Ka = 0, Q3_Ka = 0, Q4_Ka = 0; - - int Nch_sim = 0, N_sim = 0, NFT0C_sim = 0; - int N_Pi_sim = 0, N_Ka_sim = 0, N_Pr_sim = 0; - double pt_ch_sim = 0, Q1_ch_sim = 0, Q2_ch_sim = 0, Q3_ch_sim = 0, Q4_ch_sim = 0; - double pt_Pi_sim = 0, Q1_Pi_sim = 0, Q2_Pi_sim = 0, Q3_Pi_sim = 0, Q4_Pi_sim = 0; - double pt_Pr_sim = 0, Q1_Pr_sim = 0, Q2_Pr_sim = 0, Q3_Pr_sim = 0, Q4_Pr_sim = 0; - double pt_Ka_sim = 0, Q1_Ka_sim = 0, Q2_Ka_sim = 0, Q3_Ka_sim = 0, Q4_Ka_sim = 0; + int nCh = 0, nTPC = 0, nFT0M = 0; + int nPi = 0, nKa = 0, nPr = 0; + double ptCh = 0, q1Ch = 0, q2Ch = 0, q3Ch = 0, q4Ch = 0; + double ptPi = 0, q1Pi = 0, q2Pi = 0, q3Pi = 0, q4Pi = 0; + double ptPr = 0, q1Pr = 0, q2Pr = 0, q3Pr = 0, q4Pr = 0; + double ptKa = 0, q1Ka = 0, q2Ka = 0, q3Ka = 0, q4Ka = 0; + + int nChSim = 0, nSim = 0, NFT0CSim = 0; + int nPiSim = 0, nKaSim = 0, nPrSim = 0; + double ptChSim = 0, q1ChSim = 0, q2ChSim = 0, q3ChSim = 0, q4ChSim = 0; + double ptPiSim = 0, q1PiSim = 0, q2PiSim = 0, q3PiSim = 0, q4PiSim = 0; + double ptPrSim = 0, q1PrSim = 0, q2PrSim = 0, q3PrSim = 0, q4PrSim = 0; + double ptKaSim = 0, q1KaSim = 0, q2KaSim = 0, q3KaSim = 0, q4KaSim = 0; array p1, p2; double invMassGamma = 0.0; - for (auto const& [trkEl, trkPos] : soa::combinations(soa::CombinationsFullIndexPolicy(tracks, tracks))) { + for (const auto& [trkEl, trkPos] : soa::combinations(soa::CombinationsFullIndexPolicy(tracks, tracks))) { if (trkEl.index() == trkPos.index()) continue; @@ -813,15 +813,15 @@ struct meanPtFlucId { if (!selElectrons(trkEl) || !selElectrons(trkPos)) continue; - p1 = array{trkEl.px(), trkEl.py(), trkEl.pz()}; - p2 = array{trkPos.px(), trkPos.py(), trkPos.pz()}; + p1 = std::array{trkEl.px(), trkEl.py(), trkEl.pz()}; + p2 = std::array{trkPos.px(), trkPos.py(), trkPos.pz()}; - invMassGamma = RecoDecay::m(array{p1, p2}, array{MassElectron, MassElectron}); + invMassGamma = RecoDecay::m(std::array{p1, p2}, std::array{MassElectron, MassElectron}); hist.fill(HIST("QA/after/h_invMass_gamma"), invMassGamma); } if constexpr (DataFlag) { - for (auto& track : tracks) { + for (const auto& track : tracks) { if (!selTrack(track)) { continue; } @@ -838,13 +838,13 @@ struct meanPtFlucId { double innerParam = track.tpcInnerParam(); if (std::fabs(track.eta()) < 0.8) { - Nch++; - pt_ch = track.pt(); - moments(pt_ch, Q1_ch, Q2_ch, Q3_ch, Q4_ch); - FillChargedQAHistos(track); + nCh++; + ptCh = track.pt(); + moments(ptCh, q1Ch, q2Ch, q3Ch, q4Ch); + fillChargedQAHistos(track); } - FillBeforePIDQAHistos(track); + fillBeforePIDQAHistos(track); if (rejectTracks(track)) { return; @@ -856,31 +856,31 @@ struct meanPtFlucId { if (cfgSelOR == true && cfgSelAND == false) { if (selLowPi(track, innerParam) == cfgSelLow || selHighPi(track) == cfgSelHigh) { - FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); + fillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, nPi, q1Pi, q2Pi, q3Pi, q4Pi); } } else if (cfgSelOR == false && cfgSelAND == true) { if (selLowPi(track, innerParam) == cfgSelLow && selHighPi(track) == cfgSelHigh) { - FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); + fillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, nPi, q1Pi, q2Pi, q3Pi, q4Pi); } } if (cfgSelOR == true && cfgSelAND == false) { if (selLowKa(track, innerParam) == cfgSelLow || selHighKa(track) == cfgSelHigh) { - FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); + fillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, nKa, q1Ka, q2Ka, q3Ka, q4Ka); } } else if (cfgSelOR == false && cfgSelAND == true) { if (selLowKa(track, innerParam) == cfgSelLow && selHighKa(track) == cfgSelHigh) { - FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); + fillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, nKa, q1Ka, q2Ka, q3Ka, q4Ka); } } if (cfgSelOR == true && cfgSelAND == false) { if (selLowPr(track, innerParam) == cfgSelLow && selHighPr(track) == cfgSelHigh) { - FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); + fillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, nPr, q1Pr, q2Pr, q3Pr, q4Pr); } } else if (cfgSelOR == false && cfgSelAND == true) { if (selLowPr(track, innerParam) == cfgSelLow && selHighPr(track) == cfgSelHigh) { - FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); + fillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, nPr, q1Pr, q2Pr, q3Pr, q4Pr); } } } @@ -890,20 +890,20 @@ struct meanPtFlucId { return; } - for (auto& track : tracks) { + for (const auto& track : tracks) { if (!track.has_mcParticle()) { LOGF(warning, "No MC Particle for this track, skip..."); continue; } auto mcPart = track.mcParticle(); - int PID = mcPart.pdgCode(); + int pid = mcPart.pdgCode(); if (!mcPart.isPhysicalPrimary()) { continue; } //___________________________________Truth Level____________________________________________________// auto charge = 0.; - auto* pd = pdg->GetParticle(PID); + auto* pd = pdg->GetParticle(pid); if (pd != nullptr) { charge = pd->Charge(); } @@ -911,10 +911,10 @@ struct meanPtFlucId { continue; } if (std::abs(mcPart.eta()) < 0.8) { - N_sim++; + nSim++; } if (-3.3 < mcPart.eta() && mcPart.eta() < -2.1) { - NFT0C_sim++; + NFT0CSim++; } if (mcPart.pt() > cfgCutPtMin && mcPart.pt() < cfgCutPtMax) { @@ -922,61 +922,61 @@ struct meanPtFlucId { continue; } - Nch_sim++; - pt_ch_sim = mcPart.pt(); - moments(pt_ch_sim, Q1_ch_sim, Q2_ch_sim, Q3_ch_sim, Q4_ch_sim); + nChSim++; + ptChSim = mcPart.pt(); + moments(ptChSim, q1ChSim, q2ChSim, q3ChSim, q4ChSim); hist.fill(HIST("Gen/Charged/h_PtTruth"), mcPart.pt()); - if (std::abs(PID) == kPiPlus && mcPart.pt() >= cfgCutPiPtMin) { + if (std::abs(pid) == kPiPlus && mcPart.pt() >= cfgCutPiPtMin) { if (cfgSelOR == true && cfgSelAND == false) { if (mcPart.p() <= cfgCutPiThrsldP || mcPart.p() > cfgCutPiThrsldP) { - N_Pi_sim++; - pt_Pi_sim = mcPart.pt(); - moments(pt_Pi_sim, Q1_Pi_sim, Q2_Pi_sim, Q3_Pi_sim, Q4_Pi_sim); - FillPtMCHist(pt_Pi_sim, PID, kPiPlus, kPiMinus); + nPiSim++; + ptPiSim = mcPart.pt(); + moments(ptPiSim, q1PiSim, q2PiSim, q3PiSim, q4PiSim); + fillPtMCHist(ptPiSim, pid, kPiPlus, kPiMinus); } } else if (cfgSelOR == false && cfgSelAND == true) { if ((cfgSelLow == true && mcPart.p() <= cfgCutPiThrsldP) && (cfgSelHigh == true && mcPart.p() > cfgCutPiThrsldP)) { - N_Pi_sim++; - pt_Pi_sim = mcPart.pt(); - moments(pt_Pi_sim, Q1_Pi_sim, Q2_Pi_sim, Q3_Pi_sim, Q4_Pi_sim); - FillPtMCHist(pt_Pi_sim, PID, kPiPlus, kPiMinus); + nPiSim++; + ptPiSim = mcPart.pt(); + moments(ptPiSim, q1PiSim, q2PiSim, q3PiSim, q4PiSim); + fillPtMCHist(ptPiSim, pid, kPiPlus, kPiMinus); } } } - if (std::abs(PID) == kKPlus && mcPart.pt() >= cfgCutKaPtMin) { + if (std::abs(pid) == kKPlus && mcPart.pt() >= cfgCutKaPtMin) { if (cfgSelOR == true && cfgSelAND == false) { if ((cfgSelLow == true && mcPart.p() <= cfgCutPiThrsldP) || (cfgSelHigh == true && mcPart.p() > cfgCutPiThrsldP)) { - N_Ka_sim++; - pt_Ka_sim = mcPart.pt(); - moments(pt_Ka_sim, Q1_Ka_sim, Q2_Ka_sim, Q3_Ka_sim, Q4_Ka_sim); - FillPtMCHist(pt_Ka_sim, PID, kKPlus, kKMinus); + nKaSim++; + ptKaSim = mcPart.pt(); + moments(ptKaSim, q1KaSim, q2KaSim, q3KaSim, q4KaSim); + fillPtMCHist(ptKaSim, pid, kKPlus, kKMinus); } } else if (cfgSelOR == false && cfgSelAND == true) { if ((cfgSelLow == true && mcPart.p() <= cfgCutKaThrsldP) && (cfgSelHigh == true && mcPart.p() > cfgCutKaThrsldP)) { - N_Ka_sim++; - pt_Ka_sim = mcPart.pt(); - moments(pt_Ka_sim, Q1_Ka_sim, Q2_Ka_sim, Q3_Ka_sim, Q4_Ka_sim); - FillPtMCHist(pt_Ka_sim, PID, kKPlus, kKMinus); + nKaSim++; + ptKaSim = mcPart.pt(); + moments(ptKaSim, q1KaSim, q2KaSim, q3KaSim, q4KaSim); + fillPtMCHist(ptKaSim, pid, kKPlus, kKMinus); } } } - if (std::abs(PID) == kProton && mcPart.pt() >= cfgCutPrPtMin) { + if (std::abs(pid) == kProton && mcPart.pt() >= cfgCutPrPtMin) { if (cfgSelOR == true && cfgSelAND == false) { if ((cfgSelLow == true && mcPart.p() <= cfgCutPrThrsldP) || (cfgSelHigh == true && mcPart.p() > cfgCutPrThrsldP)) { - N_Pr_sim++; - pt_Pr_sim = mcPart.pt(); - moments(pt_Pr_sim, Q1_Pr_sim, Q2_Pr_sim, Q3_Pr_sim, Q4_Pr_sim); - FillPtMCHist(pt_Pr_sim, PID, kProton, kProtonBar); + nPrSim++; + ptPrSim = mcPart.pt(); + moments(ptPrSim, q1PrSim, q2PrSim, q3PrSim, q4PrSim); + fillPtMCHist(ptPrSim, pid, kProton, kProtonBar); } } else if (cfgSelOR == false && cfgSelAND == true) { if ((cfgSelLow == true && mcPart.p() <= cfgCutPrThrsldP) && (cfgSelHigh == true && mcPart.p() > cfgCutPrThrsldP)) { - N_Pr_sim++; - pt_Pr_sim = mcPart.pt(); - moments(pt_Pr_sim, Q1_Pr_sim, Q2_Pr_sim, Q3_Pr_sim, Q4_Pr_sim); - FillPtMCHist(pt_Pr_sim, PID, kProton, kProtonBar); + nPrSim++; + ptPrSim = mcPart.pt(); + moments(ptPrSim, q1PrSim, q2PrSim, q3PrSim, q4PrSim); + fillPtMCHist(ptPrSim, pid, kProton, kProtonBar); } } } @@ -997,15 +997,14 @@ struct meanPtFlucId { double rapPi = track.rapidity(MassPiPlus); double rapKa = track.rapidity(MassKPlus); double rapPr = track.rapidity(MassProton); - double innerParam = track.tpcInnerParam(); if (std::fabs(track.eta()) < 0.8) { - Nch++; - pt_ch = track.pt(); - moments(pt_ch, Q1_ch, Q2_ch, Q3_ch, Q4_ch); - FillChargedQAHistos(track); + nCh++; + ptCh = track.pt(); + moments(ptCh, q1Ch, q2Ch, q3Ch, q4Ch); + fillChargedQAHistos(track); } - FillBeforePIDQAHistos(track); + fillBeforePIDQAHistos(track); if (rejectTracks(track)) { return; @@ -1015,133 +1014,92 @@ struct meanPtFlucId { continue; } - if (cfgSelOR == true && cfgSelAND == false) { - if (selLowPi(track, innerParam) == cfgSelLow || selHighPi(track) == cfgSelHigh) { - pt_Pi = track.pt(); - FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); - - if (std::abs(PID) == kPiPlus) { - FillPtMCHist(pt_Pi, PID, kPiPlus, kPiMinus); - } - } - } else if (cfgSelOR == false && cfgSelAND == true) { - if (selLowPi(track, innerParam) == cfgSelLow && selHighPi(track) == cfgSelHigh) { - pt_Pi = track.pt(); - FillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); - - if (std::abs(PID) == kPiPlus) { - FillPtMCHist(pt_Pi, PID, kPiPlus, kPiMinus); - } - } + if (std::abs(pid) == kPiPlus && track.pt() >= cfgCutPiPtMin) { + ptPi = track.pt(); + fillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, nPi, q1Pi, q2Pi, q3Pi, q4Pi); + fillPtMCHist(ptPi, pid, kPiPlus, kPiMinus); } - if (cfgSelOR == true && cfgSelAND == false) { - if (selLowKa(track, innerParam) == cfgSelLow || selHighKa(track) == cfgSelHigh) { - pt_Ka = track.pt(); - FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - if (std::abs(PID) == kKPlus) { - FillPtMCHist(pt_Ka, PID, kKPlus, kKMinus); - } - } - } else if (cfgSelOR == false && cfgSelAND == true) { - if (selLowKa(track, innerParam) == cfgSelLow && selHighKa(track) == cfgSelHigh) { - pt_Ka = track.pt(); - FillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - - if (std::abs(PID) == kKPlus) { - FillPtMCHist(pt_Ka, PID, kKPlus, kKMinus); - } - } + if (std::abs(pid) == kKPlus && track.pt() >= cfgCutKaPtMin) { + ptKa = track.pt(); + fillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, nKa, q1Ka, q2Ka, q3Ka, q4Ka); + fillPtMCHist(ptKa, pid, kKPlus, kKMinus); } - if (cfgSelOR == true && cfgSelAND == false) { - if (selLowPr(track, innerParam) == cfgSelLow || selHighPr(track) == cfgSelHigh) { - pt_Pr = track.pt(); - FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); - - if (std::abs(PID) == kProton) { - FillPtMCHist(pt_Pr, PID, kProton, kProtonBar); - } - } - } else if (cfgSelOR == false && cfgSelAND == true) { - if (selLowPr(track, innerParam) == cfgSelLow && selHighPr(track) == cfgSelHigh) { - pt_Pr = track.pt(); - FillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); - - if (std::abs(PID) == kProton) { - FillPtMCHist(pt_Pr, PID, kProton, kProtonBar); - } - } + if (std::abs(pid) == kProton && track.pt() >= cfgCutPrPtMin) { + ptPr = track.pt(); + fillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, nPr, q1Pr, q2Pr, q3Pr, q4Pr); + fillPtMCHist(ptPr, pid, kProton, kProtonBar); } } - hist.fill(HIST("QA/after/h_vtxZ_sim"), col.mcCollision().posZ()); + hist.fill(HIST("QA/after/h_vtxZSim"), col.mcCollision().posZ()); } - N_TPC = col.multNTracksHasTPC(); - N_FT0M = col.multFT0M(); + nTPC = col.multNTracksHasTPC(); + nFT0M = col.multFT0M(); if (cfgMCTruth) { - if (N_sim != 0) - hist.fill(HIST("QA/after/h_NSim"), N_sim); + if (nSim != 0) + hist.fill(HIST("QA/after/h_NSim"), nSim); - if (N_sim != 0 && Nch != 0) - hist.fill(HIST("QA/after/h2_NchSim_NSim"), N_sim, Nch_sim); + if (nSim != 0 && nCh != 0) + hist.fill(HIST("QA/after/h2_NChSim_NSim"), nSim, nChSim); - if (N_sim != 0 && N_TPC != 0) - hist.fill(HIST("QA/after/h2_NTPC_NSim"), N_sim, N_TPC); + if (nSim != 0 && nTPC != 0) + hist.fill(HIST("QA/after/h2_NTPC_NSim"), nSim, nTPC); - int NFT0C = col.multFT0C(); - if (NFT0C != 0 && NFT0C_sim != 0) - hist.fill(HIST("QA/after/h2_NFT0C_NFT0CSim"), NFT0C_sim, NFT0C); + int nFT0C = col.multFT0C(); + if (nFT0C != 0 && NFT0CSim != 0) + hist.fill(HIST("QA/after/h2_NFT0C_NFT0CSim"), NFT0CSim, nFT0C); - N_TPC = N_sim; + nTPC = nSim; - hist.fill(HIST("Gen/NTPC"), N_TPC); - hist.fill(HIST("Gen/NFT0C"), NFT0C_sim); - hist.fill(HIST("Gen/h2_NTPC_NFT0C"), NFT0C_sim, N_TPC); + hist.fill(HIST("Gen/NTPC"), nTPC); + hist.fill(HIST("Gen/NFT0C"), NFT0CSim); + hist.fill(HIST("Gen/h2_NTPC_NFT0C"), NFT0CSim, nTPC); - FillAnalysisHistos(N_TPC, N_FT0M, Nch_sim, Q1_ch_sim, Q2_ch_sim, Q3_ch_sim, Q4_ch_sim); - FillAnalysisHistos(N_TPC, N_FT0M, N_Pi_sim, Q1_Pi_sim, Q2_Pi_sim, Q3_Pi_sim, Q4_Pi_sim); - FillAnalysisHistos(N_TPC, N_FT0M, N_Ka_sim, Q1_Ka_sim, Q2_Ka_sim, Q3_Ka_sim, Q4_Ka_sim); - FillAnalysisHistos(N_TPC, N_FT0M, N_Pr_sim, Q1_Pr_sim, Q2_Pr_sim, Q3_Pr_sim, Q4_Pr_sim); + fillAnalysisHistos(nTPC, nFT0M, nChSim, q1ChSim, q2ChSim, q3ChSim, q4ChSim); + fillAnalysisHistos(nTPC, nFT0M, nPiSim, q1PiSim, q2PiSim, q3PiSim, q4PiSim); + fillAnalysisHistos(nTPC, nFT0M, nKaSim, q1KaSim, q2KaSim, q3KaSim, q4KaSim); + fillAnalysisHistos(nTPC, nFT0M, nPrSim, q1PrSim, q2PrSim, q3PrSim, q4PrSim); } - FillAfterQAHistos(col); - if (N_TPC != 0 && Nch != 0) - hist.fill(HIST("QA/after/h2_NTPC_Nch"), N_TPC, Nch); + fillAfterQAHistos(col); + if (nTPC != 0 && nCh != 0) + hist.fill(HIST("QA/after/h2_NTPC_NCh"), nTPC, nCh); - FillAnalysisHistos(N_TPC, N_FT0M, Nch, Q1_ch, Q2_ch, Q3_ch, Q4_ch); - FillAnalysisHistos(N_TPC, N_FT0M, N_Pi, Q1_Pi, Q2_Pi, Q3_Pi, Q4_Pi); - FillAnalysisHistos(N_TPC, N_FT0M, N_Ka, Q1_Ka, Q2_Ka, Q3_Ka, Q4_Ka); - FillAnalysisHistos(N_TPC, N_FT0M, N_Pr, Q1_Pr, Q2_Pr, Q3_Pr, Q4_Pr); + fillAnalysisHistos(nTPC, nFT0M, nCh, q1Ch, q2Ch, q3Ch, q4Ch); + fillAnalysisHistos(nTPC, nFT0M, nPi, q1Pi, q2Pi, q3Pi, q4Pi); + fillAnalysisHistos(nTPC, nFT0M, nKa, q1Ka, q2Ka, q3Ka, q4Ka); + fillAnalysisHistos(nTPC, nFT0M, nPr, q1Pr, q2Pr, q3Pr, q4Pr); } - void process_Run3(MyCollisions::iterator const& col, MyAllTracks const& tracks) + void processRun3(MyCollisions::iterator const& col, MyAllTracks const& tracks) { // Before Collision and Track Cuts: - FillBeforeQAHistos(col, tracks); + fillBeforeQAHistos(col, tracks); // After Collision and Track Cuts: if (selRun3Col(col)) { - FillHistos(col, tracks); + fillHistos(col, tracks); } } - PROCESS_SWITCH(meanPtFlucId, process_Run3, "Process for Run3", false); + PROCESS_SWITCH(MeanPtFlucId, processRun3, "Process for Run3", false); - void process_MCRecoSimRun3(MyMCCollisions::iterator const& col, aod::McCollisions const&, MyMCTracks const& tracks, aod::McParticles const&) + void processMCRecoSimRun3(MyMCCollisions::iterator const& col, aod::McCollisions const&, MyMCTracks const& tracks, aod::McParticles const&) { // Before Collision and Track Cuts: - FillBeforeQAHistos(col, tracks); + fillBeforeQAHistos(col, tracks); // After Collision and Track Cuts: if (selRun3Col(col)) { - FillHistos(col, tracks); + fillHistos(col, tracks); } } - PROCESS_SWITCH(meanPtFlucId, process_MCRecoSimRun3, "process MC Reconstructed & Truth Run-3", true); + PROCESS_SWITCH(MeanPtFlucId, processMCRecoSimRun3, "process MC Reconstructed & Truth Run-3", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 080bf7c8791082b8120047ebef9e08fa2787e221 Mon Sep 17 00:00:00 2001 From: abilandz Date: Sun, 8 Dec 2024 20:46:56 +0100 Subject: [PATCH 282/459] [PWGCF] additions to IV, validations of banishment loop, support for ES, etc. (#8859) --- .../Core/MuPa-Configurables.h | 16 + .../Core/MuPa-DataMembers.h | 31 +- .../Core/MuPa-Enums.h | 8 +- .../Core/MuPa-GlobalConstants.h | 7 +- .../Core/MuPa-MemberFunctions.h | 818 +++++++++++++++--- .../Tasks/multiparticle-correlations-ab.cxx | 1 + 6 files changed, 752 insertions(+), 129 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h index 578738396c9..eab94f015a4 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h @@ -26,6 +26,7 @@ struct : ConfigurableGroup { Configurable cfVerboseUtility{"cfVerboseUtility", false, "run or not in verbose mode, also for simple utility functions (but not for function calls per particle)"}; Configurable cfVerboseForEachParticle{"cfVerboseForEachParticle", false, "run or not in verbose mode (also for function calls per particle)"}; Configurable cfVerboseEventCounter{"cfVerboseEventCounter", false, "print or not only event counter"}; + Configurable cfVerboseEventCut{"cfVerboseEventCut", false, "print or not which event cut didn't survive"}; Configurable cfPlainPrintout{"cfPlainPrintout", false, "print in color or in plain (use the latter in HL)"}; Configurable cfDoAdditionalInsanityChecks{"cfDoAdditionalInsanityChecks", false, "do additional insanity checks at run time (this leads to small loss of performance)"}; Configurable cfInsanityCheckForEachParticle{"cfInsanityCheckForEachParticle", false, "do insanity checks at run time for each particle, at the expense of losing a lot of performance. Use only during debugging."}; @@ -168,6 +169,21 @@ struct : ConfigurableGroup { Configurable cfWhichDefaultLabels{"cfWhichDefaultLabels", "standard", "only for testing purposes, select one set of default labels, see GetDefaultObjArrayWithLabels for supported options"}; } cf_t0; +// *) Eta separation: +struct : ConfigurableGroup { + Configurable cfCalculateEtaSeparations{"cfCalculateEtaSeparations", false, "calculate or not 2p corr. vs. eta separations"}; + Configurable cfCalculateEtaSeparationsAsFunctionOfIntegrated{"cfCalculateEtaSeparationsAsFunctionOfIntegrated", false, "calculate or not 2p corr. vs. eta separations ..."}; + Configurable cfCalculateEtaSeparationsAsFunctionOfMultiplicity{"cfCalculateEtaSeparationsAsFunctionOfMultiplicity", false, "calculate or not 2p corr. vs. eta separations as a function of multiplicity"}; + Configurable cfCalculateEtaSeparationsAsFunctionOfCentrality{"cfCalculateEtaSeparationsAsFunctionOfCentrality", false, "calculate or not 2p corr. vs. eta separations as a function of centrality"}; + Configurable cfCalculateEtaSeparationsAsFunctionOfPt{"cfCalculateEtaSeparationsAsFunctionOfPt", false, "calculate or not 2p corr. vs. eta separations as a function of pt"}; + // Configurable cfCalculateEtaSeparationsAsFunctionOfEta{"cfCalculateEtaSeparationsAsFunctionOfEta", false, "this one doesn't make sense in this context"}; + Configurable cfCalculateEtaSeparationsAsFunctionOfOccupancy{"cfCalculateEtaSeparationsAsFunctionOfOccupancy", false, "calculate or not 2p corr. vs. eta separations as a function of occupancy"}; + Configurable cfCalculateEtaSeparationsAsFunctionOfInteractionRate{"cfCalculateEtaSeparationsAsFunctionOfInteractionRate", false, "calculate or not 2p corr. vs. eta separations as a function of interaction rate"}; + Configurable cfCalculateEtaSeparationsAsFunctionOfCurrentRunDuration{"cfCalculateEtaSeparationsAsFunctionOfCurrentRunDuration", false, "calculate or not E2p corr. vs. eta separations as a function of current run duration (i.e. vs. seconds since start of run)"}; + Configurable> cfEtaSeparationsValues{"cfEtaSeparationsValues", {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8}, "Eta separation between interval A (-eta) and B (+eta)"}; + Configurable> cfEtaSeparationsSkipHarmonics{"cfEtaSeparationsSkipHarmonics", {"0-v1", "0-v2", "0-v3", "0-v4", "1-v5", "1-v6", "1-v7", "1-v8", "1-v9"}, "For calculation of 2p correlation with eta separation these harmonics will be skipped (if first flag = \"0-v1\", v1 will be NOT be skipped in the calculus of 2p correlations with eta separations, etc.)"}; +} cf_es; + // *) Particle weights: struct : ConfigurableGroup { Configurable cfUsePhiWeights{"cfUsePhiWeights", false, "use or not phi weights"}; diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h index ab4f7a28135..8878439b7e3 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h @@ -47,6 +47,7 @@ struct TaskConfiguration { Bool_t fVerboseUtility = kFALSE; // print additional info during debugging also for simply utility function, but not for function calls per particle (see next) Bool_t fVerboseForEachParticle = kFALSE; // print additional info during debugging, also for function calls per particle Bool_t fVerboseEventCounter = kTRUE; // print or not only event counter + Bool_t fVerboseEventCut = kTRUE; // print or not only which event cut didn't survive Bool_t fPlainPrintout = kFALSE; // print in color or in plain (use the latter in HL) Bool_t fDoAdditionalInsanityChecks = kFALSE; // do additional insanity checks at run time, at the expense of losing a bit of performance // (for instance, check if the run number in the current 'collision' is the same as run number in the first 'collision', etc.) @@ -183,10 +184,16 @@ struct Qvector { TList* fQvectorList = NULL; // list to hold all Q-vector objects TProfile* fQvectorFlagsPro = NULL; // profile to hold all flags for Q-vector Bool_t fCalculateQvectors = kTRUE; // to calculate or not to calculate Q-vectors, that's a Boolean... + // Does NOT apply to Qa, Qb, etc., vectors, needed for eta separ. TComplex fQ[gMaxHarmonic * gMaxCorrelator + 1][gMaxCorrelator + 1] = {{TComplex(0., 0.)}}; //! generic Q-vector TComplex fQvector[gMaxHarmonic * gMaxCorrelator + 1][gMaxCorrelator + 1] = {{TComplex(0., 0.)}}; //! "integrated" Q-vector TComplex fqvector[eqvectorKine_N][gMaxNoBinsKine][gMaxHarmonic * gMaxCorrelator + 1][gMaxCorrelator + 1] = {{{{TComplex(0., 0.)}}}}; //! "differenttial" q-vector [kine var.][binNo][fMaxHarmonic*fMaxCorrelator+1][fMaxCorrelator+1] = [6*12+1][12+1] Int_t fqVectorEntries[eqvectorKine_N][gMaxNoBinsKine] = {{0}}; // count number of entries in each differential q-vector + TComplex fQabVector[2][gMaxHarmonic][gMaxNumberEtaSeparations] = {{{TComplex(0., 0.)}}}; //! integrated [-eta or +eta][harmonic][eta separation] + Double_t fMab[2][gMaxNumberEtaSeparations] = {{0.}}; //! multiplicities in 2 eta separated intervals + TH1F* fMabDist[2][2][2][gMaxNumberEtaSeparations] = {{{{NULL}}}}; // multiplicity distributions in A and B, for each eta separation [ A or B ] [rec or sim] [ before or after cuts ] [ eta separation value ] + TComplex fqabVector[2][gMaxNoBinsKine][gMaxHarmonic][gMaxNumberEtaSeparations] = {{{{TComplex(0., 0.)}}}}; //! differential in pt [-eta or +eta][binNo][harmonic][eta separation] + Double_t fmab[2][gMaxNoBinsKine][gMaxNumberEtaSeparations] = {{{0.}}}; //! multiplicities vs pt in 2 eta separated intervals } qv; // "qv" is a common label for objects in this struct // *) Multiparticle correlations (standard, isotropic, same harmonic): @@ -208,7 +215,7 @@ struct ParticleWeights { Bool_t fUseWeights[eWeights_N] = {false}; // use weights [phi,pt,eta] TH1D* fWeightsHist[eWeights_N] = {NULL}; //! use only in Run 3, both for data and MC // *) As of 20240410, kNoITSROFrameBorder (only in MC) and kNoTimeFrameBorder event selection cuts are part of Sel8 // See also email from EK from 2024041 - eMultiplicityEstimator, // see documentation below for ebye.fMultiplicity - eReferenceMultiplicityEstimator, // see documentation below for ebye.fReferenceMultiplicity + eMultiplicityEstimator, // see documentation for ebye.fMultiplicity + eReferenceMultiplicityEstimator, // see documentation for ebye.fReferenceMultiplicity eCentralityEstimator, // the default centrality estimator, set via configurable. All supported centrality estimators, for QA, etc, are in enum eCentralityEstimators eSelectedEvents, // selected events = eNumberOfEvents + eAfter => therefore I do not need a special histogram for it eNoSameBunchPileup, // reject collisions in case of pileup with another collision in the same foundBC (emails from IA on 20240404 and EK on 20240410) diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-GlobalConstants.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-GlobalConstants.h index b7cc29c4232..c62ffeaf6c8 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-GlobalConstants.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-GlobalConstants.h @@ -14,8 +14,9 @@ const Int_t gMaxCorrelator = 12; const Int_t gMaxHarmonic = 9; -const Int_t gMaxIndex = 300; // per order, used only in Test0 -const Int_t gMaxNoBinsKine = 1000; // max number of bins for differential q-vector -const Int_t fMaxBinsDiffWeights = 100; // max number of bins for differential weights, see MakeWeights.C +const Int_t gMaxIndex = 300; // per order, used only in Test0 +const Int_t gMaxNoBinsKine = 1000; // max number of bins for differential q-vector +const Int_t gMaxBinsDiffWeights = 100; // max number of bins for differential weights, see MakeWeights.C +const Int_t gMaxNumberEtaSeparations = 9; // max number of different eta separations used to calculated 2p corr. with eta separations #endif // PWGCF_MULTIPARTICLECORRELATIONS_CORE_MUPA_GLOBALCONSTANTS_H_ diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h index a4a699dfe90..0e2fafcf4e7 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h @@ -354,28 +354,30 @@ void DefaultConfiguration() // *) Multiparticle correlations: mupa.fCalculateCorrelations = cf_mupa.cfCalculateCorrelations; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_INTEGRATED] = cf_mupa.cfCalculateCorrelationsAsFunctionOfIntegrated; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_MULTIPLICITY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfMultiplicity; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_CENTRALITY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfCentrality; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] = cf_mupa.cfCalculateCorrelationsAsFunctionOfPt; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] = cf_mupa.cfCalculateCorrelationsAsFunctionOfEta; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_OCCUPANCY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfOccupancy; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_INTERACTIONRATE] = cf_mupa.cfCalculateCorrelationsAsFunctionOfInteractionRate; - mupa.fCalculateCorrelationsAsFunctionOf[AFO_CURRENTRUNDURATION] = cf_mupa.cfCalculateCorrelationsAsFunctionOfCurrentRunDuration; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_INTEGRATED] = cf_mupa.cfCalculateCorrelationsAsFunctionOfIntegrated && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_MULTIPLICITY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfMultiplicity && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_CENTRALITY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfCentrality && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] = cf_mupa.cfCalculateCorrelationsAsFunctionOfPt && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] = cf_mupa.cfCalculateCorrelationsAsFunctionOfEta && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_OCCUPANCY] = cf_mupa.cfCalculateCorrelationsAsFunctionOfOccupancy && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_INTERACTIONRATE] = cf_mupa.cfCalculateCorrelationsAsFunctionOfInteractionRate && mupa.fCalculateCorrelations; + mupa.fCalculateCorrelationsAsFunctionOf[AFO_CURRENTRUNDURATION] = cf_mupa.cfCalculateCorrelationsAsFunctionOfCurrentRunDuration && mupa.fCalculateCorrelations; // *) Test0: t0.fCalculateTest0 = cf_t0.cfCalculateTest0; - t0.fCalculateTest0AsFunctionOf[AFO_INTEGRATED] = cf_t0.cfCalculateTest0AsFunctionOfIntegrated; - t0.fCalculateTest0AsFunctionOf[AFO_MULTIPLICITY] = cf_t0.cfCalculateTest0AsFunctionOfMultiplicity; - t0.fCalculateTest0AsFunctionOf[AFO_CENTRALITY] = cf_t0.cfCalculateTest0AsFunctionOfCentrality; - t0.fCalculateTest0AsFunctionOf[AFO_PT] = cf_t0.cfCalculateTest0AsFunctionOfPt; - t0.fCalculateTest0AsFunctionOf[AFO_ETA] = cf_t0.cfCalculateTest0AsFunctionOfEta; - t0.fCalculateTest0AsFunctionOf[AFO_OCCUPANCY] = cf_t0.cfCalculateTest0AsFunctionOfOccupancy; - t0.fCalculateTest0AsFunctionOf[AFO_INTERACTIONRATE] = cf_t0.cfCalculateTest0AsFunctionOfInteractionRate; - t0.fCalculateTest0AsFunctionOf[AFO_CURRENTRUNDURATION] = cf_t0.cfCalculateTest0AsFunctionOfCurrentRunDuration; - t0.fFileWithLabels = TString(cf_t0.cfFileWithLabels); - t0.fUseDefaultLabels = cf_t0.cfUseDefaultLabels; - t0.fWhichDefaultLabels = TString(cf_t0.cfWhichDefaultLabels); + t0.fCalculateTest0AsFunctionOf[AFO_INTEGRATED] = cf_t0.cfCalculateTest0AsFunctionOfIntegrated && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_MULTIPLICITY] = cf_t0.cfCalculateTest0AsFunctionOfMultiplicity && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_CENTRALITY] = cf_t0.cfCalculateTest0AsFunctionOfCentrality && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_PT] = cf_t0.cfCalculateTest0AsFunctionOfPt && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_ETA] = cf_t0.cfCalculateTest0AsFunctionOfEta && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_OCCUPANCY] = cf_t0.cfCalculateTest0AsFunctionOfOccupancy && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_INTERACTIONRATE] = cf_t0.cfCalculateTest0AsFunctionOfInteractionRate && t0.fCalculateTest0; + t0.fCalculateTest0AsFunctionOf[AFO_CURRENTRUNDURATION] = cf_t0.cfCalculateTest0AsFunctionOfCurrentRunDuration && t0.fCalculateTest0; + if (t0.fCalculateTest0) { + t0.fFileWithLabels = TString(cf_t0.cfFileWithLabels); + t0.fUseDefaultLabels = cf_t0.cfUseDefaultLabels; + t0.fWhichDefaultLabels = TString(cf_t0.cfWhichDefaultLabels); + } // *) Particle weights: pw.fUseWeights[wPHI] = cf_pw.cfUsePhiWeights; @@ -561,6 +563,43 @@ void DefaultConfiguration() } } + // ** Eta separations: + es.fCalculateEtaSeparations = cf_es.cfCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_INTEGRATED] = cf_es.cfCalculateEtaSeparationsAsFunctionOfIntegrated && es.fCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_MULTIPLICITY] = cf_es.cfCalculateEtaSeparationsAsFunctionOfMultiplicity && es.fCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_CENTRALITY] = cf_es.cfCalculateEtaSeparationsAsFunctionOfCentrality && es.fCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT] = cf_es.cfCalculateEtaSeparationsAsFunctionOfPt && es.fCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_ETA] = false; // this one doesn't make sense in this context, obviously + es.fCalculateEtaSeparationsAsFunctionOf[AFO_OCCUPANCY] = cf_es.cfCalculateEtaSeparationsAsFunctionOfOccupancy && es.fCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_INTERACTIONRATE] = cf_es.cfCalculateEtaSeparationsAsFunctionOfInteractionRate && es.fCalculateEtaSeparations; + es.fCalculateEtaSeparationsAsFunctionOf[AFO_CURRENTRUNDURATION] = cf_es.cfCalculateEtaSeparationsAsFunctionOfCurrentRunDuration && es.fCalculateEtaSeparations; + + if (es.fCalculateEtaSeparations) { + auto lEtaSeparationsValues = cf_es.cfEtaSeparationsValues.value; + if (lEtaSeparationsValues.size() != gMaxNumberEtaSeparations) { + LOGF(info, "\033[1;31m%s at line %d : lEtaSeparationsValues.size() = %d\n \033[0m", __FUNCTION__, __LINE__, lEtaSeparationsValues.size()); + LOGF(fatal, "\033[1;31m%s at line %d : Provide in configurable cfEtaSeparationsValues precisely %d entries\n \033[0m", __FUNCTION__, __LINE__, static_cast(gMaxNumberEtaSeparations)); + } + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + if (lEtaSeparationsValues[e] < 0.) { + LOGF(fatal, "\033[1;31m%s at line %d : lEtaSeparationsValues[%d] = %f is not >= 0. \n \033[0m", __FUNCTION__, __LINE__, e, static_cast(lEtaSeparationsValues[e])); + } + es.fEtaSeparationsValues[e] = lEtaSeparationsValues[e]; + } + + auto lEtaSeparationsSkipHarmonics = cf_es.cfEtaSeparationsSkipHarmonics.value; + if (lEtaSeparationsSkipHarmonics.size() != gMaxHarmonic) { + LOGF(info, "\033[1;31m lEtaSeparationsSkipHarmonics.size() = %d\033[0m", lEtaSeparationsSkipHarmonics.size()); + LOGF(info, "\033[1;31m gMaxHarmonic) = %d\033[0m", static_cast(gMaxHarmonic)); + LOGF(fatal, "\033[1;31m%s at line %d : Mismatch in the number of flags in configurable cfEtaSeparationsSkipHarmonics, and max number of supported harmonics \n \033[0m", __FUNCTION__, __LINE__); + } + + for (Int_t h = 0; h < static_cast(lEtaSeparationsSkipHarmonics.size()); h++) { + es.fEtaSeparationsSkipHarmonics[h] = Alright(lEtaSeparationsSkipHarmonics[h]); + } + + } // if(es.fCalculateEtaSeparations) { + if (tc.fVerbose) { ExitFunction(__FUNCTION__); } @@ -1641,9 +1680,14 @@ void InsanityChecksBeforeBooking() // a) Insanity checks on configuration: + // **) Dry run and internal validation are not meant to be run together: + if (tc.fDryRun && iv.fUseInternalValidation) { + LOGF(fatal, "\033[1;31m%s at line %d : Dry run and internal validation are not meant to be run together\033[0m", __FUNCTION__, __LINE__); + } + // **) Cannot calculate multiparticle correlations, in case Q-vectors are not filled: if (mupa.fCalculateCorrelations && !qv.fCalculateQvectors) { - LOGF(fatal, "\033[1;31m%s at line %d : Cannot calculate multiparticle correlations, in case Q-vectors are not filled \033[0m", __FUNCTION__, __LINE__); + LOGF(fatal, "\033[1;31m%s at line %d : Cannot calculate multiparticle correlations, in case Q-vectors are not calculated \033[0m", __FUNCTION__, __LINE__); } // **) If some differential "correlations" flag is set to true, but the main fCalculateCorrelations is false, only print the warning that that differential correlations won't be calculated. @@ -1869,14 +1913,6 @@ void InsanityChecksBeforeBooking() LOGF(fatal, "\033[1;31m%s at line %d : iv.fnEventsInternalValidation <= 0 => Set number of events to positive integer\033[0m", __FUNCTION__, __LINE__); } - if (pw.fUseWeights[wPHI] || pw.fUseWeights[wPT] || pw.fUseWeights[wETA]) { - LOGF(fatal, "\033[1;31m%s at line %d : integrated weights are not supported (yet) for internal validation. \033[0m", __FUNCTION__, __LINE__); - } - - if (pw.fUseDiffWeights[wPHIPT] || pw.fUseDiffWeights[wPHIETA]) { - LOGF(fatal, "\033[1;31m%s at line %d : differential weights are not supported (yet) for internal validation. \033[0m", __FUNCTION__, __LINE__); - } - if (iv.fRescaleWithTheoreticalInput && (nl.fCalculateNestedLoops || nl.fCalculateCustomNestedLoops || nl.fCalculateKineCustomNestedLoops)) { LOGF(fatal, "\033[1;31m%s at line %d : rescaling with theoretical input is not supported when cross-check is done with nested loops. \033[0m", __FUNCTION__, __LINE__); } @@ -2011,6 +2047,7 @@ void BookAndNestAllLists() // *) Toy NUA; // *) Internal validation; // *) Test0; + // *) Eta separations; // *) Results. if (tc.fVerbose) { @@ -2095,6 +2132,12 @@ void BookAndNestAllLists() t0.fTest0List->SetOwner(kTRUE); fBaseList->Add(t0.fTest0List); + // *) Eta separations: + es.fEtaSeparationsList = new TList(); + es.fEtaSeparationsList->SetName("EtaSeparations"); + es.fEtaSeparationsList->SetOwner(kTRUE); + fBaseList->Add(es.fEtaSeparationsList); + // *) Results: res.fResultsList = new TList(); res.fResultsList->SetName("Results"); @@ -2155,10 +2198,7 @@ void BookQAHistograms() qa.fQAList->Add(qa.fQAHistogramsPro); // b) Common local variables: - TString srs[2] = {"rec", "sim"}; - TString srs_long[2] = {"reconstructed", "simulated"}; - TString sba[2] = {"before", "after"}; - TString sba_long[2] = {"before cuts", "after cuts"}; + // ... // c) Book specific QA 2D event histograms: // Binning of 2D event histos: TBI 20240503 see if you can automate all this @@ -2421,8 +2461,8 @@ void BookQAHistograms() } qa.fQAEventHistograms2D[t][rs][ba] = new TH2F( - Form("fQAEventHistograms2D[%s][%s][%s]", qa.fEventHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) + Form("fQAEventHistograms2D[%s][%s][%s]", qa.fEventHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) nBins_x_Event[t], min_x_Event[t], max_x_Event[t], nBins_y_Event[t], min_y_Event[t], max_y_Event[t]); qa.fQAEventHistograms2D[t][rs][ba]->GetXaxis()->SetTitle(title_x_Event[t].Data()); qa.fQAEventHistograms2D[t][rs][ba]->GetYaxis()->SetTitle(title_y_Event[t].Data()); @@ -2485,8 +2525,8 @@ void BookQAHistograms() for (Int_t ba = 0; ba < 2; ba++) // before/after cuts { qa.fQAParticleHistograms2D[t][rs][ba] = new TH2F( - Form("fQAParticleHistograms2D[%s][%s][%s]", qa.fParticleHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) + Form("fQAParticleHistograms2D[%s][%s][%s]", qa.fParticleHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) nBins_x_Particle[t], min_x_Particle[t], max_x_Particle[t], nBins_y_Particle[t], min_y_Particle[t], max_y_Particle[t]); qa.fQAParticleHistograms2D[t][rs][ba]->GetXaxis()->SetTitle(title_x_Particle[t].Data()); @@ -2530,10 +2570,7 @@ void BookEventHistograms() eh.fEventHistogramsList->Add(eh.fEventHistogramsPro); // b) Book specific control event histograms 1D: - TString srs[2] = {"rec", "sim"}; - TString srs_long[2] = {"reconstructed", "simulated"}; - TString sba[2] = {"before", "after"}; - TString sba_long[2] = {"before cuts", "after cuts"}; + // ... for (Int_t t = 0; t < eEventHistograms_N; t++) // type, see enum eEventHistograms { @@ -2556,8 +2593,8 @@ void BookEventHistograms() continue; } eh.fEventHistograms[t][rs][ba] = new TH1F( - Form("fEventHistograms[%s][%s][%s]", eh.fEventHistogramsName[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) + Form("fEventHistograms[%s][%s][%s]", eh.fEventHistogramsName[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) static_cast(eh.fEventHistogramsBins[t][0]), eh.fEventHistogramsBins[t][1], eh.fEventHistogramsBins[t][2]); eh.fEventHistograms[t][rs][ba]->GetXaxis()->SetTitle(FancyFormatting(eh.fEventHistogramsName[t].Data())); @@ -2611,10 +2648,7 @@ void BookEventCutsHistograms() } // c) Book event cut counter histograms: - TString srs[2] = {"rec", "sim"}; - TString srs_long[2] = {"reconstructed", "simulated"}; - TString scc[eCutCounter_N] = {"abs", "seq"}; - TString scc_long[eCutCounter_N] = {"absolute", "sequential"}; + // ... for (Int_t rs = 0; rs < 2; rs++) // reco/sim { @@ -2622,22 +2656,22 @@ void BookEventCutsHistograms() continue; } - for (Int_t cc = 0; cc < eCutCounter_N; cc++) // enum eCutCounter + for (Int_t cuco = 0; cuco < eCutCounter_N; cuco++) // cut counter. I have to use "cuco", because "cc." is already reserved for struct "common cosmetics" { - if ((!ec.fUseEventCutCounterAbsolute && cc == eAbsolute) || (!ec.fUseEventCutCounterSequential && cc == eSequential)) { + if ((!ec.fUseEventCutCounterAbsolute && cuco == eAbsolute) || (!ec.fUseEventCutCounterSequential && cuco == eSequential)) { continue; } - ec.fEventCutCounterHist[rs][cc] = new TH1I(Form("fEventCutCounterHist[%s][%s]", srs[rs].Data(), scc[cc].Data()), Form("%s, %s, event cut counter (%s)", "__RUN_NUMBER__", srs_long[rs].Data(), scc_long[cc].Data()), eEventCuts_N, 0.5, static_cast(eEventCuts_N) + 0.5); // I cast in double the last argument, because that's what this particular TH1I constructor expects - // Yes, +0.5, because eEventCuts kicks off from 0 - ec.fEventCutCounterHist[rs][cc]->SetStats(kFALSE); - ec.fEventCutCounterHist[rs][cc]->SetLineColor(eColor); - ec.fEventCutCounterHist[rs][cc]->SetFillColor(eFillColor); + ec.fEventCutCounterHist[rs][cuco] = new TH1I(Form("fEventCutCounterHist[%s][%s]", cc.srs[rs].Data(), cc.scc[cuco].Data()), Form("%s, %s, event cut counter (%s)", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.scc_long[cuco].Data()), eEventCuts_N, 0.5, static_cast(eEventCuts_N) + 0.5); // I cast in double the last argument, because that's what this particular TH1I constructor expects + // Yes, +0.5, because eEventCuts kicks off from 0 + ec.fEventCutCounterHist[rs][cuco]->SetStats(kFALSE); + ec.fEventCutCounterHist[rs][cuco]->SetLineColor(eColor); + ec.fEventCutCounterHist[rs][cuco]->SetFillColor(eFillColor); // Remark: Bin labels are set later in a dry call to EventCuts, to accomodate sequential event cut counting - ec.fEventCutsList->Add(ec.fEventCutCounterHist[rs][cc]); + ec.fEventCutsList->Add(ec.fEventCutCounterHist[rs][cuco]); - } // for (Int_t cc = 0; cc < eCutCounter_N; cc++) // enum eCutCounter + } // for (Int_t cuco = 0; cuco < eCutCounter_N; cuco++) // enum eCutCounter } // for (Int_t rs = 0; rs < 2; rs++) // reco/sim @@ -2673,11 +2707,7 @@ void BookParticleHistograms() ph.fParticleHistogramsList->Add(ph.fParticleHistogramsPro); // b) Book specific particle histograms 1D: - TString srs[2] = {"rec", "sim"}; - TString srs_long[2] = {"reconstructed", "simulated"}; - TString sba[2] = {"before", "after"}; - TString sba_long[2] = {"before cuts", "after cuts"}; - + // ... for (Int_t t = 0; t < eParticleHistograms_N; t++) // type, see enum eParticleHistograms { if (!ph.fBookParticleHistograms[t]) { @@ -2699,8 +2729,8 @@ void BookParticleHistograms() for (Int_t ba = 0; ba < 2; ba++) // before/after cuts { - ph.fParticleHistograms[t][rs][ba] = new TH1F(Form("fParticleHistograms[%s][%s][%s]", ph.fParticleHistogramsName[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), + ph.fParticleHistograms[t][rs][ba] = new TH1F(Form("fParticleHistograms[%s][%s][%s]", ph.fParticleHistogramsName[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), static_cast(ph.fParticleHistogramsBins[t][0]), ph.fParticleHistogramsBins[t][1], ph.fParticleHistogramsBins[t][2]); ph.fParticleHistograms[t][rs][ba]->SetLineColor(ec.fBeforeAfterColor[ba]); ph.fParticleHistograms[t][rs][ba]->SetFillColor(ec.fBeforeAfterColor[ba] - 10); @@ -2754,21 +2784,21 @@ void BookParticleHistograms() // Remark: placeholder __RUN_NUMBER__ is handled in PropagateRunNumber(...) // *) variable-length binning for phi vs pt, but only in pt axis: - ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), + ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), static_cast(ph.fParticleHistogramsBins2D[t][eX][0]), ph.fParticleHistogramsBins2D[t][eX][1], ph.fParticleHistogramsBins2D[t][eX][2], res.fResultsPro[AFO_PT]->GetXaxis()->GetXbins()->GetSize() - 1, res.fResultsPro[AFO_PT]->GetXaxis()->GetXbins()->GetArray()); // yes, x-axis of "results vs pt" hist is y-axis here for 2D. } else if (ph.fParticleHistogramsName2D[t].EqualTo("Phi_vs_Eta") && res.fUseResultsProVariableLengthBins[AFO_ETA]) { // *) variable-length binning for phi vs eta, but only in eta axis: - ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), + ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), static_cast(ph.fParticleHistogramsBins2D[t][eX][0]), ph.fParticleHistogramsBins2D[t][eX][1], ph.fParticleHistogramsBins2D[t][eX][2], res.fResultsPro[AFO_ETA]->GetXaxis()->GetXbins()->GetSize() - 1, res.fResultsPro[AFO_ETA]->GetXaxis()->GetXbins()->GetArray()); // yes, x-axis of "results vs pt" hist is y-axis here for 2D } else { // default fixed-length binning: - ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), srs[rs].Data(), sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", srs_long[rs].Data(), sba_long[ba].Data()), + ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), static_cast(ph.fParticleHistogramsBins2D[t][eX][0]), ph.fParticleHistogramsBins2D[t][eX][1], ph.fParticleHistogramsBins2D[t][eX][2], static_cast(ph.fParticleHistogramsBins2D[t][eY][0]), ph.fParticleHistogramsBins2D[t][eY][1], ph.fParticleHistogramsBins2D[t][eY][2]); } @@ -2826,11 +2856,7 @@ void BookParticleCutsHistograms() } // c) Book the particle cut counter (absolute): - TString srs[2] = {"rec", "sim"}; - TString srs_long[2] = {"reconstructed", "simulated"}; - TString scc[eCutCounter_N] = {"abs", "seq"}; - TString scc_long[eCutCounter_N] = {"absolute", "sequential"}; - + // ... for (Int_t rs = 0; rs < 2; rs++) // reco/sim { @@ -2838,23 +2864,23 @@ void BookParticleCutsHistograms() continue; } - for (Int_t cc = 0; cc < eCutCounter_N; cc++) // enum eCutCounter + for (Int_t cuco = 0; cuco < eCutCounter_N; cuco++) // cut counter. I have to use "cuco", because "cc." is already reserved for struct "common cosmetics" { - if ((!pc.fUseParticleCutCounterAbsolute && cc == eAbsolute) || (!pc.fUseParticleCutCounterSequential && cc == eSequential)) { + if ((!pc.fUseParticleCutCounterAbsolute && cuco == eAbsolute) || (!pc.fUseParticleCutCounterSequential && cuco == eSequential)) { continue; } - pc.fParticleCutCounterHist[rs][cc] = new TH1I(Form("fParticleCutCounterHist[%s][%s]", srs[rs].Data(), scc[cc].Data()), Form("%s, %s, particle cut counter (%s)", "__RUN_NUMBER__", srs_long[rs].Data(), scc_long[cc].Data()), eParticleCuts_N, 0.5, static_cast(eParticleCuts_N) + 0.5); + pc.fParticleCutCounterHist[rs][cuco] = new TH1I(Form("fParticleCutCounterHist[%s][%s]", cc.srs[rs].Data(), cc.scc[cuco].Data()), Form("%s, %s, particle cut counter (%s)", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.scc_long[cuco].Data()), eParticleCuts_N, 0.5, static_cast(eParticleCuts_N) + 0.5); // I cast in double the last argument, because that's what this particular TH1I constructor expects // Yes, +0.5, because eParticleCuts kicks off from 0 - pc.fParticleCutCounterHist[rs][cc]->SetStats(kFALSE); - pc.fParticleCutCounterHist[rs][cc]->SetLineColor(eColor); - pc.fParticleCutCounterHist[rs][cc]->SetFillColor(eFillColor); + pc.fParticleCutCounterHist[rs][cuco]->SetStats(kFALSE); + pc.fParticleCutCounterHist[rs][cuco]->SetLineColor(eColor); + pc.fParticleCutCounterHist[rs][cuco]->SetFillColor(eFillColor); // Remark: Bin labels are set later in a dry call to ParticleCuts, to accomodate sequential particle cut counting - pc.fParticleCutsList->Add(pc.fParticleCutCounterHist[rs][cc]); + pc.fParticleCutsList->Add(pc.fParticleCutCounterHist[rs][cuco]); - } // for (Int_t cc = 0; cc < eCutCounter_N; cc++) // enum eCutCounter + } // for (Int_t cuco = 0; cuco < eCutCounter_N; cuco++) // enum eCutCounter } // for (Int_t rs = 0; rs < 2; rs++) // reco/sim @@ -2880,7 +2906,8 @@ void BookQvectorHistograms() // Book all Q-vector histograms. // a) Book the profile holding flags; - // b) ... + // b) Book multiplicity distributions in A and B, for each eta separation; + // c) ... if (tc.fVerbose) { StartFunction(__FUNCTION__); @@ -2901,7 +2928,40 @@ void BookQvectorHistograms() qv.fQvectorFlagsPro->Fill(2.5, gMaxCorrelator); qv.fQvectorList->Add(qv.fQvectorFlagsPro); - // b) ... + // b) Book multiplicity distributions in A and B, for each eta separation: + TString sEtaSep[2] = {"A", "B"}; // A <=> -eta , B <=> + eta + TString sEtaSep_long[2] = {Form("%.2f < #eta <", pc.fdParticleCuts[eEta][eMin]), Form("< #eta < %.2f", pc.fdParticleCuts[eEta][eMax])}; + // yes, here I define first the part of intervals as etaCutMin < eta < "subevent boundary", and "subevent" boundary < eta < etaCutMax + // Then below in the loop, I inject for "subevent boundary" the corresponding fEtaSeparationsValues (devided by 2, becaus it's symmetric round 0) + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t rs = 0; rs < 2; rs++) { // reco/sim + if (Skip(rs)) { + continue; + } + for (Int_t ba = 0; ba < 2; ba++) { // before/after cuts + if (eBefore == ba) { + continue; // it make sense to fill these histos only for "eAfter", because Q-vectors are not filled for "eBefore" + } + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + qv.fMabDist[ab][rs][ba][e] = new TH1F(Form("fMabDist[%s][%s][%s][%d]", sEtaSep[ab].Data(), cc.srs[rs].Data(), cc.sba[ba].Data(), e), + Form("%s, %s, %s, %s", "__RUN_NUMBER__", + 0 == ab ? Form("%s -%.2f", sEtaSep_long[ab].Data(), es.fEtaSeparationsValues[e] / 2.) : Form("%.2f %s", es.fEtaSeparationsValues[e] / 2., sEtaSep_long[ab].Data()), cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), + static_cast(eh.fEventHistogramsBins[eMultiplicity][0]), eh.fEventHistogramsBins[eMultiplicity][1], eh.fEventHistogramsBins[eMultiplicity][2]); // TBI 20241207 I have hardwired in this constructor "0 == ab", this can backfire... + qv.fMabDist[ab][rs][ba][e]->SetLineColor(ec.fBeforeAfterColor[ba]); + qv.fMabDist[ab][rs][ba][e]->SetFillColor(ec.fBeforeAfterColor[ba] - 10); + qv.fMabDist[ab][rs][ba][e]->GetXaxis()->SetTitle("subevent multiplicity (sum of particle weights)"); + qv.fMabDist[ab][rs][ba][e]->SetMinimum(1.e-4); // so that I can switch to log scale, even if some bins are empty + // Remark: For empty histograms, when plotting interactively, because of this line, I will get + // E-TCanvas::Range: illegal world coordinates range .... + // But it's harmless, because in any case I do not care about the content of empty histogram... + qv.fMabDist[ab][rs][ba][e]->SetOption("hist"); // do not plot marker and error (see BanishmentLoopOverParticles why errors are not reliable) for each bin, only content + filled area. + qv.fQvectorList->Add(qv.fMabDist[ab][rs][ba][e]); + } + } + } + } + + // c) ... if (tc.fVerbose) { ExitFunction(__FUNCTION__); @@ -3507,6 +3567,8 @@ void InternalValidation() // To do: // 20231114 Do I need to add support for diff. weights also here? + // *) Set and propagate some fake run number; + // *) Fetch the weights for this particular run number. Do it only once; // a) Fourier like p.d.f. for azimuthal angles and flow amplitudes; // b) Loop over on-the-fly events. // b0) Reset ebye quantities; @@ -3521,6 +3583,19 @@ void InternalValidation() StartFunction(__FUNCTION__); } + // *) Set and propagate some fake run number: + tc.fRunNumber = "123456"; + PropagateRunNumber(); + + // *) Fetch the weights for this particular run number. Do it only once. + // TBI 20231012 If eventualy I can access programatically run number in init(...) at run time, this shall go there. + if (!pw.fParticleWeightsAreFetched) { + if (pw.fUseWeights[wPHI] || pw.fUseWeights[wPT] || pw.fUseWeights[wETA] || pw.fUseDiffWeights[wPHIPT] || pw.fUseDiffWeights[wPHIETA]) { + GetParticleWeights(); + pw.fParticleWeightsAreFetched = kTRUE; + } + } + // a) Fourier like p.d.f. for azimuthal angles and flow amplitudes: TF1* fPhiPDF = NULL; TF3* fvnPDF = NULL; @@ -3635,11 +3710,12 @@ void InternalValidation() dPhi = fPhiPDF->GetRandom(); // *) To increase performance, sample pt or eta only if requested: - if (mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] || t0.fCalculateTest0AsFunctionOf[AFO_PT]) { + if (mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] || t0.fCalculateTest0AsFunctionOf[AFO_PT] || es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT]) { dPt = gRandom->Uniform(dPt_min, dPt_max); } - if (mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] || t0.fCalculateTest0AsFunctionOf[AFO_ETA]) { + if (mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] || t0.fCalculateTest0AsFunctionOf[AFO_ETA] || es.fCalculateEtaSeparations) { + // Yes, I have to use here es.fCalculateEtaSeparations , and not some differential flag, like for pt case above dEta = gRandom->Uniform(dEta_min, dEta_max); } @@ -3679,16 +3755,25 @@ void InternalValidation() !ph.fParticleHistograms2D[ePhiEta][eSim][eAfter] ? true : ph.fParticleHistograms2D[ePhiEta][eSim][eAfter]->Fill(dPhi, dEta); } + // Remark: Keep in sync all calls and flags below with the ones in MainLoopOverParticles(). // *) Integrated Q-vectors: - if (qv.fCalculateQvectors) { + if (qv.fCalculateQvectors || es.fCalculateEtaSeparations) { this->FillQvector(dPhi, dPt, dEta); // all 3 arguments are passed by reference } // *) Differential q-vectors: - if (qv.fCalculateQvectors && (mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] || t0.fCalculateTest0AsFunctionOf[AFO_PT])) { + // **) pt-dependence: + if (qv.fCalculateQvectors && (mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] || t0.fCalculateTest0AsFunctionOf[AFO_PT]) && !es.fCalculateEtaSeparations) { + // In this branch I do not need eta separation, so the ligher call can be executed: this->Fillqvector(dPhi, dPt, PTq); // first 2 arguments are passed by reference, 3rd argument is enum + } else if (es.fCalculateEtaSeparations && es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT]) { + // In this branch I do need eta separation, so the heavier call must be executed: + // Remark: Within Fillqvector() I check again all the relevant flags. + this->Fillqvector(dPhi, dPt, PTq, dEta); // first 2 arguments and the last one are passed by reference, 3rd argument is enum. "kine" variable is the 2nd argument } + // **) eta-dependence: if (qv.fCalculateQvectors && (mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] || t0.fCalculateTest0AsFunctionOf[AFO_ETA])) { + // Remark: For eta dependence I do not consider es.fCalculateEtaSeparations, because in this context that calculation is meaningless. this->Fillqvector(dPhi, dEta, ETAq); // first 2 arguments are passed by reference, 3rd argument is enum } @@ -3720,6 +3805,12 @@ void InternalValidation() !eh.fEventHistograms[eCurrentRunDuration][eSim][eAfter] ? true : eh.fEventHistograms[eCurrentRunDuration][eSim][eAfter]->Fill(ebye.fCurrentRunDuration); } + // *) Fill subevent multiplicities: + // Remark: I can call this one only after Qa and Qb vectors are filled: + if (es.fCalculateEtaSeparations) { + FillSubeventMultiplicities(); + } + // b5) Calculate everything for selected events and particles: CalculateEverything(); @@ -3918,6 +4009,95 @@ void BookTest0Histograms() //============================================================ +void BookEtaSeparationsHistograms() +{ + // Book all eta separations histograms. + + // a) Book the profile holding flags; + // b) Book what needs to be booked; + // c) Few quick insanity checks on booking. + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // a) Book the profile holding flags: + es.fEtaSeparationsFlagsPro = new TProfile("fEtaSeparationsFlagsPro", "flags for eta separations", 1, 0., 1.); + es.fEtaSeparationsFlagsPro->SetStats(kFALSE); + es.fEtaSeparationsFlagsPro->SetLineColor(eColor); + es.fEtaSeparationsFlagsPro->SetFillColor(eFillColor); + es.fEtaSeparationsFlagsPro->GetXaxis()->SetLabelSize(0.04); + es.fEtaSeparationsFlagsPro->GetXaxis()->SetBinLabel(1, "fCalculateEtaSeparations"); + es.fEtaSeparationsFlagsPro->Fill(0.5, es.fCalculateEtaSeparations); + es.fEtaSeparationsList->Add(es.fEtaSeparationsFlagsPro); + + if (!es.fCalculateEtaSeparations) { + return; + } + + // b) Book what needs to be booked: + for (Int_t h = 0; h < gMaxHarmonic; h++) { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + for (Int_t v = 0; v < eAsFunctionOf_N; v++) { + // decide what is booked, then later valid pointer to fCorrelationsPro[k][n][v] is used as a boolean, in the standard way: + if (AFO_INTEGRATED == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_INTEGRATED]) { + continue; + } + if (AFO_MULTIPLICITY == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_MULTIPLICITY]) { + continue; + } + if (AFO_CENTRALITY == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_CENTRALITY]) { + continue; + } + if (AFO_PT == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT]) { + continue; + } + if (AFO_ETA == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_ETA]) { + continue; + } + if (AFO_OCCUPANCY == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_OCCUPANCY]) { + continue; + } + if (AFO_INTERACTIONRATE == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_INTERACTIONRATE]) { + continue; + } + if (AFO_CURRENTRUNDURATION == v && !es.fCalculateEtaSeparationsAsFunctionOf[AFO_CURRENTRUNDURATION]) { + continue; + } + + if (!res.fResultsPro[v]) { + LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); + } + + es.fEtaSeparationsPro[h][e][v] = reinterpret_cast(res.fResultsPro[v]->Clone(Form("fEtaSeparationsPro[%d][%d][%s]", h, e, res.fResultsProRawName[v].Data()))); // yes + es.fEtaSeparationsPro[h][e][v]->SetStats(kFALSE); + es.fEtaSeparationsPro[h][e][v]->Sumw2(); + es.fEtaSeparationsPro[h][e][v]->SetTitle(Form("%d -%d, |#Delta#eta| > %.2f", h + 1, h + 1, es.fEtaSeparationsValues[e])); + es.fEtaSeparationsPro[h][e][v]->GetXaxis()->SetTitle(FancyFormatting(res.fResultsProXaxisTitle[v].Data())); + es.fEtaSeparationsList->Add(es.fEtaSeparationsPro[h][e][v]); // yes, this has to be here + } // for(Int_t v=0;vGetXaxis()->GetTitle()).EqualTo("integrated")) { + LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); // ordering in enum eAsFunctionOf is not the same as in TString fResultsProXaxisTitle[eAsFunctionOf_N] + } + if (es.fEtaSeparationsPro[0][0][AFO_PT] && !TString(es.fEtaSeparationsPro[0][0][AFO_PT]->GetXaxis()->GetTitle()).EqualTo("p_{T}")) { + LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); // ordering in enum eAsFunctionOf is not the same as in TString fResultsProXaxisTitle[eAsFunctionOf_N] + } + + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // void BookEtaSeparationsHistograms() + +//============================================================ + void BookResultsHistograms() { // Book all results histograms. @@ -4252,6 +4432,24 @@ void PropagateRunNumber() } // for(Int_t rs=0;rs<2;rs++) // reco/sim } // for(Int_t t=0;t -eta , ab = 1 <=> + eta + for (Int_t rs = 0; rs < 2; rs++) { // reco/sim + for (Int_t ba = 0; ba < 2; ba++) { // before/after cuts + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + if (!qv.fMabDist[ab][rs][ba][e]) { + continue; + } + histTitle = qv.fMabDist[ab][rs][ba][e]->GetTitle(); + if (histTitle.Contains("__RUN_NUMBER__")) { + histTitle.ReplaceAll("__RUN_NUMBER__", tc.fRunNumber.Data()); // it replaces in-place + qv.fMabDist[ab][rs][ba][e]->SetTitle(histTitle.Data()); + } + } + } + } + } + if (tc.fVerbose) { ExitFunction(__FUNCTION__); } @@ -4349,6 +4547,7 @@ void ResetEventByEventQuantities() // b) Q-vectors: if (qv.fCalculateQvectors) { + // b0) generic Q-vector: ResetQ(); // b1) integrated Q-vector: @@ -4358,6 +4557,7 @@ void ResetEventByEventQuantities() qv.fQvector[h][wp] = TComplex(0., 0.); } } + // b2) diff. Q-vector: for (Int_t bin = 1; bin <= gMaxNoBinsKine; bin++) { qv.fqVectorEntries[PTq][bin - 1] = 0; // TBI 20240214 shall I loop also over enum's PTq and ETAq? If yes, fix it also below for qv.fqvector[PTq][bin - 1][... @@ -4371,6 +4571,49 @@ void ResetEventByEventQuantities() } // for (Int_t b = 0; b < gMaxNoBinsKine; b++ ) { } // if(qv.fCalculateQvectors) + // b3) integrated Q-vector needed for calculations with eta separations: + if (es.fCalculateEtaSeparations) { + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t h = 0; h < gMaxHarmonic; h++) { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + qv.fQabVector[ab][h][e] = TComplex(0., 0.); + } + } + } + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + qv.fMab[ab][e] = 0.; + } + } + } + + // b4) diff. q-vector in pt needed for calculations with eta separations: + if (es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT]) { // yes, for the time being, only as a function of pt makes sense if eta separation is used + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t bin = 1; bin <= gMaxNoBinsKine; bin++) { + for (Int_t h = 0; h < gMaxHarmonic; h++) { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + qv.fqabVector[ab][bin][h][e] = TComplex(0., 0.); + } + } + } + } + + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t bin = 1; bin <= gMaxNoBinsKine; bin++) { + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + qv.fmab[ab][bin][e] = 0.; + } + } + } + } + // c) Reset ebe containers for nested loops: if (nl.fCalculateNestedLoops || nl.fCalculateCustomNestedLoops) { if (nl.ftaNestedLoops[0]) { @@ -4990,8 +5233,8 @@ Bool_t EventCut(Int_t rs, Int_t eventCut, eCutModus cutModus) // *) Do the thing: switch (cutModus) { case eCut: - if (tc.fVerbose) { - LOGF(info, "\033[1;31mEvent didn't pass the cut: %s\033[0m", ec.fEventCutName[eventCut].Data()); + if (tc.fVerboseEventCut) { + LOGF(info, "\033[1;31mEvent didn't survive the cut: %s\033[0m", ec.fEventCutName[eventCut].Data()); } return kFALSE; break; @@ -5020,6 +5263,88 @@ Bool_t EventCut(Int_t rs, Int_t eventCut, eCutModus cutModus) //============================================================ +bool RemainingEventCuts() +{ + // Remaining event cuts which can be applied ONLY after the main loop over particles. + // For instance, cut on total number of selected particles (eMultiplicity). + // Remark #1: Whichever cut I implement here, update EventCutsCounters(...) for that cut (like I did for eMultiplicity, as a sort of template). + // Remark #2: I do not have here templated arguments like in EventCuts(), because I do not anticipate using any getter from the framework directly here. + // Remark #3: With the current implementation, I support here only eCutCounterSequential, i.e. eCutCounterAbsolute is not supported for cuts applied here. + + // a) Determine if this function was called for generic rec or generic sim: + // *) eMultiplicity; + // ... + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // a) Determine if this function was called for generic rec or generic sim: + // Remark: I can do it in this simplified way, because I do not anticipate I will call here any getters from the framework. + int rs = -1; + if (tc.fProcess[eGenericRec] || tc.fProcess[eGenericRecSim]) { + rs = eRec; // yes, I do not count in RecSim mode separately particles and rec and sim level which survived particle cuts + } else if (tc.fProcess[eGenericSim]) { + rs = eSim; + } + + // *) Multiplicity: (see documentation for ebye.fMultiplicity for its definition) + if (ec.fUseEventCuts[eMultiplicity]) { + if (ebye.fMultiplicity < ec.fdEventCuts[eMultiplicity][eMin] || ebye.fMultiplicity > ec.fdEventCuts[eMultiplicity][eMax] || TMath::Abs(ebye.fMultiplicity - ec.fdEventCuts[eMultiplicity][eMax]) < tc.fFloatingPointPrecision) { + // Remark: I have to implement RemainingEventCuts() in a slightly different way as EventCuts() + EventCut(rs, eMultiplicity, eCut); // just a printout that this event didn't survive this cut + EventCut(rs, eMultiplicity, eCutCounterSequential); + return kFALSE; + } + } + + return kTRUE; + +} // bool RemainingEventCuts() + +//============================================================ + +template +void FillSubeventMultiplicities() +{ + // Fill subevent (defined via eta separation) multiplicities. + + // a) Fill reconstructed (common to Run 3, Run 2 and Run 1 + Test mode); + // b) Fill only simulated (common to Run 3, Run 2 and Run 1). + + // Remark: This function has to be called after Q-vectors are filled. It makes sense to fill these histograms only for "eAfter", + // becase Q-vectors are not filled before the event cuts. + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // a) Fill reconstructed (common to Run 3, Run 2 and Run 1 + Test mode): + if constexpr (rs == eRec || rs == eRecAndSim || rs == eRec_Run2 || rs == eRecAndSim_Run2 || rs == eRec_Run1 || rs == eRecAndSim_Run1 || rs == eTest) { + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + !qv.fMabDist[ab][eRec][eAfter][e] ? true : qv.fMabDist[ab][eRec][eAfter][e]->Fill(qv.fMab[ab][e]); + } + } + } + + // b) Fill only simulated (common to Run 3, Run 2 and Run 1): + if constexpr (rs == eSim || rs == eSim_Run2 || rs == eSim_Run1) { + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + !qv.fMabDist[ab][eSim][eAfter][e] ? true : qv.fMabDist[ab][eSim][eAfter][e]->Fill(qv.fMab[ab][e]); + } + } + } + + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // void FillSubeventMultiplicities() + +//============================================================ + template void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) { @@ -5052,6 +5377,7 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) !eh.fEventHistograms[eReferenceMultiplicity][eRec][ba] ? true : eh.fEventHistograms[eReferenceMultiplicity][eRec][ba]->Fill(ebye.fReferenceMultiplicity); !eh.fEventHistograms[eCentrality][eRec][ba] ? true : eh.fEventHistograms[eCentrality][eRec][ba]->Fill(ebye.fCentrality); } + // QA: if (qa.fFillQAEventHistograms2D) { !qa.fQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity][eRec][ba] ? true : qa.fQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity][eRec][ba]->Fill(ebye.fMultiplicity, ebye.fReferenceMultiplicity); @@ -5099,6 +5425,15 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) // eh.fEventHistograms[eReferenceMultiplicity][eSim][ba]->Fill(ebye.fReferenceMultiplicity); // TBI 20241123 this case is still not supported in DetermineReferenceMultiplicity() // eh.fEventHistograms[eTotalMultiplicity][eSim][ba]->Fill(tracks.size()); // TBI 20231030 check further how to use the same thing for 'sim' } + + // Eta separations: + if (es.fCalculateEtaSeparations) { + for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + !qv.fMabDist[ab][eSim][ba][e] ? true : qv.fMabDist[ab][eSim][ba][e]->Fill(qv.fMab[ab][e]); + } + } + } } // ----------------------------------------------------------------------------- @@ -7121,7 +7456,166 @@ void CalculateKineTest0(eAsFunctionOf AFO_variable) ExitFunction(__FUNCTION__); } -} // CalculateKineTest0(const char* kc) +} // CalculateKineTest0(eAsFunctionOf AFO_variable) + +//============================================================ + +void CalculateEtaSeparations() +{ + // Calculate correlations with pseudorapidity separations. + + // Remark: this is a port and generalization of void AliFlowAnalysisWithMultiparticleCorrelations::CalculateEtaGaps(AliFlowEventSimple *anEvent) + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // Calculate 2-p correlations with eta separations from Qa (-eta, index [0]) and Qb (+eta, index [1]) vectors: + Double_t correlation = 0.; + Double_t weight = 0.; + for (Int_t h = 0; h < gMaxHarmonic; h++) { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + if (!(qv.fQabVector[0][h][e].Rho() > 0. && qv.fQabVector[1][h][e].Rho() > 0.)) { + continue; + } + if (!(qv.fMab[0][e] > 0. && qv.fMab[1][e] > 0.)) { + continue; + } + + // calculate correlation and weights with particular eta separation: + correlation = TComplex(qv.fQabVector[0][h][e] * TComplex::Conjugate(qv.fQabVector[1][h][e])).Re(); + weight = qv.fMab[0][e] * qv.fMab[1][e]; + + // for on-the-fly and internal validation, rescale results with theoretical value: + if (iv.fUseInternalValidation && iv.fRescaleWithTheoreticalInput && iv.fInternalValidationVnPsin[eVn] && TMath::Abs(iv.fInternalValidationVnPsin[eVn]->GetAt(h)) > 0.) { + correlation /= pow(iv.fInternalValidationVnPsin[eVn]->GetAt(h), 2.); + } + + // integrated: + if (es.fEtaSeparationsPro[h][e][AFO_INTEGRATED]) { + es.fEtaSeparationsPro[h][e][AFO_INTEGRATED]->Fill(0.5, correlation / weight, weight); + } + + // vs. multiplicity: + if (es.fEtaSeparationsPro[h][e][AFO_MULTIPLICITY]) { + es.fEtaSeparationsPro[h][e][AFO_MULTIPLICITY]->Fill(ebye.fMultiplicity + 0.5, correlation / weight, weight); + } + + // vs. centrality: + if (es.fEtaSeparationsPro[h][e][AFO_CENTRALITY]) { + es.fEtaSeparationsPro[h][e][AFO_CENTRALITY]->Fill(ebye.fCentrality, correlation / weight, weight); + } + + // vs. occupancy: + if (es.fEtaSeparationsPro[h][e][AFO_OCCUPANCY]) { + es.fEtaSeparationsPro[h][e][AFO_OCCUPANCY]->Fill(ebye.fOccupancy, correlation / weight, weight); + } + + // vs. interaction rate: + if (es.fEtaSeparationsPro[h][e][AFO_INTERACTIONRATE]) { + es.fEtaSeparationsPro[h][e][AFO_INTERACTIONRATE]->Fill(ebye.fInteractionRate, correlation / weight, weight); + } + + // vs. current run duration: + if (es.fEtaSeparationsPro[h][e][AFO_CURRENTRUNDURATION]) { + es.fEtaSeparationsPro[h][e][AFO_CURRENTRUNDURATION]->Fill(ebye.fCurrentRunDuration, correlation / weight, weight); + } + + } // for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + } // for (Int_t h = 0; h < gMaxHarmonic; h++) { + + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // void CalculateEtaSeparations() + +//============================================================ + +void CalculateKineEtaSeparations(eAsFunctionOf AFO_variable) +{ + // Calculate differential correlations with pseudorapidity separations. + + if (tc.fVerbose) { + StartFunction(__FUNCTION__); + } + + // *) ... + eqvectorKine qvKine = eqvectorKine_N; // which eqvectorKine enum + Int_t nBins = -1; + + switch (AFO_variable) { + case AFO_PT: + qvKine = PTq; + nBins = res.fResultsPro[AFO_PT]->GetNbinsX(); + break; + case AFO_ETA: + LOGF(fatal, "\033[1;31m%s at line %d : It doesn't make sense (i.e. AFO_ETA cannot be used here). \033[0m", __FUNCTION__, __LINE__, static_cast(AFO_variable)); + break; // obsolete, but it supresses the warning + default: + LOGF(fatal, "\033[1;31m%s at line %d : This AFO_variable = %d is not supported yet. \033[0m", __FUNCTION__, __LINE__, static_cast(AFO_variable)); + break; + } // switch(AFO_variable) + + // *) Insanity checks on above settings: + if (qvKine == eqvectorKine_N) { + LOGF(fatal, "\033[1;31m%s at line %d : qvKine == eqvectorKine_N => add some more entries to the case statement \033[0m", __FUNCTION__, __LINE__); + } + + // *) Uniform loop over bin for all kine variables: + for (Int_t b = 0; b < nBins; b++) { + + /* TBI 20241206 Do I need to adapt and apply this cut, also for Qa and Qb? If so, most likely I would need to apply it on sum, i.e. on entries in Qa + Qb + + // *) Ensures that in each bin of interest, I have the same cut on number of particles, like in integrated analysis: + if ((qv.fqVectorEntries[qvKine][b] < ec.fdEventCuts[eMultiplicity][eMin]) || (qv.fqVectorEntries[qvKine][b] > ec.fdEventCuts[eMultiplicity][eMax] || TMath::Abs(qv.fqVectorEntries[qvKine][b] - ec.fdEventCuts[eMultiplicity][eMax]) < tc.fFloatingPointPrecision)) { + if (tc.fVerbose) { + LOGF(info, "\033[1;31m%s eMultiplicity cut in bin = %d, for qvKine = %d\033[0m", __FUNCTION__, b, static_cast(qvKine)); + } + } + */ + + // Calculate differential 2-p correlations with eta separations from Qa (-eta, index [0]) and Qb (+eta, index [1]) vectors: + Double_t correlation = 0.; + Double_t weight = 0.; + for (Int_t h = 0; h < gMaxHarmonic; h++) { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + if (!(qv.fqabVector[0][b][h][e].Rho() > 0. && qv.fqabVector[1][b][h][e].Rho() > 0.)) { + continue; + } + if (!(qv.fmab[0][b][e] > 0. && qv.fmab[1][b][e] > 0.)) { + continue; + } + + // calculate correlation and weights with particular eta separation: + correlation = TComplex(qv.fqabVector[0][b][h][e] * TComplex::Conjugate(qv.fqabVector[1][b][h][e])).Re(); + weight = qv.fmab[0][b][e] * qv.fmab[1][b][e]; + + // for on-the-fly and internal validation, rescale results with theoretical value: + if (iv.fUseInternalValidation && iv.fRescaleWithTheoreticalInput && iv.fInternalValidationVnPsin[eVn] && TMath::Abs(iv.fInternalValidationVnPsin[eVn]->GetAt(h)) > 0.) { + correlation /= pow(iv.fInternalValidationVnPsin[eVn]->GetAt(h), 2.); + } + + // finally, fill: + if (es.fEtaSeparationsPro[h][e][AFO_variable]) { + es.fEtaSeparationsPro[h][e][AFO_variable]->Fill(es.fEtaSeparationsPro[h][e][AFO_variable]->GetXaxis()->GetBinCenter(b + 1), correlation / weight, weight); + } + } + } + } // for (Int_t b = 0; b < nBins; b++) { + + if (tc.fVerbose) { + ExitFunction(__FUNCTION__); + } + +} // void CalculateKineEtaSeparations() //============================================================ @@ -7536,7 +8030,7 @@ void ComparisonNestedLoopsVsCorrelations() } } // if(TMath::Abs(valueQV)>0. && TMath::Abs(valueNL)>0.) } // for(Int_t b=1;b<=nBinsQV;b++) - } // for(Int_t h=0;h<6;h++) + } // for (Int_t h = 0; h < gMaxHarmonic; h++) { LOGF(info, ""); // new line } // for(Int_t o=0;o<4;o++) } // for (Int_t v = 0; v < 3; v++) @@ -8103,7 +8597,8 @@ TH1D* GetHistogramWithWeights(const char* filePath, const char* runNumber, const runNumberWithLeadingZeroes += runNumber; // another try, with "000" prepended to run number listWithRuns = reinterpret_cast(GetObjectFromList(baseList, runNumberWithLeadingZeroes.Data())); if (!listWithRuns) { - LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); + // baseList->ls(); + LOGF(fatal, "\033[1;31m%s at line %d : this crash can happen if in the output file there is no list with weights for the current run number = %s\033[0m", __FUNCTION__, __LINE__, tc.fRunNumber.Data()); } } @@ -8182,7 +8677,7 @@ TH1D* GetHistogramWithWeights(const char* filePath, const char* runNumber, const LOGF(fatal, "\033[1;33m min = %f, max = %f, res.fResultsPro[AFO]->GetName() = %s\033[0m", min, max, res.fResultsPro[AFO]->GetName()); } - // Compare with min and max value store in external weights.root file using MakeWeights.C: + // Compare with min and max value stored in external weights.root file using MakeWeights.C: if (!(TMath::Abs(TString(oa->At(nEntries - 1)->GetName()).Atof() - max) < tc.fFloatingPointPrecision)) { LOGF(info, "\033[1;33m hist->GetTitle() = %s, res.fResultsPro[AFO]->GetName() = %s\033[0m", hist->GetTitle(), res.fResultsPro[AFO]->GetName()); LOGF(fatal, "in function \033[1;31m%s at line %d : mismatch in upper bin boundaries \n from title = %f , local = %f\033[0m", __FUNCTION__, __LINE__, TString(oa->At(nEntries - 1)->GetName()).Atof(), max); @@ -10251,7 +10746,7 @@ void RandomIndices(Int_t nTracks) template void BanishmentLoopOverParticles(T const& tracks) { - // This is the quick banishment loop over particles, as a support for eSelectedTracks cut. + // This is the quick banishment loop over particles, as a support for eSelectedTracks cut (used through eMultiplicity, see comments for ebye.fMultiplicity). // This is particularly relevant to get all efficiency corrections right. // The underlying problem is that particle histograms got filled before eSelectedTracks could be applied in Steer. // Therefore, particle histograms got filled even for events which were rejected by eSelectedTracks cut. @@ -10275,7 +10770,7 @@ void BanishmentLoopOverParticles(T const& tracks) } // *) Counter of selected tracks in the current event: - Int_t lSelectedTracks = 0; // I could reset and reuse here ebye.fSelectedTracks, but it's safer to use separate local variable, as I can did additional insanity checks here + Int_t lSelectedTracks = 0; // I could reset and reuse here ebye.fSelectedTracks, but it's safer to use separate local variable, as I can do additional insanity checks here // *) Banishment loop over particles: // for (auto& track : tracks) { // default standard way of looping of tracks @@ -10303,18 +10798,21 @@ void BanishmentLoopOverParticles(T const& tracks) // } // *) Particle cuts: - if (!ParticleCuts(track, eCut)) { // Main call for event cuts. + if (!ParticleCuts(track, eCut)) { // Main call for particle cuts. continue; // not return!! } - // *) Increase the local selected particle counter: - lSelectedTracks++; - // *) Banish particle histograms after particle cuts: if (ph.fFillParticleHistograms || ph.fFillParticleHistograms2D || qa.fFillQAParticleHistograms2D) { FillParticleHistograms(track, eAfter, -1); // with negative weight -1, I effectively remove the previous fill for this track } + // *) Increase the local selected particle counter: + lSelectedTracks++; + if (lSelectedTracks >= ec.fdEventCuts[eMultiplicity][eMax]) { + break; + } + // *) Break the loop if fixed number of particles is taken randomly from each event (use always in combination with tc.fUseFisherYates = kTRUE): if (tc.fFixedNumberOfRandomlySelectedTracks > 0 && tc.fFixedNumberOfRandomlySelectedTracks == lSelectedTracks) { LOGF(info, "%s : Breaking the loop over particles, since requested fixed number of %d particles was reached", __FUNCTION__, tc.fFixedNumberOfRandomlySelectedTracks); @@ -10478,6 +10976,7 @@ void BailOut(Bool_t finalBailout = kFALSE) bailOutList->Add(nua.fNUAList); bailOutList->Add(iv.fInternalValidationList); bailOutList->Add(t0.fTest0List); + bailOutList->Add(es.fEtaSeparationsList); bailOutList->Add(res.fResultsList); // *) Add list with nested list to TDirectoryFile: @@ -10563,6 +11062,36 @@ void FillQvector(const Double_t& dPhi, const Double_t& dPt, const Double_t& dEta } // for(Int_t h=0;h 0.) { + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + if (dEta > es.fEtaSeparationsValues[e] / 2.) { // yes, if eta separation is 0.2, then separation interval runs from -0.1 to 0.1 + qv.fMab[1][e] += wPhi * wPt * wEta; + for (Int_t h = 0; h < gMaxHarmonic; h++) { + { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + qv.fQabVector[1][h][e] += TComplex(wPhi * wPt * wEta * TMath::Cos((h + 1) * dPhi), wPhi * wPt * wEta * TMath::Sin((h + 1) * dPhi)); + } + } // for (Int_t h = 0; h < gMaxHarmonic; h++) { + } // for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + } + } + } // if(es.fCalculateEtaSeparations) { + if (tc.fVerboseForEachParticle) { ExitFunction(__FUNCTION__); } @@ -10571,10 +11100,11 @@ void FillQvector(const Double_t& dPhi, const Double_t& dPt, const Double_t& dEta //============================================================ -void Fillqvector(const Double_t& dPhi, const Double_t& kineVarValue, eqvectorKine kineVarChoice) +void Fillqvector(const Double_t& dPhi, const Double_t& kineVarValue, eqvectorKine kineVarChoice, const Double_t& dEta = 0.) { // Fill differential q-vector, in generic kinematic variable. Here "kine" originally meant vs. pt or vs. eta, now it's general. - // Example usage: this->Fillqvector(dPhi, dPt, PTq); + // Example usage #1: this->Fillqvector(dPhi, dPt, PTq); // differential q-vectors without using eta separations + // Example usage #2: this->Fillqvector(dPhi, dPt, PTq, dEta); // differential q-vectors with using eta separations (I need dEta of particle to decide whether particle is added to qa or qb) if (tc.fVerboseForEachParticle) { StartFunction(__FUNCTION__); @@ -10666,11 +11196,47 @@ void Fillqvector(const Double_t& dPhi, const Double_t& kineVarValue, eqvectorKin // *) Multiplicity counter in this bin: qv.fqVectorEntries[kineVarChoice][bin - 1]++; // count number of particles in this pt bin in this event + // *) Usage of eta separations in differential correlations: + if (es.fCalculateEtaSeparations && es.fCalculateEtaSeparationsAsFunctionOf[AFO_var]) { // yes, I can decouple this one from if (qv.fCalculateQvectors) + + if (AFO_var == AFO_ETA) { + LOGF(fatal, "\033[1;31m%s at line %d : AFO_var == AFO_ETA . This doesn't make any sense in this context. \033[0m", __FUNCTION__, __LINE__); + } + + if (dEta < 0.) { + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + if (dEta < -1. * es.fEtaSeparationsValues[e] / 2.) { // yes, if eta separation is 0.2, then separation interval runs from -0.1 to 0.1 + qv.fmab[0][bin - 1][e] += diffPhiWeightsForThisKineVar * kineVarWeight; // Remark: I can hardwire linear weight like this only for 2-p correlation + for (Int_t h = 0; h < gMaxHarmonic; h++) { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + qv.fqabVector[0][bin - 1][h][e] += TComplex(diffPhiWeightsForThisKineVar * kineVarWeight * TMath::Cos((h + 1) * dPhi), diffPhiWeightsForThisKineVar * kineVarWeight * TMath::Sin((h + 1) * dPhi)); // Remark: I can hardwire linear weight like this only for 2-p correlation + } + } // for (Int_t h = 0; h < gMaxHarmonic; h++) { + } // for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + } else if (dEta > 0.) { + for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { + if (dEta > es.fEtaSeparationsValues[e] / 2.) { // yes, if eta separation is 0.2, then separation interval runs from -0.1 to 0.1 + qv.fmab[1][bin - 1][e] += diffPhiWeightsForThisKineVar * kineVarWeight; // Remark: I can hardwire linear weight like this only for 2-p correlation + for (Int_t h = 0; h < gMaxHarmonic; h++) { + { + if (es.fEtaSeparationsSkipHarmonics[h]) { + continue; + } + qv.fqabVector[1][bin - 1][h][e] += TComplex(diffPhiWeightsForThisKineVar * kineVarWeight * TMath::Cos((h + 1) * dPhi), diffPhiWeightsForThisKineVar * kineVarWeight * TMath::Sin((h + 1) * dPhi)); // Remark: I can hardwire linear weight like this only for 2-p correlation + } + } // for (Int_t h = 0; h < gMaxHarmonic; h++) { + } // for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation + } + } + } // if(es.fCalculateEtaSeparations) { + if (tc.fVerboseForEachParticle) { ExitFunction(__FUNCTION__); } -} // void Fillqvector(const Double_t &dPhi, const Double_t &kineVarValue, eqvectorKine kineVarChoice) +} // void Fillqvector(const Double_t& dPhi, const Double_t& kineVarValue, eqvectorKine kineVarChoice) //============================================================ @@ -10722,6 +11288,14 @@ void CalculateEverything() } } + // *) Calculate correlations with eta separations: + if (es.fCalculateEtaSeparations) { + this->CalculateEtaSeparations(); + if (es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT]) { + this->CalculateKineEtaSeparations(AFO_PT); // The implementation of CalculateKineEtaSeparations( ... ) is generic and can be used for any other "kine" variable, for which it makes sense + } + } + if (tc.fVerbose) { ExitFunction(__FUNCTION__); } @@ -10816,16 +11390,25 @@ void MainLoopOverParticles(T const& tracks) dPt = track.pt(); dEta = track.eta(); + // Remark: Keep in sync all calls and flags below with the ones in InternalValidation(). // *) Integrated Q-vectors: - if (qv.fCalculateQvectors) { + if (qv.fCalculateQvectors || es.fCalculateEtaSeparations) { this->FillQvector(dPhi, dPt, dEta); // all 3 arguments are passed by reference } // *) Differential q-vectors: - if (qv.fCalculateQvectors && (mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] || t0.fCalculateTest0AsFunctionOf[AFO_PT])) { + // **) pt-dependence: + if (qv.fCalculateQvectors && (mupa.fCalculateCorrelationsAsFunctionOf[AFO_PT] || t0.fCalculateTest0AsFunctionOf[AFO_PT]) && !es.fCalculateEtaSeparations) { + // In this branch I do not need eta separation, so the ligher call can be executed: this->Fillqvector(dPhi, dPt, PTq); // first 2 arguments are passed by reference, 3rd argument is enum + } else if (es.fCalculateEtaSeparations && es.fCalculateEtaSeparationsAsFunctionOf[AFO_PT]) { + // In this branch I do need eta separation, so the heavier call must be executed: + // Remark: Within Fillqvector() I check again all the relevant flags. + this->Fillqvector(dPhi, dPt, PTq, dEta); // first 2 arguments and the last one are passed by reference, 3rd argument is enum. "kine" variable is the 2nd argument } + // **) eta-dependence: if (qv.fCalculateQvectors && (mupa.fCalculateCorrelationsAsFunctionOf[AFO_ETA] || t0.fCalculateTest0AsFunctionOf[AFO_ETA])) { + // Remark: For eta dependence I do not consider es.fCalculateEtaSeparations, because in this context that calculation is meaningless. this->Fillqvector(dPhi, dEta, ETAq); // first 2 arguments are passed by reference, 3rd argument is enum } @@ -10942,31 +11525,24 @@ void Steer(T1 const& collision, T2 const& bcs, T3 const& tracks) DetermineMultiplicity(); // *) Remaining event cuts which can be applied only after the loop over particles is performed: - if (ebye.fMultiplicity < ec.fdEventCuts[eMultiplicity][eMin] || ebye.fMultiplicity > ec.fdEventCuts[eMultiplicity][eMax] || TMath::Abs(ebye.fMultiplicity - ec.fdEventCuts[eMultiplicity][eMax]) < tc.fFloatingPointPrecision) { - if (tc.fVerbose) { - LOGF(info, "\033[1;31m%s eMultiplicity \033[0m", __FUNCTION__); - } - // **) Special treatment for event cut counter: - // TBI 20240514 not sure if everything is done here correctly. Do some additional validation checks, and them move all this to some dedicated member function, e.g. RemainingEventCuts() - if (tc.fProcess[eGenericRec] || tc.fProcess[eGenericRecSim]) { - EventCut(eRec, eMultiplicity, eCutCounterSequential); - } - if (tc.fProcess[eGenericSim] || tc.fProcess[eGenericRecSim]) { - EventCut(eSim, eMultiplicity, eCutCounterSequential); - } - - // TBI 20240514 Do I need to do here also something about particle cut counters? Most likely yes, but it's not that important, really - - BanishmentLoopOverParticles(tracks); // yes, I need to remove particles from ParticleHistograms, which were filled in the MainLoopOverParticles also for events < eMultiplicity + if (!RemainingEventCuts()) { + // yes, I need to remove particles from ParticleHistograms, which were filled in the MainLoopOverParticles also for events which didn't survive RemainingEventCuts + BanishmentLoopOverParticles(tracks); ResetEventByEventQuantities(); return; } - // *) Fill event histograms after event AND particle cuts: // TBI 20240110 not sure still if this one is called here, or it has to be moved above + // *) Fill event histograms after event AND particle cuts: if (eh.fFillEventHistograms || qa.fFillQAEventHistograms2D) { FillEventHistograms(collision, tracks, eAfter); } + // *) Fill subevent multiplicities: + // Remark: I can call this one only after Qa and Qb vectors are filled, and after all particle and event cuts: + if (es.fCalculateEtaSeparations) { + FillSubeventMultiplicities(); + } + // *) Calculate everything for selected events and particles: CalculateEverything(); diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx index 16ff6dae966..26bf84b0403 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx @@ -153,6 +153,7 @@ struct MultiparticleCorrelationsAB // this name is used in lower-case format to BookNUAHistograms(); BookInternalValidationHistograms(); BookTest0Histograms(); + BookEtaSeparationsHistograms(); BookTheRest(); // here I book everything that was not sorted (yet) in the specific functions above // *) Insanity checks after booking: From 7d17b5d0d4536f484e2ace3c4a12587754e5eb56 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Mon, 9 Dec 2024 00:23:03 +0100 Subject: [PATCH 283/459] [PWGCF] DptDpt - Making the corrections dimensions configurable (#8864) Co-authored-by: Victor --- PWGCF/Tasks/dptdptcorrelations.cxx | 540 +++++++++++++++-------------- 1 file changed, 281 insertions(+), 259 deletions(-) diff --git a/PWGCF/Tasks/dptdptcorrelations.cxx b/PWGCF/Tasks/dptdptcorrelations.cxx index 2d751a00db0..62e71e28e90 100644 --- a/PWGCF/Tasks/dptdptcorrelations.cxx +++ b/PWGCF/Tasks/dptdptcorrelations.cxx @@ -10,8 +10,10 @@ // or submit itself to any jurisdiction. /// \file dptdptcorrelations.cxx +/// \brief implements two-particle correlations base data collection +/// \author victor.gonzalez.sebastian@gmail.com + #include -#include #include #include #include @@ -66,6 +68,7 @@ float deltaphibinwidth = constants::math::TwoPI / deltaphibins; float deltaphilow = 0.0 - deltaphibinwidth / 2.0; float deltaphiup = constants::math::TwoPI - deltaphibinwidth / 2.0; +int nNoOfDimensions = 1; // number of dimensions for the NUA & NUE corrections bool processpairs = false; // process pairs analysis bool processmixedevents = false; // process mixed events bool ptorder = false; // consider pt ordering @@ -94,34 +97,34 @@ struct DptDptCorrelationsTask { // The DptDptCorrelationsAnalysisTask output objects //============================================================================================ /* histograms */ - TH1F* fhVertexZA; //! fhN1_vsPt{nch, nullptr}; //! fhN1_vsEtaPhi{nch, nullptr}; //! fhSum1Pt_vsEtaPhi{nch, nullptr}; //! fhN1_vsZEtaPhiPt{nch, nullptr}; //! fhSum1Pt_vsZEtaPhiPt{nch, nullptr}; //! fhNuaNue{nch, nullptr}; //! fhPtAvg_vsEtaPhi{nch, nullptr}; //!> fhN2_vsPtPt{nch, {nch, nullptr}}; //!> fhN2_vsDEtaDPhi{nch, {nch, nullptr}}; //!> fhN2cont_vsDEtaDPhi{nch, {nch, nullptr}}; //!> fhSum2PtPt_vsDEtaDPhi{nch, {nch, nullptr}}; //!> fhSum2DptDpt_vsDEtaDPhi{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs \f$\Delta\eta,\;\Delta\phi\f$ for the different species combinations - std::vector> fhSupN1N1_vsDEtaDPhi{nch, {nch, nullptr}}; //!> fhSupPt1Pt1_vsDEtaDPhi{nch, {nch, nullptr}}; //!> fhInvMassDEta{nch, {nch, nullptr}}; //!> fhInvMassDPhi{nch, {nch, nullptr}}; //! fhN1VsPt{nch, nullptr}; //! fhN1VsEtaPhi{nch, nullptr}; //! fhSum1PtVsEtaPhi{nch, nullptr}; //! fhN1VsZEtaPhiPt{nch, nullptr}; //! fhSum1PtVsZEtaPhiPt{nch, nullptr}; //! fhNuaNue{nch, nullptr}; //! fhPtAvgVsEtaPhi{nch, nullptr}; //!> fhN2VsPtPt{nch, {nch, nullptr}}; //!> fhN2VsDEtaDPhi{nch, {nch, nullptr}}; //!> fhN2contVsDEtaDPhi{nch, {nch, nullptr}}; //!> fhSum2PtPtVsDEtaDPhi{nch, {nch, nullptr}}; //!> fhSum2DptDptVsDEtaDPhi{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs \f$\Delta\eta,\;\Delta\phi\f$ for the different species combinations + std::vector> fhSupN1N1VsDEtaDPhi{nch, {nch, nullptr}}; //!> fhSupPt1Pt1VsDEtaDPhi{nch, {nch, nullptr}}; //!> fhInvMassDEta{nch, {nch, nullptr}}; //!> fhInvMassDPhi{nch, {nch, nullptr}}; //! fhN1_vsC{nch, nullptr}; //! fhSum1Pt_vsC{nch, nullptr}; //! fhN1nw_vsC{nch, nullptr}; //! fhSum1Ptnw_vsC{nch, nullptr}; //!> fhN2_vsC{nch, {nch, nullptr}}; //!> fhSum2PtPt_vsC{nch, {nch, nullptr}}; //!> fhSum2DptDpt_vsC{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs event centrality/multiplicity 1-1,1-2,2-1,2-2, combinations - std::vector> fhN2nw_vsC{nch, {nch, nullptr}}; //!> fhSum2PtPtnw_vsC{nch, {nch, nullptr}}; //!> fhSum2DptDptnw_vsC{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs \f$\Delta\eta,\;\Delta\phi\f$ distribution vs event centrality/multiplicity 1-1,1-2,2-1,2-2, combinations + std::vector fhN1VsC{nch, nullptr}; //! fhSum1PtVsC{nch, nullptr}; //! fhN1nwVsC{nch, nullptr}; //! fhSum1PtnwVsC{nch, nullptr}; //!> fhN2VsC{nch, {nch, nullptr}}; //!> fhSum2PtPtVsC{nch, {nch, nullptr}}; //!> fhSum2DptDptVsC{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs event centrality/multiplicity 1-1,1-2,2-1,2-2, combinations + std::vector> fhN2nwVsC{nch, {nch, nullptr}}; //!> fhSum2PtPtnwVsC{nch, {nch, nullptr}}; //!> fhSum2DptDptnwVsC{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs \f$\Delta\eta,\;\Delta\phi\f$ distribution vs event centrality/multiplicity 1-1,1-2,2-1,2-2, combinations bool ccdbstored = false; @@ -133,7 +136,7 @@ struct DptDptCorrelationsTask { /// \brief Returns the potentially phi origin shifted phi /// \param phi the track azimuthal angle /// \return the track phi origin shifted azimuthal angle - float GetShiftedPhi(float phi) + float getShiftedPhi(float phi) { using namespace correlationstask; using namespace o2::analysis::dptdptfilter; @@ -157,14 +160,14 @@ struct DptDptCorrelationsTask { /// the track has been accepted and it is within that ranges /// IF THAT IS NOT THE CASE THE ROUTINE WILL PRODUCE NONSENSE RESULTS template - int GetEtaPhiIndex(TrackObject const& t) + int getEtaPhiIndex(TrackObject const& t) { using namespace correlationstask; using namespace o2::analysis::dptdptfilter; int etaix = static_cast((t.eta() - etalow) / etabinwidth); /* consider a potential phi origin shift */ - float phi = GetShiftedPhi(t.phi()); + float phi = getShiftedPhi(t.phi()); int phiix = static_cast((phi - philow) / phibinwidth); return etaix * phibins + phiix; } @@ -179,18 +182,18 @@ struct DptDptCorrelationsTask { /// the tracks have been accepted and they are within that ranges /// IF THAT IS NOT THE CASE THE ROUTINE WILL PRODUCE NONSENSE RESULTS template - float GetDEtaValue(TrackObject const& t1, TrackObject const& t2) + float getDEtaValue(TrackObject const& t1, TrackObject const& t2) { using namespace correlationstask; using namespace o2::analysis::dptdptfilter; /* rule: ix are always zero based while bins are always one based */ - int etaix_1 = static_cast((t1.eta() - etalow) / etabinwidth); - int etaix_2 = static_cast((t2.eta() - etalow) / etabinwidth); + int etaIx1 = static_cast((t1.eta() - etalow) / etabinwidth); + int etaIx2 = static_cast((t2.eta() - etalow) / etabinwidth); - int deltaeta_ix = etaix_1 - etaix_2 + etabins - 1; + int deltaEtaIx = etaIx1 - etaIx2 + etabins - 1; - return deltaetalow + (deltaeta_ix + 0.5) * deltaetabinwidth; + return deltaetalow + (deltaEtaIx + 0.5) * deltaetabinwidth; } /// \brief Returns the delta phi value for the differential phi @@ -203,25 +206,25 @@ struct DptDptCorrelationsTask { /// the tracks have been accepted and they are within that ranges /// IF THAT IS NOT THE CASE THE ROUTINE WILL PRODUCE NONSENSE RESULTS template - float GetDPhiValue(TrackObject const& t1, TrackObject const& t2) + float getDPhiValue(TrackObject const& t1, TrackObject const& t2) { using namespace correlationstask; using namespace o2::analysis::dptdptfilter; /* rule: ix are always zero based while bins are always one based */ /* consider a potential phi origin shift */ - float phi = GetShiftedPhi(t1.phi()); - int phiix_1 = static_cast((phi - philow) / phibinwidth); + float phi = getShiftedPhi(t1.phi()); + int phiIx1 = static_cast((phi - philow) / phibinwidth); /* consider a potential phi origin shift */ - phi = GetShiftedPhi(t2.phi()); - int phiix_2 = static_cast((phi - philow) / phibinwidth); + phi = getShiftedPhi(t2.phi()); + int phiIx2 = static_cast((phi - philow) / phibinwidth); - int deltaphi_ix = phiix_1 - phiix_2; - if (deltaphi_ix < 0) { - deltaphi_ix += phibins; + int deltaPhiIx = phiIx1 - phiIx2; + if (deltaPhiIx < 0) { + deltaPhiIx += phibins; } - float value = deltaphilow + (deltaphi_ix + 0.5) * deltaphibinwidth; + float value = deltaphilow + (deltaPhiIx + 0.5) * deltaphibinwidth; return (value < (deltaphiup - constants::math::PI)) ? value : value - constants::math::TwoPI; } @@ -236,28 +239,28 @@ struct DptDptCorrelationsTask { /// the tracks have been accepted and they are within that ranges /// IF THAT IS NOT THE CASE THE ROUTINE WILL PRODUCE NONSENSE RESULTS template - int GetDEtaDPhiGlobalBin(TrackObject const& t1, TrackObject const& t2) + int getDEtaDPhiGlobalBin(TrackObject const& t1, TrackObject const& t2) { using namespace correlationstask; using namespace o2::analysis::dptdptfilter; /* rule: ix are always zero based while bins are always one based */ - int etaix_1 = static_cast((t1.eta() - etalow) / etabinwidth); + int etaIx1 = static_cast((t1.eta() - etalow) / etabinwidth); /* consider a potential phi origin shift */ - float phi = GetShiftedPhi(t1.phi()); - int phiix_1 = static_cast((phi - philow) / phibinwidth); - int etaix_2 = static_cast((t2.eta() - etalow) / etabinwidth); + float phi = getShiftedPhi(t1.phi()); + int phiIx1 = static_cast((phi - philow) / phibinwidth); + int etaIx2 = static_cast((t2.eta() - etalow) / etabinwidth); /* consider a potential phi origin shift */ - phi = GetShiftedPhi(t2.phi()); - int phiix_2 = static_cast((phi - philow) / phibinwidth); + phi = getShiftedPhi(t2.phi()); + int phiIx2 = static_cast((phi - philow) / phibinwidth); - int deltaeta_ix = etaix_1 - etaix_2 + etabins - 1; - int deltaphi_ix = phiix_1 - phiix_2; - if (deltaphi_ix < 0) { - deltaphi_ix += phibins; + int deltaEtaIx = etaIx1 - etaIx2 + etabins - 1; + int deltaPhiIx = phiIx1 - phiIx2; + if (deltaPhiIx < 0) { + deltaPhiIx += phibins; } - return fhN2_vsDEtaDPhi[0][0]->GetBin(deltaeta_ix + 1, deltaphi_ix + 1); + return fhN2VsDEtaDPhi[0][0]->GetBin(deltaEtaIx + 1, deltaPhiIx + 1); } /* taken from PWGCF/Core/PairCuts.h implemented by JFGO */ @@ -295,25 +298,32 @@ struct DptDptCorrelationsTask { void storeTrackCorrections(std::vector corrs) { + using namespace correlationstask; + LOGF(info, "Stored NUA&NUE corrections for %d track ids", corrs.size()); for (uint i = 0; i < corrs.size(); ++i) { - int nDimensions = corrs[i] != nullptr ? corrs[i]->GetDimension() : 0; - LOGF(info, " Stored NUA&NUE corrections %s for track id %d with %d dimensions %s", - corrs[i] != nullptr ? corrs[i]->GetName() : "nullptr", i, nDimensions, corrs[i] != nullptr ? "yes" : "no"); + if (corrs[i] != nullptr) { + if (nNoOfDimensions != corrs[i]->GetDimension()) { + LOGF(fatal, " Corrections receved dimensions %d for track id %d different than expected %d", corrs[i]->GetDimension(), i, nNoOfDimensions); + } else { + LOGF(info, " Storing NUA&NUE corrections %s for track id %d with %d dimensions %s", + corrs[i] != nullptr ? corrs[i]->GetName() : "nullptr", i, nNoOfDimensions, corrs[i] != nullptr ? "yes" : "no"); + } + } fhNuaNue[i] = corrs[i]; if (fhNuaNue[i] != nullptr) { int nbins = 0; double avg = 0.0; for (int ix = 0; ix < fhNuaNue[i]->GetNbinsX(); ++ix) { - if (nDimensions == 1) { + if (nNoOfDimensions == 1) { nbins++; avg += fhNuaNue[i]->GetBinContent(ix + 1); } else { for (int iy = 0; iy < fhNuaNue[i]->GetNbinsY(); ++iy) { - if (nDimensions == 2) { + if (nNoOfDimensions == 2) { nbins++; avg += fhNuaNue[i]->GetBinContent(ix + 1, iy + 1); - } else { + } else if (nNoOfDimensions == 3 || nNoOfDimensions == 4) { for (int iz = 0; iz < fhNuaNue[i]->GetNbinsZ(); ++iz) { nbins++; avg += fhNuaNue[i]->GetBinContent(ix + 1, iy + 1, iz + 1); @@ -333,25 +343,24 @@ struct DptDptCorrelationsTask { LOGF(info, "Stored pT average for %d track ids", ptavgs.size()); for (uint i = 0; i < ptavgs.size(); ++i) { LOGF(info, " Stored pT average for track id %d %s", i, ptavgs[i] != nullptr ? "yes" : "no"); - fhPtAvg_vsEtaPhi[i] = ptavgs[i]; + fhPtAvgVsEtaPhi[i] = ptavgs[i]; } ccdbstored = true; } - template + template std::vector* getTrackCorrections(TrackListObject const& tracks, float zvtx) { std::vector* corr = new std::vector(tracks.size(), 1.0f); int index = 0; - for (auto& t : tracks) { + for (const auto& t : tracks) { if (fhNuaNue[t.trackacceptedid()] != nullptr) { - int nDimensions = fhNuaNue[t.trackacceptedid()]->GetDimension(); - if (nDimensions == 1) { + if constexpr (nDim == 1) { (*corr)[index] = fhNuaNue[t.trackacceptedid()]->GetBinContent(fhNuaNue[t.trackacceptedid()]->FindFixBin(t.pt())); - } else if (nDimensions == 2) { + } else if constexpr (nDim == 2) { (*corr)[index] = fhNuaNue[t.trackacceptedid()]->GetBinContent(fhNuaNue[t.trackacceptedid()]->FindFixBin(t.eta(), t.pt())); - } else { - (*corr)[index] = fhNuaNue[t.trackacceptedid()]->GetBinContent(fhNuaNue[t.trackacceptedid()]->FindFixBin(zvtx, GetEtaPhiIndex(t) + 0.5, t.pt())); + } else if constexpr (nDim == 3) { + (*corr)[index] = fhNuaNue[t.trackacceptedid()]->GetBinContent(fhNuaNue[t.trackacceptedid()]->FindFixBin(zvtx, getEtaPhiIndex(t) + 0.5, t.pt())); } } index++; @@ -359,14 +368,29 @@ struct DptDptCorrelationsTask { return corr; } + template + std::vector* getTrackCorrections(TrackListObject const& tracks, float zvtx) + { + using namespace correlationstask; + + if (nNoOfDimensions == 1) { + return getTrackCorrections<1>(tracks, zvtx); + } else if (nNoOfDimensions == 2) { + return getTrackCorrections<2>(tracks, zvtx); + } else if (nNoOfDimensions == 3) { + return getTrackCorrections<3>(tracks, zvtx); + } + return getTrackCorrections<4>(tracks, zvtx); + } + template std::vector* getPtAvg(TrackListObject const& tracks) { std::vector* ptavg = new std::vector(tracks.size(), 0.0f); int index = 0; - for (auto& t : tracks) { - if (fhPtAvg_vsEtaPhi[t.trackacceptedid()] != nullptr) { - (*ptavg)[index] = fhPtAvg_vsEtaPhi[t.trackacceptedid()]->GetBinContent(fhPtAvg_vsEtaPhi[t.trackacceptedid()]->FindFixBin(t.eta(), t.phi())); + for (auto const& t : tracks) { + if (fhPtAvgVsEtaPhi[t.trackacceptedid()] != nullptr) { + (*ptavg)[index] = fhPtAvgVsEtaPhi[t.trackacceptedid()]->GetBinContent(fhPtAvgVsEtaPhi[t.trackacceptedid()]->FindFixBin(t.eta(), t.phi())); index++; } } @@ -380,15 +404,15 @@ struct DptDptCorrelationsTask { void processSingles(TrackListObject const& passedtracks, std::vector* corrs, float zvtx) { int index = 0; - for (auto& track : passedtracks) { + for (auto const& track : passedtracks) { float corr = (*corrs)[index]; - fhN1_vsPt[track.trackacceptedid()]->Fill(track.pt(), corr); + fhN1VsPt[track.trackacceptedid()]->Fill(track.pt(), corr); if constexpr (smallsingles) { - fhN1_vsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), GetShiftedPhi(track.phi()), corr); - fhSum1Pt_vsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), GetShiftedPhi(track.phi()), track.pt() * corr); + fhN1VsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), getShiftedPhi(track.phi()), corr); + fhSum1PtVsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), getShiftedPhi(track.phi()), track.pt() * corr); } else { - fhN1_vsZEtaPhiPt[track.trackacceptedid()]->Fill(zvtx, GetEtaPhiIndex(track) + 0.5, track.pt(), corr); - fhSum1Pt_vsZEtaPhiPt[track.trackacceptedid()]->Fill(zvtx, GetEtaPhiIndex(track) + 0.5, track.pt(), track.pt() * corr); + fhN1VsZEtaPhiPt[track.trackacceptedid()]->Fill(zvtx, getEtaPhiIndex(track) + 0.5, track.pt(), corr); + fhSum1PtVsZEtaPhiPt[track.trackacceptedid()]->Fill(zvtx, getEtaPhiIndex(track) + 0.5, track.pt(), track.pt() * corr); } index++; } @@ -409,22 +433,22 @@ struct DptDptCorrelationsTask { std::vector n1nw(nch, 0.0); ///< not weighted number of single tracks for current collision std::vector sum1Ptnw(nch, 0.0); ///< accumulated sum of not weighted single \f$p_T\f$ for current collision int index = 0; - for (auto& track : passedtracks) { + for (auto const& track : passedtracks) { float corr = (*corrs)[index]; n1[track.trackacceptedid()] += corr; sum1Pt[track.trackacceptedid()] += track.pt() * corr; n1nw[track.trackacceptedid()] += 1; sum1Ptnw[track.trackacceptedid()] += track.pt(); - fhN1_vsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), GetShiftedPhi(track.phi()), corr); - fhSum1Pt_vsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), GetShiftedPhi(track.phi()), track.pt() * corr); + fhN1VsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), getShiftedPhi(track.phi()), corr); + fhSum1PtVsEtaPhi[track.trackacceptedid()]->Fill(track.eta(), getShiftedPhi(track.phi()), track.pt() * corr); index++; } for (uint tid = 0; tid < nch; ++tid) { - fhN1_vsC[tid]->Fill(cmul, n1[tid]); - fhSum1Pt_vsC[tid]->Fill(cmul, sum1Pt[tid]); - fhN1nw_vsC[tid]->Fill(cmul, n1nw[tid]); - fhSum1Ptnw_vsC[tid]->Fill(cmul, sum1Ptnw[tid]); + fhN1VsC[tid]->Fill(cmul, n1[tid]); + fhSum1PtVsC[tid]->Fill(cmul, sum1Pt[tid]); + fhN1nwVsC[tid]->Fill(cmul, n1nw[tid]); + fhSum1PtnwVsC[tid]->Fill(cmul, sum1Ptnw[tid]); } } @@ -450,11 +474,11 @@ struct DptDptCorrelationsTask { int globalbin = 0; LOGF(debug, "Initializing globalbin to ", globalbin); - for (auto& track1 : trks1) { - double ptavg_1 = (*ptavgs1)[index1]; + for (auto const& track1 : trks1) { + double ptAvg1 = (*ptavgs1)[index1]; double corr1 = (*corrs1)[index1]; int index2 = 0; - for (auto& track2 : trks2) { + for (auto const& track2 : trks2) { /* checking the same track id condition */ if (track1 == track2) { /* exclude autocorrelations */ @@ -469,15 +493,15 @@ struct DptDptCorrelationsTask { } } /* process pair magnitudes */ - double ptavg_2 = (*ptavgs2)[index2]; + double ptAvg2 = (*ptavgs2)[index2]; double corr2 = (*corrs2)[index2]; double corr = corr1 * corr2; - double dptdptnw = (track1.pt() - ptavg_1) * (track2.pt() - ptavg_2); - double dptdptw = (corr1 * track1.pt() - ptavg_1) * (corr2 * track2.pt() - ptavg_2); + double dptdptnw = (track1.pt() - ptAvg1) * (track2.pt() - ptAvg2); + double dptdptw = (corr1 * track1.pt() - ptAvg1) * (corr2 * track2.pt() - ptAvg2); /* get the global bin for filling the differential histograms */ if constexpr (docorrelations) { - globalbin = GetDEtaDPhiGlobalBin(track1, track2); + globalbin = getDEtaDPhiGlobalBin(track1, track2); } float deltaeta = track1.eta() - track2.eta(); float deltaphi = track1.phi() - track2.phi(); @@ -490,8 +514,8 @@ struct DptDptCorrelationsTask { if ((fUseConversionCuts && fPairCuts.conversionCuts(track1, track2)) || (fUseTwoTrackCut && fPairCuts.twoTrackCut(track1, track2, bfield))) { /* suppress the pair */ if constexpr (docorrelations) { - fhSupN1N1_vsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, corr); - fhSupPt1Pt1_vsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, track1.pt() * track2.pt() * corr); + fhSupN1N1VsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, corr); + fhSupPt1Pt1VsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, track1.pt() * track2.pt() * corr); } n2sup[track1.trackacceptedid()][track2.trackacceptedid()] += corr; } else { @@ -504,18 +528,18 @@ struct DptDptCorrelationsTask { sum2DptDptnw[track1.trackacceptedid()][track2.trackacceptedid()] += dptdptnw; if constexpr (docorrelations) { - fhN2_vsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, corr); - fhN2cont_vsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(deltaeta, deltaphi, corr); - fhSum2DptDpt_vsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, dptdptw); - fhSum2PtPt_vsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, track1.pt() * track2.pt() * corr); - fhN2_vsPtPt[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(track1.pt(), track2.pt(), corr); + fhN2VsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, corr); + fhN2contVsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(deltaeta, deltaphi, corr); + fhSum2DptDptVsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, dptdptw); + fhSum2PtPtVsDEtaDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->AddBinContent(globalbin, track1.pt() * track2.pt() * corr); + fhN2VsPtPt[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(track1.pt(), track2.pt(), corr); } if constexpr (doinvmass) { if (!(track2.trackacceptedid() < track1.trackacceptedid())) { /* only 12 combinations, 21 are exactly the same */ double invariantMass = std::sqrt(getInvMassSquared(track1, poimass[static_cast(track1.trackacceptedid() / 2)], track2, poimass[static_cast(track2.trackacceptedid() / 2)])) * 1000.0f; - fhInvMassDEta[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(GetDEtaValue(track1, track2), invariantMass); - fhInvMassDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(GetDPhiValue(track1, track2), invariantMass); + fhInvMassDEta[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(getDEtaValue(track1, track2), invariantMass); + fhInvMassDPhi[track1.trackacceptedid()][track2.trackacceptedid()]->Fill(getDPhiValue(track1, track2), invariantMass); } } } @@ -525,19 +549,19 @@ struct DptDptCorrelationsTask { } for (uint pid1 = 0; pid1 < nch; ++pid1) { for (uint pid2 = 0; pid2 < nch; ++pid2) { - fhN2_vsC[pid1][pid2]->Fill(cmul, n2[pid1][pid2]); - fhSum2PtPt_vsC[pid1][pid2]->Fill(cmul, sum2PtPt[pid1][pid2]); - fhSum2DptDpt_vsC[pid1][pid2]->Fill(cmul, sum2DptDpt[pid1][pid2]); - fhN2nw_vsC[pid1][pid2]->Fill(cmul, n2nw[pid1][pid2]); - fhSum2PtPtnw_vsC[pid1][pid2]->Fill(cmul, sum2PtPtnw[pid1][pid2]); - fhSum2DptDptnw_vsC[pid1][pid2]->Fill(cmul, sum2DptDptnw[pid1][pid2]); + fhN2VsC[pid1][pid2]->Fill(cmul, n2[pid1][pid2]); + fhSum2PtPtVsC[pid1][pid2]->Fill(cmul, sum2PtPt[pid1][pid2]); + fhSum2DptDptVsC[pid1][pid2]->Fill(cmul, sum2DptDpt[pid1][pid2]); + fhN2nwVsC[pid1][pid2]->Fill(cmul, n2nw[pid1][pid2]); + fhSum2PtPtnwVsC[pid1][pid2]->Fill(cmul, sum2PtPtnw[pid1][pid2]); + fhSum2DptDptnwVsC[pid1][pid2]->Fill(cmul, sum2DptDptnw[pid1][pid2]); /* let's also update the number of entries in the differential histograms */ if constexpr (docorrelations) { - fhN2_vsDEtaDPhi[pid1][pid2]->SetEntries(fhN2_vsDEtaDPhi[pid1][pid2]->GetEntries() + n2[pid1][pid2]); - fhSum2DptDpt_vsDEtaDPhi[pid1][pid2]->SetEntries(fhSum2DptDpt_vsDEtaDPhi[pid1][pid2]->GetEntries() + n2[pid1][pid2]); - fhSum2PtPt_vsDEtaDPhi[pid1][pid2]->SetEntries(fhSum2PtPt_vsDEtaDPhi[pid1][pid2]->GetEntries() + n2[pid1][pid2]); - fhSupN1N1_vsDEtaDPhi[pid1][pid2]->SetEntries(fhSupN1N1_vsDEtaDPhi[pid1][pid2]->GetEntries() + n2sup[pid1][pid2]); - fhSupPt1Pt1_vsDEtaDPhi[pid1][pid2]->SetEntries(fhSupPt1Pt1_vsDEtaDPhi[pid1][pid2]->GetEntries() + n2sup[pid1][pid2]); + fhN2VsDEtaDPhi[pid1][pid2]->SetEntries(fhN2VsDEtaDPhi[pid1][pid2]->GetEntries() + n2[pid1][pid2]); + fhSum2DptDptVsDEtaDPhi[pid1][pid2]->SetEntries(fhSum2DptDptVsDEtaDPhi[pid1][pid2]->GetEntries() + n2[pid1][pid2]); + fhSum2PtPtVsDEtaDPhi[pid1][pid2]->SetEntries(fhSum2PtPtVsDEtaDPhi[pid1][pid2]->GetEntries() + n2[pid1][pid2]); + fhSupN1N1VsDEtaDPhi[pid1][pid2]->SetEntries(fhSupN1N1VsDEtaDPhi[pid1][pid2]->GetEntries() + n2sup[pid1][pid2]); + fhSupPt1Pt1VsDEtaDPhi[pid1][pid2]->SetEntries(fhSupPt1Pt1VsDEtaDPhi[pid1][pid2]->GetEntries() + n2sup[pid1][pid2]); } } } @@ -635,7 +659,7 @@ struct DptDptCorrelationsTask { LOGF(info, "Do invariant mass: %s; do correlation histograms: %s", doinvmass ? "yes" : "no", docorrelations ? "yes" : "no"); /* create the histograms */ - Bool_t oldstatus = TH1::AddDirectoryStatus(); + bool oldstatus = TH1::AddDirectoryStatus(); TH1::AddDirectory(kFALSE); if (!processpairs) { @@ -643,23 +667,23 @@ struct DptDptCorrelationsTask { fOutputList->Add(fhVertexZA); for (uint i = 0; i < nch; ++i) { /* histograms for each track, one and two */ - fhN1_vsPt[i] = new TH1F(TString::Format("n1_%s_vsPt", tnames[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT;p_{t,%s} (GeV/c);#LT n_{1} #GT", tnames[i].c_str()).Data(), - ptbins, ptlow, ptup); + fhN1VsPt[i] = new TH1F(TString::Format("n1_%s_vsPt", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT;p_{t,%s} (GeV/c);#LT n_{1} #GT", tnames[i].c_str()).Data(), + ptbins, ptlow, ptup); /* we don't want the Sumw2 structure being created here */ bool defSumw2 = TH1::GetDefaultSumw2(); if constexpr (smallsingles) { - fhN1_vsEtaPhi[i] = new TH2F(TString::Format("n1_%s_vsEtaPhi", tnames[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT;#eta_{%s};#varphi_{%s} (radian);#LT n_{1} #GT", tnames[i].c_str(), tnames[i].c_str()).Data(), - etabins, etalow, etaup, phibins, philow, phiup); - fhSum1Pt_vsEtaPhi[i] = new TH2F(TString::Format("sumPt_%s_vsEtaPhi", tnames[i].c_str()).Data(), - TString::Format("#LT #Sigma p_{t,%s} #GT;#eta_{%s};#varphi_{%s} (radian);#LT #Sigma p_{t,%s} #GT (GeV/c)", - tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str()) - .Data(), - etabins, etalow, etaup, phibins, philow, phiup); + fhN1VsEtaPhi[i] = new TH2F(TString::Format("n1_%s_vsEtaPhi", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT;#eta_{%s};#varphi_{%s} (radian);#LT n_{1} #GT", tnames[i].c_str(), tnames[i].c_str()).Data(), + etabins, etalow, etaup, phibins, philow, phiup); + fhSum1PtVsEtaPhi[i] = new TH2F(TString::Format("sumPt_%s_vsEtaPhi", tnames[i].c_str()).Data(), + TString::Format("#LT #Sigma p_{t,%s} #GT;#eta_{%s};#varphi_{%s} (radian);#LT #Sigma p_{t,%s} #GT (GeV/c)", + tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str()) + .Data(), + etabins, etalow, etaup, phibins, philow, phiup); } else { TH1::SetDefaultSumw2(false); - fhN1_vsZEtaPhiPt[i] = new TH3F( + fhN1VsZEtaPhiPt[i] = new TH3F( TString::Format("n1_%s_vsZ_vsEtaPhi_vsPt", tnames[i].c_str()).Data(), TString::Format("#LT n_{1} #GT;vtx_{z};#eta_{%s}#times#varphi_{%s};p_{t,%s} (GeV/c)", tnames[i].c_str(), @@ -675,7 +699,7 @@ struct DptDptCorrelationsTask { ptbins, ptlow, ptup); - fhSum1Pt_vsZEtaPhiPt[i] = new TH3F( + fhSum1PtVsZEtaPhiPt[i] = new TH3F( TString::Format("sumPt1_%s_vsZ_vsEtaPhi_vsPt", tnames[i].c_str()).Data(), TString::Format( "#LT #Sigma p_{t,%s}#GT;vtx_{z};#eta_{%s}#times#varphi_{%s};p_{t,%s} (GeV/c)", @@ -699,58 +723,58 @@ struct DptDptCorrelationsTask { /* the statistical uncertainties will be estimated by the subsamples method so let's get rid of the error tracking */ if constexpr (smallsingles) { - fhN1_vsEtaPhi[i]->SetBit(TH1::kIsNotW); - fhN1_vsEtaPhi[i]->Sumw2(false); - fhSum1Pt_vsEtaPhi[i]->SetBit(TH1::kIsNotW); - fhSum1Pt_vsEtaPhi[i]->Sumw2(false); + fhN1VsEtaPhi[i]->SetBit(TH1::kIsNotW); + fhN1VsEtaPhi[i]->Sumw2(false); + fhSum1PtVsEtaPhi[i]->SetBit(TH1::kIsNotW); + fhSum1PtVsEtaPhi[i]->Sumw2(false); } else { - fhN1_vsZEtaPhiPt[i]->SetBit(TH1::kIsNotW); - fhN1_vsZEtaPhiPt[i]->Sumw2(false); - fhSum1Pt_vsZEtaPhiPt[i]->SetBit(TH1::kIsNotW); - fhSum1Pt_vsZEtaPhiPt[i]->Sumw2(false); + fhN1VsZEtaPhiPt[i]->SetBit(TH1::kIsNotW); + fhN1VsZEtaPhiPt[i]->Sumw2(false); + fhSum1PtVsZEtaPhiPt[i]->SetBit(TH1::kIsNotW); + fhSum1PtVsZEtaPhiPt[i]->Sumw2(false); } fhNuaNue[i] = nullptr; - fhPtAvg_vsEtaPhi[i] = nullptr; + fhPtAvgVsEtaPhi[i] = nullptr; - fOutputList->Add(fhN1_vsPt[i]); + fOutputList->Add(fhN1VsPt[i]); if constexpr (smallsingles) { - fOutputList->Add(fhN1_vsEtaPhi[i]); - fOutputList->Add(fhSum1Pt_vsEtaPhi[i]); + fOutputList->Add(fhN1VsEtaPhi[i]); + fOutputList->Add(fhSum1PtVsEtaPhi[i]); } else { - fOutputList->Add(fhN1_vsZEtaPhiPt[i]); - fOutputList->Add(fhSum1Pt_vsZEtaPhiPt[i]); + fOutputList->Add(fhN1VsZEtaPhiPt[i]); + fOutputList->Add(fhSum1PtVsZEtaPhiPt[i]); } } } else { for (uint i = 0; i < nch; ++i) { /* histograms for each track species */ - fhN1_vsEtaPhi[i] = new TH2F(TString::Format("n1_%s_vsEtaPhi", tnames[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT;#eta_{%s};#varphi_{%s} (radian);#LT n_{1} #GT", tnames[i].c_str(), tnames[i].c_str()).Data(), - etabins, etalow, etaup, phibins, philow, phiup); - fhSum1Pt_vsEtaPhi[i] = new TH2F(TString::Format("sumPt_%s_vsEtaPhi", tnames[i].c_str()).Data(), - TString::Format("#LT #Sigma p_{t,%s} #GT;#eta_{%s};#varphi_{%s} (radian);#LT #Sigma p_{t,%s} #GT (GeV/c)", - tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str()) - .Data(), - etabins, etalow, etaup, phibins, philow, phiup); - fhN1_vsC[i] = new TProfile(TString::Format("n1_%s_vsM", tnames[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT (weighted);Centrality/Multiplicity (%%);#LT n_{1} #GT").Data(), - 100, 0.0, 100.0); - fhSum1Pt_vsC[i] = new TProfile(TString::Format("sumPt_%s_vsM", tnames[i].c_str()), - TString::Format("#LT #Sigma p_{t,%s} #GT (weighted);Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tnames[i].c_str(), tnames[i].c_str()).Data(), - 100, 0.0, 100.0); - fhN1nw_vsC[i] = new TProfile(TString::Format("n1Nw_%s_vsM", tnames[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT;Centrality/Multiplicity (%%);#LT n_{1} #GT").Data(), - 100, 0.0, 100.0); - fhSum1Ptnw_vsC[i] = new TProfile(TString::Format("sumPtNw_%s_vsM", tnames[i].c_str()).Data(), - TString::Format("#LT #Sigma p_{t,%s} #GT;Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tnames[i].c_str(), tnames[i].c_str()).Data(), 100, 0.0, 100.0); + fhN1VsEtaPhi[i] = new TH2F(TString::Format("n1_%s_vsEtaPhi", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT;#eta_{%s};#varphi_{%s} (radian);#LT n_{1} #GT", tnames[i].c_str(), tnames[i].c_str()).Data(), + etabins, etalow, etaup, phibins, philow, phiup); + fhSum1PtVsEtaPhi[i] = new TH2F(TString::Format("sumPt_%s_vsEtaPhi", tnames[i].c_str()).Data(), + TString::Format("#LT #Sigma p_{t,%s} #GT;#eta_{%s};#varphi_{%s} (radian);#LT #Sigma p_{t,%s} #GT (GeV/c)", + tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str()) + .Data(), + etabins, etalow, etaup, phibins, philow, phiup); + fhN1VsC[i] = new TProfile(TString::Format("n1_%s_vsM", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT (weighted);Centrality/Multiplicity (%%);#LT n_{1} #GT").Data(), + 100, 0.0, 100.0); + fhSum1PtVsC[i] = new TProfile(TString::Format("sumPt_%s_vsM", tnames[i].c_str()), + TString::Format("#LT #Sigma p_{t,%s} #GT (weighted);Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tnames[i].c_str(), tnames[i].c_str()).Data(), + 100, 0.0, 100.0); + fhN1nwVsC[i] = new TProfile(TString::Format("n1Nw_%s_vsM", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT;Centrality/Multiplicity (%%);#LT n_{1} #GT").Data(), + 100, 0.0, 100.0); + fhSum1PtnwVsC[i] = new TProfile(TString::Format("sumPtNw_%s_vsM", tnames[i].c_str()).Data(), + TString::Format("#LT #Sigma p_{t,%s} #GT;Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tnames[i].c_str(), tnames[i].c_str()).Data(), 100, 0.0, 100.0); fhNuaNue[i] = nullptr; - fhPtAvg_vsEtaPhi[i] = nullptr; - fOutputList->Add(fhN1_vsEtaPhi[i]); - fOutputList->Add(fhSum1Pt_vsEtaPhi[i]); - fOutputList->Add(fhN1_vsC[i]); - fOutputList->Add(fhSum1Pt_vsC[i]); - fOutputList->Add(fhN1nw_vsC[i]); - fOutputList->Add(fhSum1Ptnw_vsC[i]); + fhPtAvgVsEtaPhi[i] = nullptr; + fOutputList->Add(fhN1VsEtaPhi[i]); + fOutputList->Add(fhSum1PtVsEtaPhi[i]); + fOutputList->Add(fhN1VsC[i]); + fOutputList->Add(fhSum1PtVsC[i]); + fOutputList->Add(fhN1nwVsC[i]); + fOutputList->Add(fhSum1PtnwVsC[i]); } for (uint i = 0; i < nch; ++i) { @@ -761,20 +785,20 @@ struct DptDptCorrelationsTask { TH1::SetDefaultSumw2(false); const char* pname = trackPairsNames[i][j].c_str(); if constexpr (docorrelations) { - fhN2_vsDEtaDPhi[i][j] = new TH2F(TString::Format("n2_12_vsDEtaDPhi_%s", pname), TString::Format("#LT n_{2} #GT (%s);#Delta#eta;#Delta#varphi;#LT n_{2} #GT", pname), - deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); - fhN2cont_vsDEtaDPhi[i][j] = new TH2F(TString::Format("n2_12cont_vsDEtaDPhi_%s", pname), TString::Format("#LT n_{2} #GT (%s);#Delta#eta;#Delta#varphi;#LT n_{2} #GT", pname), - deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); - fhSum2PtPt_vsDEtaDPhi[i][j] = new TH2F(TString::Format("sumPtPt_12_vsDEtaDPhi_%s", pname), TString::Format("#LT #Sigma p_{t,1}p_{t,2} #GT (%s);#Delta#eta;#Delta#varphi;#LT #Sigma p_{t,1}p_{t,2} #GT (GeV^{2})", pname), - deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); - fhSum2DptDpt_vsDEtaDPhi[i][j] = new TH2F(TString::Format("sumDptDpt_12_vsDEtaDPhi_%s", pname), TString::Format("#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (%s);#Delta#eta;#Delta#varphi;#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (GeV^{2})", pname), - deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); - fhSupN1N1_vsDEtaDPhi[i][j] = new TH2F(TString::Format("suppn1n1_12_vsDEtaDPhi_%s", pname), TString::Format("Suppressed #LT n_{1} #GT#LT n_{1} #GT (%s);#Delta#eta;#Delta#varphi;#LT n_{1} #GT#LT n_{1} #GT", pname), + fhN2VsDEtaDPhi[i][j] = new TH2F(TString::Format("n2_12_vsDEtaDPhi_%s", pname), TString::Format("#LT n_{2} #GT (%s);#Delta#eta;#Delta#varphi;#LT n_{2} #GT", pname), + deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); + fhN2contVsDEtaDPhi[i][j] = new TH2F(TString::Format("n2_12cont_vsDEtaDPhi_%s", pname), TString::Format("#LT n_{2} #GT (%s);#Delta#eta;#Delta#varphi;#LT n_{2} #GT", pname), + deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); + fhSum2PtPtVsDEtaDPhi[i][j] = new TH2F(TString::Format("sumPtPt_12_vsDEtaDPhi_%s", pname), TString::Format("#LT #Sigma p_{t,1}p_{t,2} #GT (%s);#Delta#eta;#Delta#varphi;#LT #Sigma p_{t,1}p_{t,2} #GT (GeV^{2})", pname), deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); - fhSupPt1Pt1_vsDEtaDPhi[i][j] = new TH2F(TString::Format("suppPtPt_12_vsDEtaDPhi_%s", pname), TString::Format("Suppressed #LT p_{t,1} #GT#LT p_{t,2} #GT (%s);#Delta#eta;#Delta#varphi;#LT p_{t,1} #GT#LT p_{t,2} #GT (GeV^{2})", pname), + fhSum2DptDptVsDEtaDPhi[i][j] = new TH2F(TString::Format("sumDptDpt_12_vsDEtaDPhi_%s", pname), TString::Format("#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (%s);#Delta#eta;#Delta#varphi;#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (GeV^{2})", pname), deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); - fhN2_vsPtPt[i][j] = new TH2F(TString::Format("n2_12_vsPtVsPt_%s", pname), TString::Format("#LT n_{2} #GT (%s);p_{t,1} (GeV/c);p_{t,2} (GeV/c);#LT n_{2} #GT", pname), - ptbins, ptlow, ptup, ptbins, ptlow, ptup); + fhSupN1N1VsDEtaDPhi[i][j] = new TH2F(TString::Format("suppn1n1_12_vsDEtaDPhi_%s", pname), TString::Format("Suppressed #LT n_{1} #GT#LT n_{1} #GT (%s);#Delta#eta;#Delta#varphi;#LT n_{1} #GT#LT n_{1} #GT", pname), + deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); + fhSupPt1Pt1VsDEtaDPhi[i][j] = new TH2F(TString::Format("suppPtPt_12_vsDEtaDPhi_%s", pname), TString::Format("Suppressed #LT p_{t,1} #GT#LT p_{t,2} #GT (%s);#Delta#eta;#Delta#varphi;#LT p_{t,1} #GT#LT p_{t,2} #GT (GeV^{2})", pname), + deltaetabins, deltaetalow, deltaetaup, deltaphibins, deltaphilow, deltaphiup); + fhN2VsPtPt[i][j] = new TH2F(TString::Format("n2_12_vsPtVsPt_%s", pname), TString::Format("#LT n_{2} #GT (%s);p_{t,1} (GeV/c);p_{t,2} (GeV/c);#LT n_{2} #GT", pname), + ptbins, ptlow, ptup, ptbins, ptlow, ptup); } if constexpr (doinvmass) { if (!(j < i)) { @@ -788,27 +812,27 @@ struct DptDptCorrelationsTask { /* we return it back to previuos state */ TH1::SetDefaultSumw2(defSumw2); - fhN2_vsC[i][j] = new TProfile(TString::Format("n2_12_vsM_%s", pname), TString::Format("#LT n_{2} #GT (%s) (weighted);Centrality/Multiplicity (%%);#LT n_{2} #GT", pname), 100, 0.0, 100.0); - fhSum2PtPt_vsC[i][j] = new TProfile(TString::Format("sumPtPt_12_vsM_%s", pname), TString::Format("#LT #Sigma p_{t,1}p_{t,2} #GT (%s) (weighted);Centrality/Multiplicity (%%);#LT #Sigma p_{t,1}p_{t,2} #GT (GeV^{2})", pname), 100, 0.0, 100.0); - fhSum2DptDpt_vsC[i][j] = new TProfile(TString::Format("sumDptDpt_12_vsM_%s", pname), TString::Format("#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (%s) (weighted);Centrality/Multiplicity (%%);#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (GeV^{2})", pname), 100, 0.0, 100.0); - fhN2nw_vsC[i][j] = new TProfile(TString::Format("n2Nw_12_vsM_%s", pname), TString::Format("#LT n_{2} #GT (%s);Centrality/Multiplicity (%%);#LT n_{2} #GT", pname), 100, 0.0, 100.0); - fhSum2PtPtnw_vsC[i][j] = new TProfile(TString::Format("sumPtPtNw_12_vsM_%s", pname), TString::Format("#LT #Sigma p_{t,1}p_{t,2} #GT (%s);Centrality/Multiplicity (%%);#LT #Sigma p_{t,1}p_{t,2} #GT (GeV^{2})", pname), 100, 0.0, 100.0); - fhSum2DptDptnw_vsC[i][j] = new TProfile(TString::Format("sumDptDptNw_12_vsM_%s", pname), TString::Format("#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (%s);Centrality/Multiplicity (%%);#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (GeV^{2})", pname), 100, 0.0, 100.0); + fhN2VsC[i][j] = new TProfile(TString::Format("n2_12_vsM_%s", pname), TString::Format("#LT n_{2} #GT (%s) (weighted);Centrality/Multiplicity (%%);#LT n_{2} #GT", pname), 100, 0.0, 100.0); + fhSum2PtPtVsC[i][j] = new TProfile(TString::Format("sumPtPt_12_vsM_%s", pname), TString::Format("#LT #Sigma p_{t,1}p_{t,2} #GT (%s) (weighted);Centrality/Multiplicity (%%);#LT #Sigma p_{t,1}p_{t,2} #GT (GeV^{2})", pname), 100, 0.0, 100.0); + fhSum2DptDptVsC[i][j] = new TProfile(TString::Format("sumDptDpt_12_vsM_%s", pname), TString::Format("#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (%s) (weighted);Centrality/Multiplicity (%%);#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (GeV^{2})", pname), 100, 0.0, 100.0); + fhN2nwVsC[i][j] = new TProfile(TString::Format("n2Nw_12_vsM_%s", pname), TString::Format("#LT n_{2} #GT (%s);Centrality/Multiplicity (%%);#LT n_{2} #GT", pname), 100, 0.0, 100.0); + fhSum2PtPtnwVsC[i][j] = new TProfile(TString::Format("sumPtPtNw_12_vsM_%s", pname), TString::Format("#LT #Sigma p_{t,1}p_{t,2} #GT (%s);Centrality/Multiplicity (%%);#LT #Sigma p_{t,1}p_{t,2} #GT (GeV^{2})", pname), 100, 0.0, 100.0); + fhSum2DptDptnwVsC[i][j] = new TProfile(TString::Format("sumDptDptNw_12_vsM_%s", pname), TString::Format("#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (%s);Centrality/Multiplicity (%%);#LT #Sigma (p_{t,1} - #LT p_{t,1} #GT)(p_{t,2} - #LT p_{t,2} #GT) #GT (GeV^{2})", pname), 100, 0.0, 100.0); /* the statistical uncertainties will be estimated by the subsamples method so let's get rid of the error tracking */ if constexpr (docorrelations) { - fhN2_vsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); - fhN2_vsDEtaDPhi[i][j]->Sumw2(false); - fhN2cont_vsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); - fhN2cont_vsDEtaDPhi[i][j]->Sumw2(false); - fhSum2PtPt_vsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); - fhSum2PtPt_vsDEtaDPhi[i][j]->Sumw2(false); - fhSum2DptDpt_vsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); - fhSum2DptDpt_vsDEtaDPhi[i][j]->Sumw2(false); - fhSupN1N1_vsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); - fhSupN1N1_vsDEtaDPhi[i][j]->Sumw2(false); - fhSupPt1Pt1_vsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); - fhSupPt1Pt1_vsDEtaDPhi[i][j]->Sumw2(false); + fhN2VsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); + fhN2VsDEtaDPhi[i][j]->Sumw2(false); + fhN2contVsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); + fhN2contVsDEtaDPhi[i][j]->Sumw2(false); + fhSum2PtPtVsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); + fhSum2PtPtVsDEtaDPhi[i][j]->Sumw2(false); + fhSum2DptDptVsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); + fhSum2DptDptVsDEtaDPhi[i][j]->Sumw2(false); + fhSupN1N1VsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); + fhSupN1N1VsDEtaDPhi[i][j]->Sumw2(false); + fhSupPt1Pt1VsDEtaDPhi[i][j]->SetBit(TH1::kIsNotW); + fhSupPt1Pt1VsDEtaDPhi[i][j]->Sumw2(false); } if constexpr (doinvmass) { if (!(j < i)) { @@ -821,13 +845,13 @@ struct DptDptCorrelationsTask { } if constexpr (docorrelations) { - fOutputList->Add(fhN2_vsDEtaDPhi[i][j]); - fOutputList->Add(fhN2cont_vsDEtaDPhi[i][j]); - fOutputList->Add(fhSum2PtPt_vsDEtaDPhi[i][j]); - fOutputList->Add(fhSum2DptDpt_vsDEtaDPhi[i][j]); - fOutputList->Add(fhSupN1N1_vsDEtaDPhi[i][j]); - fOutputList->Add(fhSupPt1Pt1_vsDEtaDPhi[i][j]); - fOutputList->Add(fhN2_vsPtPt[i][j]); + fOutputList->Add(fhN2VsDEtaDPhi[i][j]); + fOutputList->Add(fhN2contVsDEtaDPhi[i][j]); + fOutputList->Add(fhSum2PtPtVsDEtaDPhi[i][j]); + fOutputList->Add(fhSum2DptDptVsDEtaDPhi[i][j]); + fOutputList->Add(fhSupN1N1VsDEtaDPhi[i][j]); + fOutputList->Add(fhSupPt1Pt1VsDEtaDPhi[i][j]); + fOutputList->Add(fhN2VsPtPt[i][j]); } if constexpr (doinvmass) { if (!(j < i)) { @@ -836,12 +860,12 @@ struct DptDptCorrelationsTask { fOutputList->Add(fhInvMassDPhi[i][j]); } } - fOutputList->Add(fhN2_vsC[i][j]); - fOutputList->Add(fhSum2PtPt_vsC[i][j]); - fOutputList->Add(fhSum2DptDpt_vsC[i][j]); - fOutputList->Add(fhN2nw_vsC[i][j]); - fOutputList->Add(fhSum2PtPtnw_vsC[i][j]); - fOutputList->Add(fhSum2DptDptnw_vsC[i][j]); + fOutputList->Add(fhN2VsC[i][j]); + fOutputList->Add(fhSum2PtPtVsC[i][j]); + fOutputList->Add(fhSum2DptDptVsC[i][j]); + fOutputList->Add(fhN2nwVsC[i][j]); + fOutputList->Add(fhSum2PtPtnwVsC[i][j]); + fOutputList->Add(fhSum2DptDptnwVsC[i][j]); } } } @@ -859,7 +883,7 @@ struct DptDptCorrelationsTask { /* the data collecting engine instances */ DataCollectingEngine** dataCE; - DataCollectingEngine** dataCE_small; + DataCollectingEngine** dataCEsmall; DataCollectingEngine** dataCEME; /* the input file structure from CCDB */ @@ -871,8 +895,8 @@ struct DptDptCorrelationsTask { std::string cfgCCDBPeriod{"LHC22o"}; /* pair conversion suppression defaults */ - static constexpr float cfgPairCutDefaults[1][5] = {{-1, -1, -1, -1, -1}}; - Configurable> cfgPairCut{"paircut", {cfgPairCutDefaults[0], 5, {"Photon", "K0", "Lambda", "Phi", "Rho"}}, "Conversion suppressions"}; + static constexpr float kCfgPairCutDefaults[1][5] = {{-1, -1, -1, -1, -1}}; + Configurable> cfgPairCut{"paircut", {kCfgPairCutDefaults[0], 5, {"Photon", "K0", "Lambda", "Phi", "Rho"}}, "Conversion suppressions"}; /* two tracks cut */ Configurable cfgTwoTrackCut{"twotrackcut", -1, "Two-tracks cut: -1 = off; >0 otherwise distance value (suggested: 0.02"}; Configurable cfgTwoTrackCutMinRadius{"twotrackcutminradius", 0.8f, "Two-tracks cut: radius in m from which two-tracks cut is applied"}; @@ -883,6 +907,7 @@ struct DptDptCorrelationsTask { Configurable cfgProcessPairs{"processpairs", false, "Process pairs: false = no, just singles, true = yes, process pairs"}; Configurable cfgProcessME{"processmixedevents", false, "Process mixed events: false = no, just same event, true = yes, also process mixed events"}; Configurable cfgPtOrder{"ptorder", false, "enforce pT_1 < pT_2. Defalut: false"}; + Configurable cfgNoOfDimensions{"cfgNoOfDimensions", 1, "Number of dimensions for the NUA&NUE corrections. Default 1"}; OutputObj fOutput{"DptDptCorrelationsData", OutputObjHandlingPolicy::AnalysisObject, OutputObjSourceType::OutputObjSource}; void init(InitContext& initContext) @@ -925,6 +950,7 @@ struct DptDptCorrelationsTask { ptorder = cfgPtOrder.value; invmass = cfgDoInvMass.value; corrana = cfgDoCorrelations.value; + nNoOfDimensions = cfgNoOfDimensions.value; /* self configure the CCDB access to the input file */ getTaskOptionValue(initContext, "dpt-dpt-filter", "input_ccdburl", cfgCCDBUrl, false); @@ -1039,7 +1065,7 @@ struct DptDptCorrelationsTask { fCentMultMax[0] = 100.0f; } if (cfgSmallDCE) { - dataCE_small = new DataCollectingEngine*[ncmranges]; + dataCEsmall = new DataCollectingEngine*[ncmranges]; } else { dataCE = new DataCollectingEngine*[ncmranges]; } @@ -1088,7 +1114,7 @@ struct DptDptCorrelationsTask { if (invmass) { LOGF(fatal, "Invariant mass cannot be used with singles in the small DCE mode, please configure properly!!"); } - dataCE_small[i] = builSmallDCEInstance(range.Data()); + dataCEsmall[i] = builSmallDCEInstance(range.Data()); } else { if (invmass) { if (!processpairs) { @@ -1171,6 +1197,14 @@ struct DptDptCorrelationsTask { return grpo->getNominalL3Field(); } + const char* getDimensionStr() + { + using namespace correlationstask; + + static constexpr std::string_view kStrDim[] = {"", "2D", "3D", "4D"}; + return kStrDim[nNoOfDimensions].data(); + } + template void processSame(FilterdCollision const& collision, FilteredTracks const& tracks, uint64_t timestamp = 0) { @@ -1187,21 +1221,21 @@ struct DptDptCorrelationsTask { if (!(ixDCE < 0)) { auto isCCDBstored = [&]() { if (cfgSmallDCE.value) { - return dataCE_small[ixDCE]->isCCDBstored(); + return dataCEsmall[ixDCE]->isCCDBstored(); } else { return dataCE[ixDCE]->isCCDBstored(); } }; auto storePtAverages = [&](auto& ptavgs) { if (cfgSmallDCE.value) { - dataCE_small[ixDCE]->storePtAverages(ptavgs); + dataCEsmall[ixDCE]->storePtAverages(ptavgs); } else { dataCE[ixDCE]->storePtAverages(ptavgs); } }; auto storeTrackCorrections = [&](auto& corrs) { if (cfgSmallDCE.value) { - dataCE_small[ixDCE]->storeTrackCorrections(corrs); + dataCEsmall[ixDCE]->storeTrackCorrections(corrs); } else { dataCE[ixDCE]->storeTrackCorrections(corrs); } @@ -1222,7 +1256,8 @@ struct DptDptCorrelationsTask { std::vector corrs{tnames.size(), nullptr}; for (uint isp = 0; isp < tnames.size(); ++isp) { corrs[isp] = reinterpret_cast(ccdblst->FindObject( - TString::Format("correction_%02d-%02d_%s", + TString::Format("correction%s_%02d-%02d_%s", + getDimensionStr(), static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), tnames[isp].c_str()) @@ -1259,7 +1294,7 @@ struct DptDptCorrelationsTask { bfield = (fUseConversionCuts || fUseTwoTrackCut) ? getMagneticField(timestamp) : 0; } if (cfgSmallDCE.value) { - dataCE_small[ixDCE]->processCollision(tracks, tracks, collision.posZ(), collision.centmult(), bfield); + dataCEsmall[ixDCE]->processCollision(tracks, tracks, collision.posZ(), collision.centmult(), bfield); } else { dataCE[ixDCE]->processCollision(tracks, tracks, collision.posZ(), collision.centmult(), bfield); } @@ -1296,7 +1331,8 @@ struct DptDptCorrelationsTask { std::vector corrs{tnames.size(), nullptr}; for (uint isp = 0; isp < tnames.size(); ++isp) { corrs[isp] = reinterpret_cast(ccdblst->FindObject( - TString::Format("correction_%02d-%02d_%s", + TString::Format("correction%s_%02d-%02d_%s", + getDimensionStr(), static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), tnames[isp].c_str()) @@ -1341,20 +1377,20 @@ struct DptDptCorrelationsTask { Filter onlyacceptedcollisions = (aod::dptdptfilter::collisionaccepted == uint8_t(true)); Filter onlyacceptedtracks = (aod::dptdptfilter::trackacceptedid >= int8_t(0)); - void processRecLevel(soa::Filtered::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered& tracks) + void processRecLevel(soa::Filtered::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered const& tracks) { processSame(collision, tracks, collision.bc_as().timestamp()); } PROCESS_SWITCH(DptDptCorrelationsTask, processRecLevel, "Process reco level correlations", false); - void processRecLevelCheck(aod::Collisions const& collisions, aod::Tracks& tracks) + void processRecLevelCheck(aod::Collisions const& collisions, aod::Tracks const& tracks) { int nAssignedTracks = 0; int nNotAssignedTracks = 0; int64_t firstNotAssignedIndex = -1; int64_t lastNotAssignedIndex = -1; - for (auto track : tracks) { + for (auto const& track : tracks) { if (track.has_collision()) { nAssignedTracks++; } else { @@ -1374,14 +1410,14 @@ struct DptDptCorrelationsTask { } PROCESS_SWITCH(DptDptCorrelationsTask, processRecLevelCheck, "Process reco level checks", true); - void processGenLevelCheck(aod::McCollisions const& mccollisions, aod::McParticles& particles) + void processGenLevelCheck(aod::McCollisions const& mccollisions, aod::McParticles const& particles) { int nAssignedParticles = 0; int nNotAssignedParticles = 0; int64_t firstNotAssignedIndex = -1; int64_t lastNotAssignedIndex = -1; - for (auto particle : particles) { + for (auto const& particle : particles) { if (particle.has_mcCollision()) { nAssignedParticles++; } else { @@ -1404,18 +1440,15 @@ struct DptDptCorrelationsTask { void processRecLevelNotStored( soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, - soa::Filtered>& tracks) + soa::Filtered> const& tracks) { processSame(collision, tracks, collision.bc_as().timestamp()); } - PROCESS_SWITCH(DptDptCorrelationsTask, - processRecLevelNotStored, - "Process reco level correlations for not stored derived data", - true); + PROCESS_SWITCH(DptDptCorrelationsTask, processRecLevelNotStored, "Process reco level correlations for not stored derived data", true); void processGenLevel( soa::Filtered::iterator const& collision, - soa::Filtered>& tracks) + soa::Filtered> const& tracks) { processSame(collision, tracks); } @@ -1423,14 +1456,11 @@ struct DptDptCorrelationsTask { void processGenLevelNotStored( soa::Filtered>::iterator const& collision, - soa::Filtered>& particles) + soa::Filtered> const& particles) { processSame(collision, particles); } - PROCESS_SWITCH(DptDptCorrelationsTask, - processGenLevelNotStored, - "Process generator level correlations for not stored derived data", - false); + PROCESS_SWITCH(DptDptCorrelationsTask, processGenLevelNotStored, "Process generator level correlations for not stored derived data", false); std::vector vtxBinsEdges{VARIABLE_WIDTH, -7.0f, -5.0f, -3.0f, -1.0f, 1.0f, 3.0f, 5.0f, 7.0f}; @@ -1439,14 +1469,14 @@ struct DptDptCorrelationsTask { using BinningZVtxMultRec = ColumnBinningPolicy; BinningZVtxMultRec bindingOnVtxAndMultRec{{vtxBinsEdges, multBinsEdges}, true}; // true is for 'ignore overflows' (true by default) - void processRecLevelMixed(soa::Filtered& collisions, aod::BCsWithTimestamps const&, soa::Filtered& tracks) + void processRecLevelMixed(soa::Filtered const& collisions, aod::BCsWithTimestamps const&, soa::Filtered const& tracks) { auto tracksTuple = std::make_tuple(tracks); SameKindPair, soa::Filtered, BinningZVtxMultRec> pairreco{bindingOnVtxAndMultRec, 5, -1, collisions, tracksTuple, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored LOGF(DPTDPTLOGCOLLISIONS, "Received %d collisions", collisions.size()); int logcomb = 0; - for (auto& [collision1, tracks1, collision2, tracks2] : pairreco) { + for (auto const& [collision1, tracks1, collision2, tracks2] : pairreco) { if (logcomb < 10) { LOGF(DPTDPTLOGCOLLISIONS, "Received collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", collision1.globalIndex(), collision1.posZ(), collision1.centmult(), collision1.collisionaccepted() ? "accepted" : "not accepted", @@ -1464,9 +1494,9 @@ struct DptDptCorrelationsTask { PROCESS_SWITCH(DptDptCorrelationsTask, processRecLevelMixed, "Process reco level mixed events correlations", false); void processRecLevelMixedNotStored( - soa::Filtered>& collisions, + soa::Filtered> const& collisions, aod::BCsWithTimestamps const&, - soa::Filtered>& tracks) + soa::Filtered> const& tracks) { auto tracksTuple = std::make_tuple(tracks); SameKindPair>, @@ -1481,7 +1511,7 @@ struct DptDptCorrelationsTask { LOGF(DPTDPTLOGCOLLISIONS, "Received %d collisions", collisions.size()); int logcomb = 0; - for (auto& [collision1, tracks1, collision2, tracks2] : pairreco) { + for (auto const& [collision1, tracks1, collision2, tracks2] : pairreco) { if (logcomb < 10) { LOGF(DPTDPTLOGCOLLISIONS, "Received collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", @@ -1513,22 +1543,19 @@ struct DptDptCorrelationsTask { collision1.bc_as().timestamp()); } } - PROCESS_SWITCH(DptDptCorrelationsTask, - processRecLevelMixedNotStored, - "Process reco level mixed events correlations for not stored derived data", - false); + PROCESS_SWITCH(DptDptCorrelationsTask, processRecLevelMixedNotStored, "Process reco level mixed events correlations for not stored derived data", false); using BinningZVtxMultGen = ColumnBinningPolicy; BinningZVtxMultGen bindingOnVtxAndMultGen{{vtxBinsEdges, multBinsEdges}, true}; // true is for 'ignore overflows' (true by default) - void processGenLevelMixed(soa::Filtered& collisions, soa::Filtered& tracks) + void processGenLevelMixed(soa::Filtered const& collisions, soa::Filtered const& tracks) { auto tracksTuple = std::make_tuple(tracks); SameKindPair, soa::Filtered, BinningZVtxMultGen> pairgen{bindingOnVtxAndMultGen, 5, -1, collisions, tracksTuple, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored LOGF(DPTDPTLOGCOLLISIONS, "Received %d generated collisions", collisions.size()); int logcomb = 0; - for (auto& [collision1, tracks1, collision2, tracks2] : pairgen) { + for (auto const& [collision1, tracks1, collision2, tracks2] : pairgen) { if (logcomb < 10) { LOGF(DPTDPTLOGCOLLISIONS, "Received generated collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", collision1.globalIndex(), collision1.posZ(), collision1.centmult(), collision1.collisionaccepted() ? "accepted" : "not accepted", @@ -1544,9 +1571,7 @@ struct DptDptCorrelationsTask { } PROCESS_SWITCH(DptDptCorrelationsTask, processGenLevelMixed, "Process generator level mixed events correlations", false); - void processGenLevelMixedNotStored( - soa::Filtered>& collisions, - soa::Filtered>& tracks) + void processGenLevelMixedNotStored(soa::Filtered> const& collisions, soa::Filtered> const& tracks) { auto tracksTuple = std::make_tuple(tracks); SameKindPair>, @@ -1561,7 +1586,7 @@ struct DptDptCorrelationsTask { LOGF(DPTDPTLOGCOLLISIONS, "Received %d generated collisions", collisions.size()); int logcomb = 0; - for (auto& [collision1, tracks1, collision2, tracks2] : pairgen) { + for (auto const& [collision1, tracks1, collision2, tracks2] : pairgen) { if (logcomb < 10) { LOGF(DPTDPTLOGCOLLISIONS, "Received generated collision pair: %ld (%f, %f): %s, %ld (%f, %f): %s", @@ -1589,10 +1614,7 @@ struct DptDptCorrelationsTask { processMixed(collision1, tracks1, tracks2); } } - PROCESS_SWITCH(DptDptCorrelationsTask, - processGenLevelMixedNotStored, - "Process generator level mixed events correlations for not stored derived data", - false); + PROCESS_SWITCH(DptDptCorrelationsTask, processGenLevelMixedNotStored, "Process generator level mixed events correlations for not stored derived data", false); /// cleans the output object when the task is not used void processCleaner(soa::Filtered const& colls) @@ -1606,7 +1628,7 @@ struct DptDptCorrelationsTask { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - adaptAnalysisTask(cfgc, TaskName{"DptDptCorrelationsTaskRec"}, SetDefaultProcesses{{{"processRecLevel", true}, {"processRecLevelMixed", false}, {"processCleaner", false}}}), - adaptAnalysisTask(cfgc, TaskName{"DptDptCorrelationsTaskGen"}, SetDefaultProcesses{{{"processGenLevel", false}, {"processGenLevelMixed", false}, {"processCleaner", true}}})}; + adaptAnalysisTask(cfgc, TaskName{"DptDptCorrelationsTaskRec"}, SetDefaultProcesses{{{"processRecLevel", true}, {"processRecLevelMixed", false}, {"processCleaner", false}}}), // o2-linter: disable=name/o2-task + adaptAnalysisTask(cfgc, TaskName{"DptDptCorrelationsTaskGen"}, SetDefaultProcesses{{{"processGenLevel", false}, {"processGenLevelMixed", false}, {"processCleaner", true}}})}; // o2-linter: disable=name/o2-task return workflow; } From c14aadf63281f54f366dc65e54ecb023637dd1fa Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 9 Dec 2024 05:02:57 +0100 Subject: [PATCH 284/459] [Common] mult framework cleanup + timestamps (#8862) Co-authored-by: ALICE Builder --- Common/DataModel/Multiplicity.h | 78 ++++++++----------- .../TableProducer/multiplicityExtraTable.cxx | 1 + Common/Tasks/centralityStudy.cxx | 48 ++++++------ Common/Tasks/multiplicityQa.cxx | 6 +- 4 files changed, 61 insertions(+), 72 deletions(-) diff --git a/Common/DataModel/Multiplicity.h b/Common/DataModel/Multiplicity.h index d6ffe63e2b4..1f4a17e11b3 100644 --- a/Common/DataModel/Multiplicity.h +++ b/Common/DataModel/Multiplicity.h @@ -206,54 +206,42 @@ DECLARE_SOA_TABLE(PVMultZeqs, "AOD", "PVMULTZEQ", //! Multiplicity equalized for using MultZeqs = soa::Join; using MultZeq = MultZeqs::iterator; -namespace multBC +namespace mult { -DECLARE_SOA_COLUMN(MultBCFT0A, multBCFT0A, float); //! -DECLARE_SOA_COLUMN(MultBCFT0C, multBCFT0C, float); //! -DECLARE_SOA_COLUMN(MultBCFV0A, multBCFV0A, float); //! -DECLARE_SOA_COLUMN(MultBCFDDA, multBCFDDA, float); //! -DECLARE_SOA_COLUMN(MultBCFDDC, multBCFDDC, float); //! - -DECLARE_SOA_COLUMN(MultBCZNA, multBCZNA, float); //! -DECLARE_SOA_COLUMN(MultBCZNC, multBCZNC, float); //! -DECLARE_SOA_COLUMN(MultBCZEM1, multBCZEM1, float); //! -DECLARE_SOA_COLUMN(MultBCZEM2, multBCZEM2, float); //! -DECLARE_SOA_COLUMN(MultBCZPA, multBCZPA, float); //! -DECLARE_SOA_COLUMN(MultBCZPC, multBCZPC, float); //! +// extra BC information +DECLARE_SOA_COLUMN(MultTVX, multTVX, bool); //! +DECLARE_SOA_COLUMN(MultFV0OrA, multFV0OrA, bool); //! +DECLARE_SOA_COLUMN(MultV0triggerBits, multV0triggerBits, uint8_t); //! +DECLARE_SOA_COLUMN(MultT0triggerBits, multT0triggerBits, uint8_t); //! +DECLARE_SOA_COLUMN(MultFDDtriggerBits, multFDDtriggerBits, uint8_t); //! +DECLARE_SOA_COLUMN(MultTriggerMask, multTriggerMask, uint64_t); //! CTP trigger mask +DECLARE_SOA_COLUMN(MultCollidingBC, multCollidingBC, bool); //! CTP trigger mask -DECLARE_SOA_COLUMN(MultBCTVX, multBCTVX, bool); //! -DECLARE_SOA_COLUMN(MultBCFV0OrA, multBCFV0OrA, bool); //! -DECLARE_SOA_COLUMN(MultBCV0triggerBits, multBCV0triggerBits, uint8_t); //! -DECLARE_SOA_COLUMN(MultBCT0triggerBits, multBCT0triggerBits, uint8_t); //! -DECLARE_SOA_COLUMN(MultBCFDDtriggerBits, multBCFDDtriggerBits, uint8_t); //! -DECLARE_SOA_COLUMN(MultBCTriggerMask, multBCTriggerMask, uint64_t); //! CTP trigger mask -DECLARE_SOA_COLUMN(MultBCColliding, multBCColliding, bool); //! CTP trigger mask - -DECLARE_SOA_COLUMN(MultBCFT0PosZ, multBCFT0PosZ, float); //! Position along Z computed with the FT0 information within the BC -DECLARE_SOA_COLUMN(MultBCFT0PosZValid, multBCFT0PosZValid, bool); //! Validity of the position along Z computed with the FT0 information within the BC - -} // namespace multBC +DECLARE_SOA_COLUMN(MultFT0PosZ, multFT0PosZ, float); //! Position along Z computed with the FT0 information within the BC +DECLARE_SOA_COLUMN(MultFT0PosZValid, multFT0PosZValid, bool); //! Validity of the position along Z computed with the FT0 information +} // namespace mult DECLARE_SOA_TABLE(MultBCs, "AOD", "MULTBC", //! - multBC::MultBCFT0A, - multBC::MultBCFT0C, - multBC::MultBCFT0PosZ, - multBC::MultBCFT0PosZValid, - multBC::MultBCFV0A, - multBC::MultBCFDDA, - multBC::MultBCFDDC, - multBC::MultBCZNA, - multBC::MultBCZNC, - multBC::MultBCZEM1, - multBC::MultBCZEM2, - multBC::MultBCZPA, - multBC::MultBCZPC, - multBC::MultBCTVX, - multBC::MultBCFV0OrA, - multBC::MultBCV0triggerBits, - multBC::MultBCT0triggerBits, - multBC::MultBCFDDtriggerBits, - multBC::MultBCTriggerMask, - multBC::MultBCColliding, + mult::MultFT0A, + mult::MultFT0C, + mult::MultFT0PosZ, + mult::MultFT0PosZValid, + mult::MultFV0A, + mult::MultFDDA, + mult::MultFDDC, + mult::MultZNA, + mult::MultZNC, + mult::MultZEM1, + mult::MultZEM2, + mult::MultZPA, + mult::MultZPC, + mult::MultTVX, + mult::MultFV0OrA, + mult::MultV0triggerBits, + mult::MultT0triggerBits, + mult::MultFDDtriggerBits, + mult::MultTriggerMask, + mult::MultCollidingBC, + timestamp::Timestamp, bc::Flags); using MultBC = MultBCs::iterator; diff --git a/Common/TableProducer/multiplicityExtraTable.cxx b/Common/TableProducer/multiplicityExtraTable.cxx index 216a1b7acc6..001e75e6adb 100644 --- a/Common/TableProducer/multiplicityExtraTable.cxx +++ b/Common/TableProducer/multiplicityExtraTable.cxx @@ -245,6 +245,7 @@ struct MultiplicityExtraTable { tru(multFDDA), tru(multFDDC), tru(multZNA), tru(multZNC), tru(multZEM1), tru(multZEM2), tru(multZPA), tru(multZPC), Tvx, isFV0OrA, multFV0TriggerBits, multFT0TriggerBits, multFDDTriggerBits, multBCTriggerMask, collidingBC, + bc.timestamp(), bc.flags()); } } diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index bcb714d2a87..f9774f0963e 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -412,59 +412,59 @@ struct centralityStudy { // process BCs, calculate FT0C distribution // conditionals suggested by FIT team (Jacek O. et al) histos.fill(HIST("hBCSelection"), 0); // all BCs - if (selectCollidingBCs && !multbc.multBCColliding()) + if (selectCollidingBCs && !multbc.multCollidingBC()) return; histos.fill(HIST("hBCSelection"), 1); // colliding - if (selectTVX && !multbc.multBCTVX()) + if (selectTVX && !multbc.multTVX()) return; histos.fill(HIST("hBCSelection"), 2); // TVX - if (selectFV0OrA && !multbc.multBCFV0OrA()) + if (selectFV0OrA && !multbc.multFV0OrA()) return; histos.fill(HIST("hBCSelection"), 3); // FV0OrA if (vertexZwithT0 < 100.0f) { - if (!multbc.multBCFT0PosZValid()) + if (!multbc.multFT0PosZValid()) return; - if (TMath::Abs(multbc.multBCFT0PosZ()) > vertexZwithT0) + if (TMath::Abs(multbc.multFT0PosZ()) > vertexZwithT0) return; } histos.fill(HIST("hBCSelection"), 4); // FV0OrA - if (multbc.multBCFT0C() < upcRejection.maxFT0CforZNACselection && - multbc.multBCZNA() < upcRejection.minZNACsignal && - multbc.multBCZNC() < upcRejection.minZNACsignal) { + if (multbc.multFT0C() < upcRejection.maxFT0CforZNACselection && + multbc.multZNA() < upcRejection.minZNACsignal && + multbc.multZNC() < upcRejection.minZNACsignal) { return; } - if (multbc.multBCFT0C() < upcRejection.maxFT0CforFV0Aselection && - multbc.multBCFV0A() < upcRejection.minFV0Asignal) { + if (multbc.multFT0C() < upcRejection.maxFT0CforFV0Aselection && + multbc.multFV0A() < upcRejection.minFV0Asignal) { return; } - if (multbc.multBCFT0C() < upcRejection.maxFT0CforFDDAselection && - multbc.multBCFDDA() < upcRejection.minFDDAsignal) { + if (multbc.multFT0C() < upcRejection.maxFT0CforFDDAselection && + multbc.multFDDA() < upcRejection.minFDDAsignal) { return; } histos.fill(HIST("hBCSelection"), 5); // znac // if we got here, we also finally fill the FT0C histogram, please - histos.fill(HIST("hFT0C_BCs"), multbc.multBCFT0C() * scaleSignalFT0C); + histos.fill(HIST("hFT0C_BCs"), multbc.multFT0C() * scaleSignalFT0C); // ZN signals - histos.fill(HIST("hZNAvsFT0C_BCs"), multbc.multBCFT0C() * scaleSignalFT0C, multbc.multBCZNA()); - histos.fill(HIST("hZNCvsFT0C_BCs"), multbc.multBCFT0C() * scaleSignalFT0C, multbc.multBCZNC()); - - histos.fill(HIST("hFT0M_BCs"), (multbc.multBCFT0A() + multbc.multBCFT0C()) * scaleSignalFT0M); - histos.fill(HIST("hFV0A_BCs"), multbc.multBCFV0A() * scaleSignalFV0A); - if (multbc.multBCFT0PosZValid()) { - histos.fill(HIST("hFT0CvsPVz_BCs_All"), multbc.multBCFT0PosZ(), multbc.multBCFT0C() * scaleSignalFT0C); - if (multbc.multBCFT0C() > minFT0CforVertexZ) { - histos.fill(HIST("hFT0CvsPVz_BCs"), multbc.multBCFT0PosZ(), multbc.multBCFT0C() * scaleSignalFT0C); + histos.fill(HIST("hZNAvsFT0C_BCs"), multbc.multFT0C() * scaleSignalFT0C, multbc.multZNA()); + histos.fill(HIST("hZNCvsFT0C_BCs"), multbc.multFT0C() * scaleSignalFT0C, multbc.multZNC()); + + histos.fill(HIST("hFT0M_BCs"), (multbc.multFT0A() + multbc.multFT0C()) * scaleSignalFT0M); + histos.fill(HIST("hFV0A_BCs"), multbc.multFV0A() * scaleSignalFV0A); + if (multbc.multFT0PosZValid()) { + histos.fill(HIST("hFT0CvsPVz_BCs_All"), multbc.multFT0PosZ(), multbc.multFT0C() * scaleSignalFT0C); + if (multbc.multFT0C() > minFT0CforVertexZ) { + histos.fill(HIST("hFT0CvsPVz_BCs"), multbc.multFT0PosZ(), multbc.multFT0C() * scaleSignalFT0C); } } if (multbc.has_ft0Mult()) { auto multco = multbc.ft0Mult_as>(); - if (multbc.multBCFT0PosZValid()) { - histos.fill(HIST("hVertexZ_BCvsCO"), multco.multPVz(), multbc.multBCFT0PosZ()); + if (multbc.multFT0PosZValid()) { + histos.fill(HIST("hVertexZ_BCvsCO"), multco.multPVz(), multbc.multFT0PosZ()); } } } diff --git a/Common/Tasks/multiplicityQa.cxx b/Common/Tasks/multiplicityQa.cxx index 3bf0f769b79..3fc2374c2cc 100644 --- a/Common/Tasks/multiplicityQa.cxx +++ b/Common/Tasks/multiplicityQa.cxx @@ -405,9 +405,9 @@ struct MultiplicityQa { void processFIT(aod::MultBCs const& multsdebug) { for (auto& mult : multsdebug) { - histos.fill(HIST("multiplicityQa/hIsolatedFT0A"), mult.multBCFT0A()); - histos.fill(HIST("multiplicityQa/hIsolatedFT0C"), mult.multBCFT0C()); - histos.fill(HIST("multiplicityQa/hIsolatedFT0M"), mult.multBCFT0A() + mult.multBCFT0C()); + histos.fill(HIST("multiplicityQa/hIsolatedFT0A"), mult.multFT0A()); + histos.fill(HIST("multiplicityQa/hIsolatedFT0C"), mult.multFT0C()); + histos.fill(HIST("multiplicityQa/hIsolatedFT0M"), mult.multFT0A() + mult.multFT0C()); } } From 181b55926a7cc952546581a3f1d2ffb9edca46c5 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Mon, 9 Dec 2024 06:13:39 +0100 Subject: [PATCH 285/459] [PWGEM/Dilepton] update prefilter task (#8863) --- PWGEM/Dilepton/Core/Dilepton.h | 2 +- PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 8e31f9c63a7..f6a5ceedbef 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -532,7 +532,7 @@ struct Dilepton { if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca}, true); fRegistry.add("Pair/same/uls/hsDeltaP", "difference of p between 2 tracks;|p_{T,1} - p_{T,2}|/|p_{T,1} + p_{T,2}|;#Delta#eta;#Delta#varphi (rad.);", kTHnSparseD, {{20, 0, 1}, {100, -1, +1}, {180, -M_PI, M_PI}}, true); - fRegistry.add("Pair/same/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {80, -20, 20}}, true); + fRegistry.add("Pair/same/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {200, -10, 10}}, true); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron fRegistry.add("Pair/same/uls/hMvsOpAng", "m_{ee} vs. angle between 2 tracks;#omega (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{100, 0, 2.0}, {20, 0.0f, 3.2}}, true); diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index a5e7db3d50d..b89874d9477 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -232,7 +232,7 @@ struct prefilterDielectron { fRegistry.add("Pair/before/uls/hMvsPt", "m_{ee} vs. p_{T,ee}", kTH2D, {axis_mass, axis_pair_pt}, true); fRegistry.add("Pair/before/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {axis_phiv, {200, 0, 1}}, true); fRegistry.add("Pair/before/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {100, -1, +1}}, true); - fRegistry.add("Pair/before/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {80, -20, 20}}, true); + fRegistry.add("Pair/before/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {200, -10, 10}}, true); fRegistry.addClone("Pair/before/uls/", "Pair/before/lspp/"); fRegistry.addClone("Pair/before/uls/", "Pair/before/lsmm/"); fRegistry.addClone("Pair/before/", "Pair/after/"); From 140b6d7616704a19a33a158388c3a27c1426cb7c Mon Sep 17 00:00:00 2001 From: blacwovie Date: Mon, 9 Dec 2024 15:00:17 +0800 Subject: [PATCH 286/459] [PWGLF] add ITSnsigma cut and configurable of saving LSandUS (#8853) --- PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx | 77 +++++++++---------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx b/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx index c42e5eee06c..5f05fb4fa1d 100644 --- a/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx +++ b/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx @@ -46,6 +46,7 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/PIDResponseITS.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/TableProducer/PID/pidTOFBase.h" @@ -174,10 +175,12 @@ struct he3hadronfemto { Configurable setting_cutPtMinhe3Had{"setting_cutPtMinhe3Had", 0.0f, "Minimum PT cut on he3Had4"}; Configurable setting_cutClSizeItsHe3{"setting_cutClSizeItsHe3", 4.0f, "Minimum ITS cluster size for He3"}; Configurable setting_cutNsigmaTPC{"setting_cutNsigmaTPC", 3.0f, "Value of the TPC Nsigma cut"}; + Configurable setting_cutNsigmaITS{"setting_cutNsigmaITS", -1.5f, "Value of the TPC Nsigma cut"}; Configurable setting_cutPtMinTOFHad{"setting_cutPtMinTOFHad", 0.4f, "Minimum pT to apply the TOF cut on hadrons"}; Configurable setting_cutNsigmaTOF{"setting_cutNsigmaTOF", 3.0f, "Value of the TOF Nsigma cut"}; Configurable setting_noMixedEvents{"setting_noMixedEvents", 5, "Number of mixed events per event"}; Configurable setting_enableBkgUS{"setting_enableBkgUS", false, "Enable US background"}; + Configurable setting_saveUSandLS{"setting_saveUSandLS", true, "Save All Pairs"}; Configurable setting_isMC{"setting_isMC", false, "Run MC"}; Configurable setting_fillMultiplicity{"setting_fillMultiplicity", false, "Fill multiplicity table"}; @@ -206,8 +209,8 @@ struct he3hadronfemto { // binning for EM background ConfigurableAxis axisVertex{"axisVertex", {30, -10, 10}, "Binning for multiplicity"}; - ConfigurableAxis axisCentrality{"axisCentrality", {VARIABLE_WIDTH, 0., 15., 30., 45., 60., 75., 95., 250.}, "Binning for centrality"}; - using BinningType = ColumnBinningPolicy; + ConfigurableAxis axisCentrality{"axisCentrality", {40, 0, 100}, "Binning for centrality"}; + using BinningType = ColumnBinningPolicy; BinningType binningPolicy{{axisVertex, axisCentrality}, true}; SliceCache cache; SameKindPair m_pair{binningPolicy, setting_noMixedEvents, -1, &cache}; @@ -237,16 +240,17 @@ struct he3hadronfemto { {"hDCAxyHe3", ";DCA_{xy} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, {"hDCAzHe3", ";DCA_{z} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, {"hhe3HadtInvMass", "; M(^{3}He + p) (GeV/#it{c}^{2})", {HistType::kTH1F, {{50, 3.74f, 3.85f}}}}, - {"hHe3Pt", "#it{p}_{T} distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{200, -6.0f, 6.0f}}}}, - {"hHadronPt", "Pt distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{200, -3.0f, 3.0f}}}}, + {"hHe3Pt", "#it{p}_{T} distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}}, + {"hHadronPt", "Pt distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, {"h2dEdxHe3candidates", "dEdx distribution; #it{p} (GeV/#it{c}); dE/dx (a.u.)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {100, 0.0f, 2000.0f}}}}, - {"h2ClSizeCosLamHe3", "; n#sigma_{TPC} ; #LT ITS Cluster Size #GT #LT cos#lambda #GT (^{3}He)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {120, 0.0f, 15.0f}}}}, - {"h2NsigmaHe3TPC", "NsigmaHe3 TPC distribution; #it{p}/z (GeV/#it{c}); n#sigma_{TPC}(^{3}He)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, - {"h2NsigmaHe3TPC_preselection", "NsigmaHe3 TPC distribution; #it{p}/z (GeV/#it{c}); n#sigma_{TPC}(^{3}He)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {200, -10.0f, 10.0f}}}}, - {"h2NsigmaHadronTPC", "NsigmaHadron TPC distribution; #it{p}/z (GeV/#it{c}); n#sigma_{TPC}(p)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, - {"h2NsigmaHadronTPC_preselection", "NsigmaHe3 TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(^{3}He)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {200, -10.0f, 10.0f}}}}, - {"h2NsigmaHadronTOF", "NsigmaHadron TOF distribution; #it{p} (GeV/#it{c}); n#sigma_{TOF}(p)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, - {"h2NsigmaHadronTOF_preselection", "NsigmaHadron TOF distribution; #it{p} (GeV/#it{c}); n#sigma_{TOF}(p)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {200, -10.0f, 10.0f}}}}, + {"h2NsigmaHe3TPC", "NsigmaHe3 TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(^{3}He)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, + {"h2NsigmaHe3TPC_preselection", "NsigmaHe3 TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(^{3}He)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, + {"h2NSigmaHe3ITS_preselection", "NsigmaHe3 ITS distribution; signed #it{p}_{T} (GeV/#it{c}); n#sigma_{ITS} ^{3}He", {HistType::kTH2F, {{50, -5.0f, 5.0f}, {120, -3.0f, 3.0f}}}}, + {"h2NSigmaHe3ITS", "NsigmaHe3 ITS distribution; signed #it{p}_{T} (GeV/#it{c}); n#sigma_{ITS} ^{3}He", {HistType::kTH2F, {{50, -5.0f, 5.0f}, {120, -3.0f, 3.0f}}}}, + {"h2NsigmaHadronTPC", "NsigmaHadron TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(p)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, + {"h2NsigmaHadronTPC_preselection", "NsigmaHe3 TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(^{3}He)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, + {"h2NsigmaHadronTOF", "NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(p)", {HistType::kTH2F, {{20, -5.0f, 5.0f}, {200, -5.0f, 5.0f}}}}, + {"h2NsigmaHadronTOF_preselection", "NsigmaHadron TOF distribution; #iit{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(p)", {HistType::kTH2F, {{100, -5.0f, 5.0f}, {400, -10.0f, 10.0f}}}}, }, OutputObjHandlingPolicy::AnalysisObject, false, @@ -425,15 +429,15 @@ struct he3hadronfemto { if (std::abs(tpcNSigmaHad) > setting_cutNsigmaTPC) { return false; } - m_qaRegistry.fill(HIST("h2NsigmaHadronTOF_preselection"), candidate.p(), tofNSigmaHad); + m_qaRegistry.fill(HIST("h2NsigmaHadronTOF_preselection"), candidate.pt(), tofNSigmaHad); if (std::abs(tofNSigmaHad) > setting_cutNsigmaTOF) { return false; } - m_qaRegistry.fill(HIST("h2NsigmaHadronTPC"), candidate.tpcInnerParam(), tpcNSigmaHad); - m_qaRegistry.fill(HIST("h2NsigmaHadronTOF"), candidate.p(), tofNSigmaHad); + m_qaRegistry.fill(HIST("h2NsigmaHadronTPC"), candidate.pt(), tpcNSigmaHad); + m_qaRegistry.fill(HIST("h2NsigmaHadronTOF"), candidate.pt(), tofNSigmaHad); return true; } else if (std::abs(tpcNSigmaHad) < setting_cutNsigmaTPC) { - m_qaRegistry.fill(HIST("h2NsigmaHadronTPC"), candidate.tpcInnerParam(), tpcNSigmaHad); + m_qaRegistry.fill(HIST("h2NsigmaHadronTPC"), candidate.pt(), tpcNSigmaHad); return true; } return false; @@ -460,30 +464,23 @@ struct he3hadronfemto { return false; } - float cosl = 1. / std::cosh(candidate.eta()); - float meanClsizeIts = 0.f; - int nHitsIts = 0; - for (int ilayer = 0; ilayer < 7; ilayer++) { - float clsizeLayer = (candidate.itsClusterSizes() >> ilayer * 4) & 0b1111; - if (clsizeLayer > 0) { - nHitsIts++; - meanClsizeIts += clsizeLayer; - } - } - float clsizeCoslIts = meanClsizeIts / nHitsIts * cosl; - if (clsizeCoslIts < setting_cutClSizeItsHe3) { - return false; - } - auto nSigmaHe3 = computeNSigmaHe3(candidate); - m_qaRegistry.fill(HIST("h2NsigmaHe3TPC_preselection"), candidate.sign() * correctedTPCinnerParam, nSigmaHe3); + m_qaRegistry.fill(HIST("h2NsigmaHe3TPC_preselection"), candidate.sign() * 2 * candidate.pt(), nSigmaHe3); if (std::abs(nSigmaHe3) > setting_cutNsigmaTPC) { return false; } + // + o2::aod::ITSResponse m_responseITS; + auto ITSnSigmaHe3 = m_responseITS.nSigmaITS(candidate.itsClusterSizes(), 2 * candidate.p(), candidate.eta()); + // + m_qaRegistry.fill(HIST("h2NSigmaHe3ITS_preselection"), candidate.sign() * 2 * candidate.pt(), ITSnSigmaHe3); + if (ITSnSigmaHe3 < setting_cutNsigmaITS) { + return false; + } m_qaRegistry.fill(HIST("h2dEdxHe3candidates"), candidate.sign() * correctedTPCinnerParam, candidate.tpcSignal()); - m_qaRegistry.fill(HIST("h2NsigmaHe3TPC"), candidate.sign() * correctedTPCinnerParam, nSigmaHe3); - m_qaRegistry.fill(HIST("h2ClSizeCosLamHe3"), nSigmaHe3, clsizeCoslIts); + m_qaRegistry.fill(HIST("h2NsigmaHe3TPC"), candidate.sign() * 2 * candidate.pt(), nSigmaHe3); + m_qaRegistry.fill(HIST("h2NSigmaHe3ITS"), candidate.sign() * 2 * candidate.pt(), ITSnSigmaHe3); return true; } @@ -571,7 +568,7 @@ struct he3hadronfemto { he3Hadcand.nTPCClustersHe3 = trackHe3.tpcNClsFound(); he3Hadcand.nSigmaHe3 = computeNSigmaHe3(trackHe3); he3Hadcand.nSigmaHad = computeTPCNSigmaHadron(trackHad); - // he3Hadcand.nSigmaHad = trackHad.tpcNSigmaPi();/*tpcNSigmaHad*/ + he3Hadcand.chi2TPCHe3 = trackHe3.tpcChi2NCl(); he3Hadcand.chi2TPCHad = trackHad.tpcChi2NCl(); @@ -645,11 +642,13 @@ struct he3hadronfemto { continue; } - if (!setting_enableBkgUS && (track0.sign() * track1.sign() < 0)) { - continue; - } - if (setting_enableBkgUS && (track0.sign() * track1.sign() > 0)) { - continue; + if (!setting_saveUSandLS) { + if (!setting_enableBkgUS && (track0.sign() * track1.sign() < 0)) { + continue; + } + if (setting_enableBkgUS && (track0.sign() * track1.sign() > 0)) { + continue; + } } if (!selectTrack(track1) || !selectionPIDHadron(track1)) { From 5f7d27023310c93de8346dc4c3f300fbd454f5e3 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Mon, 9 Dec 2024 08:33:46 +0100 Subject: [PATCH 287/459] [PWGHF] added cumulant corrections for flow (#8855) Co-authored-by: Prottay Das --- .../Tasks/taskDirectedFlowCharmHadrons.cxx | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index a4d9b9fcfe1..75cfe1690c1 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -125,6 +125,13 @@ struct HfTaskDirectedFlowCharmHadrons { registry.add("hpuxyQxytvscentpteta", "hpuxyQxytvscentpteta", HistType::kTHnSparseF, axes, true); registry.add("hpoddvscentpteta", "hpoddvscentpteta", HistType::kTHnSparseF, axes, true); registry.add("hpevenvscentpteta", "hpevenvscentpteta", HistType::kTHnSparseF, axes, true); + + registry.add("hpQxpvscent", "hpQxpvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQypvscent", "hpQypvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQxtvscent", "hpQxtvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQytvscent", "hpQytvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpuxvscentpteta", "hpuxvscentpteta", HistType::kTHnSparseF, axes, true); + registry.add("hpuyvscentpteta", "hpuyvscentpteta", HistType::kTHnSparseF, axes, true); } else { registry.add("hpQxtQxpvscent", "hpQxtQxpvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); registry.add("hpQytQypvscent", "hpQytQypvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); @@ -134,6 +141,13 @@ struct HfTaskDirectedFlowCharmHadrons { registry.add("hpuyQypvscentpteta", "hpuyQypvscentpteta", HistType::kTHnSparseF, axes, true); registry.add("hpuxQxtvscentpteta", "hpuxQxtvscentpteta", HistType::kTHnSparseF, axes, true); registry.add("hpuyQytvscentpteta", "hpuyQytvscentpteta", HistType::kTHnSparseF, axes, true); + + registry.add("hpQxpvscent", "hpQxpvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQypvscent", "hpQypvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQxtvscent", "hpQxtvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpQytvscent", "hpQytvscent", HistType::kTHnSparseF, {thnAxisCent, thnAxisScalarProd}, true); + registry.add("hpuxvscentpteta", "hpuxvscentpteta", HistType::kTHnSparseF, axes, true); + registry.add("hpuyvscentpteta", "hpuyvscentpteta", HistType::kTHnSparseF, axes, true); } ccdb->setURL(ccdbUrl); @@ -198,11 +212,19 @@ struct HfTaskDirectedFlowCharmHadrons { // correlations in the denominators for SP calculation if (direct) { registry.fill(HIST("hpQxytpvscent"), cent, Qxytp); + registry.fill(HIST("hpQxpvscent"), cent, qxZDCA); + registry.fill(HIST("hpQxtvscent"), cent, qxZDCC); + registry.fill(HIST("hpQypvscent"), cent, qyZDCA); + registry.fill(HIST("hpQytvscent"), cent, qyZDCC); } else { registry.fill(HIST("hpQxtQxpvscent"), cent, QxtQxp); registry.fill(HIST("hpQytQypvscent"), cent, QytQyp); registry.fill(HIST("hpQxpQytvscent"), cent, QxpQyt); registry.fill(HIST("hpQxtQypvscent"), cent, QxtQyp); + registry.fill(HIST("hpQxpvscent"), cent, qxZDCA); + registry.fill(HIST("hpQxtvscent"), cent, qxZDCC); + registry.fill(HIST("hpQypvscent"), cent, qyZDCA); + registry.fill(HIST("hpQytvscent"), cent, qyZDCC); } for (const auto& candidate : candidates) { @@ -283,11 +305,18 @@ struct HfTaskDirectedFlowCharmHadrons { registry.fill(HIST("hpuxyQxytvscentpteta"), massCand, cent, ptCand, etaCand, uxyQxyt, sign, outputMl[0], outputMl[1]); registry.fill(HIST("hpoddvscentpteta"), massCand, cent, ptCand, etaCand, oddv1, sign, outputMl[0], outputMl[1]); registry.fill(HIST("hpevenvscentpteta"), massCand, cent, ptCand, etaCand, evenv1, sign, outputMl[0], outputMl[1]); + + registry.fill(HIST("hpuxvscentpteta"), massCand, cent, ptCand, etaCand, ux, sign, outputMl[0], outputMl[1]); + registry.fill(HIST("hpuyvscentpteta"), massCand, cent, ptCand, etaCand, uy, sign, outputMl[0], outputMl[1]); + } else { registry.fill(HIST("hpuxQxpvscentpteta"), massCand, cent, ptCand, etaCand, uxQxp, sign, outputMl[0], outputMl[1]); registry.fill(HIST("hpuyQypvscentpteta"), massCand, cent, ptCand, etaCand, uyQyp, sign, outputMl[0], outputMl[1]); registry.fill(HIST("hpuxQxtvscentpteta"), massCand, cent, ptCand, etaCand, uxQxt, sign, outputMl[0], outputMl[1]); registry.fill(HIST("hpuyQytvscentpteta"), massCand, cent, ptCand, etaCand, uyQyt, sign, outputMl[0], outputMl[1]); + + registry.fill(HIST("hpuxvscentpteta"), massCand, cent, ptCand, etaCand, ux, sign, outputMl[0], outputMl[1]); + registry.fill(HIST("hpuyvscentpteta"), massCand, cent, ptCand, etaCand, uy, sign, outputMl[0], outputMl[1]); } } else { if (direct) { @@ -295,11 +324,17 @@ struct HfTaskDirectedFlowCharmHadrons { registry.fill(HIST("hpuxyQxytvscentpteta"), massCand, cent, ptCand, etaCand, uxyQxyt, sign); registry.fill(HIST("hpoddvscentpteta"), massCand, cent, ptCand, etaCand, oddv1, sign); registry.fill(HIST("hpevenvscentpteta"), massCand, cent, ptCand, etaCand, evenv1, sign); + + registry.fill(HIST("hpuxvscentpteta"), massCand, cent, ptCand, etaCand, ux, sign); + registry.fill(HIST("hpuyvscentpteta"), massCand, cent, ptCand, etaCand, uy, sign); } else { registry.fill(HIST("hpuxQxpvscentpteta"), massCand, cent, ptCand, etaCand, uxQxp, sign); registry.fill(HIST("hpuyQypvscentpteta"), massCand, cent, ptCand, etaCand, uyQyp, sign); registry.fill(HIST("hpuxQxtvscentpteta"), massCand, cent, ptCand, etaCand, uxQxt, sign); registry.fill(HIST("hpuyQytvscentpteta"), massCand, cent, ptCand, etaCand, uyQyt, sign); + + registry.fill(HIST("hpuxvscentpteta"), massCand, cent, ptCand, etaCand, ux, sign); + registry.fill(HIST("hpuyvscentpteta"), massCand, cent, ptCand, etaCand, uy, sign); } } } From 33bcb7084024a3339945815bbee910105c7e4439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:55:25 +0100 Subject: [PATCH 288/459] [PWGHF] Add missing subscription for D0 candidates tables (#8849) --- PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index 75cfe1690c1..763a1292a52 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -341,6 +341,7 @@ struct HfTaskDirectedFlowCharmHadrons { } // D0 with ML void processD0Ml(CollsWithQvecs::iterator const& collision, + CandD0DataWMl const& /*candidatesD0*/, TracksWithExtra const& tracks) { auto candsD0ToPiKWMl = selectedD0ToPiKWMl->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); @@ -352,6 +353,7 @@ struct HfTaskDirectedFlowCharmHadrons { // D0 with rectangular cuts void processD0Std(CollsWithQvecs::iterator const& collision, + CandD0Data const& /*candidatesD0*/, TracksWithExtra const& tracks) { auto candsD0ToPiK = selectedD0ToPiK->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); From 62cc00007b7102a65748743f730fa6e835ec28cf Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Mon, 9 Dec 2024 11:12:55 +0100 Subject: [PATCH 289/459] [PWGDQ] Adding correct errors for Tprofiles Cumulants (#8860) --- PWGDQ/Core/HistogramsLibrary.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 8c5723839cc..335dbaaecf3 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -268,14 +268,14 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Psi2A_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2A); hm->AddHistogram(histClass, "Psi2B_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2B); hm->AddHistogram(histClass, "Psi2C_CentFT0C", "", false, 90, 0.0, 90.0, VarManager::kCentFT0C, 100, -2.0, 2.0, VarManager::kPsi2C); - hm->AddHistogram(histClass, "centrFT0C_Corr2REF_ev", "centrFT0C_Corr2REF_ev, --s--", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REF, VarManager::kM11REF); - hm->AddHistogram(histClass, "centrFT0C_Corr2REFetagap_ev", "centrFT0C_Corr2REFetagap_ev, --s--", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); - hm->AddHistogram(histClass, "centrFT0C_Corr4REF_ev", "centrFT0C_Corr4REF_ev, --s--", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR4REF, VarManager::kM1111REF); - hm->AddHistogram(histClass, "centrFT0C_Corr2Corr4REF_ev", "centrFT0C_Corr2Corr4REF_ev, --s--", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); - hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REF_ev", "Run2_centrFT0C_Corr2REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2REF, VarManager::kM11REF); - hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "Run2_centrFT0C_Corr2REFetagap_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); - hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "Run2_centrFT0C_Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); - hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2Corr4REF_ev", "Run2_centrFT0C_Corr2Corr4REF_ev, --s--", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2CORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); + hm->AddHistogram(histClass, "centrFT0C_Corr2REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REF, VarManager::kM11REF); + hm->AddHistogram(histClass, "centrFT0C_Corr2REFetagap_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); + hm->AddHistogram(histClass, "centrFT0C_Corr4REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR4REF, VarManager::kM1111REF); + hm->AddHistogram(histClass, "centrFT0C_Corr2Corr4REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 250, -1.0, 1.0, VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); + hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REF_ev", "", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2REF, VarManager::kM11REF); + hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2REFetagap_ev", "", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2REFetagap, 0, nullptr, -1, "", "", "", VarManager::kCORR2REFetagap, VarManager::kM11REFetagap); + hm->AddHistogram(histClass, "Run2_centrFT0C_Corr4REF_ev", "", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR4REF, VarManager::kM1111REF); + hm->AddHistogram(histClass, "Run2_centrFT0C_Corr2Corr4REF_ev", "", true, 9, std::array{0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0}.data(), VarManager::kCentFT0C, 250, std::array{-1.0, 1.0}.data(), VarManager::kCORR2CORR4REF, 0, nullptr, -1, "", "", "", VarManager::kCORR2CORR4REF, VarManager::kM11M1111REF); hm->AddHistogram(histClass, "centrFT0C_M11REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 1000000.0, VarManager::kM11REF); hm->AddHistogram(histClass, "centrFT0C_M11etagap_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 10000000.0, VarManager::kM11REFetagap); hm->AddHistogram(histClass, "centrFT0C_M1111REF_ev", "", true, 100, 0.0, 100.0, VarManager::kCentFT0C, 1000, 0.0, 100000000000000.0, VarManager::kM1111REF); From 8c679de2e6a933e2d3d27b00d010ea47eb9a500a Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Mon, 9 Dec 2024 11:50:22 +0100 Subject: [PATCH 290/459] [PWGEM/Dilepton] update createResolutionMap.cxx (#8871) --- PWGEM/Dilepton/Tasks/createResolutionMap.cxx | 40 ++++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx index bfcf7e4f8f4..6df7af5c768 100644 --- a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx +++ b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx @@ -13,6 +13,12 @@ // Analysis task to produce resolution mapfor electrons/muons in dilepton analysis // Please write to: daiki.sekihata@cern.ch +#include +#include +#include +#include +#include + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -66,6 +72,16 @@ struct CreateResolutionMap { Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; Configurable cfgEventGeneratorType{"cfgEventGeneratorType", -1, "if positive, select event generator type. i.e. gap or signal"}; + ConfigurableAxis ConfPtGenBins{"ConfPtGenBins", {VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.50, 6.00, 6.50, 7.00, 7.50, 8.00, 8.50, 9.00, 9.50, 10.00, 11.00, 12.00, 13.00, 14.00, 15.00, 16.00, 17.00, 18.00, 19.00, 20.00}, "gen. pT bins for output histograms"}; + + ConfigurableAxis ConfEtaCBGenBins{"ConfEtaCBGenBins", {30, -1.5, +1.5}, "gen. eta bins at midrapidity for output histograms"}; + ConfigurableAxis ConfEtaFWDGenBins{"ConfEtaFWDGenBins", {30, -5, -2.0}, "gen. eta bins at forward rapidity for output histograms"}; + ConfigurableAxis ConfPhiGenBins{"ConfPhiGenBins", {90, 0, 2.f * M_PI}, "gen. eta bins at forward rapidity for output histograms"}; + + ConfigurableAxis ConfRelDeltaPtBins{"ConfRelDeltaPtBins", {200, -1.f, +1.f}, "rel. dpt for output histograms"}; + ConfigurableAxis ConfDeltaEtaBins{"ConfDeltaEtaBins", {200, -0.1f, +0.1f}, "deta bins for output histograms"}; + ConfigurableAxis ConfDeltaPhiBins{"ConfDeltaPhiBins", {200, -0.1f, +0.1f}, "dphi bins for output histograms"}; + struct : ConfigurableGroup { std::string prefix = "electroncut_group"; Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.01, "min pT for single track"}; @@ -113,10 +129,13 @@ struct CreateResolutionMap { ccdb->setFatalWhenNull(false); ccdbApi.init(ccdburl); - const AxisSpec axis_pt_gen{{0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.50, 6.00, 6.50, 7.00, 7.50, 8.00, 8.50, 9.00, 9.50, 10.00, 11.00, 12.00, 13.00, 14.00, 15.00, 16.00, 17.00, 18.00, 19.00, 20.00}, "p_{T,l}^{gen} (GeV/c)"}; - const AxisSpec axis_dpt{400, -1, 1, "(p_{T,l}^{gen.} - p_{T,l}^{rec.})/p_{T,l}^{gen.}"}; - const AxisSpec axis_deta{500, -0.5, +0.5, "#eta_{l}^{gen.} - #eta_{l}^{rec.}"}; - const AxisSpec axis_dphi{500, -0.5, +0.5, "#varphi_{l}^{gen.} - #varphi_{l}^{rec.} (rad.)"}; + const AxisSpec axis_pt_gen{ConfPtGenBins, "p_{T,l}^{gen} (GeV/c)"}; + const AxisSpec axis_eta_cb_gen{ConfEtaCBGenBins, "#eta_{l}^{gen}"}; + const AxisSpec axis_eta_fwd_gen{ConfEtaFWDGenBins, "#eta_{l}^{gen}"}; + const AxisSpec axis_phi_gen{ConfPhiGenBins, "#varphi_{l}^{gen} (rad.)"}; + const AxisSpec axis_dpt{ConfRelDeltaPtBins, "(p_{T,l}^{gen} - p_{T,l}^{rec})/p_{T,l}^{gen}"}; + const AxisSpec axis_deta{ConfDeltaEtaBins, "#eta_{l}^{gen} - #eta_{l}^{rec}"}; + const AxisSpec axis_dphi{ConfDeltaPhiBins, "#varphi_{l}^{gen} - #varphi_{l}^{rec} (rad.)"}; registry.add("Electron/Ptgen_RelDeltaPt", "resolution", kTH2F, {{axis_pt_gen}, {axis_dpt}}, true); registry.add("Electron/Ptgen_DeltaEta", "resolution", kTH2F, {{axis_pt_gen}, {axis_deta}}, true); @@ -124,6 +143,13 @@ struct CreateResolutionMap { registry.add("Electron/Ptgen_DeltaPhi_Neg", "resolution", kTH2F, {{axis_pt_gen}, {axis_dphi}}, true); registry.addClone("Electron/", "StandaloneMuon/"); registry.addClone("Electron/", "GlobalMuon/"); + + registry.add("Electron/hs_reso_Pos", "6D resolution positive", kTHnSparseF, {axis_pt_gen, axis_eta_cb_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("StandaloneMuon/hs_reso_Pos", "6D resolution positive", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("GlobalMuon/hs_reso_Pos", "6D resolution positive", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("Electron/hs_reso_Neg", "6D resolution negative", kTHnSparseF, {axis_pt_gen, axis_eta_cb_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("StandaloneMuon/hs_reso_Neg", "6D resolution negative", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); + registry.add("GlobalMuon/hs_reso_Neg", "6D resolution negative", kTHnSparseF, {axis_pt_gen, axis_eta_fwd_gen, axis_phi_gen, axis_dpt, axis_deta, axis_dphi}, true); } void initCCDB(aod::BCsWithTimestamps::iterator const& bc) @@ -292,16 +318,20 @@ struct CreateResolutionMap { registry.fill(HIST("StandaloneMuon/Ptgen_DeltaEta"), mctrack.pt(), mctrack.eta() - eta); if (mctrack.pdgCode() == -13) { // positive muon registry.fill(HIST("StandaloneMuon/Ptgen_DeltaPhi_Pos"), mctrack.pt(), mctrack.phi() - phi); + registry.fill(HIST("StandaloneMuon/hs_reso_Pos"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); } else if (mctrack.pdgCode() == 13) { // negative muon registry.fill(HIST("StandaloneMuon/Ptgen_DeltaPhi_Neg"), mctrack.pt(), mctrack.phi() - phi); + registry.fill(HIST("StandaloneMuon/hs_reso_Neg"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); } } else if (muon.trackType() == static_cast(o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack)) { registry.fill(HIST("GlobalMuon/Ptgen_RelDeltaPt"), mctrack.pt(), (mctrack.pt() - pt) / mctrack.pt()); registry.fill(HIST("GlobalMuon/Ptgen_DeltaEta"), mctrack.pt(), mctrack.eta() - eta); if (mctrack.pdgCode() == -13) { // positive muon registry.fill(HIST("GlobalMuon/Ptgen_DeltaPhi_Pos"), mctrack.pt(), mctrack.phi() - phi); + registry.fill(HIST("GlobalMuon/hs_reso_Pos"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); } else if (mctrack.pdgCode() == 13) { // negative muon registry.fill(HIST("GlobalMuon/Ptgen_DeltaPhi_Neg"), mctrack.pt(), mctrack.phi() - phi); + registry.fill(HIST("GlobalMuon/hs_reso_Neg"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - pt) / mctrack.pt(), mctrack.eta() - eta, mctrack.phi() - phi); } } return true; @@ -355,8 +385,10 @@ struct CreateResolutionMap { registry.fill(HIST("Electron/Ptgen_DeltaEta"), mctrack.pt(), mctrack.eta() - track.eta()); if (mctrack.pdgCode() == -11) { // positron registry.fill(HIST("Electron/Ptgen_DeltaPhi_Pos"), mctrack.pt(), mctrack.phi() - track.phi()); + registry.fill(HIST("Electron/hs_reso_Pos"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - track.pt()) / mctrack.pt(), mctrack.eta() - track.eta(), mctrack.phi() - track.phi()); } else if (mctrack.pdgCode() == 11) { // electron registry.fill(HIST("Electron/Ptgen_DeltaPhi_Neg"), mctrack.pt(), mctrack.phi() - track.phi()); + registry.fill(HIST("Electron/hs_reso_Neg"), mctrack.pt(), mctrack.eta(), mctrack.phi(), (mctrack.pt() - track.pt()) / mctrack.pt(), mctrack.eta() - track.eta(), mctrack.phi() - track.phi()); } } // end of track loop From 868a23f151e82f2eb07a2214825ff862c2b459b5 Mon Sep 17 00:00:00 2001 From: upasanasharma31 <84681984+upasanasharma31@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:04:41 +0530 Subject: [PATCH 291/459] [DPG] Add the histo to cal. the decaylength of the mother particle (#8730) --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 15d3eba14df..cf381726f50 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -106,6 +106,7 @@ std::array, nParticles> hPtItsTpcStr; std::array, nParticles> hPtTrkItsTpcStr; std::array, nParticles> hPtItsTpcTofStr; std::array, nParticles> hPtGeneratedStr; +std::array, nParticles> hdecaylengthmother; // histogram to store decaylength of mother // Pt for secondaries from material std::array, nParticles> hPtItsTpcMat; @@ -292,6 +293,7 @@ struct QaEfficiency { LOG(fatal) << "Can't interpret pdgSign " << pdgSign; } + AxisSpec axisDecayLength{100, 0.0, 10.0, "Decay Length (cm)"}; AxisSpec axisPt{ptBins, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec axisP{ptBins, "#it{p} (GeV/#it{c})"}; if (logPt) { @@ -365,6 +367,7 @@ struct QaEfficiency { hPtTrkItsTpcStr[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/trk/its_tpc", PDGs[histogramIndex]), "ITS-TPC tracks (reco from weak decays) " + tagPt, kTH1D, {axisPt}); hPtItsTpcTofStr[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/its_tpc_tof", PDGs[histogramIndex]), "ITS-TPC-TOF tracks (from weak decays) " + tagPt, kTH1D, {axisPt}); hPtGeneratedStr[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/generated", PDGs[histogramIndex]), "Generated (from weak decays) " + tagPt, kTH1D, {axisPt}); + hdecaylengthmother[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/decayLength", PDGs[histogramIndex]), "Decay Length of mother particle" + tagPt, kTH1D, {axisPt}); // Ter hPtItsTpcTer[histogramIndex] = histos.add(Form("MC/pdg%i/pt/ter/its_tpc", PDGs[histogramIndex]), "ITS-TPC tracks (from secondary weak decays) " + tagPt, kTH1D, {axisPt}); @@ -1158,7 +1161,9 @@ struct QaEfficiency { break; } if (motherIsAccepted) { - break; + // Calculate the decay length + double decayLength = std::sqrt(std::pow(mother.vx() - mother.mcCollision().posX(), 2) + std::pow(mother.vy() - mother.mcCollision().posY(), 2) + std::pow(mother.vz() - mother.mcCollision().posZ(), 2)); + hdecaylengthmother[histogramIndex]->Fill(decayLength); } } } From 1ec2e606af6b58e1847efbaa0d0870642790c472 Mon Sep 17 00:00:00 2001 From: Ionut Cristian Arsene Date: Mon, 9 Dec 2024 12:51:07 +0100 Subject: [PATCH 292/459] [PWGDQ] Removing unneeded dependency to TrackCov in v0-selector; Adding process function which does not require TOF in the data skimmer (#8872) Co-authored-by: Ionut Cristian Arsene --- PWGDQ/Core/CutsLibrary.cxx | 39 ++++++++++++++++++++ PWGDQ/Core/HistogramsLibrary.cxx | 18 ++++++--- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 38 +++++++++++++++---- PWGDQ/Tasks/v0selector.cxx | 5 ++- 4 files changed, 86 insertions(+), 14 deletions(-) diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index ae4d9bbb900..67e15aad17d 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -15,6 +15,7 @@ #include #include #include +#include #include "AnalysisCompositeCut.h" #include "VarManager.h" @@ -371,12 +372,31 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) return cut; } + if (!nameStr.compare("JpsiPWGSkimmedCuts4")) { + cut->AddCut(GetAnalysisCut("jpsiKineSkimmed")); + cut->AddCut(GetAnalysisCut("electronTrackQualitySkimmed2")); + cut->AddCut(GetAnalysisCut("jpsi_TPCPID_debug9")); // loose cut + return cut; + } + if (!nameStr.compare("pidElectron_ionut")) { cut->AddCut(GetAnalysisCut("pidcalib_ele")); cut->AddCut(GetAnalysisCut("jpsiStandardKine3")); return cut; } + if (!nameStr.compare("pidElectron_ionut_posEta")) { + cut->AddCut(GetAnalysisCut("pidcalib_ele")); + cut->AddCut(GetAnalysisCut("jpsiPIDcalibKine_posEta")); + return cut; + } + + if (!nameStr.compare("pidElectron_ionut_negEta")) { + cut->AddCut(GetAnalysisCut("pidcalib_ele")); + cut->AddCut(GetAnalysisCut("jpsiPIDcalibKine_negEta")); + return cut; + } + if (!nameStr.compare("pidPion_ionut")) { cut->AddCut(GetAnalysisCut("pidcalib_pion")); cut->AddCut(GetAnalysisCut("jpsiStandardKine3")); @@ -3684,6 +3704,18 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("jpsiPIDcalibKine_posEta")) { + cut->AddCut(VarManager::kPin, 1.0, 1000.0); + cut->AddCut(VarManager::kEta, 0.0, 0.9); + return cut; + } + + if (!nameStr.compare("jpsiPIDcalibKine_negEta")) { + cut->AddCut(VarManager::kPin, 1.0, 1000.0); + cut->AddCut(VarManager::kEta, -0.9, 0.0); + return cut; + } + if (!nameStr.compare("jpsiStandardKine4")) { cut->AddCut(VarManager::kP, 1.5, 1000.0); cut->AddCut(VarManager::kEta, -0.9, 0.9); @@ -4406,6 +4438,13 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("jpsi_TPCPID_debug9")) { + cut->AddCut(VarManager::kTPCnSigmaEl, -2.5, 4.0); + cut->AddCut(VarManager::kTPCnSigmaPi, 1.0, 999, false, VarManager::kPin, 3.0, 999.0); + cut->AddCut(VarManager::kTPCnSigmaPr, 2.0, 999); + return cut; + } + if (!nameStr.compare("pidCut_lowP_Corr")) { cut->AddCut(VarManager::kTPCnSigmaEl_Corr, -3.0, 3.0, false, VarManager::kP, 0.0, 5.0); cut->AddCut(VarManager::kTPCnSigmaPi_Corr, 3.0, 999, false, VarManager::kP, 0.0, 5.0); diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 335dbaaecf3..57f14eee0b9 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -518,21 +518,27 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "TPCnSigEle_pIN", "TPC n-#sigma(e) vs pIN", false, 100, 0.0, 10.0, VarManager::kPin, 100, -5.0, 5.0, VarManager::kTPCnSigmaEl); hm->AddHistogram(histClass, "TPCnSigEle_occupancy", "TPC n-#sigma(e) vs occupancy", false, 200, 0., 20000., VarManager::kTrackOccupancyInTimeRange, 100, -5.0, 5.0, VarManager::kTPCnSigmaEl); hm->AddHistogram(histClass, "TPCnSigEle_timeFromSOR", "TPC n-#sigma(e) vs time from SOR", true, 10000, 0.0, 1000.0, VarManager::kTimeFromSOR, 10, -5.0, 5.0, VarManager::kTPCnSigmaEl); + hm->AddHistogram(histClass, "TPCnSigEle_occupTPCcontribLongA", "TPC n-#sigma(e) vs pileup n-contrib, long time range A-side", false, 20, 0.0, 10000.0, VarManager::kNTPCcontribLongA, 200, -5.0, 5.0, VarManager::kTPCnSigmaEl); + hm->AddHistogram(histClass, "TPCnSigEle_occupTPCmeanTimeLongA", "TPC n-#sigma(e) vs pileup mean time, long time range, A-side", false, 20, -100.0, 100.0, VarManager::kNTPCmeanTimeLongA, 200, -5.0, 5.0, VarManager::kTPCnSigmaEl); + hm->AddHistogram(histClass, "TPCnSigEle_occupTPCmedianTimeLongA", "TPC n-#sigma(e) vs pileup mean time, long time range, A-side", false, 20, -100.0, 100.0, VarManager::kNTPCmedianTimeLongA, 200, -5.0, 5.0, VarManager::kTPCnSigmaEl); + hm->AddHistogram(histClass, "TPCnSigEle_occupTPCcontribShortA", "TPC n-#sigma(e) vs pileup n-contrib, short time range A-side", false, 50, 0.0, 10000.0, VarManager::kNTPCcontribShortA, 200, -5.0, 5.0, VarManager::kTPCnSigmaEl); + hm->AddHistogram(histClass, "TPCnSigEle_occupTPCmeanTimeShortA", "TPC n-#sigma(e) vs pileup mean time, short time range, A-side", false, 20, -15.0, 15.0, VarManager::kNTPCmeanTimeShortA, 200, -5.0, 5.0, VarManager::kTPCnSigmaEl); + hm->AddHistogram(histClass, "TPCnSigEle_occupTPCmedianTimeShortA", "TPC n-#sigma(e) vs pileup mean time, short time range, A-side", false, 20, -15.0, 15.0, VarManager::kNTPCmedianTimeShortA, 200, -5.0, 5.0, VarManager::kTPCnSigmaEl); + hm->AddHistogram(histClass, "TPCnSigEle_occupTPCcontribLongC", "TPC n-#sigma(e) vs pileup n-contrib, long time range C-side", false, 20, 0.0, 10000.0, VarManager::kNTPCcontribLongC, 200, -5.0, 5.0, VarManager::kTPCnSigmaEl); + hm->AddHistogram(histClass, "TPCnSigEle_occupTPCmeanTimeLongC", "TPC n-#sigma(e) vs pileup mean time, long time range, C-side", false, 20, -100.0, 100.0, VarManager::kNTPCmeanTimeLongC, 200, -5.0, 5.0, VarManager::kTPCnSigmaEl); + hm->AddHistogram(histClass, "TPCnSigEle_occupTPCmedianTimeLongC", "TPC n-#sigma(e) vs pileup mean time, long time range, C-side", false, 20, -100.0, 100.0, VarManager::kNTPCmedianTimeLongC, 200, -5.0, 5.0, VarManager::kTPCnSigmaEl); + hm->AddHistogram(histClass, "TPCnSigEle_occupTPCcontribShortC", "TPC n-#sigma(e) vs pileup n-contrib, short time range C-side", false, 50, 0.0, 10000.0, VarManager::kNTPCcontribShortC, 200, -5.0, 5.0, VarManager::kTPCnSigmaEl); + hm->AddHistogram(histClass, "TPCnSigEle_occupTPCmeanTimeShortC", "TPC n-#sigma(e) vs pileup mean time, short time range, C-side", false, 20, -15.0, 15.0, VarManager::kNTPCmeanTimeShortC, 200, -5.0, 5.0, VarManager::kTPCnSigmaEl); + hm->AddHistogram(histClass, "TPCnSigEle_occupTPCmedianTimeShortC", "TPC n-#sigma(e) vs pileup mean time, short time range, C-side", false, 20, -15.0, 15.0, VarManager::kNTPCmedianTimeShortC, 200, -5.0, 5.0, VarManager::kTPCnSigmaEl); hm->AddHistogram(histClass, "TPCnSigPi_pIN", "TPC n-#sigma(#pi) vs pIN", false, 100, 0.0, 10.0, VarManager::kPin, 100, -5.0, 5.0, VarManager::kTPCnSigmaPi); hm->AddHistogram(histClass, "TPCnSigPi_timeFromSOR", "TPC n-#sigma(#pi) vs time from SOR", true, 1000, 0.0, 1000.0, VarManager::kTimeFromSOR, 10, -5.0, 5.0, VarManager::kTPCnSigmaPi); hm->AddHistogram(histClass, "TPCnSigPi_eta", "TPC n-#sigma(#pi) vs #eta", false, 20, -1.0, 1.0, VarManager::kEta, 200, -5.0, 5.0, VarManager::kTPCnSigmaPi); hm->AddHistogram(histClass, "TPCnSigPi_etaPin_prof", " vs (#eta,p_{IN}), --s--", true, 20, -1.0, 1.0, VarManager::kEta, 20, 0.0, 10.0, VarManager::kPin, 10, -5.0, 5.0, VarManager::kTPCnSigmaPi); hm->AddHistogram(histClass, "TPCnSigPi_etaCent_prof", " vs (#eta,cent), --s--", true, 20, -1.0, 1.0, VarManager::kEta, 20, 0.0, 100.0, VarManager::kCentFT0C, 10, -5.0, 5.0, VarManager::kTPCnSigmaPi); hm->AddHistogram(histClass, "TPCnSigPi_etaContrib_prof", " vs (#eta,n-contrib real), --s--", true, 20, -1.0, 1.0, VarManager::kEta, 20, 0.0, 4000.0, VarManager::kVtxNcontribReal, 10, -5.0, 5.0, VarManager::kTPCnSigmaPi); - hm->AddHistogram(histClass, "TPCnSigPi_etaZA_prof", " vs (#eta,ZA), --s--", true, 20, -1.0, 1.0, VarManager::kEta, 30, -15.0, 15.0, VarManager::kNTPCpileupZA, 10, -5.0, 5.0, VarManager::kTPCnSigmaPi); - hm->AddHistogram(histClass, "TPCnSigPi_etaNZA_prof", " vs (#eta,NZA), --s--", true, 20, -1.0, 1.0, VarManager::kEta, 30, 0.0, 1500.0, VarManager::kNTPCpileupContribA, 10, -5.0, 5.0, VarManager::kTPCnSigmaPi); hm->AddHistogram(histClass, "TPCnSigPi_centFT0C", "TPC n-#sigma(#pi) vs centrality", false, 20, 0.0, 100.0, VarManager::kCentFT0C, 200, -5.0, 5.0, VarManager::kTPCnSigmaPi); hm->AddHistogram(histClass, "TPCnSigPi_vtxContrib", "TPC n-#sigma(#pi) vs vtx. contrib real", false, 50, 0.0, 4000.0, VarManager::kVtxNcontribReal, 200, -5.0, 5.0, VarManager::kTPCnSigmaPi); hm->AddHistogram(histClass, "TPCnSigPi_occupancy", "TPC n-#sigma(#pi) vs occupancy", false, 200, 0., 20000., VarManager::kTrackOccupancyInTimeRange, 100, -5.0, 5.0, VarManager::kTPCnSigmaPi); - hm->AddHistogram(histClass, "TPCnSigPi_pileupZA", "TPC n-#sigma(#pi) vs pileup ZA", false, 60, -15.0, 15.0, VarManager::kNTPCpileupZA, 200, -5.0, 5.0, VarManager::kTPCnSigmaPi); - hm->AddHistogram(histClass, "TPCnSigPi_pileupZC", "TPC n-#sigma(#pi) vs pileup ZC", false, 60, -15.0, 15.0, VarManager::kNTPCpileupZC, 200, -5.0, 5.0, VarManager::kTPCnSigmaPi); - hm->AddHistogram(histClass, "TPCnSigPi_pileupNA", "TPC n-#sigma(#pi) vs n.pileup contrib A", false, 60, 0.0, 1500.0, VarManager::kNTPCpileupContribA, 200, -5.0, 5.0, VarManager::kTPCnSigmaPi); - hm->AddHistogram(histClass, "TPCnSigPi_pileupNC", "TPC n-#sigma(#pi) vs n.pileup contrib C", false, 60, 0.0, 1500.0, VarManager::kNTPCpileupContribC, 200, -5.0, 5.0, VarManager::kTPCnSigmaPi); hm->AddHistogram(histClass, "TPCnSigKa_pIN", "TPC n-#sigma(K) vs pIN", false, 100, 0.0, 10.0, VarManager::kPin, 100, -5.0, 5.0, VarManager::kTPCnSigmaKa); hm->AddHistogram(histClass, "TPCnSigPr_pIN", "TPC n-#sigma(p) vs pIN", false, 100, 0.0, 10.0, VarManager::kPin, 100, -5.0, 5.0, VarManager::kTPCnSigmaPr); hm->AddHistogram(histClass, "TPCnSigPr_timeFromSOR", "TPC n-#sigma(p) vs time from SOR", true, 10000, 0.0, 1000.0, VarManager::kTimeFromSOR, 10, -5.0, 5.0, VarManager::kTPCnSigmaPr); diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index e87c49de296..016d066087b 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -86,9 +86,9 @@ using MyBarrelTracksWithV0Bits = soa::Join; -using MyBarrelTracksWithV0BitsForMaps = soa::Join; +using MyBarrelTracksWithV0BitsNoTOF = soa::Join; using MyBarrelTracksWithDalitzBits = soa::Join tracksPos = (((aod::track::flags & static_cast(o2::aod::track::PVContributor)) == static_cast(o2::aod::track::PVContributor)) && (aod::track::tgl > static_cast(0.05))); Partition tracksNeg = (((aod::track::flags & static_cast(o2::aod::track::PVContributor)) == static_cast(o2::aod::track::PVContributor)) && (aod::track::tgl < static_cast(-0.05))); + Preslice presliceNoTOF = aod::track::collisionId; + Partition tracksPosNoTOF = (((aod::track::flags & static_cast(o2::aod::track::PVContributor)) == static_cast(o2::aod::track::PVContributor)) && (aod::track::tgl > static_cast(0.05))); + Partition tracksNegNoTOF = (((aod::track::flags & static_cast(o2::aod::track::PVContributor)) == static_cast(o2::aod::track::PVContributor)) && (aod::track::tgl < static_cast(-0.05))); + struct { std::map oMeanTimeShortA; std::map oMeanTimeShortC; @@ -345,7 +349,7 @@ struct TableMaker { // Check whether we have to define barrel or muon histograms bool enableBarrelHistos = (context.mOptions.get("processPPWithFilter") || context.mOptions.get("processPPWithFilterBarrelOnly") || context.mOptions.get("processPPBarrelOnly") || - context.mOptions.get("processPbPb") || context.mOptions.get("processPbPbBarrelOnly") || context.mOptions.get("processPbPbBarrelOnlyWithV0Bits")); + context.mOptions.get("processPbPb") || context.mOptions.get("processPbPbBarrelOnly") || context.mOptions.get("processPbPbBarrelOnlyWithV0Bits") || context.mOptions.get("processPbPbBarrelOnlyWithV0BitsNoTOF")); bool enableMuonHistos = (context.mOptions.get("processPPWithFilter") || context.mOptions.get("processPPWithFilterMuonOnly") || context.mOptions.get("processPPWithFilterMuonMFT") || context.mOptions.get("processPPMuonOnly") || context.mOptions.get("processPPMuonMFT") || context.mOptions.get("processPbPb") || context.mOptions.get("processPbPbMuonOnly") || context.mOptions.get("processPbPbMuonMFT")); @@ -524,7 +528,7 @@ struct TableMaker { } template - void computeOccupancyEstimators(TEvents const& collisions, TTracks const& /*tracks*/, Preslice& preslice, TBCs const&) + void computeOccupancyEstimators(TEvents const& collisions, Partition const& tracksPos, Partition const& tracksNeg, Preslice& preslice, TBCs const&) { // clear the occupancy maps for this time frame @@ -1007,7 +1011,17 @@ struct TableMaker { nSigmaEl, track.tpcNSigmaMu(), nSigmaPi, nSigmaKa, nSigmaPr, track.beta(), track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), track.trdSignal()); + } else if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackTPCPID)) { + float nSigmaEl = (fConfigPostCalibTPC.fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaEl_Corr] : track.tpcNSigmaEl()); + float nSigmaPi = (fConfigPostCalibTPC.fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPi_Corr] : track.tpcNSigmaPi()); + float nSigmaKa = ((fConfigPostCalibTPC.fConfigComputeTPCpostCalib && fConfigPostCalibTPC.fConfigComputeTPCpostCalibKaon) ? VarManager::fgValues[VarManager::kTPCnSigmaKa_Corr] : track.tpcNSigmaKa()); + float nSigmaPr = (fConfigPostCalibTPC.fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPr_Corr] : track.tpcNSigmaPr()); + trackBarrelPID(track.tpcSignal(), + nSigmaEl, -999.0, nSigmaPi, nSigmaKa, nSigmaPr, + -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, + -999.0); } + fTrackIndexMap[track.globalIndex()] = trackBasic.lastIndex(); // write the skimmed collision - track association @@ -1368,10 +1382,19 @@ struct TableMaker { MyBarrelTracksWithV0Bits const& tracksBarrel, TrackAssoc const& trackAssocs) { - computeOccupancyEstimators(collisions, tracksBarrel, preslice, bcs); + computeOccupancyEstimators(collisions, tracksPos, tracksNeg, preslice, bcs); fullSkimming(collisions, bcs, nullptr, tracksBarrel, nullptr, nullptr, trackAssocs, nullptr, nullptr); } + // produce the barrel only DQ skimmed data model typically for Pb-Pb (with centrality), no subscribtion to the DQ event filter + void processPbPbBarrelOnlyWithV0BitsNoTOF(MyEventsWithCentAndMults const& collisions, BCsWithTimestamps const& bcs, + MyBarrelTracksWithV0BitsNoTOF const& tracksBarrel, + TrackAssoc const& trackAssocs) + { + computeOccupancyEstimators(collisions, tracksPosNoTOF, tracksNegNoTOF, presliceNoTOF, bcs); + fullSkimming(collisions, bcs, nullptr, tracksBarrel, nullptr, nullptr, trackAssocs, nullptr, nullptr); + } + // produce the muon only DQ skimmed data model typically for Pb-Pb (with centrality), no subscribtion to the DQ event filter void processPbPbMuonOnly(MyEventsWithCentAndMults const& collisions, BCsWithTimestamps const& bcs, MyMuonsWithCov const& muons, FwdTrackAssoc const& fwdTrackAssocs) @@ -1408,6 +1431,7 @@ struct TableMaker { PROCESS_SWITCH(TableMaker, processPbPb, "Build full DQ skimmed data model typically for Pb-Pb, w/o event filtering", false); PROCESS_SWITCH(TableMaker, processPbPbBarrelOnly, "Build barrel only DQ skimmed data model typically for Pb-Pb, w/o event filtering", false); PROCESS_SWITCH(TableMaker, processPbPbBarrelOnlyWithV0Bits, "Build barrel only DQ skimmed data model typically for Pb-Pb, w/ V0 bits, w/o event filtering", false); + PROCESS_SWITCH(TableMaker, processPbPbBarrelOnlyWithV0BitsNoTOF, "Build barrel only DQ skimmed data model typically for Pb-Pb, w/ V0 bits, no TOF, w/o event filtering", false); PROCESS_SWITCH(TableMaker, processPbPbMuonOnly, "Build muon only DQ skimmed data model typically for Pb-Pb, w/o event filtering", false); PROCESS_SWITCH(TableMaker, processPbPbMuonMFT, "Build muon + mft DQ skimmed data model typically for Pb-Pb, w/o event filtering", false); PROCESS_SWITCH(TableMaker, processOnlyBCs, "Analyze the BCs to store sampled lumi", false); diff --git a/PWGDQ/Tasks/v0selector.cxx b/PWGDQ/Tasks/v0selector.cxx index 679973da3f2..52068b44958 100644 --- a/PWGDQ/Tasks/v0selector.cxx +++ b/PWGDQ/Tasks/v0selector.cxx @@ -51,7 +51,10 @@ using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -using FullTracksExt = soa::Join;*/ +using FullTracksExt = soa::Join; From 21694e5604455e74b9463c868eb0ad2048f7e91c Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Mon, 9 Dec 2024 13:35:16 +0100 Subject: [PATCH 293/459] [PWGCF] DptDpt - Improve load corrections logs when issues (#8873) Co-authored-by: Victor --- PWGCF/Tasks/dptdptcorrelations.cxx | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/PWGCF/Tasks/dptdptcorrelations.cxx b/PWGCF/Tasks/dptdptcorrelations.cxx index 62e71e28e90..e89a4958f81 100644 --- a/PWGCF/Tasks/dptdptcorrelations.cxx +++ b/PWGCF/Tasks/dptdptcorrelations.cxx @@ -300,11 +300,11 @@ struct DptDptCorrelationsTask { { using namespace correlationstask; - LOGF(info, "Stored NUA&NUE corrections for %d track ids", corrs.size()); + LOGF(info, "Storing NUA&NUE corrections for %d track ids", corrs.size()); for (uint i = 0; i < corrs.size(); ++i) { if (corrs[i] != nullptr) { if (nNoOfDimensions != corrs[i]->GetDimension()) { - LOGF(fatal, " Corrections receved dimensions %d for track id %d different than expected %d", corrs[i]->GetDimension(), i, nNoOfDimensions); + LOGF(fatal, " Corrections received dimensions %d for track id %d different than expected %d", corrs[i]->GetDimension(), i, nNoOfDimensions); } else { LOGF(info, " Storing NUA&NUE corrections %s for track id %d with %d dimensions %s", corrs[i] != nullptr ? corrs[i]->GetName() : "nullptr", i, nNoOfDimensions, corrs[i] != nullptr ? "yes" : "no"); @@ -332,7 +332,7 @@ struct DptDptCorrelationsTask { } } } - LOGF(info, "Average NUA&NUE correction for track id %d: %f", i, avg / nbins); + LOGF(info, " Average NUA&NUE correction for track id %d: %f", i, avg / nbins); } } ccdbstored = true; @@ -1201,7 +1201,7 @@ struct DptDptCorrelationsTask { { using namespace correlationstask; - static constexpr std::string_view kStrDim[] = {"", "2D", "3D", "4D"}; + static constexpr std::string_view kStrDim[] = {"", "", "2D", "3D", "4D"}; return kStrDim[nNoOfDimensions].data(); } @@ -1255,13 +1255,13 @@ struct DptDptCorrelationsTask { } else { std::vector corrs{tnames.size(), nullptr}; for (uint isp = 0; isp < tnames.size(); ++isp) { - corrs[isp] = reinterpret_cast(ccdblst->FindObject( - TString::Format("correction%s_%02d-%02d_%s", - getDimensionStr(), - static_cast(fCentMultMin[ixDCE]), - static_cast(fCentMultMax[ixDCE]), - tnames[isp].c_str()) - .Data())); + auto hName = TString::Format("correction%s_%02d-%02d_%s", getDimensionStr(), static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), tnames[isp].c_str()); + corrs[isp] = reinterpret_cast(ccdblst->FindObject(hName.Data())); + if (corrs[isp] != nullptr) { + LOGF(info, "Loaded %s", corrs[isp]->GetName()); + } else { + LOGF(warning, "No correction histogram for species %d with name %s", isp, hName.Data()); + } } storeTrackCorrections(corrs); std::vector ptavgs{tnames.size(), nullptr}; @@ -1330,13 +1330,13 @@ struct DptDptCorrelationsTask { } else { std::vector corrs{tnames.size(), nullptr}; for (uint isp = 0; isp < tnames.size(); ++isp) { - corrs[isp] = reinterpret_cast(ccdblst->FindObject( - TString::Format("correction%s_%02d-%02d_%s", - getDimensionStr(), - static_cast(fCentMultMin[ixDCE]), - static_cast(fCentMultMax[ixDCE]), - tnames[isp].c_str()) - .Data())); + auto hName = TString::Format("correction%s_%02d-%02d_%s", getDimensionStr(), static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), tnames[isp].c_str()); + corrs[isp] = reinterpret_cast(ccdblst->FindObject(hName.Data())); + if (corrs[isp] != nullptr) { + LOGF(info, "Loaded %s", corrs[isp]->GetName()); + } else { + LOGF(warning, "No correction histogram for species %d with name %s", isp, hName.Data()); + } } dataCEME[ixDCE]->storeTrackCorrections(corrs); std::vector ptavgs{tnames.size(), nullptr}; From aafa83d8ecaa241cf2a1a3df69eaa74d61cce092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 9 Dec 2024 15:12:53 +0100 Subject: [PATCH 294/459] [Infrastructure] Update CODEOWNERS for LF (#8876) --- CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 253fbdc4690..2a943c7861b 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -43,8 +43,8 @@ /PWGLF/TableProducer/GlobalEventProperties @alibuild @njacazio @skundu692 @gbencedi @omvazque /PWGLF/Tasks/Nuspex @alibuild @njacazio @skundu692 @fmazzasc @chiarapinto @maciacco /PWGLF/TableProducer/Nuspex @alibuild @njacazio @skundu692 @fmazzasc @chiarapinto @maciacco -/PWGLF/Tasks/Resonances @alibuild @njacazio @skundu692 @BongHwi @smaff92 -/PWGLF/TableProducer/Resonances @alibuild @njacazio @skundu692 @BongHwi @smaff92 +/PWGLF/Tasks/Resonances @alibuild @njacazio @skundu692 @dmallick2 @smaff92 +/PWGLF/TableProducer/Resonances @alibuild @njacazio @skundu692 @dmallick2 @smaff92 /PWGLF/Tasks/Strangeness @alibuild @njacazio @skundu692 @ercolessi @ChiaraDeMartin95 /PWGLF/TableProducer/Strangeness @alibuild @njacazio @skundu692 @ercolessi @ChiaraDeMartin95 From d3b712eba65ddf403a308b0c1b25a44cf80bd89a Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Mon, 9 Dec 2024 17:06:57 +0100 Subject: [PATCH 295/459] feat: Add new features to the NonPromptCascadeTask (#8881) --- PWGLF/DataModel/LFNonPromptCascadeTables.h | 6 ++++ PWGLF/Tasks/Strangeness/nonPromptCascade.cxx | 34 ++++++++++++-------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/PWGLF/DataModel/LFNonPromptCascadeTables.h b/PWGLF/DataModel/LFNonPromptCascadeTables.h index 0208c7c027c..aa1a3cdb867 100644 --- a/PWGLF/DataModel/LFNonPromptCascadeTables.h +++ b/PWGLF/DataModel/LFNonPromptCascadeTables.h @@ -25,7 +25,9 @@ namespace o2::aod namespace NPCascadeTable { DECLARE_SOA_COLUMN(MatchingChi2, matchingChi2, float); +DECLARE_SOA_COLUMN(DeltaPtITSCascade, deltaPtITSCascade, float); DECLARE_SOA_COLUMN(ITSClusSize, itsClusSize, float); +DECLARE_SOA_COLUMN(HasReassociatedCluster, hasReassociatedCluster, bool); DECLARE_SOA_COLUMN(IsGoodMatch, isGoodMatch, bool); DECLARE_SOA_COLUMN(IsGoodCascade, isGoodCascade, bool); DECLARE_SOA_COLUMN(PdgCodeMom, pdgCodeMom, int); @@ -108,7 +110,9 @@ DECLARE_SOA_COLUMN(MCcollisionMatch, mcCollisionMatch, bool); } // namespace NPCascadeTable DECLARE_SOA_TABLE(NPCascTable, "AOD", "NPCASCTABLE", NPCascadeTable::MatchingChi2, + NPCascadeTable::DeltaPtITSCascade, NPCascadeTable::ITSClusSize, + NPCascadeTable::HasReassociatedCluster, NPCascadeTable::PvX, NPCascadeTable::PvY, NPCascadeTable::PvZ, @@ -162,7 +166,9 @@ DECLARE_SOA_TABLE(NPCascTable, "AOD", "NPCASCTABLE", DECLARE_SOA_TABLE(NPCascTableMC, "AOD", "NPCASCTABLEMC", NPCascadeTable::MatchingChi2, + NPCascadeTable::DeltaPtITSCascade, NPCascadeTable::ITSClusSize, + NPCascadeTable::HasReassociatedCluster, NPCascadeTable::IsGoodMatch, NPCascadeTable::IsGoodCascade, NPCascadeTable::PdgCodeMom, diff --git a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx index d9b15e16d2a..45e7e635847 100644 --- a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx +++ b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx @@ -9,6 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include #include #include #include @@ -47,7 +48,9 @@ struct NPCascCandidate { int64_t trackITSID; int64_t collisionID; float matchingChi2; + float deltaPt; float itsClusSize; + bool hasReassociatedCluster; bool isGoodMatch; bool isGoodCascade; int pdgCodeMom; @@ -292,7 +295,7 @@ struct NonPromptCascadeTask { if (o2::base::Propagator::Instance()->propagateToDCA(primaryVertex, trackCovTrk, bz, 2.f, matCorr, &impactParameterTrk)) { if (protonTrack.hasTPC() && pionTrack.hasTPC()) { if (isOmega) { - registry.fill(HIST("h_dca_Omega"), TMath::Sqrt(impactParameterTrk.getR2())); + registry.fill(HIST("h_dca_Omega"), std::sqrt(impactParameterTrk.getR2())); registry.fill(HIST("h_dcaxy_Omega"), impactParameterTrk.getY()); registry.fill(HIST("h_dcaz_Omega"), impactParameterTrk.getZ()); registry.fill(HIST("h_dcavspt_Omega"), impactParameterTrk.getY(), track.pt()); @@ -301,7 +304,7 @@ struct NonPromptCascadeTask { } if (protonTrack.hasTPC() && pionTrack.hasTPC()) { - registry.fill(HIST("h_dca_Xi"), TMath::Sqrt(impactParameterTrk.getR2())); + registry.fill(HIST("h_dca_Xi"), std::sqrt(impactParameterTrk.getR2())); registry.fill(HIST("h_dcaxy_Xi"), impactParameterTrk.getY()); registry.fill(HIST("h_dcaz_Xi"), impactParameterTrk.getZ()); registry.fill(HIST("h_dcavspt_Xi"), impactParameterTrk.getY(), track.pt()); @@ -432,6 +435,7 @@ struct NonPromptCascadeTask { o2::track::TrackParCov trackParCovV0; o2::track::TrackPar trackParV0; o2::track::TrackPar trackParBachelor; + std::array cascadeMomentum; float cascCpa = -1; float v0Cpa = -1; @@ -446,10 +450,9 @@ struct NonPromptCascadeTask { trackParBachelor = df2.getTrackParamAtPCA(1); trackParV0.getPxPyPzGlo(momenta[0]); // getting the V0 momentum trackParBachelor.getPxPyPzGlo(momenta[1]); // getting the bachelor momentum - std::array pVec; - df2.createParentTrackParCov().getPxPyPzGlo(pVec); + df2.createParentTrackParCov().getPxPyPzGlo(cascadeMomentum); std::array pvPos = {primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}; - cascCpa = RecoDecay::cpa(pvPos, df2.getPCACandidate(), pVec); + cascCpa = RecoDecay::cpa(pvPos, df2.getPCACandidate(), cascadeMomentum); v0Cpa = RecoDecay::cpa(pvPos, df2.getPCACandidate(), momenta[0]); } else { continue; @@ -599,8 +602,9 @@ struct NonPromptCascadeTask { pdgCodeMom = track.mcParticle().has_mothers() ? track.mcParticle().mothers_as()[0].pdgCode() : 0; } int itsTrackPDG = ITStrack.has_mcParticle() ? ITStrack.mcParticle().pdgCode() : 0; - - candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), trackedCascade.itsClsSize(), isGoodMatch, isGoodCascade, pdgCodeMom, itsTrackPDG, std::get<0>(fromHF), std::get<1>(fromHF), + float deltaPtITSCascade = std::hypot(cascadeMomentum[0], cascadeMomentum[1]) - ITStrack.pt(); + bool hasReassociatedClusters = (track.itsNCls() != ITStrack.itsNCls()); + candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), deltaPtITSCascade, trackedCascade.itsClsSize(), hasReassociatedClusters, isGoodMatch, isGoodCascade, pdgCodeMom, itsTrackPDG, std::get<0>(fromHF), std::get<1>(fromHF), primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ(), track.pt(), track.eta(), track.phi(), protonTrack.pt(), protonTrack.eta(), pionTrack.pt(), pionTrack.eta(), bachelor.pt(), bachelor.eta(), @@ -629,7 +633,7 @@ struct NonPromptCascadeTask { auto mcCollision = particle.mcCollision_as(); auto label = collisions.iteratorAt(c.collisionID); - NPCTableMC(c.matchingChi2, c.itsClusSize, c.isGoodMatch, c.isGoodCascade, c.pdgCodeMom, c.pdgCodeITStrack, c.isFromBeauty, c.isFromCharm, + NPCTableMC(c.matchingChi2, c.deltaPt, c.itsClusSize, c.hasReassociatedCluster, c.isGoodMatch, c.isGoodCascade, c.pdgCodeMom, c.pdgCodeITStrack, c.isFromBeauty, c.isFromCharm, c.pvX, c.pvY, c.pvZ, c.cascPt, c.cascEta, c.cascPhi, c.protonPt, c.protonEta, c.pionPt, c.pionEta, c.bachPt, c.bachEta, @@ -691,6 +695,7 @@ struct NonPromptCascadeTask { const auto& ntrack = v0.negTrack_as(); const auto& protonTrack = bachelor.sign() > 0 ? ntrack : ptrack; const auto& pionTrack = bachelor.sign() > 0 ? ptrack : ntrack; + bool hasReassociatedClusters = (track.itsNCls() != ITStrack.itsNCls()); std::array, 2> momenta; std::array masses; @@ -699,6 +704,7 @@ struct NonPromptCascadeTask { o2::track::TrackParCov trackParCovV0; o2::track::TrackPar trackParV0; o2::track::TrackPar trackParBachelor; + std::array cascadeMomentum; float cascCpa = -1; float v0Cpa = -1; @@ -713,10 +719,9 @@ struct NonPromptCascadeTask { trackParBachelor = df2.getTrackParamAtPCA(1); trackParV0.getPxPyPzGlo(momenta[0]); // getting the V0 momentum trackParBachelor.getPxPyPzGlo(momenta[1]); // getting the bachelor momentum - std::array pVec; - df2.createParentTrackParCov().getPxPyPzGlo(pVec); + df2.createParentTrackParCov().getPxPyPzGlo(cascadeMomentum); std::array pvPos = {primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}; - cascCpa = RecoDecay::cpa(pvPos, df2.getPCACandidate(), pVec); + cascCpa = RecoDecay::cpa(pvPos, df2.getPCACandidate(), cascadeMomentum); v0Cpa = RecoDecay::cpa(pvPos, df2.getPCACandidate(), momenta[0]); } else { continue; @@ -724,6 +729,7 @@ struct NonPromptCascadeTask { } else { continue; } + float deltaPtITSCascade = std::hypot(cascadeMomentum[0], cascadeMomentum[1]) - ITStrack.pt(); // PV registry.fill(HIST("h_PV_x"), primaryVertex.getX()); @@ -745,7 +751,7 @@ struct NonPromptCascadeTask { const auto v0mass = RecoDecay::m(momenta, masses); ////Omega hypohesis -> rejecting Xi - if (TMath::Abs(massXi - constants::physics::MassXiMinus) > 0.005) { + if (std::abs(massXi - constants::physics::MassXiMinus) > 0.005) { isOmega = true; invMassBCOmega->Fill(massOmega); } @@ -849,7 +855,7 @@ struct NonPromptCascadeTask { daughtersDCA dDCA; fillDauDCA(trackedCascade, bachelor, protonTrack, pionTrack, primaryVertex, isOmega, dDCA); - candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), trackedCascade.itsClsSize(), 0, 0, 0, 0, 0, 0, + candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), deltaPtITSCascade, trackedCascade.itsClsSize(), hasReassociatedClusters, 0, 0, 0, 0, 0, 0, primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ(), track.pt(), track.eta(), track.phi(), protonTrack.pt(), protonTrack.eta(), pionTrack.pt(), pionTrack.eta(), bachelor.pt(), bachelor.eta(), @@ -865,7 +871,7 @@ struct NonPromptCascadeTask { for (auto& c : candidates) { - NPCTable(c.matchingChi2, c.itsClusSize, + NPCTable(c.matchingChi2, c.deltaPt, c.itsClusSize, c.hasReassociatedCluster, c.pvX, c.pvY, c.pvZ, c.cascPt, c.cascEta, c.cascPhi, c.protonPt, c.protonEta, c.pionPt, c.pionEta, c.bachPt, c.bachEta, From 90c1d6ebf2389eff73cc7e1e752273f9601cbcb2 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:19:23 +0100 Subject: [PATCH 296/459] [PWGJE,EMCAL-670] Bugfix in EMCalCorrectionTask for ShaperCorrection (#8883) Co-authored-by: Nicolas Strangmann --- PWGJE/TableProducer/emcalCorrectionTask.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index 576df1a585a..464f23a360d 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -280,7 +280,7 @@ struct EmcalCorrectionTask { std::vector cellIndicesBC; for (const auto& cell : cellsInBC) { auto amplitude = cell.amplitude(); - if (static_cast(hasShaperCorrection)) { + if (static_cast(hasShaperCorrection) && emcal::intToChannelType(cell.cellType()) == emcal::ChannelType_t::LOW_GAIN) { // Apply shaper correction to LG cells amplitude = o2::emcal::NonlinearityHandler::evaluateShaperCorrectionCellEnergy(amplitude); } if (applyCellAbsScale) { @@ -402,7 +402,7 @@ struct EmcalCorrectionTask { mHistManager.fill(HIST("hMCParticleEnergy"), cellparticle.e()); } auto amplitude = cell.amplitude(); - if (static_cast(hasShaperCorrection)) { + if (static_cast(hasShaperCorrection) && emcal::intToChannelType(cell.cellType()) == emcal::ChannelType_t::LOW_GAIN) { // Apply shaper correction to LG cells amplitude = o2::emcal::NonlinearityHandler::evaluateShaperCorrectionCellEnergy(amplitude); } cellsBC.emplace_back(cell.cellNumber(), From 3f7496f3724ace94c9d88f8ae77204f8fa9f5d1d Mon Sep 17 00:00:00 2001 From: Preet-Bhanjan Date: Mon, 9 Dec 2024 18:24:59 +0100 Subject: [PATCH 297/459] [PWGCF] Addition of nSigma PID function (#8838) Co-authored-by: Preet Pati Co-authored-by: ALICE Action Bot --- PWGCF/Flow/Tasks/CMakeLists.txt | 4 +- .../{FlowPbPbpikp.cxx => flowPbpbPikp.cxx} | 149 +++++++++++------- 2 files changed, 94 insertions(+), 59 deletions(-) rename PWGCF/Flow/Tasks/{FlowPbPbpikp.cxx => flowPbpbPikp.cxx} (68%) diff --git a/PWGCF/Flow/Tasks/CMakeLists.txt b/PWGCF/Flow/Tasks/CMakeLists.txt index eaee5ac70ed..d6e288a4594 100644 --- a/PWGCF/Flow/Tasks/CMakeLists.txt +++ b/PWGCF/Flow/Tasks/CMakeLists.txt @@ -39,8 +39,8 @@ o2physics_add_dpl_workflow(flow-gf PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(flow-pbpb-pikp-task - SOURCES FlowPbPbpikp.cxx +o2physics_add_dpl_workflow(flow-pbpb-pikp + SOURCES flowPbpbPikp.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore COMPONENT_NAME Analysis) diff --git a/PWGCF/Flow/Tasks/FlowPbPbpikp.cxx b/PWGCF/Flow/Tasks/flowPbpbPikp.cxx similarity index 68% rename from PWGCF/Flow/Tasks/FlowPbPbpikp.cxx rename to PWGCF/Flow/Tasks/flowPbpbPikp.cxx index 3692ad0375d..4c93cefdf2d 100644 --- a/PWGCF/Flow/Tasks/FlowPbPbpikp.cxx +++ b/PWGCF/Flow/Tasks/flowPbpbPikp.cxx @@ -9,10 +9,13 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file flowPbpbPikp.cxx +/// \brief PID flow using the generic framework +/// \author Preet Bhanjan Pati + #include #include #include -#include #include #include #include @@ -48,13 +51,14 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace std; #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; -struct GfwPidflow { +struct FlowPbpbPikp { Service ccdb; - Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; - Configurable url{"ccdb-url", "http://ccdb-test.cern.ch:8080", "url of the ccdb repository"}; + Configurable noLaterThan{"noLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable ccdbUrl{"ccdbUrl", "http://ccdb-test.cern.ch:8080", "url of the ccdb repository"}; O2_DEFINE_CONFIGURABLE(cfgCutVertex, float, 10.0f, "Accepted z-vertex range") O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMin, float, 0.2f, "Minimal pT for poi tracks") @@ -69,11 +73,11 @@ struct GfwPidflow { ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for histograms"}; ConfigurableAxis axisPhi{"axisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"}; ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"}; - ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.20, 1.40, 1.60, 1.80, 2.00, 2.20, 2.40, 2.60, 2.80, 3.00, 3.50, 4.00, 5.00, 6.00, 8.00, 10.00}, "pt axis for histograms"}; + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.20, 1.40, 1.60, 1.80, 2.00, 2.20, 2.40, 2.60, 2.80, 3.00, 3.50, 4.00, 5.00, 6.00, 8.00, 10.00}, "pt axis for histograms"}; ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; 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 axisParticles{"axisParticles", {3, 0, 3}, "axis for different hadrons"}; Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtPOIMin) && (aod::track::pt < cfgCutPtPOIMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); @@ -86,14 +90,15 @@ struct GfwPidflow { TAxis* fPtAxis; TRandom3* fRndm = new TRandom3(0); - using aodCollisions = soa::Filtered>; - using aodTracks = soa::Filtered>; + using AodCollisions = soa::Filtered>; + // using AodTracks = soa::Filtered>; + using AodTracks = soa::Filtered>; void init(InitContext const&) { - ccdb->setURL(url.value); + ccdb->setURL(ccdbUrl.value); ccdb->setCaching(true); - ccdb->setCreatedNotAfter(nolaterthan.value); + ccdb->setCreatedNotAfter(noLaterThan.value); histos.add("hPhi", "", {HistType::kTH1D, {axisPhi}}); histos.add("hEta", "", {HistType::kTH1D, {axisEta}}); @@ -106,28 +111,28 @@ struct GfwPidflow { histos.add("c22_gap08_ka", "", {HistType::kTProfile, {axisMultiplicity}}); histos.add("c22_gap08_pr", "", {HistType::kTProfile, {axisMultiplicity}}); histos.add("c24_full", "", {HistType::kTProfile, {axisMultiplicity}}); - histos.add("TofTpcNsigma", "", {HistType::kTHnSparseD, {{axisparticles, axisNsigmaTPC, axisNsigmaTOF}}}); - + histos.add("TofTpcNsigma", "", {HistType::kTHnSparseD, {{axisParticles, axisNsigmaTPC, axisNsigmaTOF, axisPt}}}); + histos.add("partCount", "", {HistType::kTHnSparseD, {{axisParticles, axisMultiplicity, axisPt}}}); o2::framework::AxisSpec axis = axisPt; int nPtBins = axis.binEdges.size() - 1; - double* PtBins = &(axis.binEdges)[0]; - fPtAxis = new TAxis(nPtBins, PtBins); + double* ptBins = &(axis.binEdges)[0]; + fPtAxis = new TAxis(nPtBins, ptBins); TObjArray* oba = new TObjArray(); oba->Add(new TNamed("Ch08Gap22", "Ch08Gap22")); - for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + for (int i = 0; i < fPtAxis->GetNbins(); i++) oba->Add(new TNamed(Form("Ch08Gap22_pt_%i", i + 1), "Ch08Gap22_pTDiff")); oba->Add(new TNamed("Pi08Gap22", "Pi08Gap22")); - for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + for (int i = 0; i < fPtAxis->GetNbins(); i++) oba->Add(new TNamed(Form("Pi08Gap22_pt_%i", i + 1), "Pi08Gap22_pTDiff")); oba->Add(new TNamed("Ka08Gap22", "Ka08Gap22")); - for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + for (int i = 0; i < fPtAxis->GetNbins(); i++) oba->Add(new TNamed(Form("Ka08Gap22_pt_%i", i + 1), "Ka08Gap22_pTDiff")); oba->Add(new TNamed("Pr08Gap22", "Pr08Gap22")); - for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + for (int i = 0; i < fPtAxis->GetNbins(); i++) oba->Add(new TNamed(Form("Pr08Gap22_pt_%i", i + 1), "Pr08Gap22_pTDiff")); oba->Add(new TNamed("ChFull24", "ChFull24")); - for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + for (int i = 0; i < fPtAxis->GetNbins(); i++) oba->Add(new TNamed(Form("ChFull24_pt_%i", i + 1), "ChFull24_pTDiff")); fFC->SetName("FlowContainer"); @@ -169,8 +174,36 @@ struct GfwPidflow { fGFW->CreateRegions(); } + enum Particles { + PIONS, + KAONS, + PROTONS + }; + template - std::pair GetBayesID(TTrack track) + int getNsigmaPID(TTrack track) + { + // Computing Nsigma arrays for pion, kaon, and protons + std::array nSigmaTPC = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; + std::array nSigmaCombined = {std::hypot(track.tpcNSigmaPi(), track.tofNSigmaPi()), std::hypot(track.tpcNSigmaKa(), track.tofNSigmaKa()), std::hypot(track.tpcNSigmaPr(), track.tofNSigmaPr())}; + int pid = -1; + float nsigma = 3.0; + + // Choose which nSigma to use + std::array nSigmaToUse = (track.pt() > 0.4 && track.hasTOF()) ? nSigmaCombined : nSigmaTPC; + + // Select particle with the lowest nsigma + for (int i = 0; i < 3; ++i) { + if (std::abs(nSigmaToUse[i]) < nsigma) { + pid = i; + nsigma = std::abs(nSigmaToUse[i]); + } + } + return pid + 1; // shift the pid by 1, 1 = pion, 2 = kaon, 3 = proton + } + + /*template + std::pair getBayesID(TTrack track) { std::array bayesprobs = {static_cast(track.bayesPi()), static_cast(track.bayesKa()), static_cast(track.bayesPr())}; int bayesid = -1; @@ -186,16 +219,16 @@ struct GfwPidflow { } template - int GetBayesPIDIndex(TTrack track) + int getBayesPIDIndex(TTrack track) { int maxProb[3] = {80, 80, 80}; int pidID = -1; - std::pair idprob = GetBayesID(track); - if (idprob.first == 0 || idprob.first == 1 || idprob.first == 2) { // 0 = pion, 1 = kaon, 2 = proton + std::pair idprob = getBayesID(track); + if (idprob.first == PIONS || idprob.first == KAONS || idprob.first == PROTONS) { // 0 = pion, 1 = kaon, 2 = proton pidID = idprob.first; float nsigmaTPC[3] = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; if (idprob.second > maxProb[pidID]) { - if (abs(nsigmaTPC[pidID]) > 3) + if (std::fabs(nsigmaTPC[pidID]) > 3) return 0; return pidID + 1; // shift the pid by 1, 1 = pion, 2 = kaon, 3 = proton } else { @@ -203,10 +236,10 @@ struct GfwPidflow { } } return 0; - } + }*/ template - void FillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); @@ -214,22 +247,22 @@ struct GfwPidflow { return; if (!corrconf.pTDif) { val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) + if (std::fabs(val) < 1) histos.fill(tarName, cent, val, dnx); return; } - for (Int_t i = 1; i <= fPtAxis->GetNbins(); i++) { + for (int i = 1; i <= fPtAxis->GetNbins(); i++) { dnx = fGFW->Calculate(corrconf, i - 1, kTRUE).real(); if (dnx == 0) continue; val = fGFW->Calculate(corrconf, i - 1, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) + if (std::fabs(val) < 1) histos.fill(tarName, fPtAxis->GetBinCenter(i), val, dnx); } return; } - void FillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) + void fillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); @@ -238,78 +271,80 @@ struct GfwPidflow { } if (!corrconf.pTDif) { val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) { + if (std::fabs(val) < 1) { fFC->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm); } return; } - for (Int_t i = 1; i <= fPtAxis->GetNbins(); i++) { + for (int i = 1; i <= fPtAxis->GetNbins(); i++) { dnx = fGFW->Calculate(corrconf, i - 1, kTRUE).real(); if (dnx == 0) continue; val = fGFW->Calculate(corrconf, i - 1, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) + if (std::fabs(val) < 1) fFC->FillProfile(Form("%s_pt_%i", corrconf.Head.c_str(), i), cent, val, dnx, rndm); } return; } - void process(aodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, aodTracks const& tracks) + void process(AodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, AodTracks const& tracks) { - int Ntot = tracks.size(); - if (Ntot < 1) + int nTot = tracks.size(); + if (nTot < 1) return; if (!collision.sel8()) return; - float l_Random = fRndm->Rndm(); + float lRandom = fRndm->Rndm(); float vtxz = collision.posZ(); histos.fill(HIST("hVtxZ"), vtxz); - histos.fill(HIST("hMult"), Ntot); + histos.fill(HIST("hMult"), nTot); histos.fill(HIST("hCent"), collision.centFT0C()); fGFW->Clear(); const auto cent = collision.centFT0C(); float weff = 1, wacc = 1; int pidIndex; - for (auto& track : tracks) { + for (auto const& track : tracks) { double pt = track.pt(); histos.fill(HIST("hPhi"), track.phi()); histos.fill(HIST("hEta"), track.eta()); histos.fill(HIST("hPt"), pt); - histos.fill(HIST("TofTpcNsigma"), 0, track.tpcNSigmaPi(), track.tofNSigmaPi()); - histos.fill(HIST("TofTpcNsigma"), 1, track.tpcNSigmaKa(), track.tofNSigmaKa()); - histos.fill(HIST("TofTpcNsigma"), 2, track.tpcNSigmaPr(), track.tofNSigmaPr()); + histos.fill(HIST("TofTpcNsigma"), PIONS, track.tpcNSigmaPi(), track.tofNSigmaPi(), pt); + histos.fill(HIST("TofTpcNsigma"), KAONS, track.tpcNSigmaKa(), track.tofNSigmaKa(), pt); + histos.fill(HIST("TofTpcNsigma"), PROTONS, track.tpcNSigmaPr(), track.tofNSigmaPr(), pt); - bool WithinPtPOI = (cfgCutPtPOIMin < pt) && (pt < cfgCutPtPOIMax); // within POI pT range - bool WithinPtRef = (cfgCutPtMin < pt) && (pt < cfgCutPtMax); // within RF pT range + bool withinPtPOI = (cfgCutPtPOIMin < pt) && (pt < cfgCutPtPOIMax); // within POI pT range + bool withinPtRef = (cfgCutPtMin < pt) && (pt < cfgCutPtMax); // within RF pT range - pidIndex = GetBayesPIDIndex(track); - if (WithinPtRef) + // pidIndex = getBayesPIDIndex(track); + pidIndex = getNsigmaPID(track); + if (withinPtRef) fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 1); - if (WithinPtPOI) + if (withinPtPOI) fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 128); - if (WithinPtPOI && WithinPtRef) + if (withinPtPOI && withinPtRef) fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 256); fGFW->Fill(track.eta(), 1, track.phi(), wacc * weff, 512); if (pidIndex) { - if (WithinPtPOI) + histos.fill(HIST("partCount"), pidIndex - 1, cent, pt); + if (withinPtPOI) fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 1 << (pidIndex)); - if (WithinPtPOI && WithinPtRef) + if (withinPtPOI && withinPtRef) fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), wacc * weff, 1 << (pidIndex + 3)); } } // Filling c22 with ROOT TProfile - FillProfile(corrconfigs.at(0), HIST("c22_gap08"), cent); - FillProfile(corrconfigs.at(1), HIST("c22_gap08_pi"), cent); - FillProfile(corrconfigs.at(2), HIST("c22_gap08_ka"), cent); - FillProfile(corrconfigs.at(3), HIST("c22_gap08_pr"), cent); - FillProfile(corrconfigs.at(4), HIST("c24_full"), cent); + fillProfile(corrconfigs.at(0), HIST("c22_gap08"), cent); + fillProfile(corrconfigs.at(1), HIST("c22_gap08_pi"), cent); + fillProfile(corrconfigs.at(2), HIST("c22_gap08_ka"), cent); + fillProfile(corrconfigs.at(3), HIST("c22_gap08_pr"), cent); + fillProfile(corrconfigs.at(4), HIST("c24_full"), cent); for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) { - FillFC(corrconfigs.at(l_ind), cent, l_Random); + fillFC(corrconfigs.at(l_ind), cent, lRandom); } } // end of process @@ -317,5 +352,5 @@ struct GfwPidflow { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From ba8d88646c37f403b3aecd58801deebcc96a661b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:41:14 +0100 Subject: [PATCH 298/459] [PWGHF] Add MC Generated ThnSparse in Lc task (#8887) --- PWGHF/D2H/Tasks/taskLc.cxx | 61 ++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 2981f64c8c7..e844b07e7c2 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -53,6 +53,9 @@ struct HfTaskLc { ConfigurableAxis thnConfigAxisBdtScoreBkg{"thnConfigAxisBdtScoreBkg", {1000, 0., 1.}, ""}; ConfigurableAxis thnConfigAxisBdtScoreSignal{"thnConfigAxisBdtScoreSignal", {100, 0., 1.}, ""}; ConfigurableAxis thnConfigAxisCanType{"thnConfigAxisCanType", {5, 0., 5.}, ""}; + ConfigurableAxis thnAxisRapidity{"thnAxisRapidity", {20, -1, 1}, "Cand. rapidity bins"}; + ConfigurableAxis thnConfigAxisGenPtB{"thnConfigAxisGenPtB", {1000, 0, 100}, "Gen Pt B"}; + ConfigurableAxis thnConfigAxisNumPvContr{"thnConfigAxisNumPvContr", {200, -0.5, 199.5}, "Number of PV contributors"}; HfHelper hfHelper; @@ -70,7 +73,7 @@ struct HfTaskLc { using LcCandidatesMlMc = soa::Filtered>; using McParticles3ProngMatched = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; - Preslice perMcCollision = aod::mcparticle::mcCollisionId; + PresliceUnsorted colPerMcCollision = aod::mcparticle::mcCollisionId; Preslice candLcPerCollision = aod::hf_cand::collisionId; SliceCache cache; @@ -286,11 +289,25 @@ struct HfTaskLc { const AxisSpec thnAxisBdtScoreLcPrompt{thnConfigAxisBdtScoreSignal, "BDT prompt score (Lc)"}; const AxisSpec thnAxisBdtScoreLcNonPrompt{thnConfigAxisBdtScoreSignal, "BDT non-prompt score (Lc)"}; const AxisSpec thnAxisCanType{thnConfigAxisCanType, "candidates type"}; + const AxisSpec thnAxisY{thnAxisRapidity, "rapidity"}; + const AxisSpec thnAxisPtB{thnConfigAxisGenPtB, "#it{p}_{T}^{B} (GeV/#it{c})"}; + const AxisSpec thnAxisTracklets{thnConfigAxisNumPvContr, "Number of PV contributors"}; + + if (doprocessDataWithMl || doprocessDataWithMlWithFT0C || doprocessDataWithMlWithFT0M) { + + registry.add("hnLcVarsWithBdt", "THn for Lambdac candidates with BDT scores for data with ML", HistType::kTHnSparseF, {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets}); + + } else if (doprocessMcWithMl || doprocessMcWithMlWithFT0C || doprocessMcWithMlWithFT0M) { + + registry.add("hnLcVarsWithBdt", "THn for Lambdac candidates with BDT scores for mc with ML", HistType::kTHnSparseF, {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisPtB, thnAxisCanType}); + registry.add("hnLcVarsGen", "THn for Generated Lambdac", HistType::kTHnSparseF, {thnAxisPt, thnAxisY, thnAxisTracklets, thnAxisPtB, thnAxisCanType}); + + } else if (doprocessDataStd || doprocessDataStdWithFT0C || doprocessDataStdWithFT0M) { + registry.add("hnLcVars", "THn for Reconstructed Lambdac candidates for data without ML", HistType::kTHnSparseF, {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets}); - if (doprocessDataWithMl || doprocessDataWithMlWithFT0C || doprocessDataWithMlWithFT0M || doprocessMcWithMl || doprocessMcWithMlWithFT0C || doprocessMcWithMlWithFT0M) { - registry.add("hnLcVarsWithBdt", "THn for Lambdac candidates with BDT scores", HistType::kTHnSparseF, {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisCanType}); } else { - registry.add("hnLcVars", "THn for Lambdac candidates", HistType::kTHnSparseF, {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisCanType}); + registry.add("hnLcVars", "THn for Reconstructed Lambdac candidates for mc without ML", HistType::kTHnSparseF, {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisPtB, thnAxisCanType}); + registry.add("hnLcVarsGen", "THn for Generated Lambdac", HistType::kTHnSparseF, {thnAxisPt, thnAxisY, thnAxisTracklets, thnAxisPtB, thnAxisCanType}); } } } @@ -341,6 +358,9 @@ struct HfTaskLc { auto cpa = candidate.cpa(); auto cpaXY = candidate.cpaXY(); auto originType = candidate.originMcRec(); + auto numPvContributors = collision.numContrib(); + auto ptRecB = candidate.ptBhadMotherPart(); + /// MC reconstructed signal if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { registry.fill(HIST("MC/reconstructed/signal/hMassRecSig"), hfHelper.invMassLcToPKPi(candidate)); @@ -476,9 +496,9 @@ struct HfTaskLc { outputFD = candidate.mlProbLcToPKPi()[2]; /// non-prompt score } /// Fill the ML outputScores and variables of candidate - registry.get(HIST("hnLcVarsWithBdt"))->Fill(massLc, pt, cent, outputBkg, outputPrompt, outputFD, originType); + registry.get(HIST("hnLcVarsWithBdt"))->Fill(massLc, pt, cent, outputBkg, outputPrompt, outputFD, numPvContributors, ptRecB, originType); } else { - registry.get(HIST("hnLcVars"))->Fill(massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, originType); + registry.get(HIST("hnLcVars"))->Fill(massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, numPvContributors, ptRecB, originType); } } if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { @@ -491,9 +511,9 @@ struct HfTaskLc { outputFD = candidate.mlProbLcToPiKP()[2]; /// non-prompt score } /// Fill the ML outputScores and variables of candidate (todo: add multiplicity) - registry.get(HIST("hnLcVarsWithBdt"))->Fill(massLc, pt, cent, outputBkg, outputPrompt, outputFD, originType); + registry.get(HIST("hnLcVarsWithBdt"))->Fill(massLc, pt, cent, outputBkg, outputPrompt, outputFD, numPvContributors, ptRecB, originType); } else { - registry.get(HIST("hnLcVars"))->Fill(massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, originType); + registry.get(HIST("hnLcVars"))->Fill(massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, numPvContributors, ptRecB, originType); } } } @@ -503,8 +523,8 @@ struct HfTaskLc { /// Fill MC histograms at generated level /// \tparam fillMl switch to fill ML histograms - template - void fillHistosMcGen(CandLcMcGen const& mcParticles) + template + void fillHistosMcGen(CandLcMcGen const& mcParticles, Coll const& recoCollisions) { // MC gen. for (const auto& particle : mcParticles) { @@ -514,6 +534,14 @@ struct HfTaskLc { continue; } auto ptGen = particle.pt(); + auto originType = particle.originMcGen(); + auto ptGenB = -1; + unsigned int numPvContributors = 0; + const auto& recoCollsPerMcColl = recoCollisions.sliceBy(colPerMcCollision, particle.mcCollision().globalIndex()); + for (const auto& recCol : recoCollsPerMcColl) { + numPvContributors = recCol.numContrib() > numPvContributors ? recCol.numContrib() : numPvContributors; + } + registry.fill(HIST("MC/generated/signal/hPtGen"), ptGen); registry.fill(HIST("MC/generated/signal/hEtaGen"), particle.eta()); registry.fill(HIST("MC/generated/signal/hYGen"), yGen); @@ -523,6 +551,7 @@ struct HfTaskLc { registry.fill(HIST("MC/generated/signal/hPhiVsPtGenSig"), particle.phi(), ptGen); if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { + registry.get(HIST("hnLcVarsGen"))->Fill(ptGen, yGen, numPvContributors, ptGenB, originType); registry.fill(HIST("MC/generated/prompt/hPtGenPrompt"), ptGen); registry.fill(HIST("MC/generated/prompt/hEtaGenPrompt"), particle.eta()); registry.fill(HIST("MC/generated/prompt/hYGenPrompt"), yGen); @@ -532,6 +561,8 @@ struct HfTaskLc { registry.fill(HIST("MC/generated/prompt/hPhiVsPtGenSigPrompt"), particle.phi(), ptGen); } if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { + ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); + registry.get(HIST("hnLcVarsGen"))->Fill(ptGen, yGen, numPvContributors, ptGenB, originType); registry.fill(HIST("MC/generated/nonprompt/hPtGenNonPrompt"), ptGen); registry.fill(HIST("MC/generated/nonprompt/hEtaGenNonPrompt"), particle.eta()); registry.fill(HIST("MC/generated/nonprompt/hYGenNonPrompt"), yGen); @@ -627,9 +658,9 @@ struct HfTaskLc { outputFD = candidate.mlProbLcToPKPi()[2]; /// non-prompt score } /// Fill the ML outputScores and variables of candidate - registry.get(HIST("hnLcVarsWithBdt"))->Fill(massLc, pt, cent, outputBkg, outputPrompt, outputFD, 0); + registry.get(HIST("hnLcVarsWithBdt"))->Fill(massLc, pt, cent, outputBkg, outputPrompt, outputFD, numPvContributors); } else { - registry.get(HIST("hnLcVars"))->Fill(massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, 0); + registry.get(HIST("hnLcVars"))->Fill(massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, numPvContributors); } } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { @@ -642,9 +673,9 @@ struct HfTaskLc { outputFD = candidate.mlProbLcToPiKP()[2]; /// non-prompt score } /// Fill the ML outputScores and variables of candidate - registry.get(HIST("hnLcVarsWithBdt"))->Fill(massLc, pt, cent, outputBkg, outputPrompt, outputFD, 0); + registry.get(HIST("hnLcVarsWithBdt"))->Fill(massLc, pt, cent, outputBkg, outputPrompt, outputFD, numPvContributors); } else { - registry.get(HIST("hnLcVars"))->Fill(massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, 0); + registry.get(HIST("hnLcVars"))->Fill(massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, numPvContributors); } } } @@ -675,7 +706,7 @@ struct HfTaskLc { fillHistosMcRec(collision, candidates, mcParticles); } // MC gen. - fillHistosMcGen(mcParticles); + fillHistosMcGen(mcParticles, collisions); } void processDataStd(Collisions const& collisions, From b0fa29e4a20ce1052a07a97b467d89647b0ae082 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Mon, 9 Dec 2024 19:52:41 +0100 Subject: [PATCH 299/459] [Common] Preparations for MFT track-based centrality (#8885) Co-authored-by: ALICE Builder --- Common/DataModel/Multiplicity.h | 7 ++++++ Common/TableProducer/multiplicityTable.cxx | 29 +++++++++++++++++++--- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/Common/DataModel/Multiplicity.h b/Common/DataModel/Multiplicity.h index 1f4a17e11b3..40175ded7a4 100644 --- a/Common/DataModel/Multiplicity.h +++ b/Common/DataModel/Multiplicity.h @@ -45,6 +45,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(IsInelGt0, isInelGt0, //! is INEL > 0 [](int multPveta1) -> bool { return multPveta1 > 0; }); DECLARE_SOA_DYNAMIC_COLUMN(IsInelGt1, isInelGt1, //! is INEL > 1 [](int multPveta1) -> bool { return multPveta1 > 1; }); + +// forward track counters +DECLARE_SOA_COLUMN(MFTNtracks, mftNtracks, int); //! + // MC DECLARE_SOA_COLUMN(MultMCFT0A, multMCFT0A, int); //! DECLARE_SOA_COLUMN(MultMCFT0C, multMCFT0C, int); //! @@ -108,9 +112,12 @@ DECLARE_SOA_TABLE(PVMults, "AOD", "PVMULT", //! Multiplicity from the PV contrib mult::MultNTracksPVetaHalf, mult::IsInelGt0, mult::IsInelGt1); +DECLARE_SOA_TABLE(MFTMults, "AOD", "MFTMULT", //! Multiplicity with MFT + mult::MFTNtracks); using BarrelMults = soa::Join; using Mults = soa::Join; using FT0Mult = FT0Mults::iterator; +using MFTMult = MFTMults::iterator; using Mult = Mults::iterator; DECLARE_SOA_TABLE(MultsExtra_000, "AOD", "MULTEXTRA", //! diff --git a/Common/TableProducer/multiplicityTable.cxx b/Common/TableProducer/multiplicityTable.cxx index 6d468282b55..2f9040b569c 100644 --- a/Common/TableProducer/multiplicityTable.cxx +++ b/Common/TableProducer/multiplicityTable.cxx @@ -49,7 +49,8 @@ static constexpr int kFT0MultZeqs = 10; static constexpr int kFDDMultZeqs = 11; static constexpr int kPVMultZeqs = 12; static constexpr int kMultMCExtras = 13; -static constexpr int nTables = 14; +static constexpr int kMFTMults = 14; +static constexpr int nTables = 15; // Checking that the Zeq tables are after the normal ones static_assert(kFV0Mults < kFV0MultZeqs); @@ -71,9 +72,10 @@ static const std::vector tableNames{"FV0Mults", // 0 "FT0MultZeqs", // 10 "FDDMultZeqs", // 11 "PVMultZeqs", // 12 - "MultMCExtras"}; // 13 + "MultMCExtras", // 13 + "MFTMults"}; // 14 static const std::vector parameterNames{"Enable"}; -static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}}; +static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}}; struct MultiplicityTable { SliceCache cache; @@ -92,6 +94,7 @@ struct MultiplicityTable { Produces tablePVZeqs; // 12 Produces tableExtraMc; // 13 Produces tableExtraMult2MCExtras; + Produces mftMults; // 14 Produces multsGlobal; // Not accounted for, produced based on process function processGlobalTrackingCounters // For vertex-Z corrections in calibration @@ -105,6 +108,7 @@ struct MultiplicityTable { Partition pvContribTracksEta1 = (nabs(aod::track::eta) < 1.0f) && ((aod::track::flags & (uint32_t)o2::aod::track::PVContributor) == (uint32_t)o2::aod::track::PVContributor); Preslice perCol = aod::track::collisionId; Preslice perColIU = aod::track::collisionId; + Preslice perCollisionMFT = o2::aod::fwdtrack::collisionId; using BCsWithRun3Matchings = soa::Join; @@ -297,7 +301,8 @@ struct MultiplicityTable { aod::Zdcs const&, aod::FV0As const&, aod::FT0s const&, - aod::FDDs const&) + aod::FDDs const&, + aod::MFTTracks const& mftTracks) { // reserve memory for (auto i : mEnabledTables) { @@ -343,6 +348,9 @@ struct MultiplicityTable { break; case kMultMCExtras: // MC extra information (nothing to do in the data) break; + case kMFTMults: // Equalized multiplicity for PV + mftMults.reserve(collisions.size()); + break; default: LOG(fatal) << "Unknown table requested: " << i; break; @@ -621,6 +629,19 @@ struct MultiplicityTable { case kMultMCExtras: // MC only (nothing to do) { } break; + case kMFTMults: { + // for centrality estimation with the MFT if desired + // step 1: produce proper grouping + const uint64_t collIdx = collision.globalIndex(); + auto mftTracksGrouped = mftTracks.sliceBy(perCollisionMFT, collIdx); + int nTracks = 0; + for (auto& track : mftTracksGrouped) { + if (track.nClusters() >= 5) { // hardcoded on purpose to avoid trouble + nTracks++; + } + } + mftMults(nTracks); + } break; default: // Default { LOG(fatal) << "Unknown table requested: " << i; From e34ee43ca62e7015e4e783ceb40819c751bb89a5 Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Mon, 9 Dec 2024 23:24:35 +0100 Subject: [PATCH 300/459] [PWGCF] adding ddbar mass histograms for normalization (#8789) Co-authored-by: junleekim Co-authored-by: junleekim --- PWGCF/Tasks/correlations.cxx | 170 ++++++++++++++++++----------------- 1 file changed, 89 insertions(+), 81 deletions(-) diff --git a/PWGCF/Tasks/correlations.cxx b/PWGCF/Tasks/correlations.cxx index eec9faaf96e..067e73d6425 100644 --- a/PWGCF/Tasks/correlations.cxx +++ b/PWGCF/Tasks/correlations.cxx @@ -8,6 +8,12 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. + +/// \file correlations.cxx +/// \brief task for the correlation calculations with CF-filtered tracks for O2 analysis +/// \author Jan Fiete Grosse-Oetringhaus , Jasper Parkkila +// o2-linter: disable=name/workflow-file + #include #include #include @@ -27,6 +33,7 @@ #include "Framework/HistogramRegistry.h" #include "Framework/RunningWorkflowInfo.h" #include "CommonConstants/MathConstants.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -55,7 +62,7 @@ using namespace constants::math; // cfcorreff::Correction); // } // namespace o2::aod -static constexpr float cfgPairCutDefaults[1][5] = {{-1, -1, -1, -1, -1}}; +static constexpr float kCfgPairCutDefaults[1][5] = {{-1, -1, -1, -1, -1}}; struct CorrelationTask { SliceCache cache; @@ -76,7 +83,7 @@ struct CorrelationTask { O2_DEFINE_CONFIGURABLE(cfgCentBinsForMC, int, 0, "0 = OFF and 1 = ON for data like multiplicity/centrality bins for MC steps"); O2_DEFINE_CONFIGURABLE(cfgTrackBitMask, uint8_t, 0, "BitMask for track selection systematics; refer to the enum TrackSelectionCuts in filtering task"); // Suggested values: Photon: 0.004; K0 and Lambda: 0.005 - Configurable> cfgPairCut{"cfgPairCut", {cfgPairCutDefaults[0], 5, {"Photon", "K0", "Lambda", "Phi", "Rho"}}, "Pair cuts on various particles"}; + Configurable> cfgPairCut{"cfgPairCut", {kCfgPairCutDefaults[0], 5, {"Photon", "K0", "Lambda", "Phi", "Rho"}}, "Pair cuts on various particles"}; O2_DEFINE_CONFIGURABLE(cfgEfficiencyTrigger, std::string, "", "CCDB path to efficiency object for trigger particles") O2_DEFINE_CONFIGURABLE(cfgEfficiencyAssociated, std::string, "", "CCDB path to efficiency object for associated particles") @@ -137,20 +144,23 @@ struct CorrelationTask { Service ccdb; - using aodCollisions = soa::Filtered>; - using aodTracks = soa::Filtered>; + using AodCollisions = soa::Filtered>; + using AodTracks = soa::Filtered>; - using derivedTracks = soa::Filtered; - using derivedCollisions = soa::Filtered; + using DerivedCollisions = soa::Filtered; + using DerivedTracks = soa::Filtered; void init(o2::framework::InitContext&) { registry.add("yields", "multiplicity/centrality vs pT vs eta", {HistType::kTH3F, {{100, 0, 100, "/multiplicity/centrality"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); - registry.add("etaphi", "multiplicity/centrality vs eta vs phi", {HistType::kTH3F, {{100, 0, 100, "multiplicity/centrality"}, {100, -2, 2, "#eta"}, {200, 0, 2 * M_PI, "#varphi"}}}); - if (doprocessSame2ProngDerived || doprocessMixed2ProngDerived) { + registry.add("etaphi", "multiplicity/centrality vs eta vs phi", {HistType::kTH3F, {{100, 0, 100, "multiplicity/centrality"}, {100, -2, 2, "#eta"}, {200, 0, o2::constants::math::TwoPI, "#varphi"}}}); + if (doprocessSame2ProngDerived || doprocessMixed2ProngDerived || doprocessSame2Prong2Prong) { registry.add("yieldsTrigger", "multiplicity/centrality vs pT vs eta (triggers)", {HistType::kTH3F, {{100, 0, 100, "/multiplicity/centrality"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); - registry.add("etaphiTrigger", "multiplicity/centrality vs eta vs phi (triggers)", {HistType::kTH3F, {{100, 0, 100, "multiplicity/centrality"}, {100, -2, 2, "#eta"}, {200, 0, 2 * M_PI, "#varphi"}}}); + registry.add("etaphiTrigger", "multiplicity/centrality vs eta vs phi (triggers)", {HistType::kTH3F, {{100, 0, 100, "multiplicity/centrality"}, {100, -2, 2, "#eta"}, {200, 0, o2::constants::math::TwoPI, "#varphi"}}}); registry.add("invMass", "2-prong invariant mass (GeV/c^2)", {HistType::kTH3F, {axisInvMassHistogram, axisPtTrigger, axisMultiplicity}}); + if (doprocessSame2Prong2Prong) { + registry.add("invMassTwoPart", "2D 2-prong invariant mass (GeV/c^2)", {HistType::kTHnSparseF, {axisInvMassHistogram, axisInvMassHistogram, axisPtTrigger, axisPtAssoc, axisMultiplicity}}); + } } registry.add("multiplicity", "event multiplicity", {HistType::kTH1F, {{1000, 0, 100, "/multiplicity/centrality"}}}); @@ -185,13 +195,17 @@ struct CorrelationTask { {axisPtEfficiency, "p_{T} (GeV/c)"}, {axisVertexEfficiency, "z-vtx (cm)"}}; std::vector userAxis; - if (cfgMassAxis != 0) + std::vector userMixingAxis; + + if (cfgMassAxis != 0) { userAxis.emplace_back(axisInvMass, "m (GeV/c^2)"); + userMixingAxis.emplace_back(axisInvMass, "m (GeV/c^2)"); + } if (doprocessSame2Prong2Prong) userAxis.emplace_back(axisInvMass, "m (GeV/c^2)"); same.setObject(new CorrelationContainer("sameEvent", "sameEvent", corrAxis, effAxis, userAxis)); - mixed.setObject(new CorrelationContainer("mixedEvent", "mixedEvent", corrAxis, effAxis, userAxis)); + mixed.setObject(new CorrelationContainer("mixedEvent", "mixedEvent", corrAxis, effAxis, userMixingAxis)); same->setTrackEtaCut(cfgCutEta); mixed->setTrackEtaCut(cfgCutEta); @@ -229,29 +243,36 @@ struct CorrelationTask { void fillQA(const TCollision& /*collision*/, float multiplicity, const TTracks& tracks) { registry.fill(HIST("multiplicity"), multiplicity); - for (auto& track1 : tracks) { + for (const auto& track1 : tracks) { registry.fill(HIST("yields"), multiplicity, track1.pt(), track1.eta()); registry.fill(HIST("etaphi"), multiplicity, track1.eta(), track1.phi()); } } template - using hasInvMass = decltype(std::declval().invMass()); + using HasInvMass = decltype(std::declval().invMass()); template - using hasPDGCode = decltype(std::declval().pdgCode()); + using HasPDGCode = decltype(std::declval().pdgCode()); template void fillQA(const TCollision& collision, float multiplicity, const TTracks1& tracks1, const TTracks2& tracks2) { - for (auto& track1 : tracks1) { - if constexpr (std::experimental::is_detected::value) { - if constexpr (std::experimental::is_detected::value) { + for (const auto& track1 : tracks1) { + if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast(track1.decay()))) == 0u) continue; } registry.fill(HIST("invMass"), track1.invMass(), track1.pt(), multiplicity); + for (const auto& track2 : tracks2) { + if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) { + if (doprocessSame2Prong2Prong) { + registry.fill(HIST("invMassTwoPart"), track1.invMass(), track2.invMass(), track1.pt(), track2.pt(), multiplicity); + } + } + } } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (!cfgMcTriggerPDGs->empty() && std::find(cfgMcTriggerPDGs->begin(), cfgMcTriggerPDGs->end(), track1->pdgCode()) == cfgMcTriggerPDGs->end()) continue; } @@ -290,13 +311,13 @@ struct CorrelationTask { } template - using hasSign = decltype(std::declval().sign()); + using HasSign = decltype(std::declval().sign()); template - using hasDecay = decltype(std::declval().decay()); + using HasDecay = decltype(std::declval().decay()); template - using hasProng0Id = decltype(std::declval().cfTrackProng0Id()); + using HasProng0Id = decltype(std::declval().cfTrackProng0Id()); template - using hasProng1Id = decltype(std::declval().cfTrackProng1Id()); + using HasProng1Id = decltype(std::declval().cfTrackProng1Id()); template void fillCorrelations(TTarget target, TTracks1& tracks1, TTracks2& tracks2, float multiplicity, float posZ, int magField, float eventWeight) @@ -306,13 +327,13 @@ struct CorrelationTask { if (cfg.mEfficiencyAssociated) { efficiencyAssociatedCache.clear(); efficiencyAssociatedCache.reserve(tracks2.size()); - for (auto& track : tracks2) { + for (const auto& track : tracks2) { efficiencyAssociatedCache.push_back(getEfficiencyCorrection(cfg.mEfficiencyAssociated, track.eta(), track.pt(), multiplicity, posZ)); } } } - for (auto& track1 : tracks1) { + for (const auto& track1 : tracks1) { // LOGF(info, "Track %f | %f | %f %d %d", track1.eta(), track1.phi(), track1.pt(), track1.isGlobalTrack(), track1.isGlobalTrackSDD()); if constexpr (step <= CorrelationContainer::kCFStepTracked) { @@ -321,17 +342,17 @@ struct CorrelationTask { } } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast(track1.decay()))) == 0u) continue; } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (!cfgMcTriggerPDGs->empty() && std::find(cfgMcTriggerPDGs->begin(), cfgMcTriggerPDGs->end(), track1.pdgCode()) == cfgMcTriggerPDGs->end()) continue; } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (cfgTriggerCharge != 0 && cfgTriggerCharge * track1.sign() < 0) { continue; } @@ -345,7 +366,7 @@ struct CorrelationTask { } if (cfgMassAxis) { - if constexpr (std::experimental::is_detected::value) + if constexpr (std::experimental::is_detected::value) target->getTriggerHist()->Fill(step, track1.pt(), multiplicity, posZ, track1.invMass(), triggerWeight); else LOGF(fatal, "Can not fill mass axis without invMass column. Disable cfgMassAxis."); @@ -353,23 +374,23 @@ struct CorrelationTask { target->getTriggerHist()->Fill(step, track1.pt(), multiplicity, posZ, triggerWeight); } - for (auto& track2 : tracks2) { + for (const auto& track2 : tracks2) { if constexpr (std::is_same::value) { if (track1.globalIndex() == track2.globalIndex()) { // LOGF(info, "Track identical: %f | %f | %f || %f | %f | %f", track1.eta(), track1.phi(), track1.pt(), track2.eta(), track2.phi(), track2.pt()); continue; } } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (!cfgMcTriggerPDGs->empty() && std::find(cfgMcTriggerPDGs->begin(), cfgMcTriggerPDGs->end(), track2.pdgCode()) != cfgMcTriggerPDGs->end()) continue; } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (track2.globalIndex() == track1.cfTrackProng0Id()) // do not correlate daughter tracks of the same event continue; } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (track2.globalIndex() == track1.cfTrackProng1Id()) // do not correlate daughter tracks of the same event continue; } @@ -380,37 +401,37 @@ struct CorrelationTask { } } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast(track2.decay()))) == 0u) continue; } - if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) { if (doprocessSame2Prong2Prong && (track1.decay() == track2.decay() || track1.decay() > 1 || track2.decay() > 1)) { continue; } } // D0 and anti-D0 selection - if constexpr (std::experimental::is_detected::value) { - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (track1.cfTrackProng0Id() == track2.cfTrackProng0Id()) { continue; } } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (track1.cfTrackProng0Id() == track2.cfTrackProng1Id()) { continue; } } } - if constexpr (std::experimental::is_detected::value) { - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (track1.cfTrackProng1Id() == track2.cfTrackProng0Id()) { continue; } } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (track1.cfTrackProng1Id() == track2.cfTrackProng1Id()) { continue; } @@ -421,13 +442,13 @@ struct CorrelationTask { continue; } - if constexpr (std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value) { if (cfgAssociatedCharge != 0 && cfgAssociatedCharge * track2.sign() < 0) { continue; } } - if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) { if (cfgPairCharge != 0 && cfgPairCharge * track1.sign() * track2.sign() < 0) { continue; } @@ -435,7 +456,7 @@ struct CorrelationTask { if constexpr (std::is_same::value) { if constexpr (step >= CorrelationContainer::kCFStepReconstructed) { - if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) { + if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) { if (cfg.mPairCuts && mPairCuts.conversionCuts(track1, track2)) { continue; } @@ -453,22 +474,16 @@ struct CorrelationTask { } } - float deltaPhi = track1.phi() - track2.phi(); - if (deltaPhi > 1.5f * PI) { - deltaPhi -= TwoPI; - } - if (deltaPhi < -PIHalf) { - deltaPhi += TwoPI; - } + float deltaPhi = RecoDecay::constrainAngle(track1.phi() - track2.phi(), -o2::constants::math::PIHalf); // last param is the weight if (cfgMassAxis && doprocessSame2Prong2Prong) { - if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) + if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) target->getPairHist()->Fill(step, track1.eta() - track2.eta(), track2.pt(), track1.pt(), multiplicity, deltaPhi, posZ, track2.invMass(), track1.invMass(), associatedWeight); else LOGF(fatal, "Can not fill mass axis without invMass column. \n no mass for two particles"); } else if (cfgMassAxis) { - if constexpr (std::experimental::is_detected::value) + if constexpr (std::experimental::is_detected::value) target->getPairHist()->Fill(step, track1.eta() - track2.eta(), track2.pt(), track1.pt(), multiplicity, deltaPhi, posZ, track1.invMass(), associatedWeight); else LOGF(fatal, "Can not fill mass axis without invMass column. Disable cfgMassAxis."); @@ -522,7 +537,7 @@ struct CorrelationTask { } // Version with explicit nested loop - void processSameAOD(aodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, aodTracks const& tracks) + void processSameAOD(AodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, AodTracks const& tracks) { // NOTE legacy function for O2 integration tests. Full version needs derived data @@ -545,7 +560,7 @@ struct CorrelationTask { } PROCESS_SWITCH(CorrelationTask, processSameAOD, "Process same event on AOD", true); - void processSameDerived(derivedCollisions::iterator const& collision, soa::Filtered const& tracks) + void processSameDerived(DerivedCollisions::iterator const& collision, soa::Filtered const& tracks) { BinningTypeDerived configurableBinningDerived{{axisVertex, axisMultiplicity}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. if (cfgVerbosity > 0) { @@ -573,7 +588,7 @@ struct CorrelationTask { } PROCESS_SWITCH(CorrelationTask, processSameDerived, "Process same event on derived data", false); - void processSame2ProngDerived(derivedCollisions::iterator const& collision, soa::Filtered const& tracks, soa::Filtered const& p2tracks) + void processSame2ProngDerived(DerivedCollisions::iterator const& collision, soa::Filtered const& tracks, soa::Filtered const& p2tracks) { BinningTypeDerived configurableBinningDerived{{axisVertex, axisMultiplicity}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. if (cfgVerbosity > 0) { @@ -597,7 +612,7 @@ struct CorrelationTask { } PROCESS_SWITCH(CorrelationTask, processSame2ProngDerived, "Process same event on derived data", false); - void processSame2Prong2Prong(derivedCollisions::iterator const& collision, soa::Filtered const& p2tracks) + void processSame2Prong2Prong(DerivedCollisions::iterator const& collision, soa::Filtered const& p2tracks) { BinningTypeDerived configurableBinningDerived{{axisVertex, axisMultiplicity}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. if (cfgVerbosity > 0) { @@ -622,14 +637,14 @@ struct CorrelationTask { PROCESS_SWITCH(CorrelationTask, processSame2Prong2Prong, "Process same event on derived data", false); using BinningTypeAOD = ColumnBinningPolicy; - void processMixedAOD(aodCollisions& collisions, aodTracks const& tracks, aod::BCsWithTimestamps const&) + void processMixedAOD(AodCollisions const& collisions, AodTracks const& tracks, aod::BCsWithTimestamps const&) { // NOTE legacy function for O2 integration tests. Full version needs derived data // Strictly upper categorised collisions, for cfgNoMixedEvents combinations per bin, skipping those in entry -1 BinningTypeAOD configurableBinning{{axisVertex, axisMultiplicity}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. auto tracksTuple = std::make_tuple(tracks); - SameKindPair pairs{configurableBinning, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip + SameKindPair pairs{configurableBinning, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip int skipID = -1; for (auto it = pairs.begin(); it != pairs.end(); it++) { @@ -665,12 +680,12 @@ struct CorrelationTask { PROCESS_SWITCH(CorrelationTask, processMixedAOD, "Process mixed events on AOD", false); using BinningTypeDerived = ColumnBinningPolicy; - void processMixedDerived(derivedCollisions& collisions, derivedTracks const& tracks) + void processMixedDerived(DerivedCollisions const& collisions, DerivedTracks const& tracks) { BinningTypeDerived configurableBinningDerived{{axisVertex, axisMultiplicity}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. // Strictly upper categorised collisions, for cfgNoMixedEvents combinations per bin, skipping those in entry -1 auto tracksTuple = std::make_tuple(tracks); - SameKindPair pairs{configurableBinningDerived, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip + SameKindPair pairs{configurableBinningDerived, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip for (auto it = pairs.begin(); it != pairs.end(); it++) { auto& [collision1, tracks1, collision2, tracks2] = *it; @@ -706,12 +721,12 @@ struct CorrelationTask { } PROCESS_SWITCH(CorrelationTask, processMixedDerived, "Process mixed events on derived data", false); - void processMixed2ProngDerived(derivedCollisions& collisions, derivedTracks const& tracks, soa::Filtered const& p2tracks) + void processMixed2ProngDerived(DerivedCollisions const& collisions, DerivedTracks const& tracks, soa::Filtered const& p2tracks) { BinningTypeDerived configurableBinningDerived{{axisVertex, axisMultiplicity}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. // Strictly upper categorised collisions, for cfgNoMixedEvents combinations per bin, skipping those in entry -1 auto tracksTuple = std::make_tuple(p2tracks, tracks); - Pair, derivedTracks, BinningTypeDerived> pairs{configurableBinningDerived, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip + Pair, DerivedTracks, BinningTypeDerived> pairs{configurableBinningDerived, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip for (auto it = pairs.begin(); it != pairs.end(); it++) { auto& [collision1, tracks1, collision2, tracks2] = *it; @@ -767,7 +782,7 @@ struct CorrelationTask { // mixed->getTriggerHist()->Fill(eventValues, CorrelationContainer::kCFStepReconstructed); } - for (auto& [track1, track2] : combinations(tracks, tracks)) { + for (const auto& [track1, track2] : combinations(tracks, tracks)) { // LOGF(info, "Combination %d %d", track1.index(), track2.index()); if (cfgTriggerCharge != 0 && cfgTriggerCharge * track1.sign() < 0) { @@ -788,14 +803,7 @@ struct CorrelationTask { continue; } - float deltaPhi = track1.phi() - track2.phi(); - if (deltaPhi > 1.5f * PI) { - deltaPhi -= TwoPI; - } - if (deltaPhi < -PIHalf) { - deltaPhi += TwoPI; - } - + float deltaPhi = RecoDecay::constrainAngle(track1.phi() - track2.phi(), -o2::constants::math: :PIHalf); same->getPairHist()->Fill(CorrelationContainer::kCFStepReconstructed, track1.eta() - track2.eta(), track2.pt(), track1.pt(), multiplicity, deltaPhi, collision.posZ()); // mixed->getPairHist()->Fill(values, CorrelationContainer::kCFStepReconstructed); @@ -803,7 +811,7 @@ struct CorrelationTask { } PROCESS_SWITCH(CorrelationTask, processWithCombinations, "Process same event on AOD with combinations", false);*/ - int GetSpecies(int pdgCode) + int getSpecies(int pdgCode) { switch (pdgCode) { case 211: // pion @@ -836,30 +844,30 @@ struct CorrelationTask { if (collisions.size() == 0) { return; } - for (auto& collision : collisions) { + for (const auto& collision : collisions) { multiplicity = collision.multiplicity(); } } // Primaries - for (auto& mcParticle : mcParticles) { + for (const auto& mcParticle : mcParticles) { if (mcParticle.isPhysicalPrimary() && mcParticle.sign() != 0) { - same->getTrackHistEfficiency()->Fill(CorrelationContainer::MC, mcParticle.eta(), mcParticle.pt(), GetSpecies(mcParticle.pdgCode()), multiplicity, mcCollision.posZ()); + same->getTrackHistEfficiency()->Fill(CorrelationContainer::MC, mcParticle.eta(), mcParticle.pt(), getSpecies(mcParticle.pdgCode()), multiplicity, mcCollision.posZ()); } } - for (auto& collision : collisions) { + for (const auto& collision : collisions) { auto groupedTracks = tracks.sliceBy(perCollision, collision.globalIndex()); if (cfgVerbosity > 0) { LOGF(info, " Reconstructed collision at vtx-z = %f", collision.posZ()); LOGF(info, " which has %d tracks", groupedTracks.size()); } - for (auto& track : groupedTracks) { + for (const auto& track : groupedTracks) { if (track.has_cfMCParticle()) { const auto& mcParticle = track.cfMCParticle(); if (mcParticle.isPhysicalPrimary()) { - same->getTrackHistEfficiency()->Fill(CorrelationContainer::RecoPrimaries, mcParticle.eta(), mcParticle.pt(), GetSpecies(mcParticle.pdgCode()), multiplicity, mcCollision.posZ()); + same->getTrackHistEfficiency()->Fill(CorrelationContainer::RecoPrimaries, mcParticle.eta(), mcParticle.pt(), getSpecies(mcParticle.pdgCode()), multiplicity, mcCollision.posZ()); } - same->getTrackHistEfficiency()->Fill(CorrelationContainer::RecoAll, mcParticle.eta(), mcParticle.pt(), GetSpecies(mcParticle.pdgCode()), multiplicity, mcCollision.posZ()); + same->getTrackHistEfficiency()->Fill(CorrelationContainer::RecoAll, mcParticle.eta(), mcParticle.pt(), getSpecies(mcParticle.pdgCode()), multiplicity, mcCollision.posZ()); // LOGF(info, "Filled track %d", track.globalIndex()); } else { // fake track @@ -882,7 +890,7 @@ struct CorrelationTask { if (collisions.size() == 0) { return; } - for (auto& collision : collisions) { + for (const auto& collision : collisions) { multiplicity = collision.multiplicity(); } if (cfgVerbosity > 0) { @@ -914,7 +922,7 @@ struct CorrelationTask { PROCESS_SWITCH(CorrelationTask, processMCSameDerived, "Process MC same event on derived data", false); PresliceUnsorted collisionPerMCCollision = aod::cfcollision::cfMcCollisionId; - void processMCMixedDerived(soa::Filtered& mcCollisions, soa::Filtered const& mcParticles, soa::Filtered const& collisions) + void processMCMixedDerived(soa::Filtered const& mcCollisions, soa::Filtered const& mcParticles, soa::Filtered const& collisions) { bool useMCMultiplicity = (cfgCentBinsForMC == 0); auto getMultiplicity = From b43a32b8bad16525f6c12f1ba482413380ebb14c Mon Sep 17 00:00:00 2001 From: omassen <55696099+omassen@users.noreply.github.com> Date: Mon, 9 Dec 2024 23:25:06 +0100 Subject: [PATCH 301/459] [PWGCF] Addition of proton-neutron ZDC correlation task in TwoParticleCorrelations (#8879) Co-authored-by: ALICE Action Bot --- .../Tasks/CMakeLists.txt | 5 + .../Tasks/neutronProtonCorrZdc.cxx | 247 ++++++++++++++++++ 2 files changed, 252 insertions(+) create mode 100644 PWGCF/TwoParticleCorrelations/Tasks/neutronProtonCorrZdc.cxx diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index fe8f8ed9e1a..84207fe8c5b 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -53,6 +53,11 @@ o2physics_add_dpl_workflow(corr-sparse PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(neutronprotoncorrzdc + SOURCES neutronProtonCorrZdc.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + diff --git a/PWGCF/TwoParticleCorrelations/Tasks/neutronProtonCorrZdc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/neutronProtonCorrZdc.cxx new file mode 100644 index 00000000000..55082201362 --- /dev/null +++ b/PWGCF/TwoParticleCorrelations/Tasks/neutronProtonCorrZdc.cxx @@ -0,0 +1,247 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \file neutronProtonCorrZdc.cxx +/// \brief Correlations between protons and neutrons in the ZDC +/// \author Olaf Massen + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" + +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct NeutronProtonCorrZdc { + // Histogram registry: an object to hold your histograms + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Configurable cfgNBinsZN{"cfgNBinsZN", 100, "N bins for ZNA and ZNC"}; + Configurable cfgNBinsZP{"cfgNBinsZP", 100, "N bins for ZPA and ZPC"}; + Configurable cfgZNmin{"cfgZNmin", -10, "Minimum value for ZN signal"}; + Configurable cfgZNmax{"cfgZNmax", 350, "Maximum value for ZN signal"}; + Configurable cfgZPmin{"cfgZPmin", -10, "Minimum value for ZP signal"}; + Configurable cfgZPmax{"cfgZPmax", 200, "Maximum value for ZP signal"}; + Configurable cfgDiffZmin{"cfgDiffZmin", -50, "Minimum value for the diffZ signal"}; + Configurable cfgDiffZmax{"cfgDiffZmax", 50, "Maximum value for the diffZ signal"}; + Configurable cfgNBinsAlpha{"cfgNBinsAlpha", 100, "Number of bins for ZDC asymmetry"}; + Configurable cfgAlphaZmin{"cfgAlphaZmin", -1, "Minimum value for ZDC asymmetry"}; + Configurable cfgAlphaZmax{"cfgAlphaZmax", 1, "Maximum value for ZDC asymmetry"}; + Configurable cfgProcessRun2{"cfgProcessRun2", false, "Analyse Run 2 converted data"}; + // Configurable cfgCentralityEstimator{"cfgCentralityEstimator", 0, "Choice of centrality estimator"};//0 for FTOC, 1 for FTOA, 2 for FTOM, 3 for FVOA. //To be included at a later stage + + ConfigurableAxis cfgAxisCent{"cfgAxisCent", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.2f, 4.4f, 4.6f, 4.8f, 5.0f, 5.5f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 8.5f, 9.0f, 9.5f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f, 25.0f, 26.0f, 27.0f, 28.0f, 29.0f, 30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f, 37.0f, 38.0f, 39.0f, 40.0f, 41.0f, 42.0f, 43.0f, 44.0f, 45.0f, 46.0f, 47.0f, 48.0f, 49.0f, 50.0f, 51.0f, 52.0f, 53.0f, 54.0f, 55.0f, 56.0f, 57.0f, 58.0f, 59.0f, 60.0f, 61.0f, 62.0f, 63.0f, 64.0f, 65.0f, 66.0f, 67.0f, 68.0f, 69.0f, 70.0f, 71.0f, 72.0f, 73.0f, 74.0f, 75.0f, 76.0f, 77.0f, 78.0f, 79.0f, 80.0f, 81.0f, 82.0f, 83.0f, 84.0f, 85.0f, 86.0f, 87.0f, 88.0f, 89.0f, 90.0f, 91.0f, 92.0f, 93.0f, 94.0f, 95.0f, 96.0f, 97.0f, 98.0f, 99.0f, 100.0f}, "Centrality [%]"}; + + Filter collisionVtxZ = nabs(aod::collision::posZ) < 10.f; + + using CentralitiesRun3 = aod::CentFT0Cs; + using CentralitiesRun2 = aod::CentRun2V0Ms; + using BCsRun3 = soa::Join; + + void init(InitContext const&) + { + // define axes you want to use + const AxisSpec axisCounter{4, 0, +2, ""}; + const AxisSpec axisZNSectorSignal{cfgNBinsZN, cfgZNmin, cfgZNmax / 3.}; + const AxisSpec axisZPSectorSignal{cfgNBinsZP, cfgZPmin, cfgZPmax / 3.}; + const AxisSpec axisZNASignal{cfgNBinsZN, cfgZNmin, cfgZNmax, "ZNA (a.u.)"}; + const AxisSpec axisZNCSignal{cfgNBinsZN, cfgZNmin, cfgZNmax, "ZNC (a.u.)"}; + const AxisSpec axisZPASignal{cfgNBinsZP, cfgZPmin, cfgZPmax, "ZPA (a.u.)"}; + const AxisSpec axisZPCSignal{cfgNBinsZP, cfgZPmin, cfgZPmax, "ZPC (a.u.)"}; + const AxisSpec axisZNSignal{2 * cfgNBinsZN, cfgZNmin, 1.5 * cfgZNmax, "ZN (a.u.)"}; + const AxisSpec axisZPSignal{2 * cfgNBinsZP, cfgZPmin, 1.5 * cfgZPmax, "ZP (a.u.)"}; + const AxisSpec axisAlphaZ{cfgNBinsAlpha, cfgAlphaZmin, cfgAlphaZmax, "#alpha_{spec}"}; + const AxisSpec axisZDiffSignal{cfgNBinsZN, cfgDiffZmin, cfgDiffZmax, "#Delta E"}; + + // create histograms + histos.add("eventCounter", "eventCounter", kTH1F, {axisCounter}); + + histos.add("ZNASector0Signal", "ZNASector0Signal", kTH1F, {axisZNSectorSignal}); + histos.add("ZNASector1Signal", "ZNASector1Signal", kTH1F, {axisZNSectorSignal}); + histos.add("ZNASector2Signal", "ZNASector2Signal", kTH1F, {axisZNSectorSignal}); + histos.add("ZNASector3Signal", "ZNASector3Signal", kTH1F, {axisZNSectorSignal}); + + histos.add("ZNCSector0Signal", "ZNCSector0Signal", kTH1F, {axisZNSectorSignal}); + histos.add("ZNCSector1Signal", "ZNCSector1Signal", kTH1F, {axisZNSectorSignal}); + histos.add("ZNCSector2Signal", "ZNCSector2Signal", kTH1F, {axisZNSectorSignal}); + histos.add("ZNCSector3Signal", "ZNCSector3Signal", kTH1F, {axisZNSectorSignal}); + + histos.add("ZPASector0Signal", "ZPASector0Signal", kTH1F, {axisZPSectorSignal}); + histos.add("ZPASector1Signal", "ZPASector1Signal", kTH1F, {axisZPSectorSignal}); + histos.add("ZPASector2Signal", "ZPASector2Signal", kTH1F, {axisZPSectorSignal}); + histos.add("ZPASector3Signal", "ZPASector3Signal", kTH1F, {axisZPSectorSignal}); + + histos.add("ZPCSector0Signal", "ZPCSector0Signal", kTH1F, {axisZPSectorSignal}); + histos.add("ZPCSector1Signal", "ZPCSector1Signal", kTH1F, {axisZPSectorSignal}); + histos.add("ZPCSector2Signal", "ZPCSector2Signal", kTH1F, {axisZPSectorSignal}); + histos.add("ZPCSector3Signal", "ZPCSector3Signal", kTH1F, {axisZPSectorSignal}); + + histos.add("ZNASignal", "ZNASignal", kTH1F, {axisZNASignal}); + histos.add("ZNCSignal", "ZNCSignal", kTH1F, {axisZNCSignal}); + histos.add("ZNSignal", "ZNSignal", kTH1F, {axisZNSignal}); + histos.add("ZPASignal", "ZPASignal", kTH1F, {axisZPASignal}); + histos.add("ZPCSignal", "ZPCSignal", kTH1F, {axisZPCSignal}); + histos.add("ZPSignal", "ZPSignal", kTH1F, {axisZPSignal}); + + histos.add("alphaZN", "alphaZN", kTH1F, {axisAlphaZ}); + histos.add("alphaZP", "alphaZP", kTH1F, {axisAlphaZ}); + + histos.add("diffZNASignal", "diffZNASignal", kTH1F, {axisZDiffSignal}); + histos.add("diffZNCSignal", "diffZNCSignal", kTH1F, {axisZDiffSignal}); + histos.add("diffZPASignal", "diffZPASignal", kTH1F, {axisZDiffSignal}); + histos.add("diffZPCSignal", "diffZPCSignal", kTH1F, {axisZDiffSignal}); + histos.add("diffZNSignal", "diffZNSignal", kTH1F, {axisZDiffSignal}); + histos.add("diffZPSignal", "diffZPSignal", kTH1F, {axisZDiffSignal}); + + histos.add("CentralityPercentile", "CentralityPercentile", kTH1F, {cfgAxisCent}); + + histos.add("CentvsZNASignal", "FT0CvsZNASignal", kTH2F, {cfgAxisCent, axisZNASignal}); + histos.add("CentvsZNCSignal", "FT0CvsZNCSignal", kTH2F, {cfgAxisCent, axisZNCSignal}); + histos.add("CentvsZPASignal", "FT0CvsZPASignal", kTH2F, {cfgAxisCent, axisZPASignal}); + histos.add("CentvsZPCSignal", "FT0CvsZPCSignal", kTH2F, {cfgAxisCent, axisZPCSignal}); + histos.add("CentvsZNSignal", "FT0CvsZNSignal", kTH2F, {cfgAxisCent, axisZNSignal}); + histos.add("CentvsZPSignal", "FT0CvsZPSignal", kTH2F, {cfgAxisCent, axisZPSignal}); + } + + void processRun3(soa::Filtered>::iterator const& collision, BCsRun3 const&, aod::Zdcs const&) + { + if (!collision.sel8()) { + histos.fill(HIST("eventCounter"), 0.25); + return; + } + const auto& foundBC = collision.foundBC_as(); + if (foundBC.has_zdc()) { + const auto& zdcread = foundBC.zdc(); + const auto cent = collision.centFT0C(); + + histos.fill(HIST("eventCounter"), 1.25); + histos.fill(HIST("ZNASignal"), zdcread.energyCommonZNA()); + histos.fill(HIST("ZNCSignal"), zdcread.energyCommonZNC()); + histos.fill(HIST("ZPASignal"), zdcread.energyCommonZPA()); + histos.fill(HIST("ZPCSignal"), zdcread.energyCommonZPC()); + histos.fill(HIST("ZNASector0Signal"), (zdcread.energySectorZNA())[0]); + histos.fill(HIST("ZNASector1Signal"), (zdcread.energySectorZNA())[1]); + histos.fill(HIST("ZNASector2Signal"), (zdcread.energySectorZNA())[2]); + histos.fill(HIST("ZNASector3Signal"), (zdcread.energySectorZNA())[3]); + histos.fill(HIST("ZNCSector0Signal"), (zdcread.energySectorZNC())[0]); + histos.fill(HIST("ZNCSector1Signal"), (zdcread.energySectorZNC())[1]); + histos.fill(HIST("ZNCSector2Signal"), (zdcread.energySectorZNC())[2]); + histos.fill(HIST("ZNCSector3Signal"), (zdcread.energySectorZNC())[3]); + histos.fill(HIST("ZPASector0Signal"), (zdcread.energySectorZPA())[0]); + histos.fill(HIST("ZPASector1Signal"), (zdcread.energySectorZPA())[1]); + histos.fill(HIST("ZPASector2Signal"), (zdcread.energySectorZPA())[2]); + histos.fill(HIST("ZPASector3Signal"), (zdcread.energySectorZPA())[3]); + histos.fill(HIST("ZPCSector0Signal"), (zdcread.energySectorZPC())[0]); + histos.fill(HIST("ZPCSector1Signal"), (zdcread.energySectorZPC())[1]); + histos.fill(HIST("ZPCSector2Signal"), (zdcread.energySectorZPC())[2]); + histos.fill(HIST("ZPCSector3Signal"), (zdcread.energySectorZPC())[3]); + + float sumZNC = (zdcread.energySectorZNC())[0] + (zdcread.energySectorZNC())[1] + (zdcread.energySectorZNC())[2] + (zdcread.energySectorZNC())[3]; + float sumZNA = (zdcread.energySectorZNA())[0] + (zdcread.energySectorZNA())[1] + (zdcread.energySectorZNA())[2] + (zdcread.energySectorZNA())[3]; + float sumZPC = (zdcread.energySectorZPC())[0] + (zdcread.energySectorZPC())[1] + (zdcread.energySectorZPC())[2] + (zdcread.energySectorZPC())[3]; + float sumZPA = (zdcread.energySectorZPA())[0] + (zdcread.energySectorZPA())[1] + (zdcread.energySectorZPA())[2] + (zdcread.energySectorZPA())[3]; + float alphaZN = (sumZNA - sumZNC) / (sumZNA + sumZNC); + float alphaZP = (sumZPA - sumZPC) / (sumZPA + sumZPC); + + histos.fill(HIST("alphaZN"), alphaZN); + histos.fill(HIST("alphaZP"), alphaZP); + + histos.fill(HIST("diffZNASignal"), sumZNA - zdcread.energyCommonZNA()); + histos.fill(HIST("diffZNCSignal"), sumZNC - zdcread.energyCommonZNC()); + histos.fill(HIST("diffZPASignal"), sumZPA - zdcread.energyCommonZPA()); + histos.fill(HIST("diffZPCSignal"), sumZPC - zdcread.energyCommonZPC()); + histos.fill(HIST("ZNSignal"), sumZNA + sumZNC); + histos.fill(HIST("ZPSignal"), sumZPA + sumZPC); + histos.fill(HIST("diffZNSignal"), (sumZNA + sumZNC) - (zdcread.energyCommonZNA() + zdcread.energyCommonZNC())); + histos.fill(HIST("diffZPSignal"), (sumZPA + sumZPC) - (zdcread.energyCommonZPA() + zdcread.energyCommonZPC())); + histos.fill(HIST("CentralityPercentile"), cent); + histos.fill(HIST("CentvsZNASignal"), cent, sumZNA); + histos.fill(HIST("CentvsZNCSignal"), cent, sumZNC); + histos.fill(HIST("CentvsZPASignal"), cent, sumZPA); + histos.fill(HIST("CentvsZPCSignal"), cent, sumZPC); + histos.fill(HIST("CentvsZNSignal"), cent, sumZNA + sumZNC); + histos.fill(HIST("CentvsZPSignal"), cent, sumZPA + sumZPC); + } + } + PROCESS_SWITCH(NeutronProtonCorrZdc, processRun3, "Process analysis for Run 3 data", true); + + void processRun2(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, aod::Zdcs const&) + { + if (!collision.alias_bit(kINT7)) { + histos.fill(HIST("eventCounter"), 0.25); + return; + } + + if (collision.has_zdc()) { + const auto& zdcread = collision.zdc(); + const auto cent = collision.centRun2V0M(); + histos.fill(HIST("eventCounter"), 1.25); + histos.fill(HIST("ZNASignal"), zdcread.energyCommonZNA()); + histos.fill(HIST("ZNCSignal"), zdcread.energyCommonZNC()); + histos.fill(HIST("ZPASignal"), zdcread.energyCommonZPA()); + histos.fill(HIST("ZPCSignal"), zdcread.energyCommonZPC()); + histos.fill(HIST("ZNASector0Signal"), (zdcread.energySectorZNA())[0]); + histos.fill(HIST("ZNASector1Signal"), (zdcread.energySectorZNA())[1]); + histos.fill(HIST("ZNASector2Signal"), (zdcread.energySectorZNA())[2]); + histos.fill(HIST("ZNASector3Signal"), (zdcread.energySectorZNA())[3]); + histos.fill(HIST("ZNCSector0Signal"), (zdcread.energySectorZNC())[0]); + histos.fill(HIST("ZNCSector1Signal"), (zdcread.energySectorZNC())[1]); + histos.fill(HIST("ZNCSector2Signal"), (zdcread.energySectorZNC())[2]); + histos.fill(HIST("ZNCSector3Signal"), (zdcread.energySectorZNC())[3]); + histos.fill(HIST("ZPASector0Signal"), (zdcread.energySectorZPA())[0]); + histos.fill(HIST("ZPASector1Signal"), (zdcread.energySectorZPA())[1]); + histos.fill(HIST("ZPASector2Signal"), (zdcread.energySectorZPA())[2]); + histos.fill(HIST("ZPASector3Signal"), (zdcread.energySectorZPA())[3]); + histos.fill(HIST("ZPCSector0Signal"), (zdcread.energySectorZPC())[0]); + histos.fill(HIST("ZPCSector1Signal"), (zdcread.energySectorZPC())[1]); + histos.fill(HIST("ZPCSector2Signal"), (zdcread.energySectorZPC())[2]); + histos.fill(HIST("ZPCSector3Signal"), (zdcread.energySectorZPC())[3]); + float sumZNC = (zdcread.energySectorZNC())[0] + (zdcread.energySectorZNC())[1] + (zdcread.energySectorZNC())[2] + (zdcread.energySectorZNC())[3]; + float sumZNA = (zdcread.energySectorZNA())[0] + (zdcread.energySectorZNA())[1] + (zdcread.energySectorZNA())[2] + (zdcread.energySectorZNA())[3]; + float sumZPC = (zdcread.energySectorZPC())[0] + (zdcread.energySectorZPC())[1] + (zdcread.energySectorZPC())[2] + (zdcread.energySectorZPC())[3]; + float sumZPA = (zdcread.energySectorZPA())[0] + (zdcread.energySectorZPA())[1] + (zdcread.energySectorZPA())[2] + (zdcread.energySectorZPA())[3]; + float alphaZN = (sumZNA - sumZNC) / (sumZNA + sumZNC); + float alphaZP = (sumZPA - sumZPC) / (sumZPA + sumZPC); + histos.fill(HIST("alphaZN"), alphaZN); + histos.fill(HIST("alphaZP"), alphaZP); + + histos.fill(HIST("diffZNASignal"), sumZNA - zdcread.energyCommonZNA()); + histos.fill(HIST("diffZNCSignal"), sumZNC - zdcread.energyCommonZNC()); + histos.fill(HIST("diffZPASignal"), sumZPA - zdcread.energyCommonZPA()); + histos.fill(HIST("diffZPCSignal"), sumZPC - zdcread.energyCommonZPC()); + histos.fill(HIST("ZNSignal"), sumZNA + sumZNC); + histos.fill(HIST("ZPSignal"), sumZPA + sumZPC); + histos.fill(HIST("diffZNSignal"), (sumZNA + sumZNC) - (zdcread.energyCommonZNA() + zdcread.energyCommonZNC())); + histos.fill(HIST("diffZPSignal"), (sumZPA + sumZPC) - (zdcread.energyCommonZPA() + zdcread.energyCommonZPC())); + histos.fill(HIST("CentralityPercentile"), cent); + histos.fill(HIST("CentvsZNASignal"), cent, sumZNA); + histos.fill(HIST("CentvsZNCSignal"), cent, sumZNC); + histos.fill(HIST("CentvsZPASignal"), cent, sumZPA); + histos.fill(HIST("CentvsZPCSignal"), cent, sumZPC); + histos.fill(HIST("CentvsZNSignal"), cent, sumZNA + sumZNC); + histos.fill(HIST("CentvsZPSignal"), cent, sumZPA + sumZPC); + } + } + PROCESS_SWITCH(NeutronProtonCorrZdc, processRun2, "Process analysis for Run 2 converted data", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From e2605781bc3a78fc0104c054ee5ddcab946c9134 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Tue, 10 Dec 2024 00:05:16 +0100 Subject: [PATCH 302/459] [PWGEM/Dilepton] update prefilter task (#8889) --- PWGEM/Dilepton/Core/Dilepton.h | 17 +++---- PWGEM/Dilepton/Core/DileptonMC.h | 6 ++- PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 50 +++++++++++++++----- PWGEM/Dilepton/Utils/PairUtilities.h | 10 ++-- 4 files changed, 58 insertions(+), 25 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index f6a5ceedbef..867d433a079 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -181,7 +181,7 @@ struct Dilepton { Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply phiv cut inherited from prefilter"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8, kSplitOrMergedTrackLSGeom : 16, kSplitOrMergedTrackULSGeom : 32] Please consider logical-OR among them."}; // see PairUtilities.h Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; @@ -531,11 +531,11 @@ struct Dilepton { if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca}, true); - fRegistry.add("Pair/same/uls/hsDeltaP", "difference of p between 2 tracks;|p_{T,1} - p_{T,2}|/|p_{T,1} + p_{T,2}|;#Delta#eta;#Delta#varphi (rad.);", kTHnSparseD, {{20, 0, 1}, {100, -1, +1}, {180, -M_PI, M_PI}}, true); + fRegistry.add("Pair/same/uls/hDeltaEtaDeltaPhi", "difference of p between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {100, -1, +1}}, true); fRegistry.add("Pair/same/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {200, -10, 10}}, true); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron - fRegistry.add("Pair/same/uls/hMvsOpAng", "m_{ee} vs. angle between 2 tracks;#omega (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{100, 0, 2.0}, {20, 0.0f, 3.2}}, true); + fRegistry.add("Pair/same/uls/hMvsOpAng", "m_{ee} vs. angle between 2 tracks;#omega (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); fRegistry.add("Pair/same/uls/hDCA1vsDCA2", "DCA of leg1 vs. DCA of leg2;DCA1(#sigma);DCA2 (#sigma)", kTH2D, {{100, 0, 10.0}, {100, 0, 10}}, true); } fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); @@ -910,7 +910,6 @@ struct Dilepton { } if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { - float dpt = fabs(v1.Pt() - v2.Pt()) / fabs(v1.Pt() + v2.Pt()); float deta = t1.sign() * v1.Pt() > t2.sign() * v2.Pt() ? v1.Eta() - v2.Eta() : v2.Eta() - v1.Eta(); float dphi = t1.sign() * v1.Pt() > t2.sign() * v2.Pt() ? v1.Phi() - v2.Phi() : v2.Phi() - v1.Phi(); o2::math_utils::bringToPMPi(dphi); @@ -920,7 +919,7 @@ struct Dilepton { if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, weight); - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hsDeltaP"), dpt, deta, dphi, weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hDeltaEtaDeltaPhi"), dphi, deta, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hMvsPhiV"), phiv, v12.M(), weight); @@ -928,7 +927,7 @@ struct Dilepton { } } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hs"), v12.M(), v12.Pt(), pair_dca, weight); - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hsDeltaP"), dpt, deta, dphi, weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hDeltaEtaDeltaPhi"), dphi, deta, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hMvsPhiV"), phiv, v12.M(), weight); @@ -936,7 +935,7 @@ struct Dilepton { } } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, weight); - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hsDeltaP"), dpt, deta, dphi, weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hDeltaEtaDeltaPhi"), dphi, deta, weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom, weight); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hMvsPhiV"), phiv, v12.M(), weight); @@ -1139,7 +1138,9 @@ struct Dilepton { ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) <= static_cast(0), true) && ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) <= static_cast(0), true) && ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) <= static_cast(0), true), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLSGeom))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLSGeom))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULSGeom))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULSGeom))) <= static_cast(0), true), o2::aod::emprimaryelectron::pfbpi0 >= static_cast(0)); Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index c686c102a25..d4291adb641 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -159,7 +159,7 @@ struct DileptonMC { Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply phiv cut inherited from prefilter"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8, kSplitOrMergedTrackLSGeom : 16, kSplitOrMergedTrackULSGeom : 32] Please consider logical-OR among them."}; // see PairUtilities.h Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; @@ -1063,7 +1063,9 @@ struct DileptonMC { ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kMee))) <= static_cast(0), true) && ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV))) <= static_cast(0), true) && ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) <= static_cast(0), true), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLSGeom))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLSGeom))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULSGeom))) > static_cast(0), (o2::aod::emprimaryelectron::pfbpi0 & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULSGeom))) <= static_cast(0), true), o2::aod::emprimaryelectron::pfbpi0 >= static_cast(0)); Preslice perCollision_muon = aod::emprimarymuon::emeventId; diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index b89874d9477..befbc7d9b40 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -88,21 +88,34 @@ struct prefilterDielectron { DielectronCut fDielectronCut; struct : ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass for prefilter ULS"}; // region to be rejected - Configurable cfg_max_mass{"cfg_max_mass", 0.0, "max mass for prefilter ULS"}; // region to be rejected - Configurable cfg_apply_dzrdphi_geom_uls{"cfg_apply_dzrdphi_geom_uls", false, "flag to apply generator dz-rdphi elliptic cut in ULS"}; // region to be rejected - Configurable cfg_apply_dzrdphi_geom_ls{"cfg_apply_dzrdphi_geom_ls", false, "flag to apply generator dz-rdphi elliptic cut in LS"}; // region to be rejected - Configurable cfg_min_dz_geom_ls{"cfg_min_dz_geom_ls", 3, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected - Configurable cfg_min_rdphi_geom_ls{"cfg_min_rdphi_geom_ls", 10, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected - Configurable cfg_min_dz_geom_uls{"cfg_min_dz_geom_uls", 3, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected - Configurable cfg_min_rdphi_geom_uls{"cfg_min_rdphi_geom_uls", 10, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected + // for mee prefilter + Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass for prefilter ULS"}; // region to be rejected + Configurable cfg_max_mass{"cfg_max_mass", 0.0, "max mass for prefilter ULS"}; // region to be rejected + + // for phiv prefilter Configurable cfg_apply_phiv{"cfg_apply_phiv", false, "flag to apply phiv cut"}; // region to be rejected Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; // region to be rejected Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; // region to be rejected Configurable cfg_min_phiv{"cfg_min_phiv", -1.f, "min phiv"}; // region to be rejected Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv"}; // region to be rejected + // for deta-dphi prefilter + Configurable cfg_apply_detadphi_uls{"cfg_apply_detadphi_uls", false, "flag to apply generator deta-dphi elliptic cut in ULS"}; // region to be rejected + Configurable cfg_apply_detadphi_ls{"cfg_apply_detadphi_ls", false, "flag to apply generator deta-dphi elliptic cut in LS"}; // region to be rejected + Configurable cfg_min_deta_ls{"cfg_min_deta_ls", 0.04, "deta between 2 electrons (elliptic cut)"}; // region to be rejected + Configurable cfg_min_dphi_ls{"cfg_min_dphi_ls", 0.2, "dphi between 2 electrons (elliptic cut)"}; // region to be rejected + Configurable cfg_min_deta_uls{"cfg_min_deta_uls", 0.04, "deta between 2 electrons (elliptic cut)"}; // region to be rejected + Configurable cfg_min_dphi_uls{"cfg_min_dphi_uls", 0.2, "dphi between 2 electrons (elliptic cut)"}; // region to be rejected + + // for dz-rdphi prefilter + Configurable cfg_apply_dzrdphi_geom_uls{"cfg_apply_dzrdphi_geom_uls", false, "flag to apply generator dz-rdphi elliptic cut in ULS"}; // region to be rejected + Configurable cfg_apply_dzrdphi_geom_ls{"cfg_apply_dzrdphi_geom_ls", false, "flag to apply generator dz-rdphi elliptic cut in LS"}; // region to be rejected + Configurable cfg_min_dz_geom_ls{"cfg_min_dz_geom_ls", 3, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_rdphi_geom_ls{"cfg_min_rdphi_geom_ls", 10, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_dz_geom_uls{"cfg_min_dz_geom_uls", 3, "geometrical min dz between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_rdphi_geom_uls{"cfg_min_rdphi_geom_uls", 10, "geometrical min rdphi between 2 electrons (elliptic cut) in cm"}; // region to be rejected + Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.9, "min eta for single track"}; @@ -423,10 +436,15 @@ struct prefilterDielectron { map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kPhiV); } - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_uls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom_uls, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom_uls, 2) < 1.f) { + if (dielectroncuts.cfg_apply_detadphi_uls && std::pow(deta / dielectroncuts.cfg_min_deta_uls, 2) + std::pow(dphi / dielectroncuts.cfg_min_dphi_uls, 2) < 1.f) { map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS); map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULS); } + + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_uls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom_uls, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom_uls, 2) < 1.f) { + map_pfb[pos.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULSGeom); + map_pfb[ele.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackULSGeom); + } } for (auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ @@ -453,10 +471,15 @@ struct prefilterDielectron { fRegistry.fill(HIST("Pair/before/lspp/hDeltaEtaDeltaPhi"), dphi, deta); fRegistry.fill(HIST("Pair/before/lspp/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom_ls, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom_ls, 2) < 1.f) { + if (dielectroncuts.cfg_apply_detadphi_ls && std::pow(deta / dielectroncuts.cfg_min_deta_ls, 2) + std::pow(dphi / dielectroncuts.cfg_min_dphi_ls, 2) < 1.f) { map_pfb[pos1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS); map_pfb[pos2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS); } + + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom_ls, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom_ls, 2) < 1.f) { + map_pfb[pos1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLSGeom); + map_pfb[pos2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLSGeom); + } } for (auto& [ele1, ele2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- @@ -483,10 +506,15 @@ struct prefilterDielectron { fRegistry.fill(HIST("Pair/before/lsmm/hDeltaEtaDeltaPhi"), dphi, deta); fRegistry.fill(HIST("Pair/before/lsmm/hGeomDeltaZRDeltaPhi"), rdphi_geom, dz_geom); - if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom_ls, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom_ls, 2) < 1.f) { + if (dielectroncuts.cfg_apply_detadphi_ls && std::pow(deta / dielectroncuts.cfg_min_deta_ls, 2) + std::pow(dphi / dielectroncuts.cfg_min_dphi_ls, 2) < 1.f) { map_pfb[ele1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS); map_pfb[ele2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLS); } + + if (dielectroncuts.cfg_x_to_go > 0.f && dielectroncuts.cfg_apply_dzrdphi_geom_ls && std::pow(dz_geom / dielectroncuts.cfg_min_dz_geom_ls, 2) + std::pow(rdphi_geom / dielectroncuts.cfg_min_rdphi_geom_ls, 2) < 1.f) { + map_pfb[ele1.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLSGeom); + map_pfb[ele2.globalIndex()] |= 1 << static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kSplitOrMergedTrackLSGeom); + } } } // end of collision loop diff --git a/PWGEM/Dilepton/Utils/PairUtilities.h b/PWGEM/Dilepton/Utils/PairUtilities.h index 35dd675a92d..05c858a25ec 100644 --- a/PWGEM/Dilepton/Utils/PairUtilities.h +++ b/PWGEM/Dilepton/Utils/PairUtilities.h @@ -42,10 +42,12 @@ enum class DileptonAnalysisType : int { kHFll = 6, }; enum class DileptonPrefilterBit : int { - kMee = 0, // reject tracks from pi0 dalitz decays at very low mass where S/B > 1 - kPhiV = 1, // reject tracks from photon conversions - kSplitOrMergedTrackLS = 2, // reject split or marged tracks in LS pairs - kSplitOrMergedTrackULS = 3, // reject split or marged tracks in ULS pairs + kMee = 0, // reject tracks from pi0 dalitz decays at very low mass where S/B > 1 + kPhiV = 1, // reject tracks from photon conversions + kSplitOrMergedTrackLS = 2, // reject split or marged tracks in LS pairs based on momentum deta-dphi at PV + kSplitOrMergedTrackULS = 3, // reject split or marged tracks in ULS pairs based on momentum deta-dphi at PV + kSplitOrMergedTrackLSGeom = 4, // reject split or marged tracks in LS pairs based on geometical distance at a certain propagated radius + kSplitOrMergedTrackULSGeom = 5, // reject split or marged tracks in ULS pairs based on geometical distance at a certain propagated radius }; using SMatrix55 = ROOT::Math::SMatrix>; From 6c894e6c3e6e610d269267cfddb29bbb10c93f32 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Tue, 10 Dec 2024 09:41:03 +0100 Subject: [PATCH 303/459] [PWGLF] added flags for TOF cuts and v0 to fourvector kinematics along with lower order cumulant corrections for charged particles (#8888) Co-authored-by: Prottay Das --- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 215 +++++++++++++++++------- 1 file changed, 150 insertions(+), 65 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index 083790327b8..54eca5c81fb 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -73,10 +73,8 @@ struct lambdapolsp { Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; Configurable additionalEvSel2{"additionalEvSel2", false, "additionalEvSel2"}; Configurable additionalEvSel3{"additionalEvSel3", false, "additionalEvSel3"}; - Configurable correction1{"correction1", false, "fill histograms including corrections 1"}; - Configurable correction2{"correction2", false, "fill histograms including corrections 2"}; Configurable QA{"QA", false, "flag for QA"}; - Configurable mycut{"mycut", false, "select tracks based on my cuts"}; + // Configurable mycut{"mycut", false, "select tracks based on my cuts"}; Configurable tofhit{"tofhit", true, "select tracks based on tof hit"}; Configurable globalpt{"globalpt", true, "select tracks based on pt global vs tpc"}; Configurable usefourvectormass{"usefourvectormass", true, "select invariant mass based on four vector"}; @@ -102,6 +100,9 @@ struct lambdapolsp { Configurable cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"}; Configurable isPVContributor{"isPVContributor", true, "is PV contributor"}; Configurable checkwithpub{"checkwithpub", true, "checking results with published"}; + Configurable rejectmisident{"rejectmisident", true, "rejecting misidentification"}; + Configurable useTPCTOF{"useTPCTOF", true, "flag to use TPC and TOF"}; + // Configs for V0 Configurable ConfV0PtMin{"ConfV0PtMin", 0.f, "Minimum transverse momentum of V0"}; Configurable ConfV0Rap{"ConfV0Rap", 0.8f, "Rapidity range of V0"}; @@ -112,15 +113,16 @@ struct lambdapolsp { Configurable cMaxV0DCA{"cMaxV0DCA", 1.2, "Maximum V0 DCA to PV"}; Configurable cMinV0DCA{"cMinV0DCA", 0.05, "Minimum V0 daughters DCA to PV"}; Configurable cMaxV0LifeTime{"cMaxV0LifeTime", 20, "Maximum V0 life time"}; - Configurable cSigmaMassKs0{"cSigmaMassKs0", 0.006, "Sigma cut on KS0 mass"}; - Configurable cMinLambdaMass{"cMinLambdaMass", 1.0, "Minimum lambda mass"}; - Configurable cMaxLambdaMass{"cMaxLambdaMass", 1.2, "Maximum lambda mass"}; + // config for V0 daughters Configurable ConfDaughEta{"ConfDaughEta", 0.8f, "V0 Daugh sel: max eta"}; - Configurable ConfDaughPt{"ConfDaughPt", 0.1f, "V0 Daugh sel: min pt"}; + Configurable cfgDaughPrPt{"cfgDaughPrPt", 0.4, "minimum daughter proton pt"}; + Configurable cfgDaughPiPt{"cfgDaughPiPt", 0.2, "minimum daughter pion pt"}; Configurable ConfDaughTPCnclsMin{"ConfDaughTPCnclsMin", 50.f, "V0 Daugh sel: Min. nCls TPC"}; Configurable ConfDaughDCAMin{"ConfDaughDCAMin", 0.08f, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"}; - Configurable ConfDaughPIDCuts{"ConfDaughPIDCuts", 3, "PID selections for KS0 daughters"}; + Configurable ConfDaughPIDCuts{"ConfDaughPIDCuts", 3, "PID selections for Lambda daughters"}; + Configurable ConfDaughPIDTPCCuts{"ConfDaughPIDTPCCuts", 3, "PID selections for Lambda daughters in TPC"}; + Configurable ConfDaughPIDTOFCuts{"ConfDaughPIDTOFCuts", 3, "PID selections for Lambda daughters in TOF"}; Configurable CentNbins{"CentNbins", 16, "Number of bins in cent histograms"}; Configurable lbinCent{"lbinCent", 0.0, "lower bin value in cent histograms"}; @@ -182,6 +184,11 @@ struct lambdapolsp { histos.add("hpoddv1vscentpteta", "hpoddv1vscentpteta", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); histos.add("hpevenv1vscentpteta", "hpevenv1vscentpteta", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpuxvscentpteta", "hpuxvscentpteta", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpuyvscentpteta", "hpuyvscentpteta", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpuxvscentptetaneg", "hpuxvscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpuyvscentptetaneg", "hpuyvscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); + histos.add("hpuxQxpvscentptetaneg", "hpuxQxpvscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); histos.add("hpuyQypvscentptetaneg", "hpuyQypvscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); histos.add("hpuxQxtvscentptetaneg", "hpuxQxtvscentptetaneg", kTProfile3D, {centAxis, thnAxispT, etaAxis}, true); @@ -196,6 +203,11 @@ struct lambdapolsp { histos.add("hpQxytpvscent", "hpQxytpvscent", kTProfile, {centAxis}, true); histos.add("hpQxtQypvscent", "hpQxtQypvscent", kTProfile, {centAxis}, true); histos.add("hpQxpQytvscent", "hpQxpQytvscent", kTProfile, {centAxis}, true); + + histos.add("hpQxpvscent", "hpQxpvscent", kTProfile, {centAxis}, true); + histos.add("hpQxtvscent", "hpQxtvscent", kTProfile, {centAxis}, true); + histos.add("hpQypvscent", "hpQypvscent", kTProfile, {centAxis}, true); + histos.add("hpQytvscent", "hpQytvscent", kTProfile, {centAxis}, true); } else if (useprofile == 2) { histos.add("hpuxQxpvscentpteta", "hpuxQxpvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); histos.add("hpuyQypvscentpteta", "hpuyQypvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); @@ -206,6 +218,11 @@ struct lambdapolsp { histos.add("hpoddv1vscentpteta", "hpoddv1vscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); histos.add("hpevenv1vscentpteta", "hpevenv1vscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxvscentpteta", "hpuxvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuyvscentpteta", "hpuyvscentpteta", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxvscentptetaneg", "hpuxvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuyvscentptetaneg", "hpuyvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); + histos.add("hpuxQxpvscentptetaneg", "hpuxQxpvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); histos.add("hpuyQypvscentptetaneg", "hpuyQypvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); histos.add("hpuxQxtvscentptetaneg", "hpuxQxtvscentptetaneg", HistType::kTHnSparseF, {centAxis, thnAxispT, etaAxis, spAxis}, true); @@ -220,6 +237,11 @@ struct lambdapolsp { histos.add("hpQxytpvscent", "hpQxytpvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); histos.add("hpQxtQypvscent", "hpQxtQypvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); histos.add("hpQxpQytvscent", "hpQxpQytvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + + histos.add("hpQxpvscent", "hpQxpvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + histos.add("hpQxtvscent", "hpQxtvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + histos.add("hpQypvscent", "hpQypvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); + histos.add("hpQytvscent", "hpQytvscent", HistType::kTHnSparseF, {centAxis, spAxis}, true); } else { histos.add("hpuxQxpvscentpteta", "hpuxQxpvscentpteta", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); histos.add("hpuyQypvscentpteta", "hpuyQypvscentpteta", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); @@ -230,6 +252,11 @@ struct lambdapolsp { histos.add("hpoddv1vscentpteta", "hpoddv1vscentpteta", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); histos.add("hpevenv1vscentpteta", "hpevenv1vscentpteta", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpuxvscentpteta", "hpuxvscentpteta", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpuyvscentpteta", "hpuyvscentpteta", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpuxvscentptetaneg", "hpuxvscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpuyvscentptetaneg", "hpuyvscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); + histos.add("hpuxQxpvscentptetaneg", "hpuxQxpvscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); histos.add("hpuyQypvscentptetaneg", "hpuyQypvscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); histos.add("hpuxQxtvscentptetaneg", "hpuxQxtvscentptetaneg", HistType::kTHnSparseF, {configcentAxis, configthnAxispT, configetaAxis, spAxis}, true); @@ -244,6 +271,11 @@ struct lambdapolsp { histos.add("hpQxytpvscent", "hpQxytpvscent", HistType::kTHnSparseF, {configcentAxis, spAxis}, true); histos.add("hpQxtQypvscent", "hpQxtQypvscent", HistType::kTHnSparseF, {configcentAxis, spAxis}, true); histos.add("hpQxpQytvscent", "hpQxpQytvscent", HistType::kTHnSparseF, {configcentAxis, spAxis}, true); + + histos.add("hpQxpvscent", "hpQxpvscent", HistType::kTHnSparseF, {configcentAxis, spAxis}, true); + histos.add("hpQxtvscent", "hpQxtvscent", HistType::kTHnSparseF, {configcentAxis, spAxis}, true); + histos.add("hpQypvscent", "hpQypvscent", HistType::kTHnSparseF, {configcentAxis, spAxis}, true); + histos.add("hpQytvscent", "hpQytvscent", HistType::kTHnSparseF, {configcentAxis, spAxis}, true); } } @@ -276,35 +308,31 @@ struct lambdapolsp { histos.add("hSparseAntiLambdaPolA", "hSparseAntiLambdaPolA", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); histos.add("hSparseAntiLambdaPolC", "hSparseAntiLambdaPolC", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); - if (correction1) { - histos.add("hSparseLambda_corr1a", "hSparseLambda_corr1a", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); - histos.add("hSparseLambda_corr1b", "hSparseLambda_corr1b", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); - histos.add("hSparseLambda_corr1c", "hSparseLambda_corr1c", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configphiAxis, configcentAxis}, true); - histos.add("hSparseAntiLambda_corr1a", "hSparseAntiLambda_corr1a", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); - histos.add("hSparseAntiLambda_corr1b", "hSparseAntiLambda_corr1b", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); - histos.add("hSparseAntiLambda_corr1c", "hSparseAntiLambda_corr1c", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configphiAxis, configcentAxis}, true); - } - if (correction2) { - histos.add("hSparseLambda_corr2a", "hSparseLambda_corr2a", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); - histos.add("hSparseLambda_corr2b", "hSparseLambda_corr2b", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); - histos.add("hSparseAntiLambda_corr2a", "hSparseAntiLambda_corr2a", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); - histos.add("hSparseAntiLambda_corr2b", "hSparseAntiLambda_corr2b", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); - } + histos.add("hSparseLambda_corr1a", "hSparseLambda_corr1a", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseLambda_corr1b", "hSparseLambda_corr1b", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseLambda_corr1c", "hSparseLambda_corr1c", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configphiAxis, configcentAxis}, true); + histos.add("hSparseAntiLambda_corr1a", "hSparseAntiLambda_corr1a", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseAntiLambda_corr1b", "hSparseAntiLambda_corr1b", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseAntiLambda_corr1c", "hSparseAntiLambda_corr1c", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configphiAxis, configcentAxis}, true); + + histos.add("hSparseLambda_corr2a", "hSparseLambda_corr2a", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseLambda_corr2b", "hSparseLambda_corr2b", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseAntiLambda_corr2a", "hSparseAntiLambda_corr2a", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); + histos.add("hSparseAntiLambda_corr2b", "hSparseAntiLambda_corr2b", HistType::kTHnSparseF, {thnAxisInvMass, configthnAxispT, configetaAxis, configthnAxisPol, configcentAxis}, true); } } template bool selectionTrack(const T& candidate) { - + /* if (mycut) { if (!candidate.isGlobalTrack() || !candidate.isPVContributor() || !(candidate.itsNCls() > cfgITScluster) || !(candidate.tpcNClsFound() > cfgTPCcluster) || !(candidate.itsNClsInnerBarrel() >= 1)) { return false; } - } else { - if (!(candidate.isGlobalTrack() && candidate.isPVContributor() && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster && candidate.itsNClsInnerBarrel() >= 1)) { - return false; - } + } else {*/ + if (!(candidate.isGlobalTrack() && candidate.isPVContributor() && candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster && candidate.itsNClsInnerBarrel() >= 1)) { + return false; } return true; } @@ -363,10 +391,10 @@ struct lambdapolsp { // const auto dcaXY = track.dcaXY(); // const auto sign = track.sign(); /* - if (charge < 0 && sign > 0) { + if (charge < 0 && sign > 0) { return false; - } - if (charge > 0 && sign < 0) { + } + if (charge > 0 && sign < 0) { return false; }*/ if (track.tpcNClsCrossedRows() < 70) { @@ -375,9 +403,6 @@ struct lambdapolsp { if (TMath::Abs(eta) > ConfDaughEta) { return false; } - if (pt < ConfDaughPt) { - return false; - } if (tpcNClsF < ConfDaughTPCnclsMin) { return false; } @@ -385,13 +410,47 @@ struct lambdapolsp { return false; } /* - if (TMath::Abs(dcaXY) < ConfDaughDCAMin) { + if (TMath::Abs(dcaXY) < ConfDaughDCAMin) { return false; }*/ - if (pid == 0 && TMath::Abs(track.tpcNSigmaPr()) > ConfDaughPIDCuts) { + + if (useTPCTOF) { + if (track.pt() < 0.5 && pid == 0 && TMath::Abs(track.tpcNSigmaPr()) > ConfDaughPIDCuts) { + return false; + } + if (track.pt() < 0.5 && pid == 1 && TMath::Abs(track.tpcNSigmaPi()) > ConfDaughPIDCuts) { + return false; + } + if (track.hasTOF()) { + if (track.pt() > 0.5 && pid == 0 && TMath::Abs(track.tpcNSigmaPr()) > ConfDaughPIDTPCCuts && TMath::Abs(track.tofNSigmaPr()) > ConfDaughPIDTOFCuts) { + return false; + } + if (track.pt() > 0.5 && pid == 1 && TMath::Abs(track.tpcNSigmaPi()) > ConfDaughPIDTPCCuts && TMath::Abs(track.tofNSigmaPi()) > ConfDaughPIDTOFCuts) { + return false; + } + } + } else { + if (pid == 0 && TMath::Abs(track.tpcNSigmaPr()) > ConfDaughPIDCuts) { + return false; + } + if (pid == 1 && TMath::Abs(track.tpcNSigmaPi()) > ConfDaughPIDCuts) { + return false; + } + // for misidentification + if (rejectmisident) { + if (pid == 0 && TMath::Abs(track.tpcNSigmaPi()) < 3.0) { + return false; + } + if (pid == 1 && TMath::Abs(track.tpcNSigmaPr()) < 3.0) { + return false; + } + } + } + + if (pid == 0 && pt < cfgDaughPrPt) { return false; } - if (pid == 1 && TMath::Abs(track.tpcNSigmaPi()) > ConfDaughPIDCuts) { + if (pid == 1 && pt < cfgDaughPiPt) { return false; } @@ -428,7 +487,7 @@ struct lambdapolsp { using EventCandidates = soa::Filtered>; // using AllTrackCandidates = soa::Join; - using AllTrackCandidates = soa::Filtered>; + using AllTrackCandidates = soa::Filtered>; using ResoV0s = aod::V0Datas; // void processData(EventCandidates::iterator const& collision, AllTrackCandidates const&, ResoV0s const& V0s, aod::BCs const&) @@ -497,6 +556,11 @@ struct lambdapolsp { histos.fill(HIST("hpQxpQytvscent"), centrality, QxpQyt); histos.fill(HIST("hpQxtQypvscent"), centrality, QxtQyp); + histos.fill(HIST("hpQxpvscent"), centrality, qxZDCA); + histos.fill(HIST("hpQxtvscent"), centrality, qxZDCC); + histos.fill(HIST("hpQypvscent"), centrality, qyZDCA); + histos.fill(HIST("hpQytvscent"), centrality, qyZDCC); + for (auto track : tracks) { if (!selectionTrack(track)) { continue; @@ -526,6 +590,9 @@ struct lambdapolsp { histos.fill(HIST("hpuxQxtvscentpteta"), centrality, track.pt(), track.eta(), uxQxt); histos.fill(HIST("hpuyQytvscentpteta"), centrality, track.pt(), track.eta(), uyQyt); + histos.fill(HIST("hpuxvscentpteta"), centrality, track.pt(), track.eta(), ux); + histos.fill(HIST("hpuyvscentpteta"), centrality, track.pt(), track.eta(), uy); + histos.fill(HIST("hpuxyQxytvscentpteta"), centrality, track.pt(), track.eta(), uxyQxyt); histos.fill(HIST("hpuxyQxypvscentpteta"), centrality, track.pt(), track.eta(), uxyQxyp); histos.fill(HIST("hpoddv1vscentpteta"), centrality, track.pt(), track.eta(), oddv1); @@ -536,6 +603,9 @@ struct lambdapolsp { histos.fill(HIST("hpuxQxtvscentpteta"), centrality, track.tpcInnerParam(), track.eta(), uxQxt); histos.fill(HIST("hpuyQytvscentpteta"), centrality, track.tpcInnerParam(), track.eta(), uyQyt); + histos.fill(HIST("hpuxvscentpteta"), centrality, track.pt(), track.eta(), ux); + histos.fill(HIST("hpuyvscentpteta"), centrality, track.pt(), track.eta(), uy); + histos.fill(HIST("hpuxyQxytvscentpteta"), centrality, track.tpcInnerParam(), track.eta(), uxyQxyt); histos.fill(HIST("hpuxyQxypvscentpteta"), centrality, track.tpcInnerParam(), track.eta(), uxyQxyp); histos.fill(HIST("hpoddv1vscentpteta"), centrality, track.pt(), track.eta(), oddv1); @@ -550,6 +620,9 @@ struct lambdapolsp { histos.fill(HIST("hpuxQxtvscentpteta"), centrality, track.pt(), track.eta(), uxQxt); histos.fill(HIST("hpuyQytvscentpteta"), centrality, track.pt(), track.eta(), uyQyt); + histos.fill(HIST("hpuxvscentpteta"), centrality, track.pt(), track.eta(), ux); + histos.fill(HIST("hpuyvscentpteta"), centrality, track.pt(), track.eta(), uy); + histos.fill(HIST("hpuxyQxytvscentpteta"), centrality, track.pt(), track.eta(), uxyQxyt); histos.fill(HIST("hpuxyQxypvscentpteta"), centrality, track.pt(), track.eta(), uxyQxyp); histos.fill(HIST("hpoddv1vscentpteta"), centrality, track.pt(), track.eta(), oddv1); @@ -560,6 +633,9 @@ struct lambdapolsp { histos.fill(HIST("hpuxQxtvscentptetaneg"), centrality, track.pt(), track.eta(), uxQxt); histos.fill(HIST("hpuyQytvscentptetaneg"), centrality, track.pt(), track.eta(), uyQyt); + histos.fill(HIST("hpuxvscentptetaneg"), centrality, track.pt(), track.eta(), ux); + histos.fill(HIST("hpuyvscentptetaneg"), centrality, track.pt(), track.eta(), uy); + histos.fill(HIST("hpuxyQxytvscentptetaneg"), centrality, track.pt(), track.eta(), uxyQxyt); histos.fill(HIST("hpuxyQxypvscentptetaneg"), centrality, track.pt(), track.eta(), uxyQxyp); histos.fill(HIST("hpoddv1vscentptetaneg"), centrality, track.pt(), track.eta(), oddv1); @@ -571,6 +647,9 @@ struct lambdapolsp { histos.fill(HIST("hpuxQxtvscentpteta"), centrality, track.tpcInnerParam(), track.eta(), uxQxt); histos.fill(HIST("hpuyQytvscentpteta"), centrality, track.tpcInnerParam(), track.eta(), uyQyt); + histos.fill(HIST("hpuxvscentpteta"), centrality, track.pt(), track.eta(), ux); + histos.fill(HIST("hpuyvscentpteta"), centrality, track.pt(), track.eta(), uy); + histos.fill(HIST("hpuxyQxytvscentpteta"), centrality, track.tpcInnerParam(), track.eta(), uxyQxyt); histos.fill(HIST("hpuxyQxypvscentpteta"), centrality, track.tpcInnerParam(), track.eta(), uxyQxyp); histos.fill(HIST("hpoddv1vscentpteta"), centrality, track.pt(), track.eta(), oddv1); @@ -591,8 +670,9 @@ struct lambdapolsp { const auto signneg = negtrack.sign(); if (checksign) { - if (signpos < 0 || signneg > 0) + if (signpos < 0 || signneg > 0) { continue; + } } if (isSelectedV0Daughter(postrack, 0) && isSelectedV0Daughter(negtrack, 1)) { @@ -648,43 +728,48 @@ struct lambdapolsp { auto sinThetaStarcosphiphiStar = sinThetaStar * TMath::Cos(2 * GetPhiInRange(Lambda.Phi() - phiangle)); // A2 correction auto phiphiStar = GetPhiInRange(Lambda.Phi() - phiangle); - double candmass = 0.0; + auto candmass = 0.0; + auto candpt = 0.0; + auto candeta = 0.0; if (LambdaTag) { - if (usefourvectormass) + if (usefourvectormass) { candmass = Lambdacopy.M(); - else + candpt = Lambdacopy.Pt(); + candeta = Lambdacopy.Eta(); + } else { candmass = v0.mLambda(); - - histos.fill(HIST("hSparseLambdaPolA"), candmass, v0.pt(), v0.eta(), PolA, centrality); - histos.fill(HIST("hSparseLambdaPolC"), candmass, v0.pt(), v0.eta(), PolC, centrality); - if (correction1) { - histos.fill(HIST("hSparseLambda_corr1a"), candmass, v0.pt(), v0.eta(), sinPhiStar, centrality); - histos.fill(HIST("hSparseLambda_corr1b"), candmass, v0.pt(), v0.eta(), cosPhiStar, centrality); - histos.fill(HIST("hSparseLambda_corr1c"), candmass, v0.pt(), v0.eta(), phiphiStar, centrality); - if (correction2) { - histos.fill(HIST("hSparseLambda_corr2a"), candmass, v0.pt(), v0.eta(), sinThetaStar, centrality); - histos.fill(HIST("hSparseLambda_corr2b"), candmass, v0.pt(), v0.eta(), sinThetaStarcosphiphiStar, centrality); - } + candpt = v0.pt(); + candeta = v0.eta(); } + + histos.fill(HIST("hSparseLambdaPolA"), candmass, candpt, candeta, PolA, centrality); + histos.fill(HIST("hSparseLambdaPolC"), candmass, candpt, candeta, PolC, centrality); + histos.fill(HIST("hSparseLambda_corr1a"), candmass, candpt, candeta, sinPhiStar, centrality); + histos.fill(HIST("hSparseLambda_corr1b"), candmass, candpt, candeta, cosPhiStar, centrality); + histos.fill(HIST("hSparseLambda_corr1c"), candmass, candpt, candeta, phiphiStar, centrality); + histos.fill(HIST("hSparseLambda_corr2a"), candmass, candpt, candeta, sinThetaStar, centrality); + histos.fill(HIST("hSparseLambda_corr2b"), candmass, candpt, candeta, sinThetaStarcosphiphiStar, centrality); } + if (aLambdaTag) { - if (usefourvectormass) + if (usefourvectormass) { candmass = Lambdacopy.M(); - else + candpt = Lambdacopy.Pt(); + candeta = Lambdacopy.Eta(); + } else { candmass = v0.mAntiLambda(); - - histos.fill(HIST("hSparseAntiLambdaPolA"), candmass, v0.pt(), v0.eta(), PolA, centrality); - histos.fill(HIST("hSparseAntiLambdaPolC"), candmass, v0.pt(), v0.eta(), PolC, centrality); - if (correction1) { - histos.fill(HIST("hSparseAntiLambda_corr1a"), candmass, v0.pt(), v0.eta(), sinPhiStar, centrality); - histos.fill(HIST("hSparseAntiLambda_corr1b"), candmass, v0.pt(), v0.eta(), cosPhiStar, centrality); - histos.fill(HIST("hSparseAntiLambda_corr1c"), candmass, v0.pt(), v0.eta(), phiphiStar, centrality); - if (correction2) { - histos.fill(HIST("hSparseAntiLambda_corr2a"), candmass, v0.pt(), v0.eta(), sinThetaStar, centrality); - histos.fill(HIST("hSparseAntiLambda_corr2b"), candmass, v0.pt(), v0.eta(), sinThetaStarcosphiphiStar, centrality); - } + candpt = v0.pt(); + candeta = v0.eta(); } + + histos.fill(HIST("hSparseAntiLambdaPolA"), candmass, candpt, candeta, PolA, centrality); + histos.fill(HIST("hSparseAntiLambdaPolC"), candmass, candpt, candeta, PolC, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1a"), candmass, candpt, candeta, sinPhiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1b"), candmass, candpt, candeta, cosPhiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr1c"), candmass, candpt, candeta, phiphiStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr2a"), candmass, candpt, candeta, sinThetaStar, centrality); + histos.fill(HIST("hSparseAntiLambda_corr2b"), candmass, candpt, candeta, sinThetaStarcosphiphiStar, centrality); } } } From 3fb78bd970ea95a07a62cc4f6c794c3b40398160 Mon Sep 17 00:00:00 2001 From: SuJeong Ji <120470463+SuJeong-Ji@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:05:42 +0900 Subject: [PATCH 304/459] [PWGLF] Charged K(892) flow analysis fill histograms (#8877) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Resonances/CMakeLists.txt | 5 + PWGLF/Tasks/Resonances/chk892flow.cxx | 975 ++++++++++++++++++++++++++ PWGLF/Utils/collisionCuts.h | 66 +- 3 files changed, 1011 insertions(+), 35 deletions(-) create mode 100644 PWGLF/Tasks/Resonances/chk892flow.cxx diff --git a/PWGLF/Tasks/Resonances/CMakeLists.txt b/PWGLF/Tasks/Resonances/CMakeLists.txt index e6f7b573f2e..d49deced8f3 100644 --- a/PWGLF/Tasks/Resonances/CMakeLists.txt +++ b/PWGLF/Tasks/Resonances/CMakeLists.txt @@ -163,3 +163,8 @@ o2physics_add_dpl_workflow(highmasslambdasvx SOURCES highmasslambdasvx.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(chk892flow + SOURCES chk892flow.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/Resonances/chk892flow.cxx b/PWGLF/Tasks/Resonances/chk892flow.cxx new file mode 100644 index 00000000000..7bc523eb9e0 --- /dev/null +++ b/PWGLF/Tasks/Resonances/chk892flow.cxx @@ -0,0 +1,975 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file chk892flow.cxx +/// \brief Reconstruction of track-track decay resonance candidates +/// +/// +/// \author Su-Jeong Ji + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // FIXME +#include // FIXME + +#include +#include +#include +#include +#include +#include + +#include "TRandom3.h" +#include "TF1.h" +#include "TVector2.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "Math/GenVector/Boost.h" +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/StaticFor.h" +#include "DCAFitter/DCAFitterN.h" + +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Qvectors.h" + +#include "Common/Core/trackUtilities.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/RecoDecay.h" + +#include "CommonConstants/PhysicsConstants.h" + +#include "ReconstructionDataFormats/Track.h" + +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" + +#include "CCDB/CcdbApi.h" +#include "CCDB/BasicCCDBManager.h" + +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/Utils/collisionCuts.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; +using namespace o2::constants::physics; + +struct chk892flow { + enum binType : unsigned int { + kKstarP = 0, + kKstarN, + kKstarP_Mix, + kKstarN_Mix, + kKstarP_GenINEL10, + kKstarN_GenINEL10, + kKstarP_GenINELgt10, + kKstarN_GenINELgt10, + kKstarP_GenTrig10, + kKstarN_GenTrig10, + kKstarP_GenEvtSel, + kKstarN_GenEvtSel, + kKstarP_Rec, + kKstarN_Rec, + kTYEnd + }; + + SliceCache cache; + Preslice perCollision = aod::track::collisionId; + + using EventCandidates = soa::Join; + using TrackCandidates = soa::Join; + using V0Candidates = aod::V0Datas; + + using MCEventCandidates = soa::Join; + using MCTrackCandidates = soa::Join; + using MCV0Candidates = soa::Join; + + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Service ccdb; + Service pdg; + o2::ccdb::CcdbApi ccdbApi; + + Configurable cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; + Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"}; + + // Configurables + ConfigurableAxis cfgBinsPt{"cfgBinsPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 12.7, 12.8, 12.9, 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 14.0, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 14.9, 15.0}, "Binning of the pT axis"}; + ConfigurableAxis cfgBinsPtQA{"cfgBinsPtQA", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8, 7.0, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, 8.6, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.0}, "Binning of the pT axis"}; + ConfigurableAxis cfgBinsCent{"cfgBinsCent", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; + ConfigurableAxis cfgBinsVtxZ{"cfgBinsVtxZ", {VARIABLE_WIDTH, -10.0, -9.0, -8.0, -7.0, -6.0, -5.0, -4.0, -3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "Binning of the z-vertex axis"}; + Configurable cNbinsDiv{"cNbinsDiv", 1, "Integer to divide the number of bins"}; + + /// Event cuts + o2::analysis::CollisonCuts colCuts; + Configurable ConfEvtZvtx{"ConfEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable ConfEvtOccupancyInTimeRangeMax{"ConfEvtOccupancyInTimeRangeMax", -1, "Evt sel: maximum track occupancy"}; + Configurable ConfEvtOccupancyInTimeRangeMin{"ConfEvtOccupancyInTimeRangeMin", -1, "Evt sel: minimum track occupancy"}; + Configurable ConfEvtTriggerCheck{"ConfEvtTriggerCheck", false, "Evt sel: check for trigger"}; + Configurable ConfEvtTriggerSel{"ConfEvtTriggerSel", 8, "Evt sel: trigger"}; + Configurable ConfEvtOfflineCheck{"ConfEvtOfflineCheck", true, "Evt sel: check for offline selection"}; + Configurable ConfEvtTriggerTVXSel{"ConfEvtTriggerTVXSel", false, "Evt sel: triggerTVX selection (MB)"}; + Configurable ConfEvtTFBorderCut{"ConfEvtTFBorderCut", false, "Evt sel: apply TF border cut"}; + Configurable ConfEvtUseITSTPCvertex{"ConfEvtUseITSTPCvertex", false, "Evt sel: use at lease on ITS-TPC track for vertexing"}; + Configurable ConfEvtZvertexTimedifference{"ConfEvtZvertexTimedifference", true, "Evt sel: apply Z-vertex time difference"}; + Configurable ConfEvtPileupRejection{"ConfEvtPileupRejection", true, "Evt sel: apply pileup rejection"}; + Configurable ConfEvtNoITSROBorderCut{"ConfEvtNoITSROBorderCut", false, "Evt sel: apply NoITSRO border cut"}; + Configurable ConfincludeCentralityMC{"ConfincludeCentralityMC", false, "Include centrality in MC"}; + Configurable ConfEvtCollInTimeRangeStandard{"ConfEvtCollInTimeRangeStandard", true, "Evt sel: apply NoCollInTimeRangeStandard"}; + + /// Track selections + Configurable cMinPtcut{"cMinPtcut", 0.15, "Track minium pt cut"}; + Configurable cMaxEtacut{"cMaxEtacut", 0.8, "Track maximum eta cut"}; + + // Cuts from polarization analysis + Configurable cfgQvecSel{"cfgQvecSel", true, "Reject events when no QVector"}; + Configurable cfgOccupancySel{"cfgOccupancySel", false, "Occupancy selection"}; + Configurable cfgMaxOccupancy{"cfgMaxOccupancy", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + Configurable cfgMinOccupancy{"cfgMinOccupancy", -100, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + Configurable cfgNCollinTR{"cfgNCollinTR", false, "Additional selection for the number of coll in time range"}; + + Configurable cfgCentEst{"cfgCentEst", 1, "Centrality estimator, 1: FT0C, 2: FT0M"}; + + // DCAr to PV + Configurable cMaxbDCArToPVcut{"cMaxbDCArToPVcut", 0.1, "Track DCAr cut to PV Maximum"}; + // DCAz to PV + Configurable cMaxbDCAzToPVcut{"cMaxbDCAzToPVcut", 0.1, "Track DCAz cut to PV Maximum"}; + + /// PID Selections, pion + Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 3.0, "TPC nSigma cut for Pion"}; // TPC + Configurable cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF + Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; // Combined + Configurable cTOFVeto{"cTOFVeto", true, "TOF Veto, if false, TOF is nessessary for PID selection"}; // TOF Veto + + // Track selections + Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) + Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgPVContributor{"cfgPVContributor", false, "PV contributor track selection"}; // PV Contriuibutor + + Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; + Configurable cfgTPCcluster{"cfgTPCcluster", 0, "Number of TPC cluster"}; + Configurable cfgRatioTPCRowsOverFindableCls{"cfgRatioTPCRowsOverFindableCls", 0.0f, "TPC Crossed Rows to Findable Clusters"}; + Configurable cfgITSChi2NCl{"cfgITSChi2NCl", 999.0, "ITS Chi2/NCl"}; + Configurable cfgTPCChi2NCl{"cfgTPCChi2NCl", 999.0, "TPC Chi2/NCl"}; + Configurable cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"}; + Configurable cfgUseITSRefit{"cfgUseITSRefit", false, "Require ITS Refit"}; + Configurable cfgHasITS{"cfgHasITS", false, "Require ITS"}; + Configurable cfgHasTPC{"cfgHasTPC", false, "Require TPC"}; + Configurable cfgHasTOF{"cfgHasTOF", false, "Require TOF"}; + + // Secondary Selection + Configurable cfgReturnFlag{"boolReturnFlag", false, "Return Flag for debugging"}; + Configurable cSecondaryArmenterosCut{"boolArmenterosCut", true, "cut on Armenteros-Podolanski graph"}; + + Configurable cfgByPassDauPIDSelection{"cfgByPassDauPIDSelection", true, "Bypass Daughters PID selection"}; + Configurable cSecondaryDauDCAMax{"cSecondaryDauDCAMax", 1., "Maximum DCA Secondary daughters to PV"}; + Configurable cSecondaryDauPosDCAtoPVMin{"cSecondaryDauPosDCAtoPVMin", 0.0, "Minimum DCA Secondary positive daughters to PV"}; + Configurable cSecondaryDauNegDCAtoPVMin{"cSecondaryDauNegDCAtoPVMin", 0.0, "Minimum DCA Secondary negative daughters to PV"}; + + Configurable cSecondaryPtMin{"cSecondaryPtMin", 0.f, "Minimum transverse momentum of Secondary"}; + Configurable cSecondaryRapidityMax{"cSecondaryRapidityMax", 0.5, "Maximum rapidity of Secondary"}; + Configurable cSecondaryRadiusMin{"cSecondaryRadiusMin", 1.2, "Minimum transverse radius of Secondary"}; + Configurable cSecondaryCosPAMin{"cSecondaryCosPAMin", 0.995, "Mininum cosine pointing angle of Secondary"}; + Configurable cSecondaryDCAtoPVMax{"cSecondaryDCAtoPVMax", 0.3, "Maximum DCA Secondary to PV"}; + Configurable cSecondaryProperLifetimeMax{"cSecondaryProperLifetimeMax", 20, "Maximum Secondary Lifetime"}; + Configurable cSecondaryparamArmenterosCut{"paramArmenterosCut", 0.2, "parameter for Armenteros Cut"}; + Configurable cSecondaryMassWindow{"cSecondaryMassWindow", 0.075, "Secondary inv mass selciton window"}; + + // K* selection + Configurable cKstarMaxRap{"cKstarMaxRap", 0.5, "Kstar maximum rapidity"}; + Configurable cKstarMinRap{"cKstarMinRap", -0.5, "Kstar minimum rapidity"}; + + // Confs from flow analysis + Configurable cfgnMods{"cfgnMods", 1, "The number of modulations of interest starting from 2"}; + Configurable cfgNQvec{"cfgNQvec", 7, "The number of total Qvectors for looping over the task"}; + + Configurable cfgQvecDetName{"cfgQvecDetName", "FT0C", "The name of detector to be analyzed"}; + Configurable cfgQvecRefAName{"cfgQvecRefAName", "TPCpos", "The name of detector for reference A"}; + Configurable cfgQvecRefBName{"cfgQvecRefBName", "TPCneg", "The name of detector for reference B"}; + + int DetId; + int RefAId; + int RefBId; + + int QvecDetInd; + int QvecRefAInd; + int QvecRefBInd; + + float centrality; + + // PDG code + int kPDGK0s = 310; + int kPDGK0 = 311; + int kKstarPlus = 323; + int kPiPlus = 211; + + void init(o2::framework::InitContext&) + { + centrality = -999; + + colCuts.setCuts(ConfEvtZvtx, ConfEvtTriggerCheck, ConfEvtTriggerSel, ConfEvtOfflineCheck, /*checkRun3*/ true, /*triggerTVXsel*/ false, ConfEvtOccupancyInTimeRangeMax, ConfEvtOccupancyInTimeRangeMin); + colCuts.init(&histos); + colCuts.setTriggerTVX(ConfEvtTriggerTVXSel); + colCuts.setApplyTFBorderCut(ConfEvtTFBorderCut); + colCuts.setApplyITSTPCvertex(ConfEvtUseITSTPCvertex); + colCuts.setApplyZvertexTimedifference(ConfEvtZvertexTimedifference); + colCuts.setApplyPileupRejection(ConfEvtPileupRejection); + colCuts.setApplyNoITSROBorderCut(ConfEvtNoITSROBorderCut); + colCuts.setApplyCollInTimeRangeStandard(ConfEvtCollInTimeRangeStandard); + + AxisSpec centAxis = {cfgBinsCent, "T0M (%)"}; + AxisSpec vtxzAxis = {cfgBinsVtxZ, "Z Vertex (cm)"}; + AxisSpec epAxis = {100, -1.0 * constants::math::PI, constants::math::PI}; + AxisSpec epresAxis = {100, -1.02, 1.02}; + AxisSpec ptAxis = {cfgBinsPt, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec ptAxisQA = {cfgBinsPtQA, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec v2Axis = {200, -1, 1, "#v_{2}"}; + AxisSpec radiusAxis = {50, 0, 5, "Radius (cm)"}; + AxisSpec cpaAxis = {50, 0.95, 1.0, "CPA"}; + AxisSpec tauAxis = {250, 0, 25, "Lifetime (cm)"}; + AxisSpec dcaAxis = {200, 0, 2, "DCA (cm)"}; + AxisSpec dcaxyAxis = {200, 0, 2, "DCA_{#it{xy}} (cm)"}; + AxisSpec dcazAxis = {200, 0, 2, "DCA_{#it{z}} (cm)"}; + AxisSpec yAxis = {100, -1, 1, "Rapidity"}; + AxisSpec invMassAxisK0s = {400 / cNbinsDiv, 0.3, 0.7, "Invariant Mass (GeV/#it{c}^2)"}; // K0s ~497.611 + AxisSpec invMassAxisReso = {900 / cNbinsDiv, 0.5f, 1.4f, "Invariant Mass (GeV/#it{c}^2)"}; // chK(892) ~892 + AxisSpec invMassAxisScan = {150, 0, 1.5, "Invariant Mass (GeV/#it{c}^2)"}; // For selection + AxisSpec pidQAAxis = {130, -6.5, 6.5}; + AxisSpec dataTypeAxis = {9, 0, 9, "Histogram types"}; + AxisSpec mcTypeAxis = {4, 0, 4, "Histogram types"}; + + // THnSparse + AxisSpec axisType = {binType::kTYEnd, 0, binType::kTYEnd, "Type of bin with charge and mix"}; + AxisSpec mcLabelAxis = {5, -0.5, 4.5, "MC Label"}; + + histos.add("QA/K0sCutCheck", "Check K0s cut", HistType::kTH1D, {AxisSpec{12, -0.5, 11.5, "Check"}}); + + histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); + histos.add("QA/before/VtxZ", "Centrality distribution", {HistType::kTH1D, {vtxzAxis}}); + histos.add("QA/before/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); + + // EventPlane + histos.add("QA/EP/EPhEPDet", "Event plane distribution of FT0C (Det = A)", {HistType::kTH2D, {centAxis, epAxis}}); + histos.add("QA/EP/EPhEPB", "Event plane distribution of TPCpos (B)", {HistType::kTH2D, {centAxis, epAxis}}); + histos.add("QA/EP/EPhEPC", "Event plane distribution of TPCneg (C)", {HistType::kTH2D, {centAxis, epAxis}}); + + histos.add("QA/EP/hEPDet", "Event plane distribution of FT0C (Det = A)", {HistType::kTH2D, {centAxis, epAxis}}); + histos.add("QA/EP/hEPB", "Event plane distribution of TPCpos (B)", {HistType::kTH2D, {centAxis, epAxis}}); + histos.add("QA/EP/hEPC", "Event plane distribution of TPCneg (C)", {HistType::kTH2D, {centAxis, epAxis}}); + histos.add("QA/EP/hEPResAB", "cos(n(A-B))", {HistType::kTH2D, {centAxis, epAxis}}); + histos.add("QA/EP/hEPResAC", "cos(n(A-C))", {HistType::kTH2D, {centAxis, epAxis}}); + histos.add("QA/EP/hEPResBC", "cos(n(B-C))", {HistType::kTH2D, {centAxis, epAxis}}); + + // Bachelor pion + histos.add("QA/before/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QA/before/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + histos.add("QA/after/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QA/after/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 1 + histos.add("QA/before/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/before/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + + histos.add("QA/after/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/after/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + + // Secondary pion 2 + histos.add("QA/before/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/before/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + histos.add("QA/after/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/after/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + // K0s + histos.add("QA/before/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QA/before/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QA/before/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QA/before/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QA/before/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QA/before/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + histos.add("QA/after/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QA/after/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QA/after/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QA/after/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QA/after/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QA/after/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + // Kstar + // Invariant mass nSparse + histos.add("QA/before/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + histos.add("hInvmass_Kstar", "Invariant mass of unlike-sign chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis}); + histos.add("hInvmass_Kstar_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis}); + + // Mass QA (quick check) + histos.add("QA/before/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QA/before/k0sv2vsinvmass", "Invariant mass vs v2 of unlike-sign K0s", HistType::kTH2D, {invMassAxisK0s, v2Axis}); + histos.add("QA/before/kstarv2vsinvmass", "Invariant mass vs v2 of unlike-sign chK(892)", HistType::kTH2D, {invMassAxisReso, v2Axis}); + histos.add("QA/before/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); + histos.add("QA/before/kstarv2vsinvmass_Mix", "Invariant mass vs v2 of unlike-sign chK(892) from mixed event", HistType::kTH2D, {invMassAxisReso, v2Axis}); + + histos.add("QA/after/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + histos.add("QA/after/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QA/after/k0sv2vsinvmass", "Invariant mass vs v2 of unlike-sign K0s", HistType::kTH2D, {invMassAxisK0s, v2Axis}); + histos.add("QA/after/kstarv2vsinvmass", "Invariant mass vs v2 of unlike-sign chK(892)", HistType::kTH2D, {invMassAxisReso, v2Axis}); + histos.add("QA/after/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); + histos.add("QA/after/kstarv2vsinvmass_Mix", "Invariant mass vs v2 of unlike-sign chK(892) from mixed event", HistType::kTH2D, {invMassAxisReso, v2Axis}); + + DetId = GetDetId(cfgQvecDetName); + RefAId = GetDetId(cfgQvecRefAName); + RefBId = GetDetId(cfgQvecRefBName); + + if (DetId == RefAId || DetId == RefBId || RefAId == RefBId) { + LOGF(info, "Wrong detector configuration \n The FT0C will be used to get Q-Vector \n The TPCpos and TPCneg will be used as reference systems"); + // LOGF(info) << "Wrong detector configuration \n The FT0C will be used to get Q-Vector \n The TPCpos and TPCneg will be used as reference systems"; + DetId = 0; + RefAId = 4; + RefBId = 5; + } + + // MC + if (doprocessMC) { + + histos.add("QAMC/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); + // Bachelor pion + histos.add("QAMC/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QAMC/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 1 + histos.add("QAMC/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QAMC/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 2 + histos.add("QAMC/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QAMC/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + // Secondary Resonance (K0s cand) + histos.add("QAMC/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + + histos.add("QAMC/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QAMC/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QAMC/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QAMC/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QAMC/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QAMC/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + // K892 + histos.add("QAMC/KstarOA", "Opening angle of chK(892)", HistType::kTH1D, {AxisSpec{100, 0, 3.14, "Opening angle"}}); + histos.add("QAMC/KstarPairAsym", "Pair asymmetry of chK(892)", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QAMC/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + + histos.add("QAMC/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QAMC/k0sv2vsinvmass", "Invariant mass vs v2 of unlike-sign K0s", HistType::kTH2D, {invMassAxisK0s, v2Axis}); + histos.add("QAMC/kstarv2vsinvmass", "Invariant mass vs v2 of unlike-sign chK(892)", HistType::kTH2D, {invMassAxisReso, v2Axis}); + histos.add("QAMC/kstarinvmass_noKstar", "Invariant mass of unlike-sign no chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QAMC/kstarv2vsinvmass_noKstar", "Invariant mass vs v2 of unlike-sign no chK(892)", HistType::kTH2D, {invMassAxisReso, v2Axis}); + + histos.add("hInvmass_Kstar_MC", "Invariant mass of unlike chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso, v2Axis}); + + ccdb->setURL(cfgURL); + ccdbApi.init("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + } + + // Print output histograms statistics + LOG(info) << "Size of the histograms in chK(892) Analysis Task"; + histos.print(); + } + + template + float GetCentrality(CollisionType const& collision) + { + if (cfgCentEst == 1) { + return collision.centFT0C(); + } else if (cfgCentEst == 2) { + return collision.centFT0M(); + } else { + return -999; + } + } + + template + int GetDetId(DetNameType const& name) + { + LOGF(info, "GetDetID running"); + if (name.value == "FT0C") { + return 0; + } else if (name.value == "FT0A") { + return 1; + } else if (name.value == "FT0M") { + return 2; + } else if (name.value == "FV0A") { + return 3; + } else if (name.value == "TPCpos") { + return 4; + } else if (name.value == "TPCneg") { + return 5; + } else { + return false; + } + } + + // Track selection + template + bool trackCut(TrackType const& track) + { + // basic track cuts + if (std::abs(track.pt()) < cMinPtcut) + return false; + if (std::abs(track.eta()) > cMaxEtacut) + return false; + if (track.itsNCls() < cfgITScluster) + return false; + if (track.tpcNClsFound() < cfgTPCcluster) + return false; + if (track.tpcCrossedRowsOverFindableCls() < cfgRatioTPCRowsOverFindableCls) + return false; + if (track.itsChi2NCl() >= cfgITSChi2NCl) + return false; + if (track.tpcChi2NCl() >= cfgTPCChi2NCl) + return false; + if (cfgHasITS && !track.hasITS()) + return false; + if (cfgHasTPC && !track.hasTPC()) + return false; + if (cfgHasTOF && !track.hasTOF()) + return false; + if (cfgUseITSRefit && !track.passedITSRefit()) + return false; + if (cfgUseTPCRefit && !track.passedTPCRefit()) + return false; + if (cfgPVContributor && !track.isPVContributor()) + return false; + if (cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) + return false; + if (cfgGlobalTrack && !track.isGlobalTrack()) + return false; + if (cfgPrimaryTrack && !track.isPrimaryTrack()) + return false; + if (std::abs(track.dcaXY()) > cMaxbDCArToPVcut) + return false; + if (std::abs(track.dcaZ()) > cMaxbDCAzToPVcut) + return false; + return true; + } + + // PID selection tools + template + bool selectionPIDPion(TrackType const& candidate) + { + bool tpcPIDPassed{false}, tofPIDPassed{false}; + if (std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { + tpcPIDPassed = true; + } else { + return false; + } + if (candidate.hasTOF()) { + if (std::abs(candidate.tofNSigmaPi()) < cMaxTOFnSigmaPion) { + tofPIDPassed = true; + } + if ((nsigmaCutCombinedPion > 0) && (candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < nsigmaCutCombinedPion * nsigmaCutCombinedPion)) { + tofPIDPassed = true; + } + } else { + if (!cTOFVeto) { + return false; + } + tofPIDPassed = true; + } + if (tpcPIDPassed && tofPIDPassed) { + return true; + } + return false; + } + + template + bool selectionK0s(CollisionType const& collision, K0sType const& candidate) + { + auto DauDCA = candidate.dcaV0daughters(); + auto DauPosDCAtoPV = candidate.dcapostopv(); + auto DauNegDCAtoPV = candidate.dcanegtopv(); + auto pT = candidate.pt(); + auto Rapidity = candidate.yK0Short(); + auto Radius = candidate.v0radius(); + auto DCAtoPV = candidate.dcav0topv(); + auto CPA = candidate.v0cosPA(); + auto PropTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; + auto mK0s = candidate.mK0Short(); + + if (cfgReturnFlag) { + bool returnFlag = true; + + histos.fill(HIST("QA/K0sCutCheck"), 0); + if (DauDCA > cSecondaryDauDCAMax) { + histos.fill(HIST("QA/K0sCutCheck"), 1); + returnFlag = false; + } + if (DauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 2); + returnFlag = false; + } + if (DauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 3); + returnFlag = false; + } + if (pT < cSecondaryPtMin) { + histos.fill(HIST("QA/K0sCutCheck"), 4); + returnFlag = false; + } + if (Rapidity > cSecondaryRapidityMax) { + histos.fill(HIST("QA/K0sCutCheck"), 5); + returnFlag = false; + } + if (Radius < cSecondaryRadiusMin) { + histos.fill(HIST("QA/K0sCutCheck"), 6); + returnFlag = false; + } + if (DCAtoPV > cSecondaryDCAtoPVMax) { + histos.fill(HIST("QA/K0sCutCheck"), 7); + returnFlag = false; + } + if (CPA < cSecondaryCosPAMin) { + histos.fill(HIST("QA/K0sCutCheck"), 8); + returnFlag = false; + } + if (PropTauK0s > cSecondaryProperLifetimeMax) { + histos.fill(HIST("QA/K0sCutCheck"), 9); + returnFlag = false; + } + if (fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + returnFlag = false; + } + if (candidate.qtarm() < cSecondaryparamArmenterosCut * TMath::Abs(candidate.alpha())) { + histos.fill(HIST("QA/K0sCutCheck"), 11); + returnFlag = false; + } + return returnFlag; + + } else { + histos.fill(HIST("QA/K0sCutCheck"), 0); + if (DauDCA > cSecondaryDauDCAMax) { + histos.fill(HIST("QA/K0sCutCheck"), 1); + return false; + } + if (DauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 2); + return false; + } + if (DauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 3); + return false; + } + if (pT < cSecondaryPtMin) { + histos.fill(HIST("QA/K0sCutCheck"), 4); + return false; + } + if (Rapidity > cSecondaryRapidityMax) { + histos.fill(HIST("QA/K0sCutCheck"), 5); + return false; + } + if (Radius < cSecondaryRadiusMin) { + histos.fill(HIST("QA/K0sCutCheck"), 6); + return false; + } + if (DCAtoPV > cSecondaryDCAtoPVMax) { + histos.fill(HIST("QA/K0sCutCheck"), 7); + return false; + } + if (CPA < cSecondaryCosPAMin) { + histos.fill(HIST("QA/K0sCutCheck"), 8); + return false; + } + if (PropTauK0s > cSecondaryProperLifetimeMax) { + histos.fill(HIST("QA/K0sCutCheck"), 9); + return false; + } + if (fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + return false; + } + if (candidate.qtarm() < cSecondaryparamArmenterosCut * TMath::Abs(candidate.alpha())) { + histos.fill(HIST("QA/K0sCutCheck"), 11); + return false; + } + return true; + } + + } // selectionK0s + + double GetPhiInRange(double phi) + { + double result = phi; + while (result < 0) { + result = result + 2. * TMath::Pi() / 2; + } + while (result > 2. * TMath::Pi() / 2) { + result = result - 2. * TMath::Pi() / 2; + } + return result; + } + + template + bool isTrueKstar(const TrackTemplate& bTrack, const V0Template& K0scand) + { + if (abs(bTrack.PDGCode()) != kPiPlus) // Are you pion? + return false; + if (abs(K0scand.PDGCode()) != kPDGK0s) // Are you K0s? + return false; + + auto motherbTrack = bTrack.template mothers_as(); + auto motherkV0 = K0scand.template mothers_as(); + + // Check bTrack first + if (abs(motherbTrack.pdgCode()) != kKstarPlus) // Are you charged Kstar's daughter? + return false; // Apply first since it's more restrictive + + if (abs(motherkV0.pdgCode()) != 310) // Is it K0s? + return false; + // Check if K0s's mother is K0 (311) + auto motherK0 = motherkV0.template mothers_as(); + if (abs(motherK0.pdgCode()) != 311) + return false; + + // Check if K0's mother is Kstar (323) + auto motherKstar = motherK0.template mothers_as(); + if (abs(motherKstar.pdgCode()) != 323) + return false; + + // Check if bTrack and K0 have the same mother (global index) + if (motherbTrack.globalIndex() != motherK0.globalIndex()) + return false; + + return true; + } + + int count = 0; + + template + void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2, int nmode) + { + histos.fill(HIST("QA/before/CentDist"), centrality); + + QvecDetInd = DetId * 4 + 3 + (nmode - 2) * cfgNQvec * 4; + QvecRefAInd = RefAId * 4 + 3 + (nmode - 2) * cfgNQvec * 4; + QvecRefBInd = RefBId * 4 + 3 + (nmode - 2) * cfgNQvec * 4; + + double EPDet = TMath::ATan2(collision.qvecIm()[QvecDetInd], collision.qvecRe()[QvecDetInd]) / static_cast(nmode); + double EPRefB = TMath::ATan2(collision.qvecIm()[QvecRefAInd], collision.qvecRe()[QvecRefAInd]) / static_cast(nmode); + double EPRefC = TMath::ATan2(collision.qvecIm()[QvecRefBInd], collision.qvecRe()[QvecRefBInd]) / static_cast(nmode); + + double EPResAB = TMath::Cos(static_cast(nmode) * (EPDet - EPRefB)); + double EPResAC = TMath::Cos(static_cast(nmode) * (EPDet - EPRefC)); + double EPResBC = TMath::Cos(static_cast(nmode) * (EPRefB - EPRefC)); + + histos.fill(HIST("QA/EP/hEPDet"), centrality, EPDet); + histos.fill(HIST("QA/EP/hEPB"), centrality, EPRefB); + histos.fill(HIST("QA/EP/hEPC"), centrality, EPRefC); + histos.fill(HIST("QA/EP/hEPResAB"), centrality, EPResAB); + histos.fill(HIST("QA/EP/hEPResAC"), centrality, EPResAC); + histos.fill(HIST("QA/EP/hEPResBC"), centrality, EPResBC); + + TLorentzVector lDecayDaughter1, lDecayDaughter2, lResoSecondary, lDecayDaughter_bach, lResoKstar; + std::vector trackIndicies = {}; + std::vector k0sIndicies = {}; + + for (auto& bTrack : dTracks1) { + auto trkbpt = bTrack.pt(); + auto istrkbhasTOF = bTrack.hasTOF(); + auto trkbNSigmaPiTPC = bTrack.tpcNSigmaPi(); + auto trkbNSigmaPiTOF = (istrkbhasTOF) ? bTrack.tofNSigmaPi() : -999.; + + if constexpr (!IsMix) { + // Bachelor pion QA plots + histos.fill(HIST("QA/before/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); + if (istrkbhasTOF) { + histos.fill(HIST("QA/before/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); + histos.fill(HIST("QA/before/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + } + histos.fill(HIST("QA/before/trkbpionpT"), trkbpt); + histos.fill(HIST("QA/before/trkbpionDCAxy"), bTrack.dcaXY()); + histos.fill(HIST("QA/before/trkbpionDCAz"), bTrack.dcaZ()); + } + + if (!trackCut(bTrack)) + continue; + if (!selectionPIDPion(bTrack)) + continue; + + if constexpr (!IsMix) { + // Bachelor pion QA plots after applying cuts + histos.fill(HIST("QA/after/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); + if (istrkbhasTOF) { + histos.fill(HIST("QA/after/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); + histos.fill(HIST("QA/after/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + } + histos.fill(HIST("QA/after/trkbpionpT"), trkbpt); + histos.fill(HIST("QA/after/trkbpionDCAxy"), bTrack.dcaXY()); + histos.fill(HIST("QA/after/trkbpionDCAz"), bTrack.dcaZ()); + } + trackIndicies.push_back(bTrack.index()); + } + + for (auto& K0scand : dTracks2) { + auto posDauTrack = K0scand.template posTrack_as(); + auto negDauTrack = K0scand.template negTrack_as(); + + /// Daughters + // Positve pion + auto trkppt = posDauTrack.pt(); + auto istrkphasTOF = posDauTrack.hasTOF(); + auto trkpNSigmaPiTPC = posDauTrack.tpcNSigmaPi(); + auto trkpNSigmaPiTOF = (istrkphasTOF) ? posDauTrack.tofNSigmaPi() : -999.; + // Negative pion + auto trknpt = negDauTrack.pt(); + auto istrknhasTOF = negDauTrack.hasTOF(); + auto trknNSigmaPiTPC = negDauTrack.tpcNSigmaPi(); + auto trknNSigmaPiTOF = (istrknhasTOF) ? negDauTrack.tofNSigmaPi() : -999.; + + /// K0s + auto trkkDauDCA = K0scand.dcaV0daughters(); + auto trkkDauDCAPostoPV = K0scand.dcapostopv(); + auto trkkDauDCANegtoPV = K0scand.dcanegtopv(); + auto trkkpt = K0scand.pt(); + auto trkky = K0scand.yK0Short(); + auto trkkRadius = K0scand.v0radius(); + auto trkkDCAtoPV = K0scand.dcav0topv(); + auto trkkCPA = K0scand.v0cosPA(); + auto trkkPropTau = K0scand.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; + auto trkkMass = K0scand.mK0Short(); + + if constexpr (!IsMix) { + // Seconddary QA plots + histos.fill(HIST("QA/before/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); + if (istrkphasTOF) { + histos.fill(HIST("QA/before/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); + histos.fill(HIST("QA/before/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); + } + histos.fill(HIST("QA/before/trkppionpT"), trkppt); + histos.fill(HIST("QA/before/trkppionDCAxy"), posDauTrack.dcaXY()); + histos.fill(HIST("QA/before/trkppionDCAz"), posDauTrack.dcaZ()); + + histos.fill(HIST("QA/before/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); + if (istrknhasTOF) { + histos.fill(HIST("QA/before/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); + histos.fill(HIST("QA/before/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); + } + histos.fill(HIST("QA/before/trknpionpT"), trknpt); + histos.fill(HIST("QA/before/trknpionDCAxy"), negDauTrack.dcaXY()); + histos.fill(HIST("QA/before/trknpionDCAz"), negDauTrack.dcaZ()); + + histos.fill(HIST("QA/before/hDauDCASecondary"), trkkDauDCA); + histos.fill(HIST("QA/before/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); + histos.fill(HIST("QA/before/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); + + histos.fill(HIST("QA/before/hpT_Secondary"), trkkpt); + histos.fill(HIST("QA/before/hy_Secondary"), trkky); + histos.fill(HIST("QA/before/hRadiusSecondary"), trkkRadius); + histos.fill(HIST("QA/before/hDCAtoPVSecondary"), trkkDCAtoPV); + histos.fill(HIST("QA/before/hCPASecondary"), trkkCPA); + histos.fill(HIST("QA/before/hPropTauSecondary"), trkkPropTau); + histos.fill(HIST("QA/before/hInvmassSecondary"), trkkMass); + } + + // if (!trackCut(posDauTrack) || !trackCut(negDauTrack)) // Too tight cut for K0s daugthers + // continue; + if (!cfgByPassDauPIDSelection && !selectionPIDPion(posDauTrack)) // Perhaps it's already applied in trackCut (need to check QA plots) + continue; + if (!cfgByPassDauPIDSelection && !selectionPIDPion(negDauTrack)) + continue; + if (!selectionK0s(collision, K0scand)) + continue; + + if constexpr (!IsMix) { + // Seconddary QA plots after applying cuts + + histos.fill(HIST("QA/after/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); + if (istrkphasTOF) { + histos.fill(HIST("QA/after/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); + histos.fill(HIST("QA/after/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); + } + histos.fill(HIST("QA/after/trkppionpT"), trkppt); + histos.fill(HIST("QA/after/trkppionDCAxy"), posDauTrack.dcaXY()); + histos.fill(HIST("QA/after/trkppionDCAz"), posDauTrack.dcaZ()); + + histos.fill(HIST("QA/after/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); + if (istrknhasTOF) { + histos.fill(HIST("QA/after/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); + histos.fill(HIST("QA/after/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); + } + histos.fill(HIST("QA/after/trknpionpT"), trknpt); + histos.fill(HIST("QA/after/trknpionDCAxy"), negDauTrack.dcaXY()); + histos.fill(HIST("QA/after/trknpionDCAz"), negDauTrack.dcaZ()); + + histos.fill(HIST("QA/after/hDauDCASecondary"), trkkDauDCA); + histos.fill(HIST("QA/after/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); + histos.fill(HIST("QA/after/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); + + histos.fill(HIST("QA/after/hpT_Secondary"), trkkpt); + histos.fill(HIST("QA/after/hy_Secondary"), trkky); + histos.fill(HIST("QA/after/hRadiusSecondary"), trkkRadius); + histos.fill(HIST("QA/after/hDCAtoPVSecondary"), trkkDCAtoPV); + histos.fill(HIST("QA/after/hCPASecondary"), trkkCPA); + histos.fill(HIST("QA/after/hPropTauSecondary"), trkkPropTau); + histos.fill(HIST("QA/after/hInvmassSecondary"), trkkMass); + } + k0sIndicies.push_back(K0scand.index()); + } + + for (auto& trackIndex : trackIndicies) { + for (auto& k0sIndex : k0sIndicies) { + auto bTrack = dTracks1.rawIteratorAt(trackIndex); + auto K0scand = dTracks2.rawIteratorAt(k0sIndex); + + lDecayDaughter_bach.SetXYZM(bTrack.px(), bTrack.py(), bTrack.pz(), MassPionCharged); + lResoSecondary.SetXYZM(K0scand.px(), K0scand.py(), K0scand.pz(), MassK0Short); + lResoKstar = lResoSecondary + lDecayDaughter_bach; + + auto phiminuspsi_k0s = GetPhiInRange(lResoSecondary.Phi() - EPDet); + auto phiminuspsi_kstar = GetPhiInRange(lResoKstar.Phi() - EPDet); + auto v2_k0s = TMath::Cos(static_cast(nmode) * phiminuspsi_k0s); + auto v2_kstar = TMath::Cos(static_cast(nmode) * phiminuspsi_kstar); + + // QA plots + if constexpr (!IsMix) { + histos.fill(HIST("QA/before/KstarRapidity"), lResoKstar.Rapidity()); + histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); + histos.fill(HIST("QA/before/k0sv2vsinvmass"), lResoSecondary.M(), v2_k0s); + histos.fill(HIST("QA/before/kstarv2vsinvmass"), lResoKstar.M(), v2_kstar); + } + + if (lResoKstar.Rapidity() > cKstarMaxRap || lResoKstar.Rapidity() < cKstarMinRap) + continue; + + if constexpr (!IsMix) { + unsigned int typeKstar = bTrack.sign() > 0 ? binType::kKstarP : binType::kKstarN; + + histos.fill(HIST("QA/after/KstarRapidity"), lResoKstar.Rapidity()); + histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); + histos.fill(HIST("QA/after/k0sv2vsinvmass"), lResoSecondary.M(), v2_k0s); + histos.fill(HIST("QA/after/kstarv2vsinvmass"), lResoKstar.M(), v2_kstar); + histos.fill(HIST("hInvmass_Kstar"), typeKstar, centrality, lResoKstar.Pt(), lResoKstar.M(), v2_kstar); + + } // IsMix + } // K0scand + } // bTrack + + count++; + + } // fillHistograms + + // process data + void processData(EventCandidates::iterator const& collision, + TrackCandidates const& tracks, + V0Candidates const& v0s, + aod::BCsWithTimestamps const&) + { + if (!colCuts.isSelected(collision)) // Default event selection + return; + if (cfgQvecSel && (collision.qvecAmp()[DetId] < 1e-4 || collision.qvecAmp()[RefAId] < 1e-4 || collision.qvecAmp()[RefBId] < 1e-4)) + return; // If we don't have a Q-vector + colCuts.fillQA(collision); + centrality = GetCentrality(collision); + + fillHistograms(collision, tracks, v0s, 2); // second order + } + PROCESS_SWITCH(chk892flow, processData, "Process Event for data without Partitioning", true); + + // process MC reconstructed level + void processMC(EventCandidates::iterator const& collision, + MCTrackCandidates const& tracks, + MCV0Candidates const& v0s) + { + + histos.fill(HIST("QAMC/hEvent"), 1.0); + + fillHistograms(collision, tracks, v0s, 2); + } + PROCESS_SWITCH(chk892flow, processMC, "Process Event for MC", false); +}; +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"lf-chk892flow"})}; +} diff --git a/PWGLF/Utils/collisionCuts.h b/PWGLF/Utils/collisionCuts.h index 6322e272083..a272cb32670 100644 --- a/PWGLF/Utils/collisionCuts.h +++ b/PWGLF/Utils/collisionCuts.h @@ -24,6 +24,8 @@ #include "Framework/Logger.h" #include "Common/DataModel/EventSelection.h" +using namespace o2::framework; + namespace o2::analysis { @@ -77,26 +79,26 @@ class CollisonCuts /// Initializes histograms for the task /// \param registry Histogram registry to be passed - void init(o2::framework::HistogramRegistry* registry) + void init(HistogramRegistry* registry) { if (!mCutsSet) { LOGF(error, "Event selection not set - quitting!"); } mHistogramRegistry = registry; - mHistogramRegistry->add("Event/posZ", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram after event selections - mHistogramRegistry->add("Event/posZ_noCut", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram before all selections + mHistogramRegistry->add("Event/posZ", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram after event selections + mHistogramRegistry->add("Event/posZ_noCut", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram before all selections if (mCheckIsRun3) { - mHistogramRegistry->add("Event/CentFV0A", "; vCentV0A; Entries", o2::framework::kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/CentFT0M", "; vCentT0M; Entries", o2::framework::kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/CentFT0C", "; vCentT0C; Entries", o2::framework::kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/CentFT0A", "; vCentT0A; Entries", o2::framework::kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/posZ_ITSOnly", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); - mHistogramRegistry->add("Event/posZ_ITSTPC", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); - mHistogramRegistry->add("Event/trackOccupancyInTimeRange_noCut", "; Occupancy; Entries", o2::framework::kTH1F, {{500, 0., 20000.}}); + mHistogramRegistry->add("Event/CentFV0A", "; vCentV0A; Entries", kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentFT0M", "; vCentT0M; Entries", kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentFT0C", "; vCentT0C; Entries", kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentFT0A", "; vCentT0A; Entries", kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/posZ_ITSOnly", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); + mHistogramRegistry->add("Event/posZ_ITSTPC", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); + mHistogramRegistry->add("Event/trackOccupancyInTimeRange_noCut", "; Occupancy; Entries", kTH1F, {{500, 0., 20000.}}); } else { - mHistogramRegistry->add("Event/CentRun2V0M", "; vCentV0M; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentRun2V0M", "; vCentV0M; Entries", kTH1F, {{110, 0, 110}}); } - mHistogramRegistry->add("CollCutCounts", "; ; Entries", o2::framework::kTH1F, {{11, 0., 11.}}); + mHistogramRegistry->add("CollCutCounts", "; ; Entries", kTH1F, {{11, 0., 11.}}); mHistogramRegistry->get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(binLabel(EvtSel::kAllEvent), "all"); mHistogramRegistry->get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(binLabel(EvtSel::kFlagZvertex), "Zvtx"); mHistogramRegistry->get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(binLabel(EvtSel::kFlagTrigerTVX), "IsTriggerTVX"); @@ -219,11 +221,6 @@ class CollisonCuts LOGF(debug, "Offline selection failed (sel7)"); return false; } - auto bc = col.template bc_as(); - if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) { - LOGF(debug, "Offline selection failed (AliEventCuts)"); - return false; - } mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagTrigerTVX); } if (mCheckTrigger && !col.alias_bit(mTrigger)) { @@ -276,24 +273,23 @@ class CollisonCuts } private: - using BCsWithRun2Info = soa::Join; - o2::framework::HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output - bool mCutsSet = false; ///< Protection against running without cuts - bool mCheckTrigger = false; ///< Check for trigger - bool mTriggerTVXselection = false; ///< Check for trigger TVX selection - bool mCheckOffline = false; ///< Check for offline criteria (might change) - bool mCheckIsRun3 = false; ///< Check if running on Pilot Beam - bool mInitialTriggerScan = false; ///< Check trigger when the event is first selected - bool mApplyTFBorderCut = false; ///< Apply time frame border cut - bool mApplyITSTPCvertex = false; ///< Apply at least one ITS-TPC track for vertexing - bool mApplyZvertexTimedifference = false; ///< removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference. - bool mApplyPileupRejection = false; ///< Pileup rejection - bool mApplyNoITSROBorderCut = false; ///< Apply NoITSRO frame border cut - bool mApplyCollInTimeRangeStandard = false; ///< Apply NoCollInTimeRangeStandard selection - int mTrigger = kINT7; ///< Trigger to check for - float mZvtxMax = 999.f; ///< Maximal deviation from nominal z-vertex (cm) - int mtrackOccupancyInTimeRangeMax = -1; ///< Maximum trackOccupancyInTimeRange cut (-1 no cut) - int mtrackOccupancyInTimeRangeMin = -1; ///< Minimum trackOccupancyInTimeRange cut (-1 no cut) + HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output + bool mCutsSet = false; ///< Protection against running without cuts + bool mCheckTrigger = false; ///< Check for trigger + bool mTriggerTVXselection = false; ///< Check for trigger TVX selection + bool mCheckOffline = false; ///< Check for offline criteria (might change) + bool mCheckIsRun3 = false; ///< Check if running on Pilot Beam + bool mInitialTriggerScan = false; ///< Check trigger when the event is first selected + bool mApplyTFBorderCut = false; ///< Apply time frame border cut + bool mApplyITSTPCvertex = false; ///< Apply at least one ITS-TPC track for vertexing + bool mApplyZvertexTimedifference = false; ///< removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference. + bool mApplyPileupRejection = false; ///< Pileup rejection + bool mApplyNoITSROBorderCut = false; ///< Apply NoITSRO frame border cut + bool mApplyCollInTimeRangeStandard = false; ///< Apply NoCollInTimeRangeStandard selection + int mTrigger = kINT7; ///< Trigger to check for + float mZvtxMax = 999.f; ///< Maximal deviation from nominal z-vertex (cm) + int mtrackOccupancyInTimeRangeMax = -1; ///< Maximum trackOccupancyInTimeRange cut (-1 no cut) + int mtrackOccupancyInTimeRangeMin = -1; ///< Minimum trackOccupancyInTimeRange cut (-1 no cut) }; } // namespace o2::analysis From 1abe2f4020dead252661f82b148ead4880391d0f Mon Sep 17 00:00:00 2001 From: Ida Storehaug <38440296+torkjellsdatter@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:46:16 +0100 Subject: [PATCH 305/459] [PWGDQ] [PWGDQ-120] debug of definition of cosine of pointing angle in dilepton-track-vertexing/VarManager.h (#8875) Co-authored-by: Ida Torkjellsdatter Storehaug --- PWGDQ/Core/VarManager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 8a24d5aec51..da676f4137a 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -3820,10 +3820,10 @@ void VarManager::FillDileptonTrackVertexing(C const& collision, T1 const& lepton values[VarManager::kVertexingLxy] = (collision.posX() - secondaryVertex[0]) * (collision.posX() - secondaryVertex[0]) + (collision.posY() - secondaryVertex[1]) * (collision.posY() - secondaryVertex[1]); - values[VarManager::kVertexingLxy] = std::sqrt(values[VarManager::kVertexingLxy]); values[VarManager::kVertexingLz] = (collision.posZ() - secondaryVertex[2]) * (collision.posZ() - secondaryVertex[2]); - values[VarManager::kVertexingLz] = std::sqrt(values[VarManager::kVertexingLz]); values[VarManager::kVertexingLxyz] = values[VarManager::kVertexingLxy] + values[VarManager::kVertexingLz]; + values[VarManager::kVertexingLxy] = std::sqrt(values[VarManager::kVertexingLxy]); + values[VarManager::kVertexingLz] = std::sqrt(values[VarManager::kVertexingLz]); values[VarManager::kVertexingLxyz] = std::sqrt(values[VarManager::kVertexingLxyz]); } From 7f053263e9d4cec063275d69200194151580aa4a Mon Sep 17 00:00:00 2001 From: Sabrina Hernandez Date: Thu, 19 Dec 2024 18:06:11 -0600 Subject: [PATCH 306/459] adjusted config axis for multiplicity --- PWGCF/Flow/Tasks/FlowZDCtask.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowZDCtask.cxx b/PWGCF/Flow/Tasks/FlowZDCtask.cxx index 7efdeff3d05..f3248147d19 100644 --- a/PWGCF/Flow/Tasks/FlowZDCtask.cxx +++ b/PWGCF/Flow/Tasks/FlowZDCtask.cxx @@ -9,6 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +// o2-analysis-cf-flow-zdc-task --aod-file AO2D.root --configuration json://configuration_run3.json | o2-analysis-track-propagation --aod-file AO2D.root --configuration json://configuration_run3.json | o2-analysis-timestamp --aod-file AO2D.root --configuration json://configuration_run3.json | o2-analysis-event-selection --aod-file AO2D.root --configuration json://configuration_run3.json | o2-analysis-trackselection --aod-file AO2D.root --configuration json://configuration_run3.json | o2-analysis-centrality-table --aod-file AO2D.root --configuration json://configuration_run3.json | o2-analysis-multiplicity-table --aod-file AO2D.root --configuration json://configuration_run3.json -b + #include #include #include @@ -79,7 +81,7 @@ struct FlowZDCtask { ConfigurableAxis axisPhi{"axisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"}; ConfigurableAxis axisEta{"axisEta", {40, -1., 1.}, "eta axis for histograms"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.30, 0.40, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.20, 2.40, 2.60, 2.80, 3.00}, "pt axis for histograms"}; - ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; + ConfigurableAxis axisMultiplicity{"axisMultiplicity", {2500, 0, 2500}, "centrality axis for histograms"}; ConfigurableAxis axisEnergy{"axisEnergy", {100, 0, 700}, "energy axis for zdc histos"}; Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); @@ -133,7 +135,7 @@ struct FlowZDCtask { AxisSpec axisVtxcounts{2, -0.5f, 1.5f, "Vtx info (0=no, 1=yes)"}; AxisSpec axisZvert{120, -30.f, 30.f, "Vtx z (cm)"}; AxisSpec axisCent{8, 0.f, 105.f, "centrality"}; - AxisSpec axisMult{1000, -0.5f, 1500.5f, "multiplicity"}; + AxisSpec axisMult{2500, 0, 2500.0f, "multiplicity"}; AxisSpec axisMultTPC{1000, -0.5f, 1999.5f, "TPCmultiplicity"}; AxisSpec axisCentBins{{0, 5., 10., 20., 30., 40., 50., 60., 70., 80.}, "centrality percentile"}; AxisSpec axisPtBins{{0., 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.25, 2.5, 2.75, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 8.0, 10., 13., 16., 20.}, "p_{T} (GeV/c)"}; @@ -144,7 +146,7 @@ struct FlowZDCtask { histos.add("eventCounter", "eventCounter", kTH1F, {axisCounter}); histos.add("centHistogram", "centHistogram", kTH1F, {axisCent}); - histos.add("multHistogram", "multHistogram", kTH1F, {axisMult}); + histos.add("multHistogram", "multHistogram", kTH1F, {axisMultiplicity}); histos.add("multvsCent", "centrality vs multiplicity", kTH2F, {axisCent, axisMult}); histos.add("phiHistogram", "phiHistogram", kTH1F, {axisPhi}); histos.add("TPCmultiplicity", "TPCmultiplicity", kTH1F, {axisMultTPC}); @@ -187,7 +189,6 @@ struct FlowZDCtask { histos.add("ImagQHistogramZNC", "ImagQHistogramZNC", kTH1F, {axisQZNA}); histos.add("Acorrelations", "Acorrelations", kTH2F, {{axisQZNA}, {axisQZNA}}); - histos.add("SPAngleZNA", "Spectator Plane Angle ZNA;Angle (radians);Entries", {HistType::kTH1F, {{100, -TMath::Pi(), TMath::Pi()}}}); histos.add("SPAngleZNC", "Spectator Plane Angle ZNC;Angle (radians);Entries", {HistType::kTH1F, {{100, -TMath::Pi(), TMath::Pi()}}}); From d07c2613a588ca433ceb15e04db72c2f5d439b9f Mon Sep 17 00:00:00 2001 From: amaringarcia Date: Tue, 10 Dec 2024 14:01:34 +0100 Subject: [PATCH 307/459] [Common,DPG] PID: Add AO2D metadata handling for pass name in TPC CCDB calls (pull/6793), adding NN-version number , using nSigmaTOFdautrack in protons from Lambda decays (#8835) --- Common/TableProducer/PID/pidTPC.cxx | 74 +++++++++++++++++++------- DPG/Tasks/TPC/tpcSkimsTableCreator.cxx | 10 ++-- 2 files changed, 63 insertions(+), 21 deletions(-) diff --git a/Common/TableProducer/PID/pidTPC.cxx b/Common/TableProducer/PID/pidTPC.cxx index 967225b5ca1..1fe071f2717 100644 --- a/Common/TableProducer/PID/pidTPC.cxx +++ b/Common/TableProducer/PID/pidTPC.cxx @@ -18,24 +18,32 @@ /// \brief Task to produce PID tables for TPC split for each particle. /// Only the tables for the mass hypotheses requested are filled, and only for the requested table size ("Full" or "Tiny"). The others are sent empty. /// - +#include +#include +#include +#include +#include // ROOT includes #include "TFile.h" #include "TRandom.h" #include "TSystem.h" // O2 includes -#include +#include "CCDB/BasicCCDBManager.h" #include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/ASoAHelpers.h" #include "ReconstructionDataFormats/Track.h" #include "CCDB/CcdbApi.h" #include "Common/DataModel/PIDResponse.h" #include "Common/Core/PID/TPCPIDResponse.h" #include "Framework/AnalysisDataModel.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/EventSelection.h" #include "TableHelper.h" #include "Tools/ML/model.h" #include "pidTPCBase.h" +#include "MetadataHelper.h" using namespace o2; using namespace o2::framework; @@ -45,21 +53,21 @@ using namespace o2::framework::expressions; using namespace o2::track; using namespace o2::ml; +MetadataHelper metadataInfo; // Metadata helper + void customize(std::vector& workflowOptions) { std::vector options{{"add-qa", VariantType::Int, 0, {"Legacy. No effect."}}}; std::swap(workflowOptions, options); } -#include "Framework/runDataProcessing.h" - /// Task to produce the response table struct tpcPid { using Trks = soa::Join; - using Coll = soa::Join; + using Coll = soa::Join; using TrksMC = soa::Join; - using CollMC = soa::Join; + using CollMC = soa::Join; // Tables to produce Produces tablePIDFullEl; @@ -90,8 +98,10 @@ struct tpcPid { OnnxModel network; o2::ccdb::CcdbApi ccdbApi; std::map metadata; + std::map nullmetadata; std::map headers; std::vector speciesNetworkFlags = std::vector(9); + std::string networkVersion; // Input parameters Service ccdb; @@ -187,11 +197,14 @@ struct tpcPid { speciesNetworkFlags[7] = useNetworkHe; speciesNetworkFlags[8] = useNetworkAl; - // Initialise metadata object for CCDB calls + // Initialise metadata object for CCDB calls from AO2D metadata if (recoPass.value == "") { - LOGP(info, "Reco pass not specified; CCDB will take latest available object"); + if (metadataInfo.isFullyDefined()) { + metadata["RecoPassName"] = metadataInfo.get("RecoPassName"); + LOGP(info, "Automatically setting reco pass for TPC Response to {} from AO2D", metadata["RecoPassName"]); + } } else { - LOGP(info, "CCDB object will be requested for reconstruction pass {}", recoPass.value); + LOGP(info, "Setting reco pass for TPC response to user-defined name {}", recoPass.value); metadata["RecoPassName"] = recoPass.value; } @@ -215,17 +228,23 @@ struct tpcPid { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + ccdbApi.init(url); if (time != 0) { LOGP(info, "Initialising TPC PID response for fixed timestamp {} and reco pass {}:", time, recoPass.value); ccdb->setTimestamp(time); response = ccdb->getSpecific(path, time, metadata); + headers = ccdbApi.retrieveHeaders(path, metadata, time); if (!response) { LOGF(warning, "Unable to find TPC parametrisation for specified pass name - falling back to latest object"); response = ccdb->getForTimeStamp(path, time); + headers = ccdbApi.retrieveHeaders(path, metadata, time); + networkVersion = headers["NN-Version"]; if (!response) { LOGF(fatal, "Unable to find any TPC object corresponding to timestamp {}!", time); } } + LOG(info) << "Successfully retrieved TPC PID object from CCDB for timestamp " << time << ", period " << headers["LPMProductionTag"] << ", recoPass " << headers["RecoPassName"]; + metadata["RecoPassName"] = headers["RecoPassName"]; // Force pass number for NN request to match retrieved BB response->PrintAll(); } } @@ -236,19 +255,21 @@ struct tpcPid { return; } else { /// CCDB and auto-fetching - ccdbApi.init(url); + if (!autofetchNetworks) { if (ccdbTimestamp > 0) { /// Fetching network for specific timestamp LOG(info) << "Fetching network for timestamp: " << ccdbTimestamp.value; bool retrieveSuccess = ccdbApi.retrieveBlob(networkPathCCDB.value, ".", metadata, ccdbTimestamp.value, false, networkPathLocally.value); headers = ccdbApi.retrieveHeaders(networkPathCCDB.value, metadata, ccdbTimestamp.value); + networkVersion = headers["NN-Version"]; if (retrieveSuccess) { network.initModel(networkPathLocally.value, enableNetworkOptimizations.value, networkSetNumThreads.value, strtoul(headers["Valid-From"].c_str(), NULL, 0), strtoul(headers["Valid-Until"].c_str(), NULL, 0)); std::vector dummyInput(network.getNumInputNodes(), 1.); network.evalModel(dummyInput); /// Init the model evaluations + LOGP(info, "Retrieved NN corrections for production tag {}, pass number {}, and NN-Version {}", headers["LPMProductionTag"], headers["RecoPassName"], headers["NN-Version"]); } else { - LOG(fatal) << "Error encountered while fetching/loading the network from CCDB! Maybe the network doesn't exist yet for this runnumber/timestamp?"; + LOG(fatal) << "No valid NN object found matching retrieved Bethe-Bloch parametrisation for pass " << metadata["RecoPassName"] << ". Please ensure that the requested pass has dedicated NN corrections available"; } } else { /// Taking the network from local file @@ -266,7 +287,7 @@ struct tpcPid { } } - Partition notTPCStandaloneTracks = (aod::track::tpcNClsFindable > (uint8_t)0) && ((aod::track::itsClusterSizes > (uint32_t)0) || (aod::track::trdPattern > (uint8_t)0) || (aod::track::tofExpMom > 0.f && aod::track::tofChi2 > 0.f)); // To count number of tracks for use in NN array + Partition notTPCStandaloneTracks = (aod::track::tpcNClsFindable > static_cast(0)) && ((aod::track::itsClusterSizes > static_cast(0)) || (aod::track::trdPattern > static_cast(0)) || (aod::track::tofExpMom > 0.f && aod::track::tofChi2 > 0.f)); // To count number of tracks for use in NN array Partition tracksWithTPC = (aod::track::tpcNClsFindable > (uint8_t)0); template @@ -286,13 +307,18 @@ struct tpcPid { LOGP(info, "Retrieving TPC Response for timestamp {} and recoPass {}:", bc.timestamp(), recoPass.value); } response = ccdb->getSpecific(ccdbPath.value, bc.timestamp(), metadata); + headers = ccdbApi.retrieveHeaders(ccdbPath.value, metadata, bc.timestamp()); + networkVersion = headers["NN-Version"]; if (!response) { - LOGP(warning, "!! Could not find a valid TPC response object for specific pass name {}! Falling back to latest uploaded object.", recoPass.value); + LOGP(warning, "!! Could not find a valid TPC response object for specific pass name {}! Falling back to latest uploaded object.", metadata["RecoPassName"]); + headers = ccdbApi.retrieveHeaders(ccdbPath.value, nullmetadata, bc.timestamp()); response = ccdb->getForTimeStamp(ccdbPath.value, bc.timestamp()); if (!response) { LOGP(fatal, "Could not find ANY TPC response object for the timestamp {}!", bc.timestamp()); } } + LOG(info) << "Successfully retrieved TPC PID object from CCDB for timestamp " << bc.timestamp() << ", period " << headers["LPMProductionTag"] << ", recoPass " << headers["RecoPassName"]; + metadata["RecoPassName"] = headers["RecoPassName"]; // Force pass number for NN request to match retrieved BB response->PrintAll(); } @@ -300,12 +326,14 @@ struct tpcPid { LOG(info) << "Fetching network for timestamp: " << bc.timestamp(); bool retrieveSuccess = ccdbApi.retrieveBlob(networkPathCCDB.value, ".", metadata, bc.timestamp(), false, networkPathLocally.value); headers = ccdbApi.retrieveHeaders(networkPathCCDB.value, metadata, bc.timestamp()); + networkVersion = headers["NN-Version"]; if (retrieveSuccess) { network.initModel(networkPathLocally.value, enableNetworkOptimizations.value, networkSetNumThreads.value, strtoul(headers["Valid-From"].c_str(), NULL, 0), strtoul(headers["Valid-Until"].c_str(), NULL, 0)); std::vector dummyInput(network.getNumInputNodes(), 1.); network.evalModel(dummyInput); + LOGP(info, "Retrieved NN corrections for production tag {}, pass number {}, NN-Version number{}", headers["LPMProductionTag"], headers["RecoPassName"], headers["NN-Version"]); } else { - LOG(fatal) << "Error encountered while fetching/loading the network from CCDB! Maybe the network doesn't exist yet for this runnumber/timestamp?"; + LOG(fatal) << "No valid NN object found matching retrieved Bethe-Bloch parametrisation for pass " << metadata["RecoPassName"] << ". Please ensure that the requested pass has dedicated NN corrections available"; } } } @@ -342,6 +370,9 @@ struct tpcPid { track_properties[counter_track_props + 3] = o2::track::pid_constants::sMasses[i]; track_properties[counter_track_props + 4] = trk.has_collision() ? collisions.iteratorAt(trk.collisionId()).multTPC() / 11000. : 1.; track_properties[counter_track_props + 5] = std::sqrt(nNclNormalization / trk.tpcNClsFound()); + if (input_dimensions == 7 && networkVersion == "2") { + track_properties[counter_track_props + 6] = trk.has_collision() ? collisions.iteratorAt(trk.collisionId()).ft0cOccupancyInTimeRange() / 60000. : 1.; + } counter_track_props += input_dimensions; } @@ -483,13 +514,16 @@ struct tpcPid { LOGP(info, "Retrieving TPC Response for timestamp {} and recoPass {}:", bc.timestamp(), recoPass.value); } response = ccdb->getSpecific(ccdbPath.value, bc.timestamp(), metadata); + headers = ccdbApi.retrieveHeaders(ccdbPath.value, metadata, bc.timestamp()); if (!response) { - LOGP(warning, "!! Could not find a valid TPC response object for specific pass name {}! Falling back to latest uploaded object.", recoPass.value); + LOGP(warning, "!! Could not find a valid TPC response object for specific pass name {}! Falling back to latest uploaded object.", metadata["RecoPassName"]); response = ccdb->getForTimeStamp(ccdbPath.value, bc.timestamp()); + headers = ccdbApi.retrieveHeaders(ccdbPath.value, nullmetadata, bc.timestamp()); if (!response) { LOGP(fatal, "Could not find ANY TPC response object for the timestamp {}!", bc.timestamp()); } } + LOG(info) << "Successfully retrieved TPC PID object from CCDB for timestamp " << bc.timestamp() << ", period " << headers["LPMProductionTag"] << ", recoPass " << headers["RecoPassName"]; response->PrintAll(); } @@ -515,7 +549,7 @@ struct tpcPid { PROCESS_SWITCH(tpcPid, processStandard, "Creating PID tables without MC TuneOnData", true); - Partition mcnotTPCStandaloneTracks = (aod::track::tpcNClsFindable > (uint8_t)0) && ((aod::track::itsClusterSizes > (uint32_t)0) || (aod::track::trdPattern > (uint8_t)0) || (aod::track::tofExpMom > 0.f && aod::track::tofChi2 > 0.f)); // To count number of tracks for use in NN array + Partition mcnotTPCStandaloneTracks = (aod::track::tpcNClsFindable > static_cast(0)) && ((aod::track::itsClusterSizes > static_cast(0)) || (aod::track::trdPattern > static_cast(0)) || (aod::track::tofExpMom > 0.f && aod::track::tofChi2 > 0.f)); // To count number of tracks for use in NN array Partition mctracksWithTPC = (aod::track::tpcNClsFindable > (uint8_t)0); void processMcTuneOnData(CollMC const& collisionsMc, TrksMC const& tracksMc, aod::BCsWithTimestamps const& bcs, aod::McParticles const&) @@ -573,7 +607,7 @@ struct tpcPid { } response = ccdb->getSpecific(ccdbPath.value, bc.timestamp(), metadata); if (!response) { - LOGP(warning, "!! Could not find a valid TPC response object for specific pass name {}! Falling back to latest uploaded object.", recoPass.value); + LOGP(warning, "!! Could not find a valid TPC response object for specific pass name {}! Falling back to latest uploaded object.", metadata["RecoPassName"]); response = ccdb->getForTimeStamp(ccdbPath.value, bc.timestamp()); if (!response) { LOGP(fatal, "Could not find ANY TPC response object for the timestamp {}!", bc.timestamp()); @@ -641,4 +675,8 @@ struct tpcPid { PROCESS_SWITCH(tpcPid, processMcTuneOnData, "Creating PID tables with MC TuneOnData", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + metadataInfo.initMetadata(cfgc); // Parse AO2D metadata + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} diff --git a/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx b/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx index 2b39df5bb73..5f1a85e607f 100644 --- a/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx +++ b/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx @@ -54,7 +54,7 @@ struct TreeWriterTpcV0 { Produces rowTPCTree; /// Configurables - Configurable nSigmaTOFdautrack{"nSigmaTOFdautrack", 5., "n-sigma TOF cut on the daughter tracks. Set 0 to switch it off."}; + Configurable nSigmaTOFdautrack{"nSigmaTOFdautrack", 999., "n-sigma TOF cut on the proton daughter tracks. Set 999 to switch it off."}; Configurable nClNorm{"nClNorm", 152., "Number of cluster normalization. Run 2: 159, Run 3 152"}; Configurable applyEvSel{"applyEvSel", 2, "Flag to apply rapidity cut: 0 -> no event selection, 1 -> Run 2 event selection, 2 -> Run 3 event selection"}; Configurable trackSelection{"trackSelection", 1, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"}; @@ -222,7 +222,9 @@ struct TreeWriterTpcV0 { // Lambda if (static_cast(posTrack.pidbit() & (1 << 2)) && static_cast(negTrack.pidbit() & (1 << 2))) { if (downsampleTsalisCharged(posTrack.pt(), downsamplingTsalisProtons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Proton], maxPt4dwnsmplTsalisProtons)) { - fillSkimmedV0Table(v0, posTrack, collision, posTrack.tpcNSigmaPr(), posTrack.tofNSigmaPr(), posTrack.tpcExpSignalPr(posTrack.tpcSignal()), o2::track::PID::Proton, runnumber, dwnSmplFactor_Pr, hadronicRate); + if (TMath::Abs(posTrack.tofNSigmaPr()) <= nSigmaTOFdautrack) { + fillSkimmedV0Table(v0, posTrack, collision, posTrack.tpcNSigmaPr(), posTrack.tofNSigmaPr(), posTrack.tpcExpSignalPr(posTrack.tpcSignal()), o2::track::PID::Proton, runnumber, dwnSmplFactor_Pr, hadronicRate); + } } if (downsampleTsalisCharged(negTrack.pt(), downsamplingTsalisPions, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Pion], maxPt4dwnsmplTsalisPions)) { fillSkimmedV0Table(v0, negTrack, collision, negTrack.tpcNSigmaPi(), negTrack.tofNSigmaPi(), negTrack.tpcExpSignalPi(negTrack.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi, hadronicRate); @@ -234,7 +236,9 @@ struct TreeWriterTpcV0 { fillSkimmedV0Table(v0, posTrack, collision, posTrack.tpcNSigmaPi(), posTrack.tofNSigmaPi(), posTrack.tpcExpSignalPi(posTrack.tpcSignal()), o2::track::PID::Pion, runnumber, dwnSmplFactor_Pi, hadronicRate); } if (downsampleTsalisCharged(negTrack.pt(), downsamplingTsalisProtons, sqrtSNN, o2::track::pid_constants::sMasses[o2::track::PID::Proton], maxPt4dwnsmplTsalisProtons)) { - fillSkimmedV0Table(v0, negTrack, collision, negTrack.tpcNSigmaPr(), negTrack.tofNSigmaPr(), negTrack.tpcExpSignalPr(negTrack.tpcSignal()), o2::track::PID::Proton, runnumber, dwnSmplFactor_Pr, hadronicRate); + if (TMath::Abs(negTrack.tofNSigmaPr()) <= nSigmaTOFdautrack) { + fillSkimmedV0Table(v0, negTrack, collision, negTrack.tpcNSigmaPr(), negTrack.tofNSigmaPr(), negTrack.tpcExpSignalPr(negTrack.tpcSignal()), o2::track::PID::Proton, runnumber, dwnSmplFactor_Pr, hadronicRate); + } } } } From 98cb869f60e17931a021a4e4369c5a88d0de7505 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Tue, 10 Dec 2024 14:32:14 +0100 Subject: [PATCH 308/459] [PWGEM/Dilepton] update prefilter task (#8899) --- PWGEM/Dilepton/Core/Dilepton.h | 2 +- PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 867d433a079..757c8d04a56 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -531,7 +531,7 @@ struct Dilepton { if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca}, true); - fRegistry.add("Pair/same/uls/hDeltaEtaDeltaPhi", "difference of p between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {100, -1, +1}}, true); + fRegistry.add("Pair/same/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {200, -1, +1}}, true); fRegistry.add("Pair/same/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {200, -10, 10}}, true); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index befbc7d9b40..1a129a0d70b 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -244,7 +244,7 @@ struct prefilterDielectron { // for pair fRegistry.add("Pair/before/uls/hMvsPt", "m_{ee} vs. p_{T,ee}", kTH2D, {axis_mass, axis_pair_pt}, true); fRegistry.add("Pair/before/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {axis_phiv, {200, 0, 1}}, true); - fRegistry.add("Pair/before/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {100, -1, +1}}, true); + fRegistry.add("Pair/before/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {200, -1, +1}}, true); fRegistry.add("Pair/before/uls/hGeomDeltaZRDeltaPhi", Form("difference in z-r#varphi plane between 2 tracks at r = %2.1f cm;r#Delta#varphi (cm);#Deltaz (cm);", dielectroncuts.cfg_x_to_go.value), kTH2D, {{200, -100, 100}, {200, -10, 10}}, true); fRegistry.addClone("Pair/before/uls/", "Pair/before/lspp/"); fRegistry.addClone("Pair/before/uls/", "Pair/before/lsmm/"); From e293fe4258bc34084c6289fffac98e21cd3fd8ee Mon Sep 17 00:00:00 2001 From: nzardosh Date: Tue, 10 Dec 2024 16:44:59 +0100 Subject: [PATCH 309/459] [PWGHF,PWGJE] Update B+ selector task to be similar to B+ reduced selector task and use machine learning (#8858) Co-authored-by: ALICE Action Bot --- PWGHF/Core/HfHelper.h | 39 ++- PWGHF/Core/HfMlResponseBplusToD0Pi.h | 41 +-- PWGHF/Core/HfMlResponseBplusToD0PiReduced.h | 197 +++++++++++++++ .../candidateSelectorB0ToDPiReduced.cxx | 2 +- .../candidateSelectorBplusToD0PiReduced.cxx | 6 +- .../candidateSelectorBsToDsPiReduced.cxx | 2 +- PWGHF/DataModel/DerivedTables.h | 30 ++- PWGHF/TableProducer/CMakeLists.txt | 2 +- .../candidateSelectorBplusToD0Pi.cxx | 233 ++++++++++++------ .../derivedDataCreatorBplusToD0Pi.cxx | 7 + PWGJE/Core/JetHFUtilities.h | 17 +- PWGJE/DataModel/Jet.h | 4 +- PWGJE/DataModel/JetReducedDataHF.h | 10 - PWGJE/TableProducer/derivedDataWriter.cxx | 6 +- PWGJE/Tasks/jetSubstructureBplusOutput.cxx | 2 +- 15 files changed, 448 insertions(+), 150 deletions(-) create mode 100644 PWGHF/Core/HfMlResponseBplusToD0PiReduced.h diff --git a/PWGHF/Core/HfHelper.h b/PWGHF/Core/HfHelper.h index b610c194fe9..7714fd68165 100644 --- a/PWGHF/Core/HfHelper.h +++ b/PWGHF/Core/HfHelper.h @@ -947,34 +947,59 @@ class HfHelper } /// Apply selection on ML scores for charm-hadron daughter in b-hadron decays (common for all the beauty channels) - /// \param candB b-hadron candidates /// \param cuts ML score selection per bin of charm-hadron pT /// \param binsPtC pT bin limits of charm hadron + /// \param mlScores vector with ml scores of charm hadron (position 0:bkg 1:prompt 2:nonprompt) /// \return true if b-hadron candidate passes all selections - template - bool selectionDmesMlScoresForB(const T1& candB, const T2& cuts, const T3& binsPtC) + template + bool applySelectionDmesMlScoresForB(const T1& cuts, const T2& binsPtC, float ptC, std::vector mlScores) { - auto ptC = RecoDecay::pt(candB.pxProng0(), candB.pyProng0()); // the first daughter is the charm hadron int pTBin = o2::analysis::findBin(binsPtC, ptC); if (pTBin == -1) { return false; } - if (candB.prong0MlScoreBkg() > cuts->get(pTBin, "ML score charm bkg")) { + if (mlScores[0] > cuts->get(pTBin, "ML score charm bkg")) { return false; } - if (candB.prong0MlScorePrompt() > cuts->get(pTBin, "ML score charm prompt")) { // we want non-prompt for beauty + if (mlScores[1] > cuts->get(pTBin, "ML score charm prompt")) { // we want non-prompt for beauty return false; } - if (candB.prong0MlScoreNonprompt() < cuts->get(pTBin, "ML score charm nonprompt")) { // we want non-prompt for beauty + if (mlScores[2] < cuts->get(pTBin, "ML score charm nonprompt")) { // we want non-prompt for beauty return false; } return true; } + /// Apply selection on ML scores for charm-hadron daughter in b-hadron decays (could be common for all the beauty channels) + /// \param candB b-hadron candidates + /// \param cuts ML score selection per bin of charm-hadron pT + /// \param binsPtC pT bin limits of charm hadron + /// \return true if b-hadron candidate passes all selections + template + bool selectionDmesMlScoresForB(const T1& candD, const T2& cuts, const T3& binsPtC, const std::vector& mlScores) + { + return applySelectionDmesMlScoresForB(cuts, binsPtC, candD.pt(), mlScores); + } + + /// Apply selection on ML scores for charm-hadron daughter in b-hadron decays in reduced format (common for all the beauty channels) + /// \param candB b-hadron candidates + /// \param cuts ML score selection per bin of charm-hadron pT + /// \param binsPtC pT bin limits of charm hadron + /// \return true if b-hadron candidate passes all selections + template + bool selectionDmesMlScoresForBReduced(const T1& candB, const T2& cuts, const T3& binsPtC) + { + std::vector mlScores; + mlScores.push_back(candB.prong0MlScoreBkg()); + mlScores.push_back(candB.prong0MlScorePrompt()); + mlScores.push_back(candB.prong0MlScoreNonprompt()); // we want non-prompt for beauty + return applySelectionDmesMlScoresForB(cuts, binsPtC, RecoDecay::pt(candB.pxProng0(), candB.pyProng0()), mlScores); + } + private: }; diff --git a/PWGHF/Core/HfMlResponseBplusToD0Pi.h b/PWGHF/Core/HfMlResponseBplusToD0Pi.h index 8a3b3875dae..90fb0669675 100644 --- a/PWGHF/Core/HfMlResponseBplusToD0Pi.h +++ b/PWGHF/Core/HfMlResponseBplusToD0Pi.h @@ -26,9 +26,9 @@ // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_BPLUS(FEATURE) \ - { \ -#FEATURE, static_cast < uint8_t>(InputFeaturesBplusToD0Pi::FEATURE) \ +#define FILL_MAP_BPLUS(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesBplusToD0Pi::FEATURE) \ } // Check if the index of mCachedIndices (index associated to a FEATURE) @@ -59,6 +59,17 @@ break; \ } +// where OBJECT is named candidateD , FEATURE = GETTER and INDEX is the index of the vector +#define CHECK_AND_FILL_VEC_D0_INDEX(FEATURE, GETTER1, GETTER2, INDEX) \ + case static_cast(InputFeaturesBplusToD0Pi::FEATURE): { \ + if (pdgCode == o2::constants::physics::kD0) { \ + inputFeatures.emplace_back((candidateD0.GETTER1())[INDEX]); \ + } else { \ + inputFeatures.emplace_back((candidateD0.GETTER2())[INDEX]); \ + } \ + break; \ + } + namespace o2::analysis { @@ -76,9 +87,9 @@ enum class InputFeaturesBplusToD0Pi : uint8_t { cpa, cpaXY, maxNormalisedDeltaIP, - prong0MlScoreBkg, - prong0MlScorePrompt, - prong0MlScoreNonprompt, + prong0MlProbBkg, + prong0MlProbPrompt, + prong0MlProbNonPrompt, tpcNSigmaPi1, tofNSigmaPi1, tpcTofNSigmaPi1 @@ -97,9 +108,11 @@ class HfMlResponseBplusToD0Pi : public HfMlResponse /// \param candidate is the B+ candidate /// \param prong1 is the candidate's prong1 /// \return inputFeatures vector - template + template std::vector getInputFeatures(T1 const& candidate, - T2 const& prong1) + T2 const& candidateD0, + int const& pdgCode, + T3 const& prong1) { std::vector inputFeatures; @@ -119,9 +132,9 @@ class HfMlResponseBplusToD0Pi : public HfMlResponse CHECK_AND_FILL_VEC_BPLUS(cpa); CHECK_AND_FILL_VEC_BPLUS(cpaXY); CHECK_AND_FILL_VEC_BPLUS(maxNormalisedDeltaIP); - CHECK_AND_FILL_VEC_BPLUS(prong0MlScoreBkg); - CHECK_AND_FILL_VEC_BPLUS(prong0MlScorePrompt); - CHECK_AND_FILL_VEC_BPLUS(prong0MlScoreNonprompt); + CHECK_AND_FILL_VEC_D0_INDEX(prong0MlProbBkg, mlProbD0, mlProbD0bar, 0); + CHECK_AND_FILL_VEC_D0_INDEX(prong0MlProbPrompt, mlProbD0, mlProbD0bar, 1); + CHECK_AND_FILL_VEC_D0_INDEX(prong0MlProbNonPrompt, mlProbD0, mlProbD0bar, 2); // TPC PID variable CHECK_AND_FILL_VEC_BPLUS_FULL(prong1, tpcNSigmaPi1, tpcNSigmaPi); // TOF PID variable @@ -175,9 +188,9 @@ class HfMlResponseBplusToD0Pi : public HfMlResponse FILL_MAP_BPLUS(cpa), FILL_MAP_BPLUS(cpaXY), FILL_MAP_BPLUS(maxNormalisedDeltaIP), - FILL_MAP_BPLUS(prong0MlScoreBkg), - FILL_MAP_BPLUS(prong0MlScorePrompt), - FILL_MAP_BPLUS(prong0MlScoreNonprompt), + FILL_MAP_BPLUS(prong0MlProbBkg), + FILL_MAP_BPLUS(prong0MlProbPrompt), + FILL_MAP_BPLUS(prong0MlProbNonPrompt), // TPC PID variable FILL_MAP_BPLUS(tpcNSigmaPi1), // TOF PID variable diff --git a/PWGHF/Core/HfMlResponseBplusToD0PiReduced.h b/PWGHF/Core/HfMlResponseBplusToD0PiReduced.h new file mode 100644 index 00000000000..6f56cbce245 --- /dev/null +++ b/PWGHF/Core/HfMlResponseBplusToD0PiReduced.h @@ -0,0 +1,197 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file HfMlResponseBplusToD0PiReduced.h +/// \brief Class to compute the ML response for B± → D0(bar) π± analysis selections in the reduced format +/// \author Antonio Palasciano , INFN Bari + +#ifndef PWGHF_CORE_HFMLRESPONSEBPLUSTOD0PIREDUCED_H_ +#define PWGHF_CORE_HFMLRESPONSEBPLUSTOD0PIREDUCED_H_ + +#include +#include +#include + +#include "PWGHF/Core/HfMlResponse.h" +#include "PWGHF/D2H/Utils/utilsRedDataFormat.h" + +// Fill the map of available input features +// the key is the feature's name (std::string) +// the value is the corresponding value in EnumInputFeatures +#define FILL_MAP_BPLUS(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesBplusToD0PiReduced::FEATURE) \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER from OBJECT +#define CHECK_AND_FILL_VEC_BPLUS_FULL(OBJECT, FEATURE, GETTER) \ + case static_cast(InputFeaturesBplusToD0PiReduced::FEATURE): { \ + inputFeatures.emplace_back(OBJECT.GETTER()); \ + break; \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the GETTER function taking OBJECT in argument +#define CHECK_AND_FILL_VEC_BPLUS_FUNC(OBJECT, FEATURE, GETTER) \ + case static_cast(InputFeaturesBplusToD0PiReduced::FEATURE): { \ + inputFeatures.emplace_back(GETTER(OBJECT)); \ + break; \ + } + +// Specific case of CHECK_AND_FILL_VEC_BPLUS_FULL(OBJECT, FEATURE, GETTER) +// where OBJECT is named candidate and FEATURE = GETTER +#define CHECK_AND_FILL_VEC_BPLUS(GETTER) \ + case static_cast(InputFeaturesBplusToD0PiReduced::GETTER): { \ + inputFeatures.emplace_back(candidate.GETTER()); \ + break; \ + } + +namespace o2::analysis +{ + +enum class InputFeaturesBplusToD0PiReduced : uint8_t { + ptProng0 = 0, + ptProng1, + impactParameter0, + impactParameter1, + impactParameterProduct, + chi2PCA, + decayLength, + decayLengthXY, + decayLengthNormalised, + decayLengthXYNormalised, + cpa, + cpaXY, + maxNormalisedDeltaIP, + prong0MlScoreBkg, + prong0MlScorePrompt, + prong0MlScoreNonprompt, + tpcNSigmaPi1, + tofNSigmaPi1, + tpcTofNSigmaPi1 +}; + +template +class HfMlResponseBplusToD0PiReduced : public HfMlResponse +{ + public: + /// Default constructor + HfMlResponseBplusToD0PiReduced() = default; + /// Default destructor + virtual ~HfMlResponseBplusToD0PiReduced() = default; + + /// Method to get the input features vector needed for ML inference + /// \param candidate is the B+ candidate + /// \param prong1 is the candidate's prong1 + /// \return inputFeatures vector + template + std::vector getInputFeatures(T1 const& candidate, + T2 const& prong1) + { + std::vector inputFeatures; + + for (const auto& idx : MlResponse::mCachedIndices) { + if constexpr (withDmesMl) { + switch (idx) { + CHECK_AND_FILL_VEC_BPLUS(ptProng0); + CHECK_AND_FILL_VEC_BPLUS(ptProng1); + CHECK_AND_FILL_VEC_BPLUS(impactParameter0); + CHECK_AND_FILL_VEC_BPLUS(impactParameter1); + CHECK_AND_FILL_VEC_BPLUS(impactParameterProduct); + CHECK_AND_FILL_VEC_BPLUS(chi2PCA); + CHECK_AND_FILL_VEC_BPLUS(decayLength); + CHECK_AND_FILL_VEC_BPLUS(decayLengthXY); + CHECK_AND_FILL_VEC_BPLUS(decayLengthNormalised); + CHECK_AND_FILL_VEC_BPLUS(decayLengthXYNormalised); + CHECK_AND_FILL_VEC_BPLUS(cpa); + CHECK_AND_FILL_VEC_BPLUS(cpaXY); + CHECK_AND_FILL_VEC_BPLUS(maxNormalisedDeltaIP); + CHECK_AND_FILL_VEC_BPLUS(prong0MlScoreBkg); + CHECK_AND_FILL_VEC_BPLUS(prong0MlScorePrompt); + CHECK_AND_FILL_VEC_BPLUS(prong0MlScoreNonprompt); + // TPC PID variable + CHECK_AND_FILL_VEC_BPLUS_FULL(prong1, tpcNSigmaPi1, tpcNSigmaPi); + // TOF PID variable + CHECK_AND_FILL_VEC_BPLUS_FULL(prong1, tofNSigmaPi1, tofNSigmaPi); + // Combined PID variables + CHECK_AND_FILL_VEC_BPLUS_FUNC(prong1, tpcTofNSigmaPi1, o2::pid_tpc_tof_utils::getTpcTofNSigmaPi1); + } + } else { + switch (idx) { + CHECK_AND_FILL_VEC_BPLUS(ptProng0); + CHECK_AND_FILL_VEC_BPLUS(ptProng1); + CHECK_AND_FILL_VEC_BPLUS(impactParameter0); + CHECK_AND_FILL_VEC_BPLUS(impactParameter1); + CHECK_AND_FILL_VEC_BPLUS(impactParameterProduct); + CHECK_AND_FILL_VEC_BPLUS(chi2PCA); + CHECK_AND_FILL_VEC_BPLUS(decayLength); + CHECK_AND_FILL_VEC_BPLUS(decayLengthXY); + CHECK_AND_FILL_VEC_BPLUS(decayLengthNormalised); + CHECK_AND_FILL_VEC_BPLUS(decayLengthXYNormalised); + CHECK_AND_FILL_VEC_BPLUS(cpa); + CHECK_AND_FILL_VEC_BPLUS(cpaXY); + CHECK_AND_FILL_VEC_BPLUS(maxNormalisedDeltaIP); + // TPC PID variable + CHECK_AND_FILL_VEC_BPLUS_FULL(prong1, tpcNSigmaPi1, tpcNSigmaPi); + // TOF PID variable + CHECK_AND_FILL_VEC_BPLUS_FULL(prong1, tofNSigmaPi1, tofNSigmaPi); + // Combined PID variables + CHECK_AND_FILL_VEC_BPLUS_FUNC(prong1, tpcTofNSigmaPi1, o2::pid_tpc_tof_utils::getTpcTofNSigmaPi1); + } + } + } + + return inputFeatures; + } + + protected: + /// Method to fill the map of available input features + void setAvailableInputFeatures() + { + MlResponse::mAvailableInputFeatures = { + FILL_MAP_BPLUS(ptProng0), + FILL_MAP_BPLUS(ptProng1), + FILL_MAP_BPLUS(impactParameter0), + FILL_MAP_BPLUS(impactParameter1), + FILL_MAP_BPLUS(impactParameterProduct), + FILL_MAP_BPLUS(chi2PCA), + FILL_MAP_BPLUS(decayLength), + FILL_MAP_BPLUS(decayLengthXY), + FILL_MAP_BPLUS(decayLengthNormalised), + FILL_MAP_BPLUS(decayLengthXYNormalised), + FILL_MAP_BPLUS(cpa), + FILL_MAP_BPLUS(cpaXY), + FILL_MAP_BPLUS(maxNormalisedDeltaIP), + FILL_MAP_BPLUS(prong0MlScoreBkg), + FILL_MAP_BPLUS(prong0MlScorePrompt), + FILL_MAP_BPLUS(prong0MlScoreNonprompt), + // TPC PID variable + FILL_MAP_BPLUS(tpcNSigmaPi1), + // TOF PID variable + FILL_MAP_BPLUS(tofNSigmaPi1), + // Combined PID variable + FILL_MAP_BPLUS(tpcTofNSigmaPi1)}; + } +}; + +} // namespace o2::analysis + +#undef FILL_MAP_BPLUS +#undef CHECK_AND_FILL_VEC_BPLUS_FULL +#undef CHECK_AND_FILL_VEC_BPLUS_FUNC +#undef CHECK_AND_FILL_VEC_BPLUS + +#endif // PWGHF_CORE_HFMLRESPONSEBPLUSTOD0PIREDUCED_H_ diff --git a/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx index a47f9137f7c..c5ed599c244 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorB0ToDPiReduced.cxx @@ -173,7 +173,7 @@ struct HfCandidateSelectorB0ToDPiReduced { } if constexpr (withDmesMl) { // we include it in the topological selections - if (!hfHelper.selectionDmesMlScoresForB(hfCandB0, cutsDmesMl, binsPtDmesMl)) { + if (!hfHelper.selectionDmesMlScoresForBReduced(hfCandB0, cutsDmesMl, binsPtDmesMl)) { hfSelB0ToDPiCandidate(statusB0ToDPi); if (applyB0Ml) { hfMlB0ToDPiCandidate(outputMlNotPreselected); diff --git a/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx index 9960ce06946..60649b57fdd 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorBplusToD0PiReduced.cxx @@ -23,7 +23,7 @@ #include "Common/Core/TrackSelectorPID.h" #include "PWGHF/Core/HfHelper.h" -#include "PWGHF/Core/HfMlResponseBplusToD0Pi.h" +#include "PWGHF/Core/HfMlResponseBplusToD0PiReduced.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -78,7 +78,7 @@ struct HfCandidateSelectorBplusToD0PiReduced { int mySelectionFlagD0 = -1; int mySelectionFlagD0bar = -1; - o2::analysis::HfMlResponseBplusToD0Pi hfMlResponse; + o2::analysis::HfMlResponseBplusToD0PiReduced hfMlResponse; float outputMlNotPreselected = -1.; std::vector outputMl = {}; o2::ccdb::CcdbApi ccdbApi; @@ -174,7 +174,7 @@ struct HfCandidateSelectorBplusToD0PiReduced { } if constexpr (withDmesMl) { // we include it in the topological selections - if (!hfHelper.selectionDmesMlScoresForB(hfCandBp, cutsDmesMl, binsPtDmesMl)) { + if (!hfHelper.selectionDmesMlScoresForBReduced(hfCandBp, cutsDmesMl, binsPtDmesMl)) { hfSelBplusToD0PiCandidate(statusBplus); if (applyBplusMl) { hfMlBplusToD0PiCandidate(outputMlNotPreselected); diff --git a/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx index b89272f3059..9a6c47fce58 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorBsToDsPiReduced.cxx @@ -164,7 +164,7 @@ struct HfCandidateSelectorBsToDsPiReduced { } if constexpr (withDmesMl) { // we include it in the topological selections - if (!hfHelper.selectionDmesMlScoresForB(hfCandBs, cutsDmesMl, binsPtDmesMl)) { + if (!hfHelper.selectionDmesMlScoresForBReduced(hfCandBs, cutsDmesMl, binsPtDmesMl)) { hfSelBsToDsPiCandidate(statusBsToDsPi); if (applyBsMl) { hfMlBsToDsPiCandidate(outputMl); diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 55bf8e57cc4..179695e2787 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -132,6 +132,12 @@ DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! momentum [](float pt, float eta) -> float { return RecoDecayPtEtaPhi::p(pt, eta); }); } // namespace hf_cand_base +// Candidate selection flags +namespace hf_cand_sel +{ +DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int8_t); //! bitmap of the selected candidate type +} + // Candidate MC columns namespace hf_cand_mc { @@ -193,6 +199,11 @@ DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant hf_track_index::Prong2Id, \ o2::soa::Marker); +#define DECLARE_CAND_SEL_TABLE(_hf_type_, _hf_description_) \ + DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##Sels, "HF" _hf_description_ "SEL", \ + hf_cand_sel::CandidateSelFlag, \ + o2::soa::Marker); + #define DECLARE_MCCAND_BASE_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ namespace hf_mc_particle \ { \ @@ -224,6 +235,7 @@ DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant #define DECLARE_CAND_TABLES(_hf_type_, _hf_description_, _hf_namespace_) \ DECLARE_CAND_BASE_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ + DECLARE_CAND_SEL_TABLE(_hf_type_, _hf_description_) \ DECLARE_MCCAND_BASE_TABLE(_hf_type_, _hf_description_, _hf_namespace_) \ DECLARE_MCCAND_ID_TABLE(_hf_type_, _hf_description_) @@ -391,12 +403,6 @@ DECLARE_SOA_COLUMN(NSigTpcTofPr1Charm, nSigTpcTofPr1Charm, float); DECLARE_SOA_COLUMN(NSigTpcTofPr2Charm, nSigTpcTofPr2Charm, float); } // namespace hf_cand_par_charm -// Candidate selection flags -namespace hf_cand_sel -{ -DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int8_t); //! bitmap of the selected candidate type -} - // Candidate MC columns of the charm daughter namespace hf_cand_mc_charm { @@ -467,10 +473,6 @@ DECLARE_SOA_TABLE_STAGED(HfD0ParEs, "HFD0PARE", //! Table with additional candid hf_cand_par::Ct, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(HfD0Sels, "HFD0SEL", //! Table with candidate selection flags - hf_cand_sel::CandidateSelFlag, - o2::soa::Marker); - DECLARE_SOA_TABLE_STAGED(HfD0Mls, "HFD0ML", //! Table with candidate selection ML scores hf_cand_mc::MlScores, o2::soa::Marker); @@ -543,8 +545,8 @@ DECLARE_SOA_TABLE_STAGED(HfBplusParEs, "HFBPPARE", //! Table with additional can hf_cand_par::Ct, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(HfBplusMls, "HFBPML", //! Table with candidate selection ML scores - hf_cand_mc::MlScoreSig, // why is this the signal ML score instead of the full one? +DECLARE_SOA_TABLE_STAGED(HfBplusMls, "HFBPML", //! Table with candidate selection ML scores + hf_cand_mc::MlScoreSig, o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfBplusMlD0s, "HFBPMLD0", //! Table with D0 candidate selection ML scores @@ -620,10 +622,6 @@ DECLARE_SOA_TABLE_STAGED(HfLcParEs, "HFLCPARE", //! Table with additional candid hf_cand_par::Ct, o2::soa::Marker); -DECLARE_SOA_TABLE_STAGED(HfLcSels, "HFLCSEL", //! Table with candidate selection flags - hf_cand_sel::CandidateSelFlag, - o2::soa::Marker); - DECLARE_SOA_TABLE_STAGED(HfLcMls, "HFLCML", //! Table with candidate selection ML scores hf_cand_mc::MlScores, o2::soa::Marker); diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 58f6d3280e4..f1ac9e9087a 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -109,7 +109,7 @@ o2physics_add_dpl_workflow(candidate-selector-b0-to-d-pi o2physics_add_dpl_workflow(candidate-selector-bplus-to-d0-pi SOURCES candidateSelectorBplusToD0Pi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(candidate-selector-bs-to-ds-pi diff --git a/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx b/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx index e8589833f9e..11188cbe117 100644 --- a/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/candidateSelectorBplusToD0Pi.cxx @@ -10,10 +10,14 @@ // or submit itself to any jurisdiction. /// \file candidateSelectorBplusToD0Pi.cxx -/// \brief B± → D0bar(D0) π± candidate selector +/// \brief B ± → D0bar (D0) π± candidate selector /// -/// \author Antonio Palasciano , Università degli Studi di Bari & INFN, Sezione di Bari +/// \author Antonio Palasciano , Università degli Studi di Bari /// \author Deepa Thomas , UT Austin +/// \author Nima Zardoshti , CERN + +#include +#include #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" @@ -22,6 +26,7 @@ #include "Common/Core/TrackSelectorPID.h" #include "PWGHF/Core/HfHelper.h" +#include "PWGHF/Core/HfMlResponseBplusToD0Pi.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -32,41 +37,70 @@ using namespace o2::framework; using namespace o2::analysis; struct HfCandidateSelectorBplusToD0Pi { - Produces hfSelBplusToD0PiCandidate; + Produces hfSelBplusToD0PiCandidate; // table defined in CandidateSelectionTables.h + Produces hfMlBplusToD0PiCandidate; // table defined in CandidateSelectionTables.h - // Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; - // Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; + Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; + Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; // Enable PID - Configurable usePid{"usePid", true, "Bool to use or not the PID at filtering level"}; + Configurable pionPidMethod{"pionPidMethod", 1, "PID selection method for the bachelor pion (0: none, 1: TPC or TOF, 2: TPC and TOF)"}; Configurable acceptPIDNotApplicable{"acceptPIDNotApplicable", true, "Switch to accept Status::NotApplicable [(NotApplicable for one detector) and (NotApplicable or Conditional for the other)] in PID selection"}; // TPC PID - Configurable ptPidTpcMin{"ptPidTpcMin", 999, "Lower bound of track pT for TPC PID"}; - Configurable ptPidTpcMax{"ptPidTpcMax", 9999, "Upper bound of track pT for TPC PID"}; + Configurable ptPidTpcMin{"ptPidTpcMin", 0.15, "Lower bound of track pT for TPC PID"}; + Configurable ptPidTpcMax{"ptPidTpcMax", 20., "Upper bound of track pT for TPC PID"}; Configurable nSigmaTpcMax{"nSigmaTpcMax", 5., "Nsigma cut on TPC only"}; Configurable nSigmaTpcCombinedMax{"nSigmaTpcCombinedMax", 5., "Nsigma cut on TPC combined with TOF"}; // TOF PID Configurable ptPidTofMin{"ptPidTofMin", 0.15, "Lower bound of track pT for TOF PID"}; - Configurable ptPidTofMax{"ptPidTofMax", 50., "Upper bound of track pT for TOF PID"}; + Configurable ptPidTofMax{"ptPidTofMax", 20., "Upper bound of track pT for TOF PID"}; Configurable nSigmaTofMax{"nSigmaTofMax", 5., "Nsigma cut on TOF only"}; - Configurable nSigmaTofCombinedMax{"nSigmaTofCombinedMax", 999., "Nsigma cut on TOF combined with TPC"}; + Configurable nSigmaTofCombinedMax{"nSigmaTofCombinedMax", 5., "Nsigma cut on TOF combined with TPC"}; // topological cuts Configurable> binsPt{"binsPt", std::vector{hf_cuts_bplus_to_d0_pi::vecBinsPt}, "pT bin limits"}; Configurable> cuts{"cuts", {hf_cuts_bplus_to_d0_pi::cuts[0], hf_cuts_bplus_to_d0_pi::nBinsPt, hf_cuts_bplus_to_d0_pi::nCutVars, hf_cuts_bplus_to_d0_pi::labelsPt, hf_cuts_bplus_to_d0_pi::labelsCutVar}, "B+ candidate selection per pT bin"}; + // D0-meson ML cuts + Configurable> binsPtDmesMl{"binsPtDmesMl", std::vector{hf_cuts_ml::vecBinsPt}, "D0-meson pT bin limits for ML cuts"}; + Configurable> cutsDmesMl{"cutsDmesMl", {hf_cuts_ml::cuts[0], hf_cuts_ml::nBinsPt, hf_cuts_ml::nCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsDmesCutScore}, "D0-meson ML cuts per pT bin"}; // QA switch Configurable activateQA{"activateQA", false, "Flag to enable QA histogram"}; + // B+ ML inference + Configurable applyBplusMl{"applyBplusMl", false, "Flag to apply ML selections"}; + Configurable> binsPtBpMl{"binsPtBpMl", std::vector{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"}; + Configurable> cutDirBpMl{"cutDirBpMl", std::vector{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"}; + Configurable> cutsBpMl{"cutsBpMl", {hf_cuts_ml::cuts[0], hf_cuts_ml::nBinsPt, hf_cuts_ml::nCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"}; + Configurable nClassesBpMl{"nClassesBpMl", static_cast(hf_cuts_ml::nCutScores), "Number of classes in ML model"}; + Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature1", "feature2"}, "Names of ML model input features"}; + // CCDB configuration + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable> modelPathsCCDB{"modelPathsCCDB", std::vector{"path_ccdb/BDT_BPLUS/"}, "Paths of models on CCDB"}; + Configurable> onnxFileNames{"onnxFileNames", std::vector{"ModelHandler_onnx_BPLUSToD0Pi.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; + Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - // check if selectionFlagD (defined in candidateCreatorBplus.cxx) and usePid configurables are in sync - bool selectionFlagDAndUsePidInSync = true; - TrackSelectorPi selectorPion; - HfHelper hfHelper; + o2::analysis::HfMlResponseBplusToD0Pi hfMlResponse; + float outputMlNotPreselected = -1.; + std::vector outputMl = {}; + o2::ccdb::CcdbApi ccdbApi; - using TracksPidWithSel = soa::Join; + HfHelper hfHelper; + TrackSelectorPi selectorPion; HistogramRegistry registry{"registry"}; - void init(InitContext& initContext) + using TracksPion = soa::Join; + + void init(InitContext const&) { - if (usePid) { + std::array doprocess{doprocessSelection, doprocessSelectionWithDmesMl}; + if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { + LOGP(fatal, "Only one process function for data should be enabled at a time."); + } + + if (pionPidMethod < 0 || pionPidMethod > 2) { + LOGP(fatal, "Invalid PID option in configurable, please set 0 (no PID), 1 (TPC or TOF), or 2 (TPC and TOF)"); + } + + if (pionPidMethod != 0) { selectorPion.setRangePtTpc(ptPidTpcMin, ptPidTpcMax); selectorPion.setRangeNSigmaTpc(-nSigmaTpcMax, nSigmaTpcMax); selectorPion.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedMax, nSigmaTpcCombinedMax); @@ -82,6 +116,7 @@ struct HfCandidateSelectorBplusToD0Pi { labels[1 + SelectionStep::RecoSkims] = "Skims selection"; labels[1 + SelectionStep::RecoTopol] = "Skims & Topological selections"; labels[1 + SelectionStep::RecoPID] = "Skims & Topological & PID selections"; + labels[1 + aod::SelectionStep::RecoMl] = "ML selection"; static const AxisSpec axisSelections = {kNBinsSelections, 0.5, kNBinsSelections + 0.5, ""}; registry.add("hSelections", "Selections;;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisSelections, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); for (int iBin = 0; iBin < kNBinsSelections; ++iBin) { @@ -89,104 +124,140 @@ struct HfCandidateSelectorBplusToD0Pi { } } - int selectionFlagD0 = -1; - int selectionFlagD0bar = -1; - auto& workflows = initContext.services().get(); - for (const DeviceSpec& device : workflows.devices) { - if (device.name.compare("hf-candidate-creator-bplus") == 0) { - for (const auto& option : device.options) { - if (option.name.compare("selectionFlagD0") == 0) { - selectionFlagD0 = option.defaultValue.get(); - LOGF(info, "selectionFlagD0 = %d", selectionFlagD0); - } - if (option.name.compare("selectionFlagD0bar") == 0) { - selectionFlagD0bar = option.defaultValue.get(); - LOGF(info, "selectionFlagD0bar = %d", selectionFlagD0bar); - } - } + if (applyBplusMl) { + hfMlResponse.configure(binsPtBpMl, cutsBpMl, cutDirBpMl, nClassesBpMl); + if (loadModelsFromCCDB) { + ccdbApi.init(ccdbUrl); + hfMlResponse.setModelPathsCCDB(onnxFileNames, ccdbApi, modelPathsCCDB, timestampCCDB); + } else { + hfMlResponse.setModelPathsLocal(onnxFileNames); } + hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); + hfMlResponse.init(); } - if ((usePid && !selectionFlagD0) || (usePid && !selectionFlagD0bar)) { - selectionFlagDAndUsePidInSync = false; - LOG(warning) << "PID selections required on B+ daughters (usePid=true) but no PID selections on D candidates were required a priori."; - } - if ((!usePid && selectionFlagD0) || (!usePid && selectionFlagD0bar)) { - selectionFlagDAndUsePidInSync = false; - LOG(warning) << "No PID selections required on Bp daughters (usePid=false) but PID selections on D candidates were required a priori."; - } - } - - /// Apply PID selection - /// \param pidTrackPi is the PID status of trackPi (prong1 of B+ candidate) - /// \return true if prong1 of B+ candidate passes all selections - template - bool selectionPID(const T& pidTrackPi) - { - if (!acceptPIDNotApplicable && pidTrackPi != TrackSelectorPID::Accepted) { - return false; - } - if (acceptPIDNotApplicable && pidTrackPi == TrackSelectorPID::Rejected) { - return false; - } - - return true; } - void process(aod::HfCandBplus const& hfCandBs, - soa::Join const&, - TracksPidWithSel const&) + /// Main function to perform B+ candidate creation + /// \param withDmesMl is the flag to use the table with ML scores for the D- daughter (only possible if present in the derived data) + /// \param hfCandsBp B+ candidates + /// \param pionTracks pion tracks + template + void runSelection(Cands const& hfCandsBp, + CandsDmes const& /*hfCandsD0*/, + TracksPion const& /*pionTracks*/) { - for (const auto& hfCandB : hfCandBs) { // looping over Bplus candidates - + for (const auto& hfCandBp : hfCandsBp) { int statusBplus = 0; - auto ptCandB = hfCandB.pt(); + auto ptCandBplus = hfCandBp.pt(); SETBIT(statusBplus, SelectionStep::RecoSkims); // RecoSkims = 0 --> statusBplus = 1 if (activateQA) { - registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoSkims, ptCandB); + registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoSkims, ptCandBplus); } - // D0 is always index0 and pi is index1 by default - auto trackPi = hfCandB.prong1_as(); - // topological cuts - if (!hfHelper.selectionBplusToD0PiTopol(hfCandB, cuts, binsPt)) { + if (!hfHelper.selectionBplusToD0PiTopol(hfCandBp, cuts, binsPt)) { hfSelBplusToD0PiCandidate(statusBplus); - // LOGF(debug, "B+ candidate selection failed at topology selection"); + if (applyBplusMl) { + hfMlBplusToD0PiCandidate(outputMlNotPreselected); + } + // LOGF(info, "B+ candidate selection failed at topology selection"); continue; } + + auto trackPi = hfCandBp.template prong1_as(); + auto hfCandD = hfCandBp.template prong0_as(); + + if constexpr (withDmesMl) { + std::vector mlScoresD; + if (trackPi.sign() < 0) { + std::copy(hfCandD.mlProbD0().begin(), hfCandD.mlProbD0().end(), std::back_inserter(mlScoresD)); + } else { + std::copy(hfCandD.mlProbD0bar().begin(), hfCandD.mlProbD0bar().end(), std::back_inserter(mlScoresD)); + } + + if (!hfHelper.selectionDmesMlScoresForB(hfCandD, cutsDmesMl, binsPtDmesMl, mlScoresD)) { + hfSelBplusToD0PiCandidate(statusBplus); + if (applyBplusMl) { + hfMlBplusToD0PiCandidate(outputMlNotPreselected); + } + // LOGF(info, "B+ candidate selection failed at D0-meson ML selection"); + continue; + } + } + SETBIT(statusBplus, SelectionStep::RecoTopol); // RecoTopol = 1 --> statusBplus = 3 if (activateQA) { - registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoTopol, ptCandB); + registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoTopol, ptCandBplus); } - // checking if selectionFlagD0(D0bar) and usePid are in sync - if (!selectionFlagDAndUsePidInSync) { - hfSelBplusToD0PiCandidate(statusBplus); - continue; - } // track-level PID selection - if (usePid) { - int pidTrackPi = selectorPion.statusTpcAndTof(trackPi); - if (!selectionPID(pidTrackPi)) { // FIXME use helper function + if (pionPidMethod) { + int pidTrackPi{TrackSelectorPID::Status::NotApplicable}; + if (pionPidMethod == 1) { + pidTrackPi = selectorPion.statusTpcOrTof(trackPi); + } else { + pidTrackPi = selectorPion.statusTpcAndTof(trackPi); + } + if (!hfHelper.selectionBplusToD0PiPid(pidTrackPi, acceptPIDNotApplicable.value)) { + // LOGF(info, "B+ candidate selection failed at PID selection"); hfSelBplusToD0PiCandidate(statusBplus); + if (applyBplusMl) { + hfMlBplusToD0PiCandidate(outputMlNotPreselected); + } continue; } SETBIT(statusBplus, SelectionStep::RecoPID); // RecoPID = 2 --> statusBplus = 7 if (activateQA) { - registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoPID, ptCandB); + registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoPID, ptCandBplus); + } + } + if (applyBplusMl) { + // B+ ML selections + int pdgCode = o2::constants::physics::kD0; + if (trackPi.sign() > 0) { + pdgCode = -1 * pdgCode; + } + std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandBp, hfCandD, pdgCode, trackPi); + bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandBplus, outputMl); + hfMlBplusToD0PiCandidate(outputMl[1]); // storing ML score for signal class + + if (!isSelectedMl) { + hfSelBplusToD0PiCandidate(statusBplus); + continue; + } + SETBIT(statusBplus, SelectionStep::RecoMl); // RecoML = 3 --> statusBplus = 15 if pionPidMethod, 11 otherwise + if (activateQA) { + registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoMl, ptCandBplus); } } hfSelBplusToD0PiCandidate(statusBplus); - // LOGF(info, "Successful B+ candidate selection"); + // LOGF(info, "B+ candidate selection passed all selections"); } } + + void processSelection(HfCandBplus const& hfCandsBp, + aod::HfCand2ProngWPid const& hfCandsD0, + TracksPion const& pionTracks) + { + runSelection(hfCandsBp, hfCandsD0, pionTracks); + } // processSelection + + PROCESS_SWITCH(HfCandidateSelectorBplusToD0Pi, processSelection, "Process selection without ML scores of D mesons", true); + + void processSelectionWithDmesMl(HfCandBplus const& hfCandsBp, + soa::Join const& hfCandsD0, + TracksPion const& pionTracks) + { + runSelection(hfCandsBp, hfCandsD0, pionTracks); + } // processSelectionWithDmesMl + + PROCESS_SWITCH(HfCandidateSelectorBplusToD0Pi, processSelectionWithDmesMl, "Process selection with ML scores of D mesons", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx index c2e424c460c..894acd0a3f9 100644 --- a/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorBplusToD0Pi.cxx @@ -49,6 +49,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { Produces rowCandidatePar; Produces rowCandidateParD0; Produces rowCandidateParE; + Produces rowCandidateSel; Produces rowCandidateMl; Produces rowCandidateMlD0; Produces rowCandidateId; @@ -69,6 +70,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { Configurable fillCandidatePar{"fillCandidatePar", true, "Fill candidate parameters"}; Configurable fillCandidateParD0{"fillCandidateParD0", true, "Fill D0 candidate parameters"}; Configurable fillCandidateParE{"fillCandidateParE", true, "Fill candidate extended parameters"}; + Configurable fillCandidateSel{"fillCandidateSel", true, "Fill candidate selection flags"}; Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateMlD0{"fillCandidateMlD0", true, "Fill D0 candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; @@ -266,6 +268,10 @@ struct HfDerivedDataCreatorBplusToD0Pi { hfHelper.cosThetaStarBplus(candidate), ct); } + if (fillCandidateSel) { + rowCandidateSel( + BIT(candFlag)); + } if (fillCandidateMl) { rowCandidateMl( mlScore); @@ -348,6 +354,7 @@ struct HfDerivedDataCreatorBplusToD0Pi { reserveTable(rowCandidatePar, fillCandidatePar, sizeTableCand); reserveTable(rowCandidateParD0, fillCandidateParD0, sizeTableCand); reserveTable(rowCandidateParE, fillCandidateParE, sizeTableCand); + reserveTable(rowCandidateSel, fillCandidateSel, sizeTableCand); reserveTable(rowCandidateMl, fillCandidateMl, sizeTableCand); reserveTable(rowCandidateMlD0, fillCandidateMlD0, sizeTableCand); reserveTable(rowCandidateId, fillCandidateId, sizeTableCand); diff --git a/PWGJE/Core/JetHFUtilities.h b/PWGJE/Core/JetHFUtilities.h index 00d88d728a0..1334d8ad6f6 100644 --- a/PWGJE/Core/JetHFUtilities.h +++ b/PWGJE/Core/JetHFUtilities.h @@ -494,8 +494,8 @@ void fillHFMcCollisionTable(T const& mcCollision, U& HFMcCollisionTable, int32_t HFMcCollisionTableIndex = HFMcCollisionTable.lastIndex(); } -template -void fillD0CandidateTable(T const& candidate, U& D0ParTable, V& D0ParETable, M& D0SelectionFlagTable, N& D0MlTable, O& D0MCDTable) +template +void fillD0CandidateTable(T const& candidate, U& D0ParTable, V& D0ParETable, M& D0MlTable, N& D0MCDTable) { D0ParTable( candidate.chi2PCA(), @@ -547,8 +547,6 @@ void fillD0CandidateTable(T const& candidate, U& D0ParTable, V& D0ParETable, M& candidate.cosThetaStar(), candidate.ct()); - D0SelectionFlagTable(candidate.candidateSelFlag()); - std::vector mlScoresVector; auto mlScoresSpan = candidate.mlScores(); std::copy(mlScoresSpan.begin(), mlScoresSpan.end(), std::back_inserter(mlScoresVector)); @@ -559,8 +557,8 @@ void fillD0CandidateTable(T const& candidate, U& D0ParTable, V& D0ParETable, M& } } -template -void fillLcCandidateTable(T const& candidate, U& LcParTable, V& LcParETable, M& LcSelectionFlagTable, N& LcMlTable, O& LcMCDTable) +template +void fillLcCandidateTable(T const& candidate, U& LcParTable, V& LcParETable, M& LcMlTable, N& LcMCDTable) { LcParTable( @@ -621,8 +619,6 @@ void fillLcCandidateTable(T const& candidate, U& LcParTable, V& LcParETable, M& candidate.errorImpactParameter2(), candidate.ct()); - LcSelectionFlagTable(candidate.candidateSelFlag()); - std::vector mlScoresVector; auto mlScoresSpan = candidate.mlScores(); std::copy(mlScoresSpan.begin(), mlScoresSpan.end(), std::back_inserter(mlScoresVector)); @@ -714,12 +710,13 @@ void fillHFCandidateTable(T const& candidate, int32_t collisionIndex, U& HFBaseT { HFBaseTable(collisionIndex, candidate.pt(), candidate.eta(), candidate.phi(), candidate.m(), candidate.y()); HFCandidateTableIndex = HFBaseTable.lastIndex(); + HFSelectionFlagTable(candidate.candidateSelFlag()); if constexpr (isD0Candidate()) { - fillD0CandidateTable(candidate, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable); + fillD0CandidateTable(candidate, HFParTable, HFParETable, HFMlTable, HFMCDTable); } if constexpr (isLcCandidate()) { - fillLcCandidateTable(candidate, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable); + fillLcCandidateTable(candidate, HFParTable, HFParETable, HFMlTable, HFMCDTable); } if constexpr (isBplusCandidate()) { fillBplusCandidateTable(candidate, HFParTable, HFParETable, HFParDaughterTable, HFMlTable, HFMlDaughterTable, HFMCDTable); diff --git a/PWGJE/DataModel/Jet.h b/PWGJE/DataModel/Jet.h index 423240fe799..34b8359981f 100644 --- a/PWGJE/DataModel/Jet.h +++ b/PWGJE/DataModel/Jet.h @@ -228,8 +228,8 @@ using McCollisionsLc = o2::soa::Join; using CandidatesLcMCP = o2::soa::Join; using CollisionsBplus = o2::soa::Join; -using CandidatesBplusData = o2::soa::Join; -using CandidatesBplusMCD = o2::soa::Join; +using CandidatesBplusData = o2::soa::Join; +using CandidatesBplusMCD = o2::soa::Join; using JetTracksSubBplus = JTrackBplusSubs; using JetParticlesSubBplus = JMcParticleBplusSubs; using McCollisionsBplus = o2::soa::Join; diff --git a/PWGJE/DataModel/JetReducedDataHF.h b/PWGJE/DataModel/JetReducedDataHF.h index c00a89e029e..855746326a2 100644 --- a/PWGJE/DataModel/JetReducedDataHF.h +++ b/PWGJE/DataModel/JetReducedDataHF.h @@ -129,16 +129,6 @@ DECLARE_SOA_TABLE_STAGED(JBplusPIds, "JBPPID", jbplusindices::JMcCollisionId, jbplusindices::JMcParticleId); -namespace jdummybplus -{ - -DECLARE_SOA_COLUMN(DummyBplus, dummyBplus, bool); - -} // namespace jdummybplus -DECLARE_SOA_TABLE(JDumBplusSels, "AOD", "JDUMBPUSSEL", - jdummybplus::DummyBplus, - o2::soa::Marker<1>); - } // namespace o2::aod #endif // PWGJE_DATAMODEL_JETREDUCEDDATAHF_H_ diff --git a/PWGJE/TableProducer/derivedDataWriter.cxx b/PWGJE/TableProducer/derivedDataWriter.cxx index d82f8d58b45..fb70c198fbf 100644 --- a/PWGJE/TableProducer/derivedDataWriter.cxx +++ b/PWGJE/TableProducer/derivedDataWriter.cxx @@ -141,7 +141,7 @@ struct JetDerivedDataWriter { Produces storedBplusParsTable; Produces storedBplusParExtrasTable; Produces storedBplusParD0sTable; - Produces storedBplusSelsDummyTable; + Produces storedBplusSelsTable; Produces storedBplusMlsTable; Produces storedBplusMlD0sTable; Produces storedBplusMcsTable; @@ -525,7 +525,7 @@ struct JetDerivedDataWriter { } for (const auto& Bplus : Bpluss) { int32_t BplusIndex = -1; - jethfutilities::fillHFCandidateTable(Bplus, collisionBplusIndex, products.storedBplussTable, products.storedBplusParsTable, products.storedBplusParExtrasTable, products.storedBplusParD0sTable, products.storedBplusSelsDummyTable, products.storedBplusMlsTable, products.storedBplusMlD0sTable, products.storedBplusMcsTable, BplusIndex); + jethfutilities::fillHFCandidateTable(Bplus, collisionBplusIndex, products.storedBplussTable, products.storedBplusParsTable, products.storedBplusParExtrasTable, products.storedBplusParD0sTable, products.storedBplusSelsTable, products.storedBplusMlsTable, products.storedBplusMlD0sTable, products.storedBplusMcsTable, BplusIndex); int32_t prong0Id = -1; int32_t prong1Id = -1; @@ -904,7 +904,7 @@ struct JetDerivedDataWriter { const auto lcsPerCollision = Bpluss.sliceBy(BplussPerCollision, collision.globalIndex()); for (const auto& Bplus : lcsPerCollision) { int32_t BplusIndex = -1; - jethfutilities::fillHFCandidateTable(Bplus, collisionBplusIndex, products.storedBplussTable, products.storedBplusParsTable, products.storedBplusParExtrasTable, products.storedBplusParD0sTable, products.storedBplusSelsDummyTable, products.storedBplusMlsTable, products.storedBplusMlD0sTable, products.storedBplusMcsTable, BplusIndex); + jethfutilities::fillHFCandidateTable(Bplus, collisionBplusIndex, products.storedBplussTable, products.storedBplusParsTable, products.storedBplusParExtrasTable, products.storedBplusParD0sTable, products.storedBplusSelsTable, products.storedBplusMlsTable, products.storedBplusMlD0sTable, products.storedBplusMcsTable, BplusIndex); int32_t prong0Id = -1; int32_t prong1Id = -1; diff --git a/PWGJE/Tasks/jetSubstructureBplusOutput.cxx b/PWGJE/Tasks/jetSubstructureBplusOutput.cxx index 89c0b94560f..e81e12566fa 100644 --- a/PWGJE/Tasks/jetSubstructureBplusOutput.cxx +++ b/PWGJE/Tasks/jetSubstructureBplusOutput.cxx @@ -15,7 +15,7 @@ #include "PWGJE/Tasks/jetSubstructureHFOutput.cxx" -using JetSubstructureOutputBplus = JetSubstructureHFOutputTask, aod::CandidatesBplusData, aod::CandidatesBplusMCD, aod::CandidatesBplusMCP, aod::JTrackBplusSubs, soa::Join, soa::Join, aod::BplusCJetCOs, aod::BplusCJetOs, aod::BplusCJetSSOs, aod::BplusCJetMOs, soa::Join, aod::BplusCMCDJetCOs, aod::BplusCMCDJetOs, aod::BplusCMCDJetSSOs, aod::BplusCMCDJetMOs, soa::Join, aod::BplusCMCPJetCOs, aod::BplusCMCPJetOs, aod::BplusCMCPJetSSOs, aod::BplusCMCPJetMOs, soa::Join, aod::BplusCEWSJetCOs, aod::BplusCEWSJetOs, aod::BplusCEWSJetSSOs, aod::BplusCEWSJetMOs, aod::StoredHfBplusCollBase, aod::StoredHfBplusBases, aod::StoredHfBplusPars, aod::StoredHfBplusParEs, aod::StoredHfBplusParD0s, aod::JDumBplusSels, aod::StoredHfBplusMls, aod::StoredHfBplusMlD0s, aod::StoredHfBplusMcs, aod::StoredHfBplusMcCollBases, aod::StoredHfBplusMcRCollIds, aod::StoredHfBplusPBases>; // all the 3P tables have been made into Bplus but they might be made common +using JetSubstructureOutputBplus = JetSubstructureHFOutputTask, aod::CandidatesBplusData, aod::CandidatesBplusMCD, aod::CandidatesBplusMCP, aod::JTrackBplusSubs, soa::Join, soa::Join, aod::BplusCJetCOs, aod::BplusCJetOs, aod::BplusCJetSSOs, aod::BplusCJetMOs, soa::Join, aod::BplusCMCDJetCOs, aod::BplusCMCDJetOs, aod::BplusCMCDJetSSOs, aod::BplusCMCDJetMOs, soa::Join, aod::BplusCMCPJetCOs, aod::BplusCMCPJetOs, aod::BplusCMCPJetSSOs, aod::BplusCMCPJetMOs, soa::Join, aod::BplusCEWSJetCOs, aod::BplusCEWSJetOs, aod::BplusCEWSJetSSOs, aod::BplusCEWSJetMOs, aod::StoredHfBplusCollBase, aod::StoredHfBplusBases, aod::StoredHfBplusPars, aod::StoredHfBplusParEs, aod::StoredHfBplusParD0s, aod::StoredHfBplusSels, aod::StoredHfBplusMls, aod::StoredHfBplusMlD0s, aod::StoredHfBplusMcs, aod::StoredHfBplusMcCollBases, aod::StoredHfBplusMcRCollIds, aod::StoredHfBplusPBases>; // all the 3P tables have been made into Bplus but they might be made common WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { From 5d8607df8665c39f97f894b45ced40d7a2a1c0ba Mon Sep 17 00:00:00 2001 From: Rik Spijkers <78484875+rspijkers@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:22:58 +0100 Subject: [PATCH 310/459] [PWGLF] move ME definition & add dedicated ME autocorrelation QA in cascade correlations (#8905) Co-authored-by: ALICE Builder --- .../Tasks/Strangeness/cascadecorrelations.cxx | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx b/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx index 4c8531213bb..4209688498d 100644 --- a/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx +++ b/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx @@ -426,6 +426,8 @@ struct CascadeCorrelations { {"MixedEvents/hMEDeltaPhiSS", "hMEDeltaPhiSS", {HistType::kTH1F, {deltaPhiAxis}}}, {"MixedEvents/hMEDeltaPhiOS", "hMEDeltaPhiOS", {HistType::kTH1F, {deltaPhiAxis}}}, {"MixedEvents/hMEQA", "hMEQA", {HistType::kTH1I, {{2, 0, 2, "QA for exceptions in ME (this histogram should have 0 entries!)"}}}}, + {"MixedEvents/hMEAutoCorrelation", "hMEAutoCorrelation", {HistType::kTH1I, {{4, -0.5f, 3.5f, "Types of SS autocorrelation"}}}}, + {"MixedEvents/hMEAutoCorrelationOS", "hMEAutoCorrelationOS", {HistType::kTH1I, {{2, -1.f, 1.f, "Charge of OS autocorrelated track"}}}}, {"MixedEvents/hMEXiXiOS", "hMEXiXiOS", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, {"MixedEvents/hMEXiXiSS", "hMEXiXiSS", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, @@ -441,9 +443,15 @@ struct CascadeCorrelations { // cascade filter Filter cascadeSelector = aod::cascadeflags::isSelected > 0; + // Warning: it is not possible to use this axis as configurable due to a bug - however, default values are sensible. SliceCache cache; ConfigurableAxis axisVtxZ{"axisVtxZ", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; // ConfigurableAxis axisMult{"axisMult", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 100, 1000}, "Mixing bins - multiplicity"}; + // using BinningType = ColumnBinningPolicy>; + // BinningType colBinning{{axisVtxZ, axisMult}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. + using BinningType = ColumnBinningPolicy; + BinningType colBinning{{axisVtxZ}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. + SameKindPair pair{colBinning, nMixedEvents, -1, &cache}; void processSameEvent(MyCollisionsMult::iterator const& collision, MyCascades const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIU const&, aod::BCsWithTimestamps const&) { @@ -662,13 +670,6 @@ struct CascadeCorrelations { void processMixedEvent(MyCollisionsMult const& /*collisions*/, MyCascades const& /*Cascades*/, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIU const&) { - // mixed events - // using BinningType = ColumnBinningPolicy>; - // BinningType colBinning{{axisVtxZ, axisMult}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. - using BinningType = ColumnBinningPolicy; - BinningType colBinning{{axisVtxZ}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. - SameKindPair pair{colBinning, nMixedEvents, -1, &cache}; - for (auto const& [col1, cascades1, col2, cascades2] : pair) { if (!col1.sel8() || !col2.sel8()) continue; @@ -719,24 +720,24 @@ struct CascadeCorrelations { if (trigger.isSelected() >= 2) { if (trigger.sign() > 0 && trigger.bachelorId() == posIdAssoc) { // K+ from trigger Omega is the same as proton from assoc lambda - registry.fill(HIST("hAutoCorrelationOS"), 1); + registry.fill(HIST("hMEAutoCorrelationOS"), 1); continue; } if (trigger.sign() < 0 && trigger.bachelorId() == negIdAssoc) { // K- from trigger Omega is the same as antiproton from assoc antilambda - registry.fill(HIST("hAutoCorrelationOS"), -1); + registry.fill(HIST("hMEAutoCorrelationOS"), -1); continue; } } if (assoc.isSelected() >= 2) { if (assoc.sign() > 0 && assoc.bachelorId() == posIdTrigg) { // K+ from assoc Omega is the same as proton from trigger lambda - registry.fill(HIST("hAutoCorrelationOS"), 1); + registry.fill(HIST("hMEAutoCorrelationOS"), 1); continue; } if (assoc.sign() < 0 && assoc.bachelorId() == negIdTrigg) { // K- from assoc Omega is the same as antiproton from trigger antilambda - registry.fill(HIST("hAutoCorrelationOS"), -1); + registry.fill(HIST("hMEAutoCorrelationOS"), -1); continue; } } @@ -776,7 +777,7 @@ struct CascadeCorrelations { // make sure to check for autocorrelations - only possible in same-sign correlations (if PID is correct) if (posIdTrigg == posIdAssoc && negIdTrigg == negIdAssoc) { // LOGF(info, "same v0 in SS correlation! %d %d", v0dataTrigg.v0Id(), v0dataAssoc.v0Id()); - registry.fill(HIST("hAutoCorrelation"), 0); + registry.fill(HIST("hMEAutoCorrelation"), 0); continue; } int bachIdTrigg = trigger.bachelorId(); @@ -784,25 +785,25 @@ struct CascadeCorrelations { if (bachIdTrigg == bachIdAssoc) { // LOGF(info, "same bachelor in SS correlation! %d %d", bachIdTrigg, bachIdAssoc); - registry.fill(HIST("hAutoCorrelation"), 1); + registry.fill(HIST("hMEAutoCorrelation"), 1); continue; } // check for same tracks in v0's of cascades if (negIdTrigg == negIdAssoc || posIdTrigg == posIdAssoc) { // LOGF(info, "cascades have a v0-track in common in SS correlation!"); - registry.fill(HIST("hAutoCorrelation"), 2); + registry.fill(HIST("hMEAutoCorrelation"), 2); continue; } if (trigger.sign() < 0) { // neg cascade if (negIdTrigg == bachIdAssoc || negIdAssoc == bachIdTrigg) { // LOGF(info, "bach of casc == v0-pion of other casc in neg SS correlation!"); - registry.fill(HIST("hAutoCorrelation"), 3); + registry.fill(HIST("hMEAutoCorrelation"), 3); continue; } } else { // pos cascade if (posIdTrigg == bachIdAssoc || posIdAssoc == bachIdTrigg) { // LOGF(info, "bach of casc == v0-pion of other casc in pos SS correlation!"); - registry.fill(HIST("hAutoCorrelation"), 3); + registry.fill(HIST("hMEAutoCorrelation"), 3); continue; } } @@ -840,7 +841,7 @@ struct CascadeCorrelations { } // same sign } // correlations } // collisions - } // process mixed events + } // process mixed events PROCESS_SWITCH(CascadeCorrelations, processSameEvent, "Process same events", true); PROCESS_SWITCH(CascadeCorrelations, processMixedEvent, "Process mixed events", true); From 1041165faef6256bbeadc9663665cb1461f21e5a Mon Sep 17 00:00:00 2001 From: shaidlov <109801990+Edingrast@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:11:07 +0100 Subject: [PATCH 311/459] [PWGUD] personal task modification (#8907) --- PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx | 159 ++++++++++++++++++----- 1 file changed, 125 insertions(+), 34 deletions(-) diff --git a/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx b/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx index cf84e91414a..81eb002a13a 100644 --- a/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx +++ b/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx @@ -786,18 +786,39 @@ struct UpcJpsiCentralBarrel { // MC histograms MC.add("MC/hNumberOfMCCollisions", "hNumberOfCollisions", {HistType::kTH1F, {{10, 0, 10}}}); - MC.add("MC/hNumberOfMCTracks", "hNumberOfMCTracks", {HistType::kTH1F, {{10, 0, 10}}}); + MC.add("MC/hNumberOfRecoCollisions", "hNumberOfRecoCollisions", {HistType::kTH1F, {{10, 0, 10}}}); + MC.add("MC/Muon/hNumberOfMCTracks", "hNumberOfMCTracks", {HistType::kTH1F, {{10, 0, 10}}}); + MC.add("MC/Electron/hNumberOfMCTracks", "hNumberOfMCTracks", {HistType::kTH1F, {{10, 0, 10}}}); + MC.add("MC/Proton/hNumberOfMCTracks", "hNumberOfMCTracks", {HistType::kTH1F, {{10, 0, 10}}}); MC.add("MC/hPosZ", "hPosZ", {HistType::kTH1F, {{60, -15, 15}}}); - MC.add("MC/hPDG", "hPDG", {HistType::kTH1F, {{900, -450, 450}}}); - MC.add("MC/hEta1", "hEta1", {HistType::kTH1F, {axisEta}}); - MC.add("MC/hEta2", "hEta2", {HistType::kTH1F, {axisEta}}); - MC.add("MC/hPhi1", "hPhi1", {HistType::kTH1F, {axisPhi}}); - MC.add("MC/hPhi2", "hPhi2", {HistType::kTH1F, {axisPhi}}); - MC.add("MC/hIVM", "hIVM", {HistType::kTH1F, {axisIVM}}); - MC.add("MC/hRapidity", "hRapidity", {HistType::kTH1F, {axisEta}}); - MC.add("MC/hPt1", "hPt1", {HistType::kTH1F, {axisPt}}); - MC.add("MC/hPt2", "hPt2", {HistType::kTH1F, {axisPt}}); - MC.add("MC/hPt", "hPt", {HistType::kTH1F, {axisPt}}); + MC.add("MC/hPDG", "hPDG", {HistType::kTH1F, {{200000, -100000, 100000}}}); + MC.add("MC/Electron/hEta1", "hEta1", {HistType::kTH1F, {axisEta}}); + MC.add("MC/Electron/hEta2", "hEta2", {HistType::kTH1F, {axisEta}}); + MC.add("MC/Electron/hPhi1", "hPhi1", {HistType::kTH1F, {axisPhi}}); + MC.add("MC/Electron/hPhi2", "hPhi2", {HistType::kTH1F, {axisPhi}}); + MC.add("MC/Electron/hIVM", "hIVM", {HistType::kTH1F, {axisIVM}}); + MC.add("MC/Electron/hRapidity", "hRapidity", {HistType::kTH1F, {axisEta}}); + MC.add("MC/Electron/hPt1", "hPt1", {HistType::kTH1F, {axisPt}}); + MC.add("MC/Electron/hPt2", "hPt2", {HistType::kTH1F, {axisPt}}); + MC.add("MC/Electron/hPt", "hPt", {HistType::kTH1F, {axisPt}}); + MC.add("MC/Muon/hEta1", "hEta1", {HistType::kTH1F, {axisEta}}); + MC.add("MC/Muon/hEta2", "hEta2", {HistType::kTH1F, {axisEta}}); + MC.add("MC/Muon/hPhi1", "hPhi1", {HistType::kTH1F, {axisPhi}}); + MC.add("MC/Muon/hPhi2", "hPhi2", {HistType::kTH1F, {axisPhi}}); + MC.add("MC/Muon/hIVM", "hIVM", {HistType::kTH1F, {axisIVM}}); + MC.add("MC/Muon/hRapidity", "hRapidity", {HistType::kTH1F, {axisEta}}); + MC.add("MC/Muon/hPt1", "hPt1", {HistType::kTH1F, {axisPt}}); + MC.add("MC/Muon/hPt2", "hPt2", {HistType::kTH1F, {axisPt}}); + MC.add("MC/Muon/hPt", "hPt", {HistType::kTH1F, {axisPt}}); + MC.add("MC/Proton/hEta1", "hEta1", {HistType::kTH1F, {axisEta}}); + MC.add("MC/Proton/hEta2", "hEta2", {HistType::kTH1F, {axisEta}}); + MC.add("MC/Proton/hPhi1", "hPhi1", {HistType::kTH1F, {axisPhi}}); + MC.add("MC/Proton/hPhi2", "hPhi2", {HistType::kTH1F, {axisPhi}}); + MC.add("MC/Proton/hIVM", "hIVM", {HistType::kTH1F, {axisIVM}}); + MC.add("MC/Proton/hRapidity", "hRapidity", {HistType::kTH1F, {axisEta}}); + MC.add("MC/Proton/hPt1", "hPt1", {HistType::kTH1F, {axisPt}}); + MC.add("MC/Proton/hPt2", "hPt2", {HistType::kTH1F, {axisPt}}); + MC.add("MC/Proton/hPt", "hPt", {HistType::kTH1F, {axisPt}}); } bool cutITSLayers(uint8_t itsClusterMap) const @@ -1227,7 +1248,8 @@ struct UpcJpsiCentralBarrel { } else if (OnOn) { JPsiToEl.get(HIST("JPsiToEl/NotCoherent/OnOn/hIVM"))->Fill(massJpsi); } - } else { + } + if (RecoDecay::pt(mother) > 0.2f) { JPsiToEl.get(HIST("JPsiToEl/Incoherent/hIVM"))->Fill(massJpsi); if (XnXn) { JPsiToEl.get(HIST("JPsiToEl/Incoherent/XnXn/hIVM"))->Fill(massJpsi); @@ -1631,7 +1653,8 @@ struct UpcJpsiCentralBarrel { } else if (OnOn) { JPsiToMu.get(HIST("JPsiToMu/NotCoherent/OnOn/hIVM"))->Fill(massJpsi); } - } else { + } + if (RecoDecay::pt(mother) > 0.2f) { JPsiToMu.get(HIST("JPsiToMu/Incoherent/hIVM"))->Fill(massJpsi); if (XnXn) { JPsiToMu.get(HIST("JPsiToMu/Incoherent/XnXn/hIVM"))->Fill(massJpsi); @@ -2083,44 +2106,106 @@ struct UpcJpsiCentralBarrel { MC.get(HIST("MC/hNumberOfMCCollisions"))->Fill(1.); MC.get(HIST("MC/hPosZ"))->Fill(mcCollision.posZ()); - std::array daughPart1; - std::array daughPart2; + std::array daughPart1Mu; + std::array daughPart2Mu; + std::array daughPart1El; + std::array daughPart2El; + std::array daughPart1Pr; + std::array daughPart2Pr; // fill number of particles for (auto const& mcParticle : mcParticles) { - MC.get(HIST("MC/hNumberOfMCTracks"))->Fill(1.); + MC.get(HIST("MC/Muon/hNumberOfMCTracks"))->Fill(1.); + MC.get(HIST("MC/Electron/hNumberOfMCTracks"))->Fill(1.); + MC.get(HIST("MC/Proton/hNumberOfMCTracks"))->Fill(1.); MC.get(HIST("MC/hPDG"))->Fill(mcParticle.pdgCode()); // check if only muons and physical primaries are present if ((mcParticle.pdgCode() == 13) && mcParticle.isPhysicalPrimary()) { - daughPart1 = {mcParticle.px(), mcParticle.py(), mcParticle.pz()}; + daughPart1Mu = {mcParticle.px(), mcParticle.py(), mcParticle.pz()}; - MC.get(HIST("MC/hNumberOfMCTracks"))->Fill(2.); + MC.get(HIST("MC/Muon/hNumberOfMCTracks"))->Fill(2.); } if ((mcParticle.pdgCode() == -13) && mcParticle.isPhysicalPrimary()) { - daughPart2 = {mcParticle.px(), mcParticle.py(), mcParticle.pz()}; + daughPart2Mu = {mcParticle.px(), mcParticle.py(), mcParticle.pz()}; + + MC.get(HIST("MC/Muon/hNumberOfMCTracks"))->Fill(3.); + } + if ((mcParticle.pdgCode() == 11) && mcParticle.isPhysicalPrimary()) { + daughPart1El = {mcParticle.px(), mcParticle.py(), mcParticle.pz()}; + + MC.get(HIST("MC/Electron/hNumberOfMCTracks"))->Fill(2.); + } + if ((mcParticle.pdgCode() == -11) && mcParticle.isPhysicalPrimary()) { + daughPart2El = {mcParticle.px(), mcParticle.py(), mcParticle.pz()}; + + MC.get(HIST("MC/Electron/hNumberOfMCTracks"))->Fill(3.); + } + if ((mcParticle.pdgCode() == 2212) && mcParticle.isPhysicalPrimary()) { + daughPart1Pr = {mcParticle.px(), mcParticle.py(), mcParticle.pz()}; - MC.get(HIST("MC/hNumberOfMCTracks"))->Fill(3.); + MC.get(HIST("MC/Proton/hNumberOfMCTracks"))->Fill(2.); + } + if ((mcParticle.pdgCode() == -2212) && mcParticle.isPhysicalPrimary()) { + daughPart2Pr = {mcParticle.px(), mcParticle.py(), mcParticle.pz()}; + + MC.get(HIST("MC/Proton/hNumberOfMCTracks"))->Fill(3.); } } // calculate J/psi system and needed distributions - std::array motherPart = {daughPart1[0] + daughPart2[0], daughPart1[1] + daughPart2[1], daughPart1[2] + daughPart2[2]}; + std::array motherPartMu = {daughPart1Mu[0] + daughPart2Mu[0], daughPart1Mu[1] + daughPart2Mu[1], daughPart1Mu[2] + daughPart2Mu[2]}; + std::array motherPartEl = {daughPart1El[0] + daughPart2El[0], daughPart1El[1] + daughPart2El[1], daughPart1El[2] + daughPart2El[2]}; + std::array motherPartPr = {daughPart1Pr[0] + daughPart2Pr[0], daughPart1Pr[1] + daughPart2Pr[1], daughPart1Pr[2] + daughPart2Pr[2]}; + float massEl = o2::constants::physics::MassElectron; float massMu = o2::constants::physics::MassMuonMinus; - auto arrMom = std::array{daughPart1, daughPart2}; - float massJpsi = RecoDecay::m(arrMom, std::array{massMu, massMu}); - - MC.get(HIST("MC/hEta1"))->Fill(RecoDecay::eta(daughPart1)); - MC.get(HIST("MC/hEta2"))->Fill(RecoDecay::eta(daughPart2)); - MC.get(HIST("MC/hPhi1"))->Fill(RecoDecay::phi(daughPart1)); - MC.get(HIST("MC/hPhi2"))->Fill(RecoDecay::phi(daughPart2)); - MC.get(HIST("MC/hPt1"))->Fill(RecoDecay::pt(daughPart1)); - MC.get(HIST("MC/hPt2"))->Fill(RecoDecay::pt(daughPart2)); - MC.get(HIST("MC/hPt"))->Fill(RecoDecay::pt(motherPart)); - MC.get(HIST("MC/hIVM"))->Fill(massJpsi); - MC.get(HIST("MC/hRapidity"))->Fill(RecoDecay::y(motherPart, massJpsi)); - } // end MC process + float massPr = o2::constants::physics::MassProton; + + auto arrMomMu = std::array{daughPart1Mu, daughPart2Mu}; + float massJpsiMu = RecoDecay::m(arrMomMu, std::array{massMu, massMu}); + auto arrMomEl = std::array{daughPart1El, daughPart2El}; + float massJpsiEl = RecoDecay::m(arrMomEl, std::array{massEl, massEl}); + auto arrMomPr = std::array{daughPart1Pr, daughPart2Pr}; + float massJpsiPr = RecoDecay::m(arrMomPr, std::array{massPr, massPr}); + + MC.get(HIST("MC/Muon/hEta1"))->Fill(RecoDecay::eta(daughPart1Mu)); + MC.get(HIST("MC/Muon/hEta2"))->Fill(RecoDecay::eta(daughPart2Mu)); + MC.get(HIST("MC/Muon/hPhi1"))->Fill(RecoDecay::phi(daughPart1Mu)); + MC.get(HIST("MC/Muon/hPhi2"))->Fill(RecoDecay::phi(daughPart2Mu)); + MC.get(HIST("MC/Muon/hPt1"))->Fill(RecoDecay::pt(daughPart1Mu)); + MC.get(HIST("MC/Muon/hPt2"))->Fill(RecoDecay::pt(daughPart2Mu)); + MC.get(HIST("MC/Muon/hPt"))->Fill(RecoDecay::pt(motherPartMu)); + MC.get(HIST("MC/Muon/hIVM"))->Fill(massJpsiMu); + MC.get(HIST("MC/Muon/hRapidity"))->Fill(RecoDecay::y(motherPartMu, massJpsiMu)); + + MC.get(HIST("MC/Electron/hEta1"))->Fill(RecoDecay::eta(daughPart1El)); + MC.get(HIST("MC/Electron/hEta2"))->Fill(RecoDecay::eta(daughPart2El)); + MC.get(HIST("MC/Electron/hPhi1"))->Fill(RecoDecay::phi(daughPart1El)); + MC.get(HIST("MC/Electron/hPhi2"))->Fill(RecoDecay::phi(daughPart2El)); + MC.get(HIST("MC/Electron/hPt1"))->Fill(RecoDecay::pt(daughPart1El)); + MC.get(HIST("MC/Electron/hPt2"))->Fill(RecoDecay::pt(daughPart2El)); + MC.get(HIST("MC/Electron/hPt"))->Fill(RecoDecay::pt(motherPartEl)); + MC.get(HIST("MC/Electron/hIVM"))->Fill(massJpsiEl); + MC.get(HIST("MC/Electron/hRapidity"))->Fill(RecoDecay::y(motherPartEl, massJpsiEl)); + + MC.get(HIST("MC/Proton/hEta1"))->Fill(RecoDecay::eta(daughPart1Pr)); + MC.get(HIST("MC/Proton/hEta2"))->Fill(RecoDecay::eta(daughPart2Pr)); + MC.get(HIST("MC/Proton/hPhi1"))->Fill(RecoDecay::phi(daughPart1Pr)); + MC.get(HIST("MC/Proton/hPhi2"))->Fill(RecoDecay::phi(daughPart2Pr)); + MC.get(HIST("MC/Proton/hPt1"))->Fill(RecoDecay::pt(daughPart1Pr)); + MC.get(HIST("MC/Proton/hPt2"))->Fill(RecoDecay::pt(daughPart2Pr)); + MC.get(HIST("MC/Proton/hPt"))->Fill(RecoDecay::pt(motherPartPr)); + MC.get(HIST("MC/Proton/hIVM"))->Fill(massJpsiPr); + MC.get(HIST("MC/Proton/hRapidity"))->Fill(RecoDecay::y(motherPartPr, massJpsiPr)); + + } // end MC skimmed process + + template + void processMCU(C const& collisions) + { + MC.fill(HIST("MC/hNumberOfRecoCollisions"), collisions.size()); + } // end MC unskimmed process void processDGrecoLevel(UDCollisionFull const& collision, UDTracksFull const& tracks) { @@ -2146,9 +2231,15 @@ struct UpcJpsiCentralBarrel { processMC(mcCollision, mcParticles); } + void processMCUnskimmed(aod::McCollision const& mcCollision, soa::SmallGroups> const& collisions /*, aod::McParticles const& mcParticles, aod::TracksIU const& tracks*/) + { + processMCU(collisions); + } + PROCESS_SWITCH(UpcJpsiCentralBarrel, processDGrecoLevel, "Iterate over DG skimmed data.", false); PROCESS_SWITCH(UpcJpsiCentralBarrel, processSGrecoLevel, "Iterate over SG skimmed data.", false); PROCESS_SWITCH(UpcJpsiCentralBarrel, processMCtruth, "Iterate of MC true data.", true); + PROCESS_SWITCH(UpcJpsiCentralBarrel, processMCUnskimmed, "Iterate over unskimmed data.", true); }; // end struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From a517d3f8ef8bfede38b37e22735096cdaa08ad80 Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Tue, 10 Dec 2024 20:12:06 +0100 Subject: [PATCH 312/459] [PWGLF] Update LFResonanceTables and Resonance Module Initialization Code (#8900) Co-authored-by: ALICE Action Bot --- PWGLF/DataModel/LFResonanceTables.h | 110 +- PWGLF/TableProducer/Resonances/CMakeLists.txt | 5 + .../Resonances/resonanceInitializer.cxx | 31 +- .../Resonances/resonanceModuleInitializer.cxx | 1257 +++++++++++++++++ PWGLF/Tasks/Resonances/xi1530Analysis.cxx | 5 +- PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx | 4 +- PWGLF/Utils/collisionCuts.h | 66 +- 7 files changed, 1392 insertions(+), 86 deletions(-) create mode 100644 PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx diff --git a/PWGLF/DataModel/LFResonanceTables.h b/PWGLF/DataModel/LFResonanceTables.h index 2c74b52a1b6..b72dd1e745f 100644 --- a/PWGLF/DataModel/LFResonanceTables.h +++ b/PWGLF/DataModel/LFResonanceTables.h @@ -53,13 +53,14 @@ enum { kAllCutsINELg010, kECend, }; -DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality (Multiplicity) percentile (Default: FT0M) -DECLARE_SOA_COLUMN(Spherocity, spherocity, float); //! Spherocity of the event -DECLARE_SOA_COLUMN(EvtPl, evtPl, float); //! Second harmonic event plane -DECLARE_SOA_COLUMN(EvtPlResAB, evtPlResAB, float); //! Second harmonic event plane resolution of A-B sub events -DECLARE_SOA_COLUMN(EvtPlResAC, evtPlResAC, float); //! Second harmonic event plane resolution of A-C sub events -DECLARE_SOA_COLUMN(EvtPlResBC, evtPlResBC, float); //! Second harmonic event plane resolution of B-C sub events -DECLARE_SOA_COLUMN(BMagField, bMagField, float); //! Magnetic field +DECLARE_SOA_INDEX_COLUMN_FULL(Collision, collision, int, Collisions, "_Col"); //! +DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality (Multiplicity) percentile (Default: FT0M) +DECLARE_SOA_COLUMN(Spherocity, spherocity, float); //! Spherocity of the event +DECLARE_SOA_COLUMN(EvtPl, evtPl, float); //! Second harmonic event plane +DECLARE_SOA_COLUMN(EvtPlResAB, evtPlResAB, float); //! Second harmonic event plane resolution of A-B sub events +DECLARE_SOA_COLUMN(EvtPlResAC, evtPlResAC, float); //! Second harmonic event plane resolution of A-C sub events +DECLARE_SOA_COLUMN(EvtPlResBC, evtPlResBC, float); //! Second harmonic event plane resolution of B-C sub events +DECLARE_SOA_COLUMN(BMagField, bMagField, float); //! Magnetic field // MC DECLARE_SOA_COLUMN(IsVtxIn10, isVtxIn10, bool); //! Vtx10 DECLARE_SOA_COLUMN(IsINELgt0, isINELgt0, bool); //! INEL>0 @@ -71,6 +72,7 @@ DECLARE_SOA_COLUMN(ImpactParameter, impactParameter, float); //! ImpactParamete } // namespace resocollision DECLARE_SOA_TABLE(ResoCollisions, "AOD", "RESOCOLLISION", o2::soa::Index<>, + resocollision::CollisionId, o2::aod::mult::MultNTracksPV, collision::PosX, collision::PosY, @@ -87,6 +89,7 @@ DECLARE_SOA_TABLE(ResoCollisions, "AOD", "RESOCOLLISION", using ResoCollision = ResoCollisions::iterator; DECLARE_SOA_TABLE(ResoMCCollisions, "AOD", "RESOMCCOL", + o2::soa::Index<>, resocollision::IsVtxIn10, resocollision::IsINELgt0, resocollision::IsTriggerTVX, @@ -95,36 +98,54 @@ DECLARE_SOA_TABLE(ResoMCCollisions, "AOD", "RESOMCCOL", resocollision::ImpactParameter); using ResoMCCollision = ResoMCCollisions::iterator; +DECLARE_SOA_TABLE(ResoSpheroCollisions, "AOD", "RESOSPHEROCOLL", + o2::soa::Index<>, + resocollision::CollisionId, + resocollision::Spherocity); +using ResoSpheroCollision = ResoSpheroCollisions::iterator; + +DECLARE_SOA_TABLE(ResoEvtPlCollisions, "AOD", "RESOEVTPLCOLL", + o2::soa::Index<>, + resocollision::CollisionId, + resocollision::EvtPl, + resocollision::EvtPlResAB, + resocollision::EvtPlResAC, + resocollision::EvtPlResBC); +using ResoEvtPlCollision = ResoEvtPlCollisions::iterator; + // Resonance Daughters // inspired from PWGCF/DataModel/FemtoDerived.h namespace resodaughter { DECLARE_SOA_INDEX_COLUMN(ResoCollision, resoCollision); -DECLARE_SOA_COLUMN(Pt, pt, float); //! p_T (GeV/c) -DECLARE_SOA_COLUMN(Px, px, float); //! p_x (GeV/c) -DECLARE_SOA_COLUMN(Py, py, float); //! p_y (GeV/c) -DECLARE_SOA_COLUMN(Pz, pz, float); //! p_z (GeV/c) -DECLARE_SOA_COLUMN(Eta, eta, float); //! Eta -DECLARE_SOA_COLUMN(Phi, phi, float); //! Phi -DECLARE_SOA_COLUMN(PartType, partType, uint8_t); //! Type of the particle, according to resodaughter::ParticleType -DECLARE_SOA_COLUMN(TempFitVar, tempFitVar, float); //! Observable for the template fitting (Track: DCA_xy, V0: CPA) -DECLARE_SOA_COLUMN(Indices, indices, int[2]); //! Field for the track indices to remove auto-correlations -DECLARE_SOA_COLUMN(CascadeIndices, cascIndices, int[3]); //! Field for the track indices to remove auto-correlations (ordered: positive, negative, bachelor) -DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! Sign of the track charge -DECLARE_SOA_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, uint8_t); //! Number of TPC crossed rows -DECLARE_SOA_COLUMN(TPCNClsFound, tpcNClsFound, uint8_t); //! Number of TPC clusters found -DECLARE_SOA_COLUMN(ITSNCls, itsNCls, uint8_t); //! Number of ITS clusters found -DECLARE_SOA_COLUMN(IsGlobalTrackWoDCA, isGlobalTrackWoDCA, bool); //! Is global track without DCA -DECLARE_SOA_COLUMN(IsGlobalTrack, isGlobalTrack, bool); //! Is global track -DECLARE_SOA_COLUMN(IsPrimaryTrack, isPrimaryTrack, bool); //! Is primary track -DECLARE_SOA_COLUMN(IsPVContributor, isPVContributor, bool); //! Is primary vertex contributor -DECLARE_SOA_COLUMN(HasITS, hasITS, bool); //! Has ITS -DECLARE_SOA_COLUMN(HasTPC, hasTPC, bool); //! Has TPC -DECLARE_SOA_COLUMN(HasTOF, hasTOF, bool); //! Has TOF +DECLARE_SOA_INDEX_COLUMN_FULL(Track, track, int, Tracks, "_Trk"); //! +DECLARE_SOA_INDEX_COLUMN_FULL(V0, v0, int, V0s, "_V0"); //! +DECLARE_SOA_INDEX_COLUMN_FULL(Cascade, cascade, int, Cascades, "_Cas"); //! +DECLARE_SOA_COLUMN(Pt, pt, float); //! p_T (GeV/c) +DECLARE_SOA_COLUMN(Px, px, float); //! p_x (GeV/c) +DECLARE_SOA_COLUMN(Py, py, float); //! p_y (GeV/c) +DECLARE_SOA_COLUMN(Pz, pz, float); //! p_z (GeV/c) +DECLARE_SOA_COLUMN(Eta, eta, float); //! Eta +DECLARE_SOA_COLUMN(Phi, phi, float); //! Phi +DECLARE_SOA_COLUMN(PartType, partType, uint8_t); //! Type of the particle, according to resodaughter::ParticleType +DECLARE_SOA_COLUMN(TempFitVar, tempFitVar, float); //! Observable for the template fitting (Track: DCA_xy, V0: CPA) +DECLARE_SOA_COLUMN(Indices, indices, int[2]); //! Field for the track indices to remove auto-correlations +DECLARE_SOA_COLUMN(CascadeIndices, cascadeIndices, int[3]); //! Field for the track indices to remove auto-correlations (ordered: positive, negative, bachelor) +DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! Sign of the track charge +DECLARE_SOA_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, uint8_t); //! Number of TPC crossed rows +DECLARE_SOA_COLUMN(TPCNClsFound, tpcNClsFound, uint8_t); //! Number of TPC clusters found +DECLARE_SOA_COLUMN(ITSNCls, itsNCls, uint8_t); //! Number of ITS clusters found +DECLARE_SOA_COLUMN(IsGlobalTrackWoDCA, isGlobalTrackWoDCA, bool); //! Is global track without DCA +DECLARE_SOA_COLUMN(IsGlobalTrack, isGlobalTrack, bool); //! Is global track +DECLARE_SOA_COLUMN(IsPrimaryTrack, isPrimaryTrack, bool); //! Is primary track +DECLARE_SOA_COLUMN(IsPVContributor, isPVContributor, bool); //! Is primary vertex contributor +DECLARE_SOA_COLUMN(HasITS, hasITS, bool); //! Has ITS +DECLARE_SOA_COLUMN(HasTPC, hasTPC, bool); //! Has TPC +DECLARE_SOA_COLUMN(HasTOF, hasTOF, bool); //! Has TOF DECLARE_SOA_COLUMN(TPCCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls, float); DECLARE_SOA_COLUMN(DaughDCA, daughDCA, float); //! DCA between daughters -DECLARE_SOA_COLUMN(CascDaughDCA, cascdaughDCA, float); //! DCA between daughters from cascade +DECLARE_SOA_COLUMN(CascDaughDCA, cascDaughDCA, float); //! DCA between daughters from cascade DECLARE_SOA_COLUMN(V0CosPA, v0CosPA, float); //! V0 Cosine of Pointing Angle DECLARE_SOA_COLUMN(CascCosPA, cascCosPA, float); //! Cascade Cosine of Pointing Angle DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! The invariant mass of V0 candidate, assuming lambda @@ -132,7 +153,7 @@ DECLARE_SOA_COLUMN(MAntiLambda, mAntiLambda, float); //! DECLARE_SOA_COLUMN(MK0Short, mK0Short, float); //! The invariant mass of V0 candidate, assuming k0s DECLARE_SOA_COLUMN(MXi, mXi, float); //! The invariant mass of Xi candidate DECLARE_SOA_COLUMN(TransRadius, transRadius, float); //! Transverse radius of the decay vertex -DECLARE_SOA_COLUMN(CascTransRadius, casctransRadius, float); //! Transverse radius of the decay vertex from cascade +DECLARE_SOA_COLUMN(CascTransRadius, cascTransRadius, float); //! Transverse radius of the decay vertex from cascade DECLARE_SOA_COLUMN(DecayVtxX, decayVtxX, float); //! X position of the decay vertex DECLARE_SOA_COLUMN(DecayVtxY, decayVtxY, float); //! Y position of the decay vertex DECLARE_SOA_COLUMN(DecayVtxZ, decayVtxZ, float); //! Z position of the decay vertex @@ -158,19 +179,20 @@ DECLARE_SOA_COLUMN(DaughterTOFNSigmaBachPr, daughterTOFNSigmaBachPr, float); //! DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! Index of the corresponding MC particle DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool); -DECLARE_SOA_COLUMN(MothersId, motherId, int); //! Id of the mother particle +DECLARE_SOA_COLUMN(MotherId, motherId, int); //! Id of the mother particle DECLARE_SOA_COLUMN(MotherPDG, motherPDG, int); //! PDG code of the mother particle DECLARE_SOA_COLUMN(DaughterPDG1, daughterPDG1, int); //! PDG code of the first Daughter particle DECLARE_SOA_COLUMN(DaughterPDG2, daughterPDG2, int); //! PDG code of the second Daughter particle -DECLARE_SOA_COLUMN(DaughterID1, daughterId1, int); //! Id of the first Daughter particle -DECLARE_SOA_COLUMN(DaughterID2, daughterId2, int); //! Id of the second Daughter particle +DECLARE_SOA_COLUMN(DaughterID1, daughterID1, int); //! Id of the first Daughter particle +DECLARE_SOA_COLUMN(DaughterID2, daughterID2, int); //! Id of the second Daughter particle DECLARE_SOA_COLUMN(SiblingIds, siblingIds, int[2]); //! Index of the particles with the same mother -DECLARE_SOA_COLUMN(BachTrkID, bachtrkID, int); //! Id of the bach track from cascade +DECLARE_SOA_COLUMN(BachTrkID, bachTrkID, int); //! Id of the bach track from cascade DECLARE_SOA_COLUMN(V0ID, v0ID, int); //! Id of the V0 from cascade } // namespace resodaughter DECLARE_SOA_TABLE(ResoTracks, "AOD", "RESOTRACKS", o2::soa::Index<>, resodaughter::ResoCollisionId, + resodaughter::TrackId, resodaughter::Pt, resodaughter::Px, resodaughter::Py, @@ -211,6 +233,7 @@ using ResoTrack = ResoTracks::iterator; DECLARE_SOA_TABLE(ResoV0s, "AOD", "RESOV0S", o2::soa::Index<>, resodaughter::ResoCollisionId, + resodaughter::V0Id, resodaughter::Pt, resodaughter::Px, resodaughter::Py, @@ -247,6 +270,7 @@ using ResoV0 = ResoV0s::iterator; DECLARE_SOA_TABLE(ResoCascades, "AOD", "RESOCASCADES", o2::soa::Index<>, resodaughter::ResoCollisionId, + resodaughter::CascadeId, resodaughter::Pt, resodaughter::Px, resodaughter::Py, @@ -293,7 +317,7 @@ using ResoCascade = ResoCascades::iterator; DECLARE_SOA_TABLE(ResoMCTracks, "AOD", "RESOMCTRACKS", mcparticle::PdgCode, - resodaughter::MothersId, + resodaughter::MotherId, resodaughter::MotherPDG, resodaughter::SiblingIds, resodaughter::IsPhysicalPrimary, @@ -302,7 +326,7 @@ using ResoMCTrack = ResoMCTracks::iterator; DECLARE_SOA_TABLE(ResoMCV0s, "AOD", "RESOMCV0S", mcparticle::PdgCode, - resodaughter::MothersId, + resodaughter::MotherId, resodaughter::MotherPDG, resodaughter::DaughterID1, resodaughter::DaughterID2, @@ -314,7 +338,7 @@ using ResoMCV0 = ResoMCV0s::iterator; DECLARE_SOA_TABLE(ResoMCCascades, "AOD", "RESOMCCASCADES", mcparticle::PdgCode, - resodaughter::MothersId, + resodaughter::MotherId, resodaughter::MotherPDG, resodaughter::BachTrkID, resodaughter::V0ID, @@ -349,5 +373,17 @@ using Reso2TracksMC = soa::Join; using Reso2TracksPID = soa::Join; using Reso2TracksPIDExt = soa::Join; // Without Extra +using ResoCollisionCandidates = soa::Join; +using ResoRun2CollisionCandidates = soa::Join; +using ResoCollisionCandidatesMC = soa::Join; +using ResoRun2CollisionCandidatesMC = soa::Join; +using ResoTrackCandidates = aod::Reso2TracksPIDExt; +using ResoTrackCandidatesMC = soa::Join; +using ResoV0Candidates = aod::V0Datas; +using ResoV0CandidatesMC = soa::Join; +using ResoCascadesCandidates = aod::CascDatas; +using ResoCascadesCandidatesMC = soa::Join; +using BCsWithRun2Info = soa::Join; + } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFRESONANCETABLES_H_ diff --git a/PWGLF/TableProducer/Resonances/CMakeLists.txt b/PWGLF/TableProducer/Resonances/CMakeLists.txt index d6ca37b8d0c..785dbdf3828 100644 --- a/PWGLF/TableProducer/Resonances/CMakeLists.txt +++ b/PWGLF/TableProducer/Resonances/CMakeLists.txt @@ -30,6 +30,11 @@ o2physics_add_dpl_workflow(resonance-initializer PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(resonance-module-initializer + SOURCES resonanceModuleInitializer.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(reso2mergedf SOURCES LFResonanceMergeDF.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase diff --git a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx index 8a76e68ddef..03b0a351b0b 100644 --- a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx @@ -456,6 +456,7 @@ struct ResonanceInitializer { if (!isTrackSelected(collision, track)) continue; reso2trks(resoCollisions.lastIndex(), + track.globalIndex(), track.pt(), track.px(), track.py(), @@ -508,6 +509,7 @@ struct ResonanceInitializer { childIDs[0] = v0.posTrackId(); childIDs[1] = v0.negTrackId(); reso2v0s(resoCollisions.lastIndex(), + v0.globalIndex(), v0.pt(), v0.px(), v0.py(), @@ -554,6 +556,7 @@ struct ResonanceInitializer { childIDs[1] = casc.negTrackId(); childIDs[2] = casc.bachelorId(); reso2cascades(resoCollisions.lastIndex(), + casc.globalIndex(), casc.pt(), casc.px(), casc.py(), @@ -1055,7 +1058,7 @@ struct ResonanceInitializer { return; colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); } @@ -1071,7 +1074,7 @@ struct ResonanceInitializer { return; colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); } @@ -1088,7 +1091,7 @@ struct ResonanceInitializer { return; colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), getEvtPl(collision), getEvtPlRes(collision, evtPlDetId, evtPlRefAId), getEvtPlRes(collision, evtPlDetId, evtPlRefBId), getEvtPlRes(collision, evtPlRefAId, evtPlRefBId), dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), getEvtPl(collision), getEvtPlRes(collision, evtPlDetId, evtPlRefAId), getEvtPlRes(collision, evtPlDetId, evtPlRefBId), getEvtPlRes(collision, evtPlRefAId, evtPlRefBId), dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); } @@ -1106,7 +1109,7 @@ struct ResonanceInitializer { return; colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); @@ -1124,7 +1127,7 @@ struct ResonanceInitializer { return; colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); @@ -1144,7 +1147,7 @@ struct ResonanceInitializer { return; colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); @@ -1164,7 +1167,7 @@ struct ResonanceInitializer { return; colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); @@ -1181,7 +1184,7 @@ struct ResonanceInitializer { initCCDB(bc); colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); auto mccollision = collision.mcCollision_as(); float impactpar = mccollision.impactParameter(); @@ -1204,7 +1207,7 @@ struct ResonanceInitializer { initCCDB(bc); colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), getEvtPl(collision), getEvtPlRes(collision, evtPlDetId, evtPlRefAId), getEvtPlRes(collision, evtPlDetId, evtPlRefBId), getEvtPlRes(collision, evtPlRefAId, evtPlRefBId), dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), getEvtPl(collision), getEvtPlRes(collision, evtPlDetId, evtPlRefAId), getEvtPlRes(collision, evtPlDetId, evtPlRefBId), getEvtPlRes(collision, evtPlRefAId, evtPlRefBId), dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1223,7 +1226,7 @@ struct ResonanceInitializer { auto bc = collision.bc_as(); colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1244,7 +1247,7 @@ struct ResonanceInitializer { initCCDB(bc); colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1265,7 +1268,7 @@ struct ResonanceInitializer { auto bc = collision.bc_as(); colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1288,7 +1291,7 @@ struct ResonanceInitializer { initCCDB(bc); colCuts.fillQA(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), centEst(collision), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks @@ -1312,7 +1315,7 @@ struct ResonanceInitializer { auto bc = collision.bc_as(); colCuts.fillQARun2(collision); - resoCollisions(0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), collision.centRun2V0M(), computeSpherocity(tracks, trackSphMin, trackSphDef), 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); fillMCCollision(collision, mcParticles); // Loop over tracks diff --git a/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx new file mode 100644 index 00000000000..327585d6295 --- /dev/null +++ b/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx @@ -0,0 +1,1257 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +// +/// \file resonanceModuleInitializer.cxx +/// \brief Initializes variables for the resonance candidate producers +/// +/// \author Bong-Hwi Lim + +#include +#include +#include "CCDB/BasicCCDBManager.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/Centrality.h" +#include "Common/Core/RecoDecay.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/Qvectors.h" +#include "Common/Core/EventPlaneHelper.h" +#include "CommonConstants/PhysicsConstants.h" +#include "CommonConstants/MathConstants.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DetectorsBase/Propagator.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/LFResonanceTables.h" +#include "PWGLF/DataModel/mcCentrality.h" +#include "PWGLF/Utils/collisionCuts.h" +#include "ReconstructionDataFormats/Track.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; +using namespace o2::constants::physics; +using namespace o2::constants::math; + +/** + * @brief Initializer for the event pool for resonance study + * + * This struct is responsible for initializing and processing collision data + * for resonance studies. It handles event selection, centrality estimation, + * and QA histogram filling. + */ +struct ResonanceModuleInitializer { + int mRunNumber; ///< Run number for the current data + int multEstimator; ///< Multiplicity estimator type + float dBz; ///< Magnetic field value + float centrality; ///< Centrality value for the event + Service ccdb; ///< CCDB manager service + Service pdg; ///< PDG database service + EventPlaneHelper helperEP; ///< Helper for event plane calculations + + Produces resoCollisions; ///< Output table for resonance collisions + Produces resoMCCollisions; ///< Output table for MC resonance collisions + + // CCDB options + Configurable ccdbURL{"ccdbURL", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; + Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + + Configurable cfgFatalWhenNull{"cfgFatalWhenNull", true, "Fatal when null on ccdb access"}; + + // Configurables + Configurable dBzInput{"dBzInput", -999, "bz field, -999 is automatic"}; + Configurable cfgFillQA{"cfgFillQA", false, "Fill QA histograms"}; + Configurable cfgBypassCCDB{"cfgBypassCCDB", true, "Bypass loading CCDB part to save CPU time and memory"}; // will be affected to b_z value. + Configurable cfgMultName{"cfgMultName", "FT0M", "The name of multiplicity estimator"}; + Configurable cfgCentralityMC{"cfgCentralityMC", 0, "Centrality estimator for MC (0: Reco, 1: MC, 2: impact parameter)"}; + + // EventCorrection for MC + ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 0.01, 0.1, 1.0, 5.0, 10., 15., 20., 30., 40., 50., 70., 100.0, 105.}, "Binning of the centrality axis"}; + ConfigurableAxis cfgVtxBins{"cfgVtxBins", {VARIABLE_WIDTH, -20, -15, -10, -7, -5, -3, -2, -1, 0, 1, 2, 3, 5, 7, 10, 15, 20}, "Mixing bins - z-vertex"}; + + /// Event cuts + o2::analysis::CollisonCuts colCuts; + Configurable cfgEvtZvtx{"cfgEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable cfgEvtOccupancyInTimeRange{"cfgEvtOccupancyInTimeRange", -1, "Evt sel: maximum track occupancy"}; + Configurable cfgEvtTriggerCheck{"cfgEvtTriggerCheck", false, "Evt sel: check for trigger"}; + Configurable cfgEvtTriggerSel{"cfgEvtTriggerSel", 8, "Evt sel: trigger"}; + Configurable cfgEvtOfflineCheck{"cfgEvtOfflineCheck", true, "Evt sel: check for offline selection"}; + Configurable cfgEvtTriggerTVXSel{"cfgEvtTriggerTVXSel", false, "Evt sel: triggerTVX selection (MB)"}; + Configurable cfgEvtTFBorderCut{"cfgEvtTFBorderCut", false, "Evt sel: apply TF border cut"}; + Configurable cfgEvtUseITSTPCvertex{"cfgEvtUseITSTPCvertex", false, "Evt sel: use at lease on ITS-TPC track for vertexing"}; + Configurable cfgEvtZvertexTimedifference{"cfgEvtZvertexTimedifference", false, "Evt sel: apply Z-vertex time difference"}; + Configurable cfgEvtPileupRejection{"cfgEvtPileupRejection", false, "Evt sel: apply pileup rejection"}; + Configurable cfgEvtNoITSROBorderCut{"cfgEvtNoITSROBorderCut", false, "Evt sel: apply NoITSRO border cut"}; + + // Qvector configuration + Configurable cfgBypassQvec{"cfgBypassQvec", true, "Bypass for qvector task"}; + Configurable cfgEvtPl{"cfgEvtPl", 40500, "Configuration of three subsystems for the event plane and its resolution, 10000*RefA + 100*RefB + S, where FT0C:0, FT0A:1, FT0M:2, FV0A:3, BPos:5, BNeg:6"}; + + int evtPlRefAId = static_cast(cfgEvtPl / 10000); + int evtPlRefBId = static_cast((cfgEvtPl - evtPlRefAId * 10000) / 100); + int evtPlDetId = cfgEvtPl - evtPlRefAId * 10000 - evtPlRefBId * 100; + + HistogramRegistry qaRegistry{"QAHistos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Filter collisionFilter = nabs(aod::collision::posZ) < cfgEvtZvtx; + + /** + * @brief Initializes the task + * + * @param context Initialization context + */ + void init(InitContext&) + { + mRunNumber = 0; + dBz = 0; + centrality = 0; + // Determine the multiplicity estimator based on the configuration + multEstimator = 0; + if (cfgMultName.value == "FT0M") { + multEstimator = 0; + } else if (cfgMultName.value == "FT0C") { + multEstimator = 1; + } else if (cfgMultName.value == "FT0A") { + multEstimator = 2; + } else if (cfgMultName.value == "FV0A") { + multEstimator = 99; + } + LOGF(info, "Mult estimator: %d, %s", multEstimator, cfgMultName.value.c_str()); + + // Ensure that only one process type is active at a time + if (doprocessRun3 && doprocessRun2) { + LOG(fatal) << "You cannot run both Run2 and Run3 processes at the same time"; + } + if (doprocessRun2MC && doprocessRun3MC) { + LOG(fatal) << "You cannot run both Run2 and Run3 MC processes at the same time"; + } + + // Initialize event selection cuts based on the process type + if (doprocessRun2) { + colCuts.setCuts(cfgEvtZvtx, cfgEvtTriggerCheck, cfgEvtTriggerSel, cfgEvtOfflineCheck, false); + } else if (doprocessRun3) { + colCuts.setCuts(cfgEvtZvtx, cfgEvtTriggerCheck, cfgEvtTriggerSel, cfgEvtOfflineCheck, true, false, cfgEvtOccupancyInTimeRange); + } + colCuts.init(&qaRegistry); + colCuts.setTriggerTVX(cfgEvtTriggerTVXSel); + colCuts.setApplyTFBorderCut(cfgEvtTFBorderCut); + colCuts.setApplyITSTPCvertex(cfgEvtUseITSTPCvertex); + colCuts.setApplyZvertexTimedifference(cfgEvtZvertexTimedifference); + colCuts.setApplyPileupRejection(cfgEvtPileupRejection); + colCuts.setApplyNoITSROBorderCut(cfgEvtNoITSROBorderCut); + + // Configure CCDB access if not bypassed + if (!cfgBypassCCDB) { + ccdb->setURL(ccdbURL.value); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(cfgFatalWhenNull); + uint64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + ccdb->setCreatedNotAfter(now); // TODO must become global parameter from the train creation time + } + + // Initialize QA histograms if required + if (doprocessRun3MC || doprocessRun2MC) { + AxisSpec centAxis = {binsCent, "Centrality (%)"}; + AxisSpec idxMCAxis = {26, -0.5, 25.5, "Index"}; + qaRegistry.add("Event/hMCEventIndices", "hMCEventIndices", kTH2D, {centAxis, idxMCAxis}); + } + } + + /** + * @brief Initializes CCDB for a given BC + * + * @param bc BC iterator + */ + void initCCDB(aod::BCsWithTimestamps::iterator const& bc) // Simple copy from LambdaKzeroFinder.cxx + { + if (cfgBypassCCDB) + return; + if (mRunNumber == bc.runNumber()) { + return; + } + + // In case override, don't proceed, please - no CCDB access required + if (dBzInput > -990) { + dBz = dBzInput; + ; + o2::parameters::GRPMagField grpmag; + if (std::fabs(dBz) > 1e-5) { + grpmag.setL3Current(30000.f / (dBz / 5.0f)); + } + o2::base::Propagator::initFieldFromGRP(&grpmag); + mRunNumber = bc.runNumber(); + return; + } + + auto run3grpTimestamp = bc.timestamp(); + o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(grpPath, run3grpTimestamp); + o2::parameters::GRPMagField* grpmag = 0x0; + if (grpo) { + o2::base::Propagator::initFieldFromGRP(grpo); + // Fetch magnetic field from ccdb for current collision + dBz = grpo->getNominalL3Field(); + LOG(info) << "Retrieved GRP for timestamp " << run3grpTimestamp << " with magnetic field of " << dBz << " kZG"; + } else { + grpmag = ccdb->getForTimeStamp(grpmagPath, run3grpTimestamp); + if (!grpmag) { + LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grpTimestamp; + } + o2::base::Propagator::initFieldFromGRP(grpmag); + // Fetch magnetic field from ccdb for current collision + dBz = std::lround(5.f * grpmag->getL3Current() / 30000.f); + LOG(info) << "Retrieved GRP for timestamp " << run3grpTimestamp << " with magnetic field of " << dBz << " kZG"; + } + mRunNumber = bc.runNumber(); + // Set magnetic field value once known + LOGF(info, "Bz set to %f for run: ", dBz, mRunNumber); + } + + /** + * @brief Checks if the collision is INEL>0 + * + * @tparam MCPart Type of MC particles + * @param mcparts MC particles + * @return true if INEL>0, false otherwise + */ + template + bool isTrueINEL0(MCPart const& mcparts) + { + for (auto const& mcparticle : mcparts) { + if (!mcparticle.isPhysicalPrimary()) + continue; + auto p = pdg->GetParticle(mcparticle.pdgCode()); + if (p != nullptr) { + if (std::abs(p->Charge()) >= 3) { + if (std::abs(mcparticle.eta()) < 1) + return true; + } + } + } + return false; + } + + /** + * @brief Centrality estimator selection + * + * @tparam ResoColl Type of resonance collision + * @tparam isMC Boolean indicating if it's MC + * @param ResoEvents Resonance events + * @return Centrality value + */ + template + float centEst(ResoColl ResoEvents) + { + float returnValue = -999.0; + switch (multEstimator) { + case 0: + returnValue = ResoEvents.centFT0M(); + break; + case 1: + if constexpr (isMC) { + LOG(fatal) << "CentFV0A is not available for MC"; + return returnValue; + } else { + returnValue = ResoEvents.centFT0C(); + break; + } + case 2: + if constexpr (isMC) { + LOG(fatal) << "CentFT0A is not available for MC"; + return returnValue; + } else { + returnValue = ResoEvents.centFT0A(); + break; + } + case 99: + if constexpr (isMC) { + LOG(fatal) << "CentFV0A is not available for MC"; + return returnValue; + } else { + returnValue = ResoEvents.centFV0A(); + break; + } + default: + returnValue = ResoEvents.centFT0M(); + break; + } + return returnValue; + } + using GenMCCollisions = soa::Join; + float centEstMC(const GenMCCollisions::iterator& collision) { return centEst(collision); } + + /** + * @brief Computes the spherocity of an event + * + * @tparam T Type of the tracks + * @param tracks All tracks + * @param nTracksMin Minimum number of tracks + * @param spdef Spherocity definition + * @return Spherocity value + */ + template + float computeSpherocity(T const& tracks, int nTracksMin, int spdef) + { + // if number of tracks is not enough for spherocity estimation. + int ntrks = tracks.size(); + if (ntrks < nTracksMin) + return -99.; + + // start computing spherocity + + float ptSum = 0.; + for (auto const& track : tracks) { + if (cfgFillQA) { + qaRegistry.fill(HIST("Phi"), track.phi()); + } + if (spdef == 0) { + ptSum += 1.; + } else { + ptSum += track.pt(); + } + } + + float tempSph = 1.; + for (int i = 0; i < 360 / 0.1; ++i) { + float sum = 0., pt = 0.; + float phiparm = (PI * i * 0.1) / 180.; + float nx = std::cos(phiparm); + float ny = std::sin(phiparm); + for (auto const& trk : tracks) { + pt = trk.pt(); + if (spdef == 0) { + pt = 1.; + } + float phi = trk.phi(); + float px = pt * std::cos(phi); + float py = pt * std::sin(phi); + // sum += pt * abs(sin(phiparm - phi)); + sum += std::abs(px * ny - py * nx); + } + float sph = std::pow((sum / ptSum), 2); + if (sph < tempSph) + tempSph = sph; + } + + return std::pow(PIHalf, 2) * tempSph; + } + + /** + * @brief Gets the event plane + * + * @tparam ResoColl Type of resonance collision + * @param ResoEvents Resonance events + * @return Event plane value + */ + template + float getEvtPl(ResoColl ResoEvents) + { + float returnValue = -999.0; + if (ResoEvents.qvecAmp()[evtPlDetId] > 1e-8) + returnValue = helperEP.GetEventPlane(ResoEvents.qvecRe()[evtPlDetId * 4 + 3], ResoEvents.qvecIm()[evtPlDetId * 4 + 3], 2); + return returnValue; + } + + /** + * @brief Gets the event plane resolution + * + * @tparam ResoColl Type of resonance collision + * @param ResoEvents Resonance events + * @param a First index + * @param b Second index + * @return Event plane resolution + */ + template + float getEvtPlRes(ResoColl ResoEvents, int a, int b) + { + float returnValue = -999.0; + if (ResoEvents.qvecAmp()[a] < 1e-8 || ResoEvents.qvecAmp()[b] < 1e-8) + return returnValue; + returnValue = helperEP.GetResolution(helperEP.GetEventPlane(ResoEvents.qvecRe()[a * 4 + 3], ResoEvents.qvecIm()[a * 4 + 3], 2), helperEP.GetEventPlane(ResoEvents.qvecRe()[b * 4 + 3], ResoEvents.qvecIm()[b * 4 + 3], 2), 2); + return returnValue; + } + + /** + * @brief Fills MC particles + * + * @tparam CollisionType Type of collision + * @tparam SelectedMCPartType Type of selected MC particles + * @tparam TotalMCParts Type of total MC particles + * @param collision Collision data + * @param mcParts Selected MC particles + * @param mcParticles Total MC particles + */ + template + void fillMCParticles(CollisionType collision, SelectedMCPartType const& mcParts, TotalMCParts const& mcParticles) + { + for (auto const& mcPart : mcParts) { + std::vector daughterPDGs; + if (mcPart.has_daughters()) { + auto daughter01 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[0] - mcParticles.offset()); + auto daughter02 = mcParticles.rawIteratorAt(mcPart.daughtersIds()[1] - mcParticles.offset()); + daughterPDGs = {daughter01.pdgCode(), daughter02.pdgCode()}; + } else { + daughterPDGs = {-1, -1}; + } + reso2mcparents(collision.globalIndex(), + mcPart.globalIndex(), + mcPart.pdgCode(), + daughterPDGs[0], daughterPDGs[1], + mcPart.isPhysicalPrimary(), + mcPart.producedByGenerator(), + mcPart.pt(), + mcPart.px(), + mcPart.py(), + mcPart.pz(), + mcPart.eta(), + mcPart.phi(), + mcPart.y()); + daughterPDGs.clear(); + } + } + + /** + * @brief Fills MC collision data + * + * @tparam isRun2 Boolean indicating if it's Run2 + * @tparam MCCol Type of MC collision + * @tparam MCPart Type of MC particles + * @param mccol MC collision data + * @param mcparts MC particles + */ + template + void fillMCCollision(MCCol const& mccol, MCPart const& mcparts) + { + const auto& mcColg = mccol.template mcCollision_as(); + float mcCent = 999.0; + if constexpr (isRun2) { + if (cfgCentralityMC == 0) { + mcCent = mccol.centRun2V0M(); + } else { + mcCent = mcColg.impactParameter(); + } + } else { + if (cfgCentralityMC == 0) { + mcCent = centEst(mccol); + } else if (cfgCentralityMC == 1) { + mcCent = centEstMC(mcColg); + } else if (cfgCentralityMC == 2) { + mcCent = mcColg.impactParameter(); + } + } + bool inVtx10 = (std::abs(mcColg.posZ()) > 10.) ? false : true; + bool isTrueINELgt0 = isTrueINEL0(mcparts); + bool isTriggerTVX = mccol.selection_bit(aod::evsel::kIsTriggerTVX); + bool isSel8 = mccol.sel8(); + bool isSelected = colCuts.isSelected(mccol); + resoMCCollisions(inVtx10, isTrueINELgt0, isTriggerTVX, isSel8, isSelected, mcCent); + + // QA for Trigger efficiency + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kINEL); + if (inVtx10) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kINEL10); + if (isTrueINELgt0) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kINELg0); + if (inVtx10 && isTrueINELgt0) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kINELg010); + + // TVX MB trigger + if (isTriggerTVX) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kTrig); + if (isTriggerTVX && inVtx10) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kTrig10); + if (isTriggerTVX && isTrueINELgt0) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kTrigINELg0); + if (isTriggerTVX && isTrueINELgt0 && inVtx10) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kTrigINELg010); + + // Sel8 event selection + if (isSel8) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kSel8); + if (isSel8 && inVtx10) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kSel810); + if (isSel8 && isTrueINELgt0) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kSel8INELg0); + if (isSel8 && isTrueINELgt0 && inVtx10) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kSel8INELg010); + + // CollisionCuts selection + if (isSelected) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kAllCuts); + if (isSelected && inVtx10) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kAllCuts10); + if (isSelected && isTrueINELgt0) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kAllCutsINELg0); + if (isSelected && isTrueINELgt0 && inVtx10) + qaRegistry.fill(HIST("Event/hMCEventIndices"), mcCent, aod::resocollision::kAllCutsINELg010); + } + + /** + * @brief Processes Dummy + * + * @param collision Collision data + */ + void processDummy(aod::Collisions const&) + { + } + PROCESS_SWITCH(ResonanceModuleInitializer, processDummy, "process Dummy", true); + + /** + * @brief Processes Run3 data + * + * @param collision Collision data + * @param bc BC data + */ + void processRun3(soa::Filtered::iterator const& collision, + aod::BCsWithTimestamps const&) + { + auto bc = collision.bc_as(); + initCCDB(bc); + // Default event selection + if (!colCuts.isSelected(collision)) + return; + colCuts.fillQA(collision); + centrality = centEst(collision); + + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), centrality, -999, 0., 0., 0., 0., dBz, bc.timestamp(), collision.trackOccupancyInTimeRange()); + } + PROCESS_SWITCH(ResonanceModuleInitializer, processRun3, "Default process for RUN3", false); + + /** + * @brief Processes Run2 data + * + * @param collision Collision data + * @param bc BC data + */ + void processRun2(soa::Filtered::iterator const& collision, + aod::BCsWithRun2Info const&) + { + auto bc = collision.bc_as(); + // Default event selection + if (!colCuts.isSelected(collision)) + return; + colCuts.fillQARun2(collision); + centrality = collision.centRun2V0M(); + + resoCollisions(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), centrality, -999, 0., 0., 0., 0., dBz, bc.timestamp(), -999); + } + PROCESS_SWITCH(ResonanceModuleInitializer, processRun2, "process for RUN2", false); + + /** + * @brief Processes Run3 MC data + * + * @param collision Collision data + * @param mcParticles MC particles + * @param mcCollisions MC collisions + */ + void processRun3MC(soa::Filtered::iterator const& collision, + aod::McParticles const& mcParticles, GenMCCollisions const&) + { + fillMCCollision(collision, mcParticles); + } + PROCESS_SWITCH(ResonanceModuleInitializer, processRun3MC, "process MC for RUN3", false); + + /** + * @brief Processes Run2 MC data + * + * @param collision Collision data + * @param mcParticles MC particles + */ + void processRun2MC(soa::Filtered::iterator const& collision, + aod::McParticles const& mcParticles) + { + fillMCCollision(collision, mcParticles); + } + PROCESS_SWITCH(ResonanceModuleInitializer, processRun2MC, "process MC for RUN2", false); +}; + +/** + * @brief Initializer for the resonance daughters producer + * + * This struct initializes and processes daughters for resonance studies. + * It applies daughter selection criteria and fills QA histograms for daughter properties. + */ +struct ResonanceDaughterInitializer { + SliceCache cache; + Produces reso2trks; ///< Output table for resonance tracks + Produces reso2mctracks; ///< Output table for MC resonance tracks + Produces reso2v0s; ///< Output table for resonance V0s + Produces reso2mcv0s; ///< Output table for MC resonance V0s + Produces reso2cascades; ///< Output table for resonance cascades + Produces reso2mccascades; ///< Output table for MC resonance cascades + + // Configurables + Configurable cfgFillQA{"cfgFillQA", false, "Fill QA histograms"}; + + // Configurables for tracks + Configurable cMaxDCArToPVcut{"cMaxDCArToPVcut", 2.0, "Track DCAr cut to PV Maximum"}; + Configurable cMinDCArToPVcut{"cMinDCArToPVcut", 0.0, "Track DCAr cut to PV Minimum"}; + Configurable cMaxDCAzToPVcut{"cMaxDCAzToPVcut", 2.0, "Track DCAz cut to PV Maximum"}; + Configurable cMinDCAzToPVcut{"cMinDCAzToPVcut", 0.0, "Track DCAz cut to PV Minimum"}; + Configurable trackSelection{"trackSelection", 1, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"}; + + // Configurables for V0s + Configurable cMinV0Radius{"cMinV0Radius", 0.0, "Minimum V0 radius from PV"}; + Configurable cMaxV0Radius{"cMaxV0Radius", 200.0, "Maximum V0 radius from PV"}; + Configurable cMinV0CosPA{"cMinV0CosPA", 0.995, "Minimum V0 CosPA to PV"}; + + // Configurables for cascades + Configurable cMinCascRadius{"cMinCascRadius", 0.0, "Minimum Cascade radius from PV"}; + Configurable cMaxCascRadius{"cMaxCascRadius", 200.0, "Maximum Cascade radius from PV"}; + Configurable cMinCascCosPA{"cMinCascCosPA", 0.97, "Minimum Cascade CosPA to PV"}; + + // Filters + Filter dcaXYFilter = nabs(aod::track::dcaXY) < cMaxDCArToPVcut && nabs(aod::track::dcaXY) > cMinDCArToPVcut; + Filter dcaZFilter = nabs(aod::track::dcaZ) < cMaxDCAzToPVcut && nabs(aod::track::dcaZ) > cMinDCAzToPVcut; + Preslice perMcCollision = aod::mcparticle::mcCollisionId; + + // Track selection filter based on configuration + Filter trackFilter = (trackSelection.node() == 0) || + ((trackSelection.node() == 1) && requireGlobalTrackInFilter()) || // kGlobalTrack = kQualityTracks | kPrimaryTracks | kInAcceptanceTracks + ((trackSelection.node() == 2) && requireGlobalTrackWoPtEtaInFilter()) || // kGlobalTrackWoPtEta = kQualityTracks | kPrimaryTracks + ((trackSelection.node() == 3) && requireGlobalTrackWoDCAInFilter()) || // kGlobalTrackWoDCA = kQualityTracks | kInAcceptanceTracks + ((trackSelection.node() == 4) && requireQualityTracksInFilter()) || // kQualityTracks = kQualityTracksITS | kQualityTracksTPC + ((trackSelection.node() == 5) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks)); // kInAcceptanceTracks = kPtRange | kEtaRange + HistogramRegistry qaRegistry{"QAHistos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + /** + * @brief Initializes the task + * + * @param context Initialization context + */ + void init(InitContext&) + { + if (cfgFillQA) { + AxisSpec idxAxis = {8, -0.5, 7.5, "Index"}; + AxisSpec ptAxis = {100, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec etaAxis = {100, -1.0f, 1.0f, "#eta"}; + AxisSpec phiAxis = {100, 0.0f, TwoPI, "#phi"}; + + qaRegistry.add("QA/hGoodTrackIndices", "hGoodTrackIndices", kTH1D, {idxAxis}); + if (doprocessMC) { + qaRegistry.add("QA/hGoodMCTrackIndices", "hGoodMCTrackIndices", kTH1D, {idxAxis}); + } + qaRegistry.add("QA/hTrackPt", "Track pT", kTH1F, {ptAxis}); + qaRegistry.add("QA/hTrackEta", "Track eta", kTH1F, {etaAxis}); + qaRegistry.add("QA/hTrackPhi", "Track phi", kTH1F, {phiAxis}); + + if (doprocessV0Data || doprocessV0MC) { + qaRegistry.add("QA/hGoodV0Indices", "hGoodV0Indices", kTH1D, {idxAxis}); + if (doprocessMC) { + qaRegistry.add("QA/hGoodMCV0Indices", "hGoodMCV0Indices", kTH1D, {idxAxis}); + } + AxisSpec radiusAxis = {100, 0.0, 200.0, "V0 Radius"}; + AxisSpec cosPAAxis = {100, 0.995, 1.0, "V0 CosPA"}; + qaRegistry.add("QA/hV0Radius", "V0 Radius", kTH1F, {radiusAxis}); + qaRegistry.add("QA/hV0CosPA", "V0 CosPA", kTH1F, {cosPAAxis}); + } + + if (doprocessCascData || doprocessCascMC) { + AxisSpec radiusAxis = {100, 0.0, 200.0, "Cascade Radius"}; + AxisSpec cosPAAxis = {100, 0.97, 1.0, "Cascade CosPA"}; + qaRegistry.add("QA/hGoodCascIndices", "hGoodCascIndices", kTH1D, {idxAxis}); + if (doprocessMC) { + qaRegistry.add("QA/hGoodMCCascIndices", "hGoodMCCascIndices", kTH1D, {idxAxis}); + } + qaRegistry.add("QA/hCascRadius", "Cascade Radius", kTH1F, {radiusAxis}); + qaRegistry.add("QA/hCascCosPA", "Cascade CosPA", kTH1F, {cosPAAxis}); + } + } + if (doprocessData || doprocessMC) { + LOGF(info, "ResonanceDaughterInitializer initialized with tracks"); + } + if (doprocessV0Data || doprocessV0MC) { + LOGF(info, "ResonanceDaughterInitializer initialized with V0s"); + } + if (doprocessCascData || doprocessCascMC) { + LOGF(info, "ResonanceDaughterInitializer initialized with cascades"); + } + + // Check if the module is initialized with both data and MC + if ((doprocessData && doprocessMC) || (doprocessV0Data && doprocessV0MC) || (doprocessCascData && doprocessCascMC)) { + LOGF(fatal, "ResonanceDaughterInitializer initialized with both data and MC"); + } + // Check if none of the processes are enabled + if (!doprocessDummy && !doprocessData && !doprocessMC && !doprocessV0Data && !doprocessV0MC && !doprocessCascData && !doprocessCascMC) { + LOGF(fatal, "ResonanceDaughterInitializer not initialized, enable at least one process"); + } + } + + /** + * @brief Fills track data + * + * @tparam isMC Boolean indicating if it's MC + * @tparam TrackType Type of track + * @tparam CollisionType Type of collision + * @param collision Collision data + * @param tracks Track data + */ + template + void fillTracks(CollisionType const& collision, TrackType const& tracks) + { + // Loop over tracks + for (auto const& track : tracks) { + if (cfgFillQA) { + qaRegistry.fill(HIST("QA/hGoodTrackIndices"), 0); + qaRegistry.fill(HIST("QA/hTrackPt"), track.pt()); + qaRegistry.fill(HIST("QA/hTrackEta"), track.eta()); + qaRegistry.fill(HIST("QA/hTrackPhi"), track.phi()); + } + reso2trks(collision.globalIndex(), + track.globalIndex(), + track.pt(), + track.px(), + track.py(), + track.pz(), + track.eta(), + track.phi(), + track.sign(), + (uint8_t)track.tpcNClsCrossedRows(), + (uint8_t)track.tpcNClsFound(), + (uint8_t)track.itsNCls(), + track.dcaXY(), + track.dcaZ(), + track.x(), + track.alpha(), + track.hasITS(), + track.hasTPC(), + track.hasTOF(), + track.tpcNSigmaPi(), + track.tpcNSigmaKa(), + track.tpcNSigmaPr(), + track.tpcNSigmaEl(), + track.tofNSigmaPi(), + track.tofNSigmaKa(), + track.tofNSigmaPr(), + track.tofNSigmaEl(), + track.tpcSignal(), + track.passedITSRefit(), + track.passedTPCRefit(), + track.isGlobalTrackWoDCA(), + track.isGlobalTrack(), + track.isPrimaryTrack(), + track.isPVContributor(), + track.tpcCrossedRowsOverFindableCls(), + track.itsChi2NCl(), + track.tpcChi2NCl()); + if constexpr (isMC) { + fillMCTrack(track); + } + } + } + + /** + * @brief Fills MC track data + * + * @tparam TrackType Type of track + * @param track Track data + */ + template + void fillMCTrack(TrackType const& track) + { + // ------ Temporal lambda function to prevent error in build + auto getMothersIndeces = [&](auto const& theMcParticle) { + std::vector lMothersIndeces{}; + for (auto const& lMother : theMcParticle.template mothers_as()) { + LOGF(debug, " mother index lMother: %d", lMother.globalIndex()); + lMothersIndeces.push_back(lMother.globalIndex()); + } + return lMothersIndeces; + }; + auto getMothersPDGCodes = [&](auto const& theMcParticle) { + std::vector lMothersPDGs{}; + for (auto const& lMother : theMcParticle.template mothers_as()) { + LOGF(debug, " mother pdgcode lMother: %d", lMother.pdgCode()); + lMothersPDGs.push_back(lMother.pdgCode()); + } + return lMothersPDGs; + }; + auto getSiblingsIndeces = [&](auto const& theMcParticle) { + std::vector lSiblingsIndeces{}; + for (auto const& lMother : theMcParticle.template mothers_as()) { + LOGF(debug, " mother index lMother: %d", lMother.globalIndex()); + for (auto const& lDaughter : lMother.template daughters_as()) { + LOGF(debug, " daughter index lDaughter: %d", lDaughter.globalIndex()); + if (lDaughter.globalIndex() != 0 && lDaughter.globalIndex() != theMcParticle.globalIndex()) { + lSiblingsIndeces.push_back(lDaughter.globalIndex()); + } + } + } + return lSiblingsIndeces; + }; + // ------ + std::vector mothers = {-1, -1}; + std::vector motherPDGs = {-1, -1}; + int siblings[2] = {0, 0}; + std::vector siblingsTemp = {-1, -1}; + if (track.has_mcParticle()) { + if (cfgFillQA) { + qaRegistry.fill(HIST("QA/hGoodMCTrackIndices"), 0); + } + // Get the MC particle + const auto& particle = track.mcParticle(); + if (particle.has_mothers()) { + mothers = getMothersIndeces(particle); + motherPDGs = getMothersPDGCodes(particle); + siblingsTemp = getSiblingsIndeces(particle); + } + while (mothers.size() > 2) { + mothers.pop_back(); + motherPDGs.pop_back(); + } + if (siblingsTemp.size() > 0) + siblings[0] = siblingsTemp[0]; + if (siblingsTemp.size() > 1) + siblings[1] = siblingsTemp[1]; + reso2mctracks(particle.pdgCode(), + mothers[0], + motherPDGs[0], + siblings, + particle.isPhysicalPrimary(), + particle.producedByGenerator()); + } else { + // No MC particle associated + reso2mctracks(0, + mothers[0], + motherPDGs[0], + siblings, + 0, + 0); + } + } + + /** + * @brief Fills V0 data + * + * @tparam isMC Boolean indicating if it's MC + * @tparam CollisionType Type of collision + * @tparam V0Type Type of V0 + * @tparam TrackType Type of track + * @param collision Collision data + * @param v0s V0 data + * @param tracks Track data + */ + template + void fillV0s(CollisionType const& collision, V0Type const& v0s, TrackType const&) + { + int childIDs[2] = {0, 0}; // these IDs are necessary to keep track of the children + for (auto const& v0 : v0s) { + if (cfgFillQA) { + qaRegistry.fill(HIST("QA/hGoodV0Indices"), 0); + qaRegistry.fill(HIST("QA/hV0Radius"), v0.v0radius()); + qaRegistry.fill(HIST("QA/hV0CosPA"), v0.v0cosPA()); + } + childIDs[0] = v0.posTrackId(); + childIDs[1] = v0.negTrackId(); + reso2v0s(collision.globalIndex(), + v0.globalIndex(), + v0.pt(), + v0.px(), + v0.py(), + v0.pz(), + v0.eta(), + v0.phi(), + childIDs, + v0.template posTrack_as().tpcNSigmaPi(), + v0.template posTrack_as().tpcNSigmaKa(), + v0.template posTrack_as().tpcNSigmaPr(), + v0.template negTrack_as().tpcNSigmaPi(), + v0.template negTrack_as().tpcNSigmaKa(), + v0.template negTrack_as().tpcNSigmaPr(), + v0.template negTrack_as().tofNSigmaPi(), + v0.template negTrack_as().tofNSigmaKa(), + v0.template negTrack_as().tofNSigmaPr(), + v0.template posTrack_as().tofNSigmaPi(), + v0.template posTrack_as().tofNSigmaKa(), + v0.template posTrack_as().tofNSigmaPr(), + v0.v0cosPA(), + v0.dcaV0daughters(), + v0.dcapostopv(), + v0.dcanegtopv(), + v0.dcav0topv(), + v0.mLambda(), + v0.mAntiLambda(), + v0.mK0Short(), + v0.v0radius(), v0.x(), v0.y(), v0.z()); + if constexpr (isMC) { + fillMCV0(v0); + } + } + } + + /** + * @brief Fills MC V0 data + * + * @tparam V0Type Type of V0 + * @param v0 V0 data + */ + template + void fillMCV0(V0Type const& v0) + { + // ------ Temporal lambda function to prevent error in build + auto getMothersIndeces = [&](auto const& theMcParticle) { + std::vector lMothersIndeces{}; + for (auto const& lMother : theMcParticle.template mothers_as()) { + LOGF(debug, " mother index lMother: %d", lMother.globalIndex()); + lMothersIndeces.push_back(lMother.globalIndex()); + } + return lMothersIndeces; + }; + auto getMothersPDGCodes = [&](auto const& theMcParticle) { + std::vector lMothersPDGs{}; + for (auto const& lMother : theMcParticle.template mothers_as()) { + LOGF(debug, " mother pdgcode lMother: %d", lMother.pdgCode()); + lMothersPDGs.push_back(lMother.pdgCode()); + } + return lMothersPDGs; + }; + auto getDaughtersIndeces = [&](auto const& theMcParticle) { + std::vector lDaughtersIndeces{}; + for (auto const& lDaughter : theMcParticle.template daughters_as()) { + LOGF(debug, " daughter index lDaughter: %d", lDaughter.globalIndex()); + if (lDaughter.globalIndex() != 0) { + lDaughtersIndeces.push_back(lDaughter.globalIndex()); + } + } + return lDaughtersIndeces; + }; + auto getDaughtersPDGCodes = [&](auto const& theMcParticle) { + std::vector lDaughtersPDGs{}; + for (auto const& lDaughter : theMcParticle.template daughters_as()) { + LOGF(debug, " daughter pdgcode lDaughter: %d", lDaughter.pdgCode()); + if (lDaughter.globalIndex() != 0) { + lDaughtersPDGs.push_back(lDaughter.pdgCode()); + } + } + return lDaughtersPDGs; + }; + // ------ + std::vector mothers = {-1, -1}; + std::vector motherPDGs = {-1, -1}; + std::vector daughters = {-1, -1}; + std::vector daughterPDGs = {-1, -1}; + if (v0.has_mcParticle()) { + if (cfgFillQA) { + qaRegistry.fill(HIST("QA/hGoodMCV0Indices"), 0); + } + auto v0mc = v0.mcParticle(); + if (v0mc.has_mothers()) { + mothers = getMothersIndeces(v0mc); + motherPDGs = getMothersPDGCodes(v0mc); + } + while (mothers.size() > 2) { + mothers.pop_back(); + motherPDGs.pop_back(); + } + if (v0mc.has_daughters()) { + daughters = getDaughtersIndeces(v0mc); + daughterPDGs = getDaughtersPDGCodes(v0mc); + } + while (daughters.size() > 2) { + LOGF(info, "daughters.size() is larger than 2"); + daughters.pop_back(); + daughterPDGs.pop_back(); + } + reso2mcv0s(v0mc.pdgCode(), + mothers[0], + motherPDGs[0], + daughters[0], + daughters[1], + daughterPDGs[0], + daughterPDGs[1], + v0mc.isPhysicalPrimary(), + v0mc.producedByGenerator()); + } else { + reso2mcv0s(0, + mothers[0], + motherPDGs[0], + daughters[0], + daughters[1], + daughterPDGs[0], + daughterPDGs[1], + 0, + 0); + } + } + + /** + * @brief Fills cascade data + * + * @tparam isMC Boolean indicating if it's MC + * @tparam CollisionType Type of collision + * @tparam CascType Type of cascade + * @tparam TrackType Type of track + * @param collision Collision data + * @param cascades Cascade data + * @param tracks Track data + */ + template + void fillCascades(CollisionType const& collision, CascType const& cascades, TrackType const&) + { + int childIDs[3] = {0, 0, 0}; // these IDs are necessary to keep track of the children + for (auto const& casc : cascades) { + if (cfgFillQA) { + qaRegistry.fill(HIST("QA/hGoodCascIndices"), 0); + qaRegistry.fill(HIST("QA/hCascRadius"), casc.cascradius()); + qaRegistry.fill(HIST("QA/hCascCosPA"), casc.casccosPA(collision.posX(), collision.posY(), collision.posZ())); + } + childIDs[0] = casc.posTrackId(); + childIDs[1] = casc.negTrackId(); + childIDs[2] = casc.bachelorId(); + reso2cascades(collision.globalIndex(), + casc.globalIndex(), + casc.pt(), + casc.px(), + casc.py(), + casc.pz(), + casc.eta(), + casc.phi(), + childIDs, + casc.template posTrack_as().tpcNSigmaPi(), + casc.template posTrack_as().tpcNSigmaKa(), + casc.template posTrack_as().tpcNSigmaPr(), + casc.template negTrack_as().tpcNSigmaPi(), + casc.template negTrack_as().tpcNSigmaKa(), + casc.template negTrack_as().tpcNSigmaPr(), + casc.template bachelor_as().tpcNSigmaPi(), + casc.template bachelor_as().tpcNSigmaKa(), + casc.template bachelor_as().tpcNSigmaPr(), + casc.template posTrack_as().tofNSigmaPi(), + casc.template posTrack_as().tofNSigmaKa(), + casc.template posTrack_as().tofNSigmaPr(), + casc.template negTrack_as().tofNSigmaPi(), + casc.template negTrack_as().tofNSigmaKa(), + casc.template negTrack_as().tofNSigmaPr(), + casc.template bachelor_as().tofNSigmaPi(), + casc.template bachelor_as().tofNSigmaKa(), + casc.template bachelor_as().tofNSigmaPr(), + casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()), + casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()), + casc.dcaV0daughters(), + casc.dcacascdaughters(), + casc.dcapostopv(), + casc.dcanegtopv(), + casc.dcabachtopv(), + casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()), + casc.dcaXYCascToPV(), + casc.dcaZCascToPV(), + casc.sign(), + casc.mXi(), + casc.v0radius(), casc.cascradius(), casc.x(), casc.y(), casc.z()); + if constexpr (isMC) { + fillMCCascade(casc); + } + } + } + + /** + * @brief Fills MC cascade data + * + * @tparam CascType Type of cascade + * @param casc Cascade data + */ + template + void fillMCCascade(CascType const& casc) + { + // ------ Temporal lambda function to prevent error in build + auto getMothersIndeces = [&](auto const& theMcParticle) { + std::vector lMothersIndeces{}; + for (auto const& lMother : theMcParticle.template mothers_as()) { + LOGF(debug, " mother index lMother: %d", lMother.globalIndex()); + lMothersIndeces.push_back(lMother.globalIndex()); + } + return lMothersIndeces; + }; + auto getMothersPDGCodes = [&](auto const& theMcParticle) { + std::vector lMothersPDGs{}; + for (auto const& lMother : theMcParticle.template mothers_as()) { + LOGF(debug, " mother pdgcode lMother: %d", lMother.pdgCode()); + lMothersPDGs.push_back(lMother.pdgCode()); + } + return lMothersPDGs; + }; + auto getDaughtersIndeces = [&](auto const& theMcParticle) { + std::vector lDaughtersIndeces{}; + for (auto const& lDaughter : theMcParticle.template daughters_as()) { + LOGF(debug, " daughter index lDaughter: %d", lDaughter.globalIndex()); + if (lDaughter.globalIndex() != 0) { + lDaughtersIndeces.push_back(lDaughter.globalIndex()); + } + } + return lDaughtersIndeces; + }; + auto getDaughtersPDGCodes = [&](auto const& theMcParticle) { + std::vector lDaughtersPDGs{}; + for (auto const& lDaughter : theMcParticle.template daughters_as()) { + LOGF(debug, " daughter pdgcode lDaughter: %d", lDaughter.pdgCode()); + if (lDaughter.globalIndex() != 0) { + lDaughtersPDGs.push_back(lDaughter.pdgCode()); + } + } + return lDaughtersPDGs; + }; + // ------ + std::vector mothers = {-1, -1}; + std::vector motherPDGs = {-1, -1}; + std::vector daughters = {-1, -1}; + std::vector daughterPDGs = {-1, -1}; + if (casc.has_mcParticle()) { + if (cfgFillQA) { + qaRegistry.fill(HIST("QA/hGoodMCCascIndices"), 0); + } + auto cascmc = casc.mcParticle(); + if (cascmc.has_mothers()) { + mothers = getMothersIndeces(cascmc); + motherPDGs = getMothersPDGCodes(cascmc); + } + while (mothers.size() > 2) { + mothers.pop_back(); + motherPDGs.pop_back(); + } + if (cascmc.has_daughters()) { + daughters = getDaughtersIndeces(cascmc); + daughterPDGs = getDaughtersPDGCodes(cascmc); + } + while (daughters.size() > 2) { + LOGF(info, "daughters.size() is larger than 2"); + daughters.pop_back(); + daughterPDGs.pop_back(); + } + reso2mccascades(cascmc.pdgCode(), + mothers[0], + motherPDGs[0], + daughters[0], + daughters[1], + daughterPDGs[0], + daughterPDGs[1], + cascmc.isPhysicalPrimary(), + cascmc.producedByGenerator()); + } else { + reso2mccascades(0, + mothers[0], + motherPDGs[0], + daughters[0], + daughters[1], + daughterPDGs[0], + daughterPDGs[1], + 0, + 0); + } + } + + /** + * @brief Processes dummy + * + * @param collision Collision data + */ + void processDummy(aod::ResoCollision const&) + { + } + PROCESS_SWITCH(ResonanceDaughterInitializer, processDummy, "Process dummy", true); + + /** + * @brief Processes data tracks + * + * @param collision Collision data + * @param tracks Track data + */ + void processData(aod::ResoCollision const& collision, + soa::Filtered const& tracks) + { + fillTracks(collision, tracks); + } + PROCESS_SWITCH(ResonanceDaughterInitializer, processData, "Process tracks for data", false); + + /** + * @brief Processes MC tracks + * + * @param collision Collision data + * @param tracks Track data + * @param mcParticles MC particles + */ + void processMC(aod::ResoCollision const& collision, + soa::Filtered const& tracks, + aod::McParticles const&) + { + fillTracks(collision, tracks); + } + PROCESS_SWITCH(ResonanceDaughterInitializer, processMC, "Process tracks for MC", false); + + /** + * @brief Processes V0 data + * + * @param collision Collision data + * @param v0s V0 data + * @param tracks Track data + */ + void processV0Data(aod::ResoCollision const& collision, soa::Filtered const& v0s, aod::ResoTrackCandidates const& tracks) + { + fillV0s(collision, v0s, tracks); + } + PROCESS_SWITCH(ResonanceDaughterInitializer, processV0Data, "Process V0s for data", false); + + /** + * @brief Processes MC V0 data + * + * @param collision Collision data + * @param v0s V0 data + * @param tracks Track data + */ + void processV0MC(aod::ResoCollision const& collision, soa::Filtered const& v0s, aod::ResoTrackCandidatesMC const& tracks) + { + fillV0s(collision, v0s, tracks); + } + PROCESS_SWITCH(ResonanceDaughterInitializer, processV0MC, "Process V0s for MC", false); + + /** + * @brief Processes cascade data + * + * @param collision Collision data + * @param cascades Cascade data + * @param tracks Track data + */ + void processCascData(aod::ResoCollision const& collision, soa::Filtered const& cascades, aod::ResoTrackCandidates const& tracks) + { + fillCascades(collision, cascades, tracks); + } + PROCESS_SWITCH(ResonanceDaughterInitializer, processCascData, "Process Cascades for data", false); + + /** + * @brief Processes MC cascade data + * + * @param collision Collision data + * @param cascades Cascade data + * @param tracks Track data + */ + void processCascMC(aod::ResoCollision const& collision, soa::Filtered const& cascades, aod::ResoTrackCandidatesMC const& tracks) + { + fillCascades(collision, cascades, tracks); + } + PROCESS_SWITCH(ResonanceDaughterInitializer, processCascMC, "Process Cascades for MC", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/Tasks/Resonances/xi1530Analysis.cxx b/PWGLF/Tasks/Resonances/xi1530Analysis.cxx index be3c24b8ffb..73694dda058 100644 --- a/PWGLF/Tasks/Resonances/xi1530Analysis.cxx +++ b/PWGLF/Tasks/Resonances/xi1530Analysis.cxx @@ -15,6 +15,7 @@ #include #include +#include #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/Centrality.h" @@ -342,7 +343,7 @@ struct cascadeXiAnalysis { for (auto const& casc : cascTracks) { histos.fill(HIST("QA_Casc_Xi/h1d_mass_Xi"), casc.mXi()); histos.fill(HIST("QA_Casc_Xi/h1d_v0_radius"), casc.transRadius()); - histos.fill(HIST("QA_Casc_Xi/h1d_casc_radius"), casc.casctransRadius()); + histos.fill(HIST("QA_Casc_Xi/h1d_casc_radius"), casc.cascTransRadius()); histos.fill(HIST("QA_Casc_Xi/h1d_v0_cosPA"), casc.v0CosPA()); histos.fill(HIST("QA_Casc_Xi/h1d_casc_cosPA"), casc.cascCosPA()); histos.fill(HIST("QA_Casc_Xi/h1d_dca_postoPV"), casc.dcapostopv()); @@ -350,7 +351,7 @@ struct cascadeXiAnalysis { histos.fill(HIST("QA_Casc_Xi/h1d_dca_bachtoPV"), casc.dcabachtopv()); histos.fill(HIST("QA_Casc_Xi/h1d_dca_v0toPV"), casc.dcav0topv()); histos.fill(HIST("QA_Casc_Xi/h1d_dca_v0_dau"), casc.daughDCA()); - histos.fill(HIST("QA_Casc_Xi/h1d_dca_casc_dau"), casc.cascdaughDCA()); + histos.fill(HIST("QA_Casc_Xi/h1d_dca_casc_dau"), casc.cascDaughDCA()); } fillDataHisto(cascTracks, resoTracks, resoCollision.cent()); diff --git a/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx b/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx index 6781fdffdaf..0e90a84101e 100644 --- a/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx +++ b/PWGLF/Tasks/Resonances/xi1530Analysisqa.cxx @@ -489,11 +489,11 @@ struct xi1530analysisqa { // Topological Cuts for Cascades if (track.dcabachtopv() < cDCABachlorToPVcut) return false; - if (track.cascdaughDCA() > cDCAXiDaugtherscut) + if (track.cascDaughDCA() > cDCAXiDaugtherscut) return false; if (track.cascCosPA() < cCosPACasc) return false; - if (track.casctransRadius() > cMaxCascradiuscut || track.casctransRadius() < cMinCascradiuscut) + if (track.cascTransRadius() > cMaxCascradiuscut || track.cascTransRadius() < cMinCascradiuscut) return false; // if (std::abs(track.mXi() - XiMass) > cMasswindowCasccut) // return false; diff --git a/PWGLF/Utils/collisionCuts.h b/PWGLF/Utils/collisionCuts.h index a272cb32670..6322e272083 100644 --- a/PWGLF/Utils/collisionCuts.h +++ b/PWGLF/Utils/collisionCuts.h @@ -24,8 +24,6 @@ #include "Framework/Logger.h" #include "Common/DataModel/EventSelection.h" -using namespace o2::framework; - namespace o2::analysis { @@ -79,26 +77,26 @@ class CollisonCuts /// Initializes histograms for the task /// \param registry Histogram registry to be passed - void init(HistogramRegistry* registry) + void init(o2::framework::HistogramRegistry* registry) { if (!mCutsSet) { LOGF(error, "Event selection not set - quitting!"); } mHistogramRegistry = registry; - mHistogramRegistry->add("Event/posZ", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram after event selections - mHistogramRegistry->add("Event/posZ_noCut", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram before all selections + mHistogramRegistry->add("Event/posZ", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram after event selections + mHistogramRegistry->add("Event/posZ_noCut", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); // z-vertex histogram before all selections if (mCheckIsRun3) { - mHistogramRegistry->add("Event/CentFV0A", "; vCentV0A; Entries", kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/CentFT0M", "; vCentT0M; Entries", kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/CentFT0C", "; vCentT0C; Entries", kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/CentFT0A", "; vCentT0A; Entries", kTH1F, {{110, 0, 110}}); - mHistogramRegistry->add("Event/posZ_ITSOnly", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); - mHistogramRegistry->add("Event/posZ_ITSTPC", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); - mHistogramRegistry->add("Event/trackOccupancyInTimeRange_noCut", "; Occupancy; Entries", kTH1F, {{500, 0., 20000.}}); + mHistogramRegistry->add("Event/CentFV0A", "; vCentV0A; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentFT0M", "; vCentT0M; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentFT0C", "; vCentT0C; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentFT0A", "; vCentT0A; Entries", o2::framework::kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/posZ_ITSOnly", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); + mHistogramRegistry->add("Event/posZ_ITSTPC", "; vtx_{z} (cm); Entries", o2::framework::kTH1F, {{250, -12.5, 12.5}}); + mHistogramRegistry->add("Event/trackOccupancyInTimeRange_noCut", "; Occupancy; Entries", o2::framework::kTH1F, {{500, 0., 20000.}}); } else { - mHistogramRegistry->add("Event/CentRun2V0M", "; vCentV0M; Entries", kTH1F, {{110, 0, 110}}); + mHistogramRegistry->add("Event/CentRun2V0M", "; vCentV0M; Entries", o2::framework::kTH1F, {{110, 0, 110}}); } - mHistogramRegistry->add("CollCutCounts", "; ; Entries", kTH1F, {{11, 0., 11.}}); + mHistogramRegistry->add("CollCutCounts", "; ; Entries", o2::framework::kTH1F, {{11, 0., 11.}}); mHistogramRegistry->get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(binLabel(EvtSel::kAllEvent), "all"); mHistogramRegistry->get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(binLabel(EvtSel::kFlagZvertex), "Zvtx"); mHistogramRegistry->get(HIST("CollCutCounts"))->GetXaxis()->SetBinLabel(binLabel(EvtSel::kFlagTrigerTVX), "IsTriggerTVX"); @@ -221,6 +219,11 @@ class CollisonCuts LOGF(debug, "Offline selection failed (sel7)"); return false; } + auto bc = col.template bc_as(); + if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) { + LOGF(debug, "Offline selection failed (AliEventCuts)"); + return false; + } mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagTrigerTVX); } if (mCheckTrigger && !col.alias_bit(mTrigger)) { @@ -273,23 +276,24 @@ class CollisonCuts } private: - HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output - bool mCutsSet = false; ///< Protection against running without cuts - bool mCheckTrigger = false; ///< Check for trigger - bool mTriggerTVXselection = false; ///< Check for trigger TVX selection - bool mCheckOffline = false; ///< Check for offline criteria (might change) - bool mCheckIsRun3 = false; ///< Check if running on Pilot Beam - bool mInitialTriggerScan = false; ///< Check trigger when the event is first selected - bool mApplyTFBorderCut = false; ///< Apply time frame border cut - bool mApplyITSTPCvertex = false; ///< Apply at least one ITS-TPC track for vertexing - bool mApplyZvertexTimedifference = false; ///< removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference. - bool mApplyPileupRejection = false; ///< Pileup rejection - bool mApplyNoITSROBorderCut = false; ///< Apply NoITSRO frame border cut - bool mApplyCollInTimeRangeStandard = false; ///< Apply NoCollInTimeRangeStandard selection - int mTrigger = kINT7; ///< Trigger to check for - float mZvtxMax = 999.f; ///< Maximal deviation from nominal z-vertex (cm) - int mtrackOccupancyInTimeRangeMax = -1; ///< Maximum trackOccupancyInTimeRange cut (-1 no cut) - int mtrackOccupancyInTimeRangeMin = -1; ///< Minimum trackOccupancyInTimeRange cut (-1 no cut) + using BCsWithRun2Info = soa::Join; + o2::framework::HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output + bool mCutsSet = false; ///< Protection against running without cuts + bool mCheckTrigger = false; ///< Check for trigger + bool mTriggerTVXselection = false; ///< Check for trigger TVX selection + bool mCheckOffline = false; ///< Check for offline criteria (might change) + bool mCheckIsRun3 = false; ///< Check if running on Pilot Beam + bool mInitialTriggerScan = false; ///< Check trigger when the event is first selected + bool mApplyTFBorderCut = false; ///< Apply time frame border cut + bool mApplyITSTPCvertex = false; ///< Apply at least one ITS-TPC track for vertexing + bool mApplyZvertexTimedifference = false; ///< removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference. + bool mApplyPileupRejection = false; ///< Pileup rejection + bool mApplyNoITSROBorderCut = false; ///< Apply NoITSRO frame border cut + bool mApplyCollInTimeRangeStandard = false; ///< Apply NoCollInTimeRangeStandard selection + int mTrigger = kINT7; ///< Trigger to check for + float mZvtxMax = 999.f; ///< Maximal deviation from nominal z-vertex (cm) + int mtrackOccupancyInTimeRangeMax = -1; ///< Maximum trackOccupancyInTimeRange cut (-1 no cut) + int mtrackOccupancyInTimeRangeMin = -1; ///< Minimum trackOccupancyInTimeRange cut (-1 no cut) }; } // namespace o2::analysis From d8afcaf84902cc37aeaa728c69ef61bfc666fed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jura=C4=8Dka?= <137087737+jjuracka@users.noreply.github.com> Date: Tue, 10 Dec 2024 20:18:01 +0100 Subject: [PATCH 313/459] [PWGUD] QA updates to upcRhoAnalysis.cxx (#8909) --- PWGUD/Tasks/upcRhoAnalysis.cxx | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/PWGUD/Tasks/upcRhoAnalysis.cxx b/PWGUD/Tasks/upcRhoAnalysis.cxx index 8684bf99550..597f4945a3f 100644 --- a/PWGUD/Tasks/upcRhoAnalysis.cxx +++ b/PWGUD/Tasks/upcRhoAnalysis.cxx @@ -61,10 +61,10 @@ DECLARE_SOA_COLUMN(TimeFV0A, timeFV0A, float); DECLARE_SOA_COLUMN(TimeFDDA, timeFDDA, float); DECLARE_SOA_COLUMN(TimeFDDC, timeFDDC, float); // ZDC info -// DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); -// DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float); -// DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); -// DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); +DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); +DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float); +DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); +DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); DECLARE_SOA_COLUMN(NeutronClass, neutronClass, int); // Rhos DECLARE_SOA_COLUMN(TotalCharge, totalCharge, int); @@ -94,7 +94,7 @@ DECLARE_SOA_TABLE(Tree, "AOD", "TREE", tree::RunNumber, tree::GlobalBC, tree::NumContrib, tree::PosX, tree::PosY, tree::PosZ, tree::TotalFT0AmplitudeA, tree::TotalFT0AmplitudeC, tree::TotalFV0AmplitudeA, tree::TotalFDDAmplitudeA, tree::TotalFDDAmplitudeC, tree::TimeFT0A, tree::TimeFT0C, tree::TimeFV0A, tree::TimeFDDA, tree::TimeFDDC, - /* tree::EnergyCommonZNA, tree::EnergyCommonZNC, tree::TimeZNA, tree::TimeZNC, */ tree::NeutronClass, + tree::EnergyCommonZNA, tree::EnergyCommonZNC, tree::TimeZNA, tree::TimeZNC, tree::NeutronClass, tree::TotalCharge, tree::RhoPt, tree::RhoEta, tree::RhoPhi, tree::RhoM, tree::RhoPhiRandom, tree::RhoPhiCharge, tree::TrackSign, tree::TrackPt, tree::TrackEta, tree::TrackPhi, tree::TrackM, tree::TrackPiPID, tree::TrackElPID, tree::TrackDcaXY, tree::TrackDcaZ, tree::TrackTpcSignal); } // namespace o2::aod @@ -133,7 +133,8 @@ struct upcRhoAnalysis { ConfigurableAxis pt2Axis{"pt2Axis", {100, 0.0, 0.01}, "p_{T}^{2} (GeV^{2}/#it{c}^{2})"}; ConfigurableAxis etaAxis{"etaAxis", {800, -4.0, 4.0}, "#eta"}; ConfigurableAxis etaCutAxis{"etaCutAxis", {180, -0.9, 0.9}, "#eta"}; - ConfigurableAxis yAxis{"yAxis", {180, -0.9, 0.9}, "y"}; + ConfigurableAxis yAxis{"yAxis", {400, -4.0, 4.0}, "y"}; + ConfigurableAxis yCutAxis{"yCutAxis", {180, -0.9, 0.9}, "y"}; ConfigurableAxis phiAxis{"phiAxis", {180, 0.0, o2::constants::math::TwoPI}, "#phi"}; ConfigurableAxis phiAsymmAxis{"phiAsymmAxis", {182, -o2::constants::math::PI, o2::constants::math::PI}, "#phi"}; ConfigurableAxis momentumFromPhiAxis{"momentumFromPhiAxis", {400, -0.1, 0.1}, "p (GeV/#it{c})"}; @@ -448,6 +449,7 @@ struct upcRhoAnalysis { MC.add("MC/collisions/hPosXY", ";x (cm);y (cm);counts", kTH2D, {{2000, -0.1, 0.1}, {2000, -0.1, 0.1}}); MC.add("MC/collisions/hPosZ", ";z (cm);counts", kTH1D, {{400, -20.0, 20.0}}); MC.add("MC/collisions/hNPions", ";number of pions;counts", kTH1D, {{11, -0.5, 10.5}}); + MC.add("MC/collisions/hNumOfCollisionRecos", ";number of collision reconstructions;counts", kTH1D, {{11, -0.5, 10.5}}); MC.add("MC/tracks/all/hPdgCode", ";pdg code;counts", kTH1D, {{2001, -1000.5, 1000.5}}); MC.add("MC/tracks/all/hProducedByGenerator", ";produced by generator;counts", kTH1D, {{2, -0.5, 1.5}}); @@ -772,7 +774,7 @@ struct upcRhoAnalysis { collision.posX(), collision.posY(), collision.posZ(), collision.totalFT0AmplitudeA(), collision.totalFT0AmplitudeC(), collision.totalFV0AmplitudeA(), collision.totalFDDAmplitudeA(), collision.totalFDDAmplitudeC(), collision.timeFT0A(), collision.timeFT0C(), collision.timeFV0A(), collision.timeFDDA(), collision.timeFDDC(), - /* collision.energyCommonZNA(), collision.energyCommonZNC(), collision.timeZNA(), collision.timeZNC(), */ neutronClass, + collision.energyCommonZNA(), collision.energyCommonZNC(), collision.timeZNA(), collision.timeZNC(), neutronClass, totalCharge, pT, system.Eta(), system.Phi(), mass, phiRandom, phiCharge, trackSigns, trackPts, trackEtas, trackPhis, trackMs, trackPiPIDs, trackElPIDs, trackDcaXYs, trackDcaZs, trackTpcSignals); // fill raw histograms according to the total charge @@ -1125,6 +1127,12 @@ struct upcRhoAnalysis { MC.fill(HIST("MC/system/hPhiCharge"), phiCharge); } + template + void checkNumberOfCollisionReconstructions(C const& collisions) + { + MC.fill(HIST("MC/collisions/hNumOfCollisionRecos"), collisions.size()); + } + void processSGdata(FullUdSgCollision const& collision, FullUdTracks const& tracks) { if (collision.gapSide() != 2) @@ -1144,6 +1152,12 @@ struct upcRhoAnalysis { processMC(mcCollision, mcParticles); } PROCESS_SWITCH(upcRhoAnalysis, processMCdata, "analyse MC data", false); + + void processCollisionRecoCheck(aod::McCollision const& /* mcCollision */, soa::SmallGroups> const& collisions) + { + checkNumberOfCollisionReconstructions(collisions); + } + PROCESS_SWITCH(upcRhoAnalysis, processCollisionRecoCheck, "check number of collision reconstructions", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 0bd69ae72c76f54005065559b895562040d1ecb6 Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Tue, 10 Dec 2024 22:04:18 +0100 Subject: [PATCH 314/459] [PWGCF] adding decay mask to second track (#8897) Co-authored-by: junleekim --- PWGCF/Tasks/correlations.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PWGCF/Tasks/correlations.cxx b/PWGCF/Tasks/correlations.cxx index 067e73d6425..850cdd4d455 100644 --- a/PWGCF/Tasks/correlations.cxx +++ b/PWGCF/Tasks/correlations.cxx @@ -267,6 +267,10 @@ struct CorrelationTask { for (const auto& track2 : tracks2) { if constexpr (std::experimental::is_detected::value && std::experimental::is_detected::value) { if (doprocessSame2Prong2Prong) { + if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast(track1.decay()))) == 0u) + continue; + if ((track1.decay() != 0) || (track2.decay() != 1)) // D0 in trk1, D0bar in trk2 + continue; registry.fill(HIST("invMassTwoPart"), track1.invMass(), track2.invMass(), track1.pt(), track2.pt(), multiplicity); } } From 52d40e8f2801db9a7e8b23aff26c4ce59a3f59e0 Mon Sep 17 00:00:00 2001 From: abilandz Date: Tue, 10 Dec 2024 22:50:41 +0100 Subject: [PATCH 315/459] [PWGCF] support for EP angle and few more event cuts (#8904) --- .../Core/MuPa-Configurables.h | 15 +- .../Core/MuPa-DataMembers.h | 8 +- .../Core/MuPa-Enums.h | 25 +- .../Core/MuPa-MemberFunctions.h | 352 +++++++++++++----- .../Tasks/multiparticle-correlations-ab.cxx | 5 +- 5 files changed, 301 insertions(+), 104 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h index eab94f015a4..c1aecefbc0e 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h @@ -46,7 +46,7 @@ struct : ConfigurableGroup { Configurable cfCheckUnderflowAndOverflow{"cfCheckUnderflowAndOverflow", false, "check and bail out if in event and particle histograms there are entries which went to underflow or overflow bins (use only locally)"}; Configurable cfRebin{"cfRebin", 1, "number of bins of selected heavy 2D histograms are devided with this number"}; Configurable cfFillQAEventHistograms2D{"cfFillQAEventHistograms2D", false, "if false, all QA 2D event histograms are not filled. if true, only the ones for which fBookQAEventHistograms2D[...] is true, are filled"}; - Configurable> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"1-Multiplicity_vs_ReferenceMultiplicity", "1-Multiplicity_vs_NContributors", "1-Multiplicity_vs_Centrality", "1-Multiplicity_vs_Vertex_z", "1-Multiplicity_vs_Occupancy", "1-ReferenceMultiplicity_vs_NContributors", "1-ReferenceMultiplicity_vs_Centrality", "1-ReferenceMultiplicity_vs_Vertex_z", "1-ReferenceMultiplicity_vs_Occupancy", "1-NContributors_vs_Centrality", "1-NContributors_vs_Vertex_z", "1-NContributors_vs_Occupancy", "1-Centrality_vs_Vertex_z", "1-Centrality_vs_Occupancy", "1-Vertex_z_vs_Occupancy", "0-CentFT0C_vs_CentNTPV", "0-CentFT0M_vs_CentNTPV", "0-CentRun2V0M_vs_CentRun2SPDTracklets", "1-TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange", "1-CurrentRunDuration_vs_InteractionRate"}, "book (1) or do not book (0) this QA 2D event histogram"}; + Configurable> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"1-Multiplicity_vs_ReferenceMultiplicity", "1-Multiplicity_vs_NContributors", "1-Multiplicity_vs_Centrality", "1-Multiplicity_vs_Vertex_z", "1-Multiplicity_vs_Occupancy", "1-ReferenceMultiplicity_vs_NContributors", "1-ReferenceMultiplicity_vs_Centrality", "1-ReferenceMultiplicity_vs_Vertex_z", "1-ReferenceMultiplicity_vs_Occupancy", "1-NContributors_vs_Centrality", "1-NContributors_vs_Vertex_z", "1-NContributors_vs_Occupancy", "1-Centrality_vs_Vertex_z", "1-Centrality_vs_Occupancy", "1-Centrality_vs_ImpactParameter", "1-Vertex_z_vs_Occupancy", "0-MultNTracksPV_vs_MultNTracksGlobal", "0-CentFT0C_vs_CentNTPV", "0-CentFT0M_vs_CentNTPV", "0-CentRun2V0M_vs_CentRun2SPDTracklets", "1-TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange", "1-CurrentRunDuration_vs_InteractionRate"}, "book (1) or do not book (0) this QA 2D event histogram"}; Configurable cfFillQAParticleHistograms2D{"cfFillQAParticleHistograms2D", false, "if false, all QA 2D particle histograms are not filled. if true, only the ones for which fBookQAParticleHistograms2D[...] is true, are filled"}; Configurable> cfBookQAParticleHistograms2D{"cfBookQAParticleHistograms2D", {"1-Pt_vs_dcaXY"}, "book (1) or do not book (0) this QA 2D particle histogram"}; } cf_qa; @@ -54,12 +54,12 @@ struct : ConfigurableGroup { // *) Event histograms: struct : ConfigurableGroup { Configurable cfFillEventHistograms{"cfFillEventHistograms", true, "if false, all event histograms are not filled. if true, only the ones for which fBookEventHistograms[...] is true, are filled"}; - Configurable> cfBookEventHistograms{"cfBookEventHistograms", {"1-NumberOfEvents", "1-TotalMultiplicity", "1-Multiplicity", "1-ReferenceMultiplicity", "1-Centrality", "1-Vertex_x", "1-Vertex_y", "1-Vertex_z", "1-NContributors", "0-ImpactParameter", "1-Occupancy", "1-InteractionRate", "1-CurrentRunDuration", "0-MultMCNParticlesEta08"}, "Book (1) or do not book (0) event histogram"}; + Configurable> cfBookEventHistograms{"cfBookEventHistograms", {"1-NumberOfEvents", "1-TotalMultiplicity", "1-Multiplicity", "1-ReferenceMultiplicity", "1-Centrality", "1-Vertex_x", "1-Vertex_y", "1-Vertex_z", "1-NContributors", "0-ImpactParameter", "0-EventPlaneAngle", "1-Occupancy", "1-InteractionRate", "1-CurrentRunDuration", "0-MultMCNParticlesEta08"}, "Book (1) or do not book (0) event histogram"}; } cf_eh; // *) Event cuts: struct : ConfigurableGroup { - Configurable> cfUseEventCuts{"cfUseEventCuts", {"1-NumberOfEvents", "1-TotalMultiplicity", "1-Multiplicity", "1-ReferenceMultiplicity", "1-Centrality", "1-Vertex_x", "1-Vertex_y", "1-Vertex_z", "1-NContributors", "1-ImpactParameter", "1-Occupancy", "1-InteractionRate", "1-CurrentRunDuration", "0-MultMCNParticlesEta08", "0-Trigger", "0-Sel7", "1-Sel8", "1-MultiplicityEstimator", "1-ReferenceMultiplicityEstimator", "1-CentralityEstimator", "1-SelectedEvents", "1-NoSameBunchPileup", "1-IsGoodZvtxFT0vsPV", "1-IsVertexITSTPC", "1-IsVertexTOFmatched", "1-IsVertexTRDmatched", "1-OccupancyEstimator"}, "use (1) or do not use (0) event cuts"}; + Configurable> cfUseEventCuts{"cfUseEventCuts", {"1-NumberOfEvents", "1-TotalMultiplicity", "1-Multiplicity", "1-ReferenceMultiplicity", "1-Centrality", "1-Vertex_x", "1-Vertex_y", "1-Vertex_z", "1-NContributors", "1-ImpactParameter", "0-EventPlaneAngle", "1-Occupancy", "1-InteractionRate", "1-CurrentRunDuration", "0-MultMCNParticlesEta08", "0-Trigger", "0-Sel7", "1-Sel8", "1-MultiplicityEstimator", "1-ReferenceMultiplicityEstimator", "1-CentralityEstimator", "1-SelectedEvents", "1-NoSameBunchPileup", "1-IsGoodZvtxFT0vsPV", "1-IsVertexITSTPC", "1-IsVertexTOFmatched", "1-IsVertexTRDmatched", "0-NoCollInTimeRangeStrict", "0-NoCollInTimeRangeStandard", "0-NoCollInRofStrict", "0-NoCollInRofStandard", "0-NoHighMultCollInPrevRof", "1-OccupancyEstimator"}, "use (1) or do not use (0) event cuts"}; Configurable cfUseEventCutCounterAbsolute{"cfUseEventCutCounterAbsolute", false, "profile and save how many times each event cut counter triggered (absolute). Use with care, as this is computationally heavy"}; Configurable cfUseEventCutCounterSequential{"cfUseEventCutCounterSequential", false, "profile and save how many times each event cut counter triggered (sequential). Use with care, as this is computationally heavy"}; Configurable cfPrintCutCounterContent{"cfPrintCutCounterContent", false, "if true, prints on the screen after each event the content of fEventCutCounterHist[*][*] (all which were booked)"}; @@ -74,11 +74,12 @@ struct : ConfigurableGroup { Configurable> cfVertex_z{"cfVertex_z", {-10., 10.}, "vertex z position range: {min, max}[cm], with convention: min <= Vz < max"}; Configurable> cfNContributors{"cfNContributors", {2, 1000000000}, "Number of vertex contributors: {min, max}, with convention: min <= N < max"}; Configurable> cfImpactParameter{"cfImpactParameter", {-1, 1000000000}, "Impact parameter range (can be used only for sim): {min, max}, with convention: min <= IP < max"}; + Configurable> cfEventPlaneAngle{"cfEventPlaneAngle", {-1000, 1000000000}, "Event Plane Angle range (can be used only for sim): {min, max}, with convention: min <= EP < max"}; Configurable> cfOccupancy{"cfOccupancy", {-2, 1000000000}, "Range for occupancy (use cfOccupancyEstimator to set specific estimator): {min, max}, with convention: min <= X < max"}; Configurable> cfInteractionRate{"cfInteractionRate", {-2, 1000000000}, "Range for interaction rate: {min, max}, with convention: min <= X < max"}; Configurable> cfCurrentRunDuration{"cfCurrentRunDuration", {-2, 1000000000}, "Range for current run duration (i.e. seconds since start of run) in seconds: {min, max}, with convention: min <= X < max. Only collisions taken in this range (measured from SOR) are taken for analysis"}; Configurable> cfMultMCNParticlesEta08{"cfMultMCNParticlesEta08", {-1, 1000000000}, "Range for MultMCNParticlesEta08 : {min, max}, with convention: min <= X < max"}; - Configurable cfTrigger{"cfTrigger", "some supported trigger (e.g. kINT7, ...)", "set here some supported trigger"}; + Configurable cfTrigger{"cfTrigger", "some supported trigger (e.g. INT7 for Run 2, TVXinTRD for Run 3, etc...)", "set here some supported trigger"}; Configurable cfUseSel7{"cfUseSel7", false, "use for Run 1 and 2 data and MC (see official doc)"}; Configurable cfUseSel8{"cfUseSel8", false, "use for Run 3 data and MC (see official doc)"}; Configurable cfMultiplicityEstimator{"cfMultiplicityEstimator", "SelectedTracks", "all results vs. mult are calculated against this multiplicity. Can be set to SelectedTracks (calculated internally), ReferenceMultiplicity (calculated outside of my code), etc."}; @@ -92,7 +93,11 @@ struct : ConfigurableGroup { Configurable cfUseIsVertexITSTPC{"cfUseIsVertexITSTPC", false, "TBI 20240521 explanation"}; Configurable cfUseIsVertexTOFmatched{"cfUseIsVertexTOFmatched", false, "TBI 20240521 explanation"}; Configurable cfUseIsVertexTRDmatched{"cfUseIsVertexTRDmatched", false, "TBI 20240521 explanation"}; - // Configurable cfOccupancyEstimator{"cfOccupancyEstimator", "some supported occupancy estimator (e.g. TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ...)", "set here some supported occupancy estimator (TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ..."}; + Configurable cfUseNoCollInTimeRangeStrict{"cfUseNoCollInTimeRangeStrict", false, "TBI 20240521 explanation"}; + Configurable cfUseNoCollInTimeRangeStandard{"cfUseNoCollInTimeRangeStandard", false, "TBI 20240521 explanation"}; + Configurable cfUseNoCollInRofStrict{"cfUseNoCollInRofStrict", false, "TBI 20240521 explanation"}; + Configurable cfUseNoCollInRofStandard{"cfUseNoCollInRofStandard", false, "TBI 20240521 explanation"}; + Configurable cfUseNoHighMultCollInPrevRof{"cfUseNoHighMultCollInPrevRof", false, "TBI 20240521 explanation"}; Configurable cfOccupancyEstimator{"cfOccupancyEstimator", "FT0COccupancyInTimeRange", "set here some supported occupancy estimator (TrackOccupancyInTimeRange, FT0COccupancyInTimeRange, ..."}; } cf_ec; diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h index 8878439b7e3..c27345ad515 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h @@ -200,7 +200,7 @@ struct Qvector { struct MultiparticleCorrelations { TList* fCorrelationsList = NULL; // list to hold all correlations objects TProfile* fCorrelationsFlagsPro = NULL; // profile to hold all flags for correlations - Bool_t fCalculateCorrelations = kTRUE; // calculate and store integrated correlations + bool fCalculateCorrelations = false; // calculate and store integrated correlations TProfile* fCorrelationsPro[4][gMaxHarmonic][eAsFunctionOf_N] = {{{NULL}}}; //! multiparticle correlations // [2p=0,4p=1,6p=2,8p=3][n=1,n=2,...,n=gMaxHarmonic] // [0=integrated,1=vs. multiplicity,2=vs. centrality,3=pT,4=eta,5=vs. occupancy] @@ -300,15 +300,15 @@ struct EtaSeparations { TProfile* fEtaSeparationsPro[gMaxHarmonic][gMaxNumberEtaSeparations][eAsFunctionOf_N]; // [harmonic, 0 = v1, 8 = v9][ different eta Separations - see that enum ] [ AFO ] } es; -// *) Common cosmetics: -struct CommonCosmetics { +// *) Global cosmetics: +struct GlobalCosmetics { TString srs[2] = {"rec", "sim"}; // used in the histogram name as index when saved to the file TString srs_long[2] = {"reconstructed", "simulated"}; // used in the histogram title TString sba[2] = {"before", "after"}; // used in the histogram name as index when saved to the file TString sba_long[2] = {"before cuts", "after cuts"}; // used in the histogram title TString scc[eCutCounter_N] = {"abs", "seq"}; // used in the histogram name as index when saved to the file TString scc_long[eCutCounter_N] = {"absolute", "sequential"}; // used in the histogram title -} cc; +} gc; // *) Results: struct Results { // This is in addition also sort of "abstract" interface, which defines common binning, etc., for other groups of histograms. diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h index 95471505740..e622af63e2d 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h @@ -103,6 +103,7 @@ enum eEventHistograms { eVertex_z, eNContributors, // number of tracks used for the vertex eImpactParameter, + eEventPlaneAngle, eOccupancy, // from helper task o2-analysis-event-selection, see also IA's presentation in https://indico.cern.ch/event/1464946, slide 38. Use specific occupancy estimator via eOccupancyEstimator eInteractionRate, // from utility ctpRateFetcher eCurrentRunDuration, // calculated with utility ctpRateFetcher @@ -113,7 +114,10 @@ enum eEventHistograms { enum eEventCuts { // a) For available event selection bits, check https://github.com/AliceO2Group/O2Physics/blob/master/Common/CCDB/EventSelectionParams.cxx // b) Some settings are configurable, check: https://github.com/AliceO2Group/O2Physics/blob/master/Common/TableProducer/eventSelection.cxx - eTrigger = eEventHistograms_N, // Do NOT use eTrigger for Run 3. Validated only for Run 2, and it has to be "kINT7" . TBI 20240522 investigate for Run 1 + eTrigger = eEventHistograms_N, // Implemented and validated so far: + // a) Run 3: "kTVXinTRD" (use optionally for systematics, and only in real data) + // b) Run 2: "kINT7" (at the moment the usage of this one is enfored in fact) + // c) Run 1: TBI 20241209 check if I can use kINT7 also for Run 1 eSel7, // See def. of sel7 in Ref. b) above. Event selection decision based on V0A & V0C => use only in Run 2 and Run 1. TBI 20240522 I stil need to validate this one over MC eSel8, // See def. of sel7 in Ref. b) above. Event selection decision based on TVX => use only in Run 3, both for data and MC // *) As of 20240410, kNoITSROFrameBorder (only in MC) and kNoTimeFrameBorder event selection cuts are part of Sel8 @@ -127,6 +131,11 @@ enum eEventCuts { eIsVertexITSTPC, // at least one ITS-TPC track (reject vertices built from ITS-only tracks) (emails from IA on 20240404 and EK on 20240410 eIsVertexTOFmatched, // at least one of vertex contributors is matched to TOF eIsVertexTRDmatched, // at least one of vertex contributors is matched to TRD + eNoCollInTimeRangeStrict, // rejects a collision if there are other events in dtime +/- 10 μs, see IA Slide 39 in https://indico.cern.ch/event/1462154/ + eNoCollInTimeRangeStandard, // rejects a collision if there are other events in dtime +/- 2 μs + additional cuts on multiplicity, see IA Slide 39 in https://indico.cern.ch/event/1462154/ + eNoCollInRofStrict, // rejects a collision if there are other events within the same ROF (in-ROF pileup), ROF = "ITS Readout Frames", see IA Slide 39 in https://indico.cern.ch/event/1462154/ + eNoCollInRofStandard, // same as previous + additional cuts on multiplicity, see IA Slide 39 in https://indico.cern.ch/event/1462154/ + eNoHighMultCollInPrevRof, // veto an event if FT0C amplitude in previous ITS ROF is above threshold (default is >5000 a.e. by FT0C), see IA Slide 39 in https://indico.cern.ch/event/1462154/ eOccupancyEstimator, // the default Occupancy estimator, set via configurable. All supported centrality estimators, for QA, etc, are in enum eOccupancyEstimators eEventCuts_N }; @@ -248,15 +257,16 @@ enum eQAEventHistograms2D { eNContributors_vs_Occupancy, eCentrality_vs_Vertex_z, eCentrality_vs_Occupancy, + eCentrality_vs_ImpactParameter, // [sim] = reconstructed centrality vs. simulated impact parameter. [rec] = ... TBI 20241210 eVertex_z_vs_Occupancy, // ... // Specific (everything is hardwired): + eMultNTracksPV_vs_MultNTracksGlobal, // Run 3 multiplicity eCentFT0C_vs_CentNTPV, // Run 3 centrality eCentFT0M_vs_CentNTPV, // Run 3 centrality eCentRun2V0M_vs_CentRun2SPDTracklets, // Run 2 centrality (do not use in Run 1 converted, because there is no centrality information) eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange, - eCurrentRunDuration_vs_InteractionRate, - // ... + eCurrentRunDuration_vs_InteractionRate, // ... eQAEventHistograms2D_N }; @@ -268,10 +278,11 @@ enum eQAParticleHistograms2D { enum eReferenceMultiplicityEstimators { // Run 3: eMultTPC = 0, - eMultFV0M, // ref. mult from helper task o2-analysis-multiplicity-table - eMultFT0C, // ref. mult from helper task o2-analysis-multiplicity-table - eMultFT0M, // ref. mult from helper task o2-analysis-multiplicity-table - eMultNTracksPV, // ref. mult from helper task o2-analysis-multiplicity-table + eMultFV0M, // ref. mult from helper task o2-analysis-multiplicity-table + eMultFT0C, // ref. mult from helper task o2-analysis-multiplicity-table + eMultFT0M, // ref. mult from helper task o2-analysis-multiplicity-table + eMultNTracksPV, // ref. mult from helper task o2-analysis-multiplicity-table + eMultNTracksGlobal, // ref. mult from helper task o2-analysis-multiplicity-table // Run 2: eMultTracklets, // ref. mult from helper task o2-analysis-multiplicity-table, use only for Run 2 eReferenceMultiplicityEstimators_N diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h index 0e2fafcf4e7..869acf1d44b 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h @@ -233,6 +233,7 @@ void DefaultConfiguration() eh.fEventHistogramsName[eVertex_z] = "Vertex_z"; eh.fEventHistogramsName[eNContributors] = "NContributors"; eh.fEventHistogramsName[eImpactParameter] = "ImpactParameter"; + eh.fEventHistogramsName[eEventPlaneAngle] = "EventPlaneAngle"; eh.fEventHistogramsName[eOccupancy] = "Occupancy"; eh.fEventHistogramsName[eInteractionRate] = "InteractionRate"; eh.fEventHistogramsName[eCurrentRunDuration] = "CurrentRunDuration"; @@ -260,6 +261,7 @@ void DefaultConfiguration() ec.fEventCutName[eVertex_z] = "Vertex_z"; ec.fEventCutName[eNContributors] = "NContributors"; ec.fEventCutName[eImpactParameter] = "ImpactParameter"; + ec.fEventCutName[eEventPlaneAngle] = "EventPlaneAngle"; ec.fEventCutName[eOccupancy] = "Occupancy"; ec.fEventCutName[eInteractionRate] = "InteractionRate"; ec.fEventCutName[eCurrentRunDuration] = "CurrentRunDuration"; @@ -276,6 +278,11 @@ void DefaultConfiguration() ec.fEventCutName[eIsVertexITSTPC] = "IsVertexITSTPC"; ec.fEventCutName[eIsVertexTOFmatched] = "IsVertexTOFmatched"; ec.fEventCutName[eIsVertexTRDmatched] = "IsVertexTRDmatched"; + ec.fEventCutName[eNoCollInTimeRangeStrict] = "NoCollInTimeRangeStrict"; + ec.fEventCutName[eNoCollInTimeRangeStandard] = "NoCollInTimeRangeStandard"; + ec.fEventCutName[eNoCollInRofStrict] = "NoCollInRofStrict"; + ec.fEventCutName[eNoCollInRofStandard] = "NoCollInRofStandard"; + ec.fEventCutName[eNoHighMultCollInPrevRof] = "NoHighMultCollInPrevRof"; ec.fEventCutName[eOccupancyEstimator] = "OccupancyEstimator"; for (Int_t t = 0; t < eEventCuts_N; t++) { if (ec.fEventCutName[t].EqualTo("")) { @@ -509,6 +516,7 @@ void DefaultConfiguration() qa.fReferenceMultiplicityEstimatorName[eMultFT0C] = "MultFT0C"; qa.fReferenceMultiplicityEstimatorName[eMultFT0M] = "MultFT0M"; qa.fReferenceMultiplicityEstimatorName[eMultNTracksPV] = "MultNTracksPV"; + qa.fReferenceMultiplicityEstimatorName[eMultNTracksGlobal] = "MultNTracksGlobal"; qa.fReferenceMultiplicityEstimatorName[eMultTracklets] = "MultTracklets"; // **) Centrality estimators: @@ -539,7 +547,9 @@ void DefaultConfiguration() qa.fEventHistogramsName2D[eNContributors_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eNContributors].Data(), eh.fEventHistogramsName[eOccupancy].Data()); qa.fEventHistogramsName2D[eCentrality_vs_Vertex_z] = Form("%s_vs_%s", eh.fEventHistogramsName[eCentrality].Data(), eh.fEventHistogramsName[eVertex_z].Data()); qa.fEventHistogramsName2D[eCentrality_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eCentrality].Data(), eh.fEventHistogramsName[eOccupancy].Data()); + qa.fEventHistogramsName2D[eCentrality_vs_ImpactParameter] = Form("%s_vs_%s", eh.fEventHistogramsName[eCentrality].Data(), eh.fEventHistogramsName[eImpactParameter].Data()); qa.fEventHistogramsName2D[eVertex_z_vs_Occupancy] = Form("%s_vs_%s", eh.fEventHistogramsName[eVertex_z].Data(), eh.fEventHistogramsName[eOccupancy].Data()); + qa.fEventHistogramsName2D[eMultNTracksPV_vs_MultNTracksGlobal] = Form("%s_vs_%s", qa.fReferenceMultiplicityEstimatorName[eMultNTracksPV].Data(), qa.fReferenceMultiplicityEstimatorName[eMultNTracksGlobal].Data()); qa.fEventHistogramsName2D[eCentFT0C_vs_CentNTPV] = Form("%s_vs_%s", qa.fCentralityEstimatorName[eCentFT0C].Data(), qa.fCentralityEstimatorName[eCentNTPV].Data()); qa.fEventHistogramsName2D[eCentFT0M_vs_CentNTPV] = Form("%s_vs_%s", qa.fCentralityEstimatorName[eCentFT0M].Data(), qa.fCentralityEstimatorName[eCentNTPV].Data()); qa.fEventHistogramsName2D[eCentRun2V0M_vs_CentRun2SPDTracklets] = Form("%s_vs_%s", qa.fCentralityEstimatorName[eCentRun2V0M].Data(), qa.fCentralityEstimatorName[eCentRun2SPDTracklets].Data()); @@ -704,6 +714,7 @@ void DefaultBooking() eh.fBookEventHistograms[eVertex_z] = Alright(lBookEventHistograms[eVertex_z]) && eh.fFillEventHistograms; eh.fBookEventHistograms[eNContributors] = Alright(lBookEventHistograms[eNContributors]) && eh.fFillEventHistograms; eh.fBookEventHistograms[eImpactParameter] = Alright(lBookEventHistograms[eImpactParameter]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eEventPlaneAngle] = Alright(lBookEventHistograms[eEventPlaneAngle]) && eh.fFillEventHistograms; eh.fBookEventHistograms[eOccupancy] = Alright(lBookEventHistograms[eOccupancy]) && eh.fFillEventHistograms; eh.fBookEventHistograms[eInteractionRate] = Alright(lBookEventHistograms[eInteractionRate]) && eh.fFillEventHistograms; eh.fBookEventHistograms[eCurrentRunDuration] = Alright(lBookEventHistograms[eCurrentRunDuration]) && eh.fFillEventHistograms; @@ -776,8 +787,8 @@ void DefaultBooking() // *) Insanity check on the content and ordering of 2D particle histograms in the initialization in configurable cfBookParticleHistograms2D: // TBI 20241109 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. for (Int_t name = 0; name < eParticleHistograms2D_N; name++) { - // TBI 20241109 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookParticleHistograms2D[name]).BeginsWith(ph.fParticleHistogramsName2D[name].Data())) { + // TBI 20241109 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookParticleHistograms2D[name]).EndsWith(ph.fParticleHistogramsName2D[name].Data())) { LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookParticleHistograms2D => name = %d, lBookParticleHistograms2D[name] = \"%s\", ph.fParticleHistogramsName2D[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookParticleHistograms2D[name]).Data(), ph.fParticleHistogramsName2D[name].Data()); } } @@ -827,7 +838,9 @@ void DefaultBooking() qa.fBookQAEventHistograms2D[eNContributors_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Occupancy]) && qa.fFillQAEventHistograms2D; qa.fBookQAEventHistograms2D[eCentrality_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eCentrality_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; qa.fBookQAEventHistograms2D[eCentrality_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eCentrality_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentrality_vs_ImpactParameter] = Alright(lBookQAEventHistograms2D[eCentrality_vs_ImpactParameter]) && qa.fFillQAEventHistograms2D; qa.fBookQAEventHistograms2D[eVertex_z_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eVertex_z_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultNTracksPV_vs_MultNTracksGlobal] = Alright(lBookQAEventHistograms2D[eMultNTracksPV_vs_MultNTracksGlobal]) && qa.fFillQAEventHistograms2D; qa.fBookQAEventHistograms2D[eCentFT0C_vs_CentNTPV] = Alright(lBookQAEventHistograms2D[eCentFT0C_vs_CentNTPV]) && qa.fFillQAEventHistograms2D; qa.fBookQAEventHistograms2D[eCentFT0M_vs_CentNTPV] = Alright(lBookQAEventHistograms2D[eCentFT0M_vs_CentNTPV]) && qa.fFillQAEventHistograms2D; qa.fBookQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets] = Alright(lBookQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets]) && qa.fFillQAEventHistograms2D; @@ -851,8 +864,8 @@ void DefaultBooking() // *) Insanity check on the content and ordering of QA 2D particle histograms in the initialization in configurable cfBookQAParticleHistograms2D: // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. for (Int_t name = 0; name < eQAParticleHistograms2D_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of BeginsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookQAParticleHistograms2D[name]).BeginsWith(qa.fParticleHistogramsName2D[name].Data())) { + // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookQAParticleHistograms2D[name]).EndsWith(qa.fParticleHistogramsName2D[name].Data())) { LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookQAParticleHistograms2D => name = %d, lBookQAParticleHistograms2D[name] = \"%s\", qa.fParticleHistogramsName2D[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookQAParticleHistograms2D[name]).Data(), qa.fParticleHistogramsName2D[name].Data()); } } @@ -925,9 +938,13 @@ void DefaultBinning() eh.fEventHistogramsBins[eNContributors][1] = 0.; eh.fEventHistogramsBins[eNContributors][2] = 10000.; - eh.fEventHistogramsBins[eImpactParameter][0] = 2000; - eh.fEventHistogramsBins[eImpactParameter][1] = -1000.; // It's set to -999 if not meaningful - eh.fEventHistogramsBins[eImpactParameter][2] = 1000.; + eh.fEventHistogramsBins[eImpactParameter][0] = 1000; + eh.fEventHistogramsBins[eImpactParameter][1] = 0.; + eh.fEventHistogramsBins[eImpactParameter][2] = 100.; + + eh.fEventHistogramsBins[eEventPlaneAngle][0] = 720; + eh.fEventHistogramsBins[eEventPlaneAngle][1] = -o2::constants::math::PI; // just in case somebody uses the convention -Pi < EP < Pi, instead of 0 < EP < 2Pi + eh.fEventHistogramsBins[eEventPlaneAngle][2] = o2::constants::math::TwoPI; if (ec.fsEventCuts[eOccupancyEstimator].EqualTo("TrackOccupancyInTimeRange", TString::kIgnoreCase)) { eh.fEventHistogramsBins[eOccupancy][0] = 150; @@ -1296,6 +1313,7 @@ void DefaultCuts() ec.fUseEventCuts[eVertex_z] = Alright(lUseEventCuts[eVertex_z]); ec.fUseEventCuts[eNContributors] = Alright(lUseEventCuts[eNContributors]); ec.fUseEventCuts[eImpactParameter] = Alright(lUseEventCuts[eImpactParameter]); + ec.fUseEventCuts[eEventPlaneAngle] = Alright(lUseEventCuts[eEventPlaneAngle]); ec.fUseEventCuts[eOccupancy] = Alright(lUseEventCuts[eOccupancy]); ec.fUseEventCuts[eInteractionRate] = Alright(lUseEventCuts[eInteractionRate]); ec.fUseEventCuts[eCurrentRunDuration] = Alright(lUseEventCuts[eCurrentRunDuration]); @@ -1314,6 +1332,11 @@ void DefaultCuts() ec.fUseEventCuts[eIsVertexITSTPC] = Alright(lUseEventCuts[eIsVertexITSTPC]); ec.fUseEventCuts[eIsVertexTOFmatched] = Alright(lUseEventCuts[eIsVertexTOFmatched]); ec.fUseEventCuts[eIsVertexTRDmatched] = Alright(lUseEventCuts[eIsVertexTRDmatched]); + ec.fUseEventCuts[eNoCollInTimeRangeStrict] = Alright(lUseEventCuts[eNoCollInTimeRangeStrict]); + ec.fUseEventCuts[eNoCollInTimeRangeStandard] = Alright(lUseEventCuts[eNoCollInTimeRangeStandard]); + ec.fUseEventCuts[eNoCollInRofStrict] = Alright(lUseEventCuts[eNoCollInRofStrict]); + ec.fUseEventCuts[eNoCollInRofStandard] = Alright(lUseEventCuts[eNoCollInRofStandard]); + ec.fUseEventCuts[eNoHighMultCollInPrevRof] = Alright(lUseEventCuts[eNoHighMultCollInPrevRof]); ec.fUseEventCuts[eOccupancyEstimator] = Alright(lUseEventCuts[eOccupancyEstimator]); // **) event cuts defined via booleans: @@ -1324,6 +1347,11 @@ void DefaultCuts() ec.fUseEventCuts[eIsVertexITSTPC] = ec.fUseEventCuts[eIsVertexITSTPC] && cf_ec.cfUseIsVertexITSTPC; ec.fUseEventCuts[eIsVertexTOFmatched] = ec.fUseEventCuts[eIsVertexTOFmatched] && cf_ec.cfUseIsVertexTOFmatched; ec.fUseEventCuts[eIsVertexTRDmatched] = ec.fUseEventCuts[eIsVertexTRDmatched] && cf_ec.cfUseIsVertexTRDmatched; + ec.fUseEventCuts[eNoCollInTimeRangeStrict] = ec.fUseEventCuts[eNoCollInTimeRangeStrict] && cf_ec.cfUseNoCollInTimeRangeStrict; + ec.fUseEventCuts[eNoCollInTimeRangeStandard] = ec.fUseEventCuts[eNoCollInTimeRangeStandard] && cf_ec.cfUseNoCollInTimeRangeStandard; + ec.fUseEventCuts[eNoCollInRofStrict] = ec.fUseEventCuts[eNoCollInRofStrict] && cf_ec.cfUseNoCollInRofStrict; + ec.fUseEventCuts[eNoCollInRofStandard] = ec.fUseEventCuts[eNoCollInRofStandard] && cf_ec.cfUseNoCollInRofStandard; + ec.fUseEventCuts[eNoHighMultCollInPrevRof] = ec.fUseEventCuts[eNoHighMultCollInPrevRof] && cf_ec.cfUseNoHighMultCollInPrevRof; // **) event cuts defined via [min, max): auto lNumberOfEvents = (vector)cf_ec.cfNumberOfEvents; @@ -1366,6 +1394,10 @@ void DefaultCuts() ec.fdEventCuts[eImpactParameter][eMin] = lImpactParameter[eMin]; ec.fdEventCuts[eImpactParameter][eMax] = lImpactParameter[eMax]; + auto lEventPlaneAngle = (vector)cf_ec.cfEventPlaneAngle; + ec.fdEventCuts[eEventPlaneAngle][eMin] = lEventPlaneAngle[eMin]; + ec.fdEventCuts[eEventPlaneAngle][eMax] = lEventPlaneAngle[eMax]; + auto lOccupancy = (vector)cf_ec.cfOccupancy; ec.fdEventCuts[eOccupancy][eMin] = lOccupancy[eMin]; ec.fdEventCuts[eOccupancy][eMax] = lOccupancy[eMax]; @@ -1529,6 +1561,7 @@ void SpecificCuts(TString whichSpecificCuts) // After default cuts are applied, on top of them apply analysis-specific cuts. Has to be called after DefaultBinning() and DefaultCuts(). // Typically, analysis-specific cuts are determined through period tag, see below the case statement. // Both event and particle cuts are hardwired here. + // All expert suggestions about the cuts to be used for specific period are hardwired here. // For the time being, all specific cuts are defaulted and tuned for the latest reconstruction pass. // a) Mapping; @@ -1550,10 +1583,13 @@ void SpecificCuts(TString whichSpecificCuts) } // b) Implementation of analysis-specific cuts: - // Remark: Whichever cuts start to repeat below, promote and implement into DefaultCuts(). + // Remark: Whichever cuts start to repeat below across different case statements, promote them into DefaultCuts(). switch (specificCuts) { case eLHC23zzh: - ec.fUseEventCuts[eSel8] = kTRUE; + ec.fUseEventCuts[eSel8] = kTRUE; // central event selection for Run 3 + ec.fUseEventCuts[eNoCollInTimeRangeStrict] = kTRUE; // IA Slide 39 in https://indico.cern.ch/event/1462154/ + ec.fUseEventCuts[eNoCollInRofStrict] = kTRUE; // IA Slide 39 in https://indico.cern.ch/event/1462154/ + ec.fUseEventCuts[eNoHighMultCollInPrevRof] = kTRUE; // IA Slide 39 in https://indico.cern.ch/event/1462154/ break; // ... @@ -1730,9 +1766,6 @@ void InsanityChecksBeforeBooking() } // **) Insanity checks on event cuts: - if (ec.fUseEventCuts[eTrigger] && !(tc.fProcess[eProcessRec_Run2])) { - LOGF(fatal, "\033[1;31m%s at line %d : trigger \"%s\" => From documentation: Bypass this check if you analyse MC or continuous Run3 data. By now, it's validated only for \"Rec_Run2\", for other cases, simply switch off this event cut eTrigger. \033[0m", __FUNCTION__, __LINE__, ec.fsEventCuts[eTrigger].Data()); - } // **) This check is meant to prevent the case when I want to bailout for max number of events, but I do not fill event histograms: if (ec.fdEventCuts[eNumberOfEvents][eMax] < 1e6) { // TBI 20241011 Do I need to tune 1000000000 @@ -1744,10 +1777,33 @@ void InsanityChecksBeforeBooking() } } - // **) Check if the trigger makes sense for this dataset: + // **) Check if the trigger makes sense or was validated for this dataset: + if (ec.fUseEventCuts[eTrigger]) { + + // Validated and supported Run 3 triggers: + if (tc.fProcess[eProcessRec]) { + if (!ec.fsEventCuts[eTrigger].EqualTo("kTVXinTRD")) { + LOGF(fatal, "\033[1;31m%s at line %d : trigger \"%s\" is not internally validated or supported for Run 3. Add it to the list of supported triggers, if you really want to use that one.\033[0m", __FUNCTION__, __LINE__, ec.fsEventCuts[eTrigger].Data()); + } + } + + // Validated and supported Run 2 triggers: + if (tc.fProcess[eProcessRec_Run2]) { + if (!ec.fsEventCuts[eTrigger].EqualTo("kINT7")) { + // LOGF(fatal, "\033[1;31m%s at line %d : trigger \"%s\" is not internally validated/supported yet for Run 2. Add it to the list of supported triggers, if you really want to use that one.\033[0m", __FUNCTION__, __LINE__, ec.fsEventCuts[eTrigger].Data()); + } + } + + // Validated and supported Run 1 triggers: + // ... + + } // if (ec.fUseEventCuts[eTrigger]) { + + // **) Enforce the usage of particular trigger for this dataset: if (tc.fProcess[eProcessRec_Run2]) { - // TBI 20240517 for the time being, here I am enforcing that "kINT7" is mandatory for Run 2 and Run 1 converted real data - if (!(ec.fUseEventCuts[eTrigger] && ec.fsEventCuts[eTrigger].EqualTo("kINT7"))) { // TBI 20240223 expand this list with other supported triggers eventually in this category (see if(...) above) + // TBI 20240517 for the time being, here I am enforcing that "kINT7" is mandatory for Run 2 + // TBI 20241209 I still have to validate it for Run 1 converted real data => then expand if(...) statemebt above + if (!(ec.fUseEventCuts[eTrigger] && ec.fsEventCuts[eTrigger].EqualTo("kINT7"))) { LOGF(fatal, "\033[1;31m%s at line %d : trigger \"%s\" is not internally validated/supported yet. Add it to the list of supported triggers, if you really want to use that one.\033[0m", __FUNCTION__, __LINE__, ec.fsEventCuts[eTrigger].Data()); } else { LOGF(info, "\033[1;32m%s at line %d : WARNING => trigger \"%s\" can be used only on real converted Run 2 and Run 1 data. For MC converted Run 2 and Run 1 data, this trigger shouldn't be used.\033[0m", __FUNCTION__, __LINE__, ec.fsEventCuts[eTrigger].Data()); @@ -1755,14 +1811,6 @@ void InsanityChecksBeforeBooking() } } - // **) Do NOT use eTrigger for Run 3. From documentation: Bypass this check if you analyse MC or continuous Run3 data: - // TBI 20241023 this needs further scrutiny - if (tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim] || tc.fProcess[eProcessSim]) { - if (ec.fUseEventCuts[eTrigger]) { - LOGF(fatal, "\033[1;31m%s at line %d : offline trigger eTrigger (e.g. kINT7) cannot be used in Run 3\033[0m", __FUNCTION__, __LINE__); - } - } - // **) Ensure that fFloatingPointPrecision makes sense: if (!(tc.fFloatingPointPrecision > 0.)) { LOGF(fatal, "\033[1;31m%s at line %d : set fFloatingPointPrecision = %f to some small positive value, which will determine if two floats are the same \033[0m", __FUNCTION__, __LINE__, tc.fFloatingPointPrecision); @@ -1848,6 +1896,36 @@ void InsanityChecksBeforeBooking() } } + if (ec.fUseEventCuts[eNoCollInTimeRangeStrict]) { + if (!(tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim] || tc.fProcess[eProcessSim])) { + LOGF(fatal, "\033[1;31m%s at line %d : use eNoCollInTimeRangeStrict only for Run 3 data and MC\033[0m", __FUNCTION__, __LINE__); + } + } + + if (ec.fUseEventCuts[eNoCollInTimeRangeStandard]) { + if (!(tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim] || tc.fProcess[eProcessSim])) { + LOGF(fatal, "\033[1;31m%s at line %d : use eNoCollInTimeRangeStandard only for Run 3 data and MC\033[0m", __FUNCTION__, __LINE__); + } + } + + if (ec.fUseEventCuts[eNoCollInRofStrict]) { + if (!(tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim] || tc.fProcess[eProcessSim])) { + LOGF(fatal, "\033[1;31m%s at line %d : use eNoCollInRofStrict only for Run 3 data and MC\033[0m", __FUNCTION__, __LINE__); + } + } + + if (ec.fUseEventCuts[eNoCollInRofStandard]) { + if (!(tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim] || tc.fProcess[eProcessSim])) { + LOGF(fatal, "\033[1;31m%s at line %d : use eNoCollInRofStandard only for Run 3 data and MC\033[0m", __FUNCTION__, __LINE__); + } + } + + if (ec.fUseEventCuts[eNoHighMultCollInPrevRof]) { + if (!(tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim] || tc.fProcess[eProcessSim])) { + LOGF(fatal, "\033[1;31m%s at line %d : use eNoHighMultCollInPrevRof only for Run 3 data and MC\033[0m", __FUNCTION__, __LINE__); + } + } + // **) Supported reference multiplicity estimators for Run 3 are enlisted here: if (tc.fProcess[eProcessRec] || tc.fProcess[eProcessRecSim]) { if (!(ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("MultTPC", TString::kIgnoreCase) || @@ -2351,6 +2429,16 @@ void BookQAHistograms() max_y_Event[eCentrality_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][2]; title_y_Event[eCentrality_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eOccupancy].Data()); + // *) "Centrality_vs_ImpactParameter": + nBins_x_Event[eCentrality_vs_ImpactParameter] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); + min_x_Event[eCentrality_vs_ImpactParameter] = eh.fEventHistogramsBins[eCentrality][1]; + max_x_Event[eCentrality_vs_ImpactParameter] = eh.fEventHistogramsBins[eCentrality][2]; + title_x_Event[eCentrality_vs_ImpactParameter] = FancyFormatting(eh.fEventHistogramsName[eCentrality].Data()); + nBins_y_Event[eCentrality_vs_ImpactParameter] = static_cast(eh.fEventHistogramsBins[eImpactParameter][0] / qa.fRebin); + min_y_Event[eCentrality_vs_ImpactParameter] = eh.fEventHistogramsBins[eImpactParameter][1]; + max_y_Event[eCentrality_vs_ImpactParameter] = eh.fEventHistogramsBins[eImpactParameter][2]; + title_y_Event[eCentrality_vs_ImpactParameter] = FancyFormatting(eh.fEventHistogramsName[eImpactParameter].Data()); + // *) "Vertex_z_vs_Occupancy": nBins_x_Event[eVertex_z_vs_Occupancy] = static_cast(eh.fEventHistogramsBins[eVertex_z][0]); min_x_Event[eVertex_z_vs_Occupancy] = eh.fEventHistogramsBins[eVertex_z][1]; @@ -2361,6 +2449,16 @@ void BookQAHistograms() max_y_Event[eVertex_z_vs_Occupancy] = eh.fEventHistogramsBins[eOccupancy][2]; title_y_Event[eVertex_z_vs_Occupancy] = FancyFormatting(eh.fEventHistogramsName[eOccupancy].Data()); + // *) "eMultNTracksPV_vs_MultNTracksGlobal": + nBins_x_Event[eMultNTracksPV_vs_MultNTracksGlobal] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0] / qa.fRebin); + min_x_Event[eMultNTracksPV_vs_MultNTracksGlobal] = eh.fEventHistogramsBins[eMultiplicity][1]; + max_x_Event[eMultNTracksPV_vs_MultNTracksGlobal] = eh.fEventHistogramsBins[eMultiplicity][2]; + title_x_Event[eMultNTracksPV_vs_MultNTracksGlobal] = FancyFormatting(qa.fReferenceMultiplicityEstimatorName[eMultNTracksPV].Data()); + nBins_y_Event[eMultNTracksPV_vs_MultNTracksGlobal] = static_cast(eh.fEventHistogramsBins[eMultiplicity][0] / qa.fRebin); + min_y_Event[eMultNTracksPV_vs_MultNTracksGlobal] = eh.fEventHistogramsBins[eMultiplicity][1]; + max_y_Event[eMultNTracksPV_vs_MultNTracksGlobal] = eh.fEventHistogramsBins[eMultiplicity][2]; + title_y_Event[eMultNTracksPV_vs_MultNTracksGlobal] = FancyFormatting(qa.fReferenceMultiplicityEstimatorName[eMultNTracksGlobal].Data()); + // *) "eCentFT0C_vs_CentNTPV": nBins_x_Event[eCentFT0C_vs_CentNTPV] = static_cast(eh.fEventHistogramsBins[eCentrality][0]); min_x_Event[eCentFT0C_vs_CentNTPV] = eh.fEventHistogramsBins[eCentrality][1]; @@ -2461,8 +2559,8 @@ void BookQAHistograms() } qa.fQAEventHistograms2D[t][rs][ba] = new TH2F( - Form("fQAEventHistograms2D[%s][%s][%s]", qa.fEventHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) + Form("fQAEventHistograms2D[%s][%s][%s]", qa.fEventHistogramsName2D[t].Data(), gc.srs[rs].Data(), gc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", gc.srs_long[rs].Data(), gc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) nBins_x_Event[t], min_x_Event[t], max_x_Event[t], nBins_y_Event[t], min_y_Event[t], max_y_Event[t]); qa.fQAEventHistograms2D[t][rs][ba]->GetXaxis()->SetTitle(title_x_Event[t].Data()); qa.fQAEventHistograms2D[t][rs][ba]->GetYaxis()->SetTitle(title_y_Event[t].Data()); @@ -2525,8 +2623,8 @@ void BookQAHistograms() for (Int_t ba = 0; ba < 2; ba++) // before/after cuts { qa.fQAParticleHistograms2D[t][rs][ba] = new TH2F( - Form("fQAParticleHistograms2D[%s][%s][%s]", qa.fParticleHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) + Form("fQAParticleHistograms2D[%s][%s][%s]", qa.fParticleHistogramsName2D[t].Data(), gc.srs[rs].Data(), gc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", gc.srs_long[rs].Data(), gc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) nBins_x_Particle[t], min_x_Particle[t], max_x_Particle[t], nBins_y_Particle[t], min_y_Particle[t], max_y_Particle[t]); qa.fQAParticleHistograms2D[t][rs][ba]->GetXaxis()->SetTitle(title_x_Particle[t].Data()); @@ -2593,8 +2691,8 @@ void BookEventHistograms() continue; } eh.fEventHistograms[t][rs][ba] = new TH1F( - Form("fEventHistograms[%s][%s][%s]", eh.fEventHistogramsName[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) + Form("fEventHistograms[%s][%s][%s]", eh.fEventHistogramsName[t].Data(), gc.srs[rs].Data(), gc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", gc.srs_long[rs].Data(), gc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) static_cast(eh.fEventHistogramsBins[t][0]), eh.fEventHistogramsBins[t][1], eh.fEventHistogramsBins[t][2]); eh.fEventHistograms[t][rs][ba]->GetXaxis()->SetTitle(FancyFormatting(eh.fEventHistogramsName[t].Data())); @@ -2656,22 +2754,22 @@ void BookEventCutsHistograms() continue; } - for (Int_t cuco = 0; cuco < eCutCounter_N; cuco++) // cut counter. I have to use "cuco", because "cc." is already reserved for struct "common cosmetics" + for (Int_t cc = 0; cc < eCutCounter_N; cc++) // cut counter { - if ((!ec.fUseEventCutCounterAbsolute && cuco == eAbsolute) || (!ec.fUseEventCutCounterSequential && cuco == eSequential)) { + if ((!ec.fUseEventCutCounterAbsolute && cc == eAbsolute) || (!ec.fUseEventCutCounterSequential && cc == eSequential)) { continue; } - ec.fEventCutCounterHist[rs][cuco] = new TH1I(Form("fEventCutCounterHist[%s][%s]", cc.srs[rs].Data(), cc.scc[cuco].Data()), Form("%s, %s, event cut counter (%s)", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.scc_long[cuco].Data()), eEventCuts_N, 0.5, static_cast(eEventCuts_N) + 0.5); // I cast in double the last argument, because that's what this particular TH1I constructor expects - // Yes, +0.5, because eEventCuts kicks off from 0 - ec.fEventCutCounterHist[rs][cuco]->SetStats(kFALSE); - ec.fEventCutCounterHist[rs][cuco]->SetLineColor(eColor); - ec.fEventCutCounterHist[rs][cuco]->SetFillColor(eFillColor); + ec.fEventCutCounterHist[rs][cc] = new TH1I(Form("fEventCutCounterHist[%s][%s]", gc.srs[rs].Data(), gc.scc[cc].Data()), Form("%s, %s, event cut counter (%s)", "__RUN_NUMBER__", gc.srs_long[rs].Data(), gc.scc_long[cc].Data()), eEventCuts_N, 0.5, static_cast(eEventCuts_N) + 0.5); // I cast in double the last argument, because that's what this particular TH1I constructor expects + // Yes, +0.5, because eEventCuts kicks off from 0 + ec.fEventCutCounterHist[rs][cc]->SetStats(kFALSE); + ec.fEventCutCounterHist[rs][cc]->SetLineColor(eColor); + ec.fEventCutCounterHist[rs][cc]->SetFillColor(eFillColor); // Remark: Bin labels are set later in a dry call to EventCuts, to accomodate sequential event cut counting - ec.fEventCutsList->Add(ec.fEventCutCounterHist[rs][cuco]); + ec.fEventCutsList->Add(ec.fEventCutCounterHist[rs][cc]); - } // for (Int_t cuco = 0; cuco < eCutCounter_N; cuco++) // enum eCutCounter + } // for (Int_t cc = 0; cc < eCutCounter_N; cc++) // enum eCutCounter } // for (Int_t rs = 0; rs < 2; rs++) // reco/sim @@ -2729,8 +2827,8 @@ void BookParticleHistograms() for (Int_t ba = 0; ba < 2; ba++) // before/after cuts { - ph.fParticleHistograms[t][rs][ba] = new TH1F(Form("fParticleHistograms[%s][%s][%s]", ph.fParticleHistogramsName[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), + ph.fParticleHistograms[t][rs][ba] = new TH1F(Form("fParticleHistograms[%s][%s][%s]", ph.fParticleHistogramsName[t].Data(), gc.srs[rs].Data(), gc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", gc.srs_long[rs].Data(), gc.sba_long[ba].Data()), static_cast(ph.fParticleHistogramsBins[t][0]), ph.fParticleHistogramsBins[t][1], ph.fParticleHistogramsBins[t][2]); ph.fParticleHistograms[t][rs][ba]->SetLineColor(ec.fBeforeAfterColor[ba]); ph.fParticleHistograms[t][rs][ba]->SetFillColor(ec.fBeforeAfterColor[ba] - 10); @@ -2784,21 +2882,21 @@ void BookParticleHistograms() // Remark: placeholder __RUN_NUMBER__ is handled in PropagateRunNumber(...) // *) variable-length binning for phi vs pt, but only in pt axis: - ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), + ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), gc.srs[rs].Data(), gc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", gc.srs_long[rs].Data(), gc.sba_long[ba].Data()), static_cast(ph.fParticleHistogramsBins2D[t][eX][0]), ph.fParticleHistogramsBins2D[t][eX][1], ph.fParticleHistogramsBins2D[t][eX][2], res.fResultsPro[AFO_PT]->GetXaxis()->GetXbins()->GetSize() - 1, res.fResultsPro[AFO_PT]->GetXaxis()->GetXbins()->GetArray()); // yes, x-axis of "results vs pt" hist is y-axis here for 2D. } else if (ph.fParticleHistogramsName2D[t].EqualTo("Phi_vs_Eta") && res.fUseResultsProVariableLengthBins[AFO_ETA]) { // *) variable-length binning for phi vs eta, but only in eta axis: - ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), + ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), gc.srs[rs].Data(), gc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", gc.srs_long[rs].Data(), gc.sba_long[ba].Data()), static_cast(ph.fParticleHistogramsBins2D[t][eX][0]), ph.fParticleHistogramsBins2D[t][eX][1], ph.fParticleHistogramsBins2D[t][eX][2], res.fResultsPro[AFO_ETA]->GetXaxis()->GetXbins()->GetSize() - 1, res.fResultsPro[AFO_ETA]->GetXaxis()->GetXbins()->GetArray()); // yes, x-axis of "results vs pt" hist is y-axis here for 2D } else { // default fixed-length binning: - ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), cc.srs[rs].Data(), cc.sba[ba].Data()), - Form("%s, %s, %s", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), + ph.fParticleHistograms2D[t][rs][ba] = new TH2D(Form("fParticleHistograms2D[%s][%s][%s]", ph.fParticleHistogramsName2D[t].Data(), gc.srs[rs].Data(), gc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", gc.srs_long[rs].Data(), gc.sba_long[ba].Data()), static_cast(ph.fParticleHistogramsBins2D[t][eX][0]), ph.fParticleHistogramsBins2D[t][eX][1], ph.fParticleHistogramsBins2D[t][eX][2], static_cast(ph.fParticleHistogramsBins2D[t][eY][0]), ph.fParticleHistogramsBins2D[t][eY][1], ph.fParticleHistogramsBins2D[t][eY][2]); } @@ -2864,23 +2962,23 @@ void BookParticleCutsHistograms() continue; } - for (Int_t cuco = 0; cuco < eCutCounter_N; cuco++) // cut counter. I have to use "cuco", because "cc." is already reserved for struct "common cosmetics" + for (Int_t cc = 0; cc < eCutCounter_N; cc++) // cut counter { - if ((!pc.fUseParticleCutCounterAbsolute && cuco == eAbsolute) || (!pc.fUseParticleCutCounterSequential && cuco == eSequential)) { + if ((!pc.fUseParticleCutCounterAbsolute && cc == eAbsolute) || (!pc.fUseParticleCutCounterSequential && cc == eSequential)) { continue; } - pc.fParticleCutCounterHist[rs][cuco] = new TH1I(Form("fParticleCutCounterHist[%s][%s]", cc.srs[rs].Data(), cc.scc[cuco].Data()), Form("%s, %s, particle cut counter (%s)", "__RUN_NUMBER__", cc.srs_long[rs].Data(), cc.scc_long[cuco].Data()), eParticleCuts_N, 0.5, static_cast(eParticleCuts_N) + 0.5); + pc.fParticleCutCounterHist[rs][cc] = new TH1I(Form("fParticleCutCounterHist[%s][%s]", gc.srs[rs].Data(), gc.scc[cc].Data()), Form("%s, %s, particle cut counter (%s)", "__RUN_NUMBER__", gc.srs_long[rs].Data(), gc.scc_long[cc].Data()), eParticleCuts_N, 0.5, static_cast(eParticleCuts_N) + 0.5); // I cast in double the last argument, because that's what this particular TH1I constructor expects // Yes, +0.5, because eParticleCuts kicks off from 0 - pc.fParticleCutCounterHist[rs][cuco]->SetStats(kFALSE); - pc.fParticleCutCounterHist[rs][cuco]->SetLineColor(eColor); - pc.fParticleCutCounterHist[rs][cuco]->SetFillColor(eFillColor); + pc.fParticleCutCounterHist[rs][cc]->SetStats(kFALSE); + pc.fParticleCutCounterHist[rs][cc]->SetLineColor(eColor); + pc.fParticleCutCounterHist[rs][cc]->SetFillColor(eFillColor); // Remark: Bin labels are set later in a dry call to ParticleCuts, to accomodate sequential particle cut counting - pc.fParticleCutsList->Add(pc.fParticleCutCounterHist[rs][cuco]); + pc.fParticleCutsList->Add(pc.fParticleCutCounterHist[rs][cc]); - } // for (Int_t cuco = 0; cuco < eCutCounter_N; cuco++) // enum eCutCounter + } // for (Int_t cc = 0; cc < eCutCounter_N; cc++) // enum eCutCounter } // for (Int_t rs = 0; rs < 2; rs++) // reco/sim @@ -2943,9 +3041,9 @@ void BookQvectorHistograms() continue; // it make sense to fill these histos only for "eAfter", because Q-vectors are not filled for "eBefore" } for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { // eta separation - qv.fMabDist[ab][rs][ba][e] = new TH1F(Form("fMabDist[%s][%s][%s][%d]", sEtaSep[ab].Data(), cc.srs[rs].Data(), cc.sba[ba].Data(), e), + qv.fMabDist[ab][rs][ba][e] = new TH1F(Form("fMabDist[%s][%s][%s][%d]", sEtaSep[ab].Data(), gc.srs[rs].Data(), gc.sba[ba].Data(), e), Form("%s, %s, %s, %s", "__RUN_NUMBER__", - 0 == ab ? Form("%s -%.2f", sEtaSep_long[ab].Data(), es.fEtaSeparationsValues[e] / 2.) : Form("%.2f %s", es.fEtaSeparationsValues[e] / 2., sEtaSep_long[ab].Data()), cc.srs_long[rs].Data(), cc.sba_long[ba].Data()), + 0 == ab ? Form("%s -%.2f", sEtaSep_long[ab].Data(), es.fEtaSeparationsValues[e] / 2.) : Form("%.2f %s", es.fEtaSeparationsValues[e] / 2., sEtaSep_long[ab].Data()), gc.srs_long[rs].Data(), gc.sba_long[ba].Data()), static_cast(eh.fEventHistogramsBins[eMultiplicity][0]), eh.fEventHistogramsBins[eMultiplicity][1], eh.fEventHistogramsBins[eMultiplicity][2]); // TBI 20241207 I have hardwired in this constructor "0 == ab", this can backfire... qv.fMabDist[ab][rs][ba][e]->SetLineColor(ec.fBeforeAfterColor[ba]); qv.fMabDist[ab][rs][ba][e]->SetFillColor(ec.fBeforeAfterColor[ba] - 10); @@ -2986,7 +3084,7 @@ void BookCorrelationsHistograms() // a) Book the profile holding flags: mupa.fCorrelationsFlagsPro = new TProfile("fCorrelationsFlagsPro", - "flags for correlations", 1, 0., 31); + "flags for correlations", 1, 0., 1.); mupa.fCorrelationsFlagsPro->SetStats(kFALSE); mupa.fCorrelationsFlagsPro->SetLineColor(eColor); mupa.fCorrelationsFlagsPro->SetFillColor(eFillColor); @@ -3680,6 +3778,7 @@ void InternalValidation() !eh.fEventHistograms[eOccupancy][eSim][eBefore] ? true : eh.fEventHistograms[eOccupancy][eSim][eBefore]->Fill(ebye.fOccupancy); !eh.fEventHistograms[eInteractionRate][eSim][eBefore] ? true : eh.fEventHistograms[eInteractionRate][eSim][eBefore]->Fill(ebye.fInteractionRate); !eh.fEventHistograms[eCurrentRunDuration][eSim][eBefore] ? true : eh.fEventHistograms[eCurrentRunDuration][eSim][eBefore]->Fill(ebye.fCurrentRunDuration); + !eh.fEventHistograms[eEventPlaneAngle][eSim][eBefore] ? true : eh.fEventHistograms[eEventPlaneAngle][eSim][eBefore]->Fill(fReactionPlane); } // ... here I could implement some event cuts, if necessary ... @@ -3803,6 +3902,7 @@ void InternalValidation() !eh.fEventHistograms[eOccupancy][eSim][eAfter] ? true : eh.fEventHistograms[eOccupancy][eSim][eAfter]->Fill(ebye.fOccupancy); !eh.fEventHistograms[eInteractionRate][eSim][eAfter] ? true : eh.fEventHistograms[eCentrality][eSim][eAfter]->Fill(ebye.fInteractionRate); !eh.fEventHistograms[eCurrentRunDuration][eSim][eAfter] ? true : eh.fEventHistograms[eCurrentRunDuration][eSim][eAfter]->Fill(ebye.fCurrentRunDuration); + !eh.fEventHistograms[eEventPlaneAngle][eSim][eAfter] ? true : eh.fEventHistograms[eEventPlaneAngle][eSim][eAfter]->Fill(fReactionPlane); } // *) Fill subevent multiplicities: @@ -4243,7 +4343,7 @@ void DetermineRunNumber(T1 const& collision, T2 const&) } // a) Determine run number for Run 3 real data: - if constexpr (rs == eRec) { + if constexpr (rs == eRec || rs == eRecAndSim) { // **) Determine run number: // Get start timestamp and end timemstamp for this run in miliseconds, and convert both of them in seconds: @@ -4274,7 +4374,7 @@ void DetermineRunNumber(T1 const& collision, T2 const&) } else { // b) Determine run number for the rest. TBI 20241126 differentiate this support as well, e.g. for eRecSim and eSim. But Run 2 and Run 1 most likely will stay as before - LOGF(fatal, "bc.runNumber() is not validated yet beyond eRec"); + LOGF(fatal, "\033[1;31m%s at line %d : bc.runNumber() is not validated yet for this case\033[0m", __FUNCTION__, __LINE__); } tc.fRunNumberIsDetermined = kTRUE; @@ -4599,7 +4699,7 @@ void ResetEventByEventQuantities() continue; } for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { - qv.fqabVector[ab][bin][h][e] = TComplex(0., 0.); + qv.fqabVector[ab][bin - 1][h][e] = TComplex(0., 0.); // yes, bin - 1 here } } } @@ -4608,7 +4708,7 @@ void ResetEventByEventQuantities() for (Int_t ab = 0; ab < 2; ab++) { // ab = 0 <=> -eta , ab = 1 <=> + eta for (Int_t bin = 1; bin <= gMaxNoBinsKine; bin++) { for (Int_t e = 0; e < gMaxNumberEtaSeparations; e++) { - qv.fmab[ab][bin][e] = 0.; + qv.fmab[ab][bin - 1][e] = 0.; // yes, bin - 1 here } } } @@ -4642,8 +4742,6 @@ void ResetEventByEventQuantities() tc.fRandomIndices = NULL; } - // ... TBI 20240117 port the rest ... - if (tc.fVerbose) { ExitFunction(__FUNCTION__); } @@ -4772,6 +4870,30 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) // *) SelectedEvents: => this event cut is implemented directly in Steer(...) + // *) Offline trigger: + // Remark from documentation: Bypass this check if you analyse MC or continuous Run3 data. + // Documentation: + // a) O2Physics/Common/CCDB/TriggerAliases.h => available trigger aliases + // b) O2Physics/Common/CCDB/macros/upload_trigger_aliases.C => definitions of each trigger alias + // In addition: remember that I can use it only for process cases where I have joined aod::Collisions with aod::EvSels + // TBI 20240517 I didn't validate this trigger on Run 1, in fact, I have added protection against its usage in InsanityChecks. + if (ec.fUseEventCuts[eTrigger]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eTrigger, eCutCounterBinning); + } else if (ec.fsEventCuts[eTrigger].EqualTo("kINT7") && !collision.alias_bit(kINT7)) { // Validated only for Run 2 + if (!EventCut(eRec, eTrigger, cutModus)) { + return kFALSE; + } + } else if (ec.fsEventCuts[eTrigger].EqualTo("kTVXinTRD") && !collision.alias_bit(kTVXinTRD)) { // Validated only for Run 3 + if (!EventCut(eRec, eTrigger, cutModus)) { + return kFALSE; + } + } + // ... + } + + // collision.alias_bit(kTVXinTRD); + // *) Sel8: // see definition in Common/TableProducer/eventSelection.cxx if (ec.fUseEventCuts[eSel8]) { if (cutModus == eCutCounterBinning) { @@ -4906,6 +5028,17 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) } } + // *) Event plane angle: + if (ec.fUseEventCuts[eEventPlaneAngle]) { + if (cutModus == eCutCounterBinning) { + EventCut(eSim, eEventPlaneAngle, eCutCounterBinning); + } else if (collision.eventPlaneAngle() < ec.fdEventCuts[eEventPlaneAngle][eMin] || collision.eventPlaneAngle() > ec.fdEventCuts[eEventPlaneAngle][eMax] || TMath::Abs(collision.eventPlaneAngle() - ec.fdEventCuts[eEventPlaneAngle][eMax]) < tc.fFloatingPointPrecision) { + if (!EventCut(eSim, eEventPlaneAngle, cutModus)) { + return kFALSE; + } + } + } + // *) TotalMultiplicity: // TBI 20240509 check what is the Monte Carlo analogy for tracks.size() @@ -5054,6 +5187,61 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) } } + // *) NoCollInTimeRangeStrict: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eNoCollInTimeRangeStrict]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eNoCollInTimeRangeStrict, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { + if (!EventCut(eRec, eNoCollInTimeRangeStrict, cutModus)) { + return kFALSE; + } + } + } + + // *) NoCollInTimeRangeStandard: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eNoCollInTimeRangeStandard]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eNoCollInTimeRangeStandard, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + if (!EventCut(eRec, eNoCollInTimeRangeStandard, cutModus)) { + return kFALSE; + } + } + } + + // *) NoCollInRofStrict: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eNoCollInRofStrict]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eNoCollInRofStrict, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) { + if (!EventCut(eRec, eNoCollInRofStrict, cutModus)) { + return kFALSE; + } + } + } + + // *) NoCollInRofStandard: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eNoCollInRofStandard]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eNoCollInRofStandard, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + if (!EventCut(eRec, eNoCollInRofStandard, cutModus)) { + return kFALSE; + } + } + } + + // *) NoHighMultCollInPrevRof: // see O2Physics/Common/CCDB/EventSelectionParams.cxx + if (ec.fUseEventCuts[eNoHighMultCollInPrevRof]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eNoHighMultCollInPrevRof, eCutCounterBinning); + } else if (!collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { + if (!EventCut(eRec, eNoHighMultCollInPrevRof, cutModus)) { + return kFALSE; + } + } + } + // ... // ... and corresponding MC truth simulated (Run 3 specific): @@ -5093,23 +5281,6 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) // Remark: I implement here only the event cuts which are not already in group a) above, and which make sense only for Run 1 and 2 data. if constexpr (rs == eRec_Run2 || rs == eRecAndSim_Run2 || rs == eRec_Run1 || rs == eRecAndSim_Run1) { - // *) Offline trigger: - // Remark from documentation: Bypass this check if you analyse MC or continuous Run3 data. - // Documentation: - // a) O2Physics/Common/CCDB/TriggerAliases.h => available trigger aliases - // b) O2Physics/Common/CCDB/macros/upload_trigger_aliases.C => definitions of each trigger alias - // In addition: remember that I can use it only for process cases where I have joined aod::Collisions with aod::EvSels - // TBI 20240517 I didn't validate this trigger on Run 1, in fact, I have added protection against its usage in InsanityChecks. - if (ec.fUseEventCuts[eTrigger]) { - if (cutModus == eCutCounterBinning) { - EventCut(eRec, eTrigger, eCutCounterBinning); - } else if (ec.fsEventCuts[eTrigger].EqualTo("kINT7") && !collision.alias_bit(kINT7)) { - if (!EventCut(eRec, eTrigger, cutModus)) { - return kFALSE; - } - } - } - // *) Sel7: if (ec.fUseEventCuts[eSel7]) { if (cutModus == eCutCounterBinning) { @@ -5390,8 +5561,6 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) !qa.fQAEventHistograms2D[eNContributors_vs_Centrality][eRec][ba] ? true : qa.fQAEventHistograms2D[eNContributors_vs_Centrality][eRec][ba]->Fill(collision.numContrib(), ebye.fCentrality); !qa.fQAEventHistograms2D[eNContributors_vs_Vertex_z][eRec][ba] ? true : qa.fQAEventHistograms2D[eNContributors_vs_Vertex_z][eRec][ba]->Fill(collision.numContrib(), collision.posZ()); !qa.fQAEventHistograms2D[eCentrality_vs_Vertex_z][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentrality_vs_Vertex_z][eRec][ba]->Fill(ebye.fCentrality, collision.posZ()); - !qa.fQAEventHistograms2D[eCentFT0C_vs_CentNTPV][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentFT0C_vs_CentNTPV][eRec][ba]->Fill(qa.fCentrality[eCentFT0C], qa.fCentrality[eCentNTPV]); - !qa.fQAEventHistograms2D[eCentFT0M_vs_CentNTPV][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentFT0M_vs_CentNTPV][eRec][ba]->Fill(qa.fCentrality[eCentFT0M], qa.fCentrality[eCentNTPV]); } // ... and corresponding MC truth simulated (common to Run 3, Run 2 and Run 1) ( see https://github.com/AliceO2Group/O2Physics/blob/master/Tutorials/src/mcHistograms.cxx ): @@ -5406,11 +5575,18 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) !eh.fEventHistograms[eVertex_y][eSim][ba] ? true : eh.fEventHistograms[eVertex_y][eSim][ba]->Fill(collision.mcCollision().posY()); !eh.fEventHistograms[eVertex_z][eSim][ba] ? true : eh.fEventHistograms[eVertex_z][eSim][ba]->Fill(collision.mcCollision().posZ()); !eh.fEventHistograms[eImpactParameter][eSim][ba] ? true : eh.fEventHistograms[eImpactParameter][eSim][ba]->Fill(collision.mcCollision().impactParameter()); + !eh.fEventHistograms[eEventPlaneAngle][eSim][ba] ? true : eh.fEventHistograms[eEventPlaneAngle][eSim][ba]->Fill(collision.mcCollision().eventPlaneAngle()); // eh.fEventHistograms[eTotalMultiplicity][eSim][ba]->Fill(tracks.size()); // TBI 20231106 check how to get corresponding MC truth info, and validate further // eh.fEventHistograms[eMultiplicity][eSim][ba]->Fill(ebye.fMultiplicity); // TBI 20241123 re-think if I really need it here. If yes, most likely I will have to // generalize fSelectedTracks to an array, to counter separately selected sim particles // eh.fEventHistograms[eCentrality][eSim][ba]->Fill(ebye.fCentrality); // TBI 20240120 this case is still not supported in DetermineCentrality() } + + // QA: + if (qa.fFillQAEventHistograms2D) { + !qa.fQAEventHistograms2D[eCentrality_vs_ImpactParameter][eSim][ba] ? true : qa.fQAEventHistograms2D[eCentrality_vs_ImpactParameter][eSim][ba]->Fill(ebye.fCentrality, collision.mcCollision().impactParameter()); + // ... + } } // if constexpr (rs == eRecAndSim) { } // if constexpr (rs == eRec || rs == eRecAndSim) { @@ -5420,6 +5596,7 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) if constexpr (rs == eSim || rs == eSim_Run2 || rs == eSim_Run1) { if (eh.fFillEventHistograms) { !eh.fEventHistograms[eImpactParameter][eSim][ba] ? true : eh.fEventHistograms[eImpactParameter][eSim][ba]->Fill(collision.impactParameter()); // yes, because in this branch 'collision' is always aod::McCollision + !eh.fEventHistograms[eEventPlaneAngle][eSim][ba] ? true : eh.fEventHistograms[eEventPlaneAngle][eSim][ba]->Fill(collision.eventPlaneAngle()); // yes, because in this branch 'collision' is always aod::McCollision !eh.fEventHistograms[eMultiplicity][eSim][ba] ? true : eh.fEventHistograms[eMultiplicity][eSim][ba]->Fill(ebye.fMultiplicity); // eh.fEventHistograms[eCentrality][eSim][ba]->Fill(ebye.fCentrality); // TBI 20240120 this case is still not supported in DetermineCentrality() // eh.fEventHistograms[eReferenceMultiplicity][eSim][ba]->Fill(ebye.fReferenceMultiplicity); // TBI 20241123 this case is still not supported in DetermineReferenceMultiplicity() @@ -5456,11 +5633,9 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) // ... // Specific (estimators are hardwired): + !qa.fQAEventHistograms2D[eMultNTracksPV_vs_MultNTracksGlobal][eRec][ba] ? true : qa.fQAEventHistograms2D[eMultNTracksPV_vs_MultNTracksGlobal][eRec][ba]->Fill(qa.fReferenceMultiplicity[eMultNTracksPV], qa.fReferenceMultiplicity[eMultNTracksGlobal]); // TBI 20241209 check if I can use this one for Run 2 and 1 !qa.fQAEventHistograms2D[eCentFT0C_vs_CentNTPV][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentFT0C_vs_CentNTPV][eRec][ba]->Fill(qa.fCentrality[eCentFT0C], qa.fCentrality[eCentNTPV]); !qa.fQAEventHistograms2D[eCentFT0M_vs_CentNTPV][eRec][ba] ? true : qa.fQAEventHistograms2D[eCentFT0M_vs_CentNTPV][eRec][ba]->Fill(qa.fCentrality[eCentFT0M], qa.fCentrality[eCentNTPV]); - // TBI 20241124 add 2D QA correlation plots for 2-3 selected reference multiplicity estimators - // !eh.fEventHistograms[eMultFT0M][eRec][ba] ? true : eh.fEventHistograms[eMultFT0M][eRec][ba]->Fill(collision.multFT0M()); - // !eh.fEventHistograms[eMultFV0M][eRec][ba] ? true : eh.fEventHistograms[eMultFV0M][eRec][ba]->Fill(collision.multFV0M()); !qa.fQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange][eRec][ba] ? true : qa.fQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange][eRec][ba]->Fill(collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange()); !qa.fQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate][eRec][ba] ? true : qa.fQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate][eRec][ba]->Fill(ebye.fCurrentRunDuration, ebye.fInteractionRate); } @@ -5481,9 +5656,10 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) // ----------------------------------------------------------------------------- - // d) Fill only simulated(Run 3 specific): + // d) Fill only simulated (Run 3 specific): if constexpr (rs == eSim) { // !eh.fEventHistograms[eImpactParameter][eSim][ba] ? true : eh.fEventHistograms[eImpactParameter][eSim][ba]->Fill(collision.impactParameter()); // yes, because in this branch 'collision' is always aod::McCollision + // !eh.fEventHistograms[eEventPlaneAngle][eSim][ba] ? true : eh.fEventHistograms[eEventPlaneAngle][eSim][ba]->Fill(collision.eventPlaneAngle()); // yes, because in this branch 'collision' is always aod::McCollision } // if constexpr (rs == eSim) { // ----------------------------------------------------------------------------- @@ -5515,6 +5691,7 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) // f) Fill only simulated (Run 1 and 2 specific): // In case there is some corner case between Run 1 and Run 2, simply branch further this one if constexpr (rs == eSim_Run2 || rs == eSim_Run1) { // !eh.fEventHistograms[eImpactParameter][eSim][ba] ? true : eh.fEventHistograms[eImpactParameter][eSim][ba]->Fill(collision.impactParameter()); // yes, because in this branch 'collision' is always aod::McCollision + // !eh.fEventHistograms[eEventPlaneAngle][eSim][ba] ? true : eh.fEventHistograms[eEventPlaneAngle][eSim][ba]->Fill(collision.eventPlaneAngle()); // yes, because in this branch 'collision' is always aod::McCollision } // if constexpr (rs == eSim_Run2 || rs == eSim_Run1) { // ----------------------------------------------------------------------------- @@ -10428,6 +10605,8 @@ void DetermineReferenceMultiplicity(T const& collision) ebye.fReferenceMultiplicity = collision.multFT0M(); } else if (ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("multNTracksPV", TString::kIgnoreCase)) { ebye.fReferenceMultiplicity = collision.multNTracksPV(); + } else if (ec.fsEventCuts[eReferenceMultiplicityEstimator].EqualTo("multNTracksGlobal", TString::kIgnoreCase)) { + // ebye.fReferenceMultiplicity = collision.multNTracksGlobal(); // TBI 20241209 not validated yet } else { LOGF(fatal, "\033[1;31m%s at line %d : reference multiplicity estimator = %d is not supported yet for Run 3. \033[0m", __FUNCTION__, __LINE__, ec.fsEventCuts[eReferenceMultiplicityEstimator].Data()); } @@ -10438,6 +10617,7 @@ void DetermineReferenceMultiplicity(T const& collision) qa.fReferenceMultiplicity[eMultFT0C] = collision.multFT0C(); qa.fReferenceMultiplicity[eMultFT0M] = collision.multFT0M(); qa.fReferenceMultiplicity[eMultNTracksPV] = collision.multNTracksPV(); + // qa.fReferenceMultiplicity[eMultNTracksGlobal] = collision.multNTracksGlobal(); // TBI 20241209 not validated yet } // TBI 20241123 check if corresponding simulated ref. mult. is available through collision.has_mcCollision() diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx index 26bf84b0403..6bf5b16249f 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx @@ -29,11 +29,12 @@ using BCs_Run3 = soa::Join; // TBI 20241209 validating "MultsGlobal" +// for using collision.multNTracksGlobal() using EventSelection = soa::Join; using CollisionRec = soa::Join::iterator; // use in json "isMC": "true" for "event-selection-task" using CollisionRecSim = soa::Join::iterator; -// using CollisionRecSim = soa::Join::iterator; -// using CollisionRecSim = soa::Join::iterator; +// using CollisionRecSim = soa::Join::iterator; // TBI 20241210 validating "MultsExtraMC" for multMCNParticlesEta08 using CollisionSim = aod::McCollision; using TracksRec = soa::Join; // using TrackRec = soa::Join::iterator; From f77ad467b64b59feee221ea05a8ad4afb6cab7b4 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Wed, 11 Dec 2024 00:31:00 +0100 Subject: [PATCH 316/459] [PWGCF] FemtoUniverse: Removing V0-MClabels in data (#8912) --- PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 0599cd04f02..9aa30f2939f 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -1839,7 +1839,7 @@ struct femtoUniverseProducerTask { void processV0CentRun3Data(aod::FemtoFullCollisionCentRun3 const& col, aod::BCsWithTimestamps const&, soa::Filtered const& tracks, - soa::Join const& fullV0s) + aod::V0Datas const& fullV0s) { // get magnetic field for run auto bc = col.bc_as(); From 650f01a63271f5a29a1a03818e99edcef3c3aa6d Mon Sep 17 00:00:00 2001 From: Zhenjun Xiong <108917659+zjxiongOvO@users.noreply.github.com> Date: Wed, 11 Dec 2024 17:00:54 +0800 Subject: [PATCH 317/459] [PWGDQ] Updates for X(3872) analysis (#8898) --- PWGDQ/Core/CutsLibrary.cxx | 25 +- PWGDQ/Core/HistogramsLibrary.cxx | 11 + PWGDQ/Core/MCSignalLibrary.cxx | 78 +++++++ PWGDQ/Core/VarManager.h | 36 +++ PWGDQ/DataModel/ReducedInfoTables.h | 56 +++++ PWGDQ/Tasks/dqEfficiency.cxx | 344 ++++++++++++++++++++++++++-- PWGDQ/Tasks/tableReader.cxx | 243 +++++++++----------- 7 files changed, 628 insertions(+), 165 deletions(-) diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index 67e15aad17d..20ae5000bc8 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -907,7 +907,7 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) } if (!nameStr.compare("Jpsi_TPCPost_calib_debug8")) { - cut->AddCut(GetAnalysisCut("jpsi_trackCut_debug3")); + cut->AddCut(GetAnalysisCut("jpsi_trackCut_debug5")); cut->AddCut(GetAnalysisCut("jpsi_TPCPID_debug8")); return cut; } @@ -3897,6 +3897,14 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("jpsi_trackCut_debug5")) { + cut->AddCut(VarManager::kEta, -0.9, 0.9); + cut->AddCut(VarManager::kTPCchi2, 0.0, 4.0); + cut->AddCut(VarManager::kTPCncls, 70., 159); + cut->AddCut(VarManager::kIsITSibAny, 0.5, 1.5); + return cut; + } + if (!nameStr.compare("lmee_trackCut_debug")) { cut->AddCut(VarManager::kEta, -0.9, 0.9); cut->AddCut(VarManager::kTPCchi2, 0.0, 4.0); @@ -4155,9 +4163,7 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) if (!nameStr.compare("pionQualityCut1")) { cut->AddCut(VarManager::kPt, 0.15, 1000.0); cut->AddCut(VarManager::kIsITSibAny, 0.5, 1.5); - cut->AddCut(VarManager::kTPCncls, 100, 161); - cut->AddCut(VarManager::kTrackDCAxy, -0.05, 0.05); - cut->AddCut(VarManager::kTrackDCAz, -0.1, 0.1); + cut->AddCut(VarManager::kTPCncls, 70, 161); return cut; } @@ -4431,10 +4437,11 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) } if (!nameStr.compare("jpsi_TPCPID_debug8")) { - cut->AddCut(VarManager::kTOFbeta, 0.975, 1.025, false, VarManager::kPin, 0.0, 3.0); - cut->AddCut(VarManager::kTPCnSigmaEl, -3.0, 4.0); - cut->AddCut(VarManager::kTPCnSigmaPi, 2.0, 999, false, VarManager::kPin, 3.0, 999.0); - cut->AddCut(VarManager::kTPCnSigmaPr, 2.0, 999, false, VarManager::kPin, 3.0, 999.0); + cut->AddCut(VarManager::kTPCnSigmaEl, -2.0, 3.0, false, VarManager::kPin, 0.0, 3.0); + cut->AddCut(VarManager::kTPCnSigmaEl, -3.0, 3.0, false, VarManager::kPin, 3.0, 999.0); + cut->AddCut(VarManager::kTPCnSigmaPi, 3.0, 999, false, VarManager::kPin, 0.0, 3.0); + cut->AddCut(VarManager::kTPCnSigmaPi, 2.0, 999, false, VarManager::kPin, 5.0, 999.0); + cut->AddCut(VarManager::kTPCnSigmaPr, 3.0, 999, false, VarManager::kPin, 3.0, 999.0); return cut; } @@ -5864,7 +5871,7 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) } if (!nameStr.compare("pairX3872")) { - cut->AddCut(VarManager::kCosthetaDileptonDitrack, 0.98, 1); + cut->AddCut(VarManager::kQ, 0.0, 0.3); return cut; } diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 57f14eee0b9..c55f34bf1c9 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -854,6 +854,17 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kEta, 200, 0.0, 20.0, VarManager::kPt); hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kEta, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kPhi); } + if (!groupStr.CompareTo("mctruth_quad")) { + hm->AddHistogram(histClass, "hMass_defaultDileptonMass", "", false, 1000, 3.0, 5.0, VarManager::kQuadDefaultDileptonMass); + hm->AddHistogram(histClass, "hPt", "", false, 150, 0.0, 15.0, VarManager::kQuadPt); + hm->AddHistogram(histClass, "hMass_defaultDileptonMass_Pt", "", false, 100, 3.0, 5.0, VarManager::kQuadDefaultDileptonMass, 150, 0.0, 15.0, VarManager::kQuadPt); + hm->AddHistogram(histClass, "hQ", "", false, 150, 0.0, 3.0, VarManager::kQ); + hm->AddHistogram(histClass, "hDeltaR1", "", false, 100, 0.0, 10.0, VarManager::kDeltaR1); + hm->AddHistogram(histClass, "hDeltaR2", "", false, 100, 0.0, 10.0, VarManager::kDeltaR2); + hm->AddHistogram(histClass, "hDiTrackMass", "", false, 300, 0.0, 3.0, VarManager::kDitrackMass); + hm->AddHistogram(histClass, "hMCPt_MCRap", "", false, 200, 0.0, 20.0, VarManager::kMCPt, 100, -2.0, 2.0, VarManager::kMCY); + hm->AddHistogram(histClass, "hMCPhi", "", false, 100, -TMath::Pi(), TMath::Pi(), VarManager::kMCPhi); + } if (!groupStr.CompareTo("mctruth_track")) { hm->AddHistogram(histClass, "PtMC", "MC pT", false, 200, 0.0, 20.0, VarManager::kMCPt); hm->AddHistogram(histClass, "EtaMC", "MC #eta", false, 50, -5.0, 5.0, VarManager::kMCEta); diff --git a/PWGDQ/Core/MCSignalLibrary.cxx b/PWGDQ/Core/MCSignalLibrary.cxx index 54cf2cb549a..22f445252f9 100644 --- a/PWGDQ/Core/MCSignalLibrary.cxx +++ b/PWGDQ/Core/MCSignalLibrary.cxx @@ -1325,5 +1325,83 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) signal = new MCSignal(name, "Photon and electron pair from Pi0", {pronge, pronge, prongPhoton}, {1, 1, 1}); return signal; } + + //-------------------------------------------------------------------------------- + + if (!nameStr.compare("JpsiFromX3872")) { + MCProng prong(1, {443}, {true}, {false}, {0}, {0}, {false}, false, {9920443}, {false}); + signal = new MCSignal(name, "Jpsi from X3872", {prong}, {-1}); + return signal; + } + + if (!nameStr.compare("eFromX3872")) { + MCProng prong(3, {11, 443, 9920443}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + signal = new MCSignal(name, "Electron from Jpsi from X3872", {prong}, {1}); + return signal; + } + + if (!nameStr.compare("PionFromX3872")) { + MCProng prong(1, {211}, {true}, {false}, {0}, {0}, {false}, false, {9920443}, {false}); + signal = new MCSignal(name, "Pion from Jpsi from X3872", {prong}, {-1}); + return signal; + } + + if (!nameStr.compare("JpsiFromPsi2S")) { + MCProng prong(1, {443}, {true}, {false}, {0}, {0}, {false}, false, {100443}, {false}); + signal = new MCSignal(name, "Jpsi from Psi2S", {prong}, {-1}); + return signal; + } + + if (!nameStr.compare("eFromPsi2S")) { + MCProng prong(3, {11, 443, 100443}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + signal = new MCSignal(name, "Electron from Jpsi from Psi2S", {prong}, {1}); + return signal; + } + + if (!nameStr.compare("PionFromPsi2S")) { + MCProng prong(1, {211}, {true}, {false}, {0}, {0}, {false}, false, {100443}, {false}); + signal = new MCSignal(name, "Pion from Jpsi from Psi2S", {prong}, {-1}); + return signal; + } + + if (!nameStr.compare("eeFromJpsiFromX3872")) { + MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}, false, {9920443}, {false}); + signal = new MCSignal(name, "Electron pair from Jpsi from X3872", {prong, prong}, {1, 1}); + return signal; + } + + if (!nameStr.compare("JpsiPiPiFromX3872")) { + MCProng prongJpsi(2, {443, 9920443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + MCProng prongPi(2, {211, 9920443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Jpsi and pion pair from X3872", {prongJpsi, prongPi, prongPi}, {1, 1, 1}); + return signal; + } + + if (!nameStr.compare("eePiPiFromX3872")) { + MCProng pronge(3, {11, 443, 9920443}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + MCProng prongPi(2, {211, 9920443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Electron pair and pion pair from X3872", {pronge, pronge, prongPi, prongPi}, {2, 2, 1, 1}); + return signal; + } + + if (!nameStr.compare("eeFromJpsiFromPsi2S")) { + MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}, false, {100443}, {false}); + signal = new MCSignal(name, "Electron pair from Jpsi from Psi2S", {prong, prong}, {1, 1}); + return signal; + } + + if (!nameStr.compare("JpsiPiPiFromPsi2S")) { + MCProng prongJpsi(2, {443, 100443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + MCProng prongPi(2, {211, 100443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Jpsi and pion pair from Psi2S", {prongJpsi, prongPi, prongPi}, {1, 1, 1}); + return signal; + } + + if (!nameStr.compare("eePiPiFromPsi2S")) { + MCProng pronge(3, {11, 443, 100443}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + MCProng prongPi(2, {211, 100443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Electron pair and pion pair from Psi2S", {pronge, pronge, prongPi, prongPi}, {2, 2, 1, 1}); + return signal; + } return nullptr; } diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index da676f4137a..bf328b6fa0c 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -989,6 +989,8 @@ class VarManager : public TObject static void FillPairMC(T1 const& t1, T2 const& t2, float* values = nullptr, PairCandidateType pairType = kDecayToEE); template static void FillTripleMC(T1 const& t1, T2 const& t2, T3 const& t3, float* values = nullptr, PairCandidateType pairType = kTripleCandidateToEEPhoton); + template + static void FillQaudMC(T1 const& t1, T2 const& t2, T2 const& t3, float* values = nullptr); template static void FillPairVertexing(C const& collision, T const& t1, T const& t2, bool propToSV = false, float* values = nullptr); template @@ -4556,6 +4558,40 @@ void VarManager::FillDileptonTrackTrack(T1 const& dilepton, T2 const& hadron1, T } } +//__________________________________________________________________ +template +void VarManager::FillQaudMC(T1 const& dilepton, T2 const& track1, T2 const& track2, float* values) +{ + if (!values) { + values = fgValues; + } + + double defaultDileptonMass = 3.096; + double hadronMass1 = o2::constants::physics::MassPionCharged; + double hadronMass2 = o2::constants::physics::MassPionCharged; + if (candidateType == kXtoJpsiPiPi) { + defaultDileptonMass = 3.096; + hadronMass1 = o2::constants::physics::MassPionCharged; + hadronMass2 = o2::constants::physics::MassPionCharged; + } + + ROOT::Math::PtEtaPhiMVector v1(dilepton.pt(), dilepton.eta(), dilepton.phi(), defaultDileptonMass); + ROOT::Math::PtEtaPhiMVector v2(track1.pt(), track1.eta(), track1.phi(), hadronMass1); + ROOT::Math::PtEtaPhiMVector v3(track2.pt(), track2.eta(), track2.phi(), hadronMass2); + ROOT::Math::PtEtaPhiMVector v123 = v1 + v2 + v3; + ROOT::Math::PtEtaPhiMVector v23 = v2 + v3; + values[kQuadMass] = v123.M(); + values[kQuadDefaultDileptonMass] = v123.M(); + values[kQuadPt] = v123.Pt(); + values[kQuadEta] = v123.Eta(); + values[kQuadPhi] = v123.Phi(); + values[kQ] = v123.M() - defaultDileptonMass - v23.M(); + values[kDeltaR1] = sqrt(pow(v1.Eta() - v2.Eta(), 2) + pow(v1.Phi() - v2.Phi(), 2)); + values[kDeltaR2] = sqrt(pow(v1.Eta() - v3.Eta(), 2) + pow(v1.Phi() - v3.Phi(), 2)); + values[kDitrackMass] = v23.M(); + values[kDitrackPt] = v23.Pt(); +} + //__________________________________________________________________ template float VarManager::calculatePhiV(T1 const& t1, T2 const& t2) diff --git a/PWGDQ/DataModel/ReducedInfoTables.h b/PWGDQ/DataModel/ReducedInfoTables.h index 587c70349e2..2c868f0873b 100644 --- a/PWGDQ/DataModel/ReducedInfoTables.h +++ b/PWGDQ/DataModel/ReducedInfoTables.h @@ -893,6 +893,62 @@ DECLARE_SOA_TABLE(DileptonTrackCandidates, "AOD", "RTDILEPTONTRACK", //! using DileptonTrackCandidate = DileptonTrackCandidates::iterator; +// candidate information +namespace dileptonTrackTrackCandidate +{ +// infotmation about the dilepton-track-track +DECLARE_SOA_COLUMN(Mass, mass, float); //! +DECLARE_SOA_COLUMN(Pt, pt, float); //! +DECLARE_SOA_COLUMN(Eta, eta, float); //! +DECLARE_SOA_COLUMN(Phi, phi, float); //! +DECLARE_SOA_COLUMN(Rap, rap, float); //! +DECLARE_SOA_COLUMN(DeltaQ, deltaQ, float); //! +DECLARE_SOA_COLUMN(R1, r1, float); //! distance between the dilepton and the track1 in theta-phi plane +DECLARE_SOA_COLUMN(R2, r2, float); //! distance between the dilepton and the track2 in theta-phi plane +DECLARE_SOA_COLUMN(DileptonMass, dileptonMass, float); //! +DECLARE_SOA_COLUMN(DileptonPt, dileptonPt, float); //! +DECLARE_SOA_COLUMN(DileptonEta, dileptonEta, float); //! +DECLARE_SOA_COLUMN(DileptonPhi, dileptonPhi, float); //! +DECLARE_SOA_COLUMN(DileptonSign, dileptonSign, int); //! +DECLARE_SOA_COLUMN(DiTracksMass, diTracksMass, float); //! +DECLARE_SOA_COLUMN(DiTracksPt, diTracksPt, float); //! +DECLARE_SOA_COLUMN(TrackPt1, trackPt1, float); //! +DECLARE_SOA_COLUMN(TrackPt2, trackPt2, float); //! +DECLARE_SOA_COLUMN(TrackEta1, trackEta1, float); //! +DECLARE_SOA_COLUMN(TrackEta2, trackEta2, float); //! +DECLARE_SOA_COLUMN(TrackPhi1, trackPhi1, float); //! +DECLARE_SOA_COLUMN(TrackPhi2, trackPhi2, float); //! +DECLARE_SOA_COLUMN(TrackSign1, trackSign1, int); //! +DECLARE_SOA_COLUMN(TrackSign2, trackSign2, int); //! +} // namespace dileptonTrackTrackCandidate + +DECLARE_SOA_TABLE(DileptonTrackTrackCandidates, "AOD", "RTDQUADPLET", //! + dileptonTrackTrackCandidate::Mass, + dileptonTrackTrackCandidate::Pt, + dileptonTrackTrackCandidate::Eta, + dileptonTrackTrackCandidate::Phi, + dileptonTrackTrackCandidate::Rap, + dileptonTrackTrackCandidate::DeltaQ, + dileptonTrackTrackCandidate::R1, + dileptonTrackTrackCandidate::R2, + dileptonTrackTrackCandidate::DileptonMass, + dileptonTrackTrackCandidate::DileptonPt, + dileptonTrackTrackCandidate::DileptonEta, + dileptonTrackTrackCandidate::DileptonPhi, + dileptonTrackTrackCandidate::DileptonSign, + dileptonTrackTrackCandidate::DiTracksMass, + dileptonTrackTrackCandidate::DiTracksPt, + dileptonTrackTrackCandidate::TrackPt1, + dileptonTrackTrackCandidate::TrackPt2, + dileptonTrackTrackCandidate::TrackEta1, + dileptonTrackTrackCandidate::TrackEta2, + dileptonTrackTrackCandidate::TrackPhi1, + dileptonTrackTrackCandidate::TrackPhi2, + dileptonTrackTrackCandidate::TrackSign1, + dileptonTrackTrackCandidate::TrackSign2); + +using DileptonTrackTrackCandidate = DileptonTrackTrackCandidates::iterator; + namespace v0bits { DECLARE_SOA_COLUMN(PIDBit, pidbit, uint8_t); //! diff --git a/PWGDQ/Tasks/dqEfficiency.cxx b/PWGDQ/Tasks/dqEfficiency.cxx index ee8cd2af5c1..e978fbf4bff 100644 --- a/PWGDQ/Tasks/dqEfficiency.cxx +++ b/PWGDQ/Tasks/dqEfficiency.cxx @@ -19,6 +19,9 @@ #include #include #include +#include +#include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -264,7 +267,7 @@ struct AnalysisTrackSelection { int i = 0; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, i++) { if ((*cut).IsSelected(VarManager::fgValues)) { - filterMap |= (uint32_t(1) << i); + filterMap |= (static_cast(1) << i); if (fConfigQA) { fHistMan->FillHistClass(fHistNamesReco[i].Data(), VarManager::fgValues); } @@ -285,19 +288,19 @@ struct AnalysisTrackSelection { for (auto sig = fMCSignals.begin(); sig != fMCSignals.end(); sig++, isig++) { if constexpr ((TTrackFillMap & VarManager::ObjTypes::ReducedTrack) > 0) { if ((*sig).CheckSignal(false, track.reducedMCTrack())) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } if constexpr ((TTrackFillMap & VarManager::ObjTypes::Track) > 0) { if ((*sig).CheckSignal(false, track.template mcParticle_as())) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } } // fill histograms for (unsigned int i = 0; i < fMCSignals.size(); i++) { - if (!(mcDecision & (uint32_t(1) << i))) { + if (!(mcDecision & (static_cast(1) << i))) { continue; } for (unsigned int j = 0; j < fTrackCuts.size(); j++) { @@ -313,11 +316,16 @@ struct AnalysisTrackSelection { { runSelection(event, tracks, eventsMC, tracksMC); } + void processSkimmedWithCov(MyEventsSelected::iterator const& event, MyBarrelTracksWithCov const& tracks, ReducedMCEvents const& eventsMC, ReducedMCTracks const& tracksMC) + { + runSelection(event, tracks, eventsMC, tracksMC); + } void processDummy(MyEvents&) { // do nothing } + PROCESS_SWITCH(AnalysisTrackSelection, processSkimmedWithCov, "Run barrel track selection on DQ skimmed tracks with covariance", false); PROCESS_SWITCH(AnalysisTrackSelection, processSkimmed, "Run barrel track selection on DQ skimmed tracks", false); PROCESS_SWITCH(AnalysisTrackSelection, processDummy, "Dummy process function", false); }; @@ -429,7 +437,7 @@ struct AnalysisMuonSelection { int i = 0; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, i++) { if ((*cut).IsSelected(VarManager::fgValues)) { - filterMap |= (uint32_t(1) << i); + filterMap |= (static_cast(1) << i); if (fConfigQA) { fHistMan->FillHistClass(fHistNamesReco[i].Data(), VarManager::fgValues); } @@ -453,19 +461,19 @@ struct AnalysisMuonSelection { for (auto sig = fMCSignals.begin(); sig != fMCSignals.end(); sig++, isig++) { if constexpr ((TMuonFillMap & VarManager::ObjTypes::ReducedMuon) > 0) { if ((*sig).CheckSignal(false, muon.reducedMCTrack())) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } if constexpr ((TMuonFillMap & VarManager::ObjTypes::Muon) > 0) { if ((*sig).CheckSignal(false, muon.template mcParticle_as())) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } } // fill histograms for (unsigned int i = 0; i < fMCSignals.size(); i++) { - if (!(mcDecision & (uint32_t(1) << i))) { + if (!(mcDecision & (static_cast(1) << i))) { continue; } for (unsigned int j = 0; j < fTrackCuts.size(); j++) { @@ -767,13 +775,13 @@ struct AnalysisSameEventPairing { for (auto& [t1, t2] : combinations(tracks1, tracks2)) { if constexpr (TPairType == VarManager::kDecayToEE) { - twoTrackFilter = uint32_t(t1.isBarrelSelected()) & uint32_t(t2.isBarrelSelected()); + twoTrackFilter = static_cast(t1.isBarrelSelected()) & static_cast(t2.isBarrelSelected()); } if constexpr (TPairType == VarManager::kDecayToMuMu) { - twoTrackFilter = uint32_t(t1.isMuonSelected()) & uint32_t(t2.isMuonSelected()); + twoTrackFilter = static_cast(t1.isMuonSelected()) & static_cast(t2.isMuonSelected()); } if constexpr (TPairType == VarManager::kElectronMuon) { - twoTrackFilter = uint32_t(t1.isBarrelSelected()) & uint32_t(t2.isMuonSelected()); + twoTrackFilter = static_cast(t1.isBarrelSelected()) & static_cast(t2.isMuonSelected()); } if (!twoTrackFilter) { // the tracks must have at least one filter bit in common to continue continue; @@ -790,12 +798,12 @@ struct AnalysisSameEventPairing { for (auto sig = fRecMCSignals.begin(); sig != fRecMCSignals.end(); sig++, isig++) { if constexpr (TTrackFillMap & VarManager::ObjTypes::ReducedTrack || TTrackFillMap & VarManager::ObjTypes::ReducedMuon) { // for skimmed DQ model if ((*sig).CheckSignal(false, t1.reducedMCTrack(), t2.reducedMCTrack())) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } if constexpr (TTrackFillMap & VarManager::ObjTypes::Track || TTrackFillMap & VarManager::ObjTypes::Muon) { // for Framework data model if ((*sig).CheckSignal(false, t1.template mcParticle_as(), t2.template mcParticle_as())) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } } // end loop over MC signals @@ -865,7 +873,7 @@ struct AnalysisSameEventPairing { fHistMan->FillHistClass(Form("%s_unambiguous", histNames[icut][0].Data()), VarManager::fgValues); } for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { - if (mcDecision & (uint32_t(1) << isig)) { + if (mcDecision & (static_cast(1) << isig)) { fHistMan->FillHistClass(histNamesMCmatched[icut][isig].Data(), VarManager::fgValues); if (fConfigAmbiguousHist && !(t1.isAmbiguous() || t2.isAmbiguous())) { fHistMan->FillHistClass(Form("%s_unambiguous", histNamesMCmatched[icut][isig].Data()), VarManager::fgValues); @@ -1195,13 +1203,13 @@ struct AnalysisDileptonTrack { for (auto sig = fRecMCSignals.begin(); sig != fRecMCSignals.end(); sig++, isig++) { if constexpr (TTrackFillMap & VarManager::ObjTypes::ReducedTrack || TTrackFillMap & VarManager::ObjTypes::ReducedMuon) { // for skimmed DQ model if ((*sig).CheckSignal(false, lepton1MC, lepton2MC)) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } } // end loop over MC signals for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { - if (mcDecision & (uint32_t(1) << isig)) { + if (mcDecision & (static_cast(1) << isig)) { fHistMan->FillHistClass(Form("DileptonsSelected_matchedMC_%s", fRecMCSignalsNames[isig].Data()), fValuesDilepton); } } @@ -1227,7 +1235,7 @@ struct AnalysisDileptonTrack { for (auto sig = fRecMCSignals.begin(); sig != fRecMCSignals.end(); sig++, isig++) { if constexpr (TTrackFillMap & VarManager::ObjTypes::ReducedTrack || TTrackFillMap & VarManager::ObjTypes::ReducedMuon || TTrackFillMap & VarManager::ObjTypes::ReducedMuon) { // for skimmed DQ model if ((*sig).CheckSignal(false, lepton1MC, lepton2MC, trackMC)) { - mcDecision |= (uint32_t(1) << isig); + mcDecision |= (static_cast(1) << isig); } } } @@ -1237,7 +1245,7 @@ struct AnalysisDileptonTrack { } for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { - if (mcDecision & (uint32_t(1) << isig)) { + if (mcDecision & (static_cast(1) << isig)) { fHistMan->FillHistClass(Form("DileptonTrackInvMass_matchedMC_%s", fRecMCSignalsNames[isig].Data()), fValuesTrack); } } @@ -1301,6 +1309,297 @@ struct AnalysisDileptonTrack { PROCESS_SWITCH(AnalysisDileptonTrack, processDummy, "Dummy function", false); }; +struct AnalysisDileptonTrackTrack { + OutputObj fOutputList{"output"}; + + Configurable fConfigTrackCut1{"cfgTrackCut1", "pionPIDCut1", "track1 cut"}; // used for select the tracks from SelectedTracks + Configurable fConfigTrackCut2{"cfgTrackCut2", "pionPIDCut2", "track2 cut"}; // used for select the tracks from SelectedTracks + Configurable fConfigDileptonCut{"cfgDileptonCut", "pairJpsi2", "Dilepton cut"}; + Configurable fConfigQuadrupletCuts{"cfgQuadrupletCuts", "pairX3872Cut1", "Comma separated list of Dilepton-Track-Track cut"}; + Configurable fConfigMCRecSignals{"cfgBarrelMCRecSignals", "", "Comma separated list of MC signals (reconstructed)"}; + Configurable fConfigMCGenSignals{"cfgBarrelMCGenSignals", "", "Comma separated list of MC signals (generated)"}; + Configurable fConfigDileptonMCRecSignal{"cfgDileptonMCRecSignal", "", "Comma separated list of MC signals (reconstructed)"}; + + Produces DileptonTrackTrackTable; + HistogramManager* fHistMan; + + std::vector fRecMCSignalsNames; + std::vector fRecMCSignals; + std::vector fGenMCSignals; + std::vector fDileptonMCRecSignals; + + Filter eventFilter = aod::dqanalysisflags::isEventSelected == 1; + Filter dileptonFilter = aod::reducedpair::sign == 0; + Filter filterBarrelTrackSelected = aod::dqanalysisflags::isBarrelSelected > 0; + + float* fValuesQuadruplet; + + std::vector fQuadrupletCutNames; + AnalysisCompositeCut fDileptonCut; + std::vector fQuadrupletCuts; + TString fTrackCutName1; + TString fTrackCutName2; + bool fIsSameTrackCut = false; + + constexpr static uint32_t fgDileptonFillMap = VarManager::ObjTypes::ReducedTrack | VarManager::ObjTypes::Pair; // fill map + + void init(o2::framework::InitContext& context) + { + if (context.mOptions.get("processDummy")) { + return; + } + + fValuesQuadruplet = new float[VarManager::kNVars]; + VarManager::SetDefaultVarNames(); + fHistMan = new HistogramManager("analysisHistos", "aa", VarManager::kNVars); + fHistMan->SetUseDefaultVariableNames(kTRUE); + fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); + + TString histNames; + + // check if the same track cuts are used for both tracks + if (fConfigTrackCut1.value == fConfigTrackCut2.value) { + fIsSameTrackCut = true; + } + fTrackCutName1 = fConfigTrackCut1.value; + fTrackCutName2 = fConfigTrackCut2.value; + + // dilepton cut + TString configDileptonCutNamesStr = fConfigDileptonCut.value; + fDileptonCut = *dqcuts::GetCompositeCut(configDileptonCutNamesStr.Data()); + + // dilepton-track-track cuts + TString configQuadruletCutNamesStr = fConfigQuadrupletCuts.value; + std::unique_ptr objArray(configQuadruletCutNamesStr.Tokenize(",")); + for (Int_t icut = 0; icut < objArray->GetEntries(); ++icut) { + TString cutName = objArray->At(icut)->GetName(); + fQuadrupletCutNames.push_back(cutName); + fQuadrupletCuts.push_back(*dqcuts::GetCompositeCut(cutName.Data())); + } + + // reconstructible MC signals + TString sigNamesStr = fConfigMCRecSignals.value; + std::unique_ptr objRecSigArray(sigNamesStr.Tokenize(",")); + for (int isig = 0; isig < objRecSigArray->GetEntries(); ++isig) { + MCSignal* sig = o2::aod::dqmcsignals::GetMCSignal(objRecSigArray->At(isig)->GetName()); + if (sig) { + if (sig->GetNProngs() == 3) { + fRecMCSignals.push_back(*sig); + } + } + } + + // fill the histogram names + if (!context.mOptions.get("processDummy")) { + // Title_DileptonTrackTrackCutName + if (!configQuadruletCutNamesStr.IsNull()) { + for (Int_t icut = 0; icut < fQuadrupletCutNames.size(); ++icut) { + if (fIsSameTrackCut) { + histNames += Form("QuadrupletSEPM_%s;", fQuadrupletCutNames[icut].Data()); + } else { + histNames += Form("QuadrupletSEPM_%s;", fQuadrupletCutNames[icut].Data()); + histNames += Form("QuadrupletSEMP_%s;", fQuadrupletCutNames[icut].Data()); + } + histNames += Form("QuadrupletSEPP_%s;", fQuadrupletCutNames[icut].Data()); + histNames += Form("QuadrupletSEMM_%s;", fQuadrupletCutNames[icut].Data()); + // Reco MC signals + for (int isig = 0; isig < objRecSigArray->GetEntries(); ++isig) { + MCSignal* sig = o2::aod::dqmcsignals::GetMCSignal(objRecSigArray->At(isig)->GetName()); + if (sig) { + if (sig->GetNProngs() == 4) { + fRecMCSignals.push_back(*sig); + fRecMCSignalsNames.push_back(sig->GetName()); + histNames += Form("MCTruthRecQaud_%s_%s;", fQuadrupletCutNames[icut].Data(), sig->GetName()); + } + } + } + } // loop over dilepton-track-track cuts + } + } + + // Genarate MC signals + TString sigGenNamesStr = fConfigMCGenSignals.value; + std::unique_ptr objGenSigArray(sigGenNamesStr.Tokenize(",")); + for (int isig = 0; isig < objGenSigArray->GetEntries(); isig++) { + MCSignal* sig = o2::aod::dqmcsignals::GetMCSignal(objGenSigArray->At(isig)->GetName()); + if (sig) { + if (sig->GetNProngs() == 1) { // NOTE: 1-prong signals required + fGenMCSignals.push_back(*sig); + histNames += Form("MCTruthGenQaud_%s;", sig->GetName()); // TODO: Add these names to a std::vector to avoid using Form in the process function + } + } + } + + DefineHistograms(fHistMan, histNames.Data()); // define all histograms + VarManager::SetUseVars(fHistMan->GetUsedVars()); + fOutputList.setObject(fHistMan->GetMainHistogramList()); + + // dilepton MC signal + TString configDileptonMCRecSignalStr = fConfigDileptonMCRecSignal.value; + std::unique_ptr objDileptonMCRecSignalArray(configDileptonMCRecSignalStr.Tokenize(",")); + for (int isig = 0; isig < objDileptonMCRecSignalArray->GetEntries(); isig++) { + MCSignal* sig = o2::aod::dqmcsignals::GetMCSignal(objDileptonMCRecSignalArray->At(isig)->GetName()); + if (sig) { + if (sig->GetNProngs() == 2) { + fDileptonMCRecSignals.push_back(*sig); + } + } + } + } + + // Template function to run pair - track - track combinations + template + void runDileptonTrackTrack(TEvent const& event, TTracks const& tracks, TDileptons const& dileptons, TEventsMC const& /*eventsMC*/, TTracksMC const& /*tracksMC*/) + { + VarManager::ResetValues(0, VarManager::kNVars, fValuesQuadruplet); + VarManager::FillEvent(event, fValuesQuadruplet); + + // LOGF(info, "Number of dileptons: %d", dileptons.size()); + int indexOffset = -999; + std::vector trackGlobalIndexes; + + if (dileptons.size() > 0) { + for (auto track : tracks) { + trackGlobalIndexes.push_back(track.globalIndex()); + // std::cout << track.index() << " " << track.globalIndex() << std::endl; + } + } + + // loop over dileptons + for (auto dilepton : dileptons) { + VarManager::FillTrack(dilepton, fValuesQuadruplet); + + // apply the dilepton cut + if (!fDileptonCut.IsSelected(fValuesQuadruplet)) + continue; + + // get the index of the electron legs + int indexLepton1 = dilepton.index0Id(); + int indexLepton2 = dilepton.index1Id(); + + if (indexOffset == -999) { + indexOffset = trackGlobalIndexes.at(0); + } + trackGlobalIndexes.clear(); + + auto lepton1 = tracks.iteratorAt(indexLepton1 - indexOffset); + auto lepton2 = tracks.iteratorAt(indexLepton2 - indexOffset); + + auto lepton1MC = lepton1.reducedMCTrack(); + auto lepton2MC = lepton2.reducedMCTrack(); + + // loop over track - track combinations + for (auto& [t1, t2] : combinations(tracks, tracks)) { + // avoid self-combinations + if (t1.globalIndex() == indexLepton1 || t1.globalIndex() == indexLepton2 || t2.globalIndex() == indexLepton1 || t2.globalIndex() == indexLepton2) { + // LOGF(info, "self-combination: %d=%d %d=%d", t1.globalIndex(), indexLepton1, indexLepton2, t2.globalIndex()); + continue; + } + + // dilepton combinate with two same particles + if ((fIsSameTrackCut && (t1.isBarrelSelected() & (static_cast(1) << 1)) && (t2.isBarrelSelected() & (static_cast(1) << 1))) || + (!fIsSameTrackCut && (t1.isBarrelSelected() & (static_cast(1) << 1)) && (t2.isBarrelSelected() & (static_cast(1) << 2)))) { + } else { + continue; + } + + // Fill the Histograms + VarManager::FillDileptonTrackTrack(dilepton, t1, t2, fValuesQuadruplet); + uint32_t CutDecision = 0; + uint32_t mcDecision = 0; + int iCut = 0; + for (auto cut = fQuadrupletCuts.begin(); cut != fQuadrupletCuts.end(); cut++, iCut++) { + if (cut->IsSelected(fValuesQuadruplet)) { + CutDecision |= (static_cast(1) << iCut); + if (fIsSameTrackCut) { + if (t1.sign() * t2.sign() < 0) { + fHistMan->FillHistClass(Form("QuadrupletSEPM_%s", fQuadrupletCutNames[iCut].Data()), fValuesQuadruplet); + } + } else { + if ((t1.sign() < 0) && (t2.sign() > 0)) { + fHistMan->FillHistClass(Form("QuadrupletSEMP_%s", fQuadrupletCutNames[iCut].Data()), fValuesQuadruplet); + } else if ((t1.sign() > 0) && (t2.sign() < 0)) { + fHistMan->FillHistClass(Form("QuadrupletSEPM_%s", fQuadrupletCutNames[iCut].Data()), fValuesQuadruplet); + } + } + if ((t1.sign() > 0) && (t2.sign() > 0)) { + fHistMan->FillHistClass(Form("QuadrupletSEPP_%s", fQuadrupletCutNames[iCut].Data()), fValuesQuadruplet); + } else if ((t1.sign() < 0) && (t2.sign() < 0)) { + fHistMan->FillHistClass(Form("QuadrupletSEMM_%s", fQuadrupletCutNames[iCut].Data()), fValuesQuadruplet); + } + + // Reco MC signals + if (fRecMCSignals.size() > 0) { + int isig = 0; + for (auto sig = fRecMCSignals.begin(); sig != fRecMCSignals.end(); sig++, isig++) { + if ((*sig).CheckSignal(true, lepton1MC, lepton2MC, t1.reducedMCTrack(), t2.reducedMCTrack())) { + mcDecision |= (static_cast(1) << isig); + } + } + for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { + if (mcDecision & (static_cast(1) << isig)) { + fHistMan->FillHistClass(Form("MCTruthRecQaud_%s_%s", fQuadrupletCutNames[iCut].Data(), fRecMCSignalsNames[isig].Data()), fValuesQuadruplet); + } + } + } + } + } // end loop over cuts + + // Fill the DileptonTrackTrackCandidates table + if (!CutDecision) + continue; + if (!mcDecision) + continue; + DileptonTrackTrackTable(fValuesQuadruplet[VarManager::kQuadMass], fValuesQuadruplet[VarManager::kQuadPt], fValuesQuadruplet[VarManager::kQuadEta], fValuesQuadruplet[VarManager::kQuadPhi], fValuesQuadruplet[VarManager::kRap], + fValuesQuadruplet[VarManager::kQ], fValuesQuadruplet[VarManager::kDeltaR1], fValuesQuadruplet[VarManager::kDeltaR2], + dilepton.mass(), dilepton.pt(), dilepton.eta(), dilepton.phi(), dilepton.sign(), + fValuesQuadruplet[VarManager::kDitrackMass], fValuesQuadruplet[VarManager::kDitrackPt], t1.pt(), t2.pt(), t1.eta(), t2.eta(), t1.phi(), t2.phi(), t1.sign(), t2.sign()); + } // end loop over track - track combinations + } // end loop over dileptons + }; + + template + void runMCGen(ReducedMCTracks const& mcTracks) + { + // loop over mc stack and fill histograms for pure MC truth signals + for (auto& track : mcTracks) { + VarManager::FillTrackMC(mcTracks, track); + for (auto& sig : fGenMCSignals) { + if (sig.CheckSignal(true, track)) { + int daughterIdFirst = track.daughtersIds()[0]; + int daughterIdEnd = track.daughtersIds()[1]; + int Ndaughters = daughterIdEnd - daughterIdFirst + 1; + if (Ndaughters == 3) { + auto dilepton = mcTracks.rawIteratorAt(daughterIdFirst); + auto track1 = mcTracks.rawIteratorAt(daughterIdFirst + 1); + auto track2 = mcTracks.rawIteratorAt(daughterIdFirst + 2); + VarManager::FillQaudMC(dilepton, track1, track2); + } + fHistMan->FillHistClass(Form("MCTruthGenQaud_%s", sig.GetName()), VarManager::fgValues); + } + } + } + }; + + PresliceUnsorted perReducedMcEvent = aod::reducedtrackMC::reducedMCeventId; + + void processX3872(soa::Filtered::iterator const& event, MyBarrelTracksSelectedWithCov const& tracks, soa::Join const& dileptons, ReducedMCEvents const& eventsMC, ReducedMCTracks const& tracksMC) + { + runDileptonTrackTrack(event, tracks, dileptons, eventsMC, tracksMC); + auto groupedMCTracks = tracksMC.sliceBy(perReducedMcEvent, event.reducedMCevent().globalIndex()); + groupedMCTracks.bindInternalIndicesTo(&tracksMC); + runMCGen(groupedMCTracks); + } + + void processDummy(MyEvents&) + { + // do nothing + } + + PROCESS_SWITCH(AnalysisDileptonTrackTrack, processX3872, "Run X3872 reconstruction", false); + PROCESS_SWITCH(AnalysisDileptonTrackTrack, processDummy, "Dummy function", false); +}; + WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ @@ -1308,7 +1607,8 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; } void DefineHistograms(HistogramManager* histMan, TString histClasses) @@ -1353,6 +1653,9 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses) // histMan->AddHistogram(objArray->At(iclass)->GetName(), "Rapidity", "MC generator y distribution", false, 150, 2.5, 4.0, VarManager::kMCY); histMan->AddHistogram(objArray->At(iclass)->GetName(), "Phi", "MC generator #varphi distribution", false, 50, 0.0, 2. * TMath::Pi(), VarManager::kMCPhi); } + if (classStr.Contains("MCTruthGenQaud")) { + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_quad"); + } if (classStr.Contains("MCTruthGen")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth"); histMan->AddHistogram(objArray->At(iclass)->GetName(), "Pt_Rapidity", "MC generator p_{T}, y distribution", false, 120, 0.0, 30.0, VarManager::kMCPt, 150, 2.5, 4.0, VarManager::kMCY); @@ -1369,6 +1672,9 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses) if (classStr.Contains("DileptonTrackInvMass")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "dilepton-hadron-mass"); } + if (classStr.Contains("Quadruplet") || classStr.Contains("MCTruthRecQaud")) { + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "dilepton-dihadron", "xtojpsipipi"); + } } // end loop over histogram classes } diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index bf060637a13..6b58f40d58a 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -14,6 +14,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -76,29 +79,6 @@ DECLARE_SOA_COLUMN(TauxyBcandidate, tauxyBcandidate, float); DECLARE_SOA_COLUMN(TauzBcandidate, tauzBcandidate, float); DECLARE_SOA_COLUMN(CosPBcandidate, cosPBcandidate, float); DECLARE_SOA_COLUMN(Chi2Bcandidate, chi2Bcandidate, float); - -// Xcandidate columns -DECLARE_SOA_COLUMN(massXcandidate, MXcandidate, float); -DECLARE_SOA_COLUMN(pTXcandidate, PtXcandidate, float); -DECLARE_SOA_COLUMN(rapidityXcandidate, YXcandidate, float); -DECLARE_SOA_COLUMN(etaXcandidate, EtaXcandidate, float); -DECLARE_SOA_COLUMN(massJpsicandidate, MJpsicandidate, float); -DECLARE_SOA_COLUMN(massDipioncandidate, MDipioncandidate, float); -DECLARE_SOA_COLUMN(pTJpsicandidate, PtJpsicandidate, float); -DECLARE_SOA_COLUMN(pTDipioncandidate, PtDipioncandidate, float); -DECLARE_SOA_COLUMN(massDiff, Q, float); -DECLARE_SOA_COLUMN(angDistPion1, DeltaR1, float); -DECLARE_SOA_COLUMN(angDistPion2, DeltaR2, float); -DECLARE_SOA_COLUMN(cosDileptonDipion, CosDileptonDipion, float); -DECLARE_SOA_COLUMN(dcaxyPion1, DcaXYPion1, float); -DECLARE_SOA_COLUMN(dcazPion1, DcaZPion1, float); -DECLARE_SOA_COLUMN(dcaxyPion2, DcaXYPion2, float); -DECLARE_SOA_COLUMN(dcazPion2, DcaZPion2, float); -DECLARE_SOA_COLUMN(pTPion1, PtPion1, float); -DECLARE_SOA_COLUMN(pTPion2, PtPion2, float); -DECLARE_SOA_COLUMN(dileptonSign, DileptonSign, int); -DECLARE_SOA_COLUMN(ditrackSign, DitrackSign, int); - } // namespace dqanalysisflags DECLARE_SOA_TABLE(EventCuts, "AOD", "DQANAEVCUTS", dqanalysisflags::IsEventSelected); @@ -107,7 +87,6 @@ DECLARE_SOA_TABLE(BarrelTrackCuts, "AOD", "DQANATRKCUTS", dqanalysisflags::IsBar DECLARE_SOA_TABLE(MuonTrackCuts, "AOD", "DQANAMUONCUTS", dqanalysisflags::IsMuonSelected); DECLARE_SOA_TABLE(Prefilter, "AOD", "DQPREFILTER", dqanalysisflags::IsPrefilterVetoed); DECLARE_SOA_TABLE(BmesonCandidates, "AOD", "DQBMESONS", dqanalysisflags::massBcandidate, dqanalysisflags::pTBcandidate, dqanalysisflags::LxyBcandidate, dqanalysisflags::LxyzBcandidate, dqanalysisflags::LzBcandidate, dqanalysisflags::TauxyBcandidate, dqanalysisflags::TauzBcandidate, dqanalysisflags::CosPBcandidate, dqanalysisflags::Chi2Bcandidate); -DECLARE_SOA_TABLE(XCandidates, "AOD", "DQX3872", dqanalysisflags::massXcandidate, dqanalysisflags::pTXcandidate, dqanalysisflags::rapidityXcandidate, dqanalysisflags::etaXcandidate, dqanalysisflags::massJpsicandidate, dqanalysisflags::massDipioncandidate, dqanalysisflags::pTJpsicandidate, dqanalysisflags::pTDipioncandidate, dqanalysisflags::massDiff, dqanalysisflags::angDistPion1, dqanalysisflags::angDistPion2, dqanalysisflags::cosDileptonDipion, dqanalysisflags::dcaxyPion1, dqanalysisflags::dcazPion1, dqanalysisflags::dcaxyPion2, dqanalysisflags::dcazPion2, dqanalysisflags::pTPion1, dqanalysisflags::pTPion2, dqanalysisflags::dileptonSign, dqanalysisflags::ditrackSign); } // namespace o2::aod // Declarations of various short names @@ -423,7 +402,7 @@ struct AnalysisTrackSelection { for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, iCut++) { if ((*cut).IsSelected(VarManager::fgValues)) { if (iCut != fConfigPrefilterCutId) { - filterMap |= (uint32_t(1) << iCut); + filterMap |= (static_cast(1) << iCut); } if (iCut == fConfigPrefilterCutId) { prefilterSelected = true; @@ -519,7 +498,7 @@ struct AnalysisMuonSelection { iCut = 0; for (auto cut = fMuonCuts.begin(); cut != fMuonCuts.end(); cut++, iCut++) { if ((*cut).IsSelected(VarManager::fgValues)) { - filterMap |= (uint32_t(1) << iCut); + filterMap |= (static_cast(1) << iCut); if (fConfigQA) { // TODO: make this compile time fHistMan->FillHistClass(Form("TrackMuon_%s", (*cut).GetName()), VarManager::fgValues); } @@ -666,7 +645,7 @@ struct AnalysisEventMixing { o2::parameters::GRPMagField* grpmag = nullptr; TH1D* ResoFlowSP = nullptr; // Resolution factors for flow analysis, this will be loaded from CCDB TH1D* ResoFlowEP = nullptr; // Resolution factors for flow analysis, this will be loaded from CCDB - int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. + int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. Filter filterEventSelected = aod::dqanalysisflags::isEventSelected == 1; Filter filterTrackSelected = aod::dqanalysisflags::isBarrelSelected > 0; @@ -712,7 +691,7 @@ struct AnalysisEventMixing { Form("PairsBarrelMEMM_%s", objArray->At(icut)->GetName())}; histNames += Form("%s;%s;%s;", names[0].Data(), names[1].Data(), names[2].Data()); fTrackHistNames.push_back(names); - fTwoTrackFilterMask |= (uint32_t(1) << icut); + fTwoTrackFilterMask |= (static_cast(1) << icut); } } } @@ -731,7 +710,7 @@ struct AnalysisEventMixing { histNames += Form("%s;%s;%s;", names[0].Data(), names[1].Data(), names[2].Data()); } fMuonHistNames.push_back(names); - fTwoMuonFilterMask |= (uint32_t(1) << icut); + fTwoMuonFilterMask |= (static_cast(1) << icut); } } } @@ -749,8 +728,8 @@ struct AnalysisEventMixing { Form("PairsEleMuMEMM_%s_%s", objArrayBarrel->At(icut)->GetName(), objArrayMuon->At(icut)->GetName())}; histNames += Form("%s;%s;%s;", names[0].Data(), names[1].Data(), names[2].Data()); fTrackMuonHistNames.push_back(names); - fTwoTrackFilterMask |= (uint32_t(1) << icut); - fTwoMuonFilterMask |= (uint32_t(1) << icut); + fTwoTrackFilterMask |= (static_cast(1) << icut); + fTwoMuonFilterMask |= (static_cast(1) << icut); } } } @@ -780,13 +759,13 @@ struct AnalysisEventMixing { for (auto& track1 : tracks1) { for (auto& track2 : tracks2) { if constexpr (TPairType == VarManager::kDecayToEE) { - twoTrackFilter = uint32_t(track1.isBarrelSelected()) & uint32_t(track2.isBarrelSelected()) & fTwoTrackFilterMask; + twoTrackFilter = static_cast(track1.isBarrelSelected()) & static_cast(track2.isBarrelSelected()) & fTwoTrackFilterMask; } if constexpr (TPairType == VarManager::kDecayToMuMu) { - twoTrackFilter = uint32_t(track1.isMuonSelected()) & uint32_t(track2.isMuonSelected()) & fTwoMuonFilterMask; + twoTrackFilter = static_cast(track1.isMuonSelected()) & static_cast(track2.isMuonSelected()) & fTwoMuonFilterMask; } if constexpr (TPairType == VarManager::kElectronMuon) { - twoTrackFilter = uint32_t(track1.isBarrelSelected()) & uint32_t(track2.isMuonSelected()) & fTwoTrackFilterMask; + twoTrackFilter = static_cast(track1.isBarrelSelected()) & static_cast(track2.isMuonSelected()) & fTwoTrackFilterMask; } if (!twoTrackFilter) { // the tracks must have at least one filter bit in common to continue @@ -795,7 +774,7 @@ struct AnalysisEventMixing { VarManager::FillPairME(track1, track2); for (unsigned int icut = 0; icut < ncuts; icut++) { - if (twoTrackFilter & (uint32_t(1) << icut)) { + if (twoTrackFilter & (static_cast(1) << icut)) { if (track1.sign() * track2.sign() < 0) { fHistMan->FillHistClass(histNames[icut][0].Data(), VarManager::fgValues); if (fConfigAmbiguousHist && !(track1.isAmbiguous() || track2.isAmbiguous())) { @@ -954,7 +933,7 @@ struct AnalysisSameEventPairing { o2::base::MatLayerCylSet* lut = nullptr; TH1D* ResoFlowSP = nullptr; // Resolution factors for flow analysis, this will be loaded from CCDB TH1D* ResoFlowEP = nullptr; // Resolution factors for flow analysis, this will be loaded from CCDB - int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. + int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. OutputObj fOutputList{"output"}; Configurable fConfigTrackCuts{"cfgTrackCuts", "jpsiO2MCdebugCuts2", "Comma separated list of barrel track cuts"}; @@ -1054,7 +1033,7 @@ struct AnalysisSameEventPairing { if (!cutNames.IsNull()) { // if track cuts std::unique_ptr objArray(cutNames.Tokenize(",")); for (int icut = 0; icut < objArray->GetEntries(); ++icut) { // loop over track cuts - fTwoTrackFilterMask |= (uint32_t(1) << icut); + fTwoTrackFilterMask |= (static_cast(1) << icut); // no pair cuts names = { Form("PairsBarrelSEPM_%s", objArray->At(icut)->GetName()), @@ -1088,7 +1067,7 @@ struct AnalysisSameEventPairing { if (!cutNames.IsNull()) { std::unique_ptr objArray(cutNames.Tokenize(",")); for (int icut = 0; icut < objArray->GetEntries(); ++icut) { // loop over track cuts - fTwoMuonFilterMask |= (uint32_t(1) << icut); + fTwoMuonFilterMask |= (static_cast(1) << icut); // no pair cuts names = { Form("PairsMuonSEPM_%s", objArray->At(icut)->GetName()), @@ -1124,8 +1103,8 @@ struct AnalysisSameEventPairing { std::unique_ptr objArrayMuon(cutNamesMuon.Tokenize(",")); if (objArrayBarrel->GetEntries() == objArrayMuon->GetEntries()) { // one must specify equal number of barrel and muon cuts for (int icut = 0; icut < objArrayBarrel->GetEntries(); ++icut) { // loop over track cuts - fTwoTrackFilterMask |= (uint32_t(1) << icut); - fTwoMuonFilterMask |= (uint32_t(1) << icut); + fTwoTrackFilterMask |= (static_cast(1) << icut); + fTwoMuonFilterMask |= (static_cast(1) << icut); // no pair cuts names = { Form("PairsEleMuSEPM_%s_%s", objArrayBarrel->At(icut)->GetName(), objArrayMuon->At(icut)->GetName()), @@ -1246,7 +1225,7 @@ struct AnalysisSameEventPairing { for (auto& [t1, t2] : combinations(tracks1, tracks2)) { if constexpr (TPairType == VarManager::kDecayToMuMu) { - twoTrackFilter = uint32_t(t1.isMuonSelected()) & uint32_t(t2.isMuonSelected()) & fTwoMuonFilterMask; + twoTrackFilter = static_cast(t1.isMuonSelected()) & static_cast(t2.isMuonSelected()) & fTwoMuonFilterMask; } if (twoTrackFilter && (t1.sign() != t2.sign())) { @@ -1264,13 +1243,13 @@ struct AnalysisSameEventPairing { bool isFirst = true; for (auto& [t1, t2] : combinations(tracks1, tracks2)) { if constexpr (TPairType == VarManager::kDecayToEE || TPairType == VarManager::kDecayToPiPi) { - twoTrackFilter = uint32_t(t1.isBarrelSelected()) & uint32_t(t2.isBarrelSelected()) & fTwoTrackFilterMask; + twoTrackFilter = static_cast(t1.isBarrelSelected()) & static_cast(t2.isBarrelSelected()) & fTwoTrackFilterMask; } if constexpr (TPairType == VarManager::kDecayToMuMu) { - twoTrackFilter = uint32_t(t1.isMuonSelected()) & uint32_t(t2.isMuonSelected()) & fTwoMuonFilterMask; + twoTrackFilter = static_cast(t1.isMuonSelected()) & static_cast(t2.isMuonSelected()) & fTwoMuonFilterMask; } if constexpr (TPairType == VarManager::kElectronMuon) { - twoTrackFilter = uint32_t(t1.isBarrelSelected()) & uint32_t(t2.isMuonSelected()) & fTwoTrackFilterMask; + twoTrackFilter = static_cast(t1.isBarrelSelected()) & static_cast(t2.isMuonSelected()) & fTwoTrackFilterMask; } if (!twoTrackFilter) { // the tracks must have at least one filter bit in common to continue continue; @@ -1376,7 +1355,7 @@ struct AnalysisSameEventPairing { int iCut = 0; for (int icut = 0; icut < ncuts; icut++) { - if (twoTrackFilter & (uint32_t(1) << icut)) { + if (twoTrackFilter & (static_cast(1) << icut)) { if (t1.sign() * t2.sign() < 0) { fHistMan->FillHistClass(histNames[iCut][0].Data(), VarManager::fgValues); if (fConfigAmbiguousHist && !(t1.isAmbiguous() || t2.isAmbiguous())) { @@ -1777,7 +1756,7 @@ struct AnalysisDileptonHadron { // loop over hadrons for (auto& hadron : tracks) { - if (!(uint32_t(hadron.isBarrelSelected()) & (uint32_t(1) << fNHadronCutBit))) { + if (!(static_cast(hadron.isBarrelSelected()) & (static_cast(1) << fNHadronCutBit))) { continue; } @@ -1823,7 +1802,7 @@ struct AnalysisDileptonHadron { for (auto dilepton : evDileptons) { for (auto& track : evTracks) { - if (!(uint32_t(track.isBarrelSelected()) & (uint32_t(1) << fNHadronCutBit))) { + if (!(static_cast(track.isBarrelSelected()) & (static_cast(1) << fNHadronCutBit))) { continue; } @@ -1849,18 +1828,17 @@ struct AnalysisDileptonHadron { struct AnalysisDileptonTrackTrack { OutputObj fOutputList{"output"}; - Configurable fConfigTrackCuts{"cfgTrackCuts", "pionPIDCut1", "Comma separated list of barrel track cuts"}; // used for select the tracks from SelectedTracks + Configurable fConfigTrackCut1{"cfgTrackCut1", "pionPIDCut1", "track1 cut"}; // used for select the tracks from SelectedTracks + Configurable fConfigTrackCut2{"cfgTrackCut2", "pionPIDCut2", "track2 cut"}; // used for select the tracks from SelectedTracks Configurable fConfigDileptonCut{"cfgDiLeptonCut", "pairJpsi2", "Dilepton cut"}; - Configurable fConfigDitrackCut{"cfgDiTrackCut", "DipionPairCut1", "Track-Track cut"}; - Configurable fConfigQuadrupletCut{"cfgQuadrupletCut", "pairX3872Cut1", "Dilepton-Track-Track cut"}; + Configurable fConfigQuadrupletCuts{"cfgQuadrupletCuts", "pairX3872Cut1", "Comma separated list of Dilepton-Track-Track cut"}; Configurable fConfigAddDileptonHistogram{"cfgAddDileptonHistogram", "barrel", "Comma separated list of histograms"}; - Configurable fConfigAddDitrackHistogram{"cfgAddDitrackHistogram", "barrel", "Comma separated list of histograms"}; Configurable fConfigAddQuadrupletHistogram{"cfgAddQuadrupletHistogram", "xtojpsipipi", "Comma separated list of histograms"}; - Produces XTable; + Produces DileptonTrackTrackTable; Filter eventFilter = aod::dqanalysisflags::isEventSelected == 1; - Filter dileptonFilter = aod::reducedpair::mass > 1.0f && aod::reducedpair::mass < 4.0f; + Filter dileptonFilter = aod::reducedpair::sign == 0; Filter filterBarrelTrackSelected = aod::dqanalysisflags::isBarrelSelected > 0; constexpr static uint32_t fgDileptonFillMap = VarManager::ObjTypes::ReducedTrack | VarManager::ObjTypes::Pair; // fill map @@ -1870,14 +1848,13 @@ struct AnalysisDileptonTrackTrack { float* fValuesQuadruplet; HistogramManager* fHistMan; - uint32_t fDileptonFilter = 0; - uint32_t fHadronFilter = 0; - int fIsUnlikeSignDilepton = 0; - int fIsUnlikeSignDitrack = 0; + // cut name setting + TString fTrackCutName1; + TString fTrackCutName2; + bool fIsSameTrackCut = false; AnalysisCompositeCut fDileptonCut; - AnalysisCompositeCut fDitrackCut; - AnalysisCompositeCut fQuadrupletCut; - std::vector fTrackCutNames; + std::vector fQuadrupletCutNames; + std::vector fQuadrupletCuts; void init(o2::framework::InitContext& context) { @@ -1885,7 +1862,6 @@ struct AnalysisDileptonTrackTrack { return; } - fValuesDitrack = new float[VarManager::kNVars]; fValuesQuadruplet = new float[VarManager::kNVars]; VarManager::SetDefaultVarNames(); fHistMan = new HistogramManager("analysisHistos", "aa", VarManager::kNVars); @@ -1893,29 +1869,34 @@ struct AnalysisDileptonTrackTrack { fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); // define cuts - TString configTrackCutNamesStr = fConfigTrackCuts.value; + fTrackCutName1 = fConfigTrackCut1.value; + fTrackCutName2 = fConfigTrackCut2.value; + if (fTrackCutName1 == fTrackCutName2) { + fIsSameTrackCut = true; + } TString configDileptonCutNamesStr = fConfigDileptonCut.value; fDileptonCut = *dqcuts::GetCompositeCut(configDileptonCutNamesStr.Data()); - TString configDitrackCutNamesStr = fConfigDitrackCut.value; - fDitrackCut = *dqcuts::GetCompositeCut(configDitrackCutNamesStr.Data()); - TString configQuadruletCutNamesStr = fConfigQuadrupletCut.value; - fQuadrupletCut = *dqcuts::GetCompositeCut(configQuadruletCutNamesStr.Data()); + TString configQuadruletCutNamesStr = fConfigQuadrupletCuts.value; + std::unique_ptr objArray(configQuadruletCutNamesStr.Tokenize(",")); + for (Int_t icut = 0; icut < objArray->GetEntries(); ++icut) { + TString cutName = objArray->At(icut)->GetName(); + fQuadrupletCutNames.push_back(cutName); + fQuadrupletCuts.push_back(*dqcuts::GetCompositeCut(cutName.Data())); + } if (!context.mOptions.get("processDummy")) { - // define histograms for dilepton - DefineHistograms(fHistMan, Form("DileptonsSelectedUS_%s", configDileptonCutNamesStr.Data()), fConfigAddDileptonHistogram); - DefineHistograms(fHistMan, Form("DileptonsSelectedLS_%s", configDileptonCutNamesStr.Data()), fConfigAddDileptonHistogram); - if (!configTrackCutNamesStr.IsNull()) { - std::unique_ptr objArray(configTrackCutNamesStr.Tokenize(",")); - for (Int_t icut = 0; icut < objArray->GetEntries(); ++icut) { - TString cutName = objArray->At(icut)->GetName(); - fTrackCutNames.push_back(cutName); - DefineHistograms(fHistMan, Form("DitrackSelected_%s_%s", configDitrackCutNamesStr.Data(), cutName.Data()), fConfigAddDitrackHistogram); - DefineHistograms(fHistMan, Form("QuadrupletSEUSUS_%s_%s_%s", configDileptonCutNamesStr.Data(), configDitrackCutNamesStr.Data(), cutName.Data()), fConfigAddQuadrupletHistogram); - DefineHistograms(fHistMan, Form("QuadrupletSEUSLS_%s_%s_%s", configDileptonCutNamesStr.Data(), configDitrackCutNamesStr.Data(), cutName.Data()), fConfigAddQuadrupletHistogram); - DefineHistograms(fHistMan, Form("QuadrupletSELSUS_%s_%s_%s", configDileptonCutNamesStr.Data(), configDitrackCutNamesStr.Data(), cutName.Data()), fConfigAddQuadrupletHistogram); - DefineHistograms(fHistMan, Form("QuadrupletSELSLS_%s_%s_%s", configDileptonCutNamesStr.Data(), configDitrackCutNamesStr.Data(), cutName.Data()), fConfigAddQuadrupletHistogram); - } // loop over track cuts + DefineHistograms(fHistMan, Form("Dileptons_%s", configDileptonCutNamesStr.Data()), fConfigAddDileptonHistogram); + if (!configQuadruletCutNamesStr.IsNull()) { + for (Int_t icut = 0; icut < fQuadrupletCutNames.size(); ++icut) { + if (fIsSameTrackCut) { + DefineHistograms(fHistMan, Form("QuadrupletSEPM_%s", fQuadrupletCutNames[icut].Data()), fConfigAddQuadrupletHistogram); + } else { + DefineHistograms(fHistMan, Form("QuadrupletSEPM_%s", fQuadrupletCutNames[icut].Data()), fConfigAddQuadrupletHistogram); + DefineHistograms(fHistMan, Form("QuadrupletSEMP_%s", fQuadrupletCutNames[icut].Data()), fConfigAddQuadrupletHistogram); + } + DefineHistograms(fHistMan, Form("QuadrupletSEPP_%s", fQuadrupletCutNames[icut].Data()), fConfigAddQuadrupletHistogram); + DefineHistograms(fHistMan, Form("QuadrupletSEMM_%s", fQuadrupletCutNames[icut].Data()), fConfigAddQuadrupletHistogram); + } } } @@ -1926,8 +1907,6 @@ struct AnalysisDileptonTrackTrack { template void runDileptonTrackTrack(TEvent const& event, TTracks const& tracks, soa::Filtered const& dileptons) { - VarManager::ResetValues(0, VarManager::kNVars, fValuesDitrack); - VarManager::FillEvent(event, fValuesDitrack); VarManager::ResetValues(0, VarManager::kNVars, fValuesQuadruplet); VarManager::FillEvent(event, fValuesQuadruplet); @@ -1935,29 +1914,13 @@ struct AnalysisDileptonTrackTrack { // loop over dileptons for (auto dilepton : dileptons) { - fDileptonFilter = 0; - fIsUnlikeSignDilepton = 0; VarManager::FillTrack(dilepton, fValuesQuadruplet); - // Check that the dilepton has zero charge - if (dilepton.sign() == 0) { - fIsUnlikeSignDilepton = 1; - } - // apply the dilepton cut - if (fDileptonCut.IsSelected(fValuesQuadruplet)) { - fDileptonFilter = 1; - if (fIsUnlikeSignDilepton == 1) { - fHistMan->FillHistClass(Form("DileptonsSelectedUS_%s", fDileptonCut.GetName()), fValuesQuadruplet); - } else { - fHistMan->FillHistClass(Form("DileptonsSelectedLS_%s", fDileptonCut.GetName()), fValuesQuadruplet); - } - } - - // pass the dilepton without cut - if (fDileptonFilter == 0) { + if (!fDileptonCut.IsSelected(fValuesQuadruplet)) continue; - } + + fHistMan->FillHistClass(Form("Dileptons_%s", fDileptonCut.GetName()), fValuesQuadruplet); // get the index of the electron legs int indexLepton1 = dilepton.index0Id(); @@ -1970,47 +1933,53 @@ struct AnalysisDileptonTrackTrack { continue; } - // fill variables - VarManager::FillPair(t1, t2, fValuesDitrack); - if constexpr (TCandidateType == VarManager::kChictoJpsiEE) { - VarManager::FillPair(t1, t2, fValuesDitrack); - } - VarManager::FillDileptonTrackTrack(dilepton, t1, t2, fValuesQuadruplet); - - if (t1.sign() * t2.sign() > 0) { - fIsUnlikeSignDitrack = 0; + if (fIsSameTrackCut) { + if (!(static_cast(t1.isBarrelSelected()) & (static_cast(1) << 1)) || !(static_cast(t2.isBarrelSelected()) & (static_cast(1) << 1))) { + continue; + } } else { - fIsUnlikeSignDitrack = 1; + if (!(static_cast(t1.isBarrelSelected()) & (static_cast(1) << 1)) || !(static_cast(t2.isBarrelSelected()) & (static_cast(1) << 2))) { + continue; + } } - int iTrackCut = 0; - for (auto cutname = fTrackCutNames.begin(); cutname != fTrackCutNames.end(); cutname++, iTrackCut++) { - // apply the DiTrack cut - if (fDitrackCut.IsSelected(fValuesDitrack)) { - // apply the Track cut - if (t1.isBarrelSelected() & (uint32_t(1) << (iTrackCut + 1)) && t2.isBarrelSelected() & (uint32_t(1) << (iTrackCut + 1))) { - fHistMan->FillHistClass(Form("DitrackSelected_%s_%s", fDitrackCut.GetName(), (*cutname).Data()), fValuesDitrack); - if (fQuadrupletCut.IsSelected(fValuesQuadruplet)) { - XTable(fValuesQuadruplet[VarManager::kQuadMass], fValuesQuadruplet[VarManager::kQuadPt], fValuesQuadruplet[VarManager::kRap], fValuesQuadruplet[VarManager::kQuadEta], fValuesQuadruplet[VarManager::kPairMass], fValuesQuadruplet[VarManager::kDitrackMass], fValuesQuadruplet[VarManager::kPairPt], fValuesQuadruplet[VarManager::kDitrackPt], fValuesQuadruplet[VarManager::kQ], fValuesQuadruplet[VarManager::kDeltaR1], fValuesQuadruplet[VarManager::kDeltaR2], fValuesQuadruplet[VarManager::kCosthetaDileptonDitrack], fValuesQuadruplet[VarManager::kTrackDCAxyProng1], fValuesQuadruplet[VarManager::kTrackDCAzProng1], fValuesQuadruplet[VarManager::kTrackDCAxyProng2], fValuesQuadruplet[VarManager::kTrackDCAzProng2], fValuesQuadruplet[VarManager::kPt1], fValuesQuadruplet[VarManager::kPt2], dilepton.sign(), t1.sign() + t2.sign()); - if (fIsUnlikeSignDilepton) { - if (fIsUnlikeSignDitrack) { - fHistMan->FillHistClass(Form("QuadrupletSEUSUS_%s_%s_%s", fDileptonCut.GetName(), fDitrackCut.GetName(), (*cutname).Data()), fValuesQuadruplet); - } else { - fHistMan->FillHistClass(Form("QuadrupletSEUSLS_%s_%s_%s", fDileptonCut.GetName(), fDitrackCut.GetName(), (*cutname).Data()), fValuesQuadruplet); - } - } else { - if (fIsUnlikeSignDitrack) { - fHistMan->FillHistClass(Form("QuadrupletSELSUS_%s_%s_%s", fDileptonCut.GetName(), fDitrackCut.GetName(), (*cutname).Data()), fValuesQuadruplet); - } else { - fHistMan->FillHistClass(Form("QuadrupletSELSLS_%s_%s_%s", fDileptonCut.GetName(), fDitrackCut.GetName(), (*cutname).Data()), fValuesQuadruplet); - } - } + // fill variables + VarManager::FillDileptonTrackTrack(dilepton, t1, t2, fValuesQuadruplet); + + int iCut = 0; + uint32_t CutDecision = 0; + for (auto cutname = fQuadrupletCutNames.begin(); cutname != fQuadrupletCutNames.end(); cutname++, iCut++) { + // apply dilepton-track-track cut + if (fQuadrupletCuts[iCut].IsSelected(fValuesQuadruplet)) { + CutDecision |= (1 << iCut); + if (fIsSameTrackCut) { + if (t1.sign() * t2.sign() < 0) { + fHistMan->FillHistClass(Form("QuadrupletSEPM_%s", fQuadrupletCutNames[iCut].Data()), fValuesQuadruplet); + } + } else { + if ((t1.sign() < 0) && (t2.sign() > 0)) { + fHistMan->FillHistClass(Form("QuadrupletSEMP_%s", fQuadrupletCutNames[iCut].Data()), fValuesQuadruplet); + } else if ((t1.sign() > 0) && (t2.sign() < 0)) { + fHistMan->FillHistClass(Form("QuadrupletSEPM_%s", fQuadrupletCutNames[iCut].Data()), fValuesQuadruplet); } } - } // check if the Ditrack cut is selected - } // loop over hadron cuts - } - } + if ((t1.sign() > 0) && (t2.sign() > 0)) { + fHistMan->FillHistClass(Form("QuadrupletSEPP_%s", fQuadrupletCutNames[iCut].Data()), fValuesQuadruplet); + } else if ((t1.sign() < 0) && (t2.sign() < 0)) { + fHistMan->FillHistClass(Form("QuadrupletSEMM_%s", fQuadrupletCutNames[iCut].Data()), fValuesQuadruplet); + } + } + } // loop over dilepton-track-track cuts + + // table to be written out for ML analysis + if (!CutDecision) + continue; + DileptonTrackTrackTable(fValuesQuadruplet[VarManager::kQuadMass], fValuesQuadruplet[VarManager::kQuadPt], fValuesQuadruplet[VarManager::kQuadEta], fValuesQuadruplet[VarManager::kQuadPhi], fValuesQuadruplet[VarManager::kRap], + fValuesQuadruplet[VarManager::kQ], fValuesQuadruplet[VarManager::kDeltaR1], fValuesQuadruplet[VarManager::kDeltaR2], + dilepton.mass(), dilepton.pt(), dilepton.eta(), dilepton.phi(), dilepton.sign(), + fValuesQuadruplet[VarManager::kDitrackMass], fValuesQuadruplet[VarManager::kDitrackPt], t1.pt(), t2.pt(), t1.eta(), t2.eta(), t1.phi(), t2.phi(), t1.sign(), t2.sign()); + } // end loop over track-track pairs + } // end loop over dileptons } void processJpsiPiPi(soa::Filtered::iterator const& event, MyBarrelTracksSelectedWithCov const& tracks, soa::Filtered const& dileptons) From 897f780c6a7e2e7aa7f7866e7361dd4b26c4c0b8 Mon Sep 17 00:00:00 2001 From: Ionut Cristian Arsene Date: Wed, 11 Dec 2024 10:20:15 +0100 Subject: [PATCH 318/459] [PWGDQ] fix configQA option in analysis-event-selection (#8903) Co-authored-by: Ionut Cristian Arsene --- PWGDQ/Tasks/tableReader_withAssoc.cxx | 106 ++++++++++++++------------ 1 file changed, 59 insertions(+), 47 deletions(-) diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 65c89b78918..739a9ff1957 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -262,17 +262,23 @@ struct AnalysisEventSelection { bool decision = false; // Fill histograms in the class Event, before cuts - fHistMan->FillHistClass("Event_BeforeCuts", VarManager::fgValues); + if (fConfigQA) { + fHistMan->FillHistClass("Event_BeforeCuts", VarManager::fgValues); + } // Apply event cuts and fill histograms after selection if (fEventCut->IsSelected(VarManager::fgValues)) { if (fConfigRunZorro) { if (event.tag_bit(56)) { // This is the bit used for the software trigger event selections [TO BE DONE: find a more clear way to use it] - fHistMan->FillHistClass("Event_AfterCuts", VarManager::fgValues); + if (fConfigQA) { + fHistMan->FillHistClass("Event_AfterCuts", VarManager::fgValues); + } decision = true; } } else { - fHistMan->FillHistClass("Event_AfterCuts", VarManager::fgValues); + if (fConfigQA) { + fHistMan->FillHistClass("Event_AfterCuts", VarManager::fgValues); + } decision = true; } } @@ -304,51 +310,57 @@ struct AnalysisEventSelection { // key: event global index, value: whether pileup event is a possible splitting std::map collisionSplittingMap; - // Reset the fValues array and fill event observables - VarManager::ResetValues(0, VarManager::kNEventWiseVariables); - // loop over the BC map, get the collision vectors and make in-bunch and out of bunch 2-event correlations - for (auto bc1It = fBCCollMap.begin(); bc1It != fBCCollMap.end(); ++bc1It) { - uint64_t bc1 = bc1It->first; - auto bc1Events = bc1It->second; - - // same bunch event correlations, if more than 1 collisions in this bunch - if (bc1Events.size() > 1) { - for (auto ev1It = bc1Events.begin(); ev1It != bc1Events.end(); ++ev1It) { - auto ev1 = events.rawIteratorAt(*ev1It); - for (auto ev2It = std::next(ev1It); ev2It != bc1Events.end(); ++ev2It) { - auto ev2 = events.rawIteratorAt(*ev2It); - // compute 2-event quantities and mark the candidate split collisions - VarManager::FillTwoEvents(ev1, ev2); - if (TMath::Abs(VarManager::fgValues[VarManager::kTwoEvDeltaZ]) < fConfigSplitCollisionsDeltaZ) { // this is a possible collision split - collisionSplittingMap[*ev1It] = true; - collisionSplittingMap[*ev2It] = true; - } - fHistMan->FillHistClass("SameBunchCorrelations", VarManager::fgValues); - } // end second event loop - } // end first event loop - } // end if BC1 events > 1 - - // loop over the following BCs in the TF - for (auto bc2It = std::next(bc1It); bc2It != fBCCollMap.end(); ++bc2It) { - uint64_t bc2 = bc2It->first; - if ((bc2 > bc1 ? bc2 - bc1 : bc1 - bc2) > fConfigSplitCollisionsDeltaBC) { - break; - } - auto bc2Events = bc2It->second; - - // loop over events in the first BC - for (auto ev1It : bc1Events) { - auto ev1 = events.rawIteratorAt(ev1It); - // loop over events in the second BC - for (auto ev2It : bc2Events) { - auto ev2 = events.rawIteratorAt(ev2It); - // compute 2-event quantities and mark the candidate split collisions - VarManager::FillTwoEvents(ev1, ev2); - if (TMath::Abs(VarManager::fgValues[VarManager::kTwoEvDeltaZ]) < fConfigSplitCollisionsDeltaZ) { // this is a possible collision split - collisionSplittingMap[ev1It] = true; - collisionSplittingMap[ev2It] = true; + if (fConfigCheckSplitCollisions) { + // Reset the fValues array and fill event observables + VarManager::ResetValues(0, VarManager::kNEventWiseVariables); + // loop over the BC map, get the collision vectors and make in-bunch and out of bunch 2-event correlations + for (auto bc1It = fBCCollMap.begin(); bc1It != fBCCollMap.end(); ++bc1It) { + uint64_t bc1 = bc1It->first; + auto bc1Events = bc1It->second; + + // same bunch event correlations, if more than 1 collisions in this bunch + if (bc1Events.size() > 1) { + for (auto ev1It = bc1Events.begin(); ev1It != bc1Events.end(); ++ev1It) { + auto ev1 = events.rawIteratorAt(*ev1It); + for (auto ev2It = std::next(ev1It); ev2It != bc1Events.end(); ++ev2It) { + auto ev2 = events.rawIteratorAt(*ev2It); + // compute 2-event quantities and mark the candidate split collisions + VarManager::FillTwoEvents(ev1, ev2); + if (TMath::Abs(VarManager::fgValues[VarManager::kTwoEvDeltaZ]) < fConfigSplitCollisionsDeltaZ) { // this is a possible collision split + collisionSplittingMap[*ev1It] = true; + collisionSplittingMap[*ev2It] = true; + } + if (fConfigQA) { + fHistMan->FillHistClass("SameBunchCorrelations", VarManager::fgValues); + } + } // end second event loop + } // end first event loop + } // end if BC1 events > 1 + + // loop over the following BCs in the TF + for (auto bc2It = std::next(bc1It); bc2It != fBCCollMap.end(); ++bc2It) { + uint64_t bc2 = bc2It->first; + if ((bc2 > bc1 ? bc2 - bc1 : bc1 - bc2) > fConfigSplitCollisionsDeltaBC) { + break; + } + auto bc2Events = bc2It->second; + + // loop over events in the first BC + for (auto ev1It : bc1Events) { + auto ev1 = events.rawIteratorAt(ev1It); + // loop over events in the second BC + for (auto ev2It : bc2Events) { + auto ev2 = events.rawIteratorAt(ev2It); + // compute 2-event quantities and mark the candidate split collisions + VarManager::FillTwoEvents(ev1, ev2); + if (TMath::Abs(VarManager::fgValues[VarManager::kTwoEvDeltaZ]) < fConfigSplitCollisionsDeltaZ) { // this is a possible collision split + collisionSplittingMap[ev1It] = true; + collisionSplittingMap[ev2It] = true; + } + if (fConfigQA) { + fHistMan->FillHistClass("OutOfBunchCorrelations", VarManager::fgValues); + } } - fHistMan->FillHistClass("OutOfBunchCorrelations", VarManager::fgValues); } } } From 096c281191464cb13a73c5aa4c70181c2d308073 Mon Sep 17 00:00:00 2001 From: samrangy Date: Wed, 11 Dec 2024 10:23:08 +0100 Subject: [PATCH 319/459] [PWGHF] Implement ML models in D0-h correlation (#8742) Co-authored-by: ALICE Action Bot --- PWGHF/HFC/DataModel/CorrelationTables.h | 27 +- .../HFC/TableProducer/correlatorD0Hadrons.cxx | 242 +++++++++--------- PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx | 53 +++- 3 files changed, 196 insertions(+), 126 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 3c5b8cf86fd..3b8e68cdbd8 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -57,6 +57,12 @@ DECLARE_SOA_COLUMN(PtD, ptD, float); //! Transverse mom DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron DECLARE_SOA_COLUMN(MD, mD, float); //! Invariant mass of D0 DECLARE_SOA_COLUMN(MDbar, mDbar, float); //! Invariant mass of D0bar +DECLARE_SOA_COLUMN(MlScoreBkgD0, mlScoreBkgD0, float); //! ML background score for D0 selection +DECLARE_SOA_COLUMN(MlScoreNonPromptD0, mlScoreNonPromptD0, float); //! ML prompt score for D0 selection +DECLARE_SOA_COLUMN(MlScorePromptD0, mlScorePromptD0, float); //! ML prompt score for D0 selection +DECLARE_SOA_COLUMN(MlScoreBkgD0bar, mlScoreBkgD0bar, float); //! ML background score for D0 selection +DECLARE_SOA_COLUMN(MlScoreNonPromptD0bar, mlScoreNonPromptD0bar, float); //! ML prompt score for D0 selection +DECLARE_SOA_COLUMN(MlScorePromptD0bar, mlScorePromptD0bar, float); //! ML prompt score for D0 selection DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); //! Tag for D0,D0bar DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent DECLARE_SOA_COLUMN(IsAutoCorrelated, isAutoCorrelated, bool); //! Correlation Status @@ -81,7 +87,7 @@ enum ParticleTypeMcRec { }; } // namespace hf_correlation_d0_hadron -DECLARE_SOA_TABLE(DHadronPair, "AOD", "DHADRONPAIR", //! D0-Hadrons pairs Informations +DECLARE_SOA_TABLE(D0HadronPair, "AOD", "D0HPAIR", //! D0-Hadrons pairs Informations aod::hf_correlation_d0_hadron::DeltaPhi, aod::hf_correlation_d0_hadron::DeltaEta, aod::hf_correlation_d0_hadron::PtD, @@ -89,11 +95,28 @@ DECLARE_SOA_TABLE(DHadronPair, "AOD", "DHADRONPAIR", //! D0-Hadrons pairs Inform aod::hf_correlation_d0_hadron::PoolBin, aod::hf_correlation_d0_hadron::IsAutoCorrelated); -DECLARE_SOA_TABLE(DHadronRecoInfo, "AOD", "DHADRONRECOINFO", //! D0-Hadrons pairs Reconstructed Informations +DECLARE_SOA_TABLE(D0HadronRecoInfo, "AOD", "D0HRECOINFO", //! D0-Hadrons pairs Reconstructed Informations aod::hf_correlation_d0_hadron::MD, aod::hf_correlation_d0_hadron::MDbar, aod::hf_correlation_d0_hadron::SignalStatus); +DECLARE_SOA_TABLE(D0HadronMlInfo, "AOD", "D0HMLINFO", //! D0-Hadrons pairs Machine Learning Information + aod::hf_correlation_d0_hadron::MlScoreBkgD0, + aod::hf_correlation_d0_hadron::MlScoreNonPromptD0, + aod::hf_correlation_d0_hadron::MlScorePromptD0, + aod::hf_correlation_d0_hadron::MlScoreBkgD0bar, + aod::hf_correlation_d0_hadron::MlScoreNonPromptD0bar, + aod::hf_correlation_d0_hadron::MlScorePromptD0bar); + +DECLARE_SOA_TABLE(D0CandRecoInfo, "AOD", "D0CANDRECOINFO", //! Ds candidates Reconstructed Information + aod::hf_correlation_d0_hadron::MD, + aod::hf_correlation_d0_hadron::MDbar, + aod::hf_correlation_d0_hadron::PtD, + aod::hf_correlation_d0_hadron::MlScoreBkgD0, + aod::hf_correlation_d0_hadron::MlScorePromptD0, + aod::hf_correlation_d0_hadron::MlScoreBkgD0bar, + aod::hf_correlation_d0_hadron::MlScorePromptD0bar); + // Note: definition of columns and tables for Lc-Hadron correlation pairs namespace hf_correlation_lc_hadron { diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 9ec7e5fc7c2..3500b09dc92 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -72,6 +72,7 @@ using BinningType = ColumnBinningPolicy>; using SelectedTracks = soa::Filtered>; using SelectedCandidatesData = soa::Filtered>; +using SelectedCandidatesDataMl = soa::Filtered>; using SelectedTracksMcRec = soa::Filtered>; using SelectedCandidatesMcRec = soa::Filtered>; using SelectedCollisionsMcGen = soa::Filtered>; @@ -79,8 +80,6 @@ using SelectedParticlesMcGen = soa::Join d0Sel; Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; @@ -89,8 +88,9 @@ struct HfCorrelatorD0HadronsSelection { Configurable ptCandMin{"ptCandMin", -1., "min. cand. pT"}; HfHelper hfHelper; - + SliceCache cache; Preslice perCol = aod::hf_cand::collisionId; + Partition> selectedD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; Partition> selectedD0candidatesMc = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; @@ -161,10 +161,10 @@ struct HfCorrelatorD0HadronsSelection { /// D0-Hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) struct HfCorrelatorD0Hadrons { - SliceCache cache; - - Produces entryD0HadronPair; - Produces entryD0HadronRecoInfo; + Produces entryD0HadronPair; + Produces entryD0HadronRecoInfo; + Produces entryD0HadronMlInfo; + Produces entryD0CandRecoInfo; Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; @@ -175,21 +175,16 @@ struct HfCorrelatorD0Hadrons { Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; Configurable ptTrackMin{"ptTrackMin", 0.3, "min. track pT"}; Configurable ptTrackMax{"ptTrackMax", 99., "max. track pT"}; - Configurable> bins{"ptBinsForMassAndEfficiency", std::vector{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; + Configurable> bins{"bins", std::vector{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; Configurable> efficiencyDmeson{"efficiencyDmeson", std::vector{vecEfficiencyDmeson}, "Efficiency values for D0 meson"}; - Configurable applyEfficiency{"efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights"}; + Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying D-meson efficiency weights"}; Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; Configurable ptSoftPionMax{"ptSoftPionMax", 3.f * 800.f * std::pow(10.f, -6.f), "max. pT cut for soft pion identification"}; + Configurable> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; Configurable correlateD0WithLeadingParticle{"correlateD0WithLeadingParticle", false, "Switch for correlation of D0 mesons with leading particle only"}; Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its D-meson mother instead of skipping it"}; Configurable numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"}; - ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "z vertex position pools"}; - ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f}, "event multiplicity pools (FT0M)"}; - ConfigurableAxis multPoolBinsMcGen{"multPoolBinsMcGen", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks - - HfHelper hfHelper; - BinningType corrBinning{{zPoolBins, multPoolBins}, true}; int leadingIndex = 0; double massD0{0.}; @@ -197,10 +192,8 @@ struct HfCorrelatorD0Hadrons { double massK{0.}; double softPiMass = 0.14543; // pion mass + Q-value of the D*->D0pi decay - Preslice perCol = aod::hf_cand::collisionId; - - Partition> selectedD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; - Partition> selectedD0candidatesMc = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; + HfHelper hfHelper; + SliceCache cache; Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == true; Filter trackFilter = requireGlobalTrackWoDCAInFilter() && (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); @@ -208,6 +201,14 @@ struct HfCorrelatorD0Hadrons { Filter collisionFilterGen = aod::hf_selection_dmeson_collision::dmesonSel == true; Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == static_cast(Pdg::kD0) || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); + Preslice perCol = aod::hf_cand::collisionId; + + ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "z vertex position pools"}; + ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f}, "event multiplicity pools (FT0M)"}; + ConfigurableAxis multPoolBinsMcGen{"multPoolBinsMcGen", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks + + BinningType corrBinning{{zPoolBins, multPoolBins}, true}; + HistogramRegistry registry{ "registry", // NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes @@ -273,12 +274,8 @@ struct HfCorrelatorD0Hadrons { /// D0-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) void processData(SelectedCollisions::iterator const& collision, SelectedTracks const& tracks, - soa::Join const&) + SelectedCandidatesDataMl const& candidates) { - // protection against empty tables to be sliced - if (selectedD0Candidates.size() == 0) { - return; - } // find leading particle if (correlateD0WithLeadingParticle) { leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value, etaTrackMax.value); @@ -304,46 +301,54 @@ struct HfCorrelatorD0Hadrons { return; } registry.fill(HIST("hMultiplicity"), nTracks); + std::vector outputMlD0 = {-1., -1., -1.}; + std::vector outputMlD0bar = {-1., -1., -1.}; - auto selectedD0CandidatesGrouped = selectedD0Candidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - - for (const auto& candidate1 : selectedD0CandidatesGrouped) { - if (std::abs(hfHelper.yD0(candidate1)) >= yCandMax || candidate1.pt() <= ptCandMin || candidate1.pt() >= ptTrackMax) { + for (const auto& candidate : candidates) { + if (std::abs(hfHelper.yD0(candidate)) >= yCandMax || candidate.pt() <= ptCandMin || candidate.pt() >= ptTrackMax) { continue; } - // check decay channel flag for candidate1 - if (!TESTBIT(candidate1.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) { + // check decay channel flag for candidate + if (!TESTBIT(candidate.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) { continue; } // ========================== Define parameters for soft pion removal ================================ - auto ePiK = RecoDecay::e(candidate1.pVectorProng0(), massPi) + RecoDecay::e(candidate1.pVectorProng1(), massK); - auto eKPi = RecoDecay::e(candidate1.pVectorProng0(), massK) + RecoDecay::e(candidate1.pVectorProng1(), massPi); + auto ePiK = RecoDecay::e(candidate.pVectorProng0(), massPi) + RecoDecay::e(candidate.pVectorProng1(), massK); + auto eKPi = RecoDecay::e(candidate.pVectorProng0(), massK) + RecoDecay::e(candidate.pVectorProng1(), massPi); // ========================== trigger efficiency ================================ double efficiencyWeight = 1.; if (applyEfficiency) { - efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate1.pt())); + efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate.pt())); } // ========================== Fill mass histo ================================ - if (candidate1.isSelD0() >= selectionFlagD0) { - registry.fill(HIST("hMass"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); - registry.fill(HIST("hMass1D"), hfHelper.invMassD0ToPiK(candidate1), efficiencyWeight); - registry.fill(HIST("hMassD01D"), hfHelper.invMassD0ToPiK(candidate1), efficiencyWeight); + if (candidate.isSelD0() >= selectionFlagD0) { + registry.fill(HIST("hMass"), hfHelper.invMassD0ToPiK(candidate), candidate.pt(), efficiencyWeight); + registry.fill(HIST("hMass1D"), hfHelper.invMassD0ToPiK(candidate), efficiencyWeight); + registry.fill(HIST("hMassD01D"), hfHelper.invMassD0ToPiK(candidate), efficiencyWeight); + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMlD0[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; + } } - if (candidate1.isSelD0bar() >= selectionFlagD0bar) { - registry.fill(HIST("hMass"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); - registry.fill(HIST("hMass1D"), hfHelper.invMassD0barToKPi(candidate1), efficiencyWeight); - registry.fill(HIST("hMassD0bar1D"), hfHelper.invMassD0barToKPi(candidate1), efficiencyWeight); + if (candidate.isSelD0bar() >= selectionFlagD0bar) { + registry.fill(HIST("hMass"), hfHelper.invMassD0barToKPi(candidate), candidate.pt(), efficiencyWeight); + registry.fill(HIST("hMass1D"), hfHelper.invMassD0barToKPi(candidate), efficiencyWeight); + registry.fill(HIST("hMassD0bar1D"), hfHelper.invMassD0barToKPi(candidate), efficiencyWeight); + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMlD0bar[iclass] = candidate.mlProbD0bar()[classMl->at(iclass)]; + } } + entryD0CandRecoInfo(hfHelper.invMassD0ToPiK(candidate), hfHelper.invMassD0barToKPi(candidate), candidate.pt(), outputMlD0[0], outputMlD0[2], outputMlD0bar[0], outputMlD0bar[2]); + // ========================== Fill general histos ================================ - registry.fill(HIST("hPtCand"), candidate1.pt()); - registry.fill(HIST("hPtProng0"), candidate1.ptProng0()); - registry.fill(HIST("hPtProng1"), candidate1.ptProng1()); - registry.fill(HIST("hEta"), candidate1.eta()); - registry.fill(HIST("hPhi"), candidate1.phi()); - registry.fill(HIST("hY"), hfHelper.yD0(candidate1)); - registry.fill(HIST("hSelectionStatus"), candidate1.isSelD0bar() + (candidate1.isSelD0() * 2)); + registry.fill(HIST("hPtCand"), candidate.pt()); + registry.fill(HIST("hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("hEta"), candidate.eta()); + registry.fill(HIST("hPhi"), candidate.phi()); + registry.fill(HIST("hY"), hfHelper.yD0(candidate)); + registry.fill(HIST("hSelectionStatus"), candidate.isSelD0bar() + (candidate.isSelD0() * 2)); registry.fill(HIST("hD0Bin"), poolBin); // ============ D-h correlation dedicated section ================================== @@ -353,7 +358,7 @@ struct HfCorrelatorD0Hadrons { registry.fill(HIST("hTrackCounter"), 1); // fill total no. of tracks // Remove D0 daughters by checking track indices bool correlationStatus = false; - if ((candidate1.prong0Id() == track.globalIndex()) || (candidate1.prong1Id() == track.globalIndex())) { + if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex())) { if (!storeAutoCorrelationFlag) { continue; } @@ -365,20 +370,20 @@ struct HfCorrelatorD0Hadrons { // ========== soft pion removal =================================================== double invMassDstar1 = 0., invMassDstar2 = 0.; bool isSoftPiD0 = false, isSoftPiD0bar = false; - auto pSum2 = RecoDecay::p2(candidate1.pVector(), track.pVector()); + auto pSum2 = RecoDecay::p2(candidate.pVector(), track.pVector()); auto ePion = track.energy(massPi); invMassDstar1 = std::sqrt((ePiK + ePion) * (ePiK + ePion) - pSum2); invMassDstar2 = std::sqrt((eKPi + ePion) * (eKPi + ePion) - pSum2); - if (candidate1.isSelD0() >= selectionFlagD0) { - if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(candidate1)) - softPiMass) < ptSoftPionMax) { + if (candidate.isSelD0() >= selectionFlagD0) { + if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(candidate)) - softPiMass) < ptSoftPionMax) { isSoftPiD0 = true; continue; } } - if (candidate1.isSelD0bar() >= selectionFlagD0bar) { - if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(candidate1)) - softPiMass) < ptSoftPionMax) { + if (candidate.isSelD0bar() >= selectionFlagD0bar) { + if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(candidate)) - softPiMass) < ptSoftPionMax) { isSoftPiD0bar = true; continue; } @@ -386,10 +391,10 @@ struct HfCorrelatorD0Hadrons { registry.fill(HIST("hTrackCounter"), 3); // fill no. of tracks after soft pion removal int signalStatus = 0; - if ((candidate1.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { + if ((candidate.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0Only; } - if ((candidate1.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { + if ((candidate.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0barOnly; } @@ -399,13 +404,14 @@ struct HfCorrelatorD0Hadrons { } registry.fill(HIST("hTrackCounter"), 4); // fill no. of tracks have leading particle } - entryD0HadronPair(getDeltaPhi(track.phi(), candidate1.phi()), - track.eta() - candidate1.eta(), - candidate1.pt(), + entryD0HadronPair(getDeltaPhi(track.phi(), candidate.phi()), + track.eta() - candidate.eta(), + candidate.pt(), track.pt(), poolBin, correlationStatus); - entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1), signalStatus); + entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(candidate), hfHelper.invMassD0barToKPi(candidate), signalStatus); + entryD0HadronMlInfo(outputMlD0[0], outputMlD0[1], outputMlD0[2], outputMlD0bar[0], outputMlD0bar[1], outputMlD0bar[2]); } // end inner loop (tracks) @@ -417,12 +423,8 @@ struct HfCorrelatorD0Hadrons { void processMcRec(SelectedCollisions::iterator const& collision, SelectedTracksMcRec const& tracks, - soa::Join const&) + SelectedCandidatesMcRec const& candidates) { - // protection against empty tables to be sliced - if (selectedD0candidatesMc.size() == 0) { - return; - } // find leading particle if (correlateD0WithLeadingParticle) { leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value, etaTrackMax.value); @@ -446,63 +448,62 @@ struct HfCorrelatorD0Hadrons { } registry.fill(HIST("hMultiplicity"), nTracks); - auto selectedD0CandidatesGroupedMc = selectedD0candidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); // MC reco level bool flagD0 = false; bool flagD0bar = false; - for (const auto& candidate1 : selectedD0CandidatesGroupedMc) { - // check decay channel flag for candidate1 - if (!TESTBIT(candidate1.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) { + for (const auto& candidate : candidates) { + // check decay channel flag for candidate + if (!TESTBIT(candidate.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) { continue; } - if (std::abs(hfHelper.yD0(candidate1)) >= yCandMax || candidate1.pt() <= ptCandMin || candidate1.pt() >= ptTrackMax) { + if (std::abs(hfHelper.yD0(candidate)) >= yCandMax || candidate.pt() <= ptCandMin || candidate.pt() >= ptTrackMax) { continue; } double efficiencyWeight = 1.; if (applyEfficiency) { - efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate1.pt())); + efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate.pt())); } - if (std::abs(candidate1.flagMcMatchRec()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { // fill per-candidate distributions from D0/D0bar true candidates - registry.fill(HIST("hPtCandRec"), candidate1.pt()); - registry.fill(HIST("hPtProng0Rec"), candidate1.ptProng0()); - registry.fill(HIST("hPtProng1Rec"), candidate1.ptProng1()); - registry.fill(HIST("hEtaRec"), candidate1.eta()); - registry.fill(HIST("hPhiRec"), candidate1.phi()); - registry.fill(HIST("hYRec"), hfHelper.yD0(candidate1)); - registry.fill(HIST("hSelectionStatusRec"), candidate1.isSelD0bar() + (candidate1.isSelD0() * 2)); + registry.fill(HIST("hPtCandRec"), candidate.pt()); + registry.fill(HIST("hPtProng0Rec"), candidate.ptProng0()); + registry.fill(HIST("hPtProng1Rec"), candidate.ptProng1()); + registry.fill(HIST("hEtaRec"), candidate.eta()); + registry.fill(HIST("hPhiRec"), candidate.phi()); + registry.fill(HIST("hYRec"), hfHelper.yD0(candidate)); + registry.fill(HIST("hSelectionStatusRec"), candidate.isSelD0bar() + (candidate.isSelD0() * 2)); } // fill invariant mass plots from D0/D0bar signal and background candidates - if (candidate1.isSelD0() >= selectionFlagD0) { // only reco as D0 - if (candidate1.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { // also matched as D0 - registry.fill(HIST("hMassD0RecSig"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); - } else if (candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { - registry.fill(HIST("hMassD0RecRef"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); + if (candidate.isSelD0() >= selectionFlagD0) { // only reco as D0 + if (candidate.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { // also matched as D0 + registry.fill(HIST("hMassD0RecSig"), hfHelper.invMassD0ToPiK(candidate), candidate.pt(), efficiencyWeight); + } else if (candidate.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + registry.fill(HIST("hMassD0RecRef"), hfHelper.invMassD0ToPiK(candidate), candidate.pt(), efficiencyWeight); } else { - registry.fill(HIST("hMassD0RecBg"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); + registry.fill(HIST("hMassD0RecBg"), hfHelper.invMassD0ToPiK(candidate), candidate.pt(), efficiencyWeight); } } - if (candidate1.isSelD0bar() >= selectionFlagD0bar) { // only reco as D0bar - if (candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // also matched as D0bar - registry.fill(HIST("hMassD0barRecSig"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); - } else if (candidate1.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { - registry.fill(HIST("hMassD0barRecRef"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); + if (candidate.isSelD0bar() >= selectionFlagD0bar) { // only reco as D0bar + if (candidate.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // also matched as D0bar + registry.fill(HIST("hMassD0barRecSig"), hfHelper.invMassD0barToKPi(candidate), candidate.pt(), efficiencyWeight); + } else if (candidate.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + registry.fill(HIST("hMassD0barRecRef"), hfHelper.invMassD0barToKPi(candidate), candidate.pt(), efficiencyWeight); } else { - registry.fill(HIST("hMassD0barRecBg"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); + registry.fill(HIST("hMassD0barRecBg"), hfHelper.invMassD0barToKPi(candidate), candidate.pt(), efficiencyWeight); } } // ===================== Define parameters for soft pion removal ======================== - auto ePiK = RecoDecay::e(candidate1.pVectorProng0(), massPi) + RecoDecay::e(candidate1.pVectorProng1(), massK); - auto eKPi = RecoDecay::e(candidate1.pVectorProng0(), massK) + RecoDecay::e(candidate1.pVectorProng1(), massPi); + auto ePiK = RecoDecay::e(candidate.pVectorProng0(), massPi) + RecoDecay::e(candidate.pVectorProng1(), massK); + auto eKPi = RecoDecay::e(candidate.pVectorProng0(), massK) + RecoDecay::e(candidate.pVectorProng1(), massPi); // ============== D-h correlation dedicated section ==================================== - flagD0 = candidate1.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Signal 'true' if candidate1 matched to D0 (particle) - flagD0bar = candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) + flagD0 = candidate.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Signal 'true' if candidate matched to D0 (particle) + flagD0bar = candidate.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate, selected as D0 (particle), is matched to D0bar (antiparticle) // ========== track loop starts here ======================== @@ -511,7 +512,7 @@ struct HfCorrelatorD0Hadrons { // Removing D0 daughters by checking track indices bool correlationStatus = false; - if ((candidate1.prong0Id() == track.globalIndex()) || (candidate1.prong1Id() == track.globalIndex())) { + if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex())) { if (!storeAutoCorrelationFlag) { continue; } @@ -522,20 +523,20 @@ struct HfCorrelatorD0Hadrons { // ===== soft pion removal =================================================== double invMassDstar1 = 0, invMassDstar2 = 0; bool isSoftPiD0 = false, isSoftPiD0bar = false; - auto pSum2 = RecoDecay::p2(candidate1.pVector(), track.pVector()); + auto pSum2 = RecoDecay::p2(candidate.pVector(), track.pVector()); auto ePion = track.energy(massPi); invMassDstar1 = std::sqrt((ePiK + ePion) * (ePiK + ePion) - pSum2); invMassDstar2 = std::sqrt((eKPi + ePion) * (eKPi + ePion) - pSum2); - if (candidate1.isSelD0() >= selectionFlagD0) { - if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(candidate1)) - softPiMass) < ptSoftPionMax) { + if (candidate.isSelD0() >= selectionFlagD0) { + if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(candidate)) - softPiMass) < ptSoftPionMax) { isSoftPiD0 = true; continue; } } - if (candidate1.isSelD0bar() >= selectionFlagD0bar) { - if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(candidate1)) - softPiMass) < ptSoftPionMax) { + if (candidate.isSelD0bar() >= selectionFlagD0bar) { + if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(candidate)) - softPiMass) < ptSoftPionMax) { isSoftPiD0bar = true; continue; } @@ -551,35 +552,35 @@ struct HfCorrelatorD0Hadrons { } int signalStatus = 0; - if (flagD0 && (candidate1.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { + if (flagD0 && (candidate.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Sig); } // signal case D0 - if (flagD0bar && (candidate1.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { + if (flagD0bar && (candidate.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Ref); } // reflection case D0 - if (!flagD0 && !flagD0bar && (candidate1.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { + if (!flagD0 && !flagD0bar && (candidate.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Bg); } // background case D0 - if (flagD0bar && (candidate1.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { + if (flagD0bar && (candidate.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barSig); } // signal case D0bar - if (flagD0 && (candidate1.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { + if (flagD0 && (candidate.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barRef); } // reflection case D0bar - if (!flagD0 && !flagD0bar && (candidate1.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { + if (!flagD0 && !flagD0bar && (candidate.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barBg); } // background case D0bar - entryD0HadronPair(getDeltaPhi(track.phi(), candidate1.phi()), - track.eta() - candidate1.eta(), - candidate1.pt(), + entryD0HadronPair(getDeltaPhi(track.phi(), candidate.phi()), + track.eta() - candidate.eta(), + candidate.pt(), track.pt(), poolBin, correlationStatus); - entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1), signalStatus); + entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(candidate), hfHelper.invMassD0barToKPi(candidate), signalStatus); } // end inner loop (Tracks) - } // end of outer loop (D0) + } // end of outer loop (D0) registry.fill(HIST("hZvtx"), collision.posZ()); registry.fill(HIST("hMultV0M"), collision.multFT0M()); } @@ -684,7 +685,7 @@ struct HfCorrelatorD0Hadrons { // ====================== Implement Event mixing on Data =================================== void processDataMixedEvent(SelectedCollisions const& collisions, - SelectedCandidatesData const& candidates, + SelectedCandidatesDataMl const& candidates, SelectedTracks const& tracks) { for (const auto& collision : collisions) { @@ -693,7 +694,7 @@ struct HfCorrelatorD0Hadrons { } auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairData) { // LOGF(info, "Mixed event collisions: Index = (%d, %d), tracks Size: (%d, %d), Z Vertex: (%f, %f), Pool Bin: (%d, %d)", c1.globalIndex(), c2.globalIndex(), tracks1.size(), tracks2.size(), c1.posZ(), c2.posZ(), corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())),corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M()))); // For debug @@ -713,16 +714,24 @@ struct HfCorrelatorD0Hadrons { auto ePion = t2.energy(massPi); invMassDstar1 = std::sqrt((ePiK + ePion) * (ePiK + ePion) - pSum2); invMassDstar2 = std::sqrt((eKPi + ePion) * (eKPi + ePion) - pSum2); + std::vector outputMlD0 = {-1., -1., -1.}; + std::vector outputMlD0bar = {-1., -1., -1.}; if (t1.isSelD0() >= selectionFlagD0) { if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(t1)) - softPiMass) < ptSoftPionMax) { isSoftPiD0 = true; } + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMlD0[iclass] = t1.mlProbD0()[classMl->at(iclass)]; + } } if (t1.isSelD0bar() >= selectionFlagD0bar) { if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(t1)) - softPiMass) < ptSoftPionMax) { isSoftPiD0bar = true; } + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { + outputMlD0bar[iclass] = t1.mlProbD0bar()[classMl->at(iclass)]; + } } int signalStatus = 0; @@ -743,6 +752,7 @@ struct HfCorrelatorD0Hadrons { bool correlationStatus = false; entryD0HadronPair(getDeltaPhi(t1.phi(), t2.phi()), t1.eta() - t2.eta(), t1.pt(), t2.pt(), poolBin, correlationStatus); entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(t1), hfHelper.invMassD0barToKPi(t1), signalStatus); + entryD0HadronMlInfo(outputMlD0[0], outputMlD0[1], outputMlD0[2], outputMlD0bar[0], outputMlD0bar[1], outputMlD0bar[2]); } } } @@ -789,8 +799,8 @@ struct HfCorrelatorD0Hadrons { } } - flagD0 = t1.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Signal 'true' if candidate1 matched to D0 (particle) - flagD0bar = t1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) + flagD0 = t1.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Signal 'true' if candidate matched to D0 (particle) + flagD0bar = t1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate, selected as D0 (particle), is matched to D0bar (antiparticle) int signalStatus = 0; if (flagD0 && (t1.isSelD0() >= selectionFlagD0)) { diff --git a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx index 416460e4689..2654984c45a 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx @@ -36,7 +36,8 @@ using namespace o2::analysis::hf_correlations; namespace o2::aod { -using DHadronPairFull = soa::Join; +using D0HadronPairFull = soa::Join; +using D0HadronPairFullMl = soa::Join; } // namespace o2::aod // string definitions, used for histogram axis labels @@ -58,6 +59,8 @@ AxisSpec axisPtHadron = {11, 0., 11., ""}; AxisSpec axisPoolBin = {9, 0., 9., ""}; AxisSpec axisCorrelationState = {2, 0., 2., ""}; ConfigurableAxis axisMass{"axisMass", {250, 1.65f, 2.15f}, ""}; +ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; +AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; // definition of vectors for standard ptbin and invariant mass configurables const int nPtBinsCorrelations = 12; @@ -83,9 +86,14 @@ const double ptHadronMax = 10.0; struct HfTaskCorrelationD0Hadrons { // pT ranges for correlation plots: the default values are those embedded in hf_cuts_d0_to_pi_k (i.e. the mass pT bins), but can be redefined via json files - Configurable> binsCorrelations{"ptBinsForCorrelations", std::vector{vecPtBinsCorrelations}, "pT bin limits for correlation plots"}; + Configurable> binsCorrelations{"binsCorrelations", std::vector{vecPtBinsCorrelations}, "pT bin limits for correlation plots"}; // pT bins for effiencies: same as above - Configurable> binsEfficiency{"ptBinsForEfficiency", std::vector{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for efficiency"}; + Configurable> binsEfficiency{"binsEfficiency", std::vector{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for efficiency"}; + Configurable> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; + Configurable> mlOutputPromptD0{"mlOutputPromptD0", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"}; + Configurable> mlOutputBkgD0{"mlOutputBkgD0", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"}; + Configurable> mlOutputPromptD0bar{"mlOutputPromptD0bar", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"}; + Configurable> mlOutputBkgD0bar{"mlOutputBkgD0bar", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"}; // signal and sideband region edges, to be defined via json file (initialised to empty) Configurable> signalRegionLeft{"signalRegionLeft", std::vector{vecsignalRegionLeft}, "Inner values of signal region vs pT"}; Configurable> signalRegionRight{"signalRegionRight", std::vector{vecsignalRegionRight}, "Outer values of signal region vs pT"}; @@ -96,7 +104,7 @@ struct HfTaskCorrelationD0Hadrons { Configurable> efficiencyDmeson{"efficiencyDmeson", std::vector{vecEfficiencyDmeson}, "Efficiency values for D meson specie under study"}; Configurable isTowardTransverseAway{"isTowardTransverseAway", false, "Divide into three regions: toward, transverse, and away"}; Configurable leadingParticlePtMin{"leadingParticlePtMin", 0., "Min for leading particle pt"}; - Configurable applyEfficiency{"efficiencyFlagD", 1, "Flag for applying efficiency weights"}; + Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying efficiency weights"}; HistogramRegistry registry{ "registry", @@ -191,6 +199,10 @@ struct HfTaskCorrelationD0Hadrons { { int nBinsPtAxis = binsCorrelations->size() - 1; const double* valuesPtAxis = binsCorrelations->data(); + registry.add("hBdtScorePromptD0", "D0 BDT prompt score", {HistType::kTH1F, {axisBdtScore}}); + registry.add("hBdtScoreBkgD0", "D0 BDT bkg score", {HistType::kTH1F, {axisBdtScore}}); + registry.add("hBdtScorePromptD0bar", "D0bar BDT prompt score", {HistType::kTH1F, {axisBdtScore}}); + registry.add("hBdtScoreBkgD0bar", "D0bar BDT bkg score", {HistType::kTH1F, {axisBdtScore}}); registry.get(HIST("hCorrel2DVsPtSignalRegion"))->GetAxis(2)->Set(nBinsPtAxis, valuesPtAxis); registry.get(HIST("hCorrel2DVsPtSidebands"))->GetAxis(2)->Set(nBinsPtAxis, valuesPtAxis); registry.get(HIST("hCorrel2DVsPtSignalRegion"))->Sumw2(); @@ -233,8 +245,26 @@ struct HfTaskCorrelationD0Hadrons { /// D-h correlation pair filling task, from pair tables - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) /// Works on both USL and LS analyses pair tables - void processData(aod::DHadronPairFull const& pairEntries) + void processData(aod::D0HadronPairFullMl const& pairEntries, + aod::D0CandRecoInfo const& candidates) { + for (const auto& candidate : candidates) { + float ptD = candidate.ptD(); + float bdtScorePromptD0 = candidate.mlScorePromptD0(); + float bdtScoreBkgD0 = candidate.mlScoreBkgD0(); + float bdtScorePromptD0bar = candidate.mlScorePromptD0bar(); + float bdtScoreBkgD0bar = candidate.mlScoreBkgD0bar(); + int effBinD = o2::analysis::findBin(binsEfficiency, ptD); + if (bdtScorePromptD0 < mlOutputPromptD0->at(effBinD) || bdtScoreBkgD0 > mlOutputBkgD0->at(effBinD) || + bdtScorePromptD0bar < mlOutputPromptD0bar->at(effBinD) || bdtScoreBkgD0bar > mlOutputBkgD0bar->at(effBinD)) { + continue; + } + registry.fill(HIST("hBdtScorePromptD0"), bdtScorePromptD0); + registry.fill(HIST("hBdtScoreBkgD0"), bdtScoreBkgD0); + registry.fill(HIST("hBdtScorePromptD0bar"), bdtScorePromptD0bar); + registry.fill(HIST("hBdtScoreBkgD0bar"), bdtScoreBkgD0bar); + } + for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities double deltaPhi = pairEntry.deltaPhi(); @@ -248,6 +278,10 @@ struct HfTaskCorrelationD0Hadrons { int ptBinD = o2::analysis::findBin(binsCorrelations, ptD); int poolBin = pairEntry.poolBin(); bool isAutoCorrelated = pairEntry.isAutoCorrelated(); + float bdtScorePromptD0 = pairEntry.mlScorePromptD0(); + float bdtScoreBkgD0 = pairEntry.mlScoreBkgD0(); + float bdtScorePromptD0bar = pairEntry.mlScorePromptD0bar(); + float bdtScoreBkgD0bar = pairEntry.mlScoreBkgD0bar(); // reject entries outside pT ranges of interest if (ptBinD < 0 || effBinD < 0) { continue; @@ -255,7 +289,10 @@ struct HfTaskCorrelationD0Hadrons { if (ptHadron > ptHadronMax) { ptHadron = ptHadronMax + 0.5; } - + if (bdtScorePromptD0 < mlOutputPromptD0->at(ptBinD) || bdtScoreBkgD0 > mlOutputBkgD0->at(ptBinD) || + bdtScorePromptD0bar < mlOutputPromptD0bar->at(ptBinD) || bdtScoreBkgD0bar > mlOutputBkgD0bar->at(ptBinD)) { + continue; + } double efficiencyWeight = 1.; if (applyEfficiency) { efficiencyWeight = 1. / (efficiencyDmeson->at(o2::analysis::findBin(binsEfficiency, ptD))); // ***** track efficiency to be implemented ***** @@ -362,7 +399,7 @@ struct HfTaskCorrelationD0Hadrons { } PROCESS_SWITCH(HfTaskCorrelationD0Hadrons, processData, "Process data", false); - void processMcRec(aod::DHadronPairFull const& pairEntries) + void processMcRec(aod::D0HadronPairFull const& pairEntries) { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities @@ -580,7 +617,7 @@ struct HfTaskCorrelationD0Hadrons { PROCESS_SWITCH(HfTaskCorrelationD0Hadrons, processMcRec, "Process MC Reco mode", true); /// D-Hadron correlation pair filling task, from pair tables - for MC gen-level analysis (no filter/selection, only true signal) - void processMcGen(aod::DHadronPairFull const& pairEntries) + void processMcGen(aod::D0HadronPairFull const& pairEntries) { for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities From 110a5a066920d1e80c5e2c5643f73fec8b8cfd0a Mon Sep 17 00:00:00 2001 From: Marvin Hemmer <53471402+mhemmer-cern@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:35:17 +0100 Subject: [PATCH 320/459] [PWGJE,EMCAL-670] Add time differences into the clusterdefinition (#8896) --- PWGJE/DataModel/EMCALClusterDefinition.h | 18 ++++----- PWGJE/DataModel/EMCALClusters.h | 44 +++++++++++++++------ PWGJE/TableProducer/emcalCorrectionTask.cxx | 5 ++- 3 files changed, 43 insertions(+), 24 deletions(-) diff --git a/PWGJE/DataModel/EMCALClusterDefinition.h b/PWGJE/DataModel/EMCALClusterDefinition.h index a7fcb34c439..ead4a14dde7 100644 --- a/PWGJE/DataModel/EMCALClusterDefinition.h +++ b/PWGJE/DataModel/EMCALClusterDefinition.h @@ -9,11 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// Class for the cluster definition, i.e. what is considered a cluster by the clusterizer. -// The cluster definition contains information about the used algorithm, seed threshold, -// cell energy, gradient as well as timing cut -// -/// \author Florian Jonas +/// \file EMCALClusterDefinition.h +/// \brief Class for the cluster definition, i.e. what is considered a cluster by the clusterizer. The cluster definition contains information about the used algorithm, seed threshold, cell energy, gradient as well as timing cut +/// \author Florian Jonas , Marvin Hemmer #ifndef PWGJE_DATAMODEL_EMCALCLUSTERDEFINITION_H_ #define PWGJE_DATAMODEL_EMCALCLUSTERDEFINITION_H_ @@ -38,8 +36,9 @@ struct EMCALClusterDefinition { std::string name = "kUndefined"; // name of the cluster definition double seedEnergy = 0.1; // seed threshold (GeV) double minCellEnergy = 0.05; // minimum cell energy (GeV) - double timeMin = -10000; // minimum time (ns) - double timeMax = 10000; // maximum time (ns) + double timeMin = -10000.; // minimum time (ns) + double timeMax = 10000.; // maximum time (ns) + double timeDiff = 20000.; // maximum time difference (ns) between seed cell and aggregation cell bool doGradientCut = true; // apply gradient cut if true double gradientCut = -1; // gradient cut bool recalcShowerShape5x5 = false; // recalculate shower shape using 5x5 cells @@ -47,7 +46,7 @@ struct EMCALClusterDefinition { // default constructor EMCALClusterDefinition() = default; // constructor - EMCALClusterDefinition(ClusterAlgorithm_t pAlgorithm, int pStorageID, int pSelectedCellType, std::string pName, double pSeedEnergy, double pMinCellEnergy, double pTimeMin, double pTimeMax, bool pDoGradientCut, double pGradientCut, bool precalcShowerShape5x5) + EMCALClusterDefinition(ClusterAlgorithm_t pAlgorithm, int pStorageID, int pSelectedCellType, std::string pName, double pSeedEnergy, double pMinCellEnergy, double pTimeMin, double pTimeMax, double ptimeDiff, bool pDoGradientCut, double pGradientCut, bool precalcShowerShape5x5) { algorithm = pAlgorithm; storageID = pStorageID; @@ -57,6 +56,7 @@ struct EMCALClusterDefinition { minCellEnergy = pMinCellEnergy; timeMin = pTimeMin; timeMax = pTimeMax; + timeDiff = ptimeDiff; doGradientCut = pDoGradientCut; gradientCut = pGradientCut; recalcShowerShape5x5 = precalcShowerShape5x5; @@ -65,7 +65,7 @@ struct EMCALClusterDefinition { // implement comparison operators for int std::string and ClusterAlgorithm_t bool operator==(const EMCALClusterDefinition& rhs) const { - return (algorithm == rhs.algorithm && storageID == rhs.storageID && name == rhs.name && seedEnergy == rhs.seedEnergy && minCellEnergy == rhs.minCellEnergy && timeMin == rhs.timeMin && timeMax == rhs.timeMax && gradientCut == rhs.gradientCut && doGradientCut == rhs.doGradientCut && recalcShowerShape5x5 == rhs.recalcShowerShape5x5); + return (algorithm == rhs.algorithm && storageID == rhs.storageID && name == rhs.name && seedEnergy == rhs.seedEnergy && minCellEnergy == rhs.minCellEnergy && timeMin == rhs.timeMin && timeMax == rhs.timeMax && timeDiff == rhs.timeDiff && gradientCut == rhs.gradientCut && doGradientCut == rhs.doGradientCut && recalcShowerShape5x5 == rhs.recalcShowerShape5x5); } bool operator!=(const EMCALClusterDefinition& rhs) const { diff --git a/PWGJE/DataModel/EMCALClusters.h b/PWGJE/DataModel/EMCALClusters.h index a4d6e032422..1981fd635aa 100644 --- a/PWGJE/DataModel/EMCALClusters.h +++ b/PWGJE/DataModel/EMCALClusters.h @@ -9,8 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// Table definitions for EMCAL analysis clusters -// +/// \file EMCALClusters.h +/// \brief Table definitions for EMCAL analysis clusters /// \author Raymond Ehlers , ORNL #ifndef PWGJE_DATAMODEL_EMCALCLUSTERS_H_ @@ -28,17 +28,23 @@ namespace emcalcluster // define global cluster definitions // New definitions should be added here! -const EMCALClusterDefinition kV3NoSplit(ClusterAlgorithm_t::kV3, 0, 1, "kV3NoSplit", 0.5, 0.1, -10000, 10000, false, 0., false); -const EMCALClusterDefinition kV3NoSplitLowSeed(ClusterAlgorithm_t::kV3, 1, 1, "kV3NoSplitLowSeed", 0.3, 0.1, -10000, 10000, false, 0., false); -const EMCALClusterDefinition kV3NoSplitLowerSeed(ClusterAlgorithm_t::kV3, 2, 1, "kV3NoSplitLowerSeed", 0.2, 0.1, -10000, 10000, false, 0., false); -const EMCALClusterDefinition kV3Default(ClusterAlgorithm_t::kV3, 10, 1, "kV3Default", 0.5, 0.1, -10000, 10000, true, 0.03, false); -const EMCALClusterDefinition kV3MostSplit(ClusterAlgorithm_t::kV3, 11, 1, "kV3MostSplit", 0.5, 0.1, -10000, 10000, true, 0., false); -const EMCALClusterDefinition kV3LowSeed(ClusterAlgorithm_t::kV3, 12, 1, "kV3LowSeed", 0.3, 0.1, -10000, 10000, true, 0.03, false); -const EMCALClusterDefinition kV3MostSplitLowSeed(ClusterAlgorithm_t::kV3, 13, 1, "kV3MostSplitLowSeed", 0.3, 0.1, -10000, 10000, true, 0., false); -const EMCALClusterDefinition kV3StrictTime(ClusterAlgorithm_t::kV3, 20, 1, "kV3StrictTime", 0.5, 0.1, -500, 500, true, 0.03, false); -const EMCALClusterDefinition kV3StricterTime(ClusterAlgorithm_t::kV3, 21, 1, "kV3StricterTime", 0.5, 0.1, -100, 100, true, 0.03, false); -const EMCALClusterDefinition kV3MostStrictTime(ClusterAlgorithm_t::kV3, 22, 1, "kV3MostStrictTime", 0.5, 0.1, -50, 50, true, 0.03, false); -const EMCALClusterDefinition kV3Default5x5(ClusterAlgorithm_t::kV3, 30, 1, "kV3Default5x5", 0.5, 0.1, -10000, 10000, true, 0.03, true); +const EMCALClusterDefinition kV3NoSplit(ClusterAlgorithm_t::kV3, 0, 1, "kV3NoSplit", 0.5, 0.1, -10000, 10000, 20000, false, 0., false); +const EMCALClusterDefinition kV3NoSplitLowSeed(ClusterAlgorithm_t::kV3, 1, 1, "kV3NoSplitLowSeed", 0.3, 0.1, -10000, 10000, 20000, false, 0., false); +const EMCALClusterDefinition kV3NoSplitLowerSeed(ClusterAlgorithm_t::kV3, 2, 1, "kV3NoSplitLowerSeed", 0.2, 0.1, -10000, 10000, 20000, false, 0., false); +const EMCALClusterDefinition kV3Default(ClusterAlgorithm_t::kV3, 10, 1, "kV3Default", 0.5, 0.1, -10000, 10000, 20000, true, 0.03, false); +const EMCALClusterDefinition kV3MostSplit(ClusterAlgorithm_t::kV3, 11, 1, "kV3MostSplit", 0.5, 0.1, -10000, 10000, 20000, true, 0., false); +const EMCALClusterDefinition kV3LowSeed(ClusterAlgorithm_t::kV3, 12, 1, "kV3LowSeed", 0.3, 0.1, -10000, 10000, 20000, true, 0.03, false); +const EMCALClusterDefinition kV3MostSplitLowSeed(ClusterAlgorithm_t::kV3, 13, 1, "kV3MostSplitLowSeed", 0.3, 0.1, -10000, 10000, 20000, true, 0., false); +const EMCALClusterDefinition kV3StrictTime(ClusterAlgorithm_t::kV3, 20, 1, "kV3StrictTime", 0.5, 0.1, -500, 500, 20000, true, 0.03, false); +const EMCALClusterDefinition kV3StricterTime(ClusterAlgorithm_t::kV3, 21, 1, "kV3StricterTime", 0.5, 0.1, -100, 100, 20000, true, 0.03, false); +const EMCALClusterDefinition kV3MostStrictTime(ClusterAlgorithm_t::kV3, 22, 1, "kV3MostStrictTime", 0.5, 0.1, -50, 50, 20000, true, 0.03, false); +const EMCALClusterDefinition kV3Default5x5(ClusterAlgorithm_t::kV3, 30, 1, "kV3Default5x5", 0.5, 0.1, -10000, 10000, 20000, true, 0.03, true); +const EMCALClusterDefinition kV3SmallTimeDiff(ClusterAlgorithm_t::kV3, 40, 1, "kV3SmallTimeDiff", 0.5, 0.1, -10000, 10000, 500, true, 0.03, false); +const EMCALClusterDefinition kV3SmallerTimeDiff(ClusterAlgorithm_t::kV3, 41, 1, "kV3SmallerTimeDiff", 0.5, 0.1, -10000, 10000, 100, true, 0.03, false); +const EMCALClusterDefinition kV3SmallestTimeDiff(ClusterAlgorithm_t::kV3, 42, 1, "kV3SmallestTimeDiff", 0.5, 0.1, -10000, 10000, 50, true, 0.03, false); +const EMCALClusterDefinition kV3MostSplitSmallTimeDiff(ClusterAlgorithm_t::kV3, 43, 1, "kV3MostSplitSmallTimeDiff", 0.5, 0.1, -10000, 10000, 500, true, 0., false); +const EMCALClusterDefinition kV3MostSplitSmallerTimeDiff(ClusterAlgorithm_t::kV3, 44, 1, "kV3MostSplitSmallerTimeDiff", 0.5, 0.1, -10000, 10000, 100, true, 0., false); +const EMCALClusterDefinition kV3MostSplitSmallestTimeDiff(ClusterAlgorithm_t::kV3, 45, 1, "kV3MostSplitSmallestTimeDiff", 0.5, 0.1, -10000, 10000, 50, true, 0., false); /// \brief function returns EMCALClusterDefinition for the given name /// \param name name of the cluster definition @@ -67,6 +73,18 @@ const EMCALClusterDefinition getClusterDefinitionFromString(const std::string& c return kV3MostStrictTime; } else if (clusterDefinitionName == "kV3Default5x5") { return kV3Default5x5; + } else if (clusterDefinitionName == "kV3SmallTimeDiff") { + return kV3SmallTimeDiff; + } else if (clusterDefinitionName == "kV3SmallerTimeDiff") { + return kV3SmallerTimeDiff; + } else if (clusterDefinitionName == "kV3SmallestTimeDiff") { + return kV3SmallestTimeDiff; + } else if (clusterDefinitionName == "kV3MostSplitSmallTimeDiff") { + return kV3MostSplitSmallTimeDiff; + } else if (clusterDefinitionName == "kV3MostSplitSmallerTimeDiff") { + return kV3MostSplitSmallerTimeDiff; + } else if (clusterDefinitionName == "kV3MostSplitSmallestTimeDiff") { + return kV3MostSplitSmallestTimeDiff; } else { throw std::invalid_argument("Cluster definition name not recognized"); } diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index 464f23a360d..2db77ca4894 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -163,14 +163,15 @@ struct EmcalCorrectionTask { mClusterFactories.setExoticCellInCrossMinAmplitude(exoticCellInCrossMinAmplitude); mClusterFactories.setUseWeightExotic(useWeightExotic); for (const auto& clusterDefinition : mClusterDefinitions) { - mClusterizers.emplace_back(std::make_unique>(1E9, clusterDefinition.timeMin, clusterDefinition.timeMax, clusterDefinition.gradientCut, clusterDefinition.doGradientCut, clusterDefinition.seedEnergy, clusterDefinition.minCellEnergy)); + mClusterizers.emplace_back(std::make_unique>(clusterDefinition.timeDiff, clusterDefinition.timeMin, clusterDefinition.timeMax, clusterDefinition.gradientCut, clusterDefinition.doGradientCut, clusterDefinition.seedEnergy, clusterDefinition.minCellEnergy)); LOG(info) << "Cluster definition initialized: " << clusterDefinition.toString(); LOG(info) << "timeMin: " << clusterDefinition.timeMin; LOG(info) << "timeMax: " << clusterDefinition.timeMax; + LOG(info) << "timeDiff: " << clusterDefinition.timeDiff; LOG(info) << "gradientCut: " << clusterDefinition.gradientCut; LOG(info) << "seedEnergy: " << clusterDefinition.seedEnergy; LOG(info) << "minCellEnergy: " << clusterDefinition.minCellEnergy; - LOG(info) << "storageID" << clusterDefinition.storageID; + LOG(info) << "storageID: " << clusterDefinition.storageID; } for (const auto& clusterizer : mClusterizers) { clusterizer->setGeometry(geometry); From 210e51acf9f92b6c09769912036ce748b33e6fd8 Mon Sep 17 00:00:00 2001 From: AlexianL <123153896+AlexianL@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:59:09 +0100 Subject: [PATCH 321/459] [PWGHF] taskFlow.cxx: changes in how multiplicites are obtained. (#8771) Co-authored-by: ALICE Action Bot --- PWGHF/HFC/Tasks/taskFlow.cxx | 149 ++++++++++++++++++++--------------- 1 file changed, 85 insertions(+), 64 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index b8a4619858d..0f67d4f0a2b 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -10,6 +10,8 @@ // or submit itself to any jurisdiction. /// \file taskFlow.cxx +/// \brief HF-h correlations in TPC-TPC and TPC-MFT +/// \author Alexian Lejeune , Czech Technical University in Prague /// \author Katarina Krizkova Gajdosova , CERN /// \author Maja Kabus , CERN @@ -65,6 +67,7 @@ struct HfTaskFlow { Configurable etaTrackAssocMax{"etaTrackAssocMax", 0.8f, "max. eta of associated tracks"}; Configurable ptTrackAssocMin{"ptTrackAssocMin", 0.5f, "min. pT of associated tracks"}; // configurables for HF candidates + Configurable etaCandidateMax{"etaCandidateMax", 0.8f, "max. eta of HF candidate"}; Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; Configurable selectionFlagLcToPKPi{"selectionFlagLcToPKPi", 1, "Selection Flag for LambdaC"}; @@ -111,11 +114,11 @@ struct HfTaskFlow { // HF candidate filter // TODO: use Partition instead of filter - Filter candidateFilterD0 = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || - aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; + Filter candidateFilterD0 = (aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0) || + (aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar); - Filter candidateFilterLc = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLcToPKPi || - aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLcToPiKP; + Filter candidateFilterLc = (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLcToPKPi) || + (aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLcToPiKP); // Collision filters // FIXME: The filter is applied also on the candidates! Beware! @@ -220,7 +223,7 @@ struct HfTaskFlow { registry.add("Data/TpcTpc/HadronHadron/SameEvent/hPhi", "phi", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); registry.add("Data/TpcTpc/HadronHadron/SameEvent/hYields", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("Data/TpcTpc/HadronHadron/SameEvent/hEtaPhi", "multiplicity vs eta vs phi", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); - registry.add("Data/TpcTpc/HadronHadron/SameEvent/hNtracks", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + // registry.add("Data/TpcTpc/HadronHadron/SameEvent/hNtracks", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); // Katarina had this : registry.add("Data/TpcTpc/HadronHadron/SameEvent/hVzEta", "eta vs. Vz", {HistType::kTH2F, {{100, -4, 4, "#eta"}, {20, -10, 10, "Vz"}}}); @@ -334,7 +337,7 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HadronHadron/SameEvent/hPhiTPC", "phiTPC", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); registry.add("Data/TpcMft/HadronHadron/SameEvent/hPtTPC", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); registry.add("Data/TpcMft/HadronHadron/SameEvent/hYieldsTPC", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); - registry.add("Data/TpcMft/HadronHadron/SameEvent/hNtracksTPC", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + // registry.add("Data/TpcMft/HadronHadron/SameEvent/hNtracksTPC", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcMft/HadronHadron/SameEvent/hMultiplicityTPC", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{500, 0, 500}}}); // DATA : associated particles (MFT tracks) histograms for TPC-MFT h-h same event @@ -342,8 +345,8 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HadronHadron/SameEvent/hEtaMFT", "etaMFT", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); registry.add("Data/TpcMft/HadronHadron/SameEvent/hPhiMFT", "phiMFT", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); registry.add("Data/TpcMft/HadronHadron/SameEvent/hPtMFT", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); - registry.add("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); - registry.add("Data/TpcMft/HadronHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HadronHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -5, 0, "#eta"}}}); + // registry.add("Data/TpcMft/HadronHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); // DATA : histograms for TPC-MFT h-h event mixing for TPC tracks registry.add("Data/TpcMft/HadronHadron/MixedEvent/hMultiplicityMixingTPC", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); @@ -374,7 +377,8 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HfHadron/SameEvent/2Prong/hEtaCandidate", "etaTPC", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/2Prong/hPhiCandidate", "phiTPC", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/2Prong/hYieldsCandidate", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/2Prong/hNtracksCandidate", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/2Prong/hMultiplicityCandidate", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{500, 0, 500}}}); + // registry.add("Data/TpcMft/HfHadron/SameEvent/2Prong/hNtracksCandidate", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); // DATA : trigger particles (candidates) histograms for TPC-MFT HF-h same event registry.add("Data/TpcMft/HfHadron/SameEvent/2Prong/hPtCandidate", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0, 10.}}}); @@ -401,8 +405,8 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HfHadron/SameEvent/hEtaMFT", "etaMFT", {HistType::kTH1F, {{100, -4, 4, "#eta"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/hPhiMFT", "phiMFT", {HistType::kTH1F, {{100, 0, TwoPI, "#varphi"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/hPtMFT", "pT", {HistType::kTH1F, {{100, 0, 10, "p_{T}"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/hYieldsMFT", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -5, 0, "#eta"}}}); + // registry.add("Data/TpcMft/HfHadron/SameEvent/hNtracksMFT", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); // DATA : histograms for TPC-MFT h-h event mixing for candidates registry.add("Data/TpcMft/HfHadron/MixedEvent/hMultiplicityMixingCandidate", "hMultiplicityMixing", {HistType::kTH1F, {{500, 0, 500}}}); @@ -429,7 +433,8 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hEventCountSame", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hYieldsCandidate", "multiplicity vs pT vs eta", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hNtracksCandidate", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hMultiplicityCandidate", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{500, 0, 500}}}); + // registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hNtracksCandidate", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hEtaPhiCandidate", "multiplicity vs eta vs phi in TPC", {HistType::kTH3F, {{200, 0, 200, "multiplicity"}, {100, -2, 2, "#eta"}, {200, 0, TwoPI, "#varphi"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hMassVsPt", "3-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hMass", "3-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{100, 0., 10.}}}); @@ -437,7 +442,6 @@ struct HfTaskFlow { registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0VsPtProng0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0VsPtProng1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hd0VsPtProng2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hPt", "3-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hPtProng0", "3-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); registry.add("Data/TpcMft/HfHadron/SameEvent/3Prong/hPtProng1", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); @@ -475,7 +479,7 @@ struct HfTaskFlow { registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity", "hMultiplicity", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hVtxZ", "hVtxZ", {HistType::kTH1F, {{400, -50, 50}}}); - registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); // Katarina had this : registry.add("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary", "hMultiplicityPrimary", {HistType::kTH1F, {{500, 0, 500}}}); // histograms for MC associated particles @@ -498,7 +502,7 @@ struct HfTaskFlow { registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicity", "hMultiplicity", {HistType::kTH1F, {{500, 0, 500}}}); registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hVtxZ", "hVtxZ", {HistType::kTH1F, {{400, -50, 50}}}); - registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "hNtracks", {HistType::kTH1F, {{500, 0, 500}}}); + registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hEventCountSame", "bin", {HistType::kTH1F, {{nBinsMix + 2, -2.5, -0.5 + nBinsMix, "bin"}}}); // Katarina had this : registry.add("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicityPrimary", "hMultiplicityPrimary", {HistType::kTH1F, {{500, 0, 500}}}); // histograms for MC associated particles @@ -780,6 +784,7 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hEtaCandidate"), candidate.eta()); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hPhiCandidate"), phi); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hMultiplicityCandidate"), multiplicity); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hEtaPhiCandidate"), multiplicity, candidate.eta(), phi); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hYieldsCandidate"), multiplicity, pt, candidate.eta()); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hPtCandidate"), pt); @@ -832,7 +837,7 @@ struct HfTaskFlow { registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hYieldsCandidate"), multiplicity, pt, candidate.eta()); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hEtaPhiCandidate"), multiplicity, candidate.eta(), phi); - registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hNtracksCandidate"), multiplicity); + registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hMultiplicityCandidate"), multiplicity); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPt"), pt); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPtProng0"), ptProng0); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hPtProng1"), ptProng1); @@ -1049,6 +1054,7 @@ struct HfTaskFlow { template bool isAcceptedCandidate(TTrack const& candidate) { + auto etaCandidate = candidate.eta(); if constexpr (std::is_same_v) { // For now, that means we do LambdaC if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) { @@ -1057,6 +1063,9 @@ struct HfTaskFlow { if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { return false; } + if (etaCandidateMax >= 0. && std::abs(etaCandidate) > etaCandidateMax) { + return false; + } return true; } else { // For now, that means we do D0 if (!(candidate.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { @@ -1065,6 +1074,9 @@ struct HfTaskFlow { if (yCandMax >= 0. && std::abs(hfHelper.yD0(candidate)) > yCandMax) { return false; } + if (etaCandidateMax >= 0. && std::abs(etaCandidate) > etaCandidateMax) { + return false; + } return true; } } @@ -1287,8 +1299,6 @@ struct HfTaskFlow { } // end of loop over tracks 1 } - // template - // void mixCollisions(FilteredCollisionsWSelMult const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) template void mixCollisions(TCollisions const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) { @@ -1353,7 +1363,7 @@ struct HfTaskFlow { } // end of if condition for TPC-TPC or TPC-MFT case } - corrContainer->fillEvent(multiplicityTracks2, CorrelationContainer::kCFStepReconstructed); + corrContainer->fillEvent(multiplicityTracks1, CorrelationContainer::kCFStepReconstructed); fillCorrelations(corrContainer, tracks1, tracks2, multiplicityTracks1, collision1.posZ(), false); } } @@ -1422,7 +1432,8 @@ struct HfTaskFlow { // options are ran at the same time // temporary solution, since other correlation options always have to be ran with h-h, too // TODO: rewrite it in a more intelligent way - const auto multiplicity = tracks.size(); + // const auto multiplicity = tracks.size(); + const auto multiplicity = collision.multNTracksPV(); registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); registry.fill(HIST("Data/TpcTpc/HadronHadron/SameEvent/hVtxZ"), collision.posZ()); @@ -1455,7 +1466,7 @@ struct HfTaskFlow { return; } - const auto multiplicity = candidates.size(); + const auto multiplicity = collision.multNTracksPV(); BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicity)); registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/2Prong/hEventCountSame"), bin); @@ -1484,7 +1495,7 @@ struct HfTaskFlow { return; } - const auto multiplicity = candidates.size(); + const auto multiplicity = collision.multNTracksPV(); BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicity)); registry.fill(HIST("Data/TpcTpc/HfHadron/SameEvent/3Prong/hEventCountSame"), bin); @@ -1507,14 +1518,14 @@ struct HfTaskFlow { return; } - const auto multiplicityTPC = tracks.size(); + const auto multiplicity = collision.multNTracksPV(); BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; - int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicityTPC)); + int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicity)); registry.fill(HIST("Data/TpcMft/HadronHadron/SameEvent/hEventCountSame"), bin); - sameTPCMFTChCh->fillEvent(multiplicityTPC, CorrelationContainer::kCFStepReconstructed); + sameTPCMFTChCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillCorrelations(sameTPCMFTChCh, tracks, mftTracks, multiplicityTPC, collision.posZ(), true); + fillCorrelations(sameTPCMFTChCh, tracks, mftTracks, multiplicity, collision.posZ(), true); } PROCESS_SWITCH(HfTaskFlow, processSameTpcMftChCh, "DATA : Process same-event correlations for TPC-MFT h-h case", false); @@ -1524,6 +1535,7 @@ struct HfTaskFlow { void processSameTpcMftD0Ch(FilteredCollisionsWSelMult::iterator const& collision, HfCandidatesSelD0 const& candidates, + TracksWDcaSel const& tracks, aod::MFTTracks const& mftTracks) { auto fillEventSelectionPlots = true; @@ -1536,14 +1548,14 @@ struct HfTaskFlow { return; } - const auto multiplicityCandidates = candidates.size(); + const auto multiplicity = collision.multNTracksPV(); BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; - int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicityCandidates)); + int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicity)); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/2Prong/hEventCountSame"), bin); - sameTPCMFTHfCh->fillEvent(multiplicityCandidates, CorrelationContainer::kCFStepReconstructed); + sameTPCMFTHfCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillCorrelations(sameTPCMFTHfCh, candidates, mftTracks, multiplicityCandidates, collision.posZ(), true); + fillCorrelations(sameTPCMFTHfCh, candidates, mftTracks, multiplicity, collision.posZ(), true); } PROCESS_SWITCH(HfTaskFlow, processSameTpcMftD0Ch, "DATA : Process same-event correlations for TPC-MFT D0-h case", false); @@ -1553,6 +1565,7 @@ struct HfTaskFlow { void processSameTpcMftLcCh(FilteredCollisionsWSelMult::iterator const& collision, HfCandidatesSelLc const& candidates, + TracksWDcaSel const& tracks, aod::MFTTracks const& mftTracks) { auto fillEventSelectionPlots = true; @@ -1565,14 +1578,14 @@ struct HfTaskFlow { return; } - const auto multiplicityCandidates = candidates.size(); + const auto multiplicity = collision.multNTracksPV(); BinningPolicyBase<2> baseBinning{{axisVertex, axisMultiplicity}, true}; - int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicityCandidates)); + int bin = baseBinning.getBin(std::make_tuple(collision.posZ(), multiplicity)); registry.fill(HIST("Data/TpcMft/HfHadron/SameEvent/3Prong/hEventCountSame"), bin); - sameTPCMFTHfCh->fillEvent(multiplicityCandidates, CorrelationContainer::kCFStepReconstructed); + sameTPCMFTHfCh->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed); - fillCorrelations(sameTPCMFTHfCh, candidates, mftTracks, multiplicityCandidates, collision.posZ(), true); + fillCorrelations(sameTPCMFTHfCh, candidates, mftTracks, multiplicity, collision.posZ(), true); } PROCESS_SWITCH(HfTaskFlow, processSameTpcMftLcCh, "DATA : Process same-event correlations for TPC-MFT Lc-h case", false); @@ -1589,7 +1602,7 @@ struct HfTaskFlow { // return; //} - const auto multiplicity = mcTracks.size(); + const auto multiplicity = mcCollision.multNTracksPV(); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); registry.fill(HIST("MC/Rec/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mcCollision.posZ()); @@ -1623,7 +1636,9 @@ struct HfTaskFlow { // return; // } + // TODO : check if I have to get my multiplicity based on multNTracksPV or mcParticles.size() const auto multiplicity = mcParticles.size(); // Note: these are all MC particles after selection (not only primary) + // const auto multiplicity = collision.multNTracksPV(); registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hMultiplicity"), multiplicity); registry.fill(HIST("MC/Gen/TpcTpc/HadronHadron/SameEvent/hVtxZ"), mcCollision.posZ()); @@ -1656,13 +1671,19 @@ struct HfTaskFlow { TracksWDcaSel const& tracks) { // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&tracks, this](FilteredCollisionsWSelMult::iterator const& col) { - auto associatedTracks = tracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once - auto size = associatedTracks.size(); - return size; + // auto getTracksSize = [&tracks, this](FilteredCollisionsWSelMult::iterator const& col) { + // auto associatedTracks = tracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once + // auto size = associatedTracks.size(); + // return size; + // }; + + auto getMultiplicity = [&collisions, this](FilteredCollisionsWSelMult::iterator const& collision) { + auto multiplicity = collision.numContrib(); + return multiplicity; }; - mixCollisions(collisions, tracks, tracks, getTracksSize, mixedTPCTPCChCh); + // mixCollisions(collisions, tracks, tracks, getTracksSize, mixedTPCTPCChCh); + mixCollisions(collisions, tracks, tracks, getMultiplicity, mixedTPCTPCChCh); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcChCh, "DATA : Process mixed-event correlations for TPC-TPC h-h case", false); @@ -1675,14 +1696,12 @@ struct HfTaskFlow { HfCandidatesSelD0 const& candidates) { // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&tracks, this](FilteredCollisionsWSelMult::iterator const& col) { - // Still o2::aod::track::collisionId with HF ??? -> I don't think so - auto associatedTracks = tracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); - auto size = associatedTracks.size(); - return size; + auto getMultiplicity = [&collisions, this](FilteredCollisionsWSelMult::iterator const& collision) { + auto multiplicity = collision.numContrib(); + return multiplicity; }; - mixCollisions(collisions, candidates, tracks, getTracksSize, mixedTPCTPCHfCh); + mixCollisions(collisions, candidates, tracks, getMultiplicity, mixedTPCTPCHfCh); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcTpcD0Ch, "DATA : Process mixed-event correlations for TPC-TPC D0-h case", false); @@ -1715,13 +1734,18 @@ struct HfTaskFlow { aod::MFTTracks const& mftTracks) { // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&mftTracks, this](FilteredCollisionsWSelMult::iterator const& col) { - auto associatedTracks = mftTracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); - auto size = associatedTracks.size(); - return size; + // auto getTracksSize = [&tracks, this](FilteredCollisionsWSelMult::iterator const& col) { + // auto associatedTracks = tracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); + // auto size = associatedTracks.size(); + // return size; + // }; + + auto getMultiplicity = [&collisions, this](FilteredCollisionsWSelMult::iterator const& collision) { + auto multiplicity = collision.numContrib(); + return multiplicity; }; - mixCollisions(collisions, tracks, mftTracks, getTracksSize, mixedTPCMFTChCh); + mixCollisions(collisions, tracks, mftTracks, getMultiplicity, mixedTPCMFTChCh); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcMftChCh, "DATA : Process mixed-event correlations for TPC-MFT h-h case", false); @@ -1731,17 +1755,16 @@ struct HfTaskFlow { void processMixedTpcMftD0Ch(FilteredCollisionsWSelMult const& collisions, HfCandidatesSelD0 const& candidates, - aod::MFTTracks const& mftTracks) + aod::MFTTracks const& mftTracks, + TracksWDcaSel const& tracks) { // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&mftTracks, this](FilteredCollisionsWSelMult::iterator const& col) { - // Still o2::aod::track::collisionId with HF ??? -> I don't think so - auto associatedTracks = mftTracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); - auto size = associatedTracks.size(); - return size; + auto getMultiplicity = [&collisions, this](FilteredCollisionsWSelMult::iterator const& collision) { + auto multiplicity = collision.numContrib(); + return multiplicity; }; - mixCollisions(collisions, candidates, mftTracks, getTracksSize, mixedTPCMFTHfCh); + mixCollisions(collisions, candidates, mftTracks, getMultiplicity, mixedTPCMFTHfCh); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcMftD0Ch, "DATA : Process mixed-event correlations for TPC-MFT D0-h case", false); @@ -1755,14 +1778,12 @@ struct HfTaskFlow { { // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&mftTracks, this](FilteredCollisionsWSelMult::iterator const& col) { - // Still o2::aod::track::collisionId with HF ??? -> I don't think so - auto associatedTracks = mftTracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); - auto size = associatedTracks.size(); - return size; + auto getMultiplicity = [&collisions, this](FilteredCollisionsWSelMult::iterator const& collision) { + auto multiplicity = collision.numContrib(); + return multiplicity; }; - mixCollisions(collisions, candidates, mftTracks, getTracksSize, mixedTPCMFTHfCh); + mixCollisions(collisions, candidates, mftTracks, getMultiplicity, mixedTPCMFTHfCh); } PROCESS_SWITCH(HfTaskFlow, processMixedTpcMftLcCh, "DATA : Process mixed-event correlations for TPC-MFT Lc-h case", false); From 616ed39a239a28c1857282d3982286262f58c63f Mon Sep 17 00:00:00 2001 From: Ravindra Singh <56298081+1994ra@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:03:14 +0100 Subject: [PATCH 322/459] [PWGHF] PID inclusion for associated particles in Lc correlation (#8892) Co-authored-by: ALICE Action Bot --- PWGHF/HFC/DataModel/CorrelationTables.h | 13 + .../HFC/TableProducer/correlatorLcHadrons.cxx | 130 +++++++-- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 257 ++++++++++++++---- PWGHF/HFC/Utils/utilsCorrelations.h | 70 +++++ 4 files changed, 389 insertions(+), 81 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 3b8e68cdbd8..178e3b30a0c 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -137,6 +137,12 @@ DECLARE_SOA_COLUMN(IsSignal, isSignal, bool); //! U DECLARE_SOA_COLUMN(IsPrompt, isPrompt, bool); //! Used in MC-Rec, Lc Prompt or Non-Prompt DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); //! Used in MC-Rec, primary associated particles DECLARE_SOA_COLUMN(IsAutoCorrelated, isAutoCorrelated, bool); //! Correlation Status +DECLARE_SOA_COLUMN(PrNsigmTPC, prNsigmTPC, float); //! Associated Particle TPC nSigma proton +DECLARE_SOA_COLUMN(KaNsigmTPC, kaNsigmTPC, float); //! Associated Particle TPC nSigma Kaon +DECLARE_SOA_COLUMN(PiNsigmTPC, piNsigmTPC, float); //! Associated Particle TPC nSigma Pion +DECLARE_SOA_COLUMN(PrNsigmTOF, prNsigmTOF, float); //! Associated Particle TOF nSigma Proton +DECLARE_SOA_COLUMN(KaNsigmTOF, kaNsigmTOF, float); //! Associated Particle TOF nSigma Kaon +DECLARE_SOA_COLUMN(PiNsigmTOF, piNsigmTOF, float); //! Associated Particle TOF nSigma Pion } // namespace hf_correlation_lc_hadron DECLARE_SOA_TABLE(LcHadronPair, "AOD", "LCHPAIR", //! Lc-Hadrons pairs Informations @@ -150,6 +156,13 @@ DECLARE_SOA_TABLE(LcHadronPair, "AOD", "LCHPAIR", //! Lc-Hadrons pairs Informati DECLARE_SOA_TABLE(LcHadronRecoInfo, "AOD", "LCHRECOINFO", //! Lc-Hadrons pairs Reconstructed Informations aod::hf_correlation_lc_hadron::MLc, aod::hf_correlation_lc_hadron::SignalStatus); +DECLARE_SOA_TABLE(LcHadronPairTrkPID, "AOD", "LCHPAIRPID", //! Lc-proton details + aod::hf_correlation_lc_hadron::PrNsigmTPC, + aod::hf_correlation_lc_hadron::KaNsigmTPC, + aod::hf_correlation_lc_hadron::PiNsigmTPC, + aod::hf_correlation_lc_hadron::PrNsigmTOF, + aod::hf_correlation_lc_hadron::KaNsigmTOF, + aod::hf_correlation_lc_hadron::PiNsigmTOF); DECLARE_SOA_TABLE(LcHadronGenInfo, "AOD", "LCHGENINFO", //! Lc-Hadrons pairs Generated Information aod::hf_correlation_lc_hadron::IsPrompt, diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index d9ed5d26163..97538f65ebc 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -14,12 +14,14 @@ /// /// \author Marianna Mazzilli /// \author Zhen Zhang +/// \author Ravindra Singh #include #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" +#include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" #include "Common/Core/TrackSelection.h" @@ -157,6 +159,7 @@ struct HfCorrelatorLcHadronsSelection { // Lc-Hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) struct HfCorrelatorLcHadrons { Produces entryLcHadronPair; + Produces entryLcHadronPairTrkPID; Produces entryLcHadronRecoInfo; Produces entryLcHadronMlInfo; Produces entryLcCandRecoInfo; @@ -185,9 +188,17 @@ struct HfCorrelatorLcHadrons { Configurable> efficiencyLc{"efficiencyLc", {1., 1., 1., 1., 1., 1.}, "efficiency values for Lc"}; Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its Lc mother instead of skipping it"}; Configurable correlateLcWithLeadingParticle{"correlateLcWithLeadingParticle", false, "Switch for correlation of Lc baryons with leading particle only"}; + Configurable> trkPIDspecies{"trkPIDspecies", std::vector{o2::track::PID::Proton, o2::track::PID::Pion, o2::track::PID::Kaon}, "Trk sel: Particles species for PID, proton, pion, kaon"}; + Configurable pidTrkApplied{"pidTrkApplied", false, "Apply PID selection for associated tracks"}; + Configurable> pidTPCMax{"pidTPCMax", std::vector{3., 0., 0.}, "maximum nSigma TPC"}; + Configurable> pidTOFMax{"pidTOFMax", std::vector{3., 0., 0.}, "maximum nSigma TOF"}; + Configurable tofPIDThreshold{"tofPIDThreshold", 0.80, "minimum pT after which TOF PID is applicable"}; + Configurable fillTrkPID{"fillTrkPID", false, "fill PID information for associated tracks"}; + Configurable forceTOF{"forceTOF", false, "fill PID information for associated tracks"}; HfHelper hfHelper; SliceCache cache; + Service pdg; int leadingIndex = 0; bool correlationStatus = false; @@ -202,8 +213,8 @@ struct HfCorrelatorLcHadrons { using McCollisionsSel = soa::Filtered>; using McParticlesSel = soa::Filtered; // Tracks used in Data and MC - using TracksData = soa::Filtered>; // trackFilter applied - using TracksWithMc = soa::Filtered>; // trackFilter applied + using TracksData = soa::Filtered>; // trackFilter applied + using TracksWithMc = soa::Filtered>; // trackFilter applied // Filters for ME Filter collisionFilter = aod::hf_selection_lc_collision::lcSel == true; Filter lcFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) != static_cast(0)) && (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc); @@ -338,6 +349,9 @@ struct HfCorrelatorLcHadrons { if (applyEfficiency) { efficiencyWeightLc = 1. / efficiencyLc->at(o2::analysis::findBin(binsPtEfficiencyLc, candidate.pt())); } + auto trackPos1 = candidate.template prong0_as(); // positive daughter (negative for the antiparticles) + int8_t chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate + registry.fill(HIST("hPtCand"), candidate.pt()); registry.fill(HIST("hPtProng0"), candidate.ptProng0()); registry.fill(HIST("hPtProng1"), candidate.ptProng1()); @@ -353,7 +367,7 @@ struct HfCorrelatorLcHadrons { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbLcToPKPi()[classMl->at(iclass)]; } - entryLcCandRecoInfo(hfHelper.invMassLcToPKPi(candidate), candidate.pt(), outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore + entryLcCandRecoInfo(hfHelper.invMassLcToPKPi(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); @@ -362,7 +376,7 @@ struct HfCorrelatorLcHadrons { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbLcToPiKP()[classMl->at(iclass)]; } - entryLcCandRecoInfo(hfHelper.invMassLcToPiKP(candidate), candidate.pt(), outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore + entryLcCandRecoInfo(hfHelper.invMassLcToPiKP(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore } // Lc-Hadron correlation dedicated section @@ -378,6 +392,10 @@ struct HfCorrelatorLcHadrons { if (!track.isGlobalTrackWoDCA()) { continue; } + if (pidTrkApplied) { + if (!passPIDSelection(track, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) + continue; + } if (correlateLcWithLeadingParticle) { if (track.globalIndex() != leadingIndex) { continue; @@ -386,26 +404,32 @@ struct HfCorrelatorLcHadrons { if (candidate.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), - candidate.pt(), - track.pt(), + candidate.pt() * chargeLc, + track.pt() * track.sign(), poolBin, correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), false); entryLcHadronGenInfo(false, false, 0); entryLcHadronMlInfo(outputMl[0], outputMl[1]); entryTrackRecoInfo(track.dcaXY(), track.dcaZ(), track.tpcNClsCrossedRows()); + if (fillTrkPID) { + entryLcHadronPairTrkPID(track.tpcNSigmaPr(), track.tpcNSigmaKa(), track.tpcNSigmaPi(), track.tofNSigmaPr(), track.tofNSigmaKa(), track.tofNSigmaPi()); + } } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), - candidate.pt(), - track.pt(), + candidate.pt() * chargeLc, + track.pt() * track.sign(), poolBin, correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), false); entryLcHadronGenInfo(false, false, 0); entryLcHadronMlInfo(outputMl[0], outputMl[1]); entryTrackRecoInfo(track.dcaXY(), track.dcaZ(), track.tpcNClsCrossedRows()); + if (fillTrkPID) { + entryLcHadronPairTrkPID(track.tpcNSigmaPr(), track.tpcNSigmaKa(), track.tpcNSigmaPi(), track.tofNSigmaPr(), track.tofNSigmaKa(), track.tofNSigmaPi()); + } } if (cntLc == 0) { registry.fill(HIST("hTracksBin"), poolBin); @@ -463,6 +487,8 @@ struct HfCorrelatorLcHadrons { if (applyEfficiency) { efficiencyWeightLc = 1. / efficiencyLc->at(o2::analysis::findBin(binsPtEfficiencyLc, candidate.pt())); } + auto trackPos1 = candidate.template prong0_as(); // positive daughter (negative for the antiparticles) + int8_t chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate isLcSignal = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi); isLcPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; isLcNonPrompt = candidate.originMcRec() == RecoDecay::OriginType::NonPrompt; @@ -492,7 +518,7 @@ struct HfCorrelatorLcHadrons { registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hSelectionStatusLcToPKPiMcRec"), candidate.isSelLcToPKPi()); - entryLcCandRecoInfo(hfHelper.invMassLcToPKPi(candidate), candidate.pt(), outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore + entryLcCandRecoInfo(hfHelper.invMassLcToPKPi(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore entryLcCandGenInfo(isLcPrompt); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { @@ -510,7 +536,7 @@ struct HfCorrelatorLcHadrons { registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc); registry.fill(HIST("hSelectionStatusLcToPiKPMcRec"), candidate.isSelLcToPiKP()); - entryLcCandRecoInfo(hfHelper.invMassLcToPiKP(candidate), candidate.pt(), outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore + entryLcCandRecoInfo(hfHelper.invMassLcToPiKP(candidate), candidate.pt() * chargeLc, outputMl[0], outputMl[1]); // 0: BkgBDTScore, 1:PromptBDTScore entryLcCandGenInfo(isLcPrompt); } } else { @@ -549,6 +575,10 @@ struct HfCorrelatorLcHadrons { if (!track.isGlobalTrackWoDCA()) { continue; } + if (pidTrkApplied) { + if (!passPIDSelection(track, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) + continue; + } // Removing Lc daughters by checking track indices if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { if (!storeAutoCorrelationFlag) { @@ -566,11 +596,14 @@ struct HfCorrelatorLcHadrons { if (candidate.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), - candidate.pt(), - track.pt(), + candidate.pt() * chargeLc, + track.pt() * track.sign(), poolBin, correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), isLcSignal); + if (fillTrkPID) { + entryLcHadronPairTrkPID(track.tpcNSigmaPr(), track.tpcNSigmaKa(), track.tpcNSigmaPi(), track.tofNSigmaPr(), track.tofNSigmaKa(), track.tofNSigmaPi()); + } entryLcHadronMlInfo(outputMl[0], outputMl[1]); if (track.has_mcParticle()) { auto mcParticle = track.template mcParticle_as(); @@ -592,11 +625,14 @@ struct HfCorrelatorLcHadrons { if (candidate.isSelLcToPiKP() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), - candidate.pt(), - track.pt(), + candidate.pt() * chargeLc, + track.pt() * track.sign(), poolBin, correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal); + if (fillTrkPID) { + entryLcHadronPairTrkPID(track.tpcNSigmaPr(), track.tpcNSigmaKa(), track.tpcNSigmaPi(), track.tofNSigmaPr(), track.tofNSigmaKa(), track.tofNSigmaPi()); + } entryLcHadronMlInfo(outputMl[0], outputMl[1]); if (track.has_mcParticle()) { auto mcParticle = track.template mcParticle_as(); @@ -694,9 +730,14 @@ struct HfCorrelatorLcHadrons { } correlationStatus = true; } + if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { continue; } + + if (pidTrkApplied && (std::abs(particleAssoc.pdgCode()) != kProton)) + continue; // proton PID + if (!particleAssoc.isPhysicalPrimary()) { continue; } @@ -707,12 +748,15 @@ struct HfCorrelatorLcHadrons { } } + int8_t chargeLc = pdg->GetParticle(particle.pdgCode())->Charge(); // Retrieve charge + int8_t chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge + int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true); registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); entryLcHadronPair(getDeltaPhi(particleAssoc.phi(), particle.phi()), particleAssoc.eta() - particle.eta(), - particle.pt(), - particleAssoc.pt(), + particle.pt() * chargeLc, + particleAssoc.pt() * chargeAssoc, poolBin, correlationStatus); entryLcHadronRecoInfo(MassLambdaCPlus, true); @@ -737,17 +781,29 @@ struct HfCorrelatorLcHadrons { if (!assocParticle.isGlobalTrackWoDCA() || std::abs(hfHelper.yLc(trigLc)) > yCandMax) { continue; } + + if (pidTrkApplied) { + if (!passPIDSelection(assocParticle, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) + continue; + } + + auto trackPos1 = trigLc.template prong0_as(); // positive daughter (negative for the antiparticles) + int8_t chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate + std::vector outputMl = {-1., -1., -1.}; // LcToPKPi and LcToPiKP division if (trigLc.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(assocParticle.phi(), trigLc.phi()), assocParticle.eta() - trigLc.eta(), - trigLc.pt(), - assocParticle.pt(), + trigLc.pt() * chargeLc, + assocParticle.pt() * assocParticle.sign(), poolBin, correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(trigLc), false); entryLcHadronGenInfo(false, false, 0); + if (fillTrkPID) { + entryLcHadronPairTrkPID(assocParticle.tpcNSigmaPr(), assocParticle.tpcNSigmaKa(), assocParticle.tpcNSigmaPi(), assocParticle.tofNSigmaPr(), assocParticle.tofNSigmaKa(), assocParticle.tofNSigmaPi()); + } for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = trigLc.mlProbLcToPKPi()[classMl->at(iclass)]; } @@ -757,12 +813,15 @@ struct HfCorrelatorLcHadrons { if (trigLc.isSelLcToPiKP() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(assocParticle.phi(), trigLc.phi()), assocParticle.eta() - trigLc.eta(), - trigLc.pt(), - assocParticle.pt(), + trigLc.pt() * chargeLc, + assocParticle.pt() * assocParticle.sign(), poolBin, correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(trigLc), false); entryLcHadronGenInfo(false, false, 0); + if (fillTrkPID) { + entryLcHadronPairTrkPID(assocParticle.tpcNSigmaPr(), assocParticle.tpcNSigmaKa(), assocParticle.tpcNSigmaPi(), assocParticle.tofNSigmaPr(), assocParticle.tofNSigmaKa(), assocParticle.tofNSigmaPi()); + } for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = trigLc.mlProbLcToPiKP()[classMl->at(iclass)]; } @@ -836,6 +895,13 @@ struct HfCorrelatorLcHadrons { int trackOrigin = -1; bool isLcSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi; bool isLcPrompt = candidate.originMcRec() == RecoDecay::OriginType::Prompt; + if (pidTrkApplied) { + if (!passPIDSelection(pAssoc, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF)) + continue; + } + auto trackPos1 = candidate.template prong0_as(); // positive daughter (negative for the antiparticles) + int8_t chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate + if (pAssoc.has_mcParticle()) { auto mcParticle = pAssoc.template mcParticle_as(); isPhysicalPrimary = mcParticle.isPhysicalPrimary(); @@ -846,12 +912,15 @@ struct HfCorrelatorLcHadrons { if (candidate.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(pAssoc.phi(), candidate.phi()), pAssoc.eta() - candidate.eta(), - candidate.pt(), - pAssoc.pt(), + candidate.pt() * chargeLc, + pAssoc.pt() * pAssoc.sign(), poolBin, correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), isLcSignal); entryLcHadronGenInfo(isLcPrompt, isPhysicalPrimary, trackOrigin); + if (fillTrkPID) { + entryLcHadronPairTrkPID(pAssoc.tpcNSigmaPr(), pAssoc.tpcNSigmaKa(), pAssoc.tpcNSigmaPi(), pAssoc.tofNSigmaPr(), pAssoc.tofNSigmaKa(), pAssoc.tofNSigmaPi()); + } for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbLcToPKPi()[classMl->at(iclass)]; } @@ -861,12 +930,15 @@ struct HfCorrelatorLcHadrons { if (candidate.isSelLcToPiKP() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(pAssoc.phi(), candidate.phi()), pAssoc.eta() - candidate.eta(), - candidate.pt(), - pAssoc.pt(), + candidate.pt() * chargeLc, + pAssoc.pt() * pAssoc.sign(), poolBin, correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal); entryLcHadronGenInfo(isLcPrompt, isPhysicalPrimary, trackOrigin); + if (fillTrkPID) { + entryLcHadronPairTrkPID(pAssoc.tpcNSigmaPr(), pAssoc.tpcNSigmaKa(), pAssoc.tpcNSigmaPi(), pAssoc.tofNSigmaPr(), pAssoc.tofNSigmaKa(), pAssoc.tofNSigmaPi()); + } for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMl[iclass] = candidate.mlProbLcToPiKP()[classMl->at(iclass)]; } @@ -903,12 +975,18 @@ struct HfCorrelatorLcHadrons { if (!particleAssoc.isPhysicalPrimary()) { continue; } + if (pidTrkApplied && (std::abs(particleAssoc.pdgCode()) != kProton)) { + continue; // proton PID + } + int8_t chargeLc = pdg->GetParticle(candidate.pdgCode())->Charge(); // Retrieve charge + int8_t chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge + int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true); bool isLcPrompt = candidate.originMcGen() == RecoDecay::OriginType::Prompt; entryLcHadronPair(getDeltaPhi(particleAssoc.phi(), candidate.phi()), particleAssoc.eta() - candidate.eta(), - candidate.pt(), - particleAssoc.pt(), + candidate.pt() * chargeLc, + particleAssoc.pt() * chargeAssoc, poolBin, correlationStatus); entryLcHadronRecoInfo(MassLambdaCPlus, true); diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index 734fa86b484..ede013d1f22 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -39,10 +39,13 @@ using namespace o2::analysis::hf_correlations; // string definitions, used for histogram axis labels const TString stringPtLc = "#it{p}_{T}^{#Lambda_c} (GeV/#it{c});"; const TString stringPtHadron = "#it{p}_{T}^{Hadron} (GeV/#it{c});"; +const TString stringSign = "pairSign;"; +const TString stringMass = "M_{pK#pi} (GeV/#it{c^2});"; const TString stringDeltaEta = "#it{#eta}^{Hadron}-#it{#eta}^{#Lambda_c};"; const TString stringDeltaPhi = "#it{#varphi}^{Hadron}-#it{#varphi}^{#Lambda_c} (rad);"; const TString stringLcHadron = "#Lambda_c,Hadron candidates "; const TString stringSignal = "signal region;"; +const TString stringSignMass = "sign and invMass;"; const TString stringSideband = "sidebands;"; const TString stringMcParticles = "MC gen - #Lambda_c,Hadron particles;"; const TString stringMcReco = "MC reco - #Lambda_c,Hadron candidates "; @@ -110,6 +113,11 @@ struct HfTaskCorrelationLcHadrons { Configurable ptDaughterMin{"ptDaughterMin", 0.1, "min. daughter pT"}; Configurable activateQA{"activateQA", false, "Flag to enable debug histogram"}; Configurable nTpcCrossedRaws{"nTpcCrossedRaws", 70, "Number of crossed TPC Rows"}; + // sign and invMasss + Configurable fillSignAndMass{"fillSignAndMass", false, "flag to select Lc-h corr with Lc invarient mass and sign of pairs"}; + Configurable calSign{"calSign", false, "flag to calculate sign of pairs"}; + Configurable fillSign{"fillSign", false, "flag to fill sign of pairs in ThnSparse"}; + // CCDB configuration Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable associatedEffCcdbPath{"associatedEffCcdbPath", "", "CCDB path for associated efficiency"}; @@ -166,7 +174,7 @@ struct HfTaskCorrelationLcHadrons { AxisSpec axisLcPrompt = {2, -0.5, 1.5, "Prompt #Lambda_c"}; AxisSpec axisBdtScore = {binsBdtScore, "Bdt score"}; AxisSpec axisCorrelationState = {2, 0., 2., ""}; - + AxisSpec axisSignPair = {4, 1., 5.}; // Histograms for data analysis registry.add("hBdtScorePrompt", "Lc BDT prompt score", {HistType::kTH1F, {axisBdtScore}}); registry.add("hBdtScoreBkg", "Lc BDT bkg score", {HistType::kTH1F, {axisBdtScore}}); @@ -176,7 +184,6 @@ struct HfTaskCorrelationLcHadrons { registry.add("hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}); registry.add("hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}); registry.add("hCorrel2DPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}); - registry.add("hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); registry.add("hDeltaEtaPtIntSidebands", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}); registry.add("hDeltaPhiPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}); registry.add("hCorrel2DPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}); @@ -185,18 +192,34 @@ struct HfTaskCorrelationLcHadrons { registry.add("hDeltaPhiPtIntSidebandLeft", stringLcHadron + "Left" + stringSideband + stringDeltaPhi, {HistType::kTH1F, {axisDeltaPhi}}); registry.add("hDeltaEtaPtIntSidebandRight", stringLcHadron + "Right" + stringSideband + stringDeltaEta, {HistType::kTH1F, {axisDeltaEta}}); registry.add("hDeltaPhiPtIntSidebandRight", stringLcHadron + "Right" + stringSideband + stringDeltaPhi, {HistType::kTH1F, {axisDeltaPhi}}); - registry.add("hCorrel2DVsPtSidebandLeft", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); - registry.add("hCorrel2DVsPtSidebandRight", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + if (!fillSign) { + registry.add("hCorrel2DVsPtSidebandLeft", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSidebandRight", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); + registry.get(HIST("hCorrel2DVsPtSidebandLeft"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSidebandRight"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignalRegion"))->Sumw2(); + + } else { + registry.add("hCorrel2DVsPtSignSidebandLeft", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringSign + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignSidebandRight", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringSign + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringSign + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.get(HIST("hCorrel2DVsPtSignSidebandLeft"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignSidebandRight"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignSignalRegion"))->Sumw2(); + } // Toward Transverse Away registry.add("hToward", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); registry.add("hTransverse", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); registry.add("hAway", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); - registry.get(HIST("hCorrel2DVsPtSignalRegion"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtSidebands"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtSidebandLeft"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtSidebandRight"))->Sumw2(); + + if (fillSignAndMass) { + registry.add("hCorrel2DVsPtSignMass", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringSignMass + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisMassLc}, {axisSignPair}, {axisPoolBin}}}); + registry.get(HIST("hCorrel2DVsPtSignMass"))->Sumw2(); + } } // Histograms for MC Reco analysis if (fillHistoMcRec) { @@ -206,34 +229,61 @@ struct HfTaskCorrelationLcHadrons { registry.add("hDeltaPhiPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}); registry.add("hDeltaEtaPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}); registry.add("hCorrel2DPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}); - registry.add("hCorrel2DVsPtSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisLcPrompt}, {axisPoolBin}}}); - registry.add("hCorrel2DVsPtSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); - registry.add("hCorrel2DVsPtBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); registry.add("hDeltaPhiPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}); registry.add("hCorrel2DPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hCorrel2DVsPtSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); registry.add("hCorrel2DVsPtPhysicalPrimaryMcRec", stringLcHadron + "(only true primary particles)" + stringSignal, {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisLcPrompt}, {axisPoolBin}}}); registry.add("hDeltaEtaPtIntSidebandLeftMcRec", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTH1F, {axisDeltaEta}}); registry.add("hDeltaPhiPtIntSidebandLeftMcRec", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTH1F, {axisDeltaPhi}}); - registry.add("hCorrel2DVsPtSidebandLeftMcRec", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); registry.add("hDeltaEtaPtIntSidebandRightMcRec", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTH1F, {axisDeltaEta}}); registry.add("hDeltaPhiPtIntSidebandRightMcRec", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTH1F, {axisDeltaPhi}}); - registry.add("hCorrel2DVsPtSidebandRightMcRec", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); - registry.add("hCorrel2DVsPtSignalRegionPromptLcPromptHadronMcRec", stringLcHadron + "signal region PromptLc - Prompt Track MC reco", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); - registry.add("hCorrel2DVsPtSignalRegionNonPromptLcNonPromptHadronMcRec", stringLcHadron + " signal region PromptLc - NonPrompt Track MC reco", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + + if (!fillSign) { + registry.add("hCorrel2DVsPtSidebandLeftMcRec", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSidebandRightMcRec", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignalRegionPromptLcPromptHadronMcRec", stringLcHadron + "signal region PromptLc - Prompt Track MC reco", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignalRegionNonPromptLcNonPromptHadronMcRec", stringLcHadron + " signal region PromptLc - NonPrompt Track MC reco", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisLcPrompt}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); + + registry.get(HIST("hCorrel2DVsPtSidebandLeftMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSidebandRightMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignalMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignalRegionPromptLcPromptHadronMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignalRegionNonPromptLcNonPromptHadronMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignalRegionMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtBkgMcRec"))->Sumw2(); + + } else { + registry.add("hCorrel2DVsPtSignSidebandLeftMcRec", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringSign + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignSidebandRightMcRec", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringSign + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignSignalRegionPromptLcPromptHadronMcRec", stringLcHadron + "signal region PromptLc - Prompt Track MC reco", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignSignalRegionNonPromptLcNonPromptHadronMcRec", stringLcHadron + " signal region PromptLc - NonPrompt Track MC reco", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringSign + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringSign + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringSign + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + + registry.get(HIST("hCorrel2DVsPtSignSidebandLeftMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignSidebandRightMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignSignalMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignSignalRegionPromptLcPromptHadronMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignSignalRegionNonPromptLcNonPromptHadronMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignSignalRegionMcRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignBkgMcRec"))->Sumw2(); + } + + if (fillSignAndMass) { + registry.add("hCorrel2DVsPtSignMassMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringSignMass + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisMassLc}, {axisSignPair}, {axisPoolBin}}}); + registry.get(HIST("hCorrel2DVsPtSignMassMcRec"))->Sumw2(); + } // Toward Transverse Away for McRec registry.add("hTowardRec", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); registry.add("hTransverseRec", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); registry.add("hAwayRec", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); - registry.get(HIST("hCorrel2DVsPtSignalRegionMcRec"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtSidebandsMcRec"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtSignalMcRec"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtBkgMcRec"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtSidebandLeftMcRec"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtSidebandRightMcRec"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtSignalRegionMcRec"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtPhysicalPrimaryMcRec"))->Sumw2(); } // Histograms for MC Gen analysis @@ -241,20 +291,37 @@ struct HfTaskCorrelationLcHadrons { registry.add("hDeltaEtaPtIntMcGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}); registry.add("hDeltaPhiPtIntMcGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}); registry.add("hCorrel2DPtIntMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}); - registry.add("hCorrel2DVsPtMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); - registry.add("hCorrel2DVsPtMcGenPrompt", stringLcHadron + " Prompt MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); - registry.add("hCorrel2DVsPtMcGenPromptLcPromptHadron", stringLcHadron + "prompt Lc prompt h MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); - registry.add("hCorrel2DVsPtMcGenNonPromptLcNonPromptHadron", stringLcHadron + " non prompt Lc non prompt h MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); - registry.add("hCorrel2DVsPtMcGenNonPrompt", stringLcHadron + " NonPrompt MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + + if (!fillSign) { + registry.add("hCorrel2DVsPtMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtMcGenPrompt", stringLcHadron + " Prompt MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtMcGenPromptLcPromptHadron", stringLcHadron + "prompt Lc prompt h MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtMcGenNonPromptLcNonPromptHadron", stringLcHadron + " non prompt Lc non prompt h MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtMcGenNonPrompt", stringLcHadron + " NonPrompt MC Gen", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}); + + registry.get(HIST("hCorrel2DVsPtMcGenPrompt"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtMcGenPromptLcPromptHadron"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtMcGenNonPromptLcNonPromptHadron"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtMcGenNonPrompt"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtMcGen"))->Sumw2(); + } else { + registry.add("hCorrel2DVsPtSignMcGenPrompt", stringLcHadron + " Prompt MC Gen", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignMcGenPromptLcPromptHadron", stringLcHadron + "prompt Lc prompt h MC Gen", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignMcGenNonPromptLcNonPromptHadron", stringLcHadron + " non prompt Lc non prompt h MC Gen", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignMcGenNonPrompt", stringLcHadron + " NonPrompt MC Gen", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + registry.add("hCorrel2DVsPtSignMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + stringSign + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisSignPair}, {axisPoolBin}}}); + + registry.get(HIST("hCorrel2DVsPtSignMcGenPrompt"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignMcGenPromptLcPromptHadron"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignMcGenNonPromptLcNonPromptHadron"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignMcGenNonPrompt"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignMcGen"))->Sumw2(); + } // Toward Transverse Away for McGen registry.add("hTowardGen", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); registry.add("hTransverseGen", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); registry.add("hAwayGen", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCorrelationState}}}); - - registry.get(HIST("hCorrel2DVsPtMcGen"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtMcGenPrompt"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtMcGenNonPrompt"))->Sumw2(); } // Histograms for efficiencies registry.add("Efficiency/hPtCandMcRecPrompt", stringMcRecoLcPrompt + stringPtLc, {HistType::kTH1F, {axisPtLc}}); @@ -317,7 +384,7 @@ struct HfTaskCorrelationLcHadrons { { for (const auto& candidate : candidates) { float massLc = candidate.mLc(); - float ptLc = candidate.ptLc(); + float ptLc = std::abs(candidate.ptLc()); float bdtScorePrompt = candidate.mlScorePrompt(); float bdtScoreBkg = candidate.mlScoreBkg(); int effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); @@ -347,8 +414,8 @@ struct HfTaskCorrelationLcHadrons { // define variables for widely used quantities float deltaPhi = pairEntry.deltaPhi(); float deltaEta = pairEntry.deltaEta(); - float ptLc = pairEntry.ptLc(); - float ptHadron = pairEntry.ptHadron(); + double ptLc = std::abs(pairEntry.ptLc()); + double ptHadron = std::abs(pairEntry.ptHadron()); float bdtScorePrompt = pairEntry.mlScorePrompt(); float bdtScoreBkg = pairEntry.mlScoreBkg(); float trackDcaXY = pairEntry.trackDcaXY(); @@ -359,9 +426,9 @@ struct HfTaskCorrelationLcHadrons { int effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); bool isAutoCorrelated = pairEntry.isAutoCorrelated(); - - // reject entries outside pT ranges of interest - if (ptLc < binsPtEfficiencyLc->front() || ptLc > binsPtEfficiencyLc->back()) { + int signPair = 0; + // reject entries outside Pt ranges of interest + if (ptBinLc < 0 || effBinLc < 0) { continue; } @@ -371,6 +438,7 @@ struct HfTaskCorrelationLcHadrons { if (trackDcaXY > dcaXYTrackMax || trackDcaZ > dcaZTrackMax || trackTpcCrossedRows < nTpcCrossedRaws) { continue; } + double efficiencyWeight = 1.; if (applyEfficiency) { efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHad->at(o2::analysis::findBin(binsPtEfficiencyHad, ptHadron))); @@ -400,17 +468,32 @@ struct HfTaskCorrelationLcHadrons { } } + if (calSign) { + signPair = signCalulation(pairEntry.ptLc(), pairEntry.ptHadron()); + } + if (fillSignAndMass) { + registry.fill(HIST("hCorrel2DVsPtSignMass"), deltaPhi, deltaEta, ptLc, ptHadron, massLc, signPair, poolBin, efficiencyWeight); + } + // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots if (massLc > signalRegionInner->at(ptBinLc) && massLc < signalRegionOuter->at(ptBinLc)) { // in signal region - registry.fill(HIST("hCorrel2DVsPtSignalRegion"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignSignalRegion"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin, efficiencyWeight); + } else { + registry.fill(HIST("hCorrel2DVsPtSignalRegion"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } registry.fill(HIST("hCorrel2DPtIntSignalRegion"), deltaPhi, deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaEtaPtIntSignalRegion"), deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaPhiPtIntSignalRegion"), deltaPhi, efficiencyWeight); } // in sideband left region if (massLc > sidebandLeftOuter->at(ptBinLc) && massLc < sidebandLeftInner->at(ptBinLc)) { - registry.fill(HIST("hCorrel2DVsPtSidebandLeft"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignSidebandLeft"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin, efficiencyWeight); + } else { + registry.fill(HIST("hCorrel2DVsPtSidebandLeft"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } registry.fill(HIST("hDeltaEtaPtIntSidebandLeft"), deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaPhiPtIntSidebandLeft"), deltaPhi, efficiencyWeight); registry.fill(HIST("hCorrel2DVsPtSidebands"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); @@ -420,7 +503,11 @@ struct HfTaskCorrelationLcHadrons { } // in sideband right region if (massLc > sidebandRightInner->at(ptBinLc) && massLc < sidebandRightOuter->at(ptBinLc)) { - registry.fill(HIST("hCorrel2DVsPtSidebandRight"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignSidebandRight"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin, efficiencyWeight); + } else { + registry.fill(HIST("hCorrel2DVsPtSidebandRight"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } registry.fill(HIST("hDeltaEtaPtIntSidebandRight"), deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaPhiPtIntSidebandRight"), deltaPhi, efficiencyWeight); registry.fill(HIST("hCorrel2DVsPtSidebands"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); @@ -438,7 +525,7 @@ struct HfTaskCorrelationLcHadrons { { for (const auto& candidate : candidates) { float massLc = candidate.mLc(); - float ptLc = candidate.ptLc(); + float ptLc = std::abs(candidate.ptLc()); float bdtScorePrompt = candidate.mlScorePrompt(); float bdtScoreBkg = candidate.mlScoreBkg(); int effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); @@ -481,8 +568,8 @@ struct HfTaskCorrelationLcHadrons { // define variables for widely used quantities float deltaPhi = pairEntry.deltaPhi(); float deltaEta = pairEntry.deltaEta(); - float ptLc = pairEntry.ptLc(); - float ptHadron = pairEntry.ptHadron(); + float ptLc = std::abs(pairEntry.ptLc()); + float ptHadron = std::abs(pairEntry.ptHadron()); float massLc = pairEntry.mLc(); float bdtScorePrompt = pairEntry.mlScorePrompt(); float bdtScoreBkg = pairEntry.mlScoreBkg(); @@ -496,6 +583,7 @@ struct HfTaskCorrelationLcHadrons { int effBinLc = o2::analysis::findBin(binsPtEfficiencyLc, ptLc); int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); bool isAutoCorrelated = pairEntry.isAutoCorrelated(); + int signPair = 0; // reject entries outside pT ranges of interest if (ptLc < binsPtEfficiencyLc->front() || ptLc > binsPtEfficiencyLc->back()) @@ -544,33 +632,64 @@ struct HfTaskCorrelationLcHadrons { } } + if (calSign) { + signPair = signCalulation(pairEntry.ptLc(), pairEntry.ptHadron()); + } + if (fillSignAndMass) { + registry.fill(HIST("hCorrel2DVsPtSignMassMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, massLc, signPair, poolBin, efficiencyWeight); + } + // fill correlation plots for signal/bagkground correlations if (pairEntry.signalStatus()) { - registry.fill(HIST("hCorrel2DVsPtSignalMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignSignalMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin, efficiencyWeight); + } else { + registry.fill(HIST("hCorrel2DVsPtSignalMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } } else { - registry.fill(HIST("hCorrel2DVsPtBkgMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignBkgMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin, efficiencyWeight); + } else { + registry.fill(HIST("hCorrel2DVsPtBkgMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } } // reject entries outside Pt ranges of interest // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots if (massLc > signalRegionInner->at(ptBinLc) && massLc < signalRegionOuter->at(ptBinLc)) { // in signal region - registry.fill(HIST("hCorrel2DVsPtSignalRegionMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, statusLcPrompt, poolBin, efficiencyWeight); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignSignalRegionMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin, efficiencyWeight); + } else { + registry.fill(HIST("hCorrel2DVsPtSignalRegionMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } registry.fill(HIST("hCorrel2DPtIntSignalRegionMcRec"), deltaPhi, deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaEtaPtIntSignalRegionMcRec"), deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaPhiPtIntSignalRegionMcRec"), deltaPhi, efficiencyWeight); if (isPhysicalPrimary) { registry.fill(HIST("hCorrel2DVsPtPhysicalPrimaryMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, statusLcPrompt, poolBin, efficiencyWeight); if (statusLcPrompt == 1 && statusPromptHadron == 1) { - registry.fill(HIST("hCorrel2DVsPtSignalRegionPromptLcPromptHadronMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignSignalRegionPromptLcPromptHadronMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin, efficiencyWeight); + } else { + registry.fill(HIST("hCorrel2DVsPtSignalRegionPromptLcPromptHadronMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } } else if (statusLcPrompt == 0 && statusPromptHadron == 2) { - registry.fill(HIST("hCorrel2DVsPtSignalRegionNonPromptLcNonPromptHadronMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignSignalRegionNonPromptLcNonPromptHadronMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin, efficiencyWeight); + } else { + registry.fill(HIST("hCorrel2DVsPtSignalRegionNonPromptLcNonPromptHadronMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } } } } // in sideband left region if (massLc > sidebandLeftOuter->at(ptBinLc) && massLc < sidebandLeftInner->at(ptBinLc)) { - registry.fill(HIST("hCorrel2DVsPtSidebandLeftMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignSidebandLeftMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin, efficiencyWeight); + } else { + registry.fill(HIST("hCorrel2DVsPtSidebandLeftMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } registry.fill(HIST("hDeltaEtaPtIntSidebandLeftMcRec"), deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaPhiPtIntSidebandLeftMcRec"), deltaPhi, efficiencyWeight); registry.fill(HIST("hCorrel2DVsPtSidebandsMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); @@ -580,7 +699,11 @@ struct HfTaskCorrelationLcHadrons { } // in sideband right region if (massLc > sidebandRightInner->at(ptBinLc) && massLc < sidebandRightOuter->at(ptBinLc)) { - registry.fill(HIST("hCorrel2DVsPtSidebandRightMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignSidebandRightMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin, efficiencyWeight); + } else { + registry.fill(HIST("hCorrel2DVsPtSidebandRightMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } registry.fill(HIST("hDeltaEtaPtIntSidebandRightMcRec"), deltaEta, efficiencyWeight); registry.fill(HIST("hDeltaPhiPtIntSidebandRightMcRec"), deltaPhi, efficiencyWeight); registry.fill(HIST("hCorrel2DVsPtSidebandsMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); @@ -599,12 +722,13 @@ struct HfTaskCorrelationLcHadrons { // define variables for widely used quantities float deltaPhi = pairEntry.deltaPhi(); float deltaEta = pairEntry.deltaEta(); - float ptLc = pairEntry.ptLc(); - float ptHadron = pairEntry.ptHadron(); + float ptLc = std::abs(pairEntry.ptLc()); + float ptHadron = std::abs(pairEntry.ptHadron()); int poolBin = pairEntry.poolBin(); int statusPromptHadron = pairEntry.trackOrigin(); bool isLcPrompt = pairEntry.isPrompt(); bool isAutoCorrelated = pairEntry.isAutoCorrelated(); + int signPair = 0; if (isTowardTransverseAway) { // Divide into three regions: toward, transverse, and away @@ -626,19 +750,42 @@ struct HfTaskCorrelationLcHadrons { break; } } - registry.fill(HIST("hCorrel2DVsPtMcGen"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + if (calSign) { + signPair = signCalulation(pairEntry.ptLc(), pairEntry.ptHadron()); + } + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignMcGen"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin); + } else { + registry.fill(HIST("hCorrel2DVsPtMcGen"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + } registry.fill(HIST("hCorrel2DPtIntMcGen"), deltaPhi, deltaEta); registry.fill(HIST("hDeltaEtaPtIntMcGen"), deltaEta); registry.fill(HIST("hDeltaPhiPtIntMcGen"), deltaPhi); if (isLcPrompt) { - registry.fill(HIST("hCorrel2DVsPtMcGenPrompt"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignMcGenPrompt"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin); + } else { + registry.fill(HIST("hCorrel2DVsPtMcGenPrompt"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + } if (statusPromptHadron == 1) { - registry.fill(HIST("hCorrel2DVsPtMcGenPromptLcPromptHadron"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignMcGenPromptLcPromptHadron"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin); + } else { + registry.fill(HIST("hCorrel2DVsPtMcGenPromptLcPromptHadron"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + } } } else { - registry.fill(HIST("hCorrel2DVsPtMcGenNonPrompt"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignMcGenNonPrompt"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin); + } else { + registry.fill(HIST("hCorrel2DVsPtMcGenNonPrompt"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + } if (statusPromptHadron == 2) { - registry.fill(HIST("hCorrel2DVsPtMcGenNonPromptLcNonPromptHadron"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + if (fillSign) { + registry.fill(HIST("hCorrel2DVsPtSignMcGenNonPromptLcNonPromptHadron"), deltaPhi, deltaEta, ptLc, ptHadron, signPair, poolBin); + } else { + registry.fill(HIST("hCorrel2DVsPtMcGenNonPromptLcNonPromptHadron"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + } } } } // end loop diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 65f447a2b90..20d007b3e29 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -30,6 +30,14 @@ enum Region { Transverse }; +enum PairSign { + SignNotDefined = 0, + LcPosTrkPos, + LcPosTrkNeg, + LcNegTrkPos, + LcNegTrkNeg +}; + template Region getRegion(T const deltaPhi) { @@ -42,6 +50,68 @@ Region getRegion(T const deltaPhi) } } +// Pair Sign Calculation +template +int signCalulation(TrgPt const& trigPt, TrkPt const& assocPt) +{ + int sign = 0; + if (trigPt > 0. && assocPt > 0.) { + sign = LcPosTrkPos; + } else if (trigPt > 0. && assocPt < 0.) { + sign = LcPosTrkNeg; + } else if (trigPt < 0. && assocPt > 0.) { + sign = LcNegTrkPos; + } else if (trigPt < 0. && assocPt < 0.) { + sign = LcNegTrkNeg; + } else { + sign = SignNotDefined; + } + return sign; +} + +template +bool passPIDSelection(Atrack const& track, SpeciesContainer const mPIDspecies, + T1 const maxTPC, T2 const maxTOF, double ptThreshold = 0.75, bool tofForced = false) +{ + // Ensure size consistency + if (mPIDspecies.value.size() != maxTPC.value.size() || mPIDspecies.value.size() != maxTOF.value.size()) { + LOGF(error, "Size of particle species and corresponding nSigma selection arrays should be the same"); + return false; // Early exit on error + } + + for (size_t speciesIndex = 0; speciesIndex < mPIDspecies.value.size(); ++speciesIndex) { + auto const& pid = mPIDspecies->at(speciesIndex); + auto nSigmaTPC = o2::aod::pidutils::tpcNSigma(pid, track); + + if (tofForced && !track.hasTOF()) + return false; + + if (speciesIndex == 0) { // First species logic + if (std::abs(nSigmaTPC) > maxTPC->at(speciesIndex)) { + return false; // TPC check failed + } + if (tofForced || (track.pt() > ptThreshold && track.hasTOF())) { + auto nSigmaTOF = o2::aod::pidutils::tofNSigma(pid, track); + if (std::abs(nSigmaTOF) > maxTOF->at(speciesIndex)) { + return false; // TOF check failed + } + } + } else { // Other species logic + if (std::abs(nSigmaTPC) < maxTPC->at(speciesIndex)) { // Check TPC nSigma first + if (track.hasTOF()) { + auto nSigmaTOF = o2::aod::pidutils::tofNSigma(pid, track); + if (std::abs(nSigmaTOF) < maxTOF->at(speciesIndex)) { + return false; // Reject if both TPC and TOF are within thresholds + } + } else { + return false; // Reject if only TPC is within threshold and TOF is unavailable + } + } + } + } + return true; // Passed all checks +} + // ========= Find Leading Particle ============== template int findLeadingParticle(TTracks const& tracks, T1 const dcaXYTrackMax, T2 const dcaZTrackMax, T3 const etaTrackMax) From b8a571093d3e125cefed0404b2d908c37418a938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 11 Dec 2024 12:18:20 +0100 Subject: [PATCH 323/459] [PWGJE] Fix compilation warnings (#8920) --- PWGJE/Tasks/emcClusterMonitor.cxx | 4 ++-- PWGJE/Tasks/jetChargedV2.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGJE/Tasks/emcClusterMonitor.cxx b/PWGJE/Tasks/emcClusterMonitor.cxx index bbf29d344e7..9db525fe409 100644 --- a/PWGJE/Tasks/emcClusterMonitor.cxx +++ b/PWGJE/Tasks/emcClusterMonitor.cxx @@ -255,8 +255,8 @@ struct ClusterMonitor { mCellTime.push_back(cell.calo().time()); } // end of loop over cells mHistManager.fill(HIST("clusterCellTimeMean"), std::accumulate(mCellTime.begin(), mCellTime.end(), 0.0f) / mCellTime.size()); - for (int iCell1 = 0; iCell1 < mCellTime.size() - 1; iCell1++) { - for (int iCell2 = iCell1 + 1; iCell2 < mCellTime.size(); iCell2++) { + for (std::size_t iCell1 = 0; iCell1 < mCellTime.size() - 1; iCell1++) { + for (std::size_t iCell2 = iCell1 + 1; iCell2 < mCellTime.size(); iCell2++) { mHistManager.fill(HIST("clusterCellTimeDiff"), mCellTime[iCell1] - mCellTime[iCell2]); } } diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index a05c1d80524..dc62692a2b4 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -334,7 +334,7 @@ struct Jetchargedv2Task { void processInOutJetV2(soa::Filtered>::iterator const& collision, soa::Join const& jets, - aod::JetTracks const& tracks) + aod::JetTracks const&) { if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { return; From 00fda505cbf26ec7f6603d30f7b56f9bc4c71072 Mon Sep 17 00:00:00 2001 From: Luca Barioglio Date: Wed, 11 Dec 2024 13:23:05 +0100 Subject: [PATCH 324/459] [DPG] Fix multiple initialisations in histogram registry (#8924) --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index cf381726f50..436ba4b6431 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -338,7 +338,6 @@ struct QaEfficiency { phiMin, phiMax, yMin, yMax); const int histogramIndex = id + pdgSign * nSpecies; - hPtmotherGenerated = histos.add("MC/mother/pt/generated", "Generated pT of mother Lambda or Xi", kTH1D, {axisPt}); // Pt hPtIts[histogramIndex] = histos.add(Form("MC/pdg%i/pt/its", PDGs[histogramIndex]), "ITS tracks " + tagPt, kTH1D, {axisPt}); @@ -664,6 +663,9 @@ struct QaEfficiency { histos.add("MC/occ_cent/reco/neg/its", "ITS Negative ", kTH3D, {axisOcc, axisCent, axisPt}); } + AxisSpec axisPtMother{ptBins, "#it{p}_{T} (GeV/#it{c})"}; + hPtmotherGenerated = histos.add("MC/mother/pt/generated", "Generated pT of mother Lambda or Xi", kTH1D, {axisPtMother}); + static_for<0, 1>([&](auto pdgSign) { makeMCHistograms(doEl); makeMCHistograms(doMu); From eb314d1fb42f946b5f34e6651702a8148323fec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 11 Dec 2024 13:32:31 +0100 Subject: [PATCH 325/459] [PWGCF] Fix compilation warnings (#8916) --- .../Tasks/femtoUniversePairTaskTrackNucleus.cxx | 2 +- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 2 +- PWGCF/Flow/Tasks/FlowRunbyRun.cxx | 2 +- PWGCF/Flow/Tasks/flowSP.cxx | 12 ++++++------ PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx index b9bbf923c88..74b265cd766 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx @@ -497,7 +497,7 @@ struct femtoUniversePairTaskTrackNucleus { /// \param pairType describes charge of correlation pair (plus-plus (1), minus-minus (2), plus-minus (3), minus-plus (4)) /// \param fillQA enables filling of QA histograms template - void doSameEvent(PartitionType groupTrack, PartitionType groupNucleus, PartType parts, float magFieldTesla, int multCol, int pairType, bool fillQA) + void doSameEvent(PartitionType groupTrack, PartitionType groupNucleus, PartType parts, float magFieldTesla, int multCol, int pairType, bool /*fillQA*/) { for (auto& part : groupTrack) { if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron), part.tpcSignal())) { diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index f0f27f675af..c4873eb1246 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -456,7 +456,7 @@ struct ZdcQVectors { } else if (hist->InheritsFrom("TProfile")) { TProfile* h = reinterpret_cast(hist); TString name = h->GetName(); - int bin; + int bin{}; if (name.Contains("mean_vx")) bin = h->GetXaxis()->FindBin(v[0]); if (name.Contains("mean_vy")) diff --git a/PWGCF/Flow/Tasks/FlowRunbyRun.cxx b/PWGCF/Flow/Tasks/FlowRunbyRun.cxx index 60efdf6e24d..4478ca9e0a7 100644 --- a/PWGCF/Flow/Tasks/FlowRunbyRun.cxx +++ b/PWGCF/Flow/Tasks/FlowRunbyRun.cxx @@ -268,7 +268,7 @@ struct FlowRunbyRun { for (auto& track : tracks) { TH1sList[runNumber][hPhi]->Fill(track.phi()); TH1sList[runNumber][hEta]->Fill(track.eta()); - bool WithinPtPOI = (cfgCutPtPOIMin < track.pt()) && (track.pt() < cfgCutPtPOIMax); // within POI pT range + // bool WithinPtPOI = (cfgCutPtPOIMin < track.pt()) && (track.pt() < cfgCutPtPOIMax); // within POI pT range bool WithinPtRef = (cfgCutPtRefMin < track.pt()) && (track.pt() < cfgCutPtRefMax); // within RF pT range if (WithinPtRef) { fGFW->Fill(track.eta(), 1, track.phi(), wacc * weff, 1); diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index 1bf72ba2bd9..e64492dfa06 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -353,12 +353,12 @@ struct FlowSP { auto ux = std::cos(phi); auto uy = std::sin(phi); - auto uxQxA = ux * qxA; - auto uyQyA = uy * qyA; - auto uxyQxyA = uxQxA + uyQyA; - auto uxQxC = ux * qxC; - auto uyQyC = uy * qyC; - auto uxyQxyC = uxQxC + uyQyC; + // auto uxQxA = ux * qxA; + // auto uyQyA = uy * qyA; + // auto uxyQxyA = uxQxA + uyQyA; + // auto uxQxC = ux * qxC; + // auto uyQyC = uy * qyC; + // auto uxyQxyC = uxQxC + uyQyC; auto oddv1 = ux * (qxA - qxC) + uy * (qyA - qyC); auto evenv1 = ux * (qxA + qxC) + uy * (qyA + qyC); diff --git a/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx index 9d7463534bf..49d9a573de9 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx @@ -70,7 +70,7 @@ struct CorrSparse { // fill multiple histograms template - void fillYield(TCollision collision, float centrality, TTracks tracks) // function to fill the yield and etaphi histograms. + void fillYield(TCollision /*collision*/, float /*centrality*/, TTracks tracks) // function to fill the yield and etaphi histograms. { registry.fill(HIST("Nch"), tracks.size()); for (auto const& track1 : tracks) { @@ -83,7 +83,7 @@ struct CorrSparse { } template - bool fillCollision(TCollision collision, float centrality) + bool fillCollision(TCollision collision, float /*centrality*/) { if (!collision.sel8()) { @@ -153,7 +153,7 @@ struct CorrSparse { pair{bindingOnVtxAndMult, 5, -1, &cache}; // indicates that 5 events should be mixed and under/overflow (-1) to be ignored // the process for filling the mixed events - void processMixed(AodCollisions const& collisions, AodTracks const& tracks) + void processMixed(AodCollisions const& /*collisions*/, AodTracks const& /*tracks*/) { for (auto const& [collision1, tracks1, collision2, tracks2] : pair) { From 8cec479c773fbc542df8b85dc314fb4ee1045269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 11 Dec 2024 13:37:41 +0100 Subject: [PATCH 326/459] [PWGLF] Fix compilation warnings (#8921) --- PWGLF/TableProducer/Common/spvector.cxx | 5 ----- .../TableProducer/Nuspex/hypKfTreeCreator.cxx | 2 +- .../Resonances/resonanceInitializer.cxx | 2 +- .../TableProducer/Strangeness/cascadeflow.cxx | 2 +- .../Strangeness/sigma0builder.cxx | 2 +- PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx | 2 +- PWGLF/Tasks/Resonances/lambdav2.cxx | 18 +++++++++--------- .../Tasks/Strangeness/hStrangeCorrelation.cxx | 2 +- 8 files changed, 15 insertions(+), 20 deletions(-) diff --git a/PWGLF/TableProducer/Common/spvector.cxx b/PWGLF/TableProducer/Common/spvector.cxx index a5a3a03d9d1..d3318cd1aa7 100644 --- a/PWGLF/TableProducer/Common/spvector.cxx +++ b/PWGLF/TableProducer/Common/spvector.cxx @@ -432,11 +432,6 @@ struct spvector { qxZDCC = qxZDCC / sumC; qyZDCC = qyZDCC / sumC; } - } else { - qxZDCA = qxZDCA; - qxZDCC = qxZDCC; - qyZDCA = qyZDCA; - qyZDCC = qyZDCC; } if (sumA <= 1e-4 || sumC <= 1e-4) { qxZDCA = 0.0; diff --git a/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx b/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx index bba41fdfeac..948cd62ac92 100644 --- a/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx +++ b/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx @@ -514,7 +514,7 @@ struct hypKfTreeCreator { } //___________________________________________________________________________________________________________________________________________________________ - void fillCandidate(hyperNucleus& cand, hyperNucleus& hypDaughter, aod::HypKfHypNuc const& hypNuc, aod::HypKfHypNucs const&, aod::HypKfColls const&, aod::HypKfTracks const&, aod::HypKfDaughtAdds const&, aod::HypKfSubDs const&) + void fillCandidate(hyperNucleus& cand, hyperNucleus& /*hypDaughter*/, aod::HypKfHypNuc const& hypNuc, aod::HypKfHypNucs const&, aod::HypKfColls const&, aod::HypKfTracks const&, aod::HypKfDaughtAdds const&, aod::HypKfSubDs const&) { cand.daughterTracks.clear(); cand.subDaughterMassVec.clear(); diff --git a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx index 03b0a351b0b..e518efc3986 100644 --- a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx @@ -1042,7 +1042,7 @@ struct ResonanceInitializer { LOGF(info, "Bz set to %f for run: ", dBz, mRunNumber); } - void processDummy(ResoRun2Events const& collisions) + void processDummy(ResoRun2Events const& /*collisions*/) { } PROCESS_SWITCH(ResonanceInitializer, processDummy, "Process for dummy", true); diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index 723bf0a86b7..6f6b8b307a3 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -375,7 +375,7 @@ struct cascadeFlow { if (coll.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) isNoCollInRofStd = 1; // TVX in TRD - bool isTVXinTRD = 0; + // bool isTVXinTRD = 0; // if (coll.alias_bit(kTVXinTRD)) isTVXinTRD = 1; analysisSample(coll.centFT0C(), diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index e6b7d2495a9..bd44e781f5c 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -617,7 +617,7 @@ struct sigma0builder { auto arrMom = std::array{pVecPhotons, pVecLambda}; float SigmaMass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); float SigmapT = RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()}); - float SigmaY = TMath::Abs(RecoDecay::y(std::array{gamma.px() + lambda.px(), gamma.py() + lambda.py(), gamma.pz() + lambda.pz()}, o2::constants::physics::MassSigma0)); + // float SigmaY = TMath::Abs(RecoDecay::y(std::array{gamma.px() + lambda.px(), gamma.py() + lambda.py(), gamma.pz() + lambda.pz()}, o2::constants::physics::MassSigma0)); histos.fill(HIST("h3dMassSigmasBeforeSel"), coll.centFT0C(), SigmapT, SigmaMass); if (!processSigmaCandidate(lambda, gamma)) // applying selection for reconstruction diff --git a/PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx b/PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx index 5f1e68731d3..27f6ed6d5b3 100644 --- a/PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx +++ b/PWGLF/Tasks/Nuspex/he3FromHypertritonMap.cxx @@ -83,7 +83,7 @@ struct he3FromHypertritonMap { registryMC.add("hyperHe4Ptgen", "hyperHe4PtGen", HistType::kTH1F, {{nbin_pt, min_pt, max_pt, "p_{T} (GeV/c)"}}); } - void processMC(aod::McParticles const& mcParticles, const MCTracks& tracks) + void processMC(aod::McParticles const& /*mcParticles*/, const MCTracks& tracks) { for (const auto& track : tracks) { if (!track.has_mcParticle()) { diff --git a/PWGLF/Tasks/Resonances/lambdav2.cxx b/PWGLF/Tasks/Resonances/lambdav2.cxx index 4a43c5d2d4b..ae8c1b6446c 100644 --- a/PWGLF/Tasks/Resonances/lambdav2.cxx +++ b/PWGLF/Tasks/Resonances/lambdav2.cxx @@ -273,7 +273,7 @@ struct lambdav2 { using ResoV0s = aod::V0Datas; // void processData(EventCandidates::iterator const& collision, AllTrackCandidates const&, ResoV0s const& V0s, aod::BCs const&) - void processData(EventCandidates::iterator const& collision, AllTrackCandidates const& tracks, ResoV0s const& V0s, aod::BCs const&) + void processData(EventCandidates::iterator const& collision, AllTrackCandidates const& tracks, ResoV0s const& /*V0s*/, aod::BCs const&) { if (!collision.sel8()) { @@ -303,8 +303,8 @@ struct lambdav2 { auto qxZDCC = collision.qxZDCC(); auto qyZDCA = collision.qyZDCA(); auto qyZDCC = collision.qyZDCC(); - auto psiZDCC = collision.psiZDCC(); - auto psiZDCA = collision.psiZDCA(); + // auto psiZDCC = collision.psiZDCC(); + // auto psiZDCA = collision.psiZDCA(); histos.fill(HIST("hCentrality"), centrality); @@ -350,12 +350,12 @@ struct lambdav2 { auto ux = TMath::Cos(GetPhiInRange(track.phi())); auto uy = TMath::Sin(GetPhiInRange(track.phi())); - auto uxQxp = ux * qxZDCA; - auto uyQyp = uy * qyZDCA; - auto uxyQxyp = uxQxp + uyQyp; - auto uxQxt = ux * qxZDCC; - auto uyQyt = uy * qyZDCC; - auto uxyQxyt = uxQxt + uyQyt; + // auto uxQxp = ux * qxZDCA; + // auto uyQyp = uy * qyZDCA; + // auto uxyQxyp = uxQxp + uyQyp; + // auto uxQxt = ux * qxZDCC; + // auto uyQyt = uy * qyZDCC; + // auto uxyQxyt = uxQxt + uyQyt; auto oddv1 = ux * (qxZDCA - qxZDCC) + uy * (qyZDCA - qyZDCC); auto evenv1 = ux * (qxZDCA + qxZDCC) + uy * (qyZDCA + qyZDCC); diff --git a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx index e1fe312d225..f43dc16f02f 100644 --- a/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx +++ b/PWGLF/Tasks/Strangeness/hStrangeCorrelation.cxx @@ -453,7 +453,7 @@ struct correlateStrangeness { } } - void fillCorrelationsHadron(aod::TriggerTracks const& triggers, aod::AssocHadrons const& assocs, bool mixing, float pvz, float mult, int indexAssoc) + void fillCorrelationsHadron(aod::TriggerTracks const& triggers, aod::AssocHadrons const& assocs, bool mixing, float pvz, float mult, int /*indexAssoc*/) { for (auto& triggerTrack : triggers) { From e3a9e6d02481e596db59bc5d39d99b1947b3ae9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 11 Dec 2024 13:37:56 +0100 Subject: [PATCH 327/459] [PWGLF] Fix compilation warnings (#8922) --- PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx | 4 ++-- PWGMM/UE/Tasks/ue-zdc-analysys.cxx | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx b/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx index a800b3a1002..f1366069de8 100644 --- a/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx +++ b/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx @@ -1115,7 +1115,7 @@ struct PseudorapidityDensityMFT { { float c_gen = -1; bool atLeastOne = false; - int moreThanOne = 0; + // int moreThanOne = 0; for (auto& collision : collisions) { float c_rec = -1; if constexpr (C::template contains()) { @@ -1132,7 +1132,7 @@ struct PseudorapidityDensityMFT { } } atLeastOne = true; - ++moreThanOne; + // ++moreThanOne; auto z = collision.posZ(); if constexpr (C::template contains()) { diff --git a/PWGMM/UE/Tasks/ue-zdc-analysys.cxx b/PWGMM/UE/Tasks/ue-zdc-analysys.cxx index bb05d7d2540..ec5294f7248 100644 --- a/PWGMM/UE/Tasks/ue-zdc-analysys.cxx +++ b/PWGMM/UE/Tasks/ue-zdc-analysys.cxx @@ -355,10 +355,11 @@ struct ZDCAnalysis { float multFDA = 0; float multFDC = 0; if (foundBC.has_fdd()) { - for (auto amplitude : foundBC.fdd().chargeA()) { + auto const& fdd = foundBC.fdd(); + for (auto const& amplitude : fdd.chargeA()) { multFDA += amplitude; } - for (auto amplitude : foundBC.fdd().chargeC()) { + for (auto const& amplitude : fdd.chargeC()) { multFDC += amplitude; } } else { From ea83834c7cb3e2b67e7abcf76a9296c24896c686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 11 Dec 2024 13:48:50 +0100 Subject: [PATCH 328/459] [PWGEM] Fix compilation warnings (#8918) --- PWGEM/Tasks/phosCellQA.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGEM/Tasks/phosCellQA.cxx b/PWGEM/Tasks/phosCellQA.cxx index 271782406c0..710244c1a6d 100644 --- a/PWGEM/Tasks/phosCellQA.cxx +++ b/PWGEM/Tasks/phosCellQA.cxx @@ -130,7 +130,7 @@ struct phosCellQA { if (!cell.bc_as().alias_bit(mEvSelTrig)) continue; - bool isHighGain = cell.cellType(); + // bool isHighGain = cell.cellType(); double energy = calibParams->getGain(cell.cellNumber()) * cell.amplitude(); // if (isHighGain) { // energy = calibParams->getGain(cell.cellNumber()) * cell.amplitude(); From f6457cf2849e435f5e48f2869d8bb798786cfbe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 11 Dec 2024 14:03:40 +0100 Subject: [PATCH 329/459] [PWGUD] Fix compilation warnings (#8923) --- PWGUD/Tasks/fwdMuonsUPC.cxx | 2 +- PWGUD/Tasks/sginclusivePhiKstarSD.cxx | 2 +- PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx | 2 +- PWGUD/Tasks/upcTauCentralBarrelRL.cxx | 26 ++++++++++++------------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/PWGUD/Tasks/fwdMuonsUPC.cxx b/PWGUD/Tasks/fwdMuonsUPC.cxx index de1fde95115..66957899e62 100644 --- a/PWGUD/Tasks/fwdMuonsUPC.cxx +++ b/PWGUD/Tasks/fwdMuonsUPC.cxx @@ -638,7 +638,7 @@ struct fwdMuonsUPC { // function that processes the MC gen candidates: // it applies some kinematics cut and fills the histograms - void processMcGenCand(aod::UDMcCollisions::iterator const& mcCand, + void processMcGenCand(aod::UDMcCollisions::iterator const& /*mcCand*/, aod::UDMcParticles::iterator const& McPart1, aod::UDMcParticles::iterator const& McPart2) { diff --git a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx index 29cab7ee483..bb9c8f051bc 100644 --- a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx +++ b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx @@ -951,7 +951,7 @@ struct SGResonanceAnalyzer { ConfigurableAxis axisVertex{"axisVertex", {10, -10, 10}, "vertex axis for bin"}; ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {10, 0, 100}, "multiplicity percentile for bin"}; using BinningTypeVertexContributor = ColumnBinningPolicy; - void mixprocess(UDCollisionsFull1 const& collisions, udtracksfull const& track) + void mixprocess(UDCollisionsFull1 const& collisions, udtracksfull const& /*track*/) { TLorentzVector v0; TLorentzVector v1; diff --git a/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx b/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx index 81eb002a13a..fed6937f561 100644 --- a/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx +++ b/PWGUD/Tasks/upcJpsiCentralBarrelCorr.cxx @@ -2231,7 +2231,7 @@ struct UpcJpsiCentralBarrel { processMC(mcCollision, mcParticles); } - void processMCUnskimmed(aod::McCollision const& mcCollision, soa::SmallGroups> const& collisions /*, aod::McParticles const& mcParticles, aod::TracksIU const& tracks*/) + void processMCUnskimmed(aod::McCollision const&, soa::SmallGroups> const& collisions /*, aod::McParticles const& mcParticles, aod::TracksIU const& tracks*/) { processMCU(collisions); } diff --git a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx index 819301ea6a1..9bb0e7a16db 100644 --- a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx +++ b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx @@ -149,7 +149,7 @@ struct UpcTauCentralBarrelRL { ConfigurableAxis axisFITtime{"axisFITtime", {201, -40.5, 40.5}, "FIT time in ns"}; ConfigurableAxis axisFITamplitude{"axisFITamplitude", {1000, 0., 1000.}, "FIT amplitude"}; - AxisSpec axisChannels{CH_ENUM_COUNTER, -0.5, CH_ENUM_COUNTER - 0.5, "Channels (-)"}; + AxisSpec axisChannels{CH_ENUM_COUNTER, -0.5, +CH_ENUM_COUNTER - 0.5, "Channels (-)"}; } confAxis; using FullUDTracks = soa::Join; @@ -2301,21 +2301,21 @@ struct UpcTauCentralBarrelRL { } // end processMCgenDG - void processTestMC(FullMCUDCollision const& reconstructedCollision, - FullMCUDTracks const& reconstructedBarrelTracks, + void processTestMC(FullMCUDCollision const& /*reconstructedCollision*/, + FullMCUDTracks const& /*reconstructedBarrelTracks*/, aod::UDMcCollisions const&, aod::UDMcParticles const&) { - if (reconstructedCollision.has_udMcCollision()) { - const auto& generatedCollision = reconstructedCollision.udMcCollision(); - printDebugMessage(Form("%lli udMcCollision found", generatedCollision.size())); - } - - const auto& track = reconstructedBarrelTracks.iteratorAt(0); - if (track.size() && track.has_udMcParticle()) { - const auto& particle = track.udMcParticle(); - printDebugMessage(Form("%lli udMcParticle found", particle.size())); - } + // if (reconstructedCollision.has_udMcCollision()) { + // const auto& generatedCollision = reconstructedCollision.udMcCollision(); + // printDebugMessage(Form("%lli udMcCollision found", generatedCollision.size())); // FIXME: Type of size() is not invariant. + // } + + // const auto& track = reconstructedBarrelTracks.iteratorAt(0); + // if (track.size() && track.has_udMcParticle()) { + // const auto& particle = track.udMcParticle(); + // printDebugMessage(Form("%lli udMcParticle found", particle.size())); // FIXME: Type of size() is not invariant. + // } } // end processTestMC From 9661626c4864bef0dc18b93a55ccc85a47fa486d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 11 Dec 2024 14:17:25 +0100 Subject: [PATCH 330/459] [PWGDQ] Fix compilation warnings (#8917) --- PWGDQ/Core/MCSignal.cxx | 12 ++++++------ PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 2 +- PWGDQ/Tasks/dqEfficiency.cxx | 2 +- PWGDQ/Tasks/tableReader.cxx | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/PWGDQ/Core/MCSignal.cxx b/PWGDQ/Core/MCSignal.cxx index bf08b1fab4e..7a234b65088 100644 --- a/PWGDQ/Core/MCSignal.cxx +++ b/PWGDQ/Core/MCSignal.cxx @@ -25,10 +25,10 @@ MCSignal::MCSignal() : TNamed("", ""), fNProngs(0), fCommonAncestorIdxs({}), fExcludeCommonAncestor(false), - fTempAncestorLabel(-1), fDecayChannelIsExclusive(false), fDecayChannelIsNotExclusive(false), - fNAncestorDirectProngs(0) + fNAncestorDirectProngs(0), + fTempAncestorLabel(-1) { } @@ -38,10 +38,10 @@ MCSignal::MCSignal(int nProngs, const char* name /*= ""*/, const char* title /*= fNProngs(nProngs), fCommonAncestorIdxs({}), fExcludeCommonAncestor(false), - fTempAncestorLabel(-1), fDecayChannelIsExclusive(false), fDecayChannelIsNotExclusive(false), - fNAncestorDirectProngs(0) + fNAncestorDirectProngs(0), + fTempAncestorLabel(-1) { fProngs.reserve(nProngs); } @@ -52,10 +52,10 @@ MCSignal::MCSignal(const char* name, const char* title, std::vector pro fNProngs(prongs.size()), fCommonAncestorIdxs(commonAncestors), fExcludeCommonAncestor(excludeCommonAncestor), - fTempAncestorLabel(-1), fDecayChannelIsExclusive(false), fDecayChannelIsNotExclusive(false), - fNAncestorDirectProngs(0) + fNAncestorDirectProngs(0), + fTempAncestorLabel(-1) { } diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 016d066087b..295fd1168cd 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -703,7 +703,7 @@ struct TableMaker { } template - void skimCollisions(TEvents const& collisions, TBCs const& bcs, TZdcs const& /*zdcs*/, + void skimCollisions(TEvents const& collisions, TBCs const& /*bcs*/, TZdcs const& /*zdcs*/, TTrackAssoc const& trackAssocs, TTracks const& tracks) { // Skim collisions diff --git a/PWGDQ/Tasks/dqEfficiency.cxx b/PWGDQ/Tasks/dqEfficiency.cxx index e978fbf4bff..f8f2a992d61 100644 --- a/PWGDQ/Tasks/dqEfficiency.cxx +++ b/PWGDQ/Tasks/dqEfficiency.cxx @@ -1393,7 +1393,7 @@ struct AnalysisDileptonTrackTrack { if (!context.mOptions.get("processDummy")) { // Title_DileptonTrackTrackCutName if (!configQuadruletCutNamesStr.IsNull()) { - for (Int_t icut = 0; icut < fQuadrupletCutNames.size(); ++icut) { + for (std::size_t icut = 0; icut < fQuadrupletCutNames.size(); ++icut) { if (fIsSameTrackCut) { histNames += Form("QuadrupletSEPM_%s;", fQuadrupletCutNames[icut].Data()); } else { diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index 6b58f40d58a..8ed3cd6eeef 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -1887,7 +1887,7 @@ struct AnalysisDileptonTrackTrack { if (!context.mOptions.get("processDummy")) { DefineHistograms(fHistMan, Form("Dileptons_%s", configDileptonCutNamesStr.Data()), fConfigAddDileptonHistogram); if (!configQuadruletCutNamesStr.IsNull()) { - for (Int_t icut = 0; icut < fQuadrupletCutNames.size(); ++icut) { + for (std::size_t icut = 0; icut < fQuadrupletCutNames.size(); ++icut) { if (fIsSameTrackCut) { DefineHistograms(fHistMan, Form("QuadrupletSEPM_%s", fQuadrupletCutNames[icut].Data()), fConfigAddQuadrupletHistogram); } else { From 2a2a76329eed1170e36b20ec8cf189e6a569ec03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 11 Dec 2024 14:17:44 +0100 Subject: [PATCH 331/459] [Common] Fix compilation warnings (#8914) --- Common/Core/RecoDecay.h | 4 ++-- Common/TableProducer/match-mft-mch-data.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/Core/RecoDecay.h b/Common/Core/RecoDecay.h index 5cbb4bbae7e..94ff6f12664 100644 --- a/Common/Core/RecoDecay.h +++ b/Common/Core/RecoDecay.h @@ -1077,7 +1077,7 @@ struct RecoDecay { auto mother = particlesMC.rawIteratorAt(particleMother.mothersIds().front() - particlesMC.offset()); auto PDGParticleIMother = std::abs(mother.pdgCode()); // PDG code of the mother if (PDGParticleIMother < 9 || (PDGParticleIMother > 20 && PDGParticleIMother < 38)) { - auto PDGPaticle = std::abs(particleMother.pdgCode()); + // auto PDGPaticle = std::abs(particleMother.pdgCode()); if ( (PDGParticleIMother / 100 == 5 || // b mesons PDGParticleIMother / 1000 == 5) // b baryons @@ -1100,7 +1100,7 @@ struct RecoDecay { } auto mother = particlesMC.rawIteratorAt(iMother - particlesMC.offset()); // Check status code - auto motherStatusCode = std::abs(mother.getGenStatusCode()); + // auto motherStatusCode = std::abs(mother.getGenStatusCode()); auto PDGParticleIMother = std::abs(mother.pdgCode()); // PDG code of the mother // Check mother's PDG code. // printf("getMother: "); diff --git a/Common/TableProducer/match-mft-mch-data.cxx b/Common/TableProducer/match-mft-mch-data.cxx index d87504ccfef..c151c74ba4d 100644 --- a/Common/TableProducer/match-mft-mch-data.cxx +++ b/Common/TableProducer/match-mft-mch-data.cxx @@ -566,7 +566,7 @@ struct match_mft_mch_data { return true; } - void process(aod::Collisions const& collisions, ExtBCs const& ebcs, + void process(aod::Collisions const&, ExtBCs const& ebcs, MyMuons const& fwdtracks, MyMFTs const& mfttracks) { initCCDB(ebcs.begin()); From 73c73de55ab7ef13afa8d3b59eb2ee2cdb626e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 11 Dec 2024 14:41:29 +0100 Subject: [PATCH 332/459] [DPG] Fix compilation warnings (#8915) --- DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx | 2 +- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 4 ++-- DPG/Tasks/AOTTrack/qaEventTrack.cxx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx index bc80df4b71a..837435a038e 100644 --- a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx +++ b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx @@ -171,7 +171,7 @@ struct tpcPidQaSignal { return false; } histos.fill(HIST("trksel"), 6); - if (pidInTracking != -1 && (track.pidForTracking() != std::abs(pidInTracking))) { + if (pidInTracking != -1 && (track.pidForTracking() != static_cast(std::abs(pidInTracking)))) { return false; } histos.fill(HIST("trksel"), 7); diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 436ba4b6431..991266fe14b 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -2073,8 +2073,8 @@ struct QaEfficiency { float trackEta = track.eta(); float trackPhi = track.phi(); float trackSign = track.sign(); - float occupancy; - float centrality; + float occupancy{}; + float centrality{}; if (doOccupancy) { centrality = collision.centFT0C(); if (useFT0OccEstimator) { diff --git a/DPG/Tasks/AOTTrack/qaEventTrack.cxx b/DPG/Tasks/AOTTrack/qaEventTrack.cxx index bfd106f4b8b..ffb64e1f9c2 100644 --- a/DPG/Tasks/AOTTrack/qaEventTrack.cxx +++ b/DPG/Tasks/AOTTrack/qaEventTrack.cxx @@ -1618,7 +1618,7 @@ void qaEventTrack::fillRecoHistogramsGroupedTracks(const C& collision, const T& sign = pdgInfo->Charge() / abs(pdgInfo->Charge()); } // resolution plots - if (doExtraPIDqa && track.pidForTracking() != std::abs(PartIdentifier)) { + if (doExtraPIDqa && track.pidForTracking() != static_cast(std::abs(PartIdentifier))) { // full eta range histos.fill(HIST("Tracks/Kine/resoPtVsptmcWrongPIDinTrk"), track.pt() - particle.pt(), particle.pt()); histos.fill(HIST("Tracks/Kine/resoPtVsptmcScaledWrongPIDinTrk"), (track.pt() - particle.pt()) / particle.pt(), particle.pt()); @@ -1651,7 +1651,7 @@ void qaEventTrack::fillRecoHistogramsGroupedTracks(const C& collision, const T& } // optionally check for PID in tracking: select tracks with correct PID in tracking - if (checkPIDforTracking && track.pidForTracking() != std::abs(PartIdentifier)) { + if (checkPIDforTracking && track.pidForTracking() != static_cast(std::abs(PartIdentifier))) { continue; } From bb163192dbb6ade388974b2992d165eed2084467 Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Wed, 11 Dec 2024 15:01:31 +0100 Subject: [PATCH 333/459] [PWGLF] initial commit for v0v0 reconstruction (#8929) Co-authored-by: junleekim Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Strangeness/CMakeLists.txt | 5 + PWGLF/Tasks/Strangeness/lambdalambda.cxx | 496 +++++++++++++++++++++++ 2 files changed, 501 insertions(+) create mode 100644 PWGLF/Tasks/Strangeness/lambdalambda.cxx diff --git a/PWGLF/Tasks/Strangeness/CMakeLists.txt b/PWGLF/Tasks/Strangeness/CMakeLists.txt index bdc6624af49..839b94a14fd 100644 --- a/PWGLF/Tasks/Strangeness/CMakeLists.txt +++ b/PWGLF/Tasks/Strangeness/CMakeLists.txt @@ -123,3 +123,8 @@ o2physics_add_dpl_workflow(lambdak0sflattenicity SOURCES lambdak0sflattenicity.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(lambdalambda + SOURCES lambdalambda.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/Strangeness/lambdalambda.cxx b/PWGLF/Tasks/Strangeness/lambdalambda.cxx new file mode 100644 index 00000000000..320b98db6d1 --- /dev/null +++ b/PWGLF/Tasks/Strangeness/lambdalambda.cxx @@ -0,0 +1,496 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \author Junlee Kim (jikim1290@gmail.com) + +#include +#include +#include +#include +#include +#include + +#include "TLorentzVector.h" +#include "TRandom3.h" +#include "TF1.h" +#include "TVector3.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "Math/GenVector/Boost.h" +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/StaticFor.h" + +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" + +#include "Common/Core/trackUtilities.h" +#include "Common/Core/TrackSelection.h" + +#include "CommonConstants/PhysicsConstants.h" + +#include "ReconstructionDataFormats/Track.h" + +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" + +#include "CCDB/CcdbApi.h" +#include "CCDB/BasicCCDBManager.h" + +#include "PWGLF/DataModel/LFStrangenessTables.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; +using namespace o2::constants::physics; + +struct lambdalambda { + using EventCandidates = soa::Join; + using TrackCandidates = soa::Join; + using V0TrackCandidate = aod::V0Datas; + + HistogramRegistry histos{ + "histos", + {}, + OutputObjHandlingPolicy::AnalysisObject}; + + struct : ConfigurableGroup { + Configurable cfgURL{"cfgURL", + "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; + Configurable nolaterthan{"ccdb-no-later-than", + std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), + "Latest acceptable timestamp of creation for the object"}; + } cfgCcdbParam; + Service ccdb; + o2::ccdb::CcdbApi ccdbApi; + + Configurable cfgCentSel{"cfgCentSel", 100., "Centrality selection"}; + Configurable cfgCentEst{"cfgCentEst", 1, "Centrality estimator, 1: FT0C, 2: FT0M"}; + + Configurable cfgPVSel{"cfgPVSel", false, "Additional PV selection flag for syst"}; + Configurable cfgPV{"cfgPV", 8.0, "Additional PV selection range for syst"}; + Configurable cfgAddEvtSelPileup{"cfgAddEvtSelPileup", false, "flag for additional pileup selection"}; + Configurable cfgMaxOccupancy{"cfgMaxOccupancy", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + Configurable cfgMinOccupancy{"cfgMinOccupancy", 0, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + + Configurable cfgv0radiusMin{"cfgv0radiusMin", 1.2, "minimum decay radius"}; + Configurable cfgDCAPosToPVMin{"cfgDCAPosToPVMin", 0.05, "minimum DCA to PV for positive track"}; + Configurable cfgDCANegToPVMin{"cfgDCANegToPVMin", 0.2, "minimum DCA to PV for negative track"}; + Configurable cfgv0CosPA{"cfgv0CosPA", 0.995, "minimum v0 cosine"}; + Configurable cfgDCAV0Dau{"cfgDCAV0Dau", 1.0, "maximum DCA between daughters"}; + + Configurable cfgV0PtMin{"cfgV0PtMin", 0, "minimum pT for lambda"}; + Configurable cfgV0EtaMin{"cfgV0EtaMin", -0.5, "maximum rapidity"}; + Configurable cfgV0EtaMax{"cfgV0EtaMax", 0.5, "maximum rapidity"}; + Configurable cfgV0LifeTime{"cfgV0LifeTime", 30., "maximum lambda lifetime"}; + + Configurable cfgQAv0{"cfgQAv0", false, "QA plot"}; + + Configurable cfgDaughTPCnclsMin{"cfgDaughTPCnclsMin", 70, "minimum fired crossed rows"}; + Configurable cfgDaughPIDCutsTPCPr{"cfgDaughPIDCutsTPCPr", 5, "proton nsigma for TPC"}; + Configurable cfgDaughPIDCutsTPCPi{"cfgDaughPIDCutsTPCPi", 5, "pion nsigma for TPC"}; + Configurable cfgDaughEtaMin{"cfgDaughEtaMin", -0.8, "minimum daughter eta"}; + Configurable cfgDaughEtaMax{"cfgDaughEtaMax", 0.8, "maximum daughter eta"}; + Configurable cfgDaughPrPt{"cfgDaughPrPt", 0.5, "minimum daughter proton pt"}; + Configurable cfgDaughPiPt{"cfgDaughPiPt", 0.5, "minimum daughter pion pt"}; + + Configurable cfgHypMassWindow{"cfgHypMassWindow", 0.02, "single lambda mass selection"}; + Configurable cfgV0V0RapMax{"cfgV0V0RapMax", 0.5, "rapidity selection for V0V0"}; + + Configurable cfgV0V0Sel{"cfgV0V0Sel", false, "application of V0V0 selections"}; + Configurable cfgV0V0Radius{"cfgV0V0Radius", 1.0, "maximum radius of v0v0"}; + Configurable cfgV0V0CPA{"cfgV0V0CPA", 0.6, "minimum CPA of v0v0"}; + Configurable cfgV0V0Distance{"cfgV0V0Distance", 1, "minimum distance of v0v0"}; + Configurable cfgV0V0DCA{"cfgV0V0DCA", 1.0, "maximum DCA of v0v0"}; + + Configurable cfgEffCor{"cfgEffCor", false, "flag to apply efficiency correction"}; + Configurable cfgEffCorPath{"cfgEffCorPath", "", "path for pseudo efficiency correction"}; + + Configurable cfgNoMixedEvents{"cfgNoMixedEvents", 5, "Number of mixed events per event"}; + + ConfigurableAxis massAxis{"massAxis", {110, 2.22, 2.33}, "Invariant mass axis"}; + ConfigurableAxis ptAxis{"ptAxis", {VARIABLE_WIDTH, 0.2, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.5, 8.0, 10.0, 100.0}, "Transverse momentum bins"}; + ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 100}, "Centrality interval"}; + ConfigurableAxis vertexAxis{"vertexAxis", {10, -10, 10}, "vertex axis for mixing"}; + + ConfigurableAxis RadiusAxis{"RadiusAxis", {100, 0, 5}, "radius of v0v0"}; + ConfigurableAxis CPAAxis{"CPAAxis", {102, -1.02, 1.02}, "CPA of v0v0"}; + ConfigurableAxis DistanceAxis{"DistanceAxis", {100, 0, 10}, "distance of v0v0"}; + ConfigurableAxis DCAAxis{"DCAAxis", {100, 0, 5}, "DCA of v0v0"}; + + TF1* fMultPVCutLow = nullptr; + TF1* fMultPVCutHigh = nullptr; + + float centrality; + TProfile2D* EffMap = nullptr; + + void init(o2::framework::InitContext&) + { + AxisSpec centQaAxis = {80, 0.0, 80.0}; + AxisSpec PVzQaAxis = {300, -15.0, 15.0}; + AxisSpec combAxis = {3, -0.5, 2.5}; + + histos.add("Radius_V0V0_full", "", {HistType::kTH3F, {massAxis, ptAxis, RadiusAxis}}); + histos.add("CPA_V0V0_full", "", {HistType::kTH3F, {massAxis, ptAxis, CPAAxis}}); + histos.add("Distance_V0V0_full", "", {HistType::kTH3F, {massAxis, ptAxis, DistanceAxis}}); + histos.add("DCA_V0V0_full", "", {HistType::kTH3F, {massAxis, ptAxis, DCAAxis}}); + + histos.add("Radius_V0V0_sel", "", {HistType::kTH3F, {massAxis, ptAxis, RadiusAxis}}); + histos.add("CPA_V0V0_sel", "", {HistType::kTH3F, {massAxis, ptAxis, CPAAxis}}); + histos.add("Distance_V0V0_sel", "", {HistType::kTH3F, {massAxis, ptAxis, DistanceAxis}}); + histos.add("DCA_V0V0_sel", "", {HistType::kTH3F, {massAxis, ptAxis, DCAAxis}}); + + histos.add("h_InvMass_same", "", {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, combAxis}}); + histos.add("h_InvMass_mixed", "", {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, combAxis}}); + if (cfgQAv0) { + histos.add("QA/CentDist", "", {HistType::kTH1F, {centQaAxis}}); + histos.add("QA/PVzDist", "", {HistType::kTH1F, {PVzQaAxis}}); + } + + fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); + fMultPVCutLow->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); + fMultPVCutHigh = new TF1("fMultPVCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); + fMultPVCutHigh->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); + + ccdb->setURL(cfgCcdbParam.cfgURL); + ccdbApi.init("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + } + + double massLambda = o2::constants::physics::MassLambda; + ROOT::Math::PxPyPzMVector RecoV01, RecoV02, RecoV0V0; + + template + bool eventSelected(TCollision collision) + { + if (!collision.sel8()) { + return 0; + } + + if (cfgCentSel < centrality) { + return 0; + } + /* + auto multNTracksPV = collision.multNTracksPV(); + if (multNTracksPV < fMultPVCutLow->Eval(centrality)) { + return 0; + } + if (multNTracksPV > fMultPVCutHigh->Eval(centrality)) { + return 0; + } + */ + if (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + return 0; + } + if (!collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { + return 0; + } + if (cfgPVSel && std::abs(collision.posZ()) > cfgPV) { + return 0; + } + if (cfgAddEvtSelPileup && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + return 0; + } + if (collision.trackOccupancyInTimeRange() > cfgMaxOccupancy || collision.trackOccupancyInTimeRange() < cfgMinOccupancy) { + return 0; + } + + return 1; + } // event selection + + template + bool SelectionV0(TCollision const& collision, V0 const& candidate) + { + if (candidate.v0radius() < cfgv0radiusMin) + return false; + if (std::abs(candidate.dcapostopv()) < cfgDCAPosToPVMin) + return false; + if (std::abs(candidate.dcanegtopv()) < cfgDCANegToPVMin) + return false; + if (candidate.v0cosPA() < cfgv0CosPA) + return false; + if (std::abs(candidate.dcaV0daughters()) > cfgDCAV0Dau) + return false; + if (candidate.pt() < cfgV0PtMin) + return false; + if (candidate.yLambda() < cfgV0EtaMin) + return false; + if (candidate.yLambda() > cfgV0EtaMax) + return false; + if (candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda > cfgV0LifeTime) + return false; + + return true; + } + + template + bool isSelectedV0Daughter(T const& track, int pid) // pid 0: proton, pid 1: pion + { + if (track.tpcNClsFound() < cfgDaughTPCnclsMin) + return false; + if (pid == 0 && std::abs(track.tpcNSigmaPr()) > cfgDaughPIDCutsTPCPr) + return false; + if (pid == 1 && std::abs(track.tpcNSigmaPi()) > cfgDaughPIDCutsTPCPi) + return false; + if (track.eta() > cfgDaughEtaMax) + return false; + if (track.eta() < cfgDaughEtaMin) + return false; + if (pid == 0 && track.pt() < cfgDaughPrPt) + return false; + if (pid == 1 && track.pt() < cfgDaughPiPt) + return false; + + return true; + } + + template + bool isSelectedV0V0(V01 const& v01, V02 const& v02) + { + if (getDCAofV0V0(v01, v02) > cfgV0V0DCA) + return false; + if (getCPA(v01, v02) < cfgV0V0CPA) + return false; + if (getDistance(v01, v02) < cfgV0V0Distance) + return false; + if (getRadius(v01, v02) > cfgV0V0Radius) + return false; + + return true; + } + + template + float getDCAofV0V0(V01 const& v01, V02 const& v02) + { + ROOT::Math::XYZVector v01pos, v02pos, v01mom, v02mom; + v01pos.SetXYZ(v01.x(), v01.y(), v01.z()); + v02pos.SetXYZ(v02.x(), v02.y(), v02.z()); + v01mom.SetXYZ(v01.px(), v01.py(), v01.pz()); + v02mom.SetXYZ(v02.px(), v02.py(), v02.pz()); + + ROOT::Math::XYZVector posdiff = v02pos - v01pos; + ROOT::Math::XYZVector cross = v01mom.Cross(v02mom); + if (std::sqrt(cross.Mag2()) < 1e-6) + return 999.; + return std::abs(posdiff.Dot(cross)) / std::sqrt(cross.Mag2()); + } + + template + float getCPA(V01 const& v01, V02 const& v02) + { + ROOT::Math::XYZVector v01mom, v02mom; + v01mom.SetXYZ(v01.px(), v01.py(), v01.pz()); + v02mom.SetXYZ(v02.px(), v02.py(), v02.pz()); + return v01mom.Dot(v02mom); + } + + template + float getDistance(V01 const& v01, V02 const& v02) + { + ROOT::Math::XYZVector v01pos, v02pos; + v01pos.SetXYZ(v01.x(), v01.y(), v01.z()); + v02pos.SetXYZ(v02.x(), v02.y(), v02.z()); + ROOT::Math::XYZVector posdiff = v02pos - v01pos; + return std::sqrt(posdiff.Mag2()); + } + + template + float getRadius(V01 const& v01, V02 const& v02) + { + ROOT::Math::XYZVector v01pos, v02pos, v01mom, v02mom; + v01pos.SetXYZ(v01.x(), v01.y(), v01.z()); + v02pos.SetXYZ(v02.x(), v02.y(), v02.z()); + v01mom.SetXYZ(v01.px() / v01.p(), v01.py() / v01.p(), v01.pz() / v01.p()); + v02mom.SetXYZ(v02.px() / v02.p(), v02.py() / v02.p(), v02.pz() / v02.p()); + ROOT::Math::XYZVector posdiff = v02pos - v01pos; + + float d = 1. - TMath::Power(v01mom.Dot(v02mom), 2); + if (d < 1e-5) + return 999; + float t = posdiff.Dot(v01mom - v01mom.Dot(v02mom) * v02mom) / d; + float s = -posdiff.Dot(v02mom - v01mom.Dot(v02mom) * v01mom) / d; + ROOT::Math::XYZVector dca = v01pos + v02pos + t * v01mom + s * v02mom; + dca /= 2.; + return std::sqrt(dca.Mag2()); + } + + template + void FillHistograms(C1 const& c1, C2 const& c2, V01 const& V01s, V02 const& V02s) + { + for (auto& v01 : V01s) { + auto postrack_v01 = v01.template posTrack_as(); + auto negtrack_v01 = v01.template negTrack_as(); + + int LambdaTag = 0; + int aLambdaTag = 0; + int V01Tag = -2; + + if (isSelectedV0Daughter(postrack_v01, 0) && isSelectedV0Daughter(negtrack_v01, 1)) { + LambdaTag = 1; + V01Tag = 0; + } + if (isSelectedV0Daughter(negtrack_v01, 0) && isSelectedV0Daughter(postrack_v01, 1)) { + aLambdaTag = 1; + V01Tag = 1; + } + + if (LambdaTag == aLambdaTag) + continue; + + if (!SelectionV0(c1, v01)) + continue; + + if (LambdaTag) { + if (std::abs(massLambda - v01.mLambda()) > cfgHypMassWindow) + continue; + RecoV01 = ROOT::Math::PxPyPzMVector(v01.px(), v01.py(), v01.pz(), v01.mLambda()); + } else if (aLambdaTag) { + if (std::abs(massLambda - v01.mAntiLambda()) > cfgHypMassWindow) + continue; + RecoV01 = ROOT::Math::PxPyPzMVector(v01.px(), v01.py(), v01.pz(), v01.mAntiLambda()); + } + + for (auto& v02 : V02s) { + if (v01.v0Id() <= v02.v0Id() && doprocessDataSame) + continue; + auto postrack_v02 = v02.template posTrack_as(); + auto negtrack_v02 = v02.template negTrack_as(); + + LambdaTag = 0; + aLambdaTag = 0; + int V02Tag = -2; + + if (isSelectedV0Daughter(postrack_v02, 0) && isSelectedV0Daughter(negtrack_v02, 1)) { + LambdaTag = 1; + V02Tag = 0; + } + if (isSelectedV0Daughter(negtrack_v02, 0) && isSelectedV0Daughter(postrack_v02, 1)) { + aLambdaTag = 1; + V02Tag = 1; + } + + if (LambdaTag == aLambdaTag) + continue; + + if (!SelectionV0(c2, v02)) + continue; + + if (doprocessDataSame) { + if (postrack_v01.globalIndex() == postrack_v02.globalIndex() || postrack_v01.globalIndex() == negtrack_v02.globalIndex() || negtrack_v01.globalIndex() == postrack_v02.globalIndex() || negtrack_v01.globalIndex() == negtrack_v02.globalIndex()) + continue; // no shared decay products + } + + if (LambdaTag) { + if (std::abs(massLambda - v02.mLambda()) > cfgHypMassWindow) + continue; + RecoV02 = ROOT::Math::PxPyPzMVector(v02.px(), v02.py(), v02.pz(), v02.mLambda()); + } else if (aLambdaTag) { + if (std::abs(massLambda - v02.mAntiLambda()) > cfgHypMassWindow) + continue; + RecoV02 = ROOT::Math::PxPyPzMVector(v02.px(), v02.py(), v02.pz(), v02.mAntiLambda()); + } + + RecoV0V0 = RecoV01 + RecoV02; + if (std::abs(RecoV0V0.Rapidity()) > cfgV0V0RapMax) + continue; + + histos.fill(HIST("Radius_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getRadius(v01, v02)); + histos.fill(HIST("CPA_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getCPA(v01, v02)); + histos.fill(HIST("Distance_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getDistance(v01, v02)); + histos.fill(HIST("DCA_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getDCAofV0V0(v01, v02)); + + if (isSelectedV0V0(v01, v02)) { + histos.fill(HIST("Radius_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getRadius(v01, v02)); + histos.fill(HIST("CPA_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getCPA(v01, v02)); + histos.fill(HIST("Distance_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getDistance(v01, v02)); + histos.fill(HIST("DCA_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getDCAofV0V0(v01, v02)); + } + + if (cfgV0V0Sel && !isSelectedV0V0(v01, v02)) + continue; + + if (doprocessDataSame) { + histos.fill(HIST("h_InvMass_same"), RecoV0V0.M(), RecoV0V0.Pt(), centrality, V01Tag + V02Tag); + } + if (doprocessDataMixed) { + histos.fill(HIST("h_InvMass_mixed"), RecoV0V0.M(), RecoV0V0.Pt(), centrality, V01Tag + V02Tag); + } + } + } + } + + void processDataSame(EventCandidates::iterator const& collision, + TrackCandidates const& /*tracks*/, aod::V0Datas const& V0s, + aod::BCsWithTimestamps const&) + { + if (cfgCentEst == 1) { + centrality = collision.centFT0C(); + } else if (cfgCentEst == 2) { + centrality = collision.centFT0M(); + } + if (!eventSelected(collision)) { + return; + } + + histos.fill(HIST("QA/CentDist"), centrality, 1.0); + histos.fill(HIST("QA/PVzDist"), collision.posZ(), 1.0); + + if (cfgEffCor) { + auto bc = collision.bc_as(); + EffMap = ccdb->getForTimeStamp(cfgEffCorPath.value, bc.timestamp()); + } + FillHistograms(collision, collision, V0s, V0s); + } + PROCESS_SWITCH(lambdalambda, processDataSame, "Process Event for same data", true); + + SliceCache cache; + using BinningTypeVertexContributor = ColumnBinningPolicy; + + void processDataMixed(EventCandidates const& collisions, + TrackCandidates const& /*tracks*/, aod::V0Datas const& V0s) + { + auto tracksTuple = std::make_tuple(V0s); + BinningTypeVertexContributor binningOnPositions{{vertexAxis, centAxis}, true}; + SameKindPair pair{binningOnPositions, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; + for (auto& [c1, tracks1, c2, tracks2] : pair) { + if (cfgCentEst == 1) { + centrality = c1.centFT0C(); + } else if (cfgCentEst == 2) { + centrality = c1.centFT0M(); + } + if (!eventSelected(c1)) + continue; + if (!eventSelected(c2)) + continue; + FillHistograms(c1, c2, tracks1, tracks2); + } + } + PROCESS_SWITCH(lambdalambda, processDataMixed, "Process Event for mixed data", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"lf-lambdalambda"})}; +} From a98bac151748b6ca9bef30acdd55f9f6c0a60de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 11 Dec 2024 15:15:24 +0100 Subject: [PATCH 334/459] [PWGHF] Fix compilation warnings (#8919) --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 2 +- PWGHF/HFC/Tasks/taskFlow.cxx | 8 ++++---- PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx | 4 ++-- PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 59e4f0f4523..2e6544d684a 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -436,7 +436,7 @@ struct HfTaskFlowCharmHadrons { return; } float occupancy = 0.; - uint16_t hfevflag; + uint16_t hfevflag{}; if (occEstimator != 0) { occupancy = hfEvSel.getOccupancy(collision, occEstimator); registry.fill(HIST("trackOccVsFT0COcc"), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange()); diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 0f67d4f0a2b..bd84b6982b1 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -1396,7 +1396,7 @@ struct HfTaskFlow { int bin = binningWithTracksSize.getBin(binningValues); const auto multiplicity = tracks2.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing - const auto vz = collision1.posZ(); + // const auto vz = collision1.posZ(); // TO BE DONE : ADD ONE MORE IF CONDITION TO FILL THE MC CASE // TODO : FILL NEW PLOTS FOR MCTRUTH ONLY @@ -1535,7 +1535,7 @@ struct HfTaskFlow { void processSameTpcMftD0Ch(FilteredCollisionsWSelMult::iterator const& collision, HfCandidatesSelD0 const& candidates, - TracksWDcaSel const& tracks, + TracksWDcaSel const& /*tracks*/, aod::MFTTracks const& mftTracks) { auto fillEventSelectionPlots = true; @@ -1565,7 +1565,7 @@ struct HfTaskFlow { void processSameTpcMftLcCh(FilteredCollisionsWSelMult::iterator const& collision, HfCandidatesSelLc const& candidates, - TracksWDcaSel const& tracks, + TracksWDcaSel const& /*tracks*/, aod::MFTTracks const& mftTracks) { auto fillEventSelectionPlots = true; @@ -1756,7 +1756,7 @@ struct HfTaskFlow { void processMixedTpcMftD0Ch(FilteredCollisionsWSelMult const& collisions, HfCandidatesSelD0 const& candidates, aod::MFTTracks const& mftTracks, - TracksWDcaSel const& tracks) + TracksWDcaSel const& /*tracks*/) { // we want to group collisions based on charged-track multiplicity auto getMultiplicity = [&collisions, this](FilteredCollisionsWSelMult::iterator const& collision) { diff --git a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx index 5d67864bbbb..4eb5856b6f6 100644 --- a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx @@ -320,7 +320,7 @@ struct HfCandidateCreatorXicToXiPiPi { pPrFromLambda = trackPosLambdaDaughter.p(); nSigTpcPrFromLambda = trackPosLambdaDaughter.tpcNSigmaPr(); nSigTofPrFromLambda = trackPosLambdaDaughter.tofNSigmaPr(); - } else if (signXic == -1) { + } else { pPiFromLambda = trackPosLambdaDaughter.p(); nSigTpcPiFromLambda = trackPosLambdaDaughter.tpcNSigmaPi(); nSigTofPiFromLambda = trackPosLambdaDaughter.tofNSigmaPi(); @@ -584,7 +584,7 @@ struct HfCandidateCreatorXicToXiPiPi { pPrFromLambda = trackPosLambdaDaughter.p(); nSigTpcPrFromLambda = trackPosLambdaDaughter.tpcNSigmaPr(); nSigTofPrFromLambda = trackPosLambdaDaughter.tofNSigmaPr(); - } else if (signXic == -1) { + } else { pPiFromLambda = trackPosLambdaDaughter.p(); nSigTpcPiFromLambda = trackPosLambdaDaughter.tpcNSigmaPi(); nSigTofPiFromLambda = trackPosLambdaDaughter.tofNSigmaPi(); diff --git a/PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx b/PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx index 97e4d9128a9..a7e0515eb2f 100644 --- a/PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx +++ b/PWGHF/Tasks/taskMultiplicityEstimatorCorrelation.cxx @@ -101,7 +101,7 @@ struct HfTaskMultiplicityEstimatorCorrelation { if (particle.isPhysicalPrimary()) { bool isCharged = false; for (auto const& consideredParticle : consideredParticles) { - if (std::abs(particle.pdgCode()) == consideredParticle) { + if (static_cast(std::abs(particle.pdgCode())) == consideredParticle) { isCharged = true; break; } From fa924a9bce396e99f859ffc321ca31933dd06699 Mon Sep 17 00:00:00 2001 From: ivorobye Date: Wed, 11 Dec 2024 15:19:04 +0100 Subject: [PATCH 335/459] [Infrastructure] [infrastructure] Update codeowners for PWGEM (#8932) --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 2a943c7861b..5974be54430 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -33,7 +33,7 @@ /PWGCF/TableProducer @alibuild @jgrosseo @saganatt @victor-gonzalez @zchochul @lgraczykCern @prchakra @lauraser @ariedel-cern @EmilGorm @otonvd @shouqiye /PWGCF/Tasks @alibuild @jgrosseo @saganatt @victor-gonzalez @zchochul @lgraczykCern @prchakra @lauraser @ariedel-cern @EmilGorm @otonvd @shouqiye /PWGDQ @alibuild @iarsene @dsekihat @feisenhu @lucamicheletti93 -/PWGEM @alibuild @mikesas @rbailhac @feisenhu +/PWGEM @alibuild @feisenhu @dsekihat @ivorobye /PWGEM/Dilepton @alibuild @mikesas @rbailhac @dsekihat @ivorobye @feisenhu /PWGEM/PhotonMeson @alibuild @mikesas @rbailhac @m-c-danisch @novitzky @mhemmer-cern @dsekihat /PWGHF @alibuild @vkucera @fcolamar @fgrosa @fcatalan92 @mfaggin @mmazzilli @deepathoms @NicoleBastid @hahassan7 @jpxrk @apalasciano From e53e10464d60baacbf46793dbdb8fb1e52182033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Wed, 11 Dec 2024 15:28:17 +0100 Subject: [PATCH 336/459] [Infrastructure] Remove compilation warning exception sign-compare (#8908) --- dependencies/O2PhysicsCompileFlags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/O2PhysicsCompileFlags.cmake b/dependencies/O2PhysicsCompileFlags.cmake index 02312bdf601..20078b607f7 100644 --- a/dependencies/O2PhysicsCompileFlags.cmake +++ b/dependencies/O2PhysicsCompileFlags.cmake @@ -14,7 +14,7 @@ include_guard() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") # Enabled warnings supported by Clang and GCC, not treated as errors -set(O2PHYSICS_WARNINGS_COMMON_NO_ERROR "sign-compare") +set(O2PHYSICS_WARNINGS_COMMON_NO_ERROR "") # Enabled warnings supported by Clang only, not treated as errors set(O2PHYSICS_WARNINGS_CLANG_NO_ERROR "") From 7b0032984d0c6cb62214da40747eb865b6af6921 Mon Sep 17 00:00:00 2001 From: Marta Urioni <78807256+murioni@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:37:32 +0100 Subject: [PATCH 337/459] [PWGLF] Fixing bugs in K*0 analysis in PbPb (#8925) --- PWGLF/Tasks/Resonances/k892analysis_PbPb.cxx | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/PWGLF/Tasks/Resonances/k892analysis_PbPb.cxx b/PWGLF/Tasks/Resonances/k892analysis_PbPb.cxx index aeefe798b82..d1866ffb594 100644 --- a/PWGLF/Tasks/Resonances/k892analysis_PbPb.cxx +++ b/PWGLF/Tasks/Resonances/k892analysis_PbPb.cxx @@ -279,19 +279,19 @@ struct k892analysis_PbPb { if (TofandTpcPID) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < cMaxTOFnSigmaKaon && candidate.hasTPC() && std::abs(candidate.tpcNSigmaKa()) < cMaxTPCnSigmaKaon) { // tof and tpc cut + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) <= cMaxTOFnSigmaKaon && candidate.hasTPC() && std::abs(candidate.tpcNSigmaKa()) <= cMaxTPCnSigmaKaon) { // tof and tpc cut return true; } } else { - if (candidate.hasTPC() && std::abs(candidate.tpcNSigmaKa()) < cMaxTPCnSigmaKaon) { // tpc cut, tof when available + if (candidate.hasTPC() && std::abs(candidate.tpcNSigmaKa()) <= cMaxTPCnSigmaKaon) { // tpc cut, tof when available if (cByPassTOF) // skip tof selection return true; if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaKa()) < cMaxTOFnSigmaKaon) { + if (std::abs(candidate.tofNSigmaKa()) <= cMaxTOFnSigmaKaon) { return true; } } else { @@ -309,19 +309,19 @@ struct k892analysis_PbPb { if (TofandTpcPID) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < cMaxTOFnSigmaPion && candidate.hasTPC() && std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { // tof and tpc cut + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) <= cMaxTOFnSigmaPion && candidate.hasTPC() && std::abs(candidate.tpcNSigmaPi()) <= cMaxTPCnSigmaPion) { // tof and tpc cut return true; } } else { - if (candidate.hasTPC() && std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { // tpc cut, tof when available + if (candidate.hasTPC() && std::abs(candidate.tpcNSigmaPi()) <= cMaxTPCnSigmaPion) { // tpc cut, tof when available if (cByPassTOF) // skip tof selection return true; if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaPi()) < cMaxTOFnSigmaPion) { + if (std::abs(candidate.tofNSigmaPi()) <= cMaxTOFnSigmaPion) { return true; } } else { @@ -382,10 +382,10 @@ struct k892analysis_PbPb { if constexpr (IsMC) { if (tpclowpt) { - if (trk1ptPi > cMaxPtTPC || trk2ptKa > cMaxPtTPC) + if (trk1ptPi >= cMaxPtTPC || trk2ptKa >= cMaxPtTPC) continue; } else if (tofhighpt) { - if (trk1ptPi < cMinPtTOF || trk2ptKa < cMinPtTOF) + if (trk1ptPi <= cMinPtTOF || trk2ptKa <= cMinPtTOF) continue; } } @@ -552,8 +552,8 @@ struct k892analysis_PbPb { Filter collisionFilter = nabs(aod::collision::posZ) <= cfgCutVertex; Filter centralityFilter = nabs(aod::cent::centFT0C) <= cfgCutCentrality; - Filter acceptanceFilter = (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT); - Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); + Filter acceptanceFilter = (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) >= cfgCutPT); + Filter DCAcutFilter = (nabs(aod::track::dcaXY) <= cfgCutDCAxy) && (nabs(aod::track::dcaZ) <= cfgCutDCAz); using EventCandidates = soa::Filtered>; using TrackCandidates = soa::Filtered cfgCutVertex) - return; + continue; histos.fill(HIST("hMCrecCollSels"), 5); auto centrality = RecCollision.centRun2V0M(); From 55567332078d6460f7a84c323d7d6b547e574d07 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:44:54 +0100 Subject: [PATCH 338/459] [PWGCF] FemtoUniverse: Reinstating Occupancy cut in col. table (#8930) --- .../FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 9aa30f2939f..e1428e4a6ab 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -852,13 +852,14 @@ struct femtoUniverseProducerTask { const auto vtxZ = col.posZ(); const auto multNtr = col.multNTracksPV(); const auto cent = col.centFT0C(); + const auto occupancy = col.trackOccupancyInTimeRange(); // check whether the basic event selection criteria are fulfilled // if the basic selection is NOT fulfilled: // in case of skimming run - don't store such collisions // in case of trigger run - store such collisions but don't store any // particle candidates for such collisions - if (!colCuts.isSelectedRun3(col)) { + if (!colCuts.isSelectedRun3(col) || (occupancy < ConfTPCOccupancyMin || occupancy > ConfTPCOccupancyMax)) { return false; } else { if ((col.selection_bit(aod::evsel::kNoSameBunchPileup)) && (col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) { From a70a8572f896c0d5b38c1defb8d1fe70e56752e6 Mon Sep 17 00:00:00 2001 From: Rik Spijkers <78484875+rspijkers@users.noreply.github.com> Date: Wed, 11 Dec 2024 19:34:45 +0100 Subject: [PATCH 339/459] [PWGLF] fix histogram names in ME process in cascade correlations (#8933) --- .../Tasks/Strangeness/cascadecorrelations.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx b/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx index 4209688498d..7cb9a984d9d 100644 --- a/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx +++ b/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx @@ -720,24 +720,24 @@ struct CascadeCorrelations { if (trigger.isSelected() >= 2) { if (trigger.sign() > 0 && trigger.bachelorId() == posIdAssoc) { // K+ from trigger Omega is the same as proton from assoc lambda - registry.fill(HIST("hMEAutoCorrelationOS"), 1); + registry.fill(HIST("MixedEvents/hMEAutoCorrelationOS"), 1); continue; } if (trigger.sign() < 0 && trigger.bachelorId() == negIdAssoc) { // K- from trigger Omega is the same as antiproton from assoc antilambda - registry.fill(HIST("hMEAutoCorrelationOS"), -1); + registry.fill(HIST("MixedEvents/hMEAutoCorrelationOS"), -1); continue; } } if (assoc.isSelected() >= 2) { if (assoc.sign() > 0 && assoc.bachelorId() == posIdTrigg) { // K+ from assoc Omega is the same as proton from trigger lambda - registry.fill(HIST("hMEAutoCorrelationOS"), 1); + registry.fill(HIST("MixedEvents/hMEAutoCorrelationOS"), 1); continue; } if (assoc.sign() < 0 && assoc.bachelorId() == negIdTrigg) { // K- from assoc Omega is the same as antiproton from trigger antilambda - registry.fill(HIST("hMEAutoCorrelationOS"), -1); + registry.fill(HIST("MixedEvents/hMEAutoCorrelationOS"), -1); continue; } } @@ -777,7 +777,7 @@ struct CascadeCorrelations { // make sure to check for autocorrelations - only possible in same-sign correlations (if PID is correct) if (posIdTrigg == posIdAssoc && negIdTrigg == negIdAssoc) { // LOGF(info, "same v0 in SS correlation! %d %d", v0dataTrigg.v0Id(), v0dataAssoc.v0Id()); - registry.fill(HIST("hMEAutoCorrelation"), 0); + registry.fill(HIST("MixedEvents/hMEAutoCorrelation"), 0); continue; } int bachIdTrigg = trigger.bachelorId(); @@ -785,25 +785,25 @@ struct CascadeCorrelations { if (bachIdTrigg == bachIdAssoc) { // LOGF(info, "same bachelor in SS correlation! %d %d", bachIdTrigg, bachIdAssoc); - registry.fill(HIST("hMEAutoCorrelation"), 1); + registry.fill(HIST("MixedEvents/hMEAutoCorrelation"), 1); continue; } // check for same tracks in v0's of cascades if (negIdTrigg == negIdAssoc || posIdTrigg == posIdAssoc) { // LOGF(info, "cascades have a v0-track in common in SS correlation!"); - registry.fill(HIST("hMEAutoCorrelation"), 2); + registry.fill(HIST("MixedEvents/hMEAutoCorrelation"), 2); continue; } if (trigger.sign() < 0) { // neg cascade if (negIdTrigg == bachIdAssoc || negIdAssoc == bachIdTrigg) { // LOGF(info, "bach of casc == v0-pion of other casc in neg SS correlation!"); - registry.fill(HIST("hMEAutoCorrelation"), 3); + registry.fill(HIST("MixedEvents/hMEAutoCorrelation"), 3); continue; } } else { // pos cascade if (posIdTrigg == bachIdAssoc || posIdAssoc == bachIdTrigg) { // LOGF(info, "bach of casc == v0-pion of other casc in pos SS correlation!"); - registry.fill(HIST("hMEAutoCorrelation"), 3); + registry.fill(HIST("MixedEvents/hMEAutoCorrelation"), 3); continue; } } From 6b1d62fd552f67a9b42dd7d83863e535295cf121 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:20:38 +0100 Subject: [PATCH 340/459] [PWGLF] Boosting daughter with v0 momentum (#8936) Co-authored-by: Prottay Das --- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 55 ++++++++++--------------- 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index 54eca5c81fb..bc0993bb77a 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -77,7 +77,7 @@ struct lambdapolsp { // Configurable mycut{"mycut", false, "select tracks based on my cuts"}; Configurable tofhit{"tofhit", true, "select tracks based on tof hit"}; Configurable globalpt{"globalpt", true, "select tracks based on pt global vs tpc"}; - Configurable usefourvectormass{"usefourvectormass", true, "select invariant mass based on four vector"}; + Configurable useglobal{"useglobal", true, "flag to use global vs v0 momentum"}; Configurable checksign{"checksign", true, "check sign of daughter tracks"}; Configurable useprofile{"useprofile", 3, "flag to select profile vs Sparse"}; Configurable QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"}; @@ -100,7 +100,6 @@ struct lambdapolsp { Configurable cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"}; Configurable isPVContributor{"isPVContributor", true, "is PV contributor"}; Configurable checkwithpub{"checkwithpub", true, "checking results with published"}; - Configurable rejectmisident{"rejectmisident", true, "rejecting misidentification"}; Configurable useTPCTOF{"useTPCTOF", true, "flag to use TPC and TOF"}; // Configs for V0 @@ -436,15 +435,6 @@ struct lambdapolsp { if (pid == 1 && TMath::Abs(track.tpcNSigmaPi()) > ConfDaughPIDCuts) { return false; } - // for misidentification - if (rejectmisident) { - if (pid == 0 && TMath::Abs(track.tpcNSigmaPi()) < 3.0) { - return false; - } - if (pid == 1 && TMath::Abs(track.tpcNSigmaPr()) < 3.0) { - return false; - } - } } if (pid == 0 && pt < cfgDaughPrPt) { @@ -690,15 +680,24 @@ struct lambdapolsp { } if (LambdaTag) { - Proton = ROOT::Math::PxPyPzMVector(postrack.px(), postrack.py(), postrack.pz(), massPr); - Pion = ROOT::Math::PxPyPzMVector(negtrack.px(), negtrack.py(), negtrack.pz(), massPi); + if (useglobal) { + Proton = ROOT::Math::PxPyPzMVector(postrack.px(), postrack.py(), postrack.pz(), massPr); + Pion = ROOT::Math::PxPyPzMVector(negtrack.px(), negtrack.py(), negtrack.pz(), massPi); + } else { + Proton = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPr); + Pion = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPi); + } } if (aLambdaTag) { - Proton = ROOT::Math::PxPyPzMVector(negtrack.px(), negtrack.py(), negtrack.pz(), massPr); - Pion = ROOT::Math::PxPyPzMVector(postrack.px(), postrack.py(), postrack.pz(), massPi); + if (useglobal) { + Proton = ROOT::Math::PxPyPzMVector(negtrack.px(), negtrack.py(), negtrack.pz(), massPr); + Pion = ROOT::Math::PxPyPzMVector(postrack.px(), postrack.py(), postrack.pz(), massPi); + } else { + Proton = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPr); + Pion = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPi); + } } Lambda = Proton + Pion; - Lambdacopy = Proton + Pion; Lambda.SetM(massLambda); ROOT::Math::Boost boost{Lambda.BoostToCM()}; @@ -733,15 +732,9 @@ struct lambdapolsp { auto candeta = 0.0; if (LambdaTag) { - if (usefourvectormass) { - candmass = Lambdacopy.M(); - candpt = Lambdacopy.Pt(); - candeta = Lambdacopy.Eta(); - } else { - candmass = v0.mLambda(); - candpt = v0.pt(); - candeta = v0.eta(); - } + candmass = v0.mLambda(); + candpt = v0.pt(); + candeta = v0.eta(); histos.fill(HIST("hSparseLambdaPolA"), candmass, candpt, candeta, PolA, centrality); histos.fill(HIST("hSparseLambdaPolC"), candmass, candpt, candeta, PolC, centrality); @@ -753,15 +746,9 @@ struct lambdapolsp { } if (aLambdaTag) { - if (usefourvectormass) { - candmass = Lambdacopy.M(); - candpt = Lambdacopy.Pt(); - candeta = Lambdacopy.Eta(); - } else { - candmass = v0.mAntiLambda(); - candpt = v0.pt(); - candeta = v0.eta(); - } + candmass = v0.mAntiLambda(); + candpt = v0.pt(); + candeta = v0.eta(); histos.fill(HIST("hSparseAntiLambdaPolA"), candmass, candpt, candeta, PolA, centrality); histos.fill(HIST("hSparseAntiLambdaPolC"), candmass, candpt, candeta, PolC, centrality); From a7a2d91058cc6a7f9c43363d39952465e9acfb4c Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Wed, 11 Dec 2024 21:19:31 +0100 Subject: [PATCH 341/459] [PWGLF] daughter momentum from v0 table (#8939) Co-authored-by: junleekim --- PWGLF/Tasks/Strangeness/lambdapolarization.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdapolarization.cxx b/PWGLF/Tasks/Strangeness/lambdapolarization.cxx index f0d7e63f57f..ae794ce1506 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolarization.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolarization.cxx @@ -524,12 +524,12 @@ struct lambdapolarization { continue; if (LambdaTag) { - ProtonVec = ROOT::Math::PxPyPzMVector(postrack.px(), postrack.py(), postrack.pz(), massPr); - PionVec = ROOT::Math::PxPyPzMVector(negtrack.px(), negtrack.py(), negtrack.pz(), massPi); + ProtonVec = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPr); + PionVec = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPi); } if (aLambdaTag) { - ProtonVec = ROOT::Math::PxPyPzMVector(negtrack.px(), negtrack.py(), negtrack.pz(), massPr); - PionVec = ROOT::Math::PxPyPzMVector(postrack.px(), postrack.py(), postrack.pz(), massPi); + ProtonVec = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPr); + PionVec = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPi); } LambdaVec = ProtonVec + PionVec; LambdaVec.SetM(massLambda); From 85f5d352bb3977d787ecf03072b34b24eae7be41 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:49:10 +0100 Subject: [PATCH 342/459] [PWGEM/PhotonMeson] Fix Cluster-Collision assignment in emcQC task (#8942) Co-authored-by: Nicolas Strangmann --- PWGEM/PhotonMeson/Tasks/emcalQC.cxx | 4 ++-- PWGEM/PhotonMeson/Utils/ClusterHistograms.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx index fe81608516c..0b5be17d212 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx @@ -152,9 +152,9 @@ struct emcalQC { o2::aod::pwgem::photonmeson::utils::clusterhistogram::addClusterHistograms(&fRegistry, cfgDo2DQA); } - Preslice perCollision = aod::skimmedcluster::collisionId; + Preslice perCollision = aod::emccluster::emeventId; - void processQC(MyCollisions const& collisions, aod::SkimEMCClusters const& clusters) + void processQC(MyCollisions const& collisions, MyEMCClusters const& clusters) { for (auto& collision : collisions) { diff --git a/PWGEM/PhotonMeson/Utils/ClusterHistograms.h b/PWGEM/PhotonMeson/Utils/ClusterHistograms.h index 5df8ca93de1..677dfa00902 100644 --- a/PWGEM/PhotonMeson/Utils/ClusterHistograms.h +++ b/PWGEM/PhotonMeson/Utils/ClusterHistograms.h @@ -55,8 +55,8 @@ void addClusterHistograms(HistogramRegistry* fRegistry, bool do2DQA) fRegistry->addClone("Cluster/before/", "Cluster/after/"); } -template -void fillClusterHistograms(HistogramRegistry* fRegistry, SkimEMCCluster cluster, bool do2DQA, float weight = 1.f) +template +void fillClusterHistograms(HistogramRegistry* fRegistry, TCluster cluster, bool do2DQA, float weight = 1.f) { static constexpr std::string_view cluster_types[2] = {"before/", "after/"}; fRegistry->fill(HIST("Cluster/") + HIST(cluster_types[cls_id]) + HIST("hE"), cluster.e(), weight); From 57f11b68e161d76dbe7b390370be40dbd9b9003c Mon Sep 17 00:00:00 2001 From: Zhiyong <71517277+Luzhiyongg@users.noreply.github.com> Date: Thu, 12 Dec 2024 05:52:32 +0800 Subject: [PATCH 343/459] [PWGCF] flowtask: fix DCAz bug and draw TPCsector overlap (#8935) --- PWGCF/Flow/Tasks/FlowTask.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowTask.cxx b/PWGCF/Flow/Tasks/FlowTask.cxx index 0f4d6977855..55a5bfc40ba 100644 --- a/PWGCF/Flow/Tasks/FlowTask.cxx +++ b/PWGCF/Flow/Tasks/FlowTask.cxx @@ -66,7 +66,8 @@ struct FlowTask { O2_DEFINE_CONFIGURABLE(cfgCutDCAzPtDepEnabled, bool, false, "switch of DCAz pt dependent cut") O2_DEFINE_CONFIGURABLE(cfgTrkSelSwitch, bool, false, "switch for self-defined track selection") O2_DEFINE_CONFIGURABLE(cfgTrkSelRun3ITSMatch, bool, false, "GlobalTrackRun3ITSMatching::Run3ITSall7Layers selection") - O2_DEFINE_CONFIGURABLE(cfgRejectionTPCsectorOverlap, bool, true, "rejection for TPC sector overlap") + O2_DEFINE_CONFIGURABLE(cfgShowTPCsectorOverlap, bool, true, "Draw TPC sector overlap") + O2_DEFINE_CONFIGURABLE(cfgRejectionTPCsectorOverlap, bool, false, "rejection for TPC sector overlap") O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, false, "Use additional event cut on mult correlations") O2_DEFINE_CONFIGURABLE(cfgTriggerkTVXinTRD, bool, true, "TRD triggered") O2_DEFINE_CONFIGURABLE(cfgEvSelkNoSameBunchPileup, bool, true, "rejects collisions which are associated with the same found-by-T0 bunch crossing") @@ -401,7 +402,7 @@ struct FlowTask { fT0AV0ASigma->SetParameters(463.4144, 6.796509e-02, -9.097136e-07, 7.971088e-12, -2.600581e-17); } - if (cfgRejectionTPCsectorOverlap) { + if (cfgShowTPCsectorOverlap) { fPhiCutLow = new TF1("fPhiCutLow", "0.06/x+pi/18.0-0.06", 0, 100); fPhiCutHigh = new TF1("fPhiCutHigh", "0.1/x+pi/18.0+0.06", 0, 100); } @@ -591,7 +592,7 @@ struct FlowTask { template bool trackSelected(TTrack track) { - if (cfgCutDCAzPtDepEnabled && (track.dcaZ() > (0.004f + 0.013f / track.pt()))) + if (cfgCutDCAzPtDepEnabled && (fabs(track.dcaZ()) > (0.004f + 0.013f / track.pt()))) return false; if (cfgTrkSelSwitch) { @@ -615,8 +616,10 @@ struct FlowTask { phimodn += TMath::Pi() / 18.0; // to center gap in the middle phimodn = fmod(phimodn, TMath::Pi() / 9.0); registry.fill(HIST("pt_phi_bef"), track.pt(), phimodn); - if (phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt())) - return false; // reject track + if (cfgRejectionTPCsectorOverlap) { + if (phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt())) + return false; // reject track + } registry.fill(HIST("pt_phi_aft"), track.pt(), phimodn); return true; } @@ -703,7 +706,7 @@ struct FlowTask { double sum_ptSquare_wSquare_WithinGap08 = 0., sum_pt_wSquare_WithinGap08 = 0.; int Magnetfield = 0; double NTracksCorrected = 0; - if (cfgRejectionTPCsectorOverlap) { + if (cfgShowTPCsectorOverlap) { // magnet field dependence cut Magnetfield = getMagneticField(bc.timestamp()); } @@ -714,7 +717,7 @@ struct FlowTask { for (auto& track : tracks) { if (!trackSelected(track)) continue; - if (cfgRejectionTPCsectorOverlap && !RejectionTPCoverlap(track, Magnetfield)) + if (cfgShowTPCsectorOverlap && !RejectionTPCoverlap(track, Magnetfield)) continue; bool WithinPtPOI = (cfgCutPtPOIMin < track.pt()) && (track.pt() < cfgCutPtPOIMax); // within POI pT range bool WithinPtRef = (cfgCutPtRefMin < track.pt()) && (track.pt() < cfgCutPtRefMax); // within RF pT range From aeb431cc031228e5cbe08517c913a3b5f5e2da17 Mon Sep 17 00:00:00 2001 From: Noor Koster <82090643+cnkoster@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:57:07 +0100 Subject: [PATCH 344/459] [PWGCF] Fill registry only when events are selected (#8940) Co-authored-by: ALICE Action Bot --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 46 ++-- PWGCF/Flow/Tasks/flowSP.cxx | 266 +++++++++++++---------- 2 files changed, 181 insertions(+), 131 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index c4873eb1246..957460d8b28 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -176,6 +176,7 @@ struct ZdcQVectors { for (int step = 0; step < 6; step++) { registry.add(Form("step%i/QA/hSPplaneA", step), "hSPplaneA", kTH2D, {{100, -4, 4}, axisCent10}); registry.add(Form("step%i/QA/hSPplaneC", step), "hSPplaneC", kTH2D, {{100, -4, 4}, axisCent10}); + registry.add(Form("step%i/QA/hSPplaneFull", step), "hSPplaneFull", kTH2D, {{100, -4, 4}, axisCent10}); for (const auto& side : sides) { hQxvsQy[step] = registry.add(Form("step%i/hZN%s_Qx_vs_Qy", step, side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ}); } @@ -328,6 +329,14 @@ struct ZdcQVectors { registry.fill(HIST("step0/QA/hQXC_vs_vz"), v[2], q[0][0][2]); registry.fill(HIST("step0/QA/hQYC_vs_vz"), v[2], q[0][0][3]); + // add psi!! + double psiA = 1.0 * std::atan2(q[0][0][2], q[0][0][0]); + registry.fill(HIST("step0/QA/hSPplaneA"), psiA, centrality, 1); + double psiC = 1.0 * std::atan2(q[0][0][3], q[0][0][1]); + registry.fill(HIST("step0/QA/hSPplaneC"), psiC, centrality, 1); + double psiFull = 1.0 * std::atan2(q[0][0][2] + q[0][0][3], q[0][0][0] + q[0][0][1]); + registry.fill(HIST("step0/QA/hSPplaneFull"), psiFull, centrality, 1); + static constexpr std::string_view SubDir[] = {"step1/", "step2/", "step3/", "step4/", "step5/"}; static_for<0, 4>([&](auto Ind) { constexpr int Index = Ind.value; @@ -361,11 +370,12 @@ struct ZdcQVectors { registry.fill(HIST(SubDir[Index]) + HIST("QA/hQXC_vs_vz"), v[2], q[iteration][indexRt][2]); registry.fill(HIST(SubDir[Index]) + HIST("QA/hQYC_vs_vz"), v[2], q[iteration][indexRt][3]); - // add psi!! - double psiA = 1.0 * std::atan2(q[iteration][indexRt][2], q[iteration][indexRt][0]); + psiA = 1.0 * std::atan2(q[iteration][indexRt][2], q[iteration][indexRt][0]); registry.fill(HIST(SubDir[Index]) + HIST("QA/hSPplaneA"), psiA, centrality, 1); - double psiC = 1.0 * std::atan2(q[iteration][indexRt][3], q[iteration][indexRt][1]); + psiC = 1.0 * std::atan2(q[iteration][indexRt][3], q[iteration][indexRt][1]); registry.fill(HIST(SubDir[Index]) + HIST("QA/hSPplaneC"), psiC, centrality, 1); + psiFull = 1.0 * std::atan2(q[iteration][indexRt][2] + q[iteration][indexRt][3], q[iteration][indexRt][0] + q[iteration][indexRt][1]); + registry.fill(HIST(SubDir[Index]) + HIST("QA/hSPplaneFull"), psiFull, centrality, 1); }); } @@ -456,7 +466,7 @@ struct ZdcQVectors { } else if (hist->InheritsFrom("TProfile")) { TProfile* h = reinterpret_cast(hist); TString name = h->GetName(); - int bin{}; + int bin; if (name.Contains("mean_vx")) bin = h->GetXaxis()->FindBin(v[0]); if (name.Contains("mean_vy")) @@ -471,20 +481,17 @@ struct ZdcQVectors { } else if (hist->InheritsFrom("THnSparse")) { std::vector sparsePars; THnSparseD* h = reinterpret_cast(hist); - if (step == 0 && iteration > 0) { - // Axis(0) is runnuber, but we don't need this - sparsePars.push_back(h->GetAxis(1)->FindBin(centrality)); - sparsePars.push_back(h->GetAxis(2)->FindBin(v[0])); - sparsePars.push_back(h->GetAxis(3)->FindBin(v[1])); - sparsePars.push_back(h->GetAxis(4)->FindBin(v[2])); - } + sparsePars.push_back(h->GetAxis(0)->FindBin(centrality)); + sparsePars.push_back(h->GetAxis(1)->FindBin(v[0])); + sparsePars.push_back(h->GetAxis(2)->FindBin(v[1])); + sparsePars.push_back(h->GetAxis(3)->FindBin(v[2])); - for (std::size_t i = 0; i < sparsePars.size() + 1; i++) { - h->GetAxis(i + 1)->SetRange(sparsePars[i], sparsePars[i]); + for (std::size_t i = 0; i < sparsePars.size(); i++) { + h->GetAxis(i)->SetRange(sparsePars[i], sparsePars[i]); } - calibConstant = h->Projection(5)->GetMean(); + calibConstant = h->Projection(4)->GetMean(); - if (h->Projection(sparsePars.size())->GetEntries() < cfgMinEntriesSparseBin) { + if (h->Projection(4)->GetEntries() < cfgMinEntriesSparseBin) { LOGF(debug, "1 entry in sparse bin! Not used... (increase binsize)"); calibConstant = 0; isSelected = false; @@ -694,7 +701,8 @@ struct ZdcQVectors { if (cal.atIteration == 0) { if (counter < 1) LOGF(warning, "Calibation files missing!!! Output created with q-vectors right after energy gain eq. !!"); - fillAllRegistries(0, 0); + if (isSelected) + fillAllRegistries(0, 0); spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[0][0][0], q[0][0][1], q[0][0][2], q[0][0][3], isSelected, 0, 0); counter++; return; @@ -722,8 +730,10 @@ struct ZdcQVectors { if (counter < 1) LOGF(info, "Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep + 1); - fillAllRegistries(cal.atIteration, cal.atStep + 1); - registry.fill(HIST("QA/centrality_after"), centrality); + if (isSelected) { + fillAllRegistries(cal.atIteration, cal.atStep + 1); + registry.fill(HIST("QA/centrality_after"), centrality); + } spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], isSelected, cal.atIteration, cal.atStep); counter++; return; diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index e64492dfa06..f89d0728364 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -32,7 +32,6 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" -#include "Common/DataModel/Qvectors.h" #include "Common/Core/RecoDecay.h" #include "PWGCF/DataModel/SPTableZDC.h" @@ -57,8 +56,9 @@ struct FlowSP { O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried"); O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, true, "Bool to enable Additional Event Cut"); O2_DEFINE_CONFIGURABLE(cfgUseAdditionalTrackCut, bool, true, "Bool to enable Additional Track Cut"); - O2_DEFINE_CONFIGURABLE(cfgCentMax, float, 60, "Maximum cenrality for selected events"); - O2_DEFINE_CONFIGURABLE(cfgCentMin, float, 10, "Minimum cenrality for selected events"); + O2_DEFINE_CONFIGURABLE(cfgCentMax, float, 90, "Maximum cenrality for selected events"); + O2_DEFINE_CONFIGURABLE(cfgCentMin, float, 0, "Minimum cenrality for selected events"); + O2_DEFINE_CONFIGURABLE(cfgFillWeights, bool, false, "Fill NUA weights") O2_DEFINE_CONFIGURABLE(cfgDoubleTrackFunction, bool, true, "Include track cut at low pt"); O2_DEFINE_CONFIGURABLE(cfgTrackCutSize, float, 0.06, "Spread of track cut"); @@ -68,12 +68,22 @@ struct FlowSP { O2_DEFINE_CONFIGURABLE(cfgNoCollInTimeRangeStandard, bool, true, "kNoCollInTimeRangeStandard"); O2_DEFINE_CONFIGURABLE(cfgDoOccupancySel, bool, true, "Bool for event selection on detector occupancy"); O2_DEFINE_CONFIGURABLE(cfgMultCut, bool, true, "Use additional evenr cut on mult correlations"); - O2_DEFINE_CONFIGURABLE(cfgTVXinTRD, bool, true, "Use kTVXinTRD (reject TRD triggered events)"); + O2_DEFINE_CONFIGURABLE(cfgTVXinTRD, bool, false, "Use kTVXinTRD (reject TRD triggered events)"); O2_DEFINE_CONFIGURABLE(cfgIsVertexITSTPC, bool, true, "Selects collisions with at least one ITS-TPC track"); + ConfigurableAxis axisDCAz{"axisDCAz", {200, -.5, .5}, "DCA_{z} (cm)"}; + ConfigurableAxis axisDCAxy{"axisDCAxy", {200, -.5, .5}, "DCA_{xy} (cm)"}; + ConfigurableAxis axisPhiMod = {"axisPhiMod", {100, 0, constants::math::PI / 9}, "fmod(#varphi,#pi/9)"}; + ConfigurableAxis axisPhi = {"axisPhi", {60, 0, constants::math::TwoPI}, "#varphi"}; + ConfigurableAxis axisEta = {"axisEta", {64, -1, 1}, "#eta"}; + ConfigurableAxis axisEtaV1 = {"axisEtaV1", {8, -.8, .8}, "#eta"}; + ConfigurableAxis axisVz = {"axisVz", {40, -10, 10}, "v_{z}"}; + ConfigurableAxis axisCent = {"axisCent", {90, 0, 90}, "Centrality(%)"}; + ConfigurableAxis axisPhiPlane = {"axisPhiPlane", {100, -constants::math::PI, constants::math::PI}, "#Psi"}; + Filter collisionFilter = nabs(aod::collision::posZ) < cfgVtxZ; Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && nabs(aod::track::dcaXY) < cfgDCAxy&& nabs(aod::track::dcaZ) < cfgDCAz; - using UsedCollisions = soa::Filtered>; + using UsedCollisions = soa::Filtered>; using UsedTracks = soa::Filtered>; // Connect to ccdb @@ -92,11 +102,6 @@ struct FlowSP { void init(InitContext const&) { - std::vector ptbinning = {0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}; - - AxisSpec phiModAxis = {100, 0, constants::math::PI / 9, "fmod(#varphi,#pi/9)"}; - AxisSpec ptAxis = {ptbinning, "#it{p}_{T} GeV/#it{c}"}; - ccdb->setURL("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); @@ -104,46 +109,67 @@ struct FlowSP { int64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); ccdb->setCreatedNotAfter(now); - registry.add("hSPplaneA", "hSPplaneA", kTH1D, {{100, -3, 3}}); - registry.add("hSPplaneC", "hSPplaneC", kTH1D, {{100, -3, 3}}); - registry.add("hSPplaneA-C", "hSPplaneA-C", kTH1D, {{100, -3, 3}}); - registry.add("hCent", "hCent", kTH1D, {{80, 0, 80}}); - - registry.add("hqIm", "hqIm", kTH1D, {{100, -2, 2}}); - registry.add("hqRe", "hqRe", kTH1D, {{100, -2, 2}}); - - registry.add("hCosdPhi", "hCosdPhi; Centrality(%); #LT Cos( #Psi^{A}-#Psi^{C})#GT", kTProfile, {{80, 0, 80}}); - registry.add("hSindPhi", "hSindPhi; Centrality(%); #LT Sin( #Psi^{A}-#Psi^{C})#GT", kTProfile, {{80, 0, 80}}); - registry.add("hSPlaneRes", "hSPlaneRes; Centrality(%); ", kTProfile, {{80, 0, 80}}); - - registry.add("pt_phi_bef", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); - registry.add("pt_phi_aft", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); - - registry.add("v1_eta", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1A_eta", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1C_eta", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1AC_eta", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - - registry.add("v1_eta_odd", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_even", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - - registry.add("v1_eta_odd_dev", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_even_dev", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - - registry.add("v1_eta_odd_dev_pos", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_even_dev_pos", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_odd_pos", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_even_pos", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - - registry.add("v1_eta_odd_dev_neg", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_even_dev_neg", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_odd_neg", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - registry.add("v1_eta_even_neg", "", kTProfile2D, {{10, -.8, .8}, ptAxis}); - - registry.add("v2_cent", "", kTProfile2D, {{80, 0, 80}, ptAxis}); - registry.add("v2A_cent", "", kTProfile2D, {{80, 0, 80}, ptAxis}); - registry.add("v2C_cent", "", kTProfile2D, {{80, 0, 80}, ptAxis}); - registry.add("v2AC_cent", "", kTProfile2D, {{80, 0, 80}, ptAxis}); + std::vector ptbinning = {0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}; + AxisSpec axisPt = {ptbinning, "#it{p}_{T} GeV/#it{c}"}; + AxisSpec nchAxis = {4000, 0, 4000, "N_{ch}"}; + AxisSpec t0cAxis = {70, 0, 70000, "N_{ch} (T0C)"}; + AxisSpec t0aAxis = {200, 0, 200, "N_{ch}"}; + AxisSpec multpvAxis = {4000, 0, 4000, "N_{ch} (PV)"}; + + registry.add("hSPplaneA", "hSPplaneA", kTH1D, {axisPhiPlane}); + registry.add("hSPplaneC", "hSPplaneC", kTH1D, {axisPhiPlane}); + registry.add("hSPplaneFull", "hSPplaneFull", kTH1D, {axisPhiPlane}); + + registry.add("hCosPhiACosPhiC", "hCosPhiACosPhiC; Centrality(%); #LT Cos(#Psi^{A})Cos(#Psi^{C})#GT", kTProfile, {axisCent}); + registry.add("hSinPhiASinPhiC", "hSinPhiASinPhiC; Centrality(%); #LT Sin(#Psi^{A})Sin(#Psi^{C})#GT", kTProfile, {axisCent}); + registry.add("hSinPhiACosPhiC", "hSinPhiACosPhiC; Centrality(%); #LT Sin(#Psi^{A})Cos(#Psi^{C})#GT", kTProfile, {axisCent}); + registry.add("hCosPhiASinsPhiC", "hCosPhiASinsPhiC; Centrality(%); #LT Cos(#Psi^{A})Sin(#Psi^{C})#GT", kTProfile, {axisCent}); + registry.add("hFullEvPlaneRes", "hFullEvPlaneRes; Centrality(%); #sqrt{2#LT Cos(#Psi^{A} - #Psi^{C})#GT} ", kTProfile, {axisCent}); + + registry.add("QA/after/hCent", "", {HistType::kTH1D, {axisCent}}); + registry.add("QA/after/globalTracks_centT0C", "", {HistType::kTH2D, {axisCent, nchAxis}}); + registry.add("QA/after/PVTracks_centT0C", "", {HistType::kTH2D, {axisCent, multpvAxis}}); + registry.add("QA/after/globalTracks_PVTracks", "", {HistType::kTH2D, {multpvAxis, nchAxis}}); + registry.add("QA/after/globalTracks_multT0A", "", {HistType::kTH2D, {t0aAxis, nchAxis}}); + registry.add("QA/after/globalTracks_multV0A", "", {HistType::kTH2D, {t0aAxis, nchAxis}}); + registry.add("QA/after/multV0A_multT0A", "", {HistType::kTH2D, {t0aAxis, t0aAxis}}); + registry.add("QA/after/multT0C_centT0C", "", {HistType::kTH2D, {axisCent, t0cAxis}}); + registry.addClone("QA/after/", "QA/before/"); + + registry.add("QA/after/pt_phi_bef", "", {HistType::kTH2D, {axisPt, axisPhiMod}}); + registry.add("QA/after/pt_phi_aft", "", {HistType::kTH2D, {axisPt, axisPhiMod}}); + registry.add("QA/after/hPhi_Eta_vz", "", {HistType::kTH3D, {axisPhi, axisEta, axisVz}}); + registry.add("QA/after/hDCAxy", "", {HistType::kTH1D, {axisDCAxy}}); + registry.add("QA/after/hDCAz", "", {HistType::kTH1D, {axisDCAz}}); + + // track properties per centrality and per eta, pt bin + registry.add("uxqxA_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("uyqyA_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("uxqxC_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("uyqyC_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("v1A_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("v1C_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("v1Full_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + + registry.add("uxqxA_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("uyqyA_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("uxqxC_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("uyqyC_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("v1A_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("v1C_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("v1Full_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + + registry.add("uxqxA_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("uyqyA_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("uxqxC_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("uyqyC_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("v1A_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("v1C_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("v1Full_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + + registry.add("qAqCX", "", kTProfile, {axisCent}); + registry.add("qAqCY", "", kTProfile, {axisCent}); + registry.add("qAqCXY", "", kTProfile, {axisCent}); registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{11, 0, 11}}}); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(1, "Filtered event"); @@ -283,13 +309,38 @@ struct FlowSP { phimodn += o2::constants::math::PI / 18.0; // to center gap in the middle phimodn = fmod(phimodn, o2::constants::math::PI / 9.0); - registry.fill(HIST("pt_phi_bef"), track.pt(), phimodn); + registry.fill(HIST("QA/after/pt_phi_bef"), track.pt(), phimodn); if (phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt())) return false; // reject track - registry.fill(HIST("pt_phi_aft"), track.pt(), phimodn); + registry.fill(HIST("QA/after/pt_phi_aft"), track.pt(), phimodn); return true; } + template + inline void fillEventQA(CollisionObject collision, TracksObject tracks, bool before) + { + if (before) { + registry.fill(HIST("QA/before/hCent"), collision.centFT0C()); + registry.fill(HIST("QA/before/globalTracks_centT0C"), collision.centFT0C(), tracks.size()); + registry.fill(HIST("QA/before/PVTracks_centT0C"), collision.centFT0C(), collision.multNTracksPV()); + registry.fill(HIST("QA/before/globalTracks_PVTracks"), collision.multNTracksPV(), tracks.size()); + registry.fill(HIST("QA/before/globalTracks_multT0A"), collision.multFT0A(), tracks.size()); + registry.fill(HIST("QA/before/globalTracks_multV0A"), collision.multFV0A(), tracks.size()); + registry.fill(HIST("QA/before/multV0A_multT0A"), collision.multFT0A(), collision.multFV0A()); + registry.fill(HIST("QA/before/multT0C_centT0C"), collision.centFT0C(), collision.multFT0C()); + } else { + registry.fill(HIST("QA/after/hCent"), collision.centFT0C()); + registry.fill(HIST("QA/after/globalTracks_centT0C"), collision.centFT0C(), tracks.size()); + registry.fill(HIST("QA/after/PVTracks_centT0C"), collision.centFT0C(), collision.multNTracksPV()); + registry.fill(HIST("QA/after/globalTracks_PVTracks"), collision.multNTracksPV(), tracks.size()); + registry.fill(HIST("QA/after/globalTracks_multT0A"), collision.multFT0A(), tracks.size()); + registry.fill(HIST("QA/after/globalTracks_multV0A"), collision.multFV0A(), tracks.size()); + registry.fill(HIST("QA/after/multV0A_multT0A"), collision.multFT0A(), collision.multFV0A()); + registry.fill(HIST("QA/after/multT0C_centT0C"), collision.centFT0C(), collision.multFT0C()); + } + return; + } + void process(UsedCollisions::iterator const& collision, aod::BCsWithTimestamps const&, UsedTracks const& tracks) { // Hier sum over collisions and get ZDC data. @@ -307,10 +358,13 @@ struct FlowSP { if (!eventSelected(collision, tracks.size(), centrality)) return; + fillEventQA(collision, tracks, true); + if (collision.isSelected()) { + registry.fill(HIST("hEventCount"), 10.5); - registry.fill(HIST("hCent"), centrality); + fillEventQA(collision, tracks, false); double qxA = collision.qxA(); double qyA = collision.qyA(); @@ -323,94 +377,80 @@ struct FlowSP { double psiC = 1.0 * std::atan2(qyC, qxC); registry.fill(HIST("hSPplaneC"), psiC, 1); - registry.fill(HIST("hSPplaneA-C"), psiA - psiC, 1); + // https://twiki.cern.ch/twiki/pub/ALICE/DirectedFlowAnalysisNote/v1_ZDC_ALICE_INT_NOTE_version02.pdf + double psiFull = 1.0 * std::atan2(qyA + qyC, qxA + qxC); + registry.fill(HIST("hSPplaneFull"), psiFull, 1); - registry.fill(HIST("hCosdPhi"), centrality, std::cos(psiA - psiC)); - if (std::cos(psiA - psiC) < 0) - registry.fill(HIST("hSPlaneRes"), centrality, std::sqrt(-1. * std::cos(psiA - psiC))); + registry.fill(HIST("hCosPhiACosPhiC"), centrality, std::cos(psiA) * std::cos(psiC)); + registry.fill(HIST("hSinPhiASinPhiC"), centrality, std::sin(psiA) * std::sin(psiC)); + registry.fill(HIST("hSinPhiACosPhiC"), centrality, std::sin(psiA) * std::cos(psiC)); + registry.fill(HIST("hCosPhiASinsPhiC"), centrality, std::cos(psiA) * std::sin(psiC)); - registry.fill(HIST("hSindPhi"), centrality, std::sin(psiA - psiC)); + if (std::cos(psiA) - std::cos(psiC) < 0) + registry.fill(HIST("hFullEvPlaneRes"), centrality, std::sqrt(-2. * (std::cos(psiA) - std::cos(psiC)))); - auto qxAqxC = qxA * qxC; - auto qyAqyC = qyA * qyC; + registry.fill(HIST("qAqCXY"), centrality, qxA * qxC + qyA * qyC); + registry.fill(HIST("qAqCX"), centrality, qxA * qxC); + registry.fill(HIST("qAqCY"), centrality, qyA * qyC); for (const auto& track : tracks) { if (!trackSelected(track, field)) continue; - bool pos; if (track.sign() == 0.0) continue; - if (track.sign() > 0) { - pos = true; - } else { - pos = false; - } + bool pos = (track.sign() > 0) ? true : false; // constrain angle to 0 -> [0,0+2pi] auto phi = RecoDecay::constrainAngle(track.phi(), 0); + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - auto ux = std::cos(phi); auto uy = std::sin(phi); + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // auto uxQxA = ux * qxA; - // auto uyQyA = uy * qyA; - // auto uxyQxyA = uxQxA + uyQyA; - // auto uxQxC = ux * qxC; - // auto uyQyC = uy * qyC; - // auto uxyQxyC = uxQxC + uyQyC; + double uxqxA = ux * qxA; + double uyqyA = uy * qyA; - auto oddv1 = ux * (qxA - qxC) + uy * (qyA - qyC); - auto evenv1 = ux * (qxA + qxC) + uy * (qyA + qyC); + registry.fill(HIST("uxqxA_eta_pt"), track.eta(), track.pt(), centrality, uxqxA); + registry.fill(HIST("uyqyA_eta_pt"), track.eta(), track.pt(), centrality, uyqyA); - auto oddv1Dev = ux * (qxA - qxC) / std::sqrt(std::abs(qxAqxC)) + uy * (qyA - qyC) / std::sqrt(std::abs(qyAqyC)); - auto evenv1Dev = ux * (qxA + qxC) / std::sqrt(std::abs(qxAqxC)) + uy * (qyA + qyC) / std::sqrt(std::abs(qyAqyC)); + double uxqxC = ux * qxC; + double uyqyC = uy * qyC; + + registry.fill(HIST("uxqxC_eta_pt"), track.eta(), track.pt(), centrality, uxqxC); + registry.fill(HIST("uyqyC_eta_pt"), track.eta(), track.pt(), centrality, uyqyC); double v1A = std::cos(phi - psiA); double v1C = std::cos(phi - psiC); + double v1Full = std::cos(phi - psiFull); - double v1AC = std::cos(phi - (psiA - psiC)); - - registry.fill(HIST("v1_eta"), track.eta(), track.pt(), (1. / std::sqrt(2)) * (v1A - v1C)); - registry.fill(HIST("v1A_eta"), track.eta(), track.pt(), (v1A)); - registry.fill(HIST("v1C_eta"), track.eta(), track.pt(), (v1C)); - registry.fill(HIST("v1AC_eta"), track.eta(), track.pt(), (v1AC)); - - registry.fill(HIST("v1_eta_odd"), track.eta(), track.pt(), oddv1); - registry.fill(HIST("v1_eta_even"), track.eta(), track.pt(), evenv1); - - registry.fill(HIST("v1_eta_odd_dev"), track.eta(), track.pt(), oddv1Dev); - registry.fill(HIST("v1_eta_even_dev"), track.eta(), track.pt(), evenv1Dev); + registry.fill(HIST("v1A_eta_pt"), track.eta(), track.pt(), centrality, v1A); + registry.fill(HIST("v1C_eta_pt"), track.eta(), track.pt(), centrality, v1C); + registry.fill(HIST("v1Full_eta_pt"), track.eta(), track.pt(), centrality, v1Full); if (pos) { - registry.fill(HIST("v1_eta_odd_pos"), track.eta(), track.pt(), oddv1); - registry.fill(HIST("v1_eta_even_pos"), track.eta(), track.pt(), evenv1); - - registry.fill(HIST("v1_eta_odd_dev_pos"), track.eta(), track.pt(), oddv1Dev); - registry.fill(HIST("v1_eta_even_dev_pos"), track.eta(), track.pt(), evenv1Dev); + registry.fill(HIST("uxqxA_eta_pt_pos"), track.eta(), track.pt(), centrality, uxqxA); + registry.fill(HIST("uyqyA_eta_pt_pos"), track.eta(), track.pt(), centrality, uyqyA); + registry.fill(HIST("uxqxC_eta_pt_pos"), track.eta(), track.pt(), centrality, uxqxC); + registry.fill(HIST("uyqyC_eta_pt_pos"), track.eta(), track.pt(), centrality, uyqyC); + registry.fill(HIST("v1A_eta_pt_pos"), track.eta(), track.pt(), centrality, v1A); + registry.fill(HIST("v1C_eta_pt_pos"), track.eta(), track.pt(), centrality, v1C); + registry.fill(HIST("v1Full_eta_pt_pos"), track.eta(), track.pt(), centrality, v1Full); } else { - registry.fill(HIST("v1_eta_odd_neg"), track.eta(), track.pt(), oddv1); - registry.fill(HIST("v1_eta_even_neg"), track.eta(), track.pt(), evenv1); - - registry.fill(HIST("v1_eta_odd_dev_neg"), track.eta(), track.pt(), oddv1Dev); - registry.fill(HIST("v1_eta_even_dev_neg"), track.eta(), track.pt(), evenv1Dev); + registry.fill(HIST("uxqxA_eta_pt_neg"), track.eta(), track.pt(), centrality, uxqxA); + registry.fill(HIST("uyqyA_eta_pt_neg"), track.eta(), track.pt(), centrality, uyqyA); + registry.fill(HIST("uxqxC_eta_pt_neg"), track.eta(), track.pt(), centrality, uxqxC); + registry.fill(HIST("uyqyC_eta_pt_neg"), track.eta(), track.pt(), centrality, uyqyC); + registry.fill(HIST("v1A_eta_pt_neg"), track.eta(), track.pt(), centrality, v1A); + registry.fill(HIST("v1C_eta_pt_neg"), track.eta(), track.pt(), centrality, v1C); + registry.fill(HIST("v1Full_eta_pt_neg"), track.eta(), track.pt(), centrality, v1Full); } - - double v2A = std::cos(2 * (phi - psiA)); - double v2C = std::cos(2 * (phi - psiC)); - double v2AC = std::cos(2 * (phi - (psiA - psiC))); - - registry.fill(HIST("v2_cent"), centrality, track.pt(), (1. / std::sqrt(2)) * (v2A - v2C)); - registry.fill(HIST("v2A_cent"), centrality, track.pt(), (v2A)); - registry.fill(HIST("v2C_cent"), centrality, track.pt(), (v2C)); - registry.fill(HIST("v2AC_cent"), centrality, track.pt(), (v2AC)); + // QA plots + registry.fill(HIST("QA/after/hPhi_Eta_vz"), track.phi(), track.eta(), collision.posZ()); + registry.fill(HIST("QA/after/hDCAxy"), track.dcaXY()); + registry.fill(HIST("QA/after/hDCAz"), track.dcaZ()); } - - float qIm = collision.qvecIm()[0]; - float qRe = collision.qvecRe()[0]; - - registry.fill(HIST("hqIm"), qIm); - registry.fill(HIST("hqRe"), qRe); } } }; From 893bec2dbbe8e5dfee1fe35ab4635f7b8a254bf0 Mon Sep 17 00:00:00 2001 From: EmilGorm <50658075+EmilGorm@users.noreply.github.com> Date: Wed, 11 Dec 2024 23:10:35 +0100 Subject: [PATCH 345/459] [PWGCF] Added PID, Added RBR NUA (#8938) Co-authored-by: Emil Gorm Nielsen --- .../GenericFramework/Core/FlowPtContainer.cxx | 5 +- PWGCF/GenericFramework/Core/FlowPtContainer.h | 1 + .../Tasks/flowGenericFramework.cxx | 572 ++++++++++++++---- 3 files changed, 459 insertions(+), 119 deletions(-) diff --git a/PWGCF/GenericFramework/Core/FlowPtContainer.cxx b/PWGCF/GenericFramework/Core/FlowPtContainer.cxx index 239107ce0ad..70bb53206bb 100644 --- a/PWGCF/GenericFramework/Core/FlowPtContainer.cxx +++ b/PWGCF/GenericFramework/Core/FlowPtContainer.cxx @@ -10,6 +10,9 @@ // or submit itself to any jurisdiction. #include "FlowPtContainer.h" +#include +#include +#include FlowPtContainer::FlowPtContainer() : TNamed("name", "name"), fCMTermList(0), @@ -796,7 +799,7 @@ void FlowPtContainer::RebinMulti(Int_t nbins, Double_t* binedges) } TH1* FlowPtContainer::getCorrHist(int ind, int m) { - return dynamic_cast(fCorrList->FindObject(Form("mpt%i", m + 1)))->getHist(ind); + return dynamic_cast(fCorrList->FindObject(Form("mpt%i", m)))->getHist(ind); } TH1* FlowPtContainer::getCentralMomentHist(int ind, int m) { diff --git a/PWGCF/GenericFramework/Core/FlowPtContainer.h b/PWGCF/GenericFramework/Core/FlowPtContainer.h index 5455859cf05..5b1006017f7 100644 --- a/PWGCF/GenericFramework/Core/FlowPtContainer.h +++ b/PWGCF/GenericFramework/Core/FlowPtContainer.h @@ -78,6 +78,7 @@ class FlowPtContainer : public TNamed void SetUseCentralMoments(bool newval) { fUseCentralMoments = newval; } void SetUseGapMethod(bool newval) { fUseGap = newval; } bool usesCentralMoments() { return fUseCentralMoments; } + bool usesGap() { return fUseGap; } void RebinMulti(Int_t nbins); void RebinMulti(Int_t nbins, double* binedges); TH1* getCentralMomentHist(int ind, int m); diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index d9b969ffbf6..2278333a5d0 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -16,6 +16,7 @@ #include #include #include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -28,6 +29,7 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/PIDResponse.h" #include "GFWPowerArray.h" #include "GFW.h" @@ -49,11 +51,7 @@ using namespace o2::analysis; namespace o2::analysis::genericframework { -std::vector ptbinning = { - 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, - 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, - 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, - 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}; +std::vector ptbinning = {0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}; float ptpoilow = 0.2, ptpoiup = 10.0; float ptreflow = 0.2, ptrefup = 3.0; float ptlow = 0.2, ptup = 10.0; @@ -81,10 +79,12 @@ struct GenericFramework { O2_DEFINE_CONFIGURABLE(cfgMpar, int, 8, "Highest order of pt-pt correlations") O2_DEFINE_CONFIGURABLE(cfgUseNch, bool, false, "Do correlations as function of Nch") O2_DEFINE_CONFIGURABLE(cfgFillWeights, bool, false, "Fill NUA weights") + O2_DEFINE_CONFIGURABLE(cfgRunByRunWeights, bool, false, "Use run by run NUA corrections") O2_DEFINE_CONFIGURABLE(cfgFillQA, bool, false, "Fill QA histograms") O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, false, "Use additional event cut on mult correlations") O2_DEFINE_CONFIGURABLE(cfgUseAdditionalTrackCut, bool, false, "Use additional track cut on phi") O2_DEFINE_CONFIGURABLE(cfgUseCentralMoments, bool, true, "Use central moments in vn-pt calculations") + O2_DEFINE_CONFIGURABLE(cfgUsePID, bool, true, "Enable PID information") O2_DEFINE_CONFIGURABLE(cfgUseGapMethod, bool, false, "Use gap method in vn-pt calculations") O2_DEFINE_CONFIGURABLE(cfgEfficiency, std::string, "", "CCDB path to efficiency object") O2_DEFINE_CONFIGURABLE(cfgAcceptance, std::string, "", "CCDB path to acceptance object") @@ -96,6 +96,14 @@ struct GenericFramework { O2_DEFINE_CONFIGURABLE(cfgEta, float, 0.8, "eta cut"); O2_DEFINE_CONFIGURABLE(cfgEtaPtPt, float, 0.4, "eta cut for pt-pt correlations"); O2_DEFINE_CONFIGURABLE(cfgVtxZ, float, 10, "vertex cut (cm)"); + O2_DEFINE_CONFIGURABLE(cfgOccupancySelection, int, -999, "Max occupancy selection, -999 to disable"); + O2_DEFINE_CONFIGURABLE(cfgNoSameBunchPileupCut, bool, true, "kNoSameBunchPileupCut"); + O2_DEFINE_CONFIGURABLE(cfgIsGoodZvtxFT0vsPV, bool, true, "kIsGoodZvtxFT0vsPV"); + O2_DEFINE_CONFIGURABLE(cfgNoCollInTimeRangeStandard, bool, true, "kNoCollInTimeRangeStandard"); + O2_DEFINE_CONFIGURABLE(cfgDoOccupancySel, bool, true, "Bool for event selection on detector occupancy"); + O2_DEFINE_CONFIGURABLE(cfgMultCut, bool, true, "Use additional evenr cut on mult correlations"); + O2_DEFINE_CONFIGURABLE(cfgTVXinTRD, bool, true, "Use kTVXinTRD (reject TRD triggered events)"); + O2_DEFINE_CONFIGURABLE(cfgIsVertexITSTPC, bool, true, "Selects collisions with at least one ITS-TPC track"); O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried"); Configurable cfgGFWBinning{"cfgGFWBinning", {40, 16, 72, 300, 0, 3000, 0.2, 10.0, 0.2, 3.0, {0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}, {0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}}, "Configuration for binning"}; @@ -109,7 +117,7 @@ struct GenericFramework { struct Config { TH1D* mEfficiency = nullptr; - GFWWeights* mAcceptance = nullptr; + std::vector mAcceptance; bool correctionsLoaded = false; } cfg; @@ -117,7 +125,7 @@ struct GenericFramework { OutputObj fFC{FlowContainer("FlowContainer")}; OutputObj fFCpt{FlowPtContainer("FlowPtContainer")}; OutputObj fFC_gen{FlowContainer("FlowContainer_gen")}; - OutputObj fWeights{GFWWeights("weights")}; + OutputObj fWeightList{"WeightList", OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry registry{"registry"}; // define global variables @@ -125,6 +133,7 @@ struct GenericFramework { std::vector corrconfigs; TRandom3* fRndm = new TRandom3(0); TAxis* fPtAxis; + int lastRun = 0; // Event selection cuts - Alex TF1* fPhiCutLow = nullptr; @@ -195,28 +204,66 @@ struct GenericFramework { int ptbins = ptbinning.size() - 1; fPtAxis = new TAxis(ptbins, &ptbinning[0]); - if (cfgFillWeights) { - fWeights->SetPtBins(ptbins, &ptbinning[0]); - fWeights->Init(true, false); + TList* weightlist = new TList(); + weightlist->SetOwner(true); + fWeightList.setObject(weightlist); + + if (!cfgRunByRunWeights && cfgFillWeights) { + if (cfgUsePID) { + std::vector weights; + std::vector species = {"ref", "ch", "pi", "ka", "pr"}; + for (size_t i = 0; i < species.size(); ++i) { + weights.push_back(new GFWWeights(Form("w_%s", species[i].c_str()))); + if (i == 0) { + auto it = std::find(ptbinning.begin(), ptbinning.end(), ptrefup); + std::vector refpt(ptbinning.begin(), it + 1); + weights[i]->SetPtBins(refpt.size() - 1, &refpt[0]); + } else { + weights[i]->SetPtBins(fPtAxis->GetNbins(), &ptbinning[0]); + } + weights[i]->Init(true, false); + fWeightList->Add(weights[i]); + } + } else { + GFWWeights* weight = new GFWWeights("w_ch"); + weight->SetPtBins(fPtAxis->GetNbins(), &ptbinning[0]); + weight->Init(true, false); + fWeightList->Add(weight); + } } if (doprocessMCGen) { - registry.add("pt_gen", "", {HistType::kTH1D, {ptAxis}}); - registry.add("phi_eta_vtxZ_gen", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registry.add("MCGen/before/pt_gen", "", {HistType::kTH1D, {ptAxis}}); + registry.add("MCGen/before/phi_eta_vtxZ_gen", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registry.addClone("MCGen/before/", "MCGen/after/"); } if (doprocessMCReco || doprocessData || doprocessRun2) { - registry.add("phi_eta_vtxZ", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); - registry.add("pt_dcaXY_dcaZ", "", {HistType::kTH3D, {ptAxis, dcaXYAXis, dcaZAXis}}); - registry.add("pt_phi_bef", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); - registry.add("pt_phi_aft", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); - registry.add("phi_eta_vtxZ_corrected", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); - registry.add("globalTracks_centT0C", "", {HistType::kTH2D, {centAxis, nchAxis}}); - registry.add("PVTracks_centT0C", "", {HistType::kTH2D, {centAxis, multpvAxis}}); - registry.add("globalTracks_PVTracks", "", {HistType::kTH2D, {multpvAxis, nchAxis}}); - registry.add("globalTracks_multT0A", "", {HistType::kTH2D, {t0aAxis, nchAxis}}); - registry.add("globalTracks_multV0A", "", {HistType::kTH2D, {t0aAxis, nchAxis}}); - registry.add("multV0A_multT0A", "", {HistType::kTH2D, {t0aAxis, t0aAxis}}); - registry.add("multT0C_centT0C", "", {HistType::kTH2D, {centAxis, t0cAxis}}); + registry.add("trackQA/before/phi_eta_vtxZ", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registry.add("trackQA/before/pt_dcaXY_dcaZ", "", {HistType::kTH3D, {ptAxis, dcaXYAXis, dcaZAXis}}); + registry.add("trackQA/before/pt_phi", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); + registry.addClone("trackQA/before/", "trackQA/after/"); + registry.add("trackQA/after/pt_ref", "", {HistType::kTH1D, {{100, ptreflow, ptrefup}}}); + registry.add("trackQA/after/pt_poi", "", {HistType::kTH1D, {{100, ptpoilow, ptpoiup}}}); + + registry.add("eventQA/before/globalTracks_centT0C", "", {HistType::kTH2D, {centAxis, nchAxis}}); + registry.add("eventQA/before/PVTracks_centT0C", "", {HistType::kTH2D, {centAxis, multpvAxis}}); + registry.add("eventQA/before/globalTracks_PVTracks", "", {HistType::kTH2D, {multpvAxis, nchAxis}}); + registry.add("eventQA/before/globalTracks_multT0A", "", {HistType::kTH2D, {t0aAxis, nchAxis}}); + registry.add("eventQA/before/globalTracks_multV0A", "", {HistType::kTH2D, {t0aAxis, nchAxis}}); + registry.add("eventQA/before/multV0A_multT0A", "", {HistType::kTH2D, {t0aAxis, t0aAxis}}); + registry.add("eventQA/before/multT0C_centT0C", "", {HistType::kTH2D, {centAxis, t0cAxis}}); + registry.addClone("eventQA/before/", "eventQA/after/"); + registry.add("eventQA/eventSel", "Number of Events;; Counts", {HistType::kTH1D, {{10, 0, 10}}}); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(1, "Filtered event"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(2, "sel8"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(3, "occupancy"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(4, "kTVXinTRD"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(5, "kNoSameBunchPileup"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(6, "kIsGoodZvtxFT0vsPV"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(7, "kNoCollInTimeRangeStandard"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(8, "kIsVertexITSTPC"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(9, "after Mult cuts"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(10, "has track + within cent"); } if (regions.GetSize() < 0) @@ -279,6 +326,13 @@ struct GenericFramework { } } + static constexpr std::string_view moment[] = {"before/", "after/"}; + + enum QAFillTime { + kBefore, + kAfter + }; + void AddConfigObjectsToObjArray(TObjArray* oba, const std::vector& configs) { for (auto it = configs.begin(); it != configs.end(); ++it) { @@ -311,50 +365,173 @@ struct GenericFramework { return grpo->getNominalL3Field(); } - void loadCorrections(uint64_t timestamp) + void loadCorrections(aod::BCsWithTimestamps::iterator const& bc) { - if (cfg.correctionsLoaded) - return; - if (cfgAcceptance.value.empty() == false) { - cfg.mAcceptance = ccdb->getForTimeStamp(cfgAcceptance, timestamp); - if (cfg.mAcceptance) - LOGF(info, "Loaded acceptance weights from %s (%p)", cfgAcceptance.value.c_str(), (void*)cfg.mAcceptance); - else - LOGF(warning, "Could not load acceptance weights from %s (%p)", cfgAcceptance.value.c_str(), (void*)cfg.mAcceptance); + uint64_t timestamp = bc.timestamp(); + int run = bc.runNumber(); + if (cfg.correctionsLoaded) { + if (!cfgRunByRunWeights) + return; + if (run == lastRun) + return; + } + if (cfgUsePID) { + if (cfgAcceptance.value.empty() == false) { + if (cfgRunByRunWeights) { // run-by-run NUA weights from ccdb, stored in TList to hold PID weights + TList* weightlist = ccdb->getForTimeStamp(cfgAcceptance, timestamp); + cfg.mAcceptance.push_back(dynamic_cast(weightlist->FindObject(Form("w%i_ref", run)))); + cfg.mAcceptance.push_back(dynamic_cast(weightlist->FindObject(Form("w%i_ch", run)))); + cfg.mAcceptance.push_back(dynamic_cast(weightlist->FindObject(Form("w%i_pi", run)))); + cfg.mAcceptance.push_back(dynamic_cast(weightlist->FindObject(Form("w%i_ka", run)))); + cfg.mAcceptance.push_back(dynamic_cast(weightlist->FindObject(Form("w%i_pr", run)))); + } else { // run-averaged weights, stored in TList to hold PID weights + TList* weightlist = ccdb->getForTimeStamp(cfgAcceptance, timestamp); + weightlist->ls(); + cfg.mAcceptance.push_back(dynamic_cast(weightlist->FindObject("weights_ref"))); + cfg.mAcceptance.push_back(dynamic_cast(weightlist->FindObject("weights_ch"))); + cfg.mAcceptance.push_back(dynamic_cast(weightlist->FindObject("weights_pi"))); + cfg.mAcceptance.push_back(dynamic_cast(weightlist->FindObject("weights_ka"))); + cfg.mAcceptance.push_back(dynamic_cast(weightlist->FindObject("weights_pr"))); + } + if (!cfg.mAcceptance.empty()) + LOGF(info, "Loaded acceptance weights from %s", cfgAcceptance.value.c_str()); + else + LOGF(warning, "Could not load acceptance weights from %s", cfgAcceptance.value.c_str()); + } + } else { + if (cfgAcceptance.value.empty() == false) { + if (cfgRunByRunWeights) { // run-by-run NUA weights from ccdb, stored in TList + TList* weightlist = ccdb->getForTimeStamp(cfgAcceptance, timestamp); + cfg.mAcceptance.push_back(dynamic_cast(weightlist->FindObject(Form("w%i_ch", run)))); + } else { // run-averaged weights, stored in TList + TList* weightlist = ccdb->getForTimeStamp(cfgAcceptance, timestamp); + cfg.mAcceptance.push_back(dynamic_cast(weightlist->FindObject("w_ch"))); + } + if (!cfg.mAcceptance.empty()) + LOGF(info, "Loaded acceptance weights from %s", cfgAcceptance.value.c_str()); + else + LOGF(warning, "Could not load acceptance weights from %s", cfgAcceptance.value.c_str()); + } } if (cfgEfficiency.value.empty() == false) { cfg.mEfficiency = ccdb->getForTimeStamp(cfgEfficiency, timestamp); if (cfg.mEfficiency == nullptr) { - LOGF(fatal, "Could not load efficiency histogram for trigger particles from %s", cfgEfficiency.value.c_str()); + LOGF(fatal, "Could not load efficiency histogram from %s", cfgEfficiency.value.c_str()); } LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgEfficiency.value.c_str(), (void*)cfg.mEfficiency); } cfg.correctionsLoaded = true; } - bool setCurrentParticleWeights(float& weight_nue, float& weight_nua, const float& phi, const float& eta, const float& pt, const float& vtxz) - { - float eff = 1.; + template + double getAcceptance(TTrack track, const double& vtxz, int index) + { //-1 ref, 0 ch, 1 pi, 2 ka, 3 pr + double wacc = 1; + index += 1; + if (!cfg.mAcceptance.empty()) { + if (cfgUsePID) { + wacc = cfg.mAcceptance[index]->GetNUA(track.phi(), track.eta(), vtxz); + } else { + wacc = cfg.mAcceptance[0]->GetNUA(track.phi(), track.eta(), vtxz); + } + } + return wacc; + } + + template + double getEfficiency(TTrack track) + { //-1 ref, 0 ch, 1 pi, 2 ka, 3 pr + double eff = 1.; if (cfg.mEfficiency) - eff = cfg.mEfficiency->GetBinContent(cfg.mEfficiency->FindBin(pt)); - else - eff = 1.0; + eff = cfg.mEfficiency->GetBinContent(cfg.mEfficiency->FindBin(track.pt())); if (eff == 0) - return false; - weight_nue = 1. / eff; - if (cfg.mAcceptance) - weight_nua = cfg.mAcceptance->GetNUA(phi, eta, vtxz); + return -1.; else - weight_nua = 1; - return true; + return 1. / eff; + } + // Obsolete for now untill service wagons get added + /* template + int getBayesPIDIndex(TTrack track) { + float maxProb[3] = {0.95,0.85,0.85}; + int pidID = 0; + if(track.bayesID()==o2::track::PID::Pion || track.bayesID()==o2::track::PID::Kaon || track.bayesID()==o2::track::PID::Proton){ + pidID = track.bayesID()-1; //Realign + float nsigmaTPC[3] = {track.tpcNSigmaPi(),track.tpcNSigmaKa(),track.tpcNSigmaPr()}; + float nsigmaTOF[3] = {track.tofNSigmaPi(),track.tofNSigmaKa(),track.tofNSigmaPr()}; + if(track.bayesProb() > maxProb[pidID-1]) { + if(abs(nsigmaTPC[pidID-1]) > 3) return 0; + if(abs(nsigmaTOF[pidID-1]) > 3) return 0; + return pidID; + } + else return 0; + } + return 0; + } */ + + template + int GetNsigmaPID(TTrack track) + { + // Computing Nsigma arrays for pion, kaon, and protons + std::array nSigmaTPC = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; + std::array nSigmaCombined = {std::hypot(track.tpcNSigmaPi(), track.tofNSigmaPi()), std::hypot(track.tpcNSigmaKa(), track.tofNSigmaKa()), std::hypot(track.tpcNSigmaPr(), track.tofNSigmaPr())}; + int pid = -1; + float nsigma = 3.0; + + // Choose which nSigma to use + std::array nSigmaToUse = (track.pt() > 0.4 && track.hasTOF()) ? nSigmaCombined : nSigmaTPC; + + // Select particle with the lowest nsigma + for (int i = 0; i < 3; ++i) { + if (std::abs(nSigmaToUse[i]) < nsigma) { + pid = i; + nsigma = std::abs(nSigmaToUse[i]); + } + } + return pid + 1; // shift the pid by 1, 1 = pion, 2 = kaon, 3 = proton } template bool eventSelected(TCollision collision, const int& multTrk, const float& centrality) { - if (collision.alias_bit(kTVXinTRD)) { - // TRD triggered - return 0; + if (cfgTVXinTRD) { + if (collision.alias_bit(kTVXinTRD)) { + // TRD triggered + // "CMTVX-B-NOPF-TRD,minbias_TVX" + return 0; + } + registry.fill(HIST("eventQA/eventSel"), 3.5); + } + + if (cfgNoSameBunchPileupCut) { + if (!collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + // rejects collisions which are associated with the same "found-by-T0" bunch crossing + // https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof + return 0; + } + registry.fill(HIST("eventQA/eventSel"), 4.5); + } + if (cfgIsGoodZvtxFT0vsPV) { + if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + // removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference + // use this cut at low multiplicities with caution + return 0; + } + registry.fill(HIST("eventQA/eventSel"), 5.5); + } + if (cfgNoCollInTimeRangeStandard) { + if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + // Rejection of the collisions which have other events nearby + return 0; + } + registry.fill(HIST("eventQA/eventSel"), 6.5); + } + + if (cfgIsVertexITSTPC) { + if (!collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + // selects collisions with at least one ITS-TPC track, and thus rejects vertices built from ITS-only tracks + return 0; + } + registry.fill(HIST("eventQA/eventSel"), 7.5); } float vtxz = -999; if (collision.numContrib() > 1) { @@ -378,7 +555,7 @@ struct GenericFramework { return 0; if (multTrk > fMultCutHigh->Eval(centrality)) return 0; - + registry.fill(HIST("eventQA/eventSel"), 8.5); /* 22s if (multNTracksPV < fMultPVCutLow->Eval(centrality)) return 0; @@ -407,10 +584,12 @@ struct GenericFramework { phimodn += TMath::Pi() / 18.0; // to center gap in the middle phimodn = fmod(phimodn, TMath::Pi() / 9.0); - registry.fill(HIST("pt_phi_bef"), track.pt(), phimodn); + if (cfgFillQA) + registry.fill(HIST("trackQA/before/pt_phi"), track.pt(), phimodn); if (phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt())) return false; // reject track - registry.fill(HIST("pt_phi_aft"), track.pt(), phimodn); + if (cfgFillQA) + registry.fill(HIST("trackQA/after/pt_phi"), track.pt(), phimodn); return true; } @@ -419,6 +598,62 @@ struct GenericFramework { kGen }; + template + void FillWeights(const TTrack track, const double vtxz, const double multcent, int pid_index) + { + if (cfgUsePID) { + std::vector species = {"ref", "ch", "pi", "ka", "pr"}; + double ptpidmins[] = {ptpoilow, ptpoilow, 0.3, 0.5}; // min pt for ch, pi, ka, pr + double ptpidmaxs[] = {ptpoiup, ptpoiup, 6.0, 6.0}; // max pt for ch, pi, ka, pr + bool withinPtPOI = (ptpidmins[pid_index] < track.pt()) && (track.pt() < ptpidmaxs[pid_index]); // within POI pT range + bool withinPtRef = (ptreflow < track.pt()) && (track.pt() < ptrefup); // within RF pT range + if (cfgRunByRunWeights) { + if (withinPtRef && !pid_index) + dynamic_cast(fWeightList->FindObject(Form("w%i_%s", lastRun, species[pid_index].c_str())))->Fill(track.phi(), track.eta(), vtxz, track.pt(), multcent, 0); // pt-subset of charged particles for ref flow + if (withinPtPOI) + dynamic_cast(fWeightList->FindObject(Form("w%i_%s", lastRun, species[pid_index + 1].c_str())))->Fill(track.phi(), track.eta(), vtxz, track.pt(), multcent, 0); // charged and id'ed particle weights + } else { + if (withinPtRef && !pid_index) + dynamic_cast(fWeightList->FindObject(Form("w_%s", species[pid_index].c_str())))->Fill(track.phi(), track.eta(), vtxz, track.pt(), multcent, 0); // pt-subset of charged particles for ref flow + if (withinPtPOI) + dynamic_cast(fWeightList->FindObject(Form("w_%s", species[pid_index + 1].c_str())))->Fill(track.phi(), track.eta(), vtxz, track.pt(), multcent, 0); // charged and id'ed particle weights + } + } else { + if (cfgRunByRunWeights) + dynamic_cast(fWeightList->FindObject(Form("w%i_ch", lastRun)))->Fill(track.phi(), track.eta(), vtxz, track.pt(), multcent, 0); + else + dynamic_cast(fWeightList->FindObject("w_ch"))->Fill(track.phi(), track.eta(), vtxz, track.pt(), multcent, 0); + } + return; + } + + void CreateRunByRunWeights() + { + if (cfgUsePID) { + std::vector weights; + std::vector species = {"ref", "ch", "pi", "ka", "pr"}; + for (size_t i = 0; i < species.size(); ++i) { + weights.push_back(new GFWWeights(Form("w%i_%s", lastRun, species[i].c_str()))); + if (i == 0) { + auto it = std::find(ptbinning.begin(), ptbinning.end(), ptrefup); + std::vector refpt(ptbinning.begin(), it + 1); + weights[i]->SetPtBins(refpt.size() - 1, &refpt[0]); + } else { + weights[i]->SetPtBins(fPtAxis->GetNbins(), &ptbinning[0]); + } + weights[i]->Init(true, false); + fWeightList->Add(weights[i]); + } + } else { + GFWWeights* weight = new GFWWeights(Form("w%i_ch", lastRun)); + weight->SetPtBins(fPtAxis->GetNbins(), &ptbinning[0]); + weight->Init(true, false); + fWeightList->Add(weight); + } + + return; + } + template void FillOutputContainers(const float& centmult, const double& rndm) { @@ -428,10 +663,10 @@ struct GenericFramework { if (!cfgUseGapMethod) fFCpt->FillVnPtStdProfiles(centmult, rndm); for (uint l_ind = 0; l_ind < corrconfigs.size(); ++l_ind) { - auto dnx = fGFW->Calculate(corrconfigs.at(l_ind), 0, kTRUE).real(); - if (dnx == 0) - continue; if (!corrconfigs.at(l_ind).pTDif) { + auto dnx = fGFW->Calculate(corrconfigs.at(l_ind), 0, kTRUE).real(); + if (dnx == 0) + continue; auto val = fGFW->Calculate(corrconfigs.at(l_ind), 0, kFALSE).real() / dnx; if (TMath::Abs(val) < 1) { (dt == kGen) ? fFC_gen->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, dnx, rndm) : fFC->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, dnx, rndm); @@ -441,7 +676,7 @@ struct GenericFramework { continue; } for (Int_t i = 1; i <= fPtAxis->GetNbins(); i++) { - dnx = fGFW->Calculate(corrconfigs.at(l_ind), i - 1, kTRUE).real(); + auto dnx = fGFW->Calculate(corrconfigs.at(l_ind), i - 1, kTRUE).real(); if (dnx == 0) continue; auto val = fGFW->Calculate(corrconfigs.at(l_ind), i - 1, kFALSE).real() / dnx; @@ -459,6 +694,7 @@ struct GenericFramework { return; if (centrality < centbinning.front() || centrality > centbinning.back()) return; + registry.fill(HIST("eventQA/eventSel"), 9.5); float vtxz = collision.posZ(); fGFW->Clear(); fFCpt->ClearVector(); @@ -467,126 +703,216 @@ struct GenericFramework { for (auto& track : tracks) { ProcessTrack(track, centrality, vtxz, field); } - FillOutputContainers
((cfgUseNch) ? tracks.size() : centrality, l_Random); + if (!cfgFillWeights) + FillOutputContainers
((cfgUseNch) ? tracks.size() : centrality, l_Random); } - template - inline void ProcessTrack(TrackObject const& track, const float& centrality, const float& vtxz, const int& field) + template + inline void ProcessTrack(TTrack const& track, const float& centrality, const float& vtxz, const int& field) { - float weff = 1, wacc = 1; - if constexpr (framework::has_type_v) { + if constexpr (framework::has_type_v) { if (track.mcParticleId() < 0 || !(track.has_mcParticle())) return; auto mcParticle = track.mcParticle(); - if (!mcParticle.isPhysicalPrimary() || mcParticle.eta() < etalow || mcParticle.eta() > etaup || mcParticle.pt() < ptlow || mcParticle.pt() > ptup || track.tpcNClsFound() < cfgNcls) + if (!mcParticle.isPhysicalPrimary()) + return; + if (cfgFillQA) + FillTrackQA(track, vtxz); + + if (mcParticle.eta() < etalow || mcParticle.eta() > etaup || mcParticle.pt() < ptlow || mcParticle.pt() > ptup || track.tpcNClsFound() < cfgNcls) return; if (cfgUseAdditionalTrackCut && !trackSelected(track, field)) return; - if (cfgFillWeights) - fWeights->Fill(mcParticle.phi(), mcParticle.eta(), vtxz, mcParticle.pt(), centrality, 0); + int pid_index = 0; + if (cfgUsePID) { + if (mcParticle.pdgCode() == 211) + pid_index = 1; + if (mcParticle.pdgCode() == 321) + pid_index = 2; + if (mcParticle.pdgCode() == 2212) + pid_index = 3; + } - if (!setCurrentParticleWeights(weff, wacc, mcParticle.phi(), mcParticle.eta(), mcParticle.pt(), vtxz)) - return; + if (cfgFillWeights) { + FillWeights(mcParticle, vtxz, centrality, 0); + } else { + FillPtSums(track, vtxz); + FillGFW(mcParticle, vtxz, pid_index); + } - registry.fill(HIST("phi_eta_vtxZ_corrected"), mcParticle.phi(), mcParticle.eta(), vtxz, wacc); if (cfgFillQA) - FillTrackQA(track, vtxz); + FillTrackQA(track, vtxz); - FillGFW(mcParticle, weff, wacc); - } else if constexpr (framework::has_type_v) { - if (!track.isPhysicalPrimary() || track.eta() < etalow || track.eta() > etaup || track.pt() < ptlow || track.pt() > ptup) + } else if constexpr (framework::has_type_v) { + if (!track.isPhysicalPrimary()) return; - if (cfgFillQA) - FillTrackQA(track, vtxz); + FillTrackQA(track, vtxz); + + if (track.eta() < etalow || track.eta() > etaup || track.pt() < ptlow || track.pt() > ptup) + return; - FillGFW(track, 1., 1.); + int pid_index = 0; + if (cfgUsePID) { + if (track.pdgCode() == 211) + pid_index = 1; + if (track.pdgCode() == 321) + pid_index = 2; + if (track.pdgCode() == 2212) + pid_index = 3; + } + + FillPtSums(track, vtxz); + FillGFW(track, vtxz, pid_index); + + if (cfgFillQA) + FillTrackQA(track, vtxz); } else { + if (cfgFillQA) + FillTrackQA(track, vtxz); if (track.tpcNClsFound() < cfgNcls) return; if (cfgUseAdditionalTrackCut && !trackSelected(track, field)) return; - if (cfgFillWeights) - fWeights->Fill(track.phi(), track.eta(), vtxz, track.pt(), centrality, 0); - - if (!setCurrentParticleWeights(weff, wacc, track.phi(), track.eta(), track.pt(), vtxz)) - return; - - registry.fill(HIST("phi_eta_vtxZ_corrected"), track.phi(), track.eta(), vtxz, wacc); + int pid_index = 0; + if (cfgUsePID) { + // pid_index = getBayesPIDIndex(track); + pid_index = GetNsigmaPID(track); + } + if (cfgFillWeights) { + FillWeights(track, vtxz, centrality, pid_index); + } else { + FillPtSums(track, vtxz); + FillGFW(track, vtxz, pid_index); + } if (cfgFillQA) - FillTrackQA(track, vtxz); - - FillGFW(track, weff, wacc); + FillTrackQA(track, vtxz); } } - template - inline void FillGFW(TrackObject track, float weff, float wacc) + template + inline void FillPtSums(TTrack track, const double& vtxz) { - if (fabs(track.eta()) < cfgEtaPtPt) + double wacc = (dt == kGen) ? 1. : getAcceptance(track, vtxz, -1); + double weff = (dt == kGen) ? 1. : getEfficiency(track); + if (weff < 0) + return; + if (fabs(track.eta()) < cfgEtaPtPt) { fFCpt->Fill(weff, track.pt()); - std::complex q2p = {weff * wacc * cos(2 * track.phi()), weff * wacc * sin(2 * track.phi())}; - std::complex q2n = {weff * wacc * cos(-2 * track.phi()), weff * wacc * sin(-2 * track.phi())}; + } if (!cfgUseGapMethod) { + std::complex q2p = {weff * wacc * cos(2 * track.phi()), weff * wacc * sin(2 * track.phi())}; + std::complex q2n = {weff * wacc * cos(-2 * track.phi()), weff * wacc * sin(-2 * track.phi())}; fFCpt->FillArray(q2p, q2n, weff * track.pt(), weff); fFCpt->FillArray(weff * wacc, weff * wacc, weff, weff); } - bool WithinPtPOI = (ptpoilow < track.pt()) && (track.pt() < ptpoiup); // within POI pT range - bool WithinPtRef = (ptreflow < track.pt()) && (track.pt() < ptrefup); // within RF pT range - if (WithinPtRef) + } + + template + inline void FillGFW(TTrack track, const double& vtxz, int pid_index) + { + if (cfgUsePID) { // Analysing POI flow with id'ed particles + double ptmins[] = {ptpoilow, ptpoilow, 0.3, 0.5}; + double ptmaxs[] = {ptpoiup, ptpoiup, 6.0, 6.0}; + bool WithinPtRef = (track.pt() > ptreflow && track.pt() < ptrefup); + bool WithinPtPOI = (track.pt() > ptmins[pid_index] && track.pt() < ptmaxs[pid_index]); + bool WithinPtNch = (track.pt() > ptmins[0] && track.pt() < ptmaxs[0]); + if (!WithinPtPOI && !WithinPtRef) + return; + double wacc_ref = (dt == kGen) ? 1. : getAcceptance(track, vtxz, -1); + double wacc_poi = (dt == kGen) ? 1. : WithinPtPOI ? getAcceptance(track, vtxz, pid_index) + : getAcceptance(track, vtxz, 0); // + if (WithinPtRef && WithinPtPOI && pid_index) + wacc_ref = wacc_poi; // if particle is both (then it's overlap), override ref with POI + if (WithinPtRef) + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc_ref, 1); + if (WithinPtPOI && pid_index) + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc_poi, (1 << (pid_index + 1))); + if (WithinPtNch) + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc_poi, 2); + if (WithinPtPOI && WithinPtRef && pid_index) + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc_poi, (1 << (pid_index + 5))); + if (WithinPtNch && WithinPtRef) + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc_poi, 32); + } else { // Analysing only integrated flow + double weff = (dt == kGen) ? 1. : getEfficiency(track); + if (weff < 0) + return; + double wacc = (dt == kGen) ? 1. : getAcceptance(track, vtxz, -1); fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, 1); - if (WithinPtPOI) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, 2); - if (WithinPtPOI && WithinPtRef) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, 4); + } return; } - template - inline void FillTrackQA(TrackObject track, const float vtxz) + template + inline void FillTrackQA(TTrack track, const float vtxz) { if constexpr (dt == kGen) { - registry.fill(HIST("phi_eta_vtxZ_gen"), track.phi(), track.eta(), vtxz); - registry.fill(HIST("pt_gen"), track.pt()); + registry.fill(HIST("MCGen/") + HIST(moment[ft]) + HIST("phi_eta_vtxZ_gen"), track.phi(), track.eta(), vtxz); + registry.fill(HIST("MCGen/") + HIST(moment[ft]) + HIST("pt_gen"), track.pt()); } else { - registry.fill(HIST("phi_eta_vtxZ"), track.phi(), track.eta(), vtxz); - registry.fill(HIST("pt_dcaXY_dcaZ"), track.pt(), track.dcaXY(), track.dcaZ()); + double wacc = getAcceptance(track, vtxz, -1); + registry.fill(HIST("trackQA/") + HIST(moment[ft]) + HIST("phi_eta_vtxZ"), track.phi(), track.eta(), vtxz, wacc); + registry.fill(HIST("trackQA/") + HIST(moment[ft]) + HIST("pt_dcaXY_dcaZ"), track.pt(), track.dcaXY(), track.dcaZ()); + if (ft == kAfter) { + registry.fill(HIST("trackQA/") + HIST(moment[ft]) + HIST("pt_ref"), track.pt()); + registry.fill(HIST("trackQA/") + HIST(moment[ft]) + HIST("pt_poi"), track.pt()); + } } } - template + template inline void FillEventQA(CollisionObject collision, TracksObject tracks) { - registry.fill(HIST("globalTracks_centT0C"), collision.centFT0C(), tracks.size()); - registry.fill(HIST("PVTracks_centT0C"), collision.centFT0C(), collision.multNTracksPV()); - registry.fill(HIST("globalTracks_PVTracks"), collision.multNTracksPV(), tracks.size()); - registry.fill(HIST("globalTracks_multT0A"), collision.multFT0A(), tracks.size()); - registry.fill(HIST("globalTracks_multV0A"), collision.multFV0A(), tracks.size()); - registry.fill(HIST("multV0A_multT0A"), collision.multFT0A(), collision.multFV0A()); - registry.fill(HIST("multT0C_centT0C"), collision.centFT0C(), collision.multFT0C()); + registry.fill(HIST("eventQA/") + HIST(moment[ft]) + HIST("globalTracks_centT0C"), collision.centFT0C(), tracks.size()); + registry.fill(HIST("eventQA/") + HIST(moment[ft]) + HIST("PVTracks_centT0C"), collision.centFT0C(), collision.multNTracksPV()); + registry.fill(HIST("eventQA/") + HIST(moment[ft]) + HIST("globalTracks_PVTracks"), collision.multNTracksPV(), tracks.size()); + registry.fill(HIST("eventQA/") + HIST(moment[ft]) + HIST("globalTracks_multT0A"), collision.multFT0A(), tracks.size()); + registry.fill(HIST("eventQA/") + HIST(moment[ft]) + HIST("globalTracks_multV0A"), collision.multFV0A(), tracks.size()); + registry.fill(HIST("eventQA/") + HIST(moment[ft]) + HIST("multV0A_multT0A"), collision.multFT0A(), collision.multFV0A()); + registry.fill(HIST("eventQA/") + HIST(moment[ft]) + HIST("multT0C_centT0C"), collision.centFT0C(), collision.multFT0C()); return; } Filter collisionFilter = nabs(aod::collision::posZ) < cfgVtxZ; Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && nabs(aod::track::dcaXY) < cfgDCAxy&& nabs(aod::track::dcaZ) < cfgDCAz; - using myTracks = soa::Filtered>; + using myTracks = soa::Filtered>; void processData(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, myTracks const& tracks) { + auto bc = collision.bc_as(); + int run = bc.runNumber(); + if (run != lastRun) { + lastRun = run; + if (cfgFillWeights && cfgRunByRunWeights) + CreateRunByRunWeights(); + } + registry.fill(HIST("eventQA/eventSel"), 0.5); if (!collision.sel8()) return; + registry.fill(HIST("eventQA/eventSel"), 1.5); + + if (cfgOccupancySelection != -999) { + int occupancy = collision.trackOccupancyInTimeRange(); + if (occupancy < 0 || occupancy > cfgOccupancySelection) + return; + } + registry.fill(HIST("eventQA/eventSel"), 2.5); const auto centrality = collision.centFT0C(); - auto bc = collision.bc_as(); + + if (cfgFillQA) + FillEventQA(collision, tracks); if (cfgUseAdditionalEventCut && !eventSelected(collision, tracks.size(), centrality)) return; if (cfgFillQA) - FillEventQA(collision, tracks); - loadCorrections(bc.timestamp()); + FillEventQA(collision, tracks); + if (!cfgFillWeights) + loadCorrections(bc); auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; processCollision(collision, tracks, centrality, field); } @@ -594,15 +920,25 @@ struct GenericFramework { void processMCReco(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered> const& tracks, aod::McParticles const&) { + auto bc = collision.bc_as(); + int run = bc.runNumber(); + if (run != lastRun) { + lastRun = run; + if (cfgFillWeights && cfgRunByRunWeights) + CreateRunByRunWeights(); + } if (!collision.sel8()) return; const auto centrality = collision.centFT0C(); - auto bc = collision.bc_as(); + if (cfgFillQA) + FillEventQA(collision, tracks); if (cfgUseAdditionalEventCut && !eventSelected(collision, tracks.size(), centrality)) return; if (cfgFillQA) - FillEventQA(collision, tracks); - loadCorrections(bc.timestamp()); + FillEventQA(collision, tracks); + + if (!cfgFillWeights) + loadCorrections(bc); auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; processCollision(collision, tracks, centrality, field); } @@ -627,7 +963,7 @@ struct GenericFramework { return; const auto centrality = collision.centRun2V0M(); auto bc = collision.bc_as(); - loadCorrections(bc.timestamp()); + loadCorrections(bc); auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; processCollision(collision, tracks, centrality, field); } From d99323ad01a96952f61257224de0cecf62148717 Mon Sep 17 00:00:00 2001 From: JStaa <39123272+JStaa@users.noreply.github.com> Date: Wed, 11 Dec 2024 23:12:46 +0100 Subject: [PATCH 346/459] [PWGCF] Added the full TOF NSigma distribution to the Track QA (#8945) Co-authored-by: ALICE Action Bot --- .../Tasks/ThreeParticleCorrelations.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/PWGCF/MultiparticleCorrelations/Tasks/ThreeParticleCorrelations.cxx b/PWGCF/MultiparticleCorrelations/Tasks/ThreeParticleCorrelations.cxx index fdb4ff9dcca..800ec9fc3b2 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/ThreeParticleCorrelations.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/ThreeParticleCorrelations.cxx @@ -59,7 +59,7 @@ struct ThreePartCorr { using MyFilteredV0s = soa::Filtered; using MyFilteredTracks = soa::Filtered>; + aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr, aod::pidTOFbeta>>; // Table aliases - MC using MyFilteredMCGenCollision = soa::Filtered::iterator; @@ -130,6 +130,10 @@ struct ThreePartCorr { QARegistry.add("hNSigmaKaon", "hNSigmaKaon", {HistType::kTH2D, {{201, -5.025, 5.025}, {201, -5.025, 5.025}}}); QARegistry.add("hNSigmaProton", "hNSigmaProton", {HistType::kTH2D, {{201, -5.025, 5.025}, {201, -5.025, 5.025}}}); + QARegistry.add("hTOFPion", "hTOFPion", {HistType::kTH2D, {{TrackPtAxis}, {1000, -50, 50}}}); + QARegistry.add("hTOFKaon", "hTOFKaon", {HistType::kTH2D, {{TrackPtAxis}, {1000, -50, 50}}}); + QARegistry.add("hTOFProton", "hTOFProton", {HistType::kTH2D, {{TrackPtAxis}, {1000, -50, 50}}}); + QARegistry.add("hInvMassLambda", "hInvMassLambda", {HistType::kTH3D, {{LambdaInvMassAxis}, {V0PtAxis}, {CentralityAxis}}}); QARegistry.add("hInvMassAntiLambda", "hInvMassAntiLambda", {HistType::kTH3D, {{LambdaInvMassAxis}, {V0PtAxis}, {CentralityAxis}}}); @@ -199,6 +203,12 @@ struct ThreePartCorr { // Start of the Track QA for (const auto& track : tracks) { + if (track.hasTOF()) { + QARegistry.fill(HIST("hTOFPion"), track.pt(), track.tofNSigmaPi()); + QARegistry.fill(HIST("hTOFKaon"), track.pt(), track.tofNSigmaKa()); + QARegistry.fill(HIST("hTOFProton"), track.pt(), track.tofNSigmaPr()); + } + A_PID = TrackPID(track); if (A_PID[1] < 4.0) { QARegistry.fill(HIST("hTrackPt"), track.pt()); From 426d2ef99adc30a0611df97163e10f827fd21d8f Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Wed, 11 Dec 2024 23:14:27 +0100 Subject: [PATCH 347/459] [PWGLF] Add rotation background for f1-p correlation + correction term in resonance flow + modified table producer entry for f1-p analysis (#8947) --- .../Resonances/f1protonreducedtable.cxx | 59 +++---- .../Tasks/Resonances/f1protoncorrelation.cxx | 145 ++++++++---------- PWGLF/Tasks/Resonances/phipbpb.cxx | 5 + 3 files changed, 99 insertions(+), 110 deletions(-) diff --git a/PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx b/PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx index 87fcc6ab1d5..50eb1ba4ffd 100644 --- a/PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx +++ b/PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx @@ -513,19 +513,19 @@ struct f1protonreducedtable { std::vector PionCharge = {}; std::vector KaonCharge = {}; std::vector ProtonCharge = {}; - std::vector ProtonChargeFinal = {}; + // std::vector ProtonChargeFinal = {}; // keep TPC PID of proton std::vector ProtonTPCNsigma = {}; - std::vector ProtonTPCNsigmaFinal = {}; + // std::vector ProtonTPCNsigmaFinal = {}; // keep TOF PID of proton std::vector ProtonTOFNsigma = {}; - std::vector ProtonTOFNsigmaFinal = {}; + // std::vector ProtonTOFNsigmaFinal = {}; // keep TOF Hit of proton std::vector ProtonTOFHit = {}; - std::vector ProtonTOFHitFinal = {}; + // std::vector ProtonTOFHitFinal = {}; // keep TOF Hit of pion std::vector PionTOFHit = {}; @@ -542,7 +542,8 @@ struct f1protonreducedtable { std::vector f1signal = {}; // Prepare vectors for different species - std::vector protons, kaons, pions, kshorts, f1resonance, f1resonanced1, f1resonanced2, f1resonanced3, protonsfinal; + std::vector protons, kaons, pions, kshorts, f1resonance, f1resonanced1, f1resonanced2, f1resonanced3; + // , protonsfinal; float kstar = 999.f; currentRunNumber = collision.bc_as().runNumber(); @@ -577,8 +578,8 @@ struct f1protonreducedtable { zorroSelected = true; } if (zorroSelected) { + hProcessedEvents->Fill(1.5); for (auto& track : tracks) { - hProcessedEvents->Fill(1.5); if (!isSelectedTrack(track)) continue; qaRegistry.fill(HIST("hDCAxy"), track.dcaXY()); @@ -746,22 +747,14 @@ struct f1protonreducedtable { numberF1 = numberF1 + 1; for (auto iproton = protons.begin(); iproton != protons.end(); ++iproton) { auto i4 = std::distance(protons.begin(), iproton); - ProtonVectorDummy = protons.at(i4); - if (numberF1 == 1) { - //////////// Fill final proton information after pairing////////// - ROOT::Math::PtEtaPhiMVector temp(ProtonVectorDummy.Pt(), ProtonVectorDummy.Eta(), ProtonVectorDummy.Phi(), massPr); - protonsfinal.push_back(temp); // 4 vector - ProtonChargeFinal.push_back(ProtonCharge.at(i4)); // Charge - ProtonTOFHitFinal.push_back(ProtonTOFHit.at(i4)); // TOF Hit - ProtonTOFNsigmaFinal.push_back(ProtonTOFNsigma.at(i4)); // Nsigma TOF - ProtonTPCNsigmaFinal.push_back(ProtonTPCNsigma.at(i4)); // Nsigma TPC - F1ProtonIndex.push_back(ProtonIndex.at(i4)); // proton index for share track - } - - if ((ProtonIndex.at(i4) == PionIndex.at(i1)) || (ProtonIndex.at(i4) == KaonIndex.at(i2)) || (ProtonIndex.at(i4) == KshortPosDaughIndex.at(i3)) || (ProtonIndex.at(i4) == KshortNegDaughIndex.at(i3))) { + if (ProtonIndex.at(i4) == PionIndex.at(i1)) + continue; + if (ProtonIndex.at(i4) == KaonIndex.at(i2)) + continue; + if (ProtonIndex.at(i4) == KshortPosDaughIndex.at(i3)) + continue; + if (ProtonIndex.at(i4) == KshortNegDaughIndex.at(i3)) continue; - } - kstar = getkstar(F1Vector, *iproton); qaRegistry.fill(HIST("hkstarDist"), kstar); if (kstar > cMaxRelMom) { @@ -769,8 +762,19 @@ struct f1protonreducedtable { } qaRegistry.fill(HIST("hInvMassf1kstar"), F1Vector.M(), F1Vector.Pt(), kstar); keepEventF1Proton = true; + /*ProtonVectorDummy = protons.at(i4); + if (numberF1 == 1 && keepEventF1Proton) { + //////////// Fill final proton information after pairing////////// + ROOT::Math::PtEtaPhiMVector temp(ProtonVectorDummy.Pt(), ProtonVectorDummy.Eta(), ProtonVectorDummy.Phi(), massPr); + protonsfinal.push_back(temp); // 4 vector + ProtonChargeFinal.push_back(ProtonCharge.at(i4)); // Charge + ProtonTOFHitFinal.push_back(ProtonTOFHit.at(i4)); // TOF Hit + ProtonTOFNsigmaFinal.push_back(ProtonTOFNsigma.at(i4)); // Nsigma TOF + ProtonTPCNsigmaFinal.push_back(ProtonTPCNsigma.at(i4)); // Nsigma TPC + F1ProtonIndex.push_back(ProtonIndex.at(i4)); // proton index for share track + }*/ } - } + } // pair sign } } } @@ -782,7 +786,8 @@ struct f1protonreducedtable { qaRegistry.fill(HIST("hEventstat"), 1.5); if (keepEventF1Proton) { qaRegistry.fill(HIST("hEventstat"), 2.5); - auto eventspherocity = ComputeSpherocity(tracks, trackSphMin, trackSphDef); + auto eventspherocity = 0.0; + // ComputeSpherocity(tracks, trackSphMin, trackSphDef); /////////// Fill collision table/////////////// redf1pevents(bc.globalBC(), currentRunNumber, bc.timestamp(), collision.posZ(), collision.numContrib(), eventspherocity); auto indexEvent = redf1pevents.lastIndex(); @@ -796,10 +801,10 @@ struct f1protonreducedtable { f1track(indexEvent, f1signal.at(i5), F1VectorDummy.Px(), F1VectorDummy.Py(), F1VectorDummy.Pz(), F1d1dummy.Px(), F1d1dummy.Py(), F1d1dummy.Pz(), F1d2dummy.Px(), F1d2dummy.Py(), F1d2dummy.Pz(), F1d3dummy.Px(), F1d3dummy.Py(), F1d3dummy.Pz(), PionTOFHitFinal.at(i5), KaonTOFHitFinal.at(i5), F1VectorDummy.M(), f1kaonkshortmass.at(i5), F1PionIndex.at(i5), F1KaonIndex.at(i5), F1KshortDaughterPositiveIndex.at(i5), F1KshortDaughterNegativeIndex.at(i5)); } //// Fill track table for proton////////////////// - for (auto iproton = protonsfinal.begin(); iproton != protonsfinal.end(); ++iproton) { - auto i6 = std::distance(protonsfinal.begin(), iproton); - ProtonVectorDummy2 = protonsfinal.at(i6); - protontrack(indexEvent, ProtonChargeFinal.at(i6), ProtonVectorDummy2.Px(), ProtonVectorDummy2.Py(), ProtonVectorDummy2.Pz(), ProtonTPCNsigmaFinal.at(i6), ProtonTOFHitFinal.at(i6), ProtonTOFNsigmaFinal.at(i6), F1ProtonIndex.at(i6)); + for (auto iproton = protons.begin(); iproton != protons.end(); ++iproton) { + auto i6 = std::distance(protons.begin(), iproton); + ProtonVectorDummy2 = protons.at(i6); + protontrack(indexEvent, ProtonCharge.at(i6), ProtonVectorDummy2.Px(), ProtonVectorDummy2.Py(), ProtonVectorDummy2.Pz(), ProtonTPCNsigma.at(i6), ProtonTOFHit.at(i6), ProtonTOFNsigma.at(i6), ProtonIndex.at(i6)); } } } diff --git a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx index 012d5e638a4..31d72363498 100644 --- a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx +++ b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx @@ -40,8 +40,10 @@ struct f1protoncorrelation { Configurable nsigmaCutTPC{"nsigmacutTPC", 3.0, "Value of the TPC Nsigma cut"}; Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Value of the TOF Nsigma cut"}; // PID selection + Configurable fillRotation{"fillRotation", 1, "Fill rotation"}; Configurable strategyPIDPion{"strategyPIDPion", 0, "PID strategy Pion"}; Configurable strategyPIDKaon{"strategyPIDKaon", 0, "PID strategy Kaon"}; + Configurable maxKKS0Mass{"maxKKS0Mass", 1.025, "Maximum kaon kshort mass"}; Configurable maxMomentumPion{"maxMomentumPion", 4.0, "Maximum momentum Pion"}; Configurable maxMomentumKaon{"maxMomentumKaon", 4.0, "Maximum momentum Kaon"}; Configurable momentumTOFPion{"momentumTOFPion", 0.8, "Pion momentum TOF"}; @@ -60,22 +62,14 @@ struct f1protoncorrelation { histos.add("hNsigmaProtonTPCSE", "Nsigma Proton TPC distribution same event", kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 1.0f}}); histos.add("hNsigmaProtonTPCME", "Nsigma Proton TPC distribution mixed event", kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 1.0f}}); histos.add("h2SameEventPtCorrelation", "Pt correlation of F1 and proton", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {100, 0.0, 10.0}}); - histos.add("h2SameEventInvariantMassUnlike_mass104", "Unlike Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2MixEventInvariantMassUnlike_mass104", "Unlike Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2SameEventInvariantMassLike_mass104", "Like Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2MixEventInvariantMassLike_mass104", "Like Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2SameEventInvariantMassUnlike_mass103", "Unlike Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2MixEventInvariantMassUnlike_mass103", "Unlike Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2SameEventInvariantMassLike_mass103", "Like Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2MixEventInvariantMassLike_mass103", "Like Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2SameEventInvariantMassUnlike_mass102", "Unlike Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2MixEventInvariantMassUnlike_mass102", "Unlike Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2SameEventInvariantMassLike_mass102", "Like Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2MixEventInvariantMassLike_mass102", "Like Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2SameEventInvariantMassUnlike_mass101", "Unlike Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2MixEventInvariantMassUnlike_mass101", "Unlike Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2SameEventInvariantMassLike_mass101", "Like Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); - histos.add("h2MixEventInvariantMassLike_mass101", "Like Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + + histos.add("h2SameEventInvariantMassUnlike_mass", "Unlike Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2SameEventInvariantMassLike_mass", "Like Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2SameEventInvariantMassRot_mass", "Rotational Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + + histos.add("h2MixEventInvariantMassUnlike_mass", "Unlike Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2MixEventInvariantMassLike_mass", "Like Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + histos.add("h2MixEventInvariantMassRot_mass", "Rotational Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); } // get kstar @@ -101,17 +95,20 @@ struct f1protoncorrelation { return 0.5 * trackRelK.P(); } - TLorentzVector F1, Proton, F1ProtonPair, Pion, Kaon; + TLorentzVector F1, Proton, F1ProtonPair, Pion, Kaon, Kshort; + TLorentzVector F1Rot, PionRot, KaonKshortPair; // Process the data in same event void process(aod::RedF1PEvents::iterator const& /*collision*/, aod::F1Tracks const& f1tracks, aod::ProtonTracks const& protontracks) { for (auto f1track : f1tracks) { - F1.SetXYZM(f1track.f1Px(), f1track.f1Py(), f1track.f1Pz(), f1track.f1Mass()); - if (f1track.f1MassKaonKshort() > 1.04 || F1.Pt() < lowPtF1) { + if (f1track.f1MassKaonKshort() > maxKKS0Mass) { continue; } + F1.SetXYZM(f1track.f1Px(), f1track.f1Py(), f1track.f1Pz(), f1track.f1Mass()); Pion.SetXYZM(f1track.f1d1Px(), f1track.f1d1Py(), f1track.f1d1Pz(), 0.139); Kaon.SetXYZM(f1track.f1d2Px(), f1track.f1d2Py(), f1track.f1d2Pz(), 0.493); + Kshort.SetXYZM(f1track.f1d3Px(), f1track.f1d3Py(), f1track.f1d3Pz(), 0.497); + KaonKshortPair = Kaon + Kshort; if (Pion.P() > maxMomentumPion || Kaon.P() > maxMomentumKaon) { continue; } @@ -134,37 +131,27 @@ struct f1protoncorrelation { } auto relative_momentum = getkstar(F1, Proton); histos.fill(HIST("h2SameEventPtCorrelation"), relative_momentum, F1.Pt(), Proton.Pt()); - if (f1track.f1MassKaonKshort() < 1.04) { - if (f1track.f1SignalStat() == 1) { - histos.fill(HIST("h2SameEventInvariantMassUnlike_mass104"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like - histos.fill(HIST("hNsigmaProtonTPCSE"), protontrack.protonNsigmaTPC(), relative_momentum); - } - if (f1track.f1SignalStat() == -1) { - histos.fill(HIST("h2SameEventInvariantMassLike_mass104"), relative_momentum, F1.Pt(), F1.M()); - } - } - if (f1track.f1MassKaonKshort() < 1.03) { - if (f1track.f1SignalStat() == 1) { - histos.fill(HIST("h2SameEventInvariantMassUnlike_mass103"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like - } - if (f1track.f1SignalStat() == -1) { - histos.fill(HIST("h2SameEventInvariantMassLike_mass103"), relative_momentum, F1.Pt(), F1.M()); - } - } - if (f1track.f1MassKaonKshort() < 1.02) { - if (f1track.f1SignalStat() == 1) { - histos.fill(HIST("h2SameEventInvariantMassUnlike_mass102"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like - } - if (f1track.f1SignalStat() == -1) { - histos.fill(HIST("h2SameEventInvariantMassLike_mass102"), relative_momentum, F1.Pt(), F1.M()); - } - } - if (f1track.f1MassKaonKshort() < 1.01) { - if (f1track.f1SignalStat() == 1) { - histos.fill(HIST("h2SameEventInvariantMassUnlike_mass101"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like - } - if (f1track.f1SignalStat() == -1) { - histos.fill(HIST("h2SameEventInvariantMassLike_mass101"), relative_momentum, F1.Pt(), F1.M()); + if (f1track.f1SignalStat() == 1) { + histos.fill(HIST("h2SameEventInvariantMassUnlike_mass"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like + histos.fill(HIST("hNsigmaProtonTPCSE"), protontrack.protonNsigmaTPC(), relative_momentum); + } + if (f1track.f1SignalStat() == -1) { + histos.fill(HIST("h2SameEventInvariantMassLike_mass"), relative_momentum, F1.Pt(), F1.M()); + } + if (fillRotation) { + for (int nrotbkg = 0; nrotbkg < 9; nrotbkg++) { + auto anglestart = 5.0 * TMath::Pi() / 6.0; + auto angleend = 7.0 * TMath::Pi() / 6.0; + auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0)); + auto rotangle = anglestart + nrotbkg * anglestep; + auto rotPionPx = f1track.f1d1Px() * std::cos(rotangle) - f1track.f1d1Py() * std::sin(rotangle); + auto rotPionPy = f1track.f1d1Px() * std::sin(rotangle) + f1track.f1d1Py() * std::cos(rotangle); + PionRot.SetXYZM(rotPionPx, rotPionPy, f1track.f1d1Pz(), 0.139); + F1Rot = PionRot + KaonKshortPair; + auto relative_momentum_rot = getkstar(F1Rot, Proton); + if (f1track.f1SignalStat() == 1) { + histos.fill(HIST("h2SameEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M()); + } } } } @@ -200,12 +187,14 @@ struct f1protoncorrelation { // for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(f1tracks, protontracks))) { for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(groupF1, groupProton))) { // LOGF(info, "Mixed event collision1 track1: (%d, %d)", collision1.index(), t1.index()); - F1.SetXYZM(t1.f1Px(), t1.f1Py(), t1.f1Pz(), t1.f1Mass()); - if (t1.f1MassKaonKshort() > 1.04 || F1.Pt() < lowPtF1) { + if (t1.f1MassKaonKshort() > maxKKS0Mass) { continue; } + F1.SetXYZM(t1.f1Px(), t1.f1Py(), t1.f1Pz(), t1.f1Mass()); Pion.SetXYZM(t1.f1d1Px(), t1.f1d1Py(), t1.f1d1Pz(), 0.139); Kaon.SetXYZM(t1.f1d2Px(), t1.f1d2Py(), t1.f1d2Pz(), 0.493); + Kshort.SetXYZM(t1.f1d3Px(), t1.f1d3Py(), t1.f1d3Pz(), 0.497); + KaonKshortPair = Kaon + Kshort; if (Pion.P() > maxMomentumPion || Kaon.P() > maxMomentumKaon) { continue; } @@ -223,37 +212,27 @@ struct f1protoncorrelation { continue; } auto relative_momentum = getkstar(F1, Proton); - if (t1.f1MassKaonKshort() < 1.04) { - if (t1.f1SignalStat() == 1) { - histos.fill(HIST("h2MixEventInvariantMassUnlike_mass104"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like - histos.fill(HIST("hNsigmaProtonTPCME"), t2.protonNsigmaTPC(), relative_momentum); - } - if (t1.f1SignalStat() == -1) { - histos.fill(HIST("h2MixEventInvariantMassLike_mass104"), relative_momentum, F1.Pt(), F1.M()); - } - } - if (t1.f1MassKaonKshort() < 1.03) { - if (t1.f1SignalStat() == 1) { - histos.fill(HIST("h2MixEventInvariantMassUnlike_mass103"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like - } - if (t1.f1SignalStat() == -1) { - histos.fill(HIST("h2MixEventInvariantMassLike_mass103"), relative_momentum, F1.Pt(), F1.M()); - } - } - if (t1.f1MassKaonKshort() < 1.02) { - if (t1.f1SignalStat() == 1) { - histos.fill(HIST("h2MixEventInvariantMassUnlike_mass102"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like - } - if (t1.f1SignalStat() == -1) { - histos.fill(HIST("h2MixEventInvariantMassLike_mass102"), relative_momentum, F1.Pt(), F1.M()); - } - } - if (t1.f1MassKaonKshort() < 1.01) { - if (t1.f1SignalStat() == 1) { - histos.fill(HIST("h2MixEventInvariantMassUnlike_mass101"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like - } - if (t1.f1SignalStat() == -1) { - histos.fill(HIST("h2MixEventInvariantMassLike_mass101"), relative_momentum, F1.Pt(), F1.M()); + if (t1.f1SignalStat() == 1) { + histos.fill(HIST("h2MixEventInvariantMassUnlike_mass104"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like + histos.fill(HIST("hNsigmaProtonTPCME"), t2.protonNsigmaTPC(), relative_momentum); + } + if (t1.f1SignalStat() == -1) { + histos.fill(HIST("h2MixEventInvariantMassLike_mass104"), relative_momentum, F1.Pt(), F1.M()); + } + if (fillRotation) { + for (int nrotbkg = 0; nrotbkg < 9; nrotbkg++) { + auto anglestart = 5.0 * TMath::Pi() / 6.0; + auto angleend = 7.0 * TMath::Pi() / 6.0; + auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0)); + auto rotangle = anglestart + nrotbkg * anglestep; + auto rotPionPx = t1.f1d1Px() * std::cos(rotangle) - t1.f1d1Py() * std::sin(rotangle); + auto rotPionPy = t1.f1d1Px() * std::sin(rotangle) + t1.f1d1Py() * std::cos(rotangle); + PionRot.SetXYZM(rotPionPx, rotPionPy, t1.f1d1Pz(), 0.139); + F1Rot = PionRot + KaonKshortPair; + auto relative_momentum_rot = getkstar(F1Rot, Proton); + if (t1.f1SignalStat() == 1) { + histos.fill(HIST("h2MixEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M()); + } } } } diff --git a/PWGLF/Tasks/Resonances/phipbpb.cxx b/PWGLF/Tasks/Resonances/phipbpb.cxx index 8d837d8314f..350d6664115 100644 --- a/PWGLF/Tasks/Resonances/phipbpb.cxx +++ b/PWGLF/Tasks/Resonances/phipbpb.cxx @@ -184,6 +184,9 @@ struct phipbpb { histos.add("hSparseV2SameEventCosDeltaPhi", "hSparseV2SameEventCosDeltaPhi", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); histos.add("hSparseV2MixedEventCosDeltaPhi", "hSparseV2MixedEventCosDeltaPhi", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); + histos.add("hSparseV2SameEventCosDeltaPhiSquare", "hSparseV2SameEventCosDeltaPhiSquare", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); + histos.add("hSparseV2MixedEventCosDeltaPhiSquare", "hSparseV2MixedEventCosDeltaPhiSquare", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); + histos.add("hSparseV2SameEventSinDeltaPhi", "hSparseV2SameEventSinDeltaPhi", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); histos.add("hSparseV2MixedEventSinDeltaPhi", "hSparseV2MixedEventSinDeltaPhi", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality}); @@ -465,6 +468,7 @@ struct phipbpb { histos.fill(HIST("hpTvsRapidity"), PhiMesonMother.Pt(), PhiMesonMother.Rapidity()); if (TMath::Abs(PhiMesonMother.Rapidity()) < confRapidity) { histos.fill(HIST("hSparseV2SameEventCosDeltaPhi"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2 * QFT0C, centrality); + histos.fill(HIST("hSparseV2SameEventCosDeltaPhiSquare"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2 * v2, centrality); histos.fill(HIST("hSparseV2SameEventSinDeltaPhi"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2sin * QFT0C, centrality); histos.fill(HIST("hSparseV2SameEventCosPhi"), PhiMesonMother.M(), PhiMesonMother.Pt(), TMath::Cos(2.0 * phimother), centrality); @@ -559,6 +563,7 @@ struct phipbpb { histos.fill(HIST("hpTvsRapidity"), PhiMesonMother.Pt(), PhiMesonMother.Rapidity()); if (TMath::Abs(PhiMesonMother.Rapidity()) < confRapidity) { histos.fill(HIST("hSparseV2MixedEventCosDeltaPhi"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2 * QFT0C, centrality); + histos.fill(HIST("hSparseV2MixedEventCosDeltaPhiSquare"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2 * v2, centrality); histos.fill(HIST("hSparseV2MixedEventSinDeltaPhi"), PhiMesonMother.M(), PhiMesonMother.Pt(), v2sin * QFT0C, centrality); } ROOT::Math::Boost boost{PhiMesonMother.BoostToCM()}; From 93c6c2b6497046659896a7f460f0ba236327beff Mon Sep 17 00:00:00 2001 From: Zhengqing Wang Date: Thu, 12 Dec 2024 06:15:11 +0800 Subject: [PATCH 348/459] [PWGCF] add self corr (#8870) Co-authored-by: ALICE Action Bot --- PWGCF/Flow/Tasks/pidcme.cxx | 303 ++++++++++++++++++++++++------------ 1 file changed, 200 insertions(+), 103 deletions(-) diff --git a/PWGCF/Flow/Tasks/pidcme.cxx b/PWGCF/Flow/Tasks/pidcme.cxx index 882e97aabec..5c7714ddce6 100644 --- a/PWGCF/Flow/Tasks/pidcme.cxx +++ b/PWGCF/Flow/Tasks/pidcme.cxx @@ -9,7 +9,11 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \author ZhengqingWang(zhengqing.wang@cern.ch) +/// \file pidcme.cxx +/// \brief task to calculate the pikp cme signal and bacground. // C++/ROOT includes. +// o2-linter: disable=name/workflow-file #include #include #include @@ -47,11 +51,11 @@ using namespace o2::framework::expressions; namespace o2::aod { -namespace CMETrackPIDcolums +namespace cme_track_pid_columns { -DECLARE_SOA_COLUMN(NPIDFlag, Npid, int8_t); // Flag tracks without proper binning as -1, and indicate type of particle 0->un-Id, 1->pion, 2->kaon, 3->proton -} // namespace CMETrackPIDcolums -DECLARE_SOA_TABLE(Flags, "AOD", "Flags", CMETrackPIDcolums::NPIDFlag); +DECLARE_SOA_COLUMN(NPidFlag, nPidFlag, int8_t); // Flag tracks without proper binning as -1, and indicate type of particle 0->un-Id, 1->pion, 2->kaon, 3->proton +} // namespace cme_track_pid_columns +DECLARE_SOA_TABLE(Flags, "AOD", "Flags", cme_track_pid_columns::NPidFlag); } // namespace o2::aod using TracksPID = soa::Join; @@ -77,7 +81,7 @@ struct FillPIDcolums { bool onlyTPC = true; template - bool SelTrack_PID(const TrackType track) + bool selTrackPid(const TrackType track) { if (!(track.pt() > cfgMinPtPID)) return false; @@ -101,7 +105,7 @@ struct FillPIDcolums { } template - bool selectionPID(const T& candidate, int8_t PID) + bool selectionPid(const T& candidate, int8_t PID) { if (candidate.pt() > cfgPtMaxforTPCOnlyPID) { onlyTPC = false; @@ -204,29 +208,29 @@ struct FillPIDcolums { histosQA.add(Form("QA/PID/histnSigma_Pr"), "", {HistType::kTH1F, {axisnSigma}}); histosQA.add(Form("QA/PID/histnSigma_Pt_Pr"), "", {HistType::kTH2F, {axisPtPID, axisnSigma}}); } - Produces PIDCMEtable; + Produces pidCmeTable; void process(TracksPID const& tracks) { - int8_t PID_flag; - for (auto& track : tracks) { - if (!SelTrack_PID(track)) { - PID_flag = -1; + int8_t pidFlag; + for (const auto& track : tracks) { + if (!selTrackPid(track)) { + pidFlag = -1; } else { histosQA.fill(HIST("QA/PID/histdEdxTPC_All"), track.sign() * track.tpcInnerParam(), track.tpcSignal()); - float nsigma_array[3] = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; - PID_flag = 0; + float nSigmaArray[3] = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; + pidFlag = 0; for (int8_t i = 0; i < 3; i++) { - if (selectionPID(track, i)) - PID_flag = PID_flag * 10 + i + 1; - if (PID_flag > 10) { // If a track is identified as two different tracks. - if (fabs(nsigma_array[(PID_flag / 10) - 1]) < fabs(nsigma_array[(PID_flag % 10) - 1])) // The track is identified as the particle whose |nsigma| is the least. - PID_flag /= 10; + if (selectionPid(track, i)) + pidFlag = pidFlag * 10 + i + 1; + if (pidFlag > 10) { // If a track is identified as two different tracks. + if (std::abs(nSigmaArray[(pidFlag / 10) - 1]) < std::abs(nSigmaArray[(pidFlag % 10) - 1])) // The track is identified as the particle whose |nsigma| is the least. + pidFlag /= 10; else - PID_flag %= 10; + pidFlag %= 10; } } - switch (PID_flag) { + switch (pidFlag) { case 1: histosQA.fill(HIST("QA/PID/histdEdxTPC_Pi"), track.sign() * track.tpcInnerParam(), track.tpcSignal()); histosQA.fill(HIST("QA/PID/histnSigma_Pi"), track.tpcNSigmaPi()); @@ -244,12 +248,12 @@ struct FillPIDcolums { break; } } - PIDCMEtable(PID_flag); + pidCmeTable(pidFlag); } } }; -struct pidcme { +struct pidcme { // o2-linter: disable=name/struct HistogramRegistry histosQA{"histosmain", {}, OutputObjHandlingPolicy::AnalysisObject}; Configurable> cfgnMods{"cfgnMods", {2}, "Modulation of interest"}; @@ -275,18 +279,18 @@ struct pidcme { ConfigurableAxis cfgaxissumpt{"cfgaxissumpt", {7, 1, 8}, "Binning for #gamma and #delta pt(particle1 + particle2)"}; ConfigurableAxis cfgaxisdeltaeta{"cfgaxisdeltaeta", {5, 0, 1}, "Binning for #gamma and #delta |#eta(particle1 - particle2)|"}; - Configurable OpenCME = {"cfgkOpeanCME", true, "open PID CME"}; + Configurable cfgkOpeanCME{"cfgkOpeanCME", true, "open PID CME"}; EventPlaneHelper helperEP; SliceCache cache; unsigned int mult1, mult2, mult3; - int DetId; - int RefAId; - int RefBId; + int detId; + int refAId; + int refBId; template - int GetDetId(const T& name) + int getDetId(const T& name) { if (name.value == "BPos" || name.value == "BNeg" || name.value == "BTot") { LOGF(warning, "Using deprecated label: %s. Please use TPCpos, TPCneg, TPCall instead.", name.value); @@ -314,23 +318,23 @@ struct pidcme { Filter collisionFilter = (nabs(aod::collision::posZ) < 10.f); Filter ptfilter = aod::track::pt > cfgMinPt; Filter etafilter = aod::track::eta < cfgMaxEta; - Filter properPIDfilter = aod::CMETrackPIDcolums::Npid != -1; + Filter properPIDfilter = aod::cme_track_pid_columns::nPidFlag != -1; - Partition>> Tracks_set1 = aod::CMETrackPIDcolums::Npid == 1; - Partition>> Tracks_set2 = aod::CMETrackPIDcolums::Npid == 2; - Partition>> Tracks_set3 = aod::CMETrackPIDcolums::Npid == 3; + Partition>> tracksSet1 = aod::cme_track_pid_columns::nPidFlag == 1; + Partition>> tracksSet2 = aod::cme_track_pid_columns::nPidFlag == 2; + Partition>> tracksSet3 = aod::cme_track_pid_columns::nPidFlag == 3; void init(InitContext const&) { - DetId = GetDetId(cfgDetName); - RefAId = GetDetId(cfgRefAName); - RefBId = GetDetId(cfgRefBName); + detId = getDetId(cfgDetName); + refAId = getDetId(cfgRefAName); + refBId = getDetId(cfgRefBName); - if (DetId == RefAId || DetId == RefBId || RefAId == RefBId) { + if (detId == refAId || detId == refBId || refAId == refBId) { LOGF(info, "Wrong detector configuration \n The FT0C will be used to get Q-Vector \n The TPCpos and TPCneg will be used as reference systems"); - DetId = 0; - RefAId = 4; - RefBId = 5; + detId = 0; + refAId = 4; + refBId = 5; } AxisSpec axisCent{cfgaxisCent, "centrality"}; @@ -373,13 +377,19 @@ struct pidcme { histosQA.add(Form("V2/PID/histCosDetV2_Ka_Neg"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); histosQA.add(Form("V2/PID/histCosDetV2_Pr_Neg"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}}); - if (OpenCME) { + if (cfgkOpeanCME) { histosQA.add(Form("PIDCME/histgamama_PiKa_ss"), "", {HistType::kTProfile, {axisCentMerged}}); histosQA.add(Form("PIDCME/histgamama_PiKa_os"), "", {HistType::kTProfile, {axisCentMerged}}); histosQA.add(Form("PIDCME/histgamama_PiPr_ss"), "", {HistType::kTProfile, {axisCentMerged}}); histosQA.add(Form("PIDCME/histgamama_PiPr_os"), "", {HistType::kTProfile, {axisCentMerged}}); histosQA.add(Form("PIDCME/histgamama_KaPr_ss"), "", {HistType::kTProfile, {axisCentMerged}}); histosQA.add(Form("PIDCME/histgamama_KaPr_os"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histgamama_PiPi_ss"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histgamama_PiPi_os"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histgamama_KaKa_ss"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histgamama_KaKa_os"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histgamama_PrPr_ss"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histgamama_PrPr_os"), "", {HistType::kTProfile, {axisCentMerged}}); histosQA.add(Form("PIDCME/histdelta_PiKa_ss"), "", {HistType::kTProfile, {axisCentMerged}}); histosQA.add(Form("PIDCME/histdelta_PiKa_os"), "", {HistType::kTProfile, {axisCentMerged}}); @@ -387,6 +397,12 @@ struct pidcme { histosQA.add(Form("PIDCME/histdelta_PiPr_os"), "", {HistType::kTProfile, {axisCentMerged}}); histosQA.add(Form("PIDCME/histdelta_KaPr_ss"), "", {HistType::kTProfile, {axisCentMerged}}); histosQA.add(Form("PIDCME/histdelta_KaPr_os"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histdelta_PiPi_ss"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histdelta_PiPi_os"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histdelta_KaKa_ss"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histdelta_KaKa_os"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histdelta_PrPr_ss"), "", {HistType::kTProfile, {axisCentMerged}}); + histosQA.add(Form("PIDCME/histdelta_PrPr_os"), "", {HistType::kTProfile, {axisCentMerged}}); histosQA.add(Form("PIDCME/Differential/histgamama_PiKa_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); histosQA.add(Form("PIDCME/Differential/histgamama_PiKa_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); @@ -394,6 +410,12 @@ struct pidcme { histosQA.add(Form("PIDCME/Differential/histgamama_PiPr_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); histosQA.add(Form("PIDCME/Differential/histgamama_KaPr_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); histosQA.add(Form("PIDCME/Differential/histgamama_KaPr_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histgamama_PiPi_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histgamama_PiPi_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histgamama_KaKa_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histgamama_KaKa_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histgamama_PrPr_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histgamama_PrPr_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); histosQA.add(Form("PIDCME/Differential/histdelta_PiKa_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); histosQA.add(Form("PIDCME/Differential/histdelta_PiKa_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); @@ -401,11 +423,17 @@ struct pidcme { histosQA.add(Form("PIDCME/Differential/histdelta_PiPr_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); histosQA.add(Form("PIDCME/Differential/histdelta_KaPr_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); histosQA.add(Form("PIDCME/Differential/histdelta_KaPr_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histdelta_PiPi_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histdelta_PiPi_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histdelta_KaKa_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histdelta_KaKa_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histdelta_PrPr_ss_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); + histosQA.add(Form("PIDCME/Differential/histdelta_PrPr_os_Dif"), "", {HistType::kTProfile3D, {axisCentMerged, axissumpt, axisdeltaeta}}); } } template - bool SelEvent(const CollType& collision) + bool selEvent(const CollType& collision) { if (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { return 0; @@ -420,7 +448,7 @@ struct pidcme { } template - bool SelTrack(const TrackType track) + bool selTrack(const TrackType track) { if (!track.passedITSNCls()) return false; @@ -442,139 +470,208 @@ struct pidcme { template void fillHistosQvec(const CollType& collision, int nmode) { - int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - int RefAInd = RefAId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - int RefBInd = RefBId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + int detInd = detId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + int refAInd = refAId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + int refBInd = refBId * 4 + cfgnTotalSystem * 4 * (nmode - 2); if (nmode == 2) { - if (collision.qvecAmp()[DetId] > 1e-8) { - histosQA.fill(HIST("QA/histQvec_CorrL0_V2"), collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], collision.centFT0C()); - histosQA.fill(HIST("QA/histQvec_CorrL1_V2"), collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], collision.centFT0C()); - histosQA.fill(HIST("QA/histQvec_CorrL2_V2"), collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], collision.centFT0C()); - histosQA.fill(HIST("QA/histQvec_CorrL3_V2"), collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], collision.centFT0C()); - histosQA.fill(HIST("QA/histEvtPl_CorrL0_V2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd], collision.qvecIm()[DetInd], nmode), collision.centFT0C()); - histosQA.fill(HIST("QA/histEvtPl_CorrL1_V2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 1], collision.qvecIm()[DetInd + 1], nmode), collision.centFT0C()); - histosQA.fill(HIST("QA/histEvtPl_CorrL2_V2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 2], collision.qvecIm()[DetInd + 2], nmode), collision.centFT0C()); - histosQA.fill(HIST("QA/histEvtPl_CorrL3_V2"), helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), collision.centFT0C()); + if (collision.qvecAmp()[detId] > 1e-8) { + histosQA.fill(HIST("QA/histQvec_CorrL0_V2"), collision.qvecRe()[detInd], collision.qvecIm()[detInd], collision.centFT0C()); + histosQA.fill(HIST("QA/histQvec_CorrL1_V2"), collision.qvecRe()[detInd + 1], collision.qvecIm()[detInd + 1], collision.centFT0C()); + histosQA.fill(HIST("QA/histQvec_CorrL2_V2"), collision.qvecRe()[detInd + 2], collision.qvecIm()[detInd + 2], collision.centFT0C()); + histosQA.fill(HIST("QA/histQvec_CorrL3_V2"), collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], collision.centFT0C()); + histosQA.fill(HIST("QA/histEvtPl_CorrL0_V2"), helperEP.GetEventPlane(collision.qvecRe()[detInd], collision.qvecIm()[detInd], nmode), collision.centFT0C()); + histosQA.fill(HIST("QA/histEvtPl_CorrL1_V2"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 1], collision.qvecIm()[detInd + 1], nmode), collision.centFT0C()); + histosQA.fill(HIST("QA/histEvtPl_CorrL2_V2"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 2], collision.qvecIm()[detInd + 2], nmode), collision.centFT0C()); + histosQA.fill(HIST("QA/histEvtPl_CorrL3_V2"), helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode), collision.centFT0C()); } - if (collision.qvecAmp()[DetId] > 1e-8 && collision.qvecAmp()[RefAId] > 1e-8 && collision.qvecAmp()[RefBId] > 1e-8) { - histosQA.fill(HIST("QA/histQvecRes_SigRefAV2"), helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[RefAInd + 3], collision.qvecIm()[RefAInd + 3], nmode), nmode), collision.centFT0C()); - histosQA.fill(HIST("QA/histQvecRes_SigRefBV2"), helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[RefBInd + 3], collision.qvecIm()[RefBInd + 3], nmode), nmode), collision.centFT0C()); - histosQA.fill(HIST("QA/histQvecRes_RefARefBV2"), helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[RefAInd + 3], collision.qvecIm()[RefAInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[RefBInd + 3], collision.qvecIm()[RefBInd + 3], nmode), nmode), collision.centFT0C()); + if (collision.qvecAmp()[detId] > 1e-8 && collision.qvecAmp()[refAId] > 1e-8 && collision.qvecAmp()[refBId] > 1e-8) { + histosQA.fill(HIST("QA/histQvecRes_SigRefAV2"), helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[refAInd + 3], collision.qvecIm()[refAInd + 3], nmode), nmode), collision.centFT0C()); + histosQA.fill(HIST("QA/histQvecRes_SigRefBV2"), helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[refBInd + 3], collision.qvecIm()[refBInd + 3], nmode), nmode), collision.centFT0C()); + histosQA.fill(HIST("QA/histQvecRes_RefARefBV2"), helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecRe()[refAInd + 3], collision.qvecIm()[refAInd + 3], nmode), helperEP.GetEventPlane(collision.qvecRe()[refBInd + 3], collision.qvecIm()[refBInd + 3], nmode), nmode), collision.centFT0C()); } } } template - void fillHistosFlow_gamma_delta(const CollType& collision, const TrackType& track1, const TrackType& track2, const TrackType& track3, int nmode) + void fillHistosFlowGammaDelta(const CollType& collision, const TrackType& track1, const TrackType& track2, const TrackType& track3, int nmode) { - if (collision.qvecAmp()[DetId] < 1e-8) { + if (collision.qvecAmp()[detId] < 1e-8) { return; } - int DetInd = DetId * 4 + cfgnTotalSystem * 4 * (nmode - 2); - float Psi_n = helperEP.GetEventPlane(collision.qvecRe()[DetInd + 3], collision.qvecIm()[DetInd + 3], nmode); - for (auto& trk : track1) { - if (!SelTrack(trk)) + int detInd = detId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + float psiN = helperEP.GetEventPlane(collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3], nmode); + for (const auto& trk : track1) { + if (!selTrack(trk)) continue; if (nmode == 2) { if (trk.sign() > 0) { histosQA.fill(HIST("V2/PID/histCosDetV2_Pi"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + std::cos(static_cast(nmode) * (trk.phi() - psiN))); } else if (trk.sign() < 0) { histosQA.fill(HIST("V2/PID/histCosDetV2_Pi_Neg"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + std::cos(static_cast(nmode) * (trk.phi() - psiN))); } } } - for (auto& trk : track2) { - if (!SelTrack(trk)) + for (const auto& trk : track2) { + if (!selTrack(trk)) continue; if (nmode == 2) { if (trk.sign() > 0) { histosQA.fill(HIST("V2/PID/histCosDetV2_Ka"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + std::cos(static_cast(nmode) * (trk.phi() - psiN))); } else if (trk.sign() < 0) { histosQA.fill(HIST("V2/PID/histCosDetV2_Ka_Neg"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + std::cos(static_cast(nmode) * (trk.phi() - psiN))); } } } - for (auto& trk : track3) { - if (!SelTrack(trk)) + for (const auto& trk : track3) { + if (!selTrack(trk)) continue; if (nmode == 2) { if (trk.sign() > 0) { histosQA.fill(HIST("V2/PID/histCosDetV2_Pr"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + std::cos(static_cast(nmode) * (trk.phi() - psiN))); } else if (trk.sign() < 0) { histosQA.fill(HIST("V2/PID/histCosDetV2_Pr_Neg"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(nmode) * (trk.phi() - Psi_n))); + std::cos(static_cast(nmode) * (trk.phi() - psiN))); } } } - if (OpenCME) { - for (auto& trk1 : track1) { - for (auto& trk2 : track2) { + if (cfgkOpeanCME) { + for (const auto& trk1 : track1) { + for (const auto& trk2 : track1) { if (trk1.globalIndex() == trk2.globalIndex()) continue; if (nmode == 2) { if (trk1.sign() == trk2.sign()) { - histosQA.fill(HIST("PIDCME/histgamama_PiKa_ss"), collision.centFT0C(), std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histgamama_PiPi_ss"), collision.centFT0C(), std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); + histosQA.fill(HIST("PIDCME/histdelta_PiPi_ss"), collision.centFT0C(), std::cos((trk1.phi() - trk2.phi()))); + histosQA.fill(HIST("PIDCME/Differential/histgamama_PiPi_ss_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); + histosQA.fill(HIST("PIDCME/Differential/histdelta_PiPi_ss_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() - trk2.phi()))); + } else { + histosQA.fill(HIST("PIDCME/histgamama_PiPi_os"), collision.centFT0C(), std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); + histosQA.fill(HIST("PIDCME/histdelta_PiPi_os"), collision.centFT0C(), std::cos((trk1.phi() - trk2.phi()))); + histosQA.fill(HIST("PIDCME/Differential/histgamama_PiPi_os_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); + histosQA.fill(HIST("PIDCME/Differential/histdelta_PiPi_os_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() - trk2.phi()))); + } + } + } + } + for (const auto& trk1 : track2) { + for (const auto& trk2 : track2) { + if (trk1.globalIndex() == trk2.globalIndex()) + continue; + if (nmode == 2) { + if (trk1.sign() == trk2.sign()) { + histosQA.fill(HIST("PIDCME/histgamama_KaKa_ss"), collision.centFT0C(), std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); + histosQA.fill(HIST("PIDCME/histdelta_KaKa_ss"), collision.centFT0C(), std::cos((trk1.phi() - trk2.phi()))); + histosQA.fill(HIST("PIDCME/Differential/histgamama_KaKa_ss_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); + histosQA.fill(HIST("PIDCME/Differential/histdelta_KaKa_ss_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() - trk2.phi()))); + } else { + histosQA.fill(HIST("PIDCME/histgamama_KaKa_os"), collision.centFT0C(), std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); + histosQA.fill(HIST("PIDCME/histdelta_KaKa_os"), collision.centFT0C(), std::cos((trk1.phi() - trk2.phi()))); + histosQA.fill(HIST("PIDCME/Differential/histgamama_KaKa_os_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); + histosQA.fill(HIST("PIDCME/Differential/histdelta_KaKa_os_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() - trk2.phi()))); + } + } + } + } + for (const auto& trk1 : track3) { + for (const auto& trk2 : track3) { + if (trk1.globalIndex() == trk2.globalIndex()) + continue; + if (nmode == 2) { + if (trk1.sign() == trk2.sign()) { + histosQA.fill(HIST("PIDCME/histgamama_PrPr_ss"), collision.centFT0C(), std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); + histosQA.fill(HIST("PIDCME/histdelta_PrPr_ss"), collision.centFT0C(), std::cos((trk1.phi() - trk2.phi()))); + histosQA.fill(HIST("PIDCME/Differential/histgamama_PrPr_ss_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); + histosQA.fill(HIST("PIDCME/Differential/histdelta_PrPr_ss_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() - trk2.phi()))); + } else { + histosQA.fill(HIST("PIDCME/histgamama_PrPr_os"), collision.centFT0C(), std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); + histosQA.fill(HIST("PIDCME/histdelta_PrPr_os"), collision.centFT0C(), std::cos((trk1.phi() - trk2.phi()))); + histosQA.fill(HIST("PIDCME/Differential/histgamama_PrPr_os_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); + histosQA.fill(HIST("PIDCME/Differential/histdelta_PrPr_os_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), + std::cos((trk1.phi() - trk2.phi()))); + } + } + } + } + for (const auto& trk1 : track1) { + for (const auto& trk2 : track2) { + if (trk1.globalIndex() == trk2.globalIndex()) + continue; + if (nmode == 2) { + if (trk1.sign() == trk2.sign()) { + histosQA.fill(HIST("PIDCME/histgamama_PiKa_ss"), collision.centFT0C(), std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); histosQA.fill(HIST("PIDCME/histdelta_PiKa_ss"), collision.centFT0C(), std::cos((trk1.phi() - trk2.phi()))); histosQA.fill(HIST("PIDCME/Differential/histgamama_PiKa_ss_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), - std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * Psi_n))); + std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); histosQA.fill(HIST("PIDCME/Differential/histdelta_PiKa_ss_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), std::cos((trk1.phi() - trk2.phi()))); } else { - histosQA.fill(HIST("PIDCME/histgamama_PiKa_os"), collision.centFT0C(), std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histgamama_PiKa_os"), collision.centFT0C(), std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); histosQA.fill(HIST("PIDCME/histdelta_PiKa_os"), collision.centFT0C(), std::cos((trk1.phi() - trk2.phi()))); histosQA.fill(HIST("PIDCME/Differential/histgamama_PiKa_os_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), - std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * Psi_n))); + std::cos((trk1.phi() + trk2.phi() - static_cast(nmode) * psiN))); histosQA.fill(HIST("PIDCME/Differential/histdelta_PiKa_os_Dif"), collision.centFT0C(), trk1.pt() + trk2.pt(), std::abs(trk1.eta() - trk2.eta()), std::cos((trk1.phi() - trk2.phi()))); } } } } - for (auto& trk1 : track1) { - for (auto& trk3 : track3) { + for (const auto& trk1 : track1) { + for (const auto& trk3 : track3) { if (trk1.globalIndex() == trk3.globalIndex()) continue; if (nmode == 2) { if (trk1.sign() == trk3.sign()) { - histosQA.fill(HIST("PIDCME/histgamama_PiPr_ss"), collision.centFT0C(), std::cos((trk1.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histgamama_PiPr_ss"), collision.centFT0C(), std::cos((trk1.phi() + trk3.phi() - static_cast(nmode) * psiN))); histosQA.fill(HIST("PIDCME/histdelta_PiPr_ss"), collision.centFT0C(), std::cos((trk1.phi() - trk3.phi()))); histosQA.fill(HIST("PIDCME/Differential/histgamama_PiPr_ss_Dif"), collision.centFT0C(), trk1.pt() + trk3.pt(), std::abs(trk1.eta() - trk3.eta()), - std::cos((trk1.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + std::cos((trk1.phi() + trk3.phi() - static_cast(nmode) * psiN))); histosQA.fill(HIST("PIDCME/Differential/histdelta_PiPr_ss_Dif"), collision.centFT0C(), trk1.pt() + trk3.pt(), std::abs(trk1.eta() - trk3.eta()), std::cos((trk1.phi() - trk3.phi()))); } else { - histosQA.fill(HIST("PIDCME/histgamama_PiPr_os"), collision.centFT0C(), std::cos((trk1.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histgamama_PiPr_os"), collision.centFT0C(), std::cos((trk1.phi() + trk3.phi() - static_cast(nmode) * psiN))); histosQA.fill(HIST("PIDCME/histdelta_PiPr_os"), collision.centFT0C(), std::cos((trk1.phi() - trk3.phi()))); histosQA.fill(HIST("PIDCME/Differential/histgamama_PiPr_os_Dif"), collision.centFT0C(), trk1.pt() + trk3.pt(), std::abs(trk1.eta() - trk3.eta()), - std::cos((trk1.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + std::cos((trk1.phi() + trk3.phi() - static_cast(nmode) * psiN))); histosQA.fill(HIST("PIDCME/Differential/histdelta_PiPr_os_Dif"), collision.centFT0C(), trk1.pt() + trk3.pt(), std::abs(trk1.eta() - trk3.eta()), std::cos((trk1.phi() - trk3.phi()))); } } } } - for (auto& trk2 : track2) { - for (auto& trk3 : track3) { + for (const auto& trk2 : track2) { + for (const auto& trk3 : track3) { if (trk2.globalIndex() == trk3.globalIndex()) continue; if (nmode == 2) { if (trk2.sign() == trk3.sign()) { - histosQA.fill(HIST("PIDCME/histgamama_KaPr_ss"), collision.centFT0C(), std::cos((trk2.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histgamama_KaPr_ss"), collision.centFT0C(), std::cos((trk2.phi() + trk3.phi() - static_cast(nmode) * psiN))); histosQA.fill(HIST("PIDCME/histdelta_KaPr_ss"), collision.centFT0C(), std::cos((trk2.phi() - trk3.phi()))); histosQA.fill(HIST("PIDCME/Differential/histgamama_KaPr_ss_Dif"), collision.centFT0C(), trk2.pt() + trk3.pt(), std::abs(trk2.eta() - trk3.eta()), - std::cos((trk2.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + std::cos((trk2.phi() + trk3.phi() - static_cast(nmode) * psiN))); histosQA.fill(HIST("PIDCME/Differential/histdelta_KaPr_ss_Dif"), collision.centFT0C(), trk2.pt() + trk3.pt(), std::abs(trk2.eta() - trk3.eta()), std::cos((trk2.phi() - trk3.phi()))); } else { - histosQA.fill(HIST("PIDCME/histgamama_KaPr_os"), collision.centFT0C(), std::cos((trk2.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + histosQA.fill(HIST("PIDCME/histgamama_KaPr_os"), collision.centFT0C(), std::cos((trk2.phi() + trk3.phi() - static_cast(nmode) * psiN))); histosQA.fill(HIST("PIDCME/histdelta_KaPr_os"), collision.centFT0C(), std::cos((trk2.phi() - trk3.phi()))); histosQA.fill(HIST("PIDCME/Differential/histgamama_KaPr_os_Dif"), collision.centFT0C(), trk2.pt() + trk3.pt(), std::abs(trk2.eta() - trk3.eta()), - std::cos((trk2.phi() + trk3.phi() - static_cast(nmode) * Psi_n))); + std::cos((trk2.phi() + trk3.phi() - static_cast(nmode) * psiN))); histosQA.fill(HIST("PIDCME/Differential/histdelta_KaPr_os_Dif"), collision.centFT0C(), trk2.pt() + trk3.pt(), std::abs(trk2.eta() - trk3.eta()), std::cos((trk2.phi() - trk3.phi()))); } @@ -587,33 +684,33 @@ struct pidcme { void process(soa::Filtered>::iterator const& collision, soa::Filtered> const& tracks) { histosQA.fill(HIST("QA/histEventCount"), 0.5); - if (!SelEvent(collision)) { + if (!selEvent(collision)) { return; } histosQA.fill(HIST("QA/histEventCount"), 1.5); histosQA.fill(HIST("QA/histCentrality"), collision.centFT0C()); histosQA.fill(HIST("QA/histVertexZRec"), collision.posZ()); - auto tracks1 = Tracks_set1->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - auto tracks2 = Tracks_set2->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - auto tracks3 = Tracks_set3->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto tracks1 = tracksSet1->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto tracks2 = tracksSet2->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto tracks3 = tracksSet3->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); mult1 = tracks1.size(); mult2 = tracks2.size(); mult3 = tracks3.size(); if (mult1 < 1 || mult2 < 1 || mult3 < 1) // Reject Collisions without sufficient particles return; for (auto i = 0; i < static_cast(cfgnMods->size()); i++) { - int DetInd_global = DetId * 4 + cfgnTotalSystem * 4 * (cfgnMods->at(i) - 2); - float Psi_n_global = helperEP.GetEventPlane(collision.qvecRe()[DetInd_global + 3], collision.qvecIm()[DetInd_global + 3], cfgnMods->at(i)); - for (auto& trk : tracks) { - if (!SelTrack(trk)) + int detIndGlobal = detId * 4 + cfgnTotalSystem * 4 * (cfgnMods->at(i) - 2); + float psiNGlobal = helperEP.GetEventPlane(collision.qvecRe()[detIndGlobal + 3], collision.qvecIm()[detIndGlobal + 3], cfgnMods->at(i)); + for (const auto& trk : tracks) { + if (!selTrack(trk)) continue; histosQA.fill(HIST("V2/histSinDetV2"), collision.centFT0C(), trk.pt(), - std::sin(static_cast(cfgnMods->at(i)) * (trk.phi() - Psi_n_global))); + std::sin(static_cast(cfgnMods->at(i)) * (trk.phi() - psiNGlobal))); histosQA.fill(HIST("V2/histCosDetV2"), collision.centFT0C(), trk.pt(), - std::cos(static_cast(cfgnMods->at(i)) * (trk.phi() - Psi_n_global))); + std::cos(static_cast(cfgnMods->at(i)) * (trk.phi() - psiNGlobal))); } fillHistosQvec(collision, cfgnMods->at(i)); - fillHistosFlow_gamma_delta(collision, tracks1, tracks2, tracks3, cfgnMods->at(i)); + fillHistosFlowGammaDelta(collision, tracks1, tracks2, tracks3, cfgnMods->at(i)); } } }; From 81a7e9100314ea0d88a045d8246764ce61c0d682 Mon Sep 17 00:00:00 2001 From: Chiara Pinto <48326672+chiarapinto@users.noreply.github.com> Date: Wed, 11 Dec 2024 23:21:32 +0100 Subject: [PATCH 349/459] [PWGLF] added configurable selections and new histos (#8943) Co-authored-by: ALICE Action Bot --- .../Nuspex/AngularCorrelationsInJets.cxx | 218 +++++++++--------- 1 file changed, 103 insertions(+), 115 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx b/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx index 6d751cde7c1..da2c47fa790 100644 --- a/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx +++ b/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx @@ -34,6 +34,7 @@ #include "PWGJE/Core/JetBkgSubUtils.h" #include "TVector2.h" #include "TVector3.h" +#include "TPDGCode.h" using namespace o2; using namespace o2::framework; @@ -75,10 +76,8 @@ struct AngularCorrelationsInJets { Configurable fProtonTPCTOFpT{"protonTPCTOFswitchpT", 0.7, "[proton] pT for switch in TPC/TOF nsigma"}; Configurable fProtonTPCnsigLowYield{"protonTPCnsigmaLowPtYield", 4.0, "[proton] max TPC nsigma with low pT for yield"}; Configurable fProtonTPCnsigHighYield{"protonTPCnsigmaHighPtYield", 4.0, "[proton] max TPC nsigma with high pT for yield"}; - Configurable fProtonTPCnsigLowCF{"protonTPCnsigmaLowPtCF", 2.0, "[proton] max TPC nsigma with low pT for CF"}; - Configurable fProtonTPCnsigHighCF{"protonTPCnsigmaHighPtCF", 3.0, "[proton] max TPC nsigma with high pT for CF"}; Configurable fProtonTOFnsigYield{"protonTOFnsigmaHighPtYield", 4.0, "[proton] max TOF nsigma with high pT yield"}; - Configurable fProtonTOFnsigCF{"protonTOFnsigmaHighPtCF", 4.0, "[proton] max TOF nsigma for CF"}; + Configurable fProtonNsigma{"protonNsigma", 2.0, "[proton] max combined nsigma for CF (sqrt(nsigTPC^2 + nsigTOF^2))"}; // Antiproton Cuts Configurable fAntiprotonDCAxyYield{"antiprotonDCAxyYield", 0.05, "[antiproton] DCAxy cut for yield"}; @@ -88,10 +87,8 @@ struct AngularCorrelationsInJets { Configurable fAntiprotonTPCTOFpT{"antiprotonTPCTOFswitchpT", 0.7, "[antiproton] pT for switch in TPC/TOF nsigma"}; Configurable fAntiprotonTPCnsigLowYield{"antiprotonTPCnsigmaLowPtYield", 4.0, "[antiproton] max TPC nsigma with low pT for yield"}; Configurable fAntiprotonTPCnsigHighYield{"antiprotonTPCnsigmaHighPtYield", 4.0, "[antiproton] max TPC nsigma with high pT for yield"}; - Configurable fAntiprotonTPCnsigLowCF{"antiprotonTPCnsigmaLowPtCF", 2.0, "[antiproton] max TPC nsigma with low pT for CF"}; - Configurable fAntiprotonTPCnsigHighCF{"antiprotonTPCnsigmaHighPtCF", 3.0, "[antiproton] max TPC nsigma with high pT for CF"}; Configurable fAntiprotonTOFnsigYield{"antiprotonTOFnsigmaHighPtYield", 4.0, "[antiproton] min TOF nsigma with high pT for yield"}; - Configurable fAntiprotonTOFnsigCF{"antiprotonTOFnsigmaHighPtCF", 4.0, "[antiproton] max TOF nsigma for CF"}; + Configurable fAntiprotonNsigma{"antiprotonNsigma", 2.0, "[antiproton] max combined nsigma for CF (sqrt(nsigTPC^2 + nsigTOF^2))"}; // Nuclei Cuts Configurable fNucleiDCAxyYield{"nucleiDCAxyYield", 0.05, "[nuclei] DCAxy cut for yield"}; @@ -101,10 +98,8 @@ struct AngularCorrelationsInJets { Configurable fNucleiTPCTOFpT{"nucleiTPCTOFswitchpT", 0.7, "[nuclei] pT for switch in TPC/TOF nsigma"}; Configurable fNucleiTPCnsigLowYield{"nucleiTPCnsigmaLowPtYield", 4.0, "[nuclei] max TPC nsigma with low pT for yield"}; Configurable fNucleiTPCnsigHighYield{"nucleiTPCnsigmaHighPtYield", 4.0, "[nuclei] max TPC nsigma with high pT for yield"}; - Configurable fNucleiTPCnsigLowCF{"nucleiTPCnsigmaLowPtCF", 2.0, "[nuclei] max TPC nsigma with low pT for CF"}; - Configurable fNucleiTPCnsigHighCF{"nucleiTPCnsigmaHighPtCF", 3.0, "[nuclei] max TPC nsigma with high pT for CF"}; Configurable fNucleiTOFnsigYield{"nucleiTOFnsigmaHighPtYield", 4.0, "[nuclei] min TOF nsigma with high pT for yield"}; - Configurable fNucleiTOFnsigCF{"nucleiTOFnsigmaHighPtCF", 4.0, "[nuclei] max TOF nsigma for CF"}; + Configurable fNucleiNsigma{"nucleiNsigma", 2.0, "[nuclei] max combined nsigma for CF (sqrt(nsigTPC^2 + nsigTOF^2))"}; // Antinuclei Cuts Configurable fAntinucleiDCAxyYield{"antinucleiDCAxyYield", 0.05, "[antinuclei] DCAxy cut for yield"}; @@ -114,27 +109,31 @@ struct AngularCorrelationsInJets { Configurable fAntinucleiTPCTOFpT{"antinucleiTPCTOFswitchpT", 0.7, "[antinuclei] pT for switch in TPC/TOF nsigma"}; Configurable fAntinucleiTPCnsigLowYield{"antinucleiTPCnsigmaLowPtYield", 4.0, "[antinuclei] max TPC nsigma with low pT for yield"}; Configurable fAntinucleiTPCnsigHighYield{"antinucleiTPCnsigmaHighPtYield", 4.0, "[antinuclei] max TPC nsigma with high pT for yield"}; - Configurable fAntinucleiTPCnsigLowCF{"antinucleiTPCnsigmaLowPtCF", 2.0, "[antinuclei] max TPC nsigma with low pT for CF"}; - Configurable fAntinucleiTPCnsigHighCF{"antinucleiTPCnsigmaHighPtCF", 3.0, "[antinuclei] max TPC nsigma with high pT for CF"}; Configurable fAntinucleiTOFnsigYield{"antinucleiTOFnsigmaHighPtYield", 4.0, "[antinuclei] min TOF nsigma with high pT for yield"}; - Configurable fAntinucleiTOFnsigCF{"antinucleiTOFnsigmaHighPtCF", 4.0, "[antinuclei] max TOF nsigma for CF"}; + Configurable fAntinucleiNsigma{"antinucleiNsigma", 2.0, "[nuclei] max combined nsigma for CF (sqrt(nsigTPC^2 + nsigTOF^2))"}; + Configurable fDeuteronAnalysis{"deuteronAnalysis", true, "true [false]: analyse (anti)deuterons [(anti)helium-3]"}; Configurable fUseTOFMass{"useTOFmass", true, "use TOF mass instead of pion mass if available"}; - Configurable fBufferSize{"trackBufferSize", 2000, "Number of mixed-event tracks being stored"}; + Configurable fBufferSize{"trackBufferSize", 200, "Number of mixed-event tracks being stored"}; // QC Configurables - Configurable fZVtx{"zVtx", 9999, "max zVertex"}; + Configurable fZVtx{"zVtx", 10.0, "max zVertex"}; Configurable fRmax{"Rmax", 0.4, "Maximum radius for jet and UE regions"}; Service ccdb; int mRunNumber; using FullTracksRun2 = soa::Join; + aod::TrackSelectionExtension, aod::TracksDCA, aod::pidTPCFullPr, aod::pidTPCFullDe, aod::pidTPCFullHe, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFFullHe, aod::pidTOFmass, aod::pidTOFbeta, aod::pidTPCEl, aod::pidTPCMu, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCTr, aod::pidTPCAl>; using FullTracksRun3 = soa::Join; + aod::TracksDCA, aod::pidTPCFullPr, aod::pidTPCFullDe, aod::pidTPCFullHe, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFFullHe, aod::pidTOFmass, aod::pidTOFbeta, aod::pidTPCEl, aod::pidTPCMu, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCTr, aod::pidTPCAl>; + // using McTracksRun2 = soa::Join; + // using McTracksRun3 = soa::Join; using BCsWithRun2Info = soa::Join; + // using McCollisions = soa::Join::iterator; Filter prelimTrackCuts = (aod::track::itsChi2NCl < fMaxChi2ITS && aod::track::tpcChi2NCl < fMaxChi2TPC && @@ -144,11 +143,15 @@ struct AngularCorrelationsInJets { Preslice perCollisionFullTracksRun2 = o2::aod::track::collisionId; Preslice perCollisionFullTracksRun3 = o2::aod::track::collisionId; + // PreSlice perCollisionMcTracksRun2 = o2::aod::track::collisionId; + // PreSlice perCollisionMcTracksRun3 = o2::aod::track::collisionId; AxisSpecs axisSpecs; HistogramRegistry registryData{"dataOutput", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; + // HistogramRegistry registryMC("MCOutput", {}, OutputObjHandlingPolicy::AnalysisObject, false, true); HistogramRegistry registryQA{"dataQA", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; + // HistogramRegistry registryMCQA("MCQA", {}, OutputObjHandlingPolicy::AnalysisObject, false, true); JetBkgSubUtils bkgSub; @@ -196,6 +199,10 @@ struct AngularCorrelationsInJets { registryQA.add("hPtJetAntinuclei_20", "Antinuclei p_{T} for jet p_{T} < 20 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); registryQA.add("hPtJetAntinuclei_30", "Antinuclei p_{T} for jet p_{T} < 30 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); registryQA.add("hPtJetAntinuclei_50", "Antinuclei p_{T} for jet p_{T} < 50 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); + registryQA.add("hPtJetProtonVsTotalJet", "Proton p_{T} vs. jet p_{T}", HistType::kTH2D, {axisSpecs.ptAxisPos, {1000, 0, 500}}); + registryQA.add("hPtJetAntiprotonVsTotalJet", "Antiproton p_{T} vs. jet p_{T}", HistType::kTH2D, {axisSpecs.ptAxisPos, {1000, 0, 500}}); + registryQA.add("hPtJetNucleiVsTotalJet", "Nuclei p_{T} vs. jet p_{T}", HistType::kTH2D, {axisSpecs.ptAxisPos, {1000, 0, 500}}); + registryQA.add("hPtJetAntinucleiVsTotalJet", "Antinuclei p_{T} vs. jet p_{T}", HistType::kTH2D, {axisSpecs.ptAxisPos, {1000, 0, 500}}); // nSigma registryData.add("hTPCsignal", "TPC signal", HistType::kTH2F, {{1000, -100, 100, "#it{p} [GeV/#it{c}]"}, {5000, 0, 5000, "d#it{E}/d#it{X} (a.u.)"}}); @@ -315,7 +322,7 @@ struct AngularCorrelationsInJets { } template - bool selectTrack(T const& track) + bool selectTrack(T const& track) // preliminary track selections { if (track.tpcNClsCrossedRows() < fMinRatioCrossedRowsTPC * track.tpcNClsFindable() || track.tpcNClsCrossedRows() < fMinNCrossedRowsTPC || @@ -333,9 +340,26 @@ struct AngularCorrelationsInJets { return true; } + template + bool singleSpeciesTPCNSigma(T const& track, int species) // make cut configurable + { // reject any track that has nsigma < 3 for more than 1 species + if (track.tpcNSigmaStoreEl() < 3.0 || track.tpcNSigmaStoreMu() < 3.0 || track.tpcNSigmaStorePi() < 3.0 || track.tpcNSigmaStoreKa() < 3.0 || track.tpcNSigmaStoreTr() < 3.0 || track.tpcNSigmaStoreAl() < 3.0) + return false; + switch (species) { + case 1: // (anti)proton + return (track.tpcNSigmaPr() < 3.0 && track.tpcNSigmaDe() > 3.0 && track.tpcNSigmaHe() > 3.0); + case 2: // (anti)deuteron + return (track.tpcNSigmaDe() < 3.0 && track.tpcNSigmaPr() > 3.0 && track.tpcNSigmaHe() > 3.0); + case 3: // (anti)helium-3 + return (track.tpcNSigmaHe() < 3.0 && track.tpcNSigmaDe() > 3.0 && track.tpcNSigmaPr() > 3.0); + } + } + template bool isProton(const T& track, bool tightCuts) { + // if (doprocessMCRun3) + // return (track.mcParticle().pdgCode() == 2212); if (track.sign() < 0) return false; @@ -347,20 +371,15 @@ struct AngularCorrelationsInJets { return false; registryData.fill(HIST("hTPCnsigmaProtonCF"), track.pt(), track.tpcNSigmaPr()); - - // TPC - if (track.pt() < fProtonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fProtonTPCnsigLowCF) - return false; - if (track.pt() > fProtonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fProtonTPCnsigHighCF) - return false; - registryData.fill(HIST("hTOFnsigmaProtonCF"), track.pt(), track.tofNSigmaPr()); - // TOF - if (track.hasTOF()) { - if (track.pt() > fProtonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > fProtonTOFnsigCF) + // nsigma + double tofNsigma = track.hasTOF() ? track.tofNSigmaPr() : 999; + if ((track.pt() < fProtonTPCTOFpT && (TMath::Abs(track.tpcNSigmaPr()) > fProtonNsigma)) || (track.pt() > fProtonTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaPr() * track.tpcNSigmaPr() + tofNsigma * tofNsigma) > fProtonNsigma))) + if (TMath::Sqrt(track.tpcNSigmaPr() * track.tpcNSigmaPr() + tofNsigma * tofNsigma) > fProtonNsigma) return false; - } + if (!singleSpeciesTPCNSigma(track, 1)) + return false; } else { // for yields // DCA if (TMath::Abs(track.dcaXY()) > fProtonDCAxyYield) @@ -391,6 +410,8 @@ struct AngularCorrelationsInJets { template bool isAntiproton(const T& track, bool tightCuts) { + // if (doprocessMCRun3) + // return (track.mcParticle().pdgCode() == -2212); if (track.sign() > 0) return false; @@ -402,20 +423,14 @@ struct AngularCorrelationsInJets { return false; registryData.fill(HIST("hTPCnsigmaAntiprotonCF"), track.pt(), track.tpcNSigmaPr()); + registryData.fill(HIST("hTOFnsigmaAntiprotonCF"), track.pt(), track.tofNSigmaPr()); - // TPC - if (track.pt() < fAntiprotonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fAntiprotonTPCnsigLowCF) + // nsigma + double tofNsigma = track.hasTOF() ? track.tofNSigmaPr() : 999; + if ((track.pt() < fAntiprotonTPCTOFpT && (TMath::Abs(track.tpcNSigmaPr()) > fAntiprotonNsigma)) || (track.pt() > fAntiprotonTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaPr() * track.tpcNSigmaPr() + tofNsigma * tofNsigma) > fAntiprotonNsigma))) return false; - if (track.pt() > fAntiprotonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fAntiprotonTPCnsigHighCF) + if (!singleSpeciesTPCNSigma(track, 1)) return false; - - registryData.fill(HIST("hTOFnsigmaAntiprotonCF"), track.pt(), track.tofNSigmaPr()); - - // TOF - if (track.hasTOF()) { - if (track.pt() > fAntiprotonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > fAntiprotonTOFnsigCF) - return false; - } } else { // for yields // DCA if (TMath::Abs(track.dcaXY()) > fAntiprotonDCAxyYield) @@ -446,6 +461,8 @@ struct AngularCorrelationsInJets { template bool isNucleus(const T& track, bool tightCuts) { + // if (doprocessMCRun3) + // return (track.mcParticle().pdgCode() == (fDeuteronAnalysis) ? 1000010020 : 1000020030); if (track.sign() < 0) return false; if (fDeuteronAnalysis) { @@ -457,20 +474,14 @@ struct AngularCorrelationsInJets { return false; registryData.fill(HIST("hTPCnsigmaNucleiCF"), track.pt(), track.tpcNSigmaDe()); + registryData.fill(HIST("hTOFnsigmaNucleiCF"), track.pt(), track.tofNSigmaDe()); - // TPC - if (track.pt() < fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fNucleiTPCnsigLowCF) + // nsigma + double tofNsigma = track.hasTOF() ? track.tofNSigmaDe() : 999; + if ((track.pt() < fNucleiTPCTOFpT && (TMath::Abs(track.tpcNSigmaDe()) > fNucleiNsigma)) || (track.pt() > fNucleiTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaDe() * track.tpcNSigmaDe() + tofNsigma * tofNsigma) > fNucleiNsigma))) return false; - if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fNucleiTPCnsigHighCF) + if (!singleSpeciesTPCNSigma(track, 2)) return false; - - registryData.fill(HIST("hTOFnsigmaNucleiCF"), track.pt(), track.tofNSigmaDe()); - - // TOF - if (track.hasTOF()) { - if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tofNSigmaDe()) > fNucleiTOFnsigCF) - return false; - } } else { // for yields // DCA if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyYield) @@ -503,20 +514,14 @@ struct AngularCorrelationsInJets { return false; registryData.fill(HIST("hTPCnsigmaNucleiCF"), track.pt(), track.tpcNSigmaHe()); + registryData.fill(HIST("hTOFnsigmaNucleiCF"), track.pt(), track.tofNSigmaHe()); - // TPC - if (track.pt() < fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fNucleiTPCnsigLowCF) + // nsigma + double tofNsigma = track.hasTOF() ? track.tofNSigmaHe() : 999; + if ((track.pt() < fNucleiTPCTOFpT && (TMath::Abs(track.tpcNSigmaHe()) > fNucleiNsigma)) || (track.pt() > fNucleiTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaHe() * track.tpcNSigmaHe() + tofNsigma * tofNsigma) > fNucleiNsigma))) return false; - if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fNucleiTPCnsigHighCF) + if (!singleSpeciesTPCNSigma(track, 3)) return false; - - registryData.fill(HIST("hTOFnsigmaNucleiCF"), track.pt(), track.tofNSigmaHe()); - - // TOF - if (track.hasTOF()) { - if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tofNSigmaHe()) > fNucleiTOFnsigCF) - return false; - } } else { // for yields // DCA if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyYield) @@ -548,6 +553,8 @@ struct AngularCorrelationsInJets { template bool isAntinucleus(const T& track, bool tightCuts) { + // if (doprocessMCRun3) + // return (track.mcParticle().pdgCode() == (fDeuteronAnalysis) ? -1000010020 : -1000020030); if (track.sign() > 0) return false; @@ -560,17 +567,13 @@ struct AngularCorrelationsInJets { return false; registryData.fill(HIST("hTPCnsigmaAntinucleiCF"), track.pt(), track.tpcNSigmaDe()); - - // TPC - if (track.pt() < fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fAntinucleiTPCnsigLowCF) - return false; - if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fAntinucleiTPCnsigHighCF) - return false; - registryData.fill(HIST("hTOFnsigmaAntinucleiCF"), track.pt(), track.tofNSigmaDe()); - // TOF - if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tofNSigmaDe()) > fAntinucleiTOFnsigCF) + // nsigma + double tofNsigma = track.hasTOF() ? track.tofNSigmaDe() : 999; + if ((track.pt() < fAntinucleiTPCTOFpT && (TMath::Abs(track.tpcNSigmaDe()) > fAntinucleiNsigma)) || (track.pt() > fAntinucleiTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaDe() * track.tpcNSigmaDe() + tofNsigma * tofNsigma) > fAntinucleiNsigma))) + return false; + if (!singleSpeciesTPCNSigma(track, 2)) return false; } else { // for yields // DCA @@ -602,17 +605,13 @@ struct AngularCorrelationsInJets { return false; registryData.fill(HIST("hTPCnsigmaAntinucleiCF"), track.pt(), track.tpcNSigmaHe()); - - // TPC - if (track.pt() < fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fAntinucleiTPCnsigLowCF) - return false; - if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fAntinucleiTPCnsigHighCF) - return false; - registryData.fill(HIST("hTOFnsigmaAntinucleiCF"), track.pt(), track.tofNSigmaHe()); - // TOF - if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tofNSigmaHe()) > fAntinucleiTOFnsigCF) + // nsigma + double tofNsigma = track.hasTOF() ? track.tofNSigmaHe() : 999; + if ((track.pt() < fAntinucleiTPCTOFpT && (TMath::Abs(track.tpcNSigmaHe()) > fAntinucleiNsigma)) || (track.pt() > fAntinucleiTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaHe() * track.tpcNSigmaHe() + tofNsigma * tofNsigma) > fAntinucleiNsigma))) + return false; + if (!singleSpeciesTPCNSigma(track, 3)) return false; } else { // for yields // DCA @@ -640,7 +639,7 @@ struct AngularCorrelationsInJets { return true; } - void setTrackBuffer(const auto& tempBuffer, auto& buffer) + void setTrackBuffer(const auto& tempBuffer, auto& buffer) // refresh track buffer { for (const auto& pair : tempBuffer) { if (static_cast(buffer.size()) == fBufferSize) { @@ -652,7 +651,7 @@ struct AngularCorrelationsInJets { } } - void fillMixedEventDeltas(const auto& track, const auto& buffer, int particleType, const TVector3 jetAxis) + void fillMixedEventDeltas(const auto& track, const auto& buffer, int particleType, const TVector3 jetAxis) // correlate tracks from current event with tracks from buffer, i.e. other events { if (buffer.size() == 0) return; @@ -876,7 +875,7 @@ struct AngularCorrelationsInJets { if (Delta > maxRadius) maxRadius = Delta; } - registryQA.fill(HIST("hMaxRadiusVsPt"), jet.pt(), maxRadius); // no entries - weird! + registryQA.fill(HIST("hMaxRadiusVsPt"), jet.pt(), maxRadius); // QA for comparison with nuclei_in_jets TVector3 pJet(0., 0., 0.); @@ -978,6 +977,7 @@ struct AngularCorrelationsInJets { continue; if (isProton(jetParticle, false)) { // collect protons in jet registryData.fill(HIST("hPtJetProton"), jetParticle.pt()); + registryQA.fill(HIST("hPtJetProtonVsTotalJet"), jetParticle.pt(), subtractedJetPerp.pt()); if (subtractedJetPerp.pt() < 15) { registryQA.fill(HIST("hPtJetProton_15"), jetParticle.pt()); } else if (subtractedJetPerp.pt() < 20) { @@ -987,8 +987,6 @@ struct AngularCorrelationsInJets { } else if (subtractedJetPerp.pt() < 50) { registryQA.fill(HIST("hPtJetProton_50"), jetParticle.pt()); } - if (jetParticle.hasTOF()) - registryData.fill(HIST("hTOFnsigmaProton"), jetParticle.pt(), jetParticle.tofNSigmaPr()); registryData.fill(HIST("hTrackProtocol"), 4); // # protons if (isProton(jetParticle, true)) { registryData.fill(HIST("hTrackProtocol"), 5); // # high purity protons @@ -997,6 +995,7 @@ struct AngularCorrelationsInJets { } } else if (isAntiproton(jetParticle, false)) { // collect antiprotons in jet registryData.fill(HIST("hPtJetAntiproton"), jetParticle.pt()); + registryQA.fill(HIST("hPtJetAntiprotonVsTotalJet"), jetParticle.pt(), subtractedJetPerp.pt()); if (subtractedJetPerp.pt() < 15) { registryQA.fill(HIST("hPtJetAntiproton_15"), jetParticle.pt()); } else if (subtractedJetPerp.pt() < 20) { @@ -1006,9 +1005,6 @@ struct AngularCorrelationsInJets { } else if (subtractedJetPerp.pt() < 50) { registryQA.fill(HIST("hPtJetAntiproton_50"), jetParticle.pt()); } - registryData.fill(HIST("hTPCnsigmaAntiproton"), jetParticle.pt(), jetParticle.tpcNSigmaPr()); - if (jetParticle.hasTOF()) - registryData.fill(HIST("hTOFnsigmaAntiproton"), jetParticle.pt(), jetParticle.tofNSigmaPr()); registryData.fill(HIST("hTrackProtocol"), 6); // # antiprotons if (isAntiproton(jetParticle, true)) { registryData.fill(HIST("hTrackProtocol"), 7); // # high purity antiprotons @@ -1017,6 +1013,7 @@ struct AngularCorrelationsInJets { } } else if (isNucleus(jetParticle, false)) { // collect nuclei in jet registryData.fill(HIST("hPtJetNuclei"), jetParticle.pt()); + registryQA.fill(HIST("hPtJetNucleiVsTotalJet"), jetParticle.pt(), subtractedJetPerp.pt()); if (subtractedJetPerp.pt() < 15) { registryQA.fill(HIST("hPtJetNuclei_15"), jetParticle.pt()); } else if (subtractedJetPerp.pt() < 20) { @@ -1026,18 +1023,6 @@ struct AngularCorrelationsInJets { } else if (subtractedJetPerp.pt() < 50) { registryQA.fill(HIST("hPtJetNuclei_50"), jetParticle.pt()); } - if (fDeuteronAnalysis) { - registryData.fill(HIST("hTPCnsigmaNuclei"), jetParticle.pt(), jetParticle.tpcNSigmaDe()); - } else { - registryData.fill(HIST("hTPCnsigmaNuclei"), jetParticle.pt(), jetParticle.tpcNSigmaHe()); - } - if (jetParticle.hasTOF()) { - if (fDeuteronAnalysis) { - registryData.fill(HIST("hTOFnsigmaNuclei"), jetParticle.pt(), jetParticle.tofNSigmaDe()); - } else { - registryData.fill(HIST("hTOFnsigmaNuclei"), jetParticle.pt(), jetParticle.tofNSigmaHe()); - } - } registryData.fill(HIST("hTrackProtocol"), 8); // # nuclei if (isNucleus(jetParticle, true)) { registryData.fill(HIST("hTrackProtocol"), 9); // # high purity nuclei @@ -1046,6 +1031,7 @@ struct AngularCorrelationsInJets { } } else if (isAntinucleus(jetParticle, false)) { registryData.fill(HIST("hPtJetAntinuclei"), jetParticle.pt()); + registryQA.fill(HIST("hPtJetAntinucleiVsTotalJet"), jetParticle.pt(), subtractedJetPerp.pt()); if (subtractedJetPerp.pt() < 15) { registryQA.fill(HIST("hPtJetAntinuclei_15"), jetParticle.pt()); } else if (subtractedJetPerp.pt() < 20) { @@ -1055,18 +1041,6 @@ struct AngularCorrelationsInJets { } else if (subtractedJetPerp.pt() < 50) { registryQA.fill(HIST("hPtJetAntinuclei_50"), jetParticle.pt()); } - if (fDeuteronAnalysis) { - registryData.fill(HIST("hTPCnsigmaAntinuclei"), jetParticle.pt(), jetParticle.tpcNSigmaDe()); - } else { - registryData.fill(HIST("hTPCnsigmaAntinuclei"), jetParticle.pt(), jetParticle.tpcNSigmaHe()); - } - if (jetParticle.hasTOF()) { - if (fDeuteronAnalysis) { - registryData.fill(HIST("hTOFnsigmaAntinuclei"), jetParticle.pt(), jetParticle.tofNSigmaDe()); - } else { - registryData.fill(HIST("hTOFnsigmaAntinuclei"), jetParticle.pt(), jetParticle.tofNSigmaHe()); - } - } registryData.fill(HIST("hTrackProtocol"), 10); // # antinuclei if (isAntinucleus(jetParticle, true)) { registryData.fill(HIST("hTrackProtocol"), 11); // # high purity antinuclei @@ -1144,10 +1118,6 @@ struct AngularCorrelationsInJets { mass = 0.139; } - // if (track.pt() > fMinLeadingPt) { - // leadingID = track.globalIndex(); - // } - if (track.tpcNClsFindable() != 0) { registryQA.fill(HIST("hRatioCrossedRowsTPC"), track.pt(), track.tpcNClsCrossedRows() / track.tpcNClsFindable()); } @@ -1246,6 +1216,24 @@ struct AngularCorrelationsInJets { } } PROCESS_SWITCH(AngularCorrelationsInJets, processRun3, "process Run 3 data", false); + + // void processMCRun3(McCollisions const& collisions, soa::Filtered const& tracks) + // { + // for (const auto& collision : collisions) { + // registryMC.fill(HIST("hEventProtocol"), 0); + // if (!collision.sel8()) + // continue; + // registryMC.fill(HIST("hNumberOfEvents"), 0); + // registryMC.fill(HIST("hEventProtocol"), 1); + // if (TMath::Abs(collision.posZ()) > fZVtx) + // continue; + + // auto slicedTracks = tracks.sliceBy(perCollisionMcTracksRun3, collision.globalIndex()); + + // fillHistograms(slicedTracks); + // } + // } + // PROCESS_SWITCH(AngularCorrelationsInJets, processMCRun3, "process Run 3 MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 54931a04476bb454c625fea383a29d955d7d0f05 Mon Sep 17 00:00:00 2001 From: Andrea Sofia Triolo Date: Wed, 11 Dec 2024 23:54:23 +0100 Subject: [PATCH 350/459] [PWGLF] nonPromptCascade task: fixed check on cascades from HF (#8944) --- PWGLF/Tasks/Strangeness/nonPromptCascade.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx index 45e7e635847..00478a4cef5 100644 --- a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx +++ b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx @@ -597,9 +597,11 @@ struct NonPromptCascadeTask { int pdgCodeMom = 0; std::tuple fromHF{false, false}; - if (isGoodCascade && isGoodMatch) { + if (isGoodCascade) { fromHF = isFromHF(track.mcParticle()); - pdgCodeMom = track.mcParticle().has_mothers() ? track.mcParticle().mothers_as()[0].pdgCode() : 0; + if (isGoodMatch) { + pdgCodeMom = track.mcParticle().has_mothers() ? track.mcParticle().mothers_as()[0].pdgCode() : 0; + } } int itsTrackPDG = ITStrack.has_mcParticle() ? ITStrack.mcParticle().pdgCode() : 0; float deltaPtITSCascade = std::hypot(cascadeMomentum[0], cascadeMomentum[1]) - ITStrack.pt(); From c620940703637b8c6e44533997e13d88426068ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 12 Dec 2024 00:26:42 +0100 Subject: [PATCH 351/459] [PWGHF] Fix compilation warnings (#8946) --- PWGHF/HFC/Tasks/taskFlow.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index bd84b6982b1..fd87b1c5fe0 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -1677,7 +1677,7 @@ struct HfTaskFlow { // return size; // }; - auto getMultiplicity = [&collisions, this](FilteredCollisionsWSelMult::iterator const& collision) { + auto getMultiplicity = [](FilteredCollisionsWSelMult::iterator const& collision) { auto multiplicity = collision.numContrib(); return multiplicity; }; @@ -1696,7 +1696,7 @@ struct HfTaskFlow { HfCandidatesSelD0 const& candidates) { // we want to group collisions based on charged-track multiplicity - auto getMultiplicity = [&collisions, this](FilteredCollisionsWSelMult::iterator const& collision) { + auto getMultiplicity = [](FilteredCollisionsWSelMult::iterator const& collision) { auto multiplicity = collision.numContrib(); return multiplicity; }; @@ -1740,7 +1740,7 @@ struct HfTaskFlow { // return size; // }; - auto getMultiplicity = [&collisions, this](FilteredCollisionsWSelMult::iterator const& collision) { + auto getMultiplicity = [](FilteredCollisionsWSelMult::iterator const& collision) { auto multiplicity = collision.numContrib(); return multiplicity; }; @@ -1759,7 +1759,7 @@ struct HfTaskFlow { TracksWDcaSel const& /*tracks*/) { // we want to group collisions based on charged-track multiplicity - auto getMultiplicity = [&collisions, this](FilteredCollisionsWSelMult::iterator const& collision) { + auto getMultiplicity = [](FilteredCollisionsWSelMult::iterator const& collision) { auto multiplicity = collision.numContrib(); return multiplicity; }; @@ -1778,7 +1778,7 @@ struct HfTaskFlow { { // we want to group collisions based on charged-track multiplicity - auto getMultiplicity = [&collisions, this](FilteredCollisionsWSelMult::iterator const& collision) { + auto getMultiplicity = [](FilteredCollisionsWSelMult::iterator const& collision) { auto multiplicity = collision.numContrib(); return multiplicity; }; From 9663ea33d2061a7c68a958cbd566517860adbd25 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Thu, 12 Dec 2024 00:28:43 +0100 Subject: [PATCH 352/459] [PWGEM/Dilepton] update dilepton HBT (#8948) --- PWGEM/Dilepton/Core/DielectronCut.cxx | 2 +- PWGEM/Dilepton/Core/Dilepton.h | 1 + PWGEM/Dilepton/Core/DileptonMC.h | 1 + PWGEM/Dilepton/Core/PhotonHBT.h | 134 ++++++++++-------- PWGEM/Dilepton/Core/SingleTrackQC.h | 1 + PWGEM/Dilepton/Core/SingleTrackQCMC.h | 1 + .../TableProducer/filterDielectronEvent.cxx | 56 ++++++-- PWGEM/Dilepton/Tasks/vpPairQC.cxx | 12 ++ PWGEM/Dilepton/Tasks/vpPairQCMC.cxx | 1 + PWGEM/PhotonMeson/Tasks/pcmQC.cxx | 11 +- PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx | 11 +- 11 files changed, 151 insertions(+), 80 deletions(-) diff --git a/PWGEM/Dilepton/Core/DielectronCut.cxx b/PWGEM/Dilepton/Core/DielectronCut.cxx index baeeda564ec..ba55fc3e86a 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.cxx +++ b/PWGEM/Dilepton/Core/DielectronCut.cxx @@ -34,7 +34,7 @@ void DielectronCut::SetPairYRange(float minY, float maxY) { mMinPairY = minY; mMaxPairY = maxY; - LOG(info) << "Dielectron Cut, set pair eta range: " << mMinPairY << " - " << mMaxPairY; + LOG(info) << "Dielectron Cut, set pair y range: " << mMinPairY << " - " << mMaxPairY; } void DielectronCut::SetPairDCARange(float min, float max) { diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 757c8d04a56..f0a9ff8fc2b 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -636,6 +636,7 @@ struct Dilepton { fEMEventCut.SetRequireNoCollInTimeRangeStrict(eventcuts.cfgRequireNoCollInTimeRangeStrict); fEMEventCut.SetRequireNoCollInITSROFStandard(eventcuts.cfgRequireNoCollInITSROFStandard); fEMEventCut.SetRequireNoCollInITSROFStrict(eventcuts.cfgRequireNoCollInITSROFStrict); + fEMEventCut.SetRequireNoHighMultCollInPrevRof(eventcuts.cfgRequireNoHighMultCollInPrevRof); } o2::analysis::MlResponseDielectronSingleTrack mlResponseSingleTrack; diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index d4291adb641..c6dca140962 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -537,6 +537,7 @@ struct DileptonMC { fEMEventCut.SetRequireNoCollInTimeRangeStrict(eventcuts.cfgRequireNoCollInTimeRangeStrict); fEMEventCut.SetRequireNoCollInITSROFStandard(eventcuts.cfgRequireNoCollInITSROFStandard); fEMEventCut.SetRequireNoCollInITSROFStrict(eventcuts.cfgRequireNoCollInITSROFStrict); + fEMEventCut.SetRequireNoHighMultCollInPrevRof(eventcuts.cfgRequireNoHighMultCollInPrevRof); } o2::analysis::MlResponseDielectronSingleTrack mlResponseSingleTrack; diff --git a/PWGEM/Dilepton/Core/PhotonHBT.h b/PWGEM/Dilepton/Core/PhotonHBT.h index f52b2e626b3..9b395559216 100644 --- a/PWGEM/Dilepton/Core/PhotonHBT.h +++ b/PWGEM/Dilepton/Core/PhotonHBT.h @@ -100,8 +100,6 @@ struct PhotonHBT { Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; Configurable cfgCentMin{"cfgCentMin", 0, "min. centrality"}; Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; - // Configurable cfgSpherocityMin{"cfgSpherocityMin", -999.f, "min. spherocity"}; - // Configurable cfgSpherocityMax{"cfgSpherocityMax", +999.f, "max. spherocity"}; Configurable maxY{"maxY", 0.8, "maximum rapidity for reconstructed particles"}; Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; Configurable ndepth{"ndepth", 100, "depth for event mixing"}; @@ -114,8 +112,12 @@ struct PhotonHBT { Configurable cfgNtracksPV08Min{"cfgNtracksPV08Min", -1, "min. multNTracksPV"}; Configurable cfgNtracksPV08Max{"cfgNtracksPV08Max", static_cast(1e+9), "max. multNTracksPV"}; Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", true, "flag to apply weighting by 1/N"}; + Configurable cfgUseLCMS{"cfgUseLCMS", true, "measure relative momentum in LCMS for 1D"}; // always in LCMS for 3D + ConfigurableAxis ConfQBins{"ConfQBins", {60, 0, +0.3f}, "q bins for output histograms"}; ConfigurableAxis ConfKtBins{"ConfKtBins", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0}, "kT bins for output histograms"}; + ConfigurableAxis ConfM1Bins{"ConfM1Bins", {VARIABLE_WIDTH, 0.0, 0.14, 0.5, 1.1, 2.7, 3.2, 4.0}, "m1 bins for output histograms"}; + ConfigurableAxis ConfM2Bins{"ConfM2Bins", {VARIABLE_WIDTH, 0.0, 0.14, 0.5, 1.1, 2.7, 3.2, 4.0}, "m1 bins for output histograms"}; EMEventCut fEMEventCut; struct : ConfigurableGroup { @@ -137,6 +139,7 @@ struct PhotonHBT { Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; } eventcuts; V0PhotonCut fV0PhotonCut; @@ -177,20 +180,16 @@ struct PhotonHBT { Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 2.0, "max pair dca3d in sigma"}; + Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; Configurable cfg_apply_pf{"cfg_apply_pf", false, "flag to apply phiv prefilter"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - Configurable cfg_apply_phiv_meedep{"cfg_apply_phiv_meedep", true, "flag to apply mee-dependent phiv cut"}; Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; - Configurable cfg_min_mee_for_phiv{"cfg_min_mee_for_phiv", 0.0, "min mee for phiv (constant)"}; - Configurable cfg_max_mee_for_phiv{"cfg_max_mee_for_phiv", 1e+10, "max mee for phiv (constant)"}; Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "max eta for single track"}; Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; Configurable cfg_max_dca3dsigma_track{"cfg_max_dca3dsigma_track", 1e+10, "max DCA 3D in sigma"}; @@ -201,14 +200,16 @@ struct PhotonHBT { Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; + Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.1, "max dca XY for single track in cm"}; + Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; Configurable cfg_min_p_its_cluster_size{"cfg_min_p_its_cluster_size", 0.0, "min p to apply ITS cluster size cut"}; Configurable cfg_max_p_its_cluster_size{"cfg_max_p_its_cluster_size", 0.0, "max p to apply ITS cluster size cut"}; Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; @@ -368,7 +369,7 @@ struct PhotonHBT { engine = std::mt19937(seed_gen()); dist01 = std::uniform_int_distribution(0, 1); - fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{1001, -0.5, 1000.5}}, true); + fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); if (doprocessTriggerAnalysis) { fRegistry.add("Event/hNInspectedTVX", "N inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true); } @@ -427,27 +428,41 @@ struct PhotonHBT { fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); // pair info - const AxisSpec axis_kt{ConfKtBins, "k_{T} (GeV/c)"}; - const AxisSpec axis_qinv{60, 0.0, +0.3, "q_{inv} (GeV/c)"}; - const AxisSpec axis_kstar{60, 0.0, +0.3, "k* (GeV/c)"}; - const AxisSpec axis_qabs_lcms{60, 0.0, +0.3, "|#bf{q}|^{LCMS} (GeV/c)"}; - const AxisSpec axis_qout{60, 0.0, +0.3, "q_{out} (GeV/c)"}; // qout does not change between LAB and LCMS frame - const AxisSpec axis_qside{60, 0.0, +0.3, "q_{side} (GeV/c)"}; // qside does not change between LAB and LCMS frame - const AxisSpec axis_qlong{60, 0.0, +0.3, "q_{long} (GeV/c)"}; + std::string m1_axis_title = "m_{#gamma} (GeV/c^{2})"; + std::string m2_axis_title = "m_{#gamma*} (GeV/c^{2})"; + if constexpr (pairtype == ggHBTPairType::kPCMPCM) { + m1_axis_title = "m_{#gamma} (GeV/c^{2})"; + m2_axis_title = "m_{#gamma} (GeV/c^{2})"; + } else if constexpr (pairtype == ggHBTPairType::kPCMEE) { + m1_axis_title = "m_{#gamma} (GeV/c^{2})"; + m2_axis_title = "m_{#gamma*} (GeV/c^{2})"; + } else if constexpr (pairtype == ggHBTPairType::kEEEE) { + m1_axis_title = "m_{#gamma*} (GeV/c^{2})"; + m2_axis_title = "m_{#gamma*} (GeV/c^{2})"; + } + const AxisSpec axis_m1{ConfM1Bins, m1_axis_title}; + const AxisSpec axis_m2{ConfM2Bins, m2_axis_title}; - if (cfgDo3D) { - fRegistry.add("Pair/same/hs_3d", "diphoton correlation 3D LCMS", kTHnSparseD, {axis_qout, axis_qside, axis_qlong, axis_kt}, true); - } else { - if constexpr (pairtype == ggHBTPairType::kPCMPCM) { // identical particle femtoscopy - fRegistry.add("Pair/same/hs_1d", "diphoton correlation 1D", kTHnSparseD, {axis_qinv, axis_qabs_lcms, axis_kt}, true); - } else { // non-identical particle femtoscopy - fRegistry.add("Pair/same/hs_1d", "diphoton correlation 1D", kTHnSparseD, {axis_kstar, axis_qabs_lcms, axis_kt}, true); + const AxisSpec axis_kt{ConfKtBins, "k_{T} (GeV/c)"}; + const AxisSpec axis_qinv{ConfQBins, "q_{inv} (GeV/c)"}; + const AxisSpec axis_qabs_lcms{ConfQBins, "|#bf{q}|^{LCMS} (GeV/c)"}; + const AxisSpec axis_qout{ConfQBins, "q_{out} (GeV/c)"}; // qout does not change between LAB and LCMS frame + const AxisSpec axis_qside{ConfQBins, "q_{side} (GeV/c)"}; // qside does not change between LAB and LCMS frame + const AxisSpec axis_qlong{ConfQBins, "q_{long} (GeV/c)"}; + + if (cfgDo3D) { // 3D + fRegistry.add("Pair/same/hs_3d", "diphoton correlation 3D LCMS", kTHnSparseD, {axis_qout, axis_qside, axis_qlong, axis_kt, axis_m1, axis_m2}, true); + } else { // 1D + if (cfgUseLCMS) { + fRegistry.add("Pair/same/hs_1d", "diphoton correlation 1D LCMS", kTHnSparseD, {axis_qabs_lcms, axis_kt, axis_m1, axis_m2}, true); + } else { + fRegistry.add("Pair/same/hs_1d", "diphoton correlation 1D", kTHnSparseD, {axis_qinv, axis_kt, axis_m1, axis_m2}, true); } } - fRegistry.add("Pair/same/hDeltaEtaDeltaPhi", "distance between 2 LS tracks in #eta-#varphi plane;#Delta#varphi (rad.);#Delta#eta", kTH2D, {{80, -0.2, +0.2}, {80, -0.2, 0.2}}, true); // deta, dphi of track momentum - if constexpr (pairtype == ggHBTPairType::kPCMPCM) { // dr, dz of conversion points - fRegistry.add("Pair/same/hDeltaRDeltaZ", "diphoton distance in RZ;#Deltar = #sqrt{(#Deltax)^{2} + (#Deltay)^{2}} (cm);|#Deltaz| (cm)", kTH2D, {{40, 0, 20}, {40, 0, 20}}, true); + fRegistry.add("Pair/same/hDeltaEtaDeltaPhi", "distance between 2 LS tracks in #eta-#varphi plane;#Delta#varphi (rad.);#Delta#eta", kTH2D, {{180, -M_PI, M_PI}, {200, -1, +1}}, true); // deta, dphi of track momentum + if constexpr (pairtype == ggHBTPairType::kPCMPCM) { + fRegistry.add("Pair/same/hDeltaRDeltaZ", "diphoton distance in RZ;#Deltar = #sqrt{(#Deltax)^{2} + (#Deltay)^{2}} (cm);|#Deltaz| (cm)", kTH2D, {{100, 0, 50}, {100, 0, 50}}, true); // dr, dz of conversion points } fRegistry.addClone("Pair/same/", "Pair/mix/"); @@ -468,6 +483,7 @@ struct PhotonHBT { fEMEventCut.SetRequireNoCollInTimeRangeStrict(eventcuts.cfgRequireNoCollInTimeRangeStrict); fEMEventCut.SetRequireNoCollInITSROFStandard(eventcuts.cfgRequireNoCollInITSROFStandard); fEMEventCut.SetRequireNoCollInITSROFStrict(eventcuts.cfgRequireNoCollInITSROFStrict); + fEMEventCut.SetRequireNoHighMultCollInPrevRof(eventcuts.cfgRequireNoHighMultCollInPrevRof); } void DefinePCMCut() @@ -516,7 +532,7 @@ struct PhotonHBT { if (pcmcuts.cfg_require_v0_with_tpconly) { fV0PhotonCut.SetRequireTPConly(true); fV0PhotonCut.SetMaxPCA(3.0); - fV0PhotonCut.SetRxyRange(36, 90); + fV0PhotonCut.SetRxyRange(32, 90); } if (pcmcuts.cfg_require_v0_on_wwire_ib) { fV0PhotonCut.SetMaxPCA(0.3); @@ -543,7 +559,7 @@ struct PhotonHBT { fDielectronCut.RequireITSib1st(dielectroncuts.cfg_require_itsib_1st); // for track - fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, 1e+10f); + fDielectronCut.SetTrackPtRange(dielectroncuts.cfg_min_pt_track, dielectroncuts.cfg_max_pt_track); fDielectronCut.SetTrackEtaRange(dielectroncuts.cfg_min_eta_track, dielectroncuts.cfg_max_eta_track); fDielectronCut.SetTrackDca3DRange(0.f, dielectroncuts.cfg_max_dca3dsigma_track); // in sigma fDielectronCut.SetMinNClustersTPC(dielectroncuts.cfg_min_ncluster_tpc); @@ -615,8 +631,8 @@ struct PhotonHBT { ROOT::Math::PxPyPzEVector v2_cartesian(v2); ROOT::Math::PxPyPzEVector q12_cartesian = (v1_cartesian - v2_cartesian) * rndm; float beta = (v1 + v2).Beta(); - float beta_x = beta * std::cos((v1 + v2).Phi()) * std::sin((v1 + v2).Theta()); - float beta_y = beta * std::sin((v1 + v2).Phi()) * std::sin((v1 + v2).Theta()); + // float beta_x = beta * std::cos((v1 + v2).Phi()) * std::sin((v1 + v2).Theta()); + // float beta_y = beta * std::sin((v1 + v2).Phi()) * std::sin((v1 + v2).Theta()); float beta_z = beta * std::cos((v1 + v2).Theta()); // longitudinally co-moving system (LCMS) @@ -631,13 +647,13 @@ struct PhotonHBT { // float qabs_lcms_tmp = std::sqrt(std::pow(qout_lcms, 2) + std::pow(qside_lcms, 2) + std::pow(qlong_lcms, 2)); // LOGF(info, "qabs_lcms = %f, qabs_lcms_tmp = %f", qabs_lcms, qabs_lcms_tmp); - // pair rest frame (PRF) - ROOT::Math::Boost boostPRF = ROOT::Math::Boost(-beta_x, -beta_y, -beta_z); - ROOT::Math::PxPyPzEVector v1_prf = boostPRF(v1_cartesian); - ROOT::Math::PxPyPzEVector v2_prf = boostPRF(v2_cartesian); - ROOT::Math::PxPyPzEVector rel_k = (v1_prf - v2_prf) * rndm; - float kstar = 0.5 * rel_k.P(); - // LOGF(info, "qabs_lcms = %f, qinv = %f, kstar = %f", qabs_lcms, qinv, kstar); + // // pair rest frame (PRF) + // ROOT::Math::Boost boostPRF = ROOT::Math::Boost(-beta_x, -beta_y, -beta_z); + // ROOT::Math::PxPyPzEVector v1_prf = boostPRF(v1_cartesian); + // ROOT::Math::PxPyPzEVector v2_prf = boostPRF(v2_cartesian); + // ROOT::Math::PxPyPzEVector rel_k = (v1_prf - v2_prf) * rndm; + // float kstar = 0.5 * rel_k.P(); + // // LOGF(info, "qabs_lcms = %f, qinv = %f, kstar = %f", qabs_lcms, qinv, kstar); // ROOT::Math::PxPyPzEVector v1_lcms_cartesian = bst_z(v1_cartesian); // ROOT::Math::PxPyPzEVector v2_lcms_cartesian = bst_z(v2_cartesian); @@ -654,12 +670,12 @@ struct PhotonHBT { // LOGF(info, "qabs_lcms = %f, qabs_lcms_tmp = %f", qabs_lcms, qabs_lcms_tmp); if (cfgDo3D) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("hs_3d"), fabs(qout_lcms), fabs(qside_lcms), fabs(qlong_lcms), kt, weight); // qosl can be [-inf, +inf] and CF is symmetric for pos and neg qosl. To reduce stat. unc. absolute value is taken here. + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("hs_3d"), fabs(qout_lcms), fabs(qside_lcms), fabs(qlong_lcms), kt, v1.M(), v2.M(), weight); // qosl can be [-inf, +inf] and CF is symmetric for pos and neg qosl. To reduce stat. unc. absolute value is taken here. } else { - if constexpr (pairtype == ggHBTPairType::kPCMPCM) { // identical particle femtoscopy - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("hs_1d"), qinv, qabs_lcms, kt, weight); + if (cfgUseLCMS) { + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("hs_1d"), qabs_lcms, kt, v1.M(), v2.M(), weight); } else { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("hs_1d"), kstar, qabs_lcms, kt, weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("hs_1d"), qinv, kt, v1.M(), v2.M(), weight); } } } @@ -763,11 +779,11 @@ struct PhotonHBT { continue; } - float deta_pos = pos1.eta() - pos2.eta(); - float dphi_pos = pos1.phi() - pos2.phi(); + float deta_pos = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? pos1.eta() - pos2.eta() : pos2.eta() - pos1.eta(); + float dphi_pos = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? pos1.phi() - pos2.phi() : pos2.phi() - pos1.phi(); o2::math_utils::bringToPMPi(dphi_pos); - float deta_ele = ele1.eta() - ele2.eta(); - float dphi_ele = ele1.phi() - ele2.phi(); + float deta_ele = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? ele1.eta() - ele2.eta() : ele2.eta() - ele1.eta(); + float dphi_ele = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? ele1.phi() - ele2.phi() : ele2.phi() - ele1.phi(); o2::math_utils::bringToPMPi(dphi_ele); if (ggpaircuts.applydEtadPhi && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { continue; @@ -872,11 +888,11 @@ struct PhotonHBT { std::pair pair_tmp = std::make_pair(std::make_pair(pos1.trackId(), ele1.trackId()), std::make_pair(pos2.trackId(), ele2.trackId())); if (std::find(used_pairs_per_collision.begin(), used_pairs_per_collision.end(), pair_tmp) == used_pairs_per_collision.end()) { - float deta_pos = pos1.eta() - pos2.eta(); - float dphi_pos = pos1.phi() - pos2.phi(); + float deta_pos = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? pos1.eta() - pos2.eta() : pos2.eta() - pos1.eta(); + float dphi_pos = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? pos1.phi() - pos2.phi() : pos2.phi() - pos1.phi(); o2::math_utils::bringToPMPi(dphi_pos); - float deta_ele = ele1.eta() - ele2.eta(); - float dphi_ele = ele1.phi() - ele2.phi(); + float deta_ele = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? ele1.eta() - ele2.eta() : ele2.eta() - ele1.eta(); + float dphi_ele = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? ele1.phi() - ele2.phi() : ele2.phi() - ele1.phi(); o2::math_utils::bringToPMPi(dphi_ele); if (ggpaircuts.applydEtadPhi && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { continue; @@ -981,11 +997,11 @@ struct PhotonHBT { ROOT::Math::PtEtaPhiMVector v_ele2(ele2.pt(), ele2.eta(), ele2.phi(), o2::constants::physics::MassElectron); ROOT::Math::PtEtaPhiMVector v2_ee = v_pos2 + v_ele2; - float deta_pos = pos1.eta() - pos2.eta(); - float dphi_pos = pos1.phi() - pos2.phi(); + float deta_pos = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? pos1.eta() - pos2.eta() : pos2.eta() - pos1.eta(); + float dphi_pos = pos1.sign() * pos1.pt() > pos2.sign() * pos2.pt() ? pos1.phi() - pos2.phi() : pos2.phi() - pos1.phi(); o2::math_utils::bringToPMPi(dphi_pos); - float deta_ele = ele1.eta() - ele2.eta(); - float dphi_ele = ele1.phi() - ele2.phi(); + float deta_ele = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? ele1.eta() - ele2.eta() : ele2.eta() - ele1.eta(); + float dphi_ele = ele1.sign() * ele1.pt() > ele2.sign() * ele2.pt() ? ele1.phi() - ele2.phi() : ele2.phi() - ele1.phi(); o2::math_utils::bringToPMPi(dphi_ele); if (ggpaircuts.applydEtadPhi && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { continue; @@ -1068,11 +1084,11 @@ struct PhotonHBT { continue; } - float deta_pos = pos1.Eta() - pos2.Eta(); - float dphi_pos = pos1.Phi() - pos2.Phi(); + float deta_pos = pos1.Pt() > pos2.Pt() ? pos1.Eta() - pos2.Eta() : pos2.Eta() - pos1.Eta(); + float dphi_pos = pos1.Pt() > pos2.Pt() ? pos1.Phi() - pos2.Phi() : pos2.Phi() - pos1.Phi(); o2::math_utils::bringToPMPi(dphi_pos); - float deta_ele = ele1.Eta() - ele2.Eta(); - float dphi_ele = ele1.Phi() - ele2.Phi(); + float deta_ele = ele1.Pt() < ele2.Pt() ? ele1.Eta() - ele2.Eta() : ele2.Eta() - ele1.Eta(); // flipped + float dphi_ele = ele1.Pt() < ele2.Pt() ? ele1.Phi() - ele2.Phi() : ele2.Phi() - ele1.Phi(); // flipped o2::math_utils::bringToPMPi(dphi_ele); if (ggpaircuts.applydEtadPhi && std::pow(deta_pos / ggpaircuts.cfgMinDeltaEta, 2) + std::pow(dphi_pos / ggpaircuts.cfgMinDeltaPhi, 2) < 1.f) { continue; diff --git a/PWGEM/Dilepton/Core/SingleTrackQC.h b/PWGEM/Dilepton/Core/SingleTrackQC.h index b1efa7d026d..a57c14309d4 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQC.h @@ -317,6 +317,7 @@ struct SingleTrackQC { fEMEventCut.SetRequireNoCollInTimeRangeStrict(eventcuts.cfgRequireNoCollInTimeRangeStrict); fEMEventCut.SetRequireNoCollInITSROFStandard(eventcuts.cfgRequireNoCollInITSROFStandard); fEMEventCut.SetRequireNoCollInITSROFStrict(eventcuts.cfgRequireNoCollInITSROFStrict); + fEMEventCut.SetRequireNoHighMultCollInPrevRof(eventcuts.cfgRequireNoHighMultCollInPrevRof); } o2::analysis::MlResponseDielectronSingleTrack mlResponseSingleTrack; diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index 6082f774fc3..45c40aa5c1f 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -369,6 +369,7 @@ struct SingleTrackQCMC { fEMEventCut.SetRequireNoCollInTimeRangeStrict(eventcuts.cfgRequireNoCollInTimeRangeStrict); fEMEventCut.SetRequireNoCollInITSROFStandard(eventcuts.cfgRequireNoCollInITSROFStandard); fEMEventCut.SetRequireNoCollInITSROFStrict(eventcuts.cfgRequireNoCollInITSROFStrict); + fEMEventCut.SetRequireNoHighMultCollInPrevRof(eventcuts.cfgRequireNoHighMultCollInPrevRof); } o2::analysis::MlResponseDielectronSingleTrack mlResponseSingleTrack; diff --git a/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx b/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx index 7e9155c04bc..3377fe4f3f6 100644 --- a/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx +++ b/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx @@ -13,6 +13,11 @@ /// \author daiki.sekihata@cern.ch #include +#include +#include +#include +#include + #include "Math/Vector4D.h" #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -66,26 +71,30 @@ struct filterDielectronEvent { // Operation and minimisation criteria Configurable fillQAHistogram{"fillQAHistogram", false, "flag to fill QA histograms"}; Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - Configurable min_ncluster_tpc{"min_ncluster_tpc", 10, "min ncluster tpc"}; - Configurable mincrossedrows{"mincrossedrows", 70, "min. crossed rows"}; + Configurable min_ncluster_tpc{"min_ncluster_tpc", 0, "min ncluster tpc"}; + Configurable mincrossedrows{"mincrossedrows", 80, "min. crossed rows"}; Configurable min_tpc_cr_findable_ratio{"min_tpc_cr_findable_ratio", 0.8, "min. TPC Ncr/Nf ratio"}; Configurable max_mean_its_cluster_size{"max_mean_its_cluster_size", 16.f, "max. x cos(lambda)"}; - Configurable max_p_for_its_cluster_size{"max_p_for_its_cluster_size", 0.2, "its cluster size cut is applied below this p"}; + Configurable max_p_for_its_cluster_size{"max_p_for_its_cluster_size", 0, "its cluster size cut is applied below this p"}; Configurable max_pin_for_pion_rejection{"max_pin_for_pion_rejection", -1, "pion rejection is applied below this pin"}; Configurable minitsncls{"minitsncls", 4, "min. number of ITS clusters"}; Configurable maxchi2tpc{"maxchi2tpc", 5.0, "max. chi2/NclsTPC"}; Configurable maxchi2its{"maxchi2its", 6.0, "max. chi2/NclsITS"}; Configurable minpt{"minpt", 0.15, "min pt for track"}; Configurable maxeta{"maxeta", 0.9, "eta acceptance"}; - Configurable dca_xy_max{"dca_xy_max", 1.0f, "max DCAxy in cm"}; - Configurable dca_z_max{"dca_z_max", 1.0f, "max DCAz in cm"}; - Configurable dca_3d_sigma_max{"dca_3d_sigma_max", 1e+10, "max DCA 3D in sigma"}; + Configurable dca_xy_max{"dca_xy_max", 0.1f, "max DCAxy in cm"}; + Configurable dca_z_max{"dca_z_max", 0.1f, "max DCAz in cm"}; + Configurable dca_3d_sigma_max{"dca_3d_sigma_max", 1.5, "max DCA 3D in sigma"}; Configurable minTPCNsigmaEl{"minTPCNsigmaEl", -2.5, "min. TPC n sigma for electron inclusion"}; Configurable maxTPCNsigmaEl{"maxTPCNsigmaEl", 3.5, "max. TPC n sigma for electron inclusion"}; Configurable maxTOFNsigmaEl{"maxTOFNsigmaEl", 3.5, "max. TOF n sigma for electron inclusion"}; Configurable minTPCNsigmaPi{"minTPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; Configurable maxTPCNsigmaPi{"maxTPCNsigmaPi", 2.0, "max. TPC n sigma for pion exclusion"}; - Configurable maxMee{"maxMee", 0.02, "max mee for virtual photon selection"}; + Configurable minTPCNsigmaKa{"minTPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + Configurable maxTPCNsigmaKa{"maxTPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + Configurable minTPCNsigmaPr{"minTPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + Configurable maxTPCNsigmaPr{"maxTPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + Configurable maxMee{"maxMee", 1e+10, "max mee for virtual photon selection"}; Configurable apply_phiv{"apply_phiv", true, "flag to apply phiv cut"}; Configurable slope{"slope", 0.0181, "slope for mee vs. phiv"}; @@ -280,14 +289,37 @@ struct filterDielectronEvent { template bool isElectron(TTrack const& track) { - if (track.tpcInnerParam() < max_pin_for_pion_rejection && (minTPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < maxTPCNsigmaPi)) { + return isElectron_TPChadrej(track) || isElectron_TOFreq(track); + } + + template + bool isElectron_TPChadrej(TTrack const& track) + { + if (track.tpcNSigmaEl() < minTPCNsigmaEl || maxTPCNsigmaEl < track.tpcNSigmaEl()) { return false; } - if (track.hasTOF()) { - return minTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < maxTPCNsigmaEl && fabs(track.tofNSigmaEl()) < maxTOFNsigmaEl; - } else { - return minTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < maxTPCNsigmaEl; + if (minTPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < maxTPCNsigmaPi) { + return false; + } + if (minTPCNsigmaKa < track.tpcNSigmaKa() && track.tpcNSigmaKa() < maxTPCNsigmaKa) { + return false; + } + if (minTPCNsigmaPr < track.tpcNSigmaPr() && track.tpcNSigmaPr() < maxTPCNsigmaPr) { + return false; + } + if (track.hasTOF() && (maxTOFNsigmaEl < fabs(track.tofNSigmaEl()))) { + return false; + } + return true; + } + + template + bool isElectron_TOFreq(TTrack const& track) + { + if (minTPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < maxTPCNsigmaPi) { + return false; } + return minTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < maxTPCNsigmaEl && fabs(track.tofNSigmaEl()) < maxTOFNsigmaEl; } template diff --git a/PWGEM/Dilepton/Tasks/vpPairQC.cxx b/PWGEM/Dilepton/Tasks/vpPairQC.cxx index 29c0738f7f2..c3a2aaa06e3 100644 --- a/PWGEM/Dilepton/Tasks/vpPairQC.cxx +++ b/PWGEM/Dilepton/Tasks/vpPairQC.cxx @@ -115,6 +115,7 @@ struct vpPairQC { Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; @@ -238,16 +239,19 @@ struct vpPairQC { fRegistry.add("Track/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", kTH2F, {{200, 0, 10}, {200, 0., 400}}, false); fRegistry.add("Track/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", kTH2F, {{200, 0, 10}, {200, 0., 400}}, false); + fRegistry.add("Track/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{pv} (GeV/c);(p_{in} - p_{pv})/p_{pv}", kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); fRegistry.add("Track/positive/hNclsTPC", "number of TPC clusters", kTH1F, {{161, -0.5, 160.5}}, false); fRegistry.add("Track/positive/hNcrTPC", "number of TPC crossed rows", kTH1F, {{161, -0.5, 160.5}}, false); fRegistry.add("Track/positive/hChi2TPC", "chi2/number of TPC clusters", kTH1F, {{100, 0, 10}}, false); fRegistry.add("Track/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable", kTH1F, {{200, 0, 2}}, false); fRegistry.add("Track/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable", kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); fRegistry.add("Track/positive/hNclsITS", "number of ITS clusters", kTH1F, {{8, -0.5, 7.5}}, false); fRegistry.add("Track/positive/hChi2ITS", "chi2/number of ITS clusters", kTH1F, {{100, 0, 10}}, false); fRegistry.add("Track/positive/hITSClusterMap", "ITS cluster map", kTH1F, {{128, -0.5, 127.5}}, false); fRegistry.add("Track/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); fRegistry.add("Track/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); + fRegistry.add("Track/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);chi2", kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); fRegistry.add("Track/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {160, 0, 16}}, false); fRegistry.add("Track/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); @@ -288,6 +292,7 @@ struct vpPairQC { fEMEventCut.SetRequireNoCollInTimeRangeStrict(eventcuts.cfgRequireNoCollInTimeRangeStrict); fEMEventCut.SetRequireNoCollInITSROFStandard(eventcuts.cfgRequireNoCollInITSROFStandard); fEMEventCut.SetRequireNoCollInITSROFStrict(eventcuts.cfgRequireNoCollInITSROFStrict); + fEMEventCut.SetRequireNoHighMultCollInPrevRof(eventcuts.cfgRequireNoHighMultCollInPrevRof); } o2::analysis::MlResponseDielectronSingleTrack mlResponseSingleTrack; @@ -313,6 +318,7 @@ struct vpPairQC { fDielectronCut.SetMinNClustersTPC(dielectroncuts.cfg_min_ncluster_tpc); fDielectronCut.SetMinNCrossedRowsTPC(dielectroncuts.cfg_min_ncrossedrows); fDielectronCut.SetMinNCrossedRowsOverFindableClustersTPC(0.8); + fDielectronCut.SetMaxFracSharedClustersTPC(dielectroncuts.cfg_max_frac_shared_clusters_tpc); fDielectronCut.SetChi2PerClusterTPC(0.0, dielectroncuts.cfg_max_chi2tpc); fDielectronCut.SetChi2PerClusterITS(0.0, dielectroncuts.cfg_max_chi2its); fDielectronCut.SetNClustersITS(dielectroncuts.cfg_min_ncluster_its, 7); @@ -425,8 +431,11 @@ struct vpPairQC { fRegistry.fill(HIST("Track/positive/hTPCNcr2Nf"), track.tpcCrossedRowsOverFindableCls()); fRegistry.fill(HIST("Track/positive/hTPCNcls2Nf"), track.tpcFoundOverFindableCls()); fRegistry.fill(HIST("Track/positive/hChi2TPC"), track.tpcChi2NCl()); + fRegistry.fill(HIST("Track/positive/hTPCNclsShared"), track.pt(), track.tpcFractionSharedCls()); + fRegistry.fill(HIST("Track/positive/hDeltaPin"), track.p(), (track.tpcInnerParam() - track.p()) / track.p()); fRegistry.fill(HIST("Track/positive/hChi2ITS"), track.itsChi2NCl()); fRegistry.fill(HIST("Track/positive/hITSClusterMap"), track.itsClusterMap()); + fRegistry.fill(HIST("Track/positive/hChi2TOF"), track.p(), track.tofChi2()); fRegistry.fill(HIST("Track/positive/hTPCdEdx"), track.tpcInnerParam(), track.tpcSignal()); fRegistry.fill(HIST("Track/positive/hTOFbeta"), track.p(), track.beta()); @@ -459,8 +468,11 @@ struct vpPairQC { fRegistry.fill(HIST("Track/negative/hTPCNcr2Nf"), track.tpcCrossedRowsOverFindableCls()); fRegistry.fill(HIST("Track/negative/hTPCNcls2Nf"), track.tpcFoundOverFindableCls()); fRegistry.fill(HIST("Track/negative/hChi2TPC"), track.tpcChi2NCl()); + fRegistry.fill(HIST("Track/negative/hTPCNclsShared"), track.pt(), track.tpcFractionSharedCls()); + fRegistry.fill(HIST("Track/negative/hDeltaPin"), track.p(), (track.tpcInnerParam() - track.p()) / track.p()); fRegistry.fill(HIST("Track/negative/hChi2ITS"), track.itsChi2NCl()); fRegistry.fill(HIST("Track/negative/hITSClusterMap"), track.itsClusterMap()); + fRegistry.fill(HIST("Track/negative/hChi2TOF"), track.p(), track.tofChi2()); fRegistry.fill(HIST("Track/negative/hTPCdEdx"), track.tpcInnerParam(), track.tpcSignal()); fRegistry.fill(HIST("Track/negative/hTOFbeta"), track.p(), track.beta()); diff --git a/PWGEM/Dilepton/Tasks/vpPairQCMC.cxx b/PWGEM/Dilepton/Tasks/vpPairQCMC.cxx index a687e5469a2..13bda4c1d87 100644 --- a/PWGEM/Dilepton/Tasks/vpPairQCMC.cxx +++ b/PWGEM/Dilepton/Tasks/vpPairQCMC.cxx @@ -299,6 +299,7 @@ struct vpPairQCMC { fEMEventCut.SetRequireNoCollInTimeRangeStrict(eventcuts.cfgRequireNoCollInTimeRangeStrict); fEMEventCut.SetRequireNoCollInITSROFStandard(eventcuts.cfgRequireNoCollInITSROFStandard); fEMEventCut.SetRequireNoCollInITSROFStrict(eventcuts.cfgRequireNoCollInITSROFStrict); + fEMEventCut.SetRequireNoHighMultCollInPrevRof(eventcuts.cfgRequireNoHighMultCollInPrevRof); } o2::analysis::MlResponseDielectronSingleTrack mlResponseSingleTrack; diff --git a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx index aa034a2ec39..2e8a39ed8de 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx @@ -56,8 +56,10 @@ struct PCMQC { Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgOccupancyMin{"cfgOccupancyMin", -1, "min. occupancy"}; - Configurable cfgOccupancyMax{"cfgOccupancyMax", 1000000000, "max. occupancy"}; + Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; } eventcuts; @@ -233,7 +235,7 @@ struct PCMQC { if (pcmcuts.cfg_require_v0_with_tpconly) { fV0PhotonCut.SetRequireTPConly(true); fV0PhotonCut.SetMaxPCA(3.0); - fV0PhotonCut.SetRxyRange(36, 90); + fV0PhotonCut.SetRxyRange(32, 90); } if (pcmcuts.cfg_require_v0_on_wwire_ib) { fV0PhotonCut.SetMaxPCA(0.3); @@ -339,7 +341,8 @@ struct PCMQC { Preslice perCollision = aod::v0photonkf::emeventId; Filter collisionFilter_centrality = (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); - Filter collisionFilter_occupancy = eventcuts.cfgOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgOccupancyMax; + Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin < o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; using FilteredMyCollisions = soa::Filtered; void processQC(FilteredMyCollisions const& collisions, MyV0Photons const& v0photons, aod::V0Legs const&) diff --git a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx index 54ad5d116d1..b1f445e558d 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx @@ -70,8 +70,10 @@ struct PCMQCMC { Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgOccupancyMin{"cfgOccupancyMin", -1, "min. occupancy"}; - Configurable cfgOccupancyMax{"cfgOccupancyMax", 1000000000, "max. occupancy"}; + Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; } eventcuts; @@ -290,7 +292,7 @@ struct PCMQCMC { if (pcmcuts.cfg_require_v0_with_tpconly) { fV0PhotonCut.SetRequireTPConly(true); fV0PhotonCut.SetMaxPCA(3.0); - fV0PhotonCut.SetRxyRange(36, 90); + fV0PhotonCut.SetRxyRange(32, 90); } if (pcmcuts.cfg_require_v0_on_wwire_ib) { fV0PhotonCut.SetMaxPCA(0.3); @@ -407,7 +409,8 @@ struct PCMQCMC { } Filter collisionFilter_centrality = (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); - Filter collisionFilter_occupancy = eventcuts.cfgOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgOccupancyMax; + Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin < o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; using FilteredMyCollisions = soa::Filtered; Preslice perCollision = aod::v0photonkf::emeventId; From 32b59c31b49a8a46d778b02e73cebdaced226141 Mon Sep 17 00:00:00 2001 From: Fernanda Torres <135931275+mtorresc15@users.noreply.github.com> Date: Wed, 11 Dec 2024 17:59:28 -0600 Subject: [PATCH 353/459] [PWGLF] Update on mother's decay length. (#8949) --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 51 +++++++++++++++++-------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index dd7d43705f6..5c766a92a6f 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -340,7 +340,7 @@ struct tofSpectra { const AxisSpec phiAxis{200, 0, 7, "#it{#varphi} (rad)"}; const AxisSpec dcaZAxis{binsOptions.binsDca, "DCA_{z} (cm)"}; const AxisSpec lengthAxis{100, 0, 600, "Track length (cm)"}; - const AxisSpec decayLengthAxis{100, 0, 0.1, "Decay Length (cm)"}; + const AxisSpec decayLengthAxis{100, 0, 0.5, "Decay Length (cm)"}; if (enableTrackCutHistograms) { const AxisSpec chargeAxis{2, -2.f, 2.f, "Charge"}; @@ -1650,12 +1650,15 @@ struct tofSpectra { histos.fill(HIST(hdcaxystr[i]), track.pt(), track.dcaXY()); histos.fill(HIST(hdcazstr[i]), track.pt(), track.dcaZ()); } - if (mcParticle.has_daughters()) { - auto daughter0 = mcParticle.template daughters_as().begin(); - double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()}; - double vertexPrimary[3] = {mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()}; - auto decayLength = RecoDecay::distance(vertexPrimary, vertexDau) / 10000; - hDecayLengthStr[i]->Fill(track.pt(), decayLength); + + if (mcParticle.has_mothers()) { + for (const auto& mother : mcParticle.template mothers_as()) { + auto daughter0 = mother.template daughters_as().begin(); + double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()}; + double vertexMoth[3] = {mother.vx(), mother.vy(), mother.vz()}; + auto decayLength = RecoDecay::distance(vertexMoth, vertexDau); + hDecayLengthStr[i]->Fill(track.pt(), decayLength); + } } } else { if (enableDCAxyzHistograms) { @@ -1722,23 +1725,25 @@ struct tofSpectra { hDcaZMCNotHF[i]->Fill(track.pt(), track.dcaZ()); } - if (mcParticle.has_daughters()) { - auto daughter0 = mcParticle.template daughters_as().begin(); - double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()}; - double vertexPrimary[3] = {mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()}; - auto decayLength = RecoDecay::distance(vertexPrimary, vertexDau) / 10000; + if (mcParticle.has_mothers()) { + for (const auto& mother : mcParticle.template mothers_as()) { + auto daughter0 = mother.template daughters_as().begin(); + double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()}; + double vertexMoth[3] = {mother.vx(), mother.vy(), mother.vz()}; + auto decayLength = RecoDecay::distance(vertexMoth, vertexDau); - if (IsD0Mother) { - hDecayLengthMCD0[i]->Fill(track.pt(), decayLength); - } - if (IsCharmMother) { - hDecayLengthMCCharm[i]->Fill(track.pt(), decayLength); - } - if (IsBeautyMother) { - hDecayLengthMCBeauty[i]->Fill(track.pt(), decayLength); - } - if (IsNotHFMother) { - hDecayLengthMCNotHF[i]->Fill(track.pt(), decayLength); + if (IsD0Mother) { + hDecayLengthMCD0[i]->Fill(track.pt(), decayLength); + } + if (IsCharmMother) { + hDecayLengthMCCharm[i]->Fill(track.pt(), decayLength); + } + if (IsBeautyMother) { + hDecayLengthMCBeauty[i]->Fill(track.pt(), decayLength); + } + if (IsNotHFMother) { + hDecayLengthMCNotHF[i]->Fill(track.pt(), decayLength); + } } } } From da0c2db9b5d2b4363471b5b0b0d2ddc8af2a3baf Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Thu, 12 Dec 2024 09:07:10 +0100 Subject: [PATCH 354/459] [PWGLF] Update Data Model and Improve DF Mixing Study for Resonances (#8950) --- PWGLF/DataModel/LFResonanceTables.h | 63 +++++++ PWGLF/DataModel/LFResonanceTablesMergeDF.h | 158 ------------------ .../Resonances/LFResonanceMergeDF.cxx | 18 +- PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx | 11 +- 4 files changed, 78 insertions(+), 172 deletions(-) delete mode 100644 PWGLF/DataModel/LFResonanceTablesMergeDF.h diff --git a/PWGLF/DataModel/LFResonanceTables.h b/PWGLF/DataModel/LFResonanceTables.h index b72dd1e745f..a446b97abc0 100644 --- a/PWGLF/DataModel/LFResonanceTables.h +++ b/PWGLF/DataModel/LFResonanceTables.h @@ -15,6 +15,8 @@ /// Inspired by StrangenessTables.h, FemtoDerived.h /// /// \author Bong-Hwi Lim +/// \author Nasir Mehdi Malik +/// #ifndef PWGLF_DATAMODEL_LFRESONANCETABLES_H_ #define PWGLF_DATAMODEL_LFRESONANCETABLES_H_ @@ -113,6 +115,25 @@ DECLARE_SOA_TABLE(ResoEvtPlCollisions, "AOD", "RESOEVTPLCOLL", resocollision::EvtPlResBC); using ResoEvtPlCollision = ResoEvtPlCollisions::iterator; +// For DF mixing study +DECLARE_SOA_TABLE(ResoCollisionDFs, "AOD", "RESOCOLLISIONDF", + o2::soa::Index<>, + resocollision::CollisionId, + o2::aod::mult::MultNTracksPV, + collision::PosX, + collision::PosY, + collision::PosZ, + resocollision::Cent, + resocollision::Spherocity, + resocollision::EvtPl, + resocollision::EvtPlResAB, + resocollision::EvtPlResAC, + resocollision::EvtPlResBC, + resocollision::BMagField, + timestamp::Timestamp, + evsel::NumTracksInTimeRange); +using ResoCollisionDF = ResoCollisionDFs::iterator; + // Resonance Daughters // inspired from PWGCF/DataModel/FemtoDerived.h namespace resodaughter @@ -230,6 +251,48 @@ DECLARE_SOA_TABLE(ResoTracks, "AOD", "RESOTRACKS", o2::aod::track::TPCChi2NCl); using ResoTrack = ResoTracks::iterator; +// For DF mixing study +DECLARE_SOA_TABLE(ResoTrackDFs, "AOD", "RESOTRACKDFs", + o2::soa::Index<>, + resodaughter::ResoCollisionId, + resodaughter::TrackId, + resodaughter::Pt, + resodaughter::Px, + resodaughter::Py, + resodaughter::Pz, + resodaughter::Eta, + resodaughter::Phi, + resodaughter::Sign, + resodaughter::TPCNClsCrossedRows, + resodaughter::TPCNClsFound, + resodaughter::ITSNCls, + o2::aod::track::DcaXY, + o2::aod::track::DcaZ, + o2::aod::track::X, + o2::aod::track::Alpha, + resodaughter::HasITS, + resodaughter::HasTPC, + resodaughter::HasTOF, + o2::aod::pidtpc::TPCNSigmaPi, + o2::aod::pidtpc::TPCNSigmaKa, + o2::aod::pidtpc::TPCNSigmaPr, + o2::aod::pidtpc::TPCNSigmaEl, + o2::aod::pidtof::TOFNSigmaPi, + o2::aod::pidtof::TOFNSigmaKa, + o2::aod::pidtof::TOFNSigmaPr, + o2::aod::pidtof::TOFNSigmaEl, + o2::aod::track::TPCSignal, + o2::aod::track::PassedITSRefit, + o2::aod::track::PassedTPCRefit, + resodaughter::IsGlobalTrackWoDCA, + resodaughter::IsGlobalTrack, + resodaughter::IsPrimaryTrack, + resodaughter::IsPVContributor, + resodaughter::TPCCrossedRowsOverFindableCls, + o2::aod::track::ITSChi2NCl, + o2::aod::track::TPCChi2NCl); +using ResoTrackDF = ResoTrackDFs::iterator; + DECLARE_SOA_TABLE(ResoV0s, "AOD", "RESOV0S", o2::soa::Index<>, resodaughter::ResoCollisionId, diff --git a/PWGLF/DataModel/LFResonanceTablesMergeDF.h b/PWGLF/DataModel/LFResonanceTablesMergeDF.h deleted file mode 100644 index 00ec4741956..00000000000 --- a/PWGLF/DataModel/LFResonanceTablesMergeDF.h +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file LFResonanceTables.h -/// \brief Definitions of tables of resonance decay candidates -/// -/// Inspired by StrangenessTables.h, FemtoDerived.h -/// -/// \author Bong-Hwi Lim -/// Nasir Mehdi Malik - -#ifndef PWGLF_DATAMODEL_LFRESONANCETABLESMERGEDF_H_ -#define PWGLF_DATAMODEL_LFRESONANCETABLESMERGEDF_H_ - -#include -#include - -#include "Common/DataModel/PIDResponse.h" -#include "Common/Core/RecoDecay.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisDataModel.h" - -namespace o2::aod -{ -/// Resonance Collisions -namespace resocollisiondf -{ -DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality (Multiplicity) percentile (Default: FT0M) -DECLARE_SOA_COLUMN(Spherocity, spherocity, float); //! Spherocity of the event -DECLARE_SOA_COLUMN(EvtPl, evtPl, float); //! Second harmonic event plane -DECLARE_SOA_COLUMN(EvtPlResAB, evtPlResAB, float); //! Second harmonic event plane resolution of A-B sub events -DECLARE_SOA_COLUMN(EvtPlResAC, evtPlResAC, float); //! Second harmonic event plane resolution of A-C sub events -DECLARE_SOA_COLUMN(EvtPlResBC, evtPlResBC, float); //! Second harmonic event plane resolution of B-C sub events -DECLARE_SOA_COLUMN(BMagField, bMagField, float); //! Magnetic field -} // namespace resocollisiondf -DECLARE_SOA_TABLE(ResoCollisionDFs, "AOD", "RESOCOLLISIONDF", - o2::soa::Index<>, - o2::aod::mult::MultNTracksPV, - collision::PosX, - collision::PosY, - collision::PosZ, - resocollisiondf::Cent, - resocollisiondf::Spherocity, - resocollisiondf::EvtPl, - resocollisiondf::EvtPlResAB, - resocollisiondf::EvtPlResAC, - resocollisiondf::EvtPlResBC, - resocollisiondf::BMagField, - timestamp::Timestamp, - evsel::NumTracksInTimeRange); -using ResoCollisionDF = ResoCollisionDFs::iterator; - -// Resonance Daughters -// inspired from PWGCF/DataModel/FemtoDerived.h -namespace resodaughterdf -{ - -DECLARE_SOA_INDEX_COLUMN(ResoCollisionDF, resoCollisiondf); -DECLARE_SOA_COLUMN(Pt, pt, float); //! p_T (GeV/c) -DECLARE_SOA_COLUMN(Px, px, float); //! p_x (GeV/c) -DECLARE_SOA_COLUMN(Py, py, float); //! p_y (GeV/c) -DECLARE_SOA_COLUMN(Pz, pz, float); //! p_z (GeV/c) -DECLARE_SOA_COLUMN(Eta, eta, float); //! Eta -DECLARE_SOA_COLUMN(Phi, phi, float); //! Phi -DECLARE_SOA_COLUMN(PartType, partType, uint8_t); //! Type of the particle, according to resodaughter::ParticleType -DECLARE_SOA_COLUMN(TempFitVar, tempFitVar, float); //! Observable for the template fitting (Track: DCA_xy, V0: CPA) -DECLARE_SOA_COLUMN(Indices, indices, int[2]); //! Field for the track indices to remove auto-correlations -DECLARE_SOA_COLUMN(CascadeIndices, cascIndices, int[3]); //! Field for the track indices to remove auto-correlations (ordered: positive, negative, bachelor) -DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! Sign of the track charge -DECLARE_SOA_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, uint8_t); //! Number of TPC crossed rows -DECLARE_SOA_COLUMN(TPCNClsFound, tpcNClsFound, uint8_t); //! Number of TPC clusters found -DECLARE_SOA_COLUMN(ITSNCls, itsNCls, uint8_t); //! Number of ITS clusters found -DECLARE_SOA_COLUMN(IsGlobalTrackWoDCA, isGlobalTrackWoDCA, bool); //! Is global track without DCA -DECLARE_SOA_COLUMN(IsGlobalTrack, isGlobalTrack, bool); //! Is global track -DECLARE_SOA_COLUMN(IsPrimaryTrack, isPrimaryTrack, bool); //! Is primary track -DECLARE_SOA_COLUMN(IsPVContributor, isPVContributor, bool); //! Is primary vertex contributor -DECLARE_SOA_COLUMN(HasITS, hasITS, bool); -DECLARE_SOA_COLUMN(HasTPC, hasTPC, bool); -DECLARE_SOA_COLUMN(HasTOF, hasTOF, bool); //! Has TOF -DECLARE_SOA_COLUMN(TPCCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls, float); -DECLARE_SOA_COLUMN(DaughDCA, daughDCA, float); //! DCA between daughters -DECLARE_SOA_COLUMN(CascDaughDCA, cascdaughDCA, float); //! DCA between daughters from cascade -DECLARE_SOA_COLUMN(V0CosPA, v0CosPA, float); //! V0 Cosine of Pointing Angle -DECLARE_SOA_COLUMN(CascCosPA, cascCosPA, float); //! Cascade Cosine of Pointing Angle -DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! The invariant mass of V0 candidate, assuming lambda -DECLARE_SOA_COLUMN(MAntiLambda, mAntiLambda, float); //! The invariant mass of V0 candidate, assuming antilambda -DECLARE_SOA_COLUMN(MK0Short, mK0Short, float); //! The invariant mass of V0 candidate, assuming k0s -DECLARE_SOA_COLUMN(MXi, mXi, float); //! The invariant mass of Xi candidate -DECLARE_SOA_COLUMN(TransRadius, transRadius, float); //! Transverse radius of the decay vertex -DECLARE_SOA_COLUMN(CascTransRadius, casctransRadius, float); //! Transverse radius of the decay vertex from cascade -DECLARE_SOA_COLUMN(DecayVtxX, decayVtxX, float); //! X position of the decay vertex -DECLARE_SOA_COLUMN(DecayVtxY, decayVtxY, float); //! Y position of the decay vertex -DECLARE_SOA_COLUMN(DecayVtxZ, decayVtxZ, float); //! Z position of the decay vertex -// For MC -DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! Index of the corresponding MC particle -DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); -DECLARE_SOA_COLUMN(ProducedByGenerator, producedByGenerator, bool); -DECLARE_SOA_COLUMN(MothersId, motherId, int); //! Id of the mother particle -DECLARE_SOA_COLUMN(MotherPDG, motherPDG, int); //! PDG code of the mother particle -DECLARE_SOA_COLUMN(DaughterPDG1, daughterPDG1, int); //! PDG code of the first Daughter particle -DECLARE_SOA_COLUMN(DaughterPDG2, daughterPDG2, int); //! PDG code of the second Daughter particle -DECLARE_SOA_COLUMN(DaughterID1, daughterId1, int); //! Id of the first Daughter particle -DECLARE_SOA_COLUMN(DaughterID2, daughterId2, int); //! Id of the second Daughter particle -DECLARE_SOA_COLUMN(SiblingIds, siblingIds, int[2]); //! Index of the particles with the same mother -DECLARE_SOA_COLUMN(BachTrkID, bachtrkID, int); //! Id of the bach track from cascade -DECLARE_SOA_COLUMN(V0ID, v0ID, int); //! Id of the V0 from cascade -} // namespace resodaughterdf -DECLARE_SOA_TABLE(ResoTrackDFs, "AOD", "RESOTRACKDFs", - o2::soa::Index<>, - resodaughterdf::ResoCollisionDFId, - resodaughterdf::Pt, - resodaughterdf::Px, - resodaughterdf::Py, - resodaughterdf::Pz, - resodaughterdf::Eta, - resodaughterdf::Phi, - resodaughterdf::Sign, - resodaughterdf::TPCNClsCrossedRows, - resodaughterdf::TPCNClsFound, - resodaughterdf::ITSNCls, - o2::aod::track::DcaXY, - o2::aod::track::DcaZ, - o2::aod::track::X, - o2::aod::track::Alpha, - resodaughterdf::HasITS, - resodaughterdf::HasTPC, - resodaughterdf::HasTOF, - o2::aod::pidtpc::TPCNSigmaPi, - o2::aod::pidtpc::TPCNSigmaKa, - o2::aod::pidtpc::TPCNSigmaPr, - o2::aod::pidtpc::TPCNSigmaEl, - o2::aod::pidtof::TOFNSigmaPi, - o2::aod::pidtof::TOFNSigmaKa, - o2::aod::pidtof::TOFNSigmaPr, - o2::aod::pidtof::TOFNSigmaEl, - o2::aod::track::TPCSignal, - o2::aod::track::PassedITSRefit, - o2::aod::track::PassedTPCRefit, - resodaughterdf::IsGlobalTrackWoDCA, - resodaughterdf::IsGlobalTrack, - resodaughterdf::IsPrimaryTrack, - resodaughterdf::IsPVContributor, - resodaughterdf::TPCCrossedRowsOverFindableCls, - o2::aod::track::ITSChi2NCl, - o2::aod::track::TPCChi2NCl); -using ResoTrackDF = ResoTrackDFs::iterator; - -} // namespace o2::aod -#endif // PWGLF_DATAMODEL_LFRESONANCETABLESMERGEDF_H_ diff --git a/PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx b/PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx index 9850a7bf23a..3d27c68d40e 100644 --- a/PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx +++ b/PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx @@ -44,7 +44,6 @@ #include "Framework/runDataProcessing.h" #include "Framework/O2DatabasePDGPlugin.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/LFResonanceTablesMergeDF.h" #include "PWGLF/DataModel/LFResonanceTables.h" #include "PWGLF/Utils/collisionCuts.h" #include "ReconstructionDataFormats/Track.h" @@ -89,8 +88,8 @@ struct reso2dfmerged { Produces reso2trksdf; int df = 0; - std::vector> vecOfTuples; - std::vector> vecOfTuples; + std::vector(tuple)); - resoCollisionsdf(0, std::get<0>(tuple), std::get<1>(tuple), std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple), std::get<5>(tuple), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange()); + resoCollisionsdf(std::get<0>(tuple), 0, std::get<1>(tuple), std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple), std::get<5>(tuple), std::get<6>(tuple), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange()); // LOGF(info, "collisions: Index = %d ) %f - %f - %f %f %d -- %d", std::get<0>(tuple).globalIndex(),std::get<1>(tuple),std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple), std::get<5>(tuple).size(),resoCollisionsdf.lastIndex()); for (const auto& tuple : innerVector) { @@ -223,7 +223,8 @@ struct reso2dfmerged { std::get<31>(tuple), std::get<32>(tuple), std::get<33>(tuple), - std::get<34>(tuple)); + std::get<34>(tuple), + std::get<35>(tuple)); } } @@ -242,7 +243,7 @@ struct reso2dfmerged { histos.fill(HIST("Event/h1d_ft0_mult_percentile"), collision.cent()); - resoCollisionsdf(0, collision.posX(), collision.posY(), collision.posZ(), collision.cent(), collision.spherocity(), collision.evtPl(), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange()); + resoCollisionsdf(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), collision.cent(), collision.spherocity(), collision.evtPl(), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange()); for (auto& track : tracks) { if (isPrimary && !track.isPrimaryTrack()) @@ -270,6 +271,7 @@ struct reso2dfmerged { continue; reso2trksdf(resoCollisionsdf.lastIndex(), + track.globalIndex(), track.pt(), track.px(), track.py(), diff --git a/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx b/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx index 74234cb8bd1..e7fc0ee3de9 100644 --- a/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx @@ -13,7 +13,7 @@ /// /// Invariant Mass Reconstruction of Lambda(1520) Resonance. /// /// \author Yash Patley -/// \author Nasir Mehdi Malik +/// \author Nasir Mehdi Malik #include #include @@ -30,7 +30,6 @@ #include "Framework/ASoAHelpers.h" #include "Framework/runDataProcessing.h" #include "PWGLF/DataModel/LFResonanceTables.h" -#include "PWGLF/DataModel/LFResonanceTablesMergeDF.h" #include "CommonConstants/PhysicsConstants.h" using namespace o2; @@ -654,9 +653,9 @@ struct lambdaAnalysis_pb { PROCESS_SWITCH(lambdaAnalysis_pb, processMix, "Process for Mixed Events", false); - Preslice perRColdf = aod::resodaughterdf::resoCollisiondfId; + Preslice perRColdf = aod::resodaughter::resoCollisionId; - using resoColDFs = aod::ResoCollisionDFs; + using resoColDFs = aod::ResoCollisions; using resoTrackDFs = aod::ResoTrackDFs; void processDatadf(resoColDFs::iterator const& collision, resoTrackDFs const& tracks) @@ -673,7 +672,7 @@ struct lambdaAnalysis_pb { PROCESS_SWITCH(lambdaAnalysis_pb, processDatadf, "Process for data merged DF", false); - using BinningTypeDF = ColumnBinningPolicy; + using BinningTypeDF = ColumnBinningPolicy; void processMixDF(resoColDFs& collisions, resoTrackDFs const& tracks) { if (doprocessMix) @@ -696,7 +695,7 @@ struct lambdaAnalysis_pb { PROCESS_SWITCH(lambdaAnalysis_pb, processMixDF, "Process for merged DF Mixed Events", false); - using BinningTypeEP = ColumnBinningPolicy; + using BinningTypeEP = ColumnBinningPolicy; void processMixepDF(resoColDFs& collisions, resoTrackDFs const& tracks) { if (doprocessMix || doprocessMixDF) From 7428db232fd310f270e3265cd092345ea2ed7cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 12 Dec 2024 09:24:07 +0100 Subject: [PATCH 355/459] [PWGCF] Fix compilation warnings (#8952) --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 957460d8b28..6a1048ad692 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -466,7 +466,7 @@ struct ZdcQVectors { } else if (hist->InheritsFrom("TProfile")) { TProfile* h = reinterpret_cast(hist); TString name = h->GetName(); - int bin; + int bin{}; if (name.Contains("mean_vx")) bin = h->GetXaxis()->FindBin(v[0]); if (name.Contains("mean_vy")) From 51e92fd791a0f103472073b2e6eb6f815a1105b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 12 Dec 2024 09:35:52 +0100 Subject: [PATCH 356/459] [PWGLF] Fix compilation warnings (#8951) --- PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx b/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx index da2c47fa790..e30155b61a9 100644 --- a/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx +++ b/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx @@ -353,6 +353,7 @@ struct AngularCorrelationsInJets { case 3: // (anti)helium-3 return (track.tpcNSigmaHe() < 3.0 && track.tpcNSigmaDe() > 3.0 && track.tpcNSigmaPr() > 3.0); } + return false; } template From 48037ace60b40491cbfd9316029415794076d55c Mon Sep 17 00:00:00 2001 From: Marian Ivanov Date: Thu, 12 Dec 2024 10:25:08 +0100 Subject: [PATCH 357/459] [Common] TrackQAConverter002- for TOF modification (#8901) Signed-off-by: Felix Schlepper Co-authored-by: Felix Schlepper --- .../TableProducer/Converters/CMakeLists.txt | 5 + .../Converters/trackQA002Converter.cxx | 97 +++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 Common/TableProducer/Converters/trackQA002Converter.cxx diff --git a/Common/TableProducer/Converters/CMakeLists.txt b/Common/TableProducer/Converters/CMakeLists.txt index 0bf0ff823d4..eda31568123 100644 --- a/Common/TableProducer/Converters/CMakeLists.txt +++ b/Common/TableProducer/Converters/CMakeLists.txt @@ -88,3 +88,8 @@ o2physics_add_dpl_workflow(trackqa-converter SOURCES trackQAConverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(trackqa-converter-002 + SOURCES trackQA002Converter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/Common/TableProducer/Converters/trackQA002Converter.cxx b/Common/TableProducer/Converters/trackQA002Converter.cxx new file mode 100644 index 00000000000..3e1bc82dbaf --- /dev/null +++ b/Common/TableProducer/Converters/trackQA002Converter.cxx @@ -0,0 +1,97 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" + +using namespace o2; +using namespace o2::framework; + +struct TrackQAConverter002 { + Produces tracksQA_002; + + void process000(aod::TracksQA_000 const& tracksQA_002) + { + for (const auto& trackQA : tracksQA_000) { + tracksQA_002( + trackQA.trackId(), + trackQA.tpcTime0(), + trackQA.tpcdcaR(), + trackQA.tpcdcaZ(), + trackQA.tpcClusterByteMask(), + trackQA.tpcdEdxMax0R(), + trackQA.tpcdEdxMax1R(), + trackQA.tpcdEdxMax2R(), + trackQA.tpcdEdxMax3R(), + trackQA.tpcdEdxTot0R(), + trackQA.tpcdEdxTot1R(), + trackQA.tpcdEdxTot2R(), + trackQA.tpcdEdxTot3R(), + // dummy values, not available in _000 + std::numeric_limits::min(), // deltaRefContParamY + std::numeric_limits::min(), // deltaRefContParamZ + std::numeric_limits::min(), // deltaRefContParamSnp + std::numeric_limits::min(), // deltaRefContParamTgl + std::numeric_limits::min(), // deltaRefContParamQ2Pt + std::numeric_limits::min(), // deltaRefGloParamY + std::numeric_limits::min(), // deltaRefGloParamZ + std::numeric_limits::min(), // deltaRefGloParamSnp + std::numeric_limits::min(), // deltaRefGloParamTgl + std::numeric_limits::min(), // deltaRefGloParamQ2Pt + std::numeric_limits::min(), // dTofdX + std::numeric_limits::min()); // dTofdY + } + } + PROCESS_SWITCH(TrackQAConverter002, process000, "process v000-to-v002 conversion", false); + + void process001(aod::TracksQA_001 const& tracksQA_002) + { + for (const auto& trackQA : tracksQA_001) { + tracksQA_002( + trackQA.trackId(), + trackQA.tpcTime0(), + trackQA.tpcdcaR(), + trackQA.tpcdcaZ(), + trackQA.tpcClusterByteMask(), + trackQA.tpcdEdxMax0R(), + trackQA.tpcdEdxMax1R(), + trackQA.tpcdEdxMax2R(), + trackQA.tpcdEdxMax3R(), + trackQA.tpcdEdxTot0R(), + trackQA.tpcdEdxTot1R(), + trackQA.tpcdEdxTot2R(), + trackQA.tpcdEdxTot3R(), + trackQA.deltaRefContParamY(), + trackQA.deltaRefITSParamZ(), + trackQA.deltaRefContParamSnp(), + trackQA.deltaRefContParamTgl(), + trackQA.deltaRefContParamQ2Pt(), + trackQA.deltaRefGloParamY(), + trackQA.deltaRefGloParamZ(), + trackQA.deltaRefGloParamSnp(), + trackQA.deltaRefGloParamTgl(), + trackQA.deltaRefGloParamQ2Pt(), + // dummy values, not available in _001 + std::numeric_limits::min(), // dTofdX + std::numeric_limits::min()); // dTofdY + } + } + PROCESS_SWITCH(TrackQAConverter002, process001, "process v001-to-v002 conversion", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + }; +} From 4b67411f5cfe695312971df57e73148daca778af Mon Sep 17 00:00:00 2001 From: alicja-pp <101565842+alicja-pp@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:20:04 +0100 Subject: [PATCH 358/459] [PWGCF] add ConfNEventsMix configurable in V0 task (#8911) --- .../femtoUniversePairTaskTrackV0Extended.cxx | 446 +++++++++--------- 1 file changed, 224 insertions(+), 222 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx index 4810c79298d..a8f91141904 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx @@ -9,6 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file femtoUniversePairTaskTrackV0Extended.cxx /// \brief Tasks that build pairs of track particles and v0s /// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de /// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch @@ -42,7 +43,7 @@ using namespace o2::analysis::femtoUniverse; using namespace o2::aod::pidutils; using namespace o2::track; -struct femtoUniversePairTaskTrackV0Extended { +struct FemtoUniversePairTaskTrackV0Extended { Service pdgMC; @@ -54,51 +55,51 @@ struct femtoUniversePairTaskTrackV0Extended { Preslice perColMC = aod::femtouniverseparticle::fdCollisionId; /// To apply narrow cut - Configurable ConfZVertexCut{"ConfZVertexCut", 10.f, "Event sel: Maximum z-Vertex (cm)"}; - Configurable ConfEta{"ConfEta", 0.8, "Eta cut for the global track"}; + Configurable confZVertexCut{"confZVertexCut", 10.f, "Event sel: Maximum z-Vertex (cm)"}; + Configurable confEta{"confEta", 0.8, "Eta cut for the global track"}; /// Particle 1 (track) - Configurable ConfTrkPDGCodePartOne{"ConfTrkPDGCodePartOne", 211, "Particle 1 (Track) - PDG code"}; - Configurable ConfTrackChoicePartOne{"ConfTrackChoicePartOne", 1, "0:Proton, 1:Pion, 2:Kaon"}; - ConfigurableAxis ConfTrkTempFitVarBins{"ConfTrkDTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfTrkTempFitVarpTBins{"ConfTrkTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; - Configurable ConfChargePart1{"ConfChargePart1", 0, "sign of particle 1"}; - Configurable ConfHPtPart1{"ConfHPtPart1", 4.0f, "higher limit for pt of particle 1"}; - Configurable ConfLPtPart1{"ConfLPtPart1", 0.3f, "lower limit for pt of particle 1"}; - Configurable Confmom{"Confmom", 0.5, "momentum threshold for particle identification using TOF"}; - Configurable ConfNsigmaTPCParticle{"ConfNsigmaTPCParticle", 3.0, "TPC Sigma for particle momentum < Confmom"}; - Configurable ConfNsigmaCombinedParticle{"ConfNsigmaCombinedParticle", 3.0, "TPC and TOF Sigma (combined) for particle momentum > Confmom"}; - - Filter collisionFilter = (nabs(aod::collision::posZ) < ConfZVertexCut); + Configurable confTrkPDGCodePartOne{"confTrkPDGCodePartOne", 211, "Particle 1 (Track) - PDG code"}; + Configurable confTrackChoicePartOne{"confTrackChoicePartOne", 1, "0:Proton, 1:Pion, 2:Kaon"}; + ConfigurableAxis confTrkTempFitVarBins{"confTrkTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis confTrkTempFitVarpTBins{"confTrkTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; + Configurable confChargePart1{"confChargePart1", 0, "sign of particle 1"}; + Configurable confHPtPart1{"confHPtPart1", 4.0f, "higher limit for pt of particle 1"}; + Configurable confLPtPart1{"confLPtPart1", 0.3f, "lower limit for pt of particle 1"}; + Configurable confmom{"confmom", 0.5, "momentum threshold for particle identification using TOF"}; + Configurable confNsigmaTPCParticle{"confNsigmaTPCParticle", 3.0, "TPC Sigma for particle momentum < confmom"}; + Configurable confNsigmaCombinedParticle{"confNsigmaCombinedParticle", 3.0, "TPC and TOF Sigma (combined) for particle momentum > confmom"}; + + Filter collisionFilter = (nabs(aod::collision::posZ) < confZVertexCut); using FilteredFDCollisions = soa::Filtered; using FilteredFDCollision = FilteredFDCollisions::iterator; /// Partition for particle 1 - Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == ConfChargePart1) && (nabs(aod::femtouniverseparticle::eta) < ConfEta) && (aod::femtouniverseparticle::pt < ConfHPtPart1) && (aod::femtouniverseparticle::pt > ConfLPtPart1); - Partition partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kMCTruthTrack)) && (nabs(aod::femtouniverseparticle::eta) < ConfEta) && (aod::femtouniverseparticle::pt < ConfHPtPart1) && (aod::femtouniverseparticle::pt > ConfLPtPart1); - Partition partsOneMCReco = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == ConfChargePart1) && (nabs(aod::femtouniverseparticle::eta) < ConfEta) && (aod::femtouniverseparticle::pt < ConfHPtPart1) && (aod::femtouniverseparticle::pt > ConfLPtPart1); + Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == confChargePart1) && (nabs(aod::femtouniverseparticle::eta) < confEta) && (aod::femtouniverseparticle::pt < confHPtPart1) && (aod::femtouniverseparticle::pt > confLPtPart1); + Partition partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kMCTruthTrack)) && (nabs(aod::femtouniverseparticle::eta) < confEta) && (aod::femtouniverseparticle::pt < confHPtPart1) && (aod::femtouniverseparticle::pt > confLPtPart1); + Partition partsOneMCReco = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == confChargePart1) && (nabs(aod::femtouniverseparticle::eta) < confEta) && (aod::femtouniverseparticle::pt < confHPtPart1) && (aod::femtouniverseparticle::pt > confLPtPart1); /// Histogramming for particle 1 FemtoUniverseParticleHisto trackHistoPartOnePos; FemtoUniverseParticleHisto trackHistoPartOneNeg; /// Particle 2 (V0) - Configurable ConfV0PDGCodePartTwo{"ConfV0PDGCodePartTwo", 3122, "Particle 2 (V0) - PDG code"}; - ConfigurableAxis ConfV0TempFitVarBins{"ConfV0TempFitVarBins", {300, 0.95, 1.}, "V0: binning of the TempFitVar in the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfV0TempFitVarpTBins{"ConfV0TempFitVarpTBins", {20, 0.5, 4.05}, "V0: pT binning of the pT vs. TempFitVar plot"}; - Configurable ConfV0Type1{"ConfV0Type1", 0, "select one of the V0s (lambda = 0, anti-lambda = 1, k0 = 2) for v0-v0 and Track-v0 combination"}; - Configurable ConfV0Type2{"ConfV0Type2", 0, "select one of the V0s (lambda = 0, anti-lambda = 1, k0 = 2) for v0-v0 combination"}; - Configurable ConfV0InvMassLowLimit{"ConfV0InvV0MassLowLimit", 1.10, "Lower limit of the V0 invariant mass"}; - Configurable ConfV0InvMassUpLimit{"ConfV0InvV0MassUpLimit", 1.13, "Upper limit of the V0 invariant mass"}; - ConfigurableAxis ConfChildTempFitVarBins{"ConfChildTempFitVarBins", {300, -0.15, 0.15}, "V0 child: binning of the TempFitVar in the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfChildTempFitVarpTBins{"ConfChildTempFitVarpTBins", {20, 0.5, 4.05}, "V0 child: pT binning of the pT vs. TempFitVar plot"}; - Configurable ConfHPtPart2{"ConfHPtPart2", 4.0f, "higher limit for pt of particle 2"}; - Configurable ConfLPtPart2{"ConfLPtPart2", 0.3f, "lower limit for pt of particle 2"}; + Configurable confV0PDGCodePartTwo{"confV0PDGCodePartTwo", 3122, "Particle 2 (V0) - PDG code"}; + ConfigurableAxis confV0TempFitVarBins{"confV0TempFitVarBins", {300, 0.95, 1.}, "V0: binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis confV0TempFitVarpTBins{"confV0TempFitVarpTBins", {20, 0.5, 4.05}, "V0: pT binning of the pT vs. TempFitVar plot"}; + Configurable confV0Type1{"confV0Type1", 0, "select one of the V0s (lambda = 0, anti-lambda = 1, k0 = 2) for v0-v0 and Track-v0 combination"}; + Configurable confV0Type2{"confV0Type2", 0, "select one of the V0s (lambda = 0, anti-lambda = 1, k0 = 2) for v0-v0 combination"}; + Configurable confV0InvMassLowLimit{"confV0InvMassLowLimit", 1.10, "Lower limit of the V0 invariant mass"}; + Configurable confV0InvMassUpLimit{"confV0InvMassUpLimit", 1.13, "Upper limit of the V0 invariant mass"}; + ConfigurableAxis confChildTempFitVarBins{"confChildTempFitVarBins", {300, -0.15, 0.15}, "V0 child: binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis confChildTempFitVarpTBins{"confChildTempFitVarpTBins", {20, 0.5, 4.05}, "V0 child: pT binning of the pT vs. TempFitVar plot"}; + Configurable confHPtPart2{"confHPtPart2", 4.0f, "higher limit for pt of particle 2"}; + Configurable confLPtPart2{"confLPtPart2", 0.3f, "lower limit for pt of particle 2"}; /// Partition for particle 2 - Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kV0)) && (aod::femtouniverseparticle::pt < ConfHPtPart2) && (aod::femtouniverseparticle::pt > ConfLPtPart2); - Partition partsTwoMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kMCTruthTrack)) && (aod::femtouniverseparticle::pt < ConfHPtPart2) && (aod::femtouniverseparticle::pt > ConfLPtPart2); - Partition partsTwoMCReco = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kV0)) && (aod::femtouniverseparticle::pt < ConfHPtPart2) && (aod::femtouniverseparticle::pt > ConfLPtPart2); + Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kV0)) && (aod::femtouniverseparticle::pt < confHPtPart2) && (aod::femtouniverseparticle::pt > confLPtPart2); + Partition partsTwoMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kMCTruthTrack)) && (aod::femtouniverseparticle::pt < confHPtPart2) && (aod::femtouniverseparticle::pt > confLPtPart2); + Partition partsTwoMCReco = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kV0)) && (aod::femtouniverseparticle::pt < confHPtPart2) && (aod::femtouniverseparticle::pt > confLPtPart2); /// Histogramming for particle 2 FemtoUniverseParticleHisto trackHistoPartTwo; @@ -116,31 +117,32 @@ struct femtoUniversePairTaskTrackV0Extended { FemtoUniverseEventHisto eventHisto; /// Correlation part - // Configurable ConfTrackChoicePartTwo{"ConfTrackChoicePartTwo", 1, "0:Proton, 1:Pion, 2:Kaon"}; //not used - Configurable ConfIsMC{"ConfIsMC", false, "Enable additional Histograms in the case of a MonteCarlo Run"}; - Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; - Configurable ConfUseCent{"ConfUseCent", false, "Use centrality in place of multiplicity"}; - ConfigurableAxis ConfMultBins{"ConfMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis ConfkstarBins{"ConfkstarBins", {1500, 0., 6.}, "binning kstar"}; - ConfigurableAxis ConfkTBins{"ConfkTBins", {150, 0., 9.}, "binning kT"}; - ConfigurableAxis ConfmTBins{"ConfmTBins", {225, 0., 7.5}, "binning mT"}; - Configurable ConfIsCPR{"ConfIsCPR", true, "Close Pair Rejection"}; - Configurable ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"}; - Configurable ConfCPRdeltaPhiCutMax{"ConfCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaPhiCutMin{"ConfCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaEtaCutMax{"ConfCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaEtaCutMin{"ConfCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; - Configurable ConfCPRChosenRadii{"ConfCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; - Configurable ConfPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"}; - Configurable ConfEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"}; - ConfigurableAxis ConfmTBins3D{"ConfmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - ConfigurableAxis ConfmultBins3D{"ConfMultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + // Configurable confTrackChoicePartTwo{"confTrackChoicePartTwo", 1, "0:Proton, 1:Pion, 2:Kaon"}; //not used + Configurable confIsMC{"confIsMC", false, "Enable additional Histograms in the case of a MonteCarlo Run"}; + Configurable confUse3D{"confUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; + Configurable confUseCent{"confUseCent", false, "Use centrality in place of multiplicity"}; + ConfigurableAxis confMultBins{"confMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; + ConfigurableAxis confVtxBins{"confVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + Configurable confNEventsMix{"confNEventsMix", 5, "Number of events for mixing"}; + ConfigurableAxis confkstarBins{"confkstarBins", {1500, 0., 6.}, "binning kstar"}; + ConfigurableAxis confkTBins{"confkTBins", {150, 0., 9.}, "binning kT"}; + ConfigurableAxis confmTBins{"confmTBins", {225, 0., 7.5}, "binning mT"}; + Configurable confIsCPR{"confIsCPR", true, "Close Pair Rejection"}; + Configurable confCPRPlotPerRadii{"confCPRPlotPerRadii", false, "Plot CPR per radii"}; + Configurable confCPRdeltaPhiCutMax{"confCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; + Configurable confCPRdeltaPhiCutMin{"confCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; + Configurable confCPRdeltaEtaCutMax{"confCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; + Configurable confCPRdeltaEtaCutMin{"confCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; + Configurable confCPRChosenRadii{"confCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; + Configurable confPhiBins{"confPhiBins", 29, "Number of phi bins in deta dphi"}; + Configurable confEtaBins{"confEtaBins", 29, "Number of eta bins in deta dphi"}; + ConfigurableAxis confmTBins3D{"confmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + ConfigurableAxis confMultBins3D{"confMultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; // Efficiency - Configurable ConfLocalEfficiency{"ConfLocalEfficiency", "", "Local path to efficiency .root file"}; + Configurable confLocalEfficiency{"confLocalEfficiency", "", "Local path to efficiency .root file"}; - static constexpr UInt_t V0ChildTable[][2] = {{0, 1}, {1, 0}, {1, 1}}; // Table to select the V0 children + static constexpr unsigned int V0ChildTable[][2] = {{0, 1}, {1, 0}, {1, 1}}; // Table to select the V0 children FemtoUniverseContainer sameEventCont; FemtoUniverseContainer mixedEventCont; @@ -154,32 +156,32 @@ struct femtoUniversePairTaskTrackV0Extended { HistogramRegistry registryMCtruth{"MCtruthHistos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry registryMCreco{"MCrecoHistos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; - HistogramRegistry MixQaRegistry{"MixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry mixQaRegistry{"mixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; std::unique_ptr plocalEffFile; std::unique_ptr plocalEffp1; std::unique_ptr plocalEffp2; - bool IsNSigmaCombined(float mom, float nsigmaTPCParticle, float nsigmaTOFParticle) + bool isNSigmaCombined(float mom, float nsigmaTPCParticle, float nsigmaTOFParticle) { - if (mom <= Confmom) { - return (TMath::Abs(nsigmaTPCParticle) < ConfNsigmaTPCParticle); + if (mom <= confmom) { + return (std::abs(nsigmaTPCParticle) < confNsigmaTPCParticle); } else { - return (TMath::Hypot(nsigmaTOFParticle, nsigmaTPCParticle) < ConfNsigmaCombinedParticle); + return (std::hypot(nsigmaTOFParticle, nsigmaTPCParticle) < confNsigmaCombinedParticle); } } bool invMLambda(float invMassLambda, float invMassAntiLambda) { - if ((invMassLambda < ConfV0InvMassLowLimit || invMassLambda > ConfV0InvMassUpLimit) && (invMassAntiLambda < ConfV0InvMassLowLimit || invMassAntiLambda > ConfV0InvMassUpLimit)) { + if ((invMassLambda < confV0InvMassLowLimit || invMassLambda > confV0InvMassUpLimit) && (invMassAntiLambda < confV0InvMassLowLimit || invMassAntiLambda > confV0InvMassUpLimit)) { return false; } return true; } - bool IsNSigmaTPC(float nsigmaTPCParticle) + bool isNSigmaTPC(float nsigmaTPCParticle) { - if (TMath::Abs(nsigmaTPCParticle) < ConfNsigmaTPCParticle) { + if (std::abs(nsigmaTPCParticle) < confNsigmaTPCParticle) { return true; } else { return false; @@ -187,21 +189,21 @@ struct femtoUniversePairTaskTrackV0Extended { } template - bool IsParticleCombined(const T& part, int id) + bool isParticleCombined(const T& part, int id) { const float tpcNSigmas[3] = {unPackInTable(part.tpcNSigmaStorePr()), unPackInTable(part.tpcNSigmaStorePi()), unPackInTable(part.tpcNSigmaStoreKa())}; // const float tofNSigmas[3] = {part.tofNSigmaPr(), part.tofNSigmaPi(), part.tofNSigmaKa()}; const float tofNSigmas[3] = {unPackInTable(part.tofNSigmaStorePr()), unPackInTable(part.tofNSigmaStorePi()), unPackInTable(part.tofNSigmaStoreKa())}; - return IsNSigmaCombined(part.p(), tpcNSigmas[id], tofNSigmas[id]); + return isNSigmaCombined(part.p(), tpcNSigmas[id], tofNSigmas[id]); } template - bool IsParticleTPC(const T& part, int id) + bool isParticleTPC(const T& part, int id) { const float tpcNSigmas[3] = {unPackInTable(part.tpcNSigmaStorePr()), unPackInTable(part.tpcNSigmaStorePi()), unPackInTable(part.tpcNSigmaStoreKa())}; - return IsNSigmaTPC(tpcNSigmas[id]); + return isNSigmaTPC(tpcNSigmas[id]); } void init(InitContext&) @@ -211,20 +213,20 @@ struct femtoUniversePairTaskTrackV0Extended { qaRegistry.add("Tracks_pos/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("Tracks_neg/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("Tracks_neg/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); - trackHistoPartOnePos.init(&qaRegistry, ConfTrkTempFitVarpTBins, ConfTrkTempFitVarBins, ConfIsMC, ConfTrkPDGCodePartOne); - trackHistoPartOneNeg.init(&qaRegistry, ConfTrkTempFitVarpTBins, ConfTrkTempFitVarBins, ConfIsMC, ConfTrkPDGCodePartOne); - trackHistoPartTwo.init(&qaRegistry, ConfV0TempFitVarpTBins, ConfV0TempFitVarBins, ConfIsMC, ConfV0PDGCodePartTwo, true); - posChildHistos.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false, 0, true); - negChildHistos.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false, 0, true); + trackHistoPartOnePos.init(&qaRegistry, confTrkTempFitVarpTBins, confTrkTempFitVarBins, confIsMC, confTrkPDGCodePartOne); + trackHistoPartOneNeg.init(&qaRegistry, confTrkTempFitVarpTBins, confTrkTempFitVarBins, confIsMC, confTrkPDGCodePartOne); + trackHistoPartTwo.init(&qaRegistry, confV0TempFitVarpTBins, confV0TempFitVarBins, confIsMC, confV0PDGCodePartTwo, true); + posChildHistos.init(&qaRegistry, confChildTempFitVarpTBins, confChildTempFitVarBins, false, 0, true); + negChildHistos.init(&qaRegistry, confChildTempFitVarpTBins, confChildTempFitVarBins, false, 0, true); - trackHistoV0Type1.init(&qaRegistry, ConfV0TempFitVarpTBins, ConfV0TempFitVarBins, ConfIsMC, ConfV0PDGCodePartTwo, true, "V0Type1"); - posChildV0Type1.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false, 0, true, "posChildV0Type1"); - negChildV0Type1.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false, 0, true, "negChildV0Type1"); - trackHistoV0Type2.init(&qaRegistry, ConfV0TempFitVarpTBins, ConfV0TempFitVarBins, ConfIsMC, ConfV0PDGCodePartTwo, true, "V0Type2"); - posChildV0Type2.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false, 0, true, "posChildV0Type2"); - negChildV0Type2.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false, 0, true, "negChildV0Type2"); + trackHistoV0Type1.init(&qaRegistry, confV0TempFitVarpTBins, confV0TempFitVarBins, confIsMC, confV0PDGCodePartTwo, true, "V0Type1"); + posChildV0Type1.init(&qaRegistry, confChildTempFitVarpTBins, confChildTempFitVarBins, false, 0, true, "posChildV0Type1"); + negChildV0Type1.init(&qaRegistry, confChildTempFitVarpTBins, confChildTempFitVarBins, false, 0, true, "negChildV0Type1"); + trackHistoV0Type2.init(&qaRegistry, confV0TempFitVarpTBins, confV0TempFitVarBins, confIsMC, confV0PDGCodePartTwo, true, "V0Type2"); + posChildV0Type2.init(&qaRegistry, confChildTempFitVarpTBins, confChildTempFitVarBins, false, 0, true, "posChildV0Type2"); + negChildV0Type2.init(&qaRegistry, confChildTempFitVarpTBins, confChildTempFitVarBins, false, 0, true, "negChildV0Type2"); - MixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + mixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); // MC truth registryMCtruth.add("plus/MCtruthLambda", "MC truth Lambdas;#it{p}_{T} (GeV/c); #eta", {HistType::kTH2F, {{500, 0, 5}, {400, -1.0, 1.0}}}); @@ -266,51 +268,51 @@ struct femtoUniversePairTaskTrackV0Extended { registryMCreco.add("minus/MCrecoPiPt", "MC reco pions;#it{p}_{T} (GeV/c)", {HistType::kTH1F, {{500, 0, 5}}}); registryMCreco.add("minus/MCrecoPrPt", "MC reco protons;#it{p}_{T} (GeV/c)", {HistType::kTH1F, {{500, 0, 5}}}); - sameEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfEtaBins, ConfPhiBins, ConfIsMC, ConfUse3D); - sameEventCont.setPDGCodes(ConfTrkPDGCodePartOne, ConfV0PDGCodePartTwo); - mixedEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfEtaBins, ConfPhiBins, ConfIsMC, ConfUse3D); - mixedEventCont.setPDGCodes(ConfTrkPDGCodePartOne, ConfV0PDGCodePartTwo); + sameEventCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confMultBins3D, confmTBins3D, confEtaBins, confPhiBins, confIsMC, confUse3D); + sameEventCont.setPDGCodes(confTrkPDGCodePartOne, confV0PDGCodePartTwo); + mixedEventCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confMultBins3D, confmTBins3D, confEtaBins, confPhiBins, confIsMC, confUse3D); + mixedEventCont.setPDGCodes(confTrkPDGCodePartOne, confV0PDGCodePartTwo); pairCleaner.init(&qaRegistry); pairCleanerV0.init(&qaRegistry); - if (ConfIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); - pairCloseRejectionV0.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); + if (confIsCPR.value) { + pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); + pairCloseRejectionV0.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } - if (!ConfLocalEfficiency.value.empty()) { - plocalEffFile = std::unique_ptr(TFile::Open(ConfLocalEfficiency.value.c_str(), "read")); + if (!confLocalEfficiency.value.empty()) { + plocalEffFile = std::unique_ptr(TFile::Open(confLocalEfficiency.value.c_str(), "read")); if (!plocalEffFile || plocalEffFile.get()->IsZombie()) - LOGF(fatal, "Could not load efficiency histogram from %s", ConfLocalEfficiency.value.c_str()); + LOGF(fatal, "Could not load efficiency histogram from %s", confLocalEfficiency.value.c_str()); if (doprocessSameEvent || doprocessMixedEvent) { - plocalEffp1 = (ConfChargePart1 > 0) ? std::unique_ptr(plocalEffFile.get()->Get("PrPlus")) : std::unique_ptr(plocalEffFile.get()->Get("PrMinus")); // note: works only for protons for now - plocalEffp2 = (ConfV0Type1 == 0) ? std::unique_ptr(plocalEffFile.get()->Get("Lambda")) : std::unique_ptr(plocalEffFile.get()->Get("AntiLambda")); + plocalEffp1 = (confChargePart1 > 0) ? std::unique_ptr(plocalEffFile.get()->Get("PrPlus")) : std::unique_ptr(plocalEffFile.get()->Get("PrMinus")); // note: works only for protons for now + plocalEffp2 = (confV0Type1 == 0) ? std::unique_ptr(plocalEffFile.get()->Get("Lambda")) : std::unique_ptr(plocalEffFile.get()->Get("AntiLambda")); LOGF(info, "Loaded efficiency histograms for track-V0."); } else if (doprocessSameEventV0 || doprocessMixedEventV0) { - plocalEffp1 = (ConfV0Type1 == 0) ? std::unique_ptr(plocalEffFile.get()->Get("Lambda")) : std::unique_ptr(plocalEffFile.get()->Get("AntiLambda")); - plocalEffp2 = (ConfV0Type2 == 0) ? std::unique_ptr(plocalEffFile.get()->Get("Lambda")) : std::unique_ptr(plocalEffFile.get()->Get("AntiLambda")); + plocalEffp1 = (confV0Type1 == 0) ? std::unique_ptr(plocalEffFile.get()->Get("Lambda")) : std::unique_ptr(plocalEffFile.get()->Get("AntiLambda")); + plocalEffp2 = (confV0Type2 == 0) ? std::unique_ptr(plocalEffFile.get()->Get("Lambda")) : std::unique_ptr(plocalEffFile.get()->Get("AntiLambda")); LOGF(info, "Loaded efficiency histograms for V0-V0."); } } } /// This function processes the same event for track - V0 template - void doSameEvent(FilteredFDCollision& col, PartType& parts, PartitionType& groupPartsOne, PartitionType& groupPartsTwo, [[maybe_unused]] MCParticles mcParts = nullptr) + void doSameEvent(FilteredFDCollision const& col, PartType const& parts, PartitionType& groupPartsOne, PartitionType& groupPartsTwo, [[maybe_unused]] MCParticles mcParts = nullptr) { const auto& magFieldTesla = col.magField(); - const int multCol = ConfUseCent ? col.multV0M() : col.multNtr(); + const int multCol = confUseCent ? col.multV0M() : col.multNtr(); eventHisto.fillQA(col); /// Histogramming same event - for (auto& part : groupPartsTwo) { + for (const auto& part : groupPartsTwo) { if (!invMLambda(part.mLambda(), part.mAntiLambda())) continue; const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); /// Daughters that do not pass this condition are not selected - if (!IsParticleTPC(posChild, V0ChildTable[ConfV0Type1][0]) || !IsParticleTPC(negChild, V0ChildTable[ConfV0Type1][1])) + if (!isParticleTPC(posChild, V0ChildTable[confV0Type1][0]) || !isParticleTPC(negChild, V0ChildTable[confV0Type1][1])) continue; trackHistoPartTwo.fillQA(part); @@ -318,37 +320,37 @@ struct femtoUniversePairTaskTrackV0Extended { negChildHistos.fillQA(negChild); } - for (auto& part : groupPartsOne) { + for (const auto& part : groupPartsOne) { /// PID plot for particle 1 const float tpcNSigmas[3] = {unPackInTable(part.tpcNSigmaStorePr()), unPackInTable(part.tpcNSigmaStorePi()), unPackInTable(part.tpcNSigmaStoreKa())}; const float tofNSigmas[3] = {unPackInTable(part.tofNSigmaStorePr()), unPackInTable(part.tofNSigmaStorePi()), unPackInTable(part.tofNSigmaStoreKa())}; - if (!IsNSigmaCombined(part.p(), tpcNSigmas[ConfTrackChoicePartOne], tofNSigmas[ConfTrackChoicePartOne])) + if (!isNSigmaCombined(part.p(), tpcNSigmas[confTrackChoicePartOne], tofNSigmas[confTrackChoicePartOne])) continue; if (part.sign() > 0) { - qaRegistry.fill(HIST("Tracks_pos/nSigmaTPC"), part.p(), tpcNSigmas[ConfTrackChoicePartOne]); - qaRegistry.fill(HIST("Tracks_pos/nSigmaTOF"), part.p(), tofNSigmas[ConfTrackChoicePartOne]); + qaRegistry.fill(HIST("Tracks_pos/nSigmaTPC"), part.p(), tpcNSigmas[confTrackChoicePartOne]); + qaRegistry.fill(HIST("Tracks_pos/nSigmaTOF"), part.p(), tofNSigmas[confTrackChoicePartOne]); trackHistoPartOnePos.fillQA(part); } else if (part.sign() < 0) { - qaRegistry.fill(HIST("Tracks_neg/nSigmaTPC"), part.p(), tpcNSigmas[ConfTrackChoicePartOne]); - qaRegistry.fill(HIST("Tracks_neg/nSigmaTOF"), part.p(), tofNSigmas[ConfTrackChoicePartOne]); + qaRegistry.fill(HIST("Tracks_neg/nSigmaTPC"), part.p(), tpcNSigmas[confTrackChoicePartOne]); + qaRegistry.fill(HIST("Tracks_neg/nSigmaTOF"), part.p(), tofNSigmas[confTrackChoicePartOne]); trackHistoPartOneNeg.fillQA(part); } } /// Now build the combinations - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Lambda invariant mass cut if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) continue; /// PID using stored binned nsigma - if (!IsParticleCombined(p1, ConfTrackChoicePartOne)) + if (!isParticleCombined(p1, confTrackChoicePartOne)) continue; // track cleaning if (!pairCleaner.isCleanPair(p1, p2, parts)) { continue; } - if (ConfIsCPR.value) { + if (confIsCPR.value) { if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { continue; } @@ -357,60 +359,60 @@ struct femtoUniversePairTaskTrackV0Extended { const auto& negChild = parts.iteratorAt(p2.index() - 1); /// Daughters that do not pass this condition are not selected - if (!IsParticleTPC(posChild, V0ChildTable[ConfV0Type1][0]) || !IsParticleTPC(negChild, V0ChildTable[ConfV0Type1][1])) + if (!isParticleTPC(posChild, V0ChildTable[confV0Type1][0]) || !isParticleTPC(negChild, V0ChildTable[confV0Type1][1])) continue; float weight = 1.0f; if (plocalEffp1) weight = plocalEffp1.get()->GetBinContent(plocalEffp1->FindBin(p1.pt(), p1.eta())) * plocalEffp2.get()->GetBinContent(plocalEffp2->FindBin(p2.pt(), p2.eta())); if constexpr (std::is_same::value) - sameEventCont.setPair(p1, p2, multCol, ConfUse3D, weight); + sameEventCont.setPair(p1, p2, multCol, confUse3D, weight); else - sameEventCont.setPair(p1, p2, multCol, ConfUse3D, weight); + sameEventCont.setPair(p1, p2, multCol, confUse3D, weight); } } - void processSameEvent(FilteredFDCollision& col, FemtoFullParticles& parts) + void processSameEvent(FilteredFDCollision const& col, FemtoFullParticles const& parts) { auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); doSameEvent(col, parts, groupPartsOne, groupPartsTwo); } - PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processSameEvent, "Enable processing same event for track - V0", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processSameEvent, "Enable processing same event for track - V0", false); - void processSameEventMCReco(FilteredFDCollision& col, FemtoRecoParticles& parts, aod::FDMCParticles const& mcparts) + void processSameEventMCReco(FilteredFDCollision const& col, FemtoRecoParticles const& parts, aod::FDMCParticles const& mcparts) { auto groupPartsOne = partsOneMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto groupPartsTwo = partsTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); doSameEvent(col, parts, groupPartsOne, groupPartsTwo, mcparts); } - PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processSameEventMCReco, "Enable processing same event for track - V0 MC Reco", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processSameEventMCReco, "Enable processing same event for track - V0 MC Reco", false); /// This function processes the same event for V0 - V0 - void processSameEventV0(FilteredFDCollision& col, FemtoFullParticles& parts) + void processSameEventV0(FilteredFDCollision const& col, FemtoFullParticles const& parts) { const auto& magFieldTesla = col.magField(); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - const int multCol = ConfUseCent ? col.multV0M() : col.multNtr(); + const int multCol = confUseCent ? col.multV0M() : col.multNtr(); eventHisto.fillQA(col); /// Histogramming same event - for (auto& part : groupPartsTwo) { + for (const auto& part : groupPartsTwo) { if (!invMLambda(part.mLambda(), part.mAntiLambda())) continue; const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); /// Check daughters of first V0 particle - if (IsParticleTPC(posChild, V0ChildTable[ConfV0Type1][0]) && IsParticleTPC(negChild, V0ChildTable[ConfV0Type1][1])) { + if (isParticleTPC(posChild, V0ChildTable[confV0Type1][0]) && isParticleTPC(negChild, V0ChildTable[confV0Type1][1])) { trackHistoV0Type1.fillQABase(part, HIST("V0Type1")); posChildV0Type1.fillQABase(posChild, HIST("posChildV0Type1")); negChildV0Type1.fillQABase(negChild, HIST("negChildV0Type1")); } /// Check daughters of second V0 particle - if (IsParticleTPC(posChild, V0ChildTable[ConfV0Type2][0]) && IsParticleTPC(negChild, V0ChildTable[ConfV0Type2][1])) { + if (isParticleTPC(posChild, V0ChildTable[confV0Type2][0]) && isParticleTPC(negChild, V0ChildTable[confV0Type2][1])) { trackHistoV0Type2.fillQABase(part, HIST("V0Type2")); posChildV0Type2.fillQABase(posChild, HIST("posChildV0Type2")); negChildV0Type2.fillQABase(negChild, HIST("negChildV0Type2")); @@ -428,7 +430,7 @@ struct femtoUniversePairTaskTrackV0Extended { if (!pairCleanerV0.isCleanPair(p1, p2, parts)) { return; } - if (ConfIsCPR.value) { + if (confIsCPR.value) { if (pairCloseRejectionV0.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { return; } @@ -436,54 +438,54 @@ struct femtoUniversePairTaskTrackV0Extended { const auto& posChild1 = parts.iteratorAt(p1.index() - 2); const auto& negChild1 = parts.iteratorAt(p1.index() - 1); /// Daughters that do not pass this condition are not selected - if (!IsParticleTPC(posChild1, V0ChildTable[ConfV0Type1][0]) || !IsParticleTPC(negChild1, V0ChildTable[ConfV0Type1][1])) + if (!isParticleTPC(posChild1, V0ChildTable[confV0Type1][0]) || !isParticleTPC(negChild1, V0ChildTable[confV0Type1][1])) return; const auto& posChild2 = parts.iteratorAt(p2.index() - 2); const auto& negChild2 = parts.iteratorAt(p2.index() - 1); /// Daughters that do not pass this condition are not selected - if (!IsParticleTPC(posChild2, V0ChildTable[ConfV0Type2][0]) || !IsParticleTPC(negChild2, V0ChildTable[ConfV0Type2][1])) + if (!isParticleTPC(posChild2, V0ChildTable[confV0Type2][0]) || !isParticleTPC(negChild2, V0ChildTable[confV0Type2][1])) return; - sameEventCont.setPair(p1, p2, multCol, ConfUse3D); + sameEventCont.setPair(p1, p2, multCol, confUse3D); }; - if (ConfV0Type1 == ConfV0Type2) { + if (confV0Type1 == confV0Type2) { /// Now build the combinations for identical V0s - for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsTwo, groupPartsTwo))) { + for (const auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsTwo, groupPartsTwo))) { pairProcessFunc(p1, p2); } } else { /// Now build the combinations for not identical identical V0s - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsTwo, groupPartsTwo))) { + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsTwo, groupPartsTwo))) { pairProcessFunc(p1, p2); } } } - PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processSameEventV0, "Enable processing same event for V0 - V0", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processSameEventV0, "Enable processing same event for V0 - V0", false); /// This function processes MC same events for Track - V0 - void processMCSameEvent(FilteredFDCollision& col, FemtoFullParticles& parts) + void processMCSameEvent(FilteredFDCollision const& col, FemtoFullParticles const& parts) { const auto& magFieldTesla = col.magField(); auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - const int multCol = ConfUseCent ? col.multV0M() : col.multNtr(); + const int multCol = confUseCent ? col.multV0M() : col.multNtr(); eventHisto.fillQA(col); /// Histogramming same event - for (auto& part : groupPartsTwo) { + for (const auto& part : groupPartsTwo) { int pdgCode = static_cast(part.pidcut()); - if ((ConfV0Type1 == 0 && pdgCode != 3122) || (ConfV0Type1 == 1 && pdgCode != -3122)) + if ((confV0Type1 == 0 && pdgCode != 3122) || (confV0Type1 == 1 && pdgCode != -3122)) continue; trackHistoPartTwo.fillQA(part); } - for (auto& part : groupPartsOne) { + for (const auto& part : groupPartsOne) { int pdgCode = static_cast(part.pidcut()); - if (pdgCode != ConfTrkPDGCodePartOne) + if (pdgCode != confTrkPDGCodePartOne) continue; const auto& pdgParticle = pdgMC->GetParticle(pdgCode); if (!pdgParticle) { @@ -498,74 +500,74 @@ struct femtoUniversePairTaskTrackV0Extended { } /// Now build the combinations - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (static_cast(p1.pidcut()) != ConfTrkPDGCodePartOne) + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + if (static_cast(p1.pidcut()) != confTrkPDGCodePartOne) continue; int pdgCode2 = static_cast(p2.pidcut()); - if ((ConfV0Type1 == 0 && pdgCode2 != 3122) || (ConfV0Type1 == 1 && pdgCode2 != -3122)) + if ((confV0Type1 == 0 && pdgCode2 != 3122) || (confV0Type1 == 1 && pdgCode2 != -3122)) continue; // track cleaning - if (ConfIsCPR.value) { + if (confIsCPR.value) { if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { continue; } } - sameEventCont.setPair(p1, p2, multCol, ConfUse3D); + sameEventCont.setPair(p1, p2, multCol, confUse3D); } } - PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMCSameEvent, "Enable processing same event for MC truth track - V0", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMCSameEvent, "Enable processing same event for MC truth track - V0", false); /// This function processes MC same events for V0 - V0 - void processMCSameEventV0(FilteredFDCollision& col, FemtoFullParticles& /*parts*/) + void processMCSameEventV0(FilteredFDCollision const& col, FemtoFullParticles const& /*parts*/) { auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - const int multCol = ConfUseCent ? col.multV0M() : col.multNtr(); + const int multCol = confUseCent ? col.multV0M() : col.multNtr(); eventHisto.fillQA(col); /// Histogramming same event - for (auto& part : groupPartsTwo) { + for (const auto& part : groupPartsTwo) { int pdgCode = static_cast(part.pidcut()); - if ((ConfV0Type1 == 0 && pdgCode != 3122) || (ConfV0Type1 == 1 && pdgCode != -3122)) + if ((confV0Type1 == 0 && pdgCode != 3122) || (confV0Type1 == 1 && pdgCode != -3122)) continue; trackHistoPartTwo.fillQA(part); } auto pairProcessFunc = [&](auto& p1, auto& p2) -> void { int pdgCode1 = static_cast(p1.pidcut()); - if ((ConfV0Type1 == 0 && pdgCode1 != 3122) || (ConfV0Type1 == 1 && pdgCode1 != -3122)) + if ((confV0Type1 == 0 && pdgCode1 != 3122) || (confV0Type1 == 1 && pdgCode1 != -3122)) return; int pdgCode2 = static_cast(p2.pidcut()); - if ((ConfV0Type2 == 0 && pdgCode2 != 3122) || (ConfV0Type2 == 1 && pdgCode2 != -3122)) + if ((confV0Type2 == 0 && pdgCode2 != 3122) || (confV0Type2 == 1 && pdgCode2 != -3122)) return; - sameEventCont.setPair(p1, p2, multCol, ConfUse3D); + sameEventCont.setPair(p1, p2, multCol, confUse3D); }; /// Now build the combinations - if (ConfV0Type1 == ConfV0Type2) { + if (confV0Type1 == confV0Type2) { /// Now build the combinations for identical V0s - for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsTwo, groupPartsTwo))) { + for (const auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsTwo, groupPartsTwo))) { pairProcessFunc(p1, p2); } } else { /// Now build the combinations for not identical identical V0s - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsTwo, groupPartsTwo))) { + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsTwo, groupPartsTwo))) { pairProcessFunc(p1, p2); } } } - PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMCSameEventV0, "Enable processing same event for MC truth V0 - V0", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMCSameEventV0, "Enable processing same event for MC truth V0 - V0", false); /// This function processes the mixed event for track - V0 template - void doMixedEvent(FilteredFDCollisions& cols, PartType& parts, PartitionType& partitionOne, PartitionType& partitionTwo, [[maybe_unused]] MCParticles mcParts = nullptr) + void doMixedEvent(FilteredFDCollisions const& cols, PartType const& parts, PartitionType& partitionOne, PartitionType& partitionTwo, [[maybe_unused]] MCParticles mcParts = nullptr) { - ColumnBinningPolicy colBinningMult{{ConfVtxBins, ConfMultBins}, true}; - ColumnBinningPolicy colBinningCent{{ConfVtxBins, ConfMultBins}, true}; + ColumnBinningPolicy colBinningMult{{confVtxBins, confMultBins}, true}; + ColumnBinningPolicy colBinningCent{{confVtxBins, confMultBins}, true}; auto mixedCollProcessFunc = [&](auto& collision1, auto& collision2) -> void { - const int multCol = ConfUseCent ? collision1.multV0M() : collision1.multNtr(); + const int multCol = confUseCent ? collision1.multV0M() : collision1.multNtr(); auto groupPartsOne = partitionOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partitionTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); @@ -577,25 +579,25 @@ struct femtoUniversePairTaskTrackV0Extended { return; } - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Lambda invariant mass cut if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) continue; /// PID using stored binned nsigma - if (!IsParticleCombined(p1, ConfTrackChoicePartOne)) + if (!isParticleCombined(p1, confTrackChoicePartOne)) continue; const auto& posChild = parts.iteratorAt(p2.globalIndex() - 2); const auto& negChild = parts.iteratorAt(p2.globalIndex() - 1); /// Daughters that do not pass this condition are not selected - if (!IsParticleTPC(posChild, V0ChildTable[ConfV0Type1][0]) || !IsParticleTPC(negChild, V0ChildTable[ConfV0Type1][1])) + if (!isParticleTPC(posChild, V0ChildTable[confV0Type1][0]) || !isParticleTPC(negChild, V0ChildTable[confV0Type1][1])) continue; // track cleaning if (!pairCleaner.isCleanPair(p1, p2, parts)) { continue; } - if (ConfIsCPR.value) { + if (confIsCPR.value) { if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla1, femtoUniverseContainer::EventType::mixed)) { continue; } @@ -605,45 +607,45 @@ struct femtoUniversePairTaskTrackV0Extended { weight = plocalEffp1.get()->GetBinContent(plocalEffp1->FindBin(p1.pt(), p1.eta())) * plocalEffp2.get()->GetBinContent(plocalEffp2->FindBin(p2.pt(), p2.eta())); if constexpr (std::is_same::value) - mixedEventCont.setPair(p1, p2, multCol, ConfUse3D, weight); + mixedEventCont.setPair(p1, p2, multCol, confUse3D, weight); else - mixedEventCont.setPair(p1, p2, multCol, ConfUse3D, weight); + mixedEventCont.setPair(p1, p2, multCol, confUse3D, weight); } }; - if (ConfUseCent) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinningCent, 5, -1, cols, cols)) { + if (confUseCent) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningCent, confNEventsMix, -1, cols, cols)) { mixedCollProcessFunc(collision1, collision2); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningCent.getBin({collision1.posZ(), collision1.multV0M()})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningCent.getBin({collision1.posZ(), collision1.multV0M()})); } } else { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinningMult, 5, -1, cols, cols)) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningMult, confNEventsMix, -1, cols, cols)) { mixedCollProcessFunc(collision1, collision2); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningMult.getBin({collision1.posZ(), collision1.multNtr()})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningMult.getBin({collision1.posZ(), collision1.multNtr()})); } } } - void processMixedEvent(FilteredFDCollisions& cols, FemtoFullParticles& parts) + void processMixedEvent(FilteredFDCollisions const& cols, FemtoFullParticles const& parts) { doMixedEvent(cols, parts, partsOne, partsTwo); } - PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMixedEvent, "Enable processing mixed event for track - V0", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMixedEvent, "Enable processing mixed event for track - V0", false); - void processMixedEventMCReco(FilteredFDCollisions& cols, FemtoRecoParticles& parts, aod::FDMCParticles const& mcparts) + void processMixedEventMCReco(FilteredFDCollisions const& cols, FemtoRecoParticles const& parts, aod::FDMCParticles const& mcparts) { doMixedEvent(cols, parts, partsOneMCReco, partsTwoMCReco, mcparts); } - PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMixedEventMCReco, "Enable processing mixed event for track - V0 for MC Reco", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMixedEventMCReco, "Enable processing mixed event for track - V0 for MC Reco", false); /// This function processes the mixed event for V0 - V0 - void processMixedEventV0(FilteredFDCollisions& cols, FemtoFullParticles& parts) + void processMixedEventV0(FilteredFDCollisions const& cols, FemtoFullParticles const& parts) { - ColumnBinningPolicy colBinningMult{{ConfVtxBins, ConfMultBins}, true}; - ColumnBinningPolicy colBinningCent{{ConfVtxBins, ConfMultBins}, true}; + ColumnBinningPolicy colBinningMult{{confVtxBins, confMultBins}, true}; + ColumnBinningPolicy colBinningCent{{confVtxBins, confMultBins}, true}; auto mixedCollProcessFunc = [&](auto& collision1, auto& collision2) -> void { - const int multCol = ConfUseCent ? collision1.multV0M() : collision1.multNtr(); + const int multCol = confUseCent ? collision1.multV0M() : collision1.multNtr(); auto groupPartsOne = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); @@ -655,7 +657,7 @@ struct femtoUniversePairTaskTrackV0Extended { return; } - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Lambda invariant mass cut for p1 if (!invMLambda(p1.mLambda(), p1.mAntiLambda())) { continue; @@ -668,50 +670,50 @@ struct femtoUniversePairTaskTrackV0Extended { const auto& posChild1 = parts.iteratorAt(p1.globalIndex() - 2); const auto& negChild1 = parts.iteratorAt(p1.globalIndex() - 1); /// Daughters that do not pass this condition are not selected - if (!IsParticleTPC(posChild1, V0ChildTable[ConfV0Type1][0]) || !IsParticleTPC(negChild1, V0ChildTable[ConfV0Type1][1])) + if (!isParticleTPC(posChild1, V0ChildTable[confV0Type1][0]) || !isParticleTPC(negChild1, V0ChildTable[confV0Type1][1])) continue; const auto& posChild2 = parts.iteratorAt(p2.globalIndex() - 2); const auto& negChild2 = parts.iteratorAt(p2.globalIndex() - 1); /// Daughters that do not pass this condition are not selected - if (!IsParticleTPC(posChild2, V0ChildTable[ConfV0Type2][0]) || !IsParticleTPC(negChild2, V0ChildTable[ConfV0Type2][1])) + if (!isParticleTPC(posChild2, V0ChildTable[confV0Type2][0]) || !isParticleTPC(negChild2, V0ChildTable[confV0Type2][1])) continue; // track cleaning if (!pairCleanerV0.isCleanPair(p1, p2, parts)) { continue; } - if (ConfIsCPR.value) { + if (confIsCPR.value) { if (pairCloseRejectionV0.isClosePair(p1, p2, parts, magFieldTesla1, femtoUniverseContainer::EventType::mixed)) { continue; } } - mixedEventCont.setPair(p1, p2, multCol, ConfUse3D); + mixedEventCont.setPair(p1, p2, multCol, confUse3D); } }; - if (ConfUseCent) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinningCent, 5, -1, cols, cols)) { + if (confUseCent) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningCent, confNEventsMix, -1, cols, cols)) { mixedCollProcessFunc(collision1, collision2); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningCent.getBin({collision1.posZ(), collision1.multV0M()})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningCent.getBin({collision1.posZ(), collision1.multV0M()})); } } else { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinningMult, 5, -1, cols, cols)) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningMult, confNEventsMix, -1, cols, cols)) { mixedCollProcessFunc(collision1, collision2); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningMult.getBin({collision1.posZ(), collision1.multNtr()})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningMult.getBin({collision1.posZ(), collision1.multNtr()})); } } } - PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMixedEventV0, "Enable processing mixed events for V0 - V0", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMixedEventV0, "Enable processing mixed events for V0 - V0", false); /// This function processes MC mixed events for Track - V0 - void processMCMixedEvent(FilteredFDCollisions& cols, FemtoFullParticles& parts) + void processMCMixedEvent(FilteredFDCollisions const& cols, FemtoFullParticles const& parts) { - ColumnBinningPolicy colBinningMult{{ConfVtxBins, ConfMultBins}, true}; - ColumnBinningPolicy colBinningCent{{ConfVtxBins, ConfMultBins}, true}; + ColumnBinningPolicy colBinningMult{{confVtxBins, confMultBins}, true}; + ColumnBinningPolicy colBinningCent{{confVtxBins, confMultBins}, true}; auto mixedCollProcessFunc = [&](auto& collision1, auto& collision2) -> void { - const int multCol = ConfUseCent ? collision1.multV0M() : collision1.multNtr(); + const int multCol = confUseCent ? collision1.multV0M() : collision1.multNtr(); auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); @@ -722,79 +724,79 @@ struct femtoUniversePairTaskTrackV0Extended { if (magFieldTesla1 != magFieldTesla2) { return; } - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (static_cast(p1.pidcut()) != ConfTrkPDGCodePartOne) + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + if (static_cast(p1.pidcut()) != confTrkPDGCodePartOne) continue; int pdgCode2 = static_cast(p2.pidcut()); - if ((ConfV0Type1 == 0 && pdgCode2 != 3122) || (ConfV0Type1 == 1 && pdgCode2 != -3122)) + if ((confV0Type1 == 0 && pdgCode2 != 3122) || (confV0Type1 == 1 && pdgCode2 != -3122)) continue; - if (ConfIsCPR.value) { + if (confIsCPR.value) { if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla1, femtoUniverseContainer::EventType::mixed)) { continue; } } - mixedEventCont.setPair(p1, p2, multCol, ConfUse3D); + mixedEventCont.setPair(p1, p2, multCol, confUse3D); } }; - if (ConfUseCent) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinningCent, 5, -1, cols, cols)) { + if (confUseCent) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningCent, confNEventsMix, -1, cols, cols)) { mixedCollProcessFunc(collision1, collision2); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningCent.getBin({collision1.posZ(), collision1.multV0M()})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningCent.getBin({collision1.posZ(), collision1.multV0M()})); } } else { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinningMult, 5, -1, cols, cols)) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningMult, confNEventsMix, -1, cols, cols)) { mixedCollProcessFunc(collision1, collision2); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningMult.getBin({collision1.posZ(), collision1.multNtr()})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningMult.getBin({collision1.posZ(), collision1.multNtr()})); } } } - PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMCMixedEvent, "Enable processing mixed events for MC truth track - V0", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMCMixedEvent, "Enable processing mixed events for MC truth track - V0", false); /// This function processes MC mixed events for V0 - V0 - void processMCMixedEventV0(FilteredFDCollisions& cols, FemtoFullParticles& /*parts*/) + void processMCMixedEventV0(FilteredFDCollisions const& cols, FemtoFullParticles const& /*parts*/) { - ColumnBinningPolicy colBinningMult{{ConfVtxBins, ConfMultBins}, true}; - ColumnBinningPolicy colBinningCent{{ConfVtxBins, ConfMultBins}, true}; + ColumnBinningPolicy colBinningMult{{confVtxBins, confMultBins}, true}; + ColumnBinningPolicy colBinningCent{{confVtxBins, confMultBins}, true}; auto mixedCollProcessFunc = [&](auto& collision1, auto& collision2) -> void { - const int multCol = ConfUseCent ? collision1.multV0M() : collision1.multNtr(); + const int multCol = confUseCent ? collision1.multV0M() : collision1.multNtr(); auto groupPartsOne = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { int pdgCode1 = static_cast(p1.pidcut()); - if ((ConfV0Type1 == 0 && pdgCode1 != 3122) || (ConfV0Type1 == 1 && pdgCode1 != -3122)) + if ((confV0Type1 == 0 && pdgCode1 != 3122) || (confV0Type1 == 1 && pdgCode1 != -3122)) continue; int pdgCode2 = static_cast(p2.pidcut()); - if ((ConfV0Type2 == 0 && pdgCode2 != 3122) || (ConfV0Type2 == 1 && pdgCode2 != -3122)) + if ((confV0Type2 == 0 && pdgCode2 != 3122) || (confV0Type2 == 1 && pdgCode2 != -3122)) continue; - mixedEventCont.setPair(p1, p2, multCol, ConfUse3D); + mixedEventCont.setPair(p1, p2, multCol, confUse3D); } }; - if (ConfUseCent) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinningCent, 5, -1, cols, cols)) { + if (confUseCent) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningCent, confNEventsMix, -1, cols, cols)) { mixedCollProcessFunc(collision1, collision2); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningCent.getBin({collision1.posZ(), collision1.multV0M()})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningCent.getBin({collision1.posZ(), collision1.multV0M()})); } } else { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinningMult, 5, -1, cols, cols)) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinningMult, confNEventsMix, -1, cols, cols)) { mixedCollProcessFunc(collision1, collision2); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningMult.getBin({collision1.posZ(), collision1.multNtr()})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinningMult.getBin({collision1.posZ(), collision1.multNtr()})); } } } - PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMCMixedEventV0, "Enable processing mixed events for MC truth V0 - V0", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMCMixedEventV0, "Enable processing mixed events for MC truth V0 - V0", false); ///--------------------------------------------MC-------------------------------------------------/// /// This function fills MC truth particles from derived MC table void processMCTruth(aod::FDParticles const& parts) { - for (auto& part : parts) { + for (const auto& part : parts) { if (part.partType() != uint8_t(aod::femtouniverseparticle::ParticleType::kMCTruthTrack)) continue; @@ -838,11 +840,11 @@ struct femtoUniversePairTaskTrackV0Extended { } } - PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMCTruth, "Process MC truth data", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMCTruth, "Process MC truth data", false); void processMCReco(FemtoRecoParticles const& parts, aod::FDMCParticles const& mcparts) { - for (auto& part : parts) { + for (const auto& part : parts) { auto mcPartId = part.fdMCParticleId(); if (mcPartId == -1) continue; // no MC particle @@ -853,7 +855,7 @@ struct femtoUniversePairTaskTrackV0Extended { const auto& posChild = parts.iteratorAt(part.globalIndex() - 2); const auto& negChild = parts.iteratorAt(part.globalIndex() - 1); /// Daughters that do not pass this condition are not selected - if (IsParticleTPC(posChild, 0) && IsParticleTPC(negChild, 1)) { + if (isParticleTPC(posChild, 0) && isParticleTPC(negChild, 1)) { registryMCreco.fill(HIST("plus/MCrecoLambda"), mcpart.pt(), mcpart.eta()); // lambda if (auto mcpartIdChild = posChild.fdMCParticleId(); mcpartIdChild != -1) { const auto& mcpartChild = mcparts.iteratorAt(mcpartIdChild); @@ -868,7 +870,7 @@ struct femtoUniversePairTaskTrackV0Extended { const auto& posChild = parts.iteratorAt(part.globalIndex() - 2); const auto& negChild = parts.iteratorAt(part.globalIndex() - 1); /// Daughters that do not pass this condition are not selected - if (IsParticleTPC(posChild, 1) && IsParticleTPC(negChild, 0)) { + if (isParticleTPC(posChild, 1) && isParticleTPC(negChild, 0)) { registryMCreco.fill(HIST("minus/MCrecoLambda"), mcpart.pt(), mcpart.eta()); // anti-lambda if (auto mcpartIdChild = posChild.fdMCParticleId(); mcpartIdChild != -1) { const auto& mcpartChild = mcparts.iteratorAt(mcpartIdChild); @@ -883,10 +885,10 @@ struct femtoUniversePairTaskTrackV0Extended { } else if (part.partType() == aod::femtouniverseparticle::ParticleType::kTrack) { if (part.sign() > 0) { registryMCreco.fill(HIST("plus/MCrecoAllPt"), mcpart.pt()); - if (mcpart.pdgMCTruth() == 211 && IsNSigmaCombined(part.p(), unPackInTable(part.tpcNSigmaStorePi()), unPackInTable(part.tofNSigmaStorePi()))) { + if (mcpart.pdgMCTruth() == 211 && isNSigmaCombined(part.p(), unPackInTable(part.tpcNSigmaStorePi()), unPackInTable(part.tofNSigmaStorePi()))) { registryMCreco.fill(HIST("plus/MCrecoPi"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("plus/MCrecoPiPt"), mcpart.pt()); - } else if (mcpart.pdgMCTruth() == 2212 && IsNSigmaCombined(part.p(), unPackInTable(part.tpcNSigmaStorePr()), unPackInTable(part.tofNSigmaStorePr()))) { + } else if (mcpart.pdgMCTruth() == 2212 && isNSigmaCombined(part.p(), unPackInTable(part.tpcNSigmaStorePr()), unPackInTable(part.tofNSigmaStorePr()))) { registryMCreco.fill(HIST("plus/MCrecoPr"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("plus/MCrecoPrPt"), mcpart.pt()); } @@ -894,10 +896,10 @@ struct femtoUniversePairTaskTrackV0Extended { if (part.sign() < 0) { registryMCreco.fill(HIST("minus/MCrecoAllPt"), mcpart.pt()); - if (mcpart.pdgMCTruth() == -211 && IsNSigmaCombined(part.p(), unPackInTable(part.tpcNSigmaStorePi()), unPackInTable(part.tofNSigmaStorePi()))) { + if (mcpart.pdgMCTruth() == -211 && isNSigmaCombined(part.p(), unPackInTable(part.tpcNSigmaStorePi()), unPackInTable(part.tofNSigmaStorePi()))) { registryMCreco.fill(HIST("minus/MCrecoPi"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("minus/MCrecoPiPt"), mcpart.pt()); - } else if (mcpart.pdgMCTruth() == -2212 && IsNSigmaCombined(part.p(), unPackInTable(part.tpcNSigmaStorePr()), unPackInTable(part.tofNSigmaStorePr()))) { + } else if (mcpart.pdgMCTruth() == -2212 && isNSigmaCombined(part.p(), unPackInTable(part.tpcNSigmaStorePr()), unPackInTable(part.tofNSigmaStorePr()))) { registryMCreco.fill(HIST("minus/MCrecoPr"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("minus/MCrecoPrPt"), mcpart.pt()); } @@ -906,13 +908,13 @@ struct femtoUniversePairTaskTrackV0Extended { } } - PROCESS_SWITCH(femtoUniversePairTaskTrackV0Extended, processMCReco, "Process MC reco data", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMCReco, "Process MC reco data", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; return workflow; } From 235d8efe69310676e8417935c1f42edd7b1fb0d7 Mon Sep 17 00:00:00 2001 From: "Lu, Pengzhong" <55934557+lupengzhong@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:13:53 +0800 Subject: [PATCH 359/459] [PWGDQ] Create a table with only standard PID information (#8953) Signed-off-by: Pengzhong Lu Co-authored-by: Pengzhong Lu --- PWGDQ/TableProducer/tableMaker.cxx | 52 +++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/PWGDQ/TableProducer/tableMaker.cxx b/PWGDQ/TableProducer/tableMaker.cxx index 0e54baa926f..48961a3ae0e 100644 --- a/PWGDQ/TableProducer/tableMaker.cxx +++ b/PWGDQ/TableProducer/tableMaker.cxx @@ -83,6 +83,11 @@ using MyBarrelTracksWithCov = soa::Join; +using MyBarrelTracksWithCovOnlyStdPID = soa::Join; using MyBarrelTracksWithV0Bits = soa::Join("processFullWithCovMultsAndEventFilter") || context.mOptions.get("processBarrelOnly") || context.mOptions.get("processBarrelOnlyWithCent") || context.mOptions.get("processBarrelOnlyWithCovWithCent") || context.mOptions.get("processBarrelOnlyWithMults") || context.mOptions.get("processBarrelOnlyWithCentAndMults") || context.mOptions.get("processBarrelOnlyWithCovWithCentAndMults") || - context.mOptions.get("processBarrelOnlyWithCov") || context.mOptions.get("processBarrelOnlyWithEventFilter") || + context.mOptions.get("processBarrelOnlyWithCov") || context.mOptions.get("processBarrelOnlyWithCovOnlyStdPID") || context.mOptions.get("processBarrelOnlyWithEventFilter") || context.mOptions.get("processBarrelOnlyWithMultsAndEventFilter") || context.mOptions.get("processBarrelOnlyWithCovAndEventFilter") || context.mOptions.get("processBarrelOnlyWithDalitzBits") || context.mOptions.get("processBarrelOnlyWithV0Bits") || context.mOptions.get("processBarrelWithDalitzEvent") || context.mOptions.get("processBarrelOnlyWithV0BitsAndMaps") || context.mOptions.get("processAmbiguousBarrelOnly")) || @@ -612,11 +618,19 @@ struct TableMaker { float nSigmaPi = (fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPi_Corr] : track.tpcNSigmaPi()); float nSigmaKa = ((fConfigComputeTPCpostCalib && fConfigComputeTPCpostCalibKaon) ? VarManager::fgValues[VarManager::kTPCnSigmaKa_Corr] : track.tpcNSigmaKa()); float nSigmaPr = (fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPr_Corr] : track.tpcNSigmaPr()); - trackBarrelPID(track.tpcSignal(), - nSigmaEl, track.tpcNSigmaMu(), nSigmaPi, nSigmaKa, nSigmaPr, - track.beta(), - track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), - track.trdSignal()); + if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackPIDExtra)) { + trackBarrelPID(track.tpcSignal(), + nSigmaEl, track.tpcNSigmaMu(), nSigmaPi, nSigmaKa, nSigmaPr, + track.beta(), + track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), + track.trdSignal()); + } else { + trackBarrelPID(track.tpcSignal(), + nSigmaEl, -1, nSigmaPi, nSigmaKa, nSigmaPr, + -1, + track.tofNSigmaEl(), -1, track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), + -1); + } } if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackTPCPID)) { trackBarrelPID(track.tpcSignal(), track.tpcNSigmaEl(), -1, track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(), @@ -1054,11 +1068,19 @@ struct TableMaker { float nSigmaEl = (fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaEl_Corr] : track.tpcNSigmaEl()); float nSigmaPi = (fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPi_Corr] : track.tpcNSigmaPi()); float nSigmaPr = (fConfigComputeTPCpostCalib ? VarManager::fgValues[VarManager::kTPCnSigmaPr_Corr] : track.tpcNSigmaPr()); - trackBarrelPID(track.tpcSignal(), - nSigmaEl, track.tpcNSigmaMu(), nSigmaPi, track.tpcNSigmaKa(), nSigmaPr, - track.beta(), - track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), - track.trdSignal()); + if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackPIDExtra)) { + trackBarrelPID(track.tpcSignal(), + nSigmaEl, track.tpcNSigmaMu(), nSigmaPi, track.tpcNSigmaKa(), nSigmaPr, + track.beta(), + track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), + track.trdSignal()); + } else { + trackBarrelPID(track.tpcSignal(), + nSigmaEl, -1, nSigmaPi, track.tpcNSigmaKa(), nSigmaPr, + -1, + track.tofNSigmaEl(), -1, track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), + -1); + } } if constexpr (static_cast(TTrackFillMap & VarManager::ObjTypes::TrackTPCPID)) { trackBarrelPID(track.tpcSignal(), track.tpcNSigmaEl(), -1, track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(), @@ -1517,6 +1539,13 @@ struct TableMaker { fullSkimming(collision, bcs, tracksBarrel, nullptr, nullptr, nullptr); } + // Produce barrel tables only, with track cov matrix , only std PID information used ---------------------------------------------------------------------------------------- + void processBarrelOnlyWithCovOnlyStdPID(MyEventsWithMults::iterator const& collision, aod::BCsWithTimestamps const& bcs, + soa::Filtered const& tracksBarrel) + { + fullSkimming(collision, bcs, tracksBarrel, nullptr, nullptr, nullptr); + } + // Produce barrel tables only ---------------------------------------------------------------------------------------------------------------- void processBarrelOnly(MyEvents::iterator const& collision, aod::BCsWithTimestamps const& bcs, soa::Filtered const& tracksBarrel) @@ -1752,6 +1781,7 @@ struct TableMaker { PROCESS_SWITCH(TableMaker, processBarrelOnlyWithCentAndMults, "Build barrel-only DQ skimmed data model, w/ centrality and multiplicities", false); PROCESS_SWITCH(TableMaker, processBarrelOnlyWithCovWithCentAndMults, "Build barrel-only DQ skimmed data model, w/ centrality and multiplicities and w/ track covariance", false); PROCESS_SWITCH(TableMaker, processBarrelOnlyWithCov, "Build barrel-only DQ skimmed data model, w/ track cov matrix", false); + PROCESS_SWITCH(TableMaker, processBarrelOnlyWithCovOnlyStdPID, "Build barrel-only DQ skimmed data model, w/ track cov matrix, only std PID information used", false); PROCESS_SWITCH(TableMaker, processBarrelOnly, "Build barrel-only DQ skimmed data model, w/o centrality", false); PROCESS_SWITCH(TableMaker, processMuonOnlyWithCovAndCent, "Build muon-only DQ skimmed data model, w/ centrality and muon cov matrix", false); PROCESS_SWITCH(TableMaker, processMuonOnlyWithCov, "Build muon-only DQ skimmed data model, w/ muon cov matrix", false); From f6ba0fac76e32fce89fbc628da58b0a54aa1628f Mon Sep 17 00:00:00 2001 From: abilandz Date: Thu, 12 Dec 2024 15:59:58 +0100 Subject: [PATCH 360/459] [PWGCF] added min vertex distance cut + minor fixes (#8956) --- .../Core/MuPa-Configurables.h | 35 ++-- .../Core/MuPa-DataMembers.h | 2 +- .../Core/MuPa-Enums.h | 7 +- .../Core/MuPa-MemberFunctions.h | 175 +++++++++++++----- 4 files changed, 153 insertions(+), 66 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h index c1aecefbc0e..7c5012a3804 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h @@ -46,7 +46,7 @@ struct : ConfigurableGroup { Configurable cfCheckUnderflowAndOverflow{"cfCheckUnderflowAndOverflow", false, "check and bail out if in event and particle histograms there are entries which went to underflow or overflow bins (use only locally)"}; Configurable cfRebin{"cfRebin", 1, "number of bins of selected heavy 2D histograms are devided with this number"}; Configurable cfFillQAEventHistograms2D{"cfFillQAEventHistograms2D", false, "if false, all QA 2D event histograms are not filled. if true, only the ones for which fBookQAEventHistograms2D[...] is true, are filled"}; - Configurable> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"1-Multiplicity_vs_ReferenceMultiplicity", "1-Multiplicity_vs_NContributors", "1-Multiplicity_vs_Centrality", "1-Multiplicity_vs_Vertex_z", "1-Multiplicity_vs_Occupancy", "1-ReferenceMultiplicity_vs_NContributors", "1-ReferenceMultiplicity_vs_Centrality", "1-ReferenceMultiplicity_vs_Vertex_z", "1-ReferenceMultiplicity_vs_Occupancy", "1-NContributors_vs_Centrality", "1-NContributors_vs_Vertex_z", "1-NContributors_vs_Occupancy", "1-Centrality_vs_Vertex_z", "1-Centrality_vs_Occupancy", "1-Centrality_vs_ImpactParameter", "1-Vertex_z_vs_Occupancy", "0-MultNTracksPV_vs_MultNTracksGlobal", "0-CentFT0C_vs_CentNTPV", "0-CentFT0M_vs_CentNTPV", "0-CentRun2V0M_vs_CentRun2SPDTracklets", "1-TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange", "1-CurrentRunDuration_vs_InteractionRate"}, "book (1) or do not book (0) this QA 2D event histogram"}; + Configurable> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"1-Multiplicity_vs_ReferenceMultiplicity", "1-Multiplicity_vs_NContributors", "1-Multiplicity_vs_Centrality", "1-Multiplicity_vs_Vertex_z", "1-Multiplicity_vs_Occupancy", "1-ReferenceMultiplicity_vs_NContributors", "1-ReferenceMultiplicity_vs_Centrality", "1-ReferenceMultiplicity_vs_Vertex_z", "1-ReferenceMultiplicity_vs_Occupancy", "1-NContributors_vs_Centrality", "1-NContributors_vs_Vertex_z", "1-NContributors_vs_Occupancy", "1-Centrality_vs_Vertex_z", "1-Centrality_vs_Occupancy", "0-Centrality_vs_ImpactParameter", "1-Vertex_z_vs_Occupancy", "0-MultNTracksPV_vs_MultNTracksGlobal", "0-CentFT0C_vs_CentNTPV", "0-CentFT0M_vs_CentNTPV", "0-CentRun2V0M_vs_CentRun2SPDTracklets", "1-TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange", "1-CurrentRunDuration_vs_InteractionRate"}, "book (1) or do not book (0) this QA 2D event histogram"}; Configurable cfFillQAParticleHistograms2D{"cfFillQAParticleHistograms2D", false, "if false, all QA 2D particle histograms are not filled. if true, only the ones for which fBookQAParticleHistograms2D[...] is true, are filled"}; Configurable> cfBookQAParticleHistograms2D{"cfBookQAParticleHistograms2D", {"1-Pt_vs_dcaXY"}, "book (1) or do not book (0) this QA 2D particle histogram"}; } cf_qa; @@ -59,7 +59,7 @@ struct : ConfigurableGroup { // *) Event cuts: struct : ConfigurableGroup { - Configurable> cfUseEventCuts{"cfUseEventCuts", {"1-NumberOfEvents", "1-TotalMultiplicity", "1-Multiplicity", "1-ReferenceMultiplicity", "1-Centrality", "1-Vertex_x", "1-Vertex_y", "1-Vertex_z", "1-NContributors", "1-ImpactParameter", "0-EventPlaneAngle", "1-Occupancy", "1-InteractionRate", "1-CurrentRunDuration", "0-MultMCNParticlesEta08", "0-Trigger", "0-Sel7", "1-Sel8", "1-MultiplicityEstimator", "1-ReferenceMultiplicityEstimator", "1-CentralityEstimator", "1-SelectedEvents", "1-NoSameBunchPileup", "1-IsGoodZvtxFT0vsPV", "1-IsVertexITSTPC", "1-IsVertexTOFmatched", "1-IsVertexTRDmatched", "0-NoCollInTimeRangeStrict", "0-NoCollInTimeRangeStandard", "0-NoCollInRofStrict", "0-NoCollInRofStandard", "0-NoHighMultCollInPrevRof", "1-OccupancyEstimator"}, "use (1) or do not use (0) event cuts"}; + Configurable> cfUseEventCuts{"cfUseEventCuts", {"1-NumberOfEvents", "1-TotalMultiplicity", "1-Multiplicity", "1-ReferenceMultiplicity", "1-Centrality", "1-Vertex_x", "1-Vertex_y", "1-Vertex_z", "1-NContributors", "1-ImpactParameter", "0-EventPlaneAngle", "1-Occupancy", "1-InteractionRate", "1-CurrentRunDuration", "0-MultMCNParticlesEta08", "0-Trigger", "0-Sel7", "1-Sel8", "1-MultiplicityEstimator", "1-ReferenceMultiplicityEstimator", "1-CentralityEstimator", "1-SelectedEvents", "1-NoSameBunchPileup", "1-IsGoodZvtxFT0vsPV", "1-IsVertexITSTPC", "1-IsVertexTOFmatched", "1-IsVertexTRDmatched", "0-NoCollInTimeRangeStrict", "0-NoCollInTimeRangeStandard", "0-NoCollInRofStrict", "0-NoCollInRofStandard", "0-NoHighMultCollInPrevRof", "1-OccupancyEstimator", "1-MinVertexDistanceFromIP"}, "use (1) or do not use (0) event cuts"}; Configurable cfUseEventCutCounterAbsolute{"cfUseEventCutCounterAbsolute", false, "profile and save how many times each event cut counter triggered (absolute). Use with care, as this is computationally heavy"}; Configurable cfUseEventCutCounterSequential{"cfUseEventCutCounterSequential", false, "profile and save how many times each event cut counter triggered (sequential). Use with care, as this is computationally heavy"}; Configurable cfPrintCutCounterContent{"cfPrintCutCounterContent", false, "if true, prints on the screen after each event the content of fEventCutCounterHist[*][*] (all which were booked)"}; @@ -71,10 +71,11 @@ struct : ConfigurableGroup { Configurable> cfCentrality{"cfCentrality", {-10., 110.}, "centrality range: {min, max}, with convention: min <= cent < max"}; Configurable> cfVertex_x{"cfVertex_x", {-10., 10.}, "vertex x position range: {min, max}[cm], with convention: min <= Vx < max"}; Configurable> cfVertex_y{"cfVertex_y", {-10., 10.}, "vertex y position range: {min, max}[cm], with convention: min <= Vy < max"}; - Configurable> cfVertex_z{"cfVertex_z", {-10., 10.}, "vertex z position range: {min, max}[cm], with convention: min <= Vz < max"}; + Configurable> cfVertex_z{"cfVertex_z", {-10, 10.}, "vertex z position range: {min, max}[cm], with convention: min <= Vz < max"}; + Configurable cfMinVertexDistanceFromIP{"cfMinVertexDistanceFromIP", {0.000001}, "if sqrt(vx^2+vy^2+vz^2) < cfMinVertexDistanceFromIP [cm], the event is reject. IP = nominal Interaction Point."}; Configurable> cfNContributors{"cfNContributors", {2, 1000000000}, "Number of vertex contributors: {min, max}, with convention: min <= N < max"}; Configurable> cfImpactParameter{"cfImpactParameter", {-1, 1000000000}, "Impact parameter range (can be used only for sim): {min, max}, with convention: min <= IP < max"}; - Configurable> cfEventPlaneAngle{"cfEventPlaneAngle", {-1000, 1000000000}, "Event Plane Angle range (can be used only for sim): {min, max}, with convention: min <= EP < max"}; + Configurable> cfEventPlaneAngle{"cfEventPlaneAngle", {-o2::constants::math::PI, o2::constants::math::TwoPI}, "Event Plane Angle range (can be used only for sim): {min, max}, with convention: min <= EP < max"}; Configurable> cfOccupancy{"cfOccupancy", {-2, 1000000000}, "Range for occupancy (use cfOccupancyEstimator to set specific estimator): {min, max}, with convention: min <= X < max"}; Configurable> cfInteractionRate{"cfInteractionRate", {-2, 1000000000}, "Range for interaction rate: {min, max}, with convention: min <= X < max"}; Configurable> cfCurrentRunDuration{"cfCurrentRunDuration", {-2, 1000000000}, "Range for current run duration (i.e. seconds since start of run) in seconds: {min, max}, with convention: min <= X < max. Only collisions taken in this range (measured from SOR) are taken for analysis"}; @@ -114,13 +115,13 @@ struct : ConfigurableGroup { Configurable> cfUseParticleCuts{"cfUseParticleCuts", {"1-Phi", "1-Pt", "1-Eta", "1-Charge", "1-tpcNClsFindable", "1-tpcNClsShared", "1-tpcNClsFound", "1-tpcNClsCrossedRows", "1-itsNCls", "1-itsNClsInnerBarrel", "1-tpcCrossedRowsOverFindableCls", "1-tpcFoundOverFindableCls", "1-tpcFractionSharedCls", "1-dcaXY", "1-dcaZ", "1-PDG", "0-trackCutFlagFb1", "0-trackCutFlagFb2", "0-isQualityTrack", "0-isPrimaryTrack", "0-isInAcceptanceTrack", "0-isGlobalTrack", "0-PtDependentDCAxyParameterization"}, "Use (1) or do not use (0) particle cuts"}; Configurable cfUseParticleCutCounterAbsolute{"cfUseParticleCutCounterAbsolute", false, "profile and save how many times each particle cut counter triggered (absolute). Use with care, as this is computationally heavy"}; Configurable cfUseParticleCutCounterSequential{"cfUseParticleCutCounterSequential", false, "profile and save how many times each particle cut counter triggered (sequential). Use with care, as this is computationally heavy"}; - Configurable> cfPhi{"cfPhi", {0.0, TMath::TwoPi()}, "phi range: {min, max}[rad], with convention: min <= phi < max"}; + Configurable> cfPhi{"cfPhi", {0.0, o2::constants::math::TwoPI}, "phi range: {min, max}[rad], with convention: min <= phi < max"}; Configurable> cfPt{"cfPt", {0.2, 5.0}, "pt range: {min, max}[GeV], with convention: min <= pt < max"}; Configurable> cfEta{"cfEta", {-0.8, 0.8}, "eta range: {min, max}, with convention: min <= eta < max"}; Configurable> cfCharge{"cfCharge", {-1.5, 1.5}, "particle charge. {-1.5,0} = only negative, {0,1.5} = only positive"}; Configurable> cftpcNClsFindable{"cftpcNClsFindable", {-1000., 1000.}, "tpcNClsFindable range: {min, max}, with convention: min <= cftpcNClsFindable < max"}; Configurable> cftpcNClsShared{"cftpcNClsShared", {-1000., 1000.}, "tpcNClsShared range: {min, max}, with convention: min <= cftpcNClsShared < max"}; - Configurable> cftpcNClsFound{"cftpcNClsFound", {-1000., 1000.}, "tpcNClsFound range: {min, max}, with convention: min <= cftpcNClsFound < max"}; + Configurable> cftpcNClsFound{"cftpcNClsFound", {70., 1000.}, "tpcNClsFound range: {min, max}, with convention: min <= cftpcNClsFound < max"}; Configurable> cftpcNClsCrossedRows{"cftpcNClsCrossedRows", {70., 1000.}, "tpcNClsCrossedRows range: {min, max}, with convention: min <= tpcNClsCrossedRows < max"}; Configurable> cfitsNCls{"cfitsNCls", {5., 1000.}, "itsNCls range: {min, max}, with convention: min <= itsNCls < max"}; Configurable> cfitsNClsInnerBarrel{"cfitsNClsInnerBarrel", {-1000., 1000.}, "itsNClsInnerBarrel range: {min, max}, with convention: min <= cfitsNClsInnerBarrel < max"}; @@ -148,14 +149,14 @@ struct : ConfigurableGroup { // *) Multiparticle correlations: struct : ConfigurableGroup { Configurable cfCalculateCorrelations{"cfCalculateCorrelations", false, "calculate or not multiparticle correlations"}; - Configurable cfCalculateCorrelationsAsFunctionOfIntegrated{"cfCalculateCorrelationsAsFunctionOfIntegrated", false, "calculate or not correlations as a function of integrated"}; - Configurable cfCalculateCorrelationsAsFunctionOfMultiplicity{"cfCalculateCorrelationsAsFunctionOfMultiplicity", false, "calculate or not correlations as a function of multiplicity"}; - Configurable cfCalculateCorrelationsAsFunctionOfCentrality{"cfCalculateCorrelationsAsFunctionOfCentrality", false, "calculate or not correlations as a function of centrality"}; + Configurable cfCalculateCorrelationsAsFunctionOfIntegrated{"cfCalculateCorrelationsAsFunctionOfIntegrated", true, "calculate or not correlations as a function of integrated"}; + Configurable cfCalculateCorrelationsAsFunctionOfMultiplicity{"cfCalculateCorrelationsAsFunctionOfMultiplicity", true, "calculate or not correlations as a function of multiplicity"}; + Configurable cfCalculateCorrelationsAsFunctionOfCentrality{"cfCalculateCorrelationsAsFunctionOfCentrality", true, "calculate or not correlations as a function of centrality"}; Configurable cfCalculateCorrelationsAsFunctionOfPt{"cfCalculateCorrelationsAsFunctionOfPt", false, "calculate or not correlations as a function of pt"}; Configurable cfCalculateCorrelationsAsFunctionOfEta{"cfCalculateCorrelationsAsFunctionOfEta", false, "calculate or not correlations as a function of eta"}; - Configurable cfCalculateCorrelationsAsFunctionOfOccupancy{"cfCalculateCorrelationsAsFunctionOfOccupancy", false, "calculate or not correlations as a function of occupancy"}; - Configurable cfCalculateCorrelationsAsFunctionOfInteractionRate{"cfCalculateCorrelationsAsFunctionOfInteractionRate", false, "calculate or not correlations as a function of interaction rate"}; - Configurable cfCalculateCorrelationsAsFunctionOfCurrentRunDuration{"cfCalculateCorrelationsAsFunctionOfCurrentRunDuration", false, "calculate or not correlations as a function of current run duration (i.e. vs. seconds since start of run)"}; + Configurable cfCalculateCorrelationsAsFunctionOfOccupancy{"cfCalculateCorrelationsAsFunctionOfOccupancy", true, "calculate or not correlations as a function of occupancy"}; + Configurable cfCalculateCorrelationsAsFunctionOfInteractionRate{"cfCalculateCorrelationsAsFunctionOfInteractionRate", true, "calculate or not correlations as a function of interaction rate"}; + Configurable cfCalculateCorrelationsAsFunctionOfCurrentRunDuration{"cfCalculateCorrelationsAsFunctionOfCurrentRunDuration", true, "calculate or not correlations as a function of current run duration (i.e. vs. seconds since start of run)"}; } cf_mupa; // *) Test0: @@ -242,7 +243,7 @@ struct : ConfigurableGroup { Configurable> cfFixedLength_cent_bins{"cfFixedLength_cent_bins", {110, 0., 110.}, "nCentBins, centMin, centMax (only for results histograms)"}; Configurable> cfFixedLength_pt_bins{"cfFixedLength_pt_bins", {1000, 0., 10.}, "nPtBins, ptMin, ptMax (only for results histograms)"}; Configurable> cfFixedLength_eta_bins{"cfFixedLength_eta_bins", {80, -2., 2.}, "nEtaBins, etaMin, etaMax (only for results histograms)"}; - Configurable> cfFixedLength_occu_bins{"cfFixedLength_occu_bins", {600, 0., 60000.}, "nOccuBins, occuMin, occuMax (only for results histograms)"}; + Configurable> cfFixedLength_occu_bins{"cfFixedLength_occu_bins", {200, 0., 60000.}, "nOccuBins, occuMin, occuMax (only for results histograms)"}; Configurable> cfFixedLength_ir_bins{"cfFixedLength_ir_bins", {1000, 0., 100.}, "nirBins, irMin, irMax (only for results histograms)"}; Configurable> cfFixedLength_crd_bins{"cfFixedLength_crd_bins", {1000, 0., 10000.}, "nrdBins, rdMin, rdMax (only for results histograms)"}; @@ -251,10 +252,10 @@ struct : ConfigurableGroup { Configurable> cfVariableLength_mult_bins{"cfVariableLength_mult_bins", {0., 5., 6., 7., 8., 9., 100., 200., 500., 1000., 10000.}, "variable-length multiplicity bins"}; Configurable cfUseVariableLength_cent_bins{"cfUseVariableLength_cent_bins", false, "use or not variable-length centrality bins"}; Configurable> cfVariableLength_cent_bins{"cfVariableLength_cent_bins", {0., 10., 50., 100.}, "variable-length centrality bins"}; - Configurable cfUseVariableLength_pt_bins{"cfUseVariableLength_pt_bins", false, "use or not variable-length pt bins"}; - Configurable> cfVariableLength_pt_bins{"cfVariableLength_pt_bins", {0.20, 0.30, 0.40, 0.65, 1.00, 2.00, 5.00}, "variable-length pt bins"}; - Configurable cfUseVariableLength_eta_bins{"cfUseVariableLength_eta_bins", false, "use or not variable-length eta bins"}; - Configurable> cfVariableLength_eta_bins{"cfVariableLength_eta_bins", {-0.8, 0.0, 0.3, 0.8}, "variable-length eta bins"}; + Configurable cfUseVariableLength_pt_bins{"cfUseVariableLength_pt_bins", true, "use or not variable-length pt bins"}; + Configurable> cfVariableLength_pt_bins{"cfVariableLength_pt_bins", {0.20, 0.25, 0.30, 0.35, 0.40, 0.50, 0.60, 0.80, 1.00, 1.25, 1.50, 1.75, 2.00, 2.50, 3.00, 4.00, 5.00}, "variable-length pt bins"}; + Configurable cfUseVariableLength_eta_bins{"cfUseVariableLength_eta_bins", true, "use or not variable-length eta bins"}; + Configurable> cfVariableLength_eta_bins{"cfVariableLength_eta_bins", {-0.8, -0.6, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.6, 0.8}, "variable-length eta bins"}; Configurable cfUseVariableLength_occu_bins{"cfUseVariableLength_occu_bins", false, "use or not variable-length occupancy bins"}; Configurable> cfVariableLength_occu_bins{"cfVariableLength_occu_bins", {0., 5., 6., 7., 8., 9., 100., 200., 500., 1000., 10000.}, "variable-length occupancy bins"}; Configurable cfUseVariableLength_ir_bins{"cfUseVariableLength_ir_bins", false, "use or not variable-length interaction rate bins"}; diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h index c27345ad515..01cd067855f 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h @@ -62,7 +62,7 @@ struct TaskConfiguration { TStopwatch* fTimer[eTimer_N] = {NULL}; // stopwatch, global (overal execution time) and local Float_t fFloatingPointPrecision = 1.e-6; // two floats are the same if TMath::Abs(f1 - f2) < fFloatingPointPrecision (there is configurable for it) Int_t fSequentialBailout = 0; // if fSequentialBailout > 0, then each fSequentialBailout events the function BailOut() is called. Can be used for real analysis and for IV. - Bool_t fUseSpecificCuts = kFALSE; // apply after DefaultCuts() also hardwired analysis-specific cuts, determined via tc.fWhichSpecificCuts + bool fUseSpecificCuts = kFALSE; // apply after DefaultCuts() also hardwired analysis-specific cuts, determined via tc.fWhichSpecificCuts TString fWhichSpecificCuts = ""; // determine which set of analysis-specific cuts will be applied after DefaultCuts(). Use in combination with tc.fUseSpecificCuts } tc; // "tc" labels an instance of this group of variables. diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h index e622af63e2d..b7a904d1578 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h @@ -118,7 +118,8 @@ enum eEventCuts { // a) Run 3: "kTVXinTRD" (use optionally for systematics, and only in real data) // b) Run 2: "kINT7" (at the moment the usage of this one is enfored in fact) // c) Run 1: TBI 20241209 check if I can use kINT7 also for Run 1 - eSel7, // See def. of sel7 in Ref. b) above. Event selection decision based on V0A & V0C => use only in Run 2 and Run 1. TBI 20240522 I stil need to validate this one over MC + eSel7, // See def. of sel7 in Ref. b) above. Event selection decision based on V0A & V0C => use only in Run 2 and Run 1. + // TBI 20240522 I stil need to validate this one over MC eSel8, // See def. of sel7 in Ref. b) above. Event selection decision based on TVX => use only in Run 3, both for data and MC // *) As of 20240410, kNoITSROFrameBorder (only in MC) and kNoTimeFrameBorder event selection cuts are part of Sel8 // See also email from EK from 2024041 @@ -133,10 +134,12 @@ enum eEventCuts { eIsVertexTRDmatched, // at least one of vertex contributors is matched to TRD eNoCollInTimeRangeStrict, // rejects a collision if there are other events in dtime +/- 10 μs, see IA Slide 39 in https://indico.cern.ch/event/1462154/ eNoCollInTimeRangeStandard, // rejects a collision if there are other events in dtime +/- 2 μs + additional cuts on multiplicity, see IA Slide 39 in https://indico.cern.ch/event/1462154/ - eNoCollInRofStrict, // rejects a collision if there are other events within the same ROF (in-ROF pileup), ROF = "ITS Readout Frames", see IA Slide 39 in https://indico.cern.ch/event/1462154/ + eNoCollInRofStrict, // rejects a collision if there are other events within the same ROF (in-ROF pileup), ROF = "ITS Readout Frames", + // see IA Slide 39 in https://indico.cern.ch/event/1462154/ eNoCollInRofStandard, // same as previous + additional cuts on multiplicity, see IA Slide 39 in https://indico.cern.ch/event/1462154/ eNoHighMultCollInPrevRof, // veto an event if FT0C amplitude in previous ITS ROF is above threshold (default is >5000 a.e. by FT0C), see IA Slide 39 in https://indico.cern.ch/event/1462154/ eOccupancyEstimator, // the default Occupancy estimator, set via configurable. All supported centrality estimators, for QA, etc, are in enum eOccupancyEstimators + eMinVertexDistanceFromIP, // if sqrt(vx^2+vy^2+vz^2) < MinVertexDistanceFromIP, the event is rejected. This way, I remove suspicious events with |vertex| = 0. eEventCuts_N }; diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h index 869acf1d44b..8cd74c814d5 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h @@ -284,6 +284,7 @@ void DefaultConfiguration() ec.fEventCutName[eNoCollInRofStandard] = "NoCollInRofStandard"; ec.fEventCutName[eNoHighMultCollInPrevRof] = "NoHighMultCollInPrevRof"; ec.fEventCutName[eOccupancyEstimator] = "OccupancyEstimator"; + ec.fEventCutName[eMinVertexDistanceFromIP] = "MinVertexDistanceFromIP"; for (Int_t t = 0; t < eEventCuts_N; t++) { if (ec.fEventCutName[t].EqualTo("")) { LOGF(fatal, "\033[1;31m%s at line %d : event cut name is not set for ec.fEventCutName[%d]. The last cut name which was set is \"%s\" \033[0m", __FUNCTION__, __LINE__, t, ec.fEventCutName[t - 1].Data()); @@ -1338,6 +1339,7 @@ void DefaultCuts() ec.fUseEventCuts[eNoCollInRofStandard] = Alright(lUseEventCuts[eNoCollInRofStandard]); ec.fUseEventCuts[eNoHighMultCollInPrevRof] = Alright(lUseEventCuts[eNoHighMultCollInPrevRof]); ec.fUseEventCuts[eOccupancyEstimator] = Alright(lUseEventCuts[eOccupancyEstimator]); + ec.fUseEventCuts[eMinVertexDistanceFromIP] = Alright(lUseEventCuts[eMinVertexDistanceFromIP]); // **) event cuts defined via booleans: ec.fUseEventCuts[eSel7] = ec.fUseEventCuts[eSel7] && cf_ec.cfUseSel7; @@ -1354,70 +1356,75 @@ void DefaultCuts() ec.fUseEventCuts[eNoHighMultCollInPrevRof] = ec.fUseEventCuts[eNoHighMultCollInPrevRof] && cf_ec.cfUseNoHighMultCollInPrevRof; // **) event cuts defined via [min, max): - auto lNumberOfEvents = (vector)cf_ec.cfNumberOfEvents; + // Remark: I use this one also for events cuts set only via min or via max. + // In this case, I set eithe min or max intentionally to some value which never can be met (see below example for "MinVertexDistanceFromIP") + auto lNumberOfEvents = (std::vector)cf_ec.cfNumberOfEvents; ec.fdEventCuts[eNumberOfEvents][eMin] = lNumberOfEvents[eMin]; ec.fdEventCuts[eNumberOfEvents][eMax] = lNumberOfEvents[eMax]; - auto lTotalMultiplicity = (vector)cf_ec.cfTotalMultiplicity; + auto lTotalMultiplicity = (std::vector)cf_ec.cfTotalMultiplicity; ec.fdEventCuts[eTotalMultiplicity][eMin] = lTotalMultiplicity[eMin]; ec.fdEventCuts[eTotalMultiplicity][eMax] = lTotalMultiplicity[eMax]; - auto lMultiplicity = (vector)cf_ec.cfMultiplicity; + auto lMultiplicity = (std::vector)cf_ec.cfMultiplicity; ec.fdEventCuts[eMultiplicity][eMin] = lMultiplicity[eMin]; ec.fdEventCuts[eMultiplicity][eMax] = lMultiplicity[eMax]; - auto lReferenceMultiplicity = (vector)cf_ec.cfReferenceMultiplicity; + auto lReferenceMultiplicity = (std::vector)cf_ec.cfReferenceMultiplicity; ec.fdEventCuts[eReferenceMultiplicity][eMin] = lReferenceMultiplicity[eMin]; ec.fdEventCuts[eReferenceMultiplicity][eMax] = lReferenceMultiplicity[eMax]; - auto lCentrality = (vector)cf_ec.cfCentrality; + auto lCentrality = (std::vector)cf_ec.cfCentrality; ec.fdEventCuts[eCentrality][eMin] = lCentrality[eMin]; ec.fdEventCuts[eCentrality][eMax] = lCentrality[eMax]; - auto lVertex_x = (vector)cf_ec.cfVertex_x; + auto lVertex_x = (std::vector)cf_ec.cfVertex_x; ec.fdEventCuts[eVertex_x][eMin] = lVertex_x[eMin]; ec.fdEventCuts[eVertex_x][eMax] = lVertex_x[eMax]; - auto lVertex_y = (vector)cf_ec.cfVertex_y; + auto lVertex_y = (std::vector)cf_ec.cfVertex_y; ec.fdEventCuts[eVertex_y][eMin] = lVertex_y[eMin]; ec.fdEventCuts[eVertex_y][eMax] = lVertex_y[eMax]; - auto lVertex_z = (vector)cf_ec.cfVertex_z; + auto lVertex_z = (std::vector)cf_ec.cfVertex_z; ec.fdEventCuts[eVertex_z][eMin] = lVertex_z[eMin]; ec.fdEventCuts[eVertex_z][eMax] = lVertex_z[eMax]; - auto lNContributors = (vector)cf_ec.cfNContributors; + auto lNContributors = (std::vector)cf_ec.cfNContributors; ec.fdEventCuts[eNContributors][eMin] = lNContributors[eMin]; ec.fdEventCuts[eNContributors][eMax] = lNContributors[eMax]; - auto lImpactParameter = (vector)cf_ec.cfImpactParameter; + auto lImpactParameter = (std::vector)cf_ec.cfImpactParameter; ec.fdEventCuts[eImpactParameter][eMin] = lImpactParameter[eMin]; ec.fdEventCuts[eImpactParameter][eMax] = lImpactParameter[eMax]; - auto lEventPlaneAngle = (vector)cf_ec.cfEventPlaneAngle; + auto lEventPlaneAngle = (std::vector)cf_ec.cfEventPlaneAngle; ec.fdEventCuts[eEventPlaneAngle][eMin] = lEventPlaneAngle[eMin]; ec.fdEventCuts[eEventPlaneAngle][eMax] = lEventPlaneAngle[eMax]; - auto lOccupancy = (vector)cf_ec.cfOccupancy; + auto lOccupancy = (std::vector)cf_ec.cfOccupancy; ec.fdEventCuts[eOccupancy][eMin] = lOccupancy[eMin]; ec.fdEventCuts[eOccupancy][eMax] = lOccupancy[eMax]; - auto lInteractionRate = (vector)cf_ec.cfInteractionRate; + auto lInteractionRate = (std::vector)cf_ec.cfInteractionRate; ec.fdEventCuts[eInteractionRate][eMin] = lInteractionRate[eMin]; ec.fdEventCuts[eInteractionRate][eMax] = lInteractionRate[eMax]; - auto lCurrentRunDuration = (vector)cf_ec.cfCurrentRunDuration; + auto lCurrentRunDuration = (std::vector)cf_ec.cfCurrentRunDuration; ec.fdEventCuts[eCurrentRunDuration][eMin] = lCurrentRunDuration[eMin]; ec.fdEventCuts[eCurrentRunDuration][eMax] = lCurrentRunDuration[eMax]; - auto lMultMCNParticlesEta08 = (vector)cf_ec.cfMultMCNParticlesEta08; + auto lMultMCNParticlesEta08 = (std::vector)cf_ec.cfMultMCNParticlesEta08; ec.fdEventCuts[eMultMCNParticlesEta08][eMin] = lMultMCNParticlesEta08[eMin]; ec.fdEventCuts[eMultMCNParticlesEta08][eMax] = lMultMCNParticlesEta08[eMax]; - auto lSelectedEvents = (vector)cf_ec.cfSelectedEvents; + auto lSelectedEvents = (std::vector)cf_ec.cfSelectedEvents; ec.fdEventCuts[eSelectedEvents][eMin] = lSelectedEvents[eMin]; ec.fdEventCuts[eSelectedEvents][eMax] = lSelectedEvents[eMax]; + ec.fdEventCuts[eMinVertexDistanceFromIP][eMin] = cf_ec.cfMinVertexDistanceFromIP; // if vertex is closer to IP than this value, the event is rejected + ec.fdEventCuts[eMinVertexDistanceFromIP][eMax] = -1; // // this value is never checked in any case + // **) event cuts defined via string: ec.fsEventCuts[eMultiplicityEstimator] = cf_ec.cfMultiplicityEstimator; ec.fsEventCuts[eReferenceMultiplicityEstimator] = cf_ec.cfReferenceMultiplicityEstimator; @@ -1431,7 +1438,7 @@ void DefaultCuts() // *) Use or do not use a cut enumerated in eParticleHistograms + eParticleCuts. // Default cuts are set in configurable cfUseParticleCuts - auto lUseParticleCuts = (vector)cf_pc.cfUseParticleCuts; + auto lUseParticleCuts = (std::vector)cf_pc.cfUseParticleCuts; if (lUseParticleCuts.size() != eParticleCuts_N) { LOGF(info, "\033[1;31m lUseParticleCuts.size() = %d\033[0m", lUseParticleCuts.size()); LOGF(info, "\033[1;31m eParticleCuts_N = %d\033[0m", static_cast(eParticleCuts_N)); @@ -1481,67 +1488,67 @@ void DefaultCuts() pc.fUseParticleCuts[eisGlobalTrack] = pc.fUseParticleCuts[eisGlobalTrack] && cf_pc.cfisGlobalTrack; // **) particles cuts defined via [min, max): - auto lPhi = (vector)cf_pc.cfPhi; + auto lPhi = (std::vector)cf_pc.cfPhi; pc.fdParticleCuts[ePhi][eMin] = lPhi[eMin]; pc.fdParticleCuts[ePhi][eMax] = lPhi[eMax]; - auto lPt = (vector)cf_pc.cfPt; + auto lPt = (std::vector)cf_pc.cfPt; pc.fdParticleCuts[ePt][eMin] = lPt[eMin]; pc.fdParticleCuts[ePt][eMax] = lPt[eMax]; - auto lEta = (vector)cf_pc.cfEta; + auto lEta = (std::vector)cf_pc.cfEta; pc.fdParticleCuts[eEta][eMin] = lEta[eMin]; pc.fdParticleCuts[eEta][eMax] = lEta[eMax]; - auto lCharge = (vector)cf_pc.cfCharge; + auto lCharge = (std::vector)cf_pc.cfCharge; pc.fdParticleCuts[eCharge][eMin] = lCharge[eMin]; pc.fdParticleCuts[eCharge][eMax] = lCharge[eMax]; - auto ltpcNClsFindable = (vector)cf_pc.cftpcNClsFindable; + auto ltpcNClsFindable = (std::vector)cf_pc.cftpcNClsFindable; pc.fdParticleCuts[etpcNClsFindable][eMin] = ltpcNClsFindable[eMin]; pc.fdParticleCuts[etpcNClsFindable][eMax] = ltpcNClsFindable[eMax]; - auto ltpcNClsShared = (vector)cf_pc.cftpcNClsShared; + auto ltpcNClsShared = (std::vector)cf_pc.cftpcNClsShared; pc.fdParticleCuts[etpcNClsShared][eMin] = ltpcNClsShared[eMin]; pc.fdParticleCuts[etpcNClsShared][eMax] = ltpcNClsShared[eMax]; - auto ltpcNClsFound = (vector)cf_pc.cftpcNClsFound; + auto ltpcNClsFound = (std::vector)cf_pc.cftpcNClsFound; pc.fdParticleCuts[etpcNClsFound][eMin] = ltpcNClsFound[eMin]; pc.fdParticleCuts[etpcNClsFound][eMax] = ltpcNClsFound[eMax]; - auto ltpcNClsCrossedRows = (vector)cf_pc.cftpcNClsCrossedRows; + auto ltpcNClsCrossedRows = (std::vector)cf_pc.cftpcNClsCrossedRows; pc.fdParticleCuts[etpcNClsCrossedRows][eMin] = ltpcNClsCrossedRows[eMin]; pc.fdParticleCuts[etpcNClsCrossedRows][eMax] = ltpcNClsCrossedRows[eMax]; - auto litsNCls = (vector)cf_pc.cfitsNCls; + auto litsNCls = (std::vector)cf_pc.cfitsNCls; pc.fdParticleCuts[eitsNCls][eMin] = litsNCls[eMin]; pc.fdParticleCuts[eitsNCls][eMax] = litsNCls[eMax]; - auto litsNClsInnerBarrel = (vector)cf_pc.cfitsNClsInnerBarrel; + auto litsNClsInnerBarrel = (std::vector)cf_pc.cfitsNClsInnerBarrel; pc.fdParticleCuts[eitsNClsInnerBarrel][eMin] = litsNClsInnerBarrel[eMin]; pc.fdParticleCuts[eitsNClsInnerBarrel][eMax] = litsNClsInnerBarrel[eMax]; - auto ltpcCrossedRowsOverFindableCls = (vector)cf_pc.cftpcCrossedRowsOverFindableCls; + auto ltpcCrossedRowsOverFindableCls = (std::vector)cf_pc.cftpcCrossedRowsOverFindableCls; pc.fdParticleCuts[etpcCrossedRowsOverFindableCls][eMin] = ltpcCrossedRowsOverFindableCls[eMin]; pc.fdParticleCuts[etpcCrossedRowsOverFindableCls][eMax] = ltpcCrossedRowsOverFindableCls[eMax]; - auto ltpcFoundOverFindableCls = (vector)cf_pc.cftpcFoundOverFindableCls; + auto ltpcFoundOverFindableCls = (std::vector)cf_pc.cftpcFoundOverFindableCls; pc.fdParticleCuts[etpcFoundOverFindableCls][eMin] = ltpcFoundOverFindableCls[eMin]; pc.fdParticleCuts[etpcFoundOverFindableCls][eMax] = ltpcFoundOverFindableCls[eMax]; - auto ltpcFractionSharedCls = (vector)cf_pc.cftpcFractionSharedCls; + auto ltpcFractionSharedCls = (std::vector)cf_pc.cftpcFractionSharedCls; pc.fdParticleCuts[etpcFractionSharedCls][eMin] = ltpcFractionSharedCls[eMin]; pc.fdParticleCuts[etpcFractionSharedCls][eMax] = ltpcFractionSharedCls[eMax]; - auto ldcaXY = (vector)cf_pc.cfdcaXY; + auto ldcaXY = (std::vector)cf_pc.cfdcaXY; pc.fdParticleCuts[edcaXY][eMin] = ldcaXY[eMin]; pc.fdParticleCuts[edcaXY][eMax] = ldcaXY[eMax]; - auto ldcaZ = (vector)cf_pc.cfdcaZ; + auto ldcaZ = (std::vector)cf_pc.cfdcaZ; pc.fdParticleCuts[edcaZ][eMin] = ldcaZ[eMin]; pc.fdParticleCuts[edcaZ][eMax] = ldcaZ[eMax]; - auto lPDG = (vector)cf_pc.cfPDG; + auto lPDG = (std::vector)cf_pc.cfPDG; pc.fdParticleCuts[ePDG][eMin] = lPDG[eMin]; pc.fdParticleCuts[ePDG][eMax] = lPDG[eMax]; @@ -1583,13 +1590,37 @@ void SpecificCuts(TString whichSpecificCuts) } // b) Implementation of analysis-specific cuts: - // Remark: Whichever cuts start to repeat below across different case statements, promote them into DefaultCuts(). + // Remark #1: Whichever cuts start to repeat below across different case statements, promote them into DefaultCuts(). + // The idea is to keep here cuts only which are specific for particular analysis, and which are unlikely ever to change for that particular analysis. + // Remark #2: Remember that the values for the cuts hardwired here overwrite the ones set as default values in configurables. + // If you want to reconfigure all cuts below manually via configurables, simply do not call SpecificCuts, i.e. set in JSON "cfUseSpecificCuts": "false" + // Remark #3: Most up-to-date documentation of each cut is in enum file. switch (specificCuts) { + case eLHC23zzh: - ec.fUseEventCuts[eSel8] = kTRUE; // central event selection for Run 3 - ec.fUseEventCuts[eNoCollInTimeRangeStrict] = kTRUE; // IA Slide 39 in https://indico.cern.ch/event/1462154/ - ec.fUseEventCuts[eNoCollInRofStrict] = kTRUE; // IA Slide 39 in https://indico.cern.ch/event/1462154/ - ec.fUseEventCuts[eNoHighMultCollInPrevRof] = kTRUE; // IA Slide 39 in https://indico.cern.ch/event/1462154/ + + // Event cuts: + ec.fUseEventCuts[eSel8] = kTRUE; + ec.fUseEventCuts[eNoSameBunchPileup] = kTRUE; + ec.fUseEventCuts[eIsGoodZvtxFT0vsPV] = kTRUE; + ec.fUseEventCuts[eIsVertexITSTPC] = kTRUE; + ec.fUseEventCuts[eNoCollInTimeRangeStrict] = kTRUE; + ec.fUseEventCuts[eNoCollInRofStrict] = kTRUE; + ec.fUseEventCuts[eNoHighMultCollInPrevRof] = kTRUE; + + // Particle cuts: + pc.fUseParticleCuts[eitsNCls] = kTRUE; + pc.fdParticleCuts[eitsNCls][eMin] = 5.; + pc.fdParticleCuts[eitsNCls][eMax] = 1000.; + + pc.fUseParticleCuts[etpcNClsFound] = kTRUE; + pc.fdParticleCuts[etpcNClsFound][eMin] = 70.; + pc.fdParticleCuts[etpcNClsFound][eMax] = 1000.; + + pc.fUseParticleCuts[etpcNClsCrossedRows] = kTRUE; + pc.fdParticleCuts[etpcNClsCrossedRows][eMin] = 70.; + pc.fdParticleCuts[etpcNClsCrossedRows][eMax] = 1000.; + break; // ... @@ -1799,6 +1830,13 @@ void InsanityChecksBeforeBooking() } // if (ec.fUseEventCuts[eTrigger]) { + // **) Check if the cut on MinVertexDistanceFromIP makes sense: + if (ec.fUseEventCuts[eMinVertexDistanceFromIP]) { + if (!(ec.fdEventCuts[eMinVertexDistanceFromIP][eMin] > 0.)) { + LOGF(fatal, "\033[1;31m%s at line %d : trigger ec.fdEventCuts[eMinVertexDistanceFromIP][eMin] = %f must be positive. Check the setting of configurable cfMinVertexDistanceFromIP\033[0m", __FUNCTION__, __LINE__, ec.fdEventCuts[eMinVertexDistanceFromIP][eMin]); + } + } + // **) Enforce the usage of particular trigger for this dataset: if (tc.fProcess[eProcessRec_Run2]) { // TBI 20240517 for the time being, here I am enforcing that "kINT7" is mandatory for Run 2 @@ -2725,6 +2763,11 @@ void BookEventCutsHistograms() // a) Book the profile holding flags: ec.fEventCutsPro = new TProfile("fEventCutsPro", "flags for event cuts", eEventCuts_N, -0.5, static_cast(eEventCuts_N) - 0.5); + if (tc.fUseSpecificCuts) { + ec.fEventCutsPro->SetTitle(TString::Format("%s (hardwired analysis-specific cuts = %s)", ec.fEventCutsPro->GetTitle(), tc.fWhichSpecificCuts.Data()).Data()); + } else { + ec.fEventCutsPro->SetTitle(TString::Format("%s (hardwired analysis-specific cuts not used)", ec.fEventCutsPro->GetTitle()).Data()); + } ec.fEventCutsPro->SetStats(kFALSE); ec.fEventCutsPro->SetLineColor(eColor); ec.fEventCutsPro->SetFillColor(eFillColor); @@ -2933,6 +2976,11 @@ void BookParticleCutsHistograms() // a) Book the profile holding flags: pc.fParticleCutsPro = new TProfile("fParticleCutsPro", "flags for particle cuts", eParticleCuts_N, -0.5, static_cast(eParticleCuts_N) - 0.5); + if (tc.fUseSpecificCuts) { + pc.fParticleCutsPro->SetTitle(TString::Format("%s (hardwired analysis-specific cuts = %s)", pc.fParticleCutsPro->GetTitle(), tc.fWhichSpecificCuts.Data()).Data()); + } else { + pc.fParticleCutsPro->SetTitle(TString::Format("%s (hardwired analysis-specific cuts not used)", pc.fParticleCutsPro->GetTitle()).Data()); + } pc.fParticleCutsPro->SetStats(kFALSE); pc.fParticleCutsPro->SetLineColor(eColor); pc.fParticleCutsPro->SetFillColor(eFillColor); @@ -4977,6 +5025,17 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) } } + // *) MinVertexDistanceFromIP (minimal vertex distance from nominal Interaction Point). If vertex is closer that this value, this event is rejected: + if (ec.fUseEventCuts[eMinVertexDistanceFromIP]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eMinVertexDistanceFromIP, eCutCounterBinning); + } else if (sqrt(pow(collision.posX(), 2.) + pow(collision.posY(), 2.) + pow(collision.posZ(), 2.)) < ec.fdEventCuts[eMinVertexDistanceFromIP][eMin]) { + if (!EventCut(eRec, eMinVertexDistanceFromIP, cutModus)) { + return kFALSE; + } + } + } + // *) NContributors: if (ec.fUseEventCuts[eNContributors]) { if (cutModus == eCutCounterBinning) { @@ -5080,6 +5139,17 @@ Bool_t EventCuts(T1 const& collision, T2 const& tracks, eCutModus cutModus) } } + // *) MinVertexDistanceFromIP (minimal vertex distance from nominal Interaction Point). If vertex is closer that this value, this event is rejected: + if (ec.fUseEventCuts[eMinVertexDistanceFromIP]) { + if (cutModus == eCutCounterBinning) { + EventCut(eRec, eMinVertexDistanceFromIP, eCutCounterBinning); + } else if (sqrt(pow(collision.posX(), 2.) + pow(collision.posY(), 2.) + pow(collision.posZ(), 2.)) < ec.fdEventCuts[eMinVertexDistanceFromIP][eMin]) { + if (!EventCut(eRec, eMinVertexDistanceFromIP, cutModus)) { + return kFALSE; + } + } + } + // *) Sel8: TBI 20240509 // *) SelectedEvents: => this event cut is implemented directly in Steer(...) @@ -8782,6 +8852,7 @@ TH1D* GetHistogramWithWeights(const char* filePath, const char* runNumber, const } // else { // g) The final touch on histogram with weights: + TString histName = ""; if (-1 == bin) { // Integrated weights: if (!(TString(variable).EqualTo("phi") || TString(variable).EqualTo("pt") || TString(variable).EqualTo("eta"))) { @@ -8789,17 +8860,22 @@ TH1D* GetHistogramWithWeights(const char* filePath, const char* runNumber, const } // fetch histogram directly from this list: - hist = reinterpret_cast(listWithRuns->FindObject(Form("%s_%s", variable, tc.fTaskName.Data()))); + histName = TString::Format("%s_%s", variable, tc.fTaskName.Data()); + LOGF(info, "\033[1;33m%s at line %d : fetching directly hist with name = %s\033[0m", __FUNCTION__, __LINE__, histName.Data()); + hist = reinterpret_cast(listWithRuns->FindObject(histName.Data())); // if the previous search failed, descend recursively also into the nested lists: if (!hist) { - hist = reinterpret_cast(GetObjectFromList(listWithRuns, Form("%s_%s", variable, tc.fTaskName.Data()))); + LOGF(info, "\033[1;33m%s at line %d : previous attempt failed, fetching instead recursively hist with name = %s\033[0m", __FUNCTION__, __LINE__, histName.Data()); + hist = reinterpret_cast(GetObjectFromList(listWithRuns, histName.Data())); } if (!hist) { - hist = reinterpret_cast(GetObjectFromList(listWithRuns, Form("%s", variable))); // yes, for some simple tests I can have only histogram named e.g. 'phi' + histName = TString::Format("%s", variable); // yes, for some simple tests I can have only histogram named e.g. 'phi' + LOGF(info, "\033[1;33m%s at line %d : last attempt, fetching instead hist with trivial name = %s\033[0m", __FUNCTION__, __LINE__, histName.Data()); + hist = reinterpret_cast(GetObjectFromList(listWithRuns, histName.Data())); } if (!hist) { listWithRuns->ls(); - LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); + LOGF(fatal, "\033[1;31m%s at line %d : couldn't fetch hist with name = %s\033[0m", __FUNCTION__, __LINE__, histName.Data()); } hist->SetDirectory(0); hist->SetTitle(Form("%s, %s", filePath, runNumber)); // I have to do it here, because only here I have "filePath" av @@ -8810,18 +8886,22 @@ TH1D* GetHistogramWithWeights(const char* filePath, const char* runNumber, const LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); } // fetch histogram directly from this list: - hist = reinterpret_cast(listWithRuns->FindObject(Form("%s[%d]_%s", variable, bin, tc.fTaskName.Data()))); + histName = TString::Format("%s[%d]_%s", variable, bin, tc.fTaskName.Data()); + LOGF(info, "\033[1;33m%s at line %d : fetching directly hist with name = %s\033[0m", __FUNCTION__, __LINE__, histName.Data()); + hist = reinterpret_cast(listWithRuns->FindObject(histName.Data())); // if the previous search failed, descend recursively also into the nested lists: if (!hist) { + LOGF(info, "\033[1;33m%s at line %d : previous attempt failed, fetching instead recursively hist with name = %s\033[0m", __FUNCTION__, __LINE__, histName.Data()); hist = reinterpret_cast(GetObjectFromList(listWithRuns, Form("%s[%d]_%s", variable, bin, tc.fTaskName.Data()))); } if (!hist) { - hist = reinterpret_cast(GetObjectFromList(listWithRuns, Form("%s[%d]", variable, bin))); // yes, for some simple tests I can have only histogram named e.g. 'phipt[0]' + histName = TString::Format("%s[%d]", variable, bin); // yes, for some simple tests I can have only histogram named e.g. 'phipt[0]' + LOGF(info, "\033[1;33m%s at line %d : last attempt, fetching instead hist with trivial name = %s\033[0m", __FUNCTION__, __LINE__, histName.Data()); + hist = reinterpret_cast(GetObjectFromList(listWithRuns, histName.Data())); } if (!hist) { - LOGF(info, "\033[1;31m Form(\"%%s[%%d]\", variable, bin) = %s\033[0m", Form("%s[%d]", variable, bin)); listWithRuns->ls(); - LOGF(fatal, "\033[1;31m%s at line %d\033[0m", __FUNCTION__, __LINE__); + LOGF(fatal, "\033[1;31m%s at line %d : couldn't fetch hist with name = %s\033[0m", __FUNCTION__, __LINE__, histName.Data()); } // *) insanity check for differential weights => check if boundaries of current bin are the same as bin boundaries for which these weights were calculated. @@ -9051,6 +9131,9 @@ TH1D* GetHistogramWithCentralityWeights(const char* filePath, const char* runNum } // else { // g) The final touch on histogram with centrality weights: + + // TBI 20241211 unify code below with how I implemented below for particle weights + // fetch histogram directly from this list: hist = reinterpret_cast(listWithRuns->FindObject(Form("%s_%s", ec.fsEventCuts[eCentralityEstimator].Data(), tc.fTaskName.Data()))); // if the previous search failed, descend recursively also into the nested lists: From 45ca908228c7833e3db28ed74dad0f564de88819 Mon Sep 17 00:00:00 2001 From: Marian Ivanov Date: Thu, 12 Dec 2024 16:22:53 +0100 Subject: [PATCH 361/459] [Common] Fix the bug -PR8901 (#8961) Co-authored-by: miranov25 --- Common/TableProducer/Converters/trackQA002Converter.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/TableProducer/Converters/trackQA002Converter.cxx b/Common/TableProducer/Converters/trackQA002Converter.cxx index 3e1bc82dbaf..566c998e1bc 100644 --- a/Common/TableProducer/Converters/trackQA002Converter.cxx +++ b/Common/TableProducer/Converters/trackQA002Converter.cxx @@ -20,7 +20,7 @@ using namespace o2::framework; struct TrackQAConverter002 { Produces tracksQA_002; - void process000(aod::TracksQA_000 const& tracksQA_002) + void process000(aod::TracksQA_000 const& tracksQA_000) { for (const auto& trackQA : tracksQA_000) { tracksQA_002( @@ -54,7 +54,7 @@ struct TrackQAConverter002 { } PROCESS_SWITCH(TrackQAConverter002, process000, "process v000-to-v002 conversion", false); - void process001(aod::TracksQA_001 const& tracksQA_002) + void process001(aod::TracksQA_001 const& tracksQA_001) { for (const auto& trackQA : tracksQA_001) { tracksQA_002( From f9f09a3c244dcbd76936ef413e41e8ce7edc96aa Mon Sep 17 00:00:00 2001 From: eloviyo <38348689+Eloviyo@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:36:40 +0100 Subject: [PATCH 362/459] [PWGCF] FemtoUniverse cascade task -- added process functions for cascade - cascade correlation (#8934) Co-authored-by: Shirajum Monira --- .../Core/FemtoUniverseCascadeSelection.h | 203 ++++++----- .../Core/FemtoUniverseParticleHisto.h | 45 ++- ...toUniversePairTaskTrackCascadeExtended.cxx | 325 ++++++++++++------ 3 files changed, 352 insertions(+), 221 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h index 83e9a59d9c1..972305765c5 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file femtoUniverseCascadeSelection.h +/// \file FemtoUniverseCascadeSelection.h /// \brief Definition of the femtoUniverseCascadeSelection /// \author Valentina Mantovani Sarti, TU München valentina.mantovani-sarti@tum.de /// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de @@ -21,12 +21,9 @@ #ifndef PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSECASCADESELECTION_H_ #define PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSECASCADESELECTION_H_ -#include #include #include -#include // FIXME - #include "PWGCF/FemtoUniverse/Core/FemtoUniverseObjectSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" @@ -35,11 +32,9 @@ #include "Framework/HistogramRegistry.h" #include "ReconstructionDataFormats/PID.h" -using namespace o2::framework; - -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femtoUniverse // o2-linter: disable=name/namespace { -namespace femtoUniverseCascadeSelection +namespace femtoUniverseCascadeSelection // o2-linter: disable=name/namespace { /// The different selections this task is capable of doing enum CascadeSel { @@ -88,7 +83,7 @@ class FemtoUniverseCascadeSelection public: FemtoUniverseCascadeSelection() - : nPtCascadeMinSel(0), nPtCascadeMaxSel(0), nEtaCascadeMaxSel(0), nDCAV0DaughMax(0), nCPAV0Min(0), nTranRadV0Min(0), nTranRadV0Max(0), nV0DecVtxMax(0), nDCACascadeDaughMax(0), nCPACascadeMin(0), nTranRadCascadeMin(0), nTranRadCascadeMax(0), nDecVtxMax(0), nDCAPosToPV(0), nDCANegToPV(0), nDCABachToPV(0), nDCAV0ToPV(0), pTCascadeMin(9999999.), pTCascadeMax(-9999999.), etaCascadeMax(-9999999.), DCAV0DaughMax(-9999999.), CPAV0Min(9999999.), TranRadV0Min(9999999.), TranRadV0Max(-9999999.), V0DecVtxMax(-9999999.), DCACascadeDaughMax(-9999999.), CPACascadeMin(9999999.), TranRadCascadeMin(9999999.), TranRadCascadeMax(-9999999.), DecVtxMax(-9999999.), DCAPosToPV(9999999.), DCANegToPV(9999999.), DCABachToPV(9999999.), DCAV0ToPV(9999999.), fV0InvMassLowLimit(1.05), fV0InvMassUpLimit(1.3), fInvMassLowLimit(1.25), fInvMassUpLimit(1.4), fRejectCompetingMass(false), fInvMassCompetingLowLimit(1.5), fInvMassCompetingUpLimit(2.0), isCascOmega(false) /*, nSigmaPIDOffsetTPC(0.)*/ + : nPtCascadeMinSel(0), nPtCascadeMaxSel(0), nEtaCascadeMaxSel(0), nDCAV0DaughMax(0), nCPAV0Min(0), nTranRadV0Min(0), nTranRadV0Max(0), nV0DecVtxMax(0), nDCACascadeDaughMax(0), nCPACascadeMin(0), nTranRadCascadeMin(0), nTranRadCascadeMax(0), nDecVtxMax(0), nDCAPosToPV(0), nDCANegToPV(0), nDCABachToPV(0), nDCAV0ToPV(0), pTCascadeMin(9999999.), pTCascadeMax(-9999999.), etaCascadeMax(-9999999.), fDCAV0DaughMax(-9999999.), fCPAV0Min(9999999.), fTranRadV0Min(9999999.), fTranRadV0Max(-9999999.), fV0DecVtxMax(-9999999.), fDCACascadeDaughMax(-9999999.), fCPACascadeMin(9999999.), fTranRadCascadeMin(9999999.), fTranRadCascadeMax(-9999999.), fDecVtxMax(-9999999.), fDCAPosToPV(9999999.), fDCANegToPV(9999999.), fDCABachToPV(9999999.), fDCAV0ToPV(9999999.), fV0InvMassLowLimit(1.05), fV0InvMassUpLimit(1.3), fInvMassLowLimit(1.25), fInvMassUpLimit(1.4), fRejectCompetingMass(false), fInvMassCompetingLowLimit(1.5), fInvMassCompetingUpLimit(2.0), isCascOmega(false) /*, nSigmaPIDOffsetTPC(0.)*/ { } @@ -110,11 +105,11 @@ class FemtoUniverseCascadeSelection T2 selVar, femtoUniverseSelection::SelectionType selType) { if (child == femtoUniverseCascadeSelection::kPosTrack) { - PosDaughTrack.setSelection(selVal, selVar, selType); + posDaughTrack.setSelection(selVal, selVar, selType); } else if (child == femtoUniverseCascadeSelection::kNegTrack) { - NegDaughTrack.setSelection(selVal, selVar, selType); + negDaughTrack.setSelection(selVal, selVar, selType); } else if (child == femtoUniverseCascadeSelection::kBachTrack) { - BachTrack.setSelection(selVal, selVar, selType); + bachTrackSel.setSelection(selVal, selVar, selType); } } @@ -123,11 +118,11 @@ class FemtoUniverseCascadeSelection T& pids) { if (child == femtoUniverseCascadeSelection::kPosTrack) { - PosDaughTrack.setPIDSpecies(pids); + posDaughTrack.setPIDSpecies(pids); } else if (child == femtoUniverseCascadeSelection::kNegTrack) { - NegDaughTrack.setPIDSpecies(pids); + negDaughTrack.setPIDSpecies(pids); } else if (child == femtoUniverseCascadeSelection::kBachTrack) { - BachTrack.setPIDSpecies(pids); + bachTrackSel.setPIDSpecies(pids); } } @@ -140,7 +135,7 @@ class FemtoUniverseCascadeSelection std::string_view suffix = "") { std::string outString = static_cast(prefix); - outString += static_cast(mSelectionNames[iSel]); + outString += static_cast(SelectionNames[iSel]); outString += suffix; return outString; } @@ -153,7 +148,7 @@ class FemtoUniverseCascadeSelection std::string_view prefix = "") { std::string outString = static_cast(prefix); - outString += static_cast(mSelectionHelper[iSel]); + outString += static_cast(SelectionHelper[iSel]); return outString; } @@ -197,20 +192,20 @@ class FemtoUniverseCascadeSelection float pTCascadeMin; float pTCascadeMax; float etaCascadeMax; - float DCAV0DaughMax; - float CPAV0Min; - float TranRadV0Min; - float TranRadV0Max; - float V0DecVtxMax; - float DCACascadeDaughMax; - float CPACascadeMin; - float TranRadCascadeMin; - float TranRadCascadeMax; - float DecVtxMax; - float DCAPosToPV; - float DCANegToPV; - float DCABachToPV; - float DCAV0ToPV; + float fDCAV0DaughMax; + float fCPAV0Min; + float fTranRadV0Min; + float fTranRadV0Max; + float fV0DecVtxMax; + float fDCACascadeDaughMax; + float fCPACascadeMin; + float fTranRadCascadeMin; + float fTranRadCascadeMax; + float fDecVtxMax; + float fDCAPosToPV; + float fDCANegToPV; + float fDCABachToPV; + float fDCAV0ToPV; float fV0InvMassLowLimit; float fV0InvMassUpLimit; @@ -226,13 +221,13 @@ class FemtoUniverseCascadeSelection // float nSigmaPIDOffsetTPC; - FemtoUniverseTrackSelection PosDaughTrack; - FemtoUniverseTrackSelection NegDaughTrack; - FemtoUniverseTrackSelection BachTrack; + FemtoUniverseTrackSelection posDaughTrack; + FemtoUniverseTrackSelection negDaughTrack; + FemtoUniverseTrackSelection bachTrackSel; static constexpr int kNcascadeSelection = 20; // can I do less ? - static constexpr std::string_view mSelectionNames[kNcascadeSelection] = { + static constexpr std::string_view SelectionNames[kNcascadeSelection] = { "Sign", "PtMin", "PtMax", "EtaMax", "DCAv0daughMax", "v0CPAMin", "v0TranRadMin", "v0TranRadMax", "v0DecVecMax", "DCAcascDaugh", "CPAMin", "TranRadMin", "TranRadMax", "DecVtxMax", @@ -265,7 +260,7 @@ class FemtoUniverseCascadeSelection }; ///< Map to match a variable with ///< its type - static constexpr std::string_view mSelectionHelper[kNcascadeSelection] = { + static constexpr std::string_view SelectionHelper[kNcascadeSelection] = { "Cascade particle sign (+1 or -1)", "Minimum pT (GeV/c)", "Maximum pT (GeV/c)", @@ -300,14 +295,14 @@ void FemtoUniverseCascadeSelection::init(HistogramRegistry* registry, bool isSel fillSelectionHistogram(); // pos, neg fillSelectionHistogram(); // bach - AxisSpec massAxisCascade = {2200, 1.25f, 1.8f, "m_{#Cascade} (GeV/#it{c}^{2})"}; - AxisSpec massAxisV0 = {600, 0.0f, 3.0f, "m_{#V0} (GeV/#it{c}^{2})"}; - AxisSpec DCADaughAxis = {1000, 0.0f, 2.0f, "DCA (cm)"}; - AxisSpec DCAToPVAxis = {1000, -10.0f, 10.0f, "DCA to PV (cm)"}; + AxisSpec massAxisCascade = {2200, 1.25f, 1.8f, "m_{Cascade} (GeV/#it{c}^{2})"}; + AxisSpec massAxisV0 = {600, 0.0f, 3.0f, "m_{V0} (GeV/#it{c}^{2})"}; + AxisSpec aDCADaughAxis = {1000, 0.0f, 2.0f, "DCA (cm)"}; + AxisSpec aDCAToPVAxis = {1000, -10.0f, 10.0f, "DCA to PV (cm)"}; AxisSpec ptAxis = {100, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec etaAxis = {100, -2.0f, 2.0f, "#it{#eta}"}; AxisSpec phiAxis = {100, 0.0f, 6.0f, "#it{#phi}"}; - AxisSpec CPAAxis = {1000, 0.95f, 1.0f, "#it{cos #theta_{p}}"}; + AxisSpec aCPAAxis = {1000, 0.95f, 1.0f, "#it{cos #theta_{p}}"}; AxisSpec tranRadAxis = {1000, 0.0f, 100.0f, "#it{r}_{xy} (cm)"}; /// \todo this should be an automatic check in the parent class, and the @@ -318,24 +313,24 @@ void FemtoUniverseCascadeSelection::init(HistogramRegistry* registry, bool isSel "container - quitting!"; } - PosDaughTrack.init( mHistogramRegistry); - NegDaughTrack.init( mHistogramRegistry); - BachTrack.init( + bachTrackSel.init( mHistogramRegistry); // V0 (Lambda) // mHistogramRegistry->add("CascadeQA/hInvMassV0NoCuts", "No cuts", kTH1F, {massAxisV0}); mHistogramRegistry->add("CascadeQA/hInvMassV0Cut", "Invariant mass cut", kTH1F, {massAxisV0}); - mHistogramRegistry->add("CascadeQA/hDCAV0Daugh", "V0-daughters DCA", kTH1F, {DCADaughAxis}); - mHistogramRegistry->add("CascadeQA/hV0CPA", "V0 cos PA", kTH1F, {CPAAxis}); + mHistogramRegistry->add("CascadeQA/hDCAV0Daugh", "V0-daughters DCA", kTH1F, {aDCADaughAxis}); + mHistogramRegistry->add("CascadeQA/hV0CPA", "V0 cos PA", kTH1F, {aCPAAxis}); mHistogramRegistry->add("CascadeQA/hV0TranRad", "V0 transverse radius", kTH1F, {tranRadAxis}); // mHistogramRegistry->add("CascadeQA/hV0DecVtxMax", "V0 maximum distance on decay vertex", kTH1F, {massAxisV0}); @@ -345,13 +340,13 @@ void FemtoUniverseCascadeSelection::init(HistogramRegistry* registry, bool isSel mHistogramRegistry->add("CascadeQA/hCascadePt", "pT distribution", kTH1F, {ptAxis}); mHistogramRegistry->add("CascadeQA/hCascadeEta", "Eta distribution", kTH1F, {etaAxis}); mHistogramRegistry->add("CascadeQA/hCascadePhi", "Phi distribution", kTH1F, {phiAxis}); - mHistogramRegistry->add("CascadeQA/hDCACascadeDaugh", "Cascade-daughters DCA", kTH1F, {DCADaughAxis}); - mHistogramRegistry->add("CascadeQA/hCascadeCPA", "Cos PA", kTH1F, {CPAAxis}); + mHistogramRegistry->add("CascadeQA/hDCACascadeDaugh", "Cascade-daughters DCA", kTH1F, {aDCADaughAxis}); + mHistogramRegistry->add("CascadeQA/hCascadeCPA", "Cos PA", kTH1F, {aCPAAxis}); mHistogramRegistry->add("CascadeQA/hCascadeTranRad", "Transverse radius", kTH1F, {tranRadAxis}); - mHistogramRegistry->add("CascadeQA/hDCAPosToPV", "Pos V0 daughter DCA to primary vertex", kTH1F, {DCAToPVAxis}); - mHistogramRegistry->add("CascadeQA/hDCANegToPV", "Neg V0 daughter DCA to primary vertex", kTH1F, {DCAToPVAxis}); - mHistogramRegistry->add("CascadeQA/hDCABachToPV", "Bachelor DCA to primary vertex", kTH1F, {DCAToPVAxis}); - mHistogramRegistry->add("CascadeQA/hDCAV0ToPV", "V0 DCA to primary vertex", kTH1F, {DCAToPVAxis}); + mHistogramRegistry->add("CascadeQA/hDCAPosToPV", "Pos V0 daughter DCA to primary vertex", kTH1F, {aDCAToPVAxis}); + mHistogramRegistry->add("CascadeQA/hDCANegToPV", "Neg V0 daughter DCA to primary vertex", kTH1F, {aDCAToPVAxis}); + mHistogramRegistry->add("CascadeQA/hDCABachToPV", "Bachelor DCA to primary vertex", kTH1F, {aDCAToPVAxis}); + mHistogramRegistry->add("CascadeQA/hDCAV0ToPV", "V0 DCA to primary vertex", kTH1F, {aDCAToPVAxis}); } /// check whether the most open cuts are fulfilled - most of this should have @@ -381,34 +376,34 @@ void FemtoUniverseCascadeSelection::init(HistogramRegistry* registry, bool isSel femtoUniverseSelection::kUpperLimit); etaCascadeMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeetaMax, femtoUniverseSelection::kAbsUpperLimit); - DCAV0DaughMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0DCADaughMax, + fDCAV0DaughMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0DCADaughMax, + femtoUniverseSelection::kUpperLimit); + fCPAV0Min = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0CPAMin, + femtoUniverseSelection::kLowerLimit); + fTranRadV0Min = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0TranRadMin, + femtoUniverseSelection::kLowerLimit); + fTranRadV0Max = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0TranRadMax, femtoUniverseSelection::kUpperLimit); - CPAV0Min = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0CPAMin, - femtoUniverseSelection::kLowerLimit); - TranRadV0Min = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0TranRadMin, - femtoUniverseSelection::kLowerLimit); - TranRadV0Max = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0TranRadMax, - femtoUniverseSelection::kUpperLimit); - V0DecVtxMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0DecVtxMax, - femtoUniverseSelection::kAbsUpperLimit); - DCACascadeDaughMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCADaughMax, + fV0DecVtxMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0DecVtxMax, + femtoUniverseSelection::kAbsUpperLimit); + fDCACascadeDaughMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCADaughMax, + femtoUniverseSelection::kUpperLimit); + fCPACascadeMin = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeCPAMin, + femtoUniverseSelection::kLowerLimit); + fTranRadCascadeMin = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeTranRadMin, + femtoUniverseSelection::kLowerLimit); + fTranRadCascadeMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeTranRadMax, femtoUniverseSelection::kUpperLimit); - CPACascadeMin = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeCPAMin, - femtoUniverseSelection::kLowerLimit); - TranRadCascadeMin = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeTranRadMin, - femtoUniverseSelection::kLowerLimit); - TranRadCascadeMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeTranRadMax, - femtoUniverseSelection::kUpperLimit); - DecVtxMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDecVtxMax, - femtoUniverseSelection::kAbsUpperLimit); - DCAPosToPV = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCAPosToPV, - femtoUniverseSelection::kLowerLimit); - DCANegToPV = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCANegToPV, - femtoUniverseSelection::kLowerLimit); - DCABachToPV = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCABachToPV, + fDecVtxMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDecVtxMax, + femtoUniverseSelection::kAbsUpperLimit); + fDCAPosToPV = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCAPosToPV, femtoUniverseSelection::kLowerLimit); - DCAV0ToPV = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCAV0ToPV, - femtoUniverseSelection::kLowerLimit); + fDCANegToPV = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCANegToPV, + femtoUniverseSelection::kLowerLimit); + fDCABachToPV = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCABachToPV, + femtoUniverseSelection::kLowerLimit); + fDCAV0ToPV = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCAV0ToPV, + femtoUniverseSelection::kLowerLimit); fV0InvMassLowLimit = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0MassMin, femtoUniverseSelection::kLowerLimit); fV0InvMassUpLimit = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0MassMax, @@ -458,70 +453,70 @@ bool FemtoUniverseCascadeSelection::isSelectedMinimal(Col const& col, Casc const if (nEtaCascadeMaxSel > 0 && std::abs(cascade.eta()) > etaCascadeMax) { return false; } - if (nDCAV0DaughMax > 0 && cascade.dcaV0daughters() > DCAV0DaughMax) { + if (nDCAV0DaughMax > 0 && cascade.dcaV0daughters() > fDCAV0DaughMax) { return false; } - if (nCPAV0Min > 0 && cpav0 < CPAV0Min) { + if (nCPAV0Min > 0 && cpav0 < fCPAV0Min) { return false; } - if (nTranRadV0Min > 0 && cascade.v0radius() < TranRadV0Min) { + if (nTranRadV0Min > 0 && cascade.v0radius() < fTranRadV0Min) { return false; } - if (nTranRadV0Max > 0 && cascade.v0radius() > TranRadV0Max) { + if (nTranRadV0Max > 0 && cascade.v0radius() > fTranRadV0Max) { return false; } - if (nDCACascadeDaughMax > 0 && cascade.dcacascdaughters() > DCACascadeDaughMax) { + if (nDCACascadeDaughMax > 0 && cascade.dcacascdaughters() > fDCACascadeDaughMax) { return false; } - if (nCPACascadeMin > 0 && cpaCasc < CPACascadeMin) { + if (nCPACascadeMin > 0 && cpaCasc < fCPACascadeMin) { return false; } - if (nTranRadCascadeMin > 0 && cascade.cascradius() < TranRadCascadeMin) { + if (nTranRadCascadeMin > 0 && cascade.cascradius() < fTranRadCascadeMin) { return false; } - if (nTranRadCascadeMax > 0 && cascade.cascradius() > TranRadCascadeMax) { + if (nTranRadCascadeMax > 0 && cascade.cascradius() > fTranRadCascadeMax) { return false; } for (size_t i = 0; i < decVtx.size(); i++) { - if (nDecVtxMax > 0 && decVtx.at(i) > DecVtxMax) { + if (nDecVtxMax > 0 && decVtx.at(i) > fDecVtxMax) { return false; } } - if (nDCAPosToPV > 0 && abs(cascade.dcapostopv()) < DCAPosToPV) { + if (nDCAPosToPV > 0 && std::abs(cascade.dcapostopv()) < fDCAPosToPV) { return false; } - if (nDCANegToPV > 0 && abs(cascade.dcanegtopv()) < DCANegToPV) { + if (nDCANegToPV > 0 && std::abs(cascade.dcanegtopv()) < fDCANegToPV) { return false; } - if (nDCABachToPV > 0 && abs(cascade.dcabachtopv()) < DCABachToPV) { + if (nDCABachToPV > 0 && std::abs(cascade.dcabachtopv()) < fDCABachToPV) { return false; } - if (nDCAV0ToPV > 0 && abs(dcav0topv) < DCAV0ToPV) { + if (nDCAV0ToPV > 0 && std::abs(dcav0topv) < fDCAV0ToPV) { return false; } - if (!PosDaughTrack.isSelectedMinimal(posTrack)) { + if (!posDaughTrack.isSelectedMinimal(posTrack)) { return false; } - if (!NegDaughTrack.isSelectedMinimal(negTrack)) { + if (!negDaughTrack.isSelectedMinimal(negTrack)) { return false; } - if (!BachTrack.isSelectedMinimal(bachTrack)) { + if (!bachTrackSel.isSelectedMinimal(bachTrack)) { return false; } /* // check that track combinations for V0 or antiV0 would be fulfilling PID - float nSigmaPIDMax = PosDaughTrack.getSigmaPIDMax(); + float nSigmaPIDMax = posDaughTrack.getSigmaPIDMax(); // antiV0 auto nSigmaPrNeg = negTrack.tpcNSigmaPr(); auto nSigmaPiPos = posTrack.tpcNSigmaPi(); // v0 auto nSigmaPiNeg = negTrack.tpcNSigmaPi(); auto nSigmaPrPos = posTrack.tpcNSigmaPr(); - if (!(abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && - abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax) && - !(abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && - abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax)) { + if (!(std::abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && + std::abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax) && + !(std::abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && + std::abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax)) { return false; } */ @@ -578,12 +573,12 @@ void FemtoUniverseCascadeSelection::fillCascadeQA(Col const& col, Casc const& ca template void FemtoUniverseCascadeSelection::fillQA(Col const& /*col*/, Casc const& /*cascade*/, Track const& posTrack, Track const& negTrack, Track const& bachTrack) { - PosDaughTrack.fillQA(posTrack); - NegDaughTrack.fillQA(negTrack); - BachTrack.fillQA(bachTrack); + bachTrackSel.fillQA(bachTrack); } } // namespace o2::analysis::femtoUniverse diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h index 50827d8b243..81572be5cbb 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h @@ -24,10 +24,11 @@ #include #include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" #include "Framework/HistogramRegistry.h" +#include "CommonConstants/MathConstants.h" -using namespace o2::framework; +using namespace o2::framework; // o2-linter: disable=using-directive -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femtoUniverse // o2-linter: disable=name/namespace { /// \class FemtoUniverseParticleHisto @@ -50,14 +51,14 @@ class FemtoUniverseParticleHisto /// \param tempFitVarpTAxis axis object for the pT axis in the pT vs. tempFitVar plots /// \param tempFitVarAxis axis object for the tempFitVar axis template - void init_base(std::string folderName, std::string tempFitVarAxisTitle, T& tempFitVarpTAxis, T& tempFitVarAxis) + void init_base(std::string folderName, std::string tempFitVarAxisTitle, T& tempFitVarpTAxis, T& tempFitVarAxis) // o2-linter: disable=name/function-variable { std::string folderSuffix = static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[mc]).c_str(); /// Histograms of the kinematic properties mHistogramRegistry->add((folderName + folderSuffix + "/hPt").c_str(), "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, {{240, 0, 6}}); mHistogramRegistry->add((folderName + folderSuffix + "/hEta").c_str(), "; #eta; Entries", kTH1F, {{200, -1.5, 1.5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/hPhi").c_str(), "; #phi; Entries", kTH1F, {{200, 0, 2. * M_PI}}); - mHistogramRegistry->add((folderName + folderSuffix + "/hPhiEta").c_str(), "; #phi; #eta", kTH2F, {{200, 0, 2. * M_PI}, {200, -1.5, 1.5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/hPhi").c_str(), "; #phi; Entries", kTH1F, {{200, 0, o2::constants::math::TwoPI}}); + mHistogramRegistry->add((folderName + folderSuffix + "/hPhiEta").c_str(), "; #phi; #eta", kTH2F, {{200, 0, o2::constants::math::TwoPI}, {200, -1.5, 1.5}}); /// particle specific histogramms for the TempFitVar column in FemtoUniverseParticles if constexpr (o2::aod::femtouniverseMCparticle::MCType::kRecon == mc) { @@ -67,7 +68,7 @@ class FemtoUniverseParticleHisto // comment template - void init_debug(std::string folderName) + void init_debug(std::string folderName) // o2-linter: disable=name/function-variable { std::string folderSuffix = static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[mc]).c_str(); if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kTrack || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0Child || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascadeBachelor || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) { @@ -107,6 +108,14 @@ class FemtoUniverseParticleHisto mHistogramRegistry->add((folderName + folderSuffix + "/hInvMassLambda").c_str(), "; M_{#Lambda}; Entries", kTH1F, {{2000, 1.f, 3.f}}); mHistogramRegistry->add((folderName + folderSuffix + "/hInvMassAntiLambda").c_str(), "; M_{#bar{#Lambda}}; Entries", kTH1F, {{2000, 1.f, 3.f}}); mHistogramRegistry->add((folderName + folderSuffix + "/hInvMassLambdaAntiLambda").c_str(), "; M_{#Lambda}; M_{#bar{#Lambda}}", kTH2F, {{2000, 1.f, 3.f}, {2000, 1.f, 3.f}}); + } else if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascade) { + mHistogramRegistry->add((folderName + folderSuffix + "/hDaughDCA").c_str(), "; DCA^{daugh} (cm); Entries", kTH1F, {{1000, 0, 10}}); + mHistogramRegistry->add((folderName + folderSuffix + "/hTransRadius").c_str(), "; #it{r}_{xy} (cm); Entries", kTH1F, {{1500, 0, 150}}); + mHistogramRegistry->add((folderName + folderSuffix + "/hDecayVtxX").c_str(), "; #it{Vtx}_{x} (cm); Entries", kTH1F, {{2000, 0, 200}}); + mHistogramRegistry->add((folderName + folderSuffix + "/hDecayVtxY").c_str(), "; #it{Vtx}_{y} (cm)); Entries", kTH1F, {{2000, 0, 200}}); + mHistogramRegistry->add((folderName + folderSuffix + "/hDecayVtxZ").c_str(), "; #it{Vtx}_{z} (cm); Entries", kTH1F, {{2000, 0, 200}}); + mHistogramRegistry->add((folderName + folderSuffix + "/hInvMassCascade").c_str(), "; M_{Cascade}; Entries", kTH1F, {{2000, 1.f, 1.8f}}); + mHistogramRegistry->add((folderName + folderSuffix + "/hInvMassAntiCascade").c_str(), "; M_{AntiCascade}; Entries", kTH1F, {{2000, 1.f, 1.8f}}); } } @@ -118,7 +127,7 @@ class FemtoUniverseParticleHisto /// \param tempFitVarpTAxis axis object for the pT axis in the pT vs. tempFitVar plots /// \param tempFitVarAxis axis object for the tempFitVar axis template - void init_MC(std::string folderName, std::string /*tempFitVarAxisTitle*/, T& tempFitVarpTAxis, T& tempFitVarAxis) + void init_MC(std::string folderName, std::string /*tempFitVarAxisTitle*/, T& tempFitVarpTAxis, T& tempFitVarAxis) // o2-linter: disable=name/function-variable { /// Particle-type specific histograms std::string folderSuffix = static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]).c_str(); @@ -213,7 +222,7 @@ class FemtoUniverseParticleHisto /// \tparam T Data type of the particle /// \param part Particle template - void fillQA_base(T const& part, H const& histFolder) + void fillQA_base(T const& part, H const& histFolder) // o2-linter: disable=name/function-variable { /// Histograms of the kinematic properties mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hPt"), part.pt()); @@ -228,7 +237,7 @@ class FemtoUniverseParticleHisto } template - void fillQA_debug(T const& part, H const& histFolder) + void fillQA_debug(T const& part, H const& histFolder) // o2-linter: disable=name/function-variable { // Histograms holding further debug information if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kTrack || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0Child || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascadeBachelor || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) { @@ -268,6 +277,14 @@ class FemtoUniverseParticleHisto mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hInvMassLambda"), part.mLambda()); mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hInvMassAntiLambda"), part.mAntiLambda()); mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hInvMassLambdaAntiLambda"), part.mLambda(), part.mAntiLambda()); + } else if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascade) { + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDaughDCA"), part.daughDCA()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hTransRadius"), part.transRadius()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDecayVtxX"), part.decayVtxX()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDecayVtxY"), part.decayVtxY()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDecayVtxZ"), part.decayVtxZ()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hInvMassCascade"), part.mLambda()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hInvMassAntiCascade"), part.mAntiLambda()); } } @@ -279,13 +296,13 @@ class FemtoUniverseParticleHisto /// \param mctruthorigin Origin of the associated mc Truth particle /// \param pdgcode PDG of the associated mc Truth particle associated to the reconstructed particle part template - void fillQA_MC(T const& part, int mctruthorigin, int pdgcode, H const& histFolder) + void fillQA_MC(T const& part, int mctruthorigin, int pdgcode, H const& histFolder) // o2-linter: disable=name/function-variable { if (mHistogramRegistry) { mHistogramRegistry->fill(histFolder + HIST("_MC/hPDG"), pdgcode); mHistogramRegistry->fill(histFolder + HIST("_MC/hOrigin_MC"), mctruthorigin); - if (abs(pdgcode) == mPDG) { // fill this histogramm only for TRUE protons (independently of their origin) for the track purity estimation + if (std::abs(pdgcode) == mPDG) { // fill this histogramm only for TRUE protons (independently of their origin) for the track purity estimation mHistogramRegistry->fill(histFolder + HIST("_MC/hPt_ReconNoFake"), part.pt()); } @@ -367,9 +384,9 @@ class FemtoUniverseParticleHisto private: HistogramRegistry* mHistogramRegistry; ///< For QA output - static constexpr o2::aod::femtouniverseparticle::ParticleType mParticleType = particleType; ///< Type of the particle under analysis - static constexpr int mFolderSuffixType = suffixType; ///< Counter for the folder suffix specified below - static constexpr std::string_view mFolderSuffix[5] = {"", "_one", "_two", "_pos", "_neg"}; ///< Suffix for the folder name in case of analyses of pairs of the same kind (T-T, V-V, C-C) + static constexpr o2::aod::femtouniverseparticle::ParticleType mParticleType = particleType; ///< Type of the particle under analysis // o2-linter: disable=name/constexpr-constant + static constexpr int mFolderSuffixType = suffixType; ///< Counter for the folder suffix specified below // o2-linter: disable=name/constexpr-constant + static constexpr std::string_view mFolderSuffix[5] = {"", "_one", "_two", "_pos", "_neg"}; ///< Suffix for the folder name in case of analyses of pairs of the same kind (T-T, V-V, C-C) // o2-linter: disable=name/constexpr-constant int mPDG = 0; ///< PDG code of the selected particle }; } // namespace o2::analysis::femtoUniverse diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx index b049a6589d1..e0197fb8958 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx @@ -9,9 +9,11 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file femtoUniversePairTaskTrackCascadeExtended.cxx /// \brief Task for cascade QA; in the future: for cascade correlations /// \author Barbara Chytla, WUT Warsaw, barbara.chytla@cern.ch /// \author Shirajum Monira, WUT Warsaw, shirajum.monira@cern.ch +// o2-linter: disable=name/workflow-file #include #include "Framework/AnalysisTask.h" @@ -35,59 +37,60 @@ using namespace o2::framework::expressions; using namespace o2::analysis::femtoUniverse; using namespace o2::aod::pidutils; -struct femtoUniversePairTaskTrackCascadeExtended { +struct femtoUniversePairTaskTrackCascadeExtended { // o2-linter: disable=name/struct SliceCache cache; using FemtoFullParticles = soa::Join; Preslice perCol = aod::femtouniverseparticle::fdCollisionId; - Configurable ConfZVertexCut{"ConfZVertexCut", 10.f, "Event sel: Maximum z-Vertex (cm)"}; + Configurable confZVertexCut{"ConfZVertexCut", 10.f, "Event sel: Maximum z-Vertex (cm)"}; // o2-linter: disable=name/configurable - Filter collisionFilter = (nabs(aod::collision::posZ) < ConfZVertexCut); + Filter collisionFilter = (nabs(aod::collision::posZ) < confZVertexCut); using FilteredFDCollisions = soa::Filtered; using FilteredFDCollision = FilteredFDCollisions::iterator; - ConfigurableAxis ConfChildTempFitVarpTBins{"ConfChildTempFitVarpTBins", {20, 0.5, 4.05}, "V0 child: pT binning of the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfChildTempFitVarBins{"ConfChildTempFitVarBins", {300, -0.15, 0.15}, "V0 child: binning of the TempFitVar in the pT vs. TempFitVar plot"}; - Configurable ConfCascInvMassLowLimit{"ConfCascInvMassLowLimit", 1.315, "Lower limit of the Casc invariant mass"}; - Configurable ConfCascInvMassUpLimit{"ConfCascInvMassUpLimit", 1.325, "Upper limit of the Casc invariant mass"}; - Configurable ConfCascTranRad{"ConfCascTranRad", 0.5, "Cascade transverse radius"}; + ConfigurableAxis confChildTempFitVarpTBins{"ConfChildTempFitVarpTBins", {20, 0.5, 4.05}, "V0 child: pT binning of the pT vs. TempFitVar plot"}; // o2-linter: disable=name/configurable + ConfigurableAxis confChildTempFitVarBins{"ConfChildTempFitVarBins", {300, -0.15, 0.15}, "V0 child: binning of the TempFitVar in the pT vs. TempFitVar plot"}; // o2-linter: disable=name/configurable + Configurable confCascInvMassLowLimit{"ConfCascInvMassLowLimit", 1.315, "Lower limit of the Casc invariant mass"}; // o2-linter: disable=name/configurable + Configurable confCascInvMassUpLimit{"ConfCascInvMassUpLimit", 1.325, "Upper limit of the Casc invariant mass"}; // o2-linter: disable=name/configurable + Configurable confCascTranRad{"ConfCascTranRad", 0.5, "Cascade transverse radius"}; // o2-linter: disable=name/configurable - Configurable NSigmaTPCPion{"NSigmaTPCPion", 4, "NSigmaTPCPion"}; - Configurable NSigmaTPCProton{"NSigmaTPCProton", 4, "NSigmaTPCProton"}; + Configurable confNSigmaTPCPion{"NSigmaTPCPion", 4, "NSigmaTPCPion"}; // o2-linter: disable=name/configurable + Configurable confNSigmaTPCProton{"NSigmaTPCProton", 4, "NSigmaTPCProton"}; // o2-linter: disable=name/configurable // configs for correlation part - Configurable ConfTrackChoicePartOne{"ConfTrackChoicePartOne", 0, "0:Proton, 1:Pion, 2:Kaon"}; - Configurable ConfTrkPDGCodePartOne{"ConfTrkPDGCodePartOne", 2212, "Particle 1 (Track) - PDG code"}; - Configurable ConfCascType1{"ConfCascType1", 0, "select one of the V0s (Omega = 0, Xi = 1, anti-Omega = 2, anti-Xi = 3) for track-cascade combination"}; - Configurable ConfChargePart1{"ConfChargePart1", 1, "sign of particle 1"}; - Configurable ConfHPtPart1{"ConfHPtPart1", 4.0f, "higher limit for pt of particle 1"}; - Configurable ConfLPtPart1{"ConfLPtPart1", 0.5f, "lower limit for pt of particle 1"}; - Configurable ConfHPtPart2{"ConfHPtPart2", 4.0f, "higher limit for pt of particle 2"}; - Configurable ConfLPtPart2{"ConfLPtPart2", 0.3f, "lower limit for pt of particle 2"}; - Configurable Confmom{"Confmom", 0.75, "momentum threshold for particle identification using TOF"}; - Configurable ConfNsigmaTPCParticle{"ConfNsigmaTPCParticle", 3.0, "TPC Sigma for particle momentum < Confmom"}; - Configurable ConfNsigmaCombinedParticle{"ConfNsigmaCombinedParticle", 3.0, "TPC and TOF Sigma (combined) for particle momentum > Confmom"}; - - ConfigurableAxis ConfkstarBins{"ConfkstarBins", {1500, 0., 6.}, "binning kstar"}; - ConfigurableAxis ConfMultBins{"ConfMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; - ConfigurableAxis ConfkTBins{"ConfkTBins", {150, 0., 9.}, "binning kT"}; - ConfigurableAxis ConfmTBins{"ConfmTBins", {225, 0., 7.5}, "binning mT"}; - ConfigurableAxis ConfmultBins3D{"ConfMultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - ConfigurableAxis ConfmTBins3D{"ConfmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - Configurable ConfEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"}; - Configurable ConfPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"}; - Configurable ConfIsMC{"ConfIsMC", false, "Enable additional Histograms in the case of a MonteCarlo Run"}; - Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis ConfTrkTempFitVarpTBins{"ConfTrkTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfTrkTempFitVarBins{"ConfTrkDTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + Configurable confTrackChoicePartOne{"ConfTrackChoicePartOne", 0, "0:Proton, 1:Pion, 2:Kaon"}; // o2-linter: disable=name/configurable + Configurable confTrkPDGCodePartOne{"ConfTrkPDGCodePartOne", 2212, "Particle 1 (Track) - PDG code"}; // o2-linter: disable=name/configurable + Configurable confCascType1{"ConfCascType1", 0, "select one of the V0s (Omega = 0, Xi = 1, anti-Omega = 2, anti-Xi = 3) for track-cascade combination"}; // o2-linter: disable=name/configurable + Configurable confCascType2{"ConfCascType2", 0, "select one of the V0s (Omega = 0, Xi = 1, anti-Omega = 2, anti-Xi = 3) for cascade-cascade combination"}; // o2-linter: disable=name/configurable + Configurable confChargePart1{"ConfChargePart1", 1, "sign of particle 1"}; // o2-linter: disable=name/configurable + Configurable confHPtPart1{"ConfHPtPart1", 4.0f, "higher limit for pt of particle 1"}; // o2-linter: disable=name/configurable + Configurable confLPtPart1{"ConfLPtPart1", 0.5f, "lower limit for pt of particle 1"}; // o2-linter: disable=name/configurable + Configurable confHPtPart2{"ConfHPtPart2", 4.0f, "higher limit for pt of particle 2"}; // o2-linter: disable=name/configurable + Configurable confLPtPart2{"ConfLPtPart2", 0.3f, "lower limit for pt of particle 2"}; // o2-linter: disable=name/configurable + Configurable confmom{"Confmom", 0.75, "momentum threshold for particle identification using TOF"}; // o2-linter: disable=name/configurable + Configurable confNsigmaTPCParticle{"ConfNsigmaTPCParticle", 3.0, "TPC Sigma for particle momentum < Confmom"}; // o2-linter: disable=name/configurable + Configurable confNsigmaCombinedParticle{"ConfNsigmaCombinedParticle", 3.0, "TPC and TOF Sigma (combined) for particle momentum > Confmom"}; // o2-linter: disable=name/configurable + + ConfigurableAxis confkstarBins{"ConfkstarBins", {1500, 0., 6.}, "binning kstar"}; // o2-linter: disable=name/configurable + ConfigurableAxis confMultBins{"ConfMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; // o2-linter: disable=name/configurable + ConfigurableAxis confkTBins{"ConfkTBins", {150, 0., 9.}, "binning kT"}; // o2-linter: disable=name/configurable + ConfigurableAxis confmTBins{"ConfmTBins", {225, 0., 7.5}, "binning mT"}; // o2-linter: disable=name/configurable + ConfigurableAxis confmultBins3D{"ConfMultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; // o2-linter: disable=name/configurable + ConfigurableAxis confmTBins3D{"ConfmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; // o2-linter: disable=name/configurable + Configurable confEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"}; // o2-linter: disable=name/configurable + Configurable confPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"}; // o2-linter: disable=name/configurable + Configurable confIsMC{"ConfIsMC", false, "Enable additional Histograms in the case of a MonteCarlo Run"}; // o2-linter: disable=name/configurable + Configurable confUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; // o2-linter: disable=name/configurable + ConfigurableAxis confVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; // o2-linter: disable=name/configurable + ConfigurableAxis confTrkTempFitVarpTBins{"ConfTrkTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; // o2-linter: disable=name/configurable + ConfigurableAxis confTrkTempFitVarBins{"ConfTrkDTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; // o2-linter: disable=name/configurable /// Partition for particle 1 (track) - Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == ConfChargePart1) && (aod::femtouniverseparticle::pt < ConfHPtPart1) && (aod::femtouniverseparticle::pt > ConfLPtPart1); + Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == confChargePart1) && (aod::femtouniverseparticle::pt < confHPtPart1) && (aod::femtouniverseparticle::pt > confLPtPart1); /// Partition for particle 2 (cascade) - Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kCascade)) && (aod::femtouniverseparticle::pt < ConfHPtPart2) && (aod::femtouniverseparticle::pt > ConfLPtPart2); + Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kCascade)) && (aod::femtouniverseparticle::pt < confHPtPart2) && (aod::femtouniverseparticle::pt > confLPtPart2); /// Partition for cascades Partition cascs = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kCascade)); @@ -99,7 +102,8 @@ struct femtoUniversePairTaskTrackCascadeExtended { /// Histogramming for cascade FemtoUniverseParticleHisto posChildHistos; FemtoUniverseParticleHisto negChildHistos; - FemtoUniverseParticleHisto bachHistos; + FemtoUniverseParticleHisto bachHistos; + FemtoUniverseParticleHisto cascQAHistos; FemtoUniverseContainer sameEventCont; FemtoUniverseContainer mixedEventCont; @@ -111,102 +115,103 @@ struct femtoUniversePairTaskTrackCascadeExtended { // Table to select cascade daughters // Charges: = +--, +--, +-+, +-+ - static constexpr UInt_t CascChildTable[][3] = {{0, 1, 2}, {0, 1, 1}, {1, 0, 2}, {1, 0, 1}}; + static constexpr unsigned int CascChildTable[][3] = {{0, 1, 2}, {0, 1, 1}, {1, 0, 2}, {1, 0, 1}}; bool invMCascade(float invMassCascade, float invMassAntiCascade) { - if ((invMassCascade < ConfCascInvMassLowLimit || invMassCascade > ConfCascInvMassUpLimit) && (invMassAntiCascade < ConfCascInvMassLowLimit || invMassAntiCascade > ConfCascInvMassUpLimit)) { + if ((invMassCascade < confCascInvMassLowLimit || invMassCascade > confCascInvMassUpLimit) && (invMassAntiCascade < confCascInvMassLowLimit || invMassAntiCascade > confCascInvMassUpLimit)) { return false; } return true; } - bool IsNSigmaTPC(float nsigmaTPCParticle) + bool isNSigmaTPC(float nsigmaTPCParticle) { - if (TMath::Abs(nsigmaTPCParticle) < ConfNsigmaTPCParticle) { + if (std::abs(nsigmaTPCParticle) < confNsigmaTPCParticle) { return true; } else { return false; } } - bool IsNSigmaCombined(float mom, float nsigmaTPCParticle, float nsigmaTOFParticle) + bool isNSigmaCombined(float mom, float nsigmaTPCParticle, float nsigmaTOFParticle) { - if (mom <= Confmom) { - return (TMath::Abs(nsigmaTPCParticle) < ConfNsigmaTPCParticle); + if (mom <= confmom) { + return (std::abs(nsigmaTPCParticle) < confNsigmaTPCParticle); } else { - return (TMath::Hypot(nsigmaTOFParticle, nsigmaTPCParticle) < ConfNsigmaCombinedParticle); + return (TMath::Hypot(nsigmaTOFParticle, nsigmaTPCParticle) < confNsigmaCombinedParticle); // o2-linter: disable=root-entity } } template - bool IsParticleTPC(const T& part, int id) + bool isParticleTPC(const T& part, int id) { const float tpcNSigmas[3] = {unPackInTable(part.tpcNSigmaStorePr()), unPackInTable(part.tpcNSigmaStorePi()), unPackInTable(part.tpcNSigmaStoreKa())}; - return IsNSigmaTPC(tpcNSigmas[id]); + return isNSigmaTPC(tpcNSigmas[id]); } template - bool IsParticleCombined(const T& part, int id) + bool isParticleCombined(const T& part, int id) { const float tpcNSigmas[3] = {unPackInTable(part.tpcNSigmaStorePr()), unPackInTable(part.tpcNSigmaStorePi()), unPackInTable(part.tpcNSigmaStoreKa())}; const float tofNSigmas[3] = {unPackInTable(part.tofNSigmaStorePr()), unPackInTable(part.tofNSigmaStorePi()), unPackInTable(part.tofNSigmaStoreKa())}; - return IsNSigmaCombined(part.p(), tpcNSigmas[id], tofNSigmas[id]); + return isNSigmaCombined(part.p(), tpcNSigmas[id], tofNSigmas[id]); } void init(InitContext const&) { // Axes - AxisSpec XiMassAxis = {200, 1.28f, 1.36f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec aXiMassAxis = {200, 1.28f, 1.36f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; AxisSpec ptAxis = {100, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec etaAxis = {100, -2.0f, 2.0f, "#it{#eta}"}; AxisSpec phiAxis = {100, 0.0f, 6.0f, "#it{#phi}"}; - AxisSpec DCADaughAxis = {1000, 0.0f, 2.0f, "DCA (cm)"}; - AxisSpec CPAAxis = {1000, 0.95f, 1.0f, "#it{cos #theta_{p}}"}; + AxisSpec aDCADaughAxis = {1000, 0.0f, 2.0f, "DCA (cm)"}; + AxisSpec aCPAAxis = {1000, 0.95f, 1.0f, "#it{cos #theta_{p}}"}; AxisSpec tranRadAxis = {1000, 0.0f, 100.0f, "#it{r}_{xy} (cm)"}; - AxisSpec DCAToPVAxis = {1000, -10.0f, 10.0f, "DCA to PV (cm)"}; + AxisSpec aDCAToPVAxis = {1000, -10.0f, 10.0f, "DCA to PV (cm)"}; // Histograms - rXiQA.add("hMassXi", "hMassXi", {HistType::kTH1F, {XiMassAxis}}); - rXiQA.add("hMassXiSelected", "hMassXiSelected", {HistType::kTH1F, {XiMassAxis}}); + rXiQA.add("hMassXi", "hMassXi", {HistType::kTH1F, {aXiMassAxis}}); + rXiQA.add("hMassXiSelected", "hMassXiSelected", {HistType::kTH1F, {aXiMassAxis}}); rXiQA.add("hPtXi", "hPtXi", {HistType::kTH1F, {{ptAxis}}}); rXiQA.add("hEtaXi", "hEtaXi", {HistType::kTH1F, {{etaAxis}}}); rXiQA.add("hPhiXi", "hPhiXi", {HistType::kTH1F, {{phiAxis}}}); - rXiQA.add("hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {DCADaughAxis}}); - rXiQA.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {CPAAxis}}); + rXiQA.add("hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {aDCADaughAxis}}); + rXiQA.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {aCPAAxis}}); rXiQA.add("hV0TranRad", "hV0TranRad", {HistType::kTH1F, {tranRadAxis}}); - rXiQA.add("hDCACascDaughters", "hDCACascDaughters", {HistType::kTH1F, {DCADaughAxis}}); - rXiQA.add("hCascCosPA", "hCascCosPA", {HistType::kTH1F, {CPAAxis}}); + rXiQA.add("hDCACascDaughters", "hDCACascDaughters", {HistType::kTH1F, {aDCADaughAxis}}); + rXiQA.add("hCascCosPA", "hCascCosPA", {HistType::kTH1F, {aCPAAxis}}); rXiQA.add("hCascTranRad", "hCascTranRad", {HistType::kTH1F, {tranRadAxis}}); - rXiQA.add("hDcaPostoPV", "hDcaPostoPV", {HistType::kTH1F, {DCAToPVAxis}}); - rXiQA.add("hDcaNegtoPV", "hDcaNegtoPV", {HistType::kTH1F, {DCAToPVAxis}}); - rXiQA.add("hDcaBachtoPV", "hDcaBachtoPV", {HistType::kTH1F, {DCAToPVAxis}}); - rXiQA.add("hDcaV0toPV", "hDcaV0toPV", {HistType::kTH1F, {DCAToPVAxis}}); + rXiQA.add("hDcaPostoPV", "hDcaPostoPV", {HistType::kTH1F, {aDCAToPVAxis}}); + rXiQA.add("hDcaNegtoPV", "hDcaNegtoPV", {HistType::kTH1F, {aDCAToPVAxis}}); + rXiQA.add("hDcaBachtoPV", "hDcaBachtoPV", {HistType::kTH1F, {aDCAToPVAxis}}); + rXiQA.add("hDcaV0toPV", "hDcaV0toPV", {HistType::kTH1F, {aDCAToPVAxis}}); qaRegistry.add("Tracks_pos/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("Tracks_pos/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("Tracks_neg/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("Tracks_neg/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); - trackHistoPartOnePos.init(&qaRegistry, ConfTrkTempFitVarpTBins, ConfTrkTempFitVarBins, ConfIsMC, ConfTrkPDGCodePartOne); - trackHistoPartOneNeg.init(&qaRegistry, ConfTrkTempFitVarpTBins, ConfTrkTempFitVarBins, ConfIsMC, ConfTrkPDGCodePartOne); - posChildHistos.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false, 0, true); - negChildHistos.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false, 0, true); - bachHistos.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, false, 0, true, "hBachelor"); + trackHistoPartOnePos.init(&qaRegistry, confTrkTempFitVarpTBins, confTrkTempFitVarBins, confIsMC, confTrkPDGCodePartOne); + trackHistoPartOneNeg.init(&qaRegistry, confTrkTempFitVarpTBins, confTrkTempFitVarBins, confIsMC, confTrkPDGCodePartOne); + posChildHistos.init(&qaRegistry, confChildTempFitVarpTBins, confChildTempFitVarBins, false, 0, true); + negChildHistos.init(&qaRegistry, confChildTempFitVarpTBins, confChildTempFitVarBins, false, 0, true); + bachHistos.init(&qaRegistry, confChildTempFitVarpTBins, confChildTempFitVarBins, false, 0, true, "hBachelor"); + cascQAHistos.init(&qaRegistry, confChildTempFitVarpTBins, confChildTempFitVarBins, false, 0, true); - sameEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfEtaBins, ConfPhiBins, ConfIsMC, ConfUse3D); - mixedEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfEtaBins, ConfPhiBins, ConfIsMC, ConfUse3D); + sameEventCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, confEtaBins, confPhiBins, confIsMC, confUse3D); + mixedEventCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confmultBins3D, confmTBins3D, confEtaBins, confPhiBins, confIsMC, confUse3D); pairCleaner.init(&qaRegistry); } - void processCascades(FilteredFDCollision& col, FemtoFullParticles& parts) + void processCascades(const FilteredFDCollision& col, const FemtoFullParticles& parts) { auto groupCascs = cascs->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); // const int multCol = col.multNtr(); - for (auto& casc : groupCascs) { + for (const auto& casc : groupCascs) { rXiQA.fill(HIST("hMassXi"), casc.mLambda()); // if (!invMCascade(casc.mLambda(), casc.mAntiLambda())) @@ -216,28 +221,28 @@ struct femtoUniversePairTaskTrackCascadeExtended { const auto& negChild = parts.iteratorAt(casc.index() - 2); const auto& bachelor = parts.iteratorAt(casc.index() - 1); - // if (casc.transRadius() < ConfCascTranRad) + // if (casc.transRadius() < confCascTranRad) // continue; // std::cout< NSigmaTPCProton) { + if (std::abs(posChild.tpcNSigmaPr()) > confNSigmaTPCProton) { continue; } - if (TMath::Abs(negChild.tpcNSigmaPi()) > NSigmaTPCPion) { + if (std::abs(negChild.tpcNSigmaPi()) > confNSigmaTPCPion) { continue; } } else { - if (TMath::Abs(negChild.tpcNSigmaPr()) > NSigmaTPCProton) { + if (std::abs(negChild.tpcNSigmaPr()) > confNSigmaTPCProton) { continue; } - if (TMath::Abs(posChild.tpcNSigmaPi()) > NSigmaTPCPion) { + if (std::abs(posChild.tpcNSigmaPi()) > confNSigmaTPCPion) { continue; } } - if (TMath::Abs(bachelor.tpcNSigmaPi()) > NSigmaTPCPion) { + if (std::abs(bachelor.tpcNSigmaPi()) > confNSigmaTPCPion) { continue; } @@ -261,21 +266,24 @@ struct femtoUniversePairTaskTrackCascadeExtended { bachHistos.fillQABase(bachelor, HIST("hBachelor")); } } - PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processCascades, "Enable processing cascades", true); - - void processSameEvent(FilteredFDCollision& col, FemtoFullParticles& parts) + PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processCascades, "Enable processing cascades", false); + /// track - cascade + void processSameEvent(const FilteredFDCollision& col, const FemtoFullParticles& parts) { auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - for (auto& part : groupPartsTwo) { + for (const auto& part : groupPartsTwo) { if (!invMCascade(part.mLambda(), part.mAntiLambda())) continue; + + cascQAHistos.fillQA(part); + const auto& posChild = parts.iteratorAt(part.index() - 3); const auto& negChild = parts.iteratorAt(part.index() - 2); const auto& bachelor = parts.iteratorAt(part.index() - 1); /// Child particles must pass this condition to be selected - if (!IsParticleTPC(posChild, CascChildTable[ConfCascType1][0]) || !IsParticleTPC(negChild, CascChildTable[ConfCascType1][1]) || !IsParticleTPC(bachelor, CascChildTable[ConfCascType1][2])) + if (!isParticleTPC(posChild, CascChildTable[confCascType1][0]) || !isParticleTPC(negChild, CascChildTable[confCascType1][1]) || !isParticleTPC(bachelor, CascChildTable[confCascType1][2])) continue; posChildHistos.fillQA(posChild); @@ -283,31 +291,31 @@ struct femtoUniversePairTaskTrackCascadeExtended { bachHistos.fillQABase(bachelor, HIST("hBachelor")); } - for (auto& part : groupPartsOne) { + for (const auto& part : groupPartsOne) { /// PID plot for track particle const float tpcNSigmas[3] = {unPackInTable(part.tpcNSigmaStorePr()), unPackInTable(part.tpcNSigmaStorePi()), unPackInTable(part.tpcNSigmaStoreKa())}; const float tofNSigmas[3] = {unPackInTable(part.tofNSigmaStorePr()), unPackInTable(part.tofNSigmaStorePi()), unPackInTable(part.tofNSigmaStoreKa())}; - if (!IsNSigmaCombined(part.p(), tpcNSigmas[ConfTrackChoicePartOne], tofNSigmas[ConfTrackChoicePartOne])) + if (!isNSigmaCombined(part.p(), tpcNSigmas[confTrackChoicePartOne], tofNSigmas[confTrackChoicePartOne])) continue; if (part.sign() > 0) { - qaRegistry.fill(HIST("Tracks_pos/nSigmaTPC"), part.p(), tpcNSigmas[ConfTrackChoicePartOne]); - qaRegistry.fill(HIST("Tracks_pos/nSigmaTOF"), part.p(), tofNSigmas[ConfTrackChoicePartOne]); + qaRegistry.fill(HIST("Tracks_pos/nSigmaTPC"), part.p(), tpcNSigmas[confTrackChoicePartOne]); + qaRegistry.fill(HIST("Tracks_pos/nSigmaTOF"), part.p(), tofNSigmas[confTrackChoicePartOne]); trackHistoPartOnePos.fillQA(part); } else if (part.sign() < 0) { - qaRegistry.fill(HIST("Tracks_neg/nSigmaTPC"), part.p(), tpcNSigmas[ConfTrackChoicePartOne]); - qaRegistry.fill(HIST("Tracks_neg/nSigmaTOF"), part.p(), tofNSigmas[ConfTrackChoicePartOne]); + qaRegistry.fill(HIST("Tracks_neg/nSigmaTPC"), part.p(), tpcNSigmas[confTrackChoicePartOne]); + qaRegistry.fill(HIST("Tracks_neg/nSigmaTOF"), part.p(), tofNSigmas[confTrackChoicePartOne]); trackHistoPartOneNeg.fillQA(part); } } - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Cascade invariant mass cut if (!invMCascade(p2.mLambda(), p2.mAntiLambda())) continue; // PID - if (!IsParticleCombined(p1, ConfTrackChoicePartOne)) + if (!isParticleCombined(p1, confTrackChoicePartOne)) continue; // track cleaning if (!pairCleaner.isCleanPair(p1, p2, parts)) { @@ -317,19 +325,84 @@ struct femtoUniversePairTaskTrackCascadeExtended { const auto& negChild = parts.iteratorAt(p2.index() - 2); const auto& bachelor = parts.iteratorAt(p2.index() - 1); /// Child particles must pass this condition to be selected - if (!IsParticleTPC(posChild, CascChildTable[ConfCascType1][0]) || !IsParticleTPC(negChild, CascChildTable[ConfCascType1][1]) || !IsParticleTPC(bachelor, CascChildTable[ConfCascType1][2])) + if (!isParticleTPC(posChild, CascChildTable[confCascType1][0]) || !isParticleTPC(negChild, CascChildTable[confCascType1][1]) || !isParticleTPC(bachelor, CascChildTable[confCascType1][2])) continue; - sameEventCont.setPair(p1, p2, col.multNtr(), ConfUse3D, 1.0f); + sameEventCont.setPair(p1, p2, col.multNtr(), confUse3D, 1.0f); } } - PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processSameEvent, "Enable processing same event for track - cascade", true); + PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processSameEvent, "Enable processing same event for track - cascade", false); + /// cascade - cascade + void processSameEventCasc(const FilteredFDCollision& col, const FemtoFullParticles& parts) + { + auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); + + for (const auto& part : groupPartsTwo) { + if (!invMCascade(part.mLambda(), part.mAntiLambda())) + continue; + + cascQAHistos.fillQA(part); + + const auto& posChild = parts.iteratorAt(part.index() - 3); + const auto& negChild = parts.iteratorAt(part.index() - 2); + const auto& bachelor = parts.iteratorAt(part.index() - 1); + /// Check daughters of first cascade + if (isParticleTPC(posChild, CascChildTable[confCascType1][0]) && isParticleTPC(negChild, CascChildTable[confCascType1][1]) && isParticleTPC(bachelor, CascChildTable[confCascType1][2])) { - void processMixedEvent(FilteredFDCollisions& cols, FemtoFullParticles& parts) + posChildHistos.fillQA(posChild); + negChildHistos.fillQA(negChild); + bachHistos.fillQABase(bachelor, HIST("hBachelor")); + } + /// Check daughters of second cascade + /*if (isParticleTPC(posChild, CascChildTable[confCascType2][0]) && isParticleTPC(negChild, CascChildTable[confCascType2][1]) && isParticleTPC(bachelor, CascChildTable[confCascType2][2])) { + }*/ + } + + auto pairProcessFunc = [&](auto& p1, auto& p2) -> void { + // Cascade invariant mass cut for p1 + if (!invMCascade(p1.mLambda(), p1.mAntiLambda())) + return; + // Cascade invariant mass cut for p2 + if (!invMCascade(p2.mLambda(), p2.mAntiLambda())) + return; + // track cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + return; + } + const auto& posChild1 = parts.iteratorAt(p1.index() - 3); + const auto& negChild1 = parts.iteratorAt(p1.index() - 2); + const auto& bachelor1 = parts.iteratorAt(p1.index() - 1); + /// Child particles must pass this condition to be selected + if (!isParticleTPC(posChild1, CascChildTable[confCascType1][0]) || !isParticleTPC(negChild1, CascChildTable[confCascType1][1]) || !isParticleTPC(bachelor1, CascChildTable[confCascType1][2])) + return; + const auto& posChild2 = parts.iteratorAt(p2.index() - 3); + const auto& negChild2 = parts.iteratorAt(p2.index() - 2); + const auto& bachelor2 = parts.iteratorAt(p2.index() - 1); + /// Child particles must pass this condition to be selected + if (!isParticleTPC(posChild2, CascChildTable[confCascType2][0]) || !isParticleTPC(negChild2, CascChildTable[confCascType2][1]) || !isParticleTPC(bachelor2, CascChildTable[confCascType2][2])) + return; + + sameEventCont.setPair(p1, p2, col.multNtr(), confUse3D, 1.0f); + }; + if (confCascType1 == confCascType2) { + /// Now build the combinations for identical cascades + for (const auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsTwo, groupPartsTwo))) { + pairProcessFunc(p1, p2); + } + } else { + /// Now build the combinations for non-identical cascades + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsTwo, groupPartsTwo))) { + pairProcessFunc(p1, p2); + } + } + } + PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processSameEventCasc, "Enable processing same event for cascade - cascade", false); + /// track - cascade + void processMixedEvent(const FilteredFDCollisions& cols, const FemtoFullParticles& parts) { - ColumnBinningPolicy colBinning{{ConfVtxBins, ConfMultBins}, true}; + ColumnBinningPolicy colBinning{{confVtxBins, confMultBins}, true}; - for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); @@ -340,30 +413,76 @@ struct femtoUniversePairTaskTrackCascadeExtended { if (magFieldTesla1 != magFieldTesla2) { continue; } - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Cascade invariant mass cut if (!invMCascade(p2.mLambda(), p2.mAntiLambda())) continue; // PID - if (!IsParticleCombined(p1, ConfTrackChoicePartOne)) + if (!isParticleCombined(p1, confTrackChoicePartOne)) continue; const auto& posChild = parts.iteratorAt(p2.index() - 3); const auto& negChild = parts.iteratorAt(p2.index() - 2); const auto& bachelor = parts.iteratorAt(p2.index() - 1); /// Child particles must pass this condition to be selected - if (!IsParticleTPC(posChild, CascChildTable[ConfCascType1][0]) || !IsParticleTPC(negChild, CascChildTable[ConfCascType1][1]) || !IsParticleTPC(bachelor, CascChildTable[ConfCascType1][2])) + if (!isParticleTPC(posChild, CascChildTable[confCascType1][0]) || !isParticleTPC(negChild, CascChildTable[confCascType1][1]) || !isParticleTPC(bachelor, CascChildTable[confCascType1][2])) + continue; + // track cleaning + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } + + mixedEventCont.setPair(p1, p2, collision1.multNtr(), confUse3D, 1.0f); + } + } + } + PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processMixedEvent, "Enable processing mixed event for track - cascade", false); + /// cascade - cascade + void processMixedEventCasc(const FilteredFDCollisions& cols, const FemtoFullParticles& parts) + { + ColumnBinningPolicy colBinning{{confVtxBins, confMultBins}, true}; + + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + + auto groupPartsOne = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); + auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); + + const auto& magFieldTesla1 = collision1.magField(); + const auto& magFieldTesla2 = collision2.magField(); + + if (magFieldTesla1 != magFieldTesla2) { + continue; + } + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + // Cascade invariant mass cut for p1 + if (!invMCascade(p1.mLambda(), p1.mAntiLambda())) + continue; + // Cascade invariant mass cut for p2 + if (!invMCascade(p2.mLambda(), p2.mAntiLambda())) continue; + + const auto& posChild1 = parts.iteratorAt(p1.index() - 3); + const auto& negChild1 = parts.iteratorAt(p1.index() - 2); + const auto& bachelor1 = parts.iteratorAt(p1.index() - 1); + /// Child particles must pass this condition to be selected + if (!isParticleTPC(posChild1, CascChildTable[confCascType1][0]) || !isParticleTPC(negChild1, CascChildTable[confCascType1][1]) || !isParticleTPC(bachelor1, CascChildTable[confCascType1][2])) + return; + const auto& posChild2 = parts.iteratorAt(p2.index() - 3); + const auto& negChild2 = parts.iteratorAt(p2.index() - 2); + const auto& bachelor2 = parts.iteratorAt(p2.index() - 1); + /// Child particles must pass this condition to be selected + if (!isParticleTPC(posChild2, CascChildTable[confCascType2][0]) || !isParticleTPC(negChild2, CascChildTable[confCascType2][1]) || !isParticleTPC(bachelor2, CascChildTable[confCascType2][2])) + return; // track cleaning if (!pairCleaner.isCleanPair(p1, p2, parts)) { continue; } - mixedEventCont.setPair(p1, p2, collision1.multNtr(), ConfUse3D, 1.0f); + mixedEventCont.setPair(p1, p2, collision1.multNtr(), confUse3D, 1.0f); } } } - PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processMixedEvent, "Enable processing mixed event for track - cascade", true); + PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processMixedEventCasc, "Enable processing mixed event for cascade - cascade", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From ef91e2a3206952ec9d9ec4623e9238a67415a77a Mon Sep 17 00:00:00 2001 From: lauraser <45659867+lauraser@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:03:41 +0100 Subject: [PATCH 363/459] Add new histograms for pair cleaner tests in TTV0 task (#8970) Co-authored-by: Laura Serksnyte --- .../femtoDreamTripletTaskTrackTrackV0.cxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx index 05892a71bf1..ee4f88c72b9 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackV0.cxx @@ -203,9 +203,13 @@ struct femtoDreamTripletTaskTrackTrackV0 { std::vector tmpVecMult = ConfMultBins; framework::AxisSpec multAxis = {tmpVecMult, "Multiplicity"}; ThreeBodyQARegistry.add("TripletTaskQA/hSEMultVSGoodTracks", ";Mult;GoodT", kTH2F, {multAxis, {100, 0, 100}}); - ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleaner", ";posDaughtID; negDaughID", kTH2F, {{100, -10000, 10000}, {100, -10000, 10000}}); - ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleanerPos", ";primaryTrack; posDaughtID", kTH2F, {{100, -200, 200}, {100, -200, 200}}); - ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleanerNeg", ";primaryTrack; negDaughtID", kTH2F, {{100, -200, 200}, {100, -200, 200}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleaner", ";posDaughtID; negDaughID", kTH2F, {{40, -20, 20}, {40, -20, 20}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleanerPos", ";primaryTrack; posDaughtID", kTH2F, {{40, -20, 20}, {40, -20, 20}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleanerNeg", ";primaryTrack; negDaughtID", kTH2F, {{40, -20, 20}, {40, -20, 20}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleanerPosGlobal", ";primaryTrackGlobal; posDaughtID", kTH2F, {{40, -20, 20}, {40, -20, 20}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleanerNegGlobal", ";primaryTrackGlobal; negDaughtID", kTH2F, {{40, -20, 20}, {40, -20, 20}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleanerPosAfter", ";primaryTrack; posDaughtID", kTH2F, {{40, -20, 20}, {40, -20, 20}}); + ThreeBodyQARegistry.add("TripletTaskQA/hTestPairCleanerNegAfter", ";primaryTrack; negDaughtID", kTH2F, {{40, -20, 20}, {40, -20, 20}}); sameEventCont.init(&resultRegistry, ConfQ3Bins, ConfMultBins, ConfIsMC); mixedEventCont.init(&resultRegistry, ConfQ3Bins, ConfMultBins, ConfIsMC); @@ -334,6 +338,10 @@ struct femtoDreamTripletTaskTrackTrackV0 { ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerNeg"), T1.index(), negID); ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerPos"), T2.index(), posID); ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerNeg"), T2.index(), negID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerPosGlobal"), T1.globalIndex(), posID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerNegGlobal"), T1.globalIndex(), negID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerPosGlobal"), T2.globalIndex(), posID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerNegGlobal"), T2.globalIndex(), negID); auto Q3 = FemtoDreamMath::getQ3(T1, mMassOne, T2, mMassTwo, V0, mMassThree); // Close pair rejection if (ConfIsCPR.value) { @@ -358,6 +366,10 @@ struct femtoDreamTripletTaskTrackTrackV0 { if (!pairCleanerTrackV0.isCleanPair(T1, V0, parts)) { continue; } + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerPosAfter"), T1.index(), posID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerNegAfter"), T1.index(), negID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerPosAfter"), T2.index(), posID); + ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hTestPairCleanerNegAfter"), T2.index(), negID); // fill inv Mass as a function of Q3 for purity fits ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hMinvSE_Lambda"), Q3, V0.mLambda()); ThreeBodyQARegistry.fill(HIST("TripletTaskQA/hMinvSE_AntiLambda"), Q3, V0.mAntiLambda()); From 8bff26a897e15f457c7d27b5220b29ac5335575f Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Thu, 12 Dec 2024 23:52:04 +0100 Subject: [PATCH 364/459] [PWGEM/Dilepton] update single track qc mc (#8971) --- PWGEM/Dilepton/Core/SingleTrackQCMC.h | 30 ++++++++++++++++++--------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index 45c40aa5c1f..bd16f85f0e7 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -197,7 +197,7 @@ struct SingleTrackQCMC { HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 HistogramRegistry can keep up to 512 histograms static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; - static constexpr std::string_view lepton_source_types[9] = {"lf/", "Photon/", "PromptJPsi/", "NonPromptJPsi/", "PromptPsi2S/", "NonPromptPsi2S/", "c2l/", "b2l/", "b2c2l/"}; + static constexpr std::string_view lepton_source_types[10] = {"lf/", "lf_prompt/", "Photon/", "PromptJPsi/", "NonPromptJPsi/", "PromptPsi2S/", "NonPromptPsi2S/", "c2l/", "b2l/", "b2c2l/"}; ~SingleTrackQCMC() {} @@ -221,6 +221,7 @@ struct SingleTrackQCMC { // generated info fRegistry.add("Generated/lf/hs", "gen. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); + fRegistry.addClone("Generated/lf/", "Generated/lf_prompt/"); fRegistry.addClone("Generated/lf/", "Generated/PromptJPsi/"); fRegistry.addClone("Generated/lf/", "Generated/NonPromptJPsi/"); fRegistry.addClone("Generated/lf/", "Generated/PromptPsi2S/"); @@ -253,6 +254,7 @@ struct SingleTrackQCMC { fRegistry.add("Track/lf/positive/hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); } fRegistry.addClone("Track/lf/positive/", "Track/lf/negative/"); + fRegistry.addClone("Track/lf/", "Track/lf_prompt/"); fRegistry.addClone("Track/lf/", "Track/Photon/"); // this is not for efficiency! only for contamination. We don't store generated photon conversions. fRegistry.addClone("Track/lf/", "Track/PromptJPsi/"); fRegistry.addClone("Track/lf/", "Track/NonPromptJPsi/"); @@ -289,6 +291,7 @@ struct SingleTrackQCMC { // generated info fRegistry.add("Generated/lf/hs", "gen. single muon", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); + fRegistry.addClone("Generated/lf/", "Generated/lf_prompt/"); fRegistry.addClone("Generated/lf/", "Generated/PromptJPsi/"); fRegistry.addClone("Generated/lf/", "Generated/NonPromptJPsi/"); fRegistry.addClone("Generated/lf/", "Generated/PromptPsi2S/"); @@ -318,6 +321,7 @@ struct SingleTrackQCMC { fRegistry.add("Track/lf/positive/hPtGen_DeltaPhi", "muon #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); } fRegistry.addClone("Track/lf/positive/", "Track/lf/negative/"); + fRegistry.addClone("Track/lf/", "Track/lf_prompt/"); fRegistry.addClone("Track/lf/", "Track/Photon/"); // this is not for efficiency! only for contamination. We don't store generated photon conversions. fRegistry.addClone("Track/lf/", "Track/PromptJPsi/"); fRegistry.addClone("Track/lf/", "Track/NonPromptJPsi/"); @@ -714,30 +718,33 @@ struct SingleTrackQCMC { if (mctrack.isPhysicalPrimary() || mctrack.producedByGenerator()) { if (pdg_mother == 111 || pdg_mother == 221 || pdg_mother == 331 || pdg_mother == 113 || pdg_mother == 223 || pdg_mother == 333) { - fillTrackInfo<0, TMCParticles>(track); + fillTrackInfo<0, TMCParticles>(track); // lf + if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) { + fillTrackInfo<1, TMCParticles>(track); // lf_prompt + } } else if (pdg_mother == 443) { if (IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. - fillTrackInfo<3, TMCParticles>(track); + fillTrackInfo<4, TMCParticles>(track); } else { - fillTrackInfo<2, TMCParticles>(track); + fillTrackInfo<3, TMCParticles>(track); } } else if (pdg_mother == 100443) { if (IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. - fillTrackInfo<5, TMCParticles>(track); + fillTrackInfo<6, TMCParticles>(track); } else { - fillTrackInfo<4, TMCParticles>(track); + fillTrackInfo<5, TMCParticles>(track); } } else if (IsFromBeauty(mctrack, mcparticles) > 0) { // b is found in full decay chain. if (IsFromCharm(mctrack, mcparticles) > 0) { // c is found in full decay chain. - fillTrackInfo<8, TMCParticles>(track); + fillTrackInfo<9, TMCParticles>(track); } else { - fillTrackInfo<7, TMCParticles>(track); + fillTrackInfo<8, TMCParticles>(track); } } else if (IsFromCharm(mctrack, mcparticles) > 0) { // c is found in full decay chain. Not from b. - fillTrackInfo<6, TMCParticles>(track); + fillTrackInfo<7, TMCParticles>(track); } } else { - fillTrackInfo<1, TMCParticles>(track); + fillTrackInfo<2, TMCParticles>(track); } } // end of track loop @@ -821,6 +828,9 @@ struct SingleTrackQCMC { if (pdg_mother == 111 || pdg_mother == 221 || pdg_mother == 331 || pdg_mother == 113 || pdg_mother == 223 || pdg_mother == 333) { fRegistry.fill(HIST("Generated/lf/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); + if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) { + fRegistry.fill(HIST("Generated/lf_prompt/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); + } } else if (pdg_mother == 443) { if (IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. fRegistry.fill(HIST("Generated/NonPromptJPsi/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); From ce49fe82d20e0cc0c4cc464e58a672ebc26e223e Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Fri, 13 Dec 2024 00:52:34 +0100 Subject: [PATCH 365/459] [PWGCF] DptDpt - First method for TPC tracks excluding (#8972) Co-authored-by: Victor --- PWGCF/TableProducer/dptdptfilter.cxx | 15 +++- PWGCF/TableProducer/dptdptfilter.h | 87 ++++++++++++++++++- PWGCF/Tasks/dptdptcorrelations.cxx | 1 - PWGCF/Tasks/match-reco-gen.cxx | 14 +++ .../Tasks/dptDptEfficiencyAndQc.cxx | 5 ++ 5 files changed, 116 insertions(+), 6 deletions(-) diff --git a/PWGCF/TableProducer/dptdptfilter.cxx b/PWGCF/TableProducer/dptdptfilter.cxx index 35136acff91..c96ad0356e8 100644 --- a/PWGCF/TableProducer/dptdptfilter.cxx +++ b/PWGCF/TableProducer/dptdptfilter.cxx @@ -75,6 +75,7 @@ using DptDptFullTracksFullPIDDetLevel = soa::Join; bool fullDerivedData = false; /* produce full derived data for its external storage */ +TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance /// \enum MatchRecoGenSpecies /// \brief The species considered by the matching test @@ -367,6 +368,7 @@ struct DptDptFilter { Configurable cfgTriggSel{"triggsel", "MB", "Trigger selection: MB,VTXTOFMATCHED,VTXTRDMATCHED,VTXTRDTOFMATCHED,None. Default MB"}; Configurable cfgCentSpec{"centralities", "00-10,10-20,20-30,30-40,40-50,50-60,60-70,70-80", "Centrality/multiplicity ranges in min-max separated by commas"}; Configurable cfgOverallMinP{"overallminp", 0.0f, "The overall minimum momentum for the analysis. Default: 0.0"}; + Configurable cfgTpcExclusionMethod{"cfgTpcExclusionMethod", 0, "The method for excluding tracks within the TPC. 0: no exclusion; 1: static; 2: dynamic. Default: 0"}; Configurable cfgBinning{"binning", {28, -7.0, 7.0, 18, 0.2, 2.0, 16, -0.8, 0.8, 72, 0.5}, "triplets - nbins, min, max - for z_vtx, pT, eta and phi, binning plus bin fraction of phi origin shift"}; @@ -801,7 +803,15 @@ struct DptDptFilterTracks { getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mEtabins", etabins, false); getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mEtamin", etalow, false); getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mEtamax", etaup, false); - + getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mPhibins", phibins, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mPhibinshift", phibinshift, false); + + TpcExclusionMethod tpcExclude = kNOEXCLUSION; ///< exclude tracks within the TPC according to this method + { + int tmpTpcExclude = 0; + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgTpcExclusionMethod", tmpTpcExclude, false); + tpcExclude = static_cast(tmpTpcExclude); + } /* self configure the CCDB access to the input file */ getTaskOptionValue(initContext, "dpt-dpt-filter", "input_ccdburl", cfgCCDBUrl, false); getTaskOptionValue(initContext, "dpt-dpt-filter", "input_ccdbpath", cfgCCDBPathName, false); @@ -816,6 +826,9 @@ struct DptDptFilterTracks { recoIdMethod = cfgRecoIdMethod; onlyInOneSide = cfgOnlyInOneSide.value; + /* the TPC excluder object instance */ + tpcExcluder = TpcExcludeTrack(tpcExclude); + /* self configure system type and data type */ /* if the system type is not known at this time, we have to put the initialization somewhere else */ std::string tmpstr; diff --git a/PWGCF/TableProducer/dptdptfilter.h b/PWGCF/TableProducer/dptdptfilter.h index 40cb60c13fb..0a824103934 100644 --- a/PWGCF/TableProducer/dptdptfilter.h +++ b/PWGCF/TableProducer/dptdptfilter.h @@ -35,10 +35,10 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" #include "PWGCF/Core/AnalysisConfigurableCuts.h" -#include namespace o2 { @@ -147,6 +147,14 @@ enum StrongDebugging { kDEBUG ///< output debugging information on a per track basis to a text file }; +/// \enum TpcExclusionMethod +/// \brief Methods for excluding tracks witin the TPC +enum TpcExclusionMethod { + kNOEXCLUSION = 0, ///< do not exclude tracks within the TPC + kSTATIC, ///< exclude tracks statically on the bins of the TPC sector borders; only valid if 72 bins and origin shifted by 0.5 + kDYNAMIC ///< pT dependent exclusion matching the sector borders a la Alex Dobrin +}; + //============================================================================================ // The debug output stream //============================================================================================ @@ -172,9 +180,13 @@ float etalow = -0.8, etaup = 0.8; int zvtxbins = 40; float zvtxlow = -10.0, zvtxup = 10.0; int phibins = 72; -float philow = 0.0; +float philow = 0.0f; float phiup = constants::math::TwoPI; -bool onlyInOneSide = false; /* select only tracks that don't cross the TPC central membrane */ +float phibinshift = 0.0f; + +struct TpcExcludeTrack; ///< forward declaration of the excluder object +bool onlyInOneSide = false; ///< select only tracks that don't cross the TPC central membrane +extern TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance /* selection criteria from PWGMM */ // default quality criteria for tracks with ITS contribution @@ -986,6 +998,73 @@ inline bool isEventSelected(CollisionObject const& collision, float& centormult) /// Track selection ////////////////////////////////////////////////////////////////////////////////// +struct TpcExcludeTrack { + TpcExcludeTrack() + { + method = kNOEXCLUSION; + } + explicit TpcExcludeTrack(TpcExclusionMethod m) + { + switch (m) { + case kNOEXCLUSION: + method = m; + break; + case kSTATIC: + if (phibinshift == 0.5f && phibins == 72) { + method = m; + } else { + LOGF(fatal, "Static TPC exclusion method with bin shift: %.2f and number of bins %d. Please fix it", phibinshift, phibins); + } + break; + case kDYNAMIC: + LOGF(fatal, "Dynamic TPC exclusion method still not implemented"); + method = m; + break; + default: + LOGF(fatal, "Wrong TPC tracks exclusion method %d. Please, fix it", static_cast(m)); + } + philow = 0.0f; + phiup = constants::math::TwoPI; + phibinwidth = (phiup - philow) / static_cast(phibins); + phiup = phiup - phibinwidth * phibinshift; + philow = philow - phibinwidth * phibinshift; + } + + template + int getPhiBinIx(TrackObject const& track) + { + float phi = RecoDecay::constrainAngle(track.phi(), philow); + return static_cast((phi - philow) / phibinwidth); + } + + template + bool exclude(TrackObject const& track) + { + switch (method) { + case kNOEXCLUSION: { + return false; + } break; + case kSTATIC: { + int phiBinIx = getPhiBinIx(track); + /* bins multiple of four have got sector border */ + if ((phiBinIx % 4) != 0) { + return false; + } else { + return true; + } + } break; + case kDYNAMIC: { + return false; + } break; + default: + return false; + } + } + + TpcExclusionMethod method = kNOEXCLUSION; + float phibinwidth = 0.0; +}; + template inline bool matchTrackType(TrackObject const& track) { @@ -1072,7 +1151,7 @@ inline bool inTheAcceptance(TrackObject const& track) } if (ptlow < track.pt() && track.pt() < ptup && etalow < track.eta() && track.eta() < etaup) { - return true; + return !tpcExcluder.exclude(track); } return false; } diff --git a/PWGCF/Tasks/dptdptcorrelations.cxx b/PWGCF/Tasks/dptdptcorrelations.cxx index e89a4958f81..4bbc74a6428 100644 --- a/PWGCF/Tasks/dptdptcorrelations.cxx +++ b/PWGCF/Tasks/dptdptcorrelations.cxx @@ -57,7 +57,6 @@ using namespace o2::framework::expressions; namespace correlationstask { using namespace o2::analysis::dptdptfilter; -float phibinshift = 0.5; float etabinwidth = (etaup - etalow) / static_cast(etabins); float phibinwidth = (phiup - philow) / static_cast(phibins); int deltaetabins = etabins * 2 - 1; diff --git a/PWGCF/Tasks/match-reco-gen.cxx b/PWGCF/Tasks/match-reco-gen.cxx index 2b2fe0fa47e..43adb1b63b0 100644 --- a/PWGCF/Tasks/match-reco-gen.cxx +++ b/PWGCF/Tasks/match-reco-gen.cxx @@ -51,6 +51,11 @@ std::vector> mclabelpos[2]; std::vector> mclabelneg[2]; } // namespace o2::analysis::recogenmap +namespace o2::analysis::dptdptfilter +{ +TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance +} // namespace o2::analysis::dptdptfilter + /// \brief Checks the correspondence generator level <=> detector level struct CheckGeneratorLevelVsDetectorLevel { Configurable cfgTrackType{"trktype", 1, "Type of selected tracks: 0 = no selection, 1 = global tracks FB96"}; @@ -62,6 +67,7 @@ struct CheckGeneratorLevelVsDetectorLevel { Configurable cfgBinning{"binning", {28, -7.0, 7.0, 18, 0.2, 2.0, 16, -0.8, 0.8, 72, 0.5}, "triplets - nbins, min, max - for z_vtx, pT, eta and phi, binning plus bin fraction of phi origin shift"}; + Configurable cfgTpcExclusionMethod{"cfgTpcExclusionMethod", 0, "The method for excluding tracks within the TPC. 0: no exclusion; 1: static; 2: dynamic. Default: 0"}; Configurable cfgTraceDCAOutliers{"trackdcaoutliers", {false, 0.0, 0.0}, "Track the generator level DCAxy outliers: false/true, low dcaxy, up dcaxy. Default {false,0.0,0.0}"}; Configurable cfgTraceOutOfSpeciesParticles{"trackoutparticles", false, "Track the particles which are not e,mu,pi,K,p: false/true. Default false"}; Configurable cfgRecoIdMethod{"recoidmethod", 0, "Method for identifying reconstructed tracks: 0 PID, 1 mcparticle. Default 0"}; @@ -96,6 +102,14 @@ struct CheckGeneratorLevelVsDetectorLevel { zvtxbins = cfgBinning->mZVtxbins; zvtxlow = cfgBinning->mZVtxmin; zvtxup = cfgBinning->mZVtxmax; + phibins = cfgBinning->mPhibins; + phibinshift = cfgBinning->mPhibinshift; + + /* the TPC excluder object instance */ + TpcExclusionMethod tpcExclude = kNOEXCLUSION; ///< exclude tracks within the TPC according to this method + tpcExclude = static_cast(cfgTpcExclusionMethod.value); + tpcExcluder = TpcExcludeTrack(tpcExclude); + /* the track types and combinations */ tracktype = cfgTrackType.value; initializeTrackSelection(cfgTuneTrackSelection); diff --git a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx index b902057451a..1fcb74db545 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx @@ -50,6 +50,11 @@ using namespace o2::framework::expressions; #define HNAMESTRING(thehnamefmt, thehnamepars...) FORMATSTRING(thehnamefmt, thehnamepars) #define HTITLESTRING(thehtitlefmt, thehtitlepars...) FORMATSTRING(thehtitlefmt, thehtitlepars) +namespace o2::analysis::dptdptfilter +{ +TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance +} // namespace o2::analysis::dptdptfilter + namespace efficiencyandqatask { /// \enum KindOfProcessQA From 30f9d8b48c7f573a9c53bef4ea29615accbf535e Mon Sep 17 00:00:00 2001 From: Tanu Gahlaut <154991749+TGahlaut1@users.noreply.github.com> Date: Fri, 13 Dec 2024 06:37:07 +0100 Subject: [PATCH 366/459] [PWGCF] update changes in MC level (#8958) Co-authored-by: Victor Gonzalez --- PWGCF/EbyEFluctuations/Tasks/meanPtFlucId.cxx | 171 ++++++++++++------ 1 file changed, 118 insertions(+), 53 deletions(-) diff --git a/PWGCF/EbyEFluctuations/Tasks/meanPtFlucId.cxx b/PWGCF/EbyEFluctuations/Tasks/meanPtFlucId.cxx index 60207675815..88c1fe856e7 100644 --- a/PWGCF/EbyEFluctuations/Tasks/meanPtFlucId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/meanPtFlucId.cxx @@ -75,6 +75,8 @@ struct MeanPtFlucId { Configurable cfgMcTofShiftPi{"cfgMcTofShiftPi", 0., "Pion Shift in TOF (MC data) "}; Configurable cfgMcTofShiftKa{"cfgMcTofShiftKa", 0., "Kaon Shift in TOF (MC data) "}; Configurable cfgMcTofShiftPr{"cfgMcTofShiftPr", 0., "Proton Shift in TOF (MC data) "}; + Configurable cfgPidCut{"cfgPidCut", false, ""}; + Configurable cfgPDGCodeOnly{"cfgPDGCodeOnly", true, ""}; Configurable cfgMCReco{"cfgMCReco", false, ""}; Configurable cfgMCTruth{"cfgMCTruth", false, ""}; Configurable cfgPosZ{"cfgPosZ", true, "Position Z"}; @@ -82,6 +84,7 @@ struct MeanPtFlucId { Configurable cfgEvSel1{"cfgEvSel1", true, "kNoSameBunchPileup"}; Configurable cfgEvSel2{"cfgEvSel2", true, "kIsGoodZvtxFT0vsPV"}; Configurable cfgEvSel3{"cfgEvSel3", true, "kIsVertexITSTPC"}; + Configurable cfgRejTrk{"cfgRejTrk", true, "Rejected Tracks"}; Configurable cfgInvMass{"cfgInvMass", true, "electron Inv Mass cut selection"}; Configurable cfgSelOR{"cfgSelOR", true, "Low OR High momentum "}; Configurable cfgSelAND{"cfgSelAND", false, "Low AND High momentum"}; @@ -674,7 +677,8 @@ struct MeanPtFlucId { void fillIdParticleQAHistos(T const& track, double rap, double nSigmaTPC, double nSigmaTOF, int& N, double& Q1, double& Q2, double& Q3, double& Q4) { N++; - moments(track.pt(), Q1, Q2, Q3, Q4); + double pt = track.pt(); + moments(pt, Q1, Q2, Q3, Q4); hist.fill(HIST(Dire[Mode]) + HIST("h_Pt"), track.pt()); if (track.sign() > 0) @@ -901,6 +905,113 @@ struct MeanPtFlucId { continue; } + //______________________________Reconstructed Level____________________________________________________// + + if (selTrack(track)) { + double nSigmaTPCPi = track.tpcNSigmaPi(); + double nSigmaTPCKa = track.tpcNSigmaKa(); + double nSigmaTPCPr = track.tpcNSigmaPr(); + double nSigmaTOFPi = track.tofNSigmaPi(); + double nSigmaTOFKa = track.tofNSigmaKa(); + double nSigmaTOFPr = track.tofNSigmaPr(); + double rapPi = track.rapidity(MassPiPlus); + double rapKa = track.rapidity(MassKPlus); + double rapPr = track.rapidity(MassProton); + double innerParam = track.tpcInnerParam(); + + if (std::fabs(track.eta()) < 0.8) { + nCh++; + ptCh = track.pt(); + moments(ptCh, q1Ch, q2Ch, q3Ch, q4Ch); + fillChargedQAHistos(track); + } + fillBeforePIDQAHistos(track); + + if (cfgRejTrk == true && rejectTracks(track)) { + return; + } + + if (cfgInvMass == true && invMassGamma < cfgGammaCut) { + continue; + } + + if (cfgPDGCodeOnly == true) { + if (std::abs(pid) == kPiPlus && std::abs(rapPi) < 0.5 && track.pt() >= cfgCutPiPtMin) { + ptPi = track.pt(); + fillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, nPi, q1Pi, q2Pi, q3Pi, q4Pi); + fillPtMCHist(ptPi, pid, kPiPlus, kPiMinus); + } + + if (std::abs(pid) == kKPlus && std::abs(rapKa) < 0.5 && track.pt() >= cfgCutKaPtMin) { + ptKa = track.pt(); + fillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, nKa, q1Ka, q2Ka, q3Ka, q4Ka); + fillPtMCHist(ptKa, pid, kKPlus, kKMinus); + } + + if (std::abs(pid) == kProton && std::abs(rapPr) < 0.5 && track.pt() >= cfgCutPrPtMin) { + ptPr = track.pt(); + fillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, nPr, q1Pr, q2Pr, q3Pr, q4Pr); + fillPtMCHist(ptPr, pid, kProton, kProtonBar); + } + } + + if (cfgPidCut == true) { + if (cfgSelOR == true && cfgSelAND == false) { + if (selLowPi(track, innerParam) == cfgSelLow || selHighPi(track) == cfgSelHigh) { + ptPi = track.pt(); + fillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, nPi, q1Pi, q2Pi, q3Pi, q4Pi); + if (std::abs(pid) == kPiPlus) { + fillPtMCHist(ptPi, pid, kPiPlus, kPiMinus); + } + } + } else if (cfgSelOR == false && cfgSelAND == true) { + if (selLowPi(track, innerParam) == cfgSelLow && selHighPi(track) == cfgSelHigh) { + ptPi = track.pt(); + fillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, nPi, q1Pi, q2Pi, q3Pi, q4Pi); + if (std::abs(pid) == kPiPlus) { + fillPtMCHist(ptPi, pid, kPiPlus, kPiMinus); + } + } + } + + if (cfgSelOR == true && cfgSelAND == false) { + if (selLowKa(track, innerParam) == cfgSelLow || selHighKa(track) == cfgSelHigh) { + ptKa = track.pt(); + fillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, nKa, q1Ka, q2Ka, q3Ka, q4Ka); + if (std::abs(pid) == kKPlus) { + fillPtMCHist(ptKa, pid, kKPlus, kKMinus); + } + } + } else if (cfgSelOR == false && cfgSelAND == true) { + if (selLowKa(track, innerParam) == cfgSelLow && selHighKa(track) == cfgSelHigh) { + ptKa = track.pt(); + fillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, nKa, q1Ka, q2Ka, q3Ka, q4Ka); + if (std::abs(pid) == kKPlus) { + fillPtMCHist(ptKa, pid, kKPlus, kKMinus); + } + } + } + + if (cfgSelOR == true && cfgSelAND == false) { + if (selLowPr(track, innerParam) == cfgSelLow || selHighPr(track) == cfgSelHigh) { + ptPr = track.pt(); + fillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, nPr, q1Pr, q2Pr, q3Pr, q4Pr); + if (std::abs(pid) == kProton) { + fillPtMCHist(ptPr, pid, kProton, kProtonBar); + } + } + } else if (cfgSelOR == false && cfgSelAND == true) { + if (selLowPr(track, innerParam) == cfgSelLow && selHighPr(track) == cfgSelHigh) { + ptPr = track.pt(); + fillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, nPr, q1Pr, q2Pr, q3Pr, q4Pr); + if (std::abs(pid) == kProton) { + fillPtMCHist(ptPr, pid, kProton, kProtonBar); + } + } + } + } + } + //___________________________________Truth Level____________________________________________________// auto charge = 0.; auto* pd = pdg->GetParticle(pid); @@ -918,15 +1029,19 @@ struct MeanPtFlucId { } if (mcPart.pt() > cfgCutPtMin && mcPart.pt() < cfgCutPtMax) { - if (std::abs(mcPart.y()) > cfgCutRap) { + + if (std::abs(mcPart.eta()) > 0.8) { continue; } - nChSim++; ptChSim = mcPart.pt(); moments(ptChSim, q1ChSim, q2ChSim, q3ChSim, q4ChSim); hist.fill(HIST("Gen/Charged/h_PtTruth"), mcPart.pt()); + if (std::abs(mcPart.y()) > cfgCutRap) { + continue; + } + if (std::abs(pid) == kPiPlus && mcPart.pt() >= cfgCutPiPtMin) { if (cfgSelOR == true && cfgSelAND == false) { if (mcPart.p() <= cfgCutPiThrsldP || mcPart.p() > cfgCutPiThrsldP) { @@ -981,56 +1096,6 @@ struct MeanPtFlucId { } } } - - //______________________________Reconstructed Level____________________________________________________// - - if (!selTrack(track)) { - continue; - } - - double nSigmaTPCPi = track.tpcNSigmaPi(); - double nSigmaTPCKa = track.tpcNSigmaKa(); - double nSigmaTPCPr = track.tpcNSigmaPr(); - double nSigmaTOFPi = track.tofNSigmaPi(); - double nSigmaTOFKa = track.tofNSigmaKa(); - double nSigmaTOFPr = track.tofNSigmaPr(); - double rapPi = track.rapidity(MassPiPlus); - double rapKa = track.rapidity(MassKPlus); - double rapPr = track.rapidity(MassProton); - - if (std::fabs(track.eta()) < 0.8) { - nCh++; - ptCh = track.pt(); - moments(ptCh, q1Ch, q2Ch, q3Ch, q4Ch); - fillChargedQAHistos(track); - } - fillBeforePIDQAHistos(track); - - if (rejectTracks(track)) { - return; - } - - if (cfgInvMass == true && invMassGamma < cfgGammaCut) { - continue; - } - - if (std::abs(pid) == kPiPlus && track.pt() >= cfgCutPiPtMin) { - ptPi = track.pt(); - fillIdParticleQAHistos(track, rapPi, nSigmaTPCPi, nSigmaTOFPi, nPi, q1Pi, q2Pi, q3Pi, q4Pi); - fillPtMCHist(ptPi, pid, kPiPlus, kPiMinus); - } - - if (std::abs(pid) == kKPlus && track.pt() >= cfgCutKaPtMin) { - ptKa = track.pt(); - fillIdParticleQAHistos(track, rapKa, nSigmaTPCKa, nSigmaTOFKa, nKa, q1Ka, q2Ka, q3Ka, q4Ka); - fillPtMCHist(ptKa, pid, kKPlus, kKMinus); - } - - if (std::abs(pid) == kProton && track.pt() >= cfgCutPrPtMin) { - ptPr = track.pt(); - fillIdParticleQAHistos(track, rapPr, nSigmaTPCPr, nSigmaTOFPr, nPr, q1Pr, q2Pr, q3Pr, q4Pr); - fillPtMCHist(ptPr, pid, kProton, kProtonBar); - } } hist.fill(HIST("QA/after/h_vtxZSim"), col.mcCollision().posZ()); } From f465ed8550c2facaec573028cbeb9490cd12241d Mon Sep 17 00:00:00 2001 From: Thorkj <154221526+Thorkj@users.noreply.github.com> Date: Fri, 13 Dec 2024 08:44:51 +0100 Subject: [PATCH 367/459] [PWGCF] Changed from THnSparseD to THnSparseF because of memory issue (#8927) Co-authored-by: Thor Jensen Co-authored-by: Victor Gonzalez --- PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx index 49d9a573de9..e61155d2a48 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx @@ -61,8 +61,8 @@ struct CorrSparse { registry.add("pT", "pT", {HistType::kTH1D, {axisPtTrigger}}); registry.add("Nch", "N_{ch}", {HistType::kTH1D, {axisMultiplicity}}); - registry.add("Sparse_mixed", "", {HistType::kTHnSparseD, {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); // Make the output sparse - registry.add("Sparse_same", "", {HistType::kTHnSparseD, {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); + registry.add("Sparse_mixed", "", {HistType::kTHnSparseF, {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); // Make the output sparse + registry.add("Sparse_same", "", {HistType::kTHnSparseF, {{axisVertex, axisPtTrigger, axisPtAssoc, axisMultiplicity, axisDeltaPhi, axisDeltaEta}}}); const int maxMixBin = axisMultiplicity->size() * axisVertex->size(); registry.add("eventcount", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}}); // histogram to see how many events are in the same and mixed event From f54c9afe1c1ba08e0a76ffeffe68ebaf86622a25 Mon Sep 17 00:00:00 2001 From: Antonio Palasciano <52152842+apalasciano@users.noreply.github.com> Date: Fri, 13 Dec 2024 08:54:49 +0100 Subject: [PATCH 368/459] [PWGHF,Trigger] Beauty 2nd Vertex in triggers (#8895) --- EventFiltering/PWGHF/HFFilter.cxx | 105 +++++++++++++++++++---- EventFiltering/PWGHF/HFFilterHelpers.h | 113 +++++++++++++++++++++++++ 2 files changed, 203 insertions(+), 15 deletions(-) diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index 3abef8e28a9..9342beee317 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -19,19 +19,27 @@ /// \author Biao Zhang , CCNU /// \author Federica Zanone , Heidelberg University +#include +#include +#include +#include + #include "TRandom3.h" #include "CommonConstants/PhysicsConstants.h" #include "CCDB/BasicCCDBManager.h" #include "DataFormatsParameters/GRPMagField.h" #include "DataFormatsParameters/GRPObject.h" +#include "DCAFitter/DCAFitterN.h" #include "DetectorsBase/Propagator.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" #include "Framework/ASoAHelpers.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/DCA.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" @@ -41,6 +49,7 @@ #include "EventFiltering/filterTables.h" #include "EventFiltering/PWGHF/HFFilterHelpers.h" +#include "PWGHF/Utils/utilsTrkCandHf.h" using namespace o2; using namespace o2::analysis; @@ -59,6 +68,7 @@ struct HfFilter { // Main struct for HF triggers Configurable activateQA{"activateQA", 0, "flag to enable QA histos (0 no QA, 1 basic QA, 2 extended QA, 3 very extended QA)"}; Configurable applyEventSelection{"applyEventSelection", true, "flag to enable event selection (sel8 + Zvt and possibly time-frame border cut)"}; Configurable applyTimeFrameBorderCut{"applyTimeFrameBorderCut", true, "flag to enable time-frame border cut"}; + Configurable activateSecVtx{"activateSecVtx", false, "flag to enable 2nd vertex fitting - only beauty hadrons"}; // parameters for all triggers // nsigma PID (except for V0 and cascades) @@ -76,6 +86,8 @@ struct HfFilter { // Main struct for HF triggers Configurable> cutsTrackBeauty4Prong{"cutsTrackBeauty4Prong", {hf_cuts_single_track::cutsTrack[0], hf_cuts_single_track::nBinsPtTrack, hf_cuts_single_track::nCutVarsTrack, hf_cuts_single_track::labelsPtTrack, hf_cuts_single_track::labelsCutVarTrack}, "Single-track selections per pT bin for 4-prong beauty candidates"}; Configurable paramCharmMassShape{"paramCharmMassShape", "2023_pass3", "Parametrisation of charm-hadron mass shape (options: 2023_pass3)"}; Configurable numSigmaDeltaMassCharmHad{"numSigmaDeltaMassCharmHad", 2.5, "Number of sigma for charm-hadron delta mass cut in B and D resonance triggers"}; + Configurable> pTBinsBHadron{"pTBinsBHadron", std::vector{hf_trigger_cuts_presel_beauty::vecBinsPt}, "pT bin limits for beauty hadrons preselections"}; + Configurable> cutsBplus{"cutsBplus", {hf_trigger_cuts_presel_beauty::cuts[0], hf_trigger_cuts_presel_beauty::nBinsPt, hf_trigger_cuts_presel_beauty::nCutVars, hf_trigger_cuts_presel_beauty::labelsPt, hf_trigger_cuts_presel_beauty::labelsRowsTopolBeauty}, "B+ candidate selection per pT bin"}; // parameters for femto triggers Configurable femtoMaxRelativeMomentum{"femtoMaxRelativeMomentum", 2., "Maximal allowed value for relative momentum between charm-proton pairs in GeV/c"}; @@ -135,6 +147,9 @@ struct HfFilter { // Main struct for HF triggers // array of BDT thresholds std::array, kNCharmParticles> thresholdBDTScores; + o2::vertexing::DCAFitterN<2> df2; // fitter for Charm Hadron vertex (2-prong vertex fitter) + o2::vertexing::DCAFitterN<2> dfB; // fitter for Beauty Hadron vertex (2-prong vertex fitter) + HistogramRegistry registry{"registry"}; std::shared_ptr hProcessedEvents; @@ -151,6 +166,9 @@ struct HfFilter { // Main struct for HF triggers std::array, kNV0> hArmPod{}; std::shared_ptr hV0Selected; std::shared_ptr hMassXi; + std::array, kNBeautyParticles> hCpaVsPtB{}; + std::array, kNBeautyParticles> hDecayLengthVsPtB{}; + std::array, kNBeautyParticles> hImpactParamProductVsPtB{}; // material correction for track propagation o2::base::MatLayerCylSet* lut; @@ -164,12 +182,14 @@ struct HfFilter { // Main struct for HF triggers { helper.setHighPtTriggerThresholds(ptThresholds->get(0u, 0u), ptThresholds->get(0u, 1u)); helper.setPtBinsSingleTracks(pTBinsTrack); + helper.setPtBinsBeautyHadrons(pTBinsBHadron); helper.setPtLimitsBeautyBachelor(ptCuts->get(0u, 0u), ptCuts->get(1u, 0u)); helper.setPtLimitsDstarSoftPion(ptCuts->get(0u, 1u), ptCuts->get(1u, 1u)); helper.setPtLimitsProtonForFemto(ptCuts->get(0u, 2u), ptCuts->get(1u, 2u)); helper.setPtLimitsCharmBaryonBachelor(ptCuts->get(0u, 3u), ptCuts->get(1u, 3u)); helper.setCutsSingleTrackBeauty(cutsTrackBeauty3Prong, cutsTrackBeauty4Prong); helper.setCutsSingleTrackCharmBaryonBachelor(cutsTrackCharmBaryonBachelor); + helper.setCutsBplus(cutsBplus); helper.setPtThresholdPidStrategyForFemto(ptThresholdForFemtoPid); helper.setNsigmaProtonCutsForFemto(std::array{nSigmaPidCuts->get(0u, 3u), nSigmaPidCuts->get(1u, 3u), nSigmaPidCuts->get(2u, 3u)}); helper.setNsigmaProtonCutsForCharmBaryons(nSigmaPidCuts->get(0u, 0u), nSigmaPidCuts->get(1u, 0u)); @@ -184,7 +204,10 @@ struct HfFilter { // Main struct for HF triggers helper.setPtRangeSoftPiSigmaC(ptCuts->get(0u, 4u), ptCuts->get(1u, 4u)); helper.setPtDeltaMassRangeSigmaC(cutsPtDeltaMassCharmReso->get(0u, 6u), cutsPtDeltaMassCharmReso->get(1u, 6u), cutsPtDeltaMassCharmReso->get(0u, 7u), cutsPtDeltaMassCharmReso->get(1u, 7u), cutsPtDeltaMassCharmReso->get(0u, 8u), cutsPtDeltaMassCharmReso->get(1u, 8u), cutsPtDeltaMassCharmReso->get(0u, 9u), cutsPtDeltaMassCharmReso->get(1u, 9u), cutsPtDeltaMassCharmReso->get(2u, 6u), cutsPtDeltaMassCharmReso->get(2u, 7u), cutsPtDeltaMassCharmReso->get(2u, 8u), cutsPtDeltaMassCharmReso->get(2u, 9u)); helper.setPtRangeSoftKaonXicResoToSigmaC(ptCuts->get(0u, 5u), ptCuts->get(1u, 5u)); - + if (activateSecVtx) { + helper.setVtxConfiguration(df2, false); // (DCAFitterN, useAbsDCA) + helper.setVtxConfiguration(dfB, true); + } hProcessedEvents = registry.add("fProcessedEvents", "HF - event filtered;;counts", HistType::kTH1F, {{kNtriggersHF + 2, -0.5, +kNtriggersHF + 1.5}}); for (auto iBin = 0; iBin < kNtriggersHF + 2; ++iBin) { if (iBin < 2) @@ -230,7 +253,21 @@ struct HfFilter { // Main struct for HF triggers for (int iBeautyPart{0}; iBeautyPart < kNBeautyParticles; ++iBeautyPart) { hMassVsPtB[iBeautyPart] = registry.add(Form("fMassVsPt%s", beautyParticleNames[iBeautyPart].data()), Form("#it{M} vs. #it{p}_{T} distribution of triggered %s candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", beautyParticleNames[iBeautyPart].data()), HistType::kTH2F, {ptAxis, massAxisB[iBeautyPart]}); + hCpaVsPtB[iBeautyPart] = registry.add(Form("fCpaVsPt%s", beautyParticleNames[iBeautyPart].data()), Form("CPA vs. #it{p}_{T} distribution of triggered %s candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", beautyParticleNames[iBeautyPart].data()), HistType::kTH2F, {ptAxis, {100, -1, 1}}); + hDecayLengthVsPtB[iBeautyPart] = registry.add(Form("fDecayLengthVsPt%s", beautyParticleNames[iBeautyPart].data()), Form("DecayLength vs. #it{p}_{T} distribution of triggered %s candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", beautyParticleNames[iBeautyPart].data()), HistType::kTH2F, {ptAxis, {100, 0, 20}}); + hImpactParamProductVsPtB[iBeautyPart] = registry.add(Form("fImpactParamProductVsPt%s", beautyParticleNames[iBeautyPart].data()), Form("ImpactParamProduct vs. #it{p}_{T} distribution of triggered %s candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", beautyParticleNames[iBeautyPart].data()), HistType::kTH2F, {ptAxis, {100, -2.5, +2.5}}); + } + constexpr int kNBinsHfVtxStages = kNHfVtxStage; + std::string labels[kNBinsHfVtxStages]; + labels[HfVtxStage::Skimmed] = "Skimm CharmHad-Pi pairs"; + labels[HfVtxStage::BeautyVertex] = "vertex CharmHad-Pi pairs"; + labels[HfVtxStage::CharmHadPiSelected] = "selected CharmHad-Pi pairs"; + static const AxisSpec axisHfVtxStages = {kNBinsHfVtxStages, 0.5, kNBinsHfVtxStages + 0.5, ""}; + registry.add("fHfVtxStages", "HfVtxStages;;entries", HistType::kTH1F, {axisHfVtxStages}); + for (int iBin = 0; iBin < kNBinsHfVtxStages; iBin++) { + registry.get(HIST("fHfVtxStages"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); } + for (int iV0{kPhoton}; iV0 < kNV0; ++iV0) { hArmPod[iV0] = registry.add(Form("fArmPod%s", v0Names[iV0].data()), Form("Armenteros Podolanski plot for selected %s;#it{#alpha};#it{q}_{T} (GeV/#it{c})", v0Labels[iV0].data()), HistType::kTH2F, {alphaAxis, qtAxis}); } @@ -267,7 +304,7 @@ struct HfFilter { // Main struct for HF triggers } using BigTracksMCPID = soa::Join; - using BigTracksPID = soa::Join; + using BigTracksPID = soa::Join; using CollsWithEvSel = soa::Join; using Hf2ProngsWithMl = soa::Join; @@ -342,8 +379,8 @@ struct HfFilter { // Main struct for HF triggers continue; } - auto trackParPos = getTrackPar(trackPos); - auto trackParNeg = getTrackPar(trackNeg); + auto trackParPos = getTrackParCov(trackPos); + auto trackParNeg = getTrackParCov(trackNeg); o2::gpu::gpustd::array dcaPos{trackPos.dcaXY(), trackPos.dcaZ()}; o2::gpu::gpustd::array dcaNeg{trackNeg.dcaXY(), trackNeg.dcaZ()}; std::array pVecPos{trackPos.pVector()}; @@ -418,7 +455,7 @@ struct HfFilter { // Main struct for HF triggers continue; } - auto trackParThird = getTrackPar(track); + auto trackParThird = getTrackParCov(track); o2::gpu::gpustd::array dcaThird{track.dcaXY(), track.dcaZ()}; std::array pVecThird = track.pVector(); if (track.collisionId() != thisCollId) { @@ -432,14 +469,52 @@ struct HfFilter { // Main struct for HF triggers auto massCand = RecoDecay::m(std::array{pVec2Prong, pVecThird}, std::array{massD0, massPi}); auto pVecBeauty3Prong = RecoDecay::pVec(pVec2Prong, pVecThird); auto ptCand = RecoDecay::pt(pVecBeauty3Prong); - if (TESTBIT(isTrackSelected, kForBeauty) && std::fabs(massCand - massBPlus) <= deltaMassBeauty->get(0u, 0u)) { - keepEvent[kBeauty3P] = true; - // fill optimisation tree for D0 - if (applyOptimisation) { - optimisationTreeBeauty(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scores[0], scores[1], scores[2], dcaThird[0]); - } + if (TESTBIT(isTrackSelected, kForBeauty) && helper.isSelectedBplusInMassRange(ptCand, massCand)) { if (activateQA) { - hMassVsPtB[kBplus]->Fill(ptCand, massCand); + registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::Skimmed); + } + if (!activateSecVtx) { + keepEvent[kBeauty3P] = true; + // fill optimisation tree for D0 + if (applyOptimisation) { + optimisationTreeBeauty(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scores[0], scores[1], scores[2], dcaThird[0]); + } + if (activateQA) { + hMassVsPtB[kBplus]->Fill(ptCand, massCand); + } + } else { + df2.process(trackParPos, trackParNeg); + df2.getTrack(0).getPxPyPzGlo(pVecPos); + df2.getTrack(1).getPxPyPzGlo(pVecNeg); + auto trackParD = df2.createParentTrackParCov(); + trackParD.setAbsCharge(0); // to be sure + auto pVec2Prong = RecoDecay::pVec(pVecPos, pVecNeg); + if (dfB.process(trackParD, trackParThird) != 0) { + if (activateQA) { + registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::BeautyVertex); + } + const auto& secondaryVertexBplus = dfB.getPCACandidate(); + dfB.propagateTracksToVertex(); + dfB.getTrack(0).getPxPyPzGlo(pVec2Prong); + dfB.getTrack(1).getPxPyPzGlo(pVecThird); + o2::gpu::gpustd::array dca2Prong; //{trackParD.dcaXY(), trackParD.dcaZ()}; + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParD, 2.f, noMatCorr, &dca2Prong); + bool isBplus = helper.isSelectedBplus(pVec2Prong, pVecThird, dca2Prong, dcaThird, std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexBplus[0], secondaryVertexBplus[1], secondaryVertexBplus[2]}); + if (isBplus) { + keepEvent[kBeauty3P] = true; + // fill optimisation tree for D0 + if (applyOptimisation) { + optimisationTreeBeauty(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scores[0], scores[1], scores[2], dcaThird[0]); + } + if (activateQA) { + registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::CharmHadPiSelected); + hCpaVsPtB[kBplus]->Fill(RecoDecay::pt(RecoDecay::pVec(pVec2Prong, pVecThird)), RecoDecay::cpa(std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexBplus[0], secondaryVertexBplus[1], secondaryVertexBplus[2]}, RecoDecay::pVec(pVec2Prong, pVecThird))); + hDecayLengthVsPtB[kBplus]->Fill(RecoDecay::pt(RecoDecay::pVec(pVec2Prong, pVecThird)), RecoDecay::distance(std::array{static_cast(collision.posX()), static_cast(collision.posY()), static_cast(collision.posZ())}, std::array{secondaryVertexBplus[0], secondaryVertexBplus[1], secondaryVertexBplus[2]})); + hImpactParamProductVsPtB[kBplus]->Fill(RecoDecay::pt(RecoDecay::pVec(pVec2Prong, pVecThird)), dca2Prong[0] * dcaThird[0]); + hMassVsPtB[kBplus]->Fill(ptCand, massCand); + } + } + } } } } @@ -990,9 +1065,9 @@ struct HfFilter { // Main struct for HF triggers } } } // end SigmaC++ candidate - } // end loop over tracks (soft pi) - } // end candidate Lc->pKpi - } // end loop over tracks + } // end loop over tracks (soft pi) + } // end candidate Lc->pKpi + } // end loop over tracks // Ds with photon bool isGoodDsToKKPi = (isSignalTagged[kDs - 1]) && TESTBIT(is3ProngInMass[kDs - 1], 0); diff --git a/EventFiltering/PWGHF/HFFilterHelpers.h b/EventFiltering/PWGHF/HFFilterHelpers.h index 921bb98103e..f38ed71f5eb 100644 --- a/EventFiltering/PWGHF/HFFilterHelpers.h +++ b/EventFiltering/PWGHF/HFFilterHelpers.h @@ -129,6 +129,13 @@ enum V0Species { kNV0 }; +enum HfVtxStage : uint8_t { + Skimmed = 0, + BeautyVertex, + CharmHadPiSelected, + kNHfVtxStage +}; + static const std::array charmParticleNames{"D0", "Dplus", "Ds", "Lc", "Xic"}; static const std::array beautyParticleNames{"Bplus", "B0toDStar", "B0", "Bs", "Lb", "Xib"}; static const std::array pdgCodesCharm{421, 411, 431, 4122, 4232}; @@ -205,6 +212,28 @@ static const std::vector labelsColumnsHighPtThresholds = {"2Prongs" constexpr float cutsDeltaMassB[1][kNBeautyParticles] = {{0.4, 0.4, 0.4, 0.4, 0.4, 0.4}}; // B+, B0, B0toDstar, Bs, Lb, Xib static const std::vector labelsColumnsDeltaMassB = {"Bplus", "BZero", "BZeroToDstar", "Bs", "Lb", "Xib"}; +namespace hf_trigger_cuts_presel_beauty +{ +static constexpr int nBinsPt = 2; +static constexpr int nCutVars = 4; +// default values for the pT bin edges (can be used to configure histogram axis) +// common for any beauty candidate +constexpr double binsPt[nBinsPt + 1] = { + 1., + 5., + 1000.0}; +auto vecBinsPt = std::vector{binsPt, binsPt + nBinsPt + 1}; +// default values for the cuts +constexpr double cuts[nBinsPt][nCutVars] = {{0.4, -1, -1, 10.}, /* 1 < pt < 5 */ + {0.4, -1, -1, 10.}}; /* 5 < pt < 1000 */ + +// row labels +static const std::vector labelsPt{}; +// column labels +static const std::vector labelsRowsTopolBeauty = {"DeltaMassB", "minCPA", "minDecayLength", "maxImpParProd"}; + +} // namespace hf_trigger_cuts_presel_beauty + // double charm constexpr int activeDoubleCharmChannels[1][3] = {{1, 1, 1}}; // kDoubleCharm2P, kDoubleCharm3P, kDoubleCharmMix static const std::vector labelsColumnsDoubleCharmChannels = {"DoubleCharm2Prong", "DoubleCharm3Prong", "DoubleCharmMix"}; @@ -249,11 +278,16 @@ class HfFilterHelper mPtThresholdHighPt3Prongs = threshold3Prongs; } void setPtBinsSingleTracks(std::vector ptBins) { mPtBinsTracks = ptBins; } + void setPtBinsBeautyHadrons(std::vector ptBins) { mPtBinsBeautyHadrons = ptBins; } void setCutsSingleTrackBeauty(o2::framework::LabeledArray cutsSingleTrack3P, o2::framework::LabeledArray cutsSingleTrack4P) { mCutsSingleTrackBeauty3Prong = cutsSingleTrack3P; mCutsSingleTrackBeauty4Prong = cutsSingleTrack4P; } + void setCutsBplus(o2::framework::LabeledArray cutsBeautyHadrons) + { + mCutsBplus = cutsBeautyHadrons; + } void setPtLimitsProtonForFemto(float minPt, float maxPt) { mPtMinProtonForFemto = minPt; @@ -410,6 +444,10 @@ class HfFilterHelper int8_t isBDTSelected(const T& scores, const U& thresholdBDTScores); template bool isSelectedKaonFromXicResoToSigmaC(const T& track); + template + inline bool isSelectedBplus(T1 const& pVecTrack0, T1 const& pVecTrack1, T2 const& dcaTrack0, T2 const& dcaTrack1, const T3& primVtx, const T4& secVtx); + template + inline bool isSelectedBplusInMassRange(T1 const& ptCand, T2 const& massCand); template inline bool isCharmHadronMassInSbRegions(T1 const& massHypo1, T1 const& massHypo2, const float& lowLimitSB, const float& upLimitSB); @@ -418,6 +456,8 @@ class HfFilterHelper T computeRelativeMomentum(const std::array& pTrack, const std::array& CharmCandMomentum, const T& CharmMass); template int computeNumberOfCandidates(std::vector> indices); + template + inline int setVtxConfiguration(T1 vertexer, bool useAbsDCA); // PID void setValuesBB(o2::ccdb::CcdbApi& ccdbApi, aod::BCsWithTimestamps::iterator const& bunchCrossing, const std::array& ccdbPaths); @@ -442,6 +482,7 @@ class HfFilterHelper // selections std::vector mPtBinsTracks{}; // vector of pT bins for single track cuts + std::vector mPtBinsBeautyHadrons{}; // vector of pT bins for beauty hadron candidates o2::framework::LabeledArray mCutsSingleTrackBeauty3Prong{}; // dca selections for the 3-prong b-hadron pion daughter o2::framework::LabeledArray mCutsSingleTrackBeauty4Prong{}; // dca selections for the 4-prong b-hadron pion daughter float mPtMinSoftPionForDstar{0.1}; // minimum pt for the D*+ soft pion @@ -502,6 +543,7 @@ class HfFilterHelper float mPtThresholdHighPt3Prongs{8.}; // threshold for high pT triggers for 3-prongs float mNSigmaTpcKaonFromXicResoToSigmaC{3.}; // maximum Nsigma TPC for kaons in Xic*->SigmaC-Kaon float mNSigmaTofKaonFromXicResoToSigmaC{3.}; // maximum Nsigma TOF for kaons in Xic*->SigmaC-Kaon + o2::framework::LabeledArray mCutsBplus{}; // selections for B+ candidates (DeltaMass, CPA, DecayLength, ImpactParameterProduct) // PID recalibrations int mTpcPidCalibrationOption{0}; // Option for TPC PID calibration (0 -> AO2D, 1 -> postcalibrations, 2 -> alternative bethe bloch parametrisation) @@ -1617,6 +1659,61 @@ inline bool HfFilterHelper::isSelectedKaon4Charm3Prong(const T& track) return true; } +/// Method to perform selections for B+ candidates after vertex reconstruction +/// \param pVecTrack0 is the array for the candidate D daughter momentum after reconstruction of secondary vertex +/// \param pVecTrack1 is the array for the candidate bachelor pion momentum after reconstruction of secondary vertex +/// \param dcaTrack0 is the dca of the D daughter track +/// \param dcaTrack1 is the dca of the pion daughter track +/// \param primVtx is the primary vertex +/// \param secVtx is the secondary vertex +/// \param cuts B+ candidate pre-selection per pT bin +/// \return true if the beauty candidate passes all cuts +template +inline bool HfFilterHelper::isSelectedBplus(T1 const& pVecTrack0, T1 const& pVecTrack1, T2 const& dcaTrack0, T2 const& dcaTrack1, const T3& primVtx, const T4& secVtx) +{ + auto pVecB = RecoDecay::pVec(pVecTrack0, pVecTrack1); + auto pTB = RecoDecay::pt(pVecB); + auto binPtB = findBin(mPtBinsBeautyHadrons, pTB); + if (binPtB == -1) { + return false; + } + auto cpa = RecoDecay::cpa(primVtx, secVtx, pVecB); + auto decayLength = RecoDecay::distance(primVtx, secVtx); + auto impactParameterProduct = dcaTrack0[0] * dcaTrack1[0]; + + if (cpa < mCutsBplus.get(binPtB, 1u)) { + return false; + } + if (decayLength < mCutsBplus.get(binPtB, 2u)) { + return false; + } + if (impactParameterProduct > mCutsBplus.get(binPtB, 3u)) { + return false; + } + + return true; +} + +/// Method to perform selections for B+ candidates after vertex reconstruction +/// \param ptCand is the pT of the beauty candidate +/// \param massCand is the mass of the beauty candidate +/// \param ptBins is the array of pT bin limits +/// \param cuts B+ candidate pre-selection per pT bin +/// \return true if the beauty candidate passes all cuts +template +inline bool HfFilterHelper::isSelectedBplusInMassRange(T1 const& ptCand, T2 const& massCand) +{ + auto binPtB = findBin(mPtBinsBeautyHadrons, ptCand); + if (binPtB == -1) { + return false; + } + if (std::fabs(massCand - massBPlus) > mCutsBplus.get(binPtB, 0u)) { + return false; + } + + return true; +} + /// Method to check if charm candidates has mass between sideband limits /// \param massHypo1 is the array for the candidate D daughter momentum after reconstruction of secondary vertex /// \param massHypo2 is the array for the candidate bachelor pion momentum after reconstruction of secondary vertex @@ -1723,6 +1820,22 @@ inline int HfFilterHelper::findBin(T1 const& binsPt, T2 value) return std::distance(binsPt.begin(), std::upper_bound(binsPt.begin(), binsPt.end(), value)) - 1; } +/// Set vertxing configuration +/// \param vertexer o2::vertexing::DCAFitterN object +template +inline int HfFilterHelper::setVtxConfiguration(T1 vertexer, bool useAbsDCA) +{ + // Fitter initialisation + vertexer.setPropagateToPCA(true); + vertexer.setMaxR(200.); + vertexer.setMaxDZIni(4.); + vertexer.setMinParamChange(1.e-3); + vertexer.setMinRelChi2Change(0.9); + vertexer.setUseAbsDCA(useAbsDCA); + vertexer.setWeightedFinalPCA(false); + return 1; +} + } // namespace hffilters /// definition of tables From 5465f61a4d72bdf4c52507fac64f3bf0ff77555b Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Fri, 13 Dec 2024 08:57:35 +0100 Subject: [PATCH 369/459] [PWGHF] Remove obsolete cut in Dstar selector (#8963) --- PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx b/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx index 6445241d318..90115a3f257 100644 --- a/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx @@ -215,8 +215,7 @@ struct HfCandidateSelectorDstarToD0Pi { // decay exponentail law, with tau = beta*gamma*ctau // decay length > ctau retains (1-1/e) - double decayLengthCut = std::min((candidate.pD0() * 0.0066) + 0.01, cutsD0->get(binPt, "min decay length")); - if (candidate.decayLengthD0() * candidate.decayLengthD0() < decayLengthCut * decayLengthCut) { + if (candidate.decayLengthD0() < cutsD0->get(binPt, "min decay length")) { return false; } if (candidate.decayLengthD0() > cutsD0->get(binPt, "max decay length")) { From 0687c8da95d20697d26b2be70768907b37627488 Mon Sep 17 00:00:00 2001 From: Sandeep Dudi <69388148+sdudi123@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:42:11 +0530 Subject: [PATCH 370/459] [PWGUD] Track combination policy is fixed (#8960) Co-authored-by: Sandeep Dudi Co-authored-by: rolavick --- PWGUD/Tasks/sginclusivePhiKstarSD.cxx | 46 +++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx index bb9c8f051bc..601de7ec349 100644 --- a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx +++ b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx @@ -591,7 +591,13 @@ struct SGResonanceAnalyzer { } } } - if (kstar && selectionPIDKaon1(t0) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(t1) && std::abs(t1.tpcNSigmaKa()) > 3.0) { + } + for (auto& [t0, t1] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks, tracks))) { + if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) + continue; + if (t0.globalIndex() == t1.globalIndex()) + continue; + if (kstar && selectionPIDKaon1(t0) && selectionPIDPion1(t1)) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); @@ -656,7 +662,13 @@ struct SGResonanceAnalyzer { } } } - if (kstar && selectionPIDKaon1(t0) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(t1) && std::abs(t1.tpcNSigmaKa()) > 3.0) { + } + for (auto& [t0, t1] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks, tracks))) { + if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) + continue; + if (t0.globalIndex() == t1.globalIndex()) + continue; + if (kstar && selectionPIDKaon1(t0) && selectionPIDPion1(t1)) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); @@ -720,7 +732,13 @@ struct SGResonanceAnalyzer { } } } - if (kstar && selectionPIDKaon1(t0) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(t1) && std::abs(t1.tpcNSigmaKa()) > 3.0) { + } + for (auto& [t0, t1] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks, tracks))) { + if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) + continue; + if (t0.globalIndex() == t1.globalIndex()) + continue; + if (kstar && selectionPIDKaon1(t0) && selectionPIDPion1(t1)) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); @@ -756,6 +774,7 @@ struct SGResonanceAnalyzer { for (auto& [t0, t1] : combinations(tracks, tracks)) { if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) continue; + if (phi && selectionPIDKaon1(t0) && selectionPIDKaon1(t1)) { // Apply kaon hypothesis and create pairs v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); @@ -814,7 +833,13 @@ struct SGResonanceAnalyzer { } } } - if (rho && selectionPIDPion1(t0) && selectionPIDPion1(t1)) { + } + for (auto& [t0, t1] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks, tracks))) { + if (!trackselector(t0, parameters) || !trackselector(t1, parameters)) + continue; + if (t0.globalIndex() == t1.globalIndex()) + continue; + if (rho && selectionPIDProton(t0, use_tof, nsigmatpc_cut, nsigmatof_cut) && selectionPIDPion1(t1)) { v0.SetXYZM(t0.px(), t0.py(), t0.pz(), mproton); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); v01 = v0 + v1; @@ -842,7 +867,7 @@ struct SGResonanceAnalyzer { } } } - if (kstar && selectionPIDKaon1(t0) && std::abs(t0.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(t1) && std::abs(t1.tpcNSigmaKa()) > 3.0) { + if (kstar && selectionPIDKaon1(t0) && selectionPIDPion1(t1)) { v0.SetXYZM(t0.px(), t0.py(), t0.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassPionCharged); v01 = v0 + v1; @@ -968,7 +993,8 @@ struct SGResonanceAnalyzer { continue; auto posThisColl = posTracks->sliceByCached(aod::udtrack::udCollisionId, collision1.globalIndex(), cache); auto negThisColl = negTracks->sliceByCached(aod::udtrack::udCollisionId, collision2.globalIndex(), cache); - for (auto& [track1, track2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(posThisColl, negThisColl))) { + // for (auto& [track1, track2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(posThisColl, negThisColl))) { + for (auto& [track1, track2] : o2::soa::combinations(posThisColl, negThisColl)) { if (!trackselector(track1, parameters) || !trackselector(track2, parameters)) continue; if (selectionPIDKaon1(track1) && selectionPIDKaon1(track2)) { @@ -988,7 +1014,13 @@ struct SGResonanceAnalyzer { } } } - if (selectionPIDKaon1(track1) && std::abs(track1.tpcNSigmaPi()) > 3.0 && selectionPIDPion1(track2) && std::abs(track2.tpcNSigmaKa()) > 3.0) { + } + for (auto& [track1, track2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(posThisColl, negThisColl))) { + if (!trackselector(track1, parameters) || !trackselector(track2, parameters)) + continue; + if (track1.globalIndex() == track2.globalIndex()) + continue; + if (selectionPIDKaon1(track1) && selectionPIDPion1(track2)) { v0.SetXYZM(track1.px(), track1.py(), track1.pz(), o2::constants::physics::MassKaonCharged); v1.SetXYZM(track2.px(), track2.py(), track2.pz(), o2::constants::physics::MassPionCharged); v01 = v0 + v1; From 3c65fb1e7dd3c0d50b282b84dde169fe038f44ab Mon Sep 17 00:00:00 2001 From: Stefano Cannito <143754257+scannito@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:30:51 +0100 Subject: [PATCH 371/459] [PWGLF] Removed TLorentVector for associated particles in phik0sanalysis.cxx (#8941) --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 384 +++++++++------------ 1 file changed, 170 insertions(+), 214 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 11ef94f75ce..bb12b5260f3 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -9,6 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// +/// \file phik0sanalysis.cxx +/// \brief Analysis task for the Phi and K0S rapidity correlations analysis /// \author Stefano Cannito (stefano.cannito@cern.ch) #include @@ -22,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -59,7 +60,6 @@ struct phik0shortanalysis { HistogramRegistry PhicandHist{"PhicandHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry K0SHist{"K0SHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry PhipurHist{"PhipurHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry MCPhipurHist{"MCPhipurHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry PhiK0SHist{"PhiK0SHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry MCPhiK0SHist{"MCPhiK0SHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry PhiPionHist{"PhiPionHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -68,6 +68,7 @@ struct phik0shortanalysis { HistogramRegistry K0SeffHist{"K0SeffHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry PioneffHist{"PioneffHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry yaccHist{"yaccHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry closureMCPhipurHist{"closureMCPhipurHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry closureMCPhiK0SHist{"closureMCPhiK0SHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry closureMCPhiPionHist{"closureMCPhiPionHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -98,7 +99,7 @@ struct phik0shortanalysis { Configurable> binspTK0S{"binspTK0S", {0.0, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0}, "pT bin limits for K0S"}; // Configurables on Phi mass - Configurable nBins{"nBins", 14, "N bins in cfgPhimassaxis"}; + Configurable nBins{"nBins", 13, "N bins in cfgPhimassaxis"}; Configurable lowmPhi{"lowmPhiMB", 1.0095, "Upper limits on Phi mass for signal extraction"}; Configurable upmPhi{"upmPhiMB", 1.029, "Upper limits on Phi mass for signal extraction"}; @@ -155,6 +156,7 @@ struct phik0shortanalysis { // Defining the type of the V0s using FullV0s = soa::Filtered; + using FullMCV0s = soa::Join; // Defining the type of the tracks for data and MC using FullTracks = soa::Join; @@ -177,12 +179,6 @@ struct phik0shortanalysis { // Necessary to flag INEL>0 events in GenMC Service pdgDB; - typedef struct TLorentzVectorAndPID { - TLorentzVector fLorentzVector; - float fnSigmaTPC; - float fnSigmaTOF; - } TLorentzVectorAndPID; - void init(InitContext&) { // Axes @@ -263,15 +259,15 @@ struct phik0shortanalysis { PhipurHist.add("h3PhipurPiInvMassSCut", "Invariant mass of Phi for Purity (Pi) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); // MCPhi invariant mass for computing purities - MCPhipurHist.add("h2MCPhipurInvMass", "Invariant mass of Phi for Purity (no K0S/Pi)", kTH2F, {binnedmultAxis, PhimassAxis}); + closureMCPhipurHist.add("h2MCPhipurInvMass", "Invariant mass of Phi for Purity (no K0S/Pi)", kTH2F, {binnedmultAxis, PhimassAxis}); - MCPhipurHist.add("h3MCPhipurK0SInvMassInc", "Invariant mass of Phi for Purity (K0S) Inclusive", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); - MCPhipurHist.add("h3MCPhipurK0SInvMassFCut", "Invariant mass of Phi for Purity (K0S) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); - MCPhipurHist.add("h3MCPhipurK0SInvMassSCut", "Invariant mass of Phi for Purity (K0S) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); + closureMCPhipurHist.add("h3MCPhipurK0SInvMassInc", "Invariant mass of Phi for Purity (K0S) Inclusive", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); + closureMCPhipurHist.add("h3MCPhipurK0SInvMassFCut", "Invariant mass of Phi for Purity (K0S) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); + closureMCPhipurHist.add("h3MCPhipurK0SInvMassSCut", "Invariant mass of Phi for Purity (K0S) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptK0SAxis, PhimassAxis}); - MCPhipurHist.add("h3MCPhipurPiInvMassInc", "Invariant mass of Phi for Purity (Pi) Inclusive", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); - MCPhipurHist.add("h3MCPhipurPiInvMassFCut", "Invariant mass of Phi for Purity (Pi) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); - MCPhipurHist.add("h3MCPhipurPiInvMassSCut", "Invariant mass of Phi for Purity (Pi) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); + closureMCPhipurHist.add("h3MCPhipurPiInvMassInc", "Invariant mass of Phi for Purity (Pi) Inclusive", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); + closureMCPhipurHist.add("h3MCPhipurPiInvMassFCut", "Invariant mass of Phi for Purity (Pi) Deltay < FirstCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); + closureMCPhipurHist.add("h3MCPhipurPiInvMassSCut", "Invariant mass of Phi for Purity (Pi) Deltay < SecondCut", kTH3F, {binnedmultAxis, binnedptPiAxis, PhimassAxis}); // 2D mass for Phi and K0S for Data PhiK0SHist.add("h4PhiK0SSEInc", "2D Invariant mass of Phi and K0Short for Same Event Inclusive", kTHnSparseF, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis, sigPhimassAxis}); @@ -334,30 +330,33 @@ struct phik0shortanalysis { // GenMC Phi and Phi coupled to K0S and Pion PhieffHist.add("h1PhiGenMC", "Phi for GenMC", kTH1F, {binnedmultAxis}); + PhieffHist.add("h1PhiGenMCAssocReco", "Phi for GenMC Associated Reco Collision", kTH1F, {binnedmultAxis}); PhieffHist.add("h2PhieffK0SGenMCInc", "Phi coupled to K0Short for GenMC Inclusive", kTH2F, {binnedmultAxis, binnedptK0SAxis}); PhieffHist.add("h2PhieffK0SGenMCFCut", "Phi coupled to K0Short for GenMC Deltay < FirstCut", kTH2F, {binnedmultAxis, binnedptK0SAxis}); PhieffHist.add("h2PhieffK0SGenMCSCut", "Phi coupled to K0Short for GenMC Deltay < SecondCut", kTH2F, {binnedmultAxis, binnedptK0SAxis}); - PhieffHist.add("h2PhieffK0SGenMCIncAssocReco", "Phi coupled to K0Short for GenMC Inclusive", kTH2F, {binnedmultAxis, binnedptK0SAxis}); - PhieffHist.add("h2PhieffK0SGenMCFCutAssocReco", "Phi coupled to K0Short for GenMC Deltay < FirstCut", kTH2F, {binnedmultAxis, binnedptK0SAxis}); - PhieffHist.add("h2PhieffK0SGenMCSCutAssocReco", "Phi coupled to K0Short for GenMC Deltay < SecondCut", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + PhieffHist.add("h2PhieffK0SGenMCIncAssocReco", "Phi coupled to K0Short for GenMC Inclusive Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + PhieffHist.add("h2PhieffK0SGenMCFCutAssocReco", "Phi coupled to K0Short for GenMC Deltay < FirstCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + PhieffHist.add("h2PhieffK0SGenMCSCutAssocReco", "Phi coupled to K0Short for GenMC Deltay < SecondCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptK0SAxis}); PhieffHist.add("h2PhieffPiGenMCInc", "Phi coupled to Pion for GenMC Inclusive", kTH2F, {binnedmultAxis, binnedptPiAxis}); PhieffHist.add("h2PhieffPiGenMCFCut", "Phi coupled to Pion for GenMC Deltay < FirstCut", kTH2F, {binnedmultAxis, binnedptPiAxis}); PhieffHist.add("h2PhieffPiGenMCSCut", "Phi coupled to Pion for GenMC Deltay < SecondCut", kTH2F, {binnedmultAxis, binnedptPiAxis}); - PhieffHist.add("h2PhieffPiGenMCIncAssocReco", "Phi coupled to Pion for GenMC Inclusive", kTH2F, {binnedmultAxis, binnedptPiAxis}); - PhieffHist.add("h2PhieffPiGenMCFCutAssocReco", "Phi coupled to Pion for GenMC Deltay < FirstCut", kTH2F, {binnedmultAxis, binnedptPiAxis}); - PhieffHist.add("h2PhieffPiGenMCSCutAssocReco", "Phi coupled to Pion for GenMC Deltay < SecondCut", kTH2F, {binnedmultAxis, binnedptPiAxis}); + PhieffHist.add("h2PhieffPiGenMCIncAssocReco", "Phi coupled to Pion for GenMC Inclusive Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); + PhieffHist.add("h2PhieffPiGenMCFCutAssocReco", "Phi coupled to Pion for GenMC Deltay < FirstCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); + PhieffHist.add("h2PhieffPiGenMCSCutAssocReco", "Phi coupled to Pion for GenMC Deltay < SecondCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); // MCK0S invariant mass and GenMC K0S for computing efficiencies K0SeffHist.add("h3K0SeffInvMass", "Invariant mass of K0Short for Efficiency", kTH3F, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis}); K0SeffHist.add("h2K0SGenMC", "K0Short for GenMC", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + K0SeffHist.add("h2K0SGenMCAssocReco", "K0Short for GenMC Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptK0SAxis}); // MCPion invariant mass and GenMC Pion for computing efficiencies PioneffHist.add("h4PieffInvMass", "Invariant mass of Pion for Efficiency", kTHnSparseF, {binnedmultAxis, binnedptPiAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}}); PioneffHist.add("h2PiGenMC", "Pion for GenMC", kTH2F, {binnedmultAxis, binnedptPiAxis}); + PioneffHist.add("h2PiGenMCAssocReco", "Pion for GenMC Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); // y acceptance studies yaccHist.add("hyaccK0SRecMC", "K0S y acceptance in RecMC", kTH3F, {binnedmultAxis, binnedptK0SAxis, yAxis}); @@ -548,68 +547,54 @@ struct phik0shortanalysis { } // Fill 2D invariant mass histogram for V0 and Phi - template - void fillInvMass2D(const TLorentzVector V0, const std::vector listPhi, float multiplicity, const std::array weights) + template + void fillInvMass2D(const T& V0, const std::vector& listPhi, float multiplicity, const std::array weights) { - double massV0 = V0.M(); - double ptV0 = V0.Pt(); - double rapidityV0 = V0.Rapidity(); - - for (unsigned int phitag = 0; phitag < listPhi.size(); phitag++) { - double massPhi = listPhi[phitag].M(); - double rapidityPhi = listPhi[phitag].Rapidity(); - double deltay = std::abs(rapidityV0 - rapidityPhi); - + for (const auto& Phi : listPhi) { if constexpr (!isMC) { // same event - PhiK0SHist.fill(HIST("h4PhiK0SSEInc"), multiplicity, ptV0, massV0, massPhi, weights.at(0)); - if (deltay > cfgFirstCutonDeltay) + PhiK0SHist.fill(HIST("h4PhiK0SSEInc"), multiplicity, V0.pt(), V0.mK0Short(), Phi.M(), weights.at(0)); + if (std::abs(V0.yK0Short() - Phi.Rapidity()) > cfgFirstCutonDeltay) continue; - PhiK0SHist.fill(HIST("h4PhiK0SSEFCut"), multiplicity, ptV0, massV0, massPhi, weights.at(1)); - if (deltay > cfgSecondCutonDeltay) + PhiK0SHist.fill(HIST("h4PhiK0SSEFCut"), multiplicity, V0.pt(), V0.mK0Short(), Phi.M(), weights.at(1)); + if (std::abs(V0.yK0Short() - Phi.Rapidity()) > cfgSecondCutonDeltay) continue; - PhiK0SHist.fill(HIST("h4PhiK0SSESCut"), multiplicity, ptV0, massV0, massPhi, weights.at(2)); + PhiK0SHist.fill(HIST("h4PhiK0SSESCut"), multiplicity, V0.pt(), V0.mK0Short(), Phi.M(), weights.at(2)); } else { // MC event - closureMCPhiK0SHist.fill(HIST("h4ClosureMCPhiK0SSEInc"), multiplicity, ptV0, massV0, massPhi, weights.at(0)); - if (deltay > cfgFirstCutonDeltay) + closureMCPhiK0SHist.fill(HIST("h4ClosureMCPhiK0SSEInc"), multiplicity, V0.pt(), V0.mK0Short(), Phi.M(), weights.at(0)); + if (std::abs(V0.yK0Short() - Phi.Rapidity()) > cfgFirstCutonDeltay) continue; - closureMCPhiK0SHist.fill(HIST("h4ClosureMCPhiK0SSEFCut"), multiplicity, ptV0, massV0, massPhi, weights.at(1)); - if (deltay > cfgSecondCutonDeltay) + closureMCPhiK0SHist.fill(HIST("h4ClosureMCPhiK0SSEFCut"), multiplicity, V0.pt(), V0.mK0Short(), Phi.M(), weights.at(1)); + if (std::abs(V0.yK0Short() - Phi.Rapidity()) > cfgSecondCutonDeltay) continue; - closureMCPhiK0SHist.fill(HIST("h4ClosureMCPhiK0SSESCut"), multiplicity, ptV0, massV0, massPhi, weights.at(2)); + closureMCPhiK0SHist.fill(HIST("h4ClosureMCPhiK0SSESCut"), multiplicity, V0.pt(), V0.mK0Short(), Phi.M(), weights.at(2)); } } } // Fill Phi invariant mass vs Pion nSigmadE/dx histogram - template - void fillInvMassNSigma(const TLorentzVectorAndPID Pi, const std::vector listPhi, float multiplicity, const std::array weights) + template + void fillInvMassNSigma(const T& Pi, const std::vector& listPhi, float multiplicity, const std::array weights) { - float nSigmaTPCPi = Pi.fnSigmaTPC; - float nSigmaTOFPi = Pi.fnSigmaTOF; - double rapidityPi = Pi.fLorentzVector.Rapidity(); - double ptPi = Pi.fLorentzVector.Pt(); - - for (unsigned int phitag = 0; phitag < listPhi.size(); phitag++) { - double massPhi = listPhi[phitag].M(); - double rapidityPhi = listPhi[phitag].Rapidity(); - double deltay = std::abs(rapidityPi - rapidityPhi); + float nSigmaTPCPi = (Pi.hasTPC() ? Pi.tpcNSigmaPi() : -999); + float nSigmaTOFPi = (Pi.hasTOF() ? Pi.tofNSigmaPi() : -999); + for (const auto& Phi : listPhi) { if constexpr (!isMC) { // same event - PhiPionHist.fill(HIST("h5PhiPiSEInc"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weights.at(0)); - if (deltay > cfgFirstCutonDeltay) + PhiPionHist.fill(HIST("h5PhiPiSEInc"), multiplicity, Pi.pt(), nSigmaTPCPi, nSigmaTOFPi, Phi.M(), weights.at(0)); + if (std::abs(Pi.rapidity(massPi) - Phi.Rapidity()) > cfgFirstCutonDeltay) continue; - PhiPionHist.fill(HIST("h5PhiPiSEFCut"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weights.at(1)); - if (deltay > cfgSecondCutonDeltay) + PhiPionHist.fill(HIST("h5PhiPiSEFCut"), multiplicity, Pi.pt(), nSigmaTPCPi, nSigmaTOFPi, Phi.M(), weights.at(1)); + if (std::abs(Pi.rapidity(massPi) - Phi.Rapidity()) > cfgSecondCutonDeltay) continue; - PhiPionHist.fill(HIST("h5PhiPiSESCut"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weights.at(2)); + PhiPionHist.fill(HIST("h5PhiPiSESCut"), multiplicity, Pi.pt(), nSigmaTPCPi, nSigmaTOFPi, Phi.M(), weights.at(2)); } else { // MC event - closureMCPhiPionHist.fill(HIST("h5ClosureMCPhiPiSEInc"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weights.at(0)); - if (deltay > cfgFirstCutonDeltay) + closureMCPhiPionHist.fill(HIST("h5ClosureMCPhiPiSEInc"), multiplicity, Pi.pt(), nSigmaTPCPi, nSigmaTOFPi, Phi.M(), weights.at(0)); + if (std::abs(Pi.rapidity(massPi) - Phi.Rapidity()) > cfgFirstCutonDeltay) continue; - closureMCPhiPionHist.fill(HIST("h5ClosureMCPhiPiSEFCut"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weights.at(1)); - if (deltay > cfgSecondCutonDeltay) + closureMCPhiPionHist.fill(HIST("h5ClosureMCPhiPiSEFCut"), multiplicity, Pi.pt(), nSigmaTPCPi, nSigmaTOFPi, Phi.M(), weights.at(1)); + if (std::abs(Pi.rapidity(massPi) - Phi.Rapidity()) > cfgSecondCutonDeltay) continue; - closureMCPhiPionHist.fill(HIST("h5ClosureMCPhiPiSESCut"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weights.at(2)); + closureMCPhiPionHist.fill(HIST("h5ClosureMCPhiPiSESCut"), multiplicity, Pi.pt(), nSigmaTPCPi, nSigmaTOFPi, Phi.M(), weights.at(2)); } } } @@ -630,7 +615,7 @@ struct phik0shortanalysis { bool isCountedPhi = false; bool isFilledhV0 = false; - for (auto track1 : posThisColl) { // loop over all selected tracks + for (const auto& track1 : posThisColl) { // loop over all selected tracks if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1)) continue; // topological and PID selection @@ -643,7 +628,7 @@ struct phik0shortanalysis { auto track1ID = track1.globalIndex(); // Loop over all negative candidates - for (auto track2 : negThisColl) { + for (const auto& track2 : negThisColl) { if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2)) continue; // topological and PID selection @@ -684,25 +669,22 @@ struct phik0shortanalysis { } } - TLorentzVector recK0S; - recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); - - if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) + if (std::abs(v0.yK0Short()) > cfgyAcceptance) continue; if (!isCountedK0S.at(0)) { - PhipurHist.fill(HIST("h3PhipurK0SInvMassInc"), multiplicity, recK0S.Pt(), recPhi.M()); + PhipurHist.fill(HIST("h3PhipurK0SInvMassInc"), multiplicity, v0.pt(), recPhi.M()); isCountedK0S.at(0) = true; } - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; if (!isCountedK0S.at(1)) { - PhipurHist.fill(HIST("h3PhipurK0SInvMassFCut"), multiplicity, recK0S.Pt(), recPhi.M()); + PhipurHist.fill(HIST("h3PhipurK0SInvMassFCut"), multiplicity, v0.pt(), recPhi.M()); isCountedK0S.at(1) = true; } - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; if (!isCountedK0S.at(2)) { - PhipurHist.fill(HIST("h3PhipurK0SInvMassSCut"), multiplicity, recK0S.Pt(), recPhi.M()); + PhipurHist.fill(HIST("h3PhipurK0SInvMassSCut"), multiplicity, v0.pt(), recPhi.M()); isCountedK0S.at(2) = true; } } @@ -716,25 +698,22 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi; - recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); - - if (std::abs(recPi.Rapidity()) > cfgyAcceptance) + if (std::abs(track.rapidity(massPi)) > cfgyAcceptance) continue; if (!isCountedPi.at(0)) { - PhipurHist.fill(HIST("h3PhipurPiInvMassInc"), multiplicity, recPi.Pt(), recPhi.M()); + PhipurHist.fill(HIST("h3PhipurPiInvMassInc"), multiplicity, track.pt(), recPhi.M()); isCountedPi.at(0) = true; } - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; if (!isCountedPi.at(1)) { - PhipurHist.fill(HIST("h3PhipurPiInvMassFCut"), multiplicity, recPi.Pt(), recPhi.M()); + PhipurHist.fill(HIST("h3PhipurPiInvMassFCut"), multiplicity, track.pt(), recPhi.M()); isCountedPi.at(1) = true; } - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; if (!isCountedPi.at(2)) { - PhipurHist.fill(HIST("h3PhipurPiInvMassSCut"), multiplicity, recPi.Pt(), recPhi.M()); + PhipurHist.fill(HIST("h3PhipurPiInvMassSCut"), multiplicity, track.pt(), recPhi.M()); isCountedPi.at(2) = true; } } @@ -765,10 +744,7 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S; - recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); - - if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) + if (std::abs(v0.yK0Short()) > cfgyAcceptance) continue; std::vector listrecPhi; @@ -776,14 +752,14 @@ struct phik0shortanalysis { // Phi reconstruction // Loop over positive candidates - for (auto track1 : posThisColl) { // loop over all selected tracks + for (const auto& track1 : posThisColl) { // loop over all selected tracks if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1)) continue; // topological and PID selection auto track1ID = track1.globalIndex(); // Loop over all negative candidates - for (auto track2 : negThisColl) { + for (const auto& track2 : negThisColl) { if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2)) continue; // topological and PID selection @@ -800,10 +776,10 @@ struct phik0shortanalysis { continue; listrecPhi.push_back(recPhi); counts.at(0)++; - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; counts.at(1)++; - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; counts.at(2)++; } @@ -814,7 +790,7 @@ struct phik0shortanalysis { weights.at(i) = (counts.at(i) > 0 ? 1. / static_cast(counts.at(i)) : 0); } - fillInvMass2D(recK0S, listrecPhi, multiplicity, weights); + fillInvMass2D(v0, listrecPhi, multiplicity, weights); } } @@ -839,30 +815,22 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector vecPi; - vecPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); - - if (std::abs(vecPi.Rapidity()) > cfgyAcceptance) + if (std::abs(track.rapidity(massPi)) > cfgyAcceptance) continue; - float nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -999); - float nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -999); - - TLorentzVectorAndPID recPi{vecPi, nsigmaTPC, nsigmaTOF}; - std::vector listrecPhi; std::array counts{}; // Phi reconstruction // Loop over positive candidates - for (auto track1 : posThisColl) { // loop over all selected tracks + for (const auto& track1 : posThisColl) { // loop over all selected tracks if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1)) continue; // topological and PID selection auto track1ID = track1.globalIndex(); // Loop over all negative candidates - for (auto track2 : negThisColl) { + for (const auto& track2 : negThisColl) { if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2)) continue; // topological and PID selection @@ -879,10 +847,10 @@ struct phik0shortanalysis { continue; listrecPhi.push_back(recPhi); counts.at(0)++; - if (std::abs(vecPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; counts.at(1)++; - if (std::abs(vecPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; counts.at(2)++; } @@ -893,7 +861,7 @@ struct phik0shortanalysis { weights.at(i) = (counts.at(i) > 0 ? 1. / static_cast(counts.at(i)) : 0); } - fillInvMassNSigma(recPi, listrecPhi, multiplicity, weights); + fillInvMassNSigma(track, listrecPhi, multiplicity, weights); } } @@ -921,7 +889,7 @@ struct phik0shortanalysis { bool isCountedPhi = false; - for (auto track1 : posThisColl) { // loop over all selected tracks + for (const auto& track1 : posThisColl) { // loop over all selected tracks if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1)) continue; // topological and PID selection @@ -931,7 +899,7 @@ struct phik0shortanalysis { continue; // Loop over all negative candidates - for (auto track2 : negThisColl) { + for (const auto& track2 : negThisColl) { if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2)) continue; // topological and PID selection @@ -1007,25 +975,22 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S; - recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); - - if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) + if (std::abs(v0.yK0Short()) > cfgyAcceptance) continue; if (!isCountedK0S.at(0)) { - PhieffHist.fill(HIST("h3PhieffK0SInvMassInc"), genmultiplicity, recK0S.Pt(), recPhi.M()); + PhieffHist.fill(HIST("h3PhieffK0SInvMassInc"), genmultiplicity, v0.pt(), recPhi.M()); isCountedK0S.at(0) = true; } - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; if (!isCountedK0S.at(1)) { - PhieffHist.fill(HIST("h3PhieffK0SInvMassFCut"), genmultiplicity, recK0S.Pt(), recPhi.M()); + PhieffHist.fill(HIST("h3PhieffK0SInvMassFCut"), genmultiplicity, v0.pt(), recPhi.M()); isCountedK0S.at(1) = true; } - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; if (!isCountedK0S.at(2)) { - PhieffHist.fill(HIST("h3PhieffK0SInvMassSCut"), genmultiplicity, recK0S.Pt(), recPhi.M()); + PhieffHist.fill(HIST("h3PhieffK0SInvMassSCut"), genmultiplicity, v0.pt(), recPhi.M()); isCountedK0S.at(2) = true; } } @@ -1044,25 +1009,22 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi; - recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); - - if (std::abs(recPi.Rapidity()) > cfgyAcceptance) + if (std::abs(track.rapidity(massPi)) > cfgyAcceptance) continue; if (!isCountedPi.at(0)) { - PhieffHist.fill(HIST("h3PhieffPiInvMassInc"), genmultiplicity, recPi.Pt(), recPhi.M()); + PhieffHist.fill(HIST("h3PhieffPiInvMassInc"), genmultiplicity, track.pt(), recPhi.M()); isCountedPi.at(0) = true; } - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; if (!isCountedPi.at(1)) { - PhieffHist.fill(HIST("h3PhieffPiInvMassFCut"), genmultiplicity, recPi.Pt(), recPhi.M()); + PhieffHist.fill(HIST("h3PhieffPiInvMassFCut"), genmultiplicity, track.pt(), recPhi.M()); isCountedPi.at(1) = true; } - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; if (!isCountedPi.at(2)) { - PhieffHist.fill(HIST("h3PhieffPiInvMassSCut"), genmultiplicity, recPi.Pt(), recPhi.M()); + PhieffHist.fill(HIST("h3PhieffPiInvMassSCut"), genmultiplicity, track.pt(), recPhi.M()); isCountedPi.at(2) = true; } } @@ -1117,18 +1079,15 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S; - recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); - - if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) + if (std::abs(v0.yK0Short()) > cfgyAcceptance) continue; - K0SeffHist.fill(HIST("h3K0SeffInvMass"), genmultiplicity, recK0S.Pt(), recK0S.M()); + K0SeffHist.fill(HIST("h3K0SeffInvMass"), genmultiplicity, v0.pt(), v0.mK0Short()); std::array isCountedPhi{false, false, false}; // Phi reconstruction - for (auto track1 : posThisColl) { // loop over all selected tracks + for (const auto& track1 : posThisColl) { // loop over all selected tracks if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1)) continue; // topological and PID selection @@ -1137,7 +1096,7 @@ struct phik0shortanalysis { if (!track1.has_mcParticle()) continue; - for (auto track2 : negThisColl) { + for (const auto& track2 : negThisColl) { if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2)) continue; // topological and PID selection @@ -1177,20 +1136,20 @@ struct phik0shortanalysis { if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) continue; if (!isCountedPhi.at(0)) { - yaccHist.fill(HIST("hyaccK0SRecMC"), genmultiplicity, recK0S.Pt(), recK0S.Rapidity()); - MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSEInc"), genmultiplicity, recK0S.Pt(), recK0S.M()); + yaccHist.fill(HIST("hyaccK0SRecMC"), genmultiplicity, v0.pt(), v0.yK0Short()); + MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSEInc"), genmultiplicity, v0.pt(), v0.mK0Short()); isCountedPhi.at(0) = true; } - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; if (!isCountedPhi.at(1)) { - MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSEFCut"), genmultiplicity, recK0S.Pt(), recK0S.M()); + MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSEFCut"), genmultiplicity, v0.pt(), v0.mK0Short()); isCountedPhi.at(1) = true; } - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; if (!isCountedPhi.at(2)) { - MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSESCut"), genmultiplicity, recK0S.Pt(), recK0S.M()); + MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSESCut"), genmultiplicity, v0.pt(), v0.mK0Short()); isCountedPhi.at(2) = true; } } @@ -1229,22 +1188,18 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi; - recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); - - if (std::abs(recPi.Rapidity()) > cfgyAcceptance) + if (std::abs(track.rapidity(massPi)) > cfgyAcceptance) continue; - float nsigmaTPC, nsigmaTOF; - nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -999); - nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -999); + float nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -999); + float nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -999); - PioneffHist.fill(HIST("h4PieffInvMass"), genmultiplicity, recPi.Pt(), nsigmaTPC, nsigmaTOF); + PioneffHist.fill(HIST("h4PieffInvMass"), genmultiplicity, track.pt(), nsigmaTPC, nsigmaTOF); std::array isCountedPhi{false, false, false}; // Phi reconstruction - for (auto track1 : posThisColl) { // loop over all selected tracks + for (const auto& track1 : posThisColl) { // loop over all selected tracks if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1)) continue; // topological and PID selection @@ -1253,7 +1208,7 @@ struct phik0shortanalysis { if (!track1.has_mcParticle()) continue; - for (auto track2 : negThisColl) { + for (const auto& track2 : negThisColl) { if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2)) continue; // topological and PID selection @@ -1293,20 +1248,20 @@ struct phik0shortanalysis { if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) continue; if (!isCountedPhi.at(0)) { - yaccHist.fill(HIST("hyaccPiRecMC"), genmultiplicity, recPi.Pt(), recPi.Rapidity()); - MCPhiPionHist.fill(HIST("h4RecMCPhiPiSEInc"), genmultiplicity, recPi.Pt(), nsigmaTPC, nsigmaTOF); + yaccHist.fill(HIST("hyaccPiRecMC"), genmultiplicity, track.pt(), track.rapidity(massPi)); + MCPhiPionHist.fill(HIST("h4RecMCPhiPiSEInc"), genmultiplicity, track.pt(), nsigmaTPC, nsigmaTOF); isCountedPhi.at(0) = true; } - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; if (!isCountedPhi.at(1)) { - MCPhiPionHist.fill(HIST("h4RecMCPhiPiSEFCut"), genmultiplicity, recPi.Pt(), nsigmaTPC, nsigmaTOF); + MCPhiPionHist.fill(HIST("h4RecMCPhiPiSEFCut"), genmultiplicity, track.pt(), nsigmaTPC, nsigmaTOF); isCountedPhi.at(1) = true; } - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; if (!isCountedPhi.at(2)) { - MCPhiPionHist.fill(HIST("h4RecMCPhiPiSESCut"), genmultiplicity, recPi.Pt(), nsigmaTPC, nsigmaTOF); + MCPhiPionHist.fill(HIST("h4RecMCPhiPiSESCut"), genmultiplicity, track.pt(), nsigmaTPC, nsigmaTOF); isCountedPhi.at(2) = true; } } @@ -1335,14 +1290,14 @@ struct phik0shortanalysis { bool isCountedPhi = false; - for (auto track1 : posThisColl) { // loop over all selected tracks + for (const auto& track1 : posThisColl) { // loop over all selected tracks if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1)) continue; // topological and PID selection auto track1ID = track1.globalIndex(); // Loop over all negative candidates - for (auto track2 : negThisColl) { + for (const auto& track2 : negThisColl) { if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2)) continue; // topological and PID selection @@ -1359,7 +1314,7 @@ struct phik0shortanalysis { isCountedPhi = true; } - MCPhipurHist.fill(HIST("h2MCPhipurInvMass"), genmultiplicity, recPhi.M()); + closureMCPhipurHist.fill(HIST("h2MCPhipurInvMass"), genmultiplicity, recPhi.M()); std::array isCountedK0S{false, false, false}; @@ -1371,26 +1326,23 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S; - recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); - - if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) + if (std::abs(v0.yK0Short()) > cfgyAcceptance) continue; if (!isCountedK0S.at(0)) { - MCPhipurHist.fill(HIST("h3MCPhipurK0SInvMassInc"), genmultiplicity, recK0S.Pt(), recPhi.M()); + closureMCPhipurHist.fill(HIST("h3MCPhipurK0SInvMassInc"), genmultiplicity, v0.pt(), recPhi.M()); isCountedK0S.at(0) = true; } - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; if (!isCountedK0S.at(1)) { - MCPhipurHist.fill(HIST("h3MCPhipurK0SInvMassFCut"), genmultiplicity, recK0S.Pt(), recPhi.M()); + closureMCPhipurHist.fill(HIST("h3MCPhipurK0SInvMassFCut"), genmultiplicity, v0.pt(), recPhi.M()); isCountedK0S.at(1) = true; } - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; if (!isCountedK0S.at(2)) { - MCPhipurHist.fill(HIST("h3MCPhipurK0SInvMassSCut"), genmultiplicity, recK0S.Pt(), recPhi.M()); + closureMCPhipurHist.fill(HIST("h3MCPhipurK0SInvMassSCut"), genmultiplicity, v0.pt(), recPhi.M()); isCountedK0S.at(2) = true; } } @@ -1403,26 +1355,23 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector recPi; - recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); - - if (std::abs(recPi.Rapidity()) > cfgyAcceptance) + if (std::abs(track.rapidity(massPi)) > cfgyAcceptance) continue; if (!isCountedPi.at(0)) { - MCPhipurHist.fill(HIST("h3MCPhipurPiInvMassInc"), genmultiplicity, recPi.Pt(), recPhi.M()); + closureMCPhipurHist.fill(HIST("h3MCPhipurPiInvMassInc"), genmultiplicity, track.pt(), recPhi.M()); isCountedPi.at(0) = true; } - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; if (!isCountedPi.at(1)) { - MCPhipurHist.fill(HIST("h3MCPhipurPiInvMassFCut"), genmultiplicity, recPi.Pt(), recPhi.M()); + closureMCPhipurHist.fill(HIST("h3MCPhipurPiInvMassFCut"), genmultiplicity, track.pt(), recPhi.M()); isCountedPi.at(1) = true; } - if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; if (!isCountedPi.at(2)) { - MCPhipurHist.fill(HIST("h3MCPhipurPiInvMassSCut"), genmultiplicity, recPi.Pt(), recPhi.M()); + closureMCPhipurHist.fill(HIST("h3MCPhipurPiInvMassSCut"), genmultiplicity, track.pt(), recPhi.M()); isCountedPi.at(2) = true; } } @@ -1455,23 +1404,20 @@ struct phik0shortanalysis { if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - TLorentzVector recK0S; - recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); - - if (std::abs(recK0S.Rapidity()) > cfgyAcceptance) + if (std::abs(v0.yK0Short()) > cfgyAcceptance) continue; std::vector listrecPhi; std::array counts{}; // Phi reconstruction - for (auto track1 : posThisColl) { // loop over all selected tracks + for (const auto& track1 : posThisColl) { // loop over all selected tracks if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1)) continue; // topological and PID selection auto track1ID = track1.globalIndex(); - for (auto track2 : negThisColl) { + for (const auto& track2 : negThisColl) { if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2)) continue; // topological and PID selection @@ -1488,10 +1434,10 @@ struct phik0shortanalysis { continue; listrecPhi.push_back(recPhi); counts.at(0)++; - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; counts.at(1)++; - if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; counts.at(2)++; } @@ -1502,7 +1448,7 @@ struct phik0shortanalysis { weights.at(i) = (counts.at(i) > 0 ? 1. / static_cast(counts.at(i)) : 0); } - fillInvMass2D(recK0S, listrecPhi, genmultiplicity, weights); + fillInvMass2D(v0, listrecPhi, genmultiplicity, weights); } } @@ -1530,28 +1476,20 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - TLorentzVector vecPi; - vecPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); - - if (std::abs(vecPi.Rapidity()) > cfgyAcceptance) + if (std::abs(track.rapidity(massPi)) > cfgyAcceptance) continue; - float nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -999); - float nsigmaTOF = (track.hasTOF() ? track.tofNSigmaPi() : -999); - - TLorentzVectorAndPID recPi{vecPi, nsigmaTPC, nsigmaTOF}; - std::vector listrecPhi; std::array counts{}; // Phi reconstruction - for (auto track1 : posThisColl) { // loop over all selected tracks + for (const auto& track1 : posThisColl) { // loop over all selected tracks if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1)) continue; // topological and PID selection auto track1ID = track1.globalIndex(); - for (auto track2 : negThisColl) { + for (const auto& track2 : negThisColl) { if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2)) continue; // topological and PID selection @@ -1568,10 +1506,10 @@ struct phik0shortanalysis { continue; listrecPhi.push_back(recPhi); counts.at(0)++; - if (std::abs(vecPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgFirstCutonDeltay) continue; counts.at(1)++; - if (std::abs(vecPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgSecondCutonDeltay) continue; counts.at(2)++; } @@ -1582,7 +1520,7 @@ struct phik0shortanalysis { weights.at(i) = (counts.at(i) > 0 ? 1. / static_cast(counts.at(i)) : 0); } - fillInvMassNSigma(recPi, listrecPhi, genmultiplicity, weights); + fillInvMassNSigma(track, listrecPhi, genmultiplicity, weights); } } @@ -1600,7 +1538,7 @@ struct phik0shortanalysis { MCeventHist.fill(HIST("hGenMCEventSelection"), 2); // INEL>0 collisions bool isAssocColl = false; - for (auto collision : collisions) { + for (const auto& collision : collisions) { if (acceptEventQA(collision, false)) { isAssocColl = true; break; @@ -1612,14 +1550,14 @@ struct phik0shortanalysis { bool isCountedPhi = false; - for (auto mcParticle1 : mcParticles) { + for (const auto& mcParticle1 : mcParticles) { if (mcParticle1.pdgCode() != 333) continue; auto kDaughters = mcParticle1.daughters_as(); if (kDaughters.size() != 2) continue; bool isPosKaon = false, isNegKaon = false; - for (auto kDaughter : kDaughters) { + for (const auto& kDaughter : kDaughters) { if (kDaughter.pdgCode() == 321) isPosKaon = true; if (kDaughter.pdgCode() == -321) @@ -1638,14 +1576,28 @@ struct phik0shortanalysis { } PhieffHist.fill(HIST("h1PhiGenMC"), genmultiplicity); + if (isAssocColl) + PhieffHist.fill(HIST("h1PhiGenMCAssocReco"), genmultiplicity); std::array isCountedK0S = {false, false, false}; - for (auto mcParticle2 : mcParticles) { + for (const auto& mcParticle2 : mcParticles) { if (mcParticle2.pdgCode() != 310) continue; if (!mcParticle2.isPhysicalPrimary()) continue; + auto kDaughters2 = mcParticle2.daughters_as(); + if (kDaughters2.size() != 2) + continue; + bool isPosPion = false, isNegPion = false; + for (const auto& kDaughter2 : kDaughters2) { + if (kDaughter2.pdgCode() == 211) + isPosPion = true; + if (kDaughter2.pdgCode() == -211) + isNegPion = true; + } + if (!isPosPion || !isNegPion) + continue; if (std::abs(mcParticle2.y()) > cfgyAcceptance) continue; @@ -1675,7 +1627,7 @@ struct phik0shortanalysis { std::array isCountedPi = {false, false, false}; - for (auto mcParticle2 : mcParticles) { + for (const auto& mcParticle2 : mcParticles) { if (std::abs(mcParticle2.pdgCode()) != 211) continue; if (!mcParticle2.isPhysicalPrimary()) @@ -1719,7 +1671,7 @@ struct phik0shortanalysis { return; bool isAssocColl = false; - for (auto collision : collisions) { + for (const auto& collision : collisions) { if (acceptEventQA(collision, false)) { isAssocColl = true; break; @@ -1729,7 +1681,7 @@ struct phik0shortanalysis { float genmultiplicity = mcCollision.centFT0M(); MCeventHist.fill(HIST("hGenMCMultiplicityPercent"), genmultiplicity); - for (auto mcParticle1 : mcParticles) { + for (const auto& mcParticle1 : mcParticles) { if (mcParticle1.pdgCode() != 310) continue; if (!mcParticle1.isPhysicalPrimary()) @@ -1738,7 +1690,7 @@ struct phik0shortanalysis { if (kDaughters1.size() != 2) continue; bool isPosPion = false, isNegPion = false; - for (auto kDaughter1 : kDaughters1) { + for (const auto& kDaughter1 : kDaughters1) { if (kDaughter1.pdgCode() == 211) isPosPion = true; if (kDaughter1.pdgCode() == -211) @@ -1750,17 +1702,19 @@ struct phik0shortanalysis { continue; K0SeffHist.fill(HIST("h2K0SGenMC"), genmultiplicity, mcParticle1.pt()); + if (isAssocColl) + K0SeffHist.fill(HIST("h2K0SGenMCAssocReco"), genmultiplicity, mcParticle1.pt()); std::array isCountedPhi = {false, false, false}; - for (auto mcParticle2 : mcParticles) { + for (const auto& mcParticle2 : mcParticles) { if (mcParticle2.pdgCode() != 333) continue; auto kDaughters2 = mcParticle2.daughters_as(); if (kDaughters2.size() != 2) continue; bool isPosKaon = false, isNegKaon = false; - for (auto kDaughter2 : kDaughters2) { + for (const auto& kDaughter2 : kDaughters2) { if (kDaughter2.pdgCode() == 321) isPosKaon = true; if (kDaughter2.pdgCode() == -321) @@ -1808,7 +1762,7 @@ struct phik0shortanalysis { return; bool isAssocColl = false; - for (auto collision : collisions) { + for (const auto& collision : collisions) { if (acceptEventQA(collision, false)) { isAssocColl = true; break; @@ -1818,7 +1772,7 @@ struct phik0shortanalysis { float genmultiplicity = mcCollision.centFT0M(); MCeventHist.fill(HIST("hGenMCMultiplicityPercent"), genmultiplicity); - for (auto mcParticle1 : mcParticles) { + for (const auto& mcParticle1 : mcParticles) { if (std::abs(mcParticle1.pdgCode()) != 211) continue; if (!mcParticle1.isPhysicalPrimary()) @@ -1827,17 +1781,19 @@ struct phik0shortanalysis { continue; PioneffHist.fill(HIST("h2PiGenMC"), genmultiplicity, mcParticle1.pt()); + if (isAssocColl) + PioneffHist.fill(HIST("h2PiGenMCAssocReco"), genmultiplicity, mcParticle1.pt()); std::array isCountedPhi = {false, false, false}; - for (auto mcParticle2 : mcParticles) { + for (const auto& mcParticle2 : mcParticles) { if (mcParticle2.pdgCode() != 333) continue; auto kDaughters = mcParticle2.daughters_as(); if (kDaughters.size() != 2) continue; bool isPosKaon = false, isNegKaon = false; - for (auto kDaughter : kDaughters) { + for (const auto& kDaughter : kDaughters) { if (kDaughter.pdgCode() == 321) isPosKaon = true; if (kDaughter.pdgCode() == -321) From 5f360271a00b60db925b13be89cfcb12debd8356 Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Fri, 13 Dec 2024 10:33:02 +0100 Subject: [PATCH 372/459] [PWGLF] Move check on HF anchestor (#8967) --- PWGLF/Tasks/Strangeness/nonPromptCascade.cxx | 23 +++++++------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx index 00478a4cef5..5057a129e2d 100644 --- a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx +++ b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx @@ -577,15 +577,17 @@ struct NonPromptCascadeTask { int motherParticleID = -1; + std::tuple fromHF{false, false}; if (protonTrack.mcParticle().has_mothers() && pionTrack.mcParticle().has_mothers() && bachelor.mcParticle().has_mothers()) { if (protonTrack.mcParticle().mothersIds()[0] == pionTrack.mcParticle().mothersIds()[0]) { const auto v0part = protonTrack.mcParticle().mothers_first_as(); - if (abs(v0part.pdgCode()) == 3122 && v0part.has_mothers()) { + if (std::abs(v0part.pdgCode()) == 3122 && v0part.has_mothers()) { const auto motherV0 = v0part.mothers_as()[0]; // const auto motherBach = bachelor.mcParticle().mothers_as()[0]; if (v0part.mothersIds()[0] == bachelor.mcParticle().mothersIds()[0]) { - if (abs(motherV0.pdgCode()) == 3312 || abs(motherV0.pdgCode()) == 3334) { + if (std::abs(motherV0.pdgCode()) == 3312 || abs(motherV0.pdgCode()) == 3334) { isGoodCascade = true; + fromHF = isFromHF(motherV0); motherParticleID = v0part.mothersIds()[0]; } } @@ -596,12 +598,8 @@ struct NonPromptCascadeTask { bool isGoodMatch = ((motherParticleID == ITStrack.mcParticleId())) ? true : false; int pdgCodeMom = 0; - std::tuple fromHF{false, false}; - if (isGoodCascade) { - fromHF = isFromHF(track.mcParticle()); - if (isGoodMatch) { - pdgCodeMom = track.mcParticle().has_mothers() ? track.mcParticle().mothers_as()[0].pdgCode() : 0; - } + if (isGoodMatch) { + pdgCodeMom = track.mcParticle().has_mothers() ? track.mcParticle().mothers_as()[0].pdgCode() : 0; } int itsTrackPDG = ITStrack.has_mcParticle() ? ITStrack.mcParticle().pdgCode() : 0; float deltaPtITSCascade = std::hypot(cascadeMomentum[0], cascadeMomentum[1]) - ITStrack.pt(); @@ -650,7 +648,7 @@ struct NonPromptCascadeTask { particle.pt(), particle.eta(), particle.phi(), particle.pdgCode(), mcCollision.posX() - particle.vx(), mcCollision.posY() - particle.vy(), mcCollision.posZ() - particle.vz(), mcCollision.globalIndex() == label.mcCollisionId()); } - for (auto& p : mcParticles) { + for (const auto& p : mcParticles) { auto absCode = std::abs(p.pdgCode()); if (absCode != 3312 && absCode != 3334) { continue; @@ -782,11 +780,6 @@ struct NonPromptCascadeTask { } bachPionHasTOF = bachelor.hasTOF(); - // if (!bachelor.hasTOF() && !ptrack.hasTOF() && !ntrack.hasTOF() ) { - // LOG(debug)<< "no TOF: "< Date: Fri, 13 Dec 2024 11:25:29 +0100 Subject: [PATCH 373/459] [DPG] [TOF] add plots for delta (#8764) --- DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx | 447 +++++++++++----------- 1 file changed, 226 insertions(+), 221 deletions(-) diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx index e841e057497..73d1c72ad1e 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx @@ -12,13 +12,14 @@ /// /// \file qaPIDTOFMC.cxx /// \author Nicolò Jacazio -/// \brief Task to produce QA output of the PID with TOF running on the MC. +/// \brief Task to produce QA output of the PID with TOF running on the MC e.g. to compute purity. /// // O2 includes #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/StaticFor.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" #include "Framework/runDataProcessing.h" @@ -27,169 +28,71 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::track; +static constexpr int Np = 9; +static constexpr int NpNp = Np * Np; + +std::array, Np> hParticlePt; +std::array, Np> hParticleP; +std::array, Np> hParticleEta; + +std::array, Np> hTrackPt; +std::array, Np> hTrackP; +std::array, Np> hTrackEta; +std::array, Np> hTrackLength; + +std::array, Np> hSignalMC; +std::array, Np> hSignalMCprm; +std::array, Np> hSignalMCstr; +std::array, Np> hSignalMCmat; + +std::array, Np> hNSigma; +std::array, Np> hNSigmaprm; +std::array, Np> hNSigmastr; +std::array, Np> hNSigmamat; + +std::array, NpNp> hNSigmaMC; +std::array, NpNp> hNSigmaMCprm; +std::array, NpNp> hNSigmaMCstr; +std::array, NpNp> hNSigmaMCmat; + +std::array, NpNp> hDeltaMCEvTime; +std::array, NpNp> hDeltaMCEvTimeTrueGoodEv; +std::array, NpNp> hDeltaMCEvTimeTrueBadEv; +std::array, NpNp> hDeltaMCEvTimeprm; +std::array, NpNp> hDeltaMCEvTimestr; +std::array, NpNp> hDeltaMCEvTimemat; + +std::array, NpNp> hDeltaMCEvTimeMC; +std::array, NpNp> hDeltaMCEvTimeMCprm; +std::array, NpNp> hDeltaMCEvTimeMCstr; +std::array, NpNp> hDeltaMCEvTimeMCmat; +std::array, NpNp> hDeltaMCEvTimeMCGoodMatch; +std::array, NpNp> hDeltaMCEvTimeMCBadMatch; + +std::array, NpNp> hDeltaExpTimeMC; + +template +double calculateTimeOfFlight(double momentum, double length) +{ + static constexpr float mass = pid_constants::sMasses[id]; + static constexpr float c = o2::constants::physics::LightSpeedCm2PS; + // Calculate the Lorentz factor gamma + const float gamma = std::sqrt(1 + std::pow(momentum / (mass * c), 2)); + + // Calculate velocity + double velocity = momentum / (gamma * mass); + + // Calculate time of flight + double timeOfFlight = length / velocity; + + return timeOfFlight; +} + /// Task to produce the TOF QA plots struct pidTofQaMc { SliceCache cache; - - static constexpr int Np = 9; - static constexpr int NpNp = Np * Np; - static constexpr std::string_view hparticlept[Np] = {"particlept/El", "particlept/Mu", "particlept/Pi", - "particlept/Ka", "particlept/Pr", "particlept/De", - "particlept/Tr", "particlept/He", "particlept/Al"}; - static constexpr std::string_view hparticlep[Np] = {"particlep/El", "particlep/Mu", "particlep/Pi", - "particlep/Ka", "particlep/Pr", "particlep/De", - "particlep/Tr", "particlep/He", "particlep/Al"}; - static constexpr std::string_view hparticleeta[Np] = {"particleeta/El", "particleeta/Mu", "particleeta/Pi", - "particleeta/Ka", "particleeta/Pr", "particleeta/De", - "particleeta/Tr", "particleeta/He", "particleeta/Al"}; - static constexpr std::string_view htrackpt[Np] = {"trackpt/El", "trackpt/Mu", "trackpt/Pi", - "trackpt/Ka", "trackpt/Pr", "trackpt/De", - "trackpt/Tr", "trackpt/He", "trackpt/Al"}; - static constexpr std::string_view htrackp[Np] = {"trackp/El", "trackp/Mu", "trackp/Pi", - "trackp/Ka", "trackp/Pr", "trackp/De", - "trackp/Tr", "trackp/He", "trackp/Al"}; - static constexpr std::string_view htracketa[Np] = {"tracketa/El", "tracketa/Mu", "tracketa/Pi", - "tracketa/Ka", "tracketa/Pr", "tracketa/De", - "tracketa/Tr", "tracketa/He", "tracketa/Al"}; - static constexpr std::string_view htracklength[Np] = {"tracklength/El", "tracklength/Mu", "tracklength/Pi", - "tracklength/Ka", "tracklength/Pr", "tracklength/De", - "tracklength/Tr", "tracklength/He", "tracklength/Al"}; - // Signal - static constexpr std::string_view hsignalMC[Np] = {"signalMC/El", "signalMC/Mu", "signalMC/Pi", - "signalMC/Ka", "signalMC/Pr", "signalMC/De", - "signalMC/Tr", "signalMC/He", "signalMC/Al"}; - static constexpr std::string_view hsignalMCprm[Np] = {"signalMCprm/El", "signalMCprm/Mu", "signalMCprm/Pi", - "signalMCprm/Ka", "signalMCprm/Pr", "signalMCprm/De", - "signalMCprm/Tr", "signalMCprm/He", "signalMCprm/Al"}; - static constexpr std::string_view hsignalMCstr[Np] = {"signalMCstr/El", "signalMCstr/Mu", "signalMCstr/Pi", - "signalMCstr/Ka", "signalMCstr/Pr", "signalMCstr/De", - "signalMCstr/Tr", "signalMCstr/He", "signalMCstr/Al"}; - static constexpr std::string_view hsignalMCmat[Np] = {"signalMCmat/El", "signalMCmat/Mu", "signalMCmat/Pi", - "signalMCmat/Ka", "signalMCmat/Pr", "signalMCmat/De", - "signalMCmat/Tr", "signalMCmat/He", "signalMCmat/Al"}; - // Nsigma - static constexpr std::string_view hnsigma[Np] = {"nsigma/El", "nsigma/Mu", "nsigma/Pi", - "nsigma/Ka", "nsigma/Pr", "nsigma/De", - "nsigma/Tr", "nsigma/He", "nsigma/Al"}; - static constexpr std::string_view hnsigmaprm[Np] = {"nsigmaprm/El", "nsigmaprm/Mu", "nsigmaprm/Pi", - "nsigmaprm/Ka", "nsigmaprm/Pr", "nsigmaprm/De", - "nsigmaprm/Tr", "nsigmaprm/He", "nsigmaprm/Al"}; - static constexpr std::string_view hnsigmastr[Np] = {"nsigmastr/El", "nsigmastr/Mu", "nsigmastr/Pi", - "nsigmastr/Ka", "nsigmastr/Pr", "nsigmastr/De", - "nsigmastr/Tr", "nsigmastr/He", "nsigmastr/Al"}; - static constexpr std::string_view hnsigmamat[Np] = {"nsigmamat/El", "nsigmamat/Mu", "nsigmamat/Pi", - "nsigmamat/Ka", "nsigmamat/Pr", "nsigmamat/De", - "nsigmamat/Tr", "nsigmamat/He", "nsigmamat/Al"}; - static constexpr std::string_view hnsigmaMC[NpNp] = {"nsigmaMC/El/El", "nsigmaMC/El/Mu", "nsigmaMC/El/Pi", - "nsigmaMC/El/Ka", "nsigmaMC/El/Pr", "nsigmaMC/El/De", - "nsigmaMC/El/Tr", "nsigmaMC/El/He", "nsigmaMC/El/Al", - "nsigmaMC/Mu/El", "nsigmaMC/Mu/Mu", "nsigmaMC/Mu/Pi", - "nsigmaMC/Mu/Ka", "nsigmaMC/Mu/Pr", "nsigmaMC/Mu/De", - "nsigmaMC/Mu/Tr", "nsigmaMC/Mu/He", "nsigmaMC/Mu/Al", - "nsigmaMC/Pi/El", "nsigmaMC/Pi/Mu", "nsigmaMC/Pi/Pi", - "nsigmaMC/Pi/Ka", "nsigmaMC/Pi/Pr", "nsigmaMC/Pi/De", - "nsigmaMC/Pi/Tr", "nsigmaMC/Pi/He", "nsigmaMC/Pi/Al", - "nsigmaMC/Ka/El", "nsigmaMC/Ka/Mu", "nsigmaMC/Ka/Pi", - "nsigmaMC/Ka/Ka", "nsigmaMC/Ka/Pr", "nsigmaMC/Ka/De", - "nsigmaMC/Ka/Tr", "nsigmaMC/Ka/He", "nsigmaMC/Ka/Al", - "nsigmaMC/Pr/El", "nsigmaMC/Pr/Mu", "nsigmaMC/Pr/Pi", - "nsigmaMC/Pr/Ka", "nsigmaMC/Pr/Pr", "nsigmaMC/Pr/De", - "nsigmaMC/Pr/Tr", "nsigmaMC/Pr/He", "nsigmaMC/Pr/Al", - "nsigmaMC/De/El", "nsigmaMC/De/Mu", "nsigmaMC/De/Pi", - "nsigmaMC/De/Ka", "nsigmaMC/De/Pr", "nsigmaMC/De/De", - "nsigmaMC/De/Tr", "nsigmaMC/De/He", "nsigmaMC/De/Al", - "nsigmaMC/Tr/El", "nsigmaMC/Tr/Mu", "nsigmaMC/Tr/Pi", - "nsigmaMC/Tr/Ka", "nsigmaMC/Tr/Pr", "nsigmaMC/Tr/De", - "nsigmaMC/Tr/Tr", "nsigmaMC/Tr/He", "nsigmaMC/Tr/Al", - "nsigmaMC/He/El", "nsigmaMC/He/Mu", "nsigmaMC/He/Pi", - "nsigmaMC/He/Ka", "nsigmaMC/He/Pr", "nsigmaMC/He/De", - "nsigmaMC/He/Tr", "nsigmaMC/He/He", "nsigmaMC/He/Al", - "nsigmaMC/Al/El", "nsigmaMC/Al/Mu", "nsigmaMC/Al/Pi", - "nsigmaMC/Al/Ka", "nsigmaMC/Al/Pr", "nsigmaMC/Al/De", - "nsigmaMC/Al/Tr", "nsigmaMC/Al/He", "nsigmaMC/Al/Al"}; - static constexpr std::string_view hnsigmaMCstr[NpNp] = {"nsigmaMCstr/El/El", "nsigmaMCstr/El/Mu", "nsigmaMCstr/El/Pi", - "nsigmaMCstr/El/Ka", "nsigmaMCstr/El/Pr", "nsigmaMCstr/El/De", - "nsigmaMCstr/El/Tr", "nsigmaMCstr/El/He", "nsigmaMCstr/El/Al", - "nsigmaMCstr/Mu/El", "nsigmaMCstr/Mu/Mu", "nsigmaMCstr/Mu/Pi", - "nsigmaMCstr/Mu/Ka", "nsigmaMCstr/Mu/Pr", "nsigmaMCstr/Mu/De", - "nsigmaMCstr/Mu/Tr", "nsigmaMCstr/Mu/He", "nsigmaMCstr/Mu/Al", - "nsigmaMCstr/Pi/El", "nsigmaMCstr/Pi/Mu", "nsigmaMCstr/Pi/Pi", - "nsigmaMCstr/Pi/Ka", "nsigmaMCstr/Pi/Pr", "nsigmaMCstr/Pi/De", - "nsigmaMCstr/Pi/Tr", "nsigmaMCstr/Pi/He", "nsigmaMCstr/Pi/Al", - "nsigmaMCstr/Ka/El", "nsigmaMCstr/Ka/Mu", "nsigmaMCstr/Ka/Pi", - "nsigmaMCstr/Ka/Ka", "nsigmaMCstr/Ka/Pr", "nsigmaMCstr/Ka/De", - "nsigmaMCstr/Ka/Tr", "nsigmaMCstr/Ka/He", "nsigmaMCstr/Ka/Al", - "nsigmaMCstr/Pr/El", "nsigmaMCstr/Pr/Mu", "nsigmaMCstr/Pr/Pi", - "nsigmaMCstr/Pr/Ka", "nsigmaMCstr/Pr/Pr", "nsigmaMCstr/Pr/De", - "nsigmaMCstr/Pr/Tr", "nsigmaMCstr/Pr/He", "nsigmaMCstr/Pr/Al", - "nsigmaMCstr/De/El", "nsigmaMCstr/De/Mu", "nsigmaMCstr/De/Pi", - "nsigmaMCstr/De/Ka", "nsigmaMCstr/De/Pr", "nsigmaMCstr/De/De", - "nsigmaMCstr/De/Tr", "nsigmaMCstr/De/He", "nsigmaMCstr/De/Al", - "nsigmaMCstr/Tr/El", "nsigmaMCstr/Tr/Mu", "nsigmaMCstr/Tr/Pi", - "nsigmaMCstr/Tr/Ka", "nsigmaMCstr/Tr/Pr", "nsigmaMCstr/Tr/De", - "nsigmaMCstr/Tr/Tr", "nsigmaMCstr/Tr/He", "nsigmaMCstr/Tr/Al", - "nsigmaMCstr/He/El", "nsigmaMCstr/He/Mu", "nsigmaMCstr/He/Pi", - "nsigmaMCstr/He/Ka", "nsigmaMCstr/He/Pr", "nsigmaMCstr/He/De", - "nsigmaMCstr/He/Tr", "nsigmaMCstr/He/He", "nsigmaMCstr/He/Al", - "nsigmaMCstr/Al/El", "nsigmaMCstr/Al/Mu", "nsigmaMCstr/Al/Pi", - "nsigmaMCstr/Al/Ka", "nsigmaMCstr/Al/Pr", "nsigmaMCstr/Al/De", - "nsigmaMCstr/Al/Tr", "nsigmaMCstr/Al/He", "nsigmaMCstr/Al/Al"}; - static constexpr std::string_view hnsigmaMCmat[NpNp] = {"nsigmaMCmat/El/El", "nsigmaMCmat/El/Mu", "nsigmaMCmat/El/Pi", - "nsigmaMCmat/El/Ka", "nsigmaMCmat/El/Pr", "nsigmaMCmat/El/De", - "nsigmaMCmat/El/Tr", "nsigmaMCmat/El/He", "nsigmaMCmat/El/Al", - "nsigmaMCmat/Mu/El", "nsigmaMCmat/Mu/Mu", "nsigmaMCmat/Mu/Pi", - "nsigmaMCmat/Mu/Ka", "nsigmaMCmat/Mu/Pr", "nsigmaMCmat/Mu/De", - "nsigmaMCmat/Mu/Tr", "nsigmaMCmat/Mu/He", "nsigmaMCmat/Mu/Al", - "nsigmaMCmat/Pi/El", "nsigmaMCmat/Pi/Mu", "nsigmaMCmat/Pi/Pi", - "nsigmaMCmat/Pi/Ka", "nsigmaMCmat/Pi/Pr", "nsigmaMCmat/Pi/De", - "nsigmaMCmat/Pi/Tr", "nsigmaMCmat/Pi/He", "nsigmaMCmat/Pi/Al", - "nsigmaMCmat/Ka/El", "nsigmaMCmat/Ka/Mu", "nsigmaMCmat/Ka/Pi", - "nsigmaMCmat/Ka/Ka", "nsigmaMCmat/Ka/Pr", "nsigmaMCmat/Ka/De", - "nsigmaMCmat/Ka/Tr", "nsigmaMCmat/Ka/He", "nsigmaMCmat/Ka/Al", - "nsigmaMCmat/Pr/El", "nsigmaMCmat/Pr/Mu", "nsigmaMCmat/Pr/Pi", - "nsigmaMCmat/Pr/Ka", "nsigmaMCmat/Pr/Pr", "nsigmaMCmat/Pr/De", - "nsigmaMCmat/Pr/Tr", "nsigmaMCmat/Pr/He", "nsigmaMCmat/Pr/Al", - "nsigmaMCmat/De/El", "nsigmaMCmat/De/Mu", "nsigmaMCmat/De/Pi", - "nsigmaMCmat/De/Ka", "nsigmaMCmat/De/Pr", "nsigmaMCmat/De/De", - "nsigmaMCmat/De/Tr", "nsigmaMCmat/De/He", "nsigmaMCmat/De/Al", - "nsigmaMCmat/Tr/El", "nsigmaMCmat/Tr/Mu", "nsigmaMCmat/Tr/Pi", - "nsigmaMCmat/Tr/Ka", "nsigmaMCmat/Tr/Pr", "nsigmaMCmat/Tr/De", - "nsigmaMCmat/Tr/Tr", "nsigmaMCmat/Tr/He", "nsigmaMCmat/Tr/Al", - "nsigmaMCmat/He/El", "nsigmaMCmat/He/Mu", "nsigmaMCmat/He/Pi", - "nsigmaMCmat/He/Ka", "nsigmaMCmat/He/Pr", "nsigmaMCmat/He/De", - "nsigmaMCmat/He/Tr", "nsigmaMCmat/He/He", "nsigmaMCmat/He/Al", - "nsigmaMCmat/Al/El", "nsigmaMCmat/Al/Mu", "nsigmaMCmat/Al/Pi", - "nsigmaMCmat/Al/Ka", "nsigmaMCmat/Al/Pr", "nsigmaMCmat/Al/De", - "nsigmaMCmat/Al/Tr", "nsigmaMCmat/Al/He", "nsigmaMCmat/Al/Al"}; - static constexpr std::string_view hnsigmaMCprm[NpNp] = {"nsigmaMCprm/El/El", "nsigmaMCprm/El/Mu", "nsigmaMCprm/El/Pi", - "nsigmaMCprm/El/Ka", "nsigmaMCprm/El/Pr", "nsigmaMCprm/El/De", - "nsigmaMCprm/El/Tr", "nsigmaMCprm/El/He", "nsigmaMCprm/El/Al", - "nsigmaMCprm/Mu/El", "nsigmaMCprm/Mu/Mu", "nsigmaMCprm/Mu/Pi", - "nsigmaMCprm/Mu/Ka", "nsigmaMCprm/Mu/Pr", "nsigmaMCprm/Mu/De", - "nsigmaMCprm/Mu/Tr", "nsigmaMCprm/Mu/He", "nsigmaMCprm/Mu/Al", - "nsigmaMCprm/Pi/El", "nsigmaMCprm/Pi/Mu", "nsigmaMCprm/Pi/Pi", - "nsigmaMCprm/Pi/Ka", "nsigmaMCprm/Pi/Pr", "nsigmaMCprm/Pi/De", - "nsigmaMCprm/Pi/Tr", "nsigmaMCprm/Pi/He", "nsigmaMCprm/Pi/Al", - "nsigmaMCprm/Ka/El", "nsigmaMCprm/Ka/Mu", "nsigmaMCprm/Ka/Pi", - "nsigmaMCprm/Ka/Ka", "nsigmaMCprm/Ka/Pr", "nsigmaMCprm/Ka/De", - "nsigmaMCprm/Ka/Tr", "nsigmaMCprm/Ka/He", "nsigmaMCprm/Ka/Al", - "nsigmaMCprm/Pr/El", "nsigmaMCprm/Pr/Mu", "nsigmaMCprm/Pr/Pi", - "nsigmaMCprm/Pr/Ka", "nsigmaMCprm/Pr/Pr", "nsigmaMCprm/Pr/De", - "nsigmaMCprm/Pr/Tr", "nsigmaMCprm/Pr/He", "nsigmaMCprm/Pr/Al", - "nsigmaMCprm/De/El", "nsigmaMCprm/De/Mu", "nsigmaMCprm/De/Pi", - "nsigmaMCprm/De/Ka", "nsigmaMCprm/De/Pr", "nsigmaMCprm/De/De", - "nsigmaMCprm/De/Tr", "nsigmaMCprm/De/He", "nsigmaMCprm/De/Al", - "nsigmaMCprm/Tr/El", "nsigmaMCprm/Tr/Mu", "nsigmaMCprm/Tr/Pi", - "nsigmaMCprm/Tr/Ka", "nsigmaMCprm/Tr/Pr", "nsigmaMCprm/Tr/De", - "nsigmaMCprm/Tr/Tr", "nsigmaMCprm/Tr/He", "nsigmaMCprm/Tr/Al", - "nsigmaMCprm/He/El", "nsigmaMCprm/He/Mu", "nsigmaMCprm/He/Pi", - "nsigmaMCprm/He/Ka", "nsigmaMCprm/He/Pr", "nsigmaMCprm/He/De", - "nsigmaMCprm/He/Tr", "nsigmaMCprm/He/He", "nsigmaMCprm/He/Al", - "nsigmaMCprm/Al/El", "nsigmaMCprm/Al/Mu", "nsigmaMCprm/Al/Pi", - "nsigmaMCprm/Al/Ka", "nsigmaMCprm/Al/Pr", "nsigmaMCprm/Al/De", - "nsigmaMCprm/Al/Tr", "nsigmaMCprm/Al/He", "nsigmaMCprm/Al/Al"}; - static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p", "d", "t", "^{3}He", "#alpha"}; + static constexpr const char* pName[Np] = {"El", "Mu", "Pi", "Ka", "Pr", "De", "Tr", "He", "Al"}; static constexpr int PDGs[Np] = {11, 13, 211, 321, 2212, 1000010020, 1000010030, 1000020030}; HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -207,6 +110,7 @@ struct pidTofQaMc { Configurable doAl{"doAl", 0, "Process alpha"}; ConfigurableAxis binsPt{"binsPt", {2000, 0.f, 20.f}, "Binning of the pT axis"}; ConfigurableAxis binsNsigma{"binsNsigma", {2000, -50.f, 50.f}, "Binning of the NSigma axis"}; + ConfigurableAxis binsDelta{"binsDelta", {2000, -500.f, 500.f}, "Binning of the Delta axis"}; ConfigurableAxis binsSignal{"binsSignal", {6000, 0, 2000}, "Binning of the TPC signal axis"}; ConfigurableAxis binsLength{"binsLength", {1000, 0, 3000}, "Binning of the Length axis"}; ConfigurableAxis binsEta{"binsEta", {100, -4, 4}, "Binning of the Eta axis"}; @@ -271,33 +175,50 @@ struct pidTofQaMc { const AxisSpec lengthAxis{binsLength, "Track length (cm)"}; const AxisSpec etaAxis{binsEta, "#it{#eta}"}; const AxisSpec nSigmaAxis{binsNsigma, Form("N_{#sigma}^{TOF}(%s)", pT[mcID])}; + const AxisSpec deltaAxis{binsDelta, Form("#Delta^{TOF}(%s)", pT[mcID])}; + const AxisSpec deltaLengthAxis{binsDelta, Form("t_{exp}(%s)-t_{exp}^{*}(%s)", pT[mcID], pT[mcID])}; // Particle info - histos.add(hparticlept[mcID].data(), "", kTH1F, {pAxis}); - histos.add(hparticlep[mcID].data(), "", kTH1F, {pAxis}); - histos.add(hparticleeta[mcID].data(), "", kTH1F, {pAxis}); + hParticlePt[mcID] = histos.add(Form("particlept/%s", pName[mcID]), pT[mcID], kTH1D, {ptAxis}); + hParticleP[mcID] = histos.add(Form("particlep/%s", pName[mcID]), pT[mcID], kTH1D, {pAxis}); + hParticleEta[mcID] = histos.add(Form("particleeta/%s", pName[mcID]), pT[mcID], kTH1D, {etaAxis}); // Track info - histos.add(htrackpt[mcID].data(), "", kTH1F, {pAxis}); - histos.add(htrackp[mcID].data(), "", kTH1F, {pAxis}); - histos.add(htracketa[mcID].data(), "", kTH1F, {pAxis}); - histos.add(htracklength[mcID].data(), "", kTH1F, {pAxis}); + hTrackPt[mcID] = histos.add(Form("trackpt/%s", pName[mcID]), pT[mcID], kTH1D, {ptAxis}); + hTrackP[mcID] = histos.add(Form("trackp/%s", pName[mcID]), pT[mcID], kTH1D, {pAxis}); + hTrackEta[mcID] = histos.add(Form("tracketa/%s", pName[mcID]), pT[mcID], kTH1D, {etaAxis}); + hTrackLength[mcID] = histos.add(Form("tracklength/%s", pName[mcID]), pT[mcID], kTH1D, {lengthAxis}); // NSigma - histos.add(hnsigma[mcID].data(), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis}); - histos.add(hsignalMC[mcID].data(), pT[mcID], HistType::kTH2F, {pAxis, signalAxis}); + hSignalMC[mcID] = histos.add(Form("signalMC/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {pAxis, signalAxis}); + hNSigma[mcID] = histos.add(Form("nsigma/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis}); + hDeltaMCEvTime[mcID] = histos.add(Form("deltamcevtime/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaAxis}); + hDeltaMCEvTimeTrueGoodEv[mcID] = histos.add(Form("deltamcevtimegoodev/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaAxis}); + hDeltaMCEvTimeTrueBadEv[mcID] = histos.add(Form("deltamcevtimebadev/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaAxis}); + hDeltaMCEvTimeMC[mcID] = histos.add(Form("deltamcevtimeMC/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaAxis}); + hDeltaMCEvTimeMCGoodMatch[mcID] = histos.add(Form("deltamcevtimeMCgm/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaAxis}); + hDeltaMCEvTimeMCBadMatch[mcID] = histos.add(Form("deltamcevtimeMCbm/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaAxis}); + + hDeltaExpTimeMC[mcID] = histos.add(Form("deltaexptimeMC/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaLengthAxis}); if (!checkPrimaries) { return; } + hSignalMCprm[mcID] = histos.add(Form("signalMCprm/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {pAxis, signalAxis}); + hSignalMCstr[mcID] = histos.add(Form("signalMCstr/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {pAxis, signalAxis}); + hSignalMCmat[mcID] = histos.add(Form("signalMCmat/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {pAxis, signalAxis}); + + hNSigmaprm[mcID] = histos.add(Form("nsigmaprm/%s", pName[mcID]), Form("Primary %s", pT[mcID]), HistType::kTH2F, {ptAxis, nSigmaAxis}); + hNSigmastr[mcID] = histos.add(Form("nsigmastr/%s", pName[mcID]), Form("Secondary %s from decay", pT[mcID]), HistType::kTH2F, {ptAxis, nSigmaAxis}); + hNSigmamat[mcID] = histos.add(Form("nsigmamat/%s", pName[mcID]), Form("Secondary %s from material", pT[mcID]), HistType::kTH2F, {ptAxis, nSigmaAxis}); - histos.add(hnsigmaprm[mcID].data(), Form("Primary %s", pT[mcID]), HistType::kTH2F, {ptAxis, nSigmaAxis}); - histos.add(hnsigmastr[mcID].data(), Form("Secondary %s from decay", pT[mcID]), HistType::kTH2F, {ptAxis, nSigmaAxis}); - histos.add(hnsigmamat[mcID].data(), Form("Secondary %s from material", pT[mcID]), HistType::kTH2F, {ptAxis, nSigmaAxis}); + hDeltaMCEvTimeprm[mcID] = histos.add(Form("deltamcevtimeprm/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaAxis}); + hDeltaMCEvTimestr[mcID] = histos.add(Form("deltamcevtimestr/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaAxis}); + hDeltaMCEvTimemat[mcID] = histos.add(Form("deltamcevtimemat/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaAxis}); - histos.add(hsignalMCprm[mcID].data(), Form("Primary %s", pT[mcID]), HistType::kTH2F, {pAxis, signalAxis}); - histos.add(hsignalMCstr[mcID].data(), Form("Secondary %s from decay", pT[mcID]), HistType::kTH2F, {pAxis, signalAxis}); - histos.add(hsignalMCmat[mcID].data(), Form("Secondary %s from material", pT[mcID]), HistType::kTH2F, {pAxis, signalAxis}); + hDeltaMCEvTimeMCprm[mcID] = histos.add(Form("deltamcevtimeMCprm/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaAxis}); + hDeltaMCEvTimeMCstr[mcID] = histos.add(Form("deltamcevtimeMCstr/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaAxis}); + hDeltaMCEvTimeMCmat[mcID] = histos.add(Form("deltamcevtimeMCmat/%s", pName[mcID]), pT[mcID], HistType::kTH2F, {ptAxis, deltaAxis}); } template @@ -355,11 +276,11 @@ struct pidTofQaMc { const AxisSpec nSigmaAxis{binsNsigma, Form("N_{#sigma}^{TOF}(%s)", pT[massID])}; - histos.add(hnsigmaMC[mcID * Np + massID].data(), Form("True %s", pT[mcID]), HistType::kTH2F, {ptAxis, nSigmaAxis}); + hNSigmaMC[mcID * Np + massID] = histos.add(Form("nsigmaMC/%s/%s", pName[mcID], pName[massID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis}); if (checkPrimaries) { - histos.add(hnsigmaMCprm[mcID * Np + massID].data(), Form("True Primary %s", pT[mcID]), HistType::kTH2F, {ptAxis, nSigmaAxis}); - histos.add(hnsigmaMCstr[mcID * Np + massID].data(), Form("True Secondary %s from decay", pT[mcID]), HistType::kTH2F, {ptAxis, nSigmaAxis}); - histos.add(hnsigmaMCmat[mcID * Np + massID].data(), Form("True Secondary %s from material", pT[mcID]), HistType::kTH2F, {ptAxis, nSigmaAxis}); + hNSigmaMCprm[mcID * Np + massID] = histos.add(Form("nsigmaMCprm/%s/%s", pName[mcID], pName[massID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis}); + hNSigmaMCstr[mcID * Np + massID] = histos.add(Form("nsigmaMCstr/%s/%s", pName[mcID], pName[massID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis}); + hNSigmaMCmat[mcID * Np + massID] = histos.add(Form("nsigmaMCmat/%s/%s", pName[mcID], pName[massID]), pT[mcID], HistType::kTH2F, {ptAxis, nSigmaAxis}); } } @@ -376,6 +297,8 @@ struct pidTofQaMc { histos.add("event/T0", ";Tracks with TOF;T0 (ps);Counts", HistType::kTH2F, {{1000, 0, 1000}, {1000, -1000, 1000}}); histos.add("event/vertexz", ";Vtx_{z} (cm);Entries", kTH1F, {{100, -20, 20}}); + histos.add("event/tofbadmatch", "", kTH1F, {ptAxis}); + histos.add("event/tofgoodmatch", "", kTH1F, {ptAxis}); static_for<0, 8>([&](auto i) { static_for<0, 8>([&](auto j) { @@ -401,7 +324,7 @@ struct pidTofQaMc { { switch (pdgSign.value) { case 0: - if (abs(particle.pdgCode()) != PDGs[mcID]) { + if (std::abs(particle.pdgCode()) != PDGs[mcID]) { return; } break; @@ -468,9 +391,9 @@ struct pidTofQaMc { LOG(fatal) << "Can't interpret index"; } - histos.fill(HIST(hparticlep[mcID]), particle.p()); - histos.fill(HIST(hparticlept[mcID]), particle.pt()); - histos.fill(HIST(hparticleeta[mcID]), particle.eta()); + hParticlePt[mcID]->Fill(particle.pt()); + hParticleP[mcID]->Fill(particle.p()); + hParticleEta[mcID]->Fill(particle.p()); } template @@ -529,23 +452,61 @@ struct pidTofQaMc { const float nsigma = o2::aod::pidutils::tofNSigma(track); // Fill for all - histos.fill(HIST(hnsigma[mcID]), track.pt(), nsigma); + hNSigma[mcID]->Fill(track.pt(), nsigma); + float expTime = 0.f; + switch (mcID) { + case 0: + expTime = track.tofExpTimeEl(); + break; + case 1: + expTime = track.tofExpTimeMu(); + break; + case 2: + expTime = track.tofExpTimePi(); + break; + case 3: + expTime = track.tofExpTimeKa(); + break; + case 4: + expTime = track.tofExpTimePr(); + break; + case 5: + expTime = track.tofExpTimeDe(); + break; + case 6: + expTime = track.tofExpTimeTr(); + break; + case 7: + expTime = track.tofExpTimeHe(); + break; + case 8: + expTime = track.tofExpTimeAl(); + break; + default: + break; + } + const float delta = track.tofSignal() - expTime - particle.mcCollision().t() * 1000.f; + + hDeltaMCEvTime[mcID]->Fill(track.pt(), delta); if (checkPrimaries) { if (!particle.isPhysicalPrimary()) { if (particle.getProcess() == 4) { - histos.fill(HIST(hnsigmastr[mcID]), track.pt(), nsigma); + hNSigmastr[mcID]->Fill(track.pt(), nsigma); + hDeltaMCEvTimestr[mcID]->Fill(track.pt(), delta); } else { - histos.fill(HIST(hnsigmamat[mcID]), track.pt(), nsigma); + hNSigmamat[mcID]->Fill(track.pt(), nsigma); + hDeltaMCEvTimemat[mcID]->Fill(track.pt(), delta); } } else { - histos.fill(HIST(hnsigmaprm[mcID]), track.pt(), nsigma); + hNSigmaprm[mcID]->Fill(track.pt(), nsigma); + hDeltaMCEvTimeprm[mcID]->Fill(track.pt(), delta); } } switch (pdgSign.value) { case 0: - if (abs(particle.pdgCode()) != PDGs[mcID]) { + if (std::abs(particle.pdgCode()) != PDGs[mcID]) { return; } break; @@ -564,22 +525,48 @@ struct pidTofQaMc { } // Track info - histos.fill(HIST(htrackp[mcID]), track.p()); - histos.fill(HIST(htrackpt[mcID]), track.pt()); - histos.fill(HIST(htracketa[mcID]), track.eta()); - histos.fill(HIST(htracklength[mcID]), track.length()); + hTrackPt[mcID]->Fill(track.pt()); + hTrackP[mcID]->Fill(track.p()); + hTrackEta[mcID]->Fill(track.eta()); + hTrackLength[mcID]->Fill(track.length()); // PID info - histos.fill(HIST(hsignalMC[mcID]), track.p(), track.beta()); + const float beta = track.beta(); + // const float beta = track.tofBeta(); + hSignalMC[mcID]->Fill(track.p(), beta); + hDeltaMCEvTimeMC[mcID]->Fill(track.pt(), delta); + + if (track.mcMask() & (0x1 << 15) && track.mcMask() & (0x1 << 13)) { + hDeltaMCEvTimeMCBadMatch[mcID]->Fill(track.pt(), delta); + } else { + hDeltaMCEvTimeMCGoodMatch[mcID]->Fill(track.pt(), delta); + } + + // Check that the track collision and the particle collisions match + if (particle.isPhysicalPrimary()) { + if (track.template collision_as().mcCollision().globalIndex() != particle.mcCollision().globalIndex()) { + hDeltaMCEvTimeTrueBadEv[mcID]->Fill(track.pt(), delta); + } else { + hDeltaMCEvTimeTrueGoodEv[mcID]->Fill(track.pt(), delta); + } + } + + const float mcExpTime = calculateTimeOfFlight(track.tpcInnerParam(), track.length()); + // const float mcExpTime = calculateTimeOfFlight(particle.p(), track.length()); + hDeltaExpTimeMC[mcID]->Fill(track.pt(), expTime - mcExpTime); + if (checkPrimaries) { if (!particle.isPhysicalPrimary()) { if (particle.getProcess() == 4) { - histos.fill(HIST(hsignalMCstr[mcID]), track.p(), track.beta()); + hSignalMCstr[mcID]->Fill(track.p(), beta); + hDeltaMCEvTimeMCstr[mcID]->Fill(track.pt(), delta); } else { - histos.fill(HIST(hsignalMCmat[mcID]), track.p(), track.beta()); + hSignalMCmat[mcID]->Fill(track.p(), beta); + hDeltaMCEvTimeMCmat[mcID]->Fill(track.pt(), delta); } } else { - histos.fill(HIST(hsignalMCprm[mcID]), track.p(), track.beta()); + hSignalMCprm[mcID]->Fill(track.p(), beta); + hDeltaMCEvTimeMCprm[mcID]->Fill(track.pt(), delta); } } } @@ -639,7 +626,7 @@ struct pidTofQaMc { switch (pdgSign.value) { case 0: - if (abs(particle.pdgCode()) != PDGs[mcID]) { + if (std::abs(particle.pdgCode()) != PDGs[mcID]) { return; } break; @@ -659,29 +646,31 @@ struct pidTofQaMc { const float nsigmaMassID = o2::aod::pidutils::tofNSigma(track); - histos.fill(HIST(hnsigmaMC[mcID * Np + massID]), track.pt(), nsigmaMassID); + hNSigmaMC[mcID * Np + massID]->Fill(track.pt(), nsigmaMassID); if (checkPrimaries) { if (!particle.isPhysicalPrimary()) { if (particle.getProcess() == 4) { - histos.fill(HIST(hnsigmaMCstr[mcID * Np + massID]), track.pt(), nsigmaMassID); + hNSigmaMCstr[mcID * Np + massID]->Fill(track.pt(), nsigmaMassID); } else { - histos.fill(HIST(hnsigmaMCmat[mcID * Np + massID]), track.pt(), nsigmaMassID); + hNSigmaMCmat[mcID * Np + massID]->Fill(track.pt(), nsigmaMassID); } } else { - histos.fill(HIST(hnsigmaMCprm[mcID * Np + massID]), track.pt(), nsigmaMassID); + hNSigmaMCprm[mcID * Np + massID]->Fill(track.pt(), nsigmaMassID); } } } - Preslice perCol = aod::track::collisionId; - Preslice perMCCol = aod::mcparticle::mcCollisionId; - - void process(soa::Join const& collisions, - soa::Join& tracks, + aod::TOFSignal, aod::McTrackLabels, aod::pidTOFbeta>; + using Colls = soa::Join; + Preslice perCol = aod::track::collisionId; + Preslice perMCCol = aod::mcparticle::mcCollisionId; + + void process(Colls const& collisions, + Trks& tracks, aod::McParticles& mcParticles, aod::McCollisions&) { @@ -689,10 +678,12 @@ struct pidTofQaMc { if (collision.numContrib() < nMinNumberOfContributors) { return; } + if (!collision.sel8()) { + continue; + } if (!collision.has_mcCollision()) { continue; } - const auto tracksInCollision = tracks.sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); const auto particlesInCollision = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, collision.mcCollision().globalIndex(), cache); for (const auto& p : particlesInCollision) { @@ -701,52 +692,66 @@ struct pidTofQaMc { }); } + const auto& tracksInCollision = tracks.sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + // tracksInCollision.bindExternalIndices(&mcParticles); + // const auto& tracksWithPid = soa::Attach(tracksInCollision); + // tracksInCollision.copyIndexBindings(tracksWithPid); const float collisionTime_ps = collision.collisionTime() * 1000.f; unsigned int nTracksWithTOF = 0; - for (const auto& t : tracksInCollision) { + for (const auto& track : tracksInCollision) { // - if (!t.hasTOF()) { // Skipping tracks without TOF + if (!track.hasTOF()) { // Skipping tracks without TOF continue; } - if (t.eta() < minEta || t.eta() > maxEta) { + if (track.eta() < minEta || track.eta() > maxEta) { continue; } nTracksWithTOF++; // Fill for all - histos.fill(HIST("event/tofbeta"), t.p(), t.beta()); - if (!t.has_mcParticle()) { + // const float beta = track.tofBeta(); + const float beta = track.beta(); + histos.fill(HIST("event/tofbeta"), track.p(), beta); + if (!track.has_mcParticle()) { continue; } - const auto& particle = t.mcParticle(); + std::bitset<16> bits(track.mcMask()); + // LOG(info) << "Using bitset: " << bits; + if (bits[15]) { + histos.fill(HIST("event/tofbadmatch"), track.pt()); + } else { + histos.fill(HIST("event/tofgoodmatch"), track.pt()); + } + + const auto& particle = track.mcParticle(); if (checkPrimaries) { if (!particle.isPhysicalPrimary()) { - // histos.fill(HIST("event/tofbetaSec"), t.p(), t.beta()); + // histos.fill(HIST("event/tofbetaSec"), track.p(), beta); if (particle.getProcess() == 4) { - histos.fill(HIST("event/tofbetaStr"), t.tpcInnerParam(), t.tpcSignal()); + histos.fill(HIST("event/tofbetaStr"), track.tpcInnerParam(), track.tpcSignal()); } else { - histos.fill(HIST("event/tofbetaMat"), t.tpcInnerParam(), t.tpcSignal()); + histos.fill(HIST("event/tofbetaMat"), track.tpcInnerParam(), track.tpcSignal()); } } else { - histos.fill(HIST("event/tofbetaPrm"), t.p(), t.beta()); + histos.fill(HIST("event/tofbetaPrm"), track.p(), beta); } } // Fill with PDG codes static_for<0, 8>([&](auto i) { static_for<0, 8>([&](auto j) { - fillPIDInfoForPdg(t, particle); + fillPIDInfoForPdg(track, particle); }); - fillTrackInfoForPdg(t, particle); + fillTrackInfoForPdg(track, particle); }); } // track loop histos.fill(HIST("event/T0"), nTracksWithTOF, collisionTime_ps); histos.fill(HIST("event/vertexz"), collision.posZ()); } // collision loop - } // process() + } // process() }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 3f686e18d0ada914242373a509ea24355c5113ac Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:32:42 +0100 Subject: [PATCH 374/459] [PWGEM/PhotonMeson] Fix abs in emcalQC task (#8957) Co-authored-by: Nicolas Strangmann --- PWGEM/PhotonMeson/Tasks/emcalQC.cxx | 97 +++++++++++++++-------------- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx index 0b5be17d212..8ed00c1f50e 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx @@ -9,10 +9,14 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // -// ======================== -// -// This code runs loop over EMCal clusters for EMCal QC. -// Please write to: nicolas.strangmann@cern.ch +/// EMCAL QC Task +/// +/// \file emcalQC.cxx +/// +/// \brief Task that runs basic EMCal cluster QA for derived data in the EM format +/// +/// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) Goethe University Frankfurt +/// #include #include @@ -50,10 +54,10 @@ using MyCollision = MyCollisions::iterator; using MyEMCClusters = soa::Join; using MyEMCCluster = MyEMCClusters::iterator; -struct emcalQC { +struct EmcalQC { Configurable cfgDo2DQA{"cfgDo2DQA", true, "perform 2 dimensional cluster QA"}; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + ConfigurableAxis confVtxBins{"confVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; EMPhotonEventCut fEMEventCut; struct : ConfigurableGroup { @@ -78,19 +82,19 @@ struct emcalQC { std::string prefix = "emccut_group"; Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; - Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; - Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; - Configurable EMC_minM02{"EMC_minM02", 0.1, "Minimum M02 for EMCal M02 cut"}; - Configurable EMC_maxM02{"EMC_maxM02", 0.7, "Maximum M02 for EMCal M02 cut"}; - Configurable EMC_minE{"EMC_minE", 0.7, "Minimum cluster energy for EMCal energy cut"}; - Configurable EMC_minNCell{"EMC_minNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; - Configurable> EMC_TM_Eta{"EMC_TM_Eta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; - Configurable> EMC_TM_Phi{"EMC_TM_Phi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; - Configurable EMC_Eoverp{"EMC_Eoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; - Configurable EMC_UseExoticCut{"EMC_UseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; + Configurable minClusterTime{"minClusterTime", -20., "Minimum cluster time for EMCal time cut"}; + Configurable maxClusterTime{"maxClusterTime", +25., "Maximum cluster time for EMCal time cut"}; + Configurable minM02{"minM02", 0.1, "Minimum M02 for EMCal M02 cut"}; + Configurable maxM02{"maxM02", 0.7, "Maximum M02 for EMCal M02 cut"}; + Configurable minClusterE{"minClusterE", 0.7, "Minimum cluster energy for EMCal energy cut"}; + Configurable minNCell{"minNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; + Configurable> tmEta{"tmEta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + Configurable> tmPhi{"tmPhi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + Configurable tmEoverP{"tmEoverP", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; + Configurable useExoticCut{"useExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; } emccuts; - void DefineEMEventCut() + void defineEMEventCut() { fEMEventCut = EMPhotonEventCut("fEMEventCut", "fEMEventCut"); fEMEventCut.SetRequireSel8(eventcuts.cfgRequireSel8); @@ -105,40 +109,40 @@ struct emcalQC { fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); } - void DefineEMCCut() + void defineEMCCut() { - const float a = emccuts.EMC_TM_Eta->at(0); - const float b = emccuts.EMC_TM_Eta->at(1); - const float c = emccuts.EMC_TM_Eta->at(2); + const float a = emccuts.tmEta->at(0); + const float b = emccuts.tmEta->at(1); + const float c = emccuts.tmEta->at(2); - const float d = emccuts.EMC_TM_Phi->at(0); - const float e = emccuts.EMC_TM_Phi->at(1); - const float f = emccuts.EMC_TM_Phi->at(2); + const float d = emccuts.tmPhi->at(0); + const float e = emccuts.tmPhi->at(1); + const float f = emccuts.tmPhi->at(2); LOGF(info, "EMCal track matching parameters : a = %f, b = %f, c = %f, d = %f, e = %f, f = %f", a, b, c, d, e, f); fEMCCut.SetClusterizer(emccuts.clusterDefinition); - fEMCCut.SetMinE(emccuts.EMC_minE); - fEMCCut.SetMinNCell(emccuts.EMC_minNCell); - fEMCCut.SetM02Range(emccuts.EMC_minM02, emccuts.EMC_maxM02); - fEMCCut.SetTimeRange(emccuts.EMC_minTime, emccuts.EMC_maxTime); + fEMCCut.SetMinE(emccuts.minClusterE); + fEMCCut.SetMinNCell(emccuts.minNCell); + fEMCCut.SetM02Range(emccuts.minM02, emccuts.maxM02); + fEMCCut.SetTimeRange(emccuts.minClusterTime, emccuts.maxClusterTime); - fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + pow(pT + b, c); }); - fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + pow(pT + e, f); }); + fEMCCut.SetTrackMatchingEta([a, b, c](float pT) { return a + std::pow(pT + b, c); }); + fEMCCut.SetTrackMatchingPhi([d, e, f](float pT) { return d + std::pow(pT + e, f); }); - fEMCCut.SetMinEoverP(emccuts.EMC_Eoverp); - fEMCCut.SetUseExoticCut(emccuts.EMC_UseExoticCut); + fEMCCut.SetMinEoverP(emccuts.tmEoverP); + fEMCCut.SetUseExoticCut(emccuts.useExoticCut); } HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; - std::vector zvtx_bin_edges; + std::vector zVtxBinEdges; void init(InitContext&) { - zvtx_bin_edges = std::vector(ConfVtxBins.value.begin(), ConfVtxBins.value.end()); - zvtx_bin_edges.erase(zvtx_bin_edges.begin()); + zVtxBinEdges = std::vector(confVtxBins.value.begin(), confVtxBins.value.end()); + zVtxBinEdges.erase(zVtxBinEdges.begin()); - DefineEMCCut(); - DefineEMEventCut(); + defineEMCCut(); + defineEMEventCut(); o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); auto hEMCCollisionCounter = fRegistry.add("Event/hEMCCollisionCounter", "Number of collisions after event cuts", HistType::kTH1F, {{7, 0.5, 7.5}}, false); @@ -156,16 +160,16 @@ struct emcalQC { void processQC(MyCollisions const& collisions, MyEMCClusters const& clusters) { - for (auto& collision : collisions) { + for (const auto& collision : collisions) { - if (eventcuts.onlyKeepWeightedEvents && fabs(collision.weight() - 1.) < 1E-10) { + if (eventcuts.onlyKeepWeightedEvents && std::fabs(collision.weight() - 1.) < 1E-10) { continue; } fRegistry.fill(HIST("Event/hEMCCollisionCounter"), 1); if (collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { fRegistry.fill(HIST("Event/hEMCCollisionCounter"), 2); - if (abs(collision.posZ()) < eventcuts.cfgZvtxMax) { + if (std::abs(collision.posZ()) < eventcuts.cfgZvtxMax) { fRegistry.fill(HIST("Event/hEMCCollisionCounter"), 3); if (collision.sel8()) { fRegistry.fill(HIST("Event/hEMCCollisionCounter"), 4); @@ -193,11 +197,11 @@ struct emcalQC { fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted - auto clusters_per_coll = clusters.sliceBy(perCollision, collision.collisionId()); - fRegistry.fill(HIST("Cluster/before/hNgamma"), clusters_per_coll.size(), collision.weight()); + auto clustersPerColl = clusters.sliceBy(perCollision, collision.collisionId()); + fRegistry.fill(HIST("Cluster/before/hNgamma"), clustersPerColl.size(), collision.weight()); int ngBefore = 0; int ngAfter = 0; - for (auto& cluster : clusters_per_coll) { + for (const auto& cluster : clustersPerColl) { // Fill the cluster properties before applying any cuts if (!fEMCCut.IsSelectedEMCal(EMCPhotonCut::EMCPhotonCuts::kDefinition, cluster)) continue; @@ -236,12 +240,11 @@ struct emcalQC { void processDummy(MyCollisions const&) {} - PROCESS_SWITCH(emcalQC, processQC, "run EMCal QC", false); - PROCESS_SWITCH(emcalQC, processDummy, "Dummy function", true); + PROCESS_SWITCH(EmcalQC, processQC, "run EMCal QC", false); + PROCESS_SWITCH(EmcalQC, processDummy, "Dummy function", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{ - adaptAnalysisTask(cfgc, TaskName{"emcal-qc"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 03c43b89770d1e763e491934fe3ead020b16b83d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 13 Dec 2024 13:18:04 +0100 Subject: [PATCH 375/459] [Infrastructure] Bump MegaLinter to v8.3.0 (#8976) --- .github/workflows/mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index 28bb7877865..90f11945ac0 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -38,7 +38,7 @@ jobs: id: ml # You can override MegaLinter flavor used to have faster performances # More info at https://megalinter.io/flavors/ - uses: oxsecurity/megalinter@v8.1.0 + uses: oxsecurity/megalinter@v8.3.0 env: # All available variables are described in documentation: # https://megalinter.io/configuration/ From 708a7ec88ae56605cd352075b418bd37e844beb5 Mon Sep 17 00:00:00 2001 From: Marvin Hemmer <53471402+mhemmer-cern@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:54:50 +0100 Subject: [PATCH 376/459] [PWGEM] [PWGEM-36] Cut on edge clusters for neutral meson flow (#8977) Co-authored-by: ALICE Action Bot --- PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx | 37 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx index e99f1dba904..e059ab8a74f 100644 --- a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx @@ -559,7 +559,7 @@ struct TaskPi0FlowEMC { auto [xQVec, yQVec] = getQvec(collision, qvecDetector); float cent = getCentrality(collision); int iCellIDPhoton1 = 0; - int iCellIDPhoton = 0; + int iCellIDPhoton2 = 0; ROOT::Math::AxisAngle rotationAxis(meson.Vect(), cfgRotAngle.value); ROOT::Math::Rotation3D rotationMatrix(rotationAxis); @@ -575,15 +575,15 @@ struct TaskPi0FlowEMC { iCellIDPhoton1 = -1; } try { - iCellIDPhoton = emcalGeom->GetAbsCellIdFromEtaPhi(photon2.Eta(), photon2.Phi()); - if (isTooCloseToEdge(iCellIDPhoton, cfgDistanceToEdge.value)) { - iCellIDPhoton = -1; + iCellIDPhoton2 = emcalGeom->GetAbsCellIdFromEtaPhi(photon2.Eta(), photon2.Phi()); + if (isTooCloseToEdge(iCellIDPhoton2, cfgDistanceToEdge.value)) { + iCellIDPhoton2 = -1; } } catch (o2::emcal::InvalidPositionException& e) { - iCellIDPhoton = -1; + iCellIDPhoton2 = -1; } - if (iCellIDPhoton1 == -1 && iCellIDPhoton == -1) { + if (iCellIDPhoton1 == -1 && iCellIDPhoton2 == -1) { return; } for (const auto& photon : photons_coll) { @@ -618,7 +618,7 @@ struct TaskPi0FlowEMC { } } } - if (iCellIDPhoton > 0) { + if (iCellIDPhoton2 > 0) { ROOT::Math::PtEtaPhiMVector mother2 = photon2 + photon3; float openingAngle2 = std::acos(photon2.Vect().Dot(photon3.Vect()) / (photon2.P() * photon3.P())); float cosNPhi2 = std::cos(harmonic * mother2.Phi()); @@ -738,6 +738,29 @@ struct TaskPi0FlowEMC { if (!(fEMCCut.IsSelected(g1)) || !(fEMCCut.IsSelected(g2))) { continue; } + + // Cut edge clusters away, similar to rotation method to ensure same acceptance is used + if (cfgDistanceToEdge.value) { + int iCellIDPhoton1 = -1; + int iCellIDPhoton2 = -1; + try { + iCellIDPhoton1 = emcalGeom->GetAbsCellIdFromEtaPhi(g1.eta(), g1.phi()); + if (isTooCloseToEdge(iCellIDPhoton1, cfgDistanceToEdge.value)) { + continue; + } + } catch (o2::emcal::InvalidPositionException& e) { + continue; + } + try { + iCellIDPhoton2 = emcalGeom->GetAbsCellIdFromEtaPhi(g2.eta(), g2.phi()); + if (isTooCloseToEdge(iCellIDPhoton2, cfgDistanceToEdge.value)) { + continue; + } + } catch (o2::emcal::InvalidPositionException& e) { + continue; + } + } + ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); ROOT::Math::PtEtaPhiMVector vMeson = v1 + v2; From f8b8e68f1359cd0fe44044126bdd5fef0f97fe98 Mon Sep 17 00:00:00 2001 From: Sigurd Nese <32108009+sigurdnese@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:06:26 +0100 Subject: [PATCH 377/459] [PWGDQ] Add open charm MC analyses (#8894) Co-authored-by: ALICE Builder --- PWGDQ/Core/CutsLibrary.cxx | 36 + PWGDQ/Core/HistogramsLibrary.cxx | 2 + PWGDQ/Core/MCSignalLibrary.cxx | 120 +++ PWGDQ/Core/VarManager.cxx | 2 + PWGDQ/Core/VarManager.h | 35 +- PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 1106 +++++++++++++++++++++++- PWGDQ/Tasks/tableReader_withAssoc.cxx | 13 +- 7 files changed, 1267 insertions(+), 47 deletions(-) diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index 20ae5000bc8..2f6ad8a958e 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -3172,6 +3172,27 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) return cut; } + if (!nameStr.compare("pairCosPointingPos")) { + cut->AddCut(GetAnalysisCut("pairCosPointingPos")); + return cut; + } + + if (!nameStr.compare("pairCosPointingNeg90")) { + cut->AddCut(GetAnalysisCut("pairCosPointingNeg90")); + return cut; + } + + if (!nameStr.compare("pairCosPointingNeg85")) { + cut->AddCut(GetAnalysisCut("pairCosPointingNeg85")); + return cut; + } + + if (!nameStr.compare("pairTauxyzProjectedCosPointing1")) { + cut->AddCut(GetAnalysisCut("pairCosPointingNeg")); + cut->AddCut(GetAnalysisCut("pairTauxyzProjected1")); + return cut; + } + // ------------------------------------------------------------------------------------------------- // // Below are a list of single electron single muon and in order or optimize the trigger @@ -5962,6 +5983,21 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("pairCosPointingPos")) { + cut->AddCut(VarManager::kCosPointingAngle, 0.9, 1000.); + return cut; + } + + if (!nameStr.compare("pairCosPointingNeg90")) { + cut->AddCut(VarManager::kCosPointingAngle, -1000., -0.9); + return cut; + } + + if (!nameStr.compare("pairCosPointingNeg85")) { + cut->AddCut(VarManager::kCosPointingAngle, -1000., -0.85); + return cut; + } + // ------------------------------------------------------------------------------------------------- // // Below are a list of single electron single muon and pair selection in order or optimize the trigger diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index c55f34bf1c9..c8eac97666b 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -941,6 +941,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "LxyProj_Pt", "", false, 10, 0.0, 20.0, VarManager::kPt, 1000, -1.0, 1.0, VarManager::kVertexingLxyProjected); hm->AddHistogram(histClass, "LxyProj_Mass_Pt", "", false, 50, 2.0, 4.0, VarManager::kMass, 10, 0.0, 20.0, VarManager::kPt, 1000, -1.0, 1.0, VarManager::kVertexingLxyProjected); hm->AddHistogram(histClass, "LzProj_Mass_Pt", "", false, 50, 2.0, 4.0, VarManager::kMass, 10, 0.0, 20.0, VarManager::kPt, 1000, -1.0, 1.0, VarManager::kVertexingLzProjected); + hm->AddHistogram(histClass, "CosPointingAngle", "", false, 200, -1.0, 1.0, VarManager::kCosPointingAngle); } if (subGroupStr.Contains("kalman-filter")) { @@ -1378,6 +1379,7 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "MassD0region_Rapidity", "", false, 140, 1.5, 2.2, VarManager::kMass, 10, -0.8, 0.8, VarManager::kRap); hm->AddHistogram(histClass, "MassD0region_eta", "", false, 140, 1.5, 2.2, VarManager::kMass, 40, -2., 2., VarManager::kEta); hm->AddHistogram(histClass, "MassD0region_TauxyzProj", "", false, 140, 1.5, 2.2, VarManager::kMass, 200, -0.03, 0.03, VarManager::kVertexingTauxyzProjected); + hm->AddHistogram(histClass, "MassD0region_CosPointing", "", false, 140, 1.5, 2.2, VarManager::kMass, 200, -1.0, 1.0, VarManager::kCosPointingAngle); hm->AddHistogram(histClass, "MassD0region_VtxNContribReal", "", false, 140, 1.5, 2.2, VarManager::kMass, 50, 0, 50, VarManager::kVtxNcontribReal); hm->AddHistogram(histClass, "MassD0region_Rapidity_AveragePt", "", true, 140, 1.5, 2.2, VarManager::kMass, 10, -0.8, 0.8, VarManager::kRap, 150, 0.0, 30.0, VarManager::kPt); } diff --git a/PWGDQ/Core/MCSignalLibrary.cxx b/PWGDQ/Core/MCSignalLibrary.cxx index 22f445252f9..6cef5603b9a 100644 --- a/PWGDQ/Core/MCSignalLibrary.cxx +++ b/PWGDQ/Core/MCSignalLibrary.cxx @@ -1185,6 +1185,126 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) return signal; } + //------------------------------------------------------------------------------------ + + if (!nameStr.compare("D0")) { + MCProng prong(1, {Pdg::kD0}, {true}, {false}, {0}, {0}, {false}); + signal = new MCSignal(name, "D0", {prong}, {-1}); + return signal; + } + if (!nameStr.compare("KPiFromD0")) { + MCProng prongKaon(2, {321, Pdg::kD0}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + MCProng prongPion(2, {211, Pdg::kD0}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Kaon and pion pair from D0", {prongKaon, prongPion}, {1, 1}); + return signal; + } + if (!nameStr.compare("Dcharged")) { + MCProng prong(1, {Pdg::kDPlus}, {true}, {false}, {0}, {0}, {false}); + signal = new MCSignal(name, "D+/-", {prong}, {-1}); + return signal; + } + if (!nameStr.compare("Dplus")) { + MCProng prong(1, {Pdg::kDPlus}, {false}, {false}, {0}, {0}, {false}); + signal = new MCSignal(name, "D+", {prong}, {-1}); + return signal; + } + if (!nameStr.compare("Dminus")) { + MCProng prong(1, {-Pdg::kDPlus}, {false}, {false}, {0}, {0}, {false}); + signal = new MCSignal(name, "D+", {prong}, {-1}); + return signal; + } + if (!nameStr.compare("KPiPiFromDcharged")) { + MCProng prongKaon(2, {321, Pdg::kDPlus}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + MCProng prongPion(2, {211, Pdg::kDPlus}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Kaon pion pion triplet from D+/-", {prongKaon, prongPion, prongPion}, {1, 1, 1}); + return signal; + } + if (!nameStr.compare("KPiPiFromDplus")) { + MCProng prongKaon(2, {-321, Pdg::kDPlus}, {false, false}, {false, false}, {0, 0}, {0, 0}, {false, false}); + MCProng prongPion(2, {211, Pdg::kDPlus}, {false, false}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Kaon pion pion triplet from D+", {prongKaon, prongPion, prongPion}, {1, 1, 1}); + return signal; + } + if (!nameStr.compare("KPiPiFromDminus")) { + MCProng prongKaon(2, {321, -Pdg::kDPlus}, {false, false}, {false, false}, {0, 0}, {0, 0}, {false, false}); + MCProng prongPion(2, {-211, -Pdg::kDPlus}, {false, false}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Kaon pion pion triplet from D-", {prongKaon, prongPion, prongPion}, {1, 1, 1}); + return signal; + } + if (!nameStr.compare("Dstar")) { + MCProng prong(1, {Pdg::kDStar}, {true}, {false}, {0}, {0}, {false}); + signal = new MCSignal(name, "D*", {prong}, {-1}); + return signal; + } + if (!nameStr.compare("DstarPlus")) { + MCProng prong(1, {Pdg::kDStar}, {false}, {false}, {0}, {0}, {false}); + signal = new MCSignal(name, "D*+", {prong}, {-1}); + return signal; + } + if (!nameStr.compare("DstarMinus")) { + MCProng prong(1, {-Pdg::kDStar}, {false}, {false}, {0}, {0}, {false}); + signal = new MCSignal(name, "D*-", {prong}, {-1}); + return signal; + } + if (!nameStr.compare("pionFromDstar")) { + MCProng prong(2, {211, Pdg::kDStar}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Pions from D* decays", {prong}, {1}); + return signal; + } + if (!nameStr.compare("D0FromDstar")) { + MCProng prong(2, {Pdg::kD0, Pdg::kDStar}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "D0 from D* decays", {prong}, {1}); + return signal; + } + if (!nameStr.compare("KFromD0FromDstar")) { + MCProng prong(3, {321, Pdg::kD0, Pdg::kDStar}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + signal = new MCSignal(name, "Kaons from D0 from D* decays", {prong}, {1}); + return signal; + } + if (!nameStr.compare("PiFromD0FromDstar")) { + MCProng prong(3, {211, Pdg::kD0, Pdg::kDStar}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + signal = new MCSignal(name, "Pions from D0 from D* decays", {prong}, {1}); + return signal; + } + if (!nameStr.compare("KPiFromD0FromDstar")) { + MCProng prongKaon(3, {321, Pdg::kD0, Pdg::kDStar}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + MCProng prongPion(3, {321, Pdg::kD0, Pdg::kDStar}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + signal = new MCSignal(name, "Kaon and pion pair from D0 from D* decay", {prongKaon, prongPion}, {1, 1}); + return signal; + } + if (!nameStr.compare("KPiPiFromD0FromDstar")) { + MCProng prongKaon(3, {321, Pdg::kD0, Pdg::kDStar}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + MCProng prongPionSecondary(3, {211, Pdg::kD0, Pdg::kDStar}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + MCProng prongPion(2, {211, Pdg::kDStar}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Kaon pion pion triplet from D*", {prongKaon, prongPionSecondary, prongPion}, {2, 2, 1}); + return signal; + } + if (!nameStr.compare("KPiPiFromD0FromDstarPlus")) { + MCProng prongKaon(3, {-321, Pdg::kD0, Pdg::kDStar}, {false, false, false}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + MCProng prongPionSecondary(3, {211, Pdg::kD0, Pdg::kDStar}, {false, false, false}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + MCProng prongPion(2, {211, Pdg::kDStar}, {false, false}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Kaon pion pion triplet from D*+", {prongKaon, prongPionSecondary, prongPion}, {2, 2, 1}); + return signal; + } + if (!nameStr.compare("KPiPiFromD0FromDstarMinus")) { + MCProng prongKaon(3, {321, Pdg::kD0, Pdg::kDStar}, {false, false, false}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + MCProng prongPionSecondary(3, {-211, Pdg::kD0, Pdg::kDStar}, {false, false, false}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); + MCProng prongPion(2, {-211, Pdg::kDStar}, {false, false}, {false, false}, {0, 0}, {0, 0}, {false, false}); + signal = new MCSignal(name, "Kaon pion pion triplet from D*-", {prongKaon, prongPionSecondary, prongPion}, {2, 2, 1}); + return signal; + } + if (!nameStr.compare("KFromDplus")) { + MCProng prong(2, {321, Pdg::kDPlus}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}, false, {502}, {true}); + prong.SetSourceBit(0, MCProng::kPhysicalPrimary); + signal = new MCSignal(name, "Kaons from D+/- decays", {prong}, {-1}); + return signal; + } + if (!nameStr.compare("LambdaC")) { + MCProng prong(1, {Pdg::kLambdaCPlus}, {true}, {false}, {0}, {0}, {false}); + signal = new MCSignal(name, "Lambda_c", {prong}, {-1}); + return signal; + } + //-------------------------------------------------------------------------------- if (!nameStr.compare("JpsiFromChic0")) { diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index 77de7838f8e..91315f7069c 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -642,6 +642,8 @@ void VarManager::SetDefaultVarNames() fgVariableUnits[kVertexingLzOverErr] = ""; fgVariableNames[kVertexingLxyzOverErr] = "Pair Lxyz/DLxyz"; fgVariableUnits[kVertexingLxyzOverErr] = ""; + fgVariableNames[kCosPointingAngle] = "Cos #theta_{pointing}"; + fgVariableUnits[kCosPointingAngle] = ""; fgVariableNames[kKFTrack0DCAxyz] = "Daughter0 DCAxyz"; fgVariableUnits[kKFTrack0DCAxyz] = "cm"; fgVariableNames[kKFTrack1DCAxyz] = "Daughter1 DCAxyz"; diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index bf328b6fa0c..6a2443dc3bb 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -146,7 +146,6 @@ class VarManager : public TObject kDecayToKPi, // e.g. D0 -> K+ pi- or cc. kTripleCandidateToKPiPi, // e.g. D+ -> K- pi+ pi+ kTripleCandidateToPKPi, // e.g. Lambda_c -> p K- pi+ - kTripleCandidateToKKPi, // e.g. D_s -> K+ K- pi+ kNMaxCandidateTypes }; @@ -2885,21 +2884,6 @@ void VarManager::FillTriple(T1 const& t1, T2 const& t2, T3 const& t3, float* val values[kPhi] = v123.Phi(); values[kRap] = -v123.Rapidity(); } - - if (pairType == kTripleCandidateToKKPi) { - float m1 = o2::constants::physics::MassKaonCharged; - float m2 = o2::constants::physics::MassPionCharged; - - ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), m1); - ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), m1); - ROOT::Math::PtEtaPhiMVector v3(t3.pt(), t3.eta(), t3.phi(), m2); - ROOT::Math::PtEtaPhiMVector v123 = v1 + v2 + v3; - values[kMass] = v123.M(); - values[kPt] = v123.Pt(); - values[kEta] = v123.Eta(); - values[kPhi] = v123.Phi(); - values[kRap] = -v123.Rapidity(); - } } template @@ -3063,6 +3047,21 @@ void VarManager::FillTripleMC(T1 const& t1, T2 const& t2, T3 const& t3, float* v values[kPt1] = t1.pt(); values[kPt2] = t2.pt(); } + + if (pairType == kTripleCandidateToKPiPi) { + float m1 = o2::constants::physics::MassKaonCharged; + float m2 = o2::constants::physics::MassPionCharged; + + ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), m1); + ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), m2); + ROOT::Math::PtEtaPhiMVector v3(t3.pt(), t3.eta(), t3.phi(), m2); + ROOT::Math::PtEtaPhiMVector v123 = v1 + v2 + v3; + values[kMass] = v123.M(); + values[kPt] = v123.Pt(); + values[kEta] = v123.Eta(); + values[kPhi] = v123.Phi(); + values[kRap] = -v123.Rapidity(); + } } template @@ -3574,6 +3573,10 @@ void VarManager::FillTripletVertexing(C const& collision, T const& t1, T const& values[kVertexingTauzErr] = values[kVertexingLzErr] * v123.M() / (TMath::Abs(v123.Pz()) * o2::constants::physics::LightSpeedCm2NS); values[kVertexingTauxyErr] = values[kVertexingLxyErr] * v123.M() / (v123.Pt() * o2::constants::physics::LightSpeedCm2NS); + values[kCosPointingAngle] = ((collision.posX() - secondaryVertex[0]) * v123.Px() + + (collision.posY() - secondaryVertex[1]) * v123.Py() + + (collision.posZ() - secondaryVertex[2]) * v123.Pz()) / + (v123.P() * values[VarManager::kVertexingLxyz]); // run 2 definitions: Decay length projected onto the momentum vector of the candidate values[kVertexingLzProjected] = (secondaryVertex[2] - collision.posZ()) * v123.Pz(); values[kVertexingLzProjected] = values[kVertexingLzProjected] / TMath::Sqrt(v123.Pz() * v123.Pz()); diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 62dfcd46652..7cdb426d55e 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -29,6 +29,7 @@ #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" #include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisHelpers.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/Core/HistogramManager.h" @@ -106,6 +107,7 @@ using MyBarrelTracksWithCov = soa::Join; using MyBarrelTracksWithCovWithAmbiguitiesWithColl = soa::Join; using MyDielectronCandidates = soa::Join; +using MyDitrackCandidates = soa::Join; using MyDimuonCandidates = soa::Join; using MyMuonTracks = soa::Join; using MyMuonTracksWithCov = soa::Join; @@ -1878,6 +1880,922 @@ struct AnalysisSameEventPairing { PROCESS_SWITCH(AnalysisSameEventPairing, processDummy, "Dummy function, enabled only if none of the others are enabled", false); }; +// Run pairing for resonance with legs fulfilling separate cuts (asymmetric decay channel) +struct AnalysisAsymmetricPairing { + + Produces ditrackList; + Produces ditrackExtraList; + + o2::base::MatLayerCylSet* fLUT = nullptr; + int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. + + // Output objects + OutputObj fOutputList{"output"}; + + // Configurables + Configurable fConfigLegCuts{"cfgLegCuts", "", ":[:],[:[:],...]"}; + Configurable fConfigLegAFilterMask{"cfgLegAFilterMask", 0, "Filter mask corresponding to cuts in event-selection"}; + Configurable fConfigLegBFilterMask{"cfgLegBFilterMask", 0, "Filter mask corresponding to cuts in event-selection"}; + Configurable fConfigLegCFilterMask{"cfgLegCFilterMask", 0, "Filter mask corresponding to cuts in event-selection"}; + Configurable fConfigCommonTrackCuts{"cfgCommonTrackCuts", "", "Comma separated list of cuts to be applied to all legs"}; + Configurable fConfigPairCuts{"cfgPairCuts", "", "Comma separated list of pair cuts"}; + Configurable fConfigSkipAmbiguousIdCombinations{"cfgSkipAmbiguousIdCombinations", true, "Choose whether to skip pairs/triples which pass a stricter combination of cuts, e.g. KKPi triplets for D+ -> KPiPi"}; + + Configurable fConfigHistogramSubgroups{"cfgAsymmetricPairingHistogramsSubgroups", "barrel,vertexing", "Comma separated list of asymmetric-pairing histogram subgroups"}; + Configurable fConfigSameSignHistograms{"cfgSameSignHistograms", false, "Include same sign pair histograms for 2-prong decays"}; + // Configurable fConfigAmbiguousHistograms{"cfgAmbiguousHistograms", false, "Include separate histograms for pairs/triplets with ambiguous tracks"}; + Configurable fConfigQA{"cfgQA", false, "If true, fill QA histograms"}; + + Configurable fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable fConfigGRPMagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable fConfigUseRemoteField{"cfgUseRemoteField", false, "Choose whether to fetch the magnetic field from ccdb or set it manually"}; + Configurable fConfigMagField{"cfgMagField", 5.0f, "Manually set magnetic field"}; + + Configurable fConfigUseKFVertexing{"cfgUseKFVertexing", false, "Use KF Particle for secondary vertex reconstruction (DCAFitter is used by default)"}; + Configurable fConfigUseAbsDCA{"cfgUseAbsDCA", false, "Use absolute DCA minimization instead of chi^2 minimization in secondary vertexing"}; + Configurable fConfigPropToPCA{"cfgPropToPCA", false, "Propagate tracks to secondary vertex"}; + Configurable fConfigLutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; + + Configurable fConfigRunMCGenPair{"cfgRunMCGenPair", false, "Do pairing of true MC particles"}; + Configurable fConfigMCGenSignals{"cfgBarrelMCGenSignals", "", "Comma separated list of MC signals (generated)"}; + Configurable fConfigMCRecSignals{"cfgBarrelMCRecSignals", "", "Comma separated list of MC signals (reconstructed)"}; + + Service fCCDB; + + HistogramManager* fHistMan; + + std::map> fTrackHistNames; + std::map> fBarrelHistNamesMCmatched; + std::vector fPairCuts; + + std::vector fRecMCSignals; + std::vector fGenMCSignals; + + // Filter masks to find legs in BarrelTrackCuts table + uint32_t fLegAFilterMask; + uint32_t fLegBFilterMask; + uint32_t fLegCFilterMask; + // Map tracking which pair of leg cuts the track cuts participate in + std::map fTrackCutFilterMasks; + // Filter map for common track cuts + uint32_t fCommonTrackCutMask; + // Map tracking which common track cut the track cuts correspond to + std::map fCommonTrackCutFilterMasks; + + int fNLegCuts; + int fNPairCuts = 0; + int fNCommonTrackCuts; + + Preslice> trackAssocsPerCollision = aod::reducedtrack_association::reducedeventId; + + // Partitions for triplets and asymmetric pairs + Partition> legACandidateAssocs = (o2::aod::dqanalysisflags::isBarrelSelected & fConfigLegAFilterMask) > static_cast(0); + Partition> legBCandidateAssocs = (o2::aod::dqanalysisflags::isBarrelSelected & fConfigLegBFilterMask) > static_cast(0); + Partition> legCCandidateAssocs = (o2::aod::dqanalysisflags::isBarrelSelected & fConfigLegCFilterMask) > static_cast(0); + + void init(o2::framework::InitContext& context) + { + if (context.mOptions.get("processDummy")) { + return; + } + + TString histNames = ""; + std::vector names; + + // Get the leg cut filter maps + fLegAFilterMask = fConfigLegAFilterMask.value; + fLegBFilterMask = fConfigLegBFilterMask.value; + fLegCFilterMask = fConfigLegCFilterMask.value; + // Get the pair cuts + TString cutNamesStr = fConfigPairCuts.value; + if (!cutNamesStr.IsNull()) { + std::unique_ptr objArray(cutNamesStr.Tokenize(",")); + for (int icut = 0; icut < objArray->GetEntries(); ++icut) { + fPairCuts.push_back(*dqcuts::GetCompositeCut(objArray->At(icut)->GetName())); + } + } + + // Setting the MC rec signal names + TString sigNamesStr = fConfigMCRecSignals.value; + std::unique_ptr objRecSigArray(sigNamesStr.Tokenize(",")); + + for (int isig = 0; isig < objRecSigArray->GetEntries(); ++isig) { + MCSignal* sig = o2::aod::dqmcsignals::GetMCSignal(objRecSigArray->At(isig)->GetName()); + if (sig) { + fRecMCSignals.push_back(*sig); + } + } + + // Get the barrel track selection cuts + string tempCuts; + getTaskOptionValue(context, "analysis-track-selection", "cfgTrackCuts", tempCuts, false); + TString tempCutsStr = tempCuts; + std::unique_ptr objArray(tempCutsStr.Tokenize(",")); + // Get the common leg cuts + int commonCutIdx; + TString commonNamesStr = fConfigCommonTrackCuts.value; + if (!commonNamesStr.IsNull()) { // if common track cuts + std::unique_ptr objArrayCommon(commonNamesStr.Tokenize(",")); + fNCommonTrackCuts = objArrayCommon->GetEntries(); + for (int icut = 0; icut < fNCommonTrackCuts; ++icut) { + commonCutIdx = objArray->IndexOf(objArrayCommon->At(icut)); + if (commonCutIdx >= 0) { + fCommonTrackCutMask |= static_cast(1) << objArray->IndexOf(objArrayCommon->At(icut)); + fCommonTrackCutFilterMasks[icut] = static_cast(1) << objArray->IndexOf(objArrayCommon->At(icut)); + } else { + LOGF(fatal, "Common track cut %s was not calculated upstream. Check the config!", objArrayCommon->At(icut)->GetName()); + } + } + } + // Check that the leg cut masks make sense + if (static_cast(std::floor(TMath::Log2(fLegAFilterMask))) + 1 > objArray->GetEntries()) { + LOGF(fatal, "fConfigLegAFilterMask has highest bit at position %d, but track-selection only has %d cuts!", static_cast(std::floor(TMath::Log2(fLegAFilterMask))) + 1, objArray->GetEntries()); + } + if (static_cast(std::floor(TMath::Log2(fLegBFilterMask))) + 1 > objArray->GetEntries()) { + LOGF(fatal, "fConfigLegBFilterMask has highest bit at position %d, but track-selection only has %d cuts!", static_cast(std::floor(TMath::Log2(fLegBFilterMask))) + 1, objArray->GetEntries()); + } + if (static_cast(std::floor(TMath::Log2(fLegCFilterMask))) + 1 > objArray->GetEntries()) { + LOGF(fatal, "fConfigLegCFilterMask has highest bit at position %d, but track-selection only has %d cuts!", static_cast(std::floor(TMath::Log2(fLegCFilterMask))) + 1, objArray->GetEntries()); + } + + // Get the cuts defining the legs + uint32_t fConstructedLegAFilterMask = 0; + uint32_t fConstructedLegBFilterMask = 0; + uint32_t fConstructedLegCFilterMask = 0; + TString legCutsStr = fConfigLegCuts.value; + std::unique_ptr objArrayLegs(legCutsStr.Tokenize(",")); + if (objArrayLegs->GetEntries() == 0) { + LOG(fatal) << "No cuts defining legs. Check the config!"; + } + fNLegCuts = objArrayLegs->GetEntries(); + std::vector isThreeProng; + int legAIdx; + int legBIdx; + int legCIdx; + // Loop over leg defining cuts + for (int icut = 0; icut < fNLegCuts; ++icut) { + TString legsStr = objArrayLegs->At(icut)->GetName(); + std::unique_ptr legs(legsStr.Tokenize(":")); + if (legs->GetEntries() == 3) { + isThreeProng.push_back(true); + } else if (legs->GetEntries() == 2) { + isThreeProng.push_back(false); + } else { + LOGF(fatal, "Leg cuts %s has the wrong format and could not be parsed!", legsStr.Data()); + continue; + } + // Find leg cuts in the track selection cuts + legAIdx = objArray->IndexOf(legs->At(0)); + if (legAIdx >= 0) { + fConstructedLegAFilterMask |= static_cast(1) << legAIdx; + fTrackCutFilterMasks[icut] |= static_cast(1) << legAIdx; + } else { + LOGF(fatal, "Leg A cut %s was not calculated upstream. Check the config!", legs->At(0)->GetName()); + continue; + } + legBIdx = objArray->IndexOf(legs->At(1)); + if (legBIdx >= 0) { + fConstructedLegBFilterMask |= static_cast(1) << legBIdx; + fTrackCutFilterMasks[icut] |= static_cast(1) << legBIdx; + } else { + LOGF(fatal, "Leg B cut %s was not calculated upstream. Check the config!", legs->At(1)->GetName()); + continue; + } + if (isThreeProng[icut]) { + legCIdx = objArray->IndexOf(legs->At(2)); + if (legCIdx >= 0) { + fConstructedLegCFilterMask |= static_cast(1) << legCIdx; + fTrackCutFilterMasks[icut] |= static_cast(1) << legCIdx; + } else { + LOGF(fatal, "Leg C cut %s was not calculated upstream. Check the config!", legs->At(2)->GetName()); + continue; + } + } + if (isThreeProng[icut]) { + names = { + Form("TripletsBarrelSE_%s", legsStr.Data())}; + histNames += Form("%s;", names[0].Data()); + if (fConfigQA) { + names.push_back(Form("TripletsBarrelSE_ambiguous_%s", legsStr.Data())); + histNames += Form("%s;", names[1].Data()); + } + fTrackHistNames[icut] = names; + + std::unique_ptr objArrayCommon(commonNamesStr.Tokenize(",")); + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + names = {}; + names.push_back(Form("TripletsBarrelSE_%s_%s", legsStr.Data(), objArrayCommon->At(iCommonCut)->GetName())); + histNames += Form("%s;", names[0].Data()); + fTrackHistNames[fNLegCuts + icut * fNCommonTrackCuts + iCommonCut] = names; + } + + TString cutNamesStr = fConfigPairCuts.value; + if (!cutNamesStr.IsNull()) { // if pair cuts + std::unique_ptr objArrayPair(cutNamesStr.Tokenize(",")); + fNPairCuts = objArrayPair->GetEntries(); + for (int iPairCut = 0; iPairCut < fNPairCuts; ++iPairCut) { // loop over pair cuts + names = {}; + names.push_back(Form("TripletsBarrelSE_%s_%s", legsStr.Data(), objArrayPair->At(iPairCut)->GetName())); + histNames += Form("%s;", names[0].Data()); + fTrackHistNames[fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut] = names; + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + names = {}; + names.push_back(Form("TripletsBarrelSE_%s_%s_%s", legsStr.Data(), objArrayCommon->At(iCommonCut)->GetName(), objArrayPair->At(iPairCut)->GetName())); + histNames += Form("%s;", names[0].Data()); + fTrackHistNames[(fNLegCuts * (fNCommonTrackCuts + 1) + fNLegCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts + 1) + iCommonCut * (1 + fNPairCuts) + iPairCut] = names; + } // end loop (common cuts) + } // end loop (pair cuts) + } // end if (pair cuts) + + // TODO: assign hist directories for the MC matched triplets for each (leg cut combo,MCsignal) combination + if (!sigNamesStr.IsNull()) { + for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { + auto sig = fRecMCSignals.at(isig); + int offset = fNLegCuts * isig * (1 + fNCommonTrackCuts + fNPairCuts + fNCommonTrackCuts * fNPairCuts); + names = { + Form("TripletsBarrelSE_%s_%s", legsStr.Data(), sig.GetName())}; + histNames += Form("%s;", names[0].Data()); + fBarrelHistNamesMCmatched[offset + icut] = names; + + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + names = {}; + names.push_back(Form("TripletsBarrelSE_%s_%s_%s", legsStr.Data(), objArrayCommon->At(iCommonCut)->GetName(), sig.GetName())); + histNames += Form("%s;", names[0].Data()); + fBarrelHistNamesMCmatched[offset + fNLegCuts + icut * fNCommonTrackCuts + iCommonCut] = names; + } + + if (!cutNamesStr.IsNull()) { // if pair cuts + std::unique_ptr objArrayPair(cutNamesStr.Tokenize(",")); + for (int iPairCut = 0; iPairCut < fNPairCuts; ++iPairCut) { // loop over pair cuts + names = {}; + names.push_back(Form("TripletsBarrelSE_%s_%s_%s", legsStr.Data(), objArrayPair->At(iPairCut)->GetName(), sig.GetName())); + histNames += Form("%s;", names[0].Data()); + fBarrelHistNamesMCmatched[offset + fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut] = names; + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + names = {}; + names.push_back(Form("TripletsBarrelSE_%s_%s_%s_%s", legsStr.Data(), objArrayCommon->At(iCommonCut)->GetName(), objArrayPair->At(iPairCut)->GetName(), sig.GetName())); + histNames += Form("%s;", names[0].Data()); + fBarrelHistNamesMCmatched[offset + (fNLegCuts * (fNCommonTrackCuts + 1) + fNLegCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * (1 + fNPairCuts) + iPairCut] = names; + } // end loop (common cuts) + } // end loop (pair cuts) + } // end if (pair cuts) + } // end loop over MC signals + } // end if (MC signals) + } else { + names = {}; + std::vector pairHistPrefixes = {"PairsBarrelSEPM"}; + if (fConfigSameSignHistograms.value) { + pairHistPrefixes.push_back("PairsBarrelSEPP"); + pairHistPrefixes.push_back("PairsBarrelSEMM"); + } + int fNPairHistPrefixes = pairHistPrefixes.size(); + + for (int iPrefix = 0; iPrefix < fNPairHistPrefixes; ++iPrefix) { + names.push_back(Form("%s_%s", pairHistPrefixes[iPrefix].Data(), legsStr.Data())); + histNames += Form("%s;", names[iPrefix].Data()); + } + if (fConfigQA) { + for (int iPrefix = 0; iPrefix < fNPairHistPrefixes; ++iPrefix) { + names.push_back(Form("%s_ambiguous_%s", pairHistPrefixes[iPrefix].Data(), legsStr.Data())); + histNames += Form("%s;", names[fNPairHistPrefixes + iPrefix].Data()); + } + } + fTrackHistNames[icut] = names; + + std::unique_ptr objArrayCommon(commonNamesStr.Tokenize(",")); + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + names = {}; + for (int iPrefix = 0; iPrefix < fNPairHistPrefixes; ++iPrefix) { + names.push_back(Form("%s_%s_%s", pairHistPrefixes[iPrefix].Data(), legsStr.Data(), objArrayCommon->At(iCommonCut)->GetName())); + histNames += Form("%s;", names[iPrefix].Data()); + } + fTrackHistNames[fNLegCuts + icut * fNCommonTrackCuts + iCommonCut] = names; + } + + if (!cutNamesStr.IsNull()) { // if pair cuts + std::unique_ptr objArrayPair(cutNamesStr.Tokenize(",")); + fNPairCuts = objArrayPair->GetEntries(); + for (int iPairCut = 0; iPairCut < fNPairCuts; ++iPairCut) { // loop over pair cuts + names = {}; + for (int iPrefix = 0; iPrefix < fNPairHistPrefixes; ++iPrefix) { + names.push_back(Form("%s_%s_%s", pairHistPrefixes[iPrefix].Data(), legsStr.Data(), objArrayPair->At(iPairCut)->GetName())); + histNames += Form("%s;", names[iPrefix].Data()); + } + fTrackHistNames[fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut] = names; + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + names = {}; + for (int iPrefix = 0; iPrefix < fNPairHistPrefixes; ++iPrefix) { + names.push_back(Form("%s_%s_%s_%s", pairHistPrefixes[iPrefix].Data(), legsStr.Data(), objArrayCommon->At(iCommonCut)->GetName(), objArrayPair->At(iPairCut)->GetName())); + histNames += Form("%s;", names[iPrefix].Data()); + } + fTrackHistNames[(fNLegCuts * (fNCommonTrackCuts + 1) + fNLegCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * (1 + fNPairCuts) + iPairCut] = names; + } // end loop (common cuts) + } // end loop (pair cuts) + } // end if (pair cuts) + + // assign hist directories for the MC matched triplets for each (leg cut combo,MCsignal) combination + if (!sigNamesStr.IsNull()) { + for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { + auto sig = fRecMCSignals.at(isig); + names = {}; + int offset = fNLegCuts * isig * (1 + fNCommonTrackCuts + fNPairCuts + fNCommonTrackCuts * fNPairCuts); + for (int iPrefix = 0; iPrefix < fNPairHistPrefixes; ++iPrefix) { + names.push_back(Form("%s_%s_%s", pairHistPrefixes[iPrefix].Data(), legsStr.Data(), sig.GetName())); + histNames += Form("%s;", names[iPrefix].Data()); + } + fBarrelHistNamesMCmatched[offset + icut] = names; + + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + names = {}; + for (int iPrefix = 0; iPrefix < fNPairHistPrefixes; ++iPrefix) { + names.push_back(Form("%s_%s_%s_%s", pairHistPrefixes[iPrefix].Data(), legsStr.Data(), objArrayCommon->At(iCommonCut)->GetName(), sig.GetName())); + histNames += Form("%s;", names[iPrefix].Data()); + } + fBarrelHistNamesMCmatched[offset + fNLegCuts + icut * fNCommonTrackCuts + iCommonCut] = names; + } + + if (!cutNamesStr.IsNull()) { // if pair cuts + std::unique_ptr objArrayPair(cutNamesStr.Tokenize(",")); + for (int iPairCut = 0; iPairCut < fNPairCuts; ++iPairCut) { // loop over pair cuts + names = {}; + for (int iPrefix = 0; iPrefix < fNPairHistPrefixes; ++iPrefix) { + names.push_back(Form("%s_%s_%s_%s", pairHistPrefixes[iPrefix].Data(), legsStr.Data(), objArrayPair->At(iPairCut)->GetName(), sig.GetName())); + histNames += Form("%s;", names[iPrefix].Data()); + } + fBarrelHistNamesMCmatched[offset + fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut] = names; + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + names = {}; + for (int iPrefix = 0; iPrefix < fNPairHistPrefixes; ++iPrefix) { + names.push_back(Form("%s_%s_%s_%s_%s", pairHistPrefixes[iPrefix].Data(), legsStr.Data(), objArrayCommon->At(iCommonCut)->GetName(), objArrayPair->At(iPairCut)->GetName(), sig.GetName())); + histNames += Form("%s;", names[iPrefix].Data()); + } + fBarrelHistNamesMCmatched[offset + (fNLegCuts * (fNCommonTrackCuts + 1) + fNLegCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * (1 + fNPairCuts) + iPairCut] = names; + } // end loop (common cuts) + } // end loop (pair cuts) + } // end if (pair cuts) + } // end loop over MC signals + } // end if (MC signals) + } + } + + // Add histogram classes for each specified MCsignal at the generator level + // TODO: create a std::vector of hist classes to be used at Fill time, to avoid using Form in the process function + TString sigGenNamesStr = fConfigMCGenSignals.value; + std::unique_ptr objGenSigArray(sigGenNamesStr.Tokenize(",")); + for (int isig = 0; isig < objGenSigArray->GetEntries(); isig++) { + MCSignal* sig = o2::aod::dqmcsignals::GetMCSignal(objGenSigArray->At(isig)->GetName()); + if (sig) { + if (sig->GetNProngs() == 1) { // NOTE: 1-prong signals required + fGenMCSignals.push_back(*sig); + histNames += Form("MCTruthGen_%s;", sig->GetName()); // TODO: Add these names to a std::vector to avoid using Form in the process function + } + } + } + + // Make sure the leg cuts are covered by the configured filter masks + if (fLegAFilterMask != fConstructedLegAFilterMask) { + LOGF(fatal, "cfgLegAFilterMask (%d) is not equal to the mask constructed by the cuts specified in cfgLegCuts (%d)!", fLegAFilterMask, fConstructedLegAFilterMask); + } + if (fLegBFilterMask != fConstructedLegBFilterMask) { + LOGF(fatal, "cfgLegBFilterMask (%d) is not equal to the mask constructed by the cuts specified in cfgLegCuts (%d)!", fLegBFilterMask, fConstructedLegBFilterMask); + } + if (fLegCFilterMask != fConstructedLegCFilterMask) { + LOGF(fatal, "cfgLegCFilterMask (%d) is not equal to the mask constructed by the cuts specified in cfgLegCuts (%d)!", fLegCFilterMask, fConstructedLegCFilterMask); + } + // Make sure only pairs or only triplets of leg cuts were given + int tripletCheckSum = std::count(isThreeProng.begin(), isThreeProng.end(), true); + if (tripletCheckSum != 0 && tripletCheckSum != fNLegCuts) { + LOGF(fatal, "A mix of pairs and triplets was given as leg cuts. Check your config!"); + } + + fCurrentRun = 0; + + fCCDB->setURL(fConfigCcdbUrl.value); + fCCDB->setCaching(true); + fCCDB->setLocalObjectValidityChecking(); + + fLUT = o2::base::MatLayerCylSet::rectifyPtrFromFile(fCCDB->get(fConfigLutPath)); + VarManager::SetupMatLUTFwdDCAFitter(fLUT); + + VarManager::SetDefaultVarNames(); + fHistMan = new HistogramManager("analysisHistos", "aa", VarManager::kNVars); + fHistMan->SetUseDefaultVariableNames(kTRUE); + fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); + + DefineHistograms(fHistMan, histNames.Data(), fConfigHistogramSubgroups.value.data()); // define all histograms + VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill + fOutputList.setObject(fHistMan->GetMainHistogramList()); + } + + void initParamsFromCCDB(uint64_t timestamp, bool isTriplets) + { + if (fConfigUseRemoteField.value) { + o2::parameters::GRPMagField* grpmag = fCCDB->getForTimeStamp(fConfigGRPMagPath, timestamp); + float magField = 0.0; + if (grpmag != nullptr) { + magField = grpmag->getNominalL3Field(); + } else { + LOGF(fatal, "GRP object is not available in CCDB at timestamp=%llu", timestamp); + } + if (isTriplets) { + if (fConfigUseKFVertexing.value) { + VarManager::SetupThreeProngKFParticle(magField); + } else { + VarManager::SetupThreeProngDCAFitter(magField, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); + } + } else { + if (fConfigUseKFVertexing.value) { + VarManager::SetupTwoProngKFParticle(magField); + } else { + VarManager::SetupTwoProngDCAFitter(magField, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); // TODO: get these parameters from Configurables + } + } + } else { + if (isTriplets) { + if (fConfigUseKFVertexing.value) { + VarManager::SetupThreeProngKFParticle(fConfigMagField.value); + } else { + VarManager::SetupThreeProngDCAFitter(fConfigMagField.value, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); + } + } else { + if (fConfigUseKFVertexing.value) { + VarManager::SetupTwoProngKFParticle(fConfigMagField.value); + } else { + VarManager::SetupTwoProngDCAFitter(fConfigMagField.value, true, 200.0f, 4.0f, 1.0e-3f, 0.9f, fConfigUseAbsDCA.value); // TODO: get these parameters from Configurables + } + } + } + } + + // Template function to run same event pairing with asymmetric pairs (e.g. kaon-pion) + template + void runAsymmetricPairing(TEvents const& events, Preslice& preslice, TTrackAssocs const& /*assocs*/, TTracks const& /*tracks*/, ReducedMCEvents const& /*mcEvents*/, ReducedMCTracks const& /*mcTracks*/) + { + if (events.size() > 0) { // Additional protection to avoid crashing of events.begin().runNumber() + if (fCurrentRun != events.begin().runNumber()) { + initParamsFromCCDB(events.begin().timestamp(), false); + fCurrentRun = events.begin().runNumber(); + } + } + + std::map> histNamesMC = fBarrelHistNamesMCmatched; + std::map> histNames = fTrackHistNames; + + int sign1 = 0; + int sign2 = 0; + uint32_t mcDecision = 0; + ditrackList.reserve(1); + ditrackExtraList.reserve(1); + + constexpr bool trackHasCov = ((TTrackFillMap & VarManager::ObjTypes::TrackCov) > 0 || (TTrackFillMap & VarManager::ObjTypes::ReducedTrackBarrelCov) > 0); + + for (auto& event : events) { + if (!event.isEventSelected_bit(0)) { + continue; + } + // Reset the fValues array + VarManager::ResetValues(0, VarManager::kNVars); + VarManager::FillEvent(event, VarManager::fgValues); + + auto groupedLegAAssocs = legACandidateAssocs.sliceBy(preslice, event.globalIndex()); + if (groupedLegAAssocs.size() == 0) { + continue; + } + auto groupedLegBAssocs = legBCandidateAssocs.sliceBy(preslice, event.globalIndex()); + if (groupedLegBAssocs.size() == 0) { + continue; + } + + for (auto& [a1, a2] : combinations(soa::CombinationsFullIndexPolicy(groupedLegAAssocs, groupedLegBAssocs))) { + + uint32_t twoTrackFilter = 0; + uint32_t twoTrackCommonFilter = 0; + uint32_t pairFilter = 0; + bool isPairIdWrong = false; + for (int icut = 0; icut < fNLegCuts; ++icut) { + // Find leg pair definitions both candidates participate in + if ((((a1.isBarrelSelected_raw() & fLegAFilterMask) | (a2.isBarrelSelected_raw() & fLegBFilterMask)) & fTrackCutFilterMasks[icut]) == fTrackCutFilterMasks[icut]) { + twoTrackFilter |= static_cast(1) << icut; + // If the supposed pion passes a kaon cut, this is a K+K-. Skip it. + if (TPairType == VarManager::kDecayToKPi && fConfigSkipAmbiguousIdCombinations.value) { + if (a2.isBarrelSelected_raw() & fLegAFilterMask) { + isPairIdWrong = true; + } + } + } + } + + if (!twoTrackFilter || isPairIdWrong) { + continue; + } + + // Find common track cuts both candidates pass + twoTrackCommonFilter |= a1.isBarrelSelected_raw() & a2.isBarrelSelected_raw() & fCommonTrackCutMask; + + auto t1 = a1.template reducedtrack_as(); + auto t2 = a2.template reducedtrack_as(); + + // Avoid self-pairs + if (t1.globalIndex() == t2.globalIndex()) { + continue; + } + + sign1 = t1.sign(); + sign2 = t2.sign(); + // store the ambiguity number of the two dilepton legs in the last 4 digits of the two-track filter + if (t1.barrelAmbiguityInBunch() > 1 || t1.barrelAmbiguityOutOfBunch() > 1) { + twoTrackFilter |= static_cast(1) << 30; + } + if (t2.barrelAmbiguityInBunch() > 1 || t2.barrelAmbiguityOutOfBunch() > 1) { + twoTrackFilter |= static_cast(1) << 31; + } + + // run MC matching for this pair + int isig = 0; + mcDecision = 0; + for (auto sig = fRecMCSignals.begin(); sig != fRecMCSignals.end(); sig++, isig++) { + if (t1.has_reducedMCTrack() && t2.has_reducedMCTrack()) { + if ((*sig).CheckSignal(true, t1.reducedMCTrack(), t2.reducedMCTrack())) { + mcDecision |= static_cast(1) << isig; + } + } + } // end loop over MC signals + + VarManager::FillPair(t1, t2); + if constexpr (TTwoProngFitter) { + VarManager::FillPairVertexing(event, t1, t2, fConfigPropToPCA); + } + + // Fill histograms + bool isAmbi = false; + for (int icut = 0; icut < fNLegCuts; icut++) { + if (twoTrackFilter & (static_cast(1) << icut)) { + isAmbi = (twoTrackFilter & (static_cast(1) << 30)) || (twoTrackFilter & (static_cast(1) << 31)); + if (sign1 * sign2 < 0) { // +- pairs + fHistMan->FillHistClass(histNames[icut][0].Data(), VarManager::fgValues); // reconstructed, unmatched + if (isAmbi && fConfigQA) { + fHistMan->FillHistClass(histNames[icut][3].Data(), VarManager::fgValues); + } + } else if (fConfigSameSignHistograms.value) { + if (sign1 > 0) { // ++ pairs + fHistMan->FillHistClass(histNames[icut][1].Data(), VarManager::fgValues); + if (isAmbi && fConfigQA) { + fHistMan->FillHistClass(histNames[icut][4].Data(), VarManager::fgValues); + } + } else { // -- pairs + fHistMan->FillHistClass(histNames[icut][2].Data(), VarManager::fgValues); + if (isAmbi && fConfigQA) { + fHistMan->FillHistClass(histNames[icut][5].Data(), VarManager::fgValues); + } + } + } + for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { // loop over MC signals + int offset = fNLegCuts * isig * (1 + fNCommonTrackCuts + fNPairCuts + fNCommonTrackCuts * fNPairCuts); + if (mcDecision & (static_cast(1) << isig)) { + if (sign1 * sign2 < 0) { + fHistMan->FillHistClass(histNamesMC[offset + icut][0].Data(), VarManager::fgValues); + } else if (fConfigSameSignHistograms.value) { + if (sign1 > 0) { + fHistMan->FillHistClass(histNamesMC[offset + icut][1].Data(), VarManager::fgValues); + } else { + fHistMan->FillHistClass(histNamesMC[offset + icut][2].Data(), VarManager::fgValues); + } + } + } + } + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; iCommonCut++) { + if (twoTrackCommonFilter & fCommonTrackCutFilterMasks[iCommonCut]) { + if (sign1 * sign2 < 0) { + fHistMan->FillHistClass(histNames[fNLegCuts + icut * fNCommonTrackCuts + iCommonCut][0].Data(), VarManager::fgValues); + } else if (fConfigSameSignHistograms.value) { + if (sign1 > 0) { + fHistMan->FillHistClass(histNames[fNLegCuts + icut * fNCommonTrackCuts + iCommonCut][1].Data(), VarManager::fgValues); + } else { + fHistMan->FillHistClass(histNames[fNLegCuts + icut * fNCommonTrackCuts + iCommonCut][2].Data(), VarManager::fgValues); + } + } + for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { // loop over MC signals + int offset = fNLegCuts * isig * (1 + fNCommonTrackCuts + fNPairCuts + fNCommonTrackCuts * fNPairCuts); + if (mcDecision & (static_cast(1) << isig)) { + if (sign1 * sign2 < 0) { + fHistMan->FillHistClass(histNamesMC[offset + fNLegCuts + icut * fNCommonTrackCuts + iCommonCut][0].Data(), VarManager::fgValues); + } else if (fConfigSameSignHistograms.value) { + if (sign1 > 0) { + fHistMan->FillHistClass(histNamesMC[offset + fNLegCuts + icut * fNCommonTrackCuts + iCommonCut][1].Data(), VarManager::fgValues); + } else { + fHistMan->FillHistClass(histNamesMC[offset + fNLegCuts + icut * fNCommonTrackCuts + iCommonCut][2].Data(), VarManager::fgValues); + } + } + } + } + } + } // end loop (common cuts) + for (unsigned int iPairCut = 0; iPairCut < fPairCuts.size(); iPairCut++) { + AnalysisCompositeCut cut = fPairCuts.at(iPairCut); + if (!(cut.IsSelected(VarManager::fgValues))) // apply pair cuts + continue; + pairFilter |= (static_cast(1) << iPairCut); + // Histograms with pair cuts + if (sign1 * sign2 < 0) { + fHistMan->FillHistClass(histNames[fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut][0].Data(), VarManager::fgValues); + } else if (fConfigSameSignHistograms.value) { + if (sign1 > 0) { + fHistMan->FillHistClass(histNames[fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut][1].Data(), VarManager::fgValues); + } else { + fHistMan->FillHistClass(histNames[fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut][2].Data(), VarManager::fgValues); + } + } + for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { // loop over MC signals + int offset = fNLegCuts * isig * (1 + fNCommonTrackCuts + fNPairCuts + fNCommonTrackCuts * fNPairCuts); + if (mcDecision & (static_cast(1) << isig)) { + if (sign1 * sign2 < 0) { + fHistMan->FillHistClass(histNamesMC[offset + fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut][0].Data(), VarManager::fgValues); + } else if (fConfigSameSignHistograms.value) { + if (sign1 > 0) { + fHistMan->FillHistClass(histNamesMC[offset + fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut][1].Data(), VarManager::fgValues); + } else { + fHistMan->FillHistClass(histNamesMC[offset + fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut][2].Data(), VarManager::fgValues); + } + } + } + } + // Histograms with pair cuts and common track cuts + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + if (twoTrackCommonFilter & fCommonTrackCutFilterMasks[iCommonCut]) { + if (sign1 * sign2 < 0) { + fHistMan->FillHistClass(histNames[(fNLegCuts * (fNCommonTrackCuts + 1) + fNLegCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * (1 + fNPairCuts) + iPairCut][0].Data(), VarManager::fgValues); + } else if (fConfigSameSignHistograms.value) { + if (sign1 > 0) { + fHistMan->FillHistClass(histNames[(fNLegCuts * (fNCommonTrackCuts + 1) + fNLegCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * (1 + fNPairCuts) + iPairCut][1].Data(), VarManager::fgValues); + } else { + fHistMan->FillHistClass(histNames[(fNLegCuts * (fNCommonTrackCuts + 1) + fNLegCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * (1 + fNPairCuts) + iPairCut][2].Data(), VarManager::fgValues); + } + } + for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { // loop over MC signals + int offset = fNLegCuts * isig * (1 + fNCommonTrackCuts + fNPairCuts + fNCommonTrackCuts * fNPairCuts); + if (mcDecision & (static_cast(1) << isig)) { + if (sign1 * sign2 < 0) { + fHistMan->FillHistClass(histNamesMC[offset + (fNLegCuts * (fNCommonTrackCuts + 1) + fNLegCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * (1 + fNPairCuts) + iPairCut][0].Data(), VarManager::fgValues); + } else if (fConfigSameSignHistograms.value) { + if (sign1 > 0) { + fHistMan->FillHistClass(histNamesMC[offset + (fNLegCuts * (fNCommonTrackCuts + 1) + fNLegCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * (1 + fNPairCuts) + iPairCut][1].Data(), VarManager::fgValues); + } else { + fHistMan->FillHistClass(histNamesMC[offset + (fNLegCuts * (fNCommonTrackCuts + 1) + fNLegCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * (1 + fNPairCuts) + iPairCut][2].Data(), VarManager::fgValues); + } + } + } + } + } + } + } // end loop (pair cuts) + } + } // end loop (cuts) + ditrackList(event.globalIndex(), VarManager::fgValues[VarManager::kMass], + VarManager::fgValues[VarManager::kPt], VarManager::fgValues[VarManager::kEta], VarManager::fgValues[VarManager::kPhi], + t1.sign() + t2.sign(), twoTrackFilter, pairFilter, twoTrackCommonFilter); + if constexpr (trackHasCov && TTwoProngFitter) { + ditrackExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauzProjected], VarManager::fgValues[VarManager::kVertexingLzProjected], VarManager::fgValues[VarManager::kVertexingLxyProjected]); + } + } // end inner assoc loop (leg A) + } // end event loop + } + + // Template function to run same event triplets (e.g. D+->K-pi+pi+) + template + void runThreeProng(TEvents const& events, Preslice& preslice, TTrackAssocs const& /*assocs*/, TTracks const& tracks, ReducedMCEvents const& /*mcEvents*/, ReducedMCTracks const& /*mcTracks*/, VarManager::PairCandidateType tripletType) + { + if (events.size() > 0) { // Additional protection to avoid crashing of events.begin().runNumber() + if (fCurrentRun != events.begin().runNumber()) { + initParamsFromCCDB(events.begin().timestamp(), true); + fCurrentRun = events.begin().runNumber(); + } + } + + std::map> histNames = fTrackHistNames; + std::map> histNamesMC = fBarrelHistNamesMCmatched; + + for (auto& event : events) { + if (!event.isEventSelected_bit(0)) { + continue; + } + // Reset the fValues array + VarManager::ResetValues(0, VarManager::kNVars); + VarManager::FillEvent(event, VarManager::fgValues); + + auto groupedLegAAssocs = legACandidateAssocs.sliceBy(preslice, event.globalIndex()); + if (groupedLegAAssocs.size() == 0) { + continue; + } + auto groupedLegBAssocs = legBCandidateAssocs.sliceBy(preslice, event.globalIndex()); + if (groupedLegBAssocs.size() == 0) { + continue; + } + auto groupedLegCAssocs = legCCandidateAssocs.sliceBy(preslice, event.globalIndex()); + if (groupedLegCAssocs.size() == 0) { + continue; + } + + // Based on triplet type, make suitable combinations of the partitions + if (tripletType == VarManager::kTripleCandidateToPKPi) { + for (auto& [a1, a2, a3] : combinations(soa::CombinationsFullIndexPolicy(groupedLegAAssocs, groupedLegBAssocs, groupedLegCAssocs))) { + readTriplet(a1, a2, a3, tracks, event, tripletType, histNames, histNamesMC); + } + } else if (tripletType == VarManager::kTripleCandidateToKPiPi) { + for (auto& a1 : groupedLegAAssocs) { + for (auto& [a2, a3] : combinations(groupedLegBAssocs, groupedLegCAssocs)) { + readTriplet(a1, a2, a3, tracks, event, tripletType, histNames, histNamesMC); + } + } + } else { + LOG(fatal) << "Given tripletType not recognized. Don't know how to make combinations!" << endl; + } + } // end event loop + } + + // Helper function to process triplet + template + void readTriplet(TTrackAssoc const& a1, TTrackAssoc const& a2, TTrackAssoc const& a3, TTracks const& /*tracks*/, TEvent const& event, VarManager::PairCandidateType tripletType, std::map> histNames, std::map> histNamesMC) + { + uint32_t mcDecision = 0; + + uint32_t threeTrackFilter = 0; + uint32_t threeTrackCommonFilter = 0; + for (int icut = 0; icut < fNLegCuts; ++icut) { + // Find out which leg cut combination the triplet passes + if ((((a1.isBarrelSelected_raw() & fLegAFilterMask) | (a2.isBarrelSelected_raw() & fLegBFilterMask) | (a3.isBarrelSelected_raw() & fLegCFilterMask)) & fTrackCutFilterMasks[icut]) == fTrackCutFilterMasks[icut]) { + threeTrackFilter |= (static_cast(1) << icut); + if (tripletType == VarManager::kTripleCandidateToPKPi && fConfigSkipAmbiguousIdCombinations.value) { + // Check if the supposed pion passes as a proton or kaon, if so, skip this triplet. It is pKp or pKK. + if ((a3.isBarrelSelected_raw() & fLegAFilterMask) || (a3.isBarrelSelected_raw() & fLegBFilterMask)) { + return; + } + // Check if the supposed kaon passes as a proton, if so, skip this triplet. It is ppPi. + if (a2.isBarrelSelected_raw() & fLegAFilterMask) { + return; + } + } + if (tripletType == VarManager::kTripleCandidateToKPiPi && fConfigSkipAmbiguousIdCombinations.value) { + // Check if one of the supposed pions pass as a kaon, if so, skip this triplet. It is KKPi. + if ((a2.isBarrelSelected_raw() & fLegAFilterMask) || (a3.isBarrelSelected_raw() & fLegAFilterMask)) { + return; + } + } + } + } + if (!threeTrackFilter) { + return; + } + + // Find common track cuts all candidates pass + threeTrackCommonFilter |= a1.isBarrelSelected_raw() & a2.isBarrelSelected_raw() & a3.isBarrelSelected_raw() & fCommonTrackCutMask; + + auto t1 = a1.template reducedtrack_as(); + auto t2 = a2.template reducedtrack_as(); + auto t3 = a3.template reducedtrack_as(); + + // Avoid self-pairs + if (t1 == t2 || t1 == t3 || t2 == t3) { + return; + } + + // store the ambiguity of the three legs in the last 3 digits of the two-track filter + if (t1.barrelAmbiguityInBunch() > 1 || t1.barrelAmbiguityOutOfBunch() > 1) { + threeTrackFilter |= (static_cast(1) << 29); + } + if (t2.barrelAmbiguityInBunch() > 1 || t2.barrelAmbiguityOutOfBunch() > 1) { + threeTrackFilter |= (static_cast(1) << 30); + } + if (t3.barrelAmbiguityInBunch() > 1 || t3.barrelAmbiguityOutOfBunch() > 1) { + threeTrackFilter |= (static_cast(1) << 31); + } + + // run MC matching for this triplet + int isig = 0; + mcDecision = 0; + for (auto sig = fRecMCSignals.begin(); sig != fRecMCSignals.end(); sig++, isig++) { + if (t1.has_reducedMCTrack() && t2.has_reducedMCTrack() && t3.has_reducedMCTrack()) { + if ((*sig).CheckSignal(true, t1.reducedMCTrack(), t2.reducedMCTrack(), t3.reducedMCTrack())) { + mcDecision |= (static_cast(1) << isig); + } + } + } // end loop over MC signals + + VarManager::FillTriple(t1, t2, t3, VarManager::fgValues, tripletType); + if constexpr (TThreeProngFitter) { + VarManager::FillTripletVertexing(event, t1, t2, t3, tripletType); + } + + // Fill histograms + bool isAmbi = false; + for (int icut = 0; icut < fNLegCuts; icut++) { + isAmbi = (threeTrackFilter & (static_cast(1) << 29)) || (threeTrackFilter & (static_cast(1) << 30)) || (threeTrackFilter & (static_cast(1) << 31)); + if (threeTrackFilter & (static_cast(1) << icut)) { + fHistMan->FillHistClass(histNames[icut][0].Data(), VarManager::fgValues); + // TODO: loop over MC signals + for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { // loop over MC signals + int offset = fNLegCuts * isig * (1 + fNCommonTrackCuts + fNPairCuts + fNCommonTrackCuts * fNPairCuts); + if (mcDecision & (static_cast(1) << isig)) { + fHistMan->FillHistClass(histNamesMC[offset + icut][0].Data(), VarManager::fgValues); // matched signal + } + } // end loop (MC signals) + if (fConfigQA && isAmbi) { + fHistMan->FillHistClass(histNames[icut][1].Data(), VarManager::fgValues); + } + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; iCommonCut++) { + if (threeTrackCommonFilter & fCommonTrackCutFilterMasks[iCommonCut]) { + fHistMan->FillHistClass(histNames[fNLegCuts + icut * fNCommonTrackCuts + iCommonCut][0].Data(), VarManager::fgValues); + for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { // loop over MC signals + int offset = fNLegCuts * isig * (1 + fNCommonTrackCuts + fNPairCuts + fNCommonTrackCuts * fNPairCuts); + if (mcDecision & (static_cast(1) << isig)) { + fHistMan->FillHistClass(histNamesMC[offset + fNLegCuts + icut * fNCommonTrackCuts + iCommonCut][0].Data(), VarManager::fgValues); // matched signal + } + } // end loop (MC signals) + } + } // end loop (common cuts) + for (unsigned int iPairCut = 0; iPairCut < fPairCuts.size(); iPairCut++) { + AnalysisCompositeCut cut = fPairCuts.at(iPairCut); + if (!(cut.IsSelected(VarManager::fgValues))) { // apply pair cuts + continue; + } + // Histograms with pair cuts + fHistMan->FillHistClass(histNames[fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut][0].Data(), VarManager::fgValues); + for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { // loop over MC signals + int offset = fNLegCuts * isig * (1 + fNCommonTrackCuts + fNPairCuts + fNCommonTrackCuts * fNPairCuts); + if (mcDecision & (static_cast(1) << isig)) { + fHistMan->FillHistClass(histNamesMC[offset + fNLegCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut][0].Data(), VarManager::fgValues); // matched signal + } + } // end loop (MC signals) + // Histograms with pair cuts and common track cuts + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + if (threeTrackCommonFilter & fCommonTrackCutFilterMasks[iCommonCut]) { + fHistMan->FillHistClass(histNames[(fNLegCuts * (fNCommonTrackCuts + 1) + fNLegCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts + 1) + iCommonCut * (1 + fNPairCuts) + iPairCut][0].Data(), VarManager::fgValues); + for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { // loop over MC signals + int offset = fNLegCuts * isig * (1 + fNCommonTrackCuts + fNPairCuts + fNCommonTrackCuts * fNPairCuts); + if (mcDecision & (static_cast(1) << isig)) { + fHistMan->FillHistClass(histNamesMC[offset + (fNLegCuts * (fNCommonTrackCuts + 1) + fNLegCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * (1 + fNPairCuts) + iPairCut][0].Data(), VarManager::fgValues); // matched signal + } + } // end loop (MC signals) + } + } + } // end loop (pair cuts) + } + } // end loop (cuts) + } + + PresliceUnsorted perReducedMcEvent = aod::reducedtrackMC::reducedMCeventId; + + void runMCGen(ReducedMCTracks const& mcTracks) + { + // loop over mc stack and fill histograms for pure MC truth signals + // group all the MC tracks which belong to the MC event corresponding to the current reconstructed event + for (auto& mctrack : mcTracks) { + VarManager::FillTrackMC(mcTracks, mctrack); + // NOTE: Signals are checked here mostly based on the skimmed MC stack, so depending on the requested signal, the stack could be incomplete. + // NOTE: However, the working model is that the decisions on MC signals are precomputed during skimming and are stored in the mcReducedFlags member. + // TODO: Use the mcReducedFlags to select signals + for (auto& sig : fGenMCSignals) { + if (sig.GetNProngs() != 1) { // NOTE: 1-prong signals required here + continue; + } + bool checked = false; + checked = sig.CheckSignal(true, mctrack); + if (checked) { + fHistMan->FillHistClass(Form("MCTruthGen_%s", sig.GetName()), VarManager::fgValues); + } + } + } + } // end runMCGen + + void processKaonPionSkimmed(MyEventsVtxCovSelected const& events, + soa::Join const& barrelAssocs, + MyBarrelTracksWithCovWithAmbiguities const& barrelTracks, + ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks) + { + runAsymmetricPairing(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, mcEvents, mcTracks); + if (fConfigRunMCGenPair) + runMCGen(mcTracks); + } + + void processKaonPionPionSkimmed(MyEventsVtxCovSelected const& events, + soa::Join const& barrelAssocs, + MyBarrelTracksWithCovWithAmbiguities const& barrelTracks, + ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks) + { + runThreeProng(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, mcEvents, mcTracks, VarManager::kTripleCandidateToKPiPi); + if (fConfigRunMCGenPair) + runMCGen(mcTracks); + } + + void processDummy(MyEvents&) + { + // do nothing + } + + PROCESS_SWITCH(AnalysisAsymmetricPairing, processKaonPionSkimmed, "Run kaon pion pairing, with skimmed tracks", false); + PROCESS_SWITCH(AnalysisAsymmetricPairing, processKaonPionPionSkimmed, "Run kaon pion pion triplets, with skimmed tracks", false); + PROCESS_SWITCH(AnalysisAsymmetricPairing, processDummy, "Dummy function, enabled only if none of the others are enabled", true); +}; + // Combines dileptons with barrel or muon tracks for either resonance or correlation analyses // Dileptons produced with all the selection cuts specified in the same-event pairing task are combined with the // tracks passing the fConfigTrackCut cut. The dileptons cuts from the same-event pairing task are auto-detected @@ -1903,8 +2821,12 @@ struct AnalysisDileptonTrack { int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. int fNCuts; + int fNPairCuts; + int fNCommonTrackCuts; + std::map fCommonTrackCutMap; int fTrackCutBit; std::map fHistNamesDileptonTrack; + // std::map fHistNamesDileptonTrackMCmatched; std::map> fHistNamesDileptonTrackMCmatched; std::vector fHistNamesMCgen; std::map fHistNamesDileptons; @@ -1934,8 +2856,9 @@ struct AnalysisDileptonTrack { } bool isBarrel = context.mOptions.get("processBarrelSkimmed"); + bool isBarrelAsymmetric = context.mOptions.get("processDstarToD0Pi"); bool isMuon = context.mOptions.get("processMuonSkimmed"); - bool isAnyProcessEnabled = isBarrel || isMuon; + bool isAnyProcessEnabled = isBarrel || isMuon || isBarrelAsymmetric; bool isDummy = context.mOptions.get("processDummy"); if (isDummy) { if (isAnyProcessEnabled) { @@ -1972,10 +2895,10 @@ struct AnalysisDileptonTrack { // For each track/muon selection used to produce dileptons, create a separate histogram directory using the // name of the track/muon cut. // Also, create a map which will hold the name of the histogram directories so they can be accessed directly in the pairing loop - if (isBarrel || isMuon) { + if (isBarrel || isMuon || isBarrelAsymmetric) { // get the list of single track and muon cuts computed in the dedicated tasks upstream string tempCutsSingle; - if (isBarrel) { + if (isBarrel || isBarrelAsymmetric) { getTaskOptionValue(context, "analysis-track-selection", "cfgTrackCuts", tempCutsSingle, false); } else { getTaskOptionValue(context, "analysis-muon-selection", "cfgMuonCuts", tempCutsSingle, false); @@ -1988,6 +2911,7 @@ struct AnalysisDileptonTrack { if (objArraySingleCuts->FindObject(fConfigTrackCut.value.data()) == nullptr) { LOG(fatal) << " Track cut chosen for the correlation task was not computed in the single-track task! Check it out!"; } + // Loop over single-track/muon task cuts and find the cuts used for the track to be combined with dileptons for (int icut = 0; icut < objArraySingleCuts->GetEntries(); ++icut) { TString tempStr = objArraySingleCuts->At(icut)->GetName(); if (tempStr.CompareTo(fConfigTrackCut.value.data()) == 0) { @@ -1996,31 +2920,99 @@ struct AnalysisDileptonTrack { } // get the cuts employed for same-event pairing string tempCutsPair; + string tempCutsAsymPair; + string tempCutsAsymCommon; if (isBarrel) { getTaskOptionValue(context, "analysis-same-event-pairing", "cfgTrackCuts", tempCutsPair, false); - } else { + } else if (isMuon) { getTaskOptionValue(context, "analysis-same-event-pairing", "cfgMuonCuts", tempCutsPair, false); + } else if (isBarrelAsymmetric) { + getTaskOptionValue(context, "analysis-asymmetric-pairing", "cfgLegCuts", tempCutsPair, false); + getTaskOptionValue(context, "analysis-asymmetric-pairing", "cfgPairCuts", tempCutsAsymPair, false); + getTaskOptionValue(context, "analysis-asymmetric-pairing", "cfgCommonTrackCuts", tempCutsAsymCommon, false); + } + + // If asymmetric pair is used, it may have common track cuts + TString tempCutsAsymCommonStr = tempCutsAsymCommon; + if (!tempCutsAsymCommonStr.IsNull()) { // if common track cuts + std::unique_ptr objArrayCommon(tempCutsAsymCommonStr.Tokenize(",")); + fNCommonTrackCuts = objArrayCommon->GetEntries(); + for (int icut = 0; icut < fNCommonTrackCuts; ++icut) { + for (int iicut = 0; iicut < objArraySingleCuts->GetEntries(); ++iicut) { + if (std::strcmp(objArrayCommon->At(icut)->GetName(), objArraySingleCuts->At(iicut)->GetName()) == 0) { + fCommonTrackCutMap[icut] = iicut; + } + } + } } + TString tempCutsPairStr = tempCutsPair; if (!tempCutsSingleStr.IsNull() && !tempCutsPairStr.IsNull()) { std::unique_ptr objArray(tempCutsPairStr.Tokenize(",")); fNCuts = objArray->GetEntries(); - for (int icut = 0; icut < objArray->GetEntries(); ++icut) { + for (int icut = 0; icut < fNCuts; ++icut) { TString tempStr = objArray->At(icut)->GetName(); - if (objArray->FindObject(tempStr.Data()) != nullptr) { - fHistNamesDileptonTrack[icut] = Form("DileptonTrack_%s_%s", tempStr.Data(), fConfigTrackCut.value.data()); - fHistNamesDileptons[icut] = Form("DileptonsSelected_%s", tempStr.Data()); - DefineHistograms(fHistMan, fHistNamesDileptonTrack[icut], fConfigHistogramSubgroups.value.data()); // define dilepton-track histograms - DefineHistograms(fHistMan, fHistNamesDileptons[icut], "barrel,vertexing"); // define dilepton histograms - std::vector mcHistNames; - - for (auto& sig : fRecMCSignals) { - mcHistNames.push_back(Form("DileptonTrackMCMatched_%s_%s_%s", tempStr.Data(), fConfigTrackCut.value.data(), sig.GetName())); - DefineHistograms(fHistMan, mcHistNames[mcHistNames.size() - 1], fConfigHistogramSubgroups.value.data()); + fHistNamesDileptonTrack[icut] = Form("DileptonTrack_%s_%s", tempStr.Data(), fConfigTrackCut.value.data()); + fHistNamesDileptons[icut] = Form("DileptonsSelected_%s", tempStr.Data()); + DefineHistograms(fHistMan, fHistNamesDileptonTrack[icut], fConfigHistogramSubgroups.value.data()); // define dilepton-track histograms + DefineHistograms(fHistMan, fHistNamesDileptons[icut], "barrel,vertexing"); // define dilepton histograms + if (!tempCutsAsymCommonStr.IsNull()) { + std::unique_ptr objArrayCommon(tempCutsAsymCommonStr.Tokenize(",")); + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + fHistNamesDileptonTrack[fNCuts + icut * fNCommonTrackCuts + iCommonCut] = Form("DileptonTrack_%s_%s_%s", tempStr.Data(), objArrayCommon->At(iCommonCut)->GetName(), fConfigTrackCut.value.data()); + fHistNamesDileptons[fNCuts + icut * fNCommonTrackCuts + iCommonCut] = Form("DileptonsSelected_%s_%s", tempStr.Data(), objArrayCommon->At(iCommonCut)->GetName()); + DefineHistograms(fHistMan, fHistNamesDileptonTrack[fNCuts + icut * fNCommonTrackCuts + iCommonCut], fConfigHistogramSubgroups.value.data()); // define dilepton-track histograms + DefineHistograms(fHistMan, fHistNamesDileptons[fNCuts + icut * fNCommonTrackCuts + iCommonCut], "barrel,vertexing"); // define dilepton histograms } - fHistNamesDileptonTrackMCmatched[icut] = mcHistNames; } - } + TString tempCutsAsymPairStr = tempCutsAsymPair; + if (!tempCutsAsymPairStr.IsNull()) { + std::unique_ptr objArrayPairCuts(tempCutsAsymPairStr.Tokenize(",")); + fNPairCuts = objArrayPairCuts->GetEntries(); + for (int iPairCut = 0; iPairCut < fNPairCuts; ++iPairCut) { + fHistNamesDileptonTrack[fNCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut] = Form("DileptonTrack_%s_%s_%s", tempStr.Data(), objArrayPairCuts->At(iPairCut)->GetName(), fConfigTrackCut.value.data()); + fHistNamesDileptons[fNCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut] = Form("DileptonsSelected_%s_%s", tempStr.Data(), objArrayPairCuts->At(iPairCut)->GetName()); + DefineHistograms(fHistMan, fHistNamesDileptonTrack[fNCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut], fConfigHistogramSubgroups.value.data()); // define dilepton-track histograms + DefineHistograms(fHistMan, fHistNamesDileptons[fNCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut], "barrel,vertexing"); // define dilepton histograms + if (!tempCutsAsymCommonStr.IsNull()) { + std::unique_ptr objArrayCommon(tempCutsAsymCommonStr.Tokenize(",")); + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + fHistNamesDileptonTrack[(fNCuts * (fNCommonTrackCuts + 1) + fNCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * fNPairCuts + iPairCut] = Form("DileptonTrack_%s_%s_%s_%s", tempStr.Data(), objArrayCommon->At(iCommonCut)->GetName(), objArrayPairCuts->At(iPairCut)->GetName(), fConfigTrackCut.value.data()); + fHistNamesDileptons[(fNCuts * (fNCommonTrackCuts + 1) + fNCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * fNPairCuts + iPairCut] = Form("DileptonsSelected_%s_%s_%s", tempStr.Data(), objArrayCommon->At(iCommonCut)->GetName(), objArrayPairCuts->At(iPairCut)->GetName()); + DefineHistograms(fHistMan, fHistNamesDileptonTrack[(fNCuts * (fNCommonTrackCuts + 1) + fNCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * fNPairCuts + iPairCut], fConfigHistogramSubgroups.value.data()); // define dilepton-track histograms + DefineHistograms(fHistMan, fHistNamesDileptons[(fNCuts * (fNCommonTrackCuts + 1) + fNCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * fNPairCuts + iPairCut], "barrel,vertexing"); // define dilepton histograms + } + } + } // end loop (pair cuts) + } + for (unsigned int isig = 0; isig < fRecMCSignals.size(); isig++) { + auto sig = fRecMCSignals.at(isig); + fHistNamesDileptonTrackMCmatched[icut].push_back(Form("DileptonTrackMCMatched_%s_%s_%s", tempStr.Data(), fConfigTrackCut.value.data(), sig.GetName())); + DefineHistograms(fHistMan, fHistNamesDileptonTrackMCmatched[icut].back(), fConfigHistogramSubgroups.value.data()); + if (!tempCutsAsymCommonStr.IsNull()) { + std::unique_ptr objArrayCommon(tempCutsAsymCommonStr.Tokenize(",")); + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + fHistNamesDileptonTrackMCmatched[fNCuts + icut * fNCommonTrackCuts + iCommonCut].push_back(Form("DileptonTrackMCMatched_%s_%s_%s_%s", tempStr.Data(), objArrayCommon->At(iCommonCut)->GetName(), fConfigTrackCut.value.data(), sig.GetName())); + DefineHistograms(fHistMan, fHistNamesDileptonTrackMCmatched[fNCuts + icut * fNCommonTrackCuts + iCommonCut].back(), fConfigHistogramSubgroups.value.data()); // define dilepton-track histograms + } + } + if (!tempCutsAsymPairStr.IsNull()) { + std::unique_ptr objArrayPairCuts(tempCutsAsymPairStr.Tokenize(",")); + fNPairCuts = objArrayPairCuts->GetEntries(); + for (int iPairCut = 0; iPairCut < fNPairCuts; ++iPairCut) { + fHistNamesDileptonTrackMCmatched[fNCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut].push_back(Form("DileptonTrackMCMatched_%s_%s_%s_%s", tempStr.Data(), objArrayPairCuts->At(iPairCut)->GetName(), fConfigTrackCut.value.data(), sig.GetName())); + DefineHistograms(fHistMan, fHistNamesDileptonTrackMCmatched[fNCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut].back(), fConfigHistogramSubgroups.value.data()); // define dilepton-track histograms + if (!tempCutsAsymCommonStr.IsNull()) { + std::unique_ptr objArrayCommon(tempCutsAsymCommonStr.Tokenize(",")); + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; ++iCommonCut) { + fHistNamesDileptonTrackMCmatched[(fNCuts * (fNCommonTrackCuts + 1) + fNCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * fNPairCuts + iPairCut].push_back(Form("DileptonTrackMCMatched_%s_%s_%s_%s_%s", tempStr.Data(), objArrayCommon->At(iCommonCut)->GetName(), objArrayPairCuts->At(iPairCut)->GetName(), fConfigTrackCut.value.data(), sig.GetName())); + DefineHistograms(fHistMan, fHistNamesDileptonTrackMCmatched[(fNCuts * (fNCommonTrackCuts + 1) + fNCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * fNPairCuts + iPairCut].back(), fConfigHistogramSubgroups.value.data()); // define dilepton-track histograms + } // end loop (common cuts) + } + } // end loop (pair cuts) + } + } // end loop (MC signals) + } // end loop (leg defining cuts) } // Add histogram classes for each specified MCsignal at the generator level // TODO: create a std::vector of hist classes to be used at Fill time, to avoid using Form in the process function @@ -2099,12 +3091,29 @@ struct AnalysisDileptonTrack { for (int icut = 0; icut < fNCuts; icut++) { if (dilepton.filterMap_bit(icut)) { fHistMan->FillHistClass(fHistNamesDileptons[icut].Data(), fValuesDilepton); + if constexpr (TCandidateType == VarManager::kDstarToD0KPiPi) { // Dielectrons and Dimuons don't have the PairFilterMap column + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; iCommonCut++) { + if (dilepton.commonFilterMap_bit(fCommonTrackCutMap[iCommonCut])) { + fHistMan->FillHistClass(fHistNamesDileptons[fNCuts + icut * fNCommonTrackCuts + iCommonCut].Data(), fValuesDilepton); + } + } + for (int iPairCut = 0; iPairCut < fNPairCuts; iPairCut++) { + if (dilepton.pairFilterMap_bit(iPairCut)) { + fHistMan->FillHistClass(fHistNamesDileptons[fNCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut].Data(), fValuesDilepton); + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; iCommonCut++) { + if (dilepton.commonFilterMap_bit(fCommonTrackCutMap[iCommonCut])) { + fHistMan->FillHistClass(fHistNamesDileptons[(fNCuts * (fNCommonTrackCuts + 1) + fNCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * fNPairCuts + iPairCut].Data(), fValuesDilepton); + } + } + } + } + } } } // loop over hadrons for (auto& assoc : assocs) { - if constexpr (TCandidateType == VarManager::kBtoJpsiEEK) { + if constexpr (TCandidateType == VarManager::kBtoJpsiEEK || TCandidateType == VarManager::kDstarToD0KPiPi) { if (!assoc.isBarrelSelected_bit(fTrackCutBit)) { continue; } @@ -2155,7 +3164,39 @@ struct AnalysisDileptonTrack { fHistMan->FillHistClass(fHistNamesDileptonTrackMCmatched[icut][isig], fValuesHadron); } } - } + if constexpr (TCandidateType == VarManager::kDstarToD0KPiPi) { // Dielectrons and Dimuons don't have the PairFilterMap column + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; iCommonCut++) { + if (dilepton.commonFilterMap_bit(fCommonTrackCutMap[iCommonCut])) { + fHistMan->FillHistClass(fHistNamesDileptonTrack[fNCuts + icut * fNCommonTrackCuts + iCommonCut].Data(), fValuesHadron); + for (isig = 0; isig < fRecMCSignals.size(); isig++) { + if (mcDecision & (static_cast(1) << isig)) { + fHistMan->FillHistClass(fHistNamesDileptonTrackMCmatched[fNCuts + icut * fNCommonTrackCuts + iCommonCut][isig], fValuesHadron); + } + } // end loop (MC signals) + } + } // end loop (common track cuts) + for (int iPairCut = 0; iPairCut < fNPairCuts; iPairCut++) { + if (dilepton.pairFilterMap_bit(iPairCut)) { + fHistMan->FillHistClass(fHistNamesDileptonTrack[fNCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut].Data(), fValuesHadron); + for (isig = 0; isig < fRecMCSignals.size(); isig++) { + if (mcDecision & (static_cast(1) << isig)) { + fHistMan->FillHistClass(fHistNamesDileptonTrackMCmatched[fNCuts * (fNCommonTrackCuts + 1) + icut * fNPairCuts + iPairCut][isig], fValuesHadron); + } + } + for (int iCommonCut = 0; iCommonCut < fNCommonTrackCuts; iCommonCut++) { + if (dilepton.commonFilterMap_bit(fCommonTrackCutMap[iCommonCut])) { + fHistMan->FillHistClass(fHistNamesDileptonTrack[(fNCuts * (fNCommonTrackCuts + 1) + fNCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * fNPairCuts + iPairCut].Data(), fValuesHadron); + for (isig = 0; isig < fRecMCSignals.size(); isig++) { + if (mcDecision & (static_cast(1) << isig)) { + fHistMan->FillHistClass(fHistNamesDileptonTrackMCmatched[(fNCuts * (fNCommonTrackCuts + 1) + fNCuts * fNPairCuts) + icut * (fNPairCuts * fNCommonTrackCuts) + iCommonCut * fNPairCuts + iPairCut][isig], fValuesHadron); + } + } // end loop (MC signals) + } + } // end loop (common track cuts) + } + } // end loop (pair cuts) + } + } // end loop (cuts) } // table to be written out for ML analysis BmesonsTable(fValuesHadron[VarManager::kPairMass], fValuesHadron[VarManager::kPairPt], fValuesHadron[VarManager::kVertexingLxy], fValuesHadron[VarManager::kVertexingLxyz], fValuesHadron[VarManager::kVertexingLz], fValuesHadron[VarManager::kVertexingTauxy], fValuesHadron[VarManager::kVertexingTauz], fValuesHadron[VarManager::kKFDCAxyzBetweenProngs], fValuesHadron[VarManager::kCosPointingAngle], fValuesHadron[VarManager::kVertexingChi2PCA], mcDecision); @@ -2165,6 +3206,7 @@ struct AnalysisDileptonTrack { Preslice trackAssocsPerCollision = aod::reducedtrack_association::reducedeventId; Preslice dielectronsPerCollision = aod::reducedpair::reducedeventId; + Preslice ditracksPerCollision = aod::reducedpair::reducedeventId; void processBarrelSkimmed(soa::Filtered const& events, soa::Filtered> const& assocs, @@ -2189,6 +3231,26 @@ struct AnalysisDileptonTrack { } } + void processDstarToD0Pi(soa::Filtered const& events, + soa::Filtered> const& assocs, + MyBarrelTracksWithCov const& tracks, soa::Filtered const& ditracks, + ReducedMCEvents const& mcEvents, ReducedMCTracks const& mcTracks) + { + // set up KF or DCAfitter + if (events.size() == 0) { + return; + } + if (fCurrentRun != events.begin().runNumber()) { // start: runNumber + initParamsFromCCDB(events.begin().timestamp()); + fCurrentRun = events.begin().runNumber(); + } // end: runNumber + for (auto& event : events) { + auto groupedBarrelAssocs = assocs.sliceBy(trackAssocsPerCollision, event.globalIndex()); + auto groupedDitracks = ditracks.sliceBy(ditracksPerCollision, event.globalIndex()); + runDileptonHadron(event, groupedBarrelAssocs, tracks, groupedDitracks, mcEvents, mcTracks); + } + } + Preslice muonAssocsPerCollision = aod::reducedtrack_association::reducedeventId; Preslice dimuonsPerCollision = aod::reducedpair::reducedeventId; @@ -2241,6 +3303,7 @@ struct AnalysisDileptonTrack { } PROCESS_SWITCH(AnalysisDileptonTrack, processBarrelSkimmed, "Run barrel dilepton-track pairing, using skimmed data", false); + PROCESS_SWITCH(AnalysisDileptonTrack, processDstarToD0Pi, "Run barrel pairing of D0 daughters with pion candidate, using skimmed data", false); PROCESS_SWITCH(AnalysisDileptonTrack, processMuonSkimmed, "Run muon dilepton-track pairing, using skimmed data", false); PROCESS_SWITCH(AnalysisDileptonTrack, processMCGen, "Loop over MC particle stack and fill generator level histograms", false); PROCESS_SWITCH(AnalysisDileptonTrack, processDummy, "Dummy function", false); @@ -2254,6 +3317,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc)}; } @@ -2308,6 +3372,10 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "pair", histName); } + if (classStr.Contains("Triplets")) { + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "pair", histName); + } + if (classStr.Contains("MCTruthGenPair")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_pair"); } diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 739a9ff1957..7d4c90fcefc 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -2232,8 +2232,6 @@ struct AnalysisAsymmetricPairing { continue; } - // TODO: Think about double counting - std::set> globIdxPairs; for (auto& [a1, a2] : combinations(soa::CombinationsFullIndexPolicy(groupedLegAAssocs, groupedLegBAssocs))) { uint32_t twoTrackFilter = static_cast(0); @@ -2395,9 +2393,8 @@ struct AnalysisAsymmetricPairing { continue; } - std::set> globIdxTriplets; // Based on triplet type, make suitable combinations of the partitions - if (tripletType == VarManager::kTripleCandidateToPKPi || tripletType == VarManager::kTripleCandidateToKKPi) { + if (tripletType == VarManager::kTripleCandidateToPKPi) { for (auto& [a1, a2, a3] : combinations(soa::CombinationsFullIndexPolicy(groupedLegAAssocs, groupedLegBAssocs, groupedLegCAssocs))) { readTriplet(a1, a2, a3, tracks, event, tripletType, histNames); } @@ -2517,13 +2514,6 @@ struct AnalysisAsymmetricPairing { runThreeProng(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, VarManager::kTripleCandidateToKPiPi); } - void processKaonKaonPionSkimmed(MyEventsVtxCovZdcSelected const& events, - soa::Join const& barrelAssocs, - MyBarrelTracksWithCovWithAmbiguities const& barrelTracks) - { - runThreeProng(events, trackAssocsPerCollision, barrelAssocs, barrelTracks, VarManager::kTripleCandidateToKKPi); - } - void processProtonKaonPionSkimmed(MyEventsVtxCovZdcSelected const& events, soa::Join const& barrelAssocs, MyBarrelTracksWithCovWithAmbiguities const& barrelTracks) @@ -2538,7 +2528,6 @@ struct AnalysisAsymmetricPairing { PROCESS_SWITCH(AnalysisAsymmetricPairing, processKaonPionSkimmed, "Run kaon pion pairing, with skimmed tracks", false); PROCESS_SWITCH(AnalysisAsymmetricPairing, processKaonPionPionSkimmed, "Run kaon pion pion triplets, with skimmed tracks", false); - PROCESS_SWITCH(AnalysisAsymmetricPairing, processKaonKaonPionSkimmed, "Run kaon kaon pion triplets, with skimmed tracks", false); PROCESS_SWITCH(AnalysisAsymmetricPairing, processProtonKaonPionSkimmed, "Run proton kaon pion triplets, with skimmed tracks", false); PROCESS_SWITCH(AnalysisAsymmetricPairing, processDummy, "Dummy function, enabled only if none of the others are enabled", true); }; From d0b2591b8329aa01d58b891144fbdd6ee7a5f385 Mon Sep 17 00:00:00 2001 From: Zuzanna Chochulska <87480906+zchochul@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:29:20 +0100 Subject: [PATCH 378/459] [PWGCF] FemtoUniverse -- Adding inv mass for K+K+ and K-K- (#8928) Co-authored-by: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> --- .../Core/FemtoUniverseTrackSelection.h | 35 +- .../femtoUniverseProducerTask.cxx | 656 +++++++++--------- .../Tasks/femtoUniversePairTaskTrackPhi.cxx | 358 +++++----- 3 files changed, 514 insertions(+), 535 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h index 71086d55b8d..389273d0836 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h @@ -21,7 +21,6 @@ #include #include #include -#include #include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -31,7 +30,7 @@ #include "ReconstructionDataFormats/PID.h" #include "Framework/HistogramRegistry.h" -using namespace o2::framework; +// using namespace o2::framework; namespace o2::analysis::femtoUniverse { @@ -110,7 +109,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection tmpPids = pids; /// necessary due to some features of the configurable for (o2::track::PID pid : tmpPids) { - mPIDspecies.push_back(pid); + kPIDspecies.push_back(pid); } } @@ -161,7 +160,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection(prefix); - outString += static_cast(mSelectionNames[iSel]); + outString += static_cast(kSelectionNames[iSel]); outString += suffix; return outString; } @@ -172,7 +171,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection(prefix) + static_cast(mSelectionNames[index]); + std::string comp = static_cast(prefix) + static_cast(kSelectionNames[index]); std::string_view cmp{comp}; if (obs.compare(cmp) == 0) return index; @@ -184,7 +183,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection(prefix); - outString += static_cast(mSelectionHelper[iSel]); + outString += static_cast(kSelectionHelper[iSel]); return outString; } @@ -242,9 +241,9 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection mPIDspecies; ///< All the particle species for which the n_sigma values need to be stored + std::vector kPIDspecies; ///< All the particle species for which the n_sigma values need to be stored static constexpr int kNtrackSelection = 14; - static constexpr std::string_view mSelectionNames[kNtrackSelection] = {"Sign", + static constexpr std::string_view kSelectionNames[kNtrackSelection] = {"Sign", "PtMin", "PtMax", "EtaMax", @@ -259,7 +258,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection void FemtoUniverseTrackSelection::init(HistogramRegistry* registry) @@ -305,7 +304,7 @@ void FemtoUniverseTrackSelection::init(HistogramRegistry* registry) mHistogramRegistry->add((folderName + "/hPt").c_str(), "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, {{240, 0, 6}}); mHistogramRegistry->add((folderName + "/hEta").c_str(), "; #eta; Entries", kTH1F, {{200, -1.5, 1.5}}); - mHistogramRegistry->add((folderName + "/hPhi").c_str(), "; #phi; Entries", kTH1F, {{200, 0, 2. * M_PI}}); + mHistogramRegistry->add((folderName + "/hPhi").c_str(), "; #phi; Entries", kTH1F, {{200, 0, o2::constants::math::TwoPI}}); mHistogramRegistry->add((folderName + "/hTPCfindable").c_str(), "; TPC findable clusters; Entries", kTH1F, {{163, -0.5, 162.5}}); mHistogramRegistry->add((folderName + "/hTPCfound").c_str(), "; TPC found clusters; Entries", kTH1F, {{163, -0.5, 162.5}}); mHistogramRegistry->add((folderName + "/hTPCcrossedOverFindalbe").c_str(), "; TPC ratio findable; Entries", kTH1F, {{100, 0.5, 1.5}}); @@ -397,7 +396,7 @@ bool FemtoUniverseTrackSelection::isSelectedMinimal(T const& track) const auto dca = track.dcaXY(); // Accordingly to FemtoUniverse in AliPhysics as well as LF analysis, // only dcaXY should be checked; NOT std::sqrt(pow(dcaXY, 2.) + pow(dcaZ, 2.)) std::vector pidTPC, pidTOF; - for (auto it : mPIDspecies) { + for (auto it : kPIDspecies) { pidTPC.push_back(getNsigmaTPC(track, it)); pidTOF.push_back(getNsigmaTOF(track, it)); } @@ -474,10 +473,10 @@ std::array FemtoUniverseTrackSelection::getCutContainer(T c const auto itsNClsIB = track.itsNClsInnerBarrel(); const auto dcaXY = track.dcaXY(); const auto dcaZ = track.dcaZ(); - const auto dca = std::sqrt(pow(dcaXY, 2.) + pow(dcaZ, 2.)); + const auto dca = std::sqrt(std::pow(dcaXY, 2.) + std::pow(dcaZ, 2.)); std::vector pidTPC, pidTOF; - for (auto it : mPIDspecies) { + for (auto it : kPIDspecies) { pidTPC.push_back(getNsigmaTPC(track, it)); pidTOF.push_back(getNsigmaTOF(track, it)); } @@ -487,7 +486,7 @@ std::array FemtoUniverseTrackSelection::getCutContainer(T c const auto selVariable = sel.getSelectionVariable(); if (selVariable == femtoUniverseTrackSelection::kPIDnSigmaMax) { /// PID needs to be handled a bit differently since we may need more than one species - for (size_t i = 0; i < mPIDspecies.size(); ++i) { + for (size_t i = 0; i < kPIDspecies.size(); ++i) { auto pidTPCVal = pidTPC.at(i) - nSigmaPIDOffsetTPC; auto pidTOFVal = pidTOF.at(i) - nSigmaPIDOffsetTOF; auto pidComb = std::sqrt(pidTPCVal * pidTPCVal + pidTOFVal * pidTOFVal); @@ -561,7 +560,7 @@ void FemtoUniverseTrackSelection::fillQA(T const& track) mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/hITSclustersIB"), track.itsNClsInnerBarrel()); mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/hDCAxy"), track.pt(), track.dcaXY()); mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/hDCAz"), track.pt(), track.dcaZ()); - mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/hDCA"), track.pt(), std::sqrt(pow(track.dcaXY(), 2.) + pow(track.dcaZ(), 2.))); + mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/hDCA"), track.pt(), std::sqrt(std::pow(track.dcaXY(), 2.) + std::pow(track.dcaZ(), 2.))); mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/hTPCdEdX"), track.p(), track.tpcSignal()); mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/nSigmaTPC_el"), track.p(), track.tpcNSigmaEl()); mHistogramRegistry->fill(HIST(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + HIST("/") + HIST(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]) + HIST("/nSigmaTPC_pi"), track.p(), track.tpcNSigmaPi()); diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index e1428e4a6ab..3d28e133237 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -103,7 +103,7 @@ int getRowDaughters(int daughID, T const& vecID) return rowInPrimaryTrackTableDaugh; } -struct femtoUniverseProducerTask { +struct FemtoUniverseProducerTask { Produces outputCollision; Produces outputCollExtra; Produces outputParts; @@ -113,70 +113,70 @@ struct femtoUniverseProducerTask { Produces outputDebugPartsMC; Produces outputCascParts; - Configurable ConfIsDebug{"ConfIsDebug", true, "Enable Debug tables"}; + Configurable confIsDebug{"confIsDebug", true, "Enable Debug tables"}; // Choose if filtering or skimming version is run - Configurable ConfIsTrigger{"ConfIsTrigger", false, "Store all collisions"}; + // Configurable confIsTrigger{"confIsTrigger", false, "Store all collisions"}; //Commented: not used configurable // Choose if running on converted data or Run3 / Pilot - Configurable ConfIsRun3{"ConfIsRun3", true, "Running on Run3 or pilot"}; - Configurable ConfIsMC{"ConfIsMC", false, "Running on MC; implemented only for Run3"}; + Configurable confIsRun3{"confIsRun3", true, "Running on Run3 or pilot"}; + // Configurable confIsMC{"confIsMC", false, "Running on MC; implemented only for Run3"}; //Commented: not used configurable - Configurable ConfIsForceGRP{"ConfIsForceGRP", false, "Set true if the magnetic field configuration is not available in the usual CCDB directory (e.g. for Run 2 converted data or unanchorad Monte Carlo)"}; + Configurable confIsForceGRP{"confIsForceGRP", false, "Set true if the magnetic field configuration is not available in the usual CCDB directory (e.g. for Run 2 converted data or unanchorad Monte Carlo)"}; - Configurable ConfDoSpher{"ConfDoSpher", false, "Calculate sphericity. If false sphericity will take value of 2."}; - Configurable ConfFillCollExt{"ConfFillCollExt", false, "Option to fill collision extended table"}; + Configurable confDoSpher{"confDoSpher", false, "Calculate sphericity. If false sphericity will take value of 2."}; + Configurable confFillCollExt{"confFillCollExt", false, "Option to fill collision extended table"}; /// Event cuts FemtoUniverseCollisionSelection colCuts; - Configurable ConfEvtUseTPCmult{"ConfEvtUseTPCmult", false, "Use multiplicity based on the number of tracks with TPC information"}; - Configurable ConfEvtZvtx{"ConfEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; - Configurable ConfEvtTriggerCheck{"ConfEvtTriggerCheck", true, "Evt sel: check for trigger"}; - Configurable ConfEvtTriggerSel{"ConfEvtTriggerSel", kINT7, "Evt sel: trigger"}; - Configurable ConfEvtOfflineCheck{"ConfEvtOfflineCheck", false, "Evt sel: check for offline selection"}; - Configurable ConfIsActivateV0{"ConfIsActivateV0", false, "Activate filling of V0 into femtouniverse tables"}; - Configurable ConfActivateSecondaries{"ConfActivateSecondaries", false, "Fill secondary MC gen particles that were reconstructed"}; - Configurable ConfIsActivateCascade{"ConfIsActivateCascade", false, "Activate filling of Cascade into femtouniverse tables"}; - Configurable ConfIsSelectCascOmega{"ConfIsSelectCascOmega", false, "Select Omegas for cascade analysis"}; - Configurable ConfIsActivatePhi{"ConfIsActivatePhi", false, "Activate filling of Phi into femtouniverse tables"}; - Configurable ConfMCTruthAnalysisWithPID{"ConfMCTruthAnalysisWithPID", true, "1: take only particles with specified PDG, 0: all particles (for MC Truth)"}; - Configurable> ConfMCTruthPDGCodes{"ConfMCTruthPDGCodes", std::vector{211, -211, 2212, -2212, 333}, "PDG of particles to be stored"}; - Configurable ConfCentFT0Min{"ConfCentFT0Min", 0.f, "Min CentFT0 value for centrality selection"}; - Configurable ConfCentFT0Max{"ConfCentFT0Max", 200.f, "Max CentFT0 value for centrality selection"}; - Configurable ConfEvIsGoodZvtxFT0vsPV{"ConfEvIsGoodZvtxFT0vsPV", true, "Require kIsGoodZvtxFT0vsPV selection on Events."}; - Configurable ConfEvNoSameBunchPileup{"ConfEvNoSameBunchPileup", true, "Require kNoSameBunchPileup selection on Events."}; - Configurable ConfIsUsePileUp{"ConfIsUsePileUp", true, "Required for choosing whether to run the pile-up cuts"}; - Configurable ConfEvIsVertexITSTPC{"ConfEvIsVertexITSTPC", true, "Require kIsVertexITSTPC selection on Events"}; - Configurable ConfTPCOccupancyMin{"ConfTPCOccupancyMin", 0, "Minimum value for TPC Occupancy selection"}; - Configurable ConfTPCOccupancyMax{"ConfTPCOccupancyMax", 500, "Maximum value for TPC Occupancy selection"}; - - Filter CustomCollCentFilter = (aod::cent::centFT0C > ConfCentFT0Min) && - (aod::cent::centFT0C < ConfCentFT0Max); + Configurable confEvtUseTPCmult{"confEvtUseTPCmult", false, "Use multiplicity based on the number of tracks with TPC information"}; + Configurable confEvtZvtx{"confEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable confEvtTriggerCheck{"confEvtTriggerCheck", true, "Evt sel: check for trigger"}; + Configurable confEvtTriggerSel{"confEvtTriggerSel", kINT7, "Evt sel: trigger"}; + Configurable confEvtOfflineCheck{"confEvtOfflineCheck", false, "Evt sel: check for offline selection"}; + Configurable confIsActivateV0{"confIsActivateV0", false, "Activate filling of V0 into femtouniverse tables"}; + Configurable confActivateSecondaries{"confActivateSecondaries", false, "Fill secondary MC gen particles that were reconstructed"}; + Configurable confIsActivateCascade{"confIsActivateCascade", false, "Activate filling of Cascade into femtouniverse tables"}; + Configurable confIsSelectCascOmega{"confIsSelectCascOmega", false, "Select Omegas for cascade analysis"}; + Configurable confIsActivatePhi{"confIsActivatePhi", false, "Activate filling of Phi into femtouniverse tables"}; + Configurable confMCTruthAnalysisWithPID{"confMCTruthAnalysisWithPID", true, "1: take only particles with specified PDG, 0: all particles (for MC Truth)"}; + Configurable> confMCTruthPDGCodes{"confMCTruthPDGCodes", std::vector{211, -211, 2212, -2212, 333}, "PDG of particles to be stored"}; + Configurable confCentFT0Min{"confCentFT0Min", 0.f, "Min CentFT0 value for centrality selection"}; + Configurable confCentFT0Max{"confCentFT0Max", 200.f, "Max CentFT0 value for centrality selection"}; + Configurable confEvIsGoodZvtxFT0vsPV{"confEvIsGoodZvtxFT0vsPV", true, "Require kIsGoodZvtxFT0vsPV selection on Events."}; + Configurable confEvNoSameBunchPileup{"confEvNoSameBunchPileup", true, "Require kNoSameBunchPileup selection on Events."}; + Configurable confIsUsePileUp{"confIsUsePileUp", true, "Required for choosing whether to run the pile-up cuts"}; + Configurable confEvIsVertexITSTPC{"confEvIsVertexITSTPC", true, "Require kIsVertexITSTPC selection on Events"}; + Configurable confTPCOccupancyMin{"confTPCOccupancyMin", 0, "Minimum value for TPC Occupancy selection"}; + Configurable confTPCOccupancyMax{"confTPCOccupancyMax", 500, "Maximum value for TPC Occupancy selection"}; + + Filter customCollCentFilter = (aod::cent::centFT0C > confCentFT0Min) && + (aod::cent::centFT0C < confCentFT0Max); // just sanity check to make sure in case there are problems in conversion or // MC production it does not affect results - Configurable ConfTrkRejectNotPropagated{"ConfTrkRejectNotPropagated", false, "True: reject not propagated tracks"}; + Configurable confTrkRejectNotPropagated{"confTrkRejectNotPropagated", false, "True: reject not propagated tracks"}; // Configurable ConfRejectITSHitandTOFMissing{ // "ConfRejectITSHitandTOFMissing", false, // "True: reject if neither ITS hit nor TOF timing satisfied"}; FemtoUniverseTrackSelection trackCuts; - Configurable> ConfTrkCharge{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kSign, "ConfTrk"), std::vector{-1, 1}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kSign, "Track selection: ")}; - Configurable> ConfTrkPtmin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kpTMin, "ConfTrk"), std::vector{0.5f, 0.4f, 0.6f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kpTMin, "Track selection: ")}; - Configurable> ConfTrkPtmax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kpTMax, "ConfTrk"), std::vector{5.4f, 5.6f, 5.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kpTMax, "Track selection: ")}; - Configurable> ConfTrkEta{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kEtaMax, "ConfTrk"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kEtaMax, "Track selection: ")}; - Configurable> ConfTrkTPCnclsMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCnClsMin, "ConfTrk"), std::vector{70.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCnClsMin, "Track selection: ")}; - Configurable> ConfTrkTPCfCls{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCfClsMin, "ConfTrk"), std::vector{0.83f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCfClsMin, "Track selection: ")}; - Configurable> ConfTrkTPCcRowsMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCcRowsMin, "ConfTrk"), std::vector{70.f, 60.f, 80.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCcRowsMin, "Track selection: ")}; - Configurable> ConfTrkTPCsCls{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCsClsMax, "ConfTrk"), std::vector{0.1f, 160.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCsClsMax, "Track selection: ")}; - Configurable> ConfTrkITSnclsMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kITSnClsMin, "ConfTrk"), std::vector{-1.f, 2.f, 4.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kITSnClsMin, "Track selection: ")}; - Configurable> ConfTrkITSnclsIbMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kITSnClsIbMin, "ConfTrk"), std::vector{-1.f, 1.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kITSnClsIbMin, "Track selection: ")}; - Configurable> ConfTrkDCAxyMax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kDCAxyMax, "ConfTrk"), std::vector{0.1f, 3.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kDCAxyMax, "Track selection: ")}; - Configurable> ConfTrkDCAzMax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kDCAzMax, "ConfTrk"), std::vector{0.2f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kDCAzMax, "Track selection: ")}; /// \todo Reintegrate PID to the general selection container - Configurable> ConfTrkPIDnSigmaMax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kPIDnSigmaMax, "ConfTrk"), std::vector{3.5f, 3.f, 2.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kPIDnSigmaMax, "Track selection: ")}; - Configurable ConfTrkPIDnSigmaOffsetTPC{"ConfTrkPIDnSigmaOffsetTPC", 0., "Offset for TPC nSigma because of bad calibration"}; - Configurable ConfTrkPIDnSigmaOffsetTOF{"ConfTrkPIDnSigmaOffsetTOF", 0., "Offset for TOF nSigma because of bad calibration"}; - Configurable> ConfTrkPIDspecies{"ConfTrkPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Kaon, o2::track::PID::Proton, o2::track::PID::Deuteron}, "Trk sel: Particles species for PID (Pion=2, Kaon=3, Proton=4, Deuteron=5)"}; + Configurable> confTrkCharge{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kSign, "ConfTrk"), std::vector{-1, 1}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kSign, "Track selection: ")}; + Configurable> confTrkPtmin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kpTMin, "ConfTrk"), std::vector{0.5f, 0.4f, 0.6f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kpTMin, "Track selection: ")}; + Configurable> confTrkPtmax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kpTMax, "ConfTrk"), std::vector{5.4f, 5.6f, 5.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kpTMax, "Track selection: ")}; + Configurable> confTrkEta{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kEtaMax, "ConfTrk"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kEtaMax, "Track selection: ")}; + Configurable> confTrkTPCnclsMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCnClsMin, "ConfTrk"), std::vector{70.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCnClsMin, "Track selection: ")}; + Configurable> confTrkTPCfCls{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCfClsMin, "ConfTrk"), std::vector{0.83f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCfClsMin, "Track selection: ")}; + Configurable> confTrkTPCcRowsMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCcRowsMin, "ConfTrk"), std::vector{70.f, 60.f, 80.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCcRowsMin, "Track selection: ")}; + Configurable> confTrkTPCsCls{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCsClsMax, "ConfTrk"), std::vector{0.1f, 160.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCsClsMax, "Track selection: ")}; + Configurable> confTrkITSnclsMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kITSnClsMin, "ConfTrk"), std::vector{-1.f, 2.f, 4.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kITSnClsMin, "Track selection: ")}; + Configurable> confTrkITSnclsIbMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kITSnClsIbMin, "ConfTrk"), std::vector{-1.f, 1.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kITSnClsIbMin, "Track selection: ")}; + Configurable> confTrkDCAxyMax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kDCAxyMax, "ConfTrk"), std::vector{0.1f, 3.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kDCAxyMax, "Track selection: ")}; + Configurable> confTrkDCAzMax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kDCAzMax, "ConfTrk"), std::vector{0.2f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kDCAzMax, "Track selection: ")}; /// \todo Reintegrate PID to the general selection container + Configurable> confTrkPIDnSigmaMax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kPIDnSigmaMax, "ConfTrk"), std::vector{3.5f, 3.f, 2.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kPIDnSigmaMax, "Track selection: ")}; + Configurable confTrkPIDnSigmaOffsetTPC{"confTrkPIDnSigmaOffsetTPC", 0., "Offset for TPC nSigma because of bad calibration"}; + Configurable confTrkPIDnSigmaOffsetTOF{"confTrkPIDnSigmaOffsetTOF", 0., "Offset for TOF nSigma because of bad calibration"}; + Configurable> confTrkPIDspecies{"confTrkPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Kaon, o2::track::PID::Proton, o2::track::PID::Deuteron}, "Trk sel: Particles species for PID (Pion=2, Kaon=3, Proton=4, Deuteron=5)"}; // Numbers from ~/alice/O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h //static constexpr ID Pion = 2; static constexpr ID Kaon = 3; static constexpr ID Proton = 4; static constexpr ID Deuteron = 5; - Configurable ConfTOFpTmin{"ConfTOFpTmin", 500, "TOF pT min"}; + Configurable confTOFpTmin{"confTOFpTmin", 500, "TOF pT min"}; // TrackSelection *o2PhysicsTrackSelection; /// \todo Labeled array (see Track-Track task) @@ -184,120 +184,123 @@ struct femtoUniverseProducerTask { // V0 FemtoUniverseV0Selection v0Cuts; struct : o2::framework::ConfigurableGroup { - Configurable ConfIsFillV0s{"ConfIsFillV0s", false, "Choice to fill V0s"}; - Configurable> ConfV0Sign{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0Sign, "ConfV0"), std::vector{-1, 1}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0Sign, "V0 selection: ")}; - Configurable> ConfV0PtMin{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0pTMin, "ConfV0"), std::vector{0.3f, 0.4f, 0.5f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0pTMin, "V0 selection: ")}; - Configurable> ConfV0PtMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0pTMax, "ConfV0"), std::vector{3.3f, 3.4f, 3.5f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0pTMax, "V0 selection: ")}; - Configurable> ConfV0EtaMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0etaMax, "ConfV0"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0etaMax, "V0 selection: ")}; - Configurable> ConfV0DCADaughMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0DCADaughMax, "ConfV0"), std::vector{1.2f, 1.5f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0DCADaughMax, "V0 selection: ")}; - Configurable> ConfV0CPAMin{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0CPAMin, "ConfV0"), std::vector{0.99f, 0.995f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0CPAMin, "V0 selection: ")}; - Configurable> ConfV0TranRadMin{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0TranRadMin, "ConfV0"), std::vector{0.2f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0TranRadMin, "V0 selection: ")}; - Configurable> ConfV0TranRadMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0TranRadMax, "ConfV0"), std::vector{100.f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0TranRadMax, "V0 selection: ")}; - Configurable> ConfV0DecVtxMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0DecVtxMax, "ConfV0"), std::vector{100.f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0DecVtxMax, "V0 selection: ")}; - - Configurable> ConfChildCharge{"ConfChildSign", std::vector{-1, 1}, "V0 Child sel: Charge"}; - Configurable> ConfChildEtaMax{"ConfChildEtaMax", std::vector{0.8f}, "V0 Child sel: max eta"}; - Configurable> ConfChildTPCnClsMin{"ConfChildTPCnClsMin", std::vector{80.f, 70.f, 60.f}, "V0 Child sel: Min. nCls TPC"}; - Configurable> ConfChildDCAMin{"ConfChildDCAMin", std::vector{0.05f, 0.06f}, "V0 Child sel: Max. DCA Daugh to PV (cm)"}; - Configurable> ConfChildPIDnSigmaMax{"ConfChildPIDnSigmaMax", std::vector{5.f, 4.f}, "V0 Child sel: Max. PID nSigma TPC"}; - Configurable> ConfChildPIDspecies{"ConfChildPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Proton}, "V0 Child sel: Particles species for PID"}; - - Configurable ConfV0InvMassLowLimit{"ConfV0InvV0MassLowLimit", 1.05, "Lower limit of the V0 invariant mass"}; - Configurable ConfV0InvMassUpLimit{"ConfV0InvV0MassUpLimit", 1.30, "Upper limit of the V0 invariant mass"}; - - Configurable ConfV0RejectKaons{"ConfV0RejectKaons", false, "Switch to reject kaons"}; - Configurable ConfV0InvKaonMassLowLimit{"ConfV0InvKaonMassLowLimit", 0.48, "Lower limit of the V0 invariant mass for Kaon rejection"}; - Configurable ConfV0InvKaonMassUpLimit{"ConfV0InvKaonMassUpLimit", 0.515, "Upper limit of the V0 invariant mass for Kaon rejection"}; + // Configurable confIsFillV0s{"confIsFillV0s", false, "Choice to fill V0s"}; //Commented: not used configurable + Configurable> confV0Sign{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0Sign, "ConfV0"), std::vector{-1, 1}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0Sign, "V0 selection: ")}; + Configurable> confV0PtMin{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0pTMin, "ConfV0"), std::vector{0.3f, 0.4f, 0.5f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0pTMin, "V0 selection: ")}; + Configurable> confV0PtMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0pTMax, "ConfV0"), std::vector{3.3f, 3.4f, 3.5f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0pTMax, "V0 selection: ")}; + Configurable> confV0EtaMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0etaMax, "ConfV0"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0etaMax, "V0 selection: ")}; + Configurable> confV0DCADaughMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0DCADaughMax, "ConfV0"), std::vector{1.2f, 1.5f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0DCADaughMax, "V0 selection: ")}; + Configurable> confV0CPAMin{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0CPAMin, "ConfV0"), std::vector{0.99f, 0.995f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0CPAMin, "V0 selection: ")}; + Configurable> confV0TranRadMin{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0TranRadMin, "ConfV0"), std::vector{0.2f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0TranRadMin, "V0 selection: ")}; + Configurable> confV0TranRadMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0TranRadMax, "ConfV0"), std::vector{100.f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0TranRadMax, "V0 selection: ")}; + Configurable> confV0DecVtxMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0DecVtxMax, "ConfV0"), std::vector{100.f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0DecVtxMax, "V0 selection: ")}; + + Configurable> confChildCharge{"confChildCharge", std::vector{-1, 1}, "V0 Child sel: Charge"}; + Configurable> confChildEtaMax{"confChildEtaMax", std::vector{0.8f}, "V0 Child sel: max eta"}; + Configurable> confChildTPCnClsMin{"confChildTPCnClsMin", std::vector{80.f, 70.f, 60.f}, "V0 Child sel: Min. nCls TPC"}; + Configurable> confChildDCAMin{"confChildDCAMin", std::vector{0.05f, 0.06f}, "V0 Child sel: Max. DCA Daugh to PV (cm)"}; + Configurable> confChildPIDnSigmaMax{"confChildPIDnSigmaMax", std::vector{5.f, 4.f}, "V0 Child sel: Max. PID nSigma TPC"}; + Configurable> confChildPIDspecies{"confChildPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Proton}, "V0 Child sel: Particles species for PID"}; + + Configurable confV0InvMassLowLimit{"confV0InvMassLowLimit", 1.05, "Lower limit of the V0 invariant mass"}; + Configurable confV0InvMassUpLimit{"confV0InvMassUpLimit", 1.30, "Upper limit of the V0 invariant mass"}; + + Configurable confV0RejectKaons{"confV0RejectKaons", false, "Switch to reject kaons"}; + Configurable confV0InvKaonMassLowLimit{"confV0InvKaonMassLowLimit", 0.48, "Lower limit of the V0 invariant mass for Kaon rejection"}; + Configurable confV0InvKaonMassUpLimit{"confV0InvKaonMassUpLimit", 0.515, "Upper limit of the V0 invariant mass for Kaon rejection"}; } ConfV0Selection; struct : o2::framework::ConfigurableGroup { - Configurable ConfPtLowFilterCut{"ConfPtLowFilterCut", 0.14, "Lower limit for Pt for the global track"}; // pT low - Configurable ConfPtHighFilterCut{"ConfPtHighFilterCut", 5.0, "Higher limit for Pt for the global track"}; // pT high - Configurable ConfEtaFilterCut{"ConfEtaFilterCut", 0.8, "Eta cut for the global track"}; // eta - Configurable ConfDxaXYCustom0Cut{"ConfDxaXYCustom0Cut", false, "Enable Custom Dcaxy < [0] cut."}; - Configurable ConfDcaXYFilterCut{"ConfDcaXYFilterCut", 2.4, "Value for DCA_XY for the global track"}; // max dca to vertex XY - Configurable ConfDcaZFilterCut{"ConfDcaZFilterCut", 3.2, "Value for DCA_Z for the global track"}; // max dca to vertex Z - Configurable ConfDcaXYCustom1Cut{"ConfDcaXYCustom1Cut", true, "Enable Custom |DCAxy| < [1] + [2]/pt cut."}; - Configurable ConfDcaXYCustom11FilterCut{"ConfDcaXY1FilterCut", 0.004, "Value for [1] custom DCAxy cut -> |DCAxy| < [1] + [2]/pT"}; - Configurable ConfDcaXYCustom12FilterCut{"ConfDcaXY2FilterCut", 0.013, "Value for [2] custom DCAxy cut -> |DCAxy| < [1] + [2]/pT"}; + Configurable confPtLowFilterCut{"confPtLowFilterCut", 0.14, "Lower limit for Pt for the global track"}; // pT low + Configurable confPtHighFilterCut{"confPtHighFilterCut", 5.0, "Higher limit for Pt for the global track"}; // pT high + Configurable confEtaFilterCut{"confEtaFilterCut", 0.8, "Eta cut for the global track"}; // eta + Configurable confDxaXYCustom0Cut{"confDxaXYCustom0Cut", false, "Enable Custom Dcaxy < [0] cut."}; + Configurable confDcaXYFilterCut{"confDcaXYFilterCut", 2.4, "Value for DCA_XY for the global track"}; // max dca to vertex XY + Configurable confDcaZFilterCut{"confDcaZFilterCut", 3.2, "Value for DCA_Z for the global track"}; // max dca to vertex Z + Configurable confDcaXYCustom1Cut{"confDcaXYCustom1Cut", true, "Enable Custom |DCAxy| < [1] + [2]/pt cut."}; + Configurable confDcaXYCustom11FilterCut{"confDcaXYCustom11FilterCut", 0.004, "Value for [1] custom DCAxy cut -> |DCAxy| < [1] + [2]/pT"}; + Configurable confDcaXYCustom12FilterCut{"confDcaXYCustom12FilterCut", 0.013, "Value for [2] custom DCAxy cut -> |DCAxy| < [1] + [2]/pT"}; } ConfFilterCuts; - Filter GlobalCutFilter = requireGlobalTrackInFilter(); - Filter CustomTrackFilter = (aod::track::pt > ConfFilterCuts.ConfPtLowFilterCut) && - (aod::track::pt < ConfFilterCuts.ConfPtHighFilterCut) && - (nabs(aod::track::eta) < ConfFilterCuts.ConfEtaFilterCut) && - (!ConfFilterCuts.ConfDxaXYCustom0Cut || (aod::track::dcaXY < ConfFilterCuts.ConfDcaXYFilterCut)) && // true if configurable set to false or if configurable is true and it passes the selection - (aod::track::dcaZ < ConfFilterCuts.ConfDcaZFilterCut) && - (!ConfFilterCuts.ConfDcaXYCustom1Cut || (nabs(aod::track::dcaXY) < ConfFilterCuts.ConfDcaXYCustom11FilterCut + ConfFilterCuts.ConfDcaXYCustom12FilterCut / aod::track::pt)); // same logic here + Filter globalCutFilter = requireGlobalTrackInFilter(); + Filter customTrackFilter = (aod::track::pt > ConfFilterCuts.confPtLowFilterCut) && + (aod::track::pt < ConfFilterCuts.confPtHighFilterCut) && + (nabs(aod::track::eta) < ConfFilterCuts.confEtaFilterCut) && + (!ConfFilterCuts.confDxaXYCustom0Cut || (aod::track::dcaXY < ConfFilterCuts.confDcaXYFilterCut)) && // true if configurable set to false or if configurable is true and it passes the selection + (aod::track::dcaZ < ConfFilterCuts.confDcaZFilterCut) && + (!ConfFilterCuts.confDcaXYCustom1Cut || (nabs(aod::track::dcaXY) < ConfFilterCuts.confDcaXYCustom11FilterCut + ConfFilterCuts.confDcaXYCustom12FilterCut / aod::track::pt)); // same logic here // CASCADE FemtoUniverseCascadeSelection cascadeCuts; struct : o2::framework::ConfigurableGroup { - Configurable ConfIsFillCascades{"ConfIsFillCascades", false, "Choice to fill cascades"}; - Configurable> ConfCascSign{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeSign, "ConfCasc"), std::vector{-1, 1}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeSign, "Cascade selection: ")}; - Configurable> ConfCascPtMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadepTMin, "ConfCasc"), std::vector{0.3f, 0.4f, 0.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadepTMin, "Cascade selection: ")}; - Configurable> ConfCascPtMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadepTMax, "ConfCasc"), std::vector{3.3f, 3.4f, 3.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadepTMax, "Cascade selection: ")}; - Configurable> ConfCascEtaMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeetaMax, "ConfCasc"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeetaMax, "Cascade selection: ")}; - Configurable> ConfCascV0DCADaughMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0DCADaughMax, "ConfCasc"), std::vector{1.f, 1.2f, 1.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0DCADaughMax, "Cascade selection: ")}; - Configurable> ConfCascV0CPAMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0CPAMin, "ConfCasc"), std::vector{0.99f, 0.95f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0CPAMin, "Cascade selection: ")}; - Configurable> ConfCascV0TranRadMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0TranRadMin, "ConfCasc"), std::vector{0.2f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0TranRadMin, "Cascade selection: ")}; - Configurable> ConfCascV0TranRadMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0TranRadMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0TranRadMax, "Cascade selection: ")}; - Configurable> ConfCascV0DecVtxMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0DecVtxMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0DecVtxMax, "Cascade selection: ")}; - Configurable> ConfCascDCADaughMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCADaughMax, "ConfCasc"), std::vector{1.f, 1.2f, 1.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCADaughMax, "Cascade selection: ")}; - Configurable> ConfCascCPAMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeCPAMin, "ConfCasc"), std::vector{0.99f, 0.95f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeCPAMin, "Cascade selection: ")}; - Configurable> ConfCascTranRadMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeTranRadMin, "ConfCasc"), std::vector{0.2f, 0.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeTranRadMin, "Cascade selection: ")}; - Configurable> ConfCascTranRadMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeTranRadMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeTranRadMax, "Cascade selection: ")}; - Configurable> ConfCascDecVtxMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDecVtxMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDecVtxMax, "Cascade selection: ")}; - - Configurable> ConfCascDCAPosToPV{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCAPosToPV, "ConfCasc"), std::vector{0.1f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCAPosToPV, "Cascade selection: ")}; - Configurable> ConfCascDCANegToPV{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCANegToPV, "ConfCasc"), std::vector{0.1f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCANegToPV, "Cascade selection: ")}; - Configurable> ConfCascDCABachToPV{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCABachToPV, "ConfCasc"), std::vector{0.1f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCABachToPV, "Cascade selection: ")}; - Configurable> ConfCascDCAV0ToPV{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCAV0ToPV, "ConfCasc"), std::vector{0.01f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCAV0ToPV, "Cascade selection: ")}; - Configurable> ConfCascV0MassLowLimit{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0MassMin, "ConfCasc"), std::vector{1.05f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0MassMin, "Cascade selection: ")}; - Configurable> ConfCascV0MassUpLimit{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0MassMax, "ConfCasc"), std::vector{1.30f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0MassMax, "Cascade selection: ")}; - - Configurable> ConfCascChildCharge{"ConfCascChildSign", std::vector{-1, 1}, "Cascade Child sel: Charge"}; - Configurable> ConfCascChildEtaMax{"ConfCascChildEtaMax", std::vector{0.8f}, "Cascade Child sel: max eta"}; - Configurable> ConfCascChildTPCnClsMin{"ConfCascChildTPCnClsMin", std::vector{80.f, 70.f, 60.f}, "Cascade Child sel: Min. nCls TPC"}; - // Configurable> ConfCascChildDCAMin{"ConfCascChildDCAMin", std::vector{0.05f, 0.06f}, "Cascade Child sel: Max. DCA Daugh to PV (cm)"}; - Configurable> ConfCascChildPIDnSigmaMax{"ConfCascChildPIDnSigmaMax", std::vector{3.f, 4.f}, "Cascade Child sel: Max. PID nSigma TPC"}; - Configurable> ConfCascChildPIDspecies{"ConfCascChildPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Proton}, "Cascade Child sel: particle species for PID"}; - - Configurable ConfCascInvMassLowLimit{"ConfCascInvMassLowLimit", 1.25, "Lower limit of the cascade invariant mass"}; - Configurable ConfCascInvMassUpLimit{"ConfCascInvMassUpLimit", 1.40, "Upper limit of the cascade invariant mass"}; - - Configurable ConfCascRejectCompetingMass{"ConfCascRejectCompetingMass", false, "Switch on to reject Omegas (for Xi) or Xis (for Omegas)"}; - Configurable ConfCascInvCompetingMassLowLimit{"ConfCascInvCompetingMassLowLimit", 1.66, "Lower limit of the cascade invariant mass for competing mass rejection"}; - Configurable ConfCascInvCompetingMassUpLimit{"ConfCascInvCompetingMassUpLimit", 1.68, "Upper limit of the cascade invariant mass for competing mass rejection"}; + // Configurable confIsFillCascades{"confIsFillCascades", false, "Choice to fill cascades"}; //Commented: not used configurable + Configurable> confCascSign{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeSign, "ConfCasc"), std::vector{-1, 1}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeSign, "Cascade selection: ")}; + Configurable> confCascPtMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadepTMin, "ConfCasc"), std::vector{0.3f, 0.4f, 0.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadepTMin, "Cascade selection: ")}; + Configurable> confCascPtMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadepTMax, "ConfCasc"), std::vector{3.3f, 3.4f, 3.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadepTMax, "Cascade selection: ")}; + Configurable> confCascEtaMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeetaMax, "ConfCasc"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeetaMax, "Cascade selection: ")}; + Configurable> confCascV0DCADaughMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0DCADaughMax, "ConfCasc"), std::vector{1.f, 1.2f, 1.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0DCADaughMax, "Cascade selection: ")}; + Configurable> confCascV0CPAMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0CPAMin, "ConfCasc"), std::vector{0.99f, 0.95f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0CPAMin, "Cascade selection: ")}; + Configurable> confCascV0TranRadMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0TranRadMin, "ConfCasc"), std::vector{0.2f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0TranRadMin, "Cascade selection: ")}; + Configurable> confCascV0TranRadMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0TranRadMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0TranRadMax, "Cascade selection: ")}; + Configurable> confCascV0DecVtxMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0DecVtxMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0DecVtxMax, "Cascade selection: ")}; + Configurable> confCascDCADaughMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCADaughMax, "ConfCasc"), std::vector{1.f, 1.2f, 1.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCADaughMax, "Cascade selection: ")}; + Configurable> confCascCPAMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeCPAMin, "ConfCasc"), std::vector{0.99f, 0.95f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeCPAMin, "Cascade selection: ")}; + Configurable> confCascTranRadMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeTranRadMin, "ConfCasc"), std::vector{0.2f, 0.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeTranRadMin, "Cascade selection: ")}; + Configurable> confCascTranRadMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeTranRadMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeTranRadMax, "Cascade selection: ")}; + Configurable> confCascDecVtxMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDecVtxMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDecVtxMax, "Cascade selection: ")}; + + Configurable> confCascDCAPosToPV{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCAPosToPV, "ConfCasc"), std::vector{0.1f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCAPosToPV, "Cascade selection: ")}; + Configurable> confCascDCANegToPV{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCANegToPV, "ConfCasc"), std::vector{0.1f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCANegToPV, "Cascade selection: ")}; + Configurable> confCascDCABachToPV{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCABachToPV, "ConfCasc"), std::vector{0.1f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCABachToPV, "Cascade selection: ")}; + Configurable> confCascDCAV0ToPV{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCAV0ToPV, "ConfCasc"), std::vector{0.01f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCAV0ToPV, "Cascade selection: ")}; + Configurable> confCascV0MassLowLimit{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0MassMin, "ConfCasc"), std::vector{1.05f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0MassMin, "Cascade selection: ")}; + Configurable> confCascV0MassUpLimit{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0MassMax, "ConfCasc"), std::vector{1.30f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0MassMax, "Cascade selection: ")}; + + Configurable> confCascChildCharge{"confCascChildCharge", std::vector{-1, 1}, "Cascade Child sel: Charge"}; + Configurable> confCascChildEtaMax{"confCascChildEtaMax", std::vector{0.8f}, "Cascade Child sel: max eta"}; + Configurable> confCascChildTPCnClsMin{"confCascChildTPCnClsMin", std::vector{80.f, 70.f, 60.f}, "Cascade Child sel: Min. nCls TPC"}; + // Configurable> confCascChildDCAMin{"confCascChildDCAMin", std::vector{0.05f, 0.06f}, "Cascade Child sel: Max. DCA Daugh to PV (cm)"}; //Commented: not used variable + Configurable> confCascChildPIDnSigmaMax{"confCascChildPIDnSigmaMax", std::vector{3.f, 4.f}, "Cascade Child sel: Max. PID nSigma TPC"}; + Configurable> confCascChildPIDspecies{"confCascChildPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Proton}, "Cascade Child sel: particle species for PID"}; + + Configurable confCascInvMassLowLimit{"confCascInvMassLowLimit", 1.25, "Lower limit of the cascade invariant mass"}; + Configurable confCascInvMassUpLimit{"confCascInvMassUpLimit", 1.40, "Upper limit of the cascade invariant mass"}; + + Configurable confCascRejectCompetingMass{"confCascRejectCompetingMass", false, "Switch on to reject Omegas (for Xi) or Xis (for Omegas)"}; + Configurable confCascInvCompetingMassLowLimit{"confCascInvCompetingMassLowLimit", 1.66, "Lower limit of the cascade invariant mass for competing mass rejection"}; + Configurable confCascInvCompetingMassUpLimit{"confCascInvCompetingMassUpLimit", 1.68, "Upper limit of the cascade invariant mass for competing mass rejection"}; } ConfCascadeSelection; // PHI FemtoUniversePhiSelection phiCuts; struct : o2::framework::ConfigurableGroup { - Configurable ConfLooseTPCNSigma{"ConfLooseTPCNSigma", false, "Use loose TPC N sigmas for Kaon PID."}; - Configurable ConfLooseTPCNSigmaValue{"ConfLooseTPCNSigmaValue", 10, "Value for the loose TPC N Sigma for Kaon PID."}; - Configurable ConfLooseTOFNSigma{"ConfLooseTOFNSigma", false, "Use loose TPC N sigmas for Kaon PID."}; - Configurable ConfLooseTOFNSigmaValue{"ConfLooseTOFNSigmaValue", 10, "Value for the loose TOF N Sigma for Kaon PID."}; - Configurable ConfInvMassLowLimitPhi{"ConfInvMassLowLimitPhi", 1.011, "Lower limit of the Phi invariant mass"}; // change that to do invariant mass cut - Configurable ConfInvMassUpLimitPhi{"ConfInvMassUpLimitPhi", 1.027, "Upper limit of the Phi invariant mass"}; - Configurable ConfPtLowLimitPhi{"ConfPtLowLimitPhi", 0.8, "Lower limit of the Phi pT."}; - Configurable ConfPtHighLimitPhi{"ConfPtHighLimitPhi", 4.0, "Higher limit of the Phi pT."}; - Configurable ConfNsigmaRejectPion{"ConfNsigmaRejectPion", 3.0, "Reject if particle could be a Pion combined nsigma value."}; - Configurable ConfNsigmaRejectProton{"ConfNsigmaRejectProton", 3.0, "Reject if particle could be a Proton combined nsigma value."}; + /// Phi meson + Configurable confInvMassLowLimitPhi{"confInvMassLowLimitPhi", 1.011, "Lower limit of the Phi invariant mass"}; // change that to do invariant mass cut + Configurable confInvMassUpLimitPhi{"confInvMassUpLimitPhi", 1.027, "Upper limit of the Phi invariant mass"}; + Configurable confPtLowLimitPhi{"confPtLowLimitPhi", 0.8, "Lower limit of the Phi pT."}; + Configurable confPtHighLimitPhi{"confPtHighLimitPhi", 4.0, "Higher limit of the Phi pT."}; + // Phi meson daughters + Configurable confLooseTPCNSigma{"confLooseTPCNSigma", false, "Use loose TPC N sigmas for Kaon PID."}; + Configurable confLooseTPCNSigmaValue{"confLooseTPCNSigmaValue", 10, "Value for the loose TPC N Sigma for Kaon PID."}; + Configurable confLooseTOFNSigma{"confLooseTOFNSigma", false, "Use loose TPC N sigmas for Kaon PID."}; + Configurable confNsigmaRejectPion{"confNsigmaRejectPion", 3.0, "Reject if particle could be a Pion combined nsigma value."}; + Configurable confNsigmaRejectProton{"confNsigmaRejectProton", 3.0, "Reject if particle could be a Proton combined nsigma value."}; + Configurable confLooseTOFNSigmaValue{"confLooseTOFNSigmaValue", 10, "Value for the loose TOF N Sigma for Kaon PID."}; } ConfPhiSelection; - Configurable ConfPDGCodePartOne{"ConfPDGCodePartOne", 321, "Particle 1 - PDG code"}; - Configurable ConfPDGCodePartTwo{"ConfPDGCodePartTwo", 321, "Particle 2 - PDG code"}; + // PDG codes for fillMCParticle function + Configurable confPDGCodePartOne{"confPDGCodePartOne", 321, "Particle 1 - PDG code"}; + Configurable confPDGCodePartTwo{"confPDGCodePartTwo", 321, "Particle 2 - PDG code"}; // D0/D0bar mesons struct : o2::framework::ConfigurableGroup { - Configurable ConfD0D0barCandMaxY{"ConfD0D0barCandMaxY", -1., "max. cand. rapidity"}; - Configurable ConfD0D0barCandEtaCut{"ConfD0D0barCandEtaCut", 0.8, "max. cand. pseudorapidity"}; + Configurable confD0D0barCandMaxY{"confD0D0barCandMaxY", -1., "max. cand. rapidity"}; + Configurable confD0D0barCandEtaCut{"confD0D0barCandEtaCut", 0.8, "max. cand. pseudorapidity"}; } ConfD0Selection; HfHelper hfHelper; - bool IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK) + bool isKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK) { if (mom < 0.3) { // 0.0-0.3 @@ -337,35 +340,35 @@ struct femtoUniverseProducerTask { } } - bool IsKaonNSigmaTPCLoose(float mom, float nsigmaTPCK, float nsigmaTOFK) + bool isKaonNSigmaTPCLoose(float mom, float nsigmaTPCK, float nsigmaTOFK) { if (mom < 0.3) { // 0.0-0.3 - if (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { + if (std::abs(nsigmaTPCK) < ConfPhiSelection.confLooseTPCNSigmaValue.value) { return true; } else { return false; } } else if (mom < 0.45) { // 0.30 - 0.45 - if (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { + if (std::abs(nsigmaTPCK) < ConfPhiSelection.confLooseTPCNSigmaValue.value) { return true; } else { return false; } } else if (mom < 0.55) { // 0.45-0.55 - if (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value) { + if (std::abs(nsigmaTPCK) < ConfPhiSelection.confLooseTPCNSigmaValue.value) { return true; } else { return false; } } else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF) - if ((std::abs(nsigmaTOFK) < 3.0) && (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value)) { + if ((std::abs(nsigmaTOFK) < 3.0) && (std::abs(nsigmaTPCK) < ConfPhiSelection.confLooseTPCNSigmaValue.value)) { return true; } else { return false; } } else if (mom > 1.5) { // 1.5 - - if ((std::abs(nsigmaTOFK) < 2.0) && (std::abs(nsigmaTPCK) < ConfPhiSelection.ConfLooseTPCNSigmaValue.value)) { + if ((std::abs(nsigmaTOFK) < 2.0) && (std::abs(nsigmaTPCK) < ConfPhiSelection.confLooseTPCNSigmaValue.value)) { return true; } else { return false; @@ -375,7 +378,7 @@ struct femtoUniverseProducerTask { } } - bool IsKaonNSigmaTOFLoose(float mom, float nsigmaTPCK, float nsigmaTOFK) + bool isKaonNSigmaTOFLoose(float mom, float nsigmaTPCK, float nsigmaTOFK) { if (mom < 0.3) { // 0.0-0.3 if (std::abs(nsigmaTPCK) < 3.0) { @@ -396,7 +399,7 @@ struct femtoUniverseProducerTask { return false; } } else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF) - if ((std::abs(nsigmaTOFK) < ConfPhiSelection.ConfLooseTOFNSigmaValue.value) && (std::abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < ConfPhiSelection.confLooseTOFNSigmaValue.value) && (std::abs(nsigmaTPCK) < 3.0)) { { return true; } @@ -404,7 +407,7 @@ struct femtoUniverseProducerTask { return false; } } else if (mom > 1.5) { // 1.5 - - if ((std::abs(nsigmaTOFK) < ConfPhiSelection.ConfLooseTOFNSigmaValue.value) && (std::abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < ConfPhiSelection.confLooseTOFNSigmaValue.value) && (std::abs(nsigmaTPCK) < 3.0)) { return true; } else { return false; @@ -414,19 +417,19 @@ struct femtoUniverseProducerTask { } } - bool IsKaonRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi) + bool isKaonRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi) { if (mom < 0.5) { - if (std::abs(nsigmaTPCPi) < ConfPhiSelection.ConfNsigmaRejectPion.value) { + if (std::abs(nsigmaTPCPi) < ConfPhiSelection.confNsigmaRejectPion.value) { return true; - } else if (std::abs(nsigmaTPCPr) < ConfPhiSelection.ConfNsigmaRejectProton.value) { + } else if (std::abs(nsigmaTPCPr) < ConfPhiSelection.confNsigmaRejectProton.value) { return true; } } if (mom > 0.5) { - if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfPhiSelection.ConfNsigmaRejectPion.value) { + if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfPhiSelection.confNsigmaRejectPion.value) { return true; - } else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfPhiSelection.ConfNsigmaRejectProton.value) { + } else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfPhiSelection.confNsigmaRejectProton.value) { return true; } else { return false; @@ -462,65 +465,65 @@ struct femtoUniverseProducerTask { "Please choose one."); } - colCuts.setCuts(ConfEvtZvtx, ConfEvtTriggerCheck, ConfEvtTriggerSel, ConfEvtOfflineCheck, ConfIsRun3, ConfCentFT0Min, ConfCentFT0Max); + colCuts.setCuts(confEvtZvtx, confEvtTriggerCheck, confEvtTriggerSel, confEvtOfflineCheck, confIsRun3, confCentFT0Min, confCentFT0Max); colCuts.init(&qaRegistry); - trackCuts.setSelection(ConfTrkCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - trackCuts.setSelection(ConfTrkPtmin, femtoUniverseTrackSelection::kpTMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkPtmax, femtoUniverseTrackSelection::kpTMax, femtoUniverseSelection::kUpperLimit); - trackCuts.setSelection(ConfTrkEta, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - trackCuts.setSelection(ConfTrkTPCnclsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkTPCfCls, femtoUniverseTrackSelection::kTPCfClsMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkTPCcRowsMin, femtoUniverseTrackSelection::kTPCcRowsMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkTPCsCls, femtoUniverseTrackSelection::kTPCsClsMax, femtoUniverseSelection::kUpperLimit); - trackCuts.setSelection(ConfTrkITSnclsMin, femtoUniverseTrackSelection::kITSnClsMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkITSnclsIbMin, femtoUniverseTrackSelection::kITSnClsIbMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkDCAxyMax, femtoUniverseTrackSelection::kDCAxyMax, femtoUniverseSelection::kAbsUpperLimit); - trackCuts.setSelection(ConfTrkDCAzMax, femtoUniverseTrackSelection::kDCAzMax, femtoUniverseSelection::kAbsUpperLimit); - trackCuts.setSelection(ConfTrkPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); - trackCuts.setPIDSpecies(ConfTrkPIDspecies); - trackCuts.setnSigmaPIDOffset(ConfTrkPIDnSigmaOffsetTPC, ConfTrkPIDnSigmaOffsetTOF); + trackCuts.setSelection(confTrkCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); + trackCuts.setSelection(confTrkPtmin, femtoUniverseTrackSelection::kpTMin, femtoUniverseSelection::kLowerLimit); + trackCuts.setSelection(confTrkPtmax, femtoUniverseTrackSelection::kpTMax, femtoUniverseSelection::kUpperLimit); + trackCuts.setSelection(confTrkEta, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); + trackCuts.setSelection(confTrkTPCnclsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); + trackCuts.setSelection(confTrkTPCfCls, femtoUniverseTrackSelection::kTPCfClsMin, femtoUniverseSelection::kLowerLimit); + trackCuts.setSelection(confTrkTPCcRowsMin, femtoUniverseTrackSelection::kTPCcRowsMin, femtoUniverseSelection::kLowerLimit); + trackCuts.setSelection(confTrkTPCsCls, femtoUniverseTrackSelection::kTPCsClsMax, femtoUniverseSelection::kUpperLimit); + trackCuts.setSelection(confTrkITSnclsMin, femtoUniverseTrackSelection::kITSnClsMin, femtoUniverseSelection::kLowerLimit); + trackCuts.setSelection(confTrkITSnclsIbMin, femtoUniverseTrackSelection::kITSnClsIbMin, femtoUniverseSelection::kLowerLimit); + trackCuts.setSelection(confTrkDCAxyMax, femtoUniverseTrackSelection::kDCAxyMax, femtoUniverseSelection::kAbsUpperLimit); + trackCuts.setSelection(confTrkDCAzMax, femtoUniverseTrackSelection::kDCAzMax, femtoUniverseSelection::kAbsUpperLimit); + trackCuts.setSelection(confTrkPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); + trackCuts.setPIDSpecies(confTrkPIDspecies); + trackCuts.setnSigmaPIDOffset(confTrkPIDnSigmaOffsetTPC, confTrkPIDnSigmaOffsetTOF); trackCuts.init(&qaRegistry); /// \todo fix how to pass array to setSelection, getRow() passing a /// different type! // v0Cuts.setSelection(ConfV0Selection->getRow(0), // femtoUniverseV0Selection::kDecVtxMax, femtoUniverseSelection::kAbsUpperLimit); - if (ConfIsActivateV0) { + if (confIsActivateV0) { // initializing for V0 - v0Cuts.setSelection(ConfV0Selection.ConfV0Sign, femtoUniverseV0Selection::kV0Sign, femtoUniverseSelection::kEqual); - v0Cuts.setSelection(ConfV0Selection.ConfV0PtMin, femtoUniverseV0Selection::kV0pTMin, femtoUniverseSelection::kLowerLimit); - v0Cuts.setSelection(ConfV0Selection.ConfV0PtMax, femtoUniverseV0Selection::kV0pTMax, femtoUniverseSelection::kUpperLimit); - v0Cuts.setSelection(ConfV0Selection.ConfV0EtaMax, femtoUniverseV0Selection::kV0etaMax, femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setSelection(ConfV0Selection.ConfV0DCADaughMax, femtoUniverseV0Selection::kV0DCADaughMax, femtoUniverseSelection::kUpperLimit); - v0Cuts.setSelection(ConfV0Selection.ConfV0CPAMin, femtoUniverseV0Selection::kV0CPAMin, femtoUniverseSelection::kLowerLimit); - v0Cuts.setSelection(ConfV0Selection.ConfV0TranRadMin, femtoUniverseV0Selection::kV0TranRadMin, femtoUniverseSelection::kLowerLimit); - v0Cuts.setSelection(ConfV0Selection.ConfV0TranRadMax, femtoUniverseV0Selection::kV0TranRadMax, femtoUniverseSelection::kUpperLimit); - v0Cuts.setSelection(ConfV0Selection.ConfV0DecVtxMax, femtoUniverseV0Selection::kV0DecVtxMax, femtoUniverseSelection::kUpperLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.ConfChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.ConfChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.ConfChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.ConfChildDCAMin, femtoUniverseTrackSelection::kDCAMin, femtoUniverseSelection::kAbsLowerLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.ConfChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.ConfChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.ConfChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.ConfChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.ConfChildDCAMin, femtoUniverseTrackSelection::kDCAMin, femtoUniverseSelection::kAbsLowerLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.ConfChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setChildPIDSpecies(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.ConfChildPIDspecies); - v0Cuts.setChildPIDSpecies(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.ConfChildPIDspecies); + v0Cuts.setSelection(ConfV0Selection.confV0Sign, femtoUniverseV0Selection::kV0Sign, femtoUniverseSelection::kEqual); + v0Cuts.setSelection(ConfV0Selection.confV0PtMin, femtoUniverseV0Selection::kV0pTMin, femtoUniverseSelection::kLowerLimit); + v0Cuts.setSelection(ConfV0Selection.confV0PtMax, femtoUniverseV0Selection::kV0pTMax, femtoUniverseSelection::kUpperLimit); + v0Cuts.setSelection(ConfV0Selection.confV0EtaMax, femtoUniverseV0Selection::kV0etaMax, femtoUniverseSelection::kAbsUpperLimit); + v0Cuts.setSelection(ConfV0Selection.confV0DCADaughMax, femtoUniverseV0Selection::kV0DCADaughMax, femtoUniverseSelection::kUpperLimit); + v0Cuts.setSelection(ConfV0Selection.confV0CPAMin, femtoUniverseV0Selection::kV0CPAMin, femtoUniverseSelection::kLowerLimit); + v0Cuts.setSelection(ConfV0Selection.confV0TranRadMin, femtoUniverseV0Selection::kV0TranRadMin, femtoUniverseSelection::kLowerLimit); + v0Cuts.setSelection(ConfV0Selection.confV0TranRadMax, femtoUniverseV0Selection::kV0TranRadMax, femtoUniverseSelection::kUpperLimit); + v0Cuts.setSelection(ConfV0Selection.confV0DecVtxMax, femtoUniverseV0Selection::kV0DecVtxMax, femtoUniverseSelection::kUpperLimit); + v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.confChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); + v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.confChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); + v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.confChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); + v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.confChildDCAMin, femtoUniverseTrackSelection::kDCAMin, femtoUniverseSelection::kAbsLowerLimit); + v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.confChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); + v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.confChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); + v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.confChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); + v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.confChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); + v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.confChildDCAMin, femtoUniverseTrackSelection::kDCAMin, femtoUniverseSelection::kAbsLowerLimit); + v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.confChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); + v0Cuts.setChildPIDSpecies(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.confChildPIDspecies); + v0Cuts.setChildPIDSpecies(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.confChildPIDspecies); v0Cuts.init(&qaRegistry); - v0Cuts.setInvMassLimits(ConfV0Selection.ConfV0InvMassLowLimit, ConfV0Selection.ConfV0InvMassUpLimit); + v0Cuts.setInvMassLimits(ConfV0Selection.confV0InvMassLowLimit, ConfV0Selection.confV0InvMassUpLimit); - v0Cuts.setChildRejectNotPropagatedTracks(femtoUniverseV0Selection::kPosTrack, ConfTrkRejectNotPropagated); - v0Cuts.setChildRejectNotPropagatedTracks(femtoUniverseV0Selection::kNegTrack, ConfTrkRejectNotPropagated); + v0Cuts.setChildRejectNotPropagatedTracks(femtoUniverseV0Selection::kPosTrack, confTrkRejectNotPropagated); + v0Cuts.setChildRejectNotPropagatedTracks(femtoUniverseV0Selection::kNegTrack, confTrkRejectNotPropagated); - v0Cuts.setnSigmaPIDOffsetTPC(ConfTrkPIDnSigmaOffsetTPC); - v0Cuts.setChildnSigmaPIDOffset(femtoUniverseV0Selection::kPosTrack, ConfTrkPIDnSigmaOffsetTPC, ConfTrkPIDnSigmaOffsetTOF); - v0Cuts.setChildnSigmaPIDOffset(femtoUniverseV0Selection::kNegTrack, ConfTrkPIDnSigmaOffsetTPC, ConfTrkPIDnSigmaOffsetTOF); + v0Cuts.setnSigmaPIDOffsetTPC(confTrkPIDnSigmaOffsetTPC); + v0Cuts.setChildnSigmaPIDOffset(femtoUniverseV0Selection::kPosTrack, confTrkPIDnSigmaOffsetTPC, confTrkPIDnSigmaOffsetTOF); + v0Cuts.setChildnSigmaPIDOffset(femtoUniverseV0Selection::kNegTrack, confTrkPIDnSigmaOffsetTPC, confTrkPIDnSigmaOffsetTOF); - if (ConfV0Selection.ConfV0RejectKaons) { - v0Cuts.setKaonInvMassLimits(ConfV0Selection.ConfV0InvKaonMassLowLimit, ConfV0Selection.ConfV0InvKaonMassUpLimit); + if (ConfV0Selection.confV0RejectKaons) { + v0Cuts.setKaonInvMassLimits(ConfV0Selection.confV0InvKaonMassLowLimit, ConfV0Selection.confV0InvKaonMassUpLimit); } // if (ConfRejectITSHitandTOFMissing) { // o2PhysicsTrackSelection = new @@ -529,60 +532,60 @@ struct femtoUniverseProducerTask { // } } - if (ConfIsActivateCascade) { + if (confIsActivateCascade) { // initializing for cascades - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascSign, femtoUniverseCascadeSelection::kCascadeSign, femtoUniverseSelection::kEqual); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascPtMin, femtoUniverseCascadeSelection::kCascadepTMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascPtMax, femtoUniverseCascadeSelection::kCascadepTMax, femtoUniverseSelection::kUpperLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascEtaMax, femtoUniverseCascadeSelection::kCascadeetaMax, femtoUniverseSelection::kAbsUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascSign, femtoUniverseCascadeSelection::kCascadeSign, femtoUniverseSelection::kEqual); + cascadeCuts.setSelection(ConfCascadeSelection.confCascPtMin, femtoUniverseCascadeSelection::kCascadepTMin, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascPtMax, femtoUniverseCascadeSelection::kCascadepTMax, femtoUniverseSelection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascEtaMax, femtoUniverseCascadeSelection::kCascadeetaMax, femtoUniverseSelection::kAbsUpperLimit); // v0 child cuts - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascV0DCADaughMax, femtoUniverseCascadeSelection::kCascadeV0DCADaughMax, femtoUniverseSelection::kUpperLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascV0CPAMin, femtoUniverseCascadeSelection::kCascadeV0CPAMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascV0TranRadMin, femtoUniverseCascadeSelection::kCascadeV0TranRadMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascV0TranRadMax, femtoUniverseCascadeSelection::kCascadeV0TranRadMax, femtoUniverseSelection::kUpperLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascV0DecVtxMax, femtoUniverseCascadeSelection::kCascadeV0DecVtxMax, femtoUniverseSelection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0DCADaughMax, femtoUniverseCascadeSelection::kCascadeV0DCADaughMax, femtoUniverseSelection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0CPAMin, femtoUniverseCascadeSelection::kCascadeV0CPAMin, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0TranRadMin, femtoUniverseCascadeSelection::kCascadeV0TranRadMin, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0TranRadMax, femtoUniverseCascadeSelection::kCascadeV0TranRadMax, femtoUniverseSelection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0DecVtxMax, femtoUniverseCascadeSelection::kCascadeV0DecVtxMax, femtoUniverseSelection::kUpperLimit); // cascade cuts - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascDCADaughMax, femtoUniverseCascadeSelection::kCascadeDCADaughMax, femtoUniverseSelection::kUpperLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascCPAMin, femtoUniverseCascadeSelection::kCascadeCPAMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascTranRadMin, femtoUniverseCascadeSelection::kCascadeTranRadMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascTranRadMax, femtoUniverseCascadeSelection::kCascadeTranRadMax, femtoUniverseSelection::kUpperLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascDecVtxMax, femtoUniverseCascadeSelection::kCascadeDecVtxMax, femtoUniverseSelection::kUpperLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascDCAPosToPV, femtoUniverseCascadeSelection::kCascadeDCAPosToPV, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascDCANegToPV, femtoUniverseCascadeSelection::kCascadeDCANegToPV, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascDCABachToPV, femtoUniverseCascadeSelection::kCascadeDCABachToPV, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascDCAV0ToPV, femtoUniverseCascadeSelection::kCascadeDCAV0ToPV, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascV0MassLowLimit, femtoUniverseCascadeSelection::kCascadeV0MassMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.ConfCascV0MassUpLimit, femtoUniverseCascadeSelection::kCascadeV0MassMax, femtoUniverseSelection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascDCADaughMax, femtoUniverseCascadeSelection::kCascadeDCADaughMax, femtoUniverseSelection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascCPAMin, femtoUniverseCascadeSelection::kCascadeCPAMin, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascTranRadMin, femtoUniverseCascadeSelection::kCascadeTranRadMin, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascTranRadMax, femtoUniverseCascadeSelection::kCascadeTranRadMax, femtoUniverseSelection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascDecVtxMax, femtoUniverseCascadeSelection::kCascadeDecVtxMax, femtoUniverseSelection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascDCAPosToPV, femtoUniverseCascadeSelection::kCascadeDCAPosToPV, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascDCANegToPV, femtoUniverseCascadeSelection::kCascadeDCANegToPV, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascDCABachToPV, femtoUniverseCascadeSelection::kCascadeDCABachToPV, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascDCAV0ToPV, femtoUniverseCascadeSelection::kCascadeDCAV0ToPV, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0MassLowLimit, femtoUniverseCascadeSelection::kCascadeV0MassMin, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0MassUpLimit, femtoUniverseCascadeSelection::kCascadeV0MassMax, femtoUniverseSelection::kUpperLimit); // children cuts - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kPosTrack, ConfCascadeSelection.ConfCascChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kPosTrack, ConfCascadeSelection.ConfCascChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kPosTrack, ConfCascadeSelection.ConfCascChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kPosTrack, ConfCascadeSelection.ConfCascChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kNegTrack, ConfCascadeSelection.ConfCascChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kNegTrack, ConfCascadeSelection.ConfCascChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kNegTrack, ConfCascadeSelection.ConfCascChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kNegTrack, ConfCascadeSelection.ConfCascChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.ConfCascChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.ConfCascChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.ConfCascChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.ConfCascChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kPosTrack, ConfCascadeSelection.confCascChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); + cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kPosTrack, ConfCascadeSelection.confCascChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kPosTrack, ConfCascadeSelection.confCascChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kPosTrack, ConfCascadeSelection.confCascChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kNegTrack, ConfCascadeSelection.confCascChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); + cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kNegTrack, ConfCascadeSelection.confCascChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kNegTrack, ConfCascadeSelection.confCascChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kNegTrack, ConfCascadeSelection.confCascChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.confCascChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); + cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.confCascChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.confCascChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); + cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.confCascChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); // TODO - cascadeCuts.setChildPIDSpecies(femtoUniverseCascadeSelection::kPosTrack, ConfV0Selection.ConfChildPIDspecies); - cascadeCuts.setChildPIDSpecies(femtoUniverseCascadeSelection::kNegTrack, ConfV0Selection.ConfChildPIDspecies); - cascadeCuts.setChildPIDSpecies(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.ConfCascChildPIDspecies); + cascadeCuts.setChildPIDSpecies(femtoUniverseCascadeSelection::kPosTrack, ConfV0Selection.confChildPIDspecies); + cascadeCuts.setChildPIDSpecies(femtoUniverseCascadeSelection::kNegTrack, ConfV0Selection.confChildPIDspecies); + cascadeCuts.setChildPIDSpecies(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.confCascChildPIDspecies); // check if works correctly for bachelor track - cascadeCuts.init(&cascadeQaRegistry, ConfIsSelectCascOmega); + cascadeCuts.init(&cascadeQaRegistry, confIsSelectCascOmega); // invmass cuts - cascadeCuts.setInvMassLimits(ConfCascadeSelection.ConfCascInvMassLowLimit, ConfCascadeSelection.ConfCascInvMassUpLimit); + cascadeCuts.setInvMassLimits(ConfCascadeSelection.confCascInvMassLowLimit, ConfCascadeSelection.confCascInvMassUpLimit); - if (ConfCascadeSelection.ConfCascRejectCompetingMass) { - cascadeCuts.setCompetingInvMassLimits(ConfCascadeSelection.ConfCascInvCompetingMassLowLimit, ConfCascadeSelection.ConfCascInvCompetingMassUpLimit); + if (ConfCascadeSelection.confCascRejectCompetingMass) { + cascadeCuts.setCompetingInvMassLimits(ConfCascadeSelection.confCascInvCompetingMassLowLimit, ConfCascadeSelection.confCascInvCompetingMassUpLimit); } } - if (ConfIsActivatePhi) { + if (confIsActivatePhi) { // initializing for Phi meson phiCuts.init(&qaRegistry); } @@ -608,7 +611,7 @@ struct femtoUniverseProducerTask { auto timestamp = bc.timestamp(); float output = -999; - if (ConfIsRun3 && !ConfIsForceGRP) { + if (confIsRun3 && !confIsForceGRP) { static o2::parameters::GRPMagField* grpo = nullptr; grpo = ccdb->getForTimeStamp("GLO/Config/GRPMagField", timestamp); if (grpo == nullptr) { @@ -616,12 +619,11 @@ struct femtoUniverseProducerTask { return; } LOGF(info, "Retrieved GRP for timestamp %llu with L3 ", timestamp, grpo->getL3Current()); - // taken from GRP onject definition of getNominalL3Field; update later to something smarter (mNominalL3Field = std::lround(5.f * mL3Current / 30000.f);) - auto NominalL3Field = std::lround(5.f * grpo->getL3Current() / 30000.f); - output = 0.1 * (NominalL3Field); + // taken from GRP onject definition of getnominalL3Field; update later to something smarter (mnominalL3Field = std::lround(5.f * mL3Current / 30000.f);) + auto nominalL3Field = std::lround(5.f * grpo->getL3Current() / 30000.f); + output = 0.1 * (nominalL3Field); } else { - static o2::parameters::GRPObject* grpo = nullptr; grpo = ccdb->getForTimeStamp("GLO/GRP/GRP", timestamp); if (grpo == nullptr) { @@ -686,7 +688,7 @@ struct femtoUniverseProducerTask { int particleOrigin = 99; auto motherparticlesMC = particleMC.template mothers_as(); - if (std::abs(pdgCode) == std::abs(ConfPDGCodePartOne.value) || std::abs(pdgCode) == std::abs(ConfPDGCodePartTwo.value)) { + if (std::abs(pdgCode) == std::abs(confPDGCodePartOne.value) || std::abs(pdgCode) == std::abs(confPDGCodePartTwo.value)) { if (particleMC.isPhysicalPrimary()) { particleOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kPrimary; } else if (!motherparticlesMC.empty()) { @@ -768,7 +770,7 @@ struct femtoUniverseProducerTask { const auto vtxZ = col.posZ(); float mult = 0; int multNtr = 0; - if (ConfIsRun3) { + if (confIsRun3) { mult = col.multFV0M(); multNtr = col.multNTracksPV(); } else { @@ -776,7 +778,7 @@ struct femtoUniverseProducerTask { /// FemtoUniverseRun2 is defined V0M/2 multNtr = col.multTracklets(); } - if (ConfEvtUseTPCmult) { + if (confEvtUseTPCmult) { multNtr = col.multTPC(); } @@ -788,14 +790,14 @@ struct femtoUniverseProducerTask { if (!colCuts.isSelected(col)) { return false; } else { - if (!ConfIsUsePileUp) { - if (ConfDoSpher) { + if (!confIsUsePileUp) { + if (confDoSpher) { outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); } else { outputCollision(vtxZ, mult, multNtr, 2, mMagField); } } else { - if (ConfDoSpher && (!ConfEvNoSameBunchPileup || col.selection_bit(aod::evsel::kNoSameBunchPileup)) && (!ConfEvIsGoodZvtxFT0vsPV || col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) && (!ConfEvIsVertexITSTPC || col.selection_bit(aod::evsel::kIsVertexITSTPC))) { + if (confDoSpher && (!confEvNoSameBunchPileup || col.selection_bit(aod::evsel::kNoSameBunchPileup)) && (!confEvIsGoodZvtxFT0vsPV || col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) && (!confEvIsVertexITSTPC || col.selection_bit(aod::evsel::kIsVertexITSTPC))) { outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); } else { outputCollision(vtxZ, mult, multNtr, 2, mMagField); @@ -814,11 +816,11 @@ struct femtoUniverseProducerTask { float mult = 0; int multNtr = 0; - if (std::abs(vtxZ) > ConfEvtZvtx) { + if (std::abs(vtxZ) > confEvtZvtx) { continue; } - if (ConfDoSpher) { + if (confDoSpher) { outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); } else { outputCollision(vtxZ, mult, multNtr, 2, mMagField); @@ -859,7 +861,8 @@ struct femtoUniverseProducerTask { // in case of skimming run - don't store such collisions // in case of trigger run - store such collisions but don't store any // particle candidates for such collisions - if (!colCuts.isSelectedRun3(col) || (occupancy < ConfTPCOccupancyMin || occupancy > ConfTPCOccupancyMax)) { + + if (!colCuts.isSelectedRun3(col) || (occupancy < confTPCOccupancyMin || occupancy > confTPCOccupancyMax)) { return false; } else { if ((col.selection_bit(aod::evsel::kNoSameBunchPileup)) && (col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) { @@ -891,7 +894,7 @@ struct femtoUniverseProducerTask { continue; } - if (track.pt() > ConfTOFpTmin) { + if (track.pt() > confTOFpTmin) { if (!track.hasTOF()) { continue; } @@ -903,14 +906,15 @@ struct femtoUniverseProducerTask { auto cutContainer = trackCuts.getCutContainer(track); // now the table is filled - if (!ConfIsActivateCascade) { + if (!confIsActivateCascade) { outputParts(outputCollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::femtouniverseparticle::ParticleType::kTrack, cutContainer.at( femtoUniverseTrackSelection::TrackContainerPosition::kCuts), cutContainer.at( femtoUniverseTrackSelection::TrackContainerPosition::kPID), - track.dcaXY(), childIDs, 0, 0); + track.dcaXY(), childIDs, 0, + track.sign()); // sign getter is mAntiLambda() } else { outputCascParts(outputCollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::femtouniverseparticle::ParticleType::kTrack, @@ -921,7 +925,7 @@ struct femtoUniverseProducerTask { track.dcaXY(), childIDs, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } tmpIDtrack.push_back(track.globalIndex()); - if (ConfIsDebug) { + if (confIsDebug) { fillDebugParticle(track); } @@ -1011,7 +1015,7 @@ struct femtoUniverseProducerTask { indexChildID, v0.mLambda(), v0.mAntiLambda()); - if (ConfIsDebug) { + if (confIsDebug) { fillDebugParticle(postrack); // QA for positive daughter fillDebugParticle(negtrack); // QA for negative daughter fillDebugParticle(v0); // QA for v0 @@ -1142,8 +1146,8 @@ struct femtoUniverseProducerTask { 0, 0, indexCascChildID, - ConfIsSelectCascOmega ? casc.mOmega() : casc.mXi(), - ConfIsSelectCascOmega ? casc.mOmega() : casc.mXi(), + confIsSelectCascOmega ? casc.mOmega() : casc.mXi(), + confIsSelectCascOmega ? casc.mOmega() : casc.mXi(), casc.dcaV0daughters(), casc.v0cosPA(col.posX(), col.posY(), col.posZ()), casc.v0radius(), @@ -1154,7 +1158,7 @@ struct femtoUniverseProducerTask { casc.dcanegtopv(), casc.dcabachtopv(), casc.dcav0topv(col.posX(), col.posY(), col.posZ())); - if (ConfIsDebug) { + if (confIsDebug) { fillDebugParticle(posTrackCasc); // QA for positive daughter fillDebugParticle(negTrackCasc); // QA for negative daughter fillDebugParticle(bachTrackCasc); // QA for negative daughter @@ -1179,11 +1183,11 @@ struct femtoUniverseProducerTask { continue; } - if (ConfD0Selection.ConfD0D0barCandMaxY >= 0. && std::abs(hfHelper.yD0(hfCand)) > ConfD0Selection.ConfD0D0barCandMaxY) { + if (ConfD0Selection.confD0D0barCandMaxY >= 0. && std::abs(hfHelper.yD0(hfCand)) > ConfD0Selection.confD0D0barCandMaxY) { continue; } - if (std::abs(hfCand.eta()) > ConfD0Selection.ConfD0D0barCandEtaCut) { + if (std::abs(hfCand.eta()) > ConfD0Selection.confD0D0barCandEtaCut) { continue; } @@ -1269,7 +1273,7 @@ struct femtoUniverseProducerTask { invMassD0, // D0 mass (mLambda) invMassD0bar); // D0bar mass (mAntiLambda) - if (ConfIsDebug) { + if (confIsDebug) { fillDebugParticle(postrack); // QA for positive daughter fillDebugParticle(negtrack); // QA for negative daughter fillDebugParticle(hfCand); // QA for D0/D0bar @@ -1292,33 +1296,33 @@ struct femtoUniverseProducerTask { continue; } // implementing PID cuts for phi children - if (ConfPhiSelection.ConfLooseTPCNSigma.value) { - if (!(IsKaonNSigmaTPCLoose(p1.pt(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon)))) { + if (ConfPhiSelection.confLooseTPCNSigma.value) { + if (!(isKaonNSigmaTPCLoose(p1.pt(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon)))) { continue; } - if (!(IsKaonNSigmaTPCLoose(p2.pt(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon)))) { + if (!(isKaonNSigmaTPCLoose(p2.pt(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon)))) { continue; } } - if (ConfPhiSelection.ConfLooseTOFNSigma.value) { - if (!(IsKaonNSigmaTOFLoose(p1.pt(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon)))) { + if (ConfPhiSelection.confLooseTOFNSigma.value) { + if (!(isKaonNSigmaTOFLoose(p1.pt(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon)))) { continue; } - if (!(IsKaonNSigmaTOFLoose(p2.pt(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon)))) { + if (!(isKaonNSigmaTOFLoose(p2.pt(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon)))) { continue; } } else { - if (!(IsKaonNSigma(p1.pt(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon)))) { + if (!(isKaonNSigma(p1.pt(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon)))) { continue; } - if (!(IsKaonNSigma(p2.pt(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon)))) { + if (!(isKaonNSigma(p2.pt(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon)))) { continue; } } - if (IsKaonRejected(p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion))) { + if (isKaonRejected(p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion))) { continue; } - if (IsKaonRejected(p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion))) { + if (isKaonRejected(p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion))) { continue; } @@ -1344,20 +1348,14 @@ struct femtoUniverseProducerTask { } float phiPt = sumVec.Pt(); - if ((phiPt < ConfPhiSelection.ConfPtLowLimitPhi.value) || (phiPt > ConfPhiSelection.ConfPtHighLimitPhi.value)) { + if ((phiPt < ConfPhiSelection.confPtLowLimitPhi.value) || (phiPt > ConfPhiSelection.confPtHighLimitPhi.value)) { continue; } - /*float phiPhi = sumVec.Phi(); - if (sumVec.Phi() < 0) { - phiPhi = sumVec.Phi() + o2::constants::math::TwoPI; - } else if (sumVec.Phi() >= 0) { - phiPhi = sumVec.Phi(); - }*/ float phiPhi = RecoDecay::constrainAngle(sumVec.Phi(), 0); float phiM = sumVec.M(); - if (((phiM < ConfPhiSelection.ConfInvMassLowLimitPhi.value) || (phiM > ConfPhiSelection.ConfInvMassUpLimitPhi.value))) { + if (((phiM < ConfPhiSelection.confInvMassLowLimitPhi.value) || (phiM > ConfPhiSelection.confInvMassUpLimitPhi.value))) { continue; } @@ -1372,12 +1370,12 @@ struct femtoUniverseProducerTask { outputParts(outputCollision.lastIndex(), p1.pt(), p1.eta(), p1.phi(), aod::femtouniverseparticle::ParticleType::kPhiChild, - -999, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kPosCuts), - -999, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kPosPID), - p1.dcaXY(), + -999, // cutContainer + -999, // cutContainer + p1.dcaXY(), // tempFitVar childIDs, 0, - 1); // sign, workaround for now + p1.sign()); const int rowOfPosTrack = outputParts.lastIndex(); if constexpr (isMC) { fillMCParticle(p1, o2::aod::femtouniverseparticle::ParticleType::kPhiChild); @@ -1392,12 +1390,12 @@ struct femtoUniverseProducerTask { p2.eta(), p2.phi(), aod::femtouniverseparticle::ParticleType::kPhiChild, - -999, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kNegCuts), - -999, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kNegPID), - p2.dcaXY(), + -999, // cutContainer + -999, // cutContainer + p2.dcaXY(), // tempFitVar childIDs, 0, - -1); // sign, workaround for now + p2.sign()); // sign, workaround for now const int rowOfNegTrack = outputParts.lastIndex(); if constexpr (isMC) { fillMCParticle(p2, o2::aod::femtouniverseparticle::ParticleType::kPhiChild); @@ -1409,14 +1407,14 @@ struct femtoUniverseProducerTask { phiEta, phiPhi, aod::femtouniverseparticle::ParticleType::kPhi, - -999, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kV0), + -999, // cutContainer 0, - phiM, // v0.v0cosPA(), + phiM, // tempFitVar indexChildID, - phiM, // phi.mLambda(), //for now it will have a mLambda getter, maybe we will change it in the future so it's more logical - -999); // v0.mAntiLambda() + phiM, // phi.mLambda(), //for now it will have a mLambda getter, maybe we will change it in the future so it's more logical + 0); // phi.mAntiLambda() <- sign - if (ConfIsDebug) { + if (confIsDebug) { fillDebugParticle(p1); // QA for positive daughter fillDebugParticle(p2); // QA for negative daughter fillDebugParticle(p1); // QA for phi @@ -1437,22 +1435,22 @@ struct femtoUniverseProducerTask { /// if the most open selection criteria are not fulfilled there is no /// point looking further at the track - if (particle.eta() < -ConfFilterCuts.ConfEtaFilterCut || particle.eta() > ConfFilterCuts.ConfEtaFilterCut) + if (particle.eta() < -ConfFilterCuts.confEtaFilterCut || particle.eta() > ConfFilterCuts.confEtaFilterCut) continue; - if (particle.pt() < ConfFilterCuts.ConfPtLowFilterCut || particle.pt() > ConfFilterCuts.ConfPtHighFilterCut) + if (particle.pt() < ConfFilterCuts.confPtLowFilterCut || particle.pt() > ConfFilterCuts.confPtHighFilterCut) continue; uint32_t pdgCode = static_cast(particle.pdgCode()); - if (ConfMCTruthAnalysisWithPID) { + if (confMCTruthAnalysisWithPID) { bool pass = false; - std::vector tmpPDGCodes = ConfMCTruthPDGCodes; // necessary due to some features of the Configurable - for (uint32_t pdg : tmpPDGCodes) { + std::vector tmpPDGCodes = confMCTruthPDGCodes; // necessary due to some features of the Configurable + for (auto const& pdg : tmpPDGCodes) { if (static_cast(pdg) == static_cast(pdgCode)) { if (pdgCode == 333) { // && (recoMcIds && recoMcIds->get().contains(particle.globalIndex()))) { // ATTENTION: all Phi mesons are NOT primary particles pass = true; } else { - if (particle.isPhysicalPrimary() || (ConfActivateSecondaries && recoMcIds && recoMcIds->get().contains(particle.globalIndex()))) + if (particle.isPhysicalPrimary() || (confActivateSecondaries && recoMcIds && recoMcIds->get().contains(particle.globalIndex()))) pass = true; } } @@ -1488,7 +1486,7 @@ struct femtoUniverseProducerTask { childIDs, 0, 0); - if (ConfIsDebug) { + if (confIsDebug) { fillDebugParticle(particle); } @@ -1523,7 +1521,7 @@ struct femtoUniverseProducerTask { childIDs, 0, 0); - if (ConfIsDebug) { + if (confIsDebug) { fillDebugParticle(particle); } @@ -1543,14 +1541,14 @@ struct femtoUniverseProducerTask { const auto colcheck = fillCollisions(col, tracks); if (colcheck) { fillTracks(tracks); - if (ConfIsActivateV0) { + if (confIsActivateV0) { fillV0(col, fullV0s, tracks); } - if (ConfIsActivatePhi) { + if (confIsActivatePhi) { fillPhi(col, tracks); } } - // if (ConfIsActivateCascade) { + // if (confIsActivateCascade) { // fillCascade(col, fullCascades, tracks); // } } @@ -1565,7 +1563,7 @@ struct femtoUniverseProducerTask { // fill the tables fillCollisionsAndTracksAndV0AndPhi(col, tracks, fullV0s); } - PROCESS_SWITCH(femtoUniverseProducerTask, processFullData, "Provide experimental data", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processFullData, "Provide experimental data", false); void processTrackV0(aod::FemtoFullCollision const& col, aod::BCsWithTimestamps const&, @@ -1577,7 +1575,7 @@ struct femtoUniverseProducerTask { // fill the tables fillCollisionsAndTracksAndV0AndPhi(col, tracks, fullV0s); } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackV0, "Provide experimental data for track v0", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackV0, "Provide experimental data for track v0", false); void processTrackCascadeData(aod::FemtoFullCollision const& col, aod::BCsWithTimestamps const&, @@ -1593,7 +1591,7 @@ struct femtoUniverseProducerTask { fillCascade(col, fullCascades, tracks); } } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackCascadeData, "Provide experimental data for track cascades", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackCascadeData, "Provide experimental data for track cascades", false); /*void processTrackV0CentRun3(aod::FemtoFullCollisionCentRun3 const& col, aod::BCsWithTimestamps const&, @@ -1607,7 +1605,7 @@ struct femtoUniverseProducerTask { fillTracks(tracks); fillV0(col, fullV0s, tracks); } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackV0CentRun3, "Provide experimental data for track v0", false);*/ + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackV0CentRun3, "Provide experimental data for track v0", false);*/ void processFullMC(aod::FemtoFullCollisionMC const& col, aod::BCsWithTimestamps const&, @@ -1621,7 +1619,7 @@ struct femtoUniverseProducerTask { // fill the tables fillCollisionsAndTracksAndV0AndPhi(col, tracks, fullV0s); } - PROCESS_SWITCH(femtoUniverseProducerTask, processFullMC, "Provide MC data (tracks, V0, Phi)", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processFullMC, "Provide MC data (tracks, V0, Phi)", false); void processTrackMC(aod::FemtoFullCollisionMC const& col, aod::BCsWithTimestamps const&, @@ -1637,7 +1635,7 @@ struct femtoUniverseProducerTask { fillTracks(tracks); } } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackMC, "Provide MC data for track analysis", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackMC, "Provide MC data for track analysis", false); void processTrackPhiMC(aod::FemtoFullCollisionMC const& col, aod::BCsWithTimestamps const&, @@ -1654,7 +1652,7 @@ struct femtoUniverseProducerTask { fillPhi(col, tracks); } } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackPhiMC, "Provide MC data for track Phi analysis", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackPhiMC, "Provide MC data for track Phi analysis", false); void processTrackD0MC(aod::FemtoFullCollisionMC const& col, aod::BCsWithTimestamps const&, @@ -1671,7 +1669,7 @@ struct femtoUniverseProducerTask { // fillD0mesons(col, tracks, candidates); } } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackD0MC, "Provide MC data for track D0 analysis", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackD0MC, "Provide MC data for track D0 analysis", false); void processTrackData(aod::FemtoFullCollision const& col, aod::BCsWithTimestamps const&, @@ -1683,13 +1681,13 @@ struct femtoUniverseProducerTask { // fill the tables const auto colcheck = fillCollisions(col, tracks); if (colcheck) { - if (ConfFillCollExt) { + if (confFillCollExt) { fillCollisionsCentRun3ColExtra(col, ir); } fillTracks(tracks); } } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackData, + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackData, "Provide experimental data for track track", true); // using FilteredFemtoFullTracks = soa::Filtered; @@ -1706,7 +1704,7 @@ struct femtoUniverseProducerTask { fillPhi(col, tracks); } } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackPhiData, + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackPhiData, "Provide experimental data for track phi", false); void processTrackD0mesonData(aod::FemtoFullCollision const& col, @@ -1723,7 +1721,7 @@ struct femtoUniverseProducerTask { fillD0mesons(col, tracks, candidates); } } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackD0mesonData, + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackD0mesonData, "Provide experimental data for track D0 meson", false); void processTrackMCTruth(aod::McCollision const&, @@ -1736,7 +1734,7 @@ struct femtoUniverseProducerTask { fillMCTruthCollisions(collisions, mcParticles); fillParticles(mcParticles); } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackMCTruth, "Provide MC data for MC truth track analysis", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackMCTruth, "Provide MC data for MC truth track analysis", false); void processTrackMCGen(aod::McCollision const& col, aod::McParticles const& mcParticles) @@ -1744,7 +1742,7 @@ struct femtoUniverseProducerTask { outputCollision(col.posZ(), 0, 0, 2, 0); fillParticles(mcParticles); } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackMCGen, "Provide MC Generated for model comparisons", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackMCGen, "Provide MC Generated for model comparisons", false); Preslice perMCCollision = aod::mcparticle::mcCollisionId; PresliceUnsorted> recoCollsPerMCColl = aod::mcparticle::mcCollisionId; @@ -1779,7 +1777,7 @@ struct femtoUniverseProducerTask { fillParticles(groupedMCParticles, recoMcIds); // fills mc particles } } - PROCESS_SWITCH(femtoUniverseProducerTask, processTruthAndFullMC, "Provide both MC truth and reco for tracks and V0s", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processTruthAndFullMC, "Provide both MC truth and reco for tracks and V0s", false); void processFullMCCent(aod::FemtoFullCollisionCentRun3 const& col, aod::BCsWithTimestamps const&, @@ -1799,7 +1797,7 @@ struct femtoUniverseProducerTask { fillTracks(tracks); } } - PROCESS_SWITCH(femtoUniverseProducerTask, processFullMCCent, "Provide MC data with centrality bins", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processFullMCCent, "Provide MC data with centrality bins", false); void processTrackCentRun2Data(aod::FemtoFullCollisionCentRun2 const& col, aod::BCsWithTimestamps const&, @@ -1817,7 +1815,7 @@ struct femtoUniverseProducerTask { fillTracks(tracks); } } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackCentRun2Data, "Provide experimental data for Run 2 with centrality for track track", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackCentRun2Data, "Provide experimental data for Run 2 with centrality for track track", false); void processTrackCentRun3Data(aod::FemtoFullCollisionCentRun3 const& col, aod::BCsWithTimestamps const&, @@ -1835,7 +1833,7 @@ struct femtoUniverseProducerTask { fillTracks(tracks); } } - PROCESS_SWITCH(femtoUniverseProducerTask, processTrackCentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processTrackCentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); void processV0CentRun3Data(aod::FemtoFullCollisionCentRun3 const& col, aod::BCsWithTimestamps const&, @@ -1855,7 +1853,7 @@ struct femtoUniverseProducerTask { fillV0(col, fullV0s, tracks); } } - PROCESS_SWITCH(femtoUniverseProducerTask, processV0CentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processV0CentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); void processCascadeCentRun3Data(aod::FemtoFullCollisionCentRun3 const& col, aod::BCsWithTimestamps const&, @@ -1875,11 +1873,11 @@ struct femtoUniverseProducerTask { fillCascade(col, fullCascades, tracks); } } - PROCESS_SWITCH(femtoUniverseProducerTask, processCascadeCentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); + PROCESS_SWITCH(FemtoUniverseProducerTask, processCascadeCentRun3Data, "Provide experimental data for Run 3 with centrality for track track", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; return workflow; } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index 15aea7eee19..c9044e71374 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -10,7 +10,7 @@ // or submit itself to any jurisdiction. /// \file femtoUniversePairTaskTrackPhi.cxx -/// \brief Tasks that reads the track tables used for the pairing and builds pairs of two tracks +/// \brief Tasks that reads the track tables used for the pairing and builds pairs for h-Phi angular correlation analysis /// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de /// \author Georgios Mantzaridis, TU München, georgios.mantzaridis@tum.de /// \author Anton Riedel, TU München, anton.riedel@tum.de @@ -25,7 +25,6 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/StepTHn.h" #include "Framework/O2DatabasePDGPlugin.h" -#include "TDatabasePDG.h" #include "ReconstructionDataFormats/PID.h" #include "Common/DataModel/PIDResponse.h" @@ -49,16 +48,16 @@ using namespace o2::soa; namespace { -static constexpr int nPart = 2; -static constexpr int nCuts = 5; +static constexpr int NPart = 2; +static constexpr int NCuts = 5; static const std::vector partNames{"PhiCandidate", "Track"}; static const std::vector cutNames{"MaxPt", "PIDthr", "nSigmaTPC", "nSigmaTPCTOF", "MaxP"}; -static const float cutsTable[nPart][nCuts]{ +static const float cutsTable[NPart][NCuts]{ {4.05f, 1.f, 3.f, 3.f, 100.f}, {4.05f, 1.f, 3.f, 3.f, 100.f}}; } // namespace -struct femtoUniversePairTaskTrackPhi { +struct FemtoUniversePairTaskTrackPhi { Service pdgMC; @@ -71,64 +70,58 @@ struct femtoUniversePairTaskTrackPhi { // Efficiency struct : o2::framework::ConfigurableGroup { - Configurable ConfEfficiencyTrackPath{"ConfEfficiencyTrackPath", "", "Local path to proton efficiency TH2F file"}; - Configurable ConfEfficiencyPhiPath{"ConfEfficiencyPhiPath", "", "Local path to Phi efficiency TH2F file"}; - Configurable ConfEfficiencyTrackTimestamp{"ConfEfficiencyTrackTimestamp", 0, "(int64_t) Timestamp for hadron"}; - Configurable ConfEfficiencyPhiTimestamp{"ConfEfficiencyPhiTimestamp", 0, "(int64_t) Timestamp for phi"}; + Configurable confEfficiencyTrackPath{"confEfficiencyTrackPath", "", "Local path to proton efficiency TH2F file"}; + Configurable confEfficiencyPhiPath{"confEfficiencyPhiPath", "", "Local path to Phi efficiency TH2F file"}; + Configurable confEfficiencyTrackTimestamp{"confEfficiencyTrackTimestamp", 0, "(int64_t) Timestamp for hadron"}; + Configurable confEfficiencyPhiTimestamp{"confEfficiencyPhiTimestamp", 0, "(int64_t) Timestamp for phi"}; } ConfEff; struct : o2::framework::ConfigurableGroup { - Configurable ConfCPRIsEnabled{"ConfCPRIsEnabled", true, "Close Pair Rejection"}; - Configurable ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"}; - Configurable ConfCPRdeltaPhiCutMax{"ConfCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaPhiCutMin{"ConfCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaEtaCutMax{"ConfCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaEtaCutMin{"ConfCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; - Configurable ConfCPRInvMassCutMin{"ConfCPRInvMassCutMin", 1.014, "Invariant mass (low) cut for Close Pair Rejection"}; - Configurable ConfCPRInvMassCutMax{"ConfCPRInvMassCutMax", 1.026, "Invariant mass (high) cut for Close Pair Rejection"}; - Configurable ConfCPRChosenRadii{"ConfCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; + Configurable confCPRIsEnabled{"confCPRIsEnabled", false, "Close Pair Rejection"}; + Configurable confCPRPlotPerRadii{"confCPRPlotPerRadii", false, "Plot CPR per radii"}; + Configurable confCPRdeltaPhiCutMax{"confCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; + Configurable confCPRdeltaPhiCutMin{"confCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; + Configurable confCPRdeltaEtaCutMax{"confCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; + Configurable confCPRdeltaEtaCutMin{"confCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; + Configurable confCPRInvMassCutMin{"confCPRInvMassCutMin", 1.014, "Invariant mass (low) cut for Close Pair Rejection"}; + Configurable confCPRInvMassCutMax{"confCPRInvMassCutMax", 1.026, "Invariant mass (high) cut for Close Pair Rejection"}; + Configurable confCPRChosenRadii{"confCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; } ConfCPR; /// Table for both particles struct : o2::framework::ConfigurableGroup { - Configurable ConfPIDProtonNsigmaCombined{"ConfPIDProtonNsigmaCombined", 3.0, "TPC and TOF Proton Sigma (combined) for momentum > 0.5"}; - Configurable ConfPIDProtonNsigmaTPC{"ConfPIDProtonNsigmaTPC", 3.0, "TPC Proton Sigma for momentum < 0.5"}; - Configurable ConfPIDKaonNsigmaReject{"ConfPIDKaonNsigmaReject", 3.0, "Reject if particle could be a Kaon combined nsigma value."}; - Configurable ConfPIDPionNsigmaReject{"ConfPIDPionNsigmaReject", 3.0, "Reject if particle could be a Pion combined nsigma value."}; - Configurable ConfPIDProtonNsigmaReject{"ConfPIDProtonNsigmaReject", 3.0, "Reject if particle could be a Proton combined nsigma value."}; - Configurable ConfPIDPionNsigmaCombined{"ConfPIDPionNsigmaCombined", 3.0, "TPC and TOF Pion Sigma (combined) for momentum > 0.5"}; - Configurable ConfPIDPionNsigmaTPC{"ConfPIDPionNsigmaTPC", 3.0, "TPC Pion Sigma for momentum < 0.5"}; - - Configurable> ConfCutTable{"ConfCutTable", {cutsTable[0], nPart, nCuts, partNames, cutNames}, "Particle selections"}; - Configurable ConfNspecies{"ConfNspecies", 2, "Number of particle spieces with PID info"}; - Configurable ConfIsMC{"ConfIsMC", false, "Enable additional Histograms in the case of a MonteCarlo Run"}; - Configurable> ConfTrkPIDnSigmaMax{"ConfTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; - Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; - Configurable ConfBinsPhi{"ConfBinsPhi", 29, "Number of phi bins in deta dphi"}; - Configurable ConfBinsEta{"ConfBinsEta", 29, "Number of eta bins in deta dphi"}; + Configurable confPIDProtonNsigmaCombined{"confPIDProtonNsigmaCombined", 3.0, "TPC and TOF Proton Sigma (combined) for momentum > 0.5"}; + Configurable confPIDProtonNsigmaTPC{"confPIDProtonNsigmaTPC", 3.0, "TPC Proton Sigma for momentum < 0.5"}; + Configurable confPIDKaonNsigmaReject{"confPIDKaonNsigmaReject", 3.0, "Reject if particle could be a Kaon combined nsigma value."}; + Configurable confPIDPionNsigmaReject{"confPIDPionNsigmaReject", 3.0, "Reject if particle could be a Pion combined nsigma value."}; + Configurable confPIDProtonNsigmaReject{"confPIDProtonNsigmaReject", 3.0, "Reject if particle could be a Proton combined nsigma value."}; + Configurable confPIDPionNsigmaCombined{"confPIDPionNsigmaCombined", 3.0, "TPC and TOF Pion Sigma (combined) for momentum > 0.5"}; + Configurable confPIDPionNsigmaTPC{"confPIDPionNsigmaTPC", 3.0, "TPC Pion Sigma for momentum < 0.5"}; + + // Configurable> confCutTable{"confCutTable", {cutsTable[0], NPart, NCuts, partNames, cutNames}, "Particle selections"}; //unused + // Configurable confNspecies{"confNspecies", 2, "Number of particle spieces with PID info"}; //unused + Configurable confIsMC{"confIsMC", false, "Enable additional Histograms in the case of a MonteCarlo Run"}; + Configurable> confTrkPIDnSigmaMax{"confTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; + Configurable confUse3D{"confUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; + Configurable confBinsPhi{"confBinsPhi", 29, "Number of phi bins in deta dphi"}; + Configurable confBinsEta{"confBinsEta", 29, "Number of eta bins in deta dphi"}; } ConfBothTracks; /// Particle 1 --- IDENTIFIED TRACK struct : o2::framework::ConfigurableGroup { - Configurable ConfTrackIsSame{"ConfTrackIsSame", false, "Pairs of the same particle"}; - Configurable ConfTrackPDGCode{"ConfTrackPDGCode", 2212, "Particle 2 - PDG code"}; - Configurable ConfTrackPID{"ConfTrackPID", 2, "Particle 2 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> - Configurable ConfTrackSign{"ConfTrackSign", 1, "Track sign"}; - Configurable ConfTrackIsIdentified{"ConfTrackIsIdentified", true, "Enable PID for the track"}; - Configurable ConfTrackIsRejected{"ConfTrackIsRejected", true, "Enable PID rejection for the track other species than the identified one."}; - Configurable ConfTrackPtLowLimit{"ConfTrackPtLowLimit", 0.5, "Lower limit of the Phi pT."}; - Configurable ConfTrackPtHighLimit{"ConfTrackPtHighLimit", 2.5, "Higher limit of the Phi pT."}; + Configurable confTrackIsSame{"confTrackIsSame", false, "Pairs of the same particle"}; + Configurable confTrackPDGCode{"confTrackPDGCode", 2212, "Particle 2 - PDG code"}; + Configurable confTrackPID{"confTrackPID", 2, "Particle 2 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> + Configurable confTrackSign{"confTrackSign", 1, "Track sign"}; + Configurable confTrackIsIdentified{"confTrackIsIdentified", true, "Enable PID for the track"}; + Configurable confTrackIsRejected{"confTrackIsRejected", true, "Enable PID rejection for the track other species than the identified one."}; + Configurable confTrackPtLowLimit{"confTrackPtLowLimit", 0.5, "Lower limit of the Phi pT."}; + Configurable confTrackPtHighLimit{"confTrackPtHighLimit", 2.5, "Higher limit of the Phi pT."}; } ConfTrack; - /// Particle 2 --- PHI - struct : o2::framework::ConfigurableGroup { - Configurable ConfPhiPDGCode{"ConfPhiPDGCode", 333, "Phi meson - PDG code"}; - Configurable ConfPhiPID{"ConfPhiPID", 2, "Phi meson - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector>int>> - } ConfPhi; - /// Partitions for particle 1 - Partition partsTrack = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == ConfTrack.ConfTrackSign.value) && (aod::femtouniverseparticle::pt > ConfTrack.ConfTrackPtLowLimit.value) && (aod::femtouniverseparticle::pt < ConfTrack.ConfTrackPtHighLimit.value); - Partition> partsTrackMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == ConfTrack.ConfTrackSign.value) && (aod::femtouniverseparticle::pt > ConfTrack.ConfTrackPtLowLimit.value) && (aod::femtouniverseparticle::pt < ConfTrack.ConfTrackPtHighLimit.value); + Partition partsTrack = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == ConfTrack.confTrackSign.value) && (aod::femtouniverseparticle::pt > ConfTrack.confTrackPtLowLimit.value) && (aod::femtouniverseparticle::pt < ConfTrack.confTrackPtHighLimit.value); + Partition> partsTrackMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == ConfTrack.confTrackSign.value) && (aod::femtouniverseparticle::pt > ConfTrack.confTrackPtLowLimit.value) && (aod::femtouniverseparticle::pt < ConfTrack.confTrackPtHighLimit.value); /// Partitions for particle 2 Partition partsPhi = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kPhi)); @@ -151,26 +144,22 @@ struct femtoUniversePairTaskTrackPhi { /// Histogramming for Event FemtoUniverseEventHisto eventHisto; - /// The configurables need to be passed to an std::vector - int vPIDPhiCandidate, vPIDTrack; - std::vector kNsigma; - /// particle part - ConfigurableAxis ConfBinsTempFitVar{"ConfDTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfBinsTempFitVarInvMass{"ConfDTempFitVarInvMassBins", {6000, 0.9, 4.0}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfBinsTempFitVarpT{"ConfBinsTempFitVarpT", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; + ConfigurableAxis confBinsTempFitVar{"confBinsTempFitVar", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis confBinsTempFitVarInvMass{"confBinsTempFitVarInvMass", {6000, 0.9, 4.0}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis confBinsTempFitVarpT{"confBinsTempFitVarpT", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; /// Correlation part - ConfigurableAxis ConfBinsMult{"ConfBinsMult", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; // \todo to be obtained from the hash task - ConfigurableAxis ConfBinsVtx{"ConfBinsVtx", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis ConfBins3DmT{"ConfBins3DmT", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - ConfigurableAxis ConfBins3Dmult{"ConfBins3Dmult", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + ConfigurableAxis confBinsMult{"confBinsMult", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; // \todo to be obtained from the hash task + ConfigurableAxis confBinsVtx{"confBinsVtx", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + ConfigurableAxis confBins3DmT{"confBins3DmT", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + ConfigurableAxis confBins3Dmult{"confBins3Dmult", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - ColumnBinningPolicy colBinning{{ConfBinsVtx, ConfBinsMult}, true}; + ColumnBinningPolicy colBinning{{confBinsVtx, confBinsMult}, true}; - ConfigurableAxis ConfBinskstar{"ConfBinskstar", {1500, 0., 6.}, "binning kstar"}; - ConfigurableAxis ConfBinskT{"ConfBinskT", {150, 0., 9.}, "binning kT"}; - ConfigurableAxis ConfBinsmT{"ConfBinsmT", {225, 0., 7.5}, "binning mT"}; + ConfigurableAxis confBinskstar{"confBinskstar", {1500, 0., 6.}, "binning kstar"}; + ConfigurableAxis confBinskT{"confBinskT", {150, 0., 9.}, "binning kT"}; + ConfigurableAxis confBinsmT{"confBinsmT", {225, 0., 7.5}, "binning mT"}; FemtoUniverseAngularContainer sameEventAngularCont; FemtoUniverseAngularContainer mixedEventAngularCont; @@ -179,11 +168,11 @@ struct femtoUniversePairTaskTrackPhi { FemtoUniverseTrackSelection trackCuts; /// Histogram output - HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry qaRegistry{"qaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry MixQaRegistry{"MixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry registryMCtruth{"MCtruthHistos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; - HistogramRegistry registryMCreco{"MCrecoHistos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; + HistogramRegistry mixQaRegistry{"mixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registryMCtruth{"registryMCtruth", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; + HistogramRegistry registryMCreco{"registryMCreco", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry registryPhiMinvBackground{"registryPhiMinvBackground", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; Service ccdb; @@ -191,16 +180,16 @@ struct femtoUniversePairTaskTrackPhi { TH2F* phieff; // PID for protons - bool IsProtonNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr) // previous version from: https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx + bool isProtonNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr) // previous version from: https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx { if (mom < 0.5) { - if (TMath::Abs(nsigmaTPCPr) < ConfBothTracks.ConfPIDProtonNsigmaTPC.value) { + if (std::abs(nsigmaTPCPr) < ConfBothTracks.confPIDProtonNsigmaTPC.value) { return true; } else { return false; } } else if (mom > 0.4) { - if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfPIDProtonNsigmaCombined.value) { + if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.confPIDProtonNsigmaCombined.value) { return true; } else { return false; @@ -209,15 +198,15 @@ struct femtoUniversePairTaskTrackPhi { return false; } - bool IsProtonRejected(float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) + bool isProtonRejected(float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) { if (mom < 0.5) { return true; } if (mom > 0.5) { - if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.ConfPIDPionNsigmaReject.value) { + if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.confPIDPionNsigmaReject.value) { return true; - } else if (TMath::Hypot(nsigmaTOFK, nsigmaTPCK) < ConfBothTracks.ConfPIDKaonNsigmaReject.value) { + } else if (std::hypot(nsigmaTOFK, nsigmaTPCK) < ConfBothTracks.confPIDKaonNsigmaReject.value) { return true; } else { return false; @@ -227,28 +216,28 @@ struct femtoUniversePairTaskTrackPhi { } } - bool IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK) + bool isKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK) { if (mom < 0.3) { // 0.0-0.3 - if (TMath::Abs(nsigmaTPCK) < 3.0) { + if (std::abs(nsigmaTPCK) < 3.0) { return true; } else { return false; } } else if (mom < 0.45) { // 0.30 - 0.45 - if (TMath::Abs(nsigmaTPCK) < 2.0) { + if (std::abs(nsigmaTPCK) < 2.0) { return true; } else { return false; } } else if (mom < 0.55) { // 0.45-0.55 - if (TMath::Abs(nsigmaTPCK) < 1.0) { + if (std::abs(nsigmaTPCK) < 1.0) { return true; } else { return false; } } else if (mom < 1.5) { // 0.55-1.5 (now we use TPC and TOF) - if ((TMath::Abs(nsigmaTOFK) < 3.0) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < 3.0) && (std::abs(nsigmaTPCK) < 3.0)) { { return true; } @@ -256,7 +245,7 @@ struct femtoUniversePairTaskTrackPhi { return false; } } else if (mom > 1.5) { // 1.5 - - if ((TMath::Abs(nsigmaTOFK) < 2.0) && (TMath::Abs(nsigmaTPCK) < 3.0)) { + if ((std::abs(nsigmaTOFK) < 2.0) && (std::abs(nsigmaTPCK) < 3.0)) { return true; } else { return false; @@ -266,19 +255,19 @@ struct femtoUniversePairTaskTrackPhi { } } - bool IsKaonRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi) + bool isKaonRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi) { if (mom < 0.5) { - if (TMath::Abs(nsigmaTPCPi) < ConfBothTracks.ConfPIDPionNsigmaReject.value) { + if (std::abs(nsigmaTPCPi) < ConfBothTracks.confPIDPionNsigmaReject.value) { return true; - } else if (TMath::Abs(nsigmaTPCPr) < ConfBothTracks.ConfPIDProtonNsigmaReject.value) { + } else if (std::abs(nsigmaTPCPr) < ConfBothTracks.confPIDProtonNsigmaReject.value) { return true; } } if (mom > 0.5) { - if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.ConfPIDPionNsigmaReject.value) { + if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.confPIDPionNsigmaReject.value) { return true; - } else if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfPIDProtonNsigmaReject.value) { + } else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.confPIDProtonNsigmaReject.value) { return true; } else { return false; @@ -288,17 +277,17 @@ struct femtoUniversePairTaskTrackPhi { } } - bool IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi) + bool isPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi) { if (true) { if (mom < 0.5) { - if (TMath::Abs(nsigmaTPCPi) < ConfBothTracks.ConfPIDPionNsigmaTPC.value) { + if (std::abs(nsigmaTPCPi) < ConfBothTracks.confPIDPionNsigmaTPC.value) { return true; } else { return false; } } else if (mom > 0.5) { - if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.ConfPIDPionNsigmaCombined.value) { + if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.confPIDPionNsigmaCombined.value) { return true; } else { return false; @@ -308,19 +297,19 @@ struct femtoUniversePairTaskTrackPhi { return false; } - bool IsPionRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCK, float nsigmaTOFK) + bool isPionRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCK, float nsigmaTOFK) { if (mom < 0.5) { - if (TMath::Abs(nsigmaTPCK) < ConfBothTracks.ConfPIDKaonNsigmaReject.value) { + if (std::abs(nsigmaTPCK) < ConfBothTracks.confPIDKaonNsigmaReject.value) { return true; - } else if (TMath::Abs(nsigmaTPCPr) < ConfBothTracks.ConfPIDProtonNsigmaReject.value) { + } else if (std::abs(nsigmaTPCPr) < ConfBothTracks.confPIDProtonNsigmaReject.value) { return true; } } if (mom > 0.5) { - if (TMath::Hypot(nsigmaTOFK, nsigmaTPCK) < ConfBothTracks.ConfPIDKaonNsigmaReject.value) { + if (std::hypot(nsigmaTOFK, nsigmaTPCK) < ConfBothTracks.confPIDKaonNsigmaReject.value) { return true; - } else if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.ConfPIDProtonNsigmaReject.value) { + } else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.confPIDProtonNsigmaReject.value) { return true; } else { return false; @@ -330,40 +319,40 @@ struct femtoUniversePairTaskTrackPhi { } } - bool IsParticleNSigmaAccepted(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) + bool isParticleNSigmaAccepted(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) { - switch (ConfTrack.ConfTrackPDGCode) { + switch (ConfTrack.confTrackPDGCode) { case 2212: // Proton case -2212: // anty Proton - return IsProtonNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); + return isProtonNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); break; case 211: // Pion case -211: // Pion- - return IsPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); + return isPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); break; case 321: // Kaon+ case -321: // Kaon- - return IsKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); + return isKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); break; default: return false; } } - bool IsParticleNSigmaRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) + bool isParticleNSigmaRejected(float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) { - switch (ConfTrack.ConfTrackPDGCode) { + switch (ConfTrack.confTrackPDGCode) { case 2212: // Proton case -2212: // anty Proton - return IsProtonRejected(mom, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCK, nsigmaTOFK); + return isProtonRejected(mom, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCK, nsigmaTOFK); break; case 211: // Pion case -211: // Pion- - return IsPionRejected(mom, nsigmaTPCPr, nsigmaTOFPr, nsigmaTPCK, nsigmaTOFK); + return isPionRejected(mom, nsigmaTPCPr, nsigmaTOFPr, nsigmaTPCK, nsigmaTOFK); break; case 321: // Kaon+ case -321: // Kaon- - return IsKaonRejected(mom, nsigmaTPCPr, nsigmaTOFPr, nsigmaTPCPi, nsigmaTOFPi); + return isKaonRejected(mom, nsigmaTPCPr, nsigmaTOFPr, nsigmaTPCPi, nsigmaTOFPi); break; default: return false; @@ -377,14 +366,14 @@ struct femtoUniversePairTaskTrackPhi { qaRegistry.add("PhiDaugh_pos/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("PhiDaugh_pos/pt", "; #it{p_T} (GeV/#it{c}); Counts", kTH1F, {{100, 0, 10}}); qaRegistry.add("PhiDaugh_pos/eta", "; #it{eta}; Counts", kTH1F, {{200, -1.5, 1.5}}); - qaRegistry.add("PhiDaugh_pos/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, 2. * M_PI}}); + qaRegistry.add("PhiDaugh_pos/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, o2::constants::math::TwoPI}}); qaRegistry.add("PhiDaugh_pos/hDCAxy", "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); qaRegistry.add("PhiDaugh_neg/nSigmaTPC", "; #it{p} (GeV/#it{c}); n#sigma_{TPC}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("PhiDaugh_neg/nSigmaTOF", "; #it{p} (GeV/#it{c}); n#sigma_{TOF}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); qaRegistry.add("PhiDaugh_neg/pt", "; #it{p_T} (GeV/#it{c}); Counts", kTH1F, {{100, 0, 10}}); qaRegistry.add("PhiDaugh_neg/eta", "; #it{eta}; Counts", kTH1F, {{200, -1.5, 1.5}}); - qaRegistry.add("PhiDaugh_neg/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, 2. * M_PI}}); + qaRegistry.add("PhiDaugh_neg/phi", "; #it{varphi}; Counts", kTH1F, {{200, 0, o2::constants::math::TwoPI}}); qaRegistry.add("PhiDaugh_neg/hDCAxy", "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); registryPhiMinvBackground.add("InvariantMassKpKp", "; invariant mass K+K+; Counts", kTH1F, {{6000, 0.9, 4.0}}); @@ -415,23 +404,23 @@ struct femtoUniversePairTaskTrackPhi { registryMCreco.add("MCrecoPpos", "MC reco proton;#it{p}_{T} (GeV/c); #eta", {HistType::kTH2F, {{500, 0, 5}, {400, -1.0, 1.0}}}); registryMCreco.add("MCrecoPneg", "MC reco antiproton;#it{p}_{T} (GeV/c); #eta", {HistType::kTH2F, {{500, 0, 5}, {400, -1.0, 1.0}}}); - trackHistoPartPhi.init(&qaRegistry, ConfBinsTempFitVarpT, ConfBinsTempFitVarInvMass, ConfBothTracks.ConfIsMC, ConfPhi.ConfPhiPDGCode); - if (!ConfTrack.ConfTrackIsSame) { - trackHistoPartTrack.init(&qaRegistry, ConfBinsTempFitVarpT, ConfBinsTempFitVar, ConfBothTracks.ConfIsMC, ConfTrack.ConfTrackPDGCode); + trackHistoPartPhi.init(&qaRegistry, confBinsTempFitVarpT, confBinsTempFitVarInvMass, ConfBothTracks.confIsMC, 333); + if (!ConfTrack.confTrackIsSame) { + trackHistoPartTrack.init(&qaRegistry, confBinsTempFitVarpT, confBinsTempFitVar, ConfBothTracks.confIsMC, ConfTrack.confTrackPDGCode); } - MixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); - MixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + mixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + mixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); - sameEventAngularCont.init(&resultRegistry, ConfBinskstar, ConfBinsMult, ConfBinskT, ConfBinsmT, ConfBins3Dmult, ConfBins3DmT, ConfBothTracks.ConfBinsEta, ConfBothTracks.ConfBinsPhi, ConfBothTracks.ConfIsMC, ConfBothTracks.ConfUse3D); - mixedEventAngularCont.init(&resultRegistry, ConfBinskstar, ConfBinsMult, ConfBinskT, ConfBinsmT, ConfBins3Dmult, ConfBins3DmT, ConfBothTracks.ConfBinsEta, ConfBothTracks.ConfBinsPhi, ConfBothTracks.ConfIsMC, ConfBothTracks.ConfUse3D); + sameEventAngularCont.init(&resultRegistry, confBinskstar, confBinsMult, confBinskT, confBinsmT, confBins3Dmult, confBins3DmT, ConfBothTracks.confBinsEta, ConfBothTracks.confBinsPhi, ConfBothTracks.confIsMC, ConfBothTracks.confUse3D); + mixedEventAngularCont.init(&resultRegistry, confBinskstar, confBinsMult, confBinskT, confBinsmT, confBins3Dmult, confBins3DmT, ConfBothTracks.confBinsEta, ConfBothTracks.confBinsPhi, ConfBothTracks.confIsMC, ConfBothTracks.confUse3D); - sameEventAngularCont.setPDGCodes(ConfPhi.ConfPhiPDGCode, ConfTrack.ConfTrackPDGCode); - mixedEventAngularCont.setPDGCodes(ConfPhi.ConfPhiPDGCode, ConfTrack.ConfTrackPDGCode); + sameEventAngularCont.setPDGCodes(333, ConfTrack.confTrackPDGCode); + mixedEventAngularCont.setPDGCodes(333, ConfTrack.confTrackPDGCode); pairCleaner.init(&qaRegistry); - if (ConfCPR.ConfCPRIsEnabled.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPR.ConfCPRdeltaPhiCutMin.value, ConfCPR.ConfCPRdeltaPhiCutMax.value, ConfCPR.ConfCPRdeltaEtaCutMin.value, ConfCPR.ConfCPRdeltaEtaCutMax.value, ConfCPR.ConfCPRChosenRadii.value, ConfCPR.ConfCPRPlotPerRadii.value, ConfCPR.ConfCPRInvMassCutMin.value, ConfCPR.ConfCPRInvMassCutMax.value); + if (ConfCPR.confCPRIsEnabled.value) { + pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPR.confCPRdeltaPhiCutMin.value, ConfCPR.confCPRdeltaPhiCutMax.value, ConfCPR.confCPRdeltaEtaCutMin.value, ConfCPR.confCPRdeltaEtaCutMax.value, ConfCPR.confCPRChosenRadii.value, ConfCPR.confCPRPlotPerRadii.value, ConfCPR.confCPRInvMassCutMin.value, ConfCPR.confCPRInvMassCutMax.value); } /// Initializing CCDB @@ -442,28 +431,24 @@ struct femtoUniversePairTaskTrackPhi { int64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); ccdb->setCreatedNotAfter(now); - if (!ConfEff.ConfEfficiencyTrackPath.value.empty()) { - protoneff = ccdb->getForTimeStamp(ConfEff.ConfEfficiencyTrackPath.value.c_str(), ConfEff.ConfEfficiencyTrackTimestamp.value); + if (!ConfEff.confEfficiencyTrackPath.value.empty()) { + protoneff = ccdb->getForTimeStamp(ConfEff.confEfficiencyTrackPath.value.c_str(), ConfEff.confEfficiencyTrackTimestamp.value); if (!protoneff || protoneff->IsZombie()) { - LOGF(fatal, "Could not load efficiency protoneff histogram from %s", ConfEff.ConfEfficiencyTrackPath.value.c_str()); + LOGF(fatal, "Could not load efficiency protoneff histogram from %s", ConfEff.confEfficiencyTrackPath.value.c_str()); } } - if (!ConfEff.ConfEfficiencyPhiPath.value.empty()) { - phieff = ccdb->getForTimeStamp(ConfEff.ConfEfficiencyPhiPath.value.c_str(), ConfEff.ConfEfficiencyPhiTimestamp.value); + if (!ConfEff.confEfficiencyPhiPath.value.empty()) { + phieff = ccdb->getForTimeStamp(ConfEff.confEfficiencyPhiPath.value.c_str(), ConfEff.confEfficiencyPhiTimestamp.value); if (!phieff || phieff->IsZombie()) { - LOGF(fatal, "Could not load efficiency phieff histogram from %s", ConfEff.ConfEfficiencyPhiPath.value.c_str()); + LOGF(fatal, "Could not load efficiency phieff histogram from %s", ConfEff.confEfficiencyPhiPath.value.c_str()); } } - - vPIDPhiCandidate = ConfPhi.ConfPhiPID.value; - vPIDTrack = ConfTrack.ConfTrackPID.value; - kNsigma = ConfBothTracks.ConfTrkPIDnSigmaMax.value; } template void fillCollision(CollisionType col) { - MixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); + mixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); } @@ -482,13 +467,13 @@ struct femtoUniversePairTaskTrackPhi { { /// Histogramming same event - for (auto& phicandidate : groupPartsPhi) { + for (auto const& phicandidate : groupPartsPhi) { trackHistoPartPhi.fillQA(phicandidate); } float tpcNSigma; float tofNSigma; - for (auto& phidaugh : groupPartsPhiDaugh) { + for (auto const& phidaugh : groupPartsPhiDaugh) { if (phidaugh.mAntiLambda() == 1) { // workaround tpcNSigma = trackCuts.getNsigmaTPC(phidaugh, o2::track::PID::Kaon); tofNSigma = trackCuts.getNsigmaTOF(phidaugh, o2::track::PID::Kaon); @@ -512,8 +497,8 @@ struct femtoUniversePairTaskTrackPhi { } } float tpcNSigmaPr, tofNSigmaPr, tpcNSigmaPi, tofNSigmaPi, tpcNSigmaKa, tofNSigmaKa; - if (!ConfTrack.ConfTrackIsSame) { - for (auto& track : groupPartsTrack) { + if (!ConfTrack.confTrackIsSame) { + for (auto const& track : groupPartsTrack) { tpcNSigmaPi = trackCuts.getNsigmaTPC(track, o2::track::PID::Pion); tofNSigmaPi = trackCuts.getNsigmaTOF(track, o2::track::PID::Pion); tpcNSigmaKa = trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon); @@ -521,14 +506,14 @@ struct femtoUniversePairTaskTrackPhi { tpcNSigmaPr = trackCuts.getNsigmaTPC(track, o2::track::PID::Proton); tofNSigmaPr = trackCuts.getNsigmaTOF(track, o2::track::PID::Proton); - if (ConfTrack.ConfTrackIsIdentified) { - if (!IsParticleNSigmaAccepted(track.p(), tpcNSigmaPr, tofNSigmaPr, tpcNSigmaPi, tofNSigmaPi, tpcNSigmaKa, tofNSigmaKa)) { + if (ConfTrack.confTrackIsIdentified) { + if (!isParticleNSigmaAccepted(track.p(), tpcNSigmaPr, tofNSigmaPr, tpcNSigmaPi, tofNSigmaPi, tpcNSigmaKa, tofNSigmaKa)) { continue; } } - if (ConfTrack.ConfTrackIsRejected) { - if (IsParticleNSigmaRejected(track.p(), tpcNSigmaPr, tofNSigmaPr, tpcNSigmaPi, tofNSigmaPi, tpcNSigmaKa, tofNSigmaKa)) { + if (ConfTrack.confTrackIsRejected) { + if (isParticleNSigmaRejected(track.p(), tpcNSigmaPr, tofNSigmaPr, tpcNSigmaPi, tofNSigmaPi, tpcNSigmaKa, tofNSigmaKa)) { continue; } } @@ -544,21 +529,21 @@ struct femtoUniversePairTaskTrackPhi { } } /// Now build the combinations - for (auto& [track, phicandidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsPhi))) { - if (ConfTrack.ConfTrackIsIdentified) { - if (!IsParticleNSigmaAccepted(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { + for (auto const& [track, phicandidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsPhi))) { + if (ConfTrack.confTrackIsIdentified) { + if (!isParticleNSigmaAccepted(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } } - if (ConfTrack.ConfTrackIsRejected) { - if (IsParticleNSigmaRejected(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { + if (ConfTrack.confTrackIsRejected) { + if (isParticleNSigmaRejected(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } } - // // Close Pair Rejection - if (ConfCPR.ConfCPRIsEnabled.value) { + // Close Pair Rejection + if (ConfCPR.confCPRIsEnabled.value) { if (pairCloseRejection.isClosePair(track, phicandidate, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { continue; } @@ -572,24 +557,21 @@ struct femtoUniversePairTaskTrackPhi { float weight = 1.0f; if (phieff) { weight = protoneff->GetBinContent(protoneff->FindBin(track.pt(), track.eta())) * phieff->GetBinContent(phieff->FindBin(phicandidate.pt(), phicandidate.eta())); - sameEventAngularCont.setPair(track, phicandidate, multCol, ConfBothTracks.ConfUse3D, weight); + sameEventAngularCont.setPair(track, phicandidate, multCol, ConfBothTracks.confUse3D, weight); } else { - sameEventAngularCont.setPair(track, phicandidate, multCol, ConfBothTracks.ConfUse3D, weight); + sameEventAngularCont.setPair(track, phicandidate, multCol, ConfBothTracks.confUse3D, weight); } } + // Used for better fitting of invariant mass background. + TLorentzVector part1Vec; TLorentzVector part2Vec; - float mMassOne = TDatabasePDG::Instance()->GetParticle(321)->Mass(); // FIXME: Get from the PDG service of the common header - float mMassTwo = TDatabasePDG::Instance()->GetParticle(-321)->Mass(); // FIXME: Get from the PDG service of the common header + float mMassOne = o2::constants::physics::MassKPlus; + float mMassTwo = o2::constants::physics::MassKMinus; - for (auto& [kaon1, kaon2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsKaons, groupPartsKaons))) { - // empty if statements commented out on 20241114 to get rid of MegaLinter errors - // if (!IsKaonNSigma(kaon1.p(), trackCuts.getNsigmaTPC(kaon1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(kaon1, o2::track::PID::Kaon))) { - // } - // if (!IsKaonNSigma(kaon2.p(), trackCuts.getNsigmaTPC(kaon2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(kaon2, o2::track::PID::Kaon))) { - // } + for (auto const& [kaon1, kaon2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsKaons, groupPartsKaons))) { if ((kaon1.mAntiLambda() == 1) && (kaon2.mAntiLambda() == 1)) { part1Vec.SetPtEtaPhiM(kaon1.pt(), kaon1.eta(), kaon1.phi(), mMassOne); part2Vec.SetPtEtaPhiM(kaon2.pt(), kaon2.eta(), kaon2.phi(), mMassOne); @@ -611,8 +593,8 @@ struct femtoUniversePairTaskTrackPhi { /// process function for to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(o2::aod::FDCollision& col, - FemtoFullParticles& parts) + void processSameEvent(o2::aod::FDCollision const& col, + FemtoFullParticles const& parts) { fillCollision(col); @@ -623,15 +605,15 @@ struct femtoUniversePairTaskTrackPhi { doSameEvent(thegroupPartsTrack, thegroupPartsPhi, thegroupPartsPhiDaugh, thegroupPartsKaons, parts, col.magField(), col.multNtr()); } - PROCESS_SWITCH(femtoUniversePairTaskTrackPhi, processSameEvent, "Enable processing same event", true); + PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processSameEvent, "Enable processing same event", true); /// process function for to call doSameEvent with Monte Carlo /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(o2::aod::FDCollision& col, - soa::Join& parts, - o2::aod::FDMCParticles&) + void processSameEventMC(o2::aod::FDCollision const& col, + soa::Join const& parts, + o2::aod::FDMCParticles const&) { fillCollision(col); @@ -642,7 +624,7 @@ struct femtoUniversePairTaskTrackPhi { doSameEvent(thegroupPartsTrack, thegroupPartsPhi, thegroupPartsPhiDaugh, thegroupPartsKaons, parts, col.magField(), col.multNtr()); } - PROCESS_SWITCH(femtoUniversePairTaskTrackPhi, processSameEventMC, "Enable processing same event for Monte Carlo", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processSameEventMC, "Enable processing same event for Monte Carlo", false); /// This function processes the mixed event /// \todo the trivial loops over the collisions and tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... @@ -658,20 +640,20 @@ struct femtoUniversePairTaskTrackPhi { void doMixedEvent(PartitionType groupPartsTrack, PartitionType groupPartsPhi, PartType parts, float magFieldTesla, int multCol) { - for (auto& [track, phicandidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsPhi))) { - if (ConfTrack.ConfTrackIsIdentified) { - if (!IsParticleNSigmaAccepted(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { + for (auto const& [track, phicandidate] : combinations(CombinationsFullIndexPolicy(groupPartsTrack, groupPartsPhi))) { + if (ConfTrack.confTrackIsIdentified) { + if (!isParticleNSigmaAccepted(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } } - if (ConfTrack.ConfTrackIsRejected) { - if (IsParticleNSigmaRejected(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { + if (ConfTrack.confTrackIsRejected) { + if (isParticleNSigmaRejected(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } } - if (ConfCPR.ConfCPRIsEnabled.value) { + if (ConfCPR.confCPRIsEnabled.value) { if (pairCloseRejection.isClosePair(track, phicandidate, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { continue; } @@ -680,9 +662,9 @@ struct femtoUniversePairTaskTrackPhi { float weight = 1.0f; if (protoneff) { weight = protoneff->GetBinContent(protoneff->FindBin(track.pt(), track.eta())) * phieff->GetBinContent(phieff->FindBin(phicandidate.pt(), phicandidate.eta())); - mixedEventAngularCont.setPair(track, phicandidate, multCol, ConfBothTracks.ConfUse3D, weight); + mixedEventAngularCont.setPair(track, phicandidate, multCol, ConfBothTracks.confUse3D, weight); } else { - mixedEventAngularCont.setPair(track, phicandidate, multCol, ConfBothTracks.ConfUse3D, weight); + mixedEventAngularCont.setPair(track, phicandidate, multCol, ConfBothTracks.confUse3D, weight); } } } @@ -690,13 +672,13 @@ struct femtoUniversePairTaskTrackPhi { /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(o2::aod::FDCollisions& cols, - FemtoFullParticles& parts) + void processMixedEvent(o2::aod::FDCollisions const& cols, + FemtoFullParticles const& parts) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + for (auto const& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { const int multiplicityCol = collision1.multNtr(); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); auto groupPartsTrack = partsTrack->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); auto groupPartsPhi = partsPhi->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); @@ -708,25 +690,25 @@ struct femtoUniversePairTaskTrackPhi { continue; } /// \todo before mixing we should check whether both collisions contain a pair of particles! - // if (partsPhi.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partsTrack.size() == 0 ) continue; + // if (partsPhi.size() == 0 || NPart2Evt1 == 0 || NPart1Evt2 == 0 || partsTrack.size() == 0 ) continue; doMixedEvent(groupPartsTrack, groupPartsPhi, parts, magFieldTesla1, multiplicityCol); } } - PROCESS_SWITCH(femtoUniversePairTaskTrackPhi, processMixedEvent, "Enable processing mixed events", true); + PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processMixedEvent, "Enable processing mixed events", true); /// brief process function for to call doMixedEvent with Monte Carlo /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(o2::aod::FDCollisions& cols, - soa::Join& parts, - o2::aod::FDMCParticles&) + void processMixedEventMC(o2::aod::FDCollisions const& cols, + soa::Join const& parts, + o2::aod::FDMCParticles const&) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + for (auto const& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { const int multiplicityCol = collision1.multNtr(); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); auto groupPartsTrack = partsTrackMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); auto groupPartsPhi = partsPhiMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); @@ -738,19 +720,19 @@ struct femtoUniversePairTaskTrackPhi { continue; } /// \todo before mixing we should check whether both collisions contain a pair of particles! - // if (partsPhi.size() == 0 || nPart2Evt1 == 0 || nPart1Evt2 == 0 || partsTrack.size() == 0 ) continue; + // if (partsPhi.size() == 0 || NPart2Evt1 == 0 || NPart1Evt2 == 0 || partsTrack.size() == 0 ) continue; doMixedEvent(groupPartsTrack, groupPartsPhi, parts, magFieldTesla1, multiplicityCol); } } - PROCESS_SWITCH(femtoUniversePairTaskTrackPhi, processMixedEventMC, "Enable processing mixed events MC", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processMixedEventMC, "Enable processing mixed events MC", false); ///--------------------------------------------MC-------------------------------------------------/// /// This function fills MC truth particles from derived MC table void processMCTruth(aod::FDParticles const& parts) { - for (auto& part : parts) { + for (auto const& part : parts) { if (part.partType() != uint8_t(aod::femtouniverseparticle::ParticleType::kMCTruthTrack)) continue; @@ -787,11 +769,11 @@ struct femtoUniversePairTaskTrackPhi { } } } - PROCESS_SWITCH(femtoUniversePairTaskTrackPhi, processMCTruth, "Process MC truth data", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processMCTruth, "Process MC truth data", false); void processMCReco(FemtoRecoParticles const& parts, aod::FDMCParticles const& mcparts) { - for (auto& part : parts) { + for (auto const& part : parts) { auto mcPartId = part.fdMCParticleId(); if (mcPartId == -1) continue; // no MC particle @@ -803,14 +785,14 @@ struct femtoUniversePairTaskTrackPhi { } else if (part.partType() == aod::femtouniverseparticle::ParticleType::kTrack) { if (part.sign() > 0) { registryMCreco.fill(HIST("MCrecoAllPositivePt"), mcpart.pt()); - if (mcpart.pdgMCTruth() == 2212 && IsParticleNSigmaAccepted(part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { + if (mcpart.pdgMCTruth() == 2212 && isParticleNSigmaAccepted(part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { registryMCreco.fill(HIST("MCrecoPpos"), mcpart.pt(), mcpart.eta()); } } if (part.sign() < 0) { registryMCreco.fill(HIST("MCrecoAllNegativePt"), mcpart.pt()); - if (mcpart.pdgMCTruth() == -2212 && IsParticleNSigmaAccepted(part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { + if (mcpart.pdgMCTruth() == -2212 && isParticleNSigmaAccepted(part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { registryMCreco.fill(HIST("MCrecoPneg"), mcpart.pt(), mcpart.eta()); } } @@ -818,13 +800,13 @@ struct femtoUniversePairTaskTrackPhi { } } - PROCESS_SWITCH(femtoUniversePairTaskTrackPhi, processMCReco, "Process MC reco data", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackPhi, processMCReco, "Process MC reco data", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; return workflow; } From 8da7257467bd9dca303f66b901d9bc65823fd688 Mon Sep 17 00:00:00 2001 From: Sasha Bylinkin <37345380+abylinkin@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:23:40 +0100 Subject: [PATCH 379/459] [PWGUD] Removing obsolete pids from personal task (#8979) Co-authored-by: ALICE Action Bot --- PWGUD/DataModel/SGTables.h | 8 +------- PWGUD/Tasks/sgPIDAnalyzer.cxx | 24 ------------------------ PWGUD/Tasks/sgPIDSpectraTable.cxx | 17 +++++++++-------- 3 files changed, 10 insertions(+), 39 deletions(-) diff --git a/PWGUD/DataModel/SGTables.h b/PWGUD/DataModel/SGTables.h index e0896459fea..a9bcd664063 100644 --- a/PWGUD/DataModel/SGTables.h +++ b/PWGUD/DataModel/SGTables.h @@ -54,17 +54,11 @@ DECLARE_SOA_COLUMN(TOFel, tofel, float); DECLARE_SOA_COLUMN(TPCmu, tpcmu, float); DECLARE_SOA_COLUMN(TOFmu, tofmu, float); DECLARE_SOA_COLUMN(TPCde, tpcde, float); -DECLARE_SOA_COLUMN(TPCtr, tpctr, float); -DECLARE_SOA_COLUMN(TPChe, tpche, float); -DECLARE_SOA_COLUMN(TPCal, tpcal, float); DECLARE_SOA_COLUMN(TOFde, tofde, float); -DECLARE_SOA_COLUMN(TOFtr, toftr, float); -DECLARE_SOA_COLUMN(TOFhe, tofhe, float); -DECLARE_SOA_COLUMN(TOFal, tofal, float); } // namespace sgtrack DECLARE_SOA_TABLE(SGTracks, "AOD", "SGTRACK", o2::soa::Index<>, sgtrack::SGEventId, - sgtrack::Pt, sgtrack::Eta, sgtrack::Phi, sgtrack::Sign, sgtrack::TPCpi, sgtrack::TPCka, sgtrack::TPCpr, sgtrack::TPCel, sgtrack::TOFpi, sgtrack::TOFka, sgtrack::TOFpr, sgtrack::TOFel, sgtrack::TPCmu, sgtrack::TOFmu, sgtrack::TPCde, sgtrack::TPCtr, sgtrack::TPChe, sgtrack::TPCal, sgtrack::TOFde, sgtrack::TOFtr, sgtrack::TOFhe, sgtrack::TOFal); + sgtrack::Pt, sgtrack::Eta, sgtrack::Phi, sgtrack::Sign, sgtrack::TPCpi, sgtrack::TPCka, sgtrack::TPCpr, sgtrack::TPCel, sgtrack::TOFpi, sgtrack::TOFka, sgtrack::TOFpr, sgtrack::TOFel, sgtrack::TPCmu, sgtrack::TOFmu, sgtrack::TPCde, sgtrack::TOFde); using SGTrack = SGTracks::iterator; } // namespace o2::aod diff --git a/PWGUD/Tasks/sgPIDAnalyzer.cxx b/PWGUD/Tasks/sgPIDAnalyzer.cxx index 9a69891ee0a..e4015417971 100644 --- a/PWGUD/Tasks/sgPIDAnalyzer.cxx +++ b/PWGUD/Tasks/sgPIDAnalyzer.cxx @@ -61,12 +61,6 @@ struct sgPIDAnalyzer { histos.add("TPC/nTPC_El", "Negative TPC El Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_De", "Positive TPC De Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_De", "Negative TPC De Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTPC_Tr", "Positive TPC Tr Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTPC_Tr", "Negative TPC Tr Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTPC_He", "Positive TPC He Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTPC_He", "Negative TPC He Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/pTPC_Al", "Positive TPC Al Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); - histos.add("TPC/nTPC_Al", "Negative TPC Al Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/pTPC_Mu", "Positive TPC Mu Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); histos.add("TPC/nTPC_Mu", "Negative TPC Mu Tracks", {HistType::kTH2F, {ptBins, nSigmaBins}}); @@ -164,12 +158,6 @@ struct sgPIDAnalyzer { histos.add("TOF/nEl", "Negative TPC El vs TOF El vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); histos.add("TOF/pDe", "Positive TPC De vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); histos.add("TOF/nDe", "Negative TPC De vs TOF Pi vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); - histos.add("TOF/pTr", "Positive TPC Tr vs TOF Ka vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); - histos.add("TOF/nTr", "Negative TPC Tr vs TOF Ka vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); - histos.add("TOF/pHe", "Positive TPC He vs TOF Pr vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); - histos.add("TOF/nHe", "Negative TPC He vs TOF Pr vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); - histos.add("TOF/pAl", "Positive TPC Al vs TOF El vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); - histos.add("TOF/nAl", "Negative TPC Al vs TOF El vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); histos.add("TOF/pMu", "Positive TPC Mu vs TOF El vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); histos.add("TOF/nMu", "Negative TPC Mu vs TOF El vs pt", {HistType::kTH3F, {ptBins, ntofBins, ntofBins}}); } @@ -189,9 +177,6 @@ struct sgPIDAnalyzer { histos.fill(HIST("TPC/pTPC_Pr"), track.pt(), track.tpcpr()); histos.fill(HIST("TPC/pTPC_El"), track.pt(), track.tpcel()); histos.fill(HIST("TPC/pTPC_De"), track.pt(), track.tpcde()); - histos.fill(HIST("TPC/pTPC_Tr"), track.pt(), track.tpctr()); - histos.fill(HIST("TPC/pTPC_He"), track.pt(), track.tpche()); - histos.fill(HIST("TPC/pTPC_Al"), track.pt(), track.tpcal()); histos.fill(HIST("TPC/pTPC_Mu"), track.pt(), track.tpcmu()); if (std::abs(track.tpcpi()) < 1) { histos.fill(HIST("TPC/pTPC_Ka_Pi"), track.pt(), track.tpcka()); @@ -229,9 +214,6 @@ struct sgPIDAnalyzer { histos.fill(HIST("TPC/nTPC_Pr"), track.pt(), track.tpcpr()); histos.fill(HIST("TPC/nTPC_El"), track.pt(), track.tpcel()); histos.fill(HIST("TPC/nTPC_De"), track.pt(), track.tpcde()); - histos.fill(HIST("TPC/nTPC_Tr"), track.pt(), track.tpctr()); - histos.fill(HIST("TPC/nTPC_He"), track.pt(), track.tpche()); - histos.fill(HIST("TPC/nTPC_Al"), track.pt(), track.tpcal()); histos.fill(HIST("TPC/nTPC_Mu"), track.pt(), track.tpcmu()); if (std::abs(track.tpcpi()) < 1) { histos.fill(HIST("TPC/nTPC_Ka_Pi"), track.pt(), track.tpcka()); @@ -271,9 +253,6 @@ struct sgPIDAnalyzer { histos.fill(HIST("TOF/pPr"), track.pt(), track.tpcpr(), track.tofpr()); histos.fill(HIST("TOF/pEl"), track.pt(), track.tpcel(), track.tofel()); histos.fill(HIST("TOF/pDe"), track.pt(), track.tpcpi(), track.tofde()); - histos.fill(HIST("TOF/pTr"), track.pt(), track.tpcka(), track.toftr()); - histos.fill(HIST("TOF/pHe"), track.pt(), track.tpcpr(), track.tofhe()); - histos.fill(HIST("TOF/pAl"), track.pt(), track.tpcel(), track.tofal()); histos.fill(HIST("TOF/pMu"), track.pt(), track.tpcel(), track.tofmu()); if (std::abs(track.tofpi()) < 1) { histos.fill(HIST("TOF/pTOF_Ka_Pi"), track.pt(), track.tofka()); @@ -311,9 +290,6 @@ struct sgPIDAnalyzer { histos.fill(HIST("TOF/nPr"), track.pt(), track.tpcpr(), track.tofpr()); histos.fill(HIST("TOF/nEl"), track.pt(), track.tpcel(), track.tofel()); histos.fill(HIST("TOF/nDe"), track.pt(), track.tpcpi(), track.tofde()); - histos.fill(HIST("TOF/nTr"), track.pt(), track.tpcka(), track.toftr()); - histos.fill(HIST("TOF/nHe"), track.pt(), track.tpcpr(), track.tofhe()); - histos.fill(HIST("TOF/nAl"), track.pt(), track.tpcel(), track.tofal()); histos.fill(HIST("TOF/nMu"), track.pt(), track.tpcel(), track.tofmu()); if (std::abs(track.tofpi()) < 1) { histos.fill(HIST("TOF/nTOF_Ka_Pi"), track.pt(), track.tofka()); diff --git a/PWGUD/Tasks/sgPIDSpectraTable.cxx b/PWGUD/Tasks/sgPIDSpectraTable.cxx index e5ad7187a34..f8e6e69373c 100644 --- a/PWGUD/Tasks/sgPIDSpectraTable.cxx +++ b/PWGUD/Tasks/sgPIDSpectraTable.cxx @@ -81,7 +81,7 @@ struct SGPIDSpectraTable { std::vector parameters = {PV_cut, dcaZ_cut, dcaXY_cut, tpcChi2_cut, tpcNClsFindable_cut, itsChi2_cut, eta_cut, pt_cut}; // check rho0 signals float tpcpi, tpcka, tpcel, tpcpr, tofpi, tofka, tofpr, tofel; - float tpcde, tpctr, tpche, tpcal, tofde, toftr, tofhe, tofal, tpcmu, tofmu; + float tpcde, tofde, tpcmu, tofmu; TVector3 a; int goodtracks = 0; for (auto t : tracks) { @@ -107,14 +107,15 @@ struct SGPIDSpectraTable { tofpr = t.hasTOF() ? t.tofNSigmaPr() : -999; tofel = t.hasTOF() ? t.tofNSigmaEl() : -999; tpcde = t.hasTPC() ? t.tpcNSigmaDe() : -999; - tpctr = t.hasTPC() ? t.tpcNSigmaTr() : -999; - tpche = t.hasTPC() ? t.tpcNSigmaHe() : -999; - tpcal = t.hasTPC() ? t.tpcNSigmaAl() : -999; + // tpctr = t.hasTPC() ? t.tpcNSigmaTr() : -999; + // tpche = t.hasTPC() ? t.tpcNSigmaHe() : -999; + // tpcal = t.hasTPC() ? t.tpcNSigmaAl() : -999; tofde = t.hasTOF() ? t.tofNSigmaDe() : -999; - toftr = t.hasTOF() ? t.tofNSigmaTr() : -999; - tofhe = t.hasTOF() ? t.tofNSigmaHe() : -999; - tofal = t.hasTOF() ? t.tofNSigmaAl() : -999; - SGtracks(SGevents.lastIndex(), a.Pt(), a.Eta(), a.Phi(), t.sign(), tpcpi, tpcka, tpcpr, tpcel, tofpi, tofka, tofpr, tofel, tpcmu, tofmu, tpcde, tpctr, tpche, tpcal, tofde, toftr, tofhe, tofal); + // toftr = t.hasTOF() ? t.tofNSigmaTr() : -999; + // tofhe = t.hasTOF() ? t.tofNSigmaHe() : -999; + // tofal = t.hasTOF() ? t.tofNSigmaAl() : -999; + // SGtracks(SGevents.lastIndex(),a.Pt(),a.Eta(),a.Phi(),t.sign(),tpcpi, tpcka, tpcpr, tpcel, tofpi, tofka, tofpr, tofel, tpcmu, tofmu, tpcde, tpctr, tpche, tpcal, tofde, toftr, tofhe, tofal); + SGtracks(SGevents.lastIndex(), a.Pt(), a.Eta(), a.Phi(), t.sign(), tpcpi, tpcka, tpcpr, tpcel, tofpi, tofka, tofpr, tofel, tpcmu, tofmu, tpcde, tofde); } } } From 73f3d748b3ed3ea266b81a88073d59df05be91db Mon Sep 17 00:00:00 2001 From: Yash Patley <52608802+yashpatley@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:22:12 +0530 Subject: [PATCH 380/459] [PWGCF] Update lambdaR2Correlation.cxx (#8973) --- .../Tasks/lambdaR2Correlation.cxx | 134 +++++++++++------- 1 file changed, 79 insertions(+), 55 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx index fa0d783fe52..ed063e4812a 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/lambdaR2Correlation.cxx @@ -165,14 +165,14 @@ struct LambdaCorrTableProducer { Configurable cTrackMinDcaXY{"cTrackMinDcaXY", 0.05, "Minimum DcaXY of Daughter Tracks"}; // V0s - Configurable cMinV0DcaDaughters{"cMinV0DcaDaughters", 1.0, "min DCA between V0 daughters"}; + Configurable cMinV0DcaDaughters{"cMinV0DcaDaughters", 1.4, "min DCA between V0 daughters"}; Configurable cMinDcaPosToPV{"cMinDcaPosToPV", 0.1, "Minimum V0 Positive Track DCAr cut to PV"}; Configurable cMinDcaNegToPV{"cMinDcaNegToPV", 0.1, "Minimum V0 Negative Track DCAr cut to PV"}; - Configurable cMinDcaV0ToPV{"cMinDcaV0ToPV", 0.6, "Minimum DCA V0 to PV"}; - Configurable cMinV0TransRadius{"cMinV0TransRadius", 0.0, "Minimum V0 radius from PV"}; - Configurable cMaxV0TransRadius{"cMaxV0TransRadius", 50.0, "Maximum V0 radius from PV"}; + Configurable cMinDcaV0ToPV{"cMinDcaV0ToPV", 3.0, "Minimum DCA V0 to PV"}; + Configurable cMinV0TransRadius{"cMinV0TransRadius", 0.2, "Minimum V0 radius from PV"}; + Configurable cMaxV0TransRadius{"cMaxV0TransRadius", 200.0, "Maximum V0 radius from PV"}; Configurable cMinV0CTau{"cMinV0CTau", 0.0, "Minimum ctau"}; - Configurable cMaxV0CTau{"cMaxV0CTau", 50.0, "Maximum ctau"}; + Configurable cMaxV0CTau{"cMaxV0CTau", 30.0, "Maximum ctau"}; Configurable cMinV0CosPA{"cMinV0CosPA", 0.998, "Minimum V0 CosPA to PV"}; Configurable cLambdaMassWindow{"cLambdaMassWindow", 0.007, "Mass Window to select Lambda"}; Configurable cKshortRejMassWindow{"cKshortRejMassWindow", 0.005, "Reject K0Short Candidates"}; @@ -183,13 +183,14 @@ struct LambdaCorrTableProducer { // V0s kinmatic acceptance Configurable cMinV0Pt{"cMinV0Pt", 0.8, "Minimum V0 pT"}; Configurable cMaxV0Pt{"cMaxV0Pt", 3.2, "Minimum V0 pT"}; - Configurable cMaxV0Rap{"cMaxV0Rap", 0.6, "|rap| cut"}; + Configurable cMaxV0Rap{"cMaxV0Rap", 0.8, "|rap| cut"}; // V0s MC Configurable cHasMcFlag{"cHasMcFlag", true, "Has Mc Tag"}; - Configurable cSelectTrueLambda{"cSelectTrueLambda", true, "Select True Lambda"}; - Configurable cRecPrimaryLambda{"cRecPrimaryLambda", true, "Primary Lambda"}; - Configurable cGenPrimaryLambda{"cGenPrimaryLambda", true, "Primary Lambda"}; + Configurable cSelectTrueLambda{"cSelectTrueLambda", false, "Select True Lambda"}; + Configurable cRecPrimaryLambda{"cRecPrimaryLambda", false, "Primary Reconstructed Lambda"}; + Configurable cRecSecondaryLambda{"cRecSecondaryLambda", false, "Secondary Reconstructed Lambda"}; + Configurable cGenPrimaryLambda{"cGenPrimaryLambda", true, "Primary Generated Lambda"}; // Efficiency Correction Configurable cCorrectionFlag{"cCorrectionFlag", true, "Efficiency Correction Flag"}; @@ -206,9 +207,9 @@ struct LambdaCorrTableProducer { HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // initialize corr_factor objects - std::vector> vCorrFactStrings = {{"h1f_LaP_cf", "h1f_LaM_cf"}, - {"h2f_LaP_cf", "h2f_LaM_cf"}, - {"h3f_LaP_cf", "h3f_LaM_cf"}}; + std::vector> vCorrFactStrings = {{"hEffVsPtLambda", "hEffVsPtAntiLambda"}, + {"hEffVsPtYLambda", "hEffVsPtYAntiLambda"}, + {"hEffVsPtYVzLambda", "hEffVsPtYVzAntiLambda"}}; void init(InitContext const&) { @@ -294,6 +295,7 @@ struct LambdaCorrTableProducer { histos.add("Tracks/h2f_tracks_pid_after_sel", "PIDs", kTH2F, {axisPID, axisV0Pt}); histos.add("Tracks/h2f_lambda_from_sigma", "PIDs", kTH2F, {axisPID, axisV0Pt}); histos.add("Tracks/h2f_lambda_from_cascade", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_lambda_from_omega", "PIDs", kTH2F, {axisPID, axisV0Pt}); // McGen Histos histos.add("McGen/h1f_collisions_info", "# of collisions", kTH1F, {axisCol}); @@ -420,16 +422,6 @@ struct LambdaCorrTableProducer { histos.fill(HIST("Tracks/h1f_tracks_info"), 4.5); - // Armentros-Podolanski Selection - if (cArmPodCutFlag && (std::abs(v0.alpha()) < v0.qtarm() / cArmPodCutValue)) { - return false; - } - - // Kshort mass rejection hypothesis - if (cKshortRejFlag && (std::abs(v0.mK0Short() - MassK0Short) <= cKshortRejMassWindow)) { - return false; - } - return true; } @@ -483,14 +475,30 @@ struct LambdaCorrTableProducer { } if (!lambdaFlag && !antiLambdaFlag) { // neither Lambda nor Anti-Lambda - histos.fill(HIST("Tracks/h1f_tracks_info"), 18.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), 17.5); return false; } else if (lambdaFlag && antiLambdaFlag) { // check if the track is identified as lambda and anti-lambda both (DISCARD THIS TRACK) - histos.fill(HIST("Tracks/h1f_tracks_info"), 19.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), 18.5); return false; } - return true; + // Armentros-Podolanski Selection + if (cArmPodCutFlag && (std::abs(v0.alpha()) < v0.qtarm() / cArmPodCutValue)) { + return false; + } + + // Kshort mass rejection hypothesis + if (cKshortRejFlag && (std::abs(v0.mK0Short() - MassK0Short) <= cKshortRejMassWindow)) { + return false; + } + + if (lambdaFlag || antiLambdaFlag) { + return true; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), 19.5); + + return false; } template @@ -498,19 +506,17 @@ struct LambdaCorrTableProducer { { auto mcpart = v0.template mcParticle_as(); - // check for lambda/anti-lambda if (std::abs(mcpart.pdgCode()) != kLambda0) { - histos.fill(HIST("Tracks/h1f_tracks_info"), 10.5); return false; } // check for primary/secondary lambda if (cRecPrimaryLambda && !mcpart.isPhysicalPrimary()) { - histos.fill(HIST("Tracks/h1f_tracks_info"), 11.5); - return false; - } else if (!cRecPrimaryLambda && mcpart.isPhysicalPrimary()) { histos.fill(HIST("Tracks/h1f_tracks_info"), 12.5); return false; + } else if (cRecSecondaryLambda && mcpart.isPhysicalPrimary()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 13.5); + return false; } auto postrack = v0.template posTrack_as(); @@ -518,16 +524,35 @@ struct LambdaCorrTableProducer { // check if the daughters have corresponding mcparticle if (!postrack.has_mcParticle() || !negtrack.has_mcParticle()) { - histos.fill(HIST("Tracks/h1f_tracks_info"), 13.5); + histos.fill(HIST("Tracks/h1f_tracks_info"), 14.5); return false; } auto mcpostrack = postrack.template mcParticle_as(); auto mcnegtrack = negtrack.template mcParticle_as(); - if (std::abs(mcpostrack.pdgCode()) != kProton || std::abs(mcnegtrack.pdgCode()) != kPiPlus) { // incorrect decay channel -> return false - histos.fill(HIST("Tracks/h1f_tracks_info"), 14.5); - return false; + if (mcpart.pdgCode() == kLambda0) { + if (mcpostrack.pdgCode() != kProton || mcnegtrack.pdgCode() != kPiMinus) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 15.5); + return false; + } + } else if (mcpart.pdgCode() == kLambda0Bar) { + if (mcpostrack.pdgCode() != kPiPlus || mcnegtrack.pdgCode() != kProtonBar) { + histos.fill(HIST("Tracks/h1f_tracks_info"), 16.5); + return false; + } + } + + // get information about secondary lambdas + if (cRecSecondaryLambda) { + auto lambdaMothers = mcpart.template mothers_as(); + if (std::abs(lambdaMothers[0].pdgCode()) == 3112 || std::abs(lambdaMothers[0].pdgCode()) == 3212 || std::abs(lambdaMothers[0].pdgCode()) == 3222) { + histos.fill(HIST("Tracks/h2f_lambda_from_sigma"), mcpart.pdgCode(), mcpart.pt()); + } else if (std::abs(lambdaMothers[0].pdgCode()) == 3312 || std::abs(lambdaMothers[0].pdgCode()) == 3322) { + histos.fill(HIST("Tracks/h2f_lambda_from_cascade"), mcpart.pdgCode(), mcpart.pt()); + } else if (std::abs(lambdaMothers[0].pdgCode()) == 3334) { + histos.fill(HIST("Tracks/h2f_lambda_from_omega"), mcpart.pdgCode(), mcpart.pt()); + } } return true; @@ -552,25 +577,22 @@ struct LambdaCorrTableProducer { // get ccdb object TObject* obj = reinterpret_cast(ccdbObj->FindObject(Form("%s", vCorrFactStrings[cCorrFactHistType][part].c_str()))); - - if (obj->InheritsFrom("TH1F")) { - TH1F* hist = reinterpret_cast(obj->Clone()); - int ptBin = hist->GetXaxis()->FindBin(v0.pt()); - return hist->GetBinContent(ptBin); - } else if (obj->InheritsFrom("TH2F")) { - TH2F* hist = reinterpret_cast(obj->Clone()); - int ptBin = hist->GetXaxis()->FindBin(v0.pt()); - int rapBin = hist->GetYaxis()->FindBin(v0.yLambda()); - return hist->GetBinContent(ptBin, rapBin); - } else if (obj->InheritsFrom("TH3F")) { - TH3F* hist = reinterpret_cast(obj->Clone()); - int ptBin = hist->GetXaxis()->FindBin(v0.pt()); - int rapBin = hist->GetYaxis()->FindBin(v0.yLambda()); - int vzBin = hist->GetZaxis()->FindBin(col.posZ()); - return hist->GetBinContent(ptBin, rapBin, vzBin); + TH1F* hist = reinterpret_cast(obj->Clone()); + float retVal = 0.; + + if (std::string(obj->ClassName()) == "TH1F") { + retVal = hist->GetBinContent(hist->FindBin(v0.pt())); + } else if (std::string(obj->ClassName()) == "TH2F") { + retVal = hist->GetBinContent(hist->FindBin(v0.pt(), v0.yLambda())); + } else if (std::string(obj->ClassName()) == "TH3F") { + retVal = hist->GetBinContent(hist->FindBin(v0.pt(), v0.yLambda(), col.posZ())); } else { - return 1.; + LOGF(warning, "CCDB OBJECT IS NOT A HISTOGRAM !!!"); + retVal = 1.; } + + delete hist; + return retVal; } template @@ -674,7 +696,6 @@ struct LambdaCorrTableProducer { } histos.fill(HIST("Tracks/h1f_tracks_info"), 6.5); - histos.fill(HIST("Tracks/h2f_armpod_after_sel"), v0.alpha(), v0.qtarm()); // we have v0 as lambda // do MC analysis @@ -687,6 +708,8 @@ struct LambdaCorrTableProducer { histos.fill(HIST("Tracks/h2f_tracks_pid_after_sel"), v0.mcParticle().pdgCode(), v0.pt()); } + histos.fill(HIST("Tracks/h2f_armpod_after_sel"), v0.alpha(), v0.qtarm()); + // get correction factors and mass corr_fact = (v0type == kLambda) ? getCorrectionFactors(collision, v0) : getCorrectionFactors(collision, v0); mass = (v0type == kLambda) ? v0.mLambda() : v0.mAntiLambda(); @@ -831,7 +854,7 @@ struct LambdaR2Correlation { const AxisSpec axisCent(105, 0, 105, "FT0M (%)"); const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); const AxisSpec axisMass(100, 1.06, 1.16, "Inv Mass (GeV/#it{c}^{2})"); - const AxisSpec axisPt(64, 0.2, 3.5, "p_{T} (GeV/#it{c})"); + const AxisSpec axisPt(64, 0.2, 3.4, "p_{T} (GeV/#it{c})"); const AxisSpec axisEta(24, -1.2, 1.2, "#eta"); const AxisSpec axisCPA(100, 0.99, 1.0, "cos(#theta_{PA})"); const AxisSpec axisDcaDau(75, 0., 1.5, "Daug DCA (#sigma)"); @@ -864,6 +887,8 @@ struct LambdaR2Correlation { histos.addClone("Reco/QA_Lambda/", "Reco/QA_AntiLambda/"); // Efficiency Histograms + histos.add("Reco/Efficiency/h1f_n1_pt_LaP", "#rho_{1}^{#Lambda}", kTH1F, {axisEfPt}); + histos.add("Reco/Efficiency/h1f_n1_pt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH1F, {axisEfPt}); histos.add("Reco/Efficiency/h2f_n1_pteta_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisEfPt, axisEfEta}); histos.add("Reco/Efficiency/h2f_n1_pteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisEfPt, axisEfEta}); histos.add("Reco/Efficiency/h2f_n1_ptrap_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisEfPt, axisEfRap}); @@ -1022,6 +1047,7 @@ struct LambdaR2Correlation { histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("h1d_n1_rap_") + HIST(SubDirHist[part]), track.rap(), track.corrFact()); // Efficiency Calculation Plots + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("Efficiency/h1f_n1_pt_") + HIST(SubDirHist[part]), track.pt()); histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("Efficiency/h2f_n1_pteta_") + HIST(SubDirHist[part]), track.pt(), track.eta()); histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("Efficiency/h2f_n1_ptrap_") + HIST(SubDirHist[part]), track.pt(), track.rap()); histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST("Efficiency/h3f_n1_ptetaposz_") + HIST(SubDirHist[part]), track.pt(), track.eta(), col.posZ()); @@ -1082,7 +1108,6 @@ struct LambdaR2Correlation { using LambdaTracks = aod::LambdaTracks; SliceCache cache; - Partition partLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda); Partition partAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda); @@ -1112,7 +1137,6 @@ struct LambdaR2Correlation { void processMCGen(LambdaMcGenCollisions::iterator const& mcgencol, LambdaMcGenTracks const&) { - histos.fill(HIST("Event/McGen/h1f_collision_posz"), mcgencol.posZ()); auto lambdaMcGenTracks = partLambdaMcGenTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); From c89042658a9216b076610404b138b58b3b29d9aa Mon Sep 17 00:00:00 2001 From: Fabrizio Chinu <91954233+fchinu@users.noreply.github.com> Date: Fri, 13 Dec 2024 20:11:01 +0100 Subject: [PATCH 381/459] [PWGHF] Add selection on radius and fix pid variables filling (#8981) --- PWGHF/Tasks/taskPidStudies.cxx | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/PWGHF/Tasks/taskPidStudies.cxx b/PWGHF/Tasks/taskPidStudies.cxx index 8516963bafc..8b905524fb0 100644 --- a/PWGHF/Tasks/taskPidStudies.cxx +++ b/PWGHF/Tasks/taskPidStudies.cxx @@ -119,6 +119,7 @@ DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID informat pid_studies::Pt, pid_studies::BachPt, pid_studies::TpcInnerParBach, + pid_studies::Radius, pid_studies::MLambda, pid_studies::V0cosPA, pid_studies::MassXi, @@ -144,6 +145,7 @@ struct HfTaskPidStudies { Configurable massLambdaMax{"massLambdaMax", 1.3, "Maximum mass for lambda"}; Configurable massOmegaMin{"massOmegaMin", 1.5, "Minimum mass for omega"}; Configurable massOmegaMax{"massOmegaMax", 1.8, "Maximum mass for omega"}; + Configurable radiusMax{"radiusMax", 2.3, "Maximum decay radius (cm)"}; Configurable qtArmenterosMinForK0{"qtArmenterosMinForK0", 0.12, "Minimum Armenteros' qt for K0"}; Configurable qtArmenterosMaxForLambda{"qtArmenterosMaxForLambda", 0.12, "Minimum Armenteros' qt for (anti)Lambda"}; Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of candidates to keep"}; @@ -188,14 +190,14 @@ struct HfTaskPidStudies { candidate.v0cosPA(), candidate.dcaV0daughters(), candidate.dcav0topv(), - posTrack.tofNSigmaPi(), - negTrack.tofNSigmaPi(), - posTrack.tofNSigmaPr(), - negTrack.tofNSigmaPr(), posTrack.tpcNSigmaPi(), negTrack.tpcNSigmaPi(), posTrack.tpcNSigmaPr(), negTrack.tpcNSigmaPr(), + posTrack.tofNSigmaPi(), + negTrack.tofNSigmaPi(), + posTrack.tofNSigmaPr(), + negTrack.tofNSigmaPr(), candidate.alpha(), candidate.qtarm(), coll.ft0cOccupancyInTimeRange(), @@ -210,6 +212,7 @@ struct HfTaskPidStudies { candidate.pt(), candidate.bachelorpt(), bachTrack.tpcInnerParam(), + candidate.cascradius(), candidate.mLambda(), candidate.v0cosPA(coll.posX(), coll.posY(), coll.posZ()), candidate.mXi(), @@ -276,6 +279,9 @@ struct HfTaskPidStudies { if (v0.qtarm() < qtArmenterosMinForK0) { return false; } + if (v0.v0radius() > radiusMax) { + return false; + } return true; } @@ -289,6 +295,9 @@ struct HfTaskPidStudies { if (v0.qtarm() > qtArmenterosMaxForLambda) { return false; } + if (v0.v0radius() > radiusMax) { + return false; + } return true; } @@ -301,6 +310,9 @@ struct HfTaskPidStudies { if (casc.mLambda() < massLambdaMin || casc.mLambda() > massLambdaMax) { return false; } + if (casc.cascradius() > radiusMax) { + return false; + } return true; } From 22d68fe1031203ee09ac4c7283e339cd2f320f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 13 Dec 2024 20:43:59 +0100 Subject: [PATCH 382/459] [PWGHF] Add D0 D0bar reflection infos tagged from data in D0 task (#8891) --- PWGHF/D2H/Tasks/taskD0.cxx | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index f76d9d7bfb8..c4870213625 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -35,10 +35,12 @@ using namespace o2::framework::expressions; namespace { enum CandTypeSel { - SigD0 = 0, // Signal D0 - SigD0bar, // Signal D0bar - ReflectedD0, // Reflected D0 - ReflectedD0bar // Reflected D0bar + SigD0 = 0, // Signal D0 + SigD0bar, // Signal D0bar + ReflectedD0, // Reflected D0 + ReflectedD0bar, // Reflected D0bar + PureSigD0, // Signal D0 exclude Reflected D0bar + PureSigD0bar // Signal D0bar exclude Reflected D0 }; } // namespace struct HfTaskD0 { @@ -63,7 +65,7 @@ struct HfTaskD0 { ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {500, 0, 50}, "Cand. pT bins"}; ConfigurableAxis thnConfigAxisY{"thnConfigAxisY", {20, -1, 1}, "Cand. rapidity bins"}; ConfigurableAxis thnConfigAxisOrigin{"thnConfigAxisOrigin", {3, -0.5, 2.5}, "Cand. origin type"}; - ConfigurableAxis thnConfigAxisCandType{"thnConfigAxisCandType", {4, -0.5, 3.5}, "D0 type"}; + ConfigurableAxis thnConfigAxisCandType{"thnConfigAxisCandType", {6, -0.5, 5.5}, "D0 type"}; ConfigurableAxis thnConfigAxisGenPtD{"thnConfigAxisGenPtD", {500, 0, 50}, "Gen Pt D"}; ConfigurableAxis thnConfigAxisGenPtB{"thnConfigAxisGenPtB", {1000, 0, 100}, "Gen Pt B"}; ConfigurableAxis thnConfigAxisNumPvContr{"thnConfigAxisNumPvContr", {200, -0.5, 199.5}, "Number of PV contributors"}; @@ -318,16 +320,36 @@ struct HfTaskD0 { if constexpr (applyMl) { if (candidate.isSelD0() >= selectionFlagD0) { registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0, ptCandidate, hfHelper.yD0(candidate), SigD0); + if (candidate.isSelD0bar()) { + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0, ptCandidate, hfHelper.yD0(candidate), ReflectedD0); + } else if (!candidate.isSelD0bar()) { + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0, ptCandidate, hfHelper.yD0(candidate), PureSigD0); + } } if (candidate.isSelD0bar() >= selectionFlagD0bar) { registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0bar()[0], candidate.mlProbD0bar()[1], candidate.mlProbD0bar()[2], massD0bar, ptCandidate, hfHelper.yD0(candidate), SigD0bar); + if (candidate.isSelD0()) { + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0()[0], candidate.mlProbD0()[1], candidate.mlProbD0()[2], massD0bar, ptCandidate, hfHelper.yD0(candidate), ReflectedD0bar); + } else if (!candidate.isSelD0()) { + registry.fill(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"), candidate.mlProbD0bar()[0], candidate.mlProbD0bar()[1], candidate.mlProbD0bar()[2], massD0bar, ptCandidate, hfHelper.yD0(candidate), PureSigD0bar); + } } } else { if (candidate.isSelD0() >= selectionFlagD0) { registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0, ptCandidate, hfHelper.yD0(candidate), SigD0); + if (candidate.isSelD0bar()) { + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0, ptCandidate, hfHelper.yD0(candidate), ReflectedD0); + } else if (!candidate.isSelD0bar()) { + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0, ptCandidate, hfHelper.yD0(candidate), PureSigD0); + } } if (candidate.isSelD0bar() >= selectionFlagD0bar) { registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0bar, ptCandidate, hfHelper.yD0(candidate), SigD0bar); + if (candidate.isSelD0()) { + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0bar, ptCandidate, hfHelper.yD0(candidate), ReflectedD0bar); + } else if (!candidate.isSelD0()) { + registry.fill(HIST("hMassVsPtVsPtBVsYVsOriginVsD0Type"), massD0bar, ptCandidate, hfHelper.yD0(candidate), PureSigD0bar); + } } } } From e4cc2a2ce70b5f30f5c5f5193f565bac78d4ae11 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Fri, 13 Dec 2024 21:24:15 +0100 Subject: [PATCH 383/459] [PWGLF] removed TOF tables due to memory consumption in Hyperloop (#8985) Co-authored-by: Prottay Das --- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 33 ++++++------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index bc0993bb77a..fb1d114efe5 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -100,7 +100,6 @@ struct lambdapolsp { Configurable cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"}; Configurable isPVContributor{"isPVContributor", true, "is PV contributor"}; Configurable checkwithpub{"checkwithpub", true, "checking results with published"}; - Configurable useTPCTOF{"useTPCTOF", true, "flag to use TPC and TOF"}; // Configs for V0 Configurable ConfV0PtMin{"ConfV0PtMin", 0.f, "Minimum transverse momentum of V0"}; @@ -120,8 +119,6 @@ struct lambdapolsp { Configurable ConfDaughTPCnclsMin{"ConfDaughTPCnclsMin", 50.f, "V0 Daugh sel: Min. nCls TPC"}; Configurable ConfDaughDCAMin{"ConfDaughDCAMin", 0.08f, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"}; Configurable ConfDaughPIDCuts{"ConfDaughPIDCuts", 3, "PID selections for Lambda daughters"}; - Configurable ConfDaughPIDTPCCuts{"ConfDaughPIDTPCCuts", 3, "PID selections for Lambda daughters in TPC"}; - Configurable ConfDaughPIDTOFCuts{"ConfDaughPIDTOFCuts", 3, "PID selections for Lambda daughters in TOF"}; Configurable CentNbins{"CentNbins", 16, "Number of bins in cent histograms"}; Configurable lbinCent{"lbinCent", 0.0, "lower bin value in cent histograms"}; @@ -413,28 +410,11 @@ struct lambdapolsp { return false; }*/ - if (useTPCTOF) { - if (track.pt() < 0.5 && pid == 0 && TMath::Abs(track.tpcNSigmaPr()) > ConfDaughPIDCuts) { - return false; - } - if (track.pt() < 0.5 && pid == 1 && TMath::Abs(track.tpcNSigmaPi()) > ConfDaughPIDCuts) { - return false; - } - if (track.hasTOF()) { - if (track.pt() > 0.5 && pid == 0 && TMath::Abs(track.tpcNSigmaPr()) > ConfDaughPIDTPCCuts && TMath::Abs(track.tofNSigmaPr()) > ConfDaughPIDTOFCuts) { - return false; - } - if (track.pt() > 0.5 && pid == 1 && TMath::Abs(track.tpcNSigmaPi()) > ConfDaughPIDTPCCuts && TMath::Abs(track.tofNSigmaPi()) > ConfDaughPIDTOFCuts) { - return false; - } - } - } else { - if (pid == 0 && TMath::Abs(track.tpcNSigmaPr()) > ConfDaughPIDCuts) { - return false; - } - if (pid == 1 && TMath::Abs(track.tpcNSigmaPi()) > ConfDaughPIDCuts) { - return false; - } + if (pid == 0 && TMath::Abs(track.tpcNSigmaPr()) > ConfDaughPIDCuts) { + return false; + } + if (pid == 1 && TMath::Abs(track.tpcNSigmaPi()) > ConfDaughPIDCuts) { + return false; } if (pid == 0 && pt < cfgDaughPrPt) { @@ -477,7 +457,8 @@ struct lambdapolsp { using EventCandidates = soa::Filtered>; // using AllTrackCandidates = soa::Join; - using AllTrackCandidates = soa::Filtered>; + // using AllTrackCandidates = soa::Filtered>; + using AllTrackCandidates = soa::Filtered>; using ResoV0s = aod::V0Datas; // void processData(EventCandidates::iterator const& collision, AllTrackCandidates const&, ResoV0s const& V0s, aod::BCs const&) From 4cf23e445c59381a67bf9b4591b7a299da917a43 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Fri, 13 Dec 2024 22:36:06 +0100 Subject: [PATCH 384/459] [Common] add extra MFT counters to mult table (#8980) Co-authored-by: ALICE Builder --- Common/DataModel/Multiplicity.h | 5 +- Common/TableProducer/multiplicityTable.cxx | 62 +++++++++++++--------- 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/Common/DataModel/Multiplicity.h b/Common/DataModel/Multiplicity.h index 40175ded7a4..2547f888691 100644 --- a/Common/DataModel/Multiplicity.h +++ b/Common/DataModel/Multiplicity.h @@ -47,7 +47,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(IsInelGt1, isInelGt1, //! is INEL > 1 [](int multPveta1) -> bool { return multPveta1 > 1; }); // forward track counters -DECLARE_SOA_COLUMN(MFTNtracks, mftNtracks, int); //! +DECLARE_SOA_COLUMN(MFTNalltracks, mftNalltracks, int); //! overall counter, uses AO2D coll assoc +DECLARE_SOA_COLUMN(MFTNtracks, mftNtracks, int); //! reassigned, uses mult group software // MC DECLARE_SOA_COLUMN(MultMCFT0A, multMCFT0A, int); //! @@ -113,7 +114,7 @@ DECLARE_SOA_TABLE(PVMults, "AOD", "PVMULT", //! Multiplicity from the PV contrib mult::IsInelGt0, mult::IsInelGt1); DECLARE_SOA_TABLE(MFTMults, "AOD", "MFTMULT", //! Multiplicity with MFT - mult::MFTNtracks); + mult::MFTNalltracks, mult::MFTNtracks); using BarrelMults = soa::Join; using Mults = soa::Join; using FT0Mult = FT0Mults::iterator; diff --git a/Common/TableProducer/multiplicityTable.cxx b/Common/TableProducer/multiplicityTable.cxx index 2f9040b569c..908a44e92fb 100644 --- a/Common/TableProducer/multiplicityTable.cxx +++ b/Common/TableProducer/multiplicityTable.cxx @@ -28,6 +28,7 @@ #include "TableHelper.h" #include "MetadataHelper.h" #include "TList.h" +#include "PWGMM/Mult/DataModel/bestCollisionTable.h" using namespace o2; using namespace o2::framework; @@ -49,8 +50,7 @@ static constexpr int kFT0MultZeqs = 10; static constexpr int kFDDMultZeqs = 11; static constexpr int kPVMultZeqs = 12; static constexpr int kMultMCExtras = 13; -static constexpr int kMFTMults = 14; -static constexpr int nTables = 15; +static constexpr int nTables = 14; // Checking that the Zeq tables are after the normal ones static_assert(kFV0Mults < kFV0MultZeqs); @@ -72,10 +72,9 @@ static const std::vector tableNames{"FV0Mults", // 0 "FT0MultZeqs", // 10 "FDDMultZeqs", // 11 "PVMultZeqs", // 12 - "MultMCExtras", // 13 - "MFTMults"}; // 14 + "MultMCExtras"}; // 13 static const std::vector parameterNames{"Enable"}; -static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}}; +static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}}; struct MultiplicityTable { SliceCache cache; @@ -94,7 +93,7 @@ struct MultiplicityTable { Produces tablePVZeqs; // 12 Produces tableExtraMc; // 13 Produces tableExtraMult2MCExtras; - Produces mftMults; // 14 + Produces mftMults; // Not accounted for, produced using custom process function to avoid dependencies Produces multsGlobal; // Not accounted for, produced based on process function processGlobalTrackingCounters // For vertex-Z corrections in calibration @@ -301,8 +300,7 @@ struct MultiplicityTable { aod::Zdcs const&, aod::FV0As const&, aod::FT0s const&, - aod::FDDs const&, - aod::MFTTracks const& mftTracks) + aod::FDDs const&) { // reserve memory for (auto i : mEnabledTables) { @@ -348,9 +346,6 @@ struct MultiplicityTable { break; case kMultMCExtras: // MC extra information (nothing to do in the data) break; - case kMFTMults: // Equalized multiplicity for PV - mftMults.reserve(collisions.size()); - break; default: LOG(fatal) << "Unknown table requested: " << i; break; @@ -629,19 +624,6 @@ struct MultiplicityTable { case kMultMCExtras: // MC only (nothing to do) { } break; - case kMFTMults: { - // for centrality estimation with the MFT if desired - // step 1: produce proper grouping - const uint64_t collIdx = collision.globalIndex(); - auto mftTracksGrouped = mftTracks.sliceBy(perCollisionMFT, collIdx); - int nTracks = 0; - for (auto& track : mftTracksGrouped) { - if (track.nClusters() >= 5) { // hardcoded on purpose to avoid trouble - nTracks++; - } - } - mftMults(nTracks); - } break; default: // Default { LOG(fatal) << "Unknown table requested: " << i; @@ -754,12 +736,44 @@ struct MultiplicityTable { multsGlobal(nGlobalTracks, multNContribsEta08_kGlobalTrackWoDCA, multNContribsEta10_kGlobalTrackWoDCA, multNContribsEta05_kGlobalTrackWoDCA); } + void processRun3MFT(soa::Join::iterator const&, + o2::aod::MFTTracks const& mftTracks, + soa::SmallGroups const& retracks) + { + int nAllTracks = 0; + int nTracks = 0; + + for (auto& track : mftTracks) { + if (track.nClusters() >= 5) { // hardcoded for now + nAllTracks++; + } + } + + if (retracks.size() > 0) { + for (auto& retrack : retracks) { + auto track = retrack.mfttrack(); + if (track.nClusters() < 5) { + continue; // min cluster requirement + } + if ((track.eta() > -2.0f) && (track.eta() < -3.9f)) { + continue; // too far to be of true interest + } + if (std::abs(retrack.bestDCAXY()) > 2.0f) { + continue; // does not point to PV properly + } + nTracks++; + } + } + mftMults(nAllTracks, nTracks); + } + // Process switches PROCESS_SWITCH(MultiplicityTable, processRun2, "Produce Run 2 multiplicity tables", false); PROCESS_SWITCH(MultiplicityTable, processRun3, "Produce Run 3 multiplicity tables", true); PROCESS_SWITCH(MultiplicityTable, processGlobalTrackingCounters, "Produce Run 3 global counters", false); PROCESS_SWITCH(MultiplicityTable, processMC, "Produce MC multiplicity tables", false); PROCESS_SWITCH(MultiplicityTable, processMC2Mults, "Produce MC -> Mult map", false); + PROCESS_SWITCH(MultiplicityTable, processRun3MFT, "Produce MFT mult tables", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From b3edfc416e61ce5f30bd796859055b3f0a2fbe84 Mon Sep 17 00:00:00 2001 From: sashingo Date: Sat, 14 Dec 2024 06:39:43 +0900 Subject: [PATCH 385/459] [PWGHF] added a function to isolation e (#8786) --- PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx | 66 +++++++++++++++++++---- 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index e86fe36813f..55f586dcbe7 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -39,9 +39,9 @@ struct HfTaskElectronWeakBoson { // configurable parameters Configurable nBinsPt{"nBinsPt", 100, "N bins in pt registry"}; - Configurable BinPtmax{"BinPtmax", 100.0, "maximum pt registry"}; + Configurable binPtmax{"binPtmax", 100.0, "maximum pt registry"}; Configurable nBinsE{"nBinsE", 100, "N bins in E registry"}; - Configurable BinEmax{"BinEmax", 100.0, "maximum E registry"}; + Configurable binEmax{"binEmax", 100.0, "maximum E registry"}; Configurable vtxZ{"vtxZ", 10.f, ""}; @@ -64,7 +64,10 @@ struct HfTaskElectronWeakBoson { Configurable timeEmcMax{"timeEmcMax", +20., "Maximum EMCcluster timing"}; Configurable m02Min{"m02Min", 0.1, "Minimum M02"}; Configurable m02Max{"m02Max", 0.9, "Maximum M02"}; - Configurable rMatchMax{"rMatchMax", 0.1, "cluster - track matching cut"}; + Configurable rMatchMax{"rMatchMax", 0.05, "cluster - track matching cut"}; + + Configurable rIsolation{"rIsolation", 0.3, "cone radius for isolation cut"}; + Configurable energyIsolationMax{"energyIsolationMax", 0.1, "isolation cut on energy"}; using SelectedClusters = o2::aod::EMCALClusters; // PbPb @@ -79,7 +82,7 @@ struct HfTaskElectronWeakBoson { Filter etafilter = (aod::track::eta < etaTrUp) && (aod::track::eta > etaTrLow); Filter dcaxyfilter = (nabs(aod::track::dcaXY) < dcaxyMax); - Filter filter_globalTr = requireGlobalTrackInFilter(); + Filter filterGlobalTr = requireGlobalTrackInFilter(); Filter clusterDefinitionSelection = (o2::aod::emcalcluster::definition == clusterDefinition) && (o2::aod::emcalcluster::time >= timeEmcMin) && (o2::aod::emcalcluster::time <= timeEmcMax) && (o2::aod::emcalcluster::m02 > m02Min) && (o2::aod::emcalcluster::m02 < m02Max); @@ -98,9 +101,9 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisZvtx{400, -20, 20, "Zvtx"}; const AxisSpec axisCounter{1, 0, 1, "events"}; const AxisSpec axisEta{200, -1.0, 1.0, "#eta"}; - const AxisSpec axisPt{nBinsPt, 0, BinPtmax, "p_{T}"}; + const AxisSpec axisPt{nBinsPt, 0, binPtmax, "p_{T}"}; const AxisSpec axisNsigma{100, -5, 5, "N#sigma"}; - const AxisSpec axisE{nBinsE, 0, BinEmax, "Energy"}; + const AxisSpec axisE{nBinsE, 0, binEmax, "Energy"}; const AxisSpec axisM02{100, 0, 1, "M02"}; const AxisSpec axisdPhi{200, -1, 1, "dPhi"}; const AxisSpec axisdEta{200, -1, 1, "dEta"}; @@ -110,6 +113,7 @@ struct HfTaskElectronWeakBoson { const AxisSpec axisCluster{100, 0.0, 200.0, "counts"}; const AxisSpec axisITSNCls{20, 0.0, 20, "counts"}; const AxisSpec axisEMCtime{200, -100.0, 100, "EMC time"}; + const AxisSpec axisIsoEnergy{100, 0, 1, "Isolation energy(GeV/C)"}; // create registrygrams registry.add("hZvtx", "Z vertex", kTH1F, {axisZvtx}); @@ -130,12 +134,47 @@ struct HfTaskElectronWeakBoson { registry.add("hMatchPhi", "Match in Phi", kTH2F, {{axisPhi}, {axisPhi}}); registry.add("hMatchEta", "Match in Eta", kTH2F, {{axisEta}, {axisEta}}); registry.add("hEop", "energy momentum match", kTH2F, {{axisPt}, {axisEop}}); + registry.add("hEopIsolation", "energy momentum match after isolation", kTH2F, {{axisPt}, {axisEop}}); registry.add("hEopNsigTPC", "Eop vs. Nsigma", kTH2F, {{axisNsigma}, {axisEop}}); registry.add("hEMCtime", "EMC timing", kTH1F, {axisEMCtime}); + registry.add("hIsolationEnergy", "Isolation Energy", kTH2F, {{axisE}, {axisIsoEnergy}}); + } + bool isIsolatedCluster(const o2::aod::EMCALCluster& cluster, + const SelectedClusters& clusters) + { + float energySum = 0.0; + float isoEnergy = 10.0; + float etaAssCluster = cluster.eta(); + float phiAssCluster = cluster.phi(); + + for (const auto& associateCluster : clusters) { + // Calculate angular distances + double dEta = associateCluster.eta() - etaAssCluster; + double dPhi = associateCluster.phi() - phiAssCluster; + + // Normalize φ difference + dPhi = RecoDecay::constrainAngle(dPhi, -o2::constants::math::PI); + + // Calculate ΔR + double deltaR = std::sqrt(dEta * dEta + dPhi * dPhi); + + // Sum energy within isolation cone + if (deltaR < rIsolation) { + energySum += associateCluster.energy(); + } + } + + if (energySum > 0) { + isoEnergy = energySum / cluster.energy() - 1.0; + } + + registry.fill(HIST("hIsolationEnergy"), cluster.energy(), isoEnergy); + + return (isoEnergy < energyIsolationMax); } void process(soa::Filtered::iterator const& collision, - SelectedClusters const&, + SelectedClusters const& emcClusters, TrackEle const& tracks, o2::aod::EMCALMatchedTracks const& matchedtracks) { @@ -210,8 +249,8 @@ struct HfTaskElectronWeakBoson { double dPhi = match.track_as().trackPhiEmcal() - phiEmc; dPhi = RecoDecay::constrainAngle(dPhi, -o2::constants::math::PI); - registry.fill(HIST("hMatchPhi"), phiEmc, match.track_as().phi()); - registry.fill(HIST("hMatchEta"), etaEmc, match.track_as().eta()); + registry.fill(HIST("hMatchPhi"), phiEmc, match.track_as().trackPhiEmcal()); + registry.fill(HIST("hMatchEta"), etaEmc, match.track_as().trackEtaEmcal()); double r = RecoDecay::sqrtSumOfSquares(dPhi, dEta); if (r < rMin) { @@ -223,9 +262,12 @@ struct HfTaskElectronWeakBoson { registry.fill(HIST("hEMCtime"), timeEmc); registry.fill(HIST("hEnergy"), energyEmc); - if (r < rMatchMax) + if (r > rMatchMax) continue; + const auto& cluster = match.emcalcluster_as(); + bool isIsolated = isIsolatedCluster(cluster, emcClusters); + double eop = energyEmc / match.track_as().p(); // LOG(info) << "E/p" << eop; registry.fill(HIST("hEopNsigTPC"), match.track_as().tpcNSigmaEl(), eop); @@ -233,6 +275,10 @@ struct HfTaskElectronWeakBoson { registry.fill(HIST("hM20"), match.track_as().tpcNSigmaEl(), m20Emc); if (match.track_as().tpcNSigmaEl() > nsigTpcMin && match.track_as().tpcNSigmaEl() < nsigTpcMax) { registry.fill(HIST("hEop"), match.track_as().pt(), eop); + + if (isIsolated) { + registry.fill(HIST("hEopIsolation"), match.track_as().pt(), eop); + } } } From 4c1acc29dc5405dfecaf20260b569479ad85c350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Sat, 14 Dec 2024 00:16:09 +0100 Subject: [PATCH 386/459] [PWGHF,Tutorial] Fix parent level options and improve argument processing (#8988) --- Tutorials/PWGHF/dpl-config_task.json | 4 +--- Tutorials/PWGHF/run_skim.sh | 21 +++++++++++------ Tutorials/PWGHF/run_task.sh | 34 +++++++++++++++++----------- 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/Tutorials/PWGHF/dpl-config_task.json b/Tutorials/PWGHF/dpl-config_task.json index 6418d9b7fc0..4e07d936675 100644 --- a/Tutorials/PWGHF/dpl-config_task.json +++ b/Tutorials/PWGHF/dpl-config_task.json @@ -8,9 +8,7 @@ "orbit-multiplier-enumeration": "0", "start-value-enumeration": "0", "end-value-enumeration": "-1", - "step-value-enumeration": "1", - "aod-parent-access-level": "1", - "aod-parent-base-path-replacement": "old-path-to-parent;new-path-to-parent" + "step-value-enumeration": "1" }, "internal-dpl-aod-spawner": "", "bc-converter": "", diff --git a/Tutorials/PWGHF/run_skim.sh b/Tutorials/PWGHF/run_skim.sh index fbd33e2b443..6adefe69b01 100644 --- a/Tutorials/PWGHF/run_skim.sh +++ b/Tutorials/PWGHF/run_skim.sh @@ -28,16 +28,23 @@ DIR_THIS="$(dirname "$(realpath "$0")")" JSON="$DIR_THIS/dpl-config_skim.json" # command line options of O2 workflows -OPTIONS="-b --configuration json://$JSON --aod-memory-rate-limit 2000000000 --shm-segment-size 16000000000 --resources-monitoring 2 --aod-writer-keep AOD/HFT2PRONG/0" +OPTIONS=( + -b + --configuration json://"$JSON" + --aod-memory-rate-limit 2000000000 + --shm-segment-size 16000000000 + --resources-monitoring 2 + --aod-writer-keep "AOD/HFT2PRONG/0" +) # execute the mini task workflow and its dependencies # shellcheck disable=SC2086 # Ignore unquoted options. -o2-analysistutorial-hf-skim-creator-mini $OPTIONS | \ -o2-analysis-timestamp $OPTIONS | \ -o2-analysis-trackselection $OPTIONS | \ -o2-analysis-track-propagation $OPTIONS | \ -o2-analysis-bc-converter $OPTIONS | \ -o2-analysis-tracks-extra-converter $OPTIONS \ +o2-analysistutorial-hf-skim-creator-mini "${OPTIONS[@]}" | \ +o2-analysis-timestamp "${OPTIONS[@]}" | \ +o2-analysis-trackselection "${OPTIONS[@]}" | \ +o2-analysis-track-propagation "${OPTIONS[@]}" | \ +o2-analysis-bc-converter "${OPTIONS[@]}" | \ +o2-analysis-tracks-extra-converter "${OPTIONS[@]}" \ > "$LOGFILE" 2>&1 # report status diff --git a/Tutorials/PWGHF/run_task.sh b/Tutorials/PWGHF/run_task.sh index 73c1c014930..de4096c2b85 100644 --- a/Tutorials/PWGHF/run_task.sh +++ b/Tutorials/PWGHF/run_task.sh @@ -28,22 +28,30 @@ DIR_THIS="$(dirname "$(realpath "$0")")" JSON="$DIR_THIS/dpl-config_task.json" # command line options of O2 workflows -OPTIONS="-b --configuration json://$JSON --aod-memory-rate-limit 2000000000 --shm-segment-size 16000000000 --resources-monitoring 2" +OPTIONS=( + -b + --configuration json://"$JSON" + --aod-memory-rate-limit 2000000000 + --shm-segment-size 16000000000 + --resources-monitoring 2 + --aod-parent-base-path-replacement "old-path-to-parent;new-path-to-parent" + --aod-parent-access-level 1 +) # execute the mini task workflow and its dependencies # shellcheck disable=SC2086 # Ignore unquoted options. -o2-analysistutorial-hf-task-mini $OPTIONS | \ -o2-analysis-timestamp $OPTIONS | \ -o2-analysis-track-propagation $OPTIONS | \ -o2-analysis-event-selection $OPTIONS | \ -o2-analysis-pid-tpc-base $OPTIONS | \ -o2-analysis-pid-tpc $OPTIONS | \ -o2-analysis-pid-tof-base $OPTIONS | \ -o2-analysis-pid-tof-full $OPTIONS | \ -o2-analysis-ft0-corrected-table $OPTIONS | \ -o2-analysis-bc-converter $OPTIONS | \ -o2-analysis-tracks-extra-converter $OPTIONS | \ -o2-analysis-zdc-converter $OPTIONS \ +o2-analysistutorial-hf-task-mini "${OPTIONS[@]}" | \ +o2-analysis-timestamp "${OPTIONS[@]}" | \ +o2-analysis-track-propagation "${OPTIONS[@]}" | \ +o2-analysis-event-selection "${OPTIONS[@]}" | \ +o2-analysis-pid-tpc-base "${OPTIONS[@]}" | \ +o2-analysis-pid-tpc "${OPTIONS[@]}" | \ +o2-analysis-pid-tof-base "${OPTIONS[@]}" | \ +o2-analysis-pid-tof-full "${OPTIONS[@]}" | \ +o2-analysis-ft0-corrected-table "${OPTIONS[@]}" | \ +o2-analysis-bc-converter "${OPTIONS[@]}" | \ +o2-analysis-tracks-extra-converter "${OPTIONS[@]}" | \ +o2-analysis-zdc-converter "${OPTIONS[@]}" \ > "$LOGFILE" 2>&1 # report status From 30b13a68ef6922dc6968772a91a8e53a3d48f270 Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Sat, 14 Dec 2024 05:29:22 +0100 Subject: [PATCH 387/459] [PWGLF,Tutorial] Add LambdaMass to Resonance Table and New Table Combination Tutorial (#8986) --- PWGLF/DataModel/LFResonanceTables.h | 1 + .../Resonances/resonanceInitializer.cxx | 1 + .../Resonances/resonanceModuleInitializer.cxx | 1 + Tutorials/PWGLF/Resonance/CMakeLists.txt | 5 + .../PWGLF/Resonance/resonancesCombine.cxx | 193 ++++++++++++++++++ 5 files changed, 201 insertions(+) create mode 100644 Tutorials/PWGLF/Resonance/resonancesCombine.cxx diff --git a/PWGLF/DataModel/LFResonanceTables.h b/PWGLF/DataModel/LFResonanceTables.h index a446b97abc0..c2a13c35270 100644 --- a/PWGLF/DataModel/LFResonanceTables.h +++ b/PWGLF/DataModel/LFResonanceTables.h @@ -370,6 +370,7 @@ DECLARE_SOA_TABLE(ResoCascades, "AOD", "RESOCASCADES", cascdata::DCAXYCascToPV, cascdata::DCAZCascToPV, cascdata::Sign, + resodaughter::MLambda, resodaughter::MXi, resodaughter::TransRadius, resodaughter::CascTransRadius, diff --git a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx index e518efc3986..202432fe061 100644 --- a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx @@ -593,6 +593,7 @@ struct ResonanceInitializer { casc.dcaXYCascToPV(), casc.dcaZCascToPV(), casc.sign(), + casc.mLambda(), casc.mXi(), casc.v0radius(), casc.cascradius(), casc.x(), casc.y(), casc.z()); if constexpr (isMC) { diff --git a/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx index 327585d6295..8b2315d219a 100644 --- a/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx @@ -1055,6 +1055,7 @@ struct ResonanceDaughterInitializer { casc.dcaXYCascToPV(), casc.dcaZCascToPV(), casc.sign(), + casc.mLambda(), casc.mXi(), casc.v0radius(), casc.cascradius(), casc.x(), casc.y(), casc.z()); if constexpr (isMC) { diff --git a/Tutorials/PWGLF/Resonance/CMakeLists.txt b/Tutorials/PWGLF/Resonance/CMakeLists.txt index 6adf9fb3247..09f58af5cd0 100644 --- a/Tutorials/PWGLF/Resonance/CMakeLists.txt +++ b/Tutorials/PWGLF/Resonance/CMakeLists.txt @@ -44,3 +44,8 @@ o2physics_add_dpl_workflow(resonances-step6 SOURCES resonances_step6.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME AnalysisTutorial) + +o2physics_add_dpl_workflow(resonances-combine + SOURCES resonancesCombine.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME AnalysisTutorial) diff --git a/Tutorials/PWGLF/Resonance/resonancesCombine.cxx b/Tutorials/PWGLF/Resonance/resonancesCombine.cxx new file mode 100644 index 00000000000..0168c140c23 --- /dev/null +++ b/Tutorials/PWGLF/Resonance/resonancesCombine.cxx @@ -0,0 +1,193 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \file resonancesCombine.cxx +/// \brief Resonance combination tutorial +/// \author Bong-Hwi Lim +/// \since 13/12/2024 + +#include +#include + +#include "CommonConstants/PhysicsConstants.h" +#include "Common/DataModel/Qvectors.h" +#include "Common/Core/EventPlaneHelper.h" +#include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/runDataProcessing.h" +#include "PWGLF/DataModel/LFResonanceTables.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +// Extract STEP +// Combine Resonance tables into other O2 tables +struct ResonanceCombine { + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // Configurable for number of bins + Configurable nBins{"nBins", 100, "N bins in all histos"}; + // Configurable for min pT cut + Configurable cMinPtcut{"cMinPtcut", 0.15, "Track minium pt cut"}; + // Configurable for event plane + Configurable cfgEvtPl{"cfgEvtPl", 40500, "Configuration of three subsystems for the event plane and its resolution, 10000*RefA + 100*RefB + S, where FT0C:0, FT0A:1, FT0M:2, FV0A:3, BPos:5, BNeg:6"}; + + // Track selection + // primary track condition + Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; + Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; + Configurable cfgPVContributor{"cfgPVContributor", true, "PV contributor track selection"}; + // DCA Selections + // DCAr to PV + Configurable cMaxDCArToPVcut{"cMaxDCArToPVcut", 0.5, "Track DCAr cut to PV Maximum"}; + // DCAz to PV + Configurable cMaxDCAzToPVcut{"cMaxDCAzToPVcut", 2.0, "Track DCAz cut to PV Maximum"}; + Configurable cMinDCAzToPVcut{"cMinDCAzToPVcut", 0.0, "Track DCAz cut to PV Minimum"}; + + // PID selection + Configurable nSigmaCutTPC{"nSigmaCutTPC", 3.0, "Value of the TPC Nsigma cut"}; + Configurable nSigmaCutTOF{"nSigmaCutTOF", 3.0, "Value of the TOF Nsigma cut"}; + + double massKa = o2::constants::physics::MassKPlus; + + EventPlaneHelper helperEP; + int evtPlRefAId = static_cast(cfgEvtPl / 10000); + int evtPlRefBId = static_cast((cfgEvtPl - evtPlRefAId * 10000) / 100); + int evtPlDetId = cfgEvtPl - evtPlRefAId * 10000 - evtPlRefBId * 100; + + void init(o2::framework::InitContext&) + { + histos.add("hVertexZ", "hVertexZ", HistType::kTH1F, {{nBins, -15., 15.}}); + histos.add("hMultiplicityPercent", "Multiplicity Percentile", kTH1F, {{120, 0.0f, 120.0f}}); + histos.add("hEvtPl", "Event Plane", kTH1F, {{100, -1.0f, 1.0f}}); + histos.add("hEta", "Eta distribution", kTH1F, {{200, -1.0f, 1.0f}}); + histos.add("hDcaxy", "Dcaxy distribution", kTH1F, {{200, -1.0f, 1.0f}}); + histos.add("hDcaz", "Dcaz distribution", kTH1F, {{200, -1.0f, 1.0f}}); + histos.add("hNsigmaKaonTPC", "NsigmaKaon TPC distribution", kTH1F, {{100, -10.0f, 10.0f}}); + histos.add("hNsigmaKaonTOF", "NsigmaKaon TOF distribution", kTH1F, {{100, -10.0f, 10.0f}}); + histos.add("hTiemResolutionTOF", "TOF time resolution", kTH1F, {{100, -10.0f, 10.0f}}); + histos.add("h1PhiInvMassUnlikeSign", "Invariant mass of Phi meson Unlike Sign", kTH1F, {{300, 0.9, 1.2}}); + histos.add("h1PhiInvMassLikeSignPP", "Invariant mass of Phi meson Like Sign positive", kTH1F, {{300, 0.9, 1.2}}); + histos.add("h1PhiInvMassLikeSignMM", "Invariant mass of Phi meson Like Sign negative", kTH1F, {{300, 0.9, 1.2}}); + histos.add("h3PhiInvMassUnlikeSign", "Invariant mass of Phi meson Unlike Sign", kTH3F, {{120, 0.0f, 120.0f}, {100, 0.0f, 10.0f}, {300, 0.9, 1.2}}); + histos.add("h3PhiInvMassLikeSignPP", "Invariant mass of Phi meson Like Sign positive", kTH3F, {{120, 0.0f, 120.0f}, {100, 0.0f, 10.0f}, {300, 0.9, 1.2}}); + histos.add("h3PhiInvMassLikeSignMM", "Invariant mass of Phi meson Like Sign negative", kTH3F, {{120, 0.0f, 120.0f}, {100, 0.0f, 10.0f}, {300, 0.9, 1.2}}); + + LOG(info) << "Size of the histograms in resonance tutorial with table combination:"; + histos.print(); + } + + template + bool trackCut(const TrackType track) + { + if (std::abs(track.pt()) < cMinPtcut) + return false; + if (std::abs(track.dcaXY()) > cMaxDCArToPVcut) + return false; + if (std::abs(track.dcaZ()) > cMaxDCAzToPVcut) + return false; + if (cfgPrimaryTrack && !track.isPrimaryTrack()) + return false; + if (cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) + return false; + if (cfgPVContributor && !track.isPVContributor()) + return false; + return true; + } + + template + bool selectionPID(const T& candidate) + { + bool tpcPass = std::abs(candidate.tpcNSigmaKa()) < nSigmaCutTPC; + bool tofPass = (candidate.hasTOF()) ? std::abs(candidate.tofNSigmaKa()) < nSigmaCutTOF : true; + if (tpcPass && tofPass) { + return true; + } + return false; + } + + double rapidity, mass, pT, paircharge; + TLorentzVector daughter1, daughter2, mother; + template + void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksType& dTracks2) + { + auto multiplicity = collision.template collision_as().cent(); + for (auto const& track1 : dTracks1) { + auto track1Reso = track1.template track_as(); + auto track1FullPidExt = track1.template track_as(); + if (!trackCut(track1Reso) || !selectionPID(track1Reso)) { + continue; + } + histos.fill(HIST("hEta"), track1Reso.eta()); + histos.fill(HIST("hDcaxy"), track1Reso.dcaXY()); + histos.fill(HIST("hDcaz"), track1Reso.dcaZ()); + histos.fill(HIST("hNsigmaKaonTPC"), track1Reso.tpcNSigmaKa()); + if (track1Reso.hasTOF()) { + histos.fill(HIST("hNsigmaKaonTOF"), track1Reso.tofNSigmaKa()); + histos.fill(HIST("hTiemResolutionTOF"), track1FullPidExt.trackTimeRes()); // TOF time resolution is not in the ResoTracks table (Important) + } + for (auto const& track2 : dTracks2) { + auto track2Reso = track2.template track_as(); + // auto track2FullPidExt = track2.template track_as(); + + if (!trackCut(track2Reso) || !selectionPID(track2Reso)) { + continue; + } + if (track2Reso.index() <= track1Reso.index()) { + continue; + } + daughter1.SetXYZM(track1Reso.px(), track1Reso.py(), track1Reso.pz(), massKa); + daughter2.SetXYZM(track2Reso.px(), track2Reso.py(), track2Reso.pz(), massKa); + mother = daughter1 + daughter2; + mass = mother.M(); + pT = mother.Pt(); + rapidity = mother.Rapidity(); + paircharge = track1Reso.sign() * track2Reso.sign(); + + if (std::abs(rapidity) > 0.5) + continue; + + if (paircharge < 0) { + histos.fill(HIST("h3PhiInvMassUnlikeSign"), multiplicity, pT, mass); + histos.fill(HIST("h1PhiInvMassUnlikeSign"), mass); + } else { + if (track1Reso.sign() > 0 && track2Reso.sign() > 0) { + histos.fill(HIST("h3PhiInvMassLikeSignPP"), multiplicity, pT, mass); + histos.fill(HIST("h1PhiInvMassLikeSignPP"), mass); + } else { + histos.fill(HIST("h3PhiInvMassLikeSignMM"), multiplicity, pT, mass); + histos.fill(HIST("h1PhiInvMassLikeSignMM"), mass); + } + } + } + } + } + + void process(soa::Join::iterator const& collision, soa::Join const& resotracks) + { + histos.fill(HIST("hVertexZ"), collision.posZ()); + // Both resoCollisions and Qvectors have the same cent column, so we have to use "_as" to access it + // Similarly, we can use "_as" to access the Qvectors table or other tables + histos.fill(HIST("hMultiplicityPercent"), collision.collision_as().cent()); + // Event plane + auto collisionQvec = collision.template collision_as(); // Qvectors table is not in the ResoCollisions table (Important) + auto evtPl = -999.0; + if (collisionQvec.qvecAmp()[evtPlDetId] > 1e-8) + evtPl = helperEP.GetEventPlane(collisionQvec.qvecRe()[evtPlDetId * 4 + 3], collisionQvec.qvecIm()[evtPlDetId * 4 + 3], 2); + if (evtPl > -999.0) + histos.fill(HIST("hEvtPl"), evtPl); + + fillHistograms(collision, resotracks, resotracks); + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 1ab57219ac36dd8096ef3445ff5f5fb56fe0958f Mon Sep 17 00:00:00 2001 From: Gyula Bencedi Date: Sat, 14 Dec 2024 08:55:48 +0100 Subject: [PATCH 388/459] [PWGLF] Removed filters for collisions (#8913) Co-authored-by: ALICE Action Bot --- PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx | 98 +++++++++++----------------- 1 file changed, 38 insertions(+), 60 deletions(-) diff --git a/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx b/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx index f1366069de8..a220811d105 100644 --- a/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx +++ b/PWGMM/Mult/Tasks/dndeta-mft-pbpb.cxx @@ -259,7 +259,7 @@ struct PseudorapidityDensityMFT { {HistType::kTH3F, {PhiAxis, EtaAxis, CentAxis}}}); QAregistry.add({"Events/Centrality/hcentFT0C", " ; cent FT0C", - {HistType::kTH1F, {{1000, 0, 100}}}, + {HistType::kTH1F, {CentAxis}}, true}); QAregistry.add( {"Tracks/Centrality/Chi2Eta", @@ -505,11 +505,6 @@ struct PseudorapidityDensityMFT { } } - /// Filters - collision - Filter filterCollCent = nabs(aod::cent::centFT0C) < cfgCutCent; - Filter filterCollZvtx = nabs(aod::collision::posZ) < cfgCutZvtx; - Filter filterMcCollZvtx = nabs(aod::mccollision::posZ) < cfgCutZvtx; - /// Filters - tracks Filter filtTrkEta = (aod::fwdtrack::eta < trkcuts.cfg_eta_max) && (aod::fwdtrack::eta > trkcuts.cfg_eta_min); @@ -536,28 +531,9 @@ struct PseudorapidityDensityMFT { using MFTTracksLabeled = soa::Join; /// Filtered tables - using filtColls = soa::Filtered>; - using filtColl = - soa::Filtered>::iterator; - using filtCollsCent = - soa::Filtered>; - using filtCollCent = soa::Filtered< - soa::Join>::iterator; - using CollsGenCentSmallG = - o2::soa::SmallGroups>; - using filtCollsGenCentSmallG = - soa::SmallGroups>; - using filtCollsGenCent = - soa::Filtered>; - using filtMcGenColls = soa::Filtered; - using filtMcGenColl = soa::Filtered::iterator; using filtMftTracks = soa::Filtered; using filtMcMftTracks = soa::Filtered; using filtBestTracks = soa::Filtered; - using filtBestTracksJ = - soa::Filtered>; using filtParticles = soa::Filtered; template @@ -921,20 +897,20 @@ struct PseudorapidityDensityMFT { } /// @brief process fnc. to run on DATA and REC MC w/o centrality selection - void processDataInclusive(filtColls::iterator const& collision, + void processDataInclusive(Colls::iterator const& collision, filtMftTracks const& tracks) { - processData(collision, tracks); + processData(collision, tracks); } PROCESS_SWITCH(PseudorapidityDensityMFT, processDataInclusive, "Count tracks", false); /// @brief process fnc. to run on DATA and REC MC w/ FT0C centrality selection - void processDataCent(filtCollsCent::iterator const& collision, + void processDataCent(CollsCent::iterator const& collision, filtMftTracks const& tracks) { - processData(collision, tracks); + processData(collision, tracks); } PROCESS_SWITCH(PseudorapidityDensityMFT, processDataCent, @@ -943,10 +919,10 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on DATA and REC MC based on BestCollisionsFwd /// table w/o centrality selection void processDatawBestTracksInclusive( - filtColls::iterator const& collision, filtMftTracks const& tracks, + Colls::iterator const& collision, filtMftTracks const& tracks, soa::SmallGroups const& besttracks) { - processDatawBestTracks(collision, tracks, besttracks); + processDatawBestTracks(collision, tracks, besttracks); } PROCESS_SWITCH(PseudorapidityDensityMFT, processDatawBestTracksInclusive, @@ -955,10 +931,10 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on DATA and REC MC based on BestCollisionsFwd /// table w/ FT0C centrality selection void processDatawBestTracksCent( - filtCollsCent::iterator const& collision, filtMftTracks const& tracks, + CollsCent::iterator const& collision, filtMftTracks const& tracks, soa::SmallGroups const& besttracks) { - processDatawBestTracks(collision, tracks, besttracks); + processDatawBestTracks(collision, tracks, besttracks); } PROCESS_SWITCH(PseudorapidityDensityMFT, processDatawBestTracksCent, @@ -1077,12 +1053,12 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on MC w/o centrality selection void processMCInclusive( - filtMcGenColls::iterator const& mccollision, - soa::SmallGroups> const& collisions, + aod::McCollisions::iterator const& mccollision, + soa::SmallGroups> const& collisions, filtParticles const& particles, filtMcMftTracks const& tracks) { - processMC(mccollision, collisions, particles, - tracks); + processMC(mccollision, collisions, particles, + tracks); } PROCESS_SWITCH(PseudorapidityDensityMFT, processMCInclusive, @@ -1090,12 +1066,12 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on MC w FT0C centrality selection void processMCCent( - filtMcGenColls::iterator const& mccollision, - soa::SmallGroups> const& collisions, + aod::McCollisions::iterator const& mccollision, + soa::SmallGroups> const& collisions, filtParticles const& particles, filtMcMftTracks const& tracks) { - processMC(mccollision, collisions, particles, - tracks); + processMC(mccollision, collisions, particles, + tracks); } PROCESS_SWITCH(PseudorapidityDensityMFT, processMCCent, @@ -1189,14 +1165,14 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on MC (inclusive, using aod::BestCollisionsFwd /// tracks) void processMCwBestTracksInclusive( - filtMcGenColls::iterator const& mccollision, - soa::SmallGroups> const& collisions, + aod::McCollisions::iterator const& mccollision, + soa::SmallGroups> const& collisions, filtParticles const& particles, filtMcMftTracks const& tracks, // aod::BestCollisionsFwd const // &besttracks filtBestTracks const& besttracks) { - processMCwBestTracks( + processMCwBestTracks( mccollision, collisions, particles, tracks, besttracks); } @@ -1206,12 +1182,12 @@ struct PseudorapidityDensityMFT { /// @brief process fnc. to run on MC (FT0C centrality, using /// aod::BestCollisionsFwd tracks) void processMCwBestTracksCent( - filtMcGenColls::iterator const& mccollision, - soa::SmallGroups> const& collisions, + aod::McCollisions::iterator const& mccollision, + soa::SmallGroups> const& collisions, filtParticles const& particles, filtMcMftTracks const& tracks, filtBestTracks const& besttracks) { - processMCwBestTracks( + processMCwBestTracks( mccollision, collisions, particles, tracks, besttracks); } @@ -1463,18 +1439,21 @@ struct PseudorapidityDensityMFT { template void processMcQA( typename soa::SmallGroups> const& collisions, - filtMcGenColls const& mcCollisions, filtParticles const& /*particles*/, - MFTTracksLabeled const& tracks, aod::AmbiguousMFTTracks const& atracks) + aod::McCollisions const& mcCollisions, + filtParticles const& /*particles*/, MFTTracksLabeled const& tracks, + aod::AmbiguousMFTTracks const& atracks) { for (const auto& collision : collisions) { float c_rec = -1; if constexpr (C::template contains()) { c_rec = collision.centFT0C(); - QAregistry.fill(HIST("Events/Centrality/hRecPerGenColls"), - static_cast(collisions.size()) / mcCollisions.size(), c_rec); + QAregistry.fill( + HIST("Events/Centrality/hRecPerGenColls"), + static_cast(collisions.size()) / mcCollisions.size(), c_rec); } else { QAregistry.fill(HIST("Events/hRecPerGenColls"), - static_cast(collisions.size()) / mcCollisions.size()); + static_cast(collisions.size()) / + mcCollisions.size()); } if (!isGoodEvent(collision)) { @@ -1506,12 +1485,11 @@ struct PseudorapidityDensityMFT { /// @brief process function for QA checks (inclusive) void processMcQAInclusive( - soa::SmallGroups> const& collisions, - filtMcGenColls const& mcCollisions, filtParticles const& particles, + soa::SmallGroups> const& collisions, + aod::McCollisions const& mcCollisions, filtParticles const& particles, MFTTracksLabeled const& tracks, aod::AmbiguousMFTTracks const& atracks) { - processMcQA(collisions, mcCollisions, particles, tracks, - atracks); + processMcQA(collisions, mcCollisions, particles, tracks, atracks); } PROCESS_SWITCH(PseudorapidityDensityMFT, processMcQAInclusive, @@ -1519,12 +1497,12 @@ struct PseudorapidityDensityMFT { /// @brief process function for QA checks (in FT0 bins) void processMcQACent( - soa::SmallGroups> const& collisions, - filtMcGenColls const& mcCollisions, filtParticles const& particles, + soa::SmallGroups> const& collisions, + aod::McCollisions const& mcCollisions, filtParticles const& particles, MFTTracksLabeled const& tracks, aod::AmbiguousMFTTracks const& atracks) { - processMcQA(collisions, mcCollisions, particles, tracks, - atracks); + processMcQA(collisions, mcCollisions, particles, tracks, + atracks); } PROCESS_SWITCH(PseudorapidityDensityMFT, processMcQACent, From 21acbc42e1014a87fe0502ff87e11b7ffbdf1090 Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Sat, 14 Dec 2024 11:15:45 +0100 Subject: [PATCH 389/459] [PWGDQ] Adding correct Flow checks (#8989) --- PWGDQ/Core/VarManager.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 6a2443dc3bb..50755cd301c 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -4350,14 +4350,14 @@ void VarManager::FillPairVn(T1 const& t1, T2 const& t2, float* values) values[kM0111POI] = values[kMultDimuons] * (values[kS31A] - 3. * values[kS11A] * values[kS12A] + 2. * values[kS13A]); values[kCORR2POI] = (P2 * conj(Q21)).real() / values[kM01POI]; values[kCORR4POI] = (P2 * Q21 * conj(Q21) * conj(Q21) - P2 * Q21 * conj(Q42) - 2. * values[kS12A] * P2 * conj(Q21) + 2. * P2 * conj(Q23)).real() / values[kM0111POI]; - values[kM01POIoverMp] = values[kMultDimuons] > 0 && !(std::isnan(values[kM01POI]) || std::isinf(values[kM01POI])) ? values[kM01POI] / values[kMultDimuons] : 0; - values[kM0111POIoverMp] = values[kMultDimuons] > 0 && !(std::isnan(values[kM0111POI]) || std::isinf(values[kM0111POI])) ? values[kM0111POI] / values[kMultDimuons] : 0; - values[kM11REFoverMp] = values[kMultDimuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF])) ? values[kM11REF] / values[kMultDimuons] : 0; - values[kM1111REFoverMp] = values[kMultDimuons] > 0 && !(std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF])) ? values[kM1111REF] / values[kMultDimuons] : 0; - values[kCORR2POIMp] = std::isnan(values[kCORR2POI]) || std::isinf(values[kCORR2POI]) ? 0 : values[kCORR2POI] * values[kMultDimuons]; - values[kCORR4POIMp] = std::isnan(values[kCORR4POI]) || std::isinf(values[kCORR4POI]) ? 0 : values[kCORR4POI] * values[kMultDimuons]; - values[kCORR2REF] = std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) ? 0 : values[kCORR2REF]; - values[kCORR4REF] = std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kCORR4REF]; + values[kM01POIoverMp] = values[kMultDimuons] > 0 && !(std::isnan(values[kM01POI]) || std::isinf(values[kM01POI]) || std::isnan(values[kCORR2POI]) || std::isinf(values[kCORR2POI])) ? values[kM01POI] / values[kMultDimuons] : 0; + values[kM0111POIoverMp] = values[kMultDimuons] > 0 && !(std::isnan(values[kM0111POI]) || std::isinf(values[kM0111POI]) || std::isnan(values[kCORR4POI]) || std::isinf(values[kCORR4POI])) ? values[kM0111POI] / values[kMultDimuons] : 0; + values[kM11REFoverMp] = values[kMultDimuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF])) ? values[kM11REF] / values[kMultDimuons] : 0; + values[kM1111REFoverMp] = values[kMultDimuons] > 0 && !(std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF])) ? values[kM1111REF] / values[kMultDimuons] : 0; + values[kCORR2POIMp] = std::isnan(values[kCORR2POI]) || std::isinf(values[kCORR2POI]) || std::isnan(values[kM01POI]) || std::isinf(values[kM01POI]) ? 0 : values[kCORR2POI] * values[kMultDimuons]; + values[kCORR4POIMp] = std::isnan(values[kCORR4POI]) || std::isinf(values[kCORR4POI]) || std::isnan(values[kM0111POI]) || std::isinf(values[kM0111POI]) ? 0 : values[kCORR4POI] * values[kMultDimuons]; + values[kCORR2REF] = std::isnan(values[kM11REFoverMp]) || std::isinf(values[kM11REFoverMp]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) ? 0 : values[kCORR2REF]; + values[kCORR4REF] = std::isnan(values[kM1111REFoverMp]) || std::isinf(values[kM1111REFoverMp]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kCORR4REF]; } ROOT::Math::PtEtaPhiMVector v1_vp(v1.Pt(), v1.Eta(), v1.Phi() - Psi2B, v1.M()); From ebb0e15811aae8f6a6613a59ed7299ebe0e5f286 Mon Sep 17 00:00:00 2001 From: Anantha Padmanabhan M Nair <82643666+ananthapadmanabhan18@users.noreply.github.com> Date: Sat, 14 Dec 2024 15:46:47 +0530 Subject: [PATCH 390/459] [PWGUD] Resonance analysis of rho' and 4-pi pair angular distributions. (#8994) --- PWGUD/Tasks/CMakeLists.txt | 5 + PWGUD/Tasks/exclusiveRhoTo4Pi.cxx | 351 ++++++++++++++++++++++++++++++ 2 files changed, 356 insertions(+) create mode 100644 PWGUD/Tasks/exclusiveRhoTo4Pi.cxx diff --git a/PWGUD/Tasks/CMakeLists.txt b/PWGUD/Tasks/CMakeLists.txt index a0f1eb17747..51eacc89534 100644 --- a/PWGUD/Tasks/CMakeLists.txt +++ b/PWGUD/Tasks/CMakeLists.txt @@ -212,3 +212,8 @@ o2physics_add_dpl_workflow(event-by-event SOURCES eventByevent.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::DGPIDSelector COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(exclusive-rho-to-four-pi + SOURCES exclusiveRhoTo4Pi.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::DGPIDSelector + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx b/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx new file mode 100644 index 00000000000..9d4cc4ca728 --- /dev/null +++ b/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx @@ -0,0 +1,351 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +// \Single Gap Event Analyzer +// \author Anantha Padmanabhan M Nair, anantha.manoj.nair@cern.ch +// \since May 2024 + +#include +#include +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoA.h" +#include "Framework/ASoAHelpers.h" +#include "PWGUD/DataModel/UDTables.h" +#include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/SGTrackSelector.h" +#include "Common/DataModel/PIDResponse.h" +#include +#include "TLorentzVector.h" +#include +#include "Math/Vector4D.h" +#include "Math/Vector3D.h" +#include "Math/GenVector/Boost.h" + +using namespace std; +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::framework::expressions; + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +struct UPCAnalysis { + SGSelector sgSelector; + HistogramRegistry histos{"HistoReg", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Configurable FV0_cut{"FV0", 50., "FV0A threshold"}; + Configurable FT0A_cut{"FT0A", 150., "FT0A threshold"}; + Configurable FT0C_cut{"FT0C", 50., "FT0C threshold"}; + Configurable FDDA_cut{"FDDA", 10000., "FDDA threshold"}; + Configurable FDDC_cut{"FDDC", 10000., "FDDC threshold"}; + Configurable ZDC_cut{"ZDC", 10., "ZDC threshold"}; + + Configurable PV_cut{"PV_cut", 1.0, "Use Only PV tracks"}; + Configurable dcaZ_cut{"dcaZ_cut", 3.2, "dcaZ cut"}; + Configurable dcaXY_cut{"dcaXY_cut", 2.4, "dcaXY cut (0 for Pt-function)"}; + Configurable tpcChi2_cut{"tpcChi2_cut", 4, "Max tpcChi2NCl"}; + Configurable tpcNClsFindable_cut{"tpcNClsFindable_cut", 80, "Min tpcNClsFindable"}; + Configurable itsChi2_cut{"itsChi2_cut", 36, "Max itsChi2NCl"}; + Configurable eta_cut{"eta_cut", 0.9, "Track Pseudorapidity"}; + Configurable pt_cut{"pt_cut", 0, "Track Pt"}; + + Configurable nSigmaTPC_cut{"nsigmatpccut", 3, "TPC cut"}; + Configurable nSigmaTOF_cut{"nsigmatofcut", 3, "TOF cut"}; + Configurable StrictEventSelection{"StrictEventSelection", true, "Event Selection"}; + //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + // Begin of Init Function----------------------------------------------------------------------------------------------------------------------------------------------------- + void init(InitContext const&) + { + + histos.add("GapSide", "Gap Side; Events", kTH1F, {{4, -1.5, 2.5}}); + histos.add("TrueGapSide", "Gap Side; Events", kTH1F, {{4, -1.5, 2.5}}); + histos.add("EventCounts", "Total Events; Events", kTH1F, {{10, 0, 10}}); // 2=#Events, 3= #Selected Events, 5=#Selected Events with Zero Net charge, 6=Selected Events with Non-Zero Net charge + + // TPC nSigma + histos.add("tpcNSigmaPi_WOTS", "TPC nSigma Pion without track selection; Events", kTH1F, {{100, -15, 15}}); + histos.add("tpcNSigmaPi_WTS", "TPC nSigma Pion with track selection; Events", kTH1F, {{100, -15, 15}}); + histos.add("tpcNSigmaPi_WTS_PID_Pi", "TPC nSigma Pion with track selection and PID Selection of Pi; Entries", kTH1F, {{100, -15, 15}}); + + // TOF nSigma + histos.add("tofNSigmaPi_WTS", "TOF nSigma Pion with track selection; Events", kTH1F, {{100, -15, 15}}); + histos.add("tofNSigmaPi_WOTS", "TOF nSigma Pion without track selection; Events", kTH1F, {{100, -15, 15}}); + histos.add("tofNSigmaPi_WTS_PID_Pi", "TOF nSigma Pion with track selection and PID Selection of Pi; Entries", kTH1F, {{100, -15, 15}}); + + // Track Transverse Momentum + histos.add("pT_track_WOTS", "pT without track selection; pT [GeV/c]; Events", kTH1F, {{100, 0, 2}}); + histos.add("pT_track_WTS", "pT with track selection; pT [GeV/c]; Events", kTH1F, {{100, 0, 2}}); + histos.add("pT_track_WTS_PID_Pi", "pT with track selection and PID selection of Pi; pT [GeV/c]; Events", kTH1F, {{100, 0, 2}}); + + // Zero charge Event Transverse Momentum + histos.add("pT_event_0charge_WTS_PID_Pi", "Event pT in 0 Charge Events With Track Selection and PID Selection of Pi; pT [GeV/c]; Counts", kTH1F, {{100, 0, 2}}); + + // Non Zero charge Event Transverse Momentum + histos.add("pT_event_non0charge_WTS_PID_Pi", "Event pT in Non 0 Charge Events With Track Selection and PID Selection of Pi; pT [GeV/c]; Counts", kTH1F, {{100, 0, 2}}); + + // Rapidity of 0 charge Events + histos.add("rapidity_event_0charge_WTS_PID_Pi", "Rapidity of Events With Track Selection and PID Selection of Pi; y; Counts", kTH1F, {{100, -2.5, 2.5}}); + + // Rapidity of non 0 charge Events + histos.add("rapidity_event_non0charge_WTS_PID_Pi", "Rapidity of Events With Track Selection and PID Selection of Pi; y; Counts", kTH1F, {{100, -2.5, 2.5}}); + + // Invariant Mass of 0 charge events + histos.add("invMass_event_0charge_WTS_PID_Pi", "Invariant Mass Distribution of 0 charge Events with PID Selection of Pi; m(#pi^{+}#pi^{-}#pi^{+}#pi^{-}) [GeV/c]", kTH1F, {{1000, 0.8, 2.5}}); + + // Invariant mass of non 0 charge events + histos.add("invMass_event_non0charge_WTS_PID_Pi", "Invariant Mass Distribution of non 0 charge Events with PID Selection of Pi; m(#pi^{+}#Pi^{-}#pi^{+}#pi^{-}) [GeV/c]", kTH1F, {{1000, 0.8, 2.5}}); + + // tpc signal + histos.add("tpcSignal", "TPC dEdx vs p; p [GeV/c]; dEdx [a.u.]", kTH2F, {{500, 0, 10}, {5000, 0.0, 5000.0}}); + histos.add("tpcSignal_Pi", "TPC dEdx vs p for pions; p [GeV/c]; dEdx [a.u.]", kTH2F, {{500, 0, 10}, {5000, 0.0, 5000.0}}); + + // tof beta + histos.add("tofBeta", "TOF beta vs p; p [GeV/c]; #beta", kTH2F, {{500, 0, 10}, {500, 0.0, 1.0}}); + histos.add("tofBeta_Pi", "TOF beta vs p for pions; p [GeV/c]; #beta", kTH2F, {{500, 0, 10}, {500, 0.0, 1.0}}); + + // Other signals + histos.add("FT0A", "T0A amplitude", kTH1F, {{200, 0.0, 500.0}}); + histos.add("FT0C", "T0C amplitude", kTH1F, {{200, 0.0, 500.0}}); + histos.add("ZDC_A", "ZDC amplitude", kTH1F, {{1000, 0.0, 15}}); + histos.add("ZDC_C", "ZDC amplitude", kTH1F, {{1000, 0.0, 15}}); + histos.add("V0A", "V0A amplitude", kTH1F, {{1000, 0.0, 100}}); + + // Collin Soper Theta and Phi + histos.add("CS_phi", "#phi Distribution; #phi; Entries", kTH1F, {{200, -3.2, 3.2}}); + histos.add("CS_costheta", "#theta Distribution;cos(#theta); Entries", kTH1F, {{200, -1, 1}}); + + } // End of init function + //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + using udtracks = soa::Join; + using udtracksfull = soa::Join; + using UDCollisionsFull = soa::Join; // + using UDCollisionFull = UDCollisionsFull::iterator; + //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + // Calculate the Collins-Soper Frame---------------------------------------------------------------------------------------------------------------------------- + Double_t CosThetaCollinsSoperFrame(ROOT::Math::PtEtaPhiMVector pair1, ROOT::Math::PtEtaPhiMVector pair2, ROOT::Math::PtEtaPhiMVector fourpion) + { + Double_t HalfSqrtSnn = 2680.; + Double_t MassOfLead208 = 193.6823; + Double_t MomentumBeam = TMath::Sqrt(HalfSqrtSnn * HalfSqrtSnn * 208 * 208 - MassOfLead208 * MassOfLead208); + + TLorentzVector pProjCM(0., 0., -MomentumBeam, HalfSqrtSnn * 208); // projectile + TLorentzVector pTargCM(0., 0., MomentumBeam, HalfSqrtSnn * 208); // target + + // TVector3 beta = (-1. / fourpion.E()) * fourpion.Vect(); + ROOT::Math::PtEtaPhiMVector v1 = pair1; + ROOT::Math::PtEtaPhiMVector v2 = pair2; + ROOT::Math::PtEtaPhiMVector v12 = fourpion; + + // Boost to center of mass frame + ROOT::Math::Boost boostv12{v12.BoostToCM()}; + ROOT::Math::XYZVectorF v1_CM{(boostv12(v1).Vect()).Unit()}; + ROOT::Math::XYZVectorF v2_CM{(boostv12(v2).Vect()).Unit()}; + ROOT::Math::XYZVectorF Beam1_CM{(boostv12(pProjCM).Vect()).Unit()}; + ROOT::Math::XYZVectorF Beam2_CM{(boostv12(pTargCM).Vect()).Unit()}; + + // Axes + ROOT::Math::XYZVectorF zaxis_CS{((Beam1_CM.Unit() - Beam2_CM.Unit()).Unit())}; + + Double_t CosThetaCS = zaxis_CS.Dot((v1_CM)); + return CosThetaCS; + } // End of CosThetaCollinsSoperFrame function------------------------------------------------------------------------------------------------------------------------ + + // Calculate Phi in Collins-Soper Frame------------------------------------------------------------------------------------------------------------------------ + Double_t PhiCollinsSoperFrame(ROOT::Math::PtEtaPhiMVector pair1, ROOT::Math::PtEtaPhiMVector pair2, ROOT::Math::PtEtaPhiMVector fourpion) + { + // Half of the energy per pair of the colliding nucleons. + Double_t HalfSqrtSnn = 2680.; + Double_t MassOfLead208 = 193.6823; + Double_t MomentumBeam = TMath::Sqrt(HalfSqrtSnn * HalfSqrtSnn * 208 * 208 - MassOfLead208 * MassOfLead208); + + TLorentzVector pProjCM(0., 0., -MomentumBeam, HalfSqrtSnn * 208); // projectile + TLorentzVector pTargCM(0., 0., MomentumBeam, HalfSqrtSnn * 208); // target + ROOT::Math::PtEtaPhiMVector v1 = pair1; + ROOT::Math::PtEtaPhiMVector v2 = pair2; + ROOT::Math::PtEtaPhiMVector v12 = fourpion; + // Boost to center of mass frame + ROOT::Math::Boost boostv12{v12.BoostToCM()}; + ROOT::Math::XYZVectorF v1_CM{(boostv12(v1).Vect()).Unit()}; + ROOT::Math::XYZVectorF v2_CM{(boostv12(v2).Vect()).Unit()}; + ROOT::Math::XYZVectorF Beam1_CM{(boostv12(pProjCM).Vect()).Unit()}; + ROOT::Math::XYZVectorF Beam2_CM{(boostv12(pTargCM).Vect()).Unit()}; + // Axes + ROOT::Math::XYZVectorF zaxis_CS{((Beam1_CM.Unit() - Beam2_CM.Unit()).Unit())}; + ROOT::Math::XYZVectorF yaxis_CS{(Beam1_CM.Cross(Beam2_CM)).Unit()}; + ROOT::Math::XYZVectorF xaxis_CS{(yaxis_CS.Cross(zaxis_CS)).Unit()}; + + Double_t phi = TMath::ATan2(yaxis_CS.Dot(v1_CM), xaxis_CS.Dot(v1_CM)); + return phi; + } // End of PhiCollinsSoperFrame function------------------------------------------------------------------------------------------------------------------------ + + // Begin of Process function-------------------------------------------------------------------------------------------------------------------------------------------------- + void process(UDCollisionFull const& collision, udtracksfull const& tracks) + { + + int gapSide = collision.gapSide(); + float FIT_cut[5] = {FV0_cut, FT0A_cut, FT0C_cut, FDDA_cut, FDDC_cut}; + std::vector parameters = {PV_cut, dcaZ_cut, dcaXY_cut, tpcChi2_cut, tpcNClsFindable_cut, itsChi2_cut, eta_cut, pt_cut}; + int truegapSide = sgSelector.trueGap(collision, FIT_cut[0], FIT_cut[1], FIT_cut[2], ZDC_cut); + histos.fill(HIST("GapSide"), gapSide); + histos.fill(HIST("TrueGapSide"), truegapSide); + histos.fill(HIST("EventCounts"), 1); + gapSide = truegapSide; + + if ((gapSide != 2)) { + return; + } + + histos.fill(HIST("V0A"), collision.totalFV0AmplitudeA()); + histos.fill(HIST("FT0A"), collision.totalFT0AmplitudeA()); + histos.fill(HIST("FT0C"), collision.totalFT0AmplitudeC()); + histos.fill(HIST("ZDC_A"), collision.energyCommonZNA()); + histos.fill(HIST("ZDC_C"), collision.energyCommonZNC()); + + if (StrictEventSelection) { + if (collision.numContrib() != 4) { + return; + } + } else { + if (collision.numContrib() >= 10) { + return; + } + } + + std::vector WOTS_tracks; + std::vector WTS_tracks; + std::vector WTS_PID_Pi_tracks; + std::vector Pi_plus_tracks; + std::vector Pi_minus_tracks; + + for (auto& t0 : tracks) { + + WOTS_tracks.push_back(t0); + + if (trackselector(t0, parameters)) { + WTS_tracks.push_back(t0); + + if (selectionPIDPion(t0, true, nSigmaTPC_cut, nSigmaTOF_cut)) { + WTS_PID_Pi_tracks.push_back(t0); + if (t0.sign() == 1) { + Pi_plus_tracks.push_back(t0); + } + if (t0.sign() == -1) { + Pi_minus_tracks.push_back(t0); + } + } // End of Selection PID Pion + + } // End of track selections + + } // End of loop over tracks + + int len_WOTS = static_cast(WOTS_tracks.size()); + int len_WTS = static_cast(WTS_tracks.size()); + int len_WTS_PID_Pi = static_cast(WTS_PID_Pi_tracks.size()); + int len_Pi_plus = static_cast(Pi_plus_tracks.size()); + int len_Pi_minus = static_cast(Pi_minus_tracks.size()); + + for (int i = 0; i < len_WOTS; i++) { + histos.fill(HIST("tpcNSigmaPi_WOTS"), WOTS_tracks[i].tpcNSigmaPi()); + histos.fill(HIST("tofNSigmaPi_WOTS"), WOTS_tracks[i].tofNSigmaPi()); + histos.fill(HIST("pT_track_WOTS"), TMath::Sqrt(WOTS_tracks[i].px() * WOTS_tracks[i].px() + WOTS_tracks[i].py() * WOTS_tracks[i].py())); + } // End of loop over tracks without selection + + for (int i = 0; i < len_WTS; i++) { + + histos.fill(HIST("tpcSignal"), TMath::Sqrt(WTS_tracks[i].px() * WTS_tracks[i].px() + WTS_tracks[i].py() * WTS_tracks[i].py() + WTS_tracks[i].pz() * WTS_tracks[i].pz()), WTS_tracks[i].tpcSignal()); + histos.fill(HIST("tofBeta"), TMath::Sqrt(WTS_tracks[i].px() * WTS_tracks[i].px() + WTS_tracks[i].py() * WTS_tracks[i].py() + WTS_tracks[i].pz() * WTS_tracks[i].pz()), WTS_tracks[i].beta()); + histos.fill(HIST("tpcNSigmaPi_WTS"), WTS_tracks[i].tpcNSigmaPi()); + histos.fill(HIST("tofNSigmaPi_WTS"), WTS_tracks[i].tofNSigmaPi()); + histos.fill(HIST("pT_track_WTS"), TMath::Sqrt(WTS_tracks[i].px() * WTS_tracks[i].px() + WTS_tracks[i].py() * WTS_tracks[i].py())); + } // End of loop over tracks with selection only + + for (int i = 0; i < len_WTS_PID_Pi; i++) { + + histos.fill(HIST("tpcSignal_Pi"), TMath::Sqrt(WTS_PID_Pi_tracks[i].px() * WTS_PID_Pi_tracks[i].px() + WTS_PID_Pi_tracks[i].py() * WTS_PID_Pi_tracks[i].py() + WTS_PID_Pi_tracks[i].pz() * WTS_PID_Pi_tracks[i].pz()), WTS_PID_Pi_tracks[i].tpcSignal()); + histos.fill(HIST("tofBeta_Pi"), TMath::Sqrt(WTS_PID_Pi_tracks[i].px() * WTS_PID_Pi_tracks[i].px() + WTS_PID_Pi_tracks[i].py() * WTS_PID_Pi_tracks[i].py() + WTS_PID_Pi_tracks[i].pz() * WTS_PID_Pi_tracks[i].pz()), WTS_PID_Pi_tracks[i].beta()); + histos.fill(HIST("tpcNSigmaPi_WTS_PID_Pi"), WTS_PID_Pi_tracks[i].tpcNSigmaPi()); + histos.fill(HIST("tofNSigmaPi_WTS_PID_Pi"), WTS_PID_Pi_tracks[i].tofNSigmaPi()); + histos.fill(HIST("pT_track_WTS_PID_Pi"), TMath::Sqrt(WTS_PID_Pi_tracks[i].px() * WTS_PID_Pi_tracks[i].px() + WTS_PID_Pi_tracks[i].py() * WTS_PID_Pi_tracks[i].py())); + } // End of loop over tracks with selection and PID selection of Pions + + if (len_WTS_PID_Pi != 4) { + return; + } + + if (len_Pi_minus == 2 && len_Pi_plus == 2) { + + TLorentzVector p1, p2, p3, p4, p1234; + ROOT::Math::PtEtaPhiMVector k1, k2, k3, k4, k1234, k13, k14, k23, k24; + + p1.SetXYZM(Pi_plus_tracks[0].px(), Pi_plus_tracks[0].py(), Pi_plus_tracks[0].pz(), o2::constants::physics::MassPionCharged); + p2.SetXYZM(Pi_plus_tracks[1].px(), Pi_plus_tracks[1].py(), Pi_plus_tracks[1].pz(), o2::constants::physics::MassPionCharged); + p3.SetXYZM(Pi_minus_tracks[0].px(), Pi_minus_tracks[0].py(), Pi_minus_tracks[0].pz(), o2::constants::physics::MassPionCharged); + p4.SetXYZM(Pi_minus_tracks[1].px(), Pi_minus_tracks[1].py(), Pi_minus_tracks[1].pz(), o2::constants::physics::MassPionCharged); + + k1.SetCoordinates(p1.Pt(), p1.Eta(), p1.Phi(), o2::constants::physics::MassPionCharged); + k2.SetCoordinates(p2.Pt(), p2.Eta(), p2.Phi(), o2::constants::physics::MassPionCharged); + k3.SetCoordinates(p3.Pt(), p3.Eta(), p3.Phi(), o2::constants::physics::MassPionCharged); + k4.SetCoordinates(p4.Pt(), p4.Eta(), p4.Phi(), o2::constants::physics::MassPionCharged); + + p1234 = p1 + p2 + p3 + p4; + k1234 = k1 + k2 + k3 + k4; + + k13 = k1 + k3; + k14 = k1 + k4; + k23 = k2 + k3; + k24 = k2 + k4; + + auto phi_pair_1 = PhiCollinsSoperFrame(k13, k24, k1234); + auto phi_pair_2 = PhiCollinsSoperFrame(k14, k23, k1234); + auto cos_theta_1 = CosThetaCollinsSoperFrame(k13, k24, k1234); + auto cos_theta_2 = CosThetaCollinsSoperFrame(k14, k23, k1234); + + histos.fill(HIST("pT_event_0charge_WTS_PID_Pi"), p1234.Pt()); + histos.fill(HIST("rapidity_event_0charge_WTS_PID_Pi"), p1234.Rapidity()); + histos.fill(HIST("invMass_event_0charge_WTS_PID_Pi"), p1234.M()); + histos.fill(HIST("CS_phi"), phi_pair_1); + histos.fill(HIST("CS_phi"), phi_pair_2); + histos.fill(HIST("CS_costheta"), cos_theta_1); + histos.fill(HIST("CS_costheta"), cos_theta_2); + + } // End of Analysis for 0 charge events + + if (len_Pi_minus != 2 && len_Pi_plus != 2) { + + TLorentzVector p1, p2, p3, p4, p1234; + p1.SetXYZM(WTS_PID_Pi_tracks[0].px(), WTS_PID_Pi_tracks[0].py(), WTS_PID_Pi_tracks[0].pz(), o2::constants::physics::MassPionCharged); + p2.SetXYZM(WTS_PID_Pi_tracks[1].px(), WTS_PID_Pi_tracks[1].py(), WTS_PID_Pi_tracks[1].pz(), o2::constants::physics::MassPionCharged); + p3.SetXYZM(WTS_PID_Pi_tracks[2].px(), WTS_PID_Pi_tracks[2].py(), WTS_PID_Pi_tracks[2].pz(), o2::constants::physics::MassPionCharged); + p4.SetXYZM(WTS_PID_Pi_tracks[3].px(), WTS_PID_Pi_tracks[3].py(), WTS_PID_Pi_tracks[3].pz(), o2::constants::physics::MassPionCharged); + + p1234 = p1 + p2 + p3 + p4; + + histos.fill(HIST("pT_event_non0charge_WTS_PID_Pi"), p1234.Pt()); + histos.fill(HIST("rapidity_event_non0charge_WTS_PID_Pi"), p1234.Rapidity()); + histos.fill(HIST("invMass_event_non0charge_WTS_PID_Pi"), p1234.M()); + + } // End of Analysis for non 0 charge events + + } // End of process function + //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +}; // End of Struct UPCAnalysis +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 33c144df300fc9af8f688ff490cb1080aa85e668 Mon Sep 17 00:00:00 2001 From: Zuzanna Chochulska <87480906+zchochul@users.noreply.github.com> Date: Sat, 14 Dec 2024 13:53:39 +0100 Subject: [PATCH 391/459] [PWGCF] FemtoUniverse -- Adding the correction requested by Vit (#8996) Co-authored-by: Zuzanna Chochulska Co-authored-by: Zuzanna Chochulska <01150674@pw.edu.pl> --- .../Tasks/femtoUniversePairTaskTrackPhi.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index c9044e71374..eedf16489c9 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -48,13 +48,13 @@ using namespace o2::soa; namespace { -static constexpr int NPart = 2; -static constexpr int NCuts = 5; +// static constexpr int NPart = 2; +// static constexpr int NCuts = 5; static const std::vector partNames{"PhiCandidate", "Track"}; static const std::vector cutNames{"MaxPt", "PIDthr", "nSigmaTPC", "nSigmaTPCTOF", "MaxP"}; -static const float cutsTable[NPart][NCuts]{ - {4.05f, 1.f, 3.f, 3.f, 100.f}, - {4.05f, 1.f, 3.f, 3.f, 100.f}}; +// static const float cutsTable[NPart][NCuts]{ //unused variable +// {4.05f, 1.f, 3.f, 3.f, 100.f}, +// {4.05f, 1.f, 3.f, 3.f, 100.f}}; } // namespace struct FemtoUniversePairTaskTrackPhi { From 34fb0ad8652acd14a2fc3276a6fa3a01210b3baf Mon Sep 17 00:00:00 2001 From: FDUEnrich <23210190047@m.fudan.edu.cn> Date: Sun, 15 Dec 2024 22:52:31 +0800 Subject: [PATCH 392/459] [PWGHF] Omegac0/Xi pT cut (#8962) Co-authored-by: ALICE Action Bot --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 58 +++++++++++++++---- 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index fe77bb275d9..5548863ac6c 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -19,6 +19,7 @@ /// \author Jinjoo Seo , Inha University /// \author Fabrizio Grosa , CERN /// \author Federica Zanone , Heidelberg University +/// \author Ruiqi Yin , Fudan University #include // std::find #include // std::distance @@ -277,10 +278,10 @@ struct HfTrackIndexSkimCreatorTagSelTracks { Preslice trackIndicesPerCollision = aod::track_association::collisionId; - Partition pvContributors = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); - Partition pvContributorsWithPidTpc = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); - Partition pvContributorsWithPidTof = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); - Partition pvContributorsWithPidTpcTof = ((aod::track::flags & (uint32_t)aod::track::PVContributor) == (uint32_t)aod::track::PVContributor); + Partition pvContributors = ((aod::track::flags & static_cast(aod::track::PVContributor)) == static_cast(aod::track::PVContributor)); + Partition pvContributorsWithPidTpc = ((aod::track::flags & static_cast(aod::track::PVContributor)) == static_cast(aod::track::PVContributor)); + Partition pvContributorsWithPidTof = ((aod::track::flags & static_cast(aod::track::PVContributor)) == static_cast(aod::track::PVContributor)); + Partition pvContributorsWithPidTpcTof = ((aod::track::flags & static_cast(aod::track::PVContributor)) == static_cast(aod::track::PVContributor)); // QA of PV refit ConfigurableAxis axisPvRefitDeltaX{"axisPvRefitDeltaX", {1000, -0.5f, 0.5f}, "DeltaX binning PV refit"}; @@ -2048,7 +2049,7 @@ struct HfTrackIndexSkimCreator { } if (config.debugPvRefit) { LOG(info) << "===> nTrk: " << nTrk << ", nContrib: " << nContrib << ", nNonContrib: " << nNonContrib; - if ((uint16_t)vecPvContributorTrackParCov.size() != collision.numContrib() || (uint16_t)nContrib != collision.numContrib()) { + if (static_cast(vecPvContributorTrackParCov.size()) != collision.numContrib() || static_cast(nContrib != collision.numContrib())) { LOG(info) << "!!! Some problem here !!! vecPvContributorTrackParCov.size()= " << vecPvContributorTrackParCov.size() << ", nContrib=" << nContrib << ", collision.numContrib()" << collision.numContrib(); } } @@ -3234,7 +3235,11 @@ struct HfTrackIndexSkimCreatorLfCascades { // Selection criteria // selections have been set to run2 lambda dedicated cuts // selections for cascade have been set to the loosest value between xi and omega - // a tolerance has been added to be more conservative + // a tolerance has been added to be more conservative ptMinOmegaczeroToOmegaKaLfCasc ptMinXicZeroOmegacZeroToXiPiLfCasc + Configurable ptMinOmegacZeroToOmegaPiLfCasc{"ptMinOmegacZeroToOmegaPiLfCasc", 0.f, "min. pT for Omegaczero in Omega + Pi decays"}; + Configurable ptMinOmegaczeroToOmegaKaLfCasc{"ptMinOmegaczeroToOmegaKaLfCasc", 0.f, "min. pT for Omegaczero in Omega + Ka decays"}; + Configurable ptMinXicZeroOmegacZeroToXiPiLfCasc{"ptMinXicZeroOmegacZeroToXiPiLfCasc", 0.f, "min. pT for XicZeroOmegacZero in Xi + Pi decays"}; + Configurable ptMinXicplusLfCasc{"ptMinXicplusLfCasc", 0.f, "min. pT for Xicplus in Xi + Pi + Pi decays"}; Configurable v0TransvRadius{"v0TransvRadius", 1.0, "V0 radius in xy plane"}; // 1.2 (xi) and 1.1 (omega) in run2 Configurable cascTransvRadius{"cascTransvRadius", 0.4, "Cascade radius in xy plane"}; // 0.5 cm (xi) and 0.6 (omega) in run2 Configurable dcaBachToPv{"dcaBachToPv", 0.03, "DCA Bach To PV"}; // 0.04 in run2 @@ -3358,6 +3363,16 @@ struct HfTrackIndexSkimCreatorLfCascades { registry.add("hDCACascDau", "hDCACascDau", {HistType::kTH1D, {{500, 0.0f, 5.0f, "cm^{2}"}}}); registry.add("hLambdaMass", "hLambdaMass", {HistType::kTH1D, {{400, 0.916f, 1.316f, "Inv. Mass (GeV/c^{2})"}}}); + // pT rej + registry.add("hPtCutsXicZeroOmegacZeroToXiPi", "Omegac/Xic to Xi Pi tracks selected by pT;#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1D, {{500, 0., 50.}}}); + registry.add("hPtCutsOmegacZeroToOmegaPi", "Omegac to Omega Pi tracks selected by pT;#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1D, {{500, 0., 50.}}}); + registry.add("hPtCutsOmegacZeroToOmegaKa", "Omegac to Omega Ka tracks selected by pT;#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1D, {{500, 0., 50.}}}); + registry.add("hPtCutsXicPlusToXiPiPi", "Xicplus to Xi Pi Pi tracks selected by pT;#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1D, {{500, 0., 50.}}}); + registry.add("hRejpTStatusXicZeroOmegacZeroToXiPi", "XicZeroOmegacZeroToXiPi rejected by pT status;status;entries", {HistType::kTH1D, {{2, -0.5, 1.5}}}); // pass dcafitter --> 0, pT>pTmin --> 1 + registry.add("hRejpTStatusOmegacZeroToOmegaPi", "OmegacZeroToOmegaPi rejected by pT status;status;entries", {HistType::kTH1D, {{2, -0.5, 1.5}}}); + registry.add("hRejpTStatusOmegacZeroToOmegaKa", "OmegacZeroToOmegaKa rejected by pT status;status;entries", {HistType::kTH1D, {{2, -0.5, 1.5}}}); + registry.add("hRejpTStatusXicPlusToXiPiPi", "XicPlusToXiPiPi rejected by pT status;status;entries", {HistType::kTH1D, {{2, -0.5, 1.5}}}); + // mass spectra registry.add("hMassXicZeroOmegacZeroToXiPi", "2-prong candidates;inv. mass (#Xi #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 2., 3.}}}); registry.add("hMassOmegacZeroToOmegaPi", "2-prong candidates;inv. mass (#Omega #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 2., 3.}}}); @@ -3555,17 +3570,23 @@ struct HfTrackIndexSkimCreatorLfCascades { std::array pVecPion1XiHyp = {0.}; df2.getTrack(0).getPxPyPzGlo(pVecXi); df2.getTrack(1).getPxPyPzGlo(pVecPion1XiHyp); + float ptXic = RecoDecay::pt(pVecXi, pVecPion1XiHyp); std::array, 2> arrMomToXi = {pVecXi, pVecPion1XiHyp}; auto mass2ProngXiHyp = RecoDecay::m(arrMomToXi, arrMass2Prong[hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi]); if ((std::abs(casc.mXi() - massXi) < config.cascadeMassWindow) && (mass2ProngXiHyp >= config.massXiPiMin) && (mass2ProngXiHyp <= config.massXiPiMax)) { - SETBIT(hfFlag, aod::hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi); + registry.fill(HIST("hRejpTStatusXicZeroOmegacZeroToXiPi"), 0); + if (ptXic >= config.ptMinXicZeroOmegacZeroToXiPiLfCasc) { + SETBIT(hfFlag, aod::hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi); + registry.fill(HIST("hRejpTStatusXicZeroOmegacZeroToXiPi"), 1); + } } // fill histograms if (config.fillHistograms && (TESTBIT(hfFlag, aod::hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi))) { registry.fill(HIST("hMassXicZeroOmegacZeroToXiPi"), mass2ProngXiHyp); + registry.fill(HIST("hPtCutsXicZeroOmegacZeroToXiPi"), ptXic); } } else if (df2.isPropagationFailure()) { LOGF(info, "Exception caught: failed to propagate tracks (2prong - xi) to charm baryon decay vtx"); @@ -3596,6 +3617,7 @@ struct HfTrackIndexSkimCreatorLfCascades { std::array pVecCharmBachelor1OmegaHyp = {0.}; df2.getTrack(0).getPxPyPzGlo(pVecOmega); df2.getTrack(1).getPxPyPzGlo(pVecCharmBachelor1OmegaHyp); + float ptOmegac = RecoDecay::pt(pVecOmega, pVecCharmBachelor1OmegaHyp); std::array, 2> arrMomToOmega = {pVecOmega, pVecCharmBachelor1OmegaHyp}; auto mass2ProngOmegaPiHyp = RecoDecay::m(arrMomToOmega, arrMass2Prong[hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi]); @@ -3603,10 +3625,18 @@ struct HfTrackIndexSkimCreatorLfCascades { if (std::abs(casc.mOmega() - massOmega) < config.cascadeMassWindow) { if ((mass2ProngOmegaPiHyp >= config.massOmegaCharmBachelorMin) && (mass2ProngOmegaPiHyp <= config.massOmegaCharmBachelorMax)) { - SETBIT(hfFlag, aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi); + registry.fill(HIST("hRejpTStatusOmegacZeroToOmegaPi"), 0); + if (ptOmegac >= config.ptMinOmegacZeroToOmegaPiLfCasc) { + SETBIT(hfFlag, aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi); + registry.fill(HIST("hRejpTStatusOmegacZeroToOmegaPi"), 1); + } } if ((mass2ProngOmegaKHyp >= config.massOmegaCharmBachelorMin) && (mass2ProngOmegaKHyp <= config.massOmegaCharmBachelorMax)) { - SETBIT(hfFlag, aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK); + registry.fill(HIST("hRejpTStatusOmegacZeroToOmegaKa"), 0); + if (ptOmegac >= config.ptMinOmegaczeroToOmegaKaLfCasc) { + SETBIT(hfFlag, aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK); + registry.fill(HIST("hRejpTStatusOmegacZeroToOmegaKa"), 1); + } } } @@ -3614,9 +3644,11 @@ struct HfTrackIndexSkimCreatorLfCascades { if (config.fillHistograms) { if (TESTBIT(hfFlag, aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi)) { registry.fill(HIST("hMassOmegacZeroToOmegaPi"), mass2ProngOmegaPiHyp); + registry.fill(HIST("hPtCutsOmegacZeroToOmegaPi"), ptOmegac); } if (TESTBIT(hfFlag, aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK)) { registry.fill(HIST("hMassOmegacZeroToOmegaK"), mass2ProngOmegaKHyp); + registry.fill(HIST("hPtCutsOmegacZeroToOmegaKa"), ptOmegac); } } } else if (df2.isPropagationFailure()) { @@ -3689,17 +3721,23 @@ struct HfTrackIndexSkimCreatorLfCascades { df3.getTrack(0).getPxPyPzGlo(pVec1); // take the momentum at the Xic vertex df3.getTrack(1).getPxPyPzGlo(pVec2); df3.getTrack(2).getPxPyPzGlo(pVec3); + float ptXic3Prong = RecoDecay::pt(pVec1, pVec2, pVec3); std::array, 3> arr3Mom = {pVec1, pVec2, pVec3}; auto mass3Prong = RecoDecay::m(arr3Mom, arrMass3Prong[hf_cand_casc_lf::DecayType3Prong::XicplusToXiPiPi]); if ((std::abs(casc.mXi() - massXi) < config.cascadeMassWindow) && (mass3Prong >= config.massXiPiPiMin) && (mass3Prong <= config.massXiPiPiMax)) { - SETBIT(hfFlag, aod::hf_cand_casc_lf::DecayType3Prong::XicplusToXiPiPi); + registry.fill(HIST("hRejpTStatusXicPlusToXiPiPi"), 0); + if (ptXic3Prong >= config.ptMinXicplusLfCasc) { + SETBIT(hfFlag, aod::hf_cand_casc_lf::DecayType3Prong::XicplusToXiPiPi); + registry.fill(HIST("hRejpTStatusXicPlusToXiPiPi"), 1); + } } // fill histograms if (config.fillHistograms && (TESTBIT(hfFlag, aod::hf_cand_casc_lf::DecayType3Prong::XicplusToXiPiPi))) { registry.fill(HIST("hMassXicPlusToXiPiPi"), mass3Prong); + registry.fill(HIST("hPtCutsXicPlusToXiPiPi"), ptXic3Prong); } } else if (df3.isPropagationFailure()) { LOGF(info, "Exception caught: failed to propagate tracks (3prong) to charm baryon decay vtx"); From 4945b733996adbc8e1aa47abe5abcdad194baabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Sun, 15 Dec 2024 15:53:18 +0100 Subject: [PATCH 393/459] [PWGHF] Add pt and inv.mass cuts also in mixed event (#8991) --- PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx index f421bd35ff3..9faaa37360a 100644 --- a/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx +++ b/PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx @@ -396,6 +396,14 @@ struct HfTaskCharmHadronsFemtoDream { invMass = p2.m(std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassProton}); } + if (invMass < charmHadMinInvMass || invMass > charmHadMaxInvMass) { + continue; + } + + if (p2.pt() < charmHadMinPt || p2.pt() > charmHadMaxPt) { + continue; + } + int charmHadMc = 0; int originType = 0; if constexpr (isMc) { From c5554cee33be99ec9be687f87601dc3ab7f0edaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Sun, 15 Dec 2024 15:53:49 +0100 Subject: [PATCH 394/459] [PWGHF,Trigger] Add de-Lc femto trigger channel into the HFFilter task (#8937) Co-authored-by: ALICE Action Bot Co-authored-by: Fabrizio --- EventFiltering/PWGHF/HFFilter.cxx | 53 +++++-- EventFiltering/PWGHF/HFFilterHelpers.h | 201 +++++++++++++++++-------- 2 files changed, 182 insertions(+), 72 deletions(-) diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index 9342beee317..1b7ec0ee02d 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -72,9 +72,9 @@ struct HfFilter { // Main struct for HF triggers // parameters for all triggers // nsigma PID (except for V0 and cascades) - Configurable> nSigmaPidCuts{"nSigmaPidCuts", {cutsNsigma[0], 3, 6, labelsRowsNsigma, labelsColumnsNsigma}, "Nsigma cuts for TPC/TOF PID (except for V0 and cascades)"}; + Configurable> nSigmaPidCuts{"nSigmaPidCuts", {cutsNsigma[0], 3, 7, labelsRowsNsigma, labelsColumnsNsigma}, "Nsigma cuts for TPC/TOF PID (except for V0 and cascades)"}; // min and max pts for tracks and bachelors (except for V0 and cascades) - Configurable> ptCuts{"ptCuts", {cutsPt[0], 2, 6, labelsRowsCutsPt, labelsColumnsCutsPt}, "minimum and maximum pT for bachelor tracks (except for V0 and cascades)"}; + Configurable> ptCuts{"ptCuts", {cutsPt[0], 2, 7, labelsRowsCutsPt, labelsColumnsCutsPt}, "minimum and maximum pT for bachelor tracks (except for V0 and cascades)"}; // parameters for high-pT triggers Configurable> ptThresholds{"ptThresholds", {cutsHighPtThresholds[0], 1, 2, labelsEmpty, labelsColumnsHighPtThresholds}, "pT treshold for high pT charm hadron candidates for kHighPt triggers in GeV/c"}; @@ -91,10 +91,11 @@ struct HfFilter { // Main struct for HF triggers // parameters for femto triggers Configurable femtoMaxRelativeMomentum{"femtoMaxRelativeMomentum", 2., "Maximal allowed value for relative momentum between charm-proton pairs in GeV/c"}; - Configurable> enableFemtoChannels{"enableFemtoChannels", {activeFemtoChannels[0], 1, 5, labelsEmpty, labelsColumnsFemtoChannels}, "Flags to enable/disable femto channels"}; + Configurable> enableFemtoChannels{"enableFemtoChannels", {activeFemtoChannels[0], 2, 5, labelsRowsFemtoChannels, labelsColumnsFemtoChannels}, "Flags to enable/disable femto channels"}; Configurable requireCharmMassForFemto{"requireCharmMassForFemto", false, "Flags to enable/disable cut on charm-hadron invariant-mass window for femto"}; - Configurable ptThresholdForFemtoPid{"ptThresholdForFemtoPid", 8., "pT threshold for changing strategy of proton PID in femto triggers"}; - Configurable forceTofPidForFemto{"forceTofPidForFemto", true, "force TOF PID for proton in femto triggers"}; + Configurable> ptThresholdsForFemto{"ptThresholdsForFemto", {cutsPtThresholdsForFemto[0], 1, 2, labelsEmpty, labelsColumnsPtThresholdsForFemto}, "pT treshold for proton or deuteron for kFemto triggers in GeV/c"}; + Configurable forceTofProtonForFemto{"forceTofProtonForFemto", true, "flag to force TOF PID for protons"}; + Configurable forceTofDeuteronForFemto{"forceTofDeuteronForFemto", false, "flag to force TOF PID for deuterons"}; // double charm Configurable> enableDoubleCharmChannels{"enableDoubleCharmChannels", {activeDoubleCharmChannels[0], 1, 3, labelsEmpty, labelsColumnsDoubleCharmChannels}, "Flags to enable/disable double charm channels"}; @@ -157,9 +158,11 @@ struct HfFilter { // Main struct for HF triggers std::shared_ptr hN2ProngCharmCand, hN3ProngCharmCand; std::array, kNCharmParticles> hCharmHighPt{}; std::array, kNCharmParticles> hCharmProtonKstarDistr{}; + std::array, kNCharmParticles> hCharmDeuteronKstarDistr{}; std::array, kNBeautyParticles> hMassVsPtB{}; std::array, kNCharmParticles + 17> hMassVsPtC{}; // +9 for resonances (D*+, D*0, Ds*+, Ds1+, Ds2*+, Xic+* right sign, Xic+* wrong sign, Xic0* right sign, Xic0* wrong sign) +2 for SigmaC (SigmaC++, SigmaC0) +2 for SigmaCK pairs (SigmaC++K-, SigmaC0K0s) +2 for charm baryons (Xi+Pi, Xi+Ka) std::shared_ptr hProtonTPCPID, hProtonTOFPID; + std::shared_ptr hDeuteronTPCPID, hDeuteronTOFPID; std::array, kNCharmParticles> hBDTScoreBkg{}; std::array, kNCharmParticles> hBDTScorePrompt{}; std::array, kNCharmParticles> hBDTScoreNonPrompt{}; @@ -181,20 +184,23 @@ struct HfFilter { // Main struct for HF triggers void init(InitContext&) { helper.setHighPtTriggerThresholds(ptThresholds->get(0u, 0u), ptThresholds->get(0u, 1u)); + helper.setPtTriggerThresholdsForFemto(ptThresholdsForFemto->get(0u, 0u), ptThresholdsForFemto->get(0u, 1u)); helper.setPtBinsSingleTracks(pTBinsTrack); helper.setPtBinsBeautyHadrons(pTBinsBHadron); helper.setPtLimitsBeautyBachelor(ptCuts->get(0u, 0u), ptCuts->get(1u, 0u)); helper.setPtLimitsDstarSoftPion(ptCuts->get(0u, 1u), ptCuts->get(1u, 1u)); helper.setPtLimitsProtonForFemto(ptCuts->get(0u, 2u), ptCuts->get(1u, 2u)); + helper.setPtLimitsDeuteronForFemto(ptCuts->get(0u, 6u), ptCuts->get(1u, 6u)); helper.setPtLimitsCharmBaryonBachelor(ptCuts->get(0u, 3u), ptCuts->get(1u, 3u)); helper.setCutsSingleTrackBeauty(cutsTrackBeauty3Prong, cutsTrackBeauty4Prong); helper.setCutsSingleTrackCharmBaryonBachelor(cutsTrackCharmBaryonBachelor); helper.setCutsBplus(cutsBplus); - helper.setPtThresholdPidStrategyForFemto(ptThresholdForFemtoPid); helper.setNsigmaProtonCutsForFemto(std::array{nSigmaPidCuts->get(0u, 3u), nSigmaPidCuts->get(1u, 3u), nSigmaPidCuts->get(2u, 3u)}); + helper.setNsigmaDeuteronCutsForFemto(std::array{nSigmaPidCuts->get(0u, 6u), nSigmaPidCuts->get(1u, 6u), nSigmaPidCuts->get(2u, 6u)}); helper.setNsigmaProtonCutsForCharmBaryons(nSigmaPidCuts->get(0u, 0u), nSigmaPidCuts->get(1u, 0u)); helper.setNsigmaPionKaonCutsForDzero(nSigmaPidCuts->get(0u, 1u), nSigmaPidCuts->get(1u, 1u)); helper.setNsigmaKaonCutsFor3Prongs(nSigmaPidCuts->get(0u, 2u), nSigmaPidCuts->get(1u, 2u)); + helper.setForceTofForFemto(forceTofProtonForFemto, forceTofDeuteronForFemto); helper.setV0Selections(cutsGammaK0sLambda->get(0u, 0u), cutsGammaK0sLambda->get(0u, 1u), cutsGammaK0sLambda->get(0u, 2u), cutsGammaK0sLambda->get(0u, 3u), cutsGammaK0sLambda->get(0u, 4u), cutsGammaK0sLambda->get(0u, 5u)); helper.setXiSelections(cutsXiCascades->get(0u, 0u), cutsXiCascades->get(0u, 1u), cutsXiCascades->get(0u, 2u), cutsXiCascades->get(0u, 3u), cutsXiCascades->get(0u, 4u), cutsXiCascades->get(0u, 5u), cutsXiCascades->get(0u, 6u), cutsXiCascades->get(0u, 7u)); helper.setNsigmaPiCutsForCharmBaryonBachelor(nSigmaPidCuts->get(0u, 4u), nSigmaPidCuts->get(1u, 4u)); @@ -222,6 +228,7 @@ struct HfFilter { // Main struct for HF triggers for (int iCharmPart{0}; iCharmPart < kNCharmParticles; ++iCharmPart) { hCharmHighPt[iCharmPart] = registry.add(Form("f%sHighPt", charmParticleNames[iCharmPart].data()), Form("#it{p}_{T} distribution of triggered high-#it{p}_{T} %s candidates;#it{p}_{T} (GeV/#it{c});counts", charmParticleNames[iCharmPart].data()), HistType::kTH1F, {ptAxis}); hCharmProtonKstarDistr[iCharmPart] = registry.add(Form("f%sProtonKstarDistr", charmParticleNames[iCharmPart].data()), Form("#it{k}* distribution of triggered p#minus%s pairs;#it{k}* (GeV/#it{c});counts", charmParticleNames[iCharmPart].data()), HistType::kTH1F, {kstarAxis}); + hCharmDeuteronKstarDistr[iCharmPart] = registry.add(Form("f%sDeuteronKstarDistr", charmParticleNames[iCharmPart].data()), Form("#it{k}* distribution of triggered de%s pairs;#it{k}* (GeV/#it{c});counts", charmParticleNames[iCharmPart].data()), HistType::kTH1F, {kstarAxis}); hMassVsPtC[iCharmPart] = registry.add(Form("fMassVsPt%s", charmParticleNames[iCharmPart].data()), Form("#it{M} vs. #it{p}_{T} distribution of triggered %s candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", charmParticleNames[iCharmPart].data()), HistType::kTH2F, {ptAxis, massAxisC[iCharmPart]}); if (activateQA > 1) { hBDTScoreBkg[iCharmPart] = registry.add(Form("f%sBDTScoreBkgDistr", charmParticleNames[iCharmPart].data()), Form("BDT background score distribution for %s;BDT background score;counts", charmParticleNames[iCharmPart].data()), HistType::kTH1F, {bdtAxis}); @@ -276,6 +283,9 @@ struct HfFilter { // Main struct for HF triggers if (activateQA > 1) { hProtonTPCPID = registry.add("fProtonTPCPID", "#it{N}_{#sigma}^{TPC} vs. #it{p} for selected protons;#it{p} (GeV/#it{c});#it{N}_{#sigma}^{TPC}", HistType::kTH2F, {pAxis, nSigmaAxis}); hProtonTOFPID = registry.add("fProtonTOFPID", "#it{N}_{#sigma}^{TOF} vs. #it{p} for selected protons;#it{p} (GeV/#it{c});#it{N}_{#sigma}^{TOF}", HistType::kTH2F, {pAxis, nSigmaAxis}); + hDeuteronTPCPID = registry.add("hDeuteronTPCPID", "#it{N}_{#sigma}^{TPC} vs. #it{p} for selected deuterons;#it{p} (GeV/#it{c});#it{N}_{#sigma}^{TPC}", HistType::kTH2F, {pAxis, nSigmaAxis}); + hDeuteronTOFPID = registry.add("hDeuteronTOFPID", "#it{N}_{#sigma}^{TOF} vs. #it{p} for selected deuterons;#it{p} (GeV/#it{c});#it{N}_{#sigma}^{TOF}", HistType::kTH2F, {pAxis, nSigmaAxis}); + hV0Selected = registry.add("fV0Selected", "Selections for V0s;;counts", HistType::kTH2F, {{9, -0.5, 8.5}, {kNV0, -0.5, +kNV0 - 0.5}}); for (int iV0{kPhoton}; iV0 < kNV0; ++iV0) { @@ -303,8 +313,8 @@ struct HfFilter { // Main struct for HF triggers thresholdBDTScores = {thresholdBDTScoreD0ToKPi, thresholdBDTScoreDPlusToPiKPi, thresholdBDTScoreDSToPiKK, thresholdBDTScoreLcToPiKP, thresholdBDTScoreXicToPiKP}; } - using BigTracksMCPID = soa::Join; - using BigTracksPID = soa::Join; + using BigTracksMCPID = soa::Join; + using BigTracksPID = soa::Join; using CollsWithEvSel = soa::Join; using Hf2ProngsWithMl = soa::Join; @@ -355,7 +365,7 @@ struct HfFilter { // Main struct for HF triggers if (setTPCCalib == 1) { helper.setTpcRecalibMaps(ccdb, bc, ccdbPathTPC); } else if (setTPCCalib > 1) { - helper.setValuesBB(ccdbApi, bc, std::array{ccdbBBPion.value, ccdbBBAntiPion.value, ccdbBBKaon.value, ccdbBBAntiKaon.value, ccdbBBProton.value, ccdbBBAntiProton.value}); + helper.setValuesBB(ccdbApi, bc, std::array{ccdbBBPion.value, ccdbBBAntiPion.value, ccdbBBKaon.value, ccdbBBAntiKaon.value, ccdbBBProton.value, ccdbBBAntiProton.value, ccdbBBProton.value, ccdbBBAntiProton.value}); // dummy for deuteron } currentRun = bc.runNumber(); @@ -570,11 +580,11 @@ struct HfFilter { // Main struct for HF triggers // 2-prong femto if (!keepEvent[kFemto2P] && enableFemtoChannels->get(0u, 0u) && isCharmTagged && track.collisionId() == thisCollId && (TESTBIT(selD0, 0) || TESTBIT(selD0, 1) || !requireCharmMassForFemto)) { - bool isProton = helper.isSelectedProton4Femto(track, trackParThird, activateQA, hProtonTPCPID, hProtonTOFPID, forceTofPidForFemto); + bool isProton = helper.isSelectedTrack4Femto(track, trackParThird, activateQA, hProtonTPCPID, hProtonTOFPID, kProtonForFemto); if (isProton) { float relativeMomentum = helper.computeRelativeMomentum(pVecThird, pVec2Prong, massD0); if (applyOptimisation) { - optimisationTreeFemto(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scores[0], scores[1], scores[2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr()); + optimisationTreeFemto(thisCollId, o2::constants::physics::Pdg::kD0, pt2Prong, scores[0], scores[1], scores[2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr(), track.tpcNSigmaDe(), track.tofNSigmaDe()); } if (relativeMomentum < femtoMaxRelativeMomentum) { keepEvent[kFemto2P] = true; @@ -948,13 +958,15 @@ struct HfFilter { // Main struct for HF triggers } // end beauty selection // 3-prong femto - bool isProton = helper.isSelectedProton4Femto(track, trackParFourth, activateQA, hProtonTPCPID, hProtonTOFPID, forceTofPidForFemto); + bool isProton = helper.isSelectedTrack4Femto(track, trackParFourth, activateQA, hProtonTPCPID, hProtonTOFPID, kProtonForFemto); + bool isDeuteron = helper.isSelectedTrack4Femto(track, trackParFourth, activateQA, hDeuteronTPCPID, hDeuteronTOFPID, kDeuteronForFemto); + if (isProton && track.collisionId() == thisCollId) { for (int iHypo{0}; iHypo < kNCharmParticles - 1 && !keepEvent[kFemto3P]; ++iHypo) { if (isCharmTagged[iHypo] && enableFemtoChannels->get(0u, iHypo + 1) && (TESTBIT(is3ProngInMass[iHypo], 0) || TESTBIT(is3ProngInMass[iHypo], 1) || !requireCharmMassForFemto)) { float relativeMomentum = helper.computeRelativeMomentum(pVecFourth, pVec3Prong, massCharmHypos[iHypo]); if (applyOptimisation) { - optimisationTreeFemto(thisCollId, charmParticleID[iHypo], pt3Prong, scores[iHypo][0], scores[iHypo][1], scores[iHypo][2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr()); + optimisationTreeFemto(thisCollId, charmParticleID[iHypo], pt3Prong, scores[iHypo][0], scores[iHypo][1], scores[iHypo][2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr(), track.tpcNSigmaDe(), track.tofNSigmaDe()); } if (relativeMomentum < femtoMaxRelativeMomentum) { keepEvent[kFemto3P] = true; @@ -964,6 +976,21 @@ struct HfFilter { // Main struct for HF triggers } } } + } else if (isDeuteron && track.collisionId() == thisCollId) { + for (int iHypo{0}; iHypo < kNCharmParticles - 1 && !keepEvent[kFemto3P]; ++iHypo) { + if (isCharmTagged[iHypo] && enableFemtoChannels->get(1u, iHypo + 1) && (TESTBIT(is3ProngInMass[iHypo], 0) || TESTBIT(is3ProngInMass[iHypo], 1) || !requireCharmMassForFemto)) { + float relativeMomentum = helper.computeRelativeMomentum(pVecFourth, pVec3Prong, massCharmHypos[iHypo]); + if (applyOptimisation) { + optimisationTreeFemto(thisCollId, charmParticleID[iHypo], pt3Prong, scores[iHypo][0], scores[iHypo][1], scores[iHypo][2], relativeMomentum, track.tpcNSigmaPr(), track.tofNSigmaPr(), track.tpcNSigmaDe(), track.tofNSigmaDe()); + } + if (relativeMomentum < femtoMaxRelativeMomentum) { + keepEvent[kFemto3P] = true; + if (activateQA) { + hCharmDeuteronKstarDistr[iHypo + 1]->Fill(relativeMomentum); + } + } + } + } } // end femto selection // SigmaC++ K- trigger diff --git a/EventFiltering/PWGHF/HFFilterHelpers.h b/EventFiltering/PWGHF/HFFilterHelpers.h index f38ed71f5eb..6accb5e755c 100644 --- a/EventFiltering/PWGHF/HFFilterHelpers.h +++ b/EventFiltering/PWGHF/HFFilterHelpers.h @@ -118,7 +118,14 @@ enum PIDSpecies { kKa, kAntiKa, kPr, - kAntiPr + kAntiPr, + kDe, + kAntiDe +}; + +enum trackSpecies { + kProtonForFemto, + kDeuteronForFemto }; enum V0Species { @@ -155,6 +162,7 @@ static const std::tuple pdgCharmDaughters{ constexpr float massPi = o2::constants::physics::MassPiPlus; constexpr float massKa = o2::constants::physics::MassKPlus; constexpr float massProton = o2::constants::physics::MassProton; +constexpr float massDeuteron = o2::constants::physics::MassDeuteron; constexpr float massGamma = o2::constants::physics::MassGamma; constexpr float massK0S = o2::constants::physics::MassK0Short; constexpr float massLambda = o2::constants::physics::MassLambda0; @@ -188,20 +196,24 @@ static const std::array massAxisB = // default values for configurables // channels to trigger on for femto -constexpr int activeFemtoChannels[1][5] = {{1, 1, 1, 1, 0}}; // pD0, pD+, pDs, pLc, pXic +constexpr int activeFemtoChannels[2][5] = {{1, 1, 1, 1, 0}, // pD0, pD+, pDs, pLc, pXic + {0, 0, 0, 1, 0}}; // only for deLc static const std::vector labelsColumnsFemtoChannels = {"protonDZero", "protonDPlus", "protonDs", "protonLc", "protonXic"}; +static const std::vector labelsRowsFemtoChannels = {"protonCharmFemto", "deuteronCharmFemto"}; +constexpr float cutsPtThresholdsForFemto[1][2] = {{8., 1.4}}; // proton, deuteron +static const std::vector labelsColumnsPtThresholdsForFemto = {"Proton", "Deuteron"}; // min and max pT for all tracks combined (except for V0 and cascades) -constexpr float cutsPt[2][6] = {{1., 0.1, 0.8, 0.5, 0.1, 0.2}, - {100000., 100000., 5., 100000., 100000., 100000.}}; // beauty, D*, femto, SigmaC, Xic*+ -> SigmaC++K- -static const std::vector labelsColumnsCutsPt = {"Beauty", "DstarPlus", "Femto", "CharmBaryon", "SoftPiSigmaC", "SoftKaonXicResoToSigmaC"}; +constexpr float cutsPt[2][7] = {{1., 0.1, 0.8, 0.5, 0.1, 0.2, 0.4}, + {100000., 100000., 5., 100000., 100000., 100000., 100000.}}; // beauty, D*, femto, SigmaC, Xic*+ -> SigmaC++K- +static const std::vector labelsColumnsCutsPt = {"Beauty", "DstarPlus", "FemtoProton", "CharmBaryon", "SoftPiSigmaC", "SoftKaonXicResoToSigmaC", "FemtoDeuteron"}; static const std::vector labelsRowsCutsPt = {"Minimum", "Maximum"}; // PID cuts -constexpr float cutsNsigma[3][6] = {{3., 3., 3., 5., 3., 3.}, // TPC proton from Lc, pi/K from D0, K from 3-prong, femto, pi/K from Xic/Omegac, K from Xic*->SigmaC-Kaon - {3., 3., 3., 2.5, 3., 3.}, // TOF proton from Lc, pi/K from D0, K from 3-prong, femto, pi/K from Xic/Omegac, K from Xic*->SigmaC-Kaon - {999., 999., 999., 2.5, 999., 999.}}; // Sum in quadrature of TPC and TOF (used only for femto for pT < 4 GeV/c) -static const std::vector labelsColumnsNsigma = {"PrFromLc", "PiKaFromDZero", "KaFrom3Prong", "Femto", "PiKaFromCharmBaryon", "SoftKaonFromXicResoToSigmaC"}; +constexpr float cutsNsigma[3][7] = {{3., 3., 3., 5., 3., 3., 5.}, // TPC proton from Lc, pi/K from D0, K from 3-prong, femto selected proton, pi/K from Xic/Omegac, K from Xic*->SigmaC-Kaon, femto selected deuteron + {3., 3., 3., 2.5, 3., 3., 5.}, // TOF proton from Lc, pi/K from D0, K from 3-prong, femto selected proton, pi/K from Xic/Omegac, K from Xic*->SigmaC-Kaon, femto selected deuteron + {999., 999., 999., 2.5, 999., 999., 5.}}; // Sum in quadrature of TPC and TOF (used only for femto selected proton and deuteron for pT < 4 GeV/c) +static const std::vector labelsColumnsNsigma = {"PrFromLc", "PiKaFromDZero", "KaFrom3Prong", "FemtoProton", "PiKaFromCharmBaryon", "SoftKaonFromXicResoToSigmaC", "FemtoDeuteron"}; static const std::vector labelsRowsNsigma = {"TPC", "TOF", "Comb"}; // high pt @@ -277,6 +289,16 @@ class HfFilterHelper mPtThresholdHighPt2Prongs = threshold2Prongs; mPtThresholdHighPt3Prongs = threshold3Prongs; } + void setPtTriggerThresholdsForFemto(float thresholdProtons, float thresholdDeuterons) + { + mPtThresholdProtonForFemto = thresholdProtons; + mPtThresholdDeuteronForFemto = thresholdDeuterons; + } + void setForceTofForFemto(bool forceTofProtons, bool forceTofDeuterons) + { + mForceTofProtonForFemto = forceTofProtons; + mForceTofDeuteronForFemto = forceTofDeuterons; + } void setPtBinsSingleTracks(std::vector ptBins) { mPtBinsTracks = ptBins; } void setPtBinsBeautyHadrons(std::vector ptBins) { mPtBinsBeautyHadrons = ptBins; } void setCutsSingleTrackBeauty(o2::framework::LabeledArray cutsSingleTrack3P, o2::framework::LabeledArray cutsSingleTrack4P) @@ -293,6 +315,11 @@ class HfFilterHelper mPtMinProtonForFemto = minPt; mPtMaxProtonForFemto = maxPt; } + void setPtLimitsDeuteronForFemto(float minPt, float maxPt) + { + mPtMinDeuteronForFemto = minPt; + mPtMaxDeuteronForFemto = maxPt; + } void setPtLimitsBeautyBachelor(float minPt, float maxPt) { mPtMinBeautyBachelor = minPt; @@ -334,8 +361,8 @@ class HfFilterHelper mPtMaxCharmBaryonBachelor = maxPt; } - void setPtThresholdPidStrategyForFemto(float ptThreshold) { mPtThresholdPidStrategyForFemto = ptThreshold; } void setNsigmaProtonCutsForFemto(std::array nSigmaCuts) { mNSigmaPrCutsForFemto = nSigmaCuts; } + void setNsigmaDeuteronCutsForFemto(std::array nSigmaCuts) { mNSigmaDeCutsForFemto = nSigmaCuts; } void setNsigmaProtonCutsForCharmBaryons(float nSigmaTpc, float nSigmaTof) { mNSigmaTpcPrCutForCharmBaryons = nSigmaTpc; @@ -411,7 +438,7 @@ class HfFilterHelper template int8_t isSelectedTrackForSoftPionOrBeauty(const T& track, const T1& trackPar, const T2& dca, const int& whichTrigger); template - bool isSelectedProton4Femto(const T1& track, const T2& trackPar, const int& activateQA, H2 hProtonTPCPID, H2 hProtonTOFPID, bool forceTof); + bool isSelectedTrack4Femto(const T1& track, const T2& trackPar, const int& activateQA, H2 hTPCPID, H2 hTOFPID, const int& trackSpecies); template int8_t isDzeroPreselected(const T& trackPos, const T& trackNeg); template @@ -460,7 +487,7 @@ class HfFilterHelper inline int setVtxConfiguration(T1 vertexer, bool useAbsDCA); // PID - void setValuesBB(o2::ccdb::CcdbApi& ccdbApi, aod::BCsWithTimestamps::iterator const& bunchCrossing, const std::array& ccdbPaths); + void setValuesBB(o2::ccdb::CcdbApi& ccdbApi, aod::BCsWithTimestamps::iterator const& bunchCrossing, const std::array& ccdbPaths); void setTpcRecalibMaps(o2::framework::Service const& ccdb, aod::BCsWithTimestamps::iterator const& bunchCrossing, const std::string& ccdbPath); private: @@ -492,17 +519,21 @@ class HfFilterHelper float mPtMaxSoftKaonForXicResoToSigmaC{10000.f}; // maximum pt for the soft kaon of Xic* to SigmaC-Kaon float mPtMinBeautyBachelor{0.5}; // minimum pt for the b-hadron pion daughter float mPtMinProtonForFemto{0.8}; // minimum pt for the proton for femto + float mPtMinDeuteronForFemto{0.8}; // minimum pt for the deuteron for femto float mPtMinCharmBaryonBachelor{0.5}; // minimum pt for the bachelor pion from Xic/Omegac decays float mPtMaxSoftPionForDstar{2.}; // maximum pt for the D*+ soft pion float mPtMaxBeautyBachelor{100000.}; // maximum pt for the b-hadron pion daughter float mPtMaxProtonForFemto{5.0}; // maximum pt for the proton for femto + float mPtMaxDeuteronForFemto{5.0}; // maximum pt for the deuteron for femto float mPtMaxCharmBaryonBachelor{100000.}; // maximum pt for the bachelor pion from Xic/Omegac decays - float mPtThresholdPidStrategyForFemto{8.}; // pt threshold to change strategy for proton PID for femto + float mPtThresholdProtonForFemto{8.}; // pt threshold to change strategy for proton PID for femto + float mPtThresholdDeuteronForFemto{1.4}; // pt threshold to change strategy for deuteron PID for femto float mPtMinSigmaCZero{0.f}; // pt min SigmaC0 candidate float mPtMinSigmaC2520Zero{0.f}; // pt min SigmaC(2520)0 candidate float mPtMinSigmaCPlusPlus{0.f}; // pt min SigmaC++ candidate float mPtMinSigmaC2520PlusPlus{0.f}; // pt min SigmaC(2520)++ candidate std::array mNSigmaPrCutsForFemto{3., 3., 3.}; // cut values for Nsigma TPC, TOF, combined for femto protons + std::array mNSigmaDeCutsForFemto{3., 3., 3.}; // cut values for Nsigma TPC, TOF, combined for femto deuterons float mNSigmaTpcPrCutForCharmBaryons{3.}; // maximum Nsigma TPC for protons in Lc and Xic decays float mNSigmaTofPrCutForCharmBaryons{3.}; // maximum Nsigma TOF for protons in Lc and Xic decays float mNSigmaTpcKaCutFor3Prongs{3.}; // maximum Nsigma TPC for kaons in 3-prong decays @@ -543,12 +574,14 @@ class HfFilterHelper float mPtThresholdHighPt3Prongs{8.}; // threshold for high pT triggers for 3-prongs float mNSigmaTpcKaonFromXicResoToSigmaC{3.}; // maximum Nsigma TPC for kaons in Xic*->SigmaC-Kaon float mNSigmaTofKaonFromXicResoToSigmaC{3.}; // maximum Nsigma TOF for kaons in Xic*->SigmaC-Kaon + bool mForceTofProtonForFemto = true; // flag to force TOF PID for protons + bool mForceTofDeuteronForFemto = false; // flag to force TOF PID for deuterons o2::framework::LabeledArray mCutsBplus{}; // selections for B+ candidates (DeltaMass, CPA, DecayLength, ImpactParameterProduct) // PID recalibrations - int mTpcPidCalibrationOption{0}; // Option for TPC PID calibration (0 -> AO2D, 1 -> postcalibrations, 2 -> alternative bethe bloch parametrisation) - std::array mHistMapPiPrKa{}; // Map for TPC PID postcalibrations for pions, kaon and protons - std::array, 6> mBetheBlochPiKaPr{}; // Bethe-Bloch parametrisations for pions, antipions, kaons, antikaons, protons, antiprotons in TPC + int mTpcPidCalibrationOption{0}; // Option for TPC PID calibration (0 -> AO2D, 1 -> postcalibrations, 2 -> alternative bethe bloch parametrisation) + std::array mHistMapPiPrKaDe{}; // Map for TPC PID postcalibrations for pions, kaon, protons and deuterons + std::array, 8> mBetheBlochPiKaPrDe{}; // Bethe-Bloch parametrisations for pions, antipions, kaons, antikaons, protons, antiprotons, deuterons, antideuterons in TPC }; /// Selection of high-pt 2-prong candidates @@ -652,19 +685,44 @@ inline int8_t HfFilterHelper::isSelectedTrackForSoftPionOrBeauty(const T& track, return retValue; } -/// Basic selection of proton candidates +/// Basic selection of proton or deuteron candidates /// \param track is a track /// \param trackPar is a track parameter /// \param activateQA flag to activate the filling of QA histos /// \param hProtonTPCPID histo with NsigmaTPC vs. p /// \param hProtonTOFPID histo with NsigmaTOF vs. p -/// \param forceTof flag to force TOF PID +/// \param trackSpecies flag to choose proton or deuteron /// \return true if track passes all cuts template -inline bool HfFilterHelper::isSelectedProton4Femto(const T1& track, const T2& trackPar, const int& activateQA, H2 hProtonTPCPID, H2 hProtonTOFPID, bool forceTof) +inline bool HfFilterHelper::isSelectedTrack4Femto(const T1& track, const T2& trackPar, const int& activateQA, H2 hTPCPID, H2 hTOFPID, const int& trackSpecies) { float pt = trackPar.getPt(); - if (pt < mPtMinProtonForFemto || pt > mPtMaxProtonForFemto) { + float ptMin, ptMax, ptThresholdPidStrategy; + std::array nSigmaCuts; + bool forceTof = false; // flag to force TOF PID + + // Assign particle-specific parameters + switch (trackSpecies) { + case kProtonForFemto: + ptMin = mPtMinProtonForFemto; + ptMax = mPtMaxProtonForFemto; + nSigmaCuts = mNSigmaPrCutsForFemto; + forceTof = mForceTofProtonForFemto; + ptThresholdPidStrategy = mPtThresholdProtonForFemto; + break; + case kDeuteronForFemto: + ptMin = mPtMinDeuteronForFemto; + ptMax = mPtMaxDeuteronForFemto; + nSigmaCuts = mNSigmaDeCutsForFemto; + forceTof = mForceTofDeuteronForFemto; + ptThresholdPidStrategy = mPtThresholdDeuteronForFemto; + break; + default: + return false; // Unknown particle type + } + + // Common selection criteria + if (pt < ptMin || pt > ptMax) { return false; } @@ -675,39 +733,58 @@ inline bool HfFilterHelper::isSelectedProton4Femto(const T1& track, const T2& tr if (!track.isGlobalTrack()) { return false; // use only global tracks } - - float NSigmaTPC = track.tpcNSigmaPr(); - float NSigmaTOF = track.tofNSigmaPr(); + // PID evaluation + float NSigmaTPC = (trackSpecies == kProtonForFemto) ? track.tpcNSigmaPr() : track.tpcNSigmaDe(); + float NSigmaTOF = (trackSpecies == kProtonForFemto) ? track.tofNSigmaPr() : track.tofNSigmaDe(); if (!forceTof && !track.hasTOF()) { NSigmaTOF = 0.; // always accepted } + // Apply TPC PID post-calibration(only available for proton, dummy for deuteron) if (mTpcPidCalibrationOption == 1) { - NSigmaTPC = getTPCPostCalib(track, kPr); + NSigmaTPC = getTPCPostCalib(track, trackSpecies == kProtonForFemto ? kPr : kDe); } else if (mTpcPidCalibrationOption == 2) { if (track.sign() > 0) { - NSigmaTPC = getTPCSplineCalib(track, kPr); + NSigmaTPC = getTPCSplineCalib(track, trackSpecies == kProtonForFemto ? kPr : kDe); } else { - NSigmaTPC = getTPCSplineCalib(track, kAntiPr); + NSigmaTPC = getTPCSplineCalib(track, trackSpecies == kProtonForFemto ? kAntiPr : kAntiDe); } } float NSigma = std::sqrt(NSigmaTPC * NSigmaTPC + NSigmaTOF * NSigmaTOF); - if (trackPar.getPt() <= mPtThresholdPidStrategyForFemto) { - if (NSigma > mNSigmaPrCutsForFemto[2]) { - return false; + if (trackSpecies == kProtonForFemto) { + if (pt <= ptThresholdPidStrategy) { + if (NSigma > nSigmaCuts[2]) { + return false; + } + } else { + if (std::fabs(NSigmaTPC) > nSigmaCuts[0] || std::fabs(NSigmaTOF) > nSigmaCuts[1]) { + return false; + } } - } else { - if (std::fabs(NSigmaTPC) > mNSigmaPrCutsForFemto[0] || std::fabs(NSigmaTOF) > mNSigmaPrCutsForFemto[1]) { - return false; + } + // For deuterons: Determine whether to apply TOF based on pt threshold + if (trackSpecies == kDeuteronForFemto) { + // Apply different PID strategy in different pt range + if (pt <= ptThresholdPidStrategy) { + if (std::fabs(NSigmaTPC) > nSigmaCuts[0]) { // Use only TPC below the threshold + return false; + } + } else { + if (NSigma > nSigmaCuts[2]) { // Use combined TPC and TOF above the threshold + return false; + } } } if (activateQA > 1) { - hProtonTPCPID->Fill(track.p(), NSigmaTPC); - if (forceTof || track.hasTOF()) { - hProtonTOFPID->Fill(track.p(), NSigmaTOF); + hTPCPID->Fill(track.p(), NSigmaTPC); + if ((forceTof || track.hasTOF())) { + if (trackSpecies == kProtonForFemto) + hTOFPID->Fill(track.p(), NSigmaTOF); + else if (trackSpecies == kDeuteronForFemto && pt > ptThresholdPidStrategy) + hTOFPID->Fill(track.p(), NSigmaTOF); } } @@ -1531,9 +1608,9 @@ inline int HfFilterHelper::computeNumberOfCandidates(std::vector> /// \param ccdbApi is Api for CCDB /// \param bunchCrossing is the timestamp of bunchcrossing for the run number /// \param ccdbPaths are the paths on CCDB for pions, antipions, kaons, antikaons, protons, antiprotons -inline void HfFilterHelper::setValuesBB(o2::ccdb::CcdbApi& ccdbApi, aod::BCsWithTimestamps::iterator const& bunchCrossing, const std::array& ccdbPaths) +inline void HfFilterHelper::setValuesBB(o2::ccdb::CcdbApi& ccdbApi, aod::BCsWithTimestamps::iterator const& bunchCrossing, const std::array& ccdbPaths) { - for (int iSpecie{0u}; iSpecie < 6; ++iSpecie) { + for (int iSpecie{0u}; iSpecie < 8; ++iSpecie) { std::map metadata; auto hSpline = ccdbApi.retrieveFromTFileAny(ccdbPaths[iSpecie], metadata, bunchCrossing.timestamp()); @@ -1542,12 +1619,12 @@ inline void HfFilterHelper::setValuesBB(o2::ccdb::CcdbApi& ccdbApi, aod::BCsWith } TAxis* axis = hSpline->GetXaxis(); - mBetheBlochPiKaPr[iSpecie] = {static_cast(hSpline->GetBinContent(axis->FindBin("bb1"))), - static_cast(hSpline->GetBinContent(axis->FindBin("bb2"))), - static_cast(hSpline->GetBinContent(axis->FindBin("bb3"))), - static_cast(hSpline->GetBinContent(axis->FindBin("bb4"))), - static_cast(hSpline->GetBinContent(axis->FindBin("bb5"))), - static_cast(hSpline->GetBinContent(axis->FindBin("Resolution")))}; + mBetheBlochPiKaPrDe[iSpecie] = {static_cast(hSpline->GetBinContent(axis->FindBin("bb1"))), + static_cast(hSpline->GetBinContent(axis->FindBin("bb2"))), + static_cast(hSpline->GetBinContent(axis->FindBin("bb3"))), + static_cast(hSpline->GetBinContent(axis->FindBin("bb4"))), + static_cast(hSpline->GetBinContent(axis->FindBin("bb5"))), + static_cast(hSpline->GetBinContent(axis->FindBin("Resolution")))}; } } @@ -1561,16 +1638,16 @@ inline void HfFilterHelper::setTpcRecalibMaps(o2::framework::Service mapNames = {"mean_map_pion", "sigma_map_pion", "mean_map_kaon", "sigma_map_kaon", "mean_map_proton", "sigma_map_proton"}; + std::array mapNames = {"mean_map_pion", "sigma_map_pion", "mean_map_kaon", "sigma_map_kaon", "mean_map_proton", "sigma_map_proton", "mean_map_deuteron", "sigma_map_deuteron"}; for (size_t iMap = 0; iMap < mapNames.size(); iMap++) { - mHistMapPiPrKa[iMap] = nullptr; + mHistMapPiPrKaDe[iMap] = nullptr; } for (size_t iMap = 0; iMap < mapNames.size(); iMap++) { - mHistMapPiPrKa[iMap] = reinterpret_cast(calibList->FindObject(mapNames[iMap].data())); - if (!mHistMapPiPrKa[iMap]) { + mHistMapPiPrKaDe[iMap] = reinterpret_cast(calibList->FindObject(mapNames[iMap].data())); + if (!mHistMapPiPrKaDe[iMap]) { LOG(fatal) << "Cannot find histogram: " << mapNames[iMap].data(); return; } @@ -1745,14 +1822,16 @@ inline double HfFilterHelper::getTPCSplineCalib(const T& track, const int& pidSp mMassPar = massKa; } else if (pidSpecies == kPr || pidSpecies == kAntiPr) { mMassPar = massProton; + } else if (pidSpecies == kDe || pidSpecies == kAntiDe) { + mMassPar = massDeuteron; } else { LOGP(fatal, "TPC recalibrated Nsigma requested for unknown particle species, return 999"); return 999.; } auto bgScaling = 1 / mMassPar; - double expBethe = tpc::BetheBlochAleph(static_cast(track.tpcInnerParam() * bgScaling), mBetheBlochPiKaPr[pidSpecies][0], mBetheBlochPiKaPr[pidSpecies][1], mBetheBlochPiKaPr[pidSpecies][2], mBetheBlochPiKaPr[pidSpecies][3], mBetheBlochPiKaPr[pidSpecies][4]); - double expSigma = expBethe * mBetheBlochPiKaPr[pidSpecies][5]; + double expBethe = tpc::BetheBlochAleph(static_cast(track.tpcInnerParam() * bgScaling), mBetheBlochPiKaPrDe[pidSpecies][0], mBetheBlochPiKaPrDe[pidSpecies][1], mBetheBlochPiKaPrDe[pidSpecies][2], mBetheBlochPiKaPrDe[pidSpecies][3], mBetheBlochPiKaPrDe[pidSpecies][4]); + double expSigma = expBethe * mBetheBlochPiKaPrDe[pidSpecies][5]; return static_cast((track.tpcSignal() - expBethe) / expSigma); } @@ -1783,22 +1862,22 @@ inline float HfFilterHelper::getTPCPostCalib(const T& track, const int& pidSpeci } else { LOG(fatal) << "Wrong PID Species be selected, please check!"; } - if (!mHistMapPiPrKa[iHist] || !mHistMapPiPrKa[iHist + 1]) { + if (!mHistMapPiPrKaDe[iHist] || !mHistMapPiPrKaDe[iHist + 1]) { LOGP(warn, "Postcalibration TPC PID histograms not set. Use default Nsigma values."); } - auto binTPCNCls = mHistMapPiPrKa[iHist]->GetXaxis()->FindBin(tpcNCls); + auto binTPCNCls = mHistMapPiPrKaDe[iHist]->GetXaxis()->FindBin(tpcNCls); binTPCNCls = (binTPCNCls == 0 ? 1 : binTPCNCls); - binTPCNCls = std::min(mHistMapPiPrKa[iHist]->GetXaxis()->GetNbins(), binTPCNCls); - auto binPin = mHistMapPiPrKa[iHist]->GetYaxis()->FindBin(tpcPin); + binTPCNCls = std::min(mHistMapPiPrKaDe[iHist]->GetXaxis()->GetNbins(), binTPCNCls); + auto binPin = mHistMapPiPrKaDe[iHist]->GetYaxis()->FindBin(tpcPin); binPin = (binPin == 0 ? 1 : binPin); - binPin = std::min(mHistMapPiPrKa[iHist]->GetYaxis()->GetNbins(), binPin); - auto binEta = mHistMapPiPrKa[iHist]->GetZaxis()->FindBin(eta); + binPin = std::min(mHistMapPiPrKaDe[iHist]->GetYaxis()->GetNbins(), binPin); + auto binEta = mHistMapPiPrKaDe[iHist]->GetZaxis()->FindBin(eta); binEta = (binEta == 0 ? 1 : binEta); - binEta = std::min(mHistMapPiPrKa[iHist]->GetZaxis()->GetNbins(), binEta); + binEta = std::min(mHistMapPiPrKaDe[iHist]->GetZaxis()->GetNbins(), binEta); - auto mean = mHistMapPiPrKa[iHist]->GetBinContent(binTPCNCls, binPin, binEta); - auto width = mHistMapPiPrKa[iHist + 1]->GetBinContent(binTPCNCls, binPin, binEta); + auto mean = mHistMapPiPrKaDe[iHist]->GetBinContent(binTPCNCls, binPin, binEta); + auto width = mHistMapPiPrKaDe[iHist + 1]->GetBinContent(binTPCNCls, binPin, binEta); return (tpcNSigma - mean) / width; } @@ -1962,6 +2041,8 @@ DECLARE_SOA_COLUMN(DCAXY, dcaXY, float); //! DECLARE_SOA_COLUMN(KStar, kStar, float); //! DECLARE_SOA_COLUMN(NsigmaPrTPC, nsigmaPrTPC, float); //! DECLARE_SOA_COLUMN(NsigmaPrTOF, nsigmaPrTOF, float); //! +DECLARE_SOA_COLUMN(NsigmaDeTPC, nsigmaDeTPC, float); //! +DECLARE_SOA_COLUMN(NsigmaDeTOF, nsigmaDeTOF, float); //! } // namespace hfoptimisationTree DECLARE_SOA_TABLE(HFOptimisationTreeBeauty, "AOD", "HFOPTIMTREEB", //! @@ -1988,7 +2069,9 @@ DECLARE_SOA_TABLE(HFOptimisationTreeFemto, "AOD", "HFOPTIMTREEF", //! hfoptimisationTree::NonpromptBDT, hfoptimisationTree::KStar, hfoptimisationTree::NsigmaPrTPC, - hfoptimisationTree::NsigmaPrTOF); + hfoptimisationTree::NsigmaPrTOF, + hfoptimisationTree::NsigmaDeTPC, + hfoptimisationTree::NsigmaDeTOF); DECLARE_SOA_TABLE(HFOptimisationTreeCollisions, "AOD", "HFOPTIMTREECOLL", //! hfoptimisationTree::CollisionIndex) } // namespace o2::aod From f082186d8ab99af691b47df0bc2093574cddcf79 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Mon, 16 Dec 2024 01:34:30 +0100 Subject: [PATCH 395/459] [PWGCF] DptDpt - Tracking the TPC sector borders (#9000) Co-authored-by: Victor --- .../Tasks/dptDptEfficiencyAndQc.cxx | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx index 1fcb74db545..927464b65ca 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -23,6 +24,7 @@ #include "ReconstructionDataFormats/PID.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/TableHelper.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/PIDResponse.h" #include "Framework/ASoAHelpers.h" @@ -79,6 +81,10 @@ enum BeforeAfter { kAfter ///< filling after track selection }; +/* the structures for checking the TPC sector borders impact */ +constexpr int kNoOfTpcSectors = 18; +constexpr float kTpcPhiSectorWidth = (constants::math::TwoPI) / kNoOfTpcSectors; + /* the configuration of the nsigma axis */ float minNSigma = -4.05f; float maxNSigma = 4.05f; @@ -98,7 +104,7 @@ static const std::vector allmainsptitles{"e^{#plus}", "e^{#minus}", static const std::vector mainspecies{o2::track::PID::Pion, o2::track::PID::Kaon, o2::track::PID::Proton}; static const std::vector mainspnames{"PionP", "PionM", "KaonP", "KaonM", "ProtonP", "ProtonM"}; static const std::vector mainsptitles{"#pi^{#plus}", "#pi^{#minus}", "K^{#plus}", "K^{#minus}", "p", "#bar{p}"}; -static const std::vector pdgcodes = {11, 13, 211, 321, 2212}; +static const std::vector pdgcodes = {kElectron, kMuonPlus, kPiPlus, kKPlus, kProton}; } // namespace efficiencyandqatask /* the QA data collecting engine */ @@ -120,9 +126,17 @@ struct QADataCollectingEngine { std::vector> fhPtB{2, nullptr}; std::vector> fhPtVsEtaB{2, nullptr}; std::vector> fhPtVsZvtxB{2, nullptr}; + std::shared_ptr fhPhiVsPtPosB{nullptr}; + std::shared_ptr fhPhiVsInnerWallMomPosB{nullptr}; + std::shared_ptr fhPhiVsPtNegB{nullptr}; + std::shared_ptr fhPhiVsInnerWallMomNegB{nullptr}; std::vector>> fhPtA{2, {nsp, nullptr}}; std::vector>> fhPtVsEtaA{2, {nsp, nullptr}}; std::vector>> fhPtVsZvtxA{2, {nsp, nullptr}}; + std::vector> fhPhiVsPtA{nsp, nullptr}; + std::vector> fhPhiVsInnerWallMomA{nsp, nullptr}; + std::vector> fhPhiShiftedVsPtA{nsp, nullptr}; + std::vector> fhPhiShiftedVsInnerWallMomA{nsp, nullptr}; std::shared_ptr fhPtVsEtaItsAcc{nullptr}; std::shared_ptr fhPtVsEtaTpcAcc{nullptr}; std::shared_ptr fhPtVsEtaItsTpcAcc{nullptr}; @@ -182,11 +196,15 @@ struct QADataCollectingEngine { using namespace efficiencyandqatask; using namespace analysis::dptdptfilter; + AxisSpec pidPtAxis{150, 0.1, 5.0, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec pidPAxis{150, 0.1, 5.0, "#it{p} (GeV/#it{c})"}; + pidPtAxis.makeLogarithmic(); pidPAxis.makeLogarithmic(); const AxisSpec ptAxis{ptbins, ptlow, ptup, "#it{p}_{T} (GeV/c)"}; const AxisSpec etaAxis{etabins, etalow, etaup, "#eta"}; - const AxisSpec phiAxis{360, 0.0f, constants::math::TwoPI, "#varphi"}; + const AxisSpec phiAxis{360, 0.0f, constants::math::TwoPI, "#varphi (rad)"}; + const AxisSpec phiSectorAxis{144, 0.0f, 0.36, "#varphi (mod(2#pi/18) (rad))"}; + const AxisSpec phiShiftedSectorAxis{220, -55.0f, 55.0f, "% of the sector"}; const AxisSpec zvtxAxis{zvtxbins, zvtxlow, zvtxup, "#it{z}_{vtx}"}; const AxisSpec itsNClsAxis{8, -0.5, 7.5, "ITS n clusters"}; const AxisSpec itsCh2Axis{100, 0, 40, "#Chi^{2}/Cls ITS"}; @@ -209,6 +227,10 @@ struct QADataCollectingEngine { if constexpr (kindOfData == kReco) { /* only the reconstructed level histograms*/ + fhPhiVsPtPosB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "PhiVsPtPos", "#varphi (mod(2#pi/18))", kTH2F, {pidPtAxis, phiSectorAxis}); + fhPhiVsInnerWallMomPosB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "PhiVsIwMomPos", "#varphi (mod(2#pi/18)) TPC_{iw} #it{p}", kTH2F, {pidPAxis, phiSectorAxis}); + fhPhiVsPtNegB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "PhiVsPtNeg", "#varphi (mod(2#pi/18))", kTH2F, {pidPtAxis, phiSectorAxis}); + fhPhiVsInnerWallMomNegB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "PhiVsIwMomNeg", "#varphi (mod(2#pi/18)) TPC_{iw} #it{p}", kTH2F, {pidPAxis, phiSectorAxis}); fhItsNClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSNCls", "ITS clusters", kTH2F, {ptAxis, itsNClsAxis}); fhItsChi2NClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "ITSChi2NCls", "ITS #Chi^{2}", kTH2F, {ptAxis, itsCh2Axis}); fhTpcFindableNClsVsPtB = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "Before"), "TPCFindableNCls", "TPC findable clusters", kTH2F, {ptAxis, tpcNClsAxis}); @@ -227,6 +249,10 @@ struct QADataCollectingEngine { fhPtVsEtaTpcTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptTpcTofAcc", "TPC&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); fhPtVsEtaItsTpcTofAcc = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Efficiency", "Reco"), "ptItsTpcTofAcc", "ITS&TPC&TOF tracks within the acceptance", kTH2F, {etaAxis, ptAxis}); for (uint isp = 0; isp < nsp; ++isp) { + fhPhiVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("PhiVsPt_%s", tnames[isp].c_str()), HTITLESTRING("#varphi %s (mod(2#pi/18))", tnames[isp].c_str()), kTH2F, {pidPtAxis, phiSectorAxis}); + fhPhiVsInnerWallMomA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("PhiVsIwMom_%s", tnames[isp].c_str()), HTITLESTRING("#varphi %s (mod(2#pi/18)) TPC_{iw} #it{p}", tnames[isp].c_str()), kTH2F, {pidPAxis, phiSectorAxis}); + fhPhiShiftedVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("PhiShiftedVsPt_%s", tnames[isp].c_str()), HTITLESTRING("%s TPC sector %%", tnames[isp].c_str()), kTH2F, {pidPtAxis, phiShiftedSectorAxis}); + fhPhiShiftedVsInnerWallMomA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("PhiShiftedVsIwMom_%s", tnames[isp].c_str()), HTITLESTRING("%s TPC sector %% TPC_{iw} #it{p}", tnames[isp].c_str()), kTH2F, {pidPAxis, phiShiftedSectorAxis}); fhItsNClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("ITSNCls_%s", tnames[isp].c_str()), HTITLESTRING("ITS clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, itsNClsAxis}); fhItsChi2NClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("ITSChi2NCls_%s", tnames[isp].c_str()), HTITLESTRING("ITS #Chi^{2} %s", tnames[isp].c_str()), kTH2F, {ptAxis, itsCh2Axis}); fhTpcFindableNClsVsPtA[isp] = ADDHISTOGRAM(TH2, DIRECTORYSTRING("%s/%s/%s", dirname, "Reco", "After"), HNAMESTRING("TPCFindableNCls_%s", tnames[isp].c_str()), HTITLESTRING("TPC findable clusters %s", tnames[isp].c_str()), kTH2F, {ptAxis, tpcNClsAxis}); @@ -338,6 +364,16 @@ struct QADataCollectingEngine { bool hastpc = track.hasTPC() && TrackSelectionFlags::checkFlag(track.trackCutFlag(), TrackSelectionTPC); bool hastof = track.hasTOF(); + float phiInTpcSector = std::fmod(track.phi(), kTpcPhiSectorWidth); + float phiShiftedPercentInTpcSector = phiInTpcSector * 100 / kTpcPhiSectorWidth; + phiShiftedPercentInTpcSector = (phiShiftedPercentInTpcSector > 50.0f) ? (phiShiftedPercentInTpcSector - 100.0f) : phiShiftedPercentInTpcSector; + if (track.sign() > 0) { + fhPhiVsPtPosB->Fill(track.pt(), phiInTpcSector); + fhPhiVsInnerWallMomPosB->Fill(track.tpcInnerParam(), phiInTpcSector); + } else { + fhPhiVsPtNegB->Fill(track.pt(), phiInTpcSector); + fhPhiVsInnerWallMomNegB->Fill(track.tpcInnerParam(), phiInTpcSector); + } fhItsNClsVsPtB->Fill(track.pt(), track.itsNCls()); fhItsChi2NClsVsPtB->Fill(track.pt(), track.itsChi2NCl()); fhTpcFindableNClsVsPtB->Fill(track.pt(), track.tpcNClsFindable()); @@ -357,6 +393,10 @@ struct QADataCollectingEngine { fillhisto(fhPtVsEtaItsTpcTofAcc, hasits && hastpc && hastof); } if (!(track.trackacceptedid() < 0)) { + fhPhiVsPtA[track.trackacceptedid()]->Fill(track.pt(), phiInTpcSector); + fhPhiVsInnerWallMomA[track.trackacceptedid()]->Fill(track.tpcInnerParam(), phiInTpcSector); + fhPhiShiftedVsPtA[track.trackacceptedid()]->Fill(track.pt(), phiShiftedPercentInTpcSector); + fhPhiShiftedVsInnerWallMomA[track.trackacceptedid()]->Fill(track.tpcInnerParam(), phiShiftedPercentInTpcSector); fhItsNClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.itsNCls()); fhItsChi2NClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.itsChi2NCl()); fhTpcFindableNClsVsPtA[track.trackacceptedid()]->Fill(track.pt(), track.tpcNClsFindable()); From 25f8645eba5ce214e7ee09ec4d7a1779f6af925e Mon Sep 17 00:00:00 2001 From: Sasha Bylinkin <37345380+abylinkin@users.noreply.github.com> Date: Mon, 16 Dec 2024 02:43:51 +0100 Subject: [PATCH 396/459] [PWGUD] Data Model Change: IR and Occupancy (#8987) Co-authored-by: ALICE Action Bot --- PWGUD/DataModel/SGTables.h | 4 +- PWGUD/DataModel/UDTables.h | 20 +++++- PWGUD/TableProducer/CMakeLists.txt | 4 +- PWGUD/TableProducer/Converters/CMakeLists.txt | 4 ++ .../UDCollisionSelExtrasConverter.cxx | 59 +++++++++++++++ PWGUD/TableProducer/DGCandProducer.cxx | 35 ++++++++- PWGUD/TableProducer/SGCandProducer.cxx | 71 ++++++++++++++----- PWGUD/TableProducer/UPCCandidateProducer.cxx | 4 +- PWGUD/Tasks/sgPIDSpectraTable.cxx | 27 ++++--- 9 files changed, 195 insertions(+), 33 deletions(-) create mode 100644 PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx diff --git a/PWGUD/DataModel/SGTables.h b/PWGUD/DataModel/SGTables.h index a9bcd664063..bf9ef68da96 100644 --- a/PWGUD/DataModel/SGTables.h +++ b/PWGUD/DataModel/SGTables.h @@ -31,9 +31,11 @@ DECLARE_SOA_COLUMN(GS, gs, int); DECLARE_SOA_COLUMN(ZNA, zna, float); DECLARE_SOA_COLUMN(ZNC, znc, float); DECLARE_SOA_COLUMN(Ntr, ntr, int); +DECLARE_SOA_COLUMN(Occ, occ, int); +DECLARE_SOA_COLUMN(Ir, ir, float); } // namespace sgevent DECLARE_SOA_TABLE(SGEvents, "AOD", "SGEVENT", // o2::soa::Index<>, - sgevent::Run, sgevent::Flag, sgevent::GS, sgevent::ZNA, sgevent::ZNC, sgevent::Ntr); + sgevent::Run, sgevent::Flag, sgevent::GS, sgevent::ZNA, sgevent::ZNC, sgevent::Ntr, sgevent::Occ, sgevent::Ir); // sgevent::Run, sgevent::Flag); using SGEvent = SGEvents::iterator; namespace sgtrack diff --git a/PWGUD/DataModel/UDTables.h b/PWGUD/DataModel/UDTables.h index 8c5a796a578..b3f1f2354a2 100644 --- a/PWGUD/DataModel/UDTables.h +++ b/PWGUD/DataModel/UDTables.h @@ -101,6 +101,11 @@ DECLARE_SOA_COLUMN(TotalFV0AmplitudeA, totalFV0AmplitudeA, float); //! sum of am DECLARE_SOA_COLUMN(TimeFV0A, timeFV0A, float); //! FV0A average time DECLARE_SOA_COLUMN(TriggerMaskFV0A, triggerMaskFV0A, uint8_t); //! FV0 trigger mask DECLARE_SOA_COLUMN(ChFV0A, chFV0A, uint8_t); //! number of FV0A active channels +DECLARE_SOA_COLUMN(OccupancyInTime, occupancyInTime, int); +DECLARE_SOA_COLUMN(HadronicRate, hadronicRate, double); +DECLARE_SOA_COLUMN(Trs, trs, int); +DECLARE_SOA_COLUMN(Trofs, trofs, int); +DECLARE_SOA_COLUMN(Hmpr, hmpr, int); // Gap Side Information DECLARE_SOA_COLUMN(GapSide, gapSide, uint8_t); // 0 for side A, 1 for side C, 2 for both sides (or use an enum for better readability) // FIT selection flags @@ -203,13 +208,25 @@ DECLARE_SOA_TABLE(UDCollisionsSels, "AOD", "UDCOLLISIONSEL", udcollision::BBFV0A, udcollision::BGFV0A, udcollision::BBFDDA, udcollision::BBFDDC, udcollision::BGFDDA, udcollision::BGFDDC); -DECLARE_SOA_TABLE(UDCollisionSelExtras, "AOD", "UDCOLSELEXTRA", +DECLARE_SOA_TABLE(UDCollisionSelExtras_000, "AOD", "UDCOLSELEXTRA", udcollision::ChFT0A, //! number of active channels in FT0A udcollision::ChFT0C, //! number of active channels in FT0C udcollision::ChFDDA, //! number of active channels in FDDA udcollision::ChFDDC, //! number of active channels in FDDC udcollision::ChFV0A); //! number of active channels in FV0A +DECLARE_SOA_TABLE_VERSIONED(UDCollisionSelExtras_001, "AOD", "UDCOLSELEXTRA", 1, + udcollision::ChFT0A, //! number of active channels in FT0A + udcollision::ChFT0C, //! number of active channels in FT0C + udcollision::ChFDDA, //! number of active channels in FDDA + udcollision::ChFDDC, //! number of active channels in FDDC + udcollision::ChFV0A, //! number of active channels in FV0A + udcollision::OccupancyInTime, //! Occupancy + udcollision::HadronicRate, //! Interaction Rate + udcollision::Trs, + udcollision::Trofs, + udcollision::Hmpr); + // central barrel-specific selections DECLARE_SOA_TABLE(UDCollisionsSelsCent, "AOD", "UDCOLSELCNT", udcollision::DBcTOR, @@ -233,6 +250,7 @@ DECLARE_SOA_TABLE(UDMcCollsLabels, "AOD", "UDMCCOLLSLABEL", udcollision::UDMcCollisionId); using UDCollisions = UDCollisions_001; +using UDCollisionSelExtras = UDCollisionSelExtras_001; using UDCollision = UDCollisions::iterator; using SGCollision = SGCollisions::iterator; diff --git a/PWGUD/TableProducer/CMakeLists.txt b/PWGUD/TableProducer/CMakeLists.txt index 8234d926ef2..cc9943b366d 100644 --- a/PWGUD/TableProducer/CMakeLists.txt +++ b/PWGUD/TableProducer/CMakeLists.txt @@ -13,12 +13,12 @@ add_subdirectory(Converters) o2physics_add_dpl_workflow(dgcand-producer SOURCES DGCandProducer.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::DGCutparHolder + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::DGCutparHolder O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(sgcand-producer SOURCES SGCandProducer.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::SGCutParHolder + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::SGCutParHolder O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(dgbccand-producer diff --git a/PWGUD/TableProducer/Converters/CMakeLists.txt b/PWGUD/TableProducer/Converters/CMakeLists.txt index 3bcb34f6ac2..55267c0785b 100644 --- a/PWGUD/TableProducer/Converters/CMakeLists.txt +++ b/PWGUD/TableProducer/Converters/CMakeLists.txt @@ -20,3 +20,7 @@ o2physics_add_dpl_workflow(collisions-converter PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(collisionselextras-converter + SOURCES UDCollisionSelExtrasConverter.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx new file mode 100644 index 00000000000..1fa1882e7d5 --- /dev/null +++ b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx @@ -0,0 +1,59 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file UDCollisionSelExtrasConverter.cxx +/// \brief Converts UDCollisionSelExtras table from version 000 to 001 + +/// This task allows for the conversion of the UDCollisionSelExtras table from the version 000, +/// to include occupancy and interaction rate +/// to the version 001, that includes it + +/// executable name o2-analysis-ud-collisionselectras-converter + +/// \author Sasha Bylinkin + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "PWGUD/DataModel/UDTables.h" + +using namespace o2; +using namespace o2::framework; + +// Converts UDCollisions for version 000 to 001 +struct UDCollisionSelExtrasConverter { + Produces udCollisionSelExtras_001; + + void process(o2::aod::UDCollisionSelExtras_000 const& collisions) + { + + for (const auto& collision : collisions) { + + udCollisionSelExtras_001(collision.chFT0A(), + collision.chFT0C(), + collision.chFDDA(), + collision.chFDDC(), + collision.chFV0A(), + 0, // dummy occupancy + 0.0f, // dummy rate + 0, // dummy trs + 0, // dummy trofs + 0); // dummy hmpr + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + }; +} diff --git a/PWGUD/TableProducer/DGCandProducer.cxx b/PWGUD/TableProducer/DGCandProducer.cxx index 027cfd376ee..f7c9ff038ec 100644 --- a/PWGUD/TableProducer/DGCandProducer.cxx +++ b/PWGUD/TableProducer/DGCandProducer.cxx @@ -15,9 +15,11 @@ #include #include #include +#include "CCDB/BasicCCDBManager.h" #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "ReconstructionDataFormats/Vertex.h" +#include "Common/CCDB/ctpRateFetcher.h" #include "PWGUD/DataModel/UDTables.h" #include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/Core/DGSelector.h" @@ -27,6 +29,8 @@ using namespace o2::framework; using namespace o2::framework::expressions; struct DGCandProducer { + Service ccdb; + ctpRateFetcher mRateFetcher; // get a DGCutparHolder DGCutparHolder diffCuts = DGCutparHolder(); Configurable DGCuts{"DGCuts", {}, "DG event cuts"}; @@ -39,6 +43,7 @@ struct DGCandProducer { // data tables Produces outputCollisions; Produces outputCollisionsSels; + Produces outputCollisionSelExtras; Produces outputCollsLabels; Produces outputZdcs; Produces outputZdcsReduced; @@ -198,7 +203,9 @@ struct DGCandProducer { void init(InitContext&) { LOGF(debug, " beginning of init reached"); - + ccdb->setURL("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setFatalWhenNull(false); diffCuts = (DGCutparHolder)DGCuts; const int nXbinsInStatH = 25; @@ -250,6 +257,31 @@ struct DGCandProducer { } registry.get(HIST("reco/Stat"))->Fill(1., 1.); auto bc = collision.foundBC_as(); + int trs = 0; + if (collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + trs = 1; + } + int trofs = 0; + if (collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + trofs = 1; + } + int hmpr = 0; + if (collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { + hmpr = 1; + } + double ir = 0.; + const uint64_t ts = bc.timestamp(); + const int runnumber = bc.runNumber(); + if (bc.has_zdc()) { + ir = mRateFetcher.fetch(ccdb.service, ts, runnumber, "ZNC hadronic") * 1.e-3; + } + uint8_t chFT0A = 0; + uint8_t chFT0C = 0; + uint8_t chFDDA = 0; + uint8_t chFDDC = 0; + uint8_t chFV0A = 0; + int occ = 0; + occ = collision.trackOccupancyInTimeRange(); LOGF(debug, " BC id %d", bc.globalBC()); // fill FIT histograms @@ -289,6 +321,7 @@ struct DGCandProducer { fitInfo.BBFT0Apf, fitInfo.BBFT0Cpf, fitInfo.BGFT0Apf, fitInfo.BGFT0Cpf, fitInfo.BBFV0Apf, fitInfo.BGFV0Apf, fitInfo.BBFDDApf, fitInfo.BBFDDCpf, fitInfo.BGFDDApf, fitInfo.BGFDDCpf); + outputCollisionSelExtras(chFT0A, chFT0C, chFDDA, chFDDC, chFV0A, occ, ir, trs, trofs, hmpr); outputCollsLabels(collision.globalIndex()); // update DGTracks tables diff --git a/PWGUD/TableProducer/SGCandProducer.cxx b/PWGUD/TableProducer/SGCandProducer.cxx index 967e7a838d0..424e7d44b7f 100644 --- a/PWGUD/TableProducer/SGCandProducer.cxx +++ b/PWGUD/TableProducer/SGCandProducer.cxx @@ -12,16 +12,22 @@ #include #include #include +#include "CCDB/BasicCCDBManager.h" #include "Framework/ASoA.h" #include "Framework/AnalysisDataModel.h" #include "ReconstructionDataFormats/Vertex.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/DataModel/EventSelection.h" #include "CommonConstants/LHCConstants.h" #include "DataFormatsFIT/Triggers.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" -#include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/ctpRateFetcher.h" +#include "Common/DataModel/EventSelection.h" #include "PWGUD/DataModel/UDTables.h" #include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/Core/SGSelector.h" @@ -29,8 +35,22 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::dataformats; struct SGCandProducer { + Service ccdb; + // data inputs + using CCs = soa::Join; + using CC = CCs::iterator; + using BCs = soa::Join; + using BC = BCs::iterator; + using TCs = soa::Join; + using FWs = aod::FwdTracks; // get an SGCutparHolder SGCutParHolder sameCuts = SGCutParHolder(); // SGCutparHolder Configurable SGCuts{"SGCuts", {}, "SG event cuts"}; @@ -46,14 +66,15 @@ struct SGCandProducer { // Configurables to decide which tables are filled Configurable fillTrackTables{"fillTrackTables", true, "Fill track tables"}; Configurable fillFwdTrackTables{"fillFwdTrackTables", true, "Fill forward track tables"}; - // SG selector SGSelector sgSelector; + ctpRateFetcher mRateFetcher; // data tables Produces outputSGCollisions; Produces outputCollisions; Produces outputCollisionsSels; + Produces outputCollisionSelExtras; Produces outputCollsLabels; Produces outputZdcs; Produces udZdcsReduced; @@ -73,19 +94,6 @@ struct SGCandProducer { "registry", {}}; - // data inputs - using CCs = soa::Join; - using CC = CCs::iterator; - using BCs = soa::Join; - using BC = BCs::iterator; - using TCs = soa::Join; - using FWs = aod::FwdTracks; - // function to update UDFwdTracks, UDFwdTracksExtra template void updateUDFwdTrackTables(TFwdTrack const& fwdtrack, uint64_t const& bcnum) @@ -165,6 +173,9 @@ struct SGCandProducer { void init(InitContext&) { + ccdb->setURL("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setFatalWhenNull(false); sameCuts = (SGCutParHolder)SGCuts; registry.add("reco/Stat", "Cut statistics; Selection criterion; Collisions", {HistType::kTH1F, {{14, -0.5, 13.5}}}); } @@ -206,7 +217,25 @@ struct SGCandProducer { return; } registry.get(HIST("reco/Stat"))->Fill(6., 1.); + int trs = 0; + if (collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + trs = 1; + } + int trofs = 0; + if (collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + trofs = 1; + } + int hmpr = 0; + if (collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { + hmpr = 1; + } auto bc = collision.foundBC_as(); + double ir = 0.; + const uint64_t ts = bc.timestamp(); + const int runnumber = bc.runNumber(); + if (bc.has_zdc()) { + ir = mRateFetcher.fetch(ccdb.service, ts, runnumber, "ZNC hadronic") * 1.e-3; + } auto newbc = bc; // obtain slice of compatible BCs @@ -229,6 +258,13 @@ struct SGCandProducer { return; } upchelpers::FITInfo fitInfo{}; + uint8_t chFT0A = 0; + uint8_t chFT0C = 0; + uint8_t chFDDA = 0; + uint8_t chFDDC = 0; + uint8_t chFV0A = 0; + int occ = 0; + occ = collision.trackOccupancyInTimeRange(); udhelpers::getFITinfo(fitInfo, newbc, bcs, ft0s, fv0as, fdds); // update SG candidates tables int upc_flag = 0; @@ -249,6 +285,7 @@ struct SGCandProducer { fitInfo.BBFT0Apf, fitInfo.BBFT0Cpf, fitInfo.BGFT0Apf, fitInfo.BGFT0Cpf, fitInfo.BBFV0Apf, fitInfo.BGFV0Apf, fitInfo.BBFDDApf, fitInfo.BBFDDCpf, fitInfo.BGFDDApf, fitInfo.BGFDDCpf); + outputCollisionSelExtras(chFT0A, chFT0C, chFDDA, chFDDC, chFV0A, occ, ir, trs, trofs, hmpr); outputCollsLabels(collision.globalIndex()); if (newbc.has_zdc()) { auto zdc = newbc.zdc(); diff --git a/PWGUD/TableProducer/UPCCandidateProducer.cxx b/PWGUD/TableProducer/UPCCandidateProducer.cxx index 5eba6e0c2ef..f93bea732b4 100644 --- a/PWGUD/TableProducer/UPCCandidateProducer.cxx +++ b/PWGUD/TableProducer/UPCCandidateProducer.cxx @@ -1466,7 +1466,7 @@ struct UpcCandProducer { fitInfo.BBFT0Apf, fitInfo.BBFT0Cpf, fitInfo.BGFT0Apf, fitInfo.BGFT0Cpf, fitInfo.BBFV0Apf, fitInfo.BGFV0Apf, fitInfo.BBFDDApf, fitInfo.BBFDDCpf, fitInfo.BGFDDApf, fitInfo.BGFDDCpf); - eventCandidatesSelExtras(chFT0A, chFT0C, chFDDA, chFDDC, chFV0A); + eventCandidatesSelExtras(chFT0A, chFT0C, chFDDA, chFDDC, chFV0A, 0, 0, 0, 0, 0); eventCandidatesSelsFwd(fitInfo.distClosestBcV0A, fitInfo.distClosestBcT0A, amplitudesT0A, @@ -1724,7 +1724,7 @@ struct UpcCandProducer { fitInfo.BBFT0Apf, fitInfo.BBFT0Cpf, fitInfo.BGFT0Apf, fitInfo.BGFT0Cpf, fitInfo.BBFV0Apf, fitInfo.BGFV0Apf, fitInfo.BBFDDApf, fitInfo.BBFDDCpf, fitInfo.BGFDDApf, fitInfo.BGFDDCpf); - eventCandidatesSelExtras(chFT0A, chFT0C, chFDDA, chFDDC, chFV0A); + eventCandidatesSelExtras(chFT0A, chFT0C, chFDDA, chFDDC, chFV0A, 0, 0, 0, 0, 0); eventCandidatesSelsFwd(fitInfo.distClosestBcV0A, fitInfo.distClosestBcT0A, amplitudesT0A, diff --git a/PWGUD/Tasks/sgPIDSpectraTable.cxx b/PWGUD/Tasks/sgPIDSpectraTable.cxx index f8e6e69373c..9a370403a6b 100644 --- a/PWGUD/Tasks/sgPIDSpectraTable.cxx +++ b/PWGUD/Tasks/sgPIDSpectraTable.cxx @@ -52,6 +52,11 @@ struct SGPIDSpectraTable { Configurable itsChi2_cut{"itsChi2_cut", 36, "Max itsChi2NCl"}; Configurable eta_cut{"eta_cut", 0.9, "Track Pseudorapidity"}; Configurable pt_cut{"pt_cut", 0.1, "Track Pt"}; + Configurable occ_cut{"occ_cut", 200, "Maximum Occupancy"}; + Configurable occ_bit1_cut{"occ_bit1_cut", 0, "Check NoCollInTimeRangeStandard"}; + Configurable occ_bit2_cut{"occ_bit2_cut", 0, "Check NoCollInRofStandard"}; + Configurable occ_bit3_cut{"occ_bit3_cut", 0, "Check NoHighMultCollInPrevRof"}; + Configurable ir_cut{"ir_cut", 100, "Maximum IR"}; // initialize histogram registry HistogramRegistry registry{ "registry", @@ -63,7 +68,7 @@ struct SGPIDSpectraTable { } // define data types - using UDCollisionsFull = soa::Join; // UDCollisions + using UDCollisionsFull = soa::Join; // UDCollisions using UDCollisionFull = UDCollisionsFull::iterator; using UDTracksFull = soa::Join; @@ -76,6 +81,17 @@ struct SGPIDSpectraTable { return; } // fill collision histograms + // check occupancies: + if (occ_bit1_cut && !coll.trs()) + return; + if (occ_bit2_cut && !coll.trofs()) + return; + if (occ_bit3_cut && !coll.hmpr()) + return; + if (coll.occupancyInTime() > occ_cut) + return; + if (coll.hadronicRate() > ir_cut) + return; // int truegapSide = sgSelector.trueGap(dgcand, FV0_cut, ZDC_cut); // select PV contributors std::vector parameters = {PV_cut, dcaZ_cut, dcaXY_cut, tpcChi2_cut, tpcNClsFindable_cut, itsChi2_cut, eta_cut, pt_cut}; @@ -91,7 +107,7 @@ struct SGPIDSpectraTable { } if (!goodtracks) return; - SGevents(coll.runNumber(), coll.flags(), truegapSide, coll.energyCommonZNA(), coll.energyCommonZNC(), goodtracks); + SGevents(coll.runNumber(), coll.flags(), truegapSide, coll.energyCommonZNA(), coll.energyCommonZNC(), goodtracks, coll.occupancyInTime(), coll.hadronicRate()); // SGevents(coll.runNumber(), coll.flags()); for (auto t : tracks) { if (trackselector(t, parameters)) { @@ -107,14 +123,7 @@ struct SGPIDSpectraTable { tofpr = t.hasTOF() ? t.tofNSigmaPr() : -999; tofel = t.hasTOF() ? t.tofNSigmaEl() : -999; tpcde = t.hasTPC() ? t.tpcNSigmaDe() : -999; - // tpctr = t.hasTPC() ? t.tpcNSigmaTr() : -999; - // tpche = t.hasTPC() ? t.tpcNSigmaHe() : -999; - // tpcal = t.hasTPC() ? t.tpcNSigmaAl() : -999; tofde = t.hasTOF() ? t.tofNSigmaDe() : -999; - // toftr = t.hasTOF() ? t.tofNSigmaTr() : -999; - // tofhe = t.hasTOF() ? t.tofNSigmaHe() : -999; - // tofal = t.hasTOF() ? t.tofNSigmaAl() : -999; - // SGtracks(SGevents.lastIndex(),a.Pt(),a.Eta(),a.Phi(),t.sign(),tpcpi, tpcka, tpcpr, tpcel, tofpi, tofka, tofpr, tofel, tpcmu, tofmu, tpcde, tpctr, tpche, tpcal, tofde, toftr, tofhe, tofal); SGtracks(SGevents.lastIndex(), a.Pt(), a.Eta(), a.Phi(), t.sign(), tpcpi, tpcka, tpcpr, tpcel, tofpi, tofka, tofpr, tofel, tpcmu, tofmu, tpcde, tofde); } } From 2021dcae6f9ea6f0a1445b98e348cd7f5f139ff1 Mon Sep 17 00:00:00 2001 From: abilandz Date: Mon, 16 Dec 2024 02:59:10 +0100 Subject: [PATCH 397/459] [PWGCF] new group of QA histos + minor fixes (#8998) --- .../Core/MuPa-Configurables.h | 3 + .../Core/MuPa-DataMembers.h | 46 +- .../Core/MuPa-Enums.h | 32 + .../Core/MuPa-MemberFunctions.h | 758 +++++++++++++----- .../Tasks/multiparticle-correlations-ab.cxx | 1 - 5 files changed, 633 insertions(+), 207 deletions(-) diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h index 7c5012a3804..30c3e38eca5 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Configurables.h @@ -49,6 +49,9 @@ struct : ConfigurableGroup { Configurable> cfBookQAEventHistograms2D{"cfBookQAEventHistograms2D", {"1-Multiplicity_vs_ReferenceMultiplicity", "1-Multiplicity_vs_NContributors", "1-Multiplicity_vs_Centrality", "1-Multiplicity_vs_Vertex_z", "1-Multiplicity_vs_Occupancy", "1-ReferenceMultiplicity_vs_NContributors", "1-ReferenceMultiplicity_vs_Centrality", "1-ReferenceMultiplicity_vs_Vertex_z", "1-ReferenceMultiplicity_vs_Occupancy", "1-NContributors_vs_Centrality", "1-NContributors_vs_Vertex_z", "1-NContributors_vs_Occupancy", "1-Centrality_vs_Vertex_z", "1-Centrality_vs_Occupancy", "0-Centrality_vs_ImpactParameter", "1-Vertex_z_vs_Occupancy", "0-MultNTracksPV_vs_MultNTracksGlobal", "0-CentFT0C_vs_CentNTPV", "0-CentFT0M_vs_CentNTPV", "0-CentRun2V0M_vs_CentRun2SPDTracklets", "1-TrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange", "1-CurrentRunDuration_vs_InteractionRate"}, "book (1) or do not book (0) this QA 2D event histogram"}; Configurable cfFillQAParticleHistograms2D{"cfFillQAParticleHistograms2D", false, "if false, all QA 2D particle histograms are not filled. if true, only the ones for which fBookQAParticleHistograms2D[...] is true, are filled"}; Configurable> cfBookQAParticleHistograms2D{"cfBookQAParticleHistograms2D", {"1-Pt_vs_dcaXY"}, "book (1) or do not book (0) this QA 2D particle histogram"}; + Configurable cfFillQAParticleEventHistograms2D{"cfFillQAParticleEventHistograms2D", false, "if false, all QA 2D particle event histograms are not filled. if true, only the ones for which fBookQAParticleEventHistograms2D[...] is true, are filled"}; + Configurable> cfBookQAParticleEventHistograms2D{"cfBookQAParticleEventHistograms2D", {"1-CurrentRunDuration_vs_itsNCls", "1-CurrentRunDuration_vs_itsNClsNegEtaEbyE", "1-CurrentRunDuration_vs_itsNClsPosEtaEbyE", "1-CurrentRunDuration_vs_Eta0804EbyE", "1-CurrentRunDuration_vs_Eta0400EbyE", "1-CurrentRunDuration_vs_Eta0004EbyE", "1-CurrentRunDuration_vs_Eta0408EbyE", "1-CurrentRunDuration_vs_Pt0005EbyE", "1-CurrentRunDuration_vs_Pt0510EbyE", "1-CurrentRunDuration_vs_Pt1050EbyE"}, "book (1) or do not book (0) this QA 2D particle event histogram"}; + } cf_qa; // *) Event histograms: diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h index 01cd067855f..b09eb50a02d 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-DataMembers.h @@ -84,27 +84,43 @@ struct EventByEventQuantities { // Remark 1: I keep new histograms in this group, until I need them permanently in the analysis. Then, they are moved to EventHistograms or ParticleHistograms (yes, even if they are 2D). // Remark 2: All 2D histograms book as TH2F, due to "stmem error" in terminate (see .cxx for further details) struct QualityAssurance { - TList* fQAList = NULL; //! event-by-event + // [reco, sim][before, after]. Type dimension is bin. + Float_t fReferenceMultiplicity[eReferenceMultiplicityEstimators_N] = {0.}; // used mostly in QA correlation plots TString fReferenceMultiplicityEstimatorName[eReferenceMultiplicityEstimators_N] = {""}; // TBI 20241123 add comment Float_t fCentrality[eCentralityEstimators_N] = {0.}; // used mostly in QA correlation plots TString fCentralityEstimatorName[eCentralityEstimators_N] = {""}; // TBI 20241123 add comment Float_t fOccupancy[eOccupancyEstimators_N] = {0.}; // used mostly in QA correlation plots TString fOccupancyEstimatorName[eOccupancyEstimators_N] = {""}; // TBI 20241123 add comment -} qa; // "qa" is a common label for objects in this struct + +} qa; // "qa" is a common label for objects in this struct // *) Event histograms: struct EventHistograms { diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h index b7a904d1578..7fdd8054b94 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-Enums.h @@ -278,6 +278,38 @@ enum eQAParticleHistograms2D { eQAParticleHistograms2D_N }; +enum eQAParticleEventHistograms2D { + // In this category I do correlation vs. some-event-property. + // The < ... > goes over all particles in that event. + // All < ... > over particles are calculated with helper TProfile + // For instance: vs. current run duration + eCurrentRunDuration_vs_itsNClsEbyE, + eCurrentRunDuration_vs_itsNClsNegEtaEbyE, + eCurrentRunDuration_vs_itsNClsPosEtaEbyE, + eCurrentRunDuration_vs_Eta0804EbyE, + eCurrentRunDuration_vs_Eta0400EbyE, + eCurrentRunDuration_vs_Eta0004EbyE, + eCurrentRunDuration_vs_Eta0408EbyE, + eCurrentRunDuration_vs_Pt0005EbyE, + eCurrentRunDuration_vs_Pt0510EbyE, + eCurrentRunDuration_vs_Pt1050EbyE, + eQAParticleEventHistograms2D_N +}; + +enum eQAParticleEventProEbyE { + eitsNClsEbyE = 1, // Labels average in a given event (therefore "EbyE" is appended). Yes, from one, because it runs over bin content and entries in TProfile for most of the time. + eitsNClsNegEtaEbyE, // in a given event for eta < 0 + eitsNClsPosEtaEbyE, // in a given event for eta > 0 + eEta0804EbyE, // in a given event for -0.8 < eta < -0.4 + eEta0400EbyE, // in a given event for -0.4 < eta < 0.0 + eEta0004EbyE, // in a given event for 0.0 < eta < 0.4 + eEta0408EbyE, // in a given event for 0.4 < eta < 0.8 + ePt0005EbyE, // in a given event for 0.0 < pt < 0.5 + ePt0510EbyE, // in a given event for 0.5 < pt < 1.0 + ePt1050EbyE, // in a given event for 1.0 < pt < 5.0 + eQAParticleEventProEbyE_N +}; + enum eReferenceMultiplicityEstimators { // Run 3: eMultTPC = 0, diff --git a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h index 8cd74c814d5..58358985a5d 100644 --- a/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h +++ b/PWGCF/MultiparticleCorrelations/Core/MuPa-MemberFunctions.h @@ -574,6 +574,27 @@ void DefaultConfiguration() } } + // **) Names of QA 2D particle event histograms: + qa.fQAParticleEventHistogramsName2D[eCurrentRunDuration_vs_itsNClsEbyE] = TString::Format("%s_vs_%s", eh.fEventHistogramsName[eCurrentRunDuration].Data(), ph.fParticleHistogramsName[eitsNCls].Data()).Data(); + qa.fQAParticleEventHistogramsName2D[eCurrentRunDuration_vs_itsNClsNegEtaEbyE] = TString::Format("%s_vs_%s", eh.fEventHistogramsName[eCurrentRunDuration].Data(), TString(ph.fParticleHistogramsName[eitsNCls].Data()).Append("NegEtaEbyE").Data()).Data(); // TBI 20241214 time will tell if this Append() is safe enough... Remember that Append works in-place + qa.fQAParticleEventHistogramsName2D[eCurrentRunDuration_vs_itsNClsPosEtaEbyE] = TString::Format("%s_vs_%s", eh.fEventHistogramsName[eCurrentRunDuration].Data(), TString(ph.fParticleHistogramsName[eitsNCls].Data()).Append("PosEtaEbyE").Data()).Data(); // TBI 20241214 time will tell if this Append() is safe enough... Remember that Append works in-place + qa.fQAParticleEventHistogramsName2D[eCurrentRunDuration_vs_Eta0804EbyE] = TString::Format("%s_vs_%s", eh.fEventHistogramsName[eCurrentRunDuration].Data(), TString(ph.fParticleHistogramsName[eEta].Data()).Append("0804EbyE").Data()).Data(); // TBI 20241214 time will tell if this Append() is safe enough... Remember that Append works in-place + qa.fQAParticleEventHistogramsName2D[eCurrentRunDuration_vs_Eta0400EbyE] = TString::Format("%s_vs_%s", eh.fEventHistogramsName[eCurrentRunDuration].Data(), TString(ph.fParticleHistogramsName[eEta].Data()).Append("0400EbyE").Data()).Data(); // TBI 20241214 time will tell if this Append() is safe enough... Remember that Append works in-place + qa.fQAParticleEventHistogramsName2D[eCurrentRunDuration_vs_Eta0004EbyE] = TString::Format("%s_vs_%s", eh.fEventHistogramsName[eCurrentRunDuration].Data(), TString(ph.fParticleHistogramsName[eEta].Data()).Append("0004EbyE").Data()).Data(); // TBI 20241214 time will tell if this Append() is safe enough... Remember that Append works in-place + qa.fQAParticleEventHistogramsName2D[eCurrentRunDuration_vs_Eta0408EbyE] = TString::Format("%s_vs_%s", eh.fEventHistogramsName[eCurrentRunDuration].Data(), TString(ph.fParticleHistogramsName[eEta].Data()).Append("0408EbyE").Data()).Data(); // TBI 20241214 time will tell if this Append() is safe enough... Remember that Append works in-place + qa.fQAParticleEventHistogramsName2D[eCurrentRunDuration_vs_Pt0005EbyE] = TString::Format("%s_vs_%s", eh.fEventHistogramsName[eCurrentRunDuration].Data(), TString(ph.fParticleHistogramsName[ePt].Data()).Append("0005EbyE").Data()).Data(); // TBI 20241214 time will tell if this Append() is safe enough... Remember that Append works in-place + qa.fQAParticleEventHistogramsName2D[eCurrentRunDuration_vs_Pt0510EbyE] = TString::Format("%s_vs_%s", eh.fEventHistogramsName[eCurrentRunDuration].Data(), TString(ph.fParticleHistogramsName[ePt].Data()).Append("0510EbyE").Data()).Data(); // TBI 20241214 time will tell if this Append() is safe enough... Remember that Append works in-place + qa.fQAParticleEventHistogramsName2D[eCurrentRunDuration_vs_Pt1050EbyE] = TString::Format("%s_vs_%s", eh.fEventHistogramsName[eCurrentRunDuration].Data(), TString(ph.fParticleHistogramsName[ePt].Data()).Append("1050EbyE").Data()).Data(); // TBI 20241214 time will tell if this Append() is safe enough... Remember that Append works in-place + + // ... + + // ***) Quick insanity check that all names are set: + for (Int_t t = 0; t < eQAParticleEventHistograms2D_N; t++) { + if (qa.fQAParticleEventHistogramsName2D[t].EqualTo("")) { + LOGF(fatal, "\033[1;31m%s at line %d : qa.fQAParticleEventHistogramsName2D[%d] is not set, check corresponding enum eQAParticleEventHistograms2D \033[0m", __FUNCTION__, __LINE__, t); + } + } + // ** Eta separations: es.fCalculateEtaSeparations = cf_es.cfCalculateEtaSeparations; es.fCalculateEtaSeparationsAsFunctionOf[AFO_INTEGRATED] = cf_es.cfCalculateEtaSeparationsAsFunctionOfIntegrated && es.fCalculateEtaSeparations; @@ -683,44 +704,42 @@ void DefaultBooking() // By default all event histograms are booked. Set this flag to kFALSE to switch off booking of all event histograms: eh.fFillEventHistograms = cf_eh.cfFillEventHistograms; - if (eh.fFillEventHistograms) { - // *) By default all event histograms are booked. If you do not want particular event histogram to be booked, - // use configurable array cfBookEventHistograms, where you can specify name of the histogram accompanied with flags 1 (book) or 0 (do not book). - // Supported format: "someName-0" and "someName-1", where "-" is a field separator. - // Ordering of the flags in that array is interpreted through ordering of enums in enum eEventHistograms. - auto lBookEventHistograms = cf_eh.cfBookEventHistograms.value; // this is now the local version of that string array from configurable. - if (lBookEventHistograms.size() != eEventHistograms_N) { - LOGF(info, "\033[1;31m lBookEventHistograms.size() = %d\033[0m", lBookEventHistograms.size()); - LOGF(info, "\033[1;31m eEventHistograms_N) = %d\033[0m", static_cast(eEventHistograms_N)); - LOGF(fatal, "\033[1;31m%s at line %d : Mismatch in the number of flags in configurable cfBookEventHistograms, and number of entries in enum eEventHistograms \n \033[0m", __FUNCTION__, __LINE__); - } - - // *) Insanity check on the content and ordering of histogram names in the initialization in configurable cfBookEventHistograms: - // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. - for (Int_t name = 0; name < eEventHistograms_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookEventHistograms[name]).EndsWith(eh.fEventHistogramsName[name].Data())) { - LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookEventHistograms => name = %d, lBookEventHistograms[%d] = \"%s\", eh.fEventHistogramsName[%d] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, name, TString(lBookEventHistograms[name]).Data(), name, eh.fEventHistogramsName[name].Data()); - } - } - - // I append "&& eh.fFillEventHistograms" below, to switch off booking of all event histograms with one common flag: - eh.fBookEventHistograms[eNumberOfEvents] = Alright(lBookEventHistograms[eNumberOfEvents]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eTotalMultiplicity] = Alright(lBookEventHistograms[eTotalMultiplicity]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eMultiplicity] = Alright(lBookEventHistograms[eMultiplicity]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eReferenceMultiplicity] = Alright(lBookEventHistograms[eReferenceMultiplicity]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eCentrality] = Alright(lBookEventHistograms[eCentrality]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eVertex_x] = Alright(lBookEventHistograms[eVertex_x]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eVertex_y] = Alright(lBookEventHistograms[eVertex_y]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eVertex_z] = Alright(lBookEventHistograms[eVertex_z]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eNContributors] = Alright(lBookEventHistograms[eNContributors]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eImpactParameter] = Alright(lBookEventHistograms[eImpactParameter]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eEventPlaneAngle] = Alright(lBookEventHistograms[eEventPlaneAngle]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eOccupancy] = Alright(lBookEventHistograms[eOccupancy]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eInteractionRate] = Alright(lBookEventHistograms[eInteractionRate]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eCurrentRunDuration] = Alright(lBookEventHistograms[eCurrentRunDuration]) && eh.fFillEventHistograms; - eh.fBookEventHistograms[eMultMCNParticlesEta08] = Alright(lBookEventHistograms[eMultMCNParticlesEta08]) && eh.fFillEventHistograms; - } // end of if (eh.fFillEventHistograms) + // *) By default all event histograms are booked. If you do not want particular event histogram to be booked, + // use configurable array cfBookEventHistograms, where you can specify name of the histogram accompanied with flags 1 (book) or 0 (do not book). + // Supported format: "someName-0" and "someName-1", where "-" is a field separator. + // Ordering of the flags in that array is interpreted through ordering of enums in enum eEventHistograms. + auto lBookEventHistograms = cf_eh.cfBookEventHistograms.value; // this is now the local version of that string array from configurable. + if (lBookEventHistograms.size() != eEventHistograms_N) { + LOGF(info, "\033[1;31m lBookEventHistograms.size() = %d\033[0m", lBookEventHistograms.size()); + LOGF(info, "\033[1;31m eEventHistograms_N) = %d\033[0m", static_cast(eEventHistograms_N)); + LOGF(fatal, "\033[1;31m%s at line %d : Mismatch in the number of flags in configurable cfBookEventHistograms, and number of entries in enum eEventHistograms \n \033[0m", __FUNCTION__, __LINE__); + } + + // *) Insanity check on the content and ordering of histogram names in the initialization in configurable cfBookEventHistograms: + // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. + for (Int_t name = 0; name < eEventHistograms_N; name++) { + // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookEventHistograms[name]).EndsWith(eh.fEventHistogramsName[name].Data())) { + LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookEventHistograms => name = %d, lBookEventHistograms[%d] = \"%s\", eh.fEventHistogramsName[%d] = \"%s\" \n Check if you are using an up to date tag. \033[0m", __FUNCTION__, __LINE__, name, name, TString(lBookEventHistograms[name]).Data(), name, eh.fEventHistogramsName[name].Data()); + } + } + + // I append "&& eh.fFillEventHistograms" below, to switch off booking of all event histograms with one common flag: + eh.fBookEventHistograms[eNumberOfEvents] = Alright(lBookEventHistograms[eNumberOfEvents]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eTotalMultiplicity] = Alright(lBookEventHistograms[eTotalMultiplicity]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eMultiplicity] = Alright(lBookEventHistograms[eMultiplicity]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eReferenceMultiplicity] = Alright(lBookEventHistograms[eReferenceMultiplicity]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eCentrality] = Alright(lBookEventHistograms[eCentrality]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eVertex_x] = Alright(lBookEventHistograms[eVertex_x]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eVertex_y] = Alright(lBookEventHistograms[eVertex_y]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eVertex_z] = Alright(lBookEventHistograms[eVertex_z]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eNContributors] = Alright(lBookEventHistograms[eNContributors]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eImpactParameter] = Alright(lBookEventHistograms[eImpactParameter]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eEventPlaneAngle] = Alright(lBookEventHistograms[eEventPlaneAngle]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eOccupancy] = Alright(lBookEventHistograms[eOccupancy]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eInteractionRate] = Alright(lBookEventHistograms[eInteractionRate]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eCurrentRunDuration] = Alright(lBookEventHistograms[eCurrentRunDuration]) && eh.fFillEventHistograms; + eh.fBookEventHistograms[eMultMCNParticlesEta08] = Alright(lBookEventHistograms[eMultMCNParticlesEta08]) && eh.fFillEventHistograms; // b) Event histograms 2D: // TBI 20240515 Ideally, all 2D shall go to QA group, see below @@ -730,150 +749,175 @@ void DefaultBooking() // By default all 1D particle histograms are booked. Set this flag to kFALSE to switch off booking of all 1D particle histograms: ph.fFillParticleHistograms = cf_ph.cfFillParticleHistograms; - if (ph.fFillParticleHistograms) { - // *) If you do not want particular particle histogram to be booked, use configurable array cfBookParticleHistograms, where you can specify flags 1 (book) or 0 (do not book). - // Ordering of the flags in that array is interpreted through ordering of enums in enum eParticleHistograms. // TBI 20240124 is this safe enough? - auto lBookParticleHistograms = cf_ph.cfBookParticleHistograms.value; // this is now the local version of that string array from configurable. - if (lBookParticleHistograms.size() != eParticleHistograms_N) { - LOGF(info, "\033[1;31m lBookParticleHistograms.size() = %d\033[0m", lBookParticleHistograms.size()); - LOGF(info, "\033[1;31m eParticleHistograms_N) = %d\033[0m", static_cast(eParticleHistograms_N)); - LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookParticleHistograms, and number of entries in enum eParticleHistograms \n \033[0m", __FUNCTION__, __LINE__); - } - - // *) Insanity check on the content and ordering of particle histograms in the initialization in configurable cfBookParticleHistograms: - // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. - for (Int_t name = 0; name < eParticleHistograms_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookParticleHistograms[name]).EndsWith(ph.fParticleHistogramsName[name].Data())) { - LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookParticleHistograms => name = %d, lBookParticleHistograms[name] = \"%s\", ph.fParticleHistogramsName[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookParticleHistograms[name]).Data(), ph.fParticleHistogramsName[name].Data()); - } - } - - // I append "&& ph.fFillParticleHistograms" below, to switch off booking of all 1D particle histograms with one common flag: - ph.fBookParticleHistograms[ePhi] = Alright(lBookParticleHistograms[ePhi]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[ePt] = Alright(lBookParticleHistograms[ePt]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[eEta] = Alright(lBookParticleHistograms[eEta]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[eCharge] = Alright(lBookParticleHistograms[eCharge]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcNClsFindable] = Alright(lBookParticleHistograms[etpcNClsFindable]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcNClsShared] = Alright(lBookParticleHistograms[etpcNClsShared]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcNClsFound] = Alright(lBookParticleHistograms[etpcNClsFound]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcNClsCrossedRows] = Alright(lBookParticleHistograms[etpcNClsCrossedRows]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[eitsNCls] = Alright(lBookParticleHistograms[eitsNCls]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[eitsNClsInnerBarrel] = Alright(lBookParticleHistograms[eitsNClsInnerBarrel]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcCrossedRowsOverFindableCls] = Alright(lBookParticleHistograms[etpcCrossedRowsOverFindableCls]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcFoundOverFindableCls] = Alright(lBookParticleHistograms[etpcFoundOverFindableCls]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[etpcFractionSharedCls] = Alright(lBookParticleHistograms[etpcFractionSharedCls]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[edcaXY] = Alright(lBookParticleHistograms[edcaXY]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[edcaZ] = Alright(lBookParticleHistograms[edcaZ]) && ph.fFillParticleHistograms; - ph.fBookParticleHistograms[ePDG] = Alright(lBookParticleHistograms[ePDG]) && ph.fFillParticleHistograms; - // Remark #1: I do not need here anythig for etrackCutFlagFb1, etrackCutFlagFb2, ... eisGlobalTrack, because they are booleans - // Remark #2: Nothing special here for ePtDependentDCAxyParameterization, because that is a string. - } // end of if(ph.fFillParticleHistograms) + // *) If you do not want particular particle histogram to be booked, use configurable array cfBookParticleHistograms, where you can specify flags 1 (book) or 0 (do not book). + // Ordering of the flags in that array is interpreted through ordering of enums in enum eParticleHistograms. // TBI 20240124 is this safe enough? + auto lBookParticleHistograms = cf_ph.cfBookParticleHistograms.value; // this is now the local version of that string array from configurable. + if (lBookParticleHistograms.size() != eParticleHistograms_N) { + LOGF(info, "\033[1;31m lBookParticleHistograms.size() = %d\033[0m", lBookParticleHistograms.size()); + LOGF(info, "\033[1;31m eParticleHistograms_N) = %d\033[0m", static_cast(eParticleHistograms_N)); + LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookParticleHistograms, and number of entries in enum eParticleHistograms \n \033[0m", __FUNCTION__, __LINE__); + } + + // *) Insanity check on the content and ordering of particle histograms in the initialization in configurable cfBookParticleHistograms: + // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. + for (Int_t name = 0; name < eParticleHistograms_N; name++) { + // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookParticleHistograms[name]).EndsWith(ph.fParticleHistogramsName[name].Data())) { + LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookParticleHistograms => name = %d, lBookParticleHistograms[name] = \"%s\", ph.fParticleHistogramsName[name] = \"%s\" \n Check if you are using an up to date tag. \033[0m", __FUNCTION__, __LINE__, name, TString(lBookParticleHistograms[name]).Data(), ph.fParticleHistogramsName[name].Data()); + } + } + + // I append "&& ph.fFillParticleHistograms" below, to switch off booking of all 1D particle histograms with one common flag: + ph.fBookParticleHistograms[ePhi] = Alright(lBookParticleHistograms[ePhi]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[ePt] = Alright(lBookParticleHistograms[ePt]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[eEta] = Alright(lBookParticleHistograms[eEta]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[eCharge] = Alright(lBookParticleHistograms[eCharge]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcNClsFindable] = Alright(lBookParticleHistograms[etpcNClsFindable]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcNClsShared] = Alright(lBookParticleHistograms[etpcNClsShared]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcNClsFound] = Alright(lBookParticleHistograms[etpcNClsFound]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcNClsCrossedRows] = Alright(lBookParticleHistograms[etpcNClsCrossedRows]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[eitsNCls] = Alright(lBookParticleHistograms[eitsNCls]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[eitsNClsInnerBarrel] = Alright(lBookParticleHistograms[eitsNClsInnerBarrel]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcCrossedRowsOverFindableCls] = Alright(lBookParticleHistograms[etpcCrossedRowsOverFindableCls]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcFoundOverFindableCls] = Alright(lBookParticleHistograms[etpcFoundOverFindableCls]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[etpcFractionSharedCls] = Alright(lBookParticleHistograms[etpcFractionSharedCls]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[edcaXY] = Alright(lBookParticleHistograms[edcaXY]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[edcaZ] = Alright(lBookParticleHistograms[edcaZ]) && ph.fFillParticleHistograms; + ph.fBookParticleHistograms[ePDG] = Alright(lBookParticleHistograms[ePDG]) && ph.fFillParticleHistograms; + // Remark #1: I do not need here anythig for etrackCutFlagFb1, etrackCutFlagFb2, ... eisGlobalTrack, because they are booleans + // Remark #2: Nothing special here for ePtDependentDCAxyParameterization, because that is a string. // d) Particle histograms 2D: // By default all 2D particle histograms are booked. Set this flag to kFALSE to switch off booking of all 2D particle histograms: ph.fFillParticleHistograms2D = cf_ph.cfFillParticleHistograms2D; - if (ph.fFillParticleHistograms2D) { - // If you do not want particular 2D particle histogram to be booked, use configurable array cfBookParticleHistograms2D, where you can specify flags 1 (book) or 0 (do not book). - // *) Ordering of the flags in that array is interpreted through ordering of enums in enum eParticleHistograms2D. - auto lBookParticleHistograms2D = cf_ph.cfBookParticleHistograms2D.value; // this is now the local version of that string array from configurable - // TBI 20241113 For some reason, the default values of configurable "cfBookParticleHistograms2D" are not correctly propagated in the local variables, but I can circumvent that with JSON settings for the time being - if (lBookParticleHistograms2D.size() != eParticleHistograms2D_N) { - LOGF(info, "\033[1;31m lBookParticleHistograms2D.size() = %d\033[0m", lBookParticleHistograms2D.size()); - LOGF(info, "\033[1;31m eParticleHistograms2D_N) = %d\033[0m", static_cast(eParticleHistograms2D_N)); - LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookParticleHistograms2D, and number of entries in enum eParticleHistograms2D \n \033[0m", __FUNCTION__, __LINE__); - } + // If you do not want particular 2D particle histogram to be booked, use configurable array cfBookParticleHistograms2D, where you can specify flags 1 (book) or 0 (do not book). + // *) Ordering of the flags in that array is interpreted through ordering of enums in enum eParticleHistograms2D. + auto lBookParticleHistograms2D = cf_ph.cfBookParticleHistograms2D.value; // this is now the local version of that string array from configurable + // TBI 20241113 For some reason, the default values of configurable "cfBookParticleHistograms2D" are not correctly propagated in the local variables, but I can circumvent that with JSON settings for the time being + if (lBookParticleHistograms2D.size() != eParticleHistograms2D_N) { + LOGF(info, "\033[1;31m lBookParticleHistograms2D.size() = %d\033[0m", lBookParticleHistograms2D.size()); + LOGF(info, "\033[1;31m eParticleHistograms2D_N) = %d\033[0m", static_cast(eParticleHistograms2D_N)); + LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookParticleHistograms2D, and number of entries in enum eParticleHistograms2D \n \033[0m", __FUNCTION__, __LINE__); + } - // *) Insanity check on the content and ordering of 2D particle histograms in the initialization in configurable cfBookParticleHistograms2D: - // TBI 20241109 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. - for (Int_t name = 0; name < eParticleHistograms2D_N; name++) { - // TBI 20241109 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookParticleHistograms2D[name]).EndsWith(ph.fParticleHistogramsName2D[name].Data())) { - LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookParticleHistograms2D => name = %d, lBookParticleHistograms2D[name] = \"%s\", ph.fParticleHistogramsName2D[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookParticleHistograms2D[name]).Data(), ph.fParticleHistogramsName2D[name].Data()); - } + // *) Insanity check on the content and ordering of 2D particle histograms in the initialization in configurable cfBookParticleHistograms2D: + // TBI 20241109 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. + for (Int_t name = 0; name < eParticleHistograms2D_N; name++) { + // TBI 20241109 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookParticleHistograms2D[name]).EndsWith(ph.fParticleHistogramsName2D[name].Data())) { + LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookParticleHistograms2D => name = %d, lBookParticleHistograms2D[name] = \"%s\", ph.fParticleHistogramsName2D[name] = \"%s\" \n Check if you are using an up to date tag. \033[0m", __FUNCTION__, __LINE__, name, TString(lBookParticleHistograms2D[name]).Data(), ph.fParticleHistogramsName2D[name].Data()); } + } - // I append "&& ph.fFillParticleHistograms2D" below, to switch off booking of all 2D particle histograms with one common flag: - ph.fBookParticleHistograms2D[ePhiPt] = Alright(lBookParticleHistograms2D[ePhiPt]) && ph.fFillParticleHistograms2D; - ph.fBookParticleHistograms2D[ePhiEta] = Alright(lBookParticleHistograms2D[ePhiEta]) && ph.fFillParticleHistograms2D; - } // end of if (ph.fFillParticleHistograms2D) + // I append "&& ph.fFillParticleHistograms2D" below, to switch off booking of all 2D particle histograms with one common flag: + ph.fBookParticleHistograms2D[ePhiPt] = Alright(lBookParticleHistograms2D[ePhiPt]) && ph.fFillParticleHistograms2D; + ph.fBookParticleHistograms2D[ePhiEta] = Alright(lBookParticleHistograms2D[ePhiEta]) && ph.fFillParticleHistograms2D; // e) QA: // **) QA 2D event histograms: qa.fFillQAEventHistograms2D = cf_qa.cfFillQAEventHistograms2D; - if (qa.fFillQAEventHistograms2D) { - // *) If you do not want particular 2D event histogram to be booked, use configurable array cfBookQAEventHistograms2D, where you can specify flags 1 (book) or 0 (do not book). - // Ordering of the flags in that array is interpreted through ordering of enums in enum eQAEventHistograms2D - auto lBookQAEventHistograms2D = cf_qa.cfBookQAEventHistograms2D.value; // this is now the local version of that string array from configurable - // TBI 20241115 For some reason, the default values of configurable "cfBookQAEventHistograms2D" are not correctly propagated in the local variables, but I can circumvent that with JSON settings for the time being - if (lBookQAEventHistograms2D.size() != eQAEventHistograms2D_N) { - LOGF(info, "\033[1;31m lBookQAEventHistograms2D.size() = %d\033[0m", lBookQAEventHistograms2D.size()); - LOGF(info, "\033[1;31m eQAEventHistograms2D_N = %d\033[0m", static_cast(eQAEventHistograms2D_N)); - LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookQAEventHistograms2D, and number of entries in enum eQAEventHistograms2D \n \033[0m", __FUNCTION__, __LINE__); - } - - // *) Insanity check on the content and ordering of QA 2D event histograms in the initialization in configurable cfBookQAEventHistograms2D: - // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. - for (Int_t name = 0; name < eQAEventHistograms2D_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookQAEventHistograms2D[name]).EndsWith(qa.fEventHistogramsName2D[name].Data())) { - LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookQAEventHistograms2D => name = %d, lBookQAEventHistograms2D[name] = \"%s\", qa.fEventHistogramsName2D[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookQAEventHistograms2D[name]).Data(), qa.fEventHistogramsName2D[name].Data()); - } - } - - // I append "&& qa.fFillQAEventHistograms2D" below, to switch off booking of all 2D event histograms with one common flag: - qa.fBookQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eMultiplicity_vs_NContributors] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_NContributors]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eMultiplicity_vs_Centrality] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Centrality]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eMultiplicity_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eMultiplicity_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Occupancy]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_NContributors] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_NContributors]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Centrality] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Centrality]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Occupancy]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eNContributors_vs_Centrality] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Centrality]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eNContributors_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eNContributors_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Occupancy]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCentrality_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eCentrality_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCentrality_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eCentrality_vs_Occupancy]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCentrality_vs_ImpactParameter] = Alright(lBookQAEventHistograms2D[eCentrality_vs_ImpactParameter]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eVertex_z_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eVertex_z_vs_Occupancy]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eMultNTracksPV_vs_MultNTracksGlobal] = Alright(lBookQAEventHistograms2D[eMultNTracksPV_vs_MultNTracksGlobal]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCentFT0C_vs_CentNTPV] = Alright(lBookQAEventHistograms2D[eCentFT0C_vs_CentNTPV]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCentFT0M_vs_CentNTPV] = Alright(lBookQAEventHistograms2D[eCentFT0M_vs_CentNTPV]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets] = Alright(lBookQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = Alright(lBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange]) && qa.fFillQAEventHistograms2D; - qa.fBookQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate] = Alright(lBookQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate]) && qa.fFillQAEventHistograms2D; - } // end of if (qa.fFillQAEventHistograms2D) + // *) If you do not want particular 2D event histogram to be booked, use configurable array cfBookQAEventHistograms2D, where you can specify flags 1 (book) or 0 (do not book). + // Ordering of the flags in that array is interpreted through ordering of enums in enum eQAEventHistograms2D + auto lBookQAEventHistograms2D = cf_qa.cfBookQAEventHistograms2D.value; // this is now the local version of that string array from configurable + // TBI 20241115 For some reason, the default values of configurable "cfBookQAEventHistograms2D" are not correctly propagated in the local variables, but I can circumvent that with JSON settings for the time being + if (lBookQAEventHistograms2D.size() != eQAEventHistograms2D_N) { + LOGF(info, "\033[1;31m lBookQAEventHistograms2D.size() = %d\033[0m", lBookQAEventHistograms2D.size()); + LOGF(info, "\033[1;31m eQAEventHistograms2D_N = %d\033[0m", static_cast(eQAEventHistograms2D_N)); + LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookQAEventHistograms2D, and number of entries in enum eQAEventHistograms2D \n \033[0m", __FUNCTION__, __LINE__); + } + + // *) Insanity check on the content and ordering of QA 2D event histograms in the initialization in configurable cfBookQAEventHistograms2D: + // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. + for (Int_t name = 0; name < eQAEventHistograms2D_N; name++) { + // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookQAEventHistograms2D[name]).EndsWith(qa.fEventHistogramsName2D[name].Data())) { + LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookQAEventHistograms2D => name = %d, lBookQAEventHistograms2D[name] = \"%s\", qa.fEventHistogramsName2D[name] = \"%s\" \n Check if you are using an up to date tag. \033[0m", __FUNCTION__, __LINE__, name, TString(lBookQAEventHistograms2D[name]).Data(), qa.fEventHistogramsName2D[name].Data()); + } + } + + // I append "&& qa.fFillQAEventHistograms2D" below, to switch off booking of all 2D event histograms with one common flag: + qa.fBookQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_ReferenceMultiplicity]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_NContributors] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_NContributors]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_Centrality] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Centrality]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultiplicity_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eMultiplicity_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_NContributors] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_NContributors]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Centrality] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Centrality]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eReferenceMultiplicity_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eReferenceMultiplicity_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eNContributors_vs_Centrality] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Centrality]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eNContributors_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eNContributors_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eNContributors_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentrality_vs_Vertex_z] = Alright(lBookQAEventHistograms2D[eCentrality_vs_Vertex_z]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentrality_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eCentrality_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentrality_vs_ImpactParameter] = Alright(lBookQAEventHistograms2D[eCentrality_vs_ImpactParameter]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eVertex_z_vs_Occupancy] = Alright(lBookQAEventHistograms2D[eVertex_z_vs_Occupancy]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eMultNTracksPV_vs_MultNTracksGlobal] = Alright(lBookQAEventHistograms2D[eMultNTracksPV_vs_MultNTracksGlobal]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentFT0C_vs_CentNTPV] = Alright(lBookQAEventHistograms2D[eCentFT0C_vs_CentNTPV]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentFT0M_vs_CentNTPV] = Alright(lBookQAEventHistograms2D[eCentFT0M_vs_CentNTPV]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets] = Alright(lBookQAEventHistograms2D[eCentRun2V0M_vs_CentRun2SPDTracklets]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange] = Alright(lBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange]) && qa.fFillQAEventHistograms2D; + qa.fBookQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate] = Alright(lBookQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate]) && qa.fFillQAEventHistograms2D; // **) QA 2D particle histograms: qa.fFillQAParticleHistograms2D = cf_qa.cfFillQAParticleHistograms2D; - if (qa.fFillQAParticleHistograms2D) { - // *) If you do not want particular 2D particle histogram to be booked, use configurable array cfBookQAParticleHistograms2D, where you can specify flags 1 (book) or 0 (do not book). - // Ordering of the flags in that array is interpreted through ordering of enums in enum eQAParticleHistograms2D. - auto lBookQAParticleHistograms2D = (vector)cf_qa.cfBookQAParticleHistograms2D; // this is now the local version of that int array from configurable - if (lBookQAParticleHistograms2D.size() != eQAParticleHistograms2D_N) { - LOGF(info, "\033[1;31m lBookQAParticleHistograms2D.size() = %d\033[0m", lBookQAParticleHistograms2D.size()); - LOGF(info, "\033[1;31m eQAParticleHistograms2D_N = %d\033[0m", static_cast(eQAParticleHistograms2D_N)); - LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookQAParticleHistograms2D, and number of entries in enum eParticleHistograms2D \n \033[0m", __FUNCTION__, __LINE__); + // *) If you do not want particular 2D particle histogram to be booked, use configurable array cfBookQAParticleHistograms2D, where you can specify flags 1 (book) or 0 (do not book). + // Ordering of the flags in that array is interpreted through ordering of enums in enum eQAParticleHistograms2D. + auto lBookQAParticleHistograms2D = cf_qa.cfBookQAParticleHistograms2D.value; // this is now the local version of that string array from configurable + if (lBookQAParticleHistograms2D.size() != eQAParticleHistograms2D_N) { + LOGF(info, "\033[1;31m lBookQAParticleHistograms2D.size() = %d\033[0m", lBookQAParticleHistograms2D.size()); + LOGF(info, "\033[1;31m eQAParticleHistograms2D_N = %d\033[0m", static_cast(eQAParticleHistograms2D_N)); + LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookQAParticleHistograms2D, and number of entries in enum eParticleHistograms2D \n \033[0m", __FUNCTION__, __LINE__); + } + + // *) Insanity check on the content and ordering of QA 2D particle histograms in the initialization in configurable cfBookQAParticleHistograms2D: + // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. + for (Int_t name = 0; name < eQAParticleHistograms2D_N; name++) { + // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookQAParticleHistograms2D[name]).EndsWith(qa.fParticleHistogramsName2D[name].Data())) { + LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookQAParticleHistograms2D => name = %d, lBookQAParticleHistograms2D[name] = \"%s\", qa.fParticleHistogramsName2D[name] = \"%s\" \n Check if you are using an up to date tag. \033[0m", __FUNCTION__, __LINE__, name, TString(lBookQAParticleHistograms2D[name]).Data(), qa.fParticleHistogramsName2D[name].Data()); } + } - // *) Insanity check on the content and ordering of QA 2D particle histograms in the initialization in configurable cfBookQAParticleHistograms2D: - // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. - for (Int_t name = 0; name < eQAParticleHistograms2D_N; name++) { - // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. - if (!TString(lBookQAParticleHistograms2D[name]).EndsWith(qa.fParticleHistogramsName2D[name].Data())) { - LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookQAParticleHistograms2D => name = %d, lBookQAParticleHistograms2D[name] = \"%s\", qa.fParticleHistogramsName2D[name] = \"%s\" \033[0m", __FUNCTION__, __LINE__, name, TString(lBookQAParticleHistograms2D[name]).Data(), qa.fParticleHistogramsName2D[name].Data()); - } + // I append "&& qa.fFillQAParticleHistograms2D" below, to switch off booking of all 2D particle histograms with one common flag: + qa.fBookQAParticleHistograms2D[ePt_vs_dcaXY] = Alright(lBookQAParticleHistograms2D[ePt_vs_dcaXY]) && qa.fFillQAParticleHistograms2D; + + // **) QA 2D particle event histograms: + qa.fFillQAParticleEventHistograms2D = cf_qa.cfFillQAParticleEventHistograms2D; + + // *) If you do not want particular 2D particle event histogram to be booked, use configurable array cfBookQAParticleEventHistograms2D, where you can specify flags 1 (book) or 0 (do not book). + // Ordering of the flags in that array is interpreted through ordering of enums in enum eQAParticleEventHistograms2D. + auto lBookQAParticleEventHistograms2D = cf_qa.cfBookQAParticleEventHistograms2D.value; // this is now the local version of that string array from configurable + if (lBookQAParticleEventHistograms2D.size() != eQAParticleEventHistograms2D_N) { + LOGF(info, "\033[1;31m lBookQAParticleEventHistograms2D.size() = %d\033[0m", lBookQAParticleEventHistograms2D.size()); + LOGF(info, "\033[1;31m eQAParticleEventHistograms2D_N = %d\033[0m", static_cast(eQAParticleEventHistograms2D_N)); + LOGF(fatal, "in function \033[1;31m%s at line %d Mismatch in the number of flags in configurable cfBookQAParticleEventHistograms2D, and number of entries in enum eParticleEventHistograms2D \n \033[0m", __FUNCTION__, __LINE__); + } + + // *) Insanity check on the content and ordering of QA 2D particle event histograms in the initialization in configurable cfBookQAParticleEventHistograms2D: + // TBI 20240518 I do not need this in fact, I can automate initialization even without ordering in configurable, but it feels with the ordering enforced, it's much safer. + for (Int_t name = 0; name < eQAParticleEventHistograms2D_N; name++) { + // TBI 20240518 I could implement even a strickter EqualTo instead of EndsWith, but then I need to tokenize, etc., etc. This shall be safe enough. + if (!TString(lBookQAParticleEventHistograms2D[name]).EndsWith(qa.fQAParticleEventHistogramsName2D[name].Data())) { + LOGF(fatal, "\033[1;31m%s at line %d : Wrong content or ordering of contents in configurable cfBookQAParticleEventHistograms2D => name = %d, lBookQAParticleEventHistograms2D[name] = \"%s\", qa.fParticleEventHistogramsName2D[name] = \"%s\" \n Check if you are using an up to date tag. \033[0m", __FUNCTION__, __LINE__, name, TString(lBookQAParticleEventHistograms2D[name]).Data(), qa.fQAParticleEventHistogramsName2D[name].Data()); } + } - // I append "&& qa.fFillQAParticleHistograms2D" below, to switch off booking of all 2D particle histograms with one common flag: - qa.fBookQAParticleHistograms2D[ePt_vs_dcaXY] = Alright(lBookQAParticleHistograms2D[ePt_vs_dcaXY]) && qa.fFillQAParticleHistograms2D; - } // end of if (qa.fFillQAParticleHistograms2D) + // I append "&& qa.fFillQAParticleEventHistograms2D" below, to switch off booking of all 2D particle event histograms with one common flag: + qa.fBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_itsNClsEbyE] = Alright(lBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_itsNClsEbyE]) && qa.fFillQAParticleEventHistograms2D; + qa.fBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_itsNClsNegEtaEbyE] = Alright(lBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_itsNClsNegEtaEbyE]) && qa.fFillQAParticleEventHistograms2D; + qa.fBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_itsNClsPosEtaEbyE] = Alright(lBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_itsNClsPosEtaEbyE]) && qa.fFillQAParticleEventHistograms2D; + qa.fBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0804EbyE] = Alright(lBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0804EbyE]) && qa.fFillQAParticleEventHistograms2D; + qa.fBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0400EbyE] = Alright(lBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0400EbyE]) && qa.fFillQAParticleEventHistograms2D; + qa.fBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0004EbyE] = Alright(lBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0004EbyE]) && qa.fFillQAParticleEventHistograms2D; + qa.fBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0408EbyE] = Alright(lBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0408EbyE]) && qa.fFillQAParticleEventHistograms2D; + qa.fBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Pt0005EbyE] = Alright(lBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Pt0005EbyE]) && qa.fFillQAParticleEventHistograms2D; + qa.fBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Pt0510EbyE] = Alright(lBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Pt0510EbyE]) && qa.fFillQAParticleEventHistograms2D; + qa.fBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Pt1050EbyE] = Alright(lBookQAParticleEventHistograms2D[eCurrentRunDuration_vs_Pt1050EbyE]) && qa.fFillQAParticleEventHistograms2D; // ... @@ -891,6 +935,7 @@ void DefaultBinning() // TBI 20240114 If some of these values are going to change frequently, add support for them in MuPa-Configurables.h, // in the same way I did it for DefaultCuts(). + // Remark: If // a) Default binning for event histograms; // b) Default binning for particle histograms 1D; @@ -947,21 +992,9 @@ void DefaultBinning() eh.fEventHistogramsBins[eEventPlaneAngle][1] = -o2::constants::math::PI; // just in case somebody uses the convention -Pi < EP < Pi, instead of 0 < EP < 2Pi eh.fEventHistogramsBins[eEventPlaneAngle][2] = o2::constants::math::TwoPI; - if (ec.fsEventCuts[eOccupancyEstimator].EqualTo("TrackOccupancyInTimeRange", TString::kIgnoreCase)) { - eh.fEventHistogramsBins[eOccupancy][0] = 150; - eh.fEventHistogramsBins[eOccupancy][1] = 0.; - eh.fEventHistogramsBins[eOccupancy][2] = 15000.; - } else if (ec.fsEventCuts[eOccupancyEstimator].EqualTo("FT0COccupancyInTimeRange", TString::kIgnoreCase)) { // keep in sync with values below for 2D QA - eh.fEventHistogramsBins[eOccupancy][0] = 1000; - eh.fEventHistogramsBins[eOccupancy][1] = 0.; - eh.fEventHistogramsBins[eOccupancy][2] = 100000.; - } - // For 2D QA correlation plot, temporarily I set it to maximum of the two above: - if (qa.fBookQAEventHistograms2D[eTrackOccupancyInTimeRange_vs_FT0COccupancyInTimeRange]) { - eh.fEventHistogramsBins[eOccupancy][0] = 1000; // keep in sync. with definition above - eh.fEventHistogramsBins[eOccupancy][1] = 0.; - eh.fEventHistogramsBins[eOccupancy][2] = 100000.; - } + eh.fEventHistogramsBins[eOccupancy][0] = 1000; + eh.fEventHistogramsBins[eOccupancy][1] = 0.; + eh.fEventHistogramsBins[eOccupancy][2] = 100000.; eh.fEventHistogramsBins[eInteractionRate][0] = 1000; eh.fEventHistogramsBins[eInteractionRate][1] = 0.; @@ -969,7 +1002,7 @@ void DefaultBinning() eh.fEventHistogramsBins[eCurrentRunDuration][0] = 10000; eh.fEventHistogramsBins[eCurrentRunDuration][1] = 0.; - eh.fEventHistogramsBins[eCurrentRunDuration][2] = 100000.; + eh.fEventHistogramsBins[eCurrentRunDuration][2] = 10000.; // b) Default binning for particle histograms 1D: ph.fParticleHistogramsBins[ePhi][0] = 360; @@ -1012,13 +1045,13 @@ void DefaultBinning() ph.fParticleHistogramsBins[eitsNClsInnerBarrel][1] = 0.; ph.fParticleHistogramsBins[eitsNClsInnerBarrel][2] = 10.; - ph.fParticleHistogramsBins[etpcCrossedRowsOverFindableCls][0] = 250; + ph.fParticleHistogramsBins[etpcCrossedRowsOverFindableCls][0] = 1000; ph.fParticleHistogramsBins[etpcCrossedRowsOverFindableCls][1] = 0.; - ph.fParticleHistogramsBins[etpcCrossedRowsOverFindableCls][2] = 5000; + ph.fParticleHistogramsBins[etpcCrossedRowsOverFindableCls][2] = 10; - ph.fParticleHistogramsBins[etpcFoundOverFindableCls][0] = 250; + ph.fParticleHistogramsBins[etpcFoundOverFindableCls][0] = 1000; ph.fParticleHistogramsBins[etpcFoundOverFindableCls][1] = 0.; - ph.fParticleHistogramsBins[etpcFoundOverFindableCls][2] = 5000.; + ph.fParticleHistogramsBins[etpcFoundOverFindableCls][2] = 10.; ph.fParticleHistogramsBins[etpcFractionSharedCls][0] = 110; ph.fParticleHistogramsBins[etpcFractionSharedCls][1] = -1.; // yes, I saw here entries with negative values TBI 20240507 check what are these values @@ -1357,7 +1390,7 @@ void DefaultCuts() // **) event cuts defined via [min, max): // Remark: I use this one also for events cuts set only via min or via max. - // In this case, I set eithe min or max intentionally to some value which never can be met (see below example for "MinVertexDistanceFromIP") + // In this case, I set either min or max intentionally to some value which never can be met (see below example for "MinVertexDistanceFromIP") auto lNumberOfEvents = (std::vector)cf_ec.cfNumberOfEvents; ec.fdEventCuts[eNumberOfEvents][eMin] = lNumberOfEvents[eMin]; ec.fdEventCuts[eNumberOfEvents][eMax] = lNumberOfEvents[eMax]; @@ -1621,6 +1654,10 @@ void SpecificCuts(TString whichSpecificCuts) pc.fdParticleCuts[etpcNClsCrossedRows][eMin] = 70.; pc.fdParticleCuts[etpcNClsCrossedRows][eMax] = 1000.; + pc.fUseParticleCuts[etpcCrossedRowsOverFindableCls] = kTRUE; + pc.fdParticleCuts[etpcCrossedRowsOverFindableCls][eMin] = 0.8; + pc.fdParticleCuts[etpcCrossedRowsOverFindableCls][eMax] = 1000.; + break; // ... @@ -2153,6 +2190,9 @@ Bool_t Skip(Int_t recOrSim) void BookAndNestAllLists() { // *) QA; + // **) QA event histograms; + // **) QA particle histograms; + // **) QA particle event histograms; // *) Control event histograms; // *) Control particle histograms; // *) Correlations; @@ -2176,6 +2216,30 @@ void BookAndNestAllLists() qa.fQAList->SetOwner(kTRUE); fBaseList->Add(qa.fQAList); + // **) QA event histograms; + if (qa.fFillQAEventHistograms2D) { + qa.fQAEventList = new TList(); + qa.fQAEventList->SetName("QAEvent"); + qa.fQAEventList->SetOwner(kTRUE); + qa.fQAList->Add(qa.fQAEventList); // yes, this one is nested within base QA TList + } + + // **) QA particle histograms; + if (qa.fFillQAParticleHistograms2D) { + qa.fQAParticleList = new TList(); + qa.fQAParticleList->SetName("QAParticle"); + qa.fQAParticleList->SetOwner(kTRUE); + qa.fQAList->Add(qa.fQAParticleList); // yes, this one is nested within base QA TList + } + + // **) QA particle event histograms; + if (qa.fFillQAParticleEventHistograms2D) { + qa.fQAParticleEventList = new TList(); + qa.fQAParticleEventList->SetName("QAParticleEvent"); + qa.fQAParticleEventList->SetOwner(kTRUE); + qa.fQAList->Add(qa.fQAParticleEventList); // yes, this one is nested within base QA TList + } + // *) Event cuts: ec.fEventCutsList = new TList(); ec.fEventCutsList->SetName("EventCuts"); @@ -2277,7 +2341,8 @@ void BookQAHistograms() // a) Book the profile holding flags; // b) Common local variables; // c) Book specific QA 2D event histograms; - // d) Book specific QA 2D particle histograms. + // d) Book specific QA 2D particle histograms; + // e) Book specific QA 2D particle event histograms. if (tc.fVerbose) { StartFunction(__FUNCTION__); @@ -2296,7 +2361,7 @@ void BookQAHistograms() } // a) Book the profile holding flags: - qa.fQAHistogramsPro = new TProfile("fQAHistogramsPro", "flags for QA histograms", 4, 0., 4.); + qa.fQAHistogramsPro = new TProfile("fQAHistogramsPro", "flags for QA histograms", 5, 0., 5.); qa.fQAHistogramsPro->SetStats(kFALSE); qa.fQAHistogramsPro->SetLineColor(eColor); qa.fQAHistogramsPro->SetFillColor(eFillColor); @@ -2306,8 +2371,10 @@ void BookQAHistograms() qa.fQAHistogramsPro->Fill(1.5, static_cast(qa.fFillQAEventHistograms2D)); qa.fQAHistogramsPro->GetXaxis()->SetBinLabel(3, "fFillQAParticleHistograms2D"); qa.fQAHistogramsPro->Fill(2.5, static_cast(qa.fFillQAParticleHistograms2D)); - qa.fQAHistogramsPro->GetXaxis()->SetBinLabel(4, "fRebin"); - qa.fQAHistogramsPro->Fill(3.5, static_cast(qa.fRebin)); + qa.fQAHistogramsPro->GetXaxis()->SetBinLabel(4, "fFillQAParticleEventHistograms2D"); + qa.fQAHistogramsPro->Fill(3.5, static_cast(qa.fFillQAParticleEventHistograms2D)); + qa.fQAHistogramsPro->GetXaxis()->SetBinLabel(5, "fRebin"); + qa.fQAHistogramsPro->Fill(4.5, static_cast(qa.fRebin)); // ... @@ -2605,7 +2672,7 @@ void BookQAHistograms() qa.fQAEventHistograms2D[t][rs][ba]->SetLineColor(ec.fBeforeAfterColor[ba]); qa.fQAEventHistograms2D[t][rs][ba]->SetFillColor(ec.fBeforeAfterColor[ba] - 10); qa.fQAEventHistograms2D[t][rs][ba]->SetOption("col"); - qa.fQAList->Add(qa.fQAEventHistograms2D[t][rs][ba]); + qa.fQAEventList->Add(qa.fQAEventHistograms2D[t][rs][ba]); } // for(Int_t ba=0;ba<2;ba++) } // for(Int_t rs=0;rs<2;rs++) // reco/sim } // for(Int_t t=0;tSetLineColor(ec.fBeforeAfterColor[ba]); qa.fQAParticleHistograms2D[t][rs][ba]->SetFillColor(ec.fBeforeAfterColor[ba] - 10); qa.fQAParticleHistograms2D[t][rs][ba]->SetOption("col"); - qa.fQAList->Add(qa.fQAParticleHistograms2D[t][rs][ba]); + qa.fQAParticleList->Add(qa.fQAParticleHistograms2D[t][rs][ba]); } // for(Int_t ba=0;ba<2;ba++) } // for(Int_t rs=0;rs<2;rs++) // reco/sim } // for(Int_t t=0;t(eh.fEventHistogramsBins[eCurrentRunDuration][0]); + min_x_ParticleEvent[eCurrentRunDuration_vs_itsNClsEbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][1]; + max_x_ParticleEvent[eCurrentRunDuration_vs_itsNClsEbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][2]; + title_x_ParticleEvent[eCurrentRunDuration_vs_itsNClsEbyE] = FancyFormatting(eh.fEventHistogramsName[eCurrentRunDuration].Data()); + // nBins_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsEbyE] = static_cast(ph.fParticleHistogramsBins[eitsNCls][0]); + nBins_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsEbyE] = 100; + min_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsEbyE] = ph.fParticleHistogramsBins[eitsNCls][1]; + max_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsEbyE] = ph.fParticleHistogramsBins[eitsNCls][2]; + title_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsEbyE] = TString::Format("#LT%s#GT", FancyFormatting(ph.fParticleHistogramsName[eitsNCls].Data())); + + // *) "eCurrentRunDuration_vs_itsNClsNegEtaEbyE": + nBins_x_ParticleEvent[eCurrentRunDuration_vs_itsNClsNegEtaEbyE] = static_cast(eh.fEventHistogramsBins[eCurrentRunDuration][0]); + min_x_ParticleEvent[eCurrentRunDuration_vs_itsNClsNegEtaEbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][1]; + max_x_ParticleEvent[eCurrentRunDuration_vs_itsNClsNegEtaEbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][2]; + title_x_ParticleEvent[eCurrentRunDuration_vs_itsNClsNegEtaEbyE] = FancyFormatting(eh.fEventHistogramsName[eCurrentRunDuration].Data()); + nBins_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsNegEtaEbyE] = 100; + min_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsNegEtaEbyE] = ph.fParticleHistogramsBins[eitsNCls][1]; + max_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsNegEtaEbyE] = ph.fParticleHistogramsBins[eitsNCls][2]; + title_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsNegEtaEbyE] = TString::Format("#LT%s#GT, #eta < 0", FancyFormatting(ph.fParticleHistogramsName[eitsNCls].Data())); + + // *) "eCurrentRunDuration_vs_itsNClsPosEtaEbyE": + nBins_x_ParticleEvent[eCurrentRunDuration_vs_itsNClsPosEtaEbyE] = static_cast(eh.fEventHistogramsBins[eCurrentRunDuration][0]); + min_x_ParticleEvent[eCurrentRunDuration_vs_itsNClsPosEtaEbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][1]; + max_x_ParticleEvent[eCurrentRunDuration_vs_itsNClsPosEtaEbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][2]; + title_x_ParticleEvent[eCurrentRunDuration_vs_itsNClsPosEtaEbyE] = FancyFormatting(eh.fEventHistogramsName[eCurrentRunDuration].Data()); + nBins_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsPosEtaEbyE] = 100; + min_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsPosEtaEbyE] = ph.fParticleHistogramsBins[eitsNCls][1]; + max_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsPosEtaEbyE] = ph.fParticleHistogramsBins[eitsNCls][2]; + title_y_ParticleEvent[eCurrentRunDuration_vs_itsNClsPosEtaEbyE] = TString::Format("#LT%s#GT, #eta > 0", FancyFormatting(ph.fParticleHistogramsName[eitsNCls].Data())); + + // *) "eCurrentRunDuration_vs_Eta0804EbyE": + nBins_x_ParticleEvent[eCurrentRunDuration_vs_Eta0804EbyE] = static_cast(eh.fEventHistogramsBins[eCurrentRunDuration][0]); + min_x_ParticleEvent[eCurrentRunDuration_vs_Eta0804EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][1]; + max_x_ParticleEvent[eCurrentRunDuration_vs_Eta0804EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][2]; + title_x_ParticleEvent[eCurrentRunDuration_vs_Eta0804EbyE] = FancyFormatting(eh.fEventHistogramsName[eCurrentRunDuration].Data()); + nBins_y_ParticleEvent[eCurrentRunDuration_vs_Eta0804EbyE] = 80; + min_y_ParticleEvent[eCurrentRunDuration_vs_Eta0804EbyE] = -1.0; // TBI 20241214 intentionally temporarily overshooting, to trace down overflow and underflow, if any + max_y_ParticleEvent[eCurrentRunDuration_vs_Eta0804EbyE] = 1.0; // TBI 20241214 intentionally temporarily overshooting, to trace down overflow and underflow, if any + title_y_ParticleEvent[eCurrentRunDuration_vs_Eta0804EbyE] = TString::Format("#LT%s#GT, -0.8 < #eta < -0.4", FancyFormatting(ph.fParticleHistogramsName[eEta].Data())); + + // *) "eCurrentRunDuration_vs_Eta0400EbyE": + nBins_x_ParticleEvent[eCurrentRunDuration_vs_Eta0400EbyE] = static_cast(eh.fEventHistogramsBins[eCurrentRunDuration][0]); + min_x_ParticleEvent[eCurrentRunDuration_vs_Eta0400EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][1]; + max_x_ParticleEvent[eCurrentRunDuration_vs_Eta0400EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][2]; + title_x_ParticleEvent[eCurrentRunDuration_vs_Eta0400EbyE] = FancyFormatting(eh.fEventHistogramsName[eCurrentRunDuration].Data()); + nBins_y_ParticleEvent[eCurrentRunDuration_vs_Eta0400EbyE] = 80; + min_y_ParticleEvent[eCurrentRunDuration_vs_Eta0400EbyE] = -1.0; + max_y_ParticleEvent[eCurrentRunDuration_vs_Eta0400EbyE] = 1.0; + title_y_ParticleEvent[eCurrentRunDuration_vs_Eta0400EbyE] = TString::Format("#LT%s#GT, -0.4 < #eta < 0.0", FancyFormatting(ph.fParticleHistogramsName[eEta].Data())); + + // *) "eCurrentRunDuration_vs_Eta0004EbyE": + nBins_x_ParticleEvent[eCurrentRunDuration_vs_Eta0004EbyE] = static_cast(eh.fEventHistogramsBins[eCurrentRunDuration][0]); + min_x_ParticleEvent[eCurrentRunDuration_vs_Eta0004EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][1]; + max_x_ParticleEvent[eCurrentRunDuration_vs_Eta0004EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][2]; + title_x_ParticleEvent[eCurrentRunDuration_vs_Eta0004EbyE] = FancyFormatting(eh.fEventHistogramsName[eCurrentRunDuration].Data()); + nBins_y_ParticleEvent[eCurrentRunDuration_vs_Eta0004EbyE] = 80; + min_y_ParticleEvent[eCurrentRunDuration_vs_Eta0004EbyE] = -1.0; + max_y_ParticleEvent[eCurrentRunDuration_vs_Eta0004EbyE] = 1.0; + title_y_ParticleEvent[eCurrentRunDuration_vs_Eta0004EbyE] = TString::Format("#LT%s#GT, 0.0 < #eta < 0.4", FancyFormatting(ph.fParticleHistogramsName[eEta].Data())); + + // *) "eCurrentRunDuration_vs_Eta0408EbyE": + nBins_x_ParticleEvent[eCurrentRunDuration_vs_Eta0408EbyE] = static_cast(eh.fEventHistogramsBins[eCurrentRunDuration][0]); + min_x_ParticleEvent[eCurrentRunDuration_vs_Eta0408EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][1]; + max_x_ParticleEvent[eCurrentRunDuration_vs_Eta0408EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][2]; + title_x_ParticleEvent[eCurrentRunDuration_vs_Eta0408EbyE] = FancyFormatting(eh.fEventHistogramsName[eCurrentRunDuration].Data()); + nBins_y_ParticleEvent[eCurrentRunDuration_vs_Eta0408EbyE] = 80; + min_y_ParticleEvent[eCurrentRunDuration_vs_Eta0408EbyE] = -1.0; + max_y_ParticleEvent[eCurrentRunDuration_vs_Eta0408EbyE] = 1.0; + title_y_ParticleEvent[eCurrentRunDuration_vs_Eta0408EbyE] = TString::Format("#LT%s#GT, 0.4 < #eta < 0.8", FancyFormatting(ph.fParticleHistogramsName[eEta].Data())); + + // *) "eCurrentRunDuration_vs_Pt0005EbyE": + nBins_x_ParticleEvent[eCurrentRunDuration_vs_Pt0005EbyE] = static_cast(eh.fEventHistogramsBins[eCurrentRunDuration][0]); + min_x_ParticleEvent[eCurrentRunDuration_vs_Pt0005EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][1]; + max_x_ParticleEvent[eCurrentRunDuration_vs_Pt0005EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][2]; + title_x_ParticleEvent[eCurrentRunDuration_vs_Pt0005EbyE] = FancyFormatting(eh.fEventHistogramsName[eCurrentRunDuration].Data()); + nBins_y_ParticleEvent[eCurrentRunDuration_vs_Pt0005EbyE] = 400; + min_y_ParticleEvent[eCurrentRunDuration_vs_Pt0005EbyE] = 0.0; // TBI 20241214 intentionally temporarilyovershooting, to trace down overflow and underflow, if any + max_y_ParticleEvent[eCurrentRunDuration_vs_Pt0005EbyE] = 10.0; // TBI 20241214 intentionally temporarily overshooting, to trace down overflow and underflow, if any + title_y_ParticleEvent[eCurrentRunDuration_vs_Pt0005EbyE] = TString::Format("#LT%s#GT, 0.0 < p_{T} < 0.5 GeV/c", FancyFormatting(ph.fParticleHistogramsName[ePt].Data())); + + // *) "eCurrentRunDuration_vs_Pt0510EbyE": + nBins_x_ParticleEvent[eCurrentRunDuration_vs_Pt0510EbyE] = static_cast(eh.fEventHistogramsBins[eCurrentRunDuration][0]); + min_x_ParticleEvent[eCurrentRunDuration_vs_Pt0510EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][1]; + max_x_ParticleEvent[eCurrentRunDuration_vs_Pt0510EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][2]; + title_x_ParticleEvent[eCurrentRunDuration_vs_Pt0510EbyE] = FancyFormatting(eh.fEventHistogramsName[eCurrentRunDuration].Data()); + nBins_y_ParticleEvent[eCurrentRunDuration_vs_Pt0510EbyE] = 400; + min_y_ParticleEvent[eCurrentRunDuration_vs_Pt0510EbyE] = 0.0; + max_y_ParticleEvent[eCurrentRunDuration_vs_Pt0510EbyE] = 10.0; + title_y_ParticleEvent[eCurrentRunDuration_vs_Pt0510EbyE] = TString::Format("#LT%s#GT, 0.5 < p_{T} < 1.0 GeV/c", FancyFormatting(ph.fParticleHistogramsName[ePt].Data())); + + // *) "eCurrentRunDuration_vs_Pt1050EbyE": + nBins_x_ParticleEvent[eCurrentRunDuration_vs_Pt1050EbyE] = static_cast(eh.fEventHistogramsBins[eCurrentRunDuration][0]); + min_x_ParticleEvent[eCurrentRunDuration_vs_Pt1050EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][1]; + max_x_ParticleEvent[eCurrentRunDuration_vs_Pt1050EbyE] = eh.fEventHistogramsBins[eCurrentRunDuration][2]; + title_x_ParticleEvent[eCurrentRunDuration_vs_Pt1050EbyE] = FancyFormatting(eh.fEventHistogramsName[eCurrentRunDuration].Data()); + nBins_y_ParticleEvent[eCurrentRunDuration_vs_Pt1050EbyE] = 400; + min_y_ParticleEvent[eCurrentRunDuration_vs_Pt1050EbyE] = 0.0; + max_y_ParticleEvent[eCurrentRunDuration_vs_Pt1050EbyE] = 10.0; + title_y_ParticleEvent[eCurrentRunDuration_vs_Pt1050EbyE] = TString::Format("#LT%s#GT, 1.0 < p_{T} < 5.0 GeV/c", FancyFormatting(ph.fParticleHistogramsName[ePt].Data())); + + // ... + + // *) Quick insanity check on title_x_ParticleEvent and title_y_ParticleEvent: + for (Int_t t = 0; t < eQAParticleEventHistograms2D_N; t++) { + if (title_x_ParticleEvent[t].EqualTo("")) { + LOGF(fatal, "\033[1;31m%s at line %d : title_x_ParticleEvent[%d] is not set, check corresponding enum \033[0m", __FUNCTION__, __LINE__, t); + } + if (title_y_ParticleEvent[t].EqualTo("")) { + LOGF(fatal, "\033[1;31m%s at line %d : title_y_ParticleEvent[%d] is not set, check corresponding enum \033[0m", __FUNCTION__, __LINE__, t); + } + } + + // Okay, let's book 'em all: + for (Int_t t = 0; t < eQAParticleEventHistograms2D_N; t++) // type, see enum eQAParticleEventHistograms2D + { + if (!qa.fBookQAParticleEventHistograms2D[t]) { + continue; + } + for (Int_t rs = 0; rs < 2; rs++) // reco/sim + { + + if (Skip(rs)) { + continue; + } + + for (Int_t ba = 0; ba < 2; ba++) // before/after cuts + { + + if (ba == eBefore) { // TBI 20241214 re-think if I need these additional QA particle event histos before cuts + continue; + } + + qa.fQAParticleEventHistograms2D[t][rs][ba] = new TH2F( + Form("fQAParticleEventHistograms2D[%s][%s][%s]", qa.fQAParticleEventHistogramsName2D[t].Data(), gc.srs[rs].Data(), gc.sba[ba].Data()), + Form("%s, %s, %s", "__RUN_NUMBER__", gc.srs_long[rs].Data(), gc.sba_long[ba].Data()), // __RUN_NUMBER__ is handled in PropagateRunNumber(...) + nBins_x_ParticleEvent[t], min_x_ParticleEvent[t], max_x_ParticleEvent[t], nBins_y_ParticleEvent[t], min_y_ParticleEvent[t], max_y_ParticleEvent[t]); + + qa.fQAParticleEventHistograms2D[t][rs][ba]->GetXaxis()->SetTitle(title_x_ParticleEvent[t].Data()); + qa.fQAParticleEventHistograms2D[t][rs][ba]->GetYaxis()->SetTitle(title_y_ParticleEvent[t].Data()); + qa.fQAParticleEventHistograms2D[t][rs][ba]->SetLineColor(ec.fBeforeAfterColor[ba]); + qa.fQAParticleEventHistograms2D[t][rs][ba]->SetFillColor(ec.fBeforeAfterColor[ba] - 10); + qa.fQAParticleEventHistograms2D[t][rs][ba]->SetOption("col"); + qa.fQAParticleEventList->Add(qa.fQAParticleEventHistograms2D[t][rs][ba]); + } // for(Int_t ba=0;ba<2;ba++) + } // for(Int_t rs=0;rs<2;rs++) // reco/sim + } // for(Int_t t=0;tGetXaxis()->SetBinLabel(eitsNClsEbyE, "#LTitsNCls#GT"); // TBI 20241214 this bin labeling is not really needed, as I never save this TProfile persistently + qa.fQAParticleEventProEbyE[rs][ba]->GetXaxis()->SetBinLabel(eitsNClsNegEtaEbyE, "#LTitsNClsNegEta#GT"); + qa.fQAParticleEventProEbyE[rs][ba]->GetXaxis()->SetBinLabel(eitsNClsPosEtaEbyE, "#LTitsNClsPosEta#GT"); + qa.fQAParticleEventProEbyE[rs][ba]->GetXaxis()->SetBinLabel(eEta0804EbyE, "#LTEta0804EbyE#GT"); + qa.fQAParticleEventProEbyE[rs][ba]->GetXaxis()->SetBinLabel(eEta0400EbyE, "#LTEta0400EbyE#GT"); + qa.fQAParticleEventProEbyE[rs][ba]->GetXaxis()->SetBinLabel(eEta0004EbyE, "#LTEta0004EbyE#GT"); + qa.fQAParticleEventProEbyE[rs][ba]->GetXaxis()->SetBinLabel(eEta0408EbyE, "#LTEta0408EbyE#GT"); + qa.fQAParticleEventProEbyE[rs][ba]->GetXaxis()->SetBinLabel(ePt0005EbyE, "#LTPt0005EbyE#GT"); + qa.fQAParticleEventProEbyE[rs][ba]->GetXaxis()->SetBinLabel(ePt0510EbyE, "#LTPt0510EbyE#GT"); + qa.fQAParticleEventProEbyE[rs][ba]->GetXaxis()->SetBinLabel(ePt1050EbyE, "#LTPt1050EbyE#GT"); + } + } + if (tc.fVerbose) { ExitFunction(__FUNCTION__); } @@ -4526,6 +4785,25 @@ void PropagateRunNumber() } // for(Int_t rs=0;rs<2;rs++) // reco/sim } // for (Int_t t = 0; t < eQAParticleHistograms2D_N; t++) // type, see enum eParticleHistograms2D + // *) particle event histograms 2D: + for (Int_t t = 0; t < eQAParticleEventHistograms2D_N; t++) // type, see enum eParticleEventHistograms2D + { + for (Int_t rs = 0; rs < 2; rs++) // reco/sim + { + for (Int_t ba = 0; ba < 2; ba++) // before/after cuts + { + if (!qa.fQAParticleEventHistograms2D[t][rs][ba]) { + continue; + } + histTitle = qa.fQAParticleEventHistograms2D[t][rs][ba]->GetTitle(); + if (histTitle.Contains("__RUN_NUMBER__")) { + histTitle.ReplaceAll("__RUN_NUMBER__", tc.fRunNumber.Data()); // it replaces in-place + qa.fQAParticleEventHistograms2D[t][rs][ba]->SetTitle(histTitle.Data()); + } + } // for(Int_t ba=0;ba<2;ba++) + } // for(Int_t rs=0;rs<2;rs++) // reco/sim + } // for (Int_t t = 0; t < eQAParticleEventHistograms2D_N; t++) // type, see enum eParticleEventHistograms2D + // *) particle cuts: for (Int_t rs = 0; rs < 2; rs++) // reco/sim { @@ -4678,7 +4956,8 @@ void ResetEventByEventQuantities() // a) Event-by-event quantities; // b) Q-vectors; // c) Reset ebe containers for nested loops; - // d) Fisher-Yates algorithm. + // d) Fisher-Yates algorithm; + // e) QA. if (tc.fVerbose) { StartFunction(__FUNCTION__); @@ -4790,6 +5069,17 @@ void ResetEventByEventQuantities() tc.fRandomIndices = NULL; } + // e) QA: + for (Int_t rs = 0; rs < 2; rs++) // reco/sim + { + for (Int_t ba = 0; ba < 2; ba++) // before/after cuts + { + if (qa.fQAParticleEventProEbyE[rs][ba]) { + qa.fQAParticleEventProEbyE[rs][ba]->Reset(); + } + } + } + if (tc.fVerbose) { ExitFunction(__FUNCTION__); } @@ -5710,6 +6000,24 @@ void FillEventHistograms(T1 const& collision, T2 const& tracks, eBeforeAfter ba) !qa.fQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate][eRec][ba] ? true : qa.fQAEventHistograms2D[eCurrentRunDuration_vs_InteractionRate][eRec][ba]->Fill(ebye.fCurrentRunDuration, ebye.fInteractionRate); } + if (qa.fFillQAParticleEventHistograms2D && qa.fQAParticleEventProEbyE[eRec][ba]) { + // This is a special category, where I do correlation vs. some-event-property. + // I use 'number of combinations' as a weight, which here reduces simply to the 'number of entries' weight. + !qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_itsNClsEbyE][eRec][ba] ? true : qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_itsNClsEbyE][eRec][ba]->Fill(ebye.fCurrentRunDuration, qa.fQAParticleEventProEbyE[eRec][ba]->GetBinContent(eitsNClsEbyE), qa.fQAParticleEventProEbyE[eRec][ba]->GetBinEntries(eitsNClsEbyE)); + !qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_itsNClsNegEtaEbyE][eRec][ba] ? true : qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_itsNClsNegEtaEbyE][eRec][ba]->Fill(ebye.fCurrentRunDuration, qa.fQAParticleEventProEbyE[eRec][ba]->GetBinContent(eitsNClsNegEtaEbyE), qa.fQAParticleEventProEbyE[eRec][ba]->GetBinEntries(eitsNClsNegEtaEbyE)); + !qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_itsNClsPosEtaEbyE][eRec][ba] ? true : qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_itsNClsPosEtaEbyE][eRec][ba]->Fill(ebye.fCurrentRunDuration, qa.fQAParticleEventProEbyE[eRec][ba]->GetBinContent(eitsNClsPosEtaEbyE), qa.fQAParticleEventProEbyE[eRec][ba]->GetBinEntries(eitsNClsPosEtaEbyE)); + !qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0804EbyE][eRec][ba] ? true : qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0804EbyE][eRec][ba]->Fill(ebye.fCurrentRunDuration, qa.fQAParticleEventProEbyE[eRec][ba]->GetBinContent(eEta0804EbyE), qa.fQAParticleEventProEbyE[eRec][ba]->GetBinEntries(eEta0804EbyE)); + !qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0400EbyE][eRec][ba] ? true : qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0400EbyE][eRec][ba]->Fill(ebye.fCurrentRunDuration, qa.fQAParticleEventProEbyE[eRec][ba]->GetBinContent(eEta0400EbyE), qa.fQAParticleEventProEbyE[eRec][ba]->GetBinEntries(eEta0400EbyE)); + !qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0004EbyE][eRec][ba] ? true : qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0004EbyE][eRec][ba]->Fill(ebye.fCurrentRunDuration, qa.fQAParticleEventProEbyE[eRec][ba]->GetBinContent(eEta0004EbyE), qa.fQAParticleEventProEbyE[eRec][ba]->GetBinEntries(eEta0004EbyE)); + !qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0408EbyE][eRec][ba] ? true : qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Eta0408EbyE][eRec][ba]->Fill(ebye.fCurrentRunDuration, qa.fQAParticleEventProEbyE[eRec][ba]->GetBinContent(eEta0408EbyE), qa.fQAParticleEventProEbyE[eRec][ba]->GetBinEntries(eEta0408EbyE)); + !qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Pt0005EbyE][eRec][ba] ? true : qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Pt0005EbyE][eRec][ba]->Fill(ebye.fCurrentRunDuration, qa.fQAParticleEventProEbyE[eRec][ba]->GetBinContent(ePt0005EbyE), qa.fQAParticleEventProEbyE[eRec][ba]->GetBinEntries(ePt0005EbyE)); + !qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Pt0510EbyE][eRec][ba] ? true : qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Pt0510EbyE][eRec][ba]->Fill(ebye.fCurrentRunDuration, qa.fQAParticleEventProEbyE[eRec][ba]->GetBinContent(ePt0510EbyE), qa.fQAParticleEventProEbyE[eRec][ba]->GetBinEntries(ePt0510EbyE)); + !qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Pt1050EbyE][eRec][ba] ? true : qa.fQAParticleEventHistograms2D[eCurrentRunDuration_vs_Pt1050EbyE][eRec][ba]->Fill(ebye.fCurrentRunDuration, qa.fQAParticleEventProEbyE[eRec][ba]->GetBinContent(ePt1050EbyE), qa.fQAParticleEventProEbyE[eRec][ba]->GetBinEntries(ePt1050EbyE)); + + // ... + + } // if (qa.fFillQAParticleEventHistograms2D && qa.fQAParticleEventProEbyE[eRec][ba]) { + // ... and corresponding MC truth simulated (Run 3 specific) // See https://github.com/AliceO2Group/O2Physics/blob/master/Tutorials/src/mcHistograms.cxx if constexpr (rs == eRecAndSim) { @@ -5794,7 +6102,8 @@ void CheckUnderflowAndOverflow() // c) Particle histograms 1D; // d) Particle histograms 2D; // e) QA Event histograms 2D; - // f) QA Particle histograms 2D. + // f) QA Particle histograms 2D; + // g) QA Particle event histograms 2D. if (tc.fVerboseForEachParticle) { StartFunction(__FUNCTION__); @@ -5944,6 +6253,42 @@ void CheckUnderflowAndOverflow() } // for (Int_t rs = 0; rs < 2; rs++) // reco/sim } // for (Int_t t = 0; t < eQAParticleHistograms2D_N; t++) // type, see enum eParticleHistograms2D + // g) QA Particle event histograms 2D: + // TBI 20241212 I never validated this code block + for (Int_t t = 0; t < eQAParticleEventHistograms2D_N; t++) // type, see enum eQAParticleEventHistograms2D + { + for (Int_t rs = 0; rs < 2; rs++) // reco/sim + { + for (Int_t ba = 0; ba < 2; ba++) // before/after cuts + { + if (!qa.fQAParticleEventHistograms2D[t][rs][ba]) { + continue; + } + + // Underflow and overflow in x: + for (Int_t binY = 0; binY <= qa.fQAParticleEventHistograms2D[t][rs][ba]->GetNbinsY(); binY++) { + if (qa.fQAParticleEventHistograms2D[t][rs][ba]->GetBinContent(qa.fQAParticleEventHistograms2D[t][rs][ba]->GetBin(0, binY)) > 0) { + LOGF(fatal, "\033[1;31m%s at line %d : underflow in x variable in fParticleEventHistograms2D[%d][%d][%d], for binY = %d => optimize default binning for this histogram\033[0m", __FUNCTION__, __LINE__, t, rs, ba, binY); + } + if (qa.fQAParticleEventHistograms2D[t][rs][ba]->GetBinContent(qa.fQAParticleEventHistograms2D[t][rs][ba]->GetBin(qa.fQAParticleEventHistograms2D[t][rs][ba]->GetNbinsX() + 1, binY)) > 0) { + LOGF(fatal, "\033[1;31m%s at line %d : overflow in x variable in fParticleEventHistograms2D[%d][%d][%d], for binY = %d => optimize default binning for this histogram\033[0m", __FUNCTION__, __LINE__, t, rs, ba, binY); + } + } // for (Int_t binY = 0; binY <= qa.fQAParticleEventHistograms2D[t][rs][ba]->GetNbinsY(); binY++) { + + // Underflow and overflow in y: + for (Int_t binX = 0; binX <= qa.fQAParticleEventHistograms2D[t][rs][ba]->GetNbinsX(); binX++) { + if (qa.fQAParticleEventHistograms2D[t][rs][ba]->GetBinContent(qa.fQAParticleEventHistograms2D[t][rs][ba]->GetBin(binX, 0)) > 0) { + LOGF(fatal, "\033[1;31m%s at line %d : underflow in y variable in fParticleEventHistograms2D[%d][%d][%d], for binX = %d => optimize default binning for this histogram\033[0m", __FUNCTION__, __LINE__, t, rs, ba, binX); + } + + if (qa.fQAParticleEventHistograms2D[t][rs][ba]->GetBinContent(qa.fQAParticleEventHistograms2D[t][rs][ba]->GetBin(binX, qa.fQAParticleEventHistograms2D[t][rs][ba]->GetNbinsY() + 1)) > 0) { + LOGF(fatal, "\033[1;31m%s at line %d : overflow in y variable in fParticleEventHistograms2D[%d][%d][%d], for binX = %d => optimize default binning for this histogram\033[0m", __FUNCTION__, __LINE__, t, rs, ba, binX); + } + } // for (Int_t binX = 0; binX <= qa.fQAParticleEventHistograms2D[t][rs][ba]->GetNbinsX(); binX++) { + } // for (Int_t ba = 0; ba < 2; ba++) // before/after cuts + } // for (Int_t rs = 0; rs < 2; rs++) // reco/sim + } // for (Int_t t = 0; t < eQAParticleEventHistograms2D_N; t++) // type, see enum eParticleEventHistograms2D + if (tc.fVerboseForEachParticle) { ExitFunction(__FUNCTION__); } @@ -6763,14 +7108,45 @@ void FillParticleHistograms(T const& track, eBeforeAfter ba, Int_t weight = 1) // 2D: if (ph.fFillParticleHistograms2D) { - !ph.fParticleHistograms2D[ePhiPt][eRec][ba] ? true : ph.fParticleHistograms2D[ePhiPt][eRec][ba]->Fill(track.phi(), track.pt(), weight); // 3 2 + !ph.fParticleHistograms2D[ePhiPt][eRec][ba] ? true : ph.fParticleHistograms2D[ePhiPt][eRec][ba]->Fill(track.phi(), track.pt(), weight); !ph.fParticleHistograms2D[ePhiEta][eRec][ba] ? true : ph.fParticleHistograms2D[ePhiEta][eRec][ba]->Fill(track.phi(), track.eta(), weight); } // if (ph.fFillParticleHistograms2D) { // QA: if (qa.fFillQAParticleHistograms2D) { - !qa.fQAParticleHistograms2D[ePt_vs_dcaXY][eRec][ba] ? true : qa.fQAParticleHistograms2D[ePt_vs_dcaXY][eRec][ba]->Fill(track.pt(), track.dcaXY()); + !qa.fQAParticleHistograms2D[ePt_vs_dcaXY][eRec][ba] ? true : qa.fQAParticleHistograms2D[ePt_vs_dcaXY][eRec][ba]->Fill(track.pt(), track.dcaXY(), weight); } + if (qa.fFillQAParticleEventHistograms2D && qa.fQAParticleEventProEbyE[eRec][ba]) { + // Here I only fill the helper profile to get average of requested particle variable for current event: + qa.fQAParticleEventProEbyE[eRec][ba]->Fill(static_cast(eitsNClsEbyE) - 0.5, track.itsNCls(), weight); + + if (track.eta() < 0.) { + qa.fQAParticleEventProEbyE[eRec][ba]->Fill(static_cast(eitsNClsNegEtaEbyE) - 0.5, track.itsNCls(), weight); + } else if (track.eta() > 0.) { // TBI 20241214 for the time being, I do not care about the corner case eta = 0. + qa.fQAParticleEventProEbyE[eRec][ba]->Fill(static_cast(eitsNClsPosEtaEbyE) - 0.5, track.itsNCls(), weight); + } + + if (-0.8 < track.eta() && track.eta() < -0.4) { + qa.fQAParticleEventProEbyE[eRec][ba]->Fill(static_cast(eEta0804EbyE) - 0.5, track.eta(), weight); + } else if (-0.4 < track.eta() && track.eta() < 0.0) { + qa.fQAParticleEventProEbyE[eRec][ba]->Fill(static_cast(eEta0400EbyE) - 0.5, track.eta(), weight); + } else if (0.0 < track.eta() && track.eta() < 0.4) { + qa.fQAParticleEventProEbyE[eRec][ba]->Fill(static_cast(eEta0004EbyE) - 0.5, track.eta(), weight); + } else if (0.4 < track.eta() && track.eta() < 0.8) { + qa.fQAParticleEventProEbyE[eRec][ba]->Fill(static_cast(eEta0408EbyE) - 0.5, track.eta(), weight); + } + + if (0.0 < track.pt() && track.pt() < 0.5) { + qa.fQAParticleEventProEbyE[eRec][ba]->Fill(static_cast(ePt0005EbyE) - 0.5, track.pt(), weight); + } else if (0.5 < track.pt() && track.pt() < 1.0) { + qa.fQAParticleEventProEbyE[eRec][ba]->Fill(static_cast(ePt0510EbyE) - 0.5, track.pt(), weight); + } else if (1.0 < track.pt() && track.pt() < 5.0) { + qa.fQAParticleEventProEbyE[eRec][ba]->Fill(static_cast(ePt1050EbyE) - 0.5, track.pt(), weight); + } + + // ... + + } // if (qa.fFillQAParticleEventHistograms2D && qa.fQAParticleEventProEbyE[eRec][ba]) { // ... and corresponding MC truth simulated (common to Run 3, Run 2 and Run 1) // See https://github.com/AliceO2Group/O2Physics/blob/master/Tutorials/src/mcHistograms.cxx diff --git a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx index 6bf5b16249f..13652b66836 100644 --- a/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx +++ b/PWGCF/MultiparticleCorrelations/Tasks/multiparticle-correlations-ab.cxx @@ -122,7 +122,6 @@ struct MultiparticleCorrelationsAB // this name is used in lower-case format to DefaultCuts(); // here default values for cuts are either hardwired, or defined through default binning to ease bookeeping, // or values for cuts provided via configurables are taken into account // Remark: DefaultCuts() has to be called after DefaultBinning() - // *) Specific cuts: if (tc.fUseSpecificCuts) { SpecificCuts(tc.fWhichSpecificCuts); // after default cuts are applied, on top of them apply analysis-specific cuts. Has to be called after DefaultBinning() and DefaultCuts() From 12fb84ded9f523a9c8fefe45cfb3ceb2e203d965 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Mon, 16 Dec 2024 04:23:21 +0100 Subject: [PATCH 398/459] [PWGLF] check the existence of centrality calibrations (#9002) --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 90 ++++++++++++++---------- 1 file changed, 53 insertions(+), 37 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index 98580beb99b..ac4836d204d 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -392,39 +392,41 @@ struct ebyeMaker { } o2::base::Propagator::initFieldFromGRP(grpo); TList* callst = ccdb->getForTimeStamp("Centrality/Estimators", bc.timestamp()); - auto getccdb = [callst](const char* ccdbhname) { - TH1* h = reinterpret_cast(callst->FindObject(ccdbhname)); - return h; - }; - auto getformulaccdb = [callst](const char* ccdbhname) { - TFormula* f = reinterpret_cast(callst->FindObject(ccdbhname)); - return f; - }; - Run2V0MInfo.mhVtxAmpCorrV0A = getccdb("hVtx_fAmplitude_V0A_Normalized"); - Run2V0MInfo.mhVtxAmpCorrV0C = getccdb("hVtx_fAmplitude_V0C_Normalized"); - Run2V0MInfo.mhMultSelCalib = getccdb("hMultSelCalib_V0M"); - Run2V0MInfo.mMCScale = getformulaccdb(TString::Format("%s-V0M", genName->c_str()).Data()); - if ((Run2V0MInfo.mhVtxAmpCorrV0A != nullptr) && (Run2V0MInfo.mhVtxAmpCorrV0C != nullptr) && (Run2V0MInfo.mhMultSelCalib != nullptr)) { - if (genName->length() != 0) { - if (Run2V0MInfo.mMCScale != nullptr) { - for (int ixpar = 0; ixpar < 6; ++ixpar) { - Run2V0MInfo.mMCScalePars[ixpar] = Run2V0MInfo.mMCScale->GetParameter(ixpar); + if (callst != nullptr) { + auto getccdb = [callst](const char* ccdbhname) { + TH1* h = reinterpret_cast(callst->FindObject(ccdbhname)); + return h; + }; + auto getformulaccdb = [callst](const char* ccdbhname) { + TFormula* f = reinterpret_cast(callst->FindObject(ccdbhname)); + return f; + }; + Run2V0MInfo.mhVtxAmpCorrV0A = getccdb("hVtx_fAmplitude_V0A_Normalized"); + Run2V0MInfo.mhVtxAmpCorrV0C = getccdb("hVtx_fAmplitude_V0C_Normalized"); + Run2V0MInfo.mhMultSelCalib = getccdb("hMultSelCalib_V0M"); + Run2V0MInfo.mMCScale = getformulaccdb(TString::Format("%s-V0M", genName->c_str()).Data()); + if ((Run2V0MInfo.mhVtxAmpCorrV0A != nullptr) && (Run2V0MInfo.mhVtxAmpCorrV0C != nullptr) && (Run2V0MInfo.mhMultSelCalib != nullptr)) { + if (genName->length() != 0) { + if (Run2V0MInfo.mMCScale != nullptr) { + for (int ixpar = 0; ixpar < 6; ++ixpar) { + Run2V0MInfo.mMCScalePars[ixpar] = Run2V0MInfo.mMCScale->GetParameter(ixpar); + } + } else { + LOGF(fatal, "MC Scale information from V0M for run %d not available", bc.runNumber()); } - } else { - LOGF(fatal, "MC Scale information from V0M for run %d not available", bc.runNumber()); } - } - Run2V0MInfo.mCalibrationStored = true; - } else { - LOGF(fatal, "Calibration information from V0M for run %d corrupted", bc.runNumber()); - } - if (doprocessRun2) { - Run2CL0Info.mhVtxAmpCorr = getccdb("hVtx_fnSPDClusters0_Normalized"); - Run2CL0Info.mhMultSelCalib = getccdb("hMultSelCalib_CL0"); - if ((Run2CL0Info.mhVtxAmpCorr != nullptr) && (Run2CL0Info.mhMultSelCalib != nullptr)) { - Run2CL0Info.mCalibrationStored = true; + Run2V0MInfo.mCalibrationStored = true; } else { - LOGF(fatal, "Calibration information from CL0 multiplicity for run %d corrupted", bc.runNumber()); + LOGF(fatal, "Calibration information from V0M for run %d corrupted", bc.runNumber()); + } + if (doprocessRun2) { + Run2CL0Info.mhVtxAmpCorr = getccdb("hVtx_fnSPDClusters0_Normalized"); + Run2CL0Info.mhMultSelCalib = getccdb("hMultSelCalib_CL0"); + if ((Run2CL0Info.mhVtxAmpCorr != nullptr) && (Run2CL0Info.mhMultSelCalib != nullptr)) { + Run2CL0Info.mCalibrationStored = true; + } else { + LOGF(fatal, "Calibration information from CL0 multiplicity for run %d corrupted", bc.runNumber()); + } } } } else { @@ -482,7 +484,7 @@ struct ebyeMaker { float multFV0M = multFV0A + multFV0C; v0m = scaleMC(multFV0M, Run2V0MInfo.mMCScalePars); LOGF(debug, "Unscaled v0m: %f, scaled v0m: %f", multFV0M, v0m); - } else { + } else if (Run2V0MInfo.mCalibrationStored) { v0m = multFV0A * Run2V0MInfo.mhVtxAmpCorrV0A->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0A->FindFixBin(zvtx)) + multFV0C * Run2V0MInfo.mhVtxAmpCorrV0C->GetBinContent(Run2V0MInfo.mhVtxAmpCorrV0C->FindFixBin(zvtx)); } @@ -560,6 +562,8 @@ struct ebyeMaker { // antid and antip QA histos.add("QA/tpcSignal", ";#it{p}_{TPC} (GeV/#it{c});d#it{E}/d#it{x}_{TPC} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); histos.add("QA/tpcSignalPr", ";#it{p}_{TPC} (GeV/#it{c});d#it{E}/d#it{x}_{TPC} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); + // histos.add("QA/itsSignal", ";#it{p}_{ITS} (GeV/#it{c});d#it{E}/d#it{x}_{ITS} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); + // histos.add("QA/itsSignalPr", ";#it{p}_{ITS} (GeV/#it{c});d#it{E}/d#it{x}_{ITS} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); tofMass[0] = histos.add("QA/tofMass_p", ";Centrality (%);#it{p}_{T} (GeV/#it{c});Mass (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, tofMassAxis}); tofMass[1] = histos.add("QA/tofMass_d", ";Centrality (%);#it{p}_{T} (GeV/#it{c});Mass (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, tofMassAxis}); @@ -1035,9 +1039,12 @@ struct ebyeMaker { continue; float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); - float cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); - if (!(collision.sel7() && collision.alias_bit(kINT7)) && (!kINT7Intervals || (kINT7Intervals && ((cV0M >= 10 && cV0M < 30) || cV0M > 50)))) - continue; + float cV0M = -999.f; + if (Run2V0MInfo.mCalibrationStored) { + Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + if (!(collision.sel7() && collision.alias_bit(kINT7)) && (!kINT7Intervals || (kINT7Intervals && ((cV0M >= 10 && cV0M < 30) || cV0M > 50)))) + continue; + } auto centralityCl0 = 105.0f; if (Run2CL0Info.mCalibrationStored) { @@ -1118,7 +1125,10 @@ struct ebyeMaker { continue; float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); - float cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + float cV0M = -999.f; + if (Run2V0MInfo.mCalibrationStored) { + Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + } histos.fill(HIST("QA/zVtx"), collision.posZ()); @@ -1232,7 +1242,10 @@ struct ebyeMaker { continue; float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); - float cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + float cV0M = -999.f; + if (Run2V0MInfo.mCalibrationStored) { + Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + } histos.fill(HIST("QA/zVtx"), collision.posZ()); @@ -1301,7 +1314,10 @@ struct ebyeMaker { continue; float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); - float cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + float cV0M = -999.f; + if (Run2V0MInfo.mCalibrationStored) { + Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + } histos.fill(HIST("QA/zVtx"), collision.posZ()); From 08827799023a7d0bdfec7fdc7f9ca57f1699d7d0 Mon Sep 17 00:00:00 2001 From: upasanasharma31 <84681984+upasanasharma31@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:00:02 +0530 Subject: [PATCH 399/459] [DPG] Redefine the Histogram for the mother (#8992) --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 991266fe14b..e8965bb265e 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -76,9 +76,6 @@ static constexpr const char* particleTitle[nParticles] = {"e", "#mu", "#pi", "K" static constexpr int PDGs[nParticles] = {11, 13, 211, 321, 2212, 1000010020, 1000010030, 1000020030, 1000020040, -11, -13, -211, -321, -2212, -1000010020, -1000010030, -1000020030, -1000020040}; -// Histograms -std::shared_ptr hPtmotherGenerated; // histogram to store pT of Xi and Lambda - // Pt std::array, nParticles> hPtIts; std::array, nParticles> hPtTpc; @@ -106,6 +103,7 @@ std::array, nParticles> hPtItsTpcStr; std::array, nParticles> hPtTrkItsTpcStr; std::array, nParticles> hPtItsTpcTofStr; std::array, nParticles> hPtGeneratedStr; +std::array, nParticles> hPtmotherGenerated; // histogram to store pT of mother std::array, nParticles> hdecaylengthmother; // histogram to store decaylength of mother // Pt for secondaries from material @@ -366,6 +364,7 @@ struct QaEfficiency { hPtTrkItsTpcStr[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/trk/its_tpc", PDGs[histogramIndex]), "ITS-TPC tracks (reco from weak decays) " + tagPt, kTH1D, {axisPt}); hPtItsTpcTofStr[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/its_tpc_tof", PDGs[histogramIndex]), "ITS-TPC-TOF tracks (from weak decays) " + tagPt, kTH1D, {axisPt}); hPtGeneratedStr[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/generated", PDGs[histogramIndex]), "Generated (from weak decays) " + tagPt, kTH1D, {axisPt}); + hPtmotherGenerated[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/generated_mother", PDGs[histogramIndex]), "Generated Mother " + tagPt, kTH1D, {axisPt}); hdecaylengthmother[histogramIndex] = histos.add(Form("MC/pdg%i/pt/str/decayLength", PDGs[histogramIndex]), "Decay Length of mother particle" + tagPt, kTH1D, {axisPt}); // Ter @@ -663,9 +662,6 @@ struct QaEfficiency { histos.add("MC/occ_cent/reco/neg/its", "ITS Negative ", kTH3D, {axisOcc, axisCent, axisPt}); } - AxisSpec axisPtMother{ptBins, "#it{p}_{T} (GeV/#it{c})"}; - hPtmotherGenerated = histos.add("MC/mother/pt/generated", "Generated pT of mother Lambda or Xi", kTH1D, {axisPtMother}); - static_for<0, 1>([&](auto pdgSign) { makeMCHistograms(doEl); makeMCHistograms(doMu); @@ -1267,7 +1263,7 @@ struct QaEfficiency { break; } if (motherIsAccepted) { - hPtmotherGenerated->Fill(mother.pt()); // Fill generated pT for Lambda + hPtmotherGenerated[histogramIndex]->Fill(mother.pt()); // Fill generated pT for mother } } } From 61827697d40b32707e670321113cc84e87116ca6 Mon Sep 17 00:00:00 2001 From: Lucia Anna Tarasovicova Date: Mon, 16 Dec 2024 10:57:33 +0100 Subject: [PATCH 400/459] [PWGLF] change in derivedcascadeanalysis.cxx (#8966) Co-authored-by: Lucia Anna Tarasovicova --- .../Strangeness/derivedcascadeanalysis.cxx | 143 +++++++++++------- 1 file changed, 89 insertions(+), 54 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedcascadeanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedcascadeanalysis.cxx index 824266cdd5e..9f024183737 100644 --- a/PWGLF/Tasks/Strangeness/derivedcascadeanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedcascadeanalysis.cxx @@ -72,6 +72,7 @@ struct derivedCascadeAnalysis { ConfigurableAxis axisMass{"axisMass", {200, 1.222f, 1.422f}, "range of invariant mass, in case of omega take 1.572f, 1.772f"}; Configurable isXi{"isXi", 1, "Apply cuts for Xi identification"}; + Configurable usePbPbCentrality{"usePbPbCentrality", 1, "If true, use centFt0C, else use centFT0M"}; Configurable minOccupancy{"minOccupancy", -1, "Minimal occupancy"}; Configurable maxOccupancy{"maxOccupancy", -1, "Maximal occupancy"}; Configurable minOccupancyFT0{"minOccupancyFT0", -1, "Minimal occupancy"}; @@ -195,6 +196,7 @@ struct derivedCascadeAnalysis { void init(InitContext const&) { histos.add("hEventVertexZ", "hEventVertexZ", kTH1F, {vertexZ}); + histos.add("hEventMultFt0C", "", kTH1F, {{500, 0, 5000}}); histos.add("hEventCentrality", "hEventCentrality", kTH1F, {{101, 0, 101}}); histos.add("hEventSelection", "hEventSelection", kTH1F, {{21, 0, 21}}); histos.add("hOccupancyVsOccupFt0VsCentrality", "", kTH3F, {axisOccupancy, axisOccupancyFt0, {100, 0, 100}}); @@ -328,10 +330,22 @@ struct derivedCascadeAnalysis { if (doprocessCascadesMCforEff) { histos.add("hGenEvents", "", HistType::kTH2F, {{axisNch}, {2, 0, 2}}); histos.add("hCentralityVsMultMC", "", kTH2F, {{101, 0.0f, 101.0f}, axisNch}); + histos.add("hGenMultMCFT0C", "", kTH1F, {{500, 0, 5000}}); + histos.add("hGenMCNParticlesEta10", "", kTH1F, {{500, 0, 5000}}); histos.add("hCentralityVsNcoll_beforeEvSel", "", kTH2F, {{101, 0.0f, 101.0f}, {50, 0.f, 50.f}}); histos.add("hCentralityVsNcoll_afterEvSel", "", kTH2F, {{101, 0.0f, 101.0f}, {50, 0.f, 50.f}}); + histos.add("h2dGenXiMinusEta", "", kTH1F, {{30, -2, 2}}); + histos.add("h2dGenXiMinusEtaPosDaughter", "", kTH1F, {{30, -2, 2}}); + histos.add("h2dGenXiMinusEtaNegDaughter", "", kTH1F, {{30, -2, 2}}); + histos.add("h2dGenXiMinusEtaBach", "", kTH1F, {{30, -2, 2}}); + + histos.add("h2dGenOmegaMinusEta", "", kTH1F, {{30, -2, 2}}); + histos.add("h2dGenOmegaMinusEtaPosDaughter", "", kTH1F, {{30, -2, 2}}); + histos.add("h2dGenOmegaMinusEtaNegDaughter", "", kTH1F, {{30, -2, 2}}); + histos.add("h2dGenOmegaMinusEtaBach", "", kTH1F, {{30, -2, 2}}); + histos.add("h2dGenXiMinus", "h2dGenXiMinus", kTH2D, {{101, 0.0f, 101.0f}, axisPt}); histos.add("h2dGenXiPlus", "h2dGenXiPlus", kTH2D, {{101, 0.0f, 101.0f}, axisPt}); histos.add("h2dGenOmegaMinus", "h2dGenOmegaMinus", kTH2D, {{101, 0.0f, 101.0f}, axisPt}); @@ -392,11 +406,14 @@ struct derivedCascadeAnalysis { if (fillHists) histos.fill(HIST("hEventSelection"), 0.5 /* all collisions */); + float centrality = coll.centFT0C(); + if (!usePbPbCentrality) + centrality = coll.centFT0M(); if (qaFlags.doBefSelEventMultCorr) { histos.fill(HIST("hEventNchCorrelationBefCuts"), coll.multNTracksPVeta1(), coll.multNTracksGlobal()); - histos.fill(HIST("hEventPVcontributorsVsCentralityBefCuts"), coll.centFT0C(), coll.multNTracksPVeta1()); - histos.fill(HIST("hEventGlobalTracksVsCentralityBefCuts"), coll.centFT0C(), coll.multNTracksGlobal()); + histos.fill(HIST("hEventPVcontributorsVsCentralityBefCuts"), centrality, coll.multNTracksPVeta1()); + histos.fill(HIST("hEventGlobalTracksVsCentralityBefCuts"), centrality, coll.multNTracksGlobal()); } if (eventSelectionFlags.doTriggerTVXEventCut && !coll.selection_bit(aod::evsel::kIsTriggerTVX)) { @@ -417,7 +434,7 @@ struct derivedCascadeAnalysis { if (fillHists) histos.fill(HIST("hEventSelection"), 3.5 /* collisions after sel pvz sel*/); - if (coll.centFT0C() > centMax || coll.centFT0C() < centMin) { + if (centrality > centMax || centrality < centMin) { return false; } if (fillHists) @@ -466,9 +483,9 @@ struct derivedCascadeAnalysis { histos.fill(HIST("hEventSelection"), 11.5 /* Not at TF border */); if (eventSelectionFlags.doMultiplicityCorrCut) { - if (coll.multNTracksGlobal() < (1343.3 * TMath::Exp(-0.0443259 * coll.centFT0C()) - 50) || coll.multNTracksGlobal() > (2098.9 * TMath::Exp(-0.0332444 * coll.centFT0C()))) + if (coll.multNTracksGlobal() < (1343.3 * TMath::Exp(-0.0443259 * centrality) - 50) || coll.multNTracksGlobal() > (2098.9 * TMath::Exp(-0.0332444 * centrality))) return false; - if (coll.multNTracksPVeta1() < (3703 * TMath::Exp(-0.0455483 * coll.centFT0C()) - 150) || coll.multNTracksPVeta1() > (4937.33 * TMath::Exp(-0.0372668 * coll.centFT0C()) + 20)) + if (coll.multNTracksPVeta1() < (3703 * TMath::Exp(-0.0455483 * centrality) - 150) || coll.multNTracksPVeta1() > (4937.33 * TMath::Exp(-0.0372668 * centrality) + 20)) return false; } if (fillHists) @@ -527,12 +544,13 @@ struct derivedCascadeAnalysis { histos.fill(HIST("hEventSelection"), 20.5 /* Occupancy FT0 selection */); if (fillHists) { - histos.fill(HIST("hOccupancyVsOccupFt0VsCentrality"), occupancy, occupancyFT0, coll.centFT0C()); - histos.fill(HIST("hEventCentrality"), coll.centFT0C()); + histos.fill(HIST("hOccupancyVsOccupFt0VsCentrality"), occupancy, occupancyFT0, centrality); + histos.fill(HIST("hEventCentrality"), centrality); histos.fill(HIST("hEventVertexZ"), coll.posZ()); + histos.fill(HIST("hEventMultFt0C"), coll.multFT0C()); histos.fill(HIST("hEventNchCorrelationAfCuts"), coll.multNTracksPVeta1(), coll.multNTracksGlobal()); - histos.fill(HIST("hEventPVcontributorsVsCentrality"), coll.centFT0C(), coll.multNTracksPVeta1()); - histos.fill(HIST("hEventGlobalTracksVsCentrality"), coll.centFT0C(), coll.multNTracksGlobal()); + histos.fill(HIST("hEventPVcontributorsVsCentrality"), centrality, coll.multNTracksPVeta1()); + histos.fill(HIST("hEventGlobalTracksVsCentrality"), centrality, coll.multNTracksGlobal()); } return true; @@ -699,6 +717,10 @@ struct derivedCascadeAnalysis { if (!IsEventAccepted(coll, true)) return; + float centrality = coll.centFT0C(); + if (!usePbPbCentrality) + centrality = coll.centFT0M(); + for (auto& casc : Cascades) { int counter = -1; @@ -722,12 +744,12 @@ struct derivedCascadeAnalysis { if (qaFlags.doBefSelCheck) { if (isPositive) - histos.fill(HIST("InvMassBefSel/h") + HIST(charge[0]) + HIST("Cascade"), casc.pt(), invmass, coll.centFT0C()); + histos.fill(HIST("InvMassBefSel/h") + HIST(charge[0]) + HIST("Cascade"), casc.pt(), invmass, centrality); if (isNegative) - histos.fill(HIST("InvMassBefSel/h") + HIST(charge[1]) + HIST("Cascade"), casc.pt(), invmass, coll.centFT0C()); + histos.fill(HIST("InvMassBefSel/h") + HIST(charge[1]) + HIST("Cascade"), casc.pt(), invmass, centrality); } - if (!IsCascadeCandidateAccepted(casc, counter, coll.centFT0C())) + if (!IsCascadeCandidateAccepted(casc, counter, centrality)) continue; counter += 13; @@ -769,23 +791,23 @@ struct derivedCascadeAnalysis { if (casc.sign() < 0) { if (qaFlags.doFillNsigmaTPCHistProton) - histos.fill(HIST("hNsigmaProton"), posExtra.tpcNSigmaPr(), fullMomentumPosDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaProton"), posExtra.tpcNSigmaPr(), fullMomentumPosDaugh, centrality); if (qaFlags.doFillNsigmaTPCHistV0Pion) - histos.fill(HIST("hNsigmaPionNeg"), negExtra.tpcNSigmaPi(), fullmomentumNegDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaPionNeg"), negExtra.tpcNSigmaPi(), fullmomentumNegDaugh, centrality); if (qaFlags.doFillNsigmaTPCHistPionBach && isXi) - histos.fill(HIST("hNsigmaPionNegBach"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, coll.centFT0C()); + histos.fill(HIST("hNsigmaPionNegBach"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, centrality); if (qaFlags.doFillNsigmaTPCHistPionBach && !isXi) - histos.fill(HIST("hNsigmaKaon"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, coll.centFT0C()); + histos.fill(HIST("hNsigmaKaon"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, centrality); } else if (casc.sign() > 0) { if (qaFlags.doFillNsigmaTPCHistV0Pion) - histos.fill(HIST("hNsigmaPionPos"), posExtra.tpcNSigmaPi(), fullMomentumPosDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaPionPos"), posExtra.tpcNSigmaPi(), fullMomentumPosDaugh, centrality); if (qaFlags.doFillNsigmaTPCHistProton) - histos.fill(HIST("hNsigmaProtonNeg"), negExtra.tpcNSigmaPr(), fullmomentumNegDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaProtonNeg"), negExtra.tpcNSigmaPr(), fullmomentumNegDaugh, centrality); if (qaFlags.doFillNsigmaTPCHistPionBach && isXi) - histos.fill(HIST("hNsigmaPionPosBach"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, coll.centFT0C()); + histos.fill(HIST("hNsigmaPionPosBach"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, centrality); if (qaFlags.doFillNsigmaTPCHistPionBach && !isXi) - histos.fill(HIST("hNsigmaKaon"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, coll.centFT0C()); + histos.fill(HIST("hNsigmaKaon"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, centrality); } if (casc.sign() < 0) { @@ -834,12 +856,12 @@ struct derivedCascadeAnalysis { if (posExtra.hasTOF()) { if (candidateSelectionFlags.doNTOFSigmaProtonCut && casc.sign() < 0) { - histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullMomentumPosDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullMomentumPosDaugh, centrality); if (TMath::Abs(casc.tofNSigmaXiLaPr()) > candidateSelectionValues.nsigmatofPr && fullMomentumPosDaugh > 0.6) continue; } if (candidateSelectionFlags.doNTOFSigmaV0PionCut && casc.sign() > 0) { - histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), fullMomentumPosDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), fullMomentumPosDaugh, centrality); if (TMath::Abs(casc.tofNSigmaXiLaPi()) > candidateSelectionValues.nsigmatofPion) continue; } @@ -848,12 +870,12 @@ struct derivedCascadeAnalysis { if (negExtra.hasTOF()) { if (candidateSelectionFlags.doNTOFSigmaProtonCut && casc.sign() > 0) { - histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullmomentumNegDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullmomentumNegDaugh, centrality); if (TMath::Abs(casc.tofNSigmaXiLaPr()) > candidateSelectionValues.nsigmatofPr && fullmomentumNegDaugh > 0.6) continue; } if (candidateSelectionFlags.doNTOFSigmaV0PionCut && casc.sign() < 0) { - histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), fullmomentumNegDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), fullmomentumNegDaugh, centrality); if (TMath::Abs(casc.tofNSigmaXiLaPi()) > candidateSelectionValues.nsigmatofPion) continue; } @@ -870,7 +892,7 @@ struct derivedCascadeAnalysis { } if (bachExtra.hasTOF() && candidateSelectionFlags.doNTOFSigmaBachelorCut) { - histos.fill(HIST("hNsigmaTOFBachelorPion"), casc.tofNSigmaXiPi(), fullmomentumBachelor, coll.centFT0C()); + histos.fill(HIST("hNsigmaTOFBachelorPion"), casc.tofNSigmaXiPi(), fullmomentumBachelor, centrality); if (TMath::Abs(casc.tofNSigmaXiPi()) > candidateSelectionValues.nsigmatofBachPion) continue; } @@ -893,7 +915,7 @@ struct derivedCascadeAnalysis { } if (bachExtra.hasTOF() && candidateSelectionFlags.doNTOFSigmaBachelorCut) { - histos.fill(HIST("hNsigmaTOFBachelorKaon"), casc.tofNSigmaOmKa(), TMath::Sqrt(TMath::Power(casc.pxbach(), 2) + TMath::Power(casc.pybach(), 2) + TMath::Power(casc.pzbach(), 2)), coll.centFT0C()); + histos.fill(HIST("hNsigmaTOFBachelorKaon"), casc.tofNSigmaOmKa(), TMath::Sqrt(TMath::Power(casc.pxbach(), 2) + TMath::Power(casc.pybach(), 2) + TMath::Power(casc.pzbach(), 2)), centrality); if (TMath::Abs(casc.tofNSigmaOmKa()) > candidateSelectionValues.nsigmatofBachKaon) continue; } @@ -908,9 +930,9 @@ struct derivedCascadeAnalysis { } } if (isPositive) - histos.fill(HIST("InvMassAfterSel/h") + HIST(charge[0]) + HIST("Cascade"), casc.pt(), invmass, coll.centFT0C()); + histos.fill(HIST("InvMassAfterSel/h") + HIST(charge[0]) + HIST("Cascade"), casc.pt(), invmass, centrality); if (isNegative) - histos.fill(HIST("InvMassAfterSel/h") + HIST(charge[1]) + HIST("Cascade"), casc.pt(), invmass, coll.centFT0C()); + histos.fill(HIST("InvMassAfterSel/h") + HIST(charge[1]) + HIST("Cascade"), casc.pt(), invmass, centrality); if (qaFlags.doOccupancyCheck) { float occupancy = -1; @@ -920,7 +942,7 @@ struct derivedCascadeAnalysis { occupancy = coll.ft0cOccupancyInTimeRange(); static_for<0, 9>([&](auto i) { constexpr int index = i.value; - if (coll.centFT0C() < centralityIntervals[index + 1] && coll.centFT0C() > centralityIntervals[index]) { + if (centrality < centralityIntervals[index + 1] && centrality > centralityIntervals[index]) { if (isPositive) histos.fill(HIST("InvMassAfterSelCent") + HIST(Index[index]) + HIST("/h") + HIST(charge[0]) + HIST("Cascade"), casc.pt(), invmass, occupancy); if (isNegative) @@ -981,7 +1003,9 @@ struct derivedCascadeAnalysis { { if (!IsEventAccepted(coll, true)) return; - + float centrality = coll.centFT0C(); + if (!usePbPbCentrality) + centrality = coll.centFT0M(); for (auto& casc : Cascades) { float mass = -1; if (isXi) @@ -1003,9 +1027,9 @@ struct derivedCascadeAnalysis { // To have trace of how it was before selections if (qaFlags.doBefSelCheck) { if (isPositive) - histos.fill(HIST("InvMassBefSel/h") + HIST(charge[0]) + HIST("Cascade"), casc.pt(), mass, coll.centFT0C()); + histos.fill(HIST("InvMassBefSel/h") + HIST(charge[0]) + HIST("Cascade"), casc.pt(), mass, centrality); if (isNegative) - histos.fill(HIST("InvMassBefSel/h") + HIST(charge[1]) + HIST("Cascade"), casc.pt(), mass, coll.centFT0C()); + histos.fill(HIST("InvMassBefSel/h") + HIST(charge[1]) + HIST("Cascade"), casc.pt(), mass, centrality); } if (!casc.has_cascMCCore()) @@ -1023,7 +1047,7 @@ struct derivedCascadeAnalysis { isTrueMCCascadeDecay = true; float ptmc = RecoDecay::sqrtSumOfSquares(cascMC.pxMC(), cascMC.pyMC()); - if (!IsCascadeCandidateAccepted(casc, counter, coll.centFT0C())) + if (!IsCascadeCandidateAccepted(casc, counter, centrality)) continue; counter += 13; @@ -1061,13 +1085,13 @@ struct derivedCascadeAnalysis { if (isNegative) { if (qaFlags.doFillNsigmaTPCHistProton) - histos.fill(HIST("hNsigmaProton"), posExtra.tpcNSigmaPr(), fullMomentumPosDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaProton"), posExtra.tpcNSigmaPr(), fullMomentumPosDaugh, centrality); if (qaFlags.doFillNsigmaTPCHistV0Pion) - histos.fill(HIST("hNsigmaPionNeg"), negExtra.tpcNSigmaPi(), fullmomentumNegDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaPionNeg"), negExtra.tpcNSigmaPi(), fullmomentumNegDaugh, centrality); if (qaFlags.doFillNsigmaTPCHistPionBach && isXi) - histos.fill(HIST("hNsigmaPionNegBach"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, coll.centFT0C()); + histos.fill(HIST("hNsigmaPionNegBach"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, centrality); if (qaFlags.doFillNsigmaTPCHistPionBach && !isXi) - histos.fill(HIST("hNsigmaKaon"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, coll.centFT0C()); + histos.fill(HIST("hNsigmaKaon"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, centrality); if (candidateSelectionFlags.doNTPCSigmaCut) { if (TMath::Abs(posExtra.tpcNSigmaPr()) > candidateSelectionValues.nsigmatpcPr || TMath::Abs(negExtra.tpcNSigmaPi()) > candidateSelectionValues.nsigmatpcPi) @@ -1079,13 +1103,13 @@ struct derivedCascadeAnalysis { } if (isPositive) { if (qaFlags.doFillNsigmaTPCHistV0Pion) - histos.fill(HIST("hNsigmaPionPos"), posExtra.tpcNSigmaPi(), fullMomentumPosDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaPionPos"), posExtra.tpcNSigmaPi(), fullMomentumPosDaugh, centrality); if (qaFlags.doFillNsigmaTPCHistProton) - histos.fill(HIST("hNsigmaProtonNeg"), negExtra.tpcNSigmaPr(), fullmomentumNegDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaProtonNeg"), negExtra.tpcNSigmaPr(), fullmomentumNegDaugh, centrality); if (qaFlags.doFillNsigmaTPCHistPionBach && isXi) - histos.fill(HIST("hNsigmaPionPosBach"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, coll.centFT0C()); + histos.fill(HIST("hNsigmaPionPosBach"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, centrality); if (qaFlags.doFillNsigmaTPCHistPionBach && !isXi) - histos.fill(HIST("hNsigmaKaon"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, coll.centFT0C()); + histos.fill(HIST("hNsigmaKaon"), bachExtra.tpcNSigmaPi(), fullmomentumBachelor, centrality); if (candidateSelectionFlags.doNTPCSigmaCut) { if (TMath::Abs(posExtra.tpcNSigmaPi()) > candidateSelectionValues.nsigmatpcPi || TMath::Abs(negExtra.tpcNSigmaPr()) > candidateSelectionValues.nsigmatpcPr) @@ -1120,12 +1144,12 @@ struct derivedCascadeAnalysis { if (posExtra.hasTOF()) { if (candidateSelectionFlags.doNTOFSigmaProtonCut && isNegative) { - histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullMomentumPosDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullMomentumPosDaugh, centrality); if (TMath::Abs(casc.tofNSigmaXiLaPr()) > candidateSelectionValues.nsigmatofPr && fullMomentumPosDaugh > 0.6) continue; } if (candidateSelectionFlags.doNTOFSigmaV0PionCut && isPositive) { - histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), fullMomentumPosDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), fullMomentumPosDaugh, centrality); if (TMath::Abs(casc.tofNSigmaXiLaPi()) > candidateSelectionValues.nsigmatofPion) continue; } @@ -1133,12 +1157,12 @@ struct derivedCascadeAnalysis { if (negExtra.hasTOF()) { if (candidateSelectionFlags.doNTOFSigmaProtonCut && isPositive) { - histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullmomentumNegDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaTOFProton"), casc.tofNSigmaXiLaPr(), fullmomentumNegDaugh, centrality); if (TMath::Abs(casc.tofNSigmaXiLaPr()) > candidateSelectionValues.nsigmatofPr && fullmomentumNegDaugh > 0.6) continue; } if (candidateSelectionFlags.doNTOFSigmaV0PionCut && isNegative) { - histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), fullmomentumNegDaugh, coll.centFT0C()); + histos.fill(HIST("hNsigmaTOFV0Pion"), casc.tofNSigmaXiLaPi(), fullmomentumNegDaugh, centrality); if (TMath::Abs(casc.tofNSigmaXiLaPi()) > candidateSelectionValues.nsigmatofPion) continue; } @@ -1154,7 +1178,7 @@ struct derivedCascadeAnalysis { } if (bachExtra.hasTOF() && candidateSelectionFlags.doNTOFSigmaBachelorCut) { - histos.fill(HIST("hNsigmaTOFBachelorPion"), casc.tofNSigmaXiPi(), fullmomentumBachelor, coll.centFT0C()); + histos.fill(HIST("hNsigmaTOFBachelorPion"), casc.tofNSigmaXiPi(), fullmomentumBachelor, centrality); if (TMath::Abs(casc.tofNSigmaXiPi()) > candidateSelectionValues.nsigmatofBachPion) continue; } @@ -1170,7 +1194,7 @@ struct derivedCascadeAnalysis { } if (bachExtra.hasTOF() && candidateSelectionFlags.doNTOFSigmaBachelorCut) { - histos.fill(HIST("hNsigmaTOFBachelorKaon"), casc.tofNSigmaOmKa(), fullmomentumBachelor, coll.centFT0C()); + histos.fill(HIST("hNsigmaTOFBachelorKaon"), casc.tofNSigmaOmKa(), fullmomentumBachelor, centrality); if (TMath::Abs(casc.tofNSigmaOmKa()) > candidateSelectionValues.nsigmatofBachKaon) continue; } @@ -1187,20 +1211,20 @@ struct derivedCascadeAnalysis { } if (isPositive) { - histos.fill(HIST("InvMassAfterSel/h") + HIST(charge[0]) + HIST("Cascade"), casc.pt(), mass, coll.centFT0C()); + histos.fill(HIST("InvMassAfterSel/h") + HIST(charge[0]) + HIST("Cascade"), casc.pt(), mass, centrality); if (isTrueMCCascadeDecay) - histos.fill(HIST("hPositiveCascadePtForEfficiency"), ptmc, mass, coll.centFT0C()); + histos.fill(HIST("hPositiveCascadePtForEfficiency"), ptmc, mass, centrality); } if (isNegative) { - histos.fill(HIST("InvMassAfterSel/h") + HIST(charge[1]) + HIST("Cascade"), casc.pt(), mass, coll.centFT0C()); + histos.fill(HIST("InvMassAfterSel/h") + HIST(charge[1]) + HIST("Cascade"), casc.pt(), mass, centrality); if (isTrueMCCascadeDecay) - histos.fill(HIST("hNegativeCascadePtForEfficiency"), ptmc, mass, coll.centFT0C()); + histos.fill(HIST("hNegativeCascadePtForEfficiency"), ptmc, mass, centrality); } if (isTrueMCCascade) { if (isPositive) - histos.fill(HIST("InvMassAfterSelMCrecTruth/h") + HIST(charge[0]) + HIST("Cascade"), ptmc, mass, coll.centFT0C()); + histos.fill(HIST("InvMassAfterSelMCrecTruth/h") + HIST(charge[0]) + HIST("Cascade"), ptmc, mass, centrality); if (isNegative) - histos.fill(HIST("InvMassAfterSelMCrecTruth/h") + HIST(charge[1]) + HIST("Cascade"), ptmc, mass, coll.centFT0C()); + histos.fill(HIST("InvMassAfterSelMCrecTruth/h") + HIST(charge[1]) + HIST("Cascade"), ptmc, mass, centrality); } if (qaFlags.doOccupancyCheck) { float occupancy = -1; @@ -1210,7 +1234,7 @@ struct derivedCascadeAnalysis { occupancy = coll.ft0cOccupancyInTimeRange(); static_for<0, 9>([&](auto i) { constexpr int index = i.value; - if (coll.centFT0C() < centralityIntervals[index + 1] && coll.centFT0C() > centralityIntervals[index]) { + if (centrality < centralityIntervals[index + 1] && centrality > centralityIntervals[index]) { if (isPositive) { histos.fill(HIST("InvMassAfterSelCent") + HIST(Index[index]) + HIST("/h") + HIST(charge[0]) + HIST("Cascade"), casc.pt(), mass, occupancy); if (isTrueMCCascadeDecay) @@ -1313,6 +1337,10 @@ struct derivedCascadeAnalysis { if (cascMC.pdgCode() == 3312) { histos.fill(HIST("h2dGenXiMinus"), centrality, ptmc); + histos.fill(HIST("h2dGenXiMinusEta"), RecoDecay::eta(std::array{cascMC.pxMC(), cascMC.pyMC(), cascMC.pzMC()})); + histos.fill(HIST("h2dGenXiMinusEtaPosDaughter"), RecoDecay::eta(std::array{cascMC.pxPosMC(), cascMC.pyPosMC(), cascMC.pzPosMC()})); + histos.fill(HIST("h2dGenXiMinusEtaNegDaughter"), RecoDecay::eta(std::array{cascMC.pxNegMC(), cascMC.pyNegMC(), cascMC.pzNegMC()})); + histos.fill(HIST("h2dGenXiMinusEtaBach"), RecoDecay::eta(std::array{cascMC.pxBachMC(), cascMC.pyBachMC(), cascMC.pzBachMC()})); histos.fill(HIST("h2dGenXiMinusVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); histos.fill(HIST("h2dGenXiMinusVsCentOccupancy"), ptmc, centrality, occupancy); } @@ -1323,6 +1351,10 @@ struct derivedCascadeAnalysis { } if (cascMC.pdgCode() == 3334) { histos.fill(HIST("h2dGenOmegaMinus"), centrality, ptmc); + histos.fill(HIST("h2dGenOmegaMinusEta"), RecoDecay::eta(std::array{cascMC.pxMC(), cascMC.pyMC(), cascMC.pzMC()})); + histos.fill(HIST("h2dGenOmegaMinusEtaPosDaughter"), RecoDecay::eta(std::array{cascMC.pxPosMC(), cascMC.pyPosMC(), cascMC.pzPosMC()})); + histos.fill(HIST("h2dGenOmegaMinusEtaNegDaughter"), RecoDecay::eta(std::array{cascMC.pxNegMC(), cascMC.pyNegMC(), cascMC.pzNegMC()})); + histos.fill(HIST("h2dGenOmegaMinusEtaBach"), RecoDecay::eta(std::array{cascMC.pxBachMC(), cascMC.pyBachMC(), cascMC.pzBachMC()})); histos.fill(HIST("h2dGenOmegaMinusVsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); histos.fill(HIST("h2dGenOmegaMinusVsCentOccupancy"), ptmc, centrality, occupancy); } @@ -1371,6 +1403,9 @@ struct derivedCascadeAnalysis { histos.fill(HIST("hCentralityVsMultMC"), centrality, mcCollision.multMCNParticlesEta05()); + histos.fill(HIST("hGenMultMCFT0C"), mcCollision.multMCFT0C()); + histos.fill(HIST("hGenMCNParticlesEta10"), mcCollision.multMCNParticlesEta10()); + if (atLeastOne) { histos.fill(HIST("hGenEvents"), mcCollision.multMCNParticlesEta05(), 1.5 /* at least 1 rec. event*/); } From a7c8ca1ae02ff24c065117eaa33016ca453a4860 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 16 Dec 2024 12:23:17 +0100 Subject: [PATCH 401/459] [PWGDQ] Enable building K0s-K0s pairs (#8865) --- PWGDQ/Tasks/quarkoniaToHyperons.cxx | 814 +++++++++++++++++----------- 1 file changed, 499 insertions(+), 315 deletions(-) diff --git a/PWGDQ/Tasks/quarkoniaToHyperons.cxx b/PWGDQ/Tasks/quarkoniaToHyperons.cxx index f2fc85498a3..6133ee4e090 100644 --- a/PWGDQ/Tasks/quarkoniaToHyperons.cxx +++ b/PWGDQ/Tasks/quarkoniaToHyperons.cxx @@ -9,6 +9,12 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // +/// \file quarkoniaToHyperons.cxx +/// \brief quarkonia --> hyperon antihyperon analysis task +/// +/// \author David Dobrigkeit Chinellato , Austrian Academy of Sciences & SMI +/// \author Romain Schotter , Austrian Academy of Sciences & SMI +// // V0 analysis task // ================ // @@ -16,6 +22,7 @@ // standard analysis output. It is meant to be run over // derived data. // +// // Comments, questions, complaints, suggestions? // Please write to: // romain.schotter@cern.ch @@ -26,13 +33,15 @@ #include #include #include +#include +#include +#include #include #include #include #include #include -#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -60,28 +69,28 @@ #include "EventFiltering/ZorroSummary.h" // constants -const float ctauXiPDG = 4.91; // from PDG -const float ctauOmegaPDG = 2.461; // from PDG +const float ctauXiPDG = 4.91; // Xi PDG lifetime +const float ctauOmegaPDG = 2.461; // Omega PDG lifetime using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -using dauTracks = soa::Join; -using dauMCTracks = soa::Join; -using v0Candidates = soa::Join; -// using v0MCCandidates = soa::Join; -using v0MCCandidates = soa::Join; +using DauTracks = soa::Join; +using DauMCTracks = soa::Join; +using V0Candidates = soa::Join; +// using V0MCCandidates = soa::Join; +using V0MCCandidates = soa::Join; -using cascadeCandidates = soa::Join; -using cascadeMCCandidates = soa::Join; +using CascadeCandidates = soa::Join; +using CascadeMCCandidates = soa::Join; // simple checkers, but ensure 64 bit integers -#define bitset(var, nbit) ((var) |= (static_cast(1) << static_cast(nbit))) -#define bitcheck(var, nbit) ((var) & (static_cast(1) << static_cast(nbit))) +#define BITSET(var, nbit) ((var) |= (static_cast(1) << static_cast(nbit))) +#define BITCHECK(var, nbit) ((var) & (static_cast(1) << static_cast(nbit))) -struct quarkoniaToHyperons { +struct QuarkoniaToHyperons { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // master analysis switches @@ -93,6 +102,7 @@ struct quarkoniaToHyperons { // switch on/off event selections Configurable requireSel8{"requireSel8", true, "require sel8 event selection"}; + Configurable requireTriggerTVX{"requireTriggerTVX", true, "require FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level"}; Configurable rejectITSROFBorder{"rejectITSROFBorder", true, "reject events at ITS ROF border"}; Configurable rejectTFBorder{"rejectTFBorder", true, "reject events at TF border"}; Configurable requireIsVertexITSTPC{"requireIsVertexITSTPC", false, "require events with at least one ITS-TPC track"}; @@ -103,6 +113,7 @@ struct quarkoniaToHyperons { Configurable requireNoCollInTimeRangeStd{"requireNoCollInTimeRangeStd", true, "reject collisions corrupted by the cannibalism, with other collisions within +/- 10 microseconds"}; Configurable requireNoCollInTimeRangeNarrow{"requireNoCollInTimeRangeNarrow", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 10 microseconds"}; + Configurable buildK0sK0sPairs{"buildK0sK0sPairs", false, "Build K0s K0s from charmonia decay"}; Configurable buildLaLaBarPairs{"buildLaLaBarPairs", false, "Build Lambda antiLambda from charmonia decay"}; Configurable buildXiXiBarPairs{"buildXiXiBarPairs", false, "Build Xi antiXi from charmonia decay"}; Configurable buildOmOmBarPairs{"buildOmOmBarPairs", false, "Build Omega antiOmega from charmonia decay"}; @@ -148,10 +159,10 @@ struct quarkoniaToHyperons { Configurable requireNegITSonly{"v0Selections.requireNegITSonly", false, "require that negative track is ITSonly (overrides TPC quality)"}; // PID (TPC/TOF) - Configurable TpcPidNsigmaCut{"v0Selections.TpcPidNsigmaCut", 5, "TpcPidNsigmaCut"}; - Configurable TofPidNsigmaCutLaPr{"v0Selections.TofPidNsigmaCutLaPr", 1e+6, "TofPidNsigmaCutLaPr"}; - Configurable TofPidNsigmaCutLaPi{"v0Selections.TofPidNsigmaCutLaPi", 1e+6, "TofPidNsigmaCutLaPi"}; - Configurable TofPidNsigmaCutK0Pi{"v0Selections.TofPidNsigmaCutK0Pi", 1e+6, "TofPidNsigmaCutK0Pi"}; + Configurable tpcPidNsigmaCut{"v0Selections.tpcPidNsigmaCut", 5, "tpcPidNsigmaCut"}; + Configurable tofPidNsigmaCutLaPr{"v0Selections.tofPidNsigmaCutLaPr", 1e+6, "tofPidNsigmaCutLaPr"}; + Configurable tofPidNsigmaCutLaPi{"v0Selections.tofPidNsigmaCutLaPi", 1e+6, "tofPidNsigmaCutLaPi"}; + Configurable tofPidNsigmaCutK0Pi{"v0Selections.tofPidNsigmaCutK0Pi", 1e+6, "tofPidNsigmaCutK0Pi"}; // PID (TOF) Configurable maxDeltaTimeProton{"v0Selections.maxDeltaTimeProton", 1e+9, "check maximum allowed time"}; @@ -196,11 +207,11 @@ struct quarkoniaToHyperons { Configurable requireNegITSonly{"cascSelections.requireNegITSonly", false, "require that negative track is ITSonly (overrides TPC quality)"}; // PID (TPC/TOF) - Configurable TpcPidNsigmaCut{"cascSelections.TpcPidNsigmaCut", 5, "TpcPidNsigmaCut"}; - Configurable TofPidNsigmaCutLaPr{"cascSelections.TofPidNsigmaCutLaPr", 1e+6, "TofPidNsigmaCutLaPr"}; - Configurable TofPidNsigmaCutLaPi{"cascSelections.TofPidNsigmaCutLaPi", 1e+6, "TofPidNsigmaCutLaPi"}; - Configurable TofPidNsigmaCutXiPi{"cascSelections.TofPidNsigmaCutXiPi", 1e+6, "TofPidNsigmaCutXiPi"}; - Configurable TofPidNsigmaCutOmKa{"cascSelections.TofPidNsigmaCutOmKa", 1e+6, "TofPidNsigmaCutOmKa"}; + Configurable tpcPidNsigmaCut{"cascSelections.tpcPidNsigmaCut", 5, "tpcPidNsigmaCut"}; + Configurable tofPidNsigmaCutLaPr{"cascSelections.tofPidNsigmaCutLaPr", 1e+6, "tofPidNsigmaCutLaPr"}; + Configurable tofPidNsigmaCutLaPi{"cascSelections.tofPidNsigmaCutLaPi", 1e+6, "tofPidNsigmaCutLaPi"}; + Configurable tofPidNsigmaCutXiPi{"cascSelections.tofPidNsigmaCutXiPi", 1e+6, "tofPidNsigmaCutXiPi"}; + Configurable tofPidNsigmaCutOmKa{"cascSelections.tofPidNsigmaCutOmKa", 1e+6, "tofPidNsigmaCutOmKa"}; // PID (TOF) Configurable maxDeltaTimeProton{"cascSelections.maxDeltaTimeProton", 1e+9, "check maximum allowed time"}; @@ -216,10 +227,10 @@ struct quarkoniaToHyperons { // UPC selections SGSelector sgSelector; struct : ConfigurableGroup { - Configurable FV0cut{"upcCuts.FV0cut", 100., "FV0A threshold"}; - Configurable FT0Acut{"upcCuts.FT0Acut", 200., "FT0A threshold"}; - Configurable FT0Ccut{"upcCuts.FT0Ccut", 100., "FT0C threshold"}; - Configurable ZDCcut{"upcCuts.ZDCcut", 10., "ZDC threshold"}; + Configurable fv0Cut{"upcCuts.fv0Cut", 100., "FV0A threshold"}; + Configurable ft0aCut{"upcCuts.ft0aCut", 200., "FT0A threshold"}; + Configurable ft0cCut{"upcCuts.ft0cCut", 100., "FT0C threshold"}; + Configurable zdcCut{"upcCuts.zdcCut", 10., "ZDC threshold"}; // Configurable gapSel{"upcCuts.gapSel", 2, "Gap selection"}; } upcCuts; @@ -300,6 +311,10 @@ struct quarkoniaToHyperons { ConfigurableAxis axisOmegaMass{"axisOmegaMass", {500, 1.670f, 1.675f}, "Omega mass (GeV/#it{c}^{2})"}; ConfigurableAxis axisNsigmaTPC{"axisNsigmaTPC", {200, -10.0f, 10.0f}, "N sigma TPC"}; + // AP plot axes + ConfigurableAxis axisAPAlpha{"axisAPAlpha", {220, -1.1f, 1.1f}, "V0 AP alpha"}; + ConfigurableAxis axisAPQt{"axisAPQt", {220, 0.0f, 0.5f}, "V0 AP alpha"}; + // Track quality axes ConfigurableAxis axisTPCrows{"axisTPCrows", {160, 0.0f, 160.0f}, "N TPC rows"}; ConfigurableAxis axisITSclus{"axisITSclus", {7, 0.0f, 7.0f}, "N ITS Clusters"}; @@ -313,7 +328,7 @@ struct quarkoniaToHyperons { // For manual sliceBy PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; - enum selection : uint64_t { selCosPA = 0, + enum Selection : uint64_t { selCosPA = 0, selRadius, selRadiusMax, selDCANegToPV, @@ -385,61 +400,61 @@ struct quarkoniaToHyperons { void init(InitContext const&) { // initialise bit masks - maskTopological = (uint64_t(1) << selCosPA) | (uint64_t(1) << selRadius) | (uint64_t(1) << selDCANegToPV) | (uint64_t(1) << selDCAPosToPV) | (uint64_t(1) << selDCAV0ToPV) | (uint64_t(1) << selDCAV0Dau) | (uint64_t(1) << selRadiusMax); - maskTopoNoV0Radius = (uint64_t(1) << selCosPA) | (uint64_t(1) << selDCANegToPV) | (uint64_t(1) << selDCAPosToPV) | (uint64_t(1) << selDCAV0ToPV) | (uint64_t(1) << selDCAV0Dau) | (uint64_t(1) << selRadiusMax); - maskTopoNoDCANegToPV = (uint64_t(1) << selCosPA) | (uint64_t(1) << selRadius) | (uint64_t(1) << selDCAPosToPV) | (uint64_t(1) << selDCAV0ToPV) | (uint64_t(1) << selDCAV0Dau) | (uint64_t(1) << selRadiusMax); - maskTopoNoDCAPosToPV = (uint64_t(1) << selCosPA) | (uint64_t(1) << selRadius) | (uint64_t(1) << selDCANegToPV) | (uint64_t(1) << selDCAV0ToPV) | (uint64_t(1) << selDCAV0Dau) | (uint64_t(1) << selRadiusMax); - maskTopoNoCosPA = (uint64_t(1) << selRadius) | (uint64_t(1) << selDCANegToPV) | (uint64_t(1) << selDCAPosToPV) | (uint64_t(1) << selDCAV0ToPV) | (uint64_t(1) << selDCAV0Dau) | (uint64_t(1) << selRadiusMax); - maskTopoNoDCAV0Dau = (uint64_t(1) << selCosPA) | (uint64_t(1) << selRadius) | (uint64_t(1) << selDCANegToPV) | (uint64_t(1) << selDCAPosToPV) | (uint64_t(1) << selDCAV0ToPV) | (uint64_t(1) << selRadiusMax); - maskTopoNoDCAV0ToPV = (uint64_t(1) << selCosPA) | (uint64_t(1) << selRadius) | (uint64_t(1) << selDCANegToPV) | (uint64_t(1) << selDCAPosToPV) | (uint64_t(1) << selDCAV0Dau) | (uint64_t(1) << selRadiusMax); - - maskK0ShortSpecific = (uint64_t(1) << selK0ShortRapidity) | (uint64_t(1) << selK0ShortCTau) | (uint64_t(1) << selK0ShortArmenteros) | (uint64_t(1) << selConsiderK0Short) | (uint64_t(1) << selK0ShortMassWindow) | (uint64_t(1) << selLambdaMassRejection); - maskLambdaSpecific = (uint64_t(1) << selLambdaRapidity) | (uint64_t(1) << selLambdaCTau) | (uint64_t(1) << selConsiderLambda) | (uint64_t(1) << selLambdaMassWindow) | (uint64_t(1) << selK0ShortMassRejection); - maskAntiLambdaSpecific = (uint64_t(1) << selLambdaRapidity) | (uint64_t(1) << selLambdaCTau) | (uint64_t(1) << selConsiderAntiLambda) | (uint64_t(1) << selAntiLambdaMassWindow) | (uint64_t(1) << selK0ShortMassRejection); + maskTopological = (static_cast(1) << selCosPA) | (static_cast(1) << selRadius) | (static_cast(1) << selDCANegToPV) | (static_cast(1) << selDCAPosToPV) | (static_cast(1) << selDCAV0ToPV) | (static_cast(1) << selDCAV0Dau) | (static_cast(1) << selRadiusMax); + maskTopoNoV0Radius = (static_cast(1) << selCosPA) | (static_cast(1) << selDCANegToPV) | (static_cast(1) << selDCAPosToPV) | (static_cast(1) << selDCAV0ToPV) | (static_cast(1) << selDCAV0Dau) | (static_cast(1) << selRadiusMax); + maskTopoNoDCANegToPV = (static_cast(1) << selCosPA) | (static_cast(1) << selRadius) | (static_cast(1) << selDCAPosToPV) | (static_cast(1) << selDCAV0ToPV) | (static_cast(1) << selDCAV0Dau) | (static_cast(1) << selRadiusMax); + maskTopoNoDCAPosToPV = (static_cast(1) << selCosPA) | (static_cast(1) << selRadius) | (static_cast(1) << selDCANegToPV) | (static_cast(1) << selDCAV0ToPV) | (static_cast(1) << selDCAV0Dau) | (static_cast(1) << selRadiusMax); + maskTopoNoCosPA = (static_cast(1) << selRadius) | (static_cast(1) << selDCANegToPV) | (static_cast(1) << selDCAPosToPV) | (static_cast(1) << selDCAV0ToPV) | (static_cast(1) << selDCAV0Dau) | (static_cast(1) << selRadiusMax); + maskTopoNoDCAV0Dau = (static_cast(1) << selCosPA) | (static_cast(1) << selRadius) | (static_cast(1) << selDCANegToPV) | (static_cast(1) << selDCAPosToPV) | (static_cast(1) << selDCAV0ToPV) | (static_cast(1) << selRadiusMax); + maskTopoNoDCAV0ToPV = (static_cast(1) << selCosPA) | (static_cast(1) << selRadius) | (static_cast(1) << selDCANegToPV) | (static_cast(1) << selDCAPosToPV) | (static_cast(1) << selDCAV0Dau) | (static_cast(1) << selRadiusMax); + + maskK0ShortSpecific = (static_cast(1) << selK0ShortRapidity) | (static_cast(1) << selK0ShortCTau) | (static_cast(1) << selK0ShortArmenteros) | (static_cast(1) << selConsiderK0Short) | (static_cast(1) << selK0ShortMassWindow) | (static_cast(1) << selLambdaMassRejection); + maskLambdaSpecific = (static_cast(1) << selLambdaRapidity) | (static_cast(1) << selLambdaCTau) | (static_cast(1) << selConsiderLambda) | (static_cast(1) << selLambdaMassWindow) | (static_cast(1) << selK0ShortMassRejection); + maskAntiLambdaSpecific = (static_cast(1) << selLambdaRapidity) | (static_cast(1) << selLambdaCTau) | (static_cast(1) << selConsiderAntiLambda) | (static_cast(1) << selAntiLambdaMassWindow) | (static_cast(1) << selK0ShortMassRejection); // ask for specific TPC/TOF PID selections maskTrackProperties = 0; if (v0Selections.requirePosITSonly) { - maskTrackProperties = maskTrackProperties | (uint64_t(1) << selPosItsOnly) | (uint64_t(1) << selPosGoodITSTrack); + maskTrackProperties = maskTrackProperties | (static_cast(1) << selPosItsOnly) | (static_cast(1) << selPosGoodITSTrack); } else { - maskTrackProperties = maskTrackProperties | (uint64_t(1) << selPosGoodTPCTrack) | (uint64_t(1) << selPosGoodITSTrack); + maskTrackProperties = maskTrackProperties | (static_cast(1) << selPosGoodTPCTrack) | (static_cast(1) << selPosGoodITSTrack); // TPC signal is available: ask for positive track PID - if (v0Selections.TpcPidNsigmaCut < 1e+5) { // safeguard for no cut - maskK0ShortSpecific = maskK0ShortSpecific | (uint64_t(1) << selTPCPIDPositivePion); - maskLambdaSpecific = maskLambdaSpecific | (uint64_t(1) << selTPCPIDPositiveProton); - maskAntiLambdaSpecific = maskAntiLambdaSpecific | (uint64_t(1) << selTPCPIDPositivePion); + if (v0Selections.tpcPidNsigmaCut < 1e+5) { // safeguard for no cut + maskK0ShortSpecific = maskK0ShortSpecific | (static_cast(1) << selTPCPIDPositivePion); + maskLambdaSpecific = maskLambdaSpecific | (static_cast(1) << selTPCPIDPositiveProton); + maskAntiLambdaSpecific = maskAntiLambdaSpecific | (static_cast(1) << selTPCPIDPositivePion); } // TOF PID - if (v0Selections.TofPidNsigmaCutK0Pi < 1e+5) // safeguard for no cut - maskK0ShortSpecific = maskK0ShortSpecific | (uint64_t(1) << selTOFNSigmaPositivePionK0Short) | (uint64_t(1) << selTOFDeltaTPositivePionK0Short); - if (v0Selections.TofPidNsigmaCutLaPr < 1e+5) // safeguard for no cut - maskLambdaSpecific = maskLambdaSpecific | (uint64_t(1) << selTOFNSigmaPositiveProtonLambda) | (uint64_t(1) << selTOFDeltaTPositiveProtonLambda); - if (v0Selections.TofPidNsigmaCutLaPi < 1e+5) // safeguard for no cut - maskAntiLambdaSpecific = maskAntiLambdaSpecific | (uint64_t(1) << selTOFNSigmaPositivePionLambda) | (uint64_t(1) << selTOFDeltaTPositivePionLambda); + if (v0Selections.tofPidNsigmaCutK0Pi < 1e+5) // safeguard for no cut + maskK0ShortSpecific = maskK0ShortSpecific | (static_cast(1) << selTOFNSigmaPositivePionK0Short) | (static_cast(1) << selTOFDeltaTPositivePionK0Short); + if (v0Selections.tofPidNsigmaCutLaPr < 1e+5) // safeguard for no cut + maskLambdaSpecific = maskLambdaSpecific | (static_cast(1) << selTOFNSigmaPositiveProtonLambda) | (static_cast(1) << selTOFDeltaTPositiveProtonLambda); + if (v0Selections.tofPidNsigmaCutLaPi < 1e+5) // safeguard for no cut + maskAntiLambdaSpecific = maskAntiLambdaSpecific | (static_cast(1) << selTOFNSigmaPositivePionLambda) | (static_cast(1) << selTOFDeltaTPositivePionLambda); } if (v0Selections.requireNegITSonly) { - maskTrackProperties = maskTrackProperties | (uint64_t(1) << selNegItsOnly) | (uint64_t(1) << selNegGoodITSTrack); + maskTrackProperties = maskTrackProperties | (static_cast(1) << selNegItsOnly) | (static_cast(1) << selNegGoodITSTrack); } else { - maskTrackProperties = maskTrackProperties | (uint64_t(1) << selNegGoodTPCTrack) | (uint64_t(1) << selNegGoodITSTrack); + maskTrackProperties = maskTrackProperties | (static_cast(1) << selNegGoodTPCTrack) | (static_cast(1) << selNegGoodITSTrack); // TPC signal is available: ask for negative track PID - if (v0Selections.TpcPidNsigmaCut < 1e+5) { // safeguard for no cut - maskK0ShortSpecific = maskK0ShortSpecific | (uint64_t(1) << selTPCPIDNegativePion); - maskLambdaSpecific = maskLambdaSpecific | (uint64_t(1) << selTPCPIDNegativePion); - maskAntiLambdaSpecific = maskAntiLambdaSpecific | (uint64_t(1) << selTPCPIDNegativeProton); + if (v0Selections.tpcPidNsigmaCut < 1e+5) { // safeguard for no cut + maskK0ShortSpecific = maskK0ShortSpecific | (static_cast(1) << selTPCPIDNegativePion); + maskLambdaSpecific = maskLambdaSpecific | (static_cast(1) << selTPCPIDNegativePion); + maskAntiLambdaSpecific = maskAntiLambdaSpecific | (static_cast(1) << selTPCPIDNegativeProton); } // TOF PID - if (v0Selections.TofPidNsigmaCutK0Pi < 1e+5) // safeguard for no cut - maskK0ShortSpecific = maskK0ShortSpecific | (uint64_t(1) << selTOFNSigmaNegativePionK0Short) | (uint64_t(1) << selTOFDeltaTNegativePionK0Short); - if (v0Selections.TofPidNsigmaCutLaPi < 1e+5) // safeguard for no cut - maskLambdaSpecific = maskLambdaSpecific | (uint64_t(1) << selTOFNSigmaNegativePionLambda) | (uint64_t(1) << selTOFDeltaTNegativePionLambda); - if (v0Selections.TofPidNsigmaCutLaPr < 1e+5) // safeguard for no cut - maskAntiLambdaSpecific = maskAntiLambdaSpecific | (uint64_t(1) << selTOFNSigmaNegativeProtonLambda) | (uint64_t(1) << selTOFDeltaTNegativeProtonLambda); + if (v0Selections.tofPidNsigmaCutK0Pi < 1e+5) // safeguard for no cut + maskK0ShortSpecific = maskK0ShortSpecific | (static_cast(1) << selTOFNSigmaNegativePionK0Short) | (static_cast(1) << selTOFDeltaTNegativePionK0Short); + if (v0Selections.tofPidNsigmaCutLaPi < 1e+5) // safeguard for no cut + maskLambdaSpecific = maskLambdaSpecific | (static_cast(1) << selTOFNSigmaNegativePionLambda) | (static_cast(1) << selTOFDeltaTNegativePionLambda); + if (v0Selections.tofPidNsigmaCutLaPr < 1e+5) // safeguard for no cut + maskAntiLambdaSpecific = maskAntiLambdaSpecific | (static_cast(1) << selTOFNSigmaNegativeProtonLambda) | (static_cast(1) << selTOFDeltaTNegativeProtonLambda); } if (v0Selections.skipTPConly) { - maskK0ShortSpecific = maskK0ShortSpecific | (uint64_t(1) << selPosNotTPCOnly) | (uint64_t(1) << selNegNotTPCOnly); - maskLambdaSpecific = maskLambdaSpecific | (uint64_t(1) << selPosNotTPCOnly) | (uint64_t(1) << selNegNotTPCOnly); - maskAntiLambdaSpecific = maskAntiLambdaSpecific | (uint64_t(1) << selPosNotTPCOnly) | (uint64_t(1) << selNegNotTPCOnly); + maskK0ShortSpecific = maskK0ShortSpecific | (static_cast(1) << selPosNotTPCOnly) | (static_cast(1) << selNegNotTPCOnly); + maskLambdaSpecific = maskLambdaSpecific | (static_cast(1) << selPosNotTPCOnly) | (static_cast(1) << selNegNotTPCOnly); + maskAntiLambdaSpecific = maskAntiLambdaSpecific | (static_cast(1) << selPosNotTPCOnly) | (static_cast(1) << selNegNotTPCOnly); } // Primary particle selection, central to analysis @@ -455,18 +470,19 @@ struct quarkoniaToHyperons { histos.add("hEventSelection", "hEventSelection", kTH1F, {{20, -0.5f, +19.5f}}); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(3, "posZ cut"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(3, "kIsTriggerTVX"); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(4, "kNoITSROFrameBorder"); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(5, "kNoTimeFrameBorder"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(6, "kIsVertexITSTPC"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(7, "kIsGoodZvtxFT0vsPV"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(8, "kIsVertexTOFmatched"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(9, "kIsVertexTRDmatched"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(10, "kNoSameBunchPileup"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(11, "kNoCollInTimeRangeStd"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(12, "kNoCollInTimeRangeNarrow"); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(13, "Below min occup."); - histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(14, "Above max occup."); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(6, "posZ cut"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(7, "kIsVertexITSTPC"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(8, "kIsGoodZvtxFT0vsPV"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(9, "kIsVertexTOFmatched"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(10, "kIsVertexTRDmatched"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(11, "kNoSameBunchPileup"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(12, "kNoCollInTimeRangeStd"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(13, "kNoCollInTimeRangeNarrow"); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(14, "Below min occup."); + histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(15, "Above max occup."); histos.add("hEventCentrality", "hEventCentrality", kTH1F, {{100, 0.0f, +100.0f}}); histos.add("hCentralityVsNch", "hCentralityVsNch", kTH2F, {axisCentrality, axisNch}); @@ -489,6 +505,44 @@ struct quarkoniaToHyperons { } // histograms versus mass + if (buildK0sK0sPairs) { + histos.add("K0sK0s/h3dMassK0sK0s", "h3dMassK0sK0s", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + if (!isPP) { + // Non-UPC info + histos.add("K0sK0s/h3dMassK0sK0sHadronic", "h3dMassK0sK0sHadronic", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + // UPC info + histos.add("K0sK0s/h3dMassK0sK0sSGA", "h3dMassK0sK0sSGA", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + histos.add("K0sK0s/h3dMassK0sK0sSGC", "h3dMassK0sK0sSGC", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + histos.add("K0sK0s/h3dMassK0sK0sDG", "h3dMassK0sK0sDG", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + } + histos.add("K0sK0s/h2dNbrOfK0ShortVsCentrality", "h2dNbrOfK0ShortVsCentrality", kTH2F, {axisCentrality, {10, -0.5f, 9.5f}}); + // QA plot + // Candidates after K0s selections + histos.add("K0sK0s/K0s/hPosDCAToPV", "hPosDCAToPV", kTH1F, {axisDCAtoPV}); + histos.add("K0sK0s/K0s/hNegDCAToPV", "hNegDCAToPV", kTH1F, {axisDCAtoPV}); + histos.add("K0sK0s/K0s/hDCAV0Daughters", "hDCAV0Daughters", kTH1F, {axisDCAdau}); + histos.add("K0sK0s/K0s/hDCAV0ToPV", "hDCAV0ToPV", kTH1F, {axisDCAV0ToPV}); + histos.add("K0sK0s/K0s/hV0PointingAngle", "hV0PointingAngle", kTH1F, {axisPointingAngle}); + histos.add("K0sK0s/K0s/hV0Radius", "hV0Radius", kTH1F, {axisRadius}); + histos.add("K0sK0s/K0s/hV0DecayLength", "hDecayLength", kTH1F, {axisProperLifeTime}); + histos.add("K0sK0s/K0s/hV0InvMassWindow", "hInvMassWindow", kTH1F, {axisMassWindow}); + histos.add("K0sK0s/K0s/h2dCompetingMassRej", "h2dCompetingMassRej", kTH2F, {axisLambdaMass, axisK0Mass}); + histos.add("K0sK0s/K0s/h2dArmenteros", "h2dArmenteros", kTH2F, {axisAPAlpha, axisAPQt}); + histos.add("K0sK0s/K0s/hPosTPCNsigma", "hPosTPCNsigma", kTH1F, {axisNsigmaTPC}); + histos.add("K0sK0s/K0s/hNegTPCNsigma", "hNegTPCNsigma", kTH1F, {axisNsigmaTPC}); + histos.add("K0sK0s/K0s/h2dPositiveITSvsTPCpts", "h2dPositiveITSvsTPCpts", kTH2F, {axisTPCrows, axisITSclus}); + histos.add("K0sK0s/K0s/h2dNegativeITSvsTPCpts", "h2dNegativeITSvsTPCpts", kTH2F, {axisTPCrows, axisITSclus}); + if (doMCAssociation) { + histos.add("K0sK0s/h3dInvMassTrueEtaC1S", "h3dInvMassTrueEtaC1S", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + histos.add("K0sK0s/h3dInvMassTrueJPsi", "h3dInvMassTrueJPsi", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + histos.add("K0sK0s/h3dInvMassTrueChiC0", "h3dInvMassTrueChiC0", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + histos.add("K0sK0s/h3dInvMassTrueChiC1", "h3dInvMassTrueChiC1", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + histos.add("K0sK0s/h3dInvMassTrueHC", "h3dInvMassTrueHC", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + histos.add("K0sK0s/h3dInvMassTrueChiC2", "h3dInvMassTrueChiC2", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + histos.add("K0sK0s/h3dInvMassTrueEtaC2S", "h3dInvMassTrueEtaC2S", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + histos.add("K0sK0s/h3dInvMassTruePsi2S", "h3dInvMassTruePsi2S", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); + } + } if (buildLaLaBarPairs) { histos.add("LaLaBar/h3dMassLaLabar", "h3dMassLaLabar", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); if (!isPP) { @@ -499,7 +553,6 @@ struct quarkoniaToHyperons { histos.add("LaLaBar/h3dMassLaLabarSGC", "h3dMassLaLabarSGC", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); histos.add("LaLaBar/h3dMassLaLabarDG", "h3dMassLaLabarDG", kTH3F, {axisCentrality, axisPt, axisQuarkoniumMass}); } - histos.add("LaLaBar/h2dNbrOfK0ShortVsCentrality", "h2dNbrOfK0ShortVsCentrality", kTH2F, {axisCentrality, {10, -0.5f, 9.5f}}); histos.add("LaLaBar/h2dNbrOfLambdaVsCentrality", "h2dNbrOfLambdaVsCentrality", kTH2F, {axisCentrality, {10, -0.5f, 9.5f}}); histos.add("LaLaBar/h2dNbrOfAntiLambdaVsCentrality", "h2dNbrOfAntiLambdaVsCentrality", kTH2F, {axisCentrality, {10, -0.5f, 9.5f}}); // QA plot @@ -703,12 +756,12 @@ struct quarkoniaToHyperons { int64_t timeStampML = collision.timestamp(); if (mlConfigurations.timestampCCDB.value != -1) timeStampML = mlConfigurations.timestampCCDB.value; - LoadMachines(timeStampML); + loadMachines(timeStampML); } } // function to load models for ML-based classifiers - void LoadMachines(int64_t timeStampML) + void loadMachines(int64_t timeStampML) { if (mlConfigurations.loadCustomModelsFromCCDB) { ccdbApi.init(ccdbConfigurations.ccdburl); @@ -752,7 +805,7 @@ struct quarkoniaToHyperons { } template - bool IsEventAccepted(TCollision collision, bool fillHists) + bool isEventAccepted(TCollision collision, bool fillHists) // check whether the collision passes our collision selections { if (fillHists) @@ -763,11 +816,11 @@ struct quarkoniaToHyperons { if (fillHists) histos.fill(HIST("hEventSelection"), 1 /* sel8 collisions */); - if (std::abs(collision.posZ()) > 10.f) { + if (requireTriggerTVX && !collision.selection_bit(aod::evsel::kIsTriggerTVX)) { return false; } if (fillHists) - histos.fill(HIST("hEventSelection"), 2 /* vertex-Z selected */); + histos.fill(HIST("hEventSelection"), 2 /* FT0 vertex (acceptable FT0C-FT0A time difference) collisions */); if (rejectITSROFBorder && !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { return false; @@ -781,58 +834,64 @@ struct quarkoniaToHyperons { if (fillHists) histos.fill(HIST("hEventSelection"), 4 /* Not at TF border */); + if (std::abs(collision.posZ()) > 10.f) { + return false; + } + if (fillHists) + histos.fill(HIST("hEventSelection"), 5 /* vertex-Z selected */); + if (requireIsVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { return false; } if (fillHists) - histos.fill(HIST("hEventSelection"), 5 /* Contains at least one ITS-TPC track */); + histos.fill(HIST("hEventSelection"), 6 /* Contains at least one ITS-TPC track */); if (requireIsGoodZvtxFT0VsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { return false; } if (fillHists) - histos.fill(HIST("hEventSelection"), 6 /* PV position consistency check */); + histos.fill(HIST("hEventSelection"), 7 /* PV position consistency check */); if (requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) { return false; } if (fillHists) - histos.fill(HIST("hEventSelection"), 7 /* PV with at least one contributor matched with TOF */); + histos.fill(HIST("hEventSelection"), 8 /* PV with at least one contributor matched with TOF */); if (requireIsVertexTRDmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTRDmatched)) { return false; } if (fillHists) - histos.fill(HIST("hEventSelection"), 8 /* PV with at least one contributor matched with TRD */); + histos.fill(HIST("hEventSelection"), 9 /* PV with at least one contributor matched with TRD */); if (rejectSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { return false; } if (fillHists) - histos.fill(HIST("hEventSelection"), 9 /* Not at same bunch pile-up */); + histos.fill(HIST("hEventSelection"), 10 /* Not at same bunch pile-up */); if (requireNoCollInTimeRangeStd && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { return false; } if (fillHists) - histos.fill(HIST("hEventSelection"), 10 /* No other collision within +/- 10 microseconds */); + histos.fill(HIST("hEventSelection"), 11 /* No other collision within +/- 10 microseconds */); if (requireNoCollInTimeRangeNarrow && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { return false; } if (fillHists) - histos.fill(HIST("hEventSelection"), 11 /* No other collision within +/- 4 microseconds */); + histos.fill(HIST("hEventSelection"), 12 /* No other collision within +/- 4 microseconds */); if (minOccupancy > 0 && collision.trackOccupancyInTimeRange() < minOccupancy) { return false; } if (fillHists) - histos.fill(HIST("hEventSelection"), 12 /* Below min occupancy */); + histos.fill(HIST("hEventSelection"), 13 /* Below min occupancy */); if (maxOccupancy > 0 && collision.trackOccupancyInTimeRange() > maxOccupancy) { return false; } if (fillHists) - histos.fill(HIST("hEventSelection"), 13 /* Above max occupancy */); + histos.fill(HIST("hEventSelection"), 14 /* Above max occupancy */); return true; } @@ -863,7 +922,7 @@ struct quarkoniaToHyperons { // 0 --> Single Gap - A side // 1 --> Single Gap - C side // 2 --> Double Gap - both A & C sides - selGapSide = sgSelector.trueGap(collision, upcCuts.FV0cut, upcCuts.FT0Acut, upcCuts.FT0Ccut, upcCuts.ZDCcut); + selGapSide = sgSelector.trueGap(collision, upcCuts.fv0Cut, upcCuts.ft0aCut, upcCuts.ft0cCut, upcCuts.zdcCut); histos.fill(HIST("hGapSide"), gapSide); histos.fill(HIST("hSelGapSide"), selGapSide); histos.fill(HIST("hEventCentralityVsSelGapSide"), centrality, selGapSide <= 2 ? selGapSide : -1); @@ -891,145 +950,145 @@ struct quarkoniaToHyperons { // v0 radius min/max selections if (v0.v0radius() > v0Selections.v0radius) - bitset(bitMap, selRadius); + BITSET(bitMap, selRadius); if (v0.v0radius() < v0Selections.v0radiusMax) - bitset(bitMap, selRadiusMax); + BITSET(bitMap, selRadiusMax); // DCA proton and pion to PV for Lambda and AntiLambda decay hypotheses - if (TMath::Abs(v0.dcapostopv()) > v0Selections.dcaprotontopv && - TMath::Abs(v0.dcanegtopv()) > v0Selections.dcapiontopv) { - bitset(bitMap, selDCAPosToPV); - bitset(bitMap, selDCANegToPV); - } else if (TMath::Abs(v0.dcapostopv()) > v0Selections.dcapiontopv && - TMath::Abs(v0.dcanegtopv()) > v0Selections.dcaprotontopv) { - bitset(bitMap, selDCAPosToPV); - bitset(bitMap, selDCANegToPV); + if (std::fabs(v0.dcapostopv()) > v0Selections.dcaprotontopv && + std::fabs(v0.dcanegtopv()) > v0Selections.dcapiontopv) { + BITSET(bitMap, selDCAPosToPV); + BITSET(bitMap, selDCANegToPV); + } else if (std::fabs(v0.dcapostopv()) > v0Selections.dcapiontopv && + std::fabs(v0.dcanegtopv()) > v0Selections.dcaprotontopv) { + BITSET(bitMap, selDCAPosToPV); + BITSET(bitMap, selDCANegToPV); } // V0 cosine of pointing angle if (v0.v0cosPA() > v0Selections.v0cospa) - bitset(bitMap, selCosPA); + BITSET(bitMap, selCosPA); // DCA between v0 daughters if (v0.dcaV0daughters() < v0Selections.dcav0dau) - bitset(bitMap, selDCAV0Dau); + BITSET(bitMap, selDCAV0Dau); // DCA V0 to prim vtx if (v0.dcav0topv() > v0Selections.dcav0topv) - bitset(bitMap, selDCAV0ToPV); + BITSET(bitMap, selDCAV0ToPV); // // rapidity // - if (TMath::Abs(rapidityLambda) < v0Selections.rapidityCut) - bitset(bitMap, selLambdaRapidity); - if (TMath::Abs(rapidityK0Short) < v0Selections.rapidityCut) - bitset(bitMap, selK0ShortRapidity); + if (std::fabs(rapidityLambda) < v0Selections.rapidityCut) + BITSET(bitMap, selLambdaRapidity); + if (std::fabs(rapidityK0Short) < v0Selections.rapidityCut) + BITSET(bitMap, selK0ShortRapidity); // // invariant mass window // - if (TMath::Abs(v0.mK0Short() - pdgDB->Mass(310)) < v0Selections.v0MassWindow) - bitset(bitMap, selK0ShortMassWindow); - if (TMath::Abs(v0.mLambda() - pdgDB->Mass(3122)) < v0Selections.v0MassWindow) - bitset(bitMap, selLambdaMassWindow); - if (TMath::Abs(v0.mAntiLambda() - pdgDB->Mass(3122)) < v0Selections.v0MassWindow) - bitset(bitMap, selAntiLambdaMassWindow); + if (std::fabs(v0.mK0Short() - o2::constants::physics::MassK0Short) < v0Selections.v0MassWindow) + BITSET(bitMap, selK0ShortMassWindow); + if (std::fabs(v0.mLambda() - o2::constants::physics::MassLambda0) < v0Selections.v0MassWindow) + BITSET(bitMap, selLambdaMassWindow); + if (std::fabs(v0.mAntiLambda() - o2::constants::physics::MassLambda0Bar) < v0Selections.v0MassWindow) + BITSET(bitMap, selAntiLambdaMassWindow); // // competing mass rejection // - if (TMath::Abs(v0.mK0Short() - pdgDB->Mass(310)) > v0Selections.compMassRejection) - bitset(bitMap, selK0ShortMassRejection); - if (TMath::Abs(v0.mLambda() - pdgDB->Mass(3122)) > v0Selections.compMassRejection) - bitset(bitMap, selLambdaMassRejection); + if (std::fabs(v0.mK0Short() - o2::constants::physics::MassK0Short) > v0Selections.compMassRejection) + BITSET(bitMap, selK0ShortMassRejection); + if (std::fabs(v0.mLambda() - o2::constants::physics::MassLambda0) > v0Selections.compMassRejection) + BITSET(bitMap, selLambdaMassRejection); - auto posTrackExtra = v0.template posTrackExtra_as(); - auto negTrackExtra = v0.template negTrackExtra_as(); + auto posTrackExtra = v0.template posTrackExtra_as(); + auto negTrackExtra = v0.template negTrackExtra_as(); // // ITS quality flags // if (posTrackExtra.itsNCls() >= v0Selections.minITSclusters) - bitset(bitMap, selPosGoodITSTrack); + BITSET(bitMap, selPosGoodITSTrack); if (negTrackExtra.itsNCls() >= v0Selections.minITSclusters) - bitset(bitMap, selNegGoodITSTrack); + BITSET(bitMap, selNegGoodITSTrack); // // TPC quality flags // if (posTrackExtra.tpcCrossedRows() >= v0Selections.minTPCrows) - bitset(bitMap, selPosGoodTPCTrack); + BITSET(bitMap, selPosGoodTPCTrack); if (negTrackExtra.tpcCrossedRows() >= v0Selections.minTPCrows) - bitset(bitMap, selNegGoodTPCTrack); + BITSET(bitMap, selNegGoodTPCTrack); // // TPC PID // - if (fabs(posTrackExtra.tpcNSigmaPi()) < v0Selections.TpcPidNsigmaCut) - bitset(bitMap, selTPCPIDPositivePion); - if (fabs(posTrackExtra.tpcNSigmaPr()) < v0Selections.TpcPidNsigmaCut) - bitset(bitMap, selTPCPIDPositiveProton); - if (fabs(negTrackExtra.tpcNSigmaPi()) < v0Selections.TpcPidNsigmaCut) - bitset(bitMap, selTPCPIDNegativePion); - if (fabs(negTrackExtra.tpcNSigmaPr()) < v0Selections.TpcPidNsigmaCut) - bitset(bitMap, selTPCPIDNegativeProton); + if (std::fabs(posTrackExtra.tpcNSigmaPi()) < v0Selections.tpcPidNsigmaCut) + BITSET(bitMap, selTPCPIDPositivePion); + if (std::fabs(posTrackExtra.tpcNSigmaPr()) < v0Selections.tpcPidNsigmaCut) + BITSET(bitMap, selTPCPIDPositiveProton); + if (std::fabs(negTrackExtra.tpcNSigmaPi()) < v0Selections.tpcPidNsigmaCut) + BITSET(bitMap, selTPCPIDNegativePion); + if (std::fabs(negTrackExtra.tpcNSigmaPr()) < v0Selections.tpcPidNsigmaCut) + BITSET(bitMap, selTPCPIDNegativeProton); // // TOF PID in DeltaT // Positive track - if (fabs(v0.posTOFDeltaTLaPr()) < v0Selections.maxDeltaTimeProton) - bitset(bitMap, selTOFDeltaTPositiveProtonLambda); - if (fabs(v0.posTOFDeltaTLaPi()) < v0Selections.maxDeltaTimePion) - bitset(bitMap, selTOFDeltaTPositivePionLambda); - if (fabs(v0.posTOFDeltaTK0Pi()) < v0Selections.maxDeltaTimePion) - bitset(bitMap, selTOFDeltaTPositivePionK0Short); + if (std::fabs(v0.posTOFDeltaTLaPr()) < v0Selections.maxDeltaTimeProton) + BITSET(bitMap, selTOFDeltaTPositiveProtonLambda); + if (std::fabs(v0.posTOFDeltaTLaPi()) < v0Selections.maxDeltaTimePion) + BITSET(bitMap, selTOFDeltaTPositivePionLambda); + if (std::fabs(v0.posTOFDeltaTK0Pi()) < v0Selections.maxDeltaTimePion) + BITSET(bitMap, selTOFDeltaTPositivePionK0Short); // Negative track - if (fabs(v0.negTOFDeltaTLaPr()) < v0Selections.maxDeltaTimeProton) - bitset(bitMap, selTOFDeltaTNegativeProtonLambda); - if (fabs(v0.negTOFDeltaTLaPi()) < v0Selections.maxDeltaTimePion) - bitset(bitMap, selTOFDeltaTNegativePionLambda); - if (fabs(v0.negTOFDeltaTK0Pi()) < v0Selections.maxDeltaTimePion) - bitset(bitMap, selTOFDeltaTNegativePionK0Short); + if (std::fabs(v0.negTOFDeltaTLaPr()) < v0Selections.maxDeltaTimeProton) + BITSET(bitMap, selTOFDeltaTNegativeProtonLambda); + if (std::fabs(v0.negTOFDeltaTLaPi()) < v0Selections.maxDeltaTimePion) + BITSET(bitMap, selTOFDeltaTNegativePionLambda); + if (std::fabs(v0.negTOFDeltaTK0Pi()) < v0Selections.maxDeltaTimePion) + BITSET(bitMap, selTOFDeltaTNegativePionK0Short); // // TOF PID in NSigma // Positive track - if (fabs(v0.tofNSigmaLaPr()) < v0Selections.TofPidNsigmaCutLaPr) - bitset(bitMap, selTOFNSigmaPositiveProtonLambda); - if (fabs(v0.tofNSigmaALaPi()) < v0Selections.TofPidNsigmaCutLaPi) - bitset(bitMap, selTOFNSigmaPositivePionLambda); - if (fabs(v0.tofNSigmaK0PiPlus()) < v0Selections.TofPidNsigmaCutK0Pi) - bitset(bitMap, selTOFNSigmaPositivePionK0Short); + if (std::fabs(v0.tofNSigmaLaPr()) < v0Selections.tofPidNsigmaCutLaPr) + BITSET(bitMap, selTOFNSigmaPositiveProtonLambda); + if (std::fabs(v0.tofNSigmaALaPi()) < v0Selections.tofPidNsigmaCutLaPi) + BITSET(bitMap, selTOFNSigmaPositivePionLambda); + if (std::fabs(v0.tofNSigmaK0PiPlus()) < v0Selections.tofPidNsigmaCutK0Pi) + BITSET(bitMap, selTOFNSigmaPositivePionK0Short); // Negative track - if (fabs(v0.tofNSigmaALaPr()) < v0Selections.TofPidNsigmaCutLaPr) - bitset(bitMap, selTOFNSigmaNegativeProtonLambda); - if (fabs(v0.tofNSigmaLaPi()) < v0Selections.TofPidNsigmaCutLaPi) - bitset(bitMap, selTOFNSigmaNegativePionLambda); - if (fabs(v0.tofNSigmaK0PiMinus()) < v0Selections.TofPidNsigmaCutK0Pi) - bitset(bitMap, selTOFNSigmaNegativePionK0Short); + if (std::fabs(v0.tofNSigmaALaPr()) < v0Selections.tofPidNsigmaCutLaPr) + BITSET(bitMap, selTOFNSigmaNegativeProtonLambda); + if (std::fabs(v0.tofNSigmaLaPi()) < v0Selections.tofPidNsigmaCutLaPi) + BITSET(bitMap, selTOFNSigmaNegativePionLambda); + if (std::fabs(v0.tofNSigmaK0PiMinus()) < v0Selections.tofPidNsigmaCutK0Pi) + BITSET(bitMap, selTOFNSigmaNegativePionK0Short); // // ITS only tag if (posTrackExtra.tpcCrossedRows() < 1) - bitset(bitMap, selPosItsOnly); + BITSET(bitMap, selPosItsOnly); if (negTrackExtra.tpcCrossedRows() < 1) - bitset(bitMap, selNegItsOnly); + BITSET(bitMap, selNegItsOnly); // // TPC only tag if (posTrackExtra.detectorMap() != o2::aod::track::TPC) - bitset(bitMap, selPosNotTPCOnly); + BITSET(bitMap, selPosNotTPCOnly); if (negTrackExtra.detectorMap() != o2::aod::track::TPC) - bitset(bitMap, selNegNotTPCOnly); + BITSET(bitMap, selNegNotTPCOnly); // // proper lifetime if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0 < lifetimecut->get("lifetimecutLambda")) - bitset(bitMap, selLambdaCTau); + BITSET(bitMap, selLambdaCTau); if (v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short < lifetimecut->get("lifetimecutK0S")) - bitset(bitMap, selK0ShortCTau); + BITSET(bitMap, selK0ShortCTau); // // armenteros - if (v0.qtarm() * v0Selections.armPodCut > TMath::Abs(v0.alpha()) || v0Selections.armPodCut < 1e-4) - bitset(bitMap, selK0ShortArmenteros); + if (v0.qtarm() * v0Selections.armPodCut > std::fabs(v0.alpha()) || v0Selections.armPodCut < 1e-4) + BITSET(bitMap, selK0ShortArmenteros); return bitMap; } @@ -1049,14 +1108,14 @@ struct quarkoniaToHyperons { return false; // DCA proton and pion to PV for Lambda and AntiLambda decay hypotheses if (casc.sign() < 0) { // Xi- or Omega- --> positive/negative daughter = proton/pion - if (TMath::Abs(casc.dcapostopv()) < cascSelections.dcaprotontopv) + if (std::fabs(casc.dcapostopv()) < cascSelections.dcaprotontopv) return false; - if (TMath::Abs(casc.dcanegtopv()) < cascSelections.dcapiontopv) + if (std::fabs(casc.dcanegtopv()) < cascSelections.dcapiontopv) return false; } else { // Xi+ or Omega+ --> positive/negative daughter = pion/proton - if (TMath::Abs(casc.dcapostopv()) < cascSelections.dcapiontopv) + if (std::fabs(casc.dcapostopv()) < cascSelections.dcapiontopv) return false; - if (TMath::Abs(casc.dcanegtopv()) < cascSelections.dcaprotontopv) + if (std::fabs(casc.dcanegtopv()) < cascSelections.dcaprotontopv) return false; } // V0 cosine of pointing angle @@ -1075,13 +1134,13 @@ struct quarkoniaToHyperons { if (casc.cascradius() > cascSelections.cascradiusMax) return false; // DCA bachelor selection - if (TMath::Abs(casc.dcabachtopv()) < cascSelections.dcabachtopv) + if (std::fabs(casc.dcabachtopv()) < cascSelections.dcabachtopv) return false; // Bachelor-baryon cosPA selection if (casc.bachBaryonCosPA() < cascSelections.bachbaryoncospa) return false; // DCA bachelor-baryon selection - if (TMath::Abs(casc.bachBaryonDCAxyToPV()) < cascSelections.dcaxybachbaryontopv) + if (std::fabs(casc.bachBaryonDCAxyToPV()) < cascSelections.dcaxybachbaryontopv) return false; // casc cosine of pointing angle if (casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) < cascSelections.casccospa) @@ -1093,30 +1152,30 @@ struct quarkoniaToHyperons { // // rapidity // - if (TMath::Abs(rapidity) > cascSelections.rapidityCut) + if (std::fabs(rapidity) > cascSelections.rapidityCut) return false; // // invariant mass window // - if (TMath::Abs(casc.mLambda() - pdgDB->Mass(3122)) > cascSelections.v0MassWindow) + if (std::fabs(casc.mLambda() - o2::constants::physics::MassLambda0) > cascSelections.v0MassWindow) return false; - if (isXi && TMath::Abs(casc.mXi() - pdgDB->Mass(3312)) > cascSelections.cascMassWindow) + if (isXi && std::fabs(casc.mXi() - o2::constants::physics::MassXiMinus) > cascSelections.cascMassWindow) return false; - if (!isXi && TMath::Abs(casc.mOmega() - pdgDB->Mass(3334)) > cascSelections.cascMassWindow) + if (!isXi && std::fabs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) > cascSelections.cascMassWindow) return false; // // competing mass rejection // - if (isXi && TMath::Abs(casc.mOmega() - pdgDB->Mass(3334)) < cascSelections.compMassRejection) + if (isXi && std::fabs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) < cascSelections.compMassRejection) return false; - if (!isXi && TMath::Abs(casc.mXi() - pdgDB->Mass(3312)) < cascSelections.compMassRejection) + if (!isXi && std::fabs(casc.mXi() - o2::constants::physics::MassXiMinus) < cascSelections.compMassRejection) return false; - auto bachTrackExtra = casc.template bachTrackExtra_as(); - auto posTrackExtra = casc.template posTrackExtra_as(); - auto negTrackExtra = casc.template negTrackExtra_as(); + auto bachTrackExtra = casc.template bachTrackExtra_as(); + auto posTrackExtra = casc.template posTrackExtra_as(); + auto negTrackExtra = casc.template negTrackExtra_as(); // // ITS quality flags @@ -1141,19 +1200,19 @@ struct quarkoniaToHyperons { // // TPC PID // - if (isXi && fabs(bachTrackExtra.tpcNSigmaPi()) > cascSelections.TpcPidNsigmaCut) + if (isXi && std::fabs(bachTrackExtra.tpcNSigmaPi()) > cascSelections.tpcPidNsigmaCut) return false; - if (!isXi && fabs(bachTrackExtra.tpcNSigmaKa()) > cascSelections.TpcPidNsigmaCut) + if (!isXi && std::fabs(bachTrackExtra.tpcNSigmaKa()) > cascSelections.tpcPidNsigmaCut) return false; if (casc.sign() < 0) { // Xi- or Omega- --> positive/negative daughter = proton/pion - if (fabs(posTrackExtra.tpcNSigmaPr()) > cascSelections.TpcPidNsigmaCut) + if (std::fabs(posTrackExtra.tpcNSigmaPr()) > cascSelections.tpcPidNsigmaCut) return false; - if (fabs(negTrackExtra.tpcNSigmaPi()) > cascSelections.TpcPidNsigmaCut) + if (std::fabs(negTrackExtra.tpcNSigmaPi()) > cascSelections.tpcPidNsigmaCut) return false; } else { // Xi+ or Omega+ --> positive/negative daughter = pion/proton - if (fabs(posTrackExtra.tpcNSigmaPi()) > cascSelections.TpcPidNsigmaCut) + if (std::fabs(posTrackExtra.tpcNSigmaPi()) > cascSelections.tpcPidNsigmaCut) return false; - if (fabs(negTrackExtra.tpcNSigmaPr()) > cascSelections.TpcPidNsigmaCut) + if (std::fabs(negTrackExtra.tpcNSigmaPr()) > cascSelections.tpcPidNsigmaCut) return false; } @@ -1161,36 +1220,36 @@ struct quarkoniaToHyperons { // TOF PID in DeltaT // Bachelor track if (bachTrackExtra.hasTOF()) { - if (isXi && fabs(casc.bachTOFDeltaTXiPi()) > cascSelections.maxDeltaTimePion) + if (isXi && std::fabs(casc.bachTOFDeltaTXiPi()) > cascSelections.maxDeltaTimePion) return false; - if (!isXi && fabs(casc.bachTOFDeltaTOmKa()) > cascSelections.maxDeltaTimeKaon) + if (!isXi && std::fabs(casc.bachTOFDeltaTOmKa()) > cascSelections.maxDeltaTimeKaon) return false; } // Positive track if (posTrackExtra.hasTOF()) { if (casc.sign() < 0) { // Xi- or Omega- --> positive daughter = proton - if (isXi && fabs(casc.posTOFDeltaTXiPr()) > cascSelections.maxDeltaTimeProton) + if (isXi && std::fabs(casc.posTOFDeltaTXiPr()) > cascSelections.maxDeltaTimeProton) return false; - if (!isXi && fabs(casc.posTOFDeltaTOmPr()) > cascSelections.maxDeltaTimeProton) + if (!isXi && std::fabs(casc.posTOFDeltaTOmPr()) > cascSelections.maxDeltaTimeProton) return false; } else { // Xi+ or Omega+ --> positive daughter = pion - if (isXi && fabs(casc.posTOFDeltaTXiPi()) > cascSelections.maxDeltaTimePion) + if (isXi && std::fabs(casc.posTOFDeltaTXiPi()) > cascSelections.maxDeltaTimePion) return false; - if (!isXi && fabs(casc.posTOFDeltaTOmPi()) > cascSelections.maxDeltaTimePion) + if (!isXi && std::fabs(casc.posTOFDeltaTOmPi()) > cascSelections.maxDeltaTimePion) return false; } } // Negative track if (negTrackExtra.hasTOF()) { if (casc.sign() < 0) { // Xi- or Omega- --> negative daughter = pion - if (isXi && fabs(casc.negTOFDeltaTXiPi()) > cascSelections.maxDeltaTimePion) + if (isXi && std::fabs(casc.negTOFDeltaTXiPi()) > cascSelections.maxDeltaTimePion) return false; - if (!isXi && fabs(casc.negTOFDeltaTOmPi()) > cascSelections.maxDeltaTimePion) + if (!isXi && std::fabs(casc.negTOFDeltaTOmPi()) > cascSelections.maxDeltaTimePion) return false; } else { // Xi+ or Omega+ --> negative daughter = proton - if (isXi && fabs(casc.negTOFDeltaTXiPr()) > cascSelections.maxDeltaTimeProton) + if (isXi && std::fabs(casc.negTOFDeltaTXiPr()) > cascSelections.maxDeltaTimeProton) return false; - if (!isXi && fabs(casc.negTOFDeltaTOmPr()) > cascSelections.maxDeltaTimeProton) + if (!isXi && std::fabs(casc.negTOFDeltaTOmPr()) > cascSelections.maxDeltaTimeProton) return false; } } @@ -1199,36 +1258,36 @@ struct quarkoniaToHyperons { // TOF PID in NSigma // Bachelor track if (bachTrackExtra.hasTOF()) { - if (isXi && fabs(casc.tofNSigmaXiPi()) > cascSelections.TofPidNsigmaCutXiPi) + if (isXi && std::fabs(casc.tofNSigmaXiPi()) > cascSelections.tofPidNsigmaCutXiPi) return false; - if (!isXi && fabs(casc.tofNSigmaOmKa()) > cascSelections.TofPidNsigmaCutOmKa) + if (!isXi && std::fabs(casc.tofNSigmaOmKa()) > cascSelections.tofPidNsigmaCutOmKa) return false; } // Positive track if (posTrackExtra.hasTOF()) { if (casc.sign() < 0) { // Xi- or Omega- --> positive daughter = proton - if (isXi && fabs(casc.tofNSigmaXiLaPr()) > cascSelections.TofPidNsigmaCutLaPr) + if (isXi && std::fabs(casc.tofNSigmaXiLaPr()) > cascSelections.tofPidNsigmaCutLaPr) return false; - if (!isXi && fabs(casc.tofNSigmaOmLaPr()) > cascSelections.TofPidNsigmaCutLaPr) + if (!isXi && std::fabs(casc.tofNSigmaOmLaPr()) > cascSelections.tofPidNsigmaCutLaPr) return false; } else { // Xi+ or Omega+ --> positive daughter = pion - if (isXi && fabs(casc.tofNSigmaXiLaPi()) > cascSelections.TofPidNsigmaCutLaPi) + if (isXi && std::fabs(casc.tofNSigmaXiLaPi()) > cascSelections.tofPidNsigmaCutLaPi) return false; - if (!isXi && fabs(casc.tofNSigmaOmLaPi()) > cascSelections.TofPidNsigmaCutLaPi) + if (!isXi && std::fabs(casc.tofNSigmaOmLaPi()) > cascSelections.tofPidNsigmaCutLaPi) return false; } } // Negative track if (negTrackExtra.hasTOF()) { if (casc.sign() < 0) { // Xi- or Omega- --> negative daughter = pion - if (isXi && fabs(casc.tofNSigmaXiLaPr()) > cascSelections.TofPidNsigmaCutLaPi) + if (isXi && std::fabs(casc.tofNSigmaXiLaPr()) > cascSelections.tofPidNsigmaCutLaPi) return false; - if (!isXi && fabs(casc.tofNSigmaOmLaPr()) > cascSelections.TofPidNsigmaCutLaPi) + if (!isXi && std::fabs(casc.tofNSigmaOmLaPr()) > cascSelections.tofPidNsigmaCutLaPi) return false; } else { // Xi+ or Omega+ --> negative daughter = proton - if (isXi && fabs(casc.tofNSigmaXiLaPi()) > cascSelections.TofPidNsigmaCutLaPr) + if (isXi && std::fabs(casc.tofNSigmaXiLaPi()) > cascSelections.tofPidNsigmaCutLaPr) return false; - if (!isXi && fabs(casc.tofNSigmaOmLaPi()) > cascSelections.TofPidNsigmaCutLaPr) + if (!isXi && std::fabs(casc.tofNSigmaOmLaPi()) > cascSelections.tofPidNsigmaCutLaPr) return false; } } @@ -1278,19 +1337,19 @@ struct quarkoniaToHyperons { // check for specific particle species if (v0.pdgCode() == 310 && v0.pdgCodePositive() == 211 && v0.pdgCodeNegative() == -211) { - bitset(bitMap, selConsiderK0Short); + BITSET(bitMap, selConsiderK0Short); if (v0.isPhysicalPrimary()) - bitset(bitMap, selPhysPrimK0Short); + BITSET(bitMap, selPhysPrimK0Short); } if (v0.pdgCode() == 3122 && v0.pdgCodePositive() == 2212 && v0.pdgCodeNegative() == -211) { - bitset(bitMap, selConsiderLambda); + BITSET(bitMap, selConsiderLambda); if (v0.isPhysicalPrimary()) - bitset(bitMap, selPhysPrimLambda); + BITSET(bitMap, selPhysPrimLambda); } if (v0.pdgCode() == -3122 && v0.pdgCodePositive() == 211 && v0.pdgCodeNegative() == -2212) { - bitset(bitMap, selConsiderAntiLambda); + BITSET(bitMap, selConsiderAntiLambda); if (v0.isPhysicalPrimary()) - bitset(bitMap, selPhysPrimAntiLambda); + BITSET(bitMap, selPhysPrimAntiLambda); } return bitMap; } @@ -1369,24 +1428,67 @@ struct quarkoniaToHyperons { { // fill QA information about hyperon - antihyperon pair if (type == 0) { if constexpr (requires { hyperon.mK0Short(); antiHyperon.mK0Short(); }) { // check if v0 information is available - auto posTrackExtraHyperon = hyperon.template posTrackExtra_as(); - auto negTrackExtraHyperon = hyperon.template negTrackExtra_as(); + auto posTrackExtraHyperon = hyperon.template posTrackExtra_as(); + auto negTrackExtraHyperon = hyperon.template negTrackExtra_as(); + + auto posTrackExtraAntiHyperon = antiHyperon.template posTrackExtra_as(); + auto negTrackExtraAntiHyperon = antiHyperon.template negTrackExtra_as(); + + float hyperonDecayLength = std::sqrt(std::pow(hyperon.x() - collision.posX(), 2) + std::pow(hyperon.y() - collision.posY(), 2) + std::pow(hyperon.z() - collision.posZ(), 2)) * o2::constants::physics::MassKaonNeutral / (hyperon.p() + 1E-10); + float antiHyperonDecayLength = std::sqrt(std::pow(antiHyperon.x() - collision.posX(), 2) + std::pow(antiHyperon.y() - collision.posY(), 2) + std::pow(antiHyperon.z() - collision.posZ(), 2)) * o2::constants::physics::MassKaonNeutral / (antiHyperon.p() + 1E-10); + + // Candidates after K0s selections + histos.fill(HIST("K0sK0s/K0s/hPosDCAToPV"), hyperon.dcapostopv()); + histos.fill(HIST("K0sK0s/K0s/hNegDCAToPV"), hyperon.dcanegtopv()); + histos.fill(HIST("K0sK0s/K0s/hDCAV0Daughters"), hyperon.dcaV0daughters()); + histos.fill(HIST("K0sK0s/K0s/hDCAV0ToPV"), hyperon.dcav0topv()); + histos.fill(HIST("K0sK0s/K0s/hV0PointingAngle"), hyperon.v0cosPA()); + histos.fill(HIST("K0sK0s/K0s/hV0Radius"), hyperon.v0radius()); + histos.fill(HIST("K0sK0s/K0s/hV0DecayLength"), hyperonDecayLength); + histos.fill(HIST("K0sK0s/K0s/hV0InvMassWindow"), hyperon.mK0Short() - o2::constants::physics::MassK0Short); + histos.fill(HIST("K0sK0s/K0s/h2dCompetingMassRej"), hyperon.mLambda(), hyperon.mK0Short()); + histos.fill(HIST("K0sK0s/K0s/h2dArmenteros"), hyperon.alpha(), hyperon.qtarm()); // cross-check + histos.fill(HIST("K0sK0s/K0s/hPosTPCNsigma"), posTrackExtraHyperon.tpcNSigmaPi()); + histos.fill(HIST("K0sK0s/K0s/hNegTPCNsigma"), negTrackExtraHyperon.tpcNSigmaPi()); + histos.fill(HIST("K0sK0s/K0s/h2dPositiveITSvsTPCpts"), posTrackExtraHyperon.tpcCrossedRows(), posTrackExtraHyperon.itsNCls()); + histos.fill(HIST("K0sK0s/K0s/h2dNegativeITSvsTPCpts"), negTrackExtraHyperon.tpcCrossedRows(), negTrackExtraHyperon.itsNCls()); + // Candidates after K0s selections + histos.fill(HIST("K0sK0s/K0s/hPosDCAToPV"), antiHyperon.dcapostopv()); + histos.fill(HIST("K0sK0s/K0s/hNegDCAToPV"), antiHyperon.dcanegtopv()); + histos.fill(HIST("K0sK0s/K0s/hDCAV0Daughters"), antiHyperon.dcaV0daughters()); + histos.fill(HIST("K0sK0s/K0s/hDCAV0ToPV"), antiHyperon.dcav0topv()); + histos.fill(HIST("K0sK0s/K0s/hV0PointingAngle"), antiHyperon.v0cosPA()); + histos.fill(HIST("K0sK0s/K0s/hV0Radius"), antiHyperon.v0radius()); + histos.fill(HIST("K0sK0s/K0s/hV0DecayLength"), antiHyperonDecayLength); + histos.fill(HIST("K0sK0s/K0s/hV0InvMassWindow"), antiHyperon.mK0Short() - o2::constants::physics::MassK0Short); + histos.fill(HIST("K0sK0s/K0s/h2dCompetingMassRej"), antiHyperon.mLambda(), antiHyperon.mK0Short()); + histos.fill(HIST("K0sK0s/K0s/h2dArmenteros"), antiHyperon.alpha(), antiHyperon.qtarm()); // cross-check + histos.fill(HIST("K0sK0s/K0s/hPosTPCNsigma"), posTrackExtraAntiHyperon.tpcNSigmaPi()); + histos.fill(HIST("K0sK0s/K0s/hNegTPCNsigma"), negTrackExtraAntiHyperon.tpcNSigmaPi()); + histos.fill(HIST("K0sK0s/K0s/h2dPositiveITSvsTPCpts"), posTrackExtraAntiHyperon.tpcCrossedRows(), posTrackExtraAntiHyperon.itsNCls()); + histos.fill(HIST("K0sK0s/K0s/h2dNegativeITSvsTPCpts"), negTrackExtraAntiHyperon.tpcCrossedRows(), negTrackExtraAntiHyperon.itsNCls()); + } + } + if (type == 1) { + if constexpr (requires { hyperon.mK0Short(); antiHyperon.mK0Short(); }) { // check if v0 information is available + auto posTrackExtraHyperon = hyperon.template posTrackExtra_as(); + auto negTrackExtraHyperon = hyperon.template negTrackExtra_as(); - auto posTrackExtraAntiHyperon = antiHyperon.template posTrackExtra_as(); - auto negTrackExtraAntiHyperon = antiHyperon.template negTrackExtra_as(); + auto posTrackExtraAntiHyperon = antiHyperon.template posTrackExtra_as(); + auto negTrackExtraAntiHyperon = antiHyperon.template negTrackExtra_as(); float hyperonDecayLength = std::sqrt(std::pow(hyperon.x() - collision.posX(), 2) + std::pow(hyperon.y() - collision.posY(), 2) + std::pow(hyperon.z() - collision.posZ(), 2)) * o2::constants::physics::MassLambda0 / (hyperon.p() + 1E-10); float antiHyperonDecayLength = std::sqrt(std::pow(antiHyperon.x() - collision.posX(), 2) + std::pow(antiHyperon.y() - collision.posY(), 2) + std::pow(antiHyperon.z() - collision.posZ(), 2)) * o2::constants::physics::MassLambda0 / (antiHyperon.p() + 1E-10); // Candidates after Lambda selections histos.fill(HIST("LaLaBar/Lambda/hPosDCAToPV"), hyperon.dcapostopv()); - histos.fill(HIST("LaLaBar/Lambda/hNegDCAToPV"), hyperon.dcapostopv()); + histos.fill(HIST("LaLaBar/Lambda/hNegDCAToPV"), hyperon.dcanegtopv()); histos.fill(HIST("LaLaBar/Lambda/hDCAV0Daughters"), hyperon.dcaV0daughters()); histos.fill(HIST("LaLaBar/Lambda/hDCAV0ToPV"), hyperon.dcav0topv()); histos.fill(HIST("LaLaBar/Lambda/hV0PointingAngle"), hyperon.v0cosPA()); histos.fill(HIST("LaLaBar/Lambda/hV0Radius"), hyperon.v0radius()); histos.fill(HIST("LaLaBar/Lambda/hV0DecayLength"), hyperonDecayLength); - histos.fill(HIST("LaLaBar/Lambda/hV0InvMassWindow"), hyperon.mLambda() - pdgDB->Mass(3122)); + histos.fill(HIST("LaLaBar/Lambda/hV0InvMassWindow"), hyperon.mLambda() - o2::constants::physics::MassLambda0); histos.fill(HIST("LaLaBar/Lambda/h2dCompetingMassRej"), hyperon.mLambda(), hyperon.mK0Short()); histos.fill(HIST("LaLaBar/Lambda/hPosTPCNsigma"), posTrackExtraHyperon.tpcNSigmaPr()); histos.fill(HIST("LaLaBar/Lambda/hNegTPCNsigma"), negTrackExtraHyperon.tpcNSigmaPi()); @@ -1400,7 +1502,7 @@ struct quarkoniaToHyperons { histos.fill(HIST("LaLaBar/AntiLambda/hV0PointingAngle"), antiHyperon.v0cosPA()); histos.fill(HIST("LaLaBar/AntiLambda/hV0Radius"), antiHyperon.v0radius()); histos.fill(HIST("LaLaBar/AntiLambda/hV0DecayLength"), antiHyperonDecayLength); - histos.fill(HIST("LaLaBar/AntiLambda/hV0InvMassWindow"), antiHyperon.mLambda() - pdgDB->Mass(3122)); + histos.fill(HIST("LaLaBar/AntiLambda/hV0InvMassWindow"), antiHyperon.mLambda() - o2::constants::physics::MassLambda0); histos.fill(HIST("LaLaBar/AntiLambda/h2dCompetingMassRej"), antiHyperon.mLambda(), antiHyperon.mK0Short()); histos.fill(HIST("LaLaBar/AntiLambda/hPosTPCNsigma"), posTrackExtraAntiHyperon.tpcNSigmaPi()); histos.fill(HIST("LaLaBar/AntiLambda/hNegTPCNsigma"), negTrackExtraAntiHyperon.tpcNSigmaPr()); @@ -1408,15 +1510,15 @@ struct quarkoniaToHyperons { histos.fill(HIST("LaLaBar/AntiLambda/h2dNegativeITSvsTPCpts"), negTrackExtraAntiHyperon.tpcCrossedRows(), negTrackExtraAntiHyperon.itsNCls()); } } - if (type == 1) { + if (type == 2) { if constexpr (requires { hyperon.dcabachtopv(); antiHyperon.dcabachtopv(); }) { // check if Cascade information is available - auto bachTrackExtraHyperon = hyperon.template bachTrackExtra_as(); - auto posTrackExtraHyperon = hyperon.template posTrackExtra_as(); - auto negTrackExtraHyperon = hyperon.template negTrackExtra_as(); + auto bachTrackExtraHyperon = hyperon.template bachTrackExtra_as(); + auto posTrackExtraHyperon = hyperon.template posTrackExtra_as(); + auto negTrackExtraHyperon = hyperon.template negTrackExtra_as(); - auto bachTrackExtraAntiHyperon = antiHyperon.template bachTrackExtra_as(); - auto posTrackExtraAntiHyperon = antiHyperon.template posTrackExtra_as(); - auto negTrackExtraAntiHyperon = antiHyperon.template negTrackExtra_as(); + auto bachTrackExtraAntiHyperon = antiHyperon.template bachTrackExtra_as(); + auto posTrackExtraAntiHyperon = antiHyperon.template posTrackExtra_as(); + auto negTrackExtraAntiHyperon = antiHyperon.template negTrackExtra_as(); float hyperonDecayLength = std::sqrt(std::pow(hyperon.x() - collision.posX(), 2) + std::pow(hyperon.y() - collision.posY(), 2) + std::pow(hyperon.z() - collision.posZ(), 2)) * o2::constants::physics::MassXiMinus / (hyperon.p() + 1E-10); float antiHyperonDecayLength = std::sqrt(std::pow(antiHyperon.x() - collision.posX(), 2) + std::pow(antiHyperon.y() - collision.posY(), 2) + std::pow(antiHyperon.z() - collision.posZ(), 2)) * o2::constants::physics::MassXiMinus / (antiHyperon.p() + 1E-10); @@ -1424,7 +1526,7 @@ struct quarkoniaToHyperons { // Candidates after Xi selections histos.fill(HIST("XiXiBar/Xi/hBachDCAToPV"), hyperon.dcabachtopv()); histos.fill(HIST("XiXiBar/Xi/hPosDCAToPV"), hyperon.dcapostopv()); - histos.fill(HIST("XiXiBar/Xi/hNegDCAToPV"), hyperon.dcapostopv()); + histos.fill(HIST("XiXiBar/Xi/hNegDCAToPV"), hyperon.dcanegtopv()); histos.fill(HIST("XiXiBar/Xi/hDCACascDaughters"), hyperon.dcacascdaughters()); histos.fill(HIST("XiXiBar/Xi/hDCAV0Daughters"), hyperon.dcaV0daughters()); histos.fill(HIST("XiXiBar/Xi/hDCAV0ToPV"), hyperon.dcav0topv(collision.posX(), collision.posY(), collision.posZ())); @@ -1433,8 +1535,8 @@ struct quarkoniaToHyperons { histos.fill(HIST("XiXiBar/Xi/hCascPointingAngle"), hyperon.casccosPA(collision.posX(), collision.posY(), collision.posZ())); histos.fill(HIST("XiXiBar/Xi/hCascRadius"), hyperon.cascradius()); histos.fill(HIST("XiXiBar/Xi/hCascDecayLength"), hyperonDecayLength); - histos.fill(HIST("XiXiBar/Xi/hV0InvMassWindow"), hyperon.mLambda() - pdgDB->Mass(3122)); - histos.fill(HIST("XiXiBar/Xi/hCascInvMassWindow"), hyperon.mXi() - pdgDB->Mass(3312)); + histos.fill(HIST("XiXiBar/Xi/hV0InvMassWindow"), hyperon.mLambda() - o2::constants::physics::MassLambda0); + histos.fill(HIST("XiXiBar/Xi/hCascInvMassWindow"), hyperon.mXi() - o2::constants::physics::MassXiMinus); histos.fill(HIST("XiXiBar/Xi/h2dCompetingMassRej"), hyperon.mXi(), hyperon.mOmega()); histos.fill(HIST("XiXiBar/Xi/hBachTPCNsigma"), bachTrackExtraHyperon.tpcNSigmaPi()); histos.fill(HIST("XiXiBar/Xi/hPosTPCNsigma"), posTrackExtraHyperon.tpcNSigmaPr()); @@ -1445,7 +1547,7 @@ struct quarkoniaToHyperons { // Candidates after AntiXi selections histos.fill(HIST("XiXiBar/AntiXi/hBachDCAToPV"), antiHyperon.dcabachtopv()); histos.fill(HIST("XiXiBar/AntiXi/hPosDCAToPV"), antiHyperon.dcapostopv()); - histos.fill(HIST("XiXiBar/AntiXi/hNegDCAToPV"), antiHyperon.dcapostopv()); + histos.fill(HIST("XiXiBar/AntiXi/hNegDCAToPV"), antiHyperon.dcanegtopv()); histos.fill(HIST("XiXiBar/AntiXi/hDCACascDaughters"), antiHyperon.dcacascdaughters()); histos.fill(HIST("XiXiBar/AntiXi/hDCAV0Daughters"), antiHyperon.dcaV0daughters()); histos.fill(HIST("XiXiBar/AntiXi/hDCAV0ToPV"), antiHyperon.dcav0topv(collision.posX(), collision.posY(), collision.posZ())); @@ -1454,8 +1556,8 @@ struct quarkoniaToHyperons { histos.fill(HIST("XiXiBar/AntiXi/hCascPointingAngle"), antiHyperon.casccosPA(collision.posX(), collision.posY(), collision.posZ())); histos.fill(HIST("XiXiBar/AntiXi/hCascRadius"), antiHyperon.cascradius()); histos.fill(HIST("XiXiBar/AntiXi/hCascDecayLength"), antiHyperonDecayLength); - histos.fill(HIST("XiXiBar/AntiXi/hV0InvMassWindow"), antiHyperon.mLambda() - pdgDB->Mass(3122)); - histos.fill(HIST("XiXiBar/AntiXi/hCascInvMassWindow"), antiHyperon.mXi() - pdgDB->Mass(3312)); + histos.fill(HIST("XiXiBar/AntiXi/hV0InvMassWindow"), antiHyperon.mLambda() - o2::constants::physics::MassLambda0); + histos.fill(HIST("XiXiBar/AntiXi/hCascInvMassWindow"), antiHyperon.mXi() - o2::constants::physics::MassXiMinus); histos.fill(HIST("XiXiBar/AntiXi/h2dCompetingMassRej"), antiHyperon.mXi(), antiHyperon.mOmega()); histos.fill(HIST("XiXiBar/AntiXi/hBachTPCNsigma"), bachTrackExtraAntiHyperon.tpcNSigmaPi()); histos.fill(HIST("XiXiBar/AntiXi/hPosTPCNsigma"), posTrackExtraAntiHyperon.tpcNSigmaPi()); @@ -1465,15 +1567,15 @@ struct quarkoniaToHyperons { histos.fill(HIST("XiXiBar/AntiXi/h2dNegativeITSvsTPCpts"), negTrackExtraAntiHyperon.tpcCrossedRows(), negTrackExtraAntiHyperon.itsNCls()); } } - if (type == 2) { + if (type == 3) { if constexpr (requires { hyperon.dcabachtopv(); antiHyperon.dcabachtopv(); }) { // check if Cascade information is available - auto bachTrackExtraHyperon = hyperon.template bachTrackExtra_as(); - auto posTrackExtraHyperon = hyperon.template posTrackExtra_as(); - auto negTrackExtraHyperon = hyperon.template negTrackExtra_as(); + auto bachTrackExtraHyperon = hyperon.template bachTrackExtra_as(); + auto posTrackExtraHyperon = hyperon.template posTrackExtra_as(); + auto negTrackExtraHyperon = hyperon.template negTrackExtra_as(); - auto bachTrackExtraAntiHyperon = antiHyperon.template bachTrackExtra_as(); - auto posTrackExtraAntiHyperon = antiHyperon.template posTrackExtra_as(); - auto negTrackExtraAntiHyperon = antiHyperon.template negTrackExtra_as(); + auto bachTrackExtraAntiHyperon = antiHyperon.template bachTrackExtra_as(); + auto posTrackExtraAntiHyperon = antiHyperon.template posTrackExtra_as(); + auto negTrackExtraAntiHyperon = antiHyperon.template negTrackExtra_as(); float hyperonDecayLength = std::sqrt(std::pow(hyperon.x() - collision.posX(), 2) + std::pow(hyperon.y() - collision.posY(), 2) + std::pow(hyperon.z() - collision.posZ(), 2)) * o2::constants::physics::MassOmegaMinus / (hyperon.p() + 1E-10); float antiHyperonDecayLength = std::sqrt(std::pow(antiHyperon.x() - collision.posX(), 2) + std::pow(antiHyperon.y() - collision.posY(), 2) + std::pow(antiHyperon.z() - collision.posZ(), 2)) * o2::constants::physics::MassOmegaMinus / (antiHyperon.p() + 1E-10); @@ -1481,7 +1583,7 @@ struct quarkoniaToHyperons { // Candidates after Omega selections histos.fill(HIST("OmOmBar/Omega/hBachDCAToPV"), hyperon.dcabachtopv()); histos.fill(HIST("OmOmBar/Omega/hPosDCAToPV"), hyperon.dcapostopv()); - histos.fill(HIST("OmOmBar/Omega/hNegDCAToPV"), hyperon.dcapostopv()); + histos.fill(HIST("OmOmBar/Omega/hNegDCAToPV"), hyperon.dcanegtopv()); histos.fill(HIST("OmOmBar/Omega/hDCACascDaughters"), hyperon.dcacascdaughters()); histos.fill(HIST("OmOmBar/Omega/hDCAV0Daughters"), hyperon.dcaV0daughters()); histos.fill(HIST("OmOmBar/Omega/hDCAV0ToPV"), hyperon.dcav0topv(collision.posX(), collision.posY(), collision.posZ())); @@ -1490,8 +1592,8 @@ struct quarkoniaToHyperons { histos.fill(HIST("OmOmBar/Omega/hCascPointingAngle"), hyperon.casccosPA(collision.posX(), collision.posY(), collision.posZ())); histos.fill(HIST("OmOmBar/Omega/hCascRadius"), hyperon.cascradius()); histos.fill(HIST("OmOmBar/Omega/hCascDecayLength"), hyperonDecayLength); - histos.fill(HIST("OmOmBar/Omega/hV0InvMassWindow"), hyperon.mLambda() - pdgDB->Mass(3122)); - histos.fill(HIST("OmOmBar/Omega/hCascInvMassWindow"), hyperon.mOmega() - pdgDB->Mass(3334)); + histos.fill(HIST("OmOmBar/Omega/hV0InvMassWindow"), hyperon.mLambda() - o2::constants::physics::MassLambda0); + histos.fill(HIST("OmOmBar/Omega/hCascInvMassWindow"), hyperon.mOmega() - o2::constants::physics::MassOmegaMinus); histos.fill(HIST("OmOmBar/Omega/h2dCompetingMassRej"), hyperon.mXi(), hyperon.mOmega()); histos.fill(HIST("OmOmBar/Omega/hBachTPCNsigma"), bachTrackExtraHyperon.tpcNSigmaKa()); histos.fill(HIST("OmOmBar/Omega/hPosTPCNsigma"), posTrackExtraHyperon.tpcNSigmaPr()); @@ -1502,7 +1604,7 @@ struct quarkoniaToHyperons { // Candidates after AntiOmega selections histos.fill(HIST("OmOmBar/AntiOmega/hBachDCAToPV"), antiHyperon.dcabachtopv()); histos.fill(HIST("OmOmBar/AntiOmega/hPosDCAToPV"), antiHyperon.dcapostopv()); - histos.fill(HIST("OmOmBar/AntiOmega/hNegDCAToPV"), antiHyperon.dcapostopv()); + histos.fill(HIST("OmOmBar/AntiOmega/hNegDCAToPV"), antiHyperon.dcanegtopv()); histos.fill(HIST("OmOmBar/AntiOmega/hDCACascDaughters"), antiHyperon.dcacascdaughters()); histos.fill(HIST("OmOmBar/AntiOmega/hDCAV0Daughters"), antiHyperon.dcaV0daughters()); histos.fill(HIST("OmOmBar/AntiOmega/hDCAV0ToPV"), antiHyperon.dcav0topv(collision.posX(), collision.posY(), collision.posZ())); @@ -1511,8 +1613,8 @@ struct quarkoniaToHyperons { histos.fill(HIST("OmOmBar/AntiOmega/hCascPointingAngle"), antiHyperon.casccosPA(collision.posX(), collision.posY(), collision.posZ())); histos.fill(HIST("OmOmBar/AntiOmega/hCascRadius"), antiHyperon.cascradius()); histos.fill(HIST("OmOmBar/AntiOmega/hCascDecayLength"), antiHyperonDecayLength); - histos.fill(HIST("OmOmBar/AntiOmega/hV0InvMassWindow"), antiHyperon.mLambda() - pdgDB->Mass(3122)); - histos.fill(HIST("OmOmBar/AntiOmega/hCascInvMassWindow"), antiHyperon.mOmega() - pdgDB->Mass(3334)); + histos.fill(HIST("OmOmBar/AntiOmega/hV0InvMassWindow"), antiHyperon.mLambda() - o2::constants::physics::MassLambda0); + histos.fill(HIST("OmOmBar/AntiOmega/hCascInvMassWindow"), antiHyperon.mOmega() - o2::constants::physics::MassOmegaMinus); histos.fill(HIST("OmOmBar/AntiOmega/h2dCompetingMassRej"), antiHyperon.mXi(), antiHyperon.mOmega()); histos.fill(HIST("OmOmBar/AntiOmega/hBachTPCNsigma"), bachTrackExtraAntiHyperon.tpcNSigmaKa()); histos.fill(HIST("OmOmBar/AntiOmega/hPosTPCNsigma"), posTrackExtraAntiHyperon.tpcNSigmaPi()); @@ -1533,16 +1635,18 @@ struct quarkoniaToHyperons { float invmass = -1; if (type == 0) - invmass = RecoDecay::m(std::array{std::array{hyperon.px(), hyperon.py(), hyperon.pz()}, std::array{antiHyperon.px(), antiHyperon.py(), antiHyperon.pz()}}, std::array{o2::constants::physics::MassLambda0, o2::constants::physics::MassLambda0Bar}); + invmass = RecoDecay::m(std::array{std::array{hyperon.px(), hyperon.py(), hyperon.pz()}, std::array{antiHyperon.px(), antiHyperon.py(), antiHyperon.pz()}}, std::array{o2::constants::physics::MassKaonNeutral, o2::constants::physics::MassKaonNeutral}); if (type == 1) - invmass = RecoDecay::m(std::array{std::array{hyperon.px(), hyperon.py(), hyperon.pz()}, std::array{antiHyperon.px(), antiHyperon.py(), antiHyperon.pz()}}, std::array{o2::constants::physics::MassXiMinus, o2::constants::physics::MassXiPlusBar}); + invmass = RecoDecay::m(std::array{std::array{hyperon.px(), hyperon.py(), hyperon.pz()}, std::array{antiHyperon.px(), antiHyperon.py(), antiHyperon.pz()}}, std::array{o2::constants::physics::MassLambda0, o2::constants::physics::MassLambda0Bar}); if (type == 2) + invmass = RecoDecay::m(std::array{std::array{hyperon.px(), hyperon.py(), hyperon.pz()}, std::array{antiHyperon.px(), antiHyperon.py(), antiHyperon.pz()}}, std::array{o2::constants::physics::MassXiMinus, o2::constants::physics::MassXiPlusBar}); + if (type == 3) invmass = RecoDecay::m(std::array{std::array{hyperon.px(), hyperon.py(), hyperon.pz()}, std::array{antiHyperon.px(), antiHyperon.py(), antiHyperon.pz()}}, std::array{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassOmegaPlusBar}); float rapidity = RecoDecay::y(std::array{hyperon.px() + antiHyperon.px(), hyperon.py() + antiHyperon.py(), hyperon.pz() + antiHyperon.pz()}, invmass); // rapidity cut on the quarkonium mother - if (!doMCAssociation && TMath::Abs(rapidity) > rapidityCut) + if (!doMCAssociation && std::fabs(rapidity) > rapidityCut) return; // fillV0sInfo(lambda, antiLambda, centrality); @@ -1562,7 +1666,63 @@ struct quarkoniaToHyperons { float ptmc = RecoDecay::pt(hyperonMC.pxMC() + antiHyperonMC.pxMC(), hyperonMC.pyMC() + antiHyperonMC.pyMC()); float rapiditymc = RecoDecay::y(std::array{hyperonMC.pxMC() + antiHyperonMC.pxMC(), hyperonMC.pyMC() + antiHyperonMC.pyMC(), hyperonMC.pzMC() + antiHyperonMC.pzMC()}, pdgDB->Mass(hyperonMC.pdgCodeMother())); - if (TMath::Abs(rapiditymc) > rapidityCut) + if (std::fabs(rapiditymc) > rapidityCut) + return; + + if (hyperonMC.pdgCodeMother() == 441 && hyperonMC.pdgCodeMother() == antiHyperonMC.pdgCodeMother()) { // EtaC(1S) + histos.fill(HIST("K0sK0s/h3dInvMassTrueEtaC1S"), centrality, ptmc, invmass); + } + if (hyperonMC.pdgCodeMother() == 443 && hyperonMC.pdgCodeMother() == antiHyperonMC.pdgCodeMother()) { // J/psi + histos.fill(HIST("K0sK0s/h3dInvMassTrueJPsi"), centrality, ptmc, invmass); + } + if (hyperonMC.pdgCodeMother() == 10441 && hyperonMC.pdgCodeMother() == antiHyperonMC.pdgCodeMother()) { // ChiC0 + histos.fill(HIST("K0sK0s/h3dInvMassTrueChiC0"), centrality, ptmc, invmass); + } + if (hyperonMC.pdgCodeMother() == 20443 && hyperonMC.pdgCodeMother() == antiHyperonMC.pdgCodeMother()) { // ChiC1 + histos.fill(HIST("K0sK0s/h3dInvMassTrueChiC1"), centrality, ptmc, invmass); + } + if (hyperonMC.pdgCodeMother() == 10443 && hyperonMC.pdgCodeMother() == antiHyperonMC.pdgCodeMother()) { // hC + histos.fill(HIST("K0sK0s/h3dInvMassTrueHC"), centrality, ptmc, invmass); + } + if (hyperonMC.pdgCodeMother() == 445 && hyperonMC.pdgCodeMother() == antiHyperonMC.pdgCodeMother()) { // ChiC2 + histos.fill(HIST("K0sK0s/h3dInvMassTrueChiC2"), centrality, ptmc, invmass); + } + if (hyperonMC.pdgCodeMother() == 100441 && hyperonMC.pdgCodeMother() == antiHyperonMC.pdgCodeMother()) { // EtaC(2S) + histos.fill(HIST("K0sK0s/h3dInvMassTrueEtaC2S"), centrality, ptmc, invmass); + } + if (hyperonMC.pdgCodeMother() == 100443 && hyperonMC.pdgCodeMother() == antiHyperonMC.pdgCodeMother()) { // Psi(2S) + histos.fill(HIST("K0sK0s/h3dInvMassTruePsi2S"), centrality, ptmc, invmass); + } + } + } + + histos.fill(HIST("K0sK0s/h3dMassK0sK0s"), centrality, pt, invmass); + if (!isPP) { // in case of PbPb data + if (gapSide == 0) + histos.fill(HIST("K0sK0s/h3dMassK0sK0sSGA"), centrality, pt, invmass); + else if (gapSide == 1) + histos.fill(HIST("K0sK0s/h3dMassK0sK0sSGC"), centrality, pt, invmass); + else if (gapSide == 2) + histos.fill(HIST("K0sK0s/h3dMassK0sK0sDG"), centrality, pt, invmass); + else + histos.fill(HIST("K0sK0s/h3dMassK0sK0sHadronic"), centrality, pt, invmass); + } + fillQAplot(collision, hyperon, antiHyperon, type); + } + if (type == 1) { + if (doMCAssociation) { + if constexpr (requires { hyperon.template v0MCCore_as>(); }) { // check if MC information is available + auto hyperonMC = hyperon.template v0MCCore_as>(); + auto antiHyperonMC = antiHyperon.template v0MCCore_as>(); + + if (hyperonMC.pdgCodeMother() != antiHyperonMC.pdgCodeMother()) { + return; + } + + float ptmc = RecoDecay::pt(hyperonMC.pxMC() + antiHyperonMC.pxMC(), hyperonMC.pyMC() + antiHyperonMC.pyMC()); + float rapiditymc = RecoDecay::y(std::array{hyperonMC.pxMC() + antiHyperonMC.pxMC(), hyperonMC.pyMC() + antiHyperonMC.pyMC(), hyperonMC.pzMC() + antiHyperonMC.pzMC()}, pdgDB->Mass(hyperonMC.pdgCodeMother())); + + if (std::fabs(rapiditymc) > rapidityCut) return; if (hyperonMC.pdgCodeMother() == 441 && hyperonMC.pdgCodeMother() == antiHyperonMC.pdgCodeMother()) { // EtaC(1S) @@ -1603,9 +1763,9 @@ struct quarkoniaToHyperons { else histos.fill(HIST("LaLaBar/h3dMassLaLabarHadronic"), centrality, pt, invmass); } - fillQAplot(collision, hyperon, antiHyperon, 0); + fillQAplot(collision, hyperon, antiHyperon, type); } - if (type == 1) { + if (type == 2) { if (doMCAssociation) { if constexpr (requires { hyperon.template cascMCCore_as>(); }) { // check if MC information is available auto hyperonMC = hyperon.template cascMCCore_as>(); @@ -1618,7 +1778,7 @@ struct quarkoniaToHyperons { float ptmc = RecoDecay::pt(hyperonMC.pxMC() + antiHyperonMC.pxMC(), hyperonMC.pyMC() + antiHyperonMC.pyMC()); float rapiditymc = RecoDecay::y(std::array{hyperonMC.pxMC() + antiHyperonMC.pxMC(), hyperonMC.pyMC() + antiHyperonMC.pyMC(), hyperonMC.pzMC() + antiHyperonMC.pzMC()}, pdgDB->Mass(hyperonMC.pdgCodeMother())); - if (TMath::Abs(rapiditymc) > rapidityCut) + if (std::fabs(rapiditymc) > rapidityCut) return; if (hyperonMC.pdgCodeMother() == 441 && hyperonMC.pdgCodeMother() == antiHyperonMC.pdgCodeMother()) { // EtaC(1S) @@ -1659,9 +1819,9 @@ struct quarkoniaToHyperons { else histos.fill(HIST("XiXiBar/h3dMassXiXibarHadronic"), centrality, pt, invmass); } - fillQAplot(collision, hyperon, antiHyperon, 1); + fillQAplot(collision, hyperon, antiHyperon, type); } - if (type == 2) { + if (type == 3) { if (doMCAssociation) { if constexpr (requires { hyperon.template cascMCCore_as>(); }) { // check if MC information is available auto hyperonMC = hyperon.template cascMCCore_as>(); @@ -1674,7 +1834,7 @@ struct quarkoniaToHyperons { float ptmc = RecoDecay::pt(hyperonMC.pxMC() + antiHyperonMC.pxMC(), hyperonMC.pyMC() + antiHyperonMC.pyMC()); float rapiditymc = RecoDecay::y(std::array{hyperonMC.pxMC() + antiHyperonMC.pxMC(), hyperonMC.pyMC() + antiHyperonMC.pyMC(), hyperonMC.pzMC() + antiHyperonMC.pzMC()}, pdgDB->Mass(hyperonMC.pdgCodeMother())); - if (TMath::Abs(rapiditymc) > rapidityCut) + if (std::fabs(rapiditymc) > rapidityCut) return; if (hyperonMC.pdgCodeMother() == 100441 && hyperonMC.pdgCodeMother() == antiHyperonMC.pdgCodeMother()) { // EtaC(2S) @@ -1697,7 +1857,7 @@ struct quarkoniaToHyperons { else histos.fill(HIST("OmOmBar/h3dMassOmOmbarHadronic"), centrality, pt, invmass); } - fillQAplot(collision, hyperon, antiHyperon, 2); + fillQAplot(collision, hyperon, antiHyperon, type); } } @@ -1705,7 +1865,7 @@ struct quarkoniaToHyperons { template bool checkTrackIndices(THyperon hyperon, THyperon antiHyperon) { - if constexpr (requires { hyperon.template bachTrackExtra_as(); }) { // cascade case: check if bachelor information is available + if constexpr (requires { hyperon.template bachTrackExtra_as(); }) { // cascade case: check if bachelor information is available // check that bachelor track from hyperon is different from daughter tracks of antiHyperon if (hyperon.bachTrackExtraId() == antiHyperon.bachTrackExtraId() || hyperon.bachTrackExtraId() == antiHyperon.posTrackExtraId() || @@ -1738,14 +1898,14 @@ struct quarkoniaToHyperons { void buildHyperonAntiHyperonPairs(TCollision const& collision, THyperons const& fullHyperons, std::vector selHypIndices, std::vector selAntiHypIndices, float centrality, uint8_t gapSide, int type) { // 1st loop over all v0s/cascades - for (auto& hyperon : fullHyperons) { + for (const auto& hyperon : fullHyperons) { // select only v0s matching Lambda selections if (!selHypIndices[hyperon.globalIndex() - fullHyperons.offset()]) { // local index needed due to collisions grouping continue; } // 2nd loop over all v0s/cascade - for (auto& antiHyperon : fullHyperons) { + for (const auto& antiHyperon : fullHyperons) { // select only v0s matching Anti-Lambda selections if (!selAntiHypIndices[antiHyperon.globalIndex() - fullHyperons.offset()]) { // local index needed due to collisions grouping continue; @@ -1771,7 +1931,7 @@ struct quarkoniaToHyperons { // ______________________________________________________ // Real data processing - no MC subscription - void processRealData(soa::Join::iterator const& collision, v0Candidates const& fullV0s, cascadeCandidates const& fullCascades, dauTracks const&) + void processRealData(soa::Join::iterator const& collision, V0Candidates const& fullV0s, CascadeCandidates const& fullCascades, DauTracks const&) { // Fire up CCDB if (cfgSkimmedProcessing || @@ -1781,7 +1941,7 @@ struct quarkoniaToHyperons { initCCDB(collision); } - if (!IsEventAccepted(collision, true)) { + if (!isEventAccepted(collision, true)) { return; } @@ -1796,11 +1956,11 @@ struct quarkoniaToHyperons { // __________________________________________ // perform main analysis // - if (buildLaLaBarPairs) { // Look at V0s + if (buildK0sK0sPairs || buildLaLaBarPairs) { // Look at V0s std::vector selK0ShortIndices(fullV0s.size()); std::vector selLambdaIndices(fullV0s.size()); std::vector selAntiLambdaIndices(fullV0s.size()); - for (auto& v0 : fullV0s) { + for (const auto& v0 : fullV0s) { if (std::abs(v0.negativeeta()) > v0Selections.daughterEtaCut || std::abs(v0.positiveeta()) > v0Selections.daughterEtaCut) continue; // remove acceptance that's badly reproduced by MC / superfluous in future @@ -1810,8 +1970,8 @@ struct quarkoniaToHyperons { uint64_t selMap = computeReconstructionBitmap(v0, collision, v0.yLambda(), v0.yK0Short(), v0.pt()); // consider for histograms for all species - selMap = selMap | (uint64_t(1) << selConsiderK0Short) | (uint64_t(1) << selConsiderLambda) | (uint64_t(1) << selConsiderAntiLambda); - selMap = selMap | (uint64_t(1) << selPhysPrimK0Short) | (uint64_t(1) << selPhysPrimLambda) | (uint64_t(1) << selPhysPrimAntiLambda); + selMap = selMap | (static_cast(1) << selConsiderK0Short) | (static_cast(1) << selConsiderLambda) | (static_cast(1) << selConsiderAntiLambda); + selMap = selMap | (static_cast(1) << selPhysPrimK0Short) | (static_cast(1) << selPhysPrimLambda) | (static_cast(1) << selPhysPrimAntiLambda); analyseV0Candidate(v0, v0.pt(), selMap, selK0ShortIndices, selLambdaIndices, selAntiLambdaIndices, fullV0s.offset()); } // end v0 loop @@ -1821,21 +1981,33 @@ struct quarkoniaToHyperons { int nLambdas = std::count(selLambdaIndices.begin(), selLambdaIndices.end(), true); int nAntiLambdas = std::count(selAntiLambdaIndices.begin(), selAntiLambdaIndices.end(), true); - // fill the histograms with the number of reconstructed K0s/Lambda/antiLambda per collision - histos.fill(HIST("LaLaBar/h2dNbrOfK0ShortVsCentrality"), centrality, nK0Shorts); - histos.fill(HIST("LaLaBar/h2dNbrOfLambdaVsCentrality"), centrality, nLambdas); - histos.fill(HIST("LaLaBar/h2dNbrOfAntiLambdaVsCentrality"), centrality, nAntiLambdas); - - // Check the number of Lambdas and antiLambdas - // needs at least 1 of each - if (!buildSameSignPairs && nLambdas >= 1 && nAntiLambdas >= 1) { // consider Lambda antiLambda pairs - buildHyperonAntiHyperonPairs(collision, fullV0s, selLambdaIndices, selAntiLambdaIndices, centrality, selGapSide, 0); - } - if (buildSameSignPairs && nLambdas > 1) { // consider Lambda Lambda pairs - buildHyperonAntiHyperonPairs(collision, fullV0s, selLambdaIndices, selLambdaIndices, centrality, selGapSide, 0); + if (buildK0sK0sPairs) { + // fill the histograms with the number of reconstructed K0s/Lambda/antiLambda per collision + histos.fill(HIST("K0sK0s/h2dNbrOfK0ShortVsCentrality"), centrality, nK0Shorts); + + // Check the number of K0Short + // needs at least 2 to form K0s-K0s pairs + if (nK0Shorts >= 2) { // consider K0s K0s pairs + buildHyperonAntiHyperonPairs(collision, fullV0s, selK0ShortIndices, selK0ShortIndices, centrality, selGapSide, 0); + } } - if (buildSameSignPairs && nAntiLambdas > 1) { // consider antiLambda antiLambda pairs - buildHyperonAntiHyperonPairs(collision, fullV0s, selAntiLambdaIndices, selAntiLambdaIndices, centrality, selGapSide, 0); + + if (buildLaLaBarPairs) { + // fill the histograms with the number of reconstructed K0s/Lambda/antiLambda per collision + histos.fill(HIST("LaLaBar/h2dNbrOfLambdaVsCentrality"), centrality, nLambdas); + histos.fill(HIST("LaLaBar/h2dNbrOfAntiLambdaVsCentrality"), centrality, nAntiLambdas); + + // Check the number of Lambdas and antiLambdas + // needs at least 1 of each + if (!buildSameSignPairs && nLambdas >= 1 && nAntiLambdas >= 1) { // consider Lambda antiLambda pairs + buildHyperonAntiHyperonPairs(collision, fullV0s, selLambdaIndices, selAntiLambdaIndices, centrality, selGapSide, 1); + } + if (buildSameSignPairs && nLambdas > 1) { // consider Lambda Lambda pairs + buildHyperonAntiHyperonPairs(collision, fullV0s, selLambdaIndices, selLambdaIndices, centrality, selGapSide, 1); + } + if (buildSameSignPairs && nAntiLambdas > 1) { // consider antiLambda antiLambda pairs + buildHyperonAntiHyperonPairs(collision, fullV0s, selAntiLambdaIndices, selAntiLambdaIndices, centrality, selGapSide, 1); + } } } @@ -1844,7 +2016,7 @@ struct quarkoniaToHyperons { std::vector selAntiXiIndices(fullCascades.size()); std::vector selOmIndices(fullCascades.size()); std::vector selAntiOmIndices(fullCascades.size()); - for (auto& cascade : fullCascades) { + for (const auto& cascade : fullCascades) { if (std::abs(cascade.negativeeta()) > cascSelections.daughterEtaCut || std::abs(cascade.positiveeta()) > cascSelections.daughterEtaCut || std::abs(cascade.bacheloreta()) > cascSelections.daughterEtaCut) @@ -1880,13 +2052,13 @@ struct quarkoniaToHyperons { // Check the number of Lambdas and antiLambdas // needs at least 1 of each if (!buildSameSignPairs && nXis >= 1 && nAntiXis >= 1) { - buildHyperonAntiHyperonPairs(collision, fullCascades, selXiIndices, selAntiXiIndices, centrality, selGapSide, 1); + buildHyperonAntiHyperonPairs(collision, fullCascades, selXiIndices, selAntiXiIndices, centrality, selGapSide, 2); } if (buildSameSignPairs && nXis > 1) { - buildHyperonAntiHyperonPairs(collision, fullCascades, selXiIndices, selXiIndices, centrality, selGapSide, 1); + buildHyperonAntiHyperonPairs(collision, fullCascades, selXiIndices, selXiIndices, centrality, selGapSide, 2); } if (buildSameSignPairs && nAntiXis > 1) { - buildHyperonAntiHyperonPairs(collision, fullCascades, selAntiXiIndices, selAntiXiIndices, centrality, selGapSide, 1); + buildHyperonAntiHyperonPairs(collision, fullCascades, selAntiXiIndices, selAntiXiIndices, centrality, selGapSide, 2); } } if (buildOmOmBarPairs) { @@ -1896,13 +2068,13 @@ struct quarkoniaToHyperons { // Check the number of Lambdas and antiLambdas // needs at least 1 of each if (!buildSameSignPairs && nOmegas >= 1 && nAntiOmegas >= 1) { - buildHyperonAntiHyperonPairs(collision, fullCascades, selOmIndices, selAntiOmIndices, centrality, selGapSide, 2); + buildHyperonAntiHyperonPairs(collision, fullCascades, selOmIndices, selAntiOmIndices, centrality, selGapSide, 3); } if (buildSameSignPairs && nOmegas > 1) { - buildHyperonAntiHyperonPairs(collision, fullCascades, selOmIndices, selOmIndices, centrality, selGapSide, 2); + buildHyperonAntiHyperonPairs(collision, fullCascades, selOmIndices, selOmIndices, centrality, selGapSide, 3); } if (buildSameSignPairs && nAntiOmegas > 1) { - buildHyperonAntiHyperonPairs(collision, fullCascades, selAntiOmIndices, selAntiOmIndices, centrality, selGapSide, 2); + buildHyperonAntiHyperonPairs(collision, fullCascades, selAntiOmIndices, selAntiOmIndices, centrality, selGapSide, 3); } } } @@ -1910,7 +2082,7 @@ struct quarkoniaToHyperons { // ______________________________________________________ // Simulated processing (subscribes to MC information too) - void processMonteCarlo(soa::Join::iterator const& collision, v0MCCandidates const& fullV0s, cascadeMCCandidates const& fullCascades, dauTracks const&, aod::MotherMCParts const&, soa::Join const& /*mccollisions*/, soa::Join const&, soa::Join const&) + void processMonteCarlo(soa::Join::iterator const& collision, V0MCCandidates const& fullV0s, CascadeMCCandidates const& fullCascades, DauTracks const&, aod::MotherMCParts const&, soa::Join const& /*mccollisions*/, soa::Join const&, soa::Join const&) { // Fire up CCDB if (cfgSkimmedProcessing || @@ -1920,7 +2092,7 @@ struct quarkoniaToHyperons { initCCDB(collision); } - if (!IsEventAccepted(collision, true)) { + if (!isEventAccepted(collision, true)) { return; } @@ -1934,11 +2106,11 @@ struct quarkoniaToHyperons { // __________________________________________ // perform main analysis - if (buildLaLaBarPairs) { // Look at V0s + if (buildK0sK0sPairs || buildLaLaBarPairs) { // Look at V0s std::vector selK0ShortIndices(fullV0s.size()); std::vector selLambdaIndices(fullV0s.size()); std::vector selAntiLambdaIndices(fullV0s.size()); - for (auto& v0 : fullV0s) { + for (const auto& v0 : fullV0s) { if (std::abs(v0.negativeeta()) > v0Selections.daughterEtaCut || std::abs(v0.positiveeta()) > v0Selections.daughterEtaCut) continue; // remove acceptance that's badly reproduced by MC / superfluous in future @@ -1951,7 +2123,7 @@ struct quarkoniaToHyperons { float ymc = 1e-3; if (v0MC.pdgCode() == 310) ymc = RecoDecay::y(std::array{v0MC.pxPosMC() + v0MC.pxNegMC(), v0MC.pyPosMC() + v0MC.pyNegMC(), v0MC.pzPosMC() + v0MC.pzNegMC()}, o2::constants::physics::MassKaonNeutral); - else if (TMath::Abs(v0MC.pdgCode()) == 3122) + else if (std::fabs(v0MC.pdgCode()) == 3122) ymc = RecoDecay::y(std::array{v0MC.pxPosMC() + v0MC.pxNegMC(), v0MC.pyPosMC() + v0MC.pyNegMC(), v0MC.pzPosMC() + v0MC.pzNegMC()}, o2::constants::physics::MassLambda); uint64_t selMap = computeReconstructionBitmap(v0, collision, ymc, ymc, ptmc); @@ -1959,8 +2131,8 @@ struct quarkoniaToHyperons { // consider only associated candidates if asked to do so, disregard association if (!doMCAssociation) { - selMap = selMap | (uint64_t(1) << selConsiderK0Short) | (uint64_t(1) << selConsiderLambda) | (uint64_t(1) << selConsiderAntiLambda); - selMap = selMap | (uint64_t(1) << selPhysPrimK0Short) | (uint64_t(1) << selPhysPrimLambda) | (uint64_t(1) << selPhysPrimAntiLambda); + selMap = selMap | (static_cast(1) << selConsiderK0Short) | (static_cast(1) << selConsiderLambda) | (static_cast(1) << selConsiderAntiLambda); + selMap = selMap | (static_cast(1) << selPhysPrimK0Short) | (static_cast(1) << selPhysPrimLambda) | (static_cast(1) << selPhysPrimAntiLambda); } analyseV0Candidate(v0, ptmc, selMap, selK0ShortIndices, selLambdaIndices, selAntiLambdaIndices, fullV0s.offset()); @@ -1971,19 +2143,31 @@ struct quarkoniaToHyperons { int nLambdas = std::count(selLambdaIndices.begin(), selLambdaIndices.end(), true); int nAntiLambdas = std::count(selAntiLambdaIndices.begin(), selAntiLambdaIndices.end(), true); - // fill the histograms with the number of reconstructed K0s/Lambda/antiLambda per collision - histos.fill(HIST("LaLaBar/h2dNbrOfK0ShortVsCentrality"), centrality, nK0Shorts); - histos.fill(HIST("LaLaBar/h2dNbrOfLambdaVsCentrality"), centrality, nLambdas); - histos.fill(HIST("LaLaBar/h2dNbrOfAntiLambdaVsCentrality"), centrality, nAntiLambdas); + if (buildK0sK0sPairs) { + // fill the histograms with the number of reconstructed K0s/Lambda/antiLambda per collision + histos.fill(HIST("K0sK0s/h2dNbrOfK0ShortVsCentrality"), centrality, nK0Shorts); - if (!buildSameSignPairs && nLambdas >= 1 && nAntiLambdas >= 1) { // consider Lambda antiLambda pairs - buildHyperonAntiHyperonPairs(collision, fullV0s, selLambdaIndices, selAntiLambdaIndices, centrality, selGapSide, 0); - } - if (buildSameSignPairs && nLambdas > 1) { // consider Lambda Lambda pairs - buildHyperonAntiHyperonPairs(collision, fullV0s, selLambdaIndices, selLambdaIndices, centrality, selGapSide, 0); + // Check the number of K0Short + // needs at least 2 to form K0s-K0s pairs + if (nK0Shorts >= 2) { // consider K0s K0s pairs + buildHyperonAntiHyperonPairs(collision, fullV0s, selK0ShortIndices, selK0ShortIndices, centrality, selGapSide, 0); + } } - if (buildSameSignPairs && nAntiLambdas > 1) { // consider antiLambda antiLambda pairs - buildHyperonAntiHyperonPairs(collision, fullV0s, selAntiLambdaIndices, selAntiLambdaIndices, centrality, selGapSide, 0); + + if (buildLaLaBarPairs) { + // fill the histograms with the number of reconstructed Lambda/antiLambda per collision + histos.fill(HIST("LaLaBar/h2dNbrOfLambdaVsCentrality"), centrality, nLambdas); + histos.fill(HIST("LaLaBar/h2dNbrOfAntiLambdaVsCentrality"), centrality, nAntiLambdas); + + if (!buildSameSignPairs && nLambdas >= 1 && nAntiLambdas >= 1) { // consider Lambda antiLambda pairs + buildHyperonAntiHyperonPairs(collision, fullV0s, selLambdaIndices, selAntiLambdaIndices, centrality, selGapSide, 1); + } + if (buildSameSignPairs && nLambdas > 1) { // consider Lambda Lambda pairs + buildHyperonAntiHyperonPairs(collision, fullV0s, selLambdaIndices, selLambdaIndices, centrality, selGapSide, 1); + } + if (buildSameSignPairs && nAntiLambdas > 1) { // consider antiLambda antiLambda pairs + buildHyperonAntiHyperonPairs(collision, fullV0s, selAntiLambdaIndices, selAntiLambdaIndices, centrality, selGapSide, 1); + } } } @@ -1992,7 +2176,7 @@ struct quarkoniaToHyperons { std::vector selAntiXiIndices(fullCascades.size()); std::vector selOmIndices(fullCascades.size()); std::vector selAntiOmIndices(fullCascades.size()); - for (auto& cascade : fullCascades) { + for (const auto& cascade : fullCascades) { if (std::abs(cascade.negativeeta()) > cascSelections.daughterEtaCut || std::abs(cascade.positiveeta()) > cascSelections.daughterEtaCut || std::abs(cascade.bacheloreta()) > cascSelections.daughterEtaCut) @@ -2004,9 +2188,9 @@ struct quarkoniaToHyperons { auto cascadeMC = cascade.cascMCCore_as>(); float ymc = 1e-3; - if (TMath::Abs(cascadeMC.pdgCode()) == 3312) + if (std::fabs(cascadeMC.pdgCode()) == 3312) ymc = RecoDecay::y(std::array{cascadeMC.pxMC(), cascadeMC.pyMC(), cascadeMC.pzMC()}, o2::constants::physics::MassXiMinus); - else if (TMath::Abs(cascadeMC.pdgCode()) == 3334) + else if (std::fabs(cascadeMC.pdgCode()) == 3334) ymc = RecoDecay::y(std::array{cascadeMC.pxMC(), cascadeMC.pyMC(), cascadeMC.pzMC()}, o2::constants::physics::MassOmegaMinus); if (buildXiXiBarPairs) { @@ -2039,13 +2223,13 @@ struct quarkoniaToHyperons { // Check the number of Lambdas and antiLambdas // needs at least 1 of each if (!buildSameSignPairs && nXis >= 1 && nAntiXis >= 1) { - buildHyperonAntiHyperonPairs(collision, fullCascades, selXiIndices, selAntiXiIndices, centrality, selGapSide, 1); + buildHyperonAntiHyperonPairs(collision, fullCascades, selXiIndices, selAntiXiIndices, centrality, selGapSide, 2); } if (buildSameSignPairs && nXis > 1) { - buildHyperonAntiHyperonPairs(collision, fullCascades, selXiIndices, selXiIndices, centrality, selGapSide, 1); + buildHyperonAntiHyperonPairs(collision, fullCascades, selXiIndices, selXiIndices, centrality, selGapSide, 2); } if (buildSameSignPairs && nAntiXis > 1) { - buildHyperonAntiHyperonPairs(collision, fullCascades, selAntiXiIndices, selAntiXiIndices, centrality, selGapSide, 1); + buildHyperonAntiHyperonPairs(collision, fullCascades, selAntiXiIndices, selAntiXiIndices, centrality, selGapSide, 2); } } if (buildOmOmBarPairs) { @@ -2055,24 +2239,24 @@ struct quarkoniaToHyperons { // Check the number of Lambdas and antiLambdas // needs at least 1 of each if (!buildSameSignPairs && nOmegas >= 1 && nAntiOmegas >= 1) { - buildHyperonAntiHyperonPairs(collision, fullCascades, selOmIndices, selAntiOmIndices, centrality, selGapSide, 2); + buildHyperonAntiHyperonPairs(collision, fullCascades, selOmIndices, selAntiOmIndices, centrality, selGapSide, 3); } if (buildSameSignPairs && nOmegas > 1) { - buildHyperonAntiHyperonPairs(collision, fullCascades, selOmIndices, selOmIndices, centrality, selGapSide, 2); + buildHyperonAntiHyperonPairs(collision, fullCascades, selOmIndices, selOmIndices, centrality, selGapSide, 3); } if (buildSameSignPairs && nAntiOmegas > 1) { - buildHyperonAntiHyperonPairs(collision, fullCascades, selAntiOmIndices, selAntiOmIndices, centrality, selGapSide, 2); + buildHyperonAntiHyperonPairs(collision, fullCascades, selAntiOmIndices, selAntiOmIndices, centrality, selGapSide, 3); } } } } - PROCESS_SWITCH(quarkoniaToHyperons, processRealData, "process as if real data", true); - PROCESS_SWITCH(quarkoniaToHyperons, processMonteCarlo, "process as if MC", false); + PROCESS_SWITCH(QuarkoniaToHyperons, processRealData, "process as if real data", true); + PROCESS_SWITCH(QuarkoniaToHyperons, processMonteCarlo, "process as if MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } From fcd23c679ea5470515b2ae091a560d009e89964f Mon Sep 17 00:00:00 2001 From: Rrantu <156880782+Rrantu@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:43:09 +0800 Subject: [PATCH 402/459] =?UTF-8?q?[PWGHF]=20Implementation=20of=20Xic?= =?UTF-8?q?=E2=81=B0=20reconstruction=20using=20the=20Kalman=20Filter=20me?= =?UTF-8?q?thod=20(#9001)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataModel/CandidateReconstructionTables.h | 58 ++ PWGHF/DataModel/CandidateSelectionTables.h | 19 +- PWGHF/TableProducer/CMakeLists.txt | 10 + .../candidateCreatorXic0Omegac0.cxx | 564 +++++++++++++++++- .../candidateSelectorXic0ToXiPiKf.cxx | 560 +++++++++++++++++ .../TableProducer/treeCreatorXic0ToXiPiKf.cxx | 231 +++++++ 6 files changed, 1405 insertions(+), 37 deletions(-) create mode 100644 PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx create mode 100644 PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 15647b2ca9a..009735144a7 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -1258,43 +1258,58 @@ DECLARE_SOA_COLUMN(ErrorDecayLengthXYCharmBaryon, errorDecayLengthXYCharmBaryon, // KFParticle results DECLARE_SOA_COLUMN(KfDcaXYPiFromOmegac, kfDcaXYPiFromOmegac, float); +DECLARE_SOA_COLUMN(KfDcaXYPiFromXic, kfDcaXYPiFromXic, float); DECLARE_SOA_COLUMN(KfDcaXYCascToPv, kfDcaXYCascToPv, float); DECLARE_SOA_COLUMN(Chi2GeoV0, chi2GeoV0, float); DECLARE_SOA_COLUMN(Chi2GeoCasc, chi2GeoCasc, float); DECLARE_SOA_COLUMN(Chi2GeoOmegac, chi2GeoOmegac, float); +DECLARE_SOA_COLUMN(Chi2GeoXic, chi2GeoXic, float); DECLARE_SOA_COLUMN(Chi2MassV0, chi2MassV0, float); DECLARE_SOA_COLUMN(Chi2MassCasc, chi2MassCasc, float); DECLARE_SOA_COLUMN(V0ldl, v0ldl, float); DECLARE_SOA_COLUMN(Cascldl, cascldl, float); DECLARE_SOA_COLUMN(Omegacldl, omegacldl, float); +DECLARE_SOA_COLUMN(Xicldl, xicldl, float); DECLARE_SOA_COLUMN(Chi2TopoV0ToPv, chi2TopoV0ToPv, float); DECLARE_SOA_COLUMN(Chi2TopoCascToPv, chi2TopoCascToPv, float); DECLARE_SOA_COLUMN(Chi2TopoPiFromOmegacToPv, chi2TopoPiFromOmegacToPv, float); +DECLARE_SOA_COLUMN(Chi2TopoPiFromXicToPv, chi2TopoPiFromXicToPv, float); DECLARE_SOA_COLUMN(Chi2TopoOmegacToPv, chi2TopoOmegacToPv, float); +DECLARE_SOA_COLUMN(Chi2TopoXicToPv, chi2TopoXicToPv, float); DECLARE_SOA_COLUMN(Chi2TopoV0ToCasc, chi2TopoV0ToCasc, float); DECLARE_SOA_COLUMN(Chi2TopoCascToOmegac, chi2TopoCascToOmegac, float); +DECLARE_SOA_COLUMN(Chi2TopoCascToXic, chi2TopoCascToXic, float); DECLARE_SOA_COLUMN(DecayLenXYLambda, decayLenXYLambda, float); DECLARE_SOA_COLUMN(DecayLenXYCasc, decayLenXYCasc, float); DECLARE_SOA_COLUMN(DecayLenXYOmegac, decayLenXYOmegac, float); +DECLARE_SOA_COLUMN(DecayLenXYXic, decayLenXYXic, float); DECLARE_SOA_COLUMN(CosPaV0ToCasc, cosPaV0ToCasc, float); DECLARE_SOA_COLUMN(CosPaCascToOmegac, cosPaCascToOmegac, float); +DECLARE_SOA_COLUMN(CosPaCascToXic, cosPaCascToXic, float); DECLARE_SOA_COLUMN(CosPaXYV0ToCasc, cosPaXYV0ToCasc, float); DECLARE_SOA_COLUMN(CosPaXYCascToOmegac, cosPaXYCascToOmegac, float); +DECLARE_SOA_COLUMN(CosPaXYCascToXic, cosPaXYCascToXic, float); DECLARE_SOA_COLUMN(KfMassV0, kfMassV0, float); DECLARE_SOA_COLUMN(KfMassCasc, kfMassCasc, float); DECLARE_SOA_COLUMN(KfMassOmegac, kfMassOmegac, float); DECLARE_SOA_COLUMN(KfRapOmegac, kfRapOmegac, float); +DECLARE_SOA_COLUMN(KfRapXic, kfRapXic, float); DECLARE_SOA_COLUMN(KfptPiFromOmegac, kfptPiFromOmegac, float); +DECLARE_SOA_COLUMN(KfptPiFromXic, kfptPiFromXic, float); DECLARE_SOA_COLUMN(KfptOmegac, kfptOmegac, float); +DECLARE_SOA_COLUMN(KfptXic, kfptXic, float); DECLARE_SOA_COLUMN(CosThetaStarPiFromOmegac, cosThetaStarPiFromOmegac, float); +DECLARE_SOA_COLUMN(CosThetaStarPiFromXic, cosThetaStarPiFromXic, float); DECLARE_SOA_COLUMN(V0Ndf, v0Ndf, float); DECLARE_SOA_COLUMN(CascNdf, cascNdf, float); DECLARE_SOA_COLUMN(OmegacNdf, omegacNdf, float); +DECLARE_SOA_COLUMN(XicNdf, xicNdf, float); DECLARE_SOA_COLUMN(MassV0Ndf, massV0Ndf, float); DECLARE_SOA_COLUMN(MassCascNdf, massCascNdf, float); DECLARE_SOA_COLUMN(V0Chi2OverNdf, v0Chi2OverNdf, float); DECLARE_SOA_COLUMN(CascChi2OverNdf, cascChi2OverNdf, float); DECLARE_SOA_COLUMN(OmegacChi2OverNdf, omegacChi2OverNdf, float); +DECLARE_SOA_COLUMN(XicChi2OverNdf, xicChi2OverNdf, float); DECLARE_SOA_COLUMN(MassV0Chi2OverNdf, massV0Chi2OverNdf, float); DECLARE_SOA_COLUMN(MassCascChi2OverNdf, massCascChi2OverNdf, float); @@ -1443,6 +1458,49 @@ DECLARE_SOA_TABLE(HfOmegacKf, "AOD", "HFOMEGACKF", //! hf_cand_xic0_omegac0::V0Chi2OverNdf, hf_cand_xic0_omegac0::CascChi2OverNdf, hf_cand_xic0_omegac0::OmegacChi2OverNdf, hf_cand_xic0_omegac0::MassV0Chi2OverNdf, hf_cand_xic0_omegac0::MassCascChi2OverNdf); +DECLARE_SOA_TABLE(HfCandToXiPiKf, "AOD", "HFCANDTOXIPIKF", //! + o2::soa::Index<>, + hf_cand_xic0_omegac0::CollisionId, hf_cand_xic0_omegac0::XPv, hf_cand_xic0_omegac0::YPv, hf_cand_xic0_omegac0::ZPv, + hf_cand_xic0_omegac0::XDecayVtxCharmBaryon, hf_cand_xic0_omegac0::YDecayVtxCharmBaryon, hf_cand_xic0_omegac0::ZDecayVtxCharmBaryon, + hf_cand_xic0_omegac0::XDecayVtxCascade, hf_cand_xic0_omegac0::YDecayVtxCascade, hf_cand_xic0_omegac0::ZDecayVtxCascade, + hf_cand_xic0_omegac0::XDecayVtxV0, hf_cand_xic0_omegac0::YDecayVtxV0, hf_cand_xic0_omegac0::ZDecayVtxV0, + hf_cand_xic0_omegac0::SignDecay, + hf_cand_xic0_omegac0::CovVtxCharmBaryon0, hf_cand_xic0_omegac0::CovVtxCharmBaryon1, hf_cand_xic0_omegac0::CovVtxCharmBaryon2, hf_cand_xic0_omegac0::CovVtxCharmBaryon3, hf_cand_xic0_omegac0::CovVtxCharmBaryon4, hf_cand_xic0_omegac0::CovVtxCharmBaryon5, + hf_cand_xic0_omegac0::PxCharmBaryon, hf_cand_xic0_omegac0::PyCharmBaryon, hf_cand_xic0_omegac0::PzCharmBaryon, + hf_cand_xic0_omegac0::PxCasc, hf_cand_xic0_omegac0::PyCasc, hf_cand_xic0_omegac0::PzCasc, + hf_cand_xic0_omegac0::PxBachFromCharmBaryon, hf_cand_xic0_omegac0::PyBachFromCharmBaryon, hf_cand_xic0_omegac0::PzBachFromCharmBaryon, + hf_cand_xic0_omegac0::PxLambda, hf_cand_xic0_omegac0::PyLambda, hf_cand_xic0_omegac0::PzLambda, + hf_cand_xic0_omegac0::PxBachFromCasc, hf_cand_xic0_omegac0::PyBachFromCasc, hf_cand_xic0_omegac0::PzBachFromCasc, + hf_cand_xic0_omegac0::PxPosV0Dau, hf_cand_xic0_omegac0::PyPosV0Dau, hf_cand_xic0_omegac0::PzPosV0Dau, + hf_cand_xic0_omegac0::PxNegV0Dau, hf_cand_xic0_omegac0::PyNegV0Dau, hf_cand_xic0_omegac0::PzNegV0Dau, + hf_cand_xic0_omegac0::ImpactParCascXY, hf_cand_xic0_omegac0::ImpactParBachFromCharmBaryonXY, hf_cand_xic0_omegac0::ImpactParCascZ, hf_cand_xic0_omegac0::ImpactParBachFromCharmBaryonZ, + hf_cand_xic0_omegac0::ErrImpactParCascXY, hf_cand_xic0_omegac0::ErrImpactParBachFromCharmBaryonXY, + hf_cand_xic0_omegac0::V0Id, v0data::PosTrackId, v0data::NegTrackId, hf_cand_xic0_omegac0::CascadeId, hf_cand_xic0_omegac0::BachelorFromCharmBaryonId, cascdata::BachelorId, + hf_cand_xic0_omegac0::InvMassLambda, hf_cand_xic0_omegac0::InvMassCascade, hf_cand_xic0_omegac0::InvMassCharmBaryon, + hf_cand_xic0_omegac0::CosPAV0, hf_cand_xic0_omegac0::CosPACharmBaryon, hf_cand_xic0_omegac0::CosPACasc, hf_cand_xic0_omegac0::CosPAXYV0, hf_cand_xic0_omegac0::CosPAXYCharmBaryon, hf_cand_xic0_omegac0::CosPAXYCasc, + hf_cand_xic0_omegac0::CTauOmegac, hf_cand_xic0_omegac0::CTauCascade, hf_cand_xic0_omegac0::CTauV0, hf_cand_xic0_omegac0::CTauXic, + hf_cand_xic0_omegac0::EtaV0PosDau, hf_cand_xic0_omegac0::EtaV0NegDau, hf_cand_xic0_omegac0::EtaBachFromCasc, hf_cand_xic0_omegac0::EtaBachFromCharmBaryon, + hf_cand_xic0_omegac0::EtaCharmBaryon, hf_cand_xic0_omegac0::EtaCascade, hf_cand_xic0_omegac0::EtaV0, + hf_cand_xic0_omegac0::DcaXYToPvV0Dau0, hf_cand_xic0_omegac0::DcaXYToPvV0Dau1, hf_cand_xic0_omegac0::DcaXYToPvCascDau, + hf_cand_xic0_omegac0::DcaZToPvV0Dau0, hf_cand_xic0_omegac0::DcaZToPvV0Dau1, hf_cand_xic0_omegac0::DcaZToPvCascDau, + hf_cand_xic0_omegac0::DcaCascDau, hf_cand_xic0_omegac0::DcaV0Dau, hf_cand_xic0_omegac0::DcaCharmBaryonDau, + hf_cand_xic0_omegac0::DecLenCharmBaryon, hf_cand_xic0_omegac0::DecLenCascade, hf_cand_xic0_omegac0::DecLenV0, hf_cand_xic0_omegac0::ErrorDecayLengthCharmBaryon, hf_cand_xic0_omegac0::ErrorDecayLengthXYCharmBaryon, + hf_cand_xic0_omegac0::KfDcaXYPiFromXic, hf_cand_xic0_omegac0::KfDcaXYCascToPv, + hf_cand_xic0_omegac0::Chi2GeoV0, hf_cand_xic0_omegac0::Chi2GeoCasc, hf_cand_xic0_omegac0::Chi2GeoXic, + hf_cand_xic0_omegac0::Chi2MassV0, hf_cand_xic0_omegac0::Chi2MassCasc, + hf_cand_xic0_omegac0::V0ldl, hf_cand_xic0_omegac0::Cascldl, hf_cand_xic0_omegac0::Xicldl, + hf_cand_xic0_omegac0::Chi2TopoV0ToPv, hf_cand_xic0_omegac0::Chi2TopoCascToPv, hf_cand_xic0_omegac0::Chi2TopoPiFromXicToPv, hf_cand_xic0_omegac0::Chi2TopoXicToPv, + hf_cand_xic0_omegac0::Chi2TopoV0ToCasc, hf_cand_xic0_omegac0::Chi2TopoCascToXic, + hf_cand_xic0_omegac0::DecayLenXYLambda, hf_cand_xic0_omegac0::DecayLenXYCasc, hf_cand_xic0_omegac0::DecayLenXYXic, + hf_cand_xic0_omegac0::CosPaV0ToCasc, hf_cand_xic0_omegac0::CosPaCascToXic, hf_cand_xic0_omegac0::CosPaXYV0ToCasc, hf_cand_xic0_omegac0::CosPaXYCascToXic, + hf_cand_xic0_omegac0::KfRapXic, + hf_cand_xic0_omegac0::KfptPiFromXic, hf_cand_xic0_omegac0::KfptXic, + hf_cand_xic0_omegac0::CosThetaStarPiFromXic, + hf_cand_xic0_omegac0::V0Ndf, hf_cand_xic0_omegac0::CascNdf, hf_cand_xic0_omegac0::XicNdf, + hf_cand_xic0_omegac0::MassV0Ndf, hf_cand_xic0_omegac0::MassCascNdf, + hf_cand_xic0_omegac0::V0Chi2OverNdf, hf_cand_xic0_omegac0::CascChi2OverNdf, hf_cand_xic0_omegac0::XicChi2OverNdf, + hf_cand_xic0_omegac0::MassV0Chi2OverNdf, hf_cand_xic0_omegac0::MassCascChi2OverNdf); + // table with results of reconstruction level MC matching DECLARE_SOA_TABLE(HfXicToXiPiMCRec, "AOD", "HFXICXIPIMCREC", //! hf_cand_xic0_omegac0::FlagMcMatchRec, diff --git a/PWGHF/DataModel/CandidateSelectionTables.h b/PWGHF/DataModel/CandidateSelectionTables.h index 583c30a5de2..60ba4850953 100644 --- a/PWGHF/DataModel/CandidateSelectionTables.h +++ b/PWGHF/DataModel/CandidateSelectionTables.h @@ -136,11 +136,11 @@ DECLARE_SOA_TABLE(HfMlDsToKKPi, "AOD", "HFMLDS", //! namespace hf_sel_candidate_dstar { -DECLARE_SOA_COLUMN(IsSelDstarToD0Pi, isSelDstarToD0Pi, bool); //! checking if all four of following check pass -DECLARE_SOA_COLUMN(IsRecoD0Flag, isRecoD0Flag, bool); //! checking DecayType::D0ToPiK of D0prong -DECLARE_SOA_COLUMN(IsRecoTopol, isRecoTopol, bool); //! checking conjugate independent Topological selection on Dstar -DECLARE_SOA_COLUMN(IsRecoCand, isRecoCand, bool); //! checking conjugate dependent Topological selecton on Dstar -DECLARE_SOA_COLUMN(IsRecoPid, isRecoPid, bool); //! checking PID selection on daughters of D0Prong +DECLARE_SOA_COLUMN(IsSelDstarToD0Pi, isSelDstarToD0Pi, bool); //! checking if all four of following check pass +DECLARE_SOA_COLUMN(IsRecoD0Flag, isRecoD0Flag, bool); //! checking DecayType::D0ToPiK of D0prong +DECLARE_SOA_COLUMN(IsRecoTopol, isRecoTopol, bool); //! checking conjugate independent Topological selection on Dstar +DECLARE_SOA_COLUMN(IsRecoCand, isRecoCand, bool); //! checking conjugate dependent Topological selecton on Dstar +DECLARE_SOA_COLUMN(IsRecoPid, isRecoPid, bool); //! checking PID selection on daughters of D0Prong DECLARE_SOA_COLUMN(MlProbDstarToD0Pi, mlProbDstarToD0Pi, std::vector); //! ML probability for Dstar to D0Pi } // namespace hf_sel_candidate_dstar @@ -307,7 +307,7 @@ DECLARE_SOA_COLUMN(IsSelXicToPiKP, isSelXicToPiKP, int); //! DECLARE_SOA_COLUMN(MlProbXicToPKPi, mlProbXicToPKPi, std::vector); //! DECLARE_SOA_COLUMN(MlProbXicToPiKP, mlProbXicToPiKP, std::vector); //! // XicPlus to Xi Pi Pi -DECLARE_SOA_COLUMN(IsSelXicToXiPiPi, isSelXicToXiPiPi, int); //! +DECLARE_SOA_COLUMN(IsSelXicToXiPiPi, isSelXicToXiPiPi, int); //! DECLARE_SOA_COLUMN(MlProbXicToXiPiPi, mlProbXicToXiPiPi, std::vector); //! } // namespace hf_sel_candidate_xic @@ -357,6 +357,13 @@ DECLARE_SOA_TABLE(HfSelToXiPi, "AOD", "HFSELTOXIPI", hf_sel_toxipi::TpcNSigmaPiFromCharmBaryon, hf_sel_toxipi::TpcNSigmaPiFromCasc, hf_sel_toxipi::TpcNSigmaPiFromLambda, hf_sel_toxipi::TpcNSigmaPrFromLambda, hf_sel_toxipi::TofNSigmaPiFromCharmBaryon, hf_sel_toxipi::TofNSigmaPiFromCasc, hf_sel_toxipi::TofNSigmaPiFromLambda, hf_sel_toxipi::TofNSigmaPrFromLambda); +DECLARE_SOA_TABLE(HfSelToXiPiKf, "AOD", "HFSELTOXIPIKF", + hf_sel_toxipi::StatusPidCharmBaryon, hf_sel_toxipi::StatusPidCascade, hf_sel_toxipi::StatusPidLambda, + hf_sel_toxipi::StatusInvMassCharmBaryon, hf_sel_toxipi::StatusInvMassCascade, hf_sel_toxipi::StatusInvMassLambda, + hf_sel_toxipi::ResultSelections, hf_sel_toxipi::PidTpcInfoStored, hf_sel_toxipi::PidTofInfoStored, + hf_sel_toxipi::TpcNSigmaPiFromCharmBaryon, hf_sel_toxipi::TpcNSigmaPiFromCasc, hf_sel_toxipi::TpcNSigmaPiFromLambda, hf_sel_toxipi::TpcNSigmaPrFromLambda, + hf_sel_toxipi::TofNSigmaPiFromCharmBaryon, hf_sel_toxipi::TofNSigmaPiFromCasc, hf_sel_toxipi::TofNSigmaPiFromLambda, hf_sel_toxipi::TofNSigmaPrFromLambda); + namespace hf_sel_toomegapi { DECLARE_SOA_COLUMN(StatusPidLambda, statusPidLambda, bool); diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index f1ac9e9087a..a9d71f86da1 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -167,6 +167,11 @@ o2physics_add_dpl_workflow(candidate-selector-omegac0-to-omega-pi PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(candidate-selector-xic0-to-xi-pi-kf + SOURCES candidateSelectorXic0ToXiPiKf.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(candidate-selector-to-xi-pi SOURCES candidateSelectorToXiPi.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore @@ -254,6 +259,11 @@ o2physics_add_dpl_workflow(tree-creator-to-xi-pi PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(tree-creator-xic0-to-xi-pi-kf + SOURCES treeCreatorXic0ToXiPiKf.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(tree-creator-xic-to-p-k-pi SOURCES treeCreatorXicToPKPi.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 199dc5c7477..8e67ac22696 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -79,6 +79,7 @@ struct HfCandidateCreatorXic0Omegac0 { Produces rowCandToOmegaPi; Produces rowCandToOmegaK; Produces kfCandidateData; + Produces kfCandidateXicData; Configurable propagateToPCA{"propagateToPCA", false, "create tracks version propagated to PCA"}; Configurable useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"}; @@ -177,14 +178,61 @@ struct HfCandidateCreatorXic0Omegac0 { float chi2MassCasc; float etaOmegac; } kfOmegac0Candidate; + + struct { + float chi2GeoV0; + float ldlV0; + float chi2TopoV0ToPv; + float chi2GeoCasc; + float ldlCasc; + float chi2TopoCascToPv; + float decayLenXYLambda; + float decayLenXYCasc; + float cosPaV0ToCasc; + float cosPaXYV0ToCasc; + float cosPaV0ToPv; + float cosPaXYV0ToPv; + float cosPaCascToXic; + float cosPaXYCascToXic; + float cosPaCascToPv; + float cosPaXYCascToPv; + float massV0; + float massCasc; + float ptPiFromXic; + float ptXic; + float rapXic; + float massXic; + float cosThetaStarPiFromXic; + float chi2TopoPiFromXicToPv; + float kfDcaXYPiFromXic; + float chi2TopoV0ToCasc; + float chi2TopoCascToXic; + float decayLenXYXic; + float chi2GeoXic; + float kfDcaV0Dau; + float kfDcaCascDau; + float kfDcaXicDau; + float kfDcaXYCascToPv; + float chi2TopoXicToPv; + float cosPaXicToPv; + float cosPaXYXicToPv; + float ldlXic; + float ctV0; + float ctCasc; + float ctXic; + float ctOmegac; + float chi2MassV0; + float chi2MassCasc; + float etaXic; + } kfXic0Candidate; void init(InitContext const&) { - std::array allProcesses = {doprocessNoCentToXiPi, doprocessNoCentToXiPiTraCasc, doprocessCentFT0CToXiPi, doprocessCentFT0MToXiPi, doprocessNoCentToOmegaPi, doprocessOmegacToOmegaPiWithKFParticle, doprocessCentFT0CToOmegaPi, doprocessCentFT0MToOmegaPi, doprocessNoCentToOmegaK, doprocessCentFT0CToOmegaK, doprocessCentFT0MToOmegaK}; + std::array allProcesses = {doprocessNoCentToXiPi, doprocessNoCentToXiPiTraCasc, doprocessCentFT0CToXiPi, doprocessCentFT0MToXiPi, doprocessNoCentToOmegaPi, doprocessOmegacToOmegaPiWithKFParticle, doprocessCentFT0CToOmegaPi, doprocessCentFT0MToOmegaPi, doprocessNoCentToOmegaK, doprocessCentFT0CToOmegaK, doprocessCentFT0MToOmegaK, doprocessXicToXiPiWithKFParticle}; if (std::accumulate(allProcesses.begin(), allProcesses.end(), 0) == 0) { LOGP(fatal, "No process function enabled, please select one for at least one channel."); } - std::array processesToXiPi = {doprocessNoCentToXiPi, doprocessNoCentToXiPiTraCasc, doprocessCentFT0CToXiPi, doprocessCentFT0MToXiPi}; + std::array processesToXiPi = {doprocessNoCentToXiPi, doprocessNoCentToXiPiTraCasc, doprocessCentFT0CToXiPi, doprocessCentFT0MToXiPi, doprocessXicToXiPiWithKFParticle}; if (std::accumulate(processesToXiPi.begin(), processesToXiPi.end(), 0) > 1) { LOGP(fatal, "One and only one ToXiPi process function must be enabled at a time."); } @@ -203,7 +251,7 @@ struct HfCandidateCreatorXic0Omegac0 { LOGP(fatal, "At most one process function for collision monitoring can be enabled at a time."); } if (nProcessesCollisions == 1) { - if ((doprocessNoCentToXiPi && !doprocessCollisions) || (doprocessNoCentToXiPiTraCasc && !doprocessCollisions) || (doprocessNoCentToOmegaPi && !doprocessCollisions) || (doprocessNoCentToOmegaK && !doprocessCollisions) || (doprocessOmegacToOmegaPiWithKFParticle && !doprocessCollisions)) { + if ((doprocessNoCentToXiPi && !doprocessCollisions) || (doprocessNoCentToXiPiTraCasc && !doprocessCollisions) || (doprocessNoCentToOmegaPi && !doprocessCollisions) || (doprocessNoCentToOmegaK && !doprocessCollisions) || (doprocessOmegacToOmegaPiWithKFParticle && !doprocessCollisions) || (doprocessXicToXiPiWithKFParticle && !doprocessCollisions)) { LOGP(fatal, "Process function for collision monitoring not correctly enabled. Did you enable \"processCollisions\"?"); } if ((doprocessCentFT0CToXiPi && !doprocessCollisionsCentFT0C) || (doprocessCentFT0CToOmegaPi && !doprocessCollisionsCentFT0C) || (doprocessCentFT0CToOmegaK && !doprocessCollisionsCentFT0C)) { @@ -214,31 +262,34 @@ struct HfCandidateCreatorXic0Omegac0 { } } - hInvMassCharmBaryonToXiPi = registry.add("hInvMassCharmBaryonToXiPi", "Charm baryon invariant mass - #Xi #pi decay;inv. mass (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 2.2, 3.1}}}); - hInvMassCharmBaryonToOmegaPi = registry.add("hInvMassCharmBaryonToOmegaPi", "Charm baryon invariant mass - #Omega #pi decay;inv. mass (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 2.2, 3.1}}}); - hInvMassCharmBaryonToOmegaK = registry.add("hInvMassCharmBaryonToOmegaK", "Charm baryon invariant mass - #Omega K decay;inv. mass (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 2.2, 3.1}}}); - hFitterStatusToXiPi = registry.add("hFitterStatusToXiPi", "Charm DCAFitter status - #Xi #pi vtx;status;entries", {HistType::kTH1F, {{3, -0.5, 2.5}}}); // 0 --> vertex(es) found, 1 --> exception found, 2 --> no vertex found (but no exception) - hFitterStatusToOmegaPi = registry.add("hFitterStatusToOmegaPi", "Charm DCAFitter status - #Omega #pi vtx ;status;entries", {HistType::kTH1F, {{3, -0.5, 2.5}}}); // 0 --> vertex(es) found, 1 --> exception found, 2 --> no vertex found (but no exception) - hFitterStatusToOmegaK = registry.add("hFitterStatusToOmegaK", "Charm DCAFitter status - #Omega K vtx;status;entries", {HistType::kTH1F, {{3, -0.5, 2.5}}}); // 0 --> vertex(es) found, 1 --> exception found, 2 --> no vertex found (but no exception) - hCandidateCounterToXiPi = registry.add("hCandidateCounterToXiPi", "Candidate counter wrt derived data - #Xi #pi decay;status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}); // 0 --> candidates in derived data table, 1 --> candidates passing testbit selection, 2 --> candidates passing fitter step 3 --> candidates filled in new table - hCandidateCounterToOmegaPi = registry.add("hCandidateCounterToOmegaPi", "Candidate counter wrt derived data - #Omega #pi decay;status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}); // 0 --> candidates in derived data table, 1 --> candidates passing testbit selection, 2 --> candidates passing fitter step 3 --> candidates filled in new table - hCandidateCounterToOmegaK = registry.add("hCandidateCounterToOmegaK", "Candidate counter wrt derived data - #Omega K decay;status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}); // 0 --> candidates in derived data table, 1 --> candidates passing testbit selection, 2 --> candidates passing fitter step 3 --> candidates filled in new table - hCascadesCounterToXiPi = registry.add("hCascadesCounterToXiPi", "Cascades counter wrt derived data - #Xi #pi decay;status;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}); // 0 --> cascades in derived data table (and stored in AOD table), 1 --> cascades in derived data table and also accessible in cascData table - hCascadesCounterToOmegaPi = registry.add("hCascadesCounterToOmegaPi", "Cascades counter wrt derived data - #Omega #pi decay;status;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}); // 0 --> cascades in derived data table (and stored in AOD table), 1 --> cascades in derived data table and also accessible in cascData table - hCascadesCounterToOmegaK = registry.add("hCascadesCounterToOmegaK", "Cascades counter wrt derived data - #Omega K decay;status;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}); // 0 --> cascades in derived data table (and stored in AOD table), 1 --> cascades in derived data table and also accessible in cascData table + hInvMassCharmBaryonToXiPi = registry.add("hInvMassCharmBaryonToXiPi", "Charm baryon invariant mass - #Xi #pi decay;inv. mass (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 2.2, 3.1}}}); + hInvMassCharmBaryonToOmegaPi = registry.add("hInvMassCharmBaryonToOmegaPi", "Charm baryon invariant mass - #Omega #pi decay;inv. mass (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 2.2, 3.1}}}); + hInvMassCharmBaryonToOmegaK = registry.add("hInvMassCharmBaryonToOmegaK", "Charm baryon invariant mass - #Omega K decay;inv. mass (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 2.2, 3.1}}}); + hFitterStatusToXiPi = registry.add("hFitterStatusToXiPi", "Charm DCAFitter status - #Xi #pi vtx;status;entries", {HistType::kTH1D, {{3, -0.5, 2.5}}}); // 0 --> vertex(es) found, 1 --> exception found, 2 --> no vertex found (but no exception) + hFitterStatusToOmegaPi = registry.add("hFitterStatusToOmegaPi", "Charm DCAFitter status - #Omega #pi vtx ;status;entries", {HistType::kTH1D, {{3, -0.5, 2.5}}}); // 0 --> vertex(es) found, 1 --> exception found, 2 --> no vertex found (but no exception) + hFitterStatusToOmegaK = registry.add("hFitterStatusToOmegaK", "Charm DCAFitter status - #Omega K vtx;status;entries", {HistType::kTH1D, {{3, -0.5, 2.5}}}); // 0 --> vertex(es) found, 1 --> exception found, 2 --> no vertex found (but no exception) + hCandidateCounterToXiPi = registry.add("hCandidateCounterToXiPi", "Candidate counter wrt derived data - #Xi #pi decay;status;entries", {HistType::kTH1D, {{4, -0.5, 3.5}}}); // 0 --> candidates in derived data table, 1 --> candidates passing testbit selection, 2 --> candidates passing fitter step 3 --> candidates filled in new table + hCandidateCounterToOmegaPi = registry.add("hCandidateCounterToOmegaPi", "Candidate counter wrt derived data - #Omega #pi decay;status;entries", {HistType::kTH1D, {{4, -0.5, 3.5}}}); // 0 --> candidates in derived data table, 1 --> candidates passing testbit selection, 2 --> candidates passing fitter step 3 --> candidates filled in new table + hCandidateCounterToOmegaK = registry.add("hCandidateCounterToOmegaK", "Candidate counter wrt derived data - #Omega K decay;status;entries", {HistType::kTH1D, {{4, -0.5, 3.5}}}); // 0 --> candidates in derived data table, 1 --> candidates passing testbit selection, 2 --> candidates passing fitter step 3 --> candidates filled in new table + hCascadesCounterToXiPi = registry.add("hCascadesCounterToXiPi", "Cascades counter wrt derived data - #Xi #pi decay;status;entries", {HistType::kTH1D, {{2, -0.5, 1.5}}}); // 0 --> cascades in derived data table (and stored in AOD table), 1 --> cascades in derived data table and also accessible in cascData table + hCascadesCounterToOmegaPi = registry.add("hCascadesCounterToOmegaPi", "Cascades counter wrt derived data - #Omega #pi decay;status;entries", {HistType::kTH1D, {{2, -0.5, 1.5}}}); // 0 --> cascades in derived data table (and stored in AOD table), 1 --> cascades in derived data table and also accessible in cascData table + hCascadesCounterToOmegaK = registry.add("hCascadesCounterToOmegaK", "Cascades counter wrt derived data - #Omega K decay;status;entries", {HistType::kTH1D, {{2, -0.5, 1.5}}}); // 0 --> cascades in derived data table (and stored in AOD table), 1 --> cascades in derived data table and also accessible in cascData table // KFparticle variables hist - registry.add("hKFParticleV0TopoChi2", "hKFParticleV0TopoChi2", kTH1F, {{1000, -0.10f, 100.0f}}); - registry.add("hKFParticleCascTopoChi2", "hKFParticleCascTopoChi2", kTH1F, {{1000, -0.1f, 100.0f}}); - registry.add("hKFParticleCascBachTopoChi2", "hKFParticleCascBachTopoChi2", kTH1F, {{1000, -0.1f, 100.0f}}); - registry.add("hKFParticleDcaCharmBaryonDau", "hKFParticleDcaCharmBaryonDau", kTH1F, {{1000, -0.1f, 100.0f}}); - registry.add("hKFParticleDcaXYV0DauToPv", "hKFParticleDcaXYV0DauToPv", kTH1F, {{1000, -0.1f, 100.0f}}); - registry.add("hKFParticleDcaXYCascBachToPv", "hKFParticleDcaXYCascBachToPv", kTH1F, {{1000, -0.1f, 100.0f}}); - registry.add("hKfLambda_ldl", "hKfLambda_ldl", kTH1F, {{1000, 0.0f, 1000.0f}}); - registry.add("hKfOmega_ldl", "hKfOmega_ldl", kTH1F, {{1000, 0.0f, 1000.0f}}); - registry.add("hKfOmegaC0_ldl", "hKfOmegaC0_ldl", kTH1F, {{1000, 0.0f, 1000.0f}}); - registry.add("hDcaXYCascadeToPVKf", "hDcaXYCascadeToPVKf", kTH1F, {{1000, 0.0f, 2.0f}}); - registry.add("hInvMassOmegaMinus", "hInvMassOmegaMinus", kTH1F, {{1000, 1.6f, 2.0f}}); + registry.add("hKFParticleV0TopoChi2", "hKFParticleV0TopoChi2", kTH1D, {{1000, -0.10f, 100.0f}}); + registry.add("hKFParticleCascTopoChi2", "hKFParticleCascTopoChi2", kTH1D, {{1000, -0.1f, 100.0f}}); + registry.add("hKFParticleCascBachTopoChi2", "hKFParticleCascBachTopoChi2", kTH1D, {{1000, -0.1f, 100.0f}}); + registry.add("hKFParticleDcaCharmBaryonDau", "hKFParticleDcaCharmBaryonDau", kTH1D, {{1000, -0.1f, 100.0f}}); + registry.add("hKFParticleDcaXYV0DauToPv", "hKFParticleDcaXYV0DauToPv", kTH1D, {{1000, -0.1f, 100.0f}}); + registry.add("hKFParticleDcaXYCascBachToPv", "hKFParticleDcaXYCascBachToPv", kTH1D, {{1000, -0.1f, 100.0f}}); + registry.add("hKfLambda_ldl", "hKfLambda_ldl", kTH1D, {{1000, 0.0f, 1000.0f}}); + registry.add("hKfOmega_ldl", "hKfOmega_ldl", kTH1D, {{1000, 0.0f, 1000.0f}}); + registry.add("hKfXi_ldl", "hKfXi_ldl", kTH1D, {{1000, 0.0f, 1000.0f}}); + registry.add("hKfOmegaC0_ldl", "hKfOmegaC0_ldl", kTH1D, {{1000, 0.0f, 1000.0f}}); + registry.add("hKfXiC0_ldl", "hKfXiC0_ldl", kTH1D, {{1000, 0.0f, 1000.0f}}); + registry.add("hDcaXYCascadeToPVKf", "hDcaXYCascadeToPVKf", kTH1D, {{1000, 0.0f, 2.0f}}); + registry.add("hInvMassOmegaMinus", "hInvMassOmegaMinus", kTH1D, {{1000, 1.6f, 2.0f}}); + registry.add("hInvMassXiMinus", "hInvMassXiMinus", kTH1D, {{1000, 1.25f, 1.65f}}); hfEvSel.addHistograms(registry); // collision monitoring @@ -614,7 +665,7 @@ struct HfCandidateCreatorXic0Omegac0 { } } // loop over LF Cascade-bachelor candidates - } // end of run function + } // end of run function template void runKfOmegac0CreatorWithKFParticle(Coll const&, @@ -1039,8 +1090,437 @@ struct HfCandidateCreatorXic0Omegac0 { v0Chi2OverNdf, cascChi2OverNdf, charmbaryonChi2OverNdf, v0Chi2OverNdf_m, cascChi2OverNdf_m); } // loop over LF Cascade-bachelor candidates - } // end of run function + } // end of run function + //========================================================== + template + void runKfXic0CreatorWithKFParticle(Coll const&, + aod::BCsWithTimestamps const& /*bcWithTimeStamps*/, + MyKfTracks const&, + MyKfCascTable const&, KFCascadesLinked const&, + aod::HfCascLf2Prongs const& candidates, + Hist& hInvMassCharmBaryon, + Hist& hFitterStatus, + Hist& hCandidateCounter, + Hist& hCascadesCounter) + { + for (const auto& cand : candidates) { + hCandidateCounter->Fill(1); + + auto collision = cand.collision_as(); + // set the magnetic field from CCDB + auto bc = collision.template bc_as(); + if (runNumber != bc.runNumber()) { + LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber; + initCCDB(bc, runNumber, ccdb, isRun2 ? ccdbPathGrp : ccdbPathGrpMag, lut, isRun2); + magneticField = o2::base::Propagator::Instance()->getNominalBz(); + LOG(info) << ">>>>>>>>>>>> Magnetic field: " << magneticField; + runNumber = bc.runNumber(); + } + df.setBz(magneticField); + KFParticle::SetField(magneticField); + // bachelor from Xic0 + auto trackCharmBachelor = cand.prong0_as(); + + auto cascAodElement = cand.cascade_as(); + hCascadesCounter->Fill(0); + int v0index = cascAodElement.v0Id(); + if (!cascAodElement.has_kfCascData()) { + continue; + } + auto casc = cascAodElement.kfCascData_as(); + hCascadesCounter->Fill(1); + auto trackCascDauCharged = casc.bachelor_as(); // pion <- xi track + auto trackV0Dau0 = casc.posTrack_as(); // V0 positive daughter track + auto trackV0Dau1 = casc.negTrack_as(); // V0 negative daughter track + + auto bachCharge = trackCascDauCharged.signed1Pt() > 0 ? +1 : -1; + + //// pion & p TrackParCov + auto trackParCovV0Dau0 = getTrackParCov(trackV0Dau0); + auto trackParCovV0Dau1 = getTrackParCov(trackV0Dau1); + // pion <- casc TrackParCov + auto XiDauChargedTrackParCov = getTrackParCov(trackCascDauCharged); + // convert tracks into KFParticle object + KFPTrack kfTrack0 = createKFPTrackFromTrack(trackV0Dau0); + KFPTrack kfTrack1 = createKFPTrackFromTrack(trackV0Dau1); + KFPTrack kfTrackBach = createKFPTrackFromTrack(trackCascDauCharged); + + KFParticle kfPosPr(kfTrack0, kProton); + KFParticle kfNegPi(kfTrack1, kPiMinus); + KFParticle kfNegBachPi(kfTrackBach, kPiMinus); + KFParticle kfPosPi(kfTrack0, kPiPlus); + KFParticle kfNegPr(kfTrack1, kProton); + KFParticle kfPosBachPi(kfTrackBach, kPiPlus); + + KFParticle kfBachPion; + KFParticle kfPos; + KFParticle kfNeg; + if (bachCharge < 0) { + kfPos = kfPosPr; + kfNeg = kfNegPi; + kfBachPion = kfNegBachPi; + } else { + kfPos = kfPosPi; + kfNeg = kfNegPr; + kfBachPion = kfPosBachPi; + } + + //__________________________________________ + //*>~<* step 1 : construct V0 with KF + const KFParticle* v0Daughters[2] = {&kfPos, &kfNeg}; + // construct V0 + KFParticle kfV0; + kfV0.SetConstructMethod(kfConstructMethod); + try { + kfV0.Construct(v0Daughters, 2); + } catch (std::runtime_error& e) { + LOG(debug) << "Failed to construct cascade V0 from daughter tracks: " << e.what(); + continue; + } + + // mass window cut on lambda before mass constraint + float massLam, sigLam; + kfV0.GetMass(massLam, sigLam); + if (TMath::Abs(massLam - MassLambda0) > lambdaMassWindow) + continue; + + // err_mass>0 of Lambda + if (sigLam <= 0) + continue; + // chi2>0 && NDF>0 for selecting Lambda + if ((kfV0.GetNDF() <= 0 || kfV0.GetChi2() <= 0)) + continue; + + kfXic0Candidate.chi2GeoV0 = kfV0.GetChi2(); + KFParticle kfV0MassConstrained = kfV0; + kfV0MassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassLambda); // set mass constrain to Lambda + if (kfUseV0MassConstraint) { + KFParticle kfV0 = kfV0MassConstrained; + } + kfV0.TransportToDecayVertex(); + + //__________________________________________ + //*>~<* step 2 : reconstruct cascade(Xi) with KF + const KFParticle* XiDaugthers[2] = {&kfBachPion, &kfV0}; + // construct cascade + KFParticle kfXi; + kfXi.SetConstructMethod(kfConstructMethod); + try { + kfXi.Construct(XiDaugthers, 2); + } catch (std::runtime_error& e) { + LOG(debug) << "Failed to construct Xi from V0 and bachelor track: " << e.what(); + continue; + } + + float massCasc, sigCasc; + kfXi.GetMass(massCasc, sigCasc); + // err_massXi > 0 + if (sigCasc <= 0) + continue; + + if (std::abs(massCasc - MassXiMinus) > massToleranceCascade) + continue; + // chi2>0 && NDF>0 + if (kfXi.GetNDF() <= 0 || kfXi.GetChi2() <= 0) + continue; + kfXic0Candidate.chi2GeoCasc = kfXi.GetChi2(); + KFParticle kfXiMassConstrained = kfXi; + kfXiMassConstrained.SetNonlinearMassConstraint(o2::constants::physics::MassXiMinus); // set mass constrain to XiMinus + if (kfUseCascadeMassConstraint) { + // set mass constraint if requested + KFParticle kfXi = kfXiMassConstrained; + } + registry.fill(HIST("hInvMassXiMinus"), massCasc); + kfXi.TransportToDecayVertex(); + + //__________________________________________ + //*>~<* step 3 : reconstruc Xic0 with KF + // Create KF charm bach Pion from track + KFPTrack kfTrackBachPion = createKFPTrackFromTrack(trackCharmBachelor); + KFParticle kfCharmBachPion(kfTrackBachPion, kPiPlus); + const KFParticle* XiC0Daugthers[2] = {&kfCharmBachPion, &kfXi}; + + // construct XiC0 + KFParticle kfXiC0; + kfXiC0.SetConstructMethod(kfConstructMethod); + try { + kfXiC0.Construct(XiC0Daugthers, 2); + } catch (std::runtime_error& e) { + LOG(debug) << "Failed to construct XiC0 from Cascade and bachelor pion track: " << e.what(); + continue; + } + float massXiC0, sigXiC0; + kfXiC0.GetMass(massXiC0, sigXiC0); + if (sigXiC0 <= 0) + continue; + // chi2>0 && NDF>0 + if (kfXiC0.GetNDF() <= 0 || kfXiC0.GetChi2() <= 0) + continue; + + hFitterStatus->Fill(0); + hCandidateCounter->Fill(2); + kfXiC0.TransportToDecayVertex(); + // PV + KFPVertex kfVertex = createKFPVertexFromCollision(collision); + KFParticle kfPV(kfVertex); + + // set production vertex; + kfNeg.SetProductionVertex(kfV0); + kfPos.SetProductionVertex(kfV0); + + KFParticle kfBachPionToXi = kfBachPion; + KFParticle kfV0ToCasc = kfV0; + kfBachPionToXi.SetProductionVertex(kfXi); + kfV0ToCasc.SetProductionVertex(kfXi); + + KFParticle kfXiToXiC = kfXi; + KFParticle kfCharmBachPionToXiC = kfCharmBachPion; + kfCharmBachPionToXiC.SetProductionVertex(kfXiC0); + kfXiToXiC.SetProductionVertex(kfXiC0); + + // KFParticle to PV + KFParticle kfV0ToPv = kfV0; + KFParticle kfXiToPv = kfXi; + KFParticle kfXic0ToPv = kfXiC0; + KFParticle kfPiFromXicToPv = kfCharmBachPion; + + kfV0ToPv.SetProductionVertex(kfPV); + kfXiToPv.SetProductionVertex(kfPV); + kfXic0ToPv.SetProductionVertex(kfPV); + kfPiFromXicToPv.SetProductionVertex(kfPV); + //------------get updated daughter tracks after vertex fit --------------- + auto trackParVarCharmBachelor = getTrackParCovFromKFP(kfCharmBachPionToXiC, o2::track::PID::Pion, -bachCharge); // chrambaryon bach pion + trackParVarCharmBachelor.setAbsCharge(1); + + XiDauChargedTrackParCov = getTrackParCovFromKFP(kfBachPionToXi, o2::track::PID::Pion, bachCharge); // Cascade bach pion + XiDauChargedTrackParCov.setAbsCharge(1); + o2::track::TrackParCov trackCasc = getTrackParCovFromKFP(kfXiToXiC, kfXiToXiC.GetPDG(), bachCharge); + trackCasc.setAbsCharge(1); + + trackParCovV0Dau0 = getTrackParCovFromKFP(kfPos, kfPos.GetPDG(), 1); // V0 postive daughter + trackParCovV0Dau0.setAbsCharge(1); + trackParCovV0Dau1 = getTrackParCovFromKFP(kfNeg, kfNeg.GetPDG(), -1); // V0 negtive daughter + trackParCovV0Dau1.setAbsCharge(1); + + //-------------------------- V0 info--------------------------- + // pseudorapidity + float pseudorapV0Dau0 = kfPos.GetEta(); + float pseudorapV0Dau1 = kfNeg.GetEta(); + + // info from from KFParticle + std::array pVecV0 = {kfV0.GetPx(), kfV0.GetPy(), kfV0.GetPz()}; // pVec stands for vector containing the 3-momentum components + std::array vertexV0 = {kfV0.GetX(), kfV0.GetY(), kfV0.GetZ()}; + std::array pVecV0Dau0 = {kfPos.GetPx(), kfPos.GetPy(), kfPos.GetPz()}; + std::array pVecV0Dau1 = {kfNeg.GetPx(), kfNeg.GetPy(), kfNeg.GetPz()}; + + //-------------------reconstruct cascade track------------------ + // pseudorapidity + float pseudorapCascBachelor = kfBachPionToXi.GetEta(); + + // info from KFParticle + std::array vertexCasc = {kfXi.GetX(), kfXi.GetY(), kfXi.GetZ()}; + std::array pVecCascBachelor = {kfBachPionToXi.GetPx(), kfBachPionToXi.GetPy(), kfBachPionToXi.GetPz()}; + + auto primaryVertex = getPrimaryVertex(collision); + std::array pvCoord = {collision.posX(), collision.posY(), collision.posZ()}; + std::array vertexCharmBaryonFromFitter = {0.0, 0.0, 0.0}; // This variable get from DCAfitter in default process, in KF process it is set as 0. + std::array pVecCharmBachelorAsD; + pVecCharmBachelorAsD[0] = kfCharmBachPionToXiC.GetPx(); + pVecCharmBachelorAsD[1] = kfCharmBachPionToXiC.GetPy(); + pVecCharmBachelorAsD[2] = kfCharmBachPionToXiC.GetPz(); + + std::array pVecCharmBaryon = {kfXiC0.GetPx(), kfXiC0.GetPy(), kfXiC0.GetPz()}; + std::array coordVtxCharmBaryon = {kfXiC0.GetX(), kfXiC0.GetY(), kfXiC0.GetZ()}; + auto covVtxCharmBaryon = kfXiC0.CovarianceMatrix(); + float covMatrixPV[6]; + kfVertex.GetCovarianceMatrix(covMatrixPV); + + // impact parameters + gpu::gpustd::array impactParameterV0Dau0; + gpu::gpustd::array impactParameterV0Dau1; + gpu::gpustd::array impactParameterKaFromCasc; + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCovV0Dau0, 2.f, matCorr, &impactParameterV0Dau0); + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCovV0Dau1, 2.f, matCorr, &impactParameterV0Dau1); + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, XiDauChargedTrackParCov, 2.f, matCorr, &impactParameterKaFromCasc); + float dcaxyV0Dau0 = impactParameterV0Dau0[0]; + float dcaxyV0Dau1 = impactParameterV0Dau1[0]; + float dcaxyCascBachelor = impactParameterKaFromCasc[0]; + float dcazV0Dau0 = impactParameterV0Dau0[1]; + float dcazV0Dau1 = impactParameterV0Dau1[1]; + float dcazCascBachelor = impactParameterKaFromCasc[1]; + + // pseudorapidity + float pseudorapCharmBachelor = kfCharmBachPionToXiC.GetEta(); + + // impact parameters + o2::dataformats::DCA impactParameterCasc; + o2::dataformats::DCA impactParameterCharmBachelor; + o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackCasc, 2.f, matCorr, &impactParameterCasc); + o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackParVarCharmBachelor, 2.f, matCorr, &impactParameterCharmBachelor); + float impactParBachFromCharmBaryonXY = impactParameterCharmBachelor.getY(); + float impactParBachFromCharmBaryonZ = impactParameterCharmBachelor.getZ(); + + // computing decay length and ctau + float decLenCharmBaryon = RecoDecay::distance(pvCoord, coordVtxCharmBaryon); + float decLenCascade = RecoDecay::distance(coordVtxCharmBaryon, vertexCasc); + float decLenV0 = RecoDecay::distance(vertexCasc, vertexV0); + + double phiCharmBaryon, thetaCharmBaryon; + getPointDirection(std::array{kfV0.GetX(), kfV0.GetY(), kfV0.GetZ()}, coordVtxCharmBaryon, phiCharmBaryon, thetaCharmBaryon); + auto errorDecayLengthCharmBaryon = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phiCharmBaryon, thetaCharmBaryon) + getRotatedCovMatrixXX(covVtxCharmBaryon, phiCharmBaryon, thetaCharmBaryon)); + auto errorDecayLengthXYCharmBaryon = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phiCharmBaryon, 0.) + getRotatedCovMatrixXX(covVtxCharmBaryon, phiCharmBaryon, 0.)); + + // fill test histograms + hInvMassCharmBaryon->Fill(massXiC0); + hCandidateCounter->Fill(3); + + //// KFParticle table information + // KF chi2 + auto v0NDF = kfV0.GetNDF(); + auto v0Chi2OverNdf = kfXic0Candidate.chi2GeoV0 / v0NDF; + + auto cascNDF = kfXi.GetNDF(); + auto cascChi2OverNdf = kfXic0Candidate.chi2GeoCasc / cascNDF; + + kfXic0Candidate.chi2GeoXic = kfXiC0.GetChi2(); + auto charmbaryonNDF = kfXiC0.GetNDF(); + auto charmbaryonChi2OverNdf = kfXic0Candidate.chi2GeoXic / charmbaryonNDF; + + kfXic0Candidate.chi2MassV0 = kfV0MassConstrained.GetChi2(); + auto v0NDF_m = kfV0MassConstrained.GetNDF(); + auto v0Chi2OverNdf_m = kfXic0Candidate.chi2MassV0 / v0NDF_m; + + kfXic0Candidate.chi2MassCasc = kfXiMassConstrained.GetChi2(); + auto cascNDF_m = kfXiMassConstrained.GetNDF(); + auto cascChi2OverNdf_m = kfXic0Candidate.chi2MassCasc / cascNDF_m; + + // KF topo Chi2 + kfXic0Candidate.chi2TopoV0ToPv = kfV0ToPv.GetChi2(); + kfXic0Candidate.chi2TopoCascToPv = kfXiToPv.GetChi2(); + kfXic0Candidate.chi2TopoPiFromXicToPv = kfPiFromXicToPv.GetChi2(); + kfXic0Candidate.chi2TopoXicToPv = kfXic0ToPv.GetChi2(); + + auto cascBachTopoChi2 = kfBachPionToXi.GetChi2(); + kfXic0Candidate.chi2TopoV0ToCasc = kfV0ToCasc.GetChi2(); + kfXic0Candidate.chi2TopoCascToXic = kfXiToXiC.GetChi2(); + + // KF ldl + kfXic0Candidate.ldlV0 = ldlFromKF(kfV0, kfPV); + kfXic0Candidate.ldlCasc = ldlFromKF(kfXi, kfPV); + kfXic0Candidate.ldlXic = ldlFromKF(kfXiC0, kfPV); + + // KF dca + kfXic0Candidate.kfDcaXYPiFromXic = kfCharmBachPionToXiC.GetDistanceFromVertexXY(kfPV); + kfXic0Candidate.kfDcaV0Dau = kfNeg.GetDistanceFromParticle(kfPos); + kfXic0Candidate.kfDcaCascDau = kfBachPionToXi.GetDistanceFromParticle(kfV0ToCasc); + kfXic0Candidate.kfDcaXYCascToPv = kfXiToXiC.GetDistanceFromVertexXY(kfPV); + kfXic0Candidate.kfDcaXicDau = kfCharmBachPionToXiC.GetDistanceFromParticle(kfXiToXiC); + + // KF decay length + float DecayLxy_Lam, err_DecayLxy_Lam; + kfV0ToCasc.GetDecayLengthXY(DecayLxy_Lam, err_DecayLxy_Lam); + kfXic0Candidate.decayLenXYLambda = DecayLxy_Lam; + + float DecayLxy_Casc, err_DecayLxy_Casc; + kfXiToXiC.GetDecayLengthXY(DecayLxy_Casc, err_DecayLxy_Casc); + kfXic0Candidate.decayLenXYCasc = DecayLxy_Casc; + + float DecayLxy_Xic0, err_DecayLxy_Xic0; + kfXic0ToPv.GetDecayLengthXY(DecayLxy_Xic0, err_DecayLxy_Xic0); + kfXic0Candidate.decayLenXYXic = DecayLxy_Xic0; + + // KF cosPA + kfXic0Candidate.cosPaV0ToPv = cpaFromKF(kfV0, kfPV); + kfXic0Candidate.cosPaCascToPv = cpaFromKF(kfXi, kfPV); + kfXic0Candidate.cosPaXicToPv = cpaFromKF(kfXiC0, kfPV); + kfXic0Candidate.cosPaXYV0ToPv = cpaXYFromKF(kfV0, kfPV); + kfXic0Candidate.cosPaXYCascToPv = cpaXYFromKF(kfXi, kfPV); + kfXic0Candidate.cosPaXYXicToPv = cpaXYFromKF(kfXiC0, kfPV); + + kfXic0Candidate.cosPaV0ToCasc = cpaFromKF(kfV0, kfXi); + kfXic0Candidate.cosPaCascToXic = cpaFromKF(kfXi, kfXiC0); + kfXic0Candidate.cosPaXYV0ToCasc = cpaXYFromKF(kfV0, kfXi); + kfXic0Candidate.cosPaXYCascToXic = cpaXYFromKF(kfXi, kfXiC0); + // KF mass + kfXic0Candidate.massV0 = massLam; + kfXic0Candidate.massCasc = massCasc; + kfXic0Candidate.massXic = massXiC0; + + // KF pT + kfXic0Candidate.ptPiFromXic = kfCharmBachPionToXiC.GetPt(); + kfXic0Candidate.ptXic = kfXiC0.GetPt(); + + // KF rapidity + kfXic0Candidate.rapXic = kfXiC0.GetRapidity(); + + // KF cosThetaStar + kfXic0Candidate.cosThetaStarPiFromXic = cosThetaStarFromKF(0, 4332, 211, 3312, kfCharmBachPionToXiC, kfXiToXiC); + + // KF ct + kfXic0Candidate.ctV0 = kfV0.GetLifeTime(); + kfXic0Candidate.ctCasc = kfXi.GetLifeTime(); + kfXic0Candidate.ctXic = kfXiC0.GetLifeTime(); + kfXic0Candidate.ctOmegac = kfXiC0.GetLifeTime(); + + // KF eta + kfXic0Candidate.etaXic = kfXiC0.GetEta(); + + // fill KF hist + registry.fill(HIST("hKFParticleCascBachTopoChi2"), cascBachTopoChi2); + registry.fill(HIST("hKFParticleV0TopoChi2"), kfXic0Candidate.chi2TopoV0ToCasc); + registry.fill(HIST("hKFParticleCascTopoChi2"), kfXic0Candidate.chi2TopoCascToXic); + registry.fill(HIST("hKFParticleDcaCharmBaryonDau"), kfXic0Candidate.kfDcaXicDau); + registry.fill(HIST("hKFParticleDcaXYCascBachToPv"), dcaxyCascBachelor); + registry.fill(HIST("hKFParticleDcaXYV0DauToPv"), dcaxyV0Dau0); + registry.fill(HIST("hKfLambda_ldl"), kfXic0Candidate.ldlV0); + registry.fill(HIST("hKfXi_ldl"), kfXic0Candidate.ldlCasc); + registry.fill(HIST("hKfXiC0_ldl"), kfXic0Candidate.ldlXic); + registry.fill(HIST("hDcaXYCascadeToPVKf"), kfXic0Candidate.kfDcaXYCascToPv); + + // fill kf table + kfCandidateXicData(collision.globalIndex(), + pvCoord[0], pvCoord[1], pvCoord[2], + vertexCharmBaryonFromFitter[0], vertexCharmBaryonFromFitter[1], vertexCharmBaryonFromFitter[2], + vertexCasc[0], vertexCasc[1], vertexCasc[2], + vertexV0[0], vertexV0[1], vertexV0[2], + trackCascDauCharged.sign(), + covVtxCharmBaryon[0], covVtxCharmBaryon[1], covVtxCharmBaryon[2], covVtxCharmBaryon[3], covVtxCharmBaryon[4], covVtxCharmBaryon[5], + pVecCharmBaryon[0], pVecCharmBaryon[1], pVecCharmBaryon[2], + kfXiToXiC.GetPx(), kfXiToXiC.GetPy(), kfXiToXiC.GetPz(), + pVecCharmBachelorAsD[0], pVecCharmBachelorAsD[1], pVecCharmBachelorAsD[2], + pVecV0[0], pVecV0[1], pVecV0[2], + pVecCascBachelor[0], pVecCascBachelor[1], pVecCascBachelor[2], + pVecV0Dau0[0], pVecV0Dau0[1], pVecV0Dau0[2], + pVecV0Dau1[0], pVecV0Dau1[1], pVecV0Dau1[2], + impactParameterCasc.getY(), impactParBachFromCharmBaryonXY, + impactParameterCasc.getZ(), impactParBachFromCharmBaryonZ, + std::sqrt(impactParameterCasc.getSigmaY2()), std::sqrt(impactParameterCharmBachelor.getSigmaY2()), + v0index, casc.posTrackId(), casc.negTrackId(), + casc.cascadeId(), trackCharmBachelor.globalIndex(), casc.bachelorId(), + kfXic0Candidate.massV0, kfXic0Candidate.massCasc, kfXic0Candidate.massXic, + kfXic0Candidate.cosPaV0ToPv, kfXic0Candidate.cosPaXicToPv, kfXic0Candidate.cosPaCascToPv, kfXic0Candidate.cosPaXYV0ToPv, kfXic0Candidate.cosPaXYXicToPv, kfXic0Candidate.cosPaXYCascToPv, + kfXic0Candidate.ctOmegac, kfXic0Candidate.ctCasc, kfXic0Candidate.ctV0, kfXic0Candidate.ctXic, + pseudorapV0Dau0, pseudorapV0Dau1, pseudorapCascBachelor, pseudorapCharmBachelor, + kfXic0Candidate.etaXic, kfXi.GetEta(), kfV0.GetEta(), + dcaxyV0Dau0, dcaxyV0Dau1, dcaxyCascBachelor, + dcazV0Dau0, dcazV0Dau1, dcazCascBachelor, + kfXic0Candidate.kfDcaCascDau, kfXic0Candidate.kfDcaV0Dau, kfXic0Candidate.kfDcaXicDau, + decLenCharmBaryon, decLenCascade, decLenV0, errorDecayLengthCharmBaryon, errorDecayLengthXYCharmBaryon, + kfXic0Candidate.kfDcaXYPiFromXic, kfXic0Candidate.kfDcaXYCascToPv, + kfXic0Candidate.chi2GeoV0, kfXic0Candidate.chi2GeoCasc, kfXic0Candidate.chi2GeoXic, kfXic0Candidate.chi2MassV0, kfXic0Candidate.chi2MassCasc, + kfXic0Candidate.ldlV0, kfXic0Candidate.ldlCasc, kfXic0Candidate.ldlXic, + kfXic0Candidate.chi2TopoV0ToPv, kfXic0Candidate.chi2TopoCascToPv, kfXic0Candidate.chi2TopoPiFromXicToPv, kfXic0Candidate.chi2TopoXicToPv, + kfXic0Candidate.chi2TopoV0ToCasc, kfXic0Candidate.chi2TopoCascToXic, + kfXic0Candidate.decayLenXYLambda, kfXic0Candidate.decayLenXYCasc, kfXic0Candidate.decayLenXYXic, + kfXic0Candidate.cosPaV0ToCasc, kfXic0Candidate.cosPaCascToXic, kfXic0Candidate.cosPaXYV0ToCasc, kfXic0Candidate.cosPaXYCascToXic, + kfXic0Candidate.rapXic, kfXic0Candidate.ptPiFromXic, kfXic0Candidate.ptXic, + kfXic0Candidate.cosThetaStarPiFromXic, + v0NDF, cascNDF, charmbaryonNDF, v0NDF_m, cascNDF_m, + v0Chi2OverNdf, cascChi2OverNdf, charmbaryonChi2OverNdf, v0Chi2OverNdf_m, cascChi2OverNdf_m); + + } // loop over LF Cascade-bachelor candidates + } /// @brief process function w/o centrality selections void processNoCentToXiPi(soa::Join const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, @@ -1089,6 +1569,17 @@ struct HfCandidateCreatorXic0Omegac0 { } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0, processOmegacToOmegaPiWithKFParticle, "Run candidate creator w/o centrality selections for Omegac0 To omega pi decay channel using KFParticle", false); + void processXicToXiPiWithKFParticle(aod::Collisions const& collisions, + aod::BCsWithTimestamps const& bcWithTimeStamps, + MyKfTracks const& tracks, + MyKfCascTable const& cascades, + KFCascadesLinked const& cascadeLinks, + aod::HfCascLf2Prongs const& candidates) + { + runKfXic0CreatorWithKFParticle(collisions, bcWithTimeStamps, tracks, cascades, cascadeLinks, candidates, hInvMassCharmBaryonToXiPi, hFitterStatusToXiPi, hCandidateCounterToXiPi, hCascadesCounterToXiPi); + } + PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0, processXicToXiPiWithKFParticle, "Run candidate creator w/o centrality selections for Xic0 To Xi pi decay channel using KFParticle", false); + void processNoCentToOmegaK(soa::Join const& collisions, aod::BCsWithTimestamps const& bcWithTimeStamps, TracksWCovDca const& tracks, @@ -1267,7 +1758,7 @@ struct HfCandidateCreatorXic0Omegac0Mc { // inspect for which zPvPosMax cut was set for reconstructed void init(InitContext& initContext) { - std::array procCollisionsXicToXiPi{doprocessMcXicToXiPi, doprocessMcXicToXiPiFT0m, doprocessMcXicToXiPiFT0c}; + std::array procCollisionsXicToXiPi{doprocessMcXicToXiPi, doprocessMcXicToXiPiFT0m, doprocessMcXicToXiPiFT0c, doprocessMcXicToXiPiKf}; if (std::accumulate(procCollisionsXicToXiPi.begin(), procCollisionsXicToXiPi.end(), 0) > 1) { LOGP(fatal, "At most one process function for XicToXiPi collision study can be enabled at a time."); } @@ -1768,8 +2259,8 @@ struct HfCandidateCreatorXic0Omegac0Mc { } } } // close loop on MCParticles - } // close loop on MCCollisions - } // close process + } // close loop on MCCollisions + } // close process void processDoNoMc(aod::Collisions::iterator const&) { @@ -1788,6 +2279,17 @@ struct HfCandidateCreatorXic0Omegac0Mc { } PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcXicToXiPi, "Run Xic0 to xi pi MC process function - no centrality", false); + void processMcXicToXiPiKf(aod::HfCandToXiPiKf const& candidates, + MyTracksWMc const& tracks, + aod::McParticles const& mcParticles, + aod::McCollisions const& mcColls, + McCollisionsNoCents const& collsWithMcLabels, + BCsInfo const& bcs) + { + runXic0Omegac0Mc(candidates, tracks, mcParticles, collsWithMcLabels, mcColls, bcs); + } + PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcXicToXiPiKf, "Run Xic0 to xi pi MC process function - no centrality", false); + void processMcXicToXiPiFT0m(aod::HfCandToXiPi const& candidates, MyTracksWMc const& tracks, aod::McParticles const& mcParticles, diff --git a/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx new file mode 100644 index 00000000000..f83192eb3e8 --- /dev/null +++ b/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx @@ -0,0 +1,560 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file candidateSelectorToXiPi.cxx +/// \brief Xic0 → Xi Pi selection task +/// \author Ran Tu , Fudan University + +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectorPID.h" + +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::analysis; + +enum pidInfoStored { + kPiFromLam = 0, + kPrFromLam, + kPiFromCasc, + kPiFromCharm +}; + +/// Struct for applying Xic0 -> Xi pi selection cuts +struct HfCandidateSelectorXic0ToXiPiKf { + Produces hfSelToXiPi; + + // LF analysis selections + Configurable radiusCascMin{"radiusCascMin", 0.5, "Min cascade radius"}; + Configurable radiusV0Min{"radiusV0Min", 1.1, "Min V0 radius"}; + Configurable cosPAV0Min{"cosPAV0Min", 0.97, "Min valueCosPA V0"}; + Configurable cosPACascMin{"cosPACascMin", 0.97, "Min value CosPA cascade"}; + Configurable dcaCascDauMax{"dcaCascDauMax", 1.0, "Max DCA cascade daughters"}; + Configurable dcaV0DauMax{"dcaV0DauMax", 1.0, "Max DCA V0 daughters"}; + Configurable dcaBachToPvMin{"dcaBachToPvMin", 0.04, "DCA Bach To PV"}; + Configurable dcaNegToPvMin{"dcaNegToPvMin", 0.06, "DCA Neg To PV"}; + Configurable dcaPosToPvMin{"dcaPosToPvMin", 0.06, "DCA Pos To PV"}; + Configurable v0MassWindow{"v0MassWindow", 0.01, "V0 mass window"}; + Configurable cascadeMassWindow{"cascadeMassWindow", 0.01, "Cascade mass window"}; + Configurable applyTrkSelLf{"applyTrkSelLf", true, "Apply track selection for LF daughters"}; + + // limit charm baryon invariant mass spectrum + Configurable invMassCharmBaryonMin{"invMassCharmBaryonMin", 2.0, "Lower limit invariant mass spectrum charm baryon"}; // 2.4 Omegac0 only + Configurable invMassCharmBaryonMax{"invMassCharmBaryonMax", 3.1, "Upper limit invariant mass spectrum charm baryon"}; + + // kinematic selections + Configurable etaTrackCharmBachMax{"etaTrackCharmBachMax", 0.8, "Max absolute value of eta for charm baryon bachelor"}; + Configurable etaTrackLFDauMax{"etaTrackLFDauMax", 1.0, "Max absolute value of eta for V0 and cascade daughters"}; + Configurable ptPiFromCascMin{"ptPiFromCascMin", 0.15, "Min pT pion <- casc"}; + Configurable ptPiFromCharmBaryonMin{"ptPiFromCharmBaryonMin", 0.2, "Min pT pi <- charm baryon"}; + + Configurable impactParameterXYPiFromCharmBaryonMin{"impactParameterXYPiFromCharmBaryonMin", 0., "Min dcaxy pi from charm baryon track to PV"}; + Configurable impactParameterXYPiFromCharmBaryonMax{"impactParameterXYPiFromCharmBaryonMax", 10., "Max dcaxy pi from charm baryon track to PV"}; + Configurable impactParameterZPiFromCharmBaryonMin{"impactParameterZPiFromCharmBaryonMin", 0., "Min dcaz pi from charm baryon track to PV"}; + Configurable impactParameterZPiFromCharmBaryonMax{"impactParameterZPiFromCharmBaryonMax", 10., "Max dcaz pi from charm baryon track to PV"}; + + Configurable impactParameterXYCascMin{"impactParameterXYCascMin", 0., "Min dcaxy cascade track to PV"}; + Configurable impactParameterXYCascMax{"impactParameterXYCascMax", 10., "Max dcaxy cascade track to PV"}; + Configurable impactParameterZCascMin{"impactParameterZCascMin", 0., "Min dcaz cascade track to PV"}; + Configurable impactParameterZCascMax{"impactParameterZCascMax", 10., "Max dcaz cascade track to PV"}; + + Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; + Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; + + Configurable dcaCharmBaryonDauMax{"dcaCharmBaryonDauMax", 2.0, "Max DCA charm baryon daughters"}; + + // PID options + Configurable usePidTpcOnly{"usePidTpcOnly", false, "Perform PID using only TPC"}; + Configurable usePidTpcTofCombined{"usePidTpcTofCombined", true, "Perform PID using TPC & TOF"}; + + // PID - TPC selections + + Configurable ptPrPidTpcMin{"ptPrPidTpcMin", -1, "Lower bound of track pT for TPC PID for proton selection"}; + Configurable ptPrPidTpcMax{"ptPrPidTpcMax", 9999.9, "Upper bound of track pT for TPC PID for proton selection"}; + Configurable nSigmaTpcPrMax{"nSigmaTpcPrMax", 3., "Nsigma cut on TPC only for proton selection"}; + Configurable nSigmaTpcCombinedPrMax{"nSigmaTpcCombinedPrMax", 0., "Nsigma cut on TPC combined with TOF for proton selection"}; + + Configurable ptPiPidTpcMin{"ptPiPidTpcMin", -1, "Lower bound of track pT for TPC PID for pion selection"}; + Configurable ptPiPidTpcMax{"ptPiPidTpcMax", 9999.9, "Upper bound of track pT for TPC PID for pion selection"}; + Configurable nSigmaTpcPiMax{"nSigmaTpcPiMax", 3., "Nsigma cut on TPC only for pion selection"}; + Configurable nSigmaTpcCombinedPiMax{"nSigmaTpcCombinedPiMax", 0., "Nsigma cut on TPC combined with TOF for pion selection"}; + + // PID - TOF selections + + Configurable ptPrPidTofMin{"ptPrPidTofMin", -1, "Lower bound of track pT for TOF PID for proton selection"}; + Configurable ptPrPidTofMax{"ptPrPidTofMax", 9999.9, "Upper bound of track pT for TOF PID for proton selection"}; + Configurable nSigmaTofPrMax{"nSigmaTofPrMax", 3., "Nsigma cut on TOF only for proton selection"}; + Configurable nSigmaTofCombinedPrMax{"nSigmaTofCombinedPrMax", 0., "Nsigma cut on TOF combined with TPC for proton selection"}; + + Configurable ptPiPidTofMin{"ptPiPidTofMin", -1, "Lower bound of track pT for TOF PID for pion selection"}; + Configurable ptPiPidTofMax{"ptPiPidTofMax", 9999.9, "Upper bound of track pT for TOF PID for pion selection"}; + Configurable nSigmaTofPiMax{"nSigmaTofPiMax", 3., "Nsigma cut on TOF only for pion selection"}; + Configurable nSigmaTofCombinedPiMax{"nSigmaTofCombinedPiMax", 0., "Nsigma cut on TOF combined with TOF for pion selection"}; + + // detector clusters selections + Configurable nClustersTpcMin{"nClustersTpcMin", 70, "Minimum number of TPC clusters requirement"}; + Configurable nTpcCrossedRowsMin{"nTpcCrossedRowsMin", 70, "Minimum number of TPC crossed rows requirement"}; + Configurable tpcCrossedRowsOverFindableClustersRatioMin{"tpcCrossedRowsOverFindableClustersRatioMin", 0.8, "Minimum ratio TPC crossed rows over findable clusters requirement"}; + Configurable tpcChi2PerClusterMax{"tpcChi2PerClusterMax", 4, "Maximum value of chi2 fit over TPC clusters"}; + Configurable nClustersItsMin{"nClustersItsMin", 3, "Minimum number of ITS clusters requirement for pi <- charm baryon"}; + Configurable nClustersItsInnBarrMin{"nClustersItsInnBarrMin", 1, "Minimum number of ITS clusters in inner barrel requirement for pi <- charm baryon"}; + Configurable itsChi2PerClusterMax{"itsChi2PerClusterMax", 36, "Maximum value of chi2 fit over ITS clusters for pi <- charm baryon"}; + + TrackSelectorPr selectorProton; + TrackSelectorPi selectorPion; + + using TracksSel = soa::Join; + using TracksSelLf = soa::Join; + + HistogramRegistry registry{"registry"}; // for QA of selections + + OutputObj hInvMassCharmBaryon{TH1D("hInvMassCharmBaryon", "Charm baryon invariant mass;inv mass;entries", 500, 2.3, 3.1)}; + + void init(InitContext const&) + { + selectorProton.setRangePtTpc(ptPrPidTpcMin, ptPrPidTpcMax); + selectorProton.setRangeNSigmaTpc(-nSigmaTpcPrMax, nSigmaTpcPrMax); + selectorProton.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedPrMax, nSigmaTpcCombinedPrMax); + selectorProton.setRangePtTof(ptPrPidTofMin, ptPrPidTofMax); + selectorProton.setRangeNSigmaTof(-nSigmaTofPrMax, nSigmaTofPrMax); + selectorProton.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedPrMax, nSigmaTofCombinedPrMax); + + selectorPion.setRangePtTpc(ptPiPidTpcMin, ptPiPidTpcMax); + selectorPion.setRangeNSigmaTpc(-nSigmaTpcPiMax, nSigmaTpcPiMax); + selectorPion.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedPiMax, nSigmaTpcCombinedPiMax); + selectorPion.setRangePtTof(ptPiPidTofMin, ptPiPidTofMax); + selectorPion.setRangeNSigmaTof(-nSigmaTofPiMax, nSigmaTofPiMax); + selectorPion.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedPiMax, nSigmaTofCombinedPiMax); + + const AxisSpec axisSel{2, -0.5, 1.5, "status"}; + + registry.add("hSelPID", "hSelPID;status;entries", {HistType::kTH1D, {{12, 0., 12.}}}); + registry.add("hStatusCheck", "Check consecutive selections status;status;entries", {HistType::kTH1D, {{12, 0., 12.}}}); + + // for QA of the selections (bin 0 -> candidates that did not pass the selection, bin 1 -> candidates that passed the selection) + registry.add("hSelSignDec", "hSelSignDec;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelEtaPosV0Dau", "hSelEtaPosV0Dau;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelEtaNegV0Dau", "hSelEtaNegV0Dau;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelEtaPiFromCasc", "hSelEtaPiFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelEtaPiFromCharm", "hSelEtaPiFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelRadCasc", "hSelRadCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelRadV0", "hSelRadV0;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelCosPACasc", "hSelCosPACasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelCosPAV0", "hSelCosPAV0;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelDCACascDau", "hSelDCACascDau;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelDCAV0Dau", "hSelDCAV0Dau;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelDCACharmDau", "hSelDCACharmDau;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelDCAXYPrimPi", "hSelDCAXYPrimPi;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelDCAZPrimPi", "hSelDCAZPrimPi;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelDCAXYCasc", "hSelDCAXYCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelDCAZCasc", "hSelDCAZCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelPtPiFromCasc", "hSelPtPiFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelPtPiFromCharm", "hSelPtPiFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelTPCQualityPiFromCharm", "hSelTPCQualityPiFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelTPCQualityPiFromLam", "hSelTPCQualityPiFromLam;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelTPCQualityPrFromLam", "hSelTPCQualityPrFromLam;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelTPCQualityPiFromCasc", "hSelTPCQualityPiFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelITSQualityPiFromCharm", "hSelITSQualityPiFromCharm;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelMassLam", "hSelMassLam;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelMassCasc", "hSelMassCasc;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelMassCharmBaryon", "hSelMassCharmBaryon;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelDcaXYToPvV0Daughters", "hSelDcaXYToPvV0Daughters;status;entries", {HistType::kTH1D, {axisSel}}); + registry.add("hSelDcaXYToPvPiFromCasc", "hSelDcaXYToPvPiFromCasc;status;entries", {HistType::kTH1D, {axisSel}}); + } + + void process(aod::HfCandToXiPiKf const& candidates, + TracksSel const& tracks, + TracksSelLf const& lfTracks) + { + + // looping over charm baryon candidates + for (const auto& candidate : candidates) { + + bool resultSelections = true; // True if the candidate passes all the selections, False otherwise + + auto trackV0PosDauId = candidate.posTrackId(); // positive V0 daughter + auto trackV0NegDauId = candidate.negTrackId(); // negative V0 daughter + auto trackPiFromCascId = candidate.bachelorId(); // pion <- cascade + auto trackPiFromCharmId = candidate.bachelorFromCharmBaryonId(); // pion <- charm baryon + auto trackV0PosDau = lfTracks.rawIteratorAt(trackV0PosDauId); + auto trackV0NegDau = lfTracks.rawIteratorAt(trackV0NegDauId); + auto trackPiFromCasc = lfTracks.rawIteratorAt(trackPiFromCascId); + auto trackPiFromCharm = tracks.rawIteratorAt(trackPiFromCharmId); + + auto trackPiFromLam = trackV0NegDau; + auto trackPrFromLam = trackV0PosDau; + + int8_t signDecay = candidate.signDecay(); // sign of pi <- cascade + + if (signDecay > 0) { + trackPiFromLam = trackV0PosDau; + trackPrFromLam = trackV0NegDau; + registry.fill(HIST("hSelSignDec"), 1); // anti-particle decay + } else if (signDecay < 0) { + registry.fill(HIST("hSelSignDec"), 0); // particle decay + } + + // eta selection + double etaV0PosDau = candidate.etaV0PosDau(); + double etaV0NegDau = candidate.etaV0NegDau(); + double etaPiFromCasc = candidate.etaBachFromCasc(); + double etaPiFromCharmBaryon = candidate.etaBachFromCharmBaryon(); + if (std::abs(etaV0PosDau) > etaTrackLFDauMax) { + resultSelections = false; + registry.fill(HIST("hSelEtaPosV0Dau"), 0); + } else { + registry.fill(HIST("hSelEtaPosV0Dau"), 1); + } + if (std::abs(etaV0NegDau) > etaTrackLFDauMax) { + resultSelections = false; + registry.fill(HIST("hSelEtaNegV0Dau"), 0); + } else { + registry.fill(HIST("hSelEtaNegV0Dau"), 1); + } + if (std::abs(etaPiFromCasc) > etaTrackLFDauMax) { + resultSelections = false; + registry.fill(HIST("hSelEtaPiFromCasc"), 0); + } else { + registry.fill(HIST("hSelEtaPiFromCasc"), 1); + } + if (std::abs(etaPiFromCharmBaryon) > etaTrackCharmBachMax) { + resultSelections = false; + registry.fill(HIST("hSelEtaPiFromCharm"), 0); + } else { + registry.fill(HIST("hSelEtaPiFromCharm"), 1); + } + + // minimum radius cut (LFcut) + if (RecoDecay::sqrtSumOfSquares(candidate.xDecayVtxCascade(), candidate.yDecayVtxCascade()) < radiusCascMin) { + resultSelections = false; + registry.fill(HIST("hSelRadCasc"), 0); + } else { + registry.fill(HIST("hSelRadCasc"), 1); + } + if (RecoDecay::sqrtSumOfSquares(candidate.xDecayVtxV0(), candidate.yDecayVtxV0()) < radiusV0Min) { + resultSelections = false; + registry.fill(HIST("hSelRadV0"), 0); + } else { + registry.fill(HIST("hSelRadV0"), 1); + } + + // cosPA (LFcut) + if (candidate.cosPACasc() < cosPACascMin) { + resultSelections = false; + registry.fill(HIST("hSelCosPACasc"), 0); + } else { + registry.fill(HIST("hSelCosPACasc"), 1); + } + if (candidate.cosPAV0() < cosPAV0Min) { + resultSelections = false; + registry.fill(HIST("hSelCosPAV0"), 0); + } else { + registry.fill(HIST("hSelCosPAV0"), 1); + } + + // cascade and v0 daughters dca cut (LF cut) + if (candidate.dcaCascDau() > dcaCascDauMax) { + resultSelections = false; + registry.fill(HIST("hSelDCACascDau"), 0); + } else { + registry.fill(HIST("hSelDCACascDau"), 1); + } + + if (candidate.dcaV0Dau() > dcaV0DauMax) { + resultSelections = false; + registry.fill(HIST("hSelDCAV0Dau"), 0); + } else { + registry.fill(HIST("hSelDCAV0Dau"), 1); + } + + // dca charm baryon daughters cut + if (candidate.dcaCharmBaryonDau() > dcaCharmBaryonDauMax) { + resultSelections = false; + registry.fill(HIST("hSelDCACharmDau"), 0); + } else { + registry.fill(HIST("hSelDCACharmDau"), 1); + } + + // dcaXY v0 daughters to PV cut + if (std::abs(candidate.dcaXYToPvV0Dau0()) < dcaPosToPvMin || std::abs(candidate.dcaXYToPvV0Dau1()) < dcaNegToPvMin) { + resultSelections = false; + registry.fill(HIST("hSelDcaXYToPvV0Daughters"), 0); + } else { + registry.fill(HIST("hSelDcaXYToPvV0Daughters"), 1); + } + + // dcaXY ka <-- cascade to PV cut + if (std::abs(candidate.dcaXYToPvCascDau()) < dcaBachToPvMin) { + resultSelections = false; + registry.fill(HIST("hSelDcaXYToPvPiFromCasc"), 0); + } else { + registry.fill(HIST("hSelDcaXYToPvPiFromCasc"), 1); + } + + // cut on charm bachelor pion dcaXY and dcaZ + if ((std::abs(candidate.impactParBachFromCharmBaryonXY()) < impactParameterXYPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonXY()) > impactParameterXYPiFromCharmBaryonMax)) { + resultSelections = false; + registry.fill(HIST("hSelDCAXYPrimPi"), 0); + } else { + registry.fill(HIST("hSelDCAXYPrimPi"), 1); + } + if ((std::abs(candidate.impactParBachFromCharmBaryonZ()) < impactParameterZPiFromCharmBaryonMin) || (std::abs(candidate.impactParBachFromCharmBaryonZ()) > impactParameterZPiFromCharmBaryonMax)) { + resultSelections = false; + registry.fill(HIST("hSelDCAZPrimPi"), 0); + } else { + registry.fill(HIST("hSelDCAZPrimPi"), 1); + } + + // cut on cascade dcaXY and dcaZ + if ((std::abs(candidate.impactParCascXY()) < impactParameterXYCascMin) || (std::abs(candidate.impactParCascXY()) > impactParameterXYCascMax)) { + resultSelections = false; + registry.fill(HIST("hSelDCAXYCasc"), 0); + } else { + registry.fill(HIST("hSelDCAXYCasc"), 1); + } + if ((std::abs(candidate.impactParCascZ()) < impactParameterZCascMin) || (std::abs(candidate.impactParCascZ()) > impactParameterZCascMax)) { + resultSelections = false; + registry.fill(HIST("hSelDCAZCasc"), 0); + } else { + registry.fill(HIST("hSelDCAZCasc"), 1); + } + + // pT selections + double ptPiFromCasc = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCasc(), candidate.pyBachFromCasc()); + double ptPiFromCharmBaryon = RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()); + if (std::abs(ptPiFromCasc) < ptPiFromCascMin) { + resultSelections = false; + registry.fill(HIST("hSelPtPiFromCasc"), 0); + } else { + registry.fill(HIST("hSelPtPiFromCasc"), 1); + } + if (std::abs(ptPiFromCharmBaryon) < ptPiFromCharmBaryonMin) { + resultSelections = false; + registry.fill(HIST("hSelPtPiFromCharm"), 0); + } else { + registry.fill(HIST("hSelPtPiFromCharm"), 1); + } + + // TPC clusters selections + if (applyTrkSelLf) { + if (!isSelectedTrackTpcQuality(trackPiFromLam, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { + resultSelections = false; + registry.fill(HIST("hSelTPCQualityPiFromLam"), 0); + } else { + registry.fill(HIST("hSelTPCQualityPiFromLam"), 1); + } + if (!isSelectedTrackTpcQuality(trackPrFromLam, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { + resultSelections = false; + registry.fill(HIST("hSelTPCQualityPrFromLam"), 0); + } else { + registry.fill(HIST("hSelTPCQualityPrFromLam"), 1); + } + if (!isSelectedTrackTpcQuality(trackPiFromCasc, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { + resultSelections = false; + registry.fill(HIST("hSelTPCQualityPiFromCasc"), 0); + } else { + registry.fill(HIST("hSelTPCQualityPiFromCasc"), 1); + } + } + if (!isSelectedTrackTpcQuality(trackPiFromCharm, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { + resultSelections = false; + registry.fill(HIST("hSelTPCQualityPiFromCharm"), 0); + } else { + registry.fill(HIST("hSelTPCQualityPiFromCharm"), 1); + } + + // ITS clusters selection + if (!isSelectedTrackItsQuality(trackPiFromCharm, nClustersItsMin, itsChi2PerClusterMax) || trackPiFromCharm.itsNClsInnerBarrel() < nClustersItsInnBarrMin) { + resultSelections = false; + registry.fill(HIST("hSelITSQualityPiFromCharm"), 0); + } else { + registry.fill(HIST("hSelITSQualityPiFromCharm"), 1); + } + + // track-level PID selection + + // for TrackSelectorPID + int statusPidPrFromLam = -999; + int statusPidPiFromLam = -999; + int statusPidPiFromCasc = -999; + int statusPidPiFromCharmBaryon = -999; + + bool statusPidLambda = false; + bool statusPidCascade = false; + bool statusPidCharmBaryon = false; + + int infoTpcStored = 0; + int infoTofStored = 0; + + if (usePidTpcOnly == usePidTpcTofCombined) { + LOGF(fatal, "Check the PID configurables, usePidTpcOnly and usePidTpcTofCombined can't have the same value"); + } + + if (trackPiFromLam.hasTPC()) { + SETBIT(infoTpcStored, kPiFromLam); + } + if (trackPrFromLam.hasTPC()) { + SETBIT(infoTpcStored, kPrFromLam); + } + if (trackPiFromCasc.hasTPC()) { + SETBIT(infoTpcStored, kPiFromCasc); + } + if (trackPiFromCharm.hasTPC()) { + SETBIT(infoTpcStored, kPiFromCharm); + } + if (trackPiFromLam.hasTOF()) { + SETBIT(infoTofStored, kPiFromLam); + } + if (trackPrFromLam.hasTOF()) { + SETBIT(infoTofStored, kPrFromLam); + } + if (trackPiFromCasc.hasTOF()) { + SETBIT(infoTofStored, kPiFromCasc); + } + if (trackPiFromCharm.hasTOF()) { + SETBIT(infoTofStored, kPiFromCharm); + } + + if (usePidTpcOnly) { + statusPidPrFromLam = selectorProton.statusTpc(trackPrFromLam); + statusPidPiFromLam = selectorPion.statusTpc(trackPiFromLam); + statusPidPiFromCasc = selectorPion.statusTpc(trackPiFromCasc); + statusPidPiFromCharmBaryon = selectorPion.statusTpc(trackPiFromCharm); + } else if (usePidTpcTofCombined) { + statusPidPrFromLam = selectorProton.statusTpcOrTof(trackPrFromLam); + statusPidPiFromLam = selectorPion.statusTpcOrTof(trackPiFromLam); + statusPidPiFromCasc = selectorPion.statusTpcOrTof(trackPiFromCasc); + statusPidPiFromCharmBaryon = selectorPion.statusTpcOrTof(trackPiFromCharm); + } + + if (statusPidPrFromLam == TrackSelectorPID::Accepted && statusPidPiFromLam == TrackSelectorPID::Accepted) { + statusPidLambda = true; + if (resultSelections) { + registry.fill(HIST("hStatusCheck"), 0.5); + } + } + + if (statusPidPrFromLam == TrackSelectorPID::Accepted && statusPidPiFromLam == TrackSelectorPID::Accepted && statusPidPiFromCasc == TrackSelectorPID::Accepted) { + statusPidCascade = true; + if (resultSelections) { + registry.fill(HIST("hStatusCheck"), 1.5); + } + } + + if (statusPidPrFromLam == TrackSelectorPID::Accepted && statusPidPiFromLam == TrackSelectorPID::Accepted && statusPidPiFromCasc == TrackSelectorPID::Accepted && statusPidPiFromCharmBaryon == TrackSelectorPID::Accepted) { + statusPidCharmBaryon = true; + if (resultSelections) { + registry.fill(HIST("hStatusCheck"), 2.5); + } + } + + // invariant mass cuts + bool statusInvMassLambda = false; + bool statusInvMassCascade = false; + bool statusInvMassCharmBaryon = false; + + double invMassLambda = candidate.invMassLambda(); + double invMassCascade = candidate.invMassCascade(); + double invMassCharmBaryon = candidate.invMassCharmBaryon(); + + if (std::abs(invMassLambda - o2::constants::physics::MassLambda0) < v0MassWindow) { + statusInvMassLambda = true; + registry.fill(HIST("hSelMassLam"), 1); + if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && resultSelections) { + registry.fill(HIST("hStatusCheck"), 3.5); + } + } else { + registry.fill(HIST("hSelMassLam"), 0); + } + + if (std::abs(invMassCascade - o2::constants::physics::MassXiMinus) < cascadeMassWindow) { + statusInvMassCascade = true; + registry.fill(HIST("hSelMassCasc"), 1); + if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && statusInvMassLambda && resultSelections) { + registry.fill(HIST("hStatusCheck"), 4.5); + } + } else { + registry.fill(HIST("hSelMassCasc"), 0); + } + + if ((invMassCharmBaryon >= invMassCharmBaryonMin) && (invMassCharmBaryon <= invMassCharmBaryonMax)) { + statusInvMassCharmBaryon = true; + registry.fill(HIST("hSelMassCharmBaryon"), 1); + if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && statusInvMassLambda && statusInvMassCascade && resultSelections) { + registry.fill(HIST("hStatusCheck"), 5.5); + } + } else { + registry.fill(HIST("hSelMassCharmBaryon"), 0); + } + + hfSelToXiPi(statusPidCharmBaryon, statusPidCascade, statusPidLambda, statusInvMassCharmBaryon, statusInvMassCascade, statusInvMassLambda, resultSelections, infoTpcStored, infoTofStored, + trackPiFromCharm.tpcNSigmaPi(), trackPiFromCasc.tpcNSigmaPi(), trackPiFromLam.tpcNSigmaPi(), trackPrFromLam.tpcNSigmaPr(), + trackPiFromCharm.tofNSigmaPi(), trackPiFromCasc.tofNSigmaPi(), trackPiFromLam.tofNSigmaPi(), trackPrFromLam.tofNSigmaPr()); + + if (resultSelections) { + if (!statusPidLambda) { + registry.fill(HIST("hSelPID"), 0.5); + } + if (statusPidLambda) { + registry.fill(HIST("hSelPID"), 1.5); + } + if (!statusPidCascade) { + registry.fill(HIST("hSelPID"), 2.5); + } + if (statusPidCascade) { + registry.fill(HIST("hSelPID"), 3.5); + } + if (!statusPidCharmBaryon) { + registry.fill(HIST("hSelPID"), 4.5); + } + if (statusPidCharmBaryon) { + registry.fill(HIST("hSelPID"), 5.5); + } + if (!statusInvMassLambda) { + registry.fill(HIST("hSelPID"), 6.5); + } + if (statusInvMassLambda) { + registry.fill(HIST("hSelPID"), 7.5); + } + if (!statusInvMassCascade) { + registry.fill(HIST("hSelPID"), 8.5); + } + if (statusInvMassCascade) { + registry.fill(HIST("hSelPID"), 9.5); + } + if (!statusInvMassCharmBaryon) { + registry.fill(HIST("hSelPID"), 10.5); + } + if (statusInvMassCharmBaryon) { + registry.fill(HIST("hSelPID"), 11.5); + } + } + + if (statusPidLambda && statusPidCascade && statusPidCharmBaryon && statusInvMassLambda && statusInvMassCascade && statusInvMassCharmBaryon && resultSelections) { + hInvMassCharmBaryon->Fill(invMassCharmBaryon); + } + } + } // end process +}; // end struct + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx new file mode 100644 index 00000000000..7cbc71277e5 --- /dev/null +++ b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx @@ -0,0 +1,231 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file treeCreatorToXiPi.cxx +/// \brief Writer of the xic0 to Xi Pi candidates in the form of flat tables to be stored in TTrees. +/// In this file are defined and filled the output tables +/// +/// \author Ran Tu , Fudan University + +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "Common/Core/RecoDecay.h" + +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" + +using namespace o2; +using namespace o2::framework; + +namespace o2::aod +{ +namespace full +{ +DECLARE_SOA_COLUMN(InvMassLambda, invMassLambda, float); +DECLARE_SOA_COLUMN(InvMassCascade, invMassCascade, float); +DECLARE_SOA_COLUMN(InvMassCharmBaryon, invMassCharmBaryon, float); +DECLARE_SOA_COLUMN(DcaXYToPvV0Dau0, dcaXYToPvV0Dau0, float); +DECLARE_SOA_COLUMN(DcaXYToPvV0Dau1, dcaXYToPvV0Dau1, float); +DECLARE_SOA_COLUMN(DcaXYToPvCascDau, dcaXYToPvCascDau, float); +DECLARE_SOA_COLUMN(DcaCascDau, dcaCascDau, float); +DECLARE_SOA_COLUMN(DcaCharmBaryonDau, dcaCharmBaryonDau, float); +// from creator - MC +DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level +DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int8_t); // debug flag for mis-association reconstruction level +DECLARE_SOA_COLUMN(OriginRec, originRec, int8_t); +DECLARE_SOA_COLUMN(CollisionMatched, collisionMatched, bool); +// from selector +DECLARE_SOA_COLUMN(TpcNSigmaPiFromCharmBaryon, tpcNSigmaPiFromCharmBaryon, float); +DECLARE_SOA_COLUMN(TpcNSigmaPiFromCasc, tpcNSigmaPiFromCasc, float); +DECLARE_SOA_COLUMN(TpcNSigmaPiFromLambda, tpcNSigmaPiFromLambda, float); +DECLARE_SOA_COLUMN(TpcNSigmaPrFromLambda, tpcNSigmaPrFromLambda, float); +DECLARE_SOA_COLUMN(TofNSigmaPiFromCharmBaryon, tofNSigmaPiFromCharmBaryon, float); +DECLARE_SOA_COLUMN(TofNSigmaPiFromCasc, tofNSigmaPiFromCasc, float); +DECLARE_SOA_COLUMN(TofNSigmaPiFromLambda, tofNSigmaPiFromLambda, float); +DECLARE_SOA_COLUMN(TofNSigmaPrFromLambda, tofNSigmaPrFromLambda, float); +// from creator KF +DECLARE_SOA_COLUMN(KfDcaXYPiFromXic, kfDcaXYPiFromXic, float); +DECLARE_SOA_COLUMN(KfDcaXYCascToPv, kfDcaXYCascToPv, float); +DECLARE_SOA_COLUMN(Chi2GeoV0, chi2GeoV0, float); +DECLARE_SOA_COLUMN(Chi2GeoCasc, chi2GeoCasc, float); +DECLARE_SOA_COLUMN(Chi2GeoXic, chi2GeoXic, float); +DECLARE_SOA_COLUMN(Chi2MassV0, chi2MassV0, float); +DECLARE_SOA_COLUMN(Chi2MassCasc, chi2MassCasc, float); +DECLARE_SOA_COLUMN(V0ldl, v0ldl, float); +DECLARE_SOA_COLUMN(Cascldl, cascldl, float); +DECLARE_SOA_COLUMN(Xicldl, xicldl, float); +DECLARE_SOA_COLUMN(Chi2TopoV0ToPv, chi2TopoV0ToPv, float); +DECLARE_SOA_COLUMN(Chi2TopoCascToPv, chi2TopoCascToPv, float); +DECLARE_SOA_COLUMN(Chi2TopoPiFromXicToPv, chi2TopoPiFromXicToPv, float); +DECLARE_SOA_COLUMN(Chi2TopoXicToPv, chi2TopoXicToPv, float); +DECLARE_SOA_COLUMN(Chi2TopoV0ToCasc, chi2TopoV0ToCasc, float); +DECLARE_SOA_COLUMN(Chi2TopoCascToXic, chi2TopoCascToXic, float); +DECLARE_SOA_COLUMN(DecayLenXYLambda, decayLenXYLambda, float); +DECLARE_SOA_COLUMN(DecayLenXYCasc, decayLenXYCasc, float); +DECLARE_SOA_COLUMN(DecayLenXYXic, decayLenXYXic, float); +DECLARE_SOA_COLUMN(CosPaV0ToCasc, cosPaV0ToCasc, float); +DECLARE_SOA_COLUMN(CosPaV0ToPv, cosPaV0ToPv, float); +DECLARE_SOA_COLUMN(CosPaCascToXic, cosPaCascToXic, float); +DECLARE_SOA_COLUMN(CosPaCascToPv, cosPaCascToPv, float); +DECLARE_SOA_COLUMN(CosPaXicToPv, cosPaXicToPv, float); +DECLARE_SOA_COLUMN(KfRapXic, kfRapXic, float); +DECLARE_SOA_COLUMN(KfptPiFromXic, kfptPiFromXic, float); +DECLARE_SOA_COLUMN(KfptXic, kfptXic, float); +DECLARE_SOA_COLUMN(CosThetaStarPiFromXic, cosThetaStarPiFromXic, float); +DECLARE_SOA_COLUMN(CtXic, ctXic, float); +DECLARE_SOA_COLUMN(EtaXic, etaXic, float); +DECLARE_SOA_COLUMN(V0Ndf, v0Ndf, float); +DECLARE_SOA_COLUMN(CascNdf, cascNdf, float); +DECLARE_SOA_COLUMN(XicNdf, xicNdf, float); +DECLARE_SOA_COLUMN(MassV0Ndf, massV0Ndf, float); +DECLARE_SOA_COLUMN(MassCascNdf, massCascNdf, float); +DECLARE_SOA_COLUMN(V0Chi2OverNdf, v0Chi2OverNdf, float); +DECLARE_SOA_COLUMN(CascChi2OverNdf, cascChi2OverNdf, float); +DECLARE_SOA_COLUMN(XicChi2OverNdf, xicChi2OverNdf, float); +DECLARE_SOA_COLUMN(MassV0Chi2OverNdf, massV0Chi2OverNdf, float); +DECLARE_SOA_COLUMN(MassCascChi2OverNdf, massCascChi2OverNdf, float); + +} // namespace full + +DECLARE_SOA_TABLE(HfKfXicFulls, "AOD", "HFKFXICFULL", + full::TpcNSigmaPiFromCharmBaryon, full::TofNSigmaPiFromCharmBaryon, full::TpcNSigmaPiFromCasc, full::TofNSigmaPiFromCasc, + full::TpcNSigmaPiFromLambda, full::TofNSigmaPiFromLambda, full::TpcNSigmaPrFromLambda, full::TofNSigmaPrFromLambda, + full::KfDcaXYPiFromXic, full::DcaCascDau, full::DcaCharmBaryonDau, full::KfDcaXYCascToPv, + full::DcaXYToPvV0Dau0, full::DcaXYToPvV0Dau1, full::DcaXYToPvCascDau, + full::Chi2GeoV0, full::Chi2GeoCasc, full::Chi2GeoXic, + full::Chi2MassV0, full::Chi2MassCasc, + full::V0ldl, full::Cascldl, full::Xicldl, + full::Chi2TopoV0ToPv, full::Chi2TopoCascToPv, full::Chi2TopoPiFromXicToPv, full::Chi2TopoXicToPv, + full::Chi2TopoV0ToCasc, full::Chi2TopoCascToXic, + full::DecayLenXYLambda, full::DecayLenXYCasc, full::DecayLenXYXic, + full::CosPaV0ToCasc, full::CosPaV0ToPv, full::CosPaCascToXic, full::CosPaCascToPv, full::CosPaXicToPv, + full::InvMassLambda, full::InvMassCascade, full::InvMassCharmBaryon, + full::KfRapXic, full::KfptPiFromXic, full::KfptXic, + full::CosThetaStarPiFromXic, full::CtXic, full::EtaXic, + full::V0Ndf, full::CascNdf, full::XicNdf, + full::MassV0Ndf, full::MassCascNdf, + full::V0Chi2OverNdf, full::CascChi2OverNdf, full::XicChi2OverNdf, + full::MassV0Chi2OverNdf, full::MassCascChi2OverNdf, + full::FlagMcMatchRec, full::DebugMcRec, full::OriginRec, full::CollisionMatched); + +} // namespace o2::aod + +/// Writes the full information in an output TTree +struct HfTreeCreatorXic0ToXiPiKf { + + Produces rowKfCandidate; + + Configurable zPvCut{"zPvCut", 10., "Cut on absolute value of primary vertex z coordinate"}; + + using MyTrackTable = soa::Join; + + void init(InitContext const&) + { + } + + template + void fillKfCandidate(const T& candidate, int8_t flagMc, int8_t debugMc, int8_t originMc, bool collisionMatched) + { + + if (candidate.resultSelections() && candidate.statusPidCharmBaryon() && candidate.statusInvMassLambda() && candidate.statusInvMassCascade() && candidate.statusInvMassCharmBaryon()) { + + rowKfCandidate( + candidate.tpcNSigmaPiFromCharmBaryon(), + candidate.tofNSigmaPiFromCharmBaryon(), + candidate.tpcNSigmaPiFromCasc(), + candidate.tofNSigmaPiFromCasc(), + candidate.tpcNSigmaPiFromLambda(), + candidate.tofNSigmaPiFromLambda(), + candidate.tpcNSigmaPrFromLambda(), + candidate.tofNSigmaPrFromLambda(), + candidate.kfDcaXYPiFromXic(), + candidate.dcaCascDau(), + candidate.dcaCharmBaryonDau(), + candidate.kfDcaXYCascToPv(), + candidate.dcaXYToPvV0Dau0(), + candidate.dcaXYToPvV0Dau1(), + candidate.dcaXYToPvCascDau(), + candidate.chi2GeoV0(), + candidate.chi2GeoCasc(), + candidate.chi2GeoXic(), + candidate.chi2MassV0(), + candidate.chi2MassCasc(), + candidate.v0ldl(), + candidate.cascldl(), + candidate.xicldl(), + candidate.chi2TopoV0ToPv(), + candidate.chi2TopoCascToPv(), + candidate.chi2TopoPiFromXicToPv(), + candidate.chi2TopoXicToPv(), + candidate.chi2TopoV0ToCasc(), + candidate.chi2TopoCascToXic(), + candidate.decayLenXYLambda(), + candidate.decayLenXYCasc(), + candidate.decayLenXYXic(), + candidate.cosPaV0ToCasc(), + candidate.cosPAV0(), + candidate.cosPaCascToXic(), + candidate.cosPACasc(), + candidate.cosPACharmBaryon(), + candidate.invMassLambda(), + candidate.invMassCascade(), + candidate.invMassCharmBaryon(), + candidate.kfRapXic(), + candidate.kfptPiFromXic(), + candidate.kfptXic(), + candidate.cosThetaStarPiFromXic(), + candidate.ctauXic(), + candidate.etaCharmBaryon(), + candidate.v0Ndf(), + candidate.cascNdf(), + candidate.xicNdf(), + candidate.massV0Ndf(), + candidate.massCascNdf(), + candidate.v0Chi2OverNdf(), + candidate.cascChi2OverNdf(), + candidate.xicChi2OverNdf(), + candidate.massV0Chi2OverNdf(), + candidate.massCascChi2OverNdf(), + flagMc, + debugMc, + originMc, + collisionMatched); + } + } + + void processKfData(MyTrackTable const&, + soa::Join const& candidates) + { + rowKfCandidate.reserve(candidates.size()); + for (const auto& candidate : candidates) { + fillKfCandidate(candidate, -7, -7, RecoDecay::OriginType::None, false); + } + } + PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfData, "Process KF data", false); + + void processKfMcXic0(MyTrackTable const&, + soa::Join const& candidates) + { + rowKfCandidate.reserve(candidates.size()); + for (const auto& candidate : candidates) { + fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originRec(), candidate.collisionMatched()); + } + } + PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMcXic0, "Process MC with information for xic0", false); + +}; // end of struct + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 37f1e27bb5aeb64ed46ea6dae7eafc1f09141a1f Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Mon, 16 Dec 2024 14:33:09 +0100 Subject: [PATCH 403/459] [PWGLF] separating pair combination (#8995) Co-authored-by: junleekim Co-authored-by: junleekim --- PWGLF/Tasks/Strangeness/lambdalambda.cxx | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdalambda.cxx b/PWGLF/Tasks/Strangeness/lambdalambda.cxx index 320b98db6d1..e974b812990 100644 --- a/PWGLF/Tasks/Strangeness/lambdalambda.cxx +++ b/PWGLF/Tasks/Strangeness/lambdalambda.cxx @@ -149,15 +149,15 @@ struct lambdalambda { AxisSpec PVzQaAxis = {300, -15.0, 15.0}; AxisSpec combAxis = {3, -0.5, 2.5}; - histos.add("Radius_V0V0_full", "", {HistType::kTH3F, {massAxis, ptAxis, RadiusAxis}}); - histos.add("CPA_V0V0_full", "", {HistType::kTH3F, {massAxis, ptAxis, CPAAxis}}); - histos.add("Distance_V0V0_full", "", {HistType::kTH3F, {massAxis, ptAxis, DistanceAxis}}); - histos.add("DCA_V0V0_full", "", {HistType::kTH3F, {massAxis, ptAxis, DCAAxis}}); + histos.add("Radius_V0V0_full", "", {HistType::kTHnSparseF, {massAxis, ptAxis, RadiusAxis, combAxis}}); + histos.add("CPA_V0V0_full", "", {HistType::kTHnSparseF, {massAxis, ptAxis, CPAAxis, combAxis}}); + histos.add("Distance_V0V0_full", "", {HistType::kTHnSparseF, {massAxis, ptAxis, DistanceAxis, combAxis}}); + histos.add("DCA_V0V0_full", "", {HistType::kTHnSparseF, {massAxis, ptAxis, DCAAxis, combAxis}}); - histos.add("Radius_V0V0_sel", "", {HistType::kTH3F, {massAxis, ptAxis, RadiusAxis}}); - histos.add("CPA_V0V0_sel", "", {HistType::kTH3F, {massAxis, ptAxis, CPAAxis}}); - histos.add("Distance_V0V0_sel", "", {HistType::kTH3F, {massAxis, ptAxis, DistanceAxis}}); - histos.add("DCA_V0V0_sel", "", {HistType::kTH3F, {massAxis, ptAxis, DCAAxis}}); + histos.add("Radius_V0V0_sel", "", {HistType::kTHnSparseF, {massAxis, ptAxis, RadiusAxis, combAxis}}); + histos.add("CPA_V0V0_sel", "", {HistType::kTHnSparseF, {massAxis, ptAxis, CPAAxis, combAxis}}); + histos.add("Distance_V0V0_sel", "", {HistType::kTHnSparseF, {massAxis, ptAxis, DistanceAxis, combAxis}}); + histos.add("DCA_V0V0_sel", "", {HistType::kTHnSparseF, {massAxis, ptAxis, DCAAxis, combAxis}}); histos.add("h_InvMass_same", "", {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, combAxis}}); histos.add("h_InvMass_mixed", "", {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, combAxis}}); @@ -300,8 +300,8 @@ struct lambdalambda { float getCPA(V01 const& v01, V02 const& v02) { ROOT::Math::XYZVector v01mom, v02mom; - v01mom.SetXYZ(v01.px(), v01.py(), v01.pz()); - v02mom.SetXYZ(v02.px(), v02.py(), v02.pz()); + v01mom.SetXYZ(v01.px() / v01.p(), v01.py() / v01.p(), v01.pz() / v01.p()); + v02mom.SetXYZ(v02.px() / v02.p(), v02.py() / v02.p(), v02.pz() / v02.p()); return v01mom.Dot(v02mom); } @@ -415,16 +415,16 @@ struct lambdalambda { if (std::abs(RecoV0V0.Rapidity()) > cfgV0V0RapMax) continue; - histos.fill(HIST("Radius_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getRadius(v01, v02)); - histos.fill(HIST("CPA_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getCPA(v01, v02)); - histos.fill(HIST("Distance_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getDistance(v01, v02)); - histos.fill(HIST("DCA_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getDCAofV0V0(v01, v02)); + histos.fill(HIST("Radius_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getRadius(v01, v02), V01Tag + V02Tag); + histos.fill(HIST("CPA_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getCPA(v01, v02), V01Tag + V02Tag); + histos.fill(HIST("Distance_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getDistance(v01, v02), V01Tag + V02Tag); + histos.fill(HIST("DCA_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getDCAofV0V0(v01, v02), V01Tag + V02Tag); if (isSelectedV0V0(v01, v02)) { - histos.fill(HIST("Radius_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getRadius(v01, v02)); - histos.fill(HIST("CPA_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getCPA(v01, v02)); - histos.fill(HIST("Distance_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getDistance(v01, v02)); - histos.fill(HIST("DCA_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getDCAofV0V0(v01, v02)); + histos.fill(HIST("Radius_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getRadius(v01, v02), V01Tag + V02Tag); + histos.fill(HIST("CPA_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getCPA(v01, v02), V01Tag + V02Tag); + histos.fill(HIST("Distance_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getDistance(v01, v02), V01Tag + V02Tag); + histos.fill(HIST("DCA_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getDCAofV0V0(v01, v02), V01Tag + V02Tag); } if (cfgV0V0Sel && !isSelectedV0V0(v01, v02)) From 140f2f9aac56a41dc4cdb1ef2319678ab4af7b1d Mon Sep 17 00:00:00 2001 From: syano0822 <32352856+syano0822@users.noreply.github.com> Date: Mon, 16 Dec 2024 22:49:28 +0900 Subject: [PATCH 404/459] =?UTF-8?q?[Common]=20MC=20information=20fuction?= =?UTF-8?q?=20is=20added=20into=20Common/TableProducer/match-mft-m?= =?UTF-8?q?=E2=80=A6=20(#9004)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Satoshi Yano --- Common/DataModel/MatchMFTMuonData.h | 135 ++ Common/TableProducer/CMakeLists.txt | 5 + .../TableProducer/match-mft-mch-data-mc.cxx | 881 +++++++++++ Common/TableProducer/match-mft-mch-data.cxx | 1323 +++++++++-------- 4 files changed, 1688 insertions(+), 656 deletions(-) create mode 100644 Common/DataModel/MatchMFTMuonData.h create mode 100644 Common/TableProducer/match-mft-mch-data-mc.cxx diff --git a/Common/DataModel/MatchMFTMuonData.h b/Common/DataModel/MatchMFTMuonData.h new file mode 100644 index 00000000000..d1b59dc168c --- /dev/null +++ b/Common/DataModel/MatchMFTMuonData.h @@ -0,0 +1,135 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#ifndef COMMON_DATAMODEL_MATCHMFTMUONDATA_H_ +#define COMMON_DATAMODEL_MATCHMFTMUONDATA_H_ +#include "Framework/AnalysisDataModel.h" +#endif // COMMON_DATAMODEL_MATCHMFTMUONDATA_H_ + +namespace o2::aod +{ +namespace matching_params +{ +// matching parameters +DECLARE_SOA_COLUMN(DeltaPt, mDeltaPt, float); +DECLARE_SOA_COLUMN(DeltaEta, mDeltaEta, float); +DECLARE_SOA_COLUMN(DeltaPhi, mDeltaPhi, float); +DECLARE_SOA_COLUMN(DeltaX, mDeltaX, float); +DECLARE_SOA_COLUMN(DeltaY, mDeltaY, float); +DECLARE_SOA_COLUMN(GMuonPt, mGMuonPt, float); +DECLARE_SOA_COLUMN(GMuonEta, mGMuonEta, float); +DECLARE_SOA_COLUMN(PairQ, mPairQ, int16_t); +DECLARE_SOA_COLUMN(IsCorrectMatch, mIsCorrectMatch, bool); +} // namespace matching_params + +DECLARE_SOA_TABLE(MatchParams, "AOD", "MATCHING", + matching_params::GMuonPt, + matching_params::GMuonEta, + matching_params::PairQ, + matching_params::DeltaPt, + matching_params::DeltaX, + matching_params::DeltaY, + matching_params::DeltaEta, + matching_params::DeltaPhi, + matching_params::IsCorrectMatch); + +namespace tag_matching_params +{ +// matching parameters +DECLARE_SOA_COLUMN(DeltaPt, mDeltaPt, float); +DECLARE_SOA_COLUMN(DeltaEta, mDeltaEta, float); +DECLARE_SOA_COLUMN(DeltaPhi, mDeltaPhi, float); +DECLARE_SOA_COLUMN(DeltaX, mDeltaX, float); +DECLARE_SOA_COLUMN(DeltaY, mDeltaY, float); +DECLARE_SOA_COLUMN(GMuonPt, mGMuonPt, float); +DECLARE_SOA_COLUMN(GMuonEta, mGMuonEta, float); +DECLARE_SOA_COLUMN(PairQ, mPairQ, int16_t); +DECLARE_SOA_COLUMN(IsCorrectMatch, mIsCorrectMatch, bool); +} // namespace tag_matching_params + +DECLARE_SOA_TABLE(TagMatchParams, "AOD", "TAGMATCHING", + tag_matching_params::GMuonPt, + tag_matching_params::GMuonEta, + tag_matching_params::PairQ, + tag_matching_params::DeltaPt, + tag_matching_params::DeltaX, + tag_matching_params::DeltaY, + tag_matching_params::DeltaEta, + tag_matching_params::DeltaPhi, + tag_matching_params::IsCorrectMatch); + +namespace probe_matching_params +{ +// matching parameters +DECLARE_SOA_COLUMN(DeltaPt, mDeltaPt, float); +DECLARE_SOA_COLUMN(DeltaEta, mDeltaEta, float); +DECLARE_SOA_COLUMN(DeltaPhi, mDeltaPhi, float); +DECLARE_SOA_COLUMN(DeltaX, mDeltaX, float); +DECLARE_SOA_COLUMN(DeltaY, mDeltaY, float); +DECLARE_SOA_COLUMN(TagGMuonPt, mTagGMuonPt, float); +DECLARE_SOA_COLUMN(GMuonPt, mGMuonPt, float); +DECLARE_SOA_COLUMN(GMuonEta, mGMuonEta, float); +DECLARE_SOA_COLUMN(PairQ, mPairQ, int16_t); +DECLARE_SOA_COLUMN(IsCorrectMatch, mIsCorrectMatch, bool); +} // namespace probe_matching_params + +DECLARE_SOA_TABLE(ProbeMatchParams, "AOD", "PROBEMATCHING", + probe_matching_params::TagGMuonPt, + probe_matching_params::GMuonPt, + probe_matching_params::GMuonEta, + probe_matching_params::PairQ, + probe_matching_params::DeltaPt, + probe_matching_params::DeltaX, + probe_matching_params::DeltaY, + probe_matching_params::DeltaEta, + probe_matching_params::DeltaPhi, + probe_matching_params::IsCorrectMatch); + +namespace mix_matching_params +{ +// matching parameters +DECLARE_SOA_COLUMN(DeltaPt, mDeltaPt, float); +DECLARE_SOA_COLUMN(DeltaEta, mDeltaEta, float); +DECLARE_SOA_COLUMN(DeltaPhi, mDeltaPhi, float); +DECLARE_SOA_COLUMN(DeltaX, mDeltaX, float); +DECLARE_SOA_COLUMN(DeltaY, mDeltaY, float); +DECLARE_SOA_COLUMN(GMuonPt, mGMuonPt, float); +DECLARE_SOA_COLUMN(GMuonEta, mGMuonEta, float); +DECLARE_SOA_COLUMN(PairQ, mPairQ, int16_t); +DECLARE_SOA_COLUMN(IsCorrectMatch, mIsCorrectMatch, bool); +} // namespace mix_matching_params + +DECLARE_SOA_TABLE(MixMatchParams, "AOD", "MIXMATCHING", + mix_matching_params::GMuonPt, + mix_matching_params::GMuonEta, + mix_matching_params::PairQ, + mix_matching_params::DeltaPt, + mix_matching_params::DeltaX, + mix_matching_params::DeltaY, + mix_matching_params::DeltaEta, + mix_matching_params::DeltaPhi, + mix_matching_params::IsCorrectMatch); + +namespace muon_pair +{ +// matching parameters +DECLARE_SOA_COLUMN(Mass, mMass, float); +DECLARE_SOA_COLUMN(Pt, mPt, float); +DECLARE_SOA_COLUMN(Rap, mRap, float); +DECLARE_SOA_COLUMN(PairQ, mPairQ, int16_t); +} // namespace muon_pair + +DECLARE_SOA_TABLE(MuonPair, "AOD", "MUONPAIR", + muon_pair::PairQ, + muon_pair::Mass, + muon_pair::Pt, + muon_pair::Rap); + +} // namespace o2::aod diff --git a/Common/TableProducer/CMakeLists.txt b/Common/TableProducer/CMakeLists.txt index 91513029f73..d0a9e6f5440 100644 --- a/Common/TableProducer/CMakeLists.txt +++ b/Common/TableProducer/CMakeLists.txt @@ -134,3 +134,8 @@ o2physics_add_dpl_workflow(mftmch-matching-data SOURCES match-mft-mch-data.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2Physics::AnalysisCCDB O2Physics::PWGDQCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(mftmch-matching-data-mc + SOURCES match-mft-mch-data-mc.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2Physics::AnalysisCCDB O2Physics::PWGDQCore O2Physics::EventFilteringUtils + COMPONENT_NAME Analysis) diff --git a/Common/TableProducer/match-mft-mch-data-mc.cxx b/Common/TableProducer/match-mft-mch-data-mc.cxx new file mode 100644 index 00000000000..4a03582489d --- /dev/null +++ b/Common/TableProducer/match-mft-mch-data-mc.cxx @@ -0,0 +1,881 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include +#include +#include +#include +#include + +#include "CCDB/BasicCCDBManager.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Centrality.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/MftmchMatchingML.h" +#include "Common/DataModel/MatchMFTMuonData.h" +#include "Common/Core/trackUtilities.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "PWGDQ/Core/VarManager.h" +#include "PWGDQ/Core/HistogramManager.h" +#include "PWGDQ/Core/AnalysisCut.h" +#include "PWGDQ/Core/AnalysisCompositeCut.h" +#include "PWGDQ/Core/HistogramsLibrary.h" +#include "PWGDQ/Core/CutsLibrary.h" +#include "DataFormatsGlobalTracking/RecoContainerCreateTracksVariadic.h" +#include "DetectorsVertexing/VertexTrackMatcher.h" +#include "ReconstructionDataFormats/PrimaryVertex.h" +#include "ReconstructionDataFormats/VtxTrackIndex.h" +#include "ReconstructionDataFormats/VtxTrackRef.h" +#include "DataFormatsITSMFT/ROFRecord.h" +#include "CommonDataFormat/InteractionRecord.h" +#include "DetectorsVertexing/PVertexerParams.h" +#include "MathUtils/Primitive2D.h" +#include "DataFormatsGlobalTracking/RecoContainer.h" +#include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/DataModel/MatchMFTFT0.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "Field/MagneticField.h" +#include "TGeoGlobalMagField.h" +#include "DetectorsBase/Propagator.h" +#include "DetectorsBase/GeometryManager.h" +#include "EventFiltering/Zorro.h" +#include "ReconstructionDataFormats/TrackFwd.h" +#include "Math/MatrixFunctions.h" +#include "Math/SMatrix.h" +#include "MFTTracking/Tracker.h" +#include "MCHTracking/TrackParam.h" +#include "MCHTracking/TrackExtrap.h" +#include "GlobalTracking/MatchGlobalFwd.h" +#include +#include +#include "TDatabasePDG.h" + +using namespace std; + +using namespace o2; +using namespace o2::soa; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::framework::expressions; + +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/DataTypes.h" +#include "Framework/runDataProcessing.h" + +using MyCollisions = aod::Collisions; +using MyBCs = soa::Join; +using MyMUONs = soa::Join; +using MyMFTs = soa::Join; + +using MyCollision = MyCollisions::iterator; +using MyBC = MyBCs::iterator; +using MyMUON = MyMUONs::iterator; +using MyMFT = MyMFTs::iterator; + +using SMatrix55 = ROOT::Math::SMatrix>; +using SMatrix5 = ROOT::Math::SVector; + +float mMu = TDatabasePDG::Instance()->GetParticle(13)->Mass(); +int mRunNumber; +/* + TLorentzVector muon1LV; + TLorentzVector muon2LV; + TLorentzVector dimuonLV; +*/ +unordered_map> map_mfttracks; +unordered_map> map_muontracks; +unordered_map map_collisions; +unordered_map map_has_mfttracks_collisions; +unordered_map map_has_muontracks_collisions; +unordered_map map_vtxz; +unordered_map map_nmfttrack; + +struct match_mft_mch_data_mc { + + //// Variables for matching method + Configurable fMatchingMethod{"cfgMatchingMethod", 0, ""}; + + //// Variables for selecting muon tracks + Configurable fEtaMchLow{"cfgEtaMchLow", -4.0f, ""}; + Configurable fEtaMchUp{"cfgEtaMchUp", -2.5f, ""}; + Configurable fRabsLow1{"cfgRabsLow1", 17.6f, ""}; + Configurable fRabsUp1{"cfgRabsUp1", 26.5f, ""}; + Configurable fRabsLow2{"cfgRabsLow2", 26.5f, ""}; + Configurable fRabsUp2{"cfgRabsUp2", 89.5f, ""}; + Configurable fPdcaUp1{"cfgPdcaUp1", 594.f, ""}; + Configurable fPdcaUp2{"cfgPdcaUp2", 324.f, ""}; + Configurable fTrackChi2MchUp{"cfgTrackChi2MchUp", 5.f, ""}; + Configurable fMatchingChi2MchMidUp{"cfgMatchingChi2MchMidUp", 999.f, ""}; + + //// Variables for selecting mft tracks + Configurable fEtaMftLow{"cfgEtaMftlow", -3.6f, ""}; + Configurable fEtaMftUp{"cfgEtaMftup", -2.5f, ""}; + Configurable fTrackNClustMftLow{"cfgTrackNClustMftLow", 7, ""}; + Configurable fTrackChi2MftUp{"cfgTrackChi2MftUp", 999.f, ""}; + + /// Variables to add preselection for the matching table + Configurable fPreselectMatchingX{"cfgPreselectMatchingX", 15.f, ""}; + Configurable fPreselectMatchingY{"cfgPreselectMatchingY", 15.f, ""}; + + /// Variables to event mixing criteria + Configurable fSaveMixedMatchingParamsRate{"cfgSaveMixedMatchingParamsRate", 0.002f, ""}; + Configurable fEventMaxDeltaNMFT{"cfgEventMaxDeltaNMFT", 1, ""}; + Configurable fEventMaxDeltaVtxZ{"cfgEventMaxDeltaVtxZ", 1.f, ""}; + + //// Variables for selecting tag muon + Configurable fTagMassWindowMin{"cfgTagMassWindowMin", 2.8f, ""}; + Configurable fTagMassWindowMax{"cfgTagMassWindowMax", 3.3f, ""}; + + //// Variables for ccdb + Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + + //// Variables for Tag matching criteria + Configurable fSigmaXTagMuonCut{"cfgSigmaXTagMuonCut", 1.f, ""}; + Configurable fMeanXTagMuonCut{"cfgMeanXTagMuonCut", 0.f, ""}; + Configurable fSigmaYTagMuonCut{"cfgSigmaYTagMuonCut", 1.f, ""}; + Configurable fMeanYTagMuonCut{"cfgMeanYTagMuonCut", 1.f, ""}; + + Configurable fSigmaEtaTagMuonCut{"cfgSigmaEtaTagMuonCut", 0.2f, ""}; + Configurable fMeanEtaTagMuonCut{"cfgMeanEtaTagMuonCut", 0.f, ""}; + Configurable fSigmaPhiTagMuonCut{"cfgSigmaPhiTagMuonCut", 0.2f, ""}; + Configurable fMeanPhiTagMuonCut{"cfgMeanPhiTagMuonCut", 0.f, ""}; + + template + class FindTagAndProbe + { + private: + o2::dataformats::GlobalFwdTrack muontrack_at_pv[2]; + + TLorentzVector mDimuon; + MUON muontrack1; + MUON muontrack2; + Collision collision; + int tagIdx, probeIdx; + + int16_t mQ; + + inline void fillCovarianceArray(MUON const& muontrack, float cov[15]) const + { + cov[0] = muontrack.cXX(); + cov[1] = muontrack.cXY(); + cov[2] = muontrack.cYY(); + cov[3] = muontrack.cPhiX(); + cov[4] = muontrack.cPhiY(); + cov[5] = muontrack.cPhiPhi(); + cov[6] = muontrack.cTglX(); + cov[7] = muontrack.cTglY(); + cov[8] = muontrack.cTglPhi(); + cov[9] = muontrack.cTglTgl(); + cov[10] = muontrack.c1PtX(); + cov[11] = muontrack.c1PtY(); + cov[12] = muontrack.c1PtPhi(); + cov[13] = muontrack.c1PtTgl(); + cov[14] = muontrack.c1Pt21Pt2(); + } + + inline o2::dataformats::GlobalFwdTrack propagateMUONtoPV(MUON const& muontrack) const + { + const double mz = muontrack.z(); + const double mchi2 = muontrack.chi2(); + const float mx = muontrack.x(); + const float my = muontrack.y(); + const float mphi = muontrack.phi(); + const float mtgl = muontrack.tgl(); + const float m1pt = muontrack.signed1Pt(); + + float cov[15]; + fillCovarianceArray(muontrack, cov); + SMatrix5 tpars(mx, my, mphi, mtgl, m1pt); + SMatrix55 tcovs(cov, cov + 15); + + o2::track::TrackParCovFwd parcovmuontrack{mz, tpars, tcovs, mchi2}; + + o2::dataformats::GlobalFwdTrack gtrack; + gtrack.setParameters(tpars); + gtrack.setZ(parcovmuontrack.getZ()); + gtrack.setCovariances(tcovs); + + o2::globaltracking::MatchGlobalFwd mMatching; + auto mchtrack = mMatching.FwdtoMCH(gtrack); + + o2::mch::TrackExtrap::extrapToVertex(mchtrack, collision.posX(), collision.posY(), collision.posZ(), collision.covXX(), collision.covYY()); + + auto fwdtrack = mMatching.MCHtoFwd(mchtrack); + o2::dataformats::GlobalFwdTrack extrap_muontrack; + extrap_muontrack.setParameters(fwdtrack.getParameters()); + extrap_muontrack.setZ(fwdtrack.getZ()); + extrap_muontrack.setCovariances(fwdtrack.getCovariances()); + + return extrap_muontrack; + } + + inline void setTagAndProbe() + { + if (muontrack1.pt() > muontrack2.pt()) { + tagIdx = 0; + probeIdx = 1; + } else { + tagIdx = 1; + probeIdx = 0; + } + } + + public: + inline FindTagAndProbe(const MUON& muon1, const MUON& muon2, const Collision& coll) + : muontrack_at_pv(), mDimuon(), muontrack1(muon1), muontrack2(muon2), collision(coll), tagIdx(-1), probeIdx(-1), mQ(0) + { + mQ = muontrack1.sign() + muontrack2.sign(); + setTagAndProbe(); + } + + void calcMuonPairAtPV() + { + muontrack_at_pv[0] = propagateMUONtoPV(muontrack1); + muontrack_at_pv[1] = propagateMUONtoPV(muontrack2); + TLorentzVector vMuon1, vMuon2; + vMuon1.SetPtEtaPhiM(muontrack_at_pv[0].getPt(), muontrack_at_pv[0].getEta(), muontrack_at_pv[0].getPhi(), mMu); + vMuon2.SetPtEtaPhiM(muontrack_at_pv[1].getPt(), muontrack_at_pv[1].getEta(), muontrack_at_pv[1].getPhi(), mMu); + mDimuon = vMuon1 + vMuon2; + } + inline int getTagMuonIndex() const { return tagIdx; } + inline int getProbeMuonIndex() const { return probeIdx; } + inline float getMass() const { return mDimuon.M(); } + inline float getPt() const { return mDimuon.Pt(); } + inline float getRap() const { return mDimuon.Rapidity(); } + inline int16_t getCharge() const { return mQ; } + inline const o2::dataformats::GlobalFwdTrack& getMuonAtPV(int idx) const { return muontrack_at_pv[idx]; } + }; // end of class FindTagAndProbe + + template + class MatchingParamsML + { + private: + MUON muontrack; + MFT mfttrack; + Collision collision; + + float mDX, mDY, mDPt, mDPhi, mDEta; + float mGlobalMuonPtAtDCA, mGlobalMuonEtaAtDCA, mGlobalMuonPhiAtDCA, mGlobalMuonDCAx, mGlobalMuonDCAy, mGlobalMuonQ; + int mMatchingType; + + o2::field::MagneticField* fieldB; + o2::globaltracking::MatchGlobalFwd mMatching; + + inline o2::track::TrackParCovFwd propagateMFTtoMatchingPlane() + { + double covArr[15]{0.0}; + SMatrix55 tmftcovs(covArr, covArr + 15); + + SMatrix5 tmftpars(mfttrack.x(), mfttrack.y(), mfttrack.phi(), mfttrack.tgl(), mfttrack.signed1Pt()); + o2::track::TrackParCovFwd extrap_mfttrack{mfttrack.z(), tmftpars, tmftcovs, mfttrack.chi2()}; + + double propVec[3] = {0.}; + float zPlane = 0.f; + if (mMatchingType == MCH_FIRST_CLUSTER) { + propVec[0] = muontrack.x() - mfttrack.x(); + propVec[1] = muontrack.y() - mfttrack.y(); + propVec[2] = muontrack.z() - mfttrack.z(); + zPlane = muontrack.z(); + } else if (mMatchingType == END_OF_ABSORBER || mMatchingType == BEGINING_OF_ABSORBER) { + auto extrap_muontrack = propagateMUONtoMatchingPlane(); + propVec[0] = extrap_muontrack.getX() - mfttrack.x(); + propVec[1] = extrap_muontrack.getY() - mfttrack.y(); + propVec[2] = extrap_muontrack.getZ() - mfttrack.z(); + zPlane = (mMatchingType == END_OF_ABSORBER) ? -505.f : -90.f; + } else { + zPlane = mfttrack.z(); + } + + double centerZ[3] = {mfttrack.x() + propVec[0] / 2., mfttrack.y() + propVec[1] / 2., mfttrack.z() + propVec[2] / 2.}; + float Bz = fieldB->getBz(centerZ); + extrap_mfttrack.propagateToZ(zPlane, Bz); // z in cm + return extrap_mfttrack; + } + + inline o2::dataformats::GlobalFwdTrack propagateMUONtoMatchingPlane() + { + float cov[15] = { + muontrack.cXX(), muontrack.cXY(), muontrack.cYY(), + muontrack.cPhiX(), muontrack.cPhiY(), muontrack.cPhiPhi(), + muontrack.cTglX(), muontrack.cTglY(), muontrack.cTglPhi(), + muontrack.cTglTgl(), muontrack.c1PtX(), muontrack.c1PtY(), + muontrack.c1PtPhi(), muontrack.c1PtTgl(), muontrack.c1Pt21Pt2()}; + + SMatrix5 tpars(muontrack.x(), muontrack.y(), muontrack.phi(), muontrack.tgl(), muontrack.signed1Pt()); + SMatrix55 tcovs(cov, cov + 15); + double chi2 = muontrack.chi2(); + + o2::track::TrackParCovFwd parcovmuontrack{muontrack.z(), tpars, tcovs, chi2}; + + o2::dataformats::GlobalFwdTrack gtrack; + gtrack.setParameters(tpars); + gtrack.setZ(parcovmuontrack.getZ()); + gtrack.setCovariances(tcovs); + + auto mchtrack = mMatching.FwdtoMCH(gtrack); + + if (mMatchingType == MFT_LAST_CLUSTR) { + o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchtrack, mfttrack.z()); + } else if (mMatchingType == END_OF_ABSORBER) { + o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchtrack, -505.); + } else if (mMatchingType == BEGINING_OF_ABSORBER) { + o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchtrack, -90.); + } + + auto fwdtrack = mMatching.MCHtoFwd(mchtrack); + + o2::dataformats::GlobalFwdTrack extrap_muontrack; + extrap_muontrack.setParameters(fwdtrack.getParameters()); + extrap_muontrack.setZ(fwdtrack.getZ()); + extrap_muontrack.setCovariances(fwdtrack.getCovariances()); + return extrap_muontrack; + } + + inline o2::track::TrackParCovFwd propagateMFTtoDCA() + { + double covArr[15]{0.0}; + SMatrix55 tmftcovs(covArr, covArr + 15); + + SMatrix5 tmftpars(mfttrack.x(), mfttrack.y(), mfttrack.phi(), mfttrack.tgl(), mfttrack.signed1Pt()); + o2::track::TrackParCovFwd extrap_mfttrack{mfttrack.z(), tmftpars, tmftcovs, mfttrack.chi2()}; + + double propVec[3] = {}; + propVec[0] = collision.posX() - mfttrack.x(); + propVec[1] = collision.posY() - mfttrack.y(); + propVec[2] = collision.posZ() - mfttrack.z(); + + double centerZ[3] = {mfttrack.x() + propVec[0] / 2., mfttrack.y() + propVec[1] / 2., mfttrack.z() + propVec[2] / 2.}; + float Bz = fieldB->getBz(centerZ); + extrap_mfttrack.propagateToZ(collision.posZ(), Bz); // z in cm + return extrap_mfttrack; + } + + inline o2::dataformats::GlobalFwdTrack propagateMUONtoPV() + { + float cov[15] = { + muontrack.cXX(), muontrack.cXY(), muontrack.cYY(), + muontrack.cPhiX(), muontrack.cPhiY(), muontrack.cPhiPhi(), + muontrack.cTglX(), muontrack.cTglY(), muontrack.cTglPhi(), + muontrack.cTglTgl(), muontrack.c1PtX(), muontrack.c1PtY(), + muontrack.c1PtPhi(), muontrack.c1PtTgl(), muontrack.c1Pt21Pt2()}; + + SMatrix5 tpars(muontrack.x(), muontrack.y(), muontrack.phi(), muontrack.tgl(), muontrack.signed1Pt()); + SMatrix55 tcovs(cov, cov + 15); + double chi2 = muontrack.chi2(); + + o2::track::TrackParCovFwd parcovmuontrack{muontrack.z(), tpars, tcovs, chi2}; + + o2::dataformats::GlobalFwdTrack gtrack; + gtrack.setParameters(tpars); + gtrack.setZ(parcovmuontrack.getZ()); + gtrack.setCovariances(tcovs); + + auto mchtrack = mMatching.FwdtoMCH(gtrack); + o2::mch::TrackExtrap::extrapToVertex(mchtrack, collision.posX(), collision.posY(), collision.posZ(), collision.covXX(), collision.covYY()); + + auto fwdtrack = mMatching.MCHtoFwd(mchtrack); + o2::dataformats::GlobalFwdTrack extrap_muontrack; + extrap_muontrack.setParameters(fwdtrack.getParameters()); + extrap_muontrack.setZ(fwdtrack.getZ()); + extrap_muontrack.setCovariances(fwdtrack.getCovariances()); + + return extrap_muontrack; + } + + public: + enum MATCHING_TYPE { MCH_FIRST_CLUSTER, + MFT_LAST_CLUSTR, + END_OF_ABSORBER, + BEGINING_OF_ABSORBER }; + + MatchingParamsML(MUON const& muon, MFT const& mft, Collision const& coll, int MType, o2::field::MagneticField* field) : muontrack(muon), mfttrack(mft), collision(coll), mDX(0.f), mDY(0.f), mDPt(0.f), mDPhi(0.f), mDEta(0.f), mGlobalMuonPtAtDCA(0.f), mGlobalMuonEtaAtDCA(0.f), mGlobalMuonPhiAtDCA(0.f), mGlobalMuonDCAx(0.f), mGlobalMuonDCAy(0.f), mGlobalMuonQ(0.f), mMatchingType(MType), fieldB(field) {} + void calcMatchingParams() + { + auto mfttrack_on_matchingP = propagateMFTtoMatchingPlane(); + auto muontrack_on_matchingP = propagateMUONtoMatchingPlane(); + + float dphiRaw = mfttrack_on_matchingP.getPhi() - muontrack_on_matchingP.getPhi(); + float dphi = TVector2::Phi_mpi_pi(dphiRaw); + float deta = mfttrack_on_matchingP.getEta() - muontrack_on_matchingP.getEta(); + + mDX = mfttrack_on_matchingP.getX() - muontrack_on_matchingP.getX(); + mDY = mfttrack_on_matchingP.getY() - muontrack_on_matchingP.getY(); + mDPt = mfttrack_on_matchingP.getPt() - muontrack_on_matchingP.getPt(); + mDPhi = dphi; + mDEta = deta; + } + + void calcGlobalMuonParams() + { + auto mfttrack_at_dca = propagateMFTtoDCA(); + auto muontrack_at_pv = propagateMUONtoPV(); + + float momentum = muontrack_at_pv.getP(); + float theta = mfttrack_at_dca.getTheta(); + float phiTrack = mfttrack_at_dca.getPhi(); + float px = momentum * std::sin(theta) * std::cos(phiTrack); + float py = momentum * std::sin(theta) * std::sin(phiTrack); + + mGlobalMuonQ = muontrack.sign() + mfttrack.sign(); + mGlobalMuonPtAtDCA = std::sqrt(px * px + py * py); + mGlobalMuonEtaAtDCA = mfttrack_at_dca.getEta(); + mGlobalMuonPhiAtDCA = mfttrack_at_dca.getPhi(); + mGlobalMuonDCAx = mfttrack_at_dca.getX() - collision.posX(); + mGlobalMuonDCAy = mfttrack_at_dca.getY() - collision.posY(); + } + + inline float getDx() const { return mDX; } + inline float getDy() const { return mDY; } + inline float getDphi() const { return mDPhi; } + inline float getDeta() const { return mDEta; } + inline float getDpt() const { return mDPt; } + inline float getGMPtAtDCA() const { return mGlobalMuonPtAtDCA; } + inline float getGMEtaAtDCA() const { return mGlobalMuonEtaAtDCA; } + inline float getGMPhiAtDCA() const { return mGlobalMuonPhiAtDCA; } + inline float getGMDcaX() const { return mGlobalMuonDCAx; } + inline float getGMDcaY() const { return mGlobalMuonDCAy; } + inline float getGMDcaXY() const { return std::sqrt(mGlobalMuonDCAx * mGlobalMuonDCAx + mGlobalMuonDCAy * mGlobalMuonDCAy); } + inline int16_t getGMQ() const { return static_cast(mGlobalMuonQ); } + + }; // end of class MatchingParamsML + + template + o2::dataformats::GlobalFwdTrack propagateMUONtoPV(MUON const& muontrack, Collisions const& collisions) + { + auto collision = collisions.rawIteratorAt(muontrack.collisionId()); + o2::globaltracking::MatchGlobalFwd mMatching; + o2::dataformats::GlobalFwdTrack extrap_muontrack; + + SMatrix5 tpars(muontrack.x(), muontrack.y(), muontrack.phi(), muontrack.tgl(), muontrack.signed1Pt()); + std::vector v1{muontrack.cXX(), muontrack.cXY(), muontrack.cYY(), + muontrack.cPhiX(), muontrack.cPhiY(), muontrack.cPhiPhi(), + muontrack.cTglX(), muontrack.cTglY(), muontrack.cTglPhi(), + muontrack.cTglTgl(), muontrack.c1PtX(), muontrack.c1PtY(), + muontrack.c1PtPhi(), muontrack.c1PtTgl(), muontrack.c1Pt21Pt2()}; + SMatrix55 tcovs(v1.begin(), v1.end()); + double chi2 = muontrack.chi2(); + o2::track::TrackParCovFwd parcovmuontrack{muontrack.z(), tpars, tcovs, chi2}; + + o2::dataformats::GlobalFwdTrack gtrack; + gtrack.setParameters(tpars); + gtrack.setZ(parcovmuontrack.getZ()); + gtrack.setCovariances(tcovs); + auto mchtrack = mMatching.FwdtoMCH(gtrack); + + o2::mch::TrackExtrap::extrapToVertex(mchtrack, collision.posX(), collision.posY(), collision.posZ(), collision.covXX(), collision.covYY()); + + auto fwdtrack = mMatching.MCHtoFwd(mchtrack); + extrap_muontrack.setParameters(fwdtrack.getParameters()); + extrap_muontrack.setZ(fwdtrack.getZ()); + extrap_muontrack.setCovariances(fwdtrack.getCovariances()); + + return extrap_muontrack; + } + + inline bool isGoodTagDimuon(float M) + { + return !(M < fTagMassWindowMin || M > fTagMassWindowMax); + } + + inline bool isGoodTagMatching(float mDX, float mDY, float mDEta, float mDPhi) + { + float dxNorm = (mDX - fMeanXTagMuonCut) / (fSigmaXTagMuonCut * 3); + float dyNorm = (mDY - fMeanYTagMuonCut) / (fSigmaYTagMuonCut * 3); + float detaNorm = (mDEta - fMeanEtaTagMuonCut) / (fSigmaEtaTagMuonCut * 3); + float dphiNorm = (mDPhi - fMeanPhiTagMuonCut) / (fSigmaPhiTagMuonCut * 3); + + float rTagXY = dxNorm * dxNorm + dyNorm * dyNorm; + float rTagEtaPhi = detaNorm * detaNorm + dphiNorm * dphiNorm; + + return (rTagXY < 1.f && rTagEtaPhi > 0.f); + } + + template + bool isCorrectMatching(MUON const& muontrack, MFT const& mfttrack) + { + + int idmuon = muontrack.mcParticleId(); + int idmft = mfttrack.mcParticleId(); + + if (idmuon == -1 || idmft == -1) + return false; + if (idmuon != idmft) + return false; + else + return true; + }; + + template + bool isGoodMuonQuality(MUON muontrack) + { + if (!muontrack.has_collision()) + return false; + if (muontrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) + return false; + if (muontrack.chi2() > fTrackChi2MchUp) + return false; + if (fRabsLow1 > muontrack.rAtAbsorberEnd() || muontrack.rAtAbsorberEnd() > fRabsUp2) + return false; + if (muontrack.rAtAbsorberEnd() < fRabsUp1 && fPdcaUp1 < muontrack.pDca()) + return false; + if (muontrack.rAtAbsorberEnd() > fRabsLow2 && fPdcaUp2 < muontrack.pDca()) + return false; + return true; + } + + template + bool isGoodMuonKine(MUON muontrack) + { + if (fEtaMchLow > muontrack.getEta() || muontrack.getEta() > fEtaMchUp) + return false; + return true; + } + + template + bool isGoodMFTQuality(MFT mfttrack) + { + if (!mfttrack.has_collision()) + return false; + if (mfttrack.chi2() > fTrackChi2MftUp) + return false; + if (mfttrack.nClusters() < fTrackNClustMftLow) + return false; + return true; + } + + template + bool isGoodMFTKine(MFT mfttrack) + { + if (fEtaMftLow > mfttrack.getEta() || mfttrack.getEta() > fEtaMftUp) + return false; + return true; + } + + inline bool isPassMatchingPreselection(float Dx, float Dy) + { + return !(std::abs(Dx) > fPreselectMatchingX || std::abs(Dy) > fPreselectMatchingY); + } + + template + void setMUONs(MUONs const& muontracks, Collisions const& collisions) + { + for (auto muontrack : muontracks) { + if (!isGoodMuonQuality(muontrack)) + continue; + o2::dataformats::GlobalFwdTrack muontrack_at_pv = propagateMUONtoPV(muontrack, collisions); + if (!isGoodMuonKine(muontrack_at_pv)) + continue; + + auto collision = collisions.rawIteratorAt(muontrack.collisionId()); + + bool& has = map_has_muontracks_collisions[muontrack.collisionId()]; + has = true; + + vector& arr_muontracks = map_muontracks[collision.globalIndex()]; + arr_muontracks.push_back(muontrack.globalIndex()); + } + } + + template + o2::track::TrackParCovFwd PropagateMFTtoDCA(MFT const& mfttrack, Collisions const& collisions, o2::field::MagneticField* field) + { + auto collision = collisions.rawIteratorAt(mfttrack.collisionId()); + std::vector mftv1; + SMatrix55 mftcovs{mftv1.begin(), mftv1.end()}; + SMatrix5 mftpars = {mfttrack.x(), mfttrack.y(), mfttrack.phi(), mfttrack.tgl(), mfttrack.signed1Pt()}; + o2::track::TrackParCovFwd mftpartrack = {mfttrack.z(), mftpars, mftcovs, mfttrack.chi2()}; + double propVec[3] = {fabs(mfttrack.x() - collision.posX()), + fabs(mfttrack.y() - collision.posY()), + fabs(mfttrack.z() - collision.posZ())}; + double centerZ[3] = {mfttrack.x() - propVec[0] / 2., + mfttrack.y() - propVec[1] / 2., + mfttrack.z() - propVec[2] / 2.}; + float Bz = field->getBz(centerZ); + mftpartrack.propagateToZ(collision.posZ(), Bz); + return mftpartrack; + } + + template + void setMFTs(MFTs const& mfttracks, Collisions const& collisions, o2::field::MagneticField* field) + { + for (auto mfttrack : mfttracks) { + if (!isGoodMFTQuality(mfttrack)) + continue; + + o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFTtoDCA(mfttrack, collisions, field); + if (!isGoodMFTKine(mfttrack_at_dca)) + continue; + + auto collision = collisions.rawIteratorAt(mfttrack.collisionId()); + + map_vtxz[mfttrack.collisionId()] = collision.posZ(); + map_nmfttrack[mfttrack.collisionId()] += 1; + + bool& has = map_has_mfttracks_collisions[mfttrack.collisionId()]; + has = true; + + vector& arr_mfttracks = map_mfttracks[collision.globalIndex()]; + arr_mfttracks.push_back(mfttrack.globalIndex()); + } + } + + Produces tableMatchingParams; + Produces tableTagMatchingParams; + Produces tableProbeMatchingParams; + Produces tableMixMatchingParams; + Produces tableMuonPair; + + Service ccdbManager; + + o2::field::MagneticField* fieldB; + o2::ccdb::CcdbApi ccdbApi; + + template + void initCCDB(BC const& bc) + { + if (mRunNumber == bc.runNumber()) + return; + + mRunNumber = bc.runNumber(); + std::map metadata; + auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, mRunNumber); + auto ts = soreor.first; + auto grpmag = ccdbApi.retrieveFromTFileAny(grpmagPath, metadata, ts); + o2::base::Propagator::initFieldFromGRP(grpmag); + if (!o2::base::GeometryManager::isGeometryLoaded()) { + ccdbManager->get(geoPath); + } + o2::mch::TrackExtrap::setField(); + fieldB = static_cast(TGeoGlobalMagField::Instance()->GetField()); + } + + void init(o2::framework::InitContext&) + { + ccdbManager->setURL(ccdburl); + ccdbManager->setCaching(true); + ccdbManager->setLocalObjectValidityChecking(); + ccdbManager->setFatalWhenNull(false); + ccdbApi.init(ccdburl); + mRunNumber = 0; + } + + void process(MyCollisions const& collisions, + MyBCs const& bcs, + MyMUONs const& muontracks, + MyMFTs const& mfttracks) + { + LOG(info) << "Process() "; + map_muontracks.clear(); + map_mfttracks.clear(); + map_collisions.clear(); + map_has_muontracks_collisions.clear(); + map_has_mfttracks_collisions.clear(); + + initCCDB(bcs.begin()); + setMUONs(muontracks, collisions); + setMFTs(mfttracks, collisions, fieldB); + + for (auto map_has_muontracks_collision : map_has_muontracks_collisions) { + auto idmuontrack_collisions = map_has_muontracks_collision.first; + for (auto map_has_mfttracks_collision : map_has_mfttracks_collisions) { + auto idmfttrack_collisions = map_has_mfttracks_collision.first; + if (idmuontrack_collisions != idmfttrack_collisions) + continue; + map_collisions[idmfttrack_collisions] = true; + } + } + + for (auto const& map_collision : map_collisions) { + auto const& collision = collisions.rawIteratorAt(map_collision.first); + + for (auto const& imuontrack1 : map_muontracks[map_collision.first]) { + auto const& muontrack1 = muontracks.rawIteratorAt(imuontrack1); + + for (auto const& imfttrack1 : map_mfttracks[map_collision.first]) { + auto const& mfttrack1 = mfttracks.rawIteratorAt(imfttrack1); + + MatchingParamsML matching(muontrack1, mfttrack1, collision, fMatchingMethod, fieldB); + matching.calcMatchingParams(); + + if (!isPassMatchingPreselection(matching.getDx(), matching.getDy())) + continue; + + matching.calcGlobalMuonParams(); + + bool isTrue = isCorrectMatching(muontrack1, mfttrack1); + + tableMatchingParams(matching.getGMPtAtDCA(), + matching.getGMEtaAtDCA(), + static_cast(matching.getGMQ()), + matching.getDpt(), + matching.getDx(), + matching.getDy(), + matching.getDeta(), + matching.getDphi(), + isTrue); + } + + for (auto const& map_mfttrack : map_mfttracks) { + if (map_mfttrack.first == map_collision.first) + continue; + if (fabs(map_vtxz[map_mfttrack.first] - map_vtxz[map_collision.first]) > fEventMaxDeltaVtxZ) + continue; + if (fabs(map_nmfttrack[map_mfttrack.first] - map_nmfttrack[map_collision.first]) > fEventMaxDeltaNMFT) + continue; + + for (auto const& imfttrack1 : map_mfttrack.second) { + auto const& mfttrack1 = mfttracks.rawIteratorAt(imfttrack1); + MatchingParamsML matching(muontrack1, mfttrack1, collision, fMatchingMethod, fieldB); + matching.calcMatchingParams(); + if (!isPassMatchingPreselection(matching.getDx(), matching.getDy())) + continue; + matching.calcGlobalMuonParams(); + + bool isTrue = isCorrectMatching(muontrack1, mfttrack1); + + tableMixMatchingParams(matching.getGMPtAtDCA(), + matching.getGMEtaAtDCA(), + static_cast(matching.getGMQ()), + matching.getDpt(), + matching.getDx(), + matching.getDy(), + matching.getDeta(), + matching.getDphi(), + isTrue); + } + } + + for (auto const& imuontrack2 : map_muontracks[map_collision.first]) { + + if (imuontrack1 >= imuontrack2) + continue; + + auto const& muontrack2 = muontracks.rawIteratorAt(imuontrack2); + + FindTagAndProbe tagdimuon(muontrack1, muontrack2, collision); + tagdimuon.calcMuonPairAtPV(); + tableMuonPair(tagdimuon.getCharge(), tagdimuon.getMass(), tagdimuon.getPt(), tagdimuon.getRap()); + + if (!isGoodTagDimuon(tagdimuon.getMass())) + continue; + + auto tagmuontrack = muontrack1; + auto probemuontrack = muontrack2; + + if (tagdimuon.getTagMuonIndex() == 1) { + tagmuontrack = muontrack2; + probemuontrack = muontrack1; + } + + int nTagMFTCand = 0; + int nProbeMFTCand = 0; + + int IndexTagMFTCand = -1; + float tagGMPtAtDCA = 0; + // float tagGMEtaAtDCA = 0; + + float minimumR = 9999.; + int minimumIndexProbeMFTCand = -1; + + unordered_map> map_tagMatchingParams; + unordered_map> map_probeMatchingParams; + + for (auto const& imfttrack1 : map_mfttracks[map_collision.first]) { + auto const& mfttrack1 = mfttracks.rawIteratorAt(imfttrack1); + MatchingParamsML matchingTag(tagmuontrack, mfttrack1, collision, fMatchingMethod, fieldB); + matchingTag.calcMatchingParams(); + matchingTag.calcGlobalMuonParams(); + if (isGoodTagMatching(matchingTag.getDx(), matchingTag.getDy(), matchingTag.getDeta(), matchingTag.getDphi()) && + isPassMatchingPreselection(matchingTag.getDx(), matchingTag.getDy())) { + bool isTrue = isCorrectMatching(tagmuontrack, mfttrack1); + tableTagMatchingParams(matchingTag.getGMPtAtDCA(), + matchingTag.getGMEtaAtDCA(), + matchingTag.getGMQ(), + matchingTag.getDpt(), + matchingTag.getDx(), + matchingTag.getDy(), + matchingTag.getDeta(), + matchingTag.getDphi(), + isTrue); + IndexTagMFTCand = mfttrack1.globalIndex(); + tagGMPtAtDCA = matchingTag.getGMPtAtDCA(); + // tagGMEtaAtDCA = matchingTag.getGMEtaAtDCA(); + ++nTagMFTCand; + } + } // end of loop imfttrack1 + + if (nTagMFTCand != 1) + continue; + for (auto const& imfttrack1 : map_mfttracks[map_collision.first]) { + auto const& mfttrack1 = mfttracks.rawIteratorAt(imfttrack1); + if (mfttrack1.globalIndex() == IndexTagMFTCand) + continue; + MatchingParamsML matchingProbe(probemuontrack, mfttrack1, collision, fMatchingMethod, fieldB); + matchingProbe.calcMatchingParams(); + if (isPassMatchingPreselection(matchingProbe.getDx(), matchingProbe.getDy())) { + float R = sqrt(matchingProbe.getDx() * matchingProbe.getDx() + matchingProbe.getDy() * matchingProbe.getDy()); + bool isTrue = isCorrectMatching(probemuontrack, mfttrack1); + matchingProbe.calcGlobalMuonParams(); + vector& probeMatchingParams = map_probeMatchingParams[nProbeMFTCand]; + probeMatchingParams.push_back(tagGMPtAtDCA); + probeMatchingParams.push_back(matchingProbe.getGMPtAtDCA()); + probeMatchingParams.push_back(matchingProbe.getGMEtaAtDCA()); + probeMatchingParams.push_back(matchingProbe.getGMQ()); + probeMatchingParams.push_back(matchingProbe.getDpt()); + probeMatchingParams.push_back(matchingProbe.getDx()); + probeMatchingParams.push_back(matchingProbe.getDy()); + probeMatchingParams.push_back(matchingProbe.getDeta()); + probeMatchingParams.push_back(matchingProbe.getDphi()); + probeMatchingParams.push_back(isTrue); + if (R < minimumR) { + minimumIndexProbeMFTCand = nProbeMFTCand; + minimumR = R; + } + ++nProbeMFTCand; + } + } // end of loop imfttrack1 + + if (nProbeMFTCand < 1) + continue; + + if (minimumIndexProbeMFTCand > -1) { + vector& probeMatchingParams = map_probeMatchingParams[minimumIndexProbeMFTCand]; + tableProbeMatchingParams(probeMatchingParams[0], + probeMatchingParams[1], + probeMatchingParams[2], + static_cast(probeMatchingParams[3]), + probeMatchingParams[4], + probeMatchingParams[5], + probeMatchingParams[6], + probeMatchingParams[7], + probeMatchingParams[8], + static_cast(probeMatchingParams[9])); + } + + } // end of loop imuontrack2 + } // end of loop imuontrack1 + } // end of loop map_collision + + } // end of processMC +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} diff --git a/Common/TableProducer/match-mft-mch-data.cxx b/Common/TableProducer/match-mft-mch-data.cxx index c151c74ba4d..b566d9531f8 100644 --- a/Common/TableProducer/match-mft-mch-data.cxx +++ b/Common/TableProducer/match-mft-mch-data.cxx @@ -14,11 +14,6 @@ #include #include -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" #include "CCDB/BasicCCDBManager.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/EventSelection.h" @@ -27,6 +22,7 @@ #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/MftmchMatchingML.h" +#include "Common/DataModel/MatchMFTMuonData.h" #include "Common/Core/trackUtilities.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" #include "PWGDQ/Core/VarManager.h" @@ -65,277 +61,52 @@ #include #include "TDatabasePDG.h" +using namespace std; + using namespace o2; using namespace o2::soa; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; -using SMatrix55 = ROOT::Math::SMatrix>; -using SMatrix5 = ROOT::Math::SVector; +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/DataTypes.h" +#include "Framework/runDataProcessing.h" -// using MyEvents = soa::Join; -// using MyEventsWithMults = soa::Join; -// using MyEventsWithFilter = soa::Join; -// using MyEventsWithMultsAndFilter = soa::Join; -// using MyEventsWithCent = soa::Join; -// using MyEventsWithCentAndMults = soa::Join; -using MyMuons = soa::Join; +using MyCollisions = aod::Collisions; +using MyBCs = soa::Join; +using MyMUONs = soa::Join; using MyMFTs = aod::MFTTracks; -// using MyMuonsWithCov = soa::Join; -// using MyMuonsColl = soa::Join; -// using MyMuonsCollWithCov = soa::Join; -using MyBCs = soa::Join; -using ExtBCs = soa::Join; - -float mMu = TDatabasePDG::Instance()->GetParticle(13)->Mass(); -TRandom* rnd = new TRandom(); +using MyCollision = MyCollisions::iterator; +using MyBC = MyBCs::iterator; +using MyMUON = MyMUONs::iterator; +using MyMFT = MyMFTs::iterator; -TLorentzVector muon1LV; -TLorentzVector muon2LV; -TLorentzVector dimuonLV; - -TVector3 V1; -TVector3 V2; - -namespace o2::aod -{ - -namespace muon_params -{ -DECLARE_SOA_COLUMN(TRACKCHI2, trackChi2, float); -DECLARE_SOA_COLUMN(RABS, rabs, float); -DECLARE_SOA_COLUMN(Q, q, int16_t); -DECLARE_SOA_COLUMN(PT, pt, float); -DECLARE_SOA_COLUMN(ETA, eta, float); -DECLARE_SOA_COLUMN(PHI, phi, float); -DECLARE_SOA_COLUMN(HASMFT, has_mft, bool); -} // namespace muon_params - -DECLARE_SOA_TABLE(MUONParams, "AOD", "MUON", - muon_params::TRACKCHI2, - muon_params::RABS, - muon_params::Q, - muon_params::PT, - muon_params::ETA, - muon_params::PHI, - muon_params::HASMFT); - -namespace mft_params -{ -DECLARE_SOA_COLUMN(NCLUST, nclust, int); -DECLARE_SOA_COLUMN(ISCA, isCA, bool); -DECLARE_SOA_COLUMN(TRACKCHI2, trackChi2, float); -DECLARE_SOA_COLUMN(Q, q, int16_t); -DECLARE_SOA_COLUMN(PT_AT_DCA, pt_dca, float); -DECLARE_SOA_COLUMN(ETA_AT_DCA, eta_dca, float); -DECLARE_SOA_COLUMN(PHI_AT_DCA, phi_dca, float); -DECLARE_SOA_COLUMN(DCAx, dcax, float); -DECLARE_SOA_COLUMN(DCAy, dcay, float); -} // namespace mft_params - -DECLARE_SOA_TABLE(MFTParams, "AOD", "MFT", - mft_params::NCLUST, - mft_params::ISCA, - mft_params::TRACKCHI2, - mft_params::Q, - mft_params::PT_AT_DCA, - mft_params::ETA_AT_DCA, - mft_params::PHI_AT_DCA, - mft_params::DCAx, - mft_params::DCAy); - -namespace matching_params -{ -// matching parameters -DECLARE_SOA_COLUMN(NClustMFTTracks, nClustMFT, int); -DECLARE_SOA_COLUMN(Chi2MFTTracks, chi2MFT, float); - -DECLARE_SOA_COLUMN(DeltaP, dp_mchplane, float); -DECLARE_SOA_COLUMN(DeltaPt, dpt_mchplane, float); -DECLARE_SOA_COLUMN(DeltaEta, deta_mchplane, float); -DECLARE_SOA_COLUMN(DeltaPhi, dphi_mchplane, float); -DECLARE_SOA_COLUMN(DeltaX, dx_mchplane, float); -DECLARE_SOA_COLUMN(DeltaY, dy_mchplane, float); - -DECLARE_SOA_COLUMN(MchPt, mchpt, float); -DECLARE_SOA_COLUMN(MchEta, mcheta, float); -DECLARE_SOA_COLUMN(MchPhi, mchphi, float); -DECLARE_SOA_COLUMN(MchQ, mchq, float); - -DECLARE_SOA_COLUMN(MftPt, mftpt, float); -DECLARE_SOA_COLUMN(MftEta, mfteta, float); -DECLARE_SOA_COLUMN(MftPhi, mftphi, float); -DECLARE_SOA_COLUMN(MftQ, mftq, float); - -DECLARE_SOA_COLUMN(MftDCA, mftdca, float); - -} // namespace matching_params - -DECLARE_SOA_TABLE(MatchParams, "AOD", "MATCHING", - matching_params::DeltaPt, - matching_params::DeltaEta, - matching_params::DeltaPhi, - matching_params::DeltaX, - matching_params::DeltaY, - matching_params::MchPt, - matching_params::MchEta, - matching_params::MchQ, - matching_params::MftEta, - matching_params::MftQ); - -namespace mix_matching_params -{ -// matching parameters -DECLARE_SOA_COLUMN(NClustMFTTracks, nClustMFT, int); -DECLARE_SOA_COLUMN(Chi2MFTTracks, chi2MFT, float); - -DECLARE_SOA_COLUMN(DeltaP, dp_mchplane, float); -DECLARE_SOA_COLUMN(DeltaPt, dpt_mchplane, float); -DECLARE_SOA_COLUMN(DeltaEta, deta_mchplane, float); -DECLARE_SOA_COLUMN(DeltaPhi, dphi_mchplane, float); -DECLARE_SOA_COLUMN(DeltaX, dx_mchplane, float); -DECLARE_SOA_COLUMN(DeltaY, dy_mchplane, float); - -DECLARE_SOA_COLUMN(MchPt, mchpt, float); -DECLARE_SOA_COLUMN(MchEta, mcheta, float); -DECLARE_SOA_COLUMN(MchPhi, mchphi, float); -DECLARE_SOA_COLUMN(MchQ, mchq, float); - -DECLARE_SOA_COLUMN(MftPt, mftpt, float); -DECLARE_SOA_COLUMN(MftEta, mfteta, float); -DECLARE_SOA_COLUMN(MftPhi, mftphi, float); -DECLARE_SOA_COLUMN(MftQ, mftq, float); -DECLARE_SOA_COLUMN(MftDCA, mftdca, float); -} // namespace mix_matching_params - -DECLARE_SOA_TABLE(MixMatchParams, "AOD", "MIXMATCHING", - mix_matching_params::DeltaPt, - mix_matching_params::DeltaEta, - mix_matching_params::DeltaPhi, - mix_matching_params::DeltaX, - mix_matching_params::DeltaY, - mix_matching_params::MchPt, - mix_matching_params::MchEta, - mix_matching_params::MchQ, - mix_matching_params::MftEta, - mix_matching_params::MftQ); - -namespace tag_matching_params -{ -// matching parameters -DECLARE_SOA_COLUMN(DeltaPt, dpt_mchplane, float); -DECLARE_SOA_COLUMN(DeltaEta, deta_mchplane, float); -DECLARE_SOA_COLUMN(DeltaPhi, dphi_mchplane, float); -DECLARE_SOA_COLUMN(DeltaX, dx_mchplane, float); -DECLARE_SOA_COLUMN(DeltaY, dy_mchplane, float); - -DECLARE_SOA_COLUMN(MchPt, mchpt, float); -DECLARE_SOA_COLUMN(MchEta, mcheta, float); -DECLARE_SOA_COLUMN(MchQ, mchq, float); - -DECLARE_SOA_COLUMN(MftEta, mfteta, float); -DECLARE_SOA_COLUMN(MftQ, mftq, float); -DECLARE_SOA_COLUMN(IsTaged, isTaged, bool); -} // namespace tag_matching_params - -DECLARE_SOA_TABLE(TagMatchParams, "AOD", "TAGMATCHING", - tag_matching_params::DeltaPt, - tag_matching_params::DeltaEta, - tag_matching_params::DeltaPhi, - tag_matching_params::DeltaX, - tag_matching_params::DeltaY, - tag_matching_params::MchPt, - tag_matching_params::MchEta, - tag_matching_params::MchQ, - tag_matching_params::MftEta, - tag_matching_params::MftQ, - tag_matching_params::IsTaged); - -namespace probe_matching_params -{ -// matching parameters -DECLARE_SOA_COLUMN(NMFTCandTagMuon, nTagMFT, int); -DECLARE_SOA_COLUMN(NMFTCandProbeMuon, nProbeMFT, int); -DECLARE_SOA_COLUMN(TagMuonP, tagmuonp, float); - -DECLARE_SOA_COLUMN(NClustMFTTracks, nClustMFT, int); -DECLARE_SOA_COLUMN(Chi2MFTTracks, chi2MFT, float); - -DECLARE_SOA_COLUMN(DeltaP, dp_mchplane, float); -DECLARE_SOA_COLUMN(DeltaPt, dpt_mchplane, float); -DECLARE_SOA_COLUMN(DeltaEta, deta_mchplane, float); -DECLARE_SOA_COLUMN(DeltaPhi, dphi_mchplane, float); -DECLARE_SOA_COLUMN(DeltaX, dx_mchplane, float); -DECLARE_SOA_COLUMN(DeltaY, dy_mchplane, float); - -DECLARE_SOA_COLUMN(MchPt, mchpt, float); -DECLARE_SOA_COLUMN(MchEta, mcheta, float); -DECLARE_SOA_COLUMN(MchPhi, mchphi, float); -DECLARE_SOA_COLUMN(MchQ, mchq, float); - -DECLARE_SOA_COLUMN(MftPt, mftpt, float); -DECLARE_SOA_COLUMN(MftEta, mfteta, float); -DECLARE_SOA_COLUMN(MftPhi, mftphi, float); -DECLARE_SOA_COLUMN(MftQ, mftq, float); -DECLARE_SOA_COLUMN(MftDCA, mftdca, float); -} // namespace probe_matching_params - -DECLARE_SOA_TABLE(ProbeMatchParams, "AOD", "PROBEMATCHING", - probe_matching_params::NMFTCandTagMuon, - probe_matching_params::NMFTCandProbeMuon, - probe_matching_params::TagMuonP, - probe_matching_params::DeltaPt, - probe_matching_params::DeltaEta, - probe_matching_params::DeltaPhi, - probe_matching_params::DeltaX, - probe_matching_params::DeltaY, - probe_matching_params::MchPt, - probe_matching_params::MchEta, - probe_matching_params::MchQ, - probe_matching_params::MftEta, - probe_matching_params::MftQ); - -namespace muon_pair -{ -DECLARE_SOA_COLUMN(NMFT, nMft, int); -DECLARE_SOA_COLUMN(Q, q, int16_t); -DECLARE_SOA_COLUMN(M, m, float); -DECLARE_SOA_COLUMN(Pt, pt, float); -DECLARE_SOA_COLUMN(Rap, rap, float); -} // namespace muon_pair - -DECLARE_SOA_TABLE(MuonPair, "AOD", "DIMUON", muon_pair::NMFT, muon_pair::Q, muon_pair::M, muon_pair::Pt, muon_pair::Rap); +using SMatrix55 = ROOT::Math::SMatrix>; +using SMatrix5 = ROOT::Math::SVector; -namespace tag_muon_pair -{ -DECLARE_SOA_COLUMN(NMFT, nMft, int); -DECLARE_SOA_COLUMN(Q, q, int16_t); -DECLARE_SOA_COLUMN(M, m, float); -DECLARE_SOA_COLUMN(Pt, pt, float); -DECLARE_SOA_COLUMN(Rap, rap, float); -} // namespace tag_muon_pair - -DECLARE_SOA_TABLE(TagMuonPair, "AOD", "TAGDIMUON", tag_muon_pair::NMFT, tag_muon_pair::Q, tag_muon_pair::M, tag_muon_pair::Pt, tag_muon_pair::Rap); -} // namespace o2::aod - -struct match_mft_mch_data { - - Produces matchingParams; - Produces tagmatchingParams; - Produces probematchingParams; - Produces mixmatchingParams; - Produces muonPairs; - Produces tagmuonPairs; - Produces muonParams; - Produces mftParams; - - HistogramRegistry registry{ - "registry", - {{"hMchP", "MCH track total momentum (at the first station); p [GeV/c]; Counts", {HistType::kTH1F, {{2000, 0, 200}}}}, - {"hMchCorrP", "MCH track total momentum (propagated to PV); p [GeV/c]; Counts", {HistType::kTH1F, {{2000, 0, 200}}}}, - {"hMassCorrMchPair", "Corrected MCH track pair mass (propagated to PV); m [GeV/c^{2}]; Counts", {HistType::kTH1F, {{1000, 0, 10}}}}}}; +float mMu = TDatabasePDG::Instance()->GetParticle(13)->Mass(); +int mRunNumber; +/* + TLorentzVector muon1LV; + TLorentzVector muon2LV; + TLorentzVector dimuonLV; +*/ +unordered_map> map_mfttracks; +unordered_map> map_muontracks; +unordered_map map_collisions; +unordered_map map_has_mfttracks_collisions; +unordered_map map_has_muontracks_collisions; +unordered_map map_vtxz; +unordered_map map_nmfttrack; + +struct match_mft_mch_data_mc { + + //// Variables for matching method + Configurable fMatchingMethod{"cfgMatchingMethod", 0, ""}; //// Variables for selecting muon tracks Configurable fEtaMchLow{"cfgEtaMchLow", -4.0f, ""}; @@ -356,8 +127,8 @@ struct match_mft_mch_data { Configurable fTrackChi2MftUp{"cfgTrackChi2MftUp", 999.f, ""}; /// Variables to add preselection for the matching table - Configurable fPreselectMatchingX{"cfgPreselectMatchingX", 999.f, ""}; - Configurable fPreselectMatchingY{"cfgPreselectMatchingY", 999.f, ""}; + Configurable fPreselectMatchingX{"cfgPreselectMatchingX", 15.f, ""}; + Configurable fPreselectMatchingY{"cfgPreselectMatchingY", 15.f, ""}; /// Variables to event mixing criteria Configurable fSaveMixedMatchingParamsRate{"cfgSaveMixedMatchingParamsRate", 0.002f, ""}; @@ -367,504 +138,744 @@ struct match_mft_mch_data { //// Variables for selecting tag muon Configurable fTagMassWindowMin{"cfgTagMassWindowMin", 2.8f, ""}; Configurable fTagMassWindowMax{"cfgTagMassWindowMax", 3.3f, ""}; - Configurable fTagXWindowLow{"cfgTagXWindowLow", -0.80f, ""}; - Configurable fTagXWindowUp{"cfgTagXWindowUp", 0.84f, ""}; - Configurable fTagYWindowLow{"cfgTagYWindowLow", -0.64f, ""}; - Configurable fTagYWindowUp{"cfgTagYWindowUp", 0.95f, ""}; - Configurable fTagPhiWindowLow{"cfgTagPhiWindowLow", -0.041f, ""}; - Configurable fTagPhiWindowUp{"cfgTagPhiWindowUp", 0.039f, ""}; - Configurable fTagEtaWindowLow{"cfgTagEtaWindowLow", -0.045f, ""}; - Configurable fTagEtaWindowUp{"cfgTagEtaWindowUp", 0.033f, ""}; - - //// Variables for selecting probe muon - Configurable fProbeXWindowLow{"cfgProbeXWindowLow", -10.f, ""}; - Configurable fProbeXWindowUp{"cfgProbeXWindowUp", 10.f, ""}; - Configurable fProbeYWindowLow{"cfgProbeYWindowLow", -10.f, ""}; - Configurable fProbeYWindowUp{"cfgProbeYWindowUp", 10.f, ""}; - Configurable fProbePhiWindowLow{"cfgProbePhiWindowLow", -1.0f, ""}; - Configurable fProbePhiWindowUp{"cfgProbePhiWindowUp", 1.0f, ""}; - Configurable fProbeEtaWindowLow{"cfgProbeEtaWindowLow", -1.0f, ""}; - Configurable fProbeEtaWindowUp{"cfgProbeEtaWindowUp", 1.0f, ""}; - - Service ccdb; + + //// Variables for ccdb Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; - // o2::parameters::GRPMagField* grpmag = nullptr; - o2::globaltracking::MatchGlobalFwd mMatching; - o2::field::MagneticField* fieldB; + //// Variables for Tag matching criteria + Configurable fSigmaXTagMuonCut{"cfgSigmaXTagMuonCut", 1.f, ""}; + Configurable fMeanXTagMuonCut{"cfgMeanXTagMuonCut", 0.f, ""}; + Configurable fSigmaYTagMuonCut{"cfgSigmaYTagMuonCut", 1.f, ""}; + Configurable fMeanYTagMuonCut{"cfgMeanYTagMuonCut", 1.f, ""}; - o2::ccdb::CcdbApi ccdbApi; - int mRunNumber; + Configurable fSigmaEtaTagMuonCut{"cfgSigmaEtaTagMuonCut", 0.2f, ""}; + Configurable fMeanEtaTagMuonCut{"cfgMeanEtaTagMuonCut", 0.f, ""}; + Configurable fSigmaPhiTagMuonCut{"cfgSigmaPhiTagMuonCut", 0.2f, ""}; + Configurable fMeanPhiTagMuonCut{"cfgMeanPhiTagMuonCut", 0.f, ""}; - void init(o2::framework::InitContext&) + template + class FindTagAndProbe { - ccdb->setURL(ccdburl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); - ccdbApi.init(ccdburl); - mRunNumber = 0; - } + private: + o2::dataformats::GlobalFwdTrack muontrack_at_pv[2]; + + TLorentzVector mDimuon; + MUON muontrack1; + MUON muontrack2; + Collision collision; + int tagIdx, probeIdx; + + int16_t mQ; + + inline void fillCovarianceArray(MUON const& muontrack, float cov[15]) const + { + cov[0] = muontrack.cXX(); + cov[1] = muontrack.cXY(); + cov[2] = muontrack.cYY(); + cov[3] = muontrack.cPhiX(); + cov[4] = muontrack.cPhiY(); + cov[5] = muontrack.cPhiPhi(); + cov[6] = muontrack.cTglX(); + cov[7] = muontrack.cTglY(); + cov[8] = muontrack.cTglPhi(); + cov[9] = muontrack.cTglTgl(); + cov[10] = muontrack.c1PtX(); + cov[11] = muontrack.c1PtY(); + cov[12] = muontrack.c1PtPhi(); + cov[13] = muontrack.c1PtTgl(); + cov[14] = muontrack.c1Pt21Pt2(); + } - void initCCDB(ExtBCs::iterator const& bc) - { - if (mRunNumber == bc.runNumber()) { - return; + inline o2::dataformats::GlobalFwdTrack propagateMUONtoPV(MUON const& muontrack) const + { + const double mz = muontrack.z(); + const double mchi2 = muontrack.chi2(); + const float mx = muontrack.x(); + const float my = muontrack.y(); + const float mphi = muontrack.phi(); + const float mtgl = muontrack.tgl(); + const float m1pt = muontrack.signed1Pt(); + + float cov[15]; + fillCovarianceArray(muontrack, cov); + SMatrix5 tpars(mx, my, mphi, mtgl, m1pt); + SMatrix55 tcovs(cov, cov + 15); + + o2::track::TrackParCovFwd parcovmuontrack{mz, tpars, tcovs, mchi2}; + + o2::dataformats::GlobalFwdTrack gtrack; + gtrack.setParameters(tpars); + gtrack.setZ(parcovmuontrack.getZ()); + gtrack.setCovariances(tcovs); + + o2::globaltracking::MatchGlobalFwd mMatching; + auto mchtrack = mMatching.FwdtoMCH(gtrack); + + o2::mch::TrackExtrap::extrapToVertex(mchtrack, collision.posX(), collision.posY(), collision.posZ(), collision.covXX(), collision.covYY()); + + auto fwdtrack = mMatching.MCHtoFwd(mchtrack); + o2::dataformats::GlobalFwdTrack extrap_muontrack; + extrap_muontrack.setParameters(fwdtrack.getParameters()); + extrap_muontrack.setZ(fwdtrack.getZ()); + extrap_muontrack.setCovariances(fwdtrack.getCovariances()); + + return extrap_muontrack; } - mRunNumber = bc.runNumber(); - std::map metadata; - auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, mRunNumber); - auto ts = soreor.first; - auto grpmag = ccdbApi.retrieveFromTFileAny(grpmagPath, metadata, ts); - o2::base::Propagator::initFieldFromGRP(grpmag); - if (!o2::base::GeometryManager::isGeometryLoaded()) { - ccdb->get(geoPath); + + inline void setTagAndProbe() + { + if (muontrack1.pt() > muontrack2.pt()) { + tagIdx = 0; + probeIdx = 1; + } else { + tagIdx = 1; + probeIdx = 0; + } } - o2::mch::TrackExtrap::setField(); - fieldB = static_cast(TGeoGlobalMagField::Instance()->GetField()); - } - enum ProagationPoint { ToVtx, - ToDCA }; + public: + inline FindTagAndProbe(const MUON& muon1, const MUON& muon2, const Collision& coll) + : muontrack_at_pv(), mDimuon(), muontrack1(muon1), muontrack2(muon2), collision(coll), tagIdx(-1), probeIdx(-1), mQ(0) + { + mQ = muontrack1.sign() + muontrack2.sign(); + setTagAndProbe(); + } - template - o2::dataformats::GlobalFwdTrack PropagateMUONTrack(T const& muon, int PropType) + void calcMuonPairAtPV() + { + muontrack_at_pv[0] = propagateMUONtoPV(muontrack1); + muontrack_at_pv[1] = propagateMUONtoPV(muontrack2); + TLorentzVector vMuon1, vMuon2; + vMuon1.SetPtEtaPhiM(muontrack_at_pv[0].getPt(), muontrack_at_pv[0].getEta(), muontrack_at_pv[0].getPhi(), mMu); + vMuon2.SetPtEtaPhiM(muontrack_at_pv[1].getPt(), muontrack_at_pv[1].getEta(), muontrack_at_pv[1].getPhi(), mMu); + mDimuon = vMuon1 + vMuon2; + } + inline int getTagMuonIndex() const { return tagIdx; } + inline int getProbeMuonIndex() const { return probeIdx; } + inline float getMass() const { return mDimuon.M(); } + inline float getPt() const { return mDimuon.Pt(); } + inline float getRap() const { return mDimuon.Rapidity(); } + inline int16_t getCharge() const { return mQ; } + inline const o2::dataformats::GlobalFwdTrack& getMuonAtPV(int idx) const { return muontrack_at_pv[idx]; } + }; // end of class FindTagAndProbe + + template + class MatchingParamsML { + private: + MUON muontrack; + MFT mfttrack; + Collision collision; + + float mDX, mDY, mDPt, mDPhi, mDEta; + float mGlobalMuonPtAtDCA, mGlobalMuonEtaAtDCA, mGlobalMuonPhiAtDCA, mGlobalMuonDCAx, mGlobalMuonDCAy, mGlobalMuonQ; + int mMatchingType; + + o2::field::MagneticField* fieldB; + o2::globaltracking::MatchGlobalFwd mMatching; + + inline o2::track::TrackParCovFwd propagateMFTtoMatchingPlane() + { + double covArr[15]{0.0}; + SMatrix55 tmftcovs(covArr, covArr + 15); + + SMatrix5 tmftpars(mfttrack.x(), mfttrack.y(), mfttrack.phi(), mfttrack.tgl(), mfttrack.signed1Pt()); + o2::track::TrackParCovFwd extrap_mfttrack{mfttrack.z(), tmftpars, tmftcovs, mfttrack.chi2()}; + + double propVec[3] = {0.}; + float zPlane = 0.f; + if (mMatchingType == MCH_FIRST_CLUSTER) { + propVec[0] = muontrack.x() - mfttrack.x(); + propVec[1] = muontrack.y() - mfttrack.y(); + propVec[2] = muontrack.z() - mfttrack.z(); + zPlane = muontrack.z(); + } else if (mMatchingType == END_OF_ABSORBER || mMatchingType == BEGINING_OF_ABSORBER) { + auto extrap_muontrack = propagateMUONtoMatchingPlane(); + propVec[0] = extrap_muontrack.getX() - mfttrack.x(); + propVec[1] = extrap_muontrack.getY() - mfttrack.y(); + propVec[2] = extrap_muontrack.getZ() - mfttrack.z(); + zPlane = (mMatchingType == END_OF_ABSORBER) ? -505.f : -90.f; + } else { + zPlane = mfttrack.z(); + } - auto collision = muon.collision(); - - o2::dataformats::GlobalFwdTrack propmuon; - - double chi2 = muon.chi2(); - - SMatrix5 tpars(muon.x(), muon.y(), muon.phi(), muon.tgl(), muon.signed1Pt()); - std::vector v1{muon.cXX(), muon.cXY(), muon.cYY(), muon.cPhiX(), muon.cPhiY(), - muon.cPhiPhi(), muon.cTglX(), muon.cTglY(), muon.cTglPhi(), muon.cTglTgl(), - muon.c1PtX(), muon.c1PtY(), muon.c1PtPhi(), muon.c1PtTgl(), muon.c1Pt21Pt2()}; - if (isGoodMUONTrack(muon)) { - SMatrix55 tcovs(v1.begin(), v1.end()); - o2::track::TrackParCovFwd fwdtrack{muon.z(), tpars, tcovs, chi2}; - - o2::dataformats::GlobalFwdTrack track; - track.setParameters(tpars); - track.setZ(fwdtrack.getZ()); - track.setCovariances(tcovs); - auto mchTrack = mMatching.FwdtoMCH(track); - if (PropType == ProagationPoint::ToVtx) - o2::mch::TrackExtrap::extrapToVertex(mchTrack, collision.posX(), collision.posY(), collision.posZ(), collision.covXX(), collision.covYY()); - else if (PropType == ProagationPoint::ToDCA) - o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchTrack, collision.posZ()); - - auto proptrack = mMatching.MCHtoFwd(mchTrack); - propmuon.setParameters(proptrack.getParameters()); - propmuon.setZ(proptrack.getZ()); - propmuon.setCovariances(proptrack.getCovariances()); + double centerZ[3] = {mfttrack.x() + propVec[0] / 2., mfttrack.y() + propVec[1] / 2., mfttrack.z() + propVec[2] / 2.}; + float Bz = fieldB->getBz(centerZ); + extrap_mfttrack.propagateToZ(zPlane, Bz); // z in cm + return extrap_mfttrack; } - v1.clear(); - v1.shrink_to_fit(); + inline o2::dataformats::GlobalFwdTrack propagateMUONtoMatchingPlane() + { + float cov[15] = { + muontrack.cXX(), muontrack.cXY(), muontrack.cYY(), + muontrack.cPhiX(), muontrack.cPhiY(), muontrack.cPhiPhi(), + muontrack.cTglX(), muontrack.cTglY(), muontrack.cTglPhi(), + muontrack.cTglTgl(), muontrack.c1PtX(), muontrack.c1PtY(), + muontrack.c1PtPhi(), muontrack.c1PtTgl(), muontrack.c1Pt21Pt2()}; + + SMatrix5 tpars(muontrack.x(), muontrack.y(), muontrack.phi(), muontrack.tgl(), muontrack.signed1Pt()); + SMatrix55 tcovs(cov, cov + 15); + double chi2 = muontrack.chi2(); + + o2::track::TrackParCovFwd parcovmuontrack{muontrack.z(), tpars, tcovs, chi2}; + + o2::dataformats::GlobalFwdTrack gtrack; + gtrack.setParameters(tpars); + gtrack.setZ(parcovmuontrack.getZ()); + gtrack.setCovariances(tcovs); + + auto mchtrack = mMatching.FwdtoMCH(gtrack); + + if (mMatchingType == MFT_LAST_CLUSTR) { + o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchtrack, mfttrack.z()); + } else if (mMatchingType == END_OF_ABSORBER) { + o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchtrack, -505.); + } else if (mMatchingType == BEGINING_OF_ABSORBER) { + o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchtrack, -90.); + } - return propmuon; - } + auto fwdtrack = mMatching.MCHtoFwd(mchtrack); - template - o2::track::TrackParCovFwd PropagateMFT(T const& mfttrack, int PropType) - { - std::vector mftv1; - SMatrix55 mftcovs{mftv1.begin(), mftv1.end()}; - SMatrix5 mftpars = {mfttrack.x(), mfttrack.y(), mfttrack.phi(), mfttrack.tgl(), mfttrack.signed1Pt()}; - o2::track::TrackParCovFwd mftpartrack = {mfttrack.z(), mftpars, mftcovs, mfttrack.chi2()}; - if (PropType == ProagationPoint::ToDCA) { - auto collision = mfttrack.collision(); - double propVec[3] = {fabs(mfttrack.x() - collision.posX()), fabs(mfttrack.y() - collision.posY()), fabs(mfttrack.z() - collision.posZ())}; - double centerZ[3] = {mfttrack.x() - propVec[0] / 2., mfttrack.y() - propVec[1] / 2., mfttrack.z() - propVec[2] / 2.}; + o2::dataformats::GlobalFwdTrack extrap_muontrack; + extrap_muontrack.setParameters(fwdtrack.getParameters()); + extrap_muontrack.setZ(fwdtrack.getZ()); + extrap_muontrack.setCovariances(fwdtrack.getCovariances()); + return extrap_muontrack; + } + + inline o2::track::TrackParCovFwd propagateMFTtoDCA() + { + double covArr[15]{0.0}; + SMatrix55 tmftcovs(covArr, covArr + 15); + + SMatrix5 tmftpars(mfttrack.x(), mfttrack.y(), mfttrack.phi(), mfttrack.tgl(), mfttrack.signed1Pt()); + o2::track::TrackParCovFwd extrap_mfttrack{mfttrack.z(), tmftpars, tmftcovs, mfttrack.chi2()}; + + double propVec[3] = {}; + propVec[0] = collision.posX() - mfttrack.x(); + propVec[1] = collision.posY() - mfttrack.y(); + propVec[2] = collision.posZ() - mfttrack.z(); + + double centerZ[3] = {mfttrack.x() + propVec[0] / 2., mfttrack.y() + propVec[1] / 2., mfttrack.z() + propVec[2] / 2.}; float Bz = fieldB->getBz(centerZ); - mftpartrack.propagateToZ(collision.posZ(), Bz); + extrap_mfttrack.propagateToZ(collision.posZ(), Bz); // z in cm + return extrap_mfttrack; } - return mftpartrack; + + inline o2::dataformats::GlobalFwdTrack propagateMUONtoPV() + { + float cov[15] = { + muontrack.cXX(), muontrack.cXY(), muontrack.cYY(), + muontrack.cPhiX(), muontrack.cPhiY(), muontrack.cPhiPhi(), + muontrack.cTglX(), muontrack.cTglY(), muontrack.cTglPhi(), + muontrack.cTglTgl(), muontrack.c1PtX(), muontrack.c1PtY(), + muontrack.c1PtPhi(), muontrack.c1PtTgl(), muontrack.c1Pt21Pt2()}; + + SMatrix5 tpars(muontrack.x(), muontrack.y(), muontrack.phi(), muontrack.tgl(), muontrack.signed1Pt()); + SMatrix55 tcovs(cov, cov + 15); + double chi2 = muontrack.chi2(); + + o2::track::TrackParCovFwd parcovmuontrack{muontrack.z(), tpars, tcovs, chi2}; + + o2::dataformats::GlobalFwdTrack gtrack; + gtrack.setParameters(tpars); + gtrack.setZ(parcovmuontrack.getZ()); + gtrack.setCovariances(tcovs); + + auto mchtrack = mMatching.FwdtoMCH(gtrack); + o2::mch::TrackExtrap::extrapToVertex(mchtrack, collision.posX(), collision.posY(), collision.posZ(), collision.covXX(), collision.covYY()); + + auto fwdtrack = mMatching.MCHtoFwd(mchtrack); + o2::dataformats::GlobalFwdTrack extrap_muontrack; + extrap_muontrack.setParameters(fwdtrack.getParameters()); + extrap_muontrack.setZ(fwdtrack.getZ()); + extrap_muontrack.setCovariances(fwdtrack.getCovariances()); + + return extrap_muontrack; + } + + public: + enum MATCHING_TYPE { MCH_FIRST_CLUSTER, + MFT_LAST_CLUSTR, + END_OF_ABSORBER, + BEGINING_OF_ABSORBER }; + + MatchingParamsML(MUON const& muon, MFT const& mft, Collision const& coll, int MType, o2::field::MagneticField* field) : muontrack(muon), mfttrack(mft), collision(coll), mDX(0.f), mDY(0.f), mDPt(0.f), mDPhi(0.f), mDEta(0.f), mGlobalMuonPtAtDCA(0.f), mGlobalMuonEtaAtDCA(0.f), mGlobalMuonPhiAtDCA(0.f), mGlobalMuonDCAx(0.f), mGlobalMuonDCAy(0.f), mGlobalMuonQ(0.f), mMatchingType(MType), fieldB(field) {} + void calcMatchingParams() + { + auto mfttrack_on_matchingP = propagateMFTtoMatchingPlane(); + auto muontrack_on_matchingP = propagateMUONtoMatchingPlane(); + + float dphiRaw = mfttrack_on_matchingP.getPhi() - muontrack_on_matchingP.getPhi(); + float dphi = TVector2::Phi_mpi_pi(dphiRaw); + float deta = mfttrack_on_matchingP.getEta() - muontrack_on_matchingP.getEta(); + + mDX = mfttrack_on_matchingP.getX() - muontrack_on_matchingP.getX(); + mDY = mfttrack_on_matchingP.getY() - muontrack_on_matchingP.getY(); + mDPt = mfttrack_on_matchingP.getPt() - muontrack_on_matchingP.getPt(); + mDPhi = dphi; + mDEta = deta; + } + + void calcGlobalMuonParams() + { + auto mfttrack_at_dca = propagateMFTtoDCA(); + auto muontrack_at_pv = propagateMUONtoPV(); + + float momentum = muontrack_at_pv.getP(); + float theta = mfttrack_at_dca.getTheta(); + float phiTrack = mfttrack_at_dca.getPhi(); + float px = momentum * std::sin(theta) * std::cos(phiTrack); + float py = momentum * std::sin(theta) * std::sin(phiTrack); + + mGlobalMuonQ = muontrack.sign() + mfttrack.sign(); + mGlobalMuonPtAtDCA = std::sqrt(px * px + py * py); + mGlobalMuonEtaAtDCA = mfttrack_at_dca.getEta(); + mGlobalMuonPhiAtDCA = mfttrack_at_dca.getPhi(); + mGlobalMuonDCAx = mfttrack_at_dca.getX() - collision.posX(); + mGlobalMuonDCAy = mfttrack_at_dca.getY() - collision.posY(); + } + + inline float getDx() const { return mDX; } + inline float getDy() const { return mDY; } + inline float getDphi() const { return mDPhi; } + inline float getDeta() const { return mDEta; } + inline float getDpt() const { return mDPt; } + inline float getGMPtAtDCA() const { return mGlobalMuonPtAtDCA; } + inline float getGMEtaAtDCA() const { return mGlobalMuonEtaAtDCA; } + inline float getGMPhiAtDCA() const { return mGlobalMuonPhiAtDCA; } + inline float getGMDcaX() const { return mGlobalMuonDCAx; } + inline float getGMDcaY() const { return mGlobalMuonDCAy; } + inline float getGMDcaXY() const { return std::sqrt(mGlobalMuonDCAx * mGlobalMuonDCAx + mGlobalMuonDCAy * mGlobalMuonDCAy); } + inline int16_t getGMQ() const { return static_cast(mGlobalMuonQ); } + + }; // end of class MatchingParamsML + + template + o2::dataformats::GlobalFwdTrack propagateMUONtoPV(MUON const& muontrack, Collisions const& collisions) + { + auto collision = collisions.rawIteratorAt(muontrack.collisionId()); + o2::globaltracking::MatchGlobalFwd mMatching; + o2::dataformats::GlobalFwdTrack extrap_muontrack; + + SMatrix5 tpars(muontrack.x(), muontrack.y(), muontrack.phi(), muontrack.tgl(), muontrack.signed1Pt()); + std::vector v1{muontrack.cXX(), muontrack.cXY(), muontrack.cYY(), + muontrack.cPhiX(), muontrack.cPhiY(), muontrack.cPhiPhi(), + muontrack.cTglX(), muontrack.cTglY(), muontrack.cTglPhi(), + muontrack.cTglTgl(), muontrack.c1PtX(), muontrack.c1PtY(), + muontrack.c1PtPhi(), muontrack.c1PtTgl(), muontrack.c1Pt21Pt2()}; + SMatrix55 tcovs(v1.begin(), v1.end()); + double chi2 = muontrack.chi2(); + o2::track::TrackParCovFwd parcovmuontrack{muontrack.z(), tpars, tcovs, chi2}; + + o2::dataformats::GlobalFwdTrack gtrack; + gtrack.setParameters(tpars); + gtrack.setZ(parcovmuontrack.getZ()); + gtrack.setCovariances(tcovs); + auto mchtrack = mMatching.FwdtoMCH(gtrack); + + o2::mch::TrackExtrap::extrapToVertex(mchtrack, collision.posX(), collision.posY(), collision.posZ(), collision.covXX(), collision.covYY()); + + auto fwdtrack = mMatching.MCHtoFwd(mchtrack); + extrap_muontrack.setParameters(fwdtrack.getParameters()); + extrap_muontrack.setZ(fwdtrack.getZ()); + extrap_muontrack.setCovariances(fwdtrack.getCovariances()); + + return extrap_muontrack; + } + + inline bool isGoodTagDimuon(float M) + { + return !(M < fTagMassWindowMin || M > fTagMassWindowMax); } - template - o2::track::TrackParCovFwd PropagateMFTtoMatchingPlane(MFT const& mfttrack, FWD const& fwdtrack) + inline bool isGoodTagMatching(float mDX, float mDY, float mDEta, float mDPhi) { - std::vector v1; // Temporary null vector for the computation of the covariance matrix - double propVec[3] = {fwdtrack.x() - mfttrack.x(), fwdtrack.y() - mfttrack.y(), fwdtrack.z() - mfttrack.z()}; - double centerZ[3] = {mfttrack.x() + propVec[0] / 2., mfttrack.y() + propVec[1] / 2., mfttrack.z() + propVec[2] / 2.}; - float Bz = fieldB->getBz(centerZ); // gives error if the propagator is not initFielded - SMatrix55 tmftcovs(v1.begin(), v1.end()); - SMatrix5 tmftpars(mfttrack.x(), mfttrack.y(), mfttrack.phi(), mfttrack.tgl(), mfttrack.signed1Pt()); - o2::track::TrackParCovFwd extrap_mfttrack{mfttrack.z(), tmftpars, tmftcovs, mfttrack.chi2()}; - extrap_mfttrack.propagateToZ(fwdtrack.z(), Bz); // z in cm - return extrap_mfttrack; + float dxNorm = (mDX - fMeanXTagMuonCut) / (fSigmaXTagMuonCut * 3); + float dyNorm = (mDY - fMeanYTagMuonCut) / (fSigmaYTagMuonCut * 3); + float detaNorm = (mDEta - fMeanEtaTagMuonCut) / (fSigmaEtaTagMuonCut * 3); + float dphiNorm = (mDPhi - fMeanPhiTagMuonCut) / (fSigmaPhiTagMuonCut * 3); + + float rTagXY = dxNorm * dxNorm + dyNorm * dyNorm; + float rTagEtaPhi = detaNorm * detaNorm + dphiNorm * dphiNorm; + + return (rTagXY < 1.f && rTagEtaPhi > 0.f); } - template - bool isGoodMUONTrack(T track) + template + bool isCorrectMatching(MUON const& muontrack, MFT const& mfttrack) { - if (!track.has_collision()) + + int idmuon = muontrack.mcParticleId(); + int idmft = mfttrack.mcParticleId(); + + if (idmuon == -1 || idmft == -1) return false; - if (track.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) + if (idmuon != idmft) return false; - if (track.chi2() > fTrackChi2MchUp) + else + return true; + }; + + template + bool isGoodMuonQuality(MUON muontrack) + { + if (!muontrack.has_collision()) return false; - if (fRabsLow1 > track.rAtAbsorberEnd() || track.rAtAbsorberEnd() > fRabsUp2) + if (muontrack.trackType() != o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) return false; - if (track.rAtAbsorberEnd() < fRabsUp1 && fPdcaUp1 < track.pDca()) + if (muontrack.chi2() > fTrackChi2MchUp) return false; - if (track.rAtAbsorberEnd() > fRabsLow2 && fPdcaUp2 < track.pDca()) + if (fRabsLow1 > muontrack.rAtAbsorberEnd() || muontrack.rAtAbsorberEnd() > fRabsUp2) + return false; + if (muontrack.rAtAbsorberEnd() < fRabsUp1 && fPdcaUp1 < muontrack.pDca()) + return false; + if (muontrack.rAtAbsorberEnd() > fRabsLow2 && fPdcaUp2 < muontrack.pDca()) return false; return true; } - template - int selectTagMUON(T track1, T track2) + template + bool isGoodMuonKine(MUON muontrack) { - if (track1.pt() > track2.pt()) { - return track1.globalIndex(); - } else { - return track2.globalIndex(); - } - } - - template - int selectProbeMUONTrack(T track1, T track2) - { - if (track1.pt() < track2.pt()) { - return track1.globalIndex(); - } else { - return track2.globalIndex(); - } - } - - bool isGoodKenematicMUONTrack(o2::dataformats::GlobalFwdTrack track) - { - if (fEtaMchLow > track.getEta() || track.getEta() > fEtaMchUp) + if (fEtaMchLow > muontrack.getEta() || muontrack.getEta() > fEtaMchUp) return false; return true; } - template - bool isGoodMFTTrack(T track) + template + bool isGoodMFTQuality(MFT mfttrack) { - if (!track.has_collision()) + if (!mfttrack.has_collision()) return false; - if (track.chi2() > fTrackChi2MftUp) + if (mfttrack.chi2() > fTrackChi2MftUp) return false; - if (track.nClusters() < fTrackNClustMftLow) + if (mfttrack.nClusters() < fTrackNClustMftLow) return false; return true; } - bool isGoodKenematicMFTTrack(o2::track::TrackParCovFwd track) + template + bool isGoodMFTKine(MFT mfttrack) { - if (fEtaMftLow > track.getEta() || track.getEta() > fEtaMftUp) { + if (fEtaMftLow > mfttrack.getEta() || mfttrack.getEta() > fEtaMftUp) return false; - } return true; } - void process(aod::Collisions const&, ExtBCs const& ebcs, - MyMuons const& fwdtracks, MyMFTs const& mfttracks) + inline bool isPassMatchingPreselection(float Dx, float Dy) { - initCCDB(ebcs.begin()); - - std::unordered_set bcs_mfttrack; - std::unordered_map map_vtxZ; - std::unordered_map nmfttracks; - std::unordered_map> map_mfttraks; - - for (const auto& mfttrack : mfttracks) { + return !(std::abs(Dx) > fPreselectMatchingX || std::abs(Dy) > fPreselectMatchingY); + } - if (!isGoodMFTTrack(mfttrack)) { + template + void setMUONs(MUONs const& muontracks, Collisions const& collisions) + { + for (auto muontrack : muontracks) { + if (!isGoodMuonQuality(muontrack)) continue; - } - - bcs_mfttrack.insert(mfttrack.collisionId()); - std::vector& tracks = map_mfttraks[mfttrack.collisionId()]; - tracks.push_back(mfttrack.globalIndex()); - - o2::track::TrackParCovFwd mftpartrack = PropagateMFT(mfttrack, ProagationPoint::ToDCA); - - if (!isGoodKenematicMFTTrack(mftpartrack)) { + o2::dataformats::GlobalFwdTrack muontrack_at_pv = propagateMUONtoPV(muontrack, collisions); + if (!isGoodMuonKine(muontrack_at_pv)) continue; - } - - auto collision = mfttrack.collision(); - map_vtxZ[mfttrack.collisionId()] = collision.posZ(); + auto collision = collisions.rawIteratorAt(muontrack.collisionId()); - float dx = mftpartrack.getX() - collision.posX(); - float dy = mftpartrack.getY() - collision.posY(); + bool& has = map_has_muontracks_collisions[muontrack.collisionId()]; + has = true; - mftParams(mfttrack.nClusters(), mfttrack.isCA(), mfttrack.chi2(), mfttrack.sign(), mftpartrack.getPt(), mftpartrack.getEta(), mftpartrack.getPhi(), dx, dy); - nmfttracks[mfttrack.collisionId()]++; + vector& arr_muontracks = map_muontracks[collision.globalIndex()]; + arr_muontracks.push_back(muontrack.globalIndex()); } + } - std::unordered_map nfwdtracks; - std::unordered_map> map_fwdtraks; - - for (auto fwdtrack : fwdtracks) { + template + o2::track::TrackParCovFwd PropagateMFTtoDCA(MFT const& mfttrack, Collisions const& collisions, o2::field::MagneticField* field) + { + auto collision = collisions.rawIteratorAt(mfttrack.collisionId()); + std::vector mftv1; + SMatrix55 mftcovs{mftv1.begin(), mftv1.end()}; + SMatrix5 mftpars = {mfttrack.x(), mfttrack.y(), mfttrack.phi(), mfttrack.tgl(), mfttrack.signed1Pt()}; + o2::track::TrackParCovFwd mftpartrack = {mfttrack.z(), mftpars, mftcovs, mfttrack.chi2()}; + double propVec[3] = {fabs(mfttrack.x() - collision.posX()), + fabs(mfttrack.y() - collision.posY()), + fabs(mfttrack.z() - collision.posZ())}; + double centerZ[3] = {mfttrack.x() - propVec[0] / 2., + mfttrack.y() - propVec[1] / 2., + mfttrack.z() - propVec[2] / 2.}; + float Bz = field->getBz(centerZ); + mftpartrack.propagateToZ(collision.posZ(), Bz); + return mftpartrack; + } - if (!isGoodMUONTrack(fwdtrack)) { + template + void setMFTs(MFTs const& mfttracks, Collisions const& collisions, o2::field::MagneticField* field) + { + for (auto mfttrack : mfttracks) { + if (!isGoodMFTQuality(mfttrack)) continue; - } - o2::dataformats::GlobalFwdTrack propmuonAtPV = PropagateMUONTrack(fwdtrack, ProagationPoint::ToVtx); - if (!isGoodKenematicMUONTrack(propmuonAtPV)) { + o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFTtoDCA(mfttrack, collisions, field); + if (!isGoodMFTKine(mfttrack_at_dca)) continue; - } - - std::vector& tracks = map_fwdtraks[fwdtrack.collisionId()]; - tracks.push_back(fwdtrack.globalIndex()); - bool hasMFT = false; + auto collision = collisions.rawIteratorAt(mfttrack.collisionId()); - std::vector& mfttracks = map_mfttraks[fwdtrack.collisionId()]; + map_vtxz[mfttrack.collisionId()] = collision.posZ(); + map_nmfttrack[mfttrack.collisionId()] += 1; - if (mfttracks.size() > 0) { - hasMFT = true; - } + bool& has = map_has_mfttracks_collisions[mfttrack.collisionId()]; + has = true; - muonParams(fwdtrack.chi2(), fwdtrack.rAtAbsorberEnd(), fwdtrack.sign(), propmuonAtPV.getPt(), propmuonAtPV.getEta(), propmuonAtPV.getPhi(), hasMFT); - nfwdtracks[fwdtrack.collisionId()]++; + vector& arr_mfttracks = map_mfttracks[collision.globalIndex()]; + arr_mfttracks.push_back(mfttrack.globalIndex()); } + } - for (auto fwdtrack1 : fwdtracks) { - - if (!isGoodMUONTrack(fwdtrack1)) { - continue; - } - - int ibc = fwdtrack1.collisionId(); - auto collision = fwdtrack1.collision(); - - o2::dataformats::GlobalFwdTrack fwdtrackAtPV1 = PropagateMUONTrack(fwdtrack1, ProagationPoint::ToVtx); - if (!isGoodKenematicMUONTrack(fwdtrackAtPV1)) { - continue; - } - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /////////////// MIXED EVENT /////////////// - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - for (auto bc_mfttrack : bcs_mfttrack) { - - if (ibc == bc_mfttrack) - continue; - if (fabs(nmfttracks[ibc] - nmfttracks[bc_mfttrack]) > fEventMaxDeltaNMFT) { - continue; - } - if (fabs(map_vtxZ[bc_mfttrack] - collision.posZ()) > fEventMaxDeltaVtxZ) { - continue; - } - - std::vector& mfttrackGlobalIndex = map_mfttraks[bc_mfttrack]; - - for (int idmfttrack1 = 0; idmfttrack1 < static_cast(mfttrackGlobalIndex.size()); ++idmfttrack1) { - - auto mfttrack1 = mfttracks.rawIteratorAt(mfttrackGlobalIndex[idmfttrack1]); - o2::track::TrackParCovFwd mfttrack_at_matching = PropagateMFTtoMatchingPlane(mfttrack1, fwdtrack1); - - V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); - V2.SetPtEtaPhi(fwdtrack1.pt(), fwdtrack1.eta(), fwdtrack1.phi()); - - double deltaPt = mfttrack_at_matching.getPt() - fwdtrack1.pt(); - double deltaX = mfttrack_at_matching.getX() - fwdtrack1.x(); - double deltaY = mfttrack_at_matching.getY() - fwdtrack1.y(); - double deltaPhi = V1.DeltaPhi(V2); - double deltaEta = mfttrack_at_matching.getEta() - fwdtrack1.eta(); - - if (fabs(deltaX) > fPreselectMatchingX) { - continue; - } - if (fabs(deltaY) > fPreselectMatchingY) { - continue; - } - - o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFT(mfttrack1, ProagationPoint::ToDCA); + Produces tableMatchingParams; + Produces tableTagMatchingParams; + Produces tableProbeMatchingParams; + Produces tableMixMatchingParams; + Produces tableMuonPair; - mixmatchingParams(deltaPt, deltaEta, deltaPhi, deltaX, deltaY, fwdtrackAtPV1.getPt(), fwdtrackAtPV1.getEta(), fwdtrack1.sign(), mfttrack_at_dca.getEta(), mfttrack1.sign()); - } - } // end of loop bc_mfttrack + Service ccdbManager; - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /////////////// SAME EVENT /////////////// - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - std::vector& mfttrackGlobalIndex = map_mfttraks[ibc]; + o2::field::MagneticField* fieldB; + o2::ccdb::CcdbApi ccdbApi; - for (int idmfttrack1 = 0; idmfttrack1 < static_cast(mfttrackGlobalIndex.size()); ++idmfttrack1) { + template + void initCCDB(BC const& bc) + { + if (mRunNumber == bc.runNumber()) + return; - auto mfttrack1 = mfttracks.rawIteratorAt(mfttrackGlobalIndex[idmfttrack1]); - o2::track::TrackParCovFwd mfttrack_at_matching = PropagateMFTtoMatchingPlane(mfttrack1, fwdtrack1); - V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); - V2.SetPtEtaPhi(fwdtrack1.pt(), fwdtrack1.eta(), fwdtrack1.phi()); + mRunNumber = bc.runNumber(); + std::map metadata; + auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, mRunNumber); + auto ts = soreor.first; + auto grpmag = ccdbApi.retrieveFromTFileAny(grpmagPath, metadata, ts); + o2::base::Propagator::initFieldFromGRP(grpmag); + if (!o2::base::GeometryManager::isGeometryLoaded()) { + ccdbManager->get(geoPath); + } + o2::mch::TrackExtrap::setField(); + fieldB = static_cast(TGeoGlobalMagField::Instance()->GetField()); + } - double deltaPt = mfttrack_at_matching.getPt() - fwdtrack1.pt(); - double deltaX = mfttrack_at_matching.getX() - fwdtrack1.x(); - double deltaY = mfttrack_at_matching.getY() - fwdtrack1.y(); - double deltaPhi = V1.DeltaPhi(V2); - double deltaEta = mfttrack_at_matching.getEta() - fwdtrack1.eta(); + void init(o2::framework::InitContext&) + { + ccdbManager->setURL(ccdburl); + ccdbManager->setCaching(true); + ccdbManager->setLocalObjectValidityChecking(); + ccdbManager->setFatalWhenNull(false); + ccdbApi.init(ccdburl); + mRunNumber = 0; + } - if (fabs(deltaX) > fPreselectMatchingX) { - continue; - } - if (fabs(deltaY) > fPreselectMatchingY) { + void process(MyCollisions const& collisions, + MyBCs const& bcs, + MyMUONs const& muontracks, + MyMFTs const& mfttracks) + { + LOG(info) << "Process() "; + map_muontracks.clear(); + map_mfttracks.clear(); + map_collisions.clear(); + map_has_muontracks_collisions.clear(); + map_has_mfttracks_collisions.clear(); + + initCCDB(bcs.begin()); + setMUONs(muontracks, collisions); + setMFTs(mfttracks, collisions, fieldB); + + for (auto map_has_muontracks_collision : map_has_muontracks_collisions) { + auto idmuontrack_collisions = map_has_muontracks_collision.first; + for (auto map_has_mfttracks_collision : map_has_mfttracks_collisions) { + auto idmfttrack_collisions = map_has_mfttracks_collision.first; + if (idmuontrack_collisions != idmfttrack_collisions) continue; - } - - o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFT(mfttrack1, ProagationPoint::ToDCA); - - matchingParams(deltaPt, deltaEta, deltaPhi, deltaX, deltaY, - fwdtrackAtPV1.getPt(), fwdtrackAtPV1.getEta(), fwdtrack1.sign(), - mfttrack_at_dca.getEta(), mfttrack1.sign()); - - } // end of loop idmfttrack1 - - std::vector& fwdtrackGlobalIndex = map_fwdtraks[ibc]; + map_collisions[idmfttrack_collisions] = true; + } + } - for (int idfwdtrack2 = 0; idfwdtrack2 < static_cast(fwdtrackGlobalIndex.size()); ++idfwdtrack2) { + for (auto const& map_collision : map_collisions) { + auto const& collision = collisions.rawIteratorAt(map_collision.first); - if (fwdtrack1.globalIndex() == fwdtrackGlobalIndex[idfwdtrack2]) { - continue; - } + for (auto const& imuontrack1 : map_muontracks[map_collision.first]) { + auto const& muontrack1 = muontracks.rawIteratorAt(imuontrack1); - auto fwdtrack2 = fwdtracks.rawIteratorAt(fwdtrackGlobalIndex[idfwdtrack2]); + for (auto const& imfttrack1 : map_mfttracks[map_collision.first]) { + auto const& mfttrack1 = mfttracks.rawIteratorAt(imfttrack1); - if (!isGoodMUONTrack(fwdtrack2)) { - continue; - } + MatchingParamsML matching(muontrack1, mfttrack1, collision, fMatchingMethod, fieldB); + matching.calcMatchingParams(); - o2::dataformats::GlobalFwdTrack fwdtrackAtPV2 = PropagateMUONTrack(fwdtrack2, ProagationPoint::ToVtx); - if (!isGoodKenematicMUONTrack(fwdtrackAtPV2)) { - continue; - } + if (!isPassMatchingPreselection(matching.getDx(), matching.getDy())) + continue; - muon1LV.SetPtEtaPhiM(fwdtrackAtPV1.getPt(), fwdtrackAtPV1.getEta(), fwdtrackAtPV1.getPhi(), mMu); - muon2LV.SetPtEtaPhiM(fwdtrackAtPV2.getPt(), fwdtrackAtPV2.getEta(), fwdtrackAtPV2.getPhi(), mMu); - dimuonLV = muon1LV + muon2LV; + matching.calcGlobalMuonParams(); - muonPairs(nmfttracks[ibc], fwdtrack1.sign() + fwdtrack2.sign(), dimuonLV.M(), dimuonLV.Pt(), dimuonLV.Rapidity()); + bool isTrue = false; - if (fabs(fwdtrack1.sign() + fwdtrack2.sign()) > 0) { - continue; - } - if (fTagMassWindowMin > dimuonLV.M() || dimuonLV.M() > fTagMassWindowMax) { - continue; - } - if (nmfttracks[ibc] < 1) { - continue; + tableMatchingParams(matching.getGMPtAtDCA(), + matching.getGMEtaAtDCA(), + static_cast(matching.getGMQ()), + matching.getDpt(), + matching.getDx(), + matching.getDy(), + matching.getDeta(), + matching.getDphi(), + isTrue); } - tagmuonPairs(nmfttracks[ibc], fwdtrack1.sign() + fwdtrack2.sign(), dimuonLV.M(), dimuonLV.Pt(), dimuonLV.Rapidity()); - - bool isGoodTag = false; - int nMFTCandsTagMUON = 0; - - auto tagfwdtrack = fwdtracks.rawIteratorAt(selectTagMUON(fwdtrack1, fwdtrack2)); - o2::dataformats::GlobalFwdTrack tagfwdtrackAtPV = PropagateMUONTrack(tagfwdtrack, ProagationPoint::ToVtx); - - for (int idmfttrack1 = 0; idmfttrack1 < static_cast(mfttrackGlobalIndex.size()); ++idmfttrack1) { - - auto mfttrack1 = mfttracks.rawIteratorAt(mfttrackGlobalIndex[idmfttrack1]); - o2::track::TrackParCovFwd mfttrack_at_matching = PropagateMFTtoMatchingPlane(mfttrack1, tagfwdtrack); - - V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); - V2.SetPtEtaPhi(tagfwdtrack.pt(), tagfwdtrack.eta(), tagfwdtrack.phi()); - - double deltaPt = mfttrack_at_matching.getPt() - tagfwdtrack.pt(); - double deltaX = mfttrack_at_matching.getX() - tagfwdtrack.x(); - double deltaY = mfttrack_at_matching.getY() - tagfwdtrack.y(); - double deltaPhi = V1.DeltaPhi(V2); - double deltaEta = mfttrack_at_matching.getEta() - tagfwdtrack.eta(); - - if (fabs(deltaX) > fPreselectMatchingX) { + for (auto const& map_mfttrack : map_mfttracks) { + if (map_mfttrack.first == map_collision.first) continue; - } - if (fabs(deltaY) > fPreselectMatchingY) { + if (fabs(map_vtxz[map_mfttrack.first] - map_vtxz[map_collision.first]) > fEventMaxDeltaVtxZ) + continue; + if (fabs(map_nmfttrack[map_mfttrack.first] - map_nmfttrack[map_collision.first]) > fEventMaxDeltaNMFT) continue; - } - - o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFT(mfttrack1, ProagationPoint::ToDCA); - - bool dummyTag = false; - if (fTagXWindowLow < deltaX && deltaX < fTagXWindowUp && - fTagXWindowLow < deltaY && deltaY < fTagXWindowUp && - fTagPhiWindowLow < deltaPhi && deltaPhi < fTagPhiWindowUp && - fTagEtaWindowLow < deltaEta && deltaEta < fTagEtaWindowUp) { - isGoodTag = true; - dummyTag = true; - nMFTCandsTagMUON++; + for (auto const& imfttrack1 : map_mfttrack.second) { + auto const& mfttrack1 = mfttracks.rawIteratorAt(imfttrack1); + MatchingParamsML matching(muontrack1, mfttrack1, collision, fMatchingMethod, fieldB); + matching.calcMatchingParams(); + if (!isPassMatchingPreselection(matching.getDx(), matching.getDy())) + continue; + matching.calcGlobalMuonParams(); + + bool isTrue = false; + + tableMixMatchingParams(matching.getGMPtAtDCA(), + matching.getGMEtaAtDCA(), + static_cast(matching.getGMQ()), + matching.getDpt(), + matching.getDx(), + matching.getDy(), + matching.getDeta(), + matching.getDphi(), + isTrue); } - - tagmatchingParams(deltaPt, deltaEta, deltaPhi, deltaX, deltaY, - tagfwdtrackAtPV.getPt(), tagfwdtrackAtPV.getEta(), tagfwdtrack.sign(), mfttrack_at_dca.getEta(), mfttrack1.sign(), dummyTag); } - if (!isGoodTag) { - continue; - } + for (auto const& imuontrack2 : map_muontracks[map_collision.first]) { - auto probefwdtrack = fwdtracks.rawIteratorAt(selectProbeMUONTrack(fwdtrack1, fwdtrack2)); - o2::dataformats::GlobalFwdTrack probefwdtrackAtPV = PropagateMUONTrack(probefwdtrack, ProagationPoint::ToVtx); - - int nMFTCandsProbeMUON = 0; - /// Counting the number of MFT tracks in a probe muon track - for (int idmfttrack1 = 0; idmfttrack1 < static_cast(mfttrackGlobalIndex.size()); ++idmfttrack1) { + if (imuontrack1 >= imuontrack2) + continue; - auto mfttrack1 = mfttracks.rawIteratorAt(mfttrackGlobalIndex[idmfttrack1]); - o2::track::TrackParCovFwd mfttrack_at_matching = PropagateMFTtoMatchingPlane(mfttrack1, probefwdtrack); - V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); - V2.SetPtEtaPhi(probefwdtrack.pt(), probefwdtrack.eta(), probefwdtrack.phi()); + auto const& muontrack2 = muontracks.rawIteratorAt(imuontrack2); - double deltaX = mfttrack_at_matching.getX() - probefwdtrack.x(); - double deltaY = mfttrack_at_matching.getY() - probefwdtrack.y(); - double deltaPhi = V1.DeltaPhi(V2); - double deltaEta = mfttrack_at_matching.getEta() - probefwdtrack.eta(); + FindTagAndProbe tagdimuon(muontrack1, muontrack2, collision); + tagdimuon.calcMuonPairAtPV(); + tableMuonPair(tagdimuon.getCharge(), tagdimuon.getMass(), tagdimuon.getPt(), tagdimuon.getRap()); - if (fProbeXWindowLow < deltaX && deltaX < fProbeXWindowUp && - fProbeXWindowLow < deltaY && deltaY < fProbeXWindowUp && - fProbePhiWindowLow < deltaPhi && deltaPhi < fProbePhiWindowUp && - fProbeEtaWindowLow < deltaEta && deltaEta < fProbeEtaWindowUp) { - nMFTCandsProbeMUON++; - } - } - - for (int idmfttrack1 = 0; idmfttrack1 < static_cast(mfttrackGlobalIndex.size()); ++idmfttrack1) { - - auto mfttrack1 = mfttracks.rawIteratorAt(mfttrackGlobalIndex[idmfttrack1]); - o2::track::TrackParCovFwd mfttrack_at_matching = PropagateMFTtoMatchingPlane(mfttrack1, probefwdtrack); + if (!isGoodTagDimuon(tagdimuon.getMass())) + continue; - V1.SetPtEtaPhi(mfttrack_at_matching.getPt(), mfttrack_at_matching.getEta(), mfttrack_at_matching.getPhi()); - V2.SetPtEtaPhi(probefwdtrack.pt(), probefwdtrack.eta(), probefwdtrack.phi()); + auto tagmuontrack = muontrack1; + auto probemuontrack = muontrack2; - double deltaPt = mfttrack_at_matching.getPt() - probefwdtrack.pt(); - double deltaX = mfttrack_at_matching.getX() - probefwdtrack.x(); - double deltaY = mfttrack_at_matching.getY() - probefwdtrack.y(); - double deltaPhi = V1.DeltaPhi(V2); - double deltaEta = mfttrack_at_matching.getEta() - probefwdtrack.eta(); + if (tagdimuon.getTagMuonIndex() == 1) { + tagmuontrack = muontrack2; + probemuontrack = muontrack1; + } - if (fabs(deltaX) > fPreselectMatchingX) { + int nTagMFTCand = 0; + int nProbeMFTCand = 0; + + int IndexTagMFTCand = -1; + float tagGMPtAtDCA = 0; + // float tagGMEtaAtDCA = 0; + + float minimumR = 9999.; + int minimumIndexProbeMFTCand = -1; + + unordered_map> map_tagMatchingParams; + unordered_map> map_probeMatchingParams; + + for (auto const& imfttrack1 : map_mfttracks[map_collision.first]) { + auto const& mfttrack1 = mfttracks.rawIteratorAt(imfttrack1); + MatchingParamsML matchingTag(tagmuontrack, mfttrack1, collision, fMatchingMethod, fieldB); + matchingTag.calcMatchingParams(); + matchingTag.calcGlobalMuonParams(); + if (isGoodTagMatching(matchingTag.getDx(), matchingTag.getDy(), matchingTag.getDeta(), matchingTag.getDphi()) && + isPassMatchingPreselection(matchingTag.getDx(), matchingTag.getDy())) { + bool isTrue = false; + tableTagMatchingParams(matchingTag.getGMPtAtDCA(), + matchingTag.getGMEtaAtDCA(), + matchingTag.getGMQ(), + matchingTag.getDpt(), + matchingTag.getDx(), + matchingTag.getDy(), + matchingTag.getDeta(), + matchingTag.getDphi(), + isTrue); + IndexTagMFTCand = mfttrack1.globalIndex(); + tagGMPtAtDCA = matchingTag.getGMPtAtDCA(); + // tagGMEtaAtDCA = matchingTag.getGMEtaAtDCA(); + ++nTagMFTCand; + } + } // end of loop imfttrack1 + + if (nTagMFTCand != 1) continue; - } - if (fabs(deltaY) > fPreselectMatchingY) { + for (auto const& imfttrack1 : map_mfttracks[map_collision.first]) { + auto const& mfttrack1 = mfttracks.rawIteratorAt(imfttrack1); + if (mfttrack1.globalIndex() == IndexTagMFTCand) + continue; + MatchingParamsML matchingProbe(probemuontrack, mfttrack1, collision, fMatchingMethod, fieldB); + matchingProbe.calcMatchingParams(); + if (isPassMatchingPreselection(matchingProbe.getDx(), matchingProbe.getDy())) { + float R = sqrt(matchingProbe.getDx() * matchingProbe.getDx() + matchingProbe.getDy() * matchingProbe.getDy()); + bool isTrue = false; + matchingProbe.calcGlobalMuonParams(); + vector& probeMatchingParams = map_probeMatchingParams[nProbeMFTCand]; + probeMatchingParams.push_back(tagGMPtAtDCA); + probeMatchingParams.push_back(matchingProbe.getGMPtAtDCA()); + probeMatchingParams.push_back(matchingProbe.getGMEtaAtDCA()); + probeMatchingParams.push_back(matchingProbe.getGMQ()); + probeMatchingParams.push_back(matchingProbe.getDpt()); + probeMatchingParams.push_back(matchingProbe.getDx()); + probeMatchingParams.push_back(matchingProbe.getDy()); + probeMatchingParams.push_back(matchingProbe.getDeta()); + probeMatchingParams.push_back(matchingProbe.getDphi()); + probeMatchingParams.push_back(isTrue); + if (R < minimumR) { + minimumIndexProbeMFTCand = nProbeMFTCand; + minimumR = R; + } + ++nProbeMFTCand; + } + } // end of loop imfttrack1 + + if (nProbeMFTCand < 1) continue; + + if (minimumIndexProbeMFTCand > -1) { + vector& probeMatchingParams = map_probeMatchingParams[minimumIndexProbeMFTCand]; + tableProbeMatchingParams(probeMatchingParams[0], + probeMatchingParams[1], + probeMatchingParams[2], + static_cast(probeMatchingParams[3]), + probeMatchingParams[4], + probeMatchingParams[5], + probeMatchingParams[6], + probeMatchingParams[7], + probeMatchingParams[8], + static_cast(probeMatchingParams[9])); } - o2::track::TrackParCovFwd mfttrack_at_dca = PropagateMFT(mfttrack1, ProagationPoint::ToDCA); + } // end of loop imuontrack2 + } // end of loop imuontrack1 + } // end of loop map_collision - probematchingParams(nMFTCandsTagMUON, nMFTCandsProbeMUON, tagfwdtrack.p(), deltaPt, deltaEta, deltaPhi, deltaX, deltaY, probefwdtrackAtPV.getPt(), probefwdtrackAtPV.getEta(), probefwdtrack.sign(), mfttrack_at_dca.getEta(), mfttrack1.sign()); - } - } - } - } + } // end of processMC }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From cf4a172582294f6a0c91a5a05d67cb3f16c55fbb Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Mon, 16 Dec 2024 17:24:02 +0100 Subject: [PATCH 405/459] [PWGLF] adding histograms for cumulant calculations (#9008) Co-authored-by: junleekim --- .../Tasks/Strangeness/lambdapolarization.cxx | 76 ++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/lambdapolarization.cxx b/PWGLF/Tasks/Strangeness/lambdapolarization.cxx index ae794ce1506..eb9b3b12dc7 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolarization.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolarization.cxx @@ -132,6 +132,8 @@ struct lambdapolarization { Configurable cfgEffCor{"cfgEffCor", false, "flag to apply efficiency correction"}; Configurable cfgEffCorPath{"cfgEffCorPath", "", "path for pseudo efficiency correction"}; + Configurable cfgCalcCum{"cfgCalcCum", false, "flag to calculate cumulants"}; + ConfigurableAxis massAxis{"massAxis", {30, 1.1, 1.13}, "Invariant mass axis"}; ConfigurableAxis ptAxis{"ptAxis", {VARIABLE_WIDTH, 0.2, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.5, 8.0, 10.0, 100.0}, "Transverse momentum bins"}; ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 100}, "Centrality interval"}; @@ -150,6 +152,7 @@ struct lambdapolarization { float centrality; double angle; + double psi; double relphi; int currentRunNumber = -999; @@ -213,6 +216,40 @@ struct lambdapolarization { histos.add("QA/ptspecCor_l", "", {HistType::kTH3F, {massAxis, ptAxis, centAxis}}); histos.add("QA/ptspecCor_al", "", {HistType::kTH3F, {massAxis, ptAxis, centAxis}}); + if (cfgCalcCum) { + histos.add("psi2/QA/cosTheta_l", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add("psi2/QA/cosPsi_l", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add("psi2/QA/cosPhi_l", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + + histos.add("psi2/QA/sinPsi_l", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add("psi2/QA/sinPhi_l", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + + histos.add("psi2/QA/cosTheta_cosPhi_l", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add("psi2/QA/cosTheta_cosPsi_l", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + + histos.add("psi2/QA/cosTheta_sinPhi_l", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add("psi2/QA/cosTheta_sinPsi_l", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + + histos.add("psi2/QA/cosPhi_sinPsi_l", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add("psi2/QA/sinPhi_cosPsi_l", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + + histos.add("psi2/QA/cosTheta_al", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add("psi2/QA/cosPsi_al", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add("psi2/QA/cosPhi_al", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + + histos.add("psi2/QA/sinPsi_al", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add("psi2/QA/sinPhi_al", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + + histos.add("psi2/QA/cosTheta_cosPhi_al", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add("psi2/QA/cosTheta_cosPsi_al", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + + histos.add("psi2/QA/cosTheta_sinPhi_al", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add("psi2/QA/cosTheta_sinPsi_al", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + + histos.add("psi2/QA/cosPhi_sinPsi_al", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + histos.add("psi2/QA/sinPhi_cosPsi_al", "", {HistType::kTHnSparseF, {massAxis, ptAxis, cosAxis, centAxis}}); + } + if (cfgQAv0) { histos.add("QA/CentDist", "", {HistType::kTH1F, {centQaAxis}}); histos.add("QA/PVzDist", "", {HistType::kTH1F, {PVzQaAxis}}); @@ -538,7 +575,8 @@ struct lambdapolarization { ProtonBoostedVec = boost(ProtonVec); angle = ProtonBoostedVec.Pz() / ProtonBoostedVec.P(); - relphi = TVector2::Phi_0_2pi(static_cast(nmode) * (LambdaVec.Phi() - TMath::ATan2(collision.qvecIm()[QvecDetInd], collision.qvecRe()[QvecDetInd]) / static_cast(nmode))); + psi = TMath::ATan2(collision.qvecIm()[QvecDetInd], collision.qvecRe()[QvecDetInd]) / static_cast(nmode); + relphi = TVector2::Phi_0_2pi(static_cast(nmode) * (LambdaVec.Phi() - psi)); if (cfgShiftCorr) { auto deltapsiFT0C = 0.0; @@ -591,6 +629,24 @@ struct lambdapolarization { histos.fill(HIST("psi2/h_lambda_cossin"), v0.mLambda(), v0.pt(), angle * TMath::Sin(relphi), centrality, weight); histos.fill(HIST("psi2/h_lambda_vncos"), v0.mLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); histos.fill(HIST("psi2/h_lambda_vnsin"), v0.mLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); + + if (cfgCalcCum) { + histos.fill(HIST("psi2/QA/cosTheta_l"), v0.mLambda(), v0.pt(), angle, centrality); + histos.fill(HIST("psi2/QA/cosPsi_l"), v0.mLambda(), v0.pt(), TMath::Cos(psi * 2.0), centrality); + histos.fill(HIST("psi2/QA/cosPhi_l"), v0.mLambda(), v0.pt(), TMath::Cos(v0.phi() * 2.0), centrality); + + histos.fill(HIST("psi2/QA/sinPsi_l"), v0.mLambda(), v0.pt(), TMath::Sin(psi * 2.0), centrality); + histos.fill(HIST("psi2/QA/sinPhi_l"), v0.mLambda(), v0.pt(), TMath::Sin(v0.phi() * 2.0), centrality); + + histos.fill(HIST("psi2/QA/cosTheta_cosPhi_l"), v0.mLambda(), v0.pt(), angle * TMath::Cos(v0.phi() * 2.0), centrality); + histos.fill(HIST("psi2/QA/cosTheta_cosPsi_l"), v0.mLambda(), v0.pt(), angle * TMath::Cos(psi * 2.0), centrality); + + histos.fill(HIST("psi2/QA/cosTheta_sinPhi_l"), v0.mLambda(), v0.pt(), angle * TMath::Sin(v0.phi() * 2.0), centrality); + histos.fill(HIST("psi2/QA/cosTheta_sinPsi_l"), v0.mLambda(), v0.pt(), angle * TMath::Sin(psi * 2.0), centrality); + + histos.fill(HIST("psi2/QA/cosPhi_sinPsi_l"), v0.mLambda(), v0.pt(), TMath::Cos(v0.phi() * 2.0) * TMath::Sin(psi * 2.0), centrality); + histos.fill(HIST("psi2/QA/sinPhi_cosPsi_l"), v0.mLambda(), v0.pt(), TMath::Sin(v0.phi() * 2.0) * TMath::Cos(psi * 2.0), centrality); + } } if (aLambdaTag) { histos.fill(HIST("psi2/h_alambda_cos"), v0.mAntiLambda(), v0.pt(), angle, centrality, relphi, weight); @@ -598,6 +654,24 @@ struct lambdapolarization { histos.fill(HIST("psi2/h_alambda_cossin"), v0.mAntiLambda(), v0.pt(), angle * TMath::Sin(relphi), centrality, weight); histos.fill(HIST("psi2/h_alambda_vncos"), v0.mAntiLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); histos.fill(HIST("psi2/h_alambda_vnsin"), v0.mAntiLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); + + if (cfgCalcCum) { + histos.fill(HIST("psi2/QA/cosTheta_al"), v0.mLambda(), v0.pt(), angle, centrality); + histos.fill(HIST("psi2/QA/cosPsi_al"), v0.mLambda(), v0.pt(), TMath::Cos(psi * 2.0), centrality); + histos.fill(HIST("psi2/QA/cosPhi_al"), v0.mLambda(), v0.pt(), TMath::Cos(v0.phi() * 2.0), centrality); + + histos.fill(HIST("psi2/QA/sinPsi_al"), v0.mLambda(), v0.pt(), TMath::Sin(psi * 2.0), centrality); + histos.fill(HIST("psi2/QA/sinPhi_al"), v0.mLambda(), v0.pt(), TMath::Sin(v0.phi() * 2.0), centrality); + + histos.fill(HIST("psi2/QA/cosTheta_cosPhi_al"), v0.mLambda(), v0.pt(), angle * TMath::Cos(v0.phi() * 2.0), centrality); + histos.fill(HIST("psi2/QA/cosTheta_cosPsi_al"), v0.mLambda(), v0.pt(), angle * TMath::Cos(psi * 2.0), centrality); + + histos.fill(HIST("psi2/QA/cosTheta_sinPhi_al"), v0.mLambda(), v0.pt(), angle * TMath::Sin(v0.phi() * 2.0), centrality); + histos.fill(HIST("psi2/QA/cosTheta_sinPsi_al"), v0.mLambda(), v0.pt(), angle * TMath::Sin(psi * 2.0), centrality); + + histos.fill(HIST("psi2/QA/cosPhi_sinPsi_al"), v0.mLambda(), v0.pt(), TMath::Cos(v0.phi() * 2.0) * TMath::Sin(psi * 2.0), centrality); + histos.fill(HIST("psi2/QA/sinPhi_cosPsi_al"), v0.mLambda(), v0.pt(), TMath::Sin(v0.phi() * 2.0) * TMath::Cos(psi * 2.0), centrality); + } } } else if (nmode == 3) { if (LambdaTag) { From 45c3344b6f9719b8359fc02f3c6bf5c326075bd9 Mon Sep 17 00:00:00 2001 From: Daniel Samitz <69901155+DanielSamitz@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:34:57 +0100 Subject: [PATCH 406/459] [PWGEM] add JPsi to LF cocktail analysis task (#9011) --- PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx b/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx index 86b69e3a78d..b06daf77aff 100644 --- a/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx +++ b/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx @@ -58,7 +58,8 @@ struct lmeelfcocktail { {331, {"etaP/", {22, 223, 211 * 211}}}, {113, {"rho/", {-1}}}, {223, {"omega/", {-1, 111}}}, - {333, {"phi/", {-1, 111, 221}}}}; + {333, {"phi/", {-1, 111, 221}}}, + {443, {"Jpsi/", {-1}}}}; std::map histogramId; From 4fc8f717ed3c02c071a623018f235b7b65a2142f Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Mon, 16 Dec 2024 19:08:10 +0100 Subject: [PATCH 407/459] [PWGLF] get centrality value (fix) (#9009) --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 44 ++++++++++++++---------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index ac4836d204d..8b3e2b5532d 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -447,20 +447,23 @@ struct ebyeMaker { } template - float getOuterPID(T const& track) + float getITSSignal(T const& track, aod::Run2TrackExtras const& trackExtraRun2) { - if (doprocessMiniRun2 || doprocessMiniMcRun2) { - if (track.hasTOF() && track.pt() > antipPtTof) - return track.tofNSigmaPr(); - // else if (track.pt() < antipPtTof && track.pt() > antipPtMin) { - // return track.tpcNSigmaPr() > -4.f ? track.tpcNSigmaPr() : -999.f; - // } - else - return -999.f; + if ((doprocessMiniRun2 || doprocessMiniMcRun2) && track.hasITS()) { + auto extra = trackExtraRun2.rawIteratorAt(track.globalIndex()); + return extra.itsSignal(); } return -999.f; } + template + float getOuterPID(T const& track) + { + if ((doprocessMiniRun2 || doprocessMiniMcRun2) && track.hasTOF() && track.pt() > antipPtTof) + return track.tofNSigmaPr(); + return -999.f; + } + float getV0M(int64_t const id, float const zvtx, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs) { auto fv0a = fv0as.rawIteratorAt(id); @@ -562,8 +565,7 @@ struct ebyeMaker { // antid and antip QA histos.add("QA/tpcSignal", ";#it{p}_{TPC} (GeV/#it{c});d#it{E}/d#it{x}_{TPC} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); histos.add("QA/tpcSignalPr", ";#it{p}_{TPC} (GeV/#it{c});d#it{E}/d#it{x}_{TPC} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); - // histos.add("QA/itsSignal", ";#it{p}_{ITS} (GeV/#it{c});d#it{E}/d#it{x}_{ITS} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); - // histos.add("QA/itsSignalPr", ";#it{p}_{ITS} (GeV/#it{c});d#it{E}/d#it{x}_{ITS} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); + histos.add("QA/itsSignal", ";#it{p}_{glo} (GeV/#it{c});d#it{E}/d#it{x}_{ITS} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); tofMass[0] = histos.add("QA/tofMass_p", ";Centrality (%);#it{p}_{T} (GeV/#it{c});Mass (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, tofMassAxis}); tofMass[1] = histos.add("QA/tofMass_d", ";Centrality (%);#it{p}_{T} (GeV/#it{c});Mass (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, tofMassAxis}); @@ -1041,7 +1043,7 @@ struct ebyeMaker { float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); float cV0M = -999.f; if (Run2V0MInfo.mCalibrationStored) { - Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); if (!(collision.sel7() && collision.alias_bit(kINT7)) && (!kINT7Intervals || (kINT7Intervals && ((cV0M >= 10 && cV0M < 30) || cV0M > 50)))) continue; } @@ -1108,7 +1110,7 @@ struct ebyeMaker { } PROCESS_SWITCH(ebyeMaker, processRun2, "process (Run 2)", false); - void processMiniRun2(soa::Join const& collisions, TracksFullPID const& tracks, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, aod::V0s const& V0s, BCsWithRun2Info const&) + void processMiniRun2(soa::Join const& collisions, TracksFullPID const& tracks, aod::Run2TrackExtras const& trackExtraRun2, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, aod::V0s const& V0s, BCsWithRun2Info const&) { for (const auto& collision : collisions) { @@ -1118,7 +1120,7 @@ struct ebyeMaker { if (std::abs(collision.posZ()) > zVtxMax) continue; - if (!collision.alias_bit(kINT7)) + if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kINELgtZERO))) continue; if (!(bc.eventCuts() & BIT(aod::Run2EventCuts::kAliEventCutsAccepted))) @@ -1127,7 +1129,7 @@ struct ebyeMaker { float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); float cV0M = -999.f; if (Run2V0MInfo.mCalibrationStored) { - Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); } histos.fill(HIST("QA/zVtx"), collision.posZ()); @@ -1144,6 +1146,9 @@ struct ebyeMaker { for (auto& candidateTrack : candidateTracks[0]) { // protons auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex); float outerPID = getOuterPID(tk); + float itsSignal = getITSSignal(tk, trackExtraRun2); + histos.fill(HIST("QA/itsSignal"), tk.p(), itsSignal); + candidateTrack.outerPID = tk.pt() < antipPtTof ? candidateTrack.outerPID : outerPID; int selMask = getTrackSelMask(candidateTrack); if (candidateTrack.outerPID < outerPIDMin) @@ -1244,7 +1249,7 @@ struct ebyeMaker { float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); float cV0M = -999.f; if (Run2V0MInfo.mCalibrationStored) { - Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); } histos.fill(HIST("QA/zVtx"), collision.posZ()); @@ -1300,7 +1305,7 @@ struct ebyeMaker { } PROCESS_SWITCH(ebyeMaker, processMcRun2, "process MC (Run 2)", false); - void processMiniMcRun2(soa::Join const& collisions, aod::McCollisions const& /*mcCollisions*/, TracksFullPID const& tracks, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, aod::V0s const& V0s, aod::McParticles const& mcParticles, aod::McTrackLabels const& mcLab, BCsWithRun2Info const&) + void processMiniMcRun2(soa::Join const& collisions, aod::McCollisions const& /*mcCollisions*/, TracksFullPID const& tracks, aod::Run2TrackExtras const& trackExtraRun2, aod::FV0As const& fv0as, aod::FV0Cs const& fv0cs, aod::V0s const& V0s, aod::McParticles const& mcParticles, aod::McTrackLabels const& mcLab, BCsWithRun2Info const&) { for (const auto& collision : collisions) { @@ -1316,7 +1321,7 @@ struct ebyeMaker { float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); float cV0M = -999.f; if (Run2V0MInfo.mCalibrationStored) { - Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); + cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); } histos.fill(HIST("QA/zVtx"), collision.posZ()); @@ -1335,6 +1340,9 @@ struct ebyeMaker { if (candidateTrack.isreco) { auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex); float outerPID = getOuterPID(tk); + float itsSignal = getITSSignal(tk, trackExtraRun2); + histos.fill(HIST("QA/itsSignal"), tk.p(), itsSignal); + candidateTrack.outerPID = tk.pt() < antipPtTof ? candidateTrack.outerPID : outerPID; selMask = getTrackSelMask(candidateTrack); // if (candidateTrack.outerPID < -4) From a947839eaae0c818b5cff3ef16749215063b19b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:40:46 +0100 Subject: [PATCH 408/459] [PWGHF] Add the missed rapidity for D0 (#9010) --- PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index 763a1292a52..aa6ba1525eb 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -243,6 +243,7 @@ struct HfTaskDirectedFlowCharmHadrons { switch (channel) { case DecayChannel::D0ToPiK: massCand = hfHelper.invMassD0ToPiK(candidate); + rapCand = hfHelper.yD0(candidate); if constexpr (std::is_same_v) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) outputMl[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; @@ -250,6 +251,7 @@ struct HfTaskDirectedFlowCharmHadrons { break; case DecayChannel::D0ToKPi: massCand = hfHelper.invMassD0barToKPi(candidate); + rapCand = hfHelper.yD0(candidate); if constexpr (std::is_same_v) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) outputMl[iclass] = candidate.mlProbD0bar()[classMl->at(iclass)]; From 9aab15b79336b49c0ae8a20f8393acd3367c7209 Mon Sep 17 00:00:00 2001 From: Anantha Padmanabhan M Nair <82643666+ananthapadmanabhan18@users.noreply.github.com> Date: Tue, 17 Dec 2024 02:11:19 +0530 Subject: [PATCH 409/459] [PWGUD] Applied pT and y cuts to invariant mass distributions (#9013) --- PWGUD/Tasks/exclusiveRhoTo4Pi.cxx | 88 ++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 25 deletions(-) diff --git a/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx b/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx index 9d4cc4ca728..bb90337e371 100644 --- a/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx +++ b/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx @@ -82,27 +82,35 @@ struct UPCAnalysis { histos.add("tofNSigmaPi_WTS_PID_Pi", "TOF nSigma Pion with track selection and PID Selection of Pi; Entries", kTH1F, {{100, -15, 15}}); // Track Transverse Momentum - histos.add("pT_track_WOTS", "pT without track selection; pT [GeV/c]; Events", kTH1F, {{100, 0, 2}}); - histos.add("pT_track_WTS", "pT with track selection; pT [GeV/c]; Events", kTH1F, {{100, 0, 2}}); - histos.add("pT_track_WTS_PID_Pi", "pT with track selection and PID selection of Pi; pT [GeV/c]; Events", kTH1F, {{100, 0, 2}}); + histos.add("pT_track_WOTS", "pT without track selection; pT [GeV/c]; Events", kTH1F, {{1000, 0, 2}}); + histos.add("pT_track_WTS", "pT with track selection; pT [GeV/c]; Events", kTH1F, {{1000, 0, 2}}); + histos.add("pT_track_WTS_PID_Pi", "pT with track selection and PID selection of Pi; pT [GeV/c]; Events", kTH1F, {{1000, 0, 2}}); // Zero charge Event Transverse Momentum - histos.add("pT_event_0charge_WTS_PID_Pi", "Event pT in 0 Charge Events With Track Selection and PID Selection of Pi; pT [GeV/c]; Counts", kTH1F, {{100, 0, 2}}); + histos.add("pT_event_0charge_WTS_PID_Pi", "Event pT in 0 Charge Events With Track Selection and PID Selection of Pi; pT [GeV/c]; Counts", kTH1F, {{1000, 0, 2}}); // Non Zero charge Event Transverse Momentum histos.add("pT_event_non0charge_WTS_PID_Pi", "Event pT in Non 0 Charge Events With Track Selection and PID Selection of Pi; pT [GeV/c]; Counts", kTH1F, {{100, 0, 2}}); // Rapidity of 0 charge Events - histos.add("rapidity_event_0charge_WTS_PID_Pi", "Rapidity of Events With Track Selection and PID Selection of Pi; y; Counts", kTH1F, {{100, -2.5, 2.5}}); + histos.add("rapidity_event_0charge_WTS_PID_Pi_domainA", "Rapidity of Events With Track Selection and PID Selection of Pi for p_{T} < 0.15 GeV/c; y; Counts", kTH1F, {{1000, -2.5, 2.5}}); + histos.add("rapidity_event_0charge_WTS_PID_Pi_domainB", "Rapidity of Events With Track Selection and PID Selection of Pi for 0.15< p_{T} < 0.80 GeV/c; y; Counts", kTH1F, {{1000, -2.5, 2.5}}); + histos.add("rapidity_event_0charge_WTS_PID_Pi_domainC", "Rapidity of Events With Track Selection and PID Selection of Pi for p_{T} > 0.80 GeV/c; y; Counts", kTH1F, {{1000, -2.5, 2.5}}); // Rapidity of non 0 charge Events - histos.add("rapidity_event_non0charge_WTS_PID_Pi", "Rapidity of Events With Track Selection and PID Selection of Pi; y; Counts", kTH1F, {{100, -2.5, 2.5}}); + histos.add("rapidity_event_non0charge_WTS_PID_Pi_domainA", "Rapidity of Events With Track Selection and PID Selection of Pi for p_{T} < 0.15 GeV/c; y; Counts", kTH1F, {{1000, -2.5, 2.5}}); + histos.add("rapidity_event_non0charge_WTS_PID_Pi_domainB", "Rapidity of Events With Track Selection and PID Selection of Pi for 0.15< p_{T} < 0.80 GeV/c$; y; Counts", kTH1F, {{1000, -2.5, 2.5}}); + histos.add("rapidity_event_non0charge_WTS_PID_Pi_domainC", "Rapidity of Events With Track Selection and PID Selection of Pi for p_{T} > 0.80 GeV/c; y; Counts", kTH1F, {{1000, -2.5, 2.5}}); // Invariant Mass of 0 charge events - histos.add("invMass_event_0charge_WTS_PID_Pi", "Invariant Mass Distribution of 0 charge Events with PID Selection of Pi; m(#pi^{+}#pi^{-}#pi^{+}#pi^{-}) [GeV/c]", kTH1F, {{1000, 0.8, 2.5}}); + histos.add("invMass_event_0charge_WTS_PID_Pi_domainA", "Invariant Mass Distribution of 0 charge Events with PID Selection of Pi for p_{T} < 0.15 GeV/c; m(#pi^{+}#pi^{-}#pi^{+}#pi^{-}) [GeV/c]", kTH1F, {{1000, 0.8, 2.5}}); // pT < 0.15GeV + histos.add("invMass_event_0charge_WTS_PID_Pi_domainB", "Invariant Mass Distribution of 0 charge Events with PID Selection of Pi for 0.15< p_{T} < 0.80 GeV/c; m(#pi^{+}#pi^{-}#pi^{+}#pi^{-}) [GeV/c]", kTH1F, {{1000, 0.8, 2.5}}); // 0.15GeV < pT < 0.8GeV + histos.add("invMass_event_0charge_WTS_PID_Pi_domainC", "Invariant Mass Distribution of 0 charge Events with PID Selection of Pi for p_{T} > 0.80 GeV/c; m(#pi^{+}#pi^{-}#pi^{+}#pi^{-}) [GeV/c]", kTH1F, {{1000, 0.8, 2.5}}); // 0.8GeV < pT // Invariant mass of non 0 charge events - histos.add("invMass_event_non0charge_WTS_PID_Pi", "Invariant Mass Distribution of non 0 charge Events with PID Selection of Pi; m(#pi^{+}#Pi^{-}#pi^{+}#pi^{-}) [GeV/c]", kTH1F, {{1000, 0.8, 2.5}}); + histos.add("invMass_event_non0charge_WTS_PID_Pi_domainA", "Invariant Mass Distribution of non 0 charge Events with PID Selection of Pi for p_{T} < 0.15 GeV/c; m(#pi^{+}#pi^{-}#pi^{+}#pi^{-}) [GeV/c]", kTH1F, {{1000, 0.8, 2.5}}); // pT < 0.15GeV + histos.add("invMass_event_non0charge_WTS_PID_Pi_domainB", "Invariant Mass Distribution of non 0 charge Events with PID Selection of Pi for 0.15< p_{T} < 0.80 GeV/c; m(#pi^{+}#pi^{-}#pi^{+}#pi^{-}) [GeV/c]", kTH1F, {{1000, 0.8, 2.5}}); // 0.15GeV < pT < 0.8GeV + histos.add("invMass_event_non0charge_WTS_PID_Pi_domainC", "Invariant Mass Distribution of non 0 charge Events with PID Selection of Pi for p_{T} > 0.80 GeV/c; m(#pi^{+}#pi^{-}#pi^{+}#pi^{-}) [GeV/c]", kTH1F, {{1000, 0.8, 2.5}}); // 0.8GeV < pT // tpc signal histos.add("tpcSignal", "TPC dEdx vs p; p [GeV/c]; dEdx [a.u.]", kTH2F, {{500, 0, 10}, {5000, 0.0, 5000.0}}); @@ -120,8 +128,10 @@ struct UPCAnalysis { histos.add("V0A", "V0A amplitude", kTH1F, {{1000, 0.0, 100}}); // Collin Soper Theta and Phi - histos.add("CS_phi", "#phi Distribution; #phi; Entries", kTH1F, {{200, -3.2, 3.2}}); - histos.add("CS_costheta", "#theta Distribution;cos(#theta); Entries", kTH1F, {{200, -1, 1}}); + histos.add("CS_phi_pair_1", "#phi Distribution; #phi; Entries", kTH1F, {{200, -3.2, 3.2}}); + histos.add("CS_phi_pair_2", "#phi Distribution; #phi; Entries", kTH1F, {{200, -3.2, 3.2}}); + histos.add("CS_costheta_pair_1", "#theta Distribution;cos(#theta); Entries", kTH1F, {{200, -1, 1}}); + histos.add("CS_costheta_pair_2", "#theta Distribution;cos(#theta); Entries", kTH1F, {{200, -1, 1}}); } // End of init function //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -284,6 +294,7 @@ struct UPCAnalysis { return; } + // Selecting Events with net charge = 0 if (len_Pi_minus == 2 && len_Pi_plus == 2) { TLorentzVector p1, p2, p3, p4, p1234; @@ -307,21 +318,35 @@ struct UPCAnalysis { k23 = k2 + k3; k24 = k2 + k4; - auto phi_pair_1 = PhiCollinsSoperFrame(k13, k24, k1234); - auto phi_pair_2 = PhiCollinsSoperFrame(k14, k23, k1234); - auto cos_theta_1 = CosThetaCollinsSoperFrame(k13, k24, k1234); - auto cos_theta_2 = CosThetaCollinsSoperFrame(k14, k23, k1234); - - histos.fill(HIST("pT_event_0charge_WTS_PID_Pi"), p1234.Pt()); - histos.fill(HIST("rapidity_event_0charge_WTS_PID_Pi"), p1234.Rapidity()); - histos.fill(HIST("invMass_event_0charge_WTS_PID_Pi"), p1234.M()); - histos.fill(HIST("CS_phi"), phi_pair_1); - histos.fill(HIST("CS_phi"), phi_pair_2); - histos.fill(HIST("CS_costheta"), cos_theta_1); - histos.fill(HIST("CS_costheta"), cos_theta_2); + if (fabs(p1234.Rapidity()) < 0.5) { + histos.fill(HIST("pT_event_0charge_WTS_PID_Pi"), p1234.Pt()); + if (p1234.Pt() < 0.15) { + histos.fill(HIST("rapidity_event_0charge_WTS_PID_Pi_domainA"), p1234.Rapidity()); + histos.fill(HIST("invMass_event_0charge_WTS_PID_Pi_domainA"), p1234.M()); + + auto phi_pair_1 = PhiCollinsSoperFrame(k13, k24, k1234); + auto phi_pair_2 = PhiCollinsSoperFrame(k14, k23, k1234); + auto cos_theta_1 = CosThetaCollinsSoperFrame(k13, k24, k1234); + auto cos_theta_2 = CosThetaCollinsSoperFrame(k14, k23, k1234); + + histos.fill(HIST("CS_phi_pair_1"), phi_pair_1); + histos.fill(HIST("CS_phi_pair_2"), phi_pair_2); + histos.fill(HIST("CS_costheta_pair_1"), cos_theta_1); + histos.fill(HIST("CS_costheta_pair_2"), cos_theta_2); + } + if (p1234.Pt() > 0.15 && p1234.Pt() < 0.80) { + histos.fill(HIST("rapidity_event_0charge_WTS_PID_Pi_domainB"), p1234.Rapidity()); + histos.fill(HIST("invMass_event_0charge_WTS_PID_Pi_domainB"), p1234.M()); + } + if (p1234.Pt() > 0.80) { + histos.fill(HIST("rapidity_event_0charge_WTS_PID_Pi_domainC"), p1234.Rapidity()); + histos.fill(HIST("invMass_event_0charge_WTS_PID_Pi_domainC"), p1234.M()); + } + } // End of Rapidity range selection } // End of Analysis for 0 charge events + // Selecting Events with net charge != 0 for estimation of background if (len_Pi_minus != 2 && len_Pi_plus != 2) { TLorentzVector p1, p2, p3, p4, p1234; @@ -332,9 +357,22 @@ struct UPCAnalysis { p1234 = p1 + p2 + p3 + p4; - histos.fill(HIST("pT_event_non0charge_WTS_PID_Pi"), p1234.Pt()); - histos.fill(HIST("rapidity_event_non0charge_WTS_PID_Pi"), p1234.Rapidity()); - histos.fill(HIST("invMass_event_non0charge_WTS_PID_Pi"), p1234.M()); + if (fabs(p1234.Rapidity()) < 0.5) { + histos.fill(HIST("pT_event_non0charge_WTS_PID_Pi"), p1234.Pt()); + + if (p1234.Pt() < 0.15) { + histos.fill(HIST("rapidity_event_non0charge_WTS_PID_Pi_domainA"), p1234.Rapidity()); + histos.fill(HIST("invMass_event_non0charge_WTS_PID_Pi_domainA"), p1234.M()); + } + if (p1234.Pt() > 0.15 && p1234.Pt() < 0.80) { + histos.fill(HIST("rapidity_event_non0charge_WTS_PID_Pi_domainB"), p1234.Rapidity()); + histos.fill(HIST("invMass_event_non0charge_WTS_PID_Pi_domainB"), p1234.M()); + } + if (p1234.Pt() > 0.80) { + histos.fill(HIST("rapidity_event_non0charge_WTS_PID_Pi_domainC"), p1234.Rapidity()); + histos.fill(HIST("invMass_event_non0charge_WTS_PID_Pi_domainC"), p1234.M()); + } + } // End of Rapidity range selection } // End of Analysis for non 0 charge events From 985c34347b02a90d390276cebe6b1f060d7dec26 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Tue, 17 Dec 2024 16:36:28 +0900 Subject: [PATCH 410/459] [PWGEM/Dilepton] add cent info in norm table (#9015) --- PWGEM/Dilepton/DataModel/dileptonTables.h | 2 +- .../TableProducer/createEMEventDilepton.cxx | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/PWGEM/Dilepton/DataModel/dileptonTables.h b/PWGEM/Dilepton/DataModel/dileptonTables.h index 7f252fc4f67..30348b17199 100644 --- a/PWGEM/Dilepton/DataModel/dileptonTables.h +++ b/PWGEM/Dilepton/DataModel/dileptonTables.h @@ -212,7 +212,7 @@ DECLARE_SOA_TABLE(EMEoIs, "AOD", "EMEOI", //! joinable to aod::Collisions in cre using EMEoI = EMEoIs::iterator; DECLARE_SOA_TABLE(EMEventNormInfos, "AOD", "EMEVENTNORMINFO", //! event information for normalization - o2::soa::Index<>, evsel::Alias, evsel::Selection, emevent::PosZint16, emevent::PosZ, emevent::Sel8); + o2::soa::Index<>, evsel::Alias, evsel::Selection, emevent::PosZint16, cent::CentFT0C, emevent::PosZ, emevent::Sel8); using EMEventNormInfo = EMEventNormInfos::iterator; namespace emmcevent diff --git a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx index 9684d394d46..9d60b093bb0 100644 --- a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx +++ b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx @@ -137,7 +137,7 @@ struct CreateEMEventDilepton { PresliceUnsorted perCollision_el = aod::emprimaryelectron::collisionId; PresliceUnsorted perCollision_mu = aod::emprimarymuon::collisionId; - template + template void skimEvent(TCollisions const& collisions, TBCs const&) { for (auto& collision : collisions) { @@ -151,7 +151,13 @@ struct CreateEMEventDilepton { auto bc = collision.template foundBC_as(); initCCDB(bc); - event_norm_info(collision.alias_raw(), collision.selection_raw(), static_cast(10.f * collision.posZ())); + if constexpr (eventtype == EMEventType::kEvent) { + event_norm_info(collision.alias_raw(), collision.selection_raw(), static_cast(10.f * collision.posZ()), 105.f); + } else if constexpr (eventtype == EMEventType::kEvent_Cent || eventtype == EMEventType::kEvent_Cent_Qvec) { + event_norm_info(collision.alias_raw(), collision.selection_raw(), static_cast(10.f * collision.posZ()), collision.centFT0C()); + } else { + event_norm_info(collision.alias_raw(), collision.selection_raw(), static_cast(10.f * collision.posZ()), 105.f); + } if (!collision.isSelected() || !collision.isEoI()) { continue; @@ -175,17 +181,17 @@ struct CreateEMEventDilepton { event_mult(collision.multFT0A(), collision.multFT0C(), collision.multNTracksPV(), collision.multNTracksPVeta1(), collision.multNTracksPVetaHalf()); - if constexpr (eventype == EMEventType::kEvent) { + if constexpr (eventtype == EMEventType::kEvent) { event_cent(105.f, 105.f, 105.f); event_qvec( 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f); - } else if constexpr (eventype == EMEventType::kEvent_Cent) { + } else if constexpr (eventtype == EMEventType::kEvent_Cent) { event_cent(collision.centFT0M(), collision.centFT0A(), collision.centFT0C()); event_qvec( 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f, 999.f); - } else if constexpr (eventype == EMEventType::kEvent_Cent_Qvec) { + } else if constexpr (eventtype == EMEventType::kEvent_Cent_Qvec) { event_cent(collision.centFT0M(), collision.centFT0A(), collision.centFT0C()); float q2xft0m = 999.f, q2yft0m = 999.f, q2xft0a = 999.f, q2yft0a = 999.f, q2xft0c = 999.f, q2yft0c = 999.f, q2xbpos = 999.f, q2ybpos = 999.f, q2xbneg = 999.f, q2ybneg = 999.f, q2xbtot = 999.f, q2ybtot = 999.f; float q3xft0m = 999.f, q3yft0m = 999.f, q3xft0a = 999.f, q3yft0a = 999.f, q3xft0c = 999.f, q3yft0c = 999.f, q3xbpos = 999.f, q3ybpos = 999.f, q3xbneg = 999.f, q3ybneg = 999.f, q3xbtot = 999.f, q3ybtot = 999.f; From a3a15bfd497e1886b509778bfd19cc0fbbd39887 Mon Sep 17 00:00:00 2001 From: Lars <146946151+ljoergen@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:55:04 +0100 Subject: [PATCH 411/459] [PWGLF] AngularCorrelationsInJets.cxx: added MC process (#9007) Co-authored-by: ALICE Action Bot --- .../Nuspex/AngularCorrelationsInJets.cxx | 608 +++++++++++------- 1 file changed, 360 insertions(+), 248 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx b/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx index e30155b61a9..4dc39903415 100644 --- a/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx +++ b/PWGLF/Tasks/Nuspex/AngularCorrelationsInJets.cxx @@ -26,7 +26,9 @@ #include "Common/DataModel/PIDResponse.h" #include "Common/Core/PID/PIDTOF.h" #include "Common/TableProducer/PID/pidTOFBase.h" -#include "PWGLF/DataModel/LFParticleIdentification.h" +#include "Common/DataModel/McCollisionExtra.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" + #include "fastjet/PseudoJet.hh" #include "fastjet/AreaDefinition.hh" #include "fastjet/ClusterSequenceArea.hh" @@ -53,73 +55,75 @@ struct AxisSpecs { struct AngularCorrelationsInJets { // Preliminary Cuts - Configurable fMinNCrossedRowsTPC{"minNCrossedRowsTPC", 70, "min number of crossed rows TPC"}; - Configurable fMinReqClusterITS{"minReqClusterITS", 2, "min number of clusters required in ITS"}; - Configurable fMinReqClusterTPC{"minReqClusterTPC", 70, "min number of clusters required in TPC"}; - Configurable fMinRatioCrossedRowsTPC{"minRatioCrossedRowsTPC", 0.7, "min ratio of crossed rows over findable clusters TPC"}; - Configurable fMaxChi2ITS{"maxChi2ITS", 36.0, "max chi2 per cluster ITS"}; - Configurable fMaxChi2TPC{"maxChi2TPC", 4.0, "max chi2 per cluster TPC"}; - Configurable fMaxDCAxy{"maxDCA_xy", 0.5, "max DCA to vertex xy"}; - Configurable fMaxDCAz{"maxDCA_z", 1.0, "max DCA to vertex z"}; - Configurable fMaxEta{"maxEta", 0.8, "max pseudorapidity"}; // consider jet cone? + Configurable minNCrossedRowsTPC{"minNCrossedRowsTPC", 70, "min number of crossed rows TPC"}; + Configurable minReqClusterITS{"minReqClusterITS", 2, "min number of clusters required in ITS"}; + Configurable minReqClusterTPC{"minReqClusterTPC", 70, "min number of clusters required in TPC"}; + Configurable minRatioCrossedRowsTPC{"minRatioCrossedRowsTPC", 0.7, "min ratio of crossed rows over findable clusters TPC"}; + Configurable maxChi2ITS{"maxChi2ITS", 36.0, "max chi2 per cluster ITS"}; + Configurable maxChi2TPC{"maxChi2TPC", 4.0, "max chi2 per cluster TPC"}; + Configurable maxDCAxy{"maxDCAxy", 0.5, "max DCA to vertex xy"}; + Configurable maxDCAz{"maxDCAz", 1.0, "max DCA to vertex z"}; + Configurable maxEta{"maxEta", 0.8, "max pseudorapidity"}; // consider jet cone? // Jet Cuts - Configurable fJetR{"jetR", 0.4, "jet resolution parameter"}; - Configurable fMinJetPt{"minJetPt", 5.0, "minimum total pT to accept jet"}; - Configurable fMinJetParticlePt{"minJetParticlePt", 0.0, "minimum pT to accept jet particle"}; + Configurable jetR{"jetR", 0.4, "jet resolution parameter"}; + Configurable minJetPt{"minJetPt", 5.0, "minimum total pT to accept jet"}; + Configurable minJetParticlePt{"minJetParticlePt", 0.0, "minimum pT to accept jet particle"}; // Proton Cuts - Configurable fProtonDCAxyYield{"protonDCAxyYield", 0.05, "[proton] DCAxy cut for yield"}; - Configurable fProtonDCAzYield{"protonDCAzYield", 1.0, "[proton] DCAz cut for yield"}; - Configurable fProtonDCAxyCF{"protonDCAxyCF", 0.05, "[proton] DCAxy cut for CF"}; - Configurable fProtonDCAzCF{"protonDCAzCF", 1.0, "[proton] DCAz cut for CF"}; - Configurable fProtonTPCTOFpT{"protonTPCTOFswitchpT", 0.7, "[proton] pT for switch in TPC/TOF nsigma"}; - Configurable fProtonTPCnsigLowYield{"protonTPCnsigmaLowPtYield", 4.0, "[proton] max TPC nsigma with low pT for yield"}; - Configurable fProtonTPCnsigHighYield{"protonTPCnsigmaHighPtYield", 4.0, "[proton] max TPC nsigma with high pT for yield"}; - Configurable fProtonTOFnsigYield{"protonTOFnsigmaHighPtYield", 4.0, "[proton] max TOF nsigma with high pT yield"}; - Configurable fProtonNsigma{"protonNsigma", 2.0, "[proton] max combined nsigma for CF (sqrt(nsigTPC^2 + nsigTOF^2))"}; + Configurable protonDCAxyYield{"protonDCAxyYield", 0.05, "[proton] DCAxy cut for yield"}; + Configurable protonDCAzYield{"protonDCAzYield", 1.0, "[proton] DCAz cut for yield"}; + Configurable protonDCAxyCF{"protonDCAxyCF", 0.05, "[proton] DCAxy cut for CF"}; + Configurable protonDCAzCF{"protonDCAzCF", 1.0, "[proton] DCAz cut for CF"}; + Configurable protonTPCTOFpT{"protonTPCTOFpT", 0.7, "[proton] pT for switch in TPC/TPC+TOF nsigma"}; + Configurable protonTPCnsigmaLowPtYield{"protonTPCnsigmaLowPtYield", 4.0, "[proton] max TPC nsigma with low pT for yield"}; + Configurable protonTPCnsigmaHighPtYield{"protonTPCnsigmaHighPtYield", 4.0, "[proton] max TPC nsigma with high pT for yield"}; + Configurable protonTOFnsigmaHighPtYield{"protonTOFnsigmaHighPtYield", 4.0, "[proton] max TOF nsigma with high pT yield"}; + Configurable protonNsigma{"protonNsigma", 2.0, "[proton] max combined nsigma for CF (sqrt(nsigTPC^2 + nsigTOF^2))"}; // Antiproton Cuts - Configurable fAntiprotonDCAxyYield{"antiprotonDCAxyYield", 0.05, "[antiproton] DCAxy cut for yield"}; - Configurable fAntiprotonDCAzYield{"antiprotonDCAzYield", 1.0, "[antiproton] DCAz cut for yield"}; - Configurable fAntiprotonDCAxyCF{"antiprotonDCAxyCF", 0.05, "[antiproton] DCAxy cut for CF"}; - Configurable fAntiprotonDCAzCF{"antiprotonDCAzCF", 1.0, "[antiproton] DCAz cut for CF"}; - Configurable fAntiprotonTPCTOFpT{"antiprotonTPCTOFswitchpT", 0.7, "[antiproton] pT for switch in TPC/TOF nsigma"}; - Configurable fAntiprotonTPCnsigLowYield{"antiprotonTPCnsigmaLowPtYield", 4.0, "[antiproton] max TPC nsigma with low pT for yield"}; - Configurable fAntiprotonTPCnsigHighYield{"antiprotonTPCnsigmaHighPtYield", 4.0, "[antiproton] max TPC nsigma with high pT for yield"}; - Configurable fAntiprotonTOFnsigYield{"antiprotonTOFnsigmaHighPtYield", 4.0, "[antiproton] min TOF nsigma with high pT for yield"}; - Configurable fAntiprotonNsigma{"antiprotonNsigma", 2.0, "[antiproton] max combined nsigma for CF (sqrt(nsigTPC^2 + nsigTOF^2))"}; + Configurable antiprotonDCAxyYield{"antiprotonDCAxyYield", 0.05, "[antiproton] DCAxy cut for yield"}; + Configurable antiprotonDCAzYield{"antiprotonDCAzYield", 1.0, "[antiproton] DCAz cut for yield"}; + Configurable antiprotonDCAxyCF{"antiprotonDCAxyCF", 0.05, "[antiproton] DCAxy cut for CF"}; + Configurable antiprotonDCAzCF{"antiprotonDCAzCF", 1.0, "[antiproton] DCAz cut for CF"}; + Configurable antiprotonTPCTOFpT{"antiprotonTPCTOFpT", 0.7, "[antiproton] pT for switch in TPC/TPC+TOF nsigma"}; + Configurable antiprotonTPCnsigmaLowPtYield{"antiprotonTPCnsigmaLowPtYield", 4.0, "[antiproton] max TPC nsigma with low pT for yield"}; + Configurable antiprotonTPCnsigmaHighPtYield{"antiprotonTPCnsigmaHighPtYield", 4.0, "[antiproton] max TPC nsigma with high pT for yield"}; + Configurable antiprotonTOFnsigmaHighPtYield{"antiprotonTOFnsigmaHighPtYield", 4.0, "[antiproton] min TOF nsigma with high pT for yield"}; + Configurable antiprotonNsigma{"antiprotonNsigma", 2.0, "[antiproton] max combined nsigma for CF (sqrt(nsigTPC^2 + nsigTOF^2))"}; // Nuclei Cuts - Configurable fNucleiDCAxyYield{"nucleiDCAxyYield", 0.05, "[nuclei] DCAxy cut for yield"}; - Configurable fNucleiDCAzYield{"nucleiDCAzYield", 1.0, "[nuclei] DCAz cut for yield"}; - Configurable fNucleiDCAxyCF{"nucleiDCAxyCF", 0.05, "[nuclei] DCAxy cut for CF"}; - Configurable fNucleiDCAzCF{"nucleiDCAzCF", 1.0, "[nuclei] DCAz cut for CF"}; - Configurable fNucleiTPCTOFpT{"nucleiTPCTOFswitchpT", 0.7, "[nuclei] pT for switch in TPC/TOF nsigma"}; - Configurable fNucleiTPCnsigLowYield{"nucleiTPCnsigmaLowPtYield", 4.0, "[nuclei] max TPC nsigma with low pT for yield"}; - Configurable fNucleiTPCnsigHighYield{"nucleiTPCnsigmaHighPtYield", 4.0, "[nuclei] max TPC nsigma with high pT for yield"}; - Configurable fNucleiTOFnsigYield{"nucleiTOFnsigmaHighPtYield", 4.0, "[nuclei] min TOF nsigma with high pT for yield"}; - Configurable fNucleiNsigma{"nucleiNsigma", 2.0, "[nuclei] max combined nsigma for CF (sqrt(nsigTPC^2 + nsigTOF^2))"}; + Configurable nucleiDCAxyYield{"nucleiDCAxyYield", 0.05, "[nuclei] DCAxy cut for yield"}; + Configurable nucleiDCAzYield{"nucleiDCAzYield", 1.0, "[nuclei] DCAz cut for yield"}; + Configurable nucleiDCAxyCF{"nucleiDCAxyCF", 0.05, "[nuclei] DCAxy cut for CF"}; + Configurable nucleiDCAzCF{"nucleiDCAzCF", 1.0, "[nuclei] DCAz cut for CF"}; + Configurable nucleiTPCTOFpT{"nucleiTPCTOFpT", 0.7, "[nuclei] pT for switch in TPC/TPC+TOF nsigma"}; + Configurable nucleiTPCnsigmaLowPtYield{"nucleiTPCnsigmaLowPtYield", 4.0, "[nuclei] max TPC nsigma with low pT for yield"}; + Configurable nucleiTPCnsigmaHighPtYield{"nucleiTPCnsigmaHighPtYield", 4.0, "[nuclei] max TPC nsigma with high pT for yield"}; + Configurable nucleiTOFnsigmaHighPtYield{"nucleiTOFnsigmaHighPtYield", 4.0, "[nuclei] min TOF nsigma with high pT for yield"}; + Configurable nucleiNsigma{"nucleiNsigma", 2.0, "[nuclei] max combined nsigma for CF (sqrt(nsigTPC^2 + nsigTOF^2))"}; // Antinuclei Cuts - Configurable fAntinucleiDCAxyYield{"antinucleiDCAxyYield", 0.05, "[antinuclei] DCAxy cut for yield"}; - Configurable fAntinucleiDCAzYield{"antinucleiDCAzYield", 1.0, "[antinuclei] DCAz cut for yield"}; - Configurable fAntinucleiDCAxyCF{"antinucleiDCAxyCF", 0.05, "[antinuclei] DCAxy cut for CF"}; - Configurable fAntinucleiDCAzCF{"antinucleiDCAzCF", 1.0, "[antinuclei] DCAz cut for CF"}; - Configurable fAntinucleiTPCTOFpT{"antinucleiTPCTOFswitchpT", 0.7, "[antinuclei] pT for switch in TPC/TOF nsigma"}; - Configurable fAntinucleiTPCnsigLowYield{"antinucleiTPCnsigmaLowPtYield", 4.0, "[antinuclei] max TPC nsigma with low pT for yield"}; - Configurable fAntinucleiTPCnsigHighYield{"antinucleiTPCnsigmaHighPtYield", 4.0, "[antinuclei] max TPC nsigma with high pT for yield"}; - Configurable fAntinucleiTOFnsigYield{"antinucleiTOFnsigmaHighPtYield", 4.0, "[antinuclei] min TOF nsigma with high pT for yield"}; - Configurable fAntinucleiNsigma{"antinucleiNsigma", 2.0, "[nuclei] max combined nsigma for CF (sqrt(nsigTPC^2 + nsigTOF^2))"}; + Configurable antinucleiDCAxyYield{"antinucleiDCAxyYield", 0.05, "[antinuclei] DCAxy cut for yield"}; + Configurable antinucleiDCAzYield{"antinucleiDCAzYield", 1.0, "[antinuclei] DCAz cut for yield"}; + Configurable antinucleiDCAxyCF{"antinucleiDCAxyCF", 0.05, "[antinuclei] DCAxy cut for CF"}; + Configurable antinucleiDCAzCF{"antinucleiDCAzCF", 1.0, "[antinuclei] DCAz cut for CF"}; + Configurable antinucleiTPCTOFpT{"antinucleiTPCTOFpT", 0.7, "[antinuclei] pT for switch in TPC/TPC+TOF nsigma"}; + Configurable antinucleiTPCnsigmaLowPtYield{"antinucleiTPCnsigmaLowPtYield", 4.0, "[antinuclei] max TPC nsigma with low pT for yield"}; + Configurable antinucleiTPCnsigmaHighPtYield{"antinucleiTPCnsigmaHighPtYield", 4.0, "[antinuclei] max TPC nsigma with high pT for yield"}; + Configurable antinucleiTOFnsigmaHighPtYield{"antinucleiTOFnsigmaHighPtYield", 4.0, "[antinuclei] min TOF nsigma with high pT for yield"}; + Configurable antinucleiNsigma{"antinucleiNsigma", 2.0, "[nuclei] max combined nsigma for CF (sqrt(nsigTPC^2 + nsigTOF^2))"}; + + Configurable nsigmaRejection{"nsigmaRejection", 3.0, "particles with TPC nsigma < nsigmaRejection other than the species in question will be rejected"}; - Configurable fDeuteronAnalysis{"deuteronAnalysis", true, "true [false]: analyse (anti)deuterons [(anti)helium-3]"}; - Configurable fUseTOFMass{"useTOFmass", true, "use TOF mass instead of pion mass if available"}; + Configurable deuteronAnalysis{"deuteronAnalysis", true, "true [false]: analyse (anti)deuterons [(anti)helium-3]"}; + Configurable useTOFmass{"useTOFmass", true, "use TOF mass instead of pion mass if available"}; - Configurable fBufferSize{"trackBufferSize", 200, "Number of mixed-event tracks being stored"}; + Configurable trackBufferSize{"trackBufferSize", 200, "Number of mixed-event tracks being stored"}; // QC Configurables - Configurable fZVtx{"zVtx", 10.0, "max zVertex"}; - Configurable fRmax{"Rmax", 0.4, "Maximum radius for jet and UE regions"}; + Configurable zVtx{"zVtx", 10.0, "max zVertex"}; + Configurable Rmax{"Rmax", 0.4, "Maximum radius for jet and UE regions"}; Service ccdb; int mRunNumber; @@ -128,30 +132,29 @@ struct AngularCorrelationsInJets { aod::TrackSelectionExtension, aod::TracksDCA, aod::pidTPCFullPr, aod::pidTPCFullDe, aod::pidTPCFullHe, aod::pidTOFFullPr, aod::pidTOFFullDe, aod::pidTOFFullHe, aod::pidTOFmass, aod::pidTOFbeta, aod::pidTPCEl, aod::pidTPCMu, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCTr, aod::pidTPCAl>; using FullTracksRun3 = soa::Join; - // using McTracksRun2 = soa::Join; - // using McTracksRun3 = soa::Join; + using McTracksRun2 = soa::Join; + using McTracksRun3 = soa::Join; using BCsWithRun2Info = soa::Join; - // using McCollisions = soa::Join::iterator; + using McCollisions = soa::Join; - Filter prelimTrackCuts = (aod::track::itsChi2NCl < fMaxChi2ITS && - aod::track::tpcChi2NCl < fMaxChi2TPC && - nabs(aod::track::dcaXY) < fMaxDCAxy && - nabs(aod::track::dcaZ) < fMaxDCAz && - nabs(aod::track::eta) < fMaxEta); // add more preliminary cuts to filter if possible + Filter prelimTrackCuts = (aod::track::itsChi2NCl < maxChi2ITS && + aod::track::tpcChi2NCl < maxChi2TPC && + nabs(aod::track::dcaXY) < maxDCAxy && + nabs(aod::track::dcaZ) < maxDCAz && + nabs(aod::track::eta) < maxEta); // add more preliminary cuts to filter if possible Preslice perCollisionFullTracksRun2 = o2::aod::track::collisionId; Preslice perCollisionFullTracksRun3 = o2::aod::track::collisionId; - // PreSlice perCollisionMcTracksRun2 = o2::aod::track::collisionId; - // PreSlice perCollisionMcTracksRun3 = o2::aod::track::collisionId; + Preslice perCollisionMcTracksRun2 = o2::aod::track::collisionId; + Preslice perCollisionMcTracksRun3 = o2::aod::track::collisionId; AxisSpecs axisSpecs; HistogramRegistry registryData{"dataOutput", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; - // HistogramRegistry registryMC("MCOutput", {}, OutputObjHandlingPolicy::AnalysisObject, false, true); + HistogramRegistry registryMC{"MCOutput", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry registryQA{"dataQA", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; - // HistogramRegistry registryMCQA("MCQA", {}, OutputObjHandlingPolicy::AnalysisObject, false, true); JetBkgSubUtils bkgSub; @@ -183,29 +186,13 @@ struct AngularCorrelationsInJets { registryData.add("hPtJetNuclei", "p_{T} of nuclei", HistType::kTH1D, {axisSpecs.ptAxisPos}); registryData.add("hPtJetAntinuclei", "p_{T} of antinuclei", HistType::kTH1D, {axisSpecs.ptAxisPos}); registryData.add("hPtTotalJet", "p_{T} of entire jet;#it{p}_{T} [GeV/#it{c}]", HistType::kTH1F, {{1000, 0, 500}}); - registryQA.add("hPtJetProton_15", "Proton p_{T} for jet p_{T} < 15 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetProton_20", "Proton p_{T} for jet p_{T} < 20 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetProton_30", "Proton p_{T} for jet p_{T} < 30 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetProton_50", "Proton p_{T} for jet p_{T} < 50 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetAntiproton_15", "Antiproton p_{T} for jet p_{T} < 15 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetAntiproton_20", "Antiproton p_{T} for jet p_{T} < 20 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetAntiproton_30", "Antiproton p_{T} for jet p_{T} < 30 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetAntiproton_50", "Antiproton p_{T} for jet p_{T} < 50 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetNuclei_15", "Nuclei p_{T} for jet p_{T} < 15 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetNuclei_20", "Nuclei p_{T} for jet p_{T} < 20 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetNuclei_30", "Nuclei p_{T} for jet p_{T} < 30 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetNuclei_50", "Nuclei p_{T} for jet p_{T} < 50 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetAntinuclei_15", "Antinuclei p_{T} for jet p_{T} < 15 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetAntinuclei_20", "Antinuclei p_{T} for jet p_{T} < 20 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetAntinuclei_30", "Antinuclei p_{T} for jet p_{T} < 30 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetAntinuclei_50", "Antinuclei p_{T} for jet p_{T} < 50 GeV", HistType::kTH1D, {axisSpecs.ptAxisPos}); - registryQA.add("hPtJetProtonVsTotalJet", "Proton p_{T} vs. jet p_{T}", HistType::kTH2D, {axisSpecs.ptAxisPos, {1000, 0, 500}}); - registryQA.add("hPtJetAntiprotonVsTotalJet", "Antiproton p_{T} vs. jet p_{T}", HistType::kTH2D, {axisSpecs.ptAxisPos, {1000, 0, 500}}); - registryQA.add("hPtJetNucleiVsTotalJet", "Nuclei p_{T} vs. jet p_{T}", HistType::kTH2D, {axisSpecs.ptAxisPos, {1000, 0, 500}}); - registryQA.add("hPtJetAntinucleiVsTotalJet", "Antinuclei p_{T} vs. jet p_{T}", HistType::kTH2D, {axisSpecs.ptAxisPos, {1000, 0, 500}}); + registryQA.add("hPtJetProtonVsTotalJet", "Proton p_{T} vs. jet p_{T}", HistType::kTH2D, {axisSpecs.ptAxisPos, {1000, 0, 500, "jet p_{T} [GeV/#it{c}]"}}); + registryQA.add("hPtJetAntiprotonVsTotalJet", "Antiproton p_{T} vs. jet p_{T}", HistType::kTH2D, {axisSpecs.ptAxisPos, {1000, 0, 500, "jet p_{T} [GeV/#it{c}]"}}); + registryQA.add("hPtJetNucleiVsTotalJet", "Nuclei p_{T} vs. jet p_{T}", HistType::kTH2D, {axisSpecs.ptAxisPos, {1000, 0, 500, "jet p_{T} [GeV/#it{c}]"}}); + registryQA.add("hPtJetAntinucleiVsTotalJet", "Antinuclei p_{T} vs. jet p_{T}", HistType::kTH2D, {axisSpecs.ptAxisPos, {1000, 0, 500, "jet p_{T} [GeV/#it{c}]"}}); // nSigma - registryData.add("hTPCsignal", "TPC signal", HistType::kTH2F, {{1000, -100, 100, "#it{p} [GeV/#it{c}]"}, {5000, 0, 5000, "d#it{E}/d#it{X} (a.u.)"}}); + registryData.add("hTPCsignal", "TPC signal", HistType::kTH2F, {{1000, -100, 100, "#it{p} [GeV/#it{c}]"}, {1000, 0, 5000, "d#it{E}/d#it{X} (a.u.)"}}); registryData.add("hTOFsignal", "TOF signal", HistType::kTH2F, {{1000, -100, 100, "#it{p} [GeV/#it{c}]"}, {550, 0, 1.1, "#beta (TOF)"}}); registryData.add("hTPCnsigmaProton", "TPC n#sigma for proton", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); registryData.add("hTOFnsigmaProton", "TOF n#sigma for proton", HistType::kTH2F, {axisSpecs.nsigmapTAxis, axisSpecs.nsigmaAxis}); @@ -233,10 +220,10 @@ struct AngularCorrelationsInJets { registryData.add("hDCAzJetAntinuclei", "DCA_{z} of high purity antinuclei", HistType::kTH2F, {axisSpecs.ptAxisPos, axisSpecs.dcazAxis}); // Angular Distributions - registryQA.add("hPhiFullEvent", "#varphi in full event", HistType::kTH1F, {{1000, -6.3, 6.3}}); - registryQA.add("hPhiPtFullEvent", "#varphi vs. p_{T} in full event", HistType::kTH2F, {axisSpecs.ptAxisPos, {1000, -6.3, 6.3}}); - registryQA.add("hPhiJet", "#varphi in jet", HistType::kTH1F, {{1000, -6.3, 6.3}}); - registryQA.add("hPhiPtJet", "#varphi vs. p_{T} in jet", HistType::kTH2F, {axisSpecs.ptAxisPos, {1000, -6.3, 6.3}}); + registryQA.add("hPhiFullEvent", "#varphi in full event", HistType::kTH1F, {{1000, 0, 6.3}}); + registryQA.add("hPhiPtFullEvent", "#varphi vs. p_{T} in full event", HistType::kTH2F, {axisSpecs.ptAxisPos, {1000, 0, 6.3}}); + registryQA.add("hPhiJet", "#varphi in jet", HistType::kTH1F, {{1000, 0, 6.3}}); + registryQA.add("hPhiPtJet", "#varphi vs. p_{T} in jet", HistType::kTH2F, {axisSpecs.ptAxisPos, {1000, 0, 6.3}}); registryQA.add("hEtaFullEvent", "#eta in full event", HistType::kTH1F, {{1000, -1, 1}}); registryQA.add("hEtaPtFullEvent", "#eta vs. p_{T} in full event", HistType::kTH2F, {axisSpecs.ptAxisPos, {1000, -1, 1}}); registryQA.add("hEtaJet", "#eta in jet", HistType::kTH1F, {{1000, -1, 1}}); @@ -303,6 +290,13 @@ struct AngularCorrelationsInJets { registryQA.add("hNParticlesClusteredInJet", "hNParticlesClusteredInJet", HistType::kTH1F, {{50, 0, 50, "#it{N}_{ch}"}}); registryQA.add("hPtParticlesClusteredInJet", "hPtParticlesClusteredInJet", HistType::kTH1F, {{200, 0, 10, "#it{p}_{T} (GeV/#it{c})"}}); + + // MC + registryMC.add("hPtJetProtonMC", "Truth jet proton p_{T}", HistType::kTH1F, {axisSpecs.ptAxisPos}); + registryMC.add("hPtJetAntiprotonMC", "Truth jet antiproton p_{T}", HistType::kTH1F, {axisSpecs.ptAxisPos}); + registryMC.add("hPtJetNucleiMC", "Truth jet nuclei p_{T}", HistType::kTH1F, {axisSpecs.ptAxisPos}); + registryMC.add("hPtJetAntinucleiMC", "Truth jet antinuclei p_{T}", HistType::kTH1F, {axisSpecs.ptAxisPos}); + registryMC.add("hNumberOfTruthParticles", "Truth yields (anti)p, (anti)d, (anti)He-3", HistType::kTH1I, {{6, 0, 6}}); } std::vector> fBufferProton; @@ -324,13 +318,13 @@ struct AngularCorrelationsInJets { template bool selectTrack(T const& track) // preliminary track selections { - if (track.tpcNClsCrossedRows() < fMinRatioCrossedRowsTPC * track.tpcNClsFindable() || - track.tpcNClsCrossedRows() < fMinNCrossedRowsTPC || - track.tpcNClsFound() < fMinReqClusterTPC || - track.itsNCls() < fMinReqClusterITS) { + if (track.tpcNClsCrossedRows() < minRatioCrossedRowsTPC * track.tpcNClsFindable() || + track.tpcNClsCrossedRows() < minNCrossedRowsTPC || + track.tpcNClsFound() < minReqClusterTPC || + track.itsNCls() < minReqClusterITS) { return false; } - if (doprocessRun2) { + if (doprocessRun2 || doprocessMCRun2) { if (!(track.trackType() & o2::aod::track::Run2Track) || !(track.flags() & o2::aod::track::TPCrefit) || !(track.flags() & o2::aod::track::ITSrefit)) { @@ -343,64 +337,66 @@ struct AngularCorrelationsInJets { template bool singleSpeciesTPCNSigma(T const& track, int species) // make cut configurable { // reject any track that has nsigma < 3 for more than 1 species - if (track.tpcNSigmaStoreEl() < 3.0 || track.tpcNSigmaStoreMu() < 3.0 || track.tpcNSigmaStorePi() < 3.0 || track.tpcNSigmaStoreKa() < 3.0 || track.tpcNSigmaStoreTr() < 3.0 || track.tpcNSigmaStoreAl() < 3.0) + if (track.tpcNSigmaStoreEl() < nsigmaRejection || track.tpcNSigmaStoreMu() < nsigmaRejection || track.tpcNSigmaStorePi() < nsigmaRejection || track.tpcNSigmaStoreKa() < nsigmaRejection || track.tpcNSigmaStoreTr() < nsigmaRejection || track.tpcNSigmaStoreAl() < nsigmaRejection) return false; switch (species) { case 1: // (anti)proton - return (track.tpcNSigmaPr() < 3.0 && track.tpcNSigmaDe() > 3.0 && track.tpcNSigmaHe() > 3.0); + return (track.tpcNSigmaPr() < nsigmaRejection && track.tpcNSigmaDe() > nsigmaRejection && track.tpcNSigmaHe() > nsigmaRejection); + break; case 2: // (anti)deuteron - return (track.tpcNSigmaDe() < 3.0 && track.tpcNSigmaPr() > 3.0 && track.tpcNSigmaHe() > 3.0); + return (track.tpcNSigmaDe() < nsigmaRejection && track.tpcNSigmaPr() > nsigmaRejection && track.tpcNSigmaHe() > nsigmaRejection); + break; case 3: // (anti)helium-3 - return (track.tpcNSigmaHe() < 3.0 && track.tpcNSigmaDe() > 3.0 && track.tpcNSigmaPr() > 3.0); + return (track.tpcNSigmaHe() < nsigmaRejection && track.tpcNSigmaDe() > nsigmaRejection && track.tpcNSigmaPr() > nsigmaRejection); + break; + default: + return false; } - return false; } template bool isProton(const T& track, bool tightCuts) { - // if (doprocessMCRun3) - // return (track.mcParticle().pdgCode() == 2212); if (track.sign() < 0) return false; if (tightCuts) { // for correlation function // DCA - if (TMath::Abs(track.dcaXY()) > fProtonDCAxyCF) + if (TMath::Abs(track.dcaXY()) > protonDCAxyCF) return false; - if (TMath::Abs(track.dcaZ()) > fProtonDCAzCF) + if (TMath::Abs(track.dcaZ()) > protonDCAzCF) return false; registryData.fill(HIST("hTPCnsigmaProtonCF"), track.pt(), track.tpcNSigmaPr()); - registryData.fill(HIST("hTOFnsigmaProtonCF"), track.pt(), track.tofNSigmaPr()); + if (track.hasTOF()) + registryData.fill(HIST("hTOFnsigmaProtonCF"), track.pt(), track.tofNSigmaPr()); // nsigma double tofNsigma = track.hasTOF() ? track.tofNSigmaPr() : 999; - if ((track.pt() < fProtonTPCTOFpT && (TMath::Abs(track.tpcNSigmaPr()) > fProtonNsigma)) || (track.pt() > fProtonTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaPr() * track.tpcNSigmaPr() + tofNsigma * tofNsigma) > fProtonNsigma))) - if (TMath::Sqrt(track.tpcNSigmaPr() * track.tpcNSigmaPr() + tofNsigma * tofNsigma) > fProtonNsigma) + if ((track.pt() < protonTPCTOFpT && (TMath::Abs(track.tpcNSigmaPr()) > protonNsigma)) || (track.pt() > protonTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaPr() * track.tpcNSigmaPr() + tofNsigma * tofNsigma) > protonNsigma))) + if (TMath::Sqrt(track.tpcNSigmaPr() * track.tpcNSigmaPr() + tofNsigma * tofNsigma) > protonNsigma) return false; if (!singleSpeciesTPCNSigma(track, 1)) return false; } else { // for yields // DCA - if (TMath::Abs(track.dcaXY()) > fProtonDCAxyYield) + if (TMath::Abs(track.dcaXY()) > protonDCAxyYield) return false; - if (TMath::Abs(track.dcaZ()) > fProtonDCAzYield) + if (TMath::Abs(track.dcaZ()) > protonDCAzYield) return false; registryData.fill(HIST("hTPCnsigmaProton"), track.pt(), track.tpcNSigmaPr()); // TPC - if (track.pt() < fProtonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fProtonTPCnsigLowYield) + if (track.pt() < protonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > protonTPCnsigmaLowPtYield) return false; - if (track.pt() > fProtonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fProtonTPCnsigHighYield) + if (track.pt() > protonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > protonTPCnsigmaHighPtYield) return false; - registryData.fill(HIST("hTOFnsigmaProton"), track.pt(), track.tofNSigmaPr()); - // TOF if (track.hasTOF()) { - if (track.pt() > fProtonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > fProtonTOFnsigYield) + registryData.fill(HIST("hTOFnsigmaProton"), track.pt(), track.tofNSigmaPr()); + if (track.pt() > protonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > protonTOFnsigmaHighPtYield) return false; } } @@ -411,47 +407,45 @@ struct AngularCorrelationsInJets { template bool isAntiproton(const T& track, bool tightCuts) { - // if (doprocessMCRun3) - // return (track.mcParticle().pdgCode() == -2212); if (track.sign() > 0) return false; if (tightCuts) { // for correlation function // DCA - if (TMath::Abs(track.dcaXY()) > fAntiprotonDCAxyCF) + if (TMath::Abs(track.dcaXY()) > antiprotonDCAxyCF) return false; - if (TMath::Abs(track.dcaZ()) > fAntiprotonDCAzCF) + if (TMath::Abs(track.dcaZ()) > antiprotonDCAzCF) return false; registryData.fill(HIST("hTPCnsigmaAntiprotonCF"), track.pt(), track.tpcNSigmaPr()); - registryData.fill(HIST("hTOFnsigmaAntiprotonCF"), track.pt(), track.tofNSigmaPr()); + if (track.hasTOF()) + registryData.fill(HIST("hTOFnsigmaAntiprotonCF"), track.pt(), track.tofNSigmaPr()); // nsigma double tofNsigma = track.hasTOF() ? track.tofNSigmaPr() : 999; - if ((track.pt() < fAntiprotonTPCTOFpT && (TMath::Abs(track.tpcNSigmaPr()) > fAntiprotonNsigma)) || (track.pt() > fAntiprotonTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaPr() * track.tpcNSigmaPr() + tofNsigma * tofNsigma) > fAntiprotonNsigma))) + if ((track.pt() < antiprotonTPCTOFpT && (TMath::Abs(track.tpcNSigmaPr()) > antiprotonNsigma)) || (track.pt() > antiprotonTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaPr() * track.tpcNSigmaPr() + tofNsigma * tofNsigma) > antiprotonNsigma))) return false; if (!singleSpeciesTPCNSigma(track, 1)) return false; } else { // for yields // DCA - if (TMath::Abs(track.dcaXY()) > fAntiprotonDCAxyYield) + if (TMath::Abs(track.dcaXY()) > antiprotonDCAxyYield) return false; - if (TMath::Abs(track.dcaZ()) > fAntiprotonDCAzYield) + if (TMath::Abs(track.dcaZ()) > antiprotonDCAzYield) return false; registryData.fill(HIST("hTPCnsigmaAntiproton"), track.pt(), track.tpcNSigmaPr()); // TPC - if (track.pt() < fAntiprotonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fAntiprotonTPCnsigLowYield) + if (track.pt() < antiprotonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > antiprotonTPCnsigmaLowPtYield) return false; - if (track.pt() > fAntiprotonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > fAntiprotonTPCnsigHighYield) + if (track.pt() > antiprotonTPCTOFpT && TMath::Abs(track.tpcNSigmaPr()) > antiprotonTPCnsigmaHighPtYield) return false; - registryData.fill(HIST("hTOFnsigmaAntiproton"), track.pt(), track.tofNSigmaPr()); - // TOF if (track.hasTOF()) { - if (track.pt() > fAntiprotonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > fAntiprotonTOFnsigYield) + registryData.fill(HIST("hTOFnsigmaAntiproton"), track.pt(), track.tofNSigmaPr()); + if (track.pt() > antiprotonTPCTOFpT && TMath::Abs(track.tofNSigmaPr()) > antiprotonTOFnsigmaHighPtYield) return false; } } @@ -462,87 +456,85 @@ struct AngularCorrelationsInJets { template bool isNucleus(const T& track, bool tightCuts) { - // if (doprocessMCRun3) - // return (track.mcParticle().pdgCode() == (fDeuteronAnalysis) ? 1000010020 : 1000020030); if (track.sign() < 0) return false; - if (fDeuteronAnalysis) { + if (deuteronAnalysis) { if (tightCuts) { // for correlation function // DCA - if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyCF) + if (TMath::Abs(track.dcaXY()) > nucleiDCAxyCF) return false; - if (TMath::Abs(track.dcaZ()) > fNucleiDCAzCF) + if (TMath::Abs(track.dcaZ()) > nucleiDCAzCF) return false; registryData.fill(HIST("hTPCnsigmaNucleiCF"), track.pt(), track.tpcNSigmaDe()); - registryData.fill(HIST("hTOFnsigmaNucleiCF"), track.pt(), track.tofNSigmaDe()); + if (track.hasTOF()) + registryData.fill(HIST("hTOFnsigmaNucleiCF"), track.pt(), track.tofNSigmaDe()); // nsigma double tofNsigma = track.hasTOF() ? track.tofNSigmaDe() : 999; - if ((track.pt() < fNucleiTPCTOFpT && (TMath::Abs(track.tpcNSigmaDe()) > fNucleiNsigma)) || (track.pt() > fNucleiTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaDe() * track.tpcNSigmaDe() + tofNsigma * tofNsigma) > fNucleiNsigma))) + if ((track.pt() < nucleiTPCTOFpT && (TMath::Abs(track.tpcNSigmaDe()) > nucleiNsigma)) || (track.pt() > nucleiTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaDe() * track.tpcNSigmaDe() + tofNsigma * tofNsigma) > nucleiNsigma))) return false; if (!singleSpeciesTPCNSigma(track, 2)) return false; } else { // for yields // DCA - if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyYield) + if (TMath::Abs(track.dcaXY()) > nucleiDCAxyYield) return false; - if (TMath::Abs(track.dcaZ()) > fNucleiDCAzYield) + if (TMath::Abs(track.dcaZ()) > nucleiDCAzYield) return false; registryData.fill(HIST("hTPCnsigmaNuclei"), track.pt(), track.tpcNSigmaDe()); // TPC - if (track.pt() < fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fNucleiTPCnsigLowYield) + if (track.pt() < nucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > nucleiTPCnsigmaLowPtYield) return false; - if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fNucleiTPCnsigHighYield) + if (track.pt() > nucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > nucleiTPCnsigmaHighPtYield) return false; - registryData.fill(HIST("hTOFnsigmaNuclei"), track.pt(), track.tofNSigmaDe()); - // TOF if (track.hasTOF()) { - if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tofNSigmaDe()) > fNucleiTOFnsigYield) + registryData.fill(HIST("hTOFnsigmaNuclei"), track.pt(), track.tofNSigmaDe()); + if (track.pt() > nucleiTPCTOFpT && TMath::Abs(track.tofNSigmaDe()) > nucleiTOFnsigmaHighPtYield) return false; } } } else { if (tightCuts) { // for correlation function - including for helium just in case, but realistically, angular correlations won't be a thing here // DCA - if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyCF) + if (TMath::Abs(track.dcaXY()) > nucleiDCAxyCF) return false; - if (TMath::Abs(track.dcaZ()) > fNucleiDCAzCF) + if (TMath::Abs(track.dcaZ()) > nucleiDCAzCF) return false; registryData.fill(HIST("hTPCnsigmaNucleiCF"), track.pt(), track.tpcNSigmaHe()); - registryData.fill(HIST("hTOFnsigmaNucleiCF"), track.pt(), track.tofNSigmaHe()); + if (track.hasTOF()) + registryData.fill(HIST("hTOFnsigmaNucleiCF"), track.pt(), track.tofNSigmaHe()); // nsigma double tofNsigma = track.hasTOF() ? track.tofNSigmaHe() : 999; - if ((track.pt() < fNucleiTPCTOFpT && (TMath::Abs(track.tpcNSigmaHe()) > fNucleiNsigma)) || (track.pt() > fNucleiTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaHe() * track.tpcNSigmaHe() + tofNsigma * tofNsigma) > fNucleiNsigma))) + if ((track.pt() < nucleiTPCTOFpT && (TMath::Abs(track.tpcNSigmaHe()) > nucleiNsigma)) || (track.pt() > nucleiTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaHe() * track.tpcNSigmaHe() + tofNsigma * tofNsigma) > nucleiNsigma))) return false; if (!singleSpeciesTPCNSigma(track, 3)) return false; } else { // for yields // DCA - if (TMath::Abs(track.dcaXY()) > fNucleiDCAxyYield) + if (TMath::Abs(track.dcaXY()) > nucleiDCAxyYield) return false; - if (TMath::Abs(track.dcaZ()) > fNucleiDCAzYield) + if (TMath::Abs(track.dcaZ()) > nucleiDCAzYield) return false; registryData.fill(HIST("hTPCnsigmaNuclei"), track.pt(), track.tpcNSigmaHe()); // TPC - if (track.pt() < fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fNucleiTPCnsigLowYield) + if (track.pt() < nucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > nucleiTPCnsigmaLowPtYield) return false; - if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fNucleiTPCnsigHighYield) + if (track.pt() > nucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > nucleiTPCnsigmaHighPtYield) return false; - registryData.fill(HIST("hTOFnsigmaNuclei"), track.pt(), track.tofNSigmaHe()); - // TOF if (track.hasTOF()) { - if (track.pt() > fNucleiTPCTOFpT && TMath::Abs(track.tofNSigmaHe()) > fNucleiTOFnsigYield) + registryData.fill(HIST("hTOFnsigmaNuclei"), track.pt(), track.tofNSigmaHe()); + if (track.pt() > nucleiTPCTOFpT && TMath::Abs(track.tofNSigmaHe()) > nucleiTOFnsigmaHighPtYield) return false; } } @@ -554,86 +546,88 @@ struct AngularCorrelationsInJets { template bool isAntinucleus(const T& track, bool tightCuts) { - // if (doprocessMCRun3) - // return (track.mcParticle().pdgCode() == (fDeuteronAnalysis) ? -1000010020 : -1000020030); if (track.sign() > 0) return false; - if (fDeuteronAnalysis) { + if (deuteronAnalysis) { if (tightCuts) { // for correlation function // DCA - if (TMath::Abs(track.dcaXY()) > fAntinucleiDCAxyCF) + if (TMath::Abs(track.dcaXY()) > antinucleiDCAxyCF) return false; - if (TMath::Abs(track.dcaZ()) > fAntinucleiDCAzCF) + if (TMath::Abs(track.dcaZ()) > antinucleiDCAzCF) return false; registryData.fill(HIST("hTPCnsigmaAntinucleiCF"), track.pt(), track.tpcNSigmaDe()); - registryData.fill(HIST("hTOFnsigmaAntinucleiCF"), track.pt(), track.tofNSigmaDe()); + if (track.hasTOF()) + registryData.fill(HIST("hTOFnsigmaAntinucleiCF"), track.pt(), track.tofNSigmaDe()); // nsigma double tofNsigma = track.hasTOF() ? track.tofNSigmaDe() : 999; - if ((track.pt() < fAntinucleiTPCTOFpT && (TMath::Abs(track.tpcNSigmaDe()) > fAntinucleiNsigma)) || (track.pt() > fAntinucleiTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaDe() * track.tpcNSigmaDe() + tofNsigma * tofNsigma) > fAntinucleiNsigma))) + if ((track.pt() < antinucleiTPCTOFpT && (TMath::Abs(track.tpcNSigmaDe()) > antinucleiNsigma)) || (track.pt() > antinucleiTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaDe() * track.tpcNSigmaDe() + tofNsigma * tofNsigma) > antinucleiNsigma))) return false; if (!singleSpeciesTPCNSigma(track, 2)) return false; } else { // for yields // DCA - if (TMath::Abs(track.dcaXY()) > fAntinucleiDCAxyYield) + if (TMath::Abs(track.dcaXY()) > antinucleiDCAxyYield) return false; - if (TMath::Abs(track.dcaZ()) > fAntinucleiDCAzYield) + if (TMath::Abs(track.dcaZ()) > antinucleiDCAzYield) return false; registryData.fill(HIST("hTPCnsigmaAntinuclei"), track.pt(), track.tpcNSigmaDe()); // TPC - if (track.pt() < fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fAntinucleiTPCnsigLowYield) + if (track.pt() < antinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > antinucleiTPCnsigmaLowPtYield) return false; - if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > fAntinucleiTPCnsigHighYield) + if (track.pt() > antinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaDe()) > antinucleiTPCnsigmaHighPtYield) return false; - registryData.fill(HIST("hTOFnsigmaAntinuclei"), track.pt(), track.tofNSigmaDe()); - // TOF - if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tofNSigmaDe()) > fAntinucleiTOFnsigYield) - return false; + if (track.hasTOF()) { + registryData.fill(HIST("hTOFnsigmaAntinuclei"), track.pt(), track.tofNSigmaDe()); + if (track.pt() > antinucleiTPCTOFpT && TMath::Abs(track.tofNSigmaDe()) > antinucleiTOFnsigmaHighPtYield) + return false; + } } } else { if (tightCuts) { // for correlation function - including for antihelium just in case, but realistically, angular correlations won't be a thing here // DCA - if (TMath::Abs(track.dcaXY()) > fAntinucleiDCAxyCF) + if (TMath::Abs(track.dcaXY()) > antinucleiDCAxyCF) return false; - if (TMath::Abs(track.dcaZ()) > fAntinucleiDCAzCF) + if (TMath::Abs(track.dcaZ()) > antinucleiDCAzCF) return false; registryData.fill(HIST("hTPCnsigmaAntinucleiCF"), track.pt(), track.tpcNSigmaHe()); - registryData.fill(HIST("hTOFnsigmaAntinucleiCF"), track.pt(), track.tofNSigmaHe()); + if (track.hasTOF()) + registryData.fill(HIST("hTOFnsigmaAntinucleiCF"), track.pt(), track.tofNSigmaHe()); // nsigma double tofNsigma = track.hasTOF() ? track.tofNSigmaHe() : 999; - if ((track.pt() < fAntinucleiTPCTOFpT && (TMath::Abs(track.tpcNSigmaHe()) > fAntinucleiNsigma)) || (track.pt() > fAntinucleiTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaHe() * track.tpcNSigmaHe() + tofNsigma * tofNsigma) > fAntinucleiNsigma))) + if ((track.pt() < antinucleiTPCTOFpT && (TMath::Abs(track.tpcNSigmaHe()) > antinucleiNsigma)) || (track.pt() > antinucleiTPCTOFpT && (TMath::Sqrt(track.tpcNSigmaHe() * track.tpcNSigmaHe() + tofNsigma * tofNsigma) > antinucleiNsigma))) return false; if (!singleSpeciesTPCNSigma(track, 3)) return false; } else { // for yields // DCA - if (TMath::Abs(track.dcaXY()) > fAntinucleiDCAxyYield) + if (TMath::Abs(track.dcaXY()) > antinucleiDCAxyYield) return false; - if (TMath::Abs(track.dcaZ()) > fAntinucleiDCAzYield) + if (TMath::Abs(track.dcaZ()) > antinucleiDCAzYield) return false; registryData.fill(HIST("hTPCnsigmaAntinuclei"), track.pt(), track.tpcNSigmaHe()); // TPC - if (track.pt() < fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fAntinucleiTPCnsigLowYield) + if (track.pt() < antinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > antinucleiTPCnsigmaLowPtYield) return false; - if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > fAntinucleiTPCnsigHighYield) + if (track.pt() > antinucleiTPCTOFpT && TMath::Abs(track.tpcNSigmaHe()) > antinucleiTPCnsigmaHighPtYield) return false; - registryData.fill(HIST("hTOFnsigmaAntinuclei"), track.pt(), track.tofNSigmaHe()); - // TOF - if (track.pt() > fAntinucleiTPCTOFpT && TMath::Abs(track.tofNSigmaHe()) > fAntinucleiTOFnsigYield) - return false; + if (track.hasTOF()) { + registryData.fill(HIST("hTOFnsigmaAntinuclei"), track.pt(), track.tofNSigmaHe()); + if (track.pt() > antinucleiTPCTOFpT && TMath::Abs(track.tofNSigmaHe()) > antinucleiTOFnsigmaHighPtYield) + return false; + } } } @@ -643,10 +637,10 @@ struct AngularCorrelationsInJets { void setTrackBuffer(const auto& tempBuffer, auto& buffer) // refresh track buffer { for (const auto& pair : tempBuffer) { - if (static_cast(buffer.size()) == fBufferSize) { + if (static_cast(buffer.size()) == trackBufferSize) { buffer.insert(buffer.begin(), pair); - buffer.resize(fBufferSize); - } else if (static_cast(buffer.size()) < fBufferSize) { + buffer.resize(trackBufferSize); + } else if (static_cast(buffer.size()) < trackBufferSize) { buffer.emplace_back(pair); } } @@ -836,7 +830,7 @@ struct AngularCorrelationsInJets { fastjet::PseudoJet subtractedJetArea(0., 0., 0., 0.); subtractedJetArea = bkgSub.doRhoAreaSub(jet, rho, rhoM); - if (subtractedJetPerp.pt() < fMinJetPt) // cut on jet w/o bkg + if (subtractedJetPerp.pt() < minJetPt) // cut on jet w/o bkg return jetCounter; registryData.fill(HIST("hPtTotalSubJetPerp"), subtractedJetPerp.pt()); registryData.fill(HIST("hPtTotalSubJetArea"), subtractedJetArea.pt()); @@ -905,19 +899,19 @@ struct AngularCorrelationsInJets { double deltaPhiUE2 = getDeltaPhi(particleDir.Phi(), UEAxis2.Phi()); double deltaRUE2 = sqrt(deltaEtaUE2 * deltaEtaUE2 + deltaPhiUE2 * deltaPhiUE2); - if (deltaRJet < fRmax) { + if (deltaRJet < Rmax) { if (deltaPhiJet != -999) registryQA.fill(HIST("hDeltaEtadeltaPhiJet"), deltaEtaJet, deltaPhiJet); NchJetPlusUE++; ptJetPlusUE = ptJetPlusUE + track.pt(); } - if (deltaRUE1 < fRmax) { + if (deltaRUE1 < Rmax) { if (deltaPhiUE1 != -999) registryQA.fill(HIST("hDeltaEtadeltaPhiUE"), deltaEtaUE1, deltaPhiUE1); NchUE++; ptUE = ptUE + track.pt(); } - if (deltaRUE2 < fRmax) { + if (deltaRUE2 < Rmax) { if (deltaPhiUE2 != -999) registryQA.fill(HIST("hDeltaEtadeltaPhiUE"), deltaEtaUE2, deltaPhiUE2); NchUE++; @@ -938,7 +932,7 @@ struct AngularCorrelationsInJets { int nPartClusteredJet = static_cast(constituents.size()); // Fill QA Histograms - if (ptJetPlusUE < fMinJetPt) { // swap for sub pt? + if (ptJetPlusUE < minJetPt) { // swap for sub pt? registryQA.fill(HIST("hNParticlesClusteredInJet"), nPartClusteredJet); @@ -974,20 +968,11 @@ struct AngularCorrelationsInJets { double ptDiff = pseudoParticle.pt() - jetParticle.pt(); registryQA.fill(HIST("hPtDiff"), ptDiff); - if (jetParticle.pt() < fMinJetParticlePt) + if (jetParticle.pt() < minJetParticlePt) continue; if (isProton(jetParticle, false)) { // collect protons in jet registryData.fill(HIST("hPtJetProton"), jetParticle.pt()); registryQA.fill(HIST("hPtJetProtonVsTotalJet"), jetParticle.pt(), subtractedJetPerp.pt()); - if (subtractedJetPerp.pt() < 15) { - registryQA.fill(HIST("hPtJetProton_15"), jetParticle.pt()); - } else if (subtractedJetPerp.pt() < 20) { - registryQA.fill(HIST("hPtJetProton_20"), jetParticle.pt()); - } else if (subtractedJetPerp.pt() < 30) { - registryQA.fill(HIST("hPtJetProton_30"), jetParticle.pt()); - } else if (subtractedJetPerp.pt() < 50) { - registryQA.fill(HIST("hPtJetProton_50"), jetParticle.pt()); - } registryData.fill(HIST("hTrackProtocol"), 4); // # protons if (isProton(jetParticle, true)) { registryData.fill(HIST("hTrackProtocol"), 5); // # high purity protons @@ -997,15 +982,6 @@ struct AngularCorrelationsInJets { } else if (isAntiproton(jetParticle, false)) { // collect antiprotons in jet registryData.fill(HIST("hPtJetAntiproton"), jetParticle.pt()); registryQA.fill(HIST("hPtJetAntiprotonVsTotalJet"), jetParticle.pt(), subtractedJetPerp.pt()); - if (subtractedJetPerp.pt() < 15) { - registryQA.fill(HIST("hPtJetAntiproton_15"), jetParticle.pt()); - } else if (subtractedJetPerp.pt() < 20) { - registryQA.fill(HIST("hPtJetAntiproton_20"), jetParticle.pt()); - } else if (subtractedJetPerp.pt() < 30) { - registryQA.fill(HIST("hPtJetAntiproton_30"), jetParticle.pt()); - } else if (subtractedJetPerp.pt() < 50) { - registryQA.fill(HIST("hPtJetAntiproton_50"), jetParticle.pt()); - } registryData.fill(HIST("hTrackProtocol"), 6); // # antiprotons if (isAntiproton(jetParticle, true)) { registryData.fill(HIST("hTrackProtocol"), 7); // # high purity antiprotons @@ -1015,15 +991,6 @@ struct AngularCorrelationsInJets { } else if (isNucleus(jetParticle, false)) { // collect nuclei in jet registryData.fill(HIST("hPtJetNuclei"), jetParticle.pt()); registryQA.fill(HIST("hPtJetNucleiVsTotalJet"), jetParticle.pt(), subtractedJetPerp.pt()); - if (subtractedJetPerp.pt() < 15) { - registryQA.fill(HIST("hPtJetNuclei_15"), jetParticle.pt()); - } else if (subtractedJetPerp.pt() < 20) { - registryQA.fill(HIST("hPtJetNuclei_20"), jetParticle.pt()); - } else if (subtractedJetPerp.pt() < 30) { - registryQA.fill(HIST("hPtJetNuclei_30"), jetParticle.pt()); - } else if (subtractedJetPerp.pt() < 50) { - registryQA.fill(HIST("hPtJetNuclei_50"), jetParticle.pt()); - } registryData.fill(HIST("hTrackProtocol"), 8); // # nuclei if (isNucleus(jetParticle, true)) { registryData.fill(HIST("hTrackProtocol"), 9); // # high purity nuclei @@ -1033,15 +1000,6 @@ struct AngularCorrelationsInJets { } else if (isAntinucleus(jetParticle, false)) { registryData.fill(HIST("hPtJetAntinuclei"), jetParticle.pt()); registryQA.fill(HIST("hPtJetAntinucleiVsTotalJet"), jetParticle.pt(), subtractedJetPerp.pt()); - if (subtractedJetPerp.pt() < 15) { - registryQA.fill(HIST("hPtJetAntinuclei_15"), jetParticle.pt()); - } else if (subtractedJetPerp.pt() < 20) { - registryQA.fill(HIST("hPtJetAntinuclei_20"), jetParticle.pt()); - } else if (subtractedJetPerp.pt() < 30) { - registryQA.fill(HIST("hPtJetAntinuclei_30"), jetParticle.pt()); - } else if (subtractedJetPerp.pt() < 50) { - registryQA.fill(HIST("hPtJetAntinuclei_50"), jetParticle.pt()); - } registryData.fill(HIST("hTrackProtocol"), 10); // # antinuclei if (isAntinucleus(jetParticle, true)) { registryData.fill(HIST("hTrackProtocol"), 11); // # high purity antinuclei @@ -1097,7 +1055,6 @@ struct AngularCorrelationsInJets { particles.clear(); int index = 0; int jetCounter = 0; - // int leadingID = 0; std::vector jets; jets.clear(); @@ -1106,7 +1063,7 @@ struct AngularCorrelationsInJets { continue; double mass; - if (fUseTOFMass) { + if (useTOFmass) { if (track.hasTOF()) { mass = track.mass(); // check reliability, maybe use only pion mass registryQA.fill(HIST("hTOFmass"), track.pt(), track.mass()); @@ -1152,7 +1109,7 @@ struct AngularCorrelationsInJets { double ghost_maxrap = 1.0; double ghost_area = 0.005; int ghost_repeat = 1; - fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, fJetR); + fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, jetR); fastjet::JetDefinition jetDefBkg(fastjet::kt_algorithm, 0.5); fastjet::AreaDefinition areaDef(fastjet::active_area, fastjet::GhostedAreaSpec(ghost_maxrap, ghost_repeat, ghost_area)); fastjet::AreaDefinition areaDefBkg(fastjet::active_area_explicit_ghosts, fastjet::GhostedAreaSpec(ghost_maxrap)); @@ -1178,6 +1135,142 @@ struct AngularCorrelationsInJets { setTrackBuffer(fTempBufferFull, fBufferFull); } + template + void fillHistogramsMC(U const& tracks) + { + std::vector jetProtons; + std::vector jetAntiprotons; + std::vector jetNuclei; + std::vector jetAntinuclei; + std::vector jetAll; + std::vector> fTempBufferFull; + fTempBufferFull.clear(); + std::vector jetInput; // input for jet finder + std::map particles; // all selected particles in event + std::vector particlesForCF; // particles for full event angular correlations + jetInput.clear(); + particles.clear(); + int index = 0; + int jetCounter = 0; + std::vector jets; + jets.clear(); + + for (const auto& track : tracks) { + if (!selectTrack(track)) + continue; + + double mass; + if (useTOFmass) { + if (track.hasTOF()) { + mass = track.mass(); // check reliability, maybe use only pion mass + registryQA.fill(HIST("hTOFmass"), track.pt(), track.mass()); + registryData.fill(HIST("hTrackProtocol"), 1); + } else { + mass = 0.139; // pion mass as default, ~80% are pions + registryData.fill(HIST("hTrackProtocol"), 2); + } + } else { + mass = 0.139; + } + + if (track.tpcNClsFindable() != 0) { + registryQA.fill(HIST("hRatioCrossedRowsTPC"), track.pt(), track.tpcNClsCrossedRows() / track.tpcNClsFindable()); + } + registryQA.fill(HIST("hPtFullEvent"), track.pt()); + registryQA.fill(HIST("hCrossedRowsTPC"), track.pt(), track.tpcNClsCrossedRows()); + registryQA.fill(HIST("hClusterITS"), track.pt(), track.itsNCls()); + registryQA.fill(HIST("hClusterTPC"), track.pt(), track.tpcNClsFound()); + registryQA.fill(HIST("hChi2ITS"), track.pt(), track.itsChi2NCl()); + registryQA.fill(HIST("hChi2TPC"), track.pt(), track.tpcChi2NCl()); + registryQA.fill(HIST("hDCAxyFullEvent"), track.pt(), track.dcaXY()); + registryQA.fill(HIST("hDCAzFullEvent"), track.pt(), track.dcaZ()); + registryQA.fill(HIST("hPhiFullEvent"), track.phi()); + registryQA.fill(HIST("hPhiPtFullEvent"), track.pt(), track.phi()); + registryQA.fill(HIST("hEtaFullEvent"), track.eta()); + registryQA.fill(HIST("hEtaPtFullEvent"), track.pt(), track.eta()); + + fastjet::PseudoJet inputPseudoJet(track.px(), track.py(), track.pz(), track.energy(mass)); + inputPseudoJet.set_user_index(index); + particles[index] = track; + particlesForCF.emplace_back(track); + jetInput.emplace_back(inputPseudoJet); + + index++; + } // for (const auto& track : tracks) + + if (jetInput.size() < 2) + return; + registryData.fill(HIST("hEventProtocol"), 2); + + // Reconstruct Jets + double ghost_maxrap = 1.0; + double ghost_area = 0.005; + int ghost_repeat = 1; + fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, jetR); + fastjet::JetDefinition jetDefBkg(fastjet::kt_algorithm, 0.5); + fastjet::AreaDefinition areaDef(fastjet::active_area, fastjet::GhostedAreaSpec(ghost_maxrap, ghost_repeat, ghost_area)); + fastjet::AreaDefinition areaDefBkg(fastjet::active_area_explicit_ghosts, fastjet::GhostedAreaSpec(ghost_maxrap)); + fastjet::ClusterSequenceArea clusterSeq(jetInput, jetDef, areaDef); + jets = sorted_by_pt(clusterSeq.inclusive_jets()); + + if (jets.size() == 0) + return; + + registryData.fill(HIST("hEventProtocol"), 3); + + bool doSparse = true; + auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(jetInput, doSparse); + auto [rhoPerp, rhoMPerp] = bkgSub.estimateRhoPerpCone(jetInput, jets); + + for (auto& jet : jets) { + jetCounter = analyseJet(jetCounter, jet, particles, jetProtons, jetAntiprotons, jetNuclei, jetAntinuclei, jetAll, rho, rhoM, rhoPerp, rhoMPerp); + + // MC Truth Particles + fastjet::PseudoJet subtractedJetPerp(0., 0., 0., 0.); + subtractedJetPerp = bkgSub.doRhoAreaSub(jet, rhoPerp, rhoMPerp); + if (subtractedJetPerp.pt() < minJetPt) // cut on jet w/o bkg + continue; + for (const auto& constituent : jet.constituents()) { + const auto& jetParticle = particles.at(constituent.user_index()); + if (!jetParticle.has_mcParticle()) + continue; + switch (jetParticle.mcParticle().pdgCode()) { + case 2212: + registryMC.fill(HIST("hNumberOfTruthParticles"), 0); + registryMC.fill(HIST("hPtJetProtonMC"), jetParticle.pt()); + break; + case -2212: + registryMC.fill(HIST("hNumberOfTruthParticles"), 1); + registryMC.fill(HIST("hPtJetAntiprotonMC"), jetParticle.pt()); + break; + case 1000010020: + registryMC.fill(HIST("hNumberOfTruthParticles"), 2); + registryMC.fill(HIST("hPtJetNucleiMC"), jetParticle.pt()); + break; + case -1000010020: + registryMC.fill(HIST("hNumberOfTruthParticles"), 3); + registryMC.fill(HIST("hPtJetAntinucleiMC"), jetParticle.pt()); + break; + case 1000020030: + registryMC.fill(HIST("hNumberOfTruthParticles"), 4); + registryMC.fill(HIST("hPtJetNucleiMC"), jetParticle.pt()); + break; + case -1000020030: + registryMC.fill(HIST("hNumberOfTruthParticles"), 5); + registryMC.fill(HIST("hPtJetAntinucleiMC"), jetParticle.pt()); + break; + default: + continue; + } + } // for (const auto& constituent : jet.constituents()) + } // for (const auto& jet : jets) + registryData.fill(HIST("hNumJetsInEvent"), jetCounter); + + TVector3 hardestJetAxis(jets.at(0).px(), jets.at(0).py(), jets.at(0).pz()); // for full event, use hardest jet as orientation + doCorrelations(particlesForCF, fBufferFull, fTempBufferFull, -1, hardestJetAxis); + setTrackBuffer(fTempBufferFull, fBufferFull); + } + void processRun2(soa::Join const& collisions, soa::Filtered const& tracks, BCsWithRun2Info const&) @@ -1208,7 +1301,7 @@ struct AngularCorrelationsInJets { continue; registryData.fill(HIST("hNumberOfEvents"), 0); registryData.fill(HIST("hEventProtocol"), 1); - if (TMath::Abs(collision.posZ()) > fZVtx) + if (TMath::Abs(collision.posZ()) > zVtx) continue; auto slicedTracks = tracks.sliceBy(perCollisionFullTracksRun3, collision.globalIndex()); @@ -1218,23 +1311,42 @@ struct AngularCorrelationsInJets { } PROCESS_SWITCH(AngularCorrelationsInJets, processRun3, "process Run 3 data", false); - // void processMCRun3(McCollisions const& collisions, soa::Filtered const& tracks) - // { - // for (const auto& collision : collisions) { - // registryMC.fill(HIST("hEventProtocol"), 0); - // if (!collision.sel8()) - // continue; - // registryMC.fill(HIST("hNumberOfEvents"), 0); - // registryMC.fill(HIST("hEventProtocol"), 1); - // if (TMath::Abs(collision.posZ()) > fZVtx) - // continue; - - // auto slicedTracks = tracks.sliceBy(perCollisionMcTracksRun3, collision.globalIndex()); - - // fillHistograms(slicedTracks); - // } - // } - // PROCESS_SWITCH(AngularCorrelationsInJets, processMCRun3, "process Run 3 MC", false); + void processMCRun2(McCollisions const& collisions, soa::Filtered const& tracks, BCsWithRun2Info const&, aod::McParticles&, aod::McCollisions const&) + { + for (const auto& collision : collisions) { + auto bc = collision.bc_as(); + initCCDB(bc); + + registryData.fill(HIST("hEventProtocol"), 0); + if (!collision.alias_bit(kINT7)) + continue; + registryData.fill(HIST("hNumberOfEvents"), 0); + registryData.fill(HIST("hEventProtocol"), 1); + + auto slicedTracks = tracks.sliceBy(perCollisionMcTracksRun2, collision.globalIndex()); + + fillHistogramsMC(slicedTracks); + } + } + PROCESS_SWITCH(AngularCorrelationsInJets, processMCRun2, "process Run 2 MC", false); + + void processMCRun3(McCollisions const& collisions, soa::Filtered const& tracks, aod::McParticles&, aod::McCollisions const&) + { + for (const auto& collision : collisions) { + registryData.fill(HIST("hEventProtocol"), 0); + if (!collision.sel8()) + continue; + registryData.fill(HIST("hNumberOfEvents"), 0); + registryData.fill(HIST("hEventProtocol"), 1); + if (TMath::Abs(collision.posZ()) > zVtx) + continue; + + auto slicedTracks = tracks.sliceBy(perCollisionMcTracksRun3, collision.globalIndex()); + + fillHistogramsMC(slicedTracks); + } + } + PROCESS_SWITCH(AngularCorrelationsInJets, processMCRun3, "process Run 3 MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From daccbcf940404142675dd6775b0534dfce165666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Tue, 17 Dec 2024 09:34:59 +0100 Subject: [PATCH 412/459] =?UTF-8?q?[DPG]=20qaEfficiency:=20abs=20=E2=86=92?= =?UTF-8?q?=20std::abs=20(#9017)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index e8965bb265e..20edd0ace9f 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -2201,7 +2201,7 @@ struct QaEfficiency { if (!isTrackSelected(track, HIST("Data/trackSelection"))) { continue; } - if (abs(track.tpcNSigmaDe()) > nsigmaTPCDe) { + if (std::abs(track.tpcNSigmaDe()) > nsigmaTPCDe) { continue; } histos.fill(HIST("Data/trackLength"), track.length()); From f32e23c6618907da76b1af53bd21dba957464185 Mon Sep 17 00:00:00 2001 From: prottayCMT <61418725+prottayCMT@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:47:48 +0100 Subject: [PATCH 413/459] [PWGLF] boosting with four vector mass (#9005) Co-authored-by: Prottay Das --- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index fb1d114efe5..07c42cf641f 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -679,7 +679,7 @@ struct lambdapolsp { } } Lambda = Proton + Pion; - Lambda.SetM(massLambda); + // Lambda.SetM(massLambda); ROOT::Math::Boost boost{Lambda.BoostToCM()}; fourVecDauCM = boost(Proton); From 04527987673e1dd82537907c9d8af94ea70c20b0 Mon Sep 17 00:00:00 2001 From: Gianni Shigeru Setoue Liveraro <81832939+gianniliveraro@users.noreply.github.com> Date: Tue, 17 Dec 2024 06:34:55 -0300 Subject: [PATCH 414/459] [PWGLF] Modifications in sigma0 tasks (#9014) Co-authored-by: ALICE Action Bot --- PWGLF/DataModel/LFSigmaTables.h | 23 +- .../Strangeness/sigma0builder.cxx | 169 +++++++++--- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 242 +++++++++--------- 3 files changed, 261 insertions(+), 173 deletions(-) diff --git a/PWGLF/DataModel/LFSigmaTables.h b/PWGLF/DataModel/LFSigmaTables.h index 01ef1354162..7da34376055 100644 --- a/PWGLF/DataModel/LFSigmaTables.h +++ b/PWGLF/DataModel/LFSigmaTables.h @@ -25,19 +25,6 @@ // Creating output TTree for sigma analysis namespace o2::aod { -DECLARE_SOA_TABLE(Sigma0Collisions, "AOD", "SIGMA0COLLISION", //! basic collision properties: position - o2::soa::Index<>, collision::PosX, collision::PosY, collision::PosZ, - cent::CentFT0M, cent::CentFT0A, cent::CentFT0C, cent::CentFV0A); - -using Sigma0Collision = Sigma0Collisions::iterator; - -namespace sigma0Core -{ -//______________________________________________________ -// REGULAR COLUMNS FOR INDEXING -// FOR DERIVED -DECLARE_SOA_INDEX_COLUMN(Sigma0Collision, sigma0Collision); //! -} // namespace sigma0Core // for real data namespace sigma0Core @@ -46,8 +33,8 @@ DECLARE_SOA_COLUMN(SigmapT, sigmapT, float); DECLARE_SOA_COLUMN(SigmaMass, sigmaMass, float); DECLARE_SOA_COLUMN(SigmaRapidity, sigmaRapidity, float); DECLARE_SOA_COLUMN(SigmaOPAngle, sigmaOPAngle, float); -DECLARE_SOA_COLUMN(SigmaDeltaEta, sigmaDeltaEta, float); -DECLARE_SOA_COLUMN(SigmaDeltaPhi, sigmaDeltaPhi, float); +DECLARE_SOA_COLUMN(SigmaCentrality, sigmaCentrality, float); + } // namespace sigma0Core DECLARE_SOA_TABLE(Sigma0Cores, "AOD", "SIGMA0CORES", @@ -55,11 +42,7 @@ DECLARE_SOA_TABLE(Sigma0Cores, "AOD", "SIGMA0CORES", sigma0Core::SigmaMass, sigma0Core::SigmaRapidity, sigma0Core::SigmaOPAngle, - sigma0Core::SigmaDeltaEta, - sigma0Core::SigmaDeltaPhi); - -DECLARE_SOA_TABLE(Sigma0CollRefs, "AOD", "SIGMA0COLLREF", //! optional table to refer back to a collision - o2::soa::Index<>, sigma0Core::Sigma0CollisionId); + sigma0Core::SigmaCentrality); // For Photon extra info namespace sigmaPhotonExtra diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index bd44e781f5c..46470a69f79 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -62,8 +62,6 @@ using V0StandardDerivedDatas = soa::Join sigma0Coll; // characterises collisions - Produces sigma0CollRefs; // characterises collisions Produces sigma0cores; // save sigma0 candidates for analysis Produces sigmaPhotonExtras; // save sigma0 candidates for analysis Produces sigmaLambdaExtras; // save sigma0 candidates for analysis @@ -104,6 +102,20 @@ struct sigma0builder { Configurable Sigma0Window{"Sigma0Window", 0.1, "Mass window around expected (in GeV/c2)"}; Configurable SigmaMaxRap{"SigmaMaxRap", 0.8, "Max sigma0 rapidity"}; + //// Extras: + Configurable doPi0QA{"doPi0QA", true, "Flag to fill QA histos for pi0 rejection study."}; + Configurable Pi0PhotonMinDCADauToPv{"Pi0PhotonMinDCADauToPv", 0.0, "Min DCA daughter To PV (cm)"}; + Configurable Pi0PhotonMaxDCAV0Dau{"Pi0PhotonMaxDCAV0Dau", 3.5, "Max DCA V0 Daughters (cm)"}; + Configurable Pi0PhotonMinTPCCrossedRows{"Pi0PhotonMinTPCCrossedRows", 0, "Min daughter TPC Crossed Rows"}; + Configurable Pi0PhotonMaxTPCNSigmas{"Pi0PhotonMaxTPCNSigmas", 7, "Max TPC NSigmas for daughters"}; + Configurable Pi0PhotonMaxEta{"Pi0PhotonMaxEta", 0.8, "Max photon rapidity"}; + Configurable Pi0PhotonMinRadius{"Pi0PhotonMinRadius", 3.0, "Min photon conversion radius (cm)"}; + Configurable Pi0PhotonMaxRadius{"Pi0PhotonMaxRadius", 115, "Max photon conversion radius (cm)"}; + Configurable Pi0PhotonMaxQt{"Pi0PhotonMaxQt", 0.05, "Max photon qt value (AP plot) (GeV/c)"}; + Configurable Pi0PhotonMaxAlpha{"Pi0PhotonMaxAlpha", 0.95, "Max photon alpha absolute value (AP plot)"}; + Configurable Pi0PhotonMinV0cospa{"Pi0PhotonMinV0cospa", 0.80, "Min V0 CosPA"}; + Configurable Pi0PhotonMaxMass{"Pi0PhotonMaxMass", 0.10, "Max photon mass (GeV/c^{2})"}; + // Axis // base properties ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "pt axis for analysis"}; @@ -176,6 +188,8 @@ struct sigma0builder { histos.add("GeneralQA/h2dMassGammaVsK0SAfterMassSel", "h2dMassGammaVsK0SAfterMassSel", kTH2D, {axisPhotonMass, {200, 0.4f, 0.6f}}); histos.add("GeneralQA/h2dMassLambdaVsK0SAfterMassSel", "h2dMassLambdaVsK0SAfterMassSel", kTH2D, {axisLambdaMass, {200, 0.4f, 0.6f}}); histos.add("GeneralQA/h2dMassGammaVsLambdaAfterMassSel", "h2dMassGammaVsLambdaAfterMassSel", kTH2D, {axisPhotonMass, axisLambdaMass}); + histos.add("GeneralQA/h2dPtVsMassPi0BeforeSel_Candidates", "h2dPtVsMassPi0BeforeSel_Candidates", kTH2D, {axisPt, {500, 0.08f, 0.18f}}); + histos.add("GeneralQA/h2dPtVsMassPi0AfterSel_Candidates", "h2dPtVsMassPi0AfterSel_Candidates", kTH2D, {axisPt, {500, 0.08f, 0.18f}}); // MC histos.add("MC/h2dPtVsCentrality_GammaBeforeSel", "h2dPtVsCentrality_GammaBeforeSel", kTH2D, {axisCentrality, axisPt}); @@ -210,9 +224,110 @@ struct sigma0builder { histos.add("MC/h2dFakeGammaTrueLambdaMatrix", "h2dFakeGammaTrueLambdaMatrix", kTHnSparseD, {{10001, -5000.5f, +5000.5f}, {10001, -5000.5f, +5000.5f}}); histos.add("MC/h2dFakeDaughtersMatrix", "h2dFakeDaughtersMatrix", kTHnSparseD, {{10001, -5000.5f, +5000.5f}, {10001, -5000.5f, +5000.5f}}); + // For Pi0 QA + histos.add("MC/h2dPtVsMassPi0BeforeSel_SignalOnly", "h2dPtVsMassPi0BeforeSel_SignalOnly", kTH2D, {axisPt, {500, 0.08f, 0.18f}}); + histos.add("MC/h2dPtVsMassPi0AfterSel_SignalOnly", "h2dPtVsMassPi0AfterSel_SignalOnly", kTH2D, {axisPt, {500, 0.08f, 0.18f}}); + histos.add("h3dMassSigmasBeforeSel", "h3dMassSigmasBeforeSel", kTH3F, {axisCentrality, axisPt, axisSigmaMass}); histos.add("h3dMassSigmasAfterSel", "h3dMassSigmasAfterSel", kTH3F, {axisCentrality, axisPt, axisSigmaMass}); } + template + void runPi0QA(TV0Object const& gamma1, TV0Object const& gamma2) + { + + // Check if both V0s are made of the same tracks + if (gamma1.posTrackExtraId() == gamma2.posTrackExtraId() || + gamma1.negTrackExtraId() == gamma2.negTrackExtraId() || + gamma1.posTrackExtraId() == gamma2.negTrackExtraId() || + gamma1.negTrackExtraId() == gamma2.posTrackExtraId()) { + return; + } + + // Calculate pi0 properties + std::array pVecGamma1{gamma1.px(), gamma1.py(), gamma1.pz()}; + std::array pVecGamma2{gamma2.px(), gamma2.py(), gamma2.pz()}; + std::array arrpi0{pVecGamma1, pVecGamma2}; + float pi0Mass = RecoDecay::m(arrpi0, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassPhoton}); + float pi0Pt = RecoDecay::pt(std::array{gamma1.px() + gamma2.px(), gamma1.py() + gamma2.py()}); + float pi0Y = RecoDecay::y(std::array{gamma1.px() + gamma2.px(), gamma1.py() + gamma2.py(), gamma1.pz() + gamma2.pz()}, o2::constants::physics::MassPi0); + + // MC-specific variables + bool fIsPi0 = false, fIsMC = false; + + // Check if MC data and populate fIsMC, fIsPi0 + if constexpr (requires { gamma1.pdgCode(); gamma2.pdgCode(); }) { + fIsMC = true; + if (gamma1.pdgCode() == 22 && gamma2.pdgCode() == 22 && + gamma1.pdgCodeMother() == 111 && gamma2.pdgCodeMother() == 111 && + gamma1.motherMCPartId() == gamma2.motherMCPartId()) { + fIsPi0 = true; + histos.fill(HIST("MC/h2dPtVsMassPi0BeforeSel_SignalOnly"), pi0Pt, pi0Mass); + } + } else { + histos.fill(HIST("GeneralQA/h2dPtVsMassPi0BeforeSel_Candidates"), pi0Pt, pi0Mass); + } + + // Photon-specific selections + auto posTrackGamma1 = gamma1.template posTrackExtra_as(); + auto negTrackGamma1 = gamma1.template negTrackExtra_as(); + auto posTrackGamma2 = gamma2.template posTrackExtra_as(); + auto negTrackGamma2 = gamma2.template negTrackExtra_as(); + + // Gamma1 Selection + bool passedTPCGamma1 = (posTrackGamma1.tpcNSigmaEl() == -999.f || TMath::Abs(posTrackGamma1.tpcNSigmaEl()) < Pi0PhotonMaxTPCNSigmas) && + (negTrackGamma1.tpcNSigmaEl() == -999.f || TMath::Abs(negTrackGamma1.tpcNSigmaEl()) < Pi0PhotonMaxTPCNSigmas); + + if (TMath::Abs(gamma1.mGamma()) > Pi0PhotonMaxMass || + gamma1.qtarm() >= Pi0PhotonMaxQt || + TMath::Abs(gamma1.alpha()) >= Pi0PhotonMaxAlpha || + TMath::Abs(gamma1.dcapostopv()) < Pi0PhotonMinDCADauToPv || + TMath::Abs(gamma1.dcanegtopv()) < Pi0PhotonMinDCADauToPv || + TMath::Abs(gamma1.dcaV0daughters()) > Pi0PhotonMaxDCAV0Dau || + TMath::Abs(gamma1.negativeeta()) >= Pi0PhotonMaxEta || + TMath::Abs(gamma1.positiveeta()) >= Pi0PhotonMaxEta || + gamma1.v0cosPA() <= Pi0PhotonMinV0cospa || + gamma1.v0radius() <= Pi0PhotonMinRadius || + gamma1.v0radius() >= Pi0PhotonMaxRadius || + posTrackGamma1.tpcCrossedRows() < Pi0PhotonMinTPCCrossedRows || + negTrackGamma1.tpcCrossedRows() < Pi0PhotonMinTPCCrossedRows || + !passedTPCGamma1) { + return; + } + + // Gamma2 Selection + bool passedTPCGamma2 = (posTrackGamma2.tpcNSigmaEl() == -999.f || TMath::Abs(posTrackGamma2.tpcNSigmaEl()) < Pi0PhotonMaxTPCNSigmas) && + (negTrackGamma2.tpcNSigmaEl() == -999.f || TMath::Abs(negTrackGamma2.tpcNSigmaEl()) < Pi0PhotonMaxTPCNSigmas); + + if (TMath::Abs(gamma2.mGamma()) > Pi0PhotonMaxMass || + gamma2.qtarm() >= Pi0PhotonMaxQt || + TMath::Abs(gamma2.alpha()) >= Pi0PhotonMaxAlpha || + TMath::Abs(gamma2.dcapostopv()) < Pi0PhotonMinDCADauToPv || + TMath::Abs(gamma2.dcanegtopv()) < Pi0PhotonMinDCADauToPv || + TMath::Abs(gamma2.dcaV0daughters()) > Pi0PhotonMaxDCAV0Dau || + TMath::Abs(gamma2.negativeeta()) >= Pi0PhotonMaxEta || + TMath::Abs(gamma2.positiveeta()) >= Pi0PhotonMaxEta || + gamma2.v0cosPA() <= Pi0PhotonMinV0cospa || + gamma2.v0radius() <= Pi0PhotonMinRadius || + gamma2.v0radius() >= Pi0PhotonMaxRadius || + posTrackGamma2.tpcCrossedRows() < Pi0PhotonMinTPCCrossedRows || + negTrackGamma2.tpcCrossedRows() < Pi0PhotonMinTPCCrossedRows || + !passedTPCGamma2) { + return; + } + + // Pi0-specific selections: + if (TMath::Abs(pi0Y) > 0.5) { + return; + } + + // Fill histograms + if (fIsMC) { + if (fIsPi0) + histos.fill(HIST("MC/h2dPtVsMassPi0AfterSel_SignalOnly"), pi0Pt, pi0Mass); + } else { + histos.fill(HIST("GeneralQA/h2dPtVsMassPi0AfterSel_Candidates"), pi0Pt, pi0Mass); + } + } // Process sigma candidate and store properties in object template @@ -350,19 +465,10 @@ struct sigma0builder { histos.fill(HIST("hCandidateBuilderSelection"), 13.); return true; } - // Helper struct to pass v0 information - struct { - float mass; - float pT; - float Rapidity; - float OPAngle; - float DeltaEta; - float DeltaPhi; - } sigmaCandidate; // Fill tables with reconstructed sigma0 candidate - template - void fillTables(TV0Object const& lambda, TV0Object const& gamma) + template + void fillTables(TV0Object const& lambda, TV0Object const& gamma, TCollision const& coll) { float GammaBDTScore = -1; @@ -464,23 +570,15 @@ struct sigma0builder { TVector3 v1(gamma.px(), gamma.py(), gamma.pz()); TVector3 v2(lambda.px(), lambda.py(), lambda.pz()); - sigmaCandidate.mass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); - sigmaCandidate.pT = RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()}); - sigmaCandidate.Rapidity = RecoDecay::y(std::array{gamma.px() + lambda.px(), gamma.py() + lambda.py(), gamma.pz() + lambda.pz()}, o2::constants::physics::MassSigma0); - sigmaCandidate.OPAngle = v1.Angle(v2); - sigmaCandidate.DeltaEta = fLambdaEta - fPhotonEta; - sigmaCandidate.DeltaPhi = fLambdaPhi - fPhotonPhi; - // Sigma related - float fSigmapT = sigmaCandidate.pT; - float fSigmaMass = sigmaCandidate.mass; - float fSigmaRap = sigmaCandidate.Rapidity; - float fSigmaOPAngle = sigmaCandidate.OPAngle; - float fSigmaDeltaEta = sigmaCandidate.DeltaEta; - float fSigmaDeltaPhi = sigmaCandidate.DeltaPhi; + float fSigmapT = RecoDecay::pt(array{gamma.px() + lambda.px(), gamma.py() + lambda.py()}); + float fSigmaMass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); + float fSigmaRap = RecoDecay::y(std::array{gamma.px() + lambda.px(), gamma.py() + lambda.py(), gamma.pz() + lambda.pz()}, o2::constants::physics::MassSigma0); + float fSigmaOPAngle = v1.Angle(v2); + float fSigmaCentrality = coll.centFT0C(); // Filling TTree for ML analysis - sigma0cores(fSigmapT, fSigmaMass, fSigmaRap, fSigmaOPAngle, fSigmaDeltaEta, fSigmaDeltaPhi); + sigma0cores(fSigmapT, fSigmaMass, fSigmaRap, fSigmaOPAngle, fSigmaCentrality); sigmaPhotonExtras(fPhotonPt, fPhotonMass, fPhotonQt, fPhotonAlpha, fPhotonRadius, fPhotonCosPA, fPhotonDCADau, fPhotonDCANegPV, fPhotonDCAPosPV, fPhotonZconv, @@ -501,7 +599,7 @@ struct sigma0builder { fLambdaV0Type, LambdaBDTScore, AntiLambdaBDTScore); } - void processMonteCarlo(soa::Join const& collisions, V0DerivedMCDatas const& V0s) + void processMonteCarlo(soa::Join const& collisions, V0DerivedMCDatas const& V0s, dauTracks const&) { for (const auto& coll : collisions) { // Do analysis with collision-grouped V0s, retain full collision information @@ -549,6 +647,9 @@ struct sigma0builder { } for (auto& lambda : V0Table_thisCollision) { // selecting lambdas from Sigma0 + if (doPi0QA) // Pi0 QA study + runPi0QA(gamma, lambda); + // Sigma0 candidate properties std::array pVecPhotons{gamma.px(), gamma.py(), gamma.pz()}; std::array pVecLambda{lambda.px(), lambda.py(), lambda.pz()}; @@ -607,11 +708,14 @@ struct sigma0builder { auto V0Table_thisCollision = V0s.sliceBy(perCollisionSTDDerived, collIdx); histos.fill(HIST("hEventCentrality"), coll.centFT0C()); - sigma0Coll(coll.posX(), coll.posY(), coll.posZ(), coll.centFT0M(), coll.centFT0A(), coll.centFT0C(), coll.centFV0A()); // V0 table sliced for (auto& gamma : V0Table_thisCollision) { // selecting photons from Sigma0 for (auto& lambda : V0Table_thisCollision) { // selecting lambdas from Sigma0 + if (doPi0QA) // Pi0 QA study + runPi0QA(gamma, lambda); + + // Sigma0 candidate properties std::array pVecPhotons{gamma.px(), gamma.py(), gamma.pz()}; std::array pVecLambda{lambda.px(), lambda.py(), lambda.pz()}; auto arrMom = std::array{pVecPhotons, pVecLambda}; @@ -625,8 +729,7 @@ struct sigma0builder { histos.fill(HIST("h3dMassSigmasAfterSel"), coll.centFT0C(), SigmapT, SigmaMass); - sigma0CollRefs(collIdx); - fillTables(lambda, gamma); // filling tables with accepted candidates + fillTables(lambda, gamma, coll); // filling tables with accepted candidates nSigmaCandidates++; if (nSigmaCandidates % 5000 == 0) { @@ -645,7 +748,6 @@ struct sigma0builder { auto V0Table_thisCollision = V0s.sliceBy(perCollisionMLDerived, collIdx); histos.fill(HIST("hEventCentrality"), coll.centFT0C()); - sigma0Coll(coll.posX(), coll.posY(), coll.posZ(), coll.centFT0M(), coll.centFT0A(), coll.centFT0C(), coll.centFV0A()); // V0 table sliced for (auto& gamma : V0Table_thisCollision) { // selecting photons from Sigma0 @@ -657,8 +759,7 @@ struct sigma0builder { if (nSigmaCandidates % 5000 == 0) { LOG(info) << "Sigma0 Candidates built: " << nSigmaCandidates; } - sigma0CollRefs(collIdx); - fillTables(lambda, gamma); // filling tables with accepted candidates + fillTables(lambda, gamma, coll); // filling tables with accepted candidates } } } diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 2b07b4c0958..f1347862b91 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -54,8 +54,8 @@ using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -using V0MCSigmas = soa::Join; -using V0Sigmas = soa::Join; +using V0MCSigmas = soa::Join; +using V0Sigmas = soa::Join; struct sigmaanalysis { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -63,6 +63,9 @@ struct sigmaanalysis { // Analysis strategy: Configurable fUseMLSel{"fUseMLSel", false, "Flag to use ML selection. If False, the standard selection is applied."}; Configurable fProcessMonteCarlo{"fProcessMonteCarlo", false, "Flag to process MC data."}; + Configurable fselLambdaTPCPID{"fselLambdaTPCPID", true, "Flag to select lambda-like candidates using TPC NSigma."}; + Configurable fselLambdaTOFPID{"fselLambdaTOFPID", true, "Flag to select lambda-like candidates using TOF NSigma."}; + Configurable fLambdaTPCTOFQA{"fLambdaTPCTOFQA", false, "Flag to fill histos for Lambda TPC+TOF PID studies."}; // For ML Selection Configurable Gamma_MLThreshold{"Gamma_MLThreshold", 0.1, "Decision Threshold value to select gammas"}; @@ -107,7 +110,6 @@ struct sigmaanalysis { // TODO: Include PsiPair selection Configurable SigmaMaxRap{"SigmaMaxRap", 0.5, "Max sigma0 rapidity"}; - Configurable SigmaOPAngle{"SigmaOPAngle", 1.0, "Max sigma0 opening angle between daughters (radians)"}; // Axis // base properties @@ -139,9 +141,6 @@ struct sigmaanalysis { int nSigmaCandidates = 0; void init(InitContext const&) { - // Event counter - histos.add("hEventCentrality", "hEventCentrality", kTH1F, {axisCentrality}); - // All candidates received histos.add("GeneralQA/h2dArmenterosBeforeSel", "h2dArmenterosBeforeSel", {HistType::kTH2F, {axisAPAlpha, axisAPQt}}); histos.add("GeneralQA/h2dArmenterosAfterSel", "h2dArmenterosAfterSel", {HistType::kTH2F, {axisAPAlpha, axisAPQt}}); @@ -173,8 +172,7 @@ struct sigmaanalysis { histos.get(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(22, "Lambda CosPA Cut"); histos.get(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(23, "Lambda Y Cut"); histos.get(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(24, "Sigma Y Cut"); - histos.get(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(25, "Sigma OP Angle Cut"); - histos.get(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(26, "Lambda/ALambda PID Cut"); + histos.get(HIST("GeneralQA/hCandidateAnalysisSelection"))->GetXaxis()->SetBinLabel(25, "Lambda/ALambda PID Cut"); // Photon Selection QA histos histos.add("GeneralQA/hPhotonMass", "hPhotonMass", kTH1F, {axisPhotonMass}); @@ -230,8 +228,6 @@ struct sigmaanalysis { histos.add("AntiSigma0/hRapidityAntiSigma0", "hRapidityAntiSigma0", kTH1F, {axisRapidity}); if (fProcessMonteCarlo) { - // Event counter - histos.add("MC/hMCEventCentrality", "hMCEventCentrality", kTH1F, {axisCentrality}); // Kinematic histos.add("MC/h3dMassSigma0", "h3dMassSigma0", kTH3F, {axisCentrality, axisPt, axisSigmaMass}); @@ -287,22 +283,18 @@ struct sigmaanalysis { histos.add("MC/h3dTPCvsTOFNSigma_TrueLambdaPr", "h3dTPCvsTOFNSigma_TrueLambdaPr", kTH3F, {{120, -30, 30}, {120, -30, 30}, axisPt}); histos.add("MC/h3dTPCvsTOFNSigma_TrueLambdaPi", "h3dTPCvsTOFNSigma_TrueLambdaPi", kTH3F, {{120, -30, 30}, {120, -30, 30}, axisPt}); - // Testing New Selections: - //// Opening Angle - histos.add("MC/hPtTrueSigma_AngleSel", "hPtTrueSigma_AngleSel", kTH1F, {axisPt}); - histos.add("MC/hPtSigmaCand_AngleSel", "hPtSigmaCand_AngleSel", kTH1F, {axisPt}); - + // QA of PID selections: //// TPC PID - histos.add("MC/hPtTrueLambda_TPCPID", "hPtTrueLambda_TPCPID", kTH1F, {axisPt}); - histos.add("MC/hPtLambdaCandidates_TPCPID", "hPtLambdaCandidates_TPCPID", kTH1F, {axisPt}); + histos.add("MC/hPtTrueLambda_passedTPCPID", "hPtTrueLambda_passedTPCPID", kTH1F, {axisPt}); + histos.add("MC/hPtLambdaCandidates_passedTPCPID", "hPtLambdaCandidates_passedTPCPID", kTH1F, {axisPt}); //// TOF PID - histos.add("MC/hPtTrueLambda_TOFPID", "hPtTrueLambda_TOFPID", kTH1F, {axisPt}); - histos.add("MC/hPtLambdaCandidates_TOFPID", "hPtLambdaCandidates_TOFPID", kTH1F, {axisPt}); + histos.add("MC/hPtTrueLambda_passedTOFPID", "hPtTrueLambda_passedTOFPID", kTH1F, {axisPt}); + histos.add("MC/hPtLambdaCandidates_passedTOFPID", "hPtLambdaCandidates_passedTOFPID", kTH1F, {axisPt}); //// TPC+TOF PID - histos.add("MC/hPtTrueLambda_TPCTOFPID", "hPtTrueLambda_TPCTOFPID", kTH1F, {axisPt}); - histos.add("MC/hPtLambdaCandidates_TPCTOFPID", "hPtLambdaCandidates_TPCTOFPID", kTH1F, {axisPt}); + histos.add("MC/hPtTrueLambda_passedTPCTOFPID", "hPtTrueLambda_passedTPCTOFPID", kTH1F, {axisPt}); + histos.add("MC/hPtLambdaCandidates_passedTPCTOFPID", "hPtLambdaCandidates_passedTPCTOFPID", kTH1F, {axisPt}); } } @@ -352,11 +344,11 @@ struct sigmaanalysis { return false; histos.fill(HIST("GeneralQA/hPhotonPosTPCNSigma"), cand.photonPosTPCNSigma()); histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 6.); - if ((cand.photonPosTPCNSigma() < PhotonMinTPCNSigmas) || (cand.photonPosTPCNSigma() > PhotonMaxTPCNSigmas)) + if ((cand.photonPosTPCNSigma() != -999.f) && ((cand.photonPosTPCNSigma() < PhotonMinTPCNSigmas) || (cand.photonPosTPCNSigma() > PhotonMaxTPCNSigmas))) return false; histos.fill(HIST("GeneralQA/hPhotonNegTPCNSigma"), cand.photonNegTPCNSigma()); histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 7.); - if ((cand.photonNegTPCNSigma() < PhotonMinTPCNSigmas) || (cand.photonNegTPCNSigma() > PhotonMaxTPCNSigmas)) + if ((cand.photonNegTPCNSigma() != -999.f) && ((cand.photonNegTPCNSigma() < PhotonMinTPCNSigmas) || (cand.photonNegTPCNSigma() > PhotonMaxTPCNSigmas))) return false; histos.fill(HIST("GeneralQA/hPhotonpT"), cand.photonPt()); histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 8.); @@ -426,28 +418,66 @@ struct sigmaanalysis { return false; histos.fill(HIST("GeneralQA/hSigmaOPAngle"), cand.sigmaOPAngle()); histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 24.); - if (cand.sigmaOPAngle() > SigmaOPAngle) - return false; - histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 25.); } return true; } + // Apply selections in sigma candidates + template + bool doLambdaPIDSel(TV0Object const& cand, bool isLambdalike, bool doPIDQA) + { + bool passedTPC = true; + bool passedTOF = true; + + if (isLambdalike) { // Lambda PID selection + // TPC Selection + if (fselLambdaTPCPID && (cand.lambdaPosPrTPCNSigma() != -999.f) && (TMath::Abs(cand.lambdaPosPrTPCNSigma()) > LambdaMaxTPCNSigmas)) + passedTPC = false; + if (fselLambdaTPCPID && (cand.lambdaNegPiTPCNSigma() != -999.f) && (TMath::Abs(cand.lambdaNegPiTPCNSigma()) > LambdaMaxTPCNSigmas)) + passedTPC = false; + + // TOF Selection + if (fselLambdaTOFPID && (cand.lambdaPrTOFNSigma() != -1e+3) && (TMath::Abs(cand.lambdaPrTOFNSigma()) > LambdaMaxTOFNSigmas)) + passedTOF = false; + if (fselLambdaTOFPID && (cand.lambdaPiTOFNSigma() != -1e+3) && (TMath::Abs(cand.lambdaPiTOFNSigma()) > LambdaMaxTOFNSigmas)) + passedTOF = false; + + if constexpr (requires { cand.lambdaCandPDGCode(); }) { + if (doPIDQA && passedTPC) { + histos.fill(HIST("MC/hPtLambdaCandidates_passedTPCPID"), cand.lambdaPt()); + if (cand.lambdaCandPDGCode() == 3122) + histos.fill(HIST("MC/hPtTrueLambda_passedTPCPID"), cand.lambdaPt()); + } + if (doPIDQA && passedTOF) { + histos.fill(HIST("MC/hPtLambdaCandidates_passedTOFPID"), cand.lambdaPt()); + if (cand.lambdaCandPDGCode() == 3122) + histos.fill(HIST("MC/hPtTrueLambda_passedTOFPID"), cand.lambdaPt()); + } + if (doPIDQA && passedTPC && passedTOF) { + histos.fill(HIST("MC/hPtLambdaCandidates_passedTPCTOFPID"), cand.lambdaPt()); + if (cand.lambdaCandPDGCode() == 3122) + histos.fill(HIST("MC/hPtTrueLambda_passedTPCTOFPID"), cand.lambdaPt()); + } + } + } else { // AntiLambda PID selection + // TPC Selection + if (fselLambdaTPCPID && (cand.lambdaPosPiTPCNSigma() != -999.f) && (TMath::Abs(cand.lambdaPosPiTPCNSigma()) > LambdaMaxTPCNSigmas)) + passedTPC = false; + if (fselLambdaTPCPID && (cand.lambdaNegPrTPCNSigma() != -999.f) && (TMath::Abs(cand.lambdaNegPrTPCNSigma()) > LambdaMaxTPCNSigmas)) + passedTPC = false; + + // TOF Selection + if (fselLambdaTOFPID && (cand.aLambdaPrTOFNSigma() != -1e+3) && (TMath::Abs(cand.aLambdaPrTOFNSigma()) > LambdaMaxTOFNSigmas)) + passedTOF = false; + if (fselLambdaTOFPID && (cand.aLambdaPiTOFNSigma() != -1e+3) && (TMath::Abs(cand.aLambdaPiTOFNSigma()) > LambdaMaxTOFNSigmas)) + passedTOF = false; + } + return (passedTPC && passedTOF); + } - // This process function cross-checks index correctness - // void processCounterQA(V0Sigmas const& v0s) - // { - // for (auto& gamma : v0s) { - // histos.fill(HIST("hGammaIndices"), gamma.globalIndex()); - // histos.fill(HIST("hCollIndices"), gamma.straCollisionId()); - // histos.fill(HIST("h2dIndices"), gamma.straCollisionId(), gamma.globalIndex()); - // } - // } - - void processMonteCarlo(aod::Sigma0Collision const& coll, V0MCSigmas const& v0s) + void processMonteCarlo(V0MCSigmas const& v0s) { - histos.fill(HIST("MC/hMCEventCentrality"), coll.centFT0C()); for (auto& sigma : v0s) { // selecting Sigma0-like candidates - + // selecting Sigma0-like candidates histos.fill(HIST("MC/h2dArmenterosBeforeSel"), sigma.photonAlpha(), sigma.photonQt()); histos.fill(HIST("MC/h2dArmenterosBeforeSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); histos.fill(HIST("MC/hMassSigma0BeforeSel"), sigma.sigmaMass()); @@ -467,10 +497,6 @@ struct sigmaanalysis { if (!processSigmaCandidate(sigma)) continue; - // Purity Study + PID study: - bool fPassTPCPID = false; - bool fPassTOFPID = false; - histos.fill(HIST("MC/hPtGammaCand_AfterSel"), sigma.photonPt()); histos.fill(HIST("MC/hPtSigmaCand_AfterSel"), sigma.sigmapT()); @@ -478,46 +504,17 @@ struct sigmaanalysis { histos.fill(HIST("MC/hPtTrueGamma_AfterSel"), sigma.photonPt()); // For Lambda PID Studies - if (sigma.lambdaAlpha() > 0) { + if (fLambdaTPCTOFQA && (sigma.lambdaAlpha() > 0)) { histos.fill(HIST("MC/hPtLambdaCand_AfterSel"), sigma.lambdaPt()); - histos.fill(HIST("MC/h3dTPCvsTOFNSigma_LambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma(), sigma.sigmapT()); - histos.fill(HIST("MC/h3dTPCvsTOFNSigma_LambdaPi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma(), sigma.sigmapT()); + histos.fill(HIST("MC/h3dTPCvsTOFNSigma_LambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma(), sigma.lambdaPt()); + histos.fill(HIST("MC/h3dTPCvsTOFNSigma_LambdaPi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma(), sigma.lambdaPt()); if (sigma.lambdaCandPDGCode() == 3122) { histos.fill(HIST("MC/hPtTrueLambda_AfterSel"), sigma.lambdaPt()); - histos.fill(HIST("MC/h3dTPCvsTOFNSigma_TrueLambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma(), sigma.sigmapT()); - histos.fill(HIST("MC/h3dTPCvsTOFNSigma_TrueLambdaPi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma(), sigma.sigmapT()); - } - - // TPC PID: - if ((TMath::Abs(sigma.lambdaPosPrTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaNegPiTPCNSigma()) < LambdaMaxTPCNSigmas)) { - fPassTPCPID = true; - histos.fill(HIST("MC/hPtLambdaCandidates_TPCPID"), sigma.lambdaPt()); - if (sigma.lambdaCandPDGCode() == 3122) - histos.fill(HIST("MC/hPtTrueLambda_TPCPID"), sigma.lambdaPt()); + histos.fill(HIST("MC/h3dTPCvsTOFNSigma_TrueLambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma(), sigma.lambdaPt()); + histos.fill(HIST("MC/h3dTPCvsTOFNSigma_TrueLambdaPi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma(), sigma.lambdaPt()); } - - // TOF PID: - if ((TMath::Abs(sigma.lambdaPrTOFNSigma()) < LambdaMaxTOFNSigmas) && (TMath::Abs(sigma.lambdaPiTOFNSigma()) < LambdaMaxTOFNSigmas)) { - fPassTOFPID = true; - histos.fill(HIST("MC/hPtLambdaCandidates_TOFPID"), sigma.lambdaPt()); - if (sigma.lambdaCandPDGCode() == 3122) - histos.fill(HIST("MC/hPtTrueLambda_TOFPID"), sigma.lambdaPt()); - } - // TPC + TOF PID: - if (fPassTPCPID && fPassTOFPID) { - histos.fill(HIST("MC/hPtLambdaCandidates_TPCTOFPID"), sigma.lambdaPt()); - if (sigma.lambdaCandPDGCode() == 3122) - histos.fill(HIST("MC/hPtTrueLambda_TPCTOFPID"), sigma.lambdaPt()); - } - } - - // For Opening Angle study - if (sigma.sigmaOPAngle() <= SigmaOPAngle) { - histos.fill(HIST("MC/h2dPtVsMassSigma_AfterOPAngleSel"), sigma.sigmapT(), sigma.sigmaMass()); - histos.fill(HIST("MC/hPtSigmaCand_AngleSel"), sigma.sigmapT()); - if (sigma.isSigma() || sigma.isAntiSigma()) - histos.fill(HIST("MC/hPtTrueSigma_AngleSel"), sigma.sigmapT()); + doLambdaPIDSel(sigma, true, fLambdaTPCTOFQA); } // For background studies: @@ -543,37 +540,38 @@ struct sigmaanalysis { // MC association (signal study) if (sigma.isSigma() || sigma.isAntiSigma()) { histos.fill(HIST("MC/h2dPtVsMassSigma_SignalOnly"), sigma.sigmapT(), sigma.sigmaMass()); - histos.fill(HIST("MC/h2dPtVsOPAngle_SignalOnly"), sigma.sigmapT(), sigma.sigmaOPAngle()); histos.fill(HIST("MC/hPtTrueSigma_AfterSel"), sigma.sigmapT()); histos.fill(HIST("GeneralQA/hPhotonMassSelected"), sigma.photonMass()); if (sigma.isSigma()) { - // PID selections - if ((TMath::Abs(sigma.lambdaPosPrTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaNegPiTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaPrTOFNSigma()) < LambdaMaxTOFNSigmas) && (TMath::Abs(sigma.lambdaPiTOFNSigma()) < LambdaMaxTOFNSigmas)) { - histos.fill(HIST("MC/h2dArmenterosAfterSel"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST("MC/h2dArmenterosAfterSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); - histos.fill(HIST("GeneralQA/hLambdaMassSelected"), sigma.lambdaMass()); - histos.fill(HIST("MC/hMassSigma0"), sigma.sigmaMass()); - histos.fill(HIST("MC/hPtSigma0"), sigma.sigmapT()); - histos.fill(HIST("MC/h3dMassSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass()); - } + // TPC + TOF PID Selections + if (!doLambdaPIDSel(sigma, true, false)) + continue; + + histos.fill(HIST("MC/h2dArmenterosAfterSel"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST("MC/h2dArmenterosAfterSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); + histos.fill(HIST("GeneralQA/hLambdaMassSelected"), sigma.lambdaMass()); + histos.fill(HIST("MC/hMassSigma0"), sigma.sigmaMass()); + histos.fill(HIST("MC/hPtSigma0"), sigma.sigmapT()); + histos.fill(HIST("MC/h3dMassSigma0"), sigma.sigmaCentrality(), sigma.sigmapT(), sigma.sigmaMass()); + } else { - // PID selections - if ((TMath::Abs(sigma.lambdaPosPiTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaNegPrTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.aLambdaPrTOFNSigma()) < LambdaMaxTOFNSigmas) && (TMath::Abs(sigma.aLambdaPiTOFNSigma()) < LambdaMaxTOFNSigmas)) { - histos.fill(HIST("MC/h2dArmenterosAfterSel"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST("GeneralQA/hAntiLambdaMassSelected"), sigma.antilambdaMass()); - histos.fill(HIST("MC/h2dArmenterosAfterSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); - histos.fill(HIST("MC/hMassAntiSigma0"), sigma.sigmaMass()); - histos.fill(HIST("MC/hPtAntiSigma0"), sigma.sigmapT()); - histos.fill(HIST("MC/h3dMassAntiSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass()); - } + // TPC + TOF PID Selections + if (!doLambdaPIDSel(sigma, false, false)) + continue; + + histos.fill(HIST("MC/h2dArmenterosAfterSel"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST("GeneralQA/hAntiLambdaMassSelected"), sigma.antilambdaMass()); + histos.fill(HIST("MC/h2dArmenterosAfterSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); + histos.fill(HIST("MC/hMassAntiSigma0"), sigma.sigmaMass()); + histos.fill(HIST("MC/hPtAntiSigma0"), sigma.sigmapT()); + histos.fill(HIST("MC/h3dMassAntiSigma0"), sigma.sigmaCentrality(), sigma.sigmapT(), sigma.sigmaMass()); } } } } - void processRealData(aod::Sigma0Collision const& coll, V0Sigmas const& v0s) + void processRealData(V0Sigmas const& v0s) { - histos.fill(HIST("hEventCentrality"), coll.centFT0C()); for (auto& sigma : v0s) { // selecting Sigma0-like candidates histos.fill(HIST("GeneralQA/h2dArmenterosBeforeSel"), sigma.photonAlpha(), sigma.photonQt()); histos.fill(HIST("GeneralQA/h2dArmenterosBeforeSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); @@ -591,30 +589,36 @@ struct sigmaanalysis { // PID selections histos.fill(HIST("GeneralQA/h2dTPCvsTOFNSigma_LambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma()); histos.fill(HIST("GeneralQA/h2dTPCvsTOFNSigma_LambdaPi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma()); - if ((TMath::Abs(sigma.lambdaPosPrTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaNegPiTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaPrTOFNSigma()) < LambdaMaxTOFNSigmas) && (TMath::Abs(sigma.lambdaPiTOFNSigma()) < LambdaMaxTOFNSigmas)) { - histos.fill(HIST("GeneralQA/h2dArmenterosAfterSel"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST("GeneralQA/h2dArmenterosAfterSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); - histos.fill(HIST("GeneralQA/hLambdaMassSelected"), sigma.lambdaMass()); - histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 26.); - histos.fill(HIST("Sigma0/hMassSigma0"), sigma.sigmaMass()); - histos.fill(HIST("Sigma0/hPtSigma0"), sigma.sigmapT()); - histos.fill(HIST("Sigma0/hRapiditySigma0"), sigma.sigmaRapidity()); - histos.fill(HIST("Sigma0/h3dMassSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass()); - } + + // TPC + TOF PID Selections + if (!doLambdaPIDSel(sigma, true, false)) + continue; + + histos.fill(HIST("GeneralQA/h2dArmenterosAfterSel"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST("GeneralQA/h2dArmenterosAfterSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); + histos.fill(HIST("GeneralQA/hLambdaMassSelected"), sigma.lambdaMass()); + histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 25.); + histos.fill(HIST("Sigma0/hMassSigma0"), sigma.sigmaMass()); + histos.fill(HIST("Sigma0/hPtSigma0"), sigma.sigmapT()); + histos.fill(HIST("Sigma0/hRapiditySigma0"), sigma.sigmaRapidity()); + histos.fill(HIST("Sigma0/h3dMassSigma0"), sigma.sigmaCentrality(), sigma.sigmapT(), sigma.sigmaMass()); } else { // PID selections histos.fill(HIST("GeneralQA/h2dTPCvsTOFNSigma_ALambdaPr"), sigma.lambdaNegPrTPCNSigma(), sigma.aLambdaPrTOFNSigma()); histos.fill(HIST("GeneralQA/h2dTPCvsTOFNSigma_ALambdaPi"), sigma.lambdaPosPiTPCNSigma(), sigma.aLambdaPiTOFNSigma()); - if ((TMath::Abs(sigma.lambdaPosPiTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.lambdaNegPrTPCNSigma()) < LambdaMaxTPCNSigmas) && (TMath::Abs(sigma.aLambdaPrTOFNSigma()) < LambdaMaxTOFNSigmas) && (TMath::Abs(sigma.aLambdaPiTOFNSigma()) < LambdaMaxTOFNSigmas)) { - histos.fill(HIST("GeneralQA/h2dArmenterosAfterSel"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST("GeneralQA/h2dArmenterosAfterSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); - histos.fill(HIST("GeneralQA/hAntiLambdaMassSelected"), sigma.antilambdaMass()); - histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 26.); - histos.fill(HIST("AntiSigma0/hMassAntiSigma0"), sigma.sigmaMass()); - histos.fill(HIST("AntiSigma0/hPtAntiSigma0"), sigma.sigmapT()); - histos.fill(HIST("AntiSigma0/hRapidityAntiSigma0"), sigma.sigmaRapidity()); - histos.fill(HIST("AntiSigma0/h3dMassAntiSigma0"), coll.centFT0C(), sigma.sigmapT(), sigma.sigmaMass()); - } + + // TPC + TOF PID Selections + if (!doLambdaPIDSel(sigma, false, false)) + continue; + + histos.fill(HIST("GeneralQA/h2dArmenterosAfterSel"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST("GeneralQA/h2dArmenterosAfterSel"), sigma.lambdaAlpha(), sigma.lambdaQt()); + histos.fill(HIST("GeneralQA/hAntiLambdaMassSelected"), sigma.antilambdaMass()); + histos.fill(HIST("GeneralQA/hCandidateAnalysisSelection"), 25.); + histos.fill(HIST("AntiSigma0/hMassAntiSigma0"), sigma.sigmaMass()); + histos.fill(HIST("AntiSigma0/hPtAntiSigma0"), sigma.sigmapT()); + histos.fill(HIST("AntiSigma0/hRapidityAntiSigma0"), sigma.sigmaRapidity()); + histos.fill(HIST("AntiSigma0/h3dMassAntiSigma0"), sigma.sigmaCentrality(), sigma.sigmapT(), sigma.sigmaMass()); } } } From aea9ddab339b46ddfb513c8baebe4019ae6345d1 Mon Sep 17 00:00:00 2001 From: Artem Kotliarov <71133985+KotliarovAr@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:59:46 +0100 Subject: [PATCH 415/459] [PWGJE] Task for hadron-jet correlations in O-O collisions (#8688) --- PWGJE/Tasks/CMakeLists.txt | 4 + PWGJE/Tasks/recoilJets.cxx | 541 +++++++++++++++++++++++++++++++++++++ 2 files changed, 545 insertions(+) create mode 100644 PWGJE/Tasks/recoilJets.cxx diff --git a/PWGJE/Tasks/CMakeLists.txt b/PWGJE/Tasks/CMakeLists.txt index 4582452a7ab..14d5a0dfdfe 100644 --- a/PWGJE/Tasks/CMakeLists.txt +++ b/PWGJE/Tasks/CMakeLists.txt @@ -168,6 +168,10 @@ o2physics_add_dpl_workflow(jet-substructure-bplus SOURCES jetHadronRecoil.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(recoil-jets + SOURCES recoilJets.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(jet-nsubjettiness SOURCES nsubjettiness.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore diff --git a/PWGJE/Tasks/recoilJets.cxx b/PWGJE/Tasks/recoilJets.cxx new file mode 100644 index 00000000000..ea096d6891f --- /dev/null +++ b/PWGJE/Tasks/recoilJets.cxx @@ -0,0 +1,541 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \author Kotliarov Artem , Nuclear Physics Institute of CAS +/// \file recoilJets.cxx +/// \brief hadron-jet correlation analysis + +#include +#include +#include + +#include "TRandom3.h" +#include "TVector2.h" + +#include "Framework/ASoA.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" + +#include "CommonConstants/MathConstants.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "PWGJE/Core/FastJetUtilities.h" +#include "PWGJE/Core/JetFinder.h" +#include "PWGJE/Core/JetFindingUtilities.h" +#include "PWGJE/DataModel/Jet.h" + +#include "PWGJE/Core/JetDerivedDataUtilities.h" + +#include "EventFiltering/filterTables.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +// Shorthand notations +using filtered_Coll = soa::Filtered>::iterator; +using filtered_Coll_PartLevel = soa::Filtered>::iterator; +using filtered_Coll_DetLevel_to_GetWeight = soa::Filtered>::iterator; + +using filtered_Jets = soa::Filtered>; +using filtered_Jets_DetLevel = soa::Filtered>; +using filtered_Jets_PartLevel = soa::Filtered>; + +using filtered_MatchedJets_DetLevel = soa::Filtered>; +using filtered_MatchedJets_PartLevel = soa::Filtered>; + +using filtered_Tracks = soa::Filtered; + +struct recoilJets { + + // List of configurable parameters + Configurable evSel{"evSel", "sel8", "Choose event selection"}; + Configurable trkSel{"trkSel", "globalTracks", "Set track selection"}; + Configurable vertexZCut{"vertexZCut", 10., "Accepted z-vertex range"}; + Configurable frac_sig{"frac_sig", 0.9, "Fraction of events to use for signal TT"}; + + Configurable trkPtMin{"trkPtMin", 0.15, "Minimum pT of acceptanced tracks"}; + Configurable trkPtMax{"trkPtMax", 100., "Maximum pT of acceptanced tracks"}; + + Configurable trkPhiMin{"trkPhiMin", -7., "Minimum phi angle of acceptanced tracks"}; + Configurable trkPhiMax{"trkPhiMax", 7., "Maximum phi angle of acceptanced tracks"}; + + Configurable trkEtaCut{"trkEtaCut", 0.9, "Eta acceptance of TPC"}; + Configurable jetR{"jetR", 0.4, "Jet cone radius"}; + + Configurable triggerMasks{"triggerMasks", "", "Relevant trigger masks: fJetChLowPt,fJetChHighPt,fTrackLowPt,fTrackHighPt"}; + + // List of configurable parameters for MC + Configurable pTHatExponent{"pTHatExponent", 4.0, "Exponent of the event weight for the calculation of pTHat"}; + Configurable pTHatMax{"pTHatMax", 999.0, "Maximum fraction of hard scattering for jet acceptance in MC"}; + + // Parameters for recoil jet selection + Configurable pT_TTref_min{"pT_TTref_min", 5, "Minimum pT of reference TT"}; + Configurable pT_TTref_max{"pT_TTref_max", 7, "Maximum pT of reference TT"}; + Configurable pT_TTsig_min{"pT_TTsig_min", 20, "Minimum pT of signal TT"}; + Configurable pT_TTsig_max{"pT_TTsig_max", 50, "Maximum pT of signal TT"}; + Configurable recoilRegion{"recoilRegion", 0.6, "Width of recoil acceptance"}; + + // List of configurable parameters for histograms + Configurable hist_jetPt{"hist_jetPt", 100, "Maximum value of jet pT shown in histograms"}; + + // Axes specification + AxisSpec pT{hist_jetPt, 0.0, hist_jetPt * 1.0, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec jet_pT_corr{hist_jetPt + 20, -20., hist_jetPt * 1.0, "#it{p}_{T, jet}^{ch, corr} (GeV/#it{c})"}; + AxisSpec phi_angle{40, 0.0, constants::math::TwoPI, "#varphi (rad)"}; + AxisSpec deltaPhi_angle{52, 0.0, constants::math::PI, "#Delta#varphi (rad)"}; + AxisSpec pseudorap{40, -1., 1., "#eta"}; + AxisSpec rhoArea{60, 0.0, 30., "#rho #times #A_{jet}"}; + + Preslice PartJetsPerCollision = aod::jet::mcCollisionId; + + TRandom3* rand = new TRandom3(0); + + // Declare filter on collision Z vertex + Filter collisionFilter = nabs(aod::jcollision::posZ) < vertexZCut; + Filter collisionFilterMC = nabs(aod::jmccollision::posZ) < vertexZCut; + + // Declare filters on accepted tracks + Filter trackFilter = aod::jtrack::pt > trkPtMin&& aod::jtrack::pt < trkPtMax&& nabs(aod::jtrack::eta) < trkEtaCut; + + // Declare filter on jets + Filter jetRadiusFilter = aod::jet::r == nround(jetR.node() * 100.); + + HistogramRegistry spectra; + + int eventSelection = -1; + int trackSelection = -1; + std::vector triggerMaskBits; + + void init(InitContext const&) + { + + eventSelection = jetderiveddatautilities::initialiseEventSelection(static_cast(evSel)); + trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast(trkSel)); + triggerMaskBits = jetderiveddatautilities::initialiseTriggerMaskBits(triggerMasks); + + // List of raw distributions + spectra.add("vertexZ", "Z vertex of collisions", kTH1F, {{60, -12., 12.}}); + + spectra.add("hTrackPtEtaPhi", "Charact. of tracks", kTH3F, {pT, pseudorap, phi_angle}); + spectra.add("hNtrig", "Total number of selected triggers per class", kTH1F, {{2, 0.0, 2.}}); // Can we set name for bins? + spectra.add("hTTRef_per_event", "Number of TT_{Ref} per event", kTH1F, {{10, 0.0, 10.}}); + spectra.add("hTTSig_per_event", "Number of TT_{Sig} per event", kTH1F, {{5, 0.0, 5.}}); + + spectra.add("hJetPtEtaPhiRhoArea", "Charact. of inclusive jets", kTHnSparseF, {pT, pseudorap, phi_angle, rhoArea}); + + spectra.add("hDPhi_JetPt_Corr_TTRef", "Events w. TT_{Ref}: #Delta#varphi & #it{p}_{T, jet}^{ch}", kTH2F, {deltaPhi_angle, jet_pT_corr}); + spectra.add("hDPhi_JetPt_Corr_TTSig", "Events w. TT_{Sig}: #Delta#varphi & #it{p}_{T, jet}^{ch}", kTH2F, {deltaPhi_angle, jet_pT_corr}); + spectra.add("hDPhi_JetPt_TTRef", "Events w. TT_{Ref}: #Delta#varphi & #it{p}_{T, jet}^{ch}", kTH2F, {deltaPhi_angle, pT}); + spectra.add("hDPhi_JetPt_TTSig", "Events w. TT_{Sig}: #Delta#varphi & #it{p}_{T, jet}^{ch}", kTH2F, {deltaPhi_angle, pT}); + + spectra.add("hRecoil_JetPt_Corr_TTRef", "Events w. TT_{Ref}: #it{p}_{T} of recoil jets", kTH1F, {jet_pT_corr}); + spectra.add("hRecoil_JetPt_Corr_TTSig", "Events w. TT_{Sig}: #it{p}_{T} of recoil jets", kTH1F, {jet_pT_corr}); + spectra.add("hRecoil_JetPt_TTRef", "Events w. TT_{Ref}: #it{p}_{T} of recoil jets", kTH1F, {pT}); + spectra.add("hRecoil_JetPt_TTSig", "Events w. TT_{Sig}: #it{p}_{T} of recoil jets", kTH1F, {pT}); + + spectra.add("hDPhi_JetPt_RhoArea_TTRef", "Events w. TT_{Ref}: #Delta#varphi & jet pT & #rho #times A_{jet}", kTH3F, {deltaPhi_angle, pT, rhoArea}); + spectra.add("hDPhi_JetPt_RhoArea_TTSig", "Events w. TT_{Sig}: #Delta#varphi & jet pT & #rho #times A_{jet}", kTH3F, {deltaPhi_angle, pT, rhoArea}); + + // List of MC particle level distributions + spectra.add("hPartPtEtaPhi", "Charact. of particles", kTH3F, {pT, pseudorap, phi_angle}); + spectra.add("hNtrig_Part", "Total number of selected triggers per class", kTH1F, {{2, 0.0, 2.}}); + spectra.add("hTTRef_per_event_Part", "Number of TT_{Ref} per event", kTH1F, {{10, 0.0, 10.}}); + spectra.add("hTTSig_per_event_Part", "Number of TT_{Sig} per event", kTH1F, {{5, 0.0, 5.}}); + + spectra.add("hJetPtEtaPhiRhoArea_Part", "Charact. of inclusive part. level jets", kTHnSparseF, {pT, pseudorap, phi_angle, rhoArea}); + + spectra.add("hDPhi_JetPt_Corr_TTRef_Part", "Events w. TT_{Ref}: #Delta#varphi & #it{p}_{T, jet}^{ch}", kTH2F, {deltaPhi_angle, jet_pT_corr}); + spectra.add("hDPhi_JetPt_Corr_TTSig_Part", "Events w. TT_{Sig}: #Delta#varphi & #it{p}_{T, jet}^{ch}", kTH2F, {deltaPhi_angle, jet_pT_corr}); + spectra.add("hDPhi_JetPt_TTRef_Part", "Events w. TT_{Ref}: #Delta#varphi & #it{p}_{T, jet}^{ch}", kTH2F, {deltaPhi_angle, pT}); + spectra.add("hDPhi_JetPt_TTSig_Part", "Events w. TT_{Sig}: #Delta#varphi & #it{p}_{T, jet}^{ch}", kTH2F, {deltaPhi_angle, pT}); + + spectra.add("hRecoil_JetPt_Corr_TTRef_Part", "Events w. TT_{Ref}: #it{p}_{T} of recoil jets", kTH1F, {jet_pT_corr}); + spectra.add("hRecoil_JetPt_Corr_TTSig_Part", "Events w. TT_{Sig}: #it{p}_{T} of recoil jets", kTH1F, {jet_pT_corr}); + spectra.add("hRecoil_JetPt_TTRef_Part", "Events w. TT_{Ref}: #it{p}_{T} of recoil jets", kTH1F, {pT}); + spectra.add("hRecoil_JetPt_TTSig_Part", "Events w. TT_{Sig}: #it{p}_{T} of recoil jets", kTH1F, {pT}); + + spectra.add("hDPhi_JetPt_RhoArea_TTRef_Part", "Events w. TT_{Ref}: #Delta#varphi & jet pT & #rho #times A_{jet}", kTH3F, {deltaPhi_angle, pT, rhoArea}); + spectra.add("hDPhi_JetPt_RhoArea_TTSig_Part", "Events w. TT_{Sig}: #Delta#varphi & jet pT & #rho #times A_{jet}", kTH3F, {deltaPhi_angle, pT, rhoArea}); + + // Response matrices, jet pT & jet phi resolution + spectra.add("hJetPt_PartLevel_vs_DetLevel", "Correlation jet pT at part. vs. det. levels", kTH2F, {pT, pT}); + spectra.add("hJetPt_PartLevel_vs_DetLevel_RecoilJets", "Correlation recoil jet pT at part. vs. det. levels", kTH2F, {pT, pT}); + + spectra.add("hMissedJets_pT", "Part. level jets w/o matched pair", kTH1F, {pT}); + spectra.add("hMissedJets_pT_RecoilJets", "Part. level jets w/o matched pair", kTH1F, {pT}); + + spectra.add("hFakeJets_pT", "Det. level jets w/o matched pair", kTH1F, {pT}); + spectra.add("hFakeJets_pT_RecoilJets", "Det. level jets w/o matched pair", kTH1F, {pT}); + + spectra.add("hJetPt_resolution", "Jet p_{T} relative resolution as a func. of jet #it{p}_{T, part}", kTH2F, {{60, -1., 2.}, pT}); + spectra.add("hJetPt_resolution_RecoilJets", "Jet p_{T} relative resolution as a func. of jet #it{p}_{T, part}", kTH2F, {{60, -1., 2.}, pT}); + + spectra.add("hJetPhi_resolution", "#varphi resolution as a func. of jet #it{p}_{T, part}", kTH2F, {{40, -1., 1.}, pT}); + spectra.add("hJetPhi_resolution_RecoilJets", "#varphi resolution as a func. of jet #it{p}_{T, part}", kTH2F, {{40, -1., 1.}, pT}); + } + + // Fill histograms with raw or MC det. level data + template + void fillHistograms(Collision const& collision, Jets const& jets, Tracks const& tracks, bool bIsMC = false, float weight = 1.) + { + + bool bSig_Ev = false; + std::vector phi_of_TT_cand; + double phi_TT = 0.; + int nTT = 0; + float pTHat = 0.; + if (bIsMC) + pTHat = getPtHat(weight); + + auto dice = rand->Rndm(); + if (dice < frac_sig) + bSig_Ev = true; + + for (const auto& track : tracks) { + if (!jetderiveddatautilities::selectTrack(track, trackSelection)) + continue; + + spectra.fill(HIST("hTrackPtEtaPhi"), track.pt(), track.eta(), track.phi(), weight); + + // Search for TT candidate + if (bSig_Ev && (track.pt() > pT_TTsig_min && track.pt() < pT_TTsig_max)) { + phi_of_TT_cand.push_back(track.phi()); + ++nTT; + } + + if (!bSig_Ev && (track.pt() > pT_TTref_min && track.pt() < pT_TTref_max)) { + phi_of_TT_cand.push_back(track.phi()); + ++nTT; + } + } + + if (nTT > 0) { // at least 1 TT + + phi_TT = getPhiTT(phi_of_TT_cand); + + if (bSig_Ev) { + spectra.fill(HIST("hNtrig"), 1.5, weight); + spectra.fill(HIST("hTTSig_per_event"), nTT, weight); + } else { + spectra.fill(HIST("hNtrig"), 0.5, weight); + spectra.fill(HIST("hTTRef_per_event"), nTT, weight); + } + } + + for (const auto& jet : jets) { + + if (bIsMC && (jet.pt() > pTHatMax * pTHat)) + continue; + + spectra.fill(HIST("hJetPtEtaPhiRhoArea"), jet.pt(), jet.eta(), jet.phi(), collision.rho() * jet.area(), weight); + + if (nTT > 0) { + auto [dphi, bRecoil] = isRecoilJet(jet, phi_TT); + + if (bSig_Ev) { + + spectra.fill(HIST("hDPhi_JetPt_Corr_TTSig"), dphi, jet.pt() - collision.rho() * jet.area(), weight); + spectra.fill(HIST("hDPhi_JetPt_TTSig"), dphi, jet.pt(), weight); + spectra.fill(HIST("hDPhi_JetPt_RhoArea_TTSig"), dphi, jet.pt(), collision.rho() * jet.area(), weight); + + if (bRecoil) { + spectra.fill(HIST("hRecoil_JetPt_Corr_TTSig"), jet.pt() - collision.rho() * jet.area(), weight); + spectra.fill(HIST("hRecoil_JetPt_TTSig"), jet.pt(), weight); + } + + } else { + spectra.fill(HIST("hDPhi_JetPt_Corr_TTRef"), dphi, jet.pt() - collision.rho() * jet.area(), weight); + spectra.fill(HIST("hDPhi_JetPt_TTRef"), dphi, jet.pt(), weight); + spectra.fill(HIST("hDPhi_JetPt_RhoArea_TTRef"), dphi, jet.pt(), collision.rho() * jet.area(), weight); + + if (bRecoil) { + spectra.fill(HIST("hRecoil_JetPt_Corr_TTRef"), jet.pt() - collision.rho() * jet.area(), weight); + spectra.fill(HIST("hRecoil_JetPt_TTRef"), jet.pt(), weight); + } + } + } + } + } + + template + void fillMCPHistograms(Collision const& collision, Jets const& jets, Particles const& particles, float weight = 1.) + { + bool bSig_Ev = false; + std::vector phi_of_TT_cand; + double phi_TT = 0.; + int nTT = 0; + float pTHat = getPtHat(weight); + + auto dice = rand->Rndm(); + if (dice < frac_sig) + bSig_Ev = true; + + for (const auto& particle : particles) { + + // Need charge and primary particles + bool bParticleNeutral = (static_cast(particle.e()) == 0); + if (bParticleNeutral || (!particle.isPhysicalPrimary())) + continue; + + spectra.fill(HIST("hPartPtEtaPhi"), particle.pt(), particle.eta(), particle.phi(), weight); + + if (bSig_Ev && (particle.pt() > pT_TTsig_min && particle.pt() < pT_TTsig_max)) { + phi_of_TT_cand.push_back(particle.phi()); + ++nTT; + } + + if (!bSig_Ev && (particle.pt() > pT_TTref_min && particle.pt() < pT_TTref_max)) { + phi_of_TT_cand.push_back(particle.phi()); + ++nTT; + } + } + + if (nTT > 0) { + + phi_TT = getPhiTT(phi_of_TT_cand); + + if (bSig_Ev) { + spectra.fill(HIST("hNtrig_Part"), 1.5, weight); + spectra.fill(HIST("hTTSig_per_event_Part"), nTT, weight); + } else { + spectra.fill(HIST("hNtrig_Part"), 0.5, weight); + spectra.fill(HIST("hTTRef_per_event_Part"), nTT, weight); + } + } + + for (const auto& jet : jets) { + + if (jet.pt() > pTHatMax * pTHat) + continue; + + spectra.fill(HIST("hJetPtEtaPhiRhoArea_Part"), jet.pt(), jet.eta(), jet.phi(), collision.rho() * jet.area(), weight); + + if (nTT > 0) { + + auto [dphi, bRecoil] = isRecoilJet(jet, phi_TT); + + if (bSig_Ev) { + + spectra.fill(HIST("hDPhi_JetPt_Corr_TTSig_Part"), dphi, jet.pt() - collision.rho() * jet.area(), weight); + spectra.fill(HIST("hDPhi_JetPt_TTSig_Part"), dphi, jet.pt(), weight); + spectra.fill(HIST("hDPhi_JetPt_RhoArea_TTSig_Part"), dphi, jet.pt(), collision.rho() * jet.area(), weight); + + if (bRecoil) { + spectra.fill(HIST("hRecoil_JetPt_Corr_TTSig_Part"), jet.pt() - collision.rho() * jet.area(), weight); + spectra.fill(HIST("hRecoil_JetPt_TTSig_Part"), jet.pt(), weight); + } + + } else { + + spectra.fill(HIST("hDPhi_JetPt_Corr_TTRef_Part"), dphi, jet.pt() - collision.rho() * jet.area(), weight); + spectra.fill(HIST("hDPhi_JetPt_TTRef_Part"), dphi, jet.pt(), weight); + spectra.fill(HIST("hDPhi_JetPt_RhoArea_TTRef_Part"), dphi, jet.pt(), collision.rho() * jet.area(), weight); + + if (bRecoil) { + spectra.fill(HIST("hRecoil_JetPt_Corr_TTRef_Part"), jet.pt() - collision.rho() * jet.area(), weight); + spectra.fill(HIST("hRecoil_JetPt_TTRef_Part"), jet.pt(), weight); + } + } + } + } + } + + template + void fillMatchedHistograms(Tracks const& tracks, DetLevelJets const& jets_det_level, PartLevelJets const& jets_part_level, float weight = 1.) + { + std::vector phi_of_TT_cand; + double phi_TT = 0.; + float pTHat = getPtHat(weight); + + for (const auto& track : tracks) { + if (!jetderiveddatautilities::selectTrack(track, trackSelection)) + continue; + + if (track.pt() > pT_TTsig_min && track.pt() < pT_TTsig_max) { + phi_of_TT_cand.push_back(track.phi()); + } + } + + bool bTT = phi_of_TT_cand.size() > 0; + if (bTT) + phi_TT = getPhiTT(phi_of_TT_cand); + + for (const auto& jet_det_level : jets_det_level) { + if (jet_det_level.pt() > pTHatMax * pTHat) + continue; + + bool bRecoil = get<1>(isRecoilJet(jet_det_level, phi_TT)) && bTT; + + if (jet_det_level.has_matchedJetGeo()) { + + const auto jets_matched_part_level = jet_det_level.template matchedJetGeo_as>(); // we can add "matchedJetPt_as" later + + for (const auto& jet_matched_part_level : jets_matched_part_level) { + + /* + Which histos we want: + 1) det pT vs. part. pT for inclusive jets (corrected for rho*A and not) + 2) det pT vs. part. pT for recoil jets + 3) same as (1) and (2) but 4D with dphi parts + 4) distribution of fake and miss jets + 5) pT and phi resolutions + */ + + spectra.fill(HIST("hJetPt_PartLevel_vs_DetLevel"), jet_det_level.pt(), jet_matched_part_level.pt(), weight); + spectra.fill(HIST("hJetPt_resolution"), (jet_matched_part_level.pt() - jet_det_level.pt()) / jet_matched_part_level.pt(), jet_matched_part_level.pt(), weight); + spectra.fill(HIST("hJetPhi_resolution"), jet_matched_part_level.phi() - jet_det_level.phi(), jet_matched_part_level.pt(), weight); + + if (bRecoil) { + spectra.fill(HIST("hJetPt_PartLevel_vs_DetLevel_RecoilJets"), jet_det_level.pt(), jet_matched_part_level.pt(), weight); + spectra.fill(HIST("hJetPt_resolution_RecoilJets"), (jet_matched_part_level.pt() - jet_det_level.pt()) / jet_matched_part_level.pt(), jet_matched_part_level.pt(), weight); + spectra.fill(HIST("hJetPhi_resolution_RecoilJets"), jet_matched_part_level.phi() - jet_det_level.phi(), jet_matched_part_level.pt(), weight); + } + } + } else { + spectra.fill(HIST("hFakeJets_pT"), jet_det_level.pt(), weight); + if (bRecoil) + spectra.fill(HIST("hFakeJets_pT_RecoilJets"), jet_det_level.pt(), weight); + } + } + + // Missed jets + for (const auto& jet_part_level : jets_part_level) { + if (!jet_part_level.has_matchedJetGeo()) { + spectra.fill(HIST("hMissedJets_pT"), jet_part_level.pt(), weight); + } + } + } + + void processData(filtered_Coll const& collision, + filtered_Tracks const& tracks, + filtered_Jets const& jets) + { + if (skipEvent(collision)) + return; + + spectra.fill(HIST("vertexZ"), collision.posZ()); + fillHistograms(collision, jets, tracks); + } + PROCESS_SWITCH(recoilJets, processData, "process data", true); + + void processMC_DetLevel(filtered_Coll const& collision, + filtered_Jets_DetLevel const& jets, + filtered_Tracks const& tracks) + { + if (skipEvent(collision)) + return; + + spectra.fill(HIST("vertexZ"), collision.posZ()); + fillHistograms(collision, jets, tracks, true); + } + PROCESS_SWITCH(recoilJets, processMC_DetLevel, "process MC detector level", false); + + void processMC_DetLevel_Weighted(filtered_Coll_DetLevel_to_GetWeight const& collision, + aod::JetMcCollisions const&, + filtered_Jets_DetLevel const& jets, + filtered_Tracks const& tracks) + { + if (skipEvent(collision)) + return; + + /// \TODO: should we implement function to check whether Collision was reconstructed (has_mcCollision() function)? Example: https://github.com/AliceO2Group/O2Physics/blob/1cba330514ab47c15c0095d8cee9633723d8e2a7/PWGJE/Tasks/v0qa.cxx#L166? + auto weight = collision.mcCollision().weight(); // "mcCollision" where is defined? + spectra.fill(HIST("vertexZ"), collision.posZ(), weight); + fillHistograms(collision, jets, tracks, true, weight); + } + PROCESS_SWITCH(recoilJets, processMC_DetLevel_Weighted, "process MC detector level with event weight", false); + + void processMC_PartLevel(filtered_Coll_PartLevel const& collision, + filtered_Jets_PartLevel const& jets, + aod::JetParticles const& particles) + { + spectra.fill(HIST("vertexZ"), collision.posZ()); + fillMCPHistograms(collision, jets, particles); + } + PROCESS_SWITCH(recoilJets, processMC_PartLevel, "process MC particle level", false); + + void processMC_PartLevel_Weighted(filtered_Coll_PartLevel const& collision, + filtered_Jets_PartLevel const& jets, + aod::JetParticles const& particles) + { + auto weight = collision.weight(); + spectra.fill(HIST("vertexZ"), collision.posZ(), weight); + fillMCPHistograms(collision, jets, particles, weight); + } + PROCESS_SWITCH(recoilJets, processMC_PartLevel_Weighted, "process MC particle level with event weight", false); + + void processJetsMatched(filtered_Coll_DetLevel_to_GetWeight const& collision, + aod::JetMcCollisions const&, + filtered_Tracks const& tracks, + filtered_MatchedJets_DetLevel const& mcdjets, + filtered_MatchedJets_PartLevel const& mcpjets) + { + if (skipEvent(collision)) + return; + auto mcpjetsPerMCCollision = mcpjets.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); + fillMatchedHistograms(tracks, mcdjets, mcpjetsPerMCCollision); + } + PROCESS_SWITCH(recoilJets, processJetsMatched, "process matching of MC jets (no weight)", false); + + void processJetsMatched_Weighted(filtered_Coll_DetLevel_to_GetWeight const& collision, + aod::JetMcCollisions const&, + filtered_Tracks const& tracks, + filtered_MatchedJets_DetLevel const& mcdjets, + filtered_MatchedJets_PartLevel const& mcpjets) + { + if (skipEvent(collision)) + return; + + auto mcpjetsPerMCCollision = mcpjets.sliceBy(PartJetsPerCollision, collision.mcCollisionId()); + auto weight = collision.mcCollision().weight(); + + fillMatchedHistograms(tracks, mcdjets, mcpjetsPerMCCollision, weight); + } + PROCESS_SWITCH(recoilJets, processJetsMatched_Weighted, "process matching of MC jets (weighted)", false); + + //------------------------------------------------------------------------------ + // Auxiliary functions + template + bool skipEvent(const Collision& coll) + { + /// \brief: trigger cut is needed for pp data + return !jetderiveddatautilities::selectCollision(coll, eventSelection) || !jetderiveddatautilities::selectTrigger(coll, triggerMaskBits); + } + + template + std::tuple isRecoilJet(const Jet& jet, + double phi_TT) + { + double dphi = std::fabs(RecoDecay::constrainAngle(jet.phi() - phi_TT, -constants::math::PI)); + return {dphi, (constants::math::PI - recoilRegion) < dphi}; + } + + double getPhiTT(const std::vector& phi_of_TT_cand) + { + auto iTrig = rand->Integer(phi_of_TT_cand.size()); + return phi_of_TT_cand[iTrig]; + } + + float getPtHat(float weight) + { + return 10. / (std::pow(weight, 1.0 / pTHatExponent)); + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"recoil-jets"})}; } From 8242ca0e6ea2b1e568271db1cff80442136df390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:28:23 +0100 Subject: [PATCH 416/459] [PWGHF] Fix the bug come from sign of track (#9024) --- PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx index aa6ba1525eb..1636d5223b3 100644 --- a/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskDirectedFlowCharmHadrons.cxx @@ -230,11 +230,14 @@ struct HfTaskDirectedFlowCharmHadrons { for (const auto& candidate : candidates) { double massCand = 0.; double rapCand = 0.; + double sign = 0.; // electric charge of the first daughter track to differentiate particle and antiparticle double signDstarCand = 0.0; std::vector outputMl = {-999., -999.}; if constexpr (std::is_same_v || std::is_same_v) { massCand = hfHelper.invMassDplusToPiKPi(candidate); rapCand = hfHelper.yDplus(candidate); + auto trackprong0 = candidate.template prong0_as(); + sign = trackprong0.sign(); if constexpr (std::is_same_v) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)]; @@ -244,6 +247,7 @@ struct HfTaskDirectedFlowCharmHadrons { case DecayChannel::D0ToPiK: massCand = hfHelper.invMassD0ToPiK(candidate); rapCand = hfHelper.yD0(candidate); + sign = 1; if constexpr (std::is_same_v) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) outputMl[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; @@ -252,6 +256,7 @@ struct HfTaskDirectedFlowCharmHadrons { case DecayChannel::D0ToKPi: massCand = hfHelper.invMassD0barToKPi(candidate); rapCand = hfHelper.yD0(candidate); + sign = -1; if constexpr (std::is_same_v) { for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) outputMl[iclass] = candidate.mlProbD0bar()[classMl->at(iclass)]; @@ -275,9 +280,6 @@ struct HfTaskDirectedFlowCharmHadrons { } } - auto trackprong0 = candidate.template prong0_as(); - double sign = trackprong0.sign(); // electric charge of the first daughter track to differentiate particle and antiparticle - double ptCand = candidate.pt(); double etaCand = candidate.eta(); double phiCand = candidate.phi(); From 8ee77155caeed78efc164afdf75610d5cc00d922 Mon Sep 17 00:00:00 2001 From: Joachim Carlo Kristian Bjerg Hansen <50103987+joachimckh@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:56:02 +0100 Subject: [PATCH 417/459] [PWGJE] Changes to Event Plane + Occupancy process function (#8731) --- PWGJE/Tasks/jetSpectraEseTask.cxx | 317 +++++++++++++++++++++--------- 1 file changed, 219 insertions(+), 98 deletions(-) diff --git a/PWGJE/Tasks/jetSpectraEseTask.cxx b/PWGJE/Tasks/jetSpectraEseTask.cxx index 96ecaba87b9..616775758bc 100644 --- a/PWGJE/Tasks/jetSpectraEseTask.cxx +++ b/PWGJE/Tasks/jetSpectraEseTask.cxx @@ -15,6 +15,8 @@ /// \author Joachim C. K. B. Hansen, Lund University #include +#include +#include #include "Framework/ASoA.h" #include "Framework/AnalysisDataModel.h" @@ -39,35 +41,58 @@ using namespace o2::framework; using namespace o2::framework::expressions; #include "Framework/runDataProcessing.h" +#include "Framework/StaticFor.h" struct JetSpectraEseTask { ConfigurableAxis binJetPt{"binJetPt", {200, 0., 200.}, ""}; - ConfigurableAxis bindPhi{"bindPhi", {100, -TMath::Pi() - 1, TMath::Pi() + 1}, ""}; + ConfigurableAxis bindPhi{"bindPhi", {100, -o2::constants::math::PI - 1, o2::constants::math::PI + 1}, ""}; ConfigurableAxis binESE{"binESE", {100, 0, 100}, ""}; ConfigurableAxis binCos{"binCos", {100, -1.05, 1.05}, ""}; + ConfigurableAxis binOccupancy{"binOccupancy", {5000, 0, 25000}, ""}; + ConfigurableAxis binQVec{"binQVec", {100, -3, 3}, ""}; Configurable jetPtMin{"jetPtMin", 5.0, "minimum jet pT cut"}; Configurable jetR{"jetR", 0.2, "jet resolution parameter"}; Configurable vertexZCut{"vertexZCut", 10.0, "vertex z cut"}; - Configurable> CentRange{"CentRange", {30, 50}, "centrality region of interest"}; - Configurable leadingJetPtCut{"fLeadingJetPtCut", 5.0, "leading jet pT cut"}; + Configurable> centRange{"centRange", {30, 50}, "centrality region of interest"}; + Configurable leadingJetPtCut{"leadingJetPtCut", 5.0, "leading jet pT cut"}; Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; Configurable fColSwitch{"fColSwitch", 0, "collision switch"}; + Configurable cfgEvSelOccupancy{"cfgEvSelOccupancy", false, "Flag for occupancy cut"}; + Configurable> cfgCutOccupancy{"cfgCutOccupancy", {0, 500}, "Occupancy cut"}; + Configurable> cfgOccupancyPtCut{"cfgOccupancyPtCut", {0, 100}, "pT cut"}; + + Configurable cfgnTotalSystem{"cfgnTotalSystem", 7, "total qvector number // look in Qvector table for this number"}; + Configurable cfgnCorrLevel{"cfgnCorrLevel", 3, "QVector step: 0 = no corr, 1 = rect, 2 = twist, 3 = full"}; + + Configurable cfgEPRefA{"cfgEPRefA", "FT0A", "EP reference A"}; + Configurable cfgEPRefB{"cfgEPRefB", "TPCpos", "EP reference B"}; + Configurable cfgEPRefC{"cfgEPRefC", "TPCneg", "EP reference C"}; + AxisSpec jetPtAxis = {binJetPt, "#it{p}_{T,jet}"}; AxisSpec dPhiAxis = {bindPhi, "#Delta#phi"}; AxisSpec eseAxis = {binESE, "#it{q}_{2}"}; - AxisSpec cosAxis = {binCos, ""}; + AxisSpec occAxis = {binOccupancy, "Occupancy"}; + AxisSpec qvecAxis = {binQVec, "Q-vector"}; HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; int eventSelection = -1; int trackSelection = -1; + enum class DetID { FT0C, + FT0A, + FT0M, + FV0A, + TPCpos, + TPCneg, + TPCall }; + void init(o2::framework::InitContext&) { eventSelection = jetderiveddatautilities::initialiseEventSelection(static_cast(eventSelections)); @@ -86,39 +111,51 @@ struct JetSpectraEseTask { registry.add("hRho", ";#rho;entries", {HistType::kTH1F, {{100, 0, 200.}}}); registry.add("hJetArea", ";area_{jet};entries", {HistType::kTH1F, {{100, 0, 10.}}}); registry.add("hdPhi", "#Delta#phi;entries;", {HistType::kTH1F, {{dPhiAxis}}}); - registry.add("hJetPtdPhiq2", "", {HistType::kTH3F, {{jetPtAxis}, {dPhiAxis}, {eseAxis}}}); + registry.add("hCentJetPtdPhiq2", "", {HistType::kTHnSparseF, {{100, 0, 100}, {jetPtAxis}, {dPhiAxis}, {eseAxis}}}); registry.add("hPsi2FT0C", ";Centrality; #Psi_{2}", {HistType::kTH2F, {{100, 0, 100}, {150, -2.5, 2.5}}}); - registry.add("hPsi2FT0A", ";Centrality; #Psi_{2}", {HistType::kTH2F, {{100, 0, 100}, {150, -2.5, 2.5}}}); - registry.add("hPsi2FV0A", ";Centrality; #Psi_{2}", {HistType::kTH2F, {{100, 0, 100}, {150, -2.5, 2.5}}}); - registry.add("hPsi2TPCpos", ";Centrality; #Psi_{2}", {HistType::kTH2F, {{100, 0, 100}, {150, -2.5, 2.5}}}); - registry.add("hPsi2TPCneg", ";Centrality; #Psi_{2}", {HistType::kTH2F, {{100, 0, 100}, {150, -2.5, 2.5}}}); - registry.add("hCosPsi2FT0CmFT0A", ";Centrality;cos(2(#Psi_{2}^{FT0C}-#Psi_{2}^{FT0A}));#it{q}_{2}", {HistType::kTH3F, {{100, 0, 100}, {cosAxis}, {eseAxis}}}); - registry.add("hCosPsi2FT0CmFV0A", ";Centrality;cos(2(#Psi_{2}^{FT0C}-#Psi_{2}^{FV0A}));#it{q}_{2}", {HistType::kTH3F, {{100, 0, 100}, {cosAxis}, {eseAxis}}}); - registry.add("hCosPsi2FV0AmFT0A", ";Centrality;cos(2(#Psi_{2}^{FT0C}-#Psi_{2}^{FV0A}));#it{q}_{2}", {HistType::kTH3F, {{100, 0, 100}, {cosAxis}, {eseAxis}}}); - registry.add("hCosPsi2FT0AmFT0C", ";Centrality;cos(2(#Psi_{2}^{FT0A}-#Psi_{2}^{FT0C}));#it{q}_{2}", {HistType::kTH3F, {{100, 0, 100}, {cosAxis}, {eseAxis}}}); - registry.add("hCosPsi2FT0AmFV0A", ";Centrality;cos(2(#Psi_{2}^{FT0C}-#Psi_{2}^{FV0A}));#it{q}_{2}", {HistType::kTH3F, {{100, 0, 100}, {cosAxis}, {eseAxis}}}); - registry.add("hCosPsi2FV0AmFT0C", ";Centrality;cos(2(#Psi_{2}^{FV0A}-#Psi_{2}^{FT0C}));#it{q}_{2}", {HistType::kTH3F, {{100, 0, 100}, {cosAxis}, {eseAxis}}}); - registry.add("hCosPsi2TPCposmTPCneg", ";Centrality;cos(2(#Psi_{2}^{TPCpos}-#Psi_{2}^{TPCneg}));#it{q}_{2}", {HistType::kTH3F, {{100, 0, 100}, {cosAxis}, {eseAxis}}}); - registry.add("hCosPsi2TPCposmFV0A", ";Centrality;cos(2(#Psi_{2}^{TPCpos}-#Psi_{2}^{FV0A}));#it{q}_{2}", {HistType::kTH3F, {{100, 0, 100}, {cosAxis}, {eseAxis}}}); - registry.add("hCosPsi2TPCnegmFV0A", ";Centrality;cos(2(#Psi_{2}^{TPCneg}-#Psi_{2}^{FV0A}));#it{q}_{2}", {HistType::kTH3F, {{100, 0, 100}, {cosAxis}, {eseAxis}}}); - + registry.addClone("hPsi2FT0C", "hPsi2FT0A"); + registry.addClone("hPsi2FT0C", "hPsi2FV0A"); + registry.addClone("hPsi2FT0C", "hPsi2TPCpos"); + registry.addClone("hPsi2FT0C", "hPsi2TPCneg"); + + registry.add("hCosPsi2AmC", ";Centrality;cos(2(#Psi_{2}^{A}-#Psi_{2}^{B}));#it{q}_{2}", {HistType::kTH3F, {{100, 0, 100}, {cosAxis}, {eseAxis}}}); + registry.addClone("hCosPsi2AmC", "hCosPsi2AmB"); + registry.addClone("hCosPsi2AmC", "hCosPsi2BmC"); + + registry.add("hQvecUncorV2", ";Centrality;Q_x;Q_y", {HistType::kTH3F, {{100, 0, 100}, {qvecAxis}, {qvecAxis}}}); + registry.addClone("hQvecUncorV2", "hQvecRectrV2"); + registry.addClone("hQvecUncorV2", "hQvecTwistV2"); + registry.addClone("hQvecUncorV2", "hQvecFinalV2"); + + registry.addClone("hPsi2FT0C", "hEPUncorV2"); + registry.addClone("hPsi2FT0C", "hEPRectrV2"); + registry.addClone("hPsi2FT0C", "hEPTwistV2"); break; case 1: LOGF(info, "JetSpectraEseTask::init() - using MC"); - registry.add("h_mc_collisions", "event status;event status;entries", {HistType::kTH1F, {{10, 0.0, 10.0}}}); - registry.add("h_part_jet_pt", "particle level jet pT;#it{p}_{T,jet part} (GeV/#it{c});entries", {HistType::kTH1F, {{jetPtAxis}}}); - registry.add("h_part_jet_eta", "particle level jet #eta;#eta_{jet part};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_part_jet_phi", "particle level jet #phi;#phi_{jet part};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); - registry.add("h_part_jet_pt_match", "particle level jet pT;#it{p}_{T,jet part} (GeV/#it{c});entries", {HistType::kTH1F, {{jetPtAxis}}}); - registry.add("h_part_jet_eta_match", "particle level jet #eta;#eta_{jet part};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_part_jet_phi_match", "particle level jet #phi;#phi_{jet part};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); - registry.add("h_detector_jet_pt", "detector level jet pT;#it{p}_{T,jet det} (GeV/#it{c});entries", {HistType::kTH1F, {{jetPtAxis}}}); - registry.add("h_detector_jet_eta", "detector level jet #eta;#eta_{jet det};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); - registry.add("h_detector_jet_phi", "detector level jet #phi;#phi_{jet det};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); - registry.add("h_matched_jets_pt_delta", "#it{p}_{T,jet part}; det - part", {HistType::kTH2F, {{jetPtAxis}, {200, -20., 20.0}}}); - registry.add("h_matched_jets_eta_delta", "#eta_{jet part}; det - part", {HistType::kTH2F, {{100, -1.0, 1.0}, {200, -20.0, 20.0}}}); - registry.add("h_matched_jets_phi_delta", "#phi_{jet part}; det - part", {HistType::kTH2F, {{80, -1.0, 7.}, {200, -20.0, 20.}}}); - registry.add("h_response_mat_match", "#it{p}_{T, jet det}; #it{p}_{T, jet part}", HistType::kTH2F, {jetPtAxis, jetPtAxis}); + registry.add("hMCEventCounter", "event status;event status;entries", {HistType::kTH1F, {{10, 0.0, 10.0}}}); + registry.add("hPartJetPt", "particle level jet pT;#it{p}_{T,jet part} (GeV/#it{c});entries", {HistType::kTH1F, {{jetPtAxis}}}); + registry.add("hPartJetEta", "particle level jet #eta;#eta_{jet part};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); + registry.add("hPartJetPhi", "particle level jet #phi;#phi_{jet part};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("hPartJetPtMatch", "particle level jet pT;#it{p}_{T,jet part} (GeV/#it{c});entries", {HistType::kTH1F, {{jetPtAxis}}}); + registry.add("hPartJetEtaMatch", "particle level jet #eta;#eta_{jet part};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); + registry.add("hPartJetPhiMatch", "particle level jet #phi;#phi_{jet part};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("hDetectorJetPt", "detector level jet pT;#it{p}_{T,jet det} (GeV/#it{c});entries", {HistType::kTH1F, {{jetPtAxis}}}); + registry.add("hDetectorJetEta", "detector level jet #eta;#eta_{jet det};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}); + registry.add("hDetectorJetPhi", "detector level jet #phi;#phi_{jet det};entries", {HistType::kTH1F, {{80, -1.0, 7.}}}); + registry.add("hMatchedJetsPtDelta", "#it{p}_{T,jet part}; det - part", {HistType::kTH2F, {{jetPtAxis}, {200, -20., 20.0}}}); + registry.add("hMatchedJetsEtaDelta", "#eta_{jet part}; det - part", {HistType::kTH2F, {{100, -1.0, 1.0}, {200, -20.0, 20.0}}}); + registry.add("hMatchedJetsPhiDelta", "#phi_{jet part}; det - part", {HistType::kTH2F, {{80, -1.0, 7.}, {200, -20.0, 20.}}}); + registry.add("hResponseMatrixMatch", "#it{p}_{T, jet det}; #it{p}_{T, jet part}", HistType::kTH2F, {jetPtAxis, jetPtAxis}); + break; + case 2: + LOGF(info, "JetSpectraEseTask::init() - using Occupancy processing"); + registry.add("hEventCounterOcc", "event status;event status;entries", {HistType::kTH1F, {{10, 0.0, 10.0}}}); + registry.add("hTrackPt", "track pT;#it{p}_{T,track} (GeV/#it{c});entries", {HistType::kTHnSparseF, {{100, 0, 100}, {100, 0, 100}, {eseAxis}, {occAxis}}}); + registry.add("hTrackEta", "track #eta;#eta_{track};entries", {HistType::kTH3F, {{100, 0, 100}, {100, -1.0, 1.0}, {occAxis}}}); + registry.add("hTrackPhi", "track #phi;#phi_{track};entries", {HistType::kTH3F, {{100, 0, 100}, {80, -1.0, 7.}, {occAxis}}}); + registry.add("hOccupancy", "Occupancy;Occupancy;entries", {HistType::kTH1F, {{occAxis}}}); + registry.add("hPsiOccupancy", "Occupancy;#Psi_{2};entries", {HistType::kTH3F, {{100, 0, 100}, {150, -2.5, 2.5}, {occAxis}}}); break; } } @@ -127,21 +164,16 @@ struct JetSpectraEseTask { Filter colFilter = nabs(aod::jcollision::posZ) < vertexZCut; Filter mcCollisionFilter = nabs(aod::jmccollision::posZ) < vertexZCut; - void processESEDataCharged(soa::Join::iterator const& collision, - soa::Join const&, + void processESEDataCharged(soa::Join::iterator const& collision, soa::Filtered const& jets, aod::JetTracks const& tracks) { float counter{0.5f}; registry.fill(HIST("hEventCounter"), counter++); - const auto originalCollision = collision.collision_as>(); - registry.fill(HIST("hEventCounter"), counter++); - if (originalCollision.centFT0C() < CentRange->at(0) || originalCollision.centFT0C() > CentRange->at(1)) - return; registry.fill(HIST("hEventCounter"), counter++); - const auto vPsi2 = procEP(originalCollision); - const auto qPerc = originalCollision.qPERCFT0C(); + const auto vPsi2 = procEP(collision); + const auto qPerc = collision.qPERCFT0C(); if (qPerc[0] < 0) return; registry.fill(HIST("hEventCounter"), counter++); @@ -154,29 +186,69 @@ struct JetSpectraEseTask { if (!isAcceptedLeadTrack(tracks)) return; + if (cfgEvSelOccupancy) { + auto occupancy = collision.trackOccupancyInTimeRange(); + if (occupancy < cfgCutOccupancy->at(0) || occupancy > cfgCutOccupancy->at(1)) + registry.fill(HIST("hEventCounter"), counter++); + return; + } + registry.fill(HIST("hEventCounter"), counter++); registry.fill(HIST("hRho"), collision.rho()); for (auto const& jet : jets) { - float jetpT_bkgsub = jet.pt() - (collision.rho() * jet.area()); + float jetpTbkgsub = jet.pt() - (collision.rho() * jet.area()); registry.fill(HIST("hJetPt"), jet.pt()); - registry.fill(HIST("hJetPt_bkgsub"), jetpT_bkgsub); + registry.fill(HIST("hJetPt_bkgsub"), jetpTbkgsub); registry.fill(HIST("hJetEta"), jet.eta()); registry.fill(HIST("hJetPhi"), jet.phi()); registry.fill(HIST("hJetArea"), jet.area()); float dPhi = RecoDecay::constrainAngle(jet.phi() - vPsi2, -o2::constants::math::PI); registry.fill(HIST("hdPhi"), dPhi); - registry.fill(HIST("hJetPtdPhiq2"), jetpT_bkgsub, dPhi, qPerc[0]); /* check the dphi */ + registry.fill(HIST("hCentJetPtdPhiq2"), collision.centrality(), jetpTbkgsub, dPhi, qPerc[0]); } registry.fill(HIST("hEventCounter"), counter++); + + if (collision.centrality() < centRange->at(0) || collision.centrality() > centRange->at(1)) /* for counting */ + return; + registry.fill(HIST("hEventCounter"), counter++); } PROCESS_SWITCH(JetSpectraEseTask, processESEDataCharged, "process ese collisions", true); + void processESEOccupancy(soa::Join::iterator const& collision, + soa::Join const& tracks) + { + float count{0.5}; + registry.fill(HIST("hEventCounterOcc"), count++); + const auto vPsi2 = procEP(collision); + const auto qPerc = collision.qPERCFT0C(); + + auto occupancy = collision.trackOccupancyInTimeRange(); + registry.fill(HIST("hPsiOccupancy"), collision.centrality(), vPsi2, occupancy); + registry.fill(HIST("hOccupancy"), occupancy); + + if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) + return; + registry.fill(HIST("hEventCounterOcc"), count++); + + for (auto const& track : tracks) { + if (!jetderiveddatautilities::selectTrack(track, trackSelection)) + continue; + + registry.fill(HIST("hTrackPt"), collision.centrality(), track.pt(), qPerc[0], occupancy); + if (track.pt() < cfgOccupancyPtCut->at(0) || track.pt() > cfgOccupancyPtCut->at(1)) + continue; + registry.fill(HIST("hTrackEta"), collision.centrality(), track.eta(), occupancy); + registry.fill(HIST("hTrackPhi"), collision.centrality(), track.phi(), occupancy); + } + } + PROCESS_SWITCH(JetSpectraEseTask, processESEOccupancy, "process occupancy", false); + void processMCParticleLevel(soa::Filtered::iterator const& jet) { - registry.fill(HIST("h_part_jet_pt"), jet.pt()); - registry.fill(HIST("h_part_jet_eta"), jet.eta()); - registry.fill(HIST("h_part_jet_phi"), jet.phi()); + registry.fill(HIST("hPartJetPt"), jet.pt()); + registry.fill(HIST("hPartJetEta"), jet.eta()); + registry.fill(HIST("hPartJetPhi"), jet.phi()); } PROCESS_SWITCH(JetSpectraEseTask, processMCParticleLevel, "jets on particle level MC", false); @@ -191,26 +263,26 @@ struct JetSpectraEseTask { return; float counter{0.5f}; - registry.fill(HIST("h_mc_collisions"), counter++); + registry.fill(HIST("hMCEventCounter"), counter++); for (const auto& mcdjet : mcdjets) { - registry.fill(HIST("h_detector_jet_pt"), mcdjet.pt()); - registry.fill(HIST("h_detector_jet_eta"), mcdjet.eta()); - registry.fill(HIST("h_detector_jet_phi"), mcdjet.phi()); - for (auto& mcpjet : mcdjet.template matchedJetGeo_as()) { + registry.fill(HIST("hDetectorJetPt"), mcdjet.pt()); + registry.fill(HIST("hDetectorJetEta"), mcdjet.eta()); + registry.fill(HIST("hDetectorJetPhi"), mcdjet.phi()); + for (const auto& mcpjet : mcdjet.template matchedJetGeo_as()) { - registry.fill(HIST("h_part_jet_pt_match"), mcpjet.pt()); - registry.fill(HIST("h_part_jet_eta_match"), mcpjet.eta()); - registry.fill(HIST("h_part_jet_phi_match"), mcpjet.phi()); + registry.fill(HIST("hPartJetPtMatch"), mcpjet.pt()); + registry.fill(HIST("hPartJetEtaMatch"), mcpjet.eta()); + registry.fill(HIST("hPartJetPhiMatch"), mcpjet.phi()); - registry.fill(HIST("h_matched_jets_pt_delta"), mcpjet.pt(), mcdjet.pt() - mcpjet.pt()); - registry.fill(HIST("h_matched_jets_phi_delta"), mcpjet.phi(), mcdjet.phi() - mcpjet.phi()); - registry.fill(HIST("h_matched_jets_eta_delta"), mcpjet.eta(), mcdjet.eta() - mcpjet.eta()); + registry.fill(HIST("hMatchedJetsPtDelta"), mcpjet.pt(), mcdjet.pt() - mcpjet.pt()); + registry.fill(HIST("hMatchedJetsPhiDelta"), mcpjet.phi(), mcdjet.phi() - mcpjet.phi()); + registry.fill(HIST("hMatchedJetsEtaDelta"), mcpjet.eta(), mcdjet.eta() - mcpjet.eta()); - registry.fill(HIST("h_response_mat_match"), mcdjet.pt(), mcpjet.pt()); + registry.fill(HIST("hResponseMatrixMatch"), mcdjet.pt(), mcpjet.pt()); } } - registry.fill(HIST("h_mc_collisions"), counter++); + registry.fill(HIST("hMCEventCounter"), counter++); } PROCESS_SWITCH(JetSpectraEseTask, processMCChargedMatched, "jet matched mcp and mcd", false); @@ -230,49 +302,98 @@ struct JetSpectraEseTask { else return true; } + template + float procEP(EPCol const& vec) + { + constexpr std::array AmpCut{1e-8, 0.0}; + auto computeEP = [&AmpCut](std::vector vec, auto det) { return vec[2] > AmpCut[det] ? 0.5 * std::atan2(vec[1], vec[0]) : 999.; }; + std::map epMap; + epMap["FT0A"] = computeEP(qVecNoESE(vec), 0); + if constexpr (Fill) { + epMap["FT0C"] = computeEP(qVecNoESE(vec), 0); + epMap["FV0A"] = computeEP(qVecNoESE(vec), 0); + epMap["TPCpos"] = computeEP(qVecNoESE(vec), 1); + epMap["TPCneg"] = computeEP(qVecNoESE(vec), 1); + fillEP(/*std::make_index_sequence<5>{},*/ vec, epMap); + auto cosPsi = [](float psiX, float psiY) { return (static_cast(psiX) == 999. || static_cast(psiY) == 999.) ? 999. : std::cos(2.0 * (psiX - psiY)); }; + std::array epCorrContainer{}; + epCorrContainer[0] = cosPsi(epMap[cfgEPRefA], epMap[cfgEPRefC]); + epCorrContainer[1] = cosPsi(epMap[cfgEPRefA], epMap[cfgEPRefB]); + epCorrContainer[2] = cosPsi(epMap[cfgEPRefB], epMap[cfgEPRefC]); + fillEPCos(/*std::make_index_sequence<3>{},*/ vec, epCorrContainer); + } + return epMap["FT0A"]; + } + template + void fillEPCos(/*const std::index_sequence&,*/ const collision& col, const std::array& Corr) + { + // static constexpr std::string CosList[] = {"hCosPsi2AmC", "hCosPsi2AmB", "hCosPsi2BmC"}; + // (registry.fill(HIST(CosList[Idx]), col.centrality(), Corr[Idx], col.qPERCFT0C()[0]), ...); + registry.fill(HIST("hCosPsi2AmC"), col.centrality(), Corr[0], col.qPERCFT0C()[0]); + registry.fill(HIST("hCosPsi2AmB"), col.centrality(), Corr[1], col.qPERCFT0C()[0]); + registry.fill(HIST("hCosPsi2BmC"), col.centrality(), Corr[2], col.qPERCFT0C()[0]); + } - template - float procEP(qVectors const& vec) + template + void fillEP(/*const std::index_sequence&,*/ const collision& col, const std::map& epMap) + { + // static constexpr std::string_view EpList[] = {"hPsi2FT0A", "hPsi2FV0A", "hPsi2FT0C", "hPsi2TPCpos", "hPsi2TPCneg"}; + // (registry.fill(HIST(EpList[Idx]), col.centrality(), epMap.at(std::string(RemovePrefix(EpList[Idx])))), ...); + registry.fill(HIST("hPsi2FT0A"), col.centrality(), epMap.at("FT0A")); + registry.fill(HIST("hPsi2FV0A"), col.centrality(), epMap.at("FV0A")); + registry.fill(HIST("hPsi2FT0C"), col.centrality(), epMap.at("FT0C")); + registry.fill(HIST("hPsi2TPCpos"), col.centrality(), epMap.at("TPCpos")); + registry.fill(HIST("hPsi2TPCneg"), col.centrality(), epMap.at("TPCneg")); + } + constexpr std::string_view RemovePrefix(std::string_view str) { - const auto epFT0A = 1 / 2.0 * TMath::ATan2(vec.qvecFT0AImVec()[0], vec.qvecFT0AReVec()[0]); - const auto epFV0A = 1 / 2.0 * std::atan2(vec.qvecFV0AImVec()[0], vec.qvecFV0AReVec()[0]); - const auto epFT0C = 1 / 2.0 * std::atan2(vec.qvecFT0CImVec()[0], vec.qvecFT0CReVec()[0]); - const auto epTPCpos = 1 / 2.0 * std::atan2(vec.qvecTPCposImVec()[0], vec.qvecTPCposReVec()[0]); - const auto epTPCneg = 1 / 2.0 * std::atan2(vec.qvecTPCnegImVec()[0], vec.qvecTPCnegReVec()[0]); - - registry.fill(HIST("hPsi2FT0C"), vec.centFT0C(), epFT0C); - registry.fill(HIST("hPsi2FT0A"), vec.centFT0C(), epFT0A); - registry.fill(HIST("hPsi2FV0A"), vec.centFT0C(), epFV0A); - registry.fill(HIST("hPsi2TPCpos"), vec.centFT0C(), epTPCpos); - registry.fill(HIST("hPsi2TPCneg"), vec.centFT0C(), epTPCneg); - - const auto cosPsi2FT0CmFT0A = cosPsiXY(epFT0C, epFT0A); - const auto cosPsi2FT0CmFV0A = cosPsiXY(epFT0C, epFV0A); - const auto cosPsi2FV0AmFT0A = cosPsiXY(epFV0A, epFT0A); - const auto cosPsi2FT0AmFT0C = cosPsiXY(epFT0A, epFT0C); - const auto cosPsi2FT0AmFV0A = cosPsiXY(epFT0A, epFV0A); - const auto cosPsi2FV0AmFT0C = cosPsiXY(epFV0A, epFT0C); - const auto cosPsi2TPCposmTPCneg = cosPsiXY(epTPCpos, epTPCneg); - const auto cosPsi2TPCposmFV0A = cosPsiXY(epTPCpos, epFV0A); - const auto cosPsi2TPCnegmFV0A = cosPsiXY(epTPCneg, epFV0A); - - registry.fill(HIST("hCosPsi2FT0CmFT0A"), vec.centFT0C(), cosPsi2FT0CmFT0A, vec.qPERCFT0C()[0]); - registry.fill(HIST("hCosPsi2FT0CmFV0A"), vec.centFT0C(), cosPsi2FT0CmFV0A, vec.qPERCFT0C()[0]); - registry.fill(HIST("hCosPsi2FV0AmFT0A"), vec.centFT0C(), cosPsi2FV0AmFT0A, vec.qPERCFT0C()[0]); - registry.fill(HIST("hCosPsi2FT0AmFT0C"), vec.centFT0C(), cosPsi2FT0AmFT0C, vec.qPERCFT0C()[0]); - registry.fill(HIST("hCosPsi2FT0AmFV0A"), vec.centFT0C(), cosPsi2FT0AmFV0A, vec.qPERCFT0C()[0]); - registry.fill(HIST("hCosPsi2FV0AmFT0C"), vec.centFT0C(), cosPsi2FV0AmFT0C, vec.qPERCFT0C()[0]); - registry.fill(HIST("hCosPsi2TPCposmTPCneg"), vec.centFT0C(), cosPsi2TPCposmTPCneg, vec.qPERCFT0C()[0]); - registry.fill(HIST("hCosPsi2TPCposmFV0A"), vec.centFT0C(), cosPsi2TPCposmFV0A, vec.qPERCFT0C()[0]); - registry.fill(HIST("hCosPsi2TPCnegmFV0A"), vec.centFT0C(), cosPsi2TPCnegmFV0A, vec.qPERCFT0C()[0]); - - return epFT0A; + constexpr std::string_view Prefix = "hPsi2"; + return str.substr(Prefix.size()); } - template - float cosPsiXY(Psi const& psiX, Psi const& psiY) + constexpr int detIDN(const DetID id) { - return std::cos(2.0 * (psiX - psiY)); + switch (id) { + case DetID::FT0C: + return 0; + case DetID::FT0A: + return 1; + case DetID::FT0M: + return 2; + case DetID::FV0A: + return 3; + case DetID::TPCpos: + return 4; + case DetID::TPCneg: + return 5; + case DetID::TPCall: + return 6; + } + return -1; + } + + template + std::vector qVecNoESE(Col collision) + { + const int nmode = 2; + int detId = detIDN(id); + int detInd = detId * 4 + cfgnTotalSystem * 4 * (nmode - 2); + if constexpr (fill) { + if (collision.qvecAmp()[detInd] > 1e-8) { + registry.fill(HIST("hQvecUncorV2"), collision.centrality(), collision.qvecRe()[detInd], collision.qvecIm()[detInd]); + registry.fill(HIST("hQvecRectrV2"), collision.centrality(), collision.qvecRe()[detInd + 1], collision.qvecIm()[detInd + 1]); + registry.fill(HIST("hQvecTwistV2"), collision.centrality(), collision.qvecRe()[detInd + 2], collision.qvecIm()[detInd + 2]); + registry.fill(HIST("hQvecFinalV2"), collision.centrality(), collision.qvecRe()[detInd + 3], collision.qvecIm()[detInd + 3]); + registry.fill(HIST("hEPUncorV2"), collision.centrality(), 0.5 * std::atan2(collision.qvecIm()[detInd], collision.qvecRe()[detInd])); + registry.fill(HIST("hEPRectrV2"), collision.centrality(), 0.5 * std::atan2(collision.qvecIm()[detInd + 1], collision.qvecRe()[detInd + 1])); + registry.fill(HIST("hEPTwistV2"), collision.centrality(), 0.5 * std::atan2(collision.qvecIm()[detInd + 2], collision.qvecRe()[detInd + 2])); + } + } + std::vector qVec{}; + qVec.push_back(collision.qvecRe()[detInd + cfgnCorrLevel]); + qVec.push_back(collision.qvecIm()[detInd + cfgnCorrLevel]); + qVec.push_back(collision.qvecAmp()[detId]); + return qVec; } }; From b4a11bf855416e1be1251ccdd4fb94869c0402fc Mon Sep 17 00:00:00 2001 From: Peter Stratmann <80676312+pestratm@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:01:39 +0100 Subject: [PATCH 418/459] [PWGJE] Add hadron-photon correlation analysis task (#8727) --- PWGJE/Tasks/CMakeLists.txt | 4 + PWGJE/Tasks/hadronPhotonCorrelation.cxx | 803 ++++++++++++++++++++++++ 2 files changed, 807 insertions(+) create mode 100644 PWGJE/Tasks/hadronPhotonCorrelation.cxx diff --git a/PWGJE/Tasks/CMakeLists.txt b/PWGJE/Tasks/CMakeLists.txt index 14d5a0dfdfe..e5f4c42f1d3 100644 --- a/PWGJE/Tasks/CMakeLists.txt +++ b/PWGJE/Tasks/CMakeLists.txt @@ -34,6 +34,10 @@ o2physics_add_dpl_workflow(emc-tmmonitor SOURCES emcTmMonitor.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(hadron-photon-correlation + SOURCES hadronPhotonCorrelation.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(mc-generator-studies SOURCES mcGeneratorStudies.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore diff --git a/PWGJE/Tasks/hadronPhotonCorrelation.cxx b/PWGJE/Tasks/hadronPhotonCorrelation.cxx new file mode 100644 index 00000000000..c7198bf8414 --- /dev/null +++ b/PWGJE/Tasks/hadronPhotonCorrelation.cxx @@ -0,0 +1,803 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// +/// \file hadronPhotonCorrelation.cxx +/// \author Peter Stratmann +/// \brief This code loops over JetTracks to extract pt and angular information +/// for hadrons and photons to compute angular correlations +/// + +#include +#include + +#include "Framework/ASoA.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/Expressions.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" +#include "Framework/HistogramSpec.h" +#include "Framework/Configurable.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/Core/trackUtilities.h" +#include "CommonConstants/PhysicsConstants.h" +#include "CommonConstants/MathConstants.h" + +#include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/Core/JetUtilities.h" + +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; +using namespace o2::constants::physics; +using namespace o2::constants::math; + +struct HadronPhotonCorrelation { + + Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; + Configurable trackSelections{"trackSelections", "globalTracks", "set track selections"}; + + Configurable etaMax{"etaMax", 0.8, "maximum eta cut"}; + + AxisSpec axisPhi = {72, 0., TwoPI, "#phi"}; // Axis for phi distribution + AxisSpec axisDeltaPhi = {72, -PIHalf, 3 * PIHalf, "#Delta #phi"}; // Axis for Delta phi in correlations + AxisSpec axisDeltaPhiDecay = {100, -.5, .5, "#Delta #phi"}; // Axis for Delta phi between neutral hadrons and decay photons + AxisSpec axisEta = {40, -.8, .8, "#eta"}; // Axis for eta distribution + AxisSpec axisDeltaEta = {80, -1.6, 1.6, "#Delta #eta"}; // Axis for Delta eta in correlations + AxisSpec axisDeltaEtaDecay = {100, -.6, .6, "#Delta #eta"}; // Axis for Delta eta between neutral hadrons and decay photons + ConfigurableAxis axisPtTrig = {"axisPtTrig", + {VARIABLE_WIDTH, + 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 9.0f, 11.0f, 15.0f, 20.0f}, + "p_{T, trig} [GeV]"}; // Axis for trigger particle pt distribution + ConfigurableAxis axisPtAssoc = {"axisPtAssoc", + {VARIABLE_WIDTH, + 0.2, 0.5, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 9.0f, 11.0f, 15.0f}, + "p_{T, assoc} [GeV]"}; // Axis for associated particle pt distribution + AxisSpec axisDeltaPt = {200, 0., 1.2, "#Delta p_T"}; // Axis for pt ratio between neutral hadrons and decay photons + AxisSpec axisPid = {7, -1.5, 5.5, "pid"}; // Axis for PID of neutral hadrons + AxisSpec axisMult = {100, 0., 99., "N_{ch}"}; // Axis for mutplipicity + + float ptMinTrig; + float ptMaxTrig; + float ptMinAssoc; + float ptMaxAssoc; + + HistogramRegistry registry{"histogram registry"}; + + // Particle ids for storing neutral hadrons + std::map pidCodes = { + {2212, -1}, + {1, -1}, + {2, -1}, + {3, -1}, + {4, -1}, + {5, -1}, + {6, -1}, + {21, -1}, // Protons, quarks, gluons (direct) + {111, 1}, // pi0 + {221, 2}, // eta + {223, 3}, // eta' + {331, 4}, // phi + {333, 5}}; // omega + + Service pdg; + + // Calculate difference between two azimuthal angles, projecting into range [lowerPhi, lowerPhi + pi/2] + float calculateDelta(float phi1, float phi2, float lowerPhi) + { + float dphi = fmod((phi1 - phi2) + 3 * PI, TwoPI) - PI; + dphi = RecoDecay::constrainAngle(dphi, lowerPhi); + return dphi; + } + + int eventSelection = -1; + int trackSelection = -1; + + void init(o2::framework::InitContext&) + { + ptMinTrig = axisPtTrig->at(1); + ptMaxTrig = axisPtTrig->back(); + ptMinAssoc = axisPtAssoc->at(1); + ptMaxAssoc = axisPtAssoc->back(); + + eventSelection = jetderiveddatautilities::initialiseEventSelection(static_cast(eventSelections)); + trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast(trackSelections)); + + // Generated histograms + // Triggers + registry.add("generated/triggers/hTrigMultGen", "Generated Trigger Multiplicity", kTH1F, {axisMult}); + registry.add("generated/triggers/hTrigSpectrumGen", "Generated Trigger Spectrum", kTHnSparseF, {axisPtTrig, axisEta, axisPhi}); + + // Hadrons + registry.add("generated/hadrons/hHadronCorrelGen", "Generated Trigger-Hadron Correlation", kTHnSparseF, {axisPtTrig, axisPtAssoc, axisDeltaEta, axisDeltaPhi}); + registry.add("generated/hadrons/hHadronMultGen", "Generated Hadron Multiplicity", kTH1F, {axisMult}); + registry.add("generated/hadrons/hHadronSpectrumGen", "Generated Hadron Spectrum", kTHnSparseF, {axisPtAssoc, axisEta, axisPhi}); + + // Photons + registry.add("generated/photons/hPhotonCorrelGen", "Generated Trigger-Photon Correlation", kTHnSparseF, {axisPtTrig, axisPtAssoc, axisDeltaEta, axisDeltaPhi, axisPid}); + registry.add("generated/photons/hPhotonMultGen", "Generated Photon Multiplicity", kTH1F, {axisMult}); + registry.add("generated/photons/hPhotonSpectrumGen", "Generated Photon Spectrum", kTHnSparseF, {axisPtAssoc, axisEta, axisPhi, axisPid}); + + // Charged pions + registry.add("generated/charged/hPionCorrelGen", "Generated Trigger-Pion Correlation", kTHnSparseF, {axisPtTrig, axisPtAssoc, axisDeltaEta, axisDeltaPhi}); + registry.add("generated/charged/hPionMultGen", "Generated Pion Multiplicity", kTH1F, {axisMult}); + registry.add("generated/charged/hPionSpectrumGen", "Generated Pion Spectrum", kTHnSparseF, {axisPtAssoc, axisEta, axisPhi}); + + ////Neutral particles + registry.add("generated/neutral/hNeutralCorrelGen", "Generated Trigger-Neutral Hadron Correlation", kTHnSparseF, {axisPtTrig, axisPtAssoc, axisDeltaEta, axisDeltaPhi, axisPid}); + registry.add("generated/neutral/hNeutralMultGen", "Generated Neutral Hadron Multiplicity", kTH1F, {axisMult}); + registry.add("generated/neutral/hNeutralSpectrumGen", "Generated Neutral Hadron Spectrum", kTHnSparseF, {axisPtAssoc, axisEta, axisPhi, axisPid}); // Particle ID of neutral hadrons + registry.add("generated/neutral/hNeutralDecayGen", "Generated Neutral Hadron-Decay Photon Correlation", kTHnSparseF, {axisPtAssoc, axisDeltaPt, axisDeltaEtaDecay, axisDeltaPhiDecay, axisPid}); // Correlation with decay photons + + // Reconstructed histograms + // Triggers + registry.add("reconstructed/triggers/hTrigMultReco", "Reconstructed Trigger Multiplicity", kTH1F, {axisMult}); + registry.add("reconstructed/triggers/hTrigSpectrumReco", "Reconstructed Trigger Spectrum", kTHnSparseF, {axisPtTrig, axisEta, axisPhi}); + + // Hadrons + registry.add("reconstructed/hadrons/hHadronCorrelReco", "Reconstructed Trigger-Hadron Correlation", kTHnSparseF, {axisPtTrig, axisPtAssoc, axisDeltaEta, axisDeltaPhi}); + registry.add("reconstructed/hadrons/hHadronMultReco", "Reconstructed Hadron Multiplicity", kTH1F, {axisMult}); + registry.add("reconstructed/hadrons/hHadronSpectrumReco", "Reconstructed Hadron Spectrum", kTHnSparseF, {axisPtAssoc, axisEta, axisPhi}); + registry.add("reconstructed/hadrons/hHadronPtPrimReco", "Reconstructed Primaries Spectrum", kTH1F, {axisPtAssoc}); // Primary hadron spectrum + registry.add("reconstructed/hadrons/hHadronPtSecReco", "Reconstructed Secondaries Spectrum", kTH1F, {axisPtAssoc}); // Secondary hadron spectrum + + // Photons + registry.add("reconstructed/photons/hPhotonCorrelReco", "Reconstructed Trigger-Photon Correlation", kTHnSparseF, {axisPtTrig, axisPtAssoc, axisDeltaEta, axisDeltaPhi}); + registry.add("reconstructed/photons/hPhotonMultReco", "Reconstructed Photon Multiplicity", kTH1F, {axisMult}); + registry.add("reconstructed/photons/hPhotonSpectrumReco", "Reconstructed Photon Spectrum", kTHnSparseF, {axisPtAssoc, axisEta, axisPhi}); + + // Charged Pions + registry.add("reconstructed/charged/hPionCorrelReco", "Reconstructed Trigger-Pion Correlation", kTHnSparseF, {axisPtTrig, axisPtAssoc, axisDeltaEta, axisDeltaPhi}); + registry.add("reconstructed/charged/hPionMultReco", "Reconstructed Pion Multiplicity", kTH1F, {axisMult}); + registry.add("reconstructed/charged/hPionSpectrumReco", "Reconstructed Pion Spectrum", kTHnSparseF, {axisPtAssoc, axisEta, axisPhi}); + } + + // To check if object has has_mcParticle() (i.e. is MC Track or data track) + template + struct HasHasMcParticle { + template + static auto test(U* ptr) -> decltype(ptr->has_mcParticle(), std::true_type{}); + static std::false_type test(...); + static constexpr bool Value = decltype(test(std::declval()))::value; + }; + + // Initialize track + template + bool initTrack(const T& track) + { + + if constexpr (HasHasMcParticle::Value) { + if (!track.has_mcParticle()) { + return false; + } + } + + if (std::abs(track.eta()) > etaMax) { + return false; + } + + if (track.pt() < ptMinAssoc || track.pt() > ptMaxAssoc) { + return false; + } + + return true; + } + + // Initialize particle + template + bool initParticle(const T& particle, bool checkIsPrimary = true) + { + + if (checkIsPrimary && !particle.isPhysicalPrimary()) { + return false; + } + + if (std::abs(particle.eta()) > etaMax) { + return false; + } + + if (particle.pt() < ptMinAssoc || particle.pt() > ptMaxAssoc) { + return false; + } + + return true; + } + + // Initialize trigger tracks + template + bool initTrig(const T& track) + { + if constexpr (HasHasMcParticle::Value) { + if (!track.has_mcParticle()) { + return false; + } + } + + if (std::abs(track.eta()) > etaMax) { + return false; + } + + if (track.pt() < ptMinTrig || track.pt() > ptMaxTrig) { + return false; + } + + return true; + } + + // Initialize trigger particles (charged) + template + bool initTrigParticle(const T& particle) + { + if (!particle.isPhysicalPrimary()) { + return false; + } + + auto pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (!pdgParticle || pdgParticle->Charge() == 0.) { + return false; + } + + if (std::abs(particle.eta()) > etaMax) { + return false; + } + + if (particle.pt() < ptMinTrig || particle.pt() > ptMaxTrig) { + return false; + } + + return true; + } + + // Initialize V0s + template + bool initV0(TV0 const& v0) + { + auto pos = v0.template posTrack_as(); + auto neg = v0.template negTrack_as(); + if (!initV0leg(pos) || !initV0leg(neg)) { + return false; + } + + return true; + } + + template + bool initV0leg(TTrack const& track) + { + if (!initTrack(track)) { + return false; + } + + if (!track.hasTPC()) { + return false; + } + + if (track.tpcNClsCrossedRows() < 70) { + return false; + } + + if (track.tpcCrossedRowsOverFindableCls() < 0.8) { + return false; + } + + return true; + } + + /**************************************************************************************************** + ************************************************ TRIGGER ******************************************** + ****************************************************************************************************/ + + /********************************************** DATA ***********************************************/ + + void processTrigsReco(JCollision const& collision, + JTracks const& tracks) + { + if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { + return; + } + + int nTrigs = 0; + for (const auto& track : tracks) { + if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { + continue; + } + + if (!initTrig(track)) { + continue; + } + registry.fill(HIST("reconstructed/triggers/hTrigSpectrumReco"), track.pt(), track.eta(), track.phi()); + nTrigs++; + } + registry.fill(HIST("reconstructed/triggers/hTrigMultReco"), nTrigs); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processTrigsReco, "trigger particle properties", true); + + /*********************************************** MC ************************************************/ + + void processTrigsMCReco(JCollision const& collision, + Join const& tracks, + JMcParticles const&) + { + if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { + return; + } + + int nTrigs = 0; + for (const auto& track : tracks) { + if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { + continue; + } + + if (!initTrig(track)) { + continue; + } + registry.fill(HIST("reconstructed/triggers/hTrigSpectrumReco"), track.pt(), track.eta(), track.phi()); + nTrigs++; + } + registry.fill(HIST("reconstructed/triggers/hTrigMultReco"), nTrigs); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processTrigsMCReco, "trigger particle mc properties", true); + + void processTrigsMCGen(JMcCollision const&, + JMcParticles const& particles) + { + + int nTrigs = 0; + for (const auto& particle : particles) { + if (!initTrigParticle(particle)) { + continue; + } + registry.fill(HIST("generated/triggers/hTrigSpectrumGen"), particle.pt(), particle.eta(), particle.phi()); + nTrigs++; + } + registry.fill(HIST("generated/triggers/hTrigMultGen"), nTrigs); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processTrigsMCGen, "trigger particle mc properties", true); + + /**************************************************************************************************** + ********************************************** PHOTONS ********************************************** + ****************************************************************************************************/ + + /********************************************** DATA ***********************************************/ + using MyTracks = soa::Join; + Preslice perCol = aod::v0::collisionId; + void processPhotonCorrelations(JCollision const& collision, + JTracks const& tracks, + MyTracks const&, + V0Datas const& v0s) + { + if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { + return; + } + + int nPhotons = 0; + auto v0PerCollision = v0s.sliceBy(perCol, collision.globalIndex()); + for (const auto& v0 : v0PerCollision) { + if (!initV0(v0)) { + continue; + } + registry.fill(HIST("reconstructed/photons/hPhotonSpectrumReco"), v0.pt(), v0.eta(), v0.phi()); + nPhotons++; + + for (const auto& track : tracks) { + if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { + continue; + } + + if (!initTrig(track)) { + continue; + } + float dphi = calculateDelta(track.phi(), v0.phi(), -PIHalf); + registry.fill(HIST("reconstructed/photons/hPhotonCorrelReco"), track.pt(), v0.pt(), track.eta() - v0.eta(), dphi); + } + } + registry.fill(HIST("reconstructed/photons/hPhotonMultReco"), nPhotons); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processPhotonCorrelations, "hadron-photon correlation", true); + + /*********************************************** MC ************************************************/ + + using MyTracksMC = soa::Join; + void processPhotonCorrelationsMCReco(Join::iterator const& collision_reco, + JMcCollisions const&, + JTracks const& tracks_reco, + JMcParticles const&, + MyTracksMC const&, + V0Datas const& v0s) + { + if (!jetderiveddatautilities::selectCollision(collision_reco, eventSelection)) { + return; + } + + int nPhotons = 0; + + auto v0PerCollision = v0s.sliceBy(perCol, collision_reco.globalIndex()); + for (const auto& v0 : v0PerCollision) { + if (!initV0(v0)) { + continue; + } + registry.fill(HIST("reconstructed/photons/hPhotonSpectrumReco"), v0.pt(), v0.eta(), v0.phi()); + nPhotons++; + + for (const auto& track : tracks_reco) { + if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { + continue; + } + + if (!initTrig(track)) { + continue; + } + float dphi = calculateDelta(track.phi(), v0.phi(), -PIHalf); + registry.fill(HIST("reconstructed/photons/hPhotonCorrelReco"), track.pt(), v0.pt(), track.eta() - v0.eta(), dphi); + } + } + registry.fill(HIST("reconstructed/photons/hPhotonMultReco"), nPhotons); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processPhotonCorrelationsMCReco, "hadron-photon correlation", true); + + void processPhotonCorrelationsMCGen(JMcCollision const&, + JMcParticles const& tracks_true) + { + int nPhotons = 0; + for (const auto& track_assoc : tracks_true) { + if (!initParticle(track_assoc, false)) { + continue; + } + if (std::abs(track_assoc.pdgCode()) != 22) { + continue; + } + if (!track_assoc.isPhysicalPrimary() && track_assoc.getGenStatusCode() == -1) { + continue; + } + + // Iterate through mother particles until original mother is reached + auto mother = track_assoc.mothers_as().at(0); + while (mother.pdgCode() == 22) { + mother = mother.mothers_as().at(0); + } + + registry.fill(HIST("generated/photons/hPhotonSpectrumGen"), track_assoc.pt(), track_assoc.eta(), track_assoc.phi(), pidCodes[mother.pdgCode()]); + + nPhotons++; + + for (const auto& track_trig : tracks_true) { + if (!initTrigParticle(track_trig)) { + continue; + } + if (!initParticle(track_assoc)) { + continue; + } + float dphi = calculateDelta(track_trig.phi(), track_assoc.phi(), -PIHalf); + registry.fill(HIST("generated/photons/hPhotonCorrelGen"), track_trig.pt(), track_assoc.pt(), track_trig.eta() - track_assoc.eta(), dphi, pidCodes[mother.pdgCode()]); + } + } + + registry.fill(HIST("generated/photons/hPhotonMultGen"), nPhotons); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processPhotonCorrelationsMCGen, "mc hadron-photon correlation", true); + + /**************************************************************************************************** + ***************************************** HADRONS *************************************************** + ****************************************************************************************************/ + + /********************************************** DATA ***********************************************/ + void processHadronCorrelations(JCollision const& collision, + Join const& tracks) + { + if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { + return; + } + + int nHadrons = 0; + for (const auto& track_assoc : tracks) { + if (!jetderiveddatautilities::selectTrack(track_assoc, trackSelection)) { + continue; + } + + if (!initTrack(track_assoc)) { + continue; + } + registry.fill(HIST("reconstructed/hadrons/hHadronSpectrumReco"), track_assoc.pt(), track_assoc.eta(), track_assoc.phi()); + nHadrons++; + + for (const auto& track_trig : tracks) { + if (!jetderiveddatautilities::selectTrack(track_trig, trackSelection)) { + continue; + } + + if (!initTrig(track_trig)) { + continue; + } + float dphi = calculateDelta(track_trig.phi(), track_assoc.phi(), -PIHalf); + registry.fill(HIST("reconstructed/hadrons/hadrons/hHadronCorrelReco"), track_trig.pt(), track_assoc.pt(), track_trig.eta() - track_assoc.eta(), dphi); + } + } + registry.fill(HIST("reconstructed/hadrons/hHadronMultReco"), nHadrons); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processHadronCorrelations, "hadron-hadron correlation", true); + + /*********************************************** MC ************************************************/ + + void processHadronCorrelationsMCGen(JMcCollision const&, + JMcParticles const& tracks_true) + { + int nHadrons = 0; + for (const auto& track_assoc : tracks_true) { + if (!initParticle(track_assoc)) { + continue; + } + auto pdgParticle = pdg->GetParticle(track_assoc.pdgCode()); + if (!pdgParticle || pdgParticle->Charge() == 0.) { + continue; + } + if (std::abs(track_assoc.pdgCode()) < 100) { + continue; + } + + registry.fill(HIST("generated/hadrons/hHadronSpectrumGen"), track_assoc.pt(), track_assoc.eta(), track_assoc.phi()); + nHadrons++; + + for (const auto& track_trig : tracks_true) { + if (!initTrigParticle(track_trig)) { + continue; + } + float dphi = calculateDelta(track_trig.phi(), track_assoc.phi(), -PIHalf); + + registry.fill(HIST("generated/hadrons/hHadronCorrelGen"), track_trig.pt(), track_assoc.pt(), track_trig.eta() - track_assoc.eta(), dphi); + } + } + registry.fill(HIST("generated/hadrons/hHadronMultGen"), nHadrons); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processHadronCorrelationsMCGen, "mc hadron-hadron correlation", true); + + void processHadronCorrelationsMCReco(Join::iterator const& collision_reco, + JMcCollisions const&, + Join const& tracks_reco, + JMcParticles const&) + { + if (!jetderiveddatautilities::selectCollision(collision_reco, eventSelection)) { + return; + } + + int nHadrons = 0; + for (const auto& track_assoc : tracks_reco) { + if (!jetderiveddatautilities::selectTrack(track_assoc, trackSelection)) { + continue; + } + + if (!initTrack(track_assoc)) { + continue; + } + auto particle = track_assoc.mcParticle(); + auto pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (!pdgParticle || pdgParticle->Charge() == 0.) { + continue; + } + if (std::abs(particle.pdgCode()) < 100) { + continue; + } + // if(particle.isPhysicalPrimary()){continue;} + // if(std::abs(particle.pdgCode())>1e9){continue;} + + registry.fill(HIST("reconstructed/hadrons/hHadronSpectrumReco"), track_assoc.pt(), track_assoc.eta(), track_assoc.phi()); + + if (particle.isPhysicalPrimary()) { + registry.fill(HIST("reconstructed/hadrons/hHadronPtPrimReco"), track_assoc.pt()); + } else { + registry.fill(HIST("reconstructed/hadrons/hHadronPtSecReco"), track_assoc.pt()); + } + nHadrons++; + + for (const auto& track_trig : tracks_reco) { + if (!jetderiveddatautilities::selectTrack(track_trig, trackSelection)) { + continue; + } + + if (!initTrig(track_trig)) { + continue; + } + float dphi = calculateDelta(track_trig.phi(), track_assoc.phi(), -PIHalf); + + registry.fill(HIST("reconstructed/hadrons/hHadronCorrelReco"), track_trig.pt(), track_assoc.pt(), track_trig.eta() - track_assoc.eta(), dphi); + } + } + registry.fill(HIST("reconstructed/hadrons/hHadronMultReco"), nHadrons); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processHadronCorrelationsMCReco, "mc hadron-hadron correlation", true); + + /**************************************************************************************************** + *************************************** CHARGED PIONS *********************************************** + ****************************************************************************************************/ + + /********************************************** DATA ***********************************************/ + void processPionCorrelations(JCollision const& collision, + Join const& tracks) + { + if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) { + return; + } + + int nPions = 0; + for (const auto& track_assoc : tracks) { + if (!jetderiveddatautilities::selectTrack(track_assoc, trackSelection)) { + continue; + } + + if (!initTrack(track_assoc)) { + continue; + } + if (std::abs(track_assoc.tpcNSigmaPi()) > 2) { + continue; + } // remove non-pions + registry.fill(HIST("reconstructed/charged/hPionSpectrumReco"), track_assoc.pt(), track_assoc.eta(), track_assoc.phi()); + nPions++; + + for (const auto& track_trig : tracks) { + if (!jetderiveddatautilities::selectTrack(track_trig, trackSelection)) { + continue; + } + + if (!initTrig(track_trig)) { + continue; + } + float dphi = calculateDelta(track_trig.phi(), track_assoc.phi(), -PIHalf); + registry.fill(HIST("reconstructed/charged/hPionCorrelReco"), track_trig.pt(), track_assoc.pt(), track_trig.eta() - track_assoc.eta(), dphi); + } + } + registry.fill(HIST("reconstructed/charged/hPionMultReco"), nPions); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processPionCorrelations, "hadron-pion correlation", true); + + /*********************************************** MC ************************************************/ + + void processPionCorrelationsMCGen(JMcCollision const&, + JMcParticles const& tracks_true) + { + int nPions = 0; + for (const auto& track_assoc : tracks_true) { + if (!initParticle(track_assoc)) { + continue; + } + if (std::abs(track_assoc.pdgCode()) != 211) { + continue; + } + + registry.fill(HIST("generated/charged/hPionSpectrumGen"), track_assoc.pt(), track_assoc.eta(), track_assoc.phi()); + nPions++; + + for (const auto& track_trig : tracks_true) { + if (!initTrigParticle(track_trig)) { + continue; + } + float dphi = calculateDelta(track_trig.phi(), track_assoc.phi(), -PIHalf); + + registry.fill(HIST("generated/charged/hPionCorrelGen"), track_trig.pt(), track_assoc.pt(), track_trig.eta() - track_assoc.eta(), dphi); + } + } + registry.fill(HIST("generated/charged/hPionMultGen"), nPions); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processPionCorrelationsMCGen, "mc hadron-pion correlation", true); + + void processPionCorrelationsMCReco(Join::iterator const& collision_reco, + JMcCollisions const&, + Join const& tracks_reco, + JMcParticles const&) + { + if (!jetderiveddatautilities::selectCollision(collision_reco, eventSelection)) { + return; + } + + int nPions = 0; + for (const auto& track_assoc : tracks_reco) { + if (!jetderiveddatautilities::selectTrack(track_assoc, trackSelection)) { + continue; + } + + if (!initTrack(track_assoc)) { + continue; + } + if (std::abs(track_assoc.mcParticle().pdgCode()) != 211) { + continue; + } + + registry.fill(HIST("reconstructed/charged/hPionSpectrumReco"), track_assoc.pt(), track_assoc.eta(), track_assoc.phi()); + nPions++; + + for (const auto& track_trig : tracks_reco) { + if (!jetderiveddatautilities::selectTrack(track_trig, trackSelection)) { + continue; + } + + if (!initTrig(track_trig)) { + continue; + } + float dphi = calculateDelta(track_trig.phi(), track_assoc.phi(), -PIHalf); + registry.fill(HIST("reconstructed/charged/hPionCorrelReco"), track_trig.pt(), track_assoc.pt(), track_trig.eta() - track_assoc.eta(), dphi); + } + } + registry.fill(HIST("reconstructed/charged/hPionMultReco"), nPions); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processPionCorrelationsMCReco, "mc hadron-pion correlation", true); + + /**************************************************************************************************** + ****************************************** NEUTRALS ************************************************* + ****************************************************************************************************/ + + /*********************************************** MC ************************************************/ + + void processNeutralCorrelationsMCGen(JMcCollision const&, + JMcParticles const& tracks_true) + { + int nNeutrals = 0; + for (const auto& track_assoc : tracks_true) { + if (!initParticle(track_assoc, false)) { + continue; + } + auto pdgParticle = pdg->GetParticle(track_assoc.pdgCode()); + if (!pdgParticle) { + continue; + } // remove unknown particles + if (pdgParticle->Charge() != 0.) { + continue; + } // remove charged particles + if (track_assoc.pdgCode() < 100 || track_assoc.pdgCode() == 2112) { + continue; + } // remove non-hadrons and protons + + registry.fill(HIST("generated/neutral/hNeutralSpectrumGen"), track_assoc.pt(), track_assoc.eta(), track_assoc.phi(), pidCodes[track_assoc.pdgCode()]); + nNeutrals++; + + // Get correlations between neutral hadrons and their respective decay photons + for (const auto& daughter : track_assoc.daughters_as()) { + if (daughter.pdgCode() != 22) + continue; + if (!initParticle(daughter, false)) + continue; + if (!daughter.isPhysicalPrimary() && daughter.getGenStatusCode() == -1) + continue; + registry.fill(HIST("generated/neutral/hNeutralDecayGen"), track_assoc.pt(), daughter.pt() / track_assoc.pt(), daughter.eta() - track_assoc.eta(), calculateDelta(daughter.phi(), track_assoc.phi(), -PIHalf), pidCodes[track_assoc.pdgCode()]); + } + + // Get correlations between triggers and neutral hadrons + for (const auto& track_trig : tracks_true) { + if (!initTrigParticle(track_trig)) { + continue; + } + float dphi = calculateDelta(track_assoc.phi(), track_trig.phi(), -PIHalf); + registry.fill(HIST("generated/neutral/hNeutralCorrelGen"), track_trig.pt(), track_assoc.pt(), track_assoc.eta() - track_trig.eta(), dphi, pidCodes[track_assoc.pdgCode()]); + } + } + registry.fill(HIST("generated/neutral/hNeutralMultGen"), nNeutrals); + } + PROCESS_SWITCH(HadronPhotonCorrelation, processNeutralCorrelationsMCGen, "mc hadron-pion correlation", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +}; From 120ed90dfc9940801555df647b431ca58543280a Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Tue, 17 Dec 2024 18:21:53 +0100 Subject: [PATCH 419/459] [PWGLF] check trigger classes for HM (#9029) Co-authored-by: ALICE Action Bot --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 37 ++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index 8b3e2b5532d..38a8fd8a0c2 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -10,6 +10,7 @@ // or submit itself to any jurisdiction. #include +#include #include #include #include @@ -35,6 +36,7 @@ #include "DataFormatsTPC/BetheBlochAleph.h" #include "Common/Core/PID/PIDTOF.h" #include "Common/TableProducer/PID/pidTOFBase.h" +#include "CCDB/CcdbApi.h" #include "Common/Core/PID/TPCPIDResponse.h" #include "Common/DataModel/PIDResponse.h" @@ -205,6 +207,7 @@ struct ebyeMaker { std::array, 2> candidateTracks; Service ccdb; o2::vertexing::DCAFitterN<2> fitter; + std::vector classIds; int mRunNumber; float d_bz; @@ -380,7 +383,7 @@ struct ebyeMaker { if (mRunNumber == bc.runNumber()) { return; } - + classIds.clear(); auto timestamp = bc.timestamp(); o2::parameters::GRPObject* grpo = 0x0; o2::parameters::GRPMagField* grpmag = 0x0; @@ -441,6 +444,20 @@ struct ebyeMaker { d_bz = o2::base::Propagator::Instance()->getNominalBz(); LOG(info) << "Retrieved GRP for timestamp " << timestamp << " with magnetic field of " << d_bz << " kG"; mRunNumber = bc.runNumber(); + if (doprocessMiniRun2) { + o2::ccdb::CcdbApi ccdbApi; + ccdbApi.init("http://alice-ccdb.cern.ch"); + std::map metadata; + std::map* classNameToIndexMap = ccdbApi.retrieveFromTFileAny>("CTP/ClassNameToIndexMap", metadata, mRunNumber); + for (const auto& classToIndexPair : *classNameToIndexMap) { + bool hasClassName = classToIndexPair.first.find("HMV0M") < classToIndexPair.first.length(); + int classId = hasClassName ? classToIndexPair.second - 1 : -1; + if (classId < 0) { + continue; + } + classIds.push_back(classId); + } + } fitter.setBz(d_bz); // o2::base::Propagator::Instance()->setMatLUT(lut); @@ -1041,7 +1058,7 @@ struct ebyeMaker { continue; float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); - float cV0M = -999.f; + float cV0M = 105.f; if (Run2V0MInfo.mCalibrationStored) { cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); if (!(collision.sel7() && collision.alias_bit(kINT7)) && (!kINT7Intervals || (kINT7Intervals && ((cV0M >= 10 && cV0M < 30) || cV0M > 50)))) @@ -1127,7 +1144,7 @@ struct ebyeMaker { continue; float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); - float cV0M = -999.f; + float cV0M = 105.f; if (Run2V0MInfo.mCalibrationStored) { cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); } @@ -1141,6 +1158,16 @@ struct ebyeMaker { fillRecoEvent(collision, tracks, V0Table_thisCollision, cV0M); uint8_t trigger = collision.alias_bit(kINT7) ? 0x1 : 0x0; + bool hasHMV0M = false; + for (auto& classId : classIds) { + if (bc.triggerMask() & BIT(classId)) { + hasHMV0M = true; + break; + } + } + if (!hasHMV0M && trigger == 0x0) { + continue; + } miniCollTable(static_cast(collision.posZ() * 10), trigger, nTrackletsColl, cV0M); for (auto& candidateTrack : candidateTracks[0]) { // protons @@ -1247,7 +1274,7 @@ struct ebyeMaker { continue; float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); - float cV0M = -999.f; + float cV0M = 105.f; if (Run2V0MInfo.mCalibrationStored) { cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); } @@ -1319,7 +1346,7 @@ struct ebyeMaker { continue; float v0m = getV0M(bc.globalIndex(), collision.posZ(), fv0as, fv0cs); - float cV0M = -999.f; + float cV0M = 105.f; if (Run2V0MInfo.mCalibrationStored) { cV0M = Run2V0MInfo.mhMultSelCalib->GetBinContent(Run2V0MInfo.mhMultSelCalib->FindFixBin(v0m)); } From c43a54d2c5982c9939976def529142cc02832add Mon Sep 17 00:00:00 2001 From: mhartung71 <50153519+mhartung71@users.noreply.github.com> Date: Tue, 17 Dec 2024 19:36:34 +0100 Subject: [PATCH 420/459] [PWGLF] Add centrality info, fix minor issues (#9025) Co-authored-by: ALICE Action Bot --- PWGLF/DataModel/LFHypernucleiKfTables.h | 72 +- PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx | 496 +++++++------- .../TableProducer/Nuspex/hypKfTreeCreator.cxx | 616 +++++++++--------- 3 files changed, 607 insertions(+), 577 deletions(-) diff --git a/PWGLF/DataModel/LFHypernucleiKfTables.h b/PWGLF/DataModel/LFHypernucleiKfTables.h index 328ab07f6b3..98f8076b2f6 100644 --- a/PWGLF/DataModel/LFHypernucleiKfTables.h +++ b/PWGLF/DataModel/LFHypernucleiKfTables.h @@ -8,11 +8,15 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// authors Janik Ditzel and Michael Hartung + +/// \file LFHypernucleiKfTables.h +/// \brief Slim hypernuclei kf tables +/// \author Janik Ditzel and Michael Hartung #ifndef PWGLF_DATAMODEL_LFHYPERNUCLEIKFTABLES_H_ #define PWGLF_DATAMODEL_LFHYPERNUCLEIKFTABLES_H_ +#include #include "Framework/ASoA.h" #include "Framework/AnalysisDataModel.h" #include "Common/DataModel/Centrality.h" @@ -20,13 +24,13 @@ namespace o2::aod { -namespace hykfmcColl +namespace hykfmccoll { DECLARE_SOA_COLUMN(PassedEvSel, passedEvSel, bool); //! } DECLARE_SOA_TABLE(HypKfMcColls, "AOD", "HYPKFMCCOLL", o2::soa::Index<>, - hykfmcColl::PassedEvSel, + hykfmccoll::PassedEvSel, mccollision::PosX, mccollision::PosY, mccollision::PosZ); @@ -40,9 +44,10 @@ DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); //! DECLARE_SOA_COLUMN(Svx, svx, float); //! DECLARE_SOA_COLUMN(Svy, svy, float); //! DECLARE_SOA_COLUMN(Svz, svz, float); //! +DECLARE_SOA_COLUMN(Occupancy, occupancy, int); //! DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) { return RecoDecay::pt(std::array{px, py}); }); -DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float E, float pz) { return 0.5 * TMath::Log((E + pz) / (E - pz)); }); -DECLARE_SOA_DYNAMIC_COLUMN(Mass, mass, [](float E, float px, float py, float pz) { return TMath::Sqrt(E * E - px * px - py * py - pz * pz); }); +DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float E, float pz) { return 0.5 * std::log((E + pz) / (E - pz)); }); +DECLARE_SOA_DYNAMIC_COLUMN(Mass, mass, [](float E, float px, float py, float pz) { return std::sqrt(E * E - px * px - py * py - pz * pz); }); DECLARE_SOA_DYNAMIC_COLUMN(IsMatter, isMatter, [](int pdgCode) { return pdgCode > 0; }); } // namespace hykfmc @@ -67,34 +72,35 @@ using HypKfMcPart = HypKfMcParts::iterator; DECLARE_SOA_TABLE(HypKfColls, "AOD", "HYPKFCOLL", o2::soa::Index<>, - hykfmcColl::PassedEvSel, + hykfmccoll::PassedEvSel, hykfmc::HypKfMcCollId, collision::PosX, collision::PosY, collision::PosZ, cent::CentFT0A, cent::CentFT0C, - cent::CentFT0M); + cent::CentFT0M, + hykfmc::Occupancy); using HypKfColl = HypKfColls::iterator; namespace hykftrk { DECLARE_SOA_INDEX_COLUMN(HypKfColl, hypKfColl); DECLARE_SOA_COLUMN(Rigidity, rigidity, float); //! -DECLARE_SOA_COLUMN(TPCnCluster, tpcNcluster, float); //! -DECLARE_SOA_COLUMN(TPCnSigma, tpcNsigma, float); //! -DECLARE_SOA_COLUMN(TPCnSigmaNhp, tpcNsigmaNhp, float); //! -DECLARE_SOA_COLUMN(TPCnSigmaNlp, tpcNsigmaNlp, float); //! -DECLARE_SOA_COLUMN(TOFMass, tofMass, float); //! +DECLARE_SOA_COLUMN(TpcNcluster, tpcNcluster, float); //! +DECLARE_SOA_COLUMN(TpcNsigma, tpcNsigma, float); //! +DECLARE_SOA_COLUMN(TpcNsigmaNhp, tpcNsigmaNhp, float); //! +DECLARE_SOA_COLUMN(TpcNsigmaNlp, tpcNsigmaNlp, float); //! +DECLARE_SOA_COLUMN(TofMass, tofMass, float); //! DECLARE_SOA_COLUMN(IsPVContributor, isPVContributor, bool); //! DECLARE_SOA_COLUMN(SubMass, subMass, float); //! -DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) { return (double)pt * TMath::Cos(phi); }); -DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float pt, float phi) { return (double)pt * TMath::Sin(phi); }); -DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float pt, float eta) { return (double)pt * TMath::SinH(eta); }); -DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) { return pt * TMath::CosH(eta); }); // -DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float pt, float eta, float mass) { return std::log((RecoDecay::sqrtSumOfSquares(mass, pt * TMath::CosH(eta)) + pt * TMath::SinH(eta)) / RecoDecay::sqrtSumOfSquares(mass, pt)); }); -DECLARE_SOA_DYNAMIC_COLUMN(Lambda, lambda, [](float eta) { return 1. / TMath::CosH(eta); }); -DECLARE_SOA_DYNAMIC_COLUMN(ITSnCluster, itsNcluster, [](uint32_t itsClusterSizes) { +DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) { return (double)pt * std::cos(phi); }); +DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float pt, float phi) { return (double)pt * std::sin(phi); }); +DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float pt, float eta) { return (double)pt * std::sinh(eta); }); +DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) { return pt * std::cosh(eta); }); // +DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float pt, float eta, float mass) { return std::log((RecoDecay::sqrtSumOfSquares(mass, pt * std::cosh(eta)) + pt * std::sinh(eta)) / RecoDecay::sqrtSumOfSquares(mass, pt)); }); +DECLARE_SOA_DYNAMIC_COLUMN(Lambda, lambda, [](float eta) { return 1. / std::cosh(eta); }); +DECLARE_SOA_DYNAMIC_COLUMN(ItsNcluster, itsNcluster, [](uint32_t itsClusterSizes) { uint8_t n = 0; for (uint8_t i = 0; i < 7; i++) { if (itsClusterSizes >> (4 * i) & 15) @@ -102,21 +108,21 @@ DECLARE_SOA_DYNAMIC_COLUMN(ITSnCluster, itsNcluster, [](uint32_t itsClusterSizes } return n; }); -DECLARE_SOA_DYNAMIC_COLUMN(ITSfirstLayer, itsFirstLayer, [](uint32_t itsClusterSizes) { +DECLARE_SOA_DYNAMIC_COLUMN(ItsFirstLayer, itsFirstLayer, [](uint32_t itsClusterSizes) { for (int i = 0; i < 8; i++) { if (itsClusterSizes >> (4 * i) & 15) return i; } return -999; }); -DECLARE_SOA_DYNAMIC_COLUMN(ITSmeanClsSize, itsMeanClsSize, [](uint32_t itsClusterSizes) { +DECLARE_SOA_DYNAMIC_COLUMN(ItsMeanClsSize, itsMeanClsSize, [](uint32_t itsClusterSizes) { int sum = 0, n = 0; for (int i = 0; i < 8; i++) { sum += (itsClusterSizes >> (4 * i) & 15); if (itsClusterSizes >> (4 * i) & 15) n++; } - return static_cast(sum) / n; + return n > 0 ? static_cast(sum) / n : 0.f; }); } // namespace hykftrk @@ -128,25 +134,25 @@ DECLARE_SOA_TABLE(HypKfTracks, "AOD", "HYPKFTRACK", track::Phi, track::DcaXY, track::DcaZ, - hykftrk::TPCnCluster, + hykftrk::TpcNcluster, track::TPCChi2NCl, track::ITSClusterSizes, track::ITSChi2NCl, hykftrk::Rigidity, track::TPCSignal, - hykftrk::TPCnSigma, - hykftrk::TPCnSigmaNhp, - hykftrk::TPCnSigmaNlp, - hykftrk::TOFMass, + hykftrk::TpcNsigma, + hykftrk::TpcNsigmaNhp, + hykftrk::TpcNsigmaNlp, + hykftrk::TofMass, hykftrk::IsPVContributor, hykftrk::Px, hykftrk::Py, hykftrk::Pz, hykftrk::P, hykftrk::Lambda, - hykftrk::ITSnCluster, - hykftrk::ITSfirstLayer, - hykftrk::ITSmeanClsSize); + hykftrk::ItsNcluster, + hykftrk::ItsFirstLayer, + hykftrk::ItsMeanClsSize); using HypKfTrack = HypKfTracks::iterator; DECLARE_SOA_TABLE(HypKfSubDs, "AOD", "HYPKFSUBD", @@ -168,10 +174,10 @@ namespace hykfhyp { DECLARE_SOA_INDEX_COLUMN(HypKfColl, hypKfColl); DECLARE_SOA_INDEX_COLUMN(HypKfMcPart, hypKfMcPart); -DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfDaughtAdd, addons); -DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfTrack, daughterTracks); +DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfDaughtAdd, hypKfDaughtAdd); +DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfTrack, hypKfTrack); DECLARE_SOA_SELF_INDEX_COLUMN_FULL(HypDaughter, hypDaughter, int, "HypKfHypNucs"); -DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfSubD, subDaughters); +DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfSubD, hypKfSubD); DECLARE_SOA_COLUMN(Primary, primary, bool); //! DECLARE_SOA_COLUMN(Mass, mass, float); //! DECLARE_SOA_COLUMN(Px, px, float); //! diff --git a/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx index 353459c835b..a3a3db2e936 100644 --- a/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx @@ -9,10 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// -/// \brief Hypernuclei rconstruction using KGParticle package -/// \authors Janik Ditzel and Michael Hartung +/// \file hypKfRecoTask.cxx +/// \brief Hypernuclei rconstruction using KFParticle package +/// \author Janik Ditzel and Michael Hartung -#include #include #include #include @@ -42,7 +42,7 @@ // KFParticle #ifndef HomogeneousField -#define HomogeneousField +#define HomogeneousField // o2-linter: disable=[name/macro] #endif #include "KFParticle.h" #include "KFPTrack.h" @@ -78,22 +78,22 @@ static const std::vector particleCharge{1, 1, 1, 1, 2, 2}; const int nBetheParams = 6; static const std::vector betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"}; constexpr double betheBlochDefault[nDaughterParticles][nBetheParams]{ - {14.182511, 3.784237, 0.010118, 1.775545, 0.742465, 0.09}, // pion - {23.248183, 2.357092, -0.143924, 2.178266, 0.416733, 0.09}, // proton - {12.881922, 3.775785, 0.062699, 2.452242, 1.049385, 0.09}, // deuteron - {0.313129, 181.664226, 2779397163087.684082, 2.130773, 29.609643, 0.09}, // triton - {70.584685, 3.196364, 0.133878, 2.731736, 1.675617, 0.09}, // helion - {105.625770, 0.868172, -0.871411, 1.895609, 0.046273, 0.09}}; // alpha - -const int nTrkSettings = 13; -static const std::vector trackPIDsettingsNames{"useBBparams", "minITSnCls", "minTPCnCls", "maxTPCchi2", "maxITSchi2", "minRigidity", "maxRigidity", "maxTPCnSigma", "TOFrequiredabove", "minTOFmass", "maxTOFmass", "minDcaToPvXY", "minDcaToPvZ"}; + {13.611469, 3.598765, -0.021138, 2.039562, 0.651040, 0.09}, // pion + {5.393020, 7.859534, 0.004048, 2.323197, 1.609307, 0.09}, // proton + {5.393020, 7.859534, 0.004048, 2.323197, 1.609307, 0.09}, // deuteron + {5.393020, 7.859534, 0.004048, 2.323197, 1.609307, 0.09}, // triton + {-126.557359, -0.858569, 1.111643, 1.210323, 2.656374, 0.09}, // helion + {-126.557359, -0.858569, 1.111643, 1.210323, 2.656374, 0.09}}; // alpha + +const int nTrkSettings = 15; +static const std::vector trackPIDsettingsNames{"useBBparams", "minITSnCls", "minTPCnCls", "maxTPCchi2", "maxITSchi2", "minRigidity", "maxRigidity", "maxTPCnSigma", "TOFrequiredabove", "minTOFmass", "maxTOFmass", "minDcaToPvXY", "minDcaToPvZ", "minITSclsSize", "maxITSclsSize"}; constexpr double trackPIDsettings[nDaughterParticles][nTrkSettings]{ - {0, 0, 50, 5, 50, 0.2, 1.2, 3, -1, 0, 100, 0., 0.}, - {0, 0, 50, 5, 50, 0.5, 100, 3, -1, 0, 100, 0., 0.}, - {0, 0, 50, 5, 50, 0.5, 100, 3, -1, 0, 100, 0., 0.}, - {0, 0, 50, 5, 50, 0.5, 100, 3, -1, 0, 100, 0., 0.}, - {0, 0, 50, 5, 50, 0.5, 100, 3, -1, 0, 100, 0., 0.}, - {0, 0, 50, 5, 50, 0.5, 100, 3, -1, 0, 100, 0., 0.}}; + {0, 0, 60, 3.0, 5000, 0.15, 1.2, 2.5, -1, 0, 100, 0., 0., 0., 1000}, + {1, 0, 70, 2.5, 5000, 0.20, 4.0, 3.0, -1, 0, 100, 0., 0., 0., 1000}, + {1, 0, 70, 5.0, 5000, 0.50, 5.0, 3.0, -1, 0, 100, 0., 0., 0., 1000}, + {1, 0, 70, 5.0, 5000, 0.50, 5.0, 3.0, -1, 0, 100, 0., 0., 0., 1000}, + {1, 0, 75, 1.5, 5000, 0.50, 5.0, 3.0, -1, 0, 100, 0., 0., 0., 1000}, + {1, 0, 70, 1.5, 5000, 0.50, 5.0, 3.0, -1, 0, 100, 0., 0., 0., 1000}}; static const int nHyperNuclei = 10; static const std::vector hyperNucNames{"L->p+pi", "3LH->3He+pi", "3LH->d+p+pi", "4LH->4He+pi", "4LH->t+p+pi", "4LHe->3He+p+pi", "5LHe->4He+p+pi", "5LHe->3He+d+pi", "custom1", "custom2"}; @@ -119,29 +119,29 @@ static const std::string hyperNucSigns[nHyperNuclei][4]{{"+", "-", "", ""}, {"+" const int nSelPrim = 8; static const std::vector preSelectionPrimNames{"minMass", "maxMass", "minCt", "maxCt", "minCosPa", "maxDcaTracks", "maxDcaMotherToPvXY", "maxDcaMotherToPvZ"}; constexpr double preSelectionsPrimaries[nHyperNuclei][nSelPrim]{ - {1.0, 1.3, 0, 100, -1., 100., 10., 10.}, - {2.9, 3.1, 0, 100, -1., 100., 10., 10.}, - {2.9, 3.1, 0, 100, -1., 100., 10., 10.}, - {3.6, 4.2, 0, 100, -1., 100., 10., 10.}, - {3.6, 4.2, 0, 100, -1., 100., 10., 10.}, - {3.6, 4.2, 0, 100, -1., 100., 10., 10.}, - {4.6, 5.2, 0, 100, -1., 100., 10., 10.}, - {4.6, 5.2, 0, 100, -1., 100., 10., 10.}, - {0.0, 9.9, 0, 100, -1., 100., 10., 10.}, - {0.0, 9.9, 0, 100, -1., 100., 10., 10.}}; + {1.00, 1.30, 0, 50, 0.90, 100., 2.0, 5.0}, + {2.96, 3.04, 0, 30, 0.99, 100., 1.5, 4.0}, + {2.96, 3.04, 0, 30, 0.99, 100., 1.5, 4.0}, + {3.87, 3.97, 0, 30, 0.95, 100., 2.0, 5.0}, + {3.87, 3.97, 0, 30, 0.95, 100., 2.0, 5.0}, + {3.85, 3.99, 0, 30, 0.98, 100., 1.5, 4.0}, + {4.60, 5.20, 0, 100, -1., 100., 10., 10.}, + {4.60, 5.20, 0, 100, -1., 100., 10., 10.}, + {0.00, 9.90, 0, 100, -1., 100., 10., 10.}, + {0.00, 9.90, 0, 100, -1., 100., 10., 10.}}; const int nSelSec = 8; static const std::vector preSelectionSecNames{"minMass", "maxMass", "minCt", "maxCt", "minCosPaSv", "maxDcaTracks", "maxDcaMotherToSvXY", "maxDcaMotherToSvZ"}; constexpr double preSelectionsSecondaries[nHyperNuclei][nSelSec]{ - {1.0, 1.3, 0, 100, -1., 100., 10., 10.}, - {2.9, 3.1, 0, 100, -1., 100., 10., 10.}, - {2.9, 3.1, 0, 100, -1., 100., 10., 10.}, - {3.6, 4.2, 0, 100, -1., 100., 10., 10.}, - {3.6, 4.2, 0, 100, -1., 100., 10., 10.}, - {3.6, 4.2, 0, 100, -1., 100., 10., 10.}, - {4.6, 5.2, 0, 100, -1., 100., 10., 10.}, - {4.6, 5.2, 0, 100, -1., 100., 10., 10.}, - {0.0, 9.9, 0, 100, -1., 100., 10., 10.}, - {0.0, 9.9, 0, 100, -1., 100., 10., 10.}}; + {1.00, 1.30, 0, 50, 0.90, 100., 2.0, 5.0}, + {2.96, 3.04, 0, 30, 0.99, 100., 1.5, 4.0}, + {2.96, 3.04, 0, 30, 0.99, 100., 1.5, 4.0}, + {3.87, 3.97, 0, 30, 0.95, 100., 2.0, 5.0}, + {3.87, 3.97, 0, 30, 0.95, 100., 2.0, 5.0}, + {3.85, 3.99, 0, 30, 0.98, 100., 1.5, 4.0}, + {4.60, 5.20, 0, 100, -1., 100., 10., 10.}, + {4.60, 5.20, 0, 100, -1., 100., 10., 10.}, + {0.00, 9.90, 0, 100, -1., 100., 10., 10.}, + {0.00, 9.90, 0, 100, -1., 100., 10., 10.}}; static const int nCascades = 6; static const std::vector cascadeNames{"4LLH->4LHe+pi", "4XHe->4LHe+pi", "custom1", "custom2", "custom3", "custom4"}; @@ -161,15 +161,15 @@ static const std::string cascadeSigns[nCascades][4]{{"+", "-", "", ""}, {"+", "- const int nSelCas = 8; static const std::vector preSelectionCascadeNames{"minMass", "maxMass", "minCt", "maxCt", "minCosPa", "maxDcaTracks", "maxDcaMotherToPvXY", "maxDcaMotherToPvZ"}; constexpr double preSelectionsCascades[nCascades][nSelCas]{ - {3.9, 4.3, 0, 100, -1., 100., 10., 10.}, - {3.9, 4.3, 0, 100, -1., 100., 10., 10.}, - {3.9, 4.3, 0, 100, -1., 100., 10., 10.}, - {3.9, 4.3, 0, 100, -1., 100., 10., 10.}, - {3.9, 4.3, 0, 100, -1., 100., 10., 10.}, - {3.9, 4.3, 0, 100, -1., 100., 10., 10.}}; + {4.00, 4.20, 0, 30, 0.95, 100., 2.0, 5.}, + {4.00, 4.20, 0, 30, 0.95, 100., 2.0, 5.}, + {0.00, 9.90, 0, 100, -1., 100., 10., 10.}, + {0.00, 9.90, 0, 100, -1., 100., 10., 10.}, + {0.00, 9.90, 0, 100, -1., 100., 10., 10.}, + {0.00, 9.90, 0, 100, -1., 100., 10., 10.}}; //---------------------------------------------------------------------------------------------------------------- -struct daughterParticle { +struct DaughterParticle { TString name; int pdgCode; double mass; @@ -177,7 +177,7 @@ struct daughterParticle { double resolution; std::vector betheParams; - daughterParticle(std::string name_, int pdgCode_, double mass_, int charge_, LabeledArray bethe) + DaughterParticle(std::string name_, int pdgCode_, double mass_, int charge_, LabeledArray bethe) { name = TString(name_); pdgCode = pdgCode_; @@ -188,19 +188,9 @@ struct daughterParticle { for (unsigned int i = 0; i < 5; i++) betheParams.push_back(bethe.get(name, i)); } +}; // class DaughterParticle - void Print() - { - std::cout << std::endl - << "Daughter: " << name << std::endl; - std::cout << "PDG: " << pdgCode << ", Mass: " << mass << ", Charge: " << charge << std::endl; - for (double d : betheParams) - std::cout << d << ", " << std::flush; - std::cout << resolution << std::endl; - } -}; // class daughterParticle - -struct hyperNucleus { +struct HyperNucleus { TString name; int pdgCode; double massMax; @@ -209,48 +199,37 @@ struct hyperNucleus { std::vector daughters; std::vector daughterTrackSigns; - hyperNucleus(std::string name_, int pdgCode_, bool active_, std::vector daughters_, std::vector daughterTrackSigns_) + HyperNucleus(std::string name_, int pdgCode_, bool active_, std::vector daughters_, std::vector daughterTrackSigns_) { name = TString(name_); pdgCode = pdgCode_; active = active_; - for (int d : daughters_) + for (const int& d : daughters_) daughters.push_back(d); - for (int dc : daughterTrackSigns_) + for (const int& dc : daughterTrackSigns_) daughterTrackSigns.push_back(dc); } - hyperNucleus(std::string name_, int pdgCode_, bool active_, int hypDaughter, std::vector daughters_, std::vector daughterTrackSigns_) + HyperNucleus(std::string name_, int pdgCode_, bool active_, int hypDaughter, std::vector daughters_, std::vector daughterTrackSigns_) { daughters.push_back(hypDaughter); name = TString(name_); pdgCode = pdgCode_; active = active_; - for (int d : daughters_) + for (const int& d : daughters_) daughters.push_back(d); - for (int dc : daughterTrackSigns_) + for (const int& dc : daughterTrackSigns_) daughterTrackSigns.push_back(dc); } - int GetNdaughters() { return static_cast(daughters.size()); } + int getNdaughters() { return static_cast(daughters.size()); } const char* motherName() { return name.Contains("->") ? ((TString)name(0, name.First("-"))).Data() : name.Data(); } const char* daughterNames() { return name.Contains("->") ? ((TString)name(name.First("-") + 2, name.Length())).Data() : ""; } - void Print() - { - std::cout << std::endl - << "Hypernucleus: " << name << " (" << pdgCode << "):" << (active ? " active" : " not active") << std::endl; - for (double d : daughters) - std::cout << d << ", " << std::flush; - for (double dc : daughterTrackSigns) - std::cout << dc << ", " << std::flush; - std::cout << std::endl - << std::endl; - } -}; // class hyperNucleus +}; // class HyperNucleus -struct hyperNucCandidate { +struct HyperNucCandidate { int species; KFParticle kfp; std::vector kfpDaughters; - hyperNucCandidate* hypNucDaughter; + HyperNucCandidate* hypNucDaughter; std::vector daughterTrackIds; std::vector recoSV; float devToVtx; @@ -263,24 +242,24 @@ struct hyperNucCandidate { int64_t mcParticleId; int tableId; - hyperNucCandidate(int species_, std::vector kfpDaughters_, std::vector daughterTrackIds_) : species(species_), hypNucDaughter(0), devToVtx(999), dcaToVtxXY(999), dcaToVtxZ(999), chi2(999), mcTrue(false), isPhysPrimary(false), isPrimaryCandidate(false), isSecondaryCandidate(false), isUsedSecondary(false), mcParticleId(-1), tableId(-1) + HyperNucCandidate(int species_, std::vector kfpDaughters_, std::vector daughterTrackIds_) : species(species_), hypNucDaughter(0), devToVtx(999), dcaToVtxXY(999), dcaToVtxZ(999), chi2(999), mcTrue(false), isPhysPrimary(false), isPrimaryCandidate(false), isSecondaryCandidate(false), isUsedSecondary(false), mcParticleId(-1), tableId(-1) { - for (auto kfd : kfpDaughters_) + for (const auto& kfd : kfpDaughters_) kfpDaughters.push_back(kfd); - for (auto dt : daughterTrackIds_) + for (const auto& dt : daughterTrackIds_) daughterTrackIds.push_back(dt); - Init(); + init(); } - hyperNucCandidate(int species_, hyperNucCandidate* hypNucDaughter_, std::vector kfpDaughters_, std::vector daughterTrackIds_) : species(species_), hypNucDaughter(hypNucDaughter_), devToVtx(999), dcaToVtxXY(999), dcaToVtxZ(999), chi2(999), mcTrue(false), isPhysPrimary(false), isPrimaryCandidate(false), isSecondaryCandidate(false), isUsedSecondary(false), mcParticleId(-1), tableId(-1) + HyperNucCandidate(int species_, HyperNucCandidate* hypNucDaughter_, std::vector kfpDaughters_, std::vector daughterTrackIds_) : species(species_), hypNucDaughter(hypNucDaughter_), devToVtx(999), dcaToVtxXY(999), dcaToVtxZ(999), chi2(999), mcTrue(false), isPhysPrimary(false), isPrimaryCandidate(false), isSecondaryCandidate(false), isUsedSecondary(false), mcParticleId(-1), tableId(-1) { - for (auto kfd : kfpDaughters_) + for (const auto& kfd : kfpDaughters_) kfpDaughters.push_back(kfd); - for (auto dt : daughterTrackIds_) + for (const auto& dt : daughterTrackIds_) daughterTrackIds.push_back(dt); - Init(); + init(); } - void Init() + void init() { kfp.SetConstructMethod(2); for (size_t i = 0; i < kfpDaughters.size(); i++) @@ -292,7 +271,7 @@ struct hyperNucCandidate { recoSV.push_back(kfp.GetY()); recoSV.push_back(kfp.GetZ()); } - bool CheckKfp() + bool checkKfp() { if (kfp.GetMass() == 0) return false; @@ -300,67 +279,67 @@ struct hyperNucCandidate { return false; return true; } - int GetDaughterTableId() + int getDaughterTableId() { if (hypNucDaughter) return hypNucDaughter->tableId; return -1; } - bool IsCascade() { return hypNucDaughter != 0; } - int GetSign() + bool isCascade() { return hypNucDaughter != 0; } + int getSign() { if (kfp.GetQ() == 0) return kfpDaughters.front().GetQ() / std::abs(kfpDaughters.front().GetQ()); return kfp.GetQ() / std::abs(kfp.GetQ()); } - int GetNdaughters() { return static_cast(kfpDaughters.size()); } - float GetDcaTracks() { return GetNdaughters() == 2 ? GetDcaTracks2() : GetMaxDcaToSv(); } - float GetDcaTracks2() { return kfpDaughters.at(0).GetDistanceFromParticle(kfpDaughters.at(1)); } - float GetMaxDcaToSv() + int getNdaughters() { return static_cast(kfpDaughters.size()); } + float getDcaTracks() { return getNdaughters() == 2 ? getDcaTracks2() : getMaxDcaToSv(); } + float getDcaTracks2() { return kfpDaughters.at(0).GetDistanceFromParticle(kfpDaughters.at(1)); } + float getMaxDcaToSv() { float maxDca = std::numeric_limits::lowest(); - for (auto& daughter : kfpDaughters) { + for (const auto& daughter : kfpDaughters) { float dca = daughter.GetDistanceFromVertex(&recoSV[0]); if (dca > maxDca) maxDca = dca; } return maxDca; } - float GetDcaMotherToVertex(std::vector vtx) { return kfp.GetDistanceFromVertex(&vtx[0]); } - double GetCpa(std::vector vtx) + float getDcaMotherToVertex(std::vector vtx) { return kfp.GetDistanceFromVertex(&vtx[0]); } + double getCpa(std::vector vtx) { kfp.TransportToDecayVertex(); return RecoDecay::cpa(std::array{vtx[0], vtx[1], vtx[2]}, std::array{recoSV[0], recoSV[1], recoSV[2]}, std::array{kfp.GetPx(), kfp.GetPy(), kfp.GetPz()}); ; } - float GetCt(std::vector vtx) + float getCt(std::vector vtx) { float dl = 0; for (size_t i = 0; i < vtx.size(); i++) { float tmp = recoSV.at(i) - vtx.at(i); dl += (tmp * tmp); } - return TMath::Sqrt(dl) * kfp.GetMass() / kfp.GetP(); + return std::sqrt(dl) * kfp.GetMass() / kfp.GetP(); } - float GetDcaMotherToVtxXY(std::vector vtx) { return kfp.GetDistanceFromVertexXY(&vtx[0]); } - float GetDcaMotherToVtxZ(std::vector vtx) + float getDcaMotherToVtxXY(std::vector vtx) { return kfp.GetDistanceFromVertexXY(&vtx[0]); } + float getDcaMotherToVtxZ(std::vector vtx) { kfp.TransportToPoint(&vtx[0]); - return std::abs(kfp.GetZ() - vtx[2]); + return kfp.GetZ() - vtx[2]; } - void GetDaughterPosMom(int daughter, std::vector& posMom) + void getDaughterPosMom(int daughter, std::vector& posMom) { kfpDaughters.at(daughter).TransportToPoint(&recoSV[0]); posMom.assign({kfpDaughters.at(daughter).GetX(), kfpDaughters.at(daughter).GetY(), kfpDaughters.at(daughter).GetZ(), kfpDaughters.at(daughter).GetPx(), kfpDaughters.at(daughter).GetPy(), kfpDaughters.at(daughter).GetPz()}); } - void CalcDevToVtx(KFPVertex& vtx) { devToVtx = kfp.GetDeviationFromVertexXY(vtx); } - void CalcDevToVtx(hyperNucCandidate& cand) + void calcDevToVtx(KFPVertex& vtx) { devToVtx = kfp.GetDeviationFromVertexXY(vtx); } + void calcDevToVtx(HyperNucCandidate& cand) { devToVtx = kfp.GetDeviationFromParticleXY(cand.kfp); - dcaToVtxXY = GetDcaMotherToVtxXY(cand.recoSV); - dcaToVtxZ = GetDcaMotherToVtxZ(cand.recoSV); + dcaToVtxXY = getDcaMotherToVtxXY(cand.recoSV); + dcaToVtxZ = getDcaMotherToVtxZ(cand.recoSV); } - float GetSubDaughterMass(int d1, int d2) + float getSubDaughterMass(int d1, int d2) { KFParticle subDaughter; subDaughter.SetConstructMethod(2); @@ -369,16 +348,30 @@ struct hyperNucCandidate { subDaughter.TransportToDecayVertex(); return subDaughter.GetMass(); } -}; // class hyperNucCandidate + KFParticle getDaughterTrackKfp(int track) + { + return kfpDaughters.at(track + isCascade() ? 1 : 0); + } + float getDcaTrackToVtxXY(int track, std::vector vtx) + { + return getDaughterTrackKfp(track).GetDistanceFromVertexXY(&vtx[0]); + } + float getDcaTrackToVtxZ(int track, std::vector vtx) + { + auto dKfp = getDaughterTrackKfp(track); + dKfp.TransportToPoint(&vtx[0]); + return dKfp.GetZ() - vtx[2]; + } +}; // class HyperNucCandidate -struct indexPairs { +struct IndexPairs { std::vector> pairs; - void Add(int64_t a, int b) { pairs.push_back({a, b}); } - void Clear() { pairs.clear(); } - bool GetIndex(int64_t a, int& b) + void add(int64_t a, int b) { pairs.push_back({a, b}); } + void clear() { pairs.clear(); } + bool getIndex(int64_t a, int& b) { - for (auto& pair : pairs) { + for (const auto& pair : pairs) { if (pair.first == a) { b = pair.second; return true; @@ -386,15 +379,15 @@ struct indexPairs { } return false; } -}; // class indexPairs +}; // class IndexPairs -struct mcCollInfo { +struct McCollInfo { bool hasRecoColl; bool passedEvSel; bool hasRecoParticle; int tableIndex; - mcCollInfo() : hasRecoColl(false), passedEvSel(false), hasRecoParticle(false), tableIndex(-1) {} -}; // class mcCollInfo + McCollInfo() : hasRecoColl(false), passedEvSel(false), hasRecoParticle(false), tableIndex(-1) {} +}; // class McCollInfo //---------------------------------------------------------------------------------------------------------------- std::vector> hDeDx; @@ -403,7 +396,7 @@ std::vector> hInvMass; //---------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------- -struct hypKfRecoTask { +struct hypKfRecoTask { // o2-linter: disable=[name/workflow-file][name/struct] Produces outputMcCollisionTable; Produces outputMcParticleTable; @@ -426,7 +419,7 @@ struct hypKfRecoTask { Configurable> cfgHyperNucsActive{"cfgHyperNucsActive", {hyperNucEnabled[0], nHyperNuclei, 1, hyperNucNames, hyperNucEnabledLb}, "enable or disable reconstruction"}; Configurable> cfgReduce{"cfgReduce", {reduceFactor[0], nHyperNuclei, 1, hyperNucNames, reduceLb}, "reconstruct only a percentage of all possible hypernuclei"}; - Configurable> cfgHyperNucPdg{"cfgHyperNucsPdg", {hyperNucPdgCodes[0], nHyperNuclei, 1, hyperNucNames, hyperNucPdgLb}, "PDG codes"}; + Configurable> cfgHyperNucPdg{"cfgHyperNucPdg", {hyperNucPdgCodes[0], nHyperNuclei, 1, hyperNucNames, hyperNucPdgLb}, "PDG codes"}; Configurable> cfgHyperNucDaughters{"cfgHyperNucDaughters", {hyperNucDaughters[0], nHyperNuclei, 4, hyperNucNames, hyperNucDaughtersLb}, "Daughter particles"}; Configurable> cfgHyperNucSigns{"cfgHyperNucSigns", {hyperNucSigns[0], nHyperNuclei, 4, hyperNucNames, hyperNucDaughtersLb}, "Daughter signs"}; @@ -444,65 +437,69 @@ struct hypKfRecoTask { // CCDB Service ccdb; - Configurable d_bz_input{"d_bz", -999, "bz field, -999 is automatic"}; - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable bField{"bField", -999, "bz field, -999 is automatic"}; + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; Configurable pidPath{"pidPath", "", "Path to the PID response object"}; - std::vector daughterParticles; + std::vector daughterParticles; std::vector> foundDaughters; - std::vector> singleHyperNucCandidates; // hypernuclei candidates - std::vector> cascadeHyperNucCandidates; // cascade candidates - std::vector singleHyperNuclei; - std::vector cascadeHyperNuclei; + std::vector> singleHyperNucCandidates; // hypernuclei candidates + std::vector> cascadeHyperNucCandidates; // cascade candidates + std::vector singleHyperNuclei; + std::vector cascadeHyperNuclei; std::vector primVtx; std::vector cents; - std::vector mcCollInfos; - indexPairs trackIndices; - indexPairs mcPartIndices; - KFPVertex KfPrimVtx; + std::vector mcCollInfos; + IndexPairs trackIndices; + IndexPairs mcPartIndices; + KFPVertex kfPrimVtx; bool collHasCandidate, collHasMcTrueCandidate; bool collPassedEvSel; int64_t mcCollTableIndex; - int mRunNumber; - float d_bz; + int mRunNumber, occupancy; + float dBz; TRandom rand; //---------------------------------------------------------------------------------------------------------------- void init(InitContext const&) { mRunNumber = 0; - d_bz = 0; + dBz = 0; rand.SetSeed(0); - ccdb->setURL(ccdburl); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setFatalWhenNull(false); for (int i = 0; i < nDaughterParticles; i++) { // create daughterparticles - daughterParticles.push_back(daughterParticle(particleNames.at(i), particlePdgCodes.at(i), particleMasses.at(i), particleCharge.at(i), cfgBetheBlochParams)); + daughterParticles.push_back(DaughterParticle(particleNames.at(i), particlePdgCodes.at(i), particleMasses.at(i), particleCharge.at(i), cfgBetheBlochParams)); } for (unsigned int i = 0; i < nHyperNuclei; i++) { // create hypernuclei - singleHyperNuclei.push_back(hyperNucleus(hyperNucNames.at(i), cfgHyperNucPdg->get(i, 0u), cfgHyperNucsActive->get(i, 0u), getDaughterVec(i, cfgHyperNucDaughters), getDaughterSignVec(i, cfgHyperNucSigns))); + singleHyperNuclei.push_back(HyperNucleus(hyperNucNames.at(i), cfgHyperNucPdg->get(i, 0u), cfgHyperNucsActive->get(i, 0u), getDaughterVec(i, cfgHyperNucDaughters), getDaughterSignVec(i, cfgHyperNucSigns))); } for (unsigned int i = 0; i < nCascades; i++) { // create cascades - cascadeHyperNuclei.push_back(hyperNucleus(cascadeNames.at(i), cfgCascadesPdg->get(i, 0u), cfgCascadesActive->get(i, 0u), getHypDaughterVec(i, cfgCascadeHypDaughter), getDaughterVec(i, cfgCascadeDaughters), getDaughterSignVec(i, cfgCascadeSigns))); + cascadeHyperNuclei.push_back(HyperNucleus(cascadeNames.at(i), cfgCascadesPdg->get(i, 0u), cfgCascadesActive->get(i, 0u), getHypDaughterVec(i, cfgCascadeHypDaughter), getDaughterVec(i, cfgCascadeDaughters), getDaughterSignVec(i, cfgCascadeSigns))); } - // define histogram axes const AxisSpec axisMagField{10, -10., 10., "magnetic field"}; const AxisSpec axisNev{3, 0., 3., "Number of events"}; const AxisSpec axisRigidity{4000, -10., 10., "#it{p}^{TPC}/#it{z}"}; const AxisSpec axisdEdx{2000, 0, 2000, "d#it{E}/d#it{x}"}; const AxisSpec axisInvMass{1000, 1, 6, "inv mass"}; - + const AxisSpec axisCent{100, 0, 100, "centrality"}; + const AxisSpec axisVtxZ{100, -10, 10, "z"}; // create histograms histos.add("histMagField", "histMagField", kTH1F, {axisMagField}); histos.add("histNev", "histNev", kTH1F, {axisNev}); + histos.add("histVtxZ", "histVtxZ", kTH1F, {axisVtxZ}); + histos.add("histCentFT0A", "histCentFT0A", kTH1F, {axisCent}); + histos.add("histCentFT0C", "histCentFT0C", kTH1F, {axisCent}); + histos.add("histCentFT0M", "histCentFT0M", kTH1F, {axisCent}); hDeDx.resize(2 * nDaughterParticles + 2); for (int i = 0; i < nDaughterParticles + 1; i++) { TString histName = i < nDaughterParticles ? daughterParticles[i].name : "all"; @@ -512,11 +509,11 @@ struct hypKfRecoTask { // create invariant mass histograms hInvMass.resize(nHyperNuclei + nCascades); int histCount = 0; - std::vector> hypNucVectors = {singleHyperNuclei, cascadeHyperNuclei}; - for (auto vec : hypNucVectors) { - for (auto nuc : vec) { - if (nuc.active) { - hInvMass[histCount] = histos.add(Form("h%d_%s", histCount, nuc.motherName()), ";;Counts", HistType::kTH1F, {axisInvMass}); + std::vector> hypNucVectors = {singleHyperNuclei, cascadeHyperNuclei}; + for (size_t i = 0; i < hypNucVectors.size(); i++) { + for (size_t j = 0; j < hypNucVectors.at(i).size(); j++) { + if (hypNucVectors.at(i).at(j).active) { + hInvMass[histCount] = histos.add(Form("h%d_%s", histCount, hypNucVectors.at(i).at(j).motherName()), ";;Counts", HistType::kTH1F, {axisInvMass}); } histCount++; } @@ -550,6 +547,10 @@ struct hypKfRecoTask { continue; if (std::abs(track.dcaZ()) < cfgTrackPIDsettings->get(i, "minDcaToPvZ")) continue; + if (getMeanItsClsSize(track) < cfgTrackPIDsettings->get(i, "minITSclsSize")) + continue; + if (getMeanItsClsSize(track) > cfgTrackPIDsettings->get(i, "maxITSclsSize")) + continue; if (getRigidity(track) < cfgTrackPIDsettings->get(i, "minRigidity") || getRigidity(track) > cfgTrackPIDsettings->get(i, "maxRigidity")) continue; if (cfgTrackPIDsettings->get(i, "TOFrequiredabove") >= 0 && getRigidity(track) > cfgTrackPIDsettings->get(i, "TOFrequiredabove") && (track.mass() < cfgTrackPIDsettings->get(i, "minTOFmass") || track.mass() > cfgTrackPIDsettings->get(i, "maxTOFmass"))) @@ -589,10 +590,10 @@ struct hypKfRecoTask { { // loop over all hypernuclei that are to be reconstructed for (size_t hyperNucIter = 0; hyperNucIter < singleHyperNuclei.size(); hyperNucIter++) { - hyperNucleus* hyperNuc = &(singleHyperNuclei.at(hyperNucIter)); + HyperNucleus* hyperNuc = &(singleHyperNuclei.at(hyperNucIter)); if (!hyperNuc->active) continue; - int nDaughters = hyperNuc->GetNdaughters(); + int nDaughters = hyperNuc->getNdaughters(); std::vector::iterator> it; int nCombinations = 1; @@ -627,25 +628,25 @@ struct hypKfRecoTask { daughterIds.push_back(*(it[i])); auto daughterMass = daughterParticles.at(hyperNuc->daughters.at(i)).mass; auto daughterCharge = daughterParticles.at(hyperNuc->daughters.at(i)).charge; - daughterKfps.push_back(CreateKFParticle(daughterTrack, daughterMass, daughterCharge)); + daughterKfps.push_back(createKFParticle(daughterTrack, daughterMass, daughterCharge)); } - hyperNucCandidate candidate(hyperNucIter, daughterKfps, daughterIds); + HyperNucCandidate candidate(hyperNucIter, daughterKfps, daughterIds); bool isPrimCandidate = true, isSecCandidate = true; - if (candidate.CheckKfp()) { + if (candidate.checkKfp()) { // apply pre selections - candidate.CalcDevToVtx(KfPrimVtx); + candidate.calcDevToVtx(kfPrimVtx); if (candidate.kfp.GetMass() < cfgPreSelectionsPrimaries->get(hyperNucIter, "minMass") || candidate.kfp.GetMass() > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxMass")) isPrimCandidate = false; - if (candidate.GetDcaTracks() > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxDcaTracks")) + if (candidate.getDcaTracks() > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxDcaTracks")) isPrimCandidate = false; - if (candidate.GetCt(primVtx) < cfgPreSelectionsPrimaries->get(hyperNucIter, "minCt") || candidate.GetCt(primVtx) > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxCt")) + if (candidate.getCt(primVtx) < cfgPreSelectionsPrimaries->get(hyperNucIter, "minCt") || candidate.getCt(primVtx) > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxCt")) isPrimCandidate = false; - if (candidate.GetCpa(primVtx) < cfgPreSelectionsPrimaries->get(hyperNucIter, "minCosPa")) + if (candidate.getCpa(primVtx) < cfgPreSelectionsPrimaries->get(hyperNucIter, "minCosPa")) isPrimCandidate = false; - if (candidate.GetDcaMotherToVtxXY(primVtx) > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxDcaMotherToPvXY")) + if (std::abs(candidate.getDcaMotherToVtxXY(primVtx)) > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxDcaMotherToPvXY")) isPrimCandidate = false; - if (candidate.GetDcaMotherToVtxZ(primVtx) > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxDcaMotherToPvZ")) + if (std::abs(candidate.getDcaMotherToVtxZ(primVtx)) > cfgPreSelectionsPrimaries->get(hyperNucIter, "maxDcaMotherToPvZ")) isPrimCandidate = false; if (isPrimCandidate) { candidate.isPrimaryCandidate = true; @@ -653,9 +654,9 @@ struct hypKfRecoTask { } if (candidate.kfp.GetMass() < cfgPreSelectionsSecondaries->get(hyperNucIter, "minMass") || candidate.kfp.GetMass() > cfgPreSelectionsSecondaries->get(hyperNucIter, "maxMass")) isSecCandidate = false; - if (candidate.GetDcaTracks() > cfgPreSelectionsSecondaries->get(hyperNucIter, "maxDcaTracks")) + if (candidate.getDcaTracks() > cfgPreSelectionsSecondaries->get(hyperNucIter, "maxDcaTracks")) isSecCandidate = false; - if (candidate.GetCt(primVtx) < cfgPreSelectionsSecondaries->get(hyperNucIter, "minCt") || candidate.GetCt(primVtx) > cfgPreSelectionsSecondaries->get(hyperNucIter, "maxCt")) + if (candidate.getCt(primVtx) < cfgPreSelectionsSecondaries->get(hyperNucIter, "minCt") || candidate.getCt(primVtx) > cfgPreSelectionsSecondaries->get(hyperNucIter, "maxCt")) isSecCandidate = false; if (isSecCandidate) { candidate.isSecondaryCandidate = true; @@ -678,10 +679,10 @@ struct hypKfRecoTask { // loop over all cascade hypernuclei that are to be reconstructed for (size_t hyperNucIter = 0; hyperNucIter < cascadeHyperNuclei.size(); hyperNucIter++) { - hyperNucleus* hyperNuc = &(cascadeHyperNuclei.at(hyperNucIter)); + HyperNucleus* hyperNuc = &(cascadeHyperNuclei.at(hyperNucIter)); if (!hyperNuc->active) continue; - int nDaughters = hyperNuc->GetNdaughters(); + int nDaughters = hyperNuc->getNdaughters(); int nHypNucDaughters = singleHyperNucCandidates.at(hyperNuc->daughters.at(0)).size(); std::vector vecHypNucDaughers; @@ -706,7 +707,7 @@ struct hypKfRecoTask { // select hypernuclei daughter KFParticle auto hypNucDaughter = &(singleHyperNucCandidates.at(hyperNuc->daughters.at(0)).at(*it[0])); // check for correct signs - int checkSign = hypNucDaughter->GetSign(); + int checkSign = hypNucDaughter->getSign(); bool passedChecks = true; std::vector vec = hypNucDaughter->daughterTrackIds; for (int i = 1; i < nDaughters; i++) { @@ -726,32 +727,32 @@ struct hypKfRecoTask { const auto& daughterTrack = tracks.rawIteratorAt(*(it[i])); auto daughterMass = daughterParticles.at(hyperNuc->daughters.at(i)).mass; auto daughterCharge = daughterParticles.at(hyperNuc->daughters.at(i)).charge; - daughterKfps.push_back(CreateKFParticle(daughterTrack, daughterMass, daughterCharge)); + daughterKfps.push_back(createKFParticle(daughterTrack, daughterMass, daughterCharge)); } - hyperNucCandidate candidate(hyperNucIter, hypNucDaughter, daughterKfps, daughterIds); - if (candidate.CheckKfp()) { - hypNucDaughter->CalcDevToVtx(candidate); + HyperNucCandidate candidate(hyperNucIter, hypNucDaughter, daughterKfps, daughterIds); + if (candidate.checkKfp()) { + hypNucDaughter->calcDevToVtx(candidate); bool isCandidate = true; // apply pre selections for hypernucleus daughter - if (hypNucDaughter->GetCpa(candidate.recoSV) < cfgPreSelectionsSecondaries->get(hyperNuc->daughters.at(0), "minCosPaSv")) + if (hypNucDaughter->getCpa(candidate.recoSV) < cfgPreSelectionsSecondaries->get(hyperNuc->daughters.at(0), "minCosPaSv")) isCandidate = false; - if (hypNucDaughter->GetDcaMotherToVtxXY(candidate.recoSV) > cfgPreSelectionsSecondaries->get(hyperNuc->daughters.at(0), "maxDcaMotherToSvXY")) + if (hypNucDaughter->getDcaMotherToVtxXY(candidate.recoSV) > cfgPreSelectionsSecondaries->get(hyperNuc->daughters.at(0), "maxDcaMotherToSvXY")) isCandidate = false; - if (hypNucDaughter->GetDcaMotherToVtxZ(candidate.recoSV) > cfgPreSelectionsSecondaries->get(hyperNuc->daughters.at(0), "maxDcaMotherToSvZ")) + if (hypNucDaughter->getDcaMotherToVtxZ(candidate.recoSV) > cfgPreSelectionsSecondaries->get(hyperNuc->daughters.at(0), "maxDcaMotherToSvZ")) isCandidate = false; // apply pre selections for cascade if (candidate.kfp.GetMass() < cfgPreSelectionsCascades->get(hyperNucIter, "minMass") || candidate.kfp.GetMass() > cfgPreSelectionsCascades->get(hyperNucIter, "maxMass")) isCandidate = false; - if (candidate.GetDcaTracks() > cfgPreSelectionsCascades->get(hyperNucIter, "maxDcaTracks")) + if (candidate.getDcaTracks() > cfgPreSelectionsCascades->get(hyperNucIter, "maxDcaTracks")) isCandidate = false; - if (candidate.GetCt(primVtx) < cfgPreSelectionsCascades->get(hyperNucIter, "minCt") || candidate.GetCt(primVtx) > cfgPreSelectionsCascades->get(hyperNucIter, "maxCt")) + if (candidate.getCt(primVtx) < cfgPreSelectionsCascades->get(hyperNucIter, "minCt") || candidate.getCt(primVtx) > cfgPreSelectionsCascades->get(hyperNucIter, "maxCt")) isCandidate = false; - if (candidate.GetCpa(primVtx) < cfgPreSelectionsCascades->get(hyperNucIter, "minCosPa")) + if (candidate.getCpa(primVtx) < cfgPreSelectionsCascades->get(hyperNucIter, "minCosPa")) isCandidate = false; - if (candidate.GetDcaMotherToVtxXY(primVtx) > cfgPreSelectionsCascades->get(hyperNucIter, "maxDcaMotherToPvXY")) + if (std::abs(candidate.getDcaMotherToVtxXY(primVtx)) > cfgPreSelectionsCascades->get(hyperNucIter, "maxDcaMotherToPvXY")) isCandidate = false; - if (candidate.GetDcaMotherToVtxZ(primVtx) > cfgPreSelectionsCascades->get(hyperNucIter, "maxDcaMotherToPvZ")) + if (std::abs(candidate.getDcaMotherToVtxZ(primVtx)) > cfgPreSelectionsCascades->get(hyperNucIter, "maxDcaMotherToPvZ")) isCandidate = false; if (isCandidate) { @@ -774,34 +775,34 @@ struct hypKfRecoTask { { // check for mcTrue: single (primary & cascade daughter) and cascade hypernuclei - std::vector*> hypNucVectors = {&singleHyperNuclei, &cascadeHyperNuclei}; - std::vector>*> candidateVectors = {&singleHyperNucCandidates, &cascadeHyperNucCandidates}; + std::vector*> hypNucVectors = {&singleHyperNuclei, &cascadeHyperNuclei}; + std::vector>*> candidateVectors = {&singleHyperNucCandidates, &cascadeHyperNucCandidates}; const int nVecs = candidateVectors.size(); - - for (int vec = cascadesOnly ? 1 : 0; vec < nVecs; vec++) { + const int startVec = cascadesOnly ? 1 : 0; + for (int vec = startVec; vec < nVecs; vec++) { auto candidateVector = candidateVectors.at(vec); for (size_t hyperNucIter = 0; hyperNucIter < hypNucVectors.at(vec)->size(); hyperNucIter++) { - hyperNucleus* hyperNuc = &(hypNucVectors.at(vec)->at(hyperNucIter)); + HyperNucleus* hyperNuc = &(hypNucVectors.at(vec)->at(hyperNucIter)); if (!hyperNuc->active) continue; - for (auto& hypCand : candidateVector->at(hyperNucIter)) { + for (auto& hypCand : candidateVector->at(hyperNucIter)) { // o2-linter: disable=[const-ref-in-for-loop] std::vector motherIds; int daughterCount = 0; - if (hypCand.IsCascade()) { + if (hypCand.isCascade()) { if (!hypCand.hypNucDaughter->mcTrue) continue; const auto& mcPart = particlesMC.rawIteratorAt(hypCand.hypNucDaughter->mcParticleId); if (!mcPart.has_mothers()) continue; daughterCount++; - for (auto& mother : mcPart.mothers_as()) { - if (mother.pdgCode() == hyperNuc->pdgCode * hypCand.GetSign()) { + for (const auto& mother : mcPart.mothers_as()) { + if (mother.pdgCode() == hyperNuc->pdgCode * hypCand.getSign()) { motherIds.push_back(mother.globalIndex()); break; } } } - for (auto& daughter : hypCand.daughterTrackIds) { + for (const auto& daughter : hypCand.daughterTrackIds) { const auto& mcLab = trackLabels.rawIteratorAt(daughter); if (!mcLab.has_mcParticle()) continue; @@ -810,8 +811,8 @@ struct hypKfRecoTask { continue; if (!mcPart.has_mothers()) continue; - for (auto& mother : mcPart.mothers_as()) { - if (mother.pdgCode() == hyperNuc->pdgCode * hypCand.GetSign()) { + for (const auto& mother : mcPart.mothers_as()) { + if (mother.pdgCode() == hyperNuc->pdgCode * hypCand.getSign()) { motherIds.push_back(mother.globalIndex()); break; } @@ -844,34 +845,34 @@ struct hypKfRecoTask { outputCollisionTable( collPassedEvSel, mcCollTableIndex, primVtx.at(0), primVtx.at(1), primVtx.at(2), - cents.at(0), cents.at(1), cents.at(2)); + cents.at(0), cents.at(1), cents.at(2), occupancy); - std::vector*> hypNucVectors = {&singleHyperNuclei, &cascadeHyperNuclei}; - std::vector>*> candidateVectors = {&singleHyperNucCandidates, &cascadeHyperNucCandidates}; + std::vector*> hypNucVectors = {&singleHyperNuclei, &cascadeHyperNuclei}; + std::vector>*> candidateVectors = {&singleHyperNucCandidates, &cascadeHyperNucCandidates}; for (int vec = 0; vec < 2; vec++) { auto candidateVector = candidateVectors.at(vec); for (size_t hyperNucIter = 0; hyperNucIter < hypNucVectors.at(vec)->size(); hyperNucIter++) { - hyperNucleus* hyperNuc = &(hypNucVectors.at(vec)->at(hyperNucIter)); + HyperNucleus* hyperNuc = &(hypNucVectors.at(vec)->at(hyperNucIter)); if (!hyperNuc->active) continue; - for (auto& hypCand : candidateVector->at(hyperNucIter)) { - if (!hypCand.isPrimaryCandidate && !hypCand.isUsedSecondary && !hypCand.IsCascade()) + for (auto& hypCand : candidateVector->at(hyperNucIter)) { // o2-linter: disable=[const-ref-in-for-loop] + if (!hypCand.isPrimaryCandidate && !hypCand.isUsedSecondary && !hypCand.isCascade()) continue; if (saveOnlyMcTrue && !hypCand.mcTrue) continue; hInvMass[vec * nHyperNuclei + hyperNucIter]->Fill(hypCand.kfp.GetMass()); std::vector vecDaugtherTracks, vecAddons, vecSubDaughters; int daughterCount = 0; - for (auto daughterTrackId : hypCand.daughterTrackIds) { + for (const auto& daughterTrackId : hypCand.daughterTrackIds) { int trackTableId; - if (!trackIndices.GetIndex(daughterTrackId, trackTableId)) { + if (!trackIndices.getIndex(daughterTrackId, trackTableId)) { auto daught = hyperNuc->daughters.at(daughterCount); const auto& track = tracks.rawIteratorAt(daughterTrackId); outputTrackTable( hyperNuc->daughters.at(daughterCount) * track.sign(), track.pt(), track.eta(), track.phi(), - track.dcaXY(), track.dcaZ(), + hypCand.getDcaTrackToVtxXY(daughterCount, primVtx), hypCand.getDcaTrackToVtxZ(daughterCount, primVtx), track.tpcNClsFound(), track.tpcChi2NCl(), track.itsClusterSizes(), track.itsChi2NCl(), getRigidity(track), track.tpcSignal(), getTPCnSigma(track, daughterParticles.at(daught)), @@ -880,22 +881,22 @@ struct hypKfRecoTask { track.mass(), track.isPVContributor()); trackTableId = outputTrackTable.lastIndex(); - trackIndices.Add(daughterTrackId, trackTableId); + trackIndices.add(daughterTrackId, trackTableId); } vecDaugtherTracks.push_back(trackTableId); daughterCount++; } - for (int i = 0; i < hypCand.GetNdaughters(); i++) { + for (int i = 0; i < hypCand.getNdaughters(); i++) { std::vector posMom; - hypCand.GetDaughterPosMom(i, posMom); + hypCand.getDaughterPosMom(i, posMom); outputDaughterAddonTable( posMom.at(0), posMom.at(1), posMom.at(2), posMom.at(3), posMom.at(4), posMom.at(5)); vecAddons.push_back(outputDaughterAddonTable.lastIndex()); } - if (hypCand.GetNdaughters() > 2) { - for (int i = 0; i < hypCand.GetNdaughters(); i++) { - for (int j = i + 1; j < hypCand.GetNdaughters(); j++) { - outputSubDaughterTable(hypCand.GetSubDaughterMass(i, j)); + if (hypCand.getNdaughters() > 2) { + for (int i = 0; i < hypCand.getNdaughters(); i++) { + for (int j = i + 1; j < hypCand.getNdaughters(); j++) { + outputSubDaughterTable(hypCand.getSubDaughterMass(i, j)); vecSubDaughters.push_back(outputSubDaughterTable.lastIndex()); } } @@ -904,12 +905,12 @@ struct hypKfRecoTask { hypCand.kfp.TransportToDecayVertex(); int mcPartTableId; outputHypNucTable( - mcPartIndices.GetIndex(hypCand.mcParticleId, mcPartTableId) ? mcPartTableId : -1, - outputCollisionTable.lastIndex(), vecDaugtherTracks, vecAddons, hypCand.GetDaughterTableId(), vecSubDaughters, - (vec * nHyperNuclei + hyperNucIter + 1) * hypCand.GetSign(), + mcPartIndices.getIndex(hypCand.mcParticleId, mcPartTableId) ? mcPartTableId : -1, + outputCollisionTable.lastIndex(), vecDaugtherTracks, vecAddons, hypCand.getDaughterTableId(), vecSubDaughters, + (vec * nHyperNuclei + hyperNucIter + 1) * hypCand.getSign(), hypCand.isPrimaryCandidate, hypCand.kfp.GetMass(), hypCand.kfp.GetPx(), hypCand.kfp.GetPy(), hypCand.kfp.GetPz(), - hypCand.GetDcaMotherToVtxXY(primVtx), hypCand.GetDcaMotherToVtxZ(primVtx), + hypCand.getDcaMotherToVtxXY(primVtx), hypCand.getDcaMotherToVtxZ(primVtx), hypCand.devToVtx, hypCand.dcaToVtxXY, hypCand.dcaToVtxZ, hypCand.chi2, hypCand.recoSV.at(0), hypCand.recoSV.at(1), hypCand.recoSV.at(2)); hypCand.tableId = outputHypNucTable.lastIndex(); @@ -924,18 +925,18 @@ struct hypKfRecoTask { mcCollInfos.clear(); mcCollInfos.resize(mcColls.size()); - mcPartIndices.Clear(); + mcPartIndices.clear(); for (const auto& collision : collisions) { if (!collision.has_mcCollision()) continue; if (collision.sel8() && std::abs(collision.posZ()) < 10) mcCollInfos.at(collision.mcCollisionId()).passedEvSel = true; } - std::vector*> hypNucVectors = {&singleHyperNuclei, &cascadeHyperNuclei}; - for (auto& mcPart : particlesMC) { + std::vector*> hypNucVectors = {&singleHyperNuclei, &cascadeHyperNuclei}; + for (const auto& mcPart : particlesMC) { for (int vec = 0; vec < 2; vec++) { for (size_t hyperNucIter = 0; hyperNucIter < hypNucVectors.at(vec)->size(); hyperNucIter++) { - hyperNucleus* hyperNuc = &(hypNucVectors.at(vec)->at(hyperNucIter)); + HyperNucleus* hyperNuc = &(hypNucVectors.at(vec)->at(hyperNucIter)); if (!hyperNuc->active) continue; if (std::abs(mcPart.pdgCode()) != hyperNuc->pdgCode) @@ -947,7 +948,7 @@ struct hypKfRecoTask { daughterPdg = daughterParticles.at(hyperNuc->daughters.at(0)).pdgCode; else daughterPdg = singleHyperNuclei.at(hyperNuc->daughters.at(0)).pdgCode; - for (auto& mcDaught : mcPart.daughters_as()) { + for (const auto& mcDaught : mcPart.daughters_as()) { if (std::abs(mcDaught.pdgCode()) == daughterPdg) { isDecayMode = true; svx = mcDaught.vx(); @@ -974,7 +975,7 @@ struct hypKfRecoTask { mcPart.px(), mcPart.py(), mcPart.pz(), mcPart.e(), svx, svy, svz); - mcPartIndices.Add(mcPart.globalIndex(), outputMcParticleTable.lastIndex()); + mcPartIndices.add(mcPart.globalIndex(), outputMcParticleTable.lastIndex()); } } } @@ -1012,7 +1013,7 @@ struct hypKfRecoTask { fillTree(tracks, cfgSaveOnlyMcTrue); } } - PROCESS_SWITCH(hypKfRecoTask, processMC, "MC analysis", true); + PROCESS_SWITCH(hypKfRecoTask, processMC, "MC analysis", false); //---------------------------------------------------------------------------------------------------------------- void processData(CollisionsFull const& collisions, TracksFull const& tracks, aod::BCsWithTimestamps const&, aod::TrackAssoc const& tracksColl) { @@ -1021,6 +1022,8 @@ struct hypKfRecoTask { auto bc = collision.bc_as(); initCCDB(bc); initCollision(collision); + if (!collPassedEvSel) + continue; const uint64_t collIdx = collision.globalIndex(); auto tracksByColl = tracksColl.sliceBy(perCollision, collIdx); findDaughterParticles(tracksByColl, tracks); @@ -1032,42 +1035,42 @@ struct hypKfRecoTask { fillTree(tracks); } } - PROCESS_SWITCH(hypKfRecoTask, processData, "data analysis", false); + PROCESS_SWITCH(hypKfRecoTask, processData, "data analysis", true); //---------------------------------------------------------------------------------------------------------------- void initCCDB(aod::BCsWithTimestamps::iterator const& bc) { if (mRunNumber == bc.runNumber()) { return; } - auto run3grp_timestamp = bc.timestamp(); - d_bz = 0; - o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(grpPath, run3grp_timestamp); + auto run3grpTimestamp = bc.timestamp(); + dBz = 0; + o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp(grpPath, run3grpTimestamp); o2::parameters::GRPMagField* grpmag = 0x0; if (grpo) { o2::base::Propagator::initFieldFromGRP(grpo); - if (d_bz_input < -990) { + if (bField < -990) { // Fetch magnetic field from ccdb for current collision - d_bz = grpo->getNominalL3Field(); - LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; + dBz = grpo->getNominalL3Field(); + LOG(info) << "Retrieved GRP for timestamp " << run3grpTimestamp << " with magnetic field of " << dBz << " kZG"; } else { - d_bz = d_bz_input; + dBz = bField; } } else { - grpmag = ccdb->getForTimeStamp(grpmagPath, run3grp_timestamp); + grpmag = ccdb->getForTimeStamp(grpmagPath, run3grpTimestamp); if (!grpmag) { - LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp; + LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grpTimestamp; } o2::base::Propagator::initFieldFromGRP(grpmag); - if (d_bz_input < -990) { + if (bField < -990) { // Fetch magnetic field from ccdb for current collision - d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f); - LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG"; + dBz = std::lround(5.f * grpmag->getL3Current() / 30000.f); + LOG(info) << "Retrieved GRP for timestamp " << run3grpTimestamp << " with magnetic field of " << dBz << " kZG"; } else { - d_bz = d_bz_input; + dBz = bField; } } mRunNumber = bc.runNumber(); - KFParticle::SetField(d_bz); + KFParticle::SetField(dBz); } //---------------------------------------------------------------------------------------------------------------- template @@ -1079,17 +1082,21 @@ struct hypKfRecoTask { singleHyperNucCandidates.resize(nHyperNuclei); cascadeHyperNucCandidates.clear(); cascadeHyperNucCandidates.resize(nCascades); - trackIndices.Clear(); + trackIndices.clear(); collHasCandidate = false; collHasMcTrueCandidate = false; - histos.fill(HIST("histMagField"), d_bz); + histos.fill(HIST("histMagField"), dBz); histos.fill(HIST("histNev"), 0.5); - collPassedEvSel = collision.sel8() && std::abs(collision.posZ()) < 10; - if (collPassedEvSel) + if (collPassedEvSel) { histos.fill(HIST("histNev"), 1.5); - - KfPrimVtx = createKFPVertexFromCollision(collision); + histos.fill(HIST("histVtxZ"), collision.posZ()); + histos.fill(HIST("histCentFT0A"), collision.centFT0A()); + histos.fill(HIST("histCentFT0C"), collision.centFT0C()); + histos.fill(HIST("histCentFT0M"), collision.centFT0M()); + } + occupancy = collision.trackOccupancyInTimeRange(); + kfPrimVtx = createKFPVertexFromCollision(collision); primVtx.assign({collision.posX(), collision.posY(), collision.posZ()}); cents.assign({collision.centFT0A(), collision.centFT0C(), collision.centFT0M()}); } @@ -1107,7 +1114,7 @@ struct hypKfRecoTask { //---------------------------------------------------------------------------------------------------------------- template - float getTPCnSigma(T const& track, daughterParticle const& particle) + float getTPCnSigma(T const& track, DaughterParticle const& particle) { const float rigidity = getRigidity(track); if (!track.hasTPC()) @@ -1132,7 +1139,18 @@ struct hypKfRecoTask { return sigmaTPC; } //---------------------------------------------------------------------------------------------------------------- - + template + float getMeanItsClsSize(T const& track) + { + int sum = 0, n = 0; + for (int i = 0; i < 8; i++) { + sum += (track.itsClusterSizes() >> (4 * i) & 15); + if (track.itsClusterSizes() >> (4 * i) & 15) + n++; + } + return n > 0 ? static_cast(sum) / n : 0.f; + } + //---------------------------------------------------------------------------------------------------------------- template float getRigidity(T const& track) { @@ -1144,7 +1162,7 @@ struct hypKfRecoTask { //---------------------------------------------------------------------------------------------------------------- template - KFParticle CreateKFParticle(const T& track, float mass, int charge) + KFParticle createKFParticle(const T& track, float mass, int charge) { auto trackparCov = getTrackParCov(track); std::array fP; diff --git a/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx b/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx index 948cd62ac92..1eea2943112 100644 --- a/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx +++ b/PWGLF/TableProducer/Nuspex/hypKfTreeCreator.cxx @@ -9,8 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// +/// \file hypKfTreeCreator.cxx /// \brief Creates flat tree for ML analysis -/// \authors Janik Ditzel and Michael Hartung +/// \author Janik Ditzel and Michael Hartung #include #include "Framework/runDataProcessing.h" @@ -43,35 +44,35 @@ namespace { std::vector> hPt; -struct trackProperties { - trackProperties() : X(0), Y(0), Z(0), Px(0), Py(0), Pz(0), TPCnCls(0), ITSnCls(0), TPCchi2(0), ITSchi2(0), ITSmeanClsSize(0), ITSmeanClsSizeL(0), Rigidity(0), TPCsignal(0), TPCnSigma(0), TPCnSigmaNhp(0), TPCnSigmaNlp(0), TOFmass(0), DcaXY(0), DcaZ(0), IsPvContributor(0), SubMass(0) {} - float X, Y, Z, Px, Py, Pz; - uint8_t TPCnCls, ITSnCls; - float TPCchi2, ITSchi2, ITSmeanClsSize, ITSmeanClsSizeL; - float Rigidity, TPCsignal, TPCnSigma, TPCnSigmaNhp, TPCnSigmaNlp; - float TOFmass, DcaXY, DcaZ; - bool IsPvContributor; - float SubMass; +struct TrackProperties { + TrackProperties() : x(0), y(0), z(0), px(0), py(0), pz(0), tpcNcls(0), itsNcls(0), tpcChi2(0), itsChi2(0), itsMeanClsSize(0), itsMeanClsSizeL(0), rigidity(0), tpcSignal(0), tpcNsigma(0), tpcNsigmaNhp(0), tpcNsigmaNlp(0), tofMass(0), dcaXY(0), dcaZ(0), isPvContributor(0), subMass(0) {} + float x, y, z, px, py, pz; + uint8_t tpcNcls, itsNcls; + float tpcChi2, itsChi2, itsMeanClsSize, itsMeanClsSizeL; + float rigidity, tpcSignal, tpcNsigma, tpcNsigmaNhp, tpcNsigmaNlp; + float tofMass, dcaXY, dcaZ; + bool isPvContributor; + float subMass; }; -struct hyperNucleus { - hyperNucleus() : PdgCode(0), IsReconstructed(0), GlobalIndex(0), Species(0), IsMatter(0), PassedEvSel(0), IsMatterMC(0), PassedEvSelMC(0), IsPhysicalPrimary(0), CollisionMcTrue(0), Mass(0), Y(0), Pt(0), Ct(0), YGen(0), PtGen(0), CtGen(0), CpaPvGen(0), CpaPv(0), CpaSv(0), MaxDcaTracks(0), MaxDcaTracksSV(0), DcaToPvXY(0), DcaToPvZ(0), DcaToVtxXY(0), DcaToVtxZ(0), DevToPvXY(0), Chi2(0), Pvx(0), Pvy(0), Pvz(0), Svx(0), Svy(0), Svz(0), Px(0), Py(0), Pz(0), PvxGen(0), PvyGen(0), PvzGen(0), SvxGen(0), SvyGen(0), SvzGen(0), PxGen(0), PyGen(0), PzGen(0), NsingleDaughters(0), NcascadeDaughters(0), McTrue(0), MCTrueVtx(0), McPhysicalPrimary(0), HypNucDaughter(0) {} - int PdgCode, IsReconstructed, GlobalIndex; - uint8_t Species; - bool IsMatter, PassedEvSel, IsMatterMC, PassedEvSelMC, IsPhysicalPrimary, CollisionMcTrue; - float Mass, Y, Pt, Ct, YGen, PtGen, CtGen, CpaPvGen, CpaPv, CpaSv, MaxDcaTracks, MaxDcaTracksSV; - float DcaToPvXY, DcaToPvZ, DcaToVtxXY, DcaToVtxZ, DevToPvXY, Chi2; - float Pvx, Pvy, Pvz, Svx, Svy, Svz, Px, Py, Pz; - float PvxGen, PvyGen, PvzGen, SvxGen, SvyGen, SvzGen, PxGen, PyGen, PzGen; - int NsingleDaughters, NcascadeDaughters; - bool McTrue, MCTrueVtx, McPhysicalPrimary; - std::vector daughterTracks; +struct HyperNucleus { + HyperNucleus() : pdgCode(0), isReconstructed(0), globalIndex(0), species(0), isMatter(0), passedEvSel(0), isMatterMC(0), passedEvSelMC(0), isPhysicalPrimary(0), collisionMcTrue(0), mass(0), y(0), pt(0), ct(0), yGen(0), ptGen(0), ctGen(0), cpaPvGen(0), cpaPv(0), cpaSv(0), maxDcaTracks(0), maxDcaTracksSV(0), dcaToPvXY(0), dcaToPvZ(0), dcaToVtxXY(0), dcaToVtxZ(0), devToPvXY(0), chi2(0), pvx(0), pvy(0), pvz(0), svx(0), svy(0), svz(0), px(0), py(0), pz(0), pvxGen(0), pvyGen(0), pvzGen(0), svxGen(0), svyGen(0), svzGen(0), pxGen(0), pyGen(0), pzGen(0), nSingleDaughters(0), nCascadeDaughters(0), mcTrue(0), mcTrueVtx(0), mcPhysicalPrimary(0), hypNucDaughter(0) {} + int pdgCode, isReconstructed, globalIndex; + uint8_t species; + bool isMatter, passedEvSel, isMatterMC, passedEvSelMC, isPhysicalPrimary, collisionMcTrue; + float mass, y, pt, ct, yGen, ptGen, ctGen, cpaPvGen, cpaPv, cpaSv, maxDcaTracks, maxDcaTracksSV; + float dcaToPvXY, dcaToPvZ, dcaToVtxXY, dcaToVtxZ, devToPvXY, chi2; + float pvx, pvy, pvz, svx, svy, svz, px, py, pz; + float pvxGen, pvyGen, pvzGen, svxGen, svyGen, svzGen, pxGen, pyGen, pzGen; + int nSingleDaughters, nCascadeDaughters, cent, occu; + bool mcTrue, mcTrueVtx, mcPhysicalPrimary; + std::vector daughterTracks; std::vector subDaughterMassVec; - hyperNucleus* HypNucDaughter; - ~hyperNucleus() + HyperNucleus* hypNucDaughter; + ~HyperNucleus() { - if (HypNucDaughter) - delete HypNucDaughter; + if (hypNucDaughter) + delete hypNucDaughter; } }; } // namespace @@ -107,6 +108,8 @@ DECLARE_SOA_COLUMN(SvzGen, svzGen, float); DECLARE_SOA_COLUMN(TvxGen, tvxGen, float); DECLARE_SOA_COLUMN(TvyGen, tvyGen, float); DECLARE_SOA_COLUMN(TvzGen, tvzGen, float); +DECLARE_SOA_COLUMN(Centrality, centrality, int); +DECLARE_SOA_COLUMN(Occupancy, occupancy, int); DECLARE_SOA_COLUMN(PassedEvSelMC, passedEvSelMC, bool); DECLARE_SOA_COLUMN(IsMatter, isMatter, bool); DECLARE_SOA_COLUMN(IsMatterGen, isMatterGen, bool); @@ -174,9 +177,9 @@ DECLARE_SOA_COLUMN(D3TPCnSigmaNlp, d3TPCnSigmaNlp, float); DECLARE_SOA_COLUMN(D3TOFmass, d3TOFmass, float); DECLARE_SOA_COLUMN(D3DcaXY, d3DcaXY, float); DECLARE_SOA_COLUMN(D3DcaZ, d3DcaZ, float); -DECLARE_SOA_COLUMN(D1D2Mass, d1d2Mass, float); -DECLARE_SOA_COLUMN(D1D3Mass, d1d3Mass, float); -DECLARE_SOA_COLUMN(D2D3Mass, d2d3Mass, float); +DECLARE_SOA_COLUMN(D1d2Mass, d1d2Mass, float); +DECLARE_SOA_COLUMN(D1d3Mass, d1d3Mass, float); +DECLARE_SOA_COLUMN(D2d3Mass, d2d3Mass, float); DECLARE_SOA_COLUMN(D3IsPvContributor, d3IsPvContributor, bool); DECLARE_SOA_COLUMN(D0X, d0X, float); DECLARE_SOA_COLUMN(D0Y, d0Y, float); @@ -185,81 +188,81 @@ DECLARE_SOA_COLUMN(D0Px, d0Px, float); DECLARE_SOA_COLUMN(D0Py, d0Py, float); DECLARE_SOA_COLUMN(D0Pz, d0Pz, float); DECLARE_SOA_COLUMN(D0Mass, d0Mass, float); -DECLARE_SOA_COLUMN(D0Ct, d0ct, float); -DECLARE_SOA_COLUMN(D0CosPA, d0cosPa, float); -DECLARE_SOA_COLUMN(D0DcaTracks, d0dcaTracks, float); -DECLARE_SOA_COLUMN(D0DcaTracksTv, d0dcaTracksTv, float); -DECLARE_SOA_COLUMN(D0DcaToPvXY, d0dcaToPvXY, float); -DECLARE_SOA_COLUMN(D0DcaToPvZ, d0dcaToPvZ, float); -DECLARE_SOA_COLUMN(D0DcaToSvXY, d0dcaToSvXY, float); -DECLARE_SOA_COLUMN(D0DcaToSvZ, d0dcaToSvZ, float); -DECLARE_SOA_COLUMN(D0Chi2, d0chi2, float); -DECLARE_SOA_COLUMN(SD1X, sd1X, float); -DECLARE_SOA_COLUMN(SD1Y, sd1Y, float); -DECLARE_SOA_COLUMN(SD1Z, sd1Z, float); -DECLARE_SOA_COLUMN(SD1Px, sd1Px, float); -DECLARE_SOA_COLUMN(SD1Py, sd1Py, float); -DECLARE_SOA_COLUMN(SD1Pz, sd1Pz, float); -DECLARE_SOA_COLUMN(SD1TPCnCls, sd1TPCnCls, uint8_t); -DECLARE_SOA_COLUMN(SD1TPCchi2, sd1TPCchi2, float); -DECLARE_SOA_COLUMN(SD1ITSnCls, sd1ITSnCls, uint8_t); -DECLARE_SOA_COLUMN(SD1ITSchi2, sd1ITSchi2, float); -DECLARE_SOA_COLUMN(SD1ITSmeanClsSize, sd1ITSmeanClsSize, float); -DECLARE_SOA_COLUMN(SD1ITSmeanClsSizeL, sd1ITSmeanClsSizeL, float); -DECLARE_SOA_COLUMN(SD1Rigidity, sd1Rigidity, float); -DECLARE_SOA_COLUMN(SD1TPCsignal, sd1TPCsignal, float); -DECLARE_SOA_COLUMN(SD1TPCnSigma, sd1TPCnSigma, float); -DECLARE_SOA_COLUMN(SD1TPCnSigmaNhp, sd1TPCnSigmaNhp, float); -DECLARE_SOA_COLUMN(SD1TPCnSigmaNlp, sd1TPCnSigmaNlp, float); -DECLARE_SOA_COLUMN(SD1TOFmass, sd1TOFmass, float); -DECLARE_SOA_COLUMN(SD1DcaXY, sd1DcaXY, float); -DECLARE_SOA_COLUMN(SD1DcaZ, sd1DcaZ, float); -DECLARE_SOA_COLUMN(SD1IsPvContributor, sd1IsPvContributor, bool); -DECLARE_SOA_COLUMN(SD2X, sd2X, float); -DECLARE_SOA_COLUMN(SD2Y, sd2Y, float); -DECLARE_SOA_COLUMN(SD2Z, sd2Z, float); -DECLARE_SOA_COLUMN(SD2Px, sd2Px, float); -DECLARE_SOA_COLUMN(SD2Py, sd2Py, float); -DECLARE_SOA_COLUMN(SD2Pz, sd2Pz, float); -DECLARE_SOA_COLUMN(SD2TPCnCls, sd2TPCnCls, uint8_t); -DECLARE_SOA_COLUMN(SD2TPCchi2, sd2TPCchi2, float); -DECLARE_SOA_COLUMN(SD2ITSnCls, sd2ITSnCls, uint8_t); -DECLARE_SOA_COLUMN(SD2ITSchi2, sd2ITSchi2, float); -DECLARE_SOA_COLUMN(SD2ITSmeanClsSize, sd2ITSmeanClsSize, float); -DECLARE_SOA_COLUMN(SD2ITSmeanClsSizeL, sd2ITSmeanClsSizeL, float); -DECLARE_SOA_COLUMN(SD2Rigidity, sd2Rigidity, float); -DECLARE_SOA_COLUMN(SD2TPCsignal, sd2TPCsignal, float); -DECLARE_SOA_COLUMN(SD2TPCnSigma, sd2TPCnSigma, float); -DECLARE_SOA_COLUMN(SD2TPCnSigmaNhp, sd2TPCnSigmaNhp, float); -DECLARE_SOA_COLUMN(SD2TPCnSigmaNlp, sd2TPCnSigmaNlp, float); -DECLARE_SOA_COLUMN(SD2TOFmass, sd2TOFmass, float); -DECLARE_SOA_COLUMN(SD2DcaXY, sd2DcaXY, float); -DECLARE_SOA_COLUMN(SD2DcaZ, sd2DcaZ, float); -DECLARE_SOA_COLUMN(SD2IsPvContributor, sd2IsPvContributor, bool); -DECLARE_SOA_COLUMN(SD3X, sd3X, float); -DECLARE_SOA_COLUMN(SD3Y, sd3Y, float); -DECLARE_SOA_COLUMN(SD3Z, sd3Z, float); -DECLARE_SOA_COLUMN(SD3Px, sd3Px, float); -DECLARE_SOA_COLUMN(SD3Py, sd3Py, float); -DECLARE_SOA_COLUMN(SD3Pz, sd3Pz, float); -DECLARE_SOA_COLUMN(SD3TPCnCls, sd3TPCnCls, uint8_t); -DECLARE_SOA_COLUMN(SD3TPCchi2, sd3TPCchi2, float); -DECLARE_SOA_COLUMN(SD3ITSnCls, sd3ITSnCls, uint8_t); -DECLARE_SOA_COLUMN(SD3ITSchi2, sd3ITSchi2, float); -DECLARE_SOA_COLUMN(SD3ITSmeanClsSize, sd3ITSmeanClsSize, float); -DECLARE_SOA_COLUMN(SD3ITSmeanClsSizeL, sd3ITSmeanClsSizeL, float); -DECLARE_SOA_COLUMN(SD3Rigidity, sd3Rigidity, float); -DECLARE_SOA_COLUMN(SD3TPCsignal, sd3TPCsignal, float); -DECLARE_SOA_COLUMN(SD3TPCnSigma, sd3TPCnSigma, float); -DECLARE_SOA_COLUMN(SD3TPCnSigmaNhp, sd3TPCnSigmaNhp, float); -DECLARE_SOA_COLUMN(SD3TPCnSigmaNlp, sd3TPCnSigmaNlp, float); -DECLARE_SOA_COLUMN(SD3TOFmass, sd3TOFmass, float); -DECLARE_SOA_COLUMN(SD3DcaXY, sd3DcaXY, float); -DECLARE_SOA_COLUMN(SD3DcaZ, sd3DcaZ, float); -DECLARE_SOA_COLUMN(SD3IsPvContributor, sd3IsPvContributor, bool); -DECLARE_SOA_COLUMN(SD1SD2Mass, sd1sd2Mass, float); -DECLARE_SOA_COLUMN(SD1SD3Mass, sd1sd3Mass, float); -DECLARE_SOA_COLUMN(SD2SD3Mass, sd2sd3Mass, float); +DECLARE_SOA_COLUMN(D0ct, d0ct, float); +DECLARE_SOA_COLUMN(D0cosPa, d0cosPa, float); +DECLARE_SOA_COLUMN(D0dcaTracks, d0dcaTracks, float); +DECLARE_SOA_COLUMN(D0dcaTracksTv, d0dcaTracksTv, float); +DECLARE_SOA_COLUMN(D0dcaToPvXY, d0dcaToPvXY, float); +DECLARE_SOA_COLUMN(D0dcaToPvZ, d0dcaToPvZ, float); +DECLARE_SOA_COLUMN(D0dcaToSvXY, d0dcaToSvXY, float); +DECLARE_SOA_COLUMN(D0dcaToSvZ, d0dcaToSvZ, float); +DECLARE_SOA_COLUMN(D0chi2, d0chi2, float); +DECLARE_SOA_COLUMN(Sd1X, sd1X, float); +DECLARE_SOA_COLUMN(Sd1Y, sd1Y, float); +DECLARE_SOA_COLUMN(Sd1Z, sd1Z, float); +DECLARE_SOA_COLUMN(Sd1Px, sd1Px, float); +DECLARE_SOA_COLUMN(Sd1Py, sd1Py, float); +DECLARE_SOA_COLUMN(Sd1Pz, sd1Pz, float); +DECLARE_SOA_COLUMN(Sd1TPCnCls, sd1TPCnCls, uint8_t); +DECLARE_SOA_COLUMN(Sd1TPCchi2, sd1TPCchi2, float); +DECLARE_SOA_COLUMN(Sd1ITSnCls, sd1ITSnCls, uint8_t); +DECLARE_SOA_COLUMN(Sd1ITSchi2, sd1ITSchi2, float); +DECLARE_SOA_COLUMN(Sd1ITSmeanClsSize, sd1ITSmeanClsSize, float); +DECLARE_SOA_COLUMN(Sd1ITSmeanClsSizeL, sd1ITSmeanClsSizeL, float); +DECLARE_SOA_COLUMN(Sd1Rigidity, sd1Rigidity, float); +DECLARE_SOA_COLUMN(Sd1TPCsignal, sd1TPCsignal, float); +DECLARE_SOA_COLUMN(Sd1TPCnSigma, sd1TPCnSigma, float); +DECLARE_SOA_COLUMN(Sd1TPCnSigmaNhp, sd1TPCnSigmaNhp, float); +DECLARE_SOA_COLUMN(Sd1TPCnSigmaNlp, sd1TPCnSigmaNlp, float); +DECLARE_SOA_COLUMN(Sd1TOFmass, sd1TOFmass, float); +DECLARE_SOA_COLUMN(Sd1DcaXY, sd1DcaXY, float); +DECLARE_SOA_COLUMN(Sd1DcaZ, sd1DcaZ, float); +DECLARE_SOA_COLUMN(Sd1IsPvContributor, sd1IsPvContributor, bool); +DECLARE_SOA_COLUMN(Sd2X, sd2X, float); +DECLARE_SOA_COLUMN(Sd2Y, sd2Y, float); +DECLARE_SOA_COLUMN(Sd2Z, sd2Z, float); +DECLARE_SOA_COLUMN(Sd2Px, sd2Px, float); +DECLARE_SOA_COLUMN(Sd2Py, sd2Py, float); +DECLARE_SOA_COLUMN(Sd2Pz, sd2Pz, float); +DECLARE_SOA_COLUMN(Sd2TPCnCls, sd2TPCnCls, uint8_t); +DECLARE_SOA_COLUMN(Sd2TPCchi2, sd2TPCchi2, float); +DECLARE_SOA_COLUMN(Sd2ITSnCls, sd2ITSnCls, uint8_t); +DECLARE_SOA_COLUMN(Sd2ITSchi2, sd2ITSchi2, float); +DECLARE_SOA_COLUMN(Sd2ITSmeanClsSize, sd2ITSmeanClsSize, float); +DECLARE_SOA_COLUMN(Sd2ITSmeanClsSizeL, sd2ITSmeanClsSizeL, float); +DECLARE_SOA_COLUMN(Sd2Rigidity, sd2Rigidity, float); +DECLARE_SOA_COLUMN(Sd2TPCsignal, sd2TPCsignal, float); +DECLARE_SOA_COLUMN(Sd2TPCnSigma, sd2TPCnSigma, float); +DECLARE_SOA_COLUMN(Sd2TPCnSigmaNhp, sd2TPCnSigmaNhp, float); +DECLARE_SOA_COLUMN(Sd2TPCnSigmaNlp, sd2TPCnSigmaNlp, float); +DECLARE_SOA_COLUMN(Sd2TOFmass, sd2TOFmass, float); +DECLARE_SOA_COLUMN(Sd2DcaXY, sd2DcaXY, float); +DECLARE_SOA_COLUMN(Sd2DcaZ, sd2DcaZ, float); +DECLARE_SOA_COLUMN(Sd2IsPvContributor, sd2IsPvContributor, bool); +DECLARE_SOA_COLUMN(Sd3X, sd3X, float); +DECLARE_SOA_COLUMN(Sd3Y, sd3Y, float); +DECLARE_SOA_COLUMN(Sd3Z, sd3Z, float); +DECLARE_SOA_COLUMN(Sd3Px, sd3Px, float); +DECLARE_SOA_COLUMN(Sd3Py, sd3Py, float); +DECLARE_SOA_COLUMN(Sd3Pz, sd3Pz, float); +DECLARE_SOA_COLUMN(Sd3TPCnCls, sd3TPCnCls, uint8_t); +DECLARE_SOA_COLUMN(Sd3TPCchi2, sd3TPCchi2, float); +DECLARE_SOA_COLUMN(Sd3ITSnCls, sd3ITSnCls, uint8_t); +DECLARE_SOA_COLUMN(Sd3ITSchi2, sd3ITSchi2, float); +DECLARE_SOA_COLUMN(Sd3ITSmeanClsSize, sd3ITSmeanClsSize, float); +DECLARE_SOA_COLUMN(Sd3ITSmeanClsSizeL, sd3ITSmeanClsSizeL, float); +DECLARE_SOA_COLUMN(Sd3Rigidity, sd3Rigidity, float); +DECLARE_SOA_COLUMN(Sd3TPCsignal, sd3TPCsignal, float); +DECLARE_SOA_COLUMN(Sd3TPCnSigma, sd3TPCnSigma, float); +DECLARE_SOA_COLUMN(Sd3TPCnSigmaNhp, sd3TPCnSigmaNhp, float); +DECLARE_SOA_COLUMN(Sd3TPCnSigmaNlp, sd3TPCnSigmaNlp, float); +DECLARE_SOA_COLUMN(Sd3TOFmass, sd3TOFmass, float); +DECLARE_SOA_COLUMN(Sd3DcaXY, sd3DcaXY, float); +DECLARE_SOA_COLUMN(Sd3DcaZ, sd3DcaZ, float); +DECLARE_SOA_COLUMN(Sd3IsPvContributor, sd3IsPvContributor, bool); +DECLARE_SOA_COLUMN(Sd1sd2Mass, sd1sd2Mass, float); +DECLARE_SOA_COLUMN(Sd1sd3Mass, sd1sd3Mass, float); +DECLARE_SOA_COLUMN(Sd2sd3Mass, sd2sd3Mass, float); } // namespace hypkftree #define HYPKFGENBASE mcparticle::PdgCode, hypkftree::IsMatterGen, hypkftree::IsReconstructed, hykfmc::IsPhysicalPrimary, hypkftree::PassedEvSelMC, hypkftree::YGen, hypkftree::PtGen, hypkftree::CtGen @@ -268,26 +271,26 @@ DECLARE_SOA_COLUMN(SD2SD3Mass, sd2sd3Mass, float); #define HYPKFGENCAS hypkftree::TvxGen, hypkftree::TvyGen, hypkftree::TvzGen -#define HYPKFHYPNUC hykfmc::Species, hypkftree::IsMatter, hykfmcColl::PassedEvSel, hykfhyp::Mass, hypkftree::Y, track::Pt, hypkftree::Ct, hypkftree::CosPa, hypkftree::DcaTracks, hykfhyp::DcaToPvXY, hykfhyp::DcaToPvZ, hykfhyp::DevToPvXY, hykfhyp::Chi2, hypkftree::Pvx, hypkftree::Pvy, hypkftree::Pvz, hykfmc::Svx, hykfmc::Svy, hykfmc::Svz, hykfhyp::Px, hykfhyp::Py, hykfhyp::Pz, hypkftree::CollMcTrue +#define HYPKFHYPNUC hykfmc::Species, hypkftree::IsMatter, hypkftree::Centrality, hypkftree::Occupancy, hykfmccoll::PassedEvSel, hykfhyp::Mass, hypkftree::Y, track::Pt, hypkftree::Ct, hypkftree::CosPa, hypkftree::DcaTracks, hykfhyp::DcaToPvXY, hykfhyp::DcaToPvZ, hykfhyp::DevToPvXY, hykfhyp::Chi2, hypkftree::Pvx, hypkftree::Pvy, hypkftree::Pvz, hykfmc::Svx, hykfmc::Svy, hykfmc::Svz, hykfhyp::Px, hykfhyp::Py, hykfhyp::Pz, hypkftree::CollMcTrue #define HYPKFHYPNUCMC hypkftree::McTrue, hykfmc::IsPhysicalPrimary -#define HYPKFD0 hypkftree::Tvx, hypkftree::Tvy, hypkftree::Tvz, hypkftree::D0X, hypkftree::D0Y, hypkftree::D0Z, hypkftree::D0Px, hypkftree::D0Py, hypkftree::D0Pz, hypkftree::D0Mass, hypkftree::D0Ct, hypkftree::D0CosPA, hypkftree::D0DcaTracks, hypkftree::D0DcaToPvXY, hypkftree::D0DcaToPvZ, hypkftree::D0DcaToSvXY, hypkftree::D0DcaToSvZ, hypkftree::D0Chi2 +#define HYPKFD0 hypkftree::Tvx, hypkftree::Tvy, hypkftree::Tvz, hypkftree::D0X, hypkftree::D0Y, hypkftree::D0Z, hypkftree::D0Px, hypkftree::D0Py, hypkftree::D0Pz, hypkftree::D0Mass, hypkftree::D0ct, hypkftree::D0cosPa, hypkftree::D0dcaTracks, hypkftree::D0dcaToPvXY, hypkftree::D0dcaToPvZ, hypkftree::D0dcaToSvXY, hypkftree::D0dcaToSvZ, hypkftree::D0chi2 -#define HYPKFD1 hypkftree::D1X, hypkftree::D1Y, hypkftree::D1Z, hypkftree::D1Px, hypkftree::D1Py, hypkftree::D1Pz, hypkftree::D1TPCnCls, hypkftree::D1TPCchi2, hypkftree::D1ITSnCls, hypkftree::D1ITSchi2, hypkftree::D1ITSmeanClsSize, hypkftree::D1ITSmeanClsSizeL, hypkftree::D1Rigidity, hypkftree::D1TPCsignal, hypkftree::D1TPCnSigma, hypkftree::D1TPCnSigmaNhp, hypkftree::D1TPCnSigmaNlp, hypkftree::D1TOFmass, hypkftree::D1DcaXY, hypkftree::D1DcaZ, hypkftree::D1IsPvContributor +#define HYPKFD1 hypkftree::D1X, hypkftree::D1Y, hypkftree::D1Z, hypkftree::D1Px, hypkftree::D1Py, hypkftree::D1Pz, hypkftree::D1TPCnCls, hypkftree::D1TPCchi2, hypkftree::D1ITSnCls, hypkftree::D1ITSchi2, hypkftree::D1ITSmeanClsSizeL, hypkftree::D1Rigidity, hypkftree::D1TPCsignal, hypkftree::D1TPCnSigma, hypkftree::D1TPCnSigmaNhp, hypkftree::D1TPCnSigmaNlp, hypkftree::D1TOFmass, hypkftree::D1DcaXY, hypkftree::D1DcaZ, hypkftree::D1IsPvContributor -#define HYPKFD2 hypkftree::D2X, hypkftree::D2Y, hypkftree::D2Z, hypkftree::D2Px, hypkftree::D2Py, hypkftree::D2Pz, hypkftree::D2TPCnCls, hypkftree::D2TPCchi2, hypkftree::D2ITSnCls, hypkftree::D2ITSchi2, hypkftree::D2ITSmeanClsSize, hypkftree::D2ITSmeanClsSizeL, hypkftree::D2Rigidity, hypkftree::D2TPCsignal, hypkftree::D2TPCnSigma, hypkftree::D2TPCnSigmaNhp, hypkftree::D2TPCnSigmaNlp, hypkftree::D2TOFmass, hypkftree::D2DcaXY, hypkftree::D2DcaZ, hypkftree::D2IsPvContributor +#define HYPKFD2 hypkftree::D2X, hypkftree::D2Y, hypkftree::D2Z, hypkftree::D2Px, hypkftree::D2Py, hypkftree::D2Pz, hypkftree::D2TPCnCls, hypkftree::D2TPCchi2, hypkftree::D2ITSnCls, hypkftree::D2ITSchi2, hypkftree::D2ITSmeanClsSizeL, hypkftree::D2Rigidity, hypkftree::D2TPCsignal, hypkftree::D2TPCnSigma, hypkftree::D2TPCnSigmaNhp, hypkftree::D2TPCnSigmaNlp, hypkftree::D2TOFmass, hypkftree::D2DcaXY, hypkftree::D2DcaZ, hypkftree::D2IsPvContributor -#define HYPKFD3 hypkftree::D3X, hypkftree::D3Y, hypkftree::D3Z, hypkftree::D3Px, hypkftree::D3Py, hypkftree::D3Pz, hypkftree::D3TPCnCls, hypkftree::D3TPCchi2, hypkftree::D3ITSnCls, hypkftree::D3ITSchi2, hypkftree::D3ITSmeanClsSize, hypkftree::D3ITSmeanClsSizeL, hypkftree::D3Rigidity, hypkftree::D3TPCsignal, hypkftree::D3TPCnSigma, hypkftree::D3TPCnSigmaNhp, hypkftree::D3TPCnSigmaNlp, hypkftree::D3TOFmass, hypkftree::D3DcaXY, hypkftree::D3DcaZ, hypkftree::D3IsPvContributor +#define HYPKFD3 hypkftree::D3X, hypkftree::D3Y, hypkftree::D3Z, hypkftree::D3Px, hypkftree::D3Py, hypkftree::D3Pz, hypkftree::D3TPCnCls, hypkftree::D3TPCchi2, hypkftree::D3ITSnCls, hypkftree::D3ITSchi2, hypkftree::D3ITSmeanClsSizeL, hypkftree::D3Rigidity, hypkftree::D3TPCsignal, hypkftree::D3TPCnSigma, hypkftree::D3TPCnSigmaNhp, hypkftree::D3TPCnSigmaNlp, hypkftree::D3TOFmass, hypkftree::D3DcaXY, hypkftree::D3DcaZ, hypkftree::D3IsPvContributor -#define HYPKFSD1 hypkftree::SD1X, hypkftree::SD1Y, hypkftree::SD1Z, hypkftree::SD1Px, hypkftree::SD1Py, hypkftree::SD1Pz, hypkftree::SD1TPCnCls, hypkftree::SD1TPCchi2, hypkftree::SD1ITSnCls, hypkftree::SD1ITSchi2, hypkftree::SD1ITSmeanClsSize, hypkftree::SD1ITSmeanClsSizeL, hypkftree::SD1Rigidity, hypkftree::SD1TPCsignal, hypkftree::SD1TPCnSigma, hypkftree::SD1TPCnSigmaNhp, hypkftree::SD1TPCnSigmaNlp, hypkftree::SD1TOFmass, hypkftree::SD1DcaXY, hypkftree::SD1DcaZ, hypkftree::SD1IsPvContributor +#define HYPKFSD1 hypkftree::Sd1X, hypkftree::Sd1Y, hypkftree::Sd1Z, hypkftree::Sd1Px, hypkftree::Sd1Py, hypkftree::Sd1Pz, hypkftree::Sd1TPCnCls, hypkftree::Sd1TPCchi2, hypkftree::Sd1ITSnCls, hypkftree::Sd1ITSchi2, hypkftree::Sd1ITSmeanClsSizeL, hypkftree::Sd1Rigidity, hypkftree::Sd1TPCsignal, hypkftree::Sd1TPCnSigma, hypkftree::Sd1TPCnSigmaNhp, hypkftree::Sd1TPCnSigmaNlp, hypkftree::Sd1TOFmass, hypkftree::Sd1DcaXY, hypkftree::Sd1DcaZ, hypkftree::Sd1IsPvContributor -#define HYPKFSD2 hypkftree::SD2X, hypkftree::SD2Y, hypkftree::SD2Z, hypkftree::SD2Px, hypkftree::SD2Py, hypkftree::SD2Pz, hypkftree::SD2TPCnCls, hypkftree::SD2TPCchi2, hypkftree::SD2ITSnCls, hypkftree::SD2ITSchi2, hypkftree::SD2ITSmeanClsSize, hypkftree::SD2ITSmeanClsSizeL, hypkftree::SD2Rigidity, hypkftree::SD2TPCsignal, hypkftree::SD2TPCnSigma, hypkftree::SD2TPCnSigmaNhp, hypkftree::SD2TPCnSigmaNlp, hypkftree::SD2TOFmass, hypkftree::SD2DcaXY, hypkftree::SD2DcaZ, hypkftree::SD2IsPvContributor +#define HYPKFSD2 hypkftree::Sd2X, hypkftree::Sd2Y, hypkftree::Sd2Z, hypkftree::Sd2Px, hypkftree::Sd2Py, hypkftree::Sd2Pz, hypkftree::Sd2TPCnCls, hypkftree::Sd2TPCchi2, hypkftree::Sd2ITSnCls, hypkftree::Sd2ITSchi2, hypkftree::Sd2ITSmeanClsSizeL, hypkftree::Sd2Rigidity, hypkftree::Sd2TPCsignal, hypkftree::Sd2TPCnSigma, hypkftree::Sd2TPCnSigmaNhp, hypkftree::Sd2TPCnSigmaNlp, hypkftree::Sd2TOFmass, hypkftree::Sd2DcaXY, hypkftree::Sd2DcaZ, hypkftree::Sd2IsPvContributor -#define HYPKFSD3 hypkftree::SD3X, hypkftree::SD3Y, hypkftree::SD3Z, hypkftree::SD3Px, hypkftree::SD3Py, hypkftree::SD3Pz, hypkftree::SD3TPCnCls, hypkftree::SD3TPCchi2, hypkftree::SD3ITSnCls, hypkftree::SD3ITSchi2, hypkftree::SD3ITSmeanClsSize, hypkftree::SD3ITSmeanClsSizeL, hypkftree::SD3Rigidity, hypkftree::SD3TPCsignal, hypkftree::SD3TPCnSigma, hypkftree::SD3TPCnSigmaNhp, hypkftree::SD3TPCnSigmaNlp, hypkftree::SD3TOFmass, hypkftree::SD3DcaXY, hypkftree::SD3DcaZ, hypkftree::SD3IsPvContributor +#define HYPKFSD3 hypkftree::Sd3X, hypkftree::Sd3Y, hypkftree::Sd3Z, hypkftree::Sd3Px, hypkftree::Sd3Py, hypkftree::Sd3Pz, hypkftree::Sd3TPCnCls, hypkftree::Sd3TPCchi2, hypkftree::Sd3ITSnCls, hypkftree::Sd3ITSchi2, hypkftree::Sd3ITSmeanClsSizeL, hypkftree::Sd3Rigidity, hypkftree::Sd3TPCsignal, hypkftree::Sd3TPCnSigma, hypkftree::Sd3TPCnSigmaNhp, hypkftree::Sd3TPCnSigmaNlp, hypkftree::Sd3TOFmass, hypkftree::Sd3DcaXY, hypkftree::Sd3DcaZ, hypkftree::Sd3IsPvContributor -#define HYPKFSDMASS hypkftree::D1D2Mass, hypkftree::D1D3Mass, hypkftree::D2D3Mass -#define HYPKFSSDMASS hypkftree::SD1SD2Mass, hypkftree::SD1SD3Mass, hypkftree::SD2SD3Mass +#define HYPKFSDMASS hypkftree::D1d2Mass, hypkftree::D1d3Mass, hypkftree::D2d3Mass +#define HYPKFSSDMASS hypkftree::Sd1sd2Mass, hypkftree::Sd1sd3Mass, hypkftree::Sd2sd3Mass DECLARE_SOA_TABLE(HypKfGens, "AOD", "HYPKFGEN", HYPKFGENBASE); using HypKfGen = HypKfGens::iterator; @@ -317,7 +320,7 @@ DECLARE_SOA_TABLE(HypKfMcCascadeThreeTwoCandidates, "AOD", "HYPKFMCCAND32", HYPK using HypKfMcCascadeThreeTwoCandidate = HypKfMcCascadeThreeTwoCandidates::iterator; } // namespace o2::aod -struct hypKfTreeCreator { +struct hypKfTreeCreator { // o2-linter: disable=[name/workflow-file][name/struct] HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; Produces outputMcGenTable; @@ -356,10 +359,10 @@ struct hypKfTreeCreator { void processData(aod::HypKfHypNucs const& hypNucs, aod::HypKfColls const& hypKfColls, aod::HypKfTracks const& hypKfTrks, aod::HypKfDaughtAdds const& hypKfDAdd, aod::HypKfSubDs const& hypKfDSub) { - for (auto& hypNuc : hypNucs) { + for (const auto& hypNuc : hypNucs) { if (std::abs(hypNuc.species()) != cfgSpecies) continue; - hyperNucleus candidate, hypDaughter, dummy; + HyperNucleus candidate, hypDaughter, dummy; fillCandidate(candidate, hypDaughter, hypNuc, hypNucs, hypKfColls, hypKfTrks, hypKfDAdd, hypKfDSub); if (cfgNsecDaughters) { fillCandidate(hypDaughter, dummy, hypNucs.rawIteratorAt(hypNuc.hypDaughterId()), hypNucs, hypKfColls, hypKfTrks, hypKfDAdd, hypKfDSub); @@ -369,13 +372,13 @@ struct hypKfTreeCreator { } PROCESS_SWITCH(hypKfTreeCreator, processData, "single tree", false); //___________________________________________________________________________________________________________________________________________________________ - void fillTable(hyperNucleus& cand, hyperNucleus& hypDaughter) + void fillTable(HyperNucleus& cand, HyperNucleus& hypDaughter) { if (isMC && cfgMCGenerated) outputMcGenTable( - cand.PdgCode, cand.IsMatterMC, cand.IsReconstructed, cand.IsPhysicalPrimary, cand.PassedEvSelMC, cand.YGen, cand.PtGen, cand.CtGen); + cand.pdgCode, cand.isMatterMC, cand.isReconstructed, cand.isPhysicalPrimary, cand.passedEvSelMC, cand.yGen, cand.ptGen, cand.ctGen); - if (!cand.IsReconstructed) { + if (!cand.isReconstructed) { cand.daughterTracks.resize(4); cand.subDaughterMassVec.resize(4); hypDaughter.daughterTracks.resize(4); @@ -385,53 +388,57 @@ struct hypKfTreeCreator { if (cfgNprimDaughters == 2 && cfgNsecDaughters == 0) { const auto& d1 = cand.daughterTracks.at(0); const auto& d2 = cand.daughterTracks.at(1); - if (!isMC || (isMC && cfgMCReconstructed && cand.IsReconstructed)) + if (!isMC || (isMC && cfgMCReconstructed && cand.isReconstructed)) outputTableTwo( - cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, - cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, cand.McTrue, cand.McPhysicalPrimary, - d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, - d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, - d2.X, d2.Y, d2.Z, d2.Px, d2.Py, d2.Pz, d2.TPCnCls, d2.TPCchi2, d2.ITSnCls, d2.ITSchi2, d2.ITSmeanClsSize, d2.ITSmeanClsSizeL, - d2.Rigidity, d2.TPCsignal, d2.TPCnSigma, d2.TPCnSigmaNhp, d2.TPCnSigmaNlp, d2.TOFmass, d2.DcaXY, d2.DcaZ, d2.IsPvContributor); + cand.species, cand.isMatter, cand.cent, cand.occu, cand.passedEvSel, cand.mass, cand.y, cand.pt, cand.ct, cand.cpaPv, cand.maxDcaTracks, cand.dcaToPvXY, + cand.dcaToPvZ, cand.devToPvXY, cand.chi2, cand.pvx, cand.pvy, cand.pvz, cand.svx, cand.svy, cand.svz, cand.px, cand.py, cand.pz, cand.collisionMcTrue, + cand.mcTrue, cand.mcPhysicalPrimary, + d1.x, d1.y, d1.z, d1.px, d1.py, d1.pz, d1.tpcNcls, d1.tpcChi2, d1.itsNcls, d1.itsChi2, d1.itsMeanClsSizeL, + d1.rigidity, d1.tpcSignal, d1.tpcNsigma, d1.tpcNsigmaNhp, d1.tpcNsigmaNlp, d1.tofMass, d1.dcaXY, d1.dcaZ, d1.isPvContributor, + d2.x, d2.y, d2.z, d2.px, d2.py, d2.pz, d2.tpcNcls, d2.tpcChi2, d2.itsNcls, d2.itsChi2, d2.itsMeanClsSizeL, + d2.rigidity, d2.tpcSignal, d2.tpcNsigma, d2.tpcNsigmaNhp, d2.tpcNsigmaNlp, d2.tofMass, d2.dcaXY, d2.dcaZ, d2.isPvContributor); if (isMC && cfgMCCombined) outputTableMcTwo( - cand.PdgCode, cand.IsMatterMC, cand.IsReconstructed, cand.IsPhysicalPrimary, cand.PassedEvSelMC, cand.YGen, cand.PtGen, cand.CtGen, - cand.CpaPvGen, cand.PxGen, cand.PyGen, cand.PzGen, cand.PvxGen, cand.PvyGen, cand.PvzGen, cand.SvxGen, cand.SvyGen, cand.SvzGen, - cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, - cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, - d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, - d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, - d2.X, d2.Y, d2.Z, d2.Px, d2.Py, d2.Pz, d2.TPCnCls, d2.TPCchi2, d2.ITSnCls, d2.ITSchi2, d2.ITSmeanClsSize, d2.ITSmeanClsSizeL, - d2.Rigidity, d2.TPCsignal, d2.TPCnSigma, d2.TPCnSigmaNhp, d2.TPCnSigmaNlp, d2.TOFmass, d2.DcaXY, d2.DcaZ, d2.IsPvContributor); + cand.pdgCode, cand.isMatterMC, cand.isReconstructed, cand.isPhysicalPrimary, cand.passedEvSelMC, cand.yGen, cand.ptGen, cand.ctGen, + cand.cpaPvGen, cand.pxGen, cand.pyGen, cand.pzGen, cand.pvxGen, cand.pvyGen, cand.pvzGen, cand.svxGen, cand.svyGen, cand.svzGen, + cand.species, cand.isMatter, cand.cent, cand.occu, cand.passedEvSel, cand.mass, cand.y, cand.pt, cand.ct, cand.cpaPv, cand.maxDcaTracks, + cand.dcaToPvXY, cand.dcaToPvZ, cand.devToPvXY, + cand.chi2, cand.pvx, cand.pvy, cand.pvz, cand.svx, cand.svy, cand.svz, cand.px, cand.py, cand.pz, cand.collisionMcTrue, + d1.x, d1.y, d1.z, d1.px, d1.py, d1.pz, d1.tpcNcls, d1.tpcChi2, d1.itsNcls, d1.itsChi2, d1.itsMeanClsSizeL, + d1.rigidity, d1.tpcSignal, d1.tpcNsigma, d1.tpcNsigmaNhp, d1.tpcNsigmaNlp, d1.tofMass, d1.dcaXY, d1.dcaZ, d1.isPvContributor, + d2.x, d2.y, d2.z, d2.px, d2.py, d2.pz, d2.tpcNcls, d2.tpcChi2, d2.itsNcls, d2.itsChi2, d2.itsMeanClsSizeL, + d2.rigidity, d2.tpcSignal, d2.tpcNsigma, d2.tpcNsigmaNhp, d2.tpcNsigmaNlp, d2.tofMass, d2.dcaXY, d2.dcaZ, d2.isPvContributor); } if (cfgNprimDaughters == 3 && cfgNsecDaughters == 0) { const auto& d1 = cand.daughterTracks.at(0); const auto& d2 = cand.daughterTracks.at(1); const auto& d3 = cand.daughterTracks.at(2); - if (!isMC || (isMC && cfgMCReconstructed && cand.IsReconstructed)) + if (!isMC || (isMC && cfgMCReconstructed && cand.isReconstructed)) outputTableThree( - cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, - cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, cand.McTrue, cand.McPhysicalPrimary, - d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, - d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, - d2.X, d2.Y, d2.Z, d2.Px, d2.Py, d2.Pz, d2.TPCnCls, d2.TPCchi2, d2.ITSnCls, d2.ITSchi2, d2.ITSmeanClsSize, d2.ITSmeanClsSizeL, - d2.Rigidity, d2.TPCsignal, d2.TPCnSigma, d2.TPCnSigmaNhp, d2.TPCnSigmaNlp, d2.TOFmass, d2.DcaXY, d2.DcaZ, d2.IsPvContributor, - d3.X, d3.Y, d3.Z, d3.Px, d3.Py, d3.Pz, d3.TPCnCls, d3.TPCchi2, d3.ITSnCls, d3.ITSchi2, d3.ITSmeanClsSize, d3.ITSmeanClsSizeL, - d3.Rigidity, d3.TPCsignal, d3.TPCnSigma, d3.TPCnSigmaNhp, d3.TPCnSigmaNlp, d3.TOFmass, d3.DcaXY, d3.DcaZ, d3.IsPvContributor, - d1.SubMass, d2.SubMass, d3.SubMass); + cand.species, cand.isMatter, cand.cent, cand.occu, cand.passedEvSel, cand.mass, cand.y, cand.pt, cand.ct, cand.cpaPv, cand.maxDcaTracks, cand.dcaToPvXY, + cand.dcaToPvZ, cand.devToPvXY, cand.chi2, cand.pvx, cand.pvy, cand.pvz, cand.svx, cand.svy, cand.svz, cand.px, cand.py, cand.pz, cand.collisionMcTrue, + cand.mcTrue, cand.mcPhysicalPrimary, + d1.x, d1.y, d1.z, d1.px, d1.py, d1.pz, d1.tpcNcls, d1.tpcChi2, d1.itsNcls, d1.itsChi2, d1.itsMeanClsSizeL, + d1.rigidity, d1.tpcSignal, d1.tpcNsigma, d1.tpcNsigmaNhp, d1.tpcNsigmaNlp, d1.tofMass, d1.dcaXY, d1.dcaZ, d1.isPvContributor, + d2.x, d2.y, d2.z, d2.px, d2.py, d2.pz, d2.tpcNcls, d2.tpcChi2, d2.itsNcls, d2.itsChi2, d2.itsMeanClsSizeL, + d2.rigidity, d2.tpcSignal, d2.tpcNsigma, d2.tpcNsigmaNhp, d2.tpcNsigmaNlp, d2.tofMass, d2.dcaXY, d2.dcaZ, d2.isPvContributor, + d3.x, d3.y, d3.z, d3.px, d3.py, d3.pz, d3.tpcNcls, d3.tpcChi2, d3.itsNcls, d3.itsChi2, d3.itsMeanClsSizeL, + d3.rigidity, d3.tpcSignal, d3.tpcNsigma, d3.tpcNsigmaNhp, d3.tpcNsigmaNlp, d3.tofMass, d3.dcaXY, d3.dcaZ, d3.isPvContributor, + d1.subMass, d2.subMass, d3.subMass); if (isMC && cfgMCCombined) outputTableMcThree( - cand.PdgCode, cand.IsMatterMC, cand.IsReconstructed, cand.IsPhysicalPrimary, cand.PassedEvSelMC, cand.YGen, cand.PtGen, cand.CtGen, - cand.CpaPvGen, cand.PxGen, cand.PyGen, cand.PzGen, cand.PvxGen, cand.PvyGen, cand.PvzGen, cand.SvxGen, cand.SvyGen, cand.SvzGen, - cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, - cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, - d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, - d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, - d2.X, d2.Y, d2.Z, d2.Px, d2.Py, d2.Pz, d2.TPCnCls, d2.TPCchi2, d2.ITSnCls, d2.ITSchi2, d2.ITSmeanClsSize, d2.ITSmeanClsSizeL, - d2.Rigidity, d2.TPCsignal, d2.TPCnSigma, d2.TPCnSigmaNhp, d2.TPCnSigmaNlp, d2.TOFmass, d2.DcaXY, d2.DcaZ, d2.IsPvContributor, - d3.X, d3.Y, d3.Z, d3.Px, d3.Py, d3.Pz, d3.TPCnCls, d3.TPCchi2, d3.ITSnCls, d3.ITSchi2, d3.ITSmeanClsSize, d3.ITSmeanClsSizeL, - d3.Rigidity, d3.TPCsignal, d3.TPCnSigma, d3.TPCnSigmaNhp, d3.TPCnSigmaNlp, d3.TOFmass, d3.DcaXY, d3.DcaZ, d3.IsPvContributor, - d1.SubMass, d2.SubMass, d3.SubMass); + cand.pdgCode, cand.isMatterMC, cand.isReconstructed, cand.isPhysicalPrimary, cand.passedEvSelMC, cand.yGen, cand.ptGen, cand.ctGen, + cand.cpaPvGen, cand.pxGen, cand.pyGen, cand.pzGen, cand.pvxGen, cand.pvyGen, cand.pvzGen, cand.svxGen, cand.svyGen, cand.svzGen, + cand.species, cand.isMatter, cand.cent, cand.occu, cand.passedEvSel, cand.mass, cand.y, cand.pt, cand.ct, cand.cpaPv, cand.maxDcaTracks, + cand.dcaToPvXY, cand.dcaToPvZ, cand.devToPvXY, cand.chi2, cand.pvx, cand.pvy, cand.pvz, cand.svx, cand.svy, cand.svz, cand.px, cand.py, + cand.pz, cand.collisionMcTrue, + d1.x, d1.y, d1.z, d1.px, d1.py, d1.pz, d1.tpcNcls, d1.tpcChi2, d1.itsNcls, d1.itsChi2, d1.itsMeanClsSizeL, + d1.rigidity, d1.tpcSignal, d1.tpcNsigma, d1.tpcNsigmaNhp, d1.tpcNsigmaNlp, d1.tofMass, d1.dcaXY, d1.dcaZ, d1.isPvContributor, + d2.x, d2.y, d2.z, d2.px, d2.py, d2.pz, d2.tpcNcls, d2.tpcChi2, d2.itsNcls, d2.itsChi2, d2.itsMeanClsSizeL, + d2.rigidity, d2.tpcSignal, d2.tpcNsigma, d2.tpcNsigmaNhp, d2.tpcNsigmaNlp, d2.tofMass, d2.dcaXY, d2.dcaZ, d2.isPvContributor, + d3.x, d3.y, d3.z, d3.px, d3.py, d3.pz, d3.tpcNcls, d3.tpcChi2, d3.itsNcls, d3.itsChi2, d3.itsMeanClsSizeL, + d3.rigidity, d3.tpcSignal, d3.tpcNsigma, d3.tpcNsigmaNhp, d3.tpcNsigmaNlp, d3.tofMass, d3.dcaXY, d3.dcaZ, d3.isPvContributor, + d1.subMass, d2.subMass, d3.subMass); } if (cfgNprimDaughters == 2 && cfgNsecDaughters == 3) { const auto& d0 = cand.daughterTracks.at(0); @@ -439,38 +446,40 @@ struct hypKfTreeCreator { const auto& sd1 = hypDaughter.daughterTracks.at(0); const auto& sd2 = hypDaughter.daughterTracks.at(1); const auto& sd3 = hypDaughter.daughterTracks.at(2); - if (!isMC || (isMC && cfgMCReconstructed && cand.IsReconstructed)) + if (!isMC || (isMC && cfgMCReconstructed && cand.isReconstructed)) outputTableTwoThree( - cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, - cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, cand.McTrue, cand.McPhysicalPrimary, - hypDaughter.Svx, hypDaughter.Svy, hypDaughter.Svz, d0.X, d0.Y, d0.Z, d0.Px, d0.Py, d0.Pz, hypDaughter.Mass, hypDaughter.Ct, hypDaughter.CpaPv, - hypDaughter.MaxDcaTracks, hypDaughter.DcaToPvXY, hypDaughter.DcaToPvZ, hypDaughter.DcaToVtxXY, hypDaughter.DcaToVtxZ, hypDaughter.Chi2, - d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, - d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, - sd1.X, sd1.Y, sd1.Z, sd1.Px, sd1.Py, sd1.Pz, sd1.TPCnCls, sd1.TPCchi2, sd1.ITSnCls, sd1.ITSchi2, sd1.ITSmeanClsSize, sd1.ITSmeanClsSizeL, - sd1.Rigidity, sd1.TPCsignal, sd1.TPCnSigma, sd1.TPCnSigmaNhp, sd1.TPCnSigmaNlp, sd1.TOFmass, sd1.DcaXY, sd1.DcaZ, sd1.IsPvContributor, - sd2.X, sd2.Y, sd2.Z, sd2.Px, sd2.Py, sd2.Pz, sd2.TPCnCls, sd2.TPCchi2, sd2.ITSnCls, sd2.ITSchi2, sd2.ITSmeanClsSize, sd2.ITSmeanClsSizeL, - sd2.Rigidity, sd2.TPCsignal, sd2.TPCnSigma, sd2.TPCnSigmaNhp, sd2.TPCnSigmaNlp, sd2.TOFmass, sd2.DcaXY, sd2.DcaZ, sd2.IsPvContributor, - sd3.X, sd3.Y, sd3.Z, sd3.Px, sd3.Py, sd3.Pz, sd3.TPCnCls, sd3.TPCchi2, sd3.ITSnCls, sd3.ITSchi2, sd3.ITSmeanClsSize, sd3.ITSmeanClsSizeL, - sd3.Rigidity, sd3.TPCsignal, sd3.TPCnSigma, sd3.TPCnSigmaNhp, sd3.TPCnSigmaNlp, sd3.TOFmass, sd3.DcaXY, sd3.DcaZ, sd3.IsPvContributor, - sd1.SubMass, sd2.SubMass, sd3.SubMass); + cand.species, cand.isMatter, cand.cent, cand.occu, cand.passedEvSel, cand.mass, cand.y, cand.pt, cand.ct, cand.cpaPv, cand.maxDcaTracks, cand.dcaToPvXY, + cand.dcaToPvZ, cand.devToPvXY, cand.chi2, cand.pvx, cand.pvy, cand.pvz, cand.svx, cand.svy, cand.svz, cand.px, cand.py, cand.pz, cand.collisionMcTrue, + cand.mcTrue, cand.mcPhysicalPrimary, + hypDaughter.svx, hypDaughter.svy, hypDaughter.svz, d0.x, d0.y, d0.z, d0.px, d0.py, d0.pz, hypDaughter.mass, hypDaughter.ct, hypDaughter.cpaPv, + hypDaughter.maxDcaTracks, hypDaughter.dcaToPvXY, hypDaughter.dcaToPvZ, hypDaughter.dcaToVtxXY, hypDaughter.dcaToVtxZ, hypDaughter.chi2, + d1.x, d1.y, d1.z, d1.px, d1.py, d1.pz, d1.tpcNcls, d1.tpcChi2, d1.itsNcls, d1.itsChi2, d1.itsMeanClsSizeL, + d1.rigidity, d1.tpcSignal, d1.tpcNsigma, d1.tpcNsigmaNhp, d1.tpcNsigmaNlp, d1.tofMass, d1.dcaXY, d1.dcaZ, d1.isPvContributor, + sd1.x, sd1.y, sd1.z, sd1.px, sd1.py, sd1.pz, sd1.tpcNcls, sd1.tpcChi2, sd1.itsNcls, sd1.itsChi2, sd1.itsMeanClsSizeL, + sd1.rigidity, sd1.tpcSignal, sd1.tpcNsigma, sd1.tpcNsigmaNhp, sd1.tpcNsigmaNlp, sd1.tofMass, sd1.dcaXY, sd1.dcaZ, sd1.isPvContributor, + sd2.x, sd2.y, sd2.z, sd2.px, sd2.py, sd2.pz, sd2.tpcNcls, sd2.tpcChi2, sd2.itsNcls, sd2.itsChi2, sd2.itsMeanClsSizeL, + sd2.rigidity, sd2.tpcSignal, sd2.tpcNsigma, sd2.tpcNsigmaNhp, sd2.tpcNsigmaNlp, sd2.tofMass, sd2.dcaXY, sd2.dcaZ, sd2.isPvContributor, + sd3.x, sd3.y, sd3.z, sd3.px, sd3.py, sd3.pz, sd3.tpcNcls, sd3.tpcChi2, sd3.itsNcls, sd3.itsChi2, sd3.itsMeanClsSizeL, + sd3.rigidity, sd3.tpcSignal, sd3.tpcNsigma, sd3.tpcNsigmaNhp, sd3.tpcNsigmaNlp, sd3.tofMass, sd3.dcaXY, sd3.dcaZ, sd3.isPvContributor, + sd1.subMass, sd2.subMass, sd3.subMass); if (isMC && cfgMCCombined) outputTableMcTwoThree( - cand.PdgCode, cand.IsMatterMC, cand.IsReconstructed, cand.IsPhysicalPrimary, cand.PassedEvSelMC, cand.YGen, cand.PtGen, cand.CtGen, - cand.CpaPvGen, cand.PxGen, cand.PyGen, cand.PzGen, cand.PvxGen, cand.PvyGen, cand.PvzGen, cand.SvxGen, cand.SvyGen, cand.SvzGen, - cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, - cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, - hypDaughter.Svx, hypDaughter.Svy, hypDaughter.Svz, d0.X, d0.Y, d0.Z, d0.Px, d0.Py, d0.Pz, hypDaughter.Mass, hypDaughter.Ct, hypDaughter.CpaPv, - hypDaughter.MaxDcaTracks, hypDaughter.DcaToPvXY, hypDaughter.DcaToPvZ, hypDaughter.DcaToVtxXY, hypDaughter.DcaToVtxZ, hypDaughter.Chi2, - d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, - d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, - sd1.X, sd1.Y, sd1.Z, sd1.Px, sd1.Py, sd1.Pz, sd1.TPCnCls, sd1.TPCchi2, sd1.ITSnCls, sd1.ITSchi2, sd1.ITSmeanClsSize, sd1.ITSmeanClsSizeL, - sd1.Rigidity, sd1.TPCsignal, sd1.TPCnSigma, sd1.TPCnSigmaNhp, sd1.TPCnSigmaNlp, sd1.TOFmass, sd1.DcaXY, sd1.DcaZ, sd1.IsPvContributor, - sd2.X, sd2.Y, sd2.Z, sd2.Px, sd2.Py, sd2.Pz, sd2.TPCnCls, sd2.TPCchi2, sd2.ITSnCls, sd2.ITSchi2, sd2.ITSmeanClsSize, sd2.ITSmeanClsSizeL, - sd2.Rigidity, sd2.TPCsignal, sd2.TPCnSigma, sd2.TPCnSigmaNhp, sd2.TPCnSigmaNlp, sd2.TOFmass, sd2.DcaXY, sd2.DcaZ, sd2.IsPvContributor, - sd3.X, sd3.Y, sd3.Z, sd3.Px, sd3.Py, sd3.Pz, sd3.TPCnCls, sd3.TPCchi2, sd3.ITSnCls, sd3.ITSchi2, sd3.ITSmeanClsSize, sd3.ITSmeanClsSizeL, - sd3.Rigidity, sd3.TPCsignal, sd3.TPCnSigma, sd3.TPCnSigmaNhp, sd3.TPCnSigmaNlp, sd3.TOFmass, sd3.DcaXY, sd3.DcaZ, sd3.IsPvContributor, - sd1.SubMass, sd2.SubMass, sd3.SubMass); + cand.pdgCode, cand.isMatterMC, cand.isReconstructed, cand.isPhysicalPrimary, cand.passedEvSelMC, cand.yGen, cand.ptGen, cand.ctGen, + cand.cpaPvGen, cand.pxGen, cand.pyGen, cand.pzGen, cand.pvxGen, cand.pvyGen, cand.pvzGen, cand.svxGen, cand.svyGen, cand.svzGen, + cand.species, cand.isMatter, cand.cent, cand.occu, cand.passedEvSel, cand.mass, cand.y, cand.pt, cand.ct, cand.cpaPv, cand.maxDcaTracks, cand.dcaToPvXY, + cand.dcaToPvZ, cand.devToPvXY, + cand.chi2, cand.pvx, cand.pvy, cand.pvz, cand.svx, cand.svy, cand.svz, cand.px, cand.py, cand.pz, cand.collisionMcTrue, + hypDaughter.svx, hypDaughter.svy, hypDaughter.svz, d0.x, d0.y, d0.z, d0.px, d0.py, d0.pz, hypDaughter.mass, hypDaughter.ct, hypDaughter.cpaPv, + hypDaughter.maxDcaTracks, hypDaughter.dcaToPvXY, hypDaughter.dcaToPvZ, hypDaughter.dcaToVtxXY, hypDaughter.dcaToVtxZ, hypDaughter.chi2, + d1.x, d1.y, d1.z, d1.px, d1.py, d1.pz, d1.tpcNcls, d1.tpcChi2, d1.itsNcls, d1.itsChi2, d1.itsMeanClsSizeL, + d1.rigidity, d1.tpcSignal, d1.tpcNsigma, d1.tpcNsigmaNhp, d1.tpcNsigmaNlp, d1.tofMass, d1.dcaXY, d1.dcaZ, d1.isPvContributor, + sd1.x, sd1.y, sd1.z, sd1.px, sd1.py, sd1.pz, sd1.tpcNcls, sd1.tpcChi2, sd1.itsNcls, sd1.itsChi2, sd1.itsMeanClsSizeL, + sd1.rigidity, sd1.tpcSignal, sd1.tpcNsigma, sd1.tpcNsigmaNhp, sd1.tpcNsigmaNlp, sd1.tofMass, sd1.dcaXY, sd1.dcaZ, sd1.isPvContributor, + sd2.x, sd2.y, sd2.z, sd2.px, sd2.py, sd2.pz, sd2.tpcNcls, sd2.tpcChi2, sd2.itsNcls, sd2.itsChi2, sd2.itsMeanClsSizeL, + sd2.rigidity, sd2.tpcSignal, sd2.tpcNsigma, sd2.tpcNsigmaNhp, sd2.tpcNsigmaNlp, sd2.tofMass, sd2.dcaXY, sd2.dcaZ, sd2.isPvContributor, + sd3.x, sd3.y, sd3.z, sd3.px, sd3.py, sd3.pz, sd3.tpcNcls, sd3.tpcChi2, sd3.itsNcls, sd3.itsChi2, sd3.itsMeanClsSizeL, + sd3.rigidity, sd3.tpcSignal, sd3.tpcNsigma, sd3.tpcNsigmaNhp, sd3.tpcNsigmaNlp, sd3.tofMass, sd3.dcaXY, sd3.dcaZ, sd3.isPvContributor, + sd1.subMass, sd2.subMass, sd3.subMass); } if (cfgNprimDaughters == 3 && cfgNsecDaughters == 1) { const auto& d0 = cand.daughterTracks.at(0); @@ -478,115 +487,117 @@ struct hypKfTreeCreator { const auto& d2 = cand.daughterTracks.at(2); const auto& sd1 = hypDaughter.daughterTracks.at(0); const auto& sd2 = hypDaughter.daughterTracks.at(1); - if (!isMC || (isMC && cfgMCReconstructed && cand.IsReconstructed)) + if (!isMC || (isMC && cfgMCReconstructed && cand.isReconstructed)) outputTableTwoThree( - cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, - cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, cand.McTrue, cand.McPhysicalPrimary, - hypDaughter.Svx, hypDaughter.Svy, hypDaughter.Svz, d0.X, d0.Y, d0.Z, d0.Px, d0.Py, d0.Pz, hypDaughter.Mass, hypDaughter.Ct, hypDaughter.CpaPv, - hypDaughter.MaxDcaTracks, hypDaughter.DcaToPvXY, hypDaughter.DcaToPvZ, hypDaughter.DcaToVtxXY, hypDaughter.DcaToVtxZ, hypDaughter.Chi2, - d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, - d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, - d2.X, d2.Y, d2.Z, d2.Px, d2.Py, d2.Pz, d2.TPCnCls, d2.TPCchi2, d2.ITSnCls, d2.ITSchi2, d2.ITSmeanClsSize, d2.ITSmeanClsSizeL, - d2.Rigidity, d2.TPCsignal, d2.TPCnSigma, d2.TPCnSigmaNhp, d2.TPCnSigmaNlp, d2.TOFmass, d2.DcaXY, d2.DcaZ, d2.IsPvContributor, - d0.SubMass, d1.SubMass, d2.SubMass, - sd1.X, sd1.Y, sd1.Z, sd1.Px, sd1.Py, sd1.Pz, sd1.TPCnCls, sd1.TPCchi2, sd1.ITSnCls, sd1.ITSchi2, sd1.ITSmeanClsSize, sd1.ITSmeanClsSizeL, - sd1.Rigidity, sd1.TPCsignal, sd1.TPCnSigma, sd1.TPCnSigmaNhp, sd1.TPCnSigmaNlp, sd1.TOFmass, sd1.DcaXY, sd1.DcaZ, sd1.IsPvContributor, - sd2.X, sd2.Y, sd2.Z, sd2.Px, sd2.Py, sd2.Pz, sd2.TPCnCls, sd2.TPCchi2, sd2.ITSnCls, sd2.ITSchi2, sd2.ITSmeanClsSize, sd2.ITSmeanClsSizeL, - sd2.Rigidity, sd2.TPCsignal, sd2.TPCnSigma, sd2.TPCnSigmaNhp, sd2.TPCnSigmaNlp, sd2.TOFmass, sd2.DcaXY, sd2.DcaZ, sd2.IsPvContributor); + cand.species, cand.isMatter, cand.cent, cand.occu, cand.passedEvSel, cand.mass, cand.y, cand.pt, cand.ct, cand.cpaPv, cand.maxDcaTracks, cand.dcaToPvXY, + cand.dcaToPvZ, cand.devToPvXY, cand.chi2, cand.pvx, cand.pvy, cand.pvz, cand.svx, cand.svy, cand.svz, cand.px, cand.py, cand.pz, cand.collisionMcTrue, + cand.mcTrue, cand.mcPhysicalPrimary, hypDaughter.svx, hypDaughter.svy, hypDaughter.svz, d0.x, d0.y, d0.z, d0.px, d0.py, d0.pz, hypDaughter.mass, hypDaughter.ct, + hypDaughter.cpaPv, hypDaughter.maxDcaTracks, hypDaughter.dcaToPvXY, hypDaughter.dcaToPvZ, hypDaughter.dcaToVtxXY, hypDaughter.dcaToVtxZ, hypDaughter.chi2, + d1.x, d1.y, d1.z, d1.px, d1.py, d1.pz, d1.tpcNcls, d1.tpcChi2, d1.itsNcls, d1.itsChi2, d1.itsMeanClsSizeL, + d1.rigidity, d1.tpcSignal, d1.tpcNsigma, d1.tpcNsigmaNhp, d1.tpcNsigmaNlp, d1.tofMass, d1.dcaXY, d1.dcaZ, d1.isPvContributor, + d2.x, d2.y, d2.z, d2.px, d2.py, d2.pz, d2.tpcNcls, d2.tpcChi2, d2.itsNcls, d2.itsChi2, d2.itsMeanClsSizeL, + d2.rigidity, d2.tpcSignal, d2.tpcNsigma, d2.tpcNsigmaNhp, d2.tpcNsigmaNlp, d2.tofMass, d2.dcaXY, d2.dcaZ, d2.isPvContributor, + d0.subMass, d1.subMass, d2.subMass, + sd1.x, sd1.y, sd1.z, sd1.px, sd1.py, sd1.pz, sd1.tpcNcls, sd1.tpcChi2, sd1.itsNcls, sd1.itsChi2, sd1.itsMeanClsSizeL, + sd1.rigidity, sd1.tpcSignal, sd1.tpcNsigma, sd1.tpcNsigmaNhp, sd1.tpcNsigmaNlp, sd1.tofMass, sd1.dcaXY, sd1.dcaZ, sd1.isPvContributor, + sd2.x, sd2.y, sd2.z, sd2.px, sd2.py, sd2.pz, sd2.tpcNcls, sd2.tpcChi2, sd2.itsNcls, sd2.itsChi2, sd2.itsMeanClsSizeL, + sd2.rigidity, sd2.tpcSignal, sd2.tpcNsigma, sd2.tpcNsigmaNhp, sd2.tpcNsigmaNlp, sd2.tofMass, sd2.dcaXY, sd2.dcaZ, sd2.isPvContributor); if (isMC && cfgMCCombined) outputTableMcTwoThree( - cand.PdgCode, cand.IsMatterMC, cand.IsReconstructed, cand.IsPhysicalPrimary, cand.PassedEvSelMC, cand.YGen, cand.PtGen, cand.CtGen, - cand.CpaPvGen, cand.PxGen, cand.PyGen, cand.PzGen, cand.PvxGen, cand.PvyGen, cand.PvzGen, cand.SvxGen, cand.SvyGen, cand.SvzGen, - cand.Species, cand.IsMatter, cand.PassedEvSel, cand.Mass, cand.Y, cand.Pt, cand.Ct, cand.CpaPv, cand.MaxDcaTracks, cand.DcaToPvXY, cand.DcaToPvZ, cand.DevToPvXY, - cand.Chi2, cand.Pvx, cand.Pvy, cand.Pvz, cand.Svx, cand.Svy, cand.Svz, cand.Px, cand.Py, cand.Pz, cand.CollisionMcTrue, - hypDaughter.Svx, hypDaughter.Svy, hypDaughter.Svz, d0.X, d0.Y, d0.Z, d0.Px, d0.Py, d0.Pz, hypDaughter.Mass, hypDaughter.Ct, hypDaughter.CpaPv, - hypDaughter.MaxDcaTracks, hypDaughter.DcaToPvXY, hypDaughter.DcaToPvZ, hypDaughter.DcaToVtxXY, hypDaughter.DcaToVtxZ, hypDaughter.Chi2, - d1.X, d1.Y, d1.Z, d1.Px, d1.Py, d1.Pz, d1.TPCnCls, d1.TPCchi2, d1.ITSnCls, d1.ITSchi2, d1.ITSmeanClsSize, d1.ITSmeanClsSizeL, - d1.Rigidity, d1.TPCsignal, d1.TPCnSigma, d1.TPCnSigmaNhp, d1.TPCnSigmaNlp, d1.TOFmass, d1.DcaXY, d1.DcaZ, d1.IsPvContributor, - d2.X, d2.Y, d2.Z, d2.Px, d2.Py, d2.Pz, d2.TPCnCls, d2.TPCchi2, d2.ITSnCls, d2.ITSchi2, d2.ITSmeanClsSize, d2.ITSmeanClsSizeL, - d2.Rigidity, d2.TPCsignal, d2.TPCnSigma, d2.TPCnSigmaNhp, d2.TPCnSigmaNlp, d2.TOFmass, d2.DcaXY, d2.DcaZ, d2.IsPvContributor, - d0.SubMass, d1.SubMass, d2.SubMass, - sd1.X, sd1.Y, sd1.Z, sd1.Px, sd1.Py, sd1.Pz, sd1.TPCnCls, sd1.TPCchi2, sd1.ITSnCls, sd1.ITSchi2, sd1.ITSmeanClsSize, sd1.ITSmeanClsSizeL, - sd1.Rigidity, sd1.TPCsignal, sd1.TPCnSigma, sd1.TPCnSigmaNhp, sd1.TPCnSigmaNlp, sd1.TOFmass, sd1.DcaXY, sd1.DcaZ, sd1.IsPvContributor, - sd2.X, sd2.Y, sd2.Z, sd2.Px, sd2.Py, sd2.Pz, sd2.TPCnCls, sd2.TPCchi2, sd2.ITSnCls, sd2.ITSchi2, sd2.ITSmeanClsSize, sd2.ITSmeanClsSizeL, - sd2.Rigidity, sd2.TPCsignal, sd2.TPCnSigma, sd2.TPCnSigmaNhp, sd2.TPCnSigmaNlp, sd2.TOFmass, sd2.DcaXY, sd2.DcaZ, sd2.IsPvContributor); + cand.pdgCode, cand.isMatterMC, cand.isReconstructed, cand.isPhysicalPrimary, cand.passedEvSelMC, cand.yGen, cand.ptGen, cand.ctGen, + cand.cpaPvGen, cand.pxGen, cand.pyGen, cand.pzGen, cand.pvxGen, cand.pvyGen, cand.pvzGen, cand.svxGen, cand.svyGen, cand.svzGen, + cand.species, cand.isMatter, cand.cent, cand.occu, cand.passedEvSel, cand.mass, cand.y, cand.pt, cand.ct, cand.cpaPv, cand.maxDcaTracks, cand.dcaToPvXY, + cand.dcaToPvZ, cand.devToPvXY, cand.chi2, cand.pvx, cand.pvy, cand.pvz, cand.svx, cand.svy, cand.svz, cand.px, cand.py, cand.pz, cand.collisionMcTrue, + hypDaughter.svx, hypDaughter.svy, hypDaughter.svz, d0.x, d0.y, d0.z, d0.px, d0.py, d0.pz, hypDaughter.mass, hypDaughter.ct, hypDaughter.cpaPv, + hypDaughter.maxDcaTracks, hypDaughter.dcaToPvXY, hypDaughter.dcaToPvZ, hypDaughter.dcaToVtxXY, hypDaughter.dcaToVtxZ, hypDaughter.chi2, + d1.x, d1.y, d1.z, d1.px, d1.py, d1.pz, d1.tpcNcls, d1.tpcChi2, d1.itsNcls, d1.itsChi2, d1.itsMeanClsSizeL, + d1.rigidity, d1.tpcSignal, d1.tpcNsigma, d1.tpcNsigmaNhp, d1.tpcNsigmaNlp, d1.tofMass, d1.dcaXY, d1.dcaZ, d1.isPvContributor, + d2.x, d2.y, d2.z, d2.px, d2.py, d2.pz, d2.tpcNcls, d2.tpcChi2, d2.itsNcls, d2.itsChi2, d2.itsMeanClsSizeL, + d2.rigidity, d2.tpcSignal, d2.tpcNsigma, d2.tpcNsigmaNhp, d2.tpcNsigmaNlp, d2.tofMass, d2.dcaXY, d2.dcaZ, d2.isPvContributor, + d0.subMass, d1.subMass, d2.subMass, + sd1.x, sd1.y, sd1.z, sd1.px, sd1.py, sd1.pz, sd1.tpcNcls, sd1.tpcChi2, sd1.itsNcls, sd1.itsChi2, sd1.itsMeanClsSizeL, + sd1.rigidity, sd1.tpcSignal, sd1.tpcNsigma, sd1.tpcNsigmaNhp, sd1.tpcNsigmaNlp, sd1.tofMass, sd1.dcaXY, sd1.dcaZ, sd1.isPvContributor, + sd2.x, sd2.y, sd2.z, sd2.px, sd2.py, sd2.pz, sd2.tpcNcls, sd2.tpcChi2, sd2.itsNcls, sd2.itsChi2, sd2.itsMeanClsSizeL, + sd2.rigidity, sd2.tpcSignal, sd2.tpcNsigma, sd2.tpcNsigmaNhp, sd2.tpcNsigmaNlp, sd2.tofMass, sd2.dcaXY, sd2.dcaZ, sd2.isPvContributor); } } //___________________________________________________________________________________________________________________________________________________________ - void fillCandidate(hyperNucleus& cand, hyperNucleus& /*hypDaughter*/, aod::HypKfHypNuc const& hypNuc, aod::HypKfHypNucs const&, aod::HypKfColls const&, aod::HypKfTracks const&, aod::HypKfDaughtAdds const&, aod::HypKfSubDs const&) + void fillCandidate(HyperNucleus& cand, HyperNucleus& /*hypDaughter*/, aod::HypKfHypNuc const& hypNuc, aod::HypKfHypNucs const&, aod::HypKfColls const&, aod::HypKfTracks const&, aod::HypKfDaughtAdds const&, aod::HypKfSubDs const&) { cand.daughterTracks.clear(); cand.subDaughterMassVec.clear(); auto coll = hypNuc.hypKfColl(); - auto addOns = hypNuc.addons_as(); + auto addOns = hypNuc.hypKfDaughtAdd_as(); auto posVec = posVector(addOns); - cand.Species = std::abs(hypNuc.species()); - cand.IsMatter = hypNuc.isMatter(); - cand.PassedEvSel = coll.passedEvSel(); - cand.Mass = hypNuc.mass(); - cand.Y = hypNuc.y(); - cand.Pt = hypNuc.pt(); - cand.Ct = ct(coll, hypNuc); - cand.CpaPv = cpa(coll, hypNuc); - cand.MaxDcaTracks = maxValue(dcaTrackSvAll(posVec, hypNuc, "XY")); - cand.DcaToPvXY = hypNuc.dcaToPvXY(); - cand.DcaToPvZ = hypNuc.dcaToPvZ(); - cand.DcaToVtxXY = hypNuc.dcaToVtxXY(); - cand.DcaToVtxZ = hypNuc.dcaToVtxZ(); - cand.DevToPvXY = hypNuc.devToPvXY(); - cand.Chi2 = hypNuc.chi2(); - cand.Pvx = coll.posX(); - cand.Pvy = coll.posY(); - cand.Pvz = coll.posZ(); - cand.Svx = hypNuc.svx(); - cand.Svy = hypNuc.svy(); - cand.Svz = hypNuc.svz(); - cand.Px = hypNuc.px(); - cand.Py = hypNuc.py(); - cand.Pz = hypNuc.pz(); + cand.species = std::abs(hypNuc.species()); + cand.isMatter = hypNuc.isMatter(); + cand.cent = coll.centFT0C(); + cand.occu = coll.occupancy(); + cand.passedEvSel = coll.passedEvSel(); + cand.mass = hypNuc.mass(); + cand.y = hypNuc.y(); + cand.pt = hypNuc.pt(); + cand.ct = ct(coll, hypNuc); + cand.cpaPv = cpa(coll, hypNuc); + cand.maxDcaTracks = maxValue(dcaTrackSvAll(posVec, hypNuc, "XY")); + cand.dcaToPvXY = hypNuc.dcaToPvXY(); + cand.dcaToPvZ = hypNuc.dcaToPvZ(); + cand.dcaToVtxXY = hypNuc.dcaToVtxXY(); + cand.dcaToVtxZ = hypNuc.dcaToVtxZ(); + cand.devToPvXY = hypNuc.devToPvXY(); + cand.chi2 = hypNuc.chi2(); + cand.pvx = coll.posX(); + cand.pvy = coll.posY(); + cand.pvz = coll.posZ(); + cand.svx = hypNuc.svx(); + cand.svy = hypNuc.svy(); + cand.svz = hypNuc.svz(); + cand.px = hypNuc.px(); + cand.py = hypNuc.py(); + cand.pz = hypNuc.pz(); if (cfgNsecDaughters) { - trackProperties hypDaughter; + TrackProperties hypDaughter; cand.daughterTracks.push_back(hypDaughter); } - auto daughterTracks = hypNuc.daughterTracks_as(); - for (auto& track : daughterTracks) { - trackProperties daughter; - daughter.TPCnCls = track.tpcNcluster(); - daughter.ITSnCls = track.itsNcluster(); - daughter.TPCchi2 = track.tpcChi2NCl(); - daughter.ITSchi2 = track.itsChi2NCl(); - daughter.ITSmeanClsSize = track.itsMeanClsSize(); - daughter.ITSmeanClsSizeL = track.itsMeanClsSize() * track.lambda(); - daughter.Rigidity = track.rigidity(); - daughter.TPCsignal = track.tpcSignal(); - daughter.TPCnSigma = track.tpcNsigma(); - daughter.TPCnSigmaNhp = track.tpcNsigmaNhp(); - daughter.TPCnSigmaNlp = track.tpcNsigmaNlp(); - daughter.TOFmass = track.tofMass(); - daughter.DcaXY = track.dcaXY(); - daughter.DcaZ = track.dcaZ(); - daughter.IsPvContributor = track.isPVContributor(); + auto daughterTracks = hypNuc.hypKfTrack_as(); + for (const auto& track : daughterTracks) { + TrackProperties daughter; + daughter.tpcNcls = track.tpcNcluster(); + daughter.itsNcls = track.itsNcluster(); + daughter.tpcChi2 = track.tpcChi2NCl(); + daughter.itsChi2 = track.itsChi2NCl(); + daughter.itsMeanClsSize = track.itsMeanClsSize(); + daughter.itsMeanClsSizeL = track.itsMeanClsSize() * track.lambda(); + daughter.rigidity = track.rigidity(); + daughter.tpcSignal = track.tpcSignal(); + daughter.tpcNsigma = track.tpcNsigma(); + daughter.tpcNsigmaNhp = track.tpcNsigmaNhp(); + daughter.tpcNsigmaNlp = track.tpcNsigmaNlp(); + daughter.tofMass = track.tofMass(); + daughter.dcaXY = track.dcaXY(); + daughter.dcaZ = track.dcaZ(); + daughter.isPvContributor = track.isPVContributor(); cand.daughterTracks.push_back(daughter); } int trackCount = 0; - for (auto& addOn : addOns) { - cand.daughterTracks.at(trackCount).X = addOn.x(); - cand.daughterTracks.at(trackCount).Y = addOn.y(); - cand.daughterTracks.at(trackCount).Z = addOn.z(); - cand.daughterTracks.at(trackCount).Px = addOn.px(); - cand.daughterTracks.at(trackCount).Py = addOn.py(); - cand.daughterTracks.at(trackCount).Pz = addOn.py(); + for (const auto& addOn : addOns) { + cand.daughterTracks.at(trackCount).x = addOn.x(); + cand.daughterTracks.at(trackCount).y = addOn.y(); + cand.daughterTracks.at(trackCount).z = addOn.z(); + cand.daughterTracks.at(trackCount).px = addOn.px(); + cand.daughterTracks.at(trackCount).py = addOn.py(); + cand.daughterTracks.at(trackCount).pz = addOn.py(); trackCount++; } - cand.NsingleDaughters = trackCount; - if (cand.NsingleDaughters < 3) + cand.nSingleDaughters = trackCount; + if (cand.nSingleDaughters < 3) return; trackCount = 0; - auto subDaughters = hypNuc.subDaughters_as(); - for (auto& subDaughter : subDaughters) { - cand.daughterTracks.at(trackCount++).SubMass = subDaughter.subMass(); + auto subDaughters = hypNuc.hypKfSubD_as(); + for (const auto& subDaughter : subDaughters) { + cand.daughterTracks.at(trackCount++).subMass = subDaughter.subMass(); } } //___________________________________________________________________________________________________________________________________________________________ @@ -594,37 +605,37 @@ struct hypKfTreeCreator { void processMC(aod::HypKfMcParts const& mcHypNucs, aod::HypKfHypNucs const& hypNucs, aod::HypKfMcColls const&, aod::HypKfColls const& hypKfColls, aod::HypKfTracks const& hypKfTrks, aod::HypKfDaughtAdds const& hypKfDAdd, aod::HypKfSubDs const& hypKfDSub) { isMC = true; - for (auto& mcHypNuc : mcHypNucs) { + for (const auto& mcHypNuc : mcHypNucs) { if (std::abs(mcHypNuc.species()) != cfgSpecies) continue; auto mcColl = mcHypNuc.hypKfMcColl(); const auto mcParticleIdx = mcHypNuc.globalIndex(); auto hypNucsByMc = hypNucs.sliceBy(perMcParticle, mcParticleIdx); - hyperNucleus candidate, hypDaughter, dummy; - candidate.PdgCode = mcHypNuc.pdgCode(); - candidate.IsMatterMC = mcHypNuc.isMatter(); - candidate.IsPhysicalPrimary = mcHypNuc.isPhysicalPrimary(); - candidate.PassedEvSelMC = mcColl.passedEvSel(); - candidate.YGen = mcHypNuc.y(); - candidate.PtGen = mcHypNuc.pt(); - candidate.CtGen = ct(mcColl, mcHypNuc); - candidate.IsReconstructed = 0; - candidate.CpaPvGen = cpa(mcColl, mcHypNuc); - candidate.PxGen = mcHypNuc.px(); - candidate.PyGen = mcHypNuc.py(); - candidate.PzGen = mcHypNuc.pz(); - candidate.PvxGen = mcColl.posX(); - candidate.PvyGen = mcColl.posY(); - candidate.PvzGen = mcColl.posZ(); - candidate.SvxGen = mcHypNuc.svx(); - candidate.SvyGen = mcHypNuc.svy(); - candidate.SvzGen = mcHypNuc.svz(); - for (auto& hypNuc : hypNucsByMc) { + HyperNucleus candidate, hypDaughter, dummy; + candidate.pdgCode = mcHypNuc.pdgCode(); + candidate.isMatterMC = mcHypNuc.isMatter(); + candidate.isPhysicalPrimary = mcHypNuc.isPhysicalPrimary(); + candidate.passedEvSelMC = mcColl.passedEvSel(); + candidate.yGen = mcHypNuc.y(); + candidate.ptGen = mcHypNuc.pt(); + candidate.ctGen = ct(mcColl, mcHypNuc); + candidate.isReconstructed = 0; + candidate.cpaPvGen = cpa(mcColl, mcHypNuc); + candidate.pxGen = mcHypNuc.px(); + candidate.pyGen = mcHypNuc.py(); + candidate.pzGen = mcHypNuc.pz(); + candidate.pvxGen = mcColl.posX(); + candidate.pvyGen = mcColl.posY(); + candidate.pvzGen = mcColl.posZ(); + candidate.svxGen = mcHypNuc.svx(); + candidate.svyGen = mcHypNuc.svy(); + candidate.svzGen = mcHypNuc.svz(); + for (const auto& hypNuc : hypNucsByMc) { auto coll = hypNuc.hypKfColl(); if (coll.hypKfMcCollId() == mcHypNuc.hypKfMcCollId()) { - candidate.CollisionMcTrue = true; + candidate.collisionMcTrue = true; } - candidate.IsReconstructed++; + candidate.isReconstructed++; fillCandidate(candidate, hypDaughter, hypNucs.rawIteratorAt(hypNuc.globalIndex()), hypNucs, hypKfColls, hypKfTrks, hypKfDAdd, hypKfDSub); if (cfgNsecDaughters) { fillCandidate(hypDaughter, dummy, hypNucs.rawIteratorAt(hypNuc.hypDaughterId()), hypNucs, hypKfColls, hypKfTrks, hypKfDAdd, hypKfDSub); @@ -632,8 +643,8 @@ struct hypKfTreeCreator { } fillTable(candidate, hypDaughter); hPt[0]->Fill(mcHypNuc.pt()); - if (candidate.IsReconstructed) - hPt[1]->Fill(candidate.Pt); + if (candidate.isReconstructed) + hPt[1]->Fill(candidate.pt); } hPt[2]->Divide(hPt[1].get(), hPt[0].get()); } @@ -668,16 +679,16 @@ struct hypKfTreeCreator { float meanValue(std::vector vec) { float sum = 0; - for (auto value : vec) + for (const auto& value : vec) sum += value; return sum / vec.size(); } float mean2Value(std::vector vec) { float sum = 0; - for (auto value : vec) + for (const auto& value : vec) sum += (value * value); - return TMath::Sqrt(sum / vec.size()); + return std::sqrt(sum / vec.size()); } float dcaTracks(std::vector v, int track1, int track2, TString opt = "XY") @@ -703,7 +714,7 @@ struct hypKfTreeCreator { std::vector posVector(T const& addons) { std::vector v; - for (auto& pos : addons) { + for (const auto& pos : addons) { v.push_back(std::array{pos.x(), pos.y(), pos.z()}); } return v; @@ -738,11 +749,6 @@ struct hypKfTreeCreator { { return RecoDecay::cpa(primVtx(coll), decayVtx(hypNuc), momenta(hypNuc)); } - double paArcMin(double cosPa) - { - // returns the pointing angle (in arc min) for a given cosPa - return TMath::ACos(cosPa) * 60 * 180 / TMath::Pi(); - } // only for Cascades template float decayLength(TPart const& mother, TPart const& daughter) From 5a661ce6292fd282386d25da2bc89c102c9ddbac Mon Sep 17 00:00:00 2001 From: MaolinZH <109225729+MaolinZH@users.noreply.github.com> Date: Tue, 17 Dec 2024 20:16:05 +0100 Subject: [PATCH 421/459] [PWGDQ] CutLibrary: Add electron cuts for e-mu trigger test (#9026) --- PWGDQ/Core/CutsLibrary.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index 2f6ad8a958e..36e5ae9cbdd 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -3266,6 +3266,27 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) return cut; } + if (!nameStr.compare("emu_electron_test1")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug4")); + cut->AddCut(GetAnalysisCut("electronPIDsigmaOpen")); + return cut; + } + + if (!nameStr.compare("emu_electron_test2")) { + cut->AddCut(GetAnalysisCut("jpsiStandardKine2")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug4")); + cut->AddCut(GetAnalysisCut("electronPIDsigmaOpen")); + return cut; + } + + if (!nameStr.compare("emu_electron_test3")) { + cut->AddCut(GetAnalysisCut("jpsiKineSkimmed")); + cut->AddCut(GetAnalysisCut("electronStandardQualityForO2MCdebug4")); + cut->AddCut(GetAnalysisCut("electronPIDsigmaOpen")); + return cut; + } + if (!nameStr.compare("muonLooseTriggerTestCuts")) { cut->AddCut(GetAnalysisCut("muonLooseTriggerTestCuts")); return cut; From 63f22606be91c724b95224ca77ec456f3de9dabf Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:16:13 +0100 Subject: [PATCH 422/459] [PWGLF] Fix occupancy selection, enable ITS AB track rejection, add QA plots (#9031) --- .../derivedlambdakzeroanalysis.cxx | 97 +++++++++++++++++-- 1 file changed, 88 insertions(+), 9 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 7b8ea9683d9..f04a66337e6 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -127,6 +127,8 @@ struct derivedlambdakzeroanalysis { Configurable skipTPConly{"skipTPConly", false, "skip V0s comprised of at least one TPC only prong"}; Configurable requirePosITSonly{"requirePosITSonly", false, "require that positive track is ITSonly (overrides TPC quality)"}; Configurable requireNegITSonly{"requireNegITSonly", false, "require that negative track is ITSonly (overrides TPC quality)"}; + Configurable rejectPosITSafterburner{"rejectPosITSafterburner", false, "reject positive track formed out of afterburner ITS tracks"}; + Configurable rejectNegITSafterburner{"rejectNegITSafterburner", false, "reject negative track formed out of afterburner ITS tracks"}; // PID (TPC/TOF) Configurable TpcPidNsigmaCut{"TpcPidNsigmaCut", 5, "TpcPidNsigmaCut"}; @@ -142,7 +144,7 @@ struct derivedlambdakzeroanalysis { Configurable doCompleteTopoQA{"doCompleteTopoQA", false, "do topological variable QA histograms"}; Configurable doTPCQA{"doTPCQA", false, "do TPC QA histograms"}; Configurable doTOFQA{"doTOFQA", false, "do TOF QA histograms"}; - Configurable doDetectPropQA{"doDetectPropQA", 0, "do Detector/ITS map QA: 0: no, 1: 4D, 2: 5D with mass"}; + Configurable doDetectPropQA{"doDetectPropQA", 0, "do Detector/ITS map QA: 0: no, 1: 4D, 2: 5D with mass; 3: plain in 3D"}; Configurable doPlainTopoQA{"doPlainTopoQA", true, "do simple 1D QA of candidates"}; Configurable qaMinPt{"qaMinPt", 0.0f, "minimum pT for QA plots"}; @@ -223,6 +225,7 @@ struct derivedlambdakzeroanalysis { ConfigurableAxis axisV0Radius{"axisV0Radius", {20, 0.0f, 60.0f}, "V0 2D radius (cm)"}; ConfigurableAxis axisNsigmaTPC{"axisNsigmaTPC", {200, -10.0f, 10.0f}, "N sigma TPC"}; ConfigurableAxis axisTPCsignal{"axisTPCsignal", {200, 0.0f, 200.0f}, "TPC signal"}; + ConfigurableAxis axisNsigmaTOF{"axisNsigmaTOF", {200, -10.0f, 10.0f}, "N sigma TOF"}; ConfigurableAxis axisTOFdeltaT{"axisTOFdeltaT", {200, -5000.0f, 5000.0f}, "TOF Delta T (ps)"}; ConfigurableAxis axisPhi{"axisPhi", {18, 0.0f, constants::math::TwoPI}, "Azimuth angle (rad)"}; ConfigurableAxis axisEta{"axisEta", {10, -1.0f, 1.0f}, "#eta"}; @@ -454,10 +457,16 @@ struct derivedlambdakzeroanalysis { histos.add("K0Short/h3dNegTPCsignalVsTrackPt", "h3dNegTPCsignalVsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisTPCsignal}); } if (doTOFQA) { + histos.add("K0Short/h3dPosNsigmaTOF", "h3dPosNsigmaTOF", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); + histos.add("K0Short/h3dNegNsigmaTOF", "h3dNegNsigmaTOF", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); histos.add("K0Short/h3dPosTOFdeltaT", "h3dPosTOFdeltaT", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); histos.add("K0Short/h3dNegTOFdeltaT", "h3dNegTOFdeltaT", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); + histos.add("K0Short/h3dPosNsigmaTOFvsTrackPtot", "h3dPosNsigmaTOFvsTrackPtot", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); + histos.add("K0Short/h3dNegNsigmaTOFvsTrackPtot", "h3dNegNsigmaTOFvsTrackPtot", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); histos.add("K0Short/h3dPosTOFdeltaTvsTrackPtot", "h3dPosTOFdeltaTvsTrackPtot", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); histos.add("K0Short/h3dNegTOFdeltaTvsTrackPtot", "h3dNegTOFdeltaTvsTrackPtot", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); + histos.add("K0Short/h3dPosNsigmaTOFvsTrackPt", "h3dPosNsigmaTOFvsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); + histos.add("K0Short/h3dNegNsigmaTOFvsTrackPt", "h3dNegNsigmaTOFvsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); histos.add("K0Short/h3dPosTOFdeltaTvsTrackPt", "h3dPosTOFdeltaTvsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); histos.add("K0Short/h3dNegTOFdeltaTvsTrackPt", "h3dNegTOFdeltaTvsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); } @@ -475,6 +484,12 @@ struct derivedlambdakzeroanalysis { histos.add("K0Short/h5dPosDetectPropVsCentrality", "h5dPosDetectPropVsCentrality", kTHnF, {axisCentrality, axisDetMap, axisITScluMap, axisPtCoarse, axisK0Mass}); histos.add("K0Short/h5dNegDetectPropVsCentrality", "h5dNegDetectPropVsCentrality", kTHnF, {axisCentrality, axisDetMap, axisITScluMap, axisPtCoarse, axisK0Mass}); } + if (doDetectPropQA == 3) { + histos.add("K0Short/h3dPositiveITSclusters", "h3dPositiveITSclusters", kTH3F, {axisCentrality, axisPtCoarse, axisITSclus}); + histos.add("K0Short/h3dNegativeITSclusters", "h3dNegativeITSclusters", kTH3F, {axisCentrality, axisPtCoarse, axisITSclus}); + histos.add("K0Short/h3dPositiveTPCcrossedRows", "h3dPositiveTPCcrossedRows", kTH3F, {axisCentrality, axisPtCoarse, axisTPCrows}); + histos.add("K0Short/h3dNegativeTPCcrossedRows", "h3dNegativeTPCcrossedRows", kTH3F, {axisCentrality, axisPtCoarse, axisTPCrows}); + } } if (analyseLambda) { histos.add("h2dNbrOfLambdaVsCentrality", "h2dNbrOfLambdaVsCentrality", kTH2F, {axisCentrality, {10, -0.5f, 9.5f}}); @@ -500,10 +515,16 @@ struct derivedlambdakzeroanalysis { histos.add("Lambda/h3dNegTPCsignalVsTrackPt", "h3dNegTPCsignalVsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisTPCsignal}); } if (doTOFQA) { + histos.add("Lambda/h3dPosNsigmaTOF", "h3dPosNsigmaTOF", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); + histos.add("Lambda/h3dNegNsigmaTOF", "h3dNegNsigmaTOF", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); histos.add("Lambda/h3dPosTOFdeltaT", "h3dPosTOFdeltaT", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); histos.add("Lambda/h3dNegTOFdeltaT", "h3dNegTOFdeltaT", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); + histos.add("Lambda/h3dPosNsigmaTOFvsTrackPtot", "h3dPosNsigmaTOFvsTrackPtot", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); + histos.add("Lambda/h3dNegNsigmaTOFvsTrackPtot", "h3dNegNsigmaTOFvsTrackPtot", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); histos.add("Lambda/h3dPosTOFdeltaTvsTrackPtot", "h3dPosTOFdeltaTvsTrackPtot", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); histos.add("Lambda/h3dNegTOFdeltaTvsTrackPtot", "h3dNegTOFdeltaTvsTrackPtot", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); + histos.add("Lambda/h3dPosNsigmaTOFvsTrackPt", "h3dPosNsigmaTOFvsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); + histos.add("Lambda/h3dNegNsigmaTOFvsTrackPt", "h3dNegNsigmaTOFvsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); histos.add("Lambda/h3dPosTOFdeltaTvsTrackPt", "h3dPosTOFdeltaTvsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); histos.add("Lambda/h3dNegTOFdeltaTvsTrackPt", "h3dNegTOFdeltaTvsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); } @@ -521,6 +542,12 @@ struct derivedlambdakzeroanalysis { histos.add("Lambda/h5dPosDetectPropVsCentrality", "h5dPosDetectPropVsCentrality", kTHnF, {axisCentrality, axisDetMap, axisITScluMap, axisPtCoarse, axisLambdaMass}); histos.add("Lambda/h5dNegDetectPropVsCentrality", "h5dNegDetectPropVsCentrality", kTHnF, {axisCentrality, axisDetMap, axisITScluMap, axisPtCoarse, axisLambdaMass}); } + if (doDetectPropQA == 3) { + histos.add("Lambda/h3dPositiveITSclusters", "h3dPositiveITSclusters", kTH3F, {axisCentrality, axisPtCoarse, axisITSclus}); + histos.add("Lambda/h3dNegativeITSclusters", "h3dNegativeITSclusters", kTH3F, {axisCentrality, axisPtCoarse, axisITSclus}); + histos.add("Lambda/h3dPositiveTPCcrossedRows", "h3dPositiveTPCcrossedRows", kTH3F, {axisCentrality, axisPtCoarse, axisTPCrows}); + histos.add("Lambda/h3dNegativeTPCcrossedRows", "h3dNegativeTPCcrossedRows", kTH3F, {axisCentrality, axisPtCoarse, axisTPCrows}); + } } if (analyseAntiLambda) { histos.add("h2dNbrOfAntiLambdaVsCentrality", "h2dNbrOfAntiLambdaVsCentrality", kTH2F, {axisCentrality, {10, -0.5f, 9.5f}}); @@ -546,10 +573,16 @@ struct derivedlambdakzeroanalysis { histos.add("AntiLambda/h3dNegTPCsignalVsTrackPt", "h3dNegTPCsignalVsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisTPCsignal}); } if (doTOFQA) { + histos.add("AntiLambda/h3dPosNsigmaTOF", "h3dPosNsigmaTOF", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); + histos.add("AntiLambda/h3dNegNsigmaTOF", "h3dNegNsigmaTOF", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); histos.add("AntiLambda/h3dPosTOFdeltaT", "h3dPosTOFdeltaT", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); histos.add("AntiLambda/h3dNegTOFdeltaT", "h3dNegTOFdeltaT", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); + histos.add("AntiLambda/h3dPosNsigmaTOFvsTrackPtot", "h3dPosNsigmaTOFvsTrackPtot", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); + histos.add("AntiLambda/h3dNegNsigmaTOFvsTrackPtot", "h3dNegNsigmaTOFvsTrackPtot", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); histos.add("AntiLambda/h3dPosTOFdeltaTvsTrackPtot", "h3dPosTOFdeltaTvsTrackPtot", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); histos.add("AntiLambda/h3dNegTOFdeltaTvsTrackPtot", "h3dNegTOFdeltaTvsTrackPtot", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); + histos.add("AntiLambda/h3dPosNsigmaTOFvsTrackPt", "h3dPosNsigmaTOFvsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); + histos.add("AntiLambda/h3dNegNsigmaTOFvsTrackPt", "h3dNegNsigmaTOFvsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisNsigmaTOF}); histos.add("AntiLambda/h3dPosTOFdeltaTvsTrackPt", "h3dPosTOFdeltaTvsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); histos.add("AntiLambda/h3dNegTOFdeltaTvsTrackPt", "h3dNegTOFdeltaTvsTrackPt", kTH3F, {axisCentrality, axisPtCoarse, axisTOFdeltaT}); } @@ -567,6 +600,12 @@ struct derivedlambdakzeroanalysis { histos.add("AntiLambda/h5dPosDetectPropVsCentrality", "h5dPosDetectPropVsCentrality", kTHnF, {axisCentrality, axisDetMap, axisITScluMap, axisPtCoarse, axisLambdaMass}); histos.add("AntiLambda/h5dNegDetectPropVsCentrality", "h5dNegDetectPropVsCentrality", kTHnF, {axisCentrality, axisDetMap, axisITScluMap, axisPtCoarse, axisLambdaMass}); } + if (doDetectPropQA == 3) { + histos.add("AntiLambda/h3dPositiveITSclusters", "h3dPositiveITSclusters", kTH3F, {axisCentrality, axisPtCoarse, axisITSclus}); + histos.add("AntiLambda/h3dNegativeITSclusters", "h3dNegativeITSclusters", kTH3F, {axisCentrality, axisPtCoarse, axisITSclus}); + histos.add("AntiLambda/h3dPositiveTPCcrossedRows", "h3dPositiveTPCcrossedRows", kTH3F, {axisCentrality, axisPtCoarse, axisTPCrows}); + histos.add("AntiLambda/h3dNegativeTPCcrossedRows", "h3dNegativeTPCcrossedRows", kTH3F, {axisCentrality, axisPtCoarse, axisTPCrows}); + } } if (analyseLambda && calculateFeeddownMatrix && doprocessMonteCarlo) @@ -747,9 +786,13 @@ struct derivedlambdakzeroanalysis { auto negTrackExtra = v0.template negTrackExtra_as(); // ITS quality flags - if (posTrackExtra.itsNCls() >= v0Selections.minITSclusters) + bool posIsFromAfterburner = posTrackExtra.itsChi2PerNcl() < 0; + bool negIsFromAfterburner = negTrackExtra.itsChi2PerNcl() < 0; + + // check minimum number of ITS clusters + reject ITS afterburner tracks if requested + if (posTrackExtra.itsNCls() >= v0Selections.minITSclusters && (!v0Selections.rejectPosITSafterburner || !posIsFromAfterburner)) bitset(bitMap, selPosGoodITSTrack); - if (negTrackExtra.itsNCls() >= v0Selections.minITSclusters) + if (negTrackExtra.itsNCls() >= v0Selections.minITSclusters && (!v0Selections.rejectNegITSafterburner || !negIsFromAfterburner)) bitset(bitMap, selNegGoodITSTrack); // TPC quality flags @@ -1122,6 +1165,12 @@ struct derivedlambdakzeroanalysis { histos.fill(HIST("K0Short/h5dPosDetectPropVsCentrality"), centrality, posTrackExtra.detectorMap(), posTrackExtra.itsClusterMap(), pt, v0.mK0Short()); histos.fill(HIST("K0Short/h5dNegDetectPropVsCentrality"), centrality, negTrackExtra.detectorMap(), negTrackExtra.itsClusterMap(), pt, v0.mK0Short()); } + if (doDetectPropQA == 3) { + histos.fill(HIST("K0Short/h3dPositiveITSclusters"), centrality, pt, posTrackExtra.itsNCls()); + histos.fill(HIST("K0Short/h3dNegativeITSclusters"), centrality, pt, negTrackExtra.itsNCls()); + histos.fill(HIST("K0Short/h3dPositiveTPCcrossedRows"), centrality, pt, posTrackExtra.tpcCrossedRows()); + histos.fill(HIST("K0Short/h3dNegativeTPCcrossedRows"), centrality, pt, negTrackExtra.tpcCrossedRows()); + } if (doTPCQA) { histos.fill(HIST("K0Short/h3dPosNsigmaTPC"), centrality, pt, posTrackExtra.tpcNSigmaPi()); histos.fill(HIST("K0Short/h3dNegNsigmaTPC"), centrality, pt, negTrackExtra.tpcNSigmaPi()); @@ -1137,10 +1186,16 @@ struct derivedlambdakzeroanalysis { histos.fill(HIST("K0Short/h3dNegTPCsignalVsTrackPt"), centrality, v0.negativept(), negTrackExtra.tpcSignal()); } if (doTOFQA) { + histos.fill(HIST("K0Short/h3dPosNsigmaTOF"), centrality, pt, v0.tofNSigmaK0PiPlus()); + histos.fill(HIST("K0Short/h3dNegNsigmaTOF"), centrality, pt, v0.tofNSigmaK0PiMinus()); histos.fill(HIST("K0Short/h3dPosTOFdeltaT"), centrality, pt, v0.posTOFDeltaTK0Pi()); histos.fill(HIST("K0Short/h3dNegTOFdeltaT"), centrality, pt, v0.negTOFDeltaTK0Pi()); + histos.fill(HIST("K0Short/h3dPosNsigmaTOFvsTrackPtot"), centrality, v0.positivept() * TMath::CosH(v0.positiveeta()), v0.tofNSigmaK0PiPlus()); + histos.fill(HIST("K0Short/h3dNegNsigmaTOFvsTrackPtot"), centrality, v0.negativept() * TMath::CosH(v0.negativeeta()), v0.tofNSigmaK0PiMinus()); histos.fill(HIST("K0Short/h3dPosTOFdeltaTvsTrackPtot"), centrality, v0.positivept() * TMath::CosH(v0.positiveeta()), v0.posTOFDeltaTK0Pi()); histos.fill(HIST("K0Short/h3dNegTOFdeltaTvsTrackPtot"), centrality, v0.negativept() * TMath::CosH(v0.negativeeta()), v0.negTOFDeltaTK0Pi()); + histos.fill(HIST("K0Short/h3dPosNsigmaTOFvsTrackPt"), centrality, v0.positivept(), v0.tofNSigmaK0PiPlus()); + histos.fill(HIST("K0Short/h3dNegNsigmaTOFvsTrackPt"), centrality, v0.negativept(), v0.tofNSigmaK0PiMinus()); histos.fill(HIST("K0Short/h3dPosTOFdeltaTvsTrackPt"), centrality, v0.positivept(), v0.posTOFDeltaTK0Pi()); histos.fill(HIST("K0Short/h3dNegTOFdeltaTvsTrackPt"), centrality, v0.negativept(), v0.negTOFDeltaTK0Pi()); } @@ -1175,6 +1230,12 @@ struct derivedlambdakzeroanalysis { histos.fill(HIST("Lambda/h5dPosDetectPropVsCentrality"), centrality, posTrackExtra.detectorMap(), posTrackExtra.itsClusterMap(), pt, v0.mLambda()); histos.fill(HIST("Lambda/h5dNegDetectPropVsCentrality"), centrality, negTrackExtra.detectorMap(), negTrackExtra.itsClusterMap(), pt, v0.mLambda()); } + if (doDetectPropQA == 3) { + histos.fill(HIST("Lambda/h3dPositiveITSclusters"), centrality, pt, posTrackExtra.itsNCls()); + histos.fill(HIST("Lambda/h3dNegativeITSclusters"), centrality, pt, negTrackExtra.itsNCls()); + histos.fill(HIST("Lambda/h3dPositiveTPCcrossedRows"), centrality, pt, posTrackExtra.tpcCrossedRows()); + histos.fill(HIST("Lambda/h3dNegativeTPCcrossedRows"), centrality, pt, negTrackExtra.tpcCrossedRows()); + } if (doTPCQA) { histos.fill(HIST("Lambda/h3dPosNsigmaTPC"), centrality, pt, posTrackExtra.tpcNSigmaPr()); histos.fill(HIST("Lambda/h3dNegNsigmaTPC"), centrality, pt, negTrackExtra.tpcNSigmaPi()); @@ -1190,10 +1251,16 @@ struct derivedlambdakzeroanalysis { histos.fill(HIST("Lambda/h3dNegTPCsignalVsTrackPt"), centrality, v0.negativept(), negTrackExtra.tpcSignal()); } if (doTOFQA) { + histos.fill(HIST("Lambda/h3dPosNsigmaTOF"), centrality, pt, v0.tofNSigmaLaPr()); + histos.fill(HIST("Lambda/h3dNegNsigmaTOF"), centrality, pt, v0.tofNSigmaLaPi()); histos.fill(HIST("Lambda/h3dPosTOFdeltaT"), centrality, pt, v0.posTOFDeltaTLaPr()); histos.fill(HIST("Lambda/h3dNegTOFdeltaT"), centrality, pt, v0.negTOFDeltaTLaPi()); + histos.fill(HIST("Lambda/h3dPosNsigmaTOFvsTrackPtot"), centrality, v0.positivept() * TMath::CosH(v0.positiveeta()), v0.tofNSigmaLaPr()); + histos.fill(HIST("Lambda/h3dNegNsigmaTOFvsTrackPtot"), centrality, v0.negativept() * TMath::CosH(v0.negativeeta()), v0.tofNSigmaLaPi()); histos.fill(HIST("Lambda/h3dPosTOFdeltaTvsTrackPtot"), centrality, v0.positivept() * TMath::CosH(v0.positiveeta()), v0.posTOFDeltaTLaPr()); histos.fill(HIST("Lambda/h3dNegTOFdeltaTvsTrackPtot"), centrality, v0.negativept() * TMath::CosH(v0.negativeeta()), v0.negTOFDeltaTLaPi()); + histos.fill(HIST("Lambda/h3dPosNsigmaTOFvsTrackPt"), centrality, v0.positivept(), v0.tofNSigmaLaPr()); + histos.fill(HIST("Lambda/h3dNegNsigmaTOFvsTrackPt"), centrality, v0.negativept(), v0.tofNSigmaLaPi()); histos.fill(HIST("Lambda/h3dPosTOFdeltaTvsTrackPt"), centrality, v0.positivept(), v0.posTOFDeltaTLaPr()); histos.fill(HIST("Lambda/h3dNegTOFdeltaTvsTrackPt"), centrality, v0.negativept(), v0.negTOFDeltaTLaPi()); } @@ -1228,6 +1295,12 @@ struct derivedlambdakzeroanalysis { histos.fill(HIST("AntiLambda/h5dPosDetectPropVsCentrality"), centrality, posTrackExtra.detectorMap(), posTrackExtra.itsClusterMap(), pt, v0.mAntiLambda()); histos.fill(HIST("AntiLambda/h5dNegDetectPropVsCentrality"), centrality, negTrackExtra.detectorMap(), negTrackExtra.itsClusterMap(), pt, v0.mAntiLambda()); } + if (doDetectPropQA == 3) { + histos.fill(HIST("AntiLambda/h3dPositiveITSclusters"), centrality, pt, posTrackExtra.itsNCls()); + histos.fill(HIST("AntiLambda/h3dNegativeITSclusters"), centrality, pt, negTrackExtra.itsNCls()); + histos.fill(HIST("AntiLambda/h3dPositiveTPCcrossedRows"), centrality, pt, posTrackExtra.tpcCrossedRows()); + histos.fill(HIST("AntiLambda/h3dNegativeTPCcrossedRows"), centrality, pt, negTrackExtra.tpcCrossedRows()); + } if (doTPCQA) { histos.fill(HIST("AntiLambda/h3dPosNsigmaTPC"), centrality, pt, posTrackExtra.tpcNSigmaPi()); histos.fill(HIST("AntiLambda/h3dNegNsigmaTPC"), centrality, pt, negTrackExtra.tpcNSigmaPr()); @@ -1243,10 +1316,16 @@ struct derivedlambdakzeroanalysis { histos.fill(HIST("AntiLambda/h3dNegTPCsignalVsTrackPt"), centrality, v0.negativept(), negTrackExtra.tpcSignal()); } if (doTOFQA) { + histos.fill(HIST("AntiLambda/h3dPosNsigmaTOF"), centrality, pt, v0.tofNSigmaALaPi()); + histos.fill(HIST("AntiLambda/h3dNegNsigmaTOF"), centrality, pt, v0.tofNSigmaALaPr()); histos.fill(HIST("AntiLambda/h3dPosTOFdeltaT"), centrality, pt, v0.posTOFDeltaTLaPi()); histos.fill(HIST("AntiLambda/h3dNegTOFdeltaT"), centrality, pt, v0.negTOFDeltaTLaPr()); + histos.fill(HIST("AntiLambda/h3dPosNsigmaTOFvsTrackPtot"), centrality, v0.positivept() * TMath::CosH(v0.positiveeta()), v0.tofNSigmaALaPi()); + histos.fill(HIST("AntiLambda/h3dNegNsigmaTOFvsTrackPtot"), centrality, v0.negativept() * TMath::CosH(v0.negativeeta()), v0.tofNSigmaALaPr()); histos.fill(HIST("AntiLambda/h3dPosTOFdeltaTvsTrackPtot"), centrality, v0.positivept() * TMath::CosH(v0.positiveeta()), v0.posTOFDeltaTLaPi()); histos.fill(HIST("AntiLambda/h3dNegTOFdeltaTvsTrackPtot"), centrality, v0.negativept() * TMath::CosH(v0.negativeeta()), v0.negTOFDeltaTLaPr()); + histos.fill(HIST("AntiLambda/h3dPosNsigmaTOFvsTrackPt"), centrality, v0.positivept(), v0.tofNSigmaALaPi()); + histos.fill(HIST("AntiLambda/h3dNegNsigmaTOFvsTrackPt"), centrality, v0.negativept(), v0.tofNSigmaALaPr()); histos.fill(HIST("AntiLambda/h3dPosTOFdeltaTvsTrackPt"), centrality, v0.positivept(), v0.posTOFDeltaTLaPi()); histos.fill(HIST("AntiLambda/h3dNegTOFdeltaTvsTrackPt"), centrality, v0.negativept(), v0.negTOFDeltaTLaPr()); } @@ -1456,13 +1535,13 @@ struct derivedlambdakzeroanalysis { histos.fill(HIST("hEventSelection"), 16 /* No other collision within the same ITS ROF */); float collisionOccupancy = useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange(); - if (minOccupancy > 0 && collisionOccupancy < minOccupancy) { + if (minOccupancy >= 0 && collisionOccupancy < minOccupancy) { return false; } if (fillHists) histos.fill(HIST("hEventSelection"), 17 /* Below min occupancy */); - if (maxOccupancy > 0 && collisionOccupancy > maxOccupancy) { + if (maxOccupancy >= 0 && collisionOccupancy > maxOccupancy) { return false; } if (fillHists) @@ -1752,10 +1831,10 @@ struct derivedlambdakzeroanalysis { centrality = collision.centFT0C(); float collisionOccupancy = useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange(); - if (minOccupancy > 0 && collisionOccupancy < minOccupancy) { + if (minOccupancy >= 0 && collisionOccupancy < minOccupancy) { continue; } - if (maxOccupancy > 0 && collisionOccupancy > maxOccupancy) { + if (maxOccupancy >= 0 && collisionOccupancy > maxOccupancy) { continue; } @@ -1808,10 +1887,10 @@ struct derivedlambdakzeroanalysis { centrality = collision.centFT0C(); float collisionOccupancy = useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange(); - if (minOccupancy > 0 && collisionOccupancy < minOccupancy) { + if (minOccupancy >= 0 && collisionOccupancy < minOccupancy) { continue; } - if (maxOccupancy > 0 && collisionOccupancy > maxOccupancy) { + if (maxOccupancy >= 0 && collisionOccupancy > maxOccupancy) { continue; } From e135fe896ca00e1f4524b21ff0bd31048edeed7e Mon Sep 17 00:00:00 2001 From: victorvalenciatorres <118812999+victorvalenciatorres@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:22:40 +0100 Subject: [PATCH 423/459] [PWGDQ] Adding Etagap in DataModel (#9034) --- PWGDQ/Core/VarManager.h | 2 ++ PWGDQ/DataModel/ReducedInfoTables.h | 4 +++- PWGDQ/Tasks/dqFlow.cxx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 50755cd301c..4b0e1a7b52c 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -1657,8 +1657,10 @@ void VarManager::FillEvent(T const& event, float* values) if constexpr ((fillMap & ReducedEventRefFlow) > 0) { values[kM1111REF] = event.m1111ref(); values[kM11REF] = event.m11ref(); + values[kM11REFetagap] = event.m11refetagap(); values[kM11M1111REF] = event.m11ref() * event.m1111ref(); values[kCORR2REF] = event.corr2ref(); + values[kCORR2REFetagap] = event.corr2refetagap(); values[kCORR4REF] = event.corr4ref(); values[kCORR2CORR4REF] = event.corr2ref() * event.corr4ref(); values[kMultA] = event.multa(); diff --git a/PWGDQ/DataModel/ReducedInfoTables.h b/PWGDQ/DataModel/ReducedInfoTables.h index 2c868f0873b..f8f7b4e3161 100644 --- a/PWGDQ/DataModel/ReducedInfoTables.h +++ b/PWGDQ/DataModel/ReducedInfoTables.h @@ -112,9 +112,11 @@ DECLARE_SOA_COLUMN(S12A, s12a, float); //! Weighted multiplicity (p = 1, DECLARE_SOA_COLUMN(S13A, s13a, float); //! Weighted multiplicity (p = 1, k = 3) DECLARE_SOA_COLUMN(S31A, s31a, float); //! Weighted multiplicity (p = 3, k = 1) DECLARE_SOA_COLUMN(CORR2REF, corr2ref, float); //! Ref Flow correlator <2> +DECLARE_SOA_COLUMN(CORR2REFetagap, corr2refetagap, float); //! Ref Flow correlator <2> DECLARE_SOA_COLUMN(CORR4REF, corr4ref, float); //! Ref Flow correlator <4> DECLARE_SOA_COLUMN(M11REF, m11ref, float); //! Weighted multiplicity of <<2>> for reference flow DECLARE_SOA_COLUMN(M1111REF, m1111ref, float); //! Weighted multiplicity of <<4>> for reference flow +DECLARE_SOA_COLUMN(M11REFetagap, m11refetagap, float); //! Weighted multiplicity of <<2>> etagap for reference flow } // namespace reducedevent DECLARE_SOA_TABLE_STAGED(ReducedEvents, "REDUCEDEVENT", //! Main event information table @@ -166,7 +168,7 @@ DECLARE_SOA_TABLE(ReducedEventsQvectorCentrExtra, "AOD", "REQVECCTREXTA", //! reducedevent::QvecBAllRe, reducedevent::QvecBAllIm, reducedevent::NTrkBAll); DECLARE_SOA_TABLE(ReducedEventsRefFlow, "AOD", "REREFFLOW", //! Event Ref Flow information - reducedevent::M11REF, reducedevent::M1111REF, reducedevent::CORR2REF, reducedevent::CORR4REF, cent::CentFT0C); + reducedevent::M11REF, reducedevent::M11REFetagap, reducedevent::M1111REF, reducedevent::CORR2REF, reducedevent::CORR2REFetagap, reducedevent::CORR4REF, cent::CentFT0C); DECLARE_SOA_TABLE(ReducedEventsQvectorZN, "AOD", "REQVECTORZN", //! Event Q-vector information from ZNs detectors reducedevent::Q1ZNAX, reducedevent::Q1ZNAY, reducedevent::Q1ZNCX, reducedevent::Q1ZNCY); diff --git a/PWGDQ/Tasks/dqFlow.cxx b/PWGDQ/Tasks/dqFlow.cxx index b29efd014b8..b5e855d3d13 100644 --- a/PWGDQ/Tasks/dqFlow.cxx +++ b/PWGDQ/Tasks/dqFlow.cxx @@ -507,7 +507,7 @@ struct DQEventQvector { if (fEventCut->IsSelected(VarManager::fgValues)) { eventQvector(VarManager::fgValues[VarManager::kQ1X0A], VarManager::fgValues[VarManager::kQ1Y0A], VarManager::fgValues[VarManager::kQ1X0B], VarManager::fgValues[VarManager::kQ1Y0B], VarManager::fgValues[VarManager::kQ1X0C], VarManager::fgValues[VarManager::kQ1Y0C], VarManager::fgValues[VarManager::kQ2X0A], VarManager::fgValues[VarManager::kQ2Y0A], VarManager::fgValues[VarManager::kQ2X0B], VarManager::fgValues[VarManager::kQ2Y0B], VarManager::fgValues[VarManager::kQ2X0C], VarManager::fgValues[VarManager::kQ2Y0C], VarManager::fgValues[VarManager::kMultA], VarManager::fgValues[VarManager::kMultB], VarManager::fgValues[VarManager::kMultC], VarManager::fgValues[VarManager::kQ3X0A], VarManager::fgValues[VarManager::kQ3Y0A], VarManager::fgValues[VarManager::kQ3X0B], VarManager::fgValues[VarManager::kQ3Y0B], VarManager::fgValues[VarManager::kQ3X0C], VarManager::fgValues[VarManager::kQ3Y0C], VarManager::fgValues[VarManager::kQ4X0A], VarManager::fgValues[VarManager::kQ4Y0A], VarManager::fgValues[VarManager::kQ4X0B], VarManager::fgValues[VarManager::kQ4Y0B], VarManager::fgValues[VarManager::kQ4X0C], VarManager::fgValues[VarManager::kQ4Y0C]); eventQvectorExtra(VarManager::fgValues[VarManager::kQ42XA], VarManager::fgValues[VarManager::kQ42YA], VarManager::fgValues[VarManager::kQ23XA], VarManager::fgValues[VarManager::kQ23YA], VarManager::fgValues[VarManager::kS11A], VarManager::fgValues[VarManager::kS12A], VarManager::fgValues[VarManager::kS13A], VarManager::fgValues[VarManager::kS31A]); - eventRefFlow(VarManager::fgValues[VarManager::kM11REF], VarManager::fgValues[VarManager::kM1111REF], VarManager::fgValues[VarManager::kCORR2REF], VarManager::fgValues[VarManager::kCORR4REF], centrality); + eventRefFlow(VarManager::fgValues[VarManager::kM11REF], VarManager::fgValues[VarManager::kM11REFetagap], VarManager::fgValues[VarManager::kM1111REF], VarManager::fgValues[VarManager::kCORR2REF], VarManager::fgValues[VarManager::kCORR2REFetagap], VarManager::fgValues[VarManager::kCORR4REF], centrality); } if constexpr ((TEventFillMap & VarManager::ObjTypes::CollisionQvectCentr) > 0) { From f9241b96e0096ae37bb5db72be379c50142f0181 Mon Sep 17 00:00:00 2001 From: Samuele Cattaruzzi <124249902+scattaru@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:31:59 +0100 Subject: [PATCH 424/459] [PWGHF] Ds-h correlations, ME offline on self-contained derived data (#8997) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ALICE Action Bot Co-authored-by: Vít Kučera --- PWGHF/HFC/TableProducer/CMakeLists.txt | 5 + .../HFC/TableProducer/correlatorDsHadrons.cxx | 105 +++++++++++---- .../correlatorDsHadronsReduced.cxx | 122 ++++++++++++++++++ 3 files changed, 204 insertions(+), 28 deletions(-) create mode 100644 PWGHF/HFC/TableProducer/correlatorDsHadronsReduced.cxx diff --git a/PWGHF/HFC/TableProducer/CMakeLists.txt b/PWGHF/HFC/TableProducer/CMakeLists.txt index e3fc1bd5938..1847bcf9890 100644 --- a/PWGHF/HFC/TableProducer/CMakeLists.txt +++ b/PWGHF/HFC/TableProducer/CMakeLists.txt @@ -44,6 +44,11 @@ o2physics_add_dpl_workflow(correlator-ds-hadrons PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(correlator-ds-hadrons-reduced + SOURCES correlatorDsHadronsReduced.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(correlator-dstar-hadrons SOURCES correlatorDstarHadrons.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index 6d85a17cb80..090b3f45d23 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -61,8 +61,8 @@ struct HfCorrelatorDsHadronsSelCollision { Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; - SliceCache cache; HfHelper hfHelper; + SliceCache cache; using SelCollisions = soa::Join; using CandDsData = soa::Filtered>; @@ -169,15 +169,8 @@ struct HfCorrelatorDsHadrons { Configurable> binsPtHadron{"binsPtHadron", std::vector{0.3, 2., 4., 8., 12., 50.}, "pT bin limits for assoc particle"}; Configurable> binsPtEfficiencyD{"binsPtEfficiencyD", std::vector{o2::analysis::hf_cuts_ds_to_k_k_pi::vecBinsPt}, "pT bin limits for efficiency"}; Configurable> efficiencyD{"efficiencyD", {1., 1., 1., 1., 1., 1.}, "efficiency values for Ds meson"}; - ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0, -2.5, 2.5, 10.0}, "z vertex position pools"}; - ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0., 900., 1800., 6000.}, "event multiplicity pools (FT0M)"}; - ConfigurableAxis binsMassD{"binsMassD", {200, 1.7, 2.25}, "inv. mass (K^{#pm}K^{-}#pi^{+}) (GeV/#it{c}^{2})"}; - ConfigurableAxis binsEta{"binsEta", {50, -2., 2.}, "#it{#eta}"}; - ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; - ConfigurableAxis binsMultiplicity{"binsMultiplicity", {200, 0., 800.}, "Multiplicity"}; - ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 6000.}, "Multiplicity as FT0M signal amplitude"}; - ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; - ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; + + int hfcReducedCollisionIndex = 0; HfHelper hfHelper; SliceCache cache; @@ -195,6 +188,22 @@ struct HfCorrelatorDsHadrons { Filter flagDsFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::DsToKKPi)) != static_cast(0)) && (aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs); Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); + Preslice candsDsPerCollision = aod::hf_cand::collisionId; + Preslice trackIndicesPerCollision = aod::track::collisionId; + Preslice perCollisionCandMc = o2::aod::mcparticle::mcCollisionId; + PresliceUnsorted> collPerCollMc = o2::aod::mccollisionlabel::mcCollisionId; + + ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0, -2.5, 2.5, 10.0}, "z vertex position pools"}; + ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0., 900., 1800., 6000.}, "event multiplicity pools (FT0M)"}; + ConfigurableAxis binsMassD{"binsMassD", {200, 1.7, 2.25}, "inv. mass (K^{#pm}K^{-}#pi^{+}) (GeV/#it{c}^{2})"}; + ConfigurableAxis binsEta{"binsEta", {50, -2., 2.}, "#it{#eta}"}; + + ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; + ConfigurableAxis binsMultiplicity{"binsMultiplicity", {200, 0., 800.}, "Multiplicity"}; + ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 6000.}, "Multiplicity as FT0M signal amplitude"}; + ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; + ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; + HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) @@ -581,9 +590,6 @@ struct HfCorrelatorDsHadrons { } PROCESS_SWITCH(HfCorrelatorDsHadrons, processMcRec, "Process MC Reco mode", false); - Preslice perCollisionCandMc = o2::aod::mcparticle::mcCollisionId; - PresliceUnsorted> collPerCollMc = o2::aod::mccollisionlabel::mcCollisionId; - /// Ds-Hadron correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) void processMcGen(SelCollisionsMc const& mcCollisions, soa::Join const& collisions, @@ -689,32 +695,75 @@ struct HfCorrelatorDsHadrons { } PROCESS_SWITCH(HfCorrelatorDsHadrons, processMcGen, "Process MC Gen mode", false); - void processDerivedDataDs(SelCollisionsWithDs::iterator const& collision, + void processDerivedDataDs(SelCollisionsWithDs const& collisions, CandDsData const& candidates, MyTracksData const& tracks) { - collReduced(collision.multFT0M(), collision.posZ()); - // Ds fill histograms and Ds candidates information stored - for (const auto& candidate : candidates) { - // candidate selected - if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - candReduced(collReduced.lastIndex(), candidate.phi(), candidate.eta(), candidate.pt(), hfHelper.invMassDsToKKPi(candidate)); - } else if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - candReduced(collReduced.lastIndex(), candidate.phi(), candidate.eta(), candidate.pt(), hfHelper.invMassDsToPiKK(candidate)); + for (const auto& collision : collisions) { + auto thisCollId = collision.globalIndex(); + auto candsDsThisColl = candidates.sliceBy(candsDsPerCollision, thisCollId); + auto tracksThisColl = tracks.sliceBy(trackIndicesPerCollision, thisCollId); + + // Ds fill histograms and Ds candidates information stored + for (const auto& candidate : candidates) { + // candidate selected + if (candidate.isSelDsToKKPi() >= selectionFlagDs) { + candReduced(hfcReducedCollisionIndex, candidate.phi(), candidate.eta(), candidate.pt(), hfHelper.invMassDsToKKPi(candidate)); + } else if (candidate.isSelDsToPiKK() >= selectionFlagDs) { + candReduced(hfcReducedCollisionIndex, candidate.phi(), candidate.eta(), candidate.pt(), hfHelper.invMassDsToPiKK(candidate)); + } } - } - // tracks information - for (const auto& track : tracks) { - if (!track.isGlobalTrackWoDCA()) { - continue; + // tracks information + for (const auto& track : tracks) { + if (!track.isGlobalTrackWoDCA()) { + continue; + } + assocTrackReduced(hfcReducedCollisionIndex, track.phi(), track.eta(), track.pt()); } - assocTrackReduced(collReduced.lastIndex(), track.phi(), track.eta(), track.pt()); + + collReduced(collision.multFT0M(), collision.posZ()); + hfcReducedCollisionIndex++; } } PROCESS_SWITCH(HfCorrelatorDsHadrons, processDerivedDataDs, "Process derived data Ds", false); + void processDerivedDataDsLastIndex(SelCollisionsWithDs const& collisions, + CandDsData const& candidates, + MyTracksData const& tracks) + { + + for (const auto& collision : collisions) { + auto thisCollId = collision.globalIndex(); + auto candsDsThisColl = candidates.sliceBy(candsDsPerCollision, thisCollId); + auto tracksThisColl = tracks.sliceBy(trackIndicesPerCollision, thisCollId); + + int indexHfcReducedCollision = collReduced.lastIndex() + 1; + + // Ds fill histograms and Ds candidates information stored + for (const auto& candidate : candidates) { + // candidate selected + if (candidate.isSelDsToKKPi() >= selectionFlagDs) { + candReduced(indexHfcReducedCollision, candidate.phi(), candidate.eta(), candidate.pt(), hfHelper.invMassDsToKKPi(candidate)); + } else if (candidate.isSelDsToPiKK() >= selectionFlagDs) { + candReduced(indexHfcReducedCollision, candidate.phi(), candidate.eta(), candidate.pt(), hfHelper.invMassDsToPiKK(candidate)); + } + } + + // tracks information + for (const auto& track : tracks) { + if (!track.isGlobalTrackWoDCA()) { + continue; + } + assocTrackReduced(indexHfcReducedCollision, track.phi(), track.eta(), track.pt()); + } + + collReduced(collision.multFT0M(), collision.posZ()); + } + } + PROCESS_SWITCH(HfCorrelatorDsHadrons, processDerivedDataDsLastIndex, "Process derived data Ds w lastIndex", false); + // Event Mixing void processDataME(SelCollisionsWithDs const& collisions, CandDsData const& candidates, diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadronsReduced.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadronsReduced.cxx new file mode 100644 index 00000000000..37cf40766f2 --- /dev/null +++ b/PWGHF/HFC/TableProducer/correlatorDsHadronsReduced.cxx @@ -0,0 +1,122 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file correlatorDsHadronsReduced.cxx +/// \brief Ds-Hadrons correlator task for ME offline +/// \author Samuele Cattaruzzi + +#include + +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" + +#include "PWGHF/HFC/DataModel/CorrelationTables.h" +#include "PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h" + +using namespace o2; +using namespace o2::analysis; +using namespace o2::constants::physics; +using namespace o2::constants::math; +using namespace o2::framework; +using namespace o2::framework::expressions; + +/// Returns deltaPhi value in range [-pi/2., 3.*pi/2], typically used for correlation studies +double getDeltaPhi(double phiHadron, double phiD) +{ + return RecoDecay::constrainAngle(phiHadron - phiD, -PIHalf); +} + +// binning type +using BinningTypeDerived = ColumnBinningPolicy; + +/// Ds-Hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) +struct HfCorrelatorDsHadronsReduced { + Produces entryDsHadronPair; + Produces entryDsHadronRecoInfo; + Produces entryDsHadronGenInfo; + + Configurable fillHistoData{"fillHistoData", true, "Flag for filling histograms in data processes"}; + Configurable numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"}; + + SliceCache cache; + + // Preslice tracksPerCol = aod::hf_assoc_track_reduced::hfcRedCollisionId; + Preslice tracksPerCol = aod::hf_candidate_reduced::hfcRedCollisionId; + Preslice candPerCol = aod::hf_candidate_reduced::hfcRedCollisionId; + + ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0, -2.5, 2.5, 10.0}, "z vertex position pools"}; + ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0., 900., 1800., 6000.}, "event multiplicity pools (FT0M)"}; + ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 6000.}, "Multiplicity as FT0M signal amplitude"}; + ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; + ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; + + HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; + + void init(InitContext&) + { + AxisSpec axisMultFT0M = {binsMultFT0M, "MultiplicityFT0M"}; + AxisSpec axisPosZ = {binsPosZ, "PosZ"}; + AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"}; + + // Histograms for data analysis + if (fillHistoData) { + registry.add("hMultFT0M", "Multiplicity FT0M", {HistType::kTH1F, {axisMultFT0M}}); + registry.add("hZVtx", "z vertex", {HistType::kTH1F, {axisPosZ}}); + registry.add("hDsPoolBin", "Ds candidates pool bin", {HistType::kTH1F, {axisPoolBin}}); + registry.add("hTracksPoolBin", "Particles associated pool bin", {HistType::kTH1F, {axisPoolBin}}); + } + } + + void processDerivedDataME(aod::HfcRedCollisions const& collisions, + aod::DsCandReduceds const& candidates, + aod::AssocTrackReds const& tracks) + { + + BinningTypeDerived corrBinning{{zPoolBins, multPoolBins}, true}; + + auto tracksTuple = std::make_tuple(candidates, tracks); + + Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + + for (const auto& [c1, tracks1, c2, tracks2] : pairData) { + if (tracks1.size() == 0) { + continue; + } + + int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multiplicity())); + int poolBinDs = corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multiplicity())); + registry.fill(HIST("hMultFT0M"), c1.multiplicity()); + registry.fill(HIST("hZVtx"), c1.posZ()); + registry.fill(HIST("hTracksPoolBin"), poolBin); + registry.fill(HIST("hDsPoolBin"), poolBinDs); + + for (const auto& [cand, pAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + LOGF(info, "Mixed event tracks pair: (%d, %d) from events (%d, %d), track event: (%d, %d)", cand.index(), pAssoc.index(), c1.index(), c2.index(), cand.hfcRedCollisionId(), pAssoc.hfcRedCollisionId()); + + entryDsHadronPair(getDeltaPhi(pAssoc.phiAssocTrack(), cand.phiCand()), + pAssoc.etaAssocTrack() - cand.etaCand(), + cand.ptCand(), + pAssoc.ptAssocTrack(), + poolBin); + entryDsHadronRecoInfo(cand.invMassDs(), false, false); + entryDsHadronGenInfo(false, false, 0); + } + } + } + PROCESS_SWITCH(HfCorrelatorDsHadronsReduced, processDerivedDataME, "Process Mixed Event Derived Data", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From f67772bfd24cb70640e1a125bb7522da61766cf5 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Wed, 18 Dec 2024 11:49:00 +0100 Subject: [PATCH 425/459] [PWGLF] add its nsigma cut + add trigger class cut (#9032) Co-authored-by: ALICE Action Bot --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 36 ++++++++++++++++-------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index 38a8fd8a0c2..a5a290e2b92 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -59,9 +59,10 @@ using BCsWithRun2Info = soa::Join; namespace { constexpr int kNpart = 2; -constexpr float trackSels[10]{/* 60, */ 80, 100, 2, 3, /* 4, */ 0.05, 0.1, /* 0.15, */ 0.5, 1, /* 1.5, */ 2, 3 /* , 4 */}; +constexpr float trackSels[12]{/* 60, */ 80, 100, 2, 3, /* 4, */ 0.05, 0.1, /* 0.15, */ 0.5, 1, /* 1.5, */ 2, 3 /* , 4 */, 2, 3, /*, 4 */}; constexpr float dcaSels[3]{10., 10., 10.}; constexpr double betheBlochDefault[kNpart][6]{{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}, {-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}}; +constexpr double betheBlochDefaultITS[6]{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}; constexpr double estimatorsCorrelationCoef[2]{-0.669108, 1.04489}; constexpr double estimatorsSigmaPars[4]{0.933321, 0.0416976, -0.000936344, 8.92179e-06}; constexpr double deltaEstimatorNsigma[2]{5.5, 5.}; @@ -69,7 +70,7 @@ constexpr double partMass[kNpart]{o2::constants::physics::MassProton, o2::consta constexpr double partPdg[kNpart]{2212, o2::constants::physics::kDeuteron}; static const std::vector betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"}; static const std::vector particleNamesPar{"p", "d"}; -static const std::vector trackSelsNames{"tpcClsMid", "tpcClsTight", "chi2TpcTight", "chi2TpcMid", "dcaxyTight", "dcaxyMid", "dcazTight", "dcazMid", "tpcNsigmaTight", "tpcNsigmaMid"}; +static const std::vector trackSelsNames{"tpcClsMid", "tpcClsTight", "chi2TpcTight", "chi2TpcMid", "dcaxyTight", "dcaxyMid", "dcazTight", "dcazMid", "tpcNsigmaTight", "tpcNsigmaMid", "itsNsigmaTight", "itsNsigmaMid"}; static const std::vector dcaSelsNames{"dcaxy", "dcaz", "dca"}; static const std::vector particleName{"p"}; std::array, kNpart> tofMass; @@ -216,6 +217,7 @@ struct ebyeMaker { Configurable cfgMaterialCorrection{"cfgMaterialCorrection", static_cast(o2::base::Propagator::MatCorrType::USEMatCorrNONE), "Type of material correction"}; Configurable> cfgBetheBlochParams{"cfgBetheBlochParams", {betheBlochDefault[0], 2, 6, particleNamesPar, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for deuteron"}; + Configurable> cfgBetheBlochParamsITS{"cfgBetheBlochParamsITS", {betheBlochDefaultITS, 1, 6, particleName, betheBlochParNames}, "ITS Bethe-Bloch parameterisation for deuteron"}; ConfigurableAxis centAxis{"centAxis", {106, 0, 106}, "binning for the centrality"}; ConfigurableAxis zVtxAxis{"zVtxBins", {100, -20.f, 20.f}, "Binning for the vertex z in cm"}; @@ -235,6 +237,8 @@ struct ebyeMaker { Configurable etaMaxV0dau{"etaMaxV0dau", 0.8f, "maximum eta V0 daughters"}; Configurable outerPIDMin{"outerPIDMin", -4.f, "minimum outer PID"}; + Configurable triggerCut{"triggerCut", 0x1, "trigger class to select"}; + Configurable fillOnlySignal{"fillOnlySignal", false, "fill histograms only for true signal candidates (MC)"}; Configurable genName{"genname", "", "Genearator name: HIJING, PYTHIA8, ... Default: \"\""}; @@ -292,7 +296,7 @@ struct ebyeMaker { Configurable antidItsClsSizeCut{"antidItsClsSizeCut", 1.e-10f, "cluster size cut for antideuterons"}; Configurable antidPtItsClsSizeCut{"antidPtItsClsSizeCut", 10.f, "pt for cluster size cut for antideuterons"}; - Configurable> cfgTrackSels{"cfgTrackSels", {trackSels, 1, 10, particleName, trackSelsNames}, "Track selections"}; + Configurable> cfgTrackSels{"cfgTrackSels", {trackSels, 1, 12, particleName, trackSelsNames}, "Track selections"}; std::array ptMin; std::array ptTof; @@ -464,13 +468,16 @@ struct ebyeMaker { } template - float getITSSignal(T const& track, aod::Run2TrackExtras const& trackExtraRun2) + std::pair getITSSignal(T const& track, aod::Run2TrackExtras const& trackExtraRun2) { if ((doprocessMiniRun2 || doprocessMiniMcRun2) && track.hasITS()) { auto extra = trackExtraRun2.rawIteratorAt(track.globalIndex()); - return extra.itsSignal(); + double expBethe{tpc::BetheBlochAleph(static_cast(track.p() / partMass[0]), cfgBetheBlochParamsITS->get("p0"), cfgBetheBlochParamsITS->get("p1"), cfgBetheBlochParamsITS->get("p2"), cfgBetheBlochParamsITS->get("p3"), cfgBetheBlochParamsITS->get("p4"))}; + double expSigma{expBethe * cfgBetheBlochParamsITS->get("resolution")}; + auto nSigmaITS = static_cast((extra.itsSignal() - expBethe) / expSigma); + return std::make_pair(extra.itsSignal(), nSigmaITS); } - return -999.f; + return std::make_pair(-999.f, -999.f); } template @@ -535,8 +542,10 @@ struct ebyeMaker { mask |= kTPCPIDTight; else if (std::abs(track.tpcnsigma) < cfgTrackSels->get("tpcNsigmaMid")) mask |= kTPCPIDMid; - // if (track.itsnsigma < 2) mask |= kITSPIDTight; - // else if (track.itsnsigma < 3) mask |= kITSPIDMid; + if (std::abs(track.itsnsigma) < cfgTrackSels->get("itsNsigmaTight")) + mask |= kITSPIDTight; + else if (std::abs(track.itsnsigma) < cfgTrackSels->get("itsNsigmaMid")) + mask |= kITSPIDMid; return mask; } @@ -1168,14 +1177,17 @@ struct ebyeMaker { if (!hasHMV0M && trigger == 0x0) { continue; } + if (trigger != triggerCut && triggerCut != 0x2) { + continue; + } miniCollTable(static_cast(collision.posZ() * 10), trigger, nTrackletsColl, cV0M); for (auto& candidateTrack : candidateTracks[0]) { // protons auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex); float outerPID = getOuterPID(tk); - float itsSignal = getITSSignal(tk, trackExtraRun2); + auto [itsSignal, nSigmaITS] = getITSSignal(tk, trackExtraRun2); histos.fill(HIST("QA/itsSignal"), tk.p(), itsSignal); - + candidateTrack.itsnsigma = nSigmaITS; candidateTrack.outerPID = tk.pt() < antipPtTof ? candidateTrack.outerPID : outerPID; int selMask = getTrackSelMask(candidateTrack); if (candidateTrack.outerPID < outerPIDMin) @@ -1367,9 +1379,9 @@ struct ebyeMaker { if (candidateTrack.isreco) { auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex); float outerPID = getOuterPID(tk); - float itsSignal = getITSSignal(tk, trackExtraRun2); + auto [itsSignal, nSigmaITS] = getITSSignal(tk, trackExtraRun2); histos.fill(HIST("QA/itsSignal"), tk.p(), itsSignal); - + candidateTrack.itsnsigma = nSigmaITS; candidateTrack.outerPID = tk.pt() < antipPtTof ? candidateTrack.outerPID : outerPID; selMask = getTrackSelMask(candidateTrack); // if (candidateTrack.outerPID < -4) From cab7807bf38def53cae20f4ed5de08f68f8681e8 Mon Sep 17 00:00:00 2001 From: Fernanda Torres <135931275+mtorresc15@users.noreply.github.com> Date: Wed, 18 Dec 2024 04:57:40 -0600 Subject: [PATCH 426/459] [PWGLF] Decay length of Mother. (#9036) --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 5c766a92a6f..82aa3de2e14 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -340,7 +340,7 @@ struct tofSpectra { const AxisSpec phiAxis{200, 0, 7, "#it{#varphi} (rad)"}; const AxisSpec dcaZAxis{binsOptions.binsDca, "DCA_{z} (cm)"}; const AxisSpec lengthAxis{100, 0, 600, "Track length (cm)"}; - const AxisSpec decayLengthAxis{100, 0, 0.5, "Decay Length (cm)"}; + const AxisSpec decayLengthAxis{100, 0, 1.0, "Decay Length (cm)"}; if (enableTrackCutHistograms) { const AxisSpec chargeAxis{2, -2.f, 2.f, "Charge"}; @@ -1697,14 +1697,17 @@ struct tofSpectra { if (motherPdgCode == 421) { IsD0Mother = true; } - if (charmOrigin == RecoDecay::OriginType::NonPrompt && ((motherPdgCode) / 1000 == 5 || (motherPdgCode) / 100 == 5)) { + if (charmOrigin == RecoDecay::OriginType::NonPrompt) { IsBeautyMother = true; + std::cout << "Charm Origin for Beauty:" << charmOrigin << std::endl; } - if (charmOrigin == RecoDecay::OriginType::Prompt && ((motherPdgCode) / 1000 == 4 || (motherPdgCode) / 100 == 4)) { + if (charmOrigin == RecoDecay::OriginType::Prompt) { IsCharmMother = true; + std::cout << "Charm Origin for Charm:" << charmOrigin << std::endl; } - if (!(motherPdgCode / 1000 == 4 || motherPdgCode / 100 == 4) && !(motherPdgCode / 1000 == 5 || motherPdgCode / 100 == 5)) { + if (charmOrigin == RecoDecay::OriginType::None) { IsNotHFMother = true; + std::cout << "Charm Origin for NotHF:" << charmOrigin << std::endl; } } } From 9f063da7d3b92a9fd84f6ac80890132c4b9e30ad Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:21:11 +0100 Subject: [PATCH 427/459] [PWGLF] TPC PID info in f1 table, improved PID and background for f1 (#9033) --- PWGLF/DataModel/ReducedF1ProtonTables.h | 4 + .../Resonances/f1protonreducedtable.cxx | 12 ++- .../Tasks/Resonances/f1protoncorrelation.cxx | 95 ++++++++++++++----- 3 files changed, 87 insertions(+), 24 deletions(-) diff --git a/PWGLF/DataModel/ReducedF1ProtonTables.h b/PWGLF/DataModel/ReducedF1ProtonTables.h index e7534204f54..0f5576a2eb9 100644 --- a/PWGLF/DataModel/ReducedF1ProtonTables.h +++ b/PWGLF/DataModel/ReducedF1ProtonTables.h @@ -60,6 +60,8 @@ DECLARE_SOA_COLUMN(F1d3Py, f1d3Py, float); //! F DECLARE_SOA_COLUMN(F1d3Pz, f1d3Pz, float); //! F1 d3 Pz DECLARE_SOA_COLUMN(F1d1TOFHit, f1d1TOFHit, int); //! TOF hit pion DECLARE_SOA_COLUMN(F1d2TOFHit, f1d2TOFHit, int); //! TOF hit pion +DECLARE_SOA_COLUMN(F1d1TPC, f1d1TPC, float); //! TPC nsigma pion +DECLARE_SOA_COLUMN(F1d2TPC, f1d2TPC, float); //! TPC nsigma kaon DECLARE_SOA_COLUMN(F1Mass, f1Mass, float); //! F1 mass DECLARE_SOA_COLUMN(F1MassKaonKshort, f1MassKaonKshort, float); //! F1 mass kaon kshort DECLARE_SOA_COLUMN(F1PionIndex, f1PionIndex, int64_t); //! F1 pion index @@ -93,6 +95,8 @@ DECLARE_SOA_TABLE(F1Tracks, "AOD", "F1TRACK", f1protondaughter::F1d3Pz, f1protondaughter::F1d1TOFHit, f1protondaughter::F1d2TOFHit, + f1protondaughter::F1d1TPC, + f1protondaughter::F1d2TPC, f1protondaughter::F1Mass, f1protondaughter::F1MassKaonKshort, f1protondaughter::F1PionIndex, diff --git a/PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx b/PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx index 50eb1ba4ffd..324f2ed2b01 100644 --- a/PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx +++ b/PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx @@ -530,10 +530,14 @@ struct f1protonreducedtable { // keep TOF Hit of pion std::vector PionTOFHit = {}; std::vector PionTOFHitFinal = {}; + std::vector PionTPC = {}; + std::vector PionTPCFinal = {}; // keep TOF Hit of kaon std::vector KaonTOFHit = {}; std::vector KaonTOFHitFinal = {}; + std::vector KaonTPC = {}; + std::vector KaonTPCFinal = {}; // keep kaon-kshort mass of f1resonance std::vector f1kaonkshortmass = {}; @@ -618,9 +622,11 @@ struct f1protonreducedtable { auto PionTOF = 0; if (track.sign() > 0) { qaRegistry.fill(HIST("hNsigmaPtpionTPC"), nTPCSigmaP[0], track.pt()); + PionTPC.push_back(nTPCSigmaP[0]); } if (track.sign() < 0) { qaRegistry.fill(HIST("hNsigmaPtpionTPC"), nTPCSigmaN[0], track.pt()); + PionTPC.push_back(nTPCSigmaN[0]); } if (track.hasTOF()) { qaRegistry.fill(HIST("hNsigmaPtpionTOF"), track.tofNSigmaPi(), track.pt()); @@ -637,9 +643,11 @@ struct f1protonreducedtable { auto KaonTOF = 0; if (track.sign() > 0) { qaRegistry.fill(HIST("hNsigmaPtkaonTPC"), nTPCSigmaP[1], track.pt()); + KaonTPC.push_back(nTPCSigmaP[1]); } if (track.sign() < 0) { qaRegistry.fill(HIST("hNsigmaPtkaonTPC"), nTPCSigmaN[1], track.pt()); + KaonTPC.push_back(nTPCSigmaN[1]); } if (track.hasTOF()) { qaRegistry.fill(HIST("hNsigmaPtkaonTOF"), track.tofNSigmaKa(), track.pt()); @@ -742,6 +750,8 @@ struct f1protonreducedtable { F1KshortDaughterNegativeIndex.push_back(KshortNegDaughIndex.at(i3)); PionTOFHitFinal.push_back(PionTOFHit.at(i1)); // Pion TOF Hit KaonTOFHitFinal.push_back(KaonTOFHit.at(i2)); // Kaon TOF Hit + PionTPCFinal.push_back(PionTPC.at(i1)); // Pion TPC + KaonTPCFinal.push_back(KaonTPC.at(i2)); // Kaon TPC if (pairsign == 1) { qaRegistry.fill(HIST("hInvMassf1"), F1Vector.M(), F1Vector.Pt()); numberF1 = numberF1 + 1; @@ -798,7 +808,7 @@ struct f1protonreducedtable { F1d1dummy = f1resonanced1.at(i5); F1d2dummy = f1resonanced2.at(i5); F1d3dummy = f1resonanced3.at(i5); - f1track(indexEvent, f1signal.at(i5), F1VectorDummy.Px(), F1VectorDummy.Py(), F1VectorDummy.Pz(), F1d1dummy.Px(), F1d1dummy.Py(), F1d1dummy.Pz(), F1d2dummy.Px(), F1d2dummy.Py(), F1d2dummy.Pz(), F1d3dummy.Px(), F1d3dummy.Py(), F1d3dummy.Pz(), PionTOFHitFinal.at(i5), KaonTOFHitFinal.at(i5), F1VectorDummy.M(), f1kaonkshortmass.at(i5), F1PionIndex.at(i5), F1KaonIndex.at(i5), F1KshortDaughterPositiveIndex.at(i5), F1KshortDaughterNegativeIndex.at(i5)); + f1track(indexEvent, f1signal.at(i5), F1VectorDummy.Px(), F1VectorDummy.Py(), F1VectorDummy.Pz(), F1d1dummy.Px(), F1d1dummy.Py(), F1d1dummy.Pz(), F1d2dummy.Px(), F1d2dummy.Py(), F1d2dummy.Pz(), F1d3dummy.Px(), F1d3dummy.Py(), F1d3dummy.Pz(), PionTOFHitFinal.at(i5), KaonTOFHitFinal.at(i5), PionTPCFinal.at(i5), KaonTPCFinal.at(i5), F1VectorDummy.M(), f1kaonkshortmass.at(i5), F1PionIndex.at(i5), F1KaonIndex.at(i5), F1KshortDaughterPositiveIndex.at(i5), F1KshortDaughterNegativeIndex.at(i5)); } //// Fill track table for proton////////////////// for (auto iproton = protons.begin(); iproton != protons.end(); ++iproton) { diff --git a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx index 31d72363498..5348bc46b6b 100644 --- a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx +++ b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx @@ -41,13 +41,16 @@ struct f1protoncorrelation { Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Value of the TOF Nsigma cut"}; // PID selection Configurable fillRotation{"fillRotation", 1, "Fill rotation"}; + Configurable pdepPID{"pdepPID", 1, "Momentum dependent pi, k PID"}; Configurable strategyPIDPion{"strategyPIDPion", 0, "PID strategy Pion"}; Configurable strategyPIDKaon{"strategyPIDKaon", 0, "PID strategy Kaon"}; Configurable maxKKS0Mass{"maxKKS0Mass", 1.025, "Maximum kaon kshort mass"}; Configurable maxMomentumPion{"maxMomentumPion", 4.0, "Maximum momentum Pion"}; Configurable maxMomentumKaon{"maxMomentumKaon", 4.0, "Maximum momentum Kaon"}; - Configurable momentumTOFPion{"momentumTOFPion", 0.8, "Pion momentum TOF"}; - Configurable momentumTOFKaon{"momentumTOFKaon", 0.8, "Kaon momentum TOF"}; + Configurable momentumTOFPionMin{"momentumTOFPionMin", 0.8, "Pion momentum TOF Min"}; + Configurable momentumTOFKaonMin{"momentumTOFKaonMin", 0.8, "Kaon momentum TOF Min"}; + Configurable momentumTOFPionMax{"momentumTOFPionMax", 1.2, "Pion momentum TOF Max"}; + Configurable momentumTOFKaonMax{"momentumTOFKaonMax", 1.2, "Kaon momentum TOF Max"}; Configurable momentumTOFProton{"momentumTOFProton", 0.7, "Proton momentum TOF"}; Configurable lowPtF1{"lowPtF1", 1.0, "PT cut F1"}; // Event Mixing @@ -59,8 +62,10 @@ struct f1protoncorrelation { void init(o2::framework::InitContext&) { // register histograms - histos.add("hNsigmaProtonTPCSE", "Nsigma Proton TPC distribution same event", kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 1.0f}}); - histos.add("hNsigmaProtonTPCME", "Nsigma Proton TPC distribution mixed event", kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 1.0f}}); + histos.add("hNsigmaProtonTPC", "Nsigma Proton TPC distribution", kTH2F, {{100, -5.0f, 5.0f}, {100, 0.0f, 10.0f}}); + histos.add("hNsigmaKaonTPC", "Nsigma Kaon TPC distribution", kTH2F, {{100, -5.0f, 5.0f}, {100, 0.0f, 10.0f}}); + histos.add("hNsigmaPionTPC", "Nsigma Pion TPC distribution", kTH2F, {{100, -5.0f, 5.0f}, {100, 0.0f, 10.0f}}); + histos.add("hNsigmaPionKaonTPC", "Nsigma Pion Kaon TPC correlation", kTH2F, {{100, -5.0f, 5.0f}, {100, -5.0f, 5.0f}}); histos.add("h2SameEventPtCorrelation", "Pt correlation of F1 and proton", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {100, 0.0, 10.0}}); histos.add("h2SameEventInvariantMassUnlike_mass", "Unlike Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); @@ -96,7 +101,7 @@ struct f1protoncorrelation { } TLorentzVector F1, Proton, F1ProtonPair, Pion, Kaon, Kshort; - TLorentzVector F1Rot, PionRot, KaonKshortPair; + TLorentzVector F1Rot, PionRot, KaonKshortPair, KaonKshortPairRot; // Process the data in same event void process(aod::RedF1PEvents::iterator const& /*collision*/, aod::F1Tracks const& f1tracks, aod::ProtonTracks const& protontracks) { @@ -109,15 +114,38 @@ struct f1protoncorrelation { Kaon.SetXYZM(f1track.f1d2Px(), f1track.f1d2Py(), f1track.f1d2Pz(), 0.493); Kshort.SetXYZM(f1track.f1d3Px(), f1track.f1d3Py(), f1track.f1d3Pz(), 0.497); KaonKshortPair = Kaon + Kshort; - if (Pion.P() > maxMomentumPion || Kaon.P() > maxMomentumKaon) { + if (Pion.Pt() > maxMomentumPion || Kaon.Pt() > maxMomentumKaon) { continue; } - if (strategyPIDPion == 1 && Pion.P() > momentumTOFPion && f1track.f1d1TOFHit() != 1) { + if (pdepPID) { + if (Kaon.Pt() <= 0.5 && (f1track.f1d2TPC() < -2.5 || f1track.f1d2TPC() > 2.5)) { + continue; + } + if (Kaon.Pt() > 0.5 && Kaon.Pt() <= 0.7 && (f1track.f1d2TPC() < -1.5 || f1track.f1d2TPC() > 2.5)) { + continue; + } + if (Kaon.Pt() > 0.7 && Kaon.Pt() <= 1.0 && (f1track.f1d2TPC() < -1.0 || f1track.f1d2TPC() > 2.5)) { + continue; + } + if (Kaon.Pt() > 1.0 && (f1track.f1d2TPC() < -2.0 || f1track.f1d2TPC() > 2.0)) { + continue; + } + if (Pion.Pt() < 2.0 && (f1track.f1d1TPC() < -2.5 || f1track.f1d1TPC() > 2.5)) { + continue; + } + if (Pion.Pt() > 2.0 && (f1track.f1d1TPC() < -2.0 || f1track.f1d1TPC() > 2.0)) { + continue; + } + } + if (strategyPIDPion == 1 && Pion.Pt() > momentumTOFPionMin && Pion.Pt() <= momentumTOFPionMax && f1track.f1d1TOFHit() != 1) { continue; } - if (strategyPIDKaon == 1 && Kaon.P() > momentumTOFKaon && f1track.f1d2TOFHit() != 1) { + if (strategyPIDKaon == 1 && Kaon.Pt() > momentumTOFKaonMin && Kaon.Pt() <= momentumTOFKaonMax && f1track.f1d2TOFHit() != 1) { continue; } + histos.fill(HIST("hNsigmaKaonTPC"), f1track.f1d2TPC(), Kaon.Pt()); + histos.fill(HIST("hNsigmaPionTPC"), f1track.f1d1TPC(), Pion.Pt()); + histos.fill(HIST("hNsigmaPionKaonTPC"), f1track.f1d1TPC(), f1track.f1d2TPC()); for (auto protontrack : protontracks) { Proton.SetXYZM(protontrack.protonPx(), protontrack.protonPy(), protontrack.protonPz(), 0.938); if (Proton.P() < momentumTOFProton && TMath::Abs(protontrack.protonNsigmaTPC()) > 3) { @@ -130,10 +158,12 @@ struct f1protoncorrelation { continue; } auto relative_momentum = getkstar(F1, Proton); + if (relative_momentum <= 0.5) { + histos.fill(HIST("hNsigmaProtonTPC"), protontrack.protonNsigmaTPC(), Proton.Pt()); + } histos.fill(HIST("h2SameEventPtCorrelation"), relative_momentum, F1.Pt(), Proton.Pt()); if (f1track.f1SignalStat() == 1) { histos.fill(HIST("h2SameEventInvariantMassUnlike_mass"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like - histos.fill(HIST("hNsigmaProtonTPCSE"), protontrack.protonNsigmaTPC(), relative_momentum); } if (f1track.f1SignalStat() == -1) { histos.fill(HIST("h2SameEventInvariantMassLike_mass"), relative_momentum, F1.Pt(), F1.M()); @@ -144,10 +174,10 @@ struct f1protoncorrelation { auto angleend = 7.0 * TMath::Pi() / 6.0; auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0)); auto rotangle = anglestart + nrotbkg * anglestep; - auto rotPionPx = f1track.f1d1Px() * std::cos(rotangle) - f1track.f1d1Py() * std::sin(rotangle); - auto rotPionPy = f1track.f1d1Px() * std::sin(rotangle) + f1track.f1d1Py() * std::cos(rotangle); - PionRot.SetXYZM(rotPionPx, rotPionPy, f1track.f1d1Pz(), 0.139); - F1Rot = PionRot + KaonKshortPair; + auto rotKKPx = KaonKshortPair.Px() * std::cos(rotangle) - KaonKshortPair.Py() * std::sin(rotangle); + auto rotKKPy = KaonKshortPair.Px() * std::sin(rotangle) + KaonKshortPair.Py() * std::cos(rotangle); + KaonKshortPairRot.SetXYZM(rotKKPx, rotKKPy, KaonKshortPair.Pz(), KaonKshortPair.M()); + F1Rot = Pion + KaonKshortPairRot; auto relative_momentum_rot = getkstar(F1Rot, Proton); if (f1track.f1SignalStat() == 1) { histos.fill(HIST("h2SameEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M()); @@ -195,13 +225,33 @@ struct f1protoncorrelation { Kaon.SetXYZM(t1.f1d2Px(), t1.f1d2Py(), t1.f1d2Pz(), 0.493); Kshort.SetXYZM(t1.f1d3Px(), t1.f1d3Py(), t1.f1d3Pz(), 0.497); KaonKshortPair = Kaon + Kshort; - if (Pion.P() > maxMomentumPion || Kaon.P() > maxMomentumKaon) { + if (Pion.Pt() > maxMomentumPion || Kaon.Pt() > maxMomentumKaon) { continue; } - if (strategyPIDPion == 1 && Pion.P() > momentumTOFPion && t1.f1d1TOFHit() != 1) { + if (pdepPID) { + if (Kaon.Pt() <= 0.5 && (t1.f1d2TPC() < -2.5 || t1.f1d2TPC() > 2.5)) { + continue; + } + if (Kaon.Pt() > 0.5 && Kaon.Pt() <= 0.7 && (t1.f1d2TPC() < -1.5 || t1.f1d2TPC() > 2.5)) { + continue; + } + if (Kaon.Pt() > 0.7 && Kaon.Pt() <= 1.0 && (t1.f1d2TPC() < -1.0 || t1.f1d2TPC() > 2.5)) { + continue; + } + if (Kaon.Pt() > 1.0 && (t1.f1d2TPC() < -2.0 || t1.f1d2TPC() > 2.0)) { + continue; + } + if (Pion.Pt() < 2.0 && (t1.f1d1TPC() < -2.5 || t1.f1d1TPC() > 2.5)) { + continue; + } + if (Pion.Pt() > 2.0 && (t1.f1d1TPC() < -2.0 || t1.f1d1TPC() > 2.0)) { + continue; + } + } + if (strategyPIDPion == 1 && Pion.Pt() > momentumTOFPionMin && Pion.Pt() <= momentumTOFPionMax && t1.f1d1TOFHit() != 1) { continue; } - if (strategyPIDKaon == 1 && Kaon.P() > momentumTOFKaon && t1.f1d2TOFHit() != 1) { + if (strategyPIDKaon == 1 && Kaon.Pt() > momentumTOFKaonMin && Kaon.Pt() <= momentumTOFKaonMax && t1.f1d2TOFHit() != 1) { continue; } Proton.SetXYZM(t2.protonPx(), t2.protonPy(), t2.protonPz(), 0.938); @@ -213,11 +263,10 @@ struct f1protoncorrelation { } auto relative_momentum = getkstar(F1, Proton); if (t1.f1SignalStat() == 1) { - histos.fill(HIST("h2MixEventInvariantMassUnlike_mass104"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like - histos.fill(HIST("hNsigmaProtonTPCME"), t2.protonNsigmaTPC(), relative_momentum); + histos.fill(HIST("h2MixEventInvariantMassUnlike_mass"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like } if (t1.f1SignalStat() == -1) { - histos.fill(HIST("h2MixEventInvariantMassLike_mass104"), relative_momentum, F1.Pt(), F1.M()); + histos.fill(HIST("h2MixEventInvariantMassLike_mass"), relative_momentum, F1.Pt(), F1.M()); } if (fillRotation) { for (int nrotbkg = 0; nrotbkg < 9; nrotbkg++) { @@ -225,10 +274,10 @@ struct f1protoncorrelation { auto angleend = 7.0 * TMath::Pi() / 6.0; auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0)); auto rotangle = anglestart + nrotbkg * anglestep; - auto rotPionPx = t1.f1d1Px() * std::cos(rotangle) - t1.f1d1Py() * std::sin(rotangle); - auto rotPionPy = t1.f1d1Px() * std::sin(rotangle) + t1.f1d1Py() * std::cos(rotangle); - PionRot.SetXYZM(rotPionPx, rotPionPy, t1.f1d1Pz(), 0.139); - F1Rot = PionRot + KaonKshortPair; + auto rotKKPx = KaonKshortPair.Px() * std::cos(rotangle) - KaonKshortPair.Py() * std::sin(rotangle); + auto rotKKPy = KaonKshortPair.Px() * std::sin(rotangle) + KaonKshortPair.Py() * std::cos(rotangle); + KaonKshortPairRot.SetXYZM(rotKKPx, rotKKPy, KaonKshortPair.Pz(), KaonKshortPair.M()); + F1Rot = Pion + KaonKshortPairRot; auto relative_momentum_rot = getkstar(F1Rot, Proton); if (t1.f1SignalStat() == 1) { histos.fill(HIST("h2MixEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M()); From 1f7a7aa87560db506bb3f357ca02b4fa8eb5b48f Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Wed, 18 Dec 2024 13:00:08 +0100 Subject: [PATCH 428/459] [PWGLF] Remove code duplication in nonPromptCascade task (#9035) --- PWGLF/DataModel/LFNonPromptCascadeTables.h | 4 + PWGLF/Tasks/Strangeness/nonPromptCascade.cxx | 440 +++++-------------- 2 files changed, 122 insertions(+), 322 deletions(-) diff --git a/PWGLF/DataModel/LFNonPromptCascadeTables.h b/PWGLF/DataModel/LFNonPromptCascadeTables.h index aa1a3cdb867..e6ed9470c46 100644 --- a/PWGLF/DataModel/LFNonPromptCascadeTables.h +++ b/PWGLF/DataModel/LFNonPromptCascadeTables.h @@ -113,6 +113,8 @@ DECLARE_SOA_TABLE(NPCascTable, "AOD", "NPCASCTABLE", NPCascadeTable::DeltaPtITSCascade, NPCascadeTable::ITSClusSize, NPCascadeTable::HasReassociatedCluster, + aod::collision::NumContrib, + aod::collision::CollisionTimeRes, NPCascadeTable::PvX, NPCascadeTable::PvY, NPCascadeTable::PvZ, @@ -175,6 +177,8 @@ DECLARE_SOA_TABLE(NPCascTableMC, "AOD", "NPCASCTABLEMC", NPCascadeTable::PdgCodeITStrack, NPCascadeTable::IsFromBeauty, NPCascadeTable::IsFromCharm, + aod::collision::NumContrib, + aod::collision::CollisionTimeRes, NPCascadeTable::PvX, NPCascadeTable::PvY, NPCascadeTable::PvZ, diff --git a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx index 5057a129e2d..9cc2bd3462e 100644 --- a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx +++ b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx @@ -13,7 +13,6 @@ #include #include #include -#include #include "CCDB/BasicCCDBManager.h" #include "Common/DataModel/Centrality.h" @@ -43,7 +42,10 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +namespace +{ struct NPCascCandidate { + int64_t mcParticleId; int64_t trackGlobID; int64_t trackITSID; int64_t collisionID; @@ -57,6 +59,8 @@ struct NPCascCandidate { int pdgCodeITStrack; bool isFromBeauty; bool isFromCharm; + uint16_t pvContributors; + float pvTimeResolution; float pvX; float pvY; float pvZ; @@ -123,8 +127,26 @@ struct daughtersDCA { float pionDCAz; }; -namespace +std::array isFromHF(auto& particle) { + bool fromBeauty = false; + bool fromCharm = false; + if (particle.has_mothers()) { + auto mom = particle.template mothers_as()[0]; + int pdgCodeMom = mom.pdgCode(); + fromBeauty = std::abs(pdgCodeMom) / 5000 == 1 || std::abs(pdgCodeMom) / 500 == 1 || std::abs(pdgCodeMom) == 5; + fromCharm = std::abs(pdgCodeMom) / 4000 == 1 || std::abs(pdgCodeMom) / 400 == 1 || std::abs(pdgCodeMom) == 4; + while (mom.has_mothers()) { + const auto grandma = mom.template mothers_as()[0]; + int pdgCodeGrandma = std::abs(grandma.pdgCode()); + fromBeauty = fromBeauty || (pdgCodeGrandma / 5000 == 1 || pdgCodeGrandma / 500 == 1 || pdgCodeGrandma == 5); + fromCharm = fromCharm || (pdgCodeGrandma / 4000 == 1 || pdgCodeGrandma / 400 == 1 || pdgCodeGrandma == 4); + mom = grandma; + } + } + return {fromBeauty, fromCharm}; +} + static constexpr int nParticles{4}; static constexpr int nCutsPID{2}; static const std::vector matterOrNot{"Matter", "Antimatter"}; @@ -139,10 +161,6 @@ static constexpr float cutsPID[nParticles][nCutsPID]{ std::shared_ptr h2TPCsignal[nParticles]; std::shared_ptr h2TPCnSigma[nParticles]; -std::shared_ptr invMassBCOmega; -std::shared_ptr invMassACOmega; -std::shared_ptr invMassBCXi; -std::shared_ptr invMassACXi; std::shared_ptr invMassBCV0; std::shared_ptr invMassACV0; @@ -277,10 +295,6 @@ struct NonPromptCascadeTask { cutsXi->GetXaxis()->SetBinLabel(5, "nSigmaTPCprotontrack"); cutsXi->GetXaxis()->SetBinLabel(6, "nSigmaTPCpiontrack"); - invMassBCOmega = registry.add("h_invariantmass_beforeCuts_Omega", "Invariant Mass (GeV/#it{c}^{2})", HistType::kTH1D, {{125, 1.650, 1.700, "Invariant Mass (GeV/#it{c}^{2})"}}); - invMassACOmega = registry.add("h_invariantmass_afterCuts_Omega", "Invariant Mass (GeV/#it{c}^{2})", HistType::kTH1D, {{125, 1.650, 1.700, "Invariant Mass (GeV/#it{c}^{2})"}}); - invMassBCXi = registry.add("h_invariantmass_beforeCuts_Xi", "Invariant Mass (GeV/#it{c}^{2})", HistType::kTH1D, {{125, 1.296, 1.346, "Invariant Mass (GeV/#it{c}^{2})"}}); - invMassACXi = registry.add("h_invariantmass_afterCuts_Xi", "Invariant Mass (GeV/#it{c}^{2})", HistType::kTH1D, {{125, 1.296, 1.346, "Invariant Mass (GeV/#it{c}^{2})"}}); invMassBCV0 = registry.add("h_invariantmass_beforeCuts_V0", "Invariant Mass (GeV/#it{c}^{2})", HistType::kTH1D, {{125, 1.090, 1.140, "Invariant Mass (GeV/#it{c}^{2})"}}); invMassACV0 = registry.add("h_invariantmass_afterCuts_V0", "Invariant Mass (GeV/#it{c}^{2})", HistType::kTH1D, {{125, 1.090, 1.140, "Invariant Mass (GeV/#it{c}^{2})"}}); } @@ -373,38 +387,14 @@ struct NonPromptCascadeTask { dDCA.pionDCAz = impactParameterPiontrack.getZ(); } - void processTrackedCascadesMC(CollisionCandidatesRun3MC const& collisions, - aod::AssignedTrackedCascades const& trackedCascades, aod::Cascades const& /*cascades*/, - aod::V0s const& /*v0s*/, TracksExtMC const& /*tracks*/, - aod::McParticles const& mcParticles, aod::McCollisions const&, aod::BCsWithTimestamps const&) + template + void fillCandidatesVector(CollisionType const&, auto const& trackedCascades) { - candidates.clear(); - std::vector mcParticleId; - - auto isFromHF = [&](auto particle) -> std::tuple { - bool fromBeauty = false; - bool fromCharm = false; - if (particle.has_mothers()) { - auto mom = particle.template mothers_as()[0]; - int pdgCodeMom = mom.pdgCode(); - fromBeauty = std::abs(pdgCodeMom) / 5000 == 1 || std::abs(pdgCodeMom) / 500 == 1 || std::abs(pdgCodeMom) == 5; - fromCharm = std::abs(pdgCodeMom) / 4000 == 1 || std::abs(pdgCodeMom) / 400 == 1 || std::abs(pdgCodeMom) == 4; - while (mom.has_mothers()) { - const auto grandma = mom.template mothers_as()[0]; - int pdgCodeGrandma = std::abs(grandma.pdgCode()); - fromBeauty = fromBeauty || (pdgCodeGrandma / 5000 == 1 || pdgCodeGrandma / 500 == 1 || pdgCodeGrandma == 5); - fromCharm = fromCharm || (pdgCodeGrandma / 4000 == 1 || pdgCodeGrandma / 400 == 1 || pdgCodeGrandma == 4); - mom = grandma; - } - } - return {fromBeauty, fromCharm}; - }; - for (const auto& trackedCascade : trackedCascades) { - auto collision = trackedCascade.collision_as(); - auto bc = collision.bc_as(); + auto collision = trackedCascade.template collision_as(); + auto bc = collision.template bc_as(); initCCDB(bc); const auto primaryVertex = getPrimaryVertex(collision); @@ -418,17 +408,19 @@ struct NonPromptCascadeTask { df2.setMinRelChi2Change(minRelChi2Change); df2.setUseAbsDCA(useAbsDCA); - const auto& track = trackedCascade.track_as(); - const auto& ITStrack = trackedCascade.itsTrack_as(); + const auto& track = trackedCascade.template track_as(); + const auto& ITStrack = trackedCascade.template itsTrack_as(); const auto& casc = trackedCascade.cascade(); - const auto& bachelor = casc.bachelor_as(); + const auto& bachelor = casc.template bachelor_as(); const auto& v0 = casc.v0(); - const auto& ptrack = v0.posTrack_as(); - const auto& ntrack = v0.negTrack_as(); + const auto& ptrack = v0.template posTrack_as(); + const auto& ntrack = v0.template negTrack_as(); const auto& protonTrack = bachelor.sign() > 0 ? ntrack : ptrack; const auto& pionTrack = bachelor.sign() > 0 ? ptrack : ntrack; + bool hasReassociatedClusters = (track.itsNCls() != ITStrack.itsNCls()); std::array, 2> momenta; + std::array v0Pos; std::array masses; // track propagation @@ -439,9 +431,6 @@ struct NonPromptCascadeTask { float cascCpa = -1; float v0Cpa = -1; - - std::array v0Pos = {-999., -999., -999.}; - if (df2.process(getTrackParCov(pionTrack), getTrackParCov(protonTrack))) { trackParCovV0 = df2.createParentTrackParCov(0); // V0 track retrieved from p and pi daughters v0Pos = {trackParCovV0.getX(), trackParCovV0.getY(), trackParCovV0.getZ()}; @@ -460,6 +449,7 @@ struct NonPromptCascadeTask { } else { continue; } + float deltaPtITSCascade = std::hypot(cascadeMomentum[0], cascadeMomentum[1]) - ITStrack.pt(); // PV registry.fill(HIST("h_PV_x"), primaryVertex.getX()); @@ -480,283 +470,39 @@ struct NonPromptCascadeTask { momenta[1] = {pionTrack.px(), pionTrack.py(), pionTrack.pz()}; const auto v0mass = RecoDecay::m(momenta, masses); - invMassBCOmega->Fill(massOmega); - - invMassBCXi->Fill(massXi); - invMassBCV0->Fill(v0mass); - - registry.fill(HIST("h_PIDcutsOmega"), 0, massOmega); - registry.fill(HIST("h_PIDcutsXi"), 0, massXi); - - int bachKaonNClusTPC = -1; - int bachPionNClusTPC = -1; - int bachKaonNClusITS = -1; - int bachPionNClusITS = -1; - - bachPionNClusTPC = bachelor.tpcNClsFound(); /// by default cascade = Xi - bachPionNClusITS = bachelor.itsNCls(); /// by default cascade = Xi - - bool bachKaonHasTOF = 0; - bool bachPionHasTOF = 0; - - bachPionHasTOF = bachelor.hasTOF(); - - // if (!bachelor.hasTOF() && !ptrack.hasTOF() && !ntrack.hasTOF()) { - // LOG(debug) << "no TOF: " << bachelor.hasTOF() << "/" << ptrack.hasTOF() << "/" << ntrack.hasTOF(); - // continue; - // } - - registry.fill(HIST("h_PIDcutsOmega"), 1, massOmega); - registry.fill(HIST("h_PIDcutsXi"), 1, massXi); - - if (protonTrack.tpcNClsFound() < cfgCutNclusTPC || pionTrack.tpcNClsFound() < cfgCutNclusTPC) { - LOG(debug) << "no tpcNClsFound: " << bachelor.tpcNClsFound() << "/" << protonTrack.tpcNClsFound() << "/" << pionTrack.tpcNClsFound(); - continue; - } - - registry.fill(HIST("h_PIDcutsOmega"), 2, massOmega); - registry.fill(HIST("h_PIDcutsXi"), 2, massXi); - - // QA PID - float nSigmaTPC[nParticles]{bachelor.tpcNSigmaKa(), bachelor.tpcNSigmaPi(), protonTrack.tpcNSigmaPr(), pionTrack.tpcNSigmaPi()}; - - if (bachelor.hasTPC()) { // same cuts for Omega and Xi - LOG(debug) << "TPCSignal bachelor " << bachelor.sign() << "/" << bachelor.tpcInnerParam() << "/" << bachelor.tpcSignal(); - if (nSigmaTPC[0] < cfgCutsPID->get(0u, 0u) || nSigmaTPC[0] > cfgCutsPID->get(0u, 1u)) { - continue; - } - } - registry.fill(HIST("h_PIDcutsOmega"), 3, massOmega); - registry.fill(HIST("h_PIDcutsXi"), 3, massXi); - - LOG(debug) << "TPCSignal protonTrack " << protonTrack.sign() << "/" << protonTrack.tpcInnerParam() << "/" << protonTrack.tpcSignal(); - if (nSigmaTPC[2] < cfgCutsPID->get(2u, 0u) || nSigmaTPC[2] > cfgCutsPID->get(2u, 1u)) { - continue; - } - - registry.fill(HIST("h_PIDcutsOmega"), 4, massOmega); - registry.fill(HIST("h_PIDcutsXi"), 4, massXi); - - LOG(debug) << "TPCSignal ntrack " << pionTrack.sign() << "/" << pionTrack.tpcInnerParam() << "/" << pionTrack.tpcSignal(); - if (nSigmaTPC[3] < cfgCutsPID->get(3u, 0u) || nSigmaTPC[3] > cfgCutsPID->get(3u, 1u)) { - continue; - } - - registry.fill(HIST("h_PIDcutsXi"), 5, massXi); - - registry.fill(HIST("h_PIDcutsOmega"), 5, massOmega); - invMassACOmega->Fill(massOmega); - registry.fill(HIST("h_massvspt_Omega"), massOmega, track.pt()); - - registry.fill(HIST("h_PIDcutsXi"), 5, massXi); - - invMassACXi->Fill(massXi); - registry.fill(HIST("h_massvspt_Xi"), massXi, track.pt()); - - invMassACV0->Fill(v0mass); - registry.fill(HIST("h_massvspt_V0"), v0mass, track.pt()); - - motherDCA mDCA; - fillCascadeDCA(track, protonTrack, pionTrack, primaryVertex, true, mDCA); // always filling in MC - - LOGF(debug, "protonTrack (id: %d, pdg: %d) has mother %d", protonTrack.mcParticleId(), - protonTrack.mcParticle().pdgCode(), protonTrack.mcParticle().has_mothers() ? protonTrack.mcParticle().mothersIds()[0] : -1); - LOGF(debug, "pionTrack (id: %d, pdg: %d) has mother %d", pionTrack.mcParticleId(), - pionTrack.mcParticle().pdgCode(), pionTrack.mcParticle().has_mothers() ? pionTrack.mcParticle().mothersIds()[0] : -1); - - LOG(debug) << "bachelor with PDG code: " << bachelor.mcParticle().pdgCode() << ". Charge: " << bachelor.sign(); - if (ptrack.mcParticle().has_mothers() && pionTrack.mcParticle().has_mothers() && - protonTrack.mcParticle().mothersIds()[0] == pionTrack.mcParticle().mothersIds()[0]) { - const auto v0part = protonTrack.mcParticle().mothers_as()[0]; - LOG(debug) << "v0 with PDG code: " << v0part.pdgCode(); - } - daughtersDCA dDCA; - fillDauDCA(trackedCascade, bachelor, protonTrack, pionTrack, primaryVertex, true, dDCA); // always filling in MC - - bool isGoodCascade = false; - - int motherParticleID = -1; - - std::tuple fromHF{false, false}; - if (protonTrack.mcParticle().has_mothers() && pionTrack.mcParticle().has_mothers() && bachelor.mcParticle().has_mothers()) { - if (protonTrack.mcParticle().mothersIds()[0] == pionTrack.mcParticle().mothersIds()[0]) { - const auto v0part = protonTrack.mcParticle().mothers_first_as(); - if (std::abs(v0part.pdgCode()) == 3122 && v0part.has_mothers()) { - const auto motherV0 = v0part.mothers_as()[0]; - // const auto motherBach = bachelor.mcParticle().mothers_as()[0]; - if (v0part.mothersIds()[0] == bachelor.mcParticle().mothersIds()[0]) { - if (std::abs(motherV0.pdgCode()) == 3312 || abs(motherV0.pdgCode()) == 3334) { - isGoodCascade = true; - fromHF = isFromHF(motherV0); - motherParticleID = v0part.mothersIds()[0]; + //// Omega hypohesis -> rejecting Xi, we don't do it in the MC as we can identify the particle with the MC truth + bool isOmega{std::abs(massXi - constants::physics::MassXiMinus) > 0.005}; + + std::array fromHF{false, false}; + bool isGoodMatch{false}, isGoodCascade{false}; + int itsTrackPDG{0}, pdgCodeMom{0}; + int64_t mcParticleID{-1}; + + if constexpr (TrackType::template contains()) { + if (protonTrack.mcParticle().has_mothers() && pionTrack.mcParticle().has_mothers() && bachelor.mcParticle().has_mothers()) { + if (protonTrack.mcParticle().mothersIds()[0] == pionTrack.mcParticle().mothersIds()[0]) { + const auto v0part = protonTrack.mcParticle().template mothers_first_as(); + if (std::abs(v0part.pdgCode()) == 3122 && v0part.has_mothers()) { + const auto motherV0 = v0part.template mothers_as()[0]; + if (v0part.mothersIds()[0] == bachelor.mcParticle().mothersIds()[0]) { + if (std::abs(motherV0.pdgCode()) == 3312 || std::abs(motherV0.pdgCode()) == 3334) { + isGoodCascade = true; + isOmega = (std::abs(motherV0.pdgCode()) == 3334); + fromHF = isFromHF(motherV0); + mcParticleID = v0part.mothersIds()[0]; + } } } } } - } - - bool isGoodMatch = ((motherParticleID == ITStrack.mcParticleId())) ? true : false; - - int pdgCodeMom = 0; - if (isGoodMatch) { - pdgCodeMom = track.mcParticle().has_mothers() ? track.mcParticle().mothers_as()[0].pdgCode() : 0; - } - int itsTrackPDG = ITStrack.has_mcParticle() ? ITStrack.mcParticle().pdgCode() : 0; - float deltaPtITSCascade = std::hypot(cascadeMomentum[0], cascadeMomentum[1]) - ITStrack.pt(); - bool hasReassociatedClusters = (track.itsNCls() != ITStrack.itsNCls()); - candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), deltaPtITSCascade, trackedCascade.itsClsSize(), hasReassociatedClusters, isGoodMatch, isGoodCascade, pdgCodeMom, itsTrackPDG, std::get<0>(fromHF), std::get<1>(fromHF), - primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ(), - track.pt(), track.eta(), track.phi(), - protonTrack.pt(), protonTrack.eta(), pionTrack.pt(), pionTrack.eta(), bachelor.pt(), bachelor.eta(), - mDCA.DCAxy, mDCA.DCAz, dDCA.protonDCAxy, dDCA.protonDCAz, dDCA.pionDCAxy, dDCA.pionDCAz, dDCA.bachDCAxy, dDCA.bachDCAz, - cascCpa, v0Cpa, - massXi, massOmega, v0mass, - std::hypot(trackedCascade.decayX(), trackedCascade.decayY()), std::hypot(v0Pos[0], v0Pos[1]), std::hypot(trackedCascade.decayX(), trackedCascade.decayY(), trackedCascade.decayZ()), std::hypot(v0Pos[0], v0Pos[1], v0Pos[2]), - track.itsNCls(), protonTrack.itsNCls(), pionTrack.itsNCls(), bachKaonNClusITS, bachPionNClusITS, protonTrack.tpcNClsFound(), pionTrack.tpcNClsFound(), bachKaonNClusTPC, bachPionNClusTPC, - protonTrack.tpcNSigmaPr(), pionTrack.tpcNSigmaPi(), bachelor.tpcNSigmaKa(), bachelor.tpcNSigmaPi(), - protonTrack.hasTOF(), pionTrack.hasTOF(), bachKaonHasTOF, bachPionHasTOF, - protonTrack.tofNSigmaPr(), pionTrack.tofNSigmaPi(), bachelor.tofNSigmaKa(), bachelor.tofNSigmaPi()}); - - if (track.mcParticleId() < -1 || track.mcParticleId() >= mcParticles.size()) { - mcParticleId.push_back(-1); - } else { - mcParticleId.push_back(track.mcParticleId()); - } - } // end loop over tracked cascades - - for (size_t i = 0; i < candidates.size(); ++i) { - if (mcParticleId[i] < 0) { - continue; - } - auto particle = mcParticles.iteratorAt(mcParticleId[i]); - auto& c = candidates[i]; - auto mcCollision = particle.mcCollision_as(); - auto label = collisions.iteratorAt(c.collisionID); - - NPCTableMC(c.matchingChi2, c.deltaPt, c.itsClusSize, c.hasReassociatedCluster, c.isGoodMatch, c.isGoodCascade, c.pdgCodeMom, c.pdgCodeITStrack, c.isFromBeauty, c.isFromCharm, - c.pvX, c.pvY, c.pvZ, - c.cascPt, c.cascEta, c.cascPhi, - c.protonPt, c.protonEta, c.pionPt, c.pionEta, c.bachPt, c.bachEta, - c.cascDCAxy, c.cascDCAz, c.protonDCAxy, c.protonDCAz, c.pionDCAxy, c.pionDCAz, c.bachDCAxy, c.bachDCAz, - c.casccosPA, c.v0cosPA, - c.massXi, c.massOmega, c.massV0, - c.cascRadius, c.v0radius, c.cascLength, c.v0length, - c.cascNClusITS, c.protonNClusITS, c.pionNClusITS, c.bachKaonNClusITS, c.bachPionNClusITS, c.protonNClusTPC, c.pionNClusTPC, c.bachKaonNClusTPC, c.bachPionNClusTPC, - c.protonTPCNSigma, c.pionTPCNSigma, c.bachKaonTPCNSigma, c.bachPionTPCNSigma, - c.protonHasTOF, c.pionHasTOF, c.bachKaonHasTOF, c.bachPionHasTOF, - c.protonTOFNSigma, c.pionTOFNSigma, c.bachKaonTOFNSigma, c.bachPionTOFNSigma, - particle.pt(), particle.eta(), particle.phi(), particle.pdgCode(), mcCollision.posX() - particle.vx(), mcCollision.posY() - particle.vy(), mcCollision.posZ() - particle.vz(), mcCollision.globalIndex() == label.mcCollisionId()); - } - - for (const auto& p : mcParticles) { - auto absCode = std::abs(p.pdgCode()); - if (absCode != 3312 && absCode != 3334) { - continue; - } - auto fromHF = isFromHF(p); - int pdgCodeMom = p.has_mothers() ? p.mothers_as()[0].pdgCode() : 0; - auto mcCollision = p.mcCollision_as(); - - NPCTableGen(p.pt(), p.eta(), p.phi(), p.pdgCode(), pdgCodeMom, mcCollision.posX() - p.vx(), mcCollision.posY() - p.vy(), mcCollision.posZ() - p.vz(), std::get<0>(fromHF), std::get<1>(fromHF)); - } - } - PROCESS_SWITCH(NonPromptCascadeTask, processTrackedCascadesMC, "process cascades from strangeness tracking: MC analysis", true); - - void processTrackedCascadesData(CollisionCandidatesRun3 const& /*collisions*/, - aod::AssignedTrackedCascades const& trackedCascades, aod::Cascades const& /*cascades*/, - aod::V0s const& /*v0s*/, TracksExtData const& /*tracks*/, - aod::BCsWithTimestamps const&) - { - candidates.clear(); - for (const auto& trackedCascade : trackedCascades) { - bool isOmega{false}; - - auto collision = trackedCascade.collision_as(); - auto bc = collision.bc_as(); - initCCDB(bc); - - const auto primaryVertex = getPrimaryVertex(collision); - - o2::vertexing::DCAFitterN<2> df2; - df2.setBz(bz); - df2.setPropagateToPCA(propToDCA); - df2.setMaxR(maxR); - df2.setMaxDZIni(maxDZIni); - df2.setMinParamChange(minParamChange); - df2.setMinRelChi2Change(minRelChi2Change); - df2.setUseAbsDCA(useAbsDCA); - - const auto& track = trackedCascade.track_as(); - const auto& ITStrack = trackedCascade.itsTrack_as(); - const auto& casc = trackedCascade.cascade(); - const auto& bachelor = casc.bachelor_as(); - const auto& v0 = casc.v0(); - const auto& ptrack = v0.posTrack_as(); - const auto& ntrack = v0.negTrack_as(); - const auto& protonTrack = bachelor.sign() > 0 ? ntrack : ptrack; - const auto& pionTrack = bachelor.sign() > 0 ? ptrack : ntrack; - bool hasReassociatedClusters = (track.itsNCls() != ITStrack.itsNCls()); - - std::array, 2> momenta; - std::array masses; + isGoodMatch = ((mcParticleID == ITStrack.mcParticleId())) ? true : false; - // track propagation - o2::track::TrackParCov trackParCovV0; - o2::track::TrackPar trackParV0; - o2::track::TrackPar trackParBachelor; - std::array cascadeMomentum; - - float cascCpa = -1; - float v0Cpa = -1; - - std::array v0Pos = {-999., -999., -999.}; - - if (df2.process(getTrackParCov(pionTrack), getTrackParCov(protonTrack))) { - trackParCovV0 = df2.createParentTrackParCov(0); // V0 track retrieved from p and pi daughters - v0Pos = {trackParCovV0.getX(), trackParCovV0.getY(), trackParCovV0.getZ()}; - if (df2.process(trackParCovV0, getTrackParCov(bachelor))) { - trackParV0 = df2.getTrackParamAtPCA(0); - trackParBachelor = df2.getTrackParamAtPCA(1); - trackParV0.getPxPyPzGlo(momenta[0]); // getting the V0 momentum - trackParBachelor.getPxPyPzGlo(momenta[1]); // getting the bachelor momentum - df2.createParentTrackParCov().getPxPyPzGlo(cascadeMomentum); - std::array pvPos = {primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ()}; - cascCpa = RecoDecay::cpa(pvPos, df2.getPCACandidate(), cascadeMomentum); - v0Cpa = RecoDecay::cpa(pvPos, df2.getPCACandidate(), momenta[0]); - } else { - continue; + if (isGoodMatch) { + pdgCodeMom = track.mcParticle().has_mothers() ? track.mcParticle().template mothers_as()[0].pdgCode() : 0; } - } else { - continue; + itsTrackPDG = ITStrack.has_mcParticle() ? ITStrack.mcParticle().pdgCode() : 0; } - float deltaPtITSCascade = std::hypot(cascadeMomentum[0], cascadeMomentum[1]) - ITStrack.pt(); - - // PV - registry.fill(HIST("h_PV_x"), primaryVertex.getX()); - registry.fill(HIST("h_PV_y"), primaryVertex.getY()); - registry.fill(HIST("h_PV_z"), primaryVertex.getZ()); - // Omega - masses = {o2::constants::physics::MassLambda0, o2::constants::physics::MassKPlus}; - const auto massOmega = RecoDecay::m(momenta, masses); - - // Xi - masses = {o2::constants::physics::MassLambda0, o2::constants::physics::MassPiPlus}; - const auto massXi = RecoDecay::m(momenta, masses); - - // Lambda - masses = {o2::constants::physics::MassProton, o2::constants::physics::MassPiMinus}; - momenta[0] = {protonTrack.px(), protonTrack.py(), protonTrack.pz()}; - momenta[1] = {pionTrack.px(), pionTrack.py(), pionTrack.pz()}; - const auto v0mass = RecoDecay::m(momenta, masses); - - ////Omega hypohesis -> rejecting Xi - if (std::abs(massXi - constants::physics::MassXiMinus) > 0.005) { - isOmega = true; - invMassBCOmega->Fill(massOmega); - } - - invMassBCXi->Fill(massXi); invMassBCV0->Fill(v0mass); registry.fill(HIST("h_PIDcutsXi"), 0, massXi); @@ -833,13 +579,10 @@ struct NonPromptCascadeTask { if (isOmega) { registry.fill(HIST("h_PIDcutsOmega"), 5, massOmega); - invMassACOmega->Fill(massOmega); registry.fill(HIST("h_massvspt_Omega"), massOmega, track.pt()); } registry.fill(HIST("h_PIDcutsXi"), 5, massXi); - - invMassACXi->Fill(massXi); registry.fill(HIST("h_massvspt_Xi"), massXi, track.pt()); invMassACV0->Fill(v0mass); @@ -850,8 +593,8 @@ struct NonPromptCascadeTask { daughtersDCA dDCA; fillDauDCA(trackedCascade, bachelor, protonTrack, pionTrack, primaryVertex, isOmega, dDCA); - candidates.emplace_back(NPCascCandidate{track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), deltaPtITSCascade, trackedCascade.itsClsSize(), hasReassociatedClusters, 0, 0, 0, 0, 0, 0, - primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ(), + candidates.emplace_back(NPCascCandidate{mcParticleID, track.globalIndex(), ITStrack.globalIndex(), trackedCascade.collisionId(), trackedCascade.matchingChi2(), deltaPtITSCascade, trackedCascade.itsClsSize(), hasReassociatedClusters, isGoodMatch, isGoodCascade, pdgCodeMom, itsTrackPDG, fromHF[0], fromHF[1], + collision.numContrib(), collision.collisionTimeRes(), primaryVertex.getX(), primaryVertex.getY(), primaryVertex.getZ(), track.pt(), track.eta(), track.phi(), protonTrack.pt(), protonTrack.eta(), pionTrack.pt(), pionTrack.eta(), bachelor.pt(), bachelor.eta(), mDCA.DCAxy, mDCA.DCAz, dDCA.protonDCAxy, dDCA.protonDCAz, dDCA.pionDCAxy, dDCA.pionDCAz, dDCA.bachDCAxy, dDCA.bachDCAz, @@ -863,11 +606,64 @@ struct NonPromptCascadeTask { protonTrack.hasTOF(), pionTrack.hasTOF(), bachKaonHasTOF, bachPionHasTOF, protonTrack.tofNSigmaPr(), pionTrack.tofNSigmaPi(), bachelor.tofNSigmaKa(), bachelor.tofNSigmaPi()}); } + } - for (const auto& c : candidates) { + void processTrackedCascadesMC(CollisionCandidatesRun3MC const& collisions, + aod::AssignedTrackedCascades const& trackedCascades, aod::Cascades const& /*cascades*/, + aod::V0s const& /*v0s*/, TracksExtMC const& /*tracks*/, + aod::McParticles const& mcParticles, aod::McCollisions const&, aod::BCsWithTimestamps const&) + { + + fillCandidatesVector(collisions, trackedCascades); + + for (size_t i = 0; i < candidates.size(); ++i) { + + if (candidates[i].mcParticleId < 0) { + continue; + } + auto particle = mcParticles.iteratorAt(candidates[i].mcParticleId); + auto& c = candidates[i]; + auto mcCollision = particle.mcCollision_as(); + auto label = collisions.iteratorAt(c.collisionID); + NPCTableMC(c.matchingChi2, c.deltaPt, c.itsClusSize, c.hasReassociatedCluster, c.isGoodMatch, c.isGoodCascade, c.pdgCodeMom, c.pdgCodeITStrack, c.isFromBeauty, c.isFromCharm, + c.pvContributors, c.pvTimeResolution, c.pvX, c.pvY, c.pvZ, + c.cascPt, c.cascEta, c.cascPhi, + c.protonPt, c.protonEta, c.pionPt, c.pionEta, c.bachPt, c.bachEta, + c.cascDCAxy, c.cascDCAz, c.protonDCAxy, c.protonDCAz, c.pionDCAxy, c.pionDCAz, c.bachDCAxy, c.bachDCAz, + c.casccosPA, c.v0cosPA, + c.massXi, c.massOmega, c.massV0, + c.cascRadius, c.v0radius, c.cascLength, c.v0length, + c.cascNClusITS, c.protonNClusITS, c.pionNClusITS, c.bachKaonNClusITS, c.bachPionNClusITS, c.protonNClusTPC, c.pionNClusTPC, c.bachKaonNClusTPC, c.bachPionNClusTPC, + c.protonTPCNSigma, c.pionTPCNSigma, c.bachKaonTPCNSigma, c.bachPionTPCNSigma, + c.protonHasTOF, c.pionHasTOF, c.bachKaonHasTOF, c.bachPionHasTOF, + c.protonTOFNSigma, c.pionTOFNSigma, c.bachKaonTOFNSigma, c.bachPionTOFNSigma, + particle.pt(), particle.eta(), particle.phi(), particle.pdgCode(), mcCollision.posX() - particle.vx(), mcCollision.posY() - particle.vy(), mcCollision.posZ() - particle.vz(), mcCollision.globalIndex() == label.mcCollisionId()); + } + + for (const auto& p : mcParticles) { + auto absCode = std::abs(p.pdgCode()); + if (absCode != 3312 && absCode != 3334) { + continue; + } + auto fromHF = isFromHF(p); + int pdgCodeMom = p.has_mothers() ? p.mothers_as()[0].pdgCode() : 0; + auto mcCollision = p.mcCollision_as(); + + NPCTableGen(p.pt(), p.eta(), p.phi(), p.pdgCode(), pdgCodeMom, mcCollision.posX() - p.vx(), mcCollision.posY() - p.vy(), mcCollision.posZ() - p.vz(), fromHF[0], fromHF[1]); + } + } + PROCESS_SWITCH(NonPromptCascadeTask, processTrackedCascadesMC, "process cascades from strangeness tracking: MC analysis", true); + + void processTrackedCascadesData(CollisionCandidatesRun3 const& collisions, + aod::AssignedTrackedCascades const& trackedCascades, aod::Cascades const& /*cascades*/, + aod::V0s const& /*v0s*/, TracksExtData const& /*tracks*/, + aod::BCsWithTimestamps const&) + { + fillCandidatesVector(collisions, trackedCascades); + for (const auto& c : candidates) { NPCTable(c.matchingChi2, c.deltaPt, c.itsClusSize, c.hasReassociatedCluster, - c.pvX, c.pvY, c.pvZ, + c.pvContributors, c.pvTimeResolution, c.pvX, c.pvY, c.pvZ, c.cascPt, c.cascEta, c.cascPhi, c.protonPt, c.protonEta, c.pionPt, c.pionEta, c.bachPt, c.bachEta, c.cascDCAxy, c.cascDCAz, c.protonDCAxy, c.protonDCAz, c.pionDCAxy, c.pionDCAz, c.bachDCAxy, c.bachDCAz, From 1b44b6b3cc679a9340c38b28803d089960e0082a Mon Sep 17 00:00:00 2001 From: Rrantu <156880782+Rrantu@users.noreply.github.com> Date: Wed, 18 Dec 2024 20:55:36 +0800 Subject: [PATCH 429/459] [PWGHF] Fix O2 linter issues (#9021) --- .../candidateCreatorXic0Omegac0.cxx | 77 ++++++++++--------- .../candidateSelectorXic0ToXiPiKf.cxx | 28 +++---- .../TableProducer/treeCreatorXic0ToXiPiKf.cxx | 2 +- 3 files changed, 54 insertions(+), 53 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx index 8e67ac22696..1b00c85face 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx @@ -958,12 +958,12 @@ struct HfCandidateCreatorXic0Omegac0 { auto charmbaryonChi2OverNdf = kfOmegac0Candidate.chi2GeoOmegac / charmbaryonNDF; kfOmegac0Candidate.chi2MassV0 = kfV0MassConstrained.GetChi2(); - auto v0NDF_m = kfV0MassConstrained.GetNDF(); - auto v0Chi2OverNdf_m = kfOmegac0Candidate.chi2MassV0 / v0NDF_m; + auto v0Ndfm = kfV0MassConstrained.GetNDF(); + auto v0Chi2OverNdfm = kfOmegac0Candidate.chi2MassV0 / v0Ndfm; kfOmegac0Candidate.chi2MassCasc = kfOmegaMassConstrained.GetChi2(); - auto cascNDF_m = kfOmegaMassConstrained.GetNDF(); - auto cascChi2OverNdf_m = kfOmegac0Candidate.chi2MassCasc / cascNDF_m; + auto cascNdfm = kfOmegaMassConstrained.GetNDF(); + auto cascChi2OverNdfm = kfOmegac0Candidate.chi2MassCasc / cascNdfm; // KF topo Chi2 kfOmegac0Candidate.chi2TopoV0ToPv = kfV0ToPv.GetChi2(); @@ -988,17 +988,17 @@ struct HfCandidateCreatorXic0Omegac0 { kfOmegac0Candidate.kfDcaOmegacDau = kfBachPionToOmegaC.GetDistanceFromParticle(kfOmegaToOmegaC); // KF decay length - float DecayLxy_Lam, err_DecayLxy_Lam; - kfV0ToCasc.GetDecayLengthXY(DecayLxy_Lam, err_DecayLxy_Lam); - kfOmegac0Candidate.decayLenXYLambda = DecayLxy_Lam; + float decayLxyLam, errDecayLxyLam; + kfV0ToCasc.GetDecayLengthXY(decayLxyLam, errDecayLxyLam); + kfOmegac0Candidate.decayLenXYLambda = decayLxyLam; - float DecayLxy_Casc, err_DecayLxy_Casc; - kfOmegaToOmegaC.GetDecayLengthXY(DecayLxy_Casc, err_DecayLxy_Casc); - kfOmegac0Candidate.decayLenXYCasc = DecayLxy_Casc; + float decayLxyCasc, errDecayLxyCasc; + kfOmegaToOmegaC.GetDecayLengthXY(decayLxyCasc, errDecayLxyCasc); + kfOmegac0Candidate.decayLenXYCasc = decayLxyCasc; - float DecayLxy_Omegac0, err_DecayLxy_Omegac0; - kfOmegac0ToPv.GetDecayLengthXY(DecayLxy_Omegac0, err_DecayLxy_Omegac0); - kfOmegac0Candidate.decayLenXYOmegac = DecayLxy_Omegac0; + float decayLxyOmegac0, errDecayLxyOmegac0; + kfOmegac0ToPv.GetDecayLengthXY(decayLxyOmegac0, errDecayLxyOmegac0); + kfOmegac0Candidate.decayLenXYOmegac = decayLxyOmegac0; // KF cosPA kfOmegac0Candidate.cosPaV0ToPv = cpaFromKF(kfV0, kfPV); @@ -1086,8 +1086,8 @@ struct HfCandidateCreatorXic0Omegac0 { kfOmegac0Candidate.cosPaV0ToCasc, kfOmegac0Candidate.cosPaCascToOmegac, kfOmegac0Candidate.cosPaXYV0ToCasc, kfOmegac0Candidate.cosPaXYCascToOmegac, kfOmegac0Candidate.rapOmegac, kfOmegac0Candidate.ptPiFromOmegac, kfOmegac0Candidate.ptOmegac, kfOmegac0Candidate.cosThetaStarPiFromOmegac, - v0NDF, cascNDF, charmbaryonNDF, v0NDF_m, cascNDF_m, - v0Chi2OverNdf, cascChi2OverNdf, charmbaryonChi2OverNdf, v0Chi2OverNdf_m, cascChi2OverNdf_m); + v0NDF, cascNDF, charmbaryonNDF, v0Ndfm, cascNdfm, + v0Chi2OverNdf, cascChi2OverNdf, charmbaryonChi2OverNdf, v0Chi2OverNdfm, cascChi2OverNdfm); } // loop over LF Cascade-bachelor candidates } // end of run function @@ -1140,7 +1140,8 @@ struct HfCandidateCreatorXic0Omegac0 { auto trackParCovV0Dau0 = getTrackParCov(trackV0Dau0); auto trackParCovV0Dau1 = getTrackParCov(trackV0Dau1); // pion <- casc TrackParCov - auto XiDauChargedTrackParCov = getTrackParCov(trackCascDauCharged); + auto xiDauChargedTrackParCov = getTrackParCov(trackCascDauCharged); + // convert tracks into KFParticle object KFPTrack kfTrack0 = createKFPTrackFromTrack(trackV0Dau0); KFPTrack kfTrack1 = createKFPTrackFromTrack(trackV0Dau1); @@ -1202,12 +1203,12 @@ struct HfCandidateCreatorXic0Omegac0 { //__________________________________________ //*>~<* step 2 : reconstruct cascade(Xi) with KF - const KFParticle* XiDaugthers[2] = {&kfBachPion, &kfV0}; + const KFParticle* xiDaugthers[2] = {&kfBachPion, &kfV0}; // construct cascade KFParticle kfXi; kfXi.SetConstructMethod(kfConstructMethod); try { - kfXi.Construct(XiDaugthers, 2); + kfXi.Construct(xiDaugthers, 2); } catch (std::runtime_error& e) { LOG(debug) << "Failed to construct Xi from V0 and bachelor track: " << e.what(); continue; @@ -1239,13 +1240,13 @@ struct HfCandidateCreatorXic0Omegac0 { // Create KF charm bach Pion from track KFPTrack kfTrackBachPion = createKFPTrackFromTrack(trackCharmBachelor); KFParticle kfCharmBachPion(kfTrackBachPion, kPiPlus); - const KFParticle* XiC0Daugthers[2] = {&kfCharmBachPion, &kfXi}; + const KFParticle* xiC0Daugthers[2] = {&kfCharmBachPion, &kfXi}; // construct XiC0 KFParticle kfXiC0; kfXiC0.SetConstructMethod(kfConstructMethod); try { - kfXiC0.Construct(XiC0Daugthers, 2); + kfXiC0.Construct(xiC0Daugthers, 2); } catch (std::runtime_error& e) { LOG(debug) << "Failed to construct XiC0 from Cascade and bachelor pion track: " << e.what(); continue; @@ -1293,8 +1294,8 @@ struct HfCandidateCreatorXic0Omegac0 { auto trackParVarCharmBachelor = getTrackParCovFromKFP(kfCharmBachPionToXiC, o2::track::PID::Pion, -bachCharge); // chrambaryon bach pion trackParVarCharmBachelor.setAbsCharge(1); - XiDauChargedTrackParCov = getTrackParCovFromKFP(kfBachPionToXi, o2::track::PID::Pion, bachCharge); // Cascade bach pion - XiDauChargedTrackParCov.setAbsCharge(1); + xiDauChargedTrackParCov = getTrackParCovFromKFP(kfBachPionToXi, o2::track::PID::Pion, bachCharge); // Cascade bach pion + xiDauChargedTrackParCov.setAbsCharge(1); o2::track::TrackParCov trackCasc = getTrackParCovFromKFP(kfXiToXiC, kfXiToXiC.GetPDG(), bachCharge); trackCasc.setAbsCharge(1); @@ -1342,7 +1343,7 @@ struct HfCandidateCreatorXic0Omegac0 { gpu::gpustd::array impactParameterKaFromCasc; o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCovV0Dau0, 2.f, matCorr, &impactParameterV0Dau0); o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCovV0Dau1, 2.f, matCorr, &impactParameterV0Dau1); - o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, XiDauChargedTrackParCov, 2.f, matCorr, &impactParameterKaFromCasc); + o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, xiDauChargedTrackParCov, 2.f, matCorr, &impactParameterKaFromCasc); float dcaxyV0Dau0 = impactParameterV0Dau0[0]; float dcaxyV0Dau1 = impactParameterV0Dau1[0]; float dcaxyCascBachelor = impactParameterKaFromCasc[0]; @@ -1388,12 +1389,12 @@ struct HfCandidateCreatorXic0Omegac0 { auto charmbaryonChi2OverNdf = kfXic0Candidate.chi2GeoXic / charmbaryonNDF; kfXic0Candidate.chi2MassV0 = kfV0MassConstrained.GetChi2(); - auto v0NDF_m = kfV0MassConstrained.GetNDF(); - auto v0Chi2OverNdf_m = kfXic0Candidate.chi2MassV0 / v0NDF_m; + auto v0Ndfm = kfV0MassConstrained.GetNDF(); + auto v0Chi2OverNdfm = kfXic0Candidate.chi2MassV0 / v0Ndfm; kfXic0Candidate.chi2MassCasc = kfXiMassConstrained.GetChi2(); - auto cascNDF_m = kfXiMassConstrained.GetNDF(); - auto cascChi2OverNdf_m = kfXic0Candidate.chi2MassCasc / cascNDF_m; + auto cascNdfm = kfXiMassConstrained.GetNDF(); + auto cascChi2OverNdfm = kfXic0Candidate.chi2MassCasc / cascNdfm; // KF topo Chi2 kfXic0Candidate.chi2TopoV0ToPv = kfV0ToPv.GetChi2(); @@ -1418,17 +1419,17 @@ struct HfCandidateCreatorXic0Omegac0 { kfXic0Candidate.kfDcaXicDau = kfCharmBachPionToXiC.GetDistanceFromParticle(kfXiToXiC); // KF decay length - float DecayLxy_Lam, err_DecayLxy_Lam; - kfV0ToCasc.GetDecayLengthXY(DecayLxy_Lam, err_DecayLxy_Lam); - kfXic0Candidate.decayLenXYLambda = DecayLxy_Lam; + float decayLxyLam, errDecayLxyLam; + kfV0ToCasc.GetDecayLengthXY(decayLxyLam, errDecayLxyLam); + kfXic0Candidate.decayLenXYLambda = decayLxyLam; - float DecayLxy_Casc, err_DecayLxy_Casc; - kfXiToXiC.GetDecayLengthXY(DecayLxy_Casc, err_DecayLxy_Casc); - kfXic0Candidate.decayLenXYCasc = DecayLxy_Casc; + float decayLxyCasc, errDecayLxyCasc; + kfXiToXiC.GetDecayLengthXY(decayLxyCasc, errDecayLxyCasc); + kfXic0Candidate.decayLenXYCasc = decayLxyCasc; - float DecayLxy_Xic0, err_DecayLxy_Xic0; - kfXic0ToPv.GetDecayLengthXY(DecayLxy_Xic0, err_DecayLxy_Xic0); - kfXic0Candidate.decayLenXYXic = DecayLxy_Xic0; + float decayLxyXic0, errDecayLxyXic0; + kfXic0ToPv.GetDecayLengthXY(decayLxyXic0, errDecayLxyXic0); + kfXic0Candidate.decayLenXYXic = decayLxyXic0; // KF cosPA kfXic0Candidate.cosPaV0ToPv = cpaFromKF(kfV0, kfPV); @@ -1516,8 +1517,8 @@ struct HfCandidateCreatorXic0Omegac0 { kfXic0Candidate.cosPaV0ToCasc, kfXic0Candidate.cosPaCascToXic, kfXic0Candidate.cosPaXYV0ToCasc, kfXic0Candidate.cosPaXYCascToXic, kfXic0Candidate.rapXic, kfXic0Candidate.ptPiFromXic, kfXic0Candidate.ptXic, kfXic0Candidate.cosThetaStarPiFromXic, - v0NDF, cascNDF, charmbaryonNDF, v0NDF_m, cascNDF_m, - v0Chi2OverNdf, cascChi2OverNdf, charmbaryonChi2OverNdf, v0Chi2OverNdf_m, cascChi2OverNdf_m); + v0NDF, cascNDF, charmbaryonNDF, v0Ndfm, cascNdfm, + v0Chi2OverNdf, cascChi2OverNdf, charmbaryonChi2OverNdf, v0Chi2OverNdfm, cascChi2OverNdfm); } // loop over LF Cascade-bachelor candidates } diff --git a/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx index f83192eb3e8..46b4169d564 100644 --- a/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file candidateSelectorToXiPi.cxx +/// \file candidateSelectorXic0ToXiPiKf.cxx /// \brief Xic0 → Xi Pi selection task /// \author Ran Tu , Fudan University @@ -29,11 +29,11 @@ using namespace o2::aod; using namespace o2::framework; using namespace o2::analysis; -enum pidInfoStored { - kPiFromLam = 0, - kPrFromLam, - kPiFromCasc, - kPiFromCharm +enum PidInfoStored { + KPiFromLam = 0, + KPrFromLam, + KPiFromCasc, + KPiFromCharm }; /// Struct for applying Xic0 -> Xi pi selection cuts @@ -407,28 +407,28 @@ struct HfCandidateSelectorXic0ToXiPiKf { } if (trackPiFromLam.hasTPC()) { - SETBIT(infoTpcStored, kPiFromLam); + SETBIT(infoTpcStored, KPiFromLam); } if (trackPrFromLam.hasTPC()) { - SETBIT(infoTpcStored, kPrFromLam); + SETBIT(infoTpcStored, KPiFromLam); } if (trackPiFromCasc.hasTPC()) { - SETBIT(infoTpcStored, kPiFromCasc); + SETBIT(infoTpcStored, KPiFromCasc); } if (trackPiFromCharm.hasTPC()) { - SETBIT(infoTpcStored, kPiFromCharm); + SETBIT(infoTpcStored, KPiFromCharm); } if (trackPiFromLam.hasTOF()) { - SETBIT(infoTofStored, kPiFromLam); + SETBIT(infoTofStored, KPiFromLam); } if (trackPrFromLam.hasTOF()) { - SETBIT(infoTofStored, kPrFromLam); + SETBIT(infoTofStored, KPiFromLam); } if (trackPiFromCasc.hasTOF()) { - SETBIT(infoTofStored, kPiFromCasc); + SETBIT(infoTofStored, KPiFromCasc); } if (trackPiFromCharm.hasTOF()) { - SETBIT(infoTofStored, kPiFromCharm); + SETBIT(infoTofStored, KPiFromCharm); } if (usePidTpcOnly) { diff --git a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx index 7cbc71277e5..1e1bd4e359b 100644 --- a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file treeCreatorToXiPi.cxx +/// \file treeCreatorXic0ToXiPiKf.cxx /// \brief Writer of the xic0 to Xi Pi candidates in the form of flat tables to be stored in TTrees. /// In this file are defined and filled the output tables /// From f230fc0385f982aba08f291c457924d0278b45e1 Mon Sep 17 00:00:00 2001 From: sawan <124118453+sawankumawat@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:38:23 +0530 Subject: [PATCH 430/459] [PWGLF] Added generated and reconstructed MC (#9020) --- PWGLF/Tasks/Resonances/CMakeLists.txt | 2 +- ...ortKshort.cxx => higherMassResonances.cxx} | 575 ++++++++++++++---- PWGLF/Tasks/Resonances/kstarqa.cxx | 242 ++++---- 3 files changed, 563 insertions(+), 256 deletions(-) rename PWGLF/Tasks/Resonances/{KshortKshort.cxx => higherMassResonances.cxx} (66%) diff --git a/PWGLF/Tasks/Resonances/CMakeLists.txt b/PWGLF/Tasks/Resonances/CMakeLists.txt index d49deced8f3..6988da46437 100644 --- a/PWGLF/Tasks/Resonances/CMakeLists.txt +++ b/PWGLF/Tasks/Resonances/CMakeLists.txt @@ -100,7 +100,7 @@ o2physics_add_dpl_workflow(lambda1520-pbpb COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(kshortkshort - SOURCES KshortKshort.cxx + SOURCES higherMassResonances.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/Resonances/KshortKshort.cxx b/PWGLF/Tasks/Resonances/higherMassResonances.cxx similarity index 66% rename from PWGLF/Tasks/Resonances/KshortKshort.cxx rename to PWGLF/Tasks/Resonances/higherMassResonances.cxx index 69e967b2d94..68f0c4652a7 100644 --- a/PWGLF/Tasks/Resonances/KshortKshort.cxx +++ b/PWGLF/Tasks/Resonances/higherMassResonances.cxx @@ -8,10 +8,12 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// + +/// \file higherMassResonances.cxx /// \brief glueball resonance -/// \author Sawan (sawan.sawan@cern.ch) -#include +/// \author Sawan + +// #include #include #include #include @@ -25,6 +27,7 @@ #include #include #include +#include #include "TF1.h" #include "TRandom3.h" #include "Math/Vector3D.h" @@ -55,19 +58,21 @@ using namespace o2::soa; // using namespace o2::constants::physics; using std::array; -struct strangeness_tutorial { +struct HigherMassResonances { SliceCache cache; HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry rKzeroShort{"kzeroShort", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry hglue{"hglueball", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - - Configurable QAv0{"QAv0", false, "QAv0"}; - Configurable QAPID{"QAPID", true, "QAPID"}; - Configurable QAv0_daughters{"QAv0_daughters", false, "QA of v0 daughters"}; - Configurable QAevents{"QAevents", false, "QA of events"}; - Configurable inv_mass1D{"inv_mass1D", false, "1D invariant mass histograms"}; + HistogramRegistry hMChists{"hMChists", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + // PID and QA + Configurable qAv0{"qAv0", false, "qAv0"}; + Configurable qAPID{"qAPID", true, "qAPID"}; + Configurable qAv0Daughters{"qAv0Daughters", false, "QA of v0 daughters"}; + Configurable qAevents{"qAevents", false, "QA of events"}; + Configurable invMass1D{"invMass1D", false, "1D invariant mass histograms"}; Configurable correlation2Dhist{"correlation2Dhist", true, "Lamda K0 mass correlation"}; - Configurable DCAv0topv{"DCAv0topv", false, "DCA V0 to PV"}; + Configurable cDCAv0topv{"cDCAv0topv", false, "DCA V0 to PV"}; Configurable armcut{"armcut", true, "arm cut"}; Configurable globalTracks{"globalTracks", false, "Global tracks"}; Configurable hasTPC{"hasTPC", false, "TPC"}; @@ -81,29 +86,27 @@ struct strangeness_tutorial { Configurable itstpctracks{"itstpctracks", false, "selects collisions with at least one ITS-TPC track,"}; Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; Configurable applyOccupancyCut{"applyOccupancyCut", false, "Apply occupancy cut"}; - Configurable OccupancyCut{"OccupancyCut", 1000, "Mimimum Occupancy cut"}; + Configurable occupancyCut{"occupancyCut", 1000, "Mimimum Occupancy cut"}; // Configurable parameters for V0 selection - Configurable ConfV0DCADaughMax{"ConfV0DCADaughMax", 1.0f, "DCA b/w V0 daughters"}; - Configurable v0setting_dcapostopv{"v0setting_dcapostopv", 0.06, "DCA Pos To PV"}; - Configurable v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.06, "DCA Neg To PV"}; + Configurable confV0DCADaughMax{"confV0DCADaughMax", 1.0f, "DCA b/w V0 daughters"}; + Configurable v0settingDcapostopv{"v0settingDcapostopv", 0.06, "DCA Pos To PV"}; + Configurable v0settingDcanegtopv{"v0settingDcanegtopv", 0.06, "DCA Neg To PV"}; Configurable cMaxV0DCA{"cMaxV0DCA", 1, "DCA V0 to PV"}; // Configurable isStandarv0{"isStandarv0", false, "Standard V0"}; // Configurable ConfDaughDCAMin{"ConfDaughDCAMin", 0.06f, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"}; // same as DCA pos to pv and neg to pv - - Configurable ConfV0PtMin{"ConfV0PtMin", 0.f, "Minimum transverse momentum of V0"}; - Configurable ConfV0CPAMin{"ConfV0CPAMin", 0.97f, "Minimum CPA of V0"}; - Configurable ConfV0TranRadV0Min{"ConfV0TranRadV0Min", 0.5f, "Minimum transverse radius"}; - Configurable ConfV0TranRadV0Max{"ConfV0TranRadV0Max", 200.f, "Maximum transverse radius"}; + Configurable confV0PtMin{"confV0PtMin", 0.f, "Minimum transverse momentum of V0"}; + Configurable confV0CPAMin{"confV0CPAMin", 0.97f, "Minimum CPA of V0"}; + Configurable confV0TranRadV0Min{"confV0TranRadV0Min", 0.5f, "Minimum transverse radius"}; + Configurable confV0TranRadV0Max{"confV0TranRadV0Max", 200.f, "Maximum transverse radius"}; Configurable cMaxV0LifeTime{"cMaxV0LifeTime", 15, "Maximum V0 life time"}; Configurable cSigmaMassKs0{"cSigmaMassKs0", 4, "n Sigma cut on Ks0 mass (Mass (Ks) - cSigmaMassKs0*cWidthKs0)"}; Configurable cWidthKs0{"cWidthKs0", 0.005, "Width of KS0"}; - Configurable ConfDaughEta{"ConfDaughEta", 0.8f, "V0 Daugh sel: max eta"}; - Configurable ConfDaughTPCnclsMin{"ConfDaughTPCnclsMin", 70.f, "V0 Daugh sel: Min. nCls TPC"}; - Configurable ConfDaughPIDCuts{"ConfDaughPIDCuts", 5, "PID selections for KS0 daughters"}; - Configurable Confarmcut{"Confarmcut", 0.2f, "Armenteros cut"}; - Configurable ConfKsrapidity{"ConfKsrapidity", 0.5f, "Rapidity cut on K0s"}; - + Configurable confDaughEta{"confDaughEta", 0.8f, "V0 Daugh sel: max eta"}; + Configurable confDaughTPCnclsMin{"confDaughTPCnclsMin", 70.f, "V0 Daugh sel: Min. nCls TPC"}; + Configurable confDaughPIDCuts{"confDaughPIDCuts", 5, "PID selections for KS0 daughters"}; + Configurable confarmcut{"confarmcut", 0.2f, "Armenteros cut"}; + Configurable confKsrapidity{"confKsrapidity", 0.5f, "Rapidity cut on K0s"}; // Configurable lowmasscutks0{"lowmasscutks0", 0.497 - 4 * 0.005, "Low mass cut on K0s"}; // Configurable highmasscutks0{"highmasscutks0", 0.497 + 4 * 0.005, "High mass cut on K0s"}; @@ -113,16 +116,20 @@ struct strangeness_tutorial { Configurable cfgMultFOTM{"cfgMultFOTM", true, "Use FOTM multiplicity if pp else use 0 here for PbPb (FT0C)"}; ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 5., 10., 30., 50., 70., 100., 110., 150.}, "Binning of the centrality axis"}; + // Configurable for MC + Configurable allGenCollisions{"allGenCollisions", true, "To fill all generated collisions for the signal loss calculations"}; + Configurable cTVXEvsel{"cTVXEvsel", true, "Triggger selection"}; + // output THnSparses Configurable activateTHnSparseCosThStarHelicity{"activateTHnSparseCosThStarHelicity", false, "Activate the THnSparse with cosThStar w.r.t. helicity axis"}; Configurable activateTHnSparseCosThStarProduction{"activateTHnSparseCosThStarProduction", false, "Activate the THnSparse with cosThStar w.r.t. production axis"}; Configurable activateTHnSparseCosThStarBeam{"activateTHnSparseCosThStarBeam", true, "Activate the THnSparse with cosThStar w.r.t. beam axis (Gottified jackson frame)"}; Configurable activateTHnSparseCosThStarRandom{"activateTHnSparseCosThStarRandom", false, "Activate the THnSparse with cosThStar w.r.t. random axis"}; - Configurable c_nof_rotations{"c_nof_rotations", 3, "Number of random rotations in the rotational background"}; + Configurable cRrotations{"cRrotations", 3, "Number of random rotations in the rotational background"}; // Other cuts on Ks and glueball Configurable rapidityks{"rapidityks", true, "rapidity cut on K0s"}; - Configurable apply_competingcut{"apply_competingcut", false, "Competing cascade rejection cut"}; + Configurable applyCompetingcut{"applyCompetingcut", false, "Competing cascade rejection cut"}; Configurable competingcascrejlambda{"competingcascrejlambda", 0.005, "rejecting competing cascade lambda"}; Configurable competingcascrejlambdaanti{"competingcascrejlambdaanti", 0.005, "rejecting competing cascade anti-lambda"}; // If one of the pions is misidentified as a proton, then instead of Ks we reconstruct lambda, therefore the competing cascade rejection cut is applied in which if the reconstrcted mass of a pion and proton (which we are assuming to be misidentified as proton) is close to lambda or anti-lambda, then the track is rejected. Configurable tpcCrossedrows{"tpcCrossedrows", 70, "TPC crossed rows"}; @@ -130,20 +137,20 @@ struct strangeness_tutorial { // Mass and pT axis as configurables Configurable cPtMin{"cPtMin", 0.0f, "Minimum pT"}; - Configurable cPtMax{"cPtMax", 50.0f, "Maximum pT"}; - Configurable cPtBins{"cPtBins", 500, "Number of pT bins"}; + Configurable cPtMax{"cPtMax", 30.0f, "Maximum pT"}; + Configurable cPtBins{"cPtBins", 300, "Number of pT bins"}; Configurable cMassMin{"cMassMin", 0.9f, "Minimum mass of glueball"}; Configurable cMassMax{"cMassMax", 3.0f, "Maximum mass of glueball"}; Configurable cMassBins{"cMassBins", 210, "Number of mass bins for glueball"}; Configurable ksMassMin{"ksMassMin", 0.45f, "Minimum mass of K0s"}; Configurable ksMassMax{"ksMassMax", 0.55f, "Maximum mass of K0s"}; Configurable ksMassBins{"ksMassBins", 200, "Number of mass bins for K0s"}; - Configurable rotational_cut{"rotational_cut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; + Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; ConfigurableAxis configThnAxisPOL{"configThnAxisPOL", {20, -1.0, 1.0}, "Costheta axis"}; ConfigurableAxis axisdEdx{"axisdEdx", {20000, 0.0f, 200.0f}, "dE/dx (a.u.)"}; ConfigurableAxis axisPtfordEbydx{"axisPtfordEbydx", {2000, 0, 20}, "pT (GeV/c)"}; ConfigurableAxis axisMultdist{"axisMultdist", {3500, 0, 70000}, "Multiplicity distribution"}; - ConfigurableAxis occupancy_bins{"occupancy_bins", {VARIABLE_WIDTH, 0.0, 100, 500, 600, 1000, 1100, 1500, 1600, 2000, 2100, 2500, 2600, 3000, 3100, 3500, 3600, 4000, 4100, 4500, 4600, 5000, 5100, 9999}, "Binning of the occupancy axis"}; + ConfigurableAxis occupancyBins{"occupancyBins", {VARIABLE_WIDTH, 0.0, 100, 500, 600, 1000, 1100, 1500, 1600, 2000, 2100, 2500, 2600, 3000, 3100, 3500, 3600, 4000, 4100, 4500, 4600, 5000, 5100, 9999}, "Binning: occupancy axis"}; // Event selection cuts - Alex (Temporary, need to fix!) TF1* fMultPVCutLow = nullptr; @@ -151,20 +158,20 @@ struct strangeness_tutorial { TF1* fMultCutLow = nullptr; TF1* fMultCutHigh = nullptr; TF1* fMultMultPVCut = nullptr; - Service PDGdatabase; + // Service PDGdatabase; TRandom* rn = new TRandom(); void init(InitContext const&) { // Axes - AxisSpec K0ShortMassAxis = {ksMassBins, ksMassMin, ksMassMax, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec k0ShortMassAxis = {ksMassBins, ksMassMin, ksMassMax, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; AxisSpec glueballMassAxis = {cMassBins, cMassMin, cMassMax, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; AxisSpec vertexZAxis = {60, -15.f, 15.f, "vrtx_{Z} [cm]"}; // for histogram AxisSpec ptAxis = {cPtBins, cPtMin, cPtMax, "#it{p}_{T} (GeV/#it{c})"}; // AxisSpec multiplicityAxis = {110, 0.0f, 150.0f, "Multiplicity Axis"}; AxisSpec multiplicityAxis = {binsCent, "Multiplicity Axis"}; AxisSpec thnAxisPOL{configThnAxisPOL, "Configurabel theta axis"}; - AxisSpec occupancy_axis = {occupancy_bins, "Occupancy [-40,100]"}; + AxisSpec occupancyAxis = {occupancyBins, "Occupancy [-40,100]"}; // THnSparses std::array sparses = {activateTHnSparseCosThStarHelicity, activateTHnSparseCosThStarProduction, activateTHnSparseCosThStarBeam, activateTHnSparseCosThStarRandom}; @@ -189,7 +196,7 @@ struct strangeness_tutorial { } // Event selection - if (QAevents) { + if (qAevents) { rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); rEventSelection.add("hmultiplicity", "multiplicity percentile distribution", {HistType::kTH1F, {{150, 0.0f, 150.0f}}}); rEventSelection.add("multdist_FT0M", "FT0M Multiplicity distribution", kTH1F, {axisMultdist}); @@ -198,15 +205,15 @@ struct strangeness_tutorial { rEventSelection.add("hNcontributor", "Number of primary vertex contributor", kTH1F, {{2000, 0.0f, 10000.0f}}); } - if (inv_mass1D) { + if (invMass1D) { hglue.add("h1glueInvMassDS", "h1glueInvMassDS", kTH1F, {glueballMassAxis}); hglue.add("h1glueInvMassME", "h1glueInvMassME", kTH1F, {glueballMassAxis}); hglue.add("h1glueInvMassRot", "h1glueInvMassRot", kTH1F, {glueballMassAxis}); } - hglue.add("h3glueInvMassDS", "h3glueInvMassDS", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, occupancy_axis}, true); - hglue.add("h3glueInvMassME", "h3glueInvMassME", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, occupancy_axis}, true); - hglue.add("h3glueInvMassRot", "h3glueInvMassRot", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, occupancy_axis}, true); + hglue.add("h3glueInvMassDS", "h3glueInvMassDS", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, occupancyAxis}, true); + hglue.add("h3glueInvMassME", "h3glueInvMassME", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, occupancyAxis}, true); + hglue.add("h3glueInvMassRot", "h3glueInvMassRot", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, occupancyAxis}, true); hglue.add("heventscheck", "heventscheck", kTH1I, {{10, 0, 10}}); hglue.add("htrackscheck_v0", "htrackscheck_v0", kTH1I, {{15, 0, 15}}); hglue.add("htrackscheck_v0_daughters", "htrackscheck_v0_daughters", kTH1I, {{15, 0, 15}}); @@ -225,11 +232,11 @@ struct strangeness_tutorial { rKzeroShort.add("mass_lambda_kshort_after9", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); rKzeroShort.add("mass_lambda_kshort_after10", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); } - if (QAv0) { + if (qAv0) { // Invariant Mass - rKzeroShort.add("hMassK0Shortbefore", "hMassK0Shortbefore", kTHnSparseF, {K0ShortMassAxis, ptAxis}); - rKzeroShort.add("hMasscorrelationbefore", "hMasscorrelationbefore", kTH2F, {K0ShortMassAxis, K0ShortMassAxis}); - rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", kTHnSparseF, {K0ShortMassAxis, ptAxis}); + rKzeroShort.add("hMassK0Shortbefore", "hMassK0Shortbefore", kTHnSparseF, {k0ShortMassAxis, ptAxis}); + rKzeroShort.add("hMasscorrelationbefore", "hMasscorrelationbefore", kTH2F, {k0ShortMassAxis, k0ShortMassAxis}); + rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", kTHnSparseF, {k0ShortMassAxis, ptAxis}); // Topological histograms (after the selection) rKzeroShort.add("hDCAV0Daughters", "DCA between v0 daughters", {HistType::kTH1F, {{60, -3.0f, 3.0f}}}); rKzeroShort.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.96f, 1.1f}}}); @@ -244,7 +251,7 @@ struct strangeness_tutorial { rKzeroShort.add("hv0radius", "hv0radius", kTH1F, {{100, 0.0f, 200.0f}}); rKzeroShort.add("hDCApostopv", "DCA positive daughter to PV", kTH1F, {{1000, -10.0f, 10.0f}}); rKzeroShort.add("hDCAnegtopv", "DCA negative daughter to PV", kTH1F, {{1000, -10.0f, 10.0f}}); - rKzeroShort.add("hDCAv0topv", "DCA V0 to PV", kTH1F, {{60, -3.0f, 3.0f}}); + rKzeroShort.add("hcDCAv0topv", "DCA V0 to PV", kTH1F, {{60, -3.0f, 3.0f}}); rKzeroShort.add("halpha", "Armenteros alpha", kTH1F, {{100, -5.0f, 5.0f}}); rKzeroShort.add("hqtarmbyalpha", "qtarm/alpha", kTH1F, {{100, 0.0f, 1.0f}}); rKzeroShort.add("hpsipair", "psi pair angle", kTH1F, {{100, -5.0f, 5.0f}}); @@ -255,14 +262,14 @@ struct strangeness_tutorial { // rKzeroShort.add("hV0CosPA_before", "hV0CosPA_before", {HistType::kTH1F, {{200, 0.91f, 1.1f}}}); // rKzeroShort.add("hLT_before", "hLT_before", {HistType::kTH1F, {{100, 0.0f, 50.0f}}}); } - if (QAPID) { + if (qAPID) { rKzeroShort.add("hNSigmaPosPionK0s_before", "hNSigmaPosPionK0s_before", {HistType::kTH2F, {{ptAxis}, {100, -5.f, 5.f}}}); // rKzeroShort.add("hNSigmaPosPionK0s_after", "hNSigmaPosPionK0s_after", {HistType::kTH2F, {{ptAxis}, {100, -5.f, 5.f}}}); rKzeroShort.add("hNSigmaNegPionK0s_before", "hNSigmaNegPionK0s_before", {HistType::kTH2F, {{ptAxis}, {100, -5.f, 5.f}}}); // rKzeroShort.add("hNSigmaNegPionK0s_after", "hNSigmaNegPionK0s_after", {HistType::kTH2F, {{ptAxis}, {100, -5.f, 5.f}}}); rKzeroShort.add("dE_by_dx_TPC", "dE/dx signal in the TPC as a function of pT", kTH2F, {axisPtfordEbydx, axisdEdx}); } - if (QAv0_daughters) { + if (qAv0Daughters) { rKzeroShort.add("negative_pt", "Negative daughter pT", kTH1F, {ptAxis}); rKzeroShort.add("positive_pt", "Positive daughter pT", kTH1F, {ptAxis}); rKzeroShort.add("negative_eta", "Negative daughter eta", kTH1F, {{100, -1.0f, 1.0f}}); @@ -270,6 +277,19 @@ struct strangeness_tutorial { rKzeroShort.add("negative_phi", "Negative daughter phi", kTH1F, {{70, 0.0f, 7.0f}}); rKzeroShort.add("positive_phi", "Positive daughter phi", kTH1F, {{70, 0.0f, 7.0f}}); } + + // For MC + hMChists.add("events_check", "No. of events in the generated MC", kTH1I, {{20, 0, 20}}); + hMChists.add("events_checkrec", "No. of events in the reconstructed MC", kTH1I, {{20, 0, 20}}); + hMChists.add("Genf1710", "Gen f_{0}(1710)", kTH1F, {ptAxis}); + hMChists.add("Recf1710_pt1", "Rec f_{0}(1710) p_{T}", kTH1F, {ptAxis}); + hMChists.add("Recf1710_pt2", "Rec f_{0}(1710) p_{T}", kTH1F, {ptAxis}); + hMChists.add("Recf1710_p", "Rec f_{0}(1710) p", kTH1F, {ptAxis}); + hMChists.add("Recf1710_mass", "Rec f_{0}(1710) mass", kTH1F, {glueballMassAxis}); + hMChists.add("Genf1710_mass", "Gen f_{0}(1710) mass", kTH1F, {glueballMassAxis}); + hMChists.add("MC_mult", "Multiplicity in MC", kTH1F, {multiplicityAxis}); + hMChists.add("MC_mult_after_event_sel", "Multiplicity in MC", kTH1F, {multiplicityAxis}); + if (additionalEvsel) { fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); fMultPVCutLow->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); @@ -328,8 +348,7 @@ struct strangeness_tutorial { } template - bool SelectionV0(Collision const& collision, V0 const& candidate, - float /*multiplicity*/) + bool selectionV0(Collision const& collision, V0 const& candidate, float /*multiplicity*/) { const float qtarm = candidate.qtarm(); const float alph = candidate.alpha(); @@ -339,15 +358,15 @@ struct strangeness_tutorial { const float dcaDaughv0 = candidate.dcaV0daughters(); const float cpav0 = candidate.v0cosPA(); - float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * PDGdatabase->Mass(310); + float ctauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; float lowmasscutks0 = 0.497 - cWidthKs0 * cSigmaMassKs0; float highmasscutks0 = 0.497 + cWidthKs0 * cSigmaMassKs0; // float decayLength = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * RecoDecay::sqrtSumOfSquares(candidate.px(), candidate.py(), candidate.pz()); - if (QAv0) { + if (qAv0) { rKzeroShort.fill(HIST("hMassK0Shortbefore"), candidate.mK0Short(), candidate.pt()); rKzeroShort.fill(HIST("hMasscorrelationbefore"), candidate.mK0Short(), candidate.mK0Short()); - rKzeroShort.fill(HIST("hLT"), CtauK0s); + rKzeroShort.fill(HIST("hLT"), ctauK0s); rKzeroShort.fill(HIST("hDCAV0Daughters"), candidate.dcaV0daughters()); rKzeroShort.fill(HIST("hV0CosPA"), candidate.v0cosPA()); rKzeroShort.fill(HIST("Mass_lambda"), candidate.mLambda()); @@ -359,7 +378,7 @@ struct strangeness_tutorial { rKzeroShort.fill(HIST("hv0radius"), candidate.v0radius()); rKzeroShort.fill(HIST("hDCApostopv"), candidate.dcapostopv()); rKzeroShort.fill(HIST("hDCAnegtopv"), candidate.dcanegtopv()); - rKzeroShort.fill(HIST("hDCAv0topv"), candidate.dcav0topv()); + rKzeroShort.fill(HIST("hcDCAv0topv"), candidate.dcav0topv()); rKzeroShort.fill(HIST("halpha"), candidate.alpha()); rKzeroShort.fill(HIST("hqtarmbyalpha"), arm); rKzeroShort.fill(HIST("hpsipair"), candidate.psipair()); @@ -369,77 +388,78 @@ struct strangeness_tutorial { hglue.fill(HIST("htrackscheck_v0"), 0.5); - if (DCAv0topv && fabs(candidate.dcav0topv()) > cMaxV0DCA) { + if (cDCAv0topv && std::fabs(candidate.dcav0topv()) > cMaxV0DCA) { return false; } hglue.fill(HIST("htrackscheck_v0"), 1.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after1"), candidate.mK0Short(), candidate.mLambda()); - if (rapidityks && TMath::Abs(candidate.yK0Short()) >= ConfKsrapidity) { + if (rapidityks && std::abs(candidate.yK0Short()) >= confKsrapidity) { return false; } hglue.fill(HIST("htrackscheck_v0"), 2.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after2"), candidate.mK0Short(), candidate.mLambda()); - if (pT < ConfV0PtMin) { + if (pT < confV0PtMin) { return false; } hglue.fill(HIST("htrackscheck_v0"), 3.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after3"), candidate.mK0Short(), candidate.mLambda()); - if (dcaDaughv0 > ConfV0DCADaughMax) { + if (dcaDaughv0 > confV0DCADaughMax) { return false; } hglue.fill(HIST("htrackscheck_v0"), 4.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after4"), candidate.mK0Short(), candidate.mLambda()); - if (cpav0 < ConfV0CPAMin) { + if (cpav0 < confV0CPAMin) { return false; } hglue.fill(HIST("htrackscheck_v0"), 5.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after5"), candidate.mK0Short(), candidate.mLambda()); - if (tranRad < ConfV0TranRadV0Min) { + if (tranRad < confV0TranRadV0Min) { return false; } hglue.fill(HIST("htrackscheck_v0"), 6.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after6"), candidate.mK0Short(), candidate.mLambda()); - if (tranRad > ConfV0TranRadV0Max) { + if (tranRad > confV0TranRadV0Max) { return false; } hglue.fill(HIST("htrackscheck_v0"), 7.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after7"), candidate.mK0Short(), candidate.mLambda()); - if (fabs(CtauK0s) > cMaxV0LifeTime) { + if (std::fabs(ctauK0s) > cMaxV0LifeTime) { return false; } hglue.fill(HIST("htrackscheck_v0"), 8.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after8"), candidate.mK0Short(), candidate.mLambda()); - if (armcut && arm < Confarmcut) { + if (armcut && arm < confarmcut) { return false; } hglue.fill(HIST("htrackscheck_v0"), 9.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after9"), candidate.mK0Short(), candidate.mLambda()); - if (apply_competingcut && (TMath::Abs(candidate.mLambda() - PDGdatabase->Mass(3122)) <= competingcascrejlambda || TMath::Abs(candidate.mAntiLambda() - PDGdatabase->Mass(-3122)) <= competingcascrejlambdaanti)) { + // if (applyCompetingcut && (std::abs(candidate.mLambda() - PDGdatabase->Mass(3122)) <= competingcascrejlambda || std::abs(candidate.mAntiLambda() - PDGdatabase->Mass(-3122)) <= competingcascrejlambdaanti)) + if (applyCompetingcut && (std::abs(candidate.mLambda() - o2::constants::physics::MassLambda0) <= competingcascrejlambda || std::abs(candidate.mAntiLambda() - o2::constants::physics::MassLambda0) <= competingcascrejlambdaanti)) { return false; } hglue.fill(HIST("htrackscheck_v0"), 10.5); if (correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after10"), candidate.mK0Short(), candidate.mLambda()); - if (QAv0) { + if (qAv0) { rKzeroShort.fill(HIST("hMassK0ShortSelected"), candidate.mK0Short(), candidate.pt()); // rKzeroShort.fill(HIST("mass_lambda_kshort_after"), candidate.mK0Short(), candidate.mLambda()); } @@ -453,7 +473,7 @@ struct strangeness_tutorial { template bool isSelectedV0Daughter(T const& track, float charge, double nsigmaV0Daughter, V0s const& /*candidate*/) { - if (QAPID) { + if (qAPID) { // Filling the PID of the V0 daughters in the region of the K0 peak. (charge == 1) ? rKzeroShort.fill(HIST("hNSigmaPosPionK0s_before"), track.tpcInnerParam(), track.tpcNSigmaPi()) : rKzeroShort.fill(HIST("hNSigmaNegPionK0s_before"), track.tpcInnerParam(), track.tpcNSigmaPi()); rKzeroShort.fill(HIST("dE_by_dx_TPC"), track.p(), track.tpcSignal()); @@ -477,7 +497,7 @@ struct strangeness_tutorial { return false; hglue.fill(HIST("htrackscheck_v0_daughters"), 3.5); - if (tpcNClsF < ConfDaughTPCnclsMin) { + if (tpcNClsF < confDaughTPCnclsMin) { return false; } hglue.fill(HIST("htrackscheck_v0_daughters"), 4.5); @@ -497,12 +517,12 @@ struct strangeness_tutorial { } hglue.fill(HIST("htrackscheck_v0_daughters"), 6.5); - if (std::abs(eta) > ConfDaughEta) { + if (std::abs(eta) > confDaughEta) { return false; } hglue.fill(HIST("htrackscheck_v0_daughters"), 7.5); - if (std::abs(nsigmaV0Daughter) > ConfDaughPIDCuts) { + if (std::abs(nsigmaV0Daughter) > confDaughPIDCuts) { return false; } hglue.fill(HIST("htrackscheck_v0_daughters"), 8.5); @@ -513,17 +533,21 @@ struct strangeness_tutorial { // Defining filters for events (event selection) // Filter eventFilter = (o2::aod::evsel::sel8 == true); Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); - Filter AcceptenceFilter = (nabs(aod::track::eta) < cfgETAcut && nabs(aod::track::pt) > cfgPTcut); + Filter acceptenceFilter = (nabs(aod::track::eta) < cfgETAcut && nabs(aod::track::pt) > cfgPTcut); // Filters on V0s - Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && - nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv); + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0settingDcapostopv && + nabs(aod::v0data::dcanegtopv) > v0settingDcanegtopv); // Defining the type of the daughter tracks using DaughterTracks = soa::Join; using EventCandidates = soa::Filtered>; using TrackCandidates = soa::Filtered>; using V0TrackCandidate = aod::V0Datas; + // For Monte Carlo + using EventCandidatesMC = soa::Join; + using TrackCandidatesMC = soa::Filtered>; + using V0TrackCandidatesMC = soa::Join; // void processSE(soa::Filtered>::iterator const& collision, // soa::Filtered const& V0s, @@ -531,10 +555,12 @@ struct strangeness_tutorial { ROOT::Math::PxPyPzMVector daughter1, daughter2; ROOT::Math::PxPyPzMVector lv3; + // int counter3 = 0; void processSE(EventCandidates::iterator const& collision, TrackCandidates const& /*tracks*/, aod::V0Datas const& V0s) { hglue.fill(HIST("heventscheck"), 0.5); - const double massK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(); + // const double massK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(); + const double massK0s = o2::constants::physics::MassK0Short; float multiplicity = 0.0f; if (cfgMultFOTM) { multiplicity = collision.centFT0M(); @@ -545,12 +571,12 @@ struct strangeness_tutorial { return; } - auto occupancy_no = collision.trackOccupancyInTimeRange(); - if (applyOccupancyCut && occupancy_no < OccupancyCut) { + auto occupancyNumber = collision.trackOccupancyInTimeRange(); + if (applyOccupancyCut && occupancyNumber < occupancyCut) { return; } - if (QAevents) { + if (qAevents) { rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); rEventSelection.fill(HIST("hmultiplicity"), multiplicity); rEventSelection.fill(HIST("multdist_FT0M"), collision.multFT0M()); @@ -561,16 +587,16 @@ struct strangeness_tutorial { std::vector v0indexes; - for (auto& [v1, v2] : combinations(CombinationsUpperIndexPolicy(V0s, V0s))) { + for (const auto& [v1, v2] : combinations(CombinationsUpperIndexPolicy(V0s, V0s))) { if (v1.size() == 0 || v2.size() == 0) { continue; } - if (!SelectionV0(collision, v1, multiplicity)) { + if (!selectionV0(collision, v1, multiplicity)) { continue; } - if (!SelectionV0(collision, v2, multiplicity)) { + if (!selectionV0(collision, v2, multiplicity)) { continue; } @@ -591,7 +617,7 @@ struct strangeness_tutorial { continue; } - if (QAv0_daughters) { + if (qAv0Daughters) { rKzeroShort.fill(HIST("negative_pt"), negtrack1.pt()); rKzeroShort.fill(HIST("positive_pt"), postrack1.pt()); rKzeroShort.fill(HIST("negative_eta"), negtrack1.eta()); @@ -640,72 +666,78 @@ struct strangeness_tutorial { ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massK0s); // Kshort - ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair + ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of HigherMassResonances pair ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother - if (TMath::Abs(lv3.Rapidity() < 0.5)) { + // if (counter3 < 1e3) { + // std::cout << "rapidity is " << lv3.Rapidity() << std::endl; + // } + // counter3++; + + if (std::abs(lv3.Rapidity()) < 0.5) { - if (inv_mass1D) { + if (invMass1D) { hglue.fill(HIST("h1glueInvMassRot"), lv3.M()); } if (activateTHnSparseCosThStarHelicity) { ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); - hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancy_no); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(TMath::Pi() - TMath::Pi() / rotational_cut, TMath::Pi() + TMath::Pi() / rotational_cut); + hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancyNumber); + for (int i = 0; i < cRrotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); lv4.SetPtEtaPhiM(v1.pt(), v1.eta(), v1.phi() + theta2, massK0s); // for rotated background lv5 = lv2 + lv4; - hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarHelicity, occupancy_no); + hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarHelicity, occupancyNumber); } - } else if (activateTHnSparseCosThStarProduction) { ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); - hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancy_no); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(TMath::Pi() - TMath::Pi() / rotational_cut, TMath::Pi() + TMath::Pi() / rotational_cut); + hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancyNumber); + for (int i = 0; i < cRrotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); lv4.SetPtEtaPhiM(v1.pt(), v1.eta(), v1.phi() + theta2, massK0s); // for rotated background lv5 = lv2 + lv4; - hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarProduction, occupancy_no); + hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarProduction, occupancyNumber); } } else if (activateTHnSparseCosThStarBeam) { ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancy_no); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(TMath::Pi() - TMath::Pi() / rotational_cut, TMath::Pi() + TMath::Pi() / rotational_cut); + hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancyNumber); + for (int i = 0; i < cRrotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); lv4.SetPtEtaPhiM(v1.pt(), v1.eta(), v1.phi() + theta2, massK0s); // for rotated background lv5 = lv2 + lv4; - hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarBeam, occupancy_no); + hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarBeam, occupancyNumber); } } else if (activateTHnSparseCosThStarRandom) { auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancy_no); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(TMath::Pi() - TMath::Pi() / rotational_cut, TMath::Pi() + TMath::Pi() / rotational_cut); + hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancyNumber); + for (int i = 0; i < cRrotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); lv4.SetPtEtaPhiM(v1.pt(), v1.eta(), v1.phi() + theta2, massK0s); // for rotated background lv5 = lv2 + lv4; - hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarRandom, occupancy_no); + hglue.fill(HIST("h3glueInvMassRot"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarRandom, occupancyNumber); } } } } - if (QAv0) { + if (qAv0) { int sizeofv0indexes = v0indexes.size(); rKzeroShort.fill(HIST("NksProduced"), sizeofv0indexes); // std::cout << "Size of v0indexes: " << sizeofv0indexes << std::endl; } } - PROCESS_SWITCH(strangeness_tutorial, processSE, "same event process", true); + PROCESS_SWITCH(HigherMassResonances, processSE, "same event process", true); + array pvec0; + array pvec1; // use any one of 3 alias depending on the dataset. If pp then FT0M and if pbpb then FTOC using BinningTypeTPCMultiplicity = ColumnBinningPolicy; using BinningTypeCentralityM = ColumnBinningPolicy; @@ -716,7 +748,8 @@ struct strangeness_tutorial { void processME(EventCandidates const& collisions, TrackCandidates const& /*tracks*/, V0TrackCandidate const& v0s) { - const double massK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(); + // const double massK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(); + const double massK0s = o2::constants::physics::MassK0Short; auto tracksTuple = std::make_tuple(v0s); BinningTypeVertexContributor binningOnPositions1{{mevz, memult}, true}; BinningTypeCentralityM binningOnPositions2{{mevz, memult}, true}; @@ -725,7 +758,7 @@ struct strangeness_tutorial { SameKindPair pair2{binningOnPositions2, cfgNmixedEvents, -1, collisions, tracksTuple, &cache}; // for pp if (cfgMultFOTM) { - for (auto& [c1, tracks1, c2, tracks2] : pair2) // two different centrality c1 and c2 and tracks corresponding to them + for (const auto& [c1, tracks1, c2, tracks2] : pair2) // two different centrality c1 and c2 and tracks corresponding to them { float multiplicity = 0.0f; @@ -735,21 +768,21 @@ struct strangeness_tutorial { if (!eventselection(c1, multiplicity) || !eventselection(c2, multiplicity)) { continue; } - auto occupancy_no = c1.trackOccupancyInTimeRange(); - auto occupancy_no2 = c2.trackOccupancyInTimeRange(); - if (applyOccupancyCut && (occupancy_no < OccupancyCut || occupancy_no2 < OccupancyCut)) { + auto occupancyNumber = c1.trackOccupancyInTimeRange(); + auto occupancyNumber2 = c2.trackOccupancyInTimeRange(); + if (applyOccupancyCut && (occupancyNumber < occupancyCut || occupancyNumber2 < occupancyCut)) { return; } - for (auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (t1.size() == 0 || t2.size() == 0) { continue; } - if (!SelectionV0(c1, t1, multiplicity)) + if (!selectionV0(c1, t1, multiplicity)) continue; - if (!SelectionV0(c2, t2, multiplicity)) + if (!selectionV0(c2, t2, multiplicity)) continue; auto postrack1 = t1.template posTrack_as(); @@ -787,36 +820,36 @@ struct strangeness_tutorial { ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massK0s); // Kshort - ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair + ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of HigherMassResonances pair ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother - if (TMath::Abs(lv3.Rapidity() < 0.5)) { + if (std::abs(lv3.Rapidity()) < 0.5) { if (activateTHnSparseCosThStarHelicity) { ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancyNumber); } else if (activateTHnSparseCosThStarProduction) { ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancyNumber); } else if (activateTHnSparseCosThStarBeam) { ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancyNumber); } else if (activateTHnSparseCosThStarRandom) { auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancyNumber); } } - // if (TMath::Abs(lv3.Rapidity() < 0.5)) { - // if (inv_mass1D) { + // if (std::abs(lv3.Rapidity()) < 0.5) { + // if (invMass1D) { // hglue.fill(HIST("h1glueInvMassME"), lv3.M()); // } // hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M()); @@ -824,7 +857,7 @@ struct strangeness_tutorial { } } } else { - for (auto& [c1, tracks1, c2, tracks2] : pair1) // two different centrality c1 and c2 and tracks corresponding to them + for (const auto& [c1, tracks1, c2, tracks2] : pair1) // two different centrality c1 and c2 and tracks corresponding to them { float multiplicity = 0.0f; multiplicity = c1.centFT0C(); @@ -832,20 +865,20 @@ struct strangeness_tutorial { if (!eventselection(c1, multiplicity) || !eventselection(c2, multiplicity)) { continue; } - auto occupancy_no = c1.trackOccupancyInTimeRange(); - auto occupancy_no2 = c2.trackOccupancyInTimeRange(); - if (applyOccupancyCut && (occupancy_no < OccupancyCut || occupancy_no2 < OccupancyCut)) { + auto occupancyNumber = c1.trackOccupancyInTimeRange(); + auto occupancyNumber2 = c2.trackOccupancyInTimeRange(); + if (applyOccupancyCut && (occupancyNumber < occupancyCut || occupancyNumber2 < occupancyCut)) { return; } - for (auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (t1.size() == 0 || t2.size() == 0) { continue; } - if (!SelectionV0(c1, t1, multiplicity)) + if (!selectionV0(c1, t1, multiplicity)) continue; - if (!SelectionV0(c2, t2, multiplicity)) + if (!selectionV0(c2, t2, multiplicity)) continue; auto postrack1 = t1.template posTrack_as(); @@ -883,31 +916,31 @@ struct strangeness_tutorial { ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massK0s); // Kshort - ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair + ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of HigherMassResonances pair ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother - if (TMath::Abs(lv3.Rapidity() < 0.5)) { + if (std::abs(lv3.Rapidity()) < 0.5) { if (activateTHnSparseCosThStarHelicity) { ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity, occupancyNumber); } else if (activateTHnSparseCosThStarProduction) { ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction, occupancyNumber); } else if (activateTHnSparseCosThStarBeam) { ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam, occupancyNumber); } else if (activateTHnSparseCosThStarRandom) { auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancy_no); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom, occupancyNumber); } } @@ -915,8 +948,8 @@ struct strangeness_tutorial { // lv1.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massK0s); // lv2.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massK0s); // lv3 = lv1 + lv2; - // if (TMath::Abs(lv3.Rapidity() < 0.5)) { - // if (inv_mass1D) { + // if (std::abs(lv3.Rapidity()) < 0.5) { + // if (invMass1D) { // hglue.fill(HIST("h1glueInvMassME"), lv3.M()); // } // hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M()); @@ -925,11 +958,285 @@ struct strangeness_tutorial { } } } - PROCESS_SWITCH(strangeness_tutorial, processME, "mixed event process", true); + PROCESS_SWITCH(HigherMassResonances, processME, "mixed event process", true); + + int counter = 0; + void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) + { + TLorentzVector genvec; + hMChists.fill(HIST("events_check"), 0.5); + if (std::abs(mcCollision.posZ()) < cutzvertex) { + hMChists.fill(HIST("events_check"), 1.5); + } + // int Nchinel = 0; + // for (const auto& mcParticle : mcParticles) { + // auto pdgcode = std::abs(mcParticle.pdgCode()); + // if (mcParticle.isPhysicalPrimary() && (pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == 11 || pdgcode == 13)) { + // if (std::abs(mcParticle.eta()) < 1.0) { + // Nchinel = Nchinel + 1; + // } + // } + // } + // if (Nchinel > 0 && std::abs(mcCollision.posZ()) < cutzvertex) + hMChists.fill(HIST("events_check"), 2.5); + + std::vector selectedEvents(collisions.size()); + int nevts = 0; + for (const auto& collision : collisions) { + if (std::abs(collision.mcCollision().posZ()) > cutzvertex) { + continue; + } + + if (timFrameEvsel && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { + continue; + } + if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { + continue; + } + + selectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); + } + selectedEvents.resize(nevts); + hMChists.fill(HIST("events_check"), 3.5); + // const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end(); + + // if (!allGenCollisions && !evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection + // return; + // } + hMChists.fill(HIST("events_check"), 4.5); + for (const auto& mcParticle : mcParticles) { + if (std::abs(mcParticle.y()) >= 0.5) { + continue; + } + hMChists.fill(HIST("events_check"), 5.5); + + // if (counter < 1e4) { + // std::cout << "PDG code mother " << mcParticle.pdgCode() << std::endl; + // } + // counter++; + if (std::abs(mcParticle.pdgCode()) != 10331) // f2(1525), f0(1710) + { + continue; + } + hMChists.fill(HIST("events_check"), 6.5); + + auto kDaughters = mcParticle.daughters_as(); + if (kDaughters.size() != 2) { + continue; + } + hMChists.fill(HIST("events_check"), 7.5); + + auto passKs = false; + for (const auto& kCurrentDaughter : kDaughters) { + // int daupdg = std::abs(kCurrentDaughter.pdgCode()); + // if (counter < 1e4) + // std::cout << "Daughter pdg code: " << daupdg << std::endl; + // counter++; + + if (!kCurrentDaughter.isPhysicalPrimary()) { + continue; + } + hMChists.fill(HIST("events_check"), 8.5); + + if (std::abs(kCurrentDaughter.pdgCode()) == 310) { + passKs = true; + hMChists.fill(HIST("events_check"), 9.5); + } + } + if (passKs) { + genvec.SetPtEtaPhiE(mcParticle.pt(), mcParticle.eta(), mcParticle.phi(), mcParticle.e()); + hMChists.fill(HIST("Genf1710"), mcParticle.pt()); + hMChists.fill(HIST("Genf1710_mass"), genvec.M()); + } + } + } + PROCESS_SWITCH(HigherMassResonances, processGen, "Process Generated", false); + + int counter2 = 0; + int eventCounter = 0; + std::vector gindex1, gindex2; + void processRec(EventCandidatesMC::iterator const& collision, V0TrackCandidatesMC const& V0s, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/) + { + + TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance; + + float multiplicity = 0.0f; + multiplicity = collision.centFT0C(); + hMChists.fill(HIST("MC_mult"), multiplicity); + + hMChists.fill(HIST("events_checkrec"), 0.5); + if (!collision.has_mcCollision()) { + return; + } + hMChists.fill(HIST("events_checkrec"), 1.5); + // if (std::abs(collision.mcCollision().posZ()) > cutzvertex || !collision.sel8()) { + if (std::abs(collision.mcCollision().posZ()) > cutzvertex) { + return; + } + hMChists.fill(HIST("events_checkrec"), 2.5); + + if (timFrameEvsel && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { + return; + } + hMChists.fill(HIST("events_checkrec"), 3.5); + if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { + return; + } + hMChists.fill(HIST("events_checkrec"), 4.5); + hMChists.fill(HIST("MC_mult_after_event_sel"), multiplicity); + eventCounter++; + + for (const auto& v01 : V0s) { + + for (const auto& v02 : V0s) { + + hMChists.fill(HIST("events_checkrec"), 5.5); + + if (v02.index() <= v01.index()) { + continue; + } + + if (!v01.has_mcParticle() || !v02.has_mcParticle()) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 6.5); + + auto postrack1 = v01.template posTrack_as(); + auto negtrack1 = v01.template negTrack_as(); + + auto postrack2 = v02.template posTrack_as(); + auto negtrack2 = v02.template negTrack_as(); + + if (!postrack1.has_mcParticle() || !postrack2.has_mcParticle()) + continue; // Checking that the daughter tracks come from particles and are not fake + hMChists.fill(HIST("events_checkrec"), 7.5); + + if (!negtrack1.has_mcParticle() || !negtrack2.has_mcParticle()) + continue; + hMChists.fill(HIST("events_checkrec"), 8.5); + + double nTPCSigmaPos1[1]{postrack1.tpcNSigmaPi()}; + double nTPCSigmaNeg1[1]{negtrack1.tpcNSigmaPi()}; + + double nTPCSigmaPos2[1]{postrack2.tpcNSigmaPi()}; + double nTPCSigmaNeg2[1]{negtrack2.tpcNSigmaPi()}; + + if (!isSelectedV0Daughter(postrack1, 1, nTPCSigmaPos1[0], v01) || !isSelectedV0Daughter(postrack2, 1, nTPCSigmaPos2[0], v02)) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 9.5); + + if (!isSelectedV0Daughter(negtrack1, -1, nTPCSigmaNeg1[0], v01) || !isSelectedV0Daughter(negtrack2, -1, nTPCSigmaNeg2[0], v02)) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 10.5); + + if (!selectionV0(collision, v01, multiplicity) || !selectionV0(collision, v02, multiplicity)) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 11.5); + + auto mctrackv01 = v01.mcParticle(); + auto mctrackv02 = v02.mcParticle(); + + int trackv0PDG1 = std::abs(mctrackv01.pdgCode()); + int trackv0PDG2 = std::abs(mctrackv02.pdgCode()); + + if (std::abs(trackv0PDG1) != 310 || std::abs(trackv0PDG2) != 310) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 12.5); + + for (const auto& mothertrack1 : mctrackv01.mothers_as()) { + + // int motpdgs = std::abs(mothertrack1.pdgCode()); + gindex1.push_back(mothertrack1.globalIndex()); + if (gindex1.size() > 1) { + if (std::find(gindex1.begin(), gindex1.end(), mothertrack1.globalIndex()) != gindex1.end()) { + continue; + } + } + // if (counter2 < 1e4) + // std::cout << "Mother1 pdg code: " << motpdgs << " p_{T} " << mothertrack1.pt() << "Global index " << mothertrack1.globalIndex() << " event " << eventCounter << std::endl; + // counter2++; + + // int counter_check = 0; + + for (const auto& mothertrack2 : mctrackv02.mothers_as()) { + + hMChists.fill(HIST("events_checkrec"), 13.5); + + if (mothertrack1.pdgCode() != mothertrack2.pdgCode()) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 14.5); + + // int motpdgs2 = std::abs(mothertrack2.pdgCode()); + gindex2.push_back(mothertrack2.globalIndex()); + if (gindex2.size() > 1) { + if (std::find(gindex2.begin(), gindex2.end(), mothertrack2.globalIndex()) != gindex2.end()) { + continue; + } + } + // if (counter2 < 1e4) + // std::cout << "Mother2 pdg code: " << motpdgs2 << " p_{T} " << mothertrack2.pt() << "Global index " << mothertrack1.globalIndex() << " event " << eventCounter << std::endl; + + if (mothertrack1.pdgCode() != 10331) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 15.5); + + if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 16.5); + + if (!mothertrack1.producedByGenerator()) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 17.5); + + if (std::abs(mothertrack1.y()) >= 0.5) { + continue; + } + hMChists.fill(HIST("events_checkrec"), 18.5); + + // counter_check++; + // if (counter_check > 1) { + // std::cout << "Total mothers is " << counter_check << std::endl; + // } + // std::cout << "After selection " << " p_{T} " << mothertrack2.pt() << " event " << eventCounter << std::endl; + + pvec0 = std::array{v01.px(), v01.py(), v01.pz()}; + pvec1 = std::array{v02.px(), v02.py(), v02.pz()}; + auto arrMomrec = std::array{pvec0, pvec1}; + auto motherP = mothertrack1.p(); + // auto motherE = mothertrack1.e(); + // auto genMass = std::sqrt(motherE * motherE - motherP * motherP); + auto recMass = RecoDecay::m(arrMomrec, std::array{o2::constants::physics::MassK0Short, o2::constants::physics::MassK0Short}); + // auto recpt = TMath::Sqrt((track1.px() + track2.px()) * (track1.px() + track2.px()) + (track1.py() + track2.py()) * (track1.py() + track2.py())); + //// Resonance reconstruction + lDecayDaughter1.SetXYZM(v01.px(), v01.py(), v01.pz(), o2::constants::physics::MassK0Short); + lDecayDaughter2.SetXYZM(v02.px(), v02.py(), v02.pz(), o2::constants::physics::MassK0Short); + lResonance = lDecayDaughter1 + lDecayDaughter2; + + hMChists.fill(HIST("Recf1710_p"), motherP); + hMChists.fill(HIST("Recf1710_mass"), recMass); + hMChists.fill(HIST("Recf1710_pt1"), mothertrack1.pt()); + // hMChists.fill(HIST("Genf1710_mass"), genMass); + hMChists.fill(HIST("Recf1710_pt2"), lResonance.Pt()); + } + gindex2.clear(); + } + gindex1.clear(); + } + } + } + PROCESS_SWITCH(HigherMassResonances, processRec, "Process Reconstructed", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } diff --git a/PWGLF/Tasks/Resonances/kstarqa.cxx b/PWGLF/Tasks/Resonances/kstarqa.cxx index 5517a69818e..06fcb14511c 100644 --- a/PWGLF/Tasks/Resonances/kstarqa.cxx +++ b/PWGLF/Tasks/Resonances/kstarqa.cxx @@ -8,17 +8,19 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// -/// \brief this is a code for the kstarqa resonance + +/// \file Kstarqa.cxx +/// \brief this is a code for the Kstarqa resonance /// \author prottay das, sawan /// \since 13/03/2024 -#include +// #include #include #include #include #include #include +#include #include #include #include @@ -52,7 +54,7 @@ using namespace o2::framework::expressions; using namespace o2::soa; using std::array; -struct kstarqa { +struct Kstarqa { SliceCache cache; @@ -61,27 +63,27 @@ struct kstarqa { HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; // Confugrable for QA histograms - Configurable CalcLikeSign{"CalcLikeSign", true, "Calculate Like Sign"}; - Configurable CalcRotational{"CalcRotational", true, "Calculate Rotational"}; - Configurable QAbefore{"QAbefore", true, "QAbefore"}; - Configurable QAafter{"QAafter", true, "QAafter"}; - Configurable QAevents{"QAevents", true, "Multiplicity dist, DCAxy, DCAz"}; + Configurable calcLikeSign{"calcLikeSign", true, "Calculate Like Sign"}; + Configurable calcRotational{"calcRotational", true, "Calculate Rotational"}; + Configurable cQAbefore{"cQAbefore", true, "cQAbefore"}; + Configurable cQAafter{"cQAafter", true, "cQAafter"}; + Configurable cQAevents{"cQAevents", true, "Multiplicity dist, DCAxy, DCAz"}; Configurable onlyTOF{"onlyTOF", false, "only TOF tracks"}; Configurable onlyTOFHIT{"onlyTOFHIT", false, "accept only TOF hit tracks at high pt"}; Configurable onlyTPC{"onlyTPC", true, "only TPC tracks"}; Configurable cfgFT0M{"cfgFT0M", true, "1: pp, 0: PbPb"}; // Configurables for track selections - Configurable rotational_cut{"rotational_cut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; + Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; Configurable cfgCutPT{"cfgCutPT", 0.2f, "PT cut on daughter track"}; Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta cut on daughter track"}; Configurable cfgCutDCAxy{"cfgCutDCAxy", 2.0f, "DCAxy range for tracks"}; Configurable cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"}; - Configurable nsigmaCutTPCPi{"nsigmacutTPCPi", 3.0, "Value of the TPC Nsigma cut for pions"}; - Configurable nsigmaCutTPCKa{"nsigmacutTPCKa", 3.0, "Value of the TPC Nsigma cut for kaons"}; - Configurable nsigmaCutTOFPi{"nsigmacutTOFPi", 3.0, "Value of the TOF Nsigma cut for pions"}; - Configurable nsigmaCutTOFKa{"nsigmacutTOFKa", 3.0, "Value of the TOF Nsigma cut for kaons"}; - Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Value of the Combined Nsigma cut"}; + Configurable nsigmaCutTPCPi{"nsigmaCutTPCPi", 3.0, "TPC Nsigma cut for pions"}; + Configurable nsigmaCutTPCKa{"nsigmaCutTPCKa", 3.0, "TPC Nsigma cut for kaons"}; + Configurable nsigmaCutTOFPi{"nsigmaCutTOFPi", 3.0, "TOF Nsigma cut for pions"}; + Configurable nsigmaCutTOFKa{"nsigmaCutTOFKa", 3.0, "TOF Nsigma cut for kaons"}; + Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Combined Nsigma cut"}; Configurable cfgNoMixedEvents{"cfgNoMixedEvents", 5, "Number of mixed events per event"}; Configurable ismanualDCAcut{"ismanualDCAcut", true, "ismanualDCAcut"}; Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; @@ -96,9 +98,9 @@ struct kstarqa { // Event selection configurables Configurable timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"}; - Configurable TVXEvsel{"TVXEvsel", false, "Triggger selection"}; + Configurable cTVXEvsel{"cTVXEvsel", false, "Triggger selection"}; Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; - Configurable MID{"MID", false, "Misidentification of tracks"}; + Configurable cMID{"cMID", false, "Misidentification of tracks"}; // Configurable for histograms Configurable nBins{"nBins", 100, "N bins in all histos"}; @@ -108,21 +110,21 @@ struct kstarqa { Configurable nBinspT{"nBinspT", 200, "N bins in pT histos"}; Configurable pTbinlow{"pTbinlow", 0.0, "pT bin low"}; Configurable pTbinhigh{"pTbinhigh", 20.0, "pT bin high"}; - ConfigurableAxis binsMultPlot{"binsCent", {201, -0.5f, 200.5f}, "Binning of the centrality axis for plots"}; Configurable avoidsplitrackMC{"avoidsplitrackMC", true, "avoid split track in MC"}; - Configurable AllGenCollisions{"AllGenCollisions", true, "To fill all generated collisions for the signal loss calculations"}; + Configurable cAllGenCollisions{"cAllGenCollisions", true, "To fill all generated collisions for the signal loss calculations"}; + ConfigurableAxis binsMultPlot{"binsMultPlot", {201, -0.5f, 200.5f}, "centrality axis bins"}; ConfigurableAxis axisdEdx{"axisdEdx", {20000, 0.0f, 200.0f}, "dE/dx (a.u.)"}; ConfigurableAxis axisPtfordEbydx{"axisPtfordEbydx", {2000, 0, 20}, "pT (GeV/c)"}; ConfigurableAxis axisMultdist{"axisMultdist", {3500, 0, 70000}, "Multiplicity distribution"}; // Event plane configurables - Configurable boost_daugter1{"boost_daugter1", false, "Boost daughter Kaon in the COM frame"}; - Configurable boost_daugter2{"boost_daugter2", true, "Boost daughter Pion in the COM frame"}; + Configurable boostDaugter1{"boostDaugter1", false, "Boost daughter Kaon in the COM frame"}; + Configurable boostDaugter2{"boostDaugter2", true, "Boost daughter Pion in the COM frame"}; Configurable activateTHnSparseCosThStarHelicity{"activateTHnSparseCosThStarHelicity", true, "Activate the THnSparse with cosThStar w.r.t. helicity axis"}; Configurable activateTHnSparseCosThStarProduction{"activateTHnSparseCosThStarProduction", false, "Activate the THnSparse with cosThStar w.r.t. production axis"}; Configurable activateTHnSparseCosThStarBeam{"activateTHnSparseCosThStarBeam", false, "Activate the THnSparse with cosThStar w.r.t. beam axis (Gottified jackson frame)"}; Configurable activateTHnSparseCosThStarRandom{"activateTHnSparseCosThStarRandom", false, "Activate the THnSparse with cosThStar w.r.t. random axis"}; - Configurable c_nof_rotations{"c_nof_rotations", 3, "Number of random rotations in the rotational background"}; + Configurable cRotations{"cRotations", 3, "Number of random rotations in the rotational background"}; ConfigurableAxis configThnAxisPOL{"configThnAxisPOL", {20, -1.0, 1.0}, "Costheta axis"}; TRandom* rn = new TRandom(); @@ -140,7 +142,7 @@ struct kstarqa { rEventSelection.add("hmult", "Multiplicity percentile", kTH1F, {{binsMultPlot}}); // for primary tracks - if (QAbefore && QAafter) { + if (cQAbefore && cQAafter) { histos.add("hNsigmaTPC_before", "NsigmaKaon TPC distribution before", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); histos.add("hNsigmaTOF_before", "NsigmaKaon TOF distribution before", kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); histos.add("dE_by_dx_TPC", "dE/dx signal in the TPC as a function of pT", kTH2F, {axisPtfordEbydx, axisdEdx}); @@ -176,7 +178,7 @@ struct kstarqa { histos.add("h1KSRecsplit", "KS meson Rec split", kTH1F, {{100, 0.0f, 10.0f}}); // Multplicity distribution - if (QAevents) { + if (cQAevents) { histos.add("multdist_FT0M", "FT0M Multiplicity distribution", kTH1F, {axisMultdist}); histos.add("multdist_FT0A", "FT0A Multiplicity distribution", kTH1F, {axisMultdist}); histos.add("multdist_FT0C", "FT0C Multiplicity distribution", kTH1F, {axisMultdist}); @@ -186,11 +188,9 @@ struct kstarqa { } } - double massPi = TDatabasePDG::Instance()->GetParticle(kPiPlus)->Mass(); // FIXME: Get from the common header + // double massPi = TDatabasePDG::Instance()->GetParticle(kPiPlus)->Mass(); // FIXME: Get from the common header + double massPi = o2::constants::physics::MassPiPlus; double massKa = o2::constants::physics::MassKPlus; - ROOT::Math::PtEtaPhiMVector CKSVector; - ROOT::Math::PtEtaPhiMVector CKSVectorRot1; - ROOT::Math::PtEtaPhiMVector CKSVectorRot2; template bool selectionTrack(const T& candidate) @@ -284,7 +284,7 @@ struct kstarqa { } template - bool MIDselectionPID(const T& candidate, int PID) + bool cMIDselectionPID(const T& candidate, int PID) { if (PID == 0) { if (onlyTOF) { @@ -363,8 +363,8 @@ struct kstarqa { return false; } - array pvec0; - array pvec1; + std::array pvec0; + std::array pvec1; // Defining filters for events (event selection) // Processed events will be already fulfilling the event selection @@ -373,7 +373,7 @@ struct kstarqa { Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); Filter acceptanceFilter = (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT); - Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); + Filter fDCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz); using EventCandidates = soa::Filtered>; using TrackCandidates = soa::Filtered>; @@ -384,23 +384,23 @@ struct kstarqa { template void fillInvMass(const T1& track1, const T2& track2, const T3& lv2, const T4& lv3, float multiplicity, bool isMix) { - ROOT::Math::PxPyPzMVector daughter1, daughter2, daughter_selected; + ROOT::Math::PxPyPzMVector daughter1, daughter2, daughterSelected; daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); // Kaon daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); // Pion - daughter_selected = (boost_daugter1) ? daughter1 : daughter2; - auto selected_dau_mass = (boost_daugter1) ? massKa : massPi; + daughterSelected = (boostDaugter1) ? daughter1 : daughter2; + auto selectedDauMass = (boostDaugter1) ? massKa : massPi; TLorentzVector lv4, lv5; // polarization calculations - ROOT::Math::PxPyPzMVector fourVecDau1 = ROOT::Math::PxPyPzMVector(daughter_selected.Px(), daughter_selected.Py(), daughter_selected.Pz(), selected_dau_mass); // Kaon or Pion + ROOT::Math::PxPyPzMVector fourVecDau1 = ROOT::Math::PxPyPzMVector(daughterSelected.Px(), daughterSelected.Py(), daughterSelected.Pz(), selectedDauMass); // Kaon or Pion ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KshortKshort pair ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau1); // boost the frame of daughter same as mother ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother - if (TMath::Abs(lv3.Rapidity() < 0.5)) { + if (std::abs(lv3.Rapidity()) < 0.5) { if (activateTHnSparseCosThStarHelicity) { ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); @@ -409,11 +409,11 @@ struct kstarqa { if (!isMix) { histos.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(TMath::Pi() - TMath::Pi() / rotational_cut, TMath::Pi() + TMath::Pi() / rotational_cut); + for (int i = 0; i < cRotations; i++) { + float theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); lv4.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi() + theta2, massKa); // for rotated background lv5 = lv2 + lv4; - if (CalcRotational) + if (calcRotational) histos.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarHelicity); } } else { @@ -421,7 +421,7 @@ struct kstarqa { } } else { if (!isMix) { - if (CalcLikeSign) + if (calcLikeSign) histos.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarHelicity); } } @@ -433,11 +433,11 @@ struct kstarqa { if (track1.sign() * track2.sign() < 0) { if (!isMix) { histos.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(0, TMath::Pi()); + for (int i = 0; i < cRotations; i++) { + float theta2 = rn->Uniform(0, o2::constants::math::PI); lv4.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi() + theta2, massKa); // for rotated background lv5 = lv2 + lv4; - if (CalcRotational) + if (calcRotational) histos.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarProduction); } } else { @@ -445,7 +445,7 @@ struct kstarqa { } } else { if (!isMix) { - if (CalcLikeSign) + if (calcLikeSign) histos.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarProduction); } } @@ -456,18 +456,18 @@ struct kstarqa { if (track1.sign() * track2.sign() < 0) { if (!isMix) { histos.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(0, TMath::Pi()); + for (int i = 0; i < cRotations; i++) { + float theta2 = rn->Uniform(0, o2::constants::math::PI); lv4.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi() + theta2, massKa); // for rotated background lv5 = lv2 + lv4; - if (CalcRotational) + if (calcRotational) histos.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarBeam); } } else { histos.fill(HIST("h3KstarInvMassMixed"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam); } } else { - if (CalcLikeSign) + if (calcLikeSign) histos.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarBeam); } } else if (activateTHnSparseCosThStarRandom) { @@ -480,11 +480,11 @@ struct kstarqa { if (track1.sign() * track2.sign() < 0) { if (!isMix) { histos.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom); - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(0, TMath::Pi()); + for (int i = 0; i < cRotations; i++) { + float theta2 = rn->Uniform(0, o2::constants::math::PI); lv4.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi() + theta2, massKa); // for rotated background lv5 = lv2 + lv4; - if (CalcRotational) + if (calcRotational) histos.fill(HIST("h3KstarInvMassRotated"), multiplicity, lv5.Pt(), lv5.M(), cosThetaStarRandom); } } else { @@ -492,7 +492,7 @@ struct kstarqa { } } else { if (!isMix) { - if (CalcLikeSign) + if (calcLikeSign) histos.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, lv3.Pt(), lv3.M(), cosThetaStarRandom); } } @@ -505,7 +505,7 @@ struct kstarqa { { histos.fill(HIST("events_check_data"), 0.5); - if (TVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { + if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { return; } histos.fill(HIST("events_check_data"), 1.5); @@ -525,7 +525,7 @@ struct kstarqa { multiplicity = (cfgFT0M) ? collision.centFT0M() : collision.centFT0C(); // Fill the event counter - if (QAevents) { + if (cQAevents) { rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); rEventSelection.fill(HIST("hmult"), multiplicity); histos.fill(HIST("multdist_FT0M"), collision.multFT0M()); @@ -534,8 +534,8 @@ struct kstarqa { // histos.fill(HIST("hNcontributor"), collision.numContrib()); } - for (auto& [track1, track2] : combinations(CombinationsFullIndexPolicy(tracks, tracks))) { - if (QAbefore) { + for (const auto& [track1, track2] : combinations(CombinationsFullIndexPolicy(tracks, tracks))) { + if (cQAbefore) { histos.fill(HIST("hNsigmaTPC_before"), track1.pt(), track1.tpcNSigmaKa()); histos.fill(HIST("hNsigmaTOF_before"), track1.pt(), track1.tofNSigmaKa()); histos.fill(HIST("hCRFC_before"), track1.tpcCrossedRowsOverFindableCls()); @@ -551,7 +551,7 @@ struct kstarqa { continue; } histos.fill(HIST("events_check_data"), 5.5); - if (QAevents) { + if (cQAevents) { histos.fill(HIST("hDcaxy"), track1.dcaXY()); histos.fill(HIST("hDcaz"), track1.dcaZ()); } @@ -564,18 +564,18 @@ struct kstarqa { histos.fill(HIST("events_check_data"), 6.5); - if (MID) { - if (MIDselectionPID(track1, 0)) // Kaon misidentified as pion + if (cMID) { + if (cMIDselectionPID(track1, 0)) // Kaon misidentified as pion continue; - if (MIDselectionPID(track1, 2)) // Kaon misidentified as proton + if (cMIDselectionPID(track1, 2)) // Kaon misidentified as proton continue; - if (MIDselectionPID(track2, 1)) // Pion misidentified as kaon + if (cMIDselectionPID(track2, 1)) // Pion misidentified as kaon continue; } histos.fill(HIST("events_check_data"), 7.5); - if (QAafter) { + if (cQAafter) { histos.fill(HIST("hEta_after"), track1.eta()); histos.fill(HIST("hCRFC_after"), track1.tpcCrossedRowsOverFindableCls()); // histos.fill(HIST("hNsigmaKaonTPC_after"), track1.pt(), track1.tpcNSigmaKa()); @@ -598,7 +598,7 @@ struct kstarqa { } } - PROCESS_SWITCH(kstarqa, processSE, "Process Same event", true); + PROCESS_SWITCH(Kstarqa, processSE, "Process Same event", true); ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for ME mixing"}; ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {10, 0, 100}, "multiplicity percentile for ME mixing"}; @@ -617,7 +617,7 @@ struct kstarqa { void processME(EventCandidates const&, TrackCandidates const&) { if (cfgFT0M) { - for (auto& [c1, tracks1, c2, tracks2] : pair1) { + for (const auto& [c1, tracks1, c2, tracks2] : pair1) { if (!c1.sel8()) { continue; @@ -630,13 +630,13 @@ struct kstarqa { continue; } - if (TVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) { + if (cTVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) { return; } auto multiplicity = c1.centFT0M(); - for (auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (!selectionTrack(t1)) // Kaon continue; @@ -646,30 +646,30 @@ struct kstarqa { continue; if (!selectionPID(t2, 0)) // Pion continue; - if (MID) { - if (MIDselectionPID(t1, 0)) // misidentified as pion + if (cMID) { + if (cMIDselectionPID(t1, 0)) // misidentified as pion continue; - if (MIDselectionPID(t1, 2)) // misidentified as proton + if (cMIDselectionPID(t1, 2)) // misidentified as proton continue; - if (MIDselectionPID(t2, 1)) // misidentified as kaon + if (cMIDselectionPID(t2, 1)) // misidentified as kaon continue; } - TLorentzVector KAON; - KAON.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); - TLorentzVector PION; - PION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); + TLorentzVector vKAON; + vKAON.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); + TLorentzVector vPION; + vPION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); - TLorentzVector Kstar = KAON + PION; + TLorentzVector kstar = vKAON + vPION; bool isMix = true; - if (TMath::Abs(Kstar.Rapidity()) < 0.5) { - fillInvMass(t1, t2, PION, Kstar, multiplicity, isMix); + if (std::abs(kstar.Rapidity()) < 0.5) { + fillInvMass(t1, t2, vPION, kstar, multiplicity, isMix); } } } } else { - for (auto& [c1, tracks1, c2, tracks2] : pair2) { + for (const auto& [c1, tracks1, c2, tracks2] : pair2) { if (!c1.sel8()) { continue; @@ -682,13 +682,13 @@ struct kstarqa { continue; } - if (TVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) { + if (cTVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) { return; } auto multiplicity = c1.centFT0C(); - for (auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (!selectionTrack(t1)) // Kaon continue; @@ -698,51 +698,51 @@ struct kstarqa { continue; if (!selectionPID(t2, 0)) // Pion continue; - if (MID) { - if (MIDselectionPID(t1, 0)) // misidentified as pion + if (cMID) { + if (cMIDselectionPID(t1, 0)) // misidentified as pion continue; - if (MIDselectionPID(t1, 2)) // misidentified as proton + if (cMIDselectionPID(t1, 2)) // misidentified as proton continue; - if (MIDselectionPID(t2, 1)) // misidentified as kaon + if (cMIDselectionPID(t2, 1)) // misidentified as kaon continue; } - TLorentzVector KAON; - KAON.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); - TLorentzVector PION; - PION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); + TLorentzVector vKAON; + vKAON.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); + TLorentzVector vPION; + vPION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); - TLorentzVector Kstar = KAON + PION; + TLorentzVector kstar = vKAON + vPION; bool isMix = true; - if (TMath::Abs(Kstar.Rapidity()) < 0.5) { - fillInvMass(t1, t2, PION, Kstar, multiplicity, isMix); + if (std::abs(kstar.Rapidity()) < 0.5) { + fillInvMass(t1, t2, vPION, kstar, multiplicity, isMix); } } } } } - PROCESS_SWITCH(kstarqa, processME, "Process Mixed event", true); + PROCESS_SWITCH(Kstarqa, processME, "Process Mixed event", true); - void processGen(aod::McCollision const& mcCollision, aod::McParticles& mcParticles, const soa::SmallGroups& collisions) + void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) { histos.fill(HIST("events_check"), 0.5); if (std::abs(mcCollision.posZ()) < cutzvertex) { histos.fill(HIST("events_check"), 1.5); } - int Nchinel = 0; - for (auto& mcParticle : mcParticles) { + int nChInel = 0; + for (const auto& mcParticle : mcParticles) { auto pdgcode = std::abs(mcParticle.pdgCode()); if (mcParticle.isPhysicalPrimary() && (pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == 11 || pdgcode == 13)) { if (std::abs(mcParticle.eta()) < 1.0) { - Nchinel = Nchinel + 1; + nChInel = nChInel + 1; } } } - if (Nchinel > 0 && std::abs(mcCollision.posZ()) < cutzvertex) + if (nChInel > 0 && std::abs(mcCollision.posZ()) < cutzvertex) histos.fill(HIST("events_check"), 2.5); - std::vector SelectedEvents(collisions.size()); + std::vector selectedEvents(collisions.size()); int nevts = 0; for (const auto& collision : collisions) { // if (!collision.sel8() || std::abs(collision.mcCollision().posZ()) > cutzvertex) { @@ -753,26 +753,26 @@ struct kstarqa { if (timFrameEvsel && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { continue; } - if (TVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { + if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { continue; } - SelectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); + selectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); } - SelectedEvents.resize(nevts); + selectedEvents.resize(nevts); histos.fill(HIST("events_check"), 3.5); - const auto evtReconstructedAndSelected = std::find(SelectedEvents.begin(), SelectedEvents.end(), mcCollision.globalIndex()) != SelectedEvents.end(); + const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end(); - if (!AllGenCollisions && !evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection + if (!cAllGenCollisions && !evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection return; } histos.fill(HIST("events_check"), 4.5); - for (auto& mcParticle : mcParticles) { + for (const auto& mcParticle : mcParticles) { if (std::abs(mcParticle.y()) >= 0.5) { continue; } histos.fill(HIST("events_check"), 5.5); - if (abs(mcParticle.pdgCode()) != 313) { + if (std::abs(mcParticle.pdgCode()) != 313) { continue; } histos.fill(HIST("events_check"), 6.5); @@ -783,16 +783,16 @@ struct kstarqa { histos.fill(HIST("events_check"), 7.5); auto passkaon = false; auto passpion = false; - for (auto kCurrentDaughter : kDaughters) { + for (const auto& kCurrentDaughter : kDaughters) { if (!kCurrentDaughter.isPhysicalPrimary()) { continue; } histos.fill(HIST("events_check"), 8.5); - if (abs(kCurrentDaughter.pdgCode()) == 321) { + if (std::abs(kCurrentDaughter.pdgCode()) == 321) { // if (kCurrentDaughter.pdgCode() == +321) { passkaon = true; histos.fill(HIST("events_check"), 9.5); - } else if (abs(kCurrentDaughter.pdgCode()) == 211) { + } else if (std::abs(kCurrentDaughter.pdgCode()) == 211) { //} else if (kCurrentDaughter.pdgCode() == -321) { passpion = true; // histos.fill(HIST("events_check"), 10.5); @@ -806,7 +806,7 @@ struct kstarqa { } } } - PROCESS_SWITCH(kstarqa, processGen, "Process Generated", false); + PROCESS_SWITCH(Kstarqa, processGen, "Process Generated", false); void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/) { @@ -828,13 +828,13 @@ struct kstarqa { return; } histos.fill(HIST("events_checkrec"), 3.5); - if (TVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { + if (cTVXEvsel && (!collision.selection_bit(aod::evsel::kIsTriggerTVX))) { return; } histos.fill(HIST("events_checkrec"), 4.5); auto oldindex = -999; - for (auto track1 : tracks) { + for (const auto& track1 : tracks) { if (!selectionTrack(track1)) { continue; } @@ -844,7 +844,7 @@ struct kstarqa { } histos.fill(HIST("events_checkrec"), 6.5); auto track1ID = track1.index(); - for (auto track2 : tracks) { + for (const auto& track2 : tracks) { if (!track2.has_mcParticle()) { continue; } @@ -886,8 +886,8 @@ struct kstarqa { } // LOG(info) << "trackpdgs are:"<()) { - for (auto& mothertrack2 : mctrack2.mothers_as()) { + for (const auto& mothertrack1 : mctrack1.mothers_as()) { + for (const auto& mothertrack2 : mctrack2.mothers_as()) { if (mothertrack1.pdgCode() != mothertrack2.pdgCode()) { continue; } @@ -913,13 +913,13 @@ struct kstarqa { continue; } oldindex = mothertrack1.globalIndex(); - pvec0 = array{track1.px(), track1.py(), track1.pz()}; - pvec1 = array{track2.px(), track2.py(), track2.pz()}; - auto arrMomrec = array{pvec0, pvec1}; + pvec0 = std::array{track1.px(), track1.py(), track1.pz()}; + pvec1 = std::array{track2.px(), track2.py(), track2.pz()}; + auto arrMomrec = std::array{pvec0, pvec1}; auto motherP = mothertrack1.p(); auto motherE = mothertrack1.e(); auto genMass = std::sqrt(motherE * motherE - motherP * motherP); - auto recMass = RecoDecay::m(arrMomrec, array{massKa, massPi}); + auto recMass = RecoDecay::m(arrMomrec, std::array{massKa, massPi}); // auto recpt = TMath::Sqrt((track1.px() + track2.px()) * (track1.px() + track2.px()) + (track1.py() + track2.py()) * (track1.py() + track2.py())); //// Resonance reconstruction lDecayDaughter1.SetXYZM(track1.px(), track1.py(), track1.pz(), massKa); @@ -935,10 +935,10 @@ struct kstarqa { } } } - PROCESS_SWITCH(kstarqa, processRec, "Process Reconstructed", false); + PROCESS_SWITCH(Kstarqa, processRec, "Process Reconstructed", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 0f64f37bfbc0a99c7c1ec7af7a53613784b2441e Mon Sep 17 00:00:00 2001 From: Zuzanna Chochulska <87480906+zchochul@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:36:13 +0100 Subject: [PATCH 431/459] [PWGCF] FemtoUniverse -- Fixing major O2 linter errors for FemtoUniverse directory (#9046) Co-authored-by: Zuzanna Chochulska Co-authored-by: Zuzanna Chochulska <01150674@pw.edu.pl> --- .../Core/FemtoUniverse3DContainer.h | 98 ++--- .../Core/FemtoUniverseAngularContainer.h | 92 ++-- .../Core/FemtoUniverseCascadeSelection.h | 188 ++++----- .../Core/FemtoUniverseCollisionSelection.h | 33 +- .../Core/FemtoUniverseContainer.h | 126 +++--- .../Core/FemtoUniverseCutculator.h | 110 ++--- .../Core/FemtoUniverseDetaDphiStar.h | 244 ++++++----- .../Core/FemtoUniverseEventHisto.h | 4 +- .../Core/FemtoUniverseFemtoContainer.h | 162 +++---- PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h | 73 ++-- .../Core/FemtoUniverseObjectSelection.h | 38 +- .../FemtoUniversePairAngularWithCentMultKt.h | 189 +++++---- .../Core/FemtoUniversePairCleaner.h | 24 +- .../Core/FemtoUniversePairSHCentMultKt.h | 312 ++++++-------- .../Core/FemtoUniversePairWithCentMultKt.h | 329 ++++++++------- .../Core/FemtoUniverseParticleHisto.h | 140 +++--- .../Core/FemtoUniversePhiSelection.h | 273 ++++++------ .../Core/FemtoUniverseSHContainer.h | 152 ++++--- .../Core/FemtoUniverseSelection.h | 28 +- .../Core/FemtoUniverseSpherHarMath.h | 73 ++-- .../Core/FemtoUniverseTrackSelection.h | 140 +++--- .../Core/FemtoUniverseV0Selection.h | 258 ++++++------ .../Core/{FemtoUtils.h => femtoUtils.h} | 38 +- PWGCF/FemtoUniverse/DataModel/FemtoDerived.h | 14 +- .../femtoUniverseProducerMCTruthTask.cxx | 4 +- .../femtoUniverseProducerReducedTask.cxx | 66 +-- .../femtoUniverseProducerTask.cxx | 293 ++++++------- .../femtoUniverseProducerTaskV0Only.cxx | 150 +++---- .../Tasks/femtoUniverseCutCulator.cxx | 6 +- .../Tasks/femtoUniverseDebugTrack.cxx | 4 +- .../Tasks/femtoUniverseDebugV0.cxx | 4 +- .../Tasks/femtoUniverseEfficiencyBase.cxx | 2 +- .../Tasks/femtoUniverseEfficiencyTask.cxx | 4 +- .../Tasks/femtoUniverseHashTask.cxx | 21 +- ...toUniversePairTaskTrackCascadeExtended.cxx | 8 +- .../Tasks/femtoUniversePairTaskTrackD0.cxx | 17 +- .../femtoUniversePairTaskTrackNucleus.cxx | 40 +- .../Tasks/femtoUniversePairTaskTrackPhi.cxx | 14 +- .../Tasks/femtoUniversePairTaskTrackTrack.cxx | 263 ++++++------ ...ersePairTaskTrackTrack3DMultKtExtended.cxx | 56 +-- ...emtoUniversePairTaskTrackTrackExtended.cxx | 398 +++++++++--------- .../femtoUniversePairTaskTrackTrackMC.cxx | 34 +- ...femtoUniversePairTaskTrackTrackMcTruth.cxx | 8 +- ...iversePairTaskTrackTrackMultKtExtended.cxx | 34 +- ...irTaskTrackTrackSpherHarMultKtExtended.cxx | 68 +-- .../femtoUniversePairTaskTrackV0Extended.cxx | 20 +- 46 files changed, 2288 insertions(+), 2364 deletions(-) rename PWGCF/FemtoUniverse/Core/{FemtoUtils.h => femtoUtils.h} (80%) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverse3DContainer.h b/PWGCF/FemtoUniverse/Core/FemtoUniverse3DContainer.h index c08c131ab99..9d5eee9d2f5 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverse3DContainer.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverse3DContainer.h @@ -29,10 +29,10 @@ using namespace o2::framework; -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { -namespace femtoUniverse3DContainer +namespace femto_universe3d_container { /// Femtoscopic observable to be computed enum Observable { kstar ///< kstar @@ -42,7 +42,7 @@ enum Observable { kstar ///< kstar enum EventType { same, ///< Pair from same event mixed ///< Pair from mixed event }; -}; // namespace femtoUniverse3DContainer +}; // namespace femto_universe3d_container /// \class FemtoUniverse3DContainer /// \brief Container for all histogramming related to the correlation function. The two @@ -50,7 +50,7 @@ enum EventType { same, ///< Pair from same event /// are filled according to the specified observable /// \tparam eventType Type of the event (same/mixed) /// \tparam obs Observable to be computed (k*/Q_inv/...) -template +template class FemtoUniverse3DContainer { public: @@ -75,7 +75,7 @@ class FemtoUniverse3DContainer /// \param use3dplots Flag to fill 3D plots /// \param isiden Identical or non-identical particle pair template - void init_base(std::string folderName, std::string femtoObs1D, std::string femtoObsKout, std::string femtoObsKside, std::string femtoObsKlong, T femtoObsAxis1D, T femtoObsAxisOut, T femtoObsAxisSide, T femtoObsAxisLong, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, bool use3dplots, bool isiden) + void initBase(std::string folderName, std::string femtoObs1D, std::string femtoObsKout, std::string femtoObsKside, std::string femtoObsKlong, T femtoObsAxis1D, T femtoObsAxisOut, T femtoObsAxisSide, T femtoObsAxisLong, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, bool use3dplots, bool isiden) { mHistogramRegistry->add((folderName + "/relPairMom3D").c_str(), ("; " + femtoObsKout + "; " + femtoObsKside + "; " + femtoObsKlong).c_str(), kTH3F, {femtoObsAxisOut, femtoObsAxisSide, femtoObsAxisLong}); mHistogramRegistry->add((folderName + "/relPairMomOut").c_str(), ("; " + femtoObsKout + "; Entries").c_str(), kTH1F, {femtoObsAxisOut}); @@ -105,7 +105,7 @@ class FemtoUniverse3DContainer } /// Templated function to initialize the histograms for the task - /// Always calls init_base to initialize the histograms for data/ Monte Carlo reconstructed + /// Always calls initBase to initialize the histograms for data/ Monte Carlo reconstructed /// \tparam T type of the configurable for the axis configuration /// \param registry Histogram registry to be passed /// \param kstarBins k* binning for the histograms @@ -145,9 +145,9 @@ class FemtoUniverse3DContainer framework::AxisSpec multAxis3D = {multBins3D, "Multiplicity"}; framework::AxisSpec mTAxis3D = {mTBins3D, "#it{m}_{T} (GeV/#it{c})"}; - std::string folderName = static_cast(mFolderSuffix[mEventType]) + static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kRecon]); + std::string folderName = static_cast(FolderSuffix[EventType]) + static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]); - init_base(folderName, femtoObs1D, femtoObsKout, femtoObsKside, femtoObsKlong, femtoObsAxis1D, femtoObsAxisOut, femtoObsAxisSide, femtoObsAxisLong, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, use3dplots, isiden); + initBase(folderName, femtoObs1D, femtoObsKout, femtoObsKside, femtoObsKlong, femtoObsAxis1D, femtoObsAxisOut, femtoObsAxisSide, femtoObsAxisLong, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, use3dplots, isiden); } /// Set the PDG codes of the two particles involved @@ -167,44 +167,44 @@ class FemtoUniverse3DContainer /// \param part1 Particle one /// \param part2 Particle two /// \param mult Multiplicity of the event - template - void setPair_base(const float femtoObsKout, const float femtoObsKside, const float femtoObsKlong, const float femtoObs1D, const float kT, const float mT, T const& part1, T const& part2, const int mult, bool use3dplots, const float isiden) + template + void setPairBase(const float femtoObsKout, const float femtoObsKside, const float femtoObsKlong, const float femtoObs1D, const float kT, const float mT, T const& part1, T const& part2, const int mult, bool use3dplots, const float isiden) { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairMomOut"), femtoObsKout); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairMomSide"), femtoObsKside); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairMomLong"), femtoObsKlong); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairMom3D"), femtoObsKout, femtoObsKside, femtoObsKlong); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/MultPtPart1"), part1.pt(), mult); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/MultPtPart2"), part2.pt(), mult); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/PtPart1PtPart2"), part1.pt(), part2.pt()); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairMomOut"), femtoObsKout); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairMomSide"), femtoObsKside); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairMomLong"), femtoObsKlong); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairMom3D"), femtoObsKout, femtoObsKside, femtoObsKlong); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/MultPtPart1"), part1.pt(), mult); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/MultPtPart2"), part2.pt(), mult); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/PtPart1PtPart2"), part1.pt(), part2.pt()); if (isiden) { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairMom1D"), (2.0 * femtoObs1D)); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkT"), kT); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarkT"), (2.0 * femtoObs1D), kT); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarmT"), (2.0 * femtoObs1D), mT); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarMult"), (2.0 * femtoObs1D), mult); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/kstarPtPart1"), (2.0 * femtoObs1D), part1.pt()); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/kstarPtPart2"), (2.0 * femtoObs1D), part2.pt()); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairMom1D"), (2.0 * femtoObs1D)); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkT"), kT); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarkT"), (2.0 * femtoObs1D), kT); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarmT"), (2.0 * femtoObs1D), mT); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarMult"), (2.0 * femtoObs1D), mult); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/kstarPtPart1"), (2.0 * femtoObs1D), part1.pt()); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/kstarPtPart2"), (2.0 * femtoObs1D), part2.pt()); if (use3dplots) { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarmTMult"), (2.0 * femtoObs1D), mT, mult); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarmTMult"), (2.0 * femtoObs1D), mT, mult); } } else { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairMom1D"), femtoObs1D); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkT"), kT); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarkT"), femtoObs1D, kT); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarmT"), femtoObs1D, mT); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarMult"), femtoObs1D, mult); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/kstarPtPart1"), femtoObs1D, part1.pt()); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/kstarPtPart2"), femtoObs1D, part2.pt()); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairMom1D"), femtoObs1D); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkT"), kT); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarkT"), femtoObs1D, kT); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarmT"), femtoObs1D, mT); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarMult"), femtoObs1D, mult); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/kstarPtPart1"), femtoObs1D, part1.pt()); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/kstarPtPart2"), femtoObs1D, part2.pt()); if (use3dplots) { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarmTMult"), femtoObs1D, mT, mult); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarmTMult"), femtoObs1D, mT, mult); } } } /// Templated function to compute the necessary observables and fill the respective histograms - /// Always calls setPair_base to compute the observables with reconstructed data + /// Always calls setPairBase to compute the observables with reconstructed data /// \tparam T type of the femtouniverseparticle /// \param part1 Particle one /// \param part2 Particle two @@ -227,37 +227,37 @@ class FemtoUniverse3DContainer const float femtoObsKlong = f3d[3]; if (mHistogramRegistry) { - setPair_base(femtoObsKout, femtoObsKside, femtoObsKlong, femtoObs1D, kT, mT, part1, part2, mult, use3dplots, isiden); + setPairBase(femtoObsKout, femtoObsKside, femtoObsKlong, femtoObs1D, kT, mT, part1, part2, mult, use3dplots, isiden); if (!isiden) { if (femtoObsKout > 0.0) { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kRecon]) + HIST("/KStarOutP"), femtoObs1D); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/KStarOutP"), femtoObs1D); } else { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kRecon]) + HIST("/KStarOutN"), femtoObs1D); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/KStarOutN"), femtoObs1D); } if (femtoObsKside > 0.0) { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kRecon]) + HIST("/KStarSideP"), femtoObs1D); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/KStarSideP"), femtoObs1D); } else { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kRecon]) + HIST("/KStarSideN"), femtoObs1D); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/KStarSideN"), femtoObs1D); } if (femtoObsKlong > 0.0) { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kRecon]) + HIST("/KStarLongP"), femtoObs1D); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/KStarLongP"), femtoObs1D); } else { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kRecon]) + HIST("/KStarLongN"), femtoObs1D); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]) + HIST("/KStarLongN"), femtoObs1D); } } } } protected: - HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output - static constexpr std::string_view mFolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to mEventType - static constexpr int mEventType = eventType; ///< Type of the event (same/mixed, according to femtoUniverse3DContainer::EventType) - float mMassOne = 0.f; ///< PDG mass of particle 1 - float mMassTwo = 0.f; ///< PDG mass of particle 2 - int mPDGOne = 0; ///< PDG code of particle 1 - int mPDGTwo = 0; ///< PDG code of particle 2 + HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output + static constexpr std::string_view FolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to EventType + static constexpr int EventType = eventType; ///< Type of the event (same/mixed, according to femto_universe3d_container::EventType) + float mMassOne = 0.f; ///< PDG mass of particle 1 + float mMassTwo = 0.f; ///< PDG mass of particle 2 + int mPDGOne = 0; ///< PDG code of particle 1 + int mPDGTwo = 0; ///< PDG code of particle 2 }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSE3DCONTAINER_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h index 2f29f3df474..3ea392eebe7 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h @@ -25,6 +25,7 @@ #include #include "Framework/HistogramRegistry.h" +#include "Common/Core/RecoDecay.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h" #include "Math/Vector4D.h" @@ -33,10 +34,10 @@ using namespace o2::framework; -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { -namespace femtoUniverseAngularContainer +namespace femto_universe_angular_container { /// Femtoscopic observable to be computed enum Observable { kstar ///< kstar @@ -46,7 +47,7 @@ enum Observable { kstar ///< kstar enum EventType { same, ///< Pair from same event mixed ///< Pair from mixed event }; -}; // namespace femtoUniverseAngularContainer +}; // namespace femto_universe_angular_container /// \class FemtoUniverseAngularContainer /// \brief Container for all histogramming related to the correlation function. The two @@ -54,7 +55,7 @@ enum EventType { same, ///< Pair from same event /// are filled according to the specified observable /// \tparam eventType Type of the event (same/mixed) /// \tparam obs Observable to be computed (k*/Q_inv/...) -template +template class FemtoUniverseAngularContainer { public: @@ -71,7 +72,7 @@ class FemtoUniverseAngularContainer /// \param kTAxis axis object for the kT axis /// \param mTAxis axis object for the mT axis template - void init_base(std::string folderName, std::string /*femtoObs*/, T /*femtoObsAxis*/, T /*multAxis*/, T /*kTAxis*/, T /*mTAxis*/, T /*multAxis3D*/, T /*mTAxis3D*/, T etaAxis, T phiAxis, bool use3dplots) + void initBase(std::string folderName, std::string /*femtoObs*/, T /*femtoObsAxis*/, T /*multAxis*/, T /*kTAxis*/, T /*mTAxis*/, T /*multAxis3D*/, T /*mTAxis3D*/, T etaAxis, T phiAxis, bool use3dplots) { mHistogramRegistry->add((folderName + "/DeltaEtaDeltaPhi").c_str(), "; #Delta#varphi (rad); #Delta#eta", kTH2F, {phiAxis, etaAxis}); if (use3dplots) { @@ -85,13 +86,13 @@ class FemtoUniverseAngularContainer /// \param folderName Name of the directory in the output file (no suffix for reconstructed data/ Monte Carlo; "_MC" for Monte Carlo Truth) /// \param femtoObsAxis axis object for the femto observable axis template - void init_MC(std::string /*folderName*/, std::string /*femtoObs*/, T /*femtoObsAxis*/, T /*multAxis*/, T /*mTAxis*/) + void initMC(std::string /*folderName*/, std::string /*femtoObs*/, T /*femtoObsAxis*/, T /*multAxis*/, T /*mTAxis*/) { } /// Templated function to initialize the histograms for the task - /// Always calls init_base to initialize the histograms for data/ Monte Carlo reconstructed - /// In case of Monte Carlo, calls init_base again for Monte Carlo truth and the specialized function init_MC for additional histogramms + /// Always calls initBase to initialize the histograms for data/ Monte Carlo reconstructed + /// In case of Monte Carlo, calls initBase again for Monte Carlo truth and the specialized function initMC for additional histogramms /// \tparam T type of the configurable for the axis configuration /// \param registry Histogram registry to be passed /// \param kstarBins k* binning for the histograms @@ -106,7 +107,7 @@ class FemtoUniverseAngularContainer { mHistogramRegistry = registry; std::string femtoObs; - if constexpr (mFemtoObs == femtoUniverseAngularContainer::Observable::kstar) { + if constexpr (FemtoObs == femto_universe_angular_container::Observable::kstar) { femtoObs = "#it{k*} (GeV/#it{c})"; } @@ -120,18 +121,18 @@ class FemtoUniverseAngularContainer framework::AxisSpec mTAxis3D = {mTBins3D, "#it{m}_{T} (GeV/#it{c})"}; // angular correlations - mPhiLow = (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; - mPhiHigh = 2 * o2::constants::math::PI + (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; + mPhiLow = (-static_cast(phiBins / 4) + 0.5) * o2::constants::math::TwoPI / phiBins; + mPhiHigh = o2::constants::math::TwoPI + (-static_cast(phiBins / 4) + 0.5) * o2::constants::math::TwoPI / phiBins; framework::AxisSpec phiAxis = {phiBins, mPhiLow, mPhiHigh}; framework::AxisSpec etaAxis = {etaBins, -2.0, 2.0}; - std::string folderName = static_cast(mFolderSuffix[mEventType]) + static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kRecon]); + std::string folderName = static_cast(FolderSuffix[EventType]) + static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]); - init_base(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, etaAxis, phiAxis, use3dplots); + initBase(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, etaAxis, phiAxis, use3dplots); if (isMC) { - folderName = static_cast(mFolderSuffix[mEventType]) + static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]); - init_base(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, etaAxis, phiAxis, use3dplots); - init_MC(folderName, femtoObs, femtoObsAxis, multAxis, mTAxis); + folderName = static_cast(FolderSuffix[EventType]) + static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]); + initBase(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, etaAxis, phiAxis, use3dplots); + initMC(folderName, femtoObs, femtoObsAxis, multAxis, mTAxis); } } @@ -152,20 +153,15 @@ class FemtoUniverseAngularContainer /// \param part1 Particle one /// \param part2 Particle two /// \param mult Multiplicity of the event - template - void setPair_base(const float /*femtoObs*/, const float /*mT*/, T const& part1, T const& part2, const int /*mult*/, bool use3dplots, float weight = 1.0f) + template + void setPairBase(const float /*femtoObs*/, const float /*mT*/, T const& part1, T const& part2, const int /*mult*/, bool use3dplots, float weight = 1.0f) { - delta_eta = part1.eta() - part2.eta(); - delta_phi = part1.phi() - part2.phi(); + deltaEta = part1.eta() - part2.eta(); - while (delta_phi < mPhiLow) { - delta_phi += o2::constants::math::TwoPI; - } - while (delta_phi > mPhiHigh) { - delta_phi -= o2::constants::math::TwoPI; - } + deltaPhi = part1.phi() - part2.phi(); + deltaPhi = RecoDecay::constrainAngle(deltaPhi, 0); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/DeltaEtaDeltaPhi"), delta_phi, delta_eta, weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/DeltaEtaDeltaPhi"), deltaPhi, deltaEta, weight); if (use3dplots) { // use 3d plots } @@ -175,11 +171,11 @@ class FemtoUniverseAngularContainer /// Fills MC truth specific histogramms: /// - kstar distribution plots with RECONSTRUCTED information but ONLY for non-fake candidates; needed for purity calculations of tracks /// - kstar resolution matrix - /// Note: Standard histogramms with MC truth information are filled with the setPair_base function + /// Note: Standard histogramms with MC truth information are filled with the setPairBase function /// \param part1 Particle one /// \param part2 Particle two /// \param mult Multiplicity of the event - void setPair_MC(const float /*femtoObsMC*/, const float /*femtoObs*/, const float /*mT*/, const int /*mult*/) + void setPairMC(const float /*femtoObsMC*/, const float /*femtoObs*/, const float /*mT*/, const int /*mult*/) { if (mHistogramRegistry) { // Fill the kstar distributions with the reconstructed information but only for particles with the right PDG code @@ -187,8 +183,8 @@ class FemtoUniverseAngularContainer } /// Templated function to handle data/ Monte Carlo reconstructed and Monte Carlo truth - /// Always calls setPair_base to compute the observables with reconstructed data - /// In case of Monte Carlo, calls setPair_base with MC info and specialized function setPair_MC for additional histogramms + /// Always calls setPairBase to compute the observables with reconstructed data + /// In case of Monte Carlo, calls setPairBase with MC info and specialized function setPairMC for additional histogramms /// \tparam T type of the femtouniverseparticle /// \param part1 Particle one /// \param part2 Particle two @@ -198,25 +194,25 @@ class FemtoUniverseAngularContainer { float femtoObs, femtoObsMC; // Calculate femto observable and the mT with reconstructed information - if constexpr (mFemtoObs == femtoUniverseAngularContainer::Observable::kstar) { + if constexpr (FemtoObs == femto_universe_angular_container::Observable::kstar) { femtoObs = FemtoUniverseMath::getkstar(part1, mMassOne, part2, mMassTwo); } const float mT = FemtoUniverseMath::getmT(part1, mMassOne, part2, mMassTwo); if (mHistogramRegistry) { - setPair_base(femtoObs, mT, part1, part2, mult, use3dplots); + setPairBase(femtoObs, mT, part1, part2, mult, use3dplots); if constexpr (isMC) { if (part1.has_fdMCParticle() && part2.has_fdMCParticle()) { // calculate the femto observable and the mT with MC truth information - if constexpr (mFemtoObs == femtoUniverseAngularContainer::Observable::kstar) { + if constexpr (FemtoObs == femto_universe_angular_container::Observable::kstar) { femtoObsMC = FemtoUniverseMath::getkstar(part1.fdMCParticle(), mMassOne, part2.fdMCParticle(), mMassTwo); } const float mTMC = FemtoUniverseMath::getmT(part1.fdMCParticle(), mMassOne, part2.fdMCParticle(), mMassTwo); - if (abs(part1.fdMCParticle().pdgMCTruth()) == abs(mPDGOne) && abs(part2.fdMCParticle().pdgMCTruth()) == abs(mPDGTwo)) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates - setPair_base(femtoObsMC, mTMC, part1.fdMCParticle(), part2.fdMCParticle(), mult, use3dplots, weight); - setPair_MC(femtoObsMC, femtoObs, mT, mult); + if (std::abs(part1.fdMCParticle().pdgMCTruth()) == std::abs(mPDGOne) && std::abs(part2.fdMCParticle().pdgMCTruth()) == std::abs(mPDGTwo)) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates + setPairBase(femtoObsMC, mTMC, part1.fdMCParticle(), part2.fdMCParticle(), mult, use3dplots, weight); + setPairMC(femtoObsMC, femtoObs, mT, mult); } else { } @@ -227,20 +223,20 @@ class FemtoUniverseAngularContainer } protected: - HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output - static constexpr std::string_view mFolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to mEventType - static constexpr femtoUniverseAngularContainer::Observable mFemtoObs = obs; ///< Femtoscopic observable to be computed (according to femtoUniverseAngularContainer::Observable) - static constexpr int mEventType = eventType; ///< Type of the event (same/mixed, according to femtoUniverseAngularContainer::EventType) - float mMassOne = 0.f; ///< PDG mass of particle 1 - float mMassTwo = 0.f; ///< PDG mass of particle 2 - int mPDGOne = 0; ///< PDG code of particle 1 - int mPDGTwo = 0; ///< PDG code of particle 2 + HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output + static constexpr std::string_view FolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to EventType + static constexpr femto_universe_angular_container::Observable FemtoObs = obs; ///< Femtoscopic observable to be computed (according to femto_universe_angular_container::Observable) + static constexpr int EventType = eventType; ///< Type of the event (same/mixed, according to femto_universe_angular_container::EventType) + float mMassOne = 0.f; ///< PDG mass of particle 1 + float mMassTwo = 0.f; ///< PDG mass of particle 2 + int mPDGOne = 0; ///< PDG code of particle 1 + int mPDGTwo = 0; ///< PDG code of particle 2 double mPhiLow; double mPhiHigh; - double delta_eta; - double delta_phi; + double deltaEta; + double deltaPhi; }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEANGULARCONTAINER_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h index 972305765c5..38209e8bc8f 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h @@ -10,7 +10,7 @@ // or submit itself to any jurisdiction. /// \file FemtoUniverseCascadeSelection.h -/// \brief Definition of the femtoUniverseCascadeSelection +/// \brief Definition of the femto_universe_cascade_selection /// \author Valentina Mantovani Sarti, TU München valentina.mantovani-sarti@tum.de /// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de /// \author Luca Barioglio, TU München, luca.barioglio@cern.ch @@ -32,9 +32,9 @@ #include "Framework/HistogramRegistry.h" #include "ReconstructionDataFormats/PID.h" -namespace o2::analysis::femtoUniverse // o2-linter: disable=name/namespace +namespace o2::analysis::femto_universe // o2-linter: disable=name/namespace { -namespace femtoUniverseCascadeSelection // o2-linter: disable=name/namespace +namespace femto_universe_cascade_selection // o2-linter: disable=name/namespace { /// The different selections this task is capable of doing enum CascadeSel { @@ -72,12 +72,12 @@ enum ChildTrackType { kPosTrack, kNegPID, }; /// Position in the full VO cut container (for cutculator) */ -} // namespace femtoUniverseCascadeSelection +} // namespace femto_universe_cascade_selection /// \class FemtoUniverseCascadeSelection /// \brief Cut class to contain and execute all cuts applied to Cascades class FemtoUniverseCascadeSelection - : public FemtoUniverseObjectSelection + : public FemtoUniverseObjectSelection { // do cutculatora @@ -101,27 +101,27 @@ class FemtoUniverseCascadeSelection void fillQA(Col const& col, Casc const& cascade, Track const& posTrack, Track const& negTrack, Track const& bachTrack); template - void setChildCuts(femtoUniverseCascadeSelection::ChildTrackType child, T1 selVal, - T2 selVar, femtoUniverseSelection::SelectionType selType) + void setChildCuts(femto_universe_cascade_selection::ChildTrackType child, T1 selVal, + T2 selVar, femto_universe_selection::SelectionType selType) { - if (child == femtoUniverseCascadeSelection::kPosTrack) { + if (child == femto_universe_cascade_selection::kPosTrack) { posDaughTrack.setSelection(selVal, selVar, selType); - } else if (child == femtoUniverseCascadeSelection::kNegTrack) { + } else if (child == femto_universe_cascade_selection::kNegTrack) { negDaughTrack.setSelection(selVal, selVar, selType); - } else if (child == femtoUniverseCascadeSelection::kBachTrack) { + } else if (child == femto_universe_cascade_selection::kBachTrack) { bachTrackSel.setSelection(selVal, selVar, selType); } } template - void setChildPIDSpecies(femtoUniverseCascadeSelection::ChildTrackType child, + void setChildPIDSpecies(femto_universe_cascade_selection::ChildTrackType child, T& pids) { - if (child == femtoUniverseCascadeSelection::kPosTrack) { + if (child == femto_universe_cascade_selection::kPosTrack) { posDaughTrack.setPIDSpecies(pids); - } else if (child == femtoUniverseCascadeSelection::kNegTrack) { + } else if (child == femto_universe_cascade_selection::kNegTrack) { negDaughTrack.setPIDSpecies(pids); - } else if (child == femtoUniverseCascadeSelection::kBachTrack) { + } else if (child == femto_universe_cascade_selection::kBachTrack) { bachTrackSel.setPIDSpecies(pids); } } @@ -130,7 +130,7 @@ class FemtoUniverseCascadeSelection /// \param iSel Track selection variable to be examined /// \param prefix Additional prefix for the name of the configurable /// \param suffix Additional suffix for the name of the configurable - static std::string getSelectionName(femtoUniverseCascadeSelection::CascadeSel iSel, + static std::string getSelectionName(femto_universe_cascade_selection::CascadeSel iSel, std::string_view prefix = "", std::string_view suffix = "") { @@ -144,7 +144,7 @@ class FemtoUniverseCascadeSelection /// for consistent description of the configurables /// \param iSel Track selection variable to be examined /// \param prefix Additional prefix for the output of the configurable - static std::string getSelectionHelper(femtoUniverseCascadeSelection::CascadeSel iSel, + static std::string getSelectionHelper(femto_universe_cascade_selection::CascadeSel iSel, std::string_view prefix = "") { std::string outString = static_cast(prefix); @@ -235,28 +235,28 @@ class FemtoUniverseCascadeSelection "kV0MassMin", "V0MassMax"}; ///< Name of the different ///< selections - static constexpr femtoUniverseSelection::SelectionType + static constexpr femto_universe_selection::SelectionType mSelectionTypes[kNcascadeSelection]{ - femtoUniverseSelection::kEqual, // sign - femtoUniverseSelection::kLowerLimit, // pt min - femtoUniverseSelection::kUpperLimit, // pt max - femtoUniverseSelection::kUpperLimit, // eta max - femtoUniverseSelection::kUpperLimit, // DCA v0 daughters max - femtoUniverseSelection::kLowerLimit, // v0 cos PA min - femtoUniverseSelection::kLowerLimit, // v0 tran rad min - femtoUniverseSelection::kUpperLimit, // v0 tran rad max - femtoUniverseSelection::kUpperLimit, // v0 maximum distance of decay vertex to PV - femtoUniverseSelection::kUpperLimit, // DCA cascade daughters max - femtoUniverseSelection::kLowerLimit, // cascade cos PA min - femtoUniverseSelection::kLowerLimit, // cascade tran rad min - femtoUniverseSelection::kUpperLimit, // cascade tran rad max - femtoUniverseSelection::kUpperLimit, // cascade maximum distance of decay vertex to PV - femtoUniverseSelection::kLowerLimit, // DCA pos to PV max - femtoUniverseSelection::kLowerLimit, // DCA neg to PV max - femtoUniverseSelection::kLowerLimit, // DCA bach to PV max - femtoUniverseSelection::kLowerLimit, // DCA v0 to PV max - femtoUniverseSelection::kLowerLimit, // v0 mass min - femtoUniverseSelection::kUpperLimit, // v0 mass max + femto_universe_selection::kEqual, // sign + femto_universe_selection::kLowerLimit, // pt min + femto_universe_selection::kUpperLimit, // pt max + femto_universe_selection::kUpperLimit, // eta max + femto_universe_selection::kUpperLimit, // DCA v0 daughters max + femto_universe_selection::kLowerLimit, // v0 cos PA min + femto_universe_selection::kLowerLimit, // v0 tran rad min + femto_universe_selection::kUpperLimit, // v0 tran rad max + femto_universe_selection::kUpperLimit, // v0 maximum distance of decay vertex to PV + femto_universe_selection::kUpperLimit, // DCA cascade daughters max + femto_universe_selection::kLowerLimit, // cascade cos PA min + femto_universe_selection::kLowerLimit, // cascade tran rad min + femto_universe_selection::kUpperLimit, // cascade tran rad max + femto_universe_selection::kUpperLimit, // cascade maximum distance of decay vertex to PV + femto_universe_selection::kLowerLimit, // DCA pos to PV max + femto_universe_selection::kLowerLimit, // DCA neg to PV max + femto_universe_selection::kLowerLimit, // DCA bach to PV max + femto_universe_selection::kLowerLimit, // DCA v0 to PV max + femto_universe_selection::kLowerLimit, // v0 mass min + femto_universe_selection::kUpperLimit, // v0 mass max }; ///< Map to match a variable with ///< its type @@ -283,7 +283,7 @@ class FemtoUniverseCascadeSelection "Maximum V0 mass"}; ///< Helper information for the ///< different selections -}; // namespace femtoUniverse +}; // namespace femto_universe template void FemtoUniverseCascadeSelection::init(HistogramRegistry* registry, bool isSelectCascOmega) @@ -351,63 +351,63 @@ void FemtoUniverseCascadeSelection::init(HistogramRegistry* registry, bool isSel /// check whether the most open cuts are fulfilled - most of this should have /// already be done by the filters - nPtCascadeMinSel = getNSelections(femtoUniverseCascadeSelection::kCascadepTMin); - nPtCascadeMaxSel = getNSelections(femtoUniverseCascadeSelection::kCascadepTMax); - nEtaCascadeMaxSel = getNSelections(femtoUniverseCascadeSelection::kCascadeetaMax); - nDCAV0DaughMax = getNSelections(femtoUniverseCascadeSelection::kCascadeV0DCADaughMax); - nCPAV0Min = getNSelections(femtoUniverseCascadeSelection::kCascadeV0CPAMin); - nTranRadV0Min = getNSelections(femtoUniverseCascadeSelection::kCascadeV0TranRadMin); - nTranRadV0Max = getNSelections(femtoUniverseCascadeSelection::kCascadeV0TranRadMax); - nV0DecVtxMax = getNSelections(femtoUniverseCascadeSelection::kCascadeV0DecVtxMax); - nDCACascadeDaughMax = getNSelections(femtoUniverseCascadeSelection::kCascadeDCADaughMax); - nCPACascadeMin = getNSelections(femtoUniverseCascadeSelection::kCascadeCPAMin); - nTranRadCascadeMin = getNSelections(femtoUniverseCascadeSelection::kCascadeTranRadMin); - nTranRadCascadeMax = getNSelections(femtoUniverseCascadeSelection::kCascadeTranRadMax); - nDecVtxMax = getNSelections(femtoUniverseCascadeSelection::kCascadeDecVtxMax); - nDCAPosToPV = getNSelections(femtoUniverseCascadeSelection::kCascadeDCAPosToPV); - nDCANegToPV = getNSelections(femtoUniverseCascadeSelection::kCascadeDCANegToPV); - nDCABachToPV = getNSelections(femtoUniverseCascadeSelection::kCascadeDCABachToPV); - nDCAV0ToPV = getNSelections(femtoUniverseCascadeSelection::kCascadeDCAV0ToPV); + nPtCascadeMinSel = getNSelections(femto_universe_cascade_selection::kCascadepTMin); + nPtCascadeMaxSel = getNSelections(femto_universe_cascade_selection::kCascadepTMax); + nEtaCascadeMaxSel = getNSelections(femto_universe_cascade_selection::kCascadeetaMax); + nDCAV0DaughMax = getNSelections(femto_universe_cascade_selection::kCascadeV0DCADaughMax); + nCPAV0Min = getNSelections(femto_universe_cascade_selection::kCascadeV0CPAMin); + nTranRadV0Min = getNSelections(femto_universe_cascade_selection::kCascadeV0TranRadMin); + nTranRadV0Max = getNSelections(femto_universe_cascade_selection::kCascadeV0TranRadMax); + nV0DecVtxMax = getNSelections(femto_universe_cascade_selection::kCascadeV0DecVtxMax); + nDCACascadeDaughMax = getNSelections(femto_universe_cascade_selection::kCascadeDCADaughMax); + nCPACascadeMin = getNSelections(femto_universe_cascade_selection::kCascadeCPAMin); + nTranRadCascadeMin = getNSelections(femto_universe_cascade_selection::kCascadeTranRadMin); + nTranRadCascadeMax = getNSelections(femto_universe_cascade_selection::kCascadeTranRadMax); + nDecVtxMax = getNSelections(femto_universe_cascade_selection::kCascadeDecVtxMax); + nDCAPosToPV = getNSelections(femto_universe_cascade_selection::kCascadeDCAPosToPV); + nDCANegToPV = getNSelections(femto_universe_cascade_selection::kCascadeDCANegToPV); + nDCABachToPV = getNSelections(femto_universe_cascade_selection::kCascadeDCABachToPV); + nDCAV0ToPV = getNSelections(femto_universe_cascade_selection::kCascadeDCAV0ToPV); // dodac V0 mass min i max - pTCascadeMin = getMinimalSelection(femtoUniverseCascadeSelection::kCascadepTMin, - femtoUniverseSelection::kLowerLimit); - pTCascadeMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadepTMax, - femtoUniverseSelection::kUpperLimit); - etaCascadeMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeetaMax, - femtoUniverseSelection::kAbsUpperLimit); - fDCAV0DaughMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0DCADaughMax, - femtoUniverseSelection::kUpperLimit); - fCPAV0Min = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0CPAMin, - femtoUniverseSelection::kLowerLimit); - fTranRadV0Min = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0TranRadMin, - femtoUniverseSelection::kLowerLimit); - fTranRadV0Max = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0TranRadMax, - femtoUniverseSelection::kUpperLimit); - fV0DecVtxMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0DecVtxMax, - femtoUniverseSelection::kAbsUpperLimit); - fDCACascadeDaughMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCADaughMax, - femtoUniverseSelection::kUpperLimit); - fCPACascadeMin = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeCPAMin, - femtoUniverseSelection::kLowerLimit); - fTranRadCascadeMin = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeTranRadMin, - femtoUniverseSelection::kLowerLimit); - fTranRadCascadeMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeTranRadMax, - femtoUniverseSelection::kUpperLimit); - fDecVtxMax = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDecVtxMax, - femtoUniverseSelection::kAbsUpperLimit); - fDCAPosToPV = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCAPosToPV, - femtoUniverseSelection::kLowerLimit); - fDCANegToPV = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCANegToPV, - femtoUniverseSelection::kLowerLimit); - fDCABachToPV = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCABachToPV, - femtoUniverseSelection::kLowerLimit); - fDCAV0ToPV = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeDCAV0ToPV, - femtoUniverseSelection::kLowerLimit); - fV0InvMassLowLimit = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0MassMin, - femtoUniverseSelection::kLowerLimit); - fV0InvMassUpLimit = getMinimalSelection(femtoUniverseCascadeSelection::kCascadeV0MassMax, - femtoUniverseSelection::kUpperLimit); + pTCascadeMin = getMinimalSelection(femto_universe_cascade_selection::kCascadepTMin, + femto_universe_selection::kLowerLimit); + pTCascadeMax = getMinimalSelection(femto_universe_cascade_selection::kCascadepTMax, + femto_universe_selection::kUpperLimit); + etaCascadeMax = getMinimalSelection(femto_universe_cascade_selection::kCascadeetaMax, + femto_universe_selection::kAbsUpperLimit); + fDCAV0DaughMax = getMinimalSelection(femto_universe_cascade_selection::kCascadeV0DCADaughMax, + femto_universe_selection::kUpperLimit); + fCPAV0Min = getMinimalSelection(femto_universe_cascade_selection::kCascadeV0CPAMin, + femto_universe_selection::kLowerLimit); + fTranRadV0Min = getMinimalSelection(femto_universe_cascade_selection::kCascadeV0TranRadMin, + femto_universe_selection::kLowerLimit); + fTranRadV0Max = getMinimalSelection(femto_universe_cascade_selection::kCascadeV0TranRadMax, + femto_universe_selection::kUpperLimit); + fV0DecVtxMax = getMinimalSelection(femto_universe_cascade_selection::kCascadeV0DecVtxMax, + femto_universe_selection::kAbsUpperLimit); + fDCACascadeDaughMax = getMinimalSelection(femto_universe_cascade_selection::kCascadeDCADaughMax, + femto_universe_selection::kUpperLimit); + fCPACascadeMin = getMinimalSelection(femto_universe_cascade_selection::kCascadeCPAMin, + femto_universe_selection::kLowerLimit); + fTranRadCascadeMin = getMinimalSelection(femto_universe_cascade_selection::kCascadeTranRadMin, + femto_universe_selection::kLowerLimit); + fTranRadCascadeMax = getMinimalSelection(femto_universe_cascade_selection::kCascadeTranRadMax, + femto_universe_selection::kUpperLimit); + fDecVtxMax = getMinimalSelection(femto_universe_cascade_selection::kCascadeDecVtxMax, + femto_universe_selection::kAbsUpperLimit); + fDCAPosToPV = getMinimalSelection(femto_universe_cascade_selection::kCascadeDCAPosToPV, + femto_universe_selection::kLowerLimit); + fDCANegToPV = getMinimalSelection(femto_universe_cascade_selection::kCascadeDCANegToPV, + femto_universe_selection::kLowerLimit); + fDCABachToPV = getMinimalSelection(femto_universe_cascade_selection::kCascadeDCABachToPV, + femto_universe_selection::kLowerLimit); + fDCAV0ToPV = getMinimalSelection(femto_universe_cascade_selection::kCascadeDCAV0ToPV, + femto_universe_selection::kLowerLimit); + fV0InvMassLowLimit = getMinimalSelection(femto_universe_cascade_selection::kCascadeV0MassMin, + femto_universe_selection::kLowerLimit); + fV0InvMassUpLimit = getMinimalSelection(femto_universe_cascade_selection::kCascadeV0MassMax, + femto_universe_selection::kUpperLimit); isCascOmega = isSelectCascOmega; } @@ -581,6 +581,6 @@ void FemtoUniverseCascadeSelection::fillQA(Col const& /*col*/, Casc const& /*cas aod::femtouniverseparticle::TrackType::kBachelor>(bachTrack); } -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSECASCADESELECTION_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseCollisionSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseCollisionSelection.h index c75b09e8153..fc33b37ad9a 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseCollisionSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseCollisionSelection.h @@ -19,14 +19,13 @@ #define PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSECOLLISIONSELECTION_H_ #include -#include #include "Common/CCDB/TriggerAliases.h" #include "Framework/HistogramRegistry.h" #include "Framework/Logger.h" using namespace o2::framework; -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { /// \class FemtoUniverseCollisionSelection @@ -160,33 +159,33 @@ class FemtoUniverseCollisionSelection template float computeSphericity(T1 const& /*col*/, T2 const& tracks) { - double S00 = 0; - double S11 = 0; - double S10 = 0; + double kS00 = 0; + double kS11 = 0; + double kS10 = 0; double sumPt = 0; int partNumber = 0; double spher = 0; - for (auto& p : tracks) { + for (const auto& p : tracks) { double phi = p.phi(); double pT = p.pt(); - double px = pT * TMath::Cos(phi); - double py = pT * TMath::Sin(phi); + double px = pT * std::cos(phi); + double py = pT * std::sin(phi); - S00 = S00 + px * px / pT; - S11 = S11 + py * py / pT; - S10 = S10 + px * py / pT; + kS00 = kS00 + px * px / pT; + kS11 = kS11 + py * py / pT; + kS10 = kS10 + px * py / pT; sumPt = sumPt + pT; partNumber++; } if (sumPt != 0) { - S00 = S00 / sumPt; - S11 = S11 / sumPt; - S10 = S10 / sumPt; + kS00 = kS00 / sumPt; + kS11 = kS11 / sumPt; + kS10 = kS10 / sumPt; - double lambda1 = (S00 + S11 + TMath::Sqrt((S00 + S11) * (S00 + S11) - 4.0 * (S00 * S11 - S10 * S10))) / 2.0; - double lambda2 = (S00 + S11 - TMath::Sqrt((S00 + S11) * (S00 + S11) - 4.0 * (S00 * S11 - S10 * S10))) / 2.0; + double lambda1 = (kS00 + kS11 + std::sqrt((kS00 + kS11) * (kS00 + kS11) - 4.0 * (kS00 * kS11 - kS10 * kS10))) / 2.0; + double lambda2 = (kS00 + kS11 - std::sqrt((kS00 + kS11) * (kS00 + kS11) - 4.0 * (kS00 * kS11 - kS10 * kS10))) / 2.0; if ((lambda1 + lambda2) != 0 && partNumber > 2) { spher = 2 * lambda2 / (lambda1 + lambda2); @@ -215,6 +214,6 @@ class FemtoUniverseCollisionSelection float mCentMin = 0.0; ///< Minimum centrality value float mCentMax = 100.0; ///< Maximum centrality value }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSECOLLISIONSELECTION_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h index e3f9c0feee6..ceacc7fbf3e 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h @@ -25,6 +25,7 @@ #include #include "Framework/HistogramRegistry.h" +#include "Common/Core/RecoDecay.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h" #include "Math/Vector4D.h" @@ -33,10 +34,10 @@ using namespace o2::framework; -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { -namespace femtoUniverseContainer +namespace femto_universe_container { /// Femtoscopic observable to be computed enum Observable { kstar ///< kstar @@ -46,7 +47,7 @@ enum Observable { kstar ///< kstar enum EventType { same, ///< Pair from same event mixed ///< Pair from mixed event }; -}; // namespace femtoUniverseContainer +}; // namespace femto_universe_container /// \class FemtoUniverseContainer /// \brief Container for all histogramming related to the correlation function. The two @@ -54,7 +55,7 @@ enum EventType { same, ///< Pair from same event /// are filled according to the specified observable /// \tparam eventType Type of the event (same/mixed) /// \tparam obs Observable to be computed (k*/Q_inv/...) -template +template class FemtoUniverseContainer { public: @@ -71,7 +72,7 @@ class FemtoUniverseContainer /// \param kTAxis axis object for the kT axis /// \param mTAxis axis object for the mT axis template - void init_base(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, T etaAxis, T phiAxis, bool use3dplots) + void initBase(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, T etaAxis, T phiAxis, bool use3dplots) { mHistogramRegistry->add((folderName + "/relPairDist").c_str(), ("; " + femtoObs + "; Entries").c_str(), kTH1F, {femtoObsAxis}); mHistogramRegistry->add((folderName + "/relPairkT").c_str(), "; #it{k}_{T} (GeV/#it{c}); Entries", kTH1F, {kTAxis}); @@ -95,7 +96,7 @@ class FemtoUniverseContainer /// \param folderName Name of the directory in the output file (no suffix for reconstructed data/ Monte Carlo; "_MC" for Monte Carlo Truth) /// \param femtoObsAxis axis object for the femto observable axis template - void init_MC(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T mTAxis) + void initMC(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T mTAxis) { mHistogramRegistry->add((folderName + "/relPairDist_ReconNoFake").c_str(), ("; " + femtoObs + "; Entries").c_str(), kTH1F, {femtoObsAxis}); mHistogramRegistry->add((folderName + "/relPairkstarmT_ReconNoFake").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2})").c_str(), kTH2F, {femtoObsAxis, mTAxis}); @@ -106,8 +107,8 @@ class FemtoUniverseContainer } /// Templated function to initialize the histograms for the task - /// Always calls init_base to initialize the histograms for data/ Monte Carlo reconstructed - /// In case of Monte Carlo, calls init_base again for Monte Carlo truth and the specialized function init_MC for additional histogramms + /// Always calls initBase to initialize the histograms for data/ Monte Carlo reconstructed + /// In case of Monte Carlo, calls initBase again for Monte Carlo truth and the specialized function initMC for additional histogramms /// \tparam T type of the configurable for the axis configuration /// \param registry Histogram registry to be passed /// \param kstarBins k* binning for the histograms @@ -122,7 +123,7 @@ class FemtoUniverseContainer { mHistogramRegistry = registry; std::string femtoObs; - if constexpr (mFemtoObs == femtoUniverseContainer::Observable::kstar) { + if constexpr (FemtoObs == femto_universe_container::Observable::kstar) { femtoObs = "#it{k*} (GeV/#it{c})"; } std::vector tmpVecMult = multBins; @@ -135,18 +136,18 @@ class FemtoUniverseContainer framework::AxisSpec mTAxis3D = {mTBins3D, "#it{m}_{T} (GeV/#it{c})"}; // angular correlations - mPhiLow = (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; - mPhiHigh = 2 * o2::constants::math::PI + (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; + mPhiLow = (-static_cast(phiBins / 4) + 0.5) * o2::constants::math::TwoPI / phiBins; + mPhiHigh = o2::constants::math::TwoPI + (-static_cast(phiBins / 4) + 0.5) * o2::constants::math::TwoPI / phiBins; framework::AxisSpec phiAxis = {phiBins, mPhiLow, mPhiHigh}; framework::AxisSpec etaAxis = {etaBins, -2.0, 2.0}; - std::string folderName = static_cast(mFolderSuffix[mEventType]) + static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kRecon]); + std::string folderName = static_cast(FolderSuffix[EventType]) + static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]); - init_base(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, etaAxis, phiAxis, use3dplots); + initBase(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, etaAxis, phiAxis, use3dplots); if (isMC) { - folderName = static_cast(mFolderSuffix[mEventType]) + static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]); - init_base(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, etaAxis, phiAxis, use3dplots); - init_MC(folderName, femtoObs, femtoObsAxis, multAxis, mTAxis); + folderName = static_cast(FolderSuffix[EventType]) + static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]); + initBase(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, etaAxis, phiAxis, use3dplots); + initMC(folderName, femtoObs, femtoObsAxis, multAxis, mTAxis); } } @@ -167,33 +168,28 @@ class FemtoUniverseContainer /// \param part1 Particle one /// \param part2 Particle two /// \param mult Multiplicity of the event - template - void setPair_base(const float femtoObs, const float mT, T const& part1, T const& part2, const int mult, bool use3dplots, float weight = 1.0f) + template + void setPairBase(const float femtoObs, const float mT, T const& part1, T const& part2, const int mult, bool use3dplots, float weight = 1.0f) { const float kT = FemtoUniverseMath::getkT(part1, mMassOne, part2, mMassTwo); - delta_eta = part1.eta() - part2.eta(); - delta_phi = part1.phi() - part2.phi(); + deltaEta = part1.eta() - part2.eta(); + deltaPhi = part1.phi() - part2.phi(); - while (delta_phi < mPhiLow) { - delta_phi += o2::constants::math::TwoPI; - } - while (delta_phi > mPhiHigh) { - delta_phi -= o2::constants::math::TwoPI; - } + deltaPhi = RecoDecay::constrainAngle(deltaPhi, 0); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairDist"), femtoObs, weight); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkT"), kT, weight); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarkT"), femtoObs, kT, weight); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarmT"), femtoObs, mT, weight); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarMult"), femtoObs, mult, weight); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/kstarPtPart1"), femtoObs, part1.pt(), weight); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/kstarPtPart2"), femtoObs, part2.pt(), weight); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/MultPtPart1"), part1.pt(), mult, weight); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/MultPtPart2"), part2.pt(), mult, weight); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/PtPart1PtPart2"), part1.pt(), part2.pt(), weight); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/DeltaEtaDeltaPhi"), delta_phi, delta_eta, weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairDist"), femtoObs, weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkT"), kT, weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarkT"), femtoObs, kT, weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarmT"), femtoObs, mT, weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarMult"), femtoObs, mult, weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/kstarPtPart1"), femtoObs, part1.pt(), weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/kstarPtPart2"), femtoObs, part2.pt(), weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/MultPtPart1"), part1.pt(), mult, weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/MultPtPart2"), part2.pt(), mult, weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/PtPart1PtPart2"), part1.pt(), part2.pt(), weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/DeltaEtaDeltaPhi"), deltaPhi, deltaEta, weight); if (use3dplots) { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarmTMult"), femtoObs, mT, mult, weight); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarmTMult"), femtoObs, mT, mult, weight); } } @@ -201,25 +197,25 @@ class FemtoUniverseContainer /// Fills MC truth specific histogramms: /// - kstar distribution plots with RECONSTRUCTED information but ONLY for non-fake candidates; needed for purity calculations of tracks /// - kstar resolution matrix - /// Note: Standard histogramms with MC truth information are filled with the setPair_base function + /// Note: Standard histogramms with MC truth information are filled with the setPairBase function /// \param part1 Particle one /// \param part2 Particle two /// \param mult Multiplicity of the event - void setPair_MC(const float femtoObsMC, const float femtoObs, const float mT, const int mult) + void setPairMC(const float femtoObsMC, const float femtoObs, const float mT, const int mult) { if (mHistogramRegistry) { // Fill the kstar distributions with the reconstructed information but only for particles with the right PDG code - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]) + HIST("/relPairDist_ReconNoFake"), femtoObs); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]) + HIST("/relPairkstarmT_ReconNoFake"), femtoObs, mT); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]) + HIST("/relPairkstarMult_ReconNoFake"), femtoObs, mult); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]) + HIST("/relPairDist_ReconNoFake"), femtoObs); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]) + HIST("/relPairkstarmT_ReconNoFake"), femtoObs, mT); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]) + HIST("/relPairkstarMult_ReconNoFake"), femtoObs, mult); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]) + HIST("/kstar_resolution"), femtoObsMC, femtoObs); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]) + HIST("/kstar_resolution"), femtoObsMC, femtoObs); } } /// Templated function to handle data/ Monte Carlo reconstructed and Monte Carlo truth - /// Always calls setPair_base to compute the observables with reconstructed data - /// In case of Monte Carlo, calls setPair_base with MC info and specialized function setPair_MC for additional histogramms + /// Always calls setPairBase to compute the observables with reconstructed data + /// In case of Monte Carlo, calls setPairBase with MC info and specialized function setPairMC for additional histogramms /// \tparam T type of the femtouniverseparticle /// \param part1 Particle one /// \param part2 Particle two @@ -229,51 +225,51 @@ class FemtoUniverseContainer { float femtoObs, femtoObsMC; // Calculate femto observable and the mT with reconstructed information - if constexpr (mFemtoObs == femtoUniverseContainer::Observable::kstar) { + if constexpr (FemtoObs == femto_universe_container::Observable::kstar) { femtoObs = FemtoUniverseMath::getkstar(part1, mMassOne, part2, mMassTwo); } const float mT = FemtoUniverseMath::getmT(part1, mMassOne, part2, mMassTwo); if (mHistogramRegistry) { - setPair_base(femtoObs, mT, part1, part2, mult, use3dplots, weight); + setPairBase(femtoObs, mT, part1, part2, mult, use3dplots, weight); if constexpr (isMC) { if (part1.has_fdMCParticle() && part2.has_fdMCParticle()) { // calculate the femto observable and the mT with MC truth information - if constexpr (mFemtoObs == femtoUniverseContainer::Observable::kstar) { + if constexpr (FemtoObs == femto_universe_container::Observable::kstar) { femtoObsMC = FemtoUniverseMath::getkstar(part1.fdMCParticle(), mMassOne, part2.fdMCParticle(), mMassTwo); } const float mTMC = FemtoUniverseMath::getmT(part1.fdMCParticle(), mMassOne, part2.fdMCParticle(), mMassTwo); - if (abs(part1.fdMCParticle().pdgMCTruth()) == abs(mPDGOne) && abs(part2.fdMCParticle().pdgMCTruth()) == abs(mPDGTwo)) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates - setPair_base(femtoObsMC, mTMC, part1.fdMCParticle(), part2.fdMCParticle(), mult, use3dplots, weight); - setPair_MC(femtoObsMC, femtoObs, mT, mult); + if (std::abs(part1.fdMCParticle().pdgMCTruth()) == std::abs(mPDGOne) && std::abs(part2.fdMCParticle().pdgMCTruth()) == std::abs(mPDGTwo)) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates + setPairBase(femtoObsMC, mTMC, part1.fdMCParticle(), part2.fdMCParticle(), mult, use3dplots, weight); + setPairMC(femtoObsMC, femtoObs, mT, mult); } else { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]) + HIST("/hFakePairsCounter"), 0); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]) + HIST("/hFakePairsCounter"), 0); } } else { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]) + HIST("/hNoMCtruthPairsCounter"), 0); + mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]) + HIST("/hNoMCtruthPairsCounter"), 0); } } } } protected: - HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output - static constexpr std::string_view mFolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to mEventType - static constexpr femtoUniverseContainer::Observable mFemtoObs = obs; ///< Femtoscopic observable to be computed (according to femtoUniverseContainer::Observable) - static constexpr int mEventType = eventType; ///< Type of the event (same/mixed, according to femtoUniverseContainer::EventType) - float mMassOne = 0.f; ///< PDG mass of particle 1 - float mMassTwo = 0.f; ///< PDG mass of particle 2 - int mPDGOne = 0; ///< PDG code of particle 1 - int mPDGTwo = 0; ///< PDG code of particle 2 + HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output + static constexpr std::string_view FolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to EventType + static constexpr femto_universe_container::Observable FemtoObs = obs; ///< Femtoscopic observable to be computed (according to femto_universe_container::Observable) + static constexpr int EventType = eventType; ///< Type of the event (same/mixed, according to femto_universe_container::EventType) + float mMassOne = 0.f; ///< PDG mass of particle 1 + float mMassTwo = 0.f; ///< PDG mass of particle 2 + int mPDGOne = 0; ///< PDG code of particle 1 + int mPDGTwo = 0; ///< PDG code of particle 2 double mPhiLow; double mPhiHigh; - double delta_eta; - double delta_phi; + double deltaEta; + double deltaPhi; }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSECONTAINER_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseCutculator.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseCutculator.h index 8a18e3c9f8c..3417045e100 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseCutculator.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseCutculator.h @@ -32,7 +32,7 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h" -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { /// \class FemtoUniverseCutculator @@ -45,23 +45,23 @@ class FemtoUniverseCutculator /// femtouniverse-producer task void init(const char* configFile) { - std::cout << "Welcome to the CutCulator!" << std::endl; + LOGF(info, "Welcome to the CutCulator!"); + // std::cout << "Welcome to the CutCulator!" << std::endl; boost::property_tree::ptree root; try { boost::property_tree::read_json(configFile, root); } catch (const boost::property_tree::ptree_error& e) { - std::cout - << "Failed to read JSON config file " << configFile << " (" - << e.what() << ")" << std::endl; + // LOGF(fatal, "Failed to read JSON config file %s (%s)", configFile, e.what()); + std::cout << "Failed to read JSON config file " << configFile << " (" << e.what() << ")" << std::endl; } // check the config file for all known producer task - std::vector ProducerTasks = { - "femto-universe-producer-task"}; - for (auto& Producer : ProducerTasks) { + std::vector producerTasks = {"femto-universe-producer-task"}; + for (const auto& Producer : producerTasks) { if (root.count(Producer) > 0) { mConfigTree = root.get_child(Producer); + // LOGF(info, "Found %s in %s", Producer, configFile); std::cout << "Found " << Producer << " in " << configFile << std::endl; break; } @@ -76,16 +76,15 @@ class FemtoUniverseCutculator { try { boost::property_tree::ptree& selections = mConfigTree.get_child(name); - boost::property_tree::ptree& selectionsValues = - selections.get_child("values"); + boost::property_tree::ptree& selectionsValues = selections.get_child("values"); std::vector tmpVec; for (boost::property_tree::ptree::value_type& val : selectionsValues) { tmpVec.push_back(std::stof(val.second.data())); } return tmpVec; } catch (const boost::property_tree::ptree_error& e) { - std::cout << "Selection " << name << " not available (" << e.what() << ")" - << std::endl; + // LOGF(fatal, "Selection %s not available (%s)", name, e.what()); + std::cout << "Selection " << name << " not available (" << e.what() << ")" << std::endl; return {}; } } @@ -96,12 +95,11 @@ class FemtoUniverseCutculator /// \param obs Observable of the track selection /// \param type Type of the track selection /// \param prefix Prefix which is added to the name of the Configurable - void setTrackSelection(femtoUniverseTrackSelection::TrackSel obs, - femtoUniverseSelection::SelectionType type, + void setTrackSelection(femto_universe_track_selection::TrackSel obs, + femto_universe_selection::SelectionType type, const char* prefix) { - auto tmpVec = - setSelection(FemtoUniverseTrackSelection::getSelectionName(obs, prefix)); + auto tmpVec = setSelection(FemtoUniverseTrackSelection::getSelectionName(obs, prefix)); if (tmpVec.size() > 0) { mTrackSel.setSelection(tmpVec, obs, type); } @@ -112,17 +110,17 @@ class FemtoUniverseCutculator void setTrackSelectionFromFile(const char* prefix) { for (const auto& sel : mConfigTree) { - std::string sel_name = sel.first; - femtoUniverseTrackSelection::TrackSel obs; - if (sel_name.find(prefix) != std::string::npos) { + std::string selName = sel.first; + femto_universe_track_selection::TrackSel obs; + if (selName.find(prefix) != std::string::npos) { int index = FemtoUniverseTrackSelection::findSelectionIndex( - std::string_view(sel_name), prefix); + std::string_view(selName), prefix); if (index >= 0) { - obs = femtoUniverseTrackSelection::TrackSel(index); + obs = femto_universe_track_selection::TrackSel(index); } else { continue; } - if (obs == femtoUniverseTrackSelection::TrackSel::kPIDnSigmaMax) + if (obs == femto_universe_track_selection::TrackSel::kPIDnSigmaMax) continue; // kPIDnSigmaMax is a special case setTrackSelection(obs, FemtoUniverseTrackSelection::getSelectionType(obs), prefix); @@ -134,23 +132,23 @@ class FemtoUniverseCutculator /// \param prefix Prefix which is added to the name of the Configurable void setPIDSelectionFromFile(const char* prefix) { - std::string PIDnodeName = std::string(prefix) + "PIDspecies"; - std::string PIDNsigmaNodeName = std::string(prefix) + "PIDnSigmaMax"; + std::string mPIDnodeName = std::string(prefix) + "PIDspecies"; + std::string mPIDNsigmaNodeName = std::string(prefix) + "PIDnSigmaMax"; try { - boost::property_tree::ptree& pidNode = mConfigTree.get_child(PIDnodeName); + boost::property_tree::ptree& pidNode = mConfigTree.get_child(mPIDnodeName); boost::property_tree::ptree& pidValues = pidNode.get_child("values"); - for (auto& val : pidValues) { + for (const auto& val : pidValues) { mPIDspecies.push_back( static_cast(std::stoi(val.second.data()))); } - boost::property_tree::ptree& pidNsigmaNode = mConfigTree.get_child(PIDNsigmaNodeName); + boost::property_tree::ptree& pidNsigmaNode = mConfigTree.get_child(mPIDNsigmaNodeName); boost::property_tree::ptree& pidNsigmaValues = pidNsigmaNode.get_child("values"); - for (auto& val : pidNsigmaValues) { + for (const auto& val : pidNsigmaValues) { mPIDValues.push_back(std::stof(val.second.data())); } } catch (const boost::property_tree::ptree_error& e) { - std::cout << "PID selection not avalible for these skimmed data." - << std::endl; + // LOGF(fatal, "PID selection not avalible for these skimmed data."); + std::cout << "PID selection not avalible for these skimmed data." << std::endl; } } @@ -160,8 +158,8 @@ class FemtoUniverseCutculator /// \param obs Observable of the track selection /// \param type Type of the track selection /// \param prefix Prefix which is added to the name of the Configurable - void setV0Selection(femtoUniverseV0Selection::V0Sel obs, - femtoUniverseSelection::SelectionType type, + void setV0Selection(femto_universe_v0_selection::V0Sel obs, + femto_universe_selection::SelectionType type, const char* prefix) { auto tmpVec = @@ -176,13 +174,13 @@ class FemtoUniverseCutculator void setV0SelectionFromFile(const char* prefix) { for (const auto& sel : mConfigTree) { - std::string sel_name = sel.first; - femtoUniverseV0Selection::V0Sel obs; - if (sel_name.find(prefix) != std::string::npos) { + std::string selName = sel.first; + femto_universe_v0_selection::V0Sel obs; + if (selName.find(prefix) != std::string::npos) { int index = FemtoUniverseV0Selection::findSelectionIndex( - std::string_view(sel_name), prefix); + std::string_view(selName), prefix); if (index >= 0) { - obs = femtoUniverseV0Selection::V0Sel(index); + obs = femto_universe_v0_selection::V0Sel(index); } else { continue; } @@ -207,8 +205,7 @@ class FemtoUniverseCutculator bool SysChecks, float sign) { /// Output of the available selections and user input - std::cout << "Selection: " - << objectSelection.getSelectionHelper(selectionType) << " - ("; + std::cout << "Selection: " << objectSelection.getSelectionHelper(selectionType) << " - ("; auto selVec = objectSelection.getSelections(selectionType); for (auto selIt : selVec) { std::cout << selIt.getSelectionValue() << " "; @@ -255,19 +252,19 @@ class FemtoUniverseCutculator /// If the input is sane, the selection bit is put together if (inputSane) { - int internal_index = 0; + int internalIndex = 0; for (auto sel : selVec) { double signOffset; switch (sel.getSelectionType()) { - case femtoUniverseSelection::SelectionType::kEqual: + case femto_universe_selection::SelectionType::kEqual: signOffset = 0.; break; - case (femtoUniverseSelection::SelectionType::kLowerLimit): - case (femtoUniverseSelection::SelectionType::kAbsLowerLimit): + case (femto_universe_selection::SelectionType::kLowerLimit): + case (femto_universe_selection::SelectionType::kAbsLowerLimit): signOffset = 1.; break; - case (femtoUniverseSelection::SelectionType::kUpperLimit): - case (femtoUniverseSelection::SelectionType::kAbsUpperLimit): + case (femto_universe_selection::SelectionType::kUpperLimit): + case (femto_universe_selection::SelectionType::kAbsUpperLimit): signOffset = -1.; break; } @@ -276,16 +273,16 @@ class FemtoUniverseCutculator /// the cut is actually fulfilled if (sel.isSelected(input + signOffset * 1.e-6 * input)) { output |= 1UL << counter; - for (int i = internal_index; i > 0; i--) { + for (int i = internalIndex; i > 0; i--) { output &= ~(1UL << (counter - i)); } } ++counter; - ++internal_index; + ++internalIndex; } } else { - std::cout << "Choice " << in << " not recognized - repeating" - << std::endl; + // LOGF(info, "Choice %s not recognized - repeating", in); + std::cout << "Choice " << in << " not recognized - repeating" << std::endl; checkForSelection(output, counter, objectSelection, selectionType, SysChecks, sign); } } @@ -297,8 +294,7 @@ class FemtoUniverseCutculator /// container that will be put to the user task incorporating the user choice /// of selections template - aod::femtouniverseparticle::cutContainerType iterateSelection(T objectSelection, - bool SysChecks, float sign) + aod::femtouniverseparticle::cutContainerType iterateSelection(T objectSelection, bool SysChecks, float sign) { aod::femtouniverseparticle::cutContainerType output = 0; size_t counter = 0; @@ -319,12 +315,17 @@ class FemtoUniverseCutculator } else if (choice == std::string("V")) { output = iterateSelection(mV0Sel, SysChecks, sign); } else { - std::cout << "Option " << choice - << " not recognized - available options are (T/V)" << std::endl; + // LOGF(info, "Option %s not recognized - available options are (T/V)", choice); + std::cout << "Option " << choice << " not recognized - available options are (T/V)" << std::endl; return; } std::bitset<8 * sizeof(aod::femtouniverseparticle::cutContainerType)> bitOutput = output; + // LOGF(info, "+++++++++++++++++++++++++++++++++"); + // LOGF(info, "CutCulator has spoken - your selection bit is"); + // LOGF(info, "%s (bitwise)", bitOutput); + // LOGF(info, "%s (number representation)", output); + // LOGF(info, "PID for these species is stored:"); std::cout << "+++++++++++++++++++++++++++++++++" << std::endl; std::cout << "CutCulator has spoken - your selection bit is" << std::endl; std::cout << bitOutput << " (bitwise)" << std::endl; @@ -332,6 +333,7 @@ class FemtoUniverseCutculator std::cout << "PID for these species is stored:" << std::endl; int index = 0; for (auto id : mPIDspecies) { + // LOGF(info, "%s : %d", o2::track::PID::getName(id), index++); std::cout << o2::track::PID::getName(id) << " : " << index++ << std::endl; if (SysChecks) { // Seed the random number generator @@ -357,6 +359,6 @@ class FemtoUniverseCutculator std::vector mPIDValues; ///< list of nsigma values for which PID is stored }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSECUTCULATOR_H_ */ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index d89aeef295f..f891823ccf5 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -29,15 +29,9 @@ #include "Framework/HistogramRegistry.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" -using namespace o2; -using namespace o2::analysis::femtoUniverse; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; - namespace o2::analysis { -namespace femtoUniverse +namespace femto_universe { /// \class FemtoUniverseDetaDphiStar @@ -54,86 +48,86 @@ class FemtoUniverseDetaDphiStar /// Initialization of the histograms and setting required values void init(HistogramRegistry* registry, HistogramRegistry* registryQA, float ldeltaphistarcutmin, float ldeltaphistarcutmax, float ldeltaetacutmin, float ldeltaetacutmax, float lchosenradii, bool lplotForEveryRadii, float lPhiMassMin = 1.014, float lPhiMassMax = 1.026) { - ChosenRadii = lchosenradii; - CutDeltaPhiStarMax = ldeltaphistarcutmax; - CutDeltaPhiStarMin = ldeltaphistarcutmin; - CutDeltaEtaMax = ldeltaetacutmax; - CutDeltaEtaMin = ldeltaetacutmin; + chosenRadii = lchosenradii; + cutDeltaPhiStarMax = ldeltaphistarcutmax; + cutDeltaPhiStarMin = ldeltaphistarcutmin; + cutDeltaEtaMax = ldeltaetacutmax; + cutDeltaEtaMin = ldeltaetacutmin; plotForEveryRadii = lplotForEveryRadii; mHistogramRegistry = registry; mHistogramRegistryQA = registryQA; - CutPhiInvMassLow = lPhiMassMin; - CutPhiInvMassHigh = lPhiMassMax; + cutPhiInvMassLow = lPhiMassMin; + cutPhiInvMassHigh = lPhiMassMax; - if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kTrack) { - std::string dirName = static_cast(dirNames[0]); - histdetadpisame[0][0] = mHistogramRegistry->add((dirName + static_cast(histNamesSame[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpisame[0][1] = mHistogramRegistry->add((dirName + static_cast(histNamesSame[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[0][0] = mHistogramRegistry->add((dirName + static_cast(histNamesMixed[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[0][1] = mHistogramRegistry->add((dirName + static_cast(histNamesMixed[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kTrack) { + std::string dirName = static_cast(DirNames[0]); + histdetadpisame[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int i = 0; i < 9; i++) { - histdetadpiRadii[0][i] = mHistogramRegistryQA->add((dirName + static_cast(histNamesRadii[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[0][i] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } - if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { + if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { for (int i = 0; i < 2; i++) { - std::string dirName = static_cast(dirNames[1]); - histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(histNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(histNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(histNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(histNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + std::string dirName = static_cast(DirNames[1]); + histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int j = 0; j < 9; j++) { - histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(histNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } } - if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kV0 && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { + if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kV0 && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { /// V0-V0 combination for (int k = 0; k < 2; k++) { - std::string dirName = static_cast(dirNames[2]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(histNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(histNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(histNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(histNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + std::string dirName = static_cast(DirNames[2]); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(histNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } } - if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kPhi) { + if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kPhi) { for (int i = 0; i < 2; i++) { - std::string dirName = static_cast(dirNames[3]); - histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(histNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{400, -0.30, 0.30}, {400, -0.30, 0.30}}); - histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(histNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{400, -0.30, 0.30}, {400, -0.30, 0.30}}); - histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(histNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{400, -0.30, 0.30}, {400, -0.30, 0.30}}); - histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(histNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{400, -0.30, 0.30}, {400, -0.30, 0.30}}); + std::string dirName = static_cast(DirNames[3]); + histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{400, -0.30, 0.30}, {400, -0.30, 0.30}}); + histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{400, -0.30, 0.30}, {400, -0.30, 0.30}}); + histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{400, -0.30, 0.30}, {400, -0.30, 0.30}}); + histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{400, -0.30, 0.30}, {400, -0.30, 0.30}}); if (plotForEveryRadii) { for (int j = 0; j < 9; j++) { - histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(histNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } } - if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) { + if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) { for (int i = 0; i < 2; i++) { - std::string dirName = static_cast(dirNames[4]); - histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(histNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(histNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(histNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(histNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + std::string dirName = static_cast(DirNames[4]); + histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int j = 0; j < 9; j++) { - histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(histNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -146,7 +140,7 @@ class FemtoUniverseDetaDphiStar { magfield = lmagfield; - if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kTrack) { + if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kTrack) { /// Track-Track combination // check if provided particles are in agreement with the class instantiation if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack) { @@ -154,21 +148,21 @@ class FemtoUniverseDetaDphiStar return false; } auto deta = part1.eta() - part2.eta(); - auto dphiAvg = AveragePhiStar(part1, part2, 0); - if (ChosenEventType == femtoUniverseContainer::EventType::same) { + auto dphiAvg = averagePhiStar(part1, part2, 0); + if (ChosenEventType == femto_universe_container::EventType::same) { histdetadpisame[0][0]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femtoUniverseContainer::EventType::mixed) { + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { histdetadpimixed[0][0]->Fill(deta, dphiAvg); } else { LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; } - if (pow(dphiAvg, 2) / pow(CutDeltaPhiStarMax, 2) + pow(deta, 2) / pow(CutDeltaEtaMax, 2) < 1.) { + if (std::pow(dphiAvg, 2) / std::pow(cutDeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(cutDeltaEtaMax, 2) < 1.) { return true; } else { - if (ChosenEventType == femtoUniverseContainer::EventType::same) { + if (ChosenEventType == femto_universe_container::EventType::same) { histdetadpisame[0][1]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femtoUniverseContainer::EventType::mixed) { + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { histdetadpimixed[0][1]->Fill(deta, dphiAvg); } else { LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; @@ -176,7 +170,7 @@ class FemtoUniverseDetaDphiStar return false; } - } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { + } else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { /// Track-V0 combination // check if provided particles are in agreement with the class instantiation if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0) { @@ -186,25 +180,25 @@ class FemtoUniverseDetaDphiStar bool pass = false; for (int i = 0; i < 2; i++) { - auto indexOfDaughter = (ChosenEventType == femtoUniverseContainer::EventType::mixed ? part2.globalIndex() : part2.index()) - 2 + i; + auto indexOfDaughter = (ChosenEventType == femto_universe_container::EventType::mixed ? part2.globalIndex() : part2.index()) - 2 + i; // auto indexOfDaughter = part2.globalIndex() - 2 + i; auto daughter = particles.begin() + indexOfDaughter; auto deta = part1.eta() - daughter.eta(); - auto dphiAvg = AveragePhiStar(part1, *daughter, i); - if (ChosenEventType == femtoUniverseContainer::EventType::same) { + auto dphiAvg = averagePhiStar(part1, *daughter, i); + if (ChosenEventType == femto_universe_container::EventType::same) { histdetadpisame[i][0]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femtoUniverseContainer::EventType::mixed) { + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { histdetadpimixed[i][0]->Fill(deta, dphiAvg); } else { LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; } - if (pow(dphiAvg, 2) / pow(CutDeltaPhiStarMax, 2) + pow(deta, 2) / pow(CutDeltaEtaMax, 2) < 1.) { + if (std::pow(dphiAvg, 2) / std::pow(cutDeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(cutDeltaEtaMax, 2) < 1.) { pass = true; } else { - if (ChosenEventType == femtoUniverseContainer::EventType::same) { + if (ChosenEventType == femto_universe_container::EventType::same) { histdetadpisame[i][1]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femtoUniverseContainer::EventType::mixed) { + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { histdetadpimixed[i][1]->Fill(deta, dphiAvg); } else { LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; @@ -213,7 +207,7 @@ class FemtoUniverseDetaDphiStar } return pass; - } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kV0 && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { + } else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kV0 && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { /// V0-V0 combination // check if provided particles are in agreement with the class instantiation if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0 || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0) { @@ -223,27 +217,27 @@ class FemtoUniverseDetaDphiStar bool pass = false; for (int i = 0; i < 2; i++) { - auto indexOfDaughterpart1 = (ChosenEventType == femtoUniverseContainer::EventType::mixed ? part1.globalIndex() : part1.index()) - 2 + i; - auto indexOfDaughterpart2 = (ChosenEventType == femtoUniverseContainer::EventType::mixed ? part2.globalIndex() : part2.index()) - 2 + i; + auto indexOfDaughterpart1 = (ChosenEventType == femto_universe_container::EventType::mixed ? part1.globalIndex() : part1.index()) - 2 + i; + auto indexOfDaughterpart2 = (ChosenEventType == femto_universe_container::EventType::mixed ? part2.globalIndex() : part2.index()) - 2 + i; auto daughterpart1 = particles.begin() + indexOfDaughterpart1; auto daughterpart2 = particles.begin() + indexOfDaughterpart2; auto deta = daughterpart1.eta() - daughterpart2.eta(); - auto dphiAvg = AveragePhiStar(*daughterpart1, *daughterpart2, i); - if (ChosenEventType == femtoUniverseContainer::EventType::same) { + auto dphiAvg = averagePhiStar(*daughterpart1, *daughterpart2, i); + if (ChosenEventType == femto_universe_container::EventType::same) { histdetadpisame[i][0]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femtoUniverseContainer::EventType::mixed) { + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { histdetadpimixed[i][0]->Fill(deta, dphiAvg); } else { LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; } - // if (pow(dphiAvg, 2) / pow(CutDeltaPhiStarMax, 2) + pow(deta, 2) / pow(CutDeltaEtaMax, 2) < 1.) { - if ((dphiAvg > CutDeltaPhiStarMin) && (dphiAvg < CutDeltaPhiStarMax) && (deta > CutDeltaEtaMin) && (deta < CutDeltaEtaMax)) { + // if (std::pow(dphiAvg, 2) / std::pow(cutDeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(cutDeltaEtaMax, 2) < 1.) { + if ((dphiAvg > cutDeltaPhiStarMin) && (dphiAvg < cutDeltaPhiStarMax) && (deta > cutDeltaEtaMin) && (deta < cutDeltaEtaMax)) { pass = true; } else { - if (ChosenEventType == femtoUniverseContainer::EventType::same) { + if (ChosenEventType == femto_universe_container::EventType::same) { histdetadpisame[i][1]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femtoUniverseContainer::EventType::mixed) { + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { histdetadpimixed[i][1]->Fill(deta, dphiAvg); } else { LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; @@ -252,7 +246,7 @@ class FemtoUniverseDetaDphiStar } return pass; - } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) { + } else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) { /// Track-D0 combination // check if provided particles are in agreement with the class instantiation if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kD0) { @@ -263,30 +257,30 @@ class FemtoUniverseDetaDphiStar bool pass = false; for (int i = 0; i < 2; i++) { auto indexOfDaughter = 0; - if (ChosenEventType == femtoUniverseContainer::EventType::mixed) { + if (ChosenEventType == femto_universe_container::EventType::mixed) { indexOfDaughter = part2.globalIndex() - 2 + i; - } else if (ChosenEventType == femtoUniverseContainer::EventType::same) { + } else if (ChosenEventType == femto_universe_container::EventType::same) { indexOfDaughter = part2.index() - 2 + i; } auto daughter = particles.begin() + indexOfDaughter; auto deta = part1.eta() - daughter.eta(); - auto dphiAvg = AveragePhiStar(part1, *daughter, i); // auto dphiAvg = CalculateDphiStar(part1, *daughter); + auto dphiAvg = averagePhiStar(part1, *daughter, i); // auto dphiAvg = calculateDphiStar(part1, *daughter); dphiAvg = TVector2::Phi_mpi_pi(dphiAvg); - if (ChosenEventType == femtoUniverseContainer::EventType::same) { + if (ChosenEventType == femto_universe_container::EventType::same) { histdetadpisame[i][0]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femtoUniverseContainer::EventType::mixed) { + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { histdetadpimixed[i][0]->Fill(deta, dphiAvg); } else { LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; } - if ((dphiAvg > CutDeltaPhiStarMin) && (dphiAvg < CutDeltaPhiStarMax) && (deta > CutDeltaEtaMin) && (deta < CutDeltaEtaMax)) { + if ((dphiAvg > cutDeltaPhiStarMin) && (dphiAvg < cutDeltaPhiStarMax) && (deta > cutDeltaEtaMin) && (deta < cutDeltaEtaMax)) { pass = true; // pair is close } else { - if (ChosenEventType == femtoUniverseContainer::EventType::same) { + if (ChosenEventType == femto_universe_container::EventType::same) { histdetadpisame[i][1]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femtoUniverseContainer::EventType::mixed) { + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { histdetadpimixed[i][1]->Fill(deta, dphiAvg); } else { LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; @@ -294,7 +288,7 @@ class FemtoUniverseDetaDphiStar } } return pass; - } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kPhi) { + } else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kPhi) { /// Track-Phi combination // check if provided particles are in agreement with the class instantiation if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kPhi) { @@ -305,19 +299,19 @@ class FemtoUniverseDetaDphiStar bool pass = false; for (int i = 0; i < 2; i++) { auto indexOfDaughter = 0; - if (ChosenEventType == femtoUniverseContainer::EventType::mixed) { + if (ChosenEventType == femto_universe_container::EventType::mixed) { indexOfDaughter = part2.globalIndex() - 2 + i; - } else if (ChosenEventType == femtoUniverseContainer::EventType::same) { + } else if (ChosenEventType == femto_universe_container::EventType::same) { indexOfDaughter = part2.index() - 2 + i; } auto daughter = particles.begin() + indexOfDaughter; auto deta = part1.eta() - daughter.eta(); - auto dphiAvg = AveragePhiStar(part1, *daughter, i); // CalculateDphiStar(part1, *daughter); + auto dphiAvg = averagePhiStar(part1, *daughter, i); // calculateDphiStar(part1, *daughter); dphiAvg = TVector2::Phi_mpi_pi(dphiAvg); - if (ChosenEventType == femtoUniverseContainer::EventType::same) { + if (ChosenEventType == femto_universe_container::EventType::same) { histdetadpisame[i][0]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femtoUniverseContainer::EventType::mixed) { + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { histdetadpimixed[i][0]->Fill(deta, dphiAvg); } else { LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; @@ -326,24 +320,24 @@ class FemtoUniverseDetaDphiStar // REMOVING THE "RING" -- CALCULATING THE INVARIANT MASS TLorentzVector part1Vec; TLorentzVector part2Vec; - float mMassOne = TDatabasePDG::Instance()->GetParticle(321)->Mass(); - float mMassTwo = TDatabasePDG::Instance()->GetParticle(321)->Mass(); + float mMassOne = o2::constants::physics::MassKPlus; + float mMassTwo = o2::constants::physics::MassKMinus; part1Vec.SetPtEtaPhiM(part1.pt(), part1.eta(), part1.phi(), mMassOne); part2Vec.SetPtEtaPhiM(daughter.pt(), daughter.eta(), daughter.phi(), mMassTwo); TLorentzVector sumVec(part1Vec); sumVec += part2Vec; float phiM = sumVec.M(); - if ((phiM > CutPhiInvMassLow) && (phiM < CutPhiInvMassHigh)) { + if ((phiM > cutPhiInvMassLow) && (phiM < cutPhiInvMassHigh)) { pass = true; // pair comes from Phi meson decay } // APPLYING THE CUTS - if ((dphiAvg > CutDeltaPhiStarMin) && (dphiAvg < CutDeltaPhiStarMax) && (deta > CutDeltaEtaMin) && (deta < CutDeltaEtaMax)) { + if ((dphiAvg > cutDeltaPhiStarMin) && (dphiAvg < cutDeltaPhiStarMax) && (deta > cutDeltaEtaMin) && (deta < cutDeltaEtaMax)) { pass = true; // pair is close } else { - if (ChosenEventType == femtoUniverseContainer::EventType::same) { + if (ChosenEventType == femto_universe_container::EventType::same) { histdetadpisame[i][1]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femtoUniverseContainer::EventType::mixed) { + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { histdetadpimixed[i][1]->Fill(deta, dphiAvg); } else { LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; @@ -360,47 +354,47 @@ class FemtoUniverseDetaDphiStar private: HistogramRegistry* mHistogramRegistry = nullptr; ///< For main output HistogramRegistry* mHistogramRegistryQA = nullptr; ///< For QA output - static constexpr std::string_view dirNames[5] = {"kTrack_kTrack/", "kTrack_kV0/", "kV0_kV0/", "kTrack_kPhi/", "kTrack_kD0/"}; + static constexpr std::string_view DirNames[5] = {"kTrack_kTrack/", "kTrack_kV0/", "kV0_kV0/", "kTrack_kPhi/", "kTrack_kD0/"}; - static constexpr std::string_view histNamesSame[2][2] = {{"detadphidetadphi0BeforeSame_0", "detadphidetadphi0BeforeSame_1"}, + static constexpr std::string_view HistNamesSame[2][2] = {{"detadphidetadphi0BeforeSame_0", "detadphidetadphi0BeforeSame_1"}, {"detadphidetadphi0AfterSame_0", "detadphidetadphi0AfterSame_1"}}; - static constexpr std::string_view histNamesMixed[2][2] = {{"detadphidetadphi0BeforeMixed_0", "detadphidetadphi0BeforeMixed_1"}, + static constexpr std::string_view HistNamesMixed[2][2] = {{"detadphidetadphi0BeforeMixed_0", "detadphidetadphi0BeforeMixed_1"}, {"detadphidetadphi0AfterMixed_0", "detadphidetadphi0AfterMixed_1"}}; - static constexpr std::string_view histNamesRadii[2][9] = {{"detadphidetadphi0Before_0_0", "detadphidetadphi0Before_0_1", "detadphidetadphi0Before_0_2", + static constexpr std::string_view HistNamesRadii[2][9] = {{"detadphidetadphi0Before_0_0", "detadphidetadphi0Before_0_1", "detadphidetadphi0Before_0_2", "detadphidetadphi0Before_0_3", "detadphidetadphi0Before_0_4", "detadphidetadphi0Before_0_5", "detadphidetadphi0Before_0_6", "detadphidetadphi0Before_0_7", "detadphidetadphi0Before_0_8"}, {"detadphidetadphi0Before_1_0", "detadphidetadphi0Before_1_1", "detadphidetadphi0Before_1_2", "detadphidetadphi0Before_1_3", "detadphidetadphi0Before_1_4", "detadphidetadphi0Before_1_5", "detadphidetadphi0Before_1_6", "detadphidetadphi0Before_1_7", "detadphidetadphi0Before_1_8"}}; - static constexpr o2::aod::femtouniverseparticle::ParticleType mPartOneType = partOne; ///< Type of particle 1 - static constexpr o2::aod::femtouniverseparticle::ParticleType mPartTwoType = partTwo; ///< Type of particle 2 + static constexpr o2::aod::femtouniverseparticle::ParticleType kPartOneType = partOne; ///< Type of particle 1 + static constexpr o2::aod::femtouniverseparticle::ParticleType kPartTwoType = partTwo; ///< Type of particle 2 - static constexpr float tmpRadiiTPC[9] = {85., 105., 125., 145., 165., 185., 205., 225., 245.}; + static constexpr float TmpRadiiTPC[9] = {85., 105., 125., 145., 165., 185., 205., 225., 245.}; static constexpr uint32_t kSignMinusMask = 1; static constexpr uint32_t kSignPlusMask = 1 << 1; static constexpr uint32_t kValue0 = 0; - float ChosenRadii; - float CutDeltaPhiStarMax; - float CutDeltaPhiStarMin; - float CutDeltaEtaMax; - float CutDeltaEtaMin; + float chosenRadii; + float cutDeltaPhiStarMax; + float cutDeltaPhiStarMin; + float cutDeltaEtaMax; + float cutDeltaEtaMin; float magfield; bool plotForEveryRadii = false; - float CutPhiInvMassLow; - float CutPhiInvMassHigh; + float cutPhiInvMassLow; + float cutPhiInvMassHigh; std::array, 2>, 2> histdetadpisame{}; std::array, 2>, 2> histdetadpimixed{}; std::array, 9>, 2> histdetadpiRadii{}; - /// Calculate phi at all required radii stored in tmpRadiiTPC + /// Calculate phi at all required radii stored in TmpRadiiTPC /// Magnetic field to be provided in Tesla template - void PhiAtRadiiTPC(const T& part, std::vector& tmpVec) + void phiAtRadiiTPC(const T& part, std::vector& tmpVec) { float phi0 = part.phi(); @@ -418,8 +412,8 @@ class FemtoUniverseDetaDphiStar // End: Get the charge from cutcontainer using masks float pt = part.pt(); for (size_t i = 0; i < 9; i++) { - double arg = 0.3 * charge * magfield * tmpRadiiTPC[i] * 0.01 / (2. * pt); - if (abs(arg) < 1.0) { + double arg = 0.3 * charge * magfield * TmpRadiiTPC[i] * 0.01 / (2. * pt); + if (std::abs(arg) < 1.0) { tmpVec.push_back(phi0 - std::asin(arg)); } else { tmpVec.push_back(999.0); @@ -429,12 +423,12 @@ class FemtoUniverseDetaDphiStar /// Calculate average phi template - float AveragePhiStar(const T1& part1, const T2& part2, int iHist) + float averagePhiStar(const T1& part1, const T2& part2, int iHist) { std::vector tmpVec1; std::vector tmpVec2; - PhiAtRadiiTPC(part1, tmpVec1); - PhiAtRadiiTPC(part2, tmpVec2); + phiAtRadiiTPC(part1, tmpVec1); + phiAtRadiiTPC(part2, tmpVec2); int num = tmpVec1.size(); float dPhiAvg = 0; float dphi = 0; @@ -457,7 +451,7 @@ class FemtoUniverseDetaDphiStar // Get particle charge from mask template - float GetCharge(const T1& part) + float getCharge(const T1& part) { float charge = 0; if ((part.cut() & kSignMinusMask) == kValue0 && (part.cut() & kSignPlusMask) == kValue0) { @@ -474,25 +468,25 @@ class FemtoUniverseDetaDphiStar // Calculate phi* as in https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistance.cxx template - double CalculateDphiStar(const T1& part1, const T2& part2) + double calculateDphiStar(const T1& part1, const T2& part2) { - float charge1 = GetCharge(part1); - float charge2 = GetCharge(part2); + float charge1 = getCharge(part1); + float charge2 = getCharge(part2); double deltaphiconstFD = 0.3 / 2; // double deltaphiconstAF = 0.15; - double afsi0b = deltaphiconstFD * magfield * charge1 * ChosenRadii / part1.pt(); - double afsi1b = deltaphiconstFD * magfield * charge2 * ChosenRadii / part2.pt(); + double afsi0b = deltaphiconstFD * magfield * charge1 * chosenRadii / part1.pt(); + double afsi1b = deltaphiconstFD * magfield * charge2 * chosenRadii / part2.pt(); double dphis = 0.0; - if (abs(afsi0b) < 1.0 && abs(afsi0b) < 1.0) { - dphis = part2.phi() - part1.phi() + TMath::ASin(afsi1b) - TMath::ASin(afsi0b); + if (std::abs(afsi0b) < 1.0 && std::abs(afsi0b) < 1.0) { + dphis = part2.phi() - part1.phi() + std::asin(afsi1b) - std::asin(afsi0b); } return dphis; } }; -} /* namespace femtoUniverse */ +} /* namespace femto_universe */ } /* namespace o2::analysis */ #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEDETADPHISTAR_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h index b49c2480710..627587a0c18 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h @@ -21,7 +21,7 @@ #include "Framework/HistogramRegistry.h" using namespace o2::framework; -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { /// \class FemtoUniverseEventHisto /// \brief Class for histogramming event properties @@ -60,6 +60,6 @@ class FemtoUniverseEventHisto private: HistogramRegistry* mHistogramRegistry; ///< For QA output }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEEVENTHISTO_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h index e921bb719df..e973cadee90 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h @@ -33,10 +33,10 @@ using namespace o2::framework; -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { -namespace femtoUniverseFemtoContainer +namespace femto_universe_femto_container { /// Femtoscopic observable to be computed enum Observable { kstar ///< kstar @@ -46,7 +46,7 @@ enum Observable { kstar ///< kstar enum EventType { same, ///< Pair from same event mixed ///< Pair from mixed event }; -}; // namespace femtoUniverseFemtoContainer +}; // namespace femto_universe_femto_container /// \class FemtoUniverseFemtoContainer /// \brief Container for all histogramming related to the correlation function. The two @@ -54,7 +54,7 @@ enum EventType { same, ///< Pair from same event /// are filled according to the specified observable /// \tparam eventType Type of the event (same/mixed) /// \tparam obs Observable to be computed (k*/Q_inv/...) -template +template class FemtoUniverseFemtoContainer { public: @@ -71,20 +71,20 @@ class FemtoUniverseFemtoContainer /// \param kTAxis axis object for the kT axis /// \param mTAxis axis object for the mT axis template - void init_base(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, bool use3dplots) + void initBase(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, bool use3dplots) { - mHistogramRegistry->add((folderName + "/relPairDist").c_str(), ("; " + femtoObs + "; Entries").c_str(), kTH1F, {femtoObsAxis}); - mHistogramRegistry->add((folderName + "/relPairkT").c_str(), "; #it{k}_{T} (GeV/#it{c}); Entries", kTH1F, {kTAxis}); - mHistogramRegistry->add((folderName + "/relPairkstarkT").c_str(), ("; " + femtoObs + "; #it{k}_{T} (GeV/#it{c})").c_str(), kTH2F, {femtoObsAxis, kTAxis}); - mHistogramRegistry->add((folderName + "/relPairkstarmT").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2})").c_str(), kTH2F, {femtoObsAxis, mTAxis}); - mHistogramRegistry->add((folderName + "/relPairkstarMult").c_str(), ("; " + femtoObs + "; Multiplicity").c_str(), kTH2F, {femtoObsAxis, multAxis}); - mHistogramRegistry->add((folderName + "/kstarPtPart1").c_str(), ("; " + femtoObs + "; #it{p} _{T} Particle 1 (GeV/#it{c})").c_str(), kTH2F, {femtoObsAxis, {375, 0., 7.5}}); - mHistogramRegistry->add((folderName + "/kstarPtPart2").c_str(), ("; " + femtoObs + "; #it{p} _{T} Particle 2 (GeV/#it{c})").c_str(), kTH2F, {femtoObsAxis, {375, 0., 7.5}}); - mHistogramRegistry->add((folderName + "/MultPtPart1").c_str(), "; #it{p} _{T} Particle 1 (GeV/#it{c}); Multiplicity", kTH2F, {{375, 0., 7.5}, multAxis}); - mHistogramRegistry->add((folderName + "/MultPtPart2").c_str(), "; #it{p} _{T} Particle 2 (GeV/#it{c}); Multiplicity", kTH2F, {{375, 0., 7.5}, multAxis}); - mHistogramRegistry->add((folderName + "/PtPart1PtPart2").c_str(), "; #it{p} _{T} Particle 1 (GeV/#it{c}); #it{p} _{T} Particle 2 (GeV/#it{c})", kTH2F, {{375, 0., 7.5}, {375, 0., 7.5}}); + kHistogramRegistry->add((folderName + "/relPairDist").c_str(), ("; " + femtoObs + "; Entries").c_str(), kTH1F, {femtoObsAxis}); + kHistogramRegistry->add((folderName + "/relPairkT").c_str(), "; #it{k}_{T} (GeV/#it{c}); Entries", kTH1F, {kTAxis}); + kHistogramRegistry->add((folderName + "/relPairkstarkT").c_str(), ("; " + femtoObs + "; #it{k}_{T} (GeV/#it{c})").c_str(), kTH2F, {femtoObsAxis, kTAxis}); + kHistogramRegistry->add((folderName + "/relPairkstarmT").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2})").c_str(), kTH2F, {femtoObsAxis, mTAxis}); + kHistogramRegistry->add((folderName + "/relPairkstarMult").c_str(), ("; " + femtoObs + "; Multiplicity").c_str(), kTH2F, {femtoObsAxis, multAxis}); + kHistogramRegistry->add((folderName + "/kstarPtPart1").c_str(), ("; " + femtoObs + "; #it{p} _{T} Particle 1 (GeV/#it{c})").c_str(), kTH2F, {femtoObsAxis, {375, 0., 7.5}}); + kHistogramRegistry->add((folderName + "/kstarPtPart2").c_str(), ("; " + femtoObs + "; #it{p} _{T} Particle 2 (GeV/#it{c})").c_str(), kTH2F, {femtoObsAxis, {375, 0., 7.5}}); + kHistogramRegistry->add((folderName + "/MultPtPart1").c_str(), "; #it{p} _{T} Particle 1 (GeV/#it{c}); Multiplicity", kTH2F, {{375, 0., 7.5}, multAxis}); + kHistogramRegistry->add((folderName + "/MultPtPart2").c_str(), "; #it{p} _{T} Particle 2 (GeV/#it{c}); Multiplicity", kTH2F, {{375, 0., 7.5}, multAxis}); + kHistogramRegistry->add((folderName + "/PtPart1PtPart2").c_str(), "; #it{p} _{T} Particle 1 (GeV/#it{c}); #it{p} _{T} Particle 2 (GeV/#it{c})", kTH2F, {{375, 0., 7.5}, {375, 0., 7.5}}); if (use3dplots) { - mHistogramRegistry->add((folderName + "/relPairkstarmTMult").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2}); Multiplicity").c_str(), kTH3F, {femtoObsAxis, mTAxis3D, multAxis3D}); + kHistogramRegistry->add((folderName + "/relPairkstarmTMult").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2}); Multiplicity").c_str(), kTH3F, {femtoObsAxis, mTAxis3D, multAxis3D}); } } @@ -94,19 +94,19 @@ class FemtoUniverseFemtoContainer /// \param folderName Name of the directory in the output file (no suffix for reconstructed data/ Monte Carlo; "_MC" for Monte Carlo Truth) /// \param femtoObsAxis axis object for the femto observable axis template - void init_MC(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T mTAxis) + void initMC(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T mTAxis) { - mHistogramRegistry->add((folderName + "/relPairDist_ReconNoFake").c_str(), ("; " + femtoObs + "; Entries").c_str(), kTH1F, {femtoObsAxis}); - mHistogramRegistry->add((folderName + "/relPairkstarmT_ReconNoFake").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2})").c_str(), kTH2F, {femtoObsAxis, mTAxis}); - mHistogramRegistry->add((folderName + "/relPairkstarMult_ReconNoFake").c_str(), ("; " + femtoObs + "; Multiplicity").c_str(), kTH2F, {femtoObsAxis, multAxis}); - mHistogramRegistry->add((folderName + "/hNoMCtruthPairsCounter").c_str(), "; Counter; Entries", kTH1I, {{1, 0, 1}}); - mHistogramRegistry->add((folderName + "/hFakePairsCounter").c_str(), "; Counter; Entries", kTH1I, {{1, 0, 1}}); - mHistogramRegistry->add((folderName + "/kstar_resolution").c_str(), "; #it{k} _{T} reconstructed (GeV/#it{c}); #it{k} _{T} truth (GeV/#it{c})", kTH2F, {femtoObsAxis, femtoObsAxis}); + kHistogramRegistry->add((folderName + "/relPairDist_ReconNoFake").c_str(), ("; " + femtoObs + "; Entries").c_str(), kTH1F, {femtoObsAxis}); + kHistogramRegistry->add((folderName + "/relPairkstarmT_ReconNoFake").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2})").c_str(), kTH2F, {femtoObsAxis, mTAxis}); + kHistogramRegistry->add((folderName + "/relPairkstarMult_ReconNoFake").c_str(), ("; " + femtoObs + "; Multiplicity").c_str(), kTH2F, {femtoObsAxis, multAxis}); + kHistogramRegistry->add((folderName + "/hNoMCtruthPairsCounter").c_str(), "; Counter; Entries", kTH1I, {{1, 0, 1}}); + kHistogramRegistry->add((folderName + "/hFakePairsCounter").c_str(), "; Counter; Entries", kTH1I, {{1, 0, 1}}); + kHistogramRegistry->add((folderName + "/kstar_resolution").c_str(), "; #it{k} _{T} reconstructed (GeV/#it{c}); #it{k} _{T} truth (GeV/#it{c})", kTH2F, {femtoObsAxis, femtoObsAxis}); } /// Templated function to initialize the histograms for the task - /// Always calls init_base to initialize the histograms for data/ Monte Carlo reconstructed - /// In case of Monte Carlo, calls init_base again for Monte Carlo truth and the specialized function init_MC for additional histogramms + /// Always calls initBase to initialize the histograms for data/ Monte Carlo reconstructed + /// In case of Monte Carlo, calls initBase again for Monte Carlo truth and the specialized function initMC for additional histogramms /// \tparam T type of the configurable for the axis configuration /// \param registry Histogram registry to be passed /// \param kstarBins k* binning for the histograms @@ -117,9 +117,9 @@ class FemtoUniverseFemtoContainer template void init(HistogramRegistry* registry, T& kstarBins, T& multBins, T& kTBins, T& mTBins, T& multBins3D, T& mTBins3D, bool isMC, bool use3dplots) { - mHistogramRegistry = registry; + kHistogramRegistry = registry; std::string femtoObs; - if constexpr (mFemtoObs == femtoUniverseFemtoContainer::Observable::kstar) { + if constexpr (kFemtoObs == femto_universe_femto_container::Observable::kstar) { femtoObs = "#it{k*} (GeV/#it{c})"; } std::vector tmpVecMult = multBins; @@ -131,13 +131,13 @@ class FemtoUniverseFemtoContainer framework::AxisSpec multAxis3D = {multBins3D, "Multiplicity"}; framework::AxisSpec mTAxis3D = {mTBins3D, "#it{m}_{T} (GeV/#it{c})"}; - std::string folderName = static_cast(mFolderSuffix[mEventType]) + static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kRecon]); + std::string folderName = static_cast(kFolderSuffix[kEventType]) + static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]); - init_base(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, use3dplots); + initBase(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, use3dplots); if (isMC) { - folderName = static_cast(mFolderSuffix[mEventType]) + static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]); - init_base(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, use3dplots); - init_MC(folderName, femtoObs, femtoObsAxis, multAxis, mTAxis); + folderName = static_cast(kFolderSuffix[kEventType]) + static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]); + initBase(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, use3dplots); + initMC(folderName, femtoObs, femtoObsAxis, multAxis, mTAxis); } } @@ -146,10 +146,10 @@ class FemtoUniverseFemtoContainer /// \param pdg2 PDG code of particle two void setPDGCodes(const int pdg1, const int pdg2) { - mMassOne = TDatabasePDG::Instance()->GetParticle(pdg1)->Mass(); - mMassTwo = TDatabasePDG::Instance()->GetParticle(pdg2)->Mass(); - mPDGOne = pdg1; - mPDGTwo = pdg2; + kMassOne = TDatabasePDG::Instance()->GetParticle(pdg1)->Mass(); + kMassTwo = TDatabasePDG::Instance()->GetParticle(pdg2)->Mass(); + kPDGOne = pdg1; + kPDGTwo = pdg2; } /// Pass a pair to the container and compute all the relevant observables @@ -158,23 +158,23 @@ class FemtoUniverseFemtoContainer /// \param part1 Particle one /// \param part2 Particle two /// \param mult Multiplicity of the event - template - void setPair_base(const float femtoObs, const float mT, T const& part1, T const& part2, const int mult, bool use3dplots) + template + void setPairBase(const float femtoObs, const float mT, T const& part1, T const& part2, const int mult, bool use3dplots) { - const float kT = FemtoUniverseMath::getkT(part1, mMassOne, part2, mMassTwo); + const float kT = FemtoUniverseMath::getkT(part1, kMassOne, part2, kMassTwo); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairDist"), femtoObs); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkT"), kT); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarkT"), femtoObs, kT); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarmT"), femtoObs, mT); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarMult"), femtoObs, mult); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/kstarPtPart1"), femtoObs, part1.pt()); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/kstarPtPart2"), femtoObs, part2.pt()); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/MultPtPart1"), part1.pt(), mult); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/MultPtPart2"), part2.pt(), mult); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/PtPart1PtPart2"), part1.pt(), part2.pt()); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairDist"), femtoObs); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkT"), kT); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarkT"), femtoObs, kT); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarmT"), femtoObs, mT); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarMult"), femtoObs, mult); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/kstarPtPart1"), femtoObs, part1.pt()); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/kstarPtPart2"), femtoObs, part2.pt()); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/MultPtPart1"), part1.pt(), mult); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/MultPtPart2"), part2.pt(), mult); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/PtPart1PtPart2"), part1.pt(), part2.pt()); if (use3dplots) { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/relPairkstarmTMult"), femtoObs, mT, mult); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/relPairkstarmTMult"), femtoObs, mT, mult); } } @@ -182,25 +182,25 @@ class FemtoUniverseFemtoContainer /// Fills MC truth specific histogramms: /// - kstar distribution plots with RECONSTRUCTED information but ONLY for non-fake candidates; needed for purity calculations of tracks /// - kstar resolution matrix - /// Note: Standard histogramms with MC truth information are filled with the setPair_base function + /// Note: Standard histogramms with MC truth information are filled with the setPairBase function /// \param part1 Particle one /// \param part2 Particle two /// \param mult Multiplicity of the event - void setPair_MC(const float femtoObsMC, const float femtoObs, const float mT, const int mult) + void setPairMC(const float femtoObsMC, const float femtoObs, const float mT, const int mult) { - if (mHistogramRegistry) { + if (kHistogramRegistry) { // Fill the kstar distributions with the reconstructed information but only for particles with the right PDG code - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]) + HIST("/relPairDist_ReconNoFake"), femtoObs); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]) + HIST("/relPairkstarmT_ReconNoFake"), femtoObs, mT); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]) + HIST("/relPairkstarMult_ReconNoFake"), femtoObs, mult); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]) + HIST("/relPairDist_ReconNoFake"), femtoObs); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]) + HIST("/relPairkstarmT_ReconNoFake"), femtoObs, mT); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]) + HIST("/relPairkstarMult_ReconNoFake"), femtoObs, mult); - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]) + HIST("/kstar_resolution"), femtoObsMC, femtoObs); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]) + HIST("/kstar_resolution"), femtoObsMC, femtoObs); } } /// Templated function to handle data/ Monte Carlo reconstructed and Monte Carlo truth - /// Always calls setPair_base to compute the observables with reconstructed data - /// In case of Monte Carlo, calls setPair_base with MC info and specialized function setPair_MC for additional histogramms + /// Always calls setPairBase to compute the observables with reconstructed data + /// In case of Monte Carlo, calls setPairBase with MC info and specialized function setPairMC for additional histogramms /// \tparam T type of the femtouniverseparticle /// \param part1 Particle one /// \param part2 Particle two @@ -210,47 +210,47 @@ class FemtoUniverseFemtoContainer { float femtoObs, femtoObsMC; // Calculate femto observable and the mT with reconstructed information - if constexpr (mFemtoObs == femtoUniverseFemtoContainer::Observable::kstar) { - femtoObs = FemtoUniverseMath::getkstar(part1, mMassOne, part2, mMassTwo); + if constexpr (kFemtoObs == femto_universe_femto_container::Observable::kstar) { + femtoObs = FemtoUniverseMath::getkstar(part1, kMassOne, part2, kMassTwo); } - const float mT = FemtoUniverseMath::getmT(part1, mMassOne, part2, mMassTwo); + const float mT = FemtoUniverseMath::getmT(part1, kMassOne, part2, kMassTwo); - if (mHistogramRegistry) { - setPair_base(femtoObs, mT, part1, part2, mult, use3dplots); + if (kHistogramRegistry) { + setPairBase(femtoObs, mT, part1, part2, mult, use3dplots); if constexpr (isMC) { if (part1.has_fdMCParticle() && part2.has_fdMCParticle()) { // calculate the femto observable and the mT with MC truth information - if constexpr (mFemtoObs == femtoUniverseFemtoContainer::Observable::kstar) { - femtoObsMC = FemtoUniverseMath::getkstar(part1.fdMCParticle(), mMassOne, part2.fdMCParticle(), mMassTwo); + if constexpr (kFemtoObs == femto_universe_femto_container::Observable::kstar) { + femtoObsMC = FemtoUniverseMath::getkstar(part1.fdMCParticle(), kMassOne, part2.fdMCParticle(), kMassTwo); } - const float mTMC = FemtoUniverseMath::getmT(part1.fdMCParticle(), mMassOne, part2.fdMCParticle(), mMassTwo); + const float mTMC = FemtoUniverseMath::getmT(part1.fdMCParticle(), kMassOne, part2.fdMCParticle(), kMassTwo); - if (abs(part1.fdMCParticle().pdgMCTruth()) == abs(mPDGOne) && abs(part2.fdMCParticle().pdgMCTruth()) == abs(mPDGTwo)) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates - setPair_base(femtoObsMC, mTMC, part1.fdMCParticle(), part2.fdMCParticle(), mult, use3dplots); - setPair_MC(femtoObsMC, femtoObs, mT, mult); + if (std::abs(part1.fdMCParticle().pdgMCTruth()) == std::abs(kPDGOne) && std::abs(part2.fdMCParticle().pdgMCTruth()) == std::abs(kPDGTwo)) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates + setPairBase(femtoObsMC, mTMC, part1.fdMCParticle(), part2.fdMCParticle(), mult, use3dplots); + setPairMC(femtoObsMC, femtoObs, mT, mult); } else { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]) + HIST("/hFakePairsCounter"), 0); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]) + HIST("/hFakePairsCounter"), 0); } } else { - mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]) + HIST("/hNoMCtruthPairsCounter"), 0); + kHistogramRegistry->fill(HIST(kFolderSuffix[kEventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]) + HIST("/hNoMCtruthPairsCounter"), 0); } } } } protected: - HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output - static constexpr std::string_view mFolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to mEventType - static constexpr femtoUniverseFemtoContainer::Observable mFemtoObs = obs; ///< Femtoscopic observable to be computed (according to femtoUniverseFemtoContainer::Observable) - static constexpr int mEventType = eventType; ///< Type of the event (same/mixed, according to femtoUniverseFemtoContainer::EventType) - float mMassOne = 0.f; ///< PDG mass of particle 1 - float mMassTwo = 0.f; ///< PDG mass of particle 2 - int mPDGOne = 0; ///< PDG code of particle 1 - int mPDGTwo = 0; ///< PDG code of particle 2 + HistogramRegistry* kHistogramRegistry = nullptr; ///< For QA output + static constexpr std::string_view kFolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to kEventType + static constexpr femto_universe_femto_container::Observable kFemtoObs = obs; ///< Femtoscopic observable to be computed (according to femto_universe_femto_container::Observable) + static constexpr int kEventType = eventType; ///< Type of the event (same/mixed, according to femto_universe_femto_container::EventType) + float kMassOne = 0.f; ///< PDG mass of particle 1 + float kMassTwo = 0.f; ///< PDG mass of particle 2 + int kPDGOne = 0; ///< PDG code of particle 1 + int kPDGTwo = 0; ///< PDG code of particle 2 }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEFEMTOCONTAINER_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h index 957fe316eb7..556f075d819 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h @@ -19,7 +19,6 @@ #ifndef PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEMATH_H_ #define PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEMATH_H_ -#include #include #include @@ -28,7 +27,7 @@ #include "TLorentzVector.h" #include "TMath.h" -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { /// \class FemtoUniverseMath @@ -54,14 +53,14 @@ class FemtoUniverseMath const float betay = beta * std::sin(trackSum.Phi()) * std::sin(trackSum.Theta()); const float betaz = beta * std::cos(trackSum.Theta()); - ROOT::Math::PxPyPzMVector PartOneCMS(vecpart1); - ROOT::Math::PxPyPzMVector PartTwoCMS(vecpart2); + ROOT::Math::PxPyPzMVector partOneCMS(vecpart1); + ROOT::Math::PxPyPzMVector partTwoCMS(vecpart2); const ROOT::Math::Boost boostPRF = ROOT::Math::Boost(-betax, -betay, -betaz); - PartOneCMS = boostPRF(PartOneCMS); - PartTwoCMS = boostPRF(PartTwoCMS); + partOneCMS = boostPRF(partOneCMS); + partTwoCMS = boostPRF(partTwoCMS); - const ROOT::Math::PxPyPzMVector trackRelK = PartOneCMS - PartTwoCMS; + const ROOT::Math::PxPyPzMVector trackRelK = partOneCMS - partTwoCMS; return 0.5 * trackRelK.P(); } @@ -82,17 +81,17 @@ class FemtoUniverseMath const float betay = beta * std::sin(trackSum.Phi()) * std::sin(trackSum.Theta()); const float betaz = beta * std::cos(trackSum.Theta()); - ROOT::Math::PxPyPzMVector PartOneCMS(vecpart1); - ROOT::Math::PxPyPzMVector PartTwoCMS(vecpart2); + ROOT::Math::PxPyPzMVector partOneCMS(vecpart1); + ROOT::Math::PxPyPzMVector partTwoCMS(vecpart2); const ROOT::Math::Boost boostPRF = ROOT::Math::Boost(-betax, -betay, -betaz); - PartOneCMS = boostPRF(PartOneCMS); - PartTwoCMS = boostPRF(PartTwoCMS); + partOneCMS = boostPRF(partOneCMS); + partTwoCMS = boostPRF(partTwoCMS); - const ROOT::Math::PtEtaPhiMVector PartOneCMSGeo(PartOneCMS); - const ROOT::Math::PtEtaPhiMVector PartTwoCMSGeo(PartTwoCMS); + const ROOT::Math::PtEtaPhiMVector partOneCMSGeo(partOneCMS); + const ROOT::Math::PtEtaPhiMVector partTwoCMSGeo(partTwoCMS); - return (PartOneCMSGeo.Theta() - PartTwoCMSGeo.Theta()); + return (partOneCMSGeo.Theta() - partTwoCMSGeo.Theta()); } /// Compute the qij of a pair of particles @@ -128,21 +127,21 @@ class FemtoUniverseMath template static float getQ3(const T& part1, const float mass1, const T& part2, const float mass2, const T& part3, const float mass3) { - float E1 = sqrt(pow(part1.px(), 2) + pow(part1.py(), 2) + pow(part1.pz(), 2) + pow(mass1, 2)); - float E2 = sqrt(pow(part2.px(), 2) + pow(part2.py(), 2) + pow(part2.pz(), 2) + pow(mass2, 2)); - float E3 = sqrt(pow(part3.px(), 2) + pow(part3.py(), 2) + pow(part3.pz(), 2) + pow(mass3, 2)); + float e1 = std::sqrt(std::pow(part1.px(), 2) + std::pow(part1.py(), 2) + std::pow(part1.pz(), 2) + std::pow(mass1, 2)); + float e2 = std::sqrt(std::pow(part2.px(), 2) + std::pow(part2.py(), 2) + std::pow(part2.pz(), 2) + std::pow(mass2, 2)); + float e3 = std::sqrt(std::pow(part3.px(), 2) + std::pow(part3.py(), 2) + std::pow(part3.pz(), 2) + std::pow(mass3, 2)); - const ROOT::Math::PxPyPzEVector vecpart1(part1.px(), part1.py(), part1.pz(), E1); - const ROOT::Math::PxPyPzEVector vecpart2(part2.px(), part2.py(), part2.pz(), E2); - const ROOT::Math::PxPyPzEVector vecpart3(part3.px(), part3.py(), part3.pz(), E3); + const ROOT::Math::PxPyPzEVector vecpart1(part1.px(), part1.py(), part1.pz(), e1); + const ROOT::Math::PxPyPzEVector vecpart2(part2.px(), part2.py(), part2.pz(), e2); + const ROOT::Math::PxPyPzEVector vecpart3(part3.px(), part3.py(), part3.pz(), e3); ROOT::Math::PxPyPzEVector q12 = getqij(vecpart1, vecpart2); ROOT::Math::PxPyPzEVector q23 = getqij(vecpart2, vecpart3); ROOT::Math::PxPyPzEVector q31 = getqij(vecpart3, vecpart1); - float Q32 = q12.M2() + q23.M2() + q31.M2(); + float q32 = q12.M2() + q23.M2() + q31.M2(); - return sqrt(-Q32); + return std::sqrt(-q32); } /// Compute the transverse momentum of a pair of particles @@ -182,11 +181,11 @@ class FemtoUniverseMath template static std::vector newpairfunc(const T& part1, const float mass1, const T& part2, const float mass2, bool isiden) { - const double E1 = sqrt(pow(part1.px(), 2) + pow(part1.py(), 2) + pow(part1.pz(), 2) + pow(mass1, 2)); - const double E2 = sqrt(pow(part2.px(), 2) + pow(part2.py(), 2) + pow(part2.pz(), 2) + pow(mass2, 2)); + const double e1 = std::sqrt(std::pow(part1.px(), 2) + std::pow(part1.py(), 2) + std::pow(part1.pz(), 2) + std::pow(mass1, 2)); + const double e2 = std::sqrt(std::pow(part2.px(), 2) + std::pow(part2.py(), 2) + std::pow(part2.pz(), 2) + std::pow(mass2, 2)); - const ROOT::Math::PxPyPzEVector vecpart1(part1.px(), part1.py(), part1.pz(), E1); - const ROOT::Math::PxPyPzEVector vecpart2(part2.px(), part2.py(), part2.pz(), E2); + const ROOT::Math::PxPyPzEVector vecpart1(part1.px(), part1.py(), part1.pz(), e1); + const ROOT::Math::PxPyPzEVector vecpart2(part2.px(), part2.py(), part2.pz(), e2); const ROOT::Math::PxPyPzEVector trackSum = vecpart1 + vecpart2; std::vector vect; @@ -198,9 +197,9 @@ class FemtoUniverseMath const double tPtSq = (tPx * tPx + tPy * tPy); const double tMtSq = (tE * tE - tPz * tPz); - const double tM = sqrt(tMtSq - tPtSq); - const double tMt = sqrt(tMtSq); - const double tPt = sqrt(tPtSq); + const double tM = std::sqrt(tMtSq - tPtSq); + const double tMt = std::sqrt(tMtSq); + const double tPt = std::sqrt(tPtSq); // Boost to LCMS @@ -209,8 +208,8 @@ class FemtoUniverseMath const double fDKOut = (part1.px() * tPx + part1.py() * tPy) / tPt; const double fDKSide = (-part1.px() * tPy + part1.py() * tPx) / tPt; - const double fDKLong = gamma * (part1.pz() - beta * E1); - const double fDE = gamma * (E1 - beta * part1.pz()); + const double fDKLong = gamma * (part1.pz() - beta * e1); + const double fDE = gamma * (e1 - beta * part1.pz()); const double px1LCMS = fDKOut; const double py1LCMS = fDKSide; @@ -219,8 +218,8 @@ class FemtoUniverseMath const double px2LCMS = (part2.px() * tPx + part2.py() * tPy) / tPt; const double py2LCMS = (part2.py() * tPx - part2.px() * tPy) / tPt; - const double pz2LCMS = gamma * (part2.pz() - beta * E2); - const double pE2LCMS = gamma * (E2 - beta * part2.pz()); + const double pz2LCMS = gamma * (part2.pz() - beta * e2); + const double pE2LCMS = gamma * (e2 - beta * part2.pz()); const double fDKOutLCMS = px1LCMS - px2LCMS; const double fDKSideLCMS = py1LCMS - py2LCMS; @@ -236,9 +235,9 @@ class FemtoUniverseMath const double fDKLongPRF = fDKLongLCMS; const double fKOut = gammaOut * (fDKOut - betaOut * fDE); - const double qlcms = sqrt(fDKOutLCMS * fDKOutLCMS + fDKSideLCMS * fDKSideLCMS + fDKLongLCMS * fDKLongLCMS); - const double qinv = sqrt(fDKOutPRF * fDKOutPRF + fDKSidePRF * fDKSidePRF + fDKLongPRF * fDKLongPRF); - const double kstar = sqrt(fKOut * fKOut + fDKSide * fDKSide + fDKLong * fDKLong); + const double qlcms = std::sqrt(fDKOutLCMS * fDKOutLCMS + fDKSideLCMS * fDKSideLCMS + fDKLongLCMS * fDKLongLCMS); + const double qinv = std::sqrt(fDKOutPRF * fDKOutPRF + fDKSidePRF * fDKSidePRF + fDKLongPRF * fDKLongPRF); + const double kstar = std::sqrt(fKOut * fKOut + fDKSide * fDKSide + fDKLong * fDKLong); if (isiden) { vect.push_back(qinv); @@ -256,6 +255,6 @@ class FemtoUniverseMath } }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEMATH_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseObjectSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseObjectSelection.h index acf802c161e..18281ac198b 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseObjectSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseObjectSelection.h @@ -31,7 +31,7 @@ using namespace o2::framework; namespace o2::analysis { -namespace femtoUniverse +namespace femto_universe { /// \class FemtoUniverseObjectSelection @@ -67,7 +67,7 @@ class FemtoUniverseObjectSelection /// \param selVar Variable to be employed for the selection /// \param selType Type of the selection to be employed template - void setSelection(T& selVals, selVariable selVar, femtoUniverseSelection::SelectionType selType) + void setSelection(T& selVals, selVariable selVar, femto_universe_selection::SelectionType selType) { std::vector tmpSelVals = selVals; // necessary due to some features of the Configurable std::vector> tempVec; @@ -83,15 +83,15 @@ class FemtoUniverseObjectSelection { /// First the selection is sorted so that the most open cuts are conducted first switch (sels.at(0).getSelectionType()) { - case (femtoUniverseSelection::SelectionType::kUpperLimit): - case (femtoUniverseSelection::SelectionType::kAbsUpperLimit): + case (femto_universe_selection::SelectionType::kUpperLimit): + case (femto_universe_selection::SelectionType::kAbsUpperLimit): std::sort(sels.begin(), sels.end(), [](FemtoUniverseSelection a, FemtoUniverseSelection b) { return a.getSelectionValue() > b.getSelectionValue(); }); break; - case (femtoUniverseSelection::SelectionType::kLowerLimit): - case (femtoUniverseSelection::SelectionType::kAbsLowerLimit): - case (femtoUniverseSelection::SelectionType::kEqual): + case (femto_universe_selection::SelectionType::kLowerLimit): + case (femto_universe_selection::SelectionType::kAbsLowerLimit): + case (femto_universe_selection::SelectionType::kEqual): std::sort(sels.begin(), sels.end(), [](FemtoUniverseSelection a, FemtoUniverseSelection b) { return a.getSelectionValue() < b.getSelectionValue(); }); @@ -108,17 +108,17 @@ class FemtoUniverseObjectSelection /// \param selVar Selection variable under consideration /// \param selType Type of the selection variable /// \return The most open selection of the selection variable given to the class - selValDataType getMinimalSelection(selVariable selVar, femtoUniverseSelection::SelectionType selType) + selValDataType getMinimalSelection(selVariable selVar, femto_universe_selection::SelectionType selType) { selValDataType minimalSel{}; switch (selType) { - case (femtoUniverseSelection::SelectionType::kUpperLimit): - case (femtoUniverseSelection::SelectionType::kAbsUpperLimit): + case (femto_universe_selection::SelectionType::kUpperLimit): + case (femto_universe_selection::SelectionType::kAbsUpperLimit): minimalSel = -999.e9; break; - case (femtoUniverseSelection::SelectionType::kLowerLimit): - case (femtoUniverseSelection::SelectionType::kAbsLowerLimit): - case (femtoUniverseSelection::SelectionType::kEqual): + case (femto_universe_selection::SelectionType::kLowerLimit): + case (femto_universe_selection::SelectionType::kAbsLowerLimit): + case (femto_universe_selection::SelectionType::kEqual): minimalSel = 999.e9; break; } @@ -126,15 +126,15 @@ class FemtoUniverseObjectSelection for (auto sel : mSelections) { if (sel.getSelectionVariable() == selVar) { switch (sel.getSelectionType()) { - case (femtoUniverseSelection::SelectionType::kUpperLimit): - case (femtoUniverseSelection::SelectionType::kAbsUpperLimit): + case (femto_universe_selection::SelectionType::kUpperLimit): + case (femto_universe_selection::SelectionType::kAbsUpperLimit): if (minimalSel < sel.getSelectionValue()) { minimalSel = sel.getSelectionValue(); } break; - case (femtoUniverseSelection::SelectionType::kLowerLimit): - case (femtoUniverseSelection::SelectionType::kAbsLowerLimit): - case (femtoUniverseSelection::SelectionType::kEqual): + case (femto_universe_selection::SelectionType::kLowerLimit): + case (femto_universe_selection::SelectionType::kAbsLowerLimit): + case (femto_universe_selection::SelectionType::kEqual): if (minimalSel > sel.getSelectionValue()) { minimalSel = sel.getSelectionValue(); } @@ -193,7 +193,7 @@ class FemtoUniverseObjectSelection std::vector> mSelections; ///< Vector containing all selections }; -} // namespace femtoUniverse +} // namespace femto_universe } // namespace o2::analysis #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEOBJECTSELECTION_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniversePairAngularWithCentMultKt.h b/PWGCF/FemtoUniverse/Core/FemtoUniversePairAngularWithCentMultKt.h index cc017bf192e..31b256f43f7 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniversePairAngularWithCentMultKt.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniversePairAngularWithCentMultKt.h @@ -8,26 +8,25 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file FemtoUniversePairAngularWithCentMultKt.h +/// \brief FemtoUniversePairAngularWithCentMultKt - Histogram class for angular pair tracks with centrality and multiplicity /// \author Deependra Sharma, IITB, deependra.sharma@cern.ch /// \author Alicja Płachta, WUT Warsaw, alicja.plachta.stud@pw.edu.pl +/// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch #ifndef PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEPAIRANGULARWITHCENTMULTKT_H_ #define PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEPAIRANGULARWITHCENTMULTKT_H_ #include -#include #include #include "Framework/HistogramRegistry.h" -using namespace o2; -using namespace o2::framework; - -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { -class PairWithCentMultKt +class FemtoUniversePairAngularWithCentMultKt { public: - virtual ~PairWithCentMultKt() = default; + virtual ~FemtoUniversePairAngularWithCentMultKt() = default; /// @brief /// @tparam t1 /// @param registry @@ -36,46 +35,46 @@ class PairWithCentMultKt template void init(HistogramRegistry* registry, t1& /*kstarbins*/, t1& centmultbins, t2& phiBins, t2& etaBins, bool processKT) { - PairWithCentMultKtRegistry = registry; + pairWithCentMultKtRegistry = registry; // AxisSpec kstarAxis = {kstarbins, "#it{k*} (GeV/#it{c})"}; - mPhiLow = (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; - mPhiHigh = 2 * o2::constants::math::PI + (-static_cast(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins; - framework::AxisSpec phiAxis = {phiBins, mPhiLow, mPhiHigh}; + kPhiLow = (-static_cast(phiBins / 4) + 0.5) * o2::constants::math::TwoPI / phiBins; + kPhiHigh = o2::constants::math::TwoPI + (-static_cast(phiBins / 4) + 0.5) * o2::constants::math::TwoPI / phiBins; + framework::AxisSpec phiAxis = {phiBins, kPhiLow, kPhiHigh}; framework::AxisSpec etaAxis = {etaBins, -2.0, 2.0}; - CentMultBins = centmultbins; - KtBins = {0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0f, 2.0f, 99999.f}; // temporary - KtBins.erase(KtBins.begin()); - CentMultBins.erase(CentMultBins.begin()); - UseKt = processKT; + kCentMultBins = centmultbins; + ktBins = {0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0f, 2.0f, 99999.f}; // temporary + ktBins.erase(ktBins.begin()); + kCentMultBins.erase(kCentMultBins.begin()); + useKt = processKT; - for (int i = 0; i < static_cast(CentMultBins.size() - 1); i++) { - int lowBin = static_cast((CentMultBins[i])); - int highBin = static_cast((CentMultBins[i + 1])); - std::string HistTitle = "mult_" + std::to_string(lowBin) + "-" + std::to_string(highBin); - std::string HistSuffix1 = static_cast(HistSuffix[i]); - std::string HistSuffix2 = static_cast(HistSuffix[i + 1]); - std::string HistFolderMult = "mult_" + HistSuffix1 + "_" + HistSuffix2; - std::string HistName = HistFolderMult + "/DeltaEtaDeltaPhi"; - PairWithCentMultKtRegistry->add(HistName.c_str(), HistTitle.c_str(), HistType::kTH2F, {phiAxis, etaAxis}); - if (UseKt) { - for (int i = 0; i < static_cast(KtBins.size() - 1); i++) { - std::string kt_bin1_string = std::to_string(KtBins[i]); - std::replace(kt_bin1_string.begin(), kt_bin1_string.end(), '.', '_'); - std::string kt_bin2_string = std::to_string(KtBins[i + 1]); - std::replace(kt_bin2_string.begin(), kt_bin2_string.end(), '.', '_'); - kt_bin1_string.resize(4); - kt_bin2_string.resize(4); - std::string HistTitleKt = "kt_" + kt_bin1_string + "-" + kt_bin2_string; - std::string HistSuffix1Kt = static_cast(HistSuffix[i]); - std::string HistSuffix2Kt = static_cast(HistSuffix[i + 1]); - std::string HistNameKt = HistFolderMult + "/DeltaEtaDeltaPhi" + HistSuffix1Kt + "_" + HistSuffix2Kt; - PairWithCentMultKtRegistry->add(HistNameKt.c_str(), HistTitleKt.c_str(), HistType::kTH2F, {phiAxis, etaAxis}); + for (int i = 0; i < static_cast(kCentMultBins.size() - 1); i++) { + int lowBin = static_cast((kCentMultBins[i])); + int highBin = static_cast((kCentMultBins[i + 1])); + std::string kHistTitle = "mult_" + std::to_string(lowBin) + "-" + std::to_string(highBin); + std::string kHistSuffix1 = static_cast(HistSuffix[i]); + std::string kHistSuffix2 = static_cast(HistSuffix[i + 1]); + std::string kHistFolderMult = "mult_" + kHistSuffix1 + "_" + kHistSuffix2; + std::string kHistName = kHistFolderMult + "/DeltaEtaDeltaPhi"; + pairWithCentMultKtRegistry->add(kHistName.c_str(), kHistTitle.c_str(), HistType::kTH2F, {phiAxis, etaAxis}); + if (useKt) { + for (int i = 0; i < static_cast(ktBins.size() - 1); i++) { + std::string ktBin1String = std::to_string(ktBins[i]); + std::replace(ktBin1String.begin(), ktBin1String.end(), '.', '_'); + std::string ktBin2String = std::to_string(ktBins[i + 1]); + std::replace(ktBin2String.begin(), ktBin2String.end(), '.', '_'); + ktBin1String.resize(4); + ktBin2String.resize(4); + std::string kHistTitleKt = "kt_" + ktBin1String + "-" + ktBin2String; + std::string kHistSuffix1Kt = static_cast(HistSuffix[i]); + std::string kHistSuffix2Kt = static_cast(HistSuffix[i + 1]); + std::string kHistNameKt = kHistFolderMult + "/DeltaEtaDeltaPhi" + kHistSuffix1Kt + "_" + kHistSuffix2Kt; + pairWithCentMultKtRegistry->add(kHistNameKt.c_str(), kHistTitleKt.c_str(), HistType::kTH2F, {phiAxis, etaAxis}); } } } - PairWithCentMultKtRegistry->add("Beyond_Max", "Beyond_Max", HistType::kTH2F, {phiAxis, etaAxis}); + pairWithCentMultKtRegistry->add("Beyond_Max", "Beyond_Max", HistType::kTH2F, {phiAxis, etaAxis}); } /// @brief @@ -86,59 +85,59 @@ class PairWithCentMultKt void fill(t1 kstar_value, t1 cent_mult_value, t1 d_phi_value, t1 d_eta_value) { - if (cent_mult_value > CentMultBins[CentMultBins.size() - 1] || cent_mult_value < CentMultBins[0]) { - PairWithCentMultKtRegistry->fill(HIST("Beyond_Max"), kstar_value); - } else if (cent_mult_value <= CentMultBins[1]) { - PairWithCentMultKtRegistry->fill(HIST("mult_0_1/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); - if (UseKt) { + if (cent_mult_value > kCentMultBins[kCentMultBins.size() - 1] || cent_mult_value < kCentMultBins[0]) { + pairWithCentMultKtRegistry->fill(HIST("Beyond_Max"), kstar_value); + } else if (cent_mult_value <= kCentMultBins[1]) { + pairWithCentMultKtRegistry->fill(HIST("mult_0_1/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); + if (useKt) { // auto histMultFolder = HIST("mult_0_1/"); // fill_kT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value <= CentMultBins[2]) { - PairWithCentMultKtRegistry->fill(HIST("mult_1_2/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); - if (UseKt) { + } else if (cent_mult_value <= kCentMultBins[2]) { + pairWithCentMultKtRegistry->fill(HIST("mult_1_2/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); + if (useKt) { // auto histMultFolder = HIST("mult_1_2/"); // fill_kT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value <= CentMultBins[3]) { - PairWithCentMultKtRegistry->fill(HIST("mult_2_3/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); - if (UseKt) { + } else if (cent_mult_value <= kCentMultBins[3]) { + pairWithCentMultKtRegistry->fill(HIST("mult_2_3/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); + if (useKt) { // auto histMultFolder = HIST("mult_2_3/"); // fill_kT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value <= CentMultBins[4]) { - PairWithCentMultKtRegistry->fill(HIST("mult_3_4/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); - if (UseKt) { + } else if (cent_mult_value <= kCentMultBins[4]) { + pairWithCentMultKtRegistry->fill(HIST("mult_3_4/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); + if (useKt) { // auto histMultFolder = HIST("mult_3_4/"); // fill_kT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value <= CentMultBins[5]) { - PairWithCentMultKtRegistry->fill(HIST("mult_4_5/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); - if (UseKt) { + } else if (cent_mult_value <= kCentMultBins[5]) { + pairWithCentMultKtRegistry->fill(HIST("mult_4_5/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); + if (useKt) { // auto histMultFolder = HIST("mult_4_5/"); // fill_kT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value <= CentMultBins[6]) { - PairWithCentMultKtRegistry->fill(HIST("mult_5_6/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); - if (UseKt) { + } else if (cent_mult_value <= kCentMultBins[6]) { + pairWithCentMultKtRegistry->fill(HIST("mult_5_6/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); + if (useKt) { // auto histMultFolder = HIST("mult_5_6/"); // fill_kT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value <= CentMultBins[7]) { - PairWithCentMultKtRegistry->fill(HIST("mult_6_7/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); - if (UseKt) { + } else if (cent_mult_value <= kCentMultBins[7]) { + pairWithCentMultKtRegistry->fill(HIST("mult_6_7/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); + if (useKt) { // auto histMultFolder = HIST("mult_6_7/"); // fill_kT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value <= CentMultBins[8]) { - PairWithCentMultKtRegistry->fill(HIST("mult_7_8/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); - if (UseKt) { + } else if (cent_mult_value <= kCentMultBins[8]) { + pairWithCentMultKtRegistry->fill(HIST("mult_7_8/DeltaEtaDeltaPhi"), d_phi_value, d_eta_value); + if (useKt) { // auto histMultFolder = HIST("mult_7_8/"); // fill_kT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value <= CentMultBins[9]) { - PairWithCentMultKtRegistry->fill(HIST("mult_8_9/kstar"), d_phi_value, d_eta_value); - if (UseKt) { + } else if (cent_mult_value <= kCentMultBins[9]) { + pairWithCentMultKtRegistry->fill(HIST("mult_8_9/kstar"), d_phi_value, d_eta_value); + if (useKt) { // auto histMultFolder = HIST("mult_8_9/"); // fill_kT(kstar_value, kt_value, histMultFolder); } @@ -154,38 +153,38 @@ class PairWithCentMultKt // template // void fill_kT(t1 kstar_value, t1 kt_value, t2 folder) // { - // if (kt_value <= KtBins[1]) { - // PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_0_1"), kstar_value); - // } else if (kt_value <= KtBins[2]) { - // PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_1_2"), kstar_value); - // } else if (kt_value <= KtBins[3]) { - // PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_2_3"), kstar_value); - // } else if (kt_value <= KtBins[4]) { - // PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_3_4"), kstar_value); - // } else if (kt_value <= KtBins[5]) { - // PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_4_5"), kstar_value); - // } else if (kt_value <= KtBins[6]) { - // PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_5_6"), kstar_value); - // } else if (kt_value <= KtBins[7]) { - // PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_6_7"), kstar_value); - // } else if (kt_value <= KtBins[8]) { - // PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_7_8"), kstar_value); - // } else if (kt_value <= KtBins[9]) { - // PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_8_9"), kstar_value); + // if (kt_value <= ktBins[1]) { + // pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_0_1"), kstar_value); + // } else if (kt_value <= ktBins[2]) { + // pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_1_2"), kstar_value); + // } else if (kt_value <= ktBins[3]) { + // pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_2_3"), kstar_value); + // } else if (kt_value <= ktBins[4]) { + // pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_3_4"), kstar_value); + // } else if (kt_value <= ktBins[5]) { + // pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_4_5"), kstar_value); + // } else if (kt_value <= ktBins[6]) { + // pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_5_6"), kstar_value); + // } else if (kt_value <= ktBins[7]) { + // pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_6_7"), kstar_value); + // } else if (kt_value <= ktBins[8]) { + // pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_7_8"), kstar_value); + // } else if (kt_value <= ktBins[9]) { + // pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_8_9"), kstar_value); // } // } protected: - HistogramRegistry* PairWithCentMultKtRegistry = nullptr; - std::vector CentMultBins; - std::vector KtBins; - bool UseKt = false; - double mPhiLow; - double mPhiHigh; - double delta_eta; - double delta_phi; + HistogramRegistry* pairWithCentMultKtRegistry = nullptr; + std::vector kCentMultBins; + std::vector ktBins; + bool useKt = false; + double kPhiLow; + double kPhiHigh; + double deltaEta; + double deltaPhi; static constexpr std::string_view HistSuffix[10] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}; }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEPAIRANGULARWITHCENTMULTKT_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h b/PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h index 29b8368f392..0a94c2c5a0c 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h @@ -21,9 +21,7 @@ #include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" #include "Framework/HistogramRegistry.h" -using namespace o2::framework; - -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { /// \class FemtoUniversePairCleaner @@ -57,21 +55,21 @@ class FemtoUniversePairCleaner template bool isCleanPair(Part const& part1, Part const& part2, Parts const& particles) { - if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kTrack) { + if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kTrack) { /// Track-Track combination if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack) { LOG(fatal) << "FemtoUniversePairCleaner: passed arguments don't agree with FemtoUniversePairCleaner instantiation! Please provide kTrack,kTrack candidates."; return false; } return part1.globalIndex() != part2.globalIndex(); - } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) { + } else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) { /// Track-Track combination if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) { LOG(fatal) << "FemtoUniversePairCleaner: passed arguments don't agree with FemtoUniversePairCleaner instantiation! Please provide kMCTruthTrack,kMCTruthTrack candidates."; return false; } return part1.globalIndex() != part2.globalIndex(); - } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { + } else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { /// Track-V0 combination part1 is hadron and part2 is v0 if (part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0) { LOG(fatal) << "FemtoUniversePairCleaner: passed arguments don't agree with FemtoUniversePairCleaner instantiation! Please provide second argument kV0 candidate."; @@ -84,7 +82,7 @@ class FemtoUniversePairCleaner return false; } return part1.globalIndex() != part2.globalIndex(); - } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kV0 && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { + } else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kV0 && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { /// V0-V0 combination both part1 and part2 are v0 if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0 || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kV0) { LOG(fatal) << "FemtoUniversePairCleaner: passed arguments don't agree with FemtoUniversePairCleaner instantiation! Please provide first and second arguments kV0 candidate."; @@ -100,7 +98,7 @@ class FemtoUniversePairCleaner return false; } return part1.globalIndex() != part2.globalIndex(); - } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kCascade) { + } else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kCascade) { /// Track-Cascade combination part1 is hadron and part2 is cascade if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kCascade) { LOG(fatal) << "FemtoUniversePairCleaner: passed arguments don't agree with FemtoUniversePairCleaner instantiation! Please provide first argument kTrack candidate and second argument kCascade candidate."; @@ -114,7 +112,7 @@ class FemtoUniversePairCleaner return false; } return part1.globalIndex() != part2.globalIndex(); - } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) { + } else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) { /// Track-D0 combination part1 is hadron and part2 is D0 if (part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kD0) { LOG(fatal) << "FemtoUniversePairCleaner: passed arguments don't agree with FemtoUniversePairCleaner instantiation! Please provide second argument kD0 candidate."; @@ -128,7 +126,7 @@ class FemtoUniversePairCleaner return true; } return false; - } else if constexpr (mPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kPhi) { + } else if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kPhi) { /// Track-Phi combination part1 is Phi and part 2 is hadron if (part1.partType() != o2::aod::femtouniverseparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtouniverseparticle::ParticleType::kPhi) { LOG(fatal) << "FemtoUniversePairCleaner: passed arguments don't agree with FemtoUniversePairCleaner instantiation! Please provide second argument kPhi candidate."; @@ -151,9 +149,9 @@ class FemtoUniversePairCleaner private: HistogramRegistry* mHistogramRegistry; ///< For QA output - static constexpr o2::aod::femtouniverseparticle::ParticleType mPartOneType = partOne; ///< Type of particle 1 - static constexpr o2::aod::femtouniverseparticle::ParticleType mPartTwoType = partTwo; ///< Type of particle 2 + static constexpr o2::aod::femtouniverseparticle::ParticleType kPartOneType = partOne; ///< Type of particle 1 + static constexpr o2::aod::femtouniverseparticle::ParticleType kPartTwoType = partTwo; ///< Type of particle 2 }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEPAIRCLEANER_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniversePairSHCentMultKt.h b/PWGCF/FemtoUniverse/Core/FemtoUniversePairSHCentMultKt.h index 771b1aed1ab..50885a02523 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniversePairSHCentMultKt.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniversePairSHCentMultKt.h @@ -22,10 +22,7 @@ #include #include "Framework/HistogramRegistry.h" -using namespace o2; -using namespace o2::framework; - -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { /// \class FemtoUniversePairSHCentMultKt @@ -34,8 +31,8 @@ namespace o2::analysis::femtoUniverse /// the correlation function are filled according to the specified observable /// \tparam eventType Type of the event (same/mixed) /// \tparam obs Observable to be computed (k*/Q_inv/...) -template +template class PairSHCentMultKt { public: @@ -51,21 +48,21 @@ class PairSHCentMultKt void init(HistogramRegistry* registry, t1& kstarbins, t1& centmultbins, t1& ktbins, int /*maxl*/) { - PairSHCentMultKtRegistry = registry; + pairSHCentMultKtRegistry = registry; AxisSpec kstarAxis = {kstarbins, "#it{k*} (GeV/#it{c})"}; - KStarBins = kstarbins; + kStarBins = kstarbins; - CentMultBins = centmultbins; - KtBins = ktbins; - KtBins.erase(KtBins.begin()); - CentMultBins.erase(CentMultBins.begin()); + centMultBins = centmultbins; + ktBins = ktbins; + ktBins.erase(ktBins.begin()); + centMultBins.erase(centMultBins.begin()); std::string femtoObs1D; - std::vector fels(fMaxJM); - std::vector fems(fMaxJM); - std::vector felsi(fMaxJM); - std::vector femsi(fMaxJM); + std::vector fels(kMaxJM); + std::vector fems(kMaxJM); + std::vector felsi(kMaxJM); + std::vector femsi(kMaxJM); // Fill in els and ems table int el = 0; @@ -83,128 +80,105 @@ class PairSHCentMultKt el++; em = -el; } - } while (el <= fMaxL); + } while (el <= kMaxL); femtoObs1D = "#it{q} (GeV/#it{c})"; framework::AxisSpec femtoObsAxis1D = {kstarbins, femtoObs1D.c_str()}; - for (int i = 0; i < static_cast(CentMultBins.size() - 1); i++) { - int lowBin = static_cast((CentMultBins[i])); - int highBin = static_cast((CentMultBins[i + 1])); - - std::string HistTitle = - "mult_" + std::to_string(lowBin) + "-" + std::to_string(highBin); - std::string HistSuffix1 = - std::to_string(static_cast(CentMultBins[i])); - std::string HistSuffix2 = - std::to_string(static_cast(CentMultBins[i + 1])); - std::string HistFolderMult = "mult_" + HistSuffix1 + "_" + HistSuffix2; - - for (int j = 0; j < static_cast(KtBins.size() - 1); j++) { - int ktlowBin = static_cast(KtBins[j]); - int kthighBin = static_cast(KtBins[j + 1]); - - std::string HistTitlekT = - "kT_" + std::to_string(ktlowBin) + "-" + std::to_string(kthighBin); - std::string HistSuffixkT1 = - std::to_string(static_cast(KtBins[j] * 100.0)); - std::string HistSuffixkT2 = - std::to_string(static_cast(KtBins[j + 1] * 100.0)); - std::string HistFolderkT = "kT_" + HistSuffixkT1 + "_" + HistSuffixkT2; + for (int i = 0; i < static_cast(centMultBins.size() - 1); i++) { + int lowBin = static_cast((centMultBins[i])); + int highBin = static_cast((centMultBins[i + 1])); + + std::string histTitle = "mult_" + std::to_string(lowBin) + "-" + std::to_string(highBin); + std::string histSuffix1 = std::to_string(static_cast(centMultBins[i])); + std::string histSuffix2 = std::to_string(static_cast(centMultBins[i + 1])); + std::string histFolderMult = "mult_" + histSuffix1 + "_" + histSuffix2; + + for (int j = 0; j < static_cast(ktBins.size() - 1); j++) { + int ktlowBin = static_cast(ktBins[j]); + int kthighBin = static_cast(ktBins[j + 1]); + + std::string histTitlekT = "kT_" + std::to_string(ktlowBin) + "-" + std::to_string(kthighBin); + std::string histSuffixkT1 = std::to_string(static_cast(ktBins[j] * 100.0)); + std::string histSuffixkT2 = std::to_string(static_cast(ktBins[j + 1] * 100.0)); + std::string histFolderkT = "kT_" + histSuffixkT1 + "_" + histSuffixkT2; std::string suffix; - fbinctn[i][j] = new TH1D( - TString("BinCountNum"), "Bin Occupation (Numerator)", - static_cast(KStarBins[0]), KStarBins[1], KStarBins[2]); - fbinctd[i][j] = new TH1D( - TString("BinCountDen"), "Bin Occupation (Denominator)", - static_cast(KStarBins[0]), KStarBins[1], KStarBins[2]); - - for (int ihist = 0; ihist < fMaxJM; ihist++) { + fbinctn[i][j] = new TH1D(TString("BinCountNum"), "Bin Occupation (Numerator)", static_cast(kStarBins[0]), kStarBins[1], kStarBins[2]); + fbinctd[i][j] = new TH1D(TString("BinCountDen"), "Bin Occupation (Denominator)", static_cast(kStarBins[0]), kStarBins[1], kStarBins[2]); + + for (int ihist = 0; ihist < kMaxJM; ihist++) { if (femsi[ihist] < 0) { suffix = "Ylm" + std::to_string(felsi[ihist]) + std::to_string(felsi[ihist] - femsi[ihist]); } else { - suffix = "Ylm" + std::to_string(felsi[ihist]) + - std::to_string(femsi[ihist]); + suffix = "Ylm" + std::to_string(felsi[ihist]) + std::to_string(femsi[ihist]); } - if (mFolderSuffix[mEventType] == mFolderSuffix[0]) { - fnumsreal[i][j][ihist] = PairSHCentMultKtRegistry->add( - (HistFolderMult + "/" + HistFolderkT + "/" + "NumRe" + suffix) - .c_str(), - ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, - {femtoObsAxis1D}); - fnumsimag[i][j][ihist] = PairSHCentMultKtRegistry->add( - (HistFolderMult + "/" + HistFolderkT + "/" + "NumIm" + suffix) - .c_str(), - ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, - {femtoObsAxis1D}); + if (FolderSuffix[EventType] == FolderSuffix[0]) { + fnumsreal[i][j][ihist] = pairSHCentMultKtRegistry->add( + (histFolderMult + "/" + histFolderkT + "/" + "NumRe" + suffix).c_str(), + ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, {femtoObsAxis1D}); + fnumsimag[i][j][ihist] = pairSHCentMultKtRegistry->add( + (histFolderMult + "/" + histFolderkT + "/" + "NumIm" + suffix).c_str(), + ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, {femtoObsAxis1D}); } else { - fdensreal[i][j][ihist] = PairSHCentMultKtRegistry->add( - (HistFolderMult + "/" + HistFolderkT + "/" + "DenRe" + suffix) - .c_str(), - ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, - {femtoObsAxis1D}); - fdensimag[i][j][ihist] = PairSHCentMultKtRegistry->add( - (HistFolderMult + "/" + HistFolderkT + "/" + "DenIm" + suffix) - .c_str(), - ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, - {femtoObsAxis1D}); + fdensreal[i][j][ihist] = pairSHCentMultKtRegistry->add( + (histFolderMult + "/" + histFolderkT + "/" + "DenRe" + suffix).c_str(), + ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, {femtoObsAxis1D}); + fdensimag[i][j][ihist] = pairSHCentMultKtRegistry->add( + (histFolderMult + "/" + histFolderkT + "/" + "DenIm" + suffix).c_str(), + ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, {femtoObsAxis1D}); } } - if (mFolderSuffix[mEventType] == mFolderSuffix[0]) { + if (FolderSuffix[EventType] == FolderSuffix[0]) { std::string bufnameNum = "CovNum"; - fcovnum[i][j] = PairSHCentMultKtRegistry->add( - (HistFolderMult + "/" + HistFolderkT + "/" + bufnameNum).c_str(), - "; x; y; z", kTH3D, - {{kstarbins}, - {(fMaxJM * 2), -0.5, ((static_cast(fMaxJM) * 2.0 - 0.5))}, - {(fMaxJM * 2), -0.5, - ((static_cast(fMaxJM) * 2.0 - 0.5))}}); - } else if (mFolderSuffix[mEventType] == mFolderSuffix[1]) { + fcovnum[i][j] = pairSHCentMultKtRegistry->add((histFolderMult + "/" + histFolderkT + "/" + bufnameNum).c_str(), "; x; y; z", kTH3D, + {{kstarbins}, + {(kMaxJM * 2), -0.5, ((static_cast(kMaxJM) * 2.0 - 0.5))}, + {(kMaxJM * 2), -0.5, + ((static_cast(kMaxJM) * 2.0 - 0.5))}}); + } else if (FolderSuffix[EventType] == FolderSuffix[1]) { std::string bufnameDen = "CovDen"; - fcovden[i][j] = PairSHCentMultKtRegistry->add( - (HistFolderMult + "/" + HistFolderkT + "/" + bufnameDen).c_str(), - "; x; y; z", kTH3D, - {{kstarbins}, - {(fMaxJM * 2), -0.5, ((static_cast(fMaxJM) * 2.0 - 0.5))}, - {(fMaxJM * 2), -0.5, - ((static_cast(fMaxJM) * 2.0 - 0.5))}}); + fcovden[i][j] = pairSHCentMultKtRegistry->add((histFolderMult + "/" + histFolderkT + "/" + bufnameDen).c_str(), "; x; y; z", kTH3D, + {{kstarbins}, + {(kMaxJM * 2), -0.5, ((static_cast(kMaxJM) * 2.0 - 0.5))}, + {(kMaxJM * 2), -0.5, + ((static_cast(kMaxJM) * 2.0 - 0.5))}}); } } } } /// Templated function to access different multiplicity directory and call - /// fill_kT_NumDen \param part1 particle 1 \param part2 particle 2 \param + /// fillkTNumDen \param part1 particle 1 \param part2 particle 2 \param /// ChosenEventType Same or Mixed evet type \param maxl Maximum valie of L /// component of the spherical harmonics \param multval Multiplicity value /// \param ktval kT value template - void fill_mult_NumDen(T const& part1, T const& part2, uint8_t ChosenEventType, - int maxl, int multval, float ktval, bool isiden) + void fillMultNumDen(T const& part1, T const& part2, uint8_t ChosenEventType, + int maxl, int multval, float ktval, bool isiden) { int multbinval; int absmultval = multval; - if ((absmultval >= CentMultBins[0]) && (absmultval < CentMultBins[1])) { + if ((absmultval >= centMultBins[0]) && (absmultval < centMultBins[1])) { multbinval = 0; - } else if (absmultval < CentMultBins[2]) { + } else if (absmultval < centMultBins[2]) { multbinval = 1; - } else if (absmultval < CentMultBins[3]) { + } else if (absmultval < centMultBins[3]) { multbinval = 2; - } else if (absmultval < CentMultBins[4]) { + } else if (absmultval < centMultBins[4]) { multbinval = 3; } else { return; } // std::cout<<"multbinval "< - void fill_kT_NumDen(T const& part1, T const& part2, uint8_t ChosenEventType, - int maxl, int multval, float ktval, bool isiden) + void fillkTNumDen(T const& part1, T const& part2, uint8_t ChosenEventType, + int maxl, int multval, float ktval, bool isiden) { int ktbinval = -1; - if ((ktval >= KtBins[0]) && (ktval < KtBins[1])) { + if ((ktval >= ktBins[0]) && (ktval < ktBins[1])) { ktbinval = 0; - } else if (ktval < KtBins[2]) { + } else if (ktval < ktBins[2]) { ktbinval = 1; - } else if (ktval < KtBins[3]) { + } else if (ktval < ktBins[3]) { ktbinval = 2; - } else if (ktval < KtBins[4]) { + } else if (ktval < ktBins[4]) { ktbinval = 3; } else { return; } - AddEventPair(part1, part2, ChosenEventType, maxl, multval, ktbinval, isiden); + addEventPair(part1, part2, ChosenEventType, maxl, multval, ktbinval, isiden); } /// Set the PDG codes of the two particles involved @@ -247,9 +221,9 @@ class PairSHCentMultKt /// \param zeroimag /// \param ilmprim /// \param primimag - int GetBin(int qbin, int ilmzero, int zeroimag, int ilmprim, int primimag) + int getBin(int qbin, int ilmzero, int zeroimag, int ilmprim, int primimag) { - return qbin * fMaxJM * fMaxJM * 4 + (ilmprim * 2 + primimag) * fMaxJM * 2 + + return qbin * kMaxJM * kMaxJM * 4 + (ilmprim * 2 + primimag) * kMaxJM * 2 + ilmzero * 2 + zeroimag; } @@ -261,12 +235,12 @@ class PairSHCentMultKt /// \param multval Multiplicity value /// \param ktval kT value template - void AddEventPair(T const& part1, T const& part2, uint8_t ChosenEventType, + void addEventPair(T const& part1, T const& part2, uint8_t ChosenEventType, int /*maxl*/, int multval, int ktval, bool isiden) { int fMultBin = multval; int fKtBin = ktval; - std::vector> fYlmBuffer(fMaxJM); + std::vector> fYlmBuffer(kMaxJM); std::vector f3d; f3d = FemtoUniverseMath::newpairfunc(part1, mMassOne, part2, mMassTwo, isiden); @@ -275,48 +249,48 @@ class PairSHCentMultKt const float qside = f3d[2]; const float qlong = f3d[3]; - double kv = sqrt(qout * qout + qside * qside + qlong * qlong); + double kv = std::sqrt(qout * qout + qside * qside + qlong * qlong); int nqbin = fbinctn[0][0]->GetXaxis()->FindFixBin(kv) - 1; - FemtoUniverseSpherHarMath Ylm; - Ylm.YlmUpToL(fMaxL, qout, qside, qlong, fYlmBuffer.data()); + FemtoUniverseSpherHarMath kYlm; + kYlm.doYlmUpToL(kMaxL, qout, qside, qlong, fYlmBuffer.data()); - if (ChosenEventType == femtoUniverseSHContainer::EventType::same) { - for (int ihist = 0; ihist < fMaxJM; ihist++) { + if (ChosenEventType == femto_universe_sh_container::EventType::same) { + for (int ihist = 0; ihist < kMaxJM; ihist++) { fnumsreal[fMultBin][fKtBin][ihist]->Fill(kv, real(fYlmBuffer[ihist])); fnumsimag[fMultBin][fKtBin][ihist]->Fill(kv, -imag(fYlmBuffer[ihist])); fbinctn[fMultBin][fKtBin]->Fill(kv, 1.0); } if (nqbin < fbinctn[0][0]->GetNbinsX()) { - for (int ilmzero = 0; ilmzero < fMaxJM; ilmzero++) { - for (int ilmprim = 0; ilmprim < fMaxJM; ilmprim++) { - fcovmnum[fMultBin][fKtBin][GetBin(nqbin, ilmzero, 0, ilmprim, 0)] += + for (int ilmzero = 0; ilmzero < kMaxJM; ilmzero++) { + for (int ilmprim = 0; ilmprim < kMaxJM; ilmprim++) { + fcovmnum[fMultBin][fKtBin][getBin(nqbin, ilmzero, 0, ilmprim, 0)] += (real(fYlmBuffer[ilmzero]) * real(fYlmBuffer[ilmprim])); - fcovmnum[fMultBin][fKtBin][GetBin(nqbin, ilmzero, 0, ilmprim, 1)] += + fcovmnum[fMultBin][fKtBin][getBin(nqbin, ilmzero, 0, ilmprim, 1)] += (real(fYlmBuffer[ilmzero]) * -imag(fYlmBuffer[ilmprim])); - fcovmnum[fMultBin][fKtBin][GetBin(nqbin, ilmzero, 1, ilmprim, 0)] += + fcovmnum[fMultBin][fKtBin][getBin(nqbin, ilmzero, 1, ilmprim, 0)] += (-imag(fYlmBuffer[ilmzero]) * real(fYlmBuffer[ilmprim])); - fcovmnum[fMultBin][fKtBin][GetBin(nqbin, ilmzero, 1, ilmprim, 1)] += + fcovmnum[fMultBin][fKtBin][getBin(nqbin, ilmzero, 1, ilmprim, 1)] += (-imag(fYlmBuffer[ilmzero]) * -imag(fYlmBuffer[ilmprim])); } } } - } else if (ChosenEventType == femtoUniverseSHContainer::EventType::mixed) { - for (int ihist = 0; ihist < fMaxJM; ihist++) { + } else if (ChosenEventType == femto_universe_sh_container::EventType::mixed) { + for (int ihist = 0; ihist < kMaxJM; ihist++) { fdensreal[fMultBin][fKtBin][ihist]->Fill(kv, real(fYlmBuffer[ihist])); fdensimag[fMultBin][fKtBin][ihist]->Fill(kv, -imag(fYlmBuffer[ihist])); fbinctd[fMultBin][fKtBin]->Fill(kv, 1.0); } if (nqbin < fbinctd[0][0]->GetNbinsX()) { - for (int ilmzero = 0; ilmzero < fMaxJM; ilmzero++) { - for (int ilmprim = 0; ilmprim < fMaxJM; ilmprim++) { - fcovmden[fMultBin][fKtBin][GetBin(nqbin, ilmzero, 0, ilmprim, 0)] += + for (int ilmzero = 0; ilmzero < kMaxJM; ilmzero++) { + for (int ilmprim = 0; ilmprim < kMaxJM; ilmprim++) { + fcovmden[fMultBin][fKtBin][getBin(nqbin, ilmzero, 0, ilmprim, 0)] += (real(fYlmBuffer[ilmzero]) * real(fYlmBuffer[ilmprim])); - fcovmden[fMultBin][fKtBin][GetBin(nqbin, ilmzero, 0, ilmprim, 1)] += + fcovmden[fMultBin][fKtBin][getBin(nqbin, ilmzero, 0, ilmprim, 1)] += (real(fYlmBuffer[ilmzero]) * -imag(fYlmBuffer[ilmprim])); - fcovmden[fMultBin][fKtBin][GetBin(nqbin, ilmzero, 1, ilmprim, 0)] += + fcovmden[fMultBin][fKtBin][getBin(nqbin, ilmzero, 1, ilmprim, 0)] += (-imag(fYlmBuffer[ilmzero]) * real(fYlmBuffer[ilmprim])); - fcovmden[fMultBin][fKtBin][GetBin(nqbin, ilmzero, 1, ilmprim, 1)] += + fcovmden[fMultBin][fKtBin][getBin(nqbin, ilmzero, 1, ilmprim, 1)] += (-imag(fYlmBuffer[ilmzero]) * -imag(fYlmBuffer[ilmprim])); } } @@ -329,93 +303,81 @@ class PairSHCentMultKt /// \param MaxJM Maximum value of J /// \param multval Multiplicity value /// \param ktval kT value - void PackCov(uint8_t ChosenEventType, int /*MaxJM*/, int multval, int ktval) + void packCov(uint8_t ChosenEventType, int /*MaxJM*/, int multval, int ktval) { int fMultBin = multval; int fKtBin = ktval; - if (ChosenEventType == femtoUniverseSHContainer::EventType::same) { + if (ChosenEventType == femto_universe_sh_container::EventType::same) { for (int ibin = 1; ibin <= fcovnum[0][0]->GetNbinsX(); ibin++) { - for (int ilmz = 0; ilmz < fMaxJM * 2; ilmz++) { - for (int ilmp = 0; ilmp < fMaxJM * 2; ilmp++) { - auto bin = GetBin(ibin - 1, ilmz / 2, ilmz % 2, ilmp / 2, ilmp % 2); + for (int ilmz = 0; ilmz < kMaxJM * 2; ilmz++) { + for (int ilmp = 0; ilmp < kMaxJM * 2; ilmp++) { + auto bin = getBin(ibin - 1, ilmz / 2, ilmz % 2, ilmp / 2, ilmp % 2); auto value = fcovmnum[fMultBin][fKtBin][bin]; - fcovnum[fMultBin][fKtBin]->SetBinContent(ibin, ilmz + 1, ilmp + 1, - value); + fcovnum[fMultBin][fKtBin]->SetBinContent(ibin, ilmz + 1, ilmp + 1, value); } } } - } else if (ChosenEventType == femtoUniverseSHContainer::EventType::mixed) { + } else if (ChosenEventType == femto_universe_sh_container::EventType::mixed) { for (int ibin = 1; ibin <= fcovden[0][0]->GetNbinsX(); ibin++) { - for (int ilmz = 0; ilmz < fMaxJM * 2; ilmz++) { - for (int ilmp = 0; ilmp < fMaxJM * 2; ilmp++) { - auto bin = GetBin(ibin - 1, ilmz / 2, ilmz % 2, ilmp / 2, ilmp % 2); + for (int ilmz = 0; ilmz < kMaxJM * 2; ilmz++) { + for (int ilmp = 0; ilmp < kMaxJM * 2; ilmp++) { + auto bin = getBin(ibin - 1, ilmz / 2, ilmz % 2, ilmp / 2, ilmp % 2); auto value = fcovmden[fMultBin][fKtBin][bin]; - fcovden[fMultBin][fKtBin]->SetBinContent(ibin, ilmz + 1, ilmp + 1, - value); + fcovden[fMultBin][fKtBin]->SetBinContent(ibin, ilmz + 1, ilmp + 1, value); } } } } } - /// Function to acces each multiplicity and kT directory and call PackCov + /// Function to acces each multiplicity and kT directory and call packCov /// \param ChosenEventType same or mixed event /// \param MaxJM Maximum value of J - void fill_mult_kT_Cov(uint8_t ChosenEventType, int MaxJM) + void fillMultkTCov(uint8_t ChosenEventType, int MaxJM) { for (int multbinvalcov = 0; - multbinvalcov < static_cast(CentMultBins.size() - 2); + multbinvalcov < static_cast(centMultBins.size() - 2); multbinvalcov++) { for (int ktbinvalcov = 0; - ktbinvalcov < static_cast(KtBins.size() - 1); ktbinvalcov++) { - PackCov(ChosenEventType, MaxJM, multbinvalcov, ktbinvalcov); + ktbinvalcov < static_cast(ktBins.size() - 1); ktbinvalcov++) { + packCov(ChosenEventType, MaxJM, multbinvalcov, ktbinvalcov); } } } private: - std::array, 10>, 4>, 4> - fnumsreal{}; - std::array, 10>, 4>, 4> - fnumsimag{}; - std::array, 10>, 4>, 4> - fdensreal{}; - std::array, 10>, 4>, 4> - fdensimag{}; + std::array, 10>, 4>, 4> fnumsreal{}; + std::array, 10>, 4>, 4> fnumsimag{}; + std::array, 10>, 4>, 4> fdensreal{}; + std::array, 10>, 4>, 4> fdensimag{}; TH1D* fbinctn[10][10]; TH1D* fbinctd[10][10]; - static constexpr int fMaxL = 2; - static constexpr int fMaxJM = (fMaxL + 1) * (fMaxL + 1); + static constexpr int kMaxL = 2; + static constexpr int kMaxJM = (kMaxL + 1) * (kMaxL + 1); - std::array, 4>, 4> - fcovmnum{}; ///< Covariance matrix for the numerator - std::array, 4>, 4> - fcovmden{}; ///< Covariance matrix for the numerator + std::array, 4>, 4> fcovmnum{}; ///< Covariance matrix for the numerator + std::array, 4>, 4> fcovmden{}; ///< Covariance matrix for the numerator std::array, 4>, 4> fcovnum{}; std::array, 4>, 4> fcovden{}; protected: - HistogramRegistry* PairSHCentMultKtRegistry = nullptr; - static constexpr std::string_view mFolderSuffix[2] = { - "SameEvent", - "MixedEvent"}; ///< Folder naming for the output according to mEventType - static constexpr int mEventType = - eventType; ///< Type of the event (same/mixed, according to - ///< FEMTOUNIVERSESHCONTAINER::EventType) - float mMassOne = 0.f; ///< PDG mass of particle 1 - float mMassTwo = 0.f; ///< PDG mass of particle 2 - int mPDGOne = 0; ///< PDG code of particle 1 - int mPDGTwo = 0; ///< PDG code of particle 2 - std::vector CentMultBins; - std::vector KtBins; - std::vector KStarBins; - bool UseKt = false; - bool Use3D = false; + HistogramRegistry* pairSHCentMultKtRegistry = nullptr; + static constexpr std::string_view FolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to EventType + static constexpr int EventType = eventType; ///< Type of the event (same/mixed, according to FEMTOUNIVERSESHCONTAINER::EventType) + float mMassOne = 0.f; ///< PDG mass of particle 1 + float mMassTwo = 0.f; ///< PDG mass of particle 2 + int mPDGOne = 0; ///< PDG code of particle 1 + int mPDGTwo = 0; ///< PDG code of particle 2 + std::vector centMultBins; + std::vector ktBins; + std::vector kStarBins; + bool useKt = false; + bool use3D = false; }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEPAIRSHCENTMULTKT_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniversePairWithCentMultKt.h b/PWGCF/FemtoUniverse/Core/FemtoUniversePairWithCentMultKt.h index 6b52d810d43..923242451b0 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniversePairWithCentMultKt.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniversePairWithCentMultKt.h @@ -8,26 +8,25 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file FemtoUniversePairWithCentMultKt.h +/// \brief FemtoUniversePairWithCentMultKt - Histogram class for tracks with centrality and multiplicity /// \author Deependra Sharma, IITB, deependra.sharma@cern.ch /// \author Alicja Płachta, WUT Warsaw, alicja.plachta.stud@pw.edu.pl +/// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch #ifndef PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEPAIRWITHCENTMULTKT_H_ #define PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEPAIRWITHCENTMULTKT_H_ #include -#include #include #include "Framework/HistogramRegistry.h" -using namespace o2; -using namespace o2::framework; - -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { -class PairWithCentMultKt +class FemtoUniversePairWithCentMultKt { public: - virtual ~PairWithCentMultKt() = default; + virtual ~FemtoUniversePairWithCentMultKt() = default; /// @brief /// @tparam t1 /// @param registry @@ -36,65 +35,65 @@ class PairWithCentMultKt template void init(HistogramRegistry* registry, t1& kstarbins, t1& centmultbins, t1& ktbins, bool processKT, bool process3D) { - PairWithCentMultKtRegistry = registry; + pairWithCentMultKtRegistry = registry; AxisSpec kstarAxis = {kstarbins, "#it{k*} (GeV/#it{c})"}; AxisSpec kOutAxis = {kstarbins, "#it{q}_{out} (GeV/#it{c})"}; AxisSpec kSideAxis = {kstarbins, "#it{q}_{side} (GeV/#it{c})"}; AxisSpec kLongAxis = {kstarbins, "#it{q}_{long} (GeV/#it{c})"}; - CentMultBins = centmultbins; - KtBins = ktbins; - KtBins.erase(KtBins.begin()); - CentMultBins.erase(CentMultBins.begin()); - UseKt = processKT; - Use3D = process3D; + centMultBins = centmultbins; + ktBins = ktbins; + ktBins.erase(ktBins.begin()); + centMultBins.erase(centMultBins.begin()); + useKt = processKT; + use3D = process3D; - for (int i = 0; i < static_cast(CentMultBins.size() - 1); i++) { - int lowBin = static_cast((CentMultBins[i])); - int highBin = static_cast((CentMultBins[i + 1])); - std::string HistTitle = "mult_" + std::to_string(lowBin) + "-" + std::to_string(highBin); - std::string HistSuffix1 = static_cast(HistSuffix[i]); - std::string HistSuffix2 = static_cast(HistSuffix[i + 1]); - std::cout << "HistSuffix1 " << HistSuffix1 << " HistSuffix2 " << HistSuffix2 << std::endl; - std::string HistFolderMult = "mult_" + HistSuffix1 + "_" + HistSuffix2; - std::string HistName = HistFolderMult + "/kstar"; - std::string HistName3D = HistFolderMult + "/q3D"; - PairWithCentMultKtRegistry->add(HistName.c_str(), HistTitle.c_str(), HistType::kTH1F, {kstarAxis}); - PairWithCentMultKtRegistry->add(HistName3D.c_str(), HistTitle.c_str(), HistType::kTH3F, {kOutAxis, kSideAxis, kLongAxis}); - if (UseKt) { - for (int i = 0; i < static_cast(KtBins.size() - 1); i++) { - std::string kt_bin1_string = std::to_string(KtBins[i]); - std::replace(kt_bin1_string.begin(), kt_bin1_string.end(), '.', '_'); - std::string kt_bin2_string = std::to_string(KtBins[i + 1]); - std::replace(kt_bin2_string.begin(), kt_bin2_string.end(), '.', '_'); - kt_bin1_string.resize(4); - kt_bin2_string.resize(4); - std::string HistTitleKt = "kt_" + kt_bin1_string + "-" + kt_bin2_string; - std::string HistSuffix1Kt = static_cast(HistSuffix[i]); - std::string HistSuffix2Kt = static_cast(HistSuffix[i + 1]); - std::string HistNameKt = HistFolderMult + "/kstar_kt_" + HistSuffix1Kt + "_" + HistSuffix2Kt; - std::cout << "HistNameKt " << HistNameKt << std::endl; - PairWithCentMultKtRegistry->add(HistNameKt.c_str(), HistTitleKt.c_str(), HistType::kTH1F, {kstarAxis}); + for (int i = 0; i < static_cast(centMultBins.size() - 1); i++) { + int lowBin = static_cast((centMultBins[i])); + int highBin = static_cast((centMultBins[i + 1])); + std::string histTitle = "mult_" + std::to_string(lowBin) + "-" + std::to_string(highBin); + std::string histSuffix1 = static_cast(HistSuffix[i]); + std::string histSuffix2 = static_cast(HistSuffix[i + 1]); + LOGF(info, "histSuffix1 %s histSuffix2", histSuffix1, histSuffix2); + std::string histFolderMult = "mult_" + histSuffix1 + "_" + histSuffix2; + std::string histName = histFolderMult + "/kstar"; + std::string histName3D = histFolderMult + "/q3D"; + pairWithCentMultKtRegistry->add(histName.c_str(), histTitle.c_str(), HistType::kTH1F, {kstarAxis}); + pairWithCentMultKtRegistry->add(histName3D.c_str(), histTitle.c_str(), HistType::kTH3F, {kOutAxis, kSideAxis, kLongAxis}); + if (useKt) { + for (int i = 0; i < static_cast(ktBins.size() - 1); i++) { + std::string ktBin1String = std::to_string(ktBins[i]); + std::replace(ktBin1String.begin(), ktBin1String.end(), '.', '_'); + std::string ktBin2String = std::to_string(ktBins[i + 1]); + std::replace(ktBin2String.begin(), ktBin2String.end(), '.', '_'); + ktBin1String.resize(4); + ktBin2String.resize(4); + std::string histTitleKt = "kt_" + ktBin1String + "-" + ktBin2String; + std::string histSuffix1Kt = static_cast(HistSuffix[i]); + std::string histSuffix2Kt = static_cast(HistSuffix[i + 1]); + std::string histNameKt = histFolderMult + "/kstar_kt_" + histSuffix1Kt + "_" + histSuffix2Kt; + LOGF(info, "histNameKt %s", histNameKt); + pairWithCentMultKtRegistry->add(histNameKt.c_str(), histTitleKt.c_str(), HistType::kTH1F, {kstarAxis}); } } - if (Use3D) { - for (int i = 0; i < static_cast(KtBins.size() - 1); i++) { - std::string kt_bin1_string = std::to_string(KtBins[i]); - std::replace(kt_bin1_string.begin(), kt_bin1_string.end(), '.', '_'); - std::string kt_bin2_string = std::to_string(KtBins[i + 1]); - std::replace(kt_bin2_string.begin(), kt_bin2_string.end(), '.', '_'); - kt_bin1_string.resize(4); - kt_bin2_string.resize(4); - std::string HistTitleKt = "kt_" + kt_bin1_string + "-" + kt_bin2_string; - std::string HistSuffix1Kt = static_cast(HistSuffix[i]); - std::string HistSuffix2Kt = static_cast(HistSuffix[i + 1]); - std::string HistNameKt = HistFolderMult + "/q3D_kt_" + HistSuffix1Kt + "_" + HistSuffix2Kt; - std::cout << "HistNameKt " << HistNameKt << std::endl; - PairWithCentMultKtRegistry->add(HistNameKt.c_str(), HistTitleKt.c_str(), HistType::kTH3F, {kOutAxis, kSideAxis, kLongAxis}); + if (use3D) { + for (int i = 0; i < static_cast(ktBins.size() - 1); i++) { + std::string ktBin1String = std::to_string(ktBins[i]); + std::replace(ktBin1String.begin(), ktBin1String.end(), '.', '_'); + std::string ktBin2String = std::to_string(ktBins[i + 1]); + std::replace(ktBin2String.begin(), ktBin2String.end(), '.', '_'); + ktBin1String.resize(4); + ktBin2String.resize(4); + std::string histTitleKt = "kt_" + ktBin1String + "-" + ktBin2String; + std::string histSuffix1Kt = static_cast(HistSuffix[i]); + std::string histSuffix2Kt = static_cast(HistSuffix[i + 1]); + std::string histNameKt = histFolderMult + "/q3D_kt_" + histSuffix1Kt + "_" + histSuffix2Kt; + LOGF(info, "histNameKt %s", histNameKt); + pairWithCentMultKtRegistry->add(histNameKt.c_str(), histTitleKt.c_str(), HistType::kTH3F, {kOutAxis, kSideAxis, kLongAxis}); } } } - PairWithCentMultKtRegistry->add("Beyond_Max", "Beyond_Max", HistType::kTH1F, {kstarAxis}); - PairWithCentMultKtRegistry->add("Beyond_Max_3D", "Beyond_Max_3D", HistType::kTH3F, {kOutAxis, kSideAxis, kLongAxis}); + pairWithCentMultKtRegistry->add("Beyond_Max", "Beyond_Max", HistType::kTH1F, {kstarAxis}); + pairWithCentMultKtRegistry->add("Beyond_Max_3D", "Beyond_Max_3D", HistType::kTH3F, {kOutAxis, kSideAxis, kLongAxis}); } /// @brief @@ -105,61 +104,61 @@ class PairWithCentMultKt void fill(t1 kstar_value, t1 cent_mult_value, t1 kt_value) { - if (cent_mult_value >= CentMultBins[CentMultBins.size() - 1] || cent_mult_value < CentMultBins[0]) { - PairWithCentMultKtRegistry->fill(HIST("Beyond_Max"), kstar_value); - } else if (cent_mult_value < CentMultBins[1]) { - PairWithCentMultKtRegistry->fill(HIST("mult_0_1/kstar"), kstar_value); - if (UseKt) { + if (cent_mult_value >= centMultBins[centMultBins.size() - 1] || cent_mult_value < centMultBins[0]) { + pairWithCentMultKtRegistry->fill(HIST("Beyond_Max"), kstar_value); + } else if (cent_mult_value < centMultBins[1]) { + pairWithCentMultKtRegistry->fill(HIST("mult_0_1/kstar"), kstar_value); + if (useKt) { auto histMultFolder = HIST("mult_0_1/"); - fill_kT(kstar_value, kt_value, histMultFolder); + fillkT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[2]) { - PairWithCentMultKtRegistry->fill(HIST("mult_1_2/kstar"), kstar_value); - if (UseKt) { + } else if (cent_mult_value < centMultBins[2]) { + pairWithCentMultKtRegistry->fill(HIST("mult_1_2/kstar"), kstar_value); + if (useKt) { auto histMultFolder = HIST("mult_1_2/"); - fill_kT(kstar_value, kt_value, histMultFolder); + fillkT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[3]) { - PairWithCentMultKtRegistry->fill(HIST("mult_2_3/kstar"), kstar_value); - if (UseKt) { + } else if (cent_mult_value < centMultBins[3]) { + pairWithCentMultKtRegistry->fill(HIST("mult_2_3/kstar"), kstar_value); + if (useKt) { auto histMultFolder = HIST("mult_2_3/"); - fill_kT(kstar_value, kt_value, histMultFolder); + fillkT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[4]) { - PairWithCentMultKtRegistry->fill(HIST("mult_3_4/kstar"), kstar_value); - if (UseKt) { + } else if (cent_mult_value < centMultBins[4]) { + pairWithCentMultKtRegistry->fill(HIST("mult_3_4/kstar"), kstar_value); + if (useKt) { auto histMultFolder = HIST("mult_3_4/"); - fill_kT(kstar_value, kt_value, histMultFolder); + fillkT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[5]) { - PairWithCentMultKtRegistry->fill(HIST("mult_4_5/kstar"), kstar_value); - if (UseKt) { + } else if (cent_mult_value < centMultBins[5]) { + pairWithCentMultKtRegistry->fill(HIST("mult_4_5/kstar"), kstar_value); + if (useKt) { auto histMultFolder = HIST("mult_4_5/"); - fill_kT(kstar_value, kt_value, histMultFolder); + fillkT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[6]) { - PairWithCentMultKtRegistry->fill(HIST("mult_5_6/kstar"), kstar_value); - if (UseKt) { + } else if (cent_mult_value < centMultBins[6]) { + pairWithCentMultKtRegistry->fill(HIST("mult_5_6/kstar"), kstar_value); + if (useKt) { auto histMultFolder = HIST("mult_5_6/"); - fill_kT(kstar_value, kt_value, histMultFolder); + fillkT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[7]) { - PairWithCentMultKtRegistry->fill(HIST("mult_6_7/kstar"), kstar_value); - if (UseKt) { + } else if (cent_mult_value < centMultBins[7]) { + pairWithCentMultKtRegistry->fill(HIST("mult_6_7/kstar"), kstar_value); + if (useKt) { auto histMultFolder = HIST("mult_6_7/"); - fill_kT(kstar_value, kt_value, histMultFolder); + fillkT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[8]) { - PairWithCentMultKtRegistry->fill(HIST("mult_7_8/kstar"), kstar_value); - if (UseKt) { + } else if (cent_mult_value < centMultBins[8]) { + pairWithCentMultKtRegistry->fill(HIST("mult_7_8/kstar"), kstar_value); + if (useKt) { auto histMultFolder = HIST("mult_7_8/"); - fill_kT(kstar_value, kt_value, histMultFolder); + fillkT(kstar_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[9]) { - PairWithCentMultKtRegistry->fill(HIST("mult_8_9/kstar"), kstar_value); - if (UseKt) { + } else if (cent_mult_value < centMultBins[9]) { + pairWithCentMultKtRegistry->fill(HIST("mult_8_9/kstar"), kstar_value); + if (useKt) { auto histMultFolder = HIST("mult_8_9/"); - fill_kT(kstar_value, kt_value, histMultFolder); + fillkT(kstar_value, kt_value, histMultFolder); } } } @@ -171,26 +170,26 @@ class PairWithCentMultKt /// @param kt_value /// @param folder template - void fill_kT(t1 kstar_value, t1 kt_value, t2 folder) + void fillkT(t1 kstar_value, t1 kt_value, t2 folder) { - if (kt_value < KtBins[1]) { - PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_0_1"), kstar_value); - } else if (kt_value < KtBins[2]) { - PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_1_2"), kstar_value); - } else if (kt_value < KtBins[3]) { - PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_2_3"), kstar_value); - } else if (kt_value < KtBins[4]) { - PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_3_4"), kstar_value); - } else if (kt_value < KtBins[5]) { - PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_4_5"), kstar_value); - } else if (kt_value < KtBins[6]) { - PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_5_6"), kstar_value); - } else if (kt_value < KtBins[7]) { - PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_6_7"), kstar_value); - } else if (kt_value < KtBins[8]) { - PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_7_8"), kstar_value); - } else if (kt_value < KtBins[9]) { - PairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_8_9"), kstar_value); + if (kt_value < ktBins[1]) { + pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_0_1"), kstar_value); + } else if (kt_value < ktBins[2]) { + pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_1_2"), kstar_value); + } else if (kt_value < ktBins[3]) { + pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_2_3"), kstar_value); + } else if (kt_value < ktBins[4]) { + pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_3_4"), kstar_value); + } else if (kt_value < ktBins[5]) { + pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_4_5"), kstar_value); + } else if (kt_value < ktBins[6]) { + pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_5_6"), kstar_value); + } else if (kt_value < ktBins[7]) { + pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_6_7"), kstar_value); + } else if (kt_value < ktBins[8]) { + pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_7_8"), kstar_value); + } else if (kt_value < ktBins[9]) { + pairWithCentMultKtRegistry->fill(folder + HIST("kstar_kt_8_9"), kstar_value); } } @@ -201,64 +200,64 @@ class PairWithCentMultKt /// @param qlong_value /// @param cent_mult_value template - void fill_3D(t1 qout_value, t1 qside_value, t1 qlong_value, t1 cent_mult_value, t1 kt_value) + void fill3D(t1 qout_value, t1 qside_value, t1 qlong_value, t1 cent_mult_value, t1 kt_value) { - if (cent_mult_value >= CentMultBins[CentMultBins.size() - 1] || cent_mult_value < CentMultBins[0]) { - PairWithCentMultKtRegistry->fill(HIST("Beyond_Max_3D"), qout_value, qside_value, qlong_value); - } else if (cent_mult_value < CentMultBins[1]) { - PairWithCentMultKtRegistry->fill(HIST("mult_0_1/q3D"), qout_value, qside_value, qlong_value); - if (Use3D) { + if (cent_mult_value >= centMultBins[centMultBins.size() - 1] || cent_mult_value < centMultBins[0]) { + pairWithCentMultKtRegistry->fill(HIST("Beyond_Max_3D"), qout_value, qside_value, qlong_value); + } else if (cent_mult_value < centMultBins[1]) { + pairWithCentMultKtRegistry->fill(HIST("mult_0_1/q3D"), qout_value, qside_value, qlong_value); + if (use3D) { auto histMultFolder = HIST("mult_0_1/"); - fill_kT_3d(qout_value, qside_value, qlong_value, kt_value, histMultFolder); + fillkT3D(qout_value, qside_value, qlong_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[2]) { - // PairWithCentMultKtRegistry->fill(HIST("mult_1_2/q3D"), qout_value, qside_value, qlong_value); - if (Use3D) { + } else if (cent_mult_value < centMultBins[2]) { + // pairWithCentMultKtRegistry->fill(HIST("mult_1_2/q3D"), qout_value, qside_value, qlong_value); + if (use3D) { auto histMultFolder = HIST("mult_1_2/"); - fill_kT_3d(qout_value, qside_value, qlong_value, kt_value, histMultFolder); + fillkT3D(qout_value, qside_value, qlong_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[3]) { - // PairWithCentMultKtRegistry->fill(HIST("mult_2_3/q3D"), qout_value, qside_value, qlong_value); - if (Use3D) { + } else if (cent_mult_value < centMultBins[3]) { + // pairWithCentMultKtRegistry->fill(HIST("mult_2_3/q3D"), qout_value, qside_value, qlong_value); + if (use3D) { auto histMultFolder = HIST("mult_2_3/"); - fill_kT_3d(qout_value, qside_value, qlong_value, kt_value, histMultFolder); + fillkT3D(qout_value, qside_value, qlong_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[4]) { - // PairWithCentMultKtRegistry->fill(HIST("mult_3_4/q3D"), qout_value, qside_value, qlong_value); - if (Use3D) { + } else if (cent_mult_value < centMultBins[4]) { + // pairWithCentMultKtRegistry->fill(HIST("mult_3_4/q3D"), qout_value, qside_value, qlong_value); + if (use3D) { auto histMultFolder = HIST("mult_3_4/"); - fill_kT_3d(qout_value, qside_value, qlong_value, kt_value, histMultFolder); + fillkT3D(qout_value, qside_value, qlong_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[5]) { - // PairWithCentMultKtRegistry->fill(HIST("mult_4_5/q3D"), qout_value, qside_value, qlong_value); - if (Use3D) { + } else if (cent_mult_value < centMultBins[5]) { + // pairWithCentMultKtRegistry->fill(HIST("mult_4_5/q3D"), qout_value, qside_value, qlong_value); + if (use3D) { auto histMultFolder = HIST("mult_4_5/"); - fill_kT_3d(qout_value, qside_value, qlong_value, kt_value, histMultFolder); + fillkT3D(qout_value, qside_value, qlong_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[6]) { - // PairWithCentMultKtRegistry->fill(HIST("mult_5_6/q3D"), qout_value, qside_value, qlong_value); - if (Use3D) { + } else if (cent_mult_value < centMultBins[6]) { + // pairWithCentMultKtRegistry->fill(HIST("mult_5_6/q3D"), qout_value, qside_value, qlong_value); + if (use3D) { auto histMultFolder = HIST("mult_5_6/"); - fill_kT_3d(qout_value, qside_value, qlong_value, kt_value, histMultFolder); + fillkT3D(qout_value, qside_value, qlong_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[7]) { - // PairWithCentMultKtRegistry->fill(HIST("mult_6_7/q3D"), qout_value, qside_value, qlong_value); - if (Use3D) { + } else if (cent_mult_value < centMultBins[7]) { + // pairWithCentMultKtRegistry->fill(HIST("mult_6_7/q3D"), qout_value, qside_value, qlong_value); + if (use3D) { auto histMultFolder = HIST("mult_6_7/"); - fill_kT_3d(qout_value, qside_value, qlong_value, kt_value, histMultFolder); + fillkT3D(qout_value, qside_value, qlong_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[8]) { - // PairWithCentMultKtRegistry->fill(HIST("mult_7_8/q3D"), qout_value, qside_value, qlong_value); - if (Use3D) { + } else if (cent_mult_value < centMultBins[8]) { + // pairWithCentMultKtRegistry->fill(HIST("mult_7_8/q3D"), qout_value, qside_value, qlong_value); + if (use3D) { auto histMultFolder = HIST("mult_7_8/"); - fill_kT_3d(qout_value, qside_value, qlong_value, kt_value, histMultFolder); + fillkT3D(qout_value, qside_value, qlong_value, kt_value, histMultFolder); } - } else if (cent_mult_value < CentMultBins[9]) { - // PairWithCentMultKtRegistry->fill(HIST("mult_8_9/q3D"), qout_value, qside_value, qlong_value); - if (Use3D) { + } else if (cent_mult_value < centMultBins[9]) { + // pairWithCentMultKtRegistry->fill(HIST("mult_8_9/q3D"), qout_value, qside_value, qlong_value); + if (use3D) { auto histMultFolder = HIST("mult_8_9/"); - fill_kT_3d(qout_value, qside_value, qlong_value, kt_value, histMultFolder); + fillkT3D(qout_value, qside_value, qlong_value, kt_value, histMultFolder); } } } @@ -271,25 +270,25 @@ class PairWithCentMultKt /// @param qlong_value /// @param folder template - void fill_kT_3d(t1 qout_value, t1 qside_value, t1 qlong_value, t1 kt_value, t2 folder) + void fillkT3D(t1 qout_value, t1 qside_value, t1 qlong_value, t1 kt_value, t2 folder) { - if (kt_value < KtBins[1]) { - PairWithCentMultKtRegistry->fill(folder + HIST("q3D_kt_0_1"), qout_value, qside_value, qlong_value); - } else if (kt_value < KtBins[2]) { - PairWithCentMultKtRegistry->fill(folder + HIST("q3D_kt_1_2"), qout_value, qside_value, qlong_value); - } else if (kt_value < KtBins[3]) { - PairWithCentMultKtRegistry->fill(folder + HIST("q3D_kt_2_3"), qout_value, qside_value, qlong_value); + if (kt_value < ktBins[1]) { + pairWithCentMultKtRegistry->fill(folder + HIST("q3D_kt_0_1"), qout_value, qside_value, qlong_value); + } else if (kt_value < ktBins[2]) { + pairWithCentMultKtRegistry->fill(folder + HIST("q3D_kt_1_2"), qout_value, qside_value, qlong_value); + } else if (kt_value < ktBins[3]) { + pairWithCentMultKtRegistry->fill(folder + HIST("q3D_kt_2_3"), qout_value, qside_value, qlong_value); } } protected: - HistogramRegistry* PairWithCentMultKtRegistry = nullptr; - std::vector CentMultBins; - std::vector KtBins; - bool UseKt = false; - bool Use3D = false; + HistogramRegistry* pairWithCentMultKtRegistry = nullptr; + std::vector centMultBins; + std::vector ktBins; + bool useKt = false; + bool use3D = false; static constexpr std::string_view HistSuffix[10] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}; }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEPAIRWITHCENTMULTKT_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h index 81572be5cbb..fd64d685416 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h @@ -28,7 +28,7 @@ using namespace o2::framework; // o2-linter: disable=using-directive -namespace o2::analysis::femtoUniverse // o2-linter: disable=name/namespace +namespace o2::analysis::femto_universe // o2-linter: disable=name/namespace { /// \class FemtoUniverseParticleHisto @@ -50,10 +50,10 @@ class FemtoUniverseParticleHisto /// \param tempFitVarAxisTitle Title of the axis of the tempFitVar (DCA_xy in case of tracks, CPA in case of V0s, etc.) /// \param tempFitVarpTAxis axis object for the pT axis in the pT vs. tempFitVar plots /// \param tempFitVarAxis axis object for the tempFitVar axis - template + template void init_base(std::string folderName, std::string tempFitVarAxisTitle, T& tempFitVarpTAxis, T& tempFitVarAxis) // o2-linter: disable=name/function-variable { - std::string folderSuffix = static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[mc]).c_str(); + std::string folderSuffix = static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]).c_str(); /// Histograms of the kinematic properties mHistogramRegistry->add((folderName + folderSuffix + "/hPt").c_str(), "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, {{240, 0, 6}}); mHistogramRegistry->add((folderName + folderSuffix + "/hEta").c_str(), "; #eta; Entries", kTH1F, {{200, -1.5, 1.5}}); @@ -61,16 +61,16 @@ class FemtoUniverseParticleHisto mHistogramRegistry->add((folderName + folderSuffix + "/hPhiEta").c_str(), "; #phi; #eta", kTH2F, {{200, 0, o2::constants::math::TwoPI}, {200, -1.5, 1.5}}); /// particle specific histogramms for the TempFitVar column in FemtoUniverseParticles - if constexpr (o2::aod::femtouniverseMCparticle::MCType::kRecon == mc) { + if constexpr (o2::aod::femtouniverse_mc_particle::MCType::kRecon == mc) { mHistogramRegistry->add((folderName + folderSuffix + static_cast(o2::aod::femtouniverseparticle::TempFitVarName[mParticleType])).c_str(), ("; #it{p}_{T} (GeV/#it{c}); " + tempFitVarAxisTitle).c_str(), kTH2F, {{tempFitVarpTAxis}, {tempFitVarAxis}}); } } // comment - template + template void init_debug(std::string folderName) // o2-linter: disable=name/function-variable { - std::string folderSuffix = static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[mc]).c_str(); + std::string folderSuffix = static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]).c_str(); if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kTrack || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0Child || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascadeBachelor || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) { mHistogramRegistry->add((folderName + folderSuffix + "/hCharge").c_str(), "; Charge; Entries", kTH1F, {{5, -2.5, 2.5}}); mHistogramRegistry->add((folderName + folderSuffix + "/hTPCfindable").c_str(), "; TPC findable clusters; Entries", kTH1F, {{163, -0.5, 162.5}}); @@ -130,7 +130,7 @@ class FemtoUniverseParticleHisto void init_MC(std::string folderName, std::string /*tempFitVarAxisTitle*/, T& tempFitVarpTAxis, T& tempFitVarAxis) // o2-linter: disable=name/function-variable { /// Particle-type specific histograms - std::string folderSuffix = static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]).c_str(); + std::string folderSuffix = static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]).c_str(); mHistogramRegistry->add((folderName + folderSuffix + "/hPt_ReconNoFake").c_str(), "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, {{240, 0, 6}}); @@ -206,12 +206,12 @@ class FemtoUniverseParticleHisto std::string folderName = flexibleFolder.value_or((static_cast(o2::aod::femtouniverseparticle::ParticleTypeName[mParticleType]) + static_cast(mFolderSuffix[mFolderSuffixType]))); // Fill here the actual histogramms by calling init_base and init_MC - init_base(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis); + init_base(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis); if (isDebug) { - init_debug(folderName); + init_debug(folderName); } if (isMC) { - init_base(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis); + init_base(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis); init_MC(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis); } } @@ -221,70 +221,70 @@ class FemtoUniverseParticleHisto /// Called by init both in case of reconstructed data/ Monte Carlo, and for Monte Carlo Truth /// \tparam T Data type of the particle /// \param part Particle - template + template void fillQA_base(T const& part, H const& histFolder) // o2-linter: disable=name/function-variable { /// Histograms of the kinematic properties - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hPt"), part.pt()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hEta"), part.eta()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hPhi"), part.phi()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hPhiEta"), part.phi(), part.eta()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hPt"), part.pt()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hEta"), part.eta()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hPhi"), part.phi()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hPhiEta"), part.phi(), part.eta()); /// particle specific histogramms for the TempFitVar column in FemtoUniverseParticles - if constexpr (mc == o2::aod::femtouniverseMCparticle::MCType::kRecon) { - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST(o2::aod::femtouniverseparticle::TempFitVarName[mParticleType]), part.pt(), part.tempFitVar()); + if constexpr (mc == o2::aod::femtouniverse_mc_particle::MCType::kRecon) { + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST(o2::aod::femtouniverseparticle::TempFitVarName[mParticleType]), part.pt(), part.tempFitVar()); } } - template + template void fillQA_debug(T const& part, H const& histFolder) // o2-linter: disable=name/function-variable { // Histograms holding further debug information if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kTrack || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0Child || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascadeBachelor || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) { - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hCharge"), part.sign()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hTPCfindable"), part.tpcNClsFindable()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hTPCfound"), part.tpcNClsFound()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hTPCcrossedOverFindable"), part.tpcCrossedRowsOverFindableCls()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hTPCcrossedRows"), part.tpcNClsCrossedRows()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hTPCfindableVsCrossed"), part.tpcNClsFindable(), part.tpcNClsCrossedRows()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hTPCshared"), part.tpcNClsShared()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hITSclusters"), part.itsNCls()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hITSclustersIB"), part.itsNClsInnerBarrel()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDCAz"), part.pt(), part.dcaZ()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDCA"), part.pt(), std::sqrt(std::pow(part.dcaXY(), 2.) + std::pow(part.dcaZ(), 2.))); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hTPCdEdX"), part.p(), part.tpcSignal()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaTPC_el"), part.p(), part.tpcNSigmaEl()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaTPC_pi"), part.p(), part.tpcNSigmaPi()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaTPC_K"), part.p(), part.tpcNSigmaKa()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaTPC_p"), part.p(), part.tpcNSigmaPr()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaTPC_d"), part.p(), part.tpcNSigmaDe()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaTOF_el"), part.p(), part.tofNSigmaEl()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaTOF_pi"), part.p(), part.tofNSigmaPi()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaTOF_K"), part.p(), part.tofNSigmaKa()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaTOF_p"), part.p(), part.tofNSigmaPr()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaTOF_d"), part.p(), part.tofNSigmaDe()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaComb_el"), part.p(), std::sqrt(part.tpcNSigmaEl() * part.tpcNSigmaEl() + part.tofNSigmaEl() * part.tofNSigmaEl())); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaComb_pi"), part.p(), std::sqrt(part.tpcNSigmaPi() * part.tpcNSigmaPi() + part.tofNSigmaPi() * part.tofNSigmaPi())); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaComb_K"), part.p(), std::sqrt(part.tpcNSigmaKa() * part.tpcNSigmaKa() + part.tofNSigmaKa() * part.tofNSigmaKa())); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaComb_p"), part.p(), std::sqrt(part.tpcNSigmaPr() * part.tpcNSigmaPr() + part.tofNSigmaPr() * part.tofNSigmaPr())); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/nSigmaComb_d"), part.p(), std::sqrt(part.tpcNSigmaDe() * part.tpcNSigmaDe() + part.tofNSigmaDe() * part.tofNSigmaDe())); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hCharge"), part.sign()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hTPCfindable"), part.tpcNClsFindable()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hTPCfound"), part.tpcNClsFound()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hTPCcrossedOverFindable"), part.tpcCrossedRowsOverFindableCls()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hTPCcrossedRows"), part.tpcNClsCrossedRows()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hTPCfindableVsCrossed"), part.tpcNClsFindable(), part.tpcNClsCrossedRows()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hTPCshared"), part.tpcNClsShared()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hITSclusters"), part.itsNCls()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hITSclustersIB"), part.itsNClsInnerBarrel()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hDCAz"), part.pt(), part.dcaZ()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hDCA"), part.pt(), std::sqrt(std::pow(part.dcaXY(), 2.) + std::pow(part.dcaZ(), 2.))); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hTPCdEdX"), part.p(), part.tpcSignal()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaTPC_el"), part.p(), part.tpcNSigmaEl()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaTPC_pi"), part.p(), part.tpcNSigmaPi()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaTPC_K"), part.p(), part.tpcNSigmaKa()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaTPC_p"), part.p(), part.tpcNSigmaPr()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaTPC_d"), part.p(), part.tpcNSigmaDe()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaTOF_el"), part.p(), part.tofNSigmaEl()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaTOF_pi"), part.p(), part.tofNSigmaPi()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaTOF_K"), part.p(), part.tofNSigmaKa()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaTOF_p"), part.p(), part.tofNSigmaPr()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaTOF_d"), part.p(), part.tofNSigmaDe()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaComb_el"), part.p(), std::sqrt(part.tpcNSigmaEl() * part.tpcNSigmaEl() + part.tofNSigmaEl() * part.tofNSigmaEl())); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaComb_pi"), part.p(), std::sqrt(part.tpcNSigmaPi() * part.tpcNSigmaPi() + part.tofNSigmaPi() * part.tofNSigmaPi())); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaComb_K"), part.p(), std::sqrt(part.tpcNSigmaKa() * part.tpcNSigmaKa() + part.tofNSigmaKa() * part.tofNSigmaKa())); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaComb_p"), part.p(), std::sqrt(part.tpcNSigmaPr() * part.tpcNSigmaPr() + part.tofNSigmaPr() * part.tofNSigmaPr())); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/nSigmaComb_d"), part.p(), std::sqrt(part.tpcNSigmaDe() * part.tpcNSigmaDe() + part.tofNSigmaDe() * part.tofNSigmaDe())); } else if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0) { - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDaughDCA"), part.daughDCA()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hTransRadius"), part.transRadius()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDecayVtxX"), part.decayVtxX()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDecayVtxY"), part.decayVtxY()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDecayVtxZ"), part.decayVtxZ()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hInvMassLambda"), part.mLambda()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hInvMassAntiLambda"), part.mAntiLambda()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hInvMassLambdaAntiLambda"), part.mLambda(), part.mAntiLambda()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hDaughDCA"), part.daughDCA()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hTransRadius"), part.transRadius()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hDecayVtxX"), part.decayVtxX()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hDecayVtxY"), part.decayVtxY()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hDecayVtxZ"), part.decayVtxZ()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hInvMassLambda"), part.mLambda()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hInvMassAntiLambda"), part.mAntiLambda()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hInvMassLambdaAntiLambda"), part.mLambda(), part.mAntiLambda()); } else if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascade) { - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDaughDCA"), part.daughDCA()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hTransRadius"), part.transRadius()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDecayVtxX"), part.decayVtxX()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDecayVtxY"), part.decayVtxY()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hDecayVtxZ"), part.decayVtxZ()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hInvMassCascade"), part.mLambda()); - mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/hInvMassAntiCascade"), part.mAntiLambda()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hDaughDCA"), part.daughDCA()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hTransRadius"), part.transRadius()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hDecayVtxX"), part.decayVtxX()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hDecayVtxY"), part.decayVtxY()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hDecayVtxZ"), part.decayVtxZ()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hInvMassCascade"), part.mLambda()); + mHistogramRegistry->fill(histFolder + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/hInvMassAntiCascade"), part.mAntiLambda()); } } @@ -309,27 +309,27 @@ class FemtoUniverseParticleHisto if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kTrack || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0Child || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascadeBachelor || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) { /// Track histograms switch (mctruthorigin) { - case (o2::aod::femtouniverseMCparticle::kPrimary): + case (o2::aod::femtouniverse_mc_particle::kPrimary): mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_Primary"), part.pt(), part.tempFitVar()); break; - case (o2::aod::femtouniverseMCparticle::kDaughter): + case (o2::aod::femtouniverse_mc_particle::kDaughter): mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_Daughter"), part.pt(), part.tempFitVar()); break; - case (o2::aod::femtouniverseMCparticle::kMaterial): + case (o2::aod::femtouniverse_mc_particle::kMaterial): mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_Material"), part.pt(), part.tempFitVar()); break; - case (o2::aod::femtouniverseMCparticle::kFake): + case (o2::aod::femtouniverse_mc_particle::kFake): mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_Fake"), part.pt(), part.tempFitVar()); break; - case (o2::aod::femtouniverseMCparticle::kDaughterLambda): + case (o2::aod::femtouniverse_mc_particle::kDaughterLambda): mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_DaughterLambda"), part.pt(), part.tempFitVar()); break; - case (o2::aod::femtouniverseMCparticle::kDaughterSigmaplus): + case (o2::aod::femtouniverse_mc_particle::kDaughterSigmaplus): mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_DaughterSigmaplus"), part.pt(), part.tempFitVar()); break; @@ -367,13 +367,13 @@ class FemtoUniverseParticleHisto { std::string tempFitVarName; if (mHistogramRegistry) { - fillQA_base(part, histFolder); + fillQA_base(part, histFolder); if constexpr (isDebug) { - fillQA_debug(part, histFolder); + fillQA_debug(part, histFolder); } if constexpr (isMC) { if (part.has_fdMCParticle()) { - fillQA_base(part.fdMCParticle(), histFolder); + fillQA_base(part.fdMCParticle(), histFolder); fillQA_MC(part, (part.fdMCParticle()).partOriginMCTruth(), (part.fdMCParticle()).pdgMCTruth(), histFolder); } else { mHistogramRegistry->fill(histFolder + HIST("_MC/hNoMCtruthCounter"), 0); @@ -389,6 +389,6 @@ class FemtoUniverseParticleHisto static constexpr std::string_view mFolderSuffix[5] = {"", "_one", "_two", "_pos", "_neg"}; ///< Suffix for the folder name in case of analyses of pairs of the same kind (T-T, V-V, C-C) // o2-linter: disable=name/constexpr-constant int mPDG = 0; ///< PDG code of the selected particle }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEPARTICLEHISTO_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniversePhiSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniversePhiSelection.h index d18988be907..2794bd96e80 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniversePhiSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniversePhiSelection.h @@ -19,12 +19,9 @@ #ifndef PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEPHISELECTION_H_ #define PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEPHISELECTION_H_ -#include #include #include -#include // FIXME - #include "PWGCF/FemtoUniverse/Core/FemtoUniverseObjectSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" @@ -34,11 +31,9 @@ #include "ReconstructionDataFormats/PID.h" #include "TLorentzVector.h" -using namespace o2::framework; - -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { -namespace femtoUniversePhiSelection +namespace femto_universe_phi_selection { /// The different selections this task is capable of doing enum PhiSel { @@ -62,18 +57,18 @@ enum PhiContainerPosition { kPosPID, kNegCuts, kNegPID, -}; /// Position in the full VO cut container +}; /// Position in the full Phi cut container -} // namespace femtoUniversePhiSelection +} // namespace femto_universe_phi_selection /// \class FemtoUniversePhiSelection /// \brief Cut class to contain and execute all cuts applied to Phis class FemtoUniversePhiSelection - : public FemtoUniverseObjectSelection + : public FemtoUniverseObjectSelection { public: FemtoUniversePhiSelection() - : nPtPhiMinSel(0), nPtPhiMaxSel(0), nEtaPhiMaxSel(0), nDCAPhiDaughMax(0), nCPAPhiMin(0), nTranRadPhiMin(0), nTranRadPhiMax(0), nDecVtxMax(0), pTPhiMin(9999999.), pTPhiMax(-9999999.), etaPhiMax(-9999999.), DCAPhiDaughMax(-9999999.), CPAPhiMin(9999999.), TranRadPhiMin(9999999.), TranRadPhiMax(-9999999.), DecVtxMax(-9999999.), fInvMassLowLimit(1.05), fInvMassUpLimit(1.3), fRejectKaon(false), fInvMassKaonLowLimit(0.48), fInvMassKaonUpLimit(0.515), nSigmaPIDOffsetTPC(0.) {} + : nPtPhiMinSel(0), nPtPhiMaxSel(0), nEtaPhiMaxSel(0), nDCAPhiDaughMax(0), nCPAPhiMin(0), nTranRadPhiMin(0), nTranRadPhiMax(0), nDecVtxMax(0), pTPhiMin(9999999.), pTPhiMax(-9999999.), etaPhiMax(-9999999.), kDCAPhiDaughMax(-9999999.), kCPAPhiMin(9999999.), kTranRadPhiMin(9999999.), kTranRadPhiMax(-9999999.), kDecVtxMax(-9999999.), fInvMassLowLimit(1.05), fInvMassUpLimit(1.3), fRejectKaon(false), fInvMassKaonLowLimit(0.48), fInvMassKaonUpLimit(0.515), nSigmaPIDOffsetTPC(0.) {} /// Initializes histograms for the task template - void setChildCuts(femtoUniversePhiSelection::ChildTrackType child, T1 selVal, - T2 selVar, femtoUniverseSelection::SelectionType selType) + void setChildCuts(femto_universe_phi_selection::ChildTrackType child, T1 selVal, + T2 selVar, femto_universe_selection::SelectionType selType) { - if (child == femtoUniversePhiSelection::kPosTrack) { - PosDaughTrack.setSelection(selVal, selVar, selType); - } else if (child == femtoUniversePhiSelection::kNegTrack) { - NegDaughTrack.setSelection(selVal, selVar, selType); + if (child == femto_universe_phi_selection::kPosTrack) { + posDaughTrack.setSelection(selVal, selVar, selType); + } else if (child == femto_universe_phi_selection::kNegTrack) { + negDaughTrack.setSelection(selVal, selVar, selType); } } template - void setChildPIDSpecies(femtoUniversePhiSelection::ChildTrackType child, + void setChildPIDSpecies(femto_universe_phi_selection::ChildTrackType child, T& pids) { - if (child == femtoUniversePhiSelection::kPosTrack) { - PosDaughTrack.setPIDSpecies(pids); - } else if (child == femtoUniversePhiSelection::kNegTrack) { - NegDaughTrack.setPIDSpecies(pids); + if (child == femto_universe_phi_selection::kPosTrack) { + posDaughTrack.setPIDSpecies(pids); + } else if (child == femto_universe_phi_selection::kNegTrack) { + negDaughTrack.setPIDSpecies(pids); } } @@ -125,12 +120,12 @@ class FemtoUniversePhiSelection /// \param iSel Track selection variable to be examined /// \param prefix Additional prefix for the name of the configurable /// \param suffix Additional suffix for the name of the configurable - static std::string getSelectionName(femtoUniversePhiSelection::PhiSel iSel, + static std::string getSelectionName(femto_universe_phi_selection::PhiSel iSel, std::string_view prefix = "", std::string_view suffix = "") { std::string outString = static_cast(prefix); - outString += static_cast(mSelectionNames[iSel]); + outString += static_cast(kSelectionNames[iSel]); outString += suffix; return outString; } @@ -143,7 +138,7 @@ class FemtoUniversePhiSelection { for (int index = 0; index < kNphiSelection; index++) { std::string comp = static_cast(prefix) + - static_cast(mSelectionNames[index]); + static_cast(kSelectionNames[index]); std::string_view cmp{comp}; if (obs.compare(cmp) == 0) return index; @@ -154,8 +149,7 @@ class FemtoUniversePhiSelection /// Helper function to obtain the type of a given selection variable for consistent naming of the configurables /// \param iSel Phi selection variable whose type is returned - static femtoUniverseSelection::SelectionType - getSelectionType(femtoUniversePhiSelection::PhiSel iSel) + static femto_universe_selection::SelectionType getSelectionType(femto_universe_phi_selection::PhiSel iSel) { return mSelectionTypes[iSel]; } @@ -164,11 +158,11 @@ class FemtoUniversePhiSelection /// for consistent description of the configurables /// \param iSel Track selection variable to be examined /// \param prefix Additional prefix for the output of the configurable - static std::string getSelectionHelper(femtoUniversePhiSelection::PhiSel iSel, + static std::string getSelectionHelper(femto_universe_phi_selection::PhiSel iSel, std::string_view prefix = "") { std::string outString = static_cast(prefix); - outString += static_cast(mSelectionHelper[iSel]); + outString += static_cast(kSelectionHelper[iSel]); return outString; } @@ -196,21 +190,21 @@ class FemtoUniversePhiSelection nSigmaPIDOffsetTPC = offsetTPC; } - void setChildRejectNotPropagatedTracks(femtoUniversePhiSelection::ChildTrackType child, bool reject) + void setChildRejectNotPropagatedTracks(femto_universe_phi_selection::ChildTrackType child, bool reject) { - if (child == femtoUniversePhiSelection::kPosTrack) { - PosDaughTrack.setRejectNotPropagatedTracks(reject); - } else if (child == femtoUniversePhiSelection::kNegTrack) { - NegDaughTrack.setRejectNotPropagatedTracks(reject); + if (child == femto_universe_phi_selection::kPosTrack) { + posDaughTrack.setRejectNotPropagatedTracks(reject); + } else if (child == femto_universe_phi_selection::kNegTrack) { + negDaughTrack.setRejectNotPropagatedTracks(reject); } } - void setChildnSigmaPIDOffset(femtoUniversePhiSelection::ChildTrackType child, float offsetTPC, float offsetTOF) + void setChildnSigmaPIDOffset(femto_universe_phi_selection::ChildTrackType child, float offsetTPC, float offsetTOF) { - if (child == femtoUniversePhiSelection::kPosTrack) { - PosDaughTrack.setnSigmaPIDOffset(offsetTPC, offsetTOF); - } else if (child == femtoUniversePhiSelection::kNegTrack) { - NegDaughTrack.setnSigmaPIDOffset(offsetTPC, offsetTOF); + if (child == femto_universe_phi_selection::kPosTrack) { + posDaughTrack.setnSigmaPIDOffset(offsetTPC, offsetTOF); + } else if (child == femto_universe_phi_selection::kNegTrack) { + negDaughTrack.setnSigmaPIDOffset(offsetTPC, offsetTOF); } } @@ -226,12 +220,11 @@ class FemtoUniversePhiSelection float pTPhiMin; float pTPhiMax; float etaPhiMax; - float DCAPhiDaughMax; - float CPAPhiMin; - float TranRadPhiMin; - float TranRadPhiMax; - float DecVtxMax; - + float kDCAPhiDaughMax; + float kCPAPhiMin; + float kTranRadPhiMin; + float kTranRadPhiMax; + float kDecVtxMax; float fInvMassLowLimit; float fInvMassUpLimit; @@ -241,30 +234,30 @@ class FemtoUniversePhiSelection float nSigmaPIDOffsetTPC; - FemtoUniverseTrackSelection PosDaughTrack; - FemtoUniverseTrackSelection NegDaughTrack; + FemtoUniverseTrackSelection posDaughTrack; + FemtoUniverseTrackSelection negDaughTrack; static constexpr int kNphiSelection = 9; - static constexpr std::string_view mSelectionNames[kNphiSelection] = { + static constexpr std::string_view kSelectionNames[kNphiSelection] = { "Sign", "PtMin", "PtMax", "EtaMax", "DCAdaughMax", "CPAMin", "TranRadMin", "TranRadMax", "DecVecMax"}; ///< Name of the different ///< selections - static constexpr femtoUniverseSelection::SelectionType + static constexpr femto_universe_selection::SelectionType mSelectionTypes[kNphiSelection]{ - femtoUniverseSelection::kEqual, - femtoUniverseSelection::kLowerLimit, - femtoUniverseSelection::kUpperLimit, - femtoUniverseSelection::kUpperLimit, - femtoUniverseSelection::kUpperLimit, - femtoUniverseSelection::kLowerLimit, - femtoUniverseSelection::kLowerLimit, - femtoUniverseSelection::kUpperLimit, - femtoUniverseSelection::kUpperLimit}; ///< Map to match a variable with - ///< its type - - static constexpr std::string_view mSelectionHelper[kNphiSelection] = { + femto_universe_selection::kEqual, + femto_universe_selection::kLowerLimit, + femto_universe_selection::kUpperLimit, + femto_universe_selection::kUpperLimit, + femto_universe_selection::kUpperLimit, + femto_universe_selection::kLowerLimit, + femto_universe_selection::kLowerLimit, + femto_universe_selection::kUpperLimit, + femto_universe_selection::kUpperLimit}; ///< Map to match a variable with + ///< its type + + static constexpr std::string_view kSelectionHelper[kNphiSelection] = { "+1 for lambda, -1 for antilambda", "Minimum pT (GeV/c)", "Maximum pT (GeV/c)", @@ -276,7 +269,7 @@ class FemtoUniversePhiSelection "Maximum distance from primary vertex"}; ///< Helper information for the ///< different selections -}; // namespace femtoUniverse +}; // namespace femto_universe template add((folderName + "/hEta").c_str(), "; #eta; Entries", kTH1F, {{1000, -1, 1}}); mHistogramRegistry->add((folderName + "/hPhi").c_str(), "; #phi; Entries", - kTH1F, {{1000, 0, 2. * M_PI}}); + kTH1F, {{1000, 0, o2::constants::math::TwoPI}}); mHistogramRegistry->add((folderName + "/hInvMassPhi").c_str(), "", kTH1F, {massAxisPhi}); - PosDaughTrack.init( mHistogramRegistry); - NegDaughTrack.init( mHistogramRegistry); @@ -349,31 +342,31 @@ void FemtoUniversePhiSelection::init(HistogramRegistry* registry) } /// check whether the most open cuts are fulfilled - most of this should have /// already be done by the filters - nPtPhiMinSel = getNSelections(femtoUniversePhiSelection::kPhipTMin); - nPtPhiMaxSel = getNSelections(femtoUniversePhiSelection::kPhipTMax); - nEtaPhiMaxSel = getNSelections(femtoUniversePhiSelection::kPhietaMax); - nDCAPhiDaughMax = getNSelections(femtoUniversePhiSelection::kPhiDCADaughMax); - nCPAPhiMin = getNSelections(femtoUniversePhiSelection::kPhiCPAMin); - nTranRadPhiMin = getNSelections(femtoUniversePhiSelection::kPhiTranRadMin); - nTranRadPhiMax = getNSelections(femtoUniversePhiSelection::kPhiTranRadMax); - nDecVtxMax = getNSelections(femtoUniversePhiSelection::kPhiDecVtxMax); - - pTPhiMin = getMinimalSelection(femtoUniversePhiSelection::kPhipTMin, - femtoUniverseSelection::kLowerLimit); - pTPhiMax = getMinimalSelection(femtoUniversePhiSelection::kPhipTMax, - femtoUniverseSelection::kUpperLimit); - etaPhiMax = getMinimalSelection(femtoUniversePhiSelection::kPhietaMax, - femtoUniverseSelection::kAbsUpperLimit); - DCAPhiDaughMax = getMinimalSelection(femtoUniversePhiSelection::kPhiDCADaughMax, - femtoUniverseSelection::kUpperLimit); - CPAPhiMin = getMinimalSelection(femtoUniversePhiSelection::kPhiCPAMin, - femtoUniverseSelection::kLowerLimit); - TranRadPhiMin = getMinimalSelection(femtoUniversePhiSelection::kPhiTranRadMin, - femtoUniverseSelection::kLowerLimit); - TranRadPhiMax = getMinimalSelection(femtoUniversePhiSelection::kPhiTranRadMax, - femtoUniverseSelection::kUpperLimit); - DecVtxMax = getMinimalSelection(femtoUniversePhiSelection::kPhiDecVtxMax, - femtoUniverseSelection::kAbsUpperLimit); + nPtPhiMinSel = getNSelections(femto_universe_phi_selection::kPhipTMin); + nPtPhiMaxSel = getNSelections(femto_universe_phi_selection::kPhipTMax); + nEtaPhiMaxSel = getNSelections(femto_universe_phi_selection::kPhietaMax); + nDCAPhiDaughMax = getNSelections(femto_universe_phi_selection::kPhiDCADaughMax); + nCPAPhiMin = getNSelections(femto_universe_phi_selection::kPhiCPAMin); + nTranRadPhiMin = getNSelections(femto_universe_phi_selection::kPhiTranRadMin); + nTranRadPhiMax = getNSelections(femto_universe_phi_selection::kPhiTranRadMax); + nDecVtxMax = getNSelections(femto_universe_phi_selection::kPhiDecVtxMax); + + pTPhiMin = getMinimalSelection(femto_universe_phi_selection::kPhipTMin, + femto_universe_selection::kLowerLimit); + pTPhiMax = getMinimalSelection(femto_universe_phi_selection::kPhipTMax, + femto_universe_selection::kUpperLimit); + etaPhiMax = getMinimalSelection(femto_universe_phi_selection::kPhietaMax, + femto_universe_selection::kAbsUpperLimit); + kDCAPhiDaughMax = getMinimalSelection(femto_universe_phi_selection::kPhiDCADaughMax, + femto_universe_selection::kUpperLimit); + kCPAPhiMin = getMinimalSelection(femto_universe_phi_selection::kPhiCPAMin, + femto_universe_selection::kLowerLimit); + kTranRadPhiMin = getMinimalSelection(femto_universe_phi_selection::kPhiTranRadMin, + femto_universe_selection::kLowerLimit); + kTranRadPhiMax = getMinimalSelection(femto_universe_phi_selection::kPhiTranRadMax, + femto_universe_selection::kUpperLimit); + kDecVtxMax = getMinimalSelection(femto_universe_phi_selection::kPhiDecVtxMax, + femto_universe_selection::kAbsUpperLimit); } template @@ -419,42 +412,42 @@ bool FemtoUniversePhiSelection::isSelectedMinimal(C const& col, V const& phi, if (nEtaPhiMaxSel > 0 && std::abs(eta) > etaPhiMax) { return false; } - if (nDCAPhiDaughMax > 0 && dcaDaughphi > DCAPhiDaughMax) { + if (nDCAPhiDaughMax > 0 && dcaDaughphi > kDCAPhiDaughMax) { return false; } - if (nCPAPhiMin > 0 && cpaphi < CPAPhiMin) { + if (nCPAPhiMin > 0 && cpaphi < kCPAPhiMin) { return false; } - if (nTranRadPhiMin > 0 && tranRad < TranRadPhiMin) { + if (nTranRadPhiMin > 0 && tranRad < kTranRadPhiMin) { return false; } - if (nTranRadPhiMax > 0 && tranRad > TranRadPhiMax) { + if (nTranRadPhiMax > 0 && tranRad > kTranRadPhiMax) { return false; } for (size_t i = 0; i < decVtx.size(); i++) { - if (nDecVtxMax > 0 && decVtx.at(i) > DecVtxMax) { + if (nDecVtxMax > 0 && decVtx.at(i) > kDecVtxMax) { return false; } } - if (!PosDaughTrack.isSelectedMinimal(posTrack)) { + if (!posDaughTrack.isSelectedMinimal(posTrack)) { return false; } - if (!NegDaughTrack.isSelectedMinimal(negTrack)) { + if (!negDaughTrack.isSelectedMinimal(negTrack)) { return false; } // check that track combinations for Phi or antiPhi would be fulfilling PID - int nSigmaPIDMax = PosDaughTrack.getSigmaPIDMax(); + int nSigmaPIDMax = posDaughTrack.getSigmaPIDMax(); // antiPhi auto nSigmaPrNeg = negTrack.tpcNSigmaPr(); auto nSigmaPiPos = posTrack.tpcNSigmaPi(); // phi auto nSigmaPiNeg = negTrack.tpcNSigmaPi(); auto nSigmaPrPos = posTrack.tpcNSigmaPr(); - if (!(abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && - abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax) && - !(abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && - abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax)) { + if (!(std::abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && + std::abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax) && + !(std::abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && + std::abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax)) { return false; } @@ -499,24 +492,24 @@ void FemtoUniversePhiSelection::fillLambdaQA(C const& col, V const& phi, mHistogramRegistry->fill(HIST("LambdaQA/hInvMassLambdaEtaMax"), phi.mLambda()); } - if (dcaDaughphi < DCAPhiDaughMax) { + if (dcaDaughphi < kDCAPhiDaughMax) { mHistogramRegistry->fill(HIST("LambdaQA/hInvMassLambdaDCAPhiDaugh"), phi.mLambda()); } - if (cpaphi > CPAPhiMin) { + if (cpaphi > kCPAPhiMin) { mHistogramRegistry->fill(HIST("LambdaQA/hInvMassLambdaCPA"), phi.mLambda()); } - if (tranRad > TranRadPhiMin) { + if (tranRad > kTranRadPhiMin) { mHistogramRegistry->fill(HIST("LambdaQA/hInvMassLambdaTranRadMin"), phi.mLambda()); } - if (tranRad < TranRadPhiMax) { + if (tranRad < kTranRadPhiMax) { mHistogramRegistry->fill(HIST("LambdaQA/hInvMassLambdaTranRadMax"), phi.mLambda()); } bool write = true; for (size_t i = 0; i < decVtx.size(); i++) { - write = write && (decVtx.at(i) < DecVtxMax); + write = write && (decVtx.at(i) < kDecVtxMax); } if (write) { mHistogramRegistry->fill(HIST("LambdaQA/hInvMassLambdaDecVtxMax"), @@ -530,33 +523,33 @@ template std::array FemtoUniversePhiSelection::getCutContainer(C const& col, V const& phi, T const& posTrack, T const& negTrack) { - auto outputPosTrack = PosDaughTrack.getCutContainer(posTrack); - auto outputNegTrack = NegDaughTrack.getCutContainer(negTrack); + auto outputPosTrack = posDaughTrack.getCutContainer(posTrack); + auto outputNegTrack = negDaughTrack.getCutContainer(negTrack); cutContainerType output = 0; size_t counter = 0; - auto lambdaMassNominal = TDatabasePDG::Instance()->GetParticle(3122)->Mass(); // FIXME: Get from the common header + auto lambdaMassNominal = o2::constants::physics::MassPhi; auto lambdaMassHypothesis = phi.mLambda(); auto antiLambdaMassHypothesis = phi.mAntiLambda(); - auto diffLambda = abs(lambdaMassNominal - lambdaMassHypothesis); - auto diffAntiLambda = abs(antiLambdaMassHypothesis - lambdaMassHypothesis); + auto diffLambda = std::abs(lambdaMassNominal - lambdaMassHypothesis); + auto diffAntiLambda = std::abs(antiLambdaMassHypothesis - lambdaMassHypothesis); float sign = 0.; - int nSigmaPIDMax = PosDaughTrack.getSigmaPIDMax(); + int nSigmaPIDMax = posDaughTrack.getSigmaPIDMax(); auto nSigmaPrNeg = negTrack.tpcNSigmaPr(); auto nSigmaPiPos = posTrack.tpcNSigmaPi(); auto nSigmaPiNeg = negTrack.tpcNSigmaPi(); auto nSigmaPrPos = posTrack.tpcNSigmaPr(); // check the mass and the PID of daughters - if (abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && diffAntiLambda > diffLambda) { + if (std::abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && std::abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && diffAntiLambda > diffLambda) { sign = -1.; - } else if (abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && diffAntiLambda < diffLambda) { + } else if (std::abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && std::abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && diffAntiLambda < diffLambda) { sign = 1.; } else { // if it happens that none of these are true, ignore the invariant mass - if (abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax) { + if (std::abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && std::abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax) { sign = -1.; - } else if (abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax) { + } else if (std::abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && std::abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax) { sign = 1.; } } @@ -571,38 +564,38 @@ std::array float observable = 0.; for (auto& sel : mSelections) { const auto selVariable = sel.getSelectionVariable(); - if (selVariable == femtoUniversePhiSelection::kPhiDecVtxMax) { + if (selVariable == femto_universe_phi_selection::kPhiDecVtxMax) { for (size_t i = 0; i < decVtx.size(); ++i) { auto decVtxValue = decVtx.at(i); sel.checkSelectionSetBit(decVtxValue, output, counter); } } else { switch (selVariable) { - case (femtoUniversePhiSelection::kPhiSign): + case (femto_universe_phi_selection::kPhiSign): observable = sign; break; - case (femtoUniversePhiSelection::kPhipTMin): + case (femto_universe_phi_selection::kPhipTMin): observable = pT; break; - case (femtoUniversePhiSelection::kPhipTMax): + case (femto_universe_phi_selection::kPhipTMax): observable = pT; break; - case (femtoUniversePhiSelection::kPhietaMax): + case (femto_universe_phi_selection::kPhietaMax): observable = eta; break; - case (femtoUniversePhiSelection::kPhiDCADaughMax): + case (femto_universe_phi_selection::kPhiDCADaughMax): observable = dcaDaughphi; break; - case (femtoUniversePhiSelection::kPhiCPAMin): + case (femto_universe_phi_selection::kPhiCPAMin): observable = cpaphi; break; - case (femtoUniversePhiSelection::kPhiTranRadMin): + case (femto_universe_phi_selection::kPhiTranRadMin): observable = tranRad; break; - case (femtoUniversePhiSelection::kPhiTranRadMax): + case (femto_universe_phi_selection::kPhiTranRadMax): observable = tranRad; break; - case (femtoUniversePhiSelection::kPhiDecVtxMax): + case (femto_universe_phi_selection::kPhiDecVtxMax): break; } sel.checkSelectionSetBit(observable, output, counter); @@ -610,10 +603,10 @@ std::array } return { output, - outputPosTrack.at(femtoUniverseTrackSelection::TrackContainerPosition::kCuts), - outputPosTrack.at(femtoUniverseTrackSelection::TrackContainerPosition::kPID), - outputNegTrack.at(femtoUniverseTrackSelection::TrackContainerPosition::kCuts), - outputNegTrack.at(femtoUniverseTrackSelection::TrackContainerPosition::kPID)}; + outputPosTrack.at(femto_universe_track_selection::TrackContainerPosition::kCuts), + outputPosTrack.at(femto_universe_track_selection::TrackContainerPosition::kPID), + outputNegTrack.at(femto_universe_track_selection::TrackContainerPosition::kCuts), + outputNegTrack.at(femto_universe_track_selection::TrackContainerPosition::kPID)}; } template GetParticle(321)->Mass(); // FIXME: Get from the common header - float mMassTwo = TDatabasePDG::Instance()->GetParticle(321)->Mass(); // FIXME: Get from the common header + float mMassOne = o2::constants::physics::MassKPlus; + float mMassTwo = o2::constants::physics::MassKMinus; part1Vec.SetPtEtaPhiM(posTrack.pt(), posTrack.eta(), posTrack.phi(), mMassOne); part2Vec.SetPtEtaPhiM(negTrack.pt(), negTrack.eta(), negTrack.phi(), mMassTwo); @@ -635,13 +628,7 @@ void FemtoUniversePhiSelection::fillQA(C const& /*col*/, V const& /*phi*/, T con sumVec += part2Vec; float phiEta = sumVec.Eta(); float phiPt = sumVec.Pt(); - // float phiP = sumVec.P(); - float phiPhi = sumVec.Phi(); - if (sumVec.Phi() < 0) { - phiPhi = sumVec.Phi() + 2 * o2::constants::math::PI; - } else if (sumVec.Phi() >= 0) { - phiPhi = sumVec.Phi(); - } + float phiPhi = RecoDecay::constrainAngle(sumVec.Phi(), 0); float phiM = sumVec.M(); @@ -664,12 +651,12 @@ void FemtoUniversePhiSelection::fillQA(C const& /*col*/, V const& /*phi*/, T con phiM); } - PosDaughTrack.fillQA(posTrack); - NegDaughTrack.fillQA(negTrack); } -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEPHISELECTION_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseSHContainer.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseSHContainer.h index 4bc96996408..e4a0b9d11bd 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseSHContainer.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseSHContainer.h @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file FemtoUniverseSHContainer..h +/// \file FemtoUniverseSHContainer.h /// \brief FemtoUniverseSHContainer - Fills the Spherical Harmonics components /// \remark This file is inherited from ~/FemtoUniverse/Core/FemtoUniverse3DContainer.h on 17/06/2024 /// \author Pritam Chakraborty, WUT Warsaw, pritam.chakraborty@pw.edu.pl8 @@ -30,12 +30,10 @@ #include "TMath.h" #include "TDatabasePDG.h" -using namespace o2::framework; - -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { -namespace femtoUniverseSHContainer +namespace femto_universe_sh_container { /// Femtoscopic observable to be computed enum Observable { kstar ///< kstar @@ -45,15 +43,15 @@ enum Observable { kstar ///< kstar enum EventType { same, ///< Pair from same event mixed ///< Pair from mixed event }; -}; // namespace femtoUniverseSHContainer +}; // namespace femto_universe_sh_container -/// \class femtoUniverseSHContainer +/// \class femto_universe_sh_container /// \brief Container for all histogramming related to the correlation function. The two /// particles of the pair are passed here, and the correlation function and QA histograms /// are filled according to the specified observable /// \tparam eventType Type of the event (same/mixed) /// \tparam obs Observable to be computed (k*/Q_inv/...) -template +template class FemtoUniverseSHContainer { public: @@ -69,13 +67,13 @@ class FemtoUniverseSHContainer template void init(HistogramRegistry* registry, T& kstarbins, int /*maxl*/) { - KStarBins = kstarbins; + kStarBins = kstarbins; std::string femtoObs1D; - std::vector fels(fMaxJM); - std::vector fems(fMaxJM); - std::vector felsi(fMaxJM); - std::vector femsi(fMaxJM); + std::vector fels(kMaxJM); + std::vector fems(kMaxJM); + std::vector felsi(kMaxJM); + std::vector femsi(kMaxJM); // Fill in els and ems table int el = 0; @@ -93,41 +91,41 @@ class FemtoUniverseSHContainer el++; em = -el; } - } while (el <= fMaxL); + } while (el <= kMaxL); - mHistogramRegistry = registry; + kHistogramRegistry = registry; femtoObs1D = "#it{q} (GeV/#it{c})"; framework::AxisSpec femtoObsAxis1D = {kstarbins, femtoObs1D.c_str()}; - std::string folderName = static_cast(mFolderSuffix[mEventType]) + static_cast(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kRecon]); + std::string folderName = static_cast(kFolderSuffix[kEventType]) + static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kRecon]); std::string suffix; - for (int ihist = 0; ihist < fMaxJM; ihist++) { + for (int ihist = 0; ihist < kMaxJM; ihist++) { if (femsi[ihist] < 0) { suffix = "Ylm" + std::to_string(felsi[ihist]) + std::to_string(felsi[ihist] - femsi[ihist]); } else { suffix = "Ylm" + std::to_string(felsi[ihist]) + std::to_string(femsi[ihist]); } - if (mFolderSuffix[mEventType] == mFolderSuffix[0]) { - fnumsreal[ihist] = mHistogramRegistry->add(("NumRe" + suffix).c_str(), ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, {femtoObsAxis1D}); - fnumsimag[ihist] = mHistogramRegistry->add(("NumIm" + suffix).c_str(), ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, {femtoObsAxis1D}); + if (kFolderSuffix[kEventType] == kFolderSuffix[0]) { + fnumsreal[ihist] = kHistogramRegistry->add(("NumRe" + suffix).c_str(), ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, {femtoObsAxis1D}); + fnumsimag[ihist] = kHistogramRegistry->add(("NumIm" + suffix).c_str(), ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, {femtoObsAxis1D}); } else { - fdensreal[ihist] = mHistogramRegistry->add(("DenRe" + suffix).c_str(), ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, {femtoObsAxis1D}); - fdensimag[ihist] = mHistogramRegistry->add(("DenIm" + suffix).c_str(), ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, {femtoObsAxis1D}); + fdensreal[ihist] = kHistogramRegistry->add(("DenRe" + suffix).c_str(), ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, {femtoObsAxis1D}); + fdensimag[ihist] = kHistogramRegistry->add(("DenIm" + suffix).c_str(), ("; " + femtoObs1D + "; Entries").c_str(), kTH1D, {femtoObsAxis1D}); } } - if (mFolderSuffix[mEventType] == mFolderSuffix[0]) { + if (kFolderSuffix[kEventType] == kFolderSuffix[0]) { std::string bufnameNum = "CovNum"; - fcovnum = mHistogramRegistry->add((bufnameNum).c_str(), "; x; y; z", kTH3D, {{kstarbins}, {(fMaxJM * 2), -0.5, ((static_cast(fMaxJM) * 2.0 - 0.5))}, {(fMaxJM * 2), -0.5, ((static_cast(fMaxJM) * 2.0 - 0.5))}}); - } else if (mFolderSuffix[mEventType] == mFolderSuffix[1]) { + fcovnum = kHistogramRegistry->add((bufnameNum).c_str(), "; x; y; z", kTH3D, {{kstarbins}, {(kMaxJM * 2), -0.5, ((static_cast(kMaxJM) * 2.0 - 0.5))}, {(kMaxJM * 2), -0.5, ((static_cast(kMaxJM) * 2.0 - 0.5))}}); + } else if (kFolderSuffix[kEventType] == kFolderSuffix[1]) { std::string bufnameDen = "CovDen"; - fcovden = mHistogramRegistry->add((bufnameDen).c_str(), "; x; y; z", kTH3D, {{kstarbins}, {(fMaxJM * 2), -0.5, ((static_cast(fMaxJM) * 2.0 - 0.5))}, {(fMaxJM * 2), -0.5, ((static_cast(fMaxJM) * 2.0 - 0.5))}}); + fcovden = kHistogramRegistry->add((bufnameDen).c_str(), "; x; y; z", kTH3D, {{kstarbins}, {(kMaxJM * 2), -0.5, ((static_cast(kMaxJM) * 2.0 - 0.5))}, {(kMaxJM * 2), -0.5, ((static_cast(kMaxJM) * 2.0 - 0.5))}}); } - fbinctn = new TH1D(TString("BinCountNum"), "Bin Occupation (Numerator)", static_cast(KStarBins[0]), KStarBins[1], KStarBins[2]); - fbinctd = new TH1D(TString("BinCountDen"), "Bin Occupation (Denominator)", static_cast(KStarBins[0]), KStarBins[1], KStarBins[2]); + fbinctn = new TH1D(TString("BinCountNum"), "Bin Occupation (Numerator)", static_cast(kStarBins[0]), kStarBins[1], kStarBins[2]); + fbinctd = new TH1D(TString("BinCountDen"), "Bin Occupation (Denominator)", static_cast(kStarBins[0]), kStarBins[1], kStarBins[2]); } /// Set the PDG codes of the two particles involved @@ -135,10 +133,10 @@ class FemtoUniverseSHContainer /// \param pdg2 PDG code of particle two void setPDGCodes(const int pdg1, const int pdg2) { - mMassOne = TDatabasePDG::Instance()->GetParticle(pdg1)->Mass(); - mMassTwo = TDatabasePDG::Instance()->GetParticle(pdg2)->Mass(); - mPDGOne = pdg1; - mPDGTwo = pdg2; + kMassOne = TDatabasePDG::Instance()->GetParticle(pdg1)->Mass(); + kMassTwo = TDatabasePDG::Instance()->GetParticle(pdg2)->Mass(); + kPDGOne = pdg1; + kPDGTwo = pdg2; } /// To compute the bin value for cavariance matrix @@ -147,9 +145,9 @@ class FemtoUniverseSHContainer /// \param zeroimag /// \param ilmprim /// \param primimag - int GetBin(int qbin, int ilmzero, int zeroimag, int ilmprim, int primimag) + int getBin(int qbin, int ilmzero, int zeroimag, int ilmprim, int primimag) { - return qbin * fMaxJM * fMaxJM * 4 + (ilmprim * 2 + primimag) * fMaxJM * 2 + ilmzero * 2 + zeroimag; + return qbin * kMaxJM * kMaxJM * 4 + (ilmprim * 2 + primimag) * kMaxJM * 2 + ilmzero * 2 + zeroimag; } /// Templated function to compute the necessary observables and fill the histograms for respective Spherical Harmonic @@ -159,11 +157,11 @@ class FemtoUniverseSHContainer /// \param ChosenEventType same or mixed event /// \param maxl Maximum valie of L component of the spherical harmonics template - void AddEventPair(T const& part1, T const& part2, uint8_t ChosenEventType, int /*maxl*/, bool isiden) + void addEventPair(T const& part1, T const& part2, uint8_t ChosenEventType, int /*maxl*/, bool isiden) { - std::vector> fYlmBuffer(fMaxJM); + std::vector> fYlmBuffer(kMaxJM); std::vector f3d; - f3d = FemtoUniverseMath::newpairfunc(part1, mMassOne, part2, mMassTwo, isiden); + f3d = FemtoUniverseMath::newpairfunc(part1, kMassOne, part2, kMassTwo, isiden); const float kv = f3d[0]; const float qout = f3d[1]; @@ -172,38 +170,38 @@ class FemtoUniverseSHContainer int nqbin = fbinctn->GetXaxis()->FindFixBin(kv) - 1; - FemtoUniverseSpherHarMath Ylm; - Ylm.YlmUpToL(fMaxL, qout, qside, qlong, fYlmBuffer.data()); + FemtoUniverseSpherHarMath kYlm; + kYlm.doYlmUpToL(kMaxL, qout, qside, qlong, fYlmBuffer.data()); - if (ChosenEventType == femtoUniverseSHContainer::EventType::same) { - for (int ihist = 0; ihist < fMaxJM; ihist++) { + if (ChosenEventType == femto_universe_sh_container::EventType::same) { + for (int ihist = 0; ihist < kMaxJM; ihist++) { fnumsreal[ihist]->Fill(kv, real(fYlmBuffer[ihist])); fnumsimag[ihist]->Fill(kv, -imag(fYlmBuffer[ihist])); fbinctn->Fill(kv, 1.0); } if (nqbin < fbinctn->GetNbinsX()) { - for (int ilmzero = 0; ilmzero < fMaxJM; ilmzero++) { - for (int ilmprim = 0; ilmprim < fMaxJM; ilmprim++) { - fcovmnum[GetBin(nqbin, ilmzero, 0, ilmprim, 0)] += (real(fYlmBuffer[ilmzero]) * real(fYlmBuffer[ilmprim])); - fcovmnum[GetBin(nqbin, ilmzero, 0, ilmprim, 1)] += (real(fYlmBuffer[ilmzero]) * -imag(fYlmBuffer[ilmprim])); - fcovmnum[GetBin(nqbin, ilmzero, 1, ilmprim, 0)] += (-imag(fYlmBuffer[ilmzero]) * real(fYlmBuffer[ilmprim])); - fcovmnum[GetBin(nqbin, ilmzero, 1, ilmprim, 1)] += (-imag(fYlmBuffer[ilmzero]) * -imag(fYlmBuffer[ilmprim])); + for (int ilmzero = 0; ilmzero < kMaxJM; ilmzero++) { + for (int ilmprim = 0; ilmprim < kMaxJM; ilmprim++) { + fcovmnum[getBin(nqbin, ilmzero, 0, ilmprim, 0)] += (real(fYlmBuffer[ilmzero]) * real(fYlmBuffer[ilmprim])); + fcovmnum[getBin(nqbin, ilmzero, 0, ilmprim, 1)] += (real(fYlmBuffer[ilmzero]) * -imag(fYlmBuffer[ilmprim])); + fcovmnum[getBin(nqbin, ilmzero, 1, ilmprim, 0)] += (-imag(fYlmBuffer[ilmzero]) * real(fYlmBuffer[ilmprim])); + fcovmnum[getBin(nqbin, ilmzero, 1, ilmprim, 1)] += (-imag(fYlmBuffer[ilmzero]) * -imag(fYlmBuffer[ilmprim])); } } } - } else if (ChosenEventType == femtoUniverseSHContainer::EventType::mixed) { - for (int ihist = 0; ihist < fMaxJM; ihist++) { + } else if (ChosenEventType == femto_universe_sh_container::EventType::mixed) { + for (int ihist = 0; ihist < kMaxJM; ihist++) { fdensreal[ihist]->Fill(kv, real(fYlmBuffer[ihist])); fdensimag[ihist]->Fill(kv, -imag(fYlmBuffer[ihist])); } if (nqbin < fbinctn->GetNbinsX()) { - for (int ilmzero = 0; ilmzero < fMaxJM; ilmzero++) { - for (int ilmprim = 0; ilmprim < fMaxJM; ilmprim++) { - fcovmden[GetBin(nqbin, ilmzero, 0, ilmprim, 0)] += (real(fYlmBuffer[ilmzero]) * real(fYlmBuffer[ilmprim])); - fcovmden[GetBin(nqbin, ilmzero, 0, ilmprim, 1)] += (real(fYlmBuffer[ilmzero]) * -imag(fYlmBuffer[ilmprim])); - fcovmden[GetBin(nqbin, ilmzero, 1, ilmprim, 0)] += (-imag(fYlmBuffer[ilmzero]) * real(fYlmBuffer[ilmprim])); - fcovmden[GetBin(nqbin, ilmzero, 1, ilmprim, 1)] += (-imag(fYlmBuffer[ilmzero]) * -imag(fYlmBuffer[ilmprim])); + for (int ilmzero = 0; ilmzero < kMaxJM; ilmzero++) { + for (int ilmprim = 0; ilmprim < kMaxJM; ilmprim++) { + fcovmden[getBin(nqbin, ilmzero, 0, ilmprim, 0)] += (real(fYlmBuffer[ilmzero]) * real(fYlmBuffer[ilmprim])); + fcovmden[getBin(nqbin, ilmzero, 0, ilmprim, 1)] += (real(fYlmBuffer[ilmzero]) * -imag(fYlmBuffer[ilmprim])); + fcovmden[getBin(nqbin, ilmzero, 1, ilmprim, 0)] += (-imag(fYlmBuffer[ilmzero]) * real(fYlmBuffer[ilmprim])); + fcovmden[getBin(nqbin, ilmzero, 1, ilmprim, 1)] += (-imag(fYlmBuffer[ilmzero]) * -imag(fYlmBuffer[ilmprim])); } } } @@ -213,23 +211,23 @@ class FemtoUniverseSHContainer /// Function to fill covariance matrix in 3D histograms /// \param ChosenEventType same or mixed event /// \param MaxJM Maximum value of J - void PackCov(uint8_t ChosenEventType, int /*MaxJM*/) + void packCov(uint8_t ChosenEventType, int /*MaxJM*/) { - if (ChosenEventType == femtoUniverseSHContainer::EventType::same) { + if (ChosenEventType == femto_universe_sh_container::EventType::same) { for (int ibin = 1; ibin <= fcovnum->GetNbinsX(); ibin++) { - for (int ilmz = 0; ilmz < fMaxJM * 2; ilmz++) { - for (int ilmp = 0; ilmp < fMaxJM * 2; ilmp++) { - auto bin = GetBin(ibin - 1, ilmz / 2, ilmz % 2, ilmp / 2, ilmp % 2); + for (int ilmz = 0; ilmz < kMaxJM * 2; ilmz++) { + for (int ilmp = 0; ilmp < kMaxJM * 2; ilmp++) { + auto bin = getBin(ibin - 1, ilmz / 2, ilmz % 2, ilmp / 2, ilmp % 2); auto value = fcovmnum[bin]; fcovnum->SetBinContent(ibin, ilmz + 1, ilmp + 1, value); } } } - } else if (ChosenEventType == femtoUniverseSHContainer::EventType::mixed) { + } else if (ChosenEventType == femto_universe_sh_container::EventType::mixed) { for (int ibin = 1; ibin <= fcovden->GetNbinsX(); ibin++) { - for (int ilmz = 0; ilmz < fMaxJM * 2; ilmz++) { - for (int ilmp = 0; ilmp < fMaxJM * 2; ilmp++) { - auto bin = GetBin(ibin - 1, ilmz / 2, ilmz % 2, ilmp / 2, ilmp % 2); + for (int ilmz = 0; ilmz < kMaxJM * 2; ilmz++) { + for (int ilmp = 0; ilmp < kMaxJM * 2; ilmp++) { + auto bin = getBin(ibin - 1, ilmz / 2, ilmz % 2, ilmp / 2, ilmp % 2); auto value = fcovmden[bin]; fcovden->SetBinContent(ibin, ilmz + 1, ilmp + 1, value); } @@ -250,23 +248,23 @@ class FemtoUniverseSHContainer TH1D* fbinctn; TH1D* fbinctd; - static constexpr int fMaxL = 1; - static constexpr int fMaxJM = (fMaxL + 1) * (fMaxL + 1); + static constexpr int kMaxL = 1; + static constexpr int kMaxJM = (kMaxL + 1) * (kMaxL + 1); - std::array fcovmnum{}; ///< Covariance matrix for the numerator - std::array fcovmden{}; ///< Covariance matrix for the numerator + std::array fcovmnum{}; ///< Covariance matrix for the numerator + std::array fcovmden{}; ///< Covariance matrix for the numerator protected: - HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output - static constexpr std::string_view mFolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to mEventType - static constexpr int mEventType = eventType; ///< Type of the event (same/mixed, according to FEMTOUNIVERSESHCONTAINER::EventType) - float mMassOne = 0.f; ///< PDG mass of particle 1 - float mMassTwo = 0.f; ///< PDG mass of particle 2 - int mPDGOne = 0; ///< PDG code of particle 1 - int mPDGTwo = 0; ///< PDG code of particle 2 - std::vector KStarBins; + HistogramRegistry* kHistogramRegistry = nullptr; ///< For QA output + static constexpr std::string_view kFolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to kEventType + static constexpr int kEventType = eventType; ///< Type of the event (same/mixed, according to FEMTOUNIVERSESHCONTAINER::EventType) + float kMassOne = 0.f; ///< PDG mass of particle 1 + float kMassTwo = 0.f; ///< PDG mass of particle 2 + int kPDGOne = 0; ///< PDG code of particle 1 + int kPDGTwo = 0; ///< PDG code of particle 2 + std::vector kStarBins; }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSESHCONTAINER_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h index 4e97786092d..ac49b2d6f42 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h @@ -19,10 +19,10 @@ #include -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { -namespace femtoUniverseSelection +namespace femto_universe_selection { /// Type of selection to be employed enum SelectionType { kUpperLimit, ///< simple upper limit for the value, e.g. p_T < 1 GeV/c @@ -32,7 +32,7 @@ enum SelectionType { kUpperLimit, ///< simple upper limit for the value, e.g. kEqual ///< values need to be equal, e.g. sign = 1 }; -} // namespace femtoUniverseSelection +} // namespace femto_universe_selection /// Simple class taking care of individual selections /// \todo In principle all cuts that fulfill the getMinimalSelection are done implicitly and can be removed from the vector containing all cuts @@ -49,7 +49,7 @@ class FemtoUniverseSelection /// \param selVal Value used for the selection /// \param selVar Variable used for the selection /// \param selType Type of selection to be employed - FemtoUniverseSelection(selValDataType selVal, selVariableDataType selVar, femtoUniverseSelection::SelectionType selType) + FemtoUniverseSelection(selValDataType selVal, selVariableDataType selVar, femto_universe_selection::SelectionType selType) : mSelVal(selVal), mSelVar(selVar), mSelType(selType) @@ -69,7 +69,7 @@ class FemtoUniverseSelection /// Get the type of selection to be employed /// \return Type of selection to be employed - femtoUniverseSelection::SelectionType getSelectionType() { return mSelType; } + femto_universe_selection::SelectionType getSelectionType() { return mSelType; } /// Check whether the selection is fulfilled or not /// \param observable Value of the variable to be checked @@ -77,17 +77,17 @@ class FemtoUniverseSelection bool isSelected(selValDataType observable) { switch (mSelType) { - case (femtoUniverseSelection::SelectionType::kUpperLimit): + case (femto_universe_selection::SelectionType::kUpperLimit): return (observable < mSelVal); - case (femtoUniverseSelection::SelectionType::kAbsUpperLimit): + case (femto_universe_selection::SelectionType::kAbsUpperLimit): return (std::abs(observable) < mSelVal); break; - case (femtoUniverseSelection::SelectionType::kLowerLimit): + case (femto_universe_selection::SelectionType::kLowerLimit): return (observable > mSelVal); - case (femtoUniverseSelection::SelectionType::kAbsLowerLimit): + case (femto_universe_selection::SelectionType::kAbsLowerLimit): return (std::abs(observable) > mSelVal); break; - case (femtoUniverseSelection::SelectionType::kEqual): + case (femto_universe_selection::SelectionType::kEqual): /// \todo can the comparison be done a bit nicer? return (std::abs(observable - mSelVal) < std::abs(mSelVal * 1e-6)); break; @@ -123,11 +123,11 @@ class FemtoUniverseSelection } private: - selValDataType mSelVal{0.f}; ///< Value used for the selection - selVariableDataType mSelVar; ///< Variable used for the selection - femtoUniverseSelection::SelectionType mSelType; ///< Type of selection employed + selValDataType mSelVal{0.f}; ///< Value used for the selection + selVariableDataType mSelVar; ///< Variable used for the selection + femto_universe_selection::SelectionType mSelType; ///< Type of selection employed }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSESELECTION_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseSpherHarMath.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseSpherHarMath.h index 07fe6f4e996..bb0e8bdaf22 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseSpherHarMath.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseSpherHarMath.h @@ -16,7 +16,6 @@ #ifndef PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSESPHERHARMATH_H_ #define PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSESPHERHARMATH_H_ -#include #include #include @@ -25,7 +24,7 @@ #include "TLorentzVector.h" #include "TMath.h" -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { /// \class FemtoUniverseMath @@ -34,39 +33,39 @@ class FemtoUniverseSpherHarMath { public: /// Values of various coefficients - void InitializeYlms() + void initializeYlms() { - double oneoversqrtpi = 1.0 / TMath::Sqrt(TMath::Pi()); + double oneoversqrtpi = 1.0 / std::sqrt(o2::constants::math::PI); // l=0 prefactors fgPrefactors[0] = 0.5 * oneoversqrtpi; // l=1 prefactors - fgPrefactors[1] = 0.5 * sqrt(3.0 / 2.0) * oneoversqrtpi; - fgPrefactors[2] = 0.5 * sqrt(3.0) * oneoversqrtpi; + fgPrefactors[1] = 0.5 * std::sqrt(3.0 / 2.0) * oneoversqrtpi; + fgPrefactors[2] = 0.5 * std::sqrt(3.0) * oneoversqrtpi; fgPrefactors[3] = -fgPrefactors[1]; // l=2 prefactors - fgPrefactors[4] = 0.25 * sqrt(15.0 / 2.0) * oneoversqrtpi; - fgPrefactors[5] = 0.5 * sqrt(15.0 / 2.0) * oneoversqrtpi; - fgPrefactors[6] = 0.25 * sqrt(5.0) * oneoversqrtpi; + fgPrefactors[4] = 0.25 * std::sqrt(15.0 / 2.0) * oneoversqrtpi; + fgPrefactors[5] = 0.5 * std::sqrt(15.0 / 2.0) * oneoversqrtpi; + fgPrefactors[6] = 0.25 * std::sqrt(5.0) * oneoversqrtpi; fgPrefactors[7] = -fgPrefactors[5]; fgPrefactors[8] = fgPrefactors[4]; // l=3 prefactors - fgPrefactors[9] = 0.125 * sqrt(35.0) * oneoversqrtpi; - fgPrefactors[10] = 0.25 * sqrt(105.0 / 2.0) * oneoversqrtpi; - fgPrefactors[11] = 0.125 * sqrt(21.0) * oneoversqrtpi; - fgPrefactors[12] = 0.25 * sqrt(7.0) * oneoversqrtpi; + fgPrefactors[9] = 0.125 * std::sqrt(35.0) * oneoversqrtpi; + fgPrefactors[10] = 0.25 * std::sqrt(105.0 / 2.0) * oneoversqrtpi; + fgPrefactors[11] = 0.125 * std::sqrt(21.0) * oneoversqrtpi; + fgPrefactors[12] = 0.25 * std::sqrt(7.0) * oneoversqrtpi; fgPrefactors[13] = -fgPrefactors[11]; fgPrefactors[14] = fgPrefactors[10]; fgPrefactors[15] = -fgPrefactors[9]; // l=4 prefactors - fgPrefactors[16] = 3.0 / 16.0 * sqrt(35.0 / 2.0) * oneoversqrtpi; - fgPrefactors[17] = 3.0 / 8.0 * sqrt(35.0) * oneoversqrtpi; - fgPrefactors[18] = 3.0 / 8.0 * sqrt(5.0 / 2.0) * oneoversqrtpi; - fgPrefactors[19] = 3.0 / 8.0 * sqrt(5.0) * oneoversqrtpi; + fgPrefactors[16] = 3.0 / 16.0 * std::sqrt(35.0 / 2.0) * oneoversqrtpi; + fgPrefactors[17] = 3.0 / 8.0 * std::sqrt(35.0) * oneoversqrtpi; + fgPrefactors[18] = 3.0 / 8.0 * std::sqrt(5.0 / 2.0) * oneoversqrtpi; + fgPrefactors[19] = 3.0 / 8.0 * std::sqrt(5.0) * oneoversqrtpi; fgPrefactors[20] = 3.0 / 16.0 * oneoversqrtpi; fgPrefactors[21] = -fgPrefactors[19]; fgPrefactors[22] = fgPrefactors[18]; @@ -74,12 +73,12 @@ class FemtoUniverseSpherHarMath fgPrefactors[24] = fgPrefactors[16]; // l=5 prefactors - fgPrefactors[25] = 3.0 / 32.0 * sqrt(77.0) * oneoversqrtpi; - fgPrefactors[26] = 3.0 / 16.0 * sqrt(385.0 / 2.0) * oneoversqrtpi; - fgPrefactors[27] = 1.0 / 32.0 * sqrt(385.0) * oneoversqrtpi; - fgPrefactors[28] = 1.0 / 8.0 * sqrt(1155.0 / 2.0) * oneoversqrtpi; - fgPrefactors[29] = 1.0 / 16.0 * sqrt(165.0 / 2.0) * oneoversqrtpi; - fgPrefactors[30] = 1.0 / 16.0 * sqrt(11.0) * oneoversqrtpi; + fgPrefactors[25] = 3.0 / 32.0 * std::sqrt(77.0) * oneoversqrtpi; + fgPrefactors[26] = 3.0 / 16.0 * std::sqrt(385.0 / 2.0) * oneoversqrtpi; + fgPrefactors[27] = 1.0 / 32.0 * std::sqrt(385.0) * oneoversqrtpi; + fgPrefactors[28] = 1.0 / 8.0 * std::sqrt(1155.0 / 2.0) * oneoversqrtpi; + fgPrefactors[29] = 1.0 / 16.0 * std::sqrt(165.0 / 2.0) * oneoversqrtpi; + fgPrefactors[30] = 1.0 / 16.0 * std::sqrt(11.0) * oneoversqrtpi; fgPrefactors[31] = -fgPrefactors[29]; fgPrefactors[32] = fgPrefactors[28]; fgPrefactors[33] = -fgPrefactors[27]; @@ -105,7 +104,7 @@ class FemtoUniverseSpherHarMath /// \param lmax Maximum value of L component /// \param ctheta Value of theta /// \param lbuf values of coefficients - void LegendreUpToYlm(int lmax, double ctheta, double* lbuf) + void legendreUpToYlm(int lmax, double ctheta, double* lbuf) { // Calculate a set of legendre polynomials up to a given l // with spherical input @@ -113,7 +112,7 @@ class FemtoUniverseSpherHarMath double coss[6]; sins[0] = 0.0; coss[0] = 1.0; - sins[1] = sqrt(1 - ctheta * ctheta); + sins[1] = std::sqrt(1 - ctheta * ctheta); coss[1] = ctheta; for (int iter = 2; iter < 6; iter++) { sins[iter] = sins[iter - 1] * sins[1]; @@ -165,21 +164,21 @@ class FemtoUniverseSpherHarMath } /// Function to calculate a set of Ylms up to a given l with cartesian input - void YlmUpToL(int lmax, double x, double y, double z, std::complex* ylms) + void doYlmUpToL(int lmax, double x, double y, double z, std::complex* ylms) { double ctheta, phi; - double r = sqrt(x * x + y * y + z * z); - if (r < 1e-10 || fabs(z) < 1e-10) + double r = std::sqrt(x * x + y * y + z * z); + if (r < 1e-10 || std::fabs(z) < 1e-10) ctheta = 0.0; else ctheta = z / r; - phi = atan2(y, x); - YlmUpToL(lmax, ctheta, phi, ylms); + phi = std::atan2(y, x); + doYlmUpToL(lmax, ctheta, phi, ylms); } /// Function to calculate a set of Ylms up to a given l with spherical input - void YlmUpToL(int lmax, double ctheta, double phi, std::complex* ylms) + void doYlmUpToL(int lmax, double ctheta, double phi, std::complex* ylms) { int lcur = 0; double lpol; @@ -188,12 +187,12 @@ class FemtoUniverseSpherHarMath double sins[6]; double lbuf[36]; - LegendreUpToYlm(lmax, ctheta, lbuf); - InitializeYlms(); + legendreUpToYlm(lmax, ctheta, lbuf); + initializeYlms(); for (int iter = 1; iter <= lmax; iter++) { - coss[iter - 1] = cos(iter * phi); - sins[iter - 1] = sin(iter * phi); + coss[iter - 1] = std::cos(iter * phi); + sins[iter - 1] = std::sin(iter * phi); } ylms[lcur++] = fgPrefactors[0] * lbuf[0] * std::complex(1, 0); @@ -212,13 +211,13 @@ class FemtoUniverseSpherHarMath } private: - static std::complex Ceiphi(double phi); + static std::complex fCeiphi(double phi); std::array fgPrefactors; std::array fgPrefshift; std::array fgPlmshift; }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSESPHERHARMATH_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h index 389273d0836..79ee6e167ca 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h @@ -9,8 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file FemtoUniverseTrackCuts.h -/// \brief Definition of the FemtoUniverseTrackCuts +/// \file FemtoUniverseTrackSelection.h +/// \brief Definition of the FemtoUniverseTrackSelection /// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de /// \author Luca Barioglio, TU München, luca.barioglio@cern.ch /// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch @@ -32,9 +32,9 @@ // using namespace o2::framework; -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { -namespace femtoUniverseTrackSelection +namespace femto_universe_track_selection { /// The different selections this task is capable of doing enum TrackSel { kSign, ///< Sign of the track @@ -58,11 +58,11 @@ enum TrackContainerPosition { kPID }; /// Position in the full track cut container -} // namespace femtoUniverseTrackSelection +} // namespace femto_universe_track_selection /// \class FemtoUniverseTrackCuts /// \brief Cut class to contain and execute all cuts applied to tracks -class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection +class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection { public: FemtoUniverseTrackSelection() : nRejectNotPropagatedTracks(false), @@ -108,7 +108,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection tmpPids = pids; /// necessary due to some features of the configurable - for (o2::track::PID pid : tmpPids) { + for (const o2::track::PID pid : tmpPids) { kPIDspecies.push_back(pid); } } @@ -157,7 +157,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection(prefix); outString += static_cast(kSelectionNames[iSel]); @@ -181,7 +181,7 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection(prefix); outString += static_cast(kSelectionHelper[iSel]); @@ -258,20 +258,20 @@ class FemtoUniverseTrackSelection : public FemtoUniverseObjectSelection void FemtoUniverseTrackSelection::init(HistogramRegistry* registry) @@ -297,7 +297,7 @@ void FemtoUniverseTrackSelection::init(HistogramRegistry* registry) std::string folderName = static_cast(o2::aod::femtouniverseparticle::ParticleTypeName[part]) + "/" + static_cast(o2::aod::femtouniverseparticle::TrackTypeName[tracktype]); /// check whether the number of selection exceeds the bitmap size - unsigned int nSelections = getNSelections() - getNSelections(femtoUniverseTrackSelection::kPIDnSigmaMax); + unsigned int nSelections = getNSelections() - getNSelections(femto_universe_track_selection::kPIDnSigmaMax); if (nSelections > 8 * sizeof(cutContainerType)) { LOG(fatal) << "FemtoUniverseTrackCuts: Number of selections too large for your container - quitting!"; } @@ -334,33 +334,33 @@ void FemtoUniverseTrackSelection::init(HistogramRegistry* registry) mHistogramRegistry->add((folderName + "/nSigmaComb_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{d}", kTH2F, {{100, 0, 10}, {200, -4.975, 5.025}}); } /// set cuts - nPtMinSel = getNSelections(femtoUniverseTrackSelection::kpTMin); - nPtMaxSel = getNSelections(femtoUniverseTrackSelection::kpTMax); - nEtaSel = getNSelections(femtoUniverseTrackSelection::kEtaMax); - nTPCnMinSel = getNSelections(femtoUniverseTrackSelection::kTPCnClsMin); - nTPCfMinSel = getNSelections(femtoUniverseTrackSelection::kTPCfClsMin); - nTPCcMinSel = getNSelections(femtoUniverseTrackSelection::kTPCcRowsMin); - nTPCsMaxSel = getNSelections(femtoUniverseTrackSelection::kTPCsClsMax); - nITScMinSel = getNSelections(femtoUniverseTrackSelection::kITSnClsMin); - nITScIbMinSel = getNSelections(femtoUniverseTrackSelection::kITSnClsIbMin); - nDCAxyMaxSel = getNSelections(femtoUniverseTrackSelection::kDCAxyMax); - nDCAzMaxSel = getNSelections(femtoUniverseTrackSelection::kDCAzMax); - nDCAMinSel = getNSelections(femtoUniverseTrackSelection::kDCAMin); - nPIDnSigmaSel = getNSelections(femtoUniverseTrackSelection::kPIDnSigmaMax); - - pTMin = getMinimalSelection(femtoUniverseTrackSelection::kpTMin, femtoUniverseSelection::kLowerLimit); - pTMax = getMinimalSelection(femtoUniverseTrackSelection::kpTMax, femtoUniverseSelection::kUpperLimit); - etaMax = getMinimalSelection(femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - nClsMin = getMinimalSelection(femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - fClsMin = getMinimalSelection(femtoUniverseTrackSelection::kTPCfClsMin, femtoUniverseSelection::kLowerLimit); - cTPCMin = getMinimalSelection(femtoUniverseTrackSelection::kTPCcRowsMin, femtoUniverseSelection::kLowerLimit); - sTPCMax = getMinimalSelection(femtoUniverseTrackSelection::kTPCsClsMax, femtoUniverseSelection::kUpperLimit); - nITSclsMin = getMinimalSelection(femtoUniverseTrackSelection::kITSnClsMin, femtoUniverseSelection::kLowerLimit); - nITSclsIbMin = getMinimalSelection(femtoUniverseTrackSelection::kITSnClsIbMin, femtoUniverseSelection::kLowerLimit); - dcaXYMax = getMinimalSelection(femtoUniverseTrackSelection::kDCAxyMax, femtoUniverseSelection::kAbsUpperLimit); - dcaZMax = getMinimalSelection(femtoUniverseTrackSelection::kDCAzMax, femtoUniverseSelection::kAbsUpperLimit); - dcaMin = getMinimalSelection(femtoUniverseTrackSelection::kDCAMin, femtoUniverseSelection::kAbsLowerLimit); - nSigmaPIDMax = getMinimalSelection(femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); + nPtMinSel = getNSelections(femto_universe_track_selection::kpTMin); + nPtMaxSel = getNSelections(femto_universe_track_selection::kpTMax); + nEtaSel = getNSelections(femto_universe_track_selection::kEtaMax); + nTPCnMinSel = getNSelections(femto_universe_track_selection::kTPCnClsMin); + nTPCfMinSel = getNSelections(femto_universe_track_selection::kTPCfClsMin); + nTPCcMinSel = getNSelections(femto_universe_track_selection::kTPCcRowsMin); + nTPCsMaxSel = getNSelections(femto_universe_track_selection::kTPCsClsMax); + nITScMinSel = getNSelections(femto_universe_track_selection::kITSnClsMin); + nITScIbMinSel = getNSelections(femto_universe_track_selection::kITSnClsIbMin); + nDCAxyMaxSel = getNSelections(femto_universe_track_selection::kDCAxyMax); + nDCAzMaxSel = getNSelections(femto_universe_track_selection::kDCAzMax); + nDCAMinSel = getNSelections(femto_universe_track_selection::kDCAMin); + nPIDnSigmaSel = getNSelections(femto_universe_track_selection::kPIDnSigmaMax); + + pTMin = getMinimalSelection(femto_universe_track_selection::kpTMin, femto_universe_selection::kLowerLimit); + pTMax = getMinimalSelection(femto_universe_track_selection::kpTMax, femto_universe_selection::kUpperLimit); + etaMax = getMinimalSelection(femto_universe_track_selection::kEtaMax, femto_universe_selection::kAbsUpperLimit); + nClsMin = getMinimalSelection(femto_universe_track_selection::kTPCnClsMin, femto_universe_selection::kLowerLimit); + fClsMin = getMinimalSelection(femto_universe_track_selection::kTPCfClsMin, femto_universe_selection::kLowerLimit); + cTPCMin = getMinimalSelection(femto_universe_track_selection::kTPCcRowsMin, femto_universe_selection::kLowerLimit); + sTPCMax = getMinimalSelection(femto_universe_track_selection::kTPCsClsMax, femto_universe_selection::kUpperLimit); + nITSclsMin = getMinimalSelection(femto_universe_track_selection::kITSnClsMin, femto_universe_selection::kLowerLimit); + nITSclsIbMin = getMinimalSelection(femto_universe_track_selection::kITSnClsIbMin, femto_universe_selection::kLowerLimit); + dcaXYMax = getMinimalSelection(femto_universe_track_selection::kDCAxyMax, femto_universe_selection::kAbsUpperLimit); + dcaZMax = getMinimalSelection(femto_universe_track_selection::kDCAzMax, femto_universe_selection::kAbsUpperLimit); + dcaMin = getMinimalSelection(femto_universe_track_selection::kDCAMin, femto_universe_selection::kAbsLowerLimit); + nSigmaPIDMax = getMinimalSelection(femto_universe_track_selection::kPIDnSigmaMax, femto_universe_selection::kAbsUpperLimit); } template @@ -396,7 +396,7 @@ bool FemtoUniverseTrackSelection::isSelectedMinimal(T const& track) const auto dca = track.dcaXY(); // Accordingly to FemtoUniverse in AliPhysics as well as LF analysis, // only dcaXY should be checked; NOT std::sqrt(pow(dcaXY, 2.) + pow(dcaZ, 2.)) std::vector pidTPC, pidTOF; - for (auto it : kPIDspecies) { + for (const auto it : kPIDspecies) { pidTPC.push_back(getNsigmaTPC(track, it)); pidTOF.push_back(getNsigmaTOF(track, it)); } @@ -484,7 +484,7 @@ std::array FemtoUniverseTrackSelection::getCutContainer(T c float observable = 0.; for (auto& sel : mSelections) { const auto selVariable = sel.getSelectionVariable(); - if (selVariable == femtoUniverseTrackSelection::kPIDnSigmaMax) { + if (selVariable == femto_universe_track_selection::kPIDnSigmaMax) { /// PID needs to be handled a bit differently since we may need more than one species for (size_t i = 0; i < kPIDspecies.size(); ++i) { auto pidTPCVal = pidTPC.at(i) - nSigmaPIDOffsetTPC; @@ -497,44 +497,44 @@ std::array FemtoUniverseTrackSelection::getCutContainer(T c } else { /// for the rest it's all the same switch (selVariable) { - case (femtoUniverseTrackSelection::kSign): + case (femto_universe_track_selection::kSign): observable = sign; break; - case (femtoUniverseTrackSelection::kpTMin): - case (femtoUniverseTrackSelection::kpTMax): + case (femto_universe_track_selection::kpTMin): + case (femto_universe_track_selection::kpTMax): observable = pT; break; - case (femtoUniverseTrackSelection::kEtaMax): + case (femto_universe_track_selection::kEtaMax): observable = eta; break; - case (femtoUniverseTrackSelection::kTPCnClsMin): + case (femto_universe_track_selection::kTPCnClsMin): observable = tpcNClsF; break; - case (femtoUniverseTrackSelection::kTPCfClsMin): + case (femto_universe_track_selection::kTPCfClsMin): observable = tpcRClsC; break; - case (femtoUniverseTrackSelection::kTPCcRowsMin): + case (femto_universe_track_selection::kTPCcRowsMin): observable = tpcNClsC; break; - case (femtoUniverseTrackSelection::kTPCsClsMax): + case (femto_universe_track_selection::kTPCsClsMax): observable = tpcNClsS; break; - case (femtoUniverseTrackSelection::kITSnClsMin): + case (femto_universe_track_selection::kITSnClsMin): observable = itsNCls; break; - case (femtoUniverseTrackSelection::kITSnClsIbMin): + case (femto_universe_track_selection::kITSnClsIbMin): observable = itsNClsIB; break; - case (femtoUniverseTrackSelection::kDCAxyMax): + case (femto_universe_track_selection::kDCAxyMax): observable = dcaXY; break; - case (femtoUniverseTrackSelection::kDCAzMax): + case (femto_universe_track_selection::kDCAzMax): observable = dcaZ; break; - case (femtoUniverseTrackSelection::kDCAMin): + case (femto_universe_track_selection::kDCAMin): observable = dca; break; - case (femtoUniverseTrackSelection::kPIDnSigmaMax): + case (femto_universe_track_selection::kPIDnSigmaMax): break; } sel.checkSelectionSetBit(observable, output, counter); @@ -580,6 +580,6 @@ void FemtoUniverseTrackSelection::fillQA(T const& track) } } -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSETRACKSELECTION_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h index 642b11c116f..87c0a1cc406 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h @@ -19,12 +19,9 @@ #ifndef PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEV0SELECTION_H_ #define PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEV0SELECTION_H_ -#include #include #include -#include // FIXME - #include "PWGCF/FemtoUniverse/Core/FemtoUniverseObjectSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" @@ -33,11 +30,9 @@ #include "Framework/HistogramRegistry.h" #include "ReconstructionDataFormats/PID.h" -using namespace o2::framework; - -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { -namespace femtoUniverseV0Selection +namespace femto_universe_v0_selection { /// The different selections this task is capable of doing enum V0Sel { @@ -63,16 +58,16 @@ enum V0ContainerPosition { kNegPID, }; /// Position in the full VO cut container -} // namespace femtoUniverseV0Selection +} // namespace femto_universe_v0_selection /// \class FemtoUniverseV0Selection /// \brief Cut class to contain and execute all cuts applied to V0s class FemtoUniverseV0Selection - : public FemtoUniverseObjectSelection + : public FemtoUniverseObjectSelection { public: FemtoUniverseV0Selection() - : nPtV0MinSel(0), nPtV0MaxSel(0), nEtaV0MaxSel(0), nDCAV0DaughMax(0), nCPAV0Min(0), nTranRadV0Min(0), nTranRadV0Max(0), nDecVtxMax(0), pTV0Min(9999999.), pTV0Max(-9999999.), etaV0Max(-9999999.), DCAV0DaughMax(-9999999.), CPAV0Min(9999999.), TranRadV0Min(9999999.), TranRadV0Max(-9999999.), DecVtxMax(-9999999.), fInvMassLowLimit(1.05), fInvMassUpLimit(1.3), fRejectKaon(false), fInvMassKaonLowLimit(0.48), fInvMassKaonUpLimit(0.515), nSigmaPIDOffsetTPC(0.) {} + : nPtV0MinSel(0), nPtV0MaxSel(0), nEtaV0MaxSel(0), nDCAV0DaughMax(0), nCPAV0Min(0), nTranRadV0Min(0), nTranRadV0Max(0), nDecVtxMax(0), pTV0Min(9999999.), pTV0Max(-9999999.), etaV0Max(-9999999.), kDCAV0DaughMax(-9999999.), kCPAV0Min(9999999.), kTranRadV0Min(9999999.), kTranRadV0Max(-9999999.), kDecVtxMax(-9999999.), fInvMassLowLimit(1.05), fInvMassUpLimit(1.3), fRejectKaon(false), fInvMassKaonLowLimit(0.48), fInvMassKaonUpLimit(0.515), nSigmaPIDOffsetTPC(0.) {} /// Initializes histograms for the task template - void setChildCuts(femtoUniverseV0Selection::ChildTrackType child, T1 selVal, - T2 selVar, femtoUniverseSelection::SelectionType selType) + void setChildCuts(femto_universe_v0_selection::ChildTrackType child, T1 selVal, + T2 selVar, femto_universe_selection::SelectionType selType) { - if (child == femtoUniverseV0Selection::kPosTrack) { - PosDaughTrack.setSelection(selVal, selVar, selType); - } else if (child == femtoUniverseV0Selection::kNegTrack) { - NegDaughTrack.setSelection(selVal, selVar, selType); + if (child == femto_universe_v0_selection::kPosTrack) { + posDaughTrack.setSelection(selVal, selVar, selType); + } else if (child == femto_universe_v0_selection::kNegTrack) { + negDaughTrack.setSelection(selVal, selVar, selType); } } template - void setChildPIDSpecies(femtoUniverseV0Selection::ChildTrackType child, + void setChildPIDSpecies(femto_universe_v0_selection::ChildTrackType child, T& pids) { - if (child == femtoUniverseV0Selection::kPosTrack) { - PosDaughTrack.setPIDSpecies(pids); - } else if (child == femtoUniverseV0Selection::kNegTrack) { - NegDaughTrack.setPIDSpecies(pids); + if (child == femto_universe_v0_selection::kPosTrack) { + posDaughTrack.setPIDSpecies(pids); + } else if (child == femto_universe_v0_selection::kNegTrack) { + negDaughTrack.setPIDSpecies(pids); } } @@ -124,12 +119,12 @@ class FemtoUniverseV0Selection /// \param iSel Track selection variable to be examined /// \param prefix Additional prefix for the name of the configurable /// \param suffix Additional suffix for the name of the configurable - static std::string getSelectionName(femtoUniverseV0Selection::V0Sel iSel, + static std::string getSelectionName(femto_universe_v0_selection::V0Sel iSel, std::string_view prefix = "", std::string_view suffix = "") { std::string outString = static_cast(prefix); - outString += static_cast(mSelectionNames[iSel]); + outString += static_cast(kSelectionNames[iSel]); outString += suffix; return outString; } @@ -142,7 +137,7 @@ class FemtoUniverseV0Selection { for (int index = 0; index < kNv0Selection; index++) { std::string comp = static_cast(prefix) + - static_cast(mSelectionNames[index]); + static_cast(kSelectionNames[index]); std::string_view cmp{comp}; if (obs.compare(cmp) == 0) return index; @@ -153,8 +148,7 @@ class FemtoUniverseV0Selection /// Helper function to obtain the type of a given selection variable for consistent naming of the configurables /// \param iSel V0 selection variable whose type is returned - static femtoUniverseSelection::SelectionType - getSelectionType(femtoUniverseV0Selection::V0Sel iSel) + static femto_universe_selection::SelectionType getSelectionType(femto_universe_v0_selection::V0Sel iSel) { return mSelectionTypes[iSel]; } @@ -163,11 +157,11 @@ class FemtoUniverseV0Selection /// for consistent description of the configurables /// \param iSel Track selection variable to be examined /// \param prefix Additional prefix for the output of the configurable - static std::string getSelectionHelper(femtoUniverseV0Selection::V0Sel iSel, + static std::string getSelectionHelper(femto_universe_v0_selection::V0Sel iSel, std::string_view prefix = "") { std::string outString = static_cast(prefix); - outString += static_cast(mSelectionHelper[iSel]); + outString += static_cast(kSelectionHelper[iSel]); return outString; } @@ -195,21 +189,21 @@ class FemtoUniverseV0Selection nSigmaPIDOffsetTPC = offsetTPC; } - void setChildRejectNotPropagatedTracks(femtoUniverseV0Selection::ChildTrackType child, bool reject) + void setChildRejectNotPropagatedTracks(femto_universe_v0_selection::ChildTrackType child, bool reject) { - if (child == femtoUniverseV0Selection::kPosTrack) { - PosDaughTrack.setRejectNotPropagatedTracks(reject); - } else if (child == femtoUniverseV0Selection::kNegTrack) { - NegDaughTrack.setRejectNotPropagatedTracks(reject); + if (child == femto_universe_v0_selection::kPosTrack) { + posDaughTrack.setRejectNotPropagatedTracks(reject); + } else if (child == femto_universe_v0_selection::kNegTrack) { + negDaughTrack.setRejectNotPropagatedTracks(reject); } } - void setChildnSigmaPIDOffset(femtoUniverseV0Selection::ChildTrackType child, float offsetTPC, float offsetTOF) + void setChildnSigmaPIDOffset(femto_universe_v0_selection::ChildTrackType child, float offsetTPC, float offsetTOF) { - if (child == femtoUniverseV0Selection::kPosTrack) { - PosDaughTrack.setnSigmaPIDOffset(offsetTPC, offsetTOF); - } else if (child == femtoUniverseV0Selection::kNegTrack) { - NegDaughTrack.setnSigmaPIDOffset(offsetTPC, offsetTOF); + if (child == femto_universe_v0_selection::kPosTrack) { + posDaughTrack.setnSigmaPIDOffset(offsetTPC, offsetTOF); + } else if (child == femto_universe_v0_selection::kNegTrack) { + negDaughTrack.setnSigmaPIDOffset(offsetTPC, offsetTOF); } } @@ -225,11 +219,11 @@ class FemtoUniverseV0Selection float pTV0Min; float pTV0Max; float etaV0Max; - float DCAV0DaughMax; - float CPAV0Min; - float TranRadV0Min; - float TranRadV0Max; - float DecVtxMax; + float kDCAV0DaughMax; + float kCPAV0Min; + float kTranRadV0Min; + float kTranRadV0Max; + float kDecVtxMax; float fInvMassLowLimit; float fInvMassUpLimit; @@ -240,30 +234,30 @@ class FemtoUniverseV0Selection float nSigmaPIDOffsetTPC; - FemtoUniverseTrackSelection PosDaughTrack; - FemtoUniverseTrackSelection NegDaughTrack; + FemtoUniverseTrackSelection posDaughTrack; + FemtoUniverseTrackSelection negDaughTrack; static constexpr int kNv0Selection = 9; - static constexpr std::string_view mSelectionNames[kNv0Selection] = { + static constexpr std::string_view kSelectionNames[kNv0Selection] = { "Sign", "PtMin", "PtMax", "EtaMax", "DCAdaughMax", "CPAMin", "TranRadMin", "TranRadMax", "DecVecMax"}; ///< Name of the different ///< selections - static constexpr femtoUniverseSelection::SelectionType + static constexpr femto_universe_selection::SelectionType mSelectionTypes[kNv0Selection]{ - femtoUniverseSelection::kEqual, - femtoUniverseSelection::kLowerLimit, - femtoUniverseSelection::kUpperLimit, - femtoUniverseSelection::kUpperLimit, - femtoUniverseSelection::kUpperLimit, - femtoUniverseSelection::kLowerLimit, - femtoUniverseSelection::kLowerLimit, - femtoUniverseSelection::kUpperLimit, - femtoUniverseSelection::kUpperLimit}; ///< Map to match a variable with - ///< its type - - static constexpr std::string_view mSelectionHelper[kNv0Selection] = { + femto_universe_selection::kEqual, + femto_universe_selection::kLowerLimit, + femto_universe_selection::kUpperLimit, + femto_universe_selection::kUpperLimit, + femto_universe_selection::kUpperLimit, + femto_universe_selection::kLowerLimit, + femto_universe_selection::kLowerLimit, + femto_universe_selection::kUpperLimit, + femto_universe_selection::kUpperLimit}; ///< Map to match a variable with + ///< its type + + static constexpr std::string_view kSelectionHelper[kNv0Selection] = { "+1 for lambda, -1 for antilambda", "Minimum pT (GeV/c)", "Maximum pT (GeV/c)", @@ -275,7 +269,7 @@ class FemtoUniverseV0Selection "Maximum distance from primary vertex"}; ///< Helper information for the ///< different selections -}; // namespace femtoUniverse +}; // namespace femto_universe template add((folderName + "/hEta").c_str(), "; #eta; Entries", kTH1F, {{1000, -1, 1}}); mHistogramRegistry->add((folderName + "/hPhi").c_str(), "; #phi; Entries", - kTH1F, {{1000, 0, 2. * M_PI}}); + kTH1F, {{1000, 0, o2::constants::math::TwoPI}}); mHistogramRegistry->add((folderName + "/hDaughDCA").c_str(), "; DCA^{daugh} (cm); Entries", kTH1F, {{1000, 0, 10}}); @@ -336,11 +330,11 @@ void FemtoUniverseV0Selection::init(HistogramRegistry* registry) mHistogramRegistry->add((folderName + "/hInvMassLambdaAntiLambda").c_str(), "", kTH2F, {massAxisLambda, massAxisAntiLambda}); - PosDaughTrack.init( mHistogramRegistry); - NegDaughTrack.init( mHistogramRegistry); @@ -371,31 +365,31 @@ void FemtoUniverseV0Selection::init(HistogramRegistry* registry) } /// check whether the most open cuts are fulfilled - most of this should have /// already be done by the filters - nPtV0MinSel = getNSelections(femtoUniverseV0Selection::kV0pTMin); - nPtV0MaxSel = getNSelections(femtoUniverseV0Selection::kV0pTMax); - nEtaV0MaxSel = getNSelections(femtoUniverseV0Selection::kV0etaMax); - nDCAV0DaughMax = getNSelections(femtoUniverseV0Selection::kV0DCADaughMax); - nCPAV0Min = getNSelections(femtoUniverseV0Selection::kV0CPAMin); - nTranRadV0Min = getNSelections(femtoUniverseV0Selection::kV0TranRadMin); - nTranRadV0Max = getNSelections(femtoUniverseV0Selection::kV0TranRadMax); - nDecVtxMax = getNSelections(femtoUniverseV0Selection::kV0DecVtxMax); - - pTV0Min = getMinimalSelection(femtoUniverseV0Selection::kV0pTMin, - femtoUniverseSelection::kLowerLimit); - pTV0Max = getMinimalSelection(femtoUniverseV0Selection::kV0pTMax, - femtoUniverseSelection::kUpperLimit); - etaV0Max = getMinimalSelection(femtoUniverseV0Selection::kV0etaMax, - femtoUniverseSelection::kAbsUpperLimit); - DCAV0DaughMax = getMinimalSelection(femtoUniverseV0Selection::kV0DCADaughMax, - femtoUniverseSelection::kUpperLimit); - CPAV0Min = getMinimalSelection(femtoUniverseV0Selection::kV0CPAMin, - femtoUniverseSelection::kLowerLimit); - TranRadV0Min = getMinimalSelection(femtoUniverseV0Selection::kV0TranRadMin, - femtoUniverseSelection::kLowerLimit); - TranRadV0Max = getMinimalSelection(femtoUniverseV0Selection::kV0TranRadMax, - femtoUniverseSelection::kUpperLimit); - DecVtxMax = getMinimalSelection(femtoUniverseV0Selection::kV0DecVtxMax, - femtoUniverseSelection::kAbsUpperLimit); + nPtV0MinSel = getNSelections(femto_universe_v0_selection::kV0pTMin); + nPtV0MaxSel = getNSelections(femto_universe_v0_selection::kV0pTMax); + nEtaV0MaxSel = getNSelections(femto_universe_v0_selection::kV0etaMax); + nDCAV0DaughMax = getNSelections(femto_universe_v0_selection::kV0DCADaughMax); + nCPAV0Min = getNSelections(femto_universe_v0_selection::kV0CPAMin); + nTranRadV0Min = getNSelections(femto_universe_v0_selection::kV0TranRadMin); + nTranRadV0Max = getNSelections(femto_universe_v0_selection::kV0TranRadMax); + nDecVtxMax = getNSelections(femto_universe_v0_selection::kV0DecVtxMax); + + pTV0Min = getMinimalSelection(femto_universe_v0_selection::kV0pTMin, + femto_universe_selection::kLowerLimit); + pTV0Max = getMinimalSelection(femto_universe_v0_selection::kV0pTMax, + femto_universe_selection::kUpperLimit); + etaV0Max = getMinimalSelection(femto_universe_v0_selection::kV0etaMax, + femto_universe_selection::kAbsUpperLimit); + kDCAV0DaughMax = getMinimalSelection(femto_universe_v0_selection::kV0DCADaughMax, + femto_universe_selection::kUpperLimit); + kCPAV0Min = getMinimalSelection(femto_universe_v0_selection::kV0CPAMin, + femto_universe_selection::kLowerLimit); + kTranRadV0Min = getMinimalSelection(femto_universe_v0_selection::kV0TranRadMin, + femto_universe_selection::kLowerLimit); + kTranRadV0Max = getMinimalSelection(femto_universe_v0_selection::kV0TranRadMax, + femto_universe_selection::kUpperLimit); + kDecVtxMax = getMinimalSelection(femto_universe_v0_selection::kV0DecVtxMax, + femto_universe_selection::kAbsUpperLimit); } template @@ -441,42 +435,42 @@ bool FemtoUniverseV0Selection::isSelectedMinimal(C const& /*col*/, V const& v0, if (nEtaV0MaxSel > 0 && std::abs(eta) > etaV0Max) { return false; } - if (nDCAV0DaughMax > 0 && dcaDaughv0 > DCAV0DaughMax) { + if (nDCAV0DaughMax > 0 && dcaDaughv0 > kDCAV0DaughMax) { return false; } - if (nCPAV0Min > 0 && cpav0 < CPAV0Min) { + if (nCPAV0Min > 0 && cpav0 < kCPAV0Min) { return false; } - if (nTranRadV0Min > 0 && tranRad < TranRadV0Min) { + if (nTranRadV0Min > 0 && tranRad < kTranRadV0Min) { return false; } - if (nTranRadV0Max > 0 && tranRad > TranRadV0Max) { + if (nTranRadV0Max > 0 && tranRad > kTranRadV0Max) { return false; } for (size_t i = 0; i < decVtx.size(); i++) { - if (nDecVtxMax > 0 && decVtx.at(i) > DecVtxMax) { + if (nDecVtxMax > 0 && decVtx.at(i) > kDecVtxMax) { return false; } } - if (!PosDaughTrack.isSelectedMinimal(posTrack)) { + if (!posDaughTrack.isSelectedMinimal(posTrack)) { return false; } - if (!NegDaughTrack.isSelectedMinimal(negTrack)) { + if (!negDaughTrack.isSelectedMinimal(negTrack)) { return false; } // check that track combinations for V0 or antiV0 would be fulfilling PID - float nSigmaPIDMax = PosDaughTrack.getSigmaPIDMax(); + float nSigmaPIDMax = posDaughTrack.getSigmaPIDMax(); // antiV0 auto nSigmaPrNeg = negTrack.tpcNSigmaPr(); auto nSigmaPiPos = posTrack.tpcNSigmaPi(); // v0 auto nSigmaPiNeg = negTrack.tpcNSigmaPi(); auto nSigmaPrPos = posTrack.tpcNSigmaPr(); - if (!(abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && - abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax) && - !(abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && - abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax)) { + if (!(std::abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && + std::abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax) && + !(std::abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && + std::abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax)) { return false; } @@ -521,24 +515,24 @@ void FemtoUniverseV0Selection::fillLambdaQA(C const& /*col*/, V const& v0, mHistogramRegistry->fill(HIST("LambdaQA/hInvMassLambdaEtaMax"), v0.mLambda()); } - if (dcaDaughv0 < DCAV0DaughMax) { + if (dcaDaughv0 < kDCAV0DaughMax) { mHistogramRegistry->fill(HIST("LambdaQA/hInvMassLambdaDCAV0Daugh"), v0.mLambda()); } - if (cpav0 > CPAV0Min) { + if (cpav0 > kCPAV0Min) { mHistogramRegistry->fill(HIST("LambdaQA/hInvMassLambdaCPA"), v0.mLambda()); } - if (tranRad > TranRadV0Min) { + if (tranRad > kTranRadV0Min) { mHistogramRegistry->fill(HIST("LambdaQA/hInvMassLambdaTranRadMin"), v0.mLambda()); } - if (tranRad < TranRadV0Max) { + if (tranRad < kTranRadV0Max) { mHistogramRegistry->fill(HIST("LambdaQA/hInvMassLambdaTranRadMax"), v0.mLambda()); } bool write = true; for (size_t i = 0; i < decVtx.size(); i++) { - write = write && (decVtx.at(i) < DecVtxMax); + write = write && (decVtx.at(i) < kDecVtxMax); } if (write) { mHistogramRegistry->fill(HIST("LambdaQA/hInvMassLambdaDecVtxMax"), @@ -552,33 +546,33 @@ template std::array FemtoUniverseV0Selection::getCutContainer(C const& /*col*/, V const& v0, T const& posTrack, T const& negTrack) { - auto outputPosTrack = PosDaughTrack.getCutContainer(posTrack); - auto outputNegTrack = NegDaughTrack.getCutContainer(negTrack); + auto outputPosTrack = posDaughTrack.getCutContainer(posTrack); + auto outputNegTrack = negDaughTrack.getCutContainer(negTrack); cutContainerType output = 0; size_t counter = 0; - auto lambdaMassNominal = TDatabasePDG::Instance()->GetParticle(3122)->Mass(); // FIXME: Get from the common header + auto lambdaMassNominal = o2::constants::physics::MassLambda; // FIXME: Get from the common header auto lambdaMassHypothesis = v0.mLambda(); auto antiLambdaMassHypothesis = v0.mAntiLambda(); - auto diffLambda = abs(lambdaMassNominal - lambdaMassHypothesis); - auto diffAntiLambda = abs(antiLambdaMassHypothesis - lambdaMassHypothesis); + auto diffLambda = std::abs(lambdaMassNominal - lambdaMassHypothesis); + auto diffAntiLambda = std::abs(antiLambdaMassHypothesis - lambdaMassHypothesis); float sign = 0.; - float nSigmaPIDMax = PosDaughTrack.getSigmaPIDMax(); + float nSigmaPIDMax = posDaughTrack.getSigmaPIDMax(); auto nSigmaPrNeg = negTrack.tpcNSigmaPr(); auto nSigmaPiPos = posTrack.tpcNSigmaPi(); auto nSigmaPiNeg = negTrack.tpcNSigmaPi(); auto nSigmaPrPos = posTrack.tpcNSigmaPr(); // check the mass and the PID of daughters - if (abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && diffAntiLambda > diffLambda) { + if (std::abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && std::abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && diffAntiLambda > diffLambda) { sign = -1.; - } else if (abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && diffAntiLambda < diffLambda) { + } else if (std::abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && std::abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && diffAntiLambda < diffLambda) { sign = 1.; } else { // if it happens that none of these are true, ignore the invariant mass - if (abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax) { + if (std::abs(nSigmaPrNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax && std::abs(nSigmaPiPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax) { sign = -1.; - } else if (abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax) { + } else if (std::abs(nSigmaPrPos - nSigmaPIDOffsetTPC) < nSigmaPIDMax && std::abs(nSigmaPiNeg - nSigmaPIDOffsetTPC) < nSigmaPIDMax) { sign = 1.; } } @@ -593,38 +587,38 @@ std::array float observable = 0.; for (auto& sel : mSelections) { const auto selVariable = sel.getSelectionVariable(); - if (selVariable == femtoUniverseV0Selection::kV0DecVtxMax) { + if (selVariable == femto_universe_v0_selection::kV0DecVtxMax) { for (size_t i = 0; i < decVtx.size(); ++i) { auto decVtxValue = decVtx.at(i); sel.checkSelectionSetBit(decVtxValue, output, counter); } } else { switch (selVariable) { - case (femtoUniverseV0Selection::kV0Sign): + case (femto_universe_v0_selection::kV0Sign): observable = sign; break; - case (femtoUniverseV0Selection::kV0pTMin): + case (femto_universe_v0_selection::kV0pTMin): observable = pT; break; - case (femtoUniverseV0Selection::kV0pTMax): + case (femto_universe_v0_selection::kV0pTMax): observable = pT; break; - case (femtoUniverseV0Selection::kV0etaMax): + case (femto_universe_v0_selection::kV0etaMax): observable = eta; break; - case (femtoUniverseV0Selection::kV0DCADaughMax): + case (femto_universe_v0_selection::kV0DCADaughMax): observable = dcaDaughv0; break; - case (femtoUniverseV0Selection::kV0CPAMin): + case (femto_universe_v0_selection::kV0CPAMin): observable = cpav0; break; - case (femtoUniverseV0Selection::kV0TranRadMin): + case (femto_universe_v0_selection::kV0TranRadMin): observable = tranRad; break; - case (femtoUniverseV0Selection::kV0TranRadMax): + case (femto_universe_v0_selection::kV0TranRadMax): observable = tranRad; break; - case (femtoUniverseV0Selection::kV0DecVtxMax): + case (femto_universe_v0_selection::kV0DecVtxMax): break; } sel.checkSelectionSetBit(observable, output, counter); @@ -632,10 +626,10 @@ std::array } return { output, - outputPosTrack.at(femtoUniverseTrackSelection::TrackContainerPosition::kCuts), - outputPosTrack.at(femtoUniverseTrackSelection::TrackContainerPosition::kPID), - outputNegTrack.at(femtoUniverseTrackSelection::TrackContainerPosition::kCuts), - outputNegTrack.at(femtoUniverseTrackSelection::TrackContainerPosition::kPID)}; + outputPosTrack.at(femto_universe_track_selection::TrackContainerPosition::kCuts), + outputPosTrack.at(femto_universe_track_selection::TrackContainerPosition::kPID), + outputNegTrack.at(femto_universe_track_selection::TrackContainerPosition::kCuts), + outputNegTrack.at(femto_universe_track_selection::TrackContainerPosition::kPID)}; } template (posTrack); - NegDaughTrack.fillQA(negTrack); } -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEV0SELECTION_H_ diff --git a/PWGCF/FemtoUniverse/Core/FemtoUtils.h b/PWGCF/FemtoUniverse/Core/femtoUtils.h similarity index 80% rename from PWGCF/FemtoUniverse/Core/FemtoUtils.h rename to PWGCF/FemtoUniverse/Core/femtoUtils.h index 54dbbe4e02b..9fb075d6d53 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUtils.h +++ b/PWGCF/FemtoUniverse/Core/femtoUtils.h @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file FemtoUtils.h +/// \file femtoUtils.h /// \brief Utilities for the FemtoUniverse framework /// \author Luca Barioglio, TU München, luca.barioglio@cern.ch /// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch @@ -23,10 +23,10 @@ #include "Framework/ASoAHelpers.h" #include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" -namespace o2::analysis::femtoUniverse +namespace o2::analysis::femto_universe { -enum kDetector { kTPC, +enum KDetector { kTPC, kTPCTOF, kNdetectors }; @@ -51,19 +51,19 @@ int getPIDselection(float nSigma, std::vector vNsigma) /// \param nSpecies number of available selected species (output from cutculator), i.e. how many particle types were saved in the skimmed data /// \param nSigma Nsigma selection for PID (e.g. 3, for NsigmaTPC < 3 or NsigmaTPCTOF < 3) /// \param vNsigma vector with available n-sigma selections for PID (to check if chosen nSigma value is avialable + size to get the bit number) -/// \param kDetector enum corresponding to the PID technique +/// \param KDetector enum corresponding to the PID technique /// \return Whether the PID selection specified in the vectors is fulfilled bool isPIDSelected(aod::femtouniverseparticle::cutContainerType pidcut, int vSpecies, int nSpecies, float nSigma, std::vector vNsigma, - kDetector iDet) + KDetector iDet) { int iNsigma = getPIDselection(nSigma, vNsigma); - int nDet = static_cast(kDetector::kNdetectors); - int bit_to_check = 1 + (vNsigma.size() - (iNsigma + 1)) * nDet * nSpecies + (nSpecies - (vSpecies + 1)) * nSpecies + (nDet - 1 - iDet); - return ((pidcut >> (bit_to_check)) & 1) == 1; + int nDet = static_cast(KDetector::kNdetectors); + int bitToCheck = 1 + (vNsigma.size() - (iNsigma + 1)) * nDet * nSpecies + (nSpecies - (vSpecies + 1)) * nSpecies + (nDet - 1 - iDet); + return ((pidcut >> (bitToCheck)) & 1) == 1; }; /// function that checks whether the PID selection specified in the vectors is fulfilled, depending on the momentum TPC or TPC+TOF PID is conducted @@ -88,10 +88,10 @@ bool isFullPIDSelected(aod::femtouniverseparticle::cutContainerType const& pidCu bool pidSelection = true; if (momentum < pidThresh) { /// TPC PID only - pidSelection = isPIDSelected(pidCut, vSpecies, nSpecies, nSigmaTPC, vNsigma, kDetector::kTPC); + pidSelection = isPIDSelected(pidCut, vSpecies, nSpecies, nSigmaTPC, vNsigma, KDetector::kTPC); } else { /// TPC + TOF PID - pidSelection = isPIDSelected(pidCut, vSpecies, nSpecies, nSigmaTPCTOF, vNsigma, kDetector::kTPCTOF); + pidSelection = isPIDSelected(pidCut, vSpecies, nSpecies, nSigmaTPCTOF, vNsigma, KDetector::kTPCTOF); } return pidSelection; }; @@ -101,31 +101,31 @@ int checkDaughterType(o2::aod::femtouniverseparticle::ParticleType partType, int int partOrigin = 0; if (partType == o2::aod::femtouniverseparticle::ParticleType::kTrack) { - switch (abs(motherPDG)) { + switch (std::abs(motherPDG)) { case 3122: - partOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kDaughterLambda; + partOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kDaughterLambda; break; case 3222: - partOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kDaughterSigmaplus; + partOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kDaughterSigmaplus; break; default: - partOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kDaughter; + partOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kDaughter; } // switch } else if (partType == o2::aod::femtouniverseparticle::ParticleType::kV0) { - partOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kDaughter; + partOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kDaughter; } else if (partType == o2::aod::femtouniverseparticle::ParticleType::kV0Child) { - partOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kDaughter; + partOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kDaughter; } else if (partType == o2::aod::femtouniverseparticle::ParticleType::kCascade) { - partOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kDaughter; + partOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kDaughter; } else if (partType == o2::aod::femtouniverseparticle::ParticleType::kCascadeBachelor) { - partOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kDaughter; + partOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kDaughter; } return partOrigin; }; -} // namespace o2::analysis::femtoUniverse +} // namespace o2::analysis::femto_universe #endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUTILS_H_ diff --git a/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h b/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h index 7f43c675053..fd2f4f2b5b0 100644 --- a/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h +++ b/PWGCF/FemtoUniverse/DataModel/FemtoDerived.h @@ -9,6 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file FemtoDerived.h +/// \brief Declaration of FemtoUniverse tables +/// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch + #ifndef PWGCF_FEMTOUNIVERSE_DATAMODEL_FEMTODERIVED_H_ #define PWGCF_FEMTOUNIVERSE_DATAMODEL_FEMTODERIVED_H_ @@ -243,7 +247,7 @@ DECLARE_SOA_TABLE(FDCascParticles, "AOD", "FDCASCPARTICLE", using FDCascParticle = FDCascParticles::iterator; /// FemtoUniverseTrackMC -namespace femtouniverseMCparticle +namespace femtouniverse_mc_particle { /// Distinuishes the different particle origins enum ParticleOriginMCTruth { @@ -281,19 +285,19 @@ DECLARE_SOA_COLUMN(PDGMCTruth, pdgMCTruth, int); //! Particle // debug variables DECLARE_SOA_COLUMN(MotherPDG, motherPDG, int); //! Checks mother PDG, where mother is the primary particle for that decay chain -} // namespace femtouniverseMCparticle +} // namespace femtouniverse_mc_particle DECLARE_SOA_TABLE(FDMCParticles, "AOD", "FDMCPARTICLE", o2::soa::Index<>, - femtouniverseMCparticle::PartOriginMCTruth, - femtouniverseMCparticle::PDGMCTruth, + femtouniverse_mc_particle::PartOriginMCTruth, + femtouniverse_mc_particle::PDGMCTruth, femtouniverseparticle::Pt, femtouniverseparticle::Eta, femtouniverseparticle::Phi); using FDMCParticle = FDMCParticles::iterator; DECLARE_SOA_TABLE(FDExtMCParticles, "AOD", "FDEXTMCPARTICLE", - femtouniverseMCparticle::MotherPDG); + femtouniverse_mc_particle::MotherPDG); using FDExtMCParticle = FDExtMCParticles::iterator; namespace mcfdlabel diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerMCTruthTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerMCTruthTask.cxx index 117b5c57624..9e68e923755 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerMCTruthTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerMCTruthTask.cxx @@ -26,7 +26,7 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniversePhiSelection.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" @@ -40,7 +40,7 @@ #include "TLorentzVector.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerReducedTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerReducedTask.cxx index 9ab0fd70736..23b289e7876 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerReducedTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerReducedTask.cxx @@ -36,10 +36,10 @@ #include "DataFormatsParameters/GRPObject.h" #include "DataFormatsParameters/GRPMagField.h" #include "Math/Vector4D.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; @@ -92,19 +92,19 @@ struct femtoUniverseProducerReducedTask { Configurable ConfPDGCodeTrack{"ConfPDGCodeTrack", 2212, "PDG code of the selected track for Monte Carlo truth"}; // Track cuts FemtoUniverseTrackSelection trackCuts; - Configurable> ConfTrkCharge{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kSign, "ConfTrk"), std::vector{-1, 1}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kSign, "Track selection: ")}; - Configurable> ConfTrkPtmin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kpTMin, "ConfTrk"), std::vector{0.4f, 0.6f, 0.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kpTMin, "Track selection: ")}; - Configurable> ConfTrkPtmax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kpTMax, "ConfTrk"), std::vector{5.4f, 5.6f, 5.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kpTMax, "Track selection: ")}; - Configurable> ConfTrkEta{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kEtaMax, "ConfTrk"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kEtaMax, "Track selection: ")}; - Configurable> ConfTrkTPCnclsMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCnClsMin, "ConfTrk"), std::vector{80.f, 70.f, 60.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCnClsMin, "Track selection: ")}; - Configurable> ConfTrkTPCfCls{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCfClsMin, "ConfTrk"), std::vector{0.7f, 0.83f, 0.9f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCfClsMin, "Track selection: ")}; - Configurable> ConfTrkTPCcRowsMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCcRowsMin, "ConfTrk"), std::vector{70.f, 60.f, 80.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCcRowsMin, "Track selection: ")}; - Configurable> ConfTrkTPCsCls{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCsClsMax, "ConfTrk"), std::vector{0.1f, 160.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCsClsMax, "Track selection: ")}; - Configurable> ConfTrkITSnclsMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kITSnClsMin, "ConfTrk"), std::vector{-1.f, 2.f, 4.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kITSnClsMin, "Track selection: ")}; - Configurable> ConfTrkITSnclsIbMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kITSnClsIbMin, "ConfTrk"), std::vector{-1.f, 1.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kITSnClsIbMin, "Track selection: ")}; - Configurable> ConfTrkDCAxyMax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kDCAxyMax, "ConfTrk"), std::vector{0.1f, 0.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kDCAxyMax, "Track selection: ")}; /// here we need an open cut to do the DCA fits later on! - Configurable> ConfTrkDCAzMax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kDCAzMax, "ConfTrk"), std::vector{0.2f, 0.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kDCAzMax, "Track selection: ")}; - Configurable> ConfTrkPIDnSigmaMax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kPIDnSigmaMax, "Conf"), std::vector{3.5f, 3.f, 2.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kPIDnSigmaMax, "Track selection: ")}; + Configurable> ConfTrkCharge{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kSign, "ConfTrk"), std::vector{-1, 1}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kSign, "Track selection: ")}; + Configurable> ConfTrkPtmin{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kpTMin, "ConfTrk"), std::vector{0.4f, 0.6f, 0.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kpTMin, "Track selection: ")}; + Configurable> ConfTrkPtmax{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kpTMax, "ConfTrk"), std::vector{5.4f, 5.6f, 5.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kpTMax, "Track selection: ")}; + Configurable> ConfTrkEta{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kEtaMax, "ConfTrk"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kEtaMax, "Track selection: ")}; + Configurable> ConfTrkTPCnclsMin{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kTPCnClsMin, "ConfTrk"), std::vector{80.f, 70.f, 60.f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kTPCnClsMin, "Track selection: ")}; + Configurable> ConfTrkTPCfCls{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kTPCfClsMin, "ConfTrk"), std::vector{0.7f, 0.83f, 0.9f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kTPCfClsMin, "Track selection: ")}; + Configurable> ConfTrkTPCcRowsMin{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kTPCcRowsMin, "ConfTrk"), std::vector{70.f, 60.f, 80.f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kTPCcRowsMin, "Track selection: ")}; + Configurable> ConfTrkTPCsCls{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kTPCsClsMax, "ConfTrk"), std::vector{0.1f, 160.f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kTPCsClsMax, "Track selection: ")}; + Configurable> ConfTrkITSnclsMin{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kITSnClsMin, "ConfTrk"), std::vector{-1.f, 2.f, 4.f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kITSnClsMin, "Track selection: ")}; + Configurable> ConfTrkITSnclsIbMin{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kITSnClsIbMin, "ConfTrk"), std::vector{-1.f, 1.f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kITSnClsIbMin, "Track selection: ")}; + Configurable> ConfTrkDCAxyMax{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kDCAxyMax, "ConfTrk"), std::vector{0.1f, 0.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kDCAxyMax, "Track selection: ")}; /// here we need an open cut to do the DCA fits later on! + Configurable> ConfTrkDCAzMax{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kDCAzMax, "ConfTrk"), std::vector{0.2f, 0.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kDCAzMax, "Track selection: ")}; + Configurable> ConfTrkPIDnSigmaMax{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kPIDnSigmaMax, "Conf"), std::vector{3.5f, 3.f, 2.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kPIDnSigmaMax, "Track selection: ")}; // off set the center of the nsigma distribution to deal with bad TPC/TOF calibration Configurable ConfPIDnSigmaOffsetTPC{"ConfPIDnSigmaOffsetTPC", 0., "Offset for TPC nSigma because of bad calibration"}; Configurable ConfPIDnSigmaOffsetTOF{"ConfPIDnSigmaOffsetTOF", 0., "Offset for TOF nSigma because of bad calibration"}; @@ -121,19 +121,19 @@ struct femtoUniverseProducerReducedTask { colCuts.setCuts(ConfEvtZvtx, ConfEvtTriggerCheck, ConfEvtTriggerSel, ConfEvtOfflineCheck, ConfIsRun3, ConfCentFT0Min, ConfCentFT0Max); colCuts.init(&qaRegistry); - trackCuts.setSelection(ConfTrkCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - trackCuts.setSelection(ConfTrkPtmin, femtoUniverseTrackSelection::kpTMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkPtmax, femtoUniverseTrackSelection::kpTMax, femtoUniverseSelection::kUpperLimit); - trackCuts.setSelection(ConfTrkEta, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - trackCuts.setSelection(ConfTrkTPCnclsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkTPCfCls, femtoUniverseTrackSelection::kTPCfClsMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkTPCcRowsMin, femtoUniverseTrackSelection::kTPCcRowsMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkTPCsCls, femtoUniverseTrackSelection::kTPCsClsMax, femtoUniverseSelection::kUpperLimit); - trackCuts.setSelection(ConfTrkITSnclsMin, femtoUniverseTrackSelection::kITSnClsMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkITSnclsIbMin, femtoUniverseTrackSelection::kITSnClsIbMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkDCAxyMax, femtoUniverseTrackSelection::kDCAxyMax, femtoUniverseSelection::kAbsUpperLimit); - trackCuts.setSelection(ConfTrkDCAzMax, femtoUniverseTrackSelection::kDCAzMax, femtoUniverseSelection::kAbsUpperLimit); - trackCuts.setSelection(ConfTrkPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); + trackCuts.setSelection(ConfTrkCharge, femto_universe_track_selection::kSign, femto_universe_selection::kEqual); + trackCuts.setSelection(ConfTrkPtmin, femto_universe_track_selection::kpTMin, femto_universe_selection::kLowerLimit); + trackCuts.setSelection(ConfTrkPtmax, femto_universe_track_selection::kpTMax, femto_universe_selection::kUpperLimit); + trackCuts.setSelection(ConfTrkEta, femto_universe_track_selection::kEtaMax, femto_universe_selection::kAbsUpperLimit); + trackCuts.setSelection(ConfTrkTPCnclsMin, femto_universe_track_selection::kTPCnClsMin, femto_universe_selection::kLowerLimit); + trackCuts.setSelection(ConfTrkTPCfCls, femto_universe_track_selection::kTPCfClsMin, femto_universe_selection::kLowerLimit); + trackCuts.setSelection(ConfTrkTPCcRowsMin, femto_universe_track_selection::kTPCcRowsMin, femto_universe_selection::kLowerLimit); + trackCuts.setSelection(ConfTrkTPCsCls, femto_universe_track_selection::kTPCsClsMax, femto_universe_selection::kUpperLimit); + trackCuts.setSelection(ConfTrkITSnclsMin, femto_universe_track_selection::kITSnClsMin, femto_universe_selection::kLowerLimit); + trackCuts.setSelection(ConfTrkITSnclsIbMin, femto_universe_track_selection::kITSnClsIbMin, femto_universe_selection::kLowerLimit); + trackCuts.setSelection(ConfTrkDCAxyMax, femto_universe_track_selection::kDCAxyMax, femto_universe_selection::kAbsUpperLimit); + trackCuts.setSelection(ConfTrkDCAzMax, femto_universe_track_selection::kDCAzMax, femto_universe_selection::kAbsUpperLimit); + trackCuts.setSelection(ConfTrkPIDnSigmaMax, femto_universe_track_selection::kPIDnSigmaMax, femto_universe_selection::kAbsUpperLimit); trackCuts.setPIDSpecies(ConfPIDspecies); trackCuts.setnSigmaPIDOffset(ConfPIDnSigmaOffsetTPC, ConfPIDnSigmaOffsetTOF); trackCuts.init> confTrkCharge{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kSign, "ConfTrk"), std::vector{-1, 1}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kSign, "Track selection: ")}; - Configurable> confTrkPtmin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kpTMin, "ConfTrk"), std::vector{0.5f, 0.4f, 0.6f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kpTMin, "Track selection: ")}; - Configurable> confTrkPtmax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kpTMax, "ConfTrk"), std::vector{5.4f, 5.6f, 5.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kpTMax, "Track selection: ")}; - Configurable> confTrkEta{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kEtaMax, "ConfTrk"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kEtaMax, "Track selection: ")}; - Configurable> confTrkTPCnclsMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCnClsMin, "ConfTrk"), std::vector{70.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCnClsMin, "Track selection: ")}; - Configurable> confTrkTPCfCls{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCfClsMin, "ConfTrk"), std::vector{0.83f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCfClsMin, "Track selection: ")}; - Configurable> confTrkTPCcRowsMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCcRowsMin, "ConfTrk"), std::vector{70.f, 60.f, 80.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCcRowsMin, "Track selection: ")}; - Configurable> confTrkTPCsCls{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kTPCsClsMax, "ConfTrk"), std::vector{0.1f, 160.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kTPCsClsMax, "Track selection: ")}; - Configurable> confTrkITSnclsMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kITSnClsMin, "ConfTrk"), std::vector{-1.f, 2.f, 4.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kITSnClsMin, "Track selection: ")}; - Configurable> confTrkITSnclsIbMin{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kITSnClsIbMin, "ConfTrk"), std::vector{-1.f, 1.f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kITSnClsIbMin, "Track selection: ")}; - Configurable> confTrkDCAxyMax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kDCAxyMax, "ConfTrk"), std::vector{0.1f, 3.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kDCAxyMax, "Track selection: ")}; - Configurable> confTrkDCAzMax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kDCAzMax, "ConfTrk"), std::vector{0.2f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kDCAzMax, "Track selection: ")}; /// \todo Reintegrate PID to the general selection container - Configurable> confTrkPIDnSigmaMax{FemtoUniverseTrackSelection::getSelectionName(femtoUniverseTrackSelection::kPIDnSigmaMax, "ConfTrk"), std::vector{3.5f, 3.f, 2.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femtoUniverseTrackSelection::kPIDnSigmaMax, "Track selection: ")}; + Configurable> confTrkCharge{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kSign, "ConfTrk"), std::vector{-1, 1}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kSign, "Track selection: ")}; + Configurable> confTrkPtmin{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kpTMin, "ConfTrk"), std::vector{0.5f, 0.4f, 0.6f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kpTMin, "Track selection: ")}; + Configurable> confTrkPtmax{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kpTMax, "ConfTrk"), std::vector{5.4f, 5.6f, 5.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kpTMax, "Track selection: ")}; + Configurable> confTrkEta{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kEtaMax, "ConfTrk"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kEtaMax, "Track selection: ")}; + Configurable> confTrkTPCnclsMin{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kTPCnClsMin, "ConfTrk"), std::vector{70.f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kTPCnClsMin, "Track selection: ")}; + Configurable> confTrkTPCfCls{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kTPCfClsMin, "ConfTrk"), std::vector{0.83f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kTPCfClsMin, "Track selection: ")}; + Configurable> confTrkTPCcRowsMin{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kTPCcRowsMin, "ConfTrk"), std::vector{70.f, 60.f, 80.f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kTPCcRowsMin, "Track selection: ")}; + Configurable> confTrkTPCsCls{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kTPCsClsMax, "ConfTrk"), std::vector{0.1f, 160.f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kTPCsClsMax, "Track selection: ")}; + Configurable> confTrkITSnclsMin{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kITSnClsMin, "ConfTrk"), std::vector{-1.f, 2.f, 4.f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kITSnClsMin, "Track selection: ")}; + Configurable> confTrkITSnclsIbMin{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kITSnClsIbMin, "ConfTrk"), std::vector{-1.f, 1.f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kITSnClsIbMin, "Track selection: ")}; + Configurable> confTrkDCAxyMax{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kDCAxyMax, "ConfTrk"), std::vector{0.1f, 3.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kDCAxyMax, "Track selection: ")}; + Configurable> confTrkDCAzMax{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kDCAzMax, "ConfTrk"), std::vector{0.2f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kDCAzMax, "Track selection: ")}; /// \todo Reintegrate PID to the general selection container + Configurable> confTrkPIDnSigmaMax{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kPIDnSigmaMax, "ConfTrk"), std::vector{3.5f, 3.f, 2.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kPIDnSigmaMax, "Track selection: ")}; Configurable confTrkPIDnSigmaOffsetTPC{"confTrkPIDnSigmaOffsetTPC", 0., "Offset for TPC nSigma because of bad calibration"}; Configurable confTrkPIDnSigmaOffsetTOF{"confTrkPIDnSigmaOffsetTOF", 0., "Offset for TOF nSigma because of bad calibration"}; Configurable> confTrkPIDspecies{"confTrkPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Kaon, o2::track::PID::Proton, o2::track::PID::Deuteron}, "Trk sel: Particles species for PID (Pion=2, Kaon=3, Proton=4, Deuteron=5)"}; @@ -185,15 +185,15 @@ struct FemtoUniverseProducerTask { FemtoUniverseV0Selection v0Cuts; struct : o2::framework::ConfigurableGroup { // Configurable confIsFillV0s{"confIsFillV0s", false, "Choice to fill V0s"}; //Commented: not used configurable - Configurable> confV0Sign{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0Sign, "ConfV0"), std::vector{-1, 1}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0Sign, "V0 selection: ")}; - Configurable> confV0PtMin{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0pTMin, "ConfV0"), std::vector{0.3f, 0.4f, 0.5f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0pTMin, "V0 selection: ")}; - Configurable> confV0PtMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0pTMax, "ConfV0"), std::vector{3.3f, 3.4f, 3.5f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0pTMax, "V0 selection: ")}; - Configurable> confV0EtaMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0etaMax, "ConfV0"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0etaMax, "V0 selection: ")}; - Configurable> confV0DCADaughMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0DCADaughMax, "ConfV0"), std::vector{1.2f, 1.5f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0DCADaughMax, "V0 selection: ")}; - Configurable> confV0CPAMin{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0CPAMin, "ConfV0"), std::vector{0.99f, 0.995f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0CPAMin, "V0 selection: ")}; - Configurable> confV0TranRadMin{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0TranRadMin, "ConfV0"), std::vector{0.2f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0TranRadMin, "V0 selection: ")}; - Configurable> confV0TranRadMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0TranRadMax, "ConfV0"), std::vector{100.f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0TranRadMax, "V0 selection: ")}; - Configurable> confV0DecVtxMax{FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0DecVtxMax, "ConfV0"), std::vector{100.f}, FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0DecVtxMax, "V0 selection: ")}; + Configurable> confV0Sign{FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0Sign, "ConfV0"), std::vector{-1, 1}, FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0Sign, "V0 selection: ")}; + Configurable> confV0PtMin{FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0pTMin, "ConfV0"), std::vector{0.3f, 0.4f, 0.5f}, FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0pTMin, "V0 selection: ")}; + Configurable> confV0PtMax{FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0pTMax, "ConfV0"), std::vector{3.3f, 3.4f, 3.5f}, FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0pTMax, "V0 selection: ")}; + Configurable> confV0EtaMax{FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0etaMax, "ConfV0"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0etaMax, "V0 selection: ")}; + Configurable> confV0DCADaughMax{FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0DCADaughMax, "ConfV0"), std::vector{1.2f, 1.5f}, FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0DCADaughMax, "V0 selection: ")}; + Configurable> confV0CPAMin{FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0CPAMin, "ConfV0"), std::vector{0.99f, 0.995f}, FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0CPAMin, "V0 selection: ")}; + Configurable> confV0TranRadMin{FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0TranRadMin, "ConfV0"), std::vector{0.2f}, FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0TranRadMin, "V0 selection: ")}; + Configurable> confV0TranRadMax{FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0TranRadMax, "ConfV0"), std::vector{100.f}, FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0TranRadMax, "V0 selection: ")}; + Configurable> confV0DecVtxMax{FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0DecVtxMax, "ConfV0"), std::vector{100.f}, FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0DecVtxMax, "V0 selection: ")}; Configurable> confChildCharge{"confChildCharge", std::vector{-1, 1}, "V0 Child sel: Charge"}; Configurable> confChildEtaMax{"confChildEtaMax", std::vector{0.8f}, "V0 Child sel: max eta"}; @@ -234,27 +234,27 @@ struct FemtoUniverseProducerTask { FemtoUniverseCascadeSelection cascadeCuts; struct : o2::framework::ConfigurableGroup { // Configurable confIsFillCascades{"confIsFillCascades", false, "Choice to fill cascades"}; //Commented: not used configurable - Configurable> confCascSign{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeSign, "ConfCasc"), std::vector{-1, 1}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeSign, "Cascade selection: ")}; - Configurable> confCascPtMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadepTMin, "ConfCasc"), std::vector{0.3f, 0.4f, 0.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadepTMin, "Cascade selection: ")}; - Configurable> confCascPtMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadepTMax, "ConfCasc"), std::vector{3.3f, 3.4f, 3.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadepTMax, "Cascade selection: ")}; - Configurable> confCascEtaMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeetaMax, "ConfCasc"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeetaMax, "Cascade selection: ")}; - Configurable> confCascV0DCADaughMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0DCADaughMax, "ConfCasc"), std::vector{1.f, 1.2f, 1.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0DCADaughMax, "Cascade selection: ")}; - Configurable> confCascV0CPAMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0CPAMin, "ConfCasc"), std::vector{0.99f, 0.95f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0CPAMin, "Cascade selection: ")}; - Configurable> confCascV0TranRadMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0TranRadMin, "ConfCasc"), std::vector{0.2f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0TranRadMin, "Cascade selection: ")}; - Configurable> confCascV0TranRadMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0TranRadMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0TranRadMax, "Cascade selection: ")}; - Configurable> confCascV0DecVtxMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0DecVtxMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0DecVtxMax, "Cascade selection: ")}; - Configurable> confCascDCADaughMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCADaughMax, "ConfCasc"), std::vector{1.f, 1.2f, 1.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCADaughMax, "Cascade selection: ")}; - Configurable> confCascCPAMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeCPAMin, "ConfCasc"), std::vector{0.99f, 0.95f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeCPAMin, "Cascade selection: ")}; - Configurable> confCascTranRadMin{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeTranRadMin, "ConfCasc"), std::vector{0.2f, 0.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeTranRadMin, "Cascade selection: ")}; - Configurable> confCascTranRadMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeTranRadMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeTranRadMax, "Cascade selection: ")}; - Configurable> confCascDecVtxMax{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDecVtxMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDecVtxMax, "Cascade selection: ")}; - - Configurable> confCascDCAPosToPV{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCAPosToPV, "ConfCasc"), std::vector{0.1f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCAPosToPV, "Cascade selection: ")}; - Configurable> confCascDCANegToPV{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCANegToPV, "ConfCasc"), std::vector{0.1f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCANegToPV, "Cascade selection: ")}; - Configurable> confCascDCABachToPV{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCABachToPV, "ConfCasc"), std::vector{0.1f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCABachToPV, "Cascade selection: ")}; - Configurable> confCascDCAV0ToPV{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeDCAV0ToPV, "ConfCasc"), std::vector{0.01f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeDCAV0ToPV, "Cascade selection: ")}; - Configurable> confCascV0MassLowLimit{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0MassMin, "ConfCasc"), std::vector{1.05f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0MassMin, "Cascade selection: ")}; - Configurable> confCascV0MassUpLimit{FemtoUniverseCascadeSelection::getSelectionName(femtoUniverseCascadeSelection::kCascadeV0MassMax, "ConfCasc"), std::vector{1.30f}, FemtoUniverseCascadeSelection::getSelectionHelper(femtoUniverseCascadeSelection::kCascadeV0MassMax, "Cascade selection: ")}; + Configurable> confCascSign{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeSign, "ConfCasc"), std::vector{-1, 1}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeSign, "Cascade selection: ")}; + Configurable> confCascPtMin{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadepTMin, "ConfCasc"), std::vector{0.3f, 0.4f, 0.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadepTMin, "Cascade selection: ")}; + Configurable> confCascPtMax{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadepTMax, "ConfCasc"), std::vector{3.3f, 3.4f, 3.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadepTMax, "Cascade selection: ")}; + Configurable> confCascEtaMax{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeetaMax, "ConfCasc"), std::vector{0.8f, 0.7f, 0.9f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeetaMax, "Cascade selection: ")}; + Configurable> confCascV0DCADaughMax{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeV0DCADaughMax, "ConfCasc"), std::vector{1.f, 1.2f, 1.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeV0DCADaughMax, "Cascade selection: ")}; + Configurable> confCascV0CPAMin{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeV0CPAMin, "ConfCasc"), std::vector{0.99f, 0.95f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeV0CPAMin, "Cascade selection: ")}; + Configurable> confCascV0TranRadMin{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeV0TranRadMin, "ConfCasc"), std::vector{0.2f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeV0TranRadMin, "Cascade selection: ")}; + Configurable> confCascV0TranRadMax{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeV0TranRadMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeV0TranRadMax, "Cascade selection: ")}; + Configurable> confCascV0DecVtxMax{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeV0DecVtxMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeV0DecVtxMax, "Cascade selection: ")}; + Configurable> confCascDCADaughMax{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeDCADaughMax, "ConfCasc"), std::vector{1.f, 1.2f, 1.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeDCADaughMax, "Cascade selection: ")}; + Configurable> confCascCPAMin{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeCPAMin, "ConfCasc"), std::vector{0.99f, 0.95f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeCPAMin, "Cascade selection: ")}; + Configurable> confCascTranRadMin{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeTranRadMin, "ConfCasc"), std::vector{0.2f, 0.5f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeTranRadMin, "Cascade selection: ")}; + Configurable> confCascTranRadMax{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeTranRadMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeTranRadMax, "Cascade selection: ")}; + Configurable> confCascDecVtxMax{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeDecVtxMax, "ConfCasc"), std::vector{100.f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeDecVtxMax, "Cascade selection: ")}; + + Configurable> confCascDCAPosToPV{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeDCAPosToPV, "ConfCasc"), std::vector{0.1f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeDCAPosToPV, "Cascade selection: ")}; + Configurable> confCascDCANegToPV{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeDCANegToPV, "ConfCasc"), std::vector{0.1f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeDCANegToPV, "Cascade selection: ")}; + Configurable> confCascDCABachToPV{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeDCABachToPV, "ConfCasc"), std::vector{0.1f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeDCABachToPV, "Cascade selection: ")}; + Configurable> confCascDCAV0ToPV{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeDCAV0ToPV, "ConfCasc"), std::vector{0.01f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeDCAV0ToPV, "Cascade selection: ")}; + Configurable> confCascV0MassLowLimit{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeV0MassMin, "ConfCasc"), std::vector{1.05f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeV0MassMin, "Cascade selection: ")}; + Configurable> confCascV0MassUpLimit{FemtoUniverseCascadeSelection::getSelectionName(femto_universe_cascade_selection::kCascadeV0MassMax, "ConfCasc"), std::vector{1.30f}, FemtoUniverseCascadeSelection::getSelectionHelper(femto_universe_cascade_selection::kCascadeV0MassMax, "Cascade selection: ")}; Configurable> confCascChildCharge{"confCascChildCharge", std::vector{-1, 1}, "Cascade Child sel: Charge"}; Configurable> confCascChildEtaMax{"confCascChildEtaMax", std::vector{0.8f}, "Cascade Child sel: max eta"}; @@ -468,19 +468,19 @@ struct FemtoUniverseProducerTask { colCuts.setCuts(confEvtZvtx, confEvtTriggerCheck, confEvtTriggerSel, confEvtOfflineCheck, confIsRun3, confCentFT0Min, confCentFT0Max); colCuts.init(&qaRegistry); - trackCuts.setSelection(confTrkCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - trackCuts.setSelection(confTrkPtmin, femtoUniverseTrackSelection::kpTMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(confTrkPtmax, femtoUniverseTrackSelection::kpTMax, femtoUniverseSelection::kUpperLimit); - trackCuts.setSelection(confTrkEta, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - trackCuts.setSelection(confTrkTPCnclsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(confTrkTPCfCls, femtoUniverseTrackSelection::kTPCfClsMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(confTrkTPCcRowsMin, femtoUniverseTrackSelection::kTPCcRowsMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(confTrkTPCsCls, femtoUniverseTrackSelection::kTPCsClsMax, femtoUniverseSelection::kUpperLimit); - trackCuts.setSelection(confTrkITSnclsMin, femtoUniverseTrackSelection::kITSnClsMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(confTrkITSnclsIbMin, femtoUniverseTrackSelection::kITSnClsIbMin, femtoUniverseSelection::kLowerLimit); - trackCuts.setSelection(confTrkDCAxyMax, femtoUniverseTrackSelection::kDCAxyMax, femtoUniverseSelection::kAbsUpperLimit); - trackCuts.setSelection(confTrkDCAzMax, femtoUniverseTrackSelection::kDCAzMax, femtoUniverseSelection::kAbsUpperLimit); - trackCuts.setSelection(confTrkPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); + trackCuts.setSelection(confTrkCharge, femto_universe_track_selection::kSign, femto_universe_selection::kEqual); + trackCuts.setSelection(confTrkPtmin, femto_universe_track_selection::kpTMin, femto_universe_selection::kLowerLimit); + trackCuts.setSelection(confTrkPtmax, femto_universe_track_selection::kpTMax, femto_universe_selection::kUpperLimit); + trackCuts.setSelection(confTrkEta, femto_universe_track_selection::kEtaMax, femto_universe_selection::kAbsUpperLimit); + trackCuts.setSelection(confTrkTPCnclsMin, femto_universe_track_selection::kTPCnClsMin, femto_universe_selection::kLowerLimit); + trackCuts.setSelection(confTrkTPCfCls, femto_universe_track_selection::kTPCfClsMin, femto_universe_selection::kLowerLimit); + trackCuts.setSelection(confTrkTPCcRowsMin, femto_universe_track_selection::kTPCcRowsMin, femto_universe_selection::kLowerLimit); + trackCuts.setSelection(confTrkTPCsCls, femto_universe_track_selection::kTPCsClsMax, femto_universe_selection::kUpperLimit); + trackCuts.setSelection(confTrkITSnclsMin, femto_universe_track_selection::kITSnClsMin, femto_universe_selection::kLowerLimit); + trackCuts.setSelection(confTrkITSnclsIbMin, femto_universe_track_selection::kITSnClsIbMin, femto_universe_selection::kLowerLimit); + trackCuts.setSelection(confTrkDCAxyMax, femto_universe_track_selection::kDCAxyMax, femto_universe_selection::kAbsUpperLimit); + trackCuts.setSelection(confTrkDCAzMax, femto_universe_track_selection::kDCAzMax, femto_universe_selection::kAbsUpperLimit); + trackCuts.setSelection(confTrkPIDnSigmaMax, femto_universe_track_selection::kPIDnSigmaMax, femto_universe_selection::kAbsUpperLimit); trackCuts.setPIDSpecies(confTrkPIDspecies); trackCuts.setnSigmaPIDOffset(confTrkPIDnSigmaOffsetTPC, confTrkPIDnSigmaOffsetTOF); trackCuts.init(&qaRegistry); @@ -488,39 +488,39 @@ struct FemtoUniverseProducerTask { /// \todo fix how to pass array to setSelection, getRow() passing a /// different type! // v0Cuts.setSelection(ConfV0Selection->getRow(0), - // femtoUniverseV0Selection::kDecVtxMax, femtoUniverseSelection::kAbsUpperLimit); + // femto_universe_v0_selection::kDecVtxMax, femto_universe_selection::kAbsUpperLimit); if (confIsActivateV0) { // initializing for V0 - v0Cuts.setSelection(ConfV0Selection.confV0Sign, femtoUniverseV0Selection::kV0Sign, femtoUniverseSelection::kEqual); - v0Cuts.setSelection(ConfV0Selection.confV0PtMin, femtoUniverseV0Selection::kV0pTMin, femtoUniverseSelection::kLowerLimit); - v0Cuts.setSelection(ConfV0Selection.confV0PtMax, femtoUniverseV0Selection::kV0pTMax, femtoUniverseSelection::kUpperLimit); - v0Cuts.setSelection(ConfV0Selection.confV0EtaMax, femtoUniverseV0Selection::kV0etaMax, femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setSelection(ConfV0Selection.confV0DCADaughMax, femtoUniverseV0Selection::kV0DCADaughMax, femtoUniverseSelection::kUpperLimit); - v0Cuts.setSelection(ConfV0Selection.confV0CPAMin, femtoUniverseV0Selection::kV0CPAMin, femtoUniverseSelection::kLowerLimit); - v0Cuts.setSelection(ConfV0Selection.confV0TranRadMin, femtoUniverseV0Selection::kV0TranRadMin, femtoUniverseSelection::kLowerLimit); - v0Cuts.setSelection(ConfV0Selection.confV0TranRadMax, femtoUniverseV0Selection::kV0TranRadMax, femtoUniverseSelection::kUpperLimit); - v0Cuts.setSelection(ConfV0Selection.confV0DecVtxMax, femtoUniverseV0Selection::kV0DecVtxMax, femtoUniverseSelection::kUpperLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.confChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.confChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.confChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.confChildDCAMin, femtoUniverseTrackSelection::kDCAMin, femtoUniverseSelection::kAbsLowerLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.confChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.confChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.confChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.confChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.confChildDCAMin, femtoUniverseTrackSelection::kDCAMin, femtoUniverseSelection::kAbsLowerLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.confChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setChildPIDSpecies(femtoUniverseV0Selection::kPosTrack, ConfV0Selection.confChildPIDspecies); - v0Cuts.setChildPIDSpecies(femtoUniverseV0Selection::kNegTrack, ConfV0Selection.confChildPIDspecies); + v0Cuts.setSelection(ConfV0Selection.confV0Sign, femto_universe_v0_selection::kV0Sign, femto_universe_selection::kEqual); + v0Cuts.setSelection(ConfV0Selection.confV0PtMin, femto_universe_v0_selection::kV0pTMin, femto_universe_selection::kLowerLimit); + v0Cuts.setSelection(ConfV0Selection.confV0PtMax, femto_universe_v0_selection::kV0pTMax, femto_universe_selection::kUpperLimit); + v0Cuts.setSelection(ConfV0Selection.confV0EtaMax, femto_universe_v0_selection::kV0etaMax, femto_universe_selection::kAbsUpperLimit); + v0Cuts.setSelection(ConfV0Selection.confV0DCADaughMax, femto_universe_v0_selection::kV0DCADaughMax, femto_universe_selection::kUpperLimit); + v0Cuts.setSelection(ConfV0Selection.confV0CPAMin, femto_universe_v0_selection::kV0CPAMin, femto_universe_selection::kLowerLimit); + v0Cuts.setSelection(ConfV0Selection.confV0TranRadMin, femto_universe_v0_selection::kV0TranRadMin, femto_universe_selection::kLowerLimit); + v0Cuts.setSelection(ConfV0Selection.confV0TranRadMax, femto_universe_v0_selection::kV0TranRadMax, femto_universe_selection::kUpperLimit); + v0Cuts.setSelection(ConfV0Selection.confV0DecVtxMax, femto_universe_v0_selection::kV0DecVtxMax, femto_universe_selection::kUpperLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kPosTrack, ConfV0Selection.confChildCharge, femto_universe_track_selection::kSign, femto_universe_selection::kEqual); + v0Cuts.setChildCuts(femto_universe_v0_selection::kPosTrack, ConfV0Selection.confChildEtaMax, femto_universe_track_selection::kEtaMax, femto_universe_selection::kAbsUpperLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kPosTrack, ConfV0Selection.confChildTPCnClsMin, femto_universe_track_selection::kTPCnClsMin, femto_universe_selection::kLowerLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kPosTrack, ConfV0Selection.confChildDCAMin, femto_universe_track_selection::kDCAMin, femto_universe_selection::kAbsLowerLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kPosTrack, ConfV0Selection.confChildPIDnSigmaMax, femto_universe_track_selection::kPIDnSigmaMax, femto_universe_selection::kAbsUpperLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kNegTrack, ConfV0Selection.confChildCharge, femto_universe_track_selection::kSign, femto_universe_selection::kEqual); + v0Cuts.setChildCuts(femto_universe_v0_selection::kNegTrack, ConfV0Selection.confChildEtaMax, femto_universe_track_selection::kEtaMax, femto_universe_selection::kAbsUpperLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kNegTrack, ConfV0Selection.confChildTPCnClsMin, femto_universe_track_selection::kTPCnClsMin, femto_universe_selection::kLowerLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kNegTrack, ConfV0Selection.confChildDCAMin, femto_universe_track_selection::kDCAMin, femto_universe_selection::kAbsLowerLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kNegTrack, ConfV0Selection.confChildPIDnSigmaMax, femto_universe_track_selection::kPIDnSigmaMax, femto_universe_selection::kAbsUpperLimit); + v0Cuts.setChildPIDSpecies(femto_universe_v0_selection::kPosTrack, ConfV0Selection.confChildPIDspecies); + v0Cuts.setChildPIDSpecies(femto_universe_v0_selection::kNegTrack, ConfV0Selection.confChildPIDspecies); v0Cuts.init(&qaRegistry); v0Cuts.setInvMassLimits(ConfV0Selection.confV0InvMassLowLimit, ConfV0Selection.confV0InvMassUpLimit); - v0Cuts.setChildRejectNotPropagatedTracks(femtoUniverseV0Selection::kPosTrack, confTrkRejectNotPropagated); - v0Cuts.setChildRejectNotPropagatedTracks(femtoUniverseV0Selection::kNegTrack, confTrkRejectNotPropagated); + v0Cuts.setChildRejectNotPropagatedTracks(femto_universe_v0_selection::kPosTrack, confTrkRejectNotPropagated); + v0Cuts.setChildRejectNotPropagatedTracks(femto_universe_v0_selection::kNegTrack, confTrkRejectNotPropagated); v0Cuts.setnSigmaPIDOffsetTPC(confTrkPIDnSigmaOffsetTPC); - v0Cuts.setChildnSigmaPIDOffset(femtoUniverseV0Selection::kPosTrack, confTrkPIDnSigmaOffsetTPC, confTrkPIDnSigmaOffsetTOF); - v0Cuts.setChildnSigmaPIDOffset(femtoUniverseV0Selection::kNegTrack, confTrkPIDnSigmaOffsetTPC, confTrkPIDnSigmaOffsetTOF); + v0Cuts.setChildnSigmaPIDOffset(femto_universe_v0_selection::kPosTrack, confTrkPIDnSigmaOffsetTPC, confTrkPIDnSigmaOffsetTOF); + v0Cuts.setChildnSigmaPIDOffset(femto_universe_v0_selection::kNegTrack, confTrkPIDnSigmaOffsetTPC, confTrkPIDnSigmaOffsetTOF); if (ConfV0Selection.confV0RejectKaons) { v0Cuts.setKaonInvMassLimits(ConfV0Selection.confV0InvKaonMassLowLimit, ConfV0Selection.confV0InvKaonMassUpLimit); @@ -534,46 +534,46 @@ struct FemtoUniverseProducerTask { if (confIsActivateCascade) { // initializing for cascades - cascadeCuts.setSelection(ConfCascadeSelection.confCascSign, femtoUniverseCascadeSelection::kCascadeSign, femtoUniverseSelection::kEqual); - cascadeCuts.setSelection(ConfCascadeSelection.confCascPtMin, femtoUniverseCascadeSelection::kCascadepTMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascPtMax, femtoUniverseCascadeSelection::kCascadepTMax, femtoUniverseSelection::kUpperLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascEtaMax, femtoUniverseCascadeSelection::kCascadeetaMax, femtoUniverseSelection::kAbsUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascSign, femto_universe_cascade_selection::kCascadeSign, femto_universe_selection::kEqual); + cascadeCuts.setSelection(ConfCascadeSelection.confCascPtMin, femto_universe_cascade_selection::kCascadepTMin, femto_universe_selection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascPtMax, femto_universe_cascade_selection::kCascadepTMax, femto_universe_selection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascEtaMax, femto_universe_cascade_selection::kCascadeetaMax, femto_universe_selection::kAbsUpperLimit); // v0 child cuts - cascadeCuts.setSelection(ConfCascadeSelection.confCascV0DCADaughMax, femtoUniverseCascadeSelection::kCascadeV0DCADaughMax, femtoUniverseSelection::kUpperLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascV0CPAMin, femtoUniverseCascadeSelection::kCascadeV0CPAMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascV0TranRadMin, femtoUniverseCascadeSelection::kCascadeV0TranRadMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascV0TranRadMax, femtoUniverseCascadeSelection::kCascadeV0TranRadMax, femtoUniverseSelection::kUpperLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascV0DecVtxMax, femtoUniverseCascadeSelection::kCascadeV0DecVtxMax, femtoUniverseSelection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0DCADaughMax, femto_universe_cascade_selection::kCascadeV0DCADaughMax, femto_universe_selection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0CPAMin, femto_universe_cascade_selection::kCascadeV0CPAMin, femto_universe_selection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0TranRadMin, femto_universe_cascade_selection::kCascadeV0TranRadMin, femto_universe_selection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0TranRadMax, femto_universe_cascade_selection::kCascadeV0TranRadMax, femto_universe_selection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0DecVtxMax, femto_universe_cascade_selection::kCascadeV0DecVtxMax, femto_universe_selection::kUpperLimit); // cascade cuts - cascadeCuts.setSelection(ConfCascadeSelection.confCascDCADaughMax, femtoUniverseCascadeSelection::kCascadeDCADaughMax, femtoUniverseSelection::kUpperLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascCPAMin, femtoUniverseCascadeSelection::kCascadeCPAMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascTranRadMin, femtoUniverseCascadeSelection::kCascadeTranRadMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascTranRadMax, femtoUniverseCascadeSelection::kCascadeTranRadMax, femtoUniverseSelection::kUpperLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascDecVtxMax, femtoUniverseCascadeSelection::kCascadeDecVtxMax, femtoUniverseSelection::kUpperLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascDCAPosToPV, femtoUniverseCascadeSelection::kCascadeDCAPosToPV, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascDCANegToPV, femtoUniverseCascadeSelection::kCascadeDCANegToPV, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascDCABachToPV, femtoUniverseCascadeSelection::kCascadeDCABachToPV, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascDCAV0ToPV, femtoUniverseCascadeSelection::kCascadeDCAV0ToPV, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascV0MassLowLimit, femtoUniverseCascadeSelection::kCascadeV0MassMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setSelection(ConfCascadeSelection.confCascV0MassUpLimit, femtoUniverseCascadeSelection::kCascadeV0MassMax, femtoUniverseSelection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascDCADaughMax, femto_universe_cascade_selection::kCascadeDCADaughMax, femto_universe_selection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascCPAMin, femto_universe_cascade_selection::kCascadeCPAMin, femto_universe_selection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascTranRadMin, femto_universe_cascade_selection::kCascadeTranRadMin, femto_universe_selection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascTranRadMax, femto_universe_cascade_selection::kCascadeTranRadMax, femto_universe_selection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascDecVtxMax, femto_universe_cascade_selection::kCascadeDecVtxMax, femto_universe_selection::kUpperLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascDCAPosToPV, femto_universe_cascade_selection::kCascadeDCAPosToPV, femto_universe_selection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascDCANegToPV, femto_universe_cascade_selection::kCascadeDCANegToPV, femto_universe_selection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascDCABachToPV, femto_universe_cascade_selection::kCascadeDCABachToPV, femto_universe_selection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascDCAV0ToPV, femto_universe_cascade_selection::kCascadeDCAV0ToPV, femto_universe_selection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0MassLowLimit, femto_universe_cascade_selection::kCascadeV0MassMin, femto_universe_selection::kLowerLimit); + cascadeCuts.setSelection(ConfCascadeSelection.confCascV0MassUpLimit, femto_universe_cascade_selection::kCascadeV0MassMax, femto_universe_selection::kUpperLimit); // children cuts - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kPosTrack, ConfCascadeSelection.confCascChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kPosTrack, ConfCascadeSelection.confCascChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kPosTrack, ConfCascadeSelection.confCascChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kPosTrack, ConfCascadeSelection.confCascChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kNegTrack, ConfCascadeSelection.confCascChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kNegTrack, ConfCascadeSelection.confCascChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kNegTrack, ConfCascadeSelection.confCascChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kNegTrack, ConfCascadeSelection.confCascChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.confCascChildCharge, femtoUniverseTrackSelection::kSign, femtoUniverseSelection::kEqual); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.confCascChildEtaMax, femtoUniverseTrackSelection::kEtaMax, femtoUniverseSelection::kAbsUpperLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.confCascChildTPCnClsMin, femtoUniverseTrackSelection::kTPCnClsMin, femtoUniverseSelection::kLowerLimit); - cascadeCuts.setChildCuts(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.confCascChildPIDnSigmaMax, femtoUniverseTrackSelection::kPIDnSigmaMax, femtoUniverseSelection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femto_universe_cascade_selection::kPosTrack, ConfCascadeSelection.confCascChildCharge, femto_universe_track_selection::kSign, femto_universe_selection::kEqual); + cascadeCuts.setChildCuts(femto_universe_cascade_selection::kPosTrack, ConfCascadeSelection.confCascChildEtaMax, femto_universe_track_selection::kEtaMax, femto_universe_selection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femto_universe_cascade_selection::kPosTrack, ConfCascadeSelection.confCascChildTPCnClsMin, femto_universe_track_selection::kTPCnClsMin, femto_universe_selection::kLowerLimit); + cascadeCuts.setChildCuts(femto_universe_cascade_selection::kPosTrack, ConfCascadeSelection.confCascChildPIDnSigmaMax, femto_universe_track_selection::kPIDnSigmaMax, femto_universe_selection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femto_universe_cascade_selection::kNegTrack, ConfCascadeSelection.confCascChildCharge, femto_universe_track_selection::kSign, femto_universe_selection::kEqual); + cascadeCuts.setChildCuts(femto_universe_cascade_selection::kNegTrack, ConfCascadeSelection.confCascChildEtaMax, femto_universe_track_selection::kEtaMax, femto_universe_selection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femto_universe_cascade_selection::kNegTrack, ConfCascadeSelection.confCascChildTPCnClsMin, femto_universe_track_selection::kTPCnClsMin, femto_universe_selection::kLowerLimit); + cascadeCuts.setChildCuts(femto_universe_cascade_selection::kNegTrack, ConfCascadeSelection.confCascChildPIDnSigmaMax, femto_universe_track_selection::kPIDnSigmaMax, femto_universe_selection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femto_universe_cascade_selection::kBachTrack, ConfCascadeSelection.confCascChildCharge, femto_universe_track_selection::kSign, femto_universe_selection::kEqual); + cascadeCuts.setChildCuts(femto_universe_cascade_selection::kBachTrack, ConfCascadeSelection.confCascChildEtaMax, femto_universe_track_selection::kEtaMax, femto_universe_selection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femto_universe_cascade_selection::kBachTrack, ConfCascadeSelection.confCascChildTPCnClsMin, femto_universe_track_selection::kTPCnClsMin, femto_universe_selection::kLowerLimit); + cascadeCuts.setChildCuts(femto_universe_cascade_selection::kBachTrack, ConfCascadeSelection.confCascChildPIDnSigmaMax, femto_universe_track_selection::kPIDnSigmaMax, femto_universe_selection::kAbsUpperLimit); // TODO - cascadeCuts.setChildPIDSpecies(femtoUniverseCascadeSelection::kPosTrack, ConfV0Selection.confChildPIDspecies); - cascadeCuts.setChildPIDSpecies(femtoUniverseCascadeSelection::kNegTrack, ConfV0Selection.confChildPIDspecies); - cascadeCuts.setChildPIDSpecies(femtoUniverseCascadeSelection::kBachTrack, ConfCascadeSelection.confCascChildPIDspecies); + cascadeCuts.setChildPIDSpecies(femto_universe_cascade_selection::kPosTrack, ConfV0Selection.confChildPIDspecies); + cascadeCuts.setChildPIDSpecies(femto_universe_cascade_selection::kNegTrack, ConfV0Selection.confChildPIDspecies); + cascadeCuts.setChildPIDSpecies(femto_universe_cascade_selection::kBachTrack, ConfCascadeSelection.confCascChildPIDspecies); // check if works correctly for bachelor track cascadeCuts.init(&cascadeQaRegistry, confIsSelectCascOmega); @@ -690,16 +690,16 @@ struct FemtoUniverseProducerTask { if (std::abs(pdgCode) == std::abs(confPDGCodePartOne.value) || std::abs(pdgCode) == std::abs(confPDGCodePartTwo.value)) { if (particleMC.isPhysicalPrimary()) { - particleOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kPrimary; + particleOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kPrimary; } else if (!motherparticlesMC.empty()) { auto motherparticleMC = motherparticlesMC.front(); if (motherparticleMC.producedByGenerator()) particleOrigin = checkDaughterType(fdparttype, motherparticleMC.pdgCode()); } else { - particleOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kMaterial; + particleOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kMaterial; } } else { - particleOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kFake; + particleOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kFake; } outputPartsMC(particleOrigin, pdgCode, particleMC.pt(), particleMC.eta(), particleMC.phi()); @@ -728,17 +728,17 @@ struct FemtoUniverseProducerTask { for (const auto& particleMotherOfNeg : motherskaon1MC) { for (const auto& particleMotherOfPos : motherskaon2MC) { if (particleMotherOfNeg == particleMotherOfPos && particleMotherOfNeg.pdgCode() == 333) { - phiOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kPrimary; + phiOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kPrimary; } else { - phiOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kFake; + phiOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kFake; } } } } else { - phiOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kFake; + phiOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kFake; } } else { - phiOrigin = aod::femtouniverseMCparticle::ParticleOriginMCTruth::kFake; + phiOrigin = aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kFake; } TLorentzVector part1Vec; @@ -806,6 +806,7 @@ struct FemtoUniverseProducerTask { colCuts.fillQA(col); return true; } + return true; } template @@ -910,18 +911,18 @@ struct FemtoUniverseProducerTask { outputParts(outputCollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::femtouniverseparticle::ParticleType::kTrack, cutContainer.at( - femtoUniverseTrackSelection::TrackContainerPosition::kCuts), + femto_universe_track_selection::TrackContainerPosition::kCuts), cutContainer.at( - femtoUniverseTrackSelection::TrackContainerPosition::kPID), + femto_universe_track_selection::TrackContainerPosition::kPID), track.dcaXY(), childIDs, 0, track.sign()); // sign getter is mAntiLambda() } else { outputCascParts(outputCollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::femtouniverseparticle::ParticleType::kTrack, cutContainer.at( - femtoUniverseTrackSelection::TrackContainerPosition::kCuts), + femto_universe_track_selection::TrackContainerPosition::kCuts), cutContainer.at( - femtoUniverseTrackSelection::TrackContainerPosition::kPID), + femto_universe_track_selection::TrackContainerPosition::kPID), track.dcaXY(), childIDs, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } tmpIDtrack.push_back(track.globalIndex()); @@ -973,8 +974,8 @@ struct FemtoUniverseProducerTask { outputParts(outputCollision.lastIndex(), v0.positivept(), v0.positiveeta(), v0.positivephi(), aod::femtouniverseparticle::ParticleType::kV0Child, - cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kPosCuts), - cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kPosPID), + cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kPosCuts), + cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kPosPID), 0., childIDs, 0, @@ -993,8 +994,8 @@ struct FemtoUniverseProducerTask { v0.negativeeta(), v0.negativephi(), aod::femtouniverseparticle::ParticleType::kV0Child, - cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kNegCuts), - cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kNegPID), + cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kNegCuts), + cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kNegPID), 0., childIDs, 0, @@ -1009,7 +1010,7 @@ struct FemtoUniverseProducerTask { v0.eta(), v0.phi(), aod::femtouniverseparticle::ParticleType::kV0, - cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kV0), + cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kV0), 0, v0.v0cosPA(), indexChildID, @@ -1055,8 +1056,8 @@ struct FemtoUniverseProducerTask { casc.positiveeta(), casc.positivephi(), aod::femtouniverseparticle::ParticleType::kV0Child, - 0, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kPosCuts), - 0, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kPosPID), + 0, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kPosCuts), + 0, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kPosPID), 0., childIDs, 0, @@ -1086,8 +1087,8 @@ struct FemtoUniverseProducerTask { casc.negativeeta(), casc.negativephi(), aod::femtouniverseparticle::ParticleType::kV0Child, - 0, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kNegCuts), - 0, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kNegPID), + 0, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kNegCuts), + 0, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kNegPID), 0., childIDs, 0, @@ -1118,8 +1119,8 @@ struct FemtoUniverseProducerTask { casc.bacheloreta(), casc.bachelorphi(), aod::femtouniverseparticle::ParticleType::kCascadeBachelor, - 0, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kNegCuts), - 0, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kNegPID), + 0, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kNegCuts), + 0, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kNegPID), 0., childIDs, 0, @@ -1142,7 +1143,7 @@ struct FemtoUniverseProducerTask { casc.eta(), casc.phi(), aod::femtouniverseparticle::ParticleType::kCascade, - 0, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kV0), + 0, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kV0), 0, 0, indexCascChildID, @@ -1227,8 +1228,8 @@ struct FemtoUniverseProducerTask { RecoDecay::eta(std::array{hfCand.pxProng0(), hfCand.pyProng0(), hfCand.pzProng0()}), // eta RecoDecay::phi(hfCand.pxProng0(), hfCand.pyProng0()), // phi aod::femtouniverseparticle::ParticleType::kD0Child, - -999, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kPosCuts), - -999, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kPosPID), + -999, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kPosCuts), + -999, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kPosPID), -999, childIDs, postrack.sign(), // D0 mass -> positive daughter of D0/D0bar @@ -1249,8 +1250,8 @@ struct FemtoUniverseProducerTask { RecoDecay::eta(std::array{hfCand.pxProng1(), hfCand.pyProng1(), hfCand.pzProng1()}), // eta RecoDecay::phi(hfCand.pxProng1(), hfCand.pyProng1()), // phi aod::femtouniverseparticle::ParticleType::kD0Child, - -999, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kNegCuts), - -999, // cutContainerV0.at(femtoUniverseV0Selection::V0ContainerPosition::kNegPID), + -999, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kNegCuts), + -999, // cutContainerV0.at(femto_universe_v0_selection::V0ContainerPosition::kNegPID), -999, childIDs, negtrack.sign(), // negative daughter of D0/D0bar diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTaskV0Only.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTaskV0Only.cxx index f2edc136e3d..f834a51b49d 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTaskV0Only.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTaskV0Only.cxx @@ -36,7 +36,7 @@ #include "TMath.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; @@ -109,60 +109,60 @@ struct femtoUniverseProducerTaskV0Only { /// \todo Labeled array (see Track-Track task) Configurable> ConfV0Sign{ - FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0Sign, + FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0Sign, "ConfV0"), std::vector{-1, 1}, - FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0Sign, + FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0Sign, "V0 selection: ")}; Configurable> ConfV0PtMin{ - FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0pTMin, + FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0pTMin, "ConfV0"), std::vector{0.3f}, - FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0pTMin, + FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0pTMin, "V0 selection: ")}; Configurable> ConfV0PtMax{ - FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0pTMax, + FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0pTMax, "ConfV0"), std::vector{6.f}, - FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0pTMax, + FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0pTMax, "V0 selection: ")}; Configurable> ConfV0EtaMax{ - FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0etaMax, + FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0etaMax, "ConfV0"), std::vector{6.f}, - FemtoUniverseV0Selection::getSelectionHelper(femtoUniverseV0Selection::kV0etaMax, + FemtoUniverseV0Selection::getSelectionHelper(femto_universe_v0_selection::kV0etaMax, "V0 selection: ")}; Configurable> ConfDCAV0DaughMax{ FemtoUniverseV0Selection::getSelectionName( - femtoUniverseV0Selection::kV0DCADaughMax, "ConfV0"), + femto_universe_v0_selection::kV0DCADaughMax, "ConfV0"), std::vector{1.5f}, FemtoUniverseV0Selection::getSelectionHelper( - femtoUniverseV0Selection::kV0DCADaughMax, "V0 selection: ")}; + femto_universe_v0_selection::kV0DCADaughMax, "V0 selection: ")}; Configurable> ConfCPAV0Min{ - FemtoUniverseV0Selection::getSelectionName(femtoUniverseV0Selection::kV0CPAMin, + FemtoUniverseV0Selection::getSelectionName(femto_universe_v0_selection::kV0CPAMin, "ConfV0"), std::vector{0.99f}, FemtoUniverseV0Selection::getSelectionHelper( - femtoUniverseV0Selection::kV0CPAMin, "V0 selection: ")}; + femto_universe_v0_selection::kV0CPAMin, "V0 selection: ")}; Configurable> V0TranRadV0Min{ FemtoUniverseV0Selection::getSelectionName( - femtoUniverseV0Selection::kV0TranRadMin, "ConfV0"), + femto_universe_v0_selection::kV0TranRadMin, "ConfV0"), std::vector{0.2f}, FemtoUniverseV0Selection::getSelectionHelper( - femtoUniverseV0Selection::kV0TranRadMin, "V0 selection: ")}; + femto_universe_v0_selection::kV0TranRadMin, "V0 selection: ")}; Configurable> V0TranRadV0Max{ FemtoUniverseV0Selection::getSelectionName( - femtoUniverseV0Selection::kV0TranRadMax, "ConfV0"), + femto_universe_v0_selection::kV0TranRadMax, "ConfV0"), std::vector{100.f}, FemtoUniverseV0Selection::getSelectionHelper( - femtoUniverseV0Selection::kV0TranRadMax, "V0 selection: ")}; + femto_universe_v0_selection::kV0TranRadMax, "V0 selection: ")}; Configurable> V0DecVtxMax{ FemtoUniverseV0Selection::getSelectionName( - femtoUniverseV0Selection::kV0DecVtxMax, "ConfV0"), + femto_universe_v0_selection::kV0DecVtxMax, "ConfV0"), std::vector{100.f}, FemtoUniverseV0Selection::getSelectionHelper( - femtoUniverseV0Selection::kV0DecVtxMax, "V0 selection: ")}; + femto_universe_v0_selection::kV0DecVtxMax, "V0 selection: ")}; Configurable> ConfV0DaughCharge{ "ConfV0DaughCharge", std::vector{-1, 1}, "V0 Daugh sel: Charge"}; @@ -223,67 +223,67 @@ struct femtoUniverseProducerTaskV0Only { /// \todo fix how to pass array to setSelection, getRow() passing a /// different type! // v0Cuts.setSelection(ConfV0Selection->getRow(0), - // femtoUniverseV0Selection::kDecVtxMax, femtoUniverseSelection::kAbsUpperLimit); + // femto_universe_v0_selection::kDecVtxMax, femto_universe_selection::kAbsUpperLimit); if (ConfStoreV0) { - v0Cuts.setSelection(ConfV0Sign, femtoUniverseV0Selection::kV0Sign, - femtoUniverseSelection::kEqual); - v0Cuts.setSelection(ConfV0PtMin, femtoUniverseV0Selection::kV0pTMin, - femtoUniverseSelection::kLowerLimit); - v0Cuts.setSelection(ConfV0PtMax, femtoUniverseV0Selection::kV0pTMax, - femtoUniverseSelection::kUpperLimit); - v0Cuts.setSelection(ConfV0EtaMax, femtoUniverseV0Selection::kV0etaMax, - femtoUniverseSelection::kUpperLimit); + v0Cuts.setSelection(ConfV0Sign, femto_universe_v0_selection::kV0Sign, + femto_universe_selection::kEqual); + v0Cuts.setSelection(ConfV0PtMin, femto_universe_v0_selection::kV0pTMin, + femto_universe_selection::kLowerLimit); + v0Cuts.setSelection(ConfV0PtMax, femto_universe_v0_selection::kV0pTMax, + femto_universe_selection::kUpperLimit); + v0Cuts.setSelection(ConfV0EtaMax, femto_universe_v0_selection::kV0etaMax, + femto_universe_selection::kUpperLimit); v0Cuts.setSelection(ConfDCAV0DaughMax, - femtoUniverseV0Selection::kV0DCADaughMax, - femtoUniverseSelection::kUpperLimit); - v0Cuts.setSelection(ConfCPAV0Min, femtoUniverseV0Selection::kV0CPAMin, - femtoUniverseSelection::kLowerLimit); - - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0DaughCharge, - femtoUniverseTrackSelection::kSign, - femtoUniverseSelection::kEqual); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfDaughEta, - femtoUniverseTrackSelection::kEtaMax, - femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, + femto_universe_v0_selection::kV0DCADaughMax, + femto_universe_selection::kUpperLimit); + v0Cuts.setSelection(ConfCPAV0Min, femto_universe_v0_selection::kV0CPAMin, + femto_universe_selection::kLowerLimit); + + v0Cuts.setChildCuts(femto_universe_v0_selection::kPosTrack, ConfV0DaughCharge, + femto_universe_track_selection::kSign, + femto_universe_selection::kEqual); + v0Cuts.setChildCuts(femto_universe_v0_selection::kPosTrack, ConfDaughEta, + femto_universe_track_selection::kEtaMax, + femto_universe_selection::kAbsUpperLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kPosTrack, ConfV0DaughTPCnclsMin, - femtoUniverseTrackSelection::kTPCnClsMin, - femtoUniverseSelection::kLowerLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, ConfV0DaughDCAMin, - femtoUniverseTrackSelection::kDCAMin, - femtoUniverseSelection::kAbsLowerLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kPosTrack, + femto_universe_track_selection::kTPCnClsMin, + femto_universe_selection::kLowerLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kPosTrack, ConfV0DaughDCAMin, + femto_universe_track_selection::kDCAMin, + femto_universe_selection::kAbsLowerLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kPosTrack, ConfV0DaughPIDnSigmaMax, - femtoUniverseTrackSelection::kPIDnSigmaMax, - femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0DaughCharge, - femtoUniverseTrackSelection::kSign, - femtoUniverseSelection::kEqual); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfDaughEta, - femtoUniverseTrackSelection::kEtaMax, - femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, + femto_universe_track_selection::kPIDnSigmaMax, + femto_universe_selection::kAbsUpperLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kNegTrack, ConfV0DaughCharge, + femto_universe_track_selection::kSign, + femto_universe_selection::kEqual); + v0Cuts.setChildCuts(femto_universe_v0_selection::kNegTrack, ConfDaughEta, + femto_universe_track_selection::kEtaMax, + femto_universe_selection::kAbsUpperLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kNegTrack, ConfV0DaughTPCnclsMin, - femtoUniverseTrackSelection::kTPCnClsMin, - femtoUniverseSelection::kLowerLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, ConfV0DaughDCAMin, - femtoUniverseTrackSelection::kDCAMin, - femtoUniverseSelection::kAbsLowerLimit); - v0Cuts.setChildCuts(femtoUniverseV0Selection::kNegTrack, + femto_universe_track_selection::kTPCnClsMin, + femto_universe_selection::kLowerLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kNegTrack, ConfV0DaughDCAMin, + femto_universe_track_selection::kDCAMin, + femto_universe_selection::kAbsLowerLimit); + v0Cuts.setChildCuts(femto_universe_v0_selection::kNegTrack, ConfV0DaughPIDnSigmaMax, - femtoUniverseTrackSelection::kPIDnSigmaMax, - femtoUniverseSelection::kAbsUpperLimit); - v0Cuts.setChildPIDSpecies(femtoUniverseV0Selection::kPosTrack, + femto_universe_track_selection::kPIDnSigmaMax, + femto_universe_selection::kAbsUpperLimit); + v0Cuts.setChildPIDSpecies(femto_universe_v0_selection::kPosTrack, ConfV0DaughTPIDspecies); - v0Cuts.setChildPIDSpecies(femtoUniverseV0Selection::kNegTrack, + v0Cuts.setChildPIDSpecies(femto_universe_v0_selection::kNegTrack, ConfV0DaughTPIDspecies); v0Cuts.init(&qaRegistry); v0Cuts.setInvMassLimits(ConfInvMassLowLimit, ConfInvMassUpLimit); - v0Cuts.setChildRejectNotPropagatedTracks(femtoUniverseV0Selection::kPosTrack, + v0Cuts.setChildRejectNotPropagatedTracks(femto_universe_v0_selection::kPosTrack, ConfRejectNotPropagatedTracks); - v0Cuts.setChildRejectNotPropagatedTracks(femtoUniverseV0Selection::kNegTrack, + v0Cuts.setChildRejectNotPropagatedTracks(femto_universe_v0_selection::kNegTrack, ConfRejectNotPropagatedTracks); if (ConfRejectKaons) { v0Cuts.setKaonInvMassLimits(ConfInvKaonMassLowLimit, @@ -423,11 +423,11 @@ struct femtoUniverseProducerTaskV0Only { col, v0, postrack, negtrack); if ((cutContainerV0.at( - femtoUniverseV0Selection::V0ContainerPosition::kV0) > 0) && + femto_universe_v0_selection::V0ContainerPosition::kV0) > 0) && (cutContainerV0.at( - femtoUniverseV0Selection::V0ContainerPosition::kPosCuts) > 0) && + femto_universe_v0_selection::V0ContainerPosition::kPosCuts) > 0) && (cutContainerV0.at( - femtoUniverseV0Selection::V0ContainerPosition::kNegCuts) > 0)) { + femto_universe_v0_selection::V0ContainerPosition::kNegCuts) > 0)) { int postrackID = v0.posTrackId(); int rowInPrimaryTrackTablePos = -1; rowInPrimaryTrackTablePos = getRowDaughters(postrackID, tmpIDtrack); @@ -437,9 +437,9 @@ struct femtoUniverseProducerTaskV0Only { v0.positiveeta(), v0.positivephi(), aod::femtouniverseparticle::ParticleType::kV0Child, cutContainerV0.at( - femtoUniverseV0Selection::V0ContainerPosition::kPosCuts), + femto_universe_v0_selection::V0ContainerPosition::kPosCuts), cutContainerV0.at( - femtoUniverseV0Selection::V0ContainerPosition::kPosPID), + femto_universe_v0_selection::V0ContainerPosition::kPosPID), 0., childIDs, 0, 0); const int rowOfPosTrack = outputParts.lastIndex(); int negtrackID = v0.negTrackId(); @@ -451,16 +451,16 @@ struct femtoUniverseProducerTaskV0Only { v0.negativeeta(), v0.negativephi(), aod::femtouniverseparticle::ParticleType::kV0Child, cutContainerV0.at( - femtoUniverseV0Selection::V0ContainerPosition::kNegCuts), + femto_universe_v0_selection::V0ContainerPosition::kNegCuts), cutContainerV0.at( - femtoUniverseV0Selection::V0ContainerPosition::kNegPID), + femto_universe_v0_selection::V0ContainerPosition::kNegPID), 0., childIDs, 0, 0); const int rowOfNegTrack = outputParts.lastIndex(); std::vector indexChildID = {rowOfPosTrack, rowOfNegTrack}; outputParts(outputCollision.lastIndex(), v0.pt(), v0.eta(), v0.phi(), aod::femtouniverseparticle::ParticleType::kV0, cutContainerV0.at( - femtoUniverseV0Selection::V0ContainerPosition::kV0), + femto_universe_v0_selection::V0ContainerPosition::kV0), 0, v0.v0cosPA(), indexChildID, v0.mLambda(), v0.mAntiLambda()); if (ConfDebugOutput) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseCutCulator.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseCutCulator.cxx index a13c35fa3e3..45edb854cc2 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseCutCulator.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseCutCulator.cxx @@ -22,7 +22,7 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" #include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; /// The function takes the path to the dpl-config.json as a argument and the /// does a Q&A session for the user to find the appropriate selection criteria @@ -55,8 +55,8 @@ int main(int /*argc*/, char* argv[]) return 2; } /// \todo factor out the pid here - /// cut.setTrackSelection(femtoUniverseTrackSelection::kPIDnSigmaMax, - /// femtoUniverseSelection::kAbsUpperLimit, "ConfTrk"); + /// cut.setTrackSelection(femto_universe_track_selection::kPIDnSigmaMax, + /// femto_universe_selection::kAbsUpperLimit, "ConfTrk"); std::cout << "Do you want to manually select cuts or create systematic " "variations(M/V)? >"; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugTrack.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugTrack.cxx index 94a0d58a646..444469de52b 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugTrack.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugTrack.cxx @@ -24,12 +24,12 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugV0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugV0.cxx index fc987815989..c1d1bef3122 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugV0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseDebugV0.cxx @@ -29,10 +29,10 @@ #include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx index b071bc71f62..c357fa284f7 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx @@ -25,7 +25,7 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyTask.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyTask.cxx index b1c4493470f..fcd9c56d452 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyTask.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyTask.cxx @@ -35,7 +35,7 @@ #include "TPDGCode.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::track; using namespace o2::framework; using namespace o2::framework::expressions; @@ -73,7 +73,7 @@ struct femtoUniverseEficiencyTask { Configurable cfgDcaXY{"cfgDcaXY", 2.4, "Value of max. DCA_XY"}; Configurable cfgDcaZ{"cfgDcaZ", 3.2, "Value of max. DCA_Z"}; /// Event cuts - o2::analysis::femtoUniverse::FemtoUniverseCollisionSelection colCuts; + o2::analysis::femto_universe::FemtoUniverseCollisionSelection colCuts; Configurable ConfEvtZvtx{"ConfEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; Configurable ConfEvtTriggerCheck{"ConfEvtTriggerCheck", true, "Evt sel: check for trigger"}; Configurable ConfEvtTriggerSel{"ConfEvtTriggerSel", kINT7, "Evt sel: trigger"}; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseHashTask.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseHashTask.cxx index f33657f0dca..773f6649d97 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseHashTask.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseHashTask.cxx @@ -9,9 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file femtoUniverseReaderTask.cxx +/// \file femtoUniverseHashTask.cxx /// \brief Tasks that reads the track tables used for the pairing -/// This task is common for all femto analyses /// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de /// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch @@ -24,34 +23,34 @@ using namespace o2; using namespace o2::framework; -struct femtoUniversePairHashTask { +struct FemtoUniverseHashTask { - Configurable> CfgVtxBins{"CfgVtxBins", std::vector{-10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - Configurable> CfgMultBins{"CfgMultBins", std::vector{0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; - // Configurable> CfgMultBins{"CfgMultBins", std::vector{0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; + Configurable> cfgVtxBins{"cfgVtxBins", std::vector{-10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + Configurable> cfgMultBins{"cfgMultBins", std::vector{0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; + // Configurable> cfgMultBins{"cfgMultBins", std::vector{0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; - std::vector CastCfgVtxBins, CastCfgMultBins; + std::vector castCfgVtxBins, castCfgMultBins; Produces hashes; void init(InitContext&) { /// here the Configurables are passed to std::vectors - CastCfgVtxBins = (std::vector)CfgVtxBins; - CastCfgMultBins = (std::vector)CfgMultBins; + castCfgVtxBins = (std::vector)cfgVtxBins; + castCfgMultBins = (std::vector)cfgMultBins; } void process(o2::aod::FDCollision const& col) { /// the hash of the collision is computed and written to table - hashes(eventmixing::getMixingBin(CastCfgVtxBins, CastCfgMultBins, col.posZ(), col.multV0M())); + hashes(eventmixing::getMixingBin(castCfgVtxBins, castCfgMultBins, col.posZ(), col.multV0M())); } }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; return workflow; } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx index e0197fb8958..926ac6d8a94 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx @@ -28,13 +28,13 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" using namespace o2; using namespace o2::soa; using namespace o2::framework; using namespace o2::framework::expressions; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::aod::pidutils; struct femtoUniversePairTaskTrackCascadeExtended { // o2-linter: disable=name/struct @@ -105,8 +105,8 @@ struct femtoUniversePairTaskTrackCascadeExtended { // o2-linter: disable=name/st FemtoUniverseParticleHisto bachHistos; FemtoUniverseParticleHisto cascQAHistos; - FemtoUniverseContainer sameEventCont; - FemtoUniverseContainer mixedEventCont; + FemtoUniverseContainer sameEventCont; + FemtoUniverseContainer mixedEventCont; FemtoUniversePairCleaner pairCleaner; HistogramRegistry rXiQA{"xi", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx index a994a047157..fc51aa9218e 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx @@ -28,6 +28,7 @@ #include "Framework/O2DatabasePDGPlugin.h" #include "ReconstructionDataFormats/PID.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/Core/RecoDecay.h" #include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h" @@ -36,7 +37,7 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" #include "PWGHF/Core/HfHelper.h" @@ -45,7 +46,7 @@ using namespace o2; using namespace o2::analysis; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; @@ -194,10 +195,10 @@ struct FemtoUniversePairTaskTrackD0 { Configurable confCPRdeltaEtaCutMin{"confCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; Configurable confCPRChosenRadii{"confCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; - FemtoUniverseFemtoContainer sameEventFemtoCont; - FemtoUniverseFemtoContainer mixedEventFemtoCont; - FemtoUniverseAngularContainer sameEventAngularCont; - FemtoUniverseAngularContainer mixedEventAngularCont; + FemtoUniverseFemtoContainer sameEventFemtoCont; + FemtoUniverseFemtoContainer mixedEventFemtoCont; + FemtoUniverseAngularContainer sameEventAngularCont; + FemtoUniverseAngularContainer mixedEventAngularCont; FemtoUniversePairCleaner pairCleaner; FemtoUniverseDetaDphiStar pairCloseRejection; FemtoUniverseTrackSelection trackCuts; @@ -618,7 +619,7 @@ struct FemtoUniversePairTaskTrackD0 { } // // Close Pair Rejection if (confIsCPR.value) { - if (pairCloseRejection.isClosePair(track, d0candidate, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(track, d0candidate, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -704,7 +705,7 @@ struct FemtoUniversePairTaskTrackD0 { } // // Close Pair Rejection if (confIsCPR.value) { - if (pairCloseRejection.isClosePair(track, d0candidate, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { + if (pairCloseRejection.isClosePair(track, d0candidate, parts, magFieldTesla, femto_universe_container::EventType::mixed)) { continue; } } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx index 74b265cd766..595211f78ab 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx @@ -36,13 +36,13 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairWithCentMultKt.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; @@ -202,33 +202,33 @@ struct femtoUniversePairTaskTrackNucleus { Configurable cfgProcessKtBins{"cfgProcessKtBins", true, "Process kstar histograms in kT bins (if 'cfgProcessMultBins' is false, it will not be processed regardless of 'cfgProcessKtBins' state)"}; Configurable cfgProcessKtMt3DCF{"cfgProcessKtMt3DCF", false, "Process 3D histograms in kT and MultBins"}; - FemtoUniverseFemtoContainer sameEventContPP; - FemtoUniverseFemtoContainer mixedEventContPP; + FemtoUniverseFemtoContainer sameEventContPP; + FemtoUniverseFemtoContainer mixedEventContPP; - FemtoUniverseFemtoContainer sameEventContMM; - FemtoUniverseFemtoContainer mixedEventContMM; + FemtoUniverseFemtoContainer sameEventContMM; + FemtoUniverseFemtoContainer mixedEventContMM; - FemtoUniverseFemtoContainer sameEventContPM; - FemtoUniverseFemtoContainer mixedEventContPM; + FemtoUniverseFemtoContainer sameEventContPM; + FemtoUniverseFemtoContainer mixedEventContPM; - FemtoUniverseFemtoContainer sameEventContMP; - FemtoUniverseFemtoContainer mixedEventContMP; + FemtoUniverseFemtoContainer sameEventContMP; + FemtoUniverseFemtoContainer mixedEventContMP; FemtoUniversePairCleaner pairCleaner; FemtoUniverseDetaDphiStar pairCloseRejection; FemtoUniverseTrackSelection trackCuts; - PairWithCentMultKt sameEventMultContPP; - PairWithCentMultKt mixedEventMultContPP; + FemtoUniversePairWithCentMultKt sameEventMultContPP; + FemtoUniversePairWithCentMultKt mixedEventMultContPP; - PairWithCentMultKt sameEventMultContMM; - PairWithCentMultKt mixedEventMultContMM; + FemtoUniversePairWithCentMultKt sameEventMultContMM; + FemtoUniversePairWithCentMultKt mixedEventMultContMM; - PairWithCentMultKt sameEventMultContPM; - PairWithCentMultKt mixedEventMultContPM; + FemtoUniversePairWithCentMultKt sameEventMultContPM; + FemtoUniversePairWithCentMultKt mixedEventMultContPM; - PairWithCentMultKt sameEventMultContMP; - PairWithCentMultKt mixedEventMultContMP; + FemtoUniversePairWithCentMultKt sameEventMultContMP; + FemtoUniversePairWithCentMultKt mixedEventMultContMP; float mass1 = -1; float mass2 = -1; @@ -525,7 +525,7 @@ struct femtoUniversePairTaskTrackNucleus { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -680,7 +680,7 @@ struct femtoUniversePairTaskTrackNucleus { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::mixed)) { continue; } } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx index eedf16489c9..4ee98317da0 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackPhi.cxx @@ -34,14 +34,14 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" #include #include #include "CCDB/BasicCCDBManager.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; @@ -161,8 +161,8 @@ struct FemtoUniversePairTaskTrackPhi { ConfigurableAxis confBinskT{"confBinskT", {150, 0., 9.}, "binning kT"}; ConfigurableAxis confBinsmT{"confBinsmT", {225, 0., 7.5}, "binning mT"}; - FemtoUniverseAngularContainer sameEventAngularCont; - FemtoUniverseAngularContainer mixedEventAngularCont; + FemtoUniverseAngularContainer sameEventAngularCont; + FemtoUniverseAngularContainer mixedEventAngularCont; FemtoUniversePairCleaner pairCleaner; FemtoUniverseDetaDphiStar pairCloseRejection; FemtoUniverseTrackSelection trackCuts; @@ -544,7 +544,7 @@ struct FemtoUniversePairTaskTrackPhi { // Close Pair Rejection if (ConfCPR.confCPRIsEnabled.value) { - if (pairCloseRejection.isClosePair(track, phicandidate, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(track, phicandidate, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -654,7 +654,7 @@ struct FemtoUniversePairTaskTrackPhi { } if (ConfCPR.confCPRIsEnabled.value) { - if (pairCloseRejection.isClosePair(track, phicandidate, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { + if (pairCloseRejection.isClosePair(track, phicandidate, parts, magFieldTesla, femto_universe_container::EventType::mixed)) { continue; } } @@ -779,7 +779,7 @@ struct FemtoUniversePairTaskTrackPhi { continue; // no MC particle const auto& mcpart = mcparts.iteratorAt(mcPartId); if (part.partType() == aod::femtouniverseparticle::ParticleType::kPhi) { - if ((mcpart.pdgMCTruth() == 333) && (mcpart.partOriginMCTruth() == aod::femtouniverseMCparticle::ParticleOriginMCTruth::kPrimary)) { + if ((mcpart.pdgMCTruth() == 333) && (mcpart.partOriginMCTruth() == aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kPrimary)) { registryMCreco.fill(HIST("MCrecoPhi"), mcpart.pt(), mcpart.eta()); // phi } } else if (part.partType() == aod::femtouniverseparticle::ParticleType::kTrack) { diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx index 72157d49253..7449aa4433c 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack.cxx @@ -14,6 +14,7 @@ /// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de /// \author Georgios Mantzaridis, TU München, georgios.mantzaridis@tum.de /// \author Anton Riedel, TU München, anton.riedel@tum.de +/// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch #include #include "Framework/AnalysisTask.h" @@ -23,7 +24,6 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/StepTHn.h" #include "Framework/O2DatabasePDGPlugin.h" -#include "TDatabasePDG.h" #include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h" @@ -32,63 +32,63 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; namespace { -static constexpr int nPart = 2; -static constexpr int nCuts = 5; +static constexpr int NPart = 2; +static constexpr int NCuts = 5; static const std::vector partNames{"PartOne", "PartTwo"}; static const std::vector cutNames{"MaxPt", "PIDthr", "nSigmaTPC", "nSigmaTPCTOF", "MaxP"}; -static const float cutsTable[nPart][nCuts]{ +static const float cutsTable[NPart][NCuts]{ {4.05f, 1.f, 3.f, 3.f, 100.f}, {4.05f, 1.f, 3.f, 3.f, 100.f}}; } // namespace -struct femtoUniversePairTaskTrackTrack { +struct FemtoUniversePairTaskTrackTrack { SliceCache cache; Preslice perCol = aod::femtouniverseparticle::fdCollisionId; /// Particle selection part /// Table for both particles - Configurable> ConfCutTable{"ConfCutTable", {cutsTable[0], nPart, nCuts, partNames, cutNames}, "Particle selections"}; - Configurable ConfNspecies{"ConfNspecies", 2, "Number of particle spieces with PID info"}; - Configurable ConfIsMC{"ConfIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; - Configurable> ConfTrkPIDnSigmaMax{"ConfTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; - Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; + Configurable> confCutTable{"confCutTable", {cutsTable[0], NPart, NCuts, partNames, cutNames}, "Particle selections"}; + Configurable confNspecies{"confNspecies", 2, "Number of particle spieces with PID info"}; + Configurable confIsMC{"confIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; + Configurable> confTrkPIDnSigmaMax{"confTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; + Configurable confUse3D{"confUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; /// Particle 1 - Configurable ConfPDGCodePartOne{"ConfPDGCodePartOne", 2212, "Particle 1 - PDG code"}; - Configurable ConfCutPartOne{"ConfCutPartOne", 5542474, "Particle 1 - Selection bit from cutCulator"}; - Configurable ConfPIDPartOne{"ConfPIDPartOne", 2, "Particle 1 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector>int>> + Configurable confPDGCodePartOne{"confPDGCodePartOne", 2212, "Particle 1 - PDG code"}; + Configurable confCutPartOne{"confCutPartOne", 5542474, "Particle 1 - Selection bit from cutCulator"}; + Configurable confPIDPartOne{"confPIDPartOne", 2, "Particle 1 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector>int>> /// Partition for particle 1 - Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && ((aod::femtouniverseparticle::cut & ConfCutPartOne) == ConfCutPartOne); - Partition> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && ((aod::femtouniverseparticle::cut & ConfCutPartOne) == ConfCutPartOne); + Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && ((aod::femtouniverseparticle::cut & confCutPartOne) == confCutPartOne); + Partition> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && ((aod::femtouniverseparticle::cut & confCutPartOne) == confCutPartOne); /// Histogramming for particle 1 FemtoUniverseParticleHisto trackHistoPartOne; /// Particle 2 - Configurable ConfIsSame{"ConfIsSame", false, "Pairs of the same particle"}; - Configurable ConfPDGCodePartTwo{"ConfPDGCodePartTwo", 2212, "Particle 2 - PDG code"}; - Configurable ConfCutPartTwo{"ConfCutPartTwo", 5542474, "Particle 2 - Selection bit"}; - Configurable ConfPIDPartTwo{"ConfPIDPartTwo", 2, "Particle 2 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> + Configurable confIsSame{"confIsSame", false, "Pairs of the same particle"}; + Configurable confPDGCodePartTwo{"confPDGCodePartTwo", 2212, "Particle 2 - PDG code"}; + Configurable confCutPartTwo{"confCutPartTwo", 5542474, "Particle 2 - Selection bit"}; + Configurable confPIDPartTwo{"confPIDPartTwo", 2, "Particle 2 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> /// Partition for particle 2 Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && // (aod::femtouniverseparticle::pt < cfgCutTable->get("PartTwo", "MaxPt")) && - ((aod::femtouniverseparticle::cut & ConfCutPartTwo) == ConfCutPartTwo); + ((aod::femtouniverseparticle::cut & confCutPartTwo) == confCutPartTwo); Partition> partsTwoMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && - ((aod::femtouniverseparticle::cut & ConfCutPartTwo) == ConfCutPartTwo); + ((aod::femtouniverseparticle::cut & confCutPartTwo) == confCutPartTwo); /// Histogramming for particle 2 FemtoUniverseParticleHisto trackHistoPartTwo; @@ -101,81 +101,80 @@ struct femtoUniversePairTaskTrackTrack { std::vector kNsigma; /// particle part - ConfigurableAxis ConfTempFitVarBins{"ConfDTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfTempFitVarpTBins{"ConfTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; + ConfigurableAxis confTempFitVarBins{"confTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis confTempFitVarpTBins{"confTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; /// Correlation part - ConfigurableAxis ConfMultBins{"ConfMultBins", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; // \todo to be obtained from the hash task - // ConfigurableAxis ConfMultBins{"CfgMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - - ConfigurableAxis ConfmTBins3D{"ConfmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - ConfigurableAxis ConfmultBins3D{"ConfmultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - - ColumnBinningPolicy colBinning{{ConfVtxBins, ConfMultBins}, true}; - - ConfigurableAxis ConfkstarBins{"ConfkstarBins", {1500, 0., 6.}, "binning kstar"}; - ConfigurableAxis ConfkTBins{"ConfkTBins", {150, 0., 9.}, "binning kT"}; - ConfigurableAxis ConfmTBins{"ConfmTBins", {225, 0., 7.5}, "binning mT"}; - Configurable ConfNEventsMix{"ConfNEventsMix", 5, "Number of events for mixing"}; - Configurable ConfIsCPR{"ConfIsCPR", true, "Close Pair Rejection"}; - Configurable ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"}; - Configurable ConfCPRdeltaPhiCutMax{"ConfCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaPhiCutMin{"ConfCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaEtaCutMax{"ConfCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaEtaCutMin{"ConfCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; - Configurable ConfCPRChosenRadii{"ConfCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; - Configurable ConfPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"}; - Configurable ConfEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"}; - - FemtoUniverseFemtoContainer sameEventFemtoCont; - FemtoUniverseFemtoContainer mixedEventFemtoCont; - FemtoUniverseAngularContainer sameEventAngularCont; - FemtoUniverseAngularContainer mixedEventAngularCont; + ConfigurableAxis confMultBins{"confMultBins", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; // \todo to be obtained from the hash task + ConfigurableAxis confVtxBins{"confVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + + ConfigurableAxis confmTBins3D{"confmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + ConfigurableAxis confMultBins3D{"confMultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + + ColumnBinningPolicy colBinning{{confVtxBins, confMultBins}, true}; + + ConfigurableAxis confkstarBins{"confkstarBins", {1500, 0., 6.}, "binning kstar"}; + ConfigurableAxis confkTBins{"confkTBins", {150, 0., 9.}, "binning kT"}; + ConfigurableAxis confmTBins{"confmTBins", {225, 0., 7.5}, "binning mT"}; + Configurable confNEventsMix{"confNEventsMix", 5, "Number of events for mixing"}; + Configurable confIsCPR{"confIsCPR", true, "Close Pair Rejection"}; + Configurable confCPRPlotPerRadii{"confCPRPlotPerRadii", false, "Plot CPR per radii"}; + Configurable confCPRdeltaPhiCutMax{"confCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; + Configurable confCPRdeltaPhiCutMin{"confCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; + Configurable confCPRdeltaEtaCutMax{"confCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; + Configurable confCPRdeltaEtaCutMin{"confCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; + Configurable confCPRChosenRadii{"confCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; + Configurable confPhiBins{"confPhiBins", 29, "Number of phi bins in deta dphi"}; + Configurable confEtaBins{"confEtaBins", 29, "Number of eta bins in deta dphi"}; + + FemtoUniverseFemtoContainer sameEventFemtoCont; + FemtoUniverseFemtoContainer mixedEventFemtoCont; + FemtoUniverseAngularContainer sameEventAngularCont; + FemtoUniverseAngularContainer mixedEventAngularCont; FemtoUniversePairCleaner pairCleaner; FemtoUniverseDetaDphiStar pairCloseRejection; /// Histogram output HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry MixQaRegistry{"MixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry mixQaRegistry{"mixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) { eventHisto.init(&qaRegistry); - trackHistoPartOne.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarBins, ConfIsMC, ConfPDGCodePartOne, false); - if (!ConfIsSame) { - trackHistoPartTwo.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarBins, ConfIsMC, ConfPDGCodePartTwo, false); + trackHistoPartOne.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarBins, confIsMC, confPDGCodePartOne, false); + if (!confIsSame) { + trackHistoPartTwo.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarBins, confIsMC, confPDGCodePartTwo, false); } - MixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); - MixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + mixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + mixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); - sameEventFemtoCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfIsMC, ConfUse3D); - mixedEventFemtoCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfIsMC, ConfUse3D); - sameEventAngularCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfEtaBins, ConfPhiBins, ConfIsMC, ConfUse3D); - mixedEventAngularCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfEtaBins, ConfPhiBins, ConfIsMC, ConfUse3D); + sameEventFemtoCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confMultBins3D, confmTBins3D, confIsMC, confUse3D); + mixedEventFemtoCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confMultBins3D, confmTBins3D, confIsMC, confUse3D); + sameEventAngularCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confMultBins3D, confmTBins3D, confEtaBins, confPhiBins, confIsMC, confUse3D); + mixedEventAngularCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confMultBins3D, confmTBins3D, confEtaBins, confPhiBins, confIsMC, confUse3D); - sameEventFemtoCont.setPDGCodes(ConfPDGCodePartOne, ConfPDGCodePartTwo); - mixedEventFemtoCont.setPDGCodes(ConfPDGCodePartOne, ConfPDGCodePartTwo); - sameEventAngularCont.setPDGCodes(ConfPDGCodePartOne, ConfPDGCodePartTwo); - mixedEventAngularCont.setPDGCodes(ConfPDGCodePartOne, ConfPDGCodePartTwo); + sameEventFemtoCont.setPDGCodes(confPDGCodePartOne, confPDGCodePartTwo); + mixedEventFemtoCont.setPDGCodes(confPDGCodePartOne, confPDGCodePartTwo); + sameEventAngularCont.setPDGCodes(confPDGCodePartOne, confPDGCodePartTwo); + mixedEventAngularCont.setPDGCodes(confPDGCodePartOne, confPDGCodePartTwo); pairCleaner.init(&qaRegistry); - if (ConfIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); + if (confIsCPR.value) { + pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } - vPIDPartOne = ConfPIDPartOne.value; - vPIDPartTwo = ConfPIDPartTwo.value; - kNsigma = ConfTrkPIDnSigmaMax.value; + vPIDPartOne = confPIDPartOne.value; + vPIDPartTwo = confPIDPartTwo.value; + kNsigma = confTrkPIDnSigmaMax.value; } template void fillCollision(CollisionType col) { - MixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); + mixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); } @@ -194,68 +193,68 @@ struct femtoUniversePairTaskTrackTrack { { /// Histogramming same event - for (auto& part : groupPartsOne) { - if (part.p() > ConfCutTable->get("PartOne", "MaxP") || part.pt() > ConfCutTable->get("PartOne", "MaxPt")) { + for (const auto& part : groupPartsOne) { + if (part.p() > confCutTable->get("PartOne", "MaxP") || part.pt() > confCutTable->get("PartOne", "MaxPt")) { continue; } if (!isFullPIDSelected(part.pidcut(), part.p(), - ConfCutTable->get("PartOne", "PIDthr"), + confCutTable->get("PartOne", "PIDthr"), vPIDPartOne, - ConfNspecies, + confNspecies, kNsigma, - ConfCutTable->get("PartOne", "nSigmaTPC"), - ConfCutTable->get("PartOne", "nSigmaTPCTOF"))) { + confCutTable->get("PartOne", "nSigmaTPC"), + confCutTable->get("PartOne", "nSigmaTPCTOF"))) { continue; } trackHistoPartOne.fillQA(part); } - if (!ConfIsSame) { - for (auto& part : groupPartsTwo) { - if (part.p() > ConfCutTable->get("PartTwo", "MaxP") || part.pt() > ConfCutTable->get("PartTwo", "MaxPt")) { + if (!confIsSame) { + for (const auto& part : groupPartsTwo) { + if (part.p() > confCutTable->get("PartTwo", "MaxP") || part.pt() > confCutTable->get("PartTwo", "MaxPt")) { continue; } if (!isFullPIDSelected(part.pidcut(), part.p(), - ConfCutTable->get("PartTwo", "PIDthr"), + confCutTable->get("PartTwo", "PIDthr"), vPIDPartTwo, - ConfNspecies, + confNspecies, kNsigma, - ConfCutTable->get("PartTwo", "nSigmaTPC"), - ConfCutTable->get("PartTwo", "nSigmaTPCTOF"))) { + confCutTable->get("PartTwo", "nSigmaTPC"), + confCutTable->get("PartTwo", "nSigmaTPCTOF"))) { continue; } trackHistoPartTwo.fillQA(part); } } /// Now build the combinations - for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (p1.p() > ConfCutTable->get("PartOne", "MaxP") || p1.pt() > ConfCutTable->get("PartOne", "MaxPt") || p2.p() > ConfCutTable->get("PartTwo", "MaxP") || p2.pt() > ConfCutTable->get("PartTwo", "MaxPt")) { + for (const auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsOne, groupPartsTwo))) { + if (p1.p() > confCutTable->get("PartOne", "MaxP") || p1.pt() > confCutTable->get("PartOne", "MaxPt") || p2.p() > confCutTable->get("PartTwo", "MaxP") || p2.pt() > confCutTable->get("PartTwo", "MaxPt")) { continue; } if (!isFullPIDSelected(p1.pidcut(), p1.p(), - ConfCutTable->get("PartOne", "PIDthr"), + confCutTable->get("PartOne", "PIDthr"), vPIDPartOne, - ConfNspecies, + confNspecies, kNsigma, - ConfCutTable->get("PartOne", "nSigmaTPC"), - ConfCutTable->get("PartOne", "nSigmaTPCTOF")) || + confCutTable->get("PartOne", "nSigmaTPC"), + confCutTable->get("PartOne", "nSigmaTPCTOF")) || !isFullPIDSelected(p2.pidcut(), p2.p(), - ConfCutTable->get("PartTwo", "PIDthr"), + confCutTable->get("PartTwo", "PIDthr"), vPIDPartTwo, - ConfNspecies, + confNspecies, kNsigma, - ConfCutTable->get("PartTwo", "nSigmaTPC"), - ConfCutTable->get("PartTwo", "nSigmaTPCTOF"))) { + confCutTable->get("PartTwo", "nSigmaTPC"), + confCutTable->get("PartTwo", "nSigmaTPCTOF"))) { continue; } - if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (confIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -265,16 +264,16 @@ struct femtoUniversePairTaskTrackTrack { continue; } - sameEventFemtoCont.setPair(p1, p2, multCol, ConfUse3D); - sameEventAngularCont.setPair(p1, p2, multCol, ConfUse3D); + sameEventFemtoCont.setPair(p1, p2, multCol, confUse3D); + sameEventAngularCont.setPair(p1, p2, multCol, confUse3D); } } /// process function for to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(o2::aod::FDCollision& col, - o2::aod::FDParticles& parts) + void processSameEvent(const o2::aod::FDCollision& col, + const o2::aod::FDParticles& parts) { fillCollision(col); @@ -283,15 +282,15 @@ struct femtoUniversePairTaskTrackTrack { doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multNtr()); } - PROCESS_SWITCH(femtoUniversePairTaskTrackTrack, processSameEvent, "Enable processing same event", true); + PROCESS_SWITCH(FemtoUniversePairTaskTrackTrack, processSameEvent, "Enable processing same event", true); /// process function for to call doSameEvent with Monte Carlo /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(o2::aod::FDCollision& col, - soa::Join& parts, - o2::aod::FDMCParticles&) + void processSameEventMC(const o2::aod::FDCollision& col, + const soa::Join& parts, + const o2::aod::FDMCParticles&) { fillCollision(col); @@ -300,7 +299,7 @@ struct femtoUniversePairTaskTrackTrack { doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multNtr()); } - PROCESS_SWITCH(femtoUniversePairTaskTrackTrack, processSameEventMC, "Enable processing same event for Monte Carlo", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackTrack, processSameEventMC, "Enable processing same event for Monte Carlo", false); /// This function processes the mixed event /// \todo the trivial loops over the collisions and tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... @@ -316,50 +315,50 @@ struct femtoUniversePairTaskTrackTrack { void doMixedEvent(PartitionType groupPartsOne, PartitionType groupPartsTwo, PartType parts, float magFieldTesla, int multCol) { - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - if (p1.p() > ConfCutTable->get("PartOne", "MaxP") || p1.pt() > ConfCutTable->get("PartOne", "MaxPt") || p2.p() > ConfCutTable->get("PartTwo", "MaxP") || p2.pt() > ConfCutTable->get("PartTwo", "MaxPt")) { + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + if (p1.p() > confCutTable->get("PartOne", "MaxP") || p1.pt() > confCutTable->get("PartOne", "MaxPt") || p2.p() > confCutTable->get("PartTwo", "MaxP") || p2.pt() > confCutTable->get("PartTwo", "MaxPt")) { continue; } if (!isFullPIDSelected(p1.pidcut(), p1.p(), - ConfCutTable->get("PartOne", "PIDthr"), + confCutTable->get("PartOne", "PIDthr"), vPIDPartOne, - ConfNspecies, + confNspecies, kNsigma, - ConfCutTable->get("PartOne", "nSigmaTPC"), - ConfCutTable->get("PartOne", "nSigmaTPCTOF")) || + confCutTable->get("PartOne", "nSigmaTPC"), + confCutTable->get("PartOne", "nSigmaTPCTOF")) || !isFullPIDSelected(p2.pidcut(), p2.p(), - ConfCutTable->get("PartTwo", "PIDthr"), + confCutTable->get("PartTwo", "PIDthr"), vPIDPartTwo, - ConfNspecies, + confNspecies, kNsigma, - ConfCutTable->get("PartTwo", "nSigmaTPC"), - ConfCutTable->get("PartTwo", "nSigmaTPCTOF"))) { + confCutTable->get("PartTwo", "nSigmaTPC"), + confCutTable->get("PartTwo", "nSigmaTPCTOF"))) { continue; } - if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { + if (confIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::mixed)) { continue; } } - mixedEventFemtoCont.setPair(p1, p2, multCol, ConfUse3D); - mixedEventAngularCont.setPair(p1, p2, multCol, ConfUse3D); + mixedEventFemtoCont.setPair(p1, p2, multCol, confUse3D); + mixedEventAngularCont.setPair(p1, p2, multCol, confUse3D); } } /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(o2::aod::FDCollisions& cols, - o2::aod::FDParticles& parts) + void processMixedEvent(const o2::aod::FDCollisions& cols, + const o2::aod::FDParticles& parts) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { const int multiplicityCol = collision1.multNtr(); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); @@ -376,20 +375,20 @@ struct femtoUniversePairTaskTrackTrack { doMixedEvent(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol); } } - PROCESS_SWITCH(femtoUniversePairTaskTrackTrack, processMixedEvent, "Enable processing mixed events", true); + PROCESS_SWITCH(FemtoUniversePairTaskTrackTrack, processMixedEvent, "Enable processing mixed events", true); /// brief process function for to call doMixedEvent with Monte Carlo /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(o2::aod::FDCollisions& cols, - soa::Join& parts, - o2::aod::FDMCParticles&) + void processMixedEventMC(const o2::aod::FDCollisions& cols, + const soa::Join& parts, + const o2::aod::FDMCParticles&) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { const int multiplicityCol = collision1.multNtr(); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); @@ -406,13 +405,13 @@ struct femtoUniversePairTaskTrackTrack { doMixedEvent(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol); } } - PROCESS_SWITCH(femtoUniversePairTaskTrackTrack, processMixedEventMC, "Enable processing mixed events MC", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackTrack, processMixedEventMC, "Enable processing mixed events MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; return workflow; } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx index cdccc3bd327..8e10d1269a0 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx @@ -34,13 +34,13 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverse3DContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairWithCentMultKt.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; @@ -176,27 +176,27 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { Configurable cfgProcessKtBins{"cfgProcessKtBins", true, "Process kstar histograms in kT bins (if cfgProcessMultBins is set false, this will not be processed regardless this Configurable state)"}; Configurable cfgProcessKtMt3DCF{"cfgProcessKtMt3DCF", false, "Process 3D histograms in kT and Mult bins"}; - FemtoUniverse3DContainer sameEventCont; - FemtoUniverse3DContainer mixedEventCont; + FemtoUniverse3DContainer sameEventCont; + FemtoUniverse3DContainer mixedEventCont; - FemtoUniverse3DContainer sameEventContPP; - FemtoUniverse3DContainer mixedEventContPP; + FemtoUniverse3DContainer sameEventContPP; + FemtoUniverse3DContainer mixedEventContPP; - FemtoUniverse3DContainer sameEventContMM; - FemtoUniverse3DContainer mixedEventContMM; + FemtoUniverse3DContainer sameEventContMM; + FemtoUniverse3DContainer mixedEventContMM; FemtoUniversePairCleaner pairCleaner; FemtoUniverseDetaDphiStar pairCloseRejection; FemtoUniverseTrackSelection trackCuts; - PairWithCentMultKt sameEventMultCont; - PairWithCentMultKt mixedEventMultCont; + FemtoUniversePairWithCentMultKt sameEventMultCont; + FemtoUniversePairWithCentMultKt mixedEventMultCont; - PairWithCentMultKt sameEventMultContPP; - PairWithCentMultKt mixedEventMultContPP; + FemtoUniversePairWithCentMultKt sameEventMultContPP; + FemtoUniversePairWithCentMultKt mixedEventMultContPP; - PairWithCentMultKt sameEventMultContMM; - PairWithCentMultKt mixedEventMultContMM; + FemtoUniversePairWithCentMultKt sameEventMultContMM; + FemtoUniversePairWithCentMultKt mixedEventMultContMM; float mass1 = -1; float mass2 = -1; @@ -470,7 +470,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -486,7 +486,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { sameEventCont.setPair(p1, p2, multCol, twotracksconfigs.ConfUse3D, ConfIsIden); } else { std::vector k3d = FemtoUniverseMath::newpairfunc(p1, mass1, p2, mass2, ConfIsIden); - sameEventMultCont.fill_3D(k3d[1], k3d[2], k3d[3], multCol, kT); + sameEventMultCont.fill3D(k3d[1], k3d[2], k3d[3], multCol, kT); } } } else { @@ -503,7 +503,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -524,14 +524,14 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { sameEventContPP.setPair(p1, p2, multCol, twotracksconfigs.ConfUse3D, ConfIsIden); } else { k3d = FemtoUniverseMath::newpairfunc(p1, mass1, p2, mass2, ConfIsIden); - sameEventMultContPP.fill_3D(k3d[1], k3d[2], k3d[3], multCol, kT); + sameEventMultContPP.fill3D(k3d[1], k3d[2], k3d[3], multCol, kT); } } else { if (!cfgProcessMultBins) { sameEventContPP.setPair(p2, p1, multCol, twotracksconfigs.ConfUse3D, ConfIsIden); } else { k3d = FemtoUniverseMath::newpairfunc(p2, mass2, p1, mass1, ConfIsIden); - sameEventMultContPP.fill_3D(k3d[1], k3d[2], k3d[3], multCol, kT); + sameEventMultContPP.fill3D(k3d[1], k3d[2], k3d[3], multCol, kT); } } break; @@ -547,14 +547,14 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { sameEventContMM.setPair(p1, p2, multCol, twotracksconfigs.ConfUse3D, ConfIsIden); } else { k3d = FemtoUniverseMath::newpairfunc(p1, mass1, p2, mass2, ConfIsIden); - sameEventMultContMM.fill_3D(k3d[1], k3d[2], k3d[3], multCol, kT); + sameEventMultContMM.fill3D(k3d[1], k3d[2], k3d[3], multCol, kT); } } else { if (!cfgProcessMultBins) { sameEventContMM.setPair(p2, p1, multCol, twotracksconfigs.ConfUse3D, ConfIsIden); } else { k3d = FemtoUniverseMath::newpairfunc(p2, mass2, p1, mass1, ConfIsIden); - sameEventMultContMM.fill_3D(k3d[1], k3d[2], k3d[3], multCol, kT); + sameEventMultContMM.fill3D(k3d[1], k3d[2], k3d[3], multCol, kT); } } break; @@ -649,7 +649,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::mixed)) { continue; } } @@ -666,14 +666,14 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { mixedEventCont.setPair(p1, p2, multCol, twotracksconfigs.ConfUse3D, ConfIsIden); } else { std::vector k3d = FemtoUniverseMath::newpairfunc(p1, mass1, p2, mass2, ConfIsIden); - mixedEventMultCont.fill_3D(k3d[1], k3d[2], k3d[3], multCol, kT); + mixedEventMultCont.fill3D(k3d[1], k3d[2], k3d[3], multCol, kT); } } else { if (!cfgProcessMultBins) { mixedEventCont.setPair(p2, p1, multCol, twotracksconfigs.ConfUse3D, ConfIsIden); } else { std::vector k3d = FemtoUniverseMath::newpairfunc(p2, mass2, p1, mass1, ConfIsIden); - mixedEventMultCont.fill_3D(k3d[1], k3d[2], k3d[3], multCol, kT); + mixedEventMultCont.fill3D(k3d[1], k3d[2], k3d[3], multCol, kT); } } break; @@ -686,14 +686,14 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { mixedEventContPP.setPair(p1, p2, multCol, twotracksconfigs.ConfUse3D, ConfIsIden); } else { std::vector k3d = FemtoUniverseMath::newpairfunc(p1, mass1, p2, mass2, ConfIsIden); - mixedEventMultContPP.fill_3D(k3d[1], k3d[2], k3d[3], multCol, kT); + mixedEventMultContPP.fill3D(k3d[1], k3d[2], k3d[3], multCol, kT); } } else { if (!cfgProcessMultBins) { mixedEventContPP.setPair(p2, p1, multCol, twotracksconfigs.ConfUse3D, ConfIsIden); } else { std::vector k3d = FemtoUniverseMath::newpairfunc(p2, mass2, p1, mass1, ConfIsIden); - mixedEventMultContPP.fill_3D(k3d[1], k3d[2], k3d[3], multCol, kT); + mixedEventMultContPP.fill3D(k3d[1], k3d[2], k3d[3], multCol, kT); } } break; @@ -707,14 +707,14 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended { mixedEventContMM.setPair(p1, p2, multCol, twotracksconfigs.ConfUse3D, ConfIsIden); } else { std::vector k3d = FemtoUniverseMath::newpairfunc(p1, mass1, p2, mass2, ConfIsIden); - mixedEventMultContMM.fill_3D(k3d[1], k3d[2], k3d[3], multCol, kT); + mixedEventMultContMM.fill3D(k3d[1], k3d[2], k3d[3], multCol, kT); } } else { if (!cfgProcessMultBins) { mixedEventContMM.setPair(p2, p1, multCol, twotracksconfigs.ConfUse3D, ConfIsIden); } else { std::vector k3d = FemtoUniverseMath::newpairfunc(p2, mass2, p1, mass1, ConfIsIden); - mixedEventMultContMM.fill_3D(k3d[1], k3d[2], k3d[3], multCol, kT); + mixedEventMultContMM.fill3D(k3d[1], k3d[2], k3d[3], multCol, kT); } } break; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx index 985c7466ce3..324d48d5bce 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackExtended.cxx @@ -24,7 +24,6 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/StepTHn.h" #include "Framework/O2DatabasePDGPlugin.h" -#include "TDatabasePDG.h" #include "ReconstructionDataFormats/PID.h" #include "Common/DataModel/PIDResponse.h" @@ -34,48 +33,48 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; namespace { -static constexpr int nPart = 2; -static constexpr int nCuts = 5; +static constexpr int NPart = 2; +static constexpr int NCuts = 5; static const std::vector partNames{"PartOne", "PartTwo"}; static const std::vector cutNames{"MaxPt", "PIDthr", "nSigmaTPC", "nSigmaTPCTOF", "MaxP"}; -static const float cutsTable[nPart][nCuts]{ +static const float cutsTable[NPart][NCuts]{ {4.05f, 1.f, 3.f, 3.f, 100.f}, {4.05f, 1.f, 3.f, 3.f, 100.f}}; } // namespace -struct femtoUniversePairTaskTrackTrackExtended { +struct FemtoUniversePairTaskTrackTrackExtended { /// Particle selection part /// Table for both particles struct : o2::framework::ConfigurableGroup { - Configurable ConfNsigmaCombined{"ConfNsigmaCombined", 3.0f, "TPC and TOF Pion Sigma (combined) for momentum > ConfTOFPtMin"}; - Configurable ConfNsigmaTPC{"ConfNsigmaTPC", 3.0f, "TPC Pion Sigma for momentum < ConfTOFPtMin"}; - Configurable ConfTOFPtMin{"ConfTOFPtMin", 0.5f, "Min. Pt for which TOF is required for PID."}; - Configurable ConfEtaMax{"ConfEtaMax", 0.8f, "Higher limit for |Eta| (the same for both particles)"}; - - Configurable> ConfCutTable{"ConfCutTable", {cutsTable[0], nPart, nCuts, partNames, cutNames}, "Particle selections"}; - Configurable ConfNspecies{"ConfNspecies", 2, "Number of particle spieces with PID info"}; - Configurable ConfIsMC{"ConfIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; - Configurable> ConfTrkPIDnSigmaMax{"ConfTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; - Configurable ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; + Configurable confNsigmaCombined{"confNsigmaCombined", 3.0f, "TPC and TOF Pion Sigma (combined) for momentum > confTOFPtMin"}; + Configurable confNsigmaTPC{"confNsigmaTPC", 3.0f, "TPC Pion Sigma for momentum < confTOFPtMin"}; + Configurable confTOFPtMin{"confTOFPtMin", 0.5f, "Min. Pt for which TOF is required for PID."}; + Configurable confEtaMax{"confEtaMax", 0.8f, "Higher limit for |Eta| (the same for both particles)"}; + + Configurable> confCutTable{"confCutTable", {cutsTable[0], NPart, NCuts, partNames, cutNames}, "Particle selections"}; + Configurable confNspecies{"confNspecies", 2, "Number of particle spieces with PID info"}; + Configurable confIsMC{"confIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; + Configurable> confTrkPIDnSigmaMax{"confTrkPIDnSigmaMax", std::vector{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"}; + Configurable confUse3D{"confUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"}; } twotracksconfigs; using FemtoFullParticles = soa::Join; // Filters for selecting particles (both p1 and p2) Filter trackCutFilter = requireGlobalTrackInFilter(); // Global track cuts - Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.ConfEtaMax); // example filtering on configurable + Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.confEtaMax); // example filtering on configurable using FilteredFemtoFullParticles = soa::Filtered; // using FilteredFemtoFullParticles = FemtoFullParticles; //if no filtering is applied uncomment this option @@ -84,38 +83,37 @@ struct femtoUniversePairTaskTrackTrackExtended { /// Particle 1 struct : o2::framework::ConfigurableGroup { - Configurable ConfPDGCodePartOne{"ConfPDGCodePartOne", 2212, "Particle 1 - PDG code"}; - Configurable ConfIsTrackOneIdentified{"ConfIsTrackOneIdentified", true, "Enable PID for the track one"}; - // Configurable ConfCutPartOne{"ConfCutPartOne", 5542474, "Particle 1 - Selection bit from cutCulator"}; - Configurable ConfPIDPartOne{"ConfPIDPartOne", 2, "Particle 1 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector>int>> - Configurable ConfPtLowPart1{"ConfPtLowPart1", 0.5, "Lower limit for Pt for the first particle"}; - Configurable ConfPtHighPart1{"ConfPtHighPart1", 1.5, "Higher limit for Pt for the first particle"}; - Configurable ConfChargePart1{"ConfChargePart1", 1, "Particle 1 sign"}; + Configurable confPDGCodePartOne{"confPDGCodePartOne", 2212, "Particle 1 - PDG code"}; + Configurable confIsTrackOneIdentified{"confIsTrackOneIdentified", true, "Enable PID for the track one"}; + // Configurable confCutPartOne{"confCutPartOne", 5542474, "Particle 1 - Selection bit from cutCulator"}; + Configurable confPIDPartOne{"confPIDPartOne", 2, "Particle 1 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector>int>> + Configurable confPtLowPart1{"confPtLowPart1", 0.5, "Lower limit for Pt for the first particle"}; + Configurable confPtHighPart1{"confPtHighPart1", 1.5, "Higher limit for Pt for the first particle"}; + Configurable confChargePart1{"confChargePart1", 1, "Particle 1 sign"}; } trackonefilter; /// Partition for particle 1 - Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackonefilter.ConfChargePart1 && aod::femtouniverseparticle::pt < trackonefilter.ConfPtHighPart1 && aod::femtouniverseparticle::pt > trackonefilter.ConfPtLowPart1; - Partition> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackonefilter.ConfChargePart1 && aod::femtouniverseparticle::pt < trackonefilter.ConfPtHighPart1 && aod::femtouniverseparticle::pt > trackonefilter.ConfPtLowPart1; - // && ((aod::femtouniverseparticle::cut & ConfCutPartOne) == ConfCutPartOne); + Partition partsOne = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackonefilter.confChargePart1 && aod::femtouniverseparticle::pt < trackonefilter.confPtHighPart1 && aod::femtouniverseparticle::pt > trackonefilter.confPtLowPart1; + Partition> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && aod::femtouniverseparticle::sign == trackonefilter.confChargePart1 && aod::femtouniverseparticle::pt < trackonefilter.confPtHighPart1 && aod::femtouniverseparticle::pt > trackonefilter.confPtLowPart1; + // && ((aod::femtouniverseparticle::cut & confCutPartOne) == confCutPartOne); /// Histogramming for particle 1 FemtoUniverseParticleHisto trackHistoPartOne; /// Particle 2 - Configurable ConfIsSame{"ConfIsSame", false, "Pairs of the same particle"}; + Configurable confIsSame{"confIsSame", false, "Pairs of the same particle"}; struct : o2::framework::ConfigurableGroup { - Configurable ConfPDGCodePartTwo{"ConfPDGCodePartTwo", 2212, "Particle 2 - PDG code"}; - Configurable ConfIsTrackTwoIdentified{"ConfIsTrackTwoIdentified", true, "Enable PID for the track two"}; - // Configurable ConfCutPartTwo{"ConfCutPartTwo", 5542474, "Particle 2 - Selection bit"}; - Configurable ConfPIDPartTwo{"ConfPIDPartTwo", 2, "Particle 2 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> - Configurable ConfPtLowPart2{"ConfPtLowPart2", 0.5, "Lower limit for Pt for the second particle"}; - Configurable ConfPtHighPart2{"ConfPtHighPart2", 1.5, "Higher limit for Pt for the second particle"}; - Configurable ConfChargePart2{"ConfChargePart2", -1, "Particle 2 sign"}; + Configurable confPDGCodePartTwo{"confPDGCodePartTwo", 2212, "Particle 2 - PDG code"}; + Configurable confIsTrackTwoIdentified{"confIsTrackTwoIdentified", true, "Enable PID for the track two"}; + Configurable confPIDPartTwo{"confPIDPartTwo", 2, "Particle 2 - Read from cutCulator"}; // we also need the possibility to specify whether the bit is true/false ->std>>vector> + Configurable confPtLowPart2{"confPtLowPart2", 0.5, "Lower limit for Pt for the second particle"}; + Configurable confPtHighPart2{"confPtHighPart2", 1.5, "Higher limit for Pt for the second particle"}; + Configurable confChargePart2{"confChargePart2", -1, "Particle 2 sign"}; } tracktwofilter; /// Partition for particle 2 - Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == tracktwofilter.ConfChargePart2) && aod::femtouniverseparticle::pt < tracktwofilter.ConfPtHighPart2 && aod::femtouniverseparticle::pt > tracktwofilter.ConfPtLowPart2; + Partition partsTwo = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == tracktwofilter.confChargePart2) && aod::femtouniverseparticle::pt < tracktwofilter.confPtHighPart2 && aod::femtouniverseparticle::pt > tracktwofilter.confPtLowPart2; - Partition> partsTwoMC = aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack) && (aod::femtouniverseparticle::sign == tracktwofilter.ConfChargePart2) && aod::femtouniverseparticle::pt < tracktwofilter.ConfPtHighPart2 && aod::femtouniverseparticle::pt > tracktwofilter.ConfPtLowPart2; + Partition> partsTwoMC = aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack) && (aod::femtouniverseparticle::sign == tracktwofilter.confChargePart2) && aod::femtouniverseparticle::pt < tracktwofilter.confPtHighPart2 && aod::femtouniverseparticle::pt > tracktwofilter.confPtLowPart2; /// Histogramming for particle 2 FemtoUniverseParticleHisto trackHistoPartTwo; @@ -128,64 +126,64 @@ struct femtoUniversePairTaskTrackTrackExtended { std::vector kNsigma; /// particle part - ConfigurableAxis ConfTempFitVarBins{"ConfDTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfTempFitVarpTBins{"ConfTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; + ConfigurableAxis confTempFitVarBins{"confTempFitVarBins", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + ConfigurableAxis confTempFitVarpTBins{"confTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; /// Correlation part - ConfigurableAxis ConfMultBins{"ConfMultBins", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; // \todo to be obtained from the hash task - // ConfigurableAxis ConfMultBins{"CfgMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - - ConfigurableAxis ConfmTBins3D{"ConfmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - ConfigurableAxis ConfmultBins3D{"ConfmultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; - - ColumnBinningPolicy colBinning{{ConfVtxBins, ConfMultBins}, true}; - - ConfigurableAxis ConfkstarBins{"ConfkstarBins", {1500, 0., 6.}, "binning kstar"}; - ConfigurableAxis ConfkTBins{"ConfkTBins", {150, 0., 9.}, "binning kT"}; - ConfigurableAxis ConfmTBins{"ConfmTBins", {225, 0., 7.5}, "binning mT"}; - Configurable ConfNEventsMix{"ConfNEventsMix", 5, "Number of events for mixing"}; - Configurable ConfIsCPR{"ConfIsCPR", true, "Close Pair Rejection"}; - Configurable ConfCPRPlotPerRadii{"ConfCPRPlotPerRadii", false, "Plot CPR per radii"}; - Configurable ConfCPRdeltaPhiCutMax{"ConfCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaPhiCutMin{"ConfCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaEtaCutMax{"ConfCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; - Configurable ConfCPRdeltaEtaCutMin{"ConfCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; - Configurable ConfCPRChosenRadii{"ConfCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; - Configurable ConfPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"}; - Configurable ConfEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"}; - - FemtoUniverseContainer sameEventCont; - FemtoUniverseContainer mixedEventCont; + ConfigurableAxis confMultBins{"confMultBins", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; // \todo to be obtained from the hash task + // ConfigurableAxis confMultBins{"confMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"}; + ConfigurableAxis confVtxBins{"confVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + + ConfigurableAxis confmTBins3D{"confmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + ConfigurableAxis confMultBins3D{"confMultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity Binning for the 3Dimensional plot: k* vs multiplicity vs mT (set <> to true in order to use)"}; + + ColumnBinningPolicy colBinning{{confVtxBins, confMultBins}, true}; + + ConfigurableAxis confkstarBins{"confkstarBins", {1500, 0., 6.}, "binning kstar"}; + ConfigurableAxis confkTBins{"confkTBins", {150, 0., 9.}, "binning kT"}; + ConfigurableAxis confmTBins{"confmTBins", {225, 0., 7.5}, "binning mT"}; + Configurable confNEventsMix{"confNEventsMix", 5, "Number of events for mixing"}; + Configurable confIsCPR{"confIsCPR", true, "Close Pair Rejection"}; + Configurable confCPRPlotPerRadii{"confCPRPlotPerRadii", false, "Plot CPR per radii"}; + Configurable confCPRdeltaPhiCutMax{"confCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; + Configurable confCPRdeltaPhiCutMin{"confCPRdeltaPhiCutMin", 0.0, "Delta Phi min cut for Close Pair Rejection"}; + Configurable confCPRdeltaEtaCutMax{"confCPRdeltaEtaCutMax", 0.0, "Delta Eta max cut for Close Pair Rejection"}; + Configurable confCPRdeltaEtaCutMin{"confCPRdeltaEtaCutMin", 0.0, "Delta Eta min cut for Close Pair Rejection"}; + Configurable confCPRChosenRadii{"confCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; + Configurable confPhiBins{"confPhiBins", 29, "Number of phi bins in deta dphi"}; + Configurable confEtaBins{"confEtaBins", 29, "Number of eta bins in deta dphi"}; + + FemtoUniverseContainer sameEventCont; + FemtoUniverseContainer mixedEventCont; FemtoUniversePairCleaner pairCleaner; FemtoUniverseDetaDphiStar pairCloseRejection; FemtoUniverseTrackSelection trackCuts; /// Histogram output HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry MixQaRegistry{"MixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry mixQaRegistry{"mixQaRegistry", {}, OutputObjHandlingPolicy::AnalysisObject}; /// @brief Counter for particle swapping int fNeventsProcessed = 0; // PID for protons - bool IsProtonNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr) // previous version from: https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx + bool isProtonNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr) // previous version from: https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx { //|nsigma_TPC| < 3 for p < 0.5 GeV/c //|nsigma_combined| < 3 for p > 0.5 // using configurables: - // ConfTOFPtMin - momentum value when we start using TOF; set to 1000 if TOF not needed - // ConfNsigmaTPC -> TPC Sigma for momentum < ConfTOFPtMin - // ConfNsigmaCombined -> TPC and TOF Sigma (combined) for momentum > ConfTOFPtMin + // confTOFPtMin - momentum value when we start using TOF; set to 1000 if TOF not needed + // confNsigmaTPC -> TPC Sigma for momentum < confTOFPtMin + // confNsigmaCombined -> TPC and TOF Sigma (combined) for momentum > confTOFPtMin - if (mom < twotracksconfigs.ConfTOFPtMin) { - if (TMath::Abs(nsigmaTPCPr) < twotracksconfigs.ConfNsigmaTPC) { + if (mom < twotracksconfigs.confTOFPtMin) { + if (std::abs(nsigmaTPCPr) < twotracksconfigs.confNsigmaTPC) { return true; } else { return false; } } else { - if (TMath::Hypot(nsigmaTOFPr, nsigmaTPCPr) < twotracksconfigs.ConfNsigmaCombined) { + if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < twotracksconfigs.confNsigmaCombined) { return true; } else { return false; @@ -194,24 +192,24 @@ struct femtoUniversePairTaskTrackTrackExtended { return false; } - bool IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK) + bool isKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK) { //|nsigma_TPC| < 3 for p < 0.5 GeV/c //|nsigma_combined| < 3 for p > 0.5 // using configurables: - // ConfTOFPtMin - momentum value when we start using TOF; set to 1000 if TOF not needed - // ConfNsigmaTPC -> TPC Sigma for momentum < ConfTOFPtMin - // ConfNsigmaCombined -> TPC and TOF Sigma (combined) for momentum > ConfTOFPtMin + // confTOFPtMin - momentum value when we start using TOF; set to 1000 if TOF not needed + // confNsigmaTPC -> TPC Sigma for momentum < confTOFPtMin + // confNsigmaCombined -> TPC and TOF Sigma (combined) for momentum > confTOFPtMin if (true) { - if (mom < twotracksconfigs.ConfTOFPtMin) { - if (TMath::Abs(nsigmaTPCK) < twotracksconfigs.ConfNsigmaTPC) { + if (mom < twotracksconfigs.confTOFPtMin) { + if (std::abs(nsigmaTPCK) < twotracksconfigs.confNsigmaTPC) { return true; } else { return false; } } else { - if (TMath::Hypot(nsigmaTOFK, nsigmaTPCK) < twotracksconfigs.ConfNsigmaCombined) { + if (std::hypot(nsigmaTOFK, nsigmaTPCK) < twotracksconfigs.confNsigmaCombined) { return true; } else { return false; @@ -221,24 +219,24 @@ struct femtoUniversePairTaskTrackTrackExtended { return false; } - bool IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi) + bool isPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi) { //|nsigma_TPC| < 3 for p < 0.5 GeV/c //|nsigma_combined| < 3 for p > 0.5 // using configurables: - // ConfTOFPtMin - momentum value when we start using TOF; set to 1000 if TOF not needed - // ConfNsigmaTPC -> TPC Sigma for momentum < ConfTOFPtMin - // ConfNsigmaCombined -> TPC and TOF Sigma (combined) for momentum > ConfTOFPtMin + // confTOFPtMin - momentum value when we start using TOF; set to 1000 if TOF not needed + // confNsigmaTPC -> TPC Sigma for momentum < confTOFPtMin + // confNsigmaCombined -> TPC and TOF Sigma (combined) for momentum > confTOFPtMin if (true) { - if (mom < twotracksconfigs.ConfTOFPtMin) { - if (TMath::Abs(nsigmaTPCPi) < twotracksconfigs.ConfNsigmaTPC) { + if (mom < twotracksconfigs.confTOFPtMin) { + if (std::abs(nsigmaTPCPi) < twotracksconfigs.confNsigmaTPC) { return true; } else { return false; } } else { - if (TMath::Hypot(nsigmaTOFPi, nsigmaTPCPi) < twotracksconfigs.ConfNsigmaCombined) { + if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < twotracksconfigs.confNsigmaCombined) { return true; } else { return false; @@ -248,45 +246,45 @@ struct femtoUniversePairTaskTrackTrackExtended { return false; } - bool IsParticleNSigma(int8_t particle_number, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) + bool isParticleNSigma(int8_t particle_number, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK) { if (particle_number == 1) { - switch (trackonefilter.ConfPDGCodePartOne) { + switch (trackonefilter.confPDGCodePartOne) { case 2212: // Proton case -2212: // anty Proton - return IsProtonNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); + return isProtonNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); break; case 211: // Pion case -211: // Pion- case 111: // Pion 0 - return IsPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); + return isPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); break; case 321: // Kaon+ case -321: // Kaon- case 130: // Kaon 0 LONG case 310: // Kaon 0 SHORT - return IsKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); + return isKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); break; default: return false; } return false; } else if (particle_number == 2) { - switch (tracktwofilter.ConfPDGCodePartTwo) { + switch (tracktwofilter.confPDGCodePartTwo) { case 2212: // Proton case -2212: // anty Proton - return IsProtonNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); + return isProtonNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); break; case 211: // Pion case -211: // Pion- case 111: // Pion 0 - return IsPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); + return isPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); break; case 321: // Kaon+ case -321: // Kaon- case 130: // Kaon 0 LONG case 310: // Kaon 0 SHORT - return IsKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); + return isKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); break; default: return false; @@ -301,32 +299,32 @@ struct femtoUniversePairTaskTrackTrackExtended { void init(InitContext&) { eventHisto.init(&qaRegistry); - trackHistoPartOne.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarBins, twotracksconfigs.ConfIsMC, trackonefilter.ConfPDGCodePartOne, true); // last true = isDebug - if (!ConfIsSame) { - trackHistoPartTwo.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarBins, twotracksconfigs.ConfIsMC, tracktwofilter.ConfPDGCodePartTwo, true); // last true = isDebug + trackHistoPartOne.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarBins, twotracksconfigs.confIsMC, trackonefilter.confPDGCodePartOne, true); // last true = isDebug + if (!confIsSame) { + trackHistoPartTwo.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarBins, twotracksconfigs.confIsMC, tracktwofilter.confPDGCodePartTwo, true); // last true = isDebug } - MixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); - MixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + mixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); + mixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); - sameEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfEtaBins, ConfPhiBins, twotracksconfigs.ConfIsMC, twotracksconfigs.ConfUse3D); - mixedEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfEtaBins, ConfPhiBins, twotracksconfigs.ConfIsMC, twotracksconfigs.ConfUse3D); - sameEventCont.setPDGCodes(trackonefilter.ConfPDGCodePartOne, tracktwofilter.ConfPDGCodePartTwo); - mixedEventCont.setPDGCodes(trackonefilter.ConfPDGCodePartOne, tracktwofilter.ConfPDGCodePartTwo); + sameEventCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confMultBins3D, confmTBins3D, confEtaBins, confPhiBins, twotracksconfigs.confIsMC, twotracksconfigs.confUse3D); + mixedEventCont.init(&resultRegistry, confkstarBins, confMultBins, confkTBins, confmTBins, confMultBins3D, confmTBins3D, confEtaBins, confPhiBins, twotracksconfigs.confIsMC, twotracksconfigs.confUse3D); + sameEventCont.setPDGCodes(trackonefilter.confPDGCodePartOne, tracktwofilter.confPDGCodePartTwo); + mixedEventCont.setPDGCodes(trackonefilter.confPDGCodePartOne, tracktwofilter.confPDGCodePartTwo); pairCleaner.init(&qaRegistry); - if (ConfIsCPR.value) { - pairCloseRejection.init(&resultRegistry, &qaRegistry, ConfCPRdeltaPhiCutMin.value, ConfCPRdeltaPhiCutMax.value, ConfCPRdeltaEtaCutMin.value, ConfCPRdeltaEtaCutMax.value, ConfCPRChosenRadii.value, ConfCPRPlotPerRadii.value); + if (confIsCPR.value) { + pairCloseRejection.init(&resultRegistry, &qaRegistry, confCPRdeltaPhiCutMin.value, confCPRdeltaPhiCutMax.value, confCPRdeltaEtaCutMin.value, confCPRdeltaEtaCutMax.value, confCPRChosenRadii.value, confCPRPlotPerRadii.value); } - vPIDPartOne = trackonefilter.ConfPIDPartOne.value; - vPIDPartTwo = tracktwofilter.ConfPIDPartTwo.value; - kNsigma = twotracksconfigs.ConfTrkPIDnSigmaMax.value; + vPIDPartOne = trackonefilter.confPIDPartOne.value; + vPIDPartTwo = tracktwofilter.confPIDPartTwo.value; + kNsigma = twotracksconfigs.confTrkPIDnSigmaMax.value; } template void fillCollision(CollisionType col) { - MixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); + mixQaRegistry.fill(HIST("MixingQA/hSECollisionBins"), colBinning.getBin({col.posZ(), col.multNtr()})); eventHisto.fillQA(col); } @@ -348,22 +346,22 @@ struct femtoUniversePairTaskTrackTrackExtended { fNeventsProcessed++; /// Histogramming same event - for (auto& part : groupPartsOne) { - // if (part.p() > twotracksconfigs.ConfCutTable->get("PartOne", "MaxP") || part.pt() > twotracksconfigs.ConfCutTable->get("PartOne", "MaxPt")) { + for (const auto& part : groupPartsOne) { + // if (part.p() > twotracksconfigs.confCutTable->get("PartOne", "MaxP") || part.pt() > twotracksconfigs.confCutTable->get("PartOne", "MaxPt")) { // continue; // } // if (!isFullPIDSelected(part.pidcut(), // part.p(), - // twotracksconfigs.ConfCutTable->get("PartOne", "PIDthr"), + // twotracksconfigs.confCutTable->get("PartOne", "PIDthr"), // vPIDPartOne, - // twotracksconfigs.ConfNspecies, + // twotracksconfigs.confNspecies, // kNsigma, - // twotracksconfigs.ConfCutTable->get("PartOne", "nSigmaTPC"), - // twotracksconfigs.ConfCutTable->get("PartOne", "nSigmaTPCTOF"))) { + // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPC"), + // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPCTOF"))) { // continue; // } - if (trackonefilter.ConfIsTrackOneIdentified) { - if (!IsParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { + if (trackonefilter.confIsTrackOneIdentified) { + if (!isParticleNSigma((int8_t)1, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { continue; } } @@ -371,23 +369,23 @@ struct femtoUniversePairTaskTrackTrackExtended { trackHistoPartOne.fillQA(part); } - if (!ConfIsSame) { - for (auto& part : groupPartsTwo) { - // if (part.p() > twotracksconfigs.ConfCutTable->get("PartTwo", "MaxP") || part.pt() > twotracksconfigs.ConfCutTable->get("PartTwo", "MaxPt")) { + if (!confIsSame) { + for (const auto& part : groupPartsTwo) { + // if (part.p() > twotracksconfigs.confCutTable->get("PartTwo", "MaxP") || part.pt() > twotracksconfigs.confCutTable->get("PartTwo", "MaxPt")) { // continue; // } // if (!isFullPIDSelected(part.pidcut(), // part.p(), - // twotracksconfigs.ConfCutTable->get("PartTwo", "PIDthr"), + // twotracksconfigs.confCutTable->get("PartTwo", "PIDthr"), // vPIDPartTwo, - // twotracksconfigs.ConfNspecies, + // twotracksconfigs.confNspecies, // kNsigma, - // twotracksconfigs.ConfCutTable->get("PartTwo", "nSigmaTPC"), - // twotracksconfigs.ConfCutTable->get("PartTwo", "nSigmaTPCTOF"))) { + // twotracksconfigs.confCutTable->get("PartTwo", "nSigmaTPC"), + // twotracksconfigs.confCutTable->get("PartTwo", "nSigmaTPCTOF"))) { // continue; // } - if (tracktwofilter.ConfIsTrackTwoIdentified) { - if (!IsParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { + if (tracktwofilter.confIsTrackTwoIdentified) { + if (!isParticleNSigma((int8_t)2, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon))) { continue; } } @@ -395,43 +393,43 @@ struct femtoUniversePairTaskTrackTrackExtended { } /// Now build the combinations for non-identical particle pairs - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - // if (p1.p() > twotracksconfigs.ConfCutTable->get("PartOne", "MaxP") || p1.pt() > twotracksconfigs.ConfCutTable->get("PartOne", "MaxPt") || p2.p() > twotracksconfigs.ConfCutTable->get("PartTwo", "MaxP") || p2.pt() > twotracksconfigs.ConfCutTable->get("PartTwo", "MaxPt")) { + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + // if (p1.p() > twotracksconfigs.confCutTable->get("PartOne", "MaxP") || p1.pt() > twotracksconfigs.confCutTable->get("PartOne", "MaxPt") || p2.p() > twotracksconfigs.confCutTable->get("PartTwo", "MaxP") || p2.pt() > twotracksconfigs.confCutTable->get("PartTwo", "MaxPt")) { // continue; // } // if (!isFullPIDSelected(p1.pidcut(), // p1.p(), - // twotracksconfigs.ConfCutTable->get("PartOne", "PIDthr"), + // twotracksconfigs.confCutTable->get("PartOne", "PIDthr"), // vPIDPartOne, - // twotracksconfigs.ConfNspecies, + // twotracksconfigs.confNspecies, // kNsigma, - // twotracksconfigs.ConfCutTable->get("PartOne", "nSigmaTPC"), - // twotracksconfigs.ConfCutTable->get("PartOne", "nSigmaTPCTOF")) || + // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPC"), + // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPCTOF")) || // !isFullPIDSelected(p2.pidcut(), // p2.p(), - // twotracksconfigs.ConfCutTable->get("PartTwo", "PIDthr"), + // twotracksconfigs.confCutTable->get("PartTwo", "PIDthr"), // vPIDPartTwo, - // twotracksconfigs.ConfNspecies, + // twotracksconfigs.confNspecies, // kNsigma, - // twotracksconfigs.ConfCutTable->get("PartTwo", "nSigmaTPC"), - // twotracksconfigs.ConfCutTable->get("PartTwo", "nSigmaTPCTOF"))) { + // twotracksconfigs.confCutTable->get("PartTwo", "nSigmaTPC"), + // twotracksconfigs.confCutTable->get("PartTwo", "nSigmaTPCTOF"))) { // continue; // } - if (trackonefilter.ConfIsTrackOneIdentified) { - if (!IsParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon))) { + if (trackonefilter.confIsTrackOneIdentified) { + if (!isParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon))) { continue; } } - if (tracktwofilter.ConfIsTrackTwoIdentified) { - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon))) { + if (tracktwofilter.confIsTrackTwoIdentified) { + if (!isParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon))) { continue; } } - if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (confIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -442,52 +440,52 @@ struct femtoUniversePairTaskTrackTrackExtended { } if (swpart) - sameEventCont.setPair(p1, p2, multCol, twotracksconfigs.ConfUse3D); + sameEventCont.setPair(p1, p2, multCol, twotracksconfigs.confUse3D); else - sameEventCont.setPair(p2, p1, multCol, twotracksconfigs.ConfUse3D); + sameEventCont.setPair(p2, p1, multCol, twotracksconfigs.confUse3D); swpart = !swpart; } } else { /// Now build the combinations for identical particle pairs (different combination policy than for non-identical!) - for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsOne, groupPartsTwo))) { - // if (p1.p() > twotracksconfigs.ConfCutTable->get("PartOne", "MaxP") || p1.pt() > twotracksconfigs.ConfCutTable->get("PartOne", "MaxPt") || p2.p() > twotracksconfigs.ConfCutTable->get("PartTwo", "MaxP") || p2.pt() > twotracksconfigs.ConfCutTable->get("PartTwo", "MaxPt")) { + for (const auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsOne, groupPartsTwo))) { + // if (p1.p() > twotracksconfigs.confCutTable->get("PartOne", "MaxP") || p1.pt() > twotracksconfigs.confCutTable->get("PartOne", "MaxPt") || p2.p() > twotracksconfigs.confCutTable->get("PartTwo", "MaxP") || p2.pt() > twotracksconfigs.confCutTable->get("PartTwo", "MaxPt")) { // continue; // } // if (!isFullPIDSelected(p1.pidcut(), // p1.p(), - // twotracksconfigs.ConfCutTable->get("PartOne", "PIDthr"), + // twotracksconfigs.confCutTable->get("PartOne", "PIDthr"), // vPIDPartOne, - // twotracksconfigs.ConfNspecies, + // twotracksconfigs.confNspecies, // kNsigma, - // twotracksconfigs.ConfCutTable->get("PartOne", "nSigmaTPC"), - // twotracksconfigs.ConfCutTable->get("PartOne", "nSigmaTPCTOF")) || + // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPC"), + // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPCTOF")) || // !isFullPIDSelected(p2.pidcut(), // p2.p(), - // twotracksconfigs.ConfCutTable->get("PartTwo", "PIDthr"), + // twotracksconfigs.confCutTable->get("PartTwo", "PIDthr"), // vPIDPartTwo, - // twotracksconfigs.ConfNspecies, + // twotracksconfigs.confNspecies, // kNsigma, - // twotracksconfigs.ConfCutTable->get("PartTwo", "nSigmaTPC"), - // twotracksconfigs.ConfCutTable->get("PartTwo", "nSigmaTPCTOF"))) { + // twotracksconfigs.confCutTable->get("PartTwo", "nSigmaTPC"), + // twotracksconfigs.confCutTable->get("PartTwo", "nSigmaTPCTOF"))) { // continue; // } - if (trackonefilter.ConfIsTrackOneIdentified) { - if (!IsParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon))) { + if (trackonefilter.confIsTrackOneIdentified) { + if (!isParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon))) { continue; } } - if (tracktwofilter.ConfIsTrackTwoIdentified) { - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon))) { + if (tracktwofilter.confIsTrackTwoIdentified) { + if (!isParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon))) { continue; } } - if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (confIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -496,7 +494,7 @@ struct femtoUniversePairTaskTrackTrackExtended { if (!pairCleaner.isCleanPair(p1, p2, parts)) { continue; } - sameEventCont.setPair(p1, p2, multCol, twotracksconfigs.ConfUse3D); + sameEventCont.setPair(p1, p2, multCol, twotracksconfigs.confUse3D); } } } @@ -504,8 +502,8 @@ struct femtoUniversePairTaskTrackTrackExtended { /// process function for to call doSameEvent with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processSameEvent(o2::aod::FDCollision& col, - FilteredFemtoFullParticles& parts) + void processSameEvent(const o2::aod::FDCollision& col, + const FilteredFemtoFullParticles& parts) { fillCollision(col); @@ -514,15 +512,15 @@ struct femtoUniversePairTaskTrackTrackExtended { doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multNtr()); } - PROCESS_SWITCH(femtoUniversePairTaskTrackTrackExtended, processSameEvent, "Enable processing same event", true); + PROCESS_SWITCH(FemtoUniversePairTaskTrackTrackExtended, processSameEvent, "Enable processing same event", true); /// process function for to call doSameEvent with Monte Carlo /// \param col subscribe to the collision table (Monte Carlo Reconstructed reconstructed) /// \param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// \param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processSameEventMC(o2::aod::FDCollision& col, - soa::Join& parts, - o2::aod::FDMCParticles&) + void processSameEventMC(const o2::aod::FDCollision& col, + const soa::Join& parts, + const o2::aod::FDMCParticles&) { fillCollision(col); @@ -531,7 +529,7 @@ struct femtoUniversePairTaskTrackTrackExtended { doSameEvent(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multNtr()); } - PROCESS_SWITCH(femtoUniversePairTaskTrackTrackExtended, processSameEventMC, "Enable processing same event for Monte Carlo", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackTrackExtended, processSameEventMC, "Enable processing same event for Monte Carlo", false); /// This function processes the mixed event /// \todo the trivial loops over the collisions and tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... @@ -551,50 +549,50 @@ struct femtoUniversePairTaskTrackTrackExtended { bool swpart = fNeventsProcessed % 2; fNeventsProcessed++; - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { - // if (p1.p() > twotracksconfigs.ConfCutTable->get("PartOne", "MaxP") || p1.pt() > twotracksconfigs.ConfCutTable->get("PartOne", "MaxPt") || p2.p() > twotracksconfigs.ConfCutTable->get("PartTwo", "MaxP") || p2.pt() > twotracksconfigs.ConfCutTable->get("PartTwo", "MaxPt")) { + for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { + // if (p1.p() > twotracksconfigs.confCutTable->get("PartOne", "MaxP") || p1.pt() > twotracksconfigs.confCutTable->get("PartOne", "MaxPt") || p2.p() > twotracksconfigs.confCutTable->get("PartTwo", "MaxP") || p2.pt() > twotracksconfigs.confCutTable->get("PartTwo", "MaxPt")) { // continue; // } // if (!isFullPIDSelected(p1.pidcut(), // p1.p(), - // twotracksconfigs.ConfCutTable->get("PartOne", "PIDthr"), + // twotracksconfigs.confCutTable->get("PartOne", "PIDthr"), // vPIDPartOne, - // twotracksconfigs.ConfNspecies, + // twotracksconfigs.confNspecies, // kNsigma, - // twotracksconfigs.ConfCutTable->get("PartOne", "nSigmaTPC"), - // twotracksconfigs.ConfCutTable->get("PartOne", "nSigmaTPCTOF")) || + // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPC"), + // twotracksconfigs.confCutTable->get("PartOne", "nSigmaTPCTOF")) || // !isFullPIDSelected(p2.pidcut(), // p2.p(), - // twotracksconfigs.ConfCutTable->get("PartTwo", "PIDthr"), + // twotracksconfigs.confCutTable->get("PartTwo", "PIDthr"), // vPIDPartTwo, - // twotracksconfigs.ConfNspecies, + // twotracksconfigs.confNspecies, // kNsigma, - // twotracksconfigs.ConfCutTable->get("PartTwo", "nSigmaTPC"), - // twotracksconfigs.ConfCutTable->get("PartTwo", "nSigmaTPCTOF"))) { + // twotracksconfigs.confCutTable->get("PartTwo", "nSigmaTPC"), + // twotracksconfigs.confCutTable->get("PartTwo", "nSigmaTPCTOF"))) { // continue; // } - if (trackonefilter.ConfIsTrackOneIdentified) { - if (!IsParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon))) { + if (trackonefilter.confIsTrackOneIdentified) { + if (!isParticleNSigma((int8_t)1, p1.p(), trackCuts.getNsigmaTPC(p1, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p1, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p1, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p1, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p1, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p1, o2::track::PID::Kaon))) { continue; } } - if (tracktwofilter.ConfIsTrackTwoIdentified) { - if (!IsParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon))) { + if (tracktwofilter.confIsTrackTwoIdentified) { + if (!isParticleNSigma((int8_t)2, p2.p(), trackCuts.getNsigmaTPC(p2, o2::track::PID::Proton), trackCuts.getNsigmaTOF(p2, o2::track::PID::Proton), trackCuts.getNsigmaTPC(p2, o2::track::PID::Pion), trackCuts.getNsigmaTOF(p2, o2::track::PID::Pion), trackCuts.getNsigmaTPC(p2, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(p2, o2::track::PID::Kaon))) { continue; } } - if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { + if (confIsCPR.value) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::mixed)) { continue; } } if (swpart) - mixedEventCont.setPair(p1, p2, multCol, twotracksconfigs.ConfUse3D); + mixedEventCont.setPair(p1, p2, multCol, twotracksconfigs.confUse3D); else - mixedEventCont.setPair(p2, p1, multCol, twotracksconfigs.ConfUse3D); + mixedEventCont.setPair(p2, p1, multCol, twotracksconfigs.confUse3D); swpart = !swpart; } @@ -603,13 +601,13 @@ struct femtoUniversePairTaskTrackTrackExtended { /// process function for to call doMixedEvent with Data /// @param cols subscribe to the collisions table (Data) /// @param parts subscribe to the femtoUniverseParticleTable - void processMixedEvent(o2::aod::FDCollisions& cols, - FilteredFemtoFullParticles& parts) + void processMixedEvent(const o2::aod::FDCollisions& cols, + const FilteredFemtoFullParticles& parts) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { const int multiplicityCol = collision1.multNtr(); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); auto groupPartsOne = partsOne->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); @@ -626,20 +624,20 @@ struct femtoUniversePairTaskTrackTrackExtended { doMixedEvent(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol); } } - PROCESS_SWITCH(femtoUniversePairTaskTrackTrackExtended, processMixedEvent, "Enable processing mixed events", true); + PROCESS_SWITCH(FemtoUniversePairTaskTrackTrackExtended, processMixedEvent, "Enable processing mixed events", true); /// brief process function for to call doMixedEvent with Monte Carlo /// @param cols subscribe to the collisions table (Monte Carlo Reconstructed reconstructed) /// @param parts subscribe to joined table FemtoUniverseParticles and FemtoUniverseMCLables to access Monte Carlo truth /// @param FemtoUniverseMCParticles subscribe to the Monte Carlo truth table - void processMixedEventMC(o2::aod::FDCollisions& cols, - soa::Join& parts, - o2::aod::FDMCParticles&) + void processMixedEventMC(const o2::aod::FDCollisions& cols, + const soa::Join& parts, + const o2::aod::FDMCParticles&) { - for (auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { + for (const auto& [collision1, collision2] : soa::selfCombinations(colBinning, 5, -1, cols, cols)) { const int multiplicityCol = collision1.multNtr(); - MixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); + mixQaRegistry.fill(HIST("MixingQA/hMECollisionBins"), colBinning.getBin({collision1.posZ(), multiplicityCol})); auto groupPartsOne = partsOneMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision1.globalIndex(), cache); auto groupPartsTwo = partsTwoMC->sliceByCached(aod::femtouniverseparticle::fdCollisionId, collision2.globalIndex(), cache); @@ -656,13 +654,13 @@ struct femtoUniversePairTaskTrackTrackExtended { doMixedEvent(groupPartsOne, groupPartsTwo, parts, magFieldTesla1, multiplicityCol); } } - PROCESS_SWITCH(femtoUniversePairTaskTrackTrackExtended, processMixedEventMC, "Enable processing mixed events MC", false); + PROCESS_SWITCH(FemtoUniversePairTaskTrackTrackExtended, processMixedEventMC, "Enable processing mixed events MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; return workflow; } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx index 2a9a1bb8153..c1ece63158b 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMC.cxx @@ -35,13 +35,13 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairAngularWithCentMultKt.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; @@ -167,27 +167,27 @@ struct femtoUniversePairTaskTrackTrackMC { Configurable cfgProcessMultBins{"cfgProcessMultBins", true, "Process kstar histograms in multiplicity bins (in multiplicity bins)"}; Configurable cfgProcessKtBins{"cfgProcessKtBins", true, "Process kstar histograms in kT bins (if cfgProcessMultBins is set false, this will not be processed regardless this Configurable state)"}; - FemtoUniverseContainer sameEventCont; - FemtoUniverseContainer mixedEventCont; + FemtoUniverseContainer sameEventCont; + FemtoUniverseContainer mixedEventCont; - FemtoUniverseContainer sameEventContPP; - FemtoUniverseContainer mixedEventContPP; + FemtoUniverseContainer sameEventContPP; + FemtoUniverseContainer mixedEventContPP; - FemtoUniverseContainer sameEventContMM; - FemtoUniverseContainer mixedEventContMM; + FemtoUniverseContainer sameEventContMM; + FemtoUniverseContainer mixedEventContMM; FemtoUniversePairCleaner pairCleaner; FemtoUniverseDetaDphiStar pairCloseRejection; FemtoUniverseTrackSelection trackCuts; - PairWithCentMultKt sameEventMultCont; - PairWithCentMultKt mixedEventMultCont; + FemtoUniversePairAngularWithCentMultKt sameEventMultCont; + FemtoUniversePairAngularWithCentMultKt mixedEventMultCont; - PairWithCentMultKt sameEventMultContPP; - PairWithCentMultKt mixedEventMultContPP; + FemtoUniversePairAngularWithCentMultKt sameEventMultContPP; + FemtoUniversePairAngularWithCentMultKt mixedEventMultContPP; - PairWithCentMultKt sameEventMultContMM; - PairWithCentMultKt mixedEventMultContMM; + FemtoUniversePairAngularWithCentMultKt sameEventMultContMM; + FemtoUniversePairAngularWithCentMultKt mixedEventMultContMM; float mass1 = -1; float mass2 = -1; @@ -449,7 +449,7 @@ struct femtoUniversePairTaskTrackTrackMC { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -481,7 +481,7 @@ struct femtoUniversePairTaskTrackTrackMC { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -595,7 +595,7 @@ struct femtoUniversePairTaskTrackTrackMC { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::mixed)) { continue; } } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMcTruth.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMcTruth.cxx index 0ae10b8c65a..753f528d53f 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMcTruth.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMcTruth.cxx @@ -30,11 +30,11 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; @@ -106,8 +106,8 @@ struct femtoUniversePairTaskTrackTrackMcTruth { Configurable ConfPhiBins{"ConfPhiBins", 29, "Number of phi bins in deta dphi"}; Configurable ConfEtaBins{"ConfEtaBins", 29, "Number of eta bins in deta dphi"}; - FemtoUniverseContainer sameEventCont; - FemtoUniverseContainer mixedEventCont; + FemtoUniverseContainer sameEventCont; + FemtoUniverseContainer mixedEventCont; FemtoUniversePairCleaner pairCleaner; /// Histogram output HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx index 41bbc51b54e..d243bf9f96f 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx @@ -36,13 +36,13 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseFemtoContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairWithCentMultKt.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; @@ -174,27 +174,27 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { Configurable cfgProcessKtBins{"cfgProcessKtBins", true, "Process kstar histograms in kT bins (if 'cfgProcessMultBins' is false, it will not be processed regardless of 'cfgProcessKtBins' state)"}; Configurable cfgProcessKtMt3DCF{"cfgProcessKtMt3DCF", false, "Process 3D histograms in kT and MultBins"}; - FemtoUniverseFemtoContainer sameEventCont; - FemtoUniverseFemtoContainer mixedEventCont; + FemtoUniverseFemtoContainer sameEventCont; + FemtoUniverseFemtoContainer mixedEventCont; - FemtoUniverseFemtoContainer sameEventContPP; - FemtoUniverseFemtoContainer mixedEventContPP; + FemtoUniverseFemtoContainer sameEventContPP; + FemtoUniverseFemtoContainer mixedEventContPP; - FemtoUniverseFemtoContainer sameEventContMM; - FemtoUniverseFemtoContainer mixedEventContMM; + FemtoUniverseFemtoContainer sameEventContMM; + FemtoUniverseFemtoContainer mixedEventContMM; FemtoUniversePairCleaner pairCleaner; FemtoUniverseDetaDphiStar pairCloseRejection; FemtoUniverseTrackSelection trackCuts; - PairWithCentMultKt sameEventMultCont; - PairWithCentMultKt mixedEventMultCont; + FemtoUniversePairWithCentMultKt sameEventMultCont; + FemtoUniversePairWithCentMultKt mixedEventMultCont; - PairWithCentMultKt sameEventMultContPP; - PairWithCentMultKt mixedEventMultContPP; + FemtoUniversePairWithCentMultKt sameEventMultContPP; + FemtoUniversePairWithCentMultKt mixedEventMultContPP; - PairWithCentMultKt sameEventMultContMM; - PairWithCentMultKt mixedEventMultContMM; + FemtoUniversePairWithCentMultKt sameEventMultContMM; + FemtoUniversePairWithCentMultKt mixedEventMultContMM; float mass1 = -1; float mass2 = -1; @@ -427,7 +427,7 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -457,7 +457,7 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -590,7 +590,7 @@ struct femtoUniversePairTaskTrackTrackMultKtExtended { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::mixed)) { continue; } } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index 2f1e8ee4712..93374bf2a16 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -34,13 +34,13 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseSHContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairSHCentMultKt.h" using namespace o2; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; @@ -181,27 +181,27 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable cfgProcessKtBins{"cfgProcessKtBins", true, "Process kstar histograms in kT bins (if cfgProcessMultBins is set false, this will not be processed regardless this Configurable state)"}; Configurable cfgProcessKtMt3DCF{"cfgProcessKtMt3DCF", false, "Process 3D histograms in kT and Mult bins"}; - FemtoUniverseSHContainer sameEventCont; - FemtoUniverseSHContainer mixedEventCont; + FemtoUniverseSHContainer sameEventCont; + FemtoUniverseSHContainer mixedEventCont; - FemtoUniverseSHContainer sameEventContPP; - FemtoUniverseSHContainer mixedEventContPP; + FemtoUniverseSHContainer sameEventContPP; + FemtoUniverseSHContainer mixedEventContPP; - FemtoUniverseSHContainer sameEventContMM; - FemtoUniverseSHContainer mixedEventContMM; + FemtoUniverseSHContainer sameEventContMM; + FemtoUniverseSHContainer mixedEventContMM; FemtoUniversePairCleaner pairCleaner; FemtoUniverseDetaDphiStar pairCloseRejection; FemtoUniverseTrackSelection trackCuts; - PairSHCentMultKt sameEventMultCont; - PairSHCentMultKt mixedEventMultCont; + PairSHCentMultKt sameEventMultCont; + PairSHCentMultKt mixedEventMultCont; - PairSHCentMultKt sameEventMultContPP; - PairSHCentMultKt mixedEventMultContPP; + PairSHCentMultKt sameEventMultContPP; + PairSHCentMultKt mixedEventMultContPP; - PairSHCentMultKt sameEventMultContMM; - PairSHCentMultKt mixedEventMultContMM; + PairSHCentMultKt sameEventMultContMM; + PairSHCentMultKt mixedEventMultContMM; float mass1 = -1; float mass2 = -1; @@ -475,7 +475,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -485,7 +485,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { continue; } float kT = FemtoUniverseMath::getkT(p1, mass1, p2, mass2); - sameEventMultCont.fill_mult_NumDen(p1, p2, femtoUniverseSHContainer::EventType::same, 2, multCol, kT, ConfIsIden); + sameEventMultCont.fillMultNumDen(p1, p2, femto_universe_sh_container::EventType::same, 2, multCol, kT, ConfIsIden); } } else { for (auto& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(groupPartsOne, groupPartsOne))) { @@ -499,7 +499,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -516,18 +516,18 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { switch (ContType) { case 2: { if (rand > 0.5) { - sameEventMultContPP.fill_mult_NumDen(p1, p2, femtoUniverseSHContainer::EventType::same, 2, multCol, kT, ConfIsIden); + sameEventMultContPP.fillMultNumDen(p1, p2, femto_universe_sh_container::EventType::same, 2, multCol, kT, ConfIsIden); } else if (rand <= 0.5) { - sameEventMultContPP.fill_mult_NumDen(p2, p1, femtoUniverseSHContainer::EventType::same, 2, multCol, kT, ConfIsIden); + sameEventMultContPP.fillMultNumDen(p2, p1, femto_universe_sh_container::EventType::same, 2, multCol, kT, ConfIsIden); } break; } case 3: { if (rand > 0.5) { - sameEventMultContMM.fill_mult_NumDen(p1, p2, femtoUniverseSHContainer::EventType::same, 2, multCol, kT, ConfIsIden); + sameEventMultContMM.fillMultNumDen(p1, p2, femto_universe_sh_container::EventType::same, 2, multCol, kT, ConfIsIden); } else if (rand <= 0.5) { - sameEventMultContMM.fill_mult_NumDen(p2, p1, femtoUniverseSHContainer::EventType::same, 2, multCol, kT, ConfIsIden); + sameEventMultContMM.fillMultNumDen(p2, p1, femto_universe_sh_container::EventType::same, 2, multCol, kT, ConfIsIden); } break; } @@ -607,7 +607,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (ConfIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::mixed)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::mixed)) { continue; } } @@ -619,27 +619,27 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { switch (ContType) { case 1: { if (rand > 0.5) { - mixedEventMultCont.fill_mult_NumDen(p1, p2, femtoUniverseSHContainer::EventType::mixed, 2, multCol, kT, ConfIsIden); + mixedEventMultCont.fillMultNumDen(p1, p2, femto_universe_sh_container::EventType::mixed, 2, multCol, kT, ConfIsIden); } else { - mixedEventMultCont.fill_mult_NumDen(p2, p1, femtoUniverseSHContainer::EventType::mixed, 2, multCol, kT, ConfIsIden); + mixedEventMultCont.fillMultNumDen(p2, p1, femto_universe_sh_container::EventType::mixed, 2, multCol, kT, ConfIsIden); } break; } case 2: { if (rand > 0.5) { - mixedEventMultContPP.fill_mult_NumDen(p1, p2, femtoUniverseSHContainer::EventType::mixed, 2, multCol, kT, ConfIsIden); + mixedEventMultContPP.fillMultNumDen(p1, p2, femto_universe_sh_container::EventType::mixed, 2, multCol, kT, ConfIsIden); } else { - mixedEventMultContPP.fill_mult_NumDen(p2, p1, femtoUniverseSHContainer::EventType::mixed, 2, multCol, kT, ConfIsIden); + mixedEventMultContPP.fillMultNumDen(p2, p1, femto_universe_sh_container::EventType::mixed, 2, multCol, kT, ConfIsIden); } break; } case 3: { if (rand > 0.5) { - mixedEventMultContMM.fill_mult_NumDen(p1, p2, femtoUniverseSHContainer::EventType::mixed, 2, multCol, kT, ConfIsIden); + mixedEventMultContMM.fillMultNumDen(p1, p2, femto_universe_sh_container::EventType::mixed, 2, multCol, kT, ConfIsIden); } else { - mixedEventMultContMM.fill_mult_NumDen(p2, p1, femtoUniverseSHContainer::EventType::mixed, 2, multCol, kT, ConfIsIden); + mixedEventMultContMM.fillMultNumDen(p2, p1, femto_universe_sh_container::EventType::mixed, 2, multCol, kT, ConfIsIden); } break; } @@ -697,14 +697,14 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { { int JMax = (ConfLMax + 1) * (ConfLMax + 1); if (cfgProcessMM) { - sameEventMultContMM.fill_mult_kT_Cov(femtoUniverseSHContainer::EventType::same, JMax); - mixedEventMultContMM.fill_mult_kT_Cov(femtoUniverseSHContainer::EventType::mixed, JMax); + sameEventMultContMM.fillMultkTCov(femto_universe_sh_container::EventType::same, JMax); + mixedEventMultContMM.fillMultkTCov(femto_universe_sh_container::EventType::mixed, JMax); } else if (cfgProcessPP) { - sameEventMultContPP.fill_mult_kT_Cov(femtoUniverseSHContainer::EventType::same, JMax); - mixedEventMultContPP.fill_mult_kT_Cov(femtoUniverseSHContainer::EventType::mixed, JMax); + sameEventMultContPP.fillMultkTCov(femto_universe_sh_container::EventType::same, JMax); + mixedEventMultContPP.fillMultkTCov(femto_universe_sh_container::EventType::mixed, JMax); } else if (cfgProcessPM) { - sameEventMultCont.fill_mult_kT_Cov(femtoUniverseSHContainer::EventType::same, JMax); - mixedEventMultCont.fill_mult_kT_Cov(femtoUniverseSHContainer::EventType::mixed, JMax); + sameEventMultCont.fillMultkTCov(femto_universe_sh_container::EventType::same, JMax); + mixedEventMultCont.fillMultkTCov(femto_universe_sh_container::EventType::mixed, JMax); } } PROCESS_SWITCH(femtoUniversePairTaskTrackTrackSpherHarMultKtExtended, processCov, "Enable processing same event covariance", true); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx index a8f91141904..87706527e71 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx @@ -30,7 +30,7 @@ #include "PWGCF/FemtoUniverse/Core/FemtoUniversePairCleaner.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" #include "Framework/O2DatabasePDGPlugin.h" #include #include @@ -39,7 +39,7 @@ using namespace o2; using namespace o2::soa; using namespace o2::framework; using namespace o2::framework::expressions; -using namespace o2::analysis::femtoUniverse; +using namespace o2::analysis::femto_universe; using namespace o2::aod::pidutils; using namespace o2::track; @@ -144,8 +144,8 @@ struct FemtoUniversePairTaskTrackV0Extended { static constexpr unsigned int V0ChildTable[][2] = {{0, 1}, {1, 0}, {1, 1}}; // Table to select the V0 children - FemtoUniverseContainer sameEventCont; - FemtoUniverseContainer mixedEventCont; + FemtoUniverseContainer sameEventCont; + FemtoUniverseContainer mixedEventCont; FemtoUniversePairCleaner pairCleaner; FemtoUniversePairCleaner pairCleanerV0; FemtoUniverseDetaDphiStar pairCloseRejection; @@ -351,7 +351,7 @@ struct FemtoUniversePairTaskTrackV0Extended { continue; } if (confIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -431,7 +431,7 @@ struct FemtoUniversePairTaskTrackV0Extended { return; } if (confIsCPR.value) { - if (pairCloseRejectionV0.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejectionV0.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { return; } } @@ -508,7 +508,7 @@ struct FemtoUniversePairTaskTrackV0Extended { continue; // track cleaning if (confIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femtoUniverseContainer::EventType::same)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } @@ -598,7 +598,7 @@ struct FemtoUniversePairTaskTrackV0Extended { continue; } if (confIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla1, femtoUniverseContainer::EventType::mixed)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla1, femto_universe_container::EventType::mixed)) { continue; } } @@ -684,7 +684,7 @@ struct FemtoUniversePairTaskTrackV0Extended { continue; } if (confIsCPR.value) { - if (pairCloseRejectionV0.isClosePair(p1, p2, parts, magFieldTesla1, femtoUniverseContainer::EventType::mixed)) { + if (pairCloseRejectionV0.isClosePair(p1, p2, parts, magFieldTesla1, femto_universe_container::EventType::mixed)) { continue; } } @@ -731,7 +731,7 @@ struct FemtoUniversePairTaskTrackV0Extended { if ((confV0Type1 == 0 && pdgCode2 != 3122) || (confV0Type1 == 1 && pdgCode2 != -3122)) continue; if (confIsCPR.value) { - if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla1, femtoUniverseContainer::EventType::mixed)) { + if (pairCloseRejection.isClosePair(p1, p2, parts, magFieldTesla1, femto_universe_container::EventType::mixed)) { continue; } } From 5804f9233207a2ecf4f2623e54f5d7b8f54a89cd Mon Sep 17 00:00:00 2001 From: nzardosh Date: Wed, 18 Dec 2024 17:10:59 +0100 Subject: [PATCH 432/459] [PWGJE] adding bplusSels table to dummy tables (#9048) --- PWGJE/TableProducer/derivedDataProducerDummy.cxx | 1 + PWGJE/TableProducer/derivedDataProducerDummyD0.cxx | 1 + PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx | 1 + PWGJE/TableProducer/derivedDataProducerDummyLc.cxx | 1 + 4 files changed, 4 insertions(+) diff --git a/PWGJE/TableProducer/derivedDataProducerDummy.cxx b/PWGJE/TableProducer/derivedDataProducerDummy.cxx index da60109d94f..c5a68c7c6b8 100644 --- a/PWGJE/TableProducer/derivedDataProducerDummy.cxx +++ b/PWGJE/TableProducer/derivedDataProducerDummy.cxx @@ -55,6 +55,7 @@ struct JetDerivedDataProducerDummyTask { Produces bplusParsTable; Produces bplusParExtrasTable; Produces bplusParD0sTable; + Produces bplusSelsTable; Produces bplusMlsTable; Produces bplusMlD0sTable; Produces bplusMcsTable; diff --git a/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx b/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx index c28b0e44dfe..4cbbfdeedea 100644 --- a/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx +++ b/PWGJE/TableProducer/derivedDataProducerDummyD0.cxx @@ -44,6 +44,7 @@ struct JetDerivedDataProducerDummyD0Task { Produces bplusParsTable; Produces bplusParExtrasTable; Produces bplusParD0sTable; + Produces bplusSelsTable; Produces bplusMlsTable; Produces bplusMlD0sTable; Produces bplusMcsTable; diff --git a/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx b/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx index 9df74703902..c24cf13bd41 100644 --- a/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx +++ b/PWGJE/TableProducer/derivedDataProducerDummyDielectron.cxx @@ -55,6 +55,7 @@ struct JetDerivedDataProducerDummyDielectronTask { Produces bplusParsTable; Produces bplusParExtrasTable; Produces bplusParD0sTable; + Produces bplusSelsTable; Produces bplusMlsTable; Produces bplusMlD0sTable; Produces bplusMcsTable; diff --git a/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx b/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx index 5550e97a9ae..9913e1da37f 100644 --- a/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx +++ b/PWGJE/TableProducer/derivedDataProducerDummyLc.cxx @@ -44,6 +44,7 @@ struct JetDerivedDataProducerDummyLcTask { Produces bplusParsTable; Produces bplusParExtrasTable; Produces bplusParD0sTable; + Produces bplusSelsTable; Produces bplusMlsTable; Produces bplusMlD0sTable; Produces bplusMcsTable; From 3849d6e9692e9d7c11531954a10702b0f73618ad Mon Sep 17 00:00:00 2001 From: Zhiyong <71517277+Luzhiyongg@users.noreply.github.com> Date: Thu, 19 Dec 2024 00:43:55 +0800 Subject: [PATCH 433/459] [PWGCF] flow: modify code according to O2 linter (#9037) --- PWGCF/Flow/Tasks/CMakeLists.txt | 6 +- .../{FlowRunbyRun.cxx => flowRunbyRun.cxx} | 126 +++++------ .../Flow/Tasks/{FlowTask.cxx => flowTask.cxx} | 205 +++++++++--------- 3 files changed, 171 insertions(+), 166 deletions(-) rename PWGCF/Flow/Tasks/{FlowRunbyRun.cxx => flowRunbyRun.cxx} (71%) rename PWGCF/Flow/Tasks/{FlowTask.cxx => flowTask.cxx} (85%) diff --git a/PWGCF/Flow/Tasks/CMakeLists.txt b/PWGCF/Flow/Tasks/CMakeLists.txt index d6e288a4594..34a3dafcf30 100644 --- a/PWGCF/Flow/Tasks/CMakeLists.txt +++ b/PWGCF/Flow/Tasks/CMakeLists.txt @@ -15,12 +15,12 @@ o2physics_add_dpl_workflow(flow-pt-efficiency COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(flow-task - SOURCES FlowTask.cxx + SOURCES flowTask.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::GFWCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(flow-runbyrun - SOURCES FlowRunbyRun.cxx +o2physics_add_dpl_workflow(flow-runby-run + SOURCES flowRunbyRun.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2Physics::GFWCore COMPONENT_NAME Analysis) diff --git a/PWGCF/Flow/Tasks/FlowRunbyRun.cxx b/PWGCF/Flow/Tasks/flowRunbyRun.cxx similarity index 71% rename from PWGCF/Flow/Tasks/FlowRunbyRun.cxx rename to PWGCF/Flow/Tasks/flowRunbyRun.cxx index 4478ca9e0a7..0564bfc3cc1 100644 --- a/PWGCF/Flow/Tasks/FlowRunbyRun.cxx +++ b/PWGCF/Flow/Tasks/flowRunbyRun.cxx @@ -9,9 +9,11 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // -// code author: Zhiyong Lu (zhiyong.lu@cern.ch) -// jira: PWGCF-254 -// Produce Run-by-Run QA plots and flow analysis for Run3 + +/// \file flowRunbyRun.cxx +/// \author Zhiyong Lu (zhiyong.lu@cern.ch) +/// \since Oct/30/2024 +/// \brief jira: PWGCF-254, produce Run-by-Run QA plots and flow analysis for Run3 #include #include @@ -76,8 +78,8 @@ struct FlowRunbyRun { // Connect to ccdb Service ccdb; - Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; - Configurable url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; // Define output OutputObj fFC{FlowContainer("FlowContainer")}; @@ -91,10 +93,10 @@ struct FlowRunbyRun { TAxis* fPtAxis; TRandom3* fRndm = new TRandom3(0); int lastRunNumer = -1; - std::vector RunNumbers; // vector of run numbers - std::map>> TH1sList; // map of histograms for all runs - std::map>> ProfilesList; // map of profiles for all runs - std::map WeightsList; // map of weights for all runs + std::vector runNumbers; // vector of run numbers + std::map>> th1sList; // map of histograms for all runs + std::map>> profilesList; // map of profiles for all runs + std::map weightsList; // map of weights for all runs enum OutputTH1Names { // here are TProfiles for vn-pt correlations that are not implemented in GFW hPhi = 0, @@ -110,37 +112,37 @@ struct FlowRunbyRun { kCount_TProfileNames }; - using aodCollisions = soa::Filtered>; - using aodTracks = soa::Filtered>; + using AodCollisions = soa::Filtered>; + using AodTracks = soa::Filtered>; void init(InitContext const&) { - ccdb->setURL(url.value); + ccdb->setURL(ccdbUrl.value); ccdb->setCaching(true); - ccdb->setCreatedNotAfter(nolaterthan.value); + ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); TList* weightlist = new TList(); weightlist->SetOwner(true); fWeightList.setObject(weightlist); // Add output histograms to the registry - RunNumbers = cfgRunNumbers; - for (auto& runNumber : RunNumbers) { - CreateOutputObjectsForRun(runNumber); + runNumbers = cfgRunNumbers; + for (const auto& runNumber : runNumbers) { + createOutputObjectsForRun(runNumber); } o2::framework::AxisSpec axis = axisPt; int nPtBins = axis.binEdges.size() - 1; - double* PtBins = &(axis.binEdges)[0]; - fPtAxis = new TAxis(nPtBins, PtBins); + double* ptBins = &(axis.binEdges)[0]; + fPtAxis = new TAxis(nPtBins, ptBins); // Create FlowContainer TObjArray* oba = new TObjArray(); - std::vector UserDefineGFWCorr = cfgUserDefineGFWCorr; - std::vector UserDefineGFWName = cfgUserDefineGFWName; - if (!UserDefineGFWCorr.empty() && !UserDefineGFWName.empty()) { - for (uint i = 0; i < UserDefineGFWName.size(); i++) { - oba->Add(new TNamed(UserDefineGFWName.at(i).c_str(), UserDefineGFWName.at(i).c_str())); + std::vector userDefineGFWCorr = cfgUserDefineGFWCorr; + std::vector userDefineGFWName = cfgUserDefineGFWName; + if (!userDefineGFWCorr.empty() && !userDefineGFWName.empty()) { + for (uint i = 0; i < userDefineGFWName.size(); i++) { + oba->Add(new TNamed(userDefineGFWName.at(i).c_str(), userDefineGFWName.at(i).c_str())); } } fFC->SetName("FlowContainer"); @@ -154,23 +156,23 @@ struct FlowRunbyRun { corrconfigs.resize(kCount_TProfileNames); corrconfigs[c22] = fGFW->GetCorrelatorConfig("full {2 -2}", "ChFull22", kFALSE); corrconfigs[c22_gap10] = fGFW->GetCorrelatorConfig("refN10 {2} refP10 {-2}", "Ch10Gap22", kFALSE); - if (!UserDefineGFWCorr.empty() && !UserDefineGFWName.empty()) { + if (!userDefineGFWCorr.empty() && !userDefineGFWName.empty()) { LOGF(info, "User adding GFW CorrelatorConfig:"); // attentaion: here we follow the index of cfgUserDefineGFWCorr - for (uint i = 0; i < UserDefineGFWCorr.size(); i++) { - if (i >= UserDefineGFWName.size()) { - LOGF(fatal, "The names you provided are more than configurations. UserDefineGFWName.size(): %d > UserDefineGFWCorr.size(): %d", UserDefineGFWName.size(), UserDefineGFWCorr.size()); + for (uint i = 0; i < userDefineGFWCorr.size(); i++) { + if (i >= userDefineGFWName.size()) { + LOGF(fatal, "The names you provided are more than configurations. userDefineGFWName.size(): %d > userDefineGFWCorr.size(): %d", userDefineGFWName.size(), userDefineGFWCorr.size()); break; } - LOGF(info, "%d: %s %s", i, UserDefineGFWCorr.at(i).c_str(), UserDefineGFWName.at(i).c_str()); - corrconfigsFC.push_back(fGFW->GetCorrelatorConfig(UserDefineGFWCorr.at(i).c_str(), UserDefineGFWName.at(i).c_str(), kFALSE)); + LOGF(info, "%d: %s %s", i, userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str()); + corrconfigsFC.push_back(fGFW->GetCorrelatorConfig(userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str(), kFALSE)); } } fGFW->CreateRegions(); } template - void FillProfile(const GFW::CorrConfig& corrconf, std::shared_ptr profile, const double& cent) + void fillProfile(const GFW::CorrConfig& corrconf, std::shared_ptr profile, const double& cent) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); @@ -178,14 +180,14 @@ struct FlowRunbyRun { return; if (!corrconf.pTDif) { val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) + if (std::fabs(val) < 1) profile->Fill(cent, val, dnx); return; } return; } - void FillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) + void fillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); @@ -193,22 +195,22 @@ struct FlowRunbyRun { return; if (!corrconf.pTDif) { val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) + if (std::fabs(val) < 1) fFC->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm); return; } - for (Int_t i = 1; i <= fPtAxis->GetNbins(); i++) { + for (auto i = 1; i <= fPtAxis->GetNbins(); i++) { dnx = fGFW->Calculate(corrconf, i - 1, kTRUE).real(); if (dnx == 0) continue; val = fGFW->Calculate(corrconf, i - 1, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) + if (std::fabs(val) < 1) fFC->FillProfile(Form("%s_pt_%i", corrconf.Head.c_str(), i), cent, val, dnx, rndm); } return; } - void CreateOutputObjectsForRun(int runNumber) + void createOutputObjectsForRun(int runNumber) { std::vector> histos(kCount_TH1Names); histos[hPhi] = registry.add(Form("%d/hPhi", runNumber), "", {HistType::kTH1D, {axisPhi}}); @@ -216,25 +218,25 @@ struct FlowRunbyRun { histos[hVtxZ] = registry.add(Form("%d/hVtxZ", runNumber), "", {HistType::kTH1D, {axisVertex}}); histos[hMult] = registry.add(Form("%d/hMult", runNumber), "", {HistType::kTH1D, {{3000, 0.5, 3000.5}}}); histos[hCent] = registry.add(Form("%d/hCent", runNumber), "", {HistType::kTH1D, {{90, 0, 90}}}); - TH1sList.insert(std::make_pair(runNumber, histos)); + th1sList.insert(std::make_pair(runNumber, histos)); std::vector> profiles(kCount_TProfileNames); profiles[c22] = registry.add(Form("%d/c22", runNumber), "", {HistType::kTProfile, {axisIndependent}}); profiles[c22_gap10] = registry.add(Form("%d/c22_gap10", runNumber), "", {HistType::kTProfile, {axisIndependent}}); - ProfilesList.insert(std::make_pair(runNumber, profiles)); + profilesList.insert(std::make_pair(runNumber, profiles)); - // WeightsList + // weightsList o2::framework::AxisSpec axis = axisPt; int nPtBins = axis.binEdges.size() - 1; - double* PtBins = &(axis.binEdges)[0]; + double* ptBins = &(axis.binEdges)[0]; GFWWeights* weight = new GFWWeights(Form("weight_%d", runNumber)); - weight->SetPtBins(nPtBins, PtBins); + weight->SetPtBins(nPtBins, ptBins); weight->Init(true, false); fWeightList->Add(weight); - WeightsList.insert(std::make_pair(runNumber, weight)); + weightsList.insert(std::make_pair(runNumber, weight)); } - void process(aodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, aodTracks const& tracks) + void process(AodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, AodTracks const& tracks) { if (!collision.sel8()) return; @@ -243,51 +245,51 @@ struct FlowRunbyRun { // detect run number auto bc = collision.bc_as(); int runNumber = bc.runNumber(); - float l_Random = fRndm->Rndm(); + float lRandom = fRndm->Rndm(); if (runNumber != lastRunNumer) { lastRunNumer = runNumber; - if (std::find(RunNumbers.begin(), RunNumbers.end(), runNumber) == RunNumbers.end()) { + if (std::find(runNumbers.begin(), runNumbers.end(), runNumber) == runNumbers.end()) { // if run number is not in the preconfigured list, create new output histograms for this run - CreateOutputObjectsForRun(runNumber); - RunNumbers.push_back(runNumber); + createOutputObjectsForRun(runNumber); + runNumbers.push_back(runNumber); } - if (TH1sList.find(runNumber) == TH1sList.end()) { - LOGF(fatal, "RunNumber %d not found in TH1sList", runNumber); + if (th1sList.find(runNumber) == th1sList.end()) { + LOGF(fatal, "RunNumber %d not found in th1sList", runNumber); return; } } - TH1sList[runNumber][hVtxZ]->Fill(collision.posZ()); - TH1sList[runNumber][hMult]->Fill(tracks.size()); - TH1sList[runNumber][hCent]->Fill(collision.centFT0C()); + th1sList[runNumber][hVtxZ]->Fill(collision.posZ()); + th1sList[runNumber][hMult]->Fill(tracks.size()); + th1sList[runNumber][hCent]->Fill(collision.centFT0C()); fGFW->Clear(); const auto cent = collision.centFT0C(); float weff = 1, wacc = 1; - for (auto& track : tracks) { - TH1sList[runNumber][hPhi]->Fill(track.phi()); - TH1sList[runNumber][hEta]->Fill(track.eta()); + for (const auto& track : tracks) { + th1sList[runNumber][hPhi]->Fill(track.phi()); + th1sList[runNumber][hEta]->Fill(track.eta()); // bool WithinPtPOI = (cfgCutPtPOIMin < track.pt()) && (track.pt() < cfgCutPtPOIMax); // within POI pT range - bool WithinPtRef = (cfgCutPtRefMin < track.pt()) && (track.pt() < cfgCutPtRefMax); // within RF pT range - if (WithinPtRef) { + bool withinPtRef = (cfgCutPtRefMin < track.pt()) && (track.pt() < cfgCutPtRefMax); // within RF pT range + if (withinPtRef) { fGFW->Fill(track.eta(), 1, track.phi(), wacc * weff, 1); } if (cfgOutputNUAWeightsRefPt) { - if (WithinPtRef) - WeightsList[runNumber]->Fill(track.phi(), track.eta(), collision.posZ(), track.pt(), cent, 0); + if (withinPtRef) + weightsList[runNumber]->Fill(track.phi(), track.eta(), collision.posZ(), track.pt(), cent, 0); } else { - WeightsList[runNumber]->Fill(track.phi(), track.eta(), collision.posZ(), track.pt(), cent, 0); + weightsList[runNumber]->Fill(track.phi(), track.eta(), collision.posZ(), track.pt(), cent, 0); } } // Filling TProfile for (uint i = 0; i < kCount_TProfileNames; ++i) { - FillProfile(corrconfigs[i], ProfilesList[runNumber][i], cent); + fillProfile(corrconfigs[i], profilesList[runNumber][i], cent); } // Filling Flow Container for (uint l_ind = 0; l_ind < corrconfigsFC.size(); l_ind++) { - FillFC(corrconfigsFC.at(l_ind), cent, l_Random); + fillFC(corrconfigsFC.at(l_ind), cent, lRandom); } } }; diff --git a/PWGCF/Flow/Tasks/FlowTask.cxx b/PWGCF/Flow/Tasks/flowTask.cxx similarity index 85% rename from PWGCF/Flow/Tasks/FlowTask.cxx rename to PWGCF/Flow/Tasks/flowTask.cxx index 55a5bfc40ba..60e13dde9bc 100644 --- a/PWGCF/Flow/Tasks/FlowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -8,9 +8,11 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// -// code author: Zhiyong Lu (zhiyong.lu@cern.ch) -// jira: PWGCF-254 + +/// \file flowTask.cxx +/// \author Zhiyong Lu (zhiyong.lu@cern.ch) +/// \since Dec/10/2023 +/// \brief jira: PWGCF-254, task to measure flow observables with cumulant method #include #include @@ -118,8 +120,8 @@ struct FlowTask { // Connect to ccdb Service ccdb; - Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; - Configurable url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; // Define output OutputObj fFC{FlowContainer("FlowContainer")}; @@ -131,7 +133,7 @@ struct FlowTask { std::vector corrconfigs; TAxis* fPtAxis; TRandom3* fRndm = new TRandom3(0); - std::vector>> BootstrapArray; + std::vector>> bootstrapArray; enum ExtraProfile { // here are TProfiles for vn-pt correlations that are not implemented in GFW kMeanPt_InGap08 = 0, @@ -149,8 +151,8 @@ struct FlowTask { ctpRateFetcher mRateFetcher; TH2* gCurrentHadronicRate; - using aodCollisions = soa::Filtered>; - using aodTracks = soa::Filtered>; + using AodCollisions = soa::Filtered>; + using AodTracks = soa::Filtered>; // Track selection TrackSelection myTrackSel; @@ -167,9 +169,9 @@ struct FlowTask { void init(InitContext const&) { - ccdb->setURL(url.value); + ccdb->setURL(ccdbUrl.value); ccdb->setCaching(true); - ccdb->setCreatedNotAfter(nolaterthan.value); + ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); // Add some output objects to the histogram registry // Event QA @@ -223,26 +225,26 @@ struct FlowTask { registry.add("PtVariance_partB_WithinGap08", "", {HistType::kTProfile, {axisIndependent}}); // initial array - BootstrapArray.resize(cfgNbootstrap); + bootstrapArray.resize(cfgNbootstrap); for (int i = 0; i < cfgNbootstrap; i++) { - BootstrapArray[i].resize(kCount_ExtraProfile); + bootstrapArray[i].resize(kCount_ExtraProfile); } for (int i = 0; i < cfgNbootstrap; i++) { - BootstrapArray[i][kMeanPt_InGap08] = registry.add(Form("BootstrapContainer_%d/hMeanPtWithinGap08", i), "", {HistType::kTProfile, {axisIndependent}}); - BootstrapArray[i][kC22_Gap08_Weff] = registry.add(Form("BootstrapContainer_%d/c22_gap08_Weff", i), "", {HistType::kTProfile, {axisIndependent}}); - BootstrapArray[i][kC22_Gap08_MeanPt] = registry.add(Form("BootstrapContainer_%d/c22_gap08_trackMeanPt", i), "", {HistType::kTProfile, {axisIndependent}}); - BootstrapArray[i][kPtVarParA_InGap08] = registry.add(Form("BootstrapContainer_%d/PtVariance_partA_WithinGap08", i), "", {HistType::kTProfile, {axisIndependent}}); - BootstrapArray[i][kPtVarParB_InGap08] = registry.add(Form("BootstrapContainer_%d/PtVariance_partB_WithinGap08", i), "", {HistType::kTProfile, {axisIndependent}}); + bootstrapArray[i][kMeanPt_InGap08] = registry.add(Form("BootstrapContainer_%d/hMeanPtWithinGap08", i), "", {HistType::kTProfile, {axisIndependent}}); + bootstrapArray[i][kC22_Gap08_Weff] = registry.add(Form("BootstrapContainer_%d/c22_gap08_Weff", i), "", {HistType::kTProfile, {axisIndependent}}); + bootstrapArray[i][kC22_Gap08_MeanPt] = registry.add(Form("BootstrapContainer_%d/c22_gap08_trackMeanPt", i), "", {HistType::kTProfile, {axisIndependent}}); + bootstrapArray[i][kPtVarParA_InGap08] = registry.add(Form("BootstrapContainer_%d/PtVariance_partA_WithinGap08", i), "", {HistType::kTProfile, {axisIndependent}}); + bootstrapArray[i][kPtVarParB_InGap08] = registry.add(Form("BootstrapContainer_%d/PtVariance_partB_WithinGap08", i), "", {HistType::kTProfile, {axisIndependent}}); } } o2::framework::AxisSpec axis = axisPt; int nPtBins = axis.binEdges.size() - 1; - double* PtBins = &(axis.binEdges)[0]; - fPtAxis = new TAxis(nPtBins, PtBins); + double* ptBins = &(axis.binEdges)[0]; + fPtAxis = new TAxis(nPtBins, ptBins); if (cfgOutputNUAWeights) { - fWeights->SetPtBins(nPtBins, PtBins); + fWeights->SetPtBins(nPtBins, ptBins); fWeights->Init(true, false); } @@ -254,29 +256,29 @@ struct FlowTask { oba->Add(new TNamed("ChFull42", "ChFull42")); oba->Add(new TNamed("ChFull24", "ChFull24")); oba->Add(new TNamed("ChFull26", "ChFull26")); - for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + for (auto i = 0; i < fPtAxis->GetNbins(); i++) oba->Add(new TNamed(Form("ChFull22_pt_%i", i + 1), "ChFull22_pTDiff")); - for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + for (auto i = 0; i < fPtAxis->GetNbins(); i++) oba->Add(new TNamed(Form("ChFull24_pt_%i", i + 1), "ChFull24_pTDiff")); oba->Add(new TNamed("Ch04Gap22", "Ch04Gap22")); oba->Add(new TNamed("Ch06Gap22", "Ch06Gap22")); oba->Add(new TNamed("Ch08Gap22", "Ch08Gap22")); oba->Add(new TNamed("Ch10Gap22", "Ch10Gap22")); - for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + for (auto i = 0; i < fPtAxis->GetNbins(); i++) oba->Add(new TNamed(Form("Ch10Gap22_pt_%i", i + 1), "Ch10Gap22_pTDiff")); oba->Add(new TNamed("Ch12Gap22", "Ch12Gap22")); oba->Add(new TNamed("Ch04Gap32", "Ch04Gap32")); oba->Add(new TNamed("Ch06Gap32", "Ch06Gap32")); oba->Add(new TNamed("Ch08Gap32", "Ch08Gap32")); oba->Add(new TNamed("Ch10Gap32", "Ch10Gap32")); - for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + for (auto i = 0; i < fPtAxis->GetNbins(); i++) oba->Add(new TNamed(Form("Ch10Gap32_pt_%i", i + 1), "Ch10Gap32_pTDiff")); oba->Add(new TNamed("Ch12Gap32", "Ch12Gap32")); oba->Add(new TNamed("Ch04Gap42", "Ch04Gap42")); oba->Add(new TNamed("Ch06Gap42", "Ch06Gap42")); oba->Add(new TNamed("Ch08Gap42", "Ch08Gap42")); oba->Add(new TNamed("Ch10Gap42", "Ch10Gap42")); - for (Int_t i = 0; i < fPtAxis->GetNbins(); i++) + for (auto i = 0; i < fPtAxis->GetNbins(); i++) oba->Add(new TNamed(Form("Ch10Gap42_pt_%i", i + 1), "Ch10Gap42_pTDiff")); oba->Add(new TNamed("Ch12Gap42", "Ch12Gap42")); oba->Add(new TNamed("ChFull422", "ChFull422")); @@ -292,11 +294,11 @@ struct FlowTask { oba->Add(new TNamed("Ch10Gap3232", "Ch10Gap3232")); oba->Add(new TNamed("Ch10Gap4242", "Ch10Gap4242")); oba->Add(new TNamed("Ch10Gap24", "Ch10Gap24")); - std::vector UserDefineGFWCorr = cfgUserDefineGFWCorr; - std::vector UserDefineGFWName = cfgUserDefineGFWName; - if (!UserDefineGFWCorr.empty() && !UserDefineGFWName.empty()) { - for (uint i = 0; i < UserDefineGFWName.size(); i++) { - oba->Add(new TNamed(UserDefineGFWName.at(i).c_str(), UserDefineGFWName.at(i).c_str())); + std::vector userDefineGFWCorr = cfgUserDefineGFWCorr; + std::vector userDefineGFWName = cfgUserDefineGFWName; + if (!userDefineGFWCorr.empty() && !userDefineGFWName.empty()) { + for (uint i = 0; i < userDefineGFWName.size(); i++) { + oba->Add(new TNamed(userDefineGFWName.at(i).c_str(), userDefineGFWName.at(i).c_str())); } } fFC->SetName("FlowContainer"); @@ -371,16 +373,16 @@ struct FlowTask { corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN10 {3 2} refP10 {-3 -2}", "Ch10Gap3232", kFALSE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN10 {4 2} refP10 {-4 -2}", "Ch10Gap4242", kFALSE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN10 {2 2} refP10 {-2 -2}", "Ch10Gap24", kFALSE)); - if (!UserDefineGFWCorr.empty() && !UserDefineGFWName.empty()) { + if (!userDefineGFWCorr.empty() && !userDefineGFWName.empty()) { LOGF(info, "User adding GFW CorrelatorConfig:"); // attentaion: here we follow the index of cfgUserDefineGFWCorr - for (uint i = 0; i < UserDefineGFWCorr.size(); i++) { - if (i >= UserDefineGFWName.size()) { - LOGF(fatal, "The names you provided are more than configurations. UserDefineGFWName.size(): %d > UserDefineGFWCorr.size(): %d", UserDefineGFWName.size(), UserDefineGFWCorr.size()); + for (uint i = 0; i < userDefineGFWCorr.size(); i++) { + if (i >= userDefineGFWName.size()) { + LOGF(fatal, "The names you provided are more than configurations. userDefineGFWName.size(): %d > userDefineGFWCorr.size(): %d", userDefineGFWName.size(), userDefineGFWCorr.size()); break; } - LOGF(info, "%d: %s %s", i, UserDefineGFWCorr.at(i).c_str(), UserDefineGFWName.at(i).c_str()); - corrconfigs.push_back(fGFW->GetCorrelatorConfig(UserDefineGFWCorr.at(i).c_str(), UserDefineGFWName.at(i).c_str(), kFALSE)); + LOGF(info, "%d: %s %s", i, userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str()); + corrconfigs.push_back(fGFW->GetCorrelatorConfig(userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str(), kFALSE)); } } fGFW->CreateRegions(); @@ -418,7 +420,7 @@ struct FlowTask { } template - void FillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); @@ -426,7 +428,7 @@ struct FlowTask { return; if (!corrconf.pTDif) { val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) + if (std::fabs(val) < 1) registry.fill(tarName, cent, val, dnx); return; } @@ -434,7 +436,7 @@ struct FlowTask { } template - void FillpTvnProfile(const GFW::CorrConfig& corrconf, const double& sum_pt, const double& WeffEvent, const ConstStr& vnWeff, const ConstStr& vnpT, const double& cent) + void fillpTvnProfile(const GFW::CorrConfig& corrconf, const double& sum_pt, const double& WeffEvent, const ConstStr& vnWeff, const ConstStr& vnpT, const double& cent) { double meanPt = sum_pt / WeffEvent; double dnx, val; @@ -443,7 +445,7 @@ struct FlowTask { return; if (!corrconf.pTDif) { val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) { + if (std::fabs(val) < 1) { registry.fill(vnWeff, cent, val, dnx * WeffEvent); registry.fill(vnpT, cent, val * meanPt, dnx * WeffEvent); } @@ -452,7 +454,7 @@ struct FlowTask { return; } - void FillpTvnProfile(const GFW::CorrConfig& corrconf, const double& sum_pt, const double& WeffEvent, std::shared_ptr vnWeff, std::shared_ptr vnpT, const double& cent) + void fillpTvnProfile(const GFW::CorrConfig& corrconf, const double& sum_pt, const double& WeffEvent, std::shared_ptr vnWeff, std::shared_ptr vnpT, const double& cent) { double meanPt = sum_pt / WeffEvent; double dnx, val; @@ -461,7 +463,7 @@ struct FlowTask { return; if (!corrconf.pTDif) { val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) { + if (std::fabs(val) < 1) { vnWeff->Fill(cent, val, dnx * WeffEvent); vnpT->Fill(cent, val * meanPt, dnx * WeffEvent); } @@ -470,7 +472,7 @@ struct FlowTask { return; } - void FillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) + void fillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); @@ -478,16 +480,16 @@ struct FlowTask { return; if (!corrconf.pTDif) { val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) + if (std::fabs(val) < 1) fFC->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm); return; } - for (Int_t i = 1; i <= fPtAxis->GetNbins(); i++) { + for (auto i = 1; i <= fPtAxis->GetNbins(); i++) { dnx = fGFW->Calculate(corrconf, i - 1, kTRUE).real(); if (dnx == 0) continue; val = fGFW->Calculate(corrconf, i - 1, kFALSE).real() / dnx; - if (TMath::Abs(val) < 1) + if (std::fabs(val) < 1) fFC->FillProfile(Form("%s_pt_%i", corrconf.Head.c_str(), i), cent, val, dnx, rndm); } return; @@ -569,7 +571,7 @@ struct FlowTask { } // V0A T0A 5 sigma cut - if (cfgEvSelV0AT0ACut && (fabs(collision.multFV0A() - fT0AV0AMean->Eval(collision.multFT0A())) > 5 * fT0AV0ASigma->Eval(collision.multFT0A()))) + if (cfgEvSelV0AT0ACut && (std::fabs(collision.multFV0A() - fT0AV0AMean->Eval(collision.multFT0A())) > 5 * fT0AV0ASigma->Eval(collision.multFT0A()))) return 0; return 1; @@ -592,7 +594,7 @@ struct FlowTask { template bool trackSelected(TTrack track) { - if (cfgCutDCAzPtDepEnabled && (fabs(track.dcaZ()) > (0.004f + 0.013f / track.pt()))) + if (cfgCutDCAzPtDepEnabled && (std::fabs(track.dcaZ()) > (0.004f + 0.013f / track.pt()))) return false; if (cfgTrkSelSwitch) { @@ -603,18 +605,19 @@ struct FlowTask { } template - bool RejectionTPCoverlap(TTrack track, const int field) + bool rejectionTPCoverlap(TTrack track, const int field) { double phimodn = track.phi(); if (field < 0) // for negative polarity field - phimodn = TMath::TwoPi() - phimodn; + phimodn = o2::constants::math::TwoPI - phimodn; if (track.sign() < 0) // for negative charge - phimodn = TMath::TwoPi() - phimodn; + phimodn = o2::constants::math::TwoPI - phimodn; if (phimodn < 0) LOGF(warning, "phi < 0: %g", phimodn); - phimodn += TMath::Pi() / 18.0; // to center gap in the middle - phimodn = fmod(phimodn, TMath::Pi() / 9.0); + float middle = o2::constants::math::TwoPI / 18.0; + phimodn += middle; // to center gap in the middle + phimodn = fmod(phimodn, o2::constants::math::TwoPI / 9.0); registry.fill(HIST("pt_phi_bef"), track.pt(), phimodn); if (cfgRejectionTPCsectorOverlap) { if (phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt())) @@ -641,7 +644,7 @@ struct FlowTask { gCurrentHadronicRate = gHadronicRate[mRunNumber]; } - void process(aodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, aodTracks const& tracks) + void process(AodCollisions::iterator const& collision, aod::BCsWithTimestamps const&, AodTracks const& tracks) { registry.fill(HIST("hEventCount"), 0.5); if (!collision.sel8()) @@ -651,7 +654,7 @@ struct FlowTask { registry.fill(HIST("hEventCount"), 1.5); auto bc = collision.bc_as(); int currentRunNumber = bc.runNumber(); - for (auto& ExcludedRun : cfgRunRemoveList.value) { + for (const auto& ExcludedRun : cfgRunRemoveList.value) { if (currentRunNumber == ExcludedRun) { return; } @@ -670,7 +673,7 @@ struct FlowTask { if (cfgUseAdditionalEventCut && !eventSelected(collision, tracks.size(), cent)) return; registry.fill(HIST("hEventCount"), 3.5); - float l_Random = fRndm->Rndm(); + float lRandom = fRndm->Rndm(); float vtxz = collision.posZ(); registry.fill(HIST("hVtxZ"), vtxz); registry.fill(HIST("hMult"), tracks.size()); @@ -702,29 +705,29 @@ struct FlowTask { float weff = 1, wacc = 1; double weffEvent = 0; double ptSum = 0., ptSum_Gap08 = 0.; - double weffEvent_WithinGap08 = 0., weffEventSquare_WithinGap08 = 0.; - double sum_ptSquare_wSquare_WithinGap08 = 0., sum_pt_wSquare_WithinGap08 = 0.; - int Magnetfield = 0; - double NTracksCorrected = 0; + double weffEventWithinGap08 = 0., weffEventSquareWithinGap08 = 0.; + double sumptSquarewSquareWithinGap08 = 0., sumptwSquareWithinGap08 = 0.; + int magnetfield = 0; + double nTracksCorrected = 0; if (cfgShowTPCsectorOverlap) { // magnet field dependence cut - Magnetfield = getMagneticField(bc.timestamp()); + magnetfield = getMagneticField(bc.timestamp()); } float independent = cent; if (cfgUseNch) independent = static_cast(tracks.size()); - for (auto& track : tracks) { + for (const auto& track : tracks) { if (!trackSelected(track)) continue; - if (cfgShowTPCsectorOverlap && !RejectionTPCoverlap(track, Magnetfield)) + if (cfgShowTPCsectorOverlap && !rejectionTPCoverlap(track, magnetfield)) continue; - bool WithinPtPOI = (cfgCutPtPOIMin < track.pt()) && (track.pt() < cfgCutPtPOIMax); // within POI pT range - bool WithinPtRef = (cfgCutPtRefMin < track.pt()) && (track.pt() < cfgCutPtRefMax); // within RF pT range - bool WithinEtaGap08 = (track.eta() >= -0.4) && (track.eta() <= 0.4); + bool withinPtPOI = (cfgCutPtPOIMin < track.pt()) && (track.pt() < cfgCutPtPOIMax); // within POI pT range + bool withinPtRef = (cfgCutPtRefMin < track.pt()) && (track.pt() < cfgCutPtRefMax); // within RF pT range + bool withinEtaGap08 = (track.eta() >= -0.4) && (track.eta() <= 0.4); if (cfgOutputNUAWeights) { if (cfgOutputNUAWeightsRefPt) { - if (WithinPtRef) + if (withinPtRef) fWeights->Fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0); } else { fWeights->Fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0); @@ -733,7 +736,7 @@ struct FlowTask { if (!setCurrentParticleWeights(weff, wacc, track.phi(), track.eta(), track.pt(), vtxz)) continue; registry.fill(HIST("hPt"), track.pt()); - if (WithinPtRef) { + if (withinPtRef) { registry.fill(HIST("hPhi"), track.phi()); registry.fill(HIST("hPhiWeighted"), track.phi(), wacc); registry.fill(HIST("hEta"), track.eta()); @@ -746,65 +749,65 @@ struct FlowTask { registry.fill(HIST("hDCAxy"), track.dcaXY(), track.pt()); weffEvent += weff; ptSum += weff * track.pt(); - NTracksCorrected += weff; - if (WithinEtaGap08) { + nTracksCorrected += weff; + if (withinEtaGap08) { ptSum_Gap08 += weff * track.pt(); - sum_pt_wSquare_WithinGap08 += weff * weff * track.pt(); - sum_ptSquare_wSquare_WithinGap08 += weff * weff * track.pt() * track.pt(); - weffEvent_WithinGap08 += weff; - weffEventSquare_WithinGap08 += weff * weff; + sumptwSquareWithinGap08 += weff * weff * track.pt(); + sumptSquarewSquareWithinGap08 += weff * weff * track.pt() * track.pt(); + weffEventWithinGap08 += weff; + weffEventSquareWithinGap08 += weff * weff; } } - if (WithinPtRef) + if (withinPtRef) fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 1); - if (WithinPtPOI) + if (withinPtPOI) fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 2); - if (WithinPtPOI && WithinPtRef) + if (withinPtPOI && withinPtRef) fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 4); } - registry.fill(HIST("hTrackCorrection2d"), tracks.size(), NTracksCorrected); + registry.fill(HIST("hTrackCorrection2d"), tracks.size(), nTracksCorrected); if (!cfgUseSmallMemory) { - double WeffEvent_diff_WithGap08 = weffEvent_WithinGap08 * weffEvent_WithinGap08 - weffEventSquare_WithinGap08; + double weffEventDiffWithGap08 = weffEventWithinGap08 * weffEventWithinGap08 - weffEventSquareWithinGap08; // Filling TProfile // MeanPt if (weffEvent > 1e-6) registry.fill(HIST("hMeanPt"), independent, ptSum / weffEvent, weffEvent); - if (weffEvent_WithinGap08 > 1e-6) - registry.fill(HIST("hMeanPtWithinGap08"), independent, ptSum_Gap08 / weffEvent_WithinGap08, weffEvent_WithinGap08); + if (weffEventWithinGap08 > 1e-6) + registry.fill(HIST("hMeanPtWithinGap08"), independent, ptSum_Gap08 / weffEventWithinGap08, weffEventWithinGap08); // v22-Pt // c22_gap8 * pt_withGap8 - if (weffEvent_WithinGap08 > 1e-6) - FillpTvnProfile(corrconfigs.at(7), ptSum_Gap08, weffEvent_WithinGap08, HIST("c22_gap08_Weff"), HIST("c22_gap08_trackMeanPt"), independent); + if (weffEventWithinGap08 > 1e-6) + fillpTvnProfile(corrconfigs.at(7), ptSum_Gap08, weffEventWithinGap08, HIST("c22_gap08_Weff"), HIST("c22_gap08_trackMeanPt"), independent); // PtVariance - if (WeffEvent_diff_WithGap08 > 1e-6) { + if (weffEventDiffWithGap08 > 1e-6) { registry.fill(HIST("PtVariance_partA_WithinGap08"), independent, - (ptSum_Gap08 * ptSum_Gap08 - sum_ptSquare_wSquare_WithinGap08) / WeffEvent_diff_WithGap08, - WeffEvent_diff_WithGap08); + (ptSum_Gap08 * ptSum_Gap08 - sumptSquarewSquareWithinGap08) / weffEventDiffWithGap08, + weffEventDiffWithGap08); registry.fill(HIST("PtVariance_partB_WithinGap08"), independent, - (weffEvent_WithinGap08 * ptSum_Gap08 - sum_pt_wSquare_WithinGap08) / WeffEvent_diff_WithGap08, - WeffEvent_diff_WithGap08); + (weffEventWithinGap08 * ptSum_Gap08 - sumptwSquareWithinGap08) / weffEventDiffWithGap08, + weffEventDiffWithGap08); } // Filling Bootstrap Samples - int SampleIndex = static_cast(cfgNbootstrap * l_Random); - if (weffEvent_WithinGap08 > 1e-6) - BootstrapArray[SampleIndex][kMeanPt_InGap08]->Fill(independent, ptSum_Gap08 / weffEvent_WithinGap08, weffEvent_WithinGap08); - if (weffEvent_WithinGap08 > 1e-6) - FillpTvnProfile(corrconfigs.at(7), ptSum_Gap08, weffEvent_WithinGap08, BootstrapArray[SampleIndex][kC22_Gap08_Weff], BootstrapArray[SampleIndex][kC22_Gap08_MeanPt], independent); - if (WeffEvent_diff_WithGap08 > 1e-6) { - BootstrapArray[SampleIndex][kPtVarParA_InGap08]->Fill(independent, - (ptSum_Gap08 * ptSum_Gap08 - sum_ptSquare_wSquare_WithinGap08) / WeffEvent_diff_WithGap08, - WeffEvent_diff_WithGap08); - BootstrapArray[SampleIndex][kPtVarParB_InGap08]->Fill(independent, - (weffEvent_WithinGap08 * ptSum_Gap08 - sum_pt_wSquare_WithinGap08) / WeffEvent_diff_WithGap08, - WeffEvent_diff_WithGap08); + int sampleIndex = static_cast(cfgNbootstrap * lRandom); + if (weffEventWithinGap08 > 1e-6) + bootstrapArray[sampleIndex][kMeanPt_InGap08]->Fill(independent, ptSum_Gap08 / weffEventWithinGap08, weffEventWithinGap08); + if (weffEventWithinGap08 > 1e-6) + fillpTvnProfile(corrconfigs.at(7), ptSum_Gap08, weffEventWithinGap08, bootstrapArray[sampleIndex][kC22_Gap08_Weff], bootstrapArray[sampleIndex][kC22_Gap08_MeanPt], independent); + if (weffEventDiffWithGap08 > 1e-6) { + bootstrapArray[sampleIndex][kPtVarParA_InGap08]->Fill(independent, + (ptSum_Gap08 * ptSum_Gap08 - sumptSquarewSquareWithinGap08) / weffEventDiffWithGap08, + weffEventDiffWithGap08); + bootstrapArray[sampleIndex][kPtVarParB_InGap08]->Fill(independent, + (weffEventWithinGap08 * ptSum_Gap08 - sumptwSquareWithinGap08) / weffEventDiffWithGap08, + weffEventDiffWithGap08); } } // Filling Flow Container for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) { - FillFC(corrconfigs.at(l_ind), independent, l_Random); + fillFC(corrconfigs.at(l_ind), independent, lRandom); } } }; From 012be7b5c81f306ca61d340fcd198b9fc6b0aa83 Mon Sep 17 00:00:00 2001 From: rolavick Date: Wed, 18 Dec 2024 18:27:07 +0100 Subject: [PATCH 434/459] [PWGUD] Update of personal task (#9047) Co-authored-by: ALICE Action Bot --- PWGUD/Core/UPCTauCentralBarrelHelperRL.h | 10 ++- PWGUD/Tasks/upcTauCentralBarrelRL.cxx | 98 +++++++++++++++++------- 2 files changed, 80 insertions(+), 28 deletions(-) diff --git a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h index a6147089ecc..fea30eb54a6 100644 --- a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h +++ b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h @@ -206,16 +206,22 @@ float rapidity(float mass, float px, float py, float pz) return 0.5 * std::log((energy(mass, px, py, pz) + pz) / (energy(mass, px, py, pz) - pz)); } -double calculateAcoplanarity(double phi_trk1, double phi_trk2) +double calculateAcoplanarity(double phiTrk1, double phiTrk2) // Function to calculate acoplanarity of two tracks based on phi of both tracks, which is in interval (0,2*pi) { - double aco = std::abs(phi_trk1 - phi_trk2); + double aco = std::abs(phiTrk1 - phiTrk2); if (aco <= o2::constants::math::PI) return aco; else return (o2::constants::math::TwoPI - aco); } +double calculateCollinearity(double etaTrk1, double etaTrk2, double phiTrk1, double phiTrk2) +// Function to calculate deltaR(trk1,trk2) = sqrt(deltaEta^2+deltaPhi^2) +{ + return std::sqrt(etaTrk1 * etaTrk2 + phiTrk1 * phiTrk2); +} + template int countPhysicalPrimary(Ps particles) // Function to loop over particles associated to a mcCollision and return total of physical primary particles diff --git a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx index 9bb0e7a16db..6d3261ec746 100644 --- a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx +++ b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx @@ -69,11 +69,11 @@ struct UpcTauCentralBarrelRL { struct : ConfigurableGroup { Configurable whichGapSide{"whichGapSide", 2, {"0 for side A, 1 for side C, 2 for both sides"}}; Configurable useTrueGap{"useTrueGap", true, {"Calculate gapSide for a given FV0/FT0/ZDC thresholds"}}; - Configurable cutTrueGapSideFV0{"TrueGapFV0", 100, "FV0A threshold for SG selector"}; - Configurable cutTrueGapSideFT0A{"TrueGapFT0A", 200., "FT0A threshold for SG selector"}; - Configurable cutTrueGapSideFT0C{"TrueGapFT0C", 100., "FT0C threshold for SG selector"}; - Configurable cutTrueGapSideZDC{"TrueGapZDC", 1000., "ZDC threshold for SG selector"}; - Configurable cutFITtime{"cutFITtime", 40., "Maximum FIT time allowed. Default is 4ns"}; + Configurable cutTrueGapSideFV0{"TrueGapFV0", -1, "FV0A threshold for SG selector"}; + Configurable cutTrueGapSideFT0A{"TrueGapFT0A", 150., "FT0A threshold for SG selector"}; + Configurable cutTrueGapSideFT0C{"TrueGapFT0C", 50., "FT0C threshold for SG selector"}; + Configurable cutTrueGapSideZDC{"TrueGapZDC", 0., "ZDC threshold for SG selector. 0 is <1n, 4.2 is <2n, 6.7 is <3n, 9.5 is <4n, 12.5 is <5n"}; + Configurable cutFITtime{"cutFITtime", 40., "Maximum FIT time allowed. Default is 40ns"}; Configurable applyAcceptanceSelection{"applyAcceptanceSelection", false, {"Select events in ALICE CB acceptance set with cutTrackEta"}}; Configurable cutTrackEta{"cutTrackEta", 0.9, "Cut on central barrel track eta in absolute values."}; } cutSample; @@ -101,17 +101,28 @@ struct UpcTauCentralBarrelRL { struct : ConfigurableGroup { Configurable applyTauEventSelection{"applyTauEventSelection", true, {"Select tau event."}}; Configurable cutOppositeCharge{"cutOppositeCharge", true, {"Tracks have opposite charge."}}; - Configurable cutAcoplanarity{"cutAcoplanarity", 4 * o2::constants::math::PI / 5, {"Opening angle of the tracks. What is more goes away."}}; + Configurable cutMaxAcoplanarity{"cutMaxAcoplanarity", 4 * o2::constants::math::PI / 5, {"Opening angle of the tracks. What is more goes away."}}; + Configurable cutMinAcoplanarity{"cutMinAcoplanarity", 2 * o2::constants::math::PI / 5, {"Opening angle of the tracks. What is less goes away."}}; Configurable cutElectronHasTOF{"cutElectronHasTOF", true, {"Electron is required to hit TOF."}}; Configurable cutGoodElectron{"cutGoodElectron", true, {"Select good electron."}}; Configurable cutOutRho{"cutOutRho", false, {"Cut out rho mass under two tracks are pions hypothesis"}}; Configurable cutOnRho{"cutOnRho", false, {"Cut on rho mass under two tracks are pions hypothesis"}}; Configurable cutMinRhoMass{"cutMinRhoMass", 0.6, {"Lower limit on the rho mass region for cut"}}; Configurable cutMaxRhoMass{"cutMaxRhoMass", 0.95, {"Higher limit on the rho mass region for cut"}}; - Configurable cutMinElectronNsigma{"cutMinElectronNsigma", 2.0, {"Upper n sigma cut on el hypo of selected electron. What is more goes away."}}; - Configurable cutMaxElectronNsigma{"cutMaxElectronNsigma", -1.0, {"Lower n sigma cut on el hypo of selected electron. What is less goes away."}}; - Configurable cutMinElectronPiNsigma{"cutMinElectronPiNsigma", -99.0, {"Upper n sigma cut on pi hypo of selected electron. What is less till lower cut goes away."}}; - Configurable cutMaxElectronPiNsigma{"cutMaxElectronPiNsigma", 99.0, {"Lower n sigma cut on pi hypo of selected electron. What is more till upper cut goes away."}}; + Configurable cutMinElectronNsigmaEl{"cutMinElectronNsigmaEl", 2.0, {"Good el hypo in. Upper n sigma cut on el hypo of selected electron. What is more goes away."}}; + Configurable cutMaxElectronNsigmaEl{"cutMaxElectronNsigmaEl", -1.0, {"Good el hypo in. Lower n sigma cut on el hypo of selected electron. What is less goes away."}}; + Configurable cutMinElectronNsigmaPi{"cutMinElectronNsigmaPi", -4.0, {"Good pi hypo out. Lower n sigma cut on pi hypo of selected electron. What is more till upper cut goes away."}}; + Configurable cutMaxElectronNsigmaPi{"cutMaxElectronNsigmaPi", 4.0, {"Good pi hypo out. Upper n sigma cut on pi hypo of selected electron. What is less till lower cut goes away."}}; + Configurable cutMinElectronNsigmaKa{"cutMinElectronNsigmaKa", -4.0, {"Good Ka hypo out. Lower n sigma cut on Ka hypo of selected electron. What is more till upper cut goes away."}}; + Configurable cutMaxElectronNsigmaKa{"cutMaxElectronNsigmaKa", 4.0, {"Good Ka hypo out. Upper n sigma cut on Ka hypo of selected electron. What is less till lower cut goes away."}}; + Configurable cutMinElectronNsigmaPr{"cutMinElectronNsigmaPr", -4.0, {"Good Pr hypo out. Lower n sigma cut on Pr hypo of selected electron. What is more till upper cut goes away."}}; + Configurable cutMaxElectronNsigmaPr{"cutMaxElectronNsigmaPr", 4.0, {"Good Pr hypo out. Upper n sigma cut on Pr hypo of selected electron. What is less till lower cut goes away."}}; + Configurable cutPionHasTOF{"cutPionHasTOF", true, {"Pion is required to hit TOF."}}; + Configurable cutGoodMupion{"cutGoodMupion", true, {"Select good muon/pion."}}; + Configurable cutMinPionNsigmaPi{"cutMinPionNsigmaPi", 4.0, {"Good pi hypo in. Upper n sigma cut on pi hypo of selected electron. What is more goes away."}}; + Configurable cutMaxPionNsigmaPi{"cutMaxPionNsigmaPi", -4.0, {"Good pi hypo in. Lower n sigma cut on pi hypo of selected electron. What is less goes away."}}; + Configurable cutMinPionNsigmaKa{"cutMinPionNsigmaKa", -4.0, {"Good Ka hypo out. Lower n sigma cut on Ka hypo of selected electron. What is more till upper cut goes away."}}; + Configurable cutMaxPionNsigmaKa{"cutMaxPionNsigmaKa", 4.0, {"Good Ka hypo out. Upper n sigma cut on Ka hypo of selected electron. What is less till lower cut goes away."}}; } cutTauEvent; struct : ConfigurableGroup { @@ -135,7 +146,9 @@ struct UpcTauCentralBarrelRL { ConfigurableAxis axisModPhi{"axisModPhi", {400, 0., .4}, "Track fmod(#phi,#pi/9)"}; ConfigurableAxis axisEta{"axisEta", {50, -1.2, 1.2}, "Pseudorapidity (a.u.)"}; ConfigurableAxis axisRap{"axisRap", {50, -1.2, 1.2}, "Rapidity (a.u.)"}; + ConfigurableAxis axisFraction{"axisFraction", {500, 0., 1.}, "Fraction (-)"}; ConfigurableAxis axisAcoplanarity{"axisAcoplanarity", {32, 0.0, o2::constants::math::PI}, "Acoplanarity (rad)"}; + ConfigurableAxis axisCollinearity{"axisCollinearity", {200, 0, 20}, "Collinearity (-)"}; ConfigurableAxis axisTPCdEdx{"axisTPCdEdx", {2000, 0., 200.}, "TPC dE/dx (a.u.)"}; ConfigurableAxis axisTOFsignal{"axisTOFsignal", {2500, -10000., 40000.}, "TOF signal (a.u.)"}; ConfigurableAxis axisNsigma{"axisNsigma", {200, -10., 10.}, "n sigma"}; @@ -342,6 +355,7 @@ struct UpcTauCentralBarrelRL { histos.add("EventTwoTracks/hInvariantMassWideAllPionMassPtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); histos.add("EventTwoTracks/hInvariantMassWideAllPionMassTOF", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); histos.add("EventTwoTracks/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); + histos.add("EventTwoTracks/hCollinearity", ";#DeltaR (-);Number of events (-)", HistType::kTH1D, {confAxis.axisCollinearity}); histos.add("EventTwoTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); histos.add("EventTwoTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); histos.add("EventTwoTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); @@ -353,6 +367,7 @@ struct UpcTauCentralBarrelRL { histos.add("EventTwoTracks/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); histos.add("EventTwoTracks/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); histos.add("EventTwoTracks/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/hDaughtersEnergyFractions", ";E_{daughter 1} / E_{tot} (-);E_{daughter 1} / E_{tot} (-)", HistType::kTH2D, {confAxis.axisFraction, confAxis.axisFraction}); histos.add("EventTwoTracks/hDaughtersPvsITSclusterSize", ";Average ITS cluster size;Daughter #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisAvgITSclsSizes, confAxis.axisMomSigned}); histos.add("EventTwoTracks/hDaughtersPvsITSclusterSizeXcos", ";Average ITS cluster size x cos(#lambda);Daughter #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisAvgITSclsSizes, confAxis.axisMomSigned}); histos.add("EventTwoTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); @@ -508,6 +523,7 @@ struct UpcTauCentralBarrelRL { histos.add("EventTwoTracks/ElectronMuPi/PionsSelection/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); histos.add("EventTwoTracks/ElectronMuPi/PionsSelection/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); histos.add("EventTwoTracks/ElectronMuPi/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); + histos.add("EventTwoTracks/ElectronMuPi/hCollinearity", ";#DeltaR (-);Number of events (-)", HistType::kTH1D, {confAxis.axisCollinearity}); histos.add("EventTwoTracks/ElectronMuPi/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); histos.add("EventTwoTracks/ElectronMuPi/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); histos.add("EventTwoTracks/ElectronMuPi/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); @@ -521,6 +537,7 @@ struct UpcTauCentralBarrelRL { histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); histos.add("EventTwoTracks/ElectronMuPi/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); + histos.add("EventTwoTracks/ElectronMuPi/hDaughtersEnergyFractions", ";E_{electron} / E_{tot} (-);E_{#mu/#pi} / E_{tot} (-)", HistType::kTH2D, {confAxis.axisFraction, confAxis.axisFraction}); histos.add("EventTwoTracks/ElectronMuPi/hElectronPvsOtherP", ";Electron #it{p} (GeV/c); #mu/#pi #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); histos.add("EventTwoTracks/ElectronMuPi/hElectronPwideVsOtherPwide", ";Electron #it{p} (GeV/c); #mu/#pi #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); histos.add("EventTwoTracks/ElectronMuPi/hElectronPtVsOtherPt", ";Electron #it{p_{T}} (GeV/c); #mu/#pi #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); @@ -877,9 +894,25 @@ struct UpcTauCentralBarrelRL { { if (cutTauEvent.cutElectronHasTOF && !electronCandidate.hasTOF()) return false; - if (electronCandidate.tpcNSigmaEl() < cutTauEvent.cutMaxElectronNsigma || electronCandidate.tpcNSigmaEl() > cutTauEvent.cutMinElectronNsigma) + if (electronCandidate.tpcNSigmaEl() < cutTauEvent.cutMaxElectronNsigmaEl || electronCandidate.tpcNSigmaEl() > cutTauEvent.cutMinElectronNsigmaEl) return false; - if (electronCandidate.tpcNSigmaPi() > cutTauEvent.cutMaxElectronPiNsigma && electronCandidate.tpcNSigmaPi() < cutTauEvent.cutMinElectronPiNsigma) + if (electronCandidate.tpcNSigmaPi() > cutTauEvent.cutMinElectronNsigmaPi && electronCandidate.tpcNSigmaPi() < cutTauEvent.cutMaxElectronNsigmaPi) + return false; + if (electronCandidate.tpcNSigmaKa() > cutTauEvent.cutMinElectronNsigmaKa && electronCandidate.tpcNSigmaKa() < cutTauEvent.cutMaxElectronNsigmaKa) + return false; + if (electronCandidate.tpcNSigmaPr() > cutTauEvent.cutMinElectronNsigmaPr && electronCandidate.tpcNSigmaPr() < cutTauEvent.cutMaxElectronNsigmaPr) + return false; + return true; + } + + template + bool selectedGoodPion(T const& pionCandidate) + { + if (cutTauEvent.cutPionHasTOF && !pionCandidate.hasTOF()) + return false; + if (pionCandidate.tpcNSigmaPi() < cutTauEvent.cutMaxPionNsigmaPi || pionCandidate.tpcNSigmaPi() > cutTauEvent.cutMinPionNsigmaPi) + return false; + if (pionCandidate.tpcNSigmaKa() > cutTauEvent.cutMinPionNsigmaKa && pionCandidate.tpcNSigmaKa() < cutTauEvent.cutMaxPionNsigmaKa) return false; return true; } @@ -894,13 +927,19 @@ struct UpcTauCentralBarrelRL { pion[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(kPiPlus), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); pion[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kPiMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); motherOfPions = pion[0] + pion[1]; + int enumTrk1 = enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)); if (cutTauEvent.cutOppositeCharge && (trkDaug1.sign() * trkDaug2.sign() > 0)) return false; - if (calculateAcoplanarity(daug[0].Phi(), daug[1].Phi()) > cutTauEvent.cutAcoplanarity) + if (calculateAcoplanarity(daug[0].Phi(), daug[1].Phi()) > cutTauEvent.cutMaxAcoplanarity) + return false; + if (calculateAcoplanarity(daug[0].Phi(), daug[1].Phi()) < cutTauEvent.cutMinAcoplanarity) return false; - bool goodElectron = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? selectedGoodElectron(trkDaug1) : selectedGoodElectron(trkDaug2); + bool goodElectron = (enumTrk1 == P_ELECTRON) ? selectedGoodElectron(trkDaug1) : selectedGoodElectron(trkDaug2); if (cutTauEvent.cutGoodElectron && !goodElectron) return false; + bool goodMupion = ((enumTrk1 == P_MUON) || (enumTrk1 == P_PION)) ? selectedGoodPion(trkDaug1) : selectedGoodPion(trkDaug2); + if (cutTauEvent.cutGoodMupion && !goodMupion) + return false; if (cutTauEvent.cutOutRho && (motherOfPions.M() > cutTauEvent.cutMinRhoMass && motherOfPions.M() < cutTauEvent.cutMaxRhoMass)) return false; if (cutTauEvent.cutOnRho && (motherOfPions.M() > cutTauEvent.cutMaxRhoMass || motherOfPions.M() < cutTauEvent.cutMinRhoMass)) @@ -1020,6 +1059,7 @@ struct UpcTauCentralBarrelRL { muon[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(kMuonMinus), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); motherOfMuons = muon[0] + muon[1]; const auto acoplanarity = calculateAcoplanarity(daug[0].Phi(), daug[1].Phi()); + const auto collinearity = calculateCollinearity(daug[0].Eta(), daug[1].Eta(), daug[0].Phi(), daug[1].Phi()); if (cutTauEvent.applyTauEventSelection && !selectedTauEvent(trkDaug1, trkDaug2)) { return; } @@ -1028,6 +1068,7 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/hInvariantMassWide"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/hInvariantMassWideAllPionMass"))->Fill(motherOfPions.M()); histos.get(HIST("EventTwoTracks/hAcoplanarity"))->Fill(acoplanarity); + histos.get(HIST("EventTwoTracks/hCollinearity"))->Fill(collinearity); histos.get(HIST("EventTwoTracks/hMotherP"))->Fill(mother.P()); histos.get(HIST("EventTwoTracks/hMotherPwide"))->Fill(mother.P()); histos.get(HIST("EventTwoTracks/hMotherPt"))->Fill(mother.Pt()); @@ -1038,6 +1079,7 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/hDaughtersPt"))->Fill(daug[0].Pt(), daug[1].Pt()); histos.get(HIST("EventTwoTracks/hDaughtersPhi"))->Fill(daug[0].Phi(), daug[1].Phi()); histos.get(HIST("EventTwoTracks/hDaughtersRapidity"))->Fill(daug[0].Rapidity(), daug[1].Rapidity()); + histos.get(HIST("EventTwoTracks/hDaughtersEnergyFractions"))->Fill(daug[0].E() / (daug[0].E() + daug[1].E()), daug[1].E() / (daug[0].E() + daug[1].E())); histos.get(HIST("EventTwoTracks/hMotherMassVsPt"))->Fill(mother.M(), mother.Pt()); if (motherOfPions.Pt() < 0.2) { histos.get(HIST("EventTwoTracks/hInvariantMassWideAllPionMassPtCut"))->Fill(motherOfPions.M()); @@ -1213,12 +1255,15 @@ struct UpcTauCentralBarrelRL { } if ((countPVGTelectrons == 1 && countPVGTmuons == 1) || (countPVGTelectrons == 1 && countPVGTpions == 1)) { double electronPt = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); + double electronE = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].E() : daug[1].E(); + double mupionE = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].E() : daug[0].E(); histos.get(HIST("Events/hChannels"))->Fill(CH_EMUPI); histos.get(HIST("EventTwoTracks/ElectronMuPi/hInvariantMass"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hInvariantMassWide"))->Fill(mother.M()); histos.get(HIST("EventTwoTracks/ElectronMuPi/PionsSelection/hInvariantMass"))->Fill(motherOfPions.M()); histos.get(HIST("EventTwoTracks/ElectronMuPi/PionsSelection/hInvariantMassWide"))->Fill(motherOfPions.M()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hAcoplanarity"))->Fill(acoplanarity); + histos.get(HIST("EventTwoTracks/ElectronMuPi/hCollinearity"))->Fill(collinearity); histos.get(HIST("EventTwoTracks/ElectronMuPi/hMotherP"))->Fill(mother.P()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hMotherPwide"))->Fill(mother.P()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hMotherPt"))->Fill(mother.Pt()); @@ -1232,6 +1277,7 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/ElectronMuPi/hDaughtersPt"))->Fill(daug[0].Pt(), daug[1].Pt()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hDaughtersPhi"))->Fill(daug[0].Phi(), daug[1].Phi()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hDaughtersRapidity"))->Fill(daug[0].Rapidity(), daug[1].Rapidity()); + histos.get(HIST("EventTwoTracks/ElectronMuPi/hDaughtersEnergyFractions"))->Fill(electronE / (electronE + mupionE), mupionE / (electronE + mupionE)); histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronPvsOtherP"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].P() : daug[1].P(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].P() : daug[0].P()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronPwideVsOtherPwide"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].P() : daug[1].P(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].P() : daug[0].P()); histos.get(HIST("EventTwoTracks/ElectronMuPi/hElectronPtVsOtherPt"))->Fill((enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(), (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].Pt() : daug[0].Pt()); @@ -1760,18 +1806,18 @@ struct UpcTauCentralBarrelRL { if (!isMC && ((countPVGTelectrons == 1 && countPVGTmuons == 1) || (countPVGTelectrons == 1 && countPVGTpions == 1))) { double electronPt = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); double electronPID = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); - double electronNsigma = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); - double electronPiNsigma = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); + double ElectronNsigmaEl = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); + double ElectronNsigmaPi = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); double otherPt = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); double otherPID = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); double otherNsigmaMu = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaMu() : trkDaug2.tpcNSigmaMu(); double otherNsigmaPi = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsEPofE"))->Fill(electronPt, electronPID); histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsOPofO"))->Fill(otherPt, otherPID); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofE"))->Fill(electronPt, electronNsigma); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofE"))->Fill(electronPt, ElectronNsigmaEl); histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsMPofO"))->Fill(otherPt, otherNsigmaMu); histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPPofO"))->Fill(otherPt, otherNsigmaPi); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofE"))->Fill(electronNsigma, electronPiNsigma); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofE"))->Fill(ElectronNsigmaEl, ElectronNsigmaPi); if (trkDaug1.hasTOF()) { if (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) { histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsEPofE"))->Fill(electronPt, trkDaug1.tofSignal()); @@ -1798,7 +1844,7 @@ struct UpcTauCentralBarrelRL { if ((countPVGTelectrons == 2) || (countPVGTelectrons == 1 && countPVGTmuons == 1) || (countPVGTelectrons == 1 && countPVGTpions == 1)) { double electronPt = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); double electronPID = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); - double electronNsigma = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); + double ElectronNsigmaEl = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); double otherPt = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); double otherPID = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); double otherNsigmaMu = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaMu() : trkDaug2.tpcNSigmaMu(); @@ -1806,7 +1852,7 @@ struct UpcTauCentralBarrelRL { if (countPVGTelectrons == 2) { electronPt = (daug[0].Pt() > daug[1].Pt()) ? daug[0].Pt() : daug[1].Pt(); electronPID = (daug[0].Pt() > daug[1].Pt()) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); - electronNsigma = (daug[0].Pt() > daug[1].Pt()) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); + ElectronNsigmaEl = (daug[0].Pt() > daug[1].Pt()) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); otherPt = (daug[0].Pt() > daug[1].Pt()) ? daug[1].Pt() : daug[0].Pt(); otherPID = (daug[0].Pt() > daug[1].Pt()) ? trkDaug2.tpcSignal() : trkDaug1.tpcSignal(); otherNsigmaMu = (daug[0].Pt() > daug[1].Pt()) ? trkDaug2.tpcNSigmaMu() : trkDaug1.tpcNSigmaMu(); @@ -1814,7 +1860,7 @@ struct UpcTauCentralBarrelRL { } histos.get(HIST("EventTwoTracks/ElectronOther/PID/hTPCsignalVsEP"))->Fill(electronPt, electronPID); histos.get(HIST("EventTwoTracks/ElectronOther/PID/hTPCsignalVsOP"))->Fill(otherPt, otherPID); - histos.get(HIST("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsEP"))->Fill(electronPt, electronNsigma); + histos.get(HIST("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsEP"))->Fill(electronPt, ElectronNsigmaEl); histos.get(HIST("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsMP"))->Fill(otherPt, otherNsigmaMu); histos.get(HIST("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsPP"))->Fill(otherPt, otherNsigmaPi); if (trkDaug1.hasTOF()) { @@ -2023,17 +2069,17 @@ struct UpcTauCentralBarrelRL { double electronPt = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); double electronPID = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); - double electronNsigma = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); - double electronPiNsigma = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); + double ElectronNsigmaEl = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); + double ElectronNsigmaPi = (enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); double otherPt = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[0].Pt() : daug[1].Pt(); double otherPID = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcSignal() : trkDaug2.tpcSignal(); double otherNsigmaEl = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaEl() : trkDaug2.tpcNSigmaEl(); double otherNsigmaMu = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaMu() : trkDaug2.tpcNSigmaMu(); double otherNsigmaPi = (enumMyParticle(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? trkDaug1.tpcNSigmaPi() : trkDaug2.tpcNSigmaPi(); histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsEPofE"))->Fill(electronPt, electronPID); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofE"))->Fill(electronPt, electronNsigma); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPPofE"))->Fill(electronPt, electronPiNsigma); - histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofE"))->Fill(electronNsigma, electronPiNsigma); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofE"))->Fill(electronPt, ElectronNsigmaEl); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPPofE"))->Fill(electronPt, ElectronNsigmaPi); + histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofE"))->Fill(ElectronNsigmaEl, ElectronNsigmaPi); histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsOPofO"))->Fill(otherPt, otherPID); histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofO"))->Fill(otherPt, otherNsigmaEl); histos.get(HIST("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsMPofO"))->Fill(otherPt, otherNsigmaMu); From d9522ecfadbbd2ade6b8c0733a3c888d4bbc1921 Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Wed, 18 Dec 2024 20:30:39 +0100 Subject: [PATCH 435/459] [PWGLF] bug fix for proton PID selection in f1-proton correlation (#9053) --- PWGLF/Tasks/Resonances/f1protoncorrelation.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx index 5348bc46b6b..66344a45442 100644 --- a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx +++ b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx @@ -148,10 +148,10 @@ struct f1protoncorrelation { histos.fill(HIST("hNsigmaPionKaonTPC"), f1track.f1d1TPC(), f1track.f1d2TPC()); for (auto protontrack : protontracks) { Proton.SetXYZM(protontrack.protonPx(), protontrack.protonPy(), protontrack.protonPz(), 0.938); - if (Proton.P() < momentumTOFProton && TMath::Abs(protontrack.protonNsigmaTPC()) > 3) { + if (Proton.P() < momentumTOFProton && TMath::Abs(protontrack.protonNsigmaTPC()) > 2.5) { continue; } - if (Proton.P() >= momentumTOFProton && protontrack.protonTOFHit() != 1 && TMath::Abs(protontrack.protonNsigmaTOF()) > 3) { + if (Proton.P() >= momentumTOFProton && (protontrack.protonTOFHit() != 1 || TMath::Abs(protontrack.protonNsigmaTOF()) > 2.5)) { continue; } if ((f1track.f1PionIndex() == protontrack.f1ProtonIndex()) || (f1track.f1KaonIndex() == protontrack.f1ProtonIndex()) || (f1track.f1KshortPositiveIndex() == protontrack.f1ProtonIndex()) || (f1track.f1KshortNegativeIndex() == protontrack.f1ProtonIndex())) { @@ -255,10 +255,10 @@ struct f1protoncorrelation { continue; } Proton.SetXYZM(t2.protonPx(), t2.protonPy(), t2.protonPz(), 0.938); - if (Proton.P() < momentumTOFProton && TMath::Abs(t2.protonNsigmaTPC()) > 3) { + if (Proton.P() < momentumTOFProton && TMath::Abs(t2.protonNsigmaTPC()) > 2.5) { continue; } - if (Proton.P() >= momentumTOFProton && t2.protonTOFHit() != 1 && TMath::Abs(t2.protonNsigmaTOF()) > 3) { + if (Proton.P() >= momentumTOFProton && (t2.protonTOFHit() != 1 || TMath::Abs(t2.protonNsigmaTOF()) > 2.5)) { continue; } auto relative_momentum = getkstar(F1, Proton); From 981890c4f266bb7cc3f71feeef741497df37e1b3 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore <89481844+giovannimalfattore@users.noreply.github.com> Date: Wed, 18 Dec 2024 21:55:10 +0100 Subject: [PATCH 436/459] [PWGLF] NucleiTask - Add ITS cuts (#9050) --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 479 ++++++++++++++------------ 1 file changed, 252 insertions(+), 227 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index d1f0f3f3977..b8acf8e291d 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -28,6 +28,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/PIDResponseITS.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -96,6 +97,11 @@ struct LFNucleiBATask { Configurable nsigmaTPCAl{"nsigmaTPCAl", 3.f, "Value of the Nsigma TPC cut for alpha"}; } nsigmaTPCvar; + struct : ConfigurableGroup { + Configurable nsigmaITSTr{"nsigmaITSTr", 3.f, "Value of the Nsigma ITS cut for tritons"}; + Configurable nsigmaITSHe{"nsigmaITSHe", 3.f, "Value of the Nsigma ITS cut for helium-3"}; + } nsigmaITSvar; + // Set additional cuts (used for debug) Configurable betaCut{"betaCut", 0.4f, "Value of the beta selection for TOF cut (default 0.4)"}; @@ -108,6 +114,7 @@ struct LFNucleiBATask { ConfigurableAxis binsdEdx{"binsdEdx", {600, 0.f, 3000.f}, ""}; ConfigurableAxis binsBeta{"binsBeta", {120, 0.0, 1.2}, ""}; ConfigurableAxis binsDCA{"binsDCA", {400, -1.f, 1.f}, ""}; + ConfigurableAxis binsSigmaITS{"binsSigmaITS", {1000, -100, 100}, ""}; ConfigurableAxis binsSigmaTPC{"binsSigmaTPC", {1000, -100, 100}, ""}; ConfigurableAxis binsSigmaTOF{"binsSigmaTOF", {1000, -100, 100}, ""}; ConfigurableAxis binsMassPr{"binsMassPr", {100, -1., 1.f}, ""}; @@ -175,11 +182,11 @@ struct LFNucleiBATask { static constexpr int PDGTriton = 1000010030; static constexpr int PDGHelium = 1000020030; static constexpr int PDGAlpha = 1000020040; - static constexpr float fMassProton = 0.938272088f; - static constexpr float fMassDeuteron = 1.87561f; - static constexpr float fMassTriton = 2.80892f; - static constexpr float fMassHelium = 2.80839f; - static constexpr float fMassAlpha = 3.72738f; + static constexpr float MassProtonVal = 0.938272088f; + static constexpr float MassDeuteronVal = 1.87561f; + static constexpr float MassTritonVal = 2.80892f; + static constexpr float MassHeliumVal = 2.80839f; + static constexpr float MassAlphaVal = 3.72738f; void init(o2::framework::InitContext&) { @@ -195,8 +202,9 @@ struct LFNucleiBATask { const AxisSpec massDeAxis{binsMassDe, ""}; const AxisSpec massTrAxis{binsMassTr, ""}; const AxisSpec massHeAxis{binsMassHe, ""}; - const AxisSpec SigmaTPCAxis{binsSigmaTPC, ""}; - const AxisSpec SigmaTOFAxis{binsSigmaTOF, ""}; + const AxisSpec sigmaITSAxis{binsSigmaITS, ""}; + const AxisSpec sigmaTPCAxis{binsSigmaTPC, ""}; + const AxisSpec sigmaTOFAxis{binsSigmaTOF, ""}; if (doprocessData == true && doprocessMCReco == true) { LOG(fatal) << "Can't enable processData and processMCReco in the same time, pick one!"; @@ -1466,36 +1474,42 @@ struct LFNucleiBATask { // NSigmasTPC histograms if (enableDebug) { - debugHistos.add("debug/tracks/pion/h2PionVspTNSigmaTPC", "NSigmaTPC(pi) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/tracks/kaon/h2KaonVspTNSigmaTPC", "NSigmaTPC(Ka) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); + debugHistos.add("debug/tracks/pion/h2PionVspTNSigmaTPC", "NSigmaTPC(pi) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/tracks/kaon/h2KaonVspTNSigmaTPC", "NSigmaTPC(Ka) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); } if (enablePr) { - histos.add("tracks/proton/h2ProtonVspTNSigmaTPC", "NSigmaTPC(p) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - histos.add("tracks/proton/h2antiProtonVspTNSigmaTPC", "NSigmaTPC(#bar{p}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); + histos.add("tracks/proton/h2ProtonVspTNSigmaTPC", "NSigmaTPC(p) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + histos.add("tracks/proton/h2antiProtonVspTNSigmaTPC", "NSigmaTPC(#bar{p}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); } if (enableDe) { if (enableCentrality) { - histos.add("tracks/deuteron/h3DeuteronVspTNSigmaTPCVsMult", "NSigmaTPC(d) vs pT; #it{p}_{T} (GeV/#it{c}) vs mult; NSigmaTPC", HistType::kTH3F, {{ptAxis}, {SigmaTPCAxis}, {binsPercentile}}); - histos.add("tracks/deuteron/h3antiDeuteronVspTNSigmaTPCVsMult", "NSigmaTPC(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}) vs mult; NSigmaTPC", HistType::kTH3F, {{ptAxis}, {SigmaTPCAxis}, {binsPercentile}}); + histos.add("tracks/deuteron/h3DeuteronVspTNSigmaTPCVsMult", "NSigmaTPC(d) vs pT; #it{p}_{T} (GeV/#it{c}) vs mult; NSigmaTPC", HistType::kTH3F, {{ptAxis}, {sigmaTPCAxis}, {binsPercentile}}); + histos.add("tracks/deuteron/h3antiDeuteronVspTNSigmaTPCVsMult", "NSigmaTPC(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}) vs mult; NSigmaTPC", HistType::kTH3F, {{ptAxis}, {sigmaTPCAxis}, {binsPercentile}}); } else { - histos.add("tracks/deuteron/h2DeuteronVspTNSigmaTPC", "NSigmaTPC(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - histos.add("tracks/deuteron/h2antiDeuteronVspTNSigmaTPC", "NSigmaTPC(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - histos.add("tracks/deuteron/h2DeuteronVspTNSigmaTPCTruePrim", "NSigmaTPC(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - histos.add("tracks/deuteron/h2antiDeuteronVspTNSigmaTPCTruePrim", "NSigmaTPC(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); + histos.add("tracks/deuteron/h2DeuteronVspTNSigmaTPC", "NSigmaTPC(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + histos.add("tracks/deuteron/h2antiDeuteronVspTNSigmaTPC", "NSigmaTPC(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + histos.add("tracks/deuteron/h2DeuteronVspTNSigmaTPCTruePrim", "NSigmaTPC(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + histos.add("tracks/deuteron/h2antiDeuteronVspTNSigmaTPCTruePrim", "NSigmaTPC(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); } } if (enableTr) { - histos.add("tracks/triton/h2TritonVspTNSigmaTPC", "NSigmaTPC(t) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - histos.add("tracks/triton/h2antiTritonVspTNSigmaTPC", "NSigmaTPC(#bar{t}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); + // histos.add("tracks/triton/h2TritonVspTNSigmaITS", "NSigmaITS(t) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaITS", HistType::kTH2F, {{ptAxis}, {sigmaITSAxis}}); + // histos.add("tracks/triton/h2antiTritonVspTNSigmaITS", "NSigmaITS(#bar{t}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaITS", HistType::kTH2F, {{ptAxis}, {sigmaITSAxis}}); + + histos.add("tracks/triton/h2TritonVspTNSigmaTPC", "NSigmaTPC(t) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + histos.add("tracks/triton/h2antiTritonVspTNSigmaTPC", "NSigmaTPC(#bar{t}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); } if (enableHe) { - histos.add("tracks/helium/h2HeliumVspTNSigmaTPC", "NSigmaTPC(He) vs pT/z; #it{p}_{T}/z (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptZHeAxis}, {SigmaTPCAxis}}); - histos.add("tracks/helium/h2antiHeliumVspTNSigmaTPC", "NSigmaTPC(#bar{He}) vs pT/z; #it{p}_{T}/z (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptZHeAxis}, {SigmaTPCAxis}}); + histos.add("tracks/helium/h2HeliumVspTNSigmaITS", "NSigmaITS(He) vs pT/z; #it{p}_{T}/z (GeV/#it{c}); NSigmaITS", HistType::kTH2F, {{ptZHeAxis}, {sigmaITSAxis}}); + histos.add("tracks/helium/h2antiHeliumVspTNSigmaITS", "NSigmaITS(#bar{He}) vs pT/z; #it{p}_{T}/z (GeV/#it{c}); NSigmaITS", HistType::kTH2F, {{ptZHeAxis}, {sigmaITSAxis}}); + + histos.add("tracks/helium/h2HeliumVspTNSigmaTPC", "NSigmaTPC(He) vs pT/z; #it{p}_{T}/z (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptZHeAxis}, {sigmaTPCAxis}}); + histos.add("tracks/helium/h2antiHeliumVspTNSigmaTPC", "NSigmaTPC(#bar{He}) vs pT/z; #it{p}_{T}/z (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptZHeAxis}, {sigmaTPCAxis}}); } if (enableAl) { - histos.add("tracks/alpha/h2AlphaVspTNSigmaTPC", "NSigmaTPC(#alpha) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - histos.add("tracks/alpha/h2antiAlphaVspTNSigmaTPC", "NSigmaTPC(#bar{#alpha}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); + histos.add("tracks/alpha/h2AlphaVspTNSigmaTPC", "NSigmaTPC(#alpha) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + histos.add("tracks/alpha/h2antiAlphaVspTNSigmaTPC", "NSigmaTPC(#bar{#alpha}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); } // TOF plots @@ -1541,20 +1555,20 @@ struct LFNucleiBATask { // NSigmaTOF histograms if (enableDebug) { - histos.add("tracks/pion/h2PionVspTNSigmaTOF", "NSigmaTOF(pi) vs #it{p}_{T}; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - histos.add("tracks/kaon/h2KaonVspTNSigmaTOF", "NSigmaTOF(Ka) vs #it{p}_{T}; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); + histos.add("tracks/pion/h2PionVspTNSigmaTOF", "NSigmaTOF(pi) vs #it{p}_{T}; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + histos.add("tracks/kaon/h2KaonVspTNSigmaTOF", "NSigmaTOF(Ka) vs #it{p}_{T}; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); } if (enablePr) { - histos.add("tracks/proton/h2ProtonVspTNSigmaTOF", "NSigmaTOF(p) vs #it{p}_{T}; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - histos.add("tracks/proton/h2antiProtonVspTNSigmaTOF", "NSigmaTOF(#bar{p}) vs #it{p}_{T}; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); + histos.add("tracks/proton/h2ProtonVspTNSigmaTOF", "NSigmaTOF(p) vs #it{p}_{T}; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + histos.add("tracks/proton/h2antiProtonVspTNSigmaTOF", "NSigmaTOF(#bar{p}) vs #it{p}_{T}; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); } if (enableDe) { - histos.add("tracks/deuteron/h2DeuteronVspTNSigmaTOF", "NSigmaTOF(d) vs #it{p}_{T}; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - histos.add("tracks/deuteron/h2antiDeuteronVspTNSigmaTOF", "NSigmaTOF(#bar{d}) vs #it{p}_{T}; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); + histos.add("tracks/deuteron/h2DeuteronVspTNSigmaTOF", "NSigmaTOF(d) vs #it{p}_{T}; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + histos.add("tracks/deuteron/h2antiDeuteronVspTNSigmaTOF", "NSigmaTOF(#bar{d}) vs #it{p}_{T}; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); } if (enableHe) { - histos.add("tracks/helium/h2HeliumVspTNSigmaTOF", "NSigmaTOF(He) vs #it{p}_{T}/z; #it{p}_{T}/z (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptZHeAxis}, {SigmaTOFAxis}}); - histos.add("tracks/helium/h2antiHeliumVspTNSigmaTOF", "NSigmaTOF(#bar{He}) vs #it{p}_{T}/z; #it{p}_{T}/z (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptZHeAxis}, {SigmaTOFAxis}}); + histos.add("tracks/helium/h2HeliumVspTNSigmaTOF", "NSigmaTOF(He) vs #it{p}_{T}/z; #it{p}_{T}/z (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptZHeAxis}, {sigmaTOFAxis}}); + histos.add("tracks/helium/h2antiHeliumVspTNSigmaTOF", "NSigmaTOF(#bar{He}) vs #it{p}_{T}/z; #it{p}_{T}/z (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptZHeAxis}, {sigmaTOFAxis}}); } // TOF mass histograms histos.add("tracks/h2TOFmassVsPt", "h2TOFmassVsPt; TOFmass; #it{p}_{T} (GeV)", HistType::kTH2F, {{180, 0.4, 4.}, {250, 0., 5.}}); @@ -1674,24 +1688,24 @@ struct LFNucleiBATask { // NSigmaTOF histograms - TOF EvTime Splitted if (enablePr) { - evtimeHistos.add("tracks/evtime/fill/proton/h2ProtonVspTNSigmaTOF", "NSigmaTOF(p) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/fill/proton/h2antiProtonVspTNSigmaTOF", "NSigmaTOF(#bar{p}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/tof/proton/h2ProtonVspTNSigmaTOF", "NSigmaTOF(#bar{p}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/tof/proton/h2antiProtonVspTNSigmaTOF", "NSigmaTOF(#bar{p}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/ft0/proton/h2ProtonVspTNSigmaTOF", "NSigmaTOF(p) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/ft0/proton/h2antiProtonVspTNSigmaTOF", "NSigmaTOF(#bar{p}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/ft0tof/proton/h2ProtonVspTNSigmaTOF", "NSigmaTOF(p) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/ft0tof/proton/h2antiProtonVspTNSigmaTOF", "NSigmaTOF(#bar{p}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/fill/proton/h2ProtonVspTNSigmaTOF", "NSigmaTOF(p) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/fill/proton/h2antiProtonVspTNSigmaTOF", "NSigmaTOF(#bar{p}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/tof/proton/h2ProtonVspTNSigmaTOF", "NSigmaTOF(#bar{p}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/tof/proton/h2antiProtonVspTNSigmaTOF", "NSigmaTOF(#bar{p}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/ft0/proton/h2ProtonVspTNSigmaTOF", "NSigmaTOF(p) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/ft0/proton/h2antiProtonVspTNSigmaTOF", "NSigmaTOF(#bar{p}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/ft0tof/proton/h2ProtonVspTNSigmaTOF", "NSigmaTOF(p) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/ft0tof/proton/h2antiProtonVspTNSigmaTOF", "NSigmaTOF(#bar{p}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); } if (enableDe) { - evtimeHistos.add("tracks/evtime/fill/deuteron/h2DeuteronVspTNSigmaTOF", "NSigmaTOF(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/fill/deuteron/h2antiDeuteronVspTNSigmaTOF", "NSigmaTOF(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/tof/deuteron/h2DeuteronVspTNSigmaTOF", "NSigmaTOF(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/tof/deuteron/h2antiDeuteronVspTNSigmaTOF", "NSigmaTOF(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/ft0/deuteron/h2DeuteronVspTNSigmaTOF", "NSigmaTOF(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/ft0/deuteron/h2antiDeuteronVspTNSigmaTOF", "NSigmaTOF(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/ft0tof/deuteron/h2DeuteronVspTNSigmaTOF", "NSigmaTOF(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - evtimeHistos.add("tracks/evtime/ft0tof/deuteron/h2antiDeuteronVspTNSigmaTOF", "NSigmaTOF(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/fill/deuteron/h2DeuteronVspTNSigmaTOF", "NSigmaTOF(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/fill/deuteron/h2antiDeuteronVspTNSigmaTOF", "NSigmaTOF(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/tof/deuteron/h2DeuteronVspTNSigmaTOF", "NSigmaTOF(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/tof/deuteron/h2antiDeuteronVspTNSigmaTOF", "NSigmaTOF(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/ft0/deuteron/h2DeuteronVspTNSigmaTOF", "NSigmaTOF(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/ft0/deuteron/h2antiDeuteronVspTNSigmaTOF", "NSigmaTOF(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/ft0tof/deuteron/h2DeuteronVspTNSigmaTOF", "NSigmaTOF(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + evtimeHistos.add("tracks/evtime/ft0tof/deuteron/h2antiDeuteronVspTNSigmaTOF", "NSigmaTOF(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); } // NSigmaTPC vs NSigmaTOF histograms - TOF EvTime Splitted @@ -1761,46 +1775,46 @@ struct LFNucleiBATask { // Beta < 0.5 // NSigmasTPC histograms if (enablePr) { - debugHistos.add("debug/evtime/fill/proton/h2ProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/fill/proton/h2antiProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/tof/proton/h2ProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/tof/proton/h2antiProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/ft0/proton/h2ProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/ft0/proton/h2antiProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/ft0tof/proton/h2ProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/ft0tof/proton/h2antiProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); + debugHistos.add("debug/evtime/fill/proton/h2ProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/fill/proton/h2antiProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/tof/proton/h2ProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/tof/proton/h2antiProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/ft0/proton/h2ProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/ft0/proton/h2antiProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/ft0tof/proton/h2ProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/ft0tof/proton/h2antiProtonVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); } if (enableDe) { - debugHistos.add("debug/evtime/fill/deuteron/h2DeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/fill/deuteron/h2antiDeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/tof/deuteron/h2DeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/tof/deuteron/h2antiDeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/ft0/deuteron/h2DeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/ft0/deuteron/h2antiDeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/ft0tof/deuteron/h2DeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); - debugHistos.add("debug/evtime/ft0tof/deuteron/h2antiDeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {SigmaTPCAxis}}); + debugHistos.add("debug/evtime/fill/deuteron/h2DeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/fill/deuteron/h2antiDeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/tof/deuteron/h2DeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/tof/deuteron/h2antiDeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/ft0/deuteron/h2DeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/ft0/deuteron/h2antiDeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/ft0tof/deuteron/h2DeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + debugHistos.add("debug/evtime/ft0tof/deuteron/h2antiDeuteronVspTNSigmaTPC_BetaCut", "NSigmaTPC(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); } // NSigmaTOF histograms - TOF EvTime Splitted if (enablePr) { - debugHistos.add("debug/evtime/fill/proton/h2ProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/fill/proton/h2antiProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/tof/proton/h2ProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/tof/proton/h2antiProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/ft0/proton/h2ProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/ft0/proton/h2antiProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/ft0tof/proton/h2ProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/ft0tof/proton/h2antiProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); + debugHistos.add("debug/evtime/fill/proton/h2ProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/fill/proton/h2antiProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/tof/proton/h2ProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/tof/proton/h2antiProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/ft0/proton/h2ProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/ft0/proton/h2antiProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/ft0tof/proton/h2ProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(p) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/ft0tof/proton/h2antiProtonVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{p}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); } if (enableDe) { - debugHistos.add("debug/evtime/fill/deuteron/h2DeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/fill/deuteron/h2antiDeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/tof/deuteron/h2DeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/tof/deuteron/h2antiDeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/ft0/deuteron/h2DeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/ft0/deuteron/h2antiDeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/ft0tof/deuteron/h2DeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); - debugHistos.add("debug/evtime/ft0tof/deuteron/h2antiDeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {SigmaTOFAxis}}); + debugHistos.add("debug/evtime/fill/deuteron/h2DeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/fill/deuteron/h2antiDeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/tof/deuteron/h2DeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/tof/deuteron/h2antiDeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/ft0/deuteron/h2DeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/ft0/deuteron/h2antiDeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/ft0tof/deuteron/h2DeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(d) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); + debugHistos.add("debug/evtime/ft0tof/deuteron/h2antiDeuteronVspTNSigmaTOF_BetaCut", "NSigmaTOF(#bar{d}) vs pT (#beta < 0.5); #it{p}_{T} (GeV/#it{c}); NSigmaTOF", HistType::kTH2F, {{ptAxis}, {sigmaTOFAxis}}); } if (outFlagOptions.enableExpSignalTOF) { @@ -2020,12 +2034,12 @@ struct LFNucleiBATask { } float gamma = 0., massTOF = 0., massTOFhe = 0., massTOFantihe = 0., heTPCmomentum = 0.f, antiheTPCmomentum = 0.f, heP = 0.f, antiheP = 0.f, hePt = 0.f, antihePt = 0.f, antiDPt = 0.f, DPt = 0.f; - bool isTritonTPCpid = kFALSE; - bool prRapCut = kFALSE; - bool deRapCut = kFALSE; - bool trRapCut = kFALSE; - bool heRapCut = kFALSE; - bool alRapCut = kFALSE; + bool isTritonTPCpid = false; + bool prRapCut = false; + bool deRapCut = false; + bool trRapCut = false; + bool heRapCut = false; + bool alRapCut = false; // Event histos fill histos.fill(HIST("event/h1VtxZ"), event.posZ()); @@ -2037,7 +2051,10 @@ struct LFNucleiBATask { debugHistos.fill(HIST("event/hFV0M"), event.centFV0M()); } - for (auto& track : tracks) { + auto tracksWithITS = soa::Attach(tracks); + + for (auto& track : tracksWithITS) { histos.fill(HIST("tracks/h1pT"), track.pt()); histos.fill(HIST("tracks/h1p"), track.p()); @@ -2126,6 +2143,9 @@ struct LFNucleiBATask { break; } + // float nITSTr; + float nITSHe; + heP = track.p(); antiheP = track.p(); heTPCmomentum = track.tpcInnerParam(); @@ -2134,55 +2154,55 @@ struct LFNucleiBATask { auto parDCAxy = (std::vector)parDCAxycuts; auto parDCAz = (std::vector)parDCAzcuts; - bool passDCAxyCut = kFALSE; - bool passDCAzCut = kFALSE; - bool passDCAxyCutDe = kFALSE; - bool passDCAzCutDe = kFALSE; - bool passDCAxyCutAntiDe = kFALSE; - bool passDCAzCutAntiDe = kFALSE; - bool passDCAxyCutHe = kFALSE; - bool passDCAzCutHe = kFALSE; - bool passDCAxyCutAntiHe = kFALSE; - bool passDCAzCutAntiHe = kFALSE; - - bool isDeuteron = kFALSE; - bool isHelium = kFALSE; - bool isDe = kFALSE; - bool isAntiDe = kFALSE; - bool isHe = kFALSE; - bool isAntiHe = kFALSE; - - bool isDeWoDCAxy = kFALSE; - bool isAntiDeWoDCAxy = kFALSE; - bool isHeWoDCAxy = kFALSE; - bool isAntiHeWoDCAxy = kFALSE; - - bool isDeWoDCAz = kFALSE; - bool isAntiDeWoDCAz = kFALSE; - bool isHeWoDCAz = kFALSE; - bool isAntiHeWoDCAz = kFALSE; - - bool isDeWoDCAxyWTPCpid = kFALSE; - bool isAntiDeWoDCAxyWTPCpid = kFALSE; - bool isHeWoDCAxyWTPCpid = kFALSE; - bool isAntiHeWoDCAxyWTPCpid = kFALSE; - - bool isDeWoDCAzWTPCpid = kFALSE; - bool isAntiDeWoDCAzWTPCpid = kFALSE; - bool isHeWoDCAzWTPCpid = kFALSE; - bool isAntiHeWoDCAzWTPCpid = kFALSE; - - bool isDeWoTPCpid = kFALSE; - bool isAntiDeWoTPCpid = kFALSE; - bool isHeWoTPCpid = kFALSE; - bool isAntiHeWoTPCpid = kFALSE; - - bool isDeWTPCpid = kFALSE; - bool isAntiDeWTPCpid = kFALSE; - bool isHeWTPCpid = kFALSE; - bool isAntiHeWTPCpid = kFALSE; - - bool passDCAxyzCut = kFALSE; + bool passDCAxyCut = false; + bool passDCAzCut = false; + bool passDCAxyCutDe = false; + bool passDCAzCutDe = false; + bool passDCAxyCutAntiDe = false; + bool passDCAzCutAntiDe = false; + bool passDCAxyCutHe = false; + bool passDCAzCutHe = false; + bool passDCAxyCutAntiHe = false; + bool passDCAzCutAntiHe = false; + + bool isDeuteron = false; + bool isHelium = false; + bool isDe = false; + bool isAntiDe = false; + bool isHe = false; + bool isAntiHe = false; + + bool isDeWoDCAxy = false; + bool isAntiDeWoDCAxy = false; + bool isHeWoDCAxy = false; + bool isAntiHeWoDCAxy = false; + + bool isDeWoDCAz = false; + bool isAntiDeWoDCAz = false; + bool isHeWoDCAz = false; + bool isAntiHeWoDCAz = false; + + bool isDeWoDCAxyWTPCpid = false; + bool isAntiDeWoDCAxyWTPCpid = false; + bool isHeWoDCAxyWTPCpid = false; + bool isAntiHeWoDCAxyWTPCpid = false; + + bool isDeWoDCAzWTPCpid = false; + bool isAntiDeWoDCAzWTPCpid = false; + bool isHeWoDCAzWTPCpid = false; + bool isAntiHeWoDCAzWTPCpid = false; + + bool isDeWoTPCpid = false; + bool isAntiDeWoTPCpid = false; + bool isHeWoTPCpid = false; + bool isAntiHeWoTPCpid = false; + + bool isDeWTPCpid = false; + bool isAntiDeWTPCpid = false; + bool isHeWTPCpid = false; + bool isAntiHeWTPCpid = false; + + bool passDCAxyzCut = false; switch (dcaConfOptions.DCACustomConfig) { case 0: @@ -2200,79 +2220,79 @@ struct LFNucleiBATask { passDCAzCutAntiHe = (std::abs(track.dcaZ()) <= dcaConfOptions.DCAzCustomCut); break; case 1: - passDCAxyCut = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(track.pt(), parDCAxy[2]))); - passDCAzCut = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(track.pt(), parDCAz[2]))); - - passDCAxyCutDe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(DPt, parDCAxy[2]))); - passDCAzCutDe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(DPt, parDCAz[2]))); - passDCAxyCutAntiDe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(antiDPt, parDCAxy[2]))); - passDCAzCutAntiDe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(antiDPt, parDCAz[2]))); - - passDCAxyCutHe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(hePt, parDCAxy[2]))); - passDCAzCutHe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(hePt, parDCAz[2]))); - passDCAxyCutAntiHe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(antihePt, parDCAxy[2]))); - passDCAzCutAntiHe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(antihePt, parDCAz[2]))); + passDCAxyCut = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(track.pt(), parDCAxy[2]))); + passDCAzCut = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(track.pt(), parDCAz[2]))); + + passDCAxyCutDe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(DPt, parDCAxy[2]))); + passDCAzCutDe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(DPt, parDCAz[2]))); + passDCAxyCutAntiDe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(antiDPt, parDCAxy[2]))); + passDCAzCutAntiDe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(antiDPt, parDCAz[2]))); + + passDCAxyCutHe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(hePt, parDCAxy[2]))); + passDCAzCutHe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(hePt, parDCAz[2]))); + passDCAxyCutAntiHe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(antihePt, parDCAxy[2]))); + passDCAzCutAntiHe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(antihePt, parDCAz[2]))); break; case 2: - passDCAxyCut = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(track.pt(), parDCAxy[2]))); + passDCAxyCut = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(track.pt(), parDCAxy[2]))); passDCAzCut = (std::abs(track.dcaZ()) <= dcaConfOptions.DCAzCustomCut); - passDCAxyCutDe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(DPt, parDCAxy[2]))); + passDCAxyCutDe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(DPt, parDCAxy[2]))); passDCAzCutDe = (std::abs(track.dcaZ()) <= dcaConfOptions.DCAzCustomCut); - passDCAxyCutAntiDe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(antiDPt, parDCAxy[2]))); + passDCAxyCutAntiDe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(antiDPt, parDCAxy[2]))); passDCAzCutAntiDe = (std::abs(track.dcaZ()) <= dcaConfOptions.DCAzCustomCut); - passDCAxyCutHe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(hePt, parDCAxy[2]))); + passDCAxyCutHe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(hePt, parDCAxy[2]))); passDCAzCutHe = (std::abs(track.dcaZ()) <= dcaConfOptions.DCAzCustomCut); - passDCAxyCutAntiHe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(antihePt, parDCAxy[2]))); + passDCAxyCutAntiHe = (std::abs(track.dcaXY()) <= parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(antihePt, parDCAxy[2]))); passDCAzCutAntiHe = (std::abs(track.dcaZ()) <= dcaConfOptions.DCAzCustomCut); break; case 3: passDCAxyCut = (std::abs(track.dcaXY()) <= dcaConfOptions.DCAxyCustomCut); - passDCAzCut = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(track.pt(), parDCAz[2]))); + passDCAzCut = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(track.pt(), parDCAz[2]))); passDCAxyCutDe = (std::abs(track.dcaXY()) <= dcaConfOptions.DCAxyCustomCut); - passDCAzCutDe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(DPt, parDCAz[2]))); + passDCAzCutDe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(DPt, parDCAz[2]))); passDCAxyCutAntiDe = (std::abs(track.dcaXY()) <= dcaConfOptions.DCAxyCustomCut); - passDCAzCutAntiDe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(antiDPt, parDCAz[2]))); + passDCAzCutAntiDe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(antiDPt, parDCAz[2]))); passDCAxyCutHe = (std::abs(track.dcaXY()) <= dcaConfOptions.DCAxyCustomCut); - passDCAzCutHe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(hePt, parDCAz[2]))); + passDCAzCutHe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(hePt, parDCAz[2]))); passDCAxyCutAntiHe = (std::abs(track.dcaXY()) <= dcaConfOptions.DCAxyCustomCut); - passDCAzCutAntiHe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(antihePt, parDCAz[2]))); + passDCAzCutAntiHe = (std::abs(track.dcaZ()) <= parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(antihePt, parDCAz[2]))); break; case 4: - passDCAxyCut = TMath::Power(track.dcaXY(), 2) / TMath::Power(dcaConfOptions.DCAxyCustomCut, 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(dcaConfOptions.DCAzCustomCut, 2) <= 1; - passDCAzCut = TMath::Power(track.dcaXY(), 2) / TMath::Power(dcaConfOptions.DCAxyCustomCut, 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(dcaConfOptions.DCAzCustomCut, 2) <= 1; - - passDCAxyCutDe = TMath::Power(track.dcaXY(), 2) / TMath::Power(dcaConfOptions.DCAxyCustomCut, 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(dcaConfOptions.DCAzCustomCut, 2) <= 1; - passDCAzCutDe = TMath::Power(track.dcaXY(), 2) / TMath::Power(dcaConfOptions.DCAxyCustomCut, 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(dcaConfOptions.DCAzCustomCut, 2) <= 1; - passDCAxyCutAntiDe = TMath::Power(track.dcaXY(), 2) / TMath::Power(dcaConfOptions.DCAxyCustomCut, 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(dcaConfOptions.DCAzCustomCut, 2) <= 1; - passDCAzCutAntiDe = TMath::Power(track.dcaXY(), 2) / TMath::Power(dcaConfOptions.DCAxyCustomCut, 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(dcaConfOptions.DCAzCustomCut, 2) <= 1; - - passDCAxyCutHe = TMath::Power(track.dcaXY(), 2) / TMath::Power(dcaConfOptions.DCAxyCustomCut, 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(dcaConfOptions.DCAzCustomCut, 2) <= 1; - passDCAzCutHe = TMath::Power(track.dcaXY(), 2) / TMath::Power(dcaConfOptions.DCAxyCustomCut, 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(dcaConfOptions.DCAzCustomCut, 2) <= 1; - passDCAxyCutAntiHe = TMath::Power(track.dcaXY(), 2) / TMath::Power(dcaConfOptions.DCAxyCustomCut, 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(dcaConfOptions.DCAzCustomCut, 2) <= 1; - passDCAzCutAntiHe = TMath::Power(track.dcaXY(), 2) / TMath::Power(dcaConfOptions.DCAxyCustomCut, 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(dcaConfOptions.DCAzCustomCut, 2) <= 1; + passDCAxyCut = std::pow(track.dcaXY(), 2) / std::pow(dcaConfOptions.DCAxyCustomCut, 2) + std::pow(track.dcaZ(), 2) / std::pow(dcaConfOptions.DCAzCustomCut, 2) <= 1; + passDCAzCut = std::pow(track.dcaXY(), 2) / std::pow(dcaConfOptions.DCAxyCustomCut, 2) + std::pow(track.dcaZ(), 2) / std::pow(dcaConfOptions.DCAzCustomCut, 2) <= 1; + + passDCAxyCutDe = std::pow(track.dcaXY(), 2) / std::pow(dcaConfOptions.DCAxyCustomCut, 2) + std::pow(track.dcaZ(), 2) / std::pow(dcaConfOptions.DCAzCustomCut, 2) <= 1; + passDCAzCutDe = std::pow(track.dcaXY(), 2) / std::pow(dcaConfOptions.DCAxyCustomCut, 2) + std::pow(track.dcaZ(), 2) / std::pow(dcaConfOptions.DCAzCustomCut, 2) <= 1; + passDCAxyCutAntiDe = std::pow(track.dcaXY(), 2) / std::pow(dcaConfOptions.DCAxyCustomCut, 2) + std::pow(track.dcaZ(), 2) / std::pow(dcaConfOptions.DCAzCustomCut, 2) <= 1; + passDCAzCutAntiDe = std::pow(track.dcaXY(), 2) / std::pow(dcaConfOptions.DCAxyCustomCut, 2) + std::pow(track.dcaZ(), 2) / std::pow(dcaConfOptions.DCAzCustomCut, 2) <= 1; + + passDCAxyCutHe = std::pow(track.dcaXY(), 2) / std::pow(dcaConfOptions.DCAxyCustomCut, 2) + std::pow(track.dcaZ(), 2) / std::pow(dcaConfOptions.DCAzCustomCut, 2) <= 1; + passDCAzCutHe = std::pow(track.dcaXY(), 2) / std::pow(dcaConfOptions.DCAxyCustomCut, 2) + std::pow(track.dcaZ(), 2) / std::pow(dcaConfOptions.DCAzCustomCut, 2) <= 1; + passDCAxyCutAntiHe = std::pow(track.dcaXY(), 2) / std::pow(dcaConfOptions.DCAxyCustomCut, 2) + std::pow(track.dcaZ(), 2) / std::pow(dcaConfOptions.DCAzCustomCut, 2) <= 1; + passDCAzCutAntiHe = std::pow(track.dcaXY(), 2) / std::pow(dcaConfOptions.DCAxyCustomCut, 2) + std::pow(track.dcaZ(), 2) / std::pow(dcaConfOptions.DCAzCustomCut, 2) <= 1; break; case 5: - passDCAxyCut = TMath::Power(track.dcaXY(), 2) / TMath::Power(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(track.pt(), parDCAxy[2])), 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(track.pt(), parDCAz[2])), 2) <= 1; - passDCAzCut = TMath::Power(track.dcaXY(), 2) / TMath::Power(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(track.pt(), parDCAxy[2])), 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(track.pt(), parDCAz[2])), 2) <= 1; - - passDCAxyCutDe = TMath::Power(track.dcaXY(), 2) / TMath::Power(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(DPt, parDCAxy[2])), 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(DPt, parDCAz[2])), 2) <= 1; - passDCAzCutDe = TMath::Power(track.dcaXY(), 2) / TMath::Power(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(DPt, parDCAxy[2])), 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(DPt, parDCAz[2])), 2) <= 1; - passDCAxyCutAntiDe = TMath::Power(track.dcaXY(), 2) / TMath::Power(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(antiDPt, parDCAxy[2])), 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(antiDPt, parDCAz[2])), 2) <= 1; - passDCAzCutAntiDe = TMath::Power(track.dcaXY(), 2) / TMath::Power(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(antiDPt, parDCAxy[2])), 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(antiDPt, parDCAz[2])), 2) <= 1; - - passDCAxyCutHe = TMath::Power(track.dcaXY(), 2) / TMath::Power(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(hePt, parDCAxy[2])), 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(hePt, parDCAz[2])), 2) <= 1; - passDCAzCutHe = TMath::Power(track.dcaXY(), 2) / TMath::Power(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(hePt, parDCAxy[2])), 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(hePt, parDCAz[2])), 2) <= 1; - passDCAxyCutAntiHe = TMath::Power(track.dcaXY(), 2) / TMath::Power(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(antihePt, parDCAxy[2])), 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(antihePt, parDCAz[2])), 2) <= 1; - passDCAzCutAntiHe = TMath::Power(track.dcaXY(), 2) / TMath::Power(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / TMath::Power(antihePt, parDCAxy[2])), 2) + TMath::Power(track.dcaZ(), 2) / TMath::Power(parDCAz[3] * (parDCAz[0] + parDCAz[1] / TMath::Power(antihePt, parDCAz[2])), 2) <= 1; + passDCAxyCut = std::pow(track.dcaXY(), 2) / std::pow(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(track.pt(), parDCAxy[2])), 2) + std::pow(track.dcaZ(), 2) / std::pow(parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(track.pt(), parDCAz[2])), 2) <= 1; + passDCAzCut = std::pow(track.dcaXY(), 2) / std::pow(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(track.pt(), parDCAxy[2])), 2) + std::pow(track.dcaZ(), 2) / std::pow(parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(track.pt(), parDCAz[2])), 2) <= 1; + + passDCAxyCutDe = std::pow(track.dcaXY(), 2) / std::pow(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(DPt, parDCAxy[2])), 2) + std::pow(track.dcaZ(), 2) / std::pow(parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(DPt, parDCAz[2])), 2) <= 1; + passDCAzCutDe = std::pow(track.dcaXY(), 2) / std::pow(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(DPt, parDCAxy[2])), 2) + std::pow(track.dcaZ(), 2) / std::pow(parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(DPt, parDCAz[2])), 2) <= 1; + passDCAxyCutAntiDe = std::pow(track.dcaXY(), 2) / std::pow(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(antiDPt, parDCAxy[2])), 2) + std::pow(track.dcaZ(), 2) / std::pow(parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(antiDPt, parDCAz[2])), 2) <= 1; + passDCAzCutAntiDe = std::pow(track.dcaXY(), 2) / std::pow(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(antiDPt, parDCAxy[2])), 2) + std::pow(track.dcaZ(), 2) / std::pow(parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(antiDPt, parDCAz[2])), 2) <= 1; + + passDCAxyCutHe = std::pow(track.dcaXY(), 2) / std::pow(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(hePt, parDCAxy[2])), 2) + std::pow(track.dcaZ(), 2) / std::pow(parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(hePt, parDCAz[2])), 2) <= 1; + passDCAzCutHe = std::pow(track.dcaXY(), 2) / std::pow(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(hePt, parDCAxy[2])), 2) + std::pow(track.dcaZ(), 2) / std::pow(parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(hePt, parDCAz[2])), 2) <= 1; + passDCAxyCutAntiHe = std::pow(track.dcaXY(), 2) / std::pow(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(antihePt, parDCAxy[2])), 2) + std::pow(track.dcaZ(), 2) / std::pow(parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(antihePt, parDCAz[2])), 2) <= 1; + passDCAzCutAntiHe = std::pow(track.dcaXY(), 2) / std::pow(parDCAxy[3] * (parDCAxy[0] + parDCAxy[1] / std::pow(antihePt, parDCAxy[2])), 2) + std::pow(track.dcaZ(), 2) / std::pow(parDCAz[3] * (parDCAz[0] + parDCAz[1] / std::pow(antihePt, parDCAz[2])), 2) <= 1; break; } // p cut - if (TMath::Abs(track.tpcInnerParam()) < kinemOptions.pCut) + if (std::abs(track.tpcInnerParam()) < kinemOptions.pCut) continue; // Rapidity cuts @@ -2901,7 +2921,7 @@ struct LFNucleiBATask { isProdByGen = track.producedByGenerator(); isWeakDecay = track.getProcess() == 4; pdgCode = track.pdgCode(); - genPt = TMath::Sqrt(TMath::Power(track.px(), 2) + TMath::Power(track.py(), 2)); + genPt = std::sqrt(std::pow(track.px(), 2) + std::pow(track.py(), 2)); } else { if (!track.has_mcParticle()) { @@ -3441,6 +3461,9 @@ struct LFNucleiBATask { continue; } + // nITSTr = o2::aod::ITSResponse.nSigmaITS(track); + nITSHe = track.itsNSigmaHe(); + if (outFlagOptions.makeDCAAfterCutPlots) { if (isHeWTPCpid) { @@ -4003,11 +4026,13 @@ struct LFNucleiBATask { if (isHeWoTPCpid) { if (outFlagOptions.enableExpSignalTPC) histos.fill(HIST("tracks/helium/h2HeliumTPCExpSignalDiffVsPt"), hePt, track.tpcExpSignalDiffHe()); + histos.fill(HIST("tracks/helium/h2HeliumVspTNSigmaITS"), hePt, nITSHe); histos.fill(HIST("tracks/helium/h2HeliumVspTNSigmaTPC"), hePt, track.tpcNSigmaHe()); } if (isAntiHeWoTPCpid) { if (outFlagOptions.enableExpSignalTPC) histos.fill(HIST("tracks/helium/h2antiHeliumTPCExpSignalDiffVsPt"), antihePt, track.tpcExpSignalDiffHe()); + histos.fill(HIST("tracks/helium/h2antiHeliumVspTNSigmaITS"), antihePt, nITSHe); histos.fill(HIST("tracks/helium/h2antiHeliumVspTNSigmaTPC"), antihePt, track.tpcNSigmaHe()); } @@ -4307,21 +4332,21 @@ struct LFNucleiBATask { } if ((track.beta() * track.beta()) < 1.) { - gamma = 1.f / TMath::Sqrt(1.f - (track.beta() * track.beta())); + gamma = 1.f / std::sqrt(1.f - (track.beta() * track.beta())); switch (massTOFConfig) { case 0: - massTOF = track.tpcInnerParam() * TMath::Sqrt(1.f / (track.beta() * track.beta()) - 1.f); - massTOFhe = heTPCmomentum * TMath::Sqrt(1.f / (track.beta() * track.beta()) - 1.f); - massTOFantihe = antiheTPCmomentum * TMath::Sqrt(1.f / (track.beta() * track.beta()) - 1.f); + massTOF = track.tpcInnerParam() * std::sqrt(1.f / (track.beta() * track.beta()) - 1.f); + massTOFhe = heTPCmomentum * std::sqrt(1.f / (track.beta() * track.beta()) - 1.f); + massTOFantihe = antiheTPCmomentum * std::sqrt(1.f / (track.beta() * track.beta()) - 1.f); break; case 1: - massTOF = track.tofExpMom() * TMath::Sqrt(1.f / (track.beta() * track.beta()) - 1.f); + massTOF = track.tofExpMom() * std::sqrt(1.f / (track.beta() * track.beta()) - 1.f); break; case 2: - massTOF = track.p() * TMath::Sqrt(1.f / (track.beta() * track.beta()) - 1.f); - massTOFhe = heP * TMath::Sqrt(1.f / (track.beta() * track.beta()) - 1.f); - massTOFantihe = antiheP * TMath::Sqrt(1.f / (track.beta() * track.beta()) - 1.f); + massTOF = track.p() * std::sqrt(1.f / (track.beta() * track.beta()) - 1.f); + massTOFhe = heP * std::sqrt(1.f / (track.beta() * track.beta()) - 1.f); + massTOFantihe = antiheP * std::sqrt(1.f / (track.beta() * track.beta()) - 1.f); break; } if (passDCAxyzCut) @@ -4354,22 +4379,22 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/eff/proton/hPtPrTOFrebinned"), track.pt()); } histos.fill(HIST("tracks/proton/h2TOFmassProtonVsPt"), massTOF, track.pt()); - histos.fill(HIST("tracks/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); + histos.fill(HIST("tracks/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - MassProtonVal * MassProtonVal, track.pt()); if (outFlagOptions.enableBetaCut && (track.beta() > betaCut)) { histos.fill(HIST("tracks/proton/h2TOFmassProtonVsPt_BetaCut"), massTOF, track.pt()); - histos.fill(HIST("tracks/proton/h2TOFmass2ProtonVsPt_BetaCut"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); + histos.fill(HIST("tracks/proton/h2TOFmass2ProtonVsPt_BetaCut"), massTOF * massTOF - MassProtonVal * MassProtonVal, track.pt()); } if (outFlagOptions.enableExpSignalTOF) histos.fill(HIST("tracks/proton/h2ProtonTOFExpSignalDiffVsPtCut"), track.pt(), track.tofExpSignalDiffPr()); if (enableEvTimeSplitting) { if (track.isEvTimeTOF() && track.isEvTimeT0AC()) { - evtimeHistos.fill(HIST("tracks/evtime/ft0tof/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); + evtimeHistos.fill(HIST("tracks/evtime/ft0tof/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - MassProtonVal * MassProtonVal, track.pt()); } else if (track.isEvTimeT0AC()) { - evtimeHistos.fill(HIST("tracks/evtime/ft0/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); + evtimeHistos.fill(HIST("tracks/evtime/ft0/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - MassProtonVal * MassProtonVal, track.pt()); } else if (track.isEvTimeTOF()) { - evtimeHistos.fill(HIST("tracks/evtime/tof/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); + evtimeHistos.fill(HIST("tracks/evtime/tof/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - MassProtonVal * MassProtonVal, track.pt()); } else { - evtimeHistos.fill(HIST("tracks/evtime/fill/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); + evtimeHistos.fill(HIST("tracks/evtime/fill/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - MassProtonVal * MassProtonVal, track.pt()); } } } else { @@ -4378,22 +4403,22 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/eff/proton/hPtantiPrTOFrebinned"), track.pt()); } histos.fill(HIST("tracks/proton/h2TOFmassantiProtonVsPt"), massTOF, track.pt()); - histos.fill(HIST("tracks/proton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); + histos.fill(HIST("tracks/proton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - MassProtonVal * MassProtonVal, track.pt()); if (outFlagOptions.enableBetaCut && (track.beta() > betaCut)) { histos.fill(HIST("tracks/proton/h2TOFmassantiProtonVsPt_BetaCut"), massTOF, track.pt()); - histos.fill(HIST("tracks/proton/h2TOFmass2antiProtonVsPt_BetaCut"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); + histos.fill(HIST("tracks/proton/h2TOFmass2antiProtonVsPt_BetaCut"), massTOF * massTOF - MassProtonVal * MassProtonVal, track.pt()); } if (outFlagOptions.enableExpSignalTOF) histos.fill(HIST("tracks/proton/h2antiProtonTOFExpSignalDiffVsPtCut"), track.pt(), track.tofExpSignalDiffPr()); if (enableEvTimeSplitting) { if (track.isEvTimeTOF() && track.isEvTimeT0AC()) { - evtimeHistos.fill(HIST("tracks/evtime/ft0tof/proton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); + evtimeHistos.fill(HIST("tracks/evtime/ft0tof/proton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - MassProtonVal * MassProtonVal, track.pt()); } else if (track.isEvTimeT0AC()) { - evtimeHistos.fill(HIST("tracks/evtime/ft0/proton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); + evtimeHistos.fill(HIST("tracks/evtime/ft0/proton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - MassProtonVal * MassProtonVal, track.pt()); } else if (track.isEvTimeTOF()) { - evtimeHistos.fill(HIST("tracks/evtime/tof/proton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); + evtimeHistos.fill(HIST("tracks/evtime/tof/proton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - MassProtonVal * MassProtonVal, track.pt()); } else { - evtimeHistos.fill(HIST("tracks/evtime/fill/proton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); + evtimeHistos.fill(HIST("tracks/evtime/fill/proton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - MassProtonVal * MassProtonVal, track.pt()); } } } @@ -4406,19 +4431,19 @@ struct LFNucleiBATask { if (enablePtSpectra) histos.fill(HIST("tracks/eff/triton/hPtTrTOF"), track.pt()); histos.fill(HIST("tracks/triton/h2TOFmassTritonVsPt"), massTOF, track.pt()); - histos.fill(HIST("tracks/triton/h2TOFmass2TritonVsPt"), massTOF * massTOF - fMassTriton * fMassTriton, track.pt()); + histos.fill(HIST("tracks/triton/h2TOFmass2TritonVsPt"), massTOF * massTOF - MassTritonVal * MassTritonVal, track.pt()); if (outFlagOptions.enableBetaCut && (track.beta() > betaCut)) { histos.fill(HIST("tracks/triton/h2TOFmassTritonVsPt_BetaCut"), massTOF, track.pt()); - histos.fill(HIST("tracks/triton/h2TOFmass2TritonVsPt_BetaCut"), massTOF * massTOF - fMassTriton * fMassTriton, track.pt()); + histos.fill(HIST("tracks/triton/h2TOFmass2TritonVsPt_BetaCut"), massTOF * massTOF - MassTritonVal * MassTritonVal, track.pt()); } } else { if (enablePtSpectra) histos.fill(HIST("tracks/eff/triton/hPtantiTrTOF"), track.pt()); histos.fill(HIST("tracks/triton/h2TOFmassantiTritonVsPt"), massTOF, track.pt()); - histos.fill(HIST("tracks/triton/h2TOFmass2antiTritonVsPt"), massTOF * massTOF - fMassTriton * fMassTriton, track.pt()); + histos.fill(HIST("tracks/triton/h2TOFmass2antiTritonVsPt"), massTOF * massTOF - MassTritonVal * MassTritonVal, track.pt()); if (outFlagOptions.enableBetaCut && (track.beta() > betaCut)) { histos.fill(HIST("tracks/triton/h2TOFmassantiTritonVsPt_BetaCut"), massTOF, track.pt()); - histos.fill(HIST("tracks/triton/h2TOFmass2antiTritonVsPt_BetaCut"), massTOF * massTOF - fMassTriton * fMassTriton, track.pt()); + histos.fill(HIST("tracks/triton/h2TOFmass2antiTritonVsPt_BetaCut"), massTOF * massTOF - MassTritonVal * MassTritonVal, track.pt()); } } } @@ -4430,24 +4455,24 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/eff/deuteron/hPtDeTOF"), DPt); histos.fill(HIST("tracks/deuteron/h2TOFmassDeuteronVsPt"), massTOF, DPt); if (enableCentrality) - histos.fill(HIST("tracks/deuteron/h3TOFmass2DeuteronVsPtVsMult"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, DPt, event.centFT0M()); + histos.fill(HIST("tracks/deuteron/h3TOFmass2DeuteronVsPtVsMult"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, DPt, event.centFT0M()); else - histos.fill(HIST("tracks/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, DPt); + histos.fill(HIST("tracks/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, DPt); if (outFlagOptions.enableBetaCut && (track.beta() > betaCut)) { histos.fill(HIST("tracks/deuteron/h2TOFmassDeuteronVsPt_BetaCut"), massTOF, DPt); - histos.fill(HIST("tracks/deuteron/h2TOFmass2DeuteronVsPt_BetaCut"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, DPt); + histos.fill(HIST("tracks/deuteron/h2TOFmass2DeuteronVsPt_BetaCut"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, DPt); } if (outFlagOptions.enableExpSignalTOF) histos.fill(HIST("tracks/deuteron/h2DeuteronTOFExpSignalDiffVsPtCut"), DPt, track.tofExpSignalDiffDe()); if (enableEvTimeSplitting) { if (track.isEvTimeTOF() && track.isEvTimeT0AC()) { - evtimeHistos.fill(HIST("tracks/evtime/ft0tof/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, DPt); + evtimeHistos.fill(HIST("tracks/evtime/ft0tof/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, DPt); } else if (track.isEvTimeT0AC()) { - evtimeHistos.fill(HIST("tracks/evtime/ft0/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, DPt); + evtimeHistos.fill(HIST("tracks/evtime/ft0/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, DPt); } else if (track.isEvTimeTOF()) { - evtimeHistos.fill(HIST("tracks/evtime/tof/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, DPt); + evtimeHistos.fill(HIST("tracks/evtime/tof/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, DPt); } else { - evtimeHistos.fill(HIST("tracks/evtime/fill/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, DPt); + evtimeHistos.fill(HIST("tracks/evtime/fill/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, DPt); } } } @@ -4456,24 +4481,24 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/eff/deuteron/hPtantiDeTOF"), antiDPt); histos.fill(HIST("tracks/deuteron/h2TOFmassantiDeuteronVsPt"), massTOF, antiDPt); if (enableCentrality) - histos.fill(HIST("tracks/deuteron/h3TOFmass2antiDeuteronVsPtVsMult"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, antiDPt, event.centFT0M()); + histos.fill(HIST("tracks/deuteron/h3TOFmass2antiDeuteronVsPtVsMult"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, antiDPt, event.centFT0M()); else - histos.fill(HIST("tracks/deuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, antiDPt); + histos.fill(HIST("tracks/deuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, antiDPt); if (outFlagOptions.enableBetaCut && (track.beta() > betaCut)) { histos.fill(HIST("tracks/deuteron/h2TOFmassantiDeuteronVsPt_BetaCut"), massTOF, antiDPt); - histos.fill(HIST("tracks/deuteron/h2TOFmass2antiDeuteronVsPt_BetaCut"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, antiDPt); + histos.fill(HIST("tracks/deuteron/h2TOFmass2antiDeuteronVsPt_BetaCut"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, antiDPt); } if (outFlagOptions.enableExpSignalTOF) histos.fill(HIST("tracks/deuteron/h2antiDeuteronTOFExpSignalDiffVsPtCut"), antiDPt, track.tofExpSignalDiffDe()); if (enableEvTimeSplitting) { if (track.isEvTimeTOF() && track.isEvTimeT0AC()) { - evtimeHistos.fill(HIST("tracks/evtime/ft0tof/deuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, antiDPt); + evtimeHistos.fill(HIST("tracks/evtime/ft0tof/deuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, antiDPt); } else if (track.isEvTimeT0AC()) { - evtimeHistos.fill(HIST("tracks/evtime/ft0/deuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, antiDPt); + evtimeHistos.fill(HIST("tracks/evtime/ft0/deuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, antiDPt); } else if (track.isEvTimeTOF()) { - evtimeHistos.fill(HIST("tracks/evtime/tof/deuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, antiDPt); + evtimeHistos.fill(HIST("tracks/evtime/tof/deuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, antiDPt); } else { - evtimeHistos.fill(HIST("tracks/evtime/fill/deuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, antiDPt); + evtimeHistos.fill(HIST("tracks/evtime/fill/deuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, antiDPt); } } } @@ -4482,11 +4507,11 @@ struct LFNucleiBATask { if (enablePtSpectra) histos.fill(HIST("tracks/eff/helium/hPtHeTOF"), 2 * hePt); histos.fill(HIST("tracks/helium/h2TOFmassHeliumVsPt"), 2.f * massTOFhe, hePt); - histos.fill(HIST("tracks/helium/h2TOFmassDeltaHeliumVsPt"), 2.f * massTOFhe - fMassHelium, hePt); - histos.fill(HIST("tracks/helium/h2TOFmass2HeliumVsPt"), 2.f * massTOFhe * 2.f * massTOFhe - fMassHelium * fMassHelium, hePt); + histos.fill(HIST("tracks/helium/h2TOFmassDeltaHeliumVsPt"), 2.f * massTOFhe - MassHeliumVal, hePt); + histos.fill(HIST("tracks/helium/h2TOFmass2HeliumVsPt"), 2.f * massTOFhe * 2.f * massTOFhe - MassHeliumVal * MassHeliumVal, hePt); if (outFlagOptions.enableBetaCut && (track.beta() > betaCut)) { histos.fill(HIST("tracks/helium/h2TOFmassHeliumVsPt_BetaCut"), 2.f * massTOFhe, hePt); - histos.fill(HIST("tracks/helium/h2TOFmass2HeliumVsPt_BetaCut"), 2.f * massTOFhe * 2.f * massTOFhe - fMassHelium * fMassHelium, hePt); + histos.fill(HIST("tracks/helium/h2TOFmass2HeliumVsPt_BetaCut"), 2.f * massTOFhe * 2.f * massTOFhe - MassHeliumVal * MassHeliumVal, hePt); } if (outFlagOptions.enableExpSignalTOF) histos.fill(HIST("tracks/helium/h2HeliumTOFExpSignalDiffVsPtCut"), hePt, track.tofExpSignalDiffHe()); @@ -4495,11 +4520,11 @@ struct LFNucleiBATask { if (enablePtSpectra) histos.fill(HIST("tracks/eff/helium/hPtantiHeTOF"), 2 * antihePt); histos.fill(HIST("tracks/helium/h2TOFmassantiHeliumVsPt"), 2.f * massTOFantihe, antihePt); - histos.fill(HIST("tracks/helium/h2TOFmassDeltaantiHeliumVsPt"), 2.f * massTOFantihe - fMassHelium, antihePt); - histos.fill(HIST("tracks/helium/h2TOFmass2antiHeliumVsPt"), 2.f * massTOFantihe * 2.f * massTOFantihe - fMassHelium * fMassHelium, antihePt); + histos.fill(HIST("tracks/helium/h2TOFmassDeltaantiHeliumVsPt"), 2.f * massTOFantihe - MassHeliumVal, antihePt); + histos.fill(HIST("tracks/helium/h2TOFmass2antiHeliumVsPt"), 2.f * massTOFantihe * 2.f * massTOFantihe - MassHeliumVal * MassHeliumVal, antihePt); if (outFlagOptions.enableBetaCut && (track.beta() > betaCut)) { histos.fill(HIST("tracks/helium/h2TOFmassantiHeliumVsPt_BetaCut"), 2.f * massTOFantihe, antihePt); - histos.fill(HIST("tracks/helium/h2TOFmass2antiHeliumVsPt_BetaCut"), 2.f * massTOFantihe * 2.f * massTOFantihe - fMassHelium * fMassHelium, antihePt); + histos.fill(HIST("tracks/helium/h2TOFmass2antiHeliumVsPt_BetaCut"), 2.f * massTOFantihe * 2.f * massTOFantihe - MassHeliumVal * MassHeliumVal, antihePt); } if (outFlagOptions.enableExpSignalTOF) histos.fill(HIST("tracks/helium/h2antiHeliumTOFExpSignalDiffVsPtCut"), antihePt, track.tofExpSignalDiffHe()); From 0b2ffd9a68194aa0ec539ad754f33ee44d56ace3 Mon Sep 17 00:00:00 2001 From: mhartung71 <50153519+mhartung71@users.noreply.github.com> Date: Wed, 18 Dec 2024 21:55:59 +0100 Subject: [PATCH 437/459] [PWGLF] Bug fix (#9054) --- PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx index a3a3db2e936..4dcdf0f67ec 100644 --- a/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx @@ -350,7 +350,7 @@ struct HyperNucCandidate { } KFParticle getDaughterTrackKfp(int track) { - return kfpDaughters.at(track + isCascade() ? 1 : 0); + return kfpDaughters.at(track + (isCascade() ? 1 : 0)); } float getDcaTrackToVtxXY(int track, std::vector vtx) { From b293eb9d48e8a5b7299a6976f7864a9f9972949c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 19 Dec 2024 00:18:02 +0100 Subject: [PATCH 438/459] [PWGHF,Trigger] Fix the labels (#9040) --- EventFiltering/PWGHF/HFFilterHelpers.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/EventFiltering/PWGHF/HFFilterHelpers.h b/EventFiltering/PWGHF/HFFilterHelpers.h index 6accb5e755c..73df6b6fa8d 100644 --- a/EventFiltering/PWGHF/HFFilterHelpers.h +++ b/EventFiltering/PWGHF/HFFilterHelpers.h @@ -198,7 +198,7 @@ static const std::array massAxisB = // channels to trigger on for femto constexpr int activeFemtoChannels[2][5] = {{1, 1, 1, 1, 0}, // pD0, pD+, pDs, pLc, pXic {0, 0, 0, 1, 0}}; // only for deLc -static const std::vector labelsColumnsFemtoChannels = {"protonDZero", "protonDPlus", "protonDs", "protonLc", "protonXic"}; +static const std::vector labelsColumnsFemtoChannels = {"DZero", "DPlus", "Ds", "Lc", "Xic"}; static const std::vector labelsRowsFemtoChannels = {"protonCharmFemto", "deuteronCharmFemto"}; constexpr float cutsPtThresholdsForFemto[1][2] = {{8., 1.4}}; // proton, deuteron static const std::vector labelsColumnsPtThresholdsForFemto = {"Proton", "Deuteron"}; @@ -206,14 +206,14 @@ static const std::vector labelsColumnsPtThresholdsForFemto = {"Prot // min and max pT for all tracks combined (except for V0 and cascades) constexpr float cutsPt[2][7] = {{1., 0.1, 0.8, 0.5, 0.1, 0.2, 0.4}, {100000., 100000., 5., 100000., 100000., 100000., 100000.}}; // beauty, D*, femto, SigmaC, Xic*+ -> SigmaC++K- -static const std::vector labelsColumnsCutsPt = {"Beauty", "DstarPlus", "FemtoProton", "CharmBaryon", "SoftPiSigmaC", "SoftKaonXicResoToSigmaC", "FemtoDeuteron"}; +static const std::vector labelsColumnsCutsPt = {"Beauty", "DstarPlus", "PrForFemto", "CharmBaryon", "SoftPiSigmaC", "SoftKaonXicResoToSigmaC", "DeForFemto"}; static const std::vector labelsRowsCutsPt = {"Minimum", "Maximum"}; // PID cuts constexpr float cutsNsigma[3][7] = {{3., 3., 3., 5., 3., 3., 5.}, // TPC proton from Lc, pi/K from D0, K from 3-prong, femto selected proton, pi/K from Xic/Omegac, K from Xic*->SigmaC-Kaon, femto selected deuteron {3., 3., 3., 2.5, 3., 3., 5.}, // TOF proton from Lc, pi/K from D0, K from 3-prong, femto selected proton, pi/K from Xic/Omegac, K from Xic*->SigmaC-Kaon, femto selected deuteron {999., 999., 999., 2.5, 999., 999., 5.}}; // Sum in quadrature of TPC and TOF (used only for femto selected proton and deuteron for pT < 4 GeV/c) -static const std::vector labelsColumnsNsigma = {"PrFromLc", "PiKaFromDZero", "KaFrom3Prong", "FemtoProton", "PiKaFromCharmBaryon", "SoftKaonFromXicResoToSigmaC", "FemtoDeuteron"}; +static const std::vector labelsColumnsNsigma = {"PrFromLc", "PiKaFromDZero", "KaFrom3Prong", "PrForFemto", "PiKaFromCharmBaryon", "SoftKaonFromXicResoToSigmaC", "DeForFemto"}; static const std::vector labelsRowsNsigma = {"TPC", "TOF", "Comb"}; // high pt @@ -1111,7 +1111,7 @@ inline int8_t HfFilterHelper::isSelectedSigmaCInDeltaMassRange(const T& pTrackSa return retValue; } -/// Mass selection of Xic candidates to build Lb candidates +/// Mass selection of Xic candidates to build Xib candidates /// \param pTrackSameChargeFirst is the first same-charge track momentum /// \param pTrackSameChargeSecond is the second same-charge track momentum /// \param pTrackOppositeCharge is the opposite charge track momentum From bc3cad726c6af8579a2ba41b0efe65996c4ba45c Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Thu, 19 Dec 2024 01:20:05 +0100 Subject: [PATCH 439/459] [PWGCF] DptDpt -- Tracking the TPC sector borders (#9055) Co-authored-by: Victor --- PWGCF/TableProducer/dptdptfilter.cxx | 20 +++- PWGCF/TableProducer/dptdptfilter.h | 25 ++++- PWGCF/Tasks/match-reco-gen.cxx | 7 +- .../Tasks/dptDptEfficiencyAndQc.cxx | 101 ++++++++++-------- 4 files changed, 103 insertions(+), 50 deletions(-) diff --git a/PWGCF/TableProducer/dptdptfilter.cxx b/PWGCF/TableProducer/dptdptfilter.cxx index c96ad0356e8..6c2482fffda 100644 --- a/PWGCF/TableProducer/dptdptfilter.cxx +++ b/PWGCF/TableProducer/dptdptfilter.cxx @@ -368,7 +368,14 @@ struct DptDptFilter { Configurable cfgTriggSel{"triggsel", "MB", "Trigger selection: MB,VTXTOFMATCHED,VTXTRDMATCHED,VTXTRDTOFMATCHED,None. Default MB"}; Configurable cfgCentSpec{"centralities", "00-10,10-20,20-30,30-40,40-50,50-60,60-70,70-80", "Centrality/multiplicity ranges in min-max separated by commas"}; Configurable cfgOverallMinP{"overallminp", 0.0f, "The overall minimum momentum for the analysis. Default: 0.0"}; - Configurable cfgTpcExclusionMethod{"cfgTpcExclusionMethod", 0, "The method for excluding tracks within the TPC. 0: no exclusion; 1: static; 2: dynamic. Default: 0"}; + struct : ConfigurableGroup { + std::string prefix = "cfgTpcExclusion"; + Configurable method{"method", 0, "The method for excluding tracks within the TPC. 0: no exclusion; 1: static; 2: dynamic. Default: 0"}; + Configurable positiveLowCut{"positiveLowCut", "0.0787/x - 0.0236", "The lower cut function for positive tracks"}; + Configurable positiveUpCut{"positiveUpCut", "0.0892/x + 0.0251", "The upper cut function for positive tracks"}; + Configurable negativeLowCut{"negativeLowCut", "pi/9.0 - (0.0892/x + 0.0251)", "The lower cut function for negative tracks"}; + Configurable negativeUpCut{"negativeUpCut", "pi/9 - (0.0787/x - 0.0236)", "The upper cut function for negative tracks"}; + } cfgTpcExclusion; Configurable cfgBinning{"binning", {28, -7.0, 7.0, 18, 0.2, 2.0, 16, -0.8, 0.8, 72, 0.5}, "triplets - nbins, min, max - for z_vtx, pT, eta and phi, binning plus bin fraction of phi origin shift"}; @@ -807,9 +814,17 @@ struct DptDptFilterTracks { getTaskOptionValue(initContext, "dpt-dpt-filter", "binning.mPhibinshift", phibinshift, false); TpcExclusionMethod tpcExclude = kNOEXCLUSION; ///< exclude tracks within the TPC according to this method + std::string pLowCut; + std::string pUpCut; + std::string nLowCut; + std::string nUpCut; { int tmpTpcExclude = 0; - getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgTpcExclusionMethod", tmpTpcExclude, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgTpcExclusion.method", tmpTpcExclude, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgTpcExclusion.positiveLowCut", pLowCut, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgTpcExclusion.positiveUpCut", pUpCut, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgTpcExclusion.negativeLowCut", nLowCut, false); + getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgTpcExclusion.negativeUpCut", nUpCut, false); tpcExclude = static_cast(tmpTpcExclude); } /* self configure the CCDB access to the input file */ @@ -828,6 +843,7 @@ struct DptDptFilterTracks { /* the TPC excluder object instance */ tpcExcluder = TpcExcludeTrack(tpcExclude); + tpcExcluder.setCuts(pLowCut, pUpCut, nLowCut, nUpCut); /* self configure system type and data type */ /* if the system type is not known at this time, we have to put the initialization somewhere else */ diff --git a/PWGCF/TableProducer/dptdptfilter.h b/PWGCF/TableProducer/dptdptfilter.h index 0a824103934..16904455a9e 100644 --- a/PWGCF/TableProducer/dptdptfilter.h +++ b/PWGCF/TableProducer/dptdptfilter.h @@ -17,6 +17,7 @@ #define PWGCF_TABLEPRODUCER_DPTDPTFILTER_H_ #include +#include #include #include #include @@ -1017,7 +1018,6 @@ struct TpcExcludeTrack { } break; case kDYNAMIC: - LOGF(fatal, "Dynamic TPC exclusion method still not implemented"); method = m; break; default: @@ -1040,6 +1040,9 @@ struct TpcExcludeTrack { template bool exclude(TrackObject const& track) { + constexpr int kNoOfTpcSectors = 18; + constexpr float kTpcPhiSectorWidth = (constants::math::TwoPI) / kNoOfTpcSectors; + switch (method) { case kNOEXCLUSION: { return false; @@ -1054,15 +1057,33 @@ struct TpcExcludeTrack { } } break; case kDYNAMIC: { - return false; + float phiInTpcSector = std::fmod(track.phi(), kTpcPhiSectorWidth); + if (track.sign() > 0) { + return (phiInTpcSector < positiveUpCut->Eval(track.pt())) && (positiveLowCut->Eval(track.pt()) < phiInTpcSector); + } else { + return (phiInTpcSector < negativeUpCut->Eval(track.pt())) && (negativeLowCut->Eval(track.pt()) < phiInTpcSector); + } } break; default: return false; } } + void setCuts(std::string pLowCut, std::string pUpCut, std::string nLowCut, std::string nUpCut) + { + LOGF(info, "Setting the TPC exclusion cuts: pLow=%s, pUp=%s, nLow=%s, nUp=%s", pLowCut, pUpCut, nLowCut, nUpCut); + positiveLowCut = new TF1("posLowCut", pLowCut.c_str(), ptlow, ptup); + positiveUpCut = new TF1("posUpCut", pUpCut.c_str(), ptlow, ptup); + negativeLowCut = new TF1("negLowCut", nLowCut.c_str(), ptlow, ptup); + negativeUpCut = new TF1("negUpCut", nUpCut.c_str(), ptlow, ptup); + } + TpcExclusionMethod method = kNOEXCLUSION; float phibinwidth = 0.0; + TF1* positiveLowCut = nullptr; + TF1* positiveUpCut = nullptr; + TF1* negativeLowCut = nullptr; + TF1* negativeUpCut = nullptr; }; template diff --git a/PWGCF/Tasks/match-reco-gen.cxx b/PWGCF/Tasks/match-reco-gen.cxx index 43adb1b63b0..0162083350a 100644 --- a/PWGCF/Tasks/match-reco-gen.cxx +++ b/PWGCF/Tasks/match-reco-gen.cxx @@ -67,7 +67,10 @@ struct CheckGeneratorLevelVsDetectorLevel { Configurable cfgBinning{"binning", {28, -7.0, 7.0, 18, 0.2, 2.0, 16, -0.8, 0.8, 72, 0.5}, "triplets - nbins, min, max - for z_vtx, pT, eta and phi, binning plus bin fraction of phi origin shift"}; - Configurable cfgTpcExclusionMethod{"cfgTpcExclusionMethod", 0, "The method for excluding tracks within the TPC. 0: no exclusion; 1: static; 2: dynamic. Default: 0"}; + struct : ConfigurableGroup { + std::string prefix = "cfgTpcExclusion"; + Configurable method{"method", 0, "The method for excluding tracks within the TPC. 0: no exclusion; 1: static; 2: dynamic. Default: 0"}; + } cfgTpcExclusion; Configurable cfgTraceDCAOutliers{"trackdcaoutliers", {false, 0.0, 0.0}, "Track the generator level DCAxy outliers: false/true, low dcaxy, up dcaxy. Default {false,0.0,0.0}"}; Configurable cfgTraceOutOfSpeciesParticles{"trackoutparticles", false, "Track the particles which are not e,mu,pi,K,p: false/true. Default false"}; Configurable cfgRecoIdMethod{"recoidmethod", 0, "Method for identifying reconstructed tracks: 0 PID, 1 mcparticle. Default 0"}; @@ -107,7 +110,7 @@ struct CheckGeneratorLevelVsDetectorLevel { /* the TPC excluder object instance */ TpcExclusionMethod tpcExclude = kNOEXCLUSION; ///< exclude tracks within the TPC according to this method - tpcExclude = static_cast(cfgTpcExclusionMethod.value); + tpcExclude = static_cast(cfgTpcExclusion.method.value); tpcExcluder = TpcExcludeTrack(tpcExclude); /* the track types and combinations */ diff --git a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx index 927464b65ca..fe70e5dcfb5 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/dptDptEfficiencyAndQc.cxx @@ -555,7 +555,7 @@ struct PidDataCollectingEngine { } template - void fillAllSpeciesPID(uint ix, TrackObject const& track, float mom) + void fillAllSpeciesPID(uint ix, TrackObject const& track, float tpcmom, float tofmom) { if (track.sign() < 0) { ix = 2 * ix + 1; @@ -563,8 +563,8 @@ struct PidDataCollectingEngine { ix = 2 * ix; } for (uint when = 0; when < 2; ++when) { - fhTPCnSigmasVsP[when][ix]->Fill(mom, o2::aod::pidutils::tpcNSigma(track)); - fhTOFnSigmasVsP[when][ix]->Fill(mom, o2::aod::pidutils::tofNSigma(track)); + fhTPCnSigmasVsP[when][ix]->Fill(tpcmom, o2::aod::pidutils::tpcNSigma(track)); + fhTOFnSigmasVsP[when][ix]->Fill(tofmom, o2::aod::pidutils::tofNSigma(track)); if (track.trackacceptedid() < 0) { /* track not accepted */ return; @@ -573,7 +573,7 @@ struct PidDataCollectingEngine { } template - void fillSpeciesPID(uint ix, TrackObject const& track, float mom) + void fillSpeciesPID(uint ix, TrackObject const& track, float tpcmom, float tofmom) { if (track.sign() < 0) { ix = 2 * ix + 1; @@ -581,9 +581,9 @@ struct PidDataCollectingEngine { ix = 2 * ix; } for (uint when = 0; when < 2; ++when) { - fhTPCdEdxSignalDiffVsP[when][ix]->Fill(mom, o2::aod::pidutils::tpcExpSignalDiff(track)); - fhTOFSignalDiffVsP[when][ix]->Fill(mom, o2::aod::pidutils::tofExpSignalDiff(track)); - fhTPCTOFSigmaVsP[when][ix]->Fill(mom, o2::aod::pidutils::tpcNSigma(track), o2::aod::pidutils::tofNSigma(track)); + fhTPCdEdxSignalDiffVsP[when][ix]->Fill(tpcmom, o2::aod::pidutils::tpcExpSignalDiff(track)); + fhTOFSignalDiffVsP[when][ix]->Fill(tofmom, o2::aod::pidutils::tofExpSignalDiff(track)); + fhTPCTOFSigmaVsP[when][ix]->Fill(tpcmom, o2::aod::pidutils::tpcNSigma(track), o2::aod::pidutils::tofNSigma(track)); if (track.trackacceptedid() < 0) { /* track not accepted */ return; @@ -592,12 +592,16 @@ struct PidDataCollectingEngine { } template - void fillPID(TrackObject const& track, float mom) + void fillPID(TrackObject const& track, float tpcmom, float tofmom) { for (uint when = 0; when < 2; ++when) { - fhTPCdEdxSignalVsP[when]->Fill(mom, track.tpcSignal()); - fhTOFSignalVsP[when]->Fill(mom, track.beta()); - fhPvsTOFSqMass[when]->Fill(track.mass() * track.mass(), mom); + if constexpr (framework::has_type_v) { + fhTPCdEdxSignalVsP[when]->Fill(tpcmom, track.mcTunedTPCSignal()); + } else { + fhTPCdEdxSignalVsP[when]->Fill(tpcmom, track.tpcSignal()); + } + fhTOFSignalVsP[when]->Fill(tofmom, track.beta()); + fhPvsTOFSqMass[when]->Fill(track.mass() * track.mass(), tofmom); if (track.trackacceptedid() < 0) { /* track not accepted */ return; @@ -606,20 +610,20 @@ struct PidDataCollectingEngine { } template - void processTrack(TrackObject const& track, float mom) + void processTrack(TrackObject const& track, float tpcmom, float tofmom) { using namespace efficiencyandqatask; if constexpr (kindOfData == kReco) { - fillPID(track, mom); - fillSpeciesPID(0, track, mom); - fillSpeciesPID(1, track, mom); - fillSpeciesPID(2, track, mom); - fillAllSpeciesPID(0, track, mom); - fillAllSpeciesPID(1, track, mom); - fillAllSpeciesPID(2, track, mom); - fillAllSpeciesPID(3, track, mom); - fillAllSpeciesPID(4, track, mom); + fillPID(track, tpcmom, tofmom); + fillSpeciesPID(0, track, tpcmom, tofmom); + fillSpeciesPID(1, track, tpcmom, tofmom); + fillSpeciesPID(2, track, tpcmom, tofmom); + fillAllSpeciesPID(0, track, tpcmom, tofmom); + fillAllSpeciesPID(1, track, tpcmom, tofmom); + fillAllSpeciesPID(2, track, tpcmom, tofmom); + fillAllSpeciesPID(3, track, tpcmom, tofmom); + fillAllSpeciesPID(4, track, tpcmom, tofmom); } } }; @@ -688,7 +692,7 @@ struct PidExtraDataCollectingEngine { } template - void fillAllSpeciesPID(uint ix, TrackObject const& track, float mom) + void fillAllSpeciesPID(uint ix, TrackObject const& track, float tpcmom, float tofmom) { if (track.trackacceptedid() < 0) { /* track not accepted */ @@ -699,46 +703,54 @@ struct PidExtraDataCollectingEngine { } else { ix = 2 * ix; } - fhIdTPCnSigmasVsP[track.trackacceptedid()][ix]->Fill(mom, o2::aod::pidutils::tpcNSigma(track)); - fhIdTOFnSigmasVsP[track.trackacceptedid()][ix]->Fill(mom, o2::aod::pidutils::tofNSigma(track)); + fhIdTPCnSigmasVsP[track.trackacceptedid()][ix]->Fill(tpcmom, o2::aod::pidutils::tpcNSigma(track)); + fhIdTOFnSigmasVsP[track.trackacceptedid()][ix]->Fill(tofmom, o2::aod::pidutils::tofNSigma(track)); if (efficiencyandqatask::pidselector.isGlobalSpecies(track.trackacceptedid() / 2, id)) { /* only if the species of the selected track matches the target of the number of sigmas */ - fpIdTPCdEdxSignalVsPSigmas[track.trackacceptedid()]->Fill(mom, track.tpcSignal(), o2::aod::pidutils::tpcNSigma(track)); - fpIdTOFSignalVsPSigmas[track.trackacceptedid()]->Fill(mom, track.beta(), o2::aod::pidutils::tofNSigma(track)); + if constexpr (framework::has_type_v) { + fpIdTPCdEdxSignalVsPSigmas[track.trackacceptedid()]->Fill(tpcmom, track.mcTunedTPCSignal(), o2::aod::pidutils::tpcNSigma(track)); + } else { + fpIdTPCdEdxSignalVsPSigmas[track.trackacceptedid()]->Fill(tpcmom, track.tpcSignal(), o2::aod::pidutils::tpcNSigma(track)); + } + fpIdTOFSignalVsPSigmas[track.trackacceptedid()]->Fill(tofmom, track.beta(), o2::aod::pidutils::tofNSigma(track)); } } template - void fillSpeciesPID(uint, TrackObject const&, float) + void fillSpeciesPID(uint, TrackObject const&, float, float) { } template - void fillPID(TrackObject const& track, float mom) + void fillPID(TrackObject const& track, float tpcmom, float tofmom) { if (track.trackacceptedid() < 0) { /* track not accepted */ return; } - fhIdTPCdEdxSignalVsP[track.trackacceptedid()]->Fill(mom, track.tpcSignal()); - fhIdTOFSignalVsP[track.trackacceptedid()]->Fill(mom, track.beta()); + if constexpr (framework::has_type_v) { + fhIdTPCdEdxSignalVsP[track.trackacceptedid()]->Fill(tpcmom, track.mcTunedTPCSignal()); + } else { + fhIdTPCdEdxSignalVsP[track.trackacceptedid()]->Fill(tpcmom, track.tpcSignal()); + } + fhIdTOFSignalVsP[track.trackacceptedid()]->Fill(tofmom, track.beta()); } template - void processTrack(TrackObject const& track, float mom) + void processTrack(TrackObject const& track, float tpcmom, float tofmom) { using namespace efficiencyandqatask; if constexpr (kindOfData == kReco) { - fillPID(track, mom); - fillSpeciesPID(0, track, mom); - fillSpeciesPID(1, track, mom); - fillSpeciesPID(2, track, mom); - fillAllSpeciesPID(0, track, mom); - fillAllSpeciesPID(1, track, mom); - fillAllSpeciesPID(2, track, mom); - fillAllSpeciesPID(3, track, mom); - fillAllSpeciesPID(4, track, mom); + fillPID(track, tpcmom, tofmom); + fillSpeciesPID(0, track, tpcmom, tofmom); + fillSpeciesPID(1, track, tpcmom, tofmom); + fillSpeciesPID(2, track, tpcmom, tofmom); + fillAllSpeciesPID(0, track, tpcmom, tofmom); + fillAllSpeciesPID(1, track, tpcmom, tofmom); + fillAllSpeciesPID(2, track, tpcmom, tofmom); + fillAllSpeciesPID(3, track, tpcmom, tofmom); + fillAllSpeciesPID(4, track, tpcmom, tofmom); } } }; @@ -973,20 +985,21 @@ struct DptDptEfficiencyAndQc { int ixDCE = getDCEindex(collision); if (!(ixDCE < 0)) { for (auto const& track : tracks) { - float mom = track.p(); + float tpcmom = track.p(); + float tofmom = track.p(); if (useTPCInnerWallMomentum.value) { if constexpr (!framework::has_type_v) { - mom = track.tpcInnerParam(); + tpcmom = track.tpcInnerParam(); } } if constexpr (kindOfProcess == kBASIC) { qaDataCE[ixDCE]->processTrack(collision.posZ(), track); } if constexpr (kindOfProcess == kPID) { - pidDataCE[ixDCE]->processTrack(track, mom); + pidDataCE[ixDCE]->processTrack(track, tpcmom, tofmom); } if constexpr (kindOfProcess == kPIDEXTRA) { - pidExtraDataCE[ixDCE]->processTrack(track, mom); + pidExtraDataCE[ixDCE]->processTrack(track, tpcmom, tofmom); } } } From 257a92a36f3b6c4e96c8c48924f864d4ab0320f9 Mon Sep 17 00:00:00 2001 From: Junlee Kim Date: Thu, 19 Dec 2024 08:20:28 +0100 Subject: [PATCH 440/459] [PWGLF] replace event plane v2 with scalar product v2 (#9049) Co-authored-by: junleekim --- PWGLF/Tasks/Strangeness/lambdapolarization.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdapolarization.cxx b/PWGLF/Tasks/Strangeness/lambdapolarization.cxx index eb9b3b12dc7..309c18c43f8 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolarization.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolarization.cxx @@ -621,13 +621,14 @@ struct lambdapolarization { } double weight = cfgEffCor ? 1.0 / EffMap->GetBinContent(EffMap->GetXaxis()->FindBin(v0.pt()), EffMap->GetYaxis()->FindBin(centrality)) : 1.; + double qvecMag = TMath::Sqrt(TMath::Power(collision.qvecIm()[3 + (nmode - 2) * 28], 2) + TMath::Power(collision.qvecRe()[3 + (nmode - 2) * 28], 2)); if (nmode == 2) { //////////// if (LambdaTag) { histos.fill(HIST("psi2/h_lambda_cos"), v0.mLambda(), v0.pt(), angle, centrality, relphi, weight); histos.fill(HIST("psi2/h_lambda_cos2"), v0.mLambda(), v0.pt(), angle * angle, centrality, relphi, weight); histos.fill(HIST("psi2/h_lambda_cossin"), v0.mLambda(), v0.pt(), angle * TMath::Sin(relphi), centrality, weight); - histos.fill(HIST("psi2/h_lambda_vncos"), v0.mLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); + histos.fill(HIST("psi2/h_lambda_vncos"), v0.mLambda(), v0.pt(), qvecMag * TMath::Cos(relphi), centrality, weight); histos.fill(HIST("psi2/h_lambda_vnsin"), v0.mLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); if (cfgCalcCum) { @@ -652,7 +653,7 @@ struct lambdapolarization { histos.fill(HIST("psi2/h_alambda_cos"), v0.mAntiLambda(), v0.pt(), angle, centrality, relphi, weight); histos.fill(HIST("psi2/h_alambda_cos2"), v0.mAntiLambda(), v0.pt(), angle * angle, centrality, relphi, weight); histos.fill(HIST("psi2/h_alambda_cossin"), v0.mAntiLambda(), v0.pt(), angle * TMath::Sin(relphi), centrality, weight); - histos.fill(HIST("psi2/h_alambda_vncos"), v0.mAntiLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); + histos.fill(HIST("psi2/h_alambda_vncos"), v0.mAntiLambda(), v0.pt(), qvecMag * TMath::Cos(relphi), centrality, weight); histos.fill(HIST("psi2/h_alambda_vnsin"), v0.mAntiLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); if (cfgCalcCum) { @@ -678,14 +679,14 @@ struct lambdapolarization { histos.fill(HIST("psi3/h_lambda_cos"), v0.mLambda(), v0.pt(), angle, centrality, relphi, weight); histos.fill(HIST("psi3/h_lambda_cos2"), v0.mLambda(), v0.pt(), angle * angle, centrality, relphi, weight); histos.fill(HIST("psi3/h_lambda_cossin"), v0.mLambda(), v0.pt(), angle * TMath::Sin(relphi), centrality, weight); - histos.fill(HIST("psi3/h_lambda_vncos"), v0.mLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); + histos.fill(HIST("psi3/h_lambda_vncos"), v0.mLambda(), v0.pt(), qvecMag * TMath::Cos(relphi), centrality, weight); histos.fill(HIST("psi3/h_lambda_vnsin"), v0.mLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); } if (aLambdaTag) { histos.fill(HIST("psi3/h_alambda_cos"), v0.mAntiLambda(), v0.pt(), angle, centrality, relphi, weight); histos.fill(HIST("psi3/h_alambda_cos2"), v0.mAntiLambda(), v0.pt(), angle * angle, centrality, relphi, weight); histos.fill(HIST("psi3/h_alambda_cossin"), v0.mAntiLambda(), v0.pt(), angle * TMath::Sin(relphi), centrality, weight); - histos.fill(HIST("psi3/h_alambda_vncos"), v0.mAntiLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); + histos.fill(HIST("psi3/h_alambda_vncos"), v0.mAntiLambda(), v0.pt(), qvecMag * TMath::Cos(relphi), centrality, weight); histos.fill(HIST("psi3/h_alambda_vnsin"), v0.mAntiLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); } } else if (nmode == 4) { @@ -693,14 +694,14 @@ struct lambdapolarization { histos.fill(HIST("psi4/h_lambda_cos"), v0.mLambda(), v0.pt(), angle, centrality, relphi, weight); histos.fill(HIST("psi4/h_lambda_cos2"), v0.mLambda(), v0.pt(), angle * angle, centrality, relphi, weight); histos.fill(HIST("psi4/h_lambda_cossin"), v0.mLambda(), v0.pt(), angle * TMath::Sin(relphi), centrality, weight); - histos.fill(HIST("psi4/h_lambda_vncos"), v0.mLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); + histos.fill(HIST("psi4/h_lambda_vncos"), v0.mLambda(), v0.pt(), qvecMag * TMath::Cos(relphi), centrality, weight); histos.fill(HIST("psi4/h_lambda_vnsin"), v0.mLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); } if (aLambdaTag) { histos.fill(HIST("psi4/h_alambda_cos"), v0.mAntiLambda(), v0.pt(), angle, centrality, relphi, weight); histos.fill(HIST("psi4/h_alambda_cos2"), v0.mAntiLambda(), v0.pt(), angle * angle, centrality, relphi, weight); histos.fill(HIST("psi4/h_alambda_cossin"), v0.mAntiLambda(), v0.pt(), angle * TMath::Sin(relphi), centrality, weight); - histos.fill(HIST("psi4/h_alambda_vncos"), v0.mAntiLambda(), v0.pt(), TMath::Cos(relphi), centrality, weight); + histos.fill(HIST("psi4/h_alambda_vncos"), v0.mAntiLambda(), v0.pt(), qvecMag * TMath::Cos(relphi), centrality, weight); histos.fill(HIST("psi4/h_alambda_vnsin"), v0.mAntiLambda(), v0.pt(), TMath::Sin(relphi), centrality, weight); } } ////////// FIXME: not possible to get histograms using nmode From 50ddcaaa83403f3770a00fb1158e0896ef786d6f Mon Sep 17 00:00:00 2001 From: Marcellocosti <96481191+Marcellocosti@users.noreply.github.com> Date: Thu, 19 Dec 2024 09:16:42 +0100 Subject: [PATCH 441/459] [PWGHF] Added topological cuts and TPC transverse momentum to PID Nsigma task (#9028) Co-authored-by: ALICE Action Bot --- PWGHF/Tasks/taskPidStudies.cxx | 57 +++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/PWGHF/Tasks/taskPidStudies.cxx b/PWGHF/Tasks/taskPidStudies.cxx index 8b905524fb0..ca9947202d0 100644 --- a/PWGHF/Tasks/taskPidStudies.cxx +++ b/PWGHF/Tasks/taskPidStudies.cxx @@ -49,8 +49,8 @@ DECLARE_SOA_COLUMN(MassAntiLambda, massAntiLambda, float); //! Candidate mass DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of the candidate (GeV/c) DECLARE_SOA_COLUMN(PtPos, ptPos, float); //! Transverse momentum of positive track (GeV/c) DECLARE_SOA_COLUMN(PtNeg, ptNeg, float); //! Transverse momentum of negative track (GeV/c) -DECLARE_SOA_COLUMN(TpcInnerParPos, tpcInnerParPos, float); //! Momentum of positive track at inner wall of TPC (GeV/c) -DECLARE_SOA_COLUMN(TpcInnerParNeg, tpcInnerParNeg, float); //! Momentum of negative track at inner wall of TPC (GeV/c) +DECLARE_SOA_COLUMN(PtPosTpc, ptPosTpc, float); //! Transverse Momentum of positive track at inner wall of TPC (GeV/c) +DECLARE_SOA_COLUMN(PtNegTpc, ptNegTpc, float); //! Transverse Momentum of negative track at inner wall of TPC (GeV/c) DECLARE_SOA_COLUMN(Radius, radius, float); //! Radius DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine of pointing angle DECLARE_SOA_COLUMN(DcaV0Daughters, dcaV0Daughters, float); //! DCA between V0 daughters @@ -69,8 +69,8 @@ DECLARE_SOA_COLUMN(QtArm, qtArm, float); //! Armenteros Qt // Cascades DECLARE_SOA_COLUMN(MassOmega, massOmega, float); //! Candidate mass DECLARE_SOA_COLUMN(MassXi, massXi, float); //! Candidate mass -DECLARE_SOA_COLUMN(BachPt, bachPt, float); //! Transverse momentum of the bachelor (GeV/c) -DECLARE_SOA_COLUMN(TpcInnerParBach, tpcInnerParBach, float); //! Transverse momentum of the bachelor (GeV/c) +DECLARE_SOA_COLUMN(PtBach, ptBach, float); //! Transverse momentum of the bachelor (GeV/c) +DECLARE_SOA_COLUMN(PtBachTpc, ptBachTpc, float); //! Transverse momentum of the bachelor at inner wall of TPC (GeV/c) DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! Daughter lambda mass (GeV/c^2) DECLARE_SOA_COLUMN(V0cosPA, v0cosPA, float); //! V0 CPA DECLARE_SOA_COLUMN(CascCosPa, cascCosPa, float); //! Cascade CPA @@ -92,8 +92,8 @@ DECLARE_SOA_TABLE(PidV0s, "AOD", "PIDV0S", //! Table with PID information pid_studies::Pt, pid_studies::PtPos, pid_studies::PtNeg, - pid_studies::TpcInnerParPos, - pid_studies::TpcInnerParNeg, + pid_studies::PtPosTpc, + pid_studies::PtNegTpc, pid_studies::Radius, pid_studies::Cpa, pid_studies::DcaV0Daughters, @@ -117,8 +117,8 @@ DECLARE_SOA_TABLE(PidV0s, "AOD", "PIDV0S", //! Table with PID information DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID information pid_studies::MassOmega, pid_studies::Pt, - pid_studies::BachPt, - pid_studies::TpcInnerParBach, + pid_studies::PtBach, + pid_studies::PtBachTpc, pid_studies::Radius, pid_studies::MLambda, pid_studies::V0cosPA, @@ -146,6 +146,10 @@ struct HfTaskPidStudies { Configurable massOmegaMin{"massOmegaMin", 1.5, "Minimum mass for omega"}; Configurable massOmegaMax{"massOmegaMax", 1.8, "Maximum mass for omega"}; Configurable radiusMax{"radiusMax", 2.3, "Maximum decay radius (cm)"}; + Configurable cosPaMin{"cosPaMin", 0.98, "Minimum cosine of pointing angle"}; + Configurable dcaV0DaughtersMax{"dcaV0DaughtersMax", 0.2, "Maximum DCA among the V0 daughters (cm)"}; + Configurable dcaV0ToPvMax{"dcaV0ToPvMax", 0.2, "Maximum DCA of the V0 from the primary vertex (cm)"}; + Configurable cosPaV0Min{"cosPaV0Min", 0.95, "Minimum cosine of pointing angle for V0 stemming from cascade decays"}; Configurable qtArmenterosMinForK0{"qtArmenterosMinForK0", 0.12, "Minimum Armenteros' qt for K0"}; Configurable qtArmenterosMaxForLambda{"qtArmenterosMaxForLambda", 0.12, "Minimum Armenteros' qt for (anti)Lambda"}; Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of candidates to keep"}; @@ -184,8 +188,8 @@ struct HfTaskPidStudies { candidate.pt(), posTrack.pt(), negTrack.pt(), - posTrack.tpcInnerParam(), - negTrack.tpcInnerParam(), + posTrack.tpcInnerParam() / std::cosh(candidate.positiveeta()), + negTrack.tpcInnerParam() / std::cosh(candidate.negativeeta()), candidate.v0radius(), candidate.v0cosPA(), candidate.dcaV0daughters(), @@ -211,7 +215,7 @@ struct HfTaskPidStudies { candidate.mOmega(), candidate.pt(), candidate.bachelorpt(), - bachTrack.tpcInnerParam(), + bachTrack.tpcInnerParam() / std::cosh(candidate.bacheloreta()), candidate.cascradius(), candidate.mLambda(), candidate.v0cosPA(coll.posX(), coll.posY(), coll.posZ()), @@ -282,6 +286,15 @@ struct HfTaskPidStudies { if (v0.v0radius() > radiusMax) { return false; } + if (v0.v0cosPA() < cosPaMin) { + return false; + } + if (v0.dcaV0daughters() > dcaV0DaughtersMax) { + return false; + } + if (v0.dcav0topv() > dcaV0ToPvMax) { + return false; + } return true; } @@ -298,6 +311,15 @@ struct HfTaskPidStudies { if (v0.v0radius() > radiusMax) { return false; } + if (v0.v0cosPA() < cosPaMin) { + return false; + } + if (v0.dcaV0daughters() > dcaV0DaughtersMax) { + return false; + } + if (v0.dcav0topv() > dcaV0ToPvMax) { + return false; + } return true; } @@ -313,6 +335,19 @@ struct HfTaskPidStudies { if (casc.cascradius() > radiusMax) { return false; } + const auto& coll = casc.template collision_as(); + if (casc.casccosPA(coll.posX(), coll.posY(), coll.posZ()) < cosPaMin) { + return false; + } + if (casc.dcaV0daughters() > dcaV0DaughtersMax) { + return false; + } + if (casc.dcav0topv(coll.posX(), coll.posY(), coll.posZ()) > dcaV0ToPvMax) { + return false; + } + if (casc.v0cosPA(coll.posX(), coll.posY(), coll.posZ()) < cosPaV0Min) { + return false; + } return true; } From 2d30d8031f9f1b58c89b7cb191b55ce3bf521176 Mon Sep 17 00:00:00 2001 From: upasanasharma31 <84681984+upasanasharma31@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:26:39 +0530 Subject: [PATCH 442/459] [DPG] Bug: Fix histogram filling for Mother pT and Decay Length (#9056) --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 20edd0ace9f..e202302c950 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -1156,12 +1156,13 @@ struct QaEfficiency { for (const auto& pdgToCheck : mothersPDGs.value) { if (mother.pdgCode() == pdgToCheck) { motherIsAccepted = true; - break; - } - if (motherIsAccepted) { // Calculate the decay length double decayLength = std::sqrt(std::pow(mother.vx() - mother.mcCollision().posX(), 2) + std::pow(mother.vy() - mother.mcCollision().posY(), 2) + std::pow(mother.vz() - mother.mcCollision().posZ(), 2)); hdecaylengthmother[histogramIndex]->Fill(decayLength); + break; + } + if (motherIsAccepted) { + break; } } } @@ -1260,10 +1261,11 @@ struct QaEfficiency { for (const auto& pdgToCheck : mothersPDGs.value) { if (mother.pdgCode() == pdgToCheck) { motherIsAccepted = true; // Mother matches the list of specified PDGs + hPtmotherGenerated[histogramIndex]->Fill(mother.pt()); // Fill generated pT for mother break; } if (motherIsAccepted) { - hPtmotherGenerated[histogramIndex]->Fill(mother.pt()); // Fill generated pT for mother + break; } } } From d917f0fe94422e21a59e88b1597dfaad397c1a22 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Thu, 19 Dec 2024 10:09:25 +0100 Subject: [PATCH 443/459] [Common] add Run2TracksExtra converter (#9039) Co-authored-by: ALICE Builder --- .../TableProducer/Converters/CMakeLists.txt | 5 +++ .../Converters/run2tracksExtraConverter.cxx | 44 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 Common/TableProducer/Converters/run2tracksExtraConverter.cxx diff --git a/Common/TableProducer/Converters/CMakeLists.txt b/Common/TableProducer/Converters/CMakeLists.txt index eda31568123..0033b60c940 100644 --- a/Common/TableProducer/Converters/CMakeLists.txt +++ b/Common/TableProducer/Converters/CMakeLists.txt @@ -93,3 +93,8 @@ o2physics_add_dpl_workflow(trackqa-converter-002 SOURCES trackQA002Converter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(run2-tracks-extra-converter + SOURCES run2tracksExtraConverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/Common/TableProducer/Converters/run2tracksExtraConverter.cxx b/Common/TableProducer/Converters/run2tracksExtraConverter.cxx new file mode 100644 index 00000000000..2cb11174ef4 --- /dev/null +++ b/Common/TableProducer/Converters/run2tracksExtraConverter.cxx @@ -0,0 +1,44 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file tracksExtraConverter.cxx +/// \brief Converts TracksExtra table from version 000 to 001 + +/// This task allows for the conversion of the TracksExtra table from version 000 to 001. +/// The conversion is needed because the table has been extended with the ITSClusterSize column +/// and the ITSClusterMap column is evaluated dynamically from it. +/// In the converter a dummy ITSClusterSize column is filled with overflows if a hit in the layer is present + +/// \author F.Mazzaschi + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" + +using namespace o2; +using namespace o2::framework; + +struct Run2TracksExtraConverter { + Produces Run2TrackExtras_001; + void process(aod::Run2TrackExtras_000 const& Run2TrackExtras_000) + { + + for (const auto& track0 : Run2TrackExtras_000) { + Run2TrackExtras_001(track0.itsSignal(), 0); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From ff2a4fe9f3f559cbeeb1d9468091068cf16f7e4d Mon Sep 17 00:00:00 2001 From: SuJeong Ji <120470463+SuJeong-Ji@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:25:49 +0900 Subject: [PATCH 444/459] [PWGLF] Added some configurables and pp analysis code for test (#8993) Co-authored-by: ALICE Action Bot --- PWGLF/Tasks/Resonances/CMakeLists.txt | 5 + PWGLF/Tasks/Resonances/chk892flow.cxx | 273 ++++--- PWGLF/Tasks/Resonances/chk892flow_pp.cxx | 931 +++++++++++++++++++++++ PWGLF/Tasks/Resonances/chk892pp.cxx | 931 +++++++++++++++++++++++ 4 files changed, 2017 insertions(+), 123 deletions(-) create mode 100644 PWGLF/Tasks/Resonances/chk892flow_pp.cxx create mode 100644 PWGLF/Tasks/Resonances/chk892pp.cxx diff --git a/PWGLF/Tasks/Resonances/CMakeLists.txt b/PWGLF/Tasks/Resonances/CMakeLists.txt index 6988da46437..e7d08dc500c 100644 --- a/PWGLF/Tasks/Resonances/CMakeLists.txt +++ b/PWGLF/Tasks/Resonances/CMakeLists.txt @@ -168,3 +168,8 @@ o2physics_add_dpl_workflow(chk892flow SOURCES chk892flow.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(chk892pp + SOURCES chk892pp.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/Resonances/chk892flow.cxx b/PWGLF/Tasks/Resonances/chk892flow.cxx index 7bc523eb9e0..06405f06d19 100644 --- a/PWGLF/Tasks/Resonances/chk892flow.cxx +++ b/PWGLF/Tasks/Resonances/chk892flow.cxx @@ -151,11 +151,6 @@ struct chk892flow { // Cuts from polarization analysis Configurable cfgQvecSel{"cfgQvecSel", true, "Reject events when no QVector"}; - Configurable cfgOccupancySel{"cfgOccupancySel", false, "Occupancy selection"}; - Configurable cfgMaxOccupancy{"cfgMaxOccupancy", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; - Configurable cfgMinOccupancy{"cfgMinOccupancy", -100, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; - Configurable cfgNCollinTR{"cfgNCollinTR", false, "Additional selection for the number of coll in time range"}; - Configurable cfgCentEst{"cfgCentEst", 1, "Centrality estimator, 1: FT0C, 2: FT0M"}; // DCAr to PV @@ -164,6 +159,7 @@ struct chk892flow { Configurable cMaxbDCAzToPVcut{"cMaxbDCAzToPVcut", 0.1, "Track DCAz cut to PV Maximum"}; /// PID Selections, pion + Configurable cTPConly{"cTPConly", false, "Use only TPC for PID"}; // bool Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 3.0, "TPC nSigma cut for Pion"}; // TPC Configurable cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; // Combined @@ -188,6 +184,7 @@ struct chk892flow { // Secondary Selection Configurable cfgReturnFlag{"boolReturnFlag", false, "Return Flag for debugging"}; + Configurable cSecondaryRequire{"bool", true, "Secondary cuts on/off"}; Configurable cSecondaryArmenterosCut{"boolArmenterosCut", true, "cut on Armenteros-Podolanski graph"}; Configurable cfgByPassDauPIDSelection{"cfgByPassDauPIDSelection", true, "Bypass Daughters PID selection"}; @@ -202,7 +199,7 @@ struct chk892flow { Configurable cSecondaryDCAtoPVMax{"cSecondaryDCAtoPVMax", 0.3, "Maximum DCA Secondary to PV"}; Configurable cSecondaryProperLifetimeMax{"cSecondaryProperLifetimeMax", 20, "Maximum Secondary Lifetime"}; Configurable cSecondaryparamArmenterosCut{"paramArmenterosCut", 0.2, "parameter for Armenteros Cut"}; - Configurable cSecondaryMassWindow{"cSecondaryMassWindow", 0.075, "Secondary inv mass selciton window"}; + Configurable cSecondaryMassWindow{"cSecondaryMassWindow", 0.03, "Secondary inv mass selciton window"}; // K* selection Configurable cKstarMaxRap{"cKstarMaxRap", 0.5, "Kstar maximum rapidity"}; @@ -278,10 +275,6 @@ struct chk892flow { histos.add("QA/before/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); // EventPlane - histos.add("QA/EP/EPhEPDet", "Event plane distribution of FT0C (Det = A)", {HistType::kTH2D, {centAxis, epAxis}}); - histos.add("QA/EP/EPhEPB", "Event plane distribution of TPCpos (B)", {HistType::kTH2D, {centAxis, epAxis}}); - histos.add("QA/EP/EPhEPC", "Event plane distribution of TPCneg (C)", {HistType::kTH2D, {centAxis, epAxis}}); - histos.add("QA/EP/hEPDet", "Event plane distribution of FT0C (Det = A)", {HistType::kTH2D, {centAxis, epAxis}}); histos.add("QA/EP/hEPB", "Event plane distribution of TPCpos (B)", {HistType::kTH2D, {centAxis, epAxis}}); histos.add("QA/EP/hEPC", "Event plane distribution of TPCneg (C)", {HistType::kTH2D, {centAxis, epAxis}}); @@ -540,24 +533,38 @@ struct chk892flow { bool selectionPIDPion(TrackType const& candidate) { bool tpcPIDPassed{false}, tofPIDPassed{false}; - if (std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { - tpcPIDPassed = true; - } else { - return false; - } - if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaPi()) < cMaxTOFnSigmaPion) { - tofPIDPassed = true; - } - if ((nsigmaCutCombinedPion > 0) && (candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < nsigmaCutCombinedPion * nsigmaCutCombinedPion)) { - tofPIDPassed = true; + + if (cTPConly) { + + if (std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { + tpcPIDPassed = true; + } else { + return false; } + tofPIDPassed = true; + } else { - if (!cTOFVeto) { + + if (std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { + tpcPIDPassed = true; + } else { return false; } - tofPIDPassed = true; + if (candidate.hasTOF()) { + if (std::abs(candidate.tofNSigmaPi()) < cMaxTOFnSigmaPion) { + tofPIDPassed = true; + } + if ((nsigmaCutCombinedPion > 0) && (candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < nsigmaCutCombinedPion * nsigmaCutCombinedPion)) { + tofPIDPassed = true; + } + } else { + if (!cTOFVeto) { + return false; + } + tofPIDPassed = true; + } } + if (tpcPIDPassed && tofPIDPassed) { return true; } @@ -581,112 +588,132 @@ struct chk892flow { if (cfgReturnFlag) { bool returnFlag = true; - histos.fill(HIST("QA/K0sCutCheck"), 0); - if (DauDCA > cSecondaryDauDCAMax) { - histos.fill(HIST("QA/K0sCutCheck"), 1); - returnFlag = false; - } - if (DauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { - histos.fill(HIST("QA/K0sCutCheck"), 2); - returnFlag = false; - } - if (DauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { - histos.fill(HIST("QA/K0sCutCheck"), 3); - returnFlag = false; - } - if (pT < cSecondaryPtMin) { - histos.fill(HIST("QA/K0sCutCheck"), 4); - returnFlag = false; - } - if (Rapidity > cSecondaryRapidityMax) { - histos.fill(HIST("QA/K0sCutCheck"), 5); - returnFlag = false; - } - if (Radius < cSecondaryRadiusMin) { - histos.fill(HIST("QA/K0sCutCheck"), 6); - returnFlag = false; - } - if (DCAtoPV > cSecondaryDCAtoPVMax) { - histos.fill(HIST("QA/K0sCutCheck"), 7); - returnFlag = false; - } - if (CPA < cSecondaryCosPAMin) { - histos.fill(HIST("QA/K0sCutCheck"), 8); - returnFlag = false; - } - if (PropTauK0s > cSecondaryProperLifetimeMax) { - histos.fill(HIST("QA/K0sCutCheck"), 9); - returnFlag = false; - } - if (fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { - histos.fill(HIST("QA/K0sCutCheck"), 10); - returnFlag = false; - } - if (candidate.qtarm() < cSecondaryparamArmenterosCut * TMath::Abs(candidate.alpha())) { - histos.fill(HIST("QA/K0sCutCheck"), 11); - returnFlag = false; + if (cSecondaryRequire) { + histos.fill(HIST("QA/K0sCutCheck"), 0); + if (DauDCA > cSecondaryDauDCAMax) { + histos.fill(HIST("QA/K0sCutCheck"), 1); + returnFlag = false; + } + if (DauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 2); + returnFlag = false; + } + if (DauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 3); + returnFlag = false; + } + if (pT < cSecondaryPtMin) { + histos.fill(HIST("QA/K0sCutCheck"), 4); + returnFlag = false; + } + if (Rapidity > cSecondaryRapidityMax) { + histos.fill(HIST("QA/K0sCutCheck"), 5); + returnFlag = false; + } + if (Radius < cSecondaryRadiusMin) { + histos.fill(HIST("QA/K0sCutCheck"), 6); + returnFlag = false; + } + if (DCAtoPV > cSecondaryDCAtoPVMax) { + histos.fill(HIST("QA/K0sCutCheck"), 7); + returnFlag = false; + } + if (CPA < cSecondaryCosPAMin) { + histos.fill(HIST("QA/K0sCutCheck"), 8); + returnFlag = false; + } + if (PropTauK0s > cSecondaryProperLifetimeMax) { + histos.fill(HIST("QA/K0sCutCheck"), 9); + returnFlag = false; + } + if (candidate.qtarm() < cSecondaryparamArmenterosCut * TMath::Abs(candidate.alpha())) { + histos.fill(HIST("QA/K0sCutCheck"), 11); + returnFlag = false; + } + if (std::fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + returnFlag = false; + } + + return returnFlag; + + } else { + if (std::fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + returnFlag = false; + } + + return returnFlag; } - return returnFlag; } else { - histos.fill(HIST("QA/K0sCutCheck"), 0); - if (DauDCA > cSecondaryDauDCAMax) { - histos.fill(HIST("QA/K0sCutCheck"), 1); - return false; - } - if (DauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { - histos.fill(HIST("QA/K0sCutCheck"), 2); - return false; - } - if (DauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { - histos.fill(HIST("QA/K0sCutCheck"), 3); - return false; - } - if (pT < cSecondaryPtMin) { - histos.fill(HIST("QA/K0sCutCheck"), 4); - return false; - } - if (Rapidity > cSecondaryRapidityMax) { - histos.fill(HIST("QA/K0sCutCheck"), 5); - return false; - } - if (Radius < cSecondaryRadiusMin) { - histos.fill(HIST("QA/K0sCutCheck"), 6); - return false; - } - if (DCAtoPV > cSecondaryDCAtoPVMax) { - histos.fill(HIST("QA/K0sCutCheck"), 7); - return false; - } - if (CPA < cSecondaryCosPAMin) { - histos.fill(HIST("QA/K0sCutCheck"), 8); - return false; - } - if (PropTauK0s > cSecondaryProperLifetimeMax) { - histos.fill(HIST("QA/K0sCutCheck"), 9); - return false; - } - if (fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { - histos.fill(HIST("QA/K0sCutCheck"), 10); - return false; - } - if (candidate.qtarm() < cSecondaryparamArmenterosCut * TMath::Abs(candidate.alpha())) { - histos.fill(HIST("QA/K0sCutCheck"), 11); - return false; + if (cSecondaryRequire) { + + histos.fill(HIST("QA/K0sCutCheck"), 0); + if (DauDCA > cSecondaryDauDCAMax) { + histos.fill(HIST("QA/K0sCutCheck"), 1); + return false; + } + if (DauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 2); + return false; + } + if (DauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 3); + return false; + } + if (pT < cSecondaryPtMin) { + histos.fill(HIST("QA/K0sCutCheck"), 4); + return false; + } + if (Rapidity > cSecondaryRapidityMax) { + histos.fill(HIST("QA/K0sCutCheck"), 5); + return false; + } + if (Radius < cSecondaryRadiusMin) { + histos.fill(HIST("QA/K0sCutCheck"), 6); + return false; + } + if (DCAtoPV > cSecondaryDCAtoPVMax) { + histos.fill(HIST("QA/K0sCutCheck"), 7); + return false; + } + if (CPA < cSecondaryCosPAMin) { + histos.fill(HIST("QA/K0sCutCheck"), 8); + return false; + } + if (PropTauK0s > cSecondaryProperLifetimeMax) { + histos.fill(HIST("QA/K0sCutCheck"), 9); + return false; + } + if (candidate.qtarm() < cSecondaryparamArmenterosCut * TMath::Abs(candidate.alpha())) { + histos.fill(HIST("QA/K0sCutCheck"), 11); + return false; + } + if (std::fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + return false; + } + return true; + + } else { + if (std::fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + return false; + } + return true; } - return true; } - } // selectionK0s double GetPhiInRange(double phi) { double result = phi; while (result < 0) { - result = result + 2. * TMath::Pi() / 2; + result = result + 2. * o2::constants::math::PI / 2; } - while (result > 2. * TMath::Pi() / 2) { - result = result - 2. * TMath::Pi() / 2; + while (result > 2. * o2::constants::math::PI / 2) { + result = result - 2. * o2::constants::math::PI / 2; } return result; } @@ -694,28 +721,28 @@ struct chk892flow { template bool isTrueKstar(const TrackTemplate& bTrack, const V0Template& K0scand) { - if (abs(bTrack.PDGCode()) != kPiPlus) // Are you pion? + if (std::abs(bTrack.PDGCode()) != kPiPlus) // Are you pion? return false; - if (abs(K0scand.PDGCode()) != kPDGK0s) // Are you K0s? + if (std::abs(K0scand.PDGCode()) != kPDGK0s) // Are you K0s? return false; auto motherbTrack = bTrack.template mothers_as(); auto motherkV0 = K0scand.template mothers_as(); // Check bTrack first - if (abs(motherbTrack.pdgCode()) != kKstarPlus) // Are you charged Kstar's daughter? + if (std::abs(motherbTrack.pdgCode()) != kKstarPlus) // Are you charged Kstar's daughter? return false; // Apply first since it's more restrictive - if (abs(motherkV0.pdgCode()) != 310) // Is it K0s? + if (std::abs(motherkV0.pdgCode()) != 310) // Is it K0s? return false; // Check if K0s's mother is K0 (311) auto motherK0 = motherkV0.template mothers_as(); - if (abs(motherK0.pdgCode()) != 311) + if (std::abs(motherK0.pdgCode()) != 311) return false; // Check if K0's mother is Kstar (323) auto motherKstar = motherK0.template mothers_as(); - if (abs(motherKstar.pdgCode()) != 323) + if (std::abs(motherKstar.pdgCode()) != 323) return false; // Check if bTrack and K0 have the same mother (global index) diff --git a/PWGLF/Tasks/Resonances/chk892flow_pp.cxx b/PWGLF/Tasks/Resonances/chk892flow_pp.cxx new file mode 100644 index 00000000000..2adc9170064 --- /dev/null +++ b/PWGLF/Tasks/Resonances/chk892flow_pp.cxx @@ -0,0 +1,931 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file chk892_pp.cxx +/// \brief Reconstruction of track-track decay resonance candidates +/// +/// +/// \author Su-Jeong Ji + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // FIXME +#include // FIXME + +#include +#include +#include +#include +#include +#include + +#include "TRandom3.h" +#include "TF1.h" +#include "TVector2.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "Math/GenVector/Boost.h" +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/StaticFor.h" +#include "DCAFitter/DCAFitterN.h" + +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" + +#include "Common/Core/trackUtilities.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/RecoDecay.h" + +#include "CommonConstants/PhysicsConstants.h" + +#include "ReconstructionDataFormats/Track.h" + +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" + +#include "CCDB/CcdbApi.h" +#include "CCDB/BasicCCDBManager.h" + +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/Utils/collisionCuts.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; +using namespace o2::constants::physics; + +struct chk892_pp { + enum binType : unsigned int { + kKstarP = 0, + kKstarN, + kKstarP_Mix, + kKstarN_Mix, + kKstarP_GenINEL10, + kKstarN_GenINEL10, + kKstarP_GenINELgt10, + kKstarN_GenINELgt10, + kKstarP_GenTrig10, + kKstarN_GenTrig10, + kKstarP_GenEvtSel, + kKstarN_GenEvtSel, + kKstarP_Rec, + kKstarN_Rec, + kTYEnd + }; + + SliceCache cache; + Preslice perCollision = aod::track::collisionId; + + using EventCandidates = soa::Join; + // using EventCandidates = soa::Join; + using TrackCandidates = soa::Join; + using V0Candidates = aod::V0Datas; + + using MCEventCandidates = soa::Join; + using MCTrackCandidates = soa::Join; + using MCV0Candidates = soa::Join; + + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Service ccdb; + Service pdg; + o2::ccdb::CcdbApi ccdbApi; + + Configurable cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; + Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"}; + + // Configurables + ConfigurableAxis cfgBinsPt{"cfgBinsPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 12.7, 12.8, 12.9, 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 14.0, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 14.9, 15.0}, "Binning of the pT axis"}; + ConfigurableAxis cfgBinsPtQA{"cfgBinsPtQA", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8, 7.0, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, 8.6, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.0}, "Binning of the pT axis"}; + ConfigurableAxis cfgBinsCent{"cfgBinsCent", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; + ConfigurableAxis cfgBinsVtxZ{"cfgBinsVtxZ", {VARIABLE_WIDTH, -10.0, -9.0, -8.0, -7.0, -6.0, -5.0, -4.0, -3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "Binning of the z-vertex axis"}; + Configurable cNbinsDiv{"cNbinsDiv", 1, "Integer to divide the number of bins"}; + + /// Event cuts + o2::analysis::CollisonCuts colCuts; + Configurable ConfEvtZvtx{"ConfEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable ConfEvtOccupancyInTimeRangeMax{"ConfEvtOccupancyInTimeRangeMax", -1, "Evt sel: maximum track occupancy"}; + Configurable ConfEvtOccupancyInTimeRangeMin{"ConfEvtOccupancyInTimeRangeMin", -1, "Evt sel: minimum track occupancy"}; + Configurable ConfEvtTriggerCheck{"ConfEvtTriggerCheck", false, "Evt sel: check for trigger"}; + Configurable ConfEvtTriggerSel{"ConfEvtTriggerSel", 8, "Evt sel: trigger"}; + Configurable ConfEvtOfflineCheck{"ConfEvtOfflineCheck", true, "Evt sel: check for offline selection"}; + Configurable ConfEvtTriggerTVXSel{"ConfEvtTriggerTVXSel", false, "Evt sel: triggerTVX selection (MB)"}; + Configurable ConfEvtTFBorderCut{"ConfEvtTFBorderCut", false, "Evt sel: apply TF border cut"}; + Configurable ConfEvtUseITSTPCvertex{"ConfEvtUseITSTPCvertex", false, "Evt sel: use at lease on ITS-TPC track for vertexing"}; + Configurable ConfEvtZvertexTimedifference{"ConfEvtZvertexTimedifference", true, "Evt sel: apply Z-vertex time difference"}; + Configurable ConfEvtPileupRejection{"ConfEvtPileupRejection", true, "Evt sel: apply pileup rejection"}; + Configurable ConfEvtNoITSROBorderCut{"ConfEvtNoITSROBorderCut", false, "Evt sel: apply NoITSRO border cut"}; + Configurable ConfincludeCentralityMC{"ConfincludeCentralityMC", false, "Include centrality in MC"}; + Configurable ConfEvtCollInTimeRangeStandard{"ConfEvtCollInTimeRangeStandard", true, "Evt sel: apply NoCollInTimeRangeStandard"}; + + /// Track selections + Configurable cMinPtcut{"cMinPtcut", 0.15, "Track minium pt cut"}; + Configurable cMaxEtacut{"cMaxEtacut", 0.8, "Track maximum eta cut"}; + + /* + // Cuts from polarization analysis + Configurable cfgOccupancySel{"cfgOccupancySel", false, "Occupancy selection"}; + Configurable cfgMaxOccupancy{"cfgMaxOccupancy", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + Configurable cfgMinOccupancy{"cfgMinOccupancy", -100, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + Configurable cfgNCollinTR{"cfgNCollinTR", false, "Additional selection for the number of coll in time range"}; +*/ + Configurable cfgCentEst{"cfgCentEst", 1, "Centrality estimator, 1: FT0C, 2: FT0M"}; + + // DCAr to PV + Configurable cMaxbDCArToPVcut{"cMaxbDCArToPVcut", 0.1, "Track DCAr cut to PV Maximum"}; + // DCAz to PV + Configurable cMaxbDCAzToPVcut{"cMaxbDCAzToPVcut", 0.1, "Track DCAz cut to PV Maximum"}; + + /// PID Selections, pion + Configurable cTPConly{"cTPConly", true, "Use only TPC for PID"}; // bool + Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 3.0, "TPC nSigma cut for Pion"}; // TPC + Configurable cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF + Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; // Combined + Configurable cTOFVeto{"cTOFVeto", true, "TOF Veto, if false, TOF is nessessary for PID selection"}; // TOF Veto + + // Track selections + Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) + Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgPVContributor{"cfgPVContributor", false, "PV contributor track selection"}; // PV Contriuibutor + + Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; + Configurable cfgTPCcluster{"cfgTPCcluster", 0, "Number of TPC cluster"}; + Configurable cfgRatioTPCRowsOverFindableCls{"cfgRatioTPCRowsOverFindableCls", 0.0f, "TPC Crossed Rows to Findable Clusters"}; + Configurable cfgITSChi2NCl{"cfgITSChi2NCl", 999.0, "ITS Chi2/NCl"}; + Configurable cfgTPCChi2NCl{"cfgTPCChi2NCl", 999.0, "TPC Chi2/NCl"}; + Configurable cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"}; + Configurable cfgUseITSRefit{"cfgUseITSRefit", false, "Require ITS Refit"}; + Configurable cfgHasITS{"cfgHasITS", false, "Require ITS"}; + Configurable cfgHasTPC{"cfgHasTPC", false, "Require TPC"}; + Configurable cfgHasTOF{"cfgHasTOF", false, "Require TOF"}; + + // Secondary Selection + Configurable cfgReturnFlag{"boolReturnFlag", false, "Return Flag for debugging"}; + Configurable cSecondaryRequire{"bool", true, "Secondary cuts on/off"}; + Configurable cSecondaryArmenterosCut{"boolArmenterosCut", true, "cut on Armenteros-Podolanski graph"}; + + Configurable cfgByPassDauPIDSelection{"cfgByPassDauPIDSelection", true, "Bypass Daughters PID selection"}; + Configurable cSecondaryDauDCAMax{"cSecondaryDauDCAMax", 1., "Maximum DCA Secondary daughters to PV"}; + Configurable cSecondaryDauPosDCAtoPVMin{"cSecondaryDauPosDCAtoPVMin", 0.0, "Minimum DCA Secondary positive daughters to PV"}; + Configurable cSecondaryDauNegDCAtoPVMin{"cSecondaryDauNegDCAtoPVMin", 0.0, "Minimum DCA Secondary negative daughters to PV"}; + + Configurable cSecondaryPtMin{"cSecondaryPtMin", 0.f, "Minimum transverse momentum of Secondary"}; + Configurable cSecondaryRapidityMax{"cSecondaryRapidityMax", 0.5, "Maximum rapidity of Secondary"}; + Configurable cSecondaryRadiusMin{"cSecondaryRadiusMin", 1.2, "Minimum transverse radius of Secondary"}; + Configurable cSecondaryCosPAMin{"cSecondaryCosPAMin", 0.995, "Mininum cosine pointing angle of Secondary"}; + Configurable cSecondaryDCAtoPVMax{"cSecondaryDCAtoPVMax", 0.3, "Maximum DCA Secondary to PV"}; + Configurable cSecondaryProperLifetimeMax{"cSecondaryProperLifetimeMax", 20, "Maximum Secondary Lifetime"}; + Configurable cSecondaryparamArmenterosCut{"paramArmenterosCut", 0.2, "parameter for Armenteros Cut"}; + Configurable cSecondaryMassWindow{"cSecondaryMassWindow", 0.075, "Secondary inv mass selciton window"}; + + // K* selection + Configurable cKstarMaxRap{"cKstarMaxRap", 0.5, "Kstar maximum rapidity"}; + Configurable cKstarMinRap{"cKstarMinRap", -0.5, "Kstar minimum rapidity"}; + + float centrality; + + // PDG code + int kPDGK0s = 310; + int kPDGK0 = 311; + int kKstarPlus = 323; + int kPiPlus = 211; + + void init(o2::framework::InitContext&) + { + centrality = -999; + + colCuts.setCuts(ConfEvtZvtx, ConfEvtTriggerCheck, ConfEvtTriggerSel, ConfEvtOfflineCheck, /*checkRun3*/ true, /*triggerTVXsel*/ false, ConfEvtOccupancyInTimeRangeMax, ConfEvtOccupancyInTimeRangeMin); + colCuts.init(&histos); + colCuts.setTriggerTVX(ConfEvtTriggerTVXSel); + colCuts.setApplyTFBorderCut(ConfEvtTFBorderCut); + colCuts.setApplyITSTPCvertex(ConfEvtUseITSTPCvertex); + colCuts.setApplyZvertexTimedifference(ConfEvtZvertexTimedifference); + colCuts.setApplyPileupRejection(ConfEvtPileupRejection); + colCuts.setApplyNoITSROBorderCut(ConfEvtNoITSROBorderCut); + colCuts.setApplyCollInTimeRangeStandard(ConfEvtCollInTimeRangeStandard); + + AxisSpec centAxis = {cfgBinsCent, "T0M (%)"}; + AxisSpec vtxzAxis = {cfgBinsVtxZ, "Z Vertex (cm)"}; + AxisSpec epAxis = {100, -1.0 * constants::math::PI, constants::math::PI}; + AxisSpec epresAxis = {100, -1.02, 1.02}; + AxisSpec ptAxis = {cfgBinsPt, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec ptAxisQA = {cfgBinsPtQA, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec radiusAxis = {50, 0, 5, "Radius (cm)"}; + AxisSpec cpaAxis = {50, 0.95, 1.0, "CPA"}; + AxisSpec tauAxis = {250, 0, 25, "Lifetime (cm)"}; + AxisSpec dcaAxis = {200, 0, 2, "DCA (cm)"}; + AxisSpec dcaxyAxis = {200, 0, 2, "DCA_{#it{xy}} (cm)"}; + AxisSpec dcazAxis = {200, 0, 2, "DCA_{#it{z}} (cm)"}; + AxisSpec yAxis = {100, -1, 1, "Rapidity"}; + AxisSpec invMassAxisK0s = {400 / cNbinsDiv, 0.3, 0.7, "Invariant Mass (GeV/#it{c}^2)"}; // K0s ~497.611 + AxisSpec invMassAxisReso = {900 / cNbinsDiv, 0.5f, 1.4f, "Invariant Mass (GeV/#it{c}^2)"}; // chK(892) ~892 + AxisSpec invMassAxisScan = {150, 0, 1.5, "Invariant Mass (GeV/#it{c}^2)"}; // For selection + AxisSpec pidQAAxis = {130, -6.5, 6.5}; + AxisSpec dataTypeAxis = {9, 0, 9, "Histogram types"}; + AxisSpec mcTypeAxis = {4, 0, 4, "Histogram types"}; + + // THnSparse + AxisSpec axisType = {binType::kTYEnd, 0, binType::kTYEnd, "Type of bin with charge and mix"}; + AxisSpec mcLabelAxis = {5, -0.5, 4.5, "MC Label"}; + + histos.add("QA/K0sCutCheck", "Check K0s cut", HistType::kTH1D, {AxisSpec{12, -0.5, 11.5, "Check"}}); + + histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); + histos.add("QA/before/VtxZ", "Centrality distribution", {HistType::kTH1D, {vtxzAxis}}); + histos.add("QA/before/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); + + // Bachelor pion + histos.add("QA/before/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QA/before/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + histos.add("QA/after/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QA/after/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 1 + histos.add("QA/before/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/before/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + + histos.add("QA/after/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/after/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + + // Secondary pion 2 + histos.add("QA/before/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/before/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + histos.add("QA/after/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/after/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + // K0s + histos.add("QA/before/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QA/before/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QA/before/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QA/before/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QA/before/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QA/before/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + histos.add("QA/after/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QA/after/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QA/after/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QA/after/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QA/after/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QA/after/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + // Kstar + // Invariant mass nSparse + histos.add("QA/before/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + histos.add("hInvmass_Kstar", "Invariant mass of unlike-sign chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso}); + histos.add("hInvmass_Kstar_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso}); + + // Mass QA (quick check) + histos.add("QA/before/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QA/before/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); + + histos.add("QA/after/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + histos.add("QA/after/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QA/after/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); + + // MC + if (doprocessMC) { + + histos.add("QAMC/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); + // Bachelor pion + histos.add("QAMC/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QAMC/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 1 + histos.add("QAMC/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QAMC/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 2 + histos.add("QAMC/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QAMC/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + // Secondary Resonance (K0s cand) + histos.add("QAMC/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + + histos.add("QAMC/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QAMC/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QAMC/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QAMC/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QAMC/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QAMC/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + // K892 + histos.add("QAMC/KstarOA", "Opening angle of chK(892)", HistType::kTH1D, {AxisSpec{100, 0, 3.14, "Opening angle"}}); + histos.add("QAMC/KstarPairAsym", "Pair asymmetry of chK(892)", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QAMC/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + + histos.add("QAMC/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QAMC/kstarinvmass_noKstar", "Invariant mass of unlike-sign no chK(892)", HistType::kTH1D, {invMassAxisReso}); + + histos.add("hInvmass_Kstar_MC", "Invariant mass of unlike chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso}); + + ccdb->setURL(cfgURL); + ccdbApi.init("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + } + + // Print output histograms statistics + LOG(info) << "Size of the histograms in chK(892) Analysis Task"; + histos.print(); + } + + template + float GetCentrality(CollisionType const& collision) + { + if (cfgCentEst == 1) { + return collision.multFT0C(); + } else if (cfgCentEst == 2) { + return collision.multFT0M(); + } else { + return -999; + } + } + + template + int GetDetId(DetNameType const& name) + { + LOGF(info, "GetDetID running"); + if (name.value == "FT0C") { + return 0; + } else if (name.value == "FT0A") { + return 1; + } else if (name.value == "FT0M") { + return 2; + } else if (name.value == "FV0A") { + return 3; + } else if (name.value == "TPCpos") { + return 4; + } else if (name.value == "TPCneg") { + return 5; + } else { + return false; + } + } + + // Track selection + template + bool trackCut(TrackType const& track) + { + // basic track cuts + if (std::abs(track.pt()) < cMinPtcut) + return false; + if (std::abs(track.eta()) > cMaxEtacut) + return false; + if (track.itsNCls() < cfgITScluster) + return false; + if (track.tpcNClsFound() < cfgTPCcluster) + return false; + if (track.tpcCrossedRowsOverFindableCls() < cfgRatioTPCRowsOverFindableCls) + return false; + if (track.itsChi2NCl() >= cfgITSChi2NCl) + return false; + if (track.tpcChi2NCl() >= cfgTPCChi2NCl) + return false; + if (cfgHasITS && !track.hasITS()) + return false; + if (cfgHasTPC && !track.hasTPC()) + return false; + if (cfgHasTOF && !track.hasTOF()) + return false; + if (cfgUseITSRefit && !track.passedITSRefit()) + return false; + if (cfgUseTPCRefit && !track.passedTPCRefit()) + return false; + if (cfgPVContributor && !track.isPVContributor()) + return false; + if (cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) + return false; + if (cfgGlobalTrack && !track.isGlobalTrack()) + return false; + if (cfgPrimaryTrack && !track.isPrimaryTrack()) + return false; + if (std::abs(track.dcaXY()) > cMaxbDCArToPVcut) + return false; + if (std::abs(track.dcaZ()) > cMaxbDCAzToPVcut) + return false; + return true; + } + + // PID selection tools + template + bool selectionPIDPion(TrackType const& candidate) + { + bool tpcPIDPassed{false}, tofPIDPassed{false}; + + if (cTPConly) { + + if (std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { + tpcPIDPassed = true; + } else { + return false; + } + tofPIDPassed = true; + + } else { + + if (std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { + tpcPIDPassed = true; + } else { + return false; + } + if (candidate.hasTOF()) { + if (std::abs(candidate.tofNSigmaPi()) < cMaxTOFnSigmaPion) { + tofPIDPassed = true; + } + if ((nsigmaCutCombinedPion > 0) && (candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < nsigmaCutCombinedPion * nsigmaCutCombinedPion)) { + tofPIDPassed = true; + } + } else { + if (!cTOFVeto) { + return false; + } + tofPIDPassed = true; + } + } + + if (tpcPIDPassed && tofPIDPassed) { + return true; + } + return false; + } + + template + bool selectionK0s(CollisionType const& collision, K0sType const& candidate) + { + auto DauDCA = candidate.dcaV0daughters(); + auto DauPosDCAtoPV = candidate.dcapostopv(); + auto DauNegDCAtoPV = candidate.dcanegtopv(); + auto pT = candidate.pt(); + auto Rapidity = candidate.yK0Short(); + auto Radius = candidate.v0radius(); + auto DCAtoPV = candidate.dcav0topv(); + auto CPA = candidate.v0cosPA(); + auto PropTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; + auto mK0s = candidate.mK0Short(); + + if (cfgReturnFlag) { + bool returnFlag = true; + + if (cSecondaryRequire) { + histos.fill(HIST("QA/K0sCutCheck"), 0); + if (DauDCA > cSecondaryDauDCAMax) { + histos.fill(HIST("QA/K0sCutCheck"), 1); + returnFlag = false; + } + if (DauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 2); + returnFlag = false; + } + if (DauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 3); + returnFlag = false; + } + if (pT < cSecondaryPtMin) { + histos.fill(HIST("QA/K0sCutCheck"), 4); + returnFlag = false; + } + if (Rapidity > cSecondaryRapidityMax) { + histos.fill(HIST("QA/K0sCutCheck"), 5); + returnFlag = false; + } + if (Radius < cSecondaryRadiusMin) { + histos.fill(HIST("QA/K0sCutCheck"), 6); + returnFlag = false; + } + if (DCAtoPV > cSecondaryDCAtoPVMax) { + histos.fill(HIST("QA/K0sCutCheck"), 7); + returnFlag = false; + } + if (CPA < cSecondaryCosPAMin) { + histos.fill(HIST("QA/K0sCutCheck"), 8); + returnFlag = false; + } + if (PropTauK0s > cSecondaryProperLifetimeMax) { + histos.fill(HIST("QA/K0sCutCheck"), 9); + returnFlag = false; + } + if (candidate.qtarm() < cSecondaryparamArmenterosCut * TMath::Abs(candidate.alpha())) { + histos.fill(HIST("QA/K0sCutCheck"), 11); + returnFlag = false; + } + if (fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + returnFlag = false; + } + + return returnFlag; + + } else { + if (fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + returnFlag = false; + } + + return returnFlag; + } + + } else { + if (cSecondaryRequire) { + + histos.fill(HIST("QA/K0sCutCheck"), 0); + if (DauDCA > cSecondaryDauDCAMax) { + histos.fill(HIST("QA/K0sCutCheck"), 1); + return false; + } + if (DauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 2); + return false; + } + if (DauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 3); + return false; + } + if (pT < cSecondaryPtMin) { + histos.fill(HIST("QA/K0sCutCheck"), 4); + return false; + } + if (Rapidity > cSecondaryRapidityMax) { + histos.fill(HIST("QA/K0sCutCheck"), 5); + return false; + } + if (Radius < cSecondaryRadiusMin) { + histos.fill(HIST("QA/K0sCutCheck"), 6); + return false; + } + if (DCAtoPV > cSecondaryDCAtoPVMax) { + histos.fill(HIST("QA/K0sCutCheck"), 7); + return false; + } + if (CPA < cSecondaryCosPAMin) { + histos.fill(HIST("QA/K0sCutCheck"), 8); + return false; + } + if (PropTauK0s > cSecondaryProperLifetimeMax) { + histos.fill(HIST("QA/K0sCutCheck"), 9); + return false; + } + if (candidate.qtarm() < cSecondaryparamArmenterosCut * TMath::Abs(candidate.alpha())) { + histos.fill(HIST("QA/K0sCutCheck"), 11); + return false; + } + if (fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + return false; + } + return true; + + } else { + if (fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + return false; + } + return true; + } + } + } // selectionK0s + + double GetPhiInRange(double phi) + { + double result = phi; + while (result < 0) { + result = result + 2. * TMath::Pi() / 2; + } + while (result > 2. * TMath::Pi() / 2) { + result = result - 2. * TMath::Pi() / 2; + } + return result; + } + + template + bool isTrueKstar(const TrackTemplate& bTrack, const V0Template& K0scand) + { + if (abs(bTrack.PDGCode()) != kPiPlus) // Are you pion? + return false; + if (abs(K0scand.PDGCode()) != kPDGK0s) // Are you K0s? + return false; + + auto motherbTrack = bTrack.template mothers_as(); + auto motherkV0 = K0scand.template mothers_as(); + + // Check bTrack first + if (abs(motherbTrack.pdgCode()) != kKstarPlus) // Are you charged Kstar's daughter? + return false; // Apply first since it's more restrictive + + if (abs(motherkV0.pdgCode()) != 310) // Is it K0s? + return false; + // Check if K0s's mother is K0 (311) + auto motherK0 = motherkV0.template mothers_as(); + if (abs(motherK0.pdgCode()) != 311) + return false; + + // Check if K0's mother is Kstar (323) + auto motherKstar = motherK0.template mothers_as(); + if (abs(motherKstar.pdgCode()) != 323) + return false; + + // Check if bTrack and K0 have the same mother (global index) + if (motherbTrack.globalIndex() != motherK0.globalIndex()) + return false; + + return true; + } + + int count = 0; + + template + void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2) + { + histos.fill(HIST("QA/before/CentDist"), centrality); + + TLorentzVector lDecayDaughter1, lDecayDaughter2, lResoSecondary, lDecayDaughter_bach, lResoKstar; + std::vector trackIndicies = {}; + std::vector k0sIndicies = {}; + + for (auto& bTrack : dTracks1) { + auto trkbpt = bTrack.pt(); + auto istrkbhasTOF = bTrack.hasTOF(); + auto trkbNSigmaPiTPC = bTrack.tpcNSigmaPi(); + auto trkbNSigmaPiTOF = (istrkbhasTOF) ? bTrack.tofNSigmaPi() : -999.; + + if constexpr (!IsMix) { + // Bachelor pion QA plots + histos.fill(HIST("QA/before/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); + if (istrkbhasTOF) { + histos.fill(HIST("QA/before/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); + histos.fill(HIST("QA/before/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + } + histos.fill(HIST("QA/before/trkbpionpT"), trkbpt); + histos.fill(HIST("QA/before/trkbpionDCAxy"), bTrack.dcaXY()); + histos.fill(HIST("QA/before/trkbpionDCAz"), bTrack.dcaZ()); + } + + if (!trackCut(bTrack)) + continue; + if (!selectionPIDPion(bTrack)) + continue; + + if constexpr (!IsMix) { + // Bachelor pion QA plots after applying cuts + histos.fill(HIST("QA/after/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); + if (istrkbhasTOF) { + histos.fill(HIST("QA/after/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); + histos.fill(HIST("QA/after/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + } + histos.fill(HIST("QA/after/trkbpionpT"), trkbpt); + histos.fill(HIST("QA/after/trkbpionDCAxy"), bTrack.dcaXY()); + histos.fill(HIST("QA/after/trkbpionDCAz"), bTrack.dcaZ()); + } + trackIndicies.push_back(bTrack.index()); + } + + for (auto& K0scand : dTracks2) { + auto posDauTrack = K0scand.template posTrack_as(); + auto negDauTrack = K0scand.template negTrack_as(); + + /// Daughters + // Positve pion + auto trkppt = posDauTrack.pt(); + auto istrkphasTOF = posDauTrack.hasTOF(); + auto trkpNSigmaPiTPC = posDauTrack.tpcNSigmaPi(); + auto trkpNSigmaPiTOF = (istrkphasTOF) ? posDauTrack.tofNSigmaPi() : -999.; + // Negative pion + auto trknpt = negDauTrack.pt(); + auto istrknhasTOF = negDauTrack.hasTOF(); + auto trknNSigmaPiTPC = negDauTrack.tpcNSigmaPi(); + auto trknNSigmaPiTOF = (istrknhasTOF) ? negDauTrack.tofNSigmaPi() : -999.; + + /// K0s + auto trkkDauDCA = K0scand.dcaV0daughters(); + auto trkkDauDCAPostoPV = K0scand.dcapostopv(); + auto trkkDauDCANegtoPV = K0scand.dcanegtopv(); + auto trkkpt = K0scand.pt(); + auto trkky = K0scand.yK0Short(); + auto trkkRadius = K0scand.v0radius(); + auto trkkDCAtoPV = K0scand.dcav0topv(); + auto trkkCPA = K0scand.v0cosPA(); + auto trkkPropTau = K0scand.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; + auto trkkMass = K0scand.mK0Short(); + + if constexpr (!IsMix) { + // Seconddary QA plots + histos.fill(HIST("QA/before/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); + if (istrkphasTOF) { + histos.fill(HIST("QA/before/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); + histos.fill(HIST("QA/before/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); + } + histos.fill(HIST("QA/before/trkppionpT"), trkppt); + histos.fill(HIST("QA/before/trkppionDCAxy"), posDauTrack.dcaXY()); + histos.fill(HIST("QA/before/trkppionDCAz"), posDauTrack.dcaZ()); + + histos.fill(HIST("QA/before/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); + if (istrknhasTOF) { + histos.fill(HIST("QA/before/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); + histos.fill(HIST("QA/before/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); + } + histos.fill(HIST("QA/before/trknpionpT"), trknpt); + histos.fill(HIST("QA/before/trknpionDCAxy"), negDauTrack.dcaXY()); + histos.fill(HIST("QA/before/trknpionDCAz"), negDauTrack.dcaZ()); + + histos.fill(HIST("QA/before/hDauDCASecondary"), trkkDauDCA); + histos.fill(HIST("QA/before/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); + histos.fill(HIST("QA/before/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); + + histos.fill(HIST("QA/before/hpT_Secondary"), trkkpt); + histos.fill(HIST("QA/before/hy_Secondary"), trkky); + histos.fill(HIST("QA/before/hRadiusSecondary"), trkkRadius); + histos.fill(HIST("QA/before/hDCAtoPVSecondary"), trkkDCAtoPV); + histos.fill(HIST("QA/before/hCPASecondary"), trkkCPA); + histos.fill(HIST("QA/before/hPropTauSecondary"), trkkPropTau); + histos.fill(HIST("QA/before/hInvmassSecondary"), trkkMass); + } + + // if (!trackCut(posDauTrack) || !trackCut(negDauTrack)) // Too tight cut for K0s daugthers + // continue; + if (!cfgByPassDauPIDSelection && !selectionPIDPion(posDauTrack)) // Perhaps it's already applied in trackCut (need to check QA plots) + continue; + if (!cfgByPassDauPIDSelection && !selectionPIDPion(negDauTrack)) + continue; + if (!selectionK0s(collision, K0scand)) + continue; + + if constexpr (!IsMix) { + // Seconddary QA plots after applying cuts + + histos.fill(HIST("QA/after/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); + if (istrkphasTOF) { + histos.fill(HIST("QA/after/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); + histos.fill(HIST("QA/after/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); + } + histos.fill(HIST("QA/after/trkppionpT"), trkppt); + histos.fill(HIST("QA/after/trkppionDCAxy"), posDauTrack.dcaXY()); + histos.fill(HIST("QA/after/trkppionDCAz"), posDauTrack.dcaZ()); + + histos.fill(HIST("QA/after/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); + if (istrknhasTOF) { + histos.fill(HIST("QA/after/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); + histos.fill(HIST("QA/after/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); + } + histos.fill(HIST("QA/after/trknpionpT"), trknpt); + histos.fill(HIST("QA/after/trknpionDCAxy"), negDauTrack.dcaXY()); + histos.fill(HIST("QA/after/trknpionDCAz"), negDauTrack.dcaZ()); + + histos.fill(HIST("QA/after/hDauDCASecondary"), trkkDauDCA); + histos.fill(HIST("QA/after/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); + histos.fill(HIST("QA/after/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); + + histos.fill(HIST("QA/after/hpT_Secondary"), trkkpt); + histos.fill(HIST("QA/after/hy_Secondary"), trkky); + histos.fill(HIST("QA/after/hRadiusSecondary"), trkkRadius); + histos.fill(HIST("QA/after/hDCAtoPVSecondary"), trkkDCAtoPV); + histos.fill(HIST("QA/after/hCPASecondary"), trkkCPA); + histos.fill(HIST("QA/after/hPropTauSecondary"), trkkPropTau); + histos.fill(HIST("QA/after/hInvmassSecondary"), trkkMass); + } + k0sIndicies.push_back(K0scand.index()); + } + + for (auto& trackIndex : trackIndicies) { + for (auto& k0sIndex : k0sIndicies) { + auto bTrack = dTracks1.rawIteratorAt(trackIndex); + auto K0scand = dTracks2.rawIteratorAt(k0sIndex); + + lDecayDaughter_bach.SetXYZM(bTrack.px(), bTrack.py(), bTrack.pz(), MassPionCharged); + lResoSecondary.SetXYZM(K0scand.px(), K0scand.py(), K0scand.pz(), MassK0Short); + lResoKstar = lResoSecondary + lDecayDaughter_bach; + + // QA plots + if constexpr (!IsMix) { + histos.fill(HIST("QA/before/KstarRapidity"), lResoKstar.Rapidity()); + histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); + } + + if (lResoKstar.Rapidity() > cKstarMaxRap || lResoKstar.Rapidity() < cKstarMinRap) + continue; + + if constexpr (!IsMix) { + unsigned int typeKstar = bTrack.sign() > 0 ? binType::kKstarP : binType::kKstarN; + + histos.fill(HIST("QA/after/KstarRapidity"), lResoKstar.Rapidity()); + histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); + histos.fill(HIST("hInvmass_Kstar"), typeKstar, centrality, lResoKstar.Pt(), lResoKstar.M()); + + } // IsMix + } // K0scand + } // bTrack + + count++; + + } // fillHistograms + + // process data + void processData(EventCandidates::iterator const& collision, + TrackCandidates const& tracks, + V0Candidates const& v0s, + aod::BCsWithTimestamps const&) + { + if (!colCuts.isSelected(collision)) // Default event selection + return; + colCuts.fillQA(collision); + centrality = GetCentrality(collision); + + fillHistograms(collision, tracks, v0s); // second order + } + PROCESS_SWITCH(chk892_pp, processData, "Process Event for data without Partitioning", true); + + // process MC reconstructed level + void processMC(EventCandidates::iterator const& collision, + MCTrackCandidates const& tracks, + MCV0Candidates const& v0s) + { + + histos.fill(HIST("QAMC/hEvent"), 1.0); + + fillHistograms(collision, tracks, v0s); + } + PROCESS_SWITCH(chk892_pp, processMC, "Process Event for MC", false); +}; +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"lf-chk892pp"})}; +} diff --git a/PWGLF/Tasks/Resonances/chk892pp.cxx b/PWGLF/Tasks/Resonances/chk892pp.cxx new file mode 100644 index 00000000000..e61226dd567 --- /dev/null +++ b/PWGLF/Tasks/Resonances/chk892pp.cxx @@ -0,0 +1,931 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file chk892pp.cxx +/// \brief Reconstruction of track-track decay resonance candidates +/// +/// +/// \author Su-Jeong Ji + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // FIXME +#include // FIXME + +#include +#include +#include +#include +#include +#include + +#include "TRandom3.h" +#include "TF1.h" +#include "TVector2.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "Math/GenVector/Boost.h" +#include + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StepTHn.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/StaticFor.h" +#include "DCAFitter/DCAFitterN.h" + +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" + +#include "Common/Core/trackUtilities.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/RecoDecay.h" + +#include "CommonConstants/PhysicsConstants.h" + +#include "ReconstructionDataFormats/Track.h" + +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" + +#include "CCDB/CcdbApi.h" +#include "CCDB/BasicCCDBManager.h" + +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/Utils/collisionCuts.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; +using namespace o2::constants::physics; + +struct chk892pp { + enum binType : unsigned int { + kKstarP = 0, + kKstarN, + kKstarP_Mix, + kKstarN_Mix, + kKstarP_GenINEL10, + kKstarN_GenINEL10, + kKstarP_GenINELgt10, + kKstarN_GenINELgt10, + kKstarP_GenTrig10, + kKstarN_GenTrig10, + kKstarP_GenEvtSel, + kKstarN_GenEvtSel, + kKstarP_Rec, + kKstarN_Rec, + kTYEnd + }; + + SliceCache cache; + Preslice perCollision = aod::track::collisionId; + + using EventCandidates = soa::Join; + // using EventCandidates = soa::Join; + using TrackCandidates = soa::Join; + using V0Candidates = aod::V0Datas; + + using MCEventCandidates = soa::Join; + using MCTrackCandidates = soa::Join; + using MCV0Candidates = soa::Join; + + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Service ccdb; + Service pdg; + o2::ccdb::CcdbApi ccdbApi; + + Configurable cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; + Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"}; + + // Configurables + ConfigurableAxis cfgBinsPt{"cfgBinsPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 11.0, 11.1, 11.2, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8, 11.9, 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 12.7, 12.8, 12.9, 13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 14.0, 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 14.9, 15.0}, "Binning of the pT axis"}; + ConfigurableAxis cfgBinsPtQA{"cfgBinsPtQA", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8, 7.0, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, 8.6, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.0}, "Binning of the pT axis"}; + ConfigurableAxis cfgBinsCent{"cfgBinsCent", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; + ConfigurableAxis cfgBinsVtxZ{"cfgBinsVtxZ", {VARIABLE_WIDTH, -10.0, -9.0, -8.0, -7.0, -6.0, -5.0, -4.0, -3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "Binning of the z-vertex axis"}; + Configurable cNbinsDiv{"cNbinsDiv", 1, "Integer to divide the number of bins"}; + + /// Event cuts + o2::analysis::CollisonCuts colCuts; + Configurable ConfEvtZvtx{"ConfEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable ConfEvtOccupancyInTimeRangeMax{"ConfEvtOccupancyInTimeRangeMax", -1, "Evt sel: maximum track occupancy"}; + Configurable ConfEvtOccupancyInTimeRangeMin{"ConfEvtOccupancyInTimeRangeMin", -1, "Evt sel: minimum track occupancy"}; + Configurable ConfEvtTriggerCheck{"ConfEvtTriggerCheck", false, "Evt sel: check for trigger"}; + Configurable ConfEvtTriggerSel{"ConfEvtTriggerSel", 8, "Evt sel: trigger"}; + Configurable ConfEvtOfflineCheck{"ConfEvtOfflineCheck", true, "Evt sel: check for offline selection"}; + Configurable ConfEvtTriggerTVXSel{"ConfEvtTriggerTVXSel", false, "Evt sel: triggerTVX selection (MB)"}; + Configurable ConfEvtTFBorderCut{"ConfEvtTFBorderCut", false, "Evt sel: apply TF border cut"}; + Configurable ConfEvtUseITSTPCvertex{"ConfEvtUseITSTPCvertex", false, "Evt sel: use at lease on ITS-TPC track for vertexing"}; + Configurable ConfEvtZvertexTimedifference{"ConfEvtZvertexTimedifference", true, "Evt sel: apply Z-vertex time difference"}; + Configurable ConfEvtPileupRejection{"ConfEvtPileupRejection", true, "Evt sel: apply pileup rejection"}; + Configurable ConfEvtNoITSROBorderCut{"ConfEvtNoITSROBorderCut", false, "Evt sel: apply NoITSRO border cut"}; + Configurable ConfincludeCentralityMC{"ConfincludeCentralityMC", false, "Include centrality in MC"}; + Configurable ConfEvtCollInTimeRangeStandard{"ConfEvtCollInTimeRangeStandard", true, "Evt sel: apply NoCollInTimeRangeStandard"}; + + /// Track selections + Configurable cMinPtcut{"cMinPtcut", 0.15, "Track minium pt cut"}; + Configurable cMaxEtacut{"cMaxEtacut", 0.8, "Track maximum eta cut"}; + + /* + // Cuts from polarization analysis + Configurable cfgOccupancySel{"cfgOccupancySel", false, "Occupancy selection"}; + Configurable cfgMaxOccupancy{"cfgMaxOccupancy", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + Configurable cfgMinOccupancy{"cfgMinOccupancy", -100, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + Configurable cfgNCollinTR{"cfgNCollinTR", false, "Additional selection for the number of coll in time range"}; +*/ + Configurable cfgCentEst{"cfgCentEst", 1, "Centrality estimator, 1: FT0C, 2: FT0M"}; + + // DCAr to PV + Configurable cMaxbDCArToPVcut{"cMaxbDCArToPVcut", 0.1, "Track DCAr cut to PV Maximum"}; + // DCAz to PV + Configurable cMaxbDCAzToPVcut{"cMaxbDCAzToPVcut", 0.1, "Track DCAz cut to PV Maximum"}; + + /// PID Selections, pion + Configurable cTPConly{"cTPConly", true, "Use only TPC for PID"}; // bool + Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 3.0, "TPC nSigma cut for Pion"}; // TPC + Configurable cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF + Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; // Combined + Configurable cTOFVeto{"cTOFVeto", true, "TOF Veto, if false, TOF is nessessary for PID selection"}; // TOF Veto + + // Track selections + Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) + Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgPVContributor{"cfgPVContributor", false, "PV contributor track selection"}; // PV Contriuibutor + + Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; + Configurable cfgTPCcluster{"cfgTPCcluster", 0, "Number of TPC cluster"}; + Configurable cfgRatioTPCRowsOverFindableCls{"cfgRatioTPCRowsOverFindableCls", 0.0f, "TPC Crossed Rows to Findable Clusters"}; + Configurable cfgITSChi2NCl{"cfgITSChi2NCl", 999.0, "ITS Chi2/NCl"}; + Configurable cfgTPCChi2NCl{"cfgTPCChi2NCl", 999.0, "TPC Chi2/NCl"}; + Configurable cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"}; + Configurable cfgUseITSRefit{"cfgUseITSRefit", false, "Require ITS Refit"}; + Configurable cfgHasITS{"cfgHasITS", false, "Require ITS"}; + Configurable cfgHasTPC{"cfgHasTPC", false, "Require TPC"}; + Configurable cfgHasTOF{"cfgHasTOF", false, "Require TOF"}; + + // Secondary Selection + Configurable cfgReturnFlag{"boolReturnFlag", false, "Return Flag for debugging"}; + Configurable cSecondaryRequire{"bool", true, "Secondary cuts on/off"}; + Configurable cSecondaryArmenterosCut{"boolArmenterosCut", true, "cut on Armenteros-Podolanski graph"}; + + Configurable cfgByPassDauPIDSelection{"cfgByPassDauPIDSelection", true, "Bypass Daughters PID selection"}; + Configurable cSecondaryDauDCAMax{"cSecondaryDauDCAMax", 1., "Maximum DCA Secondary daughters to PV"}; + Configurable cSecondaryDauPosDCAtoPVMin{"cSecondaryDauPosDCAtoPVMin", 0.0, "Minimum DCA Secondary positive daughters to PV"}; + Configurable cSecondaryDauNegDCAtoPVMin{"cSecondaryDauNegDCAtoPVMin", 0.0, "Minimum DCA Secondary negative daughters to PV"}; + + Configurable cSecondaryPtMin{"cSecondaryPtMin", 0.f, "Minimum transverse momentum of Secondary"}; + Configurable cSecondaryRapidityMax{"cSecondaryRapidityMax", 0.5, "Maximum rapidity of Secondary"}; + Configurable cSecondaryRadiusMin{"cSecondaryRadiusMin", 1.2, "Minimum transverse radius of Secondary"}; + Configurable cSecondaryCosPAMin{"cSecondaryCosPAMin", 0.995, "Mininum cosine pointing angle of Secondary"}; + Configurable cSecondaryDCAtoPVMax{"cSecondaryDCAtoPVMax", 0.3, "Maximum DCA Secondary to PV"}; + Configurable cSecondaryProperLifetimeMax{"cSecondaryProperLifetimeMax", 20, "Maximum Secondary Lifetime"}; + Configurable cSecondaryparamArmenterosCut{"paramArmenterosCut", 0.2, "parameter for Armenteros Cut"}; + Configurable cSecondaryMassWindow{"cSecondaryMassWindow", 0.075, "Secondary inv mass selciton window"}; + + // K* selection + Configurable cKstarMaxRap{"cKstarMaxRap", 0.5, "Kstar maximum rapidity"}; + Configurable cKstarMinRap{"cKstarMinRap", -0.5, "Kstar minimum rapidity"}; + + float centrality; + + // PDG code + int kPDGK0s = 310; + int kPDGK0 = 311; + int kKstarPlus = 323; + int kPiPlus = 211; + + void init(o2::framework::InitContext&) + { + centrality = -999; + + colCuts.setCuts(ConfEvtZvtx, ConfEvtTriggerCheck, ConfEvtTriggerSel, ConfEvtOfflineCheck, /*checkRun3*/ true, /*triggerTVXsel*/ false, ConfEvtOccupancyInTimeRangeMax, ConfEvtOccupancyInTimeRangeMin); + colCuts.init(&histos); + colCuts.setTriggerTVX(ConfEvtTriggerTVXSel); + colCuts.setApplyTFBorderCut(ConfEvtTFBorderCut); + colCuts.setApplyITSTPCvertex(ConfEvtUseITSTPCvertex); + colCuts.setApplyZvertexTimedifference(ConfEvtZvertexTimedifference); + colCuts.setApplyPileupRejection(ConfEvtPileupRejection); + colCuts.setApplyNoITSROBorderCut(ConfEvtNoITSROBorderCut); + colCuts.setApplyCollInTimeRangeStandard(ConfEvtCollInTimeRangeStandard); + + AxisSpec centAxis = {cfgBinsCent, "T0M (%)"}; + AxisSpec vtxzAxis = {cfgBinsVtxZ, "Z Vertex (cm)"}; + AxisSpec epAxis = {100, -1.0 * constants::math::PI, constants::math::PI}; + AxisSpec epresAxis = {100, -1.02, 1.02}; + AxisSpec ptAxis = {cfgBinsPt, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec ptAxisQA = {cfgBinsPtQA, "#it{p}_{T} (GeV/#it{c})"}; + AxisSpec radiusAxis = {50, 0, 5, "Radius (cm)"}; + AxisSpec cpaAxis = {50, 0.95, 1.0, "CPA"}; + AxisSpec tauAxis = {250, 0, 25, "Lifetime (cm)"}; + AxisSpec dcaAxis = {200, 0, 2, "DCA (cm)"}; + AxisSpec dcaxyAxis = {200, 0, 2, "DCA_{#it{xy}} (cm)"}; + AxisSpec dcazAxis = {200, 0, 2, "DCA_{#it{z}} (cm)"}; + AxisSpec yAxis = {100, -1, 1, "Rapidity"}; + AxisSpec invMassAxisK0s = {400 / cNbinsDiv, 0.3, 0.7, "Invariant Mass (GeV/#it{c}^2)"}; // K0s ~497.611 + AxisSpec invMassAxisReso = {900 / cNbinsDiv, 0.5f, 1.4f, "Invariant Mass (GeV/#it{c}^2)"}; // chK(892) ~892 + AxisSpec invMassAxisScan = {150, 0, 1.5, "Invariant Mass (GeV/#it{c}^2)"}; // For selection + AxisSpec pidQAAxis = {130, -6.5, 6.5}; + AxisSpec dataTypeAxis = {9, 0, 9, "Histogram types"}; + AxisSpec mcTypeAxis = {4, 0, 4, "Histogram types"}; + + // THnSparse + AxisSpec axisType = {binType::kTYEnd, 0, binType::kTYEnd, "Type of bin with charge and mix"}; + AxisSpec mcLabelAxis = {5, -0.5, 4.5, "MC Label"}; + + histos.add("QA/K0sCutCheck", "Check K0s cut", HistType::kTH1D, {AxisSpec{12, -0.5, 11.5, "Check"}}); + + histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); + histos.add("QA/before/VtxZ", "Centrality distribution", {HistType::kTH1D, {vtxzAxis}}); + histos.add("QA/before/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); + + // Bachelor pion + histos.add("QA/before/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QA/before/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + histos.add("QA/after/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QA/after/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 1 + histos.add("QA/before/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/before/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + + histos.add("QA/after/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/after/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + + // Secondary pion 2 + histos.add("QA/before/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/before/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + histos.add("QA/after/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/after/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + // K0s + histos.add("QA/before/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QA/before/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QA/before/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QA/before/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QA/before/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QA/before/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + histos.add("QA/after/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QA/after/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QA/after/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QA/after/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QA/after/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QA/after/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + // Kstar + // Invariant mass nSparse + histos.add("QA/before/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + histos.add("hInvmass_Kstar", "Invariant mass of unlike-sign chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso}); + histos.add("hInvmass_Kstar_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso}); + + // Mass QA (quick check) + histos.add("QA/before/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QA/before/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); + + histos.add("QA/after/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + histos.add("QA/after/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QA/after/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); + + // MC + if (doprocessMC) { + + histos.add("QAMC/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); + // Bachelor pion + histos.add("QAMC/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QAMC/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 1 + histos.add("QAMC/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QAMC/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 2 + histos.add("QAMC/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QAMC/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + // Secondary Resonance (K0s cand) + histos.add("QAMC/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + + histos.add("QAMC/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QAMC/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QAMC/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QAMC/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QAMC/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QAMC/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + // K892 + histos.add("QAMC/KstarOA", "Opening angle of chK(892)", HistType::kTH1D, {AxisSpec{100, 0, 3.14, "Opening angle"}}); + histos.add("QAMC/KstarPairAsym", "Pair asymmetry of chK(892)", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QAMC/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + + histos.add("QAMC/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QAMC/kstarinvmass_noKstar", "Invariant mass of unlike-sign no chK(892)", HistType::kTH1D, {invMassAxisReso}); + + histos.add("hInvmass_Kstar_MC", "Invariant mass of unlike chK(892)", HistType::kTHnSparseD, {axisType, centAxis, ptAxis, invMassAxisReso}); + + ccdb->setURL(cfgURL); + ccdbApi.init("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + } + + // Print output histograms statistics + LOG(info) << "Size of the histograms in chK(892) Analysis Task"; + histos.print(); + } + + template + float GetCentrality(CollisionType const& collision) + { + if (cfgCentEst == 1) { + return collision.multFT0C(); + } else if (cfgCentEst == 2) { + return collision.multFT0M(); + } else { + return -999; + } + } + + template + int GetDetId(DetNameType const& name) + { + LOGF(info, "GetDetID running"); + if (name.value == "FT0C") { + return 0; + } else if (name.value == "FT0A") { + return 1; + } else if (name.value == "FT0M") { + return 2; + } else if (name.value == "FV0A") { + return 3; + } else if (name.value == "TPCpos") { + return 4; + } else if (name.value == "TPCneg") { + return 5; + } else { + return false; + } + } + + // Track selection + template + bool trackCut(TrackType const& track) + { + // basic track cuts + if (std::abs(track.pt()) < cMinPtcut) + return false; + if (std::abs(track.eta()) > cMaxEtacut) + return false; + if (track.itsNCls() < cfgITScluster) + return false; + if (track.tpcNClsFound() < cfgTPCcluster) + return false; + if (track.tpcCrossedRowsOverFindableCls() < cfgRatioTPCRowsOverFindableCls) + return false; + if (track.itsChi2NCl() >= cfgITSChi2NCl) + return false; + if (track.tpcChi2NCl() >= cfgTPCChi2NCl) + return false; + if (cfgHasITS && !track.hasITS()) + return false; + if (cfgHasTPC && !track.hasTPC()) + return false; + if (cfgHasTOF && !track.hasTOF()) + return false; + if (cfgUseITSRefit && !track.passedITSRefit()) + return false; + if (cfgUseTPCRefit && !track.passedTPCRefit()) + return false; + if (cfgPVContributor && !track.isPVContributor()) + return false; + if (cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) + return false; + if (cfgGlobalTrack && !track.isGlobalTrack()) + return false; + if (cfgPrimaryTrack && !track.isPrimaryTrack()) + return false; + if (std::abs(track.dcaXY()) > cMaxbDCArToPVcut) + return false; + if (std::abs(track.dcaZ()) > cMaxbDCAzToPVcut) + return false; + return true; + } + + // PID selection tools + template + bool selectionPIDPion(TrackType const& candidate) + { + bool tpcPIDPassed{false}, tofPIDPassed{false}; + + if (cTPConly) { + + if (std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { + tpcPIDPassed = true; + } else { + return false; + } + tofPIDPassed = true; + + } else { + + if (std::abs(candidate.tpcNSigmaPi()) < cMaxTPCnSigmaPion) { + tpcPIDPassed = true; + } else { + return false; + } + if (candidate.hasTOF()) { + if (std::abs(candidate.tofNSigmaPi()) < cMaxTOFnSigmaPion) { + tofPIDPassed = true; + } + if ((nsigmaCutCombinedPion > 0) && (candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi() + candidate.tofNSigmaPi() * candidate.tofNSigmaPi() < nsigmaCutCombinedPion * nsigmaCutCombinedPion)) { + tofPIDPassed = true; + } + } else { + if (!cTOFVeto) { + return false; + } + tofPIDPassed = true; + } + } + + if (tpcPIDPassed && tofPIDPassed) { + return true; + } + return false; + } + + template + bool selectionK0s(CollisionType const& collision, K0sType const& candidate) + { + auto DauDCA = candidate.dcaV0daughters(); + auto DauPosDCAtoPV = candidate.dcapostopv(); + auto DauNegDCAtoPV = candidate.dcanegtopv(); + auto pT = candidate.pt(); + auto Rapidity = candidate.yK0Short(); + auto Radius = candidate.v0radius(); + auto DCAtoPV = candidate.dcav0topv(); + auto CPA = candidate.v0cosPA(); + auto PropTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; + auto mK0s = candidate.mK0Short(); + + if (cfgReturnFlag) { + bool returnFlag = true; + + if (cSecondaryRequire) { + histos.fill(HIST("QA/K0sCutCheck"), 0); + if (DauDCA > cSecondaryDauDCAMax) { + histos.fill(HIST("QA/K0sCutCheck"), 1); + returnFlag = false; + } + if (DauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 2); + returnFlag = false; + } + if (DauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 3); + returnFlag = false; + } + if (pT < cSecondaryPtMin) { + histos.fill(HIST("QA/K0sCutCheck"), 4); + returnFlag = false; + } + if (Rapidity > cSecondaryRapidityMax) { + histos.fill(HIST("QA/K0sCutCheck"), 5); + returnFlag = false; + } + if (Radius < cSecondaryRadiusMin) { + histos.fill(HIST("QA/K0sCutCheck"), 6); + returnFlag = false; + } + if (DCAtoPV > cSecondaryDCAtoPVMax) { + histos.fill(HIST("QA/K0sCutCheck"), 7); + returnFlag = false; + } + if (CPA < cSecondaryCosPAMin) { + histos.fill(HIST("QA/K0sCutCheck"), 8); + returnFlag = false; + } + if (PropTauK0s > cSecondaryProperLifetimeMax) { + histos.fill(HIST("QA/K0sCutCheck"), 9); + returnFlag = false; + } + if (candidate.qtarm() < cSecondaryparamArmenterosCut * TMath::Abs(candidate.alpha())) { + histos.fill(HIST("QA/K0sCutCheck"), 11); + returnFlag = false; + } + if (fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + returnFlag = false; + } + + return returnFlag; + + } else { + if (fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + returnFlag = false; + } + + return returnFlag; + } + + } else { + if (cSecondaryRequire) { + + histos.fill(HIST("QA/K0sCutCheck"), 0); + if (DauDCA > cSecondaryDauDCAMax) { + histos.fill(HIST("QA/K0sCutCheck"), 1); + return false; + } + if (DauPosDCAtoPV < cSecondaryDauPosDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 2); + return false; + } + if (DauNegDCAtoPV < cSecondaryDauNegDCAtoPVMin) { + histos.fill(HIST("QA/K0sCutCheck"), 3); + return false; + } + if (pT < cSecondaryPtMin) { + histos.fill(HIST("QA/K0sCutCheck"), 4); + return false; + } + if (Rapidity > cSecondaryRapidityMax) { + histos.fill(HIST("QA/K0sCutCheck"), 5); + return false; + } + if (Radius < cSecondaryRadiusMin) { + histos.fill(HIST("QA/K0sCutCheck"), 6); + return false; + } + if (DCAtoPV > cSecondaryDCAtoPVMax) { + histos.fill(HIST("QA/K0sCutCheck"), 7); + return false; + } + if (CPA < cSecondaryCosPAMin) { + histos.fill(HIST("QA/K0sCutCheck"), 8); + return false; + } + if (PropTauK0s > cSecondaryProperLifetimeMax) { + histos.fill(HIST("QA/K0sCutCheck"), 9); + return false; + } + if (candidate.qtarm() < cSecondaryparamArmenterosCut * TMath::Abs(candidate.alpha())) { + histos.fill(HIST("QA/K0sCutCheck"), 11); + return false; + } + if (fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + return false; + } + return true; + + } else { + if (fabs(mK0s - MassK0Short) > cSecondaryMassWindow) { + histos.fill(HIST("QA/K0sCutCheck"), 10); + return false; + } + return true; + } + } + } // selectionK0s + + double GetPhiInRange(double phi) + { + double result = phi; + while (result < 0) { + result = result + 2. * TMath::Pi() / 2; + } + while (result > 2. * TMath::Pi() / 2) { + result = result - 2. * TMath::Pi() / 2; + } + return result; + } + + template + bool isTrueKstar(const TrackTemplate& bTrack, const V0Template& K0scand) + { + if (abs(bTrack.PDGCode()) != kPiPlus) // Are you pion? + return false; + if (abs(K0scand.PDGCode()) != kPDGK0s) // Are you K0s? + return false; + + auto motherbTrack = bTrack.template mothers_as(); + auto motherkV0 = K0scand.template mothers_as(); + + // Check bTrack first + if (abs(motherbTrack.pdgCode()) != kKstarPlus) // Are you charged Kstar's daughter? + return false; // Apply first since it's more restrictive + + if (abs(motherkV0.pdgCode()) != 310) // Is it K0s? + return false; + // Check if K0s's mother is K0 (311) + auto motherK0 = motherkV0.template mothers_as(); + if (abs(motherK0.pdgCode()) != 311) + return false; + + // Check if K0's mother is Kstar (323) + auto motherKstar = motherK0.template mothers_as(); + if (abs(motherKstar.pdgCode()) != 323) + return false; + + // Check if bTrack and K0 have the same mother (global index) + if (motherbTrack.globalIndex() != motherK0.globalIndex()) + return false; + + return true; + } + + int count = 0; + + template + void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2) + { + histos.fill(HIST("QA/before/CentDist"), centrality); + + TLorentzVector lDecayDaughter1, lDecayDaughter2, lResoSecondary, lDecayDaughter_bach, lResoKstar; + std::vector trackIndicies = {}; + std::vector k0sIndicies = {}; + + for (auto& bTrack : dTracks1) { + auto trkbpt = bTrack.pt(); + auto istrkbhasTOF = bTrack.hasTOF(); + auto trkbNSigmaPiTPC = bTrack.tpcNSigmaPi(); + auto trkbNSigmaPiTOF = (istrkbhasTOF) ? bTrack.tofNSigmaPi() : -999.; + + if constexpr (!IsMix) { + // Bachelor pion QA plots + histos.fill(HIST("QA/before/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); + if (istrkbhasTOF) { + histos.fill(HIST("QA/before/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); + histos.fill(HIST("QA/before/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + } + histos.fill(HIST("QA/before/trkbpionpT"), trkbpt); + histos.fill(HIST("QA/before/trkbpionDCAxy"), bTrack.dcaXY()); + histos.fill(HIST("QA/before/trkbpionDCAz"), bTrack.dcaZ()); + } + + if (!trackCut(bTrack)) + continue; + if (!selectionPIDPion(bTrack)) + continue; + + if constexpr (!IsMix) { + // Bachelor pion QA plots after applying cuts + histos.fill(HIST("QA/after/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); + if (istrkbhasTOF) { + histos.fill(HIST("QA/after/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); + histos.fill(HIST("QA/after/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + } + histos.fill(HIST("QA/after/trkbpionpT"), trkbpt); + histos.fill(HIST("QA/after/trkbpionDCAxy"), bTrack.dcaXY()); + histos.fill(HIST("QA/after/trkbpionDCAz"), bTrack.dcaZ()); + } + trackIndicies.push_back(bTrack.index()); + } + + for (auto& K0scand : dTracks2) { + auto posDauTrack = K0scand.template posTrack_as(); + auto negDauTrack = K0scand.template negTrack_as(); + + /// Daughters + // Positve pion + auto trkppt = posDauTrack.pt(); + auto istrkphasTOF = posDauTrack.hasTOF(); + auto trkpNSigmaPiTPC = posDauTrack.tpcNSigmaPi(); + auto trkpNSigmaPiTOF = (istrkphasTOF) ? posDauTrack.tofNSigmaPi() : -999.; + // Negative pion + auto trknpt = negDauTrack.pt(); + auto istrknhasTOF = negDauTrack.hasTOF(); + auto trknNSigmaPiTPC = negDauTrack.tpcNSigmaPi(); + auto trknNSigmaPiTOF = (istrknhasTOF) ? negDauTrack.tofNSigmaPi() : -999.; + + /// K0s + auto trkkDauDCA = K0scand.dcaV0daughters(); + auto trkkDauDCAPostoPV = K0scand.dcapostopv(); + auto trkkDauDCANegtoPV = K0scand.dcanegtopv(); + auto trkkpt = K0scand.pt(); + auto trkky = K0scand.yK0Short(); + auto trkkRadius = K0scand.v0radius(); + auto trkkDCAtoPV = K0scand.dcav0topv(); + auto trkkCPA = K0scand.v0cosPA(); + auto trkkPropTau = K0scand.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * MassK0Short; + auto trkkMass = K0scand.mK0Short(); + + if constexpr (!IsMix) { + // Seconddary QA plots + histos.fill(HIST("QA/before/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); + if (istrkphasTOF) { + histos.fill(HIST("QA/before/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); + histos.fill(HIST("QA/before/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); + } + histos.fill(HIST("QA/before/trkppionpT"), trkppt); + histos.fill(HIST("QA/before/trkppionDCAxy"), posDauTrack.dcaXY()); + histos.fill(HIST("QA/before/trkppionDCAz"), posDauTrack.dcaZ()); + + histos.fill(HIST("QA/before/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); + if (istrknhasTOF) { + histos.fill(HIST("QA/before/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); + histos.fill(HIST("QA/before/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); + } + histos.fill(HIST("QA/before/trknpionpT"), trknpt); + histos.fill(HIST("QA/before/trknpionDCAxy"), negDauTrack.dcaXY()); + histos.fill(HIST("QA/before/trknpionDCAz"), negDauTrack.dcaZ()); + + histos.fill(HIST("QA/before/hDauDCASecondary"), trkkDauDCA); + histos.fill(HIST("QA/before/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); + histos.fill(HIST("QA/before/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); + + histos.fill(HIST("QA/before/hpT_Secondary"), trkkpt); + histos.fill(HIST("QA/before/hy_Secondary"), trkky); + histos.fill(HIST("QA/before/hRadiusSecondary"), trkkRadius); + histos.fill(HIST("QA/before/hDCAtoPVSecondary"), trkkDCAtoPV); + histos.fill(HIST("QA/before/hCPASecondary"), trkkCPA); + histos.fill(HIST("QA/before/hPropTauSecondary"), trkkPropTau); + histos.fill(HIST("QA/before/hInvmassSecondary"), trkkMass); + } + + // if (!trackCut(posDauTrack) || !trackCut(negDauTrack)) // Too tight cut for K0s daugthers + // continue; + if (!cfgByPassDauPIDSelection && !selectionPIDPion(posDauTrack)) // Perhaps it's already applied in trackCut (need to check QA plots) + continue; + if (!cfgByPassDauPIDSelection && !selectionPIDPion(negDauTrack)) + continue; + if (!selectionK0s(collision, K0scand)) + continue; + + if constexpr (!IsMix) { + // Seconddary QA plots after applying cuts + + histos.fill(HIST("QA/after/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); + if (istrkphasTOF) { + histos.fill(HIST("QA/after/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); + histos.fill(HIST("QA/after/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); + } + histos.fill(HIST("QA/after/trkppionpT"), trkppt); + histos.fill(HIST("QA/after/trkppionDCAxy"), posDauTrack.dcaXY()); + histos.fill(HIST("QA/after/trkppionDCAz"), posDauTrack.dcaZ()); + + histos.fill(HIST("QA/after/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); + if (istrknhasTOF) { + histos.fill(HIST("QA/after/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); + histos.fill(HIST("QA/after/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); + } + histos.fill(HIST("QA/after/trknpionpT"), trknpt); + histos.fill(HIST("QA/after/trknpionDCAxy"), negDauTrack.dcaXY()); + histos.fill(HIST("QA/after/trknpionDCAz"), negDauTrack.dcaZ()); + + histos.fill(HIST("QA/after/hDauDCASecondary"), trkkDauDCA); + histos.fill(HIST("QA/after/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); + histos.fill(HIST("QA/after/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); + + histos.fill(HIST("QA/after/hpT_Secondary"), trkkpt); + histos.fill(HIST("QA/after/hy_Secondary"), trkky); + histos.fill(HIST("QA/after/hRadiusSecondary"), trkkRadius); + histos.fill(HIST("QA/after/hDCAtoPVSecondary"), trkkDCAtoPV); + histos.fill(HIST("QA/after/hCPASecondary"), trkkCPA); + histos.fill(HIST("QA/after/hPropTauSecondary"), trkkPropTau); + histos.fill(HIST("QA/after/hInvmassSecondary"), trkkMass); + } + k0sIndicies.push_back(K0scand.index()); + } + + for (auto& trackIndex : trackIndicies) { + for (auto& k0sIndex : k0sIndicies) { + auto bTrack = dTracks1.rawIteratorAt(trackIndex); + auto K0scand = dTracks2.rawIteratorAt(k0sIndex); + + lDecayDaughter_bach.SetXYZM(bTrack.px(), bTrack.py(), bTrack.pz(), MassPionCharged); + lResoSecondary.SetXYZM(K0scand.px(), K0scand.py(), K0scand.pz(), MassK0Short); + lResoKstar = lResoSecondary + lDecayDaughter_bach; + + // QA plots + if constexpr (!IsMix) { + histos.fill(HIST("QA/before/KstarRapidity"), lResoKstar.Rapidity()); + histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); + } + + if (lResoKstar.Rapidity() > cKstarMaxRap || lResoKstar.Rapidity() < cKstarMinRap) + continue; + + if constexpr (!IsMix) { + unsigned int typeKstar = bTrack.sign() > 0 ? binType::kKstarP : binType::kKstarN; + + histos.fill(HIST("QA/after/KstarRapidity"), lResoKstar.Rapidity()); + histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); + histos.fill(HIST("hInvmass_Kstar"), typeKstar, centrality, lResoKstar.Pt(), lResoKstar.M()); + + } // IsMix + } // K0scand + } // bTrack + + count++; + + } // fillHistograms + + // process data + void processData(EventCandidates::iterator const& collision, + TrackCandidates const& tracks, + V0Candidates const& v0s, + aod::BCsWithTimestamps const&) + { + if (!colCuts.isSelected(collision)) // Default event selection + return; + colCuts.fillQA(collision); + centrality = GetCentrality(collision); + + fillHistograms(collision, tracks, v0s); // second order + } + PROCESS_SWITCH(chk892pp, processData, "Process Event for data without Partitioning", true); + + // process MC reconstructed level + void processMC(EventCandidates::iterator const& collision, + MCTrackCandidates const& tracks, + MCV0Candidates const& v0s) + { + + histos.fill(HIST("QAMC/hEvent"), 1.0); + + fillHistograms(collision, tracks, v0s); + } + PROCESS_SWITCH(chk892pp, processMC, "Process Event for MC", false); +}; +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"lf-chk892pp"})}; +} From b5d4fdb48012db07c51bfc46aed65d799b30ad02 Mon Sep 17 00:00:00 2001 From: Bong-Hwi Lim Date: Thu, 19 Dec 2024 19:56:37 +0900 Subject: [PATCH 445/459] [PWGLF] Refinements and Enhancements in Resonance Initialization and Module Setup (#8974) --- .../Resonances/resonanceInitializer.cxx | 6 +-- .../Resonances/resonanceModuleInitializer.cxx | 44 ++++++++++++++++--- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx index 202432fe061..53708c43eae 100644 --- a/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceInitializer.cxx @@ -145,14 +145,14 @@ struct ResonanceInitializer { // Pre-filters for efficient process // Filter tofPIDFilter = aod::track::tofExpMom < 0.f || ((aod::track::tofExpMom > 0.f) && ((nabs(aod::pidtof::tofNSigmaPi) < pidnSigmaPreSelectionCut) || (nabs(aod::pidtof::tofNSigmaKa) < pidnSigmaPreSelectionCut) || (nabs(aod::pidtof::tofNSigmaPr) < pidnSigmaPreSelectionCut))); // TOF + // Filter tpcPIDFilter = nabs(aod::pidtpc::tpcNSigmaPi) < pidnSigmaPreSelectionCut || nabs(aod::pidtpc::tpcNSigmaKa) < pidnSigmaPreSelectionCut || nabs(aod::pidtpc::tpcNSigmaPr) < pidnSigmaPreSelectionCut; // TPC Filter trackFilter = (trackSelection.node() == 0) || // from tpcSkimsTableCreator ((trackSelection.node() == 1) && requireGlobalTrackInFilter()) || ((trackSelection.node() == 2) && requireGlobalTrackWoPtEtaInFilter()) || ((trackSelection.node() == 3) && requireGlobalTrackWoDCAInFilter()) || ((trackSelection.node() == 4) && requireQualityTracksInFilter()) || ((trackSelection.node() == 5) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks)); - Filter tpcPIDFilter = nabs(aod::pidtpc::tpcNSigmaPi) < pidnSigmaPreSelectionCut || nabs(aod::pidtpc::tpcNSigmaKa) < pidnSigmaPreSelectionCut || nabs(aod::pidtpc::tpcNSigmaPr) < pidnSigmaPreSelectionCut; // TPC - Filter trackEtaFilter = nabs(aod::track::eta) < cfgCutEta; // Eta cut + Filter trackEtaFilter = nabs(aod::track::eta) < cfgCutEta; // Eta cut EventPlaneHelper helperEP; @@ -1298,7 +1298,6 @@ struct ResonanceInitializer { // Loop over tracks fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); - fillV0s(collision, V0s, tracks); fillCascades(collision, Cascades, tracks); // Loop over all MC particles @@ -1322,7 +1321,6 @@ struct ResonanceInitializer { // Loop over tracks fillTracks(collision, tracks); fillV0s(collision, V0s, tracks); - fillV0s(collision, V0s, tracks); fillCascades(collision, Cascades, tracks); // Loop over all MC particles diff --git a/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx b/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx index 8b2315d219a..86fa463ba3b 100644 --- a/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx +++ b/PWGLF/TableProducer/Resonances/resonanceModuleInitializer.cxx @@ -65,8 +65,10 @@ struct ResonanceModuleInitializer { Service pdg; ///< PDG database service EventPlaneHelper helperEP; ///< Helper for event plane calculations - Produces resoCollisions; ///< Output table for resonance collisions - Produces resoMCCollisions; ///< Output table for MC resonance collisions + Produces resoCollisions; ///< Output table for resonance collisions + Produces resoMCCollisions; ///< Output table for MC resonance collisions + Produces resoSpheroCollisions; ///< Output table for spherocity + Produces resoEvtPlCollisions; ///< Output table for event plane // CCDB options Configurable ccdbURL{"ccdbURL", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -102,8 +104,11 @@ struct ResonanceModuleInitializer { Configurable cfgEvtPileupRejection{"cfgEvtPileupRejection", false, "Evt sel: apply pileup rejection"}; Configurable cfgEvtNoITSROBorderCut{"cfgEvtNoITSROBorderCut", false, "Evt sel: apply NoITSRO border cut"}; + // Spherocity configuration + Configurable cfgTrackSphMin{"cfgTrackSphMin", 10, "Number of tracks for Spherocity Calculation"}; + Configurable cfgTrackSphDef{"cfgTrackSphDef", 0, "Spherocity Definition: |pT| = 1 -> 0, otherwise -> 1"}; + // Qvector configuration - Configurable cfgBypassQvec{"cfgBypassQvec", true, "Bypass for qvector task"}; Configurable cfgEvtPl{"cfgEvtPl", 40500, "Configuration of three subsystems for the event plane and its resolution, 10000*RefA + 100*RefB + S, where FT0C:0, FT0A:1, FT0M:2, FV0A:3, BPos:5, BNeg:6"}; int evtPlRefAId = static_cast(cfgEvtPl / 10000); @@ -582,6 +587,31 @@ struct ResonanceModuleInitializer { fillMCCollision(collision, mcParticles); } PROCESS_SWITCH(ResonanceModuleInitializer, processRun2MC, "process MC for RUN2", false); + + /** + * @brief Processes Spherocity + * + * @param collision Collision data + * @param tracks Track data + */ + void processSpherocity(soa::Filtered::iterator const& collision, aod::ResoTrackCandidates const& tracks) + { + float spherocity = computeSpherocity(tracks, cfgTrackSphMin, cfgTrackSphDef); + resoSpheroCollisions(collision.globalIndex(), spherocity); + } + PROCESS_SWITCH(ResonanceModuleInitializer, processSpherocity, "process Spherocity", false); + + /** + * @brief Processes Event Plane + * + * @param collision Collision data with Qvectors + * @param tracks Track data + */ + void processEventPlane(soa::Filtered>::iterator const& collision) + { + resoEvtPlCollisions(collision.globalIndex(), getEvtPl(collision), getEvtPlRes(collision, evtPlDetId, evtPlRefAId), getEvtPlRes(collision, evtPlDetId, evtPlRefBId), getEvtPlRes(collision, evtPlRefAId, evtPlRefBId)); + } + PROCESS_SWITCH(ResonanceModuleInitializer, processEventPlane, "process Event Plane", false); }; /** @@ -1204,7 +1234,7 @@ struct ResonanceDaughterInitializer { * @param v0s V0 data * @param tracks Track data */ - void processV0Data(aod::ResoCollision const& collision, soa::Filtered const& v0s, aod::ResoTrackCandidates const& tracks) + void processV0Data(aod::ResoCollision const& collision, aod::ResoV0Candidates const& v0s, aod::ResoTrackCandidates const& tracks) { fillV0s(collision, v0s, tracks); } @@ -1217,7 +1247,7 @@ struct ResonanceDaughterInitializer { * @param v0s V0 data * @param tracks Track data */ - void processV0MC(aod::ResoCollision const& collision, soa::Filtered const& v0s, aod::ResoTrackCandidatesMC const& tracks) + void processV0MC(aod::ResoCollision const& collision, aod::ResoV0CandidatesMC const& v0s, aod::ResoTrackCandidatesMC const& tracks) { fillV0s(collision, v0s, tracks); } @@ -1230,7 +1260,7 @@ struct ResonanceDaughterInitializer { * @param cascades Cascade data * @param tracks Track data */ - void processCascData(aod::ResoCollision const& collision, soa::Filtered const& cascades, aod::ResoTrackCandidates const& tracks) + void processCascData(aod::ResoCollision const& collision, aod::ResoCascadesCandidates const& cascades, aod::ResoTrackCandidates const& tracks) { fillCascades(collision, cascades, tracks); } @@ -1243,7 +1273,7 @@ struct ResonanceDaughterInitializer { * @param cascades Cascade data * @param tracks Track data */ - void processCascMC(aod::ResoCollision const& collision, soa::Filtered const& cascades, aod::ResoTrackCandidatesMC const& tracks) + void processCascMC(aod::ResoCollision const& collision, aod::ResoCascadesCandidatesMC const& cascades, aod::ResoTrackCandidatesMC const& tracks) { fillCascades(collision, cascades, tracks); } From e9485e1edc928d9fe9db88b3fd24f163379971cf Mon Sep 17 00:00:00 2001 From: rolavick Date: Thu, 19 Dec 2024 13:11:25 +0100 Subject: [PATCH 446/459] [PWGUD] Fix of personal task (#9058) --- PWGUD/Core/UPCTauCentralBarrelHelperRL.h | 4 +- PWGUD/Tasks/upcTauCentralBarrelRL.cxx | 1050 +++++++++++----------- 2 files changed, 528 insertions(+), 526 deletions(-) diff --git a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h index fea30eb54a6..55a13a0e9c5 100644 --- a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h +++ b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h @@ -219,7 +219,9 @@ double calculateAcoplanarity(double phiTrk1, double phiTrk2) double calculateCollinearity(double etaTrk1, double etaTrk2, double phiTrk1, double phiTrk2) // Function to calculate deltaR(trk1,trk2) = sqrt(deltaEta^2+deltaPhi^2) { - return std::sqrt(etaTrk1 * etaTrk2 + phiTrk1 * phiTrk2); + double deltaEta = etaTrk1 - etaTrk2; + double deltaPhi = phiTrk1 - phiTrk2; + return std::sqrt(deltaEta * deltaEta + deltaPhi * deltaPhi); } template diff --git a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx index 6d3261ec746..3d04ff94e74 100644 --- a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx +++ b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx @@ -133,36 +133,36 @@ struct UpcTauCentralBarrelRL { } cutPID; struct : ConfigurableGroup { - ConfigurableAxis axisNtracks{"axisNtracks", {30, -0.5, 29.5}, "Number of tracks in collision"}; - ConfigurableAxis axisNparticles{"axisNparticles", {100, -0.5, 99.5}, "Number of particles in collision"}; - ConfigurableAxis axisZvtx{"axisZvtx", {40, -20., 20.}, "Z-vertex position (cm)"}; - ConfigurableAxis axisInvMass{"axisInvMass", {400, 1., 5.}, "Invariant mass (GeV/c^{2})"}; - ConfigurableAxis axisInvMassWide{"axisInvMassWide", {1000, 0., 10.}, "Invariant mass (GeV/c^{2}), wider range"}; - ConfigurableAxis axisMom{"axisMom", {400, 0., 2.}, "Momentum (GeV/c)"}; - ConfigurableAxis axisMomWide{"axisMomWide", {1000, 0., 10.}, "Momentum (GeV/c), wider range"}; - ConfigurableAxis axisMomSigned{"axisMomSigned", {800, -2., 2.}, "Signed momentum (GeV/c)"}; - ConfigurableAxis axisPt{"axisPt", {400, 0., 2.}, "Transversal momentum (GeV/c)"}; - ConfigurableAxis axisPhi{"axisPhi", {64, -o2::constants::math::TwoPI, o2::constants::math::TwoPI}, "Azimuthal angle (a.y.)"}; - ConfigurableAxis axisModPhi{"axisModPhi", {400, 0., .4}, "Track fmod(#phi,#pi/9)"}; - ConfigurableAxis axisEta{"axisEta", {50, -1.2, 1.2}, "Pseudorapidity (a.u.)"}; - ConfigurableAxis axisRap{"axisRap", {50, -1.2, 1.2}, "Rapidity (a.u.)"}; - ConfigurableAxis axisFraction{"axisFraction", {500, 0., 1.}, "Fraction (-)"}; - ConfigurableAxis axisAcoplanarity{"axisAcoplanarity", {32, 0.0, o2::constants::math::PI}, "Acoplanarity (rad)"}; - ConfigurableAxis axisCollinearity{"axisCollinearity", {200, 0, 20}, "Collinearity (-)"}; - ConfigurableAxis axisTPCdEdx{"axisTPCdEdx", {2000, 0., 200.}, "TPC dE/dx (a.u.)"}; - ConfigurableAxis axisTOFsignal{"axisTOFsignal", {2500, -10000., 40000.}, "TOF signal (a.u.)"}; - ConfigurableAxis axisNsigma{"axisNsigma", {200, -10., 10.}, "n sigma"}; - ConfigurableAxis axisDCA{"axisDCA", {100, -0.5, 0.5}, "DCA (cm)"}; - ConfigurableAxis axisAvgITSclsSizes{"axisAvgITSclsSizes", {500, 0., 10.}, "ITS average cluster size"}; - ConfigurableAxis axisITSnCls{"axisITSnCls", {8, -0.5, 7.5}, "ITS n clusters"}; - ConfigurableAxis axisITSchi2{"axisITSchi2", {100, 0, 50}, "UTS chi2"}; - ConfigurableAxis axisTPCnCls{"axisTPCnCls", {165, -0.5, 164.5}, "TPC n clusters"}; - ConfigurableAxis axisTPCxRwsFrac{"axisTPCxRwsFrac", {200, 0.0, 2.0}, "TPC fraction of crossed raws"}; - ConfigurableAxis axisTPCchi2{"axisTPCchi2", {100, 0, 10}, "TPC chi2"}; - ConfigurableAxis axisFITtime{"axisFITtime", {201, -40.5, 40.5}, "FIT time in ns"}; - ConfigurableAxis axisFITamplitude{"axisFITamplitude", {1000, 0., 1000.}, "FIT amplitude"}; - - AxisSpec axisChannels{CH_ENUM_COUNTER, -0.5, +CH_ENUM_COUNTER - 0.5, "Channels (-)"}; + ConfigurableAxis zzAxisNtracks{"zzAxisNtracks", {30, -0.5, 29.5}, "Number of tracks in collision"}; + ConfigurableAxis zzAxisNparticles{"zzAxisNparticles", {100, -0.5, 99.5}, "Number of particles in collision"}; + ConfigurableAxis zzAxisZvtx{"zzAxisZvtx", {40, -20., 20.}, "Z-vertex position (cm)"}; + ConfigurableAxis zzAxisInvMass{"zzAxisInvMass", {400, 1., 5.}, "Invariant mass (GeV/c^{2})"}; + ConfigurableAxis zzAxisInvMassWide{"zzAxisInvMassWide", {1000, 0., 10.}, "Invariant mass (GeV/c^{2}), wider range"}; + ConfigurableAxis zzAxisMom{"zzAxisMom", {400, 0., 2.}, "Momentum (GeV/c)"}; + ConfigurableAxis zzAxisMomWide{"zzAxisMomWide", {1000, 0., 10.}, "Momentum (GeV/c), wider range"}; + ConfigurableAxis zzAxisMomSigned{"zzAxisMomSigned", {800, -2., 2.}, "Signed momentum (GeV/c)"}; + ConfigurableAxis zzAxisPt{"zzAxisPt", {400, 0., 2.}, "Transversal momentum (GeV/c)"}; + ConfigurableAxis zzAxisPhi{"zzAxisPhi", {64, -o2::constants::math::TwoPI, o2::constants::math::TwoPI}, "Azimuthal angle (a.y.)"}; + ConfigurableAxis zzAxisModPhi{"zzAxisModPhi", {400, 0., .4}, "Track fmod(#phi,#pi/9)"}; + ConfigurableAxis zzAxisEta{"zzAxisEta", {50, -1.2, 1.2}, "Pseudorapidity (a.u.)"}; + ConfigurableAxis zzAxisRap{"zzAxisRap", {50, -1.2, 1.2}, "Rapidity (a.u.)"}; + ConfigurableAxis zzAxisFraction{"zzAxisFraction", {500, 0., 1.}, "Fraction (-)"}; + ConfigurableAxis zzAxisAcoplanarity{"zzAxisAcoplanarity", {32, 0.0, o2::constants::math::PI}, "Acoplanarity (rad)"}; + ConfigurableAxis zzAxisCollinearity{"zzAxisCollinearity", {200, 0, 20}, "Collinearity (-)"}; + ConfigurableAxis zzAxisTPCdEdx{"zzAxisTPCdEdx", {2000, 0., 200.}, "TPC dE/dx (a.u.)"}; + ConfigurableAxis zzAxisTOFsignal{"zzAxisTOFsignal", {2500, -10000., 40000.}, "TOF signal (a.u.)"}; + ConfigurableAxis zzAxisNsigma{"zzAxisNsigma", {200, -10., 10.}, "n sigma"}; + ConfigurableAxis zzAxisDCA{"zzAxisDCA", {100, -0.5, 0.5}, "DCA (cm)"}; + ConfigurableAxis zzAxisAvgITSclsSizes{"zzAxisAvgITSclsSizes", {500, 0., 10.}, "ITS average cluster size"}; + ConfigurableAxis zzAxisITSnCls{"zzAxisITSnCls", {8, -0.5, 7.5}, "ITS n clusters"}; + ConfigurableAxis zzAxisITSchi2{"zzAxisITSchi2", {100, 0, 50}, "UTS chi2"}; + ConfigurableAxis zzAxisTPCnCls{"zzAxisTPCnCls", {165, -0.5, 164.5}, "TPC n clusters"}; + ConfigurableAxis zzAxisTPCxRwsFrac{"zzAxisTPCxRwsFrac", {200, 0.0, 2.0}, "TPC fraction of crossed raws"}; + ConfigurableAxis zzAxisTPCchi2{"zzAxisTPCchi2", {100, 0, 10}, "TPC chi2"}; + ConfigurableAxis zzAxisFITtime{"zzAxisFITtime", {201, -40.5, 40.5}, "FIT time in ns"}; + ConfigurableAxis zzAxisFITamplitude{"zzAxisFITamplitude", {1000, 0., 1000.}, "FIT amplitude"}; + + AxisSpec zzAxisChannels{CH_ENUM_COUNTER, -0.5, +CH_ENUM_COUNTER - 0.5, "Channels (-)"}; } confAxis; using FullUDTracks = soa::Join; @@ -184,524 +184,524 @@ struct UpcTauCentralBarrelRL { histos.add("Events/hCountCollisions", ";;Number of analysed collision (-)", HistType::kTH1D, {{1, 0.5, 1.5}}); histos.add("Events/UDtableGapSide", ";GapSide value from UD table (-);Number of events (-)", HistType::kTH1D, {{4, -1.5, 2.5}}); histos.add("Events/TrueGapSideDiffToTableValue", ";Difference trueGapSide from SGselector and gapSide from UD table (-);Number of events (-)", HistType::kTH1D, {{7, -3.5, 3.5}}); - histos.add("Events/hNreconstructedTracks", ";Number of tracks in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); - histos.add("Events/hNreconstructedPVGT", ";Number of good track particles from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); - histos.add("Events/hNreconstructedNotPVGT", ";Number of good track particles from NOT primary vertex in a collision (-);Number of events (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); - histos.add("Events/hNreconstructedPVGTelectrons", ";Number of good track identified electrons from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); - histos.add("Events/hNreconstructedPVGTmuons", ";Number of good track identified muons from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); - histos.add("Events/hNreconstructedPVGTpions", ";Number of good track identified pions from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); - histos.add("Events/hNreconstructedPVGTothers", ";Number of good track NOT identified electron/muon/pion particles from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNtracks}); - histos.add("Events/hChannels", ";Channels (-);Number of events (-)", HistType::kTH1D, {{confAxis.axisChannels}}); - histos.add("Events/FIT/hAmplitudeFT0A", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITamplitude}}); - histos.add("Events/FIT/hAmplitudeFT0C", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITamplitude}}); - histos.add("Events/FIT/hAmplitudeFDDA", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITamplitude}}); - histos.add("Events/FIT/hAmplitudeFDDC", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITamplitude}}); - histos.add("Events/FIT/hAmplitudeFV0A", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITamplitude}}); - histos.add("Events/FIT/hTimeFT0A", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITtime}}); - histos.add("Events/FIT/hTimeFT0C", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITtime}}); - histos.add("Events/FIT/hTimeFDDA", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITtime}}); - histos.add("Events/FIT/hTimeFDDC", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITtime}}); - histos.add("Events/FIT/hTimeFV0A", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.axisFITtime}}); - histos.add("Events/FIT/hTimeFT0AvsFT0C", ";FT0A time (ns);FT0C time (ns)", HistType::kTH2F, {{confAxis.axisFITtime}, {confAxis.axisFITtime}}); - histos.add("Events/FIT/hTimeFT0CvsFDDA", ";FT0C time (ns);FDDA time (ns)", HistType::kTH2F, {{confAxis.axisFITtime}, {confAxis.axisFITtime}}); - histos.add("Events/FIT/hTimeFDDAvsFDDC", ";FDDA time (ns);FDDC time (ns)", HistType::kTH2F, {{confAxis.axisFITtime}, {confAxis.axisFITtime}}); - histos.add("Events/FIT/hTimeFDDCvsFV0A", ";FDDC time (ns);FV0A time (ns)", HistType::kTH2F, {{confAxis.axisFITtime}, {confAxis.axisFITtime}}); - histos.add("Events/FIT/hTimeFV0AvsFT0A", ";FV0A time (ns);FT0A time (ns)", HistType::kTH2F, {{confAxis.axisFITtime}, {confAxis.axisFITtime}}); - - histos.add("Tracks/raw/hTrackZ", ";Track z-vertex (cm);Number of events (-)", HistType::kTH1D, {confAxis.axisZvtx}); - histos.add("Tracks/raw/hTrackP", ";Track #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("Tracks/raw/hTrackPt", ";Track #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("Tracks/raw/hTrackPhi", ";Track #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("Tracks/raw/hTrackPtvsModPhi", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("Tracks/raw/hTrackPtvsModPhiTOF", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("Tracks/raw/hTrackEta", ";Track #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); - histos.add("Tracks/raw/hTrackDcaXY", ";Track DCA_{XY} (cm);Number of events (-)", HistType::kTH1D, {confAxis.axisDCA}); - histos.add("Tracks/raw/hTrackPtvsDcaXY", ";Track #it{p_{T}} (GeV/c);Track DCA_{XY} (cm)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisDCA}); - histos.add("Tracks/raw/hTrackDcaZ", ";Track DCA_{Z} (cm);Number of events (-)", HistType::kTH1D, {confAxis.axisDCA}); - histos.add("Tracks/raw/ITS/itsNCls", "number of found ITS clusters;# clusters ITS", kTH1D, {confAxis.axisITSnCls}); - histos.add("Tracks/raw/ITS/itsChi2NCl", "chi2 per ITS cluster;chi2 / cluster ITS", kTH1D, {confAxis.axisITSchi2}); - histos.add("Tracks/raw/TPC/tpcNClsFindable", "number of findable TPC clusters;# findable clusters TPC", kTH1D, {confAxis.axisTPCnCls}); - histos.add("Tracks/raw/TPC/tpcNClsFound", "number of found TPC clusters;# clusters TPC", kTH1D, {confAxis.axisTPCnCls}); - histos.add("Tracks/raw/TPC/tpcCrossedRows", "number of crossed TPC rows;# crossed rows TPC", kTH1D, {confAxis.axisTPCnCls}); - histos.add("Tracks/raw/TPC/tpcCrossedRowsOverFindableCls", "crossed TPC rows over findable clusters;crossed rows / findable clusters TPC", kTH1D, {confAxis.axisTPCxRwsFrac}); - histos.add("Tracks/raw/TPC/tpcChi2NCl", "chi2 per cluster in TPC;chi2 / cluster TPC", kTH1D, {confAxis.axisTPCchi2}); - histos.add("Tracks/GoodTrack/hTrackZ", ";Track z-vertex (cm);Number of events (-)", HistType::kTH1D, {confAxis.axisZvtx}); - histos.add("Tracks/GoodTrack/hTrackP", ";Track #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("Tracks/GoodTrack/hTrackPt", ";Track #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("Tracks/GoodTrack/hTrackPhi", ";Track #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("Tracks/GoodTrack/hTrackPtvsModPhi", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("Tracks/GoodTrack/hTrackPtvsModPhiTOF", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("Tracks/GoodTrack/hTrackEta", ";Track #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); - histos.add("Tracks/GoodTrack/hTrackDcaXY", ";Track DCA_{XY} (cm);Number of events (-)", HistType::kTH1D, {confAxis.axisDCA}); - histos.add("Tracks/GoodTrack/hTrackPtvsDcaXY", ";Track #it{p_{T}} (GeV/c);Track DCA_{XY} (cm)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisDCA}); - histos.add("Tracks/GoodTrack/hTrackDcaZ", ";Track DCA_{Z} (cm);Number of events (-)", HistType::kTH1D, {confAxis.axisDCA}); - histos.add("Tracks/GoodTrack/ITS/itsNCls", "number of found ITS clusters;# clusters ITS", kTH1D, {confAxis.axisITSnCls}); - histos.add("Tracks/GoodTrack/ITS/itsChi2NCl", "chi2 per ITS cluster;chi2 / cluster ITS", kTH1D, {confAxis.axisITSchi2}); - histos.add("Tracks/GoodTrack/TPC/tpcNClsFindable", "number of findable TPC clusters;# findable clusters TPC", kTH1D, {confAxis.axisTPCnCls}); - histos.add("Tracks/GoodTrack/TPC/tpcNClsFound", "number of found TPC clusters;# clusters TPC", kTH1D, {confAxis.axisTPCnCls}); - histos.add("Tracks/GoodTrack/TPC/tpcCrossedRows", "number of crossed TPC rows;# crossed rows TPC", kTH1D, {confAxis.axisTPCnCls}); - histos.add("Tracks/GoodTrack/TPC/tpcCrossedRowsOverFindableCls", "crossed TPC rows over findable clusters;crossed rows / findable clusters TPC", kTH1D, {confAxis.axisTPCxRwsFrac}); - histos.add("Tracks/GoodTrack/TPC/tpcChi2NCl", "chi2 per cluster in TPC;chi2 / cluster TPC", kTH1D, {confAxis.axisTPCchi2}); + histos.add("Events/hNreconstructedTracks", ";Number of tracks in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisNtracks}); + histos.add("Events/hNreconstructedPVGT", ";Number of good track particles from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisNtracks}); + histos.add("Events/hNreconstructedNotPVGT", ";Number of good track particles from NOT primary vertex in a collision (-);Number of events (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisNtracks}); + histos.add("Events/hNreconstructedPVGTelectrons", ";Number of good track identified electrons from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisNtracks}); + histos.add("Events/hNreconstructedPVGTmuons", ";Number of good track identified muons from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisNtracks}); + histos.add("Events/hNreconstructedPVGTpions", ";Number of good track identified pions from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisNtracks}); + histos.add("Events/hNreconstructedPVGTothers", ";Number of good track NOT identified electron/muon/pion particles from primary vertex in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisNtracks}); + histos.add("Events/hChannels", ";Channels (-);Number of events (-)", HistType::kTH1D, {{confAxis.zzAxisChannels}}); + histos.add("Events/FIT/hAmplitudeFT0A", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.zzAxisFITamplitude}}); + histos.add("Events/FIT/hAmplitudeFT0C", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.zzAxisFITamplitude}}); + histos.add("Events/FIT/hAmplitudeFDDA", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.zzAxisFITamplitude}}); + histos.add("Events/FIT/hAmplitudeFDDC", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.zzAxisFITamplitude}}); + histos.add("Events/FIT/hAmplitudeFV0A", ";Amplitude (-);Number of events (-)", HistType::kTH1F, {{confAxis.zzAxisFITamplitude}}); + histos.add("Events/FIT/hTimeFT0A", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.zzAxisFITtime}}); + histos.add("Events/FIT/hTimeFT0C", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.zzAxisFITtime}}); + histos.add("Events/FIT/hTimeFDDA", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.zzAxisFITtime}}); + histos.add("Events/FIT/hTimeFDDC", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.zzAxisFITtime}}); + histos.add("Events/FIT/hTimeFV0A", ";Time (ns);Number of events (-)", HistType::kTH1F, {{confAxis.zzAxisFITtime}}); + histos.add("Events/FIT/hTimeFT0AvsFT0C", ";FT0A time (ns);FT0C time (ns)", HistType::kTH2F, {{confAxis.zzAxisFITtime}, {confAxis.zzAxisFITtime}}); + histos.add("Events/FIT/hTimeFT0CvsFDDA", ";FT0C time (ns);FDDA time (ns)", HistType::kTH2F, {{confAxis.zzAxisFITtime}, {confAxis.zzAxisFITtime}}); + histos.add("Events/FIT/hTimeFDDAvsFDDC", ";FDDA time (ns);FDDC time (ns)", HistType::kTH2F, {{confAxis.zzAxisFITtime}, {confAxis.zzAxisFITtime}}); + histos.add("Events/FIT/hTimeFDDCvsFV0A", ";FDDC time (ns);FV0A time (ns)", HistType::kTH2F, {{confAxis.zzAxisFITtime}, {confAxis.zzAxisFITtime}}); + histos.add("Events/FIT/hTimeFV0AvsFT0A", ";FV0A time (ns);FT0A time (ns)", HistType::kTH2F, {{confAxis.zzAxisFITtime}, {confAxis.zzAxisFITtime}}); + + histos.add("Tracks/raw/hTrackZ", ";Track z-vertex (cm);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisZvtx}); + histos.add("Tracks/raw/hTrackP", ";Track #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("Tracks/raw/hTrackPt", ";Track #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("Tracks/raw/hTrackPhi", ";Track #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("Tracks/raw/hTrackPtvsModPhi", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("Tracks/raw/hTrackPtvsModPhiTOF", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("Tracks/raw/hTrackEta", ";Track #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisEta}); + histos.add("Tracks/raw/hTrackDcaXY", ";Track DCA_{XY} (cm);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisDCA}); + histos.add("Tracks/raw/hTrackPtvsDcaXY", ";Track #it{p_{T}} (GeV/c);Track DCA_{XY} (cm)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisDCA}); + histos.add("Tracks/raw/hTrackDcaZ", ";Track DCA_{Z} (cm);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisDCA}); + histos.add("Tracks/raw/ITS/itsNCls", "number of found ITS clusters;# clusters ITS", kTH1D, {confAxis.zzAxisITSnCls}); + histos.add("Tracks/raw/ITS/itsChi2NCl", "chi2 per ITS cluster;chi2 / cluster ITS", kTH1D, {confAxis.zzAxisITSchi2}); + histos.add("Tracks/raw/TPC/tpcNClsFindable", "number of findable TPC clusters;# findable clusters TPC", kTH1D, {confAxis.zzAxisTPCnCls}); + histos.add("Tracks/raw/TPC/tpcNClsFound", "number of found TPC clusters;# clusters TPC", kTH1D, {confAxis.zzAxisTPCnCls}); + histos.add("Tracks/raw/TPC/tpcCrossedRows", "number of crossed TPC rows;# crossed rows TPC", kTH1D, {confAxis.zzAxisTPCnCls}); + histos.add("Tracks/raw/TPC/tpcCrossedRowsOverFindableCls", "crossed TPC rows over findable clusters;crossed rows / findable clusters TPC", kTH1D, {confAxis.zzAxisTPCxRwsFrac}); + histos.add("Tracks/raw/TPC/tpcChi2NCl", "chi2 per cluster in TPC;chi2 / cluster TPC", kTH1D, {confAxis.zzAxisTPCchi2}); + histos.add("Tracks/GoodTrack/hTrackZ", ";Track z-vertex (cm);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisZvtx}); + histos.add("Tracks/GoodTrack/hTrackP", ";Track #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("Tracks/GoodTrack/hTrackPt", ";Track #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("Tracks/GoodTrack/hTrackPhi", ";Track #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("Tracks/GoodTrack/hTrackPtvsModPhi", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("Tracks/GoodTrack/hTrackPtvsModPhiTOF", ";Track #it{p_{T}} (GeV/c);Track fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("Tracks/GoodTrack/hTrackEta", ";Track #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisEta}); + histos.add("Tracks/GoodTrack/hTrackDcaXY", ";Track DCA_{XY} (cm);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisDCA}); + histos.add("Tracks/GoodTrack/hTrackPtvsDcaXY", ";Track #it{p_{T}} (GeV/c);Track DCA_{XY} (cm)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisDCA}); + histos.add("Tracks/GoodTrack/hTrackDcaZ", ";Track DCA_{Z} (cm);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisDCA}); + histos.add("Tracks/GoodTrack/ITS/itsNCls", "number of found ITS clusters;# clusters ITS", kTH1D, {confAxis.zzAxisITSnCls}); + histos.add("Tracks/GoodTrack/ITS/itsChi2NCl", "chi2 per ITS cluster;chi2 / cluster ITS", kTH1D, {confAxis.zzAxisITSchi2}); + histos.add("Tracks/GoodTrack/TPC/tpcNClsFindable", "number of findable TPC clusters;# findable clusters TPC", kTH1D, {confAxis.zzAxisTPCnCls}); + histos.add("Tracks/GoodTrack/TPC/tpcNClsFound", "number of found TPC clusters;# clusters TPC", kTH1D, {confAxis.zzAxisTPCnCls}); + histos.add("Tracks/GoodTrack/TPC/tpcCrossedRows", "number of crossed TPC rows;# crossed rows TPC", kTH1D, {confAxis.zzAxisTPCnCls}); + histos.add("Tracks/GoodTrack/TPC/tpcCrossedRowsOverFindableCls", "crossed TPC rows over findable clusters;crossed rows / findable clusters TPC", kTH1D, {confAxis.zzAxisTPCxRwsFrac}); + histos.add("Tracks/GoodTrack/TPC/tpcChi2NCl", "chi2 per cluster in TPC;chi2 / cluster TPC", kTH1D, {confAxis.zzAxisTPCchi2}); } if (doPIDhistos) { - histos.add("Tracks/raw/PID/hTPCsignalVsZ", "All tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/hTPCsignalVsP", "All tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/hTPCsignalVsPt", "All tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/hTPCsignalVsEta", "All tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/hTPCsignalVsPhi", "All tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/hTOFsignalVsP", "All tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("Tracks/raw/PID/hTPCnSigmaElVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/raw/PID/hTPCnSigmaMuVsP", ";Track #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/raw/PID/hTPCnSigmaPiVsP", ";Track #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/raw/PID/hTPCnSigmaKaVsP", ";Track #it{p} (GeV/c);n#sigma^{K}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/raw/PID/hTPCnSigmaPrVsP", ";Track #it{p} (GeV/c);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsZ", "Positively charged tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsP", "Positively charged tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsPt", "Positively charged tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsEta", "Positively charged tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsPhi", "Positively charged tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/PosCharge/hTOFsignalVsP", "Positively charged tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsZ", "Negatively charged tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsP", "Negatively charged tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsPt", "Negatively charged tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsEta", "Negatively charged tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsPhi", "Negatively charged tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); - histos.add("Tracks/raw/PID/NegCharge/hTOFsignalVsP", "Negatively charged tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/hTPCsignalVsZ", "All good tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/hTPCsignalVsP", "All good tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/hTPCsignalVsPt", "All good tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/hTPCsignalVsEta", "All good tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/hTPCsignalVsPhi", "All good tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/hTPCnSigmaElVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/hTPCnSigmaMuVsP", ";Track #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/hTPCnSigmaPiVsP", ";Track #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/hTPCnSigmaKaVsP", ";Track #it{p} (GeV/c);n#sigma^{K}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/hTPCnSigmaPrVsP", ";Track #it{p} (GeV/c);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/hTOFsignalVsP", "All good tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsZ", "Positively charged good tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsP", "Positively charged good tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsPt", "Positively charged good tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsEta", "Positively charged good tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsPhi", "Positively charged good tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/PosCharge/hTOFsignalVsP", "Positively charged good tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsZ", "Negatively charged good tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsP", "Negatively charged good tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsPt", "Negatively charged good tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsEta", "Negatively charged good tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsPhi", "Negatively charged good tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/NegCharge/hTOFsignalVsP", "Negatively charged good tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsZ", "Identified electrons;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsP", "Identified electrons;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsPt", "Identified electrons;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsEta", "Identified electrons;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsPhi", "Identified electrons;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Electron/hTOFsignalVsP", "Identified electrons;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaVsP", "Identified electrons;Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaVsP", "Identified electrons;Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsMu", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsMu", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{#mu}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsPi", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsPi", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsKa", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{#it{K}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsKa", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{#it{K}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsPr", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsPr", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{p}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsZ", "Identified muons;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsP", "Identified muons;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsPt", "Identified muons;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsEta", "Identified muons;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsPhi", "Identified muons;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Muon/hTOFsignalVsP", "Identified muons;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaVsP", "Identified muons;Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaVsP", "Identified muons;Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsEl", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{#it{e}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsEl", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{#it{e}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsPi", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsPi", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsKa", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{#it{K}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsKa", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{#it{K}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsPr", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsPr", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{p}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsZ", "Identified pions;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsP", "Identified pions;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsPt", "Identified pions;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsEta", "Identified pions;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsPhi", "Identified pions;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Pion/hTOFsignalVsP", "Identified pions;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaVsP", "Identified pions;Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaVsP", "Identified pions;Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsEl", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{#it{e}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsEl", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{#it{e}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsMu", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsMu", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{#mu}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsKa", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{#it{K}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsKa", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{#it{K}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsPr", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsPr", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{p}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsZ", "Identified NOT electron/Muon/Pion;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisZvtx, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsP", "Identified NOT electron/Muon/Pion;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsPt", "Identified NOT electron/Muon/Pion;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsEta", "Identified NOT electron/Muon/Pion;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisEta, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsPhi", "Identified NOT electron/Muon/Pion;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisTPCdEdx}); - histos.add("Tracks/GoodTrack/PID/Others/hTOFsignalVsP", "Identified NOT electron/Muon/Pion;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); + histos.add("Tracks/raw/PID/hTPCsignalVsZ", "All tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisZvtx, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/hTPCsignalVsP", "All tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/hTPCsignalVsPt", "All tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/hTPCsignalVsEta", "All tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisEta, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/hTPCsignalVsPhi", "All tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/hTOFsignalVsP", "All tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("Tracks/raw/PID/hTPCnSigmaElVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/raw/PID/hTPCnSigmaMuVsP", ";Track #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/raw/PID/hTPCnSigmaPiVsP", ";Track #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/raw/PID/hTPCnSigmaKaVsP", ";Track #it{p} (GeV/c);n#sigma^{K}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/raw/PID/hTPCnSigmaPrVsP", ";Track #it{p} (GeV/c);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsZ", "Positively charged tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisZvtx, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsP", "Positively charged tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsPt", "Positively charged tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsEta", "Positively charged tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisEta, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/PosCharge/hTPCsignalVsPhi", "Positively charged tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/PosCharge/hTOFsignalVsP", "Positively charged tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsZ", "Negatively charged tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisZvtx, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsP", "Negatively charged tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsPt", "Negatively charged tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsEta", "Negatively charged tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisEta, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/NegCharge/hTPCsignalVsPhi", "Negatively charged tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/raw/PID/NegCharge/hTOFsignalVsP", "Negatively charged tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/hTPCsignalVsZ", "All good tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisZvtx, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/hTPCsignalVsP", "All good tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/hTPCsignalVsPt", "All good tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/hTPCsignalVsEta", "All good tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisEta, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/hTPCsignalVsPhi", "All good tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/hTPCnSigmaElVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/hTPCnSigmaMuVsP", ";Track #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/hTPCnSigmaPiVsP", ";Track #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/hTPCnSigmaKaVsP", ";Track #it{p} (GeV/c);n#sigma^{K}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/hTPCnSigmaPrVsP", ";Track #it{p} (GeV/c);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/hTOFsignalVsP", "All good tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsZ", "Positively charged good tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisZvtx, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsP", "Positively charged good tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsPt", "Positively charged good tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsEta", "Positively charged good tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisEta, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/PosCharge/hTPCsignalVsPhi", "Positively charged good tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/PosCharge/hTOFsignalVsP", "Positively charged good tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsZ", "Negatively charged good tracks;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisZvtx, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsP", "Negatively charged good tracks;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsPt", "Negatively charged good tracks;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsEta", "Negatively charged good tracks;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisEta, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/NegCharge/hTPCsignalVsPhi", "Negatively charged good tracks;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/NegCharge/hTOFsignalVsP", "Negatively charged good tracks;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsZ", "Identified electrons;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisZvtx, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsP", "Identified electrons;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsPt", "Identified electrons;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsEta", "Identified electrons;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisEta, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCsignalVsPhi", "Identified electrons;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Electron/hTOFsignalVsP", "Identified electrons;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaVsP", "Identified electrons;Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaVsP", "Identified electrons;Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsMu", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsMu", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{#mu}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsPi", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsPi", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsKa", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{#it{K}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsKa", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{#it{K}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTPCnSigmaElVsPr", "Identified electrons;n#sigma^{#it{e}}_{TPC} (arb. units);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Electron/hTOFnSigmaElVsPr", "Identified electrons;n#sigma^{#it{e}}_{TOF} (arb. units);n#sigma^{p}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsZ", "Identified muons;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisZvtx, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsP", "Identified muons;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsPt", "Identified muons;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsEta", "Identified muons;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisEta, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCsignalVsPhi", "Identified muons;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Muon/hTOFsignalVsP", "Identified muons;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaVsP", "Identified muons;Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaVsP", "Identified muons;Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsEl", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{#it{e}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsEl", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{#it{e}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsPi", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsPi", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsKa", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{#it{K}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsKa", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{#it{K}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTPCnSigmaMuVsPr", "Identified muons;n#sigma^{#mu}_{TPC} (arb. units);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Muon/hTOFnSigmaMuVsPr", "Identified muons;n#sigma^{#mu}_{TOF} (arb. units);n#sigma^{p}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsZ", "Identified pions;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisZvtx, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsP", "Identified pions;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsPt", "Identified pions;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsEta", "Identified pions;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisEta, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCsignalVsPhi", "Identified pions;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Pion/hTOFsignalVsP", "Identified pions;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaVsP", "Identified pions;Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaVsP", "Identified pions;Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsEl", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{#it{e}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsEl", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{#it{e}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsMu", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsMu", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{#mu}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsKa", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{#it{K}}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsKa", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{#it{K}}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTPCnSigmaPiVsPr", "Identified pions;n#sigma^{#pi}_{TPC} (arb. units);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Pion/hTOFnSigmaPiVsPr", "Identified pions;n#sigma^{#pi}_{TOF} (arb. units);n#sigma^{p}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsZ", "Identified NOT electron/Muon/Pion;Track z-vertex (cm);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisZvtx, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsP", "Identified NOT electron/Muon/Pion;Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsPt", "Identified NOT electron/Muon/Pion;Track #it{p_{#rm T}} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsEta", "Identified NOT electron/Muon/Pion;Track #eta (-);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisEta, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Others/hTPCsignalVsPhi", "Identified NOT electron/Muon/Pion;Track #phi (rad);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisTPCdEdx}); + histos.add("Tracks/GoodTrack/PID/Others/hTOFsignalVsP", "Identified NOT electron/Muon/Pion;Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); } if (doTwoTracks) { - histos.add("EventTwoTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventTwoTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/hInvariantMassWideAllPionMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/hInvariantMassWideAllPionMassPtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/hInvariantMassWideAllPionMassTOF", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); - histos.add("EventTwoTracks/hCollinearity", ";#DeltaR (-);Number of events (-)", HistType::kTH1D, {confAxis.axisCollinearity}); - histos.add("EventTwoTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventTwoTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventTwoTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventTwoTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventTwoTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventTwoTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventTwoTracks/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); - histos.add("EventTwoTracks/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); - histos.add("EventTwoTracks/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); - histos.add("EventTwoTracks/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); - histos.add("EventTwoTracks/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); - histos.add("EventTwoTracks/hDaughtersEnergyFractions", ";E_{daughter 1} / E_{tot} (-);E_{daughter 1} / E_{tot} (-)", HistType::kTH2D, {confAxis.axisFraction, confAxis.axisFraction}); - histos.add("EventTwoTracks/hDaughtersPvsITSclusterSize", ";Average ITS cluster size;Daughter #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisAvgITSclsSizes, confAxis.axisMomSigned}); - histos.add("EventTwoTracks/hDaughtersPvsITSclusterSizeXcos", ";Average ITS cluster size x cos(#lambda);Daughter #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisAvgITSclsSizes, confAxis.axisMomSigned}); - histos.add("EventTwoTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("EventTwoTracks/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("EventTwoTracks/PID/hTPCnSigmaElVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/PID/hTPCnSigmaMuVsP", ";Track #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/PID/hTPCnSigmaPiVsP", ";Track #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/PID/hTPCnSigmaKaVsP", ";Track #it{p} (GeV/c);n#sigma^{K}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/PID/hTPCnSigmaPrVsP", ";Track #it{p} (GeV/c);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/PID/NoPID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaElVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaMuVsP", ";Track #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaPiVsP", ";Track #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaKaVsP", ";Track #it{p} (GeV/c);n#sigma^{K}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaPrVsP", ";Track #it{p} (GeV/c);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - - histos.add("EventTwoTracks/TwoElectrons/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventTwoTracks/TwoElectrons/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/TwoElectrons/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/TwoElectrons/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); - histos.add("EventTwoTracks/TwoElectrons/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventTwoTracks/TwoElectrons/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventTwoTracks/TwoElectrons/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventTwoTracks/TwoElectrons/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventTwoTracks/TwoElectrons/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventTwoTracks/TwoElectrons/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhiTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhiPtCutTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("EventTwoTracks/TwoElectrons/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingP", ";Leading #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPwide", ";Leading #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPt", ";Leading #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPhi", ";Leading #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingRapidity", ";Leading #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPvsOtherP", ";Leading #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPwideVsOtherPwide", ";Leading #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPtVsOtherPt", ";Leading #it{p_{T}} (GeV/c); Other #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingPhiVsOtherPhi", ";Leading #phi (rad); Other #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); - histos.add("EventTwoTracks/TwoElectrons/hLeadingRapVsOtherRap", ";Leading #it{y} (-); Other #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTPCsignalVsLP", ";Leading #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTPCsignalVsOP", ";Other #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTOFsignalVsLP", ";Leading #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTOFsignalVsOP", ";Other #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTPCnSigmaVsLP", ";Leading #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTPCnSigmaVsOP", ";Other #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsLP", ";Leading #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsOP", ";Other #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - - histos.add("EventTwoTracks/TwoMuons/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventTwoTracks/TwoMuons/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/TwoMuons/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/TwoMuons/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); - histos.add("EventTwoTracks/TwoMuons/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventTwoTracks/TwoMuons/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventTwoTracks/TwoMuons/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventTwoTracks/TwoMuons/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventTwoTracks/TwoMuons/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventTwoTracks/TwoMuons/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhiTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhiPtCutTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("EventTwoTracks/TwoMuons/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); - histos.add("EventTwoTracks/TwoMuons/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - - histos.add("EventTwoTracks/TwoPions/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventTwoTracks/TwoPions/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/TwoPions/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/TwoPions/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); - histos.add("EventTwoTracks/TwoPions/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventTwoTracks/TwoPions/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventTwoTracks/TwoPions/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventTwoTracks/TwoPions/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventTwoTracks/TwoPions/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventTwoTracks/TwoPions/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); - histos.add("EventTwoTracks/TwoPions/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhiTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhiPtCutTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisModPhi}); - histos.add("EventTwoTracks/TwoPions/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); - histos.add("EventTwoTracks/TwoPions/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - - histos.add("EventTwoTracks/ElectronMuon/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventTwoTracks/ElectronMuon/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/ElectronMuon/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); - histos.add("EventTwoTracks/ElectronMuon/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventTwoTracks/ElectronMuon/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventTwoTracks/ElectronMuon/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronMuon/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventTwoTracks/ElectronMuon/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventTwoTracks/ElectronMuon/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronMuon/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); - histos.add("EventTwoTracks/ElectronMuon/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); - histos.add("EventTwoTracks/ElectronMuon/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronMuon/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); - histos.add("EventTwoTracks/ElectronMuon/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); - histos.add("EventTwoTracks/ElectronMuon/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - - histos.add("EventTwoTracks/ElectronPion/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventTwoTracks/ElectronPion/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/ElectronPion/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); - histos.add("EventTwoTracks/ElectronPion/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventTwoTracks/ElectronPion/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventTwoTracks/ElectronPion/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronPion/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventTwoTracks/ElectronPion/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventTwoTracks/ElectronPion/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronPion/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); - histos.add("EventTwoTracks/ElectronPion/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); - histos.add("EventTwoTracks/ElectronPion/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronPion/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); - histos.add("EventTwoTracks/ElectronPion/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); - histos.add("EventTwoTracks/ElectronPion/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - - histos.add("EventTwoTracks/MuonPion/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventTwoTracks/MuonPion/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/MuonPion/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/MuonPion/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); - histos.add("EventTwoTracks/MuonPion/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventTwoTracks/MuonPion/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventTwoTracks/MuonPion/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventTwoTracks/MuonPion/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventTwoTracks/MuonPion/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventTwoTracks/MuonPion/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventTwoTracks/MuonPion/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); - histos.add("EventTwoTracks/MuonPion/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); - histos.add("EventTwoTracks/MuonPion/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); - histos.add("EventTwoTracks/MuonPion/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); - histos.add("EventTwoTracks/MuonPion/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); - histos.add("EventTwoTracks/MuonPion/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventTwoTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventTwoTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/hInvariantMassWideAllPionMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/hInvariantMassWideAllPionMassPtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/hInvariantMassWideAllPionMassTOF", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisAcoplanarity}); + histos.add("EventTwoTracks/hCollinearity", ";#DeltaR (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisCollinearity}); + histos.add("EventTwoTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventTwoTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventTwoTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventTwoTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisMom}); + histos.add("EventTwoTracks/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMomWide, confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.zzAxisRap, confAxis.zzAxisRap}); + histos.add("EventTwoTracks/hDaughtersEnergyFractions", ";E_{daughter 1} / E_{tot} (-);E_{daughter 1} / E_{tot} (-)", HistType::kTH2D, {confAxis.zzAxisFraction, confAxis.zzAxisFraction}); + histos.add("EventTwoTracks/hDaughtersPvsITSclusterSize", ";Average ITS cluster size;Daughter #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisAvgITSclsSizes, confAxis.zzAxisMomSigned}); + histos.add("EventTwoTracks/hDaughtersPvsITSclusterSizeXcos", ";Average ITS cluster size x cos(#lambda);Daughter #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisAvgITSclsSizes, confAxis.zzAxisMomSigned}); + histos.add("EventTwoTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("EventTwoTracks/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("EventTwoTracks/PID/hTPCnSigmaElVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/PID/hTPCnSigmaMuVsP", ";Track #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/PID/hTPCnSigmaPiVsP", ";Track #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/PID/hTPCnSigmaKaVsP", ";Track #it{p} (GeV/c);n#sigma^{K}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/PID/hTPCnSigmaPrVsP", ";Track #it{p} (GeV/c);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/PID/NoPID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaElVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaMuVsP", ";Track #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaPiVsP", ";Track #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaKaVsP", ";Track #it{p} (GeV/c);n#sigma^{K}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/PID/NoPID/hTPCnSigmaPrVsP", ";Track #it{p} (GeV/c);n#sigma^{p}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + + histos.add("EventTwoTracks/TwoElectrons/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventTwoTracks/TwoElectrons/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/TwoElectrons/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/TwoElectrons/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisAcoplanarity}); + histos.add("EventTwoTracks/TwoElectrons/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventTwoTracks/TwoElectrons/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/TwoElectrons/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventTwoTracks/TwoElectrons/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/TwoElectrons/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventTwoTracks/TwoElectrons/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisMom}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMomWide, confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhiTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersPtvsModPhiPtCutTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("EventTwoTracks/TwoElectrons/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.zzAxisRap, confAxis.zzAxisRap}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingP", ";Leading #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPwide", ";Leading #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPt", ";Leading #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPhi", ";Leading #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingRapidity", ";Leading #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPvsOtherP", ";Leading #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisMom}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPwideVsOtherPwide", ";Leading #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMomWide, confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPtVsOtherPt", ";Leading #it{p_{T}} (GeV/c); Other #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingPhiVsOtherPhi", ";Leading #phi (rad); Other #phi (rad)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/TwoElectrons/hLeadingRapVsOtherRap", ";Leading #it{y} (-); Other #it{y} (-)", HistType::kTH2D, {confAxis.zzAxisRap, confAxis.zzAxisRap}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTPCsignalVsLP", ";Leading #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTPCsignalVsOP", ";Other #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTOFsignalVsLP", ";Leading #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTOFsignalVsOP", ";Other #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTPCnSigmaVsLP", ";Leading #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTPCnSigmaVsOP", ";Other #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsLP", ";Leading #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/TwoElectrons/PID/hTOFnSigmaVsOP", ";Other #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + + histos.add("EventTwoTracks/TwoMuons/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventTwoTracks/TwoMuons/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/TwoMuons/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/TwoMuons/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisAcoplanarity}); + histos.add("EventTwoTracks/TwoMuons/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventTwoTracks/TwoMuons/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/TwoMuons/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventTwoTracks/TwoMuons/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/TwoMuons/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventTwoTracks/TwoMuons/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisMom}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMomWide, confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhiTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersPtvsModPhiPtCutTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("EventTwoTracks/TwoMuons/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.zzAxisRap, confAxis.zzAxisRap}); + histos.add("EventTwoTracks/TwoMuons/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + + histos.add("EventTwoTracks/TwoPions/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventTwoTracks/TwoPions/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/TwoPions/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/TwoPions/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisAcoplanarity}); + histos.add("EventTwoTracks/TwoPions/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventTwoTracks/TwoPions/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/TwoPions/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventTwoTracks/TwoPions/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/TwoPions/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventTwoTracks/TwoPions/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisMom}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMomWide, confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/TwoPions/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhi", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhiTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhiPtCut", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("EventTwoTracks/TwoPions/hDaughtersPtvsModPhiPtCutTOF", ";Daughter #it{p_{T}} (GeV/c);Daughter fmod(#phi,#pi/9)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisModPhi}); + histos.add("EventTwoTracks/TwoPions/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.zzAxisRap, confAxis.zzAxisRap}); + histos.add("EventTwoTracks/TwoPions/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + + histos.add("EventTwoTracks/ElectronMuon/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventTwoTracks/ElectronMuon/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/ElectronMuon/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisAcoplanarity}); + histos.add("EventTwoTracks/ElectronMuon/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventTwoTracks/ElectronMuon/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/ElectronMuon/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronMuon/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/ElectronMuon/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventTwoTracks/ElectronMuon/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronMuon/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisMom}); + histos.add("EventTwoTracks/ElectronMuon/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMomWide, confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/ElectronMuon/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronMuon/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/ElectronMuon/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.zzAxisRap, confAxis.zzAxisRap}); + histos.add("EventTwoTracks/ElectronMuon/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + + histos.add("EventTwoTracks/ElectronPion/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventTwoTracks/ElectronPion/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/ElectronPion/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisAcoplanarity}); + histos.add("EventTwoTracks/ElectronPion/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventTwoTracks/ElectronPion/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/ElectronPion/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronPion/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/ElectronPion/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventTwoTracks/ElectronPion/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronPion/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisMom}); + histos.add("EventTwoTracks/ElectronPion/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMomWide, confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/ElectronPion/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronPion/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/ElectronPion/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.zzAxisRap, confAxis.zzAxisRap}); + histos.add("EventTwoTracks/ElectronPion/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + + histos.add("EventTwoTracks/MuonPion/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventTwoTracks/MuonPion/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/MuonPion/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/MuonPion/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisAcoplanarity}); + histos.add("EventTwoTracks/MuonPion/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventTwoTracks/MuonPion/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/MuonPion/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventTwoTracks/MuonPion/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/MuonPion/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventTwoTracks/MuonPion/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/MuonPion/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisMom}); + histos.add("EventTwoTracks/MuonPion/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMomWide, confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/MuonPion/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/MuonPion/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/MuonPion/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.zzAxisRap, confAxis.zzAxisRap}); + histos.add("EventTwoTracks/MuonPion/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); histos.add("EventTwoTracks/ElectronMuPi/hNeventsPtCuts", ";Selection (-);Number of events (-)", HistType::kTH1D, {{20, -0.5, 19.5}}); - histos.add("EventTwoTracks/ElectronMuPi/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventTwoTracks/ElectronMuPi/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/ElectronMuPi/PionsSelection/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventTwoTracks/ElectronMuPi/PionsSelection/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/ElectronMuPi/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); - histos.add("EventTwoTracks/ElectronMuPi/hCollinearity", ";#DeltaR (-);Number of events (-)", HistType::kTH1D, {confAxis.axisCollinearity}); - histos.add("EventTwoTracks/ElectronMuPi/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventTwoTracks/ElectronMuPi/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventTwoTracks/ElectronMuPi/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronMuPi/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventTwoTracks/ElectronMuPi/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventTwoTracks/ElectronMuPi/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronPtWide", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventTwoTracks/ElectronMuPi/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); - histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); - histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); - histos.add("EventTwoTracks/ElectronMuPi/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); - histos.add("EventTwoTracks/ElectronMuPi/hDaughtersEnergyFractions", ";E_{electron} / E_{tot} (-);E_{#mu/#pi} / E_{tot} (-)", HistType::kTH2D, {confAxis.axisFraction, confAxis.axisFraction}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronPvsOtherP", ";Electron #it{p} (GeV/c); #mu/#pi #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronPwideVsOtherPwide", ";Electron #it{p} (GeV/c); #mu/#pi #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronPtVsOtherPt", ";Electron #it{p_{T}} (GeV/c); #mu/#pi #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronPhiVsOtherPhi", ";Electron #phi (rad); #mu/#pi #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); - histos.add("EventTwoTracks/ElectronMuPi/hElectronRapVsOtherRap", ";Electron #it{y} (-); #mu/#pi #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); - - histos.add("EventTwoTracks/ElectronMuPi/PID/mcTruth/nSigmaTPC1", "Paul's way;True electron #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/mcTruth/nSigmaTPC2", "Paul's way;True not-electron #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsEPofE", ";Electron #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsOPofO", ";#mu/#pi #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofE", ";Electron #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPPofE", ";Electron #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofE", ";Electron n#sigma^{e}_{TPC} (arb. units);Electron n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofO", ";Non-electron #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsMPofO", ";Non-electron #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPPofO", ";Non-electron #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofO", ";Non-electron n#sigma^{e}_{TPC} (arb. units);Non-electron n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsEPofE", ";Electron #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEPofE", ";Electron #it{p} (GeV/c);n#sigma^{e}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPPofE", ";Electron #it{p} (GeV/c);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaEvsnSigmaPofE", ";Electron n#sigma^{e}_{TOF} (arb. units);Electron n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsOPofO", ";Not-electron #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEPofO", ";Not-electron #it{p} (GeV/c);n#sigma^{e}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsMPofO", ";Not-electron #it{p} (GeV/c);n#sigma^{#mu}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPPofO", ";Not-electron #it{p} (GeV/c);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaEvsnSigmaPofO", ";Not-electron n#sigma^{e}_{TOF} (arb. units);Not-electron n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisNsigma, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventTwoTracks/ElectronMuPi/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/ElectronMuPi/PionsSelection/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventTwoTracks/ElectronMuPi/PionsSelection/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/ElectronMuPi/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisAcoplanarity}); + histos.add("EventTwoTracks/ElectronMuPi/hCollinearity", ";#DeltaR (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisCollinearity}); + histos.add("EventTwoTracks/ElectronMuPi/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventTwoTracks/ElectronMuPi/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/ElectronMuPi/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronMuPi/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/ElectronMuPi/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventTwoTracks/ElectronMuPi/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronPtWide", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/ElectronMuPi/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisMom}); + histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMomWide, confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronMuPi/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/ElectronMuPi/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.zzAxisRap, confAxis.zzAxisRap}); + histos.add("EventTwoTracks/ElectronMuPi/hDaughtersEnergyFractions", ";E_{electron} / E_{tot} (-);E_{#mu/#pi} / E_{tot} (-)", HistType::kTH2D, {confAxis.zzAxisFraction, confAxis.zzAxisFraction}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronPvsOtherP", ";Electron #it{p} (GeV/c); #mu/#pi #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisMom}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronPwideVsOtherPwide", ";Electron #it{p} (GeV/c); #mu/#pi #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMomWide, confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronPtVsOtherPt", ";Electron #it{p_{T}} (GeV/c); #mu/#pi #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronPhiVsOtherPhi", ";Electron #phi (rad); #mu/#pi #phi (rad)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/ElectronMuPi/hElectronRapVsOtherRap", ";Electron #it{y} (-); #mu/#pi #it{y} (-)", HistType::kTH2D, {confAxis.zzAxisRap, confAxis.zzAxisRap}); + + histos.add("EventTwoTracks/ElectronMuPi/PID/mcTruth/nSigmaTPC1", "Paul's way;True electron #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/mcTruth/nSigmaTPC2", "Paul's way;True not-electron #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsEPofE", ";Electron #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCsignalVsOPofO", ";#mu/#pi #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofE", ";Electron #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPPofE", ";Electron #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofE", ";Electron n#sigma^{e}_{TPC} (arb. units);Electron n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsEPofO", ";Non-electron #it{p} (GeV/c);n#sigma^{e}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsMPofO", ";Non-electron #it{p} (GeV/c);n#sigma^{#mu}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaVsPPofO", ";Non-electron #it{p} (GeV/c);n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTPCnSigmaEvsnSigmaPofO", ";Non-electron n#sigma^{e}_{TPC} (arb. units);Non-electron n#sigma^{#pi}_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma^{e}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsEPofE", ";Electron #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEPofE", ";Electron #it{p} (GeV/c);n#sigma^{e}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPPofE", ";Electron #it{p} (GeV/c);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaEvsnSigmaPofE", ";Electron n#sigma^{e}_{TOF} (arb. units);Electron n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFsignalVsOPofO", ";Not-electron #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsEPofO", ";Not-electron #it{p} (GeV/c);n#sigma^{e}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsMPofO", ";Not-electron #it{p} (GeV/c);n#sigma^{#mu}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaVsPPofO", ";Not-electron #it{p} (GeV/c);n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronMuPi/PID/hTOFnSigmaEvsnSigmaPofO", ";Not-electron n#sigma^{e}_{TOF} (arb. units);Not-electron n#sigma^{#pi}_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisNsigma, confAxis.zzAxisNsigma}); histos.add("EventTwoTracks/ElectronOther/hNeventsPtCuts", ";Selection (-);Number of events (-)", HistType::kTH1D, {{20, -0.5, 19.5}}); - histos.add("EventTwoTracks/ElectronOther/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventTwoTracks/ElectronOther/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventTwoTracks/ElectronOther/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisAcoplanarity}); - histos.add("EventTwoTracks/ElectronOther/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventTwoTracks/ElectronOther/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventTwoTracks/ElectronOther/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronOther/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventTwoTracks/ElectronOther/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventTwoTracks/ElectronOther/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronOther/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronOther/hElectronPtWide", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventTwoTracks/ElectronOther/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); - histos.add("EventTwoTracks/ElectronOther/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); - histos.add("EventTwoTracks/ElectronOther/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronOther/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); - histos.add("EventTwoTracks/ElectronOther/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); - histos.add("EventTwoTracks/ElectronOther/hElectronPvsOtherP", ";Electron #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisMom}); - histos.add("EventTwoTracks/ElectronOther/hElectronPwideVsOtherPwide", ";Electron #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {confAxis.axisMomWide, confAxis.axisMomWide}); - histos.add("EventTwoTracks/ElectronOther/hElectronPtVsOtherPt", ";Electron #it{p_{T}} (GeV/c); Other #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisPt, confAxis.axisPt}); - histos.add("EventTwoTracks/ElectronOther/hElectronPhiVsOtherPhi", ";Electron #phi (rad); Other #phi (rad)", HistType::kTH2D, {confAxis.axisPhi, confAxis.axisPhi}); - histos.add("EventTwoTracks/ElectronOther/hElectronRapVsOtherRap", ";Electron #it{y} (-); Other #it{y} (-)", HistType::kTH2D, {confAxis.axisRap, confAxis.axisRap}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCsignalVsEP", ";Electron #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCsignalVsOP", ";#it{e}/#mu/#pi #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFsignalVsEP", ";Electron #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFsignalVsOP", ";Other #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTOFsignal}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsEP", ";Electron #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsMP", ";Muon #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsPP", ";Pion #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsEP", ";Electron #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsMP", ";Muon #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); - histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsPP", ";Pion #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisNsigma}); + histos.add("EventTwoTracks/ElectronOther/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventTwoTracks/ElectronOther/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventTwoTracks/ElectronOther/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisAcoplanarity}); + histos.add("EventTwoTracks/ElectronOther/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventTwoTracks/ElectronOther/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/ElectronOther/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronOther/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/ElectronOther/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventTwoTracks/ElectronOther/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronOther/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronOther/hElectronPtWide", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/ElectronOther/hDaughtersP", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisMom}); + histos.add("EventTwoTracks/ElectronOther/hDaughtersPwide", ";Daughter 1 #it{p} (GeV/c);Daughter 2 #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMomWide, confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/ElectronOther/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronOther/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/ElectronOther/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {confAxis.zzAxisRap, confAxis.zzAxisRap}); + histos.add("EventTwoTracks/ElectronOther/hElectronPvsOtherP", ";Electron #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisMom}); + histos.add("EventTwoTracks/ElectronOther/hElectronPwideVsOtherPwide", ";Electron #it{p} (GeV/c); Other #it{p} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisMomWide, confAxis.zzAxisMomWide}); + histos.add("EventTwoTracks/ElectronOther/hElectronPtVsOtherPt", ";Electron #it{p_{T}} (GeV/c); Other #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisPt, confAxis.zzAxisPt}); + histos.add("EventTwoTracks/ElectronOther/hElectronPhiVsOtherPhi", ";Electron #phi (rad); Other #phi (rad)", HistType::kTH2D, {confAxis.zzAxisPhi, confAxis.zzAxisPhi}); + histos.add("EventTwoTracks/ElectronOther/hElectronRapVsOtherRap", ";Electron #it{y} (-); Other #it{y} (-)", HistType::kTH2D, {confAxis.zzAxisRap, confAxis.zzAxisRap}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCsignalVsEP", ";Electron #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCsignalVsOP", ";#it{e}/#mu/#pi #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFsignalVsP", ";Track #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFsignalVsEP", ";Electron #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFsignalVsOP", ";Other #it{p} (GeV/c);TOF signal (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTOFsignal}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsEP", ";Electron #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsMP", ";Muon #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTPCnSigmaVsPP", ";Pion #it{p} (GeV/c);n#sigma_{TPC} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsP", ";Track #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsEP", ";Electron #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsMP", ";Muon #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); + histos.add("EventTwoTracks/ElectronOther/PID/hTOFnSigmaVsPP", ";Pion #it{p} (GeV/c);n#sigma_{TOF} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisNsigma}); } if (doFourTracks) { - histos.add("EventFourTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventFourTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventFourTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventFourTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventFourTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventFourTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventFourTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventFourTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventFourTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventFourTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - - histos.add("EventFourTracks/WithElectron/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventFourTracks/WithElectron/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventFourTracks/WithElectron/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventFourTracks/WithElectron/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventFourTracks/WithElectron/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventFourTracks/WithElectron/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventFourTracks/WithElectron/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventFourTracks/WithElectron/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventFourTracks/WithElectron/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - - histos.add("EventFourTracks/WithMuon/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventFourTracks/WithMuon/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventFourTracks/WithMuon/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventFourTracks/WithMuon/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventFourTracks/WithMuon/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventFourTracks/WithMuon/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventFourTracks/WithMuon/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventFourTracks/WithMuon/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventFourTracks/WithMuon/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - - histos.add("EventFourTracks/WithPion/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventFourTracks/WithPion/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventFourTracks/WithPion/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventFourTracks/WithPion/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventFourTracks/WithPion/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventFourTracks/WithPion/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventFourTracks/WithPion/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventFourTracks/WithPion/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventFourTracks/WithPion/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventFourTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventFourTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventFourTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventFourTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventFourTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventFourTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventFourTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventFourTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventFourTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventFourTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + + histos.add("EventFourTracks/WithElectron/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventFourTracks/WithElectron/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventFourTracks/WithElectron/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventFourTracks/WithElectron/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventFourTracks/WithElectron/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventFourTracks/WithElectron/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventFourTracks/WithElectron/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventFourTracks/WithElectron/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventFourTracks/WithElectron/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + + histos.add("EventFourTracks/WithMuon/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventFourTracks/WithMuon/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventFourTracks/WithMuon/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventFourTracks/WithMuon/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventFourTracks/WithMuon/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventFourTracks/WithMuon/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventFourTracks/WithMuon/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventFourTracks/WithMuon/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventFourTracks/WithMuon/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + + histos.add("EventFourTracks/WithPion/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventFourTracks/WithPion/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventFourTracks/WithPion/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventFourTracks/WithPion/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventFourTracks/WithPion/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventFourTracks/WithPion/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventFourTracks/WithPion/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventFourTracks/WithPion/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventFourTracks/WithPion/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); } if (doSixTracks) { - histos.add("EventSixTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventSixTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventSixTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventSixTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventSixTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventSixTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventSixTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventSixTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventSixTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventSixTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); - - histos.add("EventSixTracks/SixPions/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMass}); - histos.add("EventSixTracks/SixPions/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.axisInvMassWide}); - histos.add("EventSixTracks/SixPions/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("EventSixTracks/SixPions/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMomWide}); - histos.add("EventSixTracks/SixPions/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("EventSixTracks/SixPions/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("EventSixTracks/SixPions/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.axisRap}); - histos.add("EventSixTracks/SixPions/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.axisInvMassWide, confAxis.axisPt}); - histos.add("EventSixTracks/SixPions/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.axisMom, confAxis.axisTPCdEdx}); + histos.add("EventSixTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventSixTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventSixTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventSixTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventSixTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventSixTracks/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventSixTracks/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventSixTracks/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventSixTracks/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventSixTracks/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); + + histos.add("EventSixTracks/SixPions/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMass}); + histos.add("EventSixTracks/SixPions/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {confAxis.zzAxisInvMassWide}); + histos.add("EventSixTracks/SixPions/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("EventSixTracks/SixPions/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMomWide}); + histos.add("EventSixTracks/SixPions/hMotherPt", ";Mother #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("EventSixTracks/SixPions/hMotherPhi", ";Mother #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("EventSixTracks/SixPions/hMotherRapidity", ";Mother #it{y} (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisRap}); + histos.add("EventSixTracks/SixPions/hMotherMassVsPt", ";Invariant mass (GeV/c^{2});Mother #it{p_{T}} (GeV/c)", HistType::kTH2D, {confAxis.zzAxisInvMassWide, confAxis.zzAxisPt}); + histos.add("EventSixTracks/SixPions/PID/hTPCsignalVsP", ";Track #it{p} (GeV/c);TPC d#it{E}/d#it{x} (arb. units)", HistType::kTH2D, {confAxis.zzAxisMom, confAxis.zzAxisTPCdEdx}); } if (doTruthHistos) { histos.add("Events/Truth/hCountCollisions", ";;Number of generated collision (-)", HistType::kTH1D, {{1, 0.5, 1.5}}); - histos.add("Events/Truth/hChannels", ";Channels (-);Number of events (-)", HistType::kTH1D, {{confAxis.axisChannels}}); + histos.add("Events/Truth/hChannels", ";Channels (-);Number of events (-)", HistType::kTH1D, {{confAxis.zzAxisChannels}}); histos.add("Events/Truth/hPDGcodesAll", ";PDG codes of all particles (-);Number of events (-)", HistType::kTH1D, {{2001, -1000, 1000}}); histos.add("Events/Truth/hPDGcodesNoMother", ";PDG codes of particles without mother (-);Number of events (-)", HistType::kTH1D, {{2001, -1000, 1000}}); histos.add("Events/Truth/hPDGcodesTauDaughters", ";PDG codes of daughters of particles without mother (-);Number of events (-)", HistType::kTH1D, {{2001, -1000, 1000}}); - histos.add("Events/Truth/hNparticles", ";Number of particles in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); - histos.add("Events/Truth/hNtauDaughters", ";Number of daughters of no-mother particle in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); - histos.add("Events/Truth/hNelectrons", ";Number of electrons in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); - histos.add("Events/Truth/hNmuons", ";Number of muons in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); - histos.add("Events/Truth/hNpions", ";Number of pions in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.axisNparticles}); - histos.add("Events/Truth/hNphysPartVsNwoutMotherParts", ";Number of physical primary particles (-);Number of particles without mother(-)", HistType::kTH2D, {confAxis.axisNparticles, confAxis.axisNparticles}); - histos.add("Tracks/Truth/hTauP", ";Tau #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("Tracks/Truth/hTauPt", ";Tau #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("Tracks/Truth/hTauPhi", ";Tau #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("Tracks/Truth/hTauEta", ";Tau #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); - histos.add("Tracks/Truth/hElectronP", ";Electron #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("Tracks/Truth/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("Tracks/Truth/hElectronPhi", ";Electron #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("Tracks/Truth/hElectronEta", ";Electron #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); - histos.add("Tracks/Truth/hMuonP", ";Muon #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("Tracks/Truth/hMuonPt", ";Muon #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("Tracks/Truth/hMuonPhi", ";Muon #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("Tracks/Truth/hMuonEta", ";Muon #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); - histos.add("Tracks/Truth/hPionP", ";Pion #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisMom}); - histos.add("Tracks/Truth/hPionPt", ";Pion #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.axisPt}); - histos.add("Tracks/Truth/hPionPhi", ";Pion #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.axisPhi}); - histos.add("Tracks/Truth/hPionEta", ";Pion #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.axisEta}); + histos.add("Events/Truth/hNparticles", ";Number of particles in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisNparticles}); + histos.add("Events/Truth/hNtauDaughters", ";Number of daughters of no-mother particle in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisNparticles}); + histos.add("Events/Truth/hNelectrons", ";Number of electrons in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisNparticles}); + histos.add("Events/Truth/hNmuons", ";Number of muons in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisNparticles}); + histos.add("Events/Truth/hNpions", ";Number of pions in a collision (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisNparticles}); + histos.add("Events/Truth/hNphysPartVsNwoutMotherParts", ";Number of physical primary particles (-);Number of particles without mother(-)", HistType::kTH2D, {confAxis.zzAxisNparticles, confAxis.zzAxisNparticles}); + histos.add("Tracks/Truth/hTauP", ";Tau #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("Tracks/Truth/hTauPt", ";Tau #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("Tracks/Truth/hTauPhi", ";Tau #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("Tracks/Truth/hTauEta", ";Tau #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisEta}); + histos.add("Tracks/Truth/hElectronP", ";Electron #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("Tracks/Truth/hElectronPt", ";Electron #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("Tracks/Truth/hElectronPhi", ";Electron #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("Tracks/Truth/hElectronEta", ";Electron #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisEta}); + histos.add("Tracks/Truth/hMuonP", ";Muon #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("Tracks/Truth/hMuonPt", ";Muon #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("Tracks/Truth/hMuonPhi", ";Muon #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("Tracks/Truth/hMuonEta", ";Muon #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisEta}); + histos.add("Tracks/Truth/hPionP", ";Pion #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisMom}); + histos.add("Tracks/Truth/hPionPt", ";Pion #it{p_{T}} (GeV/c);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPt}); + histos.add("Tracks/Truth/hPionPhi", ";Pion #phi (rad);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisPhi}); + histos.add("Tracks/Truth/hPionEta", ";Pion #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisEta}); } } // end init From 258759aa207f13958e55eb47bff55297c9d78afd Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:40:17 +0100 Subject: [PATCH 447/459] [PWGEM/PhotonMeson] Change event counter precision (float -> double) (#9059) Co-authored-by: Nicolas Strangmann --- PWGEM/PhotonMeson/Utils/EventHistograms.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGEM/PhotonMeson/Utils/EventHistograms.h b/PWGEM/PhotonMeson/Utils/EventHistograms.h index fd6f6f31f7f..9003bd8c3ff 100644 --- a/PWGEM/PhotonMeson/Utils/EventHistograms.h +++ b/PWGEM/PhotonMeson/Utils/EventHistograms.h @@ -21,7 +21,7 @@ namespace o2::aod::pwgem::photonmeson::utils::eventhistogram void addEventHistograms(HistogramRegistry* fRegistry) { // event info - auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", kTH1F, {{12, 0.5, 12.5}}, false); + auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", kTH1D, {{12, 0.5, 12.5}}, false); hCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); hCollisionCounter->GetXaxis()->SetBinLabel(2, "No TF border"); hCollisionCounter->GetXaxis()->SetBinLabel(3, "No ITS ROF border"); From 6016f707399d99c67cf5074705f9ed7fde10d939 Mon Sep 17 00:00:00 2001 From: Daniel Samitz <69901155+DanielSamitz@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:45:10 +0100 Subject: [PATCH 448/459] [PWGEM] LF Cocktail: add psi(2S) and upsilon (#9042) --- PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx | 36 +++++++++++++------------ 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx b/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx index b06daf77aff..1cac2727e98 100644 --- a/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx +++ b/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx @@ -59,7 +59,9 @@ struct lmeelfcocktail { {113, {"rho/", {-1}}}, {223, {"omega/", {-1, 111}}}, {333, {"phi/", {-1, 111, 221}}}, - {443, {"Jpsi/", {-1}}}}; + {443, {"Jpsi/", {-1}}}, + {100443, {"psi2S/", {-1}}}, + {553, {"Upsilon/", {-1}}}}; std::map histogramId; @@ -320,12 +322,12 @@ struct lmeelfcocktail { addHistogram1D("OpAng", opAng_axis, i); addHistogram1D("Mee", mass_axis, i); addHistogram1D("Ptee", ptee_axis, i); - addHistogram1D_stage("Dca", dca_axis, i, "rec/"); - addHistogram1D_stage("Dcaee", dcaee_axis, i, "rec/"); + // addHistogram1D_stage("Dca", dca_axis, i, "rec/"); + // addHistogram1D_stage("Dcaee", dcaee_axis, i, "rec/"); i = -1; - addHistogram2D_stage("DcaVsPt", dca_axis, pt_axis, i, "rec/"); - addHistogram2D_stage("DcaeeVsPtee", dcaee_axis, ptee_axis, i, "rec/"); - addHistogram2D_stage("DcaeeVsMee", dcaee_axis, mass_axis, i, "rec/"); + // addHistogram2D_stage("DcaVsPt", dca_axis, pt_axis, i, "rec/"); + // addHistogram2D_stage("DcaeeVsPtee", dcaee_axis, ptee_axis, i, "rec/"); + // addHistogram2D_stage("DcaeeVsMee", dcaee_axis, mass_axis, i, "rec/"); i = -1; addHistogramND("MeeVsPteeVsCos2DPhiRP", std::vector{mass_axis, ptee_axis, cos2dphi_axis}, i); } @@ -352,7 +354,7 @@ struct lmeelfcocktail { int nPos = 0; ROOT::Math::PtEtaPhiMVector pEleGen, pPosGen, pEleRec, pPosRec; - float weight(1.), effEle(1.), effPos(1.), dcaEle(0.), dcaPos(0.); + float weight(1.), effEle(1.), effPos(1.); //, dcaEle(0.), dcaPos(0.); for (const auto& daughter : particle.daughters_as()) { int temp_pdg = daughter.pdgCode(); if (temp_pdg == 11) { @@ -362,7 +364,7 @@ struct lmeelfcocktail { pEleRec = temp_p; weight = daughter.weight(); effEle = daughter.efficiency(); - dcaEle = daughter.dca(); + // dcaEle = daughter.dca(); nEle++; continue; } @@ -372,7 +374,7 @@ struct lmeelfcocktail { pPosGen = temp_p_gen; pPosRec = temp_p; effPos = daughter.efficiency(); - dcaPos = daughter.dca(); + // dcaPos = daughter.dca(); nPos++; continue; } @@ -436,12 +438,12 @@ struct lmeelfcocktail { if (s == kRec) { // dca only at rec. level if (acceptedEle) { - fillHistogram1D("Dca", s, pdg, other_daughter_pdg, dcaEle, weightEle); - fillHistogram2D("DcaVsPt", s, pdg, other_daughter_pdg, dcaEle, pEle.Pt(), weightEle); + // fillHistogram1D("Dca", s, pdg, other_daughter_pdg, dcaEle, weightEle); + // fillHistogram2D("DcaVsPt", s, pdg, other_daughter_pdg, dcaEle, pEle.Pt(), weightEle); } if (acceptedPos) { - fillHistogram1D("Dca", s, pdg, other_daughter_pdg, dcaPos, weightPos); - fillHistogram2D("DcaVsPt", s, pdg, other_daughter_pdg, dcaPos, pPos.Pt(), weightPos); + // fillHistogram1D("Dca", s, pdg, other_daughter_pdg, dcaPos, weightPos); + // fillHistogram2D("DcaVsPt", s, pdg, other_daughter_pdg, dcaPos, pPos.Pt(), weightPos); } } @@ -459,7 +461,7 @@ struct lmeelfcocktail { float ptee = p12.Pt(); float opAng = o2::aod::pwgem::dilepton::utils::pairutil::getOpeningAngle(pPos.Px(), pPos.Py(), pPos.Pz(), pEle.Px(), pEle.Py(), pEle.Pz()); float phiV = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(pPos.Px(), pPos.Py(), pPos.Pz(), pEle.Px(), pEle.Py(), pEle.Pz(), 1, -1, 1); - float dcaee = sqrt((pow(dcaEle, 2) + pow(dcaPos, 2)) / 2); + // float dcaee = sqrt((pow(dcaEle, 2) + pow(dcaPos, 2)) / 2); float cos2dphi = std::cos(2.f * p12.Phi()); // PsiRP = 0 rad. double values[3] = {mee, ptee, cos2dphi}; fillHistogramND("MeeVsPteeVsCos2DPhiRP", s, pdg, other_daughter_pdg, values, pairWeight); @@ -468,9 +470,9 @@ struct lmeelfcocktail { fillHistogram1D("PhiV", s, pdg, other_daughter_pdg, phiV, pairWeight); fillHistogram1D("OpAng", s, pdg, other_daughter_pdg, opAng, pairWeight); if (s == kRec) { // dca only at rec. level - fillHistogram1D("Dcaee", s, pdg, other_daughter_pdg, dcaee, pairWeight); - fillHistogram2D("DcaeeVsPtee", s, pdg, other_daughter_pdg, dcaee, ptee, pairWeight); - fillHistogram2D("DcaeeVsMee", s, pdg, other_daughter_pdg, dcaee, mee, pairWeight); + // fillHistogram1D("Dcaee", s, pdg, other_daughter_pdg, dcaee, pairWeight); + // fillHistogram2D("DcaeeVsPtee", s, pdg, other_daughter_pdg, dcaee, ptee, pairWeight); + // fillHistogram2D("DcaeeVsMee", s, pdg, other_daughter_pdg, dcaee, mee, pairWeight); } } } From bf40b9db2eee21fbb1a26522b4b97f06be45e749 Mon Sep 17 00:00:00 2001 From: nzardosh Date: Thu, 19 Dec 2024 15:13:35 +0100 Subject: [PATCH 449/459] [PWGHF] Adding selections on impact parameter of D0 and Pi to B+ selection (#9061) --- PWGHF/Core/HfHelper.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PWGHF/Core/HfHelper.h b/PWGHF/Core/HfHelper.h index 7714fd68165..5ba68530e3f 100644 --- a/PWGHF/Core/HfHelper.h +++ b/PWGHF/Core/HfHelper.h @@ -839,6 +839,16 @@ class HfHelper return false; } + // d0 of pi + if (std::abs(candBp.impactParameter1()) < cuts->get(pTBin, "d0 Pi")) { + return false; + } + + // d0 of D + if (std::abs(candBp.impactParameter0()) < cuts->get(pTBin, "d0 D")) { + return false; + } + return true; } From 42a54f43a0fb737682f50aee1ed0d520445b9a6f Mon Sep 17 00:00:00 2001 From: Stefano Cannito <143754257+scannito@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:46:47 +0100 Subject: [PATCH 450/459] [PWGLF] Changed efficiency computation procedure for associated particle (#9062) --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 317 ++++++++------------- 1 file changed, 117 insertions(+), 200 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index bb12b5260f3..a68206f85e3 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -67,7 +67,6 @@ struct phik0shortanalysis { HistogramRegistry PhieffHist{"PhieffHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry K0SeffHist{"K0SeffHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry PioneffHist{"PioneffHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry yaccHist{"yaccHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry closureMCPhipurHist{"closureMCPhipurHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry closureMCPhiK0SHist{"closureMCPhiK0SHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry closureMCPhiPionHist{"closureMCPhiPionHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -99,7 +98,7 @@ struct phik0shortanalysis { Configurable> binspTK0S{"binspTK0S", {0.0, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0}, "pT bin limits for K0S"}; // Configurables on Phi mass - Configurable nBins{"nBins", 13, "N bins in cfgPhimassaxis"}; + Configurable nBinsmPhi{"nBinsmPhi", 13, "N bins in cfgPhimassaxis"}; Configurable lowmPhi{"lowmPhiMB", 1.0095, "Upper limits on Phi mass for signal extraction"}; Configurable upmPhi{"upmPhiMB", 1.029, "Upper limits on Phi mass for signal extraction"}; @@ -129,10 +128,11 @@ struct phik0shortanalysis { Configurable> binspTPi{"binspTPi", {0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.5, 2.0, 3.0}, "pT bin limits for pions"}; // Configurables for delta y selection - Configurable nBinsy{"nBinsy", 10, "Number of bins in y and deltay axis"}; + Configurable nBinsy{"nBinsy", 80, "Number of bins in y and deltay axis"}; Configurable cfgyAcceptance{"cfgyAcceptance", 0.5f, "Rapidity acceptance"}; Configurable cfgFirstCutonDeltay{"cgfFirstCutonDeltay", 0.5f, "First upper bound on Deltay selection"}; Configurable cfgSecondCutonDeltay{"cgfSecondCutonDeltay", 0.1f, "Second upper bound on Deltay selection"}; + Configurable cfgyAcceptanceSmear{"cfgyAcceptanceSmear", 0.8f, "Rapidity acceptance for smearing matrix study"}; // Configurable for RecMC Configurable cfgiskNoITSROFrameBorder{"cfgiskNoITSROFrameBorder", false, "kNoITSROFrameBorder request on RecMC collisions"}; @@ -184,10 +184,10 @@ struct phik0shortanalysis { // Axes AxisSpec K0SmassAxis = {200, 0.45f, 0.55f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; AxisSpec PhimassAxis = {200, 0.9f, 1.2f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; - AxisSpec sigPhimassAxis = {nBins, lowmPhi, upmPhi, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec sigPhimassAxis = {nBinsmPhi, lowmPhi, upmPhi, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; AxisSpec vertexZAxis = {100, -15.f, 15.f, "vrtx_{Z} [cm]"}; - AxisSpec yAxis = {nBinsy, -cfgyAcceptance, cfgyAcceptance, "#it{y}"}; - AxisSpec deltayAxis = {nBinsy, 0.0f, 1.0f, "|#it{#Deltay}|"}; + AxisSpec yAxis = {nBinsy, -cfgyAcceptanceSmear, cfgyAcceptanceSmear, "#it{y}"}; + AxisSpec deltayAxis = {nBinsy, 0.0f, 1.6f, "|#it{#Deltay}|"}; AxisSpec multAxis = {120, 0.0f, 120.0f, "centFT0M"}; AxisSpec binnedmultAxis{(std::vector)binsMult, "centFT0M"}; AxisSpec ptK0SAxis = {60, 0.0f, 6.0f, "#it{p}_{T} (GeV/#it{c})"}; @@ -348,22 +348,24 @@ struct phik0shortanalysis { PhieffHist.add("h2PhieffPiGenMCFCutAssocReco", "Phi coupled to Pion for GenMC Deltay < FirstCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); PhieffHist.add("h2PhieffPiGenMCSCutAssocReco", "Phi coupled to Pion for GenMC Deltay < SecondCut Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); + // Rapidity smearing matrix for Phi + PhieffHist.add("h3PhiRapiditySmearing", "Rapidity Smearing Matrix for Phi", kTH3F, {binnedmultAxis, yAxis, yAxis}); + // MCK0S invariant mass and GenMC K0S for computing efficiencies K0SeffHist.add("h3K0SeffInvMass", "Invariant mass of K0Short for Efficiency", kTH3F, {binnedmultAxis, binnedptK0SAxis, K0SmassAxis}); K0SeffHist.add("h2K0SGenMC", "K0Short for GenMC", kTH2F, {binnedmultAxis, binnedptK0SAxis}); K0SeffHist.add("h2K0SGenMCAssocReco", "K0Short for GenMC Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptK0SAxis}); + // Rapidity smearing matrix for K0S + K0SeffHist.add("h4K0SRapiditySmearing", "Rapidity Smearing Matrix for K0Short", kTHnSparseF, {binnedmultAxis, binnedptK0SAxis, yAxis, yAxis}); + // MCPion invariant mass and GenMC Pion for computing efficiencies PioneffHist.add("h4PieffInvMass", "Invariant mass of Pion for Efficiency", kTHnSparseF, {binnedmultAxis, binnedptPiAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}}); PioneffHist.add("h2PiGenMC", "Pion for GenMC", kTH2F, {binnedmultAxis, binnedptPiAxis}); PioneffHist.add("h2PiGenMCAssocReco", "Pion for GenMC Associated Reco Collision", kTH2F, {binnedmultAxis, binnedptPiAxis}); - // y acceptance studies - yaccHist.add("hyaccK0SRecMC", "K0S y acceptance in RecMC", kTH3F, {binnedmultAxis, binnedptK0SAxis, yAxis}); - yaccHist.add("hyaccK0SGenMC", "K0S y acceptance in GenMC", kTH3F, {binnedmultAxis, binnedptK0SAxis, yAxis}); - - yaccHist.add("hyaccPiRecMC", "Pion y acceptance in RecMC", kTH3F, {binnedmultAxis, binnedptPiAxis, yAxis}); - yaccHist.add("hyaccPiGenMC", "Pion y acceptance in GenMC", kTH3F, {binnedmultAxis, binnedptPiAxis, yAxis}); + // Rapidity smearing matrix for Pion + PioneffHist.add("h4PiRapiditySmearing", "Rapidity Smearing Matrix for Pion", kTHnSparseF, {binnedmultAxis, binnedptPiAxis, yAxis, yAxis}); } // Event selection and QA filling @@ -867,7 +869,7 @@ struct phik0shortanalysis { PROCESS_SWITCH(phik0shortanalysis, processSEPhiPion, "Process Same Event for Phi-Pion Analysis", false); - void processRecMCPhiQA(SimCollisions::iterator const& collision, FullMCTracks const& fullMCTracks, FullV0s const& V0s, V0DauMCTracks const&, MCCollisions const&, aod::McParticles const&) + void processRecMCPhiQA(SimCollisions::iterator const& collision, FullMCTracks const& fullMCTracks, FullMCV0s const& V0s, V0DauMCTracks const&, MCCollisions const&, aod::McParticles const&) { if (!acceptEventQA(collision, true)) return; @@ -897,6 +899,9 @@ struct phik0shortanalysis { if (!track1.has_mcParticle()) continue; + auto MCtrack1 = track1.mcParticle_as(); + if (MCtrack1.pdgCode() != 321 || !MCtrack1.isPhysicalPrimary()) + continue; // Loop over all negative candidates for (const auto& track2 : negThisColl) { @@ -909,29 +914,28 @@ struct phik0shortanalysis { if (!track2.has_mcParticle()) continue; - - auto MCtrack1 = track1.mcParticle_as(); auto MCtrack2 = track2.mcParticle_as(); - if (MCtrack1.pdgCode() != 321 || MCtrack2.pdgCode() != -321) - continue; - if (!MCtrack1.has_mothers() || !MCtrack2.has_mothers()) - continue; - if (!MCtrack1.isPhysicalPrimary() || !MCtrack2.isPhysicalPrimary()) + if (MCtrack2.pdgCode() != -321 || !MCtrack2.isPhysicalPrimary()) continue; - int pdgParentPhi = 0; + bool isMCMotherPhi = false; + auto MCMotherPhi = MCtrack1.mothers_as()[0]; for (const auto& MotherOfMCtrack1 : MCtrack1.mothers_as()) { for (const auto& MotherOfMCtrack2 : MCtrack2.mothers_as()) { - if (MotherOfMCtrack1 == MotherOfMCtrack2) { - pdgParentPhi = MotherOfMCtrack1.pdgCode(); + if (MotherOfMCtrack1 == MotherOfMCtrack2 && MotherOfMCtrack1.pdgCode() == 333) { + MCMotherPhi = MotherOfMCtrack1; + isMCMotherPhi = true; } } } - if (pdgParentPhi != 333) + if (!isMCMotherPhi) continue; TLorentzVector recPhi = recMother(track1, track2, massKa, massKa); + + PhieffHist.fill(HIST("h3PhiRapiditySmearing"), genmultiplicity, recPhi.Rapidity(), MCMotherPhi.y()); + if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) continue; @@ -946,30 +950,16 @@ struct phik0shortanalysis { // V0 already reconstructed by the builder for (const auto& v0 : V0s) { - const auto& posDaughterTrack = v0.posTrack_as(); - const auto& negDaughterTrack = v0.negTrack_as(); - if (!posDaughterTrack.has_mcParticle() || !negDaughterTrack.has_mcParticle()) + if (!v0.has_mcParticle()) { continue; + } - auto posMCDaughterTrack = posDaughterTrack.mcParticle_as(); - auto negMCDaughterTrack = negDaughterTrack.mcParticle_as(); - if (posMCDaughterTrack.pdgCode() != 211 || negMCDaughterTrack.pdgCode() != -211) - continue; - if (!posMCDaughterTrack.has_mothers() || !negMCDaughterTrack.has_mothers()) + auto v0mcparticle = v0.mcParticle(); + if (v0mcparticle.pdgCode() != 310 || !v0mcparticle.isPhysicalPrimary()) continue; - int pdgParentv0 = 0; - bool isPhysPrim = false; - for (const auto& particleMotherOfNeg : negMCDaughterTrack.mothers_as()) { - for (const auto& particleMotherOfPos : posMCDaughterTrack.mothers_as()) { - if (particleMotherOfNeg == particleMotherOfPos) { - pdgParentv0 = particleMotherOfNeg.pdgCode(); - isPhysPrim = particleMotherOfNeg.isPhysicalPrimary(); - } - } - } - if (pdgParentv0 != 310 || !isPhysPrim) - continue; + const auto& posDaughterTrack = v0.posTrack_as(); + const auto& negDaughterTrack = v0.negTrack_as(); // Cut on V0 dynamic columns if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) @@ -1034,7 +1024,7 @@ struct phik0shortanalysis { PROCESS_SWITCH(phik0shortanalysis, processRecMCPhiQA, "Process for ReCMCQA and Phi in RecMC", false); - void processRecMCPhiK0S(SimCollisions::iterator const& collision, FullMCTracks const&, FullV0s const& V0s, V0DauMCTracks const&, MCCollisions const&, aod::McParticles const&) + void processRecMCPhiK0S(SimCollisions::iterator const& collision, FullMCTracks const&, FullMCV0s const& V0s, V0DauMCTracks const&, MCCollisions const&, aod::McParticles const& mcParticles) { if (!acceptEventQA(collision, false)) return; @@ -1049,109 +1039,66 @@ struct phik0shortanalysis { auto posThisColl = posMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); auto negThisColl = negMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + // Defining McParticles in the collision + auto mcParticlesThisColl = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + // V0 already reconstructed by the builder for (const auto& v0 : V0s) { - const auto& posDaughterTrack = v0.posTrack_as(); - const auto& negDaughterTrack = v0.negTrack_as(); - if (!posDaughterTrack.has_mcParticle() || !negDaughterTrack.has_mcParticle()) + if (!v0.has_mcParticle()) continue; - auto posMCDaughterTrack = posDaughterTrack.mcParticle_as(); - auto negMCDaughterTrack = negDaughterTrack.mcParticle_as(); - if (posMCDaughterTrack.pdgCode() != 211 || negMCDaughterTrack.pdgCode() != -211) - continue; - if (!posMCDaughterTrack.has_mothers() || !negMCDaughterTrack.has_mothers()) + auto v0mcparticle = v0.mcParticle(); + if (v0mcparticle.pdgCode() != 310 || !v0mcparticle.isPhysicalPrimary()) continue; - int pdgParentv0 = 0; - bool isPhysPrim = false; - for (const auto& particleMotherOfNeg : negMCDaughterTrack.mothers_as()) { - for (const auto& particleMotherOfPos : posMCDaughterTrack.mothers_as()) { - if (particleMotherOfNeg == particleMotherOfPos) { - pdgParentv0 = particleMotherOfNeg.pdgCode(); - isPhysPrim = particleMotherOfNeg.isPhysicalPrimary(); - } - } - } - if (pdgParentv0 != 310 || !isPhysPrim) - continue; + const auto& posDaughterTrack = v0.posTrack_as(); + const auto& negDaughterTrack = v0.negTrack_as(); if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; - if (std::abs(v0.yK0Short()) > cfgyAcceptance) + K0SeffHist.fill(HIST("h4K0SRapiditySmearing"), genmultiplicity, v0.pt(), v0.yK0Short(), v0mcparticle.y()); + + if (std::abs(v0mcparticle.y()) > cfgyAcceptance) continue; K0SeffHist.fill(HIST("h3K0SeffInvMass"), genmultiplicity, v0.pt(), v0.mK0Short()); - std::array isCountedPhi{false, false, false}; - - // Phi reconstruction - for (const auto& track1 : posThisColl) { // loop over all selected tracks - if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1)) - continue; // topological and PID selection - - auto track1ID = track1.globalIndex(); + std::array isCountedMCPhi{false, false, false}; - if (!track1.has_mcParticle()) + for (const auto& mcParticle : mcParticles) { + if (mcParticle.pdgCode() != 333) + continue; + auto kDaughters = mcParticle.daughters_as(); + if (kDaughters.size() != 2) + continue; + bool isPosKaon = false, isNegKaon = false; + for (const auto& kDaughter : kDaughters) { + if (kDaughter.pdgCode() == 321) + isPosKaon = true; + if (kDaughter.pdgCode() == -321) + isNegKaon = true; + } + if (!isPosKaon || !isNegKaon) + continue; + if (std::abs(mcParticle.y()) > cfgyAcceptance) continue; - for (const auto& track2 : negThisColl) { - if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2)) - continue; // topological and PID selection - - auto track2ID = track2.globalIndex(); - if (track2ID == track1ID) - continue; // condition to avoid double counting of pair - - if (!track2.has_mcParticle()) - continue; - - auto MCtrack1 = track1.mcParticle_as(); - auto MCtrack2 = track2.mcParticle_as(); - if (MCtrack1.pdgCode() != 321 || MCtrack2.pdgCode() != -321) - continue; - if (!MCtrack1.has_mothers() || !MCtrack2.has_mothers()) - continue; - if (!MCtrack1.isPhysicalPrimary() || !MCtrack2.isPhysicalPrimary()) - continue; - - int pdgParentPhi = 0; - for (const auto& MotherOfMCtrack1 : MCtrack1.mothers_as()) { - for (const auto& MotherOfMCtrack2 : MCtrack2.mothers_as()) { - if (MotherOfMCtrack1 == MotherOfMCtrack2) { - pdgParentPhi = MotherOfMCtrack1.pdgCode(); - } - } - } - - if (pdgParentPhi != 333) - continue; - - TLorentzVector recPhi = recMother(track1, track2, massKa, massKa); - - if (recPhi.M() < lowmPhi || recPhi.M() > upmPhi) - continue; - - if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) - continue; - if (!isCountedPhi.at(0)) { - yaccHist.fill(HIST("hyaccK0SRecMC"), genmultiplicity, v0.pt(), v0.yK0Short()); - MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSEInc"), genmultiplicity, v0.pt(), v0.mK0Short()); - isCountedPhi.at(0) = true; - } - if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgFirstCutonDeltay) - continue; - if (!isCountedPhi.at(1)) { - MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSEFCut"), genmultiplicity, v0.pt(), v0.mK0Short()); - isCountedPhi.at(1) = true; - } - if (std::abs(v0.yK0Short() - recPhi.Rapidity()) > cfgSecondCutonDeltay) - continue; - if (!isCountedPhi.at(2)) { - MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSESCut"), genmultiplicity, v0.pt(), v0.mK0Short()); - isCountedPhi.at(2) = true; - } + if (!isCountedMCPhi.at(0)) { + MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSEInc"), genmultiplicity, v0.pt(), v0.mK0Short()); + isCountedMCPhi.at(0) = true; + } + if (std::abs(v0mcparticle.y() - mcParticle.y()) > cfgFirstCutonDeltay) + continue; + if (!isCountedMCPhi.at(1)) { + MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSEFCut"), genmultiplicity, v0.pt(), v0.mK0Short()); + isCountedMCPhi.at(1) = true; + } + if (std::abs(v0mcparticle.y() - mcParticle.y()) > cfgSecondCutonDeltay) + continue; + if (!isCountedMCPhi.at(2)) { + MCPhiK0SHist.fill(HIST("h3RecMCPhiK0SSESCut"), genmultiplicity, v0.pt(), v0.mK0Short()); + isCountedMCPhi.at(2) = true; } } } @@ -1159,7 +1106,7 @@ struct phik0shortanalysis { PROCESS_SWITCH(phik0shortanalysis, processRecMCPhiK0S, "Process RecMC for Phi-K0S Analysis", false); - void processRecMCPhiPion(SimCollisions::iterator const& collision, FullMCTracks const& fullMCTracks, MCCollisions const&, aod::McParticles const&) + void processRecMCPhiPion(SimCollisions::iterator const& collision, FullMCTracks const& fullMCTracks, MCCollisions const&, aod::McParticles const& mcParticles) { if (!acceptEventQA(collision, false)) return; @@ -1174,6 +1121,9 @@ struct phik0shortanalysis { auto posThisColl = posMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); auto negThisColl = negMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + // Defining McParticles in the collision + auto mcParticlesThisColl = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + // Loop over all primary pion candidates for (const auto& track : fullMCTracks) { @@ -1188,7 +1138,9 @@ struct phik0shortanalysis { if (!selectionPion(track)) continue; - if (std::abs(track.rapidity(massPi)) > cfgyAcceptance) + PioneffHist.fill(HIST("h4PiRapiditySmearing"), genmultiplicity, track.pt(), track.rapidity(massPi), MCtrack.y()); + + if (std::abs(MCtrack.y()) > cfgyAcceptance) continue; float nsigmaTPC = (track.hasTPC() ? track.tpcNSigmaPi() : -999); @@ -1196,74 +1148,41 @@ struct phik0shortanalysis { PioneffHist.fill(HIST("h4PieffInvMass"), genmultiplicity, track.pt(), nsigmaTPC, nsigmaTOF); - std::array isCountedPhi{false, false, false}; - - // Phi reconstruction - for (const auto& track1 : posThisColl) { // loop over all selected tracks - if (!selectionTrackResonance(track1) || !selectionPIDKaonpTdependent(track1)) - continue; // topological and PID selection - - auto track1ID = track1.globalIndex(); + std::array isCountedMCPhi{false, false, false}; - if (!track1.has_mcParticle()) + for (const auto& mcParticle : mcParticles) { + if (mcParticle.pdgCode() != 333) + continue; + auto kDaughters = mcParticle.daughters_as(); + if (kDaughters.size() != 2) + continue; + bool isPosKaon = false, isNegKaon = false; + for (const auto& kDaughter : kDaughters) { + if (kDaughter.pdgCode() == 321) + isPosKaon = true; + if (kDaughter.pdgCode() == -321) + isNegKaon = true; + } + if (!isPosKaon || !isNegKaon) + continue; + if (std::abs(mcParticle.y()) > cfgyAcceptance) continue; - for (const auto& track2 : negThisColl) { - if (!selectionTrackResonance(track2) || !selectionPIDKaonpTdependent(track2)) - continue; // topological and PID selection - - auto track2ID = track2.globalIndex(); - if (track2ID == track1ID) - continue; // condition to avoid double counting of pair - - if (!track2.has_mcParticle()) - continue; - - auto MCtrack1 = track1.mcParticle_as(); - auto MCtrack2 = track2.mcParticle_as(); - if (MCtrack1.pdgCode() != 321 || MCtrack2.pdgCode() != -321) - continue; - if (!MCtrack1.has_mothers() || !MCtrack2.has_mothers()) - continue; - if (!MCtrack1.isPhysicalPrimary() || !MCtrack2.isPhysicalPrimary()) - continue; - - int pdgParentPhi = 0; - for (const auto& MotherOfMCtrack1 : MCtrack1.mothers_as()) { - for (const auto& MotherOfMCtrack2 : MCtrack2.mothers_as()) { - if (MotherOfMCtrack1 == MotherOfMCtrack2) { - pdgParentPhi = MotherOfMCtrack1.pdgCode(); - } - } - } - - if (pdgParentPhi != 333) - continue; - - TLorentzVector recPhi = recMother(track1, track2, massKa, massKa); - - if (recPhi.M() < lowmPhi || recPhi.M() > upmPhi) - continue; - - if (std::abs(recPhi.Rapidity()) > cfgyAcceptance) - continue; - if (!isCountedPhi.at(0)) { - yaccHist.fill(HIST("hyaccPiRecMC"), genmultiplicity, track.pt(), track.rapidity(massPi)); - MCPhiPionHist.fill(HIST("h4RecMCPhiPiSEInc"), genmultiplicity, track.pt(), nsigmaTPC, nsigmaTOF); - isCountedPhi.at(0) = true; - } - if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgFirstCutonDeltay) - continue; - if (!isCountedPhi.at(1)) { - MCPhiPionHist.fill(HIST("h4RecMCPhiPiSEFCut"), genmultiplicity, track.pt(), nsigmaTPC, nsigmaTOF); - isCountedPhi.at(1) = true; - } - if (std::abs(track.rapidity(massPi) - recPhi.Rapidity()) > cfgSecondCutonDeltay) - continue; - if (!isCountedPhi.at(2)) { - MCPhiPionHist.fill(HIST("h4RecMCPhiPiSESCut"), genmultiplicity, track.pt(), nsigmaTPC, nsigmaTOF); - isCountedPhi.at(2) = true; - } + if (!isCountedMCPhi.at(0)) { + MCPhiPionHist.fill(HIST("h4RecMCPhiPiSEInc"), genmultiplicity, track.pt(), nsigmaTPC, nsigmaTOF); + isCountedMCPhi.at(0) = true; + } + if (std::abs(MCtrack.y() - mcParticle.y()) > cfgFirstCutonDeltay) + continue; + if (!isCountedMCPhi.at(1)) { + MCPhiPionHist.fill(HIST("h4RecMCPhiPiSEFCut"), genmultiplicity, track.pt(), nsigmaTPC, nsigmaTOF); + isCountedMCPhi.at(1) = true; + } + if (std::abs(MCtrack.y() - mcParticle.y()) > cfgSecondCutonDeltay) + continue; + if (!isCountedMCPhi.at(2)) { + MCPhiPionHist.fill(HIST("h4RecMCPhiPiSESCut"), genmultiplicity, track.pt(), nsigmaTPC, nsigmaTOF); + isCountedMCPhi.at(2) = true; } } } @@ -1726,7 +1645,6 @@ struct phik0shortanalysis { if (std::abs(mcParticle2.y()) > cfgyAcceptance) continue; if (!isCountedPhi.at(0)) { - yaccHist.fill(HIST("hyaccK0SGenMC"), genmultiplicity, mcParticle1.pt(), mcParticle1.y()); MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCInc"), genmultiplicity, mcParticle1.pt()); if (isAssocColl) MCPhiK0SHist.fill(HIST("h2PhiK0SGenMCIncAssocReco"), genmultiplicity, mcParticle1.pt()); @@ -1805,7 +1723,6 @@ struct phik0shortanalysis { if (std::abs(mcParticle2.y()) > cfgyAcceptance) continue; if (!isCountedPhi.at(0)) { - yaccHist.fill(HIST("hyaccPiGenMC"), genmultiplicity, mcParticle1.pt(), mcParticle1.y()); MCPhiPionHist.fill(HIST("h2PhiPiGenMCInc"), genmultiplicity, mcParticle1.pt()); if (isAssocColl) MCPhiPionHist.fill(HIST("h2PhiPiGenMCIncAssocReco"), genmultiplicity, mcParticle1.pt()); From 2807d24136388773de77e8ec4199147d4d4b83fd Mon Sep 17 00:00:00 2001 From: Noor Koster <82090643+cnkoster@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:23:52 +0100 Subject: [PATCH 451/459] [PWGCF] Added new histograms (#9063) Co-authored-by: ALICE Action Bot --- PWGCF/Flow/Tasks/flowSP.cxx | 262 +++++++++++++++++++++++++++--------- 1 file changed, 197 insertions(+), 65 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index f89d0728364..2de9aab6396 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -70,13 +71,20 @@ struct FlowSP { O2_DEFINE_CONFIGURABLE(cfgMultCut, bool, true, "Use additional evenr cut on mult correlations"); O2_DEFINE_CONFIGURABLE(cfgTVXinTRD, bool, false, "Use kTVXinTRD (reject TRD triggered events)"); O2_DEFINE_CONFIGURABLE(cfgIsVertexITSTPC, bool, true, "Selects collisions with at least one ITS-TPC track"); + O2_DEFINE_CONFIGURABLE(cfgCCDBdir, std::string, "Users/c/ckoster/ZDC/LHC23_zzh_pass4_small/meanQQ", "ccdb dir for average QQ values in 1% centrality bins"); + O2_DEFINE_CONFIGURABLE(cfgLoadAverageQQ, bool, true, "Load average values for QQ (in centrality bins)"); + O2_DEFINE_CONFIGURABLE(cfgHarm, int, 1, "Flow harmonic n for ux and uy: (Cos(n*phi), Sin(n*phi))"); + O2_DEFINE_CONFIGURABLE(cfgLoadSPPlaneRes, bool, false, "Load ZDC spectator plane resolution"); + O2_DEFINE_CONFIGURABLE(cfgCCDBdir_SP, std::string, "Users/c/ckoster/ZDC/LHC23_zzh_pass4_small/SPPlaneRes", "ccdb dir for average event plane resolution in 1% centrality bins"); ConfigurableAxis axisDCAz{"axisDCAz", {200, -.5, .5}, "DCA_{z} (cm)"}; ConfigurableAxis axisDCAxy{"axisDCAxy", {200, -.5, .5}, "DCA_{xy} (cm)"}; ConfigurableAxis axisPhiMod = {"axisPhiMod", {100, 0, constants::math::PI / 9}, "fmod(#varphi,#pi/9)"}; ConfigurableAxis axisPhi = {"axisPhi", {60, 0, constants::math::TwoPI}, "#varphi"}; ConfigurableAxis axisEta = {"axisEta", {64, -1, 1}, "#eta"}; - ConfigurableAxis axisEtaV1 = {"axisEtaV1", {8, -.8, .8}, "#eta"}; + ConfigurableAxis axisEtaVn = {"axisEtaVn", {8, -.8, .8}, "#eta"}; + ConfigurableAxis axisVx = {"axisVx", {40, -0.01, 0.01}, "v_{x}"}; + ConfigurableAxis axisVy = {"axisVy", {40, -0.01, 0.01}, "v_{y}"}; ConfigurableAxis axisVz = {"axisVz", {40, -10, 10}, "v_{z}"}; ConfigurableAxis axisCent = {"axisCent", {90, 0, 90}, "Centrality(%)"}; ConfigurableAxis axisPhiPlane = {"axisPhiPlane", {100, -constants::math::PI, constants::math::PI}, "#Psi"}; @@ -124,7 +132,7 @@ struct FlowSP { registry.add("hSinPhiASinPhiC", "hSinPhiASinPhiC; Centrality(%); #LT Sin(#Psi^{A})Sin(#Psi^{C})#GT", kTProfile, {axisCent}); registry.add("hSinPhiACosPhiC", "hSinPhiACosPhiC; Centrality(%); #LT Sin(#Psi^{A})Cos(#Psi^{C})#GT", kTProfile, {axisCent}); registry.add("hCosPhiASinsPhiC", "hCosPhiASinsPhiC; Centrality(%); #LT Cos(#Psi^{A})Sin(#Psi^{C})#GT", kTProfile, {axisCent}); - registry.add("hFullEvPlaneRes", "hFullEvPlaneRes; Centrality(%); #sqrt{2#LT Cos(#Psi^{A} - #Psi^{C})#GT} ", kTProfile, {axisCent}); + registry.add("hFullEvPlaneRes", "hFullEvPlaneRes; Centrality(%); -#LT Cos(#Psi^{A} - #Psi^{C})#GT ", kTProfile, {axisCent}); registry.add("QA/after/hCent", "", {HistType::kTH1D, {axisCent}}); registry.add("QA/after/globalTracks_centT0C", "", {HistType::kTH2D, {axisCent, nchAxis}}); @@ -134,6 +142,23 @@ struct FlowSP { registry.add("QA/after/globalTracks_multV0A", "", {HistType::kTH2D, {t0aAxis, nchAxis}}); registry.add("QA/after/multV0A_multT0A", "", {HistType::kTH2D, {t0aAxis, t0aAxis}}); registry.add("QA/after/multT0C_centT0C", "", {HistType::kTH2D, {axisCent, t0cAxis}}); + + registry.add("QA/after/PsiA_vs_Cent", "", {HistType::kTH2D, {axisPhiPlane, axisCent}}); + registry.add("QA/after/PsiC_vs_Cent", "", {HistType::kTH2D, {axisPhiPlane, axisCent}}); + registry.add("QA/after/PsiFull_vs_Cent", "", {HistType::kTH2D, {axisPhiPlane, axisCent}}); + + registry.add("QA/after/PsiA_vs_Vx", "", {HistType::kTH2D, {axisPhiPlane, axisVx}}); + registry.add("QA/after/PsiC_vs_Vx", "", {HistType::kTH2D, {axisPhiPlane, axisVx}}); + registry.add("QA/after/PsiFull_vs_Vx", "", {HistType::kTH2D, {axisPhiPlane, axisVx}}); + + registry.add("QA/after/PsiA_vs_Vy", "", {HistType::kTH2D, {axisPhiPlane, axisVy}}); + registry.add("QA/after/PsiC_vs_Vy", "", {HistType::kTH2D, {axisPhiPlane, axisVy}}); + registry.add("QA/after/PsiFull_vs_Vy", "", {HistType::kTH2D, {axisPhiPlane, axisVy}}); + + registry.add("QA/after/PsiA_vs_Vz", "", {HistType::kTH2D, {axisPhiPlane, axisVz}}); + registry.add("QA/after/PsiC_vs_Vz", "", {HistType::kTH2D, {axisPhiPlane, axisVz}}); + registry.add("QA/after/PsiFull_vs_Vz", "", {HistType::kTH2D, {axisPhiPlane, axisVz}}); + registry.addClone("QA/after/", "QA/before/"); registry.add("QA/after/pt_phi_bef", "", {HistType::kTH2D, {axisPt, axisPhiMod}}); @@ -143,29 +168,38 @@ struct FlowSP { registry.add("QA/after/hDCAz", "", {HistType::kTH1D, {axisDCAz}}); // track properties per centrality and per eta, pt bin - registry.add("uxqxA_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("uyqyA_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("uxqxC_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("uyqyC_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("v1A_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("v1C_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("v1Full_eta_pt", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - - registry.add("uxqxA_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("uyqyA_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("uxqxC_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("uyqyC_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("v1A_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("v1C_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("v1Full_eta_pt_pos", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - - registry.add("uxqxA_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("uyqyA_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("uxqxC_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("uyqyC_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("v1A_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("v1C_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); - registry.add("v1Full_eta_pt_neg", "", kTProfile3D, {axisEtaV1, axisPt, axisCent}); + registry.add("incl/vnAx_eta", "", kTProfile, {axisEtaVn}); + registry.add("incl/vnAy_eta", "", kTProfile, {axisEtaVn}); + registry.add("incl/vnCx_eta", "", kTProfile, {axisEtaVn}); + registry.add("incl/vnCy_eta", "", kTProfile, {axisEtaVn}); + registry.add("incl/vnC_eta", "", kTProfile, {axisEtaVn}); + registry.add("incl/vnA_eta", "", kTProfile, {axisEtaVn}); + registry.add("incl/vnA_eta_EP", "", kTProfile, {axisEtaVn}); + registry.add("incl/vnC_eta_EP", "", kTProfile, {axisEtaVn}); + registry.add("incl/vnFull_eta_EP", "", kTProfile, {axisEtaVn}); + + registry.add("incl/vnAx_pt", "", kTProfile, {axisPt}); + registry.add("incl/vnAy_pt", "", kTProfile, {axisPt}); + registry.add("incl/vnCx_pt", "", kTProfile, {axisPt}); + registry.add("incl/vnCy_pt", "", kTProfile, {axisPt}); + registry.add("incl/vnC_pt", "", kTProfile, {axisPt}); + registry.add("incl/vnA_pt", "", kTProfile, {axisPt}); + registry.add("incl/vnA_pt_EP", "", kTProfile, {axisPt}); + registry.add("incl/vnC_pt_EP", "", kTProfile, {axisPt}); + registry.add("incl/vnFull_pt_EP", "", kTProfile, {axisPt}); + + registry.add("incl/vnAx_cent", "", kTProfile, {axisCent}); + registry.add("incl/vnAy_cent", "", kTProfile, {axisCent}); + registry.add("incl/vnCx_cent", "", kTProfile, {axisCent}); + registry.add("incl/vnCy_cent", "", kTProfile, {axisCent}); + registry.add("incl/vnC_cent", "", kTProfile, {axisCent}); + registry.add("incl/vnA_cent", "", kTProfile, {axisCent}); + registry.add("incl/vnA_cent_EP", "", kTProfile, {axisCent}); + registry.add("incl/vnC_cent_EP", "", kTProfile, {axisCent}); + registry.add("incl/vnFull_cent_EP", "", kTProfile, {axisCent}); + + registry.addClone("incl/", "pos/"); + registry.addClone("incl/", "neg/"); registry.add("qAqCX", "", kTProfile, {axisCent}); registry.add("qAqCY", "", kTProfile, {axisCent}); @@ -337,6 +371,23 @@ struct FlowSP { registry.fill(HIST("QA/after/globalTracks_multV0A"), collision.multFV0A(), tracks.size()); registry.fill(HIST("QA/after/multV0A_multT0A"), collision.multFT0A(), collision.multFV0A()); registry.fill(HIST("QA/after/multT0C_centT0C"), collision.centFT0C(), collision.multFT0C()); + + double psiA = 1.0 * std::atan2(collision.qyA(), collision.qxA()); + double psiC = 1.0 * std::atan2(collision.qyC(), collision.qxC()); + double psiFull = 1.0 * std::atan2(collision.qyA() + collision.qyC(), collision.qxA() + collision.qxC()); + + registry.fill(HIST("QA/after/PsiA_vs_Cent"), psiA, collision.centFT0C()); + registry.fill(HIST("QA/after/PsiC_vs_Cent"), psiC, collision.centFT0C()); + registry.fill(HIST("QA/after/PsiFull_vs_Cent"), psiFull, collision.centFT0C()); + registry.fill(HIST("QA/after/PsiA_vs_Vx"), psiA, collision.vx()); + registry.fill(HIST("QA/after/PsiC_vs_Vx"), psiC, collision.vx()); + registry.fill(HIST("QA/after/PsiFull_vs_Vx"), psiFull, collision.vx()); + registry.fill(HIST("QA/after/PsiA_vs_Vy"), psiA, collision.vy()); + registry.fill(HIST("QA/after/PsiC_vs_Vy"), psiC, collision.vy()); + registry.fill(HIST("QA/after/PsiFull_vs_Vy"), psiFull, collision.vy()); + registry.fill(HIST("QA/after/PsiA_vs_Vz"), psiA, collision.posZ()); + registry.fill(HIST("QA/after/PsiC_vs_Vz"), psiC, collision.posZ()); + registry.fill(HIST("QA/after/PsiFull_vs_Vz"), psiFull, collision.posZ()); } return; } @@ -364,8 +415,6 @@ struct FlowSP { registry.fill(HIST("hEventCount"), 10.5); - fillEventQA(collision, tracks, false); - double qxA = collision.qxA(); double qyA = collision.qyA(); double qxC = collision.qxC(); @@ -377,22 +426,38 @@ struct FlowSP { double psiC = 1.0 * std::atan2(qyC, qxC); registry.fill(HIST("hSPplaneC"), psiC, 1); - // https://twiki.cern.ch/twiki/pub/ALICE/DirectedFlowAnalysisNote/v1_ZDC_ALICE_INT_NOTE_version02.pdf + // https://twiki.cern.ch/twiki/pub/ALICE/DirectedFlowAnalysisNote/vn_ZDC_ALICE_INT_NOTE_version02.pdf double psiFull = 1.0 * std::atan2(qyA + qyC, qxA + qxC); registry.fill(HIST("hSPplaneFull"), psiFull, 1); + fillEventQA(collision, tracks, false); + registry.fill(HIST("hCosPhiACosPhiC"), centrality, std::cos(psiA) * std::cos(psiC)); registry.fill(HIST("hSinPhiASinPhiC"), centrality, std::sin(psiA) * std::sin(psiC)); registry.fill(HIST("hSinPhiACosPhiC"), centrality, std::sin(psiA) * std::cos(psiC)); registry.fill(HIST("hCosPhiASinsPhiC"), centrality, std::cos(psiA) * std::sin(psiC)); - if (std::cos(psiA) - std::cos(psiC) < 0) - registry.fill(HIST("hFullEvPlaneRes"), centrality, std::sqrt(-2. * (std::cos(psiA) - std::cos(psiC)))); + registry.fill(HIST("hFullEvPlaneRes"), centrality, -1 * std::cos(psiA - psiC)); registry.fill(HIST("qAqCXY"), centrality, qxA * qxC + qyA * qyC); registry.fill(HIST("qAqCX"), centrality, qxA * qxC); registry.fill(HIST("qAqCY"), centrality, qyA * qyC); + double corrQQ = 1.; + if (cfgLoadAverageQQ) { + TProfile* hcorrQQ = ccdb->getForTimeStamp(cfgCCDBdir.value, bc.timestamp()); + corrQQ = hcorrQQ->GetBinContent(hcorrQQ->FindBin(centrality)); + } + + double evPlaneRes = 1.; + if (cfgLoadSPPlaneRes) { + TProfile* hEvPlaneRes = ccdb->getForTimeStamp(cfgCCDBdir_SP.value, bc.timestamp()); + evPlaneRes = hEvPlaneRes->GetBinContent(hEvPlaneRes->FindBin(centrality)); + if (evPlaneRes < 0) + LOGF(fatal, " > 0 for centrality %.2f! Cannot determine resolution.. Change centrality ranges!!!", centrality); + evPlaneRes = std::sqrt(evPlaneRes); + } + for (const auto& track : tracks) { if (!trackSelected(track, field)) continue; @@ -405,46 +470,113 @@ struct FlowSP { auto phi = RecoDecay::constrainAngle(track.phi(), 0); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - auto ux = std::cos(phi); - auto uy = std::sin(phi); + auto ux = std::cos(cfgHarm * phi); + auto uy = std::sin(cfgHarm * phi); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - double uxqxA = ux * qxA; - double uyqyA = uy * qyA; - - registry.fill(HIST("uxqxA_eta_pt"), track.eta(), track.pt(), centrality, uxqxA); - registry.fill(HIST("uyqyA_eta_pt"), track.eta(), track.pt(), centrality, uyqyA); - - double uxqxC = ux * qxC; - double uyqyC = uy * qyC; - - registry.fill(HIST("uxqxC_eta_pt"), track.eta(), track.pt(), centrality, uxqxC); - registry.fill(HIST("uyqyC_eta_pt"), track.eta(), track.pt(), centrality, uyqyC); - - double v1A = std::cos(phi - psiA); - double v1C = std::cos(phi - psiC); - double v1Full = std::cos(phi - psiFull); - - registry.fill(HIST("v1A_eta_pt"), track.eta(), track.pt(), centrality, v1A); - registry.fill(HIST("v1C_eta_pt"), track.eta(), track.pt(), centrality, v1C); - registry.fill(HIST("v1Full_eta_pt"), track.eta(), track.pt(), centrality, v1Full); + registry.fill(HIST("incl/vnAx_eta"), track.eta(), (ux * qxA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnAy_eta"), track.eta(), (uy * qyA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnCx_eta"), track.eta(), (ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnCy_eta"), track.eta(), (uy * qyC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnA_eta"), track.eta(), (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnC_eta"), track.eta(), (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + + registry.fill(HIST("incl/vnAx_pt"), track.pt(), (ux * qxA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnAy_pt"), track.pt(), (uy * qyA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnCx_pt"), track.pt(), (ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnCy_pt"), track.pt(), (uy * qyC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnA_pt"), track.pt(), (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnC_pt"), track.pt(), (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + + registry.fill(HIST("incl/vnAx_cent"), centrality, (ux * qxA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnAy_cent"), centrality, (uy * qyA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnCx_cent"), centrality, (ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnCy_cent"), centrality, (uy * qyC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnA_cent"), centrality, (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("incl/vnC_cent"), centrality, (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + + double vnA = std::cos(cfgHarm * (phi - psiA)) / evPlaneRes; + double vnC = std::cos(cfgHarm * (phi - psiC)) / evPlaneRes; + double vnFull = std::cos(cfgHarm * (phi - psiFull)) / evPlaneRes; + + registry.fill(HIST("incl/vnA_eta_EP"), track.eta(), vnA); + registry.fill(HIST("incl/vnC_eta_EP"), track.eta(), vnC); + registry.fill(HIST("incl/vnFull_eta_EP"), track.eta(), vnFull); + + registry.fill(HIST("incl/vnA_pt_EP"), track.pt(), vnA); + registry.fill(HIST("incl/vnC_pt_EP"), track.pt(), vnC); + registry.fill(HIST("incl/vnFull_pt_EP"), track.pt(), vnFull); + + registry.fill(HIST("incl/vnA_cent_EP"), centrality, vnA); + registry.fill(HIST("incl/vnC_cent_EP"), centrality, vnC); + registry.fill(HIST("incl/vnFull_cent_EP"), centrality, vnFull); if (pos) { - registry.fill(HIST("uxqxA_eta_pt_pos"), track.eta(), track.pt(), centrality, uxqxA); - registry.fill(HIST("uyqyA_eta_pt_pos"), track.eta(), track.pt(), centrality, uyqyA); - registry.fill(HIST("uxqxC_eta_pt_pos"), track.eta(), track.pt(), centrality, uxqxC); - registry.fill(HIST("uyqyC_eta_pt_pos"), track.eta(), track.pt(), centrality, uyqyC); - registry.fill(HIST("v1A_eta_pt_pos"), track.eta(), track.pt(), centrality, v1A); - registry.fill(HIST("v1C_eta_pt_pos"), track.eta(), track.pt(), centrality, v1C); - registry.fill(HIST("v1Full_eta_pt_pos"), track.eta(), track.pt(), centrality, v1Full); + registry.fill(HIST("pos/vnAx_eta"), track.eta(), (ux * qxA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnAy_eta"), track.eta(), (uy * qyA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnCx_eta"), track.eta(), (ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnCy_eta"), track.eta(), (uy * qyC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnA_eta"), track.eta(), (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnC_eta"), track.eta(), (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + + registry.fill(HIST("pos/vnAx_pt"), track.pt(), (ux * qxA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnAy_pt"), track.pt(), (uy * qyA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnCx_pt"), track.pt(), (ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnCy_pt"), track.pt(), (uy * qyC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnA_pt"), track.pt(), (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnC_pt"), track.pt(), (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + + registry.fill(HIST("pos/vnAx_cent"), centrality, (ux * qxA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnAy_cent"), centrality, (uy * qyA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnCx_cent"), centrality, (ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnCy_cent"), centrality, (uy * qyC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnA_cent"), centrality, (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("pos/vnC_cent"), centrality, (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + + registry.fill(HIST("pos/vnA_eta_EP"), track.eta(), vnA); + registry.fill(HIST("pos/vnC_eta_EP"), track.eta(), vnC); + registry.fill(HIST("pos/vnFull_eta_EP"), track.eta(), vnFull); + + registry.fill(HIST("pos/vnA_pt_EP"), track.pt(), vnA); + registry.fill(HIST("pos/vnC_pt_EP"), track.pt(), vnC); + registry.fill(HIST("pos/vnFull_pt_EP"), track.pt(), vnFull); + + registry.fill(HIST("pos/vnA_cent_EP"), centrality, vnA); + registry.fill(HIST("pos/vnC_cent_EP"), centrality, vnC); + registry.fill(HIST("pos/vnFull_cent_EP"), centrality, vnFull); + } else { - registry.fill(HIST("uxqxA_eta_pt_neg"), track.eta(), track.pt(), centrality, uxqxA); - registry.fill(HIST("uyqyA_eta_pt_neg"), track.eta(), track.pt(), centrality, uyqyA); - registry.fill(HIST("uxqxC_eta_pt_neg"), track.eta(), track.pt(), centrality, uxqxC); - registry.fill(HIST("uyqyC_eta_pt_neg"), track.eta(), track.pt(), centrality, uyqyC); - registry.fill(HIST("v1A_eta_pt_neg"), track.eta(), track.pt(), centrality, v1A); - registry.fill(HIST("v1C_eta_pt_neg"), track.eta(), track.pt(), centrality, v1C); - registry.fill(HIST("v1Full_eta_pt_neg"), track.eta(), track.pt(), centrality, v1Full); + registry.fill(HIST("neg/vnAx_eta"), track.eta(), (ux * qxA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnAy_eta"), track.eta(), (uy * qyA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnCx_eta"), track.eta(), (ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnCy_eta"), track.eta(), (uy * qyC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnA_eta"), track.eta(), (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnC_eta"), track.eta(), (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + + registry.fill(HIST("neg/vnAx_pt"), track.pt(), (ux * qxA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnAy_pt"), track.pt(), (uy * qyA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnCx_pt"), track.pt(), (ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnCy_pt"), track.pt(), (uy * qyC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnA_pt"), track.pt(), (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnC_pt"), track.pt(), (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnAx_cent"), centrality, (ux * qxA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnAy_cent"), centrality, (uy * qyA) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnCx_cent"), centrality, (ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnCy_cent"), centrality, (uy * qyC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnA_cent"), centrality, (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + registry.fill(HIST("neg/vnC_cent"), centrality, (uy * qyC + ux * qxC) / std::sqrt(std::fabs(corrQQ))); + + registry.fill(HIST("neg/vnA_eta_EP"), track.eta(), vnA); + registry.fill(HIST("neg/vnC_eta_EP"), track.eta(), vnC); + registry.fill(HIST("neg/vnFull_eta_EP"), track.eta(), vnFull); + + registry.fill(HIST("neg/vnA_pt_EP"), track.pt(), vnA); + registry.fill(HIST("neg/vnC_pt_EP"), track.pt(), vnC); + registry.fill(HIST("neg/vnFull_pt_EP"), track.pt(), vnFull); + + registry.fill(HIST("neg/vnA_cent_EP"), centrality, vnA); + registry.fill(HIST("neg/vnC_cent_EP"), centrality, vnC); + registry.fill(HIST("neg/vnFull_cent_EP"), centrality, vnFull); } // QA plots registry.fill(HIST("QA/after/hPhi_Eta_vz"), track.phi(), track.eta(), collision.posZ()); From 6a8c48ec290ecdcdf36f97ecbba7e078cc64bd4d Mon Sep 17 00:00:00 2001 From: skundu692 <86804743+skundu692@users.noreply.github.com> Date: Thu, 19 Dec 2024 17:45:23 +0100 Subject: [PATCH 452/459] [PWGLF] Add thnsparse in the output of f1p correlation (#9066) --- .../Tasks/Resonances/f1protoncorrelation.cxx | 78 ++++++++++++++++--- 1 file changed, 67 insertions(+), 11 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx index 66344a45442..8d2f04c7ee2 100644 --- a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx +++ b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx @@ -26,6 +26,9 @@ #include "Framework/AnalysisTask.h" #include "Framework/ASoAHelpers.h" #include "Framework/runDataProcessing.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/StepTHn.h" +#include "Common/Core/trackUtilities.h" #include "PWGLF/DataModel/ReducedF1ProtonTables.h" #include "CommonConstants/PhysicsConstants.h" @@ -39,7 +42,9 @@ struct f1protoncorrelation { // PID selection Configurable nsigmaCutTPC{"nsigmacutTPC", 3.0, "Value of the TPC Nsigma cut"}; Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Value of the TOF Nsigma cut"}; + Configurable typeofCombined{"typeofCombined", 1, "type of combined"}; // PID selection + Configurable fillSparse{"fillSparse", 1, "Fill Sparse"}; Configurable fillRotation{"fillRotation", 1, "Fill rotation"}; Configurable pdepPID{"pdepPID", 1, "Momentum dependent pi, k PID"}; Configurable strategyPIDPion{"strategyPIDPion", 0, "PID strategy Pion"}; @@ -52,11 +57,19 @@ struct f1protoncorrelation { Configurable momentumTOFPionMax{"momentumTOFPionMax", 1.2, "Pion momentum TOF Max"}; Configurable momentumTOFKaonMax{"momentumTOFKaonMax", 1.2, "Kaon momentum TOF Max"}; Configurable momentumTOFProton{"momentumTOFProton", 0.7, "Proton momentum TOF"}; + Configurable momentumProtonMax{"momentumProtonMax", 3.0, "Maximum proton momentum"}; Configurable lowPtF1{"lowPtF1", 1.0, "PT cut F1"}; // Event Mixing - Configurable nEvtMixing{"nEvtMixing", 1, "Number of events to mix"}; + Configurable nEvtMixing{"nEvtMixing", 10, "Number of events to mix"}; ConfigurableAxis CfgVtxBins{"CfgVtxBins", {10, -10, 10}, "Mixing bins - z-vertex"}; - ConfigurableAxis CfgMultBins{"CfgMultBins", {VARIABLE_WIDTH, 0.0, 30.0, 40.0, 50.0, 60.0, 80.0, 200.0}, "Mixing bins - number of contributor"}; + ConfigurableAxis CfgMultBins{"CfgMultBins", {VARIABLE_WIDTH, 0.0, 20.0, 40.0, 60.0, 80.0, 500.0}, "Mixing bins - number of contributor"}; + + // THnsparse bining + ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {100, 1.0, 1.4}, "#it{M} (GeV/#it{c}^{2})"}; + ConfigurableAxis configThnAxisPt{"configThnAxisPt", {100, 0.0, 10.}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis configThnAxisKstar{"configThnAxisKstar", {100, 0.0, 1.0}, "#it{k}^{*} (GeV/#it{c})"}; + ConfigurableAxis configThnAxisPtProton{"configThnAxisPtProton", {20, 0.0, 4.}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis configThnAxisNsigma{"configThnAxisNsigma", {90, -9.0, 9.0}, "NsigmaCombined"}; // Initialize the ananlysis task void init(o2::framework::InitContext&) @@ -75,6 +88,21 @@ struct f1protoncorrelation { histos.add("h2MixEventInvariantMassUnlike_mass", "Unlike Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); histos.add("h2MixEventInvariantMassLike_mass", "Like Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); histos.add("h2MixEventInvariantMassRot_mass", "Rotational Sign Invariant mass of f1 mix event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); + + const AxisSpec thnAxisInvMass{configThnAxisInvMass, "#it{M} (GeV/#it{c}^{2})"}; + const AxisSpec thnAxisPt{configThnAxisPt, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec thnAxisPtProton{configThnAxisPtProton, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec thnAxisKstar{configThnAxisKstar, "#it{k}^{*} (GeV/#it{c})"}; + const AxisSpec thnAxisNsigma{configThnAxisNsigma, "NsigmaCombined"}; + if (fillSparse) { + histos.add("SEMassUnlike", "SEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisPtProton, thnAxisKstar, thnAxisNsigma}); + histos.add("SEMassLike", "SEMassLike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisPtProton, thnAxisKstar, thnAxisNsigma}); + histos.add("SEMassRot", "SEMassRot", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisPtProton, thnAxisKstar, thnAxisNsigma}); + + histos.add("MEMassUnlike", "MEMassUnlike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisPtProton, thnAxisKstar, thnAxisNsigma}); + histos.add("MEMassLike", "MEMassLike", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisPtProton, thnAxisKstar, thnAxisNsigma}); + histos.add("MEMassRot", "MEMassRot", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisPtProton, thnAxisKstar, thnAxisNsigma}); + } } // get kstar @@ -99,7 +127,7 @@ struct f1protoncorrelation { trackRelK = PartOneCMS - PartTwoCMS; return 0.5 * trackRelK.P(); } - + float combinedTPC; TLorentzVector F1, Proton, F1ProtonPair, Pion, Kaon, Kshort; TLorentzVector F1Rot, PionRot, KaonKshortPair, KaonKshortPairRot; // Process the data in same event @@ -146,8 +174,17 @@ struct f1protoncorrelation { histos.fill(HIST("hNsigmaKaonTPC"), f1track.f1d2TPC(), Kaon.Pt()); histos.fill(HIST("hNsigmaPionTPC"), f1track.f1d1TPC(), Pion.Pt()); histos.fill(HIST("hNsigmaPionKaonTPC"), f1track.f1d1TPC(), f1track.f1d2TPC()); + if (typeofCombined == 0) { + combinedTPC = TMath::Sqrt(f1track.f1d1TPC() * f1track.f1d1TPC() + f1track.f1d2TPC() * f1track.f1d2TPC()); + } + if (typeofCombined == 1) { + combinedTPC = (f1track.f1d1TPC() - f1track.f1d2TPC()) / (f1track.f1d1TPC() + f1track.f1d2TPC()); + } for (auto protontrack : protontracks) { Proton.SetXYZM(protontrack.protonPx(), protontrack.protonPy(), protontrack.protonPz(), 0.938); + if (Proton.Pt() > momentumProtonMax) { + continue; + } if (Proton.P() < momentumTOFProton && TMath::Abs(protontrack.protonNsigmaTPC()) > 2.5) { continue; } @@ -164,9 +201,15 @@ struct f1protoncorrelation { histos.fill(HIST("h2SameEventPtCorrelation"), relative_momentum, F1.Pt(), Proton.Pt()); if (f1track.f1SignalStat() == 1) { histos.fill(HIST("h2SameEventInvariantMassUnlike_mass"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like + if (fillSparse) { + histos.fill(HIST("SEMassUnlike"), F1.M(), F1.Pt(), Proton.Pt(), relative_momentum, combinedTPC); + } } if (f1track.f1SignalStat() == -1) { histos.fill(HIST("h2SameEventInvariantMassLike_mass"), relative_momentum, F1.Pt(), F1.M()); + if (fillSparse) { + histos.fill(HIST("SEMassLike"), F1.M(), F1.Pt(), Proton.Pt(), relative_momentum, combinedTPC); + } } if (fillRotation) { for (int nrotbkg = 0; nrotbkg < 9; nrotbkg++) { @@ -181,6 +224,9 @@ struct f1protoncorrelation { auto relative_momentum_rot = getkstar(F1Rot, Proton); if (f1track.f1SignalStat() == 1) { histos.fill(HIST("h2SameEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M()); + if (fillSparse) { + histos.fill(HIST("SEMassRot"), F1Rot.M(), F1Rot.Pt(), Proton.Pt(), relative_momentum_rot, combinedTPC); + } } } } @@ -189,12 +235,6 @@ struct f1protoncorrelation { } // Processing Event Mixing - // using BinningTypeVtxZT0M = ColumnBinningPolicy; - // for (auto& [collision1, tracks1, collision2, tracks2] : pairs) { - // Pair pairs{colBinning, nEvtMixing, -1, &cache}; // -1 is the number of the bin to skip - // - // tracks1 is an aod::Tracks table of f1tracks belonging to collision collision1 (aod::Collision::iterator) - // tracks2 is an aod::Tracks table of protontracks belonging to collision collision2 (aod::Collision::iterator) SliceCache cache; using BinningType = ColumnBinningPolicy; BinningType colBinning{{CfgVtxBins, CfgMultBins}, true}; @@ -214,9 +254,7 @@ struct f1protoncorrelation { auto groupProton = protontracks.sliceBy(tracksPerCollisionPresliceP, collision2.globalIndex()); // auto groupF1 = f1tracks.sliceByCached(aod::f1protondaughter::redF1PEventId, collision1.globalIndex(), cache); // auto groupProton = protontracks.sliceByCached(aod::f1protondaughter::redF1PEventId, collision2.globalIndex(), cache); - // for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(f1tracks, protontracks))) { for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(groupF1, groupProton))) { - // LOGF(info, "Mixed event collision1 track1: (%d, %d)", collision1.index(), t1.index()); if (t1.f1MassKaonKshort() > maxKKS0Mass) { continue; } @@ -254,7 +292,16 @@ struct f1protoncorrelation { if (strategyPIDKaon == 1 && Kaon.Pt() > momentumTOFKaonMin && Kaon.Pt() <= momentumTOFKaonMax && t1.f1d2TOFHit() != 1) { continue; } + if (typeofCombined == 0) { + combinedTPC = TMath::Sqrt(t1.f1d1TPC() * t1.f1d1TPC() + t1.f1d2TPC() * t1.f1d2TPC()); + } + if (typeofCombined == 1) { + combinedTPC = (t1.f1d1TPC() - t1.f1d2TPC()) / (t1.f1d1TPC() + t1.f1d2TPC()); + } Proton.SetXYZM(t2.protonPx(), t2.protonPy(), t2.protonPz(), 0.938); + if (Proton.Pt() > momentumProtonMax) { + continue; + } if (Proton.P() < momentumTOFProton && TMath::Abs(t2.protonNsigmaTPC()) > 2.5) { continue; } @@ -264,9 +311,15 @@ struct f1protoncorrelation { auto relative_momentum = getkstar(F1, Proton); if (t1.f1SignalStat() == 1) { histos.fill(HIST("h2MixEventInvariantMassUnlike_mass"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like + if (fillSparse) { + histos.fill(HIST("MEMassUnlike"), F1.M(), F1.Pt(), Proton.Pt(), relative_momentum, combinedTPC); + } } if (t1.f1SignalStat() == -1) { histos.fill(HIST("h2MixEventInvariantMassLike_mass"), relative_momentum, F1.Pt(), F1.M()); + if (fillSparse) { + histos.fill(HIST("MEMassLike"), F1.M(), F1.Pt(), Proton.Pt(), relative_momentum, combinedTPC); + } } if (fillRotation) { for (int nrotbkg = 0; nrotbkg < 9; nrotbkg++) { @@ -281,6 +334,9 @@ struct f1protoncorrelation { auto relative_momentum_rot = getkstar(F1Rot, Proton); if (t1.f1SignalStat() == 1) { histos.fill(HIST("h2MixEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M()); + if (fillSparse) { + histos.fill(HIST("MEMassRot"), F1Rot.M(), F1Rot.Pt(), Proton.Pt(), relative_momentum_rot, combinedTPC); + } } } } From ab9839ae7ac03075bfa74eed35d314f55f986e6e Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Thu, 19 Dec 2024 18:22:14 +0100 Subject: [PATCH 453/459] [PWGCF] DptDpt -- Implementing linter recommendations (#9067) Co-authored-by: Victor --- PWGCF/Tasks/CMakeLists.txt | 6 +- ...{dptdptfilterqa.cxx => dptDptFilterQa.cxx} | 75 +++++----- .../{match-reco-gen.cxx => matchRecoGen.cxx} | 130 +++++++++--------- 3 files changed, 108 insertions(+), 103 deletions(-) rename PWGCF/Tasks/{dptdptfilterqa.cxx => dptDptFilterQa.cxx} (69%) rename PWGCF/Tasks/{match-reco-gen.cxx => matchRecoGen.cxx} (80%) diff --git a/PWGCF/Tasks/CMakeLists.txt b/PWGCF/Tasks/CMakeLists.txt index fdc35cf2ef6..233cb351d13 100644 --- a/PWGCF/Tasks/CMakeLists.txt +++ b/PWGCF/Tasks/CMakeLists.txt @@ -14,13 +14,13 @@ o2physics_add_dpl_workflow(dptdptcorrelations PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(dptdpt-filter-qa - SOURCES dptdptfilterqa.cxx +o2physics_add_dpl_workflow(dpt-dpt-filter-qa + SOURCES dptDptFilterQa.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(match-reco-gen - SOURCES match-reco-gen.cxx + SOURCES matchRecoGen.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) diff --git a/PWGCF/Tasks/dptdptfilterqa.cxx b/PWGCF/Tasks/dptDptFilterQa.cxx similarity index 69% rename from PWGCF/Tasks/dptdptfilterqa.cxx rename to PWGCF/Tasks/dptDptFilterQa.cxx index a8479d20d1a..ebb50785a61 100644 --- a/PWGCF/Tasks/dptdptfilterqa.cxx +++ b/PWGCF/Tasks/dptDptFilterQa.cxx @@ -9,7 +9,12 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file dptDptFilterQa.cxx +/// \brief basic checks for the behavior of the filter task +/// \author victor.gonzalez.sebastian@gmail.com + #include +#include #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisDataModel.h" @@ -30,12 +35,12 @@ namespace o2::analysis::dptdptfilterqa { typedef enum { kRECO = 0, kGEN } innerdatatype; -static constexpr std::string_view dirname[] = {"reconstructed/", "generated/"}; +static constexpr std::string_view Dirname[] = {"reconstructed/", "generated/"}; } // namespace o2::analysis::dptdptfilterqa // Checking the filtered tables -struct DptDptFilterQA { - Configurable cfgDataType{"datatype", "data", "Data type: data, MC, FastMC, OnTheFlyMC. Default data"}; +struct DptDptFilterQa { + Configurable cfgDataType{"cfgDataType", "data", "Data type: data, MC, FastMC, OnTheFlyMC. Default data"}; HistogramRegistry histos{"DptDptFilterQA", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; o2::analysis::dptdptfilter::DataType datatype; @@ -45,17 +50,17 @@ struct DptDptFilterQA { using namespace o2::analysis::dptdptfilterqa; - histos.add(TString::Format("%s%s", dirname[dir].data(), "TracksOne").Data(), "Tracks as track one", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); - histos.add(TString::Format("%s%s", dirname[dir].data(), "TracksTwo").Data(), "Tracks as track two", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); - histos.add(TString::Format("%s%s", dirname[dir].data(), "TracksOneAndTwo").Data(), "Tracks as track one and as track two", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); - histos.add(TString::Format("%s%s", dirname[dir].data(), "TracksNone").Data(), "Not selected tracks", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); - histos.add(TString::Format("%s%s", dirname[dir].data(), "TracksOneUnsel").Data(), "Tracks as track one", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); - histos.add(TString::Format("%s%s", dirname[dir].data(), "TracksTwoUnsel").Data(), "Tracks as track two", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); - histos.add(TString::Format("%s%s", dirname[dir].data(), "TracksOneAndTwoUnsel").Data(), "Tracks as track one and as track two", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); - histos.add(TString::Format("%s%s", dirname[dir].data(), "TracksNoneUnsel").Data(), "Not selected tracks", kTH1F, {{1500, 0.0, 1500.0}}); - histos.add(TString::Format("%s%s", dirname[dir].data(), "SelectedEvents").Data(), "Selected events", kTH1F, {{2, 0.0, 2.0}}); - histos.get(HIST(dirname[dir]) + HIST("SelectedEvents"))->GetXaxis()->SetBinLabel(1, "Not selected events"); - histos.get(HIST(dirname[dir]) + HIST("SelectedEvents"))->GetXaxis()->SetBinLabel(2, "Selected events"); + histos.add(TString::Format("%s%s", Dirname[dir].data(), "TracksOne").Data(), "Tracks as track one", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); + histos.add(TString::Format("%s%s", Dirname[dir].data(), "TracksTwo").Data(), "Tracks as track two", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); + histos.add(TString::Format("%s%s", Dirname[dir].data(), "TracksOneAndTwo").Data(), "Tracks as track one and as track two", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); + histos.add(TString::Format("%s%s", Dirname[dir].data(), "TracksNone").Data(), "Not selected tracks", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); + histos.add(TString::Format("%s%s", Dirname[dir].data(), "TracksOneUnsel").Data(), "Tracks as track one", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); + histos.add(TString::Format("%s%s", Dirname[dir].data(), "TracksTwoUnsel").Data(), "Tracks as track two", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); + histos.add(TString::Format("%s%s", Dirname[dir].data(), "TracksOneAndTwoUnsel").Data(), "Tracks as track one and as track two", kTH1F, {{1500, 0.0, 1500.0, "number of tracks"}}); + histos.add(TString::Format("%s%s", Dirname[dir].data(), "TracksNoneUnsel").Data(), "Not selected tracks", kTH1F, {{1500, 0.0, 1500.0}}); + histos.add(TString::Format("%s%s", Dirname[dir].data(), "SelectedEvents").Data(), "Selected events", kTH1F, {{2, 0.0, 2.0}}); + histos.get(HIST(Dirname[dir]) + HIST("SelectedEvents"))->GetXaxis()->SetBinLabel(1, "Not selected events"); + histos.get(HIST(Dirname[dir]) + HIST("SelectedEvents"))->GetXaxis()->SetBinLabel(2, "Selected events"); }; void init(InitContext const&) @@ -88,40 +93,40 @@ struct DptDptFilterQA { using namespace o2::analysis::dptdptfilterqa; if (collision.collisionaccepted() != uint8_t(true)) { - histos.fill(HIST(dirname[dir]) + HIST("SelectedEvents"), 0.5); + histos.fill(HIST(Dirname[dir]) + HIST("SelectedEvents"), 0.5); } else { - histos.fill(HIST(dirname[dir]) + HIST("SelectedEvents"), 1.5); + histos.fill(HIST(Dirname[dir]) + HIST("SelectedEvents"), 1.5); } - int ntracks_one = 0; - int ntracks_two = 0; - int ntracks_one_and_two = 0; - int ntracks_none = 0; - for (auto& track : tracks) { + int nTracksOne = 0; + int nTracksTwo = 0; + int nTracksOneAndTwo = 0; + int nTracksNone = 0; + for (auto const& track : tracks) { if (!(track.trackacceptedid() < 0) && !(track.trackacceptedid() < 2)) { LOGF(fatal, "Task not prepared for identified particles"); } if (track.trackacceptedid() != 0 && track.trackacceptedid() != 1) { - ntracks_none++; + nTracksNone++; } if (track.trackacceptedid() == 0) { - ntracks_one++; + nTracksOne++; } if (track.trackacceptedid() == 1) { - ntracks_two++; + nTracksTwo++; } } if (collision.collisionaccepted() != uint8_t(true)) { /* control for non selected events */ - histos.fill(HIST(dirname[dir]) + HIST("TracksOneUnsel"), ntracks_one); - histos.fill(HIST(dirname[dir]) + HIST("TracksTwoUnsel"), ntracks_two); - histos.fill(HIST(dirname[dir]) + HIST("TracksNoneUnsel"), ntracks_none); - histos.fill(HIST(dirname[dir]) + HIST("TracksOneAndTwoUnsel"), ntracks_one_and_two); + histos.fill(HIST(Dirname[dir]) + HIST("TracksOneUnsel"), nTracksOne); + histos.fill(HIST(Dirname[dir]) + HIST("TracksTwoUnsel"), nTracksTwo); + histos.fill(HIST(Dirname[dir]) + HIST("TracksNoneUnsel"), nTracksNone); + histos.fill(HIST(Dirname[dir]) + HIST("TracksOneAndTwoUnsel"), nTracksOneAndTwo); } else { - histos.fill(HIST(dirname[dir]) + HIST("TracksOne"), ntracks_one); - histos.fill(HIST(dirname[dir]) + HIST("TracksTwo"), ntracks_two); - histos.fill(HIST(dirname[dir]) + HIST("TracksNone"), ntracks_none); - histos.fill(HIST(dirname[dir]) + HIST("TracksOneAndTwo"), ntracks_one_and_two); + histos.fill(HIST(Dirname[dir]) + HIST("TracksOne"), nTracksOne); + histos.fill(HIST(Dirname[dir]) + HIST("TracksTwo"), nTracksTwo); + histos.fill(HIST(Dirname[dir]) + HIST("TracksNone"), nTracksNone); + histos.fill(HIST(Dirname[dir]) + HIST("TracksOneAndTwo"), nTracksOneAndTwo); } } @@ -134,7 +139,7 @@ struct DptDptFilterQA { LOGF(DPTDPTFILTERLOGCOLLISIONS, "New filtered generated collision with BC id %d and with %d accepted tracks", collision.bcId(), tracks.size()); processQATask(collision, tracks); } - PROCESS_SWITCH(DptDptFilterQA, processGeneratorLevel, "Process generator level filter task QA", true); + PROCESS_SWITCH(DptDptFilterQa, processGeneratorLevel, "Process generator level filter task QA", true); void processDetectorLevel(soa::Filtered::iterator const& collision, soa::Filtered const& tracks) { @@ -142,11 +147,11 @@ struct DptDptFilterQA { LOGF(DPTDPTFILTERLOGCOLLISIONS, "New filtered collision with BC id %d and with %d accepted tracks", collision.bcId(), tracks.size()); processQATask(collision, tracks); } - PROCESS_SWITCH(DptDptFilterQA, processDetectorLevel, "Process detector level filter task QA", true); + PROCESS_SWITCH(DptDptFilterQa, processDetectorLevel, "Process detector level filter task QA", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; return workflow; } diff --git a/PWGCF/Tasks/match-reco-gen.cxx b/PWGCF/Tasks/matchRecoGen.cxx similarity index 80% rename from PWGCF/Tasks/match-reco-gen.cxx rename to PWGCF/Tasks/matchRecoGen.cxx index 0162083350a..4e1022acd2f 100644 --- a/PWGCF/Tasks/match-reco-gen.cxx +++ b/PWGCF/Tasks/matchRecoGen.cxx @@ -9,12 +9,17 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file matchRecoGen.cxx +/// \brief basic check for the matching between generator level and detector level +/// \author victor.gonzalez.sebastian@gmail.com + #include #include #include #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" @@ -57,27 +62,27 @@ TpcExcludeTrack tpcExcluder; ///< the TPC excluder object instance } // namespace o2::analysis::dptdptfilter /// \brief Checks the correspondence generator level <=> detector level -struct CheckGeneratorLevelVsDetectorLevel { - Configurable cfgTrackType{"trktype", 1, "Type of selected tracks: 0 = no selection, 1 = global tracks FB96"}; - Configurable cfgCentMultEstimator{"centmultestimator", "V0M", "Centrality/multiplicity estimator detector: V0M, NOCM: none. Default V0M"}; - Configurable cfgSystem{"syst", "PbPb", "System: pp, PbPb, Pbp, pPb, XeXe, ppRun3. Default PbPb"}; - Configurable cfgDataType{"datatype", "data", "Data type: data, datanoevsel, MC, FastMC, OnTheFlyMC. Default data"}; - Configurable cfgTriggSel{"triggsel", "MB", "Trigger selection: MB, None. Default MB"}; - Configurable cfgOverallMinP{"overallminp", 0.0f, "The overall minimum momentum for the analysis. Default: 0.0"}; - Configurable cfgBinning{"binning", +struct MatchRecoGen { + Configurable cfgTrackType{"cfgTrackType", 1, "Type of selected tracks: 0 = no selection, 1 = global tracks FB96"}; + Configurable cfgCentMultEstimator{"cfgCentMultEstimator", "V0M", "Centrality/multiplicity estimator detector: V0M, NOCM: none. Default V0M"}; + Configurable cfgSystem{"cfgSystem", "PbPb", "System: pp, PbPb, Pbp, pPb, XeXe, ppRun3. Default PbPb"}; + Configurable cfgDataType{"cfgDataType", "data", "Data type: data, datanoevsel, MC, FastMC, OnTheFlyMC. Default data"}; + Configurable cfgTriggSel{"cfgTriggSel", "MB", "Trigger selection: MB, None. Default MB"}; + Configurable cfgOverallMinP{"cfgOverallMinP", 0.0f, "The overall minimum momentum for the analysis. Default: 0.0"}; + Configurable cfgBinning{"cfgBinning", {28, -7.0, 7.0, 18, 0.2, 2.0, 16, -0.8, 0.8, 72, 0.5}, "triplets - nbins, min, max - for z_vtx, pT, eta and phi, binning plus bin fraction of phi origin shift"}; struct : ConfigurableGroup { std::string prefix = "cfgTpcExclusion"; Configurable method{"method", 0, "The method for excluding tracks within the TPC. 0: no exclusion; 1: static; 2: dynamic. Default: 0"}; } cfgTpcExclusion; - Configurable cfgTraceDCAOutliers{"trackdcaoutliers", {false, 0.0, 0.0}, "Track the generator level DCAxy outliers: false/true, low dcaxy, up dcaxy. Default {false,0.0,0.0}"}; - Configurable cfgTraceOutOfSpeciesParticles{"trackoutparticles", false, "Track the particles which are not e,mu,pi,K,p: false/true. Default false"}; - Configurable cfgRecoIdMethod{"recoidmethod", 0, "Method for identifying reconstructed tracks: 0 PID, 1 mcparticle. Default 0"}; - Configurable cfgTuneTrackSelection{"tunetracksel", {}, "Track selection: {useit: true/false, tpccls-useit, tpcxrws-useit, tpcxrfc-useit, dcaxy-useit, dcaz-useit}. Default {false,0.70,false,0.8,false,2.4,false,3.2,false}"}; - Configurable cfgTraceCollId0{"tracecollid0", false, "Trace particles in collisions id 0. Default false"}; - Configurable cfgTrackMultiRec{"trackmultirec", false, "Track muli-reconstructed particles: true, false. Default false"}; - Configurable cfgTrackCollAssoc{"trackcollassoc", false, "Track collision id association, track-mcparticle-mccollision vs. track-collision-mccollision: true, false. Default false"}; + Configurable cfgTraceDCAOutliers{"cfgTraceDCAOutliers", {false, 0.0, 0.0}, "Track the generator level DCAxy outliers: false/true, low dcaxy, up dcaxy. Default {false,0.0,0.0}"}; + Configurable cfgTraceOutOfSpeciesParticles{"cfgTraceOutOfSpeciesParticles", false, "Track the particles which are not e,mu,pi,K,p: false/true. Default false"}; + Configurable cfgRecoIdMethod{"cfgRecoIdMethod", 0, "Method for identifying reconstructed tracks: 0 PID, 1 mcparticle. Default 0"}; + Configurable cfgTuneTrackSelection{"cfgTuneTrackSelection", {}, "Track selection: {useit: true/false, tpccls-useit, tpcxrws-useit, tpcxrfc-useit, dcaxy-useit, dcaz-useit}. Default {false,0.70,false,0.8,false,2.4,false,3.2,false}"}; + Configurable cfgTraceCollId0{"cfgTraceCollId0", false, "Trace particles in collisions id 0. Default false"}; + Configurable cfgTrackMultiRec{"cfgTrackMultiRec", false, "Track muli-reconstructed particles: true, false. Default false"}; + Configurable cfgTrackCollAssoc{"cfgTrackCollAssoc", false, "Track collision id association, track-mcparticle-mccollision vs. track-collision-mccollision: true, false. Default false"}; HistogramRegistry histos{"RecoGenHistograms", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; Service fPDG; @@ -186,23 +191,23 @@ struct CheckGeneratorLevelVsDetectorLevel { { using namespace o2::analysis::recogenmap; - static constexpr std::string_view dir[] = {"before/", "after/"}; - static constexpr std::string_view colldir[] = {"positivecolid/", "negativecolid/"}; + static constexpr std::string_view Dir[] = {"before/", "after/"}; + static constexpr std::string_view Colldir[] = {"positivecolid/", "negativecolid/"}; - int nrec_poslabel = 0; - int nrec_neglabel = 0; - int nrec_poslabel_crosscoll = 0; + int nRecPosLabel = 0; + int nRecNegLabel = 0; + int nRecPosLabelCrossColl = 0; for (int ixpart = 0; ixpart < mcParticles.size(); ++ixpart) { auto particle = mcParticles.iteratorAt(ixpart); /* multireconstructed tracks only for positive labels */ int nrec = mclabelpos[collsign][ixpart].size(); - nrec_poslabel += mclabelpos[collsign][ixpart].size(); - nrec_neglabel += mclabelneg[collsign][ixpart].size(); + nRecPosLabel += mclabelpos[collsign][ixpart].size(); + nRecNegLabel += mclabelneg[collsign][ixpart].size(); if (nrec > 1) { /* multireconstruction only from positive labels */ - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("multirec"), nrec); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("multirec"), nrec); if (collsign == kPOSITIVE) { /* check the cross collision reconstruction */ @@ -216,7 +221,7 @@ struct CheckGeneratorLevelVsDetectorLevel { auto track2 = tracks.iteratorAt(mclabelpos[collsign][ixpart][j]); if (track1.collisionId() != track2.collisionId()) { - nrec_poslabel_crosscoll++; + nRecPosLabelCrossColl++; crosscollfound = true; } } @@ -255,7 +260,7 @@ struct CheckGeneratorLevelVsDetectorLevel { "END multi-reconstructed: " "=================================================================="); } - histos.get(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("pdgcodemr")) + histos.get(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("pdgcodemr")) ->Fill(TString::Format("%d", particle.pdgCode()).Data(), 1.0); } } @@ -267,52 +272,47 @@ struct CheckGeneratorLevelVsDetectorLevel { float deltaeta = track1.eta() - track2.eta(); float deltaphi = track1.phi() - track2.phi(); - if (deltaphi < 0) { - deltaphi += constants::math::TwoPI; - } - if (deltaphi > constants::math::TwoPI) { - deltaphi -= constants::math::TwoPI; - } + deltaphi = RecoDecay::constrainAngle(deltaphi, 0.0f); float deltapt = (track1.pt() > track2.pt()) ? track1.pt() - track2.pt() : track2.pt() - track1.pt(); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("mrDeltaEta"), deltaeta); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("mrDeltaPhi"), deltaphi); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("mrDeltaPt"), deltapt); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("mrDeltaEta"), deltaeta); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("mrDeltaPhi"), deltaphi); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("mrDeltaPt"), deltapt); } - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("recomreta"), track1.eta()); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("recomrphi"), track1.phi()); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("recomrpt"), track1.pt()); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("detectormapmr"), track1.detectorMap()); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("dcaxymr"), track1.dcaXY()); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("dcazmr"), track1.dcaZ()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("recomreta"), track1.eta()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("recomrphi"), track1.phi()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("recomrpt"), track1.pt()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("detectormapmr"), track1.detectorMap()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("dcaxymr"), track1.dcaXY()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("dcazmr"), track1.dcaZ()); if (track1.dcaXY() < 1.0) { - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("finedcaxymr"), track1.dcaXY()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("finedcaxymr"), track1.dcaXY()); } if (track1.dcaZ() < 1.0) { - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("finedcazmr"), track1.dcaZ()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("finedcazmr"), track1.dcaZ()); } - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("genrecomreta"), track1.eta(), particle.eta()); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("genrecomrphi"), track1.phi(), particle.phi()); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("genrecomrpt"), track1.pt(), particle.pt()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("genrecomreta"), track1.eta(), particle.eta()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("genrecomrphi"), track1.phi(), particle.phi()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("genrecomrpt"), track1.pt(), particle.pt()); if (particle.mcCollisionId() != colls.iteratorAt(track1.collisionId()).mcCollisionId()) { - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("matchcollidmr"), static_cast(kDONTMATCH) + 0.5f); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("matchcollidmr"), static_cast(kDONTMATCH) + 0.5f); } else { - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("matchcollidmr"), static_cast(kMATCH) + 0.5f); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("matchcollidmr"), static_cast(kMATCH) + 0.5f); } } } else if (nrec > 0) { auto track = tracks.iteratorAt(mclabelpos[collsign][ixpart][0]); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("genrecoeta"), track.eta(), particle.eta()); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("genrecophi"), track.phi(), particle.phi()); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("genrecopt"), track.pt(), particle.pt()); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("detectormap"), track.detectorMap()); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("dcaxy"), track.dcaXY()); - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("dcaz"), track.dcaZ()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("genrecoeta"), track.eta(), particle.eta()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("genrecophi"), track.phi(), particle.phi()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("genrecopt"), track.pt(), particle.pt()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("detectormap"), track.detectorMap()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("dcaxy"), track.dcaXY()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("dcaz"), track.dcaZ()); if (track.dcaXY() < 1.0) { - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("finedcaxy"), track.dcaXY()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("finedcaxy"), track.dcaXY()); } if (track.dcaZ() < 1.0) { - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("finedcaz"), track.dcaZ()); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("finedcaz"), track.dcaZ()); } if (particle.mcCollisionId() != colls.iteratorAt(track.collisionId()).mcCollisionId()) { if ((ba == kAFTER) && (collsign == kPOSITIVE) && cfgTrackCollAssoc) { @@ -322,19 +322,19 @@ struct CheckGeneratorLevelVsDetectorLevel { LOGF(info, " associated to track with index %d and label %d assigned to collision %d, with associated MC collision %d", track.globalIndex(), ixpart, track.collisionId(), colls.iteratorAt(track.collisionId()).mcCollisionId()); } - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("matchcollid"), static_cast(kDONTMATCH) + 0.5f); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("matchcollid"), static_cast(kDONTMATCH) + 0.5f); } else { - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("matchcollid"), static_cast(kMATCH) + 0.5f); + histos.fill(HIST(Dir[ba]) + HIST(Colldir[collsign]) + HIST("matchcollid"), static_cast(kMATCH) + 0.5f); } } } if (collsign == kPOSITIVE) { LOGF(info, "Reconstructed tracks (%s) with positive collision ID: %d with positive label, %d with negative label, %d with cross collision", - ba == kAFTER ? "after" : "before", nrec_poslabel, nrec_neglabel, nrec_poslabel_crosscoll); + ba == kAFTER ? "after" : "before", nRecPosLabel, nRecNegLabel, nRecPosLabelCrossColl); } else { LOGF(info, "Reconstructed tracks (%s) with negative collision ID: %d with positive label, %d with negative label", - ba == kAFTER ? "after" : "before", nrec_poslabel, nrec_neglabel); + ba == kAFTER ? "after" : "before", nRecPosLabel, nRecNegLabel); } } @@ -368,7 +368,7 @@ struct CheckGeneratorLevelVsDetectorLevel { // For the time being we are only interested in the information based on the reconstructed tracks LOGF(info, "New dataframe (DF) with %d generated charged particles and %d reconstructed tracks", ngen, nreco); - for (auto& track : tracks) { + for (auto const& track : tracks) { int64_t recix = track.globalIndex(); int32_t label = track.mcParticleId(); @@ -408,7 +408,7 @@ struct CheckGeneratorLevelVsDetectorLevel { size_t nreco = 0; size_t ngen = 0; - for (auto& part : mcParticles) { + for (auto const& part : mcParticles) { auto pdgpart = fPDG->GetParticle(part.pdgCode()); if (pdgpart != nullptr) { float charge = getCharge(pdgpart->Charge()); @@ -419,7 +419,7 @@ struct CheckGeneratorLevelVsDetectorLevel { } // Let's go through the reco-gen mapping to detect multi-reconstructed particles - for (auto& track : tracks) { + for (auto const& track : tracks) { int64_t recix = track.globalIndex(); int32_t label = track.mcParticleId(); if (!(label < 0)) { @@ -450,7 +450,7 @@ struct CheckGeneratorLevelVsDetectorLevel { processMapChecksBeforeCuts(tracks, collisions, mcParticles); processMapChecksAfterCuts(tracks, collisions, mcParticles); } - PROCESS_SWITCH(CheckGeneratorLevelVsDetectorLevel, processMapChecksWithCent, "Process detector <=> generator levels with centrality/multiplicity information", false); + PROCESS_SWITCH(MatchRecoGen, processMapChecksWithCent, "Process detector <=> generator levels with centrality/multiplicity information", false); void processMapChecksWithoutCent(soa::Join const& tracks, soa::Join const& collisions, @@ -459,11 +459,11 @@ struct CheckGeneratorLevelVsDetectorLevel { processMapChecksBeforeCuts(tracks, collisions, mcParticles); processMapChecksAfterCuts(tracks, collisions, mcParticles); } - PROCESS_SWITCH(CheckGeneratorLevelVsDetectorLevel, processMapChecksWithoutCent, "Process detector <=> generator levels without centrality/multiplicity information", true); + PROCESS_SWITCH(MatchRecoGen, processMapChecksWithoutCent, "Process detector <=> generator levels without centrality/multiplicity information", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; return workflow; } From 079497d248d5180e2a2b28dbcb6be8bcb54b8e44 Mon Sep 17 00:00:00 2001 From: Giorgio Alberto Lucia <87222843+GiorgioAlbertoLucia@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:58:35 +0100 Subject: [PATCH 454/459] [PWGLF] invariant mass histogram extended (#9068) --- PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx b/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx index 5f05fb4fa1d..860272354c4 100644 --- a/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx +++ b/PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx @@ -239,7 +239,7 @@ struct he3hadronfemto { {"hEmptyPool", "svPoolCreator did not find track pairs false/true", {HistType::kTH1F, {{2, -0.5, 1.5}}}}, {"hDCAxyHe3", ";DCA_{xy} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, {"hDCAzHe3", ";DCA_{z} (cm)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, - {"hhe3HadtInvMass", "; M(^{3}He + p) (GeV/#it{c}^{2})", {HistType::kTH1F, {{50, 3.74f, 3.85f}}}}, + {"hhe3HadtInvMass", "; M(^{3}He + p) (GeV/#it{c}^{2})", {HistType::kTH1F, {{300, 3.74f, 4.34f}}}}, {"hHe3Pt", "#it{p}_{T} distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}}, {"hHadronPt", "Pt distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, {"h2dEdxHe3candidates", "dEdx distribution; #it{p} (GeV/#it{c}); dE/dx (a.u.)", {HistType::kTH2F, {{200, -5.0f, 5.0f}, {100, 0.0f, 2000.0f}}}}, From b02524364a41d96b3635aadd61e0869b38bbca44 Mon Sep 17 00:00:00 2001 From: Pritam Chakraborty <47203359+prchakra@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:50:51 +0100 Subject: [PATCH 455/459] [PWGCF] FemtoUniverse: Changing binning of QA histogram (#9065) --- PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h index 627587a0c18..36e81e81e76 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h @@ -36,9 +36,9 @@ class FemtoUniverseEventHisto { mHistogramRegistry = registry; mHistogramRegistry->add("Event/zvtxhist", "; vtx_{z} (cm); Entries", kTH1F, {{250, -12.5, 12.5}}); - mHistogramRegistry->add("Event/MultV0M", "; vMultV0M; Entries", kTH1F, {{1500, 0, 30000}}); + mHistogramRegistry->add("Event/MultV0M", "; vMultV0M; Entries", kTH1F, {{2000, 0, 20000}}); mHistogramRegistry->add("Event/MultNTr", "; vMultNTr; Entries", kTH1F, {{20, 0, 200}}); - mHistogramRegistry->add("Event/MultNTrVSMultV0M", "; vMultNTr; MultV0M", kTH2F, {{200, 0, 4000}, {1500, 0, 30000}}); + mHistogramRegistry->add("Event/MultNTrVSMultV0M", "; vMultNTr; MultV0M", kTH2F, {{200, 0, 4000}, {2000, 0, 20000}}); mHistogramRegistry->add("Event/zvtxhist_MultNTr", "; zvtxhist; MultNTr", kTH2F, {{250, -12.5, 12.5}, {20, 0, 200}}); } From fafee751b487a1e1e4395c8a76f850dc490076d6 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Thu, 19 Dec 2024 21:24:02 +0100 Subject: [PATCH 456/459] [Common] add Run2BCInfos converter (#9064) Co-authored-by: ALICE Builder --- .../TableProducer/Converters/CMakeLists.txt | 6 +++ .../Converters/run2bcinfosConverter.cxx | 40 +++++++++++++++++++ .../Converters/run2tracksExtraConverter.cxx | 10 ----- 3 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 Common/TableProducer/Converters/run2bcinfosConverter.cxx diff --git a/Common/TableProducer/Converters/CMakeLists.txt b/Common/TableProducer/Converters/CMakeLists.txt index 0033b60c940..646a0b5ade9 100644 --- a/Common/TableProducer/Converters/CMakeLists.txt +++ b/Common/TableProducer/Converters/CMakeLists.txt @@ -94,7 +94,13 @@ o2physics_add_dpl_workflow(trackqa-converter-002 PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(run2bcinfos-converter + SOURCES run2bcinfosConverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(run2-tracks-extra-converter SOURCES run2tracksExtraConverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + diff --git a/Common/TableProducer/Converters/run2bcinfosConverter.cxx b/Common/TableProducer/Converters/run2bcinfosConverter.cxx new file mode 100644 index 00000000000..6257d371824 --- /dev/null +++ b/Common/TableProducer/Converters/run2bcinfosConverter.cxx @@ -0,0 +1,40 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" + +using namespace o2; +using namespace o2::framework; + +struct Run2BCInfosConverter { + Produces Run2BCInfos_001; + void process(aod::Run2BCInfos_000 const& Run2BCInfos_000) + { + + for (const auto& entry : Run2BCInfos_000) { + Run2BCInfos_001(entry.eventCuts(), + entry.triggerMaskNext50(), entry.l0TriggerInputMask(), + entry.spdClustersL0(), entry.spdClustersL1(), + entry.spdFiredChipsL0(), entry.spdFiredChipsL1(), + entry.spdFiredFastOrL0(), entry.spdFiredFastOrL1(), + entry.v0TriggerChargeA(), entry.v0TriggerChargeC(), + 0, 0); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/Common/TableProducer/Converters/run2tracksExtraConverter.cxx b/Common/TableProducer/Converters/run2tracksExtraConverter.cxx index 2cb11174ef4..28ae54c4367 100644 --- a/Common/TableProducer/Converters/run2tracksExtraConverter.cxx +++ b/Common/TableProducer/Converters/run2tracksExtraConverter.cxx @@ -9,16 +9,6 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file tracksExtraConverter.cxx -/// \brief Converts TracksExtra table from version 000 to 001 - -/// This task allows for the conversion of the TracksExtra table from version 000 to 001. -/// The conversion is needed because the table has been extended with the ITSClusterSize column -/// and the ITSClusterMap column is evaluated dynamically from it. -/// In the converter a dummy ITSClusterSize column is filled with overflows if a hit in the layer is present - -/// \author F.Mazzaschi - #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" From 6f82954dcdc37d824c351ca16a370314399886ae Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Thu, 19 Dec 2024 22:33:35 +0100 Subject: [PATCH 457/459] [Infrastructure] Update code owners for AOT-Tracks. (#9057) Co-authored-by: Mattia Faggin --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 5974be54430..ea2fc514796 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -17,7 +17,7 @@ /ALICE3 @alibuild @njacazio @hscheid /DPG @alibuild @chiarazampolli @alcaliva @catalinristea /DPG/Tasks/AOTEvent @alibuild @ekryshen @strogolo @altsybee -/DPG/Tasks/AOTTrack @alibuild @mfaggin @iouribelikov @njacazio +/DPG/Tasks/AOTTrack @alibuild @mfaggin @iouribelikov @njacazio @lbariogl @f3sch /DPG/Tasks/TOF @alibuild @noferini @njacazio /DPG/Tasks/FT0 @alibuild @afurs /EventFiltering @alibuild @mpuccio @lietava From 614b131d03e3777b4ba542c5c7e9e5e0e0718e3c Mon Sep 17 00:00:00 2001 From: mcoquet642 <74600025+mcoquet642@users.noreply.github.com> Date: Thu, 19 Dec 2024 23:13:28 +0100 Subject: [PATCH 458/459] [PWGDQ] Adding event selection flags to dimuonAll table (#9052) --- PWGDQ/Core/VarManager.h | 48 +++++++++++++------------- PWGDQ/DataModel/ReducedInfoTables.h | 2 ++ PWGDQ/Tasks/dqEfficiency.cxx | 1 + PWGDQ/Tasks/dqEfficiency_withAssoc.cxx | 2 ++ PWGDQ/Tasks/tableReader.cxx | 1 + PWGDQ/Tasks/tableReader_withAssoc.cxx | 2 ++ 6 files changed, 32 insertions(+), 24 deletions(-) diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index 4b0e1a7b52c..02a7ffa4929 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -1510,30 +1510,6 @@ void VarManager::FillEvent(T const& event, float* values) values[kVtxY] = event.posY(); values[kVtxZ] = event.posZ(); values[kVtxNcontrib] = event.numContrib(); - if (fgUsedVars[kIsNoITSROFBorder]) { - values[kIsNoITSROFBorder] = (event.selection_bit(o2::aod::evsel::kNoITSROFrameBorder) > 0); - } - if (fgUsedVars[kIsNoTFBorder]) { - values[kIsNoTFBorder] = (event.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) > 0); - } - if (fgUsedVars[kNoCollInTimeRangeStandard]) { - values[kNoCollInTimeRangeStandard] = (event.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard) > 0); - } - if (fgUsedVars[kIsNoSameBunch]) { - values[kIsNoSameBunch] = (event.selection_bit(o2::aod::evsel::kNoSameBunchPileup) > 0); - } - if (fgUsedVars[kIsGoodZvtxFT0vsPV]) { - values[kIsGoodZvtxFT0vsPV] = (event.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) > 0); - } - if (fgUsedVars[kIsVertexITSTPC]) { - values[kIsVertexITSTPC] = (event.selection_bit(o2::aod::evsel::kIsVertexITSTPC) > 0); - } - if (fgUsedVars[kIsVertexTOFmatched]) { - values[kIsVertexTOFmatched] = (event.selection_bit(o2::aod::evsel::kIsVertexTOFmatched) > 0); - } - if (fgUsedVars[kIsSel8]) { - values[kIsSel8] = event.selection_bit(o2::aod::evsel::kIsTriggerTVX) && event.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) && event.selection_bit(o2::aod::evsel::kNoITSROFrameBorder); - } if (fgUsedVars[kIsDoubleGap]) { values[kIsDoubleGap] = (event.tag_bit(56 + kDoubleGap) > 0); } @@ -1560,6 +1536,30 @@ void VarManager::FillEvent(T const& event, float* values) uint16_t bcInITSROF = (event.globalBC() + 3564 - fgITSROFbias) % fgITSROFlength; values[kIsNoITSROFBorderRecomputed] = bcInITSROF > fgITSROFBorderMarginLow && bcInITSROF < fgITSROFlength - fgITSROFBorderMarginHigh ? 1.0 : 0.0; } + if (fgUsedVars[kIsNoITSROFBorder]) { + values[kIsNoITSROFBorder] = (event.selection_bit(o2::aod::evsel::kNoITSROFrameBorder) > 0); + } + if (fgUsedVars[kIsNoTFBorder]) { + values[kIsNoTFBorder] = (event.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) > 0); + } + if (fgUsedVars[kNoCollInTimeRangeStandard]) { + values[kNoCollInTimeRangeStandard] = (event.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard) > 0); + } + if (fgUsedVars[kIsNoSameBunch]) { + values[kIsNoSameBunch] = (event.selection_bit(o2::aod::evsel::kNoSameBunchPileup) > 0); + } + if (fgUsedVars[kIsGoodZvtxFT0vsPV]) { + values[kIsGoodZvtxFT0vsPV] = (event.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) > 0); + } + if (fgUsedVars[kIsVertexITSTPC]) { + values[kIsVertexITSTPC] = (event.selection_bit(o2::aod::evsel::kIsVertexITSTPC) > 0); + } + if (fgUsedVars[kIsVertexTOFmatched]) { + values[kIsVertexTOFmatched] = (event.selection_bit(o2::aod::evsel::kIsVertexTOFmatched) > 0); + } + if (fgUsedVars[kIsSel8]) { + values[kIsSel8] = event.selection_bit(o2::aod::evsel::kIsTriggerTVX) && event.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) && event.selection_bit(o2::aod::evsel::kNoITSROFrameBorder); + } if (fgUsedVars[kIsINT7]) { values[kIsINT7] = (event.alias_bit(kINT7) > 0); } diff --git a/PWGDQ/DataModel/ReducedInfoTables.h b/PWGDQ/DataModel/ReducedInfoTables.h index f8f7b4e3161..86e38033136 100644 --- a/PWGDQ/DataModel/ReducedInfoTables.h +++ b/PWGDQ/DataModel/ReducedInfoTables.h @@ -641,6 +641,7 @@ DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, ReducedTracks, "_0"); //! Ind DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, ReducedTracks, "_1"); //! Index to second prong DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, Tracks, "_0"); //! Index of first prong in Tracks table DECLARE_SOA_INDEX_COLUMN_FULL(Prong1, prong1, int, Tracks, "_1"); //! Index of second prong in Tracks table +DECLARE_SOA_BITMAP_COLUMN(EventSelection, evSelection, 8); //! Event selection bits (ambiguity, splitting candidate) DECLARE_SOA_COLUMN(Mass, mass, float); //! DECLARE_SOA_COLUMN(Pt, pt, float); //! DECLARE_SOA_COLUMN(Eta, eta, float); //! @@ -783,6 +784,7 @@ DECLARE_SOA_TABLE(DielectronsAll, "AOD", "RTDIELECTRONALL", //! DECLARE_SOA_TABLE(DimuonsAll, "AOD", "RTDIMUONALL", //! collision::PosX, collision::PosY, collision::PosZ, collision::NumContrib, + evsel::Selection, reducedpair::EventSelection, reducedevent::MCPosX, reducedevent::MCPosY, reducedevent::MCPosZ, reducedpair::Mass, reducedpair::McDecision, diff --git a/PWGDQ/Tasks/dqEfficiency.cxx b/PWGDQ/Tasks/dqEfficiency.cxx index f8f2a992d61..8532525b834 100644 --- a/PWGDQ/Tasks/dqEfficiency.cxx +++ b/PWGDQ/Tasks/dqEfficiency.cxx @@ -840,6 +840,7 @@ struct AnalysisSameEventPairing { if constexpr ((TPairType == VarManager::kDecayToMuMu) && muonHasCov) { if (fConfigFlatTables.value) { dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(), + event.selection_raw(), 0, event.reducedMCevent().mcPosX(), event.reducedMCevent().mcPosY(), event.reducedMCevent().mcPosZ(), VarManager::fgValues[VarManager::kMass], dileptonMcDecision, diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index 7cdb426d55e..6829f0f4d83 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -1504,6 +1504,7 @@ struct AnalysisSameEventPairing { if (!event.isEventSelected_bit(0)) { continue; } + uint8_t evSel = event.isEventSelected_raw(); // Reset the fValues array VarManager::ResetValues(0, VarManager::kNVars); VarManager::FillEvent(event, VarManager::fgValues); @@ -1646,6 +1647,7 @@ struct AnalysisSameEventPairing { dimuonsExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]); if (fConfigOptions.flatTables.value) { dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(), + event.selection_raw(), evSel, -999., -999., -999., VarManager::fgValues[VarManager::kMass], mcDecision, diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index 8ed3cd6eeef..22fd38cb4ea 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -1308,6 +1308,7 @@ struct AnalysisSameEventPairing { dimuonExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]); if (fConfigFlatTables.value) { dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(), + event.selection_raw(), 0, -999., -999., -999., VarManager::fgValues[VarManager::kMass], false, diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 7d4c90fcefc..4f9980dd8e6 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -1423,6 +1423,7 @@ struct AnalysisSameEventPairing { if (!event.isEventSelected_bit(0)) { continue; } + uint8_t evSel = event.isEventSelected_raw(); // Reset the fValues array VarManager::ResetValues(0, VarManager::kNVars); VarManager::FillEvent(event, VarManager::fgValues); @@ -1548,6 +1549,7 @@ struct AnalysisSameEventPairing { dimuonsExtraList(t1.globalIndex(), t2.globalIndex(), VarManager::fgValues[VarManager::kVertexingTauz], VarManager::fgValues[VarManager::kVertexingLz], VarManager::fgValues[VarManager::kVertexingLxy]); if (fConfigOptions.flatTables.value) { dimuonAllList(event.posX(), event.posY(), event.posZ(), event.numContrib(), + event.selection_raw(), evSel, -999., -999., -999., VarManager::fgValues[VarManager::kMass], false, From 59be5fa56f4ef124a901774749311bdedc3b626c Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 20 Dec 2024 00:22:42 +0000 Subject: [PATCH 459/459] Please consider the following formatting changes --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 2 +- .../eventwiseConstituentSubtractor.cxx | 20 +++++------ PWGJE/TableProducer/rhoEstimator.cxx | 36 +++++++++---------- PWGLF/Tasks/Resonances/chk892flow.cxx | 2 +- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index e202302c950..64be0470a1f 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -1260,7 +1260,7 @@ struct QaEfficiency { for (const auto& mother : mothers) { for (const auto& pdgToCheck : mothersPDGs.value) { if (mother.pdgCode() == pdgToCheck) { - motherIsAccepted = true; // Mother matches the list of specified PDGs + motherIsAccepted = true; // Mother matches the list of specified PDGs hPtmotherGenerated[histogramIndex]->Fill(mother.pt()); // Fill generated pT for mother break; } diff --git a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx index c1c1dc19b54..574aee15fa9 100644 --- a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx +++ b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx @@ -164,17 +164,17 @@ struct eventWiseConstituentSubtractorTask { } PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processLcMcCollisions, "Fill table of subtracted tracks for collisions with Lc MCP candidates", false); - void processBplusCollisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) - { - analyseHF(tracks, candidates, trackSubtractedBplusTable); - } - PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processBplusCollisions, "Fill table of subtracted tracks for collisions with Bplus candidates", false); + void processBplusCollisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) + { + analyseHF(tracks, candidates, trackSubtractedBplusTable); + } + PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processBplusCollisions, "Fill table of subtracted tracks for collisions with Bplus candidates", false); - void processBplusMcCollisions(aod::JetMcCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) - { - analyseHFMc(tracks, candidates, particleSubtractedBplusTable); - } - PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processBplusMcCollisions, "Fill table of subtracted tracks for collisions with Bplus MCP candidates", false); + void processBplusMcCollisions(aod::JetMcCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) + { + analyseHFMc(tracks, candidates, particleSubtractedBplusTable); + } + PROCESS_SWITCH(eventWiseConstituentSubtractorTask, processBplusMcCollisions, "Fill table of subtracted tracks for collisions with Bplus MCP candidates", false); void processDielectronCollisions(aod::JetCollision const&, soa::Filtered const& tracks, soa::Join const& candidates) { diff --git a/PWGJE/TableProducer/rhoEstimator.cxx b/PWGJE/TableProducer/rhoEstimator.cxx index b8a74936bfd..047443a4cbb 100644 --- a/PWGJE/TableProducer/rhoEstimator.cxx +++ b/PWGJE/TableProducer/rhoEstimator.cxx @@ -153,31 +153,31 @@ struct RhoEstimatorTask { } PROCESS_SWITCH(RhoEstimatorTask, processLcMcCollisions, "Fill rho tables for collisions with Lc MCP candidates", false); - void processBplusCollisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesBplusData const& candidates) - { + void processBplusCollisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesBplusData const& candidates) + { + inputParticles.clear(); + for (auto& candidate : candidates) { inputParticles.clear(); - for (auto& candidate : candidates) { - inputParticles.clear(); - jetfindingutilities::analyseTracks(inputParticles, tracks, trackSelection, trackingEfficiency, std::optional{candidate}); + jetfindingutilities::analyseTracks(inputParticles, tracks, trackSelection, trackingEfficiency, std::optional{candidate}); - auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); - rhoBplusTable(rho, rhoM); - } + auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); + rhoBplusTable(rho, rhoM); } - PROCESS_SWITCH(RhoEstimatorTask, processBplusCollisions, "Fill rho tables for collisions with Bplus candidates", false); + } + PROCESS_SWITCH(RhoEstimatorTask, processBplusCollisions, "Fill rho tables for collisions with Bplus candidates", false); - void processBplusMcCollisions(aod::JetMcCollision const&, soa::Filtered const& particles, aod::CandidatesBplusMCP const& candidates) - { + void processBplusMcCollisions(aod::JetMcCollision const&, soa::Filtered const& particles, aod::CandidatesBplusMCP const& candidates) + { + inputParticles.clear(); + for (auto& candidate : candidates) { inputParticles.clear(); - for (auto& candidate : candidates) { - inputParticles.clear(); - jetfindingutilities::analyseParticles(inputParticles, particleSelection, 1, particles, pdgDatabase, std::optional{candidate}); + jetfindingutilities::analyseParticles(inputParticles, particleSelection, 1, particles, pdgDatabase, std::optional{candidate}); - auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); - rhoBplusMcTable(rho, rhoM); - } + auto [rho, rhoM] = bkgSub.estimateRhoAreaMedian(inputParticles, doSparse); + rhoBplusMcTable(rho, rhoM); } - PROCESS_SWITCH(RhoEstimatorTask, processBplusMcCollisions, "Fill rho tables for collisions with Bplus MCP candidates", false); + } + PROCESS_SWITCH(RhoEstimatorTask, processBplusMcCollisions, "Fill rho tables for collisions with Bplus MCP candidates", false); void processDielectronCollisions(aod::JetCollision const&, soa::Filtered const& tracks, aod::CandidatesDielectronData const& candidates) { diff --git a/PWGLF/Tasks/Resonances/chk892flow.cxx b/PWGLF/Tasks/Resonances/chk892flow.cxx index 06405f06d19..9498c938020 100644 --- a/PWGLF/Tasks/Resonances/chk892flow.cxx +++ b/PWGLF/Tasks/Resonances/chk892flow.cxx @@ -731,7 +731,7 @@ struct chk892flow { // Check bTrack first if (std::abs(motherbTrack.pdgCode()) != kKstarPlus) // Are you charged Kstar's daughter? - return false; // Apply first since it's more restrictive + return false; // Apply first since it's more restrictive if (std::abs(motherkV0.pdgCode()) != 310) // Is it K0s? return false;